From 51062863a5c34d81e296cf15c61140911037cf3b Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 6 Aug 2018 21:47:05 +0200 Subject: Use mod vendor for vendored directory (backwards compatible) --- vendor/github.com/42wim/go-gitter/.gitignore | 3 + vendor/github.com/42wim/go-gitter/README.md | 154 + vendor/github.com/42wim/go-ircevent/LICENSE | 27 - vendor/github.com/42wim/go-ircevent/irc.go | 578 - .../github.com/42wim/go-ircevent/irc_callback.go | 222 - vendor/github.com/42wim/go-ircevent/irc_sasl.go | 53 - vendor/github.com/42wim/go-ircevent/irc_struct.go | 76 - .../github.com/42wim/go-ircevent/irc_test_fuzz.go | 14 - vendor/github.com/BurntSushi/toml/.gitignore | 5 + vendor/github.com/BurntSushi/toml/.travis.yml | 15 + vendor/github.com/BurntSushi/toml/COMPATIBLE | 3 + vendor/github.com/BurntSushi/toml/Makefile | 19 + vendor/github.com/BurntSushi/toml/README.md | 218 + .../BurntSushi/toml/cmd/toml-test-decoder/main.go | 90 - .../BurntSushi/toml/cmd/toml-test-encoder/main.go | 131 - .../github.com/BurntSushi/toml/cmd/tomlv/main.go | 61 - vendor/github.com/BurntSushi/toml/session.vim | 1 + vendor/github.com/GeertJohan/go.rice/LICENSE | 22 - vendor/github.com/GeertJohan/go.rice/appended.go | 138 - vendor/github.com/GeertJohan/go.rice/box.go | 337 - vendor/github.com/GeertJohan/go.rice/config.go | 39 - vendor/github.com/GeertJohan/go.rice/debug.go | 4 - vendor/github.com/GeertJohan/go.rice/embedded.go | 90 - .../GeertJohan/go.rice/embedded/embedded.go | 80 - .../GeertJohan/go.rice/example/example.go | 69 - vendor/github.com/GeertJohan/go.rice/file.go | 144 - vendor/github.com/GeertJohan/go.rice/http.go | 21 - .../github.com/GeertJohan/go.rice/rice/append.go | 172 - vendor/github.com/GeertJohan/go.rice/rice/clean.go | 33 - .../github.com/GeertJohan/go.rice/rice/embed-go.go | 158 - .../GeertJohan/go.rice/rice/embed-syso.go | 204 - vendor/github.com/GeertJohan/go.rice/rice/find.go | 150 - vendor/github.com/GeertJohan/go.rice/rice/flags.go | 80 - .../GeertJohan/go.rice/rice/identifier.go | 14 - vendor/github.com/GeertJohan/go.rice/rice/main.go | 68 - .../GeertJohan/go.rice/rice/templates.go | 98 - vendor/github.com/GeertJohan/go.rice/rice/util.go | 22 - .../GeertJohan/go.rice/rice/writecoff.go | 42 - vendor/github.com/GeertJohan/go.rice/sort.go | 19 - vendor/github.com/GeertJohan/go.rice/virtual.go | 252 - vendor/github.com/GeertJohan/go.rice/walk.go | 122 - vendor/github.com/Philipp15b/go-steam/.gitignore | 22 + vendor/github.com/Philipp15b/go-steam/.gitmodules | 3 + vendor/github.com/Philipp15b/go-steam/README.md | 64 + .../Philipp15b/go-steam/community/community.go | 35 - .../go-steam/dota/protocol/protobuf/base.pb.go | 3651 -- .../dota/protocol/protobuf/dota_client.pb.go | 18413 ------- .../protocol/protobuf/dota_client_fantasy.pb.go | 6123 --- .../dota/protocol/protobuf/dota_common.pb.go | 10997 ---- .../go-steam/dota/protocol/protobuf/econ.pb.go | 4441 -- .../go-steam/dota/protocol/protobuf/gcsdk.pb.go | 1825 - .../go-steam/dota/protocol/protobuf/system.pb.go | 579 - .../go-steam/economy/inventory/inventory.go | 188 - .../go-steam/economy/inventory/inventory_apps.go | 79 - .../Philipp15b/go-steam/economy/inventory/own.go | 28 - .../go-steam/economy/inventory/partial.go | 91 - .../Philipp15b/go-steam/generator/generator.go | 295 - .../github.com/Philipp15b/go-steam/gsbot/gsbot.go | 210 - .../Philipp15b/go-steam/gsbot/gsbot/gsbot.go | 56 - .../github.com/Philipp15b/go-steam/jsont/jsont.go | 19 - .../go-steam/protocol/protobuf/unified/base.pb.go | 141 - .../go-steam/protocol/protobuf/unified/cloud.pb.go | 1424 - .../protocol/protobuf/unified/credentials.pb.go | 874 - .../protocol/protobuf/unified/deviceauth.pb.go | 694 - .../protobuf/unified/gamenotifications.pb.go | 850 - .../protocol/protobuf/unified/offline.pb.go | 163 - .../protocol/protobuf/unified/parental.pb.go | 791 - .../protocol/protobuf/unified/partnerapps.pb.go | 456 - .../protocol/protobuf/unified/player.pb.go | 586 - .../protocol/protobuf/unified/publishedfile.pb.go | 2702 - .../Philipp15b/go-steam/tf2/protocol/econ.go | 51 - .../go-steam/tf2/protocol/protobuf/base.pb.go | 3676 -- .../go-steam/tf2/protocol/protobuf/econ.pb.go | 1815 - .../go-steam/tf2/protocol/protobuf/gcsdk.pb.go | 1139 - .../go-steam/tf2/protocol/protobuf/system.pb.go | 545 - .../go-steam/tf2/protocol/protobuf/tf.pb.go | 7122 --- vendor/github.com/Philipp15b/go-steam/tf2/tf2.go | 75 - .../Philipp15b/go-steam/trade/actions.go | 84 - vendor/github.com/Philipp15b/go-steam/trade/doc.go | 40 - .../github.com/Philipp15b/go-steam/trade/trade.go | 122 - .../Philipp15b/go-steam/trade/tradeapi/status.go | 111 - .../Philipp15b/go-steam/trade/tradeapi/trade.go | 200 - .../github.com/Philipp15b/go-steam/trade/types.go | 67 - .../Philipp15b/go-steam/tradeoffer/client.go | 452 - .../Philipp15b/go-steam/tradeoffer/error.go | 19 - .../Philipp15b/go-steam/tradeoffer/escrow.go | 47 - .../Philipp15b/go-steam/tradeoffer/receipt.go | 35 - .../Philipp15b/go-steam/tradeoffer/tradeoffer.go | 118 - vendor/github.com/alecthomas/log4go/.gitignore | 2 + vendor/github.com/alecthomas/log4go/README | 14 + .../log4go/examples/ConsoleLogWriter_Manual.go | 14 - .../log4go/examples/FileLogWriter_Manual.go | 57 - .../log4go/examples/SimpleNetLogServer.go | 42 - .../log4go/examples/SocketLogWriter_Manual.go | 18 - .../log4go/examples/XMLConfigurationExample.go | 13 - vendor/github.com/armon/consul-api/LICENSE | 362 - vendor/github.com/armon/consul-api/acl.go | 140 - vendor/github.com/armon/consul-api/agent.go | 272 - vendor/github.com/armon/consul-api/api.go | 323 - vendor/github.com/armon/consul-api/catalog.go | 181 - vendor/github.com/armon/consul-api/event.go | 104 - vendor/github.com/armon/consul-api/health.go | 136 - vendor/github.com/armon/consul-api/kv.go | 219 - vendor/github.com/armon/consul-api/session.go | 204 - vendor/github.com/armon/consul-api/status.go | 43 - vendor/github.com/bwmarrin/discordgo/LICENSE | 28 - vendor/github.com/bwmarrin/discordgo/discord.go | 146 - vendor/github.com/bwmarrin/discordgo/endpoints.go | 136 - vendor/github.com/bwmarrin/discordgo/event.go | 238 - .../github.com/bwmarrin/discordgo/eventhandlers.go | 1030 - vendor/github.com/bwmarrin/discordgo/events.go | 253 - .../bwmarrin/discordgo/examples/airhorn/main.go | 211 - .../bwmarrin/discordgo/examples/appmaker/main.go | 103 - .../bwmarrin/discordgo/examples/avatar/main.go | 89 - .../bwmarrin/discordgo/examples/mytoken/main.go | 40 - .../bwmarrin/discordgo/examples/pingpong/main.go | 71 - vendor/github.com/bwmarrin/discordgo/logging.go | 103 - vendor/github.com/bwmarrin/discordgo/message.go | 252 - vendor/github.com/bwmarrin/discordgo/oauth2.go | 126 - vendor/github.com/bwmarrin/discordgo/ratelimit.go | 194 - vendor/github.com/bwmarrin/discordgo/restapi.go | 2049 - vendor/github.com/bwmarrin/discordgo/state.go | 990 - vendor/github.com/bwmarrin/discordgo/structs.go | 686 - .../discordgo/tools/cmd/eventhandlers/main.go | 124 - vendor/github.com/bwmarrin/discordgo/types.go | 58 - vendor/github.com/bwmarrin/discordgo/user.go | 47 - vendor/github.com/bwmarrin/discordgo/voice.go | 886 - vendor/github.com/bwmarrin/discordgo/wsapi.go | 845 - vendor/github.com/coreos/etcd/client/LICENSE | 202 - vendor/github.com/coreos/etcd/client/auth_role.go | 236 - vendor/github.com/coreos/etcd/client/auth_user.go | 319 - vendor/github.com/coreos/etcd/client/cancelreq.go | 18 - vendor/github.com/coreos/etcd/client/client.go | 710 - .../github.com/coreos/etcd/client/cluster_error.go | 37 - vendor/github.com/coreos/etcd/client/curl.go | 70 - vendor/github.com/coreos/etcd/client/discover.go | 40 - vendor/github.com/coreos/etcd/client/doc.go | 73 - .../coreos/etcd/client/integration/doc.go | 17 - .../coreos/etcd/client/keys.generated.go | 5218 -- vendor/github.com/coreos/etcd/client/keys.go | 681 - vendor/github.com/coreos/etcd/client/members.go | 303 - vendor/github.com/coreos/etcd/client/util.go | 53 - vendor/github.com/coreos/etcd/pkg/pathutil/LICENSE | 202 - vendor/github.com/coreos/etcd/pkg/pathutil/path.go | 31 - vendor/github.com/coreos/etcd/pkg/srv/LICENSE | 202 - vendor/github.com/coreos/etcd/pkg/srv/srv.go | 130 - vendor/github.com/coreos/etcd/pkg/types/LICENSE | 202 - vendor/github.com/coreos/etcd/pkg/types/doc.go | 17 - vendor/github.com/coreos/etcd/pkg/types/id.go | 41 - vendor/github.com/coreos/etcd/pkg/types/set.go | 178 - vendor/github.com/coreos/etcd/pkg/types/slice.go | 22 - vendor/github.com/coreos/etcd/pkg/types/urls.go | 82 - vendor/github.com/coreos/etcd/pkg/types/urlsmap.go | 107 - .../github.com/coreos/go-semver/semver/LICENSE | 202 - .../github.com/coreos/go-semver/semver/semver.go | 268 - .../github.com/coreos/go-semver/semver/sort.go | 38 - .../etcd/vendor/github.com/ugorji/go/codec/0doc.go | 185 - .../etcd/vendor/github.com/ugorji/go/codec/LICENSE | 202 - .../etcd/vendor/github.com/ugorji/go/codec/binc.go | 946 - .../etcd/vendor/github.com/ugorji/go/codec/cbor.go | 631 - .../vendor/github.com/ugorji/go/codec/decode.go | 2520 - .../vendor/github.com/ugorji/go/codec/encode.go | 1414 - .../ugorji/go/codec/fast-path.generated.go | 33034 ------------ .../github.com/ugorji/go/codec/fast-path.not.go | 35 - .../ugorji/go/codec/gen-helper.generated.go | 250 - .../github.com/ugorji/go/codec/gen.generated.go | 132 - .../etcd/vendor/github.com/ugorji/go/codec/gen.go | 2014 - .../ugorji/go/codec/goversion_arrayof_gte_go15.go | 14 - .../ugorji/go/codec/goversion_arrayof_lt_go15.go | 14 - .../ugorji/go/codec/goversion_makemap_gte_go19.go | 15 - .../ugorji/go/codec/goversion_makemap_lt_go19.go | 12 - .../go/codec/goversion_unsupported_lt_go14.go | 17 - .../ugorji/go/codec/goversion_vendor_eq_go15.go | 10 - .../ugorji/go/codec/goversion_vendor_eq_go16.go | 10 - .../ugorji/go/codec/goversion_vendor_gte_go17.go | 8 - .../ugorji/go/codec/goversion_vendor_lt_go15.go | 8 - .../vendor/github.com/ugorji/go/codec/helper.go | 1944 - .../github.com/ugorji/go/codec/helper_internal.go | 221 - .../ugorji/go/codec/helper_not_unsafe.go | 156 - .../github.com/ugorji/go/codec/helper_unsafe.go | 418 - .../etcd/vendor/github.com/ugorji/go/codec/json.go | 1172 - .../vendor/github.com/ugorji/go/codec/msgpack.go | 899 - .../etcd/vendor/github.com/ugorji/go/codec/noop.go | 214 - .../etcd/vendor/github.com/ugorji/go/codec/rpc.go | 187 - .../vendor/github.com/ugorji/go/codec/simple.go | 541 - .../etcd/vendor/github.com/ugorji/go/codec/time.go | 220 - .../etcd/vendor/github.com/ugorji/go/codec/xml.go | 426 - .../etcd/vendor/github.com/ugorji/go/codec/z.go | 23 - vendor/github.com/coreos/etcd/version/LICENSE | 202 - vendor/github.com/coreos/etcd/version/version.go | 56 - vendor/github.com/daaku/go.zipexe/license | 21 - vendor/github.com/daaku/go.zipexe/zipexe.go | 142 - vendor/github.com/davecgh/go-spew/LICENSE | 15 + vendor/github.com/davecgh/go-spew/spew/LICENSE | 15 - vendor/github.com/dfordsoft/golib/LICENSE | 21 + vendor/github.com/dfordsoft/golib/ic/LICENSE | 21 - vendor/github.com/dgrijalva/jwt-go/.gitignore | 4 + vendor/github.com/dgrijalva/jwt-go/.travis.yml | 13 + .../github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md | 97 + vendor/github.com/dgrijalva/jwt-go/README.md | 85 + .../github.com/dgrijalva/jwt-go/VERSION_HISTORY.md | 105 + vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go | 282 - vendor/github.com/dgrijalva/jwt-go/cmd/jwt/args.go | 23 - vendor/github.com/dgrijalva/jwt-go/request/doc.go | 7 - .../dgrijalva/jwt-go/request/extractor.go | 81 - .../github.com/dgrijalva/jwt-go/request/oauth2.go | 28 - .../github.com/dgrijalva/jwt-go/request/request.go | 24 - vendor/github.com/dgrijalva/jwt-go/test/helpers.go | 42 - vendor/github.com/facebookgo/clock/LICENSE | 21 - vendor/github.com/facebookgo/clock/clock.go | 363 - .../github.com/facebookgo/grace/gracehttp/http.go | 190 - .../github.com/facebookgo/grace/gracehttp/license | 30 - .../github.com/facebookgo/grace/gracenet/license | 30 - vendor/github.com/facebookgo/grace/gracenet/net.go | 252 - vendor/github.com/facebookgo/httpdown/httpdown.go | 376 - .../facebookgo/httpdown/httpdown_example/main.go | 43 - vendor/github.com/facebookgo/httpdown/license | 30 - vendor/github.com/facebookgo/stats/aggregation.go | 35 - vendor/github.com/facebookgo/stats/counter.go | 112 - vendor/github.com/facebookgo/stats/license | 30 - vendor/github.com/facebookgo/stats/stats.go | 166 - vendor/github.com/facebookgo/stats/stopper.go | 17 - vendor/github.com/fsnotify/fsnotify/.editorconfig | 5 + vendor/github.com/fsnotify/fsnotify/.gitignore | 6 + vendor/github.com/fsnotify/fsnotify/.travis.yml | 30 + vendor/github.com/fsnotify/fsnotify/AUTHORS | 52 + vendor/github.com/fsnotify/fsnotify/CHANGELOG.md | 317 + .../github.com/fsnotify/fsnotify/CONTRIBUTING.md | 77 + vendor/github.com/fsnotify/fsnotify/README.md | 79 + .../telegram-bot-api/.gitignore | 2 + .../telegram-bot-api/.travis.yml | 5 + .../go-telegram-bot-api/telegram-bot-api/README.md | 118 + vendor/github.com/golang/protobuf/AUTHORS | 3 + vendor/github.com/golang/protobuf/CONTRIBUTORS | 3 + vendor/github.com/golang/protobuf/LICENSE | 31 + vendor/github.com/golang/protobuf/proto/LICENSE | 31 - vendor/github.com/golang/protobuf/proto/Makefile | 43 + .../protobuf/proto/proto3_proto/proto3.pb.go | 347 - .../protobuf/protoc-gen-go/descriptor/LICENSE | 31 - .../protobuf/protoc-gen-go/descriptor/Makefile | 36 + .../github.com/golang/protobuf/ptypes/any/LICENSE | 31 - .../golang/protobuf/ptypes/any/any.pb.go | 168 - .../github.com/google/go-querystring/query/LICENSE | 27 - .../google/go-querystring/query/encode.go | 320 - vendor/github.com/google/gops/LICENSE | 27 + vendor/github.com/google/gops/agent/LICENSE | 27 - vendor/github.com/google/gops/internal/LICENSE | 27 - .../github.com/google/gops/internal/dwarf/dwarf.go | 600 - .../google/gops/internal/dwarf/dwarf_defs.go | 483 - .../github.com/google/gops/internal/goobj/read.go | 714 - .../google/gops/internal/obj/addrtype_string.go | 27 - .../google/gops/internal/obj/arm/a.out.go | 338 - .../google/gops/internal/obj/arm/anames.go | 108 - .../google/gops/internal/obj/arm/anames5.go | 73 - .../google/gops/internal/obj/arm/asm5.go | 2846 - .../google/gops/internal/obj/arm/list5.go | 84 - .../google/gops/internal/obj/arm/obj5.go | 1055 - .../google/gops/internal/obj/arm64/a.out.go | 719 - .../google/gops/internal/obj/arm64/anames.go | 370 - .../google/gops/internal/obj/arm64/anames7.go | 70 - .../google/gops/internal/obj/arm64/asm7.go | 4374 -- .../google/gops/internal/obj/arm64/list7.go | 115 - .../google/gops/internal/obj/arm64/obj7.go | 1005 - vendor/github.com/google/gops/internal/obj/data.go | 190 - vendor/github.com/google/gops/internal/obj/flag.go | 115 - .../google/gops/internal/obj/funcdata.go | 48 - vendor/github.com/google/gops/internal/obj/go.go | 86 - vendor/github.com/google/gops/internal/obj/ld.go | 92 - vendor/github.com/google/gops/internal/obj/link.go | 974 - .../google/gops/internal/obj/mips/a.out.go | 375 - .../google/gops/internal/obj/mips/anames.go | 113 - .../google/gops/internal/obj/mips/anames0.go | 44 - .../google/gops/internal/obj/mips/asm0.go | 1783 - .../google/gops/internal/obj/mips/list0.go | 85 - .../google/gops/internal/obj/mips/obj0.go | 1497 - vendor/github.com/google/gops/internal/obj/obj.go | 306 - .../github.com/google/gops/internal/obj/objfile.go | 606 - vendor/github.com/google/gops/internal/obj/pass.go | 217 - vendor/github.com/google/gops/internal/obj/pcln.go | 281 - .../github.com/google/gops/internal/obj/plist.go | 208 - .../google/gops/internal/obj/ppc64/a.out.go | 941 - .../google/gops/internal/obj/ppc64/anames.go | 549 - .../google/gops/internal/obj/ppc64/anames9.go | 49 - .../google/gops/internal/obj/ppc64/asm9.go | 4552 -- .../google/gops/internal/obj/ppc64/list9.go | 105 - .../google/gops/internal/obj/ppc64/obj9.go | 1251 - .../google/gops/internal/obj/reloctype_string.go | 17 - .../google/gops/internal/obj/s390x/a.out.go | 926 - .../google/gops/internal/obj/s390x/anames.go | 675 - .../google/gops/internal/obj/s390x/anamesz.go | 39 - .../google/gops/internal/obj/s390x/asmz.go | 4766 -- .../google/gops/internal/obj/s390x/listz.go | 74 - .../google/gops/internal/obj/s390x/objz.go | 1029 - .../google/gops/internal/obj/s390x/vector.go | 1061 - .../github.com/google/gops/internal/obj/stack.go | 21 - .../google/gops/internal/obj/stringer.go | 104 - vendor/github.com/google/gops/internal/obj/sym.go | 88 - .../google/gops/internal/obj/symkind_string.go | 16 - .../google/gops/internal/obj/textflag.go | 50 - .../google/gops/internal/obj/typekind.go | 41 - vendor/github.com/google/gops/internal/obj/util.go | 499 - .../google/gops/internal/obj/x86/a.out.go | 1009 - .../google/gops/internal/obj/x86/anames.go | 769 - .../google/gops/internal/obj/x86/asm6.go | 4536 -- .../google/gops/internal/obj/x86/list6.go | 181 - .../google/gops/internal/obj/x86/obj6.go | 1481 - .../google/gops/internal/obj/zbootstrap.go | 15 - .../google/gops/internal/objfile/disasm.go | 283 - .../github.com/google/gops/internal/objfile/elf.go | 124 - .../google/gops/internal/objfile/goobj.go | 160 - .../google/gops/internal/objfile/macho.go | 134 - .../google/gops/internal/objfile/objfile.go | 129 - .../github.com/google/gops/internal/objfile/pe.go | 208 - .../google/gops/internal/objfile/plan9obj.go | 156 - vendor/github.com/google/gops/internal/sys/arch.go | 161 - vendor/github.com/google/gops/signal/LICENSE | 27 - vendor/github.com/gorilla/schema/.travis.yml | 18 + vendor/github.com/gorilla/schema/README.md | 90 + vendor/github.com/gorilla/websocket/.gitignore | 25 + vendor/github.com/gorilla/websocket/.travis.yml | 19 + vendor/github.com/gorilla/websocket/AUTHORS | 8 + vendor/github.com/gorilla/websocket/README.md | 64 + .../gorilla/websocket/examples/autobahn/server.go | 265 - .../gorilla/websocket/examples/chat/client.go | 134 - .../gorilla/websocket/examples/chat/hub.go | 53 - .../gorilla/websocket/examples/chat/main.go | 40 - .../gorilla/websocket/examples/command/main.go | 193 - .../gorilla/websocket/examples/echo/client.go | 81 - .../gorilla/websocket/examples/echo/server.go | 132 - .../gorilla/websocket/examples/filewatch/main.go | 193 - vendor/github.com/gorilla/websocket/proxy.go | 77 - vendor/github.com/gorilla/websocket/x_net_proxy.go | 473 - vendor/github.com/hashicorp/golang-lru/.gitignore | 23 + vendor/github.com/hashicorp/golang-lru/README.md | 25 + vendor/github.com/hashicorp/hcl/.gitignore | 9 + vendor/github.com/hashicorp/hcl/.travis.yml | 13 + vendor/github.com/hashicorp/hcl/Makefile | 18 + vendor/github.com/hashicorp/hcl/README.md | 125 + vendor/github.com/hashicorp/hcl/appveyor.yml | 19 + .../github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go | 162 - .../hashicorp/hcl/testhelper/unix2dos.go | 15 - vendor/github.com/jpillora/backoff/README.md | 119 + vendor/github.com/kardianos/osext/README.md | 21 + vendor/github.com/kr/fs/LICENSE | 27 - vendor/github.com/kr/fs/filesystem.go | 36 - vendor/github.com/kr/fs/walk.go | 95 - vendor/github.com/labstack/echo/.editorconfig | 25 + vendor/github.com/labstack/echo/.gitattributes | 20 + vendor/github.com/labstack/echo/.gitignore | 7 + vendor/github.com/labstack/echo/.travis.yml | 14 + vendor/github.com/labstack/echo/Gopkg.lock | 75 + vendor/github.com/labstack/echo/Makefile | 13 + vendor/github.com/labstack/echo/README.md | 95 + vendor/github.com/labstack/gommon/LICENSE | 22 + vendor/github.com/labstack/gommon/bytes/LICENSE | 22 - vendor/github.com/labstack/gommon/bytes/README.md | 29 + vendor/github.com/labstack/gommon/color/LICENSE | 22 - vendor/github.com/labstack/gommon/color/README.md | 86 + vendor/github.com/labstack/gommon/log/LICENSE | 22 - vendor/github.com/labstack/gommon/log/README.md | 5 + vendor/github.com/labstack/gommon/random/LICENSE | 22 - vendor/github.com/lrstanley/girc/.travis.yml | 26 + vendor/github.com/lrstanley/girc/CONTRIBUTING.md | 32 + vendor/github.com/lrstanley/girc/README.md | 99 + vendor/github.com/lrstanley/girc/cmdhandler/cmd.go | 199 - vendor/github.com/magiconair/properties/.gitignore | 6 + .../github.com/magiconair/properties/.travis.yml | 10 + .../github.com/magiconair/properties/CHANGELOG.md | 123 + vendor/github.com/magiconair/properties/README.md | 129 + .../magiconair/properties/assert/assert.go | 90 - vendor/github.com/matrix-org/gomatrix/LICENSE | 201 - vendor/github.com/matrix-org/gomatrix/client.go | 703 - vendor/github.com/matrix-org/gomatrix/events.go | 101 - vendor/github.com/matrix-org/gomatrix/filter.go | 43 - vendor/github.com/matrix-org/gomatrix/requests.go | 78 - vendor/github.com/matrix-org/gomatrix/responses.go | 176 - vendor/github.com/matrix-org/gomatrix/room.go | 50 - vendor/github.com/matrix-org/gomatrix/store.go | 65 - vendor/github.com/matrix-org/gomatrix/sync.go | 164 - vendor/github.com/matrix-org/gomatrix/userids.go | 130 - .../github.com/matterbridge/discordgo/.travis.yml | 14 + vendor/github.com/matterbridge/discordgo/README.md | 130 + .../discordgo/examples/airhorn/main.go | 211 - .../discordgo/examples/appmaker/main.go | 103 - .../matterbridge/discordgo/examples/avatar/main.go | 89 - .../discordgo/examples/mytoken/main.go | 40 - .../discordgo/examples/pingpong/main.go | 71 - .../github.com/matterbridge/discordgo/mkdocs.yml | 17 + .../discordgo/tools/cmd/eventhandlers/main.go | 124 - vendor/github.com/matterbridge/go-xmpp/.travis.yml | 5 + vendor/github.com/matterbridge/go-xmpp/README.md | 6 + vendor/github.com/matterbridge/gomatrix/.gitignore | 24 + .../github.com/matterbridge/gomatrix/.travis.yml | 9 + vendor/github.com/matterbridge/gomatrix/README.md | 6 + .../github.com/matterbridge/gozulipbot/.gitignore | 2 + .../github.com/matterbridge/gozulipbot/README.md | 20 + .../logrus-prefixed-formatter/.gitignore | 34 + .../logrus-prefixed-formatter/.travis.yml | 14 + .../logrus-prefixed-formatter/Makefile | 19 + .../logrus-prefixed-formatter/README.md | 116 + .../logrus-prefixed-formatter/examples/basic.go | 59 - .../logrus-prefixed-formatter/examples/themes.go | 48 - .../mattermost-server/einterfaces/LICENSE.txt | 897 - .../einterfaces/account_migration.go | 10 - .../mattermost-server/einterfaces/brand.go | 14 - .../mattermost-server/einterfaces/cluster.go | 25 - .../mattermost-server/einterfaces/compliance.go | 13 - .../einterfaces/data_retention.go | 12 - .../mattermost-server/einterfaces/elasticsearch.go | 20 - .../mattermost-server/einterfaces/emoji.go | 12 - .../einterfaces/jobs/data_retention.go | 13 - .../einterfaces/jobs/elasticsearch.go | 17 - .../einterfaces/jobs/ldap_sync.go | 13 - .../einterfaces/jobs/message_export.go | 13 - .../mattermost-server/einterfaces/ldap.go | 25 - .../einterfaces/message_export.go | 14 - .../mattermost-server/einterfaces/metrics.go | 43 - .../mattermost-server/einterfaces/mfa.go | 15 - .../einterfaces/oauthproviders.go | 29 - .../mattermost-server/einterfaces/saml.go | 15 - .../mattermost/mattermost-server/model/LICENSE.txt | 897 - .../mattermost/mattermost-server/model/access.go | 96 - .../mattermost-server/model/analytics_row.go | 41 - .../mattermost/mattermost-server/model/audit.go | 30 - .../mattermost/mattermost-server/model/audits.go | 34 - .../mattermost-server/model/authorization.go | 522 - .../mattermost-server/model/authorize.go | 141 - .../mattermost/mattermost-server/model/builtin.go | 9 - .../mattermost-server/model/bundle_info.go | 23 - .../mattermost/mattermost-server/model/channel.go | 208 - .../mattermost-server/model/channel_count.go | 54 - .../mattermost-server/model/channel_data.go | 34 - .../mattermost-server/model/channel_list.go | 53 - .../mattermost-server/model/channel_member.go | 148 - .../model/channel_member_history.go | 15 - .../mattermost-server/model/channel_search.go | 26 - .../mattermost-server/model/channel_stats.go | 25 - .../mattermost-server/model/channel_view.go | 41 - .../mattermost/mattermost-server/model/client.go | 2379 - .../mattermost/mattermost-server/model/client4.go | 3299 -- .../mattermost-server/model/cluster_discovery.go | 133 - .../mattermost-server/model/cluster_info.go | 50 - .../mattermost-server/model/cluster_message.go | 46 - .../mattermost-server/model/cluster_stats.go | 27 - .../mattermost/mattermost-server/model/command.go | 139 - .../mattermost-server/model/command_args.go | 34 - .../mattermost-server/model/command_response.go | 61 - .../mattermost-server/model/command_webhook.go | 65 - .../mattermost-server/model/compliance.go | 119 - .../mattermost-server/model/compliance_post.go | 114 - .../mattermost/mattermost-server/model/config.go | 2238 - .../model/data_retention_policy.go | 27 - .../mattermost/mattermost-server/model/emoji.go | 83 - .../mattermost-server/model/emoji_search.go | 25 - .../mattermost/mattermost-server/model/file.go | 34 - .../mattermost-server/model/file_info.go | 170 - .../mattermost/mattermost-server/model/gitlab.go | 8 - .../mattermost-server/model/gitlab/gitlab.go | 114 - .../mattermost-server/model/incoming_webhook.go | 206 - .../mattermost-server/model/initial_load.go | 30 - .../mattermost/mattermost-server/model/job.go | 118 - .../mattermost/mattermost-server/model/ldap.go | 9 - .../mattermost/mattermost-server/model/license.go | 219 - .../mattermost/mattermost-server/model/manifest.go | 228 - .../mattermost-server/model/message_export.go | 19 - .../mattermost-server/model/mfa_secret.go | 25 - .../mattermost/mattermost-server/model/oauth.go | 164 - .../mattermost-server/model/outgoing_webhook.go | 254 - .../mattermost-server/model/plugin_key_value.go | 32 - .../mattermost-server/model/plugins_response.go | 30 - .../mattermost/mattermost-server/model/post.go | 492 - .../mattermost-server/model/post_list.go | 138 - .../mattermost-server/model/preference.go | 113 - .../mattermost-server/model/preferences.go | 27 - .../mattermost-server/model/push_notification.go | 68 - .../mattermost-server/model/push_response.go | 54 - .../mattermost/mattermost-server/model/reaction.go | 76 - .../mattermost/mattermost-server/model/saml.go | 40 - .../mattermost-server/model/scheduled_task.go | 110 - .../mattermost-server/model/search_params.go | 171 - .../mattermost-server/model/security_bulletin.go | 41 - .../mattermost/mattermost-server/model/session.go | 137 - .../mattermost-server/model/slack_attachment.go | 59 - .../mattermost/mattermost-server/model/status.go | 60 - .../mattermost-server/model/suggest_command.go | 25 - .../mattermost-server/model/switch_request.go | 53 - .../mattermost/mattermost-server/model/system.go | 46 - .../mattermost/mattermost-server/model/team.go | 294 - .../mattermost-server/model/team_member.go | 94 - .../mattermost-server/model/team_search.go | 35 - .../mattermost-server/model/team_stats.go | 26 - .../mattermost/mattermost-server/model/token.go | 40 - .../mattermost/mattermost-server/model/user.go | 616 - .../mattermost-server/model/user_access_token.go | 65 - .../model/user_access_token_search.go | 35 - .../mattermost-server/model/user_autocomplete.go | 61 - .../mattermost-server/model/user_search.go | 32 - .../mattermost/mattermost-server/model/utils.go | 486 - .../mattermost/mattermost-server/model/version.go | 148 - .../mattermost/mattermost-server/model/webrtc.go | 39 - .../mattermost-server/model/websocket_client.go | 167 - .../mattermost-server/model/websocket_message.go | 132 - .../mattermost-server/model/websocket_request.go | 34 - .../github.com/alecthomas/log4go/LICENSE.txt | 897 - .../vendor/github.com/alecthomas/log4go/config.go | 288 - .../log4go/examples/ConsoleLogWriter_Manual.go | 14 - .../log4go/examples/FileLogWriter_Manual.go | 57 - .../log4go/examples/SimpleNetLogServer.go | 42 - .../log4go/examples/SocketLogWriter_Manual.go | 18 - .../log4go/examples/XMLConfigurationExample.go | 13 - .../vendor/github.com/alecthomas/log4go/filelog.go | 264 - .../vendor/github.com/alecthomas/log4go/log4go.go | 484 - .../vendor/github.com/alecthomas/log4go/pattlog.go | 130 - .../vendor/github.com/alecthomas/log4go/socklog.go | 57 - .../vendor/github.com/alecthomas/log4go/termlog.go | 49 - .../vendor/github.com/alecthomas/log4go/wrapper.go | 278 - .../vendor/github.com/go-ldap/ldap/LICENSE.txt | 897 - .../vendor/github.com/go-ldap/ldap/add.go | 113 - .../vendor/github.com/go-ldap/ldap/atomic_value.go | 13 - .../github.com/go-ldap/ldap/atomic_value_go13.go | 28 - .../vendor/github.com/go-ldap/ldap/bind.go | 143 - .../vendor/github.com/go-ldap/ldap/client.go | 27 - .../vendor/github.com/go-ldap/ldap/compare.go | 85 - .../vendor/github.com/go-ldap/ldap/conn.go | 470 - .../vendor/github.com/go-ldap/ldap/control.go | 420 - .../vendor/github.com/go-ldap/ldap/debug.go | 24 - .../vendor/github.com/go-ldap/ldap/del.go | 84 - .../vendor/github.com/go-ldap/ldap/dn.go | 247 - .../vendor/github.com/go-ldap/ldap/doc.go | 4 - .../vendor/github.com/go-ldap/ldap/error.go | 155 - .../vendor/github.com/go-ldap/ldap/filter.go | 469 - .../vendor/github.com/go-ldap/ldap/ldap.go | 320 - .../vendor/github.com/go-ldap/ldap/modify.go | 170 - .../vendor/github.com/go-ldap/ldap/passwdmodify.go | 148 - .../vendor/github.com/go-ldap/ldap/search.go | 450 - .../vendor/github.com/pborman/uuid/LICENSE.txt | 897 - .../vendor/github.com/pborman/uuid/dce.go | 84 - .../vendor/github.com/pborman/uuid/doc.go | 8 - .../vendor/github.com/pborman/uuid/hash.go | 53 - .../vendor/github.com/pborman/uuid/marshal.go | 83 - .../vendor/github.com/pborman/uuid/node.go | 117 - .../vendor/github.com/pborman/uuid/sql.go | 66 - .../vendor/github.com/pborman/uuid/time.go | 132 - .../vendor/github.com/pborman/uuid/util.go | 43 - .../vendor/github.com/pborman/uuid/uuid.go | 201 - .../vendor/github.com/pborman/uuid/version1.go | 41 - .../vendor/github.com/pborman/uuid/version4.go | 25 - .../vendor/golang.org/x/crypto/bcrypt/LICENSE.txt | 897 - .../vendor/golang.org/x/crypto/bcrypt/base64.go | 35 - .../vendor/golang.org/x/crypto/bcrypt/bcrypt.go | 295 - .../golang.org/x/crypto/blowfish/LICENSE.txt | 897 - .../vendor/golang.org/x/crypto/blowfish/block.go | 159 - .../vendor/golang.org/x/crypto/blowfish/cipher.go | 91 - .../vendor/golang.org/x/crypto/blowfish/const.go | 199 - .../vendor/gopkg.in/asn1-ber.v1/LICENSE.txt | 897 - .../vendor/gopkg.in/asn1-ber.v1/ber.go | 504 - .../vendor/gopkg.in/asn1-ber.v1/content_int.go | 25 - .../vendor/gopkg.in/asn1-ber.v1/header.go | 29 - .../vendor/gopkg.in/asn1-ber.v1/identifier.go | 103 - .../vendor/gopkg.in/asn1-ber.v1/length.go | 81 - .../vendor/gopkg.in/asn1-ber.v1/util.go | 24 - .../vendor/gopkg.in/yaml.v2/LICENSE.txt | 897 - .../vendor/gopkg.in/yaml.v2/apic.go | 742 - .../vendor/gopkg.in/yaml.v2/decode.go | 685 - .../vendor/gopkg.in/yaml.v2/emitterc.go | 1684 - .../vendor/gopkg.in/yaml.v2/encode.go | 306 - .../vendor/gopkg.in/yaml.v2/parserc.go | 1095 - .../vendor/gopkg.in/yaml.v2/readerc.go | 394 - .../vendor/gopkg.in/yaml.v2/resolve.go | 208 - .../vendor/gopkg.in/yaml.v2/scannerc.go | 2711 - .../vendor/gopkg.in/yaml.v2/sorter.go | 104 - .../vendor/gopkg.in/yaml.v2/writerc.go | 89 - .../vendor/gopkg.in/yaml.v2/yaml.go | 357 - .../vendor/gopkg.in/yaml.v2/yamlh.go | 716 - .../vendor/gopkg.in/yaml.v2/yamlprivateh.go | 173 - vendor/github.com/mattermost/platform/LICENSE.txt | 897 + vendor/github.com/mattermost/platform/NOTICE.txt | 2935 + .../mattermost/platform/model/LICENSE.txt | 897 - .../mattermost/platform/model/gitlab/gitlab.go | 114 - .../github.com/nicksnyder/go-i18n/i18n/LICENSE.txt | 897 - .../nicksnyder/go-i18n/i18n/bundle/bundle.go | 444 - .../github.com/nicksnyder/go-i18n/i18n/i18n.go | 158 - .../go-i18n/i18n/language/codegen/main.go | 132 - .../go-i18n/i18n/language/codegen/xml.go | 143 - .../nicksnyder/go-i18n/i18n/language/language.go | 99 - .../nicksnyder/go-i18n/i18n/language/operands.go | 119 - .../nicksnyder/go-i18n/i18n/language/plural.go | 40 - .../nicksnyder/go-i18n/i18n/language/pluralspec.go | 75 - .../go-i18n/i18n/language/pluralspec_gen.go | 557 - .../go-i18n/i18n/translation/plural_translation.go | 82 - .../go-i18n/i18n/translation/single_translation.go | 61 - .../go-i18n/i18n/translation/template.go | 65 - .../go-i18n/i18n/translation/translation.go | 84 - .../github.com/pelletier/go-toml/LICENSE.txt | 897 - .../pelletier/go-toml/cmd/test_program.go | 91 - .../pelletier/go-toml/cmd/tomljson/main.go | 72 - .../github.com/pelletier/go-toml/cmd/tomll/main.go | 66 - .../vendor/github.com/pelletier/go-toml/doc.go | 23 - .../vendor/github.com/pelletier/go-toml/fuzz.go | 31 - .../github.com/pelletier/go-toml/keysparsing.go | 161 - .../vendor/github.com/pelletier/go-toml/lexer.go | 651 - .../vendor/github.com/pelletier/go-toml/marshal.go | 621 - .../vendor/github.com/pelletier/go-toml/parser.go | 383 - .../github.com/pelletier/go-toml/position.go | 29 - .../github.com/pelletier/go-toml/query/doc.go | 175 - .../github.com/pelletier/go-toml/query/lexer.go | 357 - .../github.com/pelletier/go-toml/query/match.go | 232 - .../github.com/pelletier/go-toml/query/parser.go | 275 - .../github.com/pelletier/go-toml/query/query.go | 158 - .../github.com/pelletier/go-toml/query/tokens.go | 106 - .../vendor/github.com/pelletier/go-toml/token.go | 140 - .../vendor/github.com/pelletier/go-toml/toml.go | 300 - .../pelletier/go-toml/tomltree_create.go | 142 - .../github.com/pelletier/go-toml/tomltree_write.go | 270 - .../platform/vendor/gopkg.in/yaml.v2/LICENSE.txt | 897 - .../platform/vendor/gopkg.in/yaml.v2/apic.go | 742 - .../platform/vendor/gopkg.in/yaml.v2/decode.go | 685 - .../platform/vendor/gopkg.in/yaml.v2/emitterc.go | 1684 - .../platform/vendor/gopkg.in/yaml.v2/encode.go | 306 - .../platform/vendor/gopkg.in/yaml.v2/parserc.go | 1095 - .../platform/vendor/gopkg.in/yaml.v2/readerc.go | 394 - .../platform/vendor/gopkg.in/yaml.v2/resolve.go | 208 - .../platform/vendor/gopkg.in/yaml.v2/scannerc.go | 2711 - .../platform/vendor/gopkg.in/yaml.v2/sorter.go | 104 - .../platform/vendor/gopkg.in/yaml.v2/writerc.go | 89 - .../platform/vendor/gopkg.in/yaml.v2/yaml.go | 357 - .../platform/vendor/gopkg.in/yaml.v2/yamlh.go | 716 - .../vendor/gopkg.in/yaml.v2/yamlprivateh.go | 173 - vendor/github.com/mattn/go-colorable/.travis.yml | 8 + vendor/github.com/mattn/go-colorable/README.md | 43 + vendor/github.com/mattn/go-isatty/.travis.yml | 8 + vendor/github.com/mattn/go-isatty/README.md | 47 + vendor/github.com/mgutz/ansi/.gitignore | 1 + vendor/github.com/mgutz/ansi/README.md | 121 + .../github.com/mgutz/ansi/cmd/ansi-mgutz/main.go | 135 - .../github.com/mitchellh/mapstructure/.travis.yml | 8 + vendor/github.com/mitchellh/mapstructure/README.md | 46 + .../github.com/mreiferson/go-httpclient/.gitignore | 1 + .../mreiferson/go-httpclient/.travis.yml | 11 + .../github.com/mreiferson/go-httpclient/README.md | 41 + vendor/github.com/mrexodia/wray/README.markdown | 113 + vendor/github.com/mrexodia/wray/examples/client.go | 17 - .../github.com/mrexodia/wray/examples/publish.go | 15 - vendor/github.com/nicksnyder/go-i18n/LICENSE | 19 + vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE | 19 - .../go-i18n/i18n/language/codegen/main.go | 132 - .../go-i18n/i18n/language/codegen/xml.go | 143 - vendor/github.com/nlopes/slack/.gitignore | 2 + vendor/github.com/nlopes/slack/.travis.yml | 21 + vendor/github.com/nlopes/slack/CHANGELOG.md | 12 + vendor/github.com/nlopes/slack/README.md | 89 + vendor/github.com/nlopes/slack/TODO.txt | 3 + .../nlopes/slack/examples/channels/channels.go | 21 - .../nlopes/slack/examples/files/files.go | 30 - .../nlopes/slack/examples/groups/groups.go | 22 - vendor/github.com/nlopes/slack/examples/ims/ims.go | 21 - .../nlopes/slack/examples/messages/messages.go | 32 - .../github.com/nlopes/slack/examples/pins/pins.go | 123 - .../nlopes/slack/examples/reactions/reactions.go | 126 - .../nlopes/slack/examples/stars/stars.go | 46 - .../github.com/nlopes/slack/examples/team/team.go | 25 - .../nlopes/slack/examples/users/users.go | 17 - .../nlopes/slack/examples/websocket/websocket.go | 54 - .../paulrosania/go-charset/charset/iconv/iconv.go | 184 - .../go-charset/charset/iconv/list_query.go | 80 - .../go-charset/charset/iconv/list_static.go | 176 - .../paulrosania/go-charset/cmd/tcs/tcs.go | 103 - vendor/github.com/pborman/uuid/.travis.yml | 10 + vendor/github.com/pborman/uuid/CONTRIBUTING.md | 10 + vendor/github.com/pborman/uuid/CONTRIBUTORS | 1 + vendor/github.com/pborman/uuid/README.md | 13 + vendor/github.com/pelletier/go-toml/.gitignore | 2 + vendor/github.com/pelletier/go-toml/.travis.yml | 22 + vendor/github.com/pelletier/go-toml/README.md | 131 + vendor/github.com/pelletier/go-toml/benchmark.json | 164 + vendor/github.com/pelletier/go-toml/benchmark.sh | 32 + vendor/github.com/pelletier/go-toml/benchmark.yml | 121 + .../pelletier/go-toml/cmd/test_program.go | 91 - .../pelletier/go-toml/cmd/tomljson/main.go | 72 - .../github.com/pelletier/go-toml/cmd/tomll/main.go | 66 - vendor/github.com/pelletier/go-toml/fuzz.sh | 15 + vendor/github.com/pelletier/go-toml/query/doc.go | 175 - vendor/github.com/pelletier/go-toml/query/lexer.go | 357 - vendor/github.com/pelletier/go-toml/query/match.go | 232 - .../github.com/pelletier/go-toml/query/parser.go | 275 - vendor/github.com/pelletier/go-toml/query/query.go | 158 - .../github.com/pelletier/go-toml/query/tokens.go | 106 - vendor/github.com/pelletier/go-toml/test.sh | 91 + .../github.com/peterhellberg/emojilib/.travis.yml | 8 + vendor/github.com/peterhellberg/emojilib/README.md | 61 + vendor/github.com/peterhellberg/giphy/client.go | 117 - .../peterhellberg/giphy/cmd/giphy/main.go | 140 - vendor/github.com/peterhellberg/giphy/env.go | 34 - vendor/github.com/peterhellberg/giphy/errors.go | 17 - vendor/github.com/peterhellberg/giphy/gif.go | 44 - vendor/github.com/peterhellberg/giphy/random.go | 37 - vendor/github.com/peterhellberg/giphy/search.go | 24 - vendor/github.com/peterhellberg/giphy/translate.go | 37 - vendor/github.com/peterhellberg/giphy/trending.go | 23 - vendor/github.com/peterhellberg/giphy/types.go | 116 - vendor/github.com/pkg/errors/LICENSE | 23 - vendor/github.com/pkg/errors/errors.go | 269 - vendor/github.com/pkg/errors/stack.go | 147 - vendor/github.com/pkg/sftp/LICENSE | 9 - vendor/github.com/pkg/sftp/attrs.go | 241 - vendor/github.com/pkg/sftp/attrs_stubs.go | 11 - vendor/github.com/pkg/sftp/attrs_unix.go | 17 - vendor/github.com/pkg/sftp/client.go | 1174 - vendor/github.com/pkg/sftp/conn.go | 133 - vendor/github.com/pkg/sftp/debug.go | 9 - .../sftp/examples/buffered-read-benchmark/main.go | 78 - .../sftp/examples/buffered-write-benchmark/main.go | 84 - .../pkg/sftp/examples/request-server/main.go | 131 - .../pkg/sftp/examples/sftp-server/main.go | 147 - .../sftp/examples/streaming-read-benchmark/main.go | 85 - .../examples/streaming-write-benchmark/main.go | 85 - vendor/github.com/pkg/sftp/match.go | 295 - vendor/github.com/pkg/sftp/packet-manager.go | 173 - vendor/github.com/pkg/sftp/packet-typing.go | 133 - vendor/github.com/pkg/sftp/packet.go | 952 - vendor/github.com/pkg/sftp/release.go | 5 - vendor/github.com/pkg/sftp/request-attrs.go | 63 - vendor/github.com/pkg/sftp/request-errors.go | 42 - vendor/github.com/pkg/sftp/request-example.go | 261 - vendor/github.com/pkg/sftp/request-interfaces.go | 46 - vendor/github.com/pkg/sftp/request-server.go | 238 - vendor/github.com/pkg/sftp/request-unix.go | 23 - vendor/github.com/pkg/sftp/request.go | 353 - vendor/github.com/pkg/sftp/request_windows.go | 11 - vendor/github.com/pkg/sftp/server.go | 675 - .../github.com/pkg/sftp/server_standalone/main.go | 52 - .../github.com/pkg/sftp/server_statvfs_darwin.go | 21 - vendor/github.com/pkg/sftp/server_statvfs_impl.go | 25 - vendor/github.com/pkg/sftp/server_statvfs_linux.go | 22 - vendor/github.com/pkg/sftp/server_statvfs_stubs.go | 11 - vendor/github.com/pkg/sftp/server_stubs.go | 32 - vendor/github.com/pkg/sftp/server_unix.go | 54 - vendor/github.com/pkg/sftp/sftp.go | 217 - vendor/github.com/pmezard/go-difflib/LICENSE | 27 + .../pmezard/go-difflib/difflib/difflib.go | 772 + vendor/github.com/rs/xid/.appveyor.yml | 27 + vendor/github.com/rs/xid/.travis.yml | 8 + vendor/github.com/rs/xid/README.md | 112 + vendor/github.com/rs/xid/go.mod | 1 + vendor/github.com/russross/blackfriday/.gitignore | 8 + vendor/github.com/russross/blackfriday/.travis.yml | 30 + vendor/github.com/russross/blackfriday/README.md | 363 + vendor/github.com/russross/blackfriday/block.go | 28 +- vendor/github.com/russross/blackfriday/doc.go | 32 + vendor/github.com/russross/blackfriday/html.go | 3 +- vendor/github.com/russross/blackfriday/inline.go | 8 +- vendor/github.com/russross/blackfriday/markdown.go | 13 +- .../github.com/russross/blackfriday/smartypants.go | 58 +- vendor/github.com/saintfish/chardet/AUTHORS | 1 + vendor/github.com/saintfish/chardet/README.md | 10 + .../github.com/saintfish/chardet/icu-license.html | 51 + vendor/github.com/satori/go.uuid/LICENSE | 20 - vendor/github.com/satori/go.uuid/uuid.go | 481 - vendor/github.com/shazow/ssh-chat/LICENSE | 21 + vendor/github.com/shazow/ssh-chat/sshd/LICENSE | 21 - .../shurcooL/sanitized_anchor_name/LICENSE | 19 - .../shurcooL/sanitized_anchor_name/main.go | 29 - vendor/github.com/sirupsen/logrus/.gitignore | 1 + vendor/github.com/sirupsen/logrus/.travis.yml | 15 + vendor/github.com/sirupsen/logrus/CHANGELOG.md | 118 + vendor/github.com/sirupsen/logrus/README.md | 510 + vendor/github.com/sirupsen/logrus/appveyor.yml | 14 + .../sirupsen/logrus/hooks/syslog/syslog.go | 55 - .../github.com/sirupsen/logrus/hooks/test/test.go | 95 - vendor/github.com/sorcix/irc/LICENSE | 22 - vendor/github.com/sorcix/irc/constants.go | 298 - vendor/github.com/sorcix/irc/ctcp/ctcp.go | 144 - vendor/github.com/sorcix/irc/ctcp/doc.go | 31 - vendor/github.com/sorcix/irc/doc.go | 36 - vendor/github.com/sorcix/irc/message.go | 308 - vendor/github.com/sorcix/irc/stream.go | 134 - vendor/github.com/sorcix/irc/strings.go | 17 - vendor/github.com/sorcix/irc/strings_legacy.go | 22 - vendor/github.com/spf13/afero/.travis.yml | 21 + vendor/github.com/spf13/afero/README.md | 452 + vendor/github.com/spf13/afero/appveyor.yml | 15 + vendor/github.com/spf13/afero/sftpfs/file.go | 95 - vendor/github.com/spf13/afero/sftpfs/sftp.go | 129 - vendor/github.com/spf13/cast/.gitignore | 25 + vendor/github.com/spf13/cast/.travis.yml | 14 + vendor/github.com/spf13/cast/Makefile | 38 + vendor/github.com/spf13/cast/README.md | 75 + .../github.com/spf13/jwalterweatherman/.gitignore | 22 + .../github.com/spf13/jwalterweatherman/README.md | 148 + vendor/github.com/spf13/pflag/.gitignore | 2 + vendor/github.com/spf13/pflag/.travis.yml | 21 + vendor/github.com/spf13/pflag/README.md | 296 + vendor/github.com/spf13/viper/.gitignore | 24 + vendor/github.com/spf13/viper/.travis.yml | 28 + vendor/github.com/spf13/viper/README.md | 643 + vendor/github.com/spf13/viper/nohup.out | 1 + vendor/github.com/spf13/viper/remote/remote.go | 105 - vendor/github.com/stretchr/testify/LICENSE | 22 + .../github.com/stretchr/testify/assert/LICENCE.txt | 22 - vendor/github.com/stretchr/testify/assert/LICENSE | 22 - .../testify/assert/assertion_format.go.tmpl | 4 + .../testify/assert/assertion_forward.go.tmpl | 4 + .../github.com/davecgh/go-spew/spew/LICENCE.txt | 22 - .../vendor/github.com/davecgh/go-spew/spew/LICENSE | 22 - .../github.com/davecgh/go-spew/spew/bypass.go | 152 - .../github.com/davecgh/go-spew/spew/bypasssafe.go | 38 - .../github.com/davecgh/go-spew/spew/common.go | 341 - .../github.com/davecgh/go-spew/spew/config.go | 306 - .../vendor/github.com/davecgh/go-spew/spew/doc.go | 202 - .../vendor/github.com/davecgh/go-spew/spew/dump.go | 509 - .../github.com/davecgh/go-spew/spew/format.go | 419 - .../vendor/github.com/davecgh/go-spew/spew/spew.go | 148 - .../pmezard/go-difflib/difflib/LICENCE.txt | 22 - .../github.com/pmezard/go-difflib/difflib/LICENSE | 22 - .../pmezard/go-difflib/difflib/difflib.go | 758 - .../technoweenie/multipartstreamer/README.md | 47 + .../multipartstreamer/examples/multipart.go | 31 - .../multipartstreamer/examples/streamer.go | 27 - vendor/github.com/tylerb/graceful/LICENSE | 21 - vendor/github.com/tylerb/graceful/graceful.go | 489 - .../tylerb/graceful/keepalive_listener.go | 32 - vendor/github.com/tylerb/graceful/limit_listen.go | 77 - vendor/github.com/tylerb/graceful/signal.go | 17 - .../github.com/tylerb/graceful/signal_appengine.go | 13 - vendor/github.com/tylerb/graceful/tests/main.go | 40 - .../github.com/valyala/bytebufferpool/.travis.yml | 15 + vendor/github.com/valyala/bytebufferpool/README.md | 21 + vendor/github.com/valyala/fasttemplate/README.md | 85 + .../valyala/bytebufferpool/bytebuffer.go | 111 - .../github.com/valyala/bytebufferpool/doc.go | 7 - .../github.com/valyala/bytebufferpool/pool.go | 151 - .../x-cray/logrus-prefixed-formatter/LICENSE | 21 - .../logrus-prefixed-formatter/examples/basic.go | 59 - .../logrus-prefixed-formatter/examples/themes.go | 48 - .../x-cray/logrus-prefixed-formatter/formatter.go | 382 - .../xordataexchange/crypt/backend/LICENSE | 9 - .../xordataexchange/crypt/backend/backend.go | 32 - .../xordataexchange/crypt/backend/consul/consul.go | 87 - .../xordataexchange/crypt/backend/etcd/etcd.go | 116 - .../xordataexchange/crypt/backend/mock/mock.go | 61 - .../xordataexchange/crypt/config/LICENSE | 9 - .../xordataexchange/crypt/config/config.go | 201 - .../xordataexchange/crypt/encoding/secconf/LICENSE | 9 - .../crypt/encoding/secconf/secconf.go | 68 - vendor/github.com/zfjagann/golang-ring/.gitignore | 24 + vendor/github.com/zfjagann/golang-ring/README.md | 76 + vendor/github.com/zfjagann/golang-ring/makefile | 10 + vendor/golang.org/x/arch/arm/armasm/LICENSE | 27 - vendor/golang.org/x/arch/arm/armasm/decode.go | 567 - vendor/golang.org/x/arch/arm/armasm/gnu.go | 164 - vendor/golang.org/x/arch/arm/armasm/inst.go | 438 - vendor/golang.org/x/arch/arm/armasm/plan9x.go | 215 - vendor/golang.org/x/arch/arm/armasm/tables.go | 9448 ---- vendor/golang.org/x/arch/ppc64/ppc64asm/LICENSE | 27 - vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go | 179 - vendor/golang.org/x/arch/ppc64/ppc64asm/doc.go | 6 - vendor/golang.org/x/arch/ppc64/ppc64asm/field.go | 84 - vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go | 125 - vendor/golang.org/x/arch/ppc64/ppc64asm/inst.go | 344 - vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go | 172 - vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go | 5421 -- vendor/golang.org/x/arch/x86/x86asm/LICENSE | 27 - vendor/golang.org/x/arch/x86/x86asm/decode.go | 1724 - vendor/golang.org/x/arch/x86/x86asm/gnu.go | 928 - vendor/golang.org/x/arch/x86/x86asm/inst.go | 649 - vendor/golang.org/x/arch/x86/x86asm/intel.go | 532 - vendor/golang.org/x/arch/x86/x86asm/plan9x.go | 362 - vendor/golang.org/x/arch/x86/x86asm/tables.go | 9902 ---- vendor/golang.org/x/crypto/AUTHORS | 3 + vendor/golang.org/x/crypto/CONTRIBUTORS | 3 + vendor/golang.org/x/crypto/LICENSE | 27 + vendor/golang.org/x/crypto/PATENTS | 22 + vendor/golang.org/x/crypto/acme/LICENSE | 27 - vendor/golang.org/x/crypto/acme/acme.go | 258 +- .../golang.org/x/crypto/acme/autocert/autocert.go | 443 +- vendor/golang.org/x/crypto/acme/autocert/cache.go | 14 +- .../golang.org/x/crypto/acme/autocert/listener.go | 160 + .../golang.org/x/crypto/acme/autocert/renewal.go | 17 +- vendor/golang.org/x/crypto/acme/jws.go | 2 +- vendor/golang.org/x/crypto/acme/types.go | 136 +- vendor/golang.org/x/crypto/bcrypt/LICENSE | 27 - vendor/golang.org/x/crypto/bcrypt/bcrypt.go | 11 +- vendor/golang.org/x/crypto/blowfish/LICENSE | 27 - vendor/golang.org/x/crypto/blowfish/cipher.go | 4 +- vendor/golang.org/x/crypto/blowfish/const.go | 2 +- vendor/golang.org/x/crypto/cast5/LICENSE | 27 - vendor/golang.org/x/crypto/cast5/cast5.go | 526 - vendor/golang.org/x/crypto/curve25519/LICENSE | 27 - vendor/golang.org/x/crypto/ed25519/LICENSE | 27 - .../x/crypto/internal/chacha20/chacha_generic.go | 198 + vendor/golang.org/x/crypto/nacl/secretbox/LICENSE | 27 - .../x/crypto/nacl/secretbox/secretbox.go | 17 + vendor/golang.org/x/crypto/openpgp/LICENSE | 27 - vendor/golang.org/x/crypto/openpgp/armor/armor.go | 219 - vendor/golang.org/x/crypto/openpgp/armor/encode.go | 160 - .../golang.org/x/crypto/openpgp/canonical_text.go | 59 - .../x/crypto/openpgp/clearsign/clearsign.go | 376 - .../golang.org/x/crypto/openpgp/elgamal/elgamal.go | 122 - .../golang.org/x/crypto/openpgp/errors/errors.go | 72 - vendor/golang.org/x/crypto/openpgp/keys.go | 641 - .../x/crypto/openpgp/packet/compressed.go | 123 - .../golang.org/x/crypto/openpgp/packet/config.go | 91 - .../x/crypto/openpgp/packet/encrypted_key.go | 199 - .../golang.org/x/crypto/openpgp/packet/literal.go | 89 - vendor/golang.org/x/crypto/openpgp/packet/ocfb.go | 143 - .../x/crypto/openpgp/packet/one_pass_signature.go | 73 - .../golang.org/x/crypto/openpgp/packet/opaque.go | 162 - .../golang.org/x/crypto/openpgp/packet/packet.go | 537 - .../x/crypto/openpgp/packet/private_key.go | 380 - .../x/crypto/openpgp/packet/public_key.go | 748 - .../x/crypto/openpgp/packet/public_key_v3.go | 279 - .../golang.org/x/crypto/openpgp/packet/reader.go | 76 - .../x/crypto/openpgp/packet/signature.go | 731 - .../x/crypto/openpgp/packet/signature_v3.go | 146 - .../openpgp/packet/symmetric_key_encrypted.go | 155 - .../openpgp/packet/symmetrically_encrypted.go | 290 - .../x/crypto/openpgp/packet/userattribute.go | 91 - .../golang.org/x/crypto/openpgp/packet/userid.go | 160 - vendor/golang.org/x/crypto/openpgp/read.go | 442 - vendor/golang.org/x/crypto/openpgp/s2k/s2k.go | 273 - vendor/golang.org/x/crypto/openpgp/write.go | 378 - vendor/golang.org/x/crypto/poly1305/LICENSE | 27 - vendor/golang.org/x/crypto/poly1305/const_amd64.s | 45 - vendor/golang.org/x/crypto/poly1305/poly1305.go | 3 +- .../golang.org/x/crypto/poly1305/poly1305_amd64.s | 497 - vendor/golang.org/x/crypto/poly1305/poly1305_arm.s | 379 - vendor/golang.org/x/crypto/poly1305/sum_amd64.go | 4 +- vendor/golang.org/x/crypto/poly1305/sum_amd64.s | 125 + vendor/golang.org/x/crypto/poly1305/sum_arm.go | 6 +- vendor/golang.org/x/crypto/poly1305/sum_arm.s | 427 + vendor/golang.org/x/crypto/poly1305/sum_ref.go | 1636 +- vendor/golang.org/x/crypto/salsa20/salsa/LICENSE | 27 - .../x/crypto/salsa20/salsa/salsa2020_amd64.s | 45 +- .../x/crypto/salsa20/salsa/salsa20_amd64.go | 3 +- .../x/crypto/salsa20/salsa/salsa20_ref.go | 2 +- vendor/golang.org/x/crypto/ssh/LICENSE | 27 - vendor/golang.org/x/crypto/ssh/agent/client.go | 683 - vendor/golang.org/x/crypto/ssh/agent/forward.go | 103 - vendor/golang.org/x/crypto/ssh/agent/keyring.go | 215 - vendor/golang.org/x/crypto/ssh/agent/server.go | 523 - vendor/golang.org/x/crypto/ssh/certs.go | 6 +- vendor/golang.org/x/crypto/ssh/cipher.go | 240 +- vendor/golang.org/x/crypto/ssh/client_auth.go | 95 +- vendor/golang.org/x/crypto/ssh/common.go | 16 +- vendor/golang.org/x/crypto/ssh/keys.go | 3 +- .../x/crypto/ssh/knownhosts/knownhosts.go | 546 - vendor/golang.org/x/crypto/ssh/server.go | 23 +- .../x/crypto/ssh/terminal/util_windows.go | 10 +- vendor/golang.org/x/crypto/ssh/test/doc.go | 7 - vendor/golang.org/x/crypto/ssh/transport.go | 56 +- vendor/golang.org/x/net/AUTHORS | 3 + vendor/golang.org/x/net/CONTRIBUTORS | 3 + vendor/golang.org/x/net/LICENSE | 27 + vendor/golang.org/x/net/PATENTS | 22 + vendor/golang.org/x/net/context/LICENSE | 27 - vendor/golang.org/x/net/context/context.go | 156 - vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go | 74 - .../x/net/context/ctxhttp/ctxhttp_pre17.go | 147 - vendor/golang.org/x/net/context/go17.go | 72 - vendor/golang.org/x/net/context/pre_go17.go | 300 - vendor/golang.org/x/net/html/LICENSE | 27 - vendor/golang.org/x/net/html/atom/atom.go | 78 - vendor/golang.org/x/net/html/atom/gen.go | 648 - vendor/golang.org/x/net/html/atom/table.go | 713 - vendor/golang.org/x/net/html/charset/charset.go | 257 - vendor/golang.org/x/net/html/const.go | 102 - vendor/golang.org/x/net/html/doc.go | 106 - vendor/golang.org/x/net/html/doctype.go | 156 - vendor/golang.org/x/net/html/entity.go | 2253 - vendor/golang.org/x/net/html/escape.go | 258 - vendor/golang.org/x/net/html/foreign.go | 226 - vendor/golang.org/x/net/html/node.go | 193 - vendor/golang.org/x/net/html/parse.go | 2094 - vendor/golang.org/x/net/html/render.go | 271 - vendor/golang.org/x/net/html/token.go | 1219 - vendor/golang.org/x/net/http2/hpack/LICENSE | 27 - vendor/golang.org/x/net/http2/hpack/encode.go | 251 - vendor/golang.org/x/net/http2/hpack/hpack.go | 542 - vendor/golang.org/x/net/http2/hpack/huffman.go | 190 - vendor/golang.org/x/net/http2/hpack/tables.go | 352 - vendor/golang.org/x/net/lex/httplex/LICENSE | 27 - vendor/golang.org/x/net/lex/httplex/httplex.go | 312 - vendor/golang.org/x/net/websocket/LICENSE | 27 - vendor/golang.org/x/sys/AUTHORS | 3 + vendor/golang.org/x/sys/CONTRIBUTORS | 3 + vendor/golang.org/x/sys/LICENSE | 27 + vendor/golang.org/x/sys/PATENTS | 22 + vendor/golang.org/x/sys/unix/.gitignore | 1 + vendor/golang.org/x/sys/unix/LICENSE | 27 - vendor/golang.org/x/sys/unix/README.md | 173 + vendor/golang.org/x/sys/unix/linux/mkall.go | 482 - vendor/golang.org/x/sys/unix/linux/types.go | 596 - vendor/golang.org/x/sys/unix/mkall.sh | 188 + vendor/golang.org/x/sys/unix/mkerrors.sh | 577 + vendor/golang.org/x/sys/unix/mksyscall.pl | 328 + vendor/golang.org/x/sys/unix/mksyscall_solaris.pl | 289 + vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl | 264 + vendor/golang.org/x/sys/unix/mksysnum_darwin.pl | 39 + vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl | 50 + vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl | 50 + vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl | 58 + vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl | 50 + vendor/golang.org/x/sys/windows/LICENSE | 27 - vendor/golang.org/x/sys/windows/registry/key.go | 200 - .../golang.org/x/sys/windows/registry/mksyscall.go | 7 - .../golang.org/x/sys/windows/registry/syscall.go | 32 - vendor/golang.org/x/sys/windows/registry/value.go | 384 - .../x/sys/windows/registry/zsyscall_windows.go | 120 - vendor/golang.org/x/sys/windows/svc/debug/log.go | 56 - .../golang.org/x/sys/windows/svc/debug/service.go | 45 - vendor/golang.org/x/sys/windows/svc/event.go | 48 - .../x/sys/windows/svc/eventlog/install.go | 80 - .../golang.org/x/sys/windows/svc/eventlog/log.go | 70 - .../golang.org/x/sys/windows/svc/example/beep.go | 22 - .../x/sys/windows/svc/example/install.go | 92 - .../golang.org/x/sys/windows/svc/example/main.go | 76 - .../golang.org/x/sys/windows/svc/example/manage.go | 62 - .../x/sys/windows/svc/example/service.go | 82 - vendor/golang.org/x/sys/windows/svc/go12.c | 24 - vendor/golang.org/x/sys/windows/svc/go12.go | 11 - vendor/golang.org/x/sys/windows/svc/go13.go | 31 - vendor/golang.org/x/sys/windows/svc/mgr/config.go | 139 - vendor/golang.org/x/sys/windows/svc/mgr/mgr.go | 162 - vendor/golang.org/x/sys/windows/svc/mgr/service.go | 72 - vendor/golang.org/x/sys/windows/svc/security.go | 62 - vendor/golang.org/x/sys/windows/svc/service.go | 363 - vendor/golang.org/x/sys/windows/svc/sys_386.s | 68 - vendor/golang.org/x/sys/windows/svc/sys_amd64.s | 42 - vendor/golang.org/x/text/AUTHORS | 3 + vendor/golang.org/x/text/CONTRIBUTORS | 3 + vendor/golang.org/x/text/LICENSE | 27 + vendor/golang.org/x/text/PATENTS | 22 + vendor/golang.org/x/text/encoding/LICENSE | 27 - .../golang.org/x/text/encoding/charmap/charmap.go | 249 - .../x/text/encoding/charmap/maketables.go | 556 - .../golang.org/x/text/encoding/charmap/tables.go | 7410 --- vendor/golang.org/x/text/encoding/htmlindex/gen.go | 173 - .../x/text/encoding/htmlindex/htmlindex.go | 86 - vendor/golang.org/x/text/encoding/htmlindex/map.go | 105 - .../golang.org/x/text/encoding/htmlindex/tables.go | 352 - vendor/golang.org/x/text/encoding/ianaindex/gen.go | 192 - .../x/text/encoding/ianaindex/ianaindex.go | 209 - .../golang.org/x/text/encoding/ianaindex/tables.go | 2348 - .../x/text/encoding/internal/enctest/enctest.go | 180 - .../golang.org/x/text/encoding/unicode/override.go | 82 - .../golang.org/x/text/encoding/unicode/unicode.go | 434 - .../x/text/encoding/unicode/utf32/utf32.go | 296 - vendor/golang.org/x/text/internal/format/LICENSE | 27 - vendor/golang.org/x/text/internal/format/format.go | 41 - vendor/golang.org/x/text/internal/format/parser.go | 358 - vendor/golang.org/x/text/internal/gen/LICENSE | 27 - .../x/text/internal/gen/bitfield/bitfield.go | 226 - vendor/golang.org/x/text/internal/gen/code.go | 371 - vendor/golang.org/x/text/internal/gen/gen.go | 333 - vendor/golang.org/x/text/internal/language/LICENSE | 27 - .../golang.org/x/text/internal/language/common.go | 16 - .../golang.org/x/text/internal/language/compact.go | 29 - .../x/text/internal/language/compact/compact.go | 61 - .../x/text/internal/language/compact/gen.go | 64 - .../x/text/internal/language/compact/gen_index.go | 113 - .../text/internal/language/compact/gen_parents.go | 54 - .../x/text/internal/language/compact/language.go | 260 - .../x/text/internal/language/compact/parents.go | 120 - .../x/text/internal/language/compact/tables.go | 1015 - .../x/text/internal/language/compact/tags.go | 91 - .../golang.org/x/text/internal/language/compose.go | 167 - .../x/text/internal/language/coverage.go | 28 - vendor/golang.org/x/text/internal/language/gen.go | 1520 - .../x/text/internal/language/gen_common.go | 20 - .../x/text/internal/language/language.go | 596 - .../golang.org/x/text/internal/language/lookup.go | 412 - .../golang.org/x/text/internal/language/match.go | 226 - .../golang.org/x/text/internal/language/parse.go | 594 - .../golang.org/x/text/internal/language/tables.go | 3431 -- vendor/golang.org/x/text/internal/language/tags.go | 48 - vendor/golang.org/x/text/internal/tag/LICENSE | 27 - vendor/golang.org/x/text/internal/tag/tag.go | 100 - vendor/golang.org/x/text/internal/triegen/LICENSE | 27 - .../golang.org/x/text/internal/triegen/compact.go | 58 - vendor/golang.org/x/text/internal/triegen/print.go | 251 - .../golang.org/x/text/internal/triegen/triegen.go | 494 - vendor/golang.org/x/text/internal/ucd/LICENSE | 27 - vendor/golang.org/x/text/internal/ucd/ucd.go | 371 - .../x/text/internal/utf8internal/LICENSE | 27 - .../x/text/internal/utf8internal/utf8internal.go | 87 - vendor/golang.org/x/text/language/LICENSE | 27 - vendor/golang.org/x/text/language/coverage.go | 187 - vendor/golang.org/x/text/language/display/dict.go | 92 - .../golang.org/x/text/language/display/display.go | 420 - .../golang.org/x/text/language/display/lookup.go | 251 - .../x/text/language/display/maketables.go | 602 - .../golang.org/x/text/language/display/tables.go | 53114 ------------------- vendor/golang.org/x/text/language/doc.go | 102 - vendor/golang.org/x/text/language/gen.go | 305 - vendor/golang.org/x/text/language/go1_1.go | 38 - vendor/golang.org/x/text/language/go1_2.go | 11 - vendor/golang.org/x/text/language/language.go | 596 - vendor/golang.org/x/text/language/match.go | 735 - vendor/golang.org/x/text/language/parse.go | 228 - vendor/golang.org/x/text/language/tables.go | 298 - vendor/golang.org/x/text/language/tags.go | 145 - vendor/golang.org/x/text/runes/LICENSE | 27 - vendor/golang.org/x/text/runes/cond.go | 187 - vendor/golang.org/x/text/runes/runes.go | 355 - vendor/golang.org/x/text/transform/LICENSE | 27 - vendor/golang.org/x/text/unicode/cldr/LICENSE | 27 - vendor/golang.org/x/text/unicode/cldr/base.go | 105 - vendor/golang.org/x/text/unicode/cldr/cldr.go | 130 - vendor/golang.org/x/text/unicode/cldr/collate.go | 359 - vendor/golang.org/x/text/unicode/cldr/decode.go | 171 - vendor/golang.org/x/text/unicode/cldr/makexml.go | 400 - vendor/golang.org/x/text/unicode/cldr/resolve.go | 602 - vendor/golang.org/x/text/unicode/cldr/slice.go | 144 - vendor/golang.org/x/text/unicode/cldr/xml.go | 1494 - vendor/golang.org/x/text/unicode/norm/LICENSE | 27 - vendor/gopkg.in/airbrake/gobrake.v2/LICENSE | 27 - vendor/gopkg.in/airbrake/gobrake.v2/gobrake.go | 16 - vendor/gopkg.in/airbrake/gobrake.v2/notice.go | 105 - vendor/gopkg.in/airbrake/gobrake.v2/notifier.go | 280 - vendor/gopkg.in/airbrake/gobrake.v2/util.go | 59 - .../gemnasium/logrus-airbrake-hook.v2/LICENSE | 21 - .../gemnasium/logrus-airbrake-hook.v2/airbrake.go | 71 - vendor/gopkg.in/yaml.v2/.travis.yml | 9 + vendor/gopkg.in/yaml.v2/LICENSE.libyaml | 31 + vendor/gopkg.in/yaml.v2/README.md | 131 + vendor/manifest | 1192 - vendor/modules.txt | 174 + 1127 files changed, 17607 insertions(+), 422130 deletions(-) create mode 100644 vendor/github.com/42wim/go-gitter/.gitignore create mode 100644 vendor/github.com/42wim/go-gitter/README.md delete mode 100644 vendor/github.com/42wim/go-ircevent/LICENSE delete mode 100644 vendor/github.com/42wim/go-ircevent/irc.go delete mode 100644 vendor/github.com/42wim/go-ircevent/irc_callback.go delete mode 100644 vendor/github.com/42wim/go-ircevent/irc_sasl.go delete mode 100644 vendor/github.com/42wim/go-ircevent/irc_struct.go delete mode 100644 vendor/github.com/42wim/go-ircevent/irc_test_fuzz.go create mode 100644 vendor/github.com/BurntSushi/toml/.gitignore create mode 100644 vendor/github.com/BurntSushi/toml/.travis.yml create mode 100644 vendor/github.com/BurntSushi/toml/COMPATIBLE create mode 100644 vendor/github.com/BurntSushi/toml/Makefile create mode 100644 vendor/github.com/BurntSushi/toml/README.md delete mode 100644 vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go delete mode 100644 vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go delete mode 100644 vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go create mode 100644 vendor/github.com/BurntSushi/toml/session.vim delete mode 100644 vendor/github.com/GeertJohan/go.rice/LICENSE delete mode 100644 vendor/github.com/GeertJohan/go.rice/appended.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/box.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/config.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/debug.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/embedded.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/embedded/embedded.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/example/example.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/file.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/http.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/append.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/clean.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/embed-go.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/embed-syso.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/find.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/flags.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/identifier.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/main.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/templates.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/util.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/rice/writecoff.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/sort.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/virtual.go delete mode 100644 vendor/github.com/GeertJohan/go.rice/walk.go create mode 100644 vendor/github.com/Philipp15b/go-steam/.gitignore create mode 100644 vendor/github.com/Philipp15b/go-steam/.gitmodules create mode 100644 vendor/github.com/Philipp15b/go-steam/README.md delete mode 100644 vendor/github.com/Philipp15b/go-steam/community/community.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/base.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client_fantasy.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_common.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/econ.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/gcsdk.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/system.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory_apps.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/economy/inventory/own.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/economy/inventory/partial.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/generator/generator.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/gsbot/gsbot.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/gsbot/gsbot/gsbot.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/jsont/jsont.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/base.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/cloud.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/credentials.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/deviceauth.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/gamenotifications.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/offline.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/parental.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/partnerapps.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/player.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/publishedfile.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/protocol/econ.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/base.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/econ.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/gcsdk.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/system.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/tf.pb.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tf2/tf2.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/trade/actions.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/trade/doc.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/trade/trade.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/trade/tradeapi/status.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/trade/tradeapi/trade.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/trade/types.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tradeoffer/client.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tradeoffer/error.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tradeoffer/escrow.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tradeoffer/receipt.go delete mode 100644 vendor/github.com/Philipp15b/go-steam/tradeoffer/tradeoffer.go create mode 100644 vendor/github.com/alecthomas/log4go/.gitignore create mode 100644 vendor/github.com/alecthomas/log4go/README delete mode 100644 vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go delete mode 100644 vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go delete mode 100644 vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go delete mode 100644 vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go delete mode 100644 vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go delete mode 100644 vendor/github.com/armon/consul-api/LICENSE delete mode 100644 vendor/github.com/armon/consul-api/acl.go delete mode 100644 vendor/github.com/armon/consul-api/agent.go delete mode 100644 vendor/github.com/armon/consul-api/api.go delete mode 100644 vendor/github.com/armon/consul-api/catalog.go delete mode 100644 vendor/github.com/armon/consul-api/event.go delete mode 100644 vendor/github.com/armon/consul-api/health.go delete mode 100644 vendor/github.com/armon/consul-api/kv.go delete mode 100644 vendor/github.com/armon/consul-api/session.go delete mode 100644 vendor/github.com/armon/consul-api/status.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/LICENSE delete mode 100644 vendor/github.com/bwmarrin/discordgo/discord.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/endpoints.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/event.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/eventhandlers.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/events.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/examples/airhorn/main.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/examples/appmaker/main.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/examples/avatar/main.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/examples/pingpong/main.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/logging.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/message.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/oauth2.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/ratelimit.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/restapi.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/state.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/structs.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/types.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/user.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/voice.go delete mode 100644 vendor/github.com/bwmarrin/discordgo/wsapi.go delete mode 100644 vendor/github.com/coreos/etcd/client/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/client/auth_role.go delete mode 100644 vendor/github.com/coreos/etcd/client/auth_user.go delete mode 100644 vendor/github.com/coreos/etcd/client/cancelreq.go delete mode 100644 vendor/github.com/coreos/etcd/client/client.go delete mode 100644 vendor/github.com/coreos/etcd/client/cluster_error.go delete mode 100644 vendor/github.com/coreos/etcd/client/curl.go delete mode 100644 vendor/github.com/coreos/etcd/client/discover.go delete mode 100644 vendor/github.com/coreos/etcd/client/doc.go delete mode 100644 vendor/github.com/coreos/etcd/client/integration/doc.go delete mode 100644 vendor/github.com/coreos/etcd/client/keys.generated.go delete mode 100644 vendor/github.com/coreos/etcd/client/keys.go delete mode 100644 vendor/github.com/coreos/etcd/client/members.go delete mode 100644 vendor/github.com/coreos/etcd/client/util.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/pathutil/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/pkg/pathutil/path.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/srv/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/pkg/srv/srv.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/doc.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/id.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/set.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/slice.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/urls.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/urlsmap.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/semver.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/sort.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/0doc.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/binc.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/cbor.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/decode.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/encode.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.generated.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.not.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen-helper.generated.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.generated.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_internal.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_unsafe.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/json.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/msgpack.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/noop.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/rpc.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/simple.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/time.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/xml.go delete mode 100644 vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/z.go delete mode 100644 vendor/github.com/coreos/etcd/version/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/version/version.go delete mode 100644 vendor/github.com/daaku/go.zipexe/license delete mode 100644 vendor/github.com/daaku/go.zipexe/zipexe.go create mode 100644 vendor/github.com/davecgh/go-spew/LICENSE delete mode 100644 vendor/github.com/davecgh/go-spew/spew/LICENSE create mode 100644 vendor/github.com/dfordsoft/golib/LICENSE delete mode 100644 vendor/github.com/dfordsoft/golib/ic/LICENSE create mode 100644 vendor/github.com/dgrijalva/jwt-go/.gitignore create mode 100644 vendor/github.com/dgrijalva/jwt-go/.travis.yml create mode 100644 vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md create mode 100644 vendor/github.com/dgrijalva/jwt-go/README.md create mode 100644 vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md delete mode 100644 vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go delete mode 100644 vendor/github.com/dgrijalva/jwt-go/cmd/jwt/args.go delete mode 100644 vendor/github.com/dgrijalva/jwt-go/request/doc.go delete mode 100644 vendor/github.com/dgrijalva/jwt-go/request/extractor.go delete mode 100644 vendor/github.com/dgrijalva/jwt-go/request/oauth2.go delete mode 100644 vendor/github.com/dgrijalva/jwt-go/request/request.go delete mode 100644 vendor/github.com/dgrijalva/jwt-go/test/helpers.go delete mode 100644 vendor/github.com/facebookgo/clock/LICENSE delete mode 100644 vendor/github.com/facebookgo/clock/clock.go delete mode 100644 vendor/github.com/facebookgo/grace/gracehttp/http.go delete mode 100644 vendor/github.com/facebookgo/grace/gracehttp/license delete mode 100644 vendor/github.com/facebookgo/grace/gracenet/license delete mode 100644 vendor/github.com/facebookgo/grace/gracenet/net.go delete mode 100644 vendor/github.com/facebookgo/httpdown/httpdown.go delete mode 100644 vendor/github.com/facebookgo/httpdown/httpdown_example/main.go delete mode 100644 vendor/github.com/facebookgo/httpdown/license delete mode 100644 vendor/github.com/facebookgo/stats/aggregation.go delete mode 100644 vendor/github.com/facebookgo/stats/counter.go delete mode 100644 vendor/github.com/facebookgo/stats/license delete mode 100644 vendor/github.com/facebookgo/stats/stats.go delete mode 100644 vendor/github.com/facebookgo/stats/stopper.go create mode 100644 vendor/github.com/fsnotify/fsnotify/.editorconfig create mode 100644 vendor/github.com/fsnotify/fsnotify/.gitignore create mode 100644 vendor/github.com/fsnotify/fsnotify/.travis.yml create mode 100644 vendor/github.com/fsnotify/fsnotify/AUTHORS create mode 100644 vendor/github.com/fsnotify/fsnotify/CHANGELOG.md create mode 100644 vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md create mode 100644 vendor/github.com/fsnotify/fsnotify/README.md create mode 100644 vendor/github.com/go-telegram-bot-api/telegram-bot-api/.gitignore create mode 100644 vendor/github.com/go-telegram-bot-api/telegram-bot-api/.travis.yml create mode 100644 vendor/github.com/go-telegram-bot-api/telegram-bot-api/README.md create mode 100644 vendor/github.com/golang/protobuf/AUTHORS create mode 100644 vendor/github.com/golang/protobuf/CONTRIBUTORS create mode 100644 vendor/github.com/golang/protobuf/LICENSE delete mode 100644 vendor/github.com/golang/protobuf/proto/LICENSE create mode 100644 vendor/github.com/golang/protobuf/proto/Makefile delete mode 100644 vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/LICENSE create mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any/LICENSE delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any/any.pb.go delete mode 100644 vendor/github.com/google/go-querystring/query/LICENSE delete mode 100644 vendor/github.com/google/go-querystring/query/encode.go create mode 100644 vendor/github.com/google/gops/LICENSE delete mode 100644 vendor/github.com/google/gops/agent/LICENSE delete mode 100644 vendor/github.com/google/gops/internal/LICENSE delete mode 100644 vendor/github.com/google/gops/internal/dwarf/dwarf.go delete mode 100644 vendor/github.com/google/gops/internal/dwarf/dwarf_defs.go delete mode 100644 vendor/github.com/google/gops/internal/goobj/read.go delete mode 100644 vendor/github.com/google/gops/internal/obj/addrtype_string.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm/a.out.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm/anames.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm/anames5.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm/asm5.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm/list5.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm/obj5.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm64/a.out.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm64/anames.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm64/anames7.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm64/asm7.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm64/list7.go delete mode 100644 vendor/github.com/google/gops/internal/obj/arm64/obj7.go delete mode 100644 vendor/github.com/google/gops/internal/obj/data.go delete mode 100644 vendor/github.com/google/gops/internal/obj/flag.go delete mode 100644 vendor/github.com/google/gops/internal/obj/funcdata.go delete mode 100644 vendor/github.com/google/gops/internal/obj/go.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ld.go delete mode 100644 vendor/github.com/google/gops/internal/obj/link.go delete mode 100644 vendor/github.com/google/gops/internal/obj/mips/a.out.go delete mode 100644 vendor/github.com/google/gops/internal/obj/mips/anames.go delete mode 100644 vendor/github.com/google/gops/internal/obj/mips/anames0.go delete mode 100644 vendor/github.com/google/gops/internal/obj/mips/asm0.go delete mode 100644 vendor/github.com/google/gops/internal/obj/mips/list0.go delete mode 100644 vendor/github.com/google/gops/internal/obj/mips/obj0.go delete mode 100644 vendor/github.com/google/gops/internal/obj/obj.go delete mode 100644 vendor/github.com/google/gops/internal/obj/objfile.go delete mode 100644 vendor/github.com/google/gops/internal/obj/pass.go delete mode 100644 vendor/github.com/google/gops/internal/obj/pcln.go delete mode 100644 vendor/github.com/google/gops/internal/obj/plist.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ppc64/a.out.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ppc64/anames.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ppc64/anames9.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ppc64/asm9.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ppc64/list9.go delete mode 100644 vendor/github.com/google/gops/internal/obj/ppc64/obj9.go delete mode 100644 vendor/github.com/google/gops/internal/obj/reloctype_string.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/a.out.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/anames.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/anamesz.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/asmz.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/listz.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/objz.go delete mode 100644 vendor/github.com/google/gops/internal/obj/s390x/vector.go delete mode 100644 vendor/github.com/google/gops/internal/obj/stack.go delete mode 100644 vendor/github.com/google/gops/internal/obj/stringer.go delete mode 100644 vendor/github.com/google/gops/internal/obj/sym.go delete mode 100644 vendor/github.com/google/gops/internal/obj/symkind_string.go delete mode 100644 vendor/github.com/google/gops/internal/obj/textflag.go delete mode 100644 vendor/github.com/google/gops/internal/obj/typekind.go delete mode 100644 vendor/github.com/google/gops/internal/obj/util.go delete mode 100644 vendor/github.com/google/gops/internal/obj/x86/a.out.go delete mode 100644 vendor/github.com/google/gops/internal/obj/x86/anames.go delete mode 100644 vendor/github.com/google/gops/internal/obj/x86/asm6.go delete mode 100644 vendor/github.com/google/gops/internal/obj/x86/list6.go delete mode 100644 vendor/github.com/google/gops/internal/obj/x86/obj6.go delete mode 100644 vendor/github.com/google/gops/internal/obj/zbootstrap.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/disasm.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/elf.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/goobj.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/macho.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/objfile.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/pe.go delete mode 100644 vendor/github.com/google/gops/internal/objfile/plan9obj.go delete mode 100644 vendor/github.com/google/gops/internal/sys/arch.go delete mode 100644 vendor/github.com/google/gops/signal/LICENSE create mode 100644 vendor/github.com/gorilla/schema/.travis.yml create mode 100644 vendor/github.com/gorilla/schema/README.md create mode 100644 vendor/github.com/gorilla/websocket/.gitignore create mode 100644 vendor/github.com/gorilla/websocket/.travis.yml create mode 100644 vendor/github.com/gorilla/websocket/AUTHORS create mode 100644 vendor/github.com/gorilla/websocket/README.md delete mode 100644 vendor/github.com/gorilla/websocket/examples/autobahn/server.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/chat/client.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/chat/hub.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/chat/main.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/command/main.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/echo/client.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/echo/server.go delete mode 100644 vendor/github.com/gorilla/websocket/examples/filewatch/main.go delete mode 100644 vendor/github.com/gorilla/websocket/proxy.go delete mode 100644 vendor/github.com/gorilla/websocket/x_net_proxy.go create mode 100644 vendor/github.com/hashicorp/golang-lru/.gitignore create mode 100644 vendor/github.com/hashicorp/golang-lru/README.md create mode 100644 vendor/github.com/hashicorp/hcl/.gitignore create mode 100644 vendor/github.com/hashicorp/hcl/.travis.yml create mode 100644 vendor/github.com/hashicorp/hcl/Makefile create mode 100644 vendor/github.com/hashicorp/hcl/README.md create mode 100644 vendor/github.com/hashicorp/hcl/appveyor.yml delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go delete mode 100644 vendor/github.com/hashicorp/hcl/testhelper/unix2dos.go create mode 100644 vendor/github.com/jpillora/backoff/README.md create mode 100644 vendor/github.com/kardianos/osext/README.md delete mode 100644 vendor/github.com/kr/fs/LICENSE delete mode 100644 vendor/github.com/kr/fs/filesystem.go delete mode 100644 vendor/github.com/kr/fs/walk.go create mode 100644 vendor/github.com/labstack/echo/.editorconfig create mode 100644 vendor/github.com/labstack/echo/.gitattributes create mode 100644 vendor/github.com/labstack/echo/.gitignore create mode 100644 vendor/github.com/labstack/echo/.travis.yml create mode 100644 vendor/github.com/labstack/echo/Gopkg.lock create mode 100644 vendor/github.com/labstack/echo/Makefile create mode 100644 vendor/github.com/labstack/echo/README.md create mode 100644 vendor/github.com/labstack/gommon/LICENSE delete mode 100644 vendor/github.com/labstack/gommon/bytes/LICENSE create mode 100644 vendor/github.com/labstack/gommon/bytes/README.md delete mode 100644 vendor/github.com/labstack/gommon/color/LICENSE create mode 100644 vendor/github.com/labstack/gommon/color/README.md delete mode 100644 vendor/github.com/labstack/gommon/log/LICENSE create mode 100644 vendor/github.com/labstack/gommon/log/README.md delete mode 100644 vendor/github.com/labstack/gommon/random/LICENSE create mode 100644 vendor/github.com/lrstanley/girc/.travis.yml create mode 100644 vendor/github.com/lrstanley/girc/CONTRIBUTING.md create mode 100644 vendor/github.com/lrstanley/girc/README.md delete mode 100644 vendor/github.com/lrstanley/girc/cmdhandler/cmd.go create mode 100644 vendor/github.com/magiconair/properties/.gitignore create mode 100644 vendor/github.com/magiconair/properties/.travis.yml create mode 100644 vendor/github.com/magiconair/properties/CHANGELOG.md create mode 100644 vendor/github.com/magiconair/properties/README.md delete mode 100644 vendor/github.com/magiconair/properties/assert/assert.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/LICENSE delete mode 100644 vendor/github.com/matrix-org/gomatrix/client.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/events.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/filter.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/requests.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/responses.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/room.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/store.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/sync.go delete mode 100644 vendor/github.com/matrix-org/gomatrix/userids.go create mode 100644 vendor/github.com/matterbridge/discordgo/.travis.yml create mode 100644 vendor/github.com/matterbridge/discordgo/README.md delete mode 100644 vendor/github.com/matterbridge/discordgo/examples/airhorn/main.go delete mode 100644 vendor/github.com/matterbridge/discordgo/examples/appmaker/main.go delete mode 100644 vendor/github.com/matterbridge/discordgo/examples/avatar/main.go delete mode 100644 vendor/github.com/matterbridge/discordgo/examples/mytoken/main.go delete mode 100644 vendor/github.com/matterbridge/discordgo/examples/pingpong/main.go create mode 100644 vendor/github.com/matterbridge/discordgo/mkdocs.yml delete mode 100644 vendor/github.com/matterbridge/discordgo/tools/cmd/eventhandlers/main.go create mode 100644 vendor/github.com/matterbridge/go-xmpp/.travis.yml create mode 100644 vendor/github.com/matterbridge/go-xmpp/README.md create mode 100644 vendor/github.com/matterbridge/gomatrix/.gitignore create mode 100644 vendor/github.com/matterbridge/gomatrix/.travis.yml create mode 100644 vendor/github.com/matterbridge/gomatrix/README.md create mode 100644 vendor/github.com/matterbridge/gozulipbot/.gitignore create mode 100644 vendor/github.com/matterbridge/gozulipbot/README.md create mode 100644 vendor/github.com/matterbridge/logrus-prefixed-formatter/.gitignore create mode 100644 vendor/github.com/matterbridge/logrus-prefixed-formatter/.travis.yml create mode 100644 vendor/github.com/matterbridge/logrus-prefixed-formatter/Makefile create mode 100644 vendor/github.com/matterbridge/logrus-prefixed-formatter/README.md delete mode 100644 vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/basic.go delete mode 100644 vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/themes.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/account_migration.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/brand.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/cluster.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/compliance.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/data_retention.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/elasticsearch.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/emoji.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/data_retention.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/elasticsearch.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/ldap_sync.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/message_export.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/ldap.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/message_export.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/metrics.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/mfa.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/oauthproviders.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/einterfaces/saml.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/access.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/analytics_row.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/audit.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/audits.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/authorization.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/authorize.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/builtin.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/bundle_info.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_count.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_data.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_list.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_member.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_member_history.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_search.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_stats.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/channel_view.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/client.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/client4.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/cluster_discovery.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/cluster_info.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/cluster_message.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/cluster_stats.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/command.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/command_args.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/command_response.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/command_webhook.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/compliance.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/compliance_post.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/config.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/data_retention_policy.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/emoji.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/emoji_search.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/file.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/file_info.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/gitlab.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/gitlab/gitlab.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/incoming_webhook.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/initial_load.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/job.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/ldap.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/license.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/manifest.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/message_export.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/mfa_secret.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/oauth.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/outgoing_webhook.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/plugin_key_value.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/plugins_response.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/post.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/post_list.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/preference.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/preferences.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/push_notification.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/push_response.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/reaction.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/saml.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/scheduled_task.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/search_params.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/security_bulletin.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/session.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/slack_attachment.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/status.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/suggest_command.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/switch_request.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/system.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/team.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/team_member.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/team_search.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/team_stats.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/token.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/user.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/user_access_token.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/user_access_token_search.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/user_autocomplete.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/user_search.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/utils.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/version.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/webrtc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/websocket_client.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/websocket_message.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/model/websocket_request.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/config.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/filelog.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/log4go.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/pattlog.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/socklog.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/termlog.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/wrapper.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/add.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value_go13.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/bind.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/client.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/compare.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/conn.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/control.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/debug.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/del.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/dn.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/doc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/error.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/filter.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/ldap.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/modify.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/passwdmodify.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/search.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/dce.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/doc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/hash.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/marshal.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/node.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/sql.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/time.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/util.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/uuid.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version1.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version4.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/base64.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/bcrypt.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/block.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/cipher.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/const.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/ber.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/content_int.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/header.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/identifier.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/length.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/util.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/apic.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/decode.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/emitterc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/encode.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/parserc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/readerc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/resolve.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/scannerc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/sorter.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/writerc.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yaml.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlh.go delete mode 100644 vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlprivateh.go create mode 100644 vendor/github.com/mattermost/platform/LICENSE.txt create mode 100644 vendor/github.com/mattermost/platform/NOTICE.txt delete mode 100644 vendor/github.com/mattermost/platform/model/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/platform/model/gitlab/gitlab.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/bundle/bundle.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/i18n.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/language.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/operands.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/plural.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec_gen.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/plural_translation.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/template.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/translation.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/test_program.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/doc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/fuzz.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/keysparsing.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/lexer.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/marshal.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/parser.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/position.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/doc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/lexer.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/match.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/parser.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/query.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/tokens.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/token.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/toml.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_create.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_write.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/LICENSE.txt delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/apic.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/decode.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/emitterc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/encode.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/parserc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/readerc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/resolve.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/scannerc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/sorter.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/writerc.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yaml.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlh.go delete mode 100644 vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlprivateh.go create mode 100644 vendor/github.com/mattn/go-colorable/.travis.yml create mode 100644 vendor/github.com/mattn/go-colorable/README.md create mode 100644 vendor/github.com/mattn/go-isatty/.travis.yml create mode 100644 vendor/github.com/mattn/go-isatty/README.md create mode 100644 vendor/github.com/mgutz/ansi/.gitignore create mode 100644 vendor/github.com/mgutz/ansi/README.md delete mode 100644 vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go create mode 100644 vendor/github.com/mitchellh/mapstructure/.travis.yml create mode 100644 vendor/github.com/mitchellh/mapstructure/README.md create mode 100644 vendor/github.com/mreiferson/go-httpclient/.gitignore create mode 100644 vendor/github.com/mreiferson/go-httpclient/.travis.yml create mode 100644 vendor/github.com/mreiferson/go-httpclient/README.md create mode 100644 vendor/github.com/mrexodia/wray/README.markdown delete mode 100644 vendor/github.com/mrexodia/wray/examples/client.go delete mode 100644 vendor/github.com/mrexodia/wray/examples/publish.go create mode 100644 vendor/github.com/nicksnyder/go-i18n/LICENSE delete mode 100644 vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE delete mode 100644 vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go create mode 100644 vendor/github.com/nlopes/slack/.gitignore create mode 100644 vendor/github.com/nlopes/slack/.travis.yml create mode 100644 vendor/github.com/nlopes/slack/CHANGELOG.md create mode 100644 vendor/github.com/nlopes/slack/README.md create mode 100644 vendor/github.com/nlopes/slack/TODO.txt delete mode 100644 vendor/github.com/nlopes/slack/examples/channels/channels.go delete mode 100644 vendor/github.com/nlopes/slack/examples/files/files.go delete mode 100644 vendor/github.com/nlopes/slack/examples/groups/groups.go delete mode 100644 vendor/github.com/nlopes/slack/examples/ims/ims.go delete mode 100644 vendor/github.com/nlopes/slack/examples/messages/messages.go delete mode 100644 vendor/github.com/nlopes/slack/examples/pins/pins.go delete mode 100644 vendor/github.com/nlopes/slack/examples/reactions/reactions.go delete mode 100644 vendor/github.com/nlopes/slack/examples/stars/stars.go delete mode 100644 vendor/github.com/nlopes/slack/examples/team/team.go delete mode 100644 vendor/github.com/nlopes/slack/examples/users/users.go delete mode 100644 vendor/github.com/nlopes/slack/examples/websocket/websocket.go delete mode 100644 vendor/github.com/paulrosania/go-charset/charset/iconv/iconv.go delete mode 100644 vendor/github.com/paulrosania/go-charset/charset/iconv/list_query.go delete mode 100644 vendor/github.com/paulrosania/go-charset/charset/iconv/list_static.go delete mode 100644 vendor/github.com/paulrosania/go-charset/cmd/tcs/tcs.go create mode 100644 vendor/github.com/pborman/uuid/.travis.yml create mode 100644 vendor/github.com/pborman/uuid/CONTRIBUTING.md create mode 100644 vendor/github.com/pborman/uuid/CONTRIBUTORS create mode 100644 vendor/github.com/pborman/uuid/README.md create mode 100644 vendor/github.com/pelletier/go-toml/.gitignore create mode 100644 vendor/github.com/pelletier/go-toml/.travis.yml create mode 100644 vendor/github.com/pelletier/go-toml/README.md create mode 100644 vendor/github.com/pelletier/go-toml/benchmark.json create mode 100644 vendor/github.com/pelletier/go-toml/benchmark.sh create mode 100644 vendor/github.com/pelletier/go-toml/benchmark.yml delete mode 100644 vendor/github.com/pelletier/go-toml/cmd/test_program.go delete mode 100644 vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go delete mode 100644 vendor/github.com/pelletier/go-toml/cmd/tomll/main.go create mode 100644 vendor/github.com/pelletier/go-toml/fuzz.sh delete mode 100644 vendor/github.com/pelletier/go-toml/query/doc.go delete mode 100644 vendor/github.com/pelletier/go-toml/query/lexer.go delete mode 100644 vendor/github.com/pelletier/go-toml/query/match.go delete mode 100644 vendor/github.com/pelletier/go-toml/query/parser.go delete mode 100644 vendor/github.com/pelletier/go-toml/query/query.go delete mode 100644 vendor/github.com/pelletier/go-toml/query/tokens.go create mode 100644 vendor/github.com/pelletier/go-toml/test.sh create mode 100644 vendor/github.com/peterhellberg/emojilib/.travis.yml create mode 100644 vendor/github.com/peterhellberg/emojilib/README.md delete mode 100644 vendor/github.com/peterhellberg/giphy/client.go delete mode 100644 vendor/github.com/peterhellberg/giphy/cmd/giphy/main.go delete mode 100644 vendor/github.com/peterhellberg/giphy/env.go delete mode 100644 vendor/github.com/peterhellberg/giphy/errors.go delete mode 100644 vendor/github.com/peterhellberg/giphy/gif.go delete mode 100644 vendor/github.com/peterhellberg/giphy/random.go delete mode 100644 vendor/github.com/peterhellberg/giphy/search.go delete mode 100644 vendor/github.com/peterhellberg/giphy/translate.go delete mode 100644 vendor/github.com/peterhellberg/giphy/trending.go delete mode 100644 vendor/github.com/peterhellberg/giphy/types.go delete mode 100644 vendor/github.com/pkg/errors/LICENSE delete mode 100644 vendor/github.com/pkg/errors/errors.go delete mode 100644 vendor/github.com/pkg/errors/stack.go delete mode 100644 vendor/github.com/pkg/sftp/LICENSE delete mode 100644 vendor/github.com/pkg/sftp/attrs.go delete mode 100644 vendor/github.com/pkg/sftp/attrs_stubs.go delete mode 100644 vendor/github.com/pkg/sftp/attrs_unix.go delete mode 100644 vendor/github.com/pkg/sftp/client.go delete mode 100644 vendor/github.com/pkg/sftp/conn.go delete mode 100644 vendor/github.com/pkg/sftp/debug.go delete mode 100644 vendor/github.com/pkg/sftp/examples/buffered-read-benchmark/main.go delete mode 100644 vendor/github.com/pkg/sftp/examples/buffered-write-benchmark/main.go delete mode 100644 vendor/github.com/pkg/sftp/examples/request-server/main.go delete mode 100644 vendor/github.com/pkg/sftp/examples/sftp-server/main.go delete mode 100644 vendor/github.com/pkg/sftp/examples/streaming-read-benchmark/main.go delete mode 100644 vendor/github.com/pkg/sftp/examples/streaming-write-benchmark/main.go delete mode 100644 vendor/github.com/pkg/sftp/match.go delete mode 100644 vendor/github.com/pkg/sftp/packet-manager.go delete mode 100644 vendor/github.com/pkg/sftp/packet-typing.go delete mode 100644 vendor/github.com/pkg/sftp/packet.go delete mode 100644 vendor/github.com/pkg/sftp/release.go delete mode 100644 vendor/github.com/pkg/sftp/request-attrs.go delete mode 100644 vendor/github.com/pkg/sftp/request-errors.go delete mode 100644 vendor/github.com/pkg/sftp/request-example.go delete mode 100644 vendor/github.com/pkg/sftp/request-interfaces.go delete mode 100644 vendor/github.com/pkg/sftp/request-server.go delete mode 100644 vendor/github.com/pkg/sftp/request-unix.go delete mode 100644 vendor/github.com/pkg/sftp/request.go delete mode 100644 vendor/github.com/pkg/sftp/request_windows.go delete mode 100644 vendor/github.com/pkg/sftp/server.go delete mode 100644 vendor/github.com/pkg/sftp/server_standalone/main.go delete mode 100644 vendor/github.com/pkg/sftp/server_statvfs_darwin.go delete mode 100644 vendor/github.com/pkg/sftp/server_statvfs_impl.go delete mode 100644 vendor/github.com/pkg/sftp/server_statvfs_linux.go delete mode 100644 vendor/github.com/pkg/sftp/server_statvfs_stubs.go delete mode 100644 vendor/github.com/pkg/sftp/server_stubs.go delete mode 100644 vendor/github.com/pkg/sftp/server_unix.go delete mode 100644 vendor/github.com/pkg/sftp/sftp.go create mode 100644 vendor/github.com/pmezard/go-difflib/LICENSE create mode 100644 vendor/github.com/pmezard/go-difflib/difflib/difflib.go create mode 100644 vendor/github.com/rs/xid/.appveyor.yml create mode 100644 vendor/github.com/rs/xid/.travis.yml create mode 100644 vendor/github.com/rs/xid/README.md create mode 100644 vendor/github.com/rs/xid/go.mod create mode 100644 vendor/github.com/russross/blackfriday/.gitignore create mode 100644 vendor/github.com/russross/blackfriday/.travis.yml create mode 100644 vendor/github.com/russross/blackfriday/README.md create mode 100644 vendor/github.com/russross/blackfriday/doc.go create mode 100644 vendor/github.com/saintfish/chardet/AUTHORS create mode 100644 vendor/github.com/saintfish/chardet/README.md create mode 100644 vendor/github.com/saintfish/chardet/icu-license.html delete mode 100644 vendor/github.com/satori/go.uuid/LICENSE delete mode 100644 vendor/github.com/satori/go.uuid/uuid.go create mode 100644 vendor/github.com/shazow/ssh-chat/LICENSE delete mode 100644 vendor/github.com/shazow/ssh-chat/sshd/LICENSE delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE delete mode 100644 vendor/github.com/shurcooL/sanitized_anchor_name/main.go create mode 100644 vendor/github.com/sirupsen/logrus/.gitignore create mode 100644 vendor/github.com/sirupsen/logrus/.travis.yml create mode 100644 vendor/github.com/sirupsen/logrus/CHANGELOG.md create mode 100644 vendor/github.com/sirupsen/logrus/README.md create mode 100644 vendor/github.com/sirupsen/logrus/appveyor.yml delete mode 100644 vendor/github.com/sirupsen/logrus/hooks/syslog/syslog.go delete mode 100644 vendor/github.com/sirupsen/logrus/hooks/test/test.go delete mode 100644 vendor/github.com/sorcix/irc/LICENSE delete mode 100644 vendor/github.com/sorcix/irc/constants.go delete mode 100644 vendor/github.com/sorcix/irc/ctcp/ctcp.go delete mode 100644 vendor/github.com/sorcix/irc/ctcp/doc.go delete mode 100644 vendor/github.com/sorcix/irc/doc.go delete mode 100644 vendor/github.com/sorcix/irc/message.go delete mode 100644 vendor/github.com/sorcix/irc/stream.go delete mode 100644 vendor/github.com/sorcix/irc/strings.go delete mode 100644 vendor/github.com/sorcix/irc/strings_legacy.go create mode 100644 vendor/github.com/spf13/afero/.travis.yml create mode 100644 vendor/github.com/spf13/afero/README.md create mode 100644 vendor/github.com/spf13/afero/appveyor.yml delete mode 100644 vendor/github.com/spf13/afero/sftpfs/file.go delete mode 100644 vendor/github.com/spf13/afero/sftpfs/sftp.go create mode 100644 vendor/github.com/spf13/cast/.gitignore create mode 100644 vendor/github.com/spf13/cast/.travis.yml create mode 100644 vendor/github.com/spf13/cast/Makefile create mode 100644 vendor/github.com/spf13/cast/README.md create mode 100644 vendor/github.com/spf13/jwalterweatherman/.gitignore create mode 100644 vendor/github.com/spf13/jwalterweatherman/README.md create mode 100644 vendor/github.com/spf13/pflag/.gitignore create mode 100644 vendor/github.com/spf13/pflag/.travis.yml create mode 100644 vendor/github.com/spf13/pflag/README.md create mode 100644 vendor/github.com/spf13/viper/.gitignore create mode 100644 vendor/github.com/spf13/viper/.travis.yml create mode 100644 vendor/github.com/spf13/viper/README.md create mode 100644 vendor/github.com/spf13/viper/nohup.out delete mode 100644 vendor/github.com/spf13/viper/remote/remote.go create mode 100644 vendor/github.com/stretchr/testify/LICENSE delete mode 100644 vendor/github.com/stretchr/testify/assert/LICENCE.txt delete mode 100644 vendor/github.com/stretchr/testify/assert/LICENSE create mode 100644 vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl create mode 100644 vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENCE.txt delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENSE delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENCE.txt delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENSE delete mode 100644 vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go create mode 100644 vendor/github.com/technoweenie/multipartstreamer/README.md delete mode 100644 vendor/github.com/technoweenie/multipartstreamer/examples/multipart.go delete mode 100644 vendor/github.com/technoweenie/multipartstreamer/examples/streamer.go delete mode 100644 vendor/github.com/tylerb/graceful/LICENSE delete mode 100644 vendor/github.com/tylerb/graceful/graceful.go delete mode 100644 vendor/github.com/tylerb/graceful/keepalive_listener.go delete mode 100644 vendor/github.com/tylerb/graceful/limit_listen.go delete mode 100644 vendor/github.com/tylerb/graceful/signal.go delete mode 100644 vendor/github.com/tylerb/graceful/signal_appengine.go delete mode 100644 vendor/github.com/tylerb/graceful/tests/main.go create mode 100644 vendor/github.com/valyala/bytebufferpool/.travis.yml create mode 100644 vendor/github.com/valyala/bytebufferpool/README.md create mode 100644 vendor/github.com/valyala/fasttemplate/README.md delete mode 100644 vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/bytebuffer.go delete mode 100644 vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/doc.go delete mode 100644 vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/pool.go delete mode 100644 vendor/github.com/x-cray/logrus-prefixed-formatter/LICENSE delete mode 100644 vendor/github.com/x-cray/logrus-prefixed-formatter/examples/basic.go delete mode 100644 vendor/github.com/x-cray/logrus-prefixed-formatter/examples/themes.go delete mode 100644 vendor/github.com/x-cray/logrus-prefixed-formatter/formatter.go delete mode 100644 vendor/github.com/xordataexchange/crypt/backend/LICENSE delete mode 100644 vendor/github.com/xordataexchange/crypt/backend/backend.go delete mode 100644 vendor/github.com/xordataexchange/crypt/backend/consul/consul.go delete mode 100644 vendor/github.com/xordataexchange/crypt/backend/etcd/etcd.go delete mode 100644 vendor/github.com/xordataexchange/crypt/backend/mock/mock.go delete mode 100644 vendor/github.com/xordataexchange/crypt/config/LICENSE delete mode 100644 vendor/github.com/xordataexchange/crypt/config/config.go delete mode 100644 vendor/github.com/xordataexchange/crypt/encoding/secconf/LICENSE delete mode 100644 vendor/github.com/xordataexchange/crypt/encoding/secconf/secconf.go create mode 100644 vendor/github.com/zfjagann/golang-ring/.gitignore create mode 100644 vendor/github.com/zfjagann/golang-ring/README.md create mode 100644 vendor/github.com/zfjagann/golang-ring/makefile delete mode 100644 vendor/golang.org/x/arch/arm/armasm/LICENSE delete mode 100644 vendor/golang.org/x/arch/arm/armasm/decode.go delete mode 100644 vendor/golang.org/x/arch/arm/armasm/gnu.go delete mode 100644 vendor/golang.org/x/arch/arm/armasm/inst.go delete mode 100644 vendor/golang.org/x/arch/arm/armasm/plan9x.go delete mode 100644 vendor/golang.org/x/arch/arm/armasm/tables.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/LICENSE delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/doc.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/field.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/inst.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go delete mode 100644 vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/LICENSE delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/decode.go delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/gnu.go delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/inst.go delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/intel.go delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/plan9x.go delete mode 100644 vendor/golang.org/x/arch/x86/x86asm/tables.go create mode 100644 vendor/golang.org/x/crypto/AUTHORS create mode 100644 vendor/golang.org/x/crypto/CONTRIBUTORS create mode 100644 vendor/golang.org/x/crypto/LICENSE create mode 100644 vendor/golang.org/x/crypto/PATENTS delete mode 100644 vendor/golang.org/x/crypto/acme/LICENSE create mode 100644 vendor/golang.org/x/crypto/acme/autocert/listener.go delete mode 100644 vendor/golang.org/x/crypto/bcrypt/LICENSE delete mode 100644 vendor/golang.org/x/crypto/blowfish/LICENSE delete mode 100644 vendor/golang.org/x/crypto/cast5/LICENSE delete mode 100644 vendor/golang.org/x/crypto/cast5/cast5.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/LICENSE delete mode 100644 vendor/golang.org/x/crypto/ed25519/LICENSE create mode 100644 vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go delete mode 100644 vendor/golang.org/x/crypto/nacl/secretbox/LICENSE delete mode 100644 vendor/golang.org/x/crypto/openpgp/LICENSE delete mode 100644 vendor/golang.org/x/crypto/openpgp/armor/armor.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/armor/encode.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/canonical_text.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/clearsign/clearsign.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/errors/errors.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/keys.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/compressed.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/config.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/literal.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/ocfb.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/opaque.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/packet.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/private_key.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/public_key.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/public_key_v3.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/reader.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/signature.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/signature_v3.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/userattribute.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/packet/userid.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/read.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/s2k/s2k.go delete mode 100644 vendor/golang.org/x/crypto/openpgp/write.go delete mode 100644 vendor/golang.org/x/crypto/poly1305/LICENSE delete mode 100644 vendor/golang.org/x/crypto/poly1305/const_amd64.s delete mode 100644 vendor/golang.org/x/crypto/poly1305/poly1305_amd64.s delete mode 100644 vendor/golang.org/x/crypto/poly1305/poly1305_arm.s create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_amd64.s create mode 100644 vendor/golang.org/x/crypto/poly1305/sum_arm.s delete mode 100644 vendor/golang.org/x/crypto/salsa20/salsa/LICENSE delete mode 100644 vendor/golang.org/x/crypto/ssh/LICENSE delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/client.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/forward.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/keyring.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/server.go delete mode 100644 vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go delete mode 100644 vendor/golang.org/x/crypto/ssh/test/doc.go create mode 100644 vendor/golang.org/x/net/AUTHORS create mode 100644 vendor/golang.org/x/net/CONTRIBUTORS create mode 100644 vendor/golang.org/x/net/LICENSE create mode 100644 vendor/golang.org/x/net/PATENTS delete mode 100644 vendor/golang.org/x/net/context/LICENSE delete mode 100644 vendor/golang.org/x/net/context/context.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go delete mode 100644 vendor/golang.org/x/net/context/go17.go delete mode 100644 vendor/golang.org/x/net/context/pre_go17.go delete mode 100644 vendor/golang.org/x/net/html/LICENSE delete mode 100644 vendor/golang.org/x/net/html/atom/atom.go delete mode 100644 vendor/golang.org/x/net/html/atom/gen.go delete mode 100644 vendor/golang.org/x/net/html/atom/table.go delete mode 100644 vendor/golang.org/x/net/html/charset/charset.go delete mode 100644 vendor/golang.org/x/net/html/const.go delete mode 100644 vendor/golang.org/x/net/html/doc.go delete mode 100644 vendor/golang.org/x/net/html/doctype.go delete mode 100644 vendor/golang.org/x/net/html/entity.go delete mode 100644 vendor/golang.org/x/net/html/escape.go delete mode 100644 vendor/golang.org/x/net/html/foreign.go delete mode 100644 vendor/golang.org/x/net/html/node.go delete mode 100644 vendor/golang.org/x/net/html/parse.go delete mode 100644 vendor/golang.org/x/net/html/render.go delete mode 100644 vendor/golang.org/x/net/html/token.go delete mode 100644 vendor/golang.org/x/net/http2/hpack/LICENSE delete mode 100644 vendor/golang.org/x/net/http2/hpack/encode.go delete mode 100644 vendor/golang.org/x/net/http2/hpack/hpack.go delete mode 100644 vendor/golang.org/x/net/http2/hpack/huffman.go delete mode 100644 vendor/golang.org/x/net/http2/hpack/tables.go delete mode 100644 vendor/golang.org/x/net/lex/httplex/LICENSE delete mode 100644 vendor/golang.org/x/net/lex/httplex/httplex.go delete mode 100644 vendor/golang.org/x/net/websocket/LICENSE create mode 100644 vendor/golang.org/x/sys/AUTHORS create mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS create mode 100644 vendor/golang.org/x/sys/LICENSE create mode 100644 vendor/golang.org/x/sys/PATENTS create mode 100644 vendor/golang.org/x/sys/unix/.gitignore delete mode 100644 vendor/golang.org/x/sys/unix/LICENSE create mode 100644 vendor/golang.org/x/sys/unix/README.md delete mode 100644 vendor/golang.org/x/sys/unix/linux/mkall.go delete mode 100644 vendor/golang.org/x/sys/unix/linux/types.go create mode 100644 vendor/golang.org/x/sys/unix/mkall.sh create mode 100644 vendor/golang.org/x/sys/unix/mkerrors.sh create mode 100644 vendor/golang.org/x/sys/unix/mksyscall.pl create mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_darwin.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl create mode 100644 vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl delete mode 100644 vendor/golang.org/x/sys/windows/LICENSE delete mode 100644 vendor/golang.org/x/sys/windows/registry/key.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/mksyscall.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/syscall.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/value.go delete mode 100644 vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/debug/log.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/debug/service.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/event.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/eventlog/install.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/eventlog/log.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/example/beep.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/example/install.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/example/main.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/example/manage.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/example/service.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/go12.c delete mode 100644 vendor/golang.org/x/sys/windows/svc/go12.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/go13.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/mgr/config.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/mgr/mgr.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/mgr/service.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/security.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/service.go delete mode 100644 vendor/golang.org/x/sys/windows/svc/sys_386.s delete mode 100644 vendor/golang.org/x/sys/windows/svc/sys_amd64.s create mode 100644 vendor/golang.org/x/text/AUTHORS create mode 100644 vendor/golang.org/x/text/CONTRIBUTORS create mode 100644 vendor/golang.org/x/text/LICENSE create mode 100644 vendor/golang.org/x/text/PATENTS delete mode 100644 vendor/golang.org/x/text/encoding/LICENSE delete mode 100644 vendor/golang.org/x/text/encoding/charmap/charmap.go delete mode 100644 vendor/golang.org/x/text/encoding/charmap/maketables.go delete mode 100644 vendor/golang.org/x/text/encoding/charmap/tables.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/map.go delete mode 100644 vendor/golang.org/x/text/encoding/htmlindex/tables.go delete mode 100644 vendor/golang.org/x/text/encoding/ianaindex/gen.go delete mode 100644 vendor/golang.org/x/text/encoding/ianaindex/ianaindex.go delete mode 100644 vendor/golang.org/x/text/encoding/ianaindex/tables.go delete mode 100644 vendor/golang.org/x/text/encoding/internal/enctest/enctest.go delete mode 100644 vendor/golang.org/x/text/encoding/unicode/override.go delete mode 100644 vendor/golang.org/x/text/encoding/unicode/unicode.go delete mode 100644 vendor/golang.org/x/text/encoding/unicode/utf32/utf32.go delete mode 100644 vendor/golang.org/x/text/internal/format/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/format/format.go delete mode 100644 vendor/golang.org/x/text/internal/format/parser.go delete mode 100644 vendor/golang.org/x/text/internal/gen/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/gen/bitfield/bitfield.go delete mode 100644 vendor/golang.org/x/text/internal/gen/code.go delete mode 100644 vendor/golang.org/x/text/internal/gen/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/language/common.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/compact.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_index.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/gen_parents.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/language.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/parents.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/tables.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/tags.go delete mode 100644 vendor/golang.org/x/text/internal/language/compose.go delete mode 100644 vendor/golang.org/x/text/internal/language/coverage.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen.go delete mode 100644 vendor/golang.org/x/text/internal/language/gen_common.go delete mode 100644 vendor/golang.org/x/text/internal/language/language.go delete mode 100644 vendor/golang.org/x/text/internal/language/lookup.go delete mode 100644 vendor/golang.org/x/text/internal/language/match.go delete mode 100644 vendor/golang.org/x/text/internal/language/parse.go delete mode 100644 vendor/golang.org/x/text/internal/language/tables.go delete mode 100644 vendor/golang.org/x/text/internal/language/tags.go delete mode 100644 vendor/golang.org/x/text/internal/tag/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/tag/tag.go delete mode 100644 vendor/golang.org/x/text/internal/triegen/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/triegen/compact.go delete mode 100644 vendor/golang.org/x/text/internal/triegen/print.go delete mode 100644 vendor/golang.org/x/text/internal/triegen/triegen.go delete mode 100644 vendor/golang.org/x/text/internal/ucd/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/ucd/ucd.go delete mode 100644 vendor/golang.org/x/text/internal/utf8internal/LICENSE delete mode 100644 vendor/golang.org/x/text/internal/utf8internal/utf8internal.go delete mode 100644 vendor/golang.org/x/text/language/LICENSE delete mode 100644 vendor/golang.org/x/text/language/coverage.go delete mode 100644 vendor/golang.org/x/text/language/display/dict.go delete mode 100644 vendor/golang.org/x/text/language/display/display.go delete mode 100644 vendor/golang.org/x/text/language/display/lookup.go delete mode 100644 vendor/golang.org/x/text/language/display/maketables.go delete mode 100644 vendor/golang.org/x/text/language/display/tables.go delete mode 100644 vendor/golang.org/x/text/language/doc.go delete mode 100644 vendor/golang.org/x/text/language/gen.go delete mode 100644 vendor/golang.org/x/text/language/go1_1.go delete mode 100644 vendor/golang.org/x/text/language/go1_2.go delete mode 100644 vendor/golang.org/x/text/language/language.go delete mode 100644 vendor/golang.org/x/text/language/match.go delete mode 100644 vendor/golang.org/x/text/language/parse.go delete mode 100644 vendor/golang.org/x/text/language/tables.go delete mode 100644 vendor/golang.org/x/text/language/tags.go delete mode 100644 vendor/golang.org/x/text/runes/LICENSE delete mode 100644 vendor/golang.org/x/text/runes/cond.go delete mode 100644 vendor/golang.org/x/text/runes/runes.go delete mode 100644 vendor/golang.org/x/text/transform/LICENSE delete mode 100644 vendor/golang.org/x/text/unicode/cldr/LICENSE delete mode 100644 vendor/golang.org/x/text/unicode/cldr/base.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/cldr.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/collate.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/decode.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/makexml.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/resolve.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/slice.go delete mode 100644 vendor/golang.org/x/text/unicode/cldr/xml.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/LICENSE delete mode 100644 vendor/gopkg.in/airbrake/gobrake.v2/LICENSE delete mode 100644 vendor/gopkg.in/airbrake/gobrake.v2/gobrake.go delete mode 100644 vendor/gopkg.in/airbrake/gobrake.v2/notice.go delete mode 100644 vendor/gopkg.in/airbrake/gobrake.v2/notifier.go delete mode 100644 vendor/gopkg.in/airbrake/gobrake.v2/util.go delete mode 100644 vendor/gopkg.in/gemnasium/logrus-airbrake-hook.v2/LICENSE delete mode 100644 vendor/gopkg.in/gemnasium/logrus-airbrake-hook.v2/airbrake.go create mode 100644 vendor/gopkg.in/yaml.v2/.travis.yml create mode 100644 vendor/gopkg.in/yaml.v2/LICENSE.libyaml create mode 100644 vendor/gopkg.in/yaml.v2/README.md delete mode 100644 vendor/manifest create mode 100644 vendor/modules.txt diff --git a/vendor/github.com/42wim/go-gitter/.gitignore b/vendor/github.com/42wim/go-gitter/.gitignore new file mode 100644 index 00000000..f8601221 --- /dev/null +++ b/vendor/github.com/42wim/go-gitter/.gitignore @@ -0,0 +1,3 @@ +.idea +/test +app.yaml \ No newline at end of file diff --git a/vendor/github.com/42wim/go-gitter/README.md b/vendor/github.com/42wim/go-gitter/README.md new file mode 100644 index 00000000..5d58526d --- /dev/null +++ b/vendor/github.com/42wim/go-gitter/README.md @@ -0,0 +1,154 @@ +# gitter +Gitter API in Go +https://developer.gitter.im + +#### Install + +`go get github.com/sromku/go-gitter` + +- [Initialize](#initialize) +- [Users](#users) +- [Rooms](#rooms) +- [Messages](#messages) +- [Stream](#stream) +- [Faye (Experimental)](#faye-experimental) +- [Debug](#debug) +- [App Engine](#app-engine) + +##### Initialize +``` Go +api := gitter.New("YOUR_ACCESS_TOKEN") +``` + +##### Users + +- Get current user + + ``` Go + user, err := api.GetUser() + ``` + +##### Rooms + +- Get all rooms + ``` Go + rooms, err := api.GetRooms() + ``` + +- Get room by id + ``` Go + room, err := api.GetRoom("roomID") + ``` + +- Get rooms of some user + ``` Go + rooms, err := api.GetRooms("userID") + ``` + +- Join room + ``` Go + room, err := api.JoinRoom("roomID", "userID") + ``` + +- Leave room + ``` Go + room, err := api.LeaveRoom("roomID", "userID") + ``` + +- Get room id + ``` Go + id, err := api.GetRoomId("room/uri") + ``` + +- Search gitter rooms + ``` Go + rooms, err := api.SearchRooms("search/string") + ``` +##### Messages + +- Get messages of room + ``` Go + messages, err := api.GetMessages("roomID", nil) + ``` + +- Get one message + ``` Go + message, err := api.GetMessage("roomID", "messageID") + ``` + +- Send message + ``` Go + err := api.SendMessage("roomID", "free chat text") + ``` + +##### Stream + +Create stream to the room and start listening to incoming messages + +``` Go +stream := api.Stream(room.Id) +go api.Listen(stream) + +for { + event := <-stream.Event + switch ev := event.Data.(type) { + case *gitter.MessageReceived: + fmt.Println(ev.Message.From.Username + ": " + ev.Message.Text) + case *gitter.GitterConnectionClosed: + // connection was closed + } +} +``` + +Close stream connection + +``` Go +stream.Close() +``` + +##### Faye (Experimental) + +``` Go +faye := api.Faye(room.ID) +go faye.Listen() + +for { + event := <-faye.Event + switch ev := event.Data.(type) { + case *gitter.MessageReceived: + fmt.Println(ev.Message.From.Username + ": " + ev.Message.Text) + case *gitter.GitterConnectionClosed: //this one is never called in Faye + // connection was closed + } +} +``` + +##### Debug + +You can print the internal errors by enabling debug to true + +``` Go +api.SetDebug(true, nil) +``` + +You can also define your own `io.Writer` in case you want to persist the logs somewhere. +For example keeping the errors on file + +``` Go +logFile, err := os.Create("gitter.log") +api.SetDebug(true, logFile) +``` + +##### App Engine + +Initialize app engine client and continue as usual + +``` Go +c := appengine.NewContext(r) +client := urlfetch.Client(c) + +api := gitter.New("YOUR_ACCESS_TOKEN") +api.SetClient(client) +``` + +[Documentation](https://godoc.org/github.com/sromku/go-gitter) diff --git a/vendor/github.com/42wim/go-ircevent/LICENSE b/vendor/github.com/42wim/go-ircevent/LICENSE deleted file mode 100644 index d6bf3577..00000000 --- a/vendor/github.com/42wim/go-ircevent/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2009 Thomas Jager. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/42wim/go-ircevent/irc.go b/vendor/github.com/42wim/go-ircevent/irc.go deleted file mode 100644 index ea9c1f05..00000000 --- a/vendor/github.com/42wim/go-ircevent/irc.go +++ /dev/null @@ -1,578 +0,0 @@ -// Copyright 2009 Thomas Jager All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -This package provides an event based IRC client library. It allows to -register callbacks for the events you need to handle. Its features -include handling standard CTCP, reconnecting on errors and detecting -stones servers. -Details of the IRC protocol can be found in the following RFCs: -https://tools.ietf.org/html/rfc1459 -https://tools.ietf.org/html/rfc2810 -https://tools.ietf.org/html/rfc2811 -https://tools.ietf.org/html/rfc2812 -https://tools.ietf.org/html/rfc2813 -The details of the client-to-client protocol (CTCP) can be found here: http://www.irchelp.org/irchelp/rfc/ctcpspec.html -*/ - -package irc - -import ( - "bufio" - "bytes" - "crypto/tls" - "errors" - "fmt" - "log" - "net" - "os" - "strconv" - "strings" - "time" -) - -const ( - VERSION = "go-ircevent v2.1" -) - -var ErrDisconnected = errors.New("Disconnect Called") - -// Read data from a connection. To be used as a goroutine. -func (irc *Connection) readLoop() { - defer irc.Done() - br := bufio.NewReaderSize(irc.socket, 512) - - errChan := irc.ErrorChan() - - for { - select { - case <-irc.end: - return - default: - // Set a read deadline based on the combined timeout and ping frequency - // We should ALWAYS have received a response from the server within the timeout - // after our own pings - if irc.socket != nil { - irc.socket.SetReadDeadline(time.Now().Add(irc.Timeout + irc.PingFreq)) - } - - msg, err := br.ReadString('\n') - - // We got past our blocking read, so bin timeout - if irc.socket != nil { - var zero time.Time - irc.socket.SetReadDeadline(zero) - } - - if err != nil { - errChan <- err - return - } - - if irc.Debug { - irc.Log.Printf("<-- %s\n", strings.TrimSpace(msg)) - } - - irc.Lock() - irc.lastMessage = time.Now() - irc.Unlock() - event, err := parseToEvent(msg) - event.Connection = irc - if err == nil { - /* XXX: len(args) == 0: args should be empty */ - irc.RunCallbacks(event) - } - } - } -} - -// Unescape tag values as defined in the IRCv3.2 message tags spec -// http://ircv3.net/specs/core/message-tags-3.2.html -func unescapeTagValue(value string) string { - value = strings.Replace(value, "\\:", ";", -1) - value = strings.Replace(value, "\\s", " ", -1) - value = strings.Replace(value, "\\\\", "\\", -1) - value = strings.Replace(value, "\\r", "\r", -1) - value = strings.Replace(value, "\\n", "\n", -1) - return value -} - -//Parse raw irc messages -func parseToEvent(msg string) (*Event, error) { - msg = strings.TrimSuffix(msg, "\n") //Remove \r\n - msg = strings.TrimSuffix(msg, "\r") - event := &Event{Raw: msg} - if len(msg) < 5 { - return nil, errors.New("Malformed msg from server") - } - - if msg[0] == '@' { - // IRCv3 Message Tags - if i := strings.Index(msg, " "); i > -1 { - event.Tags = make(map[string]string) - tags := strings.Split(msg[1:i], ";") - for _, data := range tags { - parts := strings.SplitN(data, "=", 2) - if len(parts) == 1 { - event.Tags[parts[0]] = "" - } else { - event.Tags[parts[0]] = unescapeTagValue(parts[1]) - } - } - msg = msg[i+1 : len(msg)] - } else { - return nil, errors.New("Malformed msg from server") - } - } - - if msg[0] == ':' { - if i := strings.Index(msg, " "); i > -1 { - event.Source = msg[1:i] - msg = msg[i+1 : len(msg)] - - } else { - return nil, errors.New("Malformed msg from server") - } - - if i, j := strings.Index(event.Source, "!"), strings.Index(event.Source, "@"); i > -1 && j > -1 && i < j { - event.Nick = event.Source[0:i] - event.User = event.Source[i+1 : j] - event.Host = event.Source[j+1 : len(event.Source)] - } - } - - split := strings.SplitN(msg, " :", 2) - args := strings.Split(split[0], " ") - event.Code = strings.ToUpper(args[0]) - event.Arguments = args[1:] - if len(split) > 1 { - event.Arguments = append(event.Arguments, split[1]) - } - return event, nil - -} - -// Loop to write to a connection. To be used as a goroutine. -func (irc *Connection) writeLoop() { - defer irc.Done() - errChan := irc.ErrorChan() - for { - select { - case <-irc.end: - return - case b, ok := <-irc.pwrite: - if !ok || b == "" || irc.socket == nil { - return - } - - if irc.Debug { - irc.Log.Printf("--> %s\n", strings.TrimSpace(b)) - } - - // Set a write deadline based on the time out - irc.socket.SetWriteDeadline(time.Now().Add(irc.Timeout)) - - _, err := irc.socket.Write([]byte(b)) - - // Past blocking write, bin timeout - var zero time.Time - irc.socket.SetWriteDeadline(zero) - - if err != nil { - errChan <- err - return - } - } - } -} - -// Pings the server if we have not received any messages for 5 minutes -// to keep the connection alive. To be used as a goroutine. -func (irc *Connection) pingLoop() { - defer irc.Done() - ticker := time.NewTicker(1 * time.Minute) // Tick every minute for monitoring - ticker2 := time.NewTicker(irc.PingFreq) // Tick at the ping frequency. - for { - select { - case <-ticker.C: - //Ping if we haven't received anything from the server within the keep alive period - if time.Since(irc.lastMessage) >= irc.KeepAlive { - irc.SendRawf("PING %d", time.Now().UnixNano()) - } - case <-ticker2.C: - //Ping at the ping frequency - irc.SendRawf("PING %d", time.Now().UnixNano()) - //Try to recapture nickname if it's not as configured. - irc.Lock() - if irc.nick != irc.nickcurrent { - irc.nickcurrent = irc.nick - irc.SendRawf("NICK %s", irc.nick) - } - irc.Unlock() - case <-irc.end: - ticker.Stop() - ticker2.Stop() - return - } - } -} - -func (irc *Connection) isQuitting() bool { - irc.Lock() - defer irc.Unlock() - return irc.quit -} - -// Main loop to control the connection. -func (irc *Connection) Loop() { - errChan := irc.ErrorChan() - connTime := time.Now() - for !irc.isQuitting() { - err := <-errChan - close(irc.end) - irc.Wait() - for !irc.isQuitting() { - irc.Log.Printf("Error, disconnected: %s\n", err) - if time.Now().Sub(connTime) < time.Second*5 { - irc.Log.Println("Rreconnecting too fast, sleeping 60 seconds") - time.Sleep(60 * time.Second) - } - if err = irc.Reconnect(); err != nil { - irc.Log.Printf("Error while reconnecting: %s\n", err) - time.Sleep(60 * time.Second) - } else { - errChan = irc.ErrorChan() - break - } - } - connTime = time.Now() - } -} - -// Quit the current connection and disconnect from the server -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.1.6 -func (irc *Connection) Quit() { - quit := "QUIT" - - if irc.QuitMessage != "" { - quit = fmt.Sprintf("QUIT :%s", irc.QuitMessage) - } - - irc.SendRaw(quit) - irc.Lock() - irc.stopped = true - irc.quit = true - irc.Unlock() -} - -// Use the connection to join a given channel. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.2.1 -func (irc *Connection) Join(channel string) { - irc.pwrite <- fmt.Sprintf("JOIN %s\r\n", channel) -} - -// Leave a given channel. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.2.2 -func (irc *Connection) Part(channel string) { - irc.pwrite <- fmt.Sprintf("PART %s\r\n", channel) -} - -// Send a notification to a nickname. This is similar to Privmsg but must not receive replies. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.4.2 -func (irc *Connection) Notice(target, message string) { - irc.pwrite <- fmt.Sprintf("NOTICE %s :%s\r\n", target, message) -} - -// Send a formated notification to a nickname. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.4.2 -func (irc *Connection) Noticef(target, format string, a ...interface{}) { - irc.Notice(target, fmt.Sprintf(format, a...)) -} - -// Send (action) message to a target (channel or nickname). -// No clear RFC on this one... -func (irc *Connection) Action(target, message string) { - irc.pwrite <- fmt.Sprintf("PRIVMSG %s :\001ACTION %s\001\r\n", target, message) -} - -// Send formatted (action) message to a target (channel or nickname). -func (irc *Connection) Actionf(target, format string, a ...interface{}) { - irc.Action(target, fmt.Sprintf(format, a...)) -} - -// Send (private) message to a target (channel or nickname). -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.4.1 -func (irc *Connection) Privmsg(target, message string) { - irc.pwrite <- fmt.Sprintf("PRIVMSG %s :%s\r\n", target, message) -} - -// Send formated string to specified target (channel or nickname). -func (irc *Connection) Privmsgf(target, format string, a ...interface{}) { - irc.Privmsg(target, fmt.Sprintf(format, a...)) -} - -// Kick from with . For no message, pass empty string ("") -func (irc *Connection) Kick(user, channel, msg string) { - var cmd bytes.Buffer - cmd.WriteString(fmt.Sprintf("KICK %s %s", channel, user)) - if msg != "" { - cmd.WriteString(fmt.Sprintf(" :%s", msg)) - } - cmd.WriteString("\r\n") - irc.pwrite <- cmd.String() -} - -// Kick all from with . For no message, pass -// empty string ("") -func (irc *Connection) MultiKick(users []string, channel string, msg string) { - var cmd bytes.Buffer - cmd.WriteString(fmt.Sprintf("KICK %s %s", channel, strings.Join(users, ","))) - if msg != "" { - cmd.WriteString(fmt.Sprintf(" :%s", msg)) - } - cmd.WriteString("\r\n") - irc.pwrite <- cmd.String() -} - -// Send raw string. -func (irc *Connection) SendRaw(message string) { - irc.pwrite <- message + "\r\n" -} - -// Send raw formated string. -func (irc *Connection) SendRawf(format string, a ...interface{}) { - irc.SendRaw(fmt.Sprintf(format, a...)) -} - -// Set (new) nickname. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.1.2 -func (irc *Connection) Nick(n string) { - irc.nick = n - irc.SendRawf("NICK %s", n) -} - -// Determine nick currently used with the connection. -func (irc *Connection) GetNick() string { - return irc.nickcurrent -} - -// Query information about a particular nickname. -// RFC 1459: https://tools.ietf.org/html/rfc1459#section-4.5.2 -func (irc *Connection) Whois(nick string) { - irc.SendRawf("WHOIS %s", nick) -} - -// Query information about a given nickname in the server. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.5.1 -func (irc *Connection) Who(nick string) { - irc.SendRawf("WHO %s", nick) -} - -// Set different modes for a target (channel or nickname). -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.2.3 -func (irc *Connection) Mode(target string, modestring ...string) { - if len(modestring) > 0 { - mode := strings.Join(modestring, " ") - irc.SendRawf("MODE %s %s", target, mode) - return - } - irc.SendRawf("MODE %s", target) -} - -func (irc *Connection) ErrorChan() chan error { - return irc.Error -} - -// Returns true if the connection is connected to an IRC server. -func (irc *Connection) Connected() bool { - return !irc.stopped -} - -// A disconnect sends all buffered messages (if possible), -// stops all goroutines and then closes the socket. -func (irc *Connection) Disconnect() { - if irc.socket != nil { - irc.socket.Close() - } - irc.ErrorChan() <- ErrDisconnected -} - -// Reconnect to a server using the current connection. -func (irc *Connection) Reconnect() error { - irc.end = make(chan struct{}) - return irc.Connect(irc.Server) -} - -// Connect to a given server using the current connection configuration. -// This function also takes care of identification if a password is provided. -// RFC 1459 details: https://tools.ietf.org/html/rfc1459#section-4.1 -func (irc *Connection) Connect(server string) error { - irc.Server = server - // mark Server as stopped since there can be an error during connect - irc.stopped = true - - // make sure everything is ready for connection - if len(irc.Server) == 0 { - return errors.New("empty 'server'") - } - if strings.Count(irc.Server, ":") != 1 { - return errors.New("wrong number of ':' in address") - } - if strings.Index(irc.Server, ":") == 0 { - return errors.New("hostname is missing") - } - if strings.Index(irc.Server, ":") == len(irc.Server)-1 { - return errors.New("port missing") - } - // check for valid range - ports := strings.Split(irc.Server, ":")[1] - port, err := strconv.Atoi(ports) - if err != nil { - return errors.New("extracting port failed") - } - if !((port >= 0) && (port <= 65535)) { - return errors.New("port number outside valid range") - } - if irc.Log == nil { - return errors.New("'Log' points to nil") - } - if len(irc.nick) == 0 { - return errors.New("empty 'nick'") - } - if len(irc.user) == 0 { - return errors.New("empty 'user'") - } - - if irc.UseTLS { - dialer := &net.Dialer{Timeout: irc.Timeout} - irc.socket, err = tls.DialWithDialer(dialer, "tcp", irc.Server, irc.TLSConfig) - } else { - irc.socket, err = net.DialTimeout("tcp", irc.Server, irc.Timeout) - } - if err != nil { - return err - } - - irc.stopped = false - irc.Log.Printf("Connected to %s (%s)\n", irc.Server, irc.socket.RemoteAddr()) - - irc.pwrite = make(chan string, 10) - irc.Error = make(chan error, 2) - irc.Add(3) - go irc.readLoop() - go irc.writeLoop() - go irc.pingLoop() - if len(irc.Password) > 0 { - irc.pwrite <- fmt.Sprintf("PASS %s\r\n", irc.Password) - } - - err = irc.negotiateCaps() - if err != nil { - return err - } - - irc.pwrite <- fmt.Sprintf("NICK %s\r\n", irc.nick) - irc.pwrite <- fmt.Sprintf("USER %s 0.0.0.0 0.0.0.0 :%s\r\n", irc.user, irc.user) - return nil -} - -// Negotiate IRCv3 capabilities -func (irc *Connection) negotiateCaps() error { - saslResChan := make(chan *SASLResult) - if irc.UseSASL { - irc.RequestCaps = append(irc.RequestCaps, "sasl") - irc.setupSASLCallbacks(saslResChan) - } - - if len(irc.RequestCaps) == 0 { - return nil - } - - cap_chan := make(chan bool, len(irc.RequestCaps)) - irc.AddCallback("CAP", func(e *Event) { - if len(e.Arguments) != 3 { - return - } - command := e.Arguments[1] - - if command == "LS" { - missing_caps := len(irc.RequestCaps) - for _, cap_name := range strings.Split(e.Arguments[2], " ") { - for _, req_cap := range irc.RequestCaps { - if cap_name == req_cap { - irc.pwrite <- fmt.Sprintf("CAP REQ :%s\r\n", cap_name) - missing_caps-- - } - } - } - - for i := 0; i < missing_caps; i++ { - cap_chan <- true - } - } else if command == "ACK" || command == "NAK" { - for _, cap_name := range strings.Split(strings.TrimSpace(e.Arguments[2]), " ") { - if cap_name == "" { - continue - } - - if command == "ACK" { - irc.AcknowledgedCaps = append(irc.AcknowledgedCaps, cap_name) - } - cap_chan <- true - } - } - }) - - irc.pwrite <- "CAP LS\r\n" - - if irc.UseSASL { - select { - case res := <-saslResChan: - if res.Failed { - close(saslResChan) - return res.Err - } - case <-time.After(time.Second * 15): - close(saslResChan) - return errors.New("SASL setup timed out. This shouldn't happen.") - } - } - - // Wait for all capabilities to be ACKed or NAKed before ending negotiation - for i := 0; i < len(irc.RequestCaps); i++ { - <-cap_chan - } - irc.pwrite <- fmt.Sprintf("CAP END\r\n") - - return nil -} - -// Create a connection with the (publicly visible) nickname and username. -// The nickname is later used to address the user. Returns nil if nick -// or user are empty. -func IRC(nick, user string) *Connection { - // catch invalid values - if len(nick) == 0 { - return nil - } - if len(user) == 0 { - return nil - } - - irc := &Connection{ - nick: nick, - nickcurrent: nick, - user: user, - Log: log.New(os.Stdout, "", log.LstdFlags), - end: make(chan struct{}), - Version: VERSION, - KeepAlive: 4 * time.Minute, - Timeout: 1 * time.Minute, - PingFreq: 15 * time.Minute, - SASLMech: "PLAIN", - QuitMessage: "", - } - irc.setupCallbacks() - return irc -} diff --git a/vendor/github.com/42wim/go-ircevent/irc_callback.go b/vendor/github.com/42wim/go-ircevent/irc_callback.go deleted file mode 100644 index d389f731..00000000 --- a/vendor/github.com/42wim/go-ircevent/irc_callback.go +++ /dev/null @@ -1,222 +0,0 @@ -package irc - -import ( - "strconv" - "strings" - "time" -) - -// Register a callback to a connection and event code. A callback is a function -// which takes only an Event pointer as parameter. Valid event codes are all -// IRC/CTCP commands and error/response codes. This function returns the ID of -// the registered callback for later management. -func (irc *Connection) AddCallback(eventcode string, callback func(*Event)) int { - eventcode = strings.ToUpper(eventcode) - id := 0 - if _, ok := irc.events[eventcode]; !ok { - irc.events[eventcode] = make(map[int]func(*Event)) - id = 0 - } else { - id = len(irc.events[eventcode]) - } - irc.events[eventcode][id] = callback - return id -} - -// Remove callback i (ID) from the given event code. This functions returns -// true upon success, false if any error occurs. -func (irc *Connection) RemoveCallback(eventcode string, i int) bool { - eventcode = strings.ToUpper(eventcode) - - if event, ok := irc.events[eventcode]; ok { - if _, ok := event[i]; ok { - delete(irc.events[eventcode], i) - return true - } - irc.Log.Printf("Event found, but no callback found at id %d\n", i) - return false - } - - irc.Log.Println("Event not found") - return false -} - -// Remove all callbacks from a given event code. It returns true -// if given event code is found and cleared. -func (irc *Connection) ClearCallback(eventcode string) bool { - eventcode = strings.ToUpper(eventcode) - - if _, ok := irc.events[eventcode]; ok { - irc.events[eventcode] = make(map[int]func(*Event)) - return true - } - - irc.Log.Println("Event not found") - return false -} - -// Replace callback i (ID) associated with a given event code with a new callback function. -func (irc *Connection) ReplaceCallback(eventcode string, i int, callback func(*Event)) { - eventcode = strings.ToUpper(eventcode) - - if event, ok := irc.events[eventcode]; ok { - if _, ok := event[i]; ok { - event[i] = callback - return - } - irc.Log.Printf("Event found, but no callback found at id %d\n", i) - } - irc.Log.Printf("Event not found. Use AddCallBack\n") -} - -// Execute all callbacks associated with a given event. -func (irc *Connection) RunCallbacks(event *Event) { - msg := event.Message() - if event.Code == "PRIVMSG" && len(msg) > 2 && msg[0] == '\x01' { - event.Code = "CTCP" //Unknown CTCP - - if i := strings.LastIndex(msg, "\x01"); i > 0 { - msg = msg[1:i] - } else { - irc.Log.Printf("Invalid CTCP Message: %s\n", strconv.Quote(msg)) - return - } - - if msg == "VERSION" { - event.Code = "CTCP_VERSION" - - } else if msg == "TIME" { - event.Code = "CTCP_TIME" - - } else if strings.HasPrefix(msg, "PING") { - event.Code = "CTCP_PING" - - } else if msg == "USERINFO" { - event.Code = "CTCP_USERINFO" - - } else if msg == "CLIENTINFO" { - event.Code = "CTCP_CLIENTINFO" - - } else if strings.HasPrefix(msg, "ACTION") { - event.Code = "CTCP_ACTION" - if len(msg) > 6 { - msg = msg[7:] - } else { - msg = "" - } - } - - event.Arguments[len(event.Arguments)-1] = msg - } - - if callbacks, ok := irc.events[event.Code]; ok { - if irc.VerboseCallbackHandler { - irc.Log.Printf("%v (%v) >> %#v\n", event.Code, len(callbacks), event) - } - - for _, callback := range callbacks { - callback(event) - } - } else if irc.VerboseCallbackHandler { - irc.Log.Printf("%v (0) >> %#v\n", event.Code, event) - } - - if callbacks, ok := irc.events["*"]; ok { - if irc.VerboseCallbackHandler { - irc.Log.Printf("%v (0) >> %#v\n", event.Code, event) - } - - for _, callback := range callbacks { - callback(event) - } - } -} - -// Set up some initial callbacks to handle the IRC/CTCP protocol. -func (irc *Connection) setupCallbacks() { - irc.events = make(map[string]map[int]func(*Event)) - - //Handle error events. - irc.AddCallback("ERROR", func(e *Event) { irc.Disconnect() }) - - //Handle ping events - irc.AddCallback("PING", func(e *Event) { irc.SendRaw("PONG :" + e.Message()) }) - - //Version handler - irc.AddCallback("CTCP_VERSION", func(e *Event) { - irc.SendRawf("NOTICE %s :\x01VERSION %s\x01", e.Nick, irc.Version) - }) - - irc.AddCallback("CTCP_USERINFO", func(e *Event) { - irc.SendRawf("NOTICE %s :\x01USERINFO %s\x01", e.Nick, irc.user) - }) - - irc.AddCallback("CTCP_CLIENTINFO", func(e *Event) { - irc.SendRawf("NOTICE %s :\x01CLIENTINFO PING VERSION TIME USERINFO CLIENTINFO\x01", e.Nick) - }) - - irc.AddCallback("CTCP_TIME", func(e *Event) { - ltime := time.Now() - irc.SendRawf("NOTICE %s :\x01TIME %s\x01", e.Nick, ltime.String()) - }) - - irc.AddCallback("CTCP_PING", func(e *Event) { irc.SendRawf("NOTICE %s :\x01%s\x01", e.Nick, e.Message()) }) - - // 437: ERR_UNAVAILRESOURCE " :Nick/channel is temporarily unavailable" - // Add a _ to current nick. If irc.nickcurrent is empty this cannot - // work. It has to be set somewhere first in case the nick is already - // taken or unavailable from the beginning. - irc.AddCallback("437", func(e *Event) { - // If irc.nickcurrent hasn't been set yet, set to irc.nick - if irc.nickcurrent == "" { - irc.nickcurrent = irc.nick - } - - if len(irc.nickcurrent) > 8 { - irc.nickcurrent = "_" + irc.nickcurrent - } else { - irc.nickcurrent = irc.nickcurrent + "_" - } - irc.SendRawf("NICK %s", irc.nickcurrent) - }) - - // 433: ERR_NICKNAMEINUSE " :Nickname is already in use" - // Add a _ to current nick. - irc.AddCallback("433", func(e *Event) { - // If irc.nickcurrent hasn't been set yet, set to irc.nick - if irc.nickcurrent == "" { - irc.nickcurrent = irc.nick - } - - if len(irc.nickcurrent) > 8 { - irc.nickcurrent = "_" + irc.nickcurrent - } else { - irc.nickcurrent = irc.nickcurrent + "_" - } - irc.SendRawf("NICK %s", irc.nickcurrent) - }) - - irc.AddCallback("PONG", func(e *Event) { - ns, _ := strconv.ParseInt(e.Message(), 10, 64) - delta := time.Duration(time.Now().UnixNano() - ns) - if irc.Debug { - irc.Log.Printf("Lag: %.3f s\n", delta.Seconds()) - } - }) - - // NICK Define a nickname. - // Set irc.nickcurrent to the new nick actually used in this connection. - irc.AddCallback("NICK", func(e *Event) { - if e.Nick == irc.nick { - irc.nickcurrent = e.Message() - } - }) - - // 1: RPL_WELCOME "Welcome to the Internet Relay Network !@" - // Set irc.nickcurrent to the actually used nick in this connection. - irc.AddCallback("001", func(e *Event) { - irc.Lock() - irc.nickcurrent = e.Arguments[0] - irc.Unlock() - }) -} diff --git a/vendor/github.com/42wim/go-ircevent/irc_sasl.go b/vendor/github.com/42wim/go-ircevent/irc_sasl.go deleted file mode 100644 index fd9df7ba..00000000 --- a/vendor/github.com/42wim/go-ircevent/irc_sasl.go +++ /dev/null @@ -1,53 +0,0 @@ -package irc - -import ( - "encoding/base64" - "errors" - "fmt" - "strings" -) - -type SASLResult struct { - Failed bool - Err error -} - -func (irc *Connection) setupSASLCallbacks(result chan<- *SASLResult) { - irc.AddCallback("CAP", func(e *Event) { - if len(e.Arguments) == 3 { - if e.Arguments[1] == "LS" { - if !strings.Contains(e.Arguments[2], "sasl") { - result <- &SASLResult{true, errors.New("no SASL capability " + e.Arguments[2])} - } - } - if e.Arguments[1] == "ACK" { - if irc.SASLMech != "PLAIN" { - result <- &SASLResult{true, errors.New("only PLAIN is supported")} - } - irc.SendRaw("AUTHENTICATE " + irc.SASLMech) - } - } - }) - irc.AddCallback("AUTHENTICATE", func(e *Event) { - str := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s\x00%s\x00%s", irc.SASLLogin, irc.SASLLogin, irc.SASLPassword))) - irc.SendRaw("AUTHENTICATE " + str) - }) - irc.AddCallback("901", func(e *Event) { - irc.SendRaw("CAP END") - irc.SendRaw("QUIT") - result <- &SASLResult{true, errors.New(e.Arguments[1])} - }) - irc.AddCallback("902", func(e *Event) { - irc.SendRaw("CAP END") - irc.SendRaw("QUIT") - result <- &SASLResult{true, errors.New(e.Arguments[1])} - }) - irc.AddCallback("903", func(e *Event) { - result <- &SASLResult{false, nil} - }) - irc.AddCallback("904", func(e *Event) { - irc.SendRaw("CAP END") - irc.SendRaw("QUIT") - result <- &SASLResult{true, errors.New(e.Arguments[1])} - }) -} diff --git a/vendor/github.com/42wim/go-ircevent/irc_struct.go b/vendor/github.com/42wim/go-ircevent/irc_struct.go deleted file mode 100644 index c064cb80..00000000 --- a/vendor/github.com/42wim/go-ircevent/irc_struct.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2009 Thomas Jager All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package irc - -import ( - "crypto/tls" - "log" - "net" - "sync" - "time" -) - -type Connection struct { - sync.Mutex - sync.WaitGroup - Debug bool - Error chan error - Password string - UseTLS bool - UseSASL bool - RequestCaps []string - AcknowledgedCaps []string - SASLLogin string - SASLPassword string - SASLMech string - TLSConfig *tls.Config - Version string - Timeout time.Duration - PingFreq time.Duration - KeepAlive time.Duration - Server string - - socket net.Conn - pwrite chan string - end chan struct{} - - nick string //The nickname we want. - nickcurrent string //The nickname we currently have. - user string - registered bool - events map[string]map[int]func(*Event) - - QuitMessage string - lastMessage time.Time - - VerboseCallbackHandler bool - Log *log.Logger - - stopped bool - quit bool //User called Quit, do not reconnect. -} - -// A struct to represent an event. -type Event struct { - Code string - Raw string - Nick string // - Host string //!@ - Source string // - User string // - Arguments []string - Tags map[string]string - Connection *Connection -} - -// Retrieve the last message from Event arguments. -// This function leaves the arguments untouched and -// returns an empty string if there are none. -func (e *Event) Message() string { - if len(e.Arguments) == 0 { - return "" - } - return e.Arguments[len(e.Arguments)-1] -} diff --git a/vendor/github.com/42wim/go-ircevent/irc_test_fuzz.go b/vendor/github.com/42wim/go-ircevent/irc_test_fuzz.go deleted file mode 100644 index 82202e1c..00000000 --- a/vendor/github.com/42wim/go-ircevent/irc_test_fuzz.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build gofuzz - -package irc - -func Fuzz(data []byte) int { - b := bytes.NewBuffer(data) - event, err := parseToEvent(b.String()) - if err == nil { - irc := IRC("go-eventirc", "go-eventirc") - irc.RunCallbacks(event) - return 1 - } - return 0 -} diff --git a/vendor/github.com/BurntSushi/toml/.gitignore b/vendor/github.com/BurntSushi/toml/.gitignore new file mode 100644 index 00000000..0cd38003 --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/.gitignore @@ -0,0 +1,5 @@ +TAGS +tags +.*.swp +tomlcheck/tomlcheck +toml.test diff --git a/vendor/github.com/BurntSushi/toml/.travis.yml b/vendor/github.com/BurntSushi/toml/.travis.yml new file mode 100644 index 00000000..8b8afc4f --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/.travis.yml @@ -0,0 +1,15 @@ +language: go +go: + - 1.1 + - 1.2 + - 1.3 + - 1.4 + - 1.5 + - 1.6 + - tip +install: + - go install ./... + - go get github.com/BurntSushi/toml-test +script: + - export PATH="$PATH:$HOME/gopath/bin" + - make test diff --git a/vendor/github.com/BurntSushi/toml/COMPATIBLE b/vendor/github.com/BurntSushi/toml/COMPATIBLE new file mode 100644 index 00000000..6efcfd0c --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/COMPATIBLE @@ -0,0 +1,3 @@ +Compatible with TOML version +[v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md) + diff --git a/vendor/github.com/BurntSushi/toml/Makefile b/vendor/github.com/BurntSushi/toml/Makefile new file mode 100644 index 00000000..3600848d --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/Makefile @@ -0,0 +1,19 @@ +install: + go install ./... + +test: install + go test -v + toml-test toml-test-decoder + toml-test -encoder toml-test-encoder + +fmt: + gofmt -w *.go */*.go + colcheck *.go */*.go + +tags: + find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS + +push: + git push origin master + git push github master + diff --git a/vendor/github.com/BurntSushi/toml/README.md b/vendor/github.com/BurntSushi/toml/README.md new file mode 100644 index 00000000..7c1b37ec --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/README.md @@ -0,0 +1,218 @@ +## TOML parser and encoder for Go with reflection + +TOML stands for Tom's Obvious, Minimal Language. This Go package provides a +reflection interface similar to Go's standard library `json` and `xml` +packages. This package also supports the `encoding.TextUnmarshaler` and +`encoding.TextMarshaler` interfaces so that you can define custom data +representations. (There is an example of this below.) + +Spec: https://github.com/toml-lang/toml + +Compatible with TOML version +[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md) + +Documentation: https://godoc.org/github.com/BurntSushi/toml + +Installation: + +```bash +go get github.com/BurntSushi/toml +``` + +Try the toml validator: + +```bash +go get github.com/BurntSushi/toml/cmd/tomlv +tomlv some-toml-file.toml +``` + +[![Build Status](https://travis-ci.org/BurntSushi/toml.svg?branch=master)](https://travis-ci.org/BurntSushi/toml) [![GoDoc](https://godoc.org/github.com/BurntSushi/toml?status.svg)](https://godoc.org/github.com/BurntSushi/toml) + +### Testing + +This package passes all tests in +[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder +and the encoder. + +### Examples + +This package works similarly to how the Go standard library handles `XML` +and `JSON`. Namely, data is loaded into Go values via reflection. + +For the simplest example, consider some TOML file as just a list of keys +and values: + +```toml +Age = 25 +Cats = [ "Cauchy", "Plato" ] +Pi = 3.14 +Perfection = [ 6, 28, 496, 8128 ] +DOB = 1987-07-05T05:45:00Z +``` + +Which could be defined in Go as: + +```go +type Config struct { + Age int + Cats []string + Pi float64 + Perfection []int + DOB time.Time // requires `import time` +} +``` + +And then decoded with: + +```go +var conf Config +if _, err := toml.Decode(tomlData, &conf); err != nil { + // handle error +} +``` + +You can also use struct tags if your struct field name doesn't map to a TOML +key value directly: + +```toml +some_key_NAME = "wat" +``` + +```go +type TOML struct { + ObscureKey string `toml:"some_key_NAME"` +} +``` + +### Using the `encoding.TextUnmarshaler` interface + +Here's an example that automatically parses duration strings into +`time.Duration` values: + +```toml +[[song]] +name = "Thunder Road" +duration = "4m49s" + +[[song]] +name = "Stairway to Heaven" +duration = "8m03s" +``` + +Which can be decoded with: + +```go +type song struct { + Name string + Duration duration +} +type songs struct { + Song []song +} +var favorites songs +if _, err := toml.Decode(blob, &favorites); err != nil { + log.Fatal(err) +} + +for _, s := range favorites.Song { + fmt.Printf("%s (%s)\n", s.Name, s.Duration) +} +``` + +And you'll also need a `duration` type that satisfies the +`encoding.TextUnmarshaler` interface: + +```go +type duration struct { + time.Duration +} + +func (d *duration) UnmarshalText(text []byte) error { + var err error + d.Duration, err = time.ParseDuration(string(text)) + return err +} +``` + +### More complex usage + +Here's an example of how to load the example from the official spec page: + +```toml +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it + +# Line breaks are OK when inside arrays +hosts = [ + "alpha", + "omega" +] +``` + +And the corresponding Go types are: + +```go +type tomlConfig struct { + Title string + Owner ownerInfo + DB database `toml:"database"` + Servers map[string]server + Clients clients +} + +type ownerInfo struct { + Name string + Org string `toml:"organization"` + Bio string + DOB time.Time +} + +type database struct { + Server string + Ports []int + ConnMax int `toml:"connection_max"` + Enabled bool +} + +type server struct { + IP string + DC string +} + +type clients struct { + Data [][]interface{} + Hosts []string +} +``` + +Note that a case insensitive match will be tried if an exact match can't be +found. + +A working example of the above can be found in `_examples/example.{go,toml}`. diff --git a/vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go b/vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go deleted file mode 100644 index 14e75570..00000000 --- a/vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/main.go +++ /dev/null @@ -1,90 +0,0 @@ -// Command toml-test-decoder satisfies the toml-test interface for testing -// TOML decoders. Namely, it accepts TOML on stdin and outputs JSON on stdout. -package main - -import ( - "encoding/json" - "flag" - "fmt" - "log" - "os" - "path" - "time" - - "github.com/BurntSushi/toml" -) - -func init() { - log.SetFlags(0) - - flag.Usage = usage - flag.Parse() -} - -func usage() { - log.Printf("Usage: %s < toml-file\n", path.Base(os.Args[0])) - flag.PrintDefaults() - - os.Exit(1) -} - -func main() { - if flag.NArg() != 0 { - flag.Usage() - } - - var tmp interface{} - if _, err := toml.DecodeReader(os.Stdin, &tmp); err != nil { - log.Fatalf("Error decoding TOML: %s", err) - } - - typedTmp := translate(tmp) - if err := json.NewEncoder(os.Stdout).Encode(typedTmp); err != nil { - log.Fatalf("Error encoding JSON: %s", err) - } -} - -func translate(tomlData interface{}) interface{} { - switch orig := tomlData.(type) { - case map[string]interface{}: - typed := make(map[string]interface{}, len(orig)) - for k, v := range orig { - typed[k] = translate(v) - } - return typed - case []map[string]interface{}: - typed := make([]map[string]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v).(map[string]interface{}) - } - return typed - case []interface{}: - typed := make([]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v) - } - - // We don't really need to tag arrays, but let's be future proof. - // (If TOML ever supports tuples, we'll need this.) - return tag("array", typed) - case time.Time: - return tag("datetime", orig.Format("2006-01-02T15:04:05Z")) - case bool: - return tag("bool", fmt.Sprintf("%v", orig)) - case int64: - return tag("integer", fmt.Sprintf("%d", orig)) - case float64: - return tag("float", fmt.Sprintf("%v", orig)) - case string: - return tag("string", orig) - } - - panic(fmt.Sprintf("Unknown type: %T", tomlData)) -} - -func tag(typeName string, data interface{}) map[string]interface{} { - return map[string]interface{}{ - "type": typeName, - "value": data, - } -} diff --git a/vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go b/vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go deleted file mode 100644 index 092cc684..00000000 --- a/vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/main.go +++ /dev/null @@ -1,131 +0,0 @@ -// Command toml-test-encoder satisfies the toml-test interface for testing -// TOML encoders. Namely, it accepts JSON on stdin and outputs TOML on stdout. -package main - -import ( - "encoding/json" - "flag" - "log" - "os" - "path" - "strconv" - "time" - - "github.com/BurntSushi/toml" -) - -func init() { - log.SetFlags(0) - - flag.Usage = usage - flag.Parse() -} - -func usage() { - log.Printf("Usage: %s < json-file\n", path.Base(os.Args[0])) - flag.PrintDefaults() - - os.Exit(1) -} - -func main() { - if flag.NArg() != 0 { - flag.Usage() - } - - var tmp interface{} - if err := json.NewDecoder(os.Stdin).Decode(&tmp); err != nil { - log.Fatalf("Error decoding JSON: %s", err) - } - - tomlData := translate(tmp) - if err := toml.NewEncoder(os.Stdout).Encode(tomlData); err != nil { - log.Fatalf("Error encoding TOML: %s", err) - } -} - -func translate(typedJson interface{}) interface{} { - switch v := typedJson.(type) { - case map[string]interface{}: - if len(v) == 2 && in("type", v) && in("value", v) { - return untag(v) - } - m := make(map[string]interface{}, len(v)) - for k, v2 := range v { - m[k] = translate(v2) - } - return m - case []interface{}: - tabArray := make([]map[string]interface{}, len(v)) - for i := range v { - if m, ok := translate(v[i]).(map[string]interface{}); ok { - tabArray[i] = m - } else { - log.Fatalf("JSON arrays may only contain objects. This " + - "corresponds to only tables being allowed in " + - "TOML table arrays.") - } - } - return tabArray - } - log.Fatalf("Unrecognized JSON format '%T'.", typedJson) - panic("unreachable") -} - -func untag(typed map[string]interface{}) interface{} { - t := typed["type"].(string) - v := typed["value"] - switch t { - case "string": - return v.(string) - case "integer": - v := v.(string) - n, err := strconv.Atoi(v) - if err != nil { - log.Fatalf("Could not parse '%s' as integer: %s", v, err) - } - return n - case "float": - v := v.(string) - f, err := strconv.ParseFloat(v, 64) - if err != nil { - log.Fatalf("Could not parse '%s' as float64: %s", v, err) - } - return f - case "datetime": - v := v.(string) - t, err := time.Parse("2006-01-02T15:04:05Z", v) - if err != nil { - log.Fatalf("Could not parse '%s' as a datetime: %s", v, err) - } - return t - case "bool": - v := v.(string) - switch v { - case "true": - return true - case "false": - return false - } - log.Fatalf("Could not parse '%s' as a boolean.", v) - case "array": - v := v.([]interface{}) - array := make([]interface{}, len(v)) - for i := range v { - if m, ok := v[i].(map[string]interface{}); ok { - array[i] = untag(m) - } else { - log.Fatalf("Arrays may only contain other arrays or "+ - "primitive values, but found a '%T'.", m) - } - } - return array - } - log.Fatalf("Unrecognized tag type '%s'.", t) - panic("unreachable") -} - -func in(key string, m map[string]interface{}) bool { - _, ok := m[key] - return ok -} diff --git a/vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go b/vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go deleted file mode 100644 index c7d689a7..00000000 --- a/vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go +++ /dev/null @@ -1,61 +0,0 @@ -// Command tomlv validates TOML documents and prints each key's type. -package main - -import ( - "flag" - "fmt" - "log" - "os" - "path" - "strings" - "text/tabwriter" - - "github.com/BurntSushi/toml" -) - -var ( - flagTypes = false -) - -func init() { - log.SetFlags(0) - - flag.BoolVar(&flagTypes, "types", flagTypes, - "When set, the types of every defined key will be shown.") - - flag.Usage = usage - flag.Parse() -} - -func usage() { - log.Printf("Usage: %s toml-file [ toml-file ... ]\n", - path.Base(os.Args[0])) - flag.PrintDefaults() - - os.Exit(1) -} - -func main() { - if flag.NArg() < 1 { - flag.Usage() - } - for _, f := range flag.Args() { - var tmp interface{} - md, err := toml.DecodeFile(f, &tmp) - if err != nil { - log.Fatalf("Error in '%s': %s", f, err) - } - if flagTypes { - printTypes(md) - } - } -} - -func printTypes(md toml.MetaData) { - tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) - for _, key := range md.Keys() { - fmt.Fprintf(tabw, "%s%s\t%s\n", - strings.Repeat(" ", len(key)-1), key, md.Type(key...)) - } - tabw.Flush() -} diff --git a/vendor/github.com/BurntSushi/toml/session.vim b/vendor/github.com/BurntSushi/toml/session.vim new file mode 100644 index 00000000..562164be --- /dev/null +++ b/vendor/github.com/BurntSushi/toml/session.vim @@ -0,0 +1 @@ +au BufWritePost *.go silent!make tags > /dev/null 2>&1 diff --git a/vendor/github.com/GeertJohan/go.rice/LICENSE b/vendor/github.com/GeertJohan/go.rice/LICENSE deleted file mode 100644 index 8b4409d7..00000000 --- a/vendor/github.com/GeertJohan/go.rice/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013, Geert-Johan Riemer -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/github.com/GeertJohan/go.rice/appended.go b/vendor/github.com/GeertJohan/go.rice/appended.go deleted file mode 100644 index a986a0c5..00000000 --- a/vendor/github.com/GeertJohan/go.rice/appended.go +++ /dev/null @@ -1,138 +0,0 @@ -package rice - -import ( - "archive/zip" - "log" - "os" - "path/filepath" - "strings" - "time" - - "github.com/daaku/go.zipexe" - "github.com/kardianos/osext" -) - -// appendedBox defines an appended box -type appendedBox struct { - Name string // box name - Files map[string]*appendedFile // appended files (*zip.File) by full path -} - -type appendedFile struct { - zipFile *zip.File - dir bool - dirInfo *appendedDirInfo - children []*appendedFile - content []byte -} - -// appendedBoxes is a public register of appendes boxes -var appendedBoxes = make(map[string]*appendedBox) - -func init() { - // find if exec is appended - thisFile, err := osext.Executable() - if err != nil { - return // not appended or cant find self executable - } - closer, rd, err := zipexe.OpenCloser(thisFile) - if err != nil { - return // not appended - } - defer closer.Close() - - for _, f := range rd.File { - // get box and file name from f.Name - fileParts := strings.SplitN(strings.TrimLeft(filepath.ToSlash(f.Name), "/"), "/", 2) - boxName := fileParts[0] - var fileName string - if len(fileParts) > 1 { - fileName = fileParts[1] - } - - // find box or create new one if doesn't exist - box := appendedBoxes[boxName] - if box == nil { - box = &appendedBox{ - Name: boxName, - Files: make(map[string]*appendedFile), - } - appendedBoxes[boxName] = box - } - - // create and add file to box - af := &appendedFile{ - zipFile: f, - } - if f.Comment == "dir" { - af.dir = true - af.dirInfo = &appendedDirInfo{ - name: filepath.Base(af.zipFile.Name), - //++ TODO: use zip modtime when that is set correctly: af.zipFile.ModTime() - time: time.Now(), - } - } else { - // this is a file, we need it's contents so we can create a bytes.Reader when the file is opened - // make a new byteslice - af.content = make([]byte, af.zipFile.FileInfo().Size()) - // ignore reading empty files from zip (empty file still is a valid file to be read though!) - if len(af.content) > 0 { - // open io.ReadCloser - rc, err := af.zipFile.Open() - if err != nil { - af.content = nil // this will cause an error when the file is being opened or seeked (which is good) - // TODO: it's quite blunt to just log this stuff. but this is in init, so rice.Debug can't be changed yet.. - log.Printf("error opening appended file %s: %v", af.zipFile.Name, err) - } else { - _, err = rc.Read(af.content) - rc.Close() - if err != nil { - af.content = nil // this will cause an error when the file is being opened or seeked (which is good) - // TODO: it's quite blunt to just log this stuff. but this is in init, so rice.Debug can't be changed yet.. - log.Printf("error reading data for appended file %s: %v", af.zipFile.Name, err) - } - } - } - } - - // add appendedFile to box file list - box.Files[fileName] = af - - // add to parent dir (if any) - dirName := filepath.Dir(fileName) - if dirName == "." { - dirName = "" - } - if fileName != "" { // don't make box root dir a child of itself - if dir := box.Files[dirName]; dir != nil { - dir.children = append(dir.children, af) - } - } - } -} - -// implements os.FileInfo. -// used for Readdir() -type appendedDirInfo struct { - name string - time time.Time -} - -func (adi *appendedDirInfo) Name() string { - return adi.name -} -func (adi *appendedDirInfo) Size() int64 { - return 0 -} -func (adi *appendedDirInfo) Mode() os.FileMode { - return os.ModeDir -} -func (adi *appendedDirInfo) ModTime() time.Time { - return adi.time -} -func (adi *appendedDirInfo) IsDir() bool { - return true -} -func (adi *appendedDirInfo) Sys() interface{} { - return nil -} diff --git a/vendor/github.com/GeertJohan/go.rice/box.go b/vendor/github.com/GeertJohan/go.rice/box.go deleted file mode 100644 index 71482e24..00000000 --- a/vendor/github.com/GeertJohan/go.rice/box.go +++ /dev/null @@ -1,337 +0,0 @@ -package rice - -import ( - "bytes" - "errors" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "runtime" - "strings" - "time" - - "github.com/GeertJohan/go.rice/embedded" -) - -// Box abstracts a directory for resources/files. -// It can either load files from disk, or from embedded code (when `rice --embed` was ran). -type Box struct { - name string - absolutePath string - embed *embedded.EmbeddedBox - appendd *appendedBox -} - -var defaultLocateOrder = []LocateMethod{LocateEmbedded, LocateAppended, LocateFS} - -func findBox(name string, order []LocateMethod) (*Box, error) { - b := &Box{name: name} - - // no support for absolute paths since gopath can be different on different machines. - // therefore, required box must be located relative to package requiring it. - if filepath.IsAbs(name) { - return nil, errors.New("given name/path is absolute") - } - - var err error - for _, method := range order { - switch method { - case LocateEmbedded: - if embed := embedded.EmbeddedBoxes[name]; embed != nil { - b.embed = embed - return b, nil - } - - case LocateAppended: - appendedBoxName := strings.Replace(name, `/`, `-`, -1) - if appendd := appendedBoxes[appendedBoxName]; appendd != nil { - b.appendd = appendd - return b, nil - } - - case LocateFS: - // resolve absolute directory path - err := b.resolveAbsolutePathFromCaller() - if err != nil { - continue - } - // check if absolutePath exists on filesystem - info, err := os.Stat(b.absolutePath) - if err != nil { - continue - } - // check if absolutePath is actually a directory - if !info.IsDir() { - err = errors.New("given name/path is not a directory") - continue - } - return b, nil - case LocateWorkingDirectory: - // resolve absolute directory path - err := b.resolveAbsolutePathFromWorkingDirectory() - if err != nil { - continue - } - // check if absolutePath exists on filesystem - info, err := os.Stat(b.absolutePath) - if err != nil { - continue - } - // check if absolutePath is actually a directory - if !info.IsDir() { - err = errors.New("given name/path is not a directory") - continue - } - return b, nil - } - } - - if err == nil { - err = fmt.Errorf("could not locate box %q", name) - } - - return nil, err -} - -// FindBox returns a Box instance for given name. -// When the given name is a relative path, it's base path will be the calling pkg/cmd's source root. -// When the given name is absolute, it's absolute. derp. -// Make sure the path doesn't contain any sensitive information as it might be placed into generated go source (embedded). -func FindBox(name string) (*Box, error) { - return findBox(name, defaultLocateOrder) -} - -// MustFindBox returns a Box instance for given name, like FindBox does. -// It does not return an error, instead it panics when an error occurs. -func MustFindBox(name string) *Box { - box, err := findBox(name, defaultLocateOrder) - if err != nil { - panic(err) - } - return box -} - -// This is injected as a mutable function literal so that we can mock it out in -// tests and return a fixed test file. -var resolveAbsolutePathFromCaller = func(name string, nStackFrames int) (string, error) { - _, callingGoFile, _, ok := runtime.Caller(nStackFrames) - if !ok { - return "", errors.New("couldn't find caller on stack") - } - - // resolve to proper path - pkgDir := filepath.Dir(callingGoFile) - // fix for go cover - const coverPath = "_test/_obj_test" - if !filepath.IsAbs(pkgDir) { - if i := strings.Index(pkgDir, coverPath); i >= 0 { - pkgDir = pkgDir[:i] + pkgDir[i+len(coverPath):] // remove coverPath - pkgDir = filepath.Join(os.Getenv("GOPATH"), "src", pkgDir) // make absolute - } - } - return filepath.Join(pkgDir, name), nil -} - -func (b *Box) resolveAbsolutePathFromCaller() error { - path, err := resolveAbsolutePathFromCaller(b.name, 4) - if err != nil { - return err - } - b.absolutePath = path - return nil - -} - -func (b *Box) resolveAbsolutePathFromWorkingDirectory() error { - path, err := os.Getwd() - if err != nil { - return err - } - b.absolutePath = filepath.Join(path, b.name) - return nil -} - -// IsEmbedded indicates wether this box was embedded into the application -func (b *Box) IsEmbedded() bool { - return b.embed != nil -} - -// IsAppended indicates wether this box was appended to the application -func (b *Box) IsAppended() bool { - return b.appendd != nil -} - -// Time returns how actual the box is. -// When the box is embedded, it's value is saved in the embedding code. -// When the box is live, this methods returns time.Now() -func (b *Box) Time() time.Time { - if b.IsEmbedded() { - return b.embed.Time - } - - //++ TODO: return time for appended box - - return time.Now() -} - -// Open opens a File from the box -// If there is an error, it will be of type *os.PathError. -func (b *Box) Open(name string) (*File, error) { - if Debug { - fmt.Printf("Open(%s)\n", name) - } - - if b.IsEmbedded() { - if Debug { - fmt.Println("Box is embedded") - } - - // trim prefix (paths are relative to box) - name = strings.TrimLeft(name, "/") - if Debug { - fmt.Printf("Trying %s\n", name) - } - - // search for file - ef := b.embed.Files[name] - if ef == nil { - if Debug { - fmt.Println("Didn't find file in embed") - } - // file not found, try dir - ed := b.embed.Dirs[name] - if ed == nil { - if Debug { - fmt.Println("Didn't find dir in embed") - } - // dir not found, error out - return nil, &os.PathError{ - Op: "open", - Path: name, - Err: os.ErrNotExist, - } - } - if Debug { - fmt.Println("Found dir. Returning virtual dir") - } - vd := newVirtualDir(ed) - return &File{virtualD: vd}, nil - } - - // box is embedded - if Debug { - fmt.Println("Found file. Returning virtual file") - } - vf := newVirtualFile(ef) - return &File{virtualF: vf}, nil - } - - if b.IsAppended() { - // trim prefix (paths are relative to box) - name = strings.TrimLeft(name, "/") - - // search for file - appendedFile := b.appendd.Files[name] - if appendedFile == nil { - return nil, &os.PathError{ - Op: "open", - Path: name, - Err: os.ErrNotExist, - } - } - - // create new file - f := &File{ - appendedF: appendedFile, - } - - // if this file is a directory, we want to be able to read and seek - if !appendedFile.dir { - // looks like malformed data in zip, error now - if appendedFile.content == nil { - return nil, &os.PathError{ - Op: "open", - Path: "name", - Err: errors.New("error reading data from zip file"), - } - } - // create new bytes.Reader - f.appendedFileReader = bytes.NewReader(appendedFile.content) - } - - // all done - return f, nil - } - - // perform os open - if Debug { - fmt.Printf("Using os.Open(%s)", filepath.Join(b.absolutePath, name)) - } - file, err := os.Open(filepath.Join(b.absolutePath, name)) - if err != nil { - return nil, err - } - return &File{realF: file}, nil -} - -// Bytes returns the content of the file with given name as []byte. -func (b *Box) Bytes(name string) ([]byte, error) { - file, err := b.Open(name) - if err != nil { - return nil, err - } - defer file.Close() - - content, err := ioutil.ReadAll(file) - if err != nil { - return nil, err - } - - return content, nil -} - -// MustBytes returns the content of the file with given name as []byte. -// panic's on error. -func (b *Box) MustBytes(name string) []byte { - bts, err := b.Bytes(name) - if err != nil { - panic(err) - } - return bts -} - -// String returns the content of the file with given name as string. -func (b *Box) String(name string) (string, error) { - // check if box is embedded, optimized fast path - if b.IsEmbedded() { - // find file in embed - ef := b.embed.Files[name] - if ef == nil { - return "", os.ErrNotExist - } - // return as string - return ef.Content, nil - } - - bts, err := b.Bytes(name) - if err != nil { - return "", err - } - return string(bts), nil -} - -// MustString returns the content of the file with given name as string. -// panic's on error. -func (b *Box) MustString(name string) string { - str, err := b.String(name) - if err != nil { - panic(err) - } - return str -} - -// Name returns the name of the box -func (b *Box) Name() string { - return b.name -} diff --git a/vendor/github.com/GeertJohan/go.rice/config.go b/vendor/github.com/GeertJohan/go.rice/config.go deleted file mode 100644 index 45eb398f..00000000 --- a/vendor/github.com/GeertJohan/go.rice/config.go +++ /dev/null @@ -1,39 +0,0 @@ -package rice - -// LocateMethod defines how a box is located. -type LocateMethod int - -const ( - LocateFS = LocateMethod(iota) // Locate on the filesystem according to package path. - LocateAppended // Locate boxes appended to the executable. - LocateEmbedded // Locate embedded boxes. - LocateWorkingDirectory // Locate on the binary working directory -) - -// Config allows customizing the box lookup behavior. -type Config struct { - // LocateOrder defines the priority order that boxes are searched for. By - // default, the package global FindBox searches for embedded boxes first, - // then appended boxes, and then finally boxes on the filesystem. That - // search order may be customized by provided the ordered list here. Leaving - // out a particular method will omit that from the search space. For - // example, []LocateMethod{LocateEmbedded, LocateAppended} will never search - // the filesystem for boxes. - LocateOrder []LocateMethod -} - -// FindBox searches for boxes using the LocateOrder of the config. -func (c *Config) FindBox(boxName string) (*Box, error) { - return findBox(boxName, c.LocateOrder) -} - -// MustFindBox searches for boxes using the LocateOrder of the config, like -// FindBox does. It does not return an error, instead it panics when an error -// occurs. -func (c *Config) MustFindBox(boxName string) *Box { - box, err := findBox(boxName, c.LocateOrder) - if err != nil { - panic(err) - } - return box -} diff --git a/vendor/github.com/GeertJohan/go.rice/debug.go b/vendor/github.com/GeertJohan/go.rice/debug.go deleted file mode 100644 index 2e68c842..00000000 --- a/vendor/github.com/GeertJohan/go.rice/debug.go +++ /dev/null @@ -1,4 +0,0 @@ -package rice - -// Debug can be set to true to enable debugging. -var Debug = false diff --git a/vendor/github.com/GeertJohan/go.rice/embedded.go b/vendor/github.com/GeertJohan/go.rice/embedded.go deleted file mode 100644 index 4f03fe1f..00000000 --- a/vendor/github.com/GeertJohan/go.rice/embedded.go +++ /dev/null @@ -1,90 +0,0 @@ -package rice - -import ( - "os" - "time" - - "github.com/GeertJohan/go.rice/embedded" -) - -// re-type to make exported methods invisible to user (godoc) -// they're not required for the user -// embeddedDirInfo implements os.FileInfo -type embeddedDirInfo embedded.EmbeddedDir - -// Name returns the base name of the directory -// (implementing os.FileInfo) -func (ed *embeddedDirInfo) Name() string { - return ed.Filename -} - -// Size always returns 0 -// (implementing os.FileInfo) -func (ed *embeddedDirInfo) Size() int64 { - return 0 -} - -// Mode returns the file mode bits -// (implementing os.FileInfo) -func (ed *embeddedDirInfo) Mode() os.FileMode { - return os.FileMode(0555 | os.ModeDir) // dr-xr-xr-x -} - -// ModTime returns the modification time -// (implementing os.FileInfo) -func (ed *embeddedDirInfo) ModTime() time.Time { - return ed.DirModTime -} - -// IsDir returns the abbreviation for Mode().IsDir() (always true) -// (implementing os.FileInfo) -func (ed *embeddedDirInfo) IsDir() bool { - return true -} - -// Sys returns the underlying data source (always nil) -// (implementing os.FileInfo) -func (ed *embeddedDirInfo) Sys() interface{} { - return nil -} - -// re-type to make exported methods invisible to user (godoc) -// they're not required for the user -// embeddedFileInfo implements os.FileInfo -type embeddedFileInfo embedded.EmbeddedFile - -// Name returns the base name of the file -// (implementing os.FileInfo) -func (ef *embeddedFileInfo) Name() string { - return ef.Filename -} - -// Size returns the length in bytes for regular files; system-dependent for others -// (implementing os.FileInfo) -func (ef *embeddedFileInfo) Size() int64 { - return int64(len(ef.Content)) -} - -// Mode returns the file mode bits -// (implementing os.FileInfo) -func (ef *embeddedFileInfo) Mode() os.FileMode { - return os.FileMode(0555) // r-xr-xr-x -} - -// ModTime returns the modification time -// (implementing os.FileInfo) -func (ef *embeddedFileInfo) ModTime() time.Time { - return ef.FileModTime -} - -// IsDir returns the abbreviation for Mode().IsDir() (always false) -// (implementing os.FileInfo) -func (ef *embeddedFileInfo) IsDir() bool { - return false -} - -// Sys returns the underlying data source (always nil) -// (implementing os.FileInfo) -func (ef *embeddedFileInfo) Sys() interface{} { - return nil -} diff --git a/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go b/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go deleted file mode 100644 index bba8e588..00000000 --- a/vendor/github.com/GeertJohan/go.rice/embedded/embedded.go +++ /dev/null @@ -1,80 +0,0 @@ -// Package embedded defines embedded data types that are shared between the go.rice package and generated code. -package embedded - -import ( - "fmt" - "path/filepath" - "strings" - "time" -) - -const ( - EmbedTypeGo = 0 - EmbedTypeSyso = 1 -) - -// EmbeddedBox defines an embedded box -type EmbeddedBox struct { - Name string // box name - Time time.Time // embed time - EmbedType int // kind of embedding - Files map[string]*EmbeddedFile // ALL embedded files by full path - Dirs map[string]*EmbeddedDir // ALL embedded dirs by full path -} - -// Link creates the ChildDirs and ChildFiles links in all EmbeddedDir's -func (e *EmbeddedBox) Link() { - for path, ed := range e.Dirs { - fmt.Println(path) - ed.ChildDirs = make([]*EmbeddedDir, 0) - ed.ChildFiles = make([]*EmbeddedFile, 0) - } - for path, ed := range e.Dirs { - parentDirpath, _ := filepath.Split(path) - if strings.HasSuffix(parentDirpath, "/") { - parentDirpath = parentDirpath[:len(parentDirpath)-1] - } - parentDir := e.Dirs[parentDirpath] - if parentDir == nil { - panic("parentDir `" + parentDirpath + "` is missing in embedded box") - } - parentDir.ChildDirs = append(parentDir.ChildDirs, ed) - } - for path, ef := range e.Files { - dirpath, _ := filepath.Split(path) - if strings.HasSuffix(dirpath, "/") { - dirpath = dirpath[:len(dirpath)-1] - } - dir := e.Dirs[dirpath] - if dir == nil { - panic("dir `" + dirpath + "` is missing in embedded box") - } - dir.ChildFiles = append(dir.ChildFiles, ef) - } -} - -// EmbeddedDir is instanced in the code generated by the rice tool and contains all necicary information about an embedded file -type EmbeddedDir struct { - Filename string - DirModTime time.Time - ChildDirs []*EmbeddedDir // direct childs, as returned by virtualDir.Readdir() - ChildFiles []*EmbeddedFile // direct childs, as returned by virtualDir.Readdir() -} - -// EmbeddedFile is instanced in the code generated by the rice tool and contains all necicary information about an embedded file -type EmbeddedFile struct { - Filename string // filename - FileModTime time.Time - Content string -} - -// EmbeddedBoxes is a public register of embedded boxes -var EmbeddedBoxes = make(map[string]*EmbeddedBox) - -// RegisterEmbeddedBox registers an EmbeddedBox -func RegisterEmbeddedBox(name string, box *EmbeddedBox) { - if _, exists := EmbeddedBoxes[name]; exists { - panic(fmt.Sprintf("EmbeddedBox with name `%s` exists already", name)) - } - EmbeddedBoxes[name] = box -} diff --git a/vendor/github.com/GeertJohan/go.rice/example/example.go b/vendor/github.com/GeertJohan/go.rice/example/example.go deleted file mode 100644 index 68f189f3..00000000 --- a/vendor/github.com/GeertJohan/go.rice/example/example.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "encoding/hex" - "fmt" - "log" - "net/http" - "os" - "text/template" - - "github.com/GeertJohan/go.rice" - "github.com/davecgh/go-spew/spew" -) - -func main() { - conf := rice.Config{ - LocateOrder: []rice.LocateMethod{rice.LocateEmbedded, rice.LocateAppended, rice.LocateFS}, - } - box, err := conf.FindBox("example-files") - if err != nil { - log.Fatalf("error opening rice.Box: %s\n", err) - } - // spew.Dump(box) - - contentString, err := box.String("file.txt") - if err != nil { - log.Fatalf("could not read file contents as string: %s\n", err) - } - log.Printf("Read some file contents as string:\n%s\n", contentString) - - contentBytes, err := box.Bytes("file.txt") - if err != nil { - log.Fatalf("could not read file contents as byteSlice: %s\n", err) - } - log.Printf("Read some file contents as byteSlice:\n%s\n", hex.Dump(contentBytes)) - - file, err := box.Open("file.txt") - if err != nil { - log.Fatalf("could not open file: %s\n", err) - } - spew.Dump(file) - - // find/create a rice.Box - templateBox, err := rice.FindBox("example-templates") - if err != nil { - log.Fatal(err) - } - // get file contents as string - templateString, err := templateBox.String("message.tmpl") - if err != nil { - log.Fatal(err) - } - // parse and execute the template - tmplMessage, err := template.New("message").Parse(templateString) - if err != nil { - log.Fatal(err) - } - tmplMessage.Execute(os.Stdout, map[string]string{"Message": "Hello, world!"}) - - http.Handle("/", http.FileServer(box.HTTPBox())) - go func() { - fmt.Println("Serving files on :8080, press ctrl-C to exit") - err := http.ListenAndServe(":8080", nil) - if err != nil { - log.Fatalf("error serving files: %v", err) - } - }() - select {} -} diff --git a/vendor/github.com/GeertJohan/go.rice/file.go b/vendor/github.com/GeertJohan/go.rice/file.go deleted file mode 100644 index 606a1885..00000000 --- a/vendor/github.com/GeertJohan/go.rice/file.go +++ /dev/null @@ -1,144 +0,0 @@ -package rice - -import ( - "bytes" - "errors" - "os" - "path/filepath" -) - -// File implements the io.Reader, io.Seeker, io.Closer and http.File interfaces -type File struct { - // File abstracts file methods so the user doesn't see the difference between rice.virtualFile, rice.virtualDir and os.File - // TODO: maybe use internal File interface and four implementations: *os.File, appendedFile, virtualFile, virtualDir - - // real file on disk - realF *os.File - - // when embedded (go) - virtualF *virtualFile - virtualD *virtualDir - - // when appended (zip) - appendedF *appendedFile - appendedFileReader *bytes.Reader - // TODO: is appendedFileReader subject of races? Might need a lock here.. -} - -// Close is like (*os.File).Close() -// Visit http://golang.org/pkg/os/#File.Close for more information -func (f *File) Close() error { - if f.appendedF != nil { - if f.appendedFileReader == nil { - return errors.New("already closed") - } - f.appendedFileReader = nil - return nil - } - if f.virtualF != nil { - return f.virtualF.close() - } - if f.virtualD != nil { - return f.virtualD.close() - } - return f.realF.Close() -} - -// Stat is like (*os.File).Stat() -// Visit http://golang.org/pkg/os/#File.Stat for more information -func (f *File) Stat() (os.FileInfo, error) { - if f.appendedF != nil { - if f.appendedF.dir { - return f.appendedF.dirInfo, nil - } - if f.appendedFileReader == nil { - return nil, errors.New("file is closed") - } - return f.appendedF.zipFile.FileInfo(), nil - } - if f.virtualF != nil { - return f.virtualF.stat() - } - if f.virtualD != nil { - return f.virtualD.stat() - } - return f.realF.Stat() -} - -// Readdir is like (*os.File).Readdir() -// Visit http://golang.org/pkg/os/#File.Readdir for more information -func (f *File) Readdir(count int) ([]os.FileInfo, error) { - if f.appendedF != nil { - if f.appendedF.dir { - fi := make([]os.FileInfo, 0, len(f.appendedF.children)) - for _, childAppendedFile := range f.appendedF.children { - if childAppendedFile.dir { - fi = append(fi, childAppendedFile.dirInfo) - } else { - fi = append(fi, childAppendedFile.zipFile.FileInfo()) - } - } - return fi, nil - } - //++ TODO: is os.ErrInvalid the correct error for Readdir on file? - return nil, os.ErrInvalid - } - if f.virtualF != nil { - return f.virtualF.readdir(count) - } - if f.virtualD != nil { - return f.virtualD.readdir(count) - } - return f.realF.Readdir(count) -} - -// Read is like (*os.File).Read() -// Visit http://golang.org/pkg/os/#File.Read for more information -func (f *File) Read(bts []byte) (int, error) { - if f.appendedF != nil { - if f.appendedFileReader == nil { - return 0, &os.PathError{ - Op: "read", - Path: filepath.Base(f.appendedF.zipFile.Name), - Err: errors.New("file is closed"), - } - } - if f.appendedF.dir { - return 0, &os.PathError{ - Op: "read", - Path: filepath.Base(f.appendedF.zipFile.Name), - Err: errors.New("is a directory"), - } - } - return f.appendedFileReader.Read(bts) - } - if f.virtualF != nil { - return f.virtualF.read(bts) - } - if f.virtualD != nil { - return f.virtualD.read(bts) - } - return f.realF.Read(bts) -} - -// Seek is like (*os.File).Seek() -// Visit http://golang.org/pkg/os/#File.Seek for more information -func (f *File) Seek(offset int64, whence int) (int64, error) { - if f.appendedF != nil { - if f.appendedFileReader == nil { - return 0, &os.PathError{ - Op: "seek", - Path: filepath.Base(f.appendedF.zipFile.Name), - Err: errors.New("file is closed"), - } - } - return f.appendedFileReader.Seek(offset, whence) - } - if f.virtualF != nil { - return f.virtualF.seek(offset, whence) - } - if f.virtualD != nil { - return f.virtualD.seek(offset, whence) - } - return f.realF.Seek(offset, whence) -} diff --git a/vendor/github.com/GeertJohan/go.rice/http.go b/vendor/github.com/GeertJohan/go.rice/http.go deleted file mode 100644 index 3a61f0e1..00000000 --- a/vendor/github.com/GeertJohan/go.rice/http.go +++ /dev/null @@ -1,21 +0,0 @@ -package rice - -import ( - "net/http" -) - -// HTTPBox implements http.FileSystem which allows the use of Box with a http.FileServer. -// e.g.: http.Handle("/", http.FileServer(rice.MustFindBox("http-files").HTTPBox())) -type HTTPBox struct { - *Box -} - -// HTTPBox creates a new HTTPBox from an existing Box -func (b *Box) HTTPBox() *HTTPBox { - return &HTTPBox{b} -} - -// Open returns a File using the http.File interface -func (hb *HTTPBox) Open(name string) (http.File, error) { - return hb.Box.Open(name) -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/append.go b/vendor/github.com/GeertJohan/go.rice/rice/append.go deleted file mode 100644 index ae3d95fd..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/append.go +++ /dev/null @@ -1,172 +0,0 @@ -package main - -import ( - "archive/zip" - "fmt" - "go/build" - "io" - "os" - "os/exec" - "path/filepath" - "runtime" - "strings" - "time" - - "github.com/daaku/go.zipexe" -) - -func operationAppend(pkgs []*build.Package) { - if runtime.GOOS == "windows" { - _, err := exec.LookPath("zip") - if err != nil { - fmt.Println("#### WARNING ! ####") - fmt.Println("`rice append` is known not to work under windows because the `zip` command is not available. Please let me know if you got this to work (and how).") - } - } - - // MARKED FOR DELETION - // This is actually not required, the append command now has the option --exec required. - // // check if package is a command - // if !pkg.IsCommand() { - // fmt.Println("Error: can not append to non-main package. Please follow instructions at github.com/GeertJohan/go.rice") - // os.Exit(1) - // } - - // create tmp zipfile - tmpZipfileName := filepath.Join(os.TempDir(), fmt.Sprintf("ricebox-%d-%s.zip", time.Now().Unix(), randomString(10))) - verbosef("Will create tmp zipfile: %s\n", tmpZipfileName) - tmpZipfile, err := os.Create(tmpZipfileName) - if err != nil { - fmt.Printf("Error creating tmp zipfile: %s\n", err) - os.Exit(1) - } - defer func() { - tmpZipfile.Close() - os.Remove(tmpZipfileName) - }() - - // find abs path for binary file - binfileName, err := filepath.Abs(flags.Append.Executable) - if err != nil { - fmt.Printf("Error finding absolute path for executable to append: %s\n", err) - os.Exit(1) - } - verbosef("Will append to file: %s\n", binfileName) - - // check that command doesn't already have zip appended - if rd, _ := zipexe.Open(binfileName); rd != nil { - fmt.Printf("Cannot append to already appended executable. Please remove %s and build a fresh one.\n", binfileName) - os.Exit(1) - } - - // open binfile - binfile, err := os.OpenFile(binfileName, os.O_WRONLY, os.ModeAppend) - if err != nil { - fmt.Printf("Error: unable to open executable file: %s\n", err) - os.Exit(1) - } - - // create zip.Writer - zipWriter := zip.NewWriter(tmpZipfile) - - for _, pkg := range pkgs { - // find boxes for this command - boxMap := findBoxes(pkg) - - // notify user when no calls to rice.FindBox are made (is this an error and therefore os.Exit(1) ? - if len(boxMap) == 0 { - fmt.Printf("no calls to rice.FindBox() or rice.MustFindBox() found in import path `%s`\n", pkg.ImportPath) - continue - } - - verbosef("\n") - - for boxname := range boxMap { - appendedBoxName := strings.Replace(boxname, `/`, `-`, -1) - - // walk box path's and insert files - boxPath := filepath.Clean(filepath.Join(pkg.Dir, boxname)) - filepath.Walk(boxPath, func(path string, info os.FileInfo, err error) error { - if info == nil { - fmt.Printf("Error: box \"%s\" not found on disk\n", path) - os.Exit(1) - } - // create zipFilename - zipFileName := filepath.Join(appendedBoxName, strings.TrimPrefix(path, boxPath)) - // write directories as empty file with comment "dir" - if info.IsDir() { - _, err := zipWriter.CreateHeader(&zip.FileHeader{ - Name: zipFileName, - Comment: "dir", - }) - if err != nil { - fmt.Printf("Error creating dir in tmp zip: %s\n", err) - os.Exit(1) - } - return nil - } - - // create zipFileWriter - zipFileHeader, err := zip.FileInfoHeader(info) - if err != nil { - fmt.Printf("Error creating zip FileHeader: %v\n", err) - os.Exit(1) - } - zipFileHeader.Name = zipFileName - zipFileWriter, err := zipWriter.CreateHeader(zipFileHeader) - if err != nil { - fmt.Printf("Error creating file in tmp zip: %s\n", err) - os.Exit(1) - } - srcFile, err := os.Open(path) - if err != nil { - fmt.Printf("Error opening file to append: %s\n", err) - os.Exit(1) - } - _, err = io.Copy(zipFileWriter, srcFile) - if err != nil { - fmt.Printf("Error copying file contents to zip: %s\n", err) - os.Exit(1) - } - srcFile.Close() - - return nil - }) - } - } - - err = zipWriter.Close() - if err != nil { - fmt.Printf("Error closing tmp zipfile: %s\n", err) - os.Exit(1) - } - - err = tmpZipfile.Sync() - if err != nil { - fmt.Printf("Error syncing tmp zipfile: %s\n", err) - os.Exit(1) - } - _, err = tmpZipfile.Seek(0, 0) - if err != nil { - fmt.Printf("Error seeking tmp zipfile: %s\n", err) - os.Exit(1) - } - _, err = binfile.Seek(0, 2) - if err != nil { - fmt.Printf("Error seeking bin file: %s\n", err) - os.Exit(1) - } - - _, err = io.Copy(binfile, tmpZipfile) - if err != nil { - fmt.Printf("Error appending zipfile to executable: %s\n", err) - os.Exit(1) - } - - zipA := exec.Command("zip", "-A", binfileName) - err = zipA.Run() - if err != nil { - fmt.Printf("Error setting zip offset: %s\n", err) - os.Exit(1) - } -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/clean.go b/vendor/github.com/GeertJohan/go.rice/rice/clean.go deleted file mode 100644 index 6155c064..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/clean.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "fmt" - "go/build" - "os" - "path/filepath" - "strings" -) - -func operationClean(pkg *build.Package) { - filepath.Walk(pkg.Dir, func(filename string, info os.FileInfo, err error) error { - if err != nil { - fmt.Printf("error walking pkg dir to clean files: %v\n", err) - os.Exit(1) - } - if info.IsDir() { - return nil - } - verbosef("checking file '%s'\n", filename) - if filepath.Base(filename) == "rice-box.go" || - strings.HasSuffix(filename, ".rice-box.go") || - strings.HasSuffix(filename, ".rice-box.syso") { - err := os.Remove(filename) - if err != nil { - fmt.Printf("error removing file (%s): %s\n", filename, err) - os.Exit(-1) - } - verbosef("removed file '%s'\n", filename) - } - return nil - }) -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/embed-go.go b/vendor/github.com/GeertJohan/go.rice/rice/embed-go.go deleted file mode 100644 index c5a0e9e8..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/embed-go.go +++ /dev/null @@ -1,158 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "go/build" - "go/format" - "io" - "io/ioutil" - "log" - "os" - "path/filepath" - "strings" -) - -const boxFilename = "rice-box.go" - -func operationEmbedGo(pkg *build.Package) { - - boxMap := findBoxes(pkg) - - // notify user when no calls to rice.FindBox are made (is this an error and therefore os.Exit(1) ? - if len(boxMap) == 0 { - fmt.Println("no calls to rice.FindBox() found") - return - } - - verbosef("\n") - var boxes []*boxDataType - - for boxname := range boxMap { - // find path and filename for this box - boxPath := filepath.Join(pkg.Dir, boxname) - - // Check to see if the path for the box is a symbolic link. If so, simply - // box what the symbolic link points to. Note: the filepath.Walk function - // will NOT follow any nested symbolic links. This only handles the case - // where the root of the box is a symbolic link. - symPath, serr := os.Readlink(boxPath) - if serr == nil { - boxPath = symPath - } - - // verbose info - verbosef("embedding box '%s' to '%s'\n", boxname, boxFilename) - - // read box metadata - boxInfo, ierr := os.Stat(boxPath) - if ierr != nil { - fmt.Printf("Error: unable to access box at %s\n", boxPath) - os.Exit(1) - } - - // create box datastructure (used by template) - box := &boxDataType{ - BoxName: boxname, - UnixNow: boxInfo.ModTime().Unix(), - Files: make([]*fileDataType, 0), - Dirs: make(map[string]*dirDataType), - } - - if !boxInfo.IsDir() { - fmt.Printf("Error: Box %s must point to a directory but points to %s instead\n", - boxname, boxPath) - os.Exit(1) - } - - // fill box datastructure with file data - filepath.Walk(boxPath, func(path string, info os.FileInfo, err error) error { - if err != nil { - fmt.Printf("error walking box: %s\n", err) - os.Exit(1) - } - - filename := strings.TrimPrefix(path, boxPath) - filename = strings.Replace(filename, "\\", "/", -1) - filename = strings.TrimPrefix(filename, "/") - if info.IsDir() { - dirData := &dirDataType{ - Identifier: "dir" + nextIdentifier(), - FileName: filename, - ModTime: info.ModTime().Unix(), - ChildFiles: make([]*fileDataType, 0), - ChildDirs: make([]*dirDataType, 0), - } - verbosef("\tincludes dir: '%s'\n", dirData.FileName) - box.Dirs[dirData.FileName] = dirData - - // add tree entry (skip for root, it'll create a recursion) - if dirData.FileName != "" { - pathParts := strings.Split(dirData.FileName, "/") - parentDir := box.Dirs[strings.Join(pathParts[:len(pathParts)-1], "/")] - parentDir.ChildDirs = append(parentDir.ChildDirs, dirData) - } - } else { - fileData := &fileDataType{ - Identifier: "file" + nextIdentifier(), - FileName: filename, - ModTime: info.ModTime().Unix(), - } - verbosef("\tincludes file: '%s'\n", fileData.FileName) - fileData.Content, err = ioutil.ReadFile(path) - if err != nil { - fmt.Printf("error reading file content while walking box: %s\n", err) - os.Exit(1) - } - box.Files = append(box.Files, fileData) - - // add tree entry - pathParts := strings.Split(fileData.FileName, "/") - parentDir := box.Dirs[strings.Join(pathParts[:len(pathParts)-1], "/")] - if parentDir == nil { - fmt.Printf("Error: parent of %s is not within the box\n", path) - os.Exit(1) - } - parentDir.ChildFiles = append(parentDir.ChildFiles, fileData) - } - return nil - }) - boxes = append(boxes, box) - - } - - embedSourceUnformated := bytes.NewBuffer(make([]byte, 0)) - - // execute template to buffer - err := tmplEmbeddedBox.Execute( - embedSourceUnformated, - embedFileDataType{pkg.Name, boxes}, - ) - if err != nil { - log.Printf("error writing embedded box to file (template execute): %s\n", err) - os.Exit(1) - } - - // format the source code - embedSource, err := format.Source(embedSourceUnformated.Bytes()) - if err != nil { - log.Printf("error formatting embedSource: %s\n", err) - os.Exit(1) - } - - // create go file for box - boxFile, err := os.Create(filepath.Join(pkg.Dir, boxFilename)) - if err != nil { - log.Printf("error creating embedded box file: %s\n", err) - os.Exit(1) - } - defer boxFile.Close() - - // write source to file - _, err = io.Copy(boxFile, bytes.NewBuffer(embedSource)) - if err != nil { - log.Printf("error writing embedSource to file: %s\n", err) - os.Exit(1) - } - -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/embed-syso.go b/vendor/github.com/GeertJohan/go.rice/rice/embed-syso.go deleted file mode 100644 index beef3ea7..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/embed-syso.go +++ /dev/null @@ -1,204 +0,0 @@ -package main - -import ( - "bytes" - "encoding/gob" - "fmt" - "go/build" - "io" - "io/ioutil" - "os" - "path/filepath" - "regexp" - "strings" - "text/template" - - "github.com/GeertJohan/go.rice/embedded" - "github.com/akavel/rsrc/coff" -) - -type sizedReader struct { - *bytes.Reader -} - -func (s sizedReader) Size() int64 { - return int64(s.Len()) -} - -var tmplEmbeddedSysoHelper *template.Template - -func init() { - var err error - tmplEmbeddedSysoHelper, err = template.New("embeddedSysoHelper").Parse(`package {{.Package}} -// ############# GENERATED CODE ##################### -// ## This file was generated by the rice tool. -// ## Do not edit unless you know what you're doing. -// ################################################## - -// extern char _bricebox_{{.Symname}}[], _ericebox_{{.Symname}}; -// int get_{{.Symname}}_length() { -// return &_ericebox_{{.Symname}} - _bricebox_{{.Symname}}; -// } -import "C" -import ( - "bytes" - "encoding/gob" - "github.com/GeertJohan/go.rice/embedded" - "unsafe" -) - -func init() { - ptr := unsafe.Pointer(&C._bricebox_{{.Symname}}) - bts := C.GoBytes(ptr, C.get_{{.Symname}}_length()) - embeddedBox := &embedded.EmbeddedBox{} - err := gob.NewDecoder(bytes.NewReader(bts)).Decode(embeddedBox) - if err != nil { - panic("error decoding embedded box: "+err.Error()) - } - embeddedBox.Link() - embedded.RegisterEmbeddedBox(embeddedBox.Name, embeddedBox) -}`) - if err != nil { - panic("could not parse template embeddedSysoHelper: " + err.Error()) - } -} - -type embeddedSysoHelperData struct { - Package string - Symname string -} - -func operationEmbedSyso(pkg *build.Package) { - - regexpSynameReplacer := regexp.MustCompile(`[^a-z0-9_]`) - - boxMap := findBoxes(pkg) - - // notify user when no calls to rice.FindBox are made (is this an error and therefore os.Exit(1) ? - if len(boxMap) == 0 { - fmt.Println("no calls to rice.FindBox() found") - return - } - - verbosef("\n") - - for boxname := range boxMap { - // find path and filename for this box - boxPath := filepath.Join(pkg.Dir, boxname) - boxFilename := strings.Replace(boxname, "/", "-", -1) - boxFilename = strings.Replace(boxFilename, "..", "back", -1) - boxFilename = strings.Replace(boxFilename, ".", "-", -1) - - // verbose info - verbosef("embedding box '%s'\n", boxname) - verbosef("\tto file %s\n", boxFilename) - - // read box metadata - boxInfo, ierr := os.Stat(boxPath) - if ierr != nil { - fmt.Printf("Error: unable to access box at %s\n", boxPath) - os.Exit(1) - } - - // create box datastructure (used by template) - box := &embedded.EmbeddedBox{ - Name: boxname, - Time: boxInfo.ModTime(), - EmbedType: embedded.EmbedTypeSyso, - Files: make(map[string]*embedded.EmbeddedFile), - Dirs: make(map[string]*embedded.EmbeddedDir), - } - - // fill box datastructure with file data - filepath.Walk(boxPath, func(path string, info os.FileInfo, err error) error { - if err != nil { - fmt.Printf("error walking box: %s\n", err) - os.Exit(1) - } - - filename := strings.TrimPrefix(path, boxPath) - filename = strings.Replace(filename, "\\", "/", -1) - filename = strings.TrimPrefix(filename, "/") - if info.IsDir() { - embeddedDir := &embedded.EmbeddedDir{ - Filename: filename, - DirModTime: info.ModTime(), - } - verbosef("\tincludes dir: '%s'\n", embeddedDir.Filename) - box.Dirs[embeddedDir.Filename] = embeddedDir - - // add tree entry (skip for root, it'll create a recursion) - if embeddedDir.Filename != "" { - pathParts := strings.Split(embeddedDir.Filename, "/") - parentDir := box.Dirs[strings.Join(pathParts[:len(pathParts)-1], "/")] - parentDir.ChildDirs = append(parentDir.ChildDirs, embeddedDir) - } - } else { - embeddedFile := &embedded.EmbeddedFile{ - Filename: filename, - FileModTime: info.ModTime(), - Content: "", - } - verbosef("\tincludes file: '%s'\n", embeddedFile.Filename) - contentBytes, err := ioutil.ReadFile(path) - if err != nil { - fmt.Printf("error reading file content while walking box: %s\n", err) - os.Exit(1) - } - embeddedFile.Content = string(contentBytes) - box.Files[embeddedFile.Filename] = embeddedFile - } - return nil - }) - - // encode embedded box to gob file - boxGobBuf := &bytes.Buffer{} - err := gob.NewEncoder(boxGobBuf).Encode(box) - if err != nil { - fmt.Printf("error encoding box to gob: %v\n", err) - os.Exit(1) - } - - verbosef("gob-encoded embeddedBox is %d bytes large\n", boxGobBuf.Len()) - - // write coff - symname := regexpSynameReplacer.ReplaceAllString(boxname, "_") - createCoffSyso(boxname, symname, "386", boxGobBuf.Bytes()) - createCoffSyso(boxname, symname, "amd64", boxGobBuf.Bytes()) - - // write go - sysoHelperData := embeddedSysoHelperData{ - Package: pkg.Name, - Symname: symname, - } - fileSysoHelper, err := os.Create(boxFilename + ".rice-box.go") - if err != nil { - fmt.Printf("error creating syso helper: %v\n", err) - os.Exit(1) - } - err = tmplEmbeddedSysoHelper.Execute(fileSysoHelper, sysoHelperData) - if err != nil { - fmt.Printf("error executing tmplEmbeddedSysoHelper: %v\n", err) - os.Exit(1) - } - } -} - -func createCoffSyso(boxFilename string, symname string, arch string, data []byte) { - boxCoff := coff.NewRDATA() - switch arch { - case "386": - case "amd64": - boxCoff.FileHeader.Machine = 0x8664 - default: - panic("invalid arch") - } - boxCoff.AddData("_bricebox_"+symname, sizedReader{bytes.NewReader(data)}) - boxCoff.AddData("_ericebox_"+symname, io.NewSectionReader(strings.NewReader("\000\000"), 0, 2)) // TODO: why? copied from rsrc, which copied it from as-generated - boxCoff.Freeze() - err := writeCoff(boxCoff, boxFilename+"_"+arch+".rice-box.syso") - if err != nil { - fmt.Printf("error writing %s coff/.syso: %v\n", arch, err) - os.Exit(1) - } -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/find.go b/vendor/github.com/GeertJohan/go.rice/rice/find.go deleted file mode 100644 index 6d78eeaa..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/find.go +++ /dev/null @@ -1,150 +0,0 @@ -package main - -import ( - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "os" - "path/filepath" - "strings" -) - -func badArgument(fileset *token.FileSet, p token.Pos) { - pos := fileset.Position(p) - filename := pos.Filename - base, err := os.Getwd() - if err == nil { - rpath, perr := filepath.Rel(base, pos.Filename) - if perr == nil { - filename = rpath - } - } - msg := fmt.Sprintf("%s:%d: Error: found call to rice.FindBox, "+ - "but argument must be a string literal.\n", filename, pos.Line) - fmt.Println(msg) - os.Exit(1) -} - -func findBoxes(pkg *build.Package) map[string]bool { - // create map of boxes to embed - var boxMap = make(map[string]bool) - - // create one list of files for this package - filenames := make([]string, 0, len(pkg.GoFiles)+len(pkg.CgoFiles)) - filenames = append(filenames, pkg.GoFiles...) - filenames = append(filenames, pkg.CgoFiles...) - - // loop over files, search for rice.FindBox(..) calls - for _, filename := range filenames { - // find full filepath - fullpath := filepath.Join(pkg.Dir, filename) - if strings.HasSuffix(filename, "rice-box.go") { - // Ignore *.rice-box.go files - verbosef("skipping file %q\n", fullpath) - continue - } - verbosef("scanning file %q\n", fullpath) - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, fullpath, nil, 0) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - var riceIsImported bool - ricePkgName := "rice" - for _, imp := range f.Imports { - if strings.HasSuffix(imp.Path.Value, "go.rice\"") { - if imp.Name != nil { - ricePkgName = imp.Name.Name - } - riceIsImported = true - break - } - } - if !riceIsImported { - // Rice wasn't imported, so we won't find a box. - continue - } - if ricePkgName == "_" { - // Rice pkg is unnamed, so we won't find a box. - continue - } - - // Inspect AST, looking for calls to (Must)?FindBox. - // First parameter of the func must be a basic literal. - // Identifiers won't be resolved. - var nextIdentIsBoxFunc bool - var nextBasicLitParamIsBoxName bool - var boxCall token.Pos - var variableToRemember string - var validVariablesForBoxes map[string]bool = make(map[string]bool) - - ast.Inspect(f, func(node ast.Node) bool { - if node == nil { - return false - } - switch x := node.(type) { - // this case fixes the var := func() style assignments, not assignments to vars declared separately from the assignment. - case *ast.AssignStmt: - var assign = node.(*ast.AssignStmt) - name, found := assign.Lhs[0].(*ast.Ident) - if found { - variableToRemember = name.Name - composite, first := assign.Rhs[0].(*ast.CompositeLit) - if first { - riceSelector, second := composite.Type.(*ast.SelectorExpr) - - if second { - callCorrect := riceSelector.Sel.Name == "Config" - packageName, third := riceSelector.X.(*ast.Ident) - - if third && callCorrect && packageName.Name == ricePkgName { - validVariablesForBoxes[name.Name] = true - verbosef("\tfound variable, saving to scan for boxes: %q\n", name.Name) - } - } - } - } - case *ast.Ident: - if nextIdentIsBoxFunc || ricePkgName == "." { - nextIdentIsBoxFunc = false - if x.Name == "FindBox" || x.Name == "MustFindBox" { - nextBasicLitParamIsBoxName = true - boxCall = x.Pos() - } - } else { - if x.Name == ricePkgName || validVariablesForBoxes[x.Name] { - nextIdentIsBoxFunc = true - } - } - case *ast.BasicLit: - if nextBasicLitParamIsBoxName { - if x.Kind == token.STRING { - nextBasicLitParamIsBoxName = false - // trim "" or `` - name := x.Value[1 : len(x.Value)-1] - boxMap[name] = true - verbosef("\tfound box %q\n", name) - } else { - badArgument(fset, boxCall) - } - } - - default: - if nextIdentIsBoxFunc { - nextIdentIsBoxFunc = false - } - if nextBasicLitParamIsBoxName { - badArgument(fset, boxCall) - } - } - return true - }) - } - - return boxMap -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/flags.go b/vendor/github.com/GeertJohan/go.rice/rice/flags.go deleted file mode 100644 index 167fea80..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/flags.go +++ /dev/null @@ -1,80 +0,0 @@ -package main - -import ( - "fmt" - "go/build" - "os" - - goflags "github.com/jessevdk/go-flags" // rename import to `goflags` (file scope) so we can use `var flags` (package scope) -) - -// flags -var flags struct { - Verbose bool `long:"verbose" short:"v" description:"Show verbose debug information"` - ImportPaths []string `long:"import-path" short:"i" description:"Import path(s) to use. Using PWD when left empty. Specify multiple times for more import paths to append"` - - Append struct { - Executable string `long:"exec" description:"Executable to append" required:"true"` - } `command:"append"` - - EmbedGo struct{} `command:"embed-go" alias:"embed"` - EmbedSyso struct{} `command:"embed-syso"` - Clean struct{} `command:"clean"` -} - -// flags parser -var flagsParser *goflags.Parser - -// initFlags parses the given flags. -// when the user asks for help (-h or --help): the application exists with status 0 -// when unexpected flags is given: the application exits with status 1 -func parseArguments() { - // create flags parser in global var, for flagsParser.Active.Name (operation) - flagsParser = goflags.NewParser(&flags, goflags.Default) - - // parse flags - args, err := flagsParser.Parse() - if err != nil { - // assert the err to be a flags.Error - flagError := err.(*goflags.Error) - if flagError.Type == goflags.ErrHelp { - // user asked for help on flags. - // program can exit successfully - os.Exit(0) - } - if flagError.Type == goflags.ErrUnknownFlag { - fmt.Println("Use --help to view available options.") - os.Exit(1) - } - if flagError.Type == goflags.ErrRequired { - os.Exit(1) - } - fmt.Printf("Error parsing flags: %s\n", err) - os.Exit(1) - } - - // error on left-over arguments - if len(args) > 0 { - fmt.Printf("Unexpected arguments: %s\nUse --help to view available options.", args) - os.Exit(1) - } - - // default ImportPath to pwd when not set - if len(flags.ImportPaths) == 0 { - pwd, err := os.Getwd() - if err != nil { - fmt.Printf("error getting pwd: %s\n", err) - os.Exit(1) - } - verbosef("using pwd as import path\n") - // find non-absolute path for this pwd - pkg, err := build.ImportDir(pwd, build.FindOnly) - if err != nil { - fmt.Printf("error using current directory as import path: %s\n", err) - os.Exit(1) - } - flags.ImportPaths = append(flags.ImportPaths, pkg.ImportPath) - verbosef("using import paths: %s\n", flags.ImportPaths) - return - } -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/identifier.go b/vendor/github.com/GeertJohan/go.rice/rice/identifier.go deleted file mode 100644 index 445ee7da..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/identifier.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "strconv" - - "github.com/GeertJohan/go.incremental" -) - -var identifierCount incremental.Uint64 - -func nextIdentifier() string { - num := identifierCount.Next() - return strconv.FormatUint(num, 36) // 0123456789abcdefghijklmnopqrstuvwxyz -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/main.go b/vendor/github.com/GeertJohan/go.rice/rice/main.go deleted file mode 100644 index 7bac5fa3..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/main.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "fmt" - "go/build" - "log" - "os" -) - -func main() { - // parser arguments - parseArguments() - - // find package for path - var pkgs []*build.Package - for _, importPath := range flags.ImportPaths { - pkg := pkgForPath(importPath) - pkgs = append(pkgs, pkg) - } - - // switch on the operation to perform - switch flagsParser.Active.Name { - case "embed", "embed-go": - for _, pkg := range pkgs { - operationEmbedGo(pkg) - } - case "embed-syso": - log.Println("WARNING: embedding .syso is experimental..") - for _, pkg := range pkgs { - operationEmbedSyso(pkg) - } - case "append": - operationAppend(pkgs) - case "clean": - for _, pkg := range pkgs { - operationClean(pkg) - } - } - - // all done - verbosef("\n") - verbosef("rice finished successfully\n") -} - -// helper function to get *build.Package for given path -func pkgForPath(path string) *build.Package { - // get pwd for relative imports - pwd, err := os.Getwd() - if err != nil { - fmt.Printf("error getting pwd (required for relative imports): %s\n", err) - os.Exit(1) - } - - // read full package information - pkg, err := build.Import(path, pwd, 0) - if err != nil { - fmt.Printf("error reading package: %s\n", err) - os.Exit(1) - } - - return pkg -} - -func verbosef(format string, stuff ...interface{}) { - if flags.Verbose { - log.Printf(format, stuff...) - } -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/templates.go b/vendor/github.com/GeertJohan/go.rice/rice/templates.go deleted file mode 100644 index 02561ca0..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/templates.go +++ /dev/null @@ -1,98 +0,0 @@ -package main - -import ( - "fmt" - "os" - "text/template" -) - -var tmplEmbeddedBox *template.Template - -func init() { - var err error - - // parse embedded box template - tmplEmbeddedBox, err = template.New("embeddedBox").Parse(`package {{.Package}} - -import ( - "github.com/GeertJohan/go.rice/embedded" - "time" -) - -{{range .Boxes}} -func init() { - - // define files - {{range .Files}}{{.Identifier}} := &embedded.EmbeddedFile{ - Filename: ` + "`" + `{{.FileName}}` + "`" + `, - FileModTime: time.Unix({{.ModTime}}, 0), - Content: string({{.Content | printf "%q"}}), - } - {{end}} - - // define dirs - {{range .Dirs}}{{.Identifier}} := &embedded.EmbeddedDir{ - Filename: ` + "`" + `{{.FileName}}` + "`" + `, - DirModTime: time.Unix({{.ModTime}}, 0), - ChildFiles: []*embedded.EmbeddedFile{ - {{range .ChildFiles}}{{.Identifier}}, // {{.FileName}} - {{end}} - }, - } - {{end}} - - // link ChildDirs - {{range .Dirs}}{{.Identifier}}.ChildDirs = []*embedded.EmbeddedDir{ - {{range .ChildDirs}}{{.Identifier}}, // {{.FileName}} - {{end}} - } - {{end}} - - // register embeddedBox - embedded.RegisterEmbeddedBox(` + "`" + `{{.BoxName}}` + "`" + `, &embedded.EmbeddedBox{ - Name: ` + "`" + `{{.BoxName}}` + "`" + `, - Time: time.Unix({{.UnixNow}}, 0), - Dirs: map[string]*embedded.EmbeddedDir{ - {{range .Dirs}}"{{.FileName}}": {{.Identifier}}, - {{end}} - }, - Files: map[string]*embedded.EmbeddedFile{ - {{range .Files}}"{{.FileName}}": {{.Identifier}}, - {{end}} - }, - }) -} -{{end}}`) - if err != nil { - fmt.Printf("error parsing embedded box template: %s\n", err) - os.Exit(-1) - } -} - -type embedFileDataType struct { - Package string - Boxes []*boxDataType -} - -type boxDataType struct { - BoxName string - UnixNow int64 - Files []*fileDataType - Dirs map[string]*dirDataType -} - -type fileDataType struct { - Identifier string - FileName string - Content []byte - ModTime int64 -} - -type dirDataType struct { - Identifier string - FileName string - Content []byte - ModTime int64 - ChildDirs []*dirDataType - ChildFiles []*fileDataType -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/util.go b/vendor/github.com/GeertJohan/go.rice/rice/util.go deleted file mode 100644 index c9ed4b0a..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/util.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "math/rand" - "time" -) - -// randomString generates a pseudo-random alpha-numeric string with given length. -func randomString(length int) string { - rand.Seed(time.Now().UnixNano()) - k := make([]rune, length) - for i := 0; i < length; i++ { - c := rand.Intn(35) - if c < 10 { - c += 48 // numbers (0-9) (0+48 == 48 == '0', 9+48 == 57 == '9') - } else { - c += 87 // lower case alphabets (a-z) (10+87 == 97 == 'a', 35+87 == 122 = 'z') - } - k[i] = rune(c) - } - return string(k) -} diff --git a/vendor/github.com/GeertJohan/go.rice/rice/writecoff.go b/vendor/github.com/GeertJohan/go.rice/rice/writecoff.go deleted file mode 100644 index 0c12c0ff..00000000 --- a/vendor/github.com/GeertJohan/go.rice/rice/writecoff.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "fmt" - "os" - "reflect" - - "github.com/akavel/rsrc/binutil" - "github.com/akavel/rsrc/coff" -) - -// copied from github.com/akavel/rsrc -// LICENSE: MIT -// Copyright 2013-2014 The rsrc Authors. (https://github.com/akavel/rsrc/blob/master/AUTHORS) -func writeCoff(coff *coff.Coff, fnameout string) error { - out, err := os.Create(fnameout) - if err != nil { - return err - } - defer out.Close() - w := binutil.Writer{W: out} - - // write the resulting file to disk - binutil.Walk(coff, func(v reflect.Value, path string) error { - if binutil.Plain(v.Kind()) { - w.WriteLE(v.Interface()) - return nil - } - vv, ok := v.Interface().(binutil.SizedReader) - if ok { - w.WriteFromSized(vv) - return binutil.WALK_SKIP - } - return nil - }) - - if w.Err != nil { - return fmt.Errorf("Error writing output file: %s", w.Err) - } - - return nil -} diff --git a/vendor/github.com/GeertJohan/go.rice/sort.go b/vendor/github.com/GeertJohan/go.rice/sort.go deleted file mode 100644 index cd83c658..00000000 --- a/vendor/github.com/GeertJohan/go.rice/sort.go +++ /dev/null @@ -1,19 +0,0 @@ -package rice - -import "os" - -// SortByName allows an array of os.FileInfo objects -// to be easily sorted by filename using sort.Sort(SortByName(array)) -type SortByName []os.FileInfo - -func (f SortByName) Len() int { return len(f) } -func (f SortByName) Less(i, j int) bool { return f[i].Name() < f[j].Name() } -func (f SortByName) Swap(i, j int) { f[i], f[j] = f[j], f[i] } - -// SortByModified allows an array of os.FileInfo objects -// to be easily sorted by modified date using sort.Sort(SortByModified(array)) -type SortByModified []os.FileInfo - -func (f SortByModified) Len() int { return len(f) } -func (f SortByModified) Less(i, j int) bool { return f[i].ModTime().Unix() > f[j].ModTime().Unix() } -func (f SortByModified) Swap(i, j int) { f[i], f[j] = f[j], f[i] } diff --git a/vendor/github.com/GeertJohan/go.rice/virtual.go b/vendor/github.com/GeertJohan/go.rice/virtual.go deleted file mode 100644 index 50bff167..00000000 --- a/vendor/github.com/GeertJohan/go.rice/virtual.go +++ /dev/null @@ -1,252 +0,0 @@ -package rice - -import ( - "errors" - "io" - "os" - "path/filepath" - "sort" - - "github.com/GeertJohan/go.rice/embedded" -) - -//++ TODO: IDEA: merge virtualFile and virtualDir, this decreases work done by rice.File - -// Error indicating some function is not implemented yet (but available to satisfy an interface) -var ErrNotImplemented = errors.New("not implemented yet") - -// virtualFile is a 'stateful' virtual file. -// virtualFile wraps an *EmbeddedFile for a call to Box.Open() and virtualizes 'read cursor' (offset) and 'closing'. -// virtualFile is only internally visible and should be exposed through rice.File -type virtualFile struct { - *embedded.EmbeddedFile // the actual embedded file, embedded to obtain methods - offset int64 // read position on the virtual file - closed bool // closed when true -} - -// create a new virtualFile for given EmbeddedFile -func newVirtualFile(ef *embedded.EmbeddedFile) *virtualFile { - vf := &virtualFile{ - EmbeddedFile: ef, - offset: 0, - closed: false, - } - return vf -} - -//++ TODO check for nil pointers in all these methods. When so: return os.PathError with Err: os.ErrInvalid - -func (vf *virtualFile) close() error { - if vf.closed { - return &os.PathError{ - Op: "close", - Path: vf.EmbeddedFile.Filename, - Err: errors.New("already closed"), - } - } - vf.EmbeddedFile = nil - vf.closed = true - return nil -} - -func (vf *virtualFile) stat() (os.FileInfo, error) { - if vf.closed { - return nil, &os.PathError{ - Op: "stat", - Path: vf.EmbeddedFile.Filename, - Err: errors.New("bad file descriptor"), - } - } - return (*embeddedFileInfo)(vf.EmbeddedFile), nil -} - -func (vf *virtualFile) readdir(count int) ([]os.FileInfo, error) { - if vf.closed { - return nil, &os.PathError{ - Op: "readdir", - Path: vf.EmbeddedFile.Filename, - Err: errors.New("bad file descriptor"), - } - } - //TODO: return proper error for a readdir() call on a file - return nil, ErrNotImplemented -} - -func (vf *virtualFile) read(bts []byte) (int, error) { - if vf.closed { - return 0, &os.PathError{ - Op: "read", - Path: vf.EmbeddedFile.Filename, - Err: errors.New("bad file descriptor"), - } - } - - end := vf.offset + int64(len(bts)) - - if end >= int64(len(vf.Content)) { - // end of file, so return what we have + EOF - n := copy(bts, vf.Content[vf.offset:]) - vf.offset = 0 - return n, io.EOF - } - - n := copy(bts, vf.Content[vf.offset:end]) - vf.offset += int64(n) - return n, nil - -} - -func (vf *virtualFile) seek(offset int64, whence int) (int64, error) { - if vf.closed { - return 0, &os.PathError{ - Op: "seek", - Path: vf.EmbeddedFile.Filename, - Err: errors.New("bad file descriptor"), - } - } - var e error - - //++ TODO: check if this is correct implementation for seek - switch whence { - case os.SEEK_SET: - //++ check if new offset isn't out of bounds, set e when it is, then break out of switch - vf.offset = offset - case os.SEEK_CUR: - //++ check if new offset isn't out of bounds, set e when it is, then break out of switch - vf.offset += offset - case os.SEEK_END: - //++ check if new offset isn't out of bounds, set e when it is, then break out of switch - vf.offset = int64(len(vf.EmbeddedFile.Content)) - offset - } - - if e != nil { - return 0, &os.PathError{ - Op: "seek", - Path: vf.Filename, - Err: e, - } - } - - return vf.offset, nil -} - -// virtualDir is a 'stateful' virtual directory. -// virtualDir wraps an *EmbeddedDir for a call to Box.Open() and virtualizes 'closing'. -// virtualDir is only internally visible and should be exposed through rice.File -type virtualDir struct { - *embedded.EmbeddedDir - offset int // readdir position on the directory - closed bool -} - -// create a new virtualDir for given EmbeddedDir -func newVirtualDir(ed *embedded.EmbeddedDir) *virtualDir { - vd := &virtualDir{ - EmbeddedDir: ed, - offset: 0, - closed: false, - } - return vd -} - -func (vd *virtualDir) close() error { - //++ TODO: needs sync mutex? - if vd.closed { - return &os.PathError{ - Op: "close", - Path: vd.EmbeddedDir.Filename, - Err: errors.New("already closed"), - } - } - vd.closed = true - return nil -} - -func (vd *virtualDir) stat() (os.FileInfo, error) { - if vd.closed { - return nil, &os.PathError{ - Op: "stat", - Path: vd.EmbeddedDir.Filename, - Err: errors.New("bad file descriptor"), - } - } - return (*embeddedDirInfo)(vd.EmbeddedDir), nil -} - -func (vd *virtualDir) readdir(n int) (fi []os.FileInfo, err error) { - - if vd.closed { - return nil, &os.PathError{ - Op: "readdir", - Path: vd.EmbeddedDir.Filename, - Err: errors.New("bad file descriptor"), - } - } - - // Build up the array of our contents - var files []os.FileInfo - - // Add the child directories - for _, child := range vd.ChildDirs { - child.Filename = filepath.Base(child.Filename) - files = append(files, (*embeddedDirInfo)(child)) - } - - // Add the child files - for _, child := range vd.ChildFiles { - child.Filename = filepath.Base(child.Filename) - files = append(files, (*embeddedFileInfo)(child)) - } - - // Sort it by filename (lexical order) - sort.Sort(SortByName(files)) - - // Return all contents if that's what is requested - if n <= 0 { - vd.offset = 0 - return files, nil - } - - // If user has requested past the end of our list - // return what we can and send an EOF - if vd.offset+n >= len(files) { - offset := vd.offset - vd.offset = 0 - return files[offset:], io.EOF - } - - offset := vd.offset - vd.offset += n - return files[offset : offset+n], nil - -} - -func (vd *virtualDir) read(bts []byte) (int, error) { - if vd.closed { - return 0, &os.PathError{ - Op: "read", - Path: vd.EmbeddedDir.Filename, - Err: errors.New("bad file descriptor"), - } - } - return 0, &os.PathError{ - Op: "read", - Path: vd.EmbeddedDir.Filename, - Err: errors.New("is a directory"), - } -} - -func (vd *virtualDir) seek(offset int64, whence int) (int64, error) { - if vd.closed { - return 0, &os.PathError{ - Op: "seek", - Path: vd.EmbeddedDir.Filename, - Err: errors.New("bad file descriptor"), - } - } - return 0, &os.PathError{ - Op: "seek", - Path: vd.Filename, - Err: errors.New("is a directory"), - } -} diff --git a/vendor/github.com/GeertJohan/go.rice/walk.go b/vendor/github.com/GeertJohan/go.rice/walk.go deleted file mode 100644 index 3042aeab..00000000 --- a/vendor/github.com/GeertJohan/go.rice/walk.go +++ /dev/null @@ -1,122 +0,0 @@ -package rice - -import ( - "os" - "path/filepath" - "sort" - "strings" -) - -// Walk is like filepath.Walk() -// Visit http://golang.org/pkg/path/filepath/#Walk for more information -func (b *Box) Walk(path string, walkFn filepath.WalkFunc) error { - - pathFile, err := b.Open(path) - if err != nil { - return err - } - defer pathFile.Close() - - pathInfo, err := pathFile.Stat() - if err != nil { - return err - } - - if b.IsAppended() || b.IsEmbedded() { - return b.walk(path, pathInfo, walkFn) - } - - // We don't have any embedded or appended box so use live filesystem mode - return filepath.Walk(b.absolutePath+string(os.PathSeparator)+path, func(path string, info os.FileInfo, err error) error { - - // Strip out the box name from the returned paths - path = strings.TrimPrefix(path, b.absolutePath+string(os.PathSeparator)) - return walkFn(path, info, err) - - }) - -} - -// walk recursively descends path. -// See walk() in $GOROOT/src/pkg/path/filepath/path.go -func (b *Box) walk(path string, info os.FileInfo, walkFn filepath.WalkFunc) error { - - err := walkFn(path, info, nil) - if err != nil { - if info.IsDir() && err == filepath.SkipDir { - return nil - } - return err - } - - if !info.IsDir() { - return nil - } - - names, err := b.readDirNames(path) - if err != nil { - return walkFn(path, info, err) - } - - for _, name := range names { - - filename := filepath.Join(path, name) - fileObject, err := b.Open(filename) - if err != nil { - return err - } - defer fileObject.Close() - - fileInfo, err := fileObject.Stat() - if err != nil { - if err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir { - return err - } - } else { - err = b.walk(filename, fileInfo, walkFn) - if err != nil { - if !fileInfo.IsDir() || err != filepath.SkipDir { - return err - } - } - } - } - - return nil - -} - -// readDirNames reads the directory named by path and returns a sorted list of directory entries. -// See readDirNames() in $GOROOT/pkg/path/filepath/path.go -func (b *Box) readDirNames(path string) ([]string, error) { - - f, err := b.Open(path) - if err != nil { - return nil, err - } - defer f.Close() - - stat, err := f.Stat() - if err != nil { - return nil, err - } - - if !stat.IsDir() { - return nil, nil - } - - infos, err := f.Readdir(0) - if err != nil { - return nil, err - } - - var names []string - - for _, info := range infos { - names = append(names, info.Name()) - } - - sort.Strings(names) - return names, nil - -} diff --git a/vendor/github.com/Philipp15b/go-steam/.gitignore b/vendor/github.com/Philipp15b/go-steam/.gitignore new file mode 100644 index 00000000..6cd1df2b --- /dev/null +++ b/vendor/github.com/Philipp15b/go-steam/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/vendor/github.com/Philipp15b/go-steam/.gitmodules b/vendor/github.com/Philipp15b/go-steam/.gitmodules new file mode 100644 index 00000000..117cc6e9 --- /dev/null +++ b/vendor/github.com/Philipp15b/go-steam/.gitmodules @@ -0,0 +1,3 @@ +[submodule "generator/SteamKit"] + path = generator/SteamKit + url = https://github.com/Philipp15b/SteamKit.git diff --git a/vendor/github.com/Philipp15b/go-steam/README.md b/vendor/github.com/Philipp15b/go-steam/README.md new file mode 100644 index 00000000..76c906ad --- /dev/null +++ b/vendor/github.com/Philipp15b/go-steam/README.md @@ -0,0 +1,64 @@ +# Steam for Go + +This library implements Steam's protocol to allow automation of different actions on Steam without running an actual Steam client. It is based on [SteamKit2](https://github.com/SteamRE/SteamKit), a .NET library. + +In addition, it contains APIs to Steam Community features, like trade offers and inventories. + +Some of the currently implemented features: + + * Trading and trade offers, including inventories and notifications + * Friend and group management + * Chatting with friends + * Persona states (online, offline, looking to trade, etc.) + * SteamGuard with two-factor authentication + * Team Fortress 2: Crafting, moving, naming and deleting items + +If this is useful to you, there's also the [go-steamapi](https://github.com/Philipp15b/go-steamapi) package that wraps some of the official Steam Web API's types. + +## Installation + + go get github.com/Philipp15b/go-steam + +## Usage + +You can view the documentation with the [`godoc`](http://golang.org/cmd/godoc) tool or +[online on godoc.org](http://godoc.org/github.com/Philipp15b/go-steam). + +You should also take a look at the following sub-packages: + + * [`gsbot`](http://godoc.org/github.com/Philipp15b/go-steam/gsbot) utilites that make writing bots easier + * [example bot](http://godoc.org/github.com/Philipp15b/go-steam/gsbot/gsbot) and [its source code](https://github.com/Philipp15b/go-steam/blob/master/gsbot/gsbot/gsbot.go) + * [`trade`](http://godoc.org/github.com/Philipp15b/go-steam/trade) for trading + * [`tradeoffer`](http://godoc.org/github.com/Philipp15b/go-steam/tradeoffer) for trade offers + * [`economy/inventory`](http://godoc.org/github.com/Philipp15b/go-steam/economy/inventory) for inventories + * [`tf2`](http://godoc.org/github.com/Philipp15b/go-steam/tf2) for Team Fortress 2 related things + +## Working with go-steam + +Whether you want to develop your own Steam bot or directly work on go-steam itself, there are are few things to know. + + * If something is not working, check first if the same operation works (under the same conditions!) in the Steam client on that account. Maybe there's something go-steam doesn't handle correctly or you're missing a warning that's not obviously shown in go-steam. This is particularly important when working with trading since there are [restrictions](https://support.steampowered.com/kb_article.php?ref=1047-edfm-2932), for example newly authorized devices will not be able to trade for seven days. + * Since Steam does not maintain a public API for most of the things go-steam implements, you can expect that sometimes things break randomly. Especially the `trade` and `tradeoffer` packages have been affected in the past. + * Always gather as much information as possible. When you file an issue, be as precise and complete as you can. This makes debugging way easier. + * If you haven't noticed yet, expect to find lots of things out yourself. Debugging can be complicated and Steam's internals are too. + * Sometimes things break and other [SteamKit ports](https://github.com/SteamRE/SteamKit/wiki/Ports) are fixed already. Maybe take a look what people are saying over there? There's also the [SteamKit IRC channel](https://github.com/SteamRE/SteamKit/wiki#contact). + +## Updating go-steam to a new SteamKit version + +To update go-steam to a new version of SteamKit, do the following: + + go get github.com/golang/protobuf/protoc-gen-go/ + git submodule init && git submodule update + cd generator + go run generator.go clean proto steamlang + +Make sure that `$GOPATH/bin` / `protoc-gen-go` is in your `$PATH`. You'll also need [`protoc`](https://developers.google.com/protocol-buffers/docs/downloads), the protocol buffer compiler. At the moment, we use Protocol Buffers 2.6.1 with `proco-gen-go`-[2402d76](https://github.com/golang/protobuf/tree/2402d76f3d41f928c7902a765dfc872356dd3aad). + +To compile the Steam Language files, you also need the [.NET Framework](https://www.microsoft.com/net/downloads) +on Windows or [mono](http://www.go-mono.com/mono-downloads/download.html) on other operating systems. + +Apply the protocol changes where necessary. + +## License + +Steam for Go is licensed under the New BSD License. More information can be found in LICENSE.txt. \ No newline at end of file diff --git a/vendor/github.com/Philipp15b/go-steam/community/community.go b/vendor/github.com/Philipp15b/go-steam/community/community.go deleted file mode 100644 index 641c3942..00000000 --- a/vendor/github.com/Philipp15b/go-steam/community/community.go +++ /dev/null @@ -1,35 +0,0 @@ -package community - -import ( - "net/http" - "net/http/cookiejar" - "net/url" -) - -const cookiePath = "https://steamcommunity.com/" - -func SetCookies(client *http.Client, sessionId, steamLogin, steamLoginSecure string) { - if client.Jar == nil { - client.Jar, _ = cookiejar.New(new(cookiejar.Options)) - } - base, err := url.Parse(cookiePath) - if err != nil { - panic(err) - } - client.Jar.SetCookies(base, []*http.Cookie{ - // It seems that, for some reason, Steam tries to URL-decode the cookie. - &http.Cookie{ - Name: "sessionid", - Value: url.QueryEscape(sessionId), - }, - // steamLogin is already URL-encoded. - &http.Cookie{ - Name: "steamLogin", - Value: steamLogin, - }, - &http.Cookie{ - Name: "steamLoginSecure", - Value: steamLoginSecure, - }, - }) -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/base.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/base.pb.go deleted file mode 100644 index 302e667c..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/base.pb.go +++ /dev/null @@ -1,3651 +0,0 @@ -// Code generated by protoc-gen-go. -// source: base_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type EGCBaseMsg int32 - -const ( - EGCBaseMsg_k_EMsgGCSystemMessage EGCBaseMsg = 4001 - EGCBaseMsg_k_EMsgGCReplicateConVars EGCBaseMsg = 4002 - EGCBaseMsg_k_EMsgGCConVarUpdated EGCBaseMsg = 4003 - EGCBaseMsg_k_EMsgGCInviteToParty EGCBaseMsg = 4501 - EGCBaseMsg_k_EMsgGCInvitationCreated EGCBaseMsg = 4502 - EGCBaseMsg_k_EMsgGCPartyInviteResponse EGCBaseMsg = 4503 - EGCBaseMsg_k_EMsgGCKickFromParty EGCBaseMsg = 4504 - EGCBaseMsg_k_EMsgGCLeaveParty EGCBaseMsg = 4505 - EGCBaseMsg_k_EMsgGCServerAvailable EGCBaseMsg = 4506 - EGCBaseMsg_k_EMsgGCClientConnectToServer EGCBaseMsg = 4507 - EGCBaseMsg_k_EMsgGCGameServerInfo EGCBaseMsg = 4508 - EGCBaseMsg_k_EMsgGCError EGCBaseMsg = 4509 - EGCBaseMsg_k_EMsgGCReplay_UploadedToYouTube EGCBaseMsg = 4510 - EGCBaseMsg_k_EMsgGCLANServerAvailable EGCBaseMsg = 4511 - EGCBaseMsg_k_EMsgGCInviteToLobby EGCBaseMsg = 4512 - EGCBaseMsg_k_EMsgGCLobbyInviteResponse EGCBaseMsg = 4513 -) - -var EGCBaseMsg_name = map[int32]string{ - 4001: "k_EMsgGCSystemMessage", - 4002: "k_EMsgGCReplicateConVars", - 4003: "k_EMsgGCConVarUpdated", - 4501: "k_EMsgGCInviteToParty", - 4502: "k_EMsgGCInvitationCreated", - 4503: "k_EMsgGCPartyInviteResponse", - 4504: "k_EMsgGCKickFromParty", - 4505: "k_EMsgGCLeaveParty", - 4506: "k_EMsgGCServerAvailable", - 4507: "k_EMsgGCClientConnectToServer", - 4508: "k_EMsgGCGameServerInfo", - 4509: "k_EMsgGCError", - 4510: "k_EMsgGCReplay_UploadedToYouTube", - 4511: "k_EMsgGCLANServerAvailable", - 4512: "k_EMsgGCInviteToLobby", - 4513: "k_EMsgGCLobbyInviteResponse", -} -var EGCBaseMsg_value = map[string]int32{ - "k_EMsgGCSystemMessage": 4001, - "k_EMsgGCReplicateConVars": 4002, - "k_EMsgGCConVarUpdated": 4003, - "k_EMsgGCInviteToParty": 4501, - "k_EMsgGCInvitationCreated": 4502, - "k_EMsgGCPartyInviteResponse": 4503, - "k_EMsgGCKickFromParty": 4504, - "k_EMsgGCLeaveParty": 4505, - "k_EMsgGCServerAvailable": 4506, - "k_EMsgGCClientConnectToServer": 4507, - "k_EMsgGCGameServerInfo": 4508, - "k_EMsgGCError": 4509, - "k_EMsgGCReplay_UploadedToYouTube": 4510, - "k_EMsgGCLANServerAvailable": 4511, - "k_EMsgGCInviteToLobby": 4512, - "k_EMsgGCLobbyInviteResponse": 4513, -} - -func (x EGCBaseMsg) Enum() *EGCBaseMsg { - p := new(EGCBaseMsg) - *p = x - return p -} -func (x EGCBaseMsg) String() string { - return proto.EnumName(EGCBaseMsg_name, int32(x)) -} -func (x *EGCBaseMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCBaseMsg_value, data, "EGCBaseMsg") - if err != nil { - return err - } - *x = EGCBaseMsg(value) - return nil -} -func (EGCBaseMsg) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{0} } - -type EGCBaseProtoObjectTypes int32 - -const ( - EGCBaseProtoObjectTypes_k_EProtoObjectPartyInvite EGCBaseProtoObjectTypes = 1001 - EGCBaseProtoObjectTypes_k_EProtoObjectLobbyInvite EGCBaseProtoObjectTypes = 1002 -) - -var EGCBaseProtoObjectTypes_name = map[int32]string{ - 1001: "k_EProtoObjectPartyInvite", - 1002: "k_EProtoObjectLobbyInvite", -} -var EGCBaseProtoObjectTypes_value = map[string]int32{ - "k_EProtoObjectPartyInvite": 1001, - "k_EProtoObjectLobbyInvite": 1002, -} - -func (x EGCBaseProtoObjectTypes) Enum() *EGCBaseProtoObjectTypes { - p := new(EGCBaseProtoObjectTypes) - *p = x - return p -} -func (x EGCBaseProtoObjectTypes) String() string { - return proto.EnumName(EGCBaseProtoObjectTypes_name, int32(x)) -} -func (x *EGCBaseProtoObjectTypes) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCBaseProtoObjectTypes_value, data, "EGCBaseProtoObjectTypes") - if err != nil { - return err - } - *x = EGCBaseProtoObjectTypes(value) - return nil -} -func (EGCBaseProtoObjectTypes) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{1} } - -type ECustomGameInstallStatus int32 - -const ( - ECustomGameInstallStatus_k_ECustomGameInstallStatus_Unknown ECustomGameInstallStatus = 0 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_Ready ECustomGameInstallStatus = 1 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_Busy ECustomGameInstallStatus = 2 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_FailedGeneric ECustomGameInstallStatus = 101 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_FailedInternalError ECustomGameInstallStatus = 102 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_RequestedTimestampTooOld ECustomGameInstallStatus = 103 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_RequestedTimestampTooNew ECustomGameInstallStatus = 104 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_CRCMismatch ECustomGameInstallStatus = 105 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_FailedSteam ECustomGameInstallStatus = 106 - ECustomGameInstallStatus_k_ECustomGameInstallStatus_FailedCanceled ECustomGameInstallStatus = 107 -) - -var ECustomGameInstallStatus_name = map[int32]string{ - 0: "k_ECustomGameInstallStatus_Unknown", - 1: "k_ECustomGameInstallStatus_Ready", - 2: "k_ECustomGameInstallStatus_Busy", - 101: "k_ECustomGameInstallStatus_FailedGeneric", - 102: "k_ECustomGameInstallStatus_FailedInternalError", - 103: "k_ECustomGameInstallStatus_RequestedTimestampTooOld", - 104: "k_ECustomGameInstallStatus_RequestedTimestampTooNew", - 105: "k_ECustomGameInstallStatus_CRCMismatch", - 106: "k_ECustomGameInstallStatus_FailedSteam", - 107: "k_ECustomGameInstallStatus_FailedCanceled", -} -var ECustomGameInstallStatus_value = map[string]int32{ - "k_ECustomGameInstallStatus_Unknown": 0, - "k_ECustomGameInstallStatus_Ready": 1, - "k_ECustomGameInstallStatus_Busy": 2, - "k_ECustomGameInstallStatus_FailedGeneric": 101, - "k_ECustomGameInstallStatus_FailedInternalError": 102, - "k_ECustomGameInstallStatus_RequestedTimestampTooOld": 103, - "k_ECustomGameInstallStatus_RequestedTimestampTooNew": 104, - "k_ECustomGameInstallStatus_CRCMismatch": 105, - "k_ECustomGameInstallStatus_FailedSteam": 106, - "k_ECustomGameInstallStatus_FailedCanceled": 107, -} - -func (x ECustomGameInstallStatus) Enum() *ECustomGameInstallStatus { - p := new(ECustomGameInstallStatus) - *p = x - return p -} -func (x ECustomGameInstallStatus) String() string { - return proto.EnumName(ECustomGameInstallStatus_name, int32(x)) -} -func (x *ECustomGameInstallStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ECustomGameInstallStatus_value, data, "ECustomGameInstallStatus") - if err != nil { - return err - } - *x = ECustomGameInstallStatus(value) - return nil -} -func (ECustomGameInstallStatus) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{2} } - -type GC_BannedWordType int32 - -const ( - GC_BannedWordType_GC_BANNED_WORD_DISABLE_WORD GC_BannedWordType = 0 - GC_BannedWordType_GC_BANNED_WORD_ENABLE_WORD GC_BannedWordType = 1 -) - -var GC_BannedWordType_name = map[int32]string{ - 0: "GC_BANNED_WORD_DISABLE_WORD", - 1: "GC_BANNED_WORD_ENABLE_WORD", -} -var GC_BannedWordType_value = map[string]int32{ - "GC_BANNED_WORD_DISABLE_WORD": 0, - "GC_BANNED_WORD_ENABLE_WORD": 1, -} - -func (x GC_BannedWordType) Enum() *GC_BannedWordType { - p := new(GC_BannedWordType) - *p = x - return p -} -func (x GC_BannedWordType) String() string { - return proto.EnumName(GC_BannedWordType_name, int32(x)) -} -func (x *GC_BannedWordType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(GC_BannedWordType_value, data, "GC_BannedWordType") - if err != nil { - return err - } - *x = GC_BannedWordType(value) - return nil -} -func (GC_BannedWordType) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{3} } - -type CMsgExtractGemsResponse_EExtractGems int32 - -const ( - CMsgExtractGemsResponse_k_ExtractGems_Succeeded CMsgExtractGemsResponse_EExtractGems = 0 - CMsgExtractGemsResponse_k_ExtractGems_Failed_ToolIsInvalid CMsgExtractGemsResponse_EExtractGems = 1 - CMsgExtractGemsResponse_k_ExtractGems_Failed_ItemIsInvalid CMsgExtractGemsResponse_EExtractGems = 2 - CMsgExtractGemsResponse_k_ExtractGems_Failed_ToolCannotRemoveGem CMsgExtractGemsResponse_EExtractGems = 3 - CMsgExtractGemsResponse_k_ExtractGems_Failed_FailedToRemoveGem CMsgExtractGemsResponse_EExtractGems = 4 -) - -var CMsgExtractGemsResponse_EExtractGems_name = map[int32]string{ - 0: "k_ExtractGems_Succeeded", - 1: "k_ExtractGems_Failed_ToolIsInvalid", - 2: "k_ExtractGems_Failed_ItemIsInvalid", - 3: "k_ExtractGems_Failed_ToolCannotRemoveGem", - 4: "k_ExtractGems_Failed_FailedToRemoveGem", -} -var CMsgExtractGemsResponse_EExtractGems_value = map[string]int32{ - "k_ExtractGems_Succeeded": 0, - "k_ExtractGems_Failed_ToolIsInvalid": 1, - "k_ExtractGems_Failed_ItemIsInvalid": 2, - "k_ExtractGems_Failed_ToolCannotRemoveGem": 3, - "k_ExtractGems_Failed_FailedToRemoveGem": 4, -} - -func (x CMsgExtractGemsResponse_EExtractGems) Enum() *CMsgExtractGemsResponse_EExtractGems { - p := new(CMsgExtractGemsResponse_EExtractGems) - *p = x - return p -} -func (x CMsgExtractGemsResponse_EExtractGems) String() string { - return proto.EnumName(CMsgExtractGemsResponse_EExtractGems_name, int32(x)) -} -func (x *CMsgExtractGemsResponse_EExtractGems) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgExtractGemsResponse_EExtractGems_value, data, "CMsgExtractGemsResponse_EExtractGems") - if err != nil { - return err - } - *x = CMsgExtractGemsResponse_EExtractGems(value) - return nil -} -func (CMsgExtractGemsResponse_EExtractGems) EnumDescriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{78, 0} -} - -type CMsgAddSocketResponse_EAddSocket int32 - -const ( - CMsgAddSocketResponse_k_AddSocket_Succeeded CMsgAddSocketResponse_EAddSocket = 0 - CMsgAddSocketResponse_k_AddSocket_Failed_ToolIsInvalid CMsgAddSocketResponse_EAddSocket = 1 - CMsgAddSocketResponse_k_AddSocket_Failed_ItemCannotBeSocketed CMsgAddSocketResponse_EAddSocket = 2 - CMsgAddSocketResponse_k_AddSocket_Failed_FailedToAddSocket CMsgAddSocketResponse_EAddSocket = 3 -) - -var CMsgAddSocketResponse_EAddSocket_name = map[int32]string{ - 0: "k_AddSocket_Succeeded", - 1: "k_AddSocket_Failed_ToolIsInvalid", - 2: "k_AddSocket_Failed_ItemCannotBeSocketed", - 3: "k_AddSocket_Failed_FailedToAddSocket", -} -var CMsgAddSocketResponse_EAddSocket_value = map[string]int32{ - "k_AddSocket_Succeeded": 0, - "k_AddSocket_Failed_ToolIsInvalid": 1, - "k_AddSocket_Failed_ItemCannotBeSocketed": 2, - "k_AddSocket_Failed_FailedToAddSocket": 3, -} - -func (x CMsgAddSocketResponse_EAddSocket) Enum() *CMsgAddSocketResponse_EAddSocket { - p := new(CMsgAddSocketResponse_EAddSocket) - *p = x - return p -} -func (x CMsgAddSocketResponse_EAddSocket) String() string { - return proto.EnumName(CMsgAddSocketResponse_EAddSocket_name, int32(x)) -} -func (x *CMsgAddSocketResponse_EAddSocket) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgAddSocketResponse_EAddSocket_value, data, "CMsgAddSocketResponse_EAddSocket") - if err != nil { - return err - } - *x = CMsgAddSocketResponse_EAddSocket(value) - return nil -} -func (CMsgAddSocketResponse_EAddSocket) EnumDescriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{80, 0} -} - -type CMsgAddItemToSocketResponse_EAddGem int32 - -const ( - CMsgAddItemToSocketResponse_k_AddGem_Succeeded CMsgAddItemToSocketResponse_EAddGem = 0 - CMsgAddItemToSocketResponse_k_AddGem_Failed_GemIsInvalid CMsgAddItemToSocketResponse_EAddGem = 1 - CMsgAddItemToSocketResponse_k_AddGem_Failed_ItemIsInvalid CMsgAddItemToSocketResponse_EAddGem = 2 - CMsgAddItemToSocketResponse_k_AddGem_Failed_FailedToAddGem CMsgAddItemToSocketResponse_EAddGem = 3 - CMsgAddItemToSocketResponse_k_AddGem_Failed_InvalidGemTypeForSocket CMsgAddItemToSocketResponse_EAddGem = 4 - CMsgAddItemToSocketResponse_k_AddGem_Failed_InvalidGemTypeForHero CMsgAddItemToSocketResponse_EAddGem = 5 - CMsgAddItemToSocketResponse_k_AddGem_Failed_InvalidGemTypeForSlot CMsgAddItemToSocketResponse_EAddGem = 6 - CMsgAddItemToSocketResponse_k_AddGem_Failed_SocketContainsUnremovableGem CMsgAddItemToSocketResponse_EAddGem = 7 -) - -var CMsgAddItemToSocketResponse_EAddGem_name = map[int32]string{ - 0: "k_AddGem_Succeeded", - 1: "k_AddGem_Failed_GemIsInvalid", - 2: "k_AddGem_Failed_ItemIsInvalid", - 3: "k_AddGem_Failed_FailedToAddGem", - 4: "k_AddGem_Failed_InvalidGemTypeForSocket", - 5: "k_AddGem_Failed_InvalidGemTypeForHero", - 6: "k_AddGem_Failed_InvalidGemTypeForSlot", - 7: "k_AddGem_Failed_SocketContainsUnremovableGem", -} -var CMsgAddItemToSocketResponse_EAddGem_value = map[string]int32{ - "k_AddGem_Succeeded": 0, - "k_AddGem_Failed_GemIsInvalid": 1, - "k_AddGem_Failed_ItemIsInvalid": 2, - "k_AddGem_Failed_FailedToAddGem": 3, - "k_AddGem_Failed_InvalidGemTypeForSocket": 4, - "k_AddGem_Failed_InvalidGemTypeForHero": 5, - "k_AddGem_Failed_InvalidGemTypeForSlot": 6, - "k_AddGem_Failed_SocketContainsUnremovableGem": 7, -} - -func (x CMsgAddItemToSocketResponse_EAddGem) Enum() *CMsgAddItemToSocketResponse_EAddGem { - p := new(CMsgAddItemToSocketResponse_EAddGem) - *p = x - return p -} -func (x CMsgAddItemToSocketResponse_EAddGem) String() string { - return proto.EnumName(CMsgAddItemToSocketResponse_EAddGem_name, int32(x)) -} -func (x *CMsgAddItemToSocketResponse_EAddGem) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgAddItemToSocketResponse_EAddGem_value, data, "CMsgAddItemToSocketResponse_EAddGem") - if err != nil { - return err - } - *x = CMsgAddItemToSocketResponse_EAddGem(value) - return nil -} -func (CMsgAddItemToSocketResponse_EAddGem) EnumDescriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{83, 0} -} - -type CMsgResetStrangeGemCountResponse_EResetGem int32 - -const ( - CMsgResetStrangeGemCountResponse_k_ResetGem_Succeeded CMsgResetStrangeGemCountResponse_EResetGem = 0 - CMsgResetStrangeGemCountResponse_k_ResetGem_Failed_FailedToResetGem CMsgResetStrangeGemCountResponse_EResetGem = 1 - CMsgResetStrangeGemCountResponse_k_ResetGem_Failed_ItemIsInvalid CMsgResetStrangeGemCountResponse_EResetGem = 2 - CMsgResetStrangeGemCountResponse_k_ResetGem_Failed_InvalidSocketId CMsgResetStrangeGemCountResponse_EResetGem = 3 - CMsgResetStrangeGemCountResponse_k_ResetGem_Failed_SocketCannotBeReset CMsgResetStrangeGemCountResponse_EResetGem = 4 -) - -var CMsgResetStrangeGemCountResponse_EResetGem_name = map[int32]string{ - 0: "k_ResetGem_Succeeded", - 1: "k_ResetGem_Failed_FailedToResetGem", - 2: "k_ResetGem_Failed_ItemIsInvalid", - 3: "k_ResetGem_Failed_InvalidSocketId", - 4: "k_ResetGem_Failed_SocketCannotBeReset", -} -var CMsgResetStrangeGemCountResponse_EResetGem_value = map[string]int32{ - "k_ResetGem_Succeeded": 0, - "k_ResetGem_Failed_FailedToResetGem": 1, - "k_ResetGem_Failed_ItemIsInvalid": 2, - "k_ResetGem_Failed_InvalidSocketId": 3, - "k_ResetGem_Failed_SocketCannotBeReset": 4, -} - -func (x CMsgResetStrangeGemCountResponse_EResetGem) Enum() *CMsgResetStrangeGemCountResponse_EResetGem { - p := new(CMsgResetStrangeGemCountResponse_EResetGem) - *p = x - return p -} -func (x CMsgResetStrangeGemCountResponse_EResetGem) String() string { - return proto.EnumName(CMsgResetStrangeGemCountResponse_EResetGem_name, int32(x)) -} -func (x *CMsgResetStrangeGemCountResponse_EResetGem) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgResetStrangeGemCountResponse_EResetGem_value, data, "CMsgResetStrangeGemCountResponse_EResetGem") - if err != nil { - return err - } - *x = CMsgResetStrangeGemCountResponse_EResetGem(value) - return nil -} -func (CMsgResetStrangeGemCountResponse_EResetGem) EnumDescriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{85, 0} -} - -type CGCStorePurchaseInit_LineItem struct { - ItemDefId *uint32 `protobuf:"varint,1,opt,name=item_def_id" json:"item_def_id,omitempty"` - Quantity *uint32 `protobuf:"varint,2,opt,name=quantity" json:"quantity,omitempty"` - CostInLocalCurrency *uint32 `protobuf:"varint,3,opt,name=cost_in_local_currency" json:"cost_in_local_currency,omitempty"` - PurchaseType *uint32 `protobuf:"varint,4,opt,name=purchase_type" json:"purchase_type,omitempty"` - SourceReferenceId *uint64 `protobuf:"varint,5,opt,name=source_reference_id" json:"source_reference_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCStorePurchaseInit_LineItem) Reset() { *m = CGCStorePurchaseInit_LineItem{} } -func (m *CGCStorePurchaseInit_LineItem) String() string { return proto.CompactTextString(m) } -func (*CGCStorePurchaseInit_LineItem) ProtoMessage() {} -func (*CGCStorePurchaseInit_LineItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{0} } - -func (m *CGCStorePurchaseInit_LineItem) GetItemDefId() uint32 { - if m != nil && m.ItemDefId != nil { - return *m.ItemDefId - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetQuantity() uint32 { - if m != nil && m.Quantity != nil { - return *m.Quantity - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetCostInLocalCurrency() uint32 { - if m != nil && m.CostInLocalCurrency != nil { - return *m.CostInLocalCurrency - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetPurchaseType() uint32 { - if m != nil && m.PurchaseType != nil { - return *m.PurchaseType - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetSourceReferenceId() uint64 { - if m != nil && m.SourceReferenceId != nil { - return *m.SourceReferenceId - } - return 0 -} - -type CMsgGCStorePurchaseInit struct { - Country *string `protobuf:"bytes,1,opt,name=country" json:"country,omitempty"` - Language *int32 `protobuf:"varint,2,opt,name=language" json:"language,omitempty"` - Currency *int32 `protobuf:"varint,3,opt,name=currency" json:"currency,omitempty"` - LineItems []*CGCStorePurchaseInit_LineItem `protobuf:"bytes,4,rep,name=line_items" json:"line_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseInit) Reset() { *m = CMsgGCStorePurchaseInit{} } -func (m *CMsgGCStorePurchaseInit) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseInit) ProtoMessage() {} -func (*CMsgGCStorePurchaseInit) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{1} } - -func (m *CMsgGCStorePurchaseInit) GetCountry() string { - if m != nil && m.Country != nil { - return *m.Country - } - return "" -} - -func (m *CMsgGCStorePurchaseInit) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return 0 -} - -func (m *CMsgGCStorePurchaseInit) GetCurrency() int32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -func (m *CMsgGCStorePurchaseInit) GetLineItems() []*CGCStorePurchaseInit_LineItem { - if m != nil { - return m.LineItems - } - return nil -} - -type CMsgGCStorePurchaseInitResponse struct { - Result *int32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - TxnId *uint64 `protobuf:"varint,2,opt,name=txn_id" json:"txn_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseInitResponse) Reset() { *m = CMsgGCStorePurchaseInitResponse{} } -func (m *CMsgGCStorePurchaseInitResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseInitResponse) ProtoMessage() {} -func (*CMsgGCStorePurchaseInitResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{2} } - -func (m *CMsgGCStorePurchaseInitResponse) GetResult() int32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGCStorePurchaseInitResponse) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -type CMsgSystemBroadcast struct { - Message *string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSystemBroadcast) Reset() { *m = CMsgSystemBroadcast{} } -func (m *CMsgSystemBroadcast) String() string { return proto.CompactTextString(m) } -func (*CMsgSystemBroadcast) ProtoMessage() {} -func (*CMsgSystemBroadcast) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{3} } - -func (m *CMsgSystemBroadcast) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type CMsgClientPingData struct { - RelayCodes []uint32 `protobuf:"fixed32,4,rep,packed,name=relay_codes" json:"relay_codes,omitempty"` - RelayPings []uint32 `protobuf:"varint,5,rep,packed,name=relay_pings" json:"relay_pings,omitempty"` - RegionCodes []uint32 `protobuf:"varint,8,rep,packed,name=region_codes" json:"region_codes,omitempty"` - RegionPings []uint32 `protobuf:"varint,9,rep,packed,name=region_pings" json:"region_pings,omitempty"` - RegionPingFailedBitmask *uint32 `protobuf:"varint,10,opt,name=region_ping_failed_bitmask" json:"region_ping_failed_bitmask,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientPingData) Reset() { *m = CMsgClientPingData{} } -func (m *CMsgClientPingData) String() string { return proto.CompactTextString(m) } -func (*CMsgClientPingData) ProtoMessage() {} -func (*CMsgClientPingData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{4} } - -func (m *CMsgClientPingData) GetRelayCodes() []uint32 { - if m != nil { - return m.RelayCodes - } - return nil -} - -func (m *CMsgClientPingData) GetRelayPings() []uint32 { - if m != nil { - return m.RelayPings - } - return nil -} - -func (m *CMsgClientPingData) GetRegionCodes() []uint32 { - if m != nil { - return m.RegionCodes - } - return nil -} - -func (m *CMsgClientPingData) GetRegionPings() []uint32 { - if m != nil { - return m.RegionPings - } - return nil -} - -func (m *CMsgClientPingData) GetRegionPingFailedBitmask() uint32 { - if m != nil && m.RegionPingFailedBitmask != nil { - return *m.RegionPingFailedBitmask - } - return 0 -} - -type CMsgInviteToParty struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - TeamId *uint32 `protobuf:"varint,3,opt,name=team_id" json:"team_id,omitempty"` - AsCoach *bool `protobuf:"varint,4,opt,name=as_coach" json:"as_coach,omitempty"` - PingData *CMsgClientPingData `protobuf:"bytes,5,opt,name=ping_data" json:"ping_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgInviteToParty) Reset() { *m = CMsgInviteToParty{} } -func (m *CMsgInviteToParty) String() string { return proto.CompactTextString(m) } -func (*CMsgInviteToParty) ProtoMessage() {} -func (*CMsgInviteToParty) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{5} } - -func (m *CMsgInviteToParty) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgInviteToParty) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgInviteToParty) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgInviteToParty) GetAsCoach() bool { - if m != nil && m.AsCoach != nil { - return *m.AsCoach - } - return false -} - -func (m *CMsgInviteToParty) GetPingData() *CMsgClientPingData { - if m != nil { - return m.PingData - } - return nil -} - -type CMsgInviteToLobby struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgInviteToLobby) Reset() { *m = CMsgInviteToLobby{} } -func (m *CMsgInviteToLobby) String() string { return proto.CompactTextString(m) } -func (*CMsgInviteToLobby) ProtoMessage() {} -func (*CMsgInviteToLobby) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{6} } - -func (m *CMsgInviteToLobby) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgInviteToLobby) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -type CMsgInvitationCreated struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - UserOffline *bool `protobuf:"varint,3,opt,name=user_offline" json:"user_offline,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgInvitationCreated) Reset() { *m = CMsgInvitationCreated{} } -func (m *CMsgInvitationCreated) String() string { return proto.CompactTextString(m) } -func (*CMsgInvitationCreated) ProtoMessage() {} -func (*CMsgInvitationCreated) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{7} } - -func (m *CMsgInvitationCreated) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CMsgInvitationCreated) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgInvitationCreated) GetUserOffline() bool { - if m != nil && m.UserOffline != nil { - return *m.UserOffline - } - return false -} - -type CMsgPartyInviteResponse struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - Accept *bool `protobuf:"varint,2,opt,name=accept" json:"accept,omitempty"` - ClientVersion *uint32 `protobuf:"varint,3,opt,name=client_version" json:"client_version,omitempty"` - PingData *CMsgClientPingData `protobuf:"bytes,8,opt,name=ping_data" json:"ping_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPartyInviteResponse) Reset() { *m = CMsgPartyInviteResponse{} } -func (m *CMsgPartyInviteResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgPartyInviteResponse) ProtoMessage() {} -func (*CMsgPartyInviteResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{8} } - -func (m *CMsgPartyInviteResponse) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgPartyInviteResponse) GetAccept() bool { - if m != nil && m.Accept != nil { - return *m.Accept - } - return false -} - -func (m *CMsgPartyInviteResponse) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgPartyInviteResponse) GetPingData() *CMsgClientPingData { - if m != nil { - return m.PingData - } - return nil -} - -type CMsgLobbyInviteResponse struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - Accept *bool `protobuf:"varint,2,opt,name=accept" json:"accept,omitempty"` - ClientVersion *uint32 `protobuf:"varint,3,opt,name=client_version" json:"client_version,omitempty"` - CustomGameCrc *uint64 `protobuf:"fixed64,6,opt,name=custom_game_crc" json:"custom_game_crc,omitempty"` - CustomGameTimestamp *uint32 `protobuf:"fixed32,7,opt,name=custom_game_timestamp" json:"custom_game_timestamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLobbyInviteResponse) Reset() { *m = CMsgLobbyInviteResponse{} } -func (m *CMsgLobbyInviteResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgLobbyInviteResponse) ProtoMessage() {} -func (*CMsgLobbyInviteResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{9} } - -func (m *CMsgLobbyInviteResponse) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgLobbyInviteResponse) GetAccept() bool { - if m != nil && m.Accept != nil { - return *m.Accept - } - return false -} - -func (m *CMsgLobbyInviteResponse) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgLobbyInviteResponse) GetCustomGameCrc() uint64 { - if m != nil && m.CustomGameCrc != nil { - return *m.CustomGameCrc - } - return 0 -} - -func (m *CMsgLobbyInviteResponse) GetCustomGameTimestamp() uint32 { - if m != nil && m.CustomGameTimestamp != nil { - return *m.CustomGameTimestamp - } - return 0 -} - -type CMsgKickFromParty struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgKickFromParty) Reset() { *m = CMsgKickFromParty{} } -func (m *CMsgKickFromParty) String() string { return proto.CompactTextString(m) } -func (*CMsgKickFromParty) ProtoMessage() {} -func (*CMsgKickFromParty) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{10} } - -func (m *CMsgKickFromParty) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgLeaveParty struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeaveParty) Reset() { *m = CMsgLeaveParty{} } -func (m *CMsgLeaveParty) String() string { return proto.CompactTextString(m) } -func (*CMsgLeaveParty) ProtoMessage() {} -func (*CMsgLeaveParty) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{11} } - -type CMsgCustomGameInstallStatus struct { - Status *ECustomGameInstallStatus `protobuf:"varint,1,opt,name=status,enum=ECustomGameInstallStatus,def=0" json:"status,omitempty"` - Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - LatestTimestampFromSteam *uint32 `protobuf:"fixed32,3,opt,name=latest_timestamp_from_steam" json:"latest_timestamp_from_steam,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCustomGameInstallStatus) Reset() { *m = CMsgCustomGameInstallStatus{} } -func (m *CMsgCustomGameInstallStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgCustomGameInstallStatus) ProtoMessage() {} -func (*CMsgCustomGameInstallStatus) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{12} } - -const Default_CMsgCustomGameInstallStatus_Status ECustomGameInstallStatus = ECustomGameInstallStatus_k_ECustomGameInstallStatus_Unknown - -func (m *CMsgCustomGameInstallStatus) GetStatus() ECustomGameInstallStatus { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_CMsgCustomGameInstallStatus_Status -} - -func (m *CMsgCustomGameInstallStatus) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgCustomGameInstallStatus) GetLatestTimestampFromSteam() uint32 { - if m != nil && m.LatestTimestampFromSteam != nil { - return *m.LatestTimestampFromSteam - } - return 0 -} - -type CMsgServerAvailable struct { - CustomGameInstallStatus *CMsgCustomGameInstallStatus `protobuf:"bytes,1,opt,name=custom_game_install_status" json:"custom_game_install_status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerAvailable) Reset() { *m = CMsgServerAvailable{} } -func (m *CMsgServerAvailable) String() string { return proto.CompactTextString(m) } -func (*CMsgServerAvailable) ProtoMessage() {} -func (*CMsgServerAvailable) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{13} } - -func (m *CMsgServerAvailable) GetCustomGameInstallStatus() *CMsgCustomGameInstallStatus { - if m != nil { - return m.CustomGameInstallStatus - } - return nil -} - -type CMsgLANServerAvailable struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLANServerAvailable) Reset() { *m = CMsgLANServerAvailable{} } -func (m *CMsgLANServerAvailable) String() string { return proto.CompactTextString(m) } -func (*CMsgLANServerAvailable) ProtoMessage() {} -func (*CMsgLANServerAvailable) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{14} } - -func (m *CMsgLANServerAvailable) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -type CSOEconGameAccountClient struct { - AdditionalBackpackSlots *uint32 `protobuf:"varint,1,opt,name=additional_backpack_slots,def=0" json:"additional_backpack_slots,omitempty"` - TrialAccount *bool `protobuf:"varint,2,opt,name=trial_account,def=0" json:"trial_account,omitempty"` - EligibleForOnlinePlay *bool `protobuf:"varint,3,opt,name=eligible_for_online_play,def=1" json:"eligible_for_online_play,omitempty"` - NeedToChooseMostHelpfulFriend *bool `protobuf:"varint,4,opt,name=need_to_choose_most_helpful_friend" json:"need_to_choose_most_helpful_friend,omitempty"` - InCoachesList *bool `protobuf:"varint,5,opt,name=in_coaches_list" json:"in_coaches_list,omitempty"` - TradeBanExpiration *uint32 `protobuf:"fixed32,6,opt,name=trade_ban_expiration" json:"trade_ban_expiration,omitempty"` - DuelBanExpiration *uint32 `protobuf:"fixed32,7,opt,name=duel_ban_expiration" json:"duel_ban_expiration,omitempty"` - PreviewItemDef *uint32 `protobuf:"varint,8,opt,name=preview_item_def,def=0" json:"preview_item_def,omitempty"` - MadeFirstPurchase *bool `protobuf:"varint,9,opt,name=made_first_purchase,def=0" json:"made_first_purchase,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconGameAccountClient) Reset() { *m = CSOEconGameAccountClient{} } -func (m *CSOEconGameAccountClient) String() string { return proto.CompactTextString(m) } -func (*CSOEconGameAccountClient) ProtoMessage() {} -func (*CSOEconGameAccountClient) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{15} } - -const Default_CSOEconGameAccountClient_AdditionalBackpackSlots uint32 = 0 -const Default_CSOEconGameAccountClient_TrialAccount bool = false -const Default_CSOEconGameAccountClient_EligibleForOnlinePlay bool = true -const Default_CSOEconGameAccountClient_PreviewItemDef uint32 = 0 -const Default_CSOEconGameAccountClient_MadeFirstPurchase bool = false - -func (m *CSOEconGameAccountClient) GetAdditionalBackpackSlots() uint32 { - if m != nil && m.AdditionalBackpackSlots != nil { - return *m.AdditionalBackpackSlots - } - return Default_CSOEconGameAccountClient_AdditionalBackpackSlots -} - -func (m *CSOEconGameAccountClient) GetTrialAccount() bool { - if m != nil && m.TrialAccount != nil { - return *m.TrialAccount - } - return Default_CSOEconGameAccountClient_TrialAccount -} - -func (m *CSOEconGameAccountClient) GetEligibleForOnlinePlay() bool { - if m != nil && m.EligibleForOnlinePlay != nil { - return *m.EligibleForOnlinePlay - } - return Default_CSOEconGameAccountClient_EligibleForOnlinePlay -} - -func (m *CSOEconGameAccountClient) GetNeedToChooseMostHelpfulFriend() bool { - if m != nil && m.NeedToChooseMostHelpfulFriend != nil { - return *m.NeedToChooseMostHelpfulFriend - } - return false -} - -func (m *CSOEconGameAccountClient) GetInCoachesList() bool { - if m != nil && m.InCoachesList != nil { - return *m.InCoachesList - } - return false -} - -func (m *CSOEconGameAccountClient) GetTradeBanExpiration() uint32 { - if m != nil && m.TradeBanExpiration != nil { - return *m.TradeBanExpiration - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetDuelBanExpiration() uint32 { - if m != nil && m.DuelBanExpiration != nil { - return *m.DuelBanExpiration - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetPreviewItemDef() uint32 { - if m != nil && m.PreviewItemDef != nil { - return *m.PreviewItemDef - } - return Default_CSOEconGameAccountClient_PreviewItemDef -} - -func (m *CSOEconGameAccountClient) GetMadeFirstPurchase() bool { - if m != nil && m.MadeFirstPurchase != nil { - return *m.MadeFirstPurchase - } - return Default_CSOEconGameAccountClient_MadeFirstPurchase -} - -type CSOItemCriteriaCondition struct { - Op *int32 `protobuf:"varint,1,opt,name=op" json:"op,omitempty"` - Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` - Required *bool `protobuf:"varint,3,opt,name=required" json:"required,omitempty"` - FloatValue *float32 `protobuf:"fixed32,4,opt,name=float_value" json:"float_value,omitempty"` - StringValue *string `protobuf:"bytes,5,opt,name=string_value" json:"string_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOItemCriteriaCondition) Reset() { *m = CSOItemCriteriaCondition{} } -func (m *CSOItemCriteriaCondition) String() string { return proto.CompactTextString(m) } -func (*CSOItemCriteriaCondition) ProtoMessage() {} -func (*CSOItemCriteriaCondition) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{16} } - -func (m *CSOItemCriteriaCondition) GetOp() int32 { - if m != nil && m.Op != nil { - return *m.Op - } - return 0 -} - -func (m *CSOItemCriteriaCondition) GetField() string { - if m != nil && m.Field != nil { - return *m.Field - } - return "" -} - -func (m *CSOItemCriteriaCondition) GetRequired() bool { - if m != nil && m.Required != nil { - return *m.Required - } - return false -} - -func (m *CSOItemCriteriaCondition) GetFloatValue() float32 { - if m != nil && m.FloatValue != nil { - return *m.FloatValue - } - return 0 -} - -func (m *CSOItemCriteriaCondition) GetStringValue() string { - if m != nil && m.StringValue != nil { - return *m.StringValue - } - return "" -} - -type CSOItemCriteria struct { - ItemLevel *uint32 `protobuf:"varint,1,opt,name=item_level" json:"item_level,omitempty"` - ItemQuality *int32 `protobuf:"varint,2,opt,name=item_quality" json:"item_quality,omitempty"` - ItemLevelSet *bool `protobuf:"varint,3,opt,name=item_level_set" json:"item_level_set,omitempty"` - ItemQualitySet *bool `protobuf:"varint,4,opt,name=item_quality_set" json:"item_quality_set,omitempty"` - InitialInventory *uint32 `protobuf:"varint,5,opt,name=initial_inventory" json:"initial_inventory,omitempty"` - InitialQuantity *uint32 `protobuf:"varint,6,opt,name=initial_quantity" json:"initial_quantity,omitempty"` - IgnoreEnabledFlag *bool `protobuf:"varint,8,opt,name=ignore_enabled_flag" json:"ignore_enabled_flag,omitempty"` - Conditions []*CSOItemCriteriaCondition `protobuf:"bytes,9,rep,name=conditions" json:"conditions,omitempty"` - RecentOnly *bool `protobuf:"varint,10,opt,name=recent_only" json:"recent_only,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOItemCriteria) Reset() { *m = CSOItemCriteria{} } -func (m *CSOItemCriteria) String() string { return proto.CompactTextString(m) } -func (*CSOItemCriteria) ProtoMessage() {} -func (*CSOItemCriteria) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{17} } - -func (m *CSOItemCriteria) GetItemLevel() uint32 { - if m != nil && m.ItemLevel != nil { - return *m.ItemLevel - } - return 0 -} - -func (m *CSOItemCriteria) GetItemQuality() int32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CSOItemCriteria) GetItemLevelSet() bool { - if m != nil && m.ItemLevelSet != nil { - return *m.ItemLevelSet - } - return false -} - -func (m *CSOItemCriteria) GetItemQualitySet() bool { - if m != nil && m.ItemQualitySet != nil { - return *m.ItemQualitySet - } - return false -} - -func (m *CSOItemCriteria) GetInitialInventory() uint32 { - if m != nil && m.InitialInventory != nil { - return *m.InitialInventory - } - return 0 -} - -func (m *CSOItemCriteria) GetInitialQuantity() uint32 { - if m != nil && m.InitialQuantity != nil { - return *m.InitialQuantity - } - return 0 -} - -func (m *CSOItemCriteria) GetIgnoreEnabledFlag() bool { - if m != nil && m.IgnoreEnabledFlag != nil { - return *m.IgnoreEnabledFlag - } - return false -} - -func (m *CSOItemCriteria) GetConditions() []*CSOItemCriteriaCondition { - if m != nil { - return m.Conditions - } - return nil -} - -func (m *CSOItemCriteria) GetRecentOnly() bool { - if m != nil && m.RecentOnly != nil { - return *m.RecentOnly - } - return false -} - -type CSOItemRecipe struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - NA *string `protobuf:"bytes,3,opt,name=n_a" json:"n_a,omitempty"` - DescInputs *string `protobuf:"bytes,4,opt,name=desc_inputs" json:"desc_inputs,omitempty"` - DescOutputs *string `protobuf:"bytes,5,opt,name=desc_outputs" json:"desc_outputs,omitempty"` - DiA *string `protobuf:"bytes,6,opt,name=di_a" json:"di_a,omitempty"` - DiB *string `protobuf:"bytes,7,opt,name=di_b" json:"di_b,omitempty"` - DiC *string `protobuf:"bytes,8,opt,name=di_c" json:"di_c,omitempty"` - DoA *string `protobuf:"bytes,9,opt,name=do_a" json:"do_a,omitempty"` - DoB *string `protobuf:"bytes,10,opt,name=do_b" json:"do_b,omitempty"` - DoC *string `protobuf:"bytes,11,opt,name=do_c" json:"do_c,omitempty"` - RequiresAllSameClass *bool `protobuf:"varint,12,opt,name=requires_all_same_class" json:"requires_all_same_class,omitempty"` - RequiresAllSameSlot *bool `protobuf:"varint,13,opt,name=requires_all_same_slot" json:"requires_all_same_slot,omitempty"` - ClassUsageForOutput *int32 `protobuf:"varint,14,opt,name=class_usage_for_output" json:"class_usage_for_output,omitempty"` - SlotUsageForOutput *int32 `protobuf:"varint,15,opt,name=slot_usage_for_output" json:"slot_usage_for_output,omitempty"` - SetForOutput *int32 `protobuf:"varint,16,opt,name=set_for_output" json:"set_for_output,omitempty"` - InputItemsCriteria []*CSOItemCriteria `protobuf:"bytes,20,rep,name=input_items_criteria" json:"input_items_criteria,omitempty"` - OutputItemsCriteria []*CSOItemCriteria `protobuf:"bytes,21,rep,name=output_items_criteria" json:"output_items_criteria,omitempty"` - InputItemDupeCounts []uint32 `protobuf:"varint,22,rep,name=input_item_dupe_counts" json:"input_item_dupe_counts,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOItemRecipe) Reset() { *m = CSOItemRecipe{} } -func (m *CSOItemRecipe) String() string { return proto.CompactTextString(m) } -func (*CSOItemRecipe) ProtoMessage() {} -func (*CSOItemRecipe) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{18} } - -func (m *CSOItemRecipe) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOItemRecipe) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CSOItemRecipe) GetNA() string { - if m != nil && m.NA != nil { - return *m.NA - } - return "" -} - -func (m *CSOItemRecipe) GetDescInputs() string { - if m != nil && m.DescInputs != nil { - return *m.DescInputs - } - return "" -} - -func (m *CSOItemRecipe) GetDescOutputs() string { - if m != nil && m.DescOutputs != nil { - return *m.DescOutputs - } - return "" -} - -func (m *CSOItemRecipe) GetDiA() string { - if m != nil && m.DiA != nil { - return *m.DiA - } - return "" -} - -func (m *CSOItemRecipe) GetDiB() string { - if m != nil && m.DiB != nil { - return *m.DiB - } - return "" -} - -func (m *CSOItemRecipe) GetDiC() string { - if m != nil && m.DiC != nil { - return *m.DiC - } - return "" -} - -func (m *CSOItemRecipe) GetDoA() string { - if m != nil && m.DoA != nil { - return *m.DoA - } - return "" -} - -func (m *CSOItemRecipe) GetDoB() string { - if m != nil && m.DoB != nil { - return *m.DoB - } - return "" -} - -func (m *CSOItemRecipe) GetDoC() string { - if m != nil && m.DoC != nil { - return *m.DoC - } - return "" -} - -func (m *CSOItemRecipe) GetRequiresAllSameClass() bool { - if m != nil && m.RequiresAllSameClass != nil { - return *m.RequiresAllSameClass - } - return false -} - -func (m *CSOItemRecipe) GetRequiresAllSameSlot() bool { - if m != nil && m.RequiresAllSameSlot != nil { - return *m.RequiresAllSameSlot - } - return false -} - -func (m *CSOItemRecipe) GetClassUsageForOutput() int32 { - if m != nil && m.ClassUsageForOutput != nil { - return *m.ClassUsageForOutput - } - return 0 -} - -func (m *CSOItemRecipe) GetSlotUsageForOutput() int32 { - if m != nil && m.SlotUsageForOutput != nil { - return *m.SlotUsageForOutput - } - return 0 -} - -func (m *CSOItemRecipe) GetSetForOutput() int32 { - if m != nil && m.SetForOutput != nil { - return *m.SetForOutput - } - return 0 -} - -func (m *CSOItemRecipe) GetInputItemsCriteria() []*CSOItemCriteria { - if m != nil { - return m.InputItemsCriteria - } - return nil -} - -func (m *CSOItemRecipe) GetOutputItemsCriteria() []*CSOItemCriteria { - if m != nil { - return m.OutputItemsCriteria - } - return nil -} - -func (m *CSOItemRecipe) GetInputItemDupeCounts() []uint32 { - if m != nil { - return m.InputItemDupeCounts - } - return nil -} - -type CMsgApplyStrangePart struct { - StrangePartItemId *uint64 `protobuf:"varint,1,opt,name=strange_part_item_id" json:"strange_part_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyStrangePart) Reset() { *m = CMsgApplyStrangePart{} } -func (m *CMsgApplyStrangePart) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyStrangePart) ProtoMessage() {} -func (*CMsgApplyStrangePart) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{19} } - -func (m *CMsgApplyStrangePart) GetStrangePartItemId() uint64 { - if m != nil && m.StrangePartItemId != nil { - return *m.StrangePartItemId - } - return 0 -} - -func (m *CMsgApplyStrangePart) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -type CMsgApplyPennantUpgrade struct { - UpgradeItemId *uint64 `protobuf:"varint,1,opt,name=upgrade_item_id" json:"upgrade_item_id,omitempty"` - PennantItemId *uint64 `protobuf:"varint,2,opt,name=pennant_item_id" json:"pennant_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyPennantUpgrade) Reset() { *m = CMsgApplyPennantUpgrade{} } -func (m *CMsgApplyPennantUpgrade) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyPennantUpgrade) ProtoMessage() {} -func (*CMsgApplyPennantUpgrade) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{20} } - -func (m *CMsgApplyPennantUpgrade) GetUpgradeItemId() uint64 { - if m != nil && m.UpgradeItemId != nil { - return *m.UpgradeItemId - } - return 0 -} - -func (m *CMsgApplyPennantUpgrade) GetPennantItemId() uint64 { - if m != nil && m.PennantItemId != nil { - return *m.PennantItemId - } - return 0 -} - -type CMsgApplyEggEssence struct { - EssenceItemId *uint64 `protobuf:"varint,1,opt,name=essence_item_id" json:"essence_item_id,omitempty"` - EggItemId *uint64 `protobuf:"varint,2,opt,name=egg_item_id" json:"egg_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyEggEssence) Reset() { *m = CMsgApplyEggEssence{} } -func (m *CMsgApplyEggEssence) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyEggEssence) ProtoMessage() {} -func (*CMsgApplyEggEssence) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{21} } - -func (m *CMsgApplyEggEssence) GetEssenceItemId() uint64 { - if m != nil && m.EssenceItemId != nil { - return *m.EssenceItemId - } - return 0 -} - -func (m *CMsgApplyEggEssence) GetEggItemId() uint64 { - if m != nil && m.EggItemId != nil { - return *m.EggItemId - } - return 0 -} - -type CSOEconItemAttribute struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Value *uint32 `protobuf:"varint,2,opt,name=value" json:"value,omitempty"` - ValueBytes []byte `protobuf:"bytes,3,opt,name=value_bytes" json:"value_bytes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemAttribute) Reset() { *m = CSOEconItemAttribute{} } -func (m *CSOEconItemAttribute) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemAttribute) ProtoMessage() {} -func (*CSOEconItemAttribute) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{22} } - -func (m *CSOEconItemAttribute) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOEconItemAttribute) GetValue() uint32 { - if m != nil && m.Value != nil { - return *m.Value - } - return 0 -} - -func (m *CSOEconItemAttribute) GetValueBytes() []byte { - if m != nil { - return m.ValueBytes - } - return nil -} - -type CSOEconItemEquipped struct { - NewClass *uint32 `protobuf:"varint,1,opt,name=new_class" json:"new_class,omitempty"` - NewSlot *uint32 `protobuf:"varint,2,opt,name=new_slot" json:"new_slot,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemEquipped) Reset() { *m = CSOEconItemEquipped{} } -func (m *CSOEconItemEquipped) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemEquipped) ProtoMessage() {} -func (*CSOEconItemEquipped) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{23} } - -func (m *CSOEconItemEquipped) GetNewClass() uint32 { - if m != nil && m.NewClass != nil { - return *m.NewClass - } - return 0 -} - -func (m *CSOEconItemEquipped) GetNewSlot() uint32 { - if m != nil && m.NewSlot != nil { - return *m.NewSlot - } - return 0 -} - -type CSOEconItem struct { - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - AccountId *uint32 `protobuf:"varint,2,opt,name=account_id" json:"account_id,omitempty"` - Inventory *uint32 `protobuf:"varint,3,opt,name=inventory" json:"inventory,omitempty"` - DefIndex *uint32 `protobuf:"varint,4,opt,name=def_index" json:"def_index,omitempty"` - Quantity *uint32 `protobuf:"varint,5,opt,name=quantity,def=1" json:"quantity,omitempty"` - Level *uint32 `protobuf:"varint,6,opt,name=level,def=1" json:"level,omitempty"` - Quality *uint32 `protobuf:"varint,7,opt,name=quality,def=4" json:"quality,omitempty"` - Flags *uint32 `protobuf:"varint,8,opt,name=flags,def=0" json:"flags,omitempty"` - Origin *uint32 `protobuf:"varint,9,opt,name=origin,def=0" json:"origin,omitempty"` - Attribute []*CSOEconItemAttribute `protobuf:"bytes,12,rep,name=attribute" json:"attribute,omitempty"` - InteriorItem *CSOEconItem `protobuf:"bytes,13,opt,name=interior_item" json:"interior_item,omitempty"` - InUse *bool `protobuf:"varint,14,opt,name=in_use,def=0" json:"in_use,omitempty"` - Style *uint32 `protobuf:"varint,15,opt,name=style,def=0" json:"style,omitempty"` - OriginalId *uint64 `protobuf:"varint,16,opt,name=original_id,def=0" json:"original_id,omitempty"` - EquippedState []*CSOEconItemEquipped `protobuf:"bytes,18,rep,name=equipped_state" json:"equipped_state,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItem) Reset() { *m = CSOEconItem{} } -func (m *CSOEconItem) String() string { return proto.CompactTextString(m) } -func (*CSOEconItem) ProtoMessage() {} -func (*CSOEconItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{24} } - -const Default_CSOEconItem_Quantity uint32 = 1 -const Default_CSOEconItem_Level uint32 = 1 -const Default_CSOEconItem_Quality uint32 = 4 -const Default_CSOEconItem_Flags uint32 = 0 -const Default_CSOEconItem_Origin uint32 = 0 -const Default_CSOEconItem_InUse bool = false -const Default_CSOEconItem_Style uint32 = 0 -const Default_CSOEconItem_OriginalId uint64 = 0 - -func (m *CSOEconItem) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CSOEconItem) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconItem) GetInventory() uint32 { - if m != nil && m.Inventory != nil { - return *m.Inventory - } - return 0 -} - -func (m *CSOEconItem) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOEconItem) GetQuantity() uint32 { - if m != nil && m.Quantity != nil { - return *m.Quantity - } - return Default_CSOEconItem_Quantity -} - -func (m *CSOEconItem) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return Default_CSOEconItem_Level -} - -func (m *CSOEconItem) GetQuality() uint32 { - if m != nil && m.Quality != nil { - return *m.Quality - } - return Default_CSOEconItem_Quality -} - -func (m *CSOEconItem) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return Default_CSOEconItem_Flags -} - -func (m *CSOEconItem) GetOrigin() uint32 { - if m != nil && m.Origin != nil { - return *m.Origin - } - return Default_CSOEconItem_Origin -} - -func (m *CSOEconItem) GetAttribute() []*CSOEconItemAttribute { - if m != nil { - return m.Attribute - } - return nil -} - -func (m *CSOEconItem) GetInteriorItem() *CSOEconItem { - if m != nil { - return m.InteriorItem - } - return nil -} - -func (m *CSOEconItem) GetInUse() bool { - if m != nil && m.InUse != nil { - return *m.InUse - } - return Default_CSOEconItem_InUse -} - -func (m *CSOEconItem) GetStyle() uint32 { - if m != nil && m.Style != nil { - return *m.Style - } - return Default_CSOEconItem_Style -} - -func (m *CSOEconItem) GetOriginalId() uint64 { - if m != nil && m.OriginalId != nil { - return *m.OriginalId - } - return Default_CSOEconItem_OriginalId -} - -func (m *CSOEconItem) GetEquippedState() []*CSOEconItemEquipped { - if m != nil { - return m.EquippedState - } - return nil -} - -type CMsgSortItems struct { - SortType *uint32 `protobuf:"varint,1,opt,name=sort_type" json:"sort_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSortItems) Reset() { *m = CMsgSortItems{} } -func (m *CMsgSortItems) String() string { return proto.CompactTextString(m) } -func (*CMsgSortItems) ProtoMessage() {} -func (*CMsgSortItems) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{25} } - -func (m *CMsgSortItems) GetSortType() uint32 { - if m != nil && m.SortType != nil { - return *m.SortType - } - return 0 -} - -type CSOEconClaimCode struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - CodeType *uint32 `protobuf:"varint,2,opt,name=code_type" json:"code_type,omitempty"` - TimeAcquired *uint32 `protobuf:"varint,3,opt,name=time_acquired" json:"time_acquired,omitempty"` - Code *string `protobuf:"bytes,4,opt,name=code" json:"code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconClaimCode) Reset() { *m = CSOEconClaimCode{} } -func (m *CSOEconClaimCode) String() string { return proto.CompactTextString(m) } -func (*CSOEconClaimCode) ProtoMessage() {} -func (*CSOEconClaimCode) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{26} } - -func (m *CSOEconClaimCode) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconClaimCode) GetCodeType() uint32 { - if m != nil && m.CodeType != nil { - return *m.CodeType - } - return 0 -} - -func (m *CSOEconClaimCode) GetTimeAcquired() uint32 { - if m != nil && m.TimeAcquired != nil { - return *m.TimeAcquired - } - return 0 -} - -func (m *CSOEconClaimCode) GetCode() string { - if m != nil && m.Code != nil { - return *m.Code - } - return "" -} - -type CMsgStoreGetUserData struct { - PriceSheetVersion *uint32 `protobuf:"fixed32,1,opt,name=price_sheet_version" json:"price_sheet_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgStoreGetUserData) Reset() { *m = CMsgStoreGetUserData{} } -func (m *CMsgStoreGetUserData) String() string { return proto.CompactTextString(m) } -func (*CMsgStoreGetUserData) ProtoMessage() {} -func (*CMsgStoreGetUserData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{27} } - -func (m *CMsgStoreGetUserData) GetPriceSheetVersion() uint32 { - if m != nil && m.PriceSheetVersion != nil { - return *m.PriceSheetVersion - } - return 0 -} - -type CMsgStoreGetUserDataResponse struct { - Result *int32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - Currency *int32 `protobuf:"varint,2,opt,name=currency" json:"currency,omitempty"` - Country *string `protobuf:"bytes,3,opt,name=country" json:"country,omitempty"` - PriceSheetVersion *uint32 `protobuf:"fixed32,4,opt,name=price_sheet_version" json:"price_sheet_version,omitempty"` - ExperimentData *uint64 `protobuf:"varint,5,opt,name=experiment_data,def=0" json:"experiment_data,omitempty"` - FeaturedItemIdx *int32 `protobuf:"varint,6,opt,name=featured_item_idx" json:"featured_item_idx,omitempty"` - ShowHatDescriptions *bool `protobuf:"varint,7,opt,name=show_hat_descriptions,def=1" json:"show_hat_descriptions,omitempty"` - PriceSheet []byte `protobuf:"bytes,8,opt,name=price_sheet" json:"price_sheet,omitempty"` - DefaultItemSort *int32 `protobuf:"varint,9,opt,name=default_item_sort,def=0" json:"default_item_sort,omitempty"` - PopularItems []uint32 `protobuf:"varint,10,rep,name=popular_items" json:"popular_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgStoreGetUserDataResponse) Reset() { *m = CMsgStoreGetUserDataResponse{} } -func (m *CMsgStoreGetUserDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgStoreGetUserDataResponse) ProtoMessage() {} -func (*CMsgStoreGetUserDataResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{28} } - -const Default_CMsgStoreGetUserDataResponse_ExperimentData uint64 = 0 -const Default_CMsgStoreGetUserDataResponse_ShowHatDescriptions bool = true -const Default_CMsgStoreGetUserDataResponse_DefaultItemSort int32 = 0 - -func (m *CMsgStoreGetUserDataResponse) GetResult() int32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetCurrency() int32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetCountry() string { - if m != nil && m.Country != nil { - return *m.Country - } - return "" -} - -func (m *CMsgStoreGetUserDataResponse) GetPriceSheetVersion() uint32 { - if m != nil && m.PriceSheetVersion != nil { - return *m.PriceSheetVersion - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetExperimentData() uint64 { - if m != nil && m.ExperimentData != nil { - return *m.ExperimentData - } - return Default_CMsgStoreGetUserDataResponse_ExperimentData -} - -func (m *CMsgStoreGetUserDataResponse) GetFeaturedItemIdx() int32 { - if m != nil && m.FeaturedItemIdx != nil { - return *m.FeaturedItemIdx - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetShowHatDescriptions() bool { - if m != nil && m.ShowHatDescriptions != nil { - return *m.ShowHatDescriptions - } - return Default_CMsgStoreGetUserDataResponse_ShowHatDescriptions -} - -func (m *CMsgStoreGetUserDataResponse) GetPriceSheet() []byte { - if m != nil { - return m.PriceSheet - } - return nil -} - -func (m *CMsgStoreGetUserDataResponse) GetDefaultItemSort() int32 { - if m != nil && m.DefaultItemSort != nil { - return *m.DefaultItemSort - } - return Default_CMsgStoreGetUserDataResponse_DefaultItemSort -} - -func (m *CMsgStoreGetUserDataResponse) GetPopularItems() []uint32 { - if m != nil { - return m.PopularItems - } - return nil -} - -type CMsgUpdateItemSchema struct { - ItemsGame []byte `protobuf:"bytes,1,opt,name=items_game" json:"items_game,omitempty"` - ItemSchemaVersion *uint32 `protobuf:"fixed32,2,opt,name=item_schema_version" json:"item_schema_version,omitempty"` - ItemsGameUrl *string `protobuf:"bytes,3,opt,name=items_game_url" json:"items_game_url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpdateItemSchema) Reset() { *m = CMsgUpdateItemSchema{} } -func (m *CMsgUpdateItemSchema) String() string { return proto.CompactTextString(m) } -func (*CMsgUpdateItemSchema) ProtoMessage() {} -func (*CMsgUpdateItemSchema) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{29} } - -func (m *CMsgUpdateItemSchema) GetItemsGame() []byte { - if m != nil { - return m.ItemsGame - } - return nil -} - -func (m *CMsgUpdateItemSchema) GetItemSchemaVersion() uint32 { - if m != nil && m.ItemSchemaVersion != nil { - return *m.ItemSchemaVersion - } - return 0 -} - -func (m *CMsgUpdateItemSchema) GetItemsGameUrl() string { - if m != nil && m.ItemsGameUrl != nil { - return *m.ItemsGameUrl - } - return "" -} - -type CMsgGCError struct { - ErrorText *string `protobuf:"bytes,1,opt,name=error_text" json:"error_text,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCError) Reset() { *m = CMsgGCError{} } -func (m *CMsgGCError) String() string { return proto.CompactTextString(m) } -func (*CMsgGCError) ProtoMessage() {} -func (*CMsgGCError) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{30} } - -func (m *CMsgGCError) GetErrorText() string { - if m != nil && m.ErrorText != nil { - return *m.ErrorText - } - return "" -} - -type CMsgRequestInventoryRefresh struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestInventoryRefresh) Reset() { *m = CMsgRequestInventoryRefresh{} } -func (m *CMsgRequestInventoryRefresh) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestInventoryRefresh) ProtoMessage() {} -func (*CMsgRequestInventoryRefresh) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{31} } - -type CMsgConVarValue struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgConVarValue) Reset() { *m = CMsgConVarValue{} } -func (m *CMsgConVarValue) String() string { return proto.CompactTextString(m) } -func (*CMsgConVarValue) ProtoMessage() {} -func (*CMsgConVarValue) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{32} } - -func (m *CMsgConVarValue) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgConVarValue) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CMsgReplicateConVars struct { - Convars []*CMsgConVarValue `protobuf:"bytes,1,rep,name=convars" json:"convars,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReplicateConVars) Reset() { *m = CMsgReplicateConVars{} } -func (m *CMsgReplicateConVars) String() string { return proto.CompactTextString(m) } -func (*CMsgReplicateConVars) ProtoMessage() {} -func (*CMsgReplicateConVars) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{33} } - -func (m *CMsgReplicateConVars) GetConvars() []*CMsgConVarValue { - if m != nil { - return m.Convars - } - return nil -} - -type CMsgReplayUploadedToYouTube struct { - YoutubeUrl *string `protobuf:"bytes,1,opt,name=youtube_url" json:"youtube_url,omitempty"` - YoutubeAccountName *string `protobuf:"bytes,2,opt,name=youtube_account_name" json:"youtube_account_name,omitempty"` - SessionId *uint64 `protobuf:"varint,3,opt,name=session_id" json:"session_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReplayUploadedToYouTube) Reset() { *m = CMsgReplayUploadedToYouTube{} } -func (m *CMsgReplayUploadedToYouTube) String() string { return proto.CompactTextString(m) } -func (*CMsgReplayUploadedToYouTube) ProtoMessage() {} -func (*CMsgReplayUploadedToYouTube) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{34} } - -func (m *CMsgReplayUploadedToYouTube) GetYoutubeUrl() string { - if m != nil && m.YoutubeUrl != nil { - return *m.YoutubeUrl - } - return "" -} - -func (m *CMsgReplayUploadedToYouTube) GetYoutubeAccountName() string { - if m != nil && m.YoutubeAccountName != nil { - return *m.YoutubeAccountName - } - return "" -} - -func (m *CMsgReplayUploadedToYouTube) GetSessionId() uint64 { - if m != nil && m.SessionId != nil { - return *m.SessionId - } - return 0 -} - -type CMsgConsumableExhausted struct { - ItemDefId *int32 `protobuf:"varint,1,opt,name=item_def_id" json:"item_def_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgConsumableExhausted) Reset() { *m = CMsgConsumableExhausted{} } -func (m *CMsgConsumableExhausted) String() string { return proto.CompactTextString(m) } -func (*CMsgConsumableExhausted) ProtoMessage() {} -func (*CMsgConsumableExhausted) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{35} } - -func (m *CMsgConsumableExhausted) GetItemDefId() int32 { - if m != nil && m.ItemDefId != nil { - return *m.ItemDefId - } - return 0 -} - -type CMsgItemAcknowledged struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Inventory *uint32 `protobuf:"varint,2,opt,name=inventory" json:"inventory,omitempty"` - DefIndex *uint32 `protobuf:"varint,3,opt,name=def_index" json:"def_index,omitempty"` - Quality *uint32 `protobuf:"varint,4,opt,name=quality" json:"quality,omitempty"` - Rarity *uint32 `protobuf:"varint,5,opt,name=rarity" json:"rarity,omitempty"` - Origin *uint32 `protobuf:"varint,6,opt,name=origin" json:"origin,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgItemAcknowledged) Reset() { *m = CMsgItemAcknowledged{} } -func (m *CMsgItemAcknowledged) String() string { return proto.CompactTextString(m) } -func (*CMsgItemAcknowledged) ProtoMessage() {} -func (*CMsgItemAcknowledged) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{36} } - -func (m *CMsgItemAcknowledged) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetInventory() uint32 { - if m != nil && m.Inventory != nil { - return *m.Inventory - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetQuality() uint32 { - if m != nil && m.Quality != nil { - return *m.Quality - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetRarity() uint32 { - if m != nil && m.Rarity != nil { - return *m.Rarity - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetOrigin() uint32 { - if m != nil && m.Origin != nil { - return *m.Origin - } - return 0 -} - -type CMsgSetPresetItemPosition struct { - ClassId *uint32 `protobuf:"varint,1,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,2,opt,name=preset_id" json:"preset_id,omitempty"` - SlotId *uint32 `protobuf:"varint,3,opt,name=slot_id" json:"slot_id,omitempty"` - ItemId *uint64 `protobuf:"varint,4,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetPresetItemPosition) Reset() { *m = CMsgSetPresetItemPosition{} } -func (m *CMsgSetPresetItemPosition) String() string { return proto.CompactTextString(m) } -func (*CMsgSetPresetItemPosition) ProtoMessage() {} -func (*CMsgSetPresetItemPosition) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{37} } - -func (m *CMsgSetPresetItemPosition) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CMsgSetPresetItemPosition) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -func (m *CMsgSetPresetItemPosition) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CMsgSetPresetItemPosition) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgSetItemPositions struct { - ItemPositions []*CMsgSetItemPositions_ItemPosition `protobuf:"bytes,1,rep,name=item_positions" json:"item_positions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetItemPositions) Reset() { *m = CMsgSetItemPositions{} } -func (m *CMsgSetItemPositions) String() string { return proto.CompactTextString(m) } -func (*CMsgSetItemPositions) ProtoMessage() {} -func (*CMsgSetItemPositions) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{38} } - -func (m *CMsgSetItemPositions) GetItemPositions() []*CMsgSetItemPositions_ItemPosition { - if m != nil { - return m.ItemPositions - } - return nil -} - -type CMsgSetItemPositions_ItemPosition struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - Position *uint32 `protobuf:"varint,2,opt,name=position" json:"position,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetItemPositions_ItemPosition) Reset() { *m = CMsgSetItemPositions_ItemPosition{} } -func (m *CMsgSetItemPositions_ItemPosition) String() string { return proto.CompactTextString(m) } -func (*CMsgSetItemPositions_ItemPosition) ProtoMessage() {} -func (*CMsgSetItemPositions_ItemPosition) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{38, 0} -} - -func (m *CMsgSetItemPositions_ItemPosition) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgSetItemPositions_ItemPosition) GetPosition() uint32 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -type CSOEconItemPresetInstance struct { - ClassId *uint32 `protobuf:"varint,2,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,3,opt,name=preset_id" json:"preset_id,omitempty"` - SlotId *uint32 `protobuf:"varint,4,opt,name=slot_id" json:"slot_id,omitempty"` - ItemId *uint64 `protobuf:"varint,5,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemPresetInstance) Reset() { *m = CSOEconItemPresetInstance{} } -func (m *CSOEconItemPresetInstance) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemPresetInstance) ProtoMessage() {} -func (*CSOEconItemPresetInstance) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{39} } - -func (m *CSOEconItemPresetInstance) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CSOEconItemPresetInstance) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -func (m *CSOEconItemPresetInstance) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CSOEconItemPresetInstance) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgSelectItemPresetForClass struct { - ClassId *uint32 `protobuf:"varint,1,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,2,opt,name=preset_id" json:"preset_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSelectItemPresetForClass) Reset() { *m = CMsgSelectItemPresetForClass{} } -func (m *CMsgSelectItemPresetForClass) String() string { return proto.CompactTextString(m) } -func (*CMsgSelectItemPresetForClass) ProtoMessage() {} -func (*CMsgSelectItemPresetForClass) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{40} } - -func (m *CMsgSelectItemPresetForClass) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CMsgSelectItemPresetForClass) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -type CMsgSelectItemPresetForClassReply struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSelectItemPresetForClassReply) Reset() { *m = CMsgSelectItemPresetForClassReply{} } -func (m *CMsgSelectItemPresetForClassReply) String() string { return proto.CompactTextString(m) } -func (*CMsgSelectItemPresetForClassReply) ProtoMessage() {} -func (*CMsgSelectItemPresetForClassReply) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{41} -} - -func (m *CMsgSelectItemPresetForClassReply) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CSOSelectedItemPreset struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ClassId *uint32 `protobuf:"varint,2,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,3,opt,name=preset_id" json:"preset_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOSelectedItemPreset) Reset() { *m = CSOSelectedItemPreset{} } -func (m *CSOSelectedItemPreset) String() string { return proto.CompactTextString(m) } -func (*CSOSelectedItemPreset) ProtoMessage() {} -func (*CSOSelectedItemPreset) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{42} } - -func (m *CSOSelectedItemPreset) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOSelectedItemPreset) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CSOSelectedItemPreset) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -type CMsgGCNameItemNotification struct { - PlayerSteamid *uint64 `protobuf:"fixed64,1,opt,name=player_steamid" json:"player_steamid,omitempty"` - ItemDefIndex *uint32 `protobuf:"varint,2,opt,name=item_def_index" json:"item_def_index,omitempty"` - ItemNameCustom *string `protobuf:"bytes,3,opt,name=item_name_custom" json:"item_name_custom,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCNameItemNotification) Reset() { *m = CMsgGCNameItemNotification{} } -func (m *CMsgGCNameItemNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCNameItemNotification) ProtoMessage() {} -func (*CMsgGCNameItemNotification) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{43} } - -func (m *CMsgGCNameItemNotification) GetPlayerSteamid() uint64 { - if m != nil && m.PlayerSteamid != nil { - return *m.PlayerSteamid - } - return 0 -} - -func (m *CMsgGCNameItemNotification) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCNameItemNotification) GetItemNameCustom() string { - if m != nil && m.ItemNameCustom != nil { - return *m.ItemNameCustom - } - return "" -} - -type CMsgGCClientDisplayNotification struct { - NotificationTitleLocalizationKey *string `protobuf:"bytes,1,opt,name=notification_title_localization_key" json:"notification_title_localization_key,omitempty"` - NotificationBodyLocalizationKey *string `protobuf:"bytes,2,opt,name=notification_body_localization_key" json:"notification_body_localization_key,omitempty"` - BodySubstringKeys []string `protobuf:"bytes,3,rep,name=body_substring_keys" json:"body_substring_keys,omitempty"` - BodySubstringValues []string `protobuf:"bytes,4,rep,name=body_substring_values" json:"body_substring_values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientDisplayNotification) Reset() { *m = CMsgGCClientDisplayNotification{} } -func (m *CMsgGCClientDisplayNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientDisplayNotification) ProtoMessage() {} -func (*CMsgGCClientDisplayNotification) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{44} -} - -func (m *CMsgGCClientDisplayNotification) GetNotificationTitleLocalizationKey() string { - if m != nil && m.NotificationTitleLocalizationKey != nil { - return *m.NotificationTitleLocalizationKey - } - return "" -} - -func (m *CMsgGCClientDisplayNotification) GetNotificationBodyLocalizationKey() string { - if m != nil && m.NotificationBodyLocalizationKey != nil { - return *m.NotificationBodyLocalizationKey - } - return "" -} - -func (m *CMsgGCClientDisplayNotification) GetBodySubstringKeys() []string { - if m != nil { - return m.BodySubstringKeys - } - return nil -} - -func (m *CMsgGCClientDisplayNotification) GetBodySubstringValues() []string { - if m != nil { - return m.BodySubstringValues - } - return nil -} - -type CMsgGCShowItemsPickedUp struct { - PlayerSteamid *uint64 `protobuf:"fixed64,1,opt,name=player_steamid" json:"player_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCShowItemsPickedUp) Reset() { *m = CMsgGCShowItemsPickedUp{} } -func (m *CMsgGCShowItemsPickedUp) String() string { return proto.CompactTextString(m) } -func (*CMsgGCShowItemsPickedUp) ProtoMessage() {} -func (*CMsgGCShowItemsPickedUp) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{45} } - -func (m *CMsgGCShowItemsPickedUp) GetPlayerSteamid() uint64 { - if m != nil && m.PlayerSteamid != nil { - return *m.PlayerSteamid - } - return 0 -} - -type CMsgGCIncrementKillCountResponse struct { - KillerAccountId *uint32 `protobuf:"varint,1,opt,name=killer_account_id" json:"killer_account_id,omitempty"` - NumKills *uint32 `protobuf:"varint,2,opt,name=num_kills" json:"num_kills,omitempty"` - ItemDef *uint32 `protobuf:"varint,3,opt,name=item_def" json:"item_def,omitempty"` - LevelType *uint32 `protobuf:"varint,4,opt,name=level_type" json:"level_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCIncrementKillCountResponse) Reset() { *m = CMsgGCIncrementKillCountResponse{} } -func (m *CMsgGCIncrementKillCountResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCIncrementKillCountResponse) ProtoMessage() {} -func (*CMsgGCIncrementKillCountResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{46} -} - -func (m *CMsgGCIncrementKillCountResponse) GetKillerAccountId() uint32 { - if m != nil && m.KillerAccountId != nil { - return *m.KillerAccountId - } - return 0 -} - -func (m *CMsgGCIncrementKillCountResponse) GetNumKills() uint32 { - if m != nil && m.NumKills != nil { - return *m.NumKills - } - return 0 -} - -func (m *CMsgGCIncrementKillCountResponse) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgGCIncrementKillCountResponse) GetLevelType() uint32 { - if m != nil && m.LevelType != nil { - return *m.LevelType - } - return 0 -} - -type CSOEconItemDropRateBonus struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ExpirationDate *uint32 `protobuf:"fixed32,2,opt,name=expiration_date" json:"expiration_date,omitempty"` - Bonus *float32 `protobuf:"fixed32,3,opt,name=bonus" json:"bonus,omitempty"` - BonusCount *uint32 `protobuf:"varint,4,opt,name=bonus_count" json:"bonus_count,omitempty"` - ItemId *uint64 `protobuf:"varint,5,opt,name=item_id" json:"item_id,omitempty"` - DefIndex *uint32 `protobuf:"varint,6,opt,name=def_index" json:"def_index,omitempty"` - SecondsLeft *uint32 `protobuf:"varint,7,opt,name=seconds_left" json:"seconds_left,omitempty"` - BoosterType *uint32 `protobuf:"varint,8,opt,name=booster_type" json:"booster_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemDropRateBonus) Reset() { *m = CSOEconItemDropRateBonus{} } -func (m *CSOEconItemDropRateBonus) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemDropRateBonus) ProtoMessage() {} -func (*CSOEconItemDropRateBonus) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{47} } - -func (m *CSOEconItemDropRateBonus) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetExpirationDate() uint32 { - if m != nil && m.ExpirationDate != nil { - return *m.ExpirationDate - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetBonus() float32 { - if m != nil && m.Bonus != nil { - return *m.Bonus - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetBonusCount() uint32 { - if m != nil && m.BonusCount != nil { - return *m.BonusCount - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetSecondsLeft() uint32 { - if m != nil && m.SecondsLeft != nil { - return *m.SecondsLeft - } - return 0 -} - -func (m *CSOEconItemDropRateBonus) GetBoosterType() uint32 { - if m != nil && m.BoosterType != nil { - return *m.BoosterType - } - return 0 -} - -type CSOEconItemLeagueViewPass struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - Itemindex *uint32 `protobuf:"varint,4,opt,name=itemindex" json:"itemindex,omitempty"` - GrantReason *uint32 `protobuf:"varint,5,opt,name=grant_reason" json:"grant_reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemLeagueViewPass) Reset() { *m = CSOEconItemLeagueViewPass{} } -func (m *CSOEconItemLeagueViewPass) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemLeagueViewPass) ProtoMessage() {} -func (*CSOEconItemLeagueViewPass) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{48} } - -func (m *CSOEconItemLeagueViewPass) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconItemLeagueViewPass) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CSOEconItemLeagueViewPass) GetItemindex() uint32 { - if m != nil && m.Itemindex != nil { - return *m.Itemindex - } - return 0 -} - -func (m *CSOEconItemLeagueViewPass) GetGrantReason() uint32 { - if m != nil && m.GrantReason != nil { - return *m.GrantReason - } - return 0 -} - -type CSOEconItemEventTicket struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - EventId *uint32 `protobuf:"varint,2,opt,name=event_id" json:"event_id,omitempty"` - ItemId *uint64 `protobuf:"varint,3,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemEventTicket) Reset() { *m = CSOEconItemEventTicket{} } -func (m *CSOEconItemEventTicket) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemEventTicket) ProtoMessage() {} -func (*CSOEconItemEventTicket) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{49} } - -func (m *CSOEconItemEventTicket) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconItemEventTicket) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CSOEconItemEventTicket) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CSOEconItemTournamentPassport struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - ItemId *uint64 `protobuf:"varint,3,opt,name=item_id" json:"item_id,omitempty"` - OriginalPurchaserId *uint32 `protobuf:"varint,4,opt,name=original_purchaser_id" json:"original_purchaser_id,omitempty"` - PassportsBought *uint32 `protobuf:"varint,5,opt,name=passports_bought" json:"passports_bought,omitempty"` - Version *uint32 `protobuf:"varint,6,opt,name=version" json:"version,omitempty"` - DefIndex *uint32 `protobuf:"varint,7,opt,name=def_index" json:"def_index,omitempty"` - RewardFlags *uint32 `protobuf:"varint,8,opt,name=reward_flags" json:"reward_flags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemTournamentPassport) Reset() { *m = CSOEconItemTournamentPassport{} } -func (m *CSOEconItemTournamentPassport) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemTournamentPassport) ProtoMessage() {} -func (*CSOEconItemTournamentPassport) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{50} } - -func (m *CSOEconItemTournamentPassport) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetOriginalPurchaserId() uint32 { - if m != nil && m.OriginalPurchaserId != nil { - return *m.OriginalPurchaserId - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetPassportsBought() uint32 { - if m != nil && m.PassportsBought != nil { - return *m.PassportsBought - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOEconItemTournamentPassport) GetRewardFlags() uint32 { - if m != nil && m.RewardFlags != nil { - return *m.RewardFlags - } - return 0 -} - -type CMsgGCItemPreviewItemBoughtNotification struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemPreviewItemBoughtNotification) Reset() { - *m = CMsgGCItemPreviewItemBoughtNotification{} -} -func (m *CMsgGCItemPreviewItemBoughtNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemPreviewItemBoughtNotification) ProtoMessage() {} -func (*CMsgGCItemPreviewItemBoughtNotification) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{51} -} - -func (m *CMsgGCItemPreviewItemBoughtNotification) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -type CMsgGCStorePurchaseCancel struct { - TxnId *uint64 `protobuf:"varint,1,opt,name=txn_id" json:"txn_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseCancel) Reset() { *m = CMsgGCStorePurchaseCancel{} } -func (m *CMsgGCStorePurchaseCancel) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseCancel) ProtoMessage() {} -func (*CMsgGCStorePurchaseCancel) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{52} } - -func (m *CMsgGCStorePurchaseCancel) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -type CMsgGCStorePurchaseCancelResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseCancelResponse) Reset() { *m = CMsgGCStorePurchaseCancelResponse{} } -func (m *CMsgGCStorePurchaseCancelResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseCancelResponse) ProtoMessage() {} -func (*CMsgGCStorePurchaseCancelResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{53} -} - -func (m *CMsgGCStorePurchaseCancelResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgGCStorePurchaseFinalize struct { - TxnId *uint64 `protobuf:"varint,1,opt,name=txn_id" json:"txn_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseFinalize) Reset() { *m = CMsgGCStorePurchaseFinalize{} } -func (m *CMsgGCStorePurchaseFinalize) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseFinalize) ProtoMessage() {} -func (*CMsgGCStorePurchaseFinalize) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{54} } - -func (m *CMsgGCStorePurchaseFinalize) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -type CMsgGCStorePurchaseFinalizeResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - ItemIds []uint64 `protobuf:"varint,2,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseFinalizeResponse) Reset() { *m = CMsgGCStorePurchaseFinalizeResponse{} } -func (m *CMsgGCStorePurchaseFinalizeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseFinalizeResponse) ProtoMessage() {} -func (*CMsgGCStorePurchaseFinalizeResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{55} -} - -func (m *CMsgGCStorePurchaseFinalizeResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGCStorePurchaseFinalizeResponse) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgGCBannedWordListRequest struct { - BanListGroupId *uint32 `protobuf:"varint,1,opt,name=ban_list_group_id" json:"ban_list_group_id,omitempty"` - WordId *uint32 `protobuf:"varint,2,opt,name=word_id" json:"word_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCBannedWordListRequest) Reset() { *m = CMsgGCBannedWordListRequest{} } -func (m *CMsgGCBannedWordListRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCBannedWordListRequest) ProtoMessage() {} -func (*CMsgGCBannedWordListRequest) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{56} } - -func (m *CMsgGCBannedWordListRequest) GetBanListGroupId() uint32 { - if m != nil && m.BanListGroupId != nil { - return *m.BanListGroupId - } - return 0 -} - -func (m *CMsgGCBannedWordListRequest) GetWordId() uint32 { - if m != nil && m.WordId != nil { - return *m.WordId - } - return 0 -} - -type CMsgGCBannedWord struct { - WordId *uint32 `protobuf:"varint,1,opt,name=word_id" json:"word_id,omitempty"` - WordType *GC_BannedWordType `protobuf:"varint,2,opt,name=word_type,enum=GC_BannedWordType,def=0" json:"word_type,omitempty"` - Word *string `protobuf:"bytes,3,opt,name=word" json:"word,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCBannedWord) Reset() { *m = CMsgGCBannedWord{} } -func (m *CMsgGCBannedWord) String() string { return proto.CompactTextString(m) } -func (*CMsgGCBannedWord) ProtoMessage() {} -func (*CMsgGCBannedWord) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{57} } - -const Default_CMsgGCBannedWord_WordType GC_BannedWordType = GC_BannedWordType_GC_BANNED_WORD_DISABLE_WORD - -func (m *CMsgGCBannedWord) GetWordId() uint32 { - if m != nil && m.WordId != nil { - return *m.WordId - } - return 0 -} - -func (m *CMsgGCBannedWord) GetWordType() GC_BannedWordType { - if m != nil && m.WordType != nil { - return *m.WordType - } - return Default_CMsgGCBannedWord_WordType -} - -func (m *CMsgGCBannedWord) GetWord() string { - if m != nil && m.Word != nil { - return *m.Word - } - return "" -} - -type CMsgGCBannedWordListResponse struct { - BanListGroupId *uint32 `protobuf:"varint,1,opt,name=ban_list_group_id" json:"ban_list_group_id,omitempty"` - WordList []*CMsgGCBannedWord `protobuf:"bytes,2,rep,name=word_list" json:"word_list,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCBannedWordListResponse) Reset() { *m = CMsgGCBannedWordListResponse{} } -func (m *CMsgGCBannedWordListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCBannedWordListResponse) ProtoMessage() {} -func (*CMsgGCBannedWordListResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{58} } - -func (m *CMsgGCBannedWordListResponse) GetBanListGroupId() uint32 { - if m != nil && m.BanListGroupId != nil { - return *m.BanListGroupId - } - return 0 -} - -func (m *CMsgGCBannedWordListResponse) GetWordList() []*CMsgGCBannedWord { - if m != nil { - return m.WordList - } - return nil -} - -type CMsgGCToGCBannedWordListBroadcast struct { - Broadcast *CMsgGCBannedWordListResponse `protobuf:"bytes,1,opt,name=broadcast" json:"broadcast,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCBannedWordListBroadcast) Reset() { *m = CMsgGCToGCBannedWordListBroadcast{} } -func (m *CMsgGCToGCBannedWordListBroadcast) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCBannedWordListBroadcast) ProtoMessage() {} -func (*CMsgGCToGCBannedWordListBroadcast) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{59} -} - -func (m *CMsgGCToGCBannedWordListBroadcast) GetBroadcast() *CMsgGCBannedWordListResponse { - if m != nil { - return m.Broadcast - } - return nil -} - -type CMsgGCToGCBannedWordListUpdated struct { - GroupId *uint32 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCBannedWordListUpdated) Reset() { *m = CMsgGCToGCBannedWordListUpdated{} } -func (m *CMsgGCToGCBannedWordListUpdated) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCBannedWordListUpdated) ProtoMessage() {} -func (*CMsgGCToGCBannedWordListUpdated) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{60} -} - -func (m *CMsgGCToGCBannedWordListUpdated) GetGroupId() uint32 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -type CMsgGCToGCDirtySDOCache struct { - SdoType *uint32 `protobuf:"varint,1,opt,name=sdo_type" json:"sdo_type,omitempty"` - KeyUint64 *uint64 `protobuf:"varint,2,opt,name=key_uint64" json:"key_uint64,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCDirtySDOCache) Reset() { *m = CMsgGCToGCDirtySDOCache{} } -func (m *CMsgGCToGCDirtySDOCache) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCDirtySDOCache) ProtoMessage() {} -func (*CMsgGCToGCDirtySDOCache) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{61} } - -func (m *CMsgGCToGCDirtySDOCache) GetSdoType() uint32 { - if m != nil && m.SdoType != nil { - return *m.SdoType - } - return 0 -} - -func (m *CMsgGCToGCDirtySDOCache) GetKeyUint64() uint64 { - if m != nil && m.KeyUint64 != nil { - return *m.KeyUint64 - } - return 0 -} - -type CMsgGCToGCDirtyMultipleSDOCache struct { - SdoType *uint32 `protobuf:"varint,1,opt,name=sdo_type" json:"sdo_type,omitempty"` - KeyUint64 []uint64 `protobuf:"varint,2,rep,name=key_uint64" json:"key_uint64,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCDirtyMultipleSDOCache) Reset() { *m = CMsgGCToGCDirtyMultipleSDOCache{} } -func (m *CMsgGCToGCDirtyMultipleSDOCache) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCDirtyMultipleSDOCache) ProtoMessage() {} -func (*CMsgGCToGCDirtyMultipleSDOCache) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{62} -} - -func (m *CMsgGCToGCDirtyMultipleSDOCache) GetSdoType() uint32 { - if m != nil && m.SdoType != nil { - return *m.SdoType - } - return 0 -} - -func (m *CMsgGCToGCDirtyMultipleSDOCache) GetKeyUint64() []uint64 { - if m != nil { - return m.KeyUint64 - } - return nil -} - -type CMsgGCToGCApplyLocalizationDiff struct { - Language *uint32 `protobuf:"varint,1,opt,name=language" json:"language,omitempty"` - PackedDiff *string `protobuf:"bytes,2,opt,name=packed_diff" json:"packed_diff,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCApplyLocalizationDiff) Reset() { *m = CMsgGCToGCApplyLocalizationDiff{} } -func (m *CMsgGCToGCApplyLocalizationDiff) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCApplyLocalizationDiff) ProtoMessage() {} -func (*CMsgGCToGCApplyLocalizationDiff) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{63} -} - -func (m *CMsgGCToGCApplyLocalizationDiff) GetLanguage() uint32 { - if m != nil && m.Language != nil { - return *m.Language - } - return 0 -} - -func (m *CMsgGCToGCApplyLocalizationDiff) GetPackedDiff() string { - if m != nil && m.PackedDiff != nil { - return *m.PackedDiff - } - return "" -} - -type CMsgGCToGCApplyLocalizationDiffResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCApplyLocalizationDiffResponse) Reset() { - *m = CMsgGCToGCApplyLocalizationDiffResponse{} -} -func (m *CMsgGCToGCApplyLocalizationDiffResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCApplyLocalizationDiffResponse) ProtoMessage() {} -func (*CMsgGCToGCApplyLocalizationDiffResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{64} -} - -func (m *CMsgGCToGCApplyLocalizationDiffResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CMsgGCCollectItem struct { - CollectionItemId *uint64 `protobuf:"varint,1,opt,name=collection_item_id" json:"collection_item_id,omitempty"` - SubjectItemId *uint64 `protobuf:"varint,2,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCCollectItem) Reset() { *m = CMsgGCCollectItem{} } -func (m *CMsgGCCollectItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGCCollectItem) ProtoMessage() {} -func (*CMsgGCCollectItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{65} } - -func (m *CMsgGCCollectItem) GetCollectionItemId() uint64 { - if m != nil && m.CollectionItemId != nil { - return *m.CollectionItemId - } - return 0 -} - -func (m *CMsgGCCollectItem) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -type CMsgSDONoMemcached struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSDONoMemcached) Reset() { *m = CMsgSDONoMemcached{} } -func (m *CMsgSDONoMemcached) String() string { return proto.CompactTextString(m) } -func (*CMsgSDONoMemcached) ProtoMessage() {} -func (*CMsgSDONoMemcached) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{66} } - -type CMsgGCToGCUpdateSQLKeyValue struct { - KeyName *string `protobuf:"bytes,1,opt,name=key_name" json:"key_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCUpdateSQLKeyValue) Reset() { *m = CMsgGCToGCUpdateSQLKeyValue{} } -func (m *CMsgGCToGCUpdateSQLKeyValue) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCUpdateSQLKeyValue) ProtoMessage() {} -func (*CMsgGCToGCUpdateSQLKeyValue) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{67} } - -func (m *CMsgGCToGCUpdateSQLKeyValue) GetKeyName() string { - if m != nil && m.KeyName != nil { - return *m.KeyName - } - return "" -} - -type CMsgGCToGCBroadcastConsoleCommand struct { - ConCommand *string `protobuf:"bytes,1,opt,name=con_command" json:"con_command,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCBroadcastConsoleCommand) Reset() { *m = CMsgGCToGCBroadcastConsoleCommand{} } -func (m *CMsgGCToGCBroadcastConsoleCommand) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCBroadcastConsoleCommand) ProtoMessage() {} -func (*CMsgGCToGCBroadcastConsoleCommand) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{68} -} - -func (m *CMsgGCToGCBroadcastConsoleCommand) GetConCommand() string { - if m != nil && m.ConCommand != nil { - return *m.ConCommand - } - return "" -} - -type CMsgGCServerVersionUpdated struct { - ServerVersion *uint32 `protobuf:"varint,1,opt,name=server_version" json:"server_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCServerVersionUpdated) Reset() { *m = CMsgGCServerVersionUpdated{} } -func (m *CMsgGCServerVersionUpdated) String() string { return proto.CompactTextString(m) } -func (*CMsgGCServerVersionUpdated) ProtoMessage() {} -func (*CMsgGCServerVersionUpdated) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{69} } - -func (m *CMsgGCServerVersionUpdated) GetServerVersion() uint32 { - if m != nil && m.ServerVersion != nil { - return *m.ServerVersion - } - return 0 -} - -type CMsgGCClientVersionUpdated struct { - ClientVersion *uint32 `protobuf:"varint,1,opt,name=client_version" json:"client_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientVersionUpdated) Reset() { *m = CMsgGCClientVersionUpdated{} } -func (m *CMsgGCClientVersionUpdated) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientVersionUpdated) ProtoMessage() {} -func (*CMsgGCClientVersionUpdated) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{70} } - -func (m *CMsgGCClientVersionUpdated) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -type CMsgGCToGCWebAPIAccountChanged struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCWebAPIAccountChanged) Reset() { *m = CMsgGCToGCWebAPIAccountChanged{} } -func (m *CMsgGCToGCWebAPIAccountChanged) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCWebAPIAccountChanged) ProtoMessage() {} -func (*CMsgGCToGCWebAPIAccountChanged) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{71} } - -type CMsgRecipeComponent struct { - SubjectItemId *uint64 `protobuf:"varint,1,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - AttributeIndex *uint64 `protobuf:"varint,2,opt,name=attribute_index" json:"attribute_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRecipeComponent) Reset() { *m = CMsgRecipeComponent{} } -func (m *CMsgRecipeComponent) String() string { return proto.CompactTextString(m) } -func (*CMsgRecipeComponent) ProtoMessage() {} -func (*CMsgRecipeComponent) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{72} } - -func (m *CMsgRecipeComponent) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -func (m *CMsgRecipeComponent) GetAttributeIndex() uint64 { - if m != nil && m.AttributeIndex != nil { - return *m.AttributeIndex - } - return 0 -} - -type CMsgFulfillDynamicRecipeComponent struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - ConsumptionComponents []*CMsgRecipeComponent `protobuf:"bytes,2,rep,name=consumption_components" json:"consumption_components,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgFulfillDynamicRecipeComponent) Reset() { *m = CMsgFulfillDynamicRecipeComponent{} } -func (m *CMsgFulfillDynamicRecipeComponent) String() string { return proto.CompactTextString(m) } -func (*CMsgFulfillDynamicRecipeComponent) ProtoMessage() {} -func (*CMsgFulfillDynamicRecipeComponent) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{73} -} - -func (m *CMsgFulfillDynamicRecipeComponent) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgFulfillDynamicRecipeComponent) GetConsumptionComponents() []*CMsgRecipeComponent { - if m != nil { - return m.ConsumptionComponents - } - return nil -} - -type CMsgGCClientMarketDataRequest struct { - UserCurrency *uint32 `protobuf:"varint,1,opt,name=user_currency" json:"user_currency,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientMarketDataRequest) Reset() { *m = CMsgGCClientMarketDataRequest{} } -func (m *CMsgGCClientMarketDataRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientMarketDataRequest) ProtoMessage() {} -func (*CMsgGCClientMarketDataRequest) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{74} } - -func (m *CMsgGCClientMarketDataRequest) GetUserCurrency() uint32 { - if m != nil && m.UserCurrency != nil { - return *m.UserCurrency - } - return 0 -} - -type CMsgGCClientMarketDataEntry struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - ItemQuality *uint32 `protobuf:"varint,2,opt,name=item_quality" json:"item_quality,omitempty"` - ItemSellListings *uint32 `protobuf:"varint,3,opt,name=item_sell_listings" json:"item_sell_listings,omitempty"` - PriceInLocalCurrency *uint32 `protobuf:"varint,4,opt,name=price_in_local_currency" json:"price_in_local_currency,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientMarketDataEntry) Reset() { *m = CMsgGCClientMarketDataEntry{} } -func (m *CMsgGCClientMarketDataEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientMarketDataEntry) ProtoMessage() {} -func (*CMsgGCClientMarketDataEntry) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{75} } - -func (m *CMsgGCClientMarketDataEntry) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCClientMarketDataEntry) GetItemQuality() uint32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CMsgGCClientMarketDataEntry) GetItemSellListings() uint32 { - if m != nil && m.ItemSellListings != nil { - return *m.ItemSellListings - } - return 0 -} - -func (m *CMsgGCClientMarketDataEntry) GetPriceInLocalCurrency() uint32 { - if m != nil && m.PriceInLocalCurrency != nil { - return *m.PriceInLocalCurrency - } - return 0 -} - -type CMsgGCClientMarketData struct { - Entries []*CMsgGCClientMarketDataEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientMarketData) Reset() { *m = CMsgGCClientMarketData{} } -func (m *CMsgGCClientMarketData) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientMarketData) ProtoMessage() {} -func (*CMsgGCClientMarketData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{76} } - -func (m *CMsgGCClientMarketData) GetEntries() []*CMsgGCClientMarketDataEntry { - if m != nil { - return m.Entries - } - return nil -} - -type CMsgExtractGems struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - ItemSocketId *uint32 `protobuf:"varint,3,opt,name=item_socket_id,def=65535" json:"item_socket_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgExtractGems) Reset() { *m = CMsgExtractGems{} } -func (m *CMsgExtractGems) String() string { return proto.CompactTextString(m) } -func (*CMsgExtractGems) ProtoMessage() {} -func (*CMsgExtractGems) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{77} } - -const Default_CMsgExtractGems_ItemSocketId uint32 = 65535 - -func (m *CMsgExtractGems) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgExtractGems) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -func (m *CMsgExtractGems) GetItemSocketId() uint32 { - if m != nil && m.ItemSocketId != nil { - return *m.ItemSocketId - } - return Default_CMsgExtractGems_ItemSocketId -} - -type CMsgExtractGemsResponse struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - Response *CMsgExtractGemsResponse_EExtractGems `protobuf:"varint,2,opt,name=response,enum=CMsgExtractGemsResponse_EExtractGems,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgExtractGemsResponse) Reset() { *m = CMsgExtractGemsResponse{} } -func (m *CMsgExtractGemsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgExtractGemsResponse) ProtoMessage() {} -func (*CMsgExtractGemsResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{78} } - -const Default_CMsgExtractGemsResponse_Response CMsgExtractGemsResponse_EExtractGems = CMsgExtractGemsResponse_k_ExtractGems_Succeeded - -func (m *CMsgExtractGemsResponse) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgExtractGemsResponse) GetResponse() CMsgExtractGemsResponse_EExtractGems { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgExtractGemsResponse_Response -} - -type CMsgAddSocket struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - Unusual *bool `protobuf:"varint,3,opt,name=unusual" json:"unusual,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAddSocket) Reset() { *m = CMsgAddSocket{} } -func (m *CMsgAddSocket) String() string { return proto.CompactTextString(m) } -func (*CMsgAddSocket) ProtoMessage() {} -func (*CMsgAddSocket) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{79} } - -func (m *CMsgAddSocket) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgAddSocket) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -func (m *CMsgAddSocket) GetUnusual() bool { - if m != nil && m.Unusual != nil { - return *m.Unusual - } - return false -} - -type CMsgAddSocketResponse struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - UpdatedSocketIndex []uint32 `protobuf:"varint,2,rep,name=updated_socket_index" json:"updated_socket_index,omitempty"` - Response *CMsgAddSocketResponse_EAddSocket `protobuf:"varint,3,opt,name=response,enum=CMsgAddSocketResponse_EAddSocket,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAddSocketResponse) Reset() { *m = CMsgAddSocketResponse{} } -func (m *CMsgAddSocketResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgAddSocketResponse) ProtoMessage() {} -func (*CMsgAddSocketResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{80} } - -const Default_CMsgAddSocketResponse_Response CMsgAddSocketResponse_EAddSocket = CMsgAddSocketResponse_k_AddSocket_Succeeded - -func (m *CMsgAddSocketResponse) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgAddSocketResponse) GetUpdatedSocketIndex() []uint32 { - if m != nil { - return m.UpdatedSocketIndex - } - return nil -} - -func (m *CMsgAddSocketResponse) GetResponse() CMsgAddSocketResponse_EAddSocket { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgAddSocketResponse_Response -} - -type CMsgAddItemToSocketData struct { - GemItemId *uint64 `protobuf:"varint,1,opt,name=gem_item_id" json:"gem_item_id,omitempty"` - SocketIndex *uint32 `protobuf:"varint,2,opt,name=socket_index" json:"socket_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAddItemToSocketData) Reset() { *m = CMsgAddItemToSocketData{} } -func (m *CMsgAddItemToSocketData) String() string { return proto.CompactTextString(m) } -func (*CMsgAddItemToSocketData) ProtoMessage() {} -func (*CMsgAddItemToSocketData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{81} } - -func (m *CMsgAddItemToSocketData) GetGemItemId() uint64 { - if m != nil && m.GemItemId != nil { - return *m.GemItemId - } - return 0 -} - -func (m *CMsgAddItemToSocketData) GetSocketIndex() uint32 { - if m != nil && m.SocketIndex != nil { - return *m.SocketIndex - } - return 0 -} - -type CMsgAddItemToSocket struct { - ItemItemId *uint64 `protobuf:"varint,1,opt,name=item_item_id" json:"item_item_id,omitempty"` - GemsToSocket []*CMsgAddItemToSocketData `protobuf:"bytes,2,rep,name=gems_to_socket" json:"gems_to_socket,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAddItemToSocket) Reset() { *m = CMsgAddItemToSocket{} } -func (m *CMsgAddItemToSocket) String() string { return proto.CompactTextString(m) } -func (*CMsgAddItemToSocket) ProtoMessage() {} -func (*CMsgAddItemToSocket) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{82} } - -func (m *CMsgAddItemToSocket) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -func (m *CMsgAddItemToSocket) GetGemsToSocket() []*CMsgAddItemToSocketData { - if m != nil { - return m.GemsToSocket - } - return nil -} - -type CMsgAddItemToSocketResponse struct { - ItemItemId *uint64 `protobuf:"varint,1,opt,name=item_item_id" json:"item_item_id,omitempty"` - UpdatedSocketIndex []uint32 `protobuf:"varint,2,rep,name=updated_socket_index" json:"updated_socket_index,omitempty"` - Response *CMsgAddItemToSocketResponse_EAddGem `protobuf:"varint,3,opt,name=response,enum=CMsgAddItemToSocketResponse_EAddGem,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAddItemToSocketResponse) Reset() { *m = CMsgAddItemToSocketResponse{} } -func (m *CMsgAddItemToSocketResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgAddItemToSocketResponse) ProtoMessage() {} -func (*CMsgAddItemToSocketResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{83} } - -const Default_CMsgAddItemToSocketResponse_Response CMsgAddItemToSocketResponse_EAddGem = CMsgAddItemToSocketResponse_k_AddGem_Succeeded - -func (m *CMsgAddItemToSocketResponse) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -func (m *CMsgAddItemToSocketResponse) GetUpdatedSocketIndex() []uint32 { - if m != nil { - return m.UpdatedSocketIndex - } - return nil -} - -func (m *CMsgAddItemToSocketResponse) GetResponse() CMsgAddItemToSocketResponse_EAddGem { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgAddItemToSocketResponse_Response -} - -type CMsgResetStrangeGemCount struct { - ItemItemId *uint64 `protobuf:"varint,1,opt,name=item_item_id" json:"item_item_id,omitempty"` - SocketIndex *uint32 `protobuf:"varint,2,opt,name=socket_index" json:"socket_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgResetStrangeGemCount) Reset() { *m = CMsgResetStrangeGemCount{} } -func (m *CMsgResetStrangeGemCount) String() string { return proto.CompactTextString(m) } -func (*CMsgResetStrangeGemCount) ProtoMessage() {} -func (*CMsgResetStrangeGemCount) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{84} } - -func (m *CMsgResetStrangeGemCount) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -func (m *CMsgResetStrangeGemCount) GetSocketIndex() uint32 { - if m != nil && m.SocketIndex != nil { - return *m.SocketIndex - } - return 0 -} - -type CMsgResetStrangeGemCountResponse struct { - Response *CMsgResetStrangeGemCountResponse_EResetGem `protobuf:"varint,1,opt,name=response,enum=CMsgResetStrangeGemCountResponse_EResetGem,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgResetStrangeGemCountResponse) Reset() { *m = CMsgResetStrangeGemCountResponse{} } -func (m *CMsgResetStrangeGemCountResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgResetStrangeGemCountResponse) ProtoMessage() {} -func (*CMsgResetStrangeGemCountResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{85} -} - -const Default_CMsgResetStrangeGemCountResponse_Response CMsgResetStrangeGemCountResponse_EResetGem = CMsgResetStrangeGemCountResponse_k_ResetGem_Succeeded - -func (m *CMsgResetStrangeGemCountResponse) GetResponse() CMsgResetStrangeGemCountResponse_EResetGem { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgResetStrangeGemCountResponse_Response -} - -func init() { - proto.RegisterType((*CGCStorePurchaseInit_LineItem)(nil), "CGCStorePurchaseInit_LineItem") - proto.RegisterType((*CMsgGCStorePurchaseInit)(nil), "CMsgGCStorePurchaseInit") - proto.RegisterType((*CMsgGCStorePurchaseInitResponse)(nil), "CMsgGCStorePurchaseInitResponse") - proto.RegisterType((*CMsgSystemBroadcast)(nil), "CMsgSystemBroadcast") - proto.RegisterType((*CMsgClientPingData)(nil), "CMsgClientPingData") - proto.RegisterType((*CMsgInviteToParty)(nil), "CMsgInviteToParty") - proto.RegisterType((*CMsgInviteToLobby)(nil), "CMsgInviteToLobby") - proto.RegisterType((*CMsgInvitationCreated)(nil), "CMsgInvitationCreated") - proto.RegisterType((*CMsgPartyInviteResponse)(nil), "CMsgPartyInviteResponse") - proto.RegisterType((*CMsgLobbyInviteResponse)(nil), "CMsgLobbyInviteResponse") - proto.RegisterType((*CMsgKickFromParty)(nil), "CMsgKickFromParty") - proto.RegisterType((*CMsgLeaveParty)(nil), "CMsgLeaveParty") - proto.RegisterType((*CMsgCustomGameInstallStatus)(nil), "CMsgCustomGameInstallStatus") - proto.RegisterType((*CMsgServerAvailable)(nil), "CMsgServerAvailable") - proto.RegisterType((*CMsgLANServerAvailable)(nil), "CMsgLANServerAvailable") - proto.RegisterType((*CSOEconGameAccountClient)(nil), "CSOEconGameAccountClient") - proto.RegisterType((*CSOItemCriteriaCondition)(nil), "CSOItemCriteriaCondition") - proto.RegisterType((*CSOItemCriteria)(nil), "CSOItemCriteria") - proto.RegisterType((*CSOItemRecipe)(nil), "CSOItemRecipe") - proto.RegisterType((*CMsgApplyStrangePart)(nil), "CMsgApplyStrangePart") - proto.RegisterType((*CMsgApplyPennantUpgrade)(nil), "CMsgApplyPennantUpgrade") - proto.RegisterType((*CMsgApplyEggEssence)(nil), "CMsgApplyEggEssence") - proto.RegisterType((*CSOEconItemAttribute)(nil), "CSOEconItemAttribute") - proto.RegisterType((*CSOEconItemEquipped)(nil), "CSOEconItemEquipped") - proto.RegisterType((*CSOEconItem)(nil), "CSOEconItem") - proto.RegisterType((*CMsgSortItems)(nil), "CMsgSortItems") - proto.RegisterType((*CSOEconClaimCode)(nil), "CSOEconClaimCode") - proto.RegisterType((*CMsgStoreGetUserData)(nil), "CMsgStoreGetUserData") - proto.RegisterType((*CMsgStoreGetUserDataResponse)(nil), "CMsgStoreGetUserDataResponse") - proto.RegisterType((*CMsgUpdateItemSchema)(nil), "CMsgUpdateItemSchema") - proto.RegisterType((*CMsgGCError)(nil), "CMsgGCError") - proto.RegisterType((*CMsgRequestInventoryRefresh)(nil), "CMsgRequestInventoryRefresh") - proto.RegisterType((*CMsgConVarValue)(nil), "CMsgConVarValue") - proto.RegisterType((*CMsgReplicateConVars)(nil), "CMsgReplicateConVars") - proto.RegisterType((*CMsgReplayUploadedToYouTube)(nil), "CMsgReplayUploadedToYouTube") - proto.RegisterType((*CMsgConsumableExhausted)(nil), "CMsgConsumableExhausted") - proto.RegisterType((*CMsgItemAcknowledged)(nil), "CMsgItemAcknowledged") - proto.RegisterType((*CMsgSetPresetItemPosition)(nil), "CMsgSetPresetItemPosition") - proto.RegisterType((*CMsgSetItemPositions)(nil), "CMsgSetItemPositions") - proto.RegisterType((*CMsgSetItemPositions_ItemPosition)(nil), "CMsgSetItemPositions.ItemPosition") - proto.RegisterType((*CSOEconItemPresetInstance)(nil), "CSOEconItemPresetInstance") - proto.RegisterType((*CMsgSelectItemPresetForClass)(nil), "CMsgSelectItemPresetForClass") - proto.RegisterType((*CMsgSelectItemPresetForClassReply)(nil), "CMsgSelectItemPresetForClassReply") - proto.RegisterType((*CSOSelectedItemPreset)(nil), "CSOSelectedItemPreset") - proto.RegisterType((*CMsgGCNameItemNotification)(nil), "CMsgGCNameItemNotification") - proto.RegisterType((*CMsgGCClientDisplayNotification)(nil), "CMsgGCClientDisplayNotification") - proto.RegisterType((*CMsgGCShowItemsPickedUp)(nil), "CMsgGCShowItemsPickedUp") - proto.RegisterType((*CMsgGCIncrementKillCountResponse)(nil), "CMsgGCIncrementKillCountResponse") - proto.RegisterType((*CSOEconItemDropRateBonus)(nil), "CSOEconItemDropRateBonus") - proto.RegisterType((*CSOEconItemLeagueViewPass)(nil), "CSOEconItemLeagueViewPass") - proto.RegisterType((*CSOEconItemEventTicket)(nil), "CSOEconItemEventTicket") - proto.RegisterType((*CSOEconItemTournamentPassport)(nil), "CSOEconItemTournamentPassport") - proto.RegisterType((*CMsgGCItemPreviewItemBoughtNotification)(nil), "CMsgGCItemPreviewItemBoughtNotification") - proto.RegisterType((*CMsgGCStorePurchaseCancel)(nil), "CMsgGCStorePurchaseCancel") - proto.RegisterType((*CMsgGCStorePurchaseCancelResponse)(nil), "CMsgGCStorePurchaseCancelResponse") - proto.RegisterType((*CMsgGCStorePurchaseFinalize)(nil), "CMsgGCStorePurchaseFinalize") - proto.RegisterType((*CMsgGCStorePurchaseFinalizeResponse)(nil), "CMsgGCStorePurchaseFinalizeResponse") - proto.RegisterType((*CMsgGCBannedWordListRequest)(nil), "CMsgGCBannedWordListRequest") - proto.RegisterType((*CMsgGCBannedWord)(nil), "CMsgGCBannedWord") - proto.RegisterType((*CMsgGCBannedWordListResponse)(nil), "CMsgGCBannedWordListResponse") - proto.RegisterType((*CMsgGCToGCBannedWordListBroadcast)(nil), "CMsgGCToGCBannedWordListBroadcast") - proto.RegisterType((*CMsgGCToGCBannedWordListUpdated)(nil), "CMsgGCToGCBannedWordListUpdated") - proto.RegisterType((*CMsgGCToGCDirtySDOCache)(nil), "CMsgGCToGCDirtySDOCache") - proto.RegisterType((*CMsgGCToGCDirtyMultipleSDOCache)(nil), "CMsgGCToGCDirtyMultipleSDOCache") - proto.RegisterType((*CMsgGCToGCApplyLocalizationDiff)(nil), "CMsgGCToGCApplyLocalizationDiff") - proto.RegisterType((*CMsgGCToGCApplyLocalizationDiffResponse)(nil), "CMsgGCToGCApplyLocalizationDiffResponse") - proto.RegisterType((*CMsgGCCollectItem)(nil), "CMsgGCCollectItem") - proto.RegisterType((*CMsgSDONoMemcached)(nil), "CMsgSDONoMemcached") - proto.RegisterType((*CMsgGCToGCUpdateSQLKeyValue)(nil), "CMsgGCToGCUpdateSQLKeyValue") - proto.RegisterType((*CMsgGCToGCBroadcastConsoleCommand)(nil), "CMsgGCToGCBroadcastConsoleCommand") - proto.RegisterType((*CMsgGCServerVersionUpdated)(nil), "CMsgGCServerVersionUpdated") - proto.RegisterType((*CMsgGCClientVersionUpdated)(nil), "CMsgGCClientVersionUpdated") - proto.RegisterType((*CMsgGCToGCWebAPIAccountChanged)(nil), "CMsgGCToGCWebAPIAccountChanged") - proto.RegisterType((*CMsgRecipeComponent)(nil), "CMsgRecipeComponent") - proto.RegisterType((*CMsgFulfillDynamicRecipeComponent)(nil), "CMsgFulfillDynamicRecipeComponent") - proto.RegisterType((*CMsgGCClientMarketDataRequest)(nil), "CMsgGCClientMarketDataRequest") - proto.RegisterType((*CMsgGCClientMarketDataEntry)(nil), "CMsgGCClientMarketDataEntry") - proto.RegisterType((*CMsgGCClientMarketData)(nil), "CMsgGCClientMarketData") - proto.RegisterType((*CMsgExtractGems)(nil), "CMsgExtractGems") - proto.RegisterType((*CMsgExtractGemsResponse)(nil), "CMsgExtractGemsResponse") - proto.RegisterType((*CMsgAddSocket)(nil), "CMsgAddSocket") - proto.RegisterType((*CMsgAddSocketResponse)(nil), "CMsgAddSocketResponse") - proto.RegisterType((*CMsgAddItemToSocketData)(nil), "CMsgAddItemToSocketData") - proto.RegisterType((*CMsgAddItemToSocket)(nil), "CMsgAddItemToSocket") - proto.RegisterType((*CMsgAddItemToSocketResponse)(nil), "CMsgAddItemToSocketResponse") - proto.RegisterType((*CMsgResetStrangeGemCount)(nil), "CMsgResetStrangeGemCount") - proto.RegisterType((*CMsgResetStrangeGemCountResponse)(nil), "CMsgResetStrangeGemCountResponse") - proto.RegisterEnum("EGCBaseMsg", EGCBaseMsg_name, EGCBaseMsg_value) - proto.RegisterEnum("EGCBaseProtoObjectTypes", EGCBaseProtoObjectTypes_name, EGCBaseProtoObjectTypes_value) - proto.RegisterEnum("ECustomGameInstallStatus", ECustomGameInstallStatus_name, ECustomGameInstallStatus_value) - proto.RegisterEnum("GC_BannedWordType", GC_BannedWordType_name, GC_BannedWordType_value) - proto.RegisterEnum("CMsgExtractGemsResponse_EExtractGems", CMsgExtractGemsResponse_EExtractGems_name, CMsgExtractGemsResponse_EExtractGems_value) - proto.RegisterEnum("CMsgAddSocketResponse_EAddSocket", CMsgAddSocketResponse_EAddSocket_name, CMsgAddSocketResponse_EAddSocket_value) - proto.RegisterEnum("CMsgAddItemToSocketResponse_EAddGem", CMsgAddItemToSocketResponse_EAddGem_name, CMsgAddItemToSocketResponse_EAddGem_value) - proto.RegisterEnum("CMsgResetStrangeGemCountResponse_EResetGem", CMsgResetStrangeGemCountResponse_EResetGem_name, CMsgResetStrangeGemCountResponse_EResetGem_value) -} - -var base_fileDescriptor0 = []byte{ - // 4164 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x5a, 0xdd, 0x6f, 0xe4, 0x58, - 0x56, 0xdf, 0xaa, 0x4a, 0xa5, 0x92, 0x9b, 0x8f, 0x71, 0x9c, 0xa4, 0x53, 0xfd, 0xdd, 0xed, 0xea, - 0xe9, 0xed, 0xed, 0x99, 0xa9, 0x9d, 0xe9, 0xe9, 0x19, 0x20, 0x12, 0x82, 0xa4, 0x92, 0xce, 0x64, - 0xa7, 0x3f, 0xb2, 0x49, 0x7a, 0x46, 0x2b, 0x01, 0x96, 0xcb, 0xbe, 0x55, 0xf1, 0xc6, 0x65, 0x7b, - 0xfd, 0x91, 0x4e, 0x2d, 0x3c, 0x2c, 0x20, 0x24, 0x24, 0x5e, 0xf9, 0x5c, 0x60, 0x61, 0x17, 0xc4, - 0x9f, 0x80, 0xc4, 0x0b, 0xbc, 0x20, 0x21, 0x21, 0xf1, 0xc6, 0x3e, 0xf3, 0x0a, 0xbc, 0x20, 0xfe, - 0x03, 0xce, 0x39, 0xf7, 0x5e, 0xdb, 0xe5, 0x2a, 0xa7, 0x67, 0x78, 0x88, 0x52, 0xbe, 0xf7, 0xdc, - 0x73, 0xcf, 0x3d, 0x1f, 0xbf, 0x73, 0xce, 0xb5, 0xd9, 0x66, 0xdf, 0x8a, 0xb9, 0x39, 0xb4, 0x47, - 0x3c, 0x8e, 0xad, 0x21, 0x8f, 0xbb, 0x61, 0x14, 0x24, 0xc1, 0x8d, 0xf5, 0x38, 0xe1, 0xd6, 0x68, - 0x72, 0xd0, 0xf8, 0x71, 0x8d, 0xdd, 0xee, 0x1d, 0xf4, 0x4e, 0x92, 0x20, 0xe2, 0x47, 0x69, 0x64, - 0x9f, 0xc1, 0xd2, 0x43, 0xdf, 0x4d, 0xcc, 0xe7, 0xae, 0xcf, 0x0f, 0x13, 0x3e, 0xd2, 0xd7, 0xd9, - 0x92, 0x0b, 0xff, 0x4d, 0x87, 0x0f, 0x4c, 0xd7, 0x69, 0xd7, 0xee, 0xd5, 0x1e, 0xad, 0xe8, 0x1a, - 0x5b, 0xf8, 0x41, 0x6a, 0xf9, 0x89, 0x9b, 0x8c, 0xdb, 0x75, 0x1a, 0xb9, 0xc3, 0xae, 0xd9, 0x41, - 0x9c, 0x98, 0xae, 0x6f, 0x7a, 0x81, 0x6d, 0x79, 0xa6, 0x9d, 0x46, 0x11, 0xf7, 0xed, 0x71, 0xbb, - 0x41, 0xf3, 0x9b, 0x6c, 0x25, 0x94, 0xfc, 0xcd, 0x64, 0x1c, 0xf2, 0xf6, 0x1c, 0x0d, 0xdf, 0x64, - 0xeb, 0x71, 0x00, 0xe3, 0xdc, 0x8c, 0xf8, 0x80, 0xe3, 0x02, 0x8e, 0xbb, 0x34, 0x61, 0x72, 0xce, - 0xf8, 0x9d, 0x1a, 0xdb, 0xea, 0xbd, 0x88, 0x87, 0x33, 0xe4, 0xd3, 0xdf, 0x61, 0x2d, 0x3b, 0x48, - 0xfd, 0x24, 0x1a, 0x93, 0x48, 0x8b, 0x28, 0x92, 0x67, 0xf9, 0xc3, 0x14, 0x0e, 0x47, 0x22, 0x35, - 0x71, 0x64, 0x42, 0x88, 0xa6, 0xfe, 0x84, 0x31, 0x0f, 0xce, 0x65, 0xe2, 0x81, 0x62, 0x90, 0xa0, - 0xf1, 0x68, 0xe9, 0xc9, 0x9d, 0xee, 0x95, 0xe7, 0x37, 0x76, 0xd8, 0xdd, 0x0a, 0x19, 0x8e, 0x79, - 0x1c, 0x06, 0x7e, 0xcc, 0xf5, 0x55, 0x36, 0x1f, 0xf1, 0x38, 0xf5, 0x12, 0x12, 0xa5, 0x89, 0xcf, - 0xc9, 0xa5, 0x8f, 0xe7, 0xa8, 0xd3, 0x39, 0x1e, 0xb2, 0x75, 0x64, 0x71, 0x32, 0x06, 0x0b, 0x8c, - 0x76, 0xa3, 0xc0, 0x72, 0x6c, 0x2b, 0xa6, 0x23, 0x48, 0x6b, 0x88, 0x23, 0x18, 0x3f, 0xa9, 0x31, - 0x1d, 0x09, 0x7b, 0x9e, 0xcb, 0xfd, 0xe4, 0xc8, 0xf5, 0x87, 0x7b, 0x56, 0x62, 0xe9, 0x5b, 0x6c, - 0x29, 0xe2, 0x9e, 0x35, 0x36, 0xed, 0xc0, 0xe1, 0x42, 0xec, 0xd6, 0x6e, 0x5d, 0xab, 0xe5, 0x13, - 0x21, 0x90, 0xc6, 0xa0, 0xb4, 0xc6, 0xa3, 0x15, 0x9a, 0x68, 0xb3, 0xe5, 0x88, 0x0f, 0xdd, 0xc0, - 0x97, 0x4b, 0x16, 0x66, 0xcc, 0x88, 0x35, 0x8b, 0xd9, 0x8c, 0xc1, 0x6e, 0x14, 0x66, 0xcc, 0x81, - 0xe5, 0x7a, 0xdc, 0x31, 0xfb, 0x6e, 0x32, 0xb2, 0xe2, 0xf3, 0x36, 0x43, 0x6b, 0x19, 0xbf, 0x5f, - 0x63, 0x6b, 0x28, 0xe0, 0xa1, 0x7f, 0x01, 0x2a, 0x3c, 0x0d, 0x8e, 0xac, 0x28, 0x19, 0xa3, 0x9e, - 0xc9, 0xb5, 0x94, 0x7b, 0xcc, 0xeb, 0xd7, 0xd8, 0xaa, 0x4d, 0x67, 0x30, 0x2f, 0x78, 0x14, 0x03, - 0x4f, 0xe9, 0x24, 0x70, 0x62, 0x45, 0xd8, 0x50, 0x7e, 0x64, 0xc5, 0x20, 0xa4, 0x65, 0x9f, 0x91, - 0x43, 0x2c, 0xe8, 0x0f, 0xd9, 0x22, 0xed, 0xef, 0xc0, 0xc9, 0xc9, 0x0d, 0x96, 0x9e, 0xac, 0x77, - 0xa7, 0x95, 0x62, 0xfc, 0xf2, 0xa4, 0x24, 0xcf, 0x83, 0x7e, 0xff, 0x6b, 0x48, 0x62, 0x7c, 0x97, - 0x6d, 0x66, 0xcb, 0xad, 0x04, 0xc6, 0x7b, 0x11, 0xb7, 0x12, 0xee, 0x20, 0x8b, 0x61, 0x14, 0xa4, - 0xa1, 0x62, 0x31, 0x37, 0xc1, 0xb4, 0x4e, 0x4c, 0x37, 0xd8, 0x72, 0x1a, 0xf3, 0xc8, 0x0c, 0x06, - 0x03, 0x74, 0x27, 0x3a, 0xcb, 0x82, 0xf1, 0x9b, 0xc2, 0x59, 0x49, 0x27, 0x42, 0xac, 0xcc, 0x41, - 0x80, 0x45, 0x88, 0xc3, 0x39, 0x53, 0x70, 0x11, 0xcb, 0xb6, 0x79, 0x98, 0x10, 0xcb, 0x85, 0x19, - 0x72, 0x0a, 0x05, 0x4d, 0xa8, 0x63, 0xa1, 0x5a, 0x1d, 0x7f, 0x20, 0x43, 0x85, 0xf4, 0x30, 0xbd, - 0xbb, 0x87, 0xc3, 0xb9, 0x56, 0xbe, 0xea, 0xee, 0x5b, 0xec, 0x1d, 0x3b, 0x8d, 0x93, 0x60, 0x64, - 0x0e, 0xad, 0x11, 0x37, 0xed, 0xc8, 0x6e, 0xcf, 0x13, 0x83, 0xdb, 0x6c, 0xb3, 0x38, 0x91, 0xb8, - 0xe0, 0xc8, 0x89, 0x35, 0x0a, 0xdb, 0x2d, 0x98, 0x6e, 0x19, 0xef, 0x0a, 0xe3, 0x7c, 0xee, 0xda, - 0xe7, 0xcf, 0xa2, 0x60, 0x54, 0xe1, 0x26, 0x86, 0xc6, 0x56, 0x49, 0x66, 0x6e, 0x5d, 0x70, 0xa2, - 0x31, 0x7e, 0x56, 0x63, 0x37, 0xe9, 0x74, 0xc4, 0xfc, 0x00, 0x78, 0x1f, 0xfa, 0xc0, 0xd8, 0xf3, - 0x4e, 0xc0, 0x4a, 0x69, 0xac, 0xbf, 0x60, 0xf3, 0x31, 0xfd, 0x22, 0x0e, 0xab, 0x4f, 0xae, 0x77, - 0xf7, 0x2b, 0x48, 0xb7, 0x8d, 0x73, 0xb3, 0x6a, 0xce, 0x7c, 0xed, 0x9f, 0xfb, 0xc1, 0x1b, 0xbf, - 0x18, 0x81, 0x75, 0x02, 0x91, 0x0e, 0xbb, 0xe9, 0x81, 0x1b, 0x00, 0x8e, 0x65, 0x47, 0x32, 0x07, - 0x70, 0x02, 0x93, 0x24, 0x27, 0xad, 0xb4, 0x8c, 0x2f, 0x65, 0x38, 0xf3, 0x08, 0xb4, 0xb5, 0x73, - 0x01, 0x81, 0x62, 0xf5, 0x3d, 0xae, 0xff, 0x2a, 0xbb, 0x51, 0xd4, 0x89, 0x2b, 0x76, 0x34, 0x0b, - 0xf2, 0x2e, 0x3d, 0xb9, 0xd5, 0xbd, 0xe2, 0x74, 0xc6, 0x63, 0x76, 0x8d, 0xf4, 0xb1, 0xf3, 0xb2, - 0xcc, 0x7b, 0xca, 0x84, 0xc6, 0xbf, 0xd4, 0x59, 0xbb, 0x77, 0xf2, 0x6a, 0xdf, 0x0e, 0x7c, 0x64, - 0xb4, 0x63, 0x13, 0x1a, 0x0a, 0xaf, 0xd0, 0x1f, 0xb0, 0xeb, 0x96, 0xe3, 0xb8, 0xe8, 0xd7, 0x80, - 0xc4, 0x7d, 0xcb, 0x3e, 0x0f, 0xe1, 0xcf, 0x8c, 0xbd, 0x20, 0x11, 0x92, 0xac, 0x6c, 0xd7, 0x3e, - 0xd4, 0x6f, 0xb1, 0x95, 0x24, 0x72, 0x81, 0xc0, 0x12, 0x8b, 0x85, 0x33, 0x6c, 0x37, 0x07, 0x96, - 0x07, 0x5e, 0xf3, 0x90, 0xb5, 0xb9, 0xe7, 0x0e, 0x5d, 0xd8, 0xde, 0x1c, 0x04, 0xe0, 0xec, 0x3e, - 0x41, 0x67, 0x08, 0x78, 0x23, 0x1c, 0x7e, 0x7b, 0x2e, 0x89, 0x52, 0xae, 0x3f, 0x66, 0x86, 0xcf, - 0x01, 0x29, 0x92, 0xc0, 0xb4, 0xcf, 0x82, 0x00, 0xe0, 0x7d, 0x84, 0x79, 0xe0, 0x8c, 0x7b, 0xe1, - 0x20, 0xf5, 0x40, 0x7b, 0x20, 0x91, 0x23, 0x83, 0x1b, 0xfc, 0xc9, 0xf5, 0x45, 0xb8, 0xf3, 0xd8, - 0xf4, 0xdc, 0x38, 0xa1, 0x10, 0x5f, 0x00, 0x51, 0x36, 0x92, 0xc8, 0x72, 0x38, 0xc8, 0xea, 0x9b, - 0xfc, 0x32, 0x74, 0x23, 0x0a, 0x4a, 0xf2, 0xb6, 0x16, 0x26, 0x09, 0x27, 0xe5, 0x5e, 0x79, 0xb2, - 0x25, 0x27, 0xb5, 0x30, 0xe2, 0x17, 0x2e, 0x7f, 0x63, 0xaa, 0x3c, 0x45, 0x81, 0x42, 0x47, 0x34, - 0xd8, 0xfa, 0x08, 0xd9, 0x0e, 0xdc, 0x08, 0x64, 0x52, 0x09, 0x08, 0x50, 0x2f, 0x3f, 0xa8, 0x11, - 0x91, 0x22, 0x11, 0xeb, 0x7b, 0x11, 0x70, 0x00, 0x8d, 0xf4, 0x02, 0x5f, 0x28, 0x4f, 0x67, 0xac, - 0x1e, 0x84, 0x12, 0xd5, 0x57, 0x58, 0x73, 0xe0, 0x72, 0xcf, 0x91, 0xae, 0x02, 0x26, 0x89, 0xf8, - 0x0f, 0x52, 0x37, 0xe2, 0x02, 0xcc, 0x16, 0x30, 0x53, 0x0e, 0xbc, 0xc0, 0x82, 0x20, 0xb2, 0xbc, - 0x54, 0x24, 0xb8, 0x3a, 0x62, 0x45, 0x0c, 0x5a, 0x86, 0x10, 0x16, 0xa3, 0x4d, 0x42, 0xfa, 0xdf, - 0xad, 0xb3, 0x77, 0x4a, 0x9b, 0xea, 0xb0, 0x19, 0x1d, 0xc0, 0xe3, 0x17, 0xdc, 0x93, 0x79, 0x16, - 0x56, 0xd3, 0x18, 0x24, 0x5b, 0x4f, 0xe5, 0xda, 0x26, 0x86, 0x6b, 0x4e, 0x69, 0xc6, 0x3c, 0x91, - 0x02, 0xb4, 0x99, 0x56, 0xa4, 0xa6, 0x19, 0xa1, 0xf8, 0xeb, 0x6c, 0xcd, 0x85, 0x8c, 0x85, 0xc6, - 0x76, 0xfd, 0x0b, 0x70, 0x91, 0x00, 0xf2, 0x66, 0x93, 0xb6, 0xc0, 0x45, 0x72, 0x2a, 0x4b, 0xe9, - 0xf3, 0x2a, 0x37, 0xbb, 0x43, 0x1f, 0x92, 0x9e, 0xc9, 0x7d, 0xf4, 0x42, 0xc7, 0x1c, 0x78, 0xd6, - 0x90, 0x94, 0xbb, 0xa0, 0x7f, 0xc0, 0x98, 0xad, 0xd4, 0x24, 0xd2, 0xc8, 0x12, 0x44, 0x63, 0xa5, - 0x22, 0xd7, 0x31, 0x55, 0xd9, 0x88, 0x30, 0xe0, 0x47, 0x63, 0x4a, 0x27, 0x0b, 0xc6, 0xcf, 0x1b, - 0x6c, 0x45, 0xae, 0x38, 0xe6, 0xb6, 0x1b, 0x72, 0x7d, 0x8d, 0x2d, 0x52, 0x9d, 0xe1, 0x3b, 0xfc, - 0x52, 0xaa, 0x60, 0x99, 0xcd, 0xf9, 0xe0, 0xe0, 0x52, 0xeb, 0x4b, 0xac, 0xe1, 0x9b, 0x16, 0x9d, - 0x77, 0x11, 0x99, 0x42, 0x76, 0xb3, 0x81, 0x3c, 0x4c, 0x93, 0x98, 0x8e, 0xba, 0x88, 0x2a, 0xa3, - 0xc1, 0x20, 0x4d, 0x68, 0x94, 0x14, 0x8e, 0x5c, 0x1c, 0x17, 0x16, 0xce, 0x17, 0x9e, 0xfa, 0xe4, - 0x41, 0xea, 0xc9, 0xa6, 0x83, 0x89, 0xa7, 0x00, 0x28, 0x17, 0x0b, 0x4f, 0x7d, 0x12, 0x58, 0x3d, - 0xd9, 0xed, 0x25, 0x7a, 0xba, 0xcb, 0xb6, 0xa4, 0x07, 0xc4, 0x26, 0x45, 0x3a, 0x61, 0xa4, 0x67, - 0xc5, 0x71, 0x7b, 0x99, 0x74, 0x04, 0x35, 0xd1, 0x34, 0x01, 0x06, 0x61, 0x7b, 0x45, 0xcd, 0x13, - 0xb9, 0x99, 0x22, 0x04, 0x89, 0x28, 0x23, 0xa9, 0xdb, 0xab, 0x64, 0x67, 0x40, 0x59, 0xa4, 0x9e, - 0x9e, 0x7e, 0x47, 0xb9, 0x01, 0x58, 0xb8, 0x38, 0xae, 0xd1, 0x78, 0x97, 0x6d, 0x90, 0x46, 0x44, - 0x99, 0x03, 0xa8, 0x2d, 0x8c, 0xd1, 0xde, 0x20, 0x23, 0x69, 0x65, 0x23, 0xe9, 0xdf, 0x66, 0x9b, - 0x62, 0x7d, 0x79, 0xc1, 0x66, 0xc5, 0x02, 0x90, 0x3b, 0xdf, 0xc0, 0x74, 0xd2, 0x10, 0x8e, 0x8d, - 0x00, 0x12, 0xb7, 0xaf, 0x61, 0x39, 0x61, 0x7c, 0x87, 0x6d, 0x20, 0x8e, 0xed, 0x84, 0xa1, 0x37, - 0x3e, 0x81, 0xb8, 0xf6, 0x87, 0x04, 0xef, 0x18, 0xe5, 0xb1, 0x78, 0x34, 0x31, 0x1d, 0x8a, 0xe5, - 0x59, 0x4a, 0x54, 0xbe, 0xae, 0x46, 0x45, 0xed, 0xf4, 0xb9, 0xc8, 0x6b, 0xc4, 0xeb, 0x88, 0xfb, - 0x3e, 0x78, 0xe8, 0xeb, 0x70, 0x88, 0x58, 0x81, 0x68, 0x92, 0x8a, 0x9f, 0x25, 0x4e, 0x30, 0x11, - 0x0a, 0xd2, 0x12, 0xb3, 0x9e, 0x40, 0x6e, 0x62, 0xb6, 0x3f, 0x1c, 0xee, 0xc7, 0x31, 0x16, 0x9c, - 0x48, 0xcf, 0xc5, 0xcf, 0x12, 0x23, 0x70, 0x30, 0x3e, 0x1c, 0x96, 0x98, 0xbc, 0x80, 0xd3, 0x09, - 0xe0, 0x45, 0xa5, 0xec, 0x24, 0x10, 0xdd, 0xfd, 0x34, 0x99, 0xe9, 0xbb, 0x00, 0x19, 0x22, 0xea, - 0x45, 0xf9, 0x03, 0xec, 0xe8, 0xd1, 0xec, 0x8f, 0x21, 0xc7, 0x90, 0x13, 0x2f, 0x1b, 0xdb, 0x20, - 0x53, 0xce, 0x6e, 0x1f, 0xdc, 0x25, 0x0c, 0xa1, 0x0e, 0x01, 0x6e, 0x3e, 0x40, 0x9a, 0x70, 0xa7, - 0xac, 0xe8, 0xc6, 0x21, 0x72, 0x20, 0x51, 0xc5, 0xfc, 0x6f, 0x9d, 0x2d, 0x15, 0x16, 0x23, 0x5c, - 0x65, 0xb2, 0xc3, 0x83, 0xc4, 0x75, 0x25, 0xfa, 0x0a, 0x32, 0xcd, 0xc3, 0xbf, 0xa1, 0x86, 0x72, - 0xa9, 0xe7, 0xa4, 0x98, 0x79, 0x71, 0xdf, 0x14, 0x48, 0xfa, 0x11, 0x6c, 0xde, 0x14, 0xc0, 0x34, - 0xaf, 0x46, 0x74, 0xd6, 0x52, 0xb0, 0xd4, 0x12, 0x63, 0x4f, 0x91, 0x0a, 0x31, 0x22, 0xce, 0x11, - 0x78, 0x8d, 0xcd, 0x07, 0x11, 0xa4, 0x11, 0x9f, 0x02, 0x8a, 0x86, 0x1e, 0xb1, 0x45, 0x4b, 0x69, - 0x0d, 0x22, 0x05, 0x7d, 0x6c, 0xb3, 0x3b, 0x53, 0xa5, 0x1d, 0xb6, 0xe2, 0xfa, 0xe8, 0x73, 0xe0, - 0xe2, 0x68, 0x04, 0x8a, 0x9b, 0xa5, 0x27, 0xcb, 0x45, 0x6a, 0xe8, 0x2c, 0xe6, 0x21, 0xa9, 0x40, - 0x41, 0x46, 0x51, 0x93, 0xe5, 0x2f, 0x10, 0x25, 0x4e, 0xc6, 0x1e, 0xa7, 0x60, 0xa1, 0x7d, 0xaf, - 0xb1, 0x25, 0x21, 0x0a, 0xa2, 0xa0, 0x43, 0xc1, 0x32, 0x87, 0xe3, 0xef, 0xb3, 0x55, 0x2e, 0xd5, - 0x4e, 0xd9, 0x9a, 0xb7, 0x75, 0x12, 0x6a, 0xa3, 0x3b, 0xc3, 0x30, 0x86, 0x01, 0x98, 0x85, 0xd9, - 0x3f, 0x88, 0x12, 0x1c, 0x8f, 0x51, 0x83, 0x31, 0x3c, 0x88, 0xae, 0x86, 0x2c, 0x65, 0xfc, 0x06, - 0xd3, 0xe4, 0xd2, 0x9e, 0x67, 0xb9, 0xa3, 0x1e, 0x14, 0xe1, 0x25, 0x7b, 0xd4, 0x94, 0xf2, 0xb1, - 0x40, 0x17, 0x4b, 0xeb, 0xaa, 0x4f, 0xc2, 0xd2, 0x03, 0x72, 0x72, 0x21, 0xb7, 0x10, 0x0a, 0x22, - 0xa5, 0xc0, 0x38, 0xe3, 0x63, 0x11, 0x60, 0xd4, 0x91, 0x1c, 0xf0, 0xe4, 0x35, 0x14, 0xa3, 0xd4, - 0x29, 0x00, 0x62, 0x87, 0x91, 0x0b, 0x6e, 0x1c, 0x9f, 0x71, 0x9e, 0x17, 0x73, 0x35, 0x2a, 0x5b, - 0xfe, 0xb0, 0xce, 0x6e, 0xcd, 0x5a, 0x55, 0xd9, 0xc6, 0x14, 0xfb, 0x27, 0x91, 0x78, 0x0a, 0x4d, - 0x97, 0x40, 0xe0, 0x8a, 0x0d, 0xe7, 0x28, 0x33, 0xdf, 0x80, 0xb0, 0xba, 0x0c, 0xc1, 0x7a, 0x23, - 0xc4, 0xfd, 0xac, 0xa0, 0x27, 0x9d, 0x43, 0x42, 0x1a, 0x40, 0xc1, 0x9d, 0xc2, 0x09, 0x55, 0x78, - 0x5d, 0x92, 0x6b, 0x35, 0xc1, 0xe8, 0x9b, 0xf1, 0x59, 0xf0, 0xc6, 0x3c, 0x83, 0x4c, 0x8a, 0x48, - 0x1e, 0xb9, 0xa1, 0x48, 0x32, 0xad, 0x42, 0xd5, 0x01, 0xa1, 0x54, 0xd8, 0x98, 0xdc, 0x6d, 0x19, - 0xf0, 0x65, 0x0d, 0x7c, 0xd9, 0x82, 0x13, 0x08, 0x9e, 0x68, 0x16, 0x72, 0xbb, 0x26, 0x6e, 0x89, - 0x1d, 0x68, 0x10, 0xa6, 0x9e, 0x15, 0xc9, 0xfe, 0x8f, 0x11, 0x58, 0x99, 0x42, 0x97, 0xaf, 0x43, - 0x10, 0x90, 0x3a, 0xbe, 0x13, 0x28, 0x4e, 0x46, 0x59, 0x3a, 0x8e, 0xa9, 0x9a, 0x23, 0x8d, 0x2c, - 0x53, 0x46, 0x24, 0xc6, 0x44, 0x32, 0xd1, 0x52, 0xb4, 0x54, 0x56, 0x16, 0x0b, 0xcc, 0x34, 0xf2, - 0x84, 0x8e, 0x8c, 0xfb, 0x10, 0xa3, 0xd4, 0x40, 0xee, 0x47, 0x51, 0x10, 0x21, 0x5f, 0x8e, 0x3f, - 0xcc, 0x84, 0x5f, 0x26, 0xb2, 0xf1, 0xbb, 0x2d, 0xaa, 0xde, 0x63, 0x70, 0x43, 0x28, 0x3a, 0x0f, - 0x55, 0x88, 0x1e, 0xf3, 0x01, 0x18, 0xe4, 0xcc, 0xe8, 0x42, 0xb1, 0x80, 0x65, 0x63, 0xe0, 0x7f, - 0x61, 0x45, 0x5f, 0x20, 0x82, 0x64, 0x59, 0x51, 0xf4, 0xbe, 0x13, 0x38, 0xb3, 0x68, 0xfc, 0x92, - 0x38, 0xd2, 0x31, 0x0f, 0x3d, 0xd7, 0x86, 0x53, 0x89, 0x85, 0xb1, 0x7e, 0x1f, 0xcd, 0xe7, 0x5f, - 0xc0, 0x4f, 0x58, 0x27, 0xa1, 0x7d, 0x92, 0xaf, 0xe1, 0x28, 0x49, 0xb0, 0xce, 0x7b, 0x1d, 0x42, - 0x39, 0xe3, 0x70, 0xe7, 0x34, 0xf8, 0x5e, 0x90, 0x9e, 0xa6, 0x7d, 0x52, 0xfb, 0x18, 0x72, 0x05, - 0xfc, 0xa4, 0x03, 0x8a, 0xdd, 0x01, 0xd6, 0xd5, 0xa0, 0xf2, 0xf0, 0x42, 0xc6, 0x86, 0xf3, 0xc6, - 0x80, 0xae, 0xd8, 0x58, 0xca, 0xb6, 0x6f, 0x0e, 0x0e, 0xb4, 0x25, 0x37, 0x8e, 0xd3, 0x11, 0x96, - 0x16, 0xfb, 0x97, 0x67, 0x16, 0x14, 0xc5, 0x80, 0x7b, 0x33, 0xae, 0x1b, 0x9a, 0xc6, 0x6f, 0xd7, - 0xc4, 0x89, 0x08, 0x1d, 0x6c, 0xac, 0xdd, 0xa1, 0x1a, 0x19, 0x02, 0x75, 0x45, 0x50, 0xe5, 0x20, - 0x57, 0x9f, 0x06, 0xb9, 0x86, 0x6a, 0x45, 0x15, 0x7a, 0x09, 0xd4, 0x43, 0xef, 0xb7, 0xa2, 0x0c, - 0xf3, 0xf0, 0x59, 0x02, 0x17, 0x21, 0x9e, 0xd1, 0x67, 0xd7, 0x45, 0xd5, 0x9f, 0x1c, 0x81, 0x51, - 0x38, 0x05, 0xff, 0x51, 0x10, 0x8b, 0xf2, 0x06, 0x43, 0x85, 0x32, 0x79, 0x51, 0x8a, 0x90, 0xe8, - 0x72, 0xf4, 0x85, 0x2d, 0x29, 0x9d, 0x67, 0xdd, 0x2f, 0x0c, 0xa8, 0xd4, 0x32, 0x47, 0x7a, 0xf9, - 0x3d, 0x79, 0xce, 0x93, 0x49, 0xf6, 0xb1, 0xbe, 0x2d, 0x2b, 0xbe, 0x50, 0x8d, 0x48, 0x03, 0x1a, - 0xdd, 0x59, 0xe4, 0xdd, 0xe2, 0xd3, 0x8d, 0x8f, 0xd8, 0xf2, 0x84, 0xac, 0x85, 0x5d, 0xb3, 0x06, - 0x57, 0xf1, 0x95, 0x79, 0x25, 0x81, 0xb3, 0xe6, 0xd0, 0x27, 0xcf, 0x8b, 0xad, 0x0a, 0x66, 0xcb, - 0x6b, 0x85, 0xb3, 0x12, 0xf9, 0xee, 0xdc, 0x8f, 0xfe, 0xee, 0x36, 0xde, 0x46, 0x14, 0x4e, 0xdc, - 0x28, 0x4c, 0x6c, 0xe6, 0xe7, 0x9e, 0x2b, 0x0c, 0x17, 0xe4, 0x68, 0xca, 0xec, 0x2c, 0xf0, 0x89, - 0x7b, 0xdc, 0x4e, 0xf2, 0x8d, 0x9f, 0x05, 0x51, 0x0f, 0xf7, 0xfb, 0x4a, 0x4a, 0x36, 0x9e, 0xb2, - 0xfb, 0x57, 0x31, 0x41, 0xc7, 0x1e, 0x93, 0x25, 0x52, 0x68, 0x80, 0x65, 0x6a, 0x5d, 0x30, 0x7e, - 0x8d, 0x6d, 0xc2, 0x81, 0xc5, 0x22, 0xee, 0xe4, 0xcb, 0xa0, 0x3a, 0x9e, 0x72, 0x30, 0x29, 0x7e, - 0x95, 0x1a, 0xd6, 0xa6, 0xd4, 0x60, 0x0c, 0xd8, 0x0d, 0x81, 0x00, 0x2f, 0xb1, 0xe5, 0x03, 0xe6, - 0x2f, 0x83, 0xc4, 0x1d, 0x60, 0x68, 0xa2, 0x3d, 0x00, 0x37, 0x30, 0xd8, 0x78, 0x24, 0x9a, 0xcc, - 0xe2, 0xd5, 0x45, 0x1e, 0x09, 0xe4, 0xb9, 0xf5, 0xac, 0x60, 0xc7, 0x71, 0x9f, 0xca, 0x4d, 0x6a, - 0x25, 0x25, 0xd2, 0xfc, 0x7d, 0x4d, 0xdd, 0x55, 0x89, 0x3e, 0x70, 0xcf, 0x8d, 0x91, 0xf3, 0xc4, - 0x6e, 0xef, 0xb1, 0x8e, 0x5f, 0x78, 0x86, 0x3e, 0x37, 0x81, 0x06, 0x8f, 0xae, 0xec, 0xdc, 0x1f, - 0x8a, 0xa1, 0x73, 0xae, 0xee, 0xd4, 0xb0, 0xb7, 0x2b, 0x12, 0xf7, 0x03, 0x67, 0x3c, 0x4d, 0x5b, - 0x57, 0xa9, 0x80, 0xa6, 0xe3, 0xb4, 0x2f, 0x1b, 0x1e, 0x98, 0xc3, 0x22, 0xa7, 0x01, 0x93, 0x50, - 0xc9, 0x96, 0x26, 0x09, 0xaf, 0xc4, 0x65, 0xd6, 0xa2, 0xf1, 0x51, 0x76, 0xcf, 0x07, 0xc0, 0x4f, - 0x59, 0xf5, 0xc8, 0xb5, 0xcf, 0xb9, 0xf3, 0x3a, 0xac, 0xd2, 0x8e, 0xf1, 0x5b, 0xec, 0x9e, 0x58, - 0x72, 0xe8, 0xdb, 0x11, 0xc7, 0x0c, 0xf3, 0xb9, 0xeb, 0x79, 0x3d, 0xb4, 0x54, 0x96, 0xd0, 0xee, - 0xb2, 0xb5, 0x73, 0x18, 0x84, 0xb5, 0x15, 0x36, 0xc4, 0x22, 0x2b, 0x1d, 0x99, 0x48, 0x14, 0x4b, - 0xed, 0x82, 0x93, 0x65, 0x6d, 0xa4, 0x88, 0x52, 0xc0, 0x18, 0xd1, 0x68, 0xe5, 0xd7, 0x96, 0xc6, - 0xbf, 0xd5, 0xb2, 0xee, 0x1b, 0xc5, 0xdd, 0x8b, 0x82, 0xf0, 0x18, 0x80, 0x76, 0x37, 0xf0, 0xd3, - 0xf8, 0x0a, 0x9f, 0xd9, 0xa2, 0x8c, 0x28, 0xfb, 0x57, 0xcc, 0x88, 0x5c, 0xe6, 0x8e, 0x75, 0xd6, - 0xec, 0xe3, 0x5a, 0xda, 0xb2, 0x2e, 0xa9, 0x01, 0x0a, 0x69, 0x50, 0x14, 0xd7, 0x12, 0xa6, 0xca, - 0x51, 0x33, 0x89, 0x6d, 0xf3, 0xaa, 0x6b, 0x8c, 0x39, 0x76, 0x67, 0xd0, 0x63, 0xf3, 0x41, 0x22, - 0xca, 0x33, 0x48, 0xc7, 0xcb, 0x7d, 0xe8, 0xcf, 0xa1, 0x9c, 0x12, 0x27, 0x59, 0xc8, 0x05, 0x33, - 0xde, 0x4c, 0x04, 0xfc, 0x73, 0x6e, 0x0d, 0x53, 0xfe, 0x05, 0xb4, 0xd4, 0x47, 0x18, 0x77, 0x57, - 0x9d, 0x67, 0xd1, 0x23, 0xda, 0x19, 0x41, 0x80, 0x52, 0x16, 0xab, 0x4a, 0x10, 0x0a, 0x6a, 0x75, - 0xe0, 0x11, 0x71, 0x2b, 0x06, 0xa4, 0x21, 0x94, 0x35, 0x5e, 0xb1, 0x6b, 0xc5, 0x22, 0x0b, 0x61, - 0xfb, 0x14, 0x4d, 0x9f, 0xcc, 0x84, 0x76, 0x30, 0x0e, 0x47, 0x92, 0x09, 0x4c, 0x55, 0xea, 0x10, - 0xa9, 0xe5, 0x5f, 0xf1, 0x42, 0x3b, 0xe7, 0x78, 0x1a, 0xa4, 0x11, 0x06, 0x8a, 0x9f, 0xe0, 0x51, - 0x42, 0x28, 0x08, 0xaa, 0x72, 0x46, 0xe9, 0x20, 0x53, 0x9c, 0xd1, 0x87, 0xb3, 0xf2, 0x51, 0xdd, - 0x24, 0x44, 0x19, 0xa8, 0x61, 0x58, 0x86, 0x72, 0x8b, 0x18, 0x02, 0x25, 0x1d, 0x9e, 0x25, 0x32, - 0x93, 0x00, 0x27, 0x55, 0x29, 0xcc, 0x4f, 0xa7, 0xa3, 0x96, 0xd2, 0x4e, 0xc4, 0xdf, 0x58, 0x91, - 0xe8, 0xb1, 0x65, 0xfd, 0x6c, 0xec, 0xb0, 0x6f, 0x4a, 0x27, 0x17, 0x88, 0x84, 0xb7, 0x1c, 0xf8, - 0x73, 0x97, 0xd8, 0x97, 0x51, 0xa4, 0x84, 0x16, 0xa2, 0x14, 0x7d, 0x4f, 0xa4, 0xad, 0xd2, 0xf5, - 0x75, 0x0f, 0x91, 0xdc, 0x2b, 0x5c, 0x54, 0x53, 0x26, 0x80, 0xba, 0xf2, 0x7e, 0x25, 0x71, 0x45, - 0x99, 0xb8, 0x62, 0x7c, 0x20, 0x4a, 0x86, 0xd2, 0xa2, 0x67, 0xa8, 0x27, 0xf7, 0x87, 0x7c, 0x6a, - 0x8f, 0x03, 0xd6, 0xb9, 0x82, 0xbc, 0x6a, 0x97, 0x2c, 0x2e, 0x5d, 0x07, 0x23, 0xb5, 0x01, 0x8c, - 0x0e, 0xd5, 0xbe, 0xbb, 0x96, 0xef, 0x73, 0xe7, 0xcb, 0x20, 0x72, 0x9e, 0xbb, 0x71, 0x22, 0x8b, - 0x28, 0xac, 0x30, 0xf1, 0xbe, 0x08, 0x2f, 0x99, 0xcc, 0x89, 0x1b, 0x5d, 0x32, 0xc8, 0x1b, 0xa0, - 0xce, 0x93, 0x46, 0x0a, 0xf5, 0x7a, 0x89, 0x55, 0x91, 0x48, 0xac, 0xda, 0x65, 0x8b, 0x34, 0x90, - 0x15, 0xeb, 0xab, 0x4f, 0xf4, 0xee, 0x41, 0xcf, 0xcc, 0xd7, 0x9c, 0xc2, 0xcc, 0xf6, 0x4d, 0x1c, - 0xda, 0x79, 0xf9, 0x72, 0x7f, 0xcf, 0xfc, 0xf2, 0xd5, 0xf1, 0x9e, 0xb9, 0x77, 0x78, 0xb2, 0xb3, - 0xfb, 0x7c, 0x9f, 0x1e, 0xb0, 0x6c, 0x43, 0x1e, 0x12, 0xaf, 0x4d, 0x91, 0xf0, 0xa6, 0x4f, 0x20, - 0x75, 0x70, 0xc5, 0x11, 0x1e, 0x48, 0x61, 0xe8, 0x0e, 0xad, 0x4e, 0xb5, 0xc0, 0x5a, 0xb7, 0xcc, - 0xcc, 0x78, 0xad, 0xec, 0x79, 0x1a, 0x94, 0x37, 0xc9, 0x5f, 0x43, 0x7c, 0xc8, 0x16, 0xfb, 0xea, - 0x41, 0x5e, 0x53, 0xde, 0xee, 0x5e, 0x25, 0x17, 0xb8, 0xc9, 0xdd, 0x2a, 0xb6, 0xa2, 0x8c, 0x9e, - 0xbe, 0x46, 0x5f, 0x31, 0x7e, 0x45, 0x61, 0x3c, 0x2e, 0xda, 0x73, 0xa3, 0x64, 0x7c, 0xb2, 0xf7, - 0xaa, 0x87, 0x37, 0x81, 0x74, 0x33, 0xec, 0x04, 0x85, 0x06, 0x0a, 0x63, 0x14, 0xb2, 0x87, 0x99, - 0x42, 0xf7, 0xf7, 0xe9, 0x53, 0xd9, 0x77, 0x1f, 0x14, 0x77, 0x25, 0x06, 0x2f, 0xc0, 0x3d, 0xdc, - 0xd0, 0xe3, 0x5f, 0x83, 0x11, 0x3a, 0xce, 0x67, 0x45, 0x46, 0x74, 0x17, 0xf0, 0xbc, 0x90, 0xd2, - 0xf6, 0xdc, 0xc1, 0x60, 0xe2, 0x65, 0x52, 0x4d, 0xf5, 0xee, 0x78, 0x87, 0x0a, 0xed, 0x8a, 0x03, - 0x04, 0xb2, 0xd0, 0xde, 0x56, 0xf1, 0x59, 0xc9, 0x29, 0xb3, 0xe5, 0x54, 0xc9, 0xf1, 0x99, 0xb8, - 0x23, 0x87, 0x5c, 0x1d, 0x78, 0xaa, 0x56, 0x01, 0x8c, 0xd6, 0x6d, 0xf1, 0x48, 0xf5, 0x72, 0xf9, - 0x56, 0x03, 0xd2, 0xe7, 0xf7, 0x61, 0xae, 0x74, 0x21, 0xb1, 0x21, 0xde, 0x1a, 0x81, 0x16, 0x5e, - 0x06, 0x2f, 0xf8, 0xc8, 0x46, 0x55, 0x38, 0xc6, 0xb7, 0x55, 0x78, 0xa0, 0x6c, 0xc2, 0x2c, 0x27, - 0xdf, 0x7d, 0xfe, 0x39, 0x1f, 0x8b, 0x06, 0x02, 0x4e, 0x88, 0x8a, 0xc9, 0x9b, 0x08, 0xe3, 0x17, - 0x27, 0x9c, 0x45, 0x79, 0x04, 0xd6, 0xe8, 0x81, 0x07, 0x2d, 0xc4, 0x68, 0x64, 0xf9, 0x54, 0x9e, - 0xdb, 0xf4, 0x5a, 0x89, 0x1e, 0xe5, 0xca, 0xa7, 0xaa, 0xbe, 0x11, 0xd7, 0xd6, 0x5f, 0x08, 0xb0, - 0x53, 0xae, 0x40, 0xd7, 0x54, 0x38, 0x3e, 0xd1, 0x8f, 0xae, 0xe4, 0xab, 0x44, 0xb1, 0x32, 0xbd, - 0xaa, 0xf4, 0x4a, 0x42, 0xac, 0xba, 0xc7, 0xee, 0xe4, 0x52, 0x7e, 0xc9, 0xfb, 0x3b, 0x47, 0x87, - 0xea, 0xee, 0xfb, 0x0c, 0x6f, 0x96, 0x1c, 0xf0, 0x93, 0x75, 0xd1, 0xc2, 0xe0, 0x8d, 0x22, 0xc8, - 0x0d, 0xfa, 0xc7, 0x3b, 0xf1, 0x19, 0xea, 0xcb, 0xf4, 0x9a, 0x5d, 0x47, 0x14, 0x0a, 0xad, 0x39, - 0x23, 0x10, 0x0a, 0x79, 0x96, 0x7a, 0x03, 0x28, 0x10, 0xf6, 0xc6, 0xa0, 0x2b, 0xd7, 0x2e, 0xb3, - 0x05, 0xe0, 0x4e, 0x82, 0xc0, 0x2b, 0xf1, 0x7c, 0x8a, 0x6f, 0x43, 0xb1, 0xb9, 0xa1, 0xd6, 0x15, - 0xd5, 0x25, 0xc8, 0x63, 0x19, 0xab, 0x1b, 0xdd, 0x19, 0x22, 0x1a, 0x9f, 0x42, 0xea, 0x2a, 0x68, - 0xe4, 0x85, 0x15, 0x41, 0x22, 0x14, 0x2d, 0xba, 0xc0, 0x34, 0x68, 0x61, 0xe9, 0xc5, 0x53, 0xd6, - 0x96, 0xd7, 0xd4, 0x6b, 0xb9, 0x9b, 0xb3, 0x17, 0xee, 0x63, 0xaf, 0x5e, 0x95, 0x1b, 0x66, 0xde, - 0x2e, 0x63, 0x9d, 0xa0, 0x8b, 0x26, 0x97, 0x7b, 0x1e, 0xe1, 0x0b, 0xbd, 0x28, 0x14, 0xb5, 0xd0, - 0x5d, 0xb6, 0x25, 0xda, 0xee, 0xe9, 0xd7, 0xbc, 0xa2, 0x30, 0x3a, 0x10, 0xaf, 0x30, 0xa6, 0x25, - 0xd1, 0x3f, 0x60, 0x2d, 0x18, 0x88, 0x5c, 0xae, 0x7a, 0x97, 0x5b, 0xdd, 0x2b, 0x64, 0x86, 0x8a, - 0x9c, 0x7a, 0xde, 0xfd, 0xcb, 0x24, 0xb2, 0xec, 0xe4, 0x00, 0x2f, 0x5a, 0x66, 0xab, 0x7a, 0xe6, - 0xb5, 0x21, 0x24, 0xeb, 0x55, 0x79, 0x05, 0x80, 0xc5, 0x44, 0x56, 0x8a, 0x6f, 0x37, 0x3f, 0xfd, - 0xe4, 0x93, 0x8f, 0x3f, 0x31, 0xfe, 0xbd, 0x2e, 0xd0, 0xa8, 0xc0, 0xbe, 0x18, 0xa9, 0x93, 0x3b, - 0x1c, 0xe1, 0x4d, 0xbf, 0x98, 0x94, 0xb8, 0xff, 0x6e, 0xb7, 0x62, 0x71, 0x77, 0xbf, 0x30, 0xb8, - 0xbd, 0x75, 0x6e, 0x16, 0x1e, 0xcd, 0x13, 0x8c, 0x7f, 0x0e, 0xfd, 0xb4, 0xf1, 0xf3, 0x1a, 0x5b, - 0x2e, 0x52, 0x42, 0xf1, 0x5c, 0x45, 0xab, 0x7d, 0x43, 0x7f, 0xc8, 0x8c, 0xc9, 0xc9, 0x67, 0xe2, - 0xdd, 0xec, 0x29, 0x28, 0xe3, 0x30, 0x3e, 0x84, 0x86, 0xde, 0x73, 0x1d, 0xad, 0x56, 0x49, 0x87, - 0xc8, 0x92, 0xd3, 0xd5, 0xf5, 0xf7, 0xd9, 0xa3, 0x4a, 0x7e, 0x90, 0xeb, 0xa1, 0xe2, 0x3f, 0xe6, - 0xa3, 0xe0, 0x82, 0xc3, 0x9c, 0xd6, 0x80, 0x1e, 0xe0, 0xe1, 0x4c, 0x6a, 0xf1, 0xef, 0x34, 0xc8, - 0x69, 0xe7, 0x8c, 0xe7, 0xe2, 0x6e, 0x6c, 0xc7, 0x71, 0x4e, 0x48, 0xef, 0x5f, 0xcb, 0x64, 0xa0, - 0xf7, 0x14, 0xaa, 0x5d, 0xf0, 0x45, 0xf9, 0x42, 0xf5, 0x1f, 0xea, 0xe2, 0x25, 0x6d, 0xc6, 0xae, - 0xda, 0x44, 0xb7, 0xd8, 0x46, 0x2a, 0x80, 0x23, 0xb3, 0xb8, 0x0c, 0xe4, 0x06, 0x78, 0xed, 0x77, - 0x0a, 0x06, 0x6c, 0x90, 0x01, 0xef, 0x77, 0x67, 0x32, 0xee, 0xee, 0x67, 0x43, 0xdb, 0x9b, 0xe7, - 0x66, 0xf6, 0x50, 0x30, 0xdd, 0xdf, 0xd6, 0x18, 0xcb, 0xa9, 0x20, 0x45, 0xcf, 0xa6, 0x03, 0xb3, - 0x3d, 0x60, 0xf7, 0x8a, 0x53, 0x15, 0x46, 0x7b, 0x8f, 0x7d, 0x73, 0x06, 0x15, 0x5d, 0xb7, 0x93, - 0x29, 0x76, 0xb9, 0x98, 0xe1, 0x68, 0xb9, 0x47, 0xec, 0xc1, 0x0c, 0x62, 0x65, 0x89, 0x6c, 0x42, - 0x6b, 0x18, 0x7b, 0xf2, 0xda, 0xdc, 0x71, 0x44, 0x15, 0x2c, 0x26, 0x28, 0x10, 0x01, 0xc2, 0x87, - 0x05, 0xe5, 0x67, 0x26, 0x29, 0x29, 0x0e, 0xa3, 0xf9, 0xd7, 0xe5, 0x7d, 0xf9, 0x24, 0x97, 0x29, - 0xfb, 0x09, 0x16, 0x1f, 0xb2, 0xd5, 0x21, 0xfa, 0x47, 0x12, 0x48, 0x1b, 0x48, 0xac, 0x6b, 0x77, - 0x2b, 0x24, 0x31, 0xfe, 0xa3, 0x21, 0x70, 0xab, 0x34, 0x97, 0x99, 0x79, 0xf6, 0x3e, 0x5f, 0xd7, - 0xd6, 0x0f, 0xba, 0x57, 0xec, 0x41, 0x16, 0x07, 0xe7, 0xdd, 0xd6, 0x49, 0xb1, 0xf0, 0xab, 0x60, - 0xeb, 0x7f, 0xaa, 0xb3, 0x96, 0x9c, 0x07, 0x0c, 0x9d, 0x41, 0x01, 0x56, 0xbe, 0xc7, 0x6e, 0x65, - 0xe3, 0xd2, 0x1e, 0x07, 0xc5, 0x70, 0xab, 0xe9, 0xf7, 0xd9, 0xed, 0x32, 0x45, 0x39, 0x22, 0x0d, - 0x76, 0xa7, 0x4c, 0x52, 0x30, 0xaa, 0x88, 0x43, 0xe5, 0x28, 0x45, 0x36, 0x82, 0x01, 0x8c, 0x60, - 0xe5, 0xf9, 0x2c, 0x88, 0xa4, 0xf9, 0xe7, 0xf4, 0x6f, 0xb1, 0x77, 0xdf, 0x4a, 0xfc, 0x19, 0x8f, - 0x02, 0xad, 0xf9, 0x95, 0x48, 0x4f, 0xbc, 0x20, 0xd1, 0xe6, 0xc1, 0xc2, 0xef, 0x97, 0x49, 0xc5, - 0x8e, 0x50, 0x24, 0x24, 0x96, 0xeb, 0xc7, 0xaf, 0xfd, 0x08, 0xd1, 0x00, 0x6f, 0xf4, 0x50, 0xe8, - 0x96, 0xf1, 0x0c, 0xda, 0x64, 0x4a, 0x74, 0x31, 0x4f, 0xe4, 0x9b, 0x20, 0x98, 0xa0, 0x2e, 0xbd, - 0xc2, 0xba, 0xb3, 0x1d, 0xf1, 0x1f, 0xeb, 0xa2, 0xdd, 0x9f, 0xc5, 0x28, 0x73, 0x97, 0x93, 0x82, - 0xe9, 0xc5, 0xe7, 0x01, 0xef, 0x75, 0xdf, 0xb6, 0xa8, 0xbb, 0x4f, 0xb3, 0xe8, 0x01, 0x1b, 0xe7, - 0xa6, 0xfa, 0x5d, 0xf0, 0x81, 0x7f, 0xae, 0xb1, 0xc5, 0x8c, 0x06, 0x9a, 0xbc, 0x99, 0x54, 0x0a, - 0xa4, 0xb3, 0x99, 0x29, 0x8c, 0x14, 0xe3, 0xe0, 0x0d, 0x1d, 0x76, 0x77, 0x9a, 0xae, 0xec, 0x0f, - 0xef, 0xb2, 0xfb, 0x33, 0x88, 0xc4, 0xb4, 0xd0, 0xf8, 0xa1, 0x03, 0x2e, 0x41, 0xa6, 0x2b, 0x93, - 0x49, 0x8b, 0x48, 0xf0, 0xa0, 0x59, 0x6d, 0xee, 0xf1, 0xff, 0x34, 0x00, 0xb6, 0xb0, 0x58, 0x8f, - 0x39, 0x68, 0x04, 0x72, 0x3c, 0xc0, 0xd6, 0xbe, 0xa8, 0xd9, 0xe8, 0xab, 0xa4, 0x17, 0xe2, 0x33, - 0x08, 0xed, 0xa7, 0x77, 0x21, 0x75, 0xb6, 0xd5, 0x5c, 0xf9, 0x06, 0x59, 0xfb, 0xd9, 0xdd, 0xe2, - 0x52, 0x31, 0x2a, 0x2b, 0x36, 0xed, 0x6f, 0x26, 0xe6, 0x26, 0x3e, 0x11, 0xd2, 0xfe, 0xa8, 0xa3, - 0xdf, 0x61, 0xd7, 0x27, 0xe6, 0x8a, 0x5f, 0xdd, 0x68, 0x7f, 0xdc, 0x81, 0x40, 0xba, 0xa9, 0xe6, - 0x67, 0x7c, 0x42, 0xa3, 0xfd, 0x49, 0xa7, 0xc8, 0x7d, 0xe2, 0xcb, 0x12, 0xed, 0x4f, 0x3b, 0x50, - 0xc4, 0xe9, 0x6a, 0x2e, 0xff, 0x9c, 0x44, 0xfb, 0xb3, 0x0e, 0xa0, 0xc5, 0x56, 0x76, 0xd2, 0xc9, - 0x8f, 0x2a, 0xb4, 0x1f, 0x77, 0x20, 0xf0, 0x6e, 0x67, 0x87, 0xa1, 0x32, 0x04, 0x8e, 0xe4, 0x43, - 0x89, 0x08, 0x30, 0x41, 0xc4, 0xda, 0x9f, 0x77, 0x20, 0x37, 0x5f, 0x53, 0x34, 0xf8, 0xa5, 0x85, - 0x98, 0x38, 0xf4, 0x07, 0x81, 0xf6, 0x17, 0x1d, 0xe8, 0x2f, 0x56, 0xd4, 0x24, 0x5d, 0xef, 0x6b, - 0x7f, 0xd9, 0x01, 0xeb, 0xdd, 0x2b, 0x2a, 0xd0, 0x1a, 0x9b, 0x53, 0x17, 0xe9, 0xda, 0x4f, 0x3a, - 0x50, 0x4b, 0xdd, 0xc8, 0x44, 0x9e, 0xfa, 0xe2, 0x43, 0xfb, 0xab, 0xce, 0x2c, 0x6d, 0xd2, 0xe7, - 0x3d, 0xda, 0x5f, 0x4f, 0x68, 0x6b, 0xc6, 0x27, 0x3f, 0xda, 0x4f, 0x3b, 0x8f, 0xbf, 0xc7, 0xb6, - 0xa4, 0xc1, 0x8f, 0xf0, 0x4b, 0xbf, 0x57, 0x54, 0xfa, 0x62, 0x3c, 0xc7, 0xd2, 0x14, 0x85, 0xe1, - 0x82, 0xc2, 0xb5, 0xff, 0x6a, 0x4d, 0xcf, 0x17, 0xb6, 0xd0, 0xfe, 0xbb, 0xf5, 0xf8, 0x3f, 0x1b, - 0xac, 0x5d, 0xf5, 0x6d, 0x8d, 0xac, 0x42, 0xde, 0xf2, 0xe5, 0x8d, 0x4a, 0x8f, 0x95, 0x74, 0xc7, - 0xdc, 0x72, 0xc6, 0x2a, 0x5c, 0x2a, 0xa9, 0x76, 0xd3, 0x78, 0x9c, 0x15, 0x34, 0x55, 0x44, 0x22, - 0x2e, 0x0e, 0xb8, 0xcf, 0xa1, 0x72, 0xd5, 0xb8, 0xfe, 0x84, 0x75, 0xdf, 0x4a, 0x7d, 0x88, 0x6f, - 0x1d, 0x7d, 0xcb, 0x13, 0x36, 0x1d, 0xe8, 0xbf, 0xc0, 0x3e, 0xbe, 0x52, 0x58, 0x2a, 0xcf, 0xc1, - 0xbe, 0xea, 0xa3, 0x21, 0xc8, 0xf2, 0xaf, 0x3c, 0x47, 0x1b, 0xfe, 0x7f, 0x16, 0xbe, 0xe4, 0x6f, - 0xb4, 0x33, 0x59, 0x76, 0x55, 0x2d, 0xec, 0x1d, 0xf7, 0x5e, 0xb8, 0xf1, 0xc8, 0x4a, 0xec, 0x33, - 0xcd, 0x7d, 0x0b, 0xad, 0x38, 0xd1, 0x09, 0xde, 0x9e, 0x6a, 0xdf, 0x87, 0x32, 0xfc, 0x5b, 0x6f, - 0xa5, 0x15, 0x17, 0x3e, 0x10, 0x96, 0xe7, 0x8f, 0x4f, 0xd9, 0xda, 0xd4, 0x15, 0x07, 0x78, 0xee, - 0x55, 0x97, 0x1c, 0x60, 0xdb, 0x3b, 0xec, 0x46, 0x89, 0x60, 0xff, 0x65, 0x3e, 0x5f, 0xdb, 0x6d, - 0x7e, 0x56, 0xfb, 0x51, 0xed, 0x1b, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xde, 0x29, 0x50, 0xc3, - 0xa9, 0x2a, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client.pb.go deleted file mode 100644 index 8677b820..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client.pb.go +++ /dev/null @@ -1,18413 +0,0 @@ -// Code generated by protoc-gen-go. -// source: dota_gcmessages_client.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type EMatchGroupServerStatus int32 - -const ( - EMatchGroupServerStatus_k_EMatchGroupServerStatus_OK EMatchGroupServerStatus = 0 - EMatchGroupServerStatus_k_EMatchGroupServerStatus_LimitedAvailability EMatchGroupServerStatus = 1 - EMatchGroupServerStatus_k_EMatchGroupServerStatus_Offline EMatchGroupServerStatus = 2 -) - -var EMatchGroupServerStatus_name = map[int32]string{ - 0: "k_EMatchGroupServerStatus_OK", - 1: "k_EMatchGroupServerStatus_LimitedAvailability", - 2: "k_EMatchGroupServerStatus_Offline", -} -var EMatchGroupServerStatus_value = map[string]int32{ - "k_EMatchGroupServerStatus_OK": 0, - "k_EMatchGroupServerStatus_LimitedAvailability": 1, - "k_EMatchGroupServerStatus_Offline": 2, -} - -func (x EMatchGroupServerStatus) Enum() *EMatchGroupServerStatus { - p := new(EMatchGroupServerStatus) - *p = x - return p -} -func (x EMatchGroupServerStatus) String() string { - return proto.EnumName(EMatchGroupServerStatus_name, int32(x)) -} -func (x *EMatchGroupServerStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EMatchGroupServerStatus_value, data, "EMatchGroupServerStatus") - if err != nil { - return err - } - *x = EMatchGroupServerStatus(value) - return nil -} -func (EMatchGroupServerStatus) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{0} } - -type DOTA_WatchReplayType int32 - -const ( - DOTA_WatchReplayType_DOTA_WATCH_REPLAY_NORMAL DOTA_WatchReplayType = 0 - DOTA_WatchReplayType_DOTA_WATCH_REPLAY_HIGHLIGHTS DOTA_WatchReplayType = 1 -) - -var DOTA_WatchReplayType_name = map[int32]string{ - 0: "DOTA_WATCH_REPLAY_NORMAL", - 1: "DOTA_WATCH_REPLAY_HIGHLIGHTS", -} -var DOTA_WatchReplayType_value = map[string]int32{ - "DOTA_WATCH_REPLAY_NORMAL": 0, - "DOTA_WATCH_REPLAY_HIGHLIGHTS": 1, -} - -func (x DOTA_WatchReplayType) Enum() *DOTA_WatchReplayType { - p := new(DOTA_WatchReplayType) - *p = x - return p -} -func (x DOTA_WatchReplayType) String() string { - return proto.EnumName(DOTA_WatchReplayType_name, int32(x)) -} -func (x *DOTA_WatchReplayType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_WatchReplayType_value, data, "DOTA_WatchReplayType") - if err != nil { - return err - } - *x = DOTA_WatchReplayType(value) - return nil -} -func (DOTA_WatchReplayType) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{1} } - -type EItemEditorReservationResult int32 - -const ( - EItemEditorReservationResult_k_EItemEditorReservationResult_OK EItemEditorReservationResult = 1 - EItemEditorReservationResult_k_EItemEditorReservationResult_AlreadyExists EItemEditorReservationResult = 2 - EItemEditorReservationResult_k_EItemEditorReservationResult_Reserved EItemEditorReservationResult = 3 - EItemEditorReservationResult_k_EItemEditorReservationResult_TimedOut EItemEditorReservationResult = 4 -) - -var EItemEditorReservationResult_name = map[int32]string{ - 1: "k_EItemEditorReservationResult_OK", - 2: "k_EItemEditorReservationResult_AlreadyExists", - 3: "k_EItemEditorReservationResult_Reserved", - 4: "k_EItemEditorReservationResult_TimedOut", -} -var EItemEditorReservationResult_value = map[string]int32{ - "k_EItemEditorReservationResult_OK": 1, - "k_EItemEditorReservationResult_AlreadyExists": 2, - "k_EItemEditorReservationResult_Reserved": 3, - "k_EItemEditorReservationResult_TimedOut": 4, -} - -func (x EItemEditorReservationResult) Enum() *EItemEditorReservationResult { - p := new(EItemEditorReservationResult) - *p = x - return p -} -func (x EItemEditorReservationResult) String() string { - return proto.EnumName(EItemEditorReservationResult_name, int32(x)) -} -func (x *EItemEditorReservationResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EItemEditorReservationResult_value, data, "EItemEditorReservationResult") - if err != nil { - return err - } - *x = EItemEditorReservationResult(value) - return nil -} -func (EItemEditorReservationResult) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{2} } - -type EProfileCardSlotType int32 - -const ( - EProfileCardSlotType_k_EProfileCardSlotType_Empty EProfileCardSlotType = 0 - EProfileCardSlotType_k_EProfileCardSlotType_Stat EProfileCardSlotType = 1 - EProfileCardSlotType_k_EProfileCardSlotType_Trophy EProfileCardSlotType = 2 - EProfileCardSlotType_k_EProfileCardSlotType_Item EProfileCardSlotType = 3 - EProfileCardSlotType_k_EProfileCardSlotType_Hero EProfileCardSlotType = 4 - EProfileCardSlotType_k_EProfileCardSlotType_Emoticon EProfileCardSlotType = 5 -) - -var EProfileCardSlotType_name = map[int32]string{ - 0: "k_EProfileCardSlotType_Empty", - 1: "k_EProfileCardSlotType_Stat", - 2: "k_EProfileCardSlotType_Trophy", - 3: "k_EProfileCardSlotType_Item", - 4: "k_EProfileCardSlotType_Hero", - 5: "k_EProfileCardSlotType_Emoticon", -} -var EProfileCardSlotType_value = map[string]int32{ - "k_EProfileCardSlotType_Empty": 0, - "k_EProfileCardSlotType_Stat": 1, - "k_EProfileCardSlotType_Trophy": 2, - "k_EProfileCardSlotType_Item": 3, - "k_EProfileCardSlotType_Hero": 4, - "k_EProfileCardSlotType_Emoticon": 5, -} - -func (x EProfileCardSlotType) Enum() *EProfileCardSlotType { - p := new(EProfileCardSlotType) - *p = x - return p -} -func (x EProfileCardSlotType) String() string { - return proto.EnumName(EProfileCardSlotType_name, int32(x)) -} -func (x *EProfileCardSlotType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EProfileCardSlotType_value, data, "EProfileCardSlotType") - if err != nil { - return err - } - *x = EProfileCardSlotType(value) - return nil -} -func (EProfileCardSlotType) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{3} } - -type EFeaturedHeroTextField int32 - -const ( - EFeaturedHeroTextField_k_EFeaturedHeroTextField_NewHero EFeaturedHeroTextField = 0 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_NewItem EFeaturedHeroTextField = 1 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_ItemSetDescription EFeaturedHeroTextField = 2 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_ItemDescription EFeaturedHeroTextField = 3 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_Hype EFeaturedHeroTextField = 4 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_HeroWinLoss EFeaturedHeroTextField = 5 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_FrequentlyPlayedHero EFeaturedHeroTextField = 6 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_FeaturedItem EFeaturedHeroTextField = 7 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_PopularItem EFeaturedHeroTextField = 8 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_SaleItem EFeaturedHeroTextField = 9 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_SaleDiscount EFeaturedHeroTextField = 10 - EFeaturedHeroTextField_k_EFeaturedHeroTextField_Container EFeaturedHeroTextField = 11 -) - -var EFeaturedHeroTextField_name = map[int32]string{ - 0: "k_EFeaturedHeroTextField_NewHero", - 1: "k_EFeaturedHeroTextField_NewItem", - 2: "k_EFeaturedHeroTextField_ItemSetDescription", - 3: "k_EFeaturedHeroTextField_ItemDescription", - 4: "k_EFeaturedHeroTextField_Hype", - 5: "k_EFeaturedHeroTextField_HeroWinLoss", - 6: "k_EFeaturedHeroTextField_FrequentlyPlayedHero", - 7: "k_EFeaturedHeroTextField_FeaturedItem", - 8: "k_EFeaturedHeroTextField_PopularItem", - 9: "k_EFeaturedHeroTextField_SaleItem", - 10: "k_EFeaturedHeroTextField_SaleDiscount", - 11: "k_EFeaturedHeroTextField_Container", -} -var EFeaturedHeroTextField_value = map[string]int32{ - "k_EFeaturedHeroTextField_NewHero": 0, - "k_EFeaturedHeroTextField_NewItem": 1, - "k_EFeaturedHeroTextField_ItemSetDescription": 2, - "k_EFeaturedHeroTextField_ItemDescription": 3, - "k_EFeaturedHeroTextField_Hype": 4, - "k_EFeaturedHeroTextField_HeroWinLoss": 5, - "k_EFeaturedHeroTextField_FrequentlyPlayedHero": 6, - "k_EFeaturedHeroTextField_FeaturedItem": 7, - "k_EFeaturedHeroTextField_PopularItem": 8, - "k_EFeaturedHeroTextField_SaleItem": 9, - "k_EFeaturedHeroTextField_SaleDiscount": 10, - "k_EFeaturedHeroTextField_Container": 11, -} - -func (x EFeaturedHeroTextField) Enum() *EFeaturedHeroTextField { - p := new(EFeaturedHeroTextField) - *p = x - return p -} -func (x EFeaturedHeroTextField) String() string { - return proto.EnumName(EFeaturedHeroTextField_name, int32(x)) -} -func (x *EFeaturedHeroTextField) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EFeaturedHeroTextField_value, data, "EFeaturedHeroTextField") - if err != nil { - return err - } - *x = EFeaturedHeroTextField(value) - return nil -} -func (EFeaturedHeroTextField) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{4} } - -type EFeaturedHeroDataType int32 - -const ( - EFeaturedHeroDataType_k_EFeaturedHeroDataType_HeroID EFeaturedHeroDataType = 0 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_ItemDef EFeaturedHeroDataType = 1 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_HypeString EFeaturedHeroDataType = 2 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_StartTimestamp EFeaturedHeroDataType = 3 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_ExpireTimestamp EFeaturedHeroDataType = 4 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_HeroWins EFeaturedHeroDataType = 5 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_HeroLosses EFeaturedHeroDataType = 6 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_SaleDiscount EFeaturedHeroDataType = 7 - EFeaturedHeroDataType_k_EFeaturedHeroDataType_ContainerItemDef EFeaturedHeroDataType = 8 -) - -var EFeaturedHeroDataType_name = map[int32]string{ - 0: "k_EFeaturedHeroDataType_HeroID", - 1: "k_EFeaturedHeroDataType_ItemDef", - 2: "k_EFeaturedHeroDataType_HypeString", - 3: "k_EFeaturedHeroDataType_StartTimestamp", - 4: "k_EFeaturedHeroDataType_ExpireTimestamp", - 5: "k_EFeaturedHeroDataType_HeroWins", - 6: "k_EFeaturedHeroDataType_HeroLosses", - 7: "k_EFeaturedHeroDataType_SaleDiscount", - 8: "k_EFeaturedHeroDataType_ContainerItemDef", -} -var EFeaturedHeroDataType_value = map[string]int32{ - "k_EFeaturedHeroDataType_HeroID": 0, - "k_EFeaturedHeroDataType_ItemDef": 1, - "k_EFeaturedHeroDataType_HypeString": 2, - "k_EFeaturedHeroDataType_StartTimestamp": 3, - "k_EFeaturedHeroDataType_ExpireTimestamp": 4, - "k_EFeaturedHeroDataType_HeroWins": 5, - "k_EFeaturedHeroDataType_HeroLosses": 6, - "k_EFeaturedHeroDataType_SaleDiscount": 7, - "k_EFeaturedHeroDataType_ContainerItemDef": 8, -} - -func (x EFeaturedHeroDataType) Enum() *EFeaturedHeroDataType { - p := new(EFeaturedHeroDataType) - *p = x - return p -} -func (x EFeaturedHeroDataType) String() string { - return proto.EnumName(EFeaturedHeroDataType_name, int32(x)) -} -func (x *EFeaturedHeroDataType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EFeaturedHeroDataType_value, data, "EFeaturedHeroDataType") - if err != nil { - return err - } - *x = EFeaturedHeroDataType(value) - return nil -} -func (EFeaturedHeroDataType) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{5} } - -type EDOTAGroupMergeResult int32 - -const ( - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_OK EDOTAGroupMergeResult = 0 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_FAILED_GENERIC EDOTAGroupMergeResult = 1 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_NOT_LEADER EDOTAGroupMergeResult = 2 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_TOO_MANY_PLAYERS EDOTAGroupMergeResult = 3 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_TOO_MANY_COACHES EDOTAGroupMergeResult = 4 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_ENGINE_MISMATCH EDOTAGroupMergeResult = 5 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_NO_SUCH_GROUP EDOTAGroupMergeResult = 6 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_OTHER_GROUP_NOT_OPEN EDOTAGroupMergeResult = 7 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_ALREADY_INVITED EDOTAGroupMergeResult = 8 - EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_NOT_INVITED EDOTAGroupMergeResult = 9 -) - -var EDOTAGroupMergeResult_name = map[int32]string{ - 0: "k_EDOTAGroupMergeResult_OK", - 1: "k_EDOTAGroupMergeResult_FAILED_GENERIC", - 2: "k_EDOTAGroupMergeResult_NOT_LEADER", - 3: "k_EDOTAGroupMergeResult_TOO_MANY_PLAYERS", - 4: "k_EDOTAGroupMergeResult_TOO_MANY_COACHES", - 5: "k_EDOTAGroupMergeResult_ENGINE_MISMATCH", - 6: "k_EDOTAGroupMergeResult_NO_SUCH_GROUP", - 7: "k_EDOTAGroupMergeResult_OTHER_GROUP_NOT_OPEN", - 8: "k_EDOTAGroupMergeResult_ALREADY_INVITED", - 9: "k_EDOTAGroupMergeResult_NOT_INVITED", -} -var EDOTAGroupMergeResult_value = map[string]int32{ - "k_EDOTAGroupMergeResult_OK": 0, - "k_EDOTAGroupMergeResult_FAILED_GENERIC": 1, - "k_EDOTAGroupMergeResult_NOT_LEADER": 2, - "k_EDOTAGroupMergeResult_TOO_MANY_PLAYERS": 3, - "k_EDOTAGroupMergeResult_TOO_MANY_COACHES": 4, - "k_EDOTAGroupMergeResult_ENGINE_MISMATCH": 5, - "k_EDOTAGroupMergeResult_NO_SUCH_GROUP": 6, - "k_EDOTAGroupMergeResult_OTHER_GROUP_NOT_OPEN": 7, - "k_EDOTAGroupMergeResult_ALREADY_INVITED": 8, - "k_EDOTAGroupMergeResult_NOT_INVITED": 9, -} - -func (x EDOTAGroupMergeResult) Enum() *EDOTAGroupMergeResult { - p := new(EDOTAGroupMergeResult) - *p = x - return p -} -func (x EDOTAGroupMergeResult) String() string { - return proto.EnumName(EDOTAGroupMergeResult_name, int32(x)) -} -func (x *EDOTAGroupMergeResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EDOTAGroupMergeResult_value, data, "EDOTAGroupMergeResult") - if err != nil { - return err - } - *x = EDOTAGroupMergeResult(value) - return nil -} -func (EDOTAGroupMergeResult) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{6} } - -type CMsgDOTAMatch_ReplayState int32 - -const ( - CMsgDOTAMatch_REPLAY_AVAILABLE CMsgDOTAMatch_ReplayState = 0 - CMsgDOTAMatch_REPLAY_NOT_RECORDED CMsgDOTAMatch_ReplayState = 1 - CMsgDOTAMatch_REPLAY_EXPIRED CMsgDOTAMatch_ReplayState = 2 -) - -var CMsgDOTAMatch_ReplayState_name = map[int32]string{ - 0: "REPLAY_AVAILABLE", - 1: "REPLAY_NOT_RECORDED", - 2: "REPLAY_EXPIRED", -} -var CMsgDOTAMatch_ReplayState_value = map[string]int32{ - "REPLAY_AVAILABLE": 0, - "REPLAY_NOT_RECORDED": 1, - "REPLAY_EXPIRED": 2, -} - -func (x CMsgDOTAMatch_ReplayState) Enum() *CMsgDOTAMatch_ReplayState { - p := new(CMsgDOTAMatch_ReplayState) - *p = x - return p -} -func (x CMsgDOTAMatch_ReplayState) String() string { - return proto.EnumName(CMsgDOTAMatch_ReplayState_name, int32(x)) -} -func (x *CMsgDOTAMatch_ReplayState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAMatch_ReplayState_value, data, "CMsgDOTAMatch_ReplayState") - if err != nil { - return err - } - *x = CMsgDOTAMatch_ReplayState(value) - return nil -} -func (CMsgDOTAMatch_ReplayState) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{58, 0} -} - -type CMsgDOTARequestMatches_SkillLevel int32 - -const ( - CMsgDOTARequestMatches_Any CMsgDOTARequestMatches_SkillLevel = 0 - CMsgDOTARequestMatches_Normal CMsgDOTARequestMatches_SkillLevel = 1 - CMsgDOTARequestMatches_High CMsgDOTARequestMatches_SkillLevel = 2 - CMsgDOTARequestMatches_VeryHigh CMsgDOTARequestMatches_SkillLevel = 3 -) - -var CMsgDOTARequestMatches_SkillLevel_name = map[int32]string{ - 0: "Any", - 1: "Normal", - 2: "High", - 3: "VeryHigh", -} -var CMsgDOTARequestMatches_SkillLevel_value = map[string]int32{ - "Any": 0, - "Normal": 1, - "High": 2, - "VeryHigh": 3, -} - -func (x CMsgDOTARequestMatches_SkillLevel) Enum() *CMsgDOTARequestMatches_SkillLevel { - p := new(CMsgDOTARequestMatches_SkillLevel) - *p = x - return p -} -func (x CMsgDOTARequestMatches_SkillLevel) String() string { - return proto.EnumName(CMsgDOTARequestMatches_SkillLevel_name, int32(x)) -} -func (x *CMsgDOTARequestMatches_SkillLevel) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTARequestMatches_SkillLevel_value, data, "CMsgDOTARequestMatches_SkillLevel") - if err != nil { - return err - } - *x = CMsgDOTARequestMatches_SkillLevel(value) - return nil -} -func (CMsgDOTARequestMatches_SkillLevel) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{62, 0} -} - -type CMsgDOTAPopup_PopupID int32 - -const ( - CMsgDOTAPopup_KICKED_FROM_LOBBY CMsgDOTAPopup_PopupID = 0 - CMsgDOTAPopup_KICKED_FROM_PARTY CMsgDOTAPopup_PopupID = 1 - CMsgDOTAPopup_KICKED_FROM_TEAM CMsgDOTAPopup_PopupID = 2 - CMsgDOTAPopup_TEAM_WAS_DISBANDED CMsgDOTAPopup_PopupID = 3 - CMsgDOTAPopup_TEAM_MATCHMAKE_ALREADY_MATCH CMsgDOTAPopup_PopupID = 4 - CMsgDOTAPopup_TEAM_MATCHMAKE_ALREADY_FINDING CMsgDOTAPopup_PopupID = 5 - CMsgDOTAPopup_TEAM_MATCHMAKE_FULL CMsgDOTAPopup_PopupID = 6 - CMsgDOTAPopup_TEAM_MATCHMAKE_FAIL_ADD CMsgDOTAPopup_PopupID = 7 - CMsgDOTAPopup_TEAM_MATCHMAKE_FAIL_ADD_CURRENT CMsgDOTAPopup_PopupID = 8 - CMsgDOTAPopup_TEAM_MATCHMAKE_FAILED_TEAM_MEMBER CMsgDOTAPopup_PopupID = 9 - CMsgDOTAPopup_TEAM_MATCHMAKE_ALREADY_GAME CMsgDOTAPopup_PopupID = 10 - CMsgDOTAPopup_TEAM_MATCHMAKE_FAIL_GET_PARTY CMsgDOTAPopup_PopupID = 11 - CMsgDOTAPopup_MATCHMAKING_DISABLED CMsgDOTAPopup_PopupID = 12 - CMsgDOTAPopup_INVITE_DENIED CMsgDOTAPopup_PopupID = 13 - CMsgDOTAPopup_PARTY_FULL CMsgDOTAPopup_PopupID = 14 - CMsgDOTAPopup_MADE_ADMIN CMsgDOTAPopup_PopupID = 15 - CMsgDOTAPopup_NEED_TO_PURCHASE CMsgDOTAPopup_PopupID = 16 - CMsgDOTAPopup_SIGNON_MESSAGE CMsgDOTAPopup_PopupID = 17 - CMsgDOTAPopup_GUILD_KICKED CMsgDOTAPopup_PopupID = 18 - CMsgDOTAPopup_MATCHMAKING_REGION_OFFLINE CMsgDOTAPopup_PopupID = 19 - CMsgDOTAPopup_TOO_MANY_MATCHGROUPS CMsgDOTAPopup_PopupID = 20 - CMsgDOTAPopup_TOURNAMENT_GAME_NOT_FOUND CMsgDOTAPopup_PopupID = 21 - CMsgDOTAPopup_TOURNAMENT_GAME_HAS_LOBBY_ID CMsgDOTAPopup_PopupID = 22 - CMsgDOTAPopup_TOURNAMENT_GAME_HAS_MATCH_ID CMsgDOTAPopup_PopupID = 23 - CMsgDOTAPopup_TOURNAMENT_GAME_HAS_NO_RADIANT_TEAM CMsgDOTAPopup_PopupID = 24 - CMsgDOTAPopup_TOURNAMENT_GAME_HAS_NO_DIRE_TEAM CMsgDOTAPopup_PopupID = 25 - CMsgDOTAPopup_TOURNAMENT_GAME_SQL_UPDATE_FAILED CMsgDOTAPopup_PopupID = 26 - CMsgDOTAPopup_NOT_LEAGUE_ADMIN CMsgDOTAPopup_PopupID = 27 - CMsgDOTAPopup_PARTY_NOT_VALID_TO_MM CMsgDOTAPopup_PopupID = 28 - CMsgDOTAPopup_PARTY_NOT_VALID_TO_MM_COACHCOUNT CMsgDOTAPopup_PopupID = 29 - CMsgDOTAPopup_PARTY_MEMBER_IN_ANOTHER_GAME CMsgDOTAPopup_PopupID = 30 - CMsgDOTAPopup_PARTY_MEMBER_IN_LOW_PRIORITY CMsgDOTAPopup_PopupID = 31 - CMsgDOTAPopup_CLIENT_OUT_OF_DATE CMsgDOTAPopup_PopupID = 32 - CMsgDOTAPopup_COMPETITIVE_MM_NO_COACHES CMsgDOTAPopup_PopupID = 33 - CMsgDOTAPopup_COMPETITIVE_MM_NO_LOW_PRIORITY CMsgDOTAPopup_PopupID = 34 - CMsgDOTAPopup_COMPETITIVE_MM_NOT_UNLOCKED CMsgDOTAPopup_PopupID = 35 - CMsgDOTAPopup_COMPETITIVE_MM_GAME_MODE_NOT_ALLOWED CMsgDOTAPopup_PopupID = 36 - CMsgDOTAPopup_GAME_MODE_NOT_UNLOCKED CMsgDOTAPopup_PopupID = 37 - CMsgDOTAPopup_SAVE_GAME_CORRUPT CMsgDOTAPopup_PopupID = 38 - CMsgDOTAPopup_INSUFFICIENT_INGOTS CMsgDOTAPopup_PopupID = 39 - CMsgDOTAPopup_COMPETITIVE_MM_NO_4STACKS CMsgDOTAPopup_PopupID = 40 - CMsgDOTAPopup_COMPETITIVE_MM_PARTY_MMR_SPREAD_TOO_LARGE CMsgDOTAPopup_PopupID = 41 - CMsgDOTAPopup_COMPETITIVE_MM_NOT_ENOUGH_SKILL_DATA_PLAY_MORE_CASUAL CMsgDOTAPopup_PopupID = 42 - CMsgDOTAPopup_COMPETITIVE_MM_NOT_ENOUGH_SKILL_DATA_IN_PARTY CMsgDOTAPopup_PopupID = 43 - CMsgDOTAPopup_PARTY_LEADER_JOINED_LOBBY CMsgDOTAPopup_PopupID = 44 - CMsgDOTAPopup_MM_1V1_NO_PARTIES CMsgDOTAPopup_PopupID = 45 - CMsgDOTAPopup_MM_1V1_NO_LOW_PRIORITY CMsgDOTAPopup_PopupID = 46 - CMsgDOTAPopup_WEEKEND_TOURNEY_REGISTRATION_NOT_OPEN CMsgDOTAPopup_PopupID = 47 - CMsgDOTAPopup_WEEKEND_TOURNEY_UNMATCHED CMsgDOTAPopup_PopupID = 48 - CMsgDOTAPopup_POST_MATCH_SURVEY CMsgDOTAPopup_PopupID = 49 - CMsgDOTAPopup_TROPHY_AWARDED CMsgDOTAPopup_PopupID = 50 - CMsgDOTAPopup_TROPHY_LEVEL_UP CMsgDOTAPopup_PopupID = 51 - CMsgDOTAPopup_ALL_HERO_CHALLENGE_PROGRESS CMsgDOTAPopup_PopupID = 52 - CMsgDOTAPopup_NEED_INITIAL_SKILL CMsgDOTAPopup_PopupID = 53 - CMsgDOTAPopup_NEED_INITIAL_SKILL_IN_PARTY CMsgDOTAPopup_PopupID = 54 - CMsgDOTAPopup_TARGET_ENGINE_MISMATCH CMsgDOTAPopup_PopupID = 55 - CMsgDOTAPopup_VAC_NOT_VERIFIED CMsgDOTAPopup_PopupID = 56 - CMsgDOTAPopup_KICKED_FROM_QUEUE_EVENT_STARTING CMsgDOTAPopup_PopupID = 57 - CMsgDOTAPopup_KICKED_FROM_QUEUE_EVENT_ENDING CMsgDOTAPopup_PopupID = 58 - CMsgDOTAPopup_EVENT_NO_LOW_PRIORITY CMsgDOTAPopup_PopupID = 59 - CMsgDOTAPopup_MM_LOW_PRI_ONLY_CASUAL_AR CMsgDOTAPopup_PopupID = 60 - CMsgDOTAPopup_CNY2015_ONCE_PER_ROUND CMsgDOTAPopup_PopupID = 61 - CMsgDOTAPopup_LOBBY_FULL CMsgDOTAPopup_PopupID = 62 - CMsgDOTAPopup_EVENT_POINTS_EARNED CMsgDOTAPopup_PopupID = 63 - CMsgDOTAPopup_CUSTOM_GAME_INCORRECT_VERSION CMsgDOTAPopup_PopupID = 64 - CMsgDOTAPopup_COMPETITIVE_MM_MMR_TOO_HIGH_S2 CMsgDOTAPopup_PopupID = 65 - CMsgDOTAPopup_LIMITED_USER_CHAT CMsgDOTAPopup_PopupID = 66 - CMsgDOTAPopup_EVENT_PREMIUM_POINTS_EARNED CMsgDOTAPopup_PopupID = 67 -) - -var CMsgDOTAPopup_PopupID_name = map[int32]string{ - 0: "KICKED_FROM_LOBBY", - 1: "KICKED_FROM_PARTY", - 2: "KICKED_FROM_TEAM", - 3: "TEAM_WAS_DISBANDED", - 4: "TEAM_MATCHMAKE_ALREADY_MATCH", - 5: "TEAM_MATCHMAKE_ALREADY_FINDING", - 6: "TEAM_MATCHMAKE_FULL", - 7: "TEAM_MATCHMAKE_FAIL_ADD", - 8: "TEAM_MATCHMAKE_FAIL_ADD_CURRENT", - 9: "TEAM_MATCHMAKE_FAILED_TEAM_MEMBER", - 10: "TEAM_MATCHMAKE_ALREADY_GAME", - 11: "TEAM_MATCHMAKE_FAIL_GET_PARTY", - 12: "MATCHMAKING_DISABLED", - 13: "INVITE_DENIED", - 14: "PARTY_FULL", - 15: "MADE_ADMIN", - 16: "NEED_TO_PURCHASE", - 17: "SIGNON_MESSAGE", - 18: "GUILD_KICKED", - 19: "MATCHMAKING_REGION_OFFLINE", - 20: "TOO_MANY_MATCHGROUPS", - 21: "TOURNAMENT_GAME_NOT_FOUND", - 22: "TOURNAMENT_GAME_HAS_LOBBY_ID", - 23: "TOURNAMENT_GAME_HAS_MATCH_ID", - 24: "TOURNAMENT_GAME_HAS_NO_RADIANT_TEAM", - 25: "TOURNAMENT_GAME_HAS_NO_DIRE_TEAM", - 26: "TOURNAMENT_GAME_SQL_UPDATE_FAILED", - 27: "NOT_LEAGUE_ADMIN", - 28: "PARTY_NOT_VALID_TO_MM", - 29: "PARTY_NOT_VALID_TO_MM_COACHCOUNT", - 30: "PARTY_MEMBER_IN_ANOTHER_GAME", - 31: "PARTY_MEMBER_IN_LOW_PRIORITY", - 32: "CLIENT_OUT_OF_DATE", - 33: "COMPETITIVE_MM_NO_COACHES", - 34: "COMPETITIVE_MM_NO_LOW_PRIORITY", - 35: "COMPETITIVE_MM_NOT_UNLOCKED", - 36: "COMPETITIVE_MM_GAME_MODE_NOT_ALLOWED", - 37: "GAME_MODE_NOT_UNLOCKED", - 38: "SAVE_GAME_CORRUPT", - 39: "INSUFFICIENT_INGOTS", - 40: "COMPETITIVE_MM_NO_4STACKS", - 41: "COMPETITIVE_MM_PARTY_MMR_SPREAD_TOO_LARGE", - 42: "COMPETITIVE_MM_NOT_ENOUGH_SKILL_DATA_PLAY_MORE_CASUAL", - 43: "COMPETITIVE_MM_NOT_ENOUGH_SKILL_DATA_IN_PARTY", - 44: "PARTY_LEADER_JOINED_LOBBY", - 45: "MM_1V1_NO_PARTIES", - 46: "MM_1V1_NO_LOW_PRIORITY", - 47: "WEEKEND_TOURNEY_REGISTRATION_NOT_OPEN", - 48: "WEEKEND_TOURNEY_UNMATCHED", - 49: "POST_MATCH_SURVEY", - 50: "TROPHY_AWARDED", - 51: "TROPHY_LEVEL_UP", - 52: "ALL_HERO_CHALLENGE_PROGRESS", - 53: "NEED_INITIAL_SKILL", - 54: "NEED_INITIAL_SKILL_IN_PARTY", - 55: "TARGET_ENGINE_MISMATCH", - 56: "VAC_NOT_VERIFIED", - 57: "KICKED_FROM_QUEUE_EVENT_STARTING", - 58: "KICKED_FROM_QUEUE_EVENT_ENDING", - 59: "EVENT_NO_LOW_PRIORITY", - 60: "MM_LOW_PRI_ONLY_CASUAL_AR", - 61: "CNY2015_ONCE_PER_ROUND", - 62: "LOBBY_FULL", - 63: "EVENT_POINTS_EARNED", - 64: "CUSTOM_GAME_INCORRECT_VERSION", - 65: "COMPETITIVE_MM_MMR_TOO_HIGH_S2", - 66: "LIMITED_USER_CHAT", - 67: "EVENT_PREMIUM_POINTS_EARNED", -} -var CMsgDOTAPopup_PopupID_value = map[string]int32{ - "KICKED_FROM_LOBBY": 0, - "KICKED_FROM_PARTY": 1, - "KICKED_FROM_TEAM": 2, - "TEAM_WAS_DISBANDED": 3, - "TEAM_MATCHMAKE_ALREADY_MATCH": 4, - "TEAM_MATCHMAKE_ALREADY_FINDING": 5, - "TEAM_MATCHMAKE_FULL": 6, - "TEAM_MATCHMAKE_FAIL_ADD": 7, - "TEAM_MATCHMAKE_FAIL_ADD_CURRENT": 8, - "TEAM_MATCHMAKE_FAILED_TEAM_MEMBER": 9, - "TEAM_MATCHMAKE_ALREADY_GAME": 10, - "TEAM_MATCHMAKE_FAIL_GET_PARTY": 11, - "MATCHMAKING_DISABLED": 12, - "INVITE_DENIED": 13, - "PARTY_FULL": 14, - "MADE_ADMIN": 15, - "NEED_TO_PURCHASE": 16, - "SIGNON_MESSAGE": 17, - "GUILD_KICKED": 18, - "MATCHMAKING_REGION_OFFLINE": 19, - "TOO_MANY_MATCHGROUPS": 20, - "TOURNAMENT_GAME_NOT_FOUND": 21, - "TOURNAMENT_GAME_HAS_LOBBY_ID": 22, - "TOURNAMENT_GAME_HAS_MATCH_ID": 23, - "TOURNAMENT_GAME_HAS_NO_RADIANT_TEAM": 24, - "TOURNAMENT_GAME_HAS_NO_DIRE_TEAM": 25, - "TOURNAMENT_GAME_SQL_UPDATE_FAILED": 26, - "NOT_LEAGUE_ADMIN": 27, - "PARTY_NOT_VALID_TO_MM": 28, - "PARTY_NOT_VALID_TO_MM_COACHCOUNT": 29, - "PARTY_MEMBER_IN_ANOTHER_GAME": 30, - "PARTY_MEMBER_IN_LOW_PRIORITY": 31, - "CLIENT_OUT_OF_DATE": 32, - "COMPETITIVE_MM_NO_COACHES": 33, - "COMPETITIVE_MM_NO_LOW_PRIORITY": 34, - "COMPETITIVE_MM_NOT_UNLOCKED": 35, - "COMPETITIVE_MM_GAME_MODE_NOT_ALLOWED": 36, - "GAME_MODE_NOT_UNLOCKED": 37, - "SAVE_GAME_CORRUPT": 38, - "INSUFFICIENT_INGOTS": 39, - "COMPETITIVE_MM_NO_4STACKS": 40, - "COMPETITIVE_MM_PARTY_MMR_SPREAD_TOO_LARGE": 41, - "COMPETITIVE_MM_NOT_ENOUGH_SKILL_DATA_PLAY_MORE_CASUAL": 42, - "COMPETITIVE_MM_NOT_ENOUGH_SKILL_DATA_IN_PARTY": 43, - "PARTY_LEADER_JOINED_LOBBY": 44, - "MM_1V1_NO_PARTIES": 45, - "MM_1V1_NO_LOW_PRIORITY": 46, - "WEEKEND_TOURNEY_REGISTRATION_NOT_OPEN": 47, - "WEEKEND_TOURNEY_UNMATCHED": 48, - "POST_MATCH_SURVEY": 49, - "TROPHY_AWARDED": 50, - "TROPHY_LEVEL_UP": 51, - "ALL_HERO_CHALLENGE_PROGRESS": 52, - "NEED_INITIAL_SKILL": 53, - "NEED_INITIAL_SKILL_IN_PARTY": 54, - "TARGET_ENGINE_MISMATCH": 55, - "VAC_NOT_VERIFIED": 56, - "KICKED_FROM_QUEUE_EVENT_STARTING": 57, - "KICKED_FROM_QUEUE_EVENT_ENDING": 58, - "EVENT_NO_LOW_PRIORITY": 59, - "MM_LOW_PRI_ONLY_CASUAL_AR": 60, - "CNY2015_ONCE_PER_ROUND": 61, - "LOBBY_FULL": 62, - "EVENT_POINTS_EARNED": 63, - "CUSTOM_GAME_INCORRECT_VERSION": 64, - "COMPETITIVE_MM_MMR_TOO_HIGH_S2": 65, - "LIMITED_USER_CHAT": 66, - "EVENT_PREMIUM_POINTS_EARNED": 67, -} - -func (x CMsgDOTAPopup_PopupID) Enum() *CMsgDOTAPopup_PopupID { - p := new(CMsgDOTAPopup_PopupID) - *p = x - return p -} -func (x CMsgDOTAPopup_PopupID) String() string { - return proto.EnumName(CMsgDOTAPopup_PopupID_name, int32(x)) -} -func (x *CMsgDOTAPopup_PopupID) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAPopup_PopupID_value, data, "CMsgDOTAPopup_PopupID") - if err != nil { - return err - } - *x = CMsgDOTAPopup_PopupID(value) - return nil -} -func (CMsgDOTAPopup_PopupID) EnumDescriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{64, 0} } - -type CMsgDOTACreateTeamResponse_Result int32 - -const ( - CMsgDOTACreateTeamResponse_INVALID CMsgDOTACreateTeamResponse_Result = -1 - CMsgDOTACreateTeamResponse_SUCCESS CMsgDOTACreateTeamResponse_Result = 0 - CMsgDOTACreateTeamResponse_NAME_EMPTY CMsgDOTACreateTeamResponse_Result = 1 - CMsgDOTACreateTeamResponse_NAME_BAD_CHARACTERS CMsgDOTACreateTeamResponse_Result = 2 - CMsgDOTACreateTeamResponse_NAME_TAKEN CMsgDOTACreateTeamResponse_Result = 3 - CMsgDOTACreateTeamResponse_NAME_TOO_LONG CMsgDOTACreateTeamResponse_Result = 4 - CMsgDOTACreateTeamResponse_TAG_EMPTY CMsgDOTACreateTeamResponse_Result = 5 - CMsgDOTACreateTeamResponse_TAG_BAD_CHARACTERS CMsgDOTACreateTeamResponse_Result = 6 - CMsgDOTACreateTeamResponse_TAG_TAKEN CMsgDOTACreateTeamResponse_Result = 7 - CMsgDOTACreateTeamResponse_TAG_TOO_LONG CMsgDOTACreateTeamResponse_Result = 8 - CMsgDOTACreateTeamResponse_CREATOR_BUSY CMsgDOTACreateTeamResponse_Result = 9 - CMsgDOTACreateTeamResponse_UNSPECIFIED_ERROR CMsgDOTACreateTeamResponse_Result = 10 - CMsgDOTACreateTeamResponse_CREATOR_TEAM_LIMIT_REACHED CMsgDOTACreateTeamResponse_Result = 11 - CMsgDOTACreateTeamResponse_NO_LOGO CMsgDOTACreateTeamResponse_Result = 12 - CMsgDOTACreateTeamResponse_CREATOR_TEAM_CREATION_COOLDOWN CMsgDOTACreateTeamResponse_Result = 13 - CMsgDOTACreateTeamResponse_LOGO_UPLOAD_FAILED CMsgDOTACreateTeamResponse_Result = 14 - CMsgDOTACreateTeamResponse_NAME_CHANGED_TOO_RECENTLY CMsgDOTACreateTeamResponse_Result = 15 - CMsgDOTACreateTeamResponse_CREATOR_INSUFFICIENT_LEVEL CMsgDOTACreateTeamResponse_Result = 16 -) - -var CMsgDOTACreateTeamResponse_Result_name = map[int32]string{ - -1: "INVALID", - 0: "SUCCESS", - 1: "NAME_EMPTY", - 2: "NAME_BAD_CHARACTERS", - 3: "NAME_TAKEN", - 4: "NAME_TOO_LONG", - 5: "TAG_EMPTY", - 6: "TAG_BAD_CHARACTERS", - 7: "TAG_TAKEN", - 8: "TAG_TOO_LONG", - 9: "CREATOR_BUSY", - 10: "UNSPECIFIED_ERROR", - 11: "CREATOR_TEAM_LIMIT_REACHED", - 12: "NO_LOGO", - 13: "CREATOR_TEAM_CREATION_COOLDOWN", - 14: "LOGO_UPLOAD_FAILED", - 15: "NAME_CHANGED_TOO_RECENTLY", - 16: "CREATOR_INSUFFICIENT_LEVEL", -} -var CMsgDOTACreateTeamResponse_Result_value = map[string]int32{ - "INVALID": -1, - "SUCCESS": 0, - "NAME_EMPTY": 1, - "NAME_BAD_CHARACTERS": 2, - "NAME_TAKEN": 3, - "NAME_TOO_LONG": 4, - "TAG_EMPTY": 5, - "TAG_BAD_CHARACTERS": 6, - "TAG_TAKEN": 7, - "TAG_TOO_LONG": 8, - "CREATOR_BUSY": 9, - "UNSPECIFIED_ERROR": 10, - "CREATOR_TEAM_LIMIT_REACHED": 11, - "NO_LOGO": 12, - "CREATOR_TEAM_CREATION_COOLDOWN": 13, - "LOGO_UPLOAD_FAILED": 14, - "NAME_CHANGED_TOO_RECENTLY": 15, - "CREATOR_INSUFFICIENT_LEVEL": 16, -} - -func (x CMsgDOTACreateTeamResponse_Result) Enum() *CMsgDOTACreateTeamResponse_Result { - p := new(CMsgDOTACreateTeamResponse_Result) - *p = x - return p -} -func (x CMsgDOTACreateTeamResponse_Result) String() string { - return proto.EnumName(CMsgDOTACreateTeamResponse_Result_name, int32(x)) -} -func (x *CMsgDOTACreateTeamResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTACreateTeamResponse_Result_value, data, "CMsgDOTACreateTeamResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTACreateTeamResponse_Result(value) - return nil -} -func (CMsgDOTACreateTeamResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{70, 0} -} - -type CMsgDOTAEditTeamLogoResponse_Result int32 - -const ( - CMsgDOTAEditTeamLogoResponse_INVALID CMsgDOTAEditTeamLogoResponse_Result = -1 - CMsgDOTAEditTeamLogoResponse_SUCCESS CMsgDOTAEditTeamLogoResponse_Result = 0 - CMsgDOTAEditTeamLogoResponse_CREATOR_BUSY CMsgDOTAEditTeamLogoResponse_Result = 9 - CMsgDOTAEditTeamLogoResponse_UNSPECIFIED_ERROR CMsgDOTAEditTeamLogoResponse_Result = 10 - CMsgDOTAEditTeamLogoResponse_NO_LOGO CMsgDOTAEditTeamLogoResponse_Result = 12 -) - -var CMsgDOTAEditTeamLogoResponse_Result_name = map[int32]string{ - -1: "INVALID", - 0: "SUCCESS", - 9: "CREATOR_BUSY", - 10: "UNSPECIFIED_ERROR", - 12: "NO_LOGO", -} -var CMsgDOTAEditTeamLogoResponse_Result_value = map[string]int32{ - "INVALID": -1, - "SUCCESS": 0, - "CREATOR_BUSY": 9, - "UNSPECIFIED_ERROR": 10, - "NO_LOGO": 12, -} - -func (x CMsgDOTAEditTeamLogoResponse_Result) Enum() *CMsgDOTAEditTeamLogoResponse_Result { - p := new(CMsgDOTAEditTeamLogoResponse_Result) - *p = x - return p -} -func (x CMsgDOTAEditTeamLogoResponse_Result) String() string { - return proto.EnumName(CMsgDOTAEditTeamLogoResponse_Result_name, int32(x)) -} -func (x *CMsgDOTAEditTeamLogoResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAEditTeamLogoResponse_Result_value, data, "CMsgDOTAEditTeamLogoResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTAEditTeamLogoResponse_Result(value) - return nil -} -func (CMsgDOTAEditTeamLogoResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{73, 0} -} - -type CMsgDOTAEditTeamDetailsResponse_Result int32 - -const ( - CMsgDOTAEditTeamDetailsResponse_INVALID CMsgDOTAEditTeamDetailsResponse_Result = -1 - CMsgDOTAEditTeamDetailsResponse_SUCCESS CMsgDOTAEditTeamDetailsResponse_Result = 0 - CMsgDOTAEditTeamDetailsResponse_CREATOR_BUSY CMsgDOTAEditTeamDetailsResponse_Result = 9 - CMsgDOTAEditTeamDetailsResponse_UNSPECIFIED_ERROR CMsgDOTAEditTeamDetailsResponse_Result = 10 -) - -var CMsgDOTAEditTeamDetailsResponse_Result_name = map[int32]string{ - -1: "INVALID", - 0: "SUCCESS", - 9: "CREATOR_BUSY", - 10: "UNSPECIFIED_ERROR", -} -var CMsgDOTAEditTeamDetailsResponse_Result_value = map[string]int32{ - "INVALID": -1, - "SUCCESS": 0, - "CREATOR_BUSY": 9, - "UNSPECIFIED_ERROR": 10, -} - -func (x CMsgDOTAEditTeamDetailsResponse_Result) Enum() *CMsgDOTAEditTeamDetailsResponse_Result { - p := new(CMsgDOTAEditTeamDetailsResponse_Result) - *p = x - return p -} -func (x CMsgDOTAEditTeamDetailsResponse_Result) String() string { - return proto.EnumName(CMsgDOTAEditTeamDetailsResponse_Result_name, int32(x)) -} -func (x *CMsgDOTAEditTeamDetailsResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAEditTeamDetailsResponse_Result_value, data, "CMsgDOTAEditTeamDetailsResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTAEditTeamDetailsResponse_Result(value) - return nil -} -func (CMsgDOTAEditTeamDetailsResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{75, 0} -} - -type CMsgDOTADisbandTeamResponse_Result int32 - -const ( - CMsgDOTADisbandTeamResponse_SUCCESS CMsgDOTADisbandTeamResponse_Result = 0 - CMsgDOTADisbandTeamResponse_FAILURE CMsgDOTADisbandTeamResponse_Result = 1 - CMsgDOTADisbandTeamResponse_FAILURE_NOT_EMPTY CMsgDOTADisbandTeamResponse_Result = 2 -) - -var CMsgDOTADisbandTeamResponse_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILURE", - 2: "FAILURE_NOT_EMPTY", -} -var CMsgDOTADisbandTeamResponse_Result_value = map[string]int32{ - "SUCCESS": 0, - "FAILURE": 1, - "FAILURE_NOT_EMPTY": 2, -} - -func (x CMsgDOTADisbandTeamResponse_Result) Enum() *CMsgDOTADisbandTeamResponse_Result { - p := new(CMsgDOTADisbandTeamResponse_Result) - *p = x - return p -} -func (x CMsgDOTADisbandTeamResponse_Result) String() string { - return proto.EnumName(CMsgDOTADisbandTeamResponse_Result_name, int32(x)) -} -func (x *CMsgDOTADisbandTeamResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTADisbandTeamResponse_Result_value, data, "CMsgDOTADisbandTeamResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTADisbandTeamResponse_Result(value) - return nil -} -func (CMsgDOTADisbandTeamResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{77, 0} -} - -type CMsgDOTARequestTeamDataResponse_Result int32 - -const ( - CMsgDOTARequestTeamDataResponse_SUCCESS CMsgDOTARequestTeamDataResponse_Result = 0 - CMsgDOTARequestTeamDataResponse_FAILURE CMsgDOTARequestTeamDataResponse_Result = 1 -) - -var CMsgDOTARequestTeamDataResponse_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILURE", -} -var CMsgDOTARequestTeamDataResponse_Result_value = map[string]int32{ - "SUCCESS": 0, - "FAILURE": 1, -} - -func (x CMsgDOTARequestTeamDataResponse_Result) Enum() *CMsgDOTARequestTeamDataResponse_Result { - p := new(CMsgDOTARequestTeamDataResponse_Result) - *p = x - return p -} -func (x CMsgDOTARequestTeamDataResponse_Result) String() string { - return proto.EnumName(CMsgDOTARequestTeamDataResponse_Result_name, int32(x)) -} -func (x *CMsgDOTARequestTeamDataResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTARequestTeamDataResponse_Result_value, data, "CMsgDOTARequestTeamDataResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTARequestTeamDataResponse_Result(value) - return nil -} -func (CMsgDOTARequestTeamDataResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{79, 0} -} - -type CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result int32 - -const ( - CMsgDOTATeamInvite_GCImmediateResponseToInviter_SUCCESS CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 0 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_MEMBER_LIMIT CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 1 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_INVITEE_NOT_AVAILABLE CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 2 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_INVITEE_BUSY CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 3 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_INVITEE_ALREADY_ON_THE_TEAM CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 4 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_INVITEE_ALREADY_ON_TOO_MANY_TEAMS CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 5 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_UNSPECIFIED_ERROR CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 6 - CMsgDOTATeamInvite_GCImmediateResponseToInviter_INVITEE_INSUFFICIENT_LEVEL CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = 7 -) - -var CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "MEMBER_LIMIT", - 2: "INVITEE_NOT_AVAILABLE", - 3: "INVITEE_BUSY", - 4: "INVITEE_ALREADY_ON_THE_TEAM", - 5: "INVITEE_ALREADY_ON_TOO_MANY_TEAMS", - 6: "UNSPECIFIED_ERROR", - 7: "INVITEE_INSUFFICIENT_LEVEL", -} -var CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result_value = map[string]int32{ - "SUCCESS": 0, - "MEMBER_LIMIT": 1, - "INVITEE_NOT_AVAILABLE": 2, - "INVITEE_BUSY": 3, - "INVITEE_ALREADY_ON_THE_TEAM": 4, - "INVITEE_ALREADY_ON_TOO_MANY_TEAMS": 5, - "UNSPECIFIED_ERROR": 6, - "INVITEE_INSUFFICIENT_LEVEL": 7, -} - -func (x CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result) Enum() *CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result { - p := new(CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result) - *p = x - return p -} -func (x CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result) String() string { - return proto.EnumName(CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result_name, int32(x)) -} -func (x *CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result_value, data, "CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result") - if err != nil { - return err - } - *x = CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result(value) - return nil -} -func (CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{89, 0} -} - -type CMsgDOTATeamInvite_InviteeResponseToGC_Result int32 - -const ( - CMsgDOTATeamInvite_InviteeResponseToGC_JOIN CMsgDOTATeamInvite_InviteeResponseToGC_Result = 0 - CMsgDOTATeamInvite_InviteeResponseToGC_REJECT CMsgDOTATeamInvite_InviteeResponseToGC_Result = 1 - CMsgDOTATeamInvite_InviteeResponseToGC_TIMEOUT CMsgDOTATeamInvite_InviteeResponseToGC_Result = 2 -) - -var CMsgDOTATeamInvite_InviteeResponseToGC_Result_name = map[int32]string{ - 0: "JOIN", - 1: "REJECT", - 2: "TIMEOUT", -} -var CMsgDOTATeamInvite_InviteeResponseToGC_Result_value = map[string]int32{ - "JOIN": 0, - "REJECT": 1, - "TIMEOUT": 2, -} - -func (x CMsgDOTATeamInvite_InviteeResponseToGC_Result) Enum() *CMsgDOTATeamInvite_InviteeResponseToGC_Result { - p := new(CMsgDOTATeamInvite_InviteeResponseToGC_Result) - *p = x - return p -} -func (x CMsgDOTATeamInvite_InviteeResponseToGC_Result) String() string { - return proto.EnumName(CMsgDOTATeamInvite_InviteeResponseToGC_Result_name, int32(x)) -} -func (x *CMsgDOTATeamInvite_InviteeResponseToGC_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTATeamInvite_InviteeResponseToGC_Result_value, data, "CMsgDOTATeamInvite_InviteeResponseToGC_Result") - if err != nil { - return err - } - *x = CMsgDOTATeamInvite_InviteeResponseToGC_Result(value) - return nil -} -func (CMsgDOTATeamInvite_InviteeResponseToGC_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{91, 0} -} - -type CMsgDOTATeamInvite_GCResponseToInviter_Result int32 - -const ( - CMsgDOTATeamInvite_GCResponseToInviter_JOINED CMsgDOTATeamInvite_GCResponseToInviter_Result = 0 - CMsgDOTATeamInvite_GCResponseToInviter_REJECTION CMsgDOTATeamInvite_GCResponseToInviter_Result = 1 - CMsgDOTATeamInvite_GCResponseToInviter_TIMEOUT CMsgDOTATeamInvite_GCResponseToInviter_Result = 2 - CMsgDOTATeamInvite_GCResponseToInviter_UNSPECIFIED_ERROR CMsgDOTATeamInvite_GCResponseToInviter_Result = 3 -) - -var CMsgDOTATeamInvite_GCResponseToInviter_Result_name = map[int32]string{ - 0: "JOINED", - 1: "REJECTION", - 2: "TIMEOUT", - 3: "UNSPECIFIED_ERROR", -} -var CMsgDOTATeamInvite_GCResponseToInviter_Result_value = map[string]int32{ - "JOINED": 0, - "REJECTION": 1, - "TIMEOUT": 2, - "UNSPECIFIED_ERROR": 3, -} - -func (x CMsgDOTATeamInvite_GCResponseToInviter_Result) Enum() *CMsgDOTATeamInvite_GCResponseToInviter_Result { - p := new(CMsgDOTATeamInvite_GCResponseToInviter_Result) - *p = x - return p -} -func (x CMsgDOTATeamInvite_GCResponseToInviter_Result) String() string { - return proto.EnumName(CMsgDOTATeamInvite_GCResponseToInviter_Result_name, int32(x)) -} -func (x *CMsgDOTATeamInvite_GCResponseToInviter_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTATeamInvite_GCResponseToInviter_Result_value, data, "CMsgDOTATeamInvite_GCResponseToInviter_Result") - if err != nil { - return err - } - *x = CMsgDOTATeamInvite_GCResponseToInviter_Result(value) - return nil -} -func (CMsgDOTATeamInvite_GCResponseToInviter_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{92, 0} -} - -type CMsgDOTATeamInvite_GCResponseToInvitee_Result int32 - -const ( - CMsgDOTATeamInvite_GCResponseToInvitee_SUCCESS CMsgDOTATeamInvite_GCResponseToInvitee_Result = 0 - CMsgDOTATeamInvite_GCResponseToInvitee_FAILURE CMsgDOTATeamInvite_GCResponseToInvitee_Result = 1 -) - -var CMsgDOTATeamInvite_GCResponseToInvitee_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILURE", -} -var CMsgDOTATeamInvite_GCResponseToInvitee_Result_value = map[string]int32{ - "SUCCESS": 0, - "FAILURE": 1, -} - -func (x CMsgDOTATeamInvite_GCResponseToInvitee_Result) Enum() *CMsgDOTATeamInvite_GCResponseToInvitee_Result { - p := new(CMsgDOTATeamInvite_GCResponseToInvitee_Result) - *p = x - return p -} -func (x CMsgDOTATeamInvite_GCResponseToInvitee_Result) String() string { - return proto.EnumName(CMsgDOTATeamInvite_GCResponseToInvitee_Result_name, int32(x)) -} -func (x *CMsgDOTATeamInvite_GCResponseToInvitee_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTATeamInvite_GCResponseToInvitee_Result_value, data, "CMsgDOTATeamInvite_GCResponseToInvitee_Result") - if err != nil { - return err - } - *x = CMsgDOTATeamInvite_GCResponseToInvitee_Result(value) - return nil -} -func (CMsgDOTATeamInvite_GCResponseToInvitee_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{93, 0} -} - -type CMsgDOTAKickTeamMemberResponse_Result int32 - -const ( - CMsgDOTAKickTeamMemberResponse_SUCCESS CMsgDOTAKickTeamMemberResponse_Result = 0 - CMsgDOTAKickTeamMemberResponse_FAILURE CMsgDOTAKickTeamMemberResponse_Result = 1 -) - -var CMsgDOTAKickTeamMemberResponse_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILURE", -} -var CMsgDOTAKickTeamMemberResponse_Result_value = map[string]int32{ - "SUCCESS": 0, - "FAILURE": 1, -} - -func (x CMsgDOTAKickTeamMemberResponse_Result) Enum() *CMsgDOTAKickTeamMemberResponse_Result { - p := new(CMsgDOTAKickTeamMemberResponse_Result) - *p = x - return p -} -func (x CMsgDOTAKickTeamMemberResponse_Result) String() string { - return proto.EnumName(CMsgDOTAKickTeamMemberResponse_Result_name, int32(x)) -} -func (x *CMsgDOTAKickTeamMemberResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAKickTeamMemberResponse_Result_value, data, "CMsgDOTAKickTeamMemberResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTAKickTeamMemberResponse_Result(value) - return nil -} -func (CMsgDOTAKickTeamMemberResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{96, 0} -} - -type CMsgDOTATransferTeamAdminResponse_Result int32 - -const ( - CMsgDOTATransferTeamAdminResponse_SUCCESS CMsgDOTATransferTeamAdminResponse_Result = 0 - CMsgDOTATransferTeamAdminResponse_NOT_ADMIN CMsgDOTATransferTeamAdminResponse_Result = 1 - CMsgDOTATransferTeamAdminResponse_ON_OTHER_TEAM CMsgDOTATransferTeamAdminResponse_Result = 2 - CMsgDOTATransferTeamAdminResponse_ADMIN_OF_OTHER_TEAM CMsgDOTATransferTeamAdminResponse_Result = 3 - CMsgDOTATransferTeamAdminResponse_UNSPECIFIED_ERROR CMsgDOTATransferTeamAdminResponse_Result = 4 -) - -var CMsgDOTATransferTeamAdminResponse_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "NOT_ADMIN", - 2: "ON_OTHER_TEAM", - 3: "ADMIN_OF_OTHER_TEAM", - 4: "UNSPECIFIED_ERROR", -} -var CMsgDOTATransferTeamAdminResponse_Result_value = map[string]int32{ - "SUCCESS": 0, - "NOT_ADMIN": 1, - "ON_OTHER_TEAM": 2, - "ADMIN_OF_OTHER_TEAM": 3, - "UNSPECIFIED_ERROR": 4, -} - -func (x CMsgDOTATransferTeamAdminResponse_Result) Enum() *CMsgDOTATransferTeamAdminResponse_Result { - p := new(CMsgDOTATransferTeamAdminResponse_Result) - *p = x - return p -} -func (x CMsgDOTATransferTeamAdminResponse_Result) String() string { - return proto.EnumName(CMsgDOTATransferTeamAdminResponse_Result_name, int32(x)) -} -func (x *CMsgDOTATransferTeamAdminResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTATransferTeamAdminResponse_Result_value, data, "CMsgDOTATransferTeamAdminResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTATransferTeamAdminResponse_Result(value) - return nil -} -func (CMsgDOTATransferTeamAdminResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{98, 0} -} - -type CMsgDOTALeaveTeamResponse_Result int32 - -const ( - CMsgDOTALeaveTeamResponse_SUCCESS CMsgDOTALeaveTeamResponse_Result = 0 - CMsgDOTALeaveTeamResponse_FAILURE CMsgDOTALeaveTeamResponse_Result = 1 -) - -var CMsgDOTALeaveTeamResponse_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILURE", -} -var CMsgDOTALeaveTeamResponse_Result_value = map[string]int32{ - "SUCCESS": 0, - "FAILURE": 1, -} - -func (x CMsgDOTALeaveTeamResponse_Result) Enum() *CMsgDOTALeaveTeamResponse_Result { - p := new(CMsgDOTALeaveTeamResponse_Result) - *p = x - return p -} -func (x CMsgDOTALeaveTeamResponse_Result) String() string { - return proto.EnumName(CMsgDOTALeaveTeamResponse_Result_name, int32(x)) -} -func (x *CMsgDOTALeaveTeamResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTALeaveTeamResponse_Result_value, data, "CMsgDOTALeaveTeamResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTALeaveTeamResponse_Result(value) - return nil -} -func (CMsgDOTALeaveTeamResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{100, 0} -} - -type CMsgDOTAJoinChatChannelResponse_Result int32 - -const ( - CMsgDOTAJoinChatChannelResponse_JOIN_SUCCESS CMsgDOTAJoinChatChannelResponse_Result = 0 - CMsgDOTAJoinChatChannelResponse_INVALID_CHANNEL_TYPE CMsgDOTAJoinChatChannelResponse_Result = 1 - CMsgDOTAJoinChatChannelResponse_ACCOUNT_NOT_FOUND CMsgDOTAJoinChatChannelResponse_Result = 2 - CMsgDOTAJoinChatChannelResponse_ACH_FAILED CMsgDOTAJoinChatChannelResponse_Result = 3 - CMsgDOTAJoinChatChannelResponse_USER_IN_TOO_MANY_CHANNELS CMsgDOTAJoinChatChannelResponse_Result = 4 - CMsgDOTAJoinChatChannelResponse_RATE_LIMIT_EXCEEDED CMsgDOTAJoinChatChannelResponse_Result = 5 - CMsgDOTAJoinChatChannelResponse_CHANNEL_FULL CMsgDOTAJoinChatChannelResponse_Result = 6 - CMsgDOTAJoinChatChannelResponse_CHANNEL_FULL_OVERFLOWED CMsgDOTAJoinChatChannelResponse_Result = 7 - CMsgDOTAJoinChatChannelResponse_FAILED_TO_ADD_USER CMsgDOTAJoinChatChannelResponse_Result = 8 - CMsgDOTAJoinChatChannelResponse_CHANNEL_TYPE_DISABLED CMsgDOTAJoinChatChannelResponse_Result = 9 - CMsgDOTAJoinChatChannelResponse_PRIVATE_CHAT_CREATE_FAILED CMsgDOTAJoinChatChannelResponse_Result = 10 - CMsgDOTAJoinChatChannelResponse_PRIVATE_CHAT_NO_PERMISSION CMsgDOTAJoinChatChannelResponse_Result = 11 - CMsgDOTAJoinChatChannelResponse_PRIVATE_CHAT_CREATE_LOCK_FAILED CMsgDOTAJoinChatChannelResponse_Result = 12 - CMsgDOTAJoinChatChannelResponse_PRIVATE_CHAT_KICKED CMsgDOTAJoinChatChannelResponse_Result = 13 -) - -var CMsgDOTAJoinChatChannelResponse_Result_name = map[int32]string{ - 0: "JOIN_SUCCESS", - 1: "INVALID_CHANNEL_TYPE", - 2: "ACCOUNT_NOT_FOUND", - 3: "ACH_FAILED", - 4: "USER_IN_TOO_MANY_CHANNELS", - 5: "RATE_LIMIT_EXCEEDED", - 6: "CHANNEL_FULL", - 7: "CHANNEL_FULL_OVERFLOWED", - 8: "FAILED_TO_ADD_USER", - 9: "CHANNEL_TYPE_DISABLED", - 10: "PRIVATE_CHAT_CREATE_FAILED", - 11: "PRIVATE_CHAT_NO_PERMISSION", - 12: "PRIVATE_CHAT_CREATE_LOCK_FAILED", - 13: "PRIVATE_CHAT_KICKED", -} -var CMsgDOTAJoinChatChannelResponse_Result_value = map[string]int32{ - "JOIN_SUCCESS": 0, - "INVALID_CHANNEL_TYPE": 1, - "ACCOUNT_NOT_FOUND": 2, - "ACH_FAILED": 3, - "USER_IN_TOO_MANY_CHANNELS": 4, - "RATE_LIMIT_EXCEEDED": 5, - "CHANNEL_FULL": 6, - "CHANNEL_FULL_OVERFLOWED": 7, - "FAILED_TO_ADD_USER": 8, - "CHANNEL_TYPE_DISABLED": 9, - "PRIVATE_CHAT_CREATE_FAILED": 10, - "PRIVATE_CHAT_NO_PERMISSION": 11, - "PRIVATE_CHAT_CREATE_LOCK_FAILED": 12, - "PRIVATE_CHAT_KICKED": 13, -} - -func (x CMsgDOTAJoinChatChannelResponse_Result) Enum() *CMsgDOTAJoinChatChannelResponse_Result { - p := new(CMsgDOTAJoinChatChannelResponse_Result) - *p = x - return p -} -func (x CMsgDOTAJoinChatChannelResponse_Result) String() string { - return proto.EnumName(CMsgDOTAJoinChatChannelResponse_Result_name, int32(x)) -} -func (x *CMsgDOTAJoinChatChannelResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAJoinChatChannelResponse_Result_value, data, "CMsgDOTAJoinChatChannelResponse_Result") - if err != nil { - return err - } - *x = CMsgDOTAJoinChatChannelResponse_Result(value) - return nil -} -func (CMsgDOTAJoinChatChannelResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{107, 0} -} - -type CMsgDOTAGuildCreateResponse_EError int32 - -const ( - CMsgDOTAGuildCreateResponse_UNSPECIFIED CMsgDOTAGuildCreateResponse_EError = 0 - CMsgDOTAGuildCreateResponse_NAME_EMPTY CMsgDOTAGuildCreateResponse_EError = 1 - CMsgDOTAGuildCreateResponse_NAME_BAD_CHARACTERS CMsgDOTAGuildCreateResponse_EError = 2 - CMsgDOTAGuildCreateResponse_NAME_TOO_LONG CMsgDOTAGuildCreateResponse_EError = 3 - CMsgDOTAGuildCreateResponse_NAME_TAKEN CMsgDOTAGuildCreateResponse_EError = 4 - CMsgDOTAGuildCreateResponse_TAG_EMPTY CMsgDOTAGuildCreateResponse_EError = 5 - CMsgDOTAGuildCreateResponse_TAG_BAD_CHARACTERS CMsgDOTAGuildCreateResponse_EError = 6 - CMsgDOTAGuildCreateResponse_TAG_TOO_LONG CMsgDOTAGuildCreateResponse_EError = 7 - CMsgDOTAGuildCreateResponse_ACCOUNT_TOO_MANY_GUILDS CMsgDOTAGuildCreateResponse_EError = 8 - CMsgDOTAGuildCreateResponse_LOGO_UPLOAD_FAILED CMsgDOTAGuildCreateResponse_EError = 9 -) - -var CMsgDOTAGuildCreateResponse_EError_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "NAME_EMPTY", - 2: "NAME_BAD_CHARACTERS", - 3: "NAME_TOO_LONG", - 4: "NAME_TAKEN", - 5: "TAG_EMPTY", - 6: "TAG_BAD_CHARACTERS", - 7: "TAG_TOO_LONG", - 8: "ACCOUNT_TOO_MANY_GUILDS", - 9: "LOGO_UPLOAD_FAILED", -} -var CMsgDOTAGuildCreateResponse_EError_value = map[string]int32{ - "UNSPECIFIED": 0, - "NAME_EMPTY": 1, - "NAME_BAD_CHARACTERS": 2, - "NAME_TOO_LONG": 3, - "NAME_TAKEN": 4, - "TAG_EMPTY": 5, - "TAG_BAD_CHARACTERS": 6, - "TAG_TOO_LONG": 7, - "ACCOUNT_TOO_MANY_GUILDS": 8, - "LOGO_UPLOAD_FAILED": 9, -} - -func (x CMsgDOTAGuildCreateResponse_EError) Enum() *CMsgDOTAGuildCreateResponse_EError { - p := new(CMsgDOTAGuildCreateResponse_EError) - *p = x - return p -} -func (x CMsgDOTAGuildCreateResponse_EError) String() string { - return proto.EnumName(CMsgDOTAGuildCreateResponse_EError_name, int32(x)) -} -func (x *CMsgDOTAGuildCreateResponse_EError) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAGuildCreateResponse_EError_value, data, "CMsgDOTAGuildCreateResponse_EError") - if err != nil { - return err - } - *x = CMsgDOTAGuildCreateResponse_EError(value) - return nil -} -func (CMsgDOTAGuildCreateResponse_EError) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{123, 0} -} - -type CMsgDOTAGuildSetAccountRoleResponse_EResult int32 - -const ( - CMsgDOTAGuildSetAccountRoleResponse_SUCCESS CMsgDOTAGuildSetAccountRoleResponse_EResult = 0 - CMsgDOTAGuildSetAccountRoleResponse_ERROR_UNSPECIFIED CMsgDOTAGuildSetAccountRoleResponse_EResult = 1 - CMsgDOTAGuildSetAccountRoleResponse_ERROR_NO_PERMISSION CMsgDOTAGuildSetAccountRoleResponse_EResult = 2 - CMsgDOTAGuildSetAccountRoleResponse_ERROR_NO_OTHER_LEADER CMsgDOTAGuildSetAccountRoleResponse_EResult = 3 - CMsgDOTAGuildSetAccountRoleResponse_ERROR_ACCOUNT_TOO_MANY_GUILDS CMsgDOTAGuildSetAccountRoleResponse_EResult = 4 - CMsgDOTAGuildSetAccountRoleResponse_ERROR_GUILD_TOO_MANY_MEMBERS CMsgDOTAGuildSetAccountRoleResponse_EResult = 5 -) - -var CMsgDOTAGuildSetAccountRoleResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", - 3: "ERROR_NO_OTHER_LEADER", - 4: "ERROR_ACCOUNT_TOO_MANY_GUILDS", - 5: "ERROR_GUILD_TOO_MANY_MEMBERS", -} -var CMsgDOTAGuildSetAccountRoleResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, - "ERROR_NO_OTHER_LEADER": 3, - "ERROR_ACCOUNT_TOO_MANY_GUILDS": 4, - "ERROR_GUILD_TOO_MANY_MEMBERS": 5, -} - -func (x CMsgDOTAGuildSetAccountRoleResponse_EResult) Enum() *CMsgDOTAGuildSetAccountRoleResponse_EResult { - p := new(CMsgDOTAGuildSetAccountRoleResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAGuildSetAccountRoleResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAGuildSetAccountRoleResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAGuildSetAccountRoleResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAGuildSetAccountRoleResponse_EResult_value, data, "CMsgDOTAGuildSetAccountRoleResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAGuildSetAccountRoleResponse_EResult(value) - return nil -} -func (CMsgDOTAGuildSetAccountRoleResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{125, 0} -} - -type CMsgDOTAGuildInviteAccountResponse_EResult int32 - -const ( - CMsgDOTAGuildInviteAccountResponse_SUCCESS CMsgDOTAGuildInviteAccountResponse_EResult = 0 - CMsgDOTAGuildInviteAccountResponse_ERROR_UNSPECIFIED CMsgDOTAGuildInviteAccountResponse_EResult = 1 - CMsgDOTAGuildInviteAccountResponse_ERROR_NO_PERMISSION CMsgDOTAGuildInviteAccountResponse_EResult = 2 - CMsgDOTAGuildInviteAccountResponse_ERROR_ACCOUNT_ALREADY_INVITED CMsgDOTAGuildInviteAccountResponse_EResult = 3 - CMsgDOTAGuildInviteAccountResponse_ERROR_ACCOUNT_ALREADY_IN_GUILD CMsgDOTAGuildInviteAccountResponse_EResult = 4 - CMsgDOTAGuildInviteAccountResponse_ERROR_ACCOUNT_TOO_MANY_INVITES CMsgDOTAGuildInviteAccountResponse_EResult = 5 - CMsgDOTAGuildInviteAccountResponse_ERROR_GUILD_TOO_MANY_INVITES CMsgDOTAGuildInviteAccountResponse_EResult = 6 - CMsgDOTAGuildInviteAccountResponse_ERROR_ACCOUNT_TOO_MANY_GUILDS CMsgDOTAGuildInviteAccountResponse_EResult = 7 -) - -var CMsgDOTAGuildInviteAccountResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", - 3: "ERROR_ACCOUNT_ALREADY_INVITED", - 4: "ERROR_ACCOUNT_ALREADY_IN_GUILD", - 5: "ERROR_ACCOUNT_TOO_MANY_INVITES", - 6: "ERROR_GUILD_TOO_MANY_INVITES", - 7: "ERROR_ACCOUNT_TOO_MANY_GUILDS", -} -var CMsgDOTAGuildInviteAccountResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, - "ERROR_ACCOUNT_ALREADY_INVITED": 3, - "ERROR_ACCOUNT_ALREADY_IN_GUILD": 4, - "ERROR_ACCOUNT_TOO_MANY_INVITES": 5, - "ERROR_GUILD_TOO_MANY_INVITES": 6, - "ERROR_ACCOUNT_TOO_MANY_GUILDS": 7, -} - -func (x CMsgDOTAGuildInviteAccountResponse_EResult) Enum() *CMsgDOTAGuildInviteAccountResponse_EResult { - p := new(CMsgDOTAGuildInviteAccountResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAGuildInviteAccountResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAGuildInviteAccountResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAGuildInviteAccountResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAGuildInviteAccountResponse_EResult_value, data, "CMsgDOTAGuildInviteAccountResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAGuildInviteAccountResponse_EResult(value) - return nil -} -func (CMsgDOTAGuildInviteAccountResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{127, 0} -} - -type CMsgDOTAGuildCancelInviteResponse_EResult int32 - -const ( - CMsgDOTAGuildCancelInviteResponse_SUCCESS CMsgDOTAGuildCancelInviteResponse_EResult = 0 - CMsgDOTAGuildCancelInviteResponse_ERROR_UNSPECIFIED CMsgDOTAGuildCancelInviteResponse_EResult = 1 - CMsgDOTAGuildCancelInviteResponse_ERROR_NO_PERMISSION CMsgDOTAGuildCancelInviteResponse_EResult = 2 -) - -var CMsgDOTAGuildCancelInviteResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAGuildCancelInviteResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAGuildCancelInviteResponse_EResult) Enum() *CMsgDOTAGuildCancelInviteResponse_EResult { - p := new(CMsgDOTAGuildCancelInviteResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAGuildCancelInviteResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAGuildCancelInviteResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAGuildCancelInviteResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAGuildCancelInviteResponse_EResult_value, data, "CMsgDOTAGuildCancelInviteResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAGuildCancelInviteResponse_EResult(value) - return nil -} -func (CMsgDOTAGuildCancelInviteResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{129, 0} -} - -type CMsgDOTAGuildUpdateDetailsResponse_EResult int32 - -const ( - CMsgDOTAGuildUpdateDetailsResponse_SUCCESS CMsgDOTAGuildUpdateDetailsResponse_EResult = 0 - CMsgDOTAGuildUpdateDetailsResponse_ERROR_UNSPECIFIED CMsgDOTAGuildUpdateDetailsResponse_EResult = 1 - CMsgDOTAGuildUpdateDetailsResponse_ERROR_NO_PERMISSION CMsgDOTAGuildUpdateDetailsResponse_EResult = 2 -) - -var CMsgDOTAGuildUpdateDetailsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAGuildUpdateDetailsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAGuildUpdateDetailsResponse_EResult) Enum() *CMsgDOTAGuildUpdateDetailsResponse_EResult { - p := new(CMsgDOTAGuildUpdateDetailsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAGuildUpdateDetailsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAGuildUpdateDetailsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAGuildUpdateDetailsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAGuildUpdateDetailsResponse_EResult_value, data, "CMsgDOTAGuildUpdateDetailsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAGuildUpdateDetailsResponse_EResult(value) - return nil -} -func (CMsgDOTAGuildUpdateDetailsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{131, 0} -} - -type CMsgDOTAPartySetOpenGuildResponse_EResult int32 - -const ( - CMsgDOTAPartySetOpenGuildResponse_SUCCESS CMsgDOTAPartySetOpenGuildResponse_EResult = 0 - CMsgDOTAPartySetOpenGuildResponse_ERROR_UNSPECIFIED CMsgDOTAPartySetOpenGuildResponse_EResult = 1 -) - -var CMsgDOTAPartySetOpenGuildResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", -} -var CMsgDOTAPartySetOpenGuildResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, -} - -func (x CMsgDOTAPartySetOpenGuildResponse_EResult) Enum() *CMsgDOTAPartySetOpenGuildResponse_EResult { - p := new(CMsgDOTAPartySetOpenGuildResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAPartySetOpenGuildResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAPartySetOpenGuildResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAPartySetOpenGuildResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAPartySetOpenGuildResponse_EResult_value, data, "CMsgDOTAPartySetOpenGuildResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAPartySetOpenGuildResponse_EResult(value) - return nil -} -func (CMsgDOTAPartySetOpenGuildResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{137, 0} -} - -type CMsgDOTAJoinOpenGuildPartyResponse_EResult int32 - -const ( - CMsgDOTAJoinOpenGuildPartyResponse_SUCCESS CMsgDOTAJoinOpenGuildPartyResponse_EResult = 0 - CMsgDOTAJoinOpenGuildPartyResponse_ERROR_UNSPECIFIED CMsgDOTAJoinOpenGuildPartyResponse_EResult = 1 -) - -var CMsgDOTAJoinOpenGuildPartyResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", -} -var CMsgDOTAJoinOpenGuildPartyResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, -} - -func (x CMsgDOTAJoinOpenGuildPartyResponse_EResult) Enum() *CMsgDOTAJoinOpenGuildPartyResponse_EResult { - p := new(CMsgDOTAJoinOpenGuildPartyResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAJoinOpenGuildPartyResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAJoinOpenGuildPartyResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAJoinOpenGuildPartyResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAJoinOpenGuildPartyResponse_EResult_value, data, "CMsgDOTAJoinOpenGuildPartyResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAJoinOpenGuildPartyResponse_EResult(value) - return nil -} -func (CMsgDOTAJoinOpenGuildPartyResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{139, 0} -} - -type CMsgDOTAGuildEditLogoResponse_EResult int32 - -const ( - CMsgDOTAGuildEditLogoResponse_SUCCESS CMsgDOTAGuildEditLogoResponse_EResult = 0 - CMsgDOTAGuildEditLogoResponse_NO_PERMISSION CMsgDOTAGuildEditLogoResponse_EResult = 1 - CMsgDOTAGuildEditLogoResponse_LOGO_UPLOAD_FAILED CMsgDOTAGuildEditLogoResponse_EResult = 2 - CMsgDOTAGuildEditLogoResponse_UNSPECIFIED_ERROR CMsgDOTAGuildEditLogoResponse_EResult = 3 -) - -var CMsgDOTAGuildEditLogoResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "NO_PERMISSION", - 2: "LOGO_UPLOAD_FAILED", - 3: "UNSPECIFIED_ERROR", -} -var CMsgDOTAGuildEditLogoResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "NO_PERMISSION": 1, - "LOGO_UPLOAD_FAILED": 2, - "UNSPECIFIED_ERROR": 3, -} - -func (x CMsgDOTAGuildEditLogoResponse_EResult) Enum() *CMsgDOTAGuildEditLogoResponse_EResult { - p := new(CMsgDOTAGuildEditLogoResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAGuildEditLogoResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAGuildEditLogoResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAGuildEditLogoResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAGuildEditLogoResponse_EResult_value, data, "CMsgDOTAGuildEditLogoResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAGuildEditLogoResponse_EResult(value) - return nil -} -func (CMsgDOTAGuildEditLogoResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{145, 0} -} - -type CMsgWatchGameResponse_WatchGameResult int32 - -const ( - CMsgWatchGameResponse_PENDING CMsgWatchGameResponse_WatchGameResult = 0 - CMsgWatchGameResponse_READY CMsgWatchGameResponse_WatchGameResult = 1 - CMsgWatchGameResponse_GAMESERVERNOTFOUND CMsgWatchGameResponse_WatchGameResult = 2 - CMsgWatchGameResponse_UNAVAILABLE CMsgWatchGameResponse_WatchGameResult = 3 - CMsgWatchGameResponse_CANCELLED CMsgWatchGameResponse_WatchGameResult = 4 - CMsgWatchGameResponse_INCOMPATIBLEVERSION CMsgWatchGameResponse_WatchGameResult = 5 - CMsgWatchGameResponse_MISSINGLEAGUESUBSCRIPTION CMsgWatchGameResponse_WatchGameResult = 6 - CMsgWatchGameResponse_LOBBYNOTFOUND CMsgWatchGameResponse_WatchGameResult = 7 -) - -var CMsgWatchGameResponse_WatchGameResult_name = map[int32]string{ - 0: "PENDING", - 1: "READY", - 2: "GAMESERVERNOTFOUND", - 3: "UNAVAILABLE", - 4: "CANCELLED", - 5: "INCOMPATIBLEVERSION", - 6: "MISSINGLEAGUESUBSCRIPTION", - 7: "LOBBYNOTFOUND", -} -var CMsgWatchGameResponse_WatchGameResult_value = map[string]int32{ - "PENDING": 0, - "READY": 1, - "GAMESERVERNOTFOUND": 2, - "UNAVAILABLE": 3, - "CANCELLED": 4, - "INCOMPATIBLEVERSION": 5, - "MISSINGLEAGUESUBSCRIPTION": 6, - "LOBBYNOTFOUND": 7, -} - -func (x CMsgWatchGameResponse_WatchGameResult) Enum() *CMsgWatchGameResponse_WatchGameResult { - p := new(CMsgWatchGameResponse_WatchGameResult) - *p = x - return p -} -func (x CMsgWatchGameResponse_WatchGameResult) String() string { - return proto.EnumName(CMsgWatchGameResponse_WatchGameResult_name, int32(x)) -} -func (x *CMsgWatchGameResponse_WatchGameResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgWatchGameResponse_WatchGameResult_value, data, "CMsgWatchGameResponse_WatchGameResult") - if err != nil { - return err - } - *x = CMsgWatchGameResponse_WatchGameResult(value) - return nil -} -func (CMsgWatchGameResponse_WatchGameResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{157, 0} -} - -type CMsgDOTAFriendRecruitsResponse_EResult int32 - -const ( - CMsgDOTAFriendRecruitsResponse_SUCCESS CMsgDOTAFriendRecruitsResponse_EResult = 0 - CMsgDOTAFriendRecruitsResponse_ERROR_UNSPECIFIED CMsgDOTAFriendRecruitsResponse_EResult = 1 -) - -var CMsgDOTAFriendRecruitsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", -} -var CMsgDOTAFriendRecruitsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, -} - -func (x CMsgDOTAFriendRecruitsResponse_EResult) Enum() *CMsgDOTAFriendRecruitsResponse_EResult { - p := new(CMsgDOTAFriendRecruitsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFriendRecruitsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFriendRecruitsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFriendRecruitsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFriendRecruitsResponse_EResult_value, data, "CMsgDOTAFriendRecruitsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFriendRecruitsResponse_EResult(value) - return nil -} -func (CMsgDOTAFriendRecruitsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{222, 0} -} - -type CMsgDOTARedeemEventPrizeResponse_ResultCode int32 - -const ( - CMsgDOTARedeemEventPrizeResponse_Success CMsgDOTARedeemEventPrizeResponse_ResultCode = 0 - CMsgDOTARedeemEventPrizeResponse_ServerError CMsgDOTARedeemEventPrizeResponse_ResultCode = 1 - CMsgDOTARedeemEventPrizeResponse_InsufficientPoints CMsgDOTARedeemEventPrizeResponse_ResultCode = 2 - CMsgDOTARedeemEventPrizeResponse_PointsHeld CMsgDOTARedeemEventPrizeResponse_ResultCode = 3 -) - -var CMsgDOTARedeemEventPrizeResponse_ResultCode_name = map[int32]string{ - 0: "Success", - 1: "ServerError", - 2: "InsufficientPoints", - 3: "PointsHeld", -} -var CMsgDOTARedeemEventPrizeResponse_ResultCode_value = map[string]int32{ - "Success": 0, - "ServerError": 1, - "InsufficientPoints": 2, - "PointsHeld": 3, -} - -func (x CMsgDOTARedeemEventPrizeResponse_ResultCode) Enum() *CMsgDOTARedeemEventPrizeResponse_ResultCode { - p := new(CMsgDOTARedeemEventPrizeResponse_ResultCode) - *p = x - return p -} -func (x CMsgDOTARedeemEventPrizeResponse_ResultCode) String() string { - return proto.EnumName(CMsgDOTARedeemEventPrizeResponse_ResultCode_name, int32(x)) -} -func (x *CMsgDOTARedeemEventPrizeResponse_ResultCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTARedeemEventPrizeResponse_ResultCode_value, data, "CMsgDOTARedeemEventPrizeResponse_ResultCode") - if err != nil { - return err - } - *x = CMsgDOTARedeemEventPrizeResponse_ResultCode(value) - return nil -} -func (CMsgDOTARedeemEventPrizeResponse_ResultCode) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{245, 0} -} - -type CMsgGCNotificationsResponse_EResult int32 - -const ( - CMsgGCNotificationsResponse_SUCCESS CMsgGCNotificationsResponse_EResult = 0 - CMsgGCNotificationsResponse_ERROR_UNSPECIFIED CMsgGCNotificationsResponse_EResult = 1 -) - -var CMsgGCNotificationsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", -} -var CMsgGCNotificationsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, -} - -func (x CMsgGCNotificationsResponse_EResult) Enum() *CMsgGCNotificationsResponse_EResult { - p := new(CMsgGCNotificationsResponse_EResult) - *p = x - return p -} -func (x CMsgGCNotificationsResponse_EResult) String() string { - return proto.EnumName(CMsgGCNotificationsResponse_EResult_name, int32(x)) -} -func (x *CMsgGCNotificationsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGCNotificationsResponse_EResult_value, data, "CMsgGCNotificationsResponse_EResult") - if err != nil { - return err - } - *x = CMsgGCNotificationsResponse_EResult(value) - return nil -} -func (CMsgGCNotificationsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{258, 0} -} - -type CMsgGCPlayerInfoSubmitResponse_EResult int32 - -const ( - CMsgGCPlayerInfoSubmitResponse_SUCCESS CMsgGCPlayerInfoSubmitResponse_EResult = 0 - CMsgGCPlayerInfoSubmitResponse_ERROR_UNSPECIFIED CMsgGCPlayerInfoSubmitResponse_EResult = 1 - CMsgGCPlayerInfoSubmitResponse_ERROR_INFO_LOCKED CMsgGCPlayerInfoSubmitResponse_EResult = 2 -) - -var CMsgGCPlayerInfoSubmitResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_INFO_LOCKED", -} -var CMsgGCPlayerInfoSubmitResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_INFO_LOCKED": 2, -} - -func (x CMsgGCPlayerInfoSubmitResponse_EResult) Enum() *CMsgGCPlayerInfoSubmitResponse_EResult { - p := new(CMsgGCPlayerInfoSubmitResponse_EResult) - *p = x - return p -} -func (x CMsgGCPlayerInfoSubmitResponse_EResult) String() string { - return proto.EnumName(CMsgGCPlayerInfoSubmitResponse_EResult_name, int32(x)) -} -func (x *CMsgGCPlayerInfoSubmitResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGCPlayerInfoSubmitResponse_EResult_value, data, "CMsgGCPlayerInfoSubmitResponse_EResult") - if err != nil { - return err - } - *x = CMsgGCPlayerInfoSubmitResponse_EResult(value) - return nil -} -func (CMsgGCPlayerInfoSubmitResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{264, 0} -} - -type CMsgClientToGCCreateStaticRecipeResponse_EResponse int32 - -const ( - CMsgClientToGCCreateStaticRecipeResponse_eResponse_Success CMsgClientToGCCreateStaticRecipeResponse_EResponse = 0 - CMsgClientToGCCreateStaticRecipeResponse_eResponse_OfferingDisabled CMsgClientToGCCreateStaticRecipeResponse_EResponse = 1 - CMsgClientToGCCreateStaticRecipeResponse_eResponse_InvalidItems CMsgClientToGCCreateStaticRecipeResponse_EResponse = 2 - CMsgClientToGCCreateStaticRecipeResponse_eResponse_InternalError CMsgClientToGCCreateStaticRecipeResponse_EResponse = 3 - CMsgClientToGCCreateStaticRecipeResponse_eResponse_MissingLeague CMsgClientToGCCreateStaticRecipeResponse_EResponse = 4 -) - -var CMsgClientToGCCreateStaticRecipeResponse_EResponse_name = map[int32]string{ - 0: "eResponse_Success", - 1: "eResponse_OfferingDisabled", - 2: "eResponse_InvalidItems", - 3: "eResponse_InternalError", - 4: "eResponse_MissingLeague", -} -var CMsgClientToGCCreateStaticRecipeResponse_EResponse_value = map[string]int32{ - "eResponse_Success": 0, - "eResponse_OfferingDisabled": 1, - "eResponse_InvalidItems": 2, - "eResponse_InternalError": 3, - "eResponse_MissingLeague": 4, -} - -func (x CMsgClientToGCCreateStaticRecipeResponse_EResponse) Enum() *CMsgClientToGCCreateStaticRecipeResponse_EResponse { - p := new(CMsgClientToGCCreateStaticRecipeResponse_EResponse) - *p = x - return p -} -func (x CMsgClientToGCCreateStaticRecipeResponse_EResponse) String() string { - return proto.EnumName(CMsgClientToGCCreateStaticRecipeResponse_EResponse_name, int32(x)) -} -func (x *CMsgClientToGCCreateStaticRecipeResponse_EResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgClientToGCCreateStaticRecipeResponse_EResponse_value, data, "CMsgClientToGCCreateStaticRecipeResponse_EResponse") - if err != nil { - return err - } - *x = CMsgClientToGCCreateStaticRecipeResponse_EResponse(value) - return nil -} -func (CMsgClientToGCCreateStaticRecipeResponse_EResponse) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{328, 0} -} - -type CMsgGCToClientPrivateChatResponse_Result int32 - -const ( - CMsgGCToClientPrivateChatResponse_SUCCESS CMsgGCToClientPrivateChatResponse_Result = 0 - CMsgGCToClientPrivateChatResponse_FAILURE_CREATION_LOCK CMsgGCToClientPrivateChatResponse_Result = 1 - CMsgGCToClientPrivateChatResponse_FAILURE_SQL_TRANSACTION CMsgGCToClientPrivateChatResponse_Result = 2 - CMsgGCToClientPrivateChatResponse_FAILURE_SDO_LOAD CMsgGCToClientPrivateChatResponse_Result = 3 - CMsgGCToClientPrivateChatResponse_FAILURE_NO_PERMISSION CMsgGCToClientPrivateChatResponse_Result = 4 - CMsgGCToClientPrivateChatResponse_FAILURE_ALREADY_MEMBER CMsgGCToClientPrivateChatResponse_Result = 5 - CMsgGCToClientPrivateChatResponse_FAILURE_NOT_A_MEMBER CMsgGCToClientPrivateChatResponse_Result = 7 - CMsgGCToClientPrivateChatResponse_FAILURE_NO_REMAINING_ADMINS CMsgGCToClientPrivateChatResponse_Result = 8 - CMsgGCToClientPrivateChatResponse_FAILURE_NO_ROOM CMsgGCToClientPrivateChatResponse_Result = 9 - CMsgGCToClientPrivateChatResponse_FAILURE_CREATION_RATE_LIMITED CMsgGCToClientPrivateChatResponse_Result = 10 - CMsgGCToClientPrivateChatResponse_FAILURE_UNKNOWN_CHANNEL_NAME CMsgGCToClientPrivateChatResponse_Result = 11 - CMsgGCToClientPrivateChatResponse_FAILURE_UNKNOWN_USER CMsgGCToClientPrivateChatResponse_Result = 12 - CMsgGCToClientPrivateChatResponse_FAILURE_UNKNOWN_ERROR CMsgGCToClientPrivateChatResponse_Result = 13 - CMsgGCToClientPrivateChatResponse_FAILURE_CANNOT_KICK_ADMIN CMsgGCToClientPrivateChatResponse_Result = 14 - CMsgGCToClientPrivateChatResponse_FAILURE_ALREADY_ADMIN CMsgGCToClientPrivateChatResponse_Result = 15 -) - -var CMsgGCToClientPrivateChatResponse_Result_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILURE_CREATION_LOCK", - 2: "FAILURE_SQL_TRANSACTION", - 3: "FAILURE_SDO_LOAD", - 4: "FAILURE_NO_PERMISSION", - 5: "FAILURE_ALREADY_MEMBER", - 7: "FAILURE_NOT_A_MEMBER", - 8: "FAILURE_NO_REMAINING_ADMINS", - 9: "FAILURE_NO_ROOM", - 10: "FAILURE_CREATION_RATE_LIMITED", - 11: "FAILURE_UNKNOWN_CHANNEL_NAME", - 12: "FAILURE_UNKNOWN_USER", - 13: "FAILURE_UNKNOWN_ERROR", - 14: "FAILURE_CANNOT_KICK_ADMIN", - 15: "FAILURE_ALREADY_ADMIN", -} -var CMsgGCToClientPrivateChatResponse_Result_value = map[string]int32{ - "SUCCESS": 0, - "FAILURE_CREATION_LOCK": 1, - "FAILURE_SQL_TRANSACTION": 2, - "FAILURE_SDO_LOAD": 3, - "FAILURE_NO_PERMISSION": 4, - "FAILURE_ALREADY_MEMBER": 5, - "FAILURE_NOT_A_MEMBER": 7, - "FAILURE_NO_REMAINING_ADMINS": 8, - "FAILURE_NO_ROOM": 9, - "FAILURE_CREATION_RATE_LIMITED": 10, - "FAILURE_UNKNOWN_CHANNEL_NAME": 11, - "FAILURE_UNKNOWN_USER": 12, - "FAILURE_UNKNOWN_ERROR": 13, - "FAILURE_CANNOT_KICK_ADMIN": 14, - "FAILURE_ALREADY_ADMIN": 15, -} - -func (x CMsgGCToClientPrivateChatResponse_Result) Enum() *CMsgGCToClientPrivateChatResponse_Result { - p := new(CMsgGCToClientPrivateChatResponse_Result) - *p = x - return p -} -func (x CMsgGCToClientPrivateChatResponse_Result) String() string { - return proto.EnumName(CMsgGCToClientPrivateChatResponse_Result_name, int32(x)) -} -func (x *CMsgGCToClientPrivateChatResponse_Result) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGCToClientPrivateChatResponse_Result_value, data, "CMsgGCToClientPrivateChatResponse_Result") - if err != nil { - return err - } - *x = CMsgGCToClientPrivateChatResponse_Result(value) - return nil -} -func (CMsgGCToClientPrivateChatResponse_Result) EnumDescriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{342, 0} -} - -type CMsgStartFindingMatch struct { - Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Matchgroups *uint32 `protobuf:"varint,2,opt,name=matchgroups,def=4294967295" json:"matchgroups,omitempty"` - ClientVersion *uint32 `protobuf:"varint,3,opt,name=client_version" json:"client_version,omitempty"` - GameModes *uint32 `protobuf:"varint,4,opt,name=game_modes,def=4294967295" json:"game_modes,omitempty"` - BotDifficulty *DOTABotDifficulty `protobuf:"varint,5,opt,name=bot_difficulty,enum=DOTABotDifficulty,def=3" json:"bot_difficulty,omitempty"` - MatchType *MatchType `protobuf:"varint,6,opt,name=match_type,enum=MatchType,def=0" json:"match_type,omitempty"` - Matchlanguages *uint32 `protobuf:"varint,7,opt,name=matchlanguages,def=4294967295" json:"matchlanguages,omitempty"` - MapPreference *uint32 `protobuf:"varint,9,opt,name=map_preference" json:"map_preference,omitempty"` - TeamId *uint32 `protobuf:"varint,8,opt,name=team_id" json:"team_id,omitempty"` - GameLanguageEnum *MatchLanguages `protobuf:"varint,10,opt,name=game_language_enum,enum=MatchLanguages,def=0" json:"game_language_enum,omitempty"` - GameLanguageName *string `protobuf:"bytes,11,opt,name=game_language_name" json:"game_language_name,omitempty"` - PingData *CMsgClientPingData `protobuf:"bytes,12,opt,name=ping_data" json:"ping_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgStartFindingMatch) Reset() { *m = CMsgStartFindingMatch{} } -func (m *CMsgStartFindingMatch) String() string { return proto.CompactTextString(m) } -func (*CMsgStartFindingMatch) ProtoMessage() {} -func (*CMsgStartFindingMatch) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{0} } - -const Default_CMsgStartFindingMatch_Matchgroups uint32 = 4294967295 -const Default_CMsgStartFindingMatch_GameModes uint32 = 4294967295 -const Default_CMsgStartFindingMatch_BotDifficulty DOTABotDifficulty = DOTABotDifficulty_BOT_DIFFICULTY_HARD -const Default_CMsgStartFindingMatch_MatchType MatchType = MatchType_MATCH_TYPE_CASUAL -const Default_CMsgStartFindingMatch_Matchlanguages uint32 = 4294967295 -const Default_CMsgStartFindingMatch_GameLanguageEnum MatchLanguages = MatchLanguages_MATCH_LANGUAGE_INVALID - -func (m *CMsgStartFindingMatch) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *CMsgStartFindingMatch) GetMatchgroups() uint32 { - if m != nil && m.Matchgroups != nil { - return *m.Matchgroups - } - return Default_CMsgStartFindingMatch_Matchgroups -} - -func (m *CMsgStartFindingMatch) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgStartFindingMatch) GetGameModes() uint32 { - if m != nil && m.GameModes != nil { - return *m.GameModes - } - return Default_CMsgStartFindingMatch_GameModes -} - -func (m *CMsgStartFindingMatch) GetBotDifficulty() DOTABotDifficulty { - if m != nil && m.BotDifficulty != nil { - return *m.BotDifficulty - } - return Default_CMsgStartFindingMatch_BotDifficulty -} - -func (m *CMsgStartFindingMatch) GetMatchType() MatchType { - if m != nil && m.MatchType != nil { - return *m.MatchType - } - return Default_CMsgStartFindingMatch_MatchType -} - -func (m *CMsgStartFindingMatch) GetMatchlanguages() uint32 { - if m != nil && m.Matchlanguages != nil { - return *m.Matchlanguages - } - return Default_CMsgStartFindingMatch_Matchlanguages -} - -func (m *CMsgStartFindingMatch) GetMapPreference() uint32 { - if m != nil && m.MapPreference != nil { - return *m.MapPreference - } - return 0 -} - -func (m *CMsgStartFindingMatch) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgStartFindingMatch) GetGameLanguageEnum() MatchLanguages { - if m != nil && m.GameLanguageEnum != nil { - return *m.GameLanguageEnum - } - return Default_CMsgStartFindingMatch_GameLanguageEnum -} - -func (m *CMsgStartFindingMatch) GetGameLanguageName() string { - if m != nil && m.GameLanguageName != nil { - return *m.GameLanguageName - } - return "" -} - -func (m *CMsgStartFindingMatch) GetPingData() *CMsgClientPingData { - if m != nil { - return m.PingData - } - return nil -} - -type CMsgStopFindingMatch struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgStopFindingMatch) Reset() { *m = CMsgStopFindingMatch{} } -func (m *CMsgStopFindingMatch) String() string { return proto.CompactTextString(m) } -func (*CMsgStopFindingMatch) ProtoMessage() {} -func (*CMsgStopFindingMatch) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{1} } - -type CMsgReadyUp struct { - State *DOTALobbyReadyState `protobuf:"varint,1,opt,name=state,enum=DOTALobbyReadyState,def=0" json:"state,omitempty"` - ReadyUpKey *uint64 `protobuf:"fixed64,2,opt,name=ready_up_key" json:"ready_up_key,omitempty"` - HardwareSpecs *CDOTAClientHardwareSpecs `protobuf:"bytes,3,opt,name=hardware_specs" json:"hardware_specs,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReadyUp) Reset() { *m = CMsgReadyUp{} } -func (m *CMsgReadyUp) String() string { return proto.CompactTextString(m) } -func (*CMsgReadyUp) ProtoMessage() {} -func (*CMsgReadyUp) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{2} } - -const Default_CMsgReadyUp_State DOTALobbyReadyState = DOTALobbyReadyState_DOTALobbyReadyState_UNDECLARED - -func (m *CMsgReadyUp) GetState() DOTALobbyReadyState { - if m != nil && m.State != nil { - return *m.State - } - return Default_CMsgReadyUp_State -} - -func (m *CMsgReadyUp) GetReadyUpKey() uint64 { - if m != nil && m.ReadyUpKey != nil { - return *m.ReadyUpKey - } - return 0 -} - -func (m *CMsgReadyUp) GetHardwareSpecs() *CDOTAClientHardwareSpecs { - if m != nil { - return m.HardwareSpecs - } - return nil -} - -type CMsgReadyUpStatus struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - AcceptedIds []uint32 `protobuf:"varint,2,rep,name=accepted_ids" json:"accepted_ids,omitempty"` - DeclinedIds []uint32 `protobuf:"varint,3,rep,name=declined_ids" json:"declined_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReadyUpStatus) Reset() { *m = CMsgReadyUpStatus{} } -func (m *CMsgReadyUpStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgReadyUpStatus) ProtoMessage() {} -func (*CMsgReadyUpStatus) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{3} } - -func (m *CMsgReadyUpStatus) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgReadyUpStatus) GetAcceptedIds() []uint32 { - if m != nil { - return m.AcceptedIds - } - return nil -} - -func (m *CMsgReadyUpStatus) GetDeclinedIds() []uint32 { - if m != nil { - return m.DeclinedIds - } - return nil -} - -type CSourceTVGameSmall struct { - ActivateTime *uint32 `protobuf:"varint,1,opt,name=activate_time" json:"activate_time,omitempty"` - DeactivateTime *uint32 `protobuf:"varint,2,opt,name=deactivate_time" json:"deactivate_time,omitempty"` - ServerSteamId *uint64 `protobuf:"varint,3,opt,name=server_steam_id" json:"server_steam_id,omitempty"` - LobbyId *uint64 `protobuf:"varint,4,opt,name=lobby_id" json:"lobby_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,5,opt,name=league_id" json:"league_id,omitempty"` - LobbyType *uint32 `protobuf:"varint,6,opt,name=lobby_type" json:"lobby_type,omitempty"` - GameTime *int32 `protobuf:"varint,7,opt,name=game_time" json:"game_time,omitempty"` - Delay *uint32 `protobuf:"varint,8,opt,name=delay" json:"delay,omitempty"` - Spectators *uint32 `protobuf:"varint,9,opt,name=spectators" json:"spectators,omitempty"` - GameMode *uint32 `protobuf:"varint,10,opt,name=game_mode" json:"game_mode,omitempty"` - AverageMmr *uint32 `protobuf:"varint,11,opt,name=average_mmr" json:"average_mmr,omitempty"` - TeamNameRadiant *string `protobuf:"bytes,15,opt,name=team_name_radiant" json:"team_name_radiant,omitempty"` - TeamNameDire *string `protobuf:"bytes,16,opt,name=team_name_dire" json:"team_name_dire,omitempty"` - SortScore *uint32 `protobuf:"varint,17,opt,name=sort_score" json:"sort_score,omitempty"` - LastUpdateTime *float32 `protobuf:"fixed32,18,opt,name=last_update_time" json:"last_update_time,omitempty"` - RadiantLead *int32 `protobuf:"varint,19,opt,name=radiant_lead" json:"radiant_lead,omitempty"` - RadiantScore *uint32 `protobuf:"varint,20,opt,name=radiant_score" json:"radiant_score,omitempty"` - DireScore *uint32 `protobuf:"varint,21,opt,name=dire_score" json:"dire_score,omitempty"` - Players []*CSourceTVGameSmall_Player `protobuf:"bytes,22,rep,name=players" json:"players,omitempty"` - BuildingState *uint32 `protobuf:"fixed32,23,opt,name=building_state" json:"building_state,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSourceTVGameSmall) Reset() { *m = CSourceTVGameSmall{} } -func (m *CSourceTVGameSmall) String() string { return proto.CompactTextString(m) } -func (*CSourceTVGameSmall) ProtoMessage() {} -func (*CSourceTVGameSmall) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{4} } - -func (m *CSourceTVGameSmall) GetActivateTime() uint32 { - if m != nil && m.ActivateTime != nil { - return *m.ActivateTime - } - return 0 -} - -func (m *CSourceTVGameSmall) GetDeactivateTime() uint32 { - if m != nil && m.DeactivateTime != nil { - return *m.DeactivateTime - } - return 0 -} - -func (m *CSourceTVGameSmall) GetServerSteamId() uint64 { - if m != nil && m.ServerSteamId != nil { - return *m.ServerSteamId - } - return 0 -} - -func (m *CSourceTVGameSmall) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CSourceTVGameSmall) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CSourceTVGameSmall) GetLobbyType() uint32 { - if m != nil && m.LobbyType != nil { - return *m.LobbyType - } - return 0 -} - -func (m *CSourceTVGameSmall) GetGameTime() int32 { - if m != nil && m.GameTime != nil { - return *m.GameTime - } - return 0 -} - -func (m *CSourceTVGameSmall) GetDelay() uint32 { - if m != nil && m.Delay != nil { - return *m.Delay - } - return 0 -} - -func (m *CSourceTVGameSmall) GetSpectators() uint32 { - if m != nil && m.Spectators != nil { - return *m.Spectators - } - return 0 -} - -func (m *CSourceTVGameSmall) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CSourceTVGameSmall) GetAverageMmr() uint32 { - if m != nil && m.AverageMmr != nil { - return *m.AverageMmr - } - return 0 -} - -func (m *CSourceTVGameSmall) GetTeamNameRadiant() string { - if m != nil && m.TeamNameRadiant != nil { - return *m.TeamNameRadiant - } - return "" -} - -func (m *CSourceTVGameSmall) GetTeamNameDire() string { - if m != nil && m.TeamNameDire != nil { - return *m.TeamNameDire - } - return "" -} - -func (m *CSourceTVGameSmall) GetSortScore() uint32 { - if m != nil && m.SortScore != nil { - return *m.SortScore - } - return 0 -} - -func (m *CSourceTVGameSmall) GetLastUpdateTime() float32 { - if m != nil && m.LastUpdateTime != nil { - return *m.LastUpdateTime - } - return 0 -} - -func (m *CSourceTVGameSmall) GetRadiantLead() int32 { - if m != nil && m.RadiantLead != nil { - return *m.RadiantLead - } - return 0 -} - -func (m *CSourceTVGameSmall) GetRadiantScore() uint32 { - if m != nil && m.RadiantScore != nil { - return *m.RadiantScore - } - return 0 -} - -func (m *CSourceTVGameSmall) GetDireScore() uint32 { - if m != nil && m.DireScore != nil { - return *m.DireScore - } - return 0 -} - -func (m *CSourceTVGameSmall) GetPlayers() []*CSourceTVGameSmall_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CSourceTVGameSmall) GetBuildingState() uint32 { - if m != nil && m.BuildingState != nil { - return *m.BuildingState - } - return 0 -} - -type CSourceTVGameSmall_Player struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSourceTVGameSmall_Player) Reset() { *m = CSourceTVGameSmall_Player{} } -func (m *CSourceTVGameSmall_Player) String() string { return proto.CompactTextString(m) } -func (*CSourceTVGameSmall_Player) ProtoMessage() {} -func (*CSourceTVGameSmall_Player) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{4, 0} } - -func (m *CSourceTVGameSmall_Player) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSourceTVGameSmall_Player) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgClientToGCFindTopSourceTVGames struct { - SearchKey *string `protobuf:"bytes,1,opt,name=search_key" json:"search_key,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - StartGame *uint32 `protobuf:"varint,4,opt,name=start_game" json:"start_game,omitempty"` - GameListIndex *uint32 `protobuf:"varint,5,opt,name=game_list_index" json:"game_list_index,omitempty"` - LobbyIds []uint64 `protobuf:"varint,6,rep,name=lobby_ids" json:"lobby_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCFindTopSourceTVGames) Reset() { *m = CMsgClientToGCFindTopSourceTVGames{} } -func (m *CMsgClientToGCFindTopSourceTVGames) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCFindTopSourceTVGames) ProtoMessage() {} -func (*CMsgClientToGCFindTopSourceTVGames) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{5} -} - -func (m *CMsgClientToGCFindTopSourceTVGames) GetSearchKey() string { - if m != nil && m.SearchKey != nil { - return *m.SearchKey - } - return "" -} - -func (m *CMsgClientToGCFindTopSourceTVGames) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgClientToGCFindTopSourceTVGames) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgClientToGCFindTopSourceTVGames) GetStartGame() uint32 { - if m != nil && m.StartGame != nil { - return *m.StartGame - } - return 0 -} - -func (m *CMsgClientToGCFindTopSourceTVGames) GetGameListIndex() uint32 { - if m != nil && m.GameListIndex != nil { - return *m.GameListIndex - } - return 0 -} - -func (m *CMsgClientToGCFindTopSourceTVGames) GetLobbyIds() []uint64 { - if m != nil { - return m.LobbyIds - } - return nil -} - -type CMsgGCToClientFindTopSourceTVGamesResponse struct { - SearchKey *string `protobuf:"bytes,1,opt,name=search_key" json:"search_key,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - StartGame *uint32 `protobuf:"varint,4,opt,name=start_game" json:"start_game,omitempty"` - NumGames *uint32 `protobuf:"varint,5,opt,name=num_games" json:"num_games,omitempty"` - GameListIndex *uint32 `protobuf:"varint,6,opt,name=game_list_index" json:"game_list_index,omitempty"` - GameList []*CSourceTVGameSmall `protobuf:"bytes,7,rep,name=game_list" json:"game_list,omitempty"` - SpecificGames *bool `protobuf:"varint,8,opt,name=specific_games" json:"specific_games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) Reset() { - *m = CMsgGCToClientFindTopSourceTVGamesResponse{} -} -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientFindTopSourceTVGamesResponse) ProtoMessage() {} -func (*CMsgGCToClientFindTopSourceTVGamesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{6} -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetSearchKey() string { - if m != nil && m.SearchKey != nil { - return *m.SearchKey - } - return "" -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetStartGame() uint32 { - if m != nil && m.StartGame != nil { - return *m.StartGame - } - return 0 -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetNumGames() uint32 { - if m != nil && m.NumGames != nil { - return *m.NumGames - } - return 0 -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetGameListIndex() uint32 { - if m != nil && m.GameListIndex != nil { - return *m.GameListIndex - } - return 0 -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetGameList() []*CSourceTVGameSmall { - if m != nil { - return m.GameList - } - return nil -} - -func (m *CMsgGCToClientFindTopSourceTVGamesResponse) GetSpecificGames() bool { - if m != nil && m.SpecificGames != nil { - return *m.SpecificGames - } - return false -} - -type CMsgClientToGCTopMatchesRequest struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - PlayerAccountId *uint32 `protobuf:"varint,2,opt,name=player_account_id" json:"player_account_id,omitempty"` - TeamId *uint32 `protobuf:"varint,3,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCTopMatchesRequest) Reset() { *m = CMsgClientToGCTopMatchesRequest{} } -func (m *CMsgClientToGCTopMatchesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCTopMatchesRequest) ProtoMessage() {} -func (*CMsgClientToGCTopMatchesRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{7} } - -func (m *CMsgClientToGCTopMatchesRequest) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgClientToGCTopMatchesRequest) GetPlayerAccountId() uint32 { - if m != nil && m.PlayerAccountId != nil { - return *m.PlayerAccountId - } - return 0 -} - -func (m *CMsgClientToGCTopMatchesRequest) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgClientToGCTopLeagueMatchesRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCTopLeagueMatchesRequest) Reset() { *m = CMsgClientToGCTopLeagueMatchesRequest{} } -func (m *CMsgClientToGCTopLeagueMatchesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCTopLeagueMatchesRequest) ProtoMessage() {} -func (*CMsgClientToGCTopLeagueMatchesRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{8} -} - -type CMsgClientToGCTopFriendMatchesRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCTopFriendMatchesRequest) Reset() { *m = CMsgClientToGCTopFriendMatchesRequest{} } -func (m *CMsgClientToGCTopFriendMatchesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCTopFriendMatchesRequest) ProtoMessage() {} -func (*CMsgClientToGCTopFriendMatchesRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{9} -} - -type CMsgClientToGCMatchesMinimalRequest struct { - MatchIds []uint64 `protobuf:"varint,1,rep,name=match_ids" json:"match_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCMatchesMinimalRequest) Reset() { *m = CMsgClientToGCMatchesMinimalRequest{} } -func (m *CMsgClientToGCMatchesMinimalRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCMatchesMinimalRequest) ProtoMessage() {} -func (*CMsgClientToGCMatchesMinimalRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{10} -} - -func (m *CMsgClientToGCMatchesMinimalRequest) GetMatchIds() []uint64 { - if m != nil { - return m.MatchIds - } - return nil -} - -type CMsgClientToGCMatchesMinimalResponse struct { - Matches []*CMsgDOTAMatchMinimal `protobuf:"bytes,1,rep,name=matches" json:"matches,omitempty"` - LastMatch *bool `protobuf:"varint,2,opt,name=last_match" json:"last_match,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCMatchesMinimalResponse) Reset() { *m = CMsgClientToGCMatchesMinimalResponse{} } -func (m *CMsgClientToGCMatchesMinimalResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCMatchesMinimalResponse) ProtoMessage() {} -func (*CMsgClientToGCMatchesMinimalResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{11} -} - -func (m *CMsgClientToGCMatchesMinimalResponse) GetMatches() []*CMsgDOTAMatchMinimal { - if m != nil { - return m.Matches - } - return nil -} - -func (m *CMsgClientToGCMatchesMinimalResponse) GetLastMatch() bool { - if m != nil && m.LastMatch != nil { - return *m.LastMatch - } - return false -} - -type CMsgGCToClientTopLeagueMatchesResponse struct { - Matches []*CMsgDOTAMatchMinimal `protobuf:"bytes,2,rep,name=matches" json:"matches,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientTopLeagueMatchesResponse) Reset() { - *m = CMsgGCToClientTopLeagueMatchesResponse{} -} -func (m *CMsgGCToClientTopLeagueMatchesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientTopLeagueMatchesResponse) ProtoMessage() {} -func (*CMsgGCToClientTopLeagueMatchesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{12} -} - -func (m *CMsgGCToClientTopLeagueMatchesResponse) GetMatches() []*CMsgDOTAMatchMinimal { - if m != nil { - return m.Matches - } - return nil -} - -type CMsgGCToClientTopFriendMatchesResponse struct { - Matches []*CMsgDOTAMatchMinimal `protobuf:"bytes,1,rep,name=matches" json:"matches,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientTopFriendMatchesResponse) Reset() { - *m = CMsgGCToClientTopFriendMatchesResponse{} -} -func (m *CMsgGCToClientTopFriendMatchesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientTopFriendMatchesResponse) ProtoMessage() {} -func (*CMsgGCToClientTopFriendMatchesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{13} -} - -func (m *CMsgGCToClientTopFriendMatchesResponse) GetMatches() []*CMsgDOTAMatchMinimal { - if m != nil { - return m.Matches - } - return nil -} - -type CMsgClientToGCFindTopMatches struct { - StartGame *uint32 `protobuf:"varint,1,opt,name=start_game" json:"start_game,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - FriendId *uint32 `protobuf:"varint,4,opt,name=friend_id" json:"friend_id,omitempty"` - FriendList *bool `protobuf:"varint,5,opt,name=friend_list" json:"friend_list,omitempty"` - LeagueList *bool `protobuf:"varint,6,opt,name=league_list" json:"league_list,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCFindTopMatches) Reset() { *m = CMsgClientToGCFindTopMatches{} } -func (m *CMsgClientToGCFindTopMatches) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCFindTopMatches) ProtoMessage() {} -func (*CMsgClientToGCFindTopMatches) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{14} } - -func (m *CMsgClientToGCFindTopMatches) GetStartGame() uint32 { - if m != nil && m.StartGame != nil { - return *m.StartGame - } - return 0 -} - -func (m *CMsgClientToGCFindTopMatches) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgClientToGCFindTopMatches) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgClientToGCFindTopMatches) GetFriendId() uint32 { - if m != nil && m.FriendId != nil { - return *m.FriendId - } - return 0 -} - -func (m *CMsgClientToGCFindTopMatches) GetFriendList() bool { - if m != nil && m.FriendList != nil { - return *m.FriendList - } - return false -} - -func (m *CMsgClientToGCFindTopMatches) GetLeagueList() bool { - if m != nil && m.LeagueList != nil { - return *m.LeagueList - } - return false -} - -type CMsgGCToClientFindTopLeagueMatchesResponse struct { - StartGame *uint32 `protobuf:"varint,1,opt,name=start_game" json:"start_game,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - MatchIds []uint32 `protobuf:"varint,4,rep,name=match_ids" json:"match_ids,omitempty"` - Matches []*CMsgDOTAMatch `protobuf:"bytes,5,rep,name=matches" json:"matches,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) Reset() { - *m = CMsgGCToClientFindTopLeagueMatchesResponse{} -} -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientFindTopLeagueMatchesResponse) ProtoMessage() {} -func (*CMsgGCToClientFindTopLeagueMatchesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{15} -} - -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) GetStartGame() uint32 { - if m != nil && m.StartGame != nil { - return *m.StartGame - } - return 0 -} - -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) GetMatchIds() []uint32 { - if m != nil { - return m.MatchIds - } - return nil -} - -func (m *CMsgGCToClientFindTopLeagueMatchesResponse) GetMatches() []*CMsgDOTAMatch { - if m != nil { - return m.Matches - } - return nil -} - -type CMsgSpectateFriendGame struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSpectateFriendGame) Reset() { *m = CMsgSpectateFriendGame{} } -func (m *CMsgSpectateFriendGame) String() string { return proto.CompactTextString(m) } -func (*CMsgSpectateFriendGame) ProtoMessage() {} -func (*CMsgSpectateFriendGame) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{16} } - -func (m *CMsgSpectateFriendGame) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgSpectateFriendGameResponse struct { - ServerSteamid *uint64 `protobuf:"fixed64,4,opt,name=server_steamid" json:"server_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSpectateFriendGameResponse) Reset() { *m = CMsgSpectateFriendGameResponse{} } -func (m *CMsgSpectateFriendGameResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgSpectateFriendGameResponse) ProtoMessage() {} -func (*CMsgSpectateFriendGameResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{17} } - -func (m *CMsgSpectateFriendGameResponse) GetServerSteamid() uint64 { - if m != nil && m.ServerSteamid != nil { - return *m.ServerSteamid - } - return 0 -} - -type CMsgAbandonCurrentGame struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAbandonCurrentGame) Reset() { *m = CMsgAbandonCurrentGame{} } -func (m *CMsgAbandonCurrentGame) String() string { return proto.CompactTextString(m) } -func (*CMsgAbandonCurrentGame) ProtoMessage() {} -func (*CMsgAbandonCurrentGame) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{18} } - -type CMsgClientSuspended struct { - TimeEnd *uint32 `protobuf:"varint,1,opt,name=time_end" json:"time_end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientSuspended) Reset() { *m = CMsgClientSuspended{} } -func (m *CMsgClientSuspended) String() string { return proto.CompactTextString(m) } -func (*CMsgClientSuspended) ProtoMessage() {} -func (*CMsgClientSuspended) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{19} } - -func (m *CMsgClientSuspended) GetTimeEnd() uint32 { - if m != nil && m.TimeEnd != nil { - return *m.TimeEnd - } - return 0 -} - -type CMsgPracticeLobbySetDetails struct { - LobbyId *uint64 `protobuf:"varint,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - GameName *string `protobuf:"bytes,2,opt,name=game_name" json:"game_name,omitempty"` - TeamDetails []*CLobbyTeamDetails `protobuf:"bytes,3,rep,name=team_details" json:"team_details,omitempty"` - ServerRegion *uint32 `protobuf:"varint,4,opt,name=server_region" json:"server_region,omitempty"` - GameMode *uint32 `protobuf:"varint,5,opt,name=game_mode" json:"game_mode,omitempty"` - CmPick *DOTA_CM_PICK `protobuf:"varint,6,opt,name=cm_pick,enum=DOTA_CM_PICK,def=0" json:"cm_pick,omitempty"` - BotDifficulty *DOTABotDifficulty `protobuf:"varint,9,opt,name=bot_difficulty,enum=DOTABotDifficulty,def=2" json:"bot_difficulty,omitempty"` - AllowCheats *bool `protobuf:"varint,10,opt,name=allow_cheats" json:"allow_cheats,omitempty"` - FillWithBots *bool `protobuf:"varint,11,opt,name=fill_with_bots" json:"fill_with_bots,omitempty"` - IntroMode *bool `protobuf:"varint,12,opt,name=intro_mode" json:"intro_mode,omitempty"` - AllowSpectating *bool `protobuf:"varint,13,opt,name=allow_spectating" json:"allow_spectating,omitempty"` - GameVersion *DOTAGameVersion `protobuf:"varint,14,opt,name=game_version,enum=DOTAGameVersion,def=0" json:"game_version,omitempty"` - PassKey *string `protobuf:"bytes,15,opt,name=pass_key" json:"pass_key,omitempty"` - Leagueid *uint32 `protobuf:"varint,16,opt,name=leagueid" json:"leagueid,omitempty"` - PenaltyLevelRadiant *uint32 `protobuf:"varint,17,opt,name=penalty_level_radiant" json:"penalty_level_radiant,omitempty"` - PenaltyLevelDire *uint32 `protobuf:"varint,18,opt,name=penalty_level_dire" json:"penalty_level_dire,omitempty"` - LoadGameId *uint32 `protobuf:"varint,19,opt,name=load_game_id" json:"load_game_id,omitempty"` - SeriesType *uint32 `protobuf:"varint,20,opt,name=series_type" json:"series_type,omitempty"` - RadiantSeriesWins *uint32 `protobuf:"varint,21,opt,name=radiant_series_wins" json:"radiant_series_wins,omitempty"` - DireSeriesWins *uint32 `protobuf:"varint,22,opt,name=dire_series_wins" json:"dire_series_wins,omitempty"` - Allchat *bool `protobuf:"varint,23,opt,name=allchat,def=0" json:"allchat,omitempty"` - DotaTvDelay *LobbyDotaTVDelay `protobuf:"varint,24,opt,name=dota_tv_delay,enum=LobbyDotaTVDelay,def=1" json:"dota_tv_delay,omitempty"` - Lan *bool `protobuf:"varint,25,opt,name=lan" json:"lan,omitempty"` - CustomGameMode *string `protobuf:"bytes,26,opt,name=custom_game_mode" json:"custom_game_mode,omitempty"` - CustomMapName *string `protobuf:"bytes,27,opt,name=custom_map_name" json:"custom_map_name,omitempty"` - CustomDifficulty *uint32 `protobuf:"varint,28,opt,name=custom_difficulty" json:"custom_difficulty,omitempty"` - CustomGameId *uint64 `protobuf:"varint,29,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - CustomMinPlayers *uint32 `protobuf:"varint,30,opt,name=custom_min_players" json:"custom_min_players,omitempty"` - CustomMaxPlayers *uint32 `protobuf:"varint,31,opt,name=custom_max_players" json:"custom_max_players,omitempty"` - LanHostPingToServerRegion *uint32 `protobuf:"varint,32,opt,name=lan_host_ping_to_server_region" json:"lan_host_ping_to_server_region,omitempty"` - Visibility *DOTALobbyVisibility `protobuf:"varint,33,opt,name=visibility,enum=DOTALobbyVisibility,def=0" json:"visibility,omitempty"` - CustomGameCrc *uint64 `protobuf:"fixed64,34,opt,name=custom_game_crc" json:"custom_game_crc,omitempty"` - LeagueSeriesId *uint32 `protobuf:"varint,35,opt,name=league_series_id" json:"league_series_id,omitempty"` - LeagueGameId *uint32 `protobuf:"varint,36,opt,name=league_game_id" json:"league_game_id,omitempty"` - CustomGameTimestamp *uint32 `protobuf:"fixed32,37,opt,name=custom_game_timestamp" json:"custom_game_timestamp,omitempty"` - PreviousMatchOverride *uint64 `protobuf:"varint,38,opt,name=previous_match_override" json:"previous_match_override,omitempty"` - LeagueSelectionPriorityTeam *uint32 `protobuf:"varint,39,opt,name=league_selection_priority_team" json:"league_selection_priority_team,omitempty"` - LeagueSelectionPriorityChoice *SelectionPriorityType `protobuf:"varint,40,opt,name=league_selection_priority_choice,enum=SelectionPriorityType,def=0" json:"league_selection_priority_choice,omitempty"` - LeagueNonSelectionPriorityChoice *SelectionPriorityType `protobuf:"varint,41,opt,name=league_non_selection_priority_choice,enum=SelectionPriorityType,def=0" json:"league_non_selection_priority_choice,omitempty"` - PauseSetting *LobbyDotaPauseSetting `protobuf:"varint,42,opt,name=pause_setting,enum=LobbyDotaPauseSetting,def=0" json:"pause_setting,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbySetDetails) Reset() { *m = CMsgPracticeLobbySetDetails{} } -func (m *CMsgPracticeLobbySetDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbySetDetails) ProtoMessage() {} -func (*CMsgPracticeLobbySetDetails) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{20} } - -const Default_CMsgPracticeLobbySetDetails_CmPick DOTA_CM_PICK = DOTA_CM_PICK_DOTA_CM_RANDOM -const Default_CMsgPracticeLobbySetDetails_BotDifficulty DOTABotDifficulty = DOTABotDifficulty_BOT_DIFFICULTY_MEDIUM -const Default_CMsgPracticeLobbySetDetails_GameVersion DOTAGameVersion = DOTAGameVersion_GAME_VERSION_CURRENT -const Default_CMsgPracticeLobbySetDetails_Allchat bool = false -const Default_CMsgPracticeLobbySetDetails_DotaTvDelay LobbyDotaTVDelay = LobbyDotaTVDelay_LobbyDotaTV_120 -const Default_CMsgPracticeLobbySetDetails_Visibility DOTALobbyVisibility = DOTALobbyVisibility_DOTALobbyVisibility_Public -const Default_CMsgPracticeLobbySetDetails_LeagueSelectionPriorityChoice SelectionPriorityType = SelectionPriorityType_UNDEFINED -const Default_CMsgPracticeLobbySetDetails_LeagueNonSelectionPriorityChoice SelectionPriorityType = SelectionPriorityType_UNDEFINED -const Default_CMsgPracticeLobbySetDetails_PauseSetting LobbyDotaPauseSetting = LobbyDotaPauseSetting_LobbyDotaPauseSetting_Unlimited - -func (m *CMsgPracticeLobbySetDetails) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetGameName() string { - if m != nil && m.GameName != nil { - return *m.GameName - } - return "" -} - -func (m *CMsgPracticeLobbySetDetails) GetTeamDetails() []*CLobbyTeamDetails { - if m != nil { - return m.TeamDetails - } - return nil -} - -func (m *CMsgPracticeLobbySetDetails) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetCmPick() DOTA_CM_PICK { - if m != nil && m.CmPick != nil { - return *m.CmPick - } - return Default_CMsgPracticeLobbySetDetails_CmPick -} - -func (m *CMsgPracticeLobbySetDetails) GetBotDifficulty() DOTABotDifficulty { - if m != nil && m.BotDifficulty != nil { - return *m.BotDifficulty - } - return Default_CMsgPracticeLobbySetDetails_BotDifficulty -} - -func (m *CMsgPracticeLobbySetDetails) GetAllowCheats() bool { - if m != nil && m.AllowCheats != nil { - return *m.AllowCheats - } - return false -} - -func (m *CMsgPracticeLobbySetDetails) GetFillWithBots() bool { - if m != nil && m.FillWithBots != nil { - return *m.FillWithBots - } - return false -} - -func (m *CMsgPracticeLobbySetDetails) GetIntroMode() bool { - if m != nil && m.IntroMode != nil { - return *m.IntroMode - } - return false -} - -func (m *CMsgPracticeLobbySetDetails) GetAllowSpectating() bool { - if m != nil && m.AllowSpectating != nil { - return *m.AllowSpectating - } - return false -} - -func (m *CMsgPracticeLobbySetDetails) GetGameVersion() DOTAGameVersion { - if m != nil && m.GameVersion != nil { - return *m.GameVersion - } - return Default_CMsgPracticeLobbySetDetails_GameVersion -} - -func (m *CMsgPracticeLobbySetDetails) GetPassKey() string { - if m != nil && m.PassKey != nil { - return *m.PassKey - } - return "" -} - -func (m *CMsgPracticeLobbySetDetails) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetPenaltyLevelRadiant() uint32 { - if m != nil && m.PenaltyLevelRadiant != nil { - return *m.PenaltyLevelRadiant - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetPenaltyLevelDire() uint32 { - if m != nil && m.PenaltyLevelDire != nil { - return *m.PenaltyLevelDire - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetLoadGameId() uint32 { - if m != nil && m.LoadGameId != nil { - return *m.LoadGameId - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetRadiantSeriesWins() uint32 { - if m != nil && m.RadiantSeriesWins != nil { - return *m.RadiantSeriesWins - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetDireSeriesWins() uint32 { - if m != nil && m.DireSeriesWins != nil { - return *m.DireSeriesWins - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetAllchat() bool { - if m != nil && m.Allchat != nil { - return *m.Allchat - } - return Default_CMsgPracticeLobbySetDetails_Allchat -} - -func (m *CMsgPracticeLobbySetDetails) GetDotaTvDelay() LobbyDotaTVDelay { - if m != nil && m.DotaTvDelay != nil { - return *m.DotaTvDelay - } - return Default_CMsgPracticeLobbySetDetails_DotaTvDelay -} - -func (m *CMsgPracticeLobbySetDetails) GetLan() bool { - if m != nil && m.Lan != nil { - return *m.Lan - } - return false -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomGameMode() string { - if m != nil && m.CustomGameMode != nil { - return *m.CustomGameMode - } - return "" -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomMapName() string { - if m != nil && m.CustomMapName != nil { - return *m.CustomMapName - } - return "" -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomDifficulty() uint32 { - if m != nil && m.CustomDifficulty != nil { - return *m.CustomDifficulty - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomMinPlayers() uint32 { - if m != nil && m.CustomMinPlayers != nil { - return *m.CustomMinPlayers - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomMaxPlayers() uint32 { - if m != nil && m.CustomMaxPlayers != nil { - return *m.CustomMaxPlayers - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetLanHostPingToServerRegion() uint32 { - if m != nil && m.LanHostPingToServerRegion != nil { - return *m.LanHostPingToServerRegion - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetVisibility() DOTALobbyVisibility { - if m != nil && m.Visibility != nil { - return *m.Visibility - } - return Default_CMsgPracticeLobbySetDetails_Visibility -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomGameCrc() uint64 { - if m != nil && m.CustomGameCrc != nil { - return *m.CustomGameCrc - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetLeagueSeriesId() uint32 { - if m != nil && m.LeagueSeriesId != nil { - return *m.LeagueSeriesId - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetLeagueGameId() uint32 { - if m != nil && m.LeagueGameId != nil { - return *m.LeagueGameId - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetCustomGameTimestamp() uint32 { - if m != nil && m.CustomGameTimestamp != nil { - return *m.CustomGameTimestamp - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetPreviousMatchOverride() uint64 { - if m != nil && m.PreviousMatchOverride != nil { - return *m.PreviousMatchOverride - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetLeagueSelectionPriorityTeam() uint32 { - if m != nil && m.LeagueSelectionPriorityTeam != nil { - return *m.LeagueSelectionPriorityTeam - } - return 0 -} - -func (m *CMsgPracticeLobbySetDetails) GetLeagueSelectionPriorityChoice() SelectionPriorityType { - if m != nil && m.LeagueSelectionPriorityChoice != nil { - return *m.LeagueSelectionPriorityChoice - } - return Default_CMsgPracticeLobbySetDetails_LeagueSelectionPriorityChoice -} - -func (m *CMsgPracticeLobbySetDetails) GetLeagueNonSelectionPriorityChoice() SelectionPriorityType { - if m != nil && m.LeagueNonSelectionPriorityChoice != nil { - return *m.LeagueNonSelectionPriorityChoice - } - return Default_CMsgPracticeLobbySetDetails_LeagueNonSelectionPriorityChoice -} - -func (m *CMsgPracticeLobbySetDetails) GetPauseSetting() LobbyDotaPauseSetting { - if m != nil && m.PauseSetting != nil { - return *m.PauseSetting - } - return Default_CMsgPracticeLobbySetDetails_PauseSetting -} - -type CMsgPracticeLobbyCreate struct { - SearchKey *string `protobuf:"bytes,1,opt,name=search_key" json:"search_key,omitempty"` - TournamentGame *bool `protobuf:"varint,2,opt,name=tournament_game" json:"tournament_game,omitempty"` - TournamentGameId *uint32 `protobuf:"varint,3,opt,name=tournament_game_id" json:"tournament_game_id,omitempty"` - TournamentId *uint32 `protobuf:"varint,4,opt,name=tournament_id" json:"tournament_id,omitempty"` - PassKey *string `protobuf:"bytes,5,opt,name=pass_key" json:"pass_key,omitempty"` - ClientVersion *uint32 `protobuf:"varint,6,opt,name=client_version" json:"client_version,omitempty"` - LobbyDetails *CMsgPracticeLobbySetDetails `protobuf:"bytes,7,opt,name=lobby_details" json:"lobby_details,omitempty"` - SaveGame *CMsgPracticeLobbyCreate_SaveGame `protobuf:"bytes,8,opt,name=save_game" json:"save_game,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyCreate) Reset() { *m = CMsgPracticeLobbyCreate{} } -func (m *CMsgPracticeLobbyCreate) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyCreate) ProtoMessage() {} -func (*CMsgPracticeLobbyCreate) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{21} } - -func (m *CMsgPracticeLobbyCreate) GetSearchKey() string { - if m != nil && m.SearchKey != nil { - return *m.SearchKey - } - return "" -} - -func (m *CMsgPracticeLobbyCreate) GetTournamentGame() bool { - if m != nil && m.TournamentGame != nil { - return *m.TournamentGame - } - return false -} - -func (m *CMsgPracticeLobbyCreate) GetTournamentGameId() uint32 { - if m != nil && m.TournamentGameId != nil { - return *m.TournamentGameId - } - return 0 -} - -func (m *CMsgPracticeLobbyCreate) GetTournamentId() uint32 { - if m != nil && m.TournamentId != nil { - return *m.TournamentId - } - return 0 -} - -func (m *CMsgPracticeLobbyCreate) GetPassKey() string { - if m != nil && m.PassKey != nil { - return *m.PassKey - } - return "" -} - -func (m *CMsgPracticeLobbyCreate) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgPracticeLobbyCreate) GetLobbyDetails() *CMsgPracticeLobbySetDetails { - if m != nil { - return m.LobbyDetails - } - return nil -} - -func (m *CMsgPracticeLobbyCreate) GetSaveGame() *CMsgPracticeLobbyCreate_SaveGame { - if m != nil { - return m.SaveGame - } - return nil -} - -type CMsgPracticeLobbyCreate_SaveGame struct { - Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - Version *int32 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` - SteamId *uint64 `protobuf:"fixed64,3,opt,name=steam_id" json:"steam_id,omitempty"` - Signature *uint64 `protobuf:"fixed64,4,opt,name=signature" json:"signature,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyCreate_SaveGame) Reset() { *m = CMsgPracticeLobbyCreate_SaveGame{} } -func (m *CMsgPracticeLobbyCreate_SaveGame) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyCreate_SaveGame) ProtoMessage() {} -func (*CMsgPracticeLobbyCreate_SaveGame) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{21, 0} -} - -func (m *CMsgPracticeLobbyCreate_SaveGame) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *CMsgPracticeLobbyCreate_SaveGame) GetVersion() int32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgPracticeLobbyCreate_SaveGame) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgPracticeLobbyCreate_SaveGame) GetSignature() uint64 { - if m != nil && m.Signature != nil { - return *m.Signature - } - return 0 -} - -type CMsgPracticeLobbySetTeamSlot struct { - Team *DOTA_GC_TEAM `protobuf:"varint,1,opt,name=team,enum=DOTA_GC_TEAM,def=0" json:"team,omitempty"` - Slot *uint32 `protobuf:"varint,2,opt,name=slot" json:"slot,omitempty"` - BotDifficulty *DOTABotDifficulty `protobuf:"varint,3,opt,name=bot_difficulty,enum=DOTABotDifficulty,def=0" json:"bot_difficulty,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbySetTeamSlot) Reset() { *m = CMsgPracticeLobbySetTeamSlot{} } -func (m *CMsgPracticeLobbySetTeamSlot) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbySetTeamSlot) ProtoMessage() {} -func (*CMsgPracticeLobbySetTeamSlot) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{22} } - -const Default_CMsgPracticeLobbySetTeamSlot_Team DOTA_GC_TEAM = DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS -const Default_CMsgPracticeLobbySetTeamSlot_BotDifficulty DOTABotDifficulty = DOTABotDifficulty_BOT_DIFFICULTY_PASSIVE - -func (m *CMsgPracticeLobbySetTeamSlot) GetTeam() DOTA_GC_TEAM { - if m != nil && m.Team != nil { - return *m.Team - } - return Default_CMsgPracticeLobbySetTeamSlot_Team -} - -func (m *CMsgPracticeLobbySetTeamSlot) GetSlot() uint32 { - if m != nil && m.Slot != nil { - return *m.Slot - } - return 0 -} - -func (m *CMsgPracticeLobbySetTeamSlot) GetBotDifficulty() DOTABotDifficulty { - if m != nil && m.BotDifficulty != nil { - return *m.BotDifficulty - } - return Default_CMsgPracticeLobbySetTeamSlot_BotDifficulty -} - -type CMsgPracticeLobbySetCoach struct { - Team *DOTA_GC_TEAM `protobuf:"varint,1,opt,name=team,enum=DOTA_GC_TEAM,def=0" json:"team,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbySetCoach) Reset() { *m = CMsgPracticeLobbySetCoach{} } -func (m *CMsgPracticeLobbySetCoach) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbySetCoach) ProtoMessage() {} -func (*CMsgPracticeLobbySetCoach) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{23} } - -const Default_CMsgPracticeLobbySetCoach_Team DOTA_GC_TEAM = DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS - -func (m *CMsgPracticeLobbySetCoach) GetTeam() DOTA_GC_TEAM { - if m != nil && m.Team != nil { - return *m.Team - } - return Default_CMsgPracticeLobbySetCoach_Team -} - -type CMsgPracticeLobbyJoinBroadcastChannel struct { - Channel *uint32 `protobuf:"varint,1,opt,name=channel" json:"channel,omitempty"` - PreferredDescription *string `protobuf:"bytes,2,opt,name=preferred_description" json:"preferred_description,omitempty"` - PreferredCountryCode *string `protobuf:"bytes,3,opt,name=preferred_country_code" json:"preferred_country_code,omitempty"` - PreferredLanguageCode *string `protobuf:"bytes,4,opt,name=preferred_language_code" json:"preferred_language_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyJoinBroadcastChannel) Reset() { *m = CMsgPracticeLobbyJoinBroadcastChannel{} } -func (m *CMsgPracticeLobbyJoinBroadcastChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyJoinBroadcastChannel) ProtoMessage() {} -func (*CMsgPracticeLobbyJoinBroadcastChannel) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{24} -} - -func (m *CMsgPracticeLobbyJoinBroadcastChannel) GetChannel() uint32 { - if m != nil && m.Channel != nil { - return *m.Channel - } - return 0 -} - -func (m *CMsgPracticeLobbyJoinBroadcastChannel) GetPreferredDescription() string { - if m != nil && m.PreferredDescription != nil { - return *m.PreferredDescription - } - return "" -} - -func (m *CMsgPracticeLobbyJoinBroadcastChannel) GetPreferredCountryCode() string { - if m != nil && m.PreferredCountryCode != nil { - return *m.PreferredCountryCode - } - return "" -} - -func (m *CMsgPracticeLobbyJoinBroadcastChannel) GetPreferredLanguageCode() string { - if m != nil && m.PreferredLanguageCode != nil { - return *m.PreferredLanguageCode - } - return "" -} - -type CMsgPracticeLobbyCloseBroadcastChannel struct { - Channel *uint32 `protobuf:"varint,1,opt,name=channel" json:"channel,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyCloseBroadcastChannel) Reset() { - *m = CMsgPracticeLobbyCloseBroadcastChannel{} -} -func (m *CMsgPracticeLobbyCloseBroadcastChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyCloseBroadcastChannel) ProtoMessage() {} -func (*CMsgPracticeLobbyCloseBroadcastChannel) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{25} -} - -func (m *CMsgPracticeLobbyCloseBroadcastChannel) GetChannel() uint32 { - if m != nil && m.Channel != nil { - return *m.Channel - } - return 0 -} - -type CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus) Reset() { - *m = CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus{} -} -func (m *CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus) String() string { - return proto.CompactTextString(m) -} -func (*CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus) ProtoMessage() {} -func (*CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{26} -} - -type CMsgPracticeLobbyKick struct { - AccountId *uint32 `protobuf:"varint,3,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyKick) Reset() { *m = CMsgPracticeLobbyKick{} } -func (m *CMsgPracticeLobbyKick) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyKick) ProtoMessage() {} -func (*CMsgPracticeLobbyKick) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{27} } - -func (m *CMsgPracticeLobbyKick) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgPracticeLobbyKickFromTeam struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyKickFromTeam) Reset() { *m = CMsgPracticeLobbyKickFromTeam{} } -func (m *CMsgPracticeLobbyKickFromTeam) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyKickFromTeam) ProtoMessage() {} -func (*CMsgPracticeLobbyKickFromTeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{28} } - -func (m *CMsgPracticeLobbyKickFromTeam) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgPracticeLobbyLeave struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyLeave) Reset() { *m = CMsgPracticeLobbyLeave{} } -func (m *CMsgPracticeLobbyLeave) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyLeave) ProtoMessage() {} -func (*CMsgPracticeLobbyLeave) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{29} } - -type CMsgPracticeLobbyLaunch struct { - ClientVersion *uint32 `protobuf:"varint,5,opt,name=client_version" json:"client_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyLaunch) Reset() { *m = CMsgPracticeLobbyLaunch{} } -func (m *CMsgPracticeLobbyLaunch) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyLaunch) ProtoMessage() {} -func (*CMsgPracticeLobbyLaunch) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{30} } - -func (m *CMsgPracticeLobbyLaunch) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -type CMsgApplyTeamToPracticeLobby struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyTeamToPracticeLobby) Reset() { *m = CMsgApplyTeamToPracticeLobby{} } -func (m *CMsgApplyTeamToPracticeLobby) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyTeamToPracticeLobby) ProtoMessage() {} -func (*CMsgApplyTeamToPracticeLobby) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{31} } - -func (m *CMsgApplyTeamToPracticeLobby) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgClearPracticeLobbyTeam struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClearPracticeLobbyTeam) Reset() { *m = CMsgClearPracticeLobbyTeam{} } -func (m *CMsgClearPracticeLobbyTeam) String() string { return proto.CompactTextString(m) } -func (*CMsgClearPracticeLobbyTeam) ProtoMessage() {} -func (*CMsgClearPracticeLobbyTeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{32} } - -type CMsgPracticeLobbyList struct { - TournamentGames *bool `protobuf:"varint,1,opt,name=tournament_games" json:"tournament_games,omitempty"` - PassKey *string `protobuf:"bytes,2,opt,name=pass_key" json:"pass_key,omitempty"` - Region *uint32 `protobuf:"varint,3,opt,name=region" json:"region,omitempty"` - GameMode *DOTA_GameMode `protobuf:"varint,4,opt,name=game_mode,enum=DOTA_GameMode,def=0" json:"game_mode,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyList) Reset() { *m = CMsgPracticeLobbyList{} } -func (m *CMsgPracticeLobbyList) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyList) ProtoMessage() {} -func (*CMsgPracticeLobbyList) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{33} } - -const Default_CMsgPracticeLobbyList_GameMode DOTA_GameMode = DOTA_GameMode_DOTA_GAMEMODE_NONE - -func (m *CMsgPracticeLobbyList) GetTournamentGames() bool { - if m != nil && m.TournamentGames != nil { - return *m.TournamentGames - } - return false -} - -func (m *CMsgPracticeLobbyList) GetPassKey() string { - if m != nil && m.PassKey != nil { - return *m.PassKey - } - return "" -} - -func (m *CMsgPracticeLobbyList) GetRegion() uint32 { - if m != nil && m.Region != nil { - return *m.Region - } - return 0 -} - -func (m *CMsgPracticeLobbyList) GetGameMode() DOTA_GameMode { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return Default_CMsgPracticeLobbyList_GameMode -} - -type CMsgPracticeLobbyListResponseEntry struct { - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - TournamentId *uint32 `protobuf:"varint,3,opt,name=tournament_id" json:"tournament_id,omitempty"` - TournamentGameId *uint32 `protobuf:"varint,4,opt,name=tournament_game_id" json:"tournament_game_id,omitempty"` - Members []*CMsgPracticeLobbyListResponseEntry_CLobbyMember `protobuf:"bytes,5,rep,name=members" json:"members,omitempty"` - RequiresPassKey *bool `protobuf:"varint,6,opt,name=requires_pass_key" json:"requires_pass_key,omitempty"` - LeaderAccountId *uint32 `protobuf:"varint,7,opt,name=leader_account_id" json:"leader_account_id,omitempty"` - GuildId *uint32 `protobuf:"varint,8,opt,name=guild_id" json:"guild_id,omitempty"` - GuildLogo *uint64 `protobuf:"varint,9,opt,name=guild_logo" json:"guild_logo,omitempty"` - Name *string `protobuf:"bytes,10,opt,name=name" json:"name,omitempty"` - CustomGameMode *string `protobuf:"bytes,11,opt,name=custom_game_mode" json:"custom_game_mode,omitempty"` - GameMode *DOTA_GameMode `protobuf:"varint,12,opt,name=game_mode,enum=DOTA_GameMode,def=0" json:"game_mode,omitempty"` - FriendPresent *bool `protobuf:"varint,13,opt,name=friend_present" json:"friend_present,omitempty"` - Players *uint32 `protobuf:"varint,14,opt,name=players" json:"players,omitempty"` - CustomMapName *string `protobuf:"bytes,15,opt,name=custom_map_name" json:"custom_map_name,omitempty"` - MaxPlayerCount *uint32 `protobuf:"varint,16,opt,name=max_player_count" json:"max_player_count,omitempty"` - ServerRegion *uint32 `protobuf:"varint,17,opt,name=server_region" json:"server_region,omitempty"` - LanHostPingToServerRegion *uint32 `protobuf:"varint,18,opt,name=lan_host_ping_to_server_region" json:"lan_host_ping_to_server_region,omitempty"` - LeagueId *uint32 `protobuf:"varint,19,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyListResponseEntry) Reset() { *m = CMsgPracticeLobbyListResponseEntry{} } -func (m *CMsgPracticeLobbyListResponseEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyListResponseEntry) ProtoMessage() {} -func (*CMsgPracticeLobbyListResponseEntry) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{34} -} - -const Default_CMsgPracticeLobbyListResponseEntry_GameMode DOTA_GameMode = DOTA_GameMode_DOTA_GAMEMODE_NONE - -func (m *CMsgPracticeLobbyListResponseEntry) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetTournamentId() uint32 { - if m != nil && m.TournamentId != nil { - return *m.TournamentId - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetTournamentGameId() uint32 { - if m != nil && m.TournamentGameId != nil { - return *m.TournamentGameId - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetMembers() []*CMsgPracticeLobbyListResponseEntry_CLobbyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetRequiresPassKey() bool { - if m != nil && m.RequiresPassKey != nil { - return *m.RequiresPassKey - } - return false -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetLeaderAccountId() uint32 { - if m != nil && m.LeaderAccountId != nil { - return *m.LeaderAccountId - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetGuildLogo() uint64 { - if m != nil && m.GuildLogo != nil { - return *m.GuildLogo - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetCustomGameMode() string { - if m != nil && m.CustomGameMode != nil { - return *m.CustomGameMode - } - return "" -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetGameMode() DOTA_GameMode { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return Default_CMsgPracticeLobbyListResponseEntry_GameMode -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetFriendPresent() bool { - if m != nil && m.FriendPresent != nil { - return *m.FriendPresent - } - return false -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetPlayers() uint32 { - if m != nil && m.Players != nil { - return *m.Players - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetCustomMapName() string { - if m != nil && m.CustomMapName != nil { - return *m.CustomMapName - } - return "" -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetMaxPlayerCount() uint32 { - if m != nil && m.MaxPlayerCount != nil { - return *m.MaxPlayerCount - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetLanHostPingToServerRegion() uint32 { - if m != nil && m.LanHostPingToServerRegion != nil { - return *m.LanHostPingToServerRegion - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgPracticeLobbyListResponseEntry_CLobbyMember struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - PlayerName *string `protobuf:"bytes,2,opt,name=player_name" json:"player_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyListResponseEntry_CLobbyMember) Reset() { - *m = CMsgPracticeLobbyListResponseEntry_CLobbyMember{} -} -func (m *CMsgPracticeLobbyListResponseEntry_CLobbyMember) String() string { - return proto.CompactTextString(m) -} -func (*CMsgPracticeLobbyListResponseEntry_CLobbyMember) ProtoMessage() {} -func (*CMsgPracticeLobbyListResponseEntry_CLobbyMember) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{34, 0} -} - -func (m *CMsgPracticeLobbyListResponseEntry_CLobbyMember) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgPracticeLobbyListResponseEntry_CLobbyMember) GetPlayerName() string { - if m != nil && m.PlayerName != nil { - return *m.PlayerName - } - return "" -} - -type CMsgPracticeLobbyListResponse struct { - TournamentGames *bool `protobuf:"varint,1,opt,name=tournament_games" json:"tournament_games,omitempty"` - Lobbies []*CMsgPracticeLobbyListResponseEntry `protobuf:"bytes,2,rep,name=lobbies" json:"lobbies,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyListResponse) Reset() { *m = CMsgPracticeLobbyListResponse{} } -func (m *CMsgPracticeLobbyListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyListResponse) ProtoMessage() {} -func (*CMsgPracticeLobbyListResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{35} } - -func (m *CMsgPracticeLobbyListResponse) GetTournamentGames() bool { - if m != nil && m.TournamentGames != nil { - return *m.TournamentGames - } - return false -} - -func (m *CMsgPracticeLobbyListResponse) GetLobbies() []*CMsgPracticeLobbyListResponseEntry { - if m != nil { - return m.Lobbies - } - return nil -} - -type CMsgLobbyList struct { - ServerRegion *uint32 `protobuf:"varint,1,opt,name=server_region,def=0" json:"server_region,omitempty"` - GameMode *DOTA_GameMode `protobuf:"varint,2,opt,name=game_mode,enum=DOTA_GameMode,def=0" json:"game_mode,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLobbyList) Reset() { *m = CMsgLobbyList{} } -func (m *CMsgLobbyList) String() string { return proto.CompactTextString(m) } -func (*CMsgLobbyList) ProtoMessage() {} -func (*CMsgLobbyList) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{36} } - -const Default_CMsgLobbyList_ServerRegion uint32 = 0 -const Default_CMsgLobbyList_GameMode DOTA_GameMode = DOTA_GameMode_DOTA_GAMEMODE_NONE - -func (m *CMsgLobbyList) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return Default_CMsgLobbyList_ServerRegion -} - -func (m *CMsgLobbyList) GetGameMode() DOTA_GameMode { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return Default_CMsgLobbyList_GameMode -} - -type CMsgLobbyListResponse struct { - Lobbies []*CMsgPracticeLobbyListResponseEntry `protobuf:"bytes,1,rep,name=lobbies" json:"lobbies,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLobbyListResponse) Reset() { *m = CMsgLobbyListResponse{} } -func (m *CMsgLobbyListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgLobbyListResponse) ProtoMessage() {} -func (*CMsgLobbyListResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{37} } - -func (m *CMsgLobbyListResponse) GetLobbies() []*CMsgPracticeLobbyListResponseEntry { - if m != nil { - return m.Lobbies - } - return nil -} - -type CMsgPracticeLobbyJoin struct { - LobbyId *uint64 `protobuf:"varint,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - PassKey *string `protobuf:"bytes,3,opt,name=pass_key" json:"pass_key,omitempty"` - CustomGameCrc *uint64 `protobuf:"fixed64,4,opt,name=custom_game_crc" json:"custom_game_crc,omitempty"` - CustomGameTimestamp *uint32 `protobuf:"fixed32,5,opt,name=custom_game_timestamp" json:"custom_game_timestamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyJoin) Reset() { *m = CMsgPracticeLobbyJoin{} } -func (m *CMsgPracticeLobbyJoin) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyJoin) ProtoMessage() {} -func (*CMsgPracticeLobbyJoin) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{38} } - -func (m *CMsgPracticeLobbyJoin) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgPracticeLobbyJoin) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgPracticeLobbyJoin) GetPassKey() string { - if m != nil && m.PassKey != nil { - return *m.PassKey - } - return "" -} - -func (m *CMsgPracticeLobbyJoin) GetCustomGameCrc() uint64 { - if m != nil && m.CustomGameCrc != nil { - return *m.CustomGameCrc - } - return 0 -} - -func (m *CMsgPracticeLobbyJoin) GetCustomGameTimestamp() uint32 { - if m != nil && m.CustomGameTimestamp != nil { - return *m.CustomGameTimestamp - } - return 0 -} - -type CMsgPracticeLobbyJoinResponse struct { - Result *DOTAJoinLobbyResult `protobuf:"varint,1,opt,name=result,enum=DOTAJoinLobbyResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPracticeLobbyJoinResponse) Reset() { *m = CMsgPracticeLobbyJoinResponse{} } -func (m *CMsgPracticeLobbyJoinResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgPracticeLobbyJoinResponse) ProtoMessage() {} -func (*CMsgPracticeLobbyJoinResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{39} } - -const Default_CMsgPracticeLobbyJoinResponse_Result DOTAJoinLobbyResult = DOTAJoinLobbyResult_DOTA_JOIN_RESULT_SUCCESS - -func (m *CMsgPracticeLobbyJoinResponse) GetResult() DOTAJoinLobbyResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgPracticeLobbyJoinResponse_Result -} - -type CMsgFriendPracticeLobbyListRequest struct { - Friends []uint32 `protobuf:"varint,1,rep,name=friends" json:"friends,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgFriendPracticeLobbyListRequest) Reset() { *m = CMsgFriendPracticeLobbyListRequest{} } -func (m *CMsgFriendPracticeLobbyListRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgFriendPracticeLobbyListRequest) ProtoMessage() {} -func (*CMsgFriendPracticeLobbyListRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{40} -} - -func (m *CMsgFriendPracticeLobbyListRequest) GetFriends() []uint32 { - if m != nil { - return m.Friends - } - return nil -} - -type CMsgFriendPracticeLobbyListResponse struct { - Lobbies []*CMsgPracticeLobbyListResponseEntry `protobuf:"bytes,1,rep,name=lobbies" json:"lobbies,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgFriendPracticeLobbyListResponse) Reset() { *m = CMsgFriendPracticeLobbyListResponse{} } -func (m *CMsgFriendPracticeLobbyListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgFriendPracticeLobbyListResponse) ProtoMessage() {} -func (*CMsgFriendPracticeLobbyListResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{41} -} - -func (m *CMsgFriendPracticeLobbyListResponse) GetLobbies() []*CMsgPracticeLobbyListResponseEntry { - if m != nil { - return m.Lobbies - } - return nil -} - -type CMsgGuildmatePracticeLobbyListRequest struct { - Guilds []uint32 `protobuf:"varint,1,rep,name=guilds" json:"guilds,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGuildmatePracticeLobbyListRequest) Reset() { *m = CMsgGuildmatePracticeLobbyListRequest{} } -func (m *CMsgGuildmatePracticeLobbyListRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGuildmatePracticeLobbyListRequest) ProtoMessage() {} -func (*CMsgGuildmatePracticeLobbyListRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{42} -} - -func (m *CMsgGuildmatePracticeLobbyListRequest) GetGuilds() []uint32 { - if m != nil { - return m.Guilds - } - return nil -} - -type CMsgGuildmatePracticeLobbyListResponse struct { - Lobbies []*CMsgPracticeLobbyListResponseEntry `protobuf:"bytes,1,rep,name=lobbies" json:"lobbies,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGuildmatePracticeLobbyListResponse) Reset() { - *m = CMsgGuildmatePracticeLobbyListResponse{} -} -func (m *CMsgGuildmatePracticeLobbyListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGuildmatePracticeLobbyListResponse) ProtoMessage() {} -func (*CMsgGuildmatePracticeLobbyListResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{43} -} - -func (m *CMsgGuildmatePracticeLobbyListResponse) GetLobbies() []*CMsgPracticeLobbyListResponseEntry { - if m != nil { - return m.Lobbies - } - return nil -} - -type CMsgJoinableCustomGameModesRequest struct { - ServerRegion *uint32 `protobuf:"varint,1,opt,name=server_region" json:"server_region,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgJoinableCustomGameModesRequest) Reset() { *m = CMsgJoinableCustomGameModesRequest{} } -func (m *CMsgJoinableCustomGameModesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgJoinableCustomGameModesRequest) ProtoMessage() {} -func (*CMsgJoinableCustomGameModesRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{44} -} - -func (m *CMsgJoinableCustomGameModesRequest) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -type CMsgJoinableCustomGameModesResponseEntry struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - LobbyCount *uint32 `protobuf:"varint,2,opt,name=lobby_count" json:"lobby_count,omitempty"` - PlayerCount *uint32 `protobuf:"varint,3,opt,name=player_count" json:"player_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgJoinableCustomGameModesResponseEntry) Reset() { - *m = CMsgJoinableCustomGameModesResponseEntry{} -} -func (m *CMsgJoinableCustomGameModesResponseEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgJoinableCustomGameModesResponseEntry) ProtoMessage() {} -func (*CMsgJoinableCustomGameModesResponseEntry) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{45} -} - -func (m *CMsgJoinableCustomGameModesResponseEntry) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgJoinableCustomGameModesResponseEntry) GetLobbyCount() uint32 { - if m != nil && m.LobbyCount != nil { - return *m.LobbyCount - } - return 0 -} - -func (m *CMsgJoinableCustomGameModesResponseEntry) GetPlayerCount() uint32 { - if m != nil && m.PlayerCount != nil { - return *m.PlayerCount - } - return 0 -} - -type CMsgJoinableCustomGameModesResponse struct { - GameModes []*CMsgJoinableCustomGameModesResponseEntry `protobuf:"bytes,1,rep,name=game_modes" json:"game_modes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgJoinableCustomGameModesResponse) Reset() { *m = CMsgJoinableCustomGameModesResponse{} } -func (m *CMsgJoinableCustomGameModesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgJoinableCustomGameModesResponse) ProtoMessage() {} -func (*CMsgJoinableCustomGameModesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{46} -} - -func (m *CMsgJoinableCustomGameModesResponse) GetGameModes() []*CMsgJoinableCustomGameModesResponseEntry { - if m != nil { - return m.GameModes - } - return nil -} - -type CMsgJoinableCustomLobbiesRequest struct { - ServerRegion *uint32 `protobuf:"varint,1,opt,name=server_region" json:"server_region,omitempty"` - CustomGameId *uint64 `protobuf:"varint,2,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgJoinableCustomLobbiesRequest) Reset() { *m = CMsgJoinableCustomLobbiesRequest{} } -func (m *CMsgJoinableCustomLobbiesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgJoinableCustomLobbiesRequest) ProtoMessage() {} -func (*CMsgJoinableCustomLobbiesRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{47} -} - -func (m *CMsgJoinableCustomLobbiesRequest) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesRequest) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -type CMsgJoinableCustomLobbiesResponseEntry struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - CustomGameId *uint64 `protobuf:"varint,2,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - LobbyName *string `protobuf:"bytes,3,opt,name=lobby_name" json:"lobby_name,omitempty"` - MemberCount *uint32 `protobuf:"varint,4,opt,name=member_count" json:"member_count,omitempty"` - LeaderAccountId *uint32 `protobuf:"varint,5,opt,name=leader_account_id" json:"leader_account_id,omitempty"` - LeaderName *string `protobuf:"bytes,6,opt,name=leader_name" json:"leader_name,omitempty"` - CustomMapName *string `protobuf:"bytes,7,opt,name=custom_map_name" json:"custom_map_name,omitempty"` - MaxPlayerCount *uint32 `protobuf:"varint,8,opt,name=max_player_count" json:"max_player_count,omitempty"` - ServerRegion *uint32 `protobuf:"varint,9,opt,name=server_region" json:"server_region,omitempty"` - LanHostPingToServerRegion *uint32 `protobuf:"varint,10,opt,name=lan_host_ping_to_server_region" json:"lan_host_ping_to_server_region,omitempty"` - HasPassKey *bool `protobuf:"varint,11,opt,name=has_pass_key" json:"has_pass_key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) Reset() { - *m = CMsgJoinableCustomLobbiesResponseEntry{} -} -func (m *CMsgJoinableCustomLobbiesResponseEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgJoinableCustomLobbiesResponseEntry) ProtoMessage() {} -func (*CMsgJoinableCustomLobbiesResponseEntry) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{48} -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetLobbyName() string { - if m != nil && m.LobbyName != nil { - return *m.LobbyName - } - return "" -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetMemberCount() uint32 { - if m != nil && m.MemberCount != nil { - return *m.MemberCount - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetLeaderAccountId() uint32 { - if m != nil && m.LeaderAccountId != nil { - return *m.LeaderAccountId - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetLeaderName() string { - if m != nil && m.LeaderName != nil { - return *m.LeaderName - } - return "" -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetCustomMapName() string { - if m != nil && m.CustomMapName != nil { - return *m.CustomMapName - } - return "" -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetMaxPlayerCount() uint32 { - if m != nil && m.MaxPlayerCount != nil { - return *m.MaxPlayerCount - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetLanHostPingToServerRegion() uint32 { - if m != nil && m.LanHostPingToServerRegion != nil { - return *m.LanHostPingToServerRegion - } - return 0 -} - -func (m *CMsgJoinableCustomLobbiesResponseEntry) GetHasPassKey() bool { - if m != nil && m.HasPassKey != nil { - return *m.HasPassKey - } - return false -} - -type CMsgJoinableCustomLobbiesResponse struct { - Lobbies []*CMsgJoinableCustomLobbiesResponseEntry `protobuf:"bytes,1,rep,name=lobbies" json:"lobbies,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgJoinableCustomLobbiesResponse) Reset() { *m = CMsgJoinableCustomLobbiesResponse{} } -func (m *CMsgJoinableCustomLobbiesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgJoinableCustomLobbiesResponse) ProtoMessage() {} -func (*CMsgJoinableCustomLobbiesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{49} -} - -func (m *CMsgJoinableCustomLobbiesResponse) GetLobbies() []*CMsgJoinableCustomLobbiesResponseEntry { - if m != nil { - return m.Lobbies - } - return nil -} - -type CMsgQuickJoinCustomLobby struct { - LegacyServerRegion *uint32 `protobuf:"varint,1,opt,name=legacy_server_region" json:"legacy_server_region,omitempty"` - CustomGameId *uint64 `protobuf:"varint,2,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - ClientVersion *uint32 `protobuf:"varint,3,opt,name=client_version" json:"client_version,omitempty"` - CreateLobbyDetails *CMsgPracticeLobbySetDetails `protobuf:"bytes,4,opt,name=create_lobby_details" json:"create_lobby_details,omitempty"` - AllowAnyMap *bool `protobuf:"varint,5,opt,name=allow_any_map" json:"allow_any_map,omitempty"` - LegacyRegionPings []*CMsgQuickJoinCustomLobby_LegacyRegionPing `protobuf:"bytes,6,rep,name=legacy_region_pings" json:"legacy_region_pings,omitempty"` - PingData *CMsgClientPingData `protobuf:"bytes,7,opt,name=ping_data" json:"ping_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgQuickJoinCustomLobby) Reset() { *m = CMsgQuickJoinCustomLobby{} } -func (m *CMsgQuickJoinCustomLobby) String() string { return proto.CompactTextString(m) } -func (*CMsgQuickJoinCustomLobby) ProtoMessage() {} -func (*CMsgQuickJoinCustomLobby) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{50} } - -func (m *CMsgQuickJoinCustomLobby) GetLegacyServerRegion() uint32 { - if m != nil && m.LegacyServerRegion != nil { - return *m.LegacyServerRegion - } - return 0 -} - -func (m *CMsgQuickJoinCustomLobby) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgQuickJoinCustomLobby) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgQuickJoinCustomLobby) GetCreateLobbyDetails() *CMsgPracticeLobbySetDetails { - if m != nil { - return m.CreateLobbyDetails - } - return nil -} - -func (m *CMsgQuickJoinCustomLobby) GetAllowAnyMap() bool { - if m != nil && m.AllowAnyMap != nil { - return *m.AllowAnyMap - } - return false -} - -func (m *CMsgQuickJoinCustomLobby) GetLegacyRegionPings() []*CMsgQuickJoinCustomLobby_LegacyRegionPing { - if m != nil { - return m.LegacyRegionPings - } - return nil -} - -func (m *CMsgQuickJoinCustomLobby) GetPingData() *CMsgClientPingData { - if m != nil { - return m.PingData - } - return nil -} - -type CMsgQuickJoinCustomLobby_LegacyRegionPing struct { - ServerRegion *uint32 `protobuf:"varint,1,opt,name=server_region" json:"server_region,omitempty"` - Ping *uint32 `protobuf:"varint,2,opt,name=ping" json:"ping,omitempty"` - RegionCode *uint32 `protobuf:"fixed32,3,opt,name=region_code" json:"region_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgQuickJoinCustomLobby_LegacyRegionPing) Reset() { - *m = CMsgQuickJoinCustomLobby_LegacyRegionPing{} -} -func (m *CMsgQuickJoinCustomLobby_LegacyRegionPing) String() string { return proto.CompactTextString(m) } -func (*CMsgQuickJoinCustomLobby_LegacyRegionPing) ProtoMessage() {} -func (*CMsgQuickJoinCustomLobby_LegacyRegionPing) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{50, 0} -} - -func (m *CMsgQuickJoinCustomLobby_LegacyRegionPing) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -func (m *CMsgQuickJoinCustomLobby_LegacyRegionPing) GetPing() uint32 { - if m != nil && m.Ping != nil { - return *m.Ping - } - return 0 -} - -func (m *CMsgQuickJoinCustomLobby_LegacyRegionPing) GetRegionCode() uint32 { - if m != nil && m.RegionCode != nil { - return *m.RegionCode - } - return 0 -} - -type CMsgQuickJoinCustomLobbyResponse struct { - Result *DOTAJoinLobbyResult `protobuf:"varint,1,opt,name=result,enum=DOTAJoinLobbyResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgQuickJoinCustomLobbyResponse) Reset() { *m = CMsgQuickJoinCustomLobbyResponse{} } -func (m *CMsgQuickJoinCustomLobbyResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgQuickJoinCustomLobbyResponse) ProtoMessage() {} -func (*CMsgQuickJoinCustomLobbyResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{51} -} - -const Default_CMsgQuickJoinCustomLobbyResponse_Result DOTAJoinLobbyResult = DOTAJoinLobbyResult_DOTA_JOIN_RESULT_SUCCESS - -func (m *CMsgQuickJoinCustomLobbyResponse) GetResult() DOTAJoinLobbyResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgQuickJoinCustomLobbyResponse_Result -} - -type CMsgBotGameCreate struct { - SearchKey *string `protobuf:"bytes,1,opt,name=search_key" json:"search_key,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - Difficulty *DOTABotDifficulty `protobuf:"varint,3,opt,name=difficulty,enum=DOTABotDifficulty,def=0" json:"difficulty,omitempty"` - Team *DOTA_GC_TEAM `protobuf:"varint,4,opt,name=team,enum=DOTA_GC_TEAM,def=0" json:"team,omitempty"` - GameMode *uint32 `protobuf:"varint,5,opt,name=game_mode" json:"game_mode,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgBotGameCreate) Reset() { *m = CMsgBotGameCreate{} } -func (m *CMsgBotGameCreate) String() string { return proto.CompactTextString(m) } -func (*CMsgBotGameCreate) ProtoMessage() {} -func (*CMsgBotGameCreate) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{52} } - -const Default_CMsgBotGameCreate_Difficulty DOTABotDifficulty = DOTABotDifficulty_BOT_DIFFICULTY_PASSIVE -const Default_CMsgBotGameCreate_Team DOTA_GC_TEAM = DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS - -func (m *CMsgBotGameCreate) GetSearchKey() string { - if m != nil && m.SearchKey != nil { - return *m.SearchKey - } - return "" -} - -func (m *CMsgBotGameCreate) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgBotGameCreate) GetDifficulty() DOTABotDifficulty { - if m != nil && m.Difficulty != nil { - return *m.Difficulty - } - return Default_CMsgBotGameCreate_Difficulty -} - -func (m *CMsgBotGameCreate) GetTeam() DOTA_GC_TEAM { - if m != nil && m.Team != nil { - return *m.Team - } - return Default_CMsgBotGameCreate_Team -} - -func (m *CMsgBotGameCreate) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -type CMsgCustomGameCreate struct { - SearchKey *string `protobuf:"bytes,1,opt,name=search_key" json:"search_key,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - Difficulty *uint32 `protobuf:"varint,3,opt,name=difficulty" json:"difficulty,omitempty"` - GameMode *string `protobuf:"bytes,4,opt,name=game_mode" json:"game_mode,omitempty"` - Map *string `protobuf:"bytes,5,opt,name=map" json:"map,omitempty"` - CustomGameId *uint64 `protobuf:"varint,7,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCustomGameCreate) Reset() { *m = CMsgCustomGameCreate{} } -func (m *CMsgCustomGameCreate) String() string { return proto.CompactTextString(m) } -func (*CMsgCustomGameCreate) ProtoMessage() {} -func (*CMsgCustomGameCreate) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{53} } - -func (m *CMsgCustomGameCreate) GetSearchKey() string { - if m != nil && m.SearchKey != nil { - return *m.SearchKey - } - return "" -} - -func (m *CMsgCustomGameCreate) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgCustomGameCreate) GetDifficulty() uint32 { - if m != nil && m.Difficulty != nil { - return *m.Difficulty - } - return 0 -} - -func (m *CMsgCustomGameCreate) GetGameMode() string { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return "" -} - -func (m *CMsgCustomGameCreate) GetMap() string { - if m != nil && m.Map != nil { - return *m.Map - } - return "" -} - -func (m *CMsgCustomGameCreate) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -type CMsgEventGameCreate struct { - SearchKey *string `protobuf:"bytes,1,opt,name=search_key" json:"search_key,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - Difficulty *uint32 `protobuf:"varint,3,opt,name=difficulty" json:"difficulty,omitempty"` - GameMode *string `protobuf:"bytes,4,opt,name=game_mode" json:"game_mode,omitempty"` - Map *string `protobuf:"bytes,5,opt,name=map" json:"map,omitempty"` - CustomGameId *uint64 `protobuf:"varint,7,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgEventGameCreate) Reset() { *m = CMsgEventGameCreate{} } -func (m *CMsgEventGameCreate) String() string { return proto.CompactTextString(m) } -func (*CMsgEventGameCreate) ProtoMessage() {} -func (*CMsgEventGameCreate) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{54} } - -func (m *CMsgEventGameCreate) GetSearchKey() string { - if m != nil && m.SearchKey != nil { - return *m.SearchKey - } - return "" -} - -func (m *CMsgEventGameCreate) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgEventGameCreate) GetDifficulty() uint32 { - if m != nil && m.Difficulty != nil { - return *m.Difficulty - } - return 0 -} - -func (m *CMsgEventGameCreate) GetGameMode() string { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return "" -} - -func (m *CMsgEventGameCreate) GetMap() string { - if m != nil && m.Map != nil { - return *m.Map - } - return "" -} - -func (m *CMsgEventGameCreate) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -type CMsgRequestInternationalTicket struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestInternationalTicket) Reset() { *m = CMsgRequestInternationalTicket{} } -func (m *CMsgRequestInternationalTicket) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestInternationalTicket) ProtoMessage() {} -func (*CMsgRequestInternationalTicket) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{55} } - -type CMsgBalancedShuffleLobby struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgBalancedShuffleLobby) Reset() { *m = CMsgBalancedShuffleLobby{} } -func (m *CMsgBalancedShuffleLobby) String() string { return proto.CompactTextString(m) } -func (*CMsgBalancedShuffleLobby) ProtoMessage() {} -func (*CMsgBalancedShuffleLobby) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{56} } - -type CMsgInitialQuestionnaireResponse struct { - InitialSkill *uint32 `protobuf:"varint,1,opt,name=initial_skill" json:"initial_skill,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgInitialQuestionnaireResponse) Reset() { *m = CMsgInitialQuestionnaireResponse{} } -func (m *CMsgInitialQuestionnaireResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgInitialQuestionnaireResponse) ProtoMessage() {} -func (*CMsgInitialQuestionnaireResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{57} -} - -func (m *CMsgInitialQuestionnaireResponse) GetInitialSkill() uint32 { - if m != nil && m.InitialSkill != nil { - return *m.InitialSkill - } - return 0 -} - -type CMsgDOTAMatch struct { - GoodGuysWin *bool `protobuf:"varint,2,opt,name=good_guys_win" json:"good_guys_win,omitempty"` - Duration *uint32 `protobuf:"varint,3,opt,name=duration" json:"duration,omitempty"` - StartTime *uint32 `protobuf:"fixed32,4,opt,name=startTime" json:"startTime,omitempty"` - Players []*CMsgDOTAMatch_Player `protobuf:"bytes,5,rep,name=players" json:"players,omitempty"` - MatchId *uint64 `protobuf:"varint,6,opt,name=match_id" json:"match_id,omitempty"` - TowerStatus []uint32 `protobuf:"varint,8,rep,name=tower_status" json:"tower_status,omitempty"` - BarracksStatus []uint32 `protobuf:"varint,9,rep,name=barracks_status" json:"barracks_status,omitempty"` - Cluster *uint32 `protobuf:"varint,10,opt,name=cluster" json:"cluster,omitempty"` - FirstBloodTime *uint32 `protobuf:"varint,12,opt,name=first_blood_time" json:"first_blood_time,omitempty"` - ReplaySalt *uint32 `protobuf:"fixed32,13,opt,name=replay_salt" json:"replay_salt,omitempty"` - ServerIp *uint32 `protobuf:"fixed32,14,opt,name=server_ip" json:"server_ip,omitempty"` - ServerPort *uint32 `protobuf:"varint,15,opt,name=server_port" json:"server_port,omitempty"` - LobbyType *uint32 `protobuf:"varint,16,opt,name=lobby_type" json:"lobby_type,omitempty"` - HumanPlayers *uint32 `protobuf:"varint,17,opt,name=human_players" json:"human_players,omitempty"` - AverageSkill *uint32 `protobuf:"varint,18,opt,name=average_skill" json:"average_skill,omitempty"` - GameBalance *float32 `protobuf:"fixed32,19,opt,name=game_balance" json:"game_balance,omitempty"` - RadiantTeamId *uint32 `protobuf:"varint,20,opt,name=radiant_team_id" json:"radiant_team_id,omitempty"` - DireTeamId *uint32 `protobuf:"varint,21,opt,name=dire_team_id" json:"dire_team_id,omitempty"` - Leagueid *uint32 `protobuf:"varint,22,opt,name=leagueid" json:"leagueid,omitempty"` - RadiantTeamName *string `protobuf:"bytes,23,opt,name=radiant_team_name" json:"radiant_team_name,omitempty"` - DireTeamName *string `protobuf:"bytes,24,opt,name=dire_team_name" json:"dire_team_name,omitempty"` - RadiantTeamLogo *uint64 `protobuf:"varint,25,opt,name=radiant_team_logo" json:"radiant_team_logo,omitempty"` - DireTeamLogo *uint64 `protobuf:"varint,26,opt,name=dire_team_logo" json:"dire_team_logo,omitempty"` - RadiantTeamComplete *uint32 `protobuf:"varint,27,opt,name=radiant_team_complete" json:"radiant_team_complete,omitempty"` - DireTeamComplete *uint32 `protobuf:"varint,28,opt,name=dire_team_complete" json:"dire_team_complete,omitempty"` - PositiveVotes *uint32 `protobuf:"varint,29,opt,name=positive_votes" json:"positive_votes,omitempty"` - NegativeVotes *uint32 `protobuf:"varint,30,opt,name=negative_votes" json:"negative_votes,omitempty"` - GameMode *DOTA_GameMode `protobuf:"varint,31,opt,name=game_mode,enum=DOTA_GameMode,def=0" json:"game_mode,omitempty"` - PicksBans []*CMatchHeroSelectEvent `protobuf:"bytes,32,rep,name=picks_bans" json:"picks_bans,omitempty"` - MatchSeqNum *uint64 `protobuf:"varint,33,opt,name=match_seq_num" json:"match_seq_num,omitempty"` - ReplayState *CMsgDOTAMatch_ReplayState `protobuf:"varint,34,opt,name=replay_state,enum=CMsgDOTAMatch_ReplayState,def=0" json:"replay_state,omitempty"` - RadiantGuildId *uint32 `protobuf:"varint,35,opt,name=radiant_guild_id" json:"radiant_guild_id,omitempty"` - DireGuildId *uint32 `protobuf:"varint,36,opt,name=dire_guild_id" json:"dire_guild_id,omitempty"` - RadiantTeamTag *string `protobuf:"bytes,37,opt,name=radiant_team_tag" json:"radiant_team_tag,omitempty"` - DireTeamTag *string `protobuf:"bytes,38,opt,name=dire_team_tag" json:"dire_team_tag,omitempty"` - SeriesId *uint32 `protobuf:"varint,39,opt,name=series_id" json:"series_id,omitempty"` - SeriesType *uint32 `protobuf:"varint,40,opt,name=series_type" json:"series_type,omitempty"` - BroadcasterChannels []*CMsgDOTAMatch_BroadcasterChannel `protobuf:"bytes,43,rep,name=broadcaster_channels" json:"broadcaster_channels,omitempty"` - Engine *uint32 `protobuf:"varint,44,opt,name=engine" json:"engine,omitempty"` - CustomGameData *CMsgDOTAMatch_CustomGameData `protobuf:"bytes,45,opt,name=custom_game_data" json:"custom_game_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatch) Reset() { *m = CMsgDOTAMatch{} } -func (m *CMsgDOTAMatch) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatch) ProtoMessage() {} -func (*CMsgDOTAMatch) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{58} } - -const Default_CMsgDOTAMatch_GameMode DOTA_GameMode = DOTA_GameMode_DOTA_GAMEMODE_NONE -const Default_CMsgDOTAMatch_ReplayState CMsgDOTAMatch_ReplayState = CMsgDOTAMatch_REPLAY_AVAILABLE - -func (m *CMsgDOTAMatch) GetGoodGuysWin() bool { - if m != nil && m.GoodGuysWin != nil { - return *m.GoodGuysWin - } - return false -} - -func (m *CMsgDOTAMatch) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -func (m *CMsgDOTAMatch) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTAMatch) GetPlayers() []*CMsgDOTAMatch_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgDOTAMatch) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTAMatch) GetTowerStatus() []uint32 { - if m != nil { - return m.TowerStatus - } - return nil -} - -func (m *CMsgDOTAMatch) GetBarracksStatus() []uint32 { - if m != nil { - return m.BarracksStatus - } - return nil -} - -func (m *CMsgDOTAMatch) GetCluster() uint32 { - if m != nil && m.Cluster != nil { - return *m.Cluster - } - return 0 -} - -func (m *CMsgDOTAMatch) GetFirstBloodTime() uint32 { - if m != nil && m.FirstBloodTime != nil { - return *m.FirstBloodTime - } - return 0 -} - -func (m *CMsgDOTAMatch) GetReplaySalt() uint32 { - if m != nil && m.ReplaySalt != nil { - return *m.ReplaySalt - } - return 0 -} - -func (m *CMsgDOTAMatch) GetServerIp() uint32 { - if m != nil && m.ServerIp != nil { - return *m.ServerIp - } - return 0 -} - -func (m *CMsgDOTAMatch) GetServerPort() uint32 { - if m != nil && m.ServerPort != nil { - return *m.ServerPort - } - return 0 -} - -func (m *CMsgDOTAMatch) GetLobbyType() uint32 { - if m != nil && m.LobbyType != nil { - return *m.LobbyType - } - return 0 -} - -func (m *CMsgDOTAMatch) GetHumanPlayers() uint32 { - if m != nil && m.HumanPlayers != nil { - return *m.HumanPlayers - } - return 0 -} - -func (m *CMsgDOTAMatch) GetAverageSkill() uint32 { - if m != nil && m.AverageSkill != nil { - return *m.AverageSkill - } - return 0 -} - -func (m *CMsgDOTAMatch) GetGameBalance() float32 { - if m != nil && m.GameBalance != nil { - return *m.GameBalance - } - return 0 -} - -func (m *CMsgDOTAMatch) GetRadiantTeamId() uint32 { - if m != nil && m.RadiantTeamId != nil { - return *m.RadiantTeamId - } - return 0 -} - -func (m *CMsgDOTAMatch) GetDireTeamId() uint32 { - if m != nil && m.DireTeamId != nil { - return *m.DireTeamId - } - return 0 -} - -func (m *CMsgDOTAMatch) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -func (m *CMsgDOTAMatch) GetRadiantTeamName() string { - if m != nil && m.RadiantTeamName != nil { - return *m.RadiantTeamName - } - return "" -} - -func (m *CMsgDOTAMatch) GetDireTeamName() string { - if m != nil && m.DireTeamName != nil { - return *m.DireTeamName - } - return "" -} - -func (m *CMsgDOTAMatch) GetRadiantTeamLogo() uint64 { - if m != nil && m.RadiantTeamLogo != nil { - return *m.RadiantTeamLogo - } - return 0 -} - -func (m *CMsgDOTAMatch) GetDireTeamLogo() uint64 { - if m != nil && m.DireTeamLogo != nil { - return *m.DireTeamLogo - } - return 0 -} - -func (m *CMsgDOTAMatch) GetRadiantTeamComplete() uint32 { - if m != nil && m.RadiantTeamComplete != nil { - return *m.RadiantTeamComplete - } - return 0 -} - -func (m *CMsgDOTAMatch) GetDireTeamComplete() uint32 { - if m != nil && m.DireTeamComplete != nil { - return *m.DireTeamComplete - } - return 0 -} - -func (m *CMsgDOTAMatch) GetPositiveVotes() uint32 { - if m != nil && m.PositiveVotes != nil { - return *m.PositiveVotes - } - return 0 -} - -func (m *CMsgDOTAMatch) GetNegativeVotes() uint32 { - if m != nil && m.NegativeVotes != nil { - return *m.NegativeVotes - } - return 0 -} - -func (m *CMsgDOTAMatch) GetGameMode() DOTA_GameMode { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return Default_CMsgDOTAMatch_GameMode -} - -func (m *CMsgDOTAMatch) GetPicksBans() []*CMatchHeroSelectEvent { - if m != nil { - return m.PicksBans - } - return nil -} - -func (m *CMsgDOTAMatch) GetMatchSeqNum() uint64 { - if m != nil && m.MatchSeqNum != nil { - return *m.MatchSeqNum - } - return 0 -} - -func (m *CMsgDOTAMatch) GetReplayState() CMsgDOTAMatch_ReplayState { - if m != nil && m.ReplayState != nil { - return *m.ReplayState - } - return Default_CMsgDOTAMatch_ReplayState -} - -func (m *CMsgDOTAMatch) GetRadiantGuildId() uint32 { - if m != nil && m.RadiantGuildId != nil { - return *m.RadiantGuildId - } - return 0 -} - -func (m *CMsgDOTAMatch) GetDireGuildId() uint32 { - if m != nil && m.DireGuildId != nil { - return *m.DireGuildId - } - return 0 -} - -func (m *CMsgDOTAMatch) GetRadiantTeamTag() string { - if m != nil && m.RadiantTeamTag != nil { - return *m.RadiantTeamTag - } - return "" -} - -func (m *CMsgDOTAMatch) GetDireTeamTag() string { - if m != nil && m.DireTeamTag != nil { - return *m.DireTeamTag - } - return "" -} - -func (m *CMsgDOTAMatch) GetSeriesId() uint32 { - if m != nil && m.SeriesId != nil { - return *m.SeriesId - } - return 0 -} - -func (m *CMsgDOTAMatch) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CMsgDOTAMatch) GetBroadcasterChannels() []*CMsgDOTAMatch_BroadcasterChannel { - if m != nil { - return m.BroadcasterChannels - } - return nil -} - -func (m *CMsgDOTAMatch) GetEngine() uint32 { - if m != nil && m.Engine != nil { - return *m.Engine - } - return 0 -} - -func (m *CMsgDOTAMatch) GetCustomGameData() *CMsgDOTAMatch_CustomGameData { - if m != nil { - return m.CustomGameData - } - return nil -} - -type CMsgDOTAMatch_Player struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - PlayerSlot *uint32 `protobuf:"varint,2,opt,name=player_slot" json:"player_slot,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - Item_0 *uint32 `protobuf:"varint,4,opt,name=item_0" json:"item_0,omitempty"` - Item_1 *uint32 `protobuf:"varint,5,opt,name=item_1" json:"item_1,omitempty"` - Item_2 *uint32 `protobuf:"varint,6,opt,name=item_2" json:"item_2,omitempty"` - Item_3 *uint32 `protobuf:"varint,7,opt,name=item_3" json:"item_3,omitempty"` - Item_4 *uint32 `protobuf:"varint,8,opt,name=item_4" json:"item_4,omitempty"` - Item_5 *uint32 `protobuf:"varint,9,opt,name=item_5" json:"item_5,omitempty"` - ExpectedTeamContribution *float32 `protobuf:"fixed32,10,opt,name=expected_team_contribution" json:"expected_team_contribution,omitempty"` - ScaledMetric *float32 `protobuf:"fixed32,11,opt,name=scaled_metric" json:"scaled_metric,omitempty"` - PreviousRank *uint32 `protobuf:"varint,12,opt,name=previous_rank" json:"previous_rank,omitempty"` - RankChange *uint32 `protobuf:"varint,13,opt,name=rank_change" json:"rank_change,omitempty"` - SoloRank *bool `protobuf:"varint,49,opt,name=solo_rank" json:"solo_rank,omitempty"` - Kills *uint32 `protobuf:"varint,14,opt,name=kills" json:"kills,omitempty"` - Deaths *uint32 `protobuf:"varint,15,opt,name=deaths" json:"deaths,omitempty"` - Assists *uint32 `protobuf:"varint,16,opt,name=assists" json:"assists,omitempty"` - LeaverStatus *uint32 `protobuf:"varint,17,opt,name=leaver_status" json:"leaver_status,omitempty"` - Gold *uint32 `protobuf:"varint,18,opt,name=gold" json:"gold,omitempty"` - LastHits *uint32 `protobuf:"varint,19,opt,name=last_hits" json:"last_hits,omitempty"` - Denies *uint32 `protobuf:"varint,20,opt,name=denies" json:"denies,omitempty"` - GoldPerMin *uint32 `protobuf:"varint,21,opt,name=gold_per_min" json:"gold_per_min,omitempty"` - XPPerMin *uint32 `protobuf:"varint,22,opt,name=XP_per_min" json:"XP_per_min,omitempty"` - GoldSpent *uint32 `protobuf:"varint,23,opt,name=gold_spent" json:"gold_spent,omitempty"` - HeroDamage *uint32 `protobuf:"varint,24,opt,name=hero_damage" json:"hero_damage,omitempty"` - TowerDamage *uint32 `protobuf:"varint,25,opt,name=tower_damage" json:"tower_damage,omitempty"` - HeroHealing *uint32 `protobuf:"varint,26,opt,name=hero_healing" json:"hero_healing,omitempty"` - Level *uint32 `protobuf:"varint,27,opt,name=level" json:"level,omitempty"` - TimeLastSeen *uint32 `protobuf:"varint,28,opt,name=time_last_seen" json:"time_last_seen,omitempty"` - PlayerName *string `protobuf:"bytes,29,opt,name=player_name" json:"player_name,omitempty"` - SupportAbilityValue *uint32 `protobuf:"varint,30,opt,name=support_ability_value" json:"support_ability_value,omitempty"` - FeedingDetected *bool `protobuf:"varint,32,opt,name=feeding_detected" json:"feeding_detected,omitempty"` - SearchRank *uint32 `protobuf:"varint,34,opt,name=search_rank" json:"search_rank,omitempty"` - SearchRankUncertainty *uint32 `protobuf:"varint,35,opt,name=search_rank_uncertainty" json:"search_rank_uncertainty,omitempty"` - RankUncertaintyChange *int32 `protobuf:"varint,36,opt,name=rank_uncertainty_change" json:"rank_uncertainty_change,omitempty"` - HeroPlayCount *uint32 `protobuf:"varint,37,opt,name=hero_play_count" json:"hero_play_count,omitempty"` - PartyId *uint64 `protobuf:"fixed64,38,opt,name=party_id" json:"party_id,omitempty"` - ScaledKills *float32 `protobuf:"fixed32,39,opt,name=scaled_kills" json:"scaled_kills,omitempty"` - ScaledDeaths *float32 `protobuf:"fixed32,40,opt,name=scaled_deaths" json:"scaled_deaths,omitempty"` - ScaledAssists *float32 `protobuf:"fixed32,41,opt,name=scaled_assists" json:"scaled_assists,omitempty"` - ClaimedFarmGold *uint32 `protobuf:"varint,42,opt,name=claimed_farm_gold" json:"claimed_farm_gold,omitempty"` - SupportGold *uint32 `protobuf:"varint,43,opt,name=support_gold" json:"support_gold,omitempty"` - ClaimedDenies *uint32 `protobuf:"varint,44,opt,name=claimed_denies" json:"claimed_denies,omitempty"` - ClaimedMisses *uint32 `protobuf:"varint,45,opt,name=claimed_misses" json:"claimed_misses,omitempty"` - Misses *uint32 `protobuf:"varint,46,opt,name=misses" json:"misses,omitempty"` - AbilityUpgrades []*CMatchPlayerAbilityUpgrade `protobuf:"bytes,47,rep,name=ability_upgrades" json:"ability_upgrades,omitempty"` - AdditionalUnitsInventory []*CMatchAdditionalUnitInventory `protobuf:"bytes,48,rep,name=additional_units_inventory" json:"additional_units_inventory,omitempty"` - CustomGameData *CMsgDOTAMatch_Player_CustomGameData `protobuf:"bytes,50,opt,name=custom_game_data" json:"custom_game_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatch_Player) Reset() { *m = CMsgDOTAMatch_Player{} } -func (m *CMsgDOTAMatch_Player) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatch_Player) ProtoMessage() {} -func (*CMsgDOTAMatch_Player) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{58, 0} } - -func (m *CMsgDOTAMatch_Player) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetPlayerSlot() uint32 { - if m != nil && m.PlayerSlot != nil { - return *m.PlayerSlot - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetItem_0() uint32 { - if m != nil && m.Item_0 != nil { - return *m.Item_0 - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetItem_1() uint32 { - if m != nil && m.Item_1 != nil { - return *m.Item_1 - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetItem_2() uint32 { - if m != nil && m.Item_2 != nil { - return *m.Item_2 - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetItem_3() uint32 { - if m != nil && m.Item_3 != nil { - return *m.Item_3 - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetItem_4() uint32 { - if m != nil && m.Item_4 != nil { - return *m.Item_4 - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetItem_5() uint32 { - if m != nil && m.Item_5 != nil { - return *m.Item_5 - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetExpectedTeamContribution() float32 { - if m != nil && m.ExpectedTeamContribution != nil { - return *m.ExpectedTeamContribution - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetScaledMetric() float32 { - if m != nil && m.ScaledMetric != nil { - return *m.ScaledMetric - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetPreviousRank() uint32 { - if m != nil && m.PreviousRank != nil { - return *m.PreviousRank - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetRankChange() uint32 { - if m != nil && m.RankChange != nil { - return *m.RankChange - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetSoloRank() bool { - if m != nil && m.SoloRank != nil { - return *m.SoloRank - } - return false -} - -func (m *CMsgDOTAMatch_Player) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetDeaths() uint32 { - if m != nil && m.Deaths != nil { - return *m.Deaths - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetAssists() uint32 { - if m != nil && m.Assists != nil { - return *m.Assists - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetLeaverStatus() uint32 { - if m != nil && m.LeaverStatus != nil { - return *m.LeaverStatus - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetGold() uint32 { - if m != nil && m.Gold != nil { - return *m.Gold - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetLastHits() uint32 { - if m != nil && m.LastHits != nil { - return *m.LastHits - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetDenies() uint32 { - if m != nil && m.Denies != nil { - return *m.Denies - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetGoldPerMin() uint32 { - if m != nil && m.GoldPerMin != nil { - return *m.GoldPerMin - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetXPPerMin() uint32 { - if m != nil && m.XPPerMin != nil { - return *m.XPPerMin - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetGoldSpent() uint32 { - if m != nil && m.GoldSpent != nil { - return *m.GoldSpent - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetHeroDamage() uint32 { - if m != nil && m.HeroDamage != nil { - return *m.HeroDamage - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetTowerDamage() uint32 { - if m != nil && m.TowerDamage != nil { - return *m.TowerDamage - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetHeroHealing() uint32 { - if m != nil && m.HeroHealing != nil { - return *m.HeroHealing - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetTimeLastSeen() uint32 { - if m != nil && m.TimeLastSeen != nil { - return *m.TimeLastSeen - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetPlayerName() string { - if m != nil && m.PlayerName != nil { - return *m.PlayerName - } - return "" -} - -func (m *CMsgDOTAMatch_Player) GetSupportAbilityValue() uint32 { - if m != nil && m.SupportAbilityValue != nil { - return *m.SupportAbilityValue - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetFeedingDetected() bool { - if m != nil && m.FeedingDetected != nil { - return *m.FeedingDetected - } - return false -} - -func (m *CMsgDOTAMatch_Player) GetSearchRank() uint32 { - if m != nil && m.SearchRank != nil { - return *m.SearchRank - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetSearchRankUncertainty() uint32 { - if m != nil && m.SearchRankUncertainty != nil { - return *m.SearchRankUncertainty - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetRankUncertaintyChange() int32 { - if m != nil && m.RankUncertaintyChange != nil { - return *m.RankUncertaintyChange - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetHeroPlayCount() uint32 { - if m != nil && m.HeroPlayCount != nil { - return *m.HeroPlayCount - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetScaledKills() float32 { - if m != nil && m.ScaledKills != nil { - return *m.ScaledKills - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetScaledDeaths() float32 { - if m != nil && m.ScaledDeaths != nil { - return *m.ScaledDeaths - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetScaledAssists() float32 { - if m != nil && m.ScaledAssists != nil { - return *m.ScaledAssists - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetClaimedFarmGold() uint32 { - if m != nil && m.ClaimedFarmGold != nil { - return *m.ClaimedFarmGold - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetSupportGold() uint32 { - if m != nil && m.SupportGold != nil { - return *m.SupportGold - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetClaimedDenies() uint32 { - if m != nil && m.ClaimedDenies != nil { - return *m.ClaimedDenies - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetClaimedMisses() uint32 { - if m != nil && m.ClaimedMisses != nil { - return *m.ClaimedMisses - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetMisses() uint32 { - if m != nil && m.Misses != nil { - return *m.Misses - } - return 0 -} - -func (m *CMsgDOTAMatch_Player) GetAbilityUpgrades() []*CMatchPlayerAbilityUpgrade { - if m != nil { - return m.AbilityUpgrades - } - return nil -} - -func (m *CMsgDOTAMatch_Player) GetAdditionalUnitsInventory() []*CMatchAdditionalUnitInventory { - if m != nil { - return m.AdditionalUnitsInventory - } - return nil -} - -func (m *CMsgDOTAMatch_Player) GetCustomGameData() *CMsgDOTAMatch_Player_CustomGameData { - if m != nil { - return m.CustomGameData - } - return nil -} - -type CMsgDOTAMatch_Player_CustomGameData struct { - DotaTeam *uint32 `protobuf:"varint,1,opt,name=dota_team" json:"dota_team,omitempty"` - Winner *bool `protobuf:"varint,2,opt,name=winner" json:"winner,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatch_Player_CustomGameData) Reset() { *m = CMsgDOTAMatch_Player_CustomGameData{} } -func (m *CMsgDOTAMatch_Player_CustomGameData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatch_Player_CustomGameData) ProtoMessage() {} -func (*CMsgDOTAMatch_Player_CustomGameData) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{58, 0, 0} -} - -func (m *CMsgDOTAMatch_Player_CustomGameData) GetDotaTeam() uint32 { - if m != nil && m.DotaTeam != nil { - return *m.DotaTeam - } - return 0 -} - -func (m *CMsgDOTAMatch_Player_CustomGameData) GetWinner() bool { - if m != nil && m.Winner != nil { - return *m.Winner - } - return false -} - -type CMsgDOTAMatch_BroadcasterInfo struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatch_BroadcasterInfo) Reset() { *m = CMsgDOTAMatch_BroadcasterInfo{} } -func (m *CMsgDOTAMatch_BroadcasterInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatch_BroadcasterInfo) ProtoMessage() {} -func (*CMsgDOTAMatch_BroadcasterInfo) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{58, 1} -} - -func (m *CMsgDOTAMatch_BroadcasterInfo) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAMatch_BroadcasterInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type CMsgDOTAMatch_BroadcasterChannel struct { - CountryCode *string `protobuf:"bytes,1,opt,name=country_code" json:"country_code,omitempty"` - Description *string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` - BroadcasterInfos []*CMsgDOTAMatch_BroadcasterInfo `protobuf:"bytes,3,rep,name=broadcaster_infos" json:"broadcaster_infos,omitempty"` - LanguageCode *string `protobuf:"bytes,4,opt,name=language_code" json:"language_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatch_BroadcasterChannel) Reset() { *m = CMsgDOTAMatch_BroadcasterChannel{} } -func (m *CMsgDOTAMatch_BroadcasterChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatch_BroadcasterChannel) ProtoMessage() {} -func (*CMsgDOTAMatch_BroadcasterChannel) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{58, 2} -} - -func (m *CMsgDOTAMatch_BroadcasterChannel) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTAMatch_BroadcasterChannel) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CMsgDOTAMatch_BroadcasterChannel) GetBroadcasterInfos() []*CMsgDOTAMatch_BroadcasterInfo { - if m != nil { - return m.BroadcasterInfos - } - return nil -} - -func (m *CMsgDOTAMatch_BroadcasterChannel) GetLanguageCode() string { - if m != nil && m.LanguageCode != nil { - return *m.LanguageCode - } - return "" -} - -type CMsgDOTAMatch_CustomGameData struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - MapName *string `protobuf:"bytes,2,opt,name=map_name" json:"map_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatch_CustomGameData) Reset() { *m = CMsgDOTAMatch_CustomGameData{} } -func (m *CMsgDOTAMatch_CustomGameData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatch_CustomGameData) ProtoMessage() {} -func (*CMsgDOTAMatch_CustomGameData) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{58, 3} -} - -func (m *CMsgDOTAMatch_CustomGameData) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgDOTAMatch_CustomGameData) GetMapName() string { - if m != nil && m.MapName != nil { - return *m.MapName - } - return "" -} - -type CMsgDOTAPlayerMatchHistory struct { - MatchIds []uint64 `protobuf:"varint,1,rep,name=match_ids" json:"match_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPlayerMatchHistory) Reset() { *m = CMsgDOTAPlayerMatchHistory{} } -func (m *CMsgDOTAPlayerMatchHistory) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPlayerMatchHistory) ProtoMessage() {} -func (*CMsgDOTAPlayerMatchHistory) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{59} } - -func (m *CMsgDOTAPlayerMatchHistory) GetMatchIds() []uint64 { - if m != nil { - return m.MatchIds - } - return nil -} - -type CMsgDOTAMatchMinimal struct { - MatchId *uint32 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - StartTime *uint32 `protobuf:"fixed32,2,opt,name=start_time" json:"start_time,omitempty"` - Duration *uint32 `protobuf:"varint,3,opt,name=duration" json:"duration,omitempty"` - GameMode *DOTA_GameMode `protobuf:"varint,4,opt,name=game_mode,enum=DOTA_GameMode,def=0" json:"game_mode,omitempty"` - WinningTeam *uint32 `protobuf:"varint,5,opt,name=winning_team" json:"winning_team,omitempty"` - Players []*CMsgDOTAMatchMinimal_Player `protobuf:"bytes,6,rep,name=players" json:"players,omitempty"` - League *CMsgDOTAMatchMinimal_League `protobuf:"bytes,7,opt,name=league" json:"league,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchMinimal) Reset() { *m = CMsgDOTAMatchMinimal{} } -func (m *CMsgDOTAMatchMinimal) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchMinimal) ProtoMessage() {} -func (*CMsgDOTAMatchMinimal) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{60} } - -const Default_CMsgDOTAMatchMinimal_GameMode DOTA_GameMode = DOTA_GameMode_DOTA_GAMEMODE_NONE - -func (m *CMsgDOTAMatchMinimal) GetMatchId() uint32 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal) GetGameMode() DOTA_GameMode { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return Default_CMsgDOTAMatchMinimal_GameMode -} - -func (m *CMsgDOTAMatchMinimal) GetWinningTeam() uint32 { - if m != nil && m.WinningTeam != nil { - return *m.WinningTeam - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal) GetPlayers() []*CMsgDOTAMatchMinimal_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgDOTAMatchMinimal) GetLeague() *CMsgDOTAMatchMinimal_League { - if m != nil { - return m.League - } - return nil -} - -type CMsgDOTAMatchMinimal_Player struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - Kills *uint32 `protobuf:"varint,3,opt,name=kills" json:"kills,omitempty"` - Deaths *uint32 `protobuf:"varint,4,opt,name=deaths" json:"deaths,omitempty"` - Assists *uint32 `protobuf:"varint,5,opt,name=assists" json:"assists,omitempty"` - Items []uint32 `protobuf:"varint,6,rep,name=items" json:"items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchMinimal_Player) Reset() { *m = CMsgDOTAMatchMinimal_Player{} } -func (m *CMsgDOTAMatchMinimal_Player) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchMinimal_Player) ProtoMessage() {} -func (*CMsgDOTAMatchMinimal_Player) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{60, 0} } - -func (m *CMsgDOTAMatchMinimal_Player) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_Player) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_Player) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_Player) GetDeaths() uint32 { - if m != nil && m.Deaths != nil { - return *m.Deaths - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_Player) GetAssists() uint32 { - if m != nil && m.Assists != nil { - return *m.Assists - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_Player) GetItems() []uint32 { - if m != nil { - return m.Items - } - return nil -} - -type CMsgDOTAMatchMinimal_League struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - RadiantTeamId *uint32 `protobuf:"varint,2,opt,name=radiant_team_id" json:"radiant_team_id,omitempty"` - RadiantTeamName *string `protobuf:"bytes,3,opt,name=radiant_team_name" json:"radiant_team_name,omitempty"` - RadiantTeamLogo *uint64 `protobuf:"fixed64,4,opt,name=radiant_team_logo" json:"radiant_team_logo,omitempty"` - DireTeamId *uint32 `protobuf:"varint,5,opt,name=dire_team_id" json:"dire_team_id,omitempty"` - DireTeamName *string `protobuf:"bytes,6,opt,name=dire_team_name" json:"dire_team_name,omitempty"` - DireTeamLogo *uint64 `protobuf:"fixed64,7,opt,name=dire_team_logo" json:"dire_team_logo,omitempty"` - SeriesType *uint32 `protobuf:"varint,8,opt,name=series_type" json:"series_type,omitempty"` - SeriesGame *uint32 `protobuf:"varint,9,opt,name=series_game" json:"series_game,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchMinimal_League) Reset() { *m = CMsgDOTAMatchMinimal_League{} } -func (m *CMsgDOTAMatchMinimal_League) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchMinimal_League) ProtoMessage() {} -func (*CMsgDOTAMatchMinimal_League) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{60, 1} } - -func (m *CMsgDOTAMatchMinimal_League) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_League) GetRadiantTeamId() uint32 { - if m != nil && m.RadiantTeamId != nil { - return *m.RadiantTeamId - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_League) GetRadiantTeamName() string { - if m != nil && m.RadiantTeamName != nil { - return *m.RadiantTeamName - } - return "" -} - -func (m *CMsgDOTAMatchMinimal_League) GetRadiantTeamLogo() uint64 { - if m != nil && m.RadiantTeamLogo != nil { - return *m.RadiantTeamLogo - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_League) GetDireTeamId() uint32 { - if m != nil && m.DireTeamId != nil { - return *m.DireTeamId - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_League) GetDireTeamName() string { - if m != nil && m.DireTeamName != nil { - return *m.DireTeamName - } - return "" -} - -func (m *CMsgDOTAMatchMinimal_League) GetDireTeamLogo() uint64 { - if m != nil && m.DireTeamLogo != nil { - return *m.DireTeamLogo - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_League) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CMsgDOTAMatchMinimal_League) GetSeriesGame() uint32 { - if m != nil && m.SeriesGame != nil { - return *m.SeriesGame - } - return 0 -} - -type CMsgDOTAMatchHistoryFilter struct { - MatchIds []uint64 `protobuf:"varint,1,rep,name=match_ids" json:"match_ids,omitempty"` - NewestMatchIdAtLastQuery *uint64 `protobuf:"varint,2,opt,name=newest_match_id_at_last_query" json:"newest_match_id_at_last_query,omitempty"` - TimeLastQuery *uint32 `protobuf:"varint,3,opt,name=time_last_query" json:"time_last_query,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchHistoryFilter) Reset() { *m = CMsgDOTAMatchHistoryFilter{} } -func (m *CMsgDOTAMatchHistoryFilter) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchHistoryFilter) ProtoMessage() {} -func (*CMsgDOTAMatchHistoryFilter) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{61} } - -func (m *CMsgDOTAMatchHistoryFilter) GetMatchIds() []uint64 { - if m != nil { - return m.MatchIds - } - return nil -} - -func (m *CMsgDOTAMatchHistoryFilter) GetNewestMatchIdAtLastQuery() uint64 { - if m != nil && m.NewestMatchIdAtLastQuery != nil { - return *m.NewestMatchIdAtLastQuery - } - return 0 -} - -func (m *CMsgDOTAMatchHistoryFilter) GetTimeLastQuery() uint32 { - if m != nil && m.TimeLastQuery != nil { - return *m.TimeLastQuery - } - return 0 -} - -type CMsgDOTARequestMatches struct { - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - GameMode *uint32 `protobuf:"varint,3,opt,name=game_mode" json:"game_mode,omitempty"` - DateMin *uint32 `protobuf:"fixed32,6,opt,name=date_min" json:"date_min,omitempty"` - DateMax *uint32 `protobuf:"fixed32,7,opt,name=date_max" json:"date_max,omitempty"` - MatchesRequested *uint32 `protobuf:"varint,10,opt,name=matches_requested" json:"matches_requested,omitempty"` - StartAtMatchId *uint64 `protobuf:"varint,11,opt,name=start_at_match_id" json:"start_at_match_id,omitempty"` - MinPlayers *uint32 `protobuf:"fixed32,12,opt,name=min_players" json:"min_players,omitempty"` - RequestId *uint32 `protobuf:"varint,13,opt,name=request_id" json:"request_id,omitempty"` - TournamentGamesOnly *bool `protobuf:"varint,14,opt,name=tournament_games_only" json:"tournament_games_only,omitempty"` - AccountId *uint32 `protobuf:"varint,15,opt,name=account_id" json:"account_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,16,opt,name=league_id" json:"league_id,omitempty"` - Skill *CMsgDOTARequestMatches_SkillLevel `protobuf:"varint,17,opt,name=skill,enum=CMsgDOTARequestMatches_SkillLevel,def=0" json:"skill,omitempty"` - TeamId *uint32 `protobuf:"varint,18,opt,name=team_id" json:"team_id,omitempty"` - CustomGameId *uint64 `protobuf:"varint,20,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestMatches) Reset() { *m = CMsgDOTARequestMatches{} } -func (m *CMsgDOTARequestMatches) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestMatches) ProtoMessage() {} -func (*CMsgDOTARequestMatches) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{62} } - -const Default_CMsgDOTARequestMatches_Skill CMsgDOTARequestMatches_SkillLevel = CMsgDOTARequestMatches_Any - -func (m *CMsgDOTARequestMatches) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetDateMin() uint32 { - if m != nil && m.DateMin != nil { - return *m.DateMin - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetDateMax() uint32 { - if m != nil && m.DateMax != nil { - return *m.DateMax - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetMatchesRequested() uint32 { - if m != nil && m.MatchesRequested != nil { - return *m.MatchesRequested - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetStartAtMatchId() uint64 { - if m != nil && m.StartAtMatchId != nil { - return *m.StartAtMatchId - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetMinPlayers() uint32 { - if m != nil && m.MinPlayers != nil { - return *m.MinPlayers - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetRequestId() uint32 { - if m != nil && m.RequestId != nil { - return *m.RequestId - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetTournamentGamesOnly() bool { - if m != nil && m.TournamentGamesOnly != nil { - return *m.TournamentGamesOnly - } - return false -} - -func (m *CMsgDOTARequestMatches) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetSkill() CMsgDOTARequestMatches_SkillLevel { - if m != nil && m.Skill != nil { - return *m.Skill - } - return Default_CMsgDOTARequestMatches_Skill -} - -func (m *CMsgDOTARequestMatches) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTARequestMatches) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -type CMsgDOTARequestMatchesResponse struct { - Matches []*CMsgDOTAMatch `protobuf:"bytes,1,rep,name=matches" json:"matches,omitempty"` - Series []*CMsgDOTARequestMatchesResponse_Series `protobuf:"bytes,2,rep,name=series" json:"series,omitempty"` - RequestId *uint32 `protobuf:"varint,3,opt,name=request_id" json:"request_id,omitempty"` - TotalResults *uint32 `protobuf:"varint,4,opt,name=total_results" json:"total_results,omitempty"` - ResultsRemaining *uint32 `protobuf:"varint,5,opt,name=results_remaining" json:"results_remaining,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestMatchesResponse) Reset() { *m = CMsgDOTARequestMatchesResponse{} } -func (m *CMsgDOTARequestMatchesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestMatchesResponse) ProtoMessage() {} -func (*CMsgDOTARequestMatchesResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{63} } - -func (m *CMsgDOTARequestMatchesResponse) GetMatches() []*CMsgDOTAMatch { - if m != nil { - return m.Matches - } - return nil -} - -func (m *CMsgDOTARequestMatchesResponse) GetSeries() []*CMsgDOTARequestMatchesResponse_Series { - if m != nil { - return m.Series - } - return nil -} - -func (m *CMsgDOTARequestMatchesResponse) GetRequestId() uint32 { - if m != nil && m.RequestId != nil { - return *m.RequestId - } - return 0 -} - -func (m *CMsgDOTARequestMatchesResponse) GetTotalResults() uint32 { - if m != nil && m.TotalResults != nil { - return *m.TotalResults - } - return 0 -} - -func (m *CMsgDOTARequestMatchesResponse) GetResultsRemaining() uint32 { - if m != nil && m.ResultsRemaining != nil { - return *m.ResultsRemaining - } - return 0 -} - -type CMsgDOTARequestMatchesResponse_Series struct { - Matches []*CMsgDOTAMatch `protobuf:"bytes,1,rep,name=matches" json:"matches,omitempty"` - SeriesId *uint32 `protobuf:"varint,2,opt,name=series_id" json:"series_id,omitempty"` - SeriesType *uint32 `protobuf:"varint,3,opt,name=series_type" json:"series_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestMatchesResponse_Series) Reset() { *m = CMsgDOTARequestMatchesResponse_Series{} } -func (m *CMsgDOTARequestMatchesResponse_Series) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestMatchesResponse_Series) ProtoMessage() {} -func (*CMsgDOTARequestMatchesResponse_Series) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{63, 0} -} - -func (m *CMsgDOTARequestMatchesResponse_Series) GetMatches() []*CMsgDOTAMatch { - if m != nil { - return m.Matches - } - return nil -} - -func (m *CMsgDOTARequestMatchesResponse_Series) GetSeriesId() uint32 { - if m != nil && m.SeriesId != nil { - return *m.SeriesId - } - return 0 -} - -func (m *CMsgDOTARequestMatchesResponse_Series) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -type CMsgDOTAPopup struct { - Id *CMsgDOTAPopup_PopupID `protobuf:"varint,1,opt,name=id,enum=CMsgDOTAPopup_PopupID,def=0" json:"id,omitempty"` - CustomText *string `protobuf:"bytes,2,opt,name=custom_text" json:"custom_text,omitempty"` - IntData *int32 `protobuf:"zigzag32,3,opt,name=int_data" json:"int_data,omitempty"` - PopupData []byte `protobuf:"bytes,4,opt,name=popup_data" json:"popup_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPopup) Reset() { *m = CMsgDOTAPopup{} } -func (m *CMsgDOTAPopup) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPopup) ProtoMessage() {} -func (*CMsgDOTAPopup) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{64} } - -const Default_CMsgDOTAPopup_Id CMsgDOTAPopup_PopupID = CMsgDOTAPopup_KICKED_FROM_LOBBY - -func (m *CMsgDOTAPopup) GetId() CMsgDOTAPopup_PopupID { - if m != nil && m.Id != nil { - return *m.Id - } - return Default_CMsgDOTAPopup_Id -} - -func (m *CMsgDOTAPopup) GetCustomText() string { - if m != nil && m.CustomText != nil { - return *m.CustomText - } - return "" -} - -func (m *CMsgDOTAPopup) GetIntData() int32 { - if m != nil && m.IntData != nil { - return *m.IntData - } - return 0 -} - -func (m *CMsgDOTAPopup) GetPopupData() []byte { - if m != nil { - return m.PopupData - } - return nil -} - -type CMsgDOTATeamMemberSDO struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TeamIds []uint32 `protobuf:"varint,2,rep,name=team_ids" json:"team_ids,omitempty"` - ProfileTeamId *uint32 `protobuf:"varint,3,opt,name=profile_team_id" json:"profile_team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamMemberSDO) Reset() { *m = CMsgDOTATeamMemberSDO{} } -func (m *CMsgDOTATeamMemberSDO) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamMemberSDO) ProtoMessage() {} -func (*CMsgDOTATeamMemberSDO) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{65} } - -func (m *CMsgDOTATeamMemberSDO) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTATeamMemberSDO) GetTeamIds() []uint32 { - if m != nil { - return m.TeamIds - } - return nil -} - -func (m *CMsgDOTATeamMemberSDO) GetProfileTeamId() uint32 { - if m != nil && m.ProfileTeamId != nil { - return *m.ProfileTeamId - } - return 0 -} - -type CMsgDOTATeamAdminSDO struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TeamIds []uint32 `protobuf:"varint,2,rep,name=team_ids" json:"team_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamAdminSDO) Reset() { *m = CMsgDOTATeamAdminSDO{} } -func (m *CMsgDOTATeamAdminSDO) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamAdminSDO) ProtoMessage() {} -func (*CMsgDOTATeamAdminSDO) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{66} } - -func (m *CMsgDOTATeamAdminSDO) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTATeamAdminSDO) GetTeamIds() []uint32 { - if m != nil { - return m.TeamIds - } - return nil -} - -type CMsgDOTATeamMember struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TimeJoined *uint32 `protobuf:"varint,4,opt,name=time_joined" json:"time_joined,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamMember) Reset() { *m = CMsgDOTATeamMember{} } -func (m *CMsgDOTATeamMember) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamMember) ProtoMessage() {} -func (*CMsgDOTATeamMember) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{67} } - -func (m *CMsgDOTATeamMember) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTATeamMember) GetTimeJoined() uint32 { - if m != nil && m.TimeJoined != nil { - return *m.TimeJoined - } - return 0 -} - -type CMsgDOTATeam struct { - Members []*CMsgDOTATeamMember `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Tag *string `protobuf:"bytes,4,opt,name=tag" json:"tag,omitempty"` - AdminId *uint32 `protobuf:"varint,5,opt,name=admin_id" json:"admin_id,omitempty"` - TimeCreated *uint32 `protobuf:"varint,6,opt,name=time_created" json:"time_created,omitempty"` - Disbanded *bool `protobuf:"varint,7,opt,name=disbanded" json:"disbanded,omitempty"` - Wins *uint32 `protobuf:"varint,8,opt,name=wins" json:"wins,omitempty"` - Losses *uint32 `protobuf:"varint,9,opt,name=losses" json:"losses,omitempty"` - Rank *uint32 `protobuf:"varint,10,opt,name=rank" json:"rank,omitempty"` - CalibrationGamesRemaining *uint32 `protobuf:"varint,24,opt,name=calibration_games_remaining" json:"calibration_games_remaining,omitempty"` - Logo *uint64 `protobuf:"varint,11,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,12,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,13,opt,name=banner_logo" json:"banner_logo,omitempty"` - SponsorLogo *uint64 `protobuf:"varint,14,opt,name=sponsor_logo" json:"sponsor_logo,omitempty"` - CountryCode *string `protobuf:"bytes,15,opt,name=country_code" json:"country_code,omitempty"` - Url *string `protobuf:"bytes,16,opt,name=url" json:"url,omitempty"` - Fullgamesplayed *uint32 `protobuf:"varint,17,opt,name=fullgamesplayed" json:"fullgamesplayed,omitempty"` - Leagues []uint32 `protobuf:"varint,18,rep,name=leagues" json:"leagues,omitempty"` - Gamesplayed *uint32 `protobuf:"varint,19,opt,name=gamesplayed" json:"gamesplayed,omitempty"` - Gamesplayedwithcurrentroster *uint32 `protobuf:"varint,20,opt,name=gamesplayedwithcurrentroster" json:"gamesplayedwithcurrentroster,omitempty"` - Teammatchmakinggamesplayed *uint32 `protobuf:"varint,21,opt,name=teammatchmakinggamesplayed" json:"teammatchmakinggamesplayed,omitempty"` - Lastplayedgametime *uint32 `protobuf:"varint,22,opt,name=lastplayedgametime" json:"lastplayedgametime,omitempty"` - Lastrenametime *uint32 `protobuf:"varint,23,opt,name=lastrenametime" json:"lastrenametime,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeam) Reset() { *m = CMsgDOTATeam{} } -func (m *CMsgDOTATeam) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeam) ProtoMessage() {} -func (*CMsgDOTATeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{68} } - -func (m *CMsgDOTATeam) GetMembers() []*CMsgDOTATeamMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CMsgDOTATeam) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTATeam) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTATeam) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *CMsgDOTATeam) GetAdminId() uint32 { - if m != nil && m.AdminId != nil { - return *m.AdminId - } - return 0 -} - -func (m *CMsgDOTATeam) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -func (m *CMsgDOTATeam) GetDisbanded() bool { - if m != nil && m.Disbanded != nil { - return *m.Disbanded - } - return false -} - -func (m *CMsgDOTATeam) GetWins() uint32 { - if m != nil && m.Wins != nil { - return *m.Wins - } - return 0 -} - -func (m *CMsgDOTATeam) GetLosses() uint32 { - if m != nil && m.Losses != nil { - return *m.Losses - } - return 0 -} - -func (m *CMsgDOTATeam) GetRank() uint32 { - if m != nil && m.Rank != nil { - return *m.Rank - } - return 0 -} - -func (m *CMsgDOTATeam) GetCalibrationGamesRemaining() uint32 { - if m != nil && m.CalibrationGamesRemaining != nil { - return *m.CalibrationGamesRemaining - } - return 0 -} - -func (m *CMsgDOTATeam) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTATeam) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTATeam) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -func (m *CMsgDOTATeam) GetSponsorLogo() uint64 { - if m != nil && m.SponsorLogo != nil { - return *m.SponsorLogo - } - return 0 -} - -func (m *CMsgDOTATeam) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTATeam) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *CMsgDOTATeam) GetFullgamesplayed() uint32 { - if m != nil && m.Fullgamesplayed != nil { - return *m.Fullgamesplayed - } - return 0 -} - -func (m *CMsgDOTATeam) GetLeagues() []uint32 { - if m != nil { - return m.Leagues - } - return nil -} - -func (m *CMsgDOTATeam) GetGamesplayed() uint32 { - if m != nil && m.Gamesplayed != nil { - return *m.Gamesplayed - } - return 0 -} - -func (m *CMsgDOTATeam) GetGamesplayedwithcurrentroster() uint32 { - if m != nil && m.Gamesplayedwithcurrentroster != nil { - return *m.Gamesplayedwithcurrentroster - } - return 0 -} - -func (m *CMsgDOTATeam) GetTeammatchmakinggamesplayed() uint32 { - if m != nil && m.Teammatchmakinggamesplayed != nil { - return *m.Teammatchmakinggamesplayed - } - return 0 -} - -func (m *CMsgDOTATeam) GetLastplayedgametime() uint32 { - if m != nil && m.Lastplayedgametime != nil { - return *m.Lastplayedgametime - } - return 0 -} - -func (m *CMsgDOTATeam) GetLastrenametime() uint32 { - if m != nil && m.Lastrenametime != nil { - return *m.Lastrenametime - } - return 0 -} - -type CMsgDOTACreateTeam struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Tag *string `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` - Logo *uint64 `protobuf:"varint,3,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,4,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,5,opt,name=banner_logo" json:"banner_logo,omitempty"` - SponsorLogo *uint64 `protobuf:"varint,6,opt,name=sponsor_logo" json:"sponsor_logo,omitempty"` - CountryCode *string `protobuf:"bytes,7,opt,name=country_code" json:"country_code,omitempty"` - Url *string `protobuf:"bytes,8,opt,name=url" json:"url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACreateTeam) Reset() { *m = CMsgDOTACreateTeam{} } -func (m *CMsgDOTACreateTeam) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACreateTeam) ProtoMessage() {} -func (*CMsgDOTACreateTeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{69} } - -func (m *CMsgDOTACreateTeam) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTACreateTeam) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *CMsgDOTACreateTeam) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTACreateTeam) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTACreateTeam) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -func (m *CMsgDOTACreateTeam) GetSponsorLogo() uint64 { - if m != nil && m.SponsorLogo != nil { - return *m.SponsorLogo - } - return 0 -} - -func (m *CMsgDOTACreateTeam) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTACreateTeam) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -type CMsgDOTACreateTeamResponse struct { - Results []CMsgDOTACreateTeamResponse_Result `protobuf:"varint,1,rep,name=results,enum=CMsgDOTACreateTeamResponse_Result" json:"results,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - SecondsRemaining *uint32 `protobuf:"varint,3,opt,name=seconds_remaining" json:"seconds_remaining,omitempty"` - RequiredLevel *uint32 `protobuf:"varint,4,opt,name=required_level" json:"required_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACreateTeamResponse) Reset() { *m = CMsgDOTACreateTeamResponse{} } -func (m *CMsgDOTACreateTeamResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACreateTeamResponse) ProtoMessage() {} -func (*CMsgDOTACreateTeamResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{70} } - -func (m *CMsgDOTACreateTeamResponse) GetResults() []CMsgDOTACreateTeamResponse_Result { - if m != nil { - return m.Results - } - return nil -} - -func (m *CMsgDOTACreateTeamResponse) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTACreateTeamResponse) GetSecondsRemaining() uint32 { - if m != nil && m.SecondsRemaining != nil { - return *m.SecondsRemaining - } - return 0 -} - -func (m *CMsgDOTACreateTeamResponse) GetRequiredLevel() uint32 { - if m != nil && m.RequiredLevel != nil { - return *m.RequiredLevel - } - return 0 -} - -type CMsgDOTAEditTeam struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Tag *string `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` - Logo *uint64 `protobuf:"varint,3,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,4,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,5,opt,name=banner_logo" json:"banner_logo,omitempty"` - SponsorLogo *uint64 `protobuf:"varint,6,opt,name=sponsor_logo" json:"sponsor_logo,omitempty"` - CountryCode *string `protobuf:"bytes,7,opt,name=country_code" json:"country_code,omitempty"` - Url *string `protobuf:"bytes,8,opt,name=url" json:"url,omitempty"` - TeamId *uint32 `protobuf:"varint,9,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditTeam) Reset() { *m = CMsgDOTAEditTeam{} } -func (m *CMsgDOTAEditTeam) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditTeam) ProtoMessage() {} -func (*CMsgDOTAEditTeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{71} } - -func (m *CMsgDOTAEditTeam) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTAEditTeam) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *CMsgDOTAEditTeam) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAEditTeam) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTAEditTeam) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -func (m *CMsgDOTAEditTeam) GetSponsorLogo() uint64 { - if m != nil && m.SponsorLogo != nil { - return *m.SponsorLogo - } - return 0 -} - -func (m *CMsgDOTAEditTeam) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTAEditTeam) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *CMsgDOTAEditTeam) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTAEditTeamLogo struct { - Logo *uint64 `protobuf:"varint,1,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,2,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,3,opt,name=banner_logo" json:"banner_logo,omitempty"` - SponsorLogo *uint64 `protobuf:"varint,4,opt,name=sponsor_logo" json:"sponsor_logo,omitempty"` - TeamId *uint32 `protobuf:"varint,5,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditTeamLogo) Reset() { *m = CMsgDOTAEditTeamLogo{} } -func (m *CMsgDOTAEditTeamLogo) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditTeamLogo) ProtoMessage() {} -func (*CMsgDOTAEditTeamLogo) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{72} } - -func (m *CMsgDOTAEditTeamLogo) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAEditTeamLogo) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTAEditTeamLogo) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -func (m *CMsgDOTAEditTeamLogo) GetSponsorLogo() uint64 { - if m != nil && m.SponsorLogo != nil { - return *m.SponsorLogo - } - return 0 -} - -func (m *CMsgDOTAEditTeamLogo) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTAEditTeamLogoResponse struct { - Results []CMsgDOTAEditTeamLogoResponse_Result `protobuf:"varint,1,rep,name=results,enum=CMsgDOTAEditTeamLogoResponse_Result" json:"results,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditTeamLogoResponse) Reset() { *m = CMsgDOTAEditTeamLogoResponse{} } -func (m *CMsgDOTAEditTeamLogoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditTeamLogoResponse) ProtoMessage() {} -func (*CMsgDOTAEditTeamLogoResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{73} } - -func (m *CMsgDOTAEditTeamLogoResponse) GetResults() []CMsgDOTAEditTeamLogoResponse_Result { - if m != nil { - return m.Results - } - return nil -} - -type CMsgDOTAEditTeamDetails struct { - CountryCode *string `protobuf:"bytes,1,opt,name=country_code" json:"country_code,omitempty"` - Url *string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` - TeamId *uint32 `protobuf:"varint,3,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditTeamDetails) Reset() { *m = CMsgDOTAEditTeamDetails{} } -func (m *CMsgDOTAEditTeamDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditTeamDetails) ProtoMessage() {} -func (*CMsgDOTAEditTeamDetails) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{74} } - -func (m *CMsgDOTAEditTeamDetails) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTAEditTeamDetails) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *CMsgDOTAEditTeamDetails) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTAEditTeamDetailsResponse struct { - Results []CMsgDOTAEditTeamDetailsResponse_Result `protobuf:"varint,1,rep,name=results,enum=CMsgDOTAEditTeamDetailsResponse_Result" json:"results,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditTeamDetailsResponse) Reset() { *m = CMsgDOTAEditTeamDetailsResponse{} } -func (m *CMsgDOTAEditTeamDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditTeamDetailsResponse) ProtoMessage() {} -func (*CMsgDOTAEditTeamDetailsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{75} -} - -func (m *CMsgDOTAEditTeamDetailsResponse) GetResults() []CMsgDOTAEditTeamDetailsResponse_Result { - if m != nil { - return m.Results - } - return nil -} - -type CMsgDOTADisbandTeam struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTADisbandTeam) Reset() { *m = CMsgDOTADisbandTeam{} } -func (m *CMsgDOTADisbandTeam) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTADisbandTeam) ProtoMessage() {} -func (*CMsgDOTADisbandTeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{76} } - -func (m *CMsgDOTADisbandTeam) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTADisbandTeamResponse struct { - Result *CMsgDOTADisbandTeamResponse_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTADisbandTeamResponse_Result,def=0" json:"result,omitempty"` - TeamName *string `protobuf:"bytes,2,opt,name=team_name" json:"team_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTADisbandTeamResponse) Reset() { *m = CMsgDOTADisbandTeamResponse{} } -func (m *CMsgDOTADisbandTeamResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTADisbandTeamResponse) ProtoMessage() {} -func (*CMsgDOTADisbandTeamResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{77} } - -const Default_CMsgDOTADisbandTeamResponse_Result CMsgDOTADisbandTeamResponse_Result = CMsgDOTADisbandTeamResponse_SUCCESS - -func (m *CMsgDOTADisbandTeamResponse) GetResult() CMsgDOTADisbandTeamResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTADisbandTeamResponse_Result -} - -func (m *CMsgDOTADisbandTeamResponse) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -type CMsgDOTARequestTeamData struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestTeamData) Reset() { *m = CMsgDOTARequestTeamData{} } -func (m *CMsgDOTARequestTeamData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestTeamData) ProtoMessage() {} -func (*CMsgDOTARequestTeamData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{78} } - -type CMsgDOTARequestTeamDataResponse struct { - Result *CMsgDOTARequestTeamDataResponse_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTARequestTeamDataResponse_Result,def=0" json:"result,omitempty"` - Data []*CMsgDOTATeamData `protobuf:"bytes,2,rep,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestTeamDataResponse) Reset() { *m = CMsgDOTARequestTeamDataResponse{} } -func (m *CMsgDOTARequestTeamDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestTeamDataResponse) ProtoMessage() {} -func (*CMsgDOTARequestTeamDataResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{79} -} - -const Default_CMsgDOTARequestTeamDataResponse_Result CMsgDOTARequestTeamDataResponse_Result = CMsgDOTARequestTeamDataResponse_SUCCESS - -func (m *CMsgDOTARequestTeamDataResponse) GetResult() CMsgDOTARequestTeamDataResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTARequestTeamDataResponse_Result -} - -func (m *CMsgDOTARequestTeamDataResponse) GetData() []*CMsgDOTATeamData { - if m != nil { - return m.Data - } - return nil -} - -type CMsgDOTATeamData struct { - OnTeam *bool `protobuf:"varint,1,opt,name=on_team" json:"on_team,omitempty"` - ProfileTeam *bool `protobuf:"varint,2,opt,name=profile_team" json:"profile_team,omitempty"` - Team *CMsgDOTATeam `protobuf:"bytes,3,opt,name=team" json:"team,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamData) Reset() { *m = CMsgDOTATeamData{} } -func (m *CMsgDOTATeamData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamData) ProtoMessage() {} -func (*CMsgDOTATeamData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{80} } - -func (m *CMsgDOTATeamData) GetOnTeam() bool { - if m != nil && m.OnTeam != nil { - return *m.OnTeam - } - return false -} - -func (m *CMsgDOTATeamData) GetProfileTeam() bool { - if m != nil && m.ProfileTeam != nil { - return *m.ProfileTeam - } - return false -} - -func (m *CMsgDOTATeamData) GetTeam() *CMsgDOTATeam { - if m != nil { - return m.Team - } - return nil -} - -type CMsgDOTATeamProfileRequest struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamProfileRequest) Reset() { *m = CMsgDOTATeamProfileRequest{} } -func (m *CMsgDOTATeamProfileRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamProfileRequest) ProtoMessage() {} -func (*CMsgDOTATeamProfileRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{81} } - -func (m *CMsgDOTATeamProfileRequest) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTATeamMemberProfileRequest struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamMemberProfileRequest) Reset() { *m = CMsgDOTATeamMemberProfileRequest{} } -func (m *CMsgDOTATeamMemberProfileRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamMemberProfileRequest) ProtoMessage() {} -func (*CMsgDOTATeamMemberProfileRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{82} -} - -func (m *CMsgDOTATeamMemberProfileRequest) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgDOTATeamIDByNameRequest struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamIDByNameRequest) Reset() { *m = CMsgDOTATeamIDByNameRequest{} } -func (m *CMsgDOTATeamIDByNameRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamIDByNameRequest) ProtoMessage() {} -func (*CMsgDOTATeamIDByNameRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{83} } - -func (m *CMsgDOTATeamIDByNameRequest) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type CMsgDOTATeamIDByNameResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult" json:"eresult,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamIDByNameResponse) Reset() { *m = CMsgDOTATeamIDByNameResponse{} } -func (m *CMsgDOTATeamIDByNameResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamIDByNameResponse) ProtoMessage() {} -func (*CMsgDOTATeamIDByNameResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{84} } - -func (m *CMsgDOTATeamIDByNameResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return 0 -} - -func (m *CMsgDOTATeamIDByNameResponse) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTATeamProfileResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult" json:"eresult,omitempty"` - Team *CMsgDOTATeam `protobuf:"bytes,2,opt,name=team" json:"team,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamProfileResponse) Reset() { *m = CMsgDOTATeamProfileResponse{} } -func (m *CMsgDOTATeamProfileResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamProfileResponse) ProtoMessage() {} -func (*CMsgDOTATeamProfileResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{85} } - -func (m *CMsgDOTATeamProfileResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return 0 -} - -func (m *CMsgDOTATeamProfileResponse) GetTeam() *CMsgDOTATeam { - if m != nil { - return m.Team - } - return nil -} - -type CMsgDOTAProTeamListRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProTeamListRequest) Reset() { *m = CMsgDOTAProTeamListRequest{} } -func (m *CMsgDOTAProTeamListRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProTeamListRequest) ProtoMessage() {} -func (*CMsgDOTAProTeamListRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{86} } - -type CMsgDOTAProTeamListResponse struct { - Teams []*CMsgDOTAProTeamListResponse_TeamEntry `protobuf:"bytes,1,rep,name=teams" json:"teams,omitempty"` - Eresult *uint32 `protobuf:"varint,2,opt,name=eresult" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProTeamListResponse) Reset() { *m = CMsgDOTAProTeamListResponse{} } -func (m *CMsgDOTAProTeamListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProTeamListResponse) ProtoMessage() {} -func (*CMsgDOTAProTeamListResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{87} } - -func (m *CMsgDOTAProTeamListResponse) GetTeams() []*CMsgDOTAProTeamListResponse_TeamEntry { - if m != nil { - return m.Teams - } - return nil -} - -func (m *CMsgDOTAProTeamListResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return 0 -} - -type CMsgDOTAProTeamListResponse_TeamEntry struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - Tag *string `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` - TimeCreated *uint32 `protobuf:"varint,3,opt,name=time_created" json:"time_created,omitempty"` - Logo *uint64 `protobuf:"varint,4,opt,name=logo" json:"logo,omitempty"` - CountryCode *string `protobuf:"bytes,5,opt,name=country_code" json:"country_code,omitempty"` - MemberCount *uint32 `protobuf:"varint,6,opt,name=member_count" json:"member_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) Reset() { *m = CMsgDOTAProTeamListResponse_TeamEntry{} } -func (m *CMsgDOTAProTeamListResponse_TeamEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProTeamListResponse_TeamEntry) ProtoMessage() {} -func (*CMsgDOTAProTeamListResponse_TeamEntry) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{87, 0} -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTAProTeamListResponse_TeamEntry) GetMemberCount() uint32 { - if m != nil && m.MemberCount != nil { - return *m.MemberCount - } - return 0 -} - -type CMsgDOTATeamInvite_InviterToGC struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamInvite_InviterToGC) Reset() { *m = CMsgDOTATeamInvite_InviterToGC{} } -func (m *CMsgDOTATeamInvite_InviterToGC) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamInvite_InviterToGC) ProtoMessage() {} -func (*CMsgDOTATeamInvite_InviterToGC) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{88} } - -func (m *CMsgDOTATeamInvite_InviterToGC) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTATeamInvite_InviterToGC) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTATeamInvite_GCImmediateResponseToInviter struct { - Result *CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result,def=0" json:"result,omitempty"` - InviteeName *string `protobuf:"bytes,2,opt,name=invitee_name" json:"invitee_name,omitempty"` - RequiredLevel *uint32 `protobuf:"varint,3,opt,name=required_level" json:"required_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamInvite_GCImmediateResponseToInviter) Reset() { - *m = CMsgDOTATeamInvite_GCImmediateResponseToInviter{} -} -func (m *CMsgDOTATeamInvite_GCImmediateResponseToInviter) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTATeamInvite_GCImmediateResponseToInviter) ProtoMessage() {} -func (*CMsgDOTATeamInvite_GCImmediateResponseToInviter) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{89} -} - -const Default_CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result = CMsgDOTATeamInvite_GCImmediateResponseToInviter_SUCCESS - -func (m *CMsgDOTATeamInvite_GCImmediateResponseToInviter) GetResult() CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result -} - -func (m *CMsgDOTATeamInvite_GCImmediateResponseToInviter) GetInviteeName() string { - if m != nil && m.InviteeName != nil { - return *m.InviteeName - } - return "" -} - -func (m *CMsgDOTATeamInvite_GCImmediateResponseToInviter) GetRequiredLevel() uint32 { - if m != nil && m.RequiredLevel != nil { - return *m.RequiredLevel - } - return 0 -} - -type CMsgDOTATeamInvite_GCRequestToInvitee struct { - InviterAccountId *uint32 `protobuf:"varint,1,opt,name=inviter_account_id" json:"inviter_account_id,omitempty"` - TeamName *string `protobuf:"bytes,2,opt,name=team_name" json:"team_name,omitempty"` - TeamTag *string `protobuf:"bytes,3,opt,name=team_tag" json:"team_tag,omitempty"` - Logo *uint64 `protobuf:"varint,4,opt,name=logo" json:"logo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamInvite_GCRequestToInvitee) Reset() { *m = CMsgDOTATeamInvite_GCRequestToInvitee{} } -func (m *CMsgDOTATeamInvite_GCRequestToInvitee) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamInvite_GCRequestToInvitee) ProtoMessage() {} -func (*CMsgDOTATeamInvite_GCRequestToInvitee) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{90} -} - -func (m *CMsgDOTATeamInvite_GCRequestToInvitee) GetInviterAccountId() uint32 { - if m != nil && m.InviterAccountId != nil { - return *m.InviterAccountId - } - return 0 -} - -func (m *CMsgDOTATeamInvite_GCRequestToInvitee) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTATeamInvite_GCRequestToInvitee) GetTeamTag() string { - if m != nil && m.TeamTag != nil { - return *m.TeamTag - } - return "" -} - -func (m *CMsgDOTATeamInvite_GCRequestToInvitee) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -type CMsgDOTATeamInvite_InviteeResponseToGC struct { - Result *CMsgDOTATeamInvite_InviteeResponseToGC_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTATeamInvite_InviteeResponseToGC_Result,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamInvite_InviteeResponseToGC) Reset() { - *m = CMsgDOTATeamInvite_InviteeResponseToGC{} -} -func (m *CMsgDOTATeamInvite_InviteeResponseToGC) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamInvite_InviteeResponseToGC) ProtoMessage() {} -func (*CMsgDOTATeamInvite_InviteeResponseToGC) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{91} -} - -const Default_CMsgDOTATeamInvite_InviteeResponseToGC_Result CMsgDOTATeamInvite_InviteeResponseToGC_Result = CMsgDOTATeamInvite_InviteeResponseToGC_JOIN - -func (m *CMsgDOTATeamInvite_InviteeResponseToGC) GetResult() CMsgDOTATeamInvite_InviteeResponseToGC_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTATeamInvite_InviteeResponseToGC_Result -} - -type CMsgDOTATeamInvite_GCResponseToInviter struct { - Result *CMsgDOTATeamInvite_GCResponseToInviter_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTATeamInvite_GCResponseToInviter_Result,def=0" json:"result,omitempty"` - InviteeName *string `protobuf:"bytes,2,opt,name=invitee_name" json:"invitee_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamInvite_GCResponseToInviter) Reset() { - *m = CMsgDOTATeamInvite_GCResponseToInviter{} -} -func (m *CMsgDOTATeamInvite_GCResponseToInviter) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamInvite_GCResponseToInviter) ProtoMessage() {} -func (*CMsgDOTATeamInvite_GCResponseToInviter) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{92} -} - -const Default_CMsgDOTATeamInvite_GCResponseToInviter_Result CMsgDOTATeamInvite_GCResponseToInviter_Result = CMsgDOTATeamInvite_GCResponseToInviter_JOINED - -func (m *CMsgDOTATeamInvite_GCResponseToInviter) GetResult() CMsgDOTATeamInvite_GCResponseToInviter_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTATeamInvite_GCResponseToInviter_Result -} - -func (m *CMsgDOTATeamInvite_GCResponseToInviter) GetInviteeName() string { - if m != nil && m.InviteeName != nil { - return *m.InviteeName - } - return "" -} - -type CMsgDOTATeamInvite_GCResponseToInvitee struct { - Result *CMsgDOTATeamInvite_GCResponseToInvitee_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTATeamInvite_GCResponseToInvitee_Result,def=0" json:"result,omitempty"` - TeamName *string `protobuf:"bytes,2,opt,name=team_name" json:"team_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamInvite_GCResponseToInvitee) Reset() { - *m = CMsgDOTATeamInvite_GCResponseToInvitee{} -} -func (m *CMsgDOTATeamInvite_GCResponseToInvitee) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamInvite_GCResponseToInvitee) ProtoMessage() {} -func (*CMsgDOTATeamInvite_GCResponseToInvitee) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{93} -} - -const Default_CMsgDOTATeamInvite_GCResponseToInvitee_Result CMsgDOTATeamInvite_GCResponseToInvitee_Result = CMsgDOTATeamInvite_GCResponseToInvitee_SUCCESS - -func (m *CMsgDOTATeamInvite_GCResponseToInvitee) GetResult() CMsgDOTATeamInvite_GCResponseToInvitee_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTATeamInvite_GCResponseToInvitee_Result -} - -func (m *CMsgDOTATeamInvite_GCResponseToInvitee) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -type CMsgDOTATeamOnProfile struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - Enabled *bool `protobuf:"varint,2,opt,name=enabled" json:"enabled,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATeamOnProfile) Reset() { *m = CMsgDOTATeamOnProfile{} } -func (m *CMsgDOTATeamOnProfile) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATeamOnProfile) ProtoMessage() {} -func (*CMsgDOTATeamOnProfile) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{94} } - -func (m *CMsgDOTATeamOnProfile) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTATeamOnProfile) GetEnabled() bool { - if m != nil && m.Enabled != nil { - return *m.Enabled - } - return false -} - -type CMsgDOTAKickTeamMember struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAKickTeamMember) Reset() { *m = CMsgDOTAKickTeamMember{} } -func (m *CMsgDOTAKickTeamMember) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAKickTeamMember) ProtoMessage() {} -func (*CMsgDOTAKickTeamMember) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{95} } - -func (m *CMsgDOTAKickTeamMember) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAKickTeamMember) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTAKickTeamMemberResponse struct { - Result *CMsgDOTAKickTeamMemberResponse_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAKickTeamMemberResponse_Result,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAKickTeamMemberResponse) Reset() { *m = CMsgDOTAKickTeamMemberResponse{} } -func (m *CMsgDOTAKickTeamMemberResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAKickTeamMemberResponse) ProtoMessage() {} -func (*CMsgDOTAKickTeamMemberResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{96} } - -const Default_CMsgDOTAKickTeamMemberResponse_Result CMsgDOTAKickTeamMemberResponse_Result = CMsgDOTAKickTeamMemberResponse_SUCCESS - -func (m *CMsgDOTAKickTeamMemberResponse) GetResult() CMsgDOTAKickTeamMemberResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAKickTeamMemberResponse_Result -} - -type CMsgDOTATransferTeamAdmin struct { - NewAdminAccountId *uint32 `protobuf:"varint,1,opt,name=new_admin_account_id" json:"new_admin_account_id,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATransferTeamAdmin) Reset() { *m = CMsgDOTATransferTeamAdmin{} } -func (m *CMsgDOTATransferTeamAdmin) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATransferTeamAdmin) ProtoMessage() {} -func (*CMsgDOTATransferTeamAdmin) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{97} } - -func (m *CMsgDOTATransferTeamAdmin) GetNewAdminAccountId() uint32 { - if m != nil && m.NewAdminAccountId != nil { - return *m.NewAdminAccountId - } - return 0 -} - -func (m *CMsgDOTATransferTeamAdmin) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTATransferTeamAdminResponse struct { - Result *CMsgDOTATransferTeamAdminResponse_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTATransferTeamAdminResponse_Result,def=0" json:"result,omitempty"` - InviteeName *string `protobuf:"bytes,2,opt,name=invitee_name" json:"invitee_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATransferTeamAdminResponse) Reset() { *m = CMsgDOTATransferTeamAdminResponse{} } -func (m *CMsgDOTATransferTeamAdminResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATransferTeamAdminResponse) ProtoMessage() {} -func (*CMsgDOTATransferTeamAdminResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{98} -} - -const Default_CMsgDOTATransferTeamAdminResponse_Result CMsgDOTATransferTeamAdminResponse_Result = CMsgDOTATransferTeamAdminResponse_SUCCESS - -func (m *CMsgDOTATransferTeamAdminResponse) GetResult() CMsgDOTATransferTeamAdminResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTATransferTeamAdminResponse_Result -} - -func (m *CMsgDOTATransferTeamAdminResponse) GetInviteeName() string { - if m != nil && m.InviteeName != nil { - return *m.InviteeName - } - return "" -} - -type CMsgDOTALeaveTeam struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeaveTeam) Reset() { *m = CMsgDOTALeaveTeam{} } -func (m *CMsgDOTALeaveTeam) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeaveTeam) ProtoMessage() {} -func (*CMsgDOTALeaveTeam) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{99} } - -func (m *CMsgDOTALeaveTeam) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CMsgDOTALeaveTeamResponse struct { - Result *CMsgDOTALeaveTeamResponse_Result `protobuf:"varint,1,opt,name=result,enum=CMsgDOTALeaveTeamResponse_Result,def=0" json:"result,omitempty"` - TeamName *string `protobuf:"bytes,2,opt,name=team_name" json:"team_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeaveTeamResponse) Reset() { *m = CMsgDOTALeaveTeamResponse{} } -func (m *CMsgDOTALeaveTeamResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeaveTeamResponse) ProtoMessage() {} -func (*CMsgDOTALeaveTeamResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{100} } - -const Default_CMsgDOTALeaveTeamResponse_Result CMsgDOTALeaveTeamResponse_Result = CMsgDOTALeaveTeamResponse_SUCCESS - -func (m *CMsgDOTALeaveTeamResponse) GetResult() CMsgDOTALeaveTeamResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTALeaveTeamResponse_Result -} - -func (m *CMsgDOTALeaveTeamResponse) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -type CMsgDOTABetaParticipation struct { - AccessRights *uint32 `protobuf:"varint,1,opt,name=access_rights" json:"access_rights,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTABetaParticipation) Reset() { *m = CMsgDOTABetaParticipation{} } -func (m *CMsgDOTABetaParticipation) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTABetaParticipation) ProtoMessage() {} -func (*CMsgDOTABetaParticipation) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{101} } - -func (m *CMsgDOTABetaParticipation) GetAccessRights() uint32 { - if m != nil && m.AccessRights != nil { - return *m.AccessRights - } - return 0 -} - -type CMsgDOTAJoinChatChannel struct { - ChannelName *string `protobuf:"bytes,2,opt,name=channel_name" json:"channel_name,omitempty"` - ChannelType *DOTAChatChannelTypeT `protobuf:"varint,4,opt,name=channel_type,enum=DOTAChatChannelTypeT,def=0" json:"channel_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAJoinChatChannel) Reset() { *m = CMsgDOTAJoinChatChannel{} } -func (m *CMsgDOTAJoinChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAJoinChatChannel) ProtoMessage() {} -func (*CMsgDOTAJoinChatChannel) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{102} } - -const Default_CMsgDOTAJoinChatChannel_ChannelType DOTAChatChannelTypeT = DOTAChatChannelTypeT_DOTAChannelType_Regional - -func (m *CMsgDOTAJoinChatChannel) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgDOTAJoinChatChannel) GetChannelType() DOTAChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgDOTAJoinChatChannel_ChannelType -} - -type CMsgDOTALeaveChatChannel struct { - ChannelId *uint64 `protobuf:"varint,1,opt,name=channel_id" json:"channel_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeaveChatChannel) Reset() { *m = CMsgDOTALeaveChatChannel{} } -func (m *CMsgDOTALeaveChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeaveChatChannel) ProtoMessage() {} -func (*CMsgDOTALeaveChatChannel) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{103} } - -func (m *CMsgDOTALeaveChatChannel) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -type CMsgDOTAClientIgnoredUser struct { - IgnoredAccountId *uint32 `protobuf:"varint,1,opt,name=ignored_account_id" json:"ignored_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAClientIgnoredUser) Reset() { *m = CMsgDOTAClientIgnoredUser{} } -func (m *CMsgDOTAClientIgnoredUser) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAClientIgnoredUser) ProtoMessage() {} -func (*CMsgDOTAClientIgnoredUser) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{104} } - -func (m *CMsgDOTAClientIgnoredUser) GetIgnoredAccountId() uint32 { - if m != nil && m.IgnoredAccountId != nil { - return *m.IgnoredAccountId - } - return 0 -} - -type CMsgDOTAChatMessage struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ChannelId *uint64 `protobuf:"varint,2,opt,name=channel_id" json:"channel_id,omitempty"` - PersonaName *string `protobuf:"bytes,3,opt,name=persona_name" json:"persona_name,omitempty"` - Text *string `protobuf:"bytes,4,opt,name=text" json:"text,omitempty"` - Timestamp *uint32 `protobuf:"varint,5,opt,name=timestamp" json:"timestamp,omitempty"` - SuggestInviteAccountId *uint32 `protobuf:"varint,6,opt,name=suggest_invite_account_id" json:"suggest_invite_account_id,omitempty"` - SuggestInviteName *string `protobuf:"bytes,7,opt,name=suggest_invite_name" json:"suggest_invite_name,omitempty"` - FantasyDraftOwnerAccountId *uint32 `protobuf:"varint,8,opt,name=fantasy_draft_owner_account_id" json:"fantasy_draft_owner_account_id,omitempty"` - FantasyDraftPlayerAccountId *uint32 `protobuf:"varint,9,opt,name=fantasy_draft_player_account_id" json:"fantasy_draft_player_account_id,omitempty"` - EventId *uint32 `protobuf:"varint,10,opt,name=event_id" json:"event_id,omitempty"` - SuggestInviteToLobby *bool `protobuf:"varint,11,opt,name=suggest_invite_to_lobby" json:"suggest_invite_to_lobby,omitempty"` - EventPoints *uint32 `protobuf:"varint,12,opt,name=event_points" json:"event_points,omitempty"` - CoinFlip *bool `protobuf:"varint,13,opt,name=coin_flip" json:"coin_flip,omitempty"` - PlayerId *int32 `protobuf:"varint,14,opt,name=player_id,def=-1" json:"player_id,omitempty"` - ShareProfileAccountId *uint32 `protobuf:"varint,15,opt,name=share_profile_account_id" json:"share_profile_account_id,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,16,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - DiceRoll *CMsgDOTAChatMessage_DiceRoll `protobuf:"bytes,17,opt,name=dice_roll" json:"dice_roll,omitempty"` - SharePartyId *uint64 `protobuf:"varint,18,opt,name=share_party_id" json:"share_party_id,omitempty"` - ShareLobbyId *uint64 `protobuf:"varint,19,opt,name=share_lobby_id" json:"share_lobby_id,omitempty"` - ShareLobbyCustomGameId *uint64 `protobuf:"varint,20,opt,name=share_lobby_custom_game_id" json:"share_lobby_custom_game_id,omitempty"` - ShareLobbyPasskey *string `protobuf:"bytes,21,opt,name=share_lobby_passkey" json:"share_lobby_passkey,omitempty"` - PrivateChatChannelId *uint32 `protobuf:"varint,22,opt,name=private_chat_channel_id" json:"private_chat_channel_id,omitempty"` - Status *uint32 `protobuf:"varint,23,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatMessage) Reset() { *m = CMsgDOTAChatMessage{} } -func (m *CMsgDOTAChatMessage) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatMessage) ProtoMessage() {} -func (*CMsgDOTAChatMessage) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{105} } - -const Default_CMsgDOTAChatMessage_PlayerId int32 = -1 - -func (m *CMsgDOTAChatMessage) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgDOTAChatMessage) GetText() string { - if m != nil && m.Text != nil { - return *m.Text - } - return "" -} - -func (m *CMsgDOTAChatMessage) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetSuggestInviteAccountId() uint32 { - if m != nil && m.SuggestInviteAccountId != nil { - return *m.SuggestInviteAccountId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetSuggestInviteName() string { - if m != nil && m.SuggestInviteName != nil { - return *m.SuggestInviteName - } - return "" -} - -func (m *CMsgDOTAChatMessage) GetFantasyDraftOwnerAccountId() uint32 { - if m != nil && m.FantasyDraftOwnerAccountId != nil { - return *m.FantasyDraftOwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetFantasyDraftPlayerAccountId() uint32 { - if m != nil && m.FantasyDraftPlayerAccountId != nil { - return *m.FantasyDraftPlayerAccountId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetSuggestInviteToLobby() bool { - if m != nil && m.SuggestInviteToLobby != nil { - return *m.SuggestInviteToLobby - } - return false -} - -func (m *CMsgDOTAChatMessage) GetEventPoints() uint32 { - if m != nil && m.EventPoints != nil { - return *m.EventPoints - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetCoinFlip() bool { - if m != nil && m.CoinFlip != nil { - return *m.CoinFlip - } - return false -} - -func (m *CMsgDOTAChatMessage) GetPlayerId() int32 { - if m != nil && m.PlayerId != nil { - return *m.PlayerId - } - return Default_CMsgDOTAChatMessage_PlayerId -} - -func (m *CMsgDOTAChatMessage) GetShareProfileAccountId() uint32 { - if m != nil && m.ShareProfileAccountId != nil { - return *m.ShareProfileAccountId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetDiceRoll() *CMsgDOTAChatMessage_DiceRoll { - if m != nil { - return m.DiceRoll - } - return nil -} - -func (m *CMsgDOTAChatMessage) GetSharePartyId() uint64 { - if m != nil && m.SharePartyId != nil { - return *m.SharePartyId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetShareLobbyId() uint64 { - if m != nil && m.ShareLobbyId != nil { - return *m.ShareLobbyId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetShareLobbyCustomGameId() uint64 { - if m != nil && m.ShareLobbyCustomGameId != nil { - return *m.ShareLobbyCustomGameId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetShareLobbyPasskey() string { - if m != nil && m.ShareLobbyPasskey != nil { - return *m.ShareLobbyPasskey - } - return "" -} - -func (m *CMsgDOTAChatMessage) GetPrivateChatChannelId() uint32 { - if m != nil && m.PrivateChatChannelId != nil { - return *m.PrivateChatChannelId - } - return 0 -} - -func (m *CMsgDOTAChatMessage) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgDOTAChatMessage_DiceRoll struct { - RollMin *int32 `protobuf:"varint,1,opt,name=roll_min" json:"roll_min,omitempty"` - RollMax *int32 `protobuf:"varint,2,opt,name=roll_max" json:"roll_max,omitempty"` - Result *int32 `protobuf:"varint,3,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatMessage_DiceRoll) Reset() { *m = CMsgDOTAChatMessage_DiceRoll{} } -func (m *CMsgDOTAChatMessage_DiceRoll) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatMessage_DiceRoll) ProtoMessage() {} -func (*CMsgDOTAChatMessage_DiceRoll) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{105, 0} -} - -func (m *CMsgDOTAChatMessage_DiceRoll) GetRollMin() int32 { - if m != nil && m.RollMin != nil { - return *m.RollMin - } - return 0 -} - -func (m *CMsgDOTAChatMessage_DiceRoll) GetRollMax() int32 { - if m != nil && m.RollMax != nil { - return *m.RollMax - } - return 0 -} - -func (m *CMsgDOTAChatMessage_DiceRoll) GetResult() int32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgDOTAChatMember struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,3,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - Status *uint32 `protobuf:"varint,4,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatMember) Reset() { *m = CMsgDOTAChatMember{} } -func (m *CMsgDOTAChatMember) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatMember) ProtoMessage() {} -func (*CMsgDOTAChatMember) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{106} } - -func (m *CMsgDOTAChatMember) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAChatMember) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgDOTAChatMember) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -func (m *CMsgDOTAChatMember) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgDOTAJoinChatChannelResponse struct { - Response *uint32 `protobuf:"varint,1,opt,name=response" json:"response,omitempty"` - ChannelName *string `protobuf:"bytes,2,opt,name=channel_name" json:"channel_name,omitempty"` - ChannelId *uint64 `protobuf:"fixed64,3,opt,name=channel_id" json:"channel_id,omitempty"` - MaxMembers *uint32 `protobuf:"varint,4,opt,name=max_members" json:"max_members,omitempty"` - Members []*CMsgDOTAChatMember `protobuf:"bytes,5,rep,name=members" json:"members,omitempty"` - ChannelType *DOTAChatChannelTypeT `protobuf:"varint,6,opt,name=channel_type,enum=DOTAChatChannelTypeT,def=0" json:"channel_type,omitempty"` - Result *CMsgDOTAJoinChatChannelResponse_Result `protobuf:"varint,7,opt,name=result,enum=CMsgDOTAJoinChatChannelResponse_Result,def=0" json:"result,omitempty"` - GcInitiatedJoin *bool `protobuf:"varint,8,opt,name=gc_initiated_join" json:"gc_initiated_join,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,9,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - WelcomeMessage *string `protobuf:"bytes,10,opt,name=welcome_message" json:"welcome_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAJoinChatChannelResponse) Reset() { *m = CMsgDOTAJoinChatChannelResponse{} } -func (m *CMsgDOTAJoinChatChannelResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAJoinChatChannelResponse) ProtoMessage() {} -func (*CMsgDOTAJoinChatChannelResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{107} -} - -const Default_CMsgDOTAJoinChatChannelResponse_ChannelType DOTAChatChannelTypeT = DOTAChatChannelTypeT_DOTAChannelType_Regional -const Default_CMsgDOTAJoinChatChannelResponse_Result CMsgDOTAJoinChatChannelResponse_Result = CMsgDOTAJoinChatChannelResponse_JOIN_SUCCESS - -func (m *CMsgDOTAJoinChatChannelResponse) GetResponse() uint32 { - if m != nil && m.Response != nil { - return *m.Response - } - return 0 -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetMaxMembers() uint32 { - if m != nil && m.MaxMembers != nil { - return *m.MaxMembers - } - return 0 -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetMembers() []*CMsgDOTAChatMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetChannelType() DOTAChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgDOTAJoinChatChannelResponse_ChannelType -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetResult() CMsgDOTAJoinChatChannelResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAJoinChatChannelResponse_Result -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetGcInitiatedJoin() bool { - if m != nil && m.GcInitiatedJoin != nil { - return *m.GcInitiatedJoin - } - return false -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -func (m *CMsgDOTAJoinChatChannelResponse) GetWelcomeMessage() string { - if m != nil && m.WelcomeMessage != nil { - return *m.WelcomeMessage - } - return "" -} - -type CMsgDOTAChatChannelFullUpdate struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - Members []*CMsgDOTAChatMember `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatChannelFullUpdate) Reset() { *m = CMsgDOTAChatChannelFullUpdate{} } -func (m *CMsgDOTAChatChannelFullUpdate) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatChannelFullUpdate) ProtoMessage() {} -func (*CMsgDOTAChatChannelFullUpdate) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{108} } - -func (m *CMsgDOTAChatChannelFullUpdate) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAChatChannelFullUpdate) GetMembers() []*CMsgDOTAChatMember { - if m != nil { - return m.Members - } - return nil -} - -type CMsgDOTAOtherJoinedChatChannel struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - SteamId *uint64 `protobuf:"fixed64,3,opt,name=steam_id" json:"steam_id,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,4,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - Status *uint32 `protobuf:"varint,5,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAOtherJoinedChatChannel) Reset() { *m = CMsgDOTAOtherJoinedChatChannel{} } -func (m *CMsgDOTAOtherJoinedChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAOtherJoinedChatChannel) ProtoMessage() {} -func (*CMsgDOTAOtherJoinedChatChannel) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{109} -} - -func (m *CMsgDOTAOtherJoinedChatChannel) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAOtherJoinedChatChannel) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgDOTAOtherJoinedChatChannel) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAOtherJoinedChatChannel) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -func (m *CMsgDOTAOtherJoinedChatChannel) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgDOTAOtherLeftChatChannel struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,3,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAOtherLeftChatChannel) Reset() { *m = CMsgDOTAOtherLeftChatChannel{} } -func (m *CMsgDOTAOtherLeftChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAOtherLeftChatChannel) ProtoMessage() {} -func (*CMsgDOTAOtherLeftChatChannel) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{110} } - -func (m *CMsgDOTAOtherLeftChatChannel) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAOtherLeftChatChannel) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAOtherLeftChatChannel) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -type CMsgDOTAChatChannelMemberUpdate struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - LeftSteamIds []uint64 `protobuf:"fixed64,2,rep,name=left_steam_ids" json:"left_steam_ids,omitempty"` - JoinedMembers []*CMsgDOTAChatChannelMemberUpdate_JoinedMember `protobuf:"bytes,3,rep,name=joined_members" json:"joined_members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatChannelMemberUpdate) Reset() { *m = CMsgDOTAChatChannelMemberUpdate{} } -func (m *CMsgDOTAChatChannelMemberUpdate) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatChannelMemberUpdate) ProtoMessage() {} -func (*CMsgDOTAChatChannelMemberUpdate) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{111} -} - -func (m *CMsgDOTAChatChannelMemberUpdate) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAChatChannelMemberUpdate) GetLeftSteamIds() []uint64 { - if m != nil { - return m.LeftSteamIds - } - return nil -} - -func (m *CMsgDOTAChatChannelMemberUpdate) GetJoinedMembers() []*CMsgDOTAChatChannelMemberUpdate_JoinedMember { - if m != nil { - return m.JoinedMembers - } - return nil -} - -type CMsgDOTAChatChannelMemberUpdate_JoinedMember struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,3,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - Status *uint32 `protobuf:"varint,4,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatChannelMemberUpdate_JoinedMember) Reset() { - *m = CMsgDOTAChatChannelMemberUpdate_JoinedMember{} -} -func (m *CMsgDOTAChatChannelMemberUpdate_JoinedMember) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAChatChannelMemberUpdate_JoinedMember) ProtoMessage() {} -func (*CMsgDOTAChatChannelMemberUpdate_JoinedMember) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{111, 0} -} - -func (m *CMsgDOTAChatChannelMemberUpdate_JoinedMember) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAChatChannelMemberUpdate_JoinedMember) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgDOTAChatChannelMemberUpdate_JoinedMember) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -func (m *CMsgDOTAChatChannelMemberUpdate_JoinedMember) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgDOTARequestChatChannelList struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestChatChannelList) Reset() { *m = CMsgDOTARequestChatChannelList{} } -func (m *CMsgDOTARequestChatChannelList) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestChatChannelList) ProtoMessage() {} -func (*CMsgDOTARequestChatChannelList) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{112} -} - -type CMsgDOTARequestChatChannelListResponse struct { - Channels []*CMsgDOTARequestChatChannelListResponse_ChatChannel `protobuf:"bytes,1,rep,name=channels" json:"channels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestChatChannelListResponse) Reset() { - *m = CMsgDOTARequestChatChannelListResponse{} -} -func (m *CMsgDOTARequestChatChannelListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestChatChannelListResponse) ProtoMessage() {} -func (*CMsgDOTARequestChatChannelListResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{113} -} - -func (m *CMsgDOTARequestChatChannelListResponse) GetChannels() []*CMsgDOTARequestChatChannelListResponse_ChatChannel { - if m != nil { - return m.Channels - } - return nil -} - -type CMsgDOTARequestChatChannelListResponse_ChatChannel struct { - ChannelName *string `protobuf:"bytes,1,opt,name=channel_name" json:"channel_name,omitempty"` - NumMembers *uint32 `protobuf:"varint,2,opt,name=num_members" json:"num_members,omitempty"` - ChannelType *DOTAChatChannelTypeT `protobuf:"varint,3,opt,name=channel_type,enum=DOTAChatChannelTypeT,def=0" json:"channel_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestChatChannelListResponse_ChatChannel) Reset() { - *m = CMsgDOTARequestChatChannelListResponse_ChatChannel{} -} -func (m *CMsgDOTARequestChatChannelListResponse_ChatChannel) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARequestChatChannelListResponse_ChatChannel) ProtoMessage() {} -func (*CMsgDOTARequestChatChannelListResponse_ChatChannel) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{113, 0} -} - -const Default_CMsgDOTARequestChatChannelListResponse_ChatChannel_ChannelType DOTAChatChannelTypeT = DOTAChatChannelTypeT_DOTAChannelType_Regional - -func (m *CMsgDOTARequestChatChannelListResponse_ChatChannel) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgDOTARequestChatChannelListResponse_ChatChannel) GetNumMembers() uint32 { - if m != nil && m.NumMembers != nil { - return *m.NumMembers - } - return 0 -} - -func (m *CMsgDOTARequestChatChannelListResponse_ChatChannel) GetChannelType() DOTAChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgDOTARequestChatChannelListResponse_ChatChannel_ChannelType -} - -type CMsgDOTAChatGetUserList struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatGetUserList) Reset() { *m = CMsgDOTAChatGetUserList{} } -func (m *CMsgDOTAChatGetUserList) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatGetUserList) ProtoMessage() {} -func (*CMsgDOTAChatGetUserList) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{114} } - -func (m *CMsgDOTAChatGetUserList) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -type CMsgDOTAChatGetUserListResponse struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - Members []*CMsgDOTAChatGetUserListResponse_Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatGetUserListResponse) Reset() { *m = CMsgDOTAChatGetUserListResponse{} } -func (m *CMsgDOTAChatGetUserListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatGetUserListResponse) ProtoMessage() {} -func (*CMsgDOTAChatGetUserListResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{115} -} - -func (m *CMsgDOTAChatGetUserListResponse) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgDOTAChatGetUserListResponse) GetMembers() []*CMsgDOTAChatGetUserListResponse_Member { - if m != nil { - return m.Members - } - return nil -} - -type CMsgDOTAChatGetUserListResponse_Member struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - ChannelUserId *uint32 `protobuf:"varint,3,opt,name=channel_user_id" json:"channel_user_id,omitempty"` - Status *uint32 `protobuf:"varint,4,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatGetUserListResponse_Member) Reset() { - *m = CMsgDOTAChatGetUserListResponse_Member{} -} -func (m *CMsgDOTAChatGetUserListResponse_Member) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatGetUserListResponse_Member) ProtoMessage() {} -func (*CMsgDOTAChatGetUserListResponse_Member) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{115, 0} -} - -func (m *CMsgDOTAChatGetUserListResponse_Member) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAChatGetUserListResponse_Member) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgDOTAChatGetUserListResponse_Member) GetChannelUserId() uint32 { - if m != nil && m.ChannelUserId != nil { - return *m.ChannelUserId - } - return 0 -} - -func (m *CMsgDOTAChatGetUserListResponse_Member) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgDOTAChatGetMemberCount struct { - ChannelName *string `protobuf:"bytes,1,opt,name=channel_name" json:"channel_name,omitempty"` - ChannelType *DOTAChatChannelTypeT `protobuf:"varint,2,opt,name=channel_type,enum=DOTAChatChannelTypeT,def=0" json:"channel_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatGetMemberCount) Reset() { *m = CMsgDOTAChatGetMemberCount{} } -func (m *CMsgDOTAChatGetMemberCount) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatGetMemberCount) ProtoMessage() {} -func (*CMsgDOTAChatGetMemberCount) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{116} } - -const Default_CMsgDOTAChatGetMemberCount_ChannelType DOTAChatChannelTypeT = DOTAChatChannelTypeT_DOTAChannelType_Regional - -func (m *CMsgDOTAChatGetMemberCount) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgDOTAChatGetMemberCount) GetChannelType() DOTAChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgDOTAChatGetMemberCount_ChannelType -} - -type CMsgDOTAChatGetMemberCountResponse struct { - ChannelName *string `protobuf:"bytes,1,opt,name=channel_name" json:"channel_name,omitempty"` - ChannelType *DOTAChatChannelTypeT `protobuf:"varint,2,opt,name=channel_type,enum=DOTAChatChannelTypeT,def=0" json:"channel_type,omitempty"` - MemberCount *uint32 `protobuf:"varint,3,opt,name=member_count" json:"member_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatGetMemberCountResponse) Reset() { *m = CMsgDOTAChatGetMemberCountResponse{} } -func (m *CMsgDOTAChatGetMemberCountResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatGetMemberCountResponse) ProtoMessage() {} -func (*CMsgDOTAChatGetMemberCountResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{117} -} - -const Default_CMsgDOTAChatGetMemberCountResponse_ChannelType DOTAChatChannelTypeT = DOTAChatChannelTypeT_DOTAChannelType_Regional - -func (m *CMsgDOTAChatGetMemberCountResponse) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgDOTAChatGetMemberCountResponse) GetChannelType() DOTAChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgDOTAChatGetMemberCountResponse_ChannelType -} - -func (m *CMsgDOTAChatGetMemberCountResponse) GetMemberCount() uint32 { - if m != nil && m.MemberCount != nil { - return *m.MemberCount - } - return 0 -} - -type CMsgDOTAChatRegionsEnabled struct { - EnableAllRegions *bool `protobuf:"varint,1,opt,name=enable_all_regions" json:"enable_all_regions,omitempty"` - EnabledRegions []*CMsgDOTAChatRegionsEnabled_Region `protobuf:"bytes,2,rep,name=enabled_regions" json:"enabled_regions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatRegionsEnabled) Reset() { *m = CMsgDOTAChatRegionsEnabled{} } -func (m *CMsgDOTAChatRegionsEnabled) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatRegionsEnabled) ProtoMessage() {} -func (*CMsgDOTAChatRegionsEnabled) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{118} } - -func (m *CMsgDOTAChatRegionsEnabled) GetEnableAllRegions() bool { - if m != nil && m.EnableAllRegions != nil { - return *m.EnableAllRegions - } - return false -} - -func (m *CMsgDOTAChatRegionsEnabled) GetEnabledRegions() []*CMsgDOTAChatRegionsEnabled_Region { - if m != nil { - return m.EnabledRegions - } - return nil -} - -type CMsgDOTAChatRegionsEnabled_Region struct { - MinLatitude *float32 `protobuf:"fixed32,1,opt,name=min_latitude" json:"min_latitude,omitempty"` - MaxLatitude *float32 `protobuf:"fixed32,2,opt,name=max_latitude" json:"max_latitude,omitempty"` - MinLongitude *float32 `protobuf:"fixed32,3,opt,name=min_longitude" json:"min_longitude,omitempty"` - MaxLongitude *float32 `protobuf:"fixed32,4,opt,name=max_longitude" json:"max_longitude,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAChatRegionsEnabled_Region) Reset() { *m = CMsgDOTAChatRegionsEnabled_Region{} } -func (m *CMsgDOTAChatRegionsEnabled_Region) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAChatRegionsEnabled_Region) ProtoMessage() {} -func (*CMsgDOTAChatRegionsEnabled_Region) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{118, 0} -} - -func (m *CMsgDOTAChatRegionsEnabled_Region) GetMinLatitude() float32 { - if m != nil && m.MinLatitude != nil { - return *m.MinLatitude - } - return 0 -} - -func (m *CMsgDOTAChatRegionsEnabled_Region) GetMaxLatitude() float32 { - if m != nil && m.MaxLatitude != nil { - return *m.MaxLatitude - } - return 0 -} - -func (m *CMsgDOTAChatRegionsEnabled_Region) GetMinLongitude() float32 { - if m != nil && m.MinLongitude != nil { - return *m.MinLongitude - } - return 0 -} - -func (m *CMsgDOTAChatRegionsEnabled_Region) GetMaxLongitude() float32 { - if m != nil && m.MaxLongitude != nil { - return *m.MaxLongitude - } - return 0 -} - -type CMsgDOTAGuildSDO struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Tag *string `protobuf:"bytes,3,opt,name=tag" json:"tag,omitempty"` - TimeCreated *uint32 `protobuf:"varint,4,opt,name=time_created" json:"time_created,omitempty"` - TimeDisbanded *uint32 `protobuf:"varint,5,opt,name=time_disbanded" json:"time_disbanded,omitempty"` - Logo *uint64 `protobuf:"varint,6,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,7,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,8,opt,name=banner_logo" json:"banner_logo,omitempty"` - Members []*CMsgDOTAGuildSDO_Member `protobuf:"bytes,9,rep,name=members" json:"members,omitempty"` - Invitations []*CMsgDOTAGuildSDO_Invitation `protobuf:"bytes,10,rep,name=invitations" json:"invitations,omitempty"` - Message *string `protobuf:"bytes,11,opt,name=message" json:"message,omitempty"` - Incremental *bool `protobuf:"varint,12,opt,name=incremental" json:"incremental,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildSDO) Reset() { *m = CMsgDOTAGuildSDO{} } -func (m *CMsgDOTAGuildSDO) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildSDO) ProtoMessage() {} -func (*CMsgDOTAGuildSDO) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{119} } - -func (m *CMsgDOTAGuildSDO) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildSDO) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTAGuildSDO) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *CMsgDOTAGuildSDO) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -func (m *CMsgDOTAGuildSDO) GetTimeDisbanded() uint32 { - if m != nil && m.TimeDisbanded != nil { - return *m.TimeDisbanded - } - return 0 -} - -func (m *CMsgDOTAGuildSDO) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAGuildSDO) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTAGuildSDO) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -func (m *CMsgDOTAGuildSDO) GetMembers() []*CMsgDOTAGuildSDO_Member { - if m != nil { - return m.Members - } - return nil -} - -func (m *CMsgDOTAGuildSDO) GetInvitations() []*CMsgDOTAGuildSDO_Invitation { - if m != nil { - return m.Invitations - } - return nil -} - -func (m *CMsgDOTAGuildSDO) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgDOTAGuildSDO) GetIncremental() bool { - if m != nil && m.Incremental != nil { - return *m.Incremental - } - return false -} - -type CMsgDOTAGuildSDO_Member struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TimeJoined *uint32 `protobuf:"varint,2,opt,name=time_joined" json:"time_joined,omitempty"` - Role *uint32 `protobuf:"varint,3,opt,name=role" json:"role,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildSDO_Member) Reset() { *m = CMsgDOTAGuildSDO_Member{} } -func (m *CMsgDOTAGuildSDO_Member) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildSDO_Member) ProtoMessage() {} -func (*CMsgDOTAGuildSDO_Member) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{119, 0} } - -func (m *CMsgDOTAGuildSDO_Member) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAGuildSDO_Member) GetTimeJoined() uint32 { - if m != nil && m.TimeJoined != nil { - return *m.TimeJoined - } - return 0 -} - -func (m *CMsgDOTAGuildSDO_Member) GetRole() uint32 { - if m != nil && m.Role != nil { - return *m.Role - } - return 0 -} - -type CMsgDOTAGuildSDO_Invitation struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - TimeSent *uint32 `protobuf:"varint,2,opt,name=time_sent" json:"time_sent,omitempty"` - AccountIdSender *uint32 `protobuf:"varint,3,opt,name=account_id_sender" json:"account_id_sender,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildSDO_Invitation) Reset() { *m = CMsgDOTAGuildSDO_Invitation{} } -func (m *CMsgDOTAGuildSDO_Invitation) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildSDO_Invitation) ProtoMessage() {} -func (*CMsgDOTAGuildSDO_Invitation) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{119, 1} -} - -func (m *CMsgDOTAGuildSDO_Invitation) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAGuildSDO_Invitation) GetTimeSent() uint32 { - if m != nil && m.TimeSent != nil { - return *m.TimeSent - } - return 0 -} - -func (m *CMsgDOTAGuildSDO_Invitation) GetAccountIdSender() uint32 { - if m != nil && m.AccountIdSender != nil { - return *m.AccountIdSender - } - return 0 -} - -type CMsgDOTAGuildAuditSDO struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Entries []*CMsgDOTAGuildAuditSDO_Entry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildAuditSDO) Reset() { *m = CMsgDOTAGuildAuditSDO{} } -func (m *CMsgDOTAGuildAuditSDO) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildAuditSDO) ProtoMessage() {} -func (*CMsgDOTAGuildAuditSDO) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{120} } - -func (m *CMsgDOTAGuildAuditSDO) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO) GetEntries() []*CMsgDOTAGuildAuditSDO_Entry { - if m != nil { - return m.Entries - } - return nil -} - -type CMsgDOTAGuildAuditSDO_Entry struct { - EventIndex *uint32 `protobuf:"varint,1,opt,name=event_index" json:"event_index,omitempty"` - Timestamp *uint32 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - Action *uint32 `protobuf:"varint,3,opt,name=action" json:"action,omitempty"` - AccountIdRequestor *uint32 `protobuf:"varint,4,opt,name=account_id_requestor" json:"account_id_requestor,omitempty"` - AccountIdTarget *uint32 `protobuf:"varint,5,opt,name=account_id_target" json:"account_id_target,omitempty"` - ReferenceDataA *uint32 `protobuf:"varint,6,opt,name=reference_data_a" json:"reference_data_a,omitempty"` - ReferenceDataB *uint32 `protobuf:"varint,7,opt,name=reference_data_b" json:"reference_data_b,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) Reset() { *m = CMsgDOTAGuildAuditSDO_Entry{} } -func (m *CMsgDOTAGuildAuditSDO_Entry) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildAuditSDO_Entry) ProtoMessage() {} -func (*CMsgDOTAGuildAuditSDO_Entry) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{120, 0} -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetEventIndex() uint32 { - if m != nil && m.EventIndex != nil { - return *m.EventIndex - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetAction() uint32 { - if m != nil && m.Action != nil { - return *m.Action - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetAccountIdRequestor() uint32 { - if m != nil && m.AccountIdRequestor != nil { - return *m.AccountIdRequestor - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetAccountIdTarget() uint32 { - if m != nil && m.AccountIdTarget != nil { - return *m.AccountIdTarget - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetReferenceDataA() uint32 { - if m != nil && m.ReferenceDataA != nil { - return *m.ReferenceDataA - } - return 0 -} - -func (m *CMsgDOTAGuildAuditSDO_Entry) GetReferenceDataB() uint32 { - if m != nil && m.ReferenceDataB != nil { - return *m.ReferenceDataB - } - return 0 -} - -type CMsgDOTAAccountGuildMembershipsSDO struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Memberships []*CMsgDOTAAccountGuildMembershipsSDO_Membership `protobuf:"bytes,2,rep,name=memberships" json:"memberships,omitempty"` - Invitations []*CMsgDOTAAccountGuildMembershipsSDO_Invitation `protobuf:"bytes,3,rep,name=invitations" json:"invitations,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO) Reset() { *m = CMsgDOTAAccountGuildMembershipsSDO{} } -func (m *CMsgDOTAAccountGuildMembershipsSDO) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAAccountGuildMembershipsSDO) ProtoMessage() {} -func (*CMsgDOTAAccountGuildMembershipsSDO) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{121} -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO) GetMemberships() []*CMsgDOTAAccountGuildMembershipsSDO_Membership { - if m != nil { - return m.Memberships - } - return nil -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO) GetInvitations() []*CMsgDOTAAccountGuildMembershipsSDO_Invitation { - if m != nil { - return m.Invitations - } - return nil -} - -type CMsgDOTAAccountGuildMembershipsSDO_Membership struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Role *uint32 `protobuf:"varint,2,opt,name=role" json:"role,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Membership) Reset() { - *m = CMsgDOTAAccountGuildMembershipsSDO_Membership{} -} -func (m *CMsgDOTAAccountGuildMembershipsSDO_Membership) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAAccountGuildMembershipsSDO_Membership) ProtoMessage() {} -func (*CMsgDOTAAccountGuildMembershipsSDO_Membership) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{121, 0} -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Membership) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Membership) GetRole() uint32 { - if m != nil && m.Role != nil { - return *m.Role - } - return 0 -} - -type CMsgDOTAAccountGuildMembershipsSDO_Invitation struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - TimeSent *uint32 `protobuf:"varint,2,opt,name=time_sent" json:"time_sent,omitempty"` - AccountIdSender *uint32 `protobuf:"varint,3,opt,name=account_id_sender" json:"account_id_sender,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Invitation) Reset() { - *m = CMsgDOTAAccountGuildMembershipsSDO_Invitation{} -} -func (m *CMsgDOTAAccountGuildMembershipsSDO_Invitation) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAAccountGuildMembershipsSDO_Invitation) ProtoMessage() {} -func (*CMsgDOTAAccountGuildMembershipsSDO_Invitation) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{121, 1} -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Invitation) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Invitation) GetTimeSent() uint32 { - if m != nil && m.TimeSent != nil { - return *m.TimeSent - } - return 0 -} - -func (m *CMsgDOTAAccountGuildMembershipsSDO_Invitation) GetAccountIdSender() uint32 { - if m != nil && m.AccountIdSender != nil { - return *m.AccountIdSender - } - return 0 -} - -type CMsgDOTAGuildCreateRequest struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Tag *string `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` - Logo *uint64 `protobuf:"varint,3,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,4,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,5,opt,name=banner_logo" json:"banner_logo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildCreateRequest) Reset() { *m = CMsgDOTAGuildCreateRequest{} } -func (m *CMsgDOTAGuildCreateRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildCreateRequest) ProtoMessage() {} -func (*CMsgDOTAGuildCreateRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{122} } - -func (m *CMsgDOTAGuildCreateRequest) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTAGuildCreateRequest) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *CMsgDOTAGuildCreateRequest) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAGuildCreateRequest) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTAGuildCreateRequest) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -type CMsgDOTAGuildCreateResponse struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Errors []CMsgDOTAGuildCreateResponse_EError `protobuf:"varint,2,rep,name=errors,enum=CMsgDOTAGuildCreateResponse_EError" json:"errors,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildCreateResponse) Reset() { *m = CMsgDOTAGuildCreateResponse{} } -func (m *CMsgDOTAGuildCreateResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildCreateResponse) ProtoMessage() {} -func (*CMsgDOTAGuildCreateResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{123} } - -func (m *CMsgDOTAGuildCreateResponse) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildCreateResponse) GetErrors() []CMsgDOTAGuildCreateResponse_EError { - if m != nil { - return m.Errors - } - return nil -} - -type CMsgDOTAGuildSetAccountRoleRequest struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - TargetAccountId *uint32 `protobuf:"varint,2,opt,name=target_account_id" json:"target_account_id,omitempty"` - TargetRole *uint32 `protobuf:"varint,3,opt,name=target_role" json:"target_role,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildSetAccountRoleRequest) Reset() { *m = CMsgDOTAGuildSetAccountRoleRequest{} } -func (m *CMsgDOTAGuildSetAccountRoleRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildSetAccountRoleRequest) ProtoMessage() {} -func (*CMsgDOTAGuildSetAccountRoleRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{124} -} - -func (m *CMsgDOTAGuildSetAccountRoleRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildSetAccountRoleRequest) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -func (m *CMsgDOTAGuildSetAccountRoleRequest) GetTargetRole() uint32 { - if m != nil && m.TargetRole != nil { - return *m.TargetRole - } - return 0 -} - -type CMsgDOTAGuildSetAccountRoleResponse struct { - Result *CMsgDOTAGuildSetAccountRoleResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAGuildSetAccountRoleResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildSetAccountRoleResponse) Reset() { *m = CMsgDOTAGuildSetAccountRoleResponse{} } -func (m *CMsgDOTAGuildSetAccountRoleResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildSetAccountRoleResponse) ProtoMessage() {} -func (*CMsgDOTAGuildSetAccountRoleResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{125} -} - -const Default_CMsgDOTAGuildSetAccountRoleResponse_Result CMsgDOTAGuildSetAccountRoleResponse_EResult = CMsgDOTAGuildSetAccountRoleResponse_SUCCESS - -func (m *CMsgDOTAGuildSetAccountRoleResponse) GetResult() CMsgDOTAGuildSetAccountRoleResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAGuildSetAccountRoleResponse_Result -} - -type CMsgDOTAGuildInviteAccountRequest struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - TargetAccountId *uint32 `protobuf:"varint,2,opt,name=target_account_id" json:"target_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildInviteAccountRequest) Reset() { *m = CMsgDOTAGuildInviteAccountRequest{} } -func (m *CMsgDOTAGuildInviteAccountRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildInviteAccountRequest) ProtoMessage() {} -func (*CMsgDOTAGuildInviteAccountRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{126} -} - -func (m *CMsgDOTAGuildInviteAccountRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildInviteAccountRequest) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -type CMsgDOTAGuildInviteAccountResponse struct { - Result *CMsgDOTAGuildInviteAccountResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAGuildInviteAccountResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildInviteAccountResponse) Reset() { *m = CMsgDOTAGuildInviteAccountResponse{} } -func (m *CMsgDOTAGuildInviteAccountResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildInviteAccountResponse) ProtoMessage() {} -func (*CMsgDOTAGuildInviteAccountResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{127} -} - -const Default_CMsgDOTAGuildInviteAccountResponse_Result CMsgDOTAGuildInviteAccountResponse_EResult = CMsgDOTAGuildInviteAccountResponse_SUCCESS - -func (m *CMsgDOTAGuildInviteAccountResponse) GetResult() CMsgDOTAGuildInviteAccountResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAGuildInviteAccountResponse_Result -} - -type CMsgDOTAGuildCancelInviteRequest struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - TargetAccountId *uint32 `protobuf:"varint,2,opt,name=target_account_id" json:"target_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildCancelInviteRequest) Reset() { *m = CMsgDOTAGuildCancelInviteRequest{} } -func (m *CMsgDOTAGuildCancelInviteRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildCancelInviteRequest) ProtoMessage() {} -func (*CMsgDOTAGuildCancelInviteRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{128} -} - -func (m *CMsgDOTAGuildCancelInviteRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildCancelInviteRequest) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -type CMsgDOTAGuildCancelInviteResponse struct { - Result *CMsgDOTAGuildCancelInviteResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAGuildCancelInviteResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildCancelInviteResponse) Reset() { *m = CMsgDOTAGuildCancelInviteResponse{} } -func (m *CMsgDOTAGuildCancelInviteResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildCancelInviteResponse) ProtoMessage() {} -func (*CMsgDOTAGuildCancelInviteResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{129} -} - -const Default_CMsgDOTAGuildCancelInviteResponse_Result CMsgDOTAGuildCancelInviteResponse_EResult = CMsgDOTAGuildCancelInviteResponse_SUCCESS - -func (m *CMsgDOTAGuildCancelInviteResponse) GetResult() CMsgDOTAGuildCancelInviteResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAGuildCancelInviteResponse_Result -} - -type CMsgDOTAGuildUpdateDetailsRequest struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Logo *uint64 `protobuf:"varint,2,opt,name=logo" json:"logo,omitempty"` - BaseLogo *uint64 `protobuf:"varint,3,opt,name=base_logo" json:"base_logo,omitempty"` - BannerLogo *uint64 `protobuf:"varint,4,opt,name=banner_logo" json:"banner_logo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildUpdateDetailsRequest) Reset() { *m = CMsgDOTAGuildUpdateDetailsRequest{} } -func (m *CMsgDOTAGuildUpdateDetailsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildUpdateDetailsRequest) ProtoMessage() {} -func (*CMsgDOTAGuildUpdateDetailsRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{130} -} - -func (m *CMsgDOTAGuildUpdateDetailsRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildUpdateDetailsRequest) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAGuildUpdateDetailsRequest) GetBaseLogo() uint64 { - if m != nil && m.BaseLogo != nil { - return *m.BaseLogo - } - return 0 -} - -func (m *CMsgDOTAGuildUpdateDetailsRequest) GetBannerLogo() uint64 { - if m != nil && m.BannerLogo != nil { - return *m.BannerLogo - } - return 0 -} - -type CMsgDOTAGuildUpdateDetailsResponse struct { - Result *CMsgDOTAGuildUpdateDetailsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAGuildUpdateDetailsResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildUpdateDetailsResponse) Reset() { *m = CMsgDOTAGuildUpdateDetailsResponse{} } -func (m *CMsgDOTAGuildUpdateDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildUpdateDetailsResponse) ProtoMessage() {} -func (*CMsgDOTAGuildUpdateDetailsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{131} -} - -const Default_CMsgDOTAGuildUpdateDetailsResponse_Result CMsgDOTAGuildUpdateDetailsResponse_EResult = CMsgDOTAGuildUpdateDetailsResponse_SUCCESS - -func (m *CMsgDOTAGuildUpdateDetailsResponse) GetResult() CMsgDOTAGuildUpdateDetailsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAGuildUpdateDetailsResponse_Result -} - -type CMsgDOTAGCToGCUpdateOpenGuildPartyRequest struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - GuildId *uint32 `protobuf:"varint,2,opt,name=guild_id" json:"guild_id,omitempty"` - MemberAccountIds []uint32 `protobuf:"varint,3,rep,name=member_account_ids" json:"member_account_ids,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) Reset() { - *m = CMsgDOTAGCToGCUpdateOpenGuildPartyRequest{} -} -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) ProtoMessage() {} -func (*CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{132} -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) GetMemberAccountIds() []uint32 { - if m != nil { - return m.MemberAccountIds - } - return nil -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyRequest) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -type CMsgDOTAGCToGCUpdateOpenGuildPartyResponse struct { - MaintainAssociation *bool `protobuf:"varint,1,opt,name=maintain_association" json:"maintain_association,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyResponse) Reset() { - *m = CMsgDOTAGCToGCUpdateOpenGuildPartyResponse{} -} -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAGCToGCUpdateOpenGuildPartyResponse) ProtoMessage() {} -func (*CMsgDOTAGCToGCUpdateOpenGuildPartyResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{133} -} - -func (m *CMsgDOTAGCToGCUpdateOpenGuildPartyResponse) GetMaintainAssociation() bool { - if m != nil && m.MaintainAssociation != nil { - return *m.MaintainAssociation - } - return false -} - -type CMsgDOTAGCToGCDestroyOpenGuildPartyRequest struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - GuildId *uint32 `protobuf:"varint,2,opt,name=guild_id" json:"guild_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGCToGCDestroyOpenGuildPartyRequest) Reset() { - *m = CMsgDOTAGCToGCDestroyOpenGuildPartyRequest{} -} -func (m *CMsgDOTAGCToGCDestroyOpenGuildPartyRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAGCToGCDestroyOpenGuildPartyRequest) ProtoMessage() {} -func (*CMsgDOTAGCToGCDestroyOpenGuildPartyRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{134} -} - -func (m *CMsgDOTAGCToGCDestroyOpenGuildPartyRequest) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgDOTAGCToGCDestroyOpenGuildPartyRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -type CMsgDOTAGCToGCDestroyOpenGuildPartyResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGCToGCDestroyOpenGuildPartyResponse) Reset() { - *m = CMsgDOTAGCToGCDestroyOpenGuildPartyResponse{} -} -func (m *CMsgDOTAGCToGCDestroyOpenGuildPartyResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAGCToGCDestroyOpenGuildPartyResponse) ProtoMessage() {} -func (*CMsgDOTAGCToGCDestroyOpenGuildPartyResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{135} -} - -type CMsgDOTAPartySetOpenGuildRequest struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Description *string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPartySetOpenGuildRequest) Reset() { *m = CMsgDOTAPartySetOpenGuildRequest{} } -func (m *CMsgDOTAPartySetOpenGuildRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPartySetOpenGuildRequest) ProtoMessage() {} -func (*CMsgDOTAPartySetOpenGuildRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{136} -} - -func (m *CMsgDOTAPartySetOpenGuildRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAPartySetOpenGuildRequest) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -type CMsgDOTAPartySetOpenGuildResponse struct { - Result *CMsgDOTAPartySetOpenGuildResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAPartySetOpenGuildResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPartySetOpenGuildResponse) Reset() { *m = CMsgDOTAPartySetOpenGuildResponse{} } -func (m *CMsgDOTAPartySetOpenGuildResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPartySetOpenGuildResponse) ProtoMessage() {} -func (*CMsgDOTAPartySetOpenGuildResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{137} -} - -const Default_CMsgDOTAPartySetOpenGuildResponse_Result CMsgDOTAPartySetOpenGuildResponse_EResult = CMsgDOTAPartySetOpenGuildResponse_SUCCESS - -func (m *CMsgDOTAPartySetOpenGuildResponse) GetResult() CMsgDOTAPartySetOpenGuildResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAPartySetOpenGuildResponse_Result -} - -type CMsgDOTAJoinOpenGuildPartyRequest struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAJoinOpenGuildPartyRequest) Reset() { *m = CMsgDOTAJoinOpenGuildPartyRequest{} } -func (m *CMsgDOTAJoinOpenGuildPartyRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAJoinOpenGuildPartyRequest) ProtoMessage() {} -func (*CMsgDOTAJoinOpenGuildPartyRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{138} -} - -func (m *CMsgDOTAJoinOpenGuildPartyRequest) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -type CMsgDOTAJoinOpenGuildPartyResponse struct { - Result *CMsgDOTAJoinOpenGuildPartyResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAJoinOpenGuildPartyResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAJoinOpenGuildPartyResponse) Reset() { *m = CMsgDOTAJoinOpenGuildPartyResponse{} } -func (m *CMsgDOTAJoinOpenGuildPartyResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAJoinOpenGuildPartyResponse) ProtoMessage() {} -func (*CMsgDOTAJoinOpenGuildPartyResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{139} -} - -const Default_CMsgDOTAJoinOpenGuildPartyResponse_Result CMsgDOTAJoinOpenGuildPartyResponse_EResult = CMsgDOTAJoinOpenGuildPartyResponse_SUCCESS - -func (m *CMsgDOTAJoinOpenGuildPartyResponse) GetResult() CMsgDOTAJoinOpenGuildPartyResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAJoinOpenGuildPartyResponse_Result -} - -type CMsgDOTAGuildOpenPartyRefresh struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - OpenParties []*CMsgDOTAGuildOpenPartyRefresh_OpenParty `protobuf:"bytes,2,rep,name=open_parties" json:"open_parties,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildOpenPartyRefresh) Reset() { *m = CMsgDOTAGuildOpenPartyRefresh{} } -func (m *CMsgDOTAGuildOpenPartyRefresh) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildOpenPartyRefresh) ProtoMessage() {} -func (*CMsgDOTAGuildOpenPartyRefresh) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{140} } - -func (m *CMsgDOTAGuildOpenPartyRefresh) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildOpenPartyRefresh) GetOpenParties() []*CMsgDOTAGuildOpenPartyRefresh_OpenParty { - if m != nil { - return m.OpenParties - } - return nil -} - -type CMsgDOTAGuildOpenPartyRefresh_OpenParty struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - MemberAccountIds []uint32 `protobuf:"varint,2,rep,name=member_account_ids" json:"member_account_ids,omitempty"` - TimeCreated *uint32 `protobuf:"varint,3,opt,name=time_created" json:"time_created,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildOpenPartyRefresh_OpenParty) Reset() { - *m = CMsgDOTAGuildOpenPartyRefresh_OpenParty{} -} -func (m *CMsgDOTAGuildOpenPartyRefresh_OpenParty) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildOpenPartyRefresh_OpenParty) ProtoMessage() {} -func (*CMsgDOTAGuildOpenPartyRefresh_OpenParty) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{140, 0} -} - -func (m *CMsgDOTAGuildOpenPartyRefresh_OpenParty) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgDOTAGuildOpenPartyRefresh_OpenParty) GetMemberAccountIds() []uint32 { - if m != nil { - return m.MemberAccountIds - } - return nil -} - -func (m *CMsgDOTAGuildOpenPartyRefresh_OpenParty) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -func (m *CMsgDOTAGuildOpenPartyRefresh_OpenParty) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -type CMsgDOTARequestGuildData struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestGuildData) Reset() { *m = CMsgDOTARequestGuildData{} } -func (m *CMsgDOTARequestGuildData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestGuildData) ProtoMessage() {} -func (*CMsgDOTARequestGuildData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{141} } - -type CMsgDOTAGuildInviteData struct { - InvitedToGuild *bool `protobuf:"varint,1,opt,name=invited_to_guild" json:"invited_to_guild,omitempty"` - GuildId *uint32 `protobuf:"varint,2,opt,name=guild_id" json:"guild_id,omitempty"` - GuildName *string `protobuf:"bytes,3,opt,name=guild_name" json:"guild_name,omitempty"` - GuildTag *string `protobuf:"bytes,4,opt,name=guild_tag" json:"guild_tag,omitempty"` - Logo *uint64 `protobuf:"varint,5,opt,name=logo" json:"logo,omitempty"` - Inviter *uint32 `protobuf:"varint,6,opt,name=inviter" json:"inviter,omitempty"` - InviterName *string `protobuf:"bytes,7,opt,name=inviter_name" json:"inviter_name,omitempty"` - MemberCount *uint32 `protobuf:"varint,8,opt,name=member_count" json:"member_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildInviteData) Reset() { *m = CMsgDOTAGuildInviteData{} } -func (m *CMsgDOTAGuildInviteData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildInviteData) ProtoMessage() {} -func (*CMsgDOTAGuildInviteData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{142} } - -func (m *CMsgDOTAGuildInviteData) GetInvitedToGuild() bool { - if m != nil && m.InvitedToGuild != nil { - return *m.InvitedToGuild - } - return false -} - -func (m *CMsgDOTAGuildInviteData) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildInviteData) GetGuildName() string { - if m != nil && m.GuildName != nil { - return *m.GuildName - } - return "" -} - -func (m *CMsgDOTAGuildInviteData) GetGuildTag() string { - if m != nil && m.GuildTag != nil { - return *m.GuildTag - } - return "" -} - -func (m *CMsgDOTAGuildInviteData) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAGuildInviteData) GetInviter() uint32 { - if m != nil && m.Inviter != nil { - return *m.Inviter - } - return 0 -} - -func (m *CMsgDOTAGuildInviteData) GetInviterName() string { - if m != nil && m.InviterName != nil { - return *m.InviterName - } - return "" -} - -func (m *CMsgDOTAGuildInviteData) GetMemberCount() uint32 { - if m != nil && m.MemberCount != nil { - return *m.MemberCount - } - return 0 -} - -type CMsgDOTAGuildUpdateMessage struct { - Message *string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - GuildId *uint32 `protobuf:"varint,2,opt,name=guild_id" json:"guild_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildUpdateMessage) Reset() { *m = CMsgDOTAGuildUpdateMessage{} } -func (m *CMsgDOTAGuildUpdateMessage) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildUpdateMessage) ProtoMessage() {} -func (*CMsgDOTAGuildUpdateMessage) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{143} } - -func (m *CMsgDOTAGuildUpdateMessage) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgDOTAGuildUpdateMessage) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -type CMsgDOTAGuildEditLogoRequest struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Logo *uint64 `protobuf:"varint,2,opt,name=logo" json:"logo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildEditLogoRequest) Reset() { *m = CMsgDOTAGuildEditLogoRequest{} } -func (m *CMsgDOTAGuildEditLogoRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildEditLogoRequest) ProtoMessage() {} -func (*CMsgDOTAGuildEditLogoRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{144} } - -func (m *CMsgDOTAGuildEditLogoRequest) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildEditLogoRequest) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -type CMsgDOTAGuildEditLogoResponse struct { - GuildId *uint32 `protobuf:"varint,1,opt,name=guild_id" json:"guild_id,omitempty"` - Result *CMsgDOTAGuildEditLogoResponse_EResult `protobuf:"varint,2,opt,name=result,enum=CMsgDOTAGuildEditLogoResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGuildEditLogoResponse) Reset() { *m = CMsgDOTAGuildEditLogoResponse{} } -func (m *CMsgDOTAGuildEditLogoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGuildEditLogoResponse) ProtoMessage() {} -func (*CMsgDOTAGuildEditLogoResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{145} } - -const Default_CMsgDOTAGuildEditLogoResponse_Result CMsgDOTAGuildEditLogoResponse_EResult = CMsgDOTAGuildEditLogoResponse_SUCCESS - -func (m *CMsgDOTAGuildEditLogoResponse) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CMsgDOTAGuildEditLogoResponse) GetResult() CMsgDOTAGuildEditLogoResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAGuildEditLogoResponse_Result -} - -type CMsgDOTAReportsRemainingRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAReportsRemainingRequest) Reset() { *m = CMsgDOTAReportsRemainingRequest{} } -func (m *CMsgDOTAReportsRemainingRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAReportsRemainingRequest) ProtoMessage() {} -func (*CMsgDOTAReportsRemainingRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{146} -} - -type CMsgDOTAReportsRemainingResponse struct { - NumPositiveReportsRemaining *uint32 `protobuf:"varint,1,opt,name=num_positive_reports_remaining" json:"num_positive_reports_remaining,omitempty"` - NumNegativeReportsRemaining *uint32 `protobuf:"varint,2,opt,name=num_negative_reports_remaining" json:"num_negative_reports_remaining,omitempty"` - NumPositiveReportsTotal *uint32 `protobuf:"varint,3,opt,name=num_positive_reports_total" json:"num_positive_reports_total,omitempty"` - NumNegativeReportsTotal *uint32 `protobuf:"varint,4,opt,name=num_negative_reports_total" json:"num_negative_reports_total,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAReportsRemainingResponse) Reset() { *m = CMsgDOTAReportsRemainingResponse{} } -func (m *CMsgDOTAReportsRemainingResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAReportsRemainingResponse) ProtoMessage() {} -func (*CMsgDOTAReportsRemainingResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{147} -} - -func (m *CMsgDOTAReportsRemainingResponse) GetNumPositiveReportsRemaining() uint32 { - if m != nil && m.NumPositiveReportsRemaining != nil { - return *m.NumPositiveReportsRemaining - } - return 0 -} - -func (m *CMsgDOTAReportsRemainingResponse) GetNumNegativeReportsRemaining() uint32 { - if m != nil && m.NumNegativeReportsRemaining != nil { - return *m.NumNegativeReportsRemaining - } - return 0 -} - -func (m *CMsgDOTAReportsRemainingResponse) GetNumPositiveReportsTotal() uint32 { - if m != nil && m.NumPositiveReportsTotal != nil { - return *m.NumPositiveReportsTotal - } - return 0 -} - -func (m *CMsgDOTAReportsRemainingResponse) GetNumNegativeReportsTotal() uint32 { - if m != nil && m.NumNegativeReportsTotal != nil { - return *m.NumNegativeReportsTotal - } - return 0 -} - -type CMsgDOTASubmitPlayerReport struct { - TargetAccountId *uint32 `protobuf:"varint,1,opt,name=target_account_id" json:"target_account_id,omitempty"` - ReportFlags *uint32 `protobuf:"varint,2,opt,name=report_flags" json:"report_flags,omitempty"` - Comment *string `protobuf:"bytes,5,opt,name=comment" json:"comment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASubmitPlayerReport) Reset() { *m = CMsgDOTASubmitPlayerReport{} } -func (m *CMsgDOTASubmitPlayerReport) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASubmitPlayerReport) ProtoMessage() {} -func (*CMsgDOTASubmitPlayerReport) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{148} } - -func (m *CMsgDOTASubmitPlayerReport) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -func (m *CMsgDOTASubmitPlayerReport) GetReportFlags() uint32 { - if m != nil && m.ReportFlags != nil { - return *m.ReportFlags - } - return 0 -} - -func (m *CMsgDOTASubmitPlayerReport) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment - } - return "" -} - -type CMsgDOTASubmitPlayerReportResponse struct { - TargetAccountId *uint32 `protobuf:"varint,1,opt,name=target_account_id" json:"target_account_id,omitempty"` - ReportFlags *uint32 `protobuf:"varint,2,opt,name=report_flags" json:"report_flags,omitempty"` - Result *uint32 `protobuf:"varint,3,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASubmitPlayerReportResponse) Reset() { *m = CMsgDOTASubmitPlayerReportResponse{} } -func (m *CMsgDOTASubmitPlayerReportResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASubmitPlayerReportResponse) ProtoMessage() {} -func (*CMsgDOTASubmitPlayerReportResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{149} -} - -func (m *CMsgDOTASubmitPlayerReportResponse) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -func (m *CMsgDOTASubmitPlayerReportResponse) GetReportFlags() uint32 { - if m != nil && m.ReportFlags != nil { - return *m.ReportFlags - } - return 0 -} - -func (m *CMsgDOTASubmitPlayerReportResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgDOTAReportCountsRequest struct { - TargetAccountId *uint32 `protobuf:"varint,1,opt,name=target_account_id" json:"target_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAReportCountsRequest) Reset() { *m = CMsgDOTAReportCountsRequest{} } -func (m *CMsgDOTAReportCountsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAReportCountsRequest) ProtoMessage() {} -func (*CMsgDOTAReportCountsRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{150} } - -func (m *CMsgDOTAReportCountsRequest) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -type CMsgDOTAReportCountsResponse struct { - TargetAccountId *uint32 `protobuf:"varint,1,opt,name=target_account_id" json:"target_account_id,omitempty"` - LeadershipCount *uint32 `protobuf:"varint,2,opt,name=leadership_count" json:"leadership_count,omitempty"` - TeachingCount *uint32 `protobuf:"varint,3,opt,name=teaching_count" json:"teaching_count,omitempty"` - FriendlyCount *uint32 `protobuf:"varint,4,opt,name=friendly_count" json:"friendly_count,omitempty"` - ForgivingCount *uint32 `protobuf:"varint,5,opt,name=forgiving_count" json:"forgiving_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAReportCountsResponse) Reset() { *m = CMsgDOTAReportCountsResponse{} } -func (m *CMsgDOTAReportCountsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAReportCountsResponse) ProtoMessage() {} -func (*CMsgDOTAReportCountsResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{151} } - -func (m *CMsgDOTAReportCountsResponse) GetTargetAccountId() uint32 { - if m != nil && m.TargetAccountId != nil { - return *m.TargetAccountId - } - return 0 -} - -func (m *CMsgDOTAReportCountsResponse) GetLeadershipCount() uint32 { - if m != nil && m.LeadershipCount != nil { - return *m.LeadershipCount - } - return 0 -} - -func (m *CMsgDOTAReportCountsResponse) GetTeachingCount() uint32 { - if m != nil && m.TeachingCount != nil { - return *m.TeachingCount - } - return 0 -} - -func (m *CMsgDOTAReportCountsResponse) GetFriendlyCount() uint32 { - if m != nil && m.FriendlyCount != nil { - return *m.FriendlyCount - } - return 0 -} - -func (m *CMsgDOTAReportCountsResponse) GetForgivingCount() uint32 { - if m != nil && m.ForgivingCount != nil { - return *m.ForgivingCount - } - return 0 -} - -type CMsgDOTAKickedFromMatchmakingQueue struct { - MatchType *MatchType `protobuf:"varint,1,opt,name=match_type,enum=MatchType,def=0" json:"match_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAKickedFromMatchmakingQueue) Reset() { *m = CMsgDOTAKickedFromMatchmakingQueue{} } -func (m *CMsgDOTAKickedFromMatchmakingQueue) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAKickedFromMatchmakingQueue) ProtoMessage() {} -func (*CMsgDOTAKickedFromMatchmakingQueue) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{152} -} - -const Default_CMsgDOTAKickedFromMatchmakingQueue_MatchType MatchType = MatchType_MATCH_TYPE_CASUAL - -func (m *CMsgDOTAKickedFromMatchmakingQueue) GetMatchType() MatchType { - if m != nil && m.MatchType != nil { - return *m.MatchType - } - return Default_CMsgDOTAKickedFromMatchmakingQueue_MatchType -} - -type CMsgDOTARequestSaveGames struct { - ServerRegion *uint32 `protobuf:"varint,1,opt,name=server_region" json:"server_region,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestSaveGames) Reset() { *m = CMsgDOTARequestSaveGames{} } -func (m *CMsgDOTARequestSaveGames) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestSaveGames) ProtoMessage() {} -func (*CMsgDOTARequestSaveGames) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{153} } - -func (m *CMsgDOTARequestSaveGames) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -type CMsgDOTARequestSaveGamesResponse struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - SaveGames []*CDOTASaveGame `protobuf:"bytes,2,rep,name=save_games" json:"save_games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARequestSaveGamesResponse) Reset() { *m = CMsgDOTARequestSaveGamesResponse{} } -func (m *CMsgDOTARequestSaveGamesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARequestSaveGamesResponse) ProtoMessage() {} -func (*CMsgDOTARequestSaveGamesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{154} -} - -func (m *CMsgDOTARequestSaveGamesResponse) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTARequestSaveGamesResponse) GetSaveGames() []*CDOTASaveGame { - if m != nil { - return m.SaveGames - } - return nil -} - -type CMsgWatchGame struct { - ServerSteamid *uint64 `protobuf:"fixed64,1,opt,name=server_steamid" json:"server_steamid,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - WatchServerSteamid *uint64 `protobuf:"fixed64,3,opt,name=watch_server_steamid" json:"watch_server_steamid,omitempty"` - LobbyId *uint64 `protobuf:"varint,4,opt,name=lobby_id" json:"lobby_id,omitempty"` - Regions []uint32 `protobuf:"varint,5,rep,name=regions" json:"regions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgWatchGame) Reset() { *m = CMsgWatchGame{} } -func (m *CMsgWatchGame) String() string { return proto.CompactTextString(m) } -func (*CMsgWatchGame) ProtoMessage() {} -func (*CMsgWatchGame) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{155} } - -func (m *CMsgWatchGame) GetServerSteamid() uint64 { - if m != nil && m.ServerSteamid != nil { - return *m.ServerSteamid - } - return 0 -} - -func (m *CMsgWatchGame) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgWatchGame) GetWatchServerSteamid() uint64 { - if m != nil && m.WatchServerSteamid != nil { - return *m.WatchServerSteamid - } - return 0 -} - -func (m *CMsgWatchGame) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgWatchGame) GetRegions() []uint32 { - if m != nil { - return m.Regions - } - return nil -} - -type CMsgCancelWatchGame struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCancelWatchGame) Reset() { *m = CMsgCancelWatchGame{} } -func (m *CMsgCancelWatchGame) String() string { return proto.CompactTextString(m) } -func (*CMsgCancelWatchGame) ProtoMessage() {} -func (*CMsgCancelWatchGame) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{156} } - -type CMsgWatchGameResponse struct { - WatchGameResult *CMsgWatchGameResponse_WatchGameResult `protobuf:"varint,1,opt,name=watch_game_result,enum=CMsgWatchGameResponse_WatchGameResult,def=0" json:"watch_game_result,omitempty"` - SourceTvPublicAddr *uint32 `protobuf:"varint,2,opt,name=source_tv_public_addr" json:"source_tv_public_addr,omitempty"` - SourceTvPrivateAddr *uint32 `protobuf:"varint,3,opt,name=source_tv_private_addr" json:"source_tv_private_addr,omitempty"` - SourceTvPort *uint32 `protobuf:"varint,4,opt,name=source_tv_port" json:"source_tv_port,omitempty"` - GameServerSteamid *uint64 `protobuf:"fixed64,5,opt,name=game_server_steamid" json:"game_server_steamid,omitempty"` - WatchServerSteamid *uint64 `protobuf:"fixed64,6,opt,name=watch_server_steamid" json:"watch_server_steamid,omitempty"` - WatchTvUniqueSecretCode *uint64 `protobuf:"fixed64,7,opt,name=watch_tv_unique_secret_code" json:"watch_tv_unique_secret_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgWatchGameResponse) Reset() { *m = CMsgWatchGameResponse{} } -func (m *CMsgWatchGameResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgWatchGameResponse) ProtoMessage() {} -func (*CMsgWatchGameResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{157} } - -const Default_CMsgWatchGameResponse_WatchGameResult CMsgWatchGameResponse_WatchGameResult = CMsgWatchGameResponse_PENDING - -func (m *CMsgWatchGameResponse) GetWatchGameResult() CMsgWatchGameResponse_WatchGameResult { - if m != nil && m.WatchGameResult != nil { - return *m.WatchGameResult - } - return Default_CMsgWatchGameResponse_WatchGameResult -} - -func (m *CMsgWatchGameResponse) GetSourceTvPublicAddr() uint32 { - if m != nil && m.SourceTvPublicAddr != nil { - return *m.SourceTvPublicAddr - } - return 0 -} - -func (m *CMsgWatchGameResponse) GetSourceTvPrivateAddr() uint32 { - if m != nil && m.SourceTvPrivateAddr != nil { - return *m.SourceTvPrivateAddr - } - return 0 -} - -func (m *CMsgWatchGameResponse) GetSourceTvPort() uint32 { - if m != nil && m.SourceTvPort != nil { - return *m.SourceTvPort - } - return 0 -} - -func (m *CMsgWatchGameResponse) GetGameServerSteamid() uint64 { - if m != nil && m.GameServerSteamid != nil { - return *m.GameServerSteamid - } - return 0 -} - -func (m *CMsgWatchGameResponse) GetWatchServerSteamid() uint64 { - if m != nil && m.WatchServerSteamid != nil { - return *m.WatchServerSteamid - } - return 0 -} - -func (m *CMsgWatchGameResponse) GetWatchTvUniqueSecretCode() uint64 { - if m != nil && m.WatchTvUniqueSecretCode != nil { - return *m.WatchTvUniqueSecretCode - } - return 0 -} - -type CMsgPartyLeaderWatchGamePrompt struct { - GameServerSteamid *uint64 `protobuf:"fixed64,5,opt,name=game_server_steamid" json:"game_server_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPartyLeaderWatchGamePrompt) Reset() { *m = CMsgPartyLeaderWatchGamePrompt{} } -func (m *CMsgPartyLeaderWatchGamePrompt) String() string { return proto.CompactTextString(m) } -func (*CMsgPartyLeaderWatchGamePrompt) ProtoMessage() {} -func (*CMsgPartyLeaderWatchGamePrompt) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{158} -} - -func (m *CMsgPartyLeaderWatchGamePrompt) GetGameServerSteamid() uint64 { - if m != nil && m.GameServerSteamid != nil { - return *m.GameServerSteamid - } - return 0 -} - -type CMsgGCMatchDetailsRequest struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCMatchDetailsRequest) Reset() { *m = CMsgGCMatchDetailsRequest{} } -func (m *CMsgGCMatchDetailsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCMatchDetailsRequest) ProtoMessage() {} -func (*CMsgGCMatchDetailsRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{159} } - -func (m *CMsgGCMatchDetailsRequest) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -type CMsgGCMatchDetailsResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - Match *CMsgDOTAMatch `protobuf:"bytes,2,opt,name=match" json:"match,omitempty"` - Vote *DOTAMatchVote `protobuf:"varint,3,opt,name=vote,enum=DOTAMatchVote,def=0" json:"vote,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCMatchDetailsResponse) Reset() { *m = CMsgGCMatchDetailsResponse{} } -func (m *CMsgGCMatchDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCMatchDetailsResponse) ProtoMessage() {} -func (*CMsgGCMatchDetailsResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{160} } - -const Default_CMsgGCMatchDetailsResponse_Vote DOTAMatchVote = DOTAMatchVote_DOTAMatchVote_INVALID - -func (m *CMsgGCMatchDetailsResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGCMatchDetailsResponse) GetMatch() *CMsgDOTAMatch { - if m != nil { - return m.Match - } - return nil -} - -func (m *CMsgGCMatchDetailsResponse) GetVote() DOTAMatchVote { - if m != nil && m.Vote != nil { - return *m.Vote - } - return Default_CMsgGCMatchDetailsResponse_Vote -} - -type CMsgServerToGCMatchDetailsRequest struct { - MatchIds []uint64 `protobuf:"varint,1,rep,name=match_ids" json:"match_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerToGCMatchDetailsRequest) Reset() { *m = CMsgServerToGCMatchDetailsRequest{} } -func (m *CMsgServerToGCMatchDetailsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgServerToGCMatchDetailsRequest) ProtoMessage() {} -func (*CMsgServerToGCMatchDetailsRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{161} -} - -func (m *CMsgServerToGCMatchDetailsRequest) GetMatchIds() []uint64 { - if m != nil { - return m.MatchIds - } - return nil -} - -type CMsgGCToServerMatchDetailsResponse struct { - Matches []*CMsgDOTAMatch `protobuf:"bytes,1,rep,name=matches" json:"matches,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToServerMatchDetailsResponse) Reset() { *m = CMsgGCToServerMatchDetailsResponse{} } -func (m *CMsgGCToServerMatchDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToServerMatchDetailsResponse) ProtoMessage() {} -func (*CMsgGCToServerMatchDetailsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{162} -} - -func (m *CMsgGCToServerMatchDetailsResponse) GetMatches() []*CMsgDOTAMatch { - if m != nil { - return m.Matches - } - return nil -} - -type CMsgDOTAProfileRequest struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - RequestName *bool `protobuf:"varint,2,opt,name=request_name" json:"request_name,omitempty"` - Engine *ESourceEngine `protobuf:"varint,3,opt,name=engine,enum=ESourceEngine,def=0" json:"engine,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileRequest) Reset() { *m = CMsgDOTAProfileRequest{} } -func (m *CMsgDOTAProfileRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileRequest) ProtoMessage() {} -func (*CMsgDOTAProfileRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{163} } - -const Default_CMsgDOTAProfileRequest_Engine ESourceEngine = ESourceEngine_k_ESE_Source1 - -func (m *CMsgDOTAProfileRequest) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAProfileRequest) GetRequestName() bool { - if m != nil && m.RequestName != nil { - return *m.RequestName - } - return false -} - -func (m *CMsgDOTAProfileRequest) GetEngine() ESourceEngine { - if m != nil && m.Engine != nil { - return *m.Engine - } - return Default_CMsgDOTAProfileRequest_Engine -} - -type CMsgDOTAProfileResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - GameAccountClient *CSODOTAGameAccountClient `protobuf:"bytes,2,opt,name=game_account_client" json:"game_account_client,omitempty"` - LatestMatches []*CMsgDOTAMatch `protobuf:"bytes,3,rep,name=latest_matches" json:"latest_matches,omitempty"` - Heroes []*CMsgDOTAProfileResponse_PlayedHero `protobuf:"bytes,4,rep,name=heroes" json:"heroes,omitempty"` - PlayerName *string `protobuf:"bytes,5,opt,name=player_name" json:"player_name,omitempty"` - TeamName *string `protobuf:"bytes,6,opt,name=team_name" json:"team_name,omitempty"` - TeamTag *string `protobuf:"bytes,7,opt,name=team_tag" json:"team_tag,omitempty"` - TeamLogo *uint64 `protobuf:"varint,8,opt,name=team_logo" json:"team_logo,omitempty"` - ShowcaseHero *CMsgDOTAProfileResponse_ShowcaseHero `protobuf:"bytes,9,opt,name=showcase_hero" json:"showcase_hero,omitempty"` - LeaguePasses []*CMsgDOTAProfileResponse_LeaguePass `protobuf:"bytes,10,rep,name=league_passes" json:"league_passes,omitempty"` - EventTickets []*CMsgDOTAProfileResponse_EventTicket `protobuf:"bytes,11,rep,name=event_tickets" json:"event_tickets,omitempty"` - TeamId *uint32 `protobuf:"varint,12,opt,name=team_id" json:"team_id,omitempty"` - HasPassport *bool `protobuf:"varint,13,opt,name=has_passport" json:"has_passport,omitempty"` - FeaturedItems []*CMsgDOTAProfileResponse_FeaturedItem `protobuf:"bytes,14,rep,name=featured_items" json:"featured_items,omitempty"` - AbandonPercent *uint32 `protobuf:"varint,15,opt,name=abandon_percent" json:"abandon_percent,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileResponse) Reset() { *m = CMsgDOTAProfileResponse{} } -func (m *CMsgDOTAProfileResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileResponse) ProtoMessage() {} -func (*CMsgDOTAProfileResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{164} } - -func (m *CMsgDOTAProfileResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgDOTAProfileResponse) GetGameAccountClient() *CSODOTAGameAccountClient { - if m != nil { - return m.GameAccountClient - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetLatestMatches() []*CMsgDOTAMatch { - if m != nil { - return m.LatestMatches - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetHeroes() []*CMsgDOTAProfileResponse_PlayedHero { - if m != nil { - return m.Heroes - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetPlayerName() string { - if m != nil && m.PlayerName != nil { - return *m.PlayerName - } - return "" -} - -func (m *CMsgDOTAProfileResponse) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTAProfileResponse) GetTeamTag() string { - if m != nil && m.TeamTag != nil { - return *m.TeamTag - } - return "" -} - -func (m *CMsgDOTAProfileResponse) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -func (m *CMsgDOTAProfileResponse) GetShowcaseHero() *CMsgDOTAProfileResponse_ShowcaseHero { - if m != nil { - return m.ShowcaseHero - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetLeaguePasses() []*CMsgDOTAProfileResponse_LeaguePass { - if m != nil { - return m.LeaguePasses - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetEventTickets() []*CMsgDOTAProfileResponse_EventTicket { - if m != nil { - return m.EventTickets - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTAProfileResponse) GetHasPassport() bool { - if m != nil && m.HasPassport != nil { - return *m.HasPassport - } - return false -} - -func (m *CMsgDOTAProfileResponse) GetFeaturedItems() []*CMsgDOTAProfileResponse_FeaturedItem { - if m != nil { - return m.FeaturedItems - } - return nil -} - -func (m *CMsgDOTAProfileResponse) GetAbandonPercent() uint32 { - if m != nil && m.AbandonPercent != nil { - return *m.AbandonPercent - } - return 0 -} - -type CMsgDOTAProfileResponse_PlayedHero struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - Wins *uint32 `protobuf:"varint,2,opt,name=wins" json:"wins,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileResponse_PlayedHero) Reset() { *m = CMsgDOTAProfileResponse_PlayedHero{} } -func (m *CMsgDOTAProfileResponse_PlayedHero) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileResponse_PlayedHero) ProtoMessage() {} -func (*CMsgDOTAProfileResponse_PlayedHero) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{164, 0} -} - -func (m *CMsgDOTAProfileResponse_PlayedHero) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAProfileResponse_PlayedHero) GetWins() uint32 { - if m != nil && m.Wins != nil { - return *m.Wins - } - return 0 -} - -type CMsgDOTAProfileResponse_ShowcaseHero struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - ObjectData [][]byte `protobuf:"bytes,2,rep,name=object_data" json:"object_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileResponse_ShowcaseHero) Reset() { *m = CMsgDOTAProfileResponse_ShowcaseHero{} } -func (m *CMsgDOTAProfileResponse_ShowcaseHero) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileResponse_ShowcaseHero) ProtoMessage() {} -func (*CMsgDOTAProfileResponse_ShowcaseHero) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{164, 1} -} - -func (m *CMsgDOTAProfileResponse_ShowcaseHero) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAProfileResponse_ShowcaseHero) GetObjectData() [][]byte { - if m != nil { - return m.ObjectData - } - return nil -} - -type CMsgDOTAProfileResponse_LeaguePass struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - ItemDef *uint32 `protobuf:"varint,2,opt,name=item_def" json:"item_def,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileResponse_LeaguePass) Reset() { *m = CMsgDOTAProfileResponse_LeaguePass{} } -func (m *CMsgDOTAProfileResponse_LeaguePass) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileResponse_LeaguePass) ProtoMessage() {} -func (*CMsgDOTAProfileResponse_LeaguePass) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{164, 2} -} - -func (m *CMsgDOTAProfileResponse_LeaguePass) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTAProfileResponse_LeaguePass) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -type CMsgDOTAProfileResponse_EventTicket struct { - EventId *uint32 `protobuf:"varint,1,opt,name=event_id" json:"event_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileResponse_EventTicket) Reset() { *m = CMsgDOTAProfileResponse_EventTicket{} } -func (m *CMsgDOTAProfileResponse_EventTicket) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileResponse_EventTicket) ProtoMessage() {} -func (*CMsgDOTAProfileResponse_EventTicket) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{164, 3} -} - -func (m *CMsgDOTAProfileResponse_EventTicket) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -type CMsgDOTAProfileResponse_FeaturedItem struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - ObjectData []byte `protobuf:"bytes,2,opt,name=object_data" json:"object_data,omitempty"` - SlotIndex *uint32 `protobuf:"varint,3,opt,name=slot_index" json:"slot_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileResponse_FeaturedItem) Reset() { *m = CMsgDOTAProfileResponse_FeaturedItem{} } -func (m *CMsgDOTAProfileResponse_FeaturedItem) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileResponse_FeaturedItem) ProtoMessage() {} -func (*CMsgDOTAProfileResponse_FeaturedItem) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{164, 4} -} - -func (m *CMsgDOTAProfileResponse_FeaturedItem) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgDOTAProfileResponse_FeaturedItem) GetObjectData() []byte { - if m != nil { - return m.ObjectData - } - return nil -} - -func (m *CMsgDOTAProfileResponse_FeaturedItem) GetSlotIndex() uint32 { - if m != nil && m.SlotIndex != nil { - return *m.SlotIndex - } - return 0 -} - -type CMsgDOTAProfileTickets struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - AccountId *uint32 `protobuf:"varint,2,opt,name=account_id" json:"account_id,omitempty"` - LeaguePasses []*CMsgDOTAProfileTickets_LeaguePass `protobuf:"bytes,3,rep,name=league_passes" json:"league_passes,omitempty"` - EventTickets []*CMsgDOTAProfileTickets_EventTicket `protobuf:"bytes,4,rep,name=event_tickets" json:"event_tickets,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileTickets) Reset() { *m = CMsgDOTAProfileTickets{} } -func (m *CMsgDOTAProfileTickets) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileTickets) ProtoMessage() {} -func (*CMsgDOTAProfileTickets) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{165} } - -func (m *CMsgDOTAProfileTickets) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgDOTAProfileTickets) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAProfileTickets) GetLeaguePasses() []*CMsgDOTAProfileTickets_LeaguePass { - if m != nil { - return m.LeaguePasses - } - return nil -} - -func (m *CMsgDOTAProfileTickets) GetEventTickets() []*CMsgDOTAProfileTickets_EventTicket { - if m != nil { - return m.EventTickets - } - return nil -} - -type CMsgDOTAProfileTickets_LeaguePass struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - ItemDef *uint32 `protobuf:"varint,2,opt,name=item_def" json:"item_def,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileTickets_LeaguePass) Reset() { *m = CMsgDOTAProfileTickets_LeaguePass{} } -func (m *CMsgDOTAProfileTickets_LeaguePass) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileTickets_LeaguePass) ProtoMessage() {} -func (*CMsgDOTAProfileTickets_LeaguePass) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{165, 0} -} - -func (m *CMsgDOTAProfileTickets_LeaguePass) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTAProfileTickets_LeaguePass) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -type CMsgDOTAProfileTickets_EventTicket struct { - EventId *uint32 `protobuf:"varint,1,opt,name=event_id" json:"event_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileTickets_EventTicket) Reset() { *m = CMsgDOTAProfileTickets_EventTicket{} } -func (m *CMsgDOTAProfileTickets_EventTicket) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileTickets_EventTicket) ProtoMessage() {} -func (*CMsgDOTAProfileTickets_EventTicket) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{165, 1} -} - -func (m *CMsgDOTAProfileTickets_EventTicket) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -type CMsgClientToGCGetProfileTickets struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetProfileTickets) Reset() { *m = CMsgClientToGCGetProfileTickets{} } -func (m *CMsgClientToGCGetProfileTickets) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetProfileTickets) ProtoMessage() {} -func (*CMsgClientToGCGetProfileTickets) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{166} -} - -func (m *CMsgClientToGCGetProfileTickets) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCSteamProfileRequest struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCSteamProfileRequest) Reset() { *m = CMsgGCSteamProfileRequest{} } -func (m *CMsgGCSteamProfileRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCSteamProfileRequest) ProtoMessage() {} -func (*CMsgGCSteamProfileRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{167} } - -func (m *CMsgGCSteamProfileRequest) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCSteamProfileRequestResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCSteamProfileRequestResponse) Reset() { *m = CMsgGCSteamProfileRequestResponse{} } -func (m *CMsgGCSteamProfileRequestResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCSteamProfileRequestResponse) ProtoMessage() {} -func (*CMsgGCSteamProfileRequestResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{168} -} - -func (m *CMsgGCSteamProfileRequestResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgDOTAClearNotifySuccessfulReport struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAClearNotifySuccessfulReport) Reset() { *m = CMsgDOTAClearNotifySuccessfulReport{} } -func (m *CMsgDOTAClearNotifySuccessfulReport) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAClearNotifySuccessfulReport) ProtoMessage() {} -func (*CMsgDOTAClearNotifySuccessfulReport) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{169} -} - -type CMsgDOTAWelcome struct { - TournamentAdmin *bool `protobuf:"varint,3,opt,name=tournament_admin" json:"tournament_admin,omitempty"` - TournamentBroadcaster *bool `protobuf:"varint,4,opt,name=tournament_broadcaster" json:"tournament_broadcaster,omitempty"` - StoreItemHash *uint32 `protobuf:"varint,5,opt,name=store_item_hash" json:"store_item_hash,omitempty"` - Timeplayedconsecutively *uint32 `protobuf:"varint,6,opt,name=timeplayedconsecutively" json:"timeplayedconsecutively,omitempty"` - Allow_3RdPartyMatchHistory *bool `protobuf:"varint,7,opt,name=allow_3rd_party_match_history" json:"allow_3rd_party_match_history,omitempty"` - PartnerAccountType *PartnerAccountType `protobuf:"varint,8,opt,name=partner_account_type,enum=PartnerAccountType,def=0" json:"partner_account_type,omitempty"` - BannedWordListWordId *uint32 `protobuf:"varint,9,opt,name=banned_word_list_word_id" json:"banned_word_list_word_id,omitempty"` - PartnerAccountState *uint32 `protobuf:"varint,11,opt,name=partner_account_state" json:"partner_account_state,omitempty"` - LastTimePlayed *uint32 `protobuf:"varint,12,opt,name=last_time_played" json:"last_time_played,omitempty"` - LastIpAddress *uint32 `protobuf:"varint,13,opt,name=last_ip_address" json:"last_ip_address,omitempty"` - Shutdownlawterminateminutes *uint32 `protobuf:"varint,15,opt,name=shutdownlawterminateminutes" json:"shutdownlawterminateminutes,omitempty"` - BannedWordListVersion *uint32 `protobuf:"varint,16,opt,name=banned_word_list_version" json:"banned_word_list_version,omitempty"` - ProfilePrivate *bool `protobuf:"varint,17,opt,name=profile_private" json:"profile_private,omitempty"` - Currency *uint32 `protobuf:"varint,18,opt,name=currency" json:"currency,omitempty"` - BangNo *uint32 `protobuf:"varint,19,opt,name=bang_no" json:"bang_no,omitempty"` - ShouldRequestPlayerOrigin *bool `protobuf:"varint,20,opt,name=should_request_player_origin" json:"should_request_player_origin,omitempty"` - CompendiumUnlocks *uint64 `protobuf:"varint,21,opt,name=compendium_unlocks" json:"compendium_unlocks,omitempty"` - GcSocacheFileVersion *uint32 `protobuf:"varint,22,opt,name=gc_socache_file_version" json:"gc_socache_file_version,omitempty"` - LocalizationDigests []*CMsgDOTAWelcome_LocalizationDigest `protobuf:"bytes,23,rep,name=localization_digests" json:"localization_digests,omitempty"` - IsPerfectWorldTestAccount *bool `protobuf:"varint,24,opt,name=is_perfect_world_test_account" json:"is_perfect_world_test_account,omitempty"` - ActiveEvents []EEvent `protobuf:"varint,25,rep,name=active_events,enum=EEvent" json:"active_events,omitempty"` - ExtraMessages []*CMsgDOTAWelcome_CExtraMsg `protobuf:"bytes,26,rep,name=extra_messages" json:"extra_messages,omitempty"` - MinimumRecentItemId *uint64 `protobuf:"varint,27,opt,name=minimum_recent_item_id" json:"minimum_recent_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAWelcome) Reset() { *m = CMsgDOTAWelcome{} } -func (m *CMsgDOTAWelcome) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAWelcome) ProtoMessage() {} -func (*CMsgDOTAWelcome) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{170} } - -const Default_CMsgDOTAWelcome_PartnerAccountType PartnerAccountType = PartnerAccountType_PARTNER_NONE - -func (m *CMsgDOTAWelcome) GetTournamentAdmin() bool { - if m != nil && m.TournamentAdmin != nil { - return *m.TournamentAdmin - } - return false -} - -func (m *CMsgDOTAWelcome) GetTournamentBroadcaster() bool { - if m != nil && m.TournamentBroadcaster != nil { - return *m.TournamentBroadcaster - } - return false -} - -func (m *CMsgDOTAWelcome) GetStoreItemHash() uint32 { - if m != nil && m.StoreItemHash != nil { - return *m.StoreItemHash - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetTimeplayedconsecutively() uint32 { - if m != nil && m.Timeplayedconsecutively != nil { - return *m.Timeplayedconsecutively - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetAllow_3RdPartyMatchHistory() bool { - if m != nil && m.Allow_3RdPartyMatchHistory != nil { - return *m.Allow_3RdPartyMatchHistory - } - return false -} - -func (m *CMsgDOTAWelcome) GetPartnerAccountType() PartnerAccountType { - if m != nil && m.PartnerAccountType != nil { - return *m.PartnerAccountType - } - return Default_CMsgDOTAWelcome_PartnerAccountType -} - -func (m *CMsgDOTAWelcome) GetBannedWordListWordId() uint32 { - if m != nil && m.BannedWordListWordId != nil { - return *m.BannedWordListWordId - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetPartnerAccountState() uint32 { - if m != nil && m.PartnerAccountState != nil { - return *m.PartnerAccountState - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetLastTimePlayed() uint32 { - if m != nil && m.LastTimePlayed != nil { - return *m.LastTimePlayed - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetLastIpAddress() uint32 { - if m != nil && m.LastIpAddress != nil { - return *m.LastIpAddress - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetShutdownlawterminateminutes() uint32 { - if m != nil && m.Shutdownlawterminateminutes != nil { - return *m.Shutdownlawterminateminutes - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetBannedWordListVersion() uint32 { - if m != nil && m.BannedWordListVersion != nil { - return *m.BannedWordListVersion - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetProfilePrivate() bool { - if m != nil && m.ProfilePrivate != nil { - return *m.ProfilePrivate - } - return false -} - -func (m *CMsgDOTAWelcome) GetCurrency() uint32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetBangNo() uint32 { - if m != nil && m.BangNo != nil { - return *m.BangNo - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetShouldRequestPlayerOrigin() bool { - if m != nil && m.ShouldRequestPlayerOrigin != nil { - return *m.ShouldRequestPlayerOrigin - } - return false -} - -func (m *CMsgDOTAWelcome) GetCompendiumUnlocks() uint64 { - if m != nil && m.CompendiumUnlocks != nil { - return *m.CompendiumUnlocks - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetGcSocacheFileVersion() uint32 { - if m != nil && m.GcSocacheFileVersion != nil { - return *m.GcSocacheFileVersion - } - return 0 -} - -func (m *CMsgDOTAWelcome) GetLocalizationDigests() []*CMsgDOTAWelcome_LocalizationDigest { - if m != nil { - return m.LocalizationDigests - } - return nil -} - -func (m *CMsgDOTAWelcome) GetIsPerfectWorldTestAccount() bool { - if m != nil && m.IsPerfectWorldTestAccount != nil { - return *m.IsPerfectWorldTestAccount - } - return false -} - -func (m *CMsgDOTAWelcome) GetActiveEvents() []EEvent { - if m != nil { - return m.ActiveEvents - } - return nil -} - -func (m *CMsgDOTAWelcome) GetExtraMessages() []*CMsgDOTAWelcome_CExtraMsg { - if m != nil { - return m.ExtraMessages - } - return nil -} - -func (m *CMsgDOTAWelcome) GetMinimumRecentItemId() uint64 { - if m != nil && m.MinimumRecentItemId != nil { - return *m.MinimumRecentItemId - } - return 0 -} - -type CMsgDOTAWelcome_LocalizationDigest struct { - Context *string `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"` - EnglishLanguageFileSha1 *CMsgSHA1Digest `protobuf:"bytes,2,opt,name=english_language_file_sha1" json:"english_language_file_sha1,omitempty"` - ClientLanguageFileSha1 *CMsgSHA1Digest `protobuf:"bytes,3,opt,name=client_language_file_sha1" json:"client_language_file_sha1,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAWelcome_LocalizationDigest) Reset() { *m = CMsgDOTAWelcome_LocalizationDigest{} } -func (m *CMsgDOTAWelcome_LocalizationDigest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAWelcome_LocalizationDigest) ProtoMessage() {} -func (*CMsgDOTAWelcome_LocalizationDigest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{170, 0} -} - -func (m *CMsgDOTAWelcome_LocalizationDigest) GetContext() string { - if m != nil && m.Context != nil { - return *m.Context - } - return "" -} - -func (m *CMsgDOTAWelcome_LocalizationDigest) GetEnglishLanguageFileSha1() *CMsgSHA1Digest { - if m != nil { - return m.EnglishLanguageFileSha1 - } - return nil -} - -func (m *CMsgDOTAWelcome_LocalizationDigest) GetClientLanguageFileSha1() *CMsgSHA1Digest { - if m != nil { - return m.ClientLanguageFileSha1 - } - return nil -} - -type CMsgDOTAWelcome_CExtraMsg struct { - Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Contents []byte `protobuf:"bytes,2,opt,name=contents" json:"contents,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAWelcome_CExtraMsg) Reset() { *m = CMsgDOTAWelcome_CExtraMsg{} } -func (m *CMsgDOTAWelcome_CExtraMsg) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAWelcome_CExtraMsg) ProtoMessage() {} -func (*CMsgDOTAWelcome_CExtraMsg) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{170, 1} } - -func (m *CMsgDOTAWelcome_CExtraMsg) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CMsgDOTAWelcome_CExtraMsg) GetContents() []byte { - if m != nil { - return m.Contents - } - return nil -} - -type CSODOTAGameHeroFavorites struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAGameHeroFavorites) Reset() { *m = CSODOTAGameHeroFavorites{} } -func (m *CSODOTAGameHeroFavorites) String() string { return proto.CompactTextString(m) } -func (*CSODOTAGameHeroFavorites) ProtoMessage() {} -func (*CSODOTAGameHeroFavorites) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{171} } - -func (m *CSODOTAGameHeroFavorites) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSODOTAGameHeroFavorites) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgDOTAHeroFavoritesAdd struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHeroFavoritesAdd) Reset() { *m = CMsgDOTAHeroFavoritesAdd{} } -func (m *CMsgDOTAHeroFavoritesAdd) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHeroFavoritesAdd) ProtoMessage() {} -func (*CMsgDOTAHeroFavoritesAdd) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{172} } - -func (m *CMsgDOTAHeroFavoritesAdd) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgDOTAHeroFavoritesRemove struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHeroFavoritesRemove) Reset() { *m = CMsgDOTAHeroFavoritesRemove{} } -func (m *CMsgDOTAHeroFavoritesRemove) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHeroFavoritesRemove) ProtoMessage() {} -func (*CMsgDOTAHeroFavoritesRemove) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{173} } - -func (m *CMsgDOTAHeroFavoritesRemove) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgSetShowcaseHero struct { - ShowcaseHeroId *uint32 `protobuf:"varint,1,opt,name=showcase_hero_id" json:"showcase_hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetShowcaseHero) Reset() { *m = CMsgSetShowcaseHero{} } -func (m *CMsgSetShowcaseHero) String() string { return proto.CompactTextString(m) } -func (*CMsgSetShowcaseHero) ProtoMessage() {} -func (*CMsgSetShowcaseHero) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{174} } - -func (m *CMsgSetShowcaseHero) GetShowcaseHeroId() uint32 { - if m != nil && m.ShowcaseHeroId != nil { - return *m.ShowcaseHeroId - } - return 0 -} - -type CMsgSetFeaturedItems struct { - FeaturedItemId []uint64 `protobuf:"varint,1,rep,name=featured_item_id" json:"featured_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetFeaturedItems) Reset() { *m = CMsgSetFeaturedItems{} } -func (m *CMsgSetFeaturedItems) String() string { return proto.CompactTextString(m) } -func (*CMsgSetFeaturedItems) ProtoMessage() {} -func (*CMsgSetFeaturedItems) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{175} } - -func (m *CMsgSetFeaturedItems) GetFeaturedItemId() []uint64 { - if m != nil { - return m.FeaturedItemId - } - return nil -} - -type CMsgDOTAFeaturedItems struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - FeaturedItemId []uint64 `protobuf:"varint,2,rep,name=featured_item_id" json:"featured_item_id,omitempty"` - ObjectData [][]byte `protobuf:"bytes,3,rep,name=object_data" json:"object_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFeaturedItems) Reset() { *m = CMsgDOTAFeaturedItems{} } -func (m *CMsgDOTAFeaturedItems) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFeaturedItems) ProtoMessage() {} -func (*CMsgDOTAFeaturedItems) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{176} } - -func (m *CMsgDOTAFeaturedItems) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAFeaturedItems) GetFeaturedItemId() []uint64 { - if m != nil { - return m.FeaturedItemId - } - return nil -} - -func (m *CMsgDOTAFeaturedItems) GetObjectData() [][]byte { - if m != nil { - return m.ObjectData - } - return nil -} - -type CMsgRequestLeagueInfo struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestLeagueInfo) Reset() { *m = CMsgRequestLeagueInfo{} } -func (m *CMsgRequestLeagueInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestLeagueInfo) ProtoMessage() {} -func (*CMsgRequestLeagueInfo) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{177} } - -type CDynamicLeagueData struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - LastMatchTime *uint32 `protobuf:"fixed32,2,opt,name=last_match_time" json:"last_match_time,omitempty"` - PrizePoolUsd *uint32 `protobuf:"varint,3,opt,name=prize_pool_usd" json:"prize_pool_usd,omitempty"` - HasLiveMatches *bool `protobuf:"varint,4,opt,name=has_live_matches" json:"has_live_matches,omitempty"` - IsCompendiumPublic *bool `protobuf:"varint,5,opt,name=is_compendium_public" json:"is_compendium_public,omitempty"` - CompendiumVersion *uint32 `protobuf:"varint,6,opt,name=compendium_version" json:"compendium_version,omitempty"` - CompendiumContentVersion *uint32 `protobuf:"varint,7,opt,name=compendium_content_version" json:"compendium_content_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDynamicLeagueData) Reset() { *m = CDynamicLeagueData{} } -func (m *CDynamicLeagueData) String() string { return proto.CompactTextString(m) } -func (*CDynamicLeagueData) ProtoMessage() {} -func (*CDynamicLeagueData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{178} } - -func (m *CDynamicLeagueData) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CDynamicLeagueData) GetLastMatchTime() uint32 { - if m != nil && m.LastMatchTime != nil { - return *m.LastMatchTime - } - return 0 -} - -func (m *CDynamicLeagueData) GetPrizePoolUsd() uint32 { - if m != nil && m.PrizePoolUsd != nil { - return *m.PrizePoolUsd - } - return 0 -} - -func (m *CDynamicLeagueData) GetHasLiveMatches() bool { - if m != nil && m.HasLiveMatches != nil { - return *m.HasLiveMatches - } - return false -} - -func (m *CDynamicLeagueData) GetIsCompendiumPublic() bool { - if m != nil && m.IsCompendiumPublic != nil { - return *m.IsCompendiumPublic - } - return false -} - -func (m *CDynamicLeagueData) GetCompendiumVersion() uint32 { - if m != nil && m.CompendiumVersion != nil { - return *m.CompendiumVersion - } - return 0 -} - -func (m *CDynamicLeagueData) GetCompendiumContentVersion() uint32 { - if m != nil && m.CompendiumContentVersion != nil { - return *m.CompendiumContentVersion - } - return 0 -} - -type CStaticLeagueData struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Description *string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - BannerName *string `protobuf:"bytes,4,opt,name=banner_name" json:"banner_name,omitempty"` - ItemdefName *string `protobuf:"bytes,5,opt,name=itemdef_name" json:"itemdef_name,omitempty"` - Url *string `protobuf:"bytes,6,opt,name=url" json:"url,omitempty"` - ItemDefIndex *uint32 `protobuf:"varint,7,opt,name=item_def_index" json:"item_def_index,omitempty"` - HudSkinItemDefIndex *uint32 `protobuf:"varint,8,opt,name=hud_skin_item_def_index" json:"hud_skin_item_def_index,omitempty"` - LoadingScreenName *string `protobuf:"bytes,9,opt,name=loading_screen_name" json:"loading_screen_name,omitempty"` - BasePrizePool *uint32 `protobuf:"varint,10,opt,name=base_prize_pool" json:"base_prize_pool,omitempty"` - IsMajor *bool `protobuf:"varint,11,opt,name=is_major" json:"is_major,omitempty"` - SortOrder *uint32 `protobuf:"varint,12,opt,name=sort_order" json:"sort_order,omitempty"` - Tier *uint32 `protobuf:"varint,13,opt,name=tier" json:"tier,omitempty"` - AmateurRegion *uint32 `protobuf:"varint,14,opt,name=amateur_region" json:"amateur_region,omitempty"` - Organizer *string `protobuf:"bytes,15,opt,name=organizer" json:"organizer,omitempty"` - StartDate *uint32 `protobuf:"varint,16,opt,name=start_date" json:"start_date,omitempty"` - EndDate *uint32 `protobuf:"varint,17,opt,name=end_date" json:"end_date,omitempty"` - Location *string `protobuf:"bytes,18,opt,name=location" json:"location,omitempty"` - InventoryImage *string `protobuf:"bytes,19,opt,name=inventory_image" json:"inventory_image,omitempty"` - SquareImage *string `protobuf:"bytes,20,opt,name=square_image" json:"square_image,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CStaticLeagueData) Reset() { *m = CStaticLeagueData{} } -func (m *CStaticLeagueData) String() string { return proto.CompactTextString(m) } -func (*CStaticLeagueData) ProtoMessage() {} -func (*CStaticLeagueData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{179} } - -func (m *CStaticLeagueData) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CStaticLeagueData) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CStaticLeagueData) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CStaticLeagueData) GetBannerName() string { - if m != nil && m.BannerName != nil { - return *m.BannerName - } - return "" -} - -func (m *CStaticLeagueData) GetItemdefName() string { - if m != nil && m.ItemdefName != nil { - return *m.ItemdefName - } - return "" -} - -func (m *CStaticLeagueData) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *CStaticLeagueData) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CStaticLeagueData) GetHudSkinItemDefIndex() uint32 { - if m != nil && m.HudSkinItemDefIndex != nil { - return *m.HudSkinItemDefIndex - } - return 0 -} - -func (m *CStaticLeagueData) GetLoadingScreenName() string { - if m != nil && m.LoadingScreenName != nil { - return *m.LoadingScreenName - } - return "" -} - -func (m *CStaticLeagueData) GetBasePrizePool() uint32 { - if m != nil && m.BasePrizePool != nil { - return *m.BasePrizePool - } - return 0 -} - -func (m *CStaticLeagueData) GetIsMajor() bool { - if m != nil && m.IsMajor != nil { - return *m.IsMajor - } - return false -} - -func (m *CStaticLeagueData) GetSortOrder() uint32 { - if m != nil && m.SortOrder != nil { - return *m.SortOrder - } - return 0 -} - -func (m *CStaticLeagueData) GetTier() uint32 { - if m != nil && m.Tier != nil { - return *m.Tier - } - return 0 -} - -func (m *CStaticLeagueData) GetAmateurRegion() uint32 { - if m != nil && m.AmateurRegion != nil { - return *m.AmateurRegion - } - return 0 -} - -func (m *CStaticLeagueData) GetOrganizer() string { - if m != nil && m.Organizer != nil { - return *m.Organizer - } - return "" -} - -func (m *CStaticLeagueData) GetStartDate() uint32 { - if m != nil && m.StartDate != nil { - return *m.StartDate - } - return 0 -} - -func (m *CStaticLeagueData) GetEndDate() uint32 { - if m != nil && m.EndDate != nil { - return *m.EndDate - } - return 0 -} - -func (m *CStaticLeagueData) GetLocation() string { - if m != nil && m.Location != nil { - return *m.Location - } - return "" -} - -func (m *CStaticLeagueData) GetInventoryImage() string { - if m != nil && m.InventoryImage != nil { - return *m.InventoryImage - } - return "" -} - -func (m *CStaticLeagueData) GetSquareImage() string { - if m != nil && m.SquareImage != nil { - return *m.SquareImage - } - return "" -} - -type CLeagueData struct { - DynamicData *CDynamicLeagueData `protobuf:"bytes,1,opt,name=dynamic_data" json:"dynamic_data,omitempty"` - StaticData *CStaticLeagueData `protobuf:"bytes,2,opt,name=static_data" json:"static_data,omitempty"` - IsOwned *bool `protobuf:"varint,3,opt,name=is_owned" json:"is_owned,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CLeagueData) Reset() { *m = CLeagueData{} } -func (m *CLeagueData) String() string { return proto.CompactTextString(m) } -func (*CLeagueData) ProtoMessage() {} -func (*CLeagueData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{180} } - -func (m *CLeagueData) GetDynamicData() *CDynamicLeagueData { - if m != nil { - return m.DynamicData - } - return nil -} - -func (m *CLeagueData) GetStaticData() *CStaticLeagueData { - if m != nil { - return m.StaticData - } - return nil -} - -func (m *CLeagueData) GetIsOwned() bool { - if m != nil && m.IsOwned != nil { - return *m.IsOwned - } - return false -} - -type CMsgResponseLeagueInfo struct { - Leagues []*CDynamicLeagueData `protobuf:"bytes,1,rep,name=leagues" json:"leagues,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgResponseLeagueInfo) Reset() { *m = CMsgResponseLeagueInfo{} } -func (m *CMsgResponseLeagueInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgResponseLeagueInfo) ProtoMessage() {} -func (*CMsgResponseLeagueInfo) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{181} } - -func (m *CMsgResponseLeagueInfo) GetLeagues() []*CDynamicLeagueData { - if m != nil { - return m.Leagues - } - return nil -} - -type CMsgDOTAMatchVotes struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - Votes []*CMsgDOTAMatchVotes_PlayerVote `protobuf:"bytes,2,rep,name=votes" json:"votes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchVotes) Reset() { *m = CMsgDOTAMatchVotes{} } -func (m *CMsgDOTAMatchVotes) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchVotes) ProtoMessage() {} -func (*CMsgDOTAMatchVotes) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{182} } - -func (m *CMsgDOTAMatchVotes) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTAMatchVotes) GetVotes() []*CMsgDOTAMatchVotes_PlayerVote { - if m != nil { - return m.Votes - } - return nil -} - -type CMsgDOTAMatchVotes_PlayerVote struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Vote *uint32 `protobuf:"varint,2,opt,name=vote" json:"vote,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchVotes_PlayerVote) Reset() { *m = CMsgDOTAMatchVotes_PlayerVote{} } -func (m *CMsgDOTAMatchVotes_PlayerVote) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchVotes_PlayerVote) ProtoMessage() {} -func (*CMsgDOTAMatchVotes_PlayerVote) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{182, 0} -} - -func (m *CMsgDOTAMatchVotes_PlayerVote) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAMatchVotes_PlayerVote) GetVote() uint32 { - if m != nil && m.Vote != nil { - return *m.Vote - } - return 0 -} - -type CMsgCastMatchVote struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - Vote *DOTAMatchVote `protobuf:"varint,2,opt,name=vote,enum=DOTAMatchVote,def=0" json:"vote,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCastMatchVote) Reset() { *m = CMsgCastMatchVote{} } -func (m *CMsgCastMatchVote) String() string { return proto.CompactTextString(m) } -func (*CMsgCastMatchVote) ProtoMessage() {} -func (*CMsgCastMatchVote) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{183} } - -const Default_CMsgCastMatchVote_Vote DOTAMatchVote = DOTAMatchVote_DOTAMatchVote_INVALID - -func (m *CMsgCastMatchVote) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgCastMatchVote) GetVote() DOTAMatchVote { - if m != nil && m.Vote != nil { - return *m.Vote - } - return Default_CMsgCastMatchVote_Vote -} - -type CMsgRetrieveMatchVote struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - Incremental *uint32 `protobuf:"varint,2,opt,name=incremental" json:"incremental,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRetrieveMatchVote) Reset() { *m = CMsgRetrieveMatchVote{} } -func (m *CMsgRetrieveMatchVote) String() string { return proto.CompactTextString(m) } -func (*CMsgRetrieveMatchVote) ProtoMessage() {} -func (*CMsgRetrieveMatchVote) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{184} } - -func (m *CMsgRetrieveMatchVote) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgRetrieveMatchVote) GetIncremental() uint32 { - if m != nil && m.Incremental != nil { - return *m.Incremental - } - return 0 -} - -type CMsgMatchVoteResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - Vote *DOTAMatchVote `protobuf:"varint,2,opt,name=vote,enum=DOTAMatchVote,def=0" json:"vote,omitempty"` - PositiveVotes *uint32 `protobuf:"varint,3,opt,name=positive_votes" json:"positive_votes,omitempty"` - NegativeVotes *uint32 `protobuf:"varint,4,opt,name=negative_votes" json:"negative_votes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchVoteResponse) Reset() { *m = CMsgMatchVoteResponse{} } -func (m *CMsgMatchVoteResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchVoteResponse) ProtoMessage() {} -func (*CMsgMatchVoteResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{185} } - -const Default_CMsgMatchVoteResponse_Eresult uint32 = 2 -const Default_CMsgMatchVoteResponse_Vote DOTAMatchVote = DOTAMatchVote_DOTAMatchVote_INVALID - -func (m *CMsgMatchVoteResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgMatchVoteResponse_Eresult -} - -func (m *CMsgMatchVoteResponse) GetVote() DOTAMatchVote { - if m != nil && m.Vote != nil { - return *m.Vote - } - return Default_CMsgMatchVoteResponse_Vote -} - -func (m *CMsgMatchVoteResponse) GetPositiveVotes() uint32 { - if m != nil && m.PositiveVotes != nil { - return *m.PositiveVotes - } - return 0 -} - -func (m *CMsgMatchVoteResponse) GetNegativeVotes() uint32 { - if m != nil && m.NegativeVotes != nil { - return *m.NegativeVotes - } - return 0 -} - -type CMsgDOTAHallOfFame struct { - Week *uint32 `protobuf:"varint,1,opt,name=week" json:"week,omitempty"` - FeaturedPlayers []*CMsgDOTAHallOfFame_FeaturedPlayer `protobuf:"bytes,2,rep,name=featured_players" json:"featured_players,omitempty"` - FeaturedFarmer *CMsgDOTAHallOfFame_FeaturedFarmer `protobuf:"bytes,3,opt,name=featured_farmer" json:"featured_farmer,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHallOfFame) Reset() { *m = CMsgDOTAHallOfFame{} } -func (m *CMsgDOTAHallOfFame) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHallOfFame) ProtoMessage() {} -func (*CMsgDOTAHallOfFame) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{186} } - -func (m *CMsgDOTAHallOfFame) GetWeek() uint32 { - if m != nil && m.Week != nil { - return *m.Week - } - return 0 -} - -func (m *CMsgDOTAHallOfFame) GetFeaturedPlayers() []*CMsgDOTAHallOfFame_FeaturedPlayer { - if m != nil { - return m.FeaturedPlayers - } - return nil -} - -func (m *CMsgDOTAHallOfFame) GetFeaturedFarmer() *CMsgDOTAHallOfFame_FeaturedFarmer { - if m != nil { - return m.FeaturedFarmer - } - return nil -} - -type CMsgDOTAHallOfFame_FeaturedPlayer struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - AverageScaledMetric *float32 `protobuf:"fixed32,3,opt,name=average_scaled_metric" json:"average_scaled_metric,omitempty"` - NumGames *uint32 `protobuf:"varint,4,opt,name=num_games" json:"num_games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHallOfFame_FeaturedPlayer) Reset() { *m = CMsgDOTAHallOfFame_FeaturedPlayer{} } -func (m *CMsgDOTAHallOfFame_FeaturedPlayer) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHallOfFame_FeaturedPlayer) ProtoMessage() {} -func (*CMsgDOTAHallOfFame_FeaturedPlayer) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{186, 0} -} - -func (m *CMsgDOTAHallOfFame_FeaturedPlayer) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAHallOfFame_FeaturedPlayer) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAHallOfFame_FeaturedPlayer) GetAverageScaledMetric() float32 { - if m != nil && m.AverageScaledMetric != nil { - return *m.AverageScaledMetric - } - return 0 -} - -func (m *CMsgDOTAHallOfFame_FeaturedPlayer) GetNumGames() uint32 { - if m != nil && m.NumGames != nil { - return *m.NumGames - } - return 0 -} - -type CMsgDOTAHallOfFame_FeaturedFarmer struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - GoldPerMin *uint32 `protobuf:"varint,3,opt,name=gold_per_min" json:"gold_per_min,omitempty"` - MatchId *uint64 `protobuf:"varint,4,opt,name=match_id" json:"match_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHallOfFame_FeaturedFarmer) Reset() { *m = CMsgDOTAHallOfFame_FeaturedFarmer{} } -func (m *CMsgDOTAHallOfFame_FeaturedFarmer) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHallOfFame_FeaturedFarmer) ProtoMessage() {} -func (*CMsgDOTAHallOfFame_FeaturedFarmer) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{186, 1} -} - -func (m *CMsgDOTAHallOfFame_FeaturedFarmer) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAHallOfFame_FeaturedFarmer) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAHallOfFame_FeaturedFarmer) GetGoldPerMin() uint32 { - if m != nil && m.GoldPerMin != nil { - return *m.GoldPerMin - } - return 0 -} - -func (m *CMsgDOTAHallOfFame_FeaturedFarmer) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -type CMsgDOTAHallOfFameRequest struct { - Week *uint32 `protobuf:"varint,1,opt,name=week" json:"week,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHallOfFameRequest) Reset() { *m = CMsgDOTAHallOfFameRequest{} } -func (m *CMsgDOTAHallOfFameRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHallOfFameRequest) ProtoMessage() {} -func (*CMsgDOTAHallOfFameRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{187} } - -func (m *CMsgDOTAHallOfFameRequest) GetWeek() uint32 { - if m != nil && m.Week != nil { - return *m.Week - } - return 0 -} - -type CMsgDOTAHallOfFameResponse struct { - HallOfFame *CMsgDOTAHallOfFame `protobuf:"bytes,1,opt,name=hall_of_fame" json:"hall_of_fame,omitempty"` - Eresult *uint32 `protobuf:"varint,2,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHallOfFameResponse) Reset() { *m = CMsgDOTAHallOfFameResponse{} } -func (m *CMsgDOTAHallOfFameResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHallOfFameResponse) ProtoMessage() {} -func (*CMsgDOTAHallOfFameResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{188} } - -const Default_CMsgDOTAHallOfFameResponse_Eresult uint32 = 2 - -func (m *CMsgDOTAHallOfFameResponse) GetHallOfFame() *CMsgDOTAHallOfFame { - if m != nil { - return m.HallOfFame - } - return nil -} - -func (m *CMsgDOTAHallOfFameResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgDOTAHallOfFameResponse_Eresult -} - -type CMsgDOTAHalloweenHighScoreRequest struct { - Round *int32 `protobuf:"varint,1,opt,name=round,def=-1" json:"round,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHalloweenHighScoreRequest) Reset() { *m = CMsgDOTAHalloweenHighScoreRequest{} } -func (m *CMsgDOTAHalloweenHighScoreRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHalloweenHighScoreRequest) ProtoMessage() {} -func (*CMsgDOTAHalloweenHighScoreRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{189} -} - -const Default_CMsgDOTAHalloweenHighScoreRequest_Round int32 = -1 - -func (m *CMsgDOTAHalloweenHighScoreRequest) GetRound() int32 { - if m != nil && m.Round != nil { - return *m.Round - } - return Default_CMsgDOTAHalloweenHighScoreRequest_Round -} - -type CMsgDOTAHalloweenHighScoreResponse struct { - Score *uint32 `protobuf:"varint,1,opt,name=score" json:"score,omitempty"` - Match *CMsgDOTAMatch `protobuf:"bytes,2,opt,name=match" json:"match,omitempty"` - Eresult *uint32 `protobuf:"varint,3,opt,name=eresult" json:"eresult,omitempty"` - Round *int32 `protobuf:"varint,4,opt,name=round" json:"round,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHalloweenHighScoreResponse) Reset() { *m = CMsgDOTAHalloweenHighScoreResponse{} } -func (m *CMsgDOTAHalloweenHighScoreResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHalloweenHighScoreResponse) ProtoMessage() {} -func (*CMsgDOTAHalloweenHighScoreResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{190} -} - -func (m *CMsgDOTAHalloweenHighScoreResponse) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CMsgDOTAHalloweenHighScoreResponse) GetMatch() *CMsgDOTAMatch { - if m != nil { - return m.Match - } - return nil -} - -func (m *CMsgDOTAHalloweenHighScoreResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return 0 -} - -func (m *CMsgDOTAHalloweenHighScoreResponse) GetRound() int32 { - if m != nil && m.Round != nil { - return *m.Round - } - return 0 -} - -type CMsgDOTAStorePromoPagesRequest struct { - VersionSeen *uint32 `protobuf:"varint,1,opt,name=version_seen" json:"version_seen,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAStorePromoPagesRequest) Reset() { *m = CMsgDOTAStorePromoPagesRequest{} } -func (m *CMsgDOTAStorePromoPagesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAStorePromoPagesRequest) ProtoMessage() {} -func (*CMsgDOTAStorePromoPagesRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{191} -} - -func (m *CMsgDOTAStorePromoPagesRequest) GetVersionSeen() uint32 { - if m != nil && m.VersionSeen != nil { - return *m.VersionSeen - } - return 0 -} - -type CMsgDOTAStorePromoPagesResponse struct { - Pages []*CMsgDOTAStorePromoPagesResponse_PromoPage `protobuf:"bytes,1,rep,name=pages" json:"pages,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAStorePromoPagesResponse) Reset() { *m = CMsgDOTAStorePromoPagesResponse{} } -func (m *CMsgDOTAStorePromoPagesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAStorePromoPagesResponse) ProtoMessage() {} -func (*CMsgDOTAStorePromoPagesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{192} -} - -func (m *CMsgDOTAStorePromoPagesResponse) GetPages() []*CMsgDOTAStorePromoPagesResponse_PromoPage { - if m != nil { - return m.Pages - } - return nil -} - -type CMsgDOTAStorePromoPagesResponse_PromoPage struct { - PromoId *uint32 `protobuf:"varint,1,opt,name=promo_id" json:"promo_id,omitempty"` - Title *string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` - Url *string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAStorePromoPagesResponse_PromoPage) Reset() { - *m = CMsgDOTAStorePromoPagesResponse_PromoPage{} -} -func (m *CMsgDOTAStorePromoPagesResponse_PromoPage) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAStorePromoPagesResponse_PromoPage) ProtoMessage() {} -func (*CMsgDOTAStorePromoPagesResponse_PromoPage) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{192, 0} -} - -func (m *CMsgDOTAStorePromoPagesResponse_PromoPage) GetPromoId() uint32 { - if m != nil && m.PromoId != nil { - return *m.PromoId - } - return 0 -} - -func (m *CMsgDOTAStorePromoPagesResponse_PromoPage) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *CMsgDOTAStorePromoPagesResponse_PromoPage) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -type CMsgLeagueScheduleBlockTeamInfo struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Logo *uint64 `protobuf:"varint,4,opt,name=logo" json:"logo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeagueScheduleBlockTeamInfo) Reset() { *m = CMsgLeagueScheduleBlockTeamInfo{} } -func (m *CMsgLeagueScheduleBlockTeamInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgLeagueScheduleBlockTeamInfo) ProtoMessage() {} -func (*CMsgLeagueScheduleBlockTeamInfo) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{193} -} - -func (m *CMsgLeagueScheduleBlockTeamInfo) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgLeagueScheduleBlockTeamInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgLeagueScheduleBlockTeamInfo) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -type CMsgLeagueScheduleBlock struct { - BlockId *uint32 `protobuf:"varint,1,opt,name=block_id" json:"block_id,omitempty"` - StartTime *uint32 `protobuf:"varint,2,opt,name=start_time" json:"start_time,omitempty"` - Finals *bool `protobuf:"varint,4,opt,name=finals" json:"finals,omitempty"` - Comment *string `protobuf:"bytes,5,opt,name=comment" json:"comment,omitempty"` - Teams []*CMsgLeagueScheduleBlockTeamInfo `protobuf:"bytes,6,rep,name=teams" json:"teams,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeagueScheduleBlock) Reset() { *m = CMsgLeagueScheduleBlock{} } -func (m *CMsgLeagueScheduleBlock) String() string { return proto.CompactTextString(m) } -func (*CMsgLeagueScheduleBlock) ProtoMessage() {} -func (*CMsgLeagueScheduleBlock) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{194} } - -func (m *CMsgLeagueScheduleBlock) GetBlockId() uint32 { - if m != nil && m.BlockId != nil { - return *m.BlockId - } - return 0 -} - -func (m *CMsgLeagueScheduleBlock) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgLeagueScheduleBlock) GetFinals() bool { - if m != nil && m.Finals != nil { - return *m.Finals - } - return false -} - -func (m *CMsgLeagueScheduleBlock) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment - } - return "" -} - -func (m *CMsgLeagueScheduleBlock) GetTeams() []*CMsgLeagueScheduleBlockTeamInfo { - if m != nil { - return m.Teams - } - return nil -} - -type CMsgDOTALeague struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - Schedule []*CMsgLeagueScheduleBlock `protobuf:"bytes,2,rep,name=schedule" json:"schedule,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeague) Reset() { *m = CMsgDOTALeague{} } -func (m *CMsgDOTALeague) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeague) ProtoMessage() {} -func (*CMsgDOTALeague) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{195} } - -func (m *CMsgDOTALeague) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTALeague) GetSchedule() []*CMsgLeagueScheduleBlock { - if m != nil { - return m.Schedule - } - return nil -} - -type CMsgDOTALeagueScheduleRequest struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeagueScheduleRequest) Reset() { *m = CMsgDOTALeagueScheduleRequest{} } -func (m *CMsgDOTALeagueScheduleRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeagueScheduleRequest) ProtoMessage() {} -func (*CMsgDOTALeagueScheduleRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{196} } - -func (m *CMsgDOTALeagueScheduleRequest) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgDOTALeagueScheduleResponse struct { - League *CMsgDOTALeague `protobuf:"bytes,1,opt,name=league" json:"league,omitempty"` - Eresult *uint32 `protobuf:"varint,2,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeagueScheduleResponse) Reset() { *m = CMsgDOTALeagueScheduleResponse{} } -func (m *CMsgDOTALeagueScheduleResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeagueScheduleResponse) ProtoMessage() {} -func (*CMsgDOTALeagueScheduleResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{197} -} - -const Default_CMsgDOTALeagueScheduleResponse_Eresult uint32 = 2 - -func (m *CMsgDOTALeagueScheduleResponse) GetLeague() *CMsgDOTALeague { - if m != nil { - return m.League - } - return nil -} - -func (m *CMsgDOTALeagueScheduleResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgDOTALeagueScheduleResponse_Eresult -} - -type CMsgDOTALeagueScheduleEdit struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - Schedule *CMsgLeagueScheduleBlock `protobuf:"bytes,2,opt,name=schedule" json:"schedule,omitempty"` - DeleteBlock *bool `protobuf:"varint,3,opt,name=delete_block" json:"delete_block,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeagueScheduleEdit) Reset() { *m = CMsgDOTALeagueScheduleEdit{} } -func (m *CMsgDOTALeagueScheduleEdit) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeagueScheduleEdit) ProtoMessage() {} -func (*CMsgDOTALeagueScheduleEdit) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{198} } - -func (m *CMsgDOTALeagueScheduleEdit) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTALeagueScheduleEdit) GetSchedule() *CMsgLeagueScheduleBlock { - if m != nil { - return m.Schedule - } - return nil -} - -func (m *CMsgDOTALeagueScheduleEdit) GetDeleteBlock() bool { - if m != nil && m.DeleteBlock != nil { - return *m.DeleteBlock - } - return false -} - -type CMsgDOTALeagueScheduleEditResponse struct { - League *CMsgDOTALeague `protobuf:"bytes,1,opt,name=league" json:"league,omitempty"` - Eresult *uint32 `protobuf:"varint,2,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeagueScheduleEditResponse) Reset() { *m = CMsgDOTALeagueScheduleEditResponse{} } -func (m *CMsgDOTALeagueScheduleEditResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeagueScheduleEditResponse) ProtoMessage() {} -func (*CMsgDOTALeagueScheduleEditResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{199} -} - -const Default_CMsgDOTALeagueScheduleEditResponse_Eresult uint32 = 2 - -func (m *CMsgDOTALeagueScheduleEditResponse) GetLeague() *CMsgDOTALeague { - if m != nil { - return m.League - } - return nil -} - -func (m *CMsgDOTALeagueScheduleEditResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgDOTALeagueScheduleEditResponse_Eresult -} - -type CMsgDOTALeaguesInMonthRequest struct { - Month *uint32 `protobuf:"varint,1,opt,name=month" json:"month,omitempty"` - Year *uint32 `protobuf:"varint,2,opt,name=year" json:"year,omitempty"` - Tier *uint32 `protobuf:"varint,3,opt,name=tier" json:"tier,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeaguesInMonthRequest) Reset() { *m = CMsgDOTALeaguesInMonthRequest{} } -func (m *CMsgDOTALeaguesInMonthRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeaguesInMonthRequest) ProtoMessage() {} -func (*CMsgDOTALeaguesInMonthRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{200} } - -func (m *CMsgDOTALeaguesInMonthRequest) GetMonth() uint32 { - if m != nil && m.Month != nil { - return *m.Month - } - return 0 -} - -func (m *CMsgDOTALeaguesInMonthRequest) GetYear() uint32 { - if m != nil && m.Year != nil { - return *m.Year - } - return 0 -} - -func (m *CMsgDOTALeaguesInMonthRequest) GetTier() uint32 { - if m != nil && m.Tier != nil { - return *m.Tier - } - return 0 -} - -type CMsgDOTALeaguesInMonthResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - Month *uint32 `protobuf:"varint,2,opt,name=month" json:"month,omitempty"` - Year *uint32 `protobuf:"varint,3,opt,name=year" json:"year,omitempty"` - Leagues []*CMsgDOTALeague `protobuf:"bytes,4,rep,name=leagues" json:"leagues,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALeaguesInMonthResponse) Reset() { *m = CMsgDOTALeaguesInMonthResponse{} } -func (m *CMsgDOTALeaguesInMonthResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALeaguesInMonthResponse) ProtoMessage() {} -func (*CMsgDOTALeaguesInMonthResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{201} -} - -const Default_CMsgDOTALeaguesInMonthResponse_Eresult uint32 = 2 - -func (m *CMsgDOTALeaguesInMonthResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgDOTALeaguesInMonthResponse_Eresult -} - -func (m *CMsgDOTALeaguesInMonthResponse) GetMonth() uint32 { - if m != nil && m.Month != nil { - return *m.Month - } - return 0 -} - -func (m *CMsgDOTALeaguesInMonthResponse) GetYear() uint32 { - if m != nil && m.Year != nil { - return *m.Year - } - return 0 -} - -func (m *CMsgDOTALeaguesInMonthResponse) GetLeagues() []*CMsgDOTALeague { - if m != nil { - return m.Leagues - } - return nil -} - -type CMsgMatchGroupServerStatus struct { - Ip []uint32 `protobuf:"fixed32,1,rep,packed,name=ip" json:"ip,omitempty"` - Port []uint32 `protobuf:"varint,2,rep,packed,name=port" json:"port,omitempty"` - AutoRegionSelectPingPenalty *int32 `protobuf:"zigzag32,3,opt,name=auto_region_select_ping_penalty" json:"auto_region_select_ping_penalty,omitempty"` - Status *EMatchGroupServerStatus `protobuf:"varint,4,opt,name=status,enum=EMatchGroupServerStatus,def=0" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchGroupServerStatus) Reset() { *m = CMsgMatchGroupServerStatus{} } -func (m *CMsgMatchGroupServerStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchGroupServerStatus) ProtoMessage() {} -func (*CMsgMatchGroupServerStatus) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{202} } - -const Default_CMsgMatchGroupServerStatus_Status EMatchGroupServerStatus = EMatchGroupServerStatus_k_EMatchGroupServerStatus_OK - -func (m *CMsgMatchGroupServerStatus) GetIp() []uint32 { - if m != nil { - return m.Ip - } - return nil -} - -func (m *CMsgMatchGroupServerStatus) GetPort() []uint32 { - if m != nil { - return m.Port - } - return nil -} - -func (m *CMsgMatchGroupServerStatus) GetAutoRegionSelectPingPenalty() int32 { - if m != nil && m.AutoRegionSelectPingPenalty != nil { - return *m.AutoRegionSelectPingPenalty - } - return 0 -} - -func (m *CMsgMatchGroupServerStatus) GetStatus() EMatchGroupServerStatus { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_CMsgMatchGroupServerStatus_Status -} - -type CMsgMatchmakingGroupServerSample struct { - MatchGroups []*CMsgMatchGroupServerStatus `protobuf:"bytes,5,rep,name=match_groups" json:"match_groups,omitempty"` - LegacyServersToPing *uint32 `protobuf:"varint,2,opt,name=legacy_servers_to_ping" json:"legacy_servers_to_ping,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchmakingGroupServerSample) Reset() { *m = CMsgMatchmakingGroupServerSample{} } -func (m *CMsgMatchmakingGroupServerSample) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchmakingGroupServerSample) ProtoMessage() {} -func (*CMsgMatchmakingGroupServerSample) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{203} -} - -func (m *CMsgMatchmakingGroupServerSample) GetMatchGroups() []*CMsgMatchGroupServerStatus { - if m != nil { - return m.MatchGroups - } - return nil -} - -func (m *CMsgMatchmakingGroupServerSample) GetLegacyServersToPing() uint32 { - if m != nil && m.LegacyServersToPing != nil { - return *m.LegacyServersToPing - } - return 0 -} - -type CMsgDOTAMatchmakingStatsRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchmakingStatsRequest) Reset() { *m = CMsgDOTAMatchmakingStatsRequest{} } -func (m *CMsgDOTAMatchmakingStatsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchmakingStatsRequest) ProtoMessage() {} -func (*CMsgDOTAMatchmakingStatsRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{204} -} - -type CMsgDOTAMatchmakingStatsResponse struct { - MatchgroupsVersion *uint32 `protobuf:"varint,1,opt,name=matchgroups_version" json:"matchgroups_version,omitempty"` - SearchingPlayersByGroup []uint32 `protobuf:"varint,2,rep,name=searching_players_by_group" json:"searching_players_by_group,omitempty"` - SearchingPlayersByGroupSource2 []uint32 `protobuf:"varint,7,rep,name=searching_players_by_group_source2" json:"searching_players_by_group_source2,omitempty"` - GameserverSampleSource2 *CMsgMatchmakingGroupServerSample `protobuf:"bytes,6,opt,name=gameserver_sample_source2" json:"gameserver_sample_source2,omitempty"` - LegacyDisabledGroupsSource2 *uint32 `protobuf:"varint,8,opt,name=legacy_disabled_groups_source2" json:"legacy_disabled_groups_source2,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAMatchmakingStatsResponse) Reset() { *m = CMsgDOTAMatchmakingStatsResponse{} } -func (m *CMsgDOTAMatchmakingStatsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAMatchmakingStatsResponse) ProtoMessage() {} -func (*CMsgDOTAMatchmakingStatsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{205} -} - -func (m *CMsgDOTAMatchmakingStatsResponse) GetMatchgroupsVersion() uint32 { - if m != nil && m.MatchgroupsVersion != nil { - return *m.MatchgroupsVersion - } - return 0 -} - -func (m *CMsgDOTAMatchmakingStatsResponse) GetSearchingPlayersByGroup() []uint32 { - if m != nil { - return m.SearchingPlayersByGroup - } - return nil -} - -func (m *CMsgDOTAMatchmakingStatsResponse) GetSearchingPlayersByGroupSource2() []uint32 { - if m != nil { - return m.SearchingPlayersByGroupSource2 - } - return nil -} - -func (m *CMsgDOTAMatchmakingStatsResponse) GetGameserverSampleSource2() *CMsgMatchmakingGroupServerSample { - if m != nil { - return m.GameserverSampleSource2 - } - return nil -} - -func (m *CMsgDOTAMatchmakingStatsResponse) GetLegacyDisabledGroupsSource2() uint32 { - if m != nil && m.LegacyDisabledGroupsSource2 != nil { - return *m.LegacyDisabledGroupsSource2 - } - return 0 -} - -type CMsgDOTASetMatchHistoryAccess struct { - Allow_3RdPartyMatchHistory *bool `protobuf:"varint,1,opt,name=allow_3rd_party_match_history" json:"allow_3rd_party_match_history,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASetMatchHistoryAccess) Reset() { *m = CMsgDOTASetMatchHistoryAccess{} } -func (m *CMsgDOTASetMatchHistoryAccess) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASetMatchHistoryAccess) ProtoMessage() {} -func (*CMsgDOTASetMatchHistoryAccess) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{206} } - -func (m *CMsgDOTASetMatchHistoryAccess) GetAllow_3RdPartyMatchHistory() bool { - if m != nil && m.Allow_3RdPartyMatchHistory != nil { - return *m.Allow_3RdPartyMatchHistory - } - return false -} - -type CMsgDOTASetMatchHistoryAccessResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASetMatchHistoryAccessResponse) Reset() { *m = CMsgDOTASetMatchHistoryAccessResponse{} } -func (m *CMsgDOTASetMatchHistoryAccessResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASetMatchHistoryAccessResponse) ProtoMessage() {} -func (*CMsgDOTASetMatchHistoryAccessResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{207} -} - -const Default_CMsgDOTASetMatchHistoryAccessResponse_Eresult uint32 = 2 - -func (m *CMsgDOTASetMatchHistoryAccessResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgDOTASetMatchHistoryAccessResponse_Eresult -} - -type CMsgDOTANotifyAccountFlagsChange struct { - Accountid *uint32 `protobuf:"varint,1,opt,name=accountid" json:"accountid,omitempty"` - AccountFlags *uint32 `protobuf:"varint,2,opt,name=account_flags" json:"account_flags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTANotifyAccountFlagsChange) Reset() { *m = CMsgDOTANotifyAccountFlagsChange{} } -func (m *CMsgDOTANotifyAccountFlagsChange) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTANotifyAccountFlagsChange) ProtoMessage() {} -func (*CMsgDOTANotifyAccountFlagsChange) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{208} -} - -func (m *CMsgDOTANotifyAccountFlagsChange) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -func (m *CMsgDOTANotifyAccountFlagsChange) GetAccountFlags() uint32 { - if m != nil && m.AccountFlags != nil { - return *m.AccountFlags - } - return 0 -} - -type CMsgDOTASetProfilePrivacy struct { - ProfilePrivate *bool `protobuf:"varint,1,opt,name=profile_private" json:"profile_private,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASetProfilePrivacy) Reset() { *m = CMsgDOTASetProfilePrivacy{} } -func (m *CMsgDOTASetProfilePrivacy) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASetProfilePrivacy) ProtoMessage() {} -func (*CMsgDOTASetProfilePrivacy) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{209} } - -func (m *CMsgDOTASetProfilePrivacy) GetProfilePrivate() bool { - if m != nil && m.ProfilePrivate != nil { - return *m.ProfilePrivate - } - return false -} - -type CMsgDOTASetProfilePrivacyResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASetProfilePrivacyResponse) Reset() { *m = CMsgDOTASetProfilePrivacyResponse{} } -func (m *CMsgDOTASetProfilePrivacyResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASetProfilePrivacyResponse) ProtoMessage() {} -func (*CMsgDOTASetProfilePrivacyResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{210} -} - -func (m *CMsgDOTASetProfilePrivacyResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return 0 -} - -type CMsgUpgradeLeagueItem struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpgradeLeagueItem) Reset() { *m = CMsgUpgradeLeagueItem{} } -func (m *CMsgUpgradeLeagueItem) String() string { return proto.CompactTextString(m) } -func (*CMsgUpgradeLeagueItem) ProtoMessage() {} -func (*CMsgUpgradeLeagueItem) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{211} } - -func (m *CMsgUpgradeLeagueItem) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgUpgradeLeagueItem) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgUpgradeLeagueItemResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpgradeLeagueItemResponse) Reset() { *m = CMsgUpgradeLeagueItemResponse{} } -func (m *CMsgUpgradeLeagueItemResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgUpgradeLeagueItemResponse) ProtoMessage() {} -func (*CMsgUpgradeLeagueItemResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{212} } - -type CMsgGCWatchDownloadedReplay struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - WatchType *DOTA_WatchReplayType `protobuf:"varint,2,opt,name=watch_type,enum=DOTA_WatchReplayType,def=0" json:"watch_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCWatchDownloadedReplay) Reset() { *m = CMsgGCWatchDownloadedReplay{} } -func (m *CMsgGCWatchDownloadedReplay) String() string { return proto.CompactTextString(m) } -func (*CMsgGCWatchDownloadedReplay) ProtoMessage() {} -func (*CMsgGCWatchDownloadedReplay) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{213} } - -const Default_CMsgGCWatchDownloadedReplay_WatchType DOTA_WatchReplayType = DOTA_WatchReplayType_DOTA_WATCH_REPLAY_NORMAL - -func (m *CMsgGCWatchDownloadedReplay) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgGCWatchDownloadedReplay) GetWatchType() DOTA_WatchReplayType { - if m != nil && m.WatchType != nil { - return *m.WatchType - } - return Default_CMsgGCWatchDownloadedReplay_WatchType -} - -type CMsgSetMapLocationState struct { - LocationId *int32 `protobuf:"varint,1,opt,name=location_id" json:"location_id,omitempty"` - Completed *bool `protobuf:"varint,2,opt,name=completed" json:"completed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetMapLocationState) Reset() { *m = CMsgSetMapLocationState{} } -func (m *CMsgSetMapLocationState) String() string { return proto.CompactTextString(m) } -func (*CMsgSetMapLocationState) ProtoMessage() {} -func (*CMsgSetMapLocationState) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{214} } - -func (m *CMsgSetMapLocationState) GetLocationId() int32 { - if m != nil && m.LocationId != nil { - return *m.LocationId - } - return 0 -} - -func (m *CMsgSetMapLocationState) GetCompleted() bool { - if m != nil && m.Completed != nil { - return *m.Completed - } - return false -} - -type CMsgSetMapLocationStateResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetMapLocationStateResponse) Reset() { *m = CMsgSetMapLocationStateResponse{} } -func (m *CMsgSetMapLocationStateResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgSetMapLocationStateResponse) ProtoMessage() {} -func (*CMsgSetMapLocationStateResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{215} -} - -const Default_CMsgSetMapLocationStateResponse_Eresult uint32 = 2 - -func (m *CMsgSetMapLocationStateResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgSetMapLocationStateResponse_Eresult -} - -type CMsgResetMapLocations struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgResetMapLocations) Reset() { *m = CMsgResetMapLocations{} } -func (m *CMsgResetMapLocations) String() string { return proto.CompactTextString(m) } -func (*CMsgResetMapLocations) ProtoMessage() {} -func (*CMsgResetMapLocations) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{216} } - -type CMsgResetMapLocationsResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgResetMapLocationsResponse) Reset() { *m = CMsgResetMapLocationsResponse{} } -func (m *CMsgResetMapLocationsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgResetMapLocationsResponse) ProtoMessage() {} -func (*CMsgResetMapLocationsResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{217} } - -const Default_CMsgResetMapLocationsResponse_Eresult uint32 = 2 - -func (m *CMsgResetMapLocationsResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgResetMapLocationsResponse_Eresult -} - -type CMsgRefreshPartnerAccountLink struct { - PartnerType *int32 `protobuf:"varint,1,opt,name=partner_type" json:"partner_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRefreshPartnerAccountLink) Reset() { *m = CMsgRefreshPartnerAccountLink{} } -func (m *CMsgRefreshPartnerAccountLink) String() string { return proto.CompactTextString(m) } -func (*CMsgRefreshPartnerAccountLink) ProtoMessage() {} -func (*CMsgRefreshPartnerAccountLink) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{218} } - -func (m *CMsgRefreshPartnerAccountLink) GetPartnerType() int32 { - if m != nil && m.PartnerType != nil { - return *m.PartnerType - } - return 0 -} - -type CMsgClientsRejoinChatChannels struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientsRejoinChatChannels) Reset() { *m = CMsgClientsRejoinChatChannels{} } -func (m *CMsgClientsRejoinChatChannels) String() string { return proto.CompactTextString(m) } -func (*CMsgClientsRejoinChatChannels) ProtoMessage() {} -func (*CMsgClientsRejoinChatChannels) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{219} } - -type CMsgDOTASendFriendRecruits struct { - Recruits []uint32 `protobuf:"varint,1,rep,name=recruits" json:"recruits,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASendFriendRecruits) Reset() { *m = CMsgDOTASendFriendRecruits{} } -func (m *CMsgDOTASendFriendRecruits) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASendFriendRecruits) ProtoMessage() {} -func (*CMsgDOTASendFriendRecruits) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{220} } - -func (m *CMsgDOTASendFriendRecruits) GetRecruits() []uint32 { - if m != nil { - return m.Recruits - } - return nil -} - -type CMsgDOTAFriendRecruitsRequest struct { - AccountIds []uint32 `protobuf:"varint,1,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFriendRecruitsRequest) Reset() { *m = CMsgDOTAFriendRecruitsRequest{} } -func (m *CMsgDOTAFriendRecruitsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFriendRecruitsRequest) ProtoMessage() {} -func (*CMsgDOTAFriendRecruitsRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{221} } - -func (m *CMsgDOTAFriendRecruitsRequest) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgDOTAFriendRecruitsResponse struct { - Result *CMsgDOTAFriendRecruitsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFriendRecruitsResponse_EResult,def=0" json:"result,omitempty"` - Recruits []*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus `protobuf:"bytes,2,rep,name=recruits" json:"recruits,omitempty"` - Recruiters []*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus `protobuf:"bytes,3,rep,name=recruiters" json:"recruiters,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFriendRecruitsResponse) Reset() { *m = CMsgDOTAFriendRecruitsResponse{} } -func (m *CMsgDOTAFriendRecruitsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFriendRecruitsResponse) ProtoMessage() {} -func (*CMsgDOTAFriendRecruitsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{222} -} - -const Default_CMsgDOTAFriendRecruitsResponse_Result CMsgDOTAFriendRecruitsResponse_EResult = CMsgDOTAFriendRecruitsResponse_SUCCESS - -func (m *CMsgDOTAFriendRecruitsResponse) GetResult() CMsgDOTAFriendRecruitsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFriendRecruitsResponse_Result -} - -func (m *CMsgDOTAFriendRecruitsResponse) GetRecruits() []*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus { - if m != nil { - return m.Recruits - } - return nil -} - -func (m *CMsgDOTAFriendRecruitsResponse) GetRecruiters() []*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus { - if m != nil { - return m.Recruiters - } - return nil -} - -type CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Status *uint32 `protobuf:"varint,2,opt,name=status" json:"status,omitempty"` - LevelsEarned *uint32 `protobuf:"varint,3,opt,name=levels_earned" json:"levels_earned,omitempty"` - Bonus *bool `protobuf:"varint,4,opt,name=bonus" json:"bonus,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) Reset() { - *m = CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus{} -} -func (m *CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) ProtoMessage() {} -func (*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{222, 0} -} - -func (m *CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -func (m *CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) GetLevelsEarned() uint32 { - if m != nil && m.LevelsEarned != nil { - return *m.LevelsEarned - } - return 0 -} - -func (m *CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus) GetBonus() bool { - if m != nil && m.Bonus != nil { - return *m.Bonus - } - return false -} - -type CMsgDOTAFriendRecruitInviteAcceptDecline struct { - Accepted *bool `protobuf:"varint,1,opt,name=accepted" json:"accepted,omitempty"` - AccountId *uint32 `protobuf:"varint,2,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFriendRecruitInviteAcceptDecline) Reset() { - *m = CMsgDOTAFriendRecruitInviteAcceptDecline{} -} -func (m *CMsgDOTAFriendRecruitInviteAcceptDecline) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFriendRecruitInviteAcceptDecline) ProtoMessage() {} -func (*CMsgDOTAFriendRecruitInviteAcceptDecline) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{223} -} - -func (m *CMsgDOTAFriendRecruitInviteAcceptDecline) GetAccepted() bool { - if m != nil && m.Accepted != nil { - return *m.Accepted - } - return false -} - -func (m *CMsgDOTAFriendRecruitInviteAcceptDecline) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgRequestLeaguePrizePool struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestLeaguePrizePool) Reset() { *m = CMsgRequestLeaguePrizePool{} } -func (m *CMsgRequestLeaguePrizePool) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestLeaguePrizePool) ProtoMessage() {} -func (*CMsgRequestLeaguePrizePool) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{224} } - -func (m *CMsgRequestLeaguePrizePool) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgRequestLeaguePrizePoolResponse struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - PrizePool *uint32 `protobuf:"varint,2,opt,name=prize_pool" json:"prize_pool,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestLeaguePrizePoolResponse) Reset() { *m = CMsgRequestLeaguePrizePoolResponse{} } -func (m *CMsgRequestLeaguePrizePoolResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestLeaguePrizePoolResponse) ProtoMessage() {} -func (*CMsgRequestLeaguePrizePoolResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{225} -} - -func (m *CMsgRequestLeaguePrizePoolResponse) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgRequestLeaguePrizePoolResponse) GetPrizePool() uint32 { - if m != nil && m.PrizePool != nil { - return *m.PrizePool - } - return 0 -} - -type CMsgGCGetHeroStandings struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCGetHeroStandings) Reset() { *m = CMsgGCGetHeroStandings{} } -func (m *CMsgGCGetHeroStandings) String() string { return proto.CompactTextString(m) } -func (*CMsgGCGetHeroStandings) ProtoMessage() {} -func (*CMsgGCGetHeroStandings) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{226} } - -type CMsgGCGetHeroStandingsResponse struct { - Standings []*CMsgGCGetHeroStandingsResponse_Hero `protobuf:"bytes,1,rep,name=standings" json:"standings,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCGetHeroStandingsResponse) Reset() { *m = CMsgGCGetHeroStandingsResponse{} } -func (m *CMsgGCGetHeroStandingsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCGetHeroStandingsResponse) ProtoMessage() {} -func (*CMsgGCGetHeroStandingsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{227} -} - -func (m *CMsgGCGetHeroStandingsResponse) GetStandings() []*CMsgGCGetHeroStandingsResponse_Hero { - if m != nil { - return m.Standings - } - return nil -} - -type CMsgGCGetHeroStandingsResponse_Hero struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - Wins *uint32 `protobuf:"varint,2,opt,name=wins" json:"wins,omitempty"` - Losses *uint32 `protobuf:"varint,3,opt,name=losses" json:"losses,omitempty"` - WinStreak *uint32 `protobuf:"varint,4,opt,name=win_streak" json:"win_streak,omitempty"` - BestWinStreak *uint32 `protobuf:"varint,5,opt,name=best_win_streak" json:"best_win_streak,omitempty"` - AvgKills *float32 `protobuf:"fixed32,6,opt,name=avg_kills" json:"avg_kills,omitempty"` - AvgDeaths *float32 `protobuf:"fixed32,7,opt,name=avg_deaths" json:"avg_deaths,omitempty"` - AvgAssists *float32 `protobuf:"fixed32,8,opt,name=avg_assists" json:"avg_assists,omitempty"` - AvgGpm *float32 `protobuf:"fixed32,9,opt,name=avg_gpm" json:"avg_gpm,omitempty"` - AvgXpm *float32 `protobuf:"fixed32,10,opt,name=avg_xpm" json:"avg_xpm,omitempty"` - BestKills *uint32 `protobuf:"varint,11,opt,name=best_kills" json:"best_kills,omitempty"` - BestAssists *uint32 `protobuf:"varint,12,opt,name=best_assists" json:"best_assists,omitempty"` - BestGpm *uint32 `protobuf:"varint,13,opt,name=best_gpm" json:"best_gpm,omitempty"` - BestXpm *uint32 `protobuf:"varint,14,opt,name=best_xpm" json:"best_xpm,omitempty"` - Performance *float32 `protobuf:"fixed32,15,opt,name=performance" json:"performance,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) Reset() { *m = CMsgGCGetHeroStandingsResponse_Hero{} } -func (m *CMsgGCGetHeroStandingsResponse_Hero) String() string { return proto.CompactTextString(m) } -func (*CMsgGCGetHeroStandingsResponse_Hero) ProtoMessage() {} -func (*CMsgGCGetHeroStandingsResponse_Hero) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{227, 0} -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetWins() uint32 { - if m != nil && m.Wins != nil { - return *m.Wins - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetLosses() uint32 { - if m != nil && m.Losses != nil { - return *m.Losses - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetWinStreak() uint32 { - if m != nil && m.WinStreak != nil { - return *m.WinStreak - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetBestWinStreak() uint32 { - if m != nil && m.BestWinStreak != nil { - return *m.BestWinStreak - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetAvgKills() float32 { - if m != nil && m.AvgKills != nil { - return *m.AvgKills - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetAvgDeaths() float32 { - if m != nil && m.AvgDeaths != nil { - return *m.AvgDeaths - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetAvgAssists() float32 { - if m != nil && m.AvgAssists != nil { - return *m.AvgAssists - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetAvgGpm() float32 { - if m != nil && m.AvgGpm != nil { - return *m.AvgGpm - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetAvgXpm() float32 { - if m != nil && m.AvgXpm != nil { - return *m.AvgXpm - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetBestKills() uint32 { - if m != nil && m.BestKills != nil { - return *m.BestKills - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetBestAssists() uint32 { - if m != nil && m.BestAssists != nil { - return *m.BestAssists - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetBestGpm() uint32 { - if m != nil && m.BestGpm != nil { - return *m.BestGpm - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetBestXpm() uint32 { - if m != nil && m.BestXpm != nil { - return *m.BestXpm - } - return 0 -} - -func (m *CMsgGCGetHeroStandingsResponse_Hero) GetPerformance() float32 { - if m != nil && m.Performance != nil { - return *m.Performance - } - return 0 -} - -type CMsgGCItemEditorReservationsRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReservationsRequest) Reset() { *m = CMsgGCItemEditorReservationsRequest{} } -func (m *CMsgGCItemEditorReservationsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorReservationsRequest) ProtoMessage() {} -func (*CMsgGCItemEditorReservationsRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{228} -} - -type CMsgGCItemEditorReservation struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReservation) Reset() { *m = CMsgGCItemEditorReservation{} } -func (m *CMsgGCItemEditorReservation) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorReservation) ProtoMessage() {} -func (*CMsgGCItemEditorReservation) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{229} } - -func (m *CMsgGCItemEditorReservation) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgGCItemEditorReservation) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type CMsgGCItemEditorReservationsResponse struct { - Reservations []*CMsgGCItemEditorReservation `protobuf:"bytes,1,rep,name=reservations" json:"reservations,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReservationsResponse) Reset() { *m = CMsgGCItemEditorReservationsResponse{} } -func (m *CMsgGCItemEditorReservationsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorReservationsResponse) ProtoMessage() {} -func (*CMsgGCItemEditorReservationsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{230} -} - -func (m *CMsgGCItemEditorReservationsResponse) GetReservations() []*CMsgGCItemEditorReservation { - if m != nil { - return m.Reservations - } - return nil -} - -type CMsgGCItemEditorReserveItemDef struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReserveItemDef) Reset() { *m = CMsgGCItemEditorReserveItemDef{} } -func (m *CMsgGCItemEditorReserveItemDef) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorReserveItemDef) ProtoMessage() {} -func (*CMsgGCItemEditorReserveItemDef) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{231} -} - -func (m *CMsgGCItemEditorReserveItemDef) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgGCItemEditorReserveItemDef) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username - } - return "" -} - -type CMsgGCItemEditorReserveItemDefResponse struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` - Result *uint32 `protobuf:"varint,3,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReserveItemDefResponse) Reset() { - *m = CMsgGCItemEditorReserveItemDefResponse{} -} -func (m *CMsgGCItemEditorReserveItemDefResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorReserveItemDefResponse) ProtoMessage() {} -func (*CMsgGCItemEditorReserveItemDefResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{232} -} - -func (m *CMsgGCItemEditorReserveItemDefResponse) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgGCItemEditorReserveItemDefResponse) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username - } - return "" -} - -func (m *CMsgGCItemEditorReserveItemDefResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgGCItemEditorReleaseReservation struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReleaseReservation) Reset() { *m = CMsgGCItemEditorReleaseReservation{} } -func (m *CMsgGCItemEditorReleaseReservation) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorReleaseReservation) ProtoMessage() {} -func (*CMsgGCItemEditorReleaseReservation) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{233} -} - -func (m *CMsgGCItemEditorReleaseReservation) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgGCItemEditorReleaseReservation) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username - } - return "" -} - -type CMsgGCItemEditorReleaseReservationResponse struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Released *bool `protobuf:"varint,2,opt,name=released" json:"released,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorReleaseReservationResponse) Reset() { - *m = CMsgGCItemEditorReleaseReservationResponse{} -} -func (m *CMsgGCItemEditorReleaseReservationResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCItemEditorReleaseReservationResponse) ProtoMessage() {} -func (*CMsgGCItemEditorReleaseReservationResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{234} -} - -func (m *CMsgGCItemEditorReleaseReservationResponse) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgGCItemEditorReleaseReservationResponse) GetReleased() bool { - if m != nil && m.Released != nil { - return *m.Released - } - return false -} - -type CMsgGCItemEditorRequestLeagueInfo struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorRequestLeagueInfo) Reset() { *m = CMsgGCItemEditorRequestLeagueInfo{} } -func (m *CMsgGCItemEditorRequestLeagueInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorRequestLeagueInfo) ProtoMessage() {} -func (*CMsgGCItemEditorRequestLeagueInfo) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{235} -} - -func (m *CMsgGCItemEditorRequestLeagueInfo) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgGCItemEditorLeagueInfoResponse struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - LeagueName *string `protobuf:"bytes,2,opt,name=league_name" json:"league_name,omitempty"` - LeagueDesc *string `protobuf:"bytes,3,opt,name=league_desc" json:"league_desc,omitempty"` - LeagueUrl *string `protobuf:"bytes,4,opt,name=league_url" json:"league_url,omitempty"` - RevenueUrl *string `protobuf:"bytes,5,opt,name=revenue_url" json:"revenue_url,omitempty"` - Tier *uint32 `protobuf:"varint,6,opt,name=tier" json:"tier,omitempty"` - Location *uint32 `protobuf:"varint,7,opt,name=location" json:"location,omitempty"` - Result *uint32 `protobuf:"varint,8,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) Reset() { *m = CMsgGCItemEditorLeagueInfoResponse{} } -func (m *CMsgGCItemEditorLeagueInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemEditorLeagueInfoResponse) ProtoMessage() {} -func (*CMsgGCItemEditorLeagueInfoResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{236} -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetLeagueName() string { - if m != nil && m.LeagueName != nil { - return *m.LeagueName - } - return "" -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetLeagueDesc() string { - if m != nil && m.LeagueDesc != nil { - return *m.LeagueDesc - } - return "" -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetLeagueUrl() string { - if m != nil && m.LeagueUrl != nil { - return *m.LeagueUrl - } - return "" -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetRevenueUrl() string { - if m != nil && m.RevenueUrl != nil { - return *m.RevenueUrl - } - return "" -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetTier() uint32 { - if m != nil && m.Tier != nil { - return *m.Tier - } - return 0 -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetLocation() uint32 { - if m != nil && m.Location != nil { - return *m.Location - } - return 0 -} - -func (m *CMsgGCItemEditorLeagueInfoResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgDOTARewardTutorialPrizes struct { - LocationId *uint32 `protobuf:"varint,1,opt,name=location_id" json:"location_id,omitempty"` - TrackingOnly *bool `protobuf:"varint,2,opt,name=tracking_only" json:"tracking_only,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARewardTutorialPrizes) Reset() { *m = CMsgDOTARewardTutorialPrizes{} } -func (m *CMsgDOTARewardTutorialPrizes) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARewardTutorialPrizes) ProtoMessage() {} -func (*CMsgDOTARewardTutorialPrizes) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{237} } - -func (m *CMsgDOTARewardTutorialPrizes) GetLocationId() uint32 { - if m != nil && m.LocationId != nil { - return *m.LocationId - } - return 0 -} - -func (m *CMsgDOTARewardTutorialPrizes) GetTrackingOnly() bool { - if m != nil && m.TrackingOnly != nil { - return *m.TrackingOnly - } - return false -} - -type CMsgDOTALastHitChallengeHighScorePost struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - HighScore *uint32 `protobuf:"varint,2,opt,name=high_score" json:"high_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALastHitChallengeHighScorePost) Reset() { *m = CMsgDOTALastHitChallengeHighScorePost{} } -func (m *CMsgDOTALastHitChallengeHighScorePost) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALastHitChallengeHighScorePost) ProtoMessage() {} -func (*CMsgDOTALastHitChallengeHighScorePost) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{238} -} - -func (m *CMsgDOTALastHitChallengeHighScorePost) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTALastHitChallengeHighScorePost) GetHighScore() uint32 { - if m != nil && m.HighScore != nil { - return *m.HighScore - } - return 0 -} - -type CMsgDOTALastHitChallengeHighScoreRequest struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALastHitChallengeHighScoreRequest) Reset() { - *m = CMsgDOTALastHitChallengeHighScoreRequest{} -} -func (m *CMsgDOTALastHitChallengeHighScoreRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALastHitChallengeHighScoreRequest) ProtoMessage() {} -func (*CMsgDOTALastHitChallengeHighScoreRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{239} -} - -func (m *CMsgDOTALastHitChallengeHighScoreRequest) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgDOTALastHitChallengeHighScoreResponse struct { - Score *uint32 `protobuf:"varint,1,opt,name=score" json:"score,omitempty"` - Eresult *uint32 `protobuf:"varint,2,opt,name=eresult" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALastHitChallengeHighScoreResponse) Reset() { - *m = CMsgDOTALastHitChallengeHighScoreResponse{} -} -func (m *CMsgDOTALastHitChallengeHighScoreResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALastHitChallengeHighScoreResponse) ProtoMessage() {} -func (*CMsgDOTALastHitChallengeHighScoreResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{240} -} - -func (m *CMsgDOTALastHitChallengeHighScoreResponse) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CMsgDOTALastHitChallengeHighScoreResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return 0 -} - -type CMsgFlipLobbyTeams struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgFlipLobbyTeams) Reset() { *m = CMsgFlipLobbyTeams{} } -func (m *CMsgFlipLobbyTeams) String() string { return proto.CompactTextString(m) } -func (*CMsgFlipLobbyTeams) ProtoMessage() {} -func (*CMsgFlipLobbyTeams) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{241} } - -type CMsgPresentedClientTerminateDlg struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPresentedClientTerminateDlg) Reset() { *m = CMsgPresentedClientTerminateDlg{} } -func (m *CMsgPresentedClientTerminateDlg) String() string { return proto.CompactTextString(m) } -func (*CMsgPresentedClientTerminateDlg) ProtoMessage() {} -func (*CMsgPresentedClientTerminateDlg) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{242} -} - -type CMsgGCLobbyUpdateBroadcastChannelInfo struct { - ChannelId *uint32 `protobuf:"varint,1,opt,name=channel_id" json:"channel_id,omitempty"` - CountryCode *string `protobuf:"bytes,2,opt,name=country_code" json:"country_code,omitempty"` - Description *string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - LanguageCode *string `protobuf:"bytes,4,opt,name=language_code" json:"language_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCLobbyUpdateBroadcastChannelInfo) Reset() { *m = CMsgGCLobbyUpdateBroadcastChannelInfo{} } -func (m *CMsgGCLobbyUpdateBroadcastChannelInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCLobbyUpdateBroadcastChannelInfo) ProtoMessage() {} -func (*CMsgGCLobbyUpdateBroadcastChannelInfo) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{243} -} - -func (m *CMsgGCLobbyUpdateBroadcastChannelInfo) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgGCLobbyUpdateBroadcastChannelInfo) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgGCLobbyUpdateBroadcastChannelInfo) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CMsgGCLobbyUpdateBroadcastChannelInfo) GetLanguageCode() string { - if m != nil && m.LanguageCode != nil { - return *m.LanguageCode - } - return "" -} - -type CMsgDOTARedeemEventPrize struct { - PrizeId *uint32 `protobuf:"varint,1,opt,name=prize_id" json:"prize_id,omitempty"` - EventId *uint32 `protobuf:"varint,2,opt,name=event_id" json:"event_id,omitempty"` - Quantity *uint32 `protobuf:"varint,3,opt,name=quantity,def=1" json:"quantity,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARedeemEventPrize) Reset() { *m = CMsgDOTARedeemEventPrize{} } -func (m *CMsgDOTARedeemEventPrize) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARedeemEventPrize) ProtoMessage() {} -func (*CMsgDOTARedeemEventPrize) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{244} } - -const Default_CMsgDOTARedeemEventPrize_Quantity uint32 = 1 - -func (m *CMsgDOTARedeemEventPrize) GetPrizeId() uint32 { - if m != nil && m.PrizeId != nil { - return *m.PrizeId - } - return 0 -} - -func (m *CMsgDOTARedeemEventPrize) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgDOTARedeemEventPrize) GetQuantity() uint32 { - if m != nil && m.Quantity != nil { - return *m.Quantity - } - return Default_CMsgDOTARedeemEventPrize_Quantity -} - -type CMsgDOTARedeemEventPrizeResponse struct { - Result *CMsgDOTARedeemEventPrizeResponse_ResultCode `protobuf:"varint,1,opt,name=result,enum=CMsgDOTARedeemEventPrizeResponse_ResultCode,def=0" json:"result,omitempty"` - RemainingPoints *uint32 `protobuf:"varint,2,opt,name=remaining_points" json:"remaining_points,omitempty"` - RemainingPremiumPoints *uint32 `protobuf:"varint,3,opt,name=remaining_premium_points" json:"remaining_premium_points,omitempty"` - EventId *uint32 `protobuf:"varint,4,opt,name=event_id" json:"event_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARedeemEventPrizeResponse) Reset() { *m = CMsgDOTARedeemEventPrizeResponse{} } -func (m *CMsgDOTARedeemEventPrizeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARedeemEventPrizeResponse) ProtoMessage() {} -func (*CMsgDOTARedeemEventPrizeResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{245} -} - -const Default_CMsgDOTARedeemEventPrizeResponse_Result CMsgDOTARedeemEventPrizeResponse_ResultCode = CMsgDOTARedeemEventPrizeResponse_Success - -func (m *CMsgDOTARedeemEventPrizeResponse) GetResult() CMsgDOTARedeemEventPrizeResponse_ResultCode { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTARedeemEventPrizeResponse_Result -} - -func (m *CMsgDOTARedeemEventPrizeResponse) GetRemainingPoints() uint32 { - if m != nil && m.RemainingPoints != nil { - return *m.RemainingPoints - } - return 0 -} - -func (m *CMsgDOTARedeemEventPrizeResponse) GetRemainingPremiumPoints() uint32 { - if m != nil && m.RemainingPremiumPoints != nil { - return *m.RemainingPremiumPoints - } - return 0 -} - -func (m *CMsgDOTARedeemEventPrizeResponse) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -type CMsgDOTAGetEventPoints struct { - EventId *uint32 `protobuf:"varint,1,opt,name=event_id" json:"event_id,omitempty"` - AccountId *uint32 `protobuf:"varint,2,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGetEventPoints) Reset() { *m = CMsgDOTAGetEventPoints{} } -func (m *CMsgDOTAGetEventPoints) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGetEventPoints) ProtoMessage() {} -func (*CMsgDOTAGetEventPoints) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{246} } - -func (m *CMsgDOTAGetEventPoints) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgDOTAGetEventPoints) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgDOTAGetEventPointsResponse struct { - TotalPoints *uint32 `protobuf:"varint,1,opt,name=total_points" json:"total_points,omitempty"` - TotalPremiumPoints *uint32 `protobuf:"varint,2,opt,name=total_premium_points" json:"total_premium_points,omitempty"` - EventId *uint32 `protobuf:"varint,3,opt,name=event_id" json:"event_id,omitempty"` - Points *uint32 `protobuf:"varint,4,opt,name=points" json:"points,omitempty"` - PremiumPoints *uint32 `protobuf:"varint,5,opt,name=premium_points" json:"premium_points,omitempty"` - CompletedActions []*CMsgDOTAGetEventPointsResponse_Action `protobuf:"bytes,6,rep,name=completed_actions" json:"completed_actions,omitempty"` - AccountId *uint32 `protobuf:"varint,7,opt,name=account_id" json:"account_id,omitempty"` - Owned *bool `protobuf:"varint,8,opt,name=owned" json:"owned,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGetEventPointsResponse) Reset() { *m = CMsgDOTAGetEventPointsResponse{} } -func (m *CMsgDOTAGetEventPointsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGetEventPointsResponse) ProtoMessage() {} -func (*CMsgDOTAGetEventPointsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{247} -} - -func (m *CMsgDOTAGetEventPointsResponse) GetTotalPoints() uint32 { - if m != nil && m.TotalPoints != nil { - return *m.TotalPoints - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse) GetTotalPremiumPoints() uint32 { - if m != nil && m.TotalPremiumPoints != nil { - return *m.TotalPremiumPoints - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse) GetPoints() uint32 { - if m != nil && m.Points != nil { - return *m.Points - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse) GetPremiumPoints() uint32 { - if m != nil && m.PremiumPoints != nil { - return *m.PremiumPoints - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse) GetCompletedActions() []*CMsgDOTAGetEventPointsResponse_Action { - if m != nil { - return m.CompletedActions - } - return nil -} - -func (m *CMsgDOTAGetEventPointsResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse) GetOwned() bool { - if m != nil && m.Owned != nil { - return *m.Owned - } - return false -} - -type CMsgDOTAGetEventPointsResponse_Action struct { - ActionId *uint32 `protobuf:"varint,1,opt,name=action_id" json:"action_id,omitempty"` - TimesCompleted *uint32 `protobuf:"varint,2,opt,name=times_completed,def=1" json:"times_completed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGetEventPointsResponse_Action) Reset() { *m = CMsgDOTAGetEventPointsResponse_Action{} } -func (m *CMsgDOTAGetEventPointsResponse_Action) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGetEventPointsResponse_Action) ProtoMessage() {} -func (*CMsgDOTAGetEventPointsResponse_Action) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{247, 0} -} - -const Default_CMsgDOTAGetEventPointsResponse_Action_TimesCompleted uint32 = 1 - -func (m *CMsgDOTAGetEventPointsResponse_Action) GetActionId() uint32 { - if m != nil && m.ActionId != nil { - return *m.ActionId - } - return 0 -} - -func (m *CMsgDOTAGetEventPointsResponse_Action) GetTimesCompleted() uint32 { - if m != nil && m.TimesCompleted != nil { - return *m.TimesCompleted - } - return Default_CMsgDOTAGetEventPointsResponse_Action_TimesCompleted -} - -type CMsgDOTALiveLeagueGameUpdate struct { - LiveLeagueGames *uint32 `protobuf:"varint,1,opt,name=live_league_games" json:"live_league_games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALiveLeagueGameUpdate) Reset() { *m = CMsgDOTALiveLeagueGameUpdate{} } -func (m *CMsgDOTALiveLeagueGameUpdate) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALiveLeagueGameUpdate) ProtoMessage() {} -func (*CMsgDOTALiveLeagueGameUpdate) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{248} } - -func (m *CMsgDOTALiveLeagueGameUpdate) GetLiveLeagueGames() uint32 { - if m != nil && m.LiveLeagueGames != nil { - return *m.LiveLeagueGames - } - return 0 -} - -type CMsgDOTACompendiumSelection struct { - SelectionIndex *uint32 `protobuf:"varint,1,opt,name=selection_index" json:"selection_index,omitempty"` - Selection *uint32 `protobuf:"varint,2,opt,name=selection" json:"selection,omitempty"` - Leagueid *uint32 `protobuf:"varint,3,opt,name=leagueid" json:"leagueid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACompendiumSelection) Reset() { *m = CMsgDOTACompendiumSelection{} } -func (m *CMsgDOTACompendiumSelection) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACompendiumSelection) ProtoMessage() {} -func (*CMsgDOTACompendiumSelection) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{249} } - -func (m *CMsgDOTACompendiumSelection) GetSelectionIndex() uint32 { - if m != nil && m.SelectionIndex != nil { - return *m.SelectionIndex - } - return 0 -} - -func (m *CMsgDOTACompendiumSelection) GetSelection() uint32 { - if m != nil && m.Selection != nil { - return *m.Selection - } - return 0 -} - -func (m *CMsgDOTACompendiumSelection) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -type CMsgDOTACompendiumSelectionResponse struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - ExtraSelections []*CMsgDOTACompendiumSelection `protobuf:"bytes,2,rep,name=extra_selections" json:"extra_selections,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACompendiumSelectionResponse) Reset() { *m = CMsgDOTACompendiumSelectionResponse{} } -func (m *CMsgDOTACompendiumSelectionResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACompendiumSelectionResponse) ProtoMessage() {} -func (*CMsgDOTACompendiumSelectionResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{250} -} - -const Default_CMsgDOTACompendiumSelectionResponse_Eresult uint32 = 2 - -func (m *CMsgDOTACompendiumSelectionResponse) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgDOTACompendiumSelectionResponse_Eresult -} - -func (m *CMsgDOTACompendiumSelectionResponse) GetExtraSelections() []*CMsgDOTACompendiumSelection { - if m != nil { - return m.ExtraSelections - } - return nil -} - -type CMsgDOTACompendiumData struct { - Selections []*CMsgDOTACompendiumSelection `protobuf:"bytes,1,rep,name=selections" json:"selections,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACompendiumData) Reset() { *m = CMsgDOTACompendiumData{} } -func (m *CMsgDOTACompendiumData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACompendiumData) ProtoMessage() {} -func (*CMsgDOTACompendiumData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{251} } - -func (m *CMsgDOTACompendiumData) GetSelections() []*CMsgDOTACompendiumSelection { - if m != nil { - return m.Selections - } - return nil -} - -type CMsgDOTACompendiumDataRequest struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Leagueid *uint32 `protobuf:"varint,2,opt,name=leagueid" json:"leagueid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACompendiumDataRequest) Reset() { *m = CMsgDOTACompendiumDataRequest{} } -func (m *CMsgDOTACompendiumDataRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACompendiumDataRequest) ProtoMessage() {} -func (*CMsgDOTACompendiumDataRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{252} } - -func (m *CMsgDOTACompendiumDataRequest) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTACompendiumDataRequest) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -type CMsgDOTACompendiumDataResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Leagueid *uint32 `protobuf:"varint,2,opt,name=leagueid" json:"leagueid,omitempty"` - Result *uint32 `protobuf:"varint,3,opt,name=result,def=2" json:"result,omitempty"` - CompendiumData *CMsgDOTACompendiumData `protobuf:"bytes,4,opt,name=compendium_data" json:"compendium_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACompendiumDataResponse) Reset() { *m = CMsgDOTACompendiumDataResponse{} } -func (m *CMsgDOTACompendiumDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACompendiumDataResponse) ProtoMessage() {} -func (*CMsgDOTACompendiumDataResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{253} -} - -const Default_CMsgDOTACompendiumDataResponse_Result uint32 = 2 - -func (m *CMsgDOTACompendiumDataResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTACompendiumDataResponse) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -func (m *CMsgDOTACompendiumDataResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTACompendiumDataResponse_Result -} - -func (m *CMsgDOTACompendiumDataResponse) GetCompendiumData() *CMsgDOTACompendiumData { - if m != nil { - return m.CompendiumData - } - return nil -} - -type CMsgDOTAGetPlayerMatchHistory struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - StartAtMatchId *uint64 `protobuf:"varint,2,opt,name=start_at_match_id" json:"start_at_match_id,omitempty"` - MatchesRequested *uint32 `protobuf:"varint,3,opt,name=matches_requested" json:"matches_requested,omitempty"` - HeroId *uint32 `protobuf:"varint,4,opt,name=hero_id" json:"hero_id,omitempty"` - RequestId *uint32 `protobuf:"varint,5,opt,name=request_id" json:"request_id,omitempty"` - IncludePracticeMatches *bool `protobuf:"varint,7,opt,name=include_practice_matches" json:"include_practice_matches,omitempty"` - IncludeCustomGames *bool `protobuf:"varint,8,opt,name=include_custom_games" json:"include_custom_games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGetPlayerMatchHistory) Reset() { *m = CMsgDOTAGetPlayerMatchHistory{} } -func (m *CMsgDOTAGetPlayerMatchHistory) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGetPlayerMatchHistory) ProtoMessage() {} -func (*CMsgDOTAGetPlayerMatchHistory) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{254} } - -func (m *CMsgDOTAGetPlayerMatchHistory) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistory) GetStartAtMatchId() uint64 { - if m != nil && m.StartAtMatchId != nil { - return *m.StartAtMatchId - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistory) GetMatchesRequested() uint32 { - if m != nil && m.MatchesRequested != nil { - return *m.MatchesRequested - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistory) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistory) GetRequestId() uint32 { - if m != nil && m.RequestId != nil { - return *m.RequestId - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistory) GetIncludePracticeMatches() bool { - if m != nil && m.IncludePracticeMatches != nil { - return *m.IncludePracticeMatches - } - return false -} - -func (m *CMsgDOTAGetPlayerMatchHistory) GetIncludeCustomGames() bool { - if m != nil && m.IncludeCustomGames != nil { - return *m.IncludeCustomGames - } - return false -} - -type CMsgDOTAGetPlayerMatchHistoryResponse struct { - Matches []*CMsgDOTAGetPlayerMatchHistoryResponse_Match `protobuf:"bytes,1,rep,name=matches" json:"matches,omitempty"` - RequestId *uint32 `protobuf:"varint,2,opt,name=request_id" json:"request_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse) Reset() { *m = CMsgDOTAGetPlayerMatchHistoryResponse{} } -func (m *CMsgDOTAGetPlayerMatchHistoryResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGetPlayerMatchHistoryResponse) ProtoMessage() {} -func (*CMsgDOTAGetPlayerMatchHistoryResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{255} -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse) GetMatches() []*CMsgDOTAGetPlayerMatchHistoryResponse_Match { - if m != nil { - return m.Matches - } - return nil -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse) GetRequestId() uint32 { - if m != nil && m.RequestId != nil { - return *m.RequestId - } - return 0 -} - -type CMsgDOTAGetPlayerMatchHistoryResponse_Match struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - StartTime *uint32 `protobuf:"varint,2,opt,name=start_time" json:"start_time,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - Winner *bool `protobuf:"varint,4,opt,name=winner" json:"winner,omitempty"` - GameMode *uint32 `protobuf:"varint,5,opt,name=game_mode" json:"game_mode,omitempty"` - RankChange *int32 `protobuf:"varint,6,opt,name=rank_change" json:"rank_change,omitempty"` - PreviousRank *uint32 `protobuf:"varint,7,opt,name=previous_rank" json:"previous_rank,omitempty"` - LobbyType *uint32 `protobuf:"varint,8,opt,name=lobby_type" json:"lobby_type,omitempty"` - SoloRank *bool `protobuf:"varint,9,opt,name=solo_rank" json:"solo_rank,omitempty"` - Abandon *bool `protobuf:"varint,10,opt,name=abandon" json:"abandon,omitempty"` - Duration *uint32 `protobuf:"varint,11,opt,name=duration" json:"duration,omitempty"` - Engine *uint32 `protobuf:"varint,12,opt,name=engine" json:"engine,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) Reset() { - *m = CMsgDOTAGetPlayerMatchHistoryResponse_Match{} -} -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAGetPlayerMatchHistoryResponse_Match) ProtoMessage() {} -func (*CMsgDOTAGetPlayerMatchHistoryResponse_Match) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{255, 0} -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetWinner() bool { - if m != nil && m.Winner != nil { - return *m.Winner - } - return false -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetRankChange() int32 { - if m != nil && m.RankChange != nil { - return *m.RankChange - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetPreviousRank() uint32 { - if m != nil && m.PreviousRank != nil { - return *m.PreviousRank - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetLobbyType() uint32 { - if m != nil && m.LobbyType != nil { - return *m.LobbyType - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetSoloRank() bool { - if m != nil && m.SoloRank != nil { - return *m.SoloRank - } - return false -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetAbandon() bool { - if m != nil && m.Abandon != nil { - return *m.Abandon - } - return false -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -func (m *CMsgDOTAGetPlayerMatchHistoryResponse_Match) GetEngine() uint32 { - if m != nil && m.Engine != nil { - return *m.Engine - } - return 0 -} - -type CMsgDOTAStartDailyHeroChallenge struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAStartDailyHeroChallenge) Reset() { *m = CMsgDOTAStartDailyHeroChallenge{} } -func (m *CMsgDOTAStartDailyHeroChallenge) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAStartDailyHeroChallenge) ProtoMessage() {} -func (*CMsgDOTAStartDailyHeroChallenge) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{256} -} - -type CMsgGCNotificationsRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCNotificationsRequest) Reset() { *m = CMsgGCNotificationsRequest{} } -func (m *CMsgGCNotificationsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCNotificationsRequest) ProtoMessage() {} -func (*CMsgGCNotificationsRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{257} } - -type CMsgGCNotificationsResponse struct { - Result *CMsgGCNotificationsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgGCNotificationsResponse_EResult,def=0" json:"result,omitempty"` - Notifications []*CMsgGCNotificationsResponse_Notification `protobuf:"bytes,2,rep,name=notifications" json:"notifications,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCNotificationsResponse) Reset() { *m = CMsgGCNotificationsResponse{} } -func (m *CMsgGCNotificationsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCNotificationsResponse) ProtoMessage() {} -func (*CMsgGCNotificationsResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{258} } - -const Default_CMsgGCNotificationsResponse_Result CMsgGCNotificationsResponse_EResult = CMsgGCNotificationsResponse_SUCCESS - -func (m *CMsgGCNotificationsResponse) GetResult() CMsgGCNotificationsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgGCNotificationsResponse_Result -} - -func (m *CMsgGCNotificationsResponse) GetNotifications() []*CMsgGCNotificationsResponse_Notification { - if m != nil { - return m.Notifications - } - return nil -} - -type CMsgGCNotificationsResponse_Notification struct { - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Type *uint32 `protobuf:"varint,2,opt,name=type" json:"type,omitempty"` - Timestamp *uint32 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` - ReferenceA *uint32 `protobuf:"varint,4,opt,name=reference_a" json:"reference_a,omitempty"` - ReferenceB *uint32 `protobuf:"varint,5,opt,name=reference_b" json:"reference_b,omitempty"` - ReferenceC *uint32 `protobuf:"varint,6,opt,name=reference_c" json:"reference_c,omitempty"` - Message *string `protobuf:"bytes,7,opt,name=message" json:"message,omitempty"` - Unread *bool `protobuf:"varint,8,opt,name=unread" json:"unread,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCNotificationsResponse_Notification) Reset() { - *m = CMsgGCNotificationsResponse_Notification{} -} -func (m *CMsgGCNotificationsResponse_Notification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCNotificationsResponse_Notification) ProtoMessage() {} -func (*CMsgGCNotificationsResponse_Notification) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{258, 0} -} - -func (m *CMsgGCNotificationsResponse_Notification) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CMsgGCNotificationsResponse_Notification) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgGCNotificationsResponse_Notification) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgGCNotificationsResponse_Notification) GetReferenceA() uint32 { - if m != nil && m.ReferenceA != nil { - return *m.ReferenceA - } - return 0 -} - -func (m *CMsgGCNotificationsResponse_Notification) GetReferenceB() uint32 { - if m != nil && m.ReferenceB != nil { - return *m.ReferenceB - } - return 0 -} - -func (m *CMsgGCNotificationsResponse_Notification) GetReferenceC() uint32 { - if m != nil && m.ReferenceC != nil { - return *m.ReferenceC - } - return 0 -} - -func (m *CMsgGCNotificationsResponse_Notification) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgGCNotificationsResponse_Notification) GetUnread() bool { - if m != nil && m.Unread != nil { - return *m.Unread - } - return false -} - -type CMsgGCNotificationsMarkReadRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCNotificationsMarkReadRequest) Reset() { *m = CMsgGCNotificationsMarkReadRequest{} } -func (m *CMsgGCNotificationsMarkReadRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCNotificationsMarkReadRequest) ProtoMessage() {} -func (*CMsgGCNotificationsMarkReadRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{259} -} - -type CMsgClientToGCMarkNotificationListRead struct { - NotificationIds []uint64 `protobuf:"varint,1,rep,name=notification_ids" json:"notification_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCMarkNotificationListRead) Reset() { - *m = CMsgClientToGCMarkNotificationListRead{} -} -func (m *CMsgClientToGCMarkNotificationListRead) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCMarkNotificationListRead) ProtoMessage() {} -func (*CMsgClientToGCMarkNotificationListRead) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{260} -} - -func (m *CMsgClientToGCMarkNotificationListRead) GetNotificationIds() []uint64 { - if m != nil { - return m.NotificationIds - } - return nil -} - -type CMsgGCLeagueAdminState struct { - Leagues []uint32 `protobuf:"varint,1,rep,name=leagues" json:"leagues,omitempty"` - Keys []*CMsgGCLeagueAdminState_PrivateLeagueKeys `protobuf:"bytes,2,rep,name=keys" json:"keys,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCLeagueAdminState) Reset() { *m = CMsgGCLeagueAdminState{} } -func (m *CMsgGCLeagueAdminState) String() string { return proto.CompactTextString(m) } -func (*CMsgGCLeagueAdminState) ProtoMessage() {} -func (*CMsgGCLeagueAdminState) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{261} } - -func (m *CMsgGCLeagueAdminState) GetLeagues() []uint32 { - if m != nil { - return m.Leagues - } - return nil -} - -func (m *CMsgGCLeagueAdminState) GetKeys() []*CMsgGCLeagueAdminState_PrivateLeagueKeys { - if m != nil { - return m.Keys - } - return nil -} - -type CMsgGCLeagueAdminState_PrivateLeagueKeys struct { - Leagueid *uint32 `protobuf:"varint,1,opt,name=leagueid" json:"leagueid,omitempty"` - Privatekey *uint32 `protobuf:"varint,2,opt,name=privatekey" json:"privatekey,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCLeagueAdminState_PrivateLeagueKeys) Reset() { - *m = CMsgGCLeagueAdminState_PrivateLeagueKeys{} -} -func (m *CMsgGCLeagueAdminState_PrivateLeagueKeys) String() string { return proto.CompactTextString(m) } -func (*CMsgGCLeagueAdminState_PrivateLeagueKeys) ProtoMessage() {} -func (*CMsgGCLeagueAdminState_PrivateLeagueKeys) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{261, 0} -} - -func (m *CMsgGCLeagueAdminState_PrivateLeagueKeys) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -func (m *CMsgGCLeagueAdminState_PrivateLeagueKeys) GetPrivatekey() uint32 { - if m != nil && m.Privatekey != nil { - return *m.Privatekey - } - return 0 -} - -type CMsgGCPlayerInfoRequest struct { - AccountIds []uint32 `protobuf:"varint,1,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPlayerInfoRequest) Reset() { *m = CMsgGCPlayerInfoRequest{} } -func (m *CMsgGCPlayerInfoRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPlayerInfoRequest) ProtoMessage() {} -func (*CMsgGCPlayerInfoRequest) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{262} } - -func (m *CMsgGCPlayerInfoRequest) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgGCPlayerInfoSubmit struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - CountryCode *string `protobuf:"bytes,2,opt,name=country_code" json:"country_code,omitempty"` - FantasyRole *uint32 `protobuf:"varint,3,opt,name=fantasy_role" json:"fantasy_role,omitempty"` - TeamId *uint32 `protobuf:"varint,4,opt,name=team_id" json:"team_id,omitempty"` - Sponsor *string `protobuf:"bytes,5,opt,name=sponsor" json:"sponsor,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPlayerInfoSubmit) Reset() { *m = CMsgGCPlayerInfoSubmit{} } -func (m *CMsgGCPlayerInfoSubmit) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPlayerInfoSubmit) ProtoMessage() {} -func (*CMsgGCPlayerInfoSubmit) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{263} } - -func (m *CMsgGCPlayerInfoSubmit) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgGCPlayerInfoSubmit) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgGCPlayerInfoSubmit) GetFantasyRole() uint32 { - if m != nil && m.FantasyRole != nil { - return *m.FantasyRole - } - return 0 -} - -func (m *CMsgGCPlayerInfoSubmit) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgGCPlayerInfoSubmit) GetSponsor() string { - if m != nil && m.Sponsor != nil { - return *m.Sponsor - } - return "" -} - -type CMsgGCPlayerInfoSubmitResponse struct { - Result *CMsgGCPlayerInfoSubmitResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgGCPlayerInfoSubmitResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPlayerInfoSubmitResponse) Reset() { *m = CMsgGCPlayerInfoSubmitResponse{} } -func (m *CMsgGCPlayerInfoSubmitResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPlayerInfoSubmitResponse) ProtoMessage() {} -func (*CMsgGCPlayerInfoSubmitResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{264} -} - -const Default_CMsgGCPlayerInfoSubmitResponse_Result CMsgGCPlayerInfoSubmitResponse_EResult = CMsgGCPlayerInfoSubmitResponse_SUCCESS - -func (m *CMsgGCPlayerInfoSubmitResponse) GetResult() CMsgGCPlayerInfoSubmitResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgGCPlayerInfoSubmitResponse_Result -} - -type CMsgSerializedSOCache struct { - FileVersion *uint32 `protobuf:"varint,1,opt,name=file_version" json:"file_version,omitempty"` - Caches []*CMsgSerializedSOCache_Cache `protobuf:"bytes,2,rep,name=caches" json:"caches,omitempty"` - GcSocacheFileVersion *uint32 `protobuf:"varint,3,opt,name=gc_socache_file_version" json:"gc_socache_file_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSerializedSOCache) Reset() { *m = CMsgSerializedSOCache{} } -func (m *CMsgSerializedSOCache) String() string { return proto.CompactTextString(m) } -func (*CMsgSerializedSOCache) ProtoMessage() {} -func (*CMsgSerializedSOCache) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{265} } - -func (m *CMsgSerializedSOCache) GetFileVersion() uint32 { - if m != nil && m.FileVersion != nil { - return *m.FileVersion - } - return 0 -} - -func (m *CMsgSerializedSOCache) GetCaches() []*CMsgSerializedSOCache_Cache { - if m != nil { - return m.Caches - } - return nil -} - -func (m *CMsgSerializedSOCache) GetGcSocacheFileVersion() uint32 { - if m != nil && m.GcSocacheFileVersion != nil { - return *m.GcSocacheFileVersion - } - return 0 -} - -type CMsgSerializedSOCache_TypeCache struct { - Type *uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - Objects [][]byte `protobuf:"bytes,2,rep,name=objects" json:"objects,omitempty"` - ServiceId *uint32 `protobuf:"varint,3,opt,name=service_id" json:"service_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSerializedSOCache_TypeCache) Reset() { *m = CMsgSerializedSOCache_TypeCache{} } -func (m *CMsgSerializedSOCache_TypeCache) String() string { return proto.CompactTextString(m) } -func (*CMsgSerializedSOCache_TypeCache) ProtoMessage() {} -func (*CMsgSerializedSOCache_TypeCache) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{265, 0} -} - -func (m *CMsgSerializedSOCache_TypeCache) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgSerializedSOCache_TypeCache) GetObjects() [][]byte { - if m != nil { - return m.Objects - } - return nil -} - -func (m *CMsgSerializedSOCache_TypeCache) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -type CMsgSerializedSOCache_Cache struct { - Type *uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - Id *uint64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` - Versions []*CMsgSerializedSOCache_Cache_Version `protobuf:"bytes,3,rep,name=versions" json:"versions,omitempty"` - TypeCaches []*CMsgSerializedSOCache_TypeCache `protobuf:"bytes,4,rep,name=type_caches" json:"type_caches,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSerializedSOCache_Cache) Reset() { *m = CMsgSerializedSOCache_Cache{} } -func (m *CMsgSerializedSOCache_Cache) String() string { return proto.CompactTextString(m) } -func (*CMsgSerializedSOCache_Cache) ProtoMessage() {} -func (*CMsgSerializedSOCache_Cache) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{265, 1} -} - -func (m *CMsgSerializedSOCache_Cache) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgSerializedSOCache_Cache) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CMsgSerializedSOCache_Cache) GetVersions() []*CMsgSerializedSOCache_Cache_Version { - if m != nil { - return m.Versions - } - return nil -} - -func (m *CMsgSerializedSOCache_Cache) GetTypeCaches() []*CMsgSerializedSOCache_TypeCache { - if m != nil { - return m.TypeCaches - } - return nil -} - -type CMsgSerializedSOCache_Cache_Version struct { - Service *uint32 `protobuf:"varint,1,opt,name=service" json:"service,omitempty"` - Version *uint64 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSerializedSOCache_Cache_Version) Reset() { *m = CMsgSerializedSOCache_Cache_Version{} } -func (m *CMsgSerializedSOCache_Cache_Version) String() string { return proto.CompactTextString(m) } -func (*CMsgSerializedSOCache_Cache_Version) ProtoMessage() {} -func (*CMsgSerializedSOCache_Cache_Version) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{265, 1, 0} -} - -func (m *CMsgSerializedSOCache_Cache_Version) GetService() uint32 { - if m != nil && m.Service != nil { - return *m.Service - } - return 0 -} - -func (m *CMsgSerializedSOCache_Cache_Version) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgRequestWeekendTourneySchedule struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestWeekendTourneySchedule) Reset() { *m = CMsgRequestWeekendTourneySchedule{} } -func (m *CMsgRequestWeekendTourneySchedule) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestWeekendTourneySchedule) ProtoMessage() {} -func (*CMsgRequestWeekendTourneySchedule) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{266} -} - -type CMsgWeekendTourneySchedule struct { - Divisions []*CMsgWeekendTourneySchedule_Division `protobuf:"bytes,1,rep,name=divisions" json:"divisions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgWeekendTourneySchedule) Reset() { *m = CMsgWeekendTourneySchedule{} } -func (m *CMsgWeekendTourneySchedule) String() string { return proto.CompactTextString(m) } -func (*CMsgWeekendTourneySchedule) ProtoMessage() {} -func (*CMsgWeekendTourneySchedule) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{267} } - -func (m *CMsgWeekendTourneySchedule) GetDivisions() []*CMsgWeekendTourneySchedule_Division { - if m != nil { - return m.Divisions - } - return nil -} - -type CMsgWeekendTourneySchedule_Division struct { - DivisionCode *uint32 `protobuf:"varint,1,opt,name=division_code" json:"division_code,omitempty"` - TimeWindowOpen *uint32 `protobuf:"varint,2,opt,name=time_window_open" json:"time_window_open,omitempty"` - TimeWindowClose *uint32 `protobuf:"varint,3,opt,name=time_window_close" json:"time_window_close,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgWeekendTourneySchedule_Division) Reset() { *m = CMsgWeekendTourneySchedule_Division{} } -func (m *CMsgWeekendTourneySchedule_Division) String() string { return proto.CompactTextString(m) } -func (*CMsgWeekendTourneySchedule_Division) ProtoMessage() {} -func (*CMsgWeekendTourneySchedule_Division) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{267, 0} -} - -func (m *CMsgWeekendTourneySchedule_Division) GetDivisionCode() uint32 { - if m != nil && m.DivisionCode != nil { - return *m.DivisionCode - } - return 0 -} - -func (m *CMsgWeekendTourneySchedule_Division) GetTimeWindowOpen() uint32 { - if m != nil && m.TimeWindowOpen != nil { - return *m.TimeWindowOpen - } - return 0 -} - -func (m *CMsgWeekendTourneySchedule_Division) GetTimeWindowClose() uint32 { - if m != nil && m.TimeWindowClose != nil { - return *m.TimeWindowClose - } - return 0 -} - -type CMsgClientProvideSurveyResult struct { - Responses []*CMsgClientProvideSurveyResult_Response `protobuf:"bytes,1,rep,name=responses" json:"responses,omitempty"` - SurveyKey *uint64 `protobuf:"varint,2,opt,name=survey_key" json:"survey_key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientProvideSurveyResult) Reset() { *m = CMsgClientProvideSurveyResult{} } -func (m *CMsgClientProvideSurveyResult) String() string { return proto.CompactTextString(m) } -func (*CMsgClientProvideSurveyResult) ProtoMessage() {} -func (*CMsgClientProvideSurveyResult) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{268} } - -func (m *CMsgClientProvideSurveyResult) GetResponses() []*CMsgClientProvideSurveyResult_Response { - if m != nil { - return m.Responses - } - return nil -} - -func (m *CMsgClientProvideSurveyResult) GetSurveyKey() uint64 { - if m != nil && m.SurveyKey != nil { - return *m.SurveyKey - } - return 0 -} - -type CMsgClientProvideSurveyResult_Response struct { - QuestionId *uint32 `protobuf:"varint,1,opt,name=question_id" json:"question_id,omitempty"` - SurveyValue *uint32 `protobuf:"varint,2,opt,name=survey_value" json:"survey_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientProvideSurveyResult_Response) Reset() { - *m = CMsgClientProvideSurveyResult_Response{} -} -func (m *CMsgClientProvideSurveyResult_Response) String() string { return proto.CompactTextString(m) } -func (*CMsgClientProvideSurveyResult_Response) ProtoMessage() {} -func (*CMsgClientProvideSurveyResult_Response) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{268, 0} -} - -func (m *CMsgClientProvideSurveyResult_Response) GetQuestionId() uint32 { - if m != nil && m.QuestionId != nil { - return *m.QuestionId - } - return 0 -} - -func (m *CMsgClientProvideSurveyResult_Response) GetSurveyValue() uint32 { - if m != nil && m.SurveyValue != nil { - return *m.SurveyValue - } - return 0 -} - -type CMsgDOTAEmoticonAccessSDO struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - UnlockedEmoticons []byte `protobuf:"bytes,2,opt,name=unlocked_emoticons" json:"unlocked_emoticons,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEmoticonAccessSDO) Reset() { *m = CMsgDOTAEmoticonAccessSDO{} } -func (m *CMsgDOTAEmoticonAccessSDO) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEmoticonAccessSDO) ProtoMessage() {} -func (*CMsgDOTAEmoticonAccessSDO) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{269} } - -func (m *CMsgDOTAEmoticonAccessSDO) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAEmoticonAccessSDO) GetUnlockedEmoticons() []byte { - if m != nil { - return m.UnlockedEmoticons - } - return nil -} - -type CMsgClientToGCEmoticonDataRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCEmoticonDataRequest) Reset() { *m = CMsgClientToGCEmoticonDataRequest{} } -func (m *CMsgClientToGCEmoticonDataRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCEmoticonDataRequest) ProtoMessage() {} -func (*CMsgClientToGCEmoticonDataRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{270} -} - -type CMsgGCToClientEmoticonData struct { - EmoticonAccess *CMsgDOTAEmoticonAccessSDO `protobuf:"bytes,1,opt,name=emoticon_access" json:"emoticon_access,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientEmoticonData) Reset() { *m = CMsgGCToClientEmoticonData{} } -func (m *CMsgGCToClientEmoticonData) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientEmoticonData) ProtoMessage() {} -func (*CMsgGCToClientEmoticonData) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{271} } - -func (m *CMsgGCToClientEmoticonData) GetEmoticonAccess() *CMsgDOTAEmoticonAccessSDO { - if m != nil { - return m.EmoticonAccess - } - return nil -} - -type CMsgClientToGCTrackDialogResult struct { - DialogId *uint32 `protobuf:"varint,1,opt,name=dialog_id" json:"dialog_id,omitempty"` - Value *uint32 `protobuf:"varint,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCTrackDialogResult) Reset() { *m = CMsgClientToGCTrackDialogResult{} } -func (m *CMsgClientToGCTrackDialogResult) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCTrackDialogResult) ProtoMessage() {} -func (*CMsgClientToGCTrackDialogResult) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{272} -} - -func (m *CMsgClientToGCTrackDialogResult) GetDialogId() uint32 { - if m != nil && m.DialogId != nil { - return *m.DialogId - } - return 0 -} - -func (m *CMsgClientToGCTrackDialogResult) GetValue() uint32 { - if m != nil && m.Value != nil { - return *m.Value - } - return 0 -} - -type CMsgGCToClientTournamentItemDrop struct { - ItemDef *uint32 `protobuf:"varint,1,opt,name=item_def" json:"item_def,omitempty"` - EventType *uint32 `protobuf:"varint,2,opt,name=event_type" json:"event_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientTournamentItemDrop) Reset() { *m = CMsgGCToClientTournamentItemDrop{} } -func (m *CMsgGCToClientTournamentItemDrop) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientTournamentItemDrop) ProtoMessage() {} -func (*CMsgGCToClientTournamentItemDrop) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{273} -} - -func (m *CMsgGCToClientTournamentItemDrop) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgGCToClientTournamentItemDrop) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -type CMsgClientToGCSetAdditionalEquips struct { - Equips []*CAdditionalEquipSlot `protobuf:"bytes,1,rep,name=equips" json:"equips,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetAdditionalEquips) Reset() { *m = CMsgClientToGCSetAdditionalEquips{} } -func (m *CMsgClientToGCSetAdditionalEquips) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSetAdditionalEquips) ProtoMessage() {} -func (*CMsgClientToGCSetAdditionalEquips) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{274} -} - -func (m *CMsgClientToGCSetAdditionalEquips) GetEquips() []*CAdditionalEquipSlot { - if m != nil { - return m.Equips - } - return nil -} - -type CMsgClientToGCSetAdditionalEquipsResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetAdditionalEquipsResponse) Reset() { - *m = CMsgClientToGCSetAdditionalEquipsResponse{} -} -func (m *CMsgClientToGCSetAdditionalEquipsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSetAdditionalEquipsResponse) ProtoMessage() {} -func (*CMsgClientToGCSetAdditionalEquipsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{275} -} - -type CMsgClientToGCGetAdditionalEquips struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetAdditionalEquips) Reset() { *m = CMsgClientToGCGetAdditionalEquips{} } -func (m *CMsgClientToGCGetAdditionalEquips) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetAdditionalEquips) ProtoMessage() {} -func (*CMsgClientToGCGetAdditionalEquips) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{276} -} - -type CMsgClientToGCGetAdditionalEquipsResponse struct { - Equips []*CAdditionalEquipSlot `protobuf:"bytes,1,rep,name=equips" json:"equips,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetAdditionalEquipsResponse) Reset() { - *m = CMsgClientToGCGetAdditionalEquipsResponse{} -} -func (m *CMsgClientToGCGetAdditionalEquipsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetAdditionalEquipsResponse) ProtoMessage() {} -func (*CMsgClientToGCGetAdditionalEquipsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{277} -} - -func (m *CMsgClientToGCGetAdditionalEquipsResponse) GetEquips() []*CAdditionalEquipSlot { - if m != nil { - return m.Equips - } - return nil -} - -type CMsgClientToGCGetAllHeroOrder struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetAllHeroOrder) Reset() { *m = CMsgClientToGCGetAllHeroOrder{} } -func (m *CMsgClientToGCGetAllHeroOrder) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetAllHeroOrder) ProtoMessage() {} -func (*CMsgClientToGCGetAllHeroOrder) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{278} } - -type CMsgClientToGCGetAllHeroOrderResponse struct { - HeroIds []uint32 `protobuf:"varint,1,rep,name=hero_ids" json:"hero_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetAllHeroOrderResponse) Reset() { *m = CMsgClientToGCGetAllHeroOrderResponse{} } -func (m *CMsgClientToGCGetAllHeroOrderResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetAllHeroOrderResponse) ProtoMessage() {} -func (*CMsgClientToGCGetAllHeroOrderResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{279} -} - -func (m *CMsgClientToGCGetAllHeroOrderResponse) GetHeroIds() []uint32 { - if m != nil { - return m.HeroIds - } - return nil -} - -type CMsgClientToGCGetAllHeroProgress struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetAllHeroProgress) Reset() { *m = CMsgClientToGCGetAllHeroProgress{} } -func (m *CMsgClientToGCGetAllHeroProgress) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetAllHeroProgress) ProtoMessage() {} -func (*CMsgClientToGCGetAllHeroProgress) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{280} -} - -func (m *CMsgClientToGCGetAllHeroProgress) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgClientToGCGetAllHeroProgressResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - CurrHeroId *uint32 `protobuf:"varint,2,opt,name=curr_hero_id" json:"curr_hero_id,omitempty"` - LapsCompleted *uint32 `protobuf:"varint,3,opt,name=laps_completed" json:"laps_completed,omitempty"` - CurrHeroGames *uint32 `protobuf:"varint,4,opt,name=curr_hero_games" json:"curr_hero_games,omitempty"` - CurrLapTimeStarted *uint32 `protobuf:"varint,5,opt,name=curr_lap_time_started" json:"curr_lap_time_started,omitempty"` - CurrLapGames *uint32 `protobuf:"varint,6,opt,name=curr_lap_games" json:"curr_lap_games,omitempty"` - BestLapGames *uint32 `protobuf:"varint,7,opt,name=best_lap_games" json:"best_lap_games,omitempty"` - BestLapTime *uint32 `protobuf:"varint,8,opt,name=best_lap_time" json:"best_lap_time,omitempty"` - LapHeroesCompleted *uint32 `protobuf:"varint,9,opt,name=lap_heroes_completed" json:"lap_heroes_completed,omitempty"` - LapHeroesRemaining *uint32 `protobuf:"varint,10,opt,name=lap_heroes_remaining" json:"lap_heroes_remaining,omitempty"` - NextHeroId *uint32 `protobuf:"varint,11,opt,name=next_hero_id" json:"next_hero_id,omitempty"` - PrevHeroId *uint32 `protobuf:"varint,12,opt,name=prev_hero_id" json:"prev_hero_id,omitempty"` - PrevHeroGames *uint32 `protobuf:"varint,13,opt,name=prev_hero_games" json:"prev_hero_games,omitempty"` - PrevAvgTries *float32 `protobuf:"fixed32,14,opt,name=prev_avg_tries" json:"prev_avg_tries,omitempty"` - CurrAvgTries *float32 `protobuf:"fixed32,15,opt,name=curr_avg_tries" json:"curr_avg_tries,omitempty"` - NextAvgTries *float32 `protobuf:"fixed32,16,opt,name=next_avg_tries" json:"next_avg_tries,omitempty"` - FullLapAvgTries *float32 `protobuf:"fixed32,17,opt,name=full_lap_avg_tries" json:"full_lap_avg_tries,omitempty"` - CurrLapAvgTries *float32 `protobuf:"fixed32,18,opt,name=curr_lap_avg_tries" json:"curr_lap_avg_tries,omitempty"` - ProfileName *string `protobuf:"bytes,19,opt,name=profile_name" json:"profile_name,omitempty"` - StartHeroId *uint32 `protobuf:"varint,20,opt,name=start_hero_id" json:"start_hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) Reset() { - *m = CMsgClientToGCGetAllHeroProgressResponse{} -} -func (m *CMsgClientToGCGetAllHeroProgressResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetAllHeroProgressResponse) ProtoMessage() {} -func (*CMsgClientToGCGetAllHeroProgressResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{281} -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetCurrHeroId() uint32 { - if m != nil && m.CurrHeroId != nil { - return *m.CurrHeroId - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetLapsCompleted() uint32 { - if m != nil && m.LapsCompleted != nil { - return *m.LapsCompleted - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetCurrHeroGames() uint32 { - if m != nil && m.CurrHeroGames != nil { - return *m.CurrHeroGames - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetCurrLapTimeStarted() uint32 { - if m != nil && m.CurrLapTimeStarted != nil { - return *m.CurrLapTimeStarted - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetCurrLapGames() uint32 { - if m != nil && m.CurrLapGames != nil { - return *m.CurrLapGames - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetBestLapGames() uint32 { - if m != nil && m.BestLapGames != nil { - return *m.BestLapGames - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetBestLapTime() uint32 { - if m != nil && m.BestLapTime != nil { - return *m.BestLapTime - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetLapHeroesCompleted() uint32 { - if m != nil && m.LapHeroesCompleted != nil { - return *m.LapHeroesCompleted - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetLapHeroesRemaining() uint32 { - if m != nil && m.LapHeroesRemaining != nil { - return *m.LapHeroesRemaining - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetNextHeroId() uint32 { - if m != nil && m.NextHeroId != nil { - return *m.NextHeroId - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetPrevHeroId() uint32 { - if m != nil && m.PrevHeroId != nil { - return *m.PrevHeroId - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetPrevHeroGames() uint32 { - if m != nil && m.PrevHeroGames != nil { - return *m.PrevHeroGames - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetPrevAvgTries() float32 { - if m != nil && m.PrevAvgTries != nil { - return *m.PrevAvgTries - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetCurrAvgTries() float32 { - if m != nil && m.CurrAvgTries != nil { - return *m.CurrAvgTries - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetNextAvgTries() float32 { - if m != nil && m.NextAvgTries != nil { - return *m.NextAvgTries - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetFullLapAvgTries() float32 { - if m != nil && m.FullLapAvgTries != nil { - return *m.FullLapAvgTries - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetCurrLapAvgTries() float32 { - if m != nil && m.CurrLapAvgTries != nil { - return *m.CurrLapAvgTries - } - return 0 -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetProfileName() string { - if m != nil && m.ProfileName != nil { - return *m.ProfileName - } - return "" -} - -func (m *CMsgClientToGCGetAllHeroProgressResponse) GetStartHeroId() uint32 { - if m != nil && m.StartHeroId != nil { - return *m.StartHeroId - } - return 0 -} - -type CMsgClientToGCGetTrophyList struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetTrophyList) Reset() { *m = CMsgClientToGCGetTrophyList{} } -func (m *CMsgClientToGCGetTrophyList) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetTrophyList) ProtoMessage() {} -func (*CMsgClientToGCGetTrophyList) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{282} } - -func (m *CMsgClientToGCGetTrophyList) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgClientToGCGetTrophyListResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Trophies []*CMsgClientToGCGetTrophyListResponse_Trophy `protobuf:"bytes,2,rep,name=trophies" json:"trophies,omitempty"` - ProfileName *string `protobuf:"bytes,3,opt,name=profile_name" json:"profile_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetTrophyListResponse) Reset() { *m = CMsgClientToGCGetTrophyListResponse{} } -func (m *CMsgClientToGCGetTrophyListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetTrophyListResponse) ProtoMessage() {} -func (*CMsgClientToGCGetTrophyListResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{283} -} - -func (m *CMsgClientToGCGetTrophyListResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgClientToGCGetTrophyListResponse) GetTrophies() []*CMsgClientToGCGetTrophyListResponse_Trophy { - if m != nil { - return m.Trophies - } - return nil -} - -func (m *CMsgClientToGCGetTrophyListResponse) GetProfileName() string { - if m != nil && m.ProfileName != nil { - return *m.ProfileName - } - return "" -} - -type CMsgClientToGCGetTrophyListResponse_Trophy struct { - TrophyId *uint32 `protobuf:"varint,1,opt,name=trophy_id" json:"trophy_id,omitempty"` - TrophyScore *uint32 `protobuf:"varint,2,opt,name=trophy_score" json:"trophy_score,omitempty"` - LastUpdated *uint32 `protobuf:"varint,3,opt,name=last_updated" json:"last_updated,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetTrophyListResponse_Trophy) Reset() { - *m = CMsgClientToGCGetTrophyListResponse_Trophy{} -} -func (m *CMsgClientToGCGetTrophyListResponse_Trophy) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCGetTrophyListResponse_Trophy) ProtoMessage() {} -func (*CMsgClientToGCGetTrophyListResponse_Trophy) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{283, 0} -} - -func (m *CMsgClientToGCGetTrophyListResponse_Trophy) GetTrophyId() uint32 { - if m != nil && m.TrophyId != nil { - return *m.TrophyId - } - return 0 -} - -func (m *CMsgClientToGCGetTrophyListResponse_Trophy) GetTrophyScore() uint32 { - if m != nil && m.TrophyScore != nil { - return *m.TrophyScore - } - return 0 -} - -func (m *CMsgClientToGCGetTrophyListResponse_Trophy) GetLastUpdated() uint32 { - if m != nil && m.LastUpdated != nil { - return *m.LastUpdated - } - return 0 -} - -type CMsgGCToClientTrophyAwarded struct { - TrophyId *uint32 `protobuf:"varint,1,opt,name=trophy_id" json:"trophy_id,omitempty"` - TrophyScore *uint32 `protobuf:"varint,2,opt,name=trophy_score" json:"trophy_score,omitempty"` - TrophyOldScore *uint32 `protobuf:"varint,3,opt,name=trophy_old_score" json:"trophy_old_score,omitempty"` - LastUpdated *uint32 `protobuf:"varint,4,opt,name=last_updated" json:"last_updated,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientTrophyAwarded) Reset() { *m = CMsgGCToClientTrophyAwarded{} } -func (m *CMsgGCToClientTrophyAwarded) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientTrophyAwarded) ProtoMessage() {} -func (*CMsgGCToClientTrophyAwarded) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{284} } - -func (m *CMsgGCToClientTrophyAwarded) GetTrophyId() uint32 { - if m != nil && m.TrophyId != nil { - return *m.TrophyId - } - return 0 -} - -func (m *CMsgGCToClientTrophyAwarded) GetTrophyScore() uint32 { - if m != nil && m.TrophyScore != nil { - return *m.TrophyScore - } - return 0 -} - -func (m *CMsgGCToClientTrophyAwarded) GetTrophyOldScore() uint32 { - if m != nil && m.TrophyOldScore != nil { - return *m.TrophyOldScore - } - return 0 -} - -func (m *CMsgGCToClientTrophyAwarded) GetLastUpdated() uint32 { - if m != nil && m.LastUpdated != nil { - return *m.LastUpdated - } - return 0 -} - -type CMsgClientToGCGetProfileCard struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetProfileCard) Reset() { *m = CMsgClientToGCGetProfileCard{} } -func (m *CMsgClientToGCGetProfileCard) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetProfileCard) ProtoMessage() {} -func (*CMsgClientToGCGetProfileCard) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{285} } - -func (m *CMsgClientToGCGetProfileCard) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgClientToGCSetProfileCardSlots struct { - Slots []*CMsgClientToGCSetProfileCardSlots_CardSlot `protobuf:"bytes,1,rep,name=slots" json:"slots,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetProfileCardSlots) Reset() { *m = CMsgClientToGCSetProfileCardSlots{} } -func (m *CMsgClientToGCSetProfileCardSlots) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSetProfileCardSlots) ProtoMessage() {} -func (*CMsgClientToGCSetProfileCardSlots) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{286} -} - -func (m *CMsgClientToGCSetProfileCardSlots) GetSlots() []*CMsgClientToGCSetProfileCardSlots_CardSlot { - if m != nil { - return m.Slots - } - return nil -} - -type CMsgClientToGCSetProfileCardSlots_CardSlot struct { - SlotId *uint32 `protobuf:"varint,1,opt,name=slot_id" json:"slot_id,omitempty"` - SlotType *EProfileCardSlotType `protobuf:"varint,2,opt,name=slot_type,enum=EProfileCardSlotType,def=0" json:"slot_type,omitempty"` - SlotValue *uint64 `protobuf:"varint,3,opt,name=slot_value" json:"slot_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetProfileCardSlots_CardSlot) Reset() { - *m = CMsgClientToGCSetProfileCardSlots_CardSlot{} -} -func (m *CMsgClientToGCSetProfileCardSlots_CardSlot) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCSetProfileCardSlots_CardSlot) ProtoMessage() {} -func (*CMsgClientToGCSetProfileCardSlots_CardSlot) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{286, 0} -} - -const Default_CMsgClientToGCSetProfileCardSlots_CardSlot_SlotType EProfileCardSlotType = EProfileCardSlotType_k_EProfileCardSlotType_Empty - -func (m *CMsgClientToGCSetProfileCardSlots_CardSlot) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CMsgClientToGCSetProfileCardSlots_CardSlot) GetSlotType() EProfileCardSlotType { - if m != nil && m.SlotType != nil { - return *m.SlotType - } - return Default_CMsgClientToGCSetProfileCardSlots_CardSlot_SlotType -} - -func (m *CMsgClientToGCSetProfileCardSlots_CardSlot) GetSlotValue() uint64 { - if m != nil && m.SlotValue != nil { - return *m.SlotValue - } - return 0 -} - -type CMsgClientToGCGetProfileCardStats struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetProfileCardStats) Reset() { *m = CMsgClientToGCGetProfileCardStats{} } -func (m *CMsgClientToGCGetProfileCardStats) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetProfileCardStats) ProtoMessage() {} -func (*CMsgClientToGCGetProfileCardStats) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{287} -} - -type CMsgClientToGCCreateHeroStatue struct { - SourceItem *uint64 `protobuf:"varint,1,opt,name=source_item" json:"source_item,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - SequenceName *string `protobuf:"bytes,4,opt,name=sequence_name" json:"sequence_name,omitempty"` - Cycle *float32 `protobuf:"fixed32,5,opt,name=cycle" json:"cycle,omitempty"` - Wearables []uint32 `protobuf:"varint,6,rep,name=wearables" json:"wearables,omitempty"` - Inscription *string `protobuf:"bytes,7,opt,name=inscription" json:"inscription,omitempty"` - Styles []uint32 `protobuf:"varint,8,rep,name=styles" json:"styles,omitempty"` - ReforgerItem *uint64 `protobuf:"varint,9,opt,name=reforger_item" json:"reforger_item,omitempty"` - TournamentDrop *bool `protobuf:"varint,10,opt,name=tournament_drop" json:"tournament_drop,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCreateHeroStatue) Reset() { *m = CMsgClientToGCCreateHeroStatue{} } -func (m *CMsgClientToGCCreateHeroStatue) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCCreateHeroStatue) ProtoMessage() {} -func (*CMsgClientToGCCreateHeroStatue) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{288} -} - -func (m *CMsgClientToGCCreateHeroStatue) GetSourceItem() uint64 { - if m != nil && m.SourceItem != nil { - return *m.SourceItem - } - return 0 -} - -func (m *CMsgClientToGCCreateHeroStatue) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgClientToGCCreateHeroStatue) GetSequenceName() string { - if m != nil && m.SequenceName != nil { - return *m.SequenceName - } - return "" -} - -func (m *CMsgClientToGCCreateHeroStatue) GetCycle() float32 { - if m != nil && m.Cycle != nil { - return *m.Cycle - } - return 0 -} - -func (m *CMsgClientToGCCreateHeroStatue) GetWearables() []uint32 { - if m != nil { - return m.Wearables - } - return nil -} - -func (m *CMsgClientToGCCreateHeroStatue) GetInscription() string { - if m != nil && m.Inscription != nil { - return *m.Inscription - } - return "" -} - -func (m *CMsgClientToGCCreateHeroStatue) GetStyles() []uint32 { - if m != nil { - return m.Styles - } - return nil -} - -func (m *CMsgClientToGCCreateHeroStatue) GetReforgerItem() uint64 { - if m != nil && m.ReforgerItem != nil { - return *m.ReforgerItem - } - return 0 -} - -func (m *CMsgClientToGCCreateHeroStatue) GetTournamentDrop() bool { - if m != nil && m.TournamentDrop != nil { - return *m.TournamentDrop - } - return false -} - -type CMsgClientToGCCreateTeamShowcase struct { - SourceItem *uint64 `protobuf:"varint,1,opt,name=source_item" json:"source_item,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - SequenceName *string `protobuf:"bytes,4,opt,name=sequence_name" json:"sequence_name,omitempty"` - Cycle *float32 `protobuf:"fixed32,5,opt,name=cycle" json:"cycle,omitempty"` - Wearables []uint32 `protobuf:"varint,6,rep,name=wearables" json:"wearables,omitempty"` - Inscription *string `protobuf:"bytes,7,opt,name=inscription" json:"inscription,omitempty"` - Styles []uint32 `protobuf:"varint,8,rep,name=styles" json:"styles,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCreateTeamShowcase) Reset() { *m = CMsgClientToGCCreateTeamShowcase{} } -func (m *CMsgClientToGCCreateTeamShowcase) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCCreateTeamShowcase) ProtoMessage() {} -func (*CMsgClientToGCCreateTeamShowcase) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{289} -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetSourceItem() uint64 { - if m != nil && m.SourceItem != nil { - return *m.SourceItem - } - return 0 -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetSequenceName() string { - if m != nil && m.SequenceName != nil { - return *m.SequenceName - } - return "" -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetCycle() float32 { - if m != nil && m.Cycle != nil { - return *m.Cycle - } - return 0 -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetWearables() []uint32 { - if m != nil { - return m.Wearables - } - return nil -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetInscription() string { - if m != nil && m.Inscription != nil { - return *m.Inscription - } - return "" -} - -func (m *CMsgClientToGCCreateTeamShowcase) GetStyles() []uint32 { - if m != nil { - return m.Styles - } - return nil -} - -type CMsgGCToClientHeroStatueCreateResult struct { - ResultingItem *uint64 `protobuf:"varint,1,opt,name=resulting_item" json:"resulting_item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientHeroStatueCreateResult) Reset() { *m = CMsgGCToClientHeroStatueCreateResult{} } -func (m *CMsgGCToClientHeroStatueCreateResult) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientHeroStatueCreateResult) ProtoMessage() {} -func (*CMsgGCToClientHeroStatueCreateResult) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{290} -} - -func (m *CMsgGCToClientHeroStatueCreateResult) GetResultingItem() uint64 { - if m != nil && m.ResultingItem != nil { - return *m.ResultingItem - } - return 0 -} - -type CMsgGCToClientTeamShowcaseCreateResult struct { - ResultingItem *uint64 `protobuf:"varint,1,opt,name=resulting_item" json:"resulting_item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientTeamShowcaseCreateResult) Reset() { - *m = CMsgGCToClientTeamShowcaseCreateResult{} -} -func (m *CMsgGCToClientTeamShowcaseCreateResult) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientTeamShowcaseCreateResult) ProtoMessage() {} -func (*CMsgGCToClientTeamShowcaseCreateResult) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{291} -} - -func (m *CMsgGCToClientTeamShowcaseCreateResult) GetResultingItem() uint64 { - if m != nil && m.ResultingItem != nil { - return *m.ResultingItem - } - return 0 -} - -type CMsgClientToGCRecordCompendiumStats struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - ViewDurationS *uint32 `protobuf:"varint,2,opt,name=view_duration_s" json:"view_duration_s,omitempty"` - VideosViewed *uint32 `protobuf:"varint,3,opt,name=videos_viewed" json:"videos_viewed,omitempty"` - PageTurns *uint32 `protobuf:"varint,4,opt,name=page_turns" json:"page_turns,omitempty"` - LinksFollowed *uint32 `protobuf:"varint,5,opt,name=links_followed" json:"links_followed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCRecordCompendiumStats) Reset() { *m = CMsgClientToGCRecordCompendiumStats{} } -func (m *CMsgClientToGCRecordCompendiumStats) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCRecordCompendiumStats) ProtoMessage() {} -func (*CMsgClientToGCRecordCompendiumStats) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{292} -} - -func (m *CMsgClientToGCRecordCompendiumStats) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgClientToGCRecordCompendiumStats) GetViewDurationS() uint32 { - if m != nil && m.ViewDurationS != nil { - return *m.ViewDurationS - } - return 0 -} - -func (m *CMsgClientToGCRecordCompendiumStats) GetVideosViewed() uint32 { - if m != nil && m.VideosViewed != nil { - return *m.VideosViewed - } - return 0 -} - -func (m *CMsgClientToGCRecordCompendiumStats) GetPageTurns() uint32 { - if m != nil && m.PageTurns != nil { - return *m.PageTurns - } - return 0 -} - -func (m *CMsgClientToGCRecordCompendiumStats) GetLinksFollowed() uint32 { - if m != nil && m.LinksFollowed != nil { - return *m.LinksFollowed - } - return 0 -} - -type CMsgGCToClientEventStatusChanged struct { - ActiveEvents []EEvent `protobuf:"varint,1,rep,name=active_events,enum=EEvent" json:"active_events,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientEventStatusChanged) Reset() { *m = CMsgGCToClientEventStatusChanged{} } -func (m *CMsgGCToClientEventStatusChanged) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientEventStatusChanged) ProtoMessage() {} -func (*CMsgGCToClientEventStatusChanged) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{293} -} - -func (m *CMsgGCToClientEventStatusChanged) GetActiveEvents() []EEvent { - if m != nil { - return m.ActiveEvents - } - return nil -} - -type CMsgClientToGCPlayerStatsRequest struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCPlayerStatsRequest) Reset() { *m = CMsgClientToGCPlayerStatsRequest{} } -func (m *CMsgClientToGCPlayerStatsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCPlayerStatsRequest) ProtoMessage() {} -func (*CMsgClientToGCPlayerStatsRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{294} -} - -func (m *CMsgClientToGCPlayerStatsRequest) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCToClientPlayerStatsResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - PlayerStats []float32 `protobuf:"fixed32,2,rep,name=player_stats" json:"player_stats,omitempty"` - MatchCount *uint32 `protobuf:"varint,3,opt,name=match_count" json:"match_count,omitempty"` - MeanGpm *float32 `protobuf:"fixed32,4,opt,name=mean_gpm" json:"mean_gpm,omitempty"` - MeanXppm *float32 `protobuf:"fixed32,5,opt,name=mean_xppm" json:"mean_xppm,omitempty"` - MeanLasthits *float32 `protobuf:"fixed32,6,opt,name=mean_lasthits" json:"mean_lasthits,omitempty"` - Rampages *uint32 `protobuf:"varint,7,opt,name=rampages" json:"rampages,omitempty"` - TripleKills *uint32 `protobuf:"varint,8,opt,name=triple_kills" json:"triple_kills,omitempty"` - FirstBloodClaimed *uint32 `protobuf:"varint,9,opt,name=first_blood_claimed" json:"first_blood_claimed,omitempty"` - FirstBloodGiven *uint32 `protobuf:"varint,10,opt,name=first_blood_given" json:"first_blood_given,omitempty"` - CouriersKilled *uint32 `protobuf:"varint,11,opt,name=couriers_killed" json:"couriers_killed,omitempty"` - AegisesSnatched *uint32 `protobuf:"varint,12,opt,name=aegises_snatched" json:"aegises_snatched,omitempty"` - CheesesEaten *uint32 `protobuf:"varint,13,opt,name=cheeses_eaten" json:"cheeses_eaten,omitempty"` - CreepsStacked *uint32 `protobuf:"varint,14,opt,name=creeps_stacked" json:"creeps_stacked,omitempty"` - FightScore *float32 `protobuf:"fixed32,15,opt,name=fight_score" json:"fight_score,omitempty"` - FarmScore *float32 `protobuf:"fixed32,16,opt,name=farm_score" json:"farm_score,omitempty"` - SupportScore *float32 `protobuf:"fixed32,17,opt,name=support_score" json:"support_score,omitempty"` - PushScore *float32 `protobuf:"fixed32,18,opt,name=push_score" json:"push_score,omitempty"` - VersatilityScore *float32 `protobuf:"fixed32,19,opt,name=versatility_score" json:"versatility_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientPlayerStatsResponse) Reset() { *m = CMsgGCToClientPlayerStatsResponse{} } -func (m *CMsgGCToClientPlayerStatsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientPlayerStatsResponse) ProtoMessage() {} -func (*CMsgGCToClientPlayerStatsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{295} -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetPlayerStats() []float32 { - if m != nil { - return m.PlayerStats - } - return nil -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetMatchCount() uint32 { - if m != nil && m.MatchCount != nil { - return *m.MatchCount - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetMeanGpm() float32 { - if m != nil && m.MeanGpm != nil { - return *m.MeanGpm - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetMeanXppm() float32 { - if m != nil && m.MeanXppm != nil { - return *m.MeanXppm - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetMeanLasthits() float32 { - if m != nil && m.MeanLasthits != nil { - return *m.MeanLasthits - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetRampages() uint32 { - if m != nil && m.Rampages != nil { - return *m.Rampages - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetTripleKills() uint32 { - if m != nil && m.TripleKills != nil { - return *m.TripleKills - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetFirstBloodClaimed() uint32 { - if m != nil && m.FirstBloodClaimed != nil { - return *m.FirstBloodClaimed - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetFirstBloodGiven() uint32 { - if m != nil && m.FirstBloodGiven != nil { - return *m.FirstBloodGiven - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetCouriersKilled() uint32 { - if m != nil && m.CouriersKilled != nil { - return *m.CouriersKilled - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetAegisesSnatched() uint32 { - if m != nil && m.AegisesSnatched != nil { - return *m.AegisesSnatched - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetCheesesEaten() uint32 { - if m != nil && m.CheesesEaten != nil { - return *m.CheesesEaten - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetCreepsStacked() uint32 { - if m != nil && m.CreepsStacked != nil { - return *m.CreepsStacked - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetFightScore() float32 { - if m != nil && m.FightScore != nil { - return *m.FightScore - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetFarmScore() float32 { - if m != nil && m.FarmScore != nil { - return *m.FarmScore - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetSupportScore() float32 { - if m != nil && m.SupportScore != nil { - return *m.SupportScore - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetPushScore() float32 { - if m != nil && m.PushScore != nil { - return *m.PushScore - } - return 0 -} - -func (m *CMsgGCToClientPlayerStatsResponse) GetVersatilityScore() float32 { - if m != nil && m.VersatilityScore != nil { - return *m.VersatilityScore - } - return 0 -} - -type CMsgClientToGCCustomGamePlayerCountRequest struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCustomGamePlayerCountRequest) Reset() { - *m = CMsgClientToGCCustomGamePlayerCountRequest{} -} -func (m *CMsgClientToGCCustomGamePlayerCountRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCCustomGamePlayerCountRequest) ProtoMessage() {} -func (*CMsgClientToGCCustomGamePlayerCountRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{296} -} - -func (m *CMsgClientToGCCustomGamePlayerCountRequest) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -type CMsgGCToClientCustomGamePlayerCountResponse struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - PlayerCount *uint64 `protobuf:"varint,2,opt,name=player_count" json:"player_count,omitempty"` - SpectatorCount *uint64 `protobuf:"varint,3,opt,name=spectator_count" json:"spectator_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientCustomGamePlayerCountResponse) Reset() { - *m = CMsgGCToClientCustomGamePlayerCountResponse{} -} -func (m *CMsgGCToClientCustomGamePlayerCountResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientCustomGamePlayerCountResponse) ProtoMessage() {} -func (*CMsgGCToClientCustomGamePlayerCountResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{297} -} - -func (m *CMsgGCToClientCustomGamePlayerCountResponse) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgGCToClientCustomGamePlayerCountResponse) GetPlayerCount() uint64 { - if m != nil && m.PlayerCount != nil { - return *m.PlayerCount - } - return 0 -} - -func (m *CMsgGCToClientCustomGamePlayerCountResponse) GetSpectatorCount() uint64 { - if m != nil && m.SpectatorCount != nil { - return *m.SpectatorCount - } - return 0 -} - -type CMsgClientToGCCustomGamesFriendsPlayedRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCustomGamesFriendsPlayedRequest) Reset() { - *m = CMsgClientToGCCustomGamesFriendsPlayedRequest{} -} -func (m *CMsgClientToGCCustomGamesFriendsPlayedRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCCustomGamesFriendsPlayedRequest) ProtoMessage() {} -func (*CMsgClientToGCCustomGamesFriendsPlayedRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{298} -} - -type CMsgGCToClientCustomGamesFriendsPlayedResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Games []*CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame `protobuf:"bytes,2,rep,name=games" json:"games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse) Reset() { - *m = CMsgGCToClientCustomGamesFriendsPlayedResponse{} -} -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientCustomGamesFriendsPlayedResponse) ProtoMessage() {} -func (*CMsgGCToClientCustomGamesFriendsPlayedResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{299} -} - -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse) GetGames() []*CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame { - if m != nil { - return m.Games - } - return nil -} - -type CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - AccountIds []uint32 `protobuf:"varint,2,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame) Reset() { - *m = CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame{} -} -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame) ProtoMessage() {} -func (*CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{299, 0} -} - -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgClientToGCSocialFeedPostCommentRequest struct { - EventId *uint64 `protobuf:"varint,1,opt,name=event_id" json:"event_id,omitempty"` - Comment *string `protobuf:"bytes,2,opt,name=comment" json:"comment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSocialFeedPostCommentRequest) Reset() { - *m = CMsgClientToGCSocialFeedPostCommentRequest{} -} -func (m *CMsgClientToGCSocialFeedPostCommentRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCSocialFeedPostCommentRequest) ProtoMessage() {} -func (*CMsgClientToGCSocialFeedPostCommentRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{300} -} - -func (m *CMsgClientToGCSocialFeedPostCommentRequest) GetEventId() uint64 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgClientToGCSocialFeedPostCommentRequest) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment - } - return "" -} - -type CMsgGCToClientSocialFeedPostCommentResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientSocialFeedPostCommentResponse) Reset() { - *m = CMsgGCToClientSocialFeedPostCommentResponse{} -} -func (m *CMsgGCToClientSocialFeedPostCommentResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientSocialFeedPostCommentResponse) ProtoMessage() {} -func (*CMsgGCToClientSocialFeedPostCommentResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{301} -} - -func (m *CMsgGCToClientSocialFeedPostCommentResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CMsgClientToGCSocialFeedPostMessageRequest struct { - Message *string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - MatchId *uint64 `protobuf:"varint,2,opt,name=match_id" json:"match_id,omitempty"` - MatchTimestamp *uint32 `protobuf:"varint,3,opt,name=match_timestamp" json:"match_timestamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSocialFeedPostMessageRequest) Reset() { - *m = CMsgClientToGCSocialFeedPostMessageRequest{} -} -func (m *CMsgClientToGCSocialFeedPostMessageRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCSocialFeedPostMessageRequest) ProtoMessage() {} -func (*CMsgClientToGCSocialFeedPostMessageRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{302} -} - -func (m *CMsgClientToGCSocialFeedPostMessageRequest) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgClientToGCSocialFeedPostMessageRequest) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgClientToGCSocialFeedPostMessageRequest) GetMatchTimestamp() uint32 { - if m != nil && m.MatchTimestamp != nil { - return *m.MatchTimestamp - } - return 0 -} - -type CMsgGCToClientSocialFeedPostMessageResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientSocialFeedPostMessageResponse) Reset() { - *m = CMsgGCToClientSocialFeedPostMessageResponse{} -} -func (m *CMsgGCToClientSocialFeedPostMessageResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientSocialFeedPostMessageResponse) ProtoMessage() {} -func (*CMsgGCToClientSocialFeedPostMessageResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{303} -} - -func (m *CMsgGCToClientSocialFeedPostMessageResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CMsgClientToGCFriendsPlayedCustomGameRequest struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCFriendsPlayedCustomGameRequest) Reset() { - *m = CMsgClientToGCFriendsPlayedCustomGameRequest{} -} -func (m *CMsgClientToGCFriendsPlayedCustomGameRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCFriendsPlayedCustomGameRequest) ProtoMessage() {} -func (*CMsgClientToGCFriendsPlayedCustomGameRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{304} -} - -func (m *CMsgClientToGCFriendsPlayedCustomGameRequest) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -type CMsgGCToClientFriendsPlayedCustomGameResponse struct { - CustomGameId *uint64 `protobuf:"varint,1,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - AccountIds []uint32 `protobuf:"varint,2,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFriendsPlayedCustomGameResponse) Reset() { - *m = CMsgGCToClientFriendsPlayedCustomGameResponse{} -} -func (m *CMsgGCToClientFriendsPlayedCustomGameResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientFriendsPlayedCustomGameResponse) ProtoMessage() {} -func (*CMsgGCToClientFriendsPlayedCustomGameResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{305} -} - -func (m *CMsgGCToClientFriendsPlayedCustomGameResponse) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgGCToClientFriendsPlayedCustomGameResponse) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgClientToGCFeaturedHeroesRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCFeaturedHeroesRequest) Reset() { *m = CMsgClientToGCFeaturedHeroesRequest{} } -func (m *CMsgClientToGCFeaturedHeroesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCFeaturedHeroesRequest) ProtoMessage() {} -func (*CMsgClientToGCFeaturedHeroesRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{306} -} - -type CMsgGCToClientFeaturedHeroesResponse struct { - Categories []*CMsgGCToClientFeaturedHeroesResponse_Category `protobuf:"bytes,1,rep,name=categories" json:"categories,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFeaturedHeroesResponse) Reset() { *m = CMsgGCToClientFeaturedHeroesResponse{} } -func (m *CMsgGCToClientFeaturedHeroesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientFeaturedHeroesResponse) ProtoMessage() {} -func (*CMsgGCToClientFeaturedHeroesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{307} -} - -func (m *CMsgGCToClientFeaturedHeroesResponse) GetCategories() []*CMsgGCToClientFeaturedHeroesResponse_Category { - if m != nil { - return m.Categories - } - return nil -} - -type CMsgGCToClientFeaturedHeroesResponse_DataField struct { - DataType *EFeaturedHeroDataType `protobuf:"varint,1,opt,name=data_type,enum=EFeaturedHeroDataType,def=0" json:"data_type,omitempty"` - Uint32Value *uint32 `protobuf:"varint,2,opt,name=uint32_value" json:"uint32_value,omitempty"` - Uint64Value *uint64 `protobuf:"varint,3,opt,name=uint64_value" json:"uint64_value,omitempty"` - StringValue *string `protobuf:"bytes,4,opt,name=string_value" json:"string_value,omitempty"` - FloatValue *float32 `protobuf:"fixed32,5,opt,name=float_value" json:"float_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) Reset() { - *m = CMsgGCToClientFeaturedHeroesResponse_DataField{} -} -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientFeaturedHeroesResponse_DataField) ProtoMessage() {} -func (*CMsgGCToClientFeaturedHeroesResponse_DataField) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{307, 0} -} - -const Default_CMsgGCToClientFeaturedHeroesResponse_DataField_DataType EFeaturedHeroDataType = EFeaturedHeroDataType_k_EFeaturedHeroDataType_HeroID - -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) GetDataType() EFeaturedHeroDataType { - if m != nil && m.DataType != nil { - return *m.DataType - } - return Default_CMsgGCToClientFeaturedHeroesResponse_DataField_DataType -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) GetUint32Value() uint32 { - if m != nil && m.Uint32Value != nil { - return *m.Uint32Value - } - return 0 -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) GetUint64Value() uint64 { - if m != nil && m.Uint64Value != nil { - return *m.Uint64Value - } - return 0 -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) GetStringValue() string { - if m != nil && m.StringValue != nil { - return *m.StringValue - } - return "" -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_DataField) GetFloatValue() float32 { - if m != nil && m.FloatValue != nil { - return *m.FloatValue - } - return 0 -} - -type CMsgGCToClientFeaturedHeroesResponse_FeaturedHero struct { - DataFields []*CMsgGCToClientFeaturedHeroesResponse_DataField `protobuf:"bytes,1,rep,name=data_fields" json:"data_fields,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_FeaturedHero) Reset() { - *m = CMsgGCToClientFeaturedHeroesResponse_FeaturedHero{} -} -func (m *CMsgGCToClientFeaturedHeroesResponse_FeaturedHero) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientFeaturedHeroesResponse_FeaturedHero) ProtoMessage() {} -func (*CMsgGCToClientFeaturedHeroesResponse_FeaturedHero) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{307, 1} -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_FeaturedHero) GetDataFields() []*CMsgGCToClientFeaturedHeroesResponse_DataField { - if m != nil { - return m.DataFields - } - return nil -} - -type CMsgGCToClientFeaturedHeroesResponse_Category struct { - CategoryWeight *int32 `protobuf:"varint,1,opt,name=category_weight" json:"category_weight,omitempty"` - TextFields []EFeaturedHeroTextField `protobuf:"varint,2,rep,name=text_fields,enum=EFeaturedHeroTextField" json:"text_fields,omitempty"` - FeaturedHeroes []*CMsgGCToClientFeaturedHeroesResponse_FeaturedHero `protobuf:"bytes,3,rep,name=featured_heroes" json:"featured_heroes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_Category) Reset() { - *m = CMsgGCToClientFeaturedHeroesResponse_Category{} -} -func (m *CMsgGCToClientFeaturedHeroesResponse_Category) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientFeaturedHeroesResponse_Category) ProtoMessage() {} -func (*CMsgGCToClientFeaturedHeroesResponse_Category) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{307, 2} -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_Category) GetCategoryWeight() int32 { - if m != nil && m.CategoryWeight != nil { - return *m.CategoryWeight - } - return 0 -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_Category) GetTextFields() []EFeaturedHeroTextField { - if m != nil { - return m.TextFields - } - return nil -} - -func (m *CMsgGCToClientFeaturedHeroesResponse_Category) GetFeaturedHeroes() []*CMsgGCToClientFeaturedHeroesResponse_FeaturedHero { - if m != nil { - return m.FeaturedHeroes - } - return nil -} - -type CMsgClientToGCSocialMatchPostCommentRequest struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - Comment *string `protobuf:"bytes,2,opt,name=comment" json:"comment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSocialMatchPostCommentRequest) Reset() { - *m = CMsgClientToGCSocialMatchPostCommentRequest{} -} -func (m *CMsgClientToGCSocialMatchPostCommentRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCSocialMatchPostCommentRequest) ProtoMessage() {} -func (*CMsgClientToGCSocialMatchPostCommentRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{308} -} - -func (m *CMsgClientToGCSocialMatchPostCommentRequest) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgClientToGCSocialMatchPostCommentRequest) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment - } - return "" -} - -type CMsgGCToClientSocialMatchPostCommentResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientSocialMatchPostCommentResponse) Reset() { - *m = CMsgGCToClientSocialMatchPostCommentResponse{} -} -func (m *CMsgGCToClientSocialMatchPostCommentResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientSocialMatchPostCommentResponse) ProtoMessage() {} -func (*CMsgGCToClientSocialMatchPostCommentResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{309} -} - -func (m *CMsgGCToClientSocialMatchPostCommentResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CMsgClientToGCSocialMatchDetailsRequest struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - PaginationTimestamp *uint32 `protobuf:"varint,2,opt,name=pagination_timestamp" json:"pagination_timestamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSocialMatchDetailsRequest) Reset() { - *m = CMsgClientToGCSocialMatchDetailsRequest{} -} -func (m *CMsgClientToGCSocialMatchDetailsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSocialMatchDetailsRequest) ProtoMessage() {} -func (*CMsgClientToGCSocialMatchDetailsRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{310} -} - -func (m *CMsgClientToGCSocialMatchDetailsRequest) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgClientToGCSocialMatchDetailsRequest) GetPaginationTimestamp() uint32 { - if m != nil && m.PaginationTimestamp != nil { - return *m.PaginationTimestamp - } - return 0 -} - -type CMsgGCToClientSocialMatchDetailsResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - Comments []*CMsgGCToClientSocialMatchDetailsResponse_Comment `protobuf:"bytes,2,rep,name=comments" json:"comments,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse) Reset() { - *m = CMsgGCToClientSocialMatchDetailsResponse{} -} -func (m *CMsgGCToClientSocialMatchDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientSocialMatchDetailsResponse) ProtoMessage() {} -func (*CMsgGCToClientSocialMatchDetailsResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{311} -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse) GetComments() []*CMsgGCToClientSocialMatchDetailsResponse_Comment { - if m != nil { - return m.Comments - } - return nil -} - -type CMsgGCToClientSocialMatchDetailsResponse_Comment struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - Timestamp *uint32 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` - Comment *string `protobuf:"bytes,4,opt,name=comment" json:"comment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse_Comment) Reset() { - *m = CMsgGCToClientSocialMatchDetailsResponse_Comment{} -} -func (m *CMsgGCToClientSocialMatchDetailsResponse_Comment) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientSocialMatchDetailsResponse_Comment) ProtoMessage() {} -func (*CMsgGCToClientSocialMatchDetailsResponse_Comment) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{311, 0} -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse_Comment) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse_Comment) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse_Comment) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgGCToClientSocialMatchDetailsResponse_Comment) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment - } - return "" -} - -type CMsgDOTAPartyMemberSetCoach struct { - WantsCoach *bool `protobuf:"varint,1,opt,name=wants_coach" json:"wants_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPartyMemberSetCoach) Reset() { *m = CMsgDOTAPartyMemberSetCoach{} } -func (m *CMsgDOTAPartyMemberSetCoach) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPartyMemberSetCoach) ProtoMessage() {} -func (*CMsgDOTAPartyMemberSetCoach) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{312} } - -func (m *CMsgDOTAPartyMemberSetCoach) GetWantsCoach() bool { - if m != nil && m.WantsCoach != nil { - return *m.WantsCoach - } - return false -} - -type CMsgDOTASetGroupLeader struct { - NewLeaderSteamid *uint64 `protobuf:"fixed64,1,opt,name=new_leader_steamid" json:"new_leader_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASetGroupLeader) Reset() { *m = CMsgDOTASetGroupLeader{} } -func (m *CMsgDOTASetGroupLeader) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASetGroupLeader) ProtoMessage() {} -func (*CMsgDOTASetGroupLeader) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{313} } - -func (m *CMsgDOTASetGroupLeader) GetNewLeaderSteamid() uint64 { - if m != nil && m.NewLeaderSteamid != nil { - return *m.NewLeaderSteamid - } - return 0 -} - -type CMsgDOTACancelGroupInvites struct { - InvitedSteamids []uint64 `protobuf:"fixed64,1,rep,name=invited_steamids" json:"invited_steamids,omitempty"` - InvitedGroupids []uint64 `protobuf:"fixed64,2,rep,name=invited_groupids" json:"invited_groupids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACancelGroupInvites) Reset() { *m = CMsgDOTACancelGroupInvites{} } -func (m *CMsgDOTACancelGroupInvites) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACancelGroupInvites) ProtoMessage() {} -func (*CMsgDOTACancelGroupInvites) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{314} } - -func (m *CMsgDOTACancelGroupInvites) GetInvitedSteamids() []uint64 { - if m != nil { - return m.InvitedSteamids - } - return nil -} - -func (m *CMsgDOTACancelGroupInvites) GetInvitedGroupids() []uint64 { - if m != nil { - return m.InvitedGroupids - } - return nil -} - -type CMsgDOTASetGroupOpenStatus struct { - Open *bool `protobuf:"varint,1,opt,name=open" json:"open,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASetGroupOpenStatus) Reset() { *m = CMsgDOTASetGroupOpenStatus{} } -func (m *CMsgDOTASetGroupOpenStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASetGroupOpenStatus) ProtoMessage() {} -func (*CMsgDOTASetGroupOpenStatus) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{315} } - -func (m *CMsgDOTASetGroupOpenStatus) GetOpen() bool { - if m != nil && m.Open != nil { - return *m.Open - } - return false -} - -type CMsgDOTAGroupMergeInvite struct { - OtherGroupId *uint64 `protobuf:"fixed64,1,opt,name=other_group_id" json:"other_group_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGroupMergeInvite) Reset() { *m = CMsgDOTAGroupMergeInvite{} } -func (m *CMsgDOTAGroupMergeInvite) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGroupMergeInvite) ProtoMessage() {} -func (*CMsgDOTAGroupMergeInvite) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{316} } - -func (m *CMsgDOTAGroupMergeInvite) GetOtherGroupId() uint64 { - if m != nil && m.OtherGroupId != nil { - return *m.OtherGroupId - } - return 0 -} - -type CMsgDOTAGroupMergeResponse struct { - InitiatorGroupId *uint64 `protobuf:"fixed64,1,opt,name=initiator_group_id" json:"initiator_group_id,omitempty"` - Accept *bool `protobuf:"varint,2,opt,name=accept" json:"accept,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGroupMergeResponse) Reset() { *m = CMsgDOTAGroupMergeResponse{} } -func (m *CMsgDOTAGroupMergeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGroupMergeResponse) ProtoMessage() {} -func (*CMsgDOTAGroupMergeResponse) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{317} } - -func (m *CMsgDOTAGroupMergeResponse) GetInitiatorGroupId() uint64 { - if m != nil && m.InitiatorGroupId != nil { - return *m.InitiatorGroupId - } - return 0 -} - -func (m *CMsgDOTAGroupMergeResponse) GetAccept() bool { - if m != nil && m.Accept != nil { - return *m.Accept - } - return false -} - -type CMsgDOTAGroupMergeReply struct { - Result *EDOTAGroupMergeResult `protobuf:"varint,1,opt,name=result,enum=EDOTAGroupMergeResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAGroupMergeReply) Reset() { *m = CMsgDOTAGroupMergeReply{} } -func (m *CMsgDOTAGroupMergeReply) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAGroupMergeReply) ProtoMessage() {} -func (*CMsgDOTAGroupMergeReply) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{318} } - -const Default_CMsgDOTAGroupMergeReply_Result EDOTAGroupMergeResult = EDOTAGroupMergeResult_k_EDOTAGroupMergeResult_OK - -func (m *CMsgDOTAGroupMergeReply) GetResult() EDOTAGroupMergeResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAGroupMergeReply_Result -} - -type CMsgDOTAPartyRichPresence struct { - PartyId *uint64 `protobuf:"fixed64,1,opt,name=party_id" json:"party_id,omitempty"` - PartyState *CSODOTAParty_State `protobuf:"varint,2,opt,name=party_state,enum=CSODOTAParty_State,def=0" json:"party_state,omitempty"` - Open *bool `protobuf:"varint,3,opt,name=open" json:"open,omitempty"` - LowPriority *bool `protobuf:"varint,5,opt,name=low_priority" json:"low_priority,omitempty"` - Members []*CMsgDOTAPartyRichPresence_Member `protobuf:"bytes,4,rep,name=members" json:"members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPartyRichPresence) Reset() { *m = CMsgDOTAPartyRichPresence{} } -func (m *CMsgDOTAPartyRichPresence) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPartyRichPresence) ProtoMessage() {} -func (*CMsgDOTAPartyRichPresence) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{319} } - -const Default_CMsgDOTAPartyRichPresence_PartyState CSODOTAParty_State = CSODOTAParty_UI - -func (m *CMsgDOTAPartyRichPresence) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgDOTAPartyRichPresence) GetPartyState() CSODOTAParty_State { - if m != nil && m.PartyState != nil { - return *m.PartyState - } - return Default_CMsgDOTAPartyRichPresence_PartyState -} - -func (m *CMsgDOTAPartyRichPresence) GetOpen() bool { - if m != nil && m.Open != nil { - return *m.Open - } - return false -} - -func (m *CMsgDOTAPartyRichPresence) GetLowPriority() bool { - if m != nil && m.LowPriority != nil { - return *m.LowPriority - } - return false -} - -func (m *CMsgDOTAPartyRichPresence) GetMembers() []*CMsgDOTAPartyRichPresence_Member { - if m != nil { - return m.Members - } - return nil -} - -type CMsgDOTAPartyRichPresence_Member struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - Coach *bool `protobuf:"varint,2,opt,name=coach" json:"coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPartyRichPresence_Member) Reset() { *m = CMsgDOTAPartyRichPresence_Member{} } -func (m *CMsgDOTAPartyRichPresence_Member) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPartyRichPresence_Member) ProtoMessage() {} -func (*CMsgDOTAPartyRichPresence_Member) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{319, 0} -} - -func (m *CMsgDOTAPartyRichPresence_Member) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAPartyRichPresence_Member) GetCoach() bool { - if m != nil && m.Coach != nil { - return *m.Coach - } - return false -} - -type CMsgDOTALobbyRichPresence struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - LobbyState *CSODOTALobby_State `protobuf:"varint,2,opt,name=lobby_state,enum=CSODOTALobby_State,def=0" json:"lobby_state,omitempty"` - Password *bool `protobuf:"varint,3,opt,name=password" json:"password,omitempty"` - GameMode *DOTA_GameMode `protobuf:"varint,4,opt,name=game_mode,enum=DOTA_GameMode,def=0" json:"game_mode,omitempty"` - MemberCount *uint32 `protobuf:"varint,5,opt,name=member_count" json:"member_count,omitempty"` - MaxMemberCount *uint32 `protobuf:"varint,6,opt,name=max_member_count" json:"max_member_count,omitempty"` - CustomGameId *uint64 `protobuf:"fixed64,7,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - Name *string `protobuf:"bytes,8,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTALobbyRichPresence) Reset() { *m = CMsgDOTALobbyRichPresence{} } -func (m *CMsgDOTALobbyRichPresence) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTALobbyRichPresence) ProtoMessage() {} -func (*CMsgDOTALobbyRichPresence) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{320} } - -const Default_CMsgDOTALobbyRichPresence_LobbyState CSODOTALobby_State = CSODOTALobby_UI -const Default_CMsgDOTALobbyRichPresence_GameMode DOTA_GameMode = DOTA_GameMode_DOTA_GAMEMODE_NONE - -func (m *CMsgDOTALobbyRichPresence) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgDOTALobbyRichPresence) GetLobbyState() CSODOTALobby_State { - if m != nil && m.LobbyState != nil { - return *m.LobbyState - } - return Default_CMsgDOTALobbyRichPresence_LobbyState -} - -func (m *CMsgDOTALobbyRichPresence) GetPassword() bool { - if m != nil && m.Password != nil { - return *m.Password - } - return false -} - -func (m *CMsgDOTALobbyRichPresence) GetGameMode() DOTA_GameMode { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return Default_CMsgDOTALobbyRichPresence_GameMode -} - -func (m *CMsgDOTALobbyRichPresence) GetMemberCount() uint32 { - if m != nil && m.MemberCount != nil { - return *m.MemberCount - } - return 0 -} - -func (m *CMsgDOTALobbyRichPresence) GetMaxMemberCount() uint32 { - if m != nil && m.MaxMemberCount != nil { - return *m.MaxMemberCount - } - return 0 -} - -func (m *CMsgDOTALobbyRichPresence) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgDOTALobbyRichPresence) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type CMsgDOTACustomGameListenServerStartedLoading struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - CustomGameId *uint64 `protobuf:"varint,2,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - LobbyMembers []uint32 `protobuf:"varint,3,rep,name=lobby_members" json:"lobby_members,omitempty"` - StartTime *uint32 `protobuf:"varint,4,opt,name=start_time" json:"start_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACustomGameListenServerStartedLoading) Reset() { - *m = CMsgDOTACustomGameListenServerStartedLoading{} -} -func (m *CMsgDOTACustomGameListenServerStartedLoading) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTACustomGameListenServerStartedLoading) ProtoMessage() {} -func (*CMsgDOTACustomGameListenServerStartedLoading) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{321} -} - -func (m *CMsgDOTACustomGameListenServerStartedLoading) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgDOTACustomGameListenServerStartedLoading) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CMsgDOTACustomGameListenServerStartedLoading) GetLobbyMembers() []uint32 { - if m != nil { - return m.LobbyMembers - } - return nil -} - -func (m *CMsgDOTACustomGameListenServerStartedLoading) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -type CMsgDOTACustomGameClientFinishedLoading struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - LoadingDuration *uint32 `protobuf:"varint,2,opt,name=loading_duration" json:"loading_duration,omitempty"` - ResultCode *int32 `protobuf:"zigzag32,3,opt,name=result_code" json:"result_code,omitempty"` - ResultString *string `protobuf:"bytes,4,opt,name=result_string" json:"result_string,omitempty"` - SignonStates *uint32 `protobuf:"varint,5,opt,name=signon_states" json:"signon_states,omitempty"` - Comment *string `protobuf:"bytes,6,opt,name=comment" json:"comment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) Reset() { - *m = CMsgDOTACustomGameClientFinishedLoading{} -} -func (m *CMsgDOTACustomGameClientFinishedLoading) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACustomGameClientFinishedLoading) ProtoMessage() {} -func (*CMsgDOTACustomGameClientFinishedLoading) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{322} -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) GetLoadingDuration() uint32 { - if m != nil && m.LoadingDuration != nil { - return *m.LoadingDuration - } - return 0 -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) GetResultCode() int32 { - if m != nil && m.ResultCode != nil { - return *m.ResultCode - } - return 0 -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) GetResultString() string { - if m != nil && m.ResultString != nil { - return *m.ResultString - } - return "" -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) GetSignonStates() uint32 { - if m != nil && m.SignonStates != nil { - return *m.SignonStates - } - return 0 -} - -func (m *CMsgDOTACustomGameClientFinishedLoading) GetComment() string { - if m != nil && m.Comment != nil { - return *m.Comment - } - return "" -} - -type CMsgClientToGCGetLeagueSeries struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetLeagueSeries) Reset() { *m = CMsgClientToGCGetLeagueSeries{} } -func (m *CMsgClientToGCGetLeagueSeries) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetLeagueSeries) ProtoMessage() {} -func (*CMsgClientToGCGetLeagueSeries) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{323} } - -func (m *CMsgClientToGCGetLeagueSeries) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgClientToGCGetLeagueSeriesResponse struct { - Series []*CMsgClientToGCGetLeagueSeriesResponse_Series `protobuf:"bytes,1,rep,name=series" json:"series,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse) Reset() { *m = CMsgClientToGCGetLeagueSeriesResponse{} } -func (m *CMsgClientToGCGetLeagueSeriesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetLeagueSeriesResponse) ProtoMessage() {} -func (*CMsgClientToGCGetLeagueSeriesResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{324} -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse) GetSeries() []*CMsgClientToGCGetLeagueSeriesResponse_Series { - if m != nil { - return m.Series - } - return nil -} - -type CMsgClientToGCGetLeagueSeriesResponse_Series struct { - SeriesId *uint32 `protobuf:"varint,1,opt,name=series_id" json:"series_id,omitempty"` - NumGames *uint32 `protobuf:"varint,2,opt,name=num_games" json:"num_games,omitempty"` - Teams []*CMsgClientToGCGetLeagueSeriesResponse_Series_Team `protobuf:"bytes,3,rep,name=teams" json:"teams,omitempty"` - SeriesName *string `protobuf:"bytes,4,opt,name=series_name" json:"series_name,omitempty"` - PhaseName *string `protobuf:"bytes,5,opt,name=phase_name" json:"phase_name,omitempty"` - StartTime *uint32 `protobuf:"varint,6,opt,name=start_time" json:"start_time,omitempty"` - AfterSeriesId *uint32 `protobuf:"varint,7,opt,name=after_series_id" json:"after_series_id,omitempty"` - NumCompletedGames *uint32 `protobuf:"varint,8,opt,name=num_completed_games" json:"num_completed_games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) Reset() { - *m = CMsgClientToGCGetLeagueSeriesResponse_Series{} -} -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCGetLeagueSeriesResponse_Series) ProtoMessage() {} -func (*CMsgClientToGCGetLeagueSeriesResponse_Series) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{324, 0} -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetSeriesId() uint32 { - if m != nil && m.SeriesId != nil { - return *m.SeriesId - } - return 0 -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetNumGames() uint32 { - if m != nil && m.NumGames != nil { - return *m.NumGames - } - return 0 -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetTeams() []*CMsgClientToGCGetLeagueSeriesResponse_Series_Team { - if m != nil { - return m.Teams - } - return nil -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetSeriesName() string { - if m != nil && m.SeriesName != nil { - return *m.SeriesName - } - return "" -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetPhaseName() string { - if m != nil && m.PhaseName != nil { - return *m.PhaseName - } - return "" -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetAfterSeriesId() uint32 { - if m != nil && m.AfterSeriesId != nil { - return *m.AfterSeriesId - } - return 0 -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series) GetNumCompletedGames() uint32 { - if m != nil && m.NumCompletedGames != nil { - return *m.NumCompletedGames - } - return 0 -} - -type CMsgClientToGCGetLeagueSeriesResponse_Series_Team struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - TeamName *string `protobuf:"bytes,2,opt,name=team_name" json:"team_name,omitempty"` - TeamTag *string `protobuf:"bytes,3,opt,name=team_tag" json:"team_tag,omitempty"` - TeamScore *uint32 `protobuf:"varint,4,opt,name=team_score" json:"team_score,omitempty"` - TeamWins *uint32 `protobuf:"varint,5,opt,name=team_wins" json:"team_wins,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) Reset() { - *m = CMsgClientToGCGetLeagueSeriesResponse_Series_Team{} -} -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCGetLeagueSeriesResponse_Series_Team) ProtoMessage() {} -func (*CMsgClientToGCGetLeagueSeriesResponse_Series_Team) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{324, 0, 0} -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) GetTeamTag() string { - if m != nil && m.TeamTag != nil { - return *m.TeamTag - } - return "" -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) GetTeamScore() uint32 { - if m != nil && m.TeamScore != nil { - return *m.TeamScore - } - return 0 -} - -func (m *CMsgClientToGCGetLeagueSeriesResponse_Series_Team) GetTeamWins() uint32 { - if m != nil && m.TeamWins != nil { - return *m.TeamWins - } - return 0 -} - -type CMsgClientToGCApplyGemCombiner struct { - ItemId_1 *uint64 `protobuf:"varint,1,opt,name=item_id_1" json:"item_id_1,omitempty"` - ItemId_2 *uint64 `protobuf:"varint,2,opt,name=item_id_2" json:"item_id_2,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCApplyGemCombiner) Reset() { *m = CMsgClientToGCApplyGemCombiner{} } -func (m *CMsgClientToGCApplyGemCombiner) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCApplyGemCombiner) ProtoMessage() {} -func (*CMsgClientToGCApplyGemCombiner) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{325} -} - -func (m *CMsgClientToGCApplyGemCombiner) GetItemId_1() uint64 { - if m != nil && m.ItemId_1 != nil { - return *m.ItemId_1 - } - return 0 -} - -func (m *CMsgClientToGCApplyGemCombiner) GetItemId_2() uint64 { - if m != nil && m.ItemId_2 != nil { - return *m.ItemId_2 - } - return 0 -} - -type CDummyUnbreakMessage struct { - DummyField *CMsgDOTAClearTournamentGame `protobuf:"bytes,1,opt,name=dummy_field" json:"dummy_field,omitempty"` - AnotherDummyField *ETournamentState `protobuf:"varint,2,opt,name=another_dummy_field,enum=ETournamentState,def=0" json:"another_dummy_field,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDummyUnbreakMessage) Reset() { *m = CDummyUnbreakMessage{} } -func (m *CDummyUnbreakMessage) String() string { return proto.CompactTextString(m) } -func (*CDummyUnbreakMessage) ProtoMessage() {} -func (*CDummyUnbreakMessage) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{326} } - -const Default_CDummyUnbreakMessage_AnotherDummyField ETournamentState = ETournamentState_k_ETournamentState_Unknown - -func (m *CDummyUnbreakMessage) GetDummyField() *CMsgDOTAClearTournamentGame { - if m != nil { - return m.DummyField - } - return nil -} - -func (m *CDummyUnbreakMessage) GetAnotherDummyField() ETournamentState { - if m != nil && m.AnotherDummyField != nil { - return *m.AnotherDummyField - } - return Default_CDummyUnbreakMessage_AnotherDummyField -} - -type CMsgClientToGCCreateStaticRecipe struct { - Items []*CMsgClientToGCCreateStaticRecipe_Item `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` - RecipeDefIndex *uint32 `protobuf:"varint,2,opt,name=recipe_def_index" json:"recipe_def_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCreateStaticRecipe) Reset() { *m = CMsgClientToGCCreateStaticRecipe{} } -func (m *CMsgClientToGCCreateStaticRecipe) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCCreateStaticRecipe) ProtoMessage() {} -func (*CMsgClientToGCCreateStaticRecipe) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{327} -} - -func (m *CMsgClientToGCCreateStaticRecipe) GetItems() []*CMsgClientToGCCreateStaticRecipe_Item { - if m != nil { - return m.Items - } - return nil -} - -func (m *CMsgClientToGCCreateStaticRecipe) GetRecipeDefIndex() uint32 { - if m != nil && m.RecipeDefIndex != nil { - return *m.RecipeDefIndex - } - return 0 -} - -type CMsgClientToGCCreateStaticRecipe_Item struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - SlotId *uint32 `protobuf:"varint,2,opt,name=slot_id" json:"slot_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCreateStaticRecipe_Item) Reset() { *m = CMsgClientToGCCreateStaticRecipe_Item{} } -func (m *CMsgClientToGCCreateStaticRecipe_Item) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCCreateStaticRecipe_Item) ProtoMessage() {} -func (*CMsgClientToGCCreateStaticRecipe_Item) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{327, 0} -} - -func (m *CMsgClientToGCCreateStaticRecipe_Item) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgClientToGCCreateStaticRecipe_Item) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -type CMsgClientToGCCreateStaticRecipeResponse struct { - Response *CMsgClientToGCCreateStaticRecipeResponse_EResponse `protobuf:"varint,1,opt,name=response,enum=CMsgClientToGCCreateStaticRecipeResponse_EResponse,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCCreateStaticRecipeResponse) Reset() { - *m = CMsgClientToGCCreateStaticRecipeResponse{} -} -func (m *CMsgClientToGCCreateStaticRecipeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCCreateStaticRecipeResponse) ProtoMessage() {} -func (*CMsgClientToGCCreateStaticRecipeResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{328} -} - -const Default_CMsgClientToGCCreateStaticRecipeResponse_Response CMsgClientToGCCreateStaticRecipeResponse_EResponse = CMsgClientToGCCreateStaticRecipeResponse_eResponse_Success - -func (m *CMsgClientToGCCreateStaticRecipeResponse) GetResponse() CMsgClientToGCCreateStaticRecipeResponse_EResponse { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCCreateStaticRecipeResponse_Response -} - -type CDOTAReplayDownloadInfo struct { - Match *CMsgDOTAMatchMinimal `protobuf:"bytes,1,opt,name=match" json:"match,omitempty"` - Title *string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` - Description *string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - Size *uint32 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` - Tags []string `protobuf:"bytes,5,rep,name=tags" json:"tags,omitempty"` - ExistsOnDisk *bool `protobuf:"varint,6,opt,name=exists_on_disk" json:"exists_on_disk,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTAReplayDownloadInfo) Reset() { *m = CDOTAReplayDownloadInfo{} } -func (m *CDOTAReplayDownloadInfo) String() string { return proto.CompactTextString(m) } -func (*CDOTAReplayDownloadInfo) ProtoMessage() {} -func (*CDOTAReplayDownloadInfo) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{329} } - -func (m *CDOTAReplayDownloadInfo) GetMatch() *CMsgDOTAMatchMinimal { - if m != nil { - return m.Match - } - return nil -} - -func (m *CDOTAReplayDownloadInfo) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *CDOTAReplayDownloadInfo) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CDOTAReplayDownloadInfo) GetSize() uint32 { - if m != nil && m.Size != nil { - return *m.Size - } - return 0 -} - -func (m *CDOTAReplayDownloadInfo) GetTags() []string { - if m != nil { - return m.Tags - } - return nil -} - -func (m *CDOTAReplayDownloadInfo) GetExistsOnDisk() bool { - if m != nil && m.ExistsOnDisk != nil { - return *m.ExistsOnDisk - } - return false -} - -type CDOTAReplayDownloadInfo_Highlight struct { - Timestamp *uint32 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - Description *string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTAReplayDownloadInfo_Highlight) Reset() { *m = CDOTAReplayDownloadInfo_Highlight{} } -func (m *CDOTAReplayDownloadInfo_Highlight) String() string { return proto.CompactTextString(m) } -func (*CDOTAReplayDownloadInfo_Highlight) ProtoMessage() {} -func (*CDOTAReplayDownloadInfo_Highlight) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{329, 0} -} - -func (m *CDOTAReplayDownloadInfo_Highlight) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CDOTAReplayDownloadInfo_Highlight) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -type CDOTABroadcasterInfo struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ServerSteamId *uint64 `protobuf:"fixed64,2,opt,name=server_steam_id" json:"server_steam_id,omitempty"` - Live *bool `protobuf:"varint,3,opt,name=live" json:"live,omitempty"` - TeamNameRadiant *string `protobuf:"bytes,4,opt,name=team_name_radiant" json:"team_name_radiant,omitempty"` - TeamNameDire *string `protobuf:"bytes,5,opt,name=team_name_dire" json:"team_name_dire,omitempty"` - StageName *string `protobuf:"bytes,6,opt,name=stage_name" json:"stage_name,omitempty"` - SeriesGame *uint32 `protobuf:"varint,7,opt,name=series_game" json:"series_game,omitempty"` - SeriesType *uint32 `protobuf:"varint,8,opt,name=series_type" json:"series_type,omitempty"` - UpcomingBroadcastTimestamp *uint32 `protobuf:"varint,9,opt,name=upcoming_broadcast_timestamp" json:"upcoming_broadcast_timestamp,omitempty"` - AllowLiveVideo *bool `protobuf:"varint,10,opt,name=allow_live_video" json:"allow_live_video,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTABroadcasterInfo) Reset() { *m = CDOTABroadcasterInfo{} } -func (m *CDOTABroadcasterInfo) String() string { return proto.CompactTextString(m) } -func (*CDOTABroadcasterInfo) ProtoMessage() {} -func (*CDOTABroadcasterInfo) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{330} } - -func (m *CDOTABroadcasterInfo) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CDOTABroadcasterInfo) GetServerSteamId() uint64 { - if m != nil && m.ServerSteamId != nil { - return *m.ServerSteamId - } - return 0 -} - -func (m *CDOTABroadcasterInfo) GetLive() bool { - if m != nil && m.Live != nil { - return *m.Live - } - return false -} - -func (m *CDOTABroadcasterInfo) GetTeamNameRadiant() string { - if m != nil && m.TeamNameRadiant != nil { - return *m.TeamNameRadiant - } - return "" -} - -func (m *CDOTABroadcasterInfo) GetTeamNameDire() string { - if m != nil && m.TeamNameDire != nil { - return *m.TeamNameDire - } - return "" -} - -func (m *CDOTABroadcasterInfo) GetStageName() string { - if m != nil && m.StageName != nil { - return *m.StageName - } - return "" -} - -func (m *CDOTABroadcasterInfo) GetSeriesGame() uint32 { - if m != nil && m.SeriesGame != nil { - return *m.SeriesGame - } - return 0 -} - -func (m *CDOTABroadcasterInfo) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CDOTABroadcasterInfo) GetUpcomingBroadcastTimestamp() uint32 { - if m != nil && m.UpcomingBroadcastTimestamp != nil { - return *m.UpcomingBroadcastTimestamp - } - return 0 -} - -func (m *CDOTABroadcasterInfo) GetAllowLiveVideo() bool { - if m != nil && m.AllowLiveVideo != nil { - return *m.AllowLiveVideo - } - return false -} - -type CMsgClientToGCH264Unsupported struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCH264Unsupported) Reset() { *m = CMsgClientToGCH264Unsupported{} } -func (m *CMsgClientToGCH264Unsupported) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCH264Unsupported) ProtoMessage() {} -func (*CMsgClientToGCH264Unsupported) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{331} } - -type CMsgClientToGCRequestH264Support struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCRequestH264Support) Reset() { *m = CMsgClientToGCRequestH264Support{} } -func (m *CMsgClientToGCRequestH264Support) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCRequestH264Support) ProtoMessage() {} -func (*CMsgClientToGCRequestH264Support) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{332} -} - -type CMsgClientToGCGetQuestProgress struct { - QuestIds []uint32 `protobuf:"varint,1,rep,name=quest_ids" json:"quest_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetQuestProgress) Reset() { *m = CMsgClientToGCGetQuestProgress{} } -func (m *CMsgClientToGCGetQuestProgress) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetQuestProgress) ProtoMessage() {} -func (*CMsgClientToGCGetQuestProgress) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{333} -} - -func (m *CMsgClientToGCGetQuestProgress) GetQuestIds() []uint32 { - if m != nil { - return m.QuestIds - } - return nil -} - -type CMsgClientToGCGetQuestProgressResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - Quests []*CMsgClientToGCGetQuestProgressResponse_Quest `protobuf:"bytes,2,rep,name=quests" json:"quests,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetQuestProgressResponse) Reset() { - *m = CMsgClientToGCGetQuestProgressResponse{} -} -func (m *CMsgClientToGCGetQuestProgressResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCGetQuestProgressResponse) ProtoMessage() {} -func (*CMsgClientToGCGetQuestProgressResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{334} -} - -func (m *CMsgClientToGCGetQuestProgressResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *CMsgClientToGCGetQuestProgressResponse) GetQuests() []*CMsgClientToGCGetQuestProgressResponse_Quest { - if m != nil { - return m.Quests - } - return nil -} - -type CMsgClientToGCGetQuestProgressResponse_Challenge struct { - ChallengeId *uint32 `protobuf:"varint,1,opt,name=challenge_id" json:"challenge_id,omitempty"` - TimeCompleted *uint32 `protobuf:"varint,2,opt,name=time_completed" json:"time_completed,omitempty"` - Attempts *uint32 `protobuf:"varint,3,opt,name=attempts" json:"attempts,omitempty"` - HeroId *uint32 `protobuf:"varint,4,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Challenge) Reset() { - *m = CMsgClientToGCGetQuestProgressResponse_Challenge{} -} -func (m *CMsgClientToGCGetQuestProgressResponse_Challenge) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCGetQuestProgressResponse_Challenge) ProtoMessage() {} -func (*CMsgClientToGCGetQuestProgressResponse_Challenge) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{334, 0} -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Challenge) GetChallengeId() uint32 { - if m != nil && m.ChallengeId != nil { - return *m.ChallengeId - } - return 0 -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Challenge) GetTimeCompleted() uint32 { - if m != nil && m.TimeCompleted != nil { - return *m.TimeCompleted - } - return 0 -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Challenge) GetAttempts() uint32 { - if m != nil && m.Attempts != nil { - return *m.Attempts - } - return 0 -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Challenge) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgClientToGCGetQuestProgressResponse_Quest struct { - QuestId *uint32 `protobuf:"varint,1,opt,name=quest_id" json:"quest_id,omitempty"` - CompletedChallenges []*CMsgClientToGCGetQuestProgressResponse_Challenge `protobuf:"bytes,2,rep,name=completed_challenges" json:"completed_challenges,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Quest) Reset() { - *m = CMsgClientToGCGetQuestProgressResponse_Quest{} -} -func (m *CMsgClientToGCGetQuestProgressResponse_Quest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgClientToGCGetQuestProgressResponse_Quest) ProtoMessage() {} -func (*CMsgClientToGCGetQuestProgressResponse_Quest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{334, 1} -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Quest) GetQuestId() uint32 { - if m != nil && m.QuestId != nil { - return *m.QuestId - } - return 0 -} - -func (m *CMsgClientToGCGetQuestProgressResponse_Quest) GetCompletedChallenges() []*CMsgClientToGCGetQuestProgressResponse_Challenge { - if m != nil { - return m.CompletedChallenges - } - return nil -} - -type CMsgGCToClientMatchSignedOut struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientMatchSignedOut) Reset() { *m = CMsgGCToClientMatchSignedOut{} } -func (m *CMsgGCToClientMatchSignedOut) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientMatchSignedOut) ProtoMessage() {} -func (*CMsgGCToClientMatchSignedOut) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{335} } - -func (m *CMsgGCToClientMatchSignedOut) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -type CMsgGCGetHeroStatsHistory struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCGetHeroStatsHistory) Reset() { *m = CMsgGCGetHeroStatsHistory{} } -func (m *CMsgGCGetHeroStatsHistory) String() string { return proto.CompactTextString(m) } -func (*CMsgGCGetHeroStatsHistory) ProtoMessage() {} -func (*CMsgGCGetHeroStatsHistory) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{336} } - -func (m *CMsgGCGetHeroStatsHistory) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgGCGetHeroStatsHistoryResponse struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - Records []*CMsgDOTASDOHeroStatsHistory `protobuf:"bytes,2,rep,name=records" json:"records,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCGetHeroStatsHistoryResponse) Reset() { *m = CMsgGCGetHeroStatsHistoryResponse{} } -func (m *CMsgGCGetHeroStatsHistoryResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCGetHeroStatsHistoryResponse) ProtoMessage() {} -func (*CMsgGCGetHeroStatsHistoryResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{337} -} - -func (m *CMsgGCGetHeroStatsHistoryResponse) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgGCGetHeroStatsHistoryResponse) GetRecords() []*CMsgDOTASDOHeroStatsHistory { - if m != nil { - return m.Records - } - return nil -} - -type CMsgClientToGCPrivateChatInvite struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - InvitedAccountId *uint32 `protobuf:"varint,2,opt,name=invited_account_id" json:"invited_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCPrivateChatInvite) Reset() { *m = CMsgClientToGCPrivateChatInvite{} } -func (m *CMsgClientToGCPrivateChatInvite) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCPrivateChatInvite) ProtoMessage() {} -func (*CMsgClientToGCPrivateChatInvite) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{338} -} - -func (m *CMsgClientToGCPrivateChatInvite) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -func (m *CMsgClientToGCPrivateChatInvite) GetInvitedAccountId() uint32 { - if m != nil && m.InvitedAccountId != nil { - return *m.InvitedAccountId - } - return 0 -} - -type CMsgClientToGCPrivateChatKick struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - KickAccountId *uint32 `protobuf:"varint,2,opt,name=kick_account_id" json:"kick_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCPrivateChatKick) Reset() { *m = CMsgClientToGCPrivateChatKick{} } -func (m *CMsgClientToGCPrivateChatKick) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCPrivateChatKick) ProtoMessage() {} -func (*CMsgClientToGCPrivateChatKick) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{339} } - -func (m *CMsgClientToGCPrivateChatKick) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -func (m *CMsgClientToGCPrivateChatKick) GetKickAccountId() uint32 { - if m != nil && m.KickAccountId != nil { - return *m.KickAccountId - } - return 0 -} - -type CMsgClientToGCPrivateChatPromote struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - PromoteAccountId *uint32 `protobuf:"varint,2,opt,name=promote_account_id" json:"promote_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCPrivateChatPromote) Reset() { *m = CMsgClientToGCPrivateChatPromote{} } -func (m *CMsgClientToGCPrivateChatPromote) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCPrivateChatPromote) ProtoMessage() {} -func (*CMsgClientToGCPrivateChatPromote) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{340} -} - -func (m *CMsgClientToGCPrivateChatPromote) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -func (m *CMsgClientToGCPrivateChatPromote) GetPromoteAccountId() uint32 { - if m != nil && m.PromoteAccountId != nil { - return *m.PromoteAccountId - } - return 0 -} - -type CMsgClientToGCPrivateChatDemote struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - DemoteAccountId *uint32 `protobuf:"varint,2,opt,name=demote_account_id" json:"demote_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCPrivateChatDemote) Reset() { *m = CMsgClientToGCPrivateChatDemote{} } -func (m *CMsgClientToGCPrivateChatDemote) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCPrivateChatDemote) ProtoMessage() {} -func (*CMsgClientToGCPrivateChatDemote) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{341} -} - -func (m *CMsgClientToGCPrivateChatDemote) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -func (m *CMsgClientToGCPrivateChatDemote) GetDemoteAccountId() uint32 { - if m != nil && m.DemoteAccountId != nil { - return *m.DemoteAccountId - } - return 0 -} - -type CMsgGCToClientPrivateChatResponse struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - Result *CMsgGCToClientPrivateChatResponse_Result `protobuf:"varint,2,opt,name=result,enum=CMsgGCToClientPrivateChatResponse_Result,def=0" json:"result,omitempty"` - Username *string `protobuf:"bytes,3,opt,name=username" json:"username,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientPrivateChatResponse) Reset() { *m = CMsgGCToClientPrivateChatResponse{} } -func (m *CMsgGCToClientPrivateChatResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientPrivateChatResponse) ProtoMessage() {} -func (*CMsgGCToClientPrivateChatResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{342} -} - -const Default_CMsgGCToClientPrivateChatResponse_Result CMsgGCToClientPrivateChatResponse_Result = CMsgGCToClientPrivateChatResponse_SUCCESS - -func (m *CMsgGCToClientPrivateChatResponse) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -func (m *CMsgGCToClientPrivateChatResponse) GetResult() CMsgGCToClientPrivateChatResponse_Result { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgGCToClientPrivateChatResponse_Result -} - -func (m *CMsgGCToClientPrivateChatResponse) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username - } - return "" -} - -type CMsgClientToGCPrivateChatInfoRequest struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCPrivateChatInfoRequest) Reset() { *m = CMsgClientToGCPrivateChatInfoRequest{} } -func (m *CMsgClientToGCPrivateChatInfoRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCPrivateChatInfoRequest) ProtoMessage() {} -func (*CMsgClientToGCPrivateChatInfoRequest) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{343} -} - -func (m *CMsgClientToGCPrivateChatInfoRequest) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -type CMsgGCToClientPrivateChatInfoResponse struct { - PrivateChatChannelName *string `protobuf:"bytes,1,opt,name=private_chat_channel_name" json:"private_chat_channel_name,omitempty"` - Members []*CMsgGCToClientPrivateChatInfoResponse_Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` - Creator *uint32 `protobuf:"varint,3,opt,name=creator" json:"creator,omitempty"` - CreationDate *uint32 `protobuf:"varint,4,opt,name=creation_date" json:"creation_date,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientPrivateChatInfoResponse) Reset() { *m = CMsgGCToClientPrivateChatInfoResponse{} } -func (m *CMsgGCToClientPrivateChatInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientPrivateChatInfoResponse) ProtoMessage() {} -func (*CMsgGCToClientPrivateChatInfoResponse) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{344} -} - -func (m *CMsgGCToClientPrivateChatInfoResponse) GetPrivateChatChannelName() string { - if m != nil && m.PrivateChatChannelName != nil { - return *m.PrivateChatChannelName - } - return "" -} - -func (m *CMsgGCToClientPrivateChatInfoResponse) GetMembers() []*CMsgGCToClientPrivateChatInfoResponse_Member { - if m != nil { - return m.Members - } - return nil -} - -func (m *CMsgGCToClientPrivateChatInfoResponse) GetCreator() uint32 { - if m != nil && m.Creator != nil { - return *m.Creator - } - return 0 -} - -func (m *CMsgGCToClientPrivateChatInfoResponse) GetCreationDate() uint32 { - if m != nil && m.CreationDate != nil { - return *m.CreationDate - } - return 0 -} - -type CMsgGCToClientPrivateChatInfoResponse_Member struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Status *uint32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientPrivateChatInfoResponse_Member) Reset() { - *m = CMsgGCToClientPrivateChatInfoResponse_Member{} -} -func (m *CMsgGCToClientPrivateChatInfoResponse_Member) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToClientPrivateChatInfoResponse_Member) ProtoMessage() {} -func (*CMsgGCToClientPrivateChatInfoResponse_Member) Descriptor() ([]byte, []int) { - return dota_client_fileDescriptor0, []int{344, 0} -} - -func (m *CMsgGCToClientPrivateChatInfoResponse_Member) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToClientPrivateChatInfoResponse_Member) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgGCToClientPrivateChatInfoResponse_Member) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgPlayerBehaviorReport struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - MatchId *uint64 `protobuf:"varint,2,opt,name=match_id" json:"match_id,omitempty"` - SeqNum *uint32 `protobuf:"varint,3,opt,name=seq_num" json:"seq_num,omitempty"` - Reasons *uint32 `protobuf:"varint,4,opt,name=reasons" json:"reasons,omitempty"` - MatchesInReport *uint32 `protobuf:"varint,5,opt,name=matches_in_report" json:"matches_in_report,omitempty"` - MatchesClean *uint32 `protobuf:"varint,6,opt,name=matches_clean" json:"matches_clean,omitempty"` - MatchesReported *uint32 `protobuf:"varint,7,opt,name=matches_reported" json:"matches_reported,omitempty"` - MatchesAbandoned *uint32 `protobuf:"varint,8,opt,name=matches_abandoned" json:"matches_abandoned,omitempty"` - ReportsCount *uint32 `protobuf:"varint,9,opt,name=reports_count" json:"reports_count,omitempty"` - ReportsParties *uint32 `protobuf:"varint,10,opt,name=reports_parties" json:"reports_parties,omitempty"` - CommendCount *uint32 `protobuf:"varint,11,opt,name=commend_count" json:"commend_count,omitempty"` - EndScore *uint32 `protobuf:"varint,13,opt,name=end_score" json:"end_score,omitempty"` - ClientAcknowledged *bool `protobuf:"varint,100,opt,name=client_acknowledged" json:"client_acknowledged,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPlayerBehaviorReport) Reset() { *m = CMsgPlayerBehaviorReport{} } -func (m *CMsgPlayerBehaviorReport) String() string { return proto.CompactTextString(m) } -func (*CMsgPlayerBehaviorReport) ProtoMessage() {} -func (*CMsgPlayerBehaviorReport) Descriptor() ([]byte, []int) { return dota_client_fileDescriptor0, []int{345} } - -func (m *CMsgPlayerBehaviorReport) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetSeqNum() uint32 { - if m != nil && m.SeqNum != nil { - return *m.SeqNum - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetReasons() uint32 { - if m != nil && m.Reasons != nil { - return *m.Reasons - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetMatchesInReport() uint32 { - if m != nil && m.MatchesInReport != nil { - return *m.MatchesInReport - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetMatchesClean() uint32 { - if m != nil && m.MatchesClean != nil { - return *m.MatchesClean - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetMatchesReported() uint32 { - if m != nil && m.MatchesReported != nil { - return *m.MatchesReported - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetMatchesAbandoned() uint32 { - if m != nil && m.MatchesAbandoned != nil { - return *m.MatchesAbandoned - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetReportsCount() uint32 { - if m != nil && m.ReportsCount != nil { - return *m.ReportsCount - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetReportsParties() uint32 { - if m != nil && m.ReportsParties != nil { - return *m.ReportsParties - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetCommendCount() uint32 { - if m != nil && m.CommendCount != nil { - return *m.CommendCount - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetEndScore() uint32 { - if m != nil && m.EndScore != nil { - return *m.EndScore - } - return 0 -} - -func (m *CMsgPlayerBehaviorReport) GetClientAcknowledged() bool { - if m != nil && m.ClientAcknowledged != nil { - return *m.ClientAcknowledged - } - return false -} - -func init() { - proto.RegisterType((*CMsgStartFindingMatch)(nil), "CMsgStartFindingMatch") - proto.RegisterType((*CMsgStopFindingMatch)(nil), "CMsgStopFindingMatch") - proto.RegisterType((*CMsgReadyUp)(nil), "CMsgReadyUp") - proto.RegisterType((*CMsgReadyUpStatus)(nil), "CMsgReadyUpStatus") - proto.RegisterType((*CSourceTVGameSmall)(nil), "CSourceTVGameSmall") - proto.RegisterType((*CSourceTVGameSmall_Player)(nil), "CSourceTVGameSmall.Player") - proto.RegisterType((*CMsgClientToGCFindTopSourceTVGames)(nil), "CMsgClientToGCFindTopSourceTVGames") - proto.RegisterType((*CMsgGCToClientFindTopSourceTVGamesResponse)(nil), "CMsgGCToClientFindTopSourceTVGamesResponse") - proto.RegisterType((*CMsgClientToGCTopMatchesRequest)(nil), "CMsgClientToGCTopMatchesRequest") - proto.RegisterType((*CMsgClientToGCTopLeagueMatchesRequest)(nil), "CMsgClientToGCTopLeagueMatchesRequest") - proto.RegisterType((*CMsgClientToGCTopFriendMatchesRequest)(nil), "CMsgClientToGCTopFriendMatchesRequest") - proto.RegisterType((*CMsgClientToGCMatchesMinimalRequest)(nil), "CMsgClientToGCMatchesMinimalRequest") - proto.RegisterType((*CMsgClientToGCMatchesMinimalResponse)(nil), "CMsgClientToGCMatchesMinimalResponse") - proto.RegisterType((*CMsgGCToClientTopLeagueMatchesResponse)(nil), "CMsgGCToClientTopLeagueMatchesResponse") - proto.RegisterType((*CMsgGCToClientTopFriendMatchesResponse)(nil), "CMsgGCToClientTopFriendMatchesResponse") - proto.RegisterType((*CMsgClientToGCFindTopMatches)(nil), "CMsgClientToGCFindTopMatches") - proto.RegisterType((*CMsgGCToClientFindTopLeagueMatchesResponse)(nil), "CMsgGCToClientFindTopLeagueMatchesResponse") - proto.RegisterType((*CMsgSpectateFriendGame)(nil), "CMsgSpectateFriendGame") - proto.RegisterType((*CMsgSpectateFriendGameResponse)(nil), "CMsgSpectateFriendGameResponse") - proto.RegisterType((*CMsgAbandonCurrentGame)(nil), "CMsgAbandonCurrentGame") - proto.RegisterType((*CMsgClientSuspended)(nil), "CMsgClientSuspended") - proto.RegisterType((*CMsgPracticeLobbySetDetails)(nil), "CMsgPracticeLobbySetDetails") - proto.RegisterType((*CMsgPracticeLobbyCreate)(nil), "CMsgPracticeLobbyCreate") - proto.RegisterType((*CMsgPracticeLobbyCreate_SaveGame)(nil), "CMsgPracticeLobbyCreate.SaveGame") - proto.RegisterType((*CMsgPracticeLobbySetTeamSlot)(nil), "CMsgPracticeLobbySetTeamSlot") - proto.RegisterType((*CMsgPracticeLobbySetCoach)(nil), "CMsgPracticeLobbySetCoach") - proto.RegisterType((*CMsgPracticeLobbyJoinBroadcastChannel)(nil), "CMsgPracticeLobbyJoinBroadcastChannel") - proto.RegisterType((*CMsgPracticeLobbyCloseBroadcastChannel)(nil), "CMsgPracticeLobbyCloseBroadcastChannel") - proto.RegisterType((*CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus)(nil), "CMsgPracticeLobbyToggleBroadcastChannelCameramanStatus") - proto.RegisterType((*CMsgPracticeLobbyKick)(nil), "CMsgPracticeLobbyKick") - proto.RegisterType((*CMsgPracticeLobbyKickFromTeam)(nil), "CMsgPracticeLobbyKickFromTeam") - proto.RegisterType((*CMsgPracticeLobbyLeave)(nil), "CMsgPracticeLobbyLeave") - proto.RegisterType((*CMsgPracticeLobbyLaunch)(nil), "CMsgPracticeLobbyLaunch") - proto.RegisterType((*CMsgApplyTeamToPracticeLobby)(nil), "CMsgApplyTeamToPracticeLobby") - proto.RegisterType((*CMsgClearPracticeLobbyTeam)(nil), "CMsgClearPracticeLobbyTeam") - proto.RegisterType((*CMsgPracticeLobbyList)(nil), "CMsgPracticeLobbyList") - proto.RegisterType((*CMsgPracticeLobbyListResponseEntry)(nil), "CMsgPracticeLobbyListResponseEntry") - proto.RegisterType((*CMsgPracticeLobbyListResponseEntry_CLobbyMember)(nil), "CMsgPracticeLobbyListResponseEntry.CLobbyMember") - proto.RegisterType((*CMsgPracticeLobbyListResponse)(nil), "CMsgPracticeLobbyListResponse") - proto.RegisterType((*CMsgLobbyList)(nil), "CMsgLobbyList") - proto.RegisterType((*CMsgLobbyListResponse)(nil), "CMsgLobbyListResponse") - proto.RegisterType((*CMsgPracticeLobbyJoin)(nil), "CMsgPracticeLobbyJoin") - proto.RegisterType((*CMsgPracticeLobbyJoinResponse)(nil), "CMsgPracticeLobbyJoinResponse") - proto.RegisterType((*CMsgFriendPracticeLobbyListRequest)(nil), "CMsgFriendPracticeLobbyListRequest") - proto.RegisterType((*CMsgFriendPracticeLobbyListResponse)(nil), "CMsgFriendPracticeLobbyListResponse") - proto.RegisterType((*CMsgGuildmatePracticeLobbyListRequest)(nil), "CMsgGuildmatePracticeLobbyListRequest") - proto.RegisterType((*CMsgGuildmatePracticeLobbyListResponse)(nil), "CMsgGuildmatePracticeLobbyListResponse") - proto.RegisterType((*CMsgJoinableCustomGameModesRequest)(nil), "CMsgJoinableCustomGameModesRequest") - proto.RegisterType((*CMsgJoinableCustomGameModesResponseEntry)(nil), "CMsgJoinableCustomGameModesResponseEntry") - proto.RegisterType((*CMsgJoinableCustomGameModesResponse)(nil), "CMsgJoinableCustomGameModesResponse") - proto.RegisterType((*CMsgJoinableCustomLobbiesRequest)(nil), "CMsgJoinableCustomLobbiesRequest") - proto.RegisterType((*CMsgJoinableCustomLobbiesResponseEntry)(nil), "CMsgJoinableCustomLobbiesResponseEntry") - proto.RegisterType((*CMsgJoinableCustomLobbiesResponse)(nil), "CMsgJoinableCustomLobbiesResponse") - proto.RegisterType((*CMsgQuickJoinCustomLobby)(nil), "CMsgQuickJoinCustomLobby") - proto.RegisterType((*CMsgQuickJoinCustomLobby_LegacyRegionPing)(nil), "CMsgQuickJoinCustomLobby.LegacyRegionPing") - proto.RegisterType((*CMsgQuickJoinCustomLobbyResponse)(nil), "CMsgQuickJoinCustomLobbyResponse") - proto.RegisterType((*CMsgBotGameCreate)(nil), "CMsgBotGameCreate") - proto.RegisterType((*CMsgCustomGameCreate)(nil), "CMsgCustomGameCreate") - proto.RegisterType((*CMsgEventGameCreate)(nil), "CMsgEventGameCreate") - proto.RegisterType((*CMsgRequestInternationalTicket)(nil), "CMsgRequestInternationalTicket") - proto.RegisterType((*CMsgBalancedShuffleLobby)(nil), "CMsgBalancedShuffleLobby") - proto.RegisterType((*CMsgInitialQuestionnaireResponse)(nil), "CMsgInitialQuestionnaireResponse") - proto.RegisterType((*CMsgDOTAMatch)(nil), "CMsgDOTAMatch") - proto.RegisterType((*CMsgDOTAMatch_Player)(nil), "CMsgDOTAMatch.Player") - proto.RegisterType((*CMsgDOTAMatch_Player_CustomGameData)(nil), "CMsgDOTAMatch.Player.CustomGameData") - proto.RegisterType((*CMsgDOTAMatch_BroadcasterInfo)(nil), "CMsgDOTAMatch.BroadcasterInfo") - proto.RegisterType((*CMsgDOTAMatch_BroadcasterChannel)(nil), "CMsgDOTAMatch.BroadcasterChannel") - proto.RegisterType((*CMsgDOTAMatch_CustomGameData)(nil), "CMsgDOTAMatch.CustomGameData") - proto.RegisterType((*CMsgDOTAPlayerMatchHistory)(nil), "CMsgDOTAPlayerMatchHistory") - proto.RegisterType((*CMsgDOTAMatchMinimal)(nil), "CMsgDOTAMatchMinimal") - proto.RegisterType((*CMsgDOTAMatchMinimal_Player)(nil), "CMsgDOTAMatchMinimal.Player") - proto.RegisterType((*CMsgDOTAMatchMinimal_League)(nil), "CMsgDOTAMatchMinimal.League") - proto.RegisterType((*CMsgDOTAMatchHistoryFilter)(nil), "CMsgDOTAMatchHistoryFilter") - proto.RegisterType((*CMsgDOTARequestMatches)(nil), "CMsgDOTARequestMatches") - proto.RegisterType((*CMsgDOTARequestMatchesResponse)(nil), "CMsgDOTARequestMatchesResponse") - proto.RegisterType((*CMsgDOTARequestMatchesResponse_Series)(nil), "CMsgDOTARequestMatchesResponse.Series") - proto.RegisterType((*CMsgDOTAPopup)(nil), "CMsgDOTAPopup") - proto.RegisterType((*CMsgDOTATeamMemberSDO)(nil), "CMsgDOTATeamMemberSDO") - proto.RegisterType((*CMsgDOTATeamAdminSDO)(nil), "CMsgDOTATeamAdminSDO") - proto.RegisterType((*CMsgDOTATeamMember)(nil), "CMsgDOTATeamMember") - proto.RegisterType((*CMsgDOTATeam)(nil), "CMsgDOTATeam") - proto.RegisterType((*CMsgDOTACreateTeam)(nil), "CMsgDOTACreateTeam") - proto.RegisterType((*CMsgDOTACreateTeamResponse)(nil), "CMsgDOTACreateTeamResponse") - proto.RegisterType((*CMsgDOTAEditTeam)(nil), "CMsgDOTAEditTeam") - proto.RegisterType((*CMsgDOTAEditTeamLogo)(nil), "CMsgDOTAEditTeamLogo") - proto.RegisterType((*CMsgDOTAEditTeamLogoResponse)(nil), "CMsgDOTAEditTeamLogoResponse") - proto.RegisterType((*CMsgDOTAEditTeamDetails)(nil), "CMsgDOTAEditTeamDetails") - proto.RegisterType((*CMsgDOTAEditTeamDetailsResponse)(nil), "CMsgDOTAEditTeamDetailsResponse") - proto.RegisterType((*CMsgDOTADisbandTeam)(nil), "CMsgDOTADisbandTeam") - proto.RegisterType((*CMsgDOTADisbandTeamResponse)(nil), "CMsgDOTADisbandTeamResponse") - proto.RegisterType((*CMsgDOTARequestTeamData)(nil), "CMsgDOTARequestTeamData") - proto.RegisterType((*CMsgDOTARequestTeamDataResponse)(nil), "CMsgDOTARequestTeamDataResponse") - proto.RegisterType((*CMsgDOTATeamData)(nil), "CMsgDOTATeamData") - proto.RegisterType((*CMsgDOTATeamProfileRequest)(nil), "CMsgDOTATeamProfileRequest") - proto.RegisterType((*CMsgDOTATeamMemberProfileRequest)(nil), "CMsgDOTATeamMemberProfileRequest") - proto.RegisterType((*CMsgDOTATeamIDByNameRequest)(nil), "CMsgDOTATeamIDByNameRequest") - proto.RegisterType((*CMsgDOTATeamIDByNameResponse)(nil), "CMsgDOTATeamIDByNameResponse") - proto.RegisterType((*CMsgDOTATeamProfileResponse)(nil), "CMsgDOTATeamProfileResponse") - proto.RegisterType((*CMsgDOTAProTeamListRequest)(nil), "CMsgDOTAProTeamListRequest") - proto.RegisterType((*CMsgDOTAProTeamListResponse)(nil), "CMsgDOTAProTeamListResponse") - proto.RegisterType((*CMsgDOTAProTeamListResponse_TeamEntry)(nil), "CMsgDOTAProTeamListResponse.TeamEntry") - proto.RegisterType((*CMsgDOTATeamInvite_InviterToGC)(nil), "CMsgDOTATeamInvite_InviterToGC") - proto.RegisterType((*CMsgDOTATeamInvite_GCImmediateResponseToInviter)(nil), "CMsgDOTATeamInvite_GCImmediateResponseToInviter") - proto.RegisterType((*CMsgDOTATeamInvite_GCRequestToInvitee)(nil), "CMsgDOTATeamInvite_GCRequestToInvitee") - proto.RegisterType((*CMsgDOTATeamInvite_InviteeResponseToGC)(nil), "CMsgDOTATeamInvite_InviteeResponseToGC") - proto.RegisterType((*CMsgDOTATeamInvite_GCResponseToInviter)(nil), "CMsgDOTATeamInvite_GCResponseToInviter") - proto.RegisterType((*CMsgDOTATeamInvite_GCResponseToInvitee)(nil), "CMsgDOTATeamInvite_GCResponseToInvitee") - proto.RegisterType((*CMsgDOTATeamOnProfile)(nil), "CMsgDOTATeamOnProfile") - proto.RegisterType((*CMsgDOTAKickTeamMember)(nil), "CMsgDOTAKickTeamMember") - proto.RegisterType((*CMsgDOTAKickTeamMemberResponse)(nil), "CMsgDOTAKickTeamMemberResponse") - proto.RegisterType((*CMsgDOTATransferTeamAdmin)(nil), "CMsgDOTATransferTeamAdmin") - proto.RegisterType((*CMsgDOTATransferTeamAdminResponse)(nil), "CMsgDOTATransferTeamAdminResponse") - proto.RegisterType((*CMsgDOTALeaveTeam)(nil), "CMsgDOTALeaveTeam") - proto.RegisterType((*CMsgDOTALeaveTeamResponse)(nil), "CMsgDOTALeaveTeamResponse") - proto.RegisterType((*CMsgDOTABetaParticipation)(nil), "CMsgDOTABetaParticipation") - proto.RegisterType((*CMsgDOTAJoinChatChannel)(nil), "CMsgDOTAJoinChatChannel") - proto.RegisterType((*CMsgDOTALeaveChatChannel)(nil), "CMsgDOTALeaveChatChannel") - proto.RegisterType((*CMsgDOTAClientIgnoredUser)(nil), "CMsgDOTAClientIgnoredUser") - proto.RegisterType((*CMsgDOTAChatMessage)(nil), "CMsgDOTAChatMessage") - proto.RegisterType((*CMsgDOTAChatMessage_DiceRoll)(nil), "CMsgDOTAChatMessage.DiceRoll") - proto.RegisterType((*CMsgDOTAChatMember)(nil), "CMsgDOTAChatMember") - proto.RegisterType((*CMsgDOTAJoinChatChannelResponse)(nil), "CMsgDOTAJoinChatChannelResponse") - proto.RegisterType((*CMsgDOTAChatChannelFullUpdate)(nil), "CMsgDOTAChatChannelFullUpdate") - proto.RegisterType((*CMsgDOTAOtherJoinedChatChannel)(nil), "CMsgDOTAOtherJoinedChatChannel") - proto.RegisterType((*CMsgDOTAOtherLeftChatChannel)(nil), "CMsgDOTAOtherLeftChatChannel") - proto.RegisterType((*CMsgDOTAChatChannelMemberUpdate)(nil), "CMsgDOTAChatChannelMemberUpdate") - proto.RegisterType((*CMsgDOTAChatChannelMemberUpdate_JoinedMember)(nil), "CMsgDOTAChatChannelMemberUpdate.JoinedMember") - proto.RegisterType((*CMsgDOTARequestChatChannelList)(nil), "CMsgDOTARequestChatChannelList") - proto.RegisterType((*CMsgDOTARequestChatChannelListResponse)(nil), "CMsgDOTARequestChatChannelListResponse") - proto.RegisterType((*CMsgDOTARequestChatChannelListResponse_ChatChannel)(nil), "CMsgDOTARequestChatChannelListResponse.ChatChannel") - proto.RegisterType((*CMsgDOTAChatGetUserList)(nil), "CMsgDOTAChatGetUserList") - proto.RegisterType((*CMsgDOTAChatGetUserListResponse)(nil), "CMsgDOTAChatGetUserListResponse") - proto.RegisterType((*CMsgDOTAChatGetUserListResponse_Member)(nil), "CMsgDOTAChatGetUserListResponse.Member") - proto.RegisterType((*CMsgDOTAChatGetMemberCount)(nil), "CMsgDOTAChatGetMemberCount") - proto.RegisterType((*CMsgDOTAChatGetMemberCountResponse)(nil), "CMsgDOTAChatGetMemberCountResponse") - proto.RegisterType((*CMsgDOTAChatRegionsEnabled)(nil), "CMsgDOTAChatRegionsEnabled") - proto.RegisterType((*CMsgDOTAChatRegionsEnabled_Region)(nil), "CMsgDOTAChatRegionsEnabled.Region") - proto.RegisterType((*CMsgDOTAGuildSDO)(nil), "CMsgDOTAGuildSDO") - proto.RegisterType((*CMsgDOTAGuildSDO_Member)(nil), "CMsgDOTAGuildSDO.Member") - proto.RegisterType((*CMsgDOTAGuildSDO_Invitation)(nil), "CMsgDOTAGuildSDO.Invitation") - proto.RegisterType((*CMsgDOTAGuildAuditSDO)(nil), "CMsgDOTAGuildAuditSDO") - proto.RegisterType((*CMsgDOTAGuildAuditSDO_Entry)(nil), "CMsgDOTAGuildAuditSDO.Entry") - proto.RegisterType((*CMsgDOTAAccountGuildMembershipsSDO)(nil), "CMsgDOTAAccountGuildMembershipsSDO") - proto.RegisterType((*CMsgDOTAAccountGuildMembershipsSDO_Membership)(nil), "CMsgDOTAAccountGuildMembershipsSDO.Membership") - proto.RegisterType((*CMsgDOTAAccountGuildMembershipsSDO_Invitation)(nil), "CMsgDOTAAccountGuildMembershipsSDO.Invitation") - proto.RegisterType((*CMsgDOTAGuildCreateRequest)(nil), "CMsgDOTAGuildCreateRequest") - proto.RegisterType((*CMsgDOTAGuildCreateResponse)(nil), "CMsgDOTAGuildCreateResponse") - proto.RegisterType((*CMsgDOTAGuildSetAccountRoleRequest)(nil), "CMsgDOTAGuildSetAccountRoleRequest") - proto.RegisterType((*CMsgDOTAGuildSetAccountRoleResponse)(nil), "CMsgDOTAGuildSetAccountRoleResponse") - proto.RegisterType((*CMsgDOTAGuildInviteAccountRequest)(nil), "CMsgDOTAGuildInviteAccountRequest") - proto.RegisterType((*CMsgDOTAGuildInviteAccountResponse)(nil), "CMsgDOTAGuildInviteAccountResponse") - proto.RegisterType((*CMsgDOTAGuildCancelInviteRequest)(nil), "CMsgDOTAGuildCancelInviteRequest") - proto.RegisterType((*CMsgDOTAGuildCancelInviteResponse)(nil), "CMsgDOTAGuildCancelInviteResponse") - proto.RegisterType((*CMsgDOTAGuildUpdateDetailsRequest)(nil), "CMsgDOTAGuildUpdateDetailsRequest") - proto.RegisterType((*CMsgDOTAGuildUpdateDetailsResponse)(nil), "CMsgDOTAGuildUpdateDetailsResponse") - proto.RegisterType((*CMsgDOTAGCToGCUpdateOpenGuildPartyRequest)(nil), "CMsgDOTAGCToGCUpdateOpenGuildPartyRequest") - proto.RegisterType((*CMsgDOTAGCToGCUpdateOpenGuildPartyResponse)(nil), "CMsgDOTAGCToGCUpdateOpenGuildPartyResponse") - proto.RegisterType((*CMsgDOTAGCToGCDestroyOpenGuildPartyRequest)(nil), "CMsgDOTAGCToGCDestroyOpenGuildPartyRequest") - proto.RegisterType((*CMsgDOTAGCToGCDestroyOpenGuildPartyResponse)(nil), "CMsgDOTAGCToGCDestroyOpenGuildPartyResponse") - proto.RegisterType((*CMsgDOTAPartySetOpenGuildRequest)(nil), "CMsgDOTAPartySetOpenGuildRequest") - proto.RegisterType((*CMsgDOTAPartySetOpenGuildResponse)(nil), "CMsgDOTAPartySetOpenGuildResponse") - proto.RegisterType((*CMsgDOTAJoinOpenGuildPartyRequest)(nil), "CMsgDOTAJoinOpenGuildPartyRequest") - proto.RegisterType((*CMsgDOTAJoinOpenGuildPartyResponse)(nil), "CMsgDOTAJoinOpenGuildPartyResponse") - proto.RegisterType((*CMsgDOTAGuildOpenPartyRefresh)(nil), "CMsgDOTAGuildOpenPartyRefresh") - proto.RegisterType((*CMsgDOTAGuildOpenPartyRefresh_OpenParty)(nil), "CMsgDOTAGuildOpenPartyRefresh.OpenParty") - proto.RegisterType((*CMsgDOTARequestGuildData)(nil), "CMsgDOTARequestGuildData") - proto.RegisterType((*CMsgDOTAGuildInviteData)(nil), "CMsgDOTAGuildInviteData") - proto.RegisterType((*CMsgDOTAGuildUpdateMessage)(nil), "CMsgDOTAGuildUpdateMessage") - proto.RegisterType((*CMsgDOTAGuildEditLogoRequest)(nil), "CMsgDOTAGuildEditLogoRequest") - proto.RegisterType((*CMsgDOTAGuildEditLogoResponse)(nil), "CMsgDOTAGuildEditLogoResponse") - proto.RegisterType((*CMsgDOTAReportsRemainingRequest)(nil), "CMsgDOTAReportsRemainingRequest") - proto.RegisterType((*CMsgDOTAReportsRemainingResponse)(nil), "CMsgDOTAReportsRemainingResponse") - proto.RegisterType((*CMsgDOTASubmitPlayerReport)(nil), "CMsgDOTASubmitPlayerReport") - proto.RegisterType((*CMsgDOTASubmitPlayerReportResponse)(nil), "CMsgDOTASubmitPlayerReportResponse") - proto.RegisterType((*CMsgDOTAReportCountsRequest)(nil), "CMsgDOTAReportCountsRequest") - proto.RegisterType((*CMsgDOTAReportCountsResponse)(nil), "CMsgDOTAReportCountsResponse") - proto.RegisterType((*CMsgDOTAKickedFromMatchmakingQueue)(nil), "CMsgDOTAKickedFromMatchmakingQueue") - proto.RegisterType((*CMsgDOTARequestSaveGames)(nil), "CMsgDOTARequestSaveGames") - proto.RegisterType((*CMsgDOTARequestSaveGamesResponse)(nil), "CMsgDOTARequestSaveGamesResponse") - proto.RegisterType((*CMsgWatchGame)(nil), "CMsgWatchGame") - proto.RegisterType((*CMsgCancelWatchGame)(nil), "CMsgCancelWatchGame") - proto.RegisterType((*CMsgWatchGameResponse)(nil), "CMsgWatchGameResponse") - proto.RegisterType((*CMsgPartyLeaderWatchGamePrompt)(nil), "CMsgPartyLeaderWatchGamePrompt") - proto.RegisterType((*CMsgGCMatchDetailsRequest)(nil), "CMsgGCMatchDetailsRequest") - proto.RegisterType((*CMsgGCMatchDetailsResponse)(nil), "CMsgGCMatchDetailsResponse") - proto.RegisterType((*CMsgServerToGCMatchDetailsRequest)(nil), "CMsgServerToGCMatchDetailsRequest") - proto.RegisterType((*CMsgGCToServerMatchDetailsResponse)(nil), "CMsgGCToServerMatchDetailsResponse") - proto.RegisterType((*CMsgDOTAProfileRequest)(nil), "CMsgDOTAProfileRequest") - proto.RegisterType((*CMsgDOTAProfileResponse)(nil), "CMsgDOTAProfileResponse") - proto.RegisterType((*CMsgDOTAProfileResponse_PlayedHero)(nil), "CMsgDOTAProfileResponse.PlayedHero") - proto.RegisterType((*CMsgDOTAProfileResponse_ShowcaseHero)(nil), "CMsgDOTAProfileResponse.ShowcaseHero") - proto.RegisterType((*CMsgDOTAProfileResponse_LeaguePass)(nil), "CMsgDOTAProfileResponse.LeaguePass") - proto.RegisterType((*CMsgDOTAProfileResponse_EventTicket)(nil), "CMsgDOTAProfileResponse.EventTicket") - proto.RegisterType((*CMsgDOTAProfileResponse_FeaturedItem)(nil), "CMsgDOTAProfileResponse.FeaturedItem") - proto.RegisterType((*CMsgDOTAProfileTickets)(nil), "CMsgDOTAProfileTickets") - proto.RegisterType((*CMsgDOTAProfileTickets_LeaguePass)(nil), "CMsgDOTAProfileTickets.LeaguePass") - proto.RegisterType((*CMsgDOTAProfileTickets_EventTicket)(nil), "CMsgDOTAProfileTickets.EventTicket") - proto.RegisterType((*CMsgClientToGCGetProfileTickets)(nil), "CMsgClientToGCGetProfileTickets") - proto.RegisterType((*CMsgGCSteamProfileRequest)(nil), "CMsgGCSteamProfileRequest") - proto.RegisterType((*CMsgGCSteamProfileRequestResponse)(nil), "CMsgGCSteamProfileRequestResponse") - proto.RegisterType((*CMsgDOTAClearNotifySuccessfulReport)(nil), "CMsgDOTAClearNotifySuccessfulReport") - proto.RegisterType((*CMsgDOTAWelcome)(nil), "CMsgDOTAWelcome") - proto.RegisterType((*CMsgDOTAWelcome_LocalizationDigest)(nil), "CMsgDOTAWelcome.LocalizationDigest") - proto.RegisterType((*CMsgDOTAWelcome_CExtraMsg)(nil), "CMsgDOTAWelcome.CExtraMsg") - proto.RegisterType((*CSODOTAGameHeroFavorites)(nil), "CSODOTAGameHeroFavorites") - proto.RegisterType((*CMsgDOTAHeroFavoritesAdd)(nil), "CMsgDOTAHeroFavoritesAdd") - proto.RegisterType((*CMsgDOTAHeroFavoritesRemove)(nil), "CMsgDOTAHeroFavoritesRemove") - proto.RegisterType((*CMsgSetShowcaseHero)(nil), "CMsgSetShowcaseHero") - proto.RegisterType((*CMsgSetFeaturedItems)(nil), "CMsgSetFeaturedItems") - proto.RegisterType((*CMsgDOTAFeaturedItems)(nil), "CMsgDOTAFeaturedItems") - proto.RegisterType((*CMsgRequestLeagueInfo)(nil), "CMsgRequestLeagueInfo") - proto.RegisterType((*CDynamicLeagueData)(nil), "CDynamicLeagueData") - proto.RegisterType((*CStaticLeagueData)(nil), "CStaticLeagueData") - proto.RegisterType((*CLeagueData)(nil), "CLeagueData") - proto.RegisterType((*CMsgResponseLeagueInfo)(nil), "CMsgResponseLeagueInfo") - proto.RegisterType((*CMsgDOTAMatchVotes)(nil), "CMsgDOTAMatchVotes") - proto.RegisterType((*CMsgDOTAMatchVotes_PlayerVote)(nil), "CMsgDOTAMatchVotes.PlayerVote") - proto.RegisterType((*CMsgCastMatchVote)(nil), "CMsgCastMatchVote") - proto.RegisterType((*CMsgRetrieveMatchVote)(nil), "CMsgRetrieveMatchVote") - proto.RegisterType((*CMsgMatchVoteResponse)(nil), "CMsgMatchVoteResponse") - proto.RegisterType((*CMsgDOTAHallOfFame)(nil), "CMsgDOTAHallOfFame") - proto.RegisterType((*CMsgDOTAHallOfFame_FeaturedPlayer)(nil), "CMsgDOTAHallOfFame.FeaturedPlayer") - proto.RegisterType((*CMsgDOTAHallOfFame_FeaturedFarmer)(nil), "CMsgDOTAHallOfFame.FeaturedFarmer") - proto.RegisterType((*CMsgDOTAHallOfFameRequest)(nil), "CMsgDOTAHallOfFameRequest") - proto.RegisterType((*CMsgDOTAHallOfFameResponse)(nil), "CMsgDOTAHallOfFameResponse") - proto.RegisterType((*CMsgDOTAHalloweenHighScoreRequest)(nil), "CMsgDOTAHalloweenHighScoreRequest") - proto.RegisterType((*CMsgDOTAHalloweenHighScoreResponse)(nil), "CMsgDOTAHalloweenHighScoreResponse") - proto.RegisterType((*CMsgDOTAStorePromoPagesRequest)(nil), "CMsgDOTAStorePromoPagesRequest") - proto.RegisterType((*CMsgDOTAStorePromoPagesResponse)(nil), "CMsgDOTAStorePromoPagesResponse") - proto.RegisterType((*CMsgDOTAStorePromoPagesResponse_PromoPage)(nil), "CMsgDOTAStorePromoPagesResponse.PromoPage") - proto.RegisterType((*CMsgLeagueScheduleBlockTeamInfo)(nil), "CMsgLeagueScheduleBlockTeamInfo") - proto.RegisterType((*CMsgLeagueScheduleBlock)(nil), "CMsgLeagueScheduleBlock") - proto.RegisterType((*CMsgDOTALeague)(nil), "CMsgDOTALeague") - proto.RegisterType((*CMsgDOTALeagueScheduleRequest)(nil), "CMsgDOTALeagueScheduleRequest") - proto.RegisterType((*CMsgDOTALeagueScheduleResponse)(nil), "CMsgDOTALeagueScheduleResponse") - proto.RegisterType((*CMsgDOTALeagueScheduleEdit)(nil), "CMsgDOTALeagueScheduleEdit") - proto.RegisterType((*CMsgDOTALeagueScheduleEditResponse)(nil), "CMsgDOTALeagueScheduleEditResponse") - proto.RegisterType((*CMsgDOTALeaguesInMonthRequest)(nil), "CMsgDOTALeaguesInMonthRequest") - proto.RegisterType((*CMsgDOTALeaguesInMonthResponse)(nil), "CMsgDOTALeaguesInMonthResponse") - proto.RegisterType((*CMsgMatchGroupServerStatus)(nil), "CMsgMatchGroupServerStatus") - proto.RegisterType((*CMsgMatchmakingGroupServerSample)(nil), "CMsgMatchmakingGroupServerSample") - proto.RegisterType((*CMsgDOTAMatchmakingStatsRequest)(nil), "CMsgDOTAMatchmakingStatsRequest") - proto.RegisterType((*CMsgDOTAMatchmakingStatsResponse)(nil), "CMsgDOTAMatchmakingStatsResponse") - proto.RegisterType((*CMsgDOTASetMatchHistoryAccess)(nil), "CMsgDOTASetMatchHistoryAccess") - proto.RegisterType((*CMsgDOTASetMatchHistoryAccessResponse)(nil), "CMsgDOTASetMatchHistoryAccessResponse") - proto.RegisterType((*CMsgDOTANotifyAccountFlagsChange)(nil), "CMsgDOTANotifyAccountFlagsChange") - proto.RegisterType((*CMsgDOTASetProfilePrivacy)(nil), "CMsgDOTASetProfilePrivacy") - proto.RegisterType((*CMsgDOTASetProfilePrivacyResponse)(nil), "CMsgDOTASetProfilePrivacyResponse") - proto.RegisterType((*CMsgUpgradeLeagueItem)(nil), "CMsgUpgradeLeagueItem") - proto.RegisterType((*CMsgUpgradeLeagueItemResponse)(nil), "CMsgUpgradeLeagueItemResponse") - proto.RegisterType((*CMsgGCWatchDownloadedReplay)(nil), "CMsgGCWatchDownloadedReplay") - proto.RegisterType((*CMsgSetMapLocationState)(nil), "CMsgSetMapLocationState") - proto.RegisterType((*CMsgSetMapLocationStateResponse)(nil), "CMsgSetMapLocationStateResponse") - proto.RegisterType((*CMsgResetMapLocations)(nil), "CMsgResetMapLocations") - proto.RegisterType((*CMsgResetMapLocationsResponse)(nil), "CMsgResetMapLocationsResponse") - proto.RegisterType((*CMsgRefreshPartnerAccountLink)(nil), "CMsgRefreshPartnerAccountLink") - proto.RegisterType((*CMsgClientsRejoinChatChannels)(nil), "CMsgClientsRejoinChatChannels") - proto.RegisterType((*CMsgDOTASendFriendRecruits)(nil), "CMsgDOTASendFriendRecruits") - proto.RegisterType((*CMsgDOTAFriendRecruitsRequest)(nil), "CMsgDOTAFriendRecruitsRequest") - proto.RegisterType((*CMsgDOTAFriendRecruitsResponse)(nil), "CMsgDOTAFriendRecruitsResponse") - proto.RegisterType((*CMsgDOTAFriendRecruitsResponse_FriendRecruitStatus)(nil), "CMsgDOTAFriendRecruitsResponse.FriendRecruitStatus") - proto.RegisterType((*CMsgDOTAFriendRecruitInviteAcceptDecline)(nil), "CMsgDOTAFriendRecruitInviteAcceptDecline") - proto.RegisterType((*CMsgRequestLeaguePrizePool)(nil), "CMsgRequestLeaguePrizePool") - proto.RegisterType((*CMsgRequestLeaguePrizePoolResponse)(nil), "CMsgRequestLeaguePrizePoolResponse") - proto.RegisterType((*CMsgGCGetHeroStandings)(nil), "CMsgGCGetHeroStandings") - proto.RegisterType((*CMsgGCGetHeroStandingsResponse)(nil), "CMsgGCGetHeroStandingsResponse") - proto.RegisterType((*CMsgGCGetHeroStandingsResponse_Hero)(nil), "CMsgGCGetHeroStandingsResponse.Hero") - proto.RegisterType((*CMsgGCItemEditorReservationsRequest)(nil), "CMsgGCItemEditorReservationsRequest") - proto.RegisterType((*CMsgGCItemEditorReservation)(nil), "CMsgGCItemEditorReservation") - proto.RegisterType((*CMsgGCItemEditorReservationsResponse)(nil), "CMsgGCItemEditorReservationsResponse") - proto.RegisterType((*CMsgGCItemEditorReserveItemDef)(nil), "CMsgGCItemEditorReserveItemDef") - proto.RegisterType((*CMsgGCItemEditorReserveItemDefResponse)(nil), "CMsgGCItemEditorReserveItemDefResponse") - proto.RegisterType((*CMsgGCItemEditorReleaseReservation)(nil), "CMsgGCItemEditorReleaseReservation") - proto.RegisterType((*CMsgGCItemEditorReleaseReservationResponse)(nil), "CMsgGCItemEditorReleaseReservationResponse") - proto.RegisterType((*CMsgGCItemEditorRequestLeagueInfo)(nil), "CMsgGCItemEditorRequestLeagueInfo") - proto.RegisterType((*CMsgGCItemEditorLeagueInfoResponse)(nil), "CMsgGCItemEditorLeagueInfoResponse") - proto.RegisterType((*CMsgDOTARewardTutorialPrizes)(nil), "CMsgDOTARewardTutorialPrizes") - proto.RegisterType((*CMsgDOTALastHitChallengeHighScorePost)(nil), "CMsgDOTALastHitChallengeHighScorePost") - proto.RegisterType((*CMsgDOTALastHitChallengeHighScoreRequest)(nil), "CMsgDOTALastHitChallengeHighScoreRequest") - proto.RegisterType((*CMsgDOTALastHitChallengeHighScoreResponse)(nil), "CMsgDOTALastHitChallengeHighScoreResponse") - proto.RegisterType((*CMsgFlipLobbyTeams)(nil), "CMsgFlipLobbyTeams") - proto.RegisterType((*CMsgPresentedClientTerminateDlg)(nil), "CMsgPresentedClientTerminateDlg") - proto.RegisterType((*CMsgGCLobbyUpdateBroadcastChannelInfo)(nil), "CMsgGCLobbyUpdateBroadcastChannelInfo") - proto.RegisterType((*CMsgDOTARedeemEventPrize)(nil), "CMsgDOTARedeemEventPrize") - proto.RegisterType((*CMsgDOTARedeemEventPrizeResponse)(nil), "CMsgDOTARedeemEventPrizeResponse") - proto.RegisterType((*CMsgDOTAGetEventPoints)(nil), "CMsgDOTAGetEventPoints") - proto.RegisterType((*CMsgDOTAGetEventPointsResponse)(nil), "CMsgDOTAGetEventPointsResponse") - proto.RegisterType((*CMsgDOTAGetEventPointsResponse_Action)(nil), "CMsgDOTAGetEventPointsResponse.Action") - proto.RegisterType((*CMsgDOTALiveLeagueGameUpdate)(nil), "CMsgDOTALiveLeagueGameUpdate") - proto.RegisterType((*CMsgDOTACompendiumSelection)(nil), "CMsgDOTACompendiumSelection") - proto.RegisterType((*CMsgDOTACompendiumSelectionResponse)(nil), "CMsgDOTACompendiumSelectionResponse") - proto.RegisterType((*CMsgDOTACompendiumData)(nil), "CMsgDOTACompendiumData") - proto.RegisterType((*CMsgDOTACompendiumDataRequest)(nil), "CMsgDOTACompendiumDataRequest") - proto.RegisterType((*CMsgDOTACompendiumDataResponse)(nil), "CMsgDOTACompendiumDataResponse") - proto.RegisterType((*CMsgDOTAGetPlayerMatchHistory)(nil), "CMsgDOTAGetPlayerMatchHistory") - proto.RegisterType((*CMsgDOTAGetPlayerMatchHistoryResponse)(nil), "CMsgDOTAGetPlayerMatchHistoryResponse") - proto.RegisterType((*CMsgDOTAGetPlayerMatchHistoryResponse_Match)(nil), "CMsgDOTAGetPlayerMatchHistoryResponse.Match") - proto.RegisterType((*CMsgDOTAStartDailyHeroChallenge)(nil), "CMsgDOTAStartDailyHeroChallenge") - proto.RegisterType((*CMsgGCNotificationsRequest)(nil), "CMsgGCNotificationsRequest") - proto.RegisterType((*CMsgGCNotificationsResponse)(nil), "CMsgGCNotificationsResponse") - proto.RegisterType((*CMsgGCNotificationsResponse_Notification)(nil), "CMsgGCNotificationsResponse.Notification") - proto.RegisterType((*CMsgGCNotificationsMarkReadRequest)(nil), "CMsgGCNotificationsMarkReadRequest") - proto.RegisterType((*CMsgClientToGCMarkNotificationListRead)(nil), "CMsgClientToGCMarkNotificationListRead") - proto.RegisterType((*CMsgGCLeagueAdminState)(nil), "CMsgGCLeagueAdminState") - proto.RegisterType((*CMsgGCLeagueAdminState_PrivateLeagueKeys)(nil), "CMsgGCLeagueAdminState.PrivateLeagueKeys") - proto.RegisterType((*CMsgGCPlayerInfoRequest)(nil), "CMsgGCPlayerInfoRequest") - proto.RegisterType((*CMsgGCPlayerInfoSubmit)(nil), "CMsgGCPlayerInfoSubmit") - proto.RegisterType((*CMsgGCPlayerInfoSubmitResponse)(nil), "CMsgGCPlayerInfoSubmitResponse") - proto.RegisterType((*CMsgSerializedSOCache)(nil), "CMsgSerializedSOCache") - proto.RegisterType((*CMsgSerializedSOCache_TypeCache)(nil), "CMsgSerializedSOCache.TypeCache") - proto.RegisterType((*CMsgSerializedSOCache_Cache)(nil), "CMsgSerializedSOCache.Cache") - proto.RegisterType((*CMsgSerializedSOCache_Cache_Version)(nil), "CMsgSerializedSOCache.Cache.Version") - proto.RegisterType((*CMsgRequestWeekendTourneySchedule)(nil), "CMsgRequestWeekendTourneySchedule") - proto.RegisterType((*CMsgWeekendTourneySchedule)(nil), "CMsgWeekendTourneySchedule") - proto.RegisterType((*CMsgWeekendTourneySchedule_Division)(nil), "CMsgWeekendTourneySchedule.Division") - proto.RegisterType((*CMsgClientProvideSurveyResult)(nil), "CMsgClientProvideSurveyResult") - proto.RegisterType((*CMsgClientProvideSurveyResult_Response)(nil), "CMsgClientProvideSurveyResult.Response") - proto.RegisterType((*CMsgDOTAEmoticonAccessSDO)(nil), "CMsgDOTAEmoticonAccessSDO") - proto.RegisterType((*CMsgClientToGCEmoticonDataRequest)(nil), "CMsgClientToGCEmoticonDataRequest") - proto.RegisterType((*CMsgGCToClientEmoticonData)(nil), "CMsgGCToClientEmoticonData") - proto.RegisterType((*CMsgClientToGCTrackDialogResult)(nil), "CMsgClientToGCTrackDialogResult") - proto.RegisterType((*CMsgGCToClientTournamentItemDrop)(nil), "CMsgGCToClientTournamentItemDrop") - proto.RegisterType((*CMsgClientToGCSetAdditionalEquips)(nil), "CMsgClientToGCSetAdditionalEquips") - proto.RegisterType((*CMsgClientToGCSetAdditionalEquipsResponse)(nil), "CMsgClientToGCSetAdditionalEquipsResponse") - proto.RegisterType((*CMsgClientToGCGetAdditionalEquips)(nil), "CMsgClientToGCGetAdditionalEquips") - proto.RegisterType((*CMsgClientToGCGetAdditionalEquipsResponse)(nil), "CMsgClientToGCGetAdditionalEquipsResponse") - proto.RegisterType((*CMsgClientToGCGetAllHeroOrder)(nil), "CMsgClientToGCGetAllHeroOrder") - proto.RegisterType((*CMsgClientToGCGetAllHeroOrderResponse)(nil), "CMsgClientToGCGetAllHeroOrderResponse") - proto.RegisterType((*CMsgClientToGCGetAllHeroProgress)(nil), "CMsgClientToGCGetAllHeroProgress") - proto.RegisterType((*CMsgClientToGCGetAllHeroProgressResponse)(nil), "CMsgClientToGCGetAllHeroProgressResponse") - proto.RegisterType((*CMsgClientToGCGetTrophyList)(nil), "CMsgClientToGCGetTrophyList") - proto.RegisterType((*CMsgClientToGCGetTrophyListResponse)(nil), "CMsgClientToGCGetTrophyListResponse") - proto.RegisterType((*CMsgClientToGCGetTrophyListResponse_Trophy)(nil), "CMsgClientToGCGetTrophyListResponse.Trophy") - proto.RegisterType((*CMsgGCToClientTrophyAwarded)(nil), "CMsgGCToClientTrophyAwarded") - proto.RegisterType((*CMsgClientToGCGetProfileCard)(nil), "CMsgClientToGCGetProfileCard") - proto.RegisterType((*CMsgClientToGCSetProfileCardSlots)(nil), "CMsgClientToGCSetProfileCardSlots") - proto.RegisterType((*CMsgClientToGCSetProfileCardSlots_CardSlot)(nil), "CMsgClientToGCSetProfileCardSlots.CardSlot") - proto.RegisterType((*CMsgClientToGCGetProfileCardStats)(nil), "CMsgClientToGCGetProfileCardStats") - proto.RegisterType((*CMsgClientToGCCreateHeroStatue)(nil), "CMsgClientToGCCreateHeroStatue") - proto.RegisterType((*CMsgClientToGCCreateTeamShowcase)(nil), "CMsgClientToGCCreateTeamShowcase") - proto.RegisterType((*CMsgGCToClientHeroStatueCreateResult)(nil), "CMsgGCToClientHeroStatueCreateResult") - proto.RegisterType((*CMsgGCToClientTeamShowcaseCreateResult)(nil), "CMsgGCToClientTeamShowcaseCreateResult") - proto.RegisterType((*CMsgClientToGCRecordCompendiumStats)(nil), "CMsgClientToGCRecordCompendiumStats") - proto.RegisterType((*CMsgGCToClientEventStatusChanged)(nil), "CMsgGCToClientEventStatusChanged") - proto.RegisterType((*CMsgClientToGCPlayerStatsRequest)(nil), "CMsgClientToGCPlayerStatsRequest") - proto.RegisterType((*CMsgGCToClientPlayerStatsResponse)(nil), "CMsgGCToClientPlayerStatsResponse") - proto.RegisterType((*CMsgClientToGCCustomGamePlayerCountRequest)(nil), "CMsgClientToGCCustomGamePlayerCountRequest") - proto.RegisterType((*CMsgGCToClientCustomGamePlayerCountResponse)(nil), "CMsgGCToClientCustomGamePlayerCountResponse") - proto.RegisterType((*CMsgClientToGCCustomGamesFriendsPlayedRequest)(nil), "CMsgClientToGCCustomGamesFriendsPlayedRequest") - proto.RegisterType((*CMsgGCToClientCustomGamesFriendsPlayedResponse)(nil), "CMsgGCToClientCustomGamesFriendsPlayedResponse") - proto.RegisterType((*CMsgGCToClientCustomGamesFriendsPlayedResponse_CustomGame)(nil), "CMsgGCToClientCustomGamesFriendsPlayedResponse.CustomGame") - proto.RegisterType((*CMsgClientToGCSocialFeedPostCommentRequest)(nil), "CMsgClientToGCSocialFeedPostCommentRequest") - proto.RegisterType((*CMsgGCToClientSocialFeedPostCommentResponse)(nil), "CMsgGCToClientSocialFeedPostCommentResponse") - proto.RegisterType((*CMsgClientToGCSocialFeedPostMessageRequest)(nil), "CMsgClientToGCSocialFeedPostMessageRequest") - proto.RegisterType((*CMsgGCToClientSocialFeedPostMessageResponse)(nil), "CMsgGCToClientSocialFeedPostMessageResponse") - proto.RegisterType((*CMsgClientToGCFriendsPlayedCustomGameRequest)(nil), "CMsgClientToGCFriendsPlayedCustomGameRequest") - proto.RegisterType((*CMsgGCToClientFriendsPlayedCustomGameResponse)(nil), "CMsgGCToClientFriendsPlayedCustomGameResponse") - proto.RegisterType((*CMsgClientToGCFeaturedHeroesRequest)(nil), "CMsgClientToGCFeaturedHeroesRequest") - proto.RegisterType((*CMsgGCToClientFeaturedHeroesResponse)(nil), "CMsgGCToClientFeaturedHeroesResponse") - proto.RegisterType((*CMsgGCToClientFeaturedHeroesResponse_DataField)(nil), "CMsgGCToClientFeaturedHeroesResponse.DataField") - proto.RegisterType((*CMsgGCToClientFeaturedHeroesResponse_FeaturedHero)(nil), "CMsgGCToClientFeaturedHeroesResponse.FeaturedHero") - proto.RegisterType((*CMsgGCToClientFeaturedHeroesResponse_Category)(nil), "CMsgGCToClientFeaturedHeroesResponse.Category") - proto.RegisterType((*CMsgClientToGCSocialMatchPostCommentRequest)(nil), "CMsgClientToGCSocialMatchPostCommentRequest") - proto.RegisterType((*CMsgGCToClientSocialMatchPostCommentResponse)(nil), "CMsgGCToClientSocialMatchPostCommentResponse") - proto.RegisterType((*CMsgClientToGCSocialMatchDetailsRequest)(nil), "CMsgClientToGCSocialMatchDetailsRequest") - proto.RegisterType((*CMsgGCToClientSocialMatchDetailsResponse)(nil), "CMsgGCToClientSocialMatchDetailsResponse") - proto.RegisterType((*CMsgGCToClientSocialMatchDetailsResponse_Comment)(nil), "CMsgGCToClientSocialMatchDetailsResponse.Comment") - proto.RegisterType((*CMsgDOTAPartyMemberSetCoach)(nil), "CMsgDOTAPartyMemberSetCoach") - proto.RegisterType((*CMsgDOTASetGroupLeader)(nil), "CMsgDOTASetGroupLeader") - proto.RegisterType((*CMsgDOTACancelGroupInvites)(nil), "CMsgDOTACancelGroupInvites") - proto.RegisterType((*CMsgDOTASetGroupOpenStatus)(nil), "CMsgDOTASetGroupOpenStatus") - proto.RegisterType((*CMsgDOTAGroupMergeInvite)(nil), "CMsgDOTAGroupMergeInvite") - proto.RegisterType((*CMsgDOTAGroupMergeResponse)(nil), "CMsgDOTAGroupMergeResponse") - proto.RegisterType((*CMsgDOTAGroupMergeReply)(nil), "CMsgDOTAGroupMergeReply") - proto.RegisterType((*CMsgDOTAPartyRichPresence)(nil), "CMsgDOTAPartyRichPresence") - proto.RegisterType((*CMsgDOTAPartyRichPresence_Member)(nil), "CMsgDOTAPartyRichPresence.Member") - proto.RegisterType((*CMsgDOTALobbyRichPresence)(nil), "CMsgDOTALobbyRichPresence") - proto.RegisterType((*CMsgDOTACustomGameListenServerStartedLoading)(nil), "CMsgDOTACustomGameListenServerStartedLoading") - proto.RegisterType((*CMsgDOTACustomGameClientFinishedLoading)(nil), "CMsgDOTACustomGameClientFinishedLoading") - proto.RegisterType((*CMsgClientToGCGetLeagueSeries)(nil), "CMsgClientToGCGetLeagueSeries") - proto.RegisterType((*CMsgClientToGCGetLeagueSeriesResponse)(nil), "CMsgClientToGCGetLeagueSeriesResponse") - proto.RegisterType((*CMsgClientToGCGetLeagueSeriesResponse_Series)(nil), "CMsgClientToGCGetLeagueSeriesResponse.Series") - proto.RegisterType((*CMsgClientToGCGetLeagueSeriesResponse_Series_Team)(nil), "CMsgClientToGCGetLeagueSeriesResponse.Series.Team") - proto.RegisterType((*CMsgClientToGCApplyGemCombiner)(nil), "CMsgClientToGCApplyGemCombiner") - proto.RegisterType((*CDummyUnbreakMessage)(nil), "CDummyUnbreakMessage") - proto.RegisterType((*CMsgClientToGCCreateStaticRecipe)(nil), "CMsgClientToGCCreateStaticRecipe") - proto.RegisterType((*CMsgClientToGCCreateStaticRecipe_Item)(nil), "CMsgClientToGCCreateStaticRecipe.Item") - proto.RegisterType((*CMsgClientToGCCreateStaticRecipeResponse)(nil), "CMsgClientToGCCreateStaticRecipeResponse") - proto.RegisterType((*CDOTAReplayDownloadInfo)(nil), "CDOTAReplayDownloadInfo") - proto.RegisterType((*CDOTAReplayDownloadInfo_Highlight)(nil), "CDOTAReplayDownloadInfo.Highlight") - proto.RegisterType((*CDOTABroadcasterInfo)(nil), "CDOTABroadcasterInfo") - proto.RegisterType((*CMsgClientToGCH264Unsupported)(nil), "CMsgClientToGCH264Unsupported") - proto.RegisterType((*CMsgClientToGCRequestH264Support)(nil), "CMsgClientToGCRequestH264Support") - proto.RegisterType((*CMsgClientToGCGetQuestProgress)(nil), "CMsgClientToGCGetQuestProgress") - proto.RegisterType((*CMsgClientToGCGetQuestProgressResponse)(nil), "CMsgClientToGCGetQuestProgressResponse") - proto.RegisterType((*CMsgClientToGCGetQuestProgressResponse_Challenge)(nil), "CMsgClientToGCGetQuestProgressResponse.Challenge") - proto.RegisterType((*CMsgClientToGCGetQuestProgressResponse_Quest)(nil), "CMsgClientToGCGetQuestProgressResponse.Quest") - proto.RegisterType((*CMsgGCToClientMatchSignedOut)(nil), "CMsgGCToClientMatchSignedOut") - proto.RegisterType((*CMsgGCGetHeroStatsHistory)(nil), "CMsgGCGetHeroStatsHistory") - proto.RegisterType((*CMsgGCGetHeroStatsHistoryResponse)(nil), "CMsgGCGetHeroStatsHistoryResponse") - proto.RegisterType((*CMsgClientToGCPrivateChatInvite)(nil), "CMsgClientToGCPrivateChatInvite") - proto.RegisterType((*CMsgClientToGCPrivateChatKick)(nil), "CMsgClientToGCPrivateChatKick") - proto.RegisterType((*CMsgClientToGCPrivateChatPromote)(nil), "CMsgClientToGCPrivateChatPromote") - proto.RegisterType((*CMsgClientToGCPrivateChatDemote)(nil), "CMsgClientToGCPrivateChatDemote") - proto.RegisterType((*CMsgGCToClientPrivateChatResponse)(nil), "CMsgGCToClientPrivateChatResponse") - proto.RegisterType((*CMsgClientToGCPrivateChatInfoRequest)(nil), "CMsgClientToGCPrivateChatInfoRequest") - proto.RegisterType((*CMsgGCToClientPrivateChatInfoResponse)(nil), "CMsgGCToClientPrivateChatInfoResponse") - proto.RegisterType((*CMsgGCToClientPrivateChatInfoResponse_Member)(nil), "CMsgGCToClientPrivateChatInfoResponse.Member") - proto.RegisterType((*CMsgPlayerBehaviorReport)(nil), "CMsgPlayerBehaviorReport") - proto.RegisterEnum("EMatchGroupServerStatus", EMatchGroupServerStatus_name, EMatchGroupServerStatus_value) - proto.RegisterEnum("DOTA_WatchReplayType", DOTA_WatchReplayType_name, DOTA_WatchReplayType_value) - proto.RegisterEnum("EItemEditorReservationResult", EItemEditorReservationResult_name, EItemEditorReservationResult_value) - proto.RegisterEnum("EProfileCardSlotType", EProfileCardSlotType_name, EProfileCardSlotType_value) - proto.RegisterEnum("EFeaturedHeroTextField", EFeaturedHeroTextField_name, EFeaturedHeroTextField_value) - proto.RegisterEnum("EFeaturedHeroDataType", EFeaturedHeroDataType_name, EFeaturedHeroDataType_value) - proto.RegisterEnum("EDOTAGroupMergeResult", EDOTAGroupMergeResult_name, EDOTAGroupMergeResult_value) - proto.RegisterEnum("CMsgDOTAMatch_ReplayState", CMsgDOTAMatch_ReplayState_name, CMsgDOTAMatch_ReplayState_value) - proto.RegisterEnum("CMsgDOTARequestMatches_SkillLevel", CMsgDOTARequestMatches_SkillLevel_name, CMsgDOTARequestMatches_SkillLevel_value) - proto.RegisterEnum("CMsgDOTAPopup_PopupID", CMsgDOTAPopup_PopupID_name, CMsgDOTAPopup_PopupID_value) - proto.RegisterEnum("CMsgDOTACreateTeamResponse_Result", CMsgDOTACreateTeamResponse_Result_name, CMsgDOTACreateTeamResponse_Result_value) - proto.RegisterEnum("CMsgDOTAEditTeamLogoResponse_Result", CMsgDOTAEditTeamLogoResponse_Result_name, CMsgDOTAEditTeamLogoResponse_Result_value) - proto.RegisterEnum("CMsgDOTAEditTeamDetailsResponse_Result", CMsgDOTAEditTeamDetailsResponse_Result_name, CMsgDOTAEditTeamDetailsResponse_Result_value) - proto.RegisterEnum("CMsgDOTADisbandTeamResponse_Result", CMsgDOTADisbandTeamResponse_Result_name, CMsgDOTADisbandTeamResponse_Result_value) - proto.RegisterEnum("CMsgDOTARequestTeamDataResponse_Result", CMsgDOTARequestTeamDataResponse_Result_name, CMsgDOTARequestTeamDataResponse_Result_value) - proto.RegisterEnum("CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result", CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result_name, CMsgDOTATeamInvite_GCImmediateResponseToInviter_Result_value) - proto.RegisterEnum("CMsgDOTATeamInvite_InviteeResponseToGC_Result", CMsgDOTATeamInvite_InviteeResponseToGC_Result_name, CMsgDOTATeamInvite_InviteeResponseToGC_Result_value) - proto.RegisterEnum("CMsgDOTATeamInvite_GCResponseToInviter_Result", CMsgDOTATeamInvite_GCResponseToInviter_Result_name, CMsgDOTATeamInvite_GCResponseToInviter_Result_value) - proto.RegisterEnum("CMsgDOTATeamInvite_GCResponseToInvitee_Result", CMsgDOTATeamInvite_GCResponseToInvitee_Result_name, CMsgDOTATeamInvite_GCResponseToInvitee_Result_value) - proto.RegisterEnum("CMsgDOTAKickTeamMemberResponse_Result", CMsgDOTAKickTeamMemberResponse_Result_name, CMsgDOTAKickTeamMemberResponse_Result_value) - proto.RegisterEnum("CMsgDOTATransferTeamAdminResponse_Result", CMsgDOTATransferTeamAdminResponse_Result_name, CMsgDOTATransferTeamAdminResponse_Result_value) - proto.RegisterEnum("CMsgDOTALeaveTeamResponse_Result", CMsgDOTALeaveTeamResponse_Result_name, CMsgDOTALeaveTeamResponse_Result_value) - proto.RegisterEnum("CMsgDOTAJoinChatChannelResponse_Result", CMsgDOTAJoinChatChannelResponse_Result_name, CMsgDOTAJoinChatChannelResponse_Result_value) - proto.RegisterEnum("CMsgDOTAGuildCreateResponse_EError", CMsgDOTAGuildCreateResponse_EError_name, CMsgDOTAGuildCreateResponse_EError_value) - proto.RegisterEnum("CMsgDOTAGuildSetAccountRoleResponse_EResult", CMsgDOTAGuildSetAccountRoleResponse_EResult_name, CMsgDOTAGuildSetAccountRoleResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAGuildInviteAccountResponse_EResult", CMsgDOTAGuildInviteAccountResponse_EResult_name, CMsgDOTAGuildInviteAccountResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAGuildCancelInviteResponse_EResult", CMsgDOTAGuildCancelInviteResponse_EResult_name, CMsgDOTAGuildCancelInviteResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAGuildUpdateDetailsResponse_EResult", CMsgDOTAGuildUpdateDetailsResponse_EResult_name, CMsgDOTAGuildUpdateDetailsResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAPartySetOpenGuildResponse_EResult", CMsgDOTAPartySetOpenGuildResponse_EResult_name, CMsgDOTAPartySetOpenGuildResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAJoinOpenGuildPartyResponse_EResult", CMsgDOTAJoinOpenGuildPartyResponse_EResult_name, CMsgDOTAJoinOpenGuildPartyResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAGuildEditLogoResponse_EResult", CMsgDOTAGuildEditLogoResponse_EResult_name, CMsgDOTAGuildEditLogoResponse_EResult_value) - proto.RegisterEnum("CMsgWatchGameResponse_WatchGameResult", CMsgWatchGameResponse_WatchGameResult_name, CMsgWatchGameResponse_WatchGameResult_value) - proto.RegisterEnum("CMsgDOTAFriendRecruitsResponse_EResult", CMsgDOTAFriendRecruitsResponse_EResult_name, CMsgDOTAFriendRecruitsResponse_EResult_value) - proto.RegisterEnum("CMsgDOTARedeemEventPrizeResponse_ResultCode", CMsgDOTARedeemEventPrizeResponse_ResultCode_name, CMsgDOTARedeemEventPrizeResponse_ResultCode_value) - proto.RegisterEnum("CMsgGCNotificationsResponse_EResult", CMsgGCNotificationsResponse_EResult_name, CMsgGCNotificationsResponse_EResult_value) - proto.RegisterEnum("CMsgGCPlayerInfoSubmitResponse_EResult", CMsgGCPlayerInfoSubmitResponse_EResult_name, CMsgGCPlayerInfoSubmitResponse_EResult_value) - proto.RegisterEnum("CMsgClientToGCCreateStaticRecipeResponse_EResponse", CMsgClientToGCCreateStaticRecipeResponse_EResponse_name, CMsgClientToGCCreateStaticRecipeResponse_EResponse_value) - proto.RegisterEnum("CMsgGCToClientPrivateChatResponse_Result", CMsgGCToClientPrivateChatResponse_Result_name, CMsgGCToClientPrivateChatResponse_Result_value) -} - -var dota_client_fileDescriptor0 = []byte{ - // 17332 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0xbd, 0x7b, 0x8c, 0x5b, 0x57, - 0x7a, 0x38, 0xb6, 0x7c, 0xcc, 0xeb, 0xcc, 0x43, 0x14, 0xf5, 0x1a, 0xd1, 0xb2, 0x24, 0x5f, 0xcb, - 0x96, 0x25, 0x5b, 0xb4, 0x35, 0xf2, 0x63, 0x3d, 0xbb, 0xb6, 0x97, 0xe2, 0x70, 0x46, 0xb4, 0x66, - 0xc8, 0x31, 0xc9, 0x91, 0x57, 0x49, 0x36, 0x37, 0x1c, 0xf2, 0xce, 0xcc, 0x5d, 0x71, 0x78, 0x69, - 0x5e, 0x52, 0xf2, 0x2c, 0x50, 0x20, 0x48, 0xd1, 0x06, 0x48, 0xd0, 0x20, 0x49, 0x1b, 0x24, 0x41, - 0xda, 0x14, 0x45, 0xd1, 0x20, 0x05, 0x12, 0x34, 0x0d, 0x8a, 0x36, 0x08, 0x90, 0xa2, 0x48, 0xff, - 0x58, 0x24, 0x28, 0x92, 0x16, 0x2d, 0x90, 0xb6, 0x7f, 0x04, 0x6d, 0x93, 0xb6, 0x40, 0x0b, 0x14, - 0x68, 0x8b, 0xf6, 0x8f, 0xe0, 0xf7, 0x43, 0x7e, 0xdf, 0xe3, 0x9c, 0x73, 0xcf, 0x7d, 0x90, 0x33, - 0xf6, 0xee, 0xe2, 0x97, 0x05, 0xac, 0x1d, 0x9e, 0xd7, 0x3d, 0x8f, 0xef, 0x7c, 0xef, 0xf3, 0x7d, - 0xe2, 0x5a, 0xd7, 0x1b, 0xb5, 0xed, 0xc3, 0xce, 0xb1, 0xe3, 0xfb, 0xed, 0x43, 0xc7, 0xb7, 0x3b, - 0x3d, 0xd7, 0xe9, 0x8f, 0x8a, 0x83, 0xa1, 0x37, 0xf2, 0x0a, 0x17, 0xfc, 0x91, 0xd3, 0x3e, 0x56, - 0x75, 0xb2, 0x30, 0xde, 0xc5, 0x3b, 0x3e, 0xf6, 0xfa, 0xb2, 0xf6, 0xf2, 0x61, 0xc7, 0xef, 0x3e, - 0x33, 0xaa, 0x65, 0xf9, 0xad, 0xe4, 0x0f, 0xd9, 0x07, 0xed, 0xfe, 0xa8, 0xed, 0x9f, 0xc8, 0x56, - 0x97, 0xf6, 0xdb, 0xbe, 0x13, 0xeb, 0x6c, 0xfd, 0x30, 0x23, 0x2e, 0x95, 0x77, 0xfc, 0xc3, 0xe6, - 0xa8, 0x3d, 0x1c, 0x6d, 0xba, 0xfd, 0xae, 0xdb, 0x3f, 0xdc, 0x69, 0x8f, 0x3a, 0x47, 0xf9, 0x45, - 0x91, 0x79, 0xe6, 0x9c, 0xac, 0xa6, 0x6e, 0xa6, 0xde, 0x58, 0xc8, 0xdf, 0x10, 0x8b, 0xc7, 0x58, - 0x7a, 0x38, 0xf4, 0xc6, 0x03, 0x7f, 0x35, 0x0d, 0x85, 0xcb, 0xeb, 0xe2, 0xdd, 0xb5, 0x0f, 0xdf, - 0xfd, 0xf0, 0xfd, 0x0f, 0xd6, 0x3e, 0x7c, 0x2f, 0x7f, 0x59, 0xac, 0xc8, 0xcf, 0x3e, 0x77, 0x86, - 0xbe, 0xeb, 0xf5, 0x57, 0x33, 0xd8, 0x26, 0x7f, 0x5d, 0x88, 0xc3, 0xf6, 0xb1, 0x63, 0x1f, 0x7b, - 0x5d, 0xc7, 0x5f, 0xcd, 0xc6, 0xfa, 0x7d, 0x22, 0x56, 0xf6, 0xbd, 0x91, 0xdd, 0x75, 0x0f, 0x0e, - 0xdc, 0xce, 0xb8, 0x37, 0x3a, 0x59, 0x9d, 0x81, 0x36, 0x2b, 0x6b, 0xf9, 0xe2, 0x46, 0xbd, 0x55, - 0x7a, 0xe8, 0x8d, 0x36, 0x74, 0xcd, 0xfa, 0x85, 0x87, 0xf5, 0x96, 0xbd, 0x51, 0xdd, 0xdc, 0xac, - 0x96, 0xf7, 0xb6, 0x5b, 0x4f, 0xed, 0x47, 0xa5, 0xc6, 0x46, 0xfe, 0xbe, 0x10, 0x34, 0x33, 0x7b, - 0x74, 0x32, 0x70, 0x56, 0x67, 0xa9, 0xb3, 0x28, 0xd2, 0x12, 0x5a, 0x50, 0xb2, 0x7e, 0x7e, 0xa7, - 0xd4, 0x2a, 0x3f, 0xb2, 0x5b, 0x4f, 0x77, 0x2b, 0x76, 0xb9, 0xd4, 0xdc, 0x2b, 0x6d, 0xe7, 0x2d, - 0xb1, 0x42, 0x5d, 0x7a, 0xed, 0xfe, 0xe1, 0x18, 0xf7, 0x62, 0x75, 0x2e, 0x69, 0x3d, 0xc7, 0xed, - 0x81, 0x3d, 0x18, 0x3a, 0x07, 0xce, 0xd0, 0xe9, 0x77, 0x9c, 0xd5, 0x05, 0x5a, 0xcf, 0x39, 0x31, - 0x87, 0x07, 0x67, 0xbb, 0xdd, 0xd5, 0x79, 0x2a, 0x28, 0x8b, 0x3c, 0x2d, 0x50, 0x0d, 0x66, 0x3b, - 0xfd, 0xf1, 0xf1, 0xaa, 0xa0, 0x79, 0x9c, 0xe3, 0x79, 0x6c, 0xab, 0xef, 0xac, 0x5f, 0xe6, 0xc9, - 0x6c, 0x97, 0x6a, 0x5b, 0x7b, 0xa5, 0xad, 0x8a, 0x5d, 0xad, 0x3d, 0x29, 0x6d, 0x57, 0x37, 0xf2, - 0x85, 0xe8, 0x20, 0x7d, 0xf8, 0xb5, 0xba, 0x48, 0x5b, 0xff, 0xba, 0x58, 0x18, 0xc0, 0xa1, 0xd8, - 0xdd, 0xf6, 0xa8, 0xbd, 0xba, 0x04, 0x45, 0x8b, 0x6b, 0x17, 0x8a, 0x78, 0x64, 0x65, 0xda, 0xef, - 0x5d, 0xa8, 0xdb, 0x80, 0x2a, 0xeb, 0xb2, 0xb8, 0xc8, 0x07, 0xe9, 0x0d, 0xcc, 0x73, 0xb4, 0x7e, - 0x27, 0x25, 0x16, 0xb1, 0xa2, 0xe1, 0xb4, 0xbb, 0x27, 0x7b, 0x03, 0x98, 0xf0, 0x8c, 0x3f, 0x6a, - 0x8f, 0x1c, 0x3a, 0xd9, 0x95, 0xb5, 0x8b, 0xb4, 0xd1, 0xdb, 0xde, 0xfe, 0xfe, 0x09, 0xb5, 0x68, - 0x62, 0xdd, 0xfa, 0xf5, 0x84, 0x42, 0x7b, 0xaf, 0xb6, 0x51, 0x29, 0x6f, 0x97, 0x1a, 0x95, 0x8d, - 0xfc, 0x45, 0xb1, 0x34, 0xc4, 0x0a, 0x7b, 0x3c, 0xb0, 0x11, 0x4a, 0x10, 0x20, 0x66, 0xe1, 0x2c, - 0x56, 0x8e, 0xda, 0xc3, 0xee, 0x8b, 0xf6, 0xd0, 0xb1, 0xfd, 0x81, 0xd3, 0xf1, 0x09, 0x08, 0x16, - 0xd7, 0xae, 0x16, 0xcb, 0x38, 0x1e, 0x4f, 0xf8, 0x91, 0x6c, 0xd1, 0xc4, 0x06, 0xd6, 0x67, 0xe2, - 0xbc, 0x31, 0x39, 0xfc, 0xce, 0xd8, 0xcf, 0xe7, 0xc4, 0x7c, 0x0f, 0xbf, 0x8d, 0xbb, 0x9c, 0xa2, - 0x91, 0xe1, 0x7b, 0xed, 0x4e, 0xc7, 0x19, 0x8c, 0x9c, 0x2e, 0x14, 0x22, 0x00, 0x66, 0x60, 0xef, - 0xa1, 0xb4, 0xeb, 0x00, 0xd8, 0xf5, 0x65, 0x69, 0x06, 0x4b, 0xad, 0x5f, 0xca, 0x8a, 0x7c, 0xb9, - 0xe9, 0x8d, 0x87, 0x1d, 0xa7, 0xf5, 0x64, 0x0b, 0x36, 0xb2, 0x79, 0xdc, 0xee, 0xf5, 0xf2, 0x97, - 0xc4, 0x72, 0xbb, 0x33, 0x72, 0x9f, 0xe3, 0x4a, 0x46, 0xee, 0x31, 0xaf, 0x7f, 0x39, 0x7f, 0x45, - 0x9c, 0xeb, 0x3a, 0xe1, 0x8a, 0xb4, 0xaa, 0xf0, 0x9d, 0x21, 0x40, 0xb3, 0xed, 0xab, 0x13, 0xc7, - 0xd5, 0x64, 0x43, 0xb3, 0xcb, 0x52, 0xc9, 0x79, 0xb1, 0xd0, 0x73, 0xda, 0x87, 0x63, 0x07, 0x8b, - 0x66, 0xa8, 0x77, 0x5e, 0x08, 0x6e, 0xa4, 0xc1, 0x72, 0x19, 0x9b, 0xd1, 0x29, 0xd3, 0x47, 0x10, - 0xe4, 0x66, 0xf2, 0xcb, 0x62, 0xa6, 0xeb, 0xf4, 0xda, 0x27, 0x12, 0x98, 0xa0, 0x17, 0xee, 0x1b, - 0xec, 0x82, 0x37, 0xf4, 0x25, 0xc4, 0xa9, 0x5e, 0x78, 0x83, 0x08, 0xae, 0x96, 0xf3, 0x17, 0xc4, - 0x62, 0x1b, 0x26, 0x86, 0x80, 0x72, 0x7c, 0x3c, 0x24, 0x38, 0x59, 0xce, 0x5f, 0x15, 0xe7, 0x69, - 0x9e, 0x08, 0x3a, 0xf6, 0xb0, 0xdd, 0x75, 0xe1, 0xfa, 0xaf, 0x9e, 0x23, 0x10, 0x02, 0x60, 0x0e, - 0xaa, 0xba, 0xee, 0xd0, 0x59, 0xcd, 0x51, 0x39, 0x7e, 0xce, 0x1b, 0x8e, 0x6c, 0xbf, 0xe3, 0x41, - 0xd9, 0x79, 0x1a, 0x66, 0x55, 0xe4, 0x7a, 0x6d, 0x7f, 0x04, 0x07, 0xdb, 0xd5, 0x1b, 0x92, 0x87, - 0x9a, 0x34, 0x9d, 0x39, 0x0f, 0x6b, 0xc3, 0x6a, 0xbb, 0xab, 0x17, 0x68, 0x05, 0xb0, 0xad, 0xaa, - 0x94, 0x87, 0xb9, 0xa8, 0x56, 0x82, 0x1f, 0x92, 0x65, 0x97, 0xa8, 0xec, 0x4d, 0x31, 0x37, 0x80, - 0xb5, 0x02, 0x7e, 0x58, 0xbd, 0x0c, 0x27, 0xb5, 0xb8, 0x56, 0x28, 0xc6, 0xcf, 0xa9, 0xb8, 0x4b, - 0x4d, 0x70, 0xce, 0xfb, 0x63, 0xb7, 0x87, 0x70, 0x6c, 0x33, 0xbc, 0x5e, 0x81, 0x41, 0xe6, 0x0a, - 0xf7, 0xc4, 0xac, 0x6c, 0x01, 0x9f, 0x00, 0x98, 0xf0, 0xc6, 0xf0, 0x65, 0x09, 0x27, 0x74, 0x3d, - 0x8f, 0x9c, 0xa1, 0x87, 0x05, 0x74, 0x8a, 0xd6, 0xbf, 0x9d, 0x12, 0x56, 0x70, 0x59, 0x5a, 0xde, - 0x56, 0x19, 0x2f, 0x47, 0xcb, 0x1b, 0x98, 0x1f, 0xf6, 0x69, 0x27, 0x9c, 0xf6, 0x10, 0xd0, 0x48, - 0x80, 0xf3, 0x42, 0xa7, 0x9a, 0x8e, 0x0e, 0x9f, 0xd1, 0x07, 0x86, 0x98, 0xd3, 0xc6, 0x23, 0x62, - 0xf4, 0x86, 0x80, 0xc3, 0x97, 0xd9, 0x85, 0x6d, 0x84, 0x8f, 0x39, 0x5f, 0x4a, 0x98, 0xc0, 0x01, - 0x25, 0xe0, 0xf8, 0x00, 0x12, 0x99, 0x37, 0xb2, 0xd6, 0xdf, 0xa7, 0xc4, 0x5d, 0x9c, 0xde, 0x56, - 0xb9, 0xe5, 0xf1, 0x14, 0x93, 0xa6, 0xd7, 0x70, 0xfc, 0x81, 0xd7, 0xf7, 0x9d, 0x1f, 0xeb, 0x34, - 0xa1, 0x1f, 0x60, 0x2a, 0x2a, 0xf1, 0xe5, 0x04, 0x13, 0x66, 0xce, 0x90, 0xfb, 0xba, 0x84, 0x41, - 0xac, 0x00, 0xc8, 0xcd, 0x30, 0x0e, 0x8a, 0xdf, 0x31, 0x38, 0x34, 0x84, 0x5f, 0x17, 0x30, 0xb6, - 0x1c, 0x18, 0xe1, 0x7a, 0xde, 0xfa, 0x59, 0x71, 0x23, 0x7c, 0x08, 0xb0, 0x42, 0xc2, 0x4e, 0xb8, - 0xb6, 0x2f, 0xc6, 0x8e, 0x3f, 0x32, 0xe7, 0x9c, 0x52, 0xf0, 0xcc, 0xd0, 0x62, 0x1b, 0xa7, 0x9c, - 0x8e, 0x22, 0x61, 0x5a, 0x9f, 0x75, 0x5b, 0xbc, 0x16, 0x1b, 0x7f, 0x9b, 0x36, 0x25, 0xfc, 0x95, - 0xc4, 0x86, 0x9b, 0x43, 0xf8, 0xd1, 0x8d, 0x34, 0xfc, 0xa6, 0x78, 0x35, 0xdc, 0x50, 0xd6, 0xef, - 0xb8, 0x7d, 0x17, 0x96, 0xaa, 0x66, 0x0d, 0x9b, 0xc8, 0xd4, 0x07, 0x8f, 0x34, 0x45, 0x47, 0xba, - 0x2f, 0x6e, 0x4d, 0xef, 0x29, 0xcf, 0xf2, 0x75, 0x31, 0x77, 0xcc, 0x35, 0xd4, 0x71, 0x71, 0xed, - 0x12, 0x61, 0x75, 0x44, 0x94, 0xd4, 0x43, 0xb6, 0x27, 0x4c, 0x82, 0x17, 0x92, 0x1a, 0xd3, 0x06, - 0xcc, 0x5b, 0xbb, 0xe2, 0xf5, 0x30, 0xd4, 0xc4, 0xd7, 0x1b, 0xff, 0x4a, 0x7a, 0xca, 0x57, 0x12, - 0x47, 0x8c, 0x6c, 0xcc, 0x57, 0x9b, 0xb7, 0xf5, 0x6f, 0xa6, 0xc4, 0xb5, 0xc4, 0x9b, 0x27, 0x07, - 0x8c, 0x00, 0x65, 0x4a, 0x5f, 0x91, 0xd3, 0x80, 0x19, 0xda, 0x1c, 0xd0, 0xcc, 0x14, 0x02, 0x26, - 0x84, 0x28, 0x8b, 0x08, 0x42, 0x11, 0x9a, 0xe7, 0xb1, 0x50, 0x8e, 0x45, 0x85, 0xb3, 0xb4, 0x73, - 0xbf, 0x35, 0xe9, 0xc2, 0x25, 0x6f, 0xdf, 0x8f, 0x30, 0xc7, 0x00, 0x2e, 0xb2, 0x44, 0xac, 0x6e, - 0x04, 0xfb, 0x36, 0x43, 0xfb, 0xb6, 0x12, 0xde, 0x37, 0xeb, 0xae, 0xb8, 0x4c, 0x04, 0x9c, 0x09, - 0x80, 0xc3, 0xbb, 0x8f, 0x77, 0x0b, 0x29, 0x8e, 0xa6, 0x41, 0x44, 0x0f, 0x01, 0x3c, 0xaf, 0x27, - 0xb7, 0xd5, 0x33, 0xc7, 0xab, 0x68, 0x90, 0x2f, 0xb9, 0x55, 0xb3, 0xd6, 0x2a, 0x7f, 0xa5, 0xb4, - 0xdf, 0xee, 0x77, 0xbd, 0x7e, 0x79, 0x3c, 0x04, 0xee, 0x66, 0x84, 0x3d, 0xe1, 0x6e, 0x5c, 0x08, - 0xce, 0xab, 0x39, 0x86, 0x8b, 0x0c, 0x18, 0xa0, 0x8b, 0x1f, 0x47, 0x22, 0x00, 0x7c, 0x8d, 0xbc, - 0x99, 0xd6, 0xff, 0x2d, 0xc4, 0x4b, 0xd8, 0x72, 0x77, 0x88, 0x74, 0xb3, 0xe3, 0x10, 0x9f, 0xd0, - 0x74, 0x46, 0x1b, 0xce, 0xa8, 0xed, 0xf6, 0xe2, 0xe4, 0x3b, 0xab, 0x69, 0x18, 0xb1, 0x35, 0x69, - 0x42, 0x5b, 0x6f, 0x88, 0x25, 0x5a, 0x52, 0x97, 0x3b, 0x11, 0xed, 0x5e, 0x04, 0xb6, 0xaf, 0x4c, - 0xa3, 0xb5, 0xa0, 0x4a, 0x0d, 0x07, 0x14, 0x46, 0xae, 0x64, 0xe8, 0x1c, 0x22, 0x67, 0x99, 0x8d, - 0xd3, 0x45, 0xc6, 0x5f, 0x45, 0x31, 0xd7, 0x39, 0xb6, 0x07, 0x6e, 0xe7, 0x99, 0x64, 0x04, 0x97, - 0x89, 0xb9, 0xb1, 0xcb, 0x3b, 0xf6, 0x6e, 0xb5, 0xfc, 0x78, 0x7d, 0x45, 0xfd, 0x6a, 0x94, 0x6a, - 0x1b, 0xf5, 0x9d, 0x7c, 0x29, 0xc6, 0x7c, 0x2e, 0x4c, 0x64, 0x3e, 0x2f, 0x45, 0x98, 0xcf, 0x9d, - 0xca, 0x46, 0x75, 0x6f, 0x87, 0x18, 0x93, 0x5e, 0xcf, 0x7b, 0x61, 0xc3, 0xc1, 0xb6, 0x47, 0x3e, - 0x11, 0xe8, 0x79, 0xdc, 0xfc, 0x03, 0xb7, 0xd7, 0xb3, 0x5f, 0xb8, 0xa3, 0x23, 0x1b, 0x3e, 0xe1, - 0x13, 0x8d, 0x9e, 0x47, 0x70, 0x72, 0xfb, 0x23, 0x00, 0x14, 0x9a, 0xf4, 0x12, 0x95, 0x01, 0xc1, - 0xe5, 0x11, 0x24, 0xe5, 0x07, 0x82, 0xb7, 0xba, 0x4c, 0x35, 0xdf, 0x16, 0x4b, 0xb4, 0x42, 0xc5, - 0x51, 0xaf, 0xd0, 0xe4, 0x72, 0x34, 0x39, 0x3c, 0xb1, 0x27, 0x5c, 0xbe, 0x7e, 0x71, 0xab, 0xb4, - 0x53, 0xb1, 0x9f, 0x54, 0x1a, 0xcd, 0x6a, 0xbd, 0x66, 0x97, 0xf7, 0x1a, 0x8d, 0x4a, 0xad, 0x85, - 0xa7, 0x30, 0x68, 0xfb, 0x3e, 0x51, 0x0a, 0x66, 0x03, 0xf0, 0x5c, 0x08, 0x70, 0xe1, 0x5c, 0x72, - 0xb4, 0x61, 0x2f, 0x8b, 0x4b, 0x70, 0xca, 0x6d, 0x58, 0x1f, 0x90, 0xf4, 0xe7, 0x4e, 0x4f, 0xf3, - 0x0d, 0xcc, 0x0b, 0x00, 0x5b, 0x1a, 0xae, 0x26, 0xde, 0x21, 0x4f, 0x75, 0xb0, 0xf0, 0x9e, 0xd7, - 0xee, 0xd2, 0xc5, 0xc0, 0x83, 0xbe, 0xa0, 0x2e, 0x22, 0x9c, 0x95, 0x0b, 0x42, 0x08, 0xf1, 0x3d, - 0xcc, 0x0b, 0xbc, 0x24, 0x2e, 0x68, 0x16, 0x81, 0x2b, 0x5f, 0xb8, 0x7d, 0x5f, 0x32, 0x05, 0xb0, - 0x7c, 0x66, 0x14, 0x8c, 0x9a, 0xcb, 0x54, 0x73, 0x59, 0xcc, 0xc1, 0xc6, 0x74, 0x8e, 0xda, 0x23, - 0x22, 0xfd, 0xf3, 0xeb, 0x33, 0x07, 0xed, 0x1e, 0x40, 0xf6, 0x87, 0x62, 0x99, 0x24, 0x9e, 0xd1, - 0x73, 0x9b, 0x79, 0xa7, 0x55, 0xda, 0x97, 0xf3, 0x45, 0x82, 0x9c, 0x0d, 0xa8, 0x6a, 0x3d, 0xd9, - 0xc0, 0x8a, 0xf5, 0x73, 0x46, 0x89, 0x7d, 0x7f, 0xed, 0x1d, 0x94, 0x69, 0x80, 0xc5, 0x5e, 0xbd, - 0xaa, 0x36, 0xbe, 0x33, 0xf6, 0x47, 0x1e, 0xd3, 0x40, 0x3e, 0x92, 0x02, 0x6d, 0x14, 0xd0, 0x41, - 0x59, 0x83, 0x32, 0x00, 0x01, 0xed, 0x4b, 0x54, 0x01, 0x34, 0x49, 0x56, 0x18, 0x30, 0x73, 0x4d, - 0xce, 0x76, 0xc5, 0x1c, 0x0d, 0x76, 0xe4, 0x65, 0x02, 0x7d, 0xd8, 0x43, 0x35, 0x96, 0xdb, 0xb7, - 0x15, 0xff, 0x73, 0x5d, 0xed, 0xaf, 0xfe, 0xce, 0x97, 0xba, 0xee, 0x86, 0x24, 0xb9, 0xd7, 0x61, - 0xaa, 0xf6, 0x91, 0x07, 0xa8, 0x9f, 0xf8, 0xff, 0x91, 0x67, 0x87, 0xaf, 0xc1, 0x4d, 0x6a, 0xb7, - 0x21, 0xc4, 0x73, 0xd7, 0x77, 0xf7, 0xdd, 0x9e, 0x0b, 0x73, 0x79, 0x25, 0xca, 0xd3, 0x3f, 0xd1, - 0x75, 0xeb, 0x85, 0x84, 0x42, 0x7b, 0x77, 0xbc, 0xdf, 0x73, 0x3b, 0xc6, 0x8a, 0x69, 0xf6, 0x9d, - 0x61, 0x67, 0xd5, 0x22, 0xc6, 0x1b, 0xd9, 0x41, 0x46, 0x76, 0xf2, 0x80, 0x60, 0x61, 0xaf, 0xaa, - 0x05, 0xcb, 0x1a, 0xb5, 0xe0, 0x5b, 0x0a, 0xa6, 0xcc, 0xa1, 0x10, 0x77, 0x00, 0x0a, 0x3d, 0x1e, - 0xac, 0xbe, 0x86, 0xfc, 0x1b, 0xa0, 0xc1, 0x2b, 0x20, 0x54, 0x3d, 0x77, 0xbd, 0xb1, 0xcf, 0x24, - 0xcd, 0xf6, 0x60, 0x4d, 0x43, 0x17, 0x36, 0xff, 0x75, 0xda, 0x30, 0x5c, 0xb8, 0xfa, 0x62, 0x0f, - 0x6e, 0x04, 0x2c, 0x15, 0xc4, 0x30, 0xd7, 0x1b, 0xe2, 0x74, 0x11, 0x65, 0xac, 0xde, 0xa6, 0xef, - 0x3c, 0x16, 0x37, 0x27, 0xb7, 0xeb, 0x1c, 0x79, 0x80, 0x98, 0x56, 0xdf, 0xa0, 0xed, 0xb8, 0x5c, - 0x6c, 0xaa, 0x16, 0xbb, 0xb2, 0x01, 0x89, 0x86, 0x0b, 0x28, 0xd0, 0x6c, 0x56, 0x6b, 0x20, 0xcf, - 0xd4, 0xc5, 0x2d, 0x39, 0x58, 0x1f, 0x86, 0x99, 0x3c, 0xe0, 0x9d, 0xb3, 0x0e, 0x58, 0x13, 0xcb, - 0x83, 0xf6, 0xd8, 0xc7, 0xc9, 0x8d, 0xe8, 0x4a, 0xdf, 0x95, 0x3d, 0x35, 0x48, 0xee, 0x62, 0x75, - 0x93, 0x6b, 0xd7, 0x6f, 0x24, 0x16, 0xdb, 0x7b, 0xfd, 0x9e, 0x7b, 0xec, 0x82, 0xd0, 0x63, 0xfd, - 0x6d, 0x5a, 0x5c, 0x89, 0xe1, 0xdc, 0x32, 0xc8, 0x60, 0xa3, 0x64, 0xae, 0x10, 0x0e, 0x74, 0x04, - 0xec, 0x19, 0xc2, 0x6e, 0x5f, 0x52, 0x2f, 0x62, 0x1d, 0x10, 0xe6, 0x22, 0x15, 0x01, 0xd5, 0x02, - 0x4c, 0x6b, 0xd4, 0x69, 0xea, 0x6a, 0x62, 0x92, 0x19, 0x25, 0x50, 0x44, 0xa4, 0x7d, 0xe6, 0x13, - 0x1f, 0x88, 0x65, 0xc6, 0xfc, 0x0a, 0xab, 0xcf, 0x91, 0xfc, 0x77, 0xad, 0x38, 0x8d, 0x5c, 0xbc, - 0x2b, 0x16, 0x7c, 0x10, 0x67, 0x78, 0x92, 0xf3, 0xd4, 0xe1, 0x95, 0xe2, 0x84, 0xb5, 0x16, 0x9b, - 0xd0, 0x12, 0x71, 0x5f, 0xa1, 0x26, 0xe6, 0xd5, 0xdf, 0xf9, 0x25, 0x91, 0x25, 0xe9, 0x18, 0x97, - 0xbe, 0x84, 0xc4, 0x58, 0xcd, 0x2a, 0x4d, 0x22, 0x8a, 0x49, 0x3e, 0x33, 0x04, 0xd5, 0x40, 0x3b, - 0x7c, 0xf7, 0xb0, 0x0f, 0xc2, 0xe6, 0xd0, 0x91, 0x74, 0xf1, 0x3f, 0x90, 0xec, 0x4a, 0x74, 0x96, - 0x48, 0x89, 0x9a, 0x3d, 0x6f, 0x04, 0x6b, 0xcb, 0x12, 0xf4, 0xa5, 0x4c, 0xca, 0xb2, 0x55, 0xb6, - 0x5b, 0x95, 0xd2, 0xce, 0xfa, 0x65, 0xf3, 0x97, 0xbd, 0x55, 0xaf, 0x6f, 0xd8, 0x5b, 0x7b, 0x4f, - 0x9b, 0x38, 0x33, 0x1f, 0x3a, 0x4b, 0x36, 0xe1, 0x61, 0x8c, 0xde, 0x64, 0x26, 0xd2, 0x9b, 0xcb, - 0x11, 0x7a, 0xb3, 0x5b, 0x6a, 0x36, 0xab, 0x4f, 0x2a, 0xc0, 0xa8, 0x5d, 0x4d, 0x9a, 0x66, 0xd9, - 0x6b, 0x77, 0x8e, 0xbe, 0xd6, 0x1c, 0x91, 0x25, 0x7a, 0x2d, 0x36, 0xe4, 0xa7, 0x9e, 0xdb, 0x7f, - 0x38, 0x04, 0x04, 0xdf, 0x01, 0xde, 0xb3, 0x7c, 0xd4, 0xee, 0xf7, 0x9d, 0x1e, 0xee, 0x6c, 0x87, - 0xff, 0x94, 0xac, 0x10, 0xd2, 0x0f, 0xd2, 0x90, 0x0c, 0x41, 0x02, 0xef, 0x3a, 0x7e, 0x67, 0xe8, - 0x0e, 0x46, 0x6a, 0xe3, 0x17, 0xf2, 0xd7, 0xc5, 0xe5, 0xa0, 0x9a, 0x78, 0xf8, 0x21, 0xdc, 0x24, - 0xc4, 0xb3, 0x19, 0xa9, 0x55, 0xba, 0x12, 0xd4, 0x6b, 0xdd, 0x07, 0x35, 0xc0, 0x43, 0x59, 0xb0, - 0x3e, 0x64, 0xae, 0x34, 0x0c, 0x08, 0x3d, 0xcf, 0x77, 0x4e, 0x9d, 0x1a, 0x70, 0x48, 0xef, 0xc7, - 0xba, 0xb6, 0xbc, 0xc3, 0xc3, 0x5e, 0xac, 0x6f, 0x19, 0x40, 0x68, 0xd8, 0x3e, 0x6e, 0xf7, 0x59, - 0xfb, 0x60, 0xbd, 0xc9, 0x1a, 0xb1, 0x50, 0xcf, 0xc7, 0xc0, 0x53, 0x44, 0x04, 0x4e, 0x96, 0x3c, - 0x1e, 0x88, 0x97, 0x13, 0x1b, 0x6f, 0x0e, 0xbd, 0x63, 0x04, 0x9d, 0x24, 0x29, 0x55, 0xf1, 0x60, - 0xa1, 0x4e, 0xc0, 0x7f, 0x3e, 0x77, 0xac, 0xfb, 0x09, 0xb7, 0x7c, 0xbb, 0x3d, 0xee, 0xc3, 0xd9, - 0xc6, 0xef, 0x1c, 0x31, 0x3d, 0xd6, 0xdb, 0x0c, 0xb7, 0xa5, 0xc1, 0xa0, 0x47, 0x6c, 0x53, 0xcb, - 0x0b, 0xf5, 0x36, 0x85, 0x25, 0xfe, 0xfa, 0x35, 0x51, 0x60, 0x3e, 0x0f, 0x70, 0x46, 0x78, 0x7b, - 0xa0, 0x99, 0xf5, 0x4b, 0xa9, 0x84, 0xe5, 0x6f, 0x03, 0x03, 0x8d, 0xa4, 0x20, 0x82, 0x39, 0x7c, - 0x1a, 0x71, 0x3e, 0x84, 0x20, 0xf8, 0xe4, 0x57, 0xc4, 0xac, 0xa4, 0x52, 0x8c, 0x59, 0xde, 0x33, - 0x99, 0xb5, 0x2c, 0x41, 0xe7, 0x8a, 0x84, 0x4e, 0x28, 0xde, 0x81, 0xd2, 0xf5, 0x3c, 0xff, 0x04, - 0x56, 0x66, 0xa7, 0xbe, 0x51, 0xb1, 0x6b, 0xf5, 0x5a, 0xc5, 0xfa, 0xab, 0x2c, 0x4b, 0xef, 0xb1, - 0xc9, 0x28, 0x36, 0xb7, 0x82, 0x20, 0x05, 0xdf, 0x4f, 0x2b, 0x56, 0xf3, 0x61, 0xf6, 0xe7, 0x7f, - 0xef, 0xe5, 0x54, 0x1c, 0x93, 0x65, 0x14, 0xc1, 0x4d, 0x40, 0x7e, 0x8c, 0xe5, 0x4a, 0xc0, 0x9f, - 0x3b, 0xc7, 0xfb, 0x48, 0x81, 0x99, 0x3f, 0x7f, 0xa7, 0x78, 0xfa, 0xa7, 0x25, 0xbb, 0xba, 0x43, - 0x1d, 0x91, 0x3d, 0x18, 0x82, 0x60, 0x08, 0xec, 0x8c, 0x6f, 0xeb, 0x0d, 0x21, 0xb9, 0x03, 0xab, - 0x50, 0x69, 0x12, 0x96, 0x66, 0xe7, 0x14, 0x7a, 0x3d, 0x44, 0x4d, 0x47, 0xa0, 0x53, 0x04, 0x98, - 0xe1, 0x92, 0x9e, 0x77, 0xe8, 0x11, 0x4f, 0x9a, 0x45, 0x4c, 0x42, 0x8c, 0x88, 0xa0, 0xfd, 0x4d, - 0xe2, 0x5d, 0x58, 0x5d, 0x18, 0xda, 0xe9, 0xa5, 0xb3, 0xee, 0x34, 0x71, 0xac, 0x2c, 0x41, 0xc1, - 0x8d, 0xf4, 0x61, 0x77, 0x24, 0x0f, 0x7a, 0x2e, 0xd0, 0xd9, 0xac, 0x28, 0x1d, 0x41, 0x94, 0x37, - 0x3a, 0xa7, 0xa6, 0x14, 0x70, 0x31, 0x7c, 0xdb, 0x25, 0x97, 0x19, 0x63, 0xe0, 0xcf, 0x9f, 0x91, - 0xc3, 0xc9, 0xc7, 0xe5, 0x2d, 0x62, 0x33, 0x0b, 0x1f, 0x88, 0xa5, 0xd0, 0xc6, 0x27, 0xa9, 0x82, - 0x80, 0x15, 0x95, 0x73, 0x09, 0xa4, 0x0e, 0xcb, 0x4b, 0xb8, 0xae, 0xe6, 0xa1, 0x4e, 0x01, 0xf2, - 0x77, 0xc5, 0x1c, 0xd2, 0x36, 0x57, 0x4b, 0xd2, 0xaf, 0x9e, 0x01, 0x3e, 0xac, 0x9f, 0x13, 0xcb, - 0xd8, 0xca, 0xbc, 0x45, 0x91, 0xcd, 0xa0, 0xd9, 0xae, 0xa7, 0xde, 0x09, 0x9f, 0x5c, 0xfa, 0xcc, - 0x77, 0x64, 0x87, 0xef, 0x6b, 0x7c, 0x29, 0xc6, 0x84, 0x53, 0x67, 0x9f, 0xf0, 0x2f, 0x27, 0xdd, - 0x7f, 0xa4, 0x06, 0x09, 0x62, 0x5d, 0x1c, 0x25, 0xa5, 0x63, 0x0c, 0x43, 0x26, 0xc2, 0x51, 0x6b, - 0xfe, 0x92, 0xc8, 0xee, 0x64, 0x6e, 0x11, 0x91, 0xdb, 0x9c, 0x65, 0x27, 0x9c, 0x17, 0x4e, 0x46, - 0x2f, 0xf2, 0x63, 0x44, 0x34, 0x3e, 0x50, 0xcc, 0x90, 0x3a, 0x1b, 0x9b, 0x48, 0xed, 0x35, 0xd6, - 0xad, 0xaf, 0xd2, 0xbe, 0x7d, 0x5a, 0xaf, 0xd6, 0xec, 0x46, 0xa5, 0x09, 0xf4, 0xd4, 0x6e, 0xee, - 0x95, 0xcb, 0x95, 0x66, 0xd3, 0x7a, 0x8f, 0x11, 0x0c, 0x0b, 0xd0, 0x09, 0x5b, 0xa3, 0x95, 0x53, - 0x7c, 0x3b, 0x78, 0x2b, 0x97, 0xad, 0x9f, 0x66, 0xf5, 0xd0, 0xc4, 0x6e, 0x3f, 0xd2, 0x11, 0x7c, - 0xc0, 0xf4, 0x78, 0x0b, 0x51, 0x00, 0xb0, 0xc8, 0xce, 0xc4, 0x69, 0x01, 0x96, 0x25, 0x3c, 0xa1, - 0x66, 0xf5, 0xb3, 0x52, 0x89, 0x33, 0xa5, 0xe3, 0x8f, 0x34, 0xb1, 0x6f, 0xf1, 0x66, 0xe1, 0xee, - 0xb6, 0xf7, 0x7b, 0x4e, 0x99, 0x0e, 0x4e, 0x01, 0xa7, 0xd6, 0xe4, 0x5d, 0x4a, 0x84, 0x70, 0xeb, - 0x58, 0xbc, 0x31, 0xb5, 0xb3, 0x89, 0xd0, 0xe3, 0xc2, 0x14, 0x03, 0x1c, 0xaa, 0x74, 0x08, 0x04, - 0x19, 0xbd, 0xa4, 0x95, 0x24, 0x1a, 0x42, 0x3a, 0x4c, 0x98, 0xbb, 0x7c, 0x42, 0xa7, 0x7c, 0x2e, - 0xff, 0x51, 0xc8, 0x3e, 0xc5, 0x7b, 0x71, 0xa7, 0x78, 0xd6, 0x89, 0x5a, 0x9f, 0x89, 0x9b, 0xf1, - 0xb6, 0xdb, 0xbc, 0xb3, 0xd3, 0xf7, 0x23, 0x61, 0x8d, 0xb8, 0x9c, 0xac, 0xf5, 0x9f, 0xa4, 0xf9, - 0x14, 0x27, 0x8c, 0x19, 0xa6, 0x7b, 0x51, 0x3b, 0xc9, 0x84, 0x41, 0x03, 0x73, 0x04, 0xe1, 0x42, - 0xbe, 0x93, 0xb0, 0x6f, 0x4c, 0xf0, 0xe4, 0xbe, 0x65, 0x95, 0xda, 0x35, 0x4e, 0xa8, 0x66, 0x14, - 0x46, 0x95, 0x55, 0x34, 0xca, 0xec, 0x24, 0x59, 0x79, 0x6e, 0x22, 0x3d, 0x98, 0x4f, 0xa6, 0x07, - 0x0b, 0x67, 0xa4, 0x07, 0x42, 0x9d, 0xf7, 0x51, 0xdb, 0x20, 0xb0, 0xa4, 0x5a, 0xb1, 0xbe, 0x27, - 0x5e, 0x39, 0x75, 0xd7, 0xf2, 0xdf, 0x8c, 0x82, 0xfd, 0xed, 0xe2, 0xd9, 0xb6, 0xda, 0xfa, 0x87, - 0xb4, 0x58, 0xc5, 0xa6, 0x9f, 0x8d, 0x81, 0xb9, 0xc3, 0xf6, 0x41, 0xdb, 0x93, 0xfc, 0x35, 0x71, - 0xb1, 0xe7, 0x1c, 0xb6, 0x3b, 0x27, 0xf6, 0x57, 0x38, 0xe8, 0x89, 0x26, 0xd3, 0x75, 0x71, 0xb1, - 0x43, 0xc2, 0x8e, 0x1d, 0x96, 0xa5, 0xb2, 0x67, 0x90, 0xa5, 0xd0, 0xc8, 0x45, 0xca, 0xa4, 0x76, - 0xff, 0x04, 0x0f, 0x44, 0xaa, 0x42, 0xb7, 0xc4, 0x05, 0x39, 0x41, 0x9e, 0x19, 0xed, 0x2f, 0xdb, - 0x20, 0x16, 0xd7, 0xee, 0x16, 0x27, 0x2d, 0xac, 0xb8, 0x4d, 0x9d, 0x1a, 0xd4, 0x07, 0x0d, 0x8d, - 0x61, 0x63, 0xe4, 0xdc, 0x44, 0x63, 0x64, 0x61, 0x5b, 0xe4, 0x62, 0x7d, 0x27, 0xdc, 0x03, 0x60, - 0x6c, 0x70, 0x48, 0x79, 0x99, 0x01, 0xc6, 0xe4, 0x14, 0xb5, 0x9c, 0x30, 0x67, 0xed, 0xf3, 0x2d, - 0x4b, 0x9a, 0xe2, 0x8f, 0x8d, 0x10, 0xfc, 0x30, 0xc5, 0x96, 0x48, 0x90, 0xc2, 0xf0, 0xae, 0x4f, - 0x11, 0xad, 0x27, 0x51, 0xbd, 0x8f, 0xd1, 0xe4, 0xf5, 0xf5, 0x25, 0x3b, 0x2d, 0xbc, 0x65, 0xbf, - 0x8a, 0x80, 0x19, 0xd7, 0x82, 0x5a, 0xbf, 0x92, 0x62, 0x4b, 0x70, 0x80, 0xb8, 0xbe, 0xc6, 0x62, - 0xf2, 0xb1, 0xc5, 0x44, 0x34, 0xae, 0x24, 0xa0, 0xa1, 0x42, 0x4d, 0x41, 0xd9, 0x42, 0x02, 0xa0, - 0xcf, 0x11, 0x46, 0xfb, 0x37, 0x52, 0xac, 0x59, 0xae, 0x3c, 0x97, 0xaa, 0xe6, 0x7f, 0xc9, 0xf3, - 0xb9, 0xc9, 0xca, 0x73, 0x89, 0x9f, 0xab, 0xfd, 0x91, 0x03, 0xfc, 0x1e, 0x8a, 0xad, 0xed, 0x5e, - 0x0b, 0x20, 0xcc, 0x19, 0x59, 0x05, 0xbe, 0xec, 0x0f, 0xdb, 0x80, 0x90, 0x3a, 0x4e, 0xb7, 0x79, - 0x34, 0x3e, 0x38, 0xe8, 0xf1, 0x65, 0x03, 0x99, 0x94, 0x80, 0xb1, 0xda, 0x77, 0x47, 0x6e, 0xbb, - 0xf7, 0x19, 0x0e, 0x01, 0x5d, 0xfb, 0x6d, 0xe0, 0xfa, 0x35, 0x30, 0x02, 0xa8, 0xbb, 0x5c, 0x6f, - 0xfb, 0xcf, 0xdc, 0x9e, 0x92, 0x49, 0xff, 0x97, 0x8b, 0xcc, 0x0d, 0x6a, 0x9d, 0x3f, 0x36, 0x3c, - 0xf4, 0xbc, 0xae, 0x7d, 0x38, 0x3e, 0x21, 0xdd, 0xa7, 0x54, 0xd2, 0x00, 0x62, 0xef, 0x8e, 0x87, - 0x34, 0xa7, 0x60, 0xad, 0x64, 0x88, 0x68, 0xb9, 0xd2, 0x80, 0x37, 0x87, 0x86, 0x18, 0xc5, 0x9a, - 0xcf, 0x24, 0x19, 0x62, 0x94, 0x25, 0x15, 0x06, 0x53, 0xb6, 0x08, 0xc2, 0xd9, 0x59, 0xc4, 0xa0, - 0x23, 0xef, 0x05, 0x99, 0x06, 0x50, 0xe2, 0x05, 0xb4, 0x9c, 0x61, 0xce, 0x7e, 0xbf, 0x3d, 0x04, - 0xc4, 0xf2, 0xcc, 0x57, 0x15, 0x0b, 0x54, 0x81, 0xb2, 0x75, 0x0f, 0x36, 0xd2, 0x19, 0x4a, 0x0c, - 0x0c, 0xa8, 0xfd, 0xc0, 0x1d, 0x02, 0x9a, 0xde, 0xef, 0xe1, 0xe4, 0xc9, 0x46, 0xbc, 0x14, 0x5c, - 0x5f, 0x9c, 0x95, 0xed, 0xb7, 0x7b, 0x2c, 0x43, 0xcc, 0xd1, 0xdc, 0xf9, 0xe2, 0xbb, 0x03, 0x92, - 0x22, 0xe6, 0xa4, 0x9e, 0x18, 0x8b, 0x06, 0xde, 0x90, 0xcd, 0xd4, 0x51, 0x9b, 0xb9, 0x96, 0x1d, - 0x8e, 0xc6, 0x20, 0x9b, 0x6b, 0xed, 0xe8, 0x79, 0x55, 0xac, 0x2c, 0xe0, 0xbc, 0xc1, 0x5a, 0x29, - 0x4d, 0x47, 0xbd, 0xcf, 0x07, 0x47, 0xd2, 0x42, 0x1a, 0x17, 0xa6, 0xf4, 0xcf, 0x4a, 0x12, 0xbe, - 0xa8, 0x9a, 0x93, 0xee, 0x59, 0x95, 0x5e, 0x52, 0xdc, 0xab, 0x56, 0x93, 0x5f, 0x56, 0x34, 0x31, - 0x34, 0x00, 0x51, 0xb9, 0x2b, 0x0a, 0xc6, 0x82, 0x21, 0xa8, 0x7c, 0x55, 0x69, 0x8a, 0x43, 0x5d, - 0x48, 0x92, 0xbb, 0xaa, 0xf0, 0x7e, 0xd0, 0x85, 0xca, 0x0b, 0x54, 0x0e, 0xac, 0x70, 0xa8, 0x4b, - 0xc7, 0x3b, 0x1e, 0xf4, 0x9c, 0x11, 0xeb, 0x9e, 0x49, 0x76, 0x0d, 0xba, 0xe9, 0x3a, 0xad, 0x7c, - 0x1e, 0x78, 0x3e, 0x00, 0xdc, 0x73, 0xc7, 0x7e, 0xee, 0x8d, 0x80, 0xbc, 0xbd, 0xac, 0xca, 0xfb, - 0x80, 0x86, 0x8d, 0xf2, 0xeb, 0x71, 0x71, 0xfc, 0xc6, 0x99, 0x85, 0xc4, 0xbb, 0x42, 0xa0, 0x71, - 0xc5, 0x87, 0xfd, 0xed, 0xfb, 0xab, 0x37, 0x09, 0xe8, 0x2e, 0x17, 0xd9, 0xc0, 0xf9, 0xc8, 0x19, - 0x7a, 0xac, 0x15, 0xa5, 0x6b, 0x8e, 0x27, 0xc4, 0x50, 0xe7, 0x3b, 0x5f, 0xd8, 0xe8, 0x12, 0xf3, - 0x0a, 0x2d, 0xf2, 0x21, 0x3a, 0x8e, 0x30, 0x80, 0x90, 0x51, 0xdf, 0xa2, 0x8f, 0x17, 0x22, 0x90, - 0xdb, 0xa0, 0x26, 0xec, 0x8a, 0x92, 0x6b, 0x54, 0x76, 0xb7, 0x4b, 0x4f, 0xed, 0xd2, 0x93, 0x52, - 0x75, 0xbb, 0xf4, 0x70, 0xbb, 0x82, 0xe0, 0xa7, 0x36, 0x4a, 0x0b, 0xce, 0xaf, 0x2a, 0xb0, 0xa0, - 0x3d, 0xd2, 0xc5, 0xb7, 0x14, 0xbc, 0x86, 0x76, 0x76, 0xd4, 0x3e, 0x24, 0x6d, 0xf4, 0x82, 0xee, - 0xa0, 0x8b, 0x5f, 0x57, 0x36, 0xf5, 0x40, 0xdd, 0x7d, 0x3b, 0xc9, 0xb2, 0xf1, 0x06, 0x15, 0x7e, - 0x22, 0x2e, 0xee, 0x2b, 0x6d, 0x12, 0x32, 0x39, 0xac, 0x50, 0xf2, 0x57, 0xdf, 0xa4, 0xad, 0x79, - 0x25, 0xb2, 0xaa, 0x87, 0x41, 0x53, 0xa5, 0xb6, 0x02, 0x0e, 0xde, 0xe9, 0x1f, 0xba, 0x7d, 0x67, - 0xf5, 0x2d, 0x1a, 0xf0, 0x83, 0xb0, 0x5c, 0x4f, 0x64, 0xf6, 0x1e, 0x91, 0xd9, 0x97, 0x23, 0x83, - 0x05, 0xd8, 0x9d, 0x08, 0xee, 0x1f, 0x2d, 0x4c, 0xf5, 0x8b, 0x08, 0x84, 0x61, 0x43, 0x1d, 0x19, - 0xb3, 0x5a, 0xc2, 0x6c, 0xdc, 0x91, 0x73, 0x6c, 0xbf, 0x23, 0x79, 0x41, 0xf5, 0xfb, 0xbe, 0x64, - 0x00, 0xd5, 0xef, 0x35, 0xa9, 0xee, 0x55, 0xbf, 0x1f, 0x48, 0x4d, 0x86, 0xfa, 0xfd, 0xae, 0x64, - 0xf4, 0xd4, 0xef, 0xf7, 0x24, 0x87, 0x67, 0x89, 0x82, 0xf3, 0x25, 0x5a, 0xb9, 0x9c, 0xae, 0x02, - 0x63, 0x60, 0xae, 0xdc, 0xfd, 0xf1, 0x48, 0x71, 0x77, 0x69, 0xe2, 0x12, 0x3a, 0xed, 0x1e, 0xb4, - 0x38, 0x76, 0xa0, 0xae, 0x43, 0xec, 0x1d, 0x15, 0x6b, 0xb3, 0xc1, 0xb0, 0xdd, 0x7f, 0x66, 0xe0, - 0x1b, 0xf8, 0x45, 0x3b, 0x7f, 0xe8, 0x10, 0xbe, 0x61, 0x5c, 0xe9, 0xf5, 0x3c, 0x6e, 0x77, 0x9f, - 0x10, 0xea, 0xb2, 0x98, 0x41, 0x34, 0xa1, 0x94, 0x18, 0x30, 0xb1, 0x2e, 0x90, 0xa0, 0x23, 0x5f, - 0x62, 0x1e, 0xd8, 0x09, 0xe0, 0x26, 0x41, 0xde, 0xf1, 0x03, 0xb4, 0xd3, 0x43, 0x85, 0x9c, 0x46, - 0x91, 0xe7, 0x15, 0xaf, 0x72, 0xe8, 0xf5, 0xba, 0x86, 0x62, 0x02, 0x2d, 0xf3, 0x47, 0x2e, 0xf4, - 0xbb, 0x10, 0x0c, 0xdc, 0x47, 0xfe, 0x52, 0x63, 0x18, 0xec, 0x60, 0x0f, 0x60, 0xa4, 0x63, 0x40, - 0xef, 0x97, 0x14, 0xa2, 0xfb, 0xee, 0xae, 0x2e, 0xbb, 0xac, 0x75, 0x3e, 0xd8, 0x12, 0xcd, 0xae, - 0x6c, 0xf0, 0xa2, 0xd5, 0xd1, 0x01, 0x75, 0xdb, 0xc7, 0x80, 0xe9, 0x08, 0xb3, 0x2c, 0x07, 0xc8, - 0x5b, 0x96, 0x5e, 0xd5, 0x4c, 0x31, 0x36, 0x3d, 0x72, 0xda, 0x3d, 0xe4, 0xa6, 0x0a, 0x54, 0x0a, - 0xcb, 0x26, 0xc3, 0x9d, 0x44, 0x21, 0xe8, 0x07, 0xe4, 0x92, 0x9b, 0x99, 0x8f, 0xa6, 0x38, 0xa7, - 0x2f, 0xd1, 0x47, 0x44, 0x55, 0xf2, 0x32, 0xdd, 0x01, 0x40, 0x47, 0xfe, 0x78, 0x80, 0xe8, 0xd9, - 0x6e, 0x4b, 0x63, 0xd1, 0xf3, 0x76, 0x6f, 0xec, 0x48, 0x14, 0x82, 0x34, 0xc0, 0x71, 0xc8, 0x3d, - 0x07, 0x18, 0x54, 0x3a, 0x53, 0xb2, 0x48, 0xcd, 0xf3, 0x4d, 0x21, 0xb2, 0x4e, 0x07, 0x60, 0x51, - 0xf3, 0x1b, 0xe2, 0x8a, 0x51, 0x68, 0x8f, 0x01, 0x3b, 0x0f, 0x81, 0x65, 0xed, 0x03, 0x31, 0x7f, - 0x55, 0x35, 0x88, 0xd6, 0xa8, 0x53, 0xbd, 0x45, 0x5a, 0x7c, 0xc0, 0xe2, 0xb4, 0x42, 0x42, 0x1e, - 0x2c, 0x4e, 0xbc, 0x16, 0x68, 0x1b, 0x86, 0x23, 0x92, 0x82, 0x5e, 0x57, 0xde, 0x62, 0x12, 0x86, - 0xf8, 0xd0, 0x6f, 0x47, 0x20, 0x4b, 0x9e, 0xfd, 0x1b, 0x54, 0x8c, 0x86, 0x72, 0x2e, 0x56, 0x20, - 0x70, 0x87, 0xca, 0xd1, 0xd6, 0xd7, 0x6b, 0xc3, 0x76, 0x75, 0xed, 0x83, 0xf6, 0x10, 0x2e, 0x24, - 0x1e, 0xfc, 0x5d, 0xb5, 0xd9, 0x6a, 0x6b, 0xa8, 0xf4, 0x4d, 0xcd, 0xe7, 0xcb, 0x0e, 0x12, 0x06, - 0xde, 0x8a, 0x96, 0x1f, 0xbb, 0xbe, 0x0f, 0xe5, 0xf7, 0x14, 0xac, 0xc8, 0xdf, 0x45, 0x89, 0x94, - 0x73, 0x6a, 0xa3, 0xc7, 0x83, 0x43, 0x40, 0x58, 0x50, 0xf3, 0x36, 0x21, 0x92, 0x97, 0x24, 0x8e, - 0xe5, 0x0b, 0x5e, 0xe2, 0x46, 0x7b, 0xdc, 0x06, 0x30, 0x6a, 0xa1, 0xdd, 0xed, 0xba, 0xcc, 0xbf, - 0xc0, 0xf6, 0x01, 0x30, 0xda, 0x6e, 0x1f, 0x71, 0xb0, 0x37, 0x3c, 0x59, 0x7d, 0x87, 0x06, 0xb8, - 0x2e, 0x07, 0x28, 0xe9, 0x86, 0x7b, 0xd0, 0xae, 0xaa, 0x5a, 0x01, 0xeb, 0x1a, 0x47, 0x3b, 0x6b, - 0x84, 0x76, 0x6e, 0x25, 0xf2, 0x14, 0x51, 0xec, 0xf3, 0x40, 0xac, 0x84, 0x4b, 0xf0, 0x6e, 0xb0, - 0x91, 0x56, 0x99, 0x23, 0x68, 0xbd, 0xc0, 0xe1, 0xf4, 0x81, 0x8b, 0x20, 0x26, 0x07, 0x3a, 0x9d, - 0x33, 0x30, 0x62, 0xb5, 0x7f, 0xe0, 0x25, 0xa2, 0x2e, 0xa5, 0xf8, 0x24, 0x05, 0x5e, 0xe1, 0xd7, - 0x52, 0x22, 0x9f, 0x80, 0x47, 0xe1, 0x44, 0x42, 0xf6, 0x05, 0x66, 0x26, 0x01, 0x12, 0xe3, 0x46, - 0x89, 0x0f, 0xc5, 0x79, 0x13, 0x67, 0xbb, 0xf0, 0x5d, 0xe5, 0x7d, 0x70, 0x7d, 0x32, 0xc2, 0xa6, - 0xe9, 0x21, 0x56, 0x88, 0x5b, 0x29, 0x0a, 0xeb, 0xb1, 0xd5, 0x4f, 0xd2, 0x5f, 0x10, 0x2b, 0x36, - 0x30, 0x15, 0x92, 0xbb, 0x62, 0xd1, 0x20, 0x76, 0xb0, 0x8e, 0x18, 0xb9, 0xcb, 0x7d, 0x03, 0x40, - 0xff, 0x82, 0x2c, 0xad, 0x81, 0xe8, 0xd0, 0xa8, 0x94, 0xeb, 0x8d, 0x8d, 0xca, 0x46, 0x2e, 0x05, - 0xfb, 0xb5, 0x22, 0x2b, 0x2a, 0xdf, 0xdd, 0xad, 0x36, 0xa0, 0x2c, 0x6d, 0xbd, 0xcd, 0xea, 0x7d, - 0x5c, 0x05, 0x1f, 0x16, 0x93, 0x67, 0x80, 0x6c, 0x3c, 0xe9, 0x04, 0x87, 0xa5, 0xff, 0x32, 0xcb, - 0xf2, 0x42, 0xcc, 0xf3, 0xc8, 0x64, 0x1c, 0x53, 0x61, 0x3f, 0x32, 0xed, 0x27, 0x39, 0x97, 0xc0, - 0xab, 0x7e, 0x3d, 0x65, 0x3f, 0x9e, 0x21, 0xc2, 0x07, 0x49, 0xfe, 0x08, 0x35, 0x4c, 0x73, 0xee, - 0x05, 0x5c, 0x2e, 0x8b, 0xab, 0xd7, 0x12, 0xdd, 0x8d, 0x14, 0xb3, 0xfb, 0x96, 0x98, 0x65, 0xe6, - 0x2d, 0x64, 0x7a, 0x8c, 0xb5, 0x66, 0x6f, 0x9f, 0x42, 0xef, 0x2b, 0x39, 0x13, 0x06, 0x54, 0x24, - 0x13, 0xa1, 0x22, 0xd9, 0x28, 0x15, 0x99, 0x51, 0xed, 0x91, 0xfe, 0xf1, 0xcc, 0x97, 0x0b, 0xff, - 0x63, 0x4a, 0xcc, 0xf2, 0x87, 0xc3, 0x3a, 0x6d, 0xed, 0x88, 0x1a, 0xe5, 0x52, 0xd3, 0x93, 0xb9, - 0xcf, 0xcc, 0x64, 0x2e, 0x33, 0xab, 0x70, 0x60, 0x88, 0xb7, 0x9d, 0x51, 0xb8, 0x28, 0xc2, 0xae, - 0xce, 0xc6, 0xd9, 0x58, 0x1a, 0x65, 0x8e, 0x46, 0x89, 0x70, 0x3d, 0xf3, 0x11, 0x56, 0x88, 0x4c, - 0xb6, 0x44, 0xdb, 0x2d, 0x2f, 0x00, 0x3b, 0x13, 0xe0, 0x36, 0xdd, 0x1e, 0xdc, 0x9e, 0x04, 0xb0, - 0xcb, 0xbf, 0x26, 0x5e, 0xee, 0x3b, 0x2f, 0x1c, 0xe5, 0xd9, 0x06, 0x35, 0x76, 0x7b, 0xc4, 0xa4, - 0x09, 0xe4, 0xb2, 0xe1, 0x89, 0xd4, 0x92, 0xa0, 0x21, 0x5b, 0xd3, 0x2c, 0xae, 0x60, 0x05, 0xdf, - 0xbf, 0x97, 0x61, 0x2b, 0x1a, 0x7e, 0x51, 0x8a, 0x72, 0xca, 0xb3, 0x2c, 0x76, 0x70, 0x21, 0x49, - 0x31, 0xa3, 0xa8, 0x06, 0x39, 0xb8, 0x22, 0x05, 0x9e, 0xd5, 0x80, 0x4c, 0x25, 0xed, 0x2f, 0x69, - 0xf5, 0x73, 0xb8, 0xbd, 0xd2, 0x65, 0xcb, 0x1e, 0xf2, 0x17, 0x80, 0xc8, 0x09, 0x75, 0x28, 0x7c, - 0x13, 0xda, 0xc1, 0xfc, 0x89, 0x55, 0x21, 0x25, 0xa5, 0xe9, 0xea, 0xb1, 0x44, 0x43, 0x01, 0x7c, - 0xc9, 0x21, 0xb0, 0xe1, 0xb2, 0xb2, 0x9e, 0x46, 0x6d, 0x0d, 0xb6, 0xd7, 0xef, 0x9d, 0x10, 0x93, - 0x32, 0x1f, 0x01, 0xc9, 0x73, 0x71, 0x5b, 0x08, 0xb3, 0x2a, 0xef, 0x8b, 0x19, 0x16, 0x81, 0xce, - 0xd3, 0x4d, 0xb3, 0x8a, 0xc9, 0x9b, 0x52, 0x6c, 0x62, 0xa3, 0x6d, 0xe4, 0x06, 0xd6, 0x33, 0xa5, - 0x7e, 0xc8, 0x2e, 0x98, 0x9f, 0xa0, 0xa7, 0xba, 0x48, 0xe2, 0xf2, 0x87, 0x42, 0x04, 0x7d, 0xf3, - 0x73, 0x02, 0x7b, 0x03, 0x52, 0x12, 0x62, 0xb6, 0xe6, 0x0d, 0xe1, 0x32, 0x01, 0x1e, 0x9a, 0x17, - 0xd9, 0x47, 0xee, 0xe1, 0x51, 0x2e, 0x0d, 0xd8, 0x7a, 0xfe, 0x09, 0x9c, 0x11, 0xfd, 0xca, 0x58, - 0xbf, 0x9e, 0x66, 0x51, 0x3b, 0x3e, 0x1d, 0x2d, 0x2a, 0xdf, 0x88, 0xba, 0x13, 0x46, 0xdc, 0xe2, - 0x60, 0x7d, 0xb3, 0x0c, 0x6d, 0xd2, 0xec, 0xf2, 0x7a, 0x71, 0xfa, 0x88, 0xc5, 0x26, 0xb5, 0x8e, - 0xec, 0xb8, 0xe1, 0xe0, 0x30, 0x02, 0x32, 0xc9, 0xaa, 0x22, 0x3f, 0xd0, 0x79, 0xca, 0x02, 0xa8, - 0x38, 0x06, 0xde, 0x03, 0x39, 0x28, 0xba, 0x30, 0x85, 0xcf, 0xc4, 0xac, 0x1c, 0xef, 0xd4, 0x89, - 0x86, 0x84, 0x86, 0x74, 0x92, 0xd0, 0xc0, 0x80, 0xfb, 0x4b, 0xe7, 0x03, 0x2d, 0xc0, 0xae, 0x37, - 0x18, 0x0f, 0x00, 0x61, 0x2a, 0xfb, 0xe5, 0x0a, 0xc9, 0x53, 0x46, 0x5d, 0x91, 0xfe, 0xad, 0x6e, - 0xac, 0x9f, 0x7f, 0x5c, 0x2d, 0x3f, 0xae, 0x6c, 0xd8, 0x9b, 0x8d, 0xfa, 0x8e, 0xbd, 0x5d, 0x7f, - 0xf8, 0xf0, 0x29, 0x8e, 0x2e, 0x0f, 0x6c, 0xe4, 0x7c, 0x39, 0x92, 0xe4, 0x0d, 0xa0, 0x18, 0x78, - 0x27, 0x26, 0xe1, 0xf8, 0xbd, 0xf3, 0xb8, 0x11, 0x03, 0x1c, 0x84, 0xcb, 0x70, 0xc5, 0x4b, 0xd6, - 0xbf, 0x9e, 0x13, 0x73, 0x72, 0x64, 0xd8, 0x94, 0xf8, 0xd8, 0x70, 0xbe, 0x91, 0xe2, 0xdd, 0x52, - 0xa3, 0xf5, 0x14, 0x8e, 0x1a, 0x28, 0x94, 0x59, 0x8c, 0xea, 0xa8, 0x1c, 0x32, 0x51, 0x79, 0x52, - 0x4c, 0x7d, 0x5e, 0x6a, 0xda, 0x1b, 0xd5, 0xe6, 0xc3, 0x52, 0x0d, 0x09, 0x54, 0x26, 0x7f, 0x53, - 0x5c, 0xa3, 0x72, 0x7a, 0xf7, 0xb0, 0x53, 0x7a, 0x5c, 0xb1, 0x4b, 0xdb, 0x8d, 0x4a, 0x69, 0xe3, - 0x29, 0x97, 0xe4, 0xb2, 0x20, 0x13, 0x5c, 0x9f, 0xd0, 0x62, 0xb3, 0x5a, 0xdb, 0xa8, 0xd6, 0xb6, - 0x72, 0xc8, 0xfa, 0x5d, 0x88, 0xb4, 0xd9, 0xdc, 0xdb, 0xde, 0xce, 0xcd, 0xe6, 0x5f, 0x12, 0x57, - 0xa2, 0x15, 0x40, 0x35, 0xed, 0xd2, 0xc6, 0x46, 0x6e, 0x2e, 0xff, 0xaa, 0xb8, 0x31, 0xa1, 0x52, - 0xf9, 0xc8, 0xe5, 0xe6, 0x01, 0x0b, 0xbd, 0x92, 0xd0, 0x08, 0x56, 0xc7, 0xa5, 0x95, 0x9d, 0x87, - 0x95, 0x46, 0x0e, 0x3d, 0x15, 0x5e, 0x9a, 0x30, 0x4b, 0xa4, 0x61, 0x39, 0x91, 0x7f, 0x45, 0xbc, - 0x9c, 0xf4, 0xb1, 0xad, 0x4a, 0x4b, 0xee, 0xdc, 0x22, 0x70, 0xcc, 0x17, 0x55, 0x2d, 0x2c, 0x0b, - 0xb7, 0x09, 0xc9, 0xfb, 0x46, 0x6e, 0x09, 0x20, 0x67, 0xb9, 0x5a, 0x7b, 0x52, 0x6d, 0x55, 0xec, - 0x8d, 0x4a, 0xad, 0x0a, 0x45, 0x48, 0x5b, 0x04, 0xf5, 0xe3, 0x95, 0xae, 0xe0, 0xef, 0x9d, 0x12, - 0x50, 0xca, 0xd2, 0xc6, 0x4e, 0xb5, 0x96, 0x3b, 0x87, 0xc7, 0x50, 0xab, 0xe0, 0x34, 0xeb, 0xf6, - 0xee, 0x5e, 0xa3, 0xfc, 0xa8, 0xd4, 0xac, 0xe4, 0x72, 0xc8, 0x0f, 0x34, 0xab, 0x5b, 0x40, 0x4d, - 0x61, 0xe6, 0xcd, 0x66, 0x69, 0xab, 0x92, 0x3b, 0x0f, 0x00, 0xb1, 0xb4, 0xb5, 0x57, 0xdd, 0xde, - 0xb0, 0xf9, 0xd8, 0xa0, 0xd1, 0x75, 0x51, 0x30, 0x27, 0xd2, 0xa8, 0x6c, 0xa1, 0xdf, 0x60, 0x7d, - 0x73, 0x73, 0xbb, 0x5a, 0xab, 0xe4, 0x2e, 0xe0, 0x44, 0x5b, 0xf5, 0x3a, 0x2c, 0xa5, 0x26, 0x8f, - 0x69, 0xab, 0x51, 0xdf, 0xdb, 0x6d, 0xe6, 0x2e, 0x02, 0xc6, 0xba, 0xda, 0xaa, 0xef, 0x35, 0x6a, - 0xb0, 0xe6, 0x5a, 0x8b, 0x96, 0x4e, 0x1c, 0xc9, 0x66, 0x7d, 0xaf, 0xb6, 0x91, 0xbb, 0x44, 0xa7, - 0x1d, 0xa9, 0x86, 0x89, 0x31, 0x44, 0xd9, 0xd5, 0x8d, 0xdc, 0xe5, 0x49, 0x2d, 0xf8, 0x59, 0x0c, - 0xb4, 0xb8, 0x92, 0xbf, 0x2d, 0x5e, 0x4d, 0x6a, 0x51, 0xab, 0xdb, 0x8d, 0xd2, 0x46, 0xb5, 0x04, - 0x65, 0x04, 0x72, 0xab, 0xf9, 0x5b, 0xe2, 0xe6, 0x84, 0x86, 0x1b, 0xc0, 0x09, 0x71, 0xab, 0xab, - 0x74, 0xbe, 0x91, 0x56, 0xcd, 0xcf, 0xb6, 0xed, 0xbd, 0xdd, 0x8d, 0x52, 0x4b, 0x9d, 0x75, 0xae, - 0x40, 0xdb, 0x09, 0x0b, 0xd9, 0xae, 0x94, 0xb6, 0xf6, 0xd4, 0x26, 0xbf, 0x04, 0x78, 0xe1, 0x12, - 0x1f, 0x02, 0xd6, 0xd1, 0x4b, 0x1d, 0xdc, 0xef, 0x9d, 0x9d, 0xdc, 0x35, 0xfc, 0x7a, 0x62, 0x95, - 0x5d, 0xae, 0x97, 0xca, 0x8f, 0xca, 0xb0, 0x21, 0xad, 0xdc, 0xcb, 0xb8, 0x5c, 0x6e, 0xc5, 0x80, - 0x64, 0x57, 0x6b, 0x76, 0x09, 0x3a, 0x3c, 0x82, 0x3f, 0x09, 0x6e, 0xae, 0x27, 0xb5, 0xd8, 0xae, - 0x7f, 0x6e, 0xef, 0x36, 0xaa, 0xf5, 0x46, 0x15, 0xc0, 0xe6, 0x06, 0x5e, 0xad, 0xf2, 0x76, 0x15, - 0x67, 0x5f, 0xdf, 0x83, 0xff, 0x36, 0x6d, 0x9c, 0x79, 0xee, 0x26, 0x9e, 0x45, 0xb9, 0xbe, 0xb3, - 0x5b, 0x69, 0x55, 0x5b, 0xd5, 0x27, 0x15, 0xfc, 0x34, 0x2c, 0x9d, 0xbe, 0x5e, 0x69, 0xe6, 0x5e, - 0xc1, 0x7b, 0x15, 0xaf, 0x0e, 0x0d, 0x6d, 0x21, 0x54, 0xc7, 0xda, 0xb4, 0xec, 0xbd, 0xda, 0x76, - 0x9d, 0x20, 0xe5, 0xd5, 0xfc, 0x1b, 0xe2, 0x56, 0xa4, 0x01, 0xed, 0xa0, 0xe4, 0xd9, 0x5a, 0x70, - 0x09, 0x60, 0x44, 0x68, 0x79, 0x2b, 0x5f, 0x10, 0x97, 0xc3, 0x55, 0x7a, 0x94, 0xd7, 0x10, 0x93, - 0x34, 0x4b, 0xd0, 0x9d, 0x1a, 0x00, 0xef, 0xda, 0xd8, 0xdb, 0x6d, 0xe5, 0x5e, 0xc7, 0x5b, 0x5d, - 0xad, 0x35, 0xf7, 0x50, 0x0f, 0x4e, 0xcb, 0x03, 0x58, 0xac, 0xb7, 0x9a, 0xb9, 0xdb, 0xc9, 0x2b, - 0x7b, 0xb7, 0xd9, 0x2a, 0x95, 0x1f, 0x37, 0x73, 0x6f, 0x00, 0x47, 0x78, 0x27, 0x52, 0x2d, 0x77, - 0x70, 0xa7, 0x61, 0x37, 0x77, 0xf1, 0x56, 0xda, 0x08, 0xbe, 0xdb, 0xa5, 0x06, 0xc0, 0xff, 0x1d, - 0xe0, 0xf7, 0xdf, 0x4b, 0x58, 0x64, 0xa5, 0x56, 0xdf, 0xdb, 0x7a, 0x64, 0x37, 0x1f, 0x57, 0xb7, - 0xb7, 0x71, 0x47, 0x4b, 0x36, 0xb1, 0xd1, 0x3b, 0xf5, 0x86, 0x7a, 0x26, 0x96, 0xbb, 0x9b, 0xbf, - 0x2f, 0xee, 0x9d, 0xa9, 0x2b, 0x1c, 0x1a, 0x5f, 0xf2, 0x37, 0x71, 0xee, 0x3c, 0x1b, 0x00, 0xa5, - 0x0d, 0x38, 0x4f, 0x34, 0x35, 0xc0, 0x35, 0x65, 0xa4, 0xfa, 0x16, 0x6e, 0x05, 0x8c, 0x72, 0xff, - 0xc9, 0x7d, 0x5c, 0x12, 0x36, 0xac, 0xc2, 0x61, 0xdd, 0xc3, 0xdd, 0x0b, 0x8a, 0x43, 0x87, 0x54, - 0xcc, 0xdf, 0x11, 0xaf, 0x7d, 0x5e, 0xa9, 0x3c, 0xae, 0xd4, 0x70, 0x59, 0x00, 0xc9, 0x95, 0xa7, - 0x74, 0x63, 0x9b, 0xad, 0x46, 0xa9, 0x85, 0xf7, 0x16, 0xa7, 0x54, 0xdf, 0xad, 0xd4, 0x72, 0x6f, - 0xe3, 0xc7, 0xa3, 0x4d, 0xf7, 0x6a, 0x74, 0xb7, 0xe0, 0x1c, 0xde, 0xc1, 0x8f, 0xef, 0xd6, 0x9b, - 0x2d, 0x79, 0xdb, 0x9a, 0x7b, 0x8d, 0x27, 0x95, 0xa7, 0xb9, 0xfb, 0x88, 0x34, 0x5a, 0x8d, 0xfa, - 0xee, 0x23, 0x90, 0x39, 0x3e, 0x2f, 0x91, 0x60, 0xb1, 0x06, 0xa4, 0xe5, 0x9c, 0x2c, 0xdb, 0xae, - 0x3c, 0xa9, 0xe0, 0x7d, 0xc9, 0x3d, 0x40, 0x70, 0x81, 0x03, 0xb7, 0x01, 0x7a, 0x01, 0xd0, 0x1e, - 0xc1, 0x9f, 0x95, 0xda, 0x56, 0x05, 0xa6, 0x5a, 0xdf, 0x6a, 0x00, 0xb6, 0xc9, 0xbd, 0x8b, 0xa0, - 0x4a, 0x48, 0xa9, 0x5a, 0x83, 0x0d, 0x2b, 0x6d, 0xf3, 0x16, 0xe5, 0xde, 0xc3, 0x8e, 0xf1, 0xf2, - 0x60, 0xd7, 0xde, 0xc7, 0xf5, 0xb7, 0xf0, 0xb8, 0x70, 0x73, 0xb7, 0x60, 0xc3, 0xec, 0x9d, 0x6a, - 0x93, 0x09, 0xc4, 0x07, 0x78, 0x35, 0x9f, 0x94, 0xca, 0x7c, 0xcf, 0x2a, 0x8d, 0xea, 0x26, 0xe2, - 0xc7, 0x6f, 0xe2, 0xfd, 0x33, 0xc9, 0xd0, 0x67, 0x7b, 0x15, 0xb8, 0xb7, 0x30, 0x55, 0x80, 0x23, - 0x00, 0x14, 0xd8, 0x57, 0x20, 0x1c, 0x1f, 0xe2, 0x25, 0x98, 0xd4, 0xaa, 0xc2, 0xc4, 0x65, 0x1d, - 0x2f, 0x39, 0x97, 0x44, 0xb7, 0xfe, 0x5b, 0xb8, 0x9f, 0x3b, 0x3b, 0xaa, 0xd0, 0xae, 0xd7, 0xb6, - 0x9f, 0x4a, 0xd8, 0xb0, 0x4b, 0x8d, 0xdc, 0xb7, 0x71, 0xd6, 0xe5, 0xda, 0xd3, 0xb5, 0x77, 0xee, - 0xbf, 0x07, 0x75, 0x65, 0xd8, 0x09, 0x38, 0xef, 0x06, 0xa1, 0xc2, 0x8f, 0x10, 0x5f, 0x33, 0xda, - 0x23, 0xfc, 0xfd, 0x31, 0x02, 0x3b, 0x7f, 0x65, 0x17, 0x00, 0xa2, 0xd5, 0xb4, 0x2b, 0x25, 0x38, - 0x9e, 0x8d, 0xdc, 0x27, 0x48, 0x38, 0xca, 0x7b, 0xcd, 0x56, 0x5d, 0x5e, 0xad, 0x6a, 0x0d, 0x2f, - 0x48, 0xa5, 0xdc, 0x52, 0xfe, 0xdc, 0xb9, 0xef, 0x24, 0x5c, 0x65, 0x04, 0x75, 0x84, 0xf1, 0x47, - 0x55, 0x04, 0xc4, 0xb5, 0x5c, 0x09, 0xcf, 0x76, 0xbb, 0xba, 0x03, 0x24, 0x64, 0xc3, 0xde, 0x6b, - 0xc2, 0x3c, 0xe0, 0x7c, 0x5a, 0xb9, 0x87, 0xb8, 0xf3, 0xf2, 0xb3, 0x8d, 0xca, 0x4e, 0x75, 0x6f, - 0x27, 0xf2, 0xf9, 0xb2, 0xf5, 0x84, 0xbd, 0x3d, 0x90, 0xdf, 0x40, 0xf7, 0x2f, 0xf6, 0xa7, 0x69, - 0x6e, 0xd4, 0x13, 0x05, 0x22, 0x7c, 0x0a, 0xc0, 0x2c, 0xa3, 0x7a, 0x81, 0x07, 0xdc, 0xf9, 0x60, - 0xe8, 0x1d, 0xb8, 0xbd, 0x40, 0xd0, 0x60, 0x26, 0xe7, 0xdb, 0x81, 0x4c, 0x89, 0xe3, 0x96, 0xba, - 0xc0, 0x12, 0x9f, 0x79, 0x58, 0xeb, 0x23, 0xc0, 0x79, 0xb1, 0x59, 0x4d, 0x52, 0x6c, 0x92, 0x78, - 0xf0, 0x7d, 0x0f, 0x5f, 0x01, 0x32, 0x3f, 0x67, 0xfd, 0x56, 0x56, 0x2c, 0x99, 0xfd, 0x01, 0x5a, - 0xb4, 0x6f, 0x57, 0x4a, 0xbd, 0x5e, 0x8a, 0x8f, 0x6f, 0x70, 0xc4, 0xe9, 0x90, 0xea, 0x21, 0xa3, - 0x6c, 0x4b, 0xa8, 0x21, 0xce, 0x2a, 0x36, 0xab, 0x8d, 0x6b, 0x0a, 0x44, 0x2b, 0xd4, 0xcb, 0xb9, - 0xe4, 0xdb, 0x82, 0xc6, 0xad, 0x6e, 0xf0, 0xe6, 0xaf, 0xeb, 0xfa, 0xf8, 0xd8, 0xc2, 0x61, 0xf3, - 0xd3, 0x3c, 0x8e, 0x4a, 0x5e, 0xee, 0x5a, 0x47, 0xda, 0xf3, 0x48, 0x0b, 0xb4, 0xa0, 0xbe, 0x49, - 0x6a, 0x33, 0x16, 0x33, 0x5e, 0x15, 0x2f, 0x75, 0xda, 0x3d, 0x77, 0x9f, 0xe5, 0x6b, 0x29, 0x23, - 0x04, 0x3c, 0xea, 0xaa, 0xea, 0x42, 0x22, 0xdb, 0xa2, 0x7a, 0x6b, 0x41, 0x4f, 0x7d, 0xa9, 0x68, - 0x49, 0x49, 0x24, 0xfb, 0xa8, 0x27, 0x19, 0x72, 0xe1, 0xb2, 0x32, 0x02, 0x11, 0xc3, 0xec, 0xc9, - 0xd2, 0x15, 0x55, 0x1a, 0x52, 0xa4, 0x9c, 0x53, 0x4b, 0x1f, 0x0f, 0x7b, 0xf2, 0xd5, 0x20, 0x9c, - 0xf9, 0xc1, 0xb8, 0xd7, 0xa3, 0xb9, 0x90, 0x90, 0xd3, 0x95, 0xda, 0x51, 0xd8, 0x3f, 0x16, 0x4e, - 0x7c, 0x90, 0x28, 0x32, 0x7c, 0x38, 0x66, 0x2b, 0x56, 0x91, 0xde, 0x12, 0xd7, 0x8c, 0x42, 0x7c, - 0x21, 0xd1, 0xe1, 0x47, 0x28, 0x43, 0x8f, 0x4c, 0x4c, 0x17, 0x95, 0xaa, 0x98, 0x1e, 0x48, 0x23, - 0x67, 0x7d, 0xdc, 0x7e, 0x06, 0x8b, 0x35, 0x47, 0xba, 0xa4, 0x2c, 0x22, 0x28, 0x15, 0x72, 0x19, - 0x56, 0x93, 0x56, 0xe2, 0xb2, 0xf6, 0x4e, 0x87, 0x3a, 0x18, 0x57, 0x95, 0x93, 0x4a, 0xd5, 0xfa, - 0xdd, 0x54, 0x00, 0x5a, 0x6c, 0x86, 0x24, 0x00, 0x51, 0x27, 0x9d, 0x32, 0x4f, 0x9a, 0x19, 0x6a, - 0xb5, 0xbb, 0x99, 0xf8, 0xee, 0x66, 0x93, 0x76, 0x77, 0x26, 0x71, 0x77, 0x67, 0x13, 0x77, 0x77, - 0xce, 0xdc, 0xdd, 0x79, 0x52, 0x08, 0xfd, 0x7e, 0x36, 0x10, 0xa4, 0x83, 0x09, 0x6a, 0x71, 0xe9, - 0x81, 0x98, 0x53, 0xb2, 0x0b, 0x42, 0xb2, 0x29, 0xef, 0xc5, 0x5b, 0x17, 0xd9, 0xea, 0x1d, 0x07, - 0x6c, 0x94, 0x5e, 0x9d, 0x8e, 0xd7, 0xef, 0x9a, 0xc0, 0x94, 0x51, 0x1b, 0x27, 0x7d, 0x18, 0xbb, - 0xfc, 0xe8, 0x43, 0xde, 0xa9, 0x5f, 0xcd, 0x88, 0x59, 0x39, 0xdc, 0x45, 0x31, 0x27, 0x1f, 0x2e, - 0xe7, 0xfe, 0x51, 0xfd, 0x2f, 0x05, 0xab, 0x98, 0x93, 0xb6, 0x74, 0x10, 0x1e, 0x00, 0xfd, 0x21, - 0xcb, 0x65, 0x57, 0x76, 0x76, 0x49, 0x6a, 0x00, 0xf4, 0x47, 0xbf, 0x1f, 0x02, 0x71, 0x06, 0xd4, - 0xd4, 0x28, 0x95, 0x5b, 0x80, 0xde, 0x40, 0x70, 0x50, 0x0d, 0x5b, 0xc0, 0x32, 0xd7, 0x40, 0x60, - 0x00, 0x56, 0x98, 0x7f, 0x23, 0x05, 0xaf, 0x03, 0x82, 0xce, 0xe6, 0x97, 0xc5, 0x42, 0xab, 0xb4, - 0x25, 0x87, 0x9a, 0x21, 0x51, 0x03, 0x7e, 0x46, 0x46, 0x9a, 0x55, 0xcd, 0x78, 0x20, 0x94, 0xe6, - 0x97, 0xe8, 0xa7, 0x1a, 0x07, 0x8d, 0xaa, 0x4b, 0x65, 0xe0, 0x0e, 0x5a, 0xf5, 0x86, 0xfd, 0x70, - 0xaf, 0xf9, 0x34, 0x87, 0xd6, 0x9f, 0xf3, 0x7b, 0xb5, 0xe6, 0x6e, 0xa5, 0x4c, 0x54, 0xc5, 0xae, - 0x34, 0x1a, 0xf5, 0x06, 0xf0, 0xf2, 0xc0, 0x1f, 0xab, 0x86, 0xc4, 0xd3, 0x13, 0x62, 0x05, 0xa2, - 0x5b, 0x22, 0x3a, 0xba, 0x88, 0x2b, 0x25, 0x5a, 0xb1, 0x55, 0x07, 0xde, 0x1d, 0x91, 0xb3, 0xd9, - 0x98, 0x7e, 0xd0, 0x3b, 0x9c, 0x7a, 0x7d, 0x7b, 0xa3, 0xfe, 0x79, 0x2d, 0x87, 0x7b, 0x9a, 0xc7, - 0xd6, 0x40, 0x45, 0xb7, 0xeb, 0x30, 0x6d, 0xc9, 0x75, 0xae, 0x20, 0x7d, 0xa1, 0xc5, 0xc2, 0x3a, - 0x80, 0x92, 0x32, 0xdb, 0x02, 0xb8, 0x1f, 0xf0, 0xf5, 0xf6, 0x53, 0xe0, 0xf1, 0x8d, 0x79, 0x84, - 0x18, 0x25, 0x22, 0xc9, 0xb9, 0x9c, 0xf5, 0x87, 0x29, 0x91, 0x53, 0x87, 0x5f, 0xe9, 0xba, 0xa3, - 0x7f, 0x5a, 0x90, 0x6c, 0x42, 0x1d, 0xab, 0x88, 0xfc, 0x80, 0x26, 0xa8, 0xe9, 0x6e, 0xc3, 0x88, - 0x7a, 0x5e, 0xa9, 0xf8, 0xbc, 0xd2, 0x49, 0xf3, 0xca, 0x24, 0xce, 0x8b, 0x97, 0x60, 0x7c, 0x94, - 0xbd, 0x21, 0xfe, 0x44, 0xfa, 0xf5, 0x47, 0xbf, 0xaa, 0x6f, 0xd4, 0x7b, 0xd1, 0x1b, 0x15, 0xa8, - 0xbc, 0x93, 0xda, 0xcb, 0x3b, 0x65, 0xb5, 0xbf, 0xca, 0x75, 0x38, 0x33, 0xe8, 0x99, 0xa0, 0x65, - 0xed, 0xb0, 0x33, 0xb8, 0x39, 0x13, 0xe5, 0xe7, 0x93, 0xac, 0xef, 0x96, 0xdb, 0x9f, 0x8e, 0x6e, - 0x3f, 0x93, 0xe4, 0xff, 0x38, 0xc5, 0xaf, 0x70, 0x13, 0xc6, 0x33, 0x1d, 0xa4, 0xc2, 0x9b, 0x71, - 0xbb, 0x78, 0x4a, 0x17, 0xb5, 0x1f, 0xad, 0x9f, 0xc4, 0x7e, 0x58, 0xaf, 0xb3, 0xe7, 0x08, 0x7e, - 0x7f, 0x83, 0xc9, 0x28, 0x01, 0x79, 0xcc, 0xa7, 0xfd, 0x3f, 0x4c, 0xf1, 0x93, 0xc4, 0x48, 0x43, - 0xbd, 0xae, 0x6f, 0x47, 0xbc, 0x83, 0x5e, 0x2d, 0x4e, 0x69, 0x2d, 0x97, 0xb4, 0xae, 0x26, 0x8c, - 0x20, 0x19, 0x28, 0x4c, 0xd3, 0xf2, 0x65, 0x82, 0x5a, 0x6e, 0x68, 0x61, 0xf0, 0x03, 0x6f, 0xf7, - 0x5e, 0xa3, 0x92, 0x43, 0x27, 0xf4, 0xf3, 0xf2, 0x07, 0xcb, 0x0d, 0x84, 0xc0, 0xd2, 0xd6, 0xd5, - 0xe0, 0x58, 0xa5, 0x06, 0x8b, 0xb6, 0x15, 0x63, 0x38, 0xfc, 0xbe, 0x71, 0x44, 0x91, 0x3a, 0xbd, - 0x94, 0xef, 0x44, 0x96, 0x72, 0xbb, 0x78, 0x4a, 0x8f, 0xd8, 0x72, 0x6e, 0xc8, 0xe7, 0x32, 0xac, - 0x4f, 0x3b, 0x1f, 0x62, 0x85, 0x68, 0x1a, 0xd6, 0xe9, 0x8b, 0x03, 0xc6, 0x31, 0x17, 0xed, 0x87, - 0xc7, 0x02, 0x4c, 0x8a, 0x36, 0xf9, 0xcc, 0x93, 0x6b, 0xa6, 0xc1, 0x1e, 0x4a, 0xef, 0x96, 0x97, - 0xa4, 0xa3, 0x13, 0x07, 0x87, 0x58, 0x0e, 0x7d, 0xdf, 0xba, 0x17, 0x90, 0x3f, 0xfc, 0xbd, 0xcb, - 0xdd, 0x0d, 0x47, 0xdc, 0xf0, 0xc1, 0xbf, 0xcb, 0xde, 0x38, 0x61, 0x4e, 0x2e, 0xd2, 0x29, 0xfe, - 0x7c, 0xf6, 0xcd, 0x00, 0x5a, 0xb0, 0x57, 0x75, 0xe3, 0xe1, 0x49, 0x8d, 0x1e, 0xcf, 0x72, 0x87, - 0x10, 0x0e, 0xb5, 0xbe, 0x13, 0x20, 0x90, 0x70, 0x63, 0x79, 0x20, 0x30, 0x27, 0xc7, 0x38, 0x91, - 0xe5, 0x18, 0xb9, 0xb5, 0x1e, 0x87, 0x3f, 0xa7, 0xa7, 0x37, 0x69, 0x00, 0xb5, 0x41, 0xe9, 0xa4, - 0x0d, 0xba, 0x66, 0xd8, 0x77, 0x86, 0x1e, 0xa1, 0xa7, 0xc0, 0x25, 0xd8, 0xfa, 0x9f, 0x8c, 0x8b, - 0x10, 0xaa, 0xd6, 0xd8, 0x6e, 0x06, 0x87, 0x56, 0x7c, 0x70, 0xa0, 0x4c, 0x4d, 0x68, 0x5c, 0xc4, - 0x02, 0xf6, 0x34, 0x35, 0xa6, 0x48, 0x4b, 0x2a, 0x9c, 0x00, 0xb5, 0x35, 0x6b, 0x43, 0xa7, 0x12, - 0x26, 0x3b, 0x51, 0xc6, 0x38, 0x13, 0x62, 0x5a, 0xb3, 0x89, 0xe4, 0x64, 0x26, 0xd1, 0x43, 0x95, - 0x58, 0x6a, 0xab, 0x12, 0xe8, 0x94, 0xe9, 0x3c, 0xfa, 0xcf, 0xdd, 0x91, 0x63, 0xf3, 0xff, 0x0d, - 0xf1, 0x9d, 0xf9, 0x24, 0x63, 0x4e, 0xf8, 0x50, 0x7e, 0x31, 0x23, 0xde, 0x4e, 0x18, 0x67, 0xab, - 0x5c, 0x3d, 0x3e, 0x76, 0xba, 0x2e, 0x4c, 0x55, 0xed, 0x43, 0xcb, 0x93, 0x83, 0xe7, 0x77, 0x23, - 0x77, 0xef, 0x83, 0xe2, 0x57, 0x1c, 0x21, 0x76, 0x17, 0x61, 0x89, 0x2e, 0x55, 0x85, 0x1e, 0x47, - 0xc7, 0x99, 0x30, 0x46, 0xe1, 0xff, 0x6d, 0x2a, 0xf9, 0x66, 0x02, 0x3e, 0x95, 0xfa, 0x23, 0xe2, - 0x55, 0x00, 0xf7, 0x80, 0x54, 0xcb, 0x2a, 0x45, 0xa9, 0xa8, 0xd1, 0xd6, 0xc4, 0x34, 0x36, 0x56, - 0x55, 0x84, 0x7c, 0x33, 0x28, 0x25, 0xaa, 0x12, 0xa5, 0xd6, 0x04, 0x06, 0xa6, 0xf5, 0x48, 0x6a, - 0xd1, 0xd0, 0x56, 0xf3, 0x4a, 0x52, 0x03, 0xa5, 0x24, 0xc4, 0x56, 0xcd, 0xdc, 0x4c, 0x32, 0x12, - 0x9f, 0x45, 0x3e, 0x46, 0xf5, 0x4e, 0xe0, 0x63, 0xe6, 0xac, 0xe7, 0xec, 0xef, 0x1e, 0xdb, 0x46, - 0x85, 0xcf, 0xe4, 0xe6, 0x39, 0xc8, 0xf0, 0xf3, 0x66, 0x85, 0x9c, 0x93, 0xf5, 0xab, 0xfc, 0x08, - 0x8e, 0xd6, 0x72, 0x25, 0x82, 0x62, 0x26, 0xc4, 0x01, 0x11, 0xd0, 0x61, 0x64, 0x9c, 0xd7, 0x27, - 0x42, 0x92, 0x71, 0x76, 0x00, 0x51, 0x1b, 0x91, 0x83, 0x2f, 0x16, 0xcf, 0xd6, 0x51, 0x9d, 0x77, - 0x16, 0xf5, 0x40, 0x80, 0x76, 0xd4, 0xe9, 0xcd, 0x0b, 0x2a, 0x61, 0x33, 0x4a, 0xa3, 0xf2, 0x29, - 0x08, 0xfc, 0x39, 0xa2, 0x91, 0xad, 0xea, 0x4e, 0xa5, 0xbe, 0xd7, 0x02, 0x32, 0xf1, 0xd7, 0xc9, - 0xb3, 0xc3, 0x6d, 0x89, 0x82, 0xe5, 0xe6, 0x59, 0x66, 0x97, 0xd0, 0x51, 0xcd, 0x6e, 0x96, 0xb5, - 0x54, 0xc9, 0xc0, 0x68, 0x6d, 0xe9, 0x59, 0xc3, 0x5c, 0xb9, 0x25, 0xcc, 0x1b, 0xd8, 0x6d, 0x9e, - 0x37, 0xea, 0x28, 0xc2, 0x53, 0x4f, 0x86, 0x83, 0x0c, 0x52, 0xb7, 0xb3, 0xad, 0xc8, 0xc9, 0x6f, - 0x7d, 0xbd, 0x15, 0x9d, 0x89, 0x74, 0x9f, 0x85, 0xba, 0x7d, 0x18, 0x56, 0x8b, 0xd4, 0xfb, 0x12, - 0x67, 0xc7, 0x51, 0x1d, 0x62, 0x46, 0x72, 0x1e, 0xef, 0xca, 0xd8, 0x1c, 0x1f, 0x05, 0x66, 0x49, - 0x7c, 0x08, 0x78, 0x8a, 0xfe, 0x22, 0x86, 0x96, 0xfe, 0xb5, 0x54, 0x80, 0xde, 0xc2, 0xfd, 0x35, - 0x0e, 0xff, 0x24, 0xb2, 0x39, 0x01, 0x12, 0x4f, 0xee, 0x10, 0xdd, 0x94, 0x33, 0xed, 0xc0, 0xa7, - 0xfc, 0xce, 0x94, 0x76, 0x60, 0xd8, 0xee, 0xfb, 0x07, 0x80, 0x5b, 0x95, 0x22, 0x07, 0x1d, 0xde, - 0xfb, 0xce, 0x0b, 0x9b, 0x35, 0x20, 0xa7, 0xaf, 0xe9, 0x7f, 0x4b, 0xb1, 0x73, 0x7e, 0xe2, 0x60, - 0x7a, 0x59, 0x0f, 0x23, 0xcb, 0xba, 0x53, 0x3c, 0xb5, 0xcf, 0xd9, 0xd0, 0xa9, 0x75, 0x98, 0xbc, - 0x5e, 0x00, 0x61, 0xc2, 0x8d, 0xa4, 0xed, 0x4f, 0xa1, 0xe8, 0x89, 0x66, 0x10, 0xd2, 0xce, 0x4b, - 0xb3, 0x16, 0x88, 0xad, 0x54, 0x8b, 0x6a, 0x77, 0xa3, 0x22, 0x93, 0x0c, 0xe1, 0x59, 0xeb, 0x16, - 0xfb, 0x90, 0xd3, 0x43, 0x7b, 0x74, 0x1f, 0x4b, 0x66, 0x56, 0x7f, 0x25, 0x15, 0xec, 0xad, 0x6e, - 0xa6, 0xb7, 0x61, 0x3d, 0xb2, 0x0d, 0x81, 0x17, 0x61, 0xac, 0xed, 0x8f, 0x0b, 0xda, 0xd7, 0x82, - 0xf9, 0x3c, 0x74, 0xf0, 0x09, 0xfa, 0x70, 0xe4, 0x76, 0xdc, 0x01, 0xe9, 0x9c, 0x38, 0x6e, 0x56, - 0xc7, 0xf1, 0x7d, 0x7b, 0xe8, 0x1e, 0x1e, 0x8d, 0x7c, 0xb9, 0x88, 0x17, 0x01, 0x17, 0x4b, 0x2e, - 0xf9, 0x47, 0xed, 0x91, 0xe9, 0x8c, 0xc3, 0x7f, 0x9a, 0xd8, 0x78, 0x33, 0x28, 0x25, 0x63, 0x68, - 0x56, 0x9a, 0x3b, 0x49, 0x75, 0x11, 0xf4, 0xc6, 0x87, 0xf4, 0xb6, 0x74, 0xd4, 0x37, 0x8b, 0xf8, - 0x21, 0x41, 0xbb, 0x67, 0x15, 0xd9, 0x37, 0x5b, 0x6f, 0x88, 0xf9, 0x65, 0xb8, 0x61, 0xea, 0x1b, - 0xca, 0xe7, 0xc6, 0xfa, 0x20, 0x58, 0x1c, 0x3f, 0x52, 0xa8, 0x1e, 0xf6, 0x3d, 0x20, 0xac, 0x7b, - 0x3e, 0x5c, 0x49, 0xa4, 0x28, 0xfc, 0x33, 0x06, 0xc6, 0xd6, 0x0f, 0x67, 0x02, 0xe1, 0x03, 0x3f, - 0xb2, 0xc3, 0x91, 0xf3, 0x12, 0xaf, 0x71, 0xf8, 0xc3, 0x69, 0xc5, 0xd3, 0x0c, 0x9c, 0xa1, 0x0f, - 0x93, 0x36, 0x5d, 0x36, 0x96, 0x90, 0xb7, 0xfb, 0x72, 0x24, 0xd5, 0x88, 0x78, 0x60, 0xa1, 0x27, - 0x6f, 0xcb, 0xf9, 0x57, 0xc4, 0x55, 0x7f, 0x7c, 0x78, 0x48, 0x76, 0x6b, 0xc6, 0x73, 0xc6, 0xd7, - 0x66, 0x55, 0x40, 0x8d, 0x48, 0x13, 0xe3, 0xdd, 0xcd, 0xeb, 0xe2, 0xba, 0x8c, 0xfc, 0x67, 0x77, - 0x87, 0xed, 0x83, 0x91, 0xed, 0xbd, 0xe8, 0x87, 0x09, 0x26, 0x2b, 0x1e, 0x6f, 0x8b, 0x1b, 0xe1, - 0x76, 0xf1, 0x68, 0x4b, 0x0b, 0x4a, 0x3d, 0xeb, 0x3c, 0x97, 0xcf, 0x68, 0x85, 0x76, 0xe6, 0x0b, - 0x7f, 0x7f, 0xe4, 0xf1, 0x63, 0x15, 0x19, 0xe7, 0x04, 0x96, 0xce, 0x5d, 0x06, 0x00, 0x1a, 0x23, - 0x5f, 0x3a, 0x6b, 0xc2, 0x62, 0x3b, 0xf0, 0xdb, 0x3e, 0xe8, 0xb9, 0x03, 0xf9, 0xbc, 0xf4, 0x92, - 0x58, 0x90, 0x9f, 0x85, 0xc1, 0x51, 0x03, 0x39, 0xb3, 0x9e, 0xbe, 0x77, 0x3f, 0x7f, 0x53, 0xac, - 0xfa, 0x47, 0x18, 0x45, 0x4e, 0x49, 0x0f, 0x31, 0x47, 0x08, 0x7c, 0x76, 0x24, 0x37, 0x7c, 0xec, - 0x73, 0x77, 0x76, 0x87, 0x78, 0x07, 0x15, 0xae, 0x1d, 0xc7, 0x1e, 0x7a, 0xd2, 0x25, 0xc2, 0x74, - 0x9d, 0x35, 0x8e, 0xb1, 0xb8, 0x01, 0xad, 0x1a, 0x9e, 0x0c, 0x5a, 0xc5, 0x1f, 0x53, 0x5e, 0x84, - 0x79, 0xe5, 0xa7, 0xcd, 0xe5, 0xfa, 0x8d, 0xd5, 0x05, 0x2a, 0xb7, 0x44, 0xc1, 0x2c, 0x4f, 0xf2, - 0x99, 0xa0, 0x13, 0x32, 0xda, 0xe0, 0x5b, 0x25, 0x7c, 0xe3, 0x70, 0x29, 0x78, 0xf6, 0xce, 0xf1, - 0xe6, 0x30, 0xba, 0x89, 0x6d, 0x40, 0xce, 0x65, 0xa5, 0x13, 0x96, 0x6e, 0xa7, 0xa4, 0xb4, 0x2c, - 0x7c, 0x2c, 0xe6, 0xf5, 0x6c, 0xe1, 0x34, 0x70, 0x69, 0xe4, 0xb7, 0x92, 0x52, 0xe1, 0x0d, 0xb8, - 0xa4, 0xfd, 0xa5, 0x0c, 0x78, 0xb0, 0xa2, 0x51, 0x08, 0xc2, 0xdc, 0x8c, 0xe5, 0x18, 0x3a, 0x4f, - 0xda, 0x01, 0x22, 0x47, 0x31, 0xb1, 0x28, 0x06, 0xb1, 0x69, 0xfd, 0xc2, 0x2b, 0xb2, 0xd5, 0x99, - 0xc8, 0x34, 0x59, 0x45, 0xf8, 0x7f, 0xcc, 0x04, 0xd2, 0x6b, 0x04, 0x27, 0x68, 0xec, 0x86, 0x93, - 0x95, 0x7f, 0xcb, 0xab, 0x93, 0x8c, 0x2d, 0xc2, 0x17, 0x2a, 0xa3, 0x9c, 0x91, 0xf0, 0x45, 0x99, - 0xd2, 0xe4, 0x67, 0xa5, 0x3a, 0x39, 0xf2, 0x6c, 0xfb, 0x42, 0x31, 0x61, 0xad, 0x51, 0xe4, 0x33, - 0xfb, 0xf5, 0x90, 0x4f, 0xbe, 0xa2, 0x77, 0x76, 0x2e, 0x22, 0x7c, 0x4f, 0x58, 0xb0, 0x42, 0xd1, - 0x4b, 0xf4, 0xe6, 0x48, 0xe1, 0xe9, 0xab, 0xe2, 0xfc, 0x61, 0xc7, 0xe6, 0x27, 0x22, 0xe8, 0x0c, - 0x8d, 0xd6, 0x0b, 0x0e, 0x95, 0x96, 0xb4, 0xdb, 0x0b, 0x0a, 0xe2, 0x5f, 0x38, 0xbd, 0x8e, 0x87, - 0x6e, 0x4c, 0x0c, 0xc2, 0xfc, 0x16, 0xdc, 0xfa, 0x7f, 0xd3, 0x1a, 0xc5, 0x03, 0x6b, 0x6f, 0x7e, - 0x07, 0xf0, 0xfc, 0xaa, 0xb8, 0x28, 0x95, 0x31, 0xa4, 0x65, 0xac, 0x55, 0xb6, 0x29, 0x14, 0x26, - 0x6b, 0x27, 0x4a, 0x65, 0x32, 0x54, 0x1b, 0x36, 0x7c, 0x52, 0xc8, 0x96, 0xca, 0x8f, 0x94, 0x8e, - 0x32, 0x83, 0x3a, 0x4a, 0x32, 0x28, 0x55, 0x0d, 0x7e, 0x5f, 0x8e, 0xd4, 0xcc, 0x65, 0xc9, 0x35, - 0x11, 0x2d, 0xe9, 0xac, 0x23, 0xad, 0x7c, 0xb7, 0x5c, 0xa9, 0xa0, 0x05, 0x71, 0x86, 0x54, 0x3c, - 0xf2, 0x83, 0x81, 0xb3, 0x86, 0x59, 0x62, 0xd7, 0x9f, 0x54, 0x1a, 0x9b, 0x6c, 0x3f, 0x9e, 0x43, - 0x15, 0xa9, 0x72, 0xbc, 0xa8, 0x93, 0x8b, 0x06, 0x7e, 0x34, 0x87, 0xef, 0xe6, 0x2f, 0x99, 0xf3, - 0x0e, 0xbc, 0x26, 0x30, 0xba, 0x44, 0x61, 0xb7, 0x51, 0x7d, 0x82, 0x5f, 0x47, 0x6b, 0x17, 0x6b, - 0x5e, 0xb5, 0x4d, 0x5f, 0xc4, 0xea, 0xd1, 0xe2, 0x5a, 0x69, 0xec, 0x54, 0x9b, 0x64, 0x56, 0x5b, - 0x44, 0xff, 0x90, 0xa4, 0xfe, 0x68, 0xb6, 0x56, 0x83, 0x2c, 0xe1, 0xfa, 0x42, 0x8d, 0xa4, 0x13, - 0xc5, 0xb2, 0xf5, 0x94, 0x5f, 0x26, 0x47, 0x00, 0x68, 0x73, 0xdc, 0xeb, 0xed, 0x51, 0xe4, 0xc4, - 0x04, 0x5a, 0x34, 0x6b, 0x02, 0x6b, 0x7a, 0x22, 0xb0, 0x86, 0x58, 0xc0, 0xfa, 0xe8, 0xc8, 0x19, - 0x7e, 0x4a, 0xc6, 0xad, 0xe9, 0x84, 0x6e, 0xd2, 0xed, 0x8d, 0x07, 0x3f, 0x49, 0x80, 0xb0, 0x6c, - 0xe4, 0x3e, 0xb3, 0xea, 0xf4, 0x7b, 0x81, 0xe2, 0x83, 0xa6, 0xb1, 0xed, 0x1c, 0x8c, 0x4e, 0x9b, - 0x84, 0xf9, 0xb9, 0xf4, 0xa4, 0xcf, 0xb1, 0x30, 0xfb, 0xff, 0x19, 0xca, 0x2e, 0x63, 0x58, 0xde, - 0x84, 0x29, 0x9b, 0x48, 0x81, 0x87, 0x80, 0x5e, 0xf9, 0x21, 0xa3, 0xe1, 0x2c, 0xdc, 0xcd, 0x15, - 0xb6, 0x02, 0x6a, 0x0c, 0xc1, 0x5e, 0xbd, 0xf7, 0x8a, 0xa7, 0x7c, 0xa5, 0xc8, 0xfb, 0xcb, 0x45, - 0x05, 0x1b, 0xee, 0x90, 0xf1, 0xfb, 0xc7, 0x8f, 0x26, 0x6f, 0xc6, 0x7c, 0xe2, 0x8c, 0x79, 0xa1, - 0xfe, 0xc5, 0xfa, 0x7f, 0x0c, 0x41, 0x29, 0xb9, 0x89, 0xc6, 0xa7, 0x15, 0x31, 0xaf, 0x5f, 0x9d, - 0xb0, 0x4a, 0xe7, 0x41, 0xf1, 0x6c, 0x5d, 0x8b, 0x46, 0x79, 0xe1, 0xe7, 0x31, 0x48, 0xec, 0x14, - 0x16, 0x4e, 0xfb, 0x53, 0x63, 0xc8, 0xc8, 0x00, 0x84, 0x71, 0x79, 0x51, 0xd4, 0x9a, 0xf9, 0x9a, - 0x7c, 0xdd, 0xbd, 0x80, 0xa1, 0xc4, 0x6e, 0x5b, 0xce, 0x08, 0x39, 0x34, 0x8a, 0x99, 0x90, 0x00, - 0x05, 0xd6, 0x5f, 0x46, 0xa0, 0xc7, 0x68, 0x6f, 0x46, 0xef, 0x8b, 0x41, 0xcf, 0x37, 0xa3, 0x57, - 0xf0, 0x76, 0xf1, 0x94, 0x61, 0x8a, 0x12, 0x30, 0x9e, 0x8a, 0xd9, 0x9f, 0x14, 0x48, 0xfc, 0xc0, - 0xb0, 0xf9, 0xf1, 0x24, 0xf8, 0x4b, 0x65, 0x64, 0x7a, 0x26, 0x1c, 0x46, 0x74, 0xdf, 0xd3, 0x5f, - 0x73, 0xdf, 0x7f, 0x4b, 0x46, 0x48, 0x4d, 0xfe, 0xb8, 0xde, 0xcb, 0x9f, 0xe8, 0x24, 0x62, 0x9a, - 0x3e, 0xc6, 0x10, 0xff, 0x43, 0x2a, 0xbc, 0x2f, 0xdc, 0xdc, 0xaf, 0xb0, 0xbc, 0x8d, 0xcc, 0x3b, - 0x8b, 0xde, 0x76, 0xbb, 0xd7, 0x93, 0x8f, 0x8a, 0x55, 0xb4, 0x8e, 0x6f, 0x89, 0x73, 0x52, 0x2c, - 0xd7, 0x15, 0x7c, 0xdc, 0x56, 0x71, 0xf2, 0x88, 0x45, 0xfe, 0x59, 0xd8, 0x47, 0x82, 0x8a, 0x7f, - 0xd1, 0xbc, 0x80, 0x63, 0xed, 0x81, 0x28, 0x34, 0x1a, 0x4b, 0x3b, 0x0b, 0x45, 0xc2, 0x45, 0x46, - 0x44, 0x97, 0xa6, 0xd5, 0xfb, 0x12, 0x6a, 0xeb, 0xf5, 0x0f, 0xb9, 0x38, 0xa3, 0x8b, 0xb1, 0xb1, - 0x2e, 0xc6, 0x23, 0x4f, 0x5b, 0x7f, 0x92, 0x09, 0x14, 0xe8, 0x14, 0xb0, 0x01, 0xbd, 0x23, 0xcc, - 0x50, 0x30, 0x09, 0xaf, 0x1f, 0x94, 0x5e, 0x35, 0x93, 0xa8, 0x57, 0xcd, 0x86, 0xde, 0xf8, 0x04, - 0x5e, 0x07, 0x33, 0x21, 0x7d, 0xeb, 0x6c, 0xdc, 0xc8, 0x36, 0x97, 0x64, 0x64, 0x9b, 0xa7, 0xc2, - 0x3b, 0xc1, 0x6d, 0x59, 0xa0, 0xed, 0x5b, 0x2d, 0x46, 0x27, 0x2d, 0xaf, 0x47, 0xfe, 0xbe, 0x58, - 0x24, 0x61, 0x80, 0xa4, 0x46, 0x0c, 0x84, 0x18, 0x76, 0xd6, 0xd7, 0xcd, 0xab, 0xba, 0x11, 0x4a, - 0xc6, 0x8a, 0x95, 0x59, 0x54, 0x08, 0xc6, 0xed, 0xc3, 0x7a, 0xd0, 0x21, 0xba, 0xdd, 0xe3, 0x00, - 0x89, 0x85, 0x4f, 0xf4, 0xbd, 0x3b, 0x83, 0x03, 0x88, 0x76, 0xdc, 0x00, 0x96, 0x58, 0x3a, 0xdc, - 0x16, 0x6a, 0x42, 0x18, 0x1f, 0x4d, 0x1a, 0x44, 0x8a, 0x61, 0x36, 0x05, 0xbe, 0xd1, 0x26, 0xf2, - 0xa0, 0x19, 0x56, 0x74, 0x9d, 0xa1, 0x04, 0xcb, 0x5f, 0x4c, 0x07, 0xda, 0x21, 0x5a, 0x56, 0x69, - 0xdc, 0x75, 0x47, 0xc9, 0xe7, 0x77, 0x0f, 0xd5, 0x43, 0x23, 0xc3, 0x7d, 0x39, 0xb2, 0x23, 0xaa, - 0x6b, 0x91, 0x34, 0xe9, 0x85, 0x3f, 0x48, 0x89, 0x19, 0xd6, 0xa9, 0xc3, 0xba, 0xa4, 0xd4, 0x45, - 0x71, 0x78, 0x43, 0xf3, 0x64, 0x71, 0x31, 0xad, 0x50, 0x49, 0xbb, 0x63, 0x3c, 0xbe, 0xb8, 0x26, - 0x2e, 0x1a, 0xf3, 0x96, 0x1e, 0xd0, 0xde, 0x30, 0xf0, 0x74, 0x36, 0x6a, 0x47, 0xed, 0xe1, 0xa1, - 0x33, 0x92, 0x00, 0x82, 0x8f, 0x24, 0x55, 0xb0, 0x73, 0x72, 0x15, 0xb6, 0xdb, 0x52, 0xdc, 0x8c, - 0xd7, 0xec, 0xf3, 0x83, 0x3f, 0xeb, 0x3f, 0x4f, 0x07, 0xb8, 0xa3, 0xc4, 0xe3, 0xd2, 0xaa, 0xf8, - 0xbc, 0xfc, 0x23, 0x77, 0xe0, 0x4f, 0x72, 0xfa, 0x29, 0x03, 0x33, 0x1f, 0xb4, 0x92, 0x9b, 0x13, - 0xa8, 0xf9, 0x26, 0x8f, 0x56, 0x0c, 0x7e, 0xe2, 0x20, 0x26, 0xcc, 0x65, 0xce, 0x3e, 0x48, 0x00, - 0x10, 0x85, 0xb7, 0x84, 0x30, 0x86, 0x4c, 0xbc, 0x82, 0x04, 0x4c, 0x6c, 0xf8, 0xd8, 0x0e, 0x01, - 0x53, 0xbc, 0xf5, 0x57, 0x03, 0xa5, 0xe3, 0x00, 0xc1, 0xd1, 0x2c, 0xd9, 0x87, 0x23, 0xd1, 0x0e, - 0xf5, 0x63, 0xb0, 0xe5, 0x5b, 0x7f, 0x9a, 0x0e, 0xac, 0x43, 0xa1, 0xef, 0x05, 0xd2, 0x59, 0x64, - 0x39, 0x0f, 0xc4, 0xac, 0x33, 0x1c, 0x7a, 0x92, 0x5a, 0x9a, 0x86, 0xd3, 0x84, 0xfe, 0xc5, 0x4a, - 0x05, 0xdb, 0x92, 0x99, 0x82, 0xff, 0x84, 0x2b, 0xbe, 0x68, 0x28, 0xca, 0xbe, 0x8a, 0x67, 0x48, - 0xcc, 0x13, 0x24, 0x13, 0x71, 0x16, 0x39, 0xb3, 0x67, 0x48, 0xd4, 0x15, 0x64, 0x0e, 0x45, 0x11, - 0x25, 0xfb, 0x68, 0xa1, 0x86, 0x9c, 0xa4, 0x9b, 0xb9, 0xf9, 0x09, 0xde, 0x1a, 0x0b, 0xd6, 0x41, - 0x00, 0xeb, 0x8c, 0xcc, 0x9c, 0x91, 0x04, 0x30, 0x10, 0xcc, 0x4d, 0x63, 0x63, 0x64, 0x0b, 0x31, - 0x30, 0x3b, 0x5d, 0xb4, 0x78, 0x20, 0x6b, 0x44, 0x5e, 0x5c, 0x15, 0xa0, 0x2b, 0xeb, 0x37, 0xd2, - 0x1c, 0xba, 0x66, 0xe2, 0x87, 0x34, 0xeb, 0x17, 0x56, 0x14, 0xbe, 0x55, 0x3c, 0x43, 0xaf, 0x62, - 0x25, 0xaa, 0x0c, 0xfe, 0xbd, 0x94, 0x98, 0xab, 0x24, 0xa9, 0x08, 0x41, 0x40, 0x24, 0xbd, 0xa6, - 0x6d, 0x1e, 0x20, 0x1d, 0x18, 0x17, 0x87, 0xe5, 0xa9, 0x34, 0x39, 0x52, 0xaa, 0x0a, 0x56, 0x96, - 0xb2, 0x0f, 0x2c, 0x1c, 0xdc, 0x2b, 0xe2, 0x65, 0xae, 0x9a, 0xb4, 0xeb, 0x59, 0x74, 0x84, 0xe6, - 0x26, 0xec, 0xac, 0x1e, 0x38, 0xa0, 0x93, 0x5d, 0xab, 0x99, 0x9b, 0xb1, 0x76, 0x03, 0x25, 0x32, - 0x2d, 0x90, 0x55, 0xfe, 0x6a, 0x8d, 0x5f, 0x63, 0xfb, 0xad, 0xbf, 0x4b, 0x47, 0x8e, 0x34, 0x32, - 0xa4, 0xdc, 0xe8, 0xa8, 0xf1, 0xe7, 0xcd, 0xe2, 0xe9, 0x9d, 0xe2, 0xfb, 0xfc, 0xff, 0xff, 0xb8, - 0xf6, 0x39, 0xb6, 0x99, 0xca, 0x24, 0xc7, 0x46, 0x36, 0x14, 0xda, 0x2d, 0x71, 0x7d, 0x52, 0x13, - 0xde, 0x5f, 0x7e, 0x78, 0x31, 0xe1, 0x4c, 0x78, 0x1c, 0x34, 0xe8, 0x4d, 0x3a, 0x14, 0xd5, 0x62, - 0xf6, 0xf4, 0x93, 0x9d, 0xb3, 0xea, 0x81, 0x89, 0x9e, 0x71, 0x06, 0x86, 0x66, 0xe8, 0xf1, 0xae, - 0x7d, 0xad, 0x63, 0xfb, 0xa3, 0x54, 0x04, 0x12, 0xc2, 0x23, 0xca, 0x53, 0x2b, 0x47, 0x4e, 0xed, - 0x6e, 0xf1, 0xd4, 0x3e, 0xf1, 0x43, 0xdb, 0xfc, 0xf1, 0x9c, 0x99, 0xf5, 0x2c, 0x32, 0x63, 0x16, - 0x3c, 0xb5, 0x2b, 0xcd, 0xa4, 0x4d, 0x50, 0x58, 0x3e, 0x1d, 0xc7, 0xf2, 0x99, 0x24, 0x2c, 0xcf, - 0x76, 0xcd, 0x3f, 0x4e, 0x45, 0xc0, 0x3a, 0xf2, 0xb5, 0xb3, 0x81, 0x75, 0x62, 0xa7, 0x9f, 0xdc, - 0x0e, 0x81, 0x04, 0x7a, 0x47, 0x7f, 0xbf, 0x8c, 0xb6, 0x53, 0x9e, 0x40, 0x7d, 0xe0, 0xf4, 0x69, - 0x3e, 0x68, 0x95, 0x38, 0x31, 0xb6, 0x4a, 0x6b, 0x6b, 0xf5, 0xd3, 0x5a, 0xbd, 0x79, 0x69, 0xe5, - 0x1e, 0x2a, 0x65, 0x8a, 0x00, 0x82, 0x64, 0x8e, 0x90, 0xe8, 0xcb, 0x60, 0x8e, 0x36, 0xfa, 0x29, - 0x87, 0x86, 0x3f, 0x6d, 0x06, 0x72, 0xfb, 0x80, 0xd1, 0x42, 0xcf, 0x49, 0x7c, 0xaa, 0x8e, 0x2f, - 0xc7, 0xbd, 0x8e, 0xcb, 0x6f, 0x60, 0x53, 0x32, 0x42, 0x7f, 0x64, 0xac, 0x0d, 0x98, 0xf6, 0xd0, - 0x3b, 0xf9, 0xda, 0xcb, 0x01, 0xf9, 0xf8, 0xcd, 0x33, 0x8d, 0xc8, 0xd3, 0xb3, 0xaa, 0xc1, 0xad, - 0xa3, 0x0a, 0x20, 0x07, 0xba, 0xe5, 0x64, 0x80, 0x4b, 0x7a, 0x31, 0x6d, 0xfd, 0xa6, 0x71, 0xdf, - 0x12, 0xc6, 0x3a, 0xf5, 0xbe, 0x4d, 0xec, 0x13, 0x87, 0xa6, 0x7b, 0x5f, 0x09, 0x9a, 0xac, 0xf7, - 0x82, 0x89, 0xa1, 0xce, 0xe6, 0x8c, 0x9b, 0x6b, 0xfd, 0xb6, 0x71, 0x41, 0x92, 0xfa, 0x9d, 0x7a, - 0x41, 0x26, 0x77, 0xfa, 0x91, 0x97, 0xf4, 0x37, 0xa9, 0x40, 0xb1, 0x48, 0xc3, 0xe3, 0x77, 0xe4, - 0x27, 0x0e, 0x60, 0x3a, 0x47, 0x09, 0xa7, 0xf6, 0xb1, 0x58, 0xf2, 0xa0, 0x15, 0x19, 0x30, 0x02, - 0x49, 0xe3, 0x8d, 0xe2, 0xd4, 0x71, 0x8a, 0xba, 0xa0, 0xd0, 0x15, 0x0b, 0xfa, 0x47, 0x02, 0x2c, - 0x26, 0x5f, 0x24, 0x9d, 0x82, 0x27, 0xc1, 0xb9, 0x27, 0xf1, 0x7a, 0x15, 0x02, 0xc3, 0x9d, 0x3c, - 0x1a, 0x9a, 0x17, 0x79, 0x9c, 0xfd, 0x67, 0xa9, 0x40, 0xfb, 0x63, 0x10, 0x55, 0xf2, 0x2a, 0x03, - 0xf1, 0x83, 0xad, 0x4c, 0x5d, 0x34, 0x33, 0xd1, 0xd2, 0x83, 0xb8, 0xb3, 0x91, 0x3b, 0xaf, 0x23, - 0xa7, 0x1a, 0x16, 0x37, 0x7c, 0xfc, 0x4b, 0x65, 0x81, 0xf7, 0xbe, 0xc2, 0xab, 0x33, 0xca, 0x67, - 0x54, 0xba, 0x95, 0x48, 0x81, 0x47, 0x5b, 0x91, 0x87, 0xa6, 0x61, 0x2d, 0xaa, 0xa3, 0x20, 0x33, - 0x9a, 0xf5, 0x49, 0x84, 0x83, 0x67, 0x9c, 0xa1, 0x6c, 0x85, 0x86, 0x84, 0x9b, 0x52, 0xea, 0xd8, - 0xc8, 0xbd, 0xfe, 0x38, 0xd0, 0xb2, 0xd2, 0x00, 0xe8, 0x67, 0xc9, 0x0e, 0xa7, 0x67, 0xa2, 0x0a, - 0xd6, 0x7f, 0x15, 0x05, 0x98, 0x60, 0x80, 0x89, 0x5c, 0x7d, 0xe0, 0x41, 0x90, 0x8e, 0x78, 0x10, - 0x24, 0x8e, 0x10, 0x07, 0xea, 0xef, 0x4e, 0x00, 0x6a, 0x64, 0xda, 0x43, 0x88, 0x3d, 0x35, 0x81, - 0x9d, 0x9e, 0xe8, 0x24, 0xf2, 0x8a, 0xe9, 0x01, 0x89, 0x21, 0x36, 0x80, 0xf6, 0x48, 0x0f, 0x75, - 0xe5, 0xe3, 0xf6, 0xa7, 0xa9, 0x00, 0xb7, 0xc5, 0xdb, 0xe8, 0x34, 0x25, 0xd7, 0x51, 0x57, 0xa9, - 0xc3, 0x22, 0x0d, 0xb9, 0xa1, 0xe1, 0xef, 0x9e, 0x52, 0x51, 0x07, 0xb1, 0x9d, 0x0e, 0x93, 0x14, - 0x6f, 0x97, 0x56, 0x0f, 0x12, 0x12, 0xc7, 0xa3, 0xf7, 0xc4, 0x12, 0xec, 0x65, 0x9b, 0xd8, 0x58, - 0xdc, 0x86, 0x55, 0x7d, 0x3f, 0x1b, 0xc0, 0x4b, 0x73, 0xbc, 0x7f, 0xec, 0x8e, 0x38, 0x00, 0x01, - 0xaf, 0x23, 0x99, 0xeb, 0xd1, 0x76, 0x32, 0x1e, 0xcf, 0x3e, 0xe8, 0xb5, 0x0f, 0xfd, 0x20, 0x86, - 0x0f, 0x26, 0x89, 0x43, 0x61, 0x93, 0x7c, 0xe6, 0x2c, 0x27, 0x40, 0x6d, 0xf1, 0xf1, 0xf5, 0xee, - 0x7c, 0xe5, 0xef, 0x84, 0x4d, 0x8a, 0x18, 0x5e, 0xfb, 0xa5, 0xf0, 0x11, 0x90, 0xb6, 0x50, 0xb3, - 0x32, 0x93, 0xc7, 0xc7, 0x8c, 0x4c, 0xd7, 0x92, 0xbb, 0x9e, 0x3e, 0x37, 0xce, 0x46, 0xd0, 0x65, - 0x51, 0x3d, 0x14, 0x04, 0x94, 0x53, 0x5c, 0x75, 0x8e, 0x30, 0x7a, 0x84, 0xa1, 0x42, 0x0c, 0xe2, - 0x1a, 0xf7, 0x4e, 0x42, 0x61, 0x2e, 0xf1, 0x11, 0x8b, 0x37, 0x3c, 0x74, 0x9f, 0x07, 0x1d, 0xd8, - 0xe8, 0xf1, 0x79, 0xb0, 0x7f, 0xe8, 0x4d, 0xe3, 0x74, 0x31, 0x92, 0xf7, 0x4e, 0xf0, 0x0c, 0xe5, - 0xb3, 0xb1, 0x33, 0x76, 0x22, 0x59, 0xe7, 0x52, 0x67, 0xc8, 0x3a, 0x67, 0xdd, 0x8f, 0xa1, 0x3f, - 0x15, 0xbf, 0xde, 0x9f, 0x14, 0x32, 0xf5, 0xbb, 0x26, 0x9c, 0x87, 0xbb, 0x98, 0x97, 0x3b, 0xa2, - 0x8b, 0xb6, 0x84, 0xd0, 0xf1, 0xf4, 0x15, 0x2d, 0x58, 0xe1, 0x0c, 0x6c, 0xaa, 0x3b, 0x72, 0x5b, - 0xf4, 0x06, 0xfd, 0x73, 0x9c, 0x31, 0xc5, 0xd0, 0x8f, 0xe7, 0x8b, 0x09, 0x22, 0x8a, 0x26, 0x05, - 0xe4, 0x03, 0xf6, 0xe7, 0x85, 0x8c, 0xef, 0x15, 0xea, 0x95, 0x51, 0x66, 0xa0, 0x48, 0x8e, 0xb4, - 0x73, 0xe8, 0x59, 0xce, 0x8a, 0xd8, 0x19, 0x7a, 0xe3, 0x75, 0x49, 0xa6, 0x9b, 0x21, 0x3e, 0x5c, - 0xcf, 0xc3, 0xfa, 0x0b, 0x99, 0x90, 0x50, 0x97, 0xe8, 0x95, 0x7e, 0x2a, 0xce, 0xf3, 0x17, 0xc9, - 0xd4, 0x9e, 0xe0, 0x01, 0x15, 0xeb, 0x52, 0x34, 0x4b, 0x08, 0x7f, 0xed, 0xf2, 0xb3, 0x3f, 0x0a, - 0x6e, 0x44, 0xd9, 0xab, 0x30, 0x8b, 0xc8, 0x80, 0x72, 0x60, 0xd8, 0xed, 0x6e, 0x77, 0x28, 0x17, - 0x77, 0x5d, 0x5c, 0x36, 0xaa, 0xa5, 0xad, 0x9e, 0xea, 0x35, 0x54, 0x19, 0xf5, 0x18, 0xc1, 0x2e, - 0xab, 0x1c, 0x33, 0x68, 0x72, 0x91, 0x3d, 0x99, 0xa1, 0x3d, 0x99, 0xb4, 0x63, 0xb3, 0x54, 0xfb, - 0xaa, 0x78, 0x89, 0x6b, 0x61, 0xc4, 0x71, 0xdf, 0xfd, 0x82, 0xf2, 0x5a, 0x00, 0x55, 0x1d, 0x05, - 0xef, 0x2b, 0x66, 0xad, 0x3f, 0x48, 0x89, 0x73, 0x91, 0x35, 0x21, 0xfe, 0x95, 0xab, 0x02, 0xfc, - 0xbb, 0x20, 0x66, 0x48, 0xd0, 0x63, 0xbc, 0x8b, 0x2f, 0x0a, 0x9b, 0x95, 0xc6, 0x93, 0x4a, 0xa3, - 0x56, 0x6f, 0x29, 0x03, 0x2f, 0x69, 0x64, 0x02, 0x7f, 0xd0, 0x0c, 0x6a, 0x51, 0xca, 0xa5, 0x5a, - 0xb9, 0xb2, 0x8d, 0x78, 0x39, 0xcb, 0xcf, 0x72, 0xf1, 0xbd, 0x61, 0xa9, 0x55, 0x7d, 0x88, 0x2e, - 0x9a, 0xfc, 0x0c, 0x71, 0x86, 0x5e, 0x43, 0x22, 0x56, 0xaf, 0x6d, 0xf1, 0x33, 0xe9, 0xe6, 0xde, - 0xc3, 0x66, 0xb9, 0x51, 0xdd, 0x25, 0x0f, 0x40, 0xcc, 0xa9, 0xb0, 0x4c, 0x2f, 0x1e, 0xf5, 0xa7, - 0xe6, 0xac, 0x8f, 0xd8, 0xd2, 0x45, 0x7c, 0xc5, 0x36, 0xdd, 0x5b, 0x3d, 0xf9, 0x5d, 0xb8, 0x55, - 0x83, 0xd1, 0xd4, 0x0d, 0x03, 0xce, 0xe9, 0x2a, 0xa7, 0x6a, 0xa2, 0x7b, 0x15, 0x17, 0x96, 0x42, - 0xc1, 0x69, 0xb2, 0x08, 0xd3, 0x85, 0xa4, 0xf6, 0x12, 0x7c, 0x56, 0x42, 0xdc, 0x1c, 0x46, 0xdf, - 0x98, 0x09, 0x52, 0x6a, 0xc5, 0xa3, 0x39, 0x3c, 0x10, 0x59, 0x8c, 0x98, 0x27, 0xcd, 0x59, 0x1c, - 0xbf, 0x86, 0x6a, 0x9e, 0x40, 0xe9, 0xfa, 0xa5, 0xd0, 0x4f, 0x95, 0xc7, 0xd1, 0x7a, 0x9f, 0xf9, - 0xd1, 0x26, 0xad, 0x46, 0xe7, 0xfe, 0x8a, 0xcc, 0x3c, 0x21, 0x04, 0x4f, 0x85, 0x91, 0x0e, 0xf2, - 0xf5, 0xdc, 0x37, 0x71, 0x05, 0xa7, 0x45, 0xa0, 0xb0, 0xbe, 0x08, 0x5c, 0x0f, 0x23, 0x2e, 0xf0, - 0x49, 0x1a, 0x58, 0x42, 0xf4, 0x1c, 0x20, 0xa3, 0x1f, 0xe4, 0x07, 0xb9, 0xa7, 0x23, 0xd2, 0xa9, - 0x95, 0x57, 0x38, 0xcf, 0x5b, 0x85, 0x4a, 0xd7, 0x97, 0x9f, 0xd9, 0x00, 0x53, 0x36, 0x97, 0xdd, - 0xb7, 0xfe, 0x7c, 0x36, 0x60, 0xdc, 0xa2, 0x7e, 0xed, 0xd1, 0x1d, 0x7f, 0x5f, 0x1e, 0xb6, 0x9a, - 0x09, 0xe3, 0x15, 0xb9, 0xff, 0x57, 0x8b, 0xe5, 0x66, 0x5d, 0x65, 0x36, 0x92, 0xca, 0x14, 0xf6, - 0xd7, 0x02, 0x12, 0xbd, 0xd2, 0x83, 0x0b, 0xa8, 0x22, 0xc5, 0x38, 0x4a, 0xd1, 0x1b, 0x3f, 0xb2, - 0x59, 0x0c, 0xfb, 0xe2, 0x70, 0xc6, 0xad, 0x45, 0x43, 0x57, 0x19, 0x99, 0x19, 0x07, 0x0b, 0xea, - 0x62, 0xc8, 0xc2, 0x68, 0xec, 0xb3, 0x19, 0xed, 0x96, 0x15, 0x89, 0x90, 0x63, 0x3a, 0x13, 0xcf, - 0x85, 0x1a, 0x19, 0xe6, 0x92, 0x6f, 0x03, 0x1e, 0x3f, 0xf2, 0x5e, 0x74, 0x50, 0x4a, 0xc7, 0xa9, - 0x90, 0xeb, 0xc6, 0xe2, 0xda, 0x6b, 0x13, 0x27, 0xd2, 0x94, 0xad, 0x69, 0x2a, 0xeb, 0x14, 0x74, - 0x0e, 0x83, 0xbb, 0xa0, 0xbf, 0x90, 0xa3, 0x6c, 0x28, 0x93, 0x97, 0xc1, 0xc1, 0x84, 0x76, 0xa1, - 0x71, 0xfe, 0x5b, 0x62, 0x99, 0xcd, 0x05, 0x23, 0x8a, 0x60, 0x8a, 0x09, 0xa7, 0x32, 0xa1, 0xf0, - 0x5d, 0xd1, 0xbe, 0x14, 0xa5, 0x91, 0xc3, 0x9d, 0x9a, 0x1e, 0x8a, 0x4b, 0xd1, 0x10, 0xcb, 0x84, - 0xdd, 0xd8, 0x59, 0xeb, 0x23, 0xa0, 0xa5, 0x0e, 0xe5, 0x4c, 0x01, 0x56, 0x92, 0xe2, 0x1a, 0xad, - 0xd0, 0x47, 0x26, 0x2f, 0x6f, 0x53, 0x36, 0xaf, 0x42, 0x6b, 0x24, 0xb9, 0x6d, 0xce, 0x3a, 0x86, - 0xa1, 0xef, 0x3a, 0x8e, 0x4c, 0x4f, 0xb9, 0x5c, 0x78, 0x53, 0x08, 0xe3, 0x40, 0x62, 0x89, 0x00, - 0xd5, 0x7b, 0x59, 0xd6, 0xbf, 0xbf, 0x2b, 0x96, 0x42, 0x9b, 0x16, 0x6b, 0x0e, 0x07, 0xea, 0xed, - 0x7f, 0xdf, 0xe9, 0xc8, 0x18, 0x28, 0x48, 0xff, 0x96, 0x0a, 0x40, 0xaf, 0x8d, 0xcd, 0x4a, 0x88, - 0xbe, 0x84, 0x61, 0x53, 0x30, 0x54, 0x61, 0xd7, 0x39, 0x90, 0x1f, 0xba, 0x21, 0x16, 0xcd, 0x3d, - 0x32, 0xbd, 0xe0, 0xa8, 0x4b, 0xe1, 0x91, 0x58, 0x0a, 0xad, 0x0f, 0xc5, 0x08, 0x1c, 0xc2, 0x8c, - 0x56, 0x1e, 0x9e, 0x09, 0x66, 0xa7, 0xc1, 0x10, 0x5a, 0x3d, 0x4f, 0x99, 0x75, 0xb4, 0x41, 0x29, - 0x7a, 0x71, 0xf9, 0xab, 0x7e, 0xec, 0x0e, 0x85, 0x2f, 0x32, 0x53, 0xab, 0x0f, 0xa3, 0x70, 0x93, - 0x89, 0x58, 0x3a, 0xc3, 0x63, 0x9a, 0x60, 0xb3, 0x1e, 0x05, 0x9b, 0x09, 0x37, 0x47, 0x75, 0x35, - 0x76, 0xe4, 0x27, 0xb1, 0xa7, 0x20, 0xd0, 0x47, 0x12, 0x45, 0x6e, 0x39, 0xa3, 0xc8, 0x8e, 0x24, - 0x25, 0x54, 0x79, 0x5b, 0x51, 0x8a, 0xe6, 0x28, 0xfe, 0x66, 0x28, 0xa9, 0xc3, 0x03, 0x46, 0xd4, - 0x89, 0x1d, 0x26, 0xe1, 0x2f, 0xeb, 0xb5, 0x40, 0x2f, 0x4f, 0xc9, 0x53, 0x6a, 0xde, 0xc8, 0x3d, - 0x38, 0x69, 0x8e, 0xc9, 0x3b, 0xf6, 0x60, 0xdc, 0x63, 0x6e, 0xd6, 0xfa, 0x9f, 0xe7, 0xc4, 0x39, - 0xd5, 0xee, 0x73, 0xf6, 0xd8, 0x8a, 0xa4, 0x95, 0x20, 0xbf, 0x69, 0x3a, 0xfb, 0x79, 0x64, 0x35, - 0x8c, 0x1a, 0x23, 0x32, 0x1d, 0xb1, 0x14, 0xe4, 0x0f, 0x86, 0xf6, 0x3b, 0x87, 0x6e, 0x9c, 0x0d, - 0xb7, 0xf2, 0x48, 0xda, 0xeb, 0x6e, 0x88, 0x2b, 0x28, 0x79, 0xf3, 0xeb, 0xe7, 0x0e, 0x4e, 0xb8, - 0x33, 0x46, 0xa9, 0xa3, 0x77, 0x22, 0xa5, 0xd8, 0xd7, 0xc4, 0xcb, 0x1c, 0x0b, 0xfc, 0xc1, 0xb0, - 0x2b, 0x7d, 0x1b, 0x99, 0xee, 0x1c, 0x71, 0x68, 0x2e, 0xf9, 0x1c, 0xfd, 0x13, 0x71, 0x11, 0x2b, - 0x4d, 0x1f, 0x51, 0x1d, 0xeb, 0x6b, 0x65, 0xed, 0x42, 0x71, 0x97, 0x2b, 0x25, 0x4a, 0x26, 0xee, - 0x76, 0x09, 0xe3, 0x36, 0xd4, 0x2a, 0x0d, 0x8e, 0xdb, 0x76, 0x53, 0xac, 0x92, 0x0e, 0xb2, 0x6b, - 0xbf, 0xf0, 0x86, 0x9c, 0x81, 0x91, 0xff, 0xd2, 0xae, 0x6b, 0x98, 0x26, 0x28, 0xf2, 0x09, 0x8e, - 0xfe, 0xba, 0x18, 0x4a, 0x39, 0x4b, 0x8a, 0x04, 0xf9, 0xc2, 0x7b, 0x49, 0x71, 0xe9, 0x54, 0x03, - 0xcc, 0x3e, 0x72, 0x5f, 0xb0, 0xcd, 0x32, 0x74, 0x16, 0x70, 0x4b, 0xfe, 0xd1, 0x78, 0xd4, 0xf5, - 0x5e, 0xf4, 0x7b, 0xed, 0x17, 0xb0, 0x5b, 0xb0, 0xa1, 0x30, 0x20, 0xfc, 0x3b, 0xc6, 0x28, 0xb7, - 0xec, 0x23, 0x9a, 0x34, 0x31, 0xc5, 0xc4, 0xe6, 0xd4, 0xf8, 0xca, 0xc3, 0x54, 0x72, 0x79, 0xe4, - 0x32, 0x4a, 0x9a, 0x05, 0x7e, 0x95, 0xde, 0x39, 0x91, 0xd1, 0xb1, 0xe0, 0x76, 0xc3, 0x60, 0x87, - 0x76, 0xdf, 0x0b, 0xde, 0xb1, 0x03, 0xae, 0x1f, 0xf7, 0xb4, 0x91, 0x55, 0x39, 0xd0, 0x7a, 0x43, - 0x17, 0x28, 0x25, 0x39, 0x82, 0x52, 0xba, 0x2d, 0x8c, 0xd5, 0x0b, 0x02, 0x88, 0x0b, 0x92, 0xe1, - 0xb8, 0xdf, 0xf3, 0x3a, 0xcf, 0x38, 0xf5, 0x5d, 0x16, 0x4f, 0xf0, 0xb0, 0x63, 0xfb, 0x5e, 0x07, - 0xe4, 0x16, 0xc7, 0xa6, 0x59, 0xa8, 0xe9, 0x5d, 0x96, 0x29, 0x69, 0x2e, 0x42, 0xfb, 0x76, 0xcf, - 0xfd, 0x01, 0x3f, 0xff, 0xef, 0xba, 0xe8, 0x73, 0x8b, 0x5e, 0xa1, 0xe1, 0x4b, 0x2a, 0xa1, 0xac, - 0xb8, 0x6d, 0x34, 0xde, 0xa0, 0xb6, 0x08, 0x04, 0xae, 0x8f, 0xf8, 0xf6, 0x00, 0xf1, 0x10, 0xec, - 0x03, 0xea, 0x41, 0x70, 0xb2, 0xf2, 0x20, 0x28, 0x84, 0x00, 0x42, 0x21, 0x27, 0x47, 0x76, 0x6c, - 0xba, 0x90, 0xfe, 0xea, 0x55, 0xb2, 0xf6, 0xcd, 0x15, 0x2b, 0x1c, 0xcd, 0x77, 0x4d, 0xac, 0x38, - 0x5f, 0x8e, 0x86, 0x6d, 0xe5, 0x7a, 0xe8, 0xaf, 0x16, 0x54, 0x06, 0xdf, 0xc8, 0x1c, 0xca, 0x15, - 0x6c, 0x07, 0x85, 0x08, 0xd9, 0xc7, 0x18, 0x6e, 0x0f, 0xd6, 0x3d, 0x74, 0x3a, 0x74, 0xcd, 0x25, - 0x7a, 0xc4, 0x68, 0xa4, 0xd9, 0xc2, 0xaf, 0xa4, 0x44, 0x3e, 0x61, 0xc6, 0x24, 0xd1, 0xf6, 0xc9, - 0x47, 0x9a, 0x55, 0x26, 0x0f, 0x44, 0x01, 0x38, 0x12, 0x38, 0xbd, 0xa3, 0x20, 0x47, 0x14, 0x6d, - 0x96, 0x7f, 0xd4, 0xbe, 0x2f, 0xb9, 0x87, 0x73, 0x34, 0x8f, 0xe6, 0xa3, 0xd2, 0x7d, 0x39, 0xca, - 0x9a, 0xb8, 0x2a, 0xc5, 0x96, 0x84, 0x3e, 0x99, 0xc4, 0x3e, 0x85, 0x3b, 0xc0, 0x08, 0xeb, 0xd9, - 0x0b, 0x1d, 0x93, 0x8b, 0x10, 0x19, 0x4d, 0x09, 0x37, 0x86, 0xb0, 0xb8, 0xf5, 0x18, 0x84, 0xb9, - 0x80, 0x5d, 0x41, 0x42, 0xb4, 0xd9, 0x7e, 0x8e, 0x89, 0xe0, 0x40, 0x98, 0x5b, 0x8d, 0xe3, 0x1b, - 0x9d, 0x95, 0x28, 0x1c, 0x97, 0x8e, 0x8b, 0xad, 0x37, 0x03, 0xc9, 0x30, 0x34, 0x52, 0xa9, 0xdb, - 0x8d, 0x91, 0x37, 0xab, 0x18, 0x08, 0xde, 0xa1, 0xc6, 0x0d, 0xe7, 0xd8, 0x7b, 0xee, 0xc4, 0xdb, - 0xbf, 0xcd, 0x62, 0x56, 0xd3, 0x19, 0x85, 0xc8, 0x26, 0xdc, 0xb9, 0x10, 0xa7, 0x12, 0x74, 0x78, - 0x47, 0xe6, 0x11, 0x77, 0x46, 0x26, 0x75, 0xf3, 0x39, 0xe0, 0xab, 0x41, 0xfd, 0xb9, 0x07, 0x72, - 0xaf, 0x3f, 0x15, 0xb8, 0x43, 0x84, 0xbb, 0x24, 0x71, 0x9d, 0x49, 0xc3, 0xa4, 0x29, 0x20, 0x60, - 0x84, 0x5c, 0x22, 0x11, 0x5b, 0xb2, 0xae, 0xf0, 0xd8, 0x12, 0x35, 0x33, 0xbd, 0xc1, 0x58, 0x9c, - 0xd6, 0x7f, 0x8d, 0x81, 0x1c, 0x36, 0x4e, 0x00, 0x6f, 0xba, 0x1d, 0x2e, 0x56, 0x71, 0x47, 0x13, - 0x02, 0x2b, 0x06, 0x09, 0x74, 0xcd, 0xc8, 0x95, 0x18, 0x35, 0x7b, 0xe8, 0xfe, 0x00, 0xee, 0xbe, - 0xe7, 0xa1, 0x87, 0x96, 0xd2, 0x5e, 0xc2, 0x14, 0x91, 0xfb, 0xe9, 0xe1, 0x75, 0x50, 0x1c, 0x27, - 0x23, 0x63, 0x10, 0xe1, 0x5c, 0xca, 0xca, 0xaf, 0x2e, 0x34, 0x8b, 0x8e, 0x32, 0xcb, 0x42, 0xf8, - 0xae, 0x87, 0x33, 0xe3, 0x59, 0xa2, 0x60, 0xd4, 0x49, 0x68, 0xd2, 0x6d, 0xd8, 0x9b, 0xe2, 0x3f, - 0xcd, 0x88, 0xf3, 0x65, 0x8c, 0x03, 0x7a, 0xda, 0x8a, 0xc2, 0x4e, 0x41, 0x11, 0x65, 0x6b, 0x46, - 0x15, 0x4a, 0xc3, 0x50, 0x5f, 0xa5, 0x7c, 0x26, 0x0d, 0x26, 0x6e, 0x39, 0xd0, 0x63, 0x93, 0xd9, - 0x95, 0xaf, 0xc6, 0x75, 0x20, 0x48, 0x45, 0xb3, 0x25, 0x8b, 0x32, 0xa7, 0xa8, 0xcd, 0xd1, 0xb8, - 0x8b, 0xc1, 0xd6, 0xfb, 0x76, 0xa4, 0xc1, 0xbc, 0x12, 0x7d, 0x31, 0x1f, 0x28, 0xa5, 0xeb, 0x06, - 0xb1, 0xd5, 0xe9, 0xf3, 0x27, 0x16, 0x94, 0x23, 0x1c, 0x59, 0xae, 0x82, 0xed, 0x96, 0x2f, 0x09, - 0x90, 0x45, 0xc0, 0x3c, 0x90, 0xdf, 0xf7, 0x86, 0x41, 0x8a, 0x54, 0xca, 0x49, 0x0e, 0x18, 0x1b, - 0x68, 0xe0, 0x92, 0x5a, 0xef, 0xc8, 0x85, 0x5f, 0xcb, 0x4a, 0xf8, 0x6e, 0x63, 0x76, 0x9b, 0xb1, - 0xd6, 0x96, 0xac, 0x28, 0xcf, 0x0b, 0x6f, 0x78, 0xd8, 0xee, 0xc3, 0x27, 0x86, 0x32, 0x6e, 0x89, - 0x8e, 0x57, 0x8a, 0x3a, 0x59, 0x89, 0xf3, 0x91, 0xe9, 0xe8, 0x77, 0xb9, 0xe4, 0xbc, 0x0e, 0xf8, - 0x0e, 0x78, 0x68, 0xa4, 0x52, 0x4e, 0xd1, 0x7c, 0x75, 0x08, 0x5d, 0xdb, 0xa5, 0x30, 0xcb, 0x17, - 0xd4, 0x0e, 0xfa, 0x5f, 0x8c, 0xd1, 0xb1, 0x9f, 0x4b, 0x2f, 0x92, 0xce, 0xcd, 0x17, 0x8b, 0x65, - 0xe3, 0xc4, 0xee, 0x88, 0xa5, 0x2e, 0x03, 0xa6, 0xad, 0xd3, 0x12, 0x92, 0xab, 0x6f, 0x1c, 0x5c, - 0x6f, 0x8b, 0x45, 0x9f, 0x0e, 0x3c, 0x60, 0x11, 0x29, 0x09, 0x6e, 0x0c, 0x0a, 0x78, 0xa3, 0xf0, - 0x29, 0x07, 0x43, 0xe9, 0xbc, 0xf5, 0x31, 0xf3, 0x8c, 0x8a, 0x5b, 0x09, 0xae, 0x06, 0x7a, 0x19, - 0xab, 0x38, 0x2c, 0x3a, 0xda, 0x4d, 0xec, 0xd3, 0xe8, 0x65, 0x9c, 0x0f, 0xc9, 0x4f, 0x28, 0xc9, - 0xfa, 0x71, 0xb9, 0x1a, 0x24, 0xc2, 0x19, 0x8e, 0x1d, 0x9f, 0x4e, 0x0a, 0x92, 0x4b, 0xbd, 0x64, - 0xf4, 0x55, 0xfc, 0xbb, 0x50, 0x94, 0xdc, 0x3c, 0xfd, 0x9a, 0x14, 0xd1, 0x97, 0x44, 0x6b, 0xd6, - 0x7f, 0xff, 0x14, 0xbf, 0x99, 0x2a, 0xb7, 0x65, 0x24, 0x47, 0xea, 0x16, 0x9f, 0xc5, 0x03, 0xa3, - 0xd3, 0x99, 0xe5, 0xf1, 0x8f, 0x15, 0xf6, 0x40, 0x0f, 0xac, 0xe7, 0xce, 0xb4, 0xf1, 0x23, 0xae, - 0x67, 0x3c, 0xb7, 0x5f, 0x95, 0xc9, 0xb0, 0x74, 0x47, 0xc3, 0xb5, 0x34, 0xfc, 0x66, 0x7b, 0x3d, - 0xb5, 0xf6, 0xb5, 0xa6, 0x98, 0x10, 0xba, 0x3f, 0x33, 0x21, 0x74, 0x3f, 0xeb, 0x8f, 0xff, 0xd7, - 0x74, 0x70, 0x6c, 0x8f, 0x80, 0xbf, 0xab, 0x1f, 0x6c, 0xca, 0x14, 0x98, 0x2f, 0x1c, 0xe7, 0x99, - 0xdc, 0xe1, 0x6f, 0x1b, 0x48, 0x56, 0xc5, 0x21, 0x8d, 0xba, 0x3f, 0x06, 0x9d, 0xb5, 0x98, 0x26, - 0x63, 0xe1, 0x7e, 0x4b, 0x9c, 0xd3, 0xbd, 0x31, 0xf4, 0xb5, 0xf4, 0x56, 0x3a, 0xa5, 0xf3, 0x26, - 0xb5, 0x2c, 0x1c, 0x8a, 0x95, 0xc8, 0x70, 0x67, 0x0a, 0xad, 0x0b, 0x2c, 0xa2, 0x4e, 0xe8, 0x10, - 0x0a, 0xff, 0xce, 0x4e, 0x94, 0xa1, 0x64, 0xf5, 0xb4, 0x11, 0x85, 0xef, 0x05, 0x1f, 0xe2, 0x4f, - 0x9f, 0xed, 0x43, 0xd1, 0x88, 0xec, 0x3a, 0x1a, 0xac, 0x86, 0x07, 0x36, 0xa2, 0xdf, 0x09, 0x9e, - 0x8d, 0x05, 0x8b, 0x35, 0x1c, 0xb3, 0x82, 0xdd, 0xb6, 0x7e, 0x3a, 0x50, 0xe9, 0x9b, 0x4d, 0x25, - 0xa4, 0xdc, 0x41, 0x59, 0xba, 0xd7, 0xb3, 0xbd, 0x03, 0xd8, 0x4c, 0xe9, 0xcc, 0x65, 0x3a, 0xfe, - 0x1b, 0x87, 0x98, 0x8f, 0xbc, 0xb2, 0x07, 0xa0, 0x52, 0x2a, 0x25, 0xd5, 0xd2, 0x83, 0xef, 0xf6, - 0x31, 0xba, 0x6a, 0xb3, 0xe3, 0x0d, 0x9d, 0x40, 0xa5, 0x34, 0x33, 0x84, 0x75, 0xf3, 0xa2, 0xe9, - 0x09, 0x95, 0x35, 0x0c, 0xf4, 0xd8, 0x49, 0xfd, 0xe4, 0xe4, 0x96, 0xc5, 0x8c, 0x8f, 0x05, 0x67, - 0xd3, 0x89, 0x19, 0x51, 0x00, 0x32, 0x2a, 0xc0, 0x31, 0x7f, 0x37, 0x4b, 0xef, 0x8c, 0xde, 0x0f, - 0x3c, 0xdb, 0x9b, 0x28, 0xb3, 0xa0, 0x92, 0xcf, 0xdb, 0x45, 0x76, 0x51, 0x4d, 0x14, 0x76, 0x5f, - 0xd2, 0x3c, 0x8e, 0x3f, 0xcf, 0x1b, 0xf8, 0x9b, 0x86, 0x2f, 0x77, 0xac, 0xa3, 0x9c, 0xe9, 0x87, - 0x62, 0x66, 0x40, 0x8c, 0x67, 0xca, 0x48, 0x5a, 0x34, 0xa5, 0x43, 0x51, 0x17, 0x15, 0x3e, 0x14, - 0x0b, 0xfa, 0x07, 0x99, 0x37, 0xf1, 0x47, 0x00, 0x22, 0xb0, 0x88, 0x91, 0x3b, 0xea, 0x19, 0x3e, - 0xb6, 0x48, 0x0e, 0x89, 0x8c, 0x5a, 0x35, 0x9e, 0x18, 0xa3, 0xcd, 0x26, 0x70, 0x02, 0xdd, 0x71, - 0xcf, 0x79, 0x88, 0x4c, 0x3c, 0xbf, 0x43, 0x3e, 0xf0, 0xe2, 0x2f, 0x82, 0xc3, 0xd4, 0x39, 0xfc, - 0xe4, 0xfc, 0xd7, 0xa4, 0x9d, 0x33, 0x61, 0x40, 0x9c, 0xd9, 0x3e, 0xfe, 0x31, 0x2d, 0xdc, 0x36, - 0x19, 0x62, 0x0e, 0x40, 0xd6, 0xe9, 0x29, 0x96, 0x24, 0x6a, 0x00, 0xca, 0xbf, 0xad, 0x22, 0x3c, - 0x70, 0xb8, 0xec, 0x9b, 0xc5, 0x53, 0x16, 0x60, 0xd5, 0xc5, 0x8a, 0xf1, 0xa0, 0x72, 0x42, 0x74, - 0xea, 0xbb, 0x62, 0xde, 0x97, 0xbd, 0x25, 0x26, 0x59, 0x9d, 0x34, 0xb0, 0xb5, 0x16, 0x18, 0x24, - 0xc3, 0xd5, 0x86, 0x06, 0x34, 0x32, 0xbe, 0xb5, 0x17, 0x80, 0x4e, 0xb4, 0x8f, 0xd6, 0x7e, 0xaa, - 0xc8, 0xde, 0x29, 0x83, 0x7d, 0x37, 0x66, 0x9d, 0x74, 0x7b, 0xbe, 0x08, 0xae, 0x66, 0x78, 0x58, - 0x34, 0x71, 0x9e, 0xbe, 0xce, 0xd4, 0xb4, 0x75, 0x52, 0x88, 0x6d, 0x07, 0xb3, 0xb0, 0xd8, 0x74, - 0x6e, 0x92, 0x2e, 0x3f, 0x0d, 0x2e, 0x5e, 0xfc, 0x93, 0x3f, 0xda, 0x6a, 0x3e, 0x8d, 0x6e, 0xac, - 0x5f, 0xed, 0xef, 0x00, 0x2b, 0x79, 0xa4, 0x36, 0x16, 0x40, 0xf9, 0x18, 0x7f, 0x07, 0x90, 0x78, - 0xe2, 0xb4, 0x87, 0x81, 0x53, 0x34, 0x71, 0x51, 0x19, 0x19, 0x8c, 0xe9, 0xfa, 0xa4, 0xb1, 0xa6, - 0x90, 0x38, 0xfd, 0x81, 0x74, 0xe8, 0x03, 0x19, 0x29, 0x6f, 0x6b, 0xbe, 0x83, 0xd5, 0x48, 0xd1, - 0x45, 0x59, 0xff, 0x91, 0x54, 0xd1, 0x13, 0x3a, 0xd9, 0x02, 0xd4, 0x31, 0x60, 0x75, 0x37, 0x67, - 0xde, 0x05, 0xd8, 0x4e, 0xbb, 0x03, 0xba, 0xe0, 0x73, 0x0f, 0xd3, 0xb9, 0x14, 0xdc, 0x88, 0x2c, - 0xa9, 0x1f, 0xc9, 0xd5, 0x80, 0x4a, 0x6e, 0x8b, 0x1b, 0xed, 0xf1, 0xc8, 0x53, 0x69, 0xcc, 0x38, - 0x51, 0x37, 0x67, 0x8b, 0x93, 0x99, 0xea, 0x65, 0xd0, 0xe3, 0xcd, 0xd0, 0x0b, 0x8b, 0x15, 0x38, - 0xc5, 0x4a, 0xf2, 0x47, 0xd7, 0xaf, 0x3d, 0xb3, 0x27, 0x54, 0xd9, 0xf5, 0xc7, 0xd6, 0x98, 0x4d, - 0x70, 0x86, 0x01, 0xd0, 0x6c, 0xd6, 0xc6, 0x2c, 0x3c, 0xf9, 0xfb, 0xf8, 0x1c, 0x80, 0x0c, 0x53, - 0x58, 0xa5, 0xde, 0x21, 0xbe, 0x54, 0x9c, 0xb2, 0x52, 0x90, 0x8d, 0x43, 0x19, 0xe3, 0xd0, 0x46, - 0x6c, 0x07, 0x69, 0xd0, 0x4c, 0x2b, 0xb8, 0xf1, 0x69, 0xec, 0xac, 0x50, 0xa9, 0xf5, 0xcf, 0x0d, - 0x2b, 0x78, 0xbc, 0x8d, 0x3c, 0x43, 0xe0, 0xca, 0x69, 0x6a, 0x3c, 0x33, 0x2d, 0x6f, 0xa4, 0x94, - 0x4c, 0xc2, 0x39, 0x39, 0x68, 0xfb, 0x98, 0x4d, 0xb0, 0xf7, 0x4f, 0x78, 0x19, 0xd2, 0xbf, 0xe3, - 0xae, 0xb0, 0x26, 0xb7, 0xb1, 0xd9, 0x08, 0xb6, 0x06, 0x32, 0x42, 0x86, 0x52, 0xd1, 0x5f, 0x25, - 0x02, 0x2d, 0x6d, 0x39, 0xb4, 0x39, 0xba, 0xc9, 0xac, 0x91, 0xd8, 0x7b, 0xea, 0x6e, 0x52, 0xfe, - 0x77, 0xda, 0x9a, 0xae, 0xeb, 0xf3, 0x0b, 0x0e, 0x39, 0x7b, 0x35, 0x14, 0x3b, 0x5e, 0x6c, 0x06, - 0x97, 0x01, 0x64, 0x55, 0x33, 0xe6, 0x7c, 0x89, 0x14, 0x72, 0xa7, 0xeb, 0xbf, 0xd8, 0x53, 0xeb, - 0x5b, 0x41, 0xf4, 0x91, 0xc4, 0x71, 0xa6, 0xdd, 0x07, 0x6b, 0x3b, 0x38, 0x03, 0xd6, 0x06, 0x4a, - 0x35, 0xd9, 0x26, 0x9a, 0xce, 0xcb, 0x94, 0xbe, 0x04, 0xb1, 0x8c, 0x64, 0x4b, 0x34, 0x96, 0xe1, - 0x37, 0xf5, 0xc4, 0xa9, 0x18, 0x46, 0x76, 0xeb, 0xdd, 0x80, 0xe7, 0x68, 0x6a, 0xbd, 0xe7, 0x2e, - 0x2a, 0xa6, 0x3a, 0x27, 0x49, 0xba, 0x2a, 0x5e, 0xc0, 0xbb, 0x01, 0x87, 0x10, 0xeb, 0x35, 0x31, - 0xc6, 0x90, 0xf5, 0x6d, 0xe6, 0x6c, 0x65, 0x16, 0x11, 0x29, 0x3d, 0xa0, 0x1a, 0x3b, 0xce, 0x1a, - 0x87, 0xd0, 0x24, 0xcf, 0xf4, 0x06, 0x6f, 0x7e, 0xac, 0xb7, 0x76, 0x3f, 0x1b, 0xb1, 0x9a, 0x62, - 0xab, 0x4c, 0x16, 0xbf, 0x0d, 0xd4, 0xd3, 0x81, 0x74, 0xe8, 0x74, 0x39, 0xd9, 0x45, 0xc2, 0x47, - 0xca, 0x42, 0xbc, 0x08, 0x2c, 0xea, 0xcc, 0x42, 0x5f, 0xe2, 0xac, 0x11, 0x34, 0x04, 0x77, 0x24, - 0xf5, 0x23, 0x27, 0xf1, 0xfb, 0x9c, 0x2c, 0xec, 0x3a, 0x2f, 0x46, 0x63, 0xa7, 0xb4, 0x6d, 0x95, - 0x98, 0xba, 0xd2, 0x39, 0x0e, 0xb6, 0xa5, 0x4c, 0xc7, 0x99, 0x35, 0x28, 0x75, 0x28, 0x17, 0xa8, - 0x8f, 0xce, 0xf0, 0x8b, 0x74, 0xce, 0xa4, 0xa5, 0xc2, 0x77, 0x48, 0x0d, 0x74, 0xc2, 0x10, 0x53, - 0x01, 0x41, 0xeb, 0x29, 0xfc, 0x50, 0x47, 0x5f, 0x25, 0x08, 0x8f, 0x55, 0x4c, 0x1d, 0xed, 0x3d, - 0xd5, 0x89, 0x3c, 0xb5, 0xc2, 0x1a, 0xd8, 0x6d, 0xb7, 0x4f, 0xa4, 0x47, 0x69, 0x54, 0xb5, 0x07, - 0xc2, 0x8c, 0x3a, 0x15, 0xd6, 0x9e, 0xc3, 0x17, 0xbe, 0x1f, 0x7e, 0x93, 0xec, 0x5b, 0x45, 0xc3, - 0xf9, 0x04, 0x84, 0x60, 0x4e, 0x5f, 0xdb, 0x70, 0x3a, 0xc3, 0xb1, 0x3b, 0xf2, 0xf9, 0x6d, 0x36, - 0xff, 0x2d, 0x13, 0xca, 0xbe, 0x1b, 0xdc, 0xb1, 0x70, 0x5b, 0x45, 0x70, 0x60, 0x57, 0x4d, 0x9f, - 0x30, 0xee, 0xf5, 0x0b, 0x99, 0x80, 0xb6, 0x44, 0xbb, 0x9d, 0x1a, 0xc4, 0x2c, 0xb9, 0x43, 0xcc, - 0x03, 0x09, 0x1f, 0x3e, 0xea, 0xc9, 0xa6, 0x23, 0x0f, 0x1f, 0x27, 0x8c, 0x11, 0x2a, 0x96, 0x88, - 0x78, 0x0b, 0xb3, 0x04, 0x50, 0x41, 0xf0, 0x60, 0xf4, 0xeb, 0x0c, 0x54, 0xb0, 0xc5, 0x85, 0xa4, - 0xf1, 0x93, 0x64, 0x92, 0xe0, 0xf5, 0x5f, 0x3a, 0x48, 0x36, 0xf5, 0x1c, 0xce, 0xc7, 0x06, 0x4c, - 0xdb, 0xd7, 0x4e, 0x74, 0x40, 0x6b, 0xf7, 0xbd, 0xbe, 0xa4, 0x60, 0xf3, 0x5f, 0xd5, 0x8f, 0x70, - 0x97, 0xd3, 0xed, 0xc6, 0x56, 0xa1, 0xbd, 0xd5, 0x9d, 0xc1, 0x68, 0xc3, 0xe9, 0xf4, 0xdc, 0x3e, - 0xf1, 0xc4, 0x6d, 0x2a, 0x70, 0x94, 0x67, 0x5d, 0x82, 0x99, 0x49, 0x25, 0x96, 0x09, 0xa9, 0xe2, - 0x76, 0x51, 0xa1, 0xb3, 0xeb, 0x79, 0xbd, 0x24, 0x9e, 0xee, 0x31, 0x73, 0x42, 0xc9, 0x1d, 0x34, - 0x28, 0x24, 0x30, 0x61, 0x98, 0xb1, 0x20, 0xd0, 0x14, 0xa5, 0xcd, 0x9c, 0xf9, 0x64, 0x11, 0xa2, - 0x5c, 0x73, 0xa3, 0x76, 0x1f, 0xb5, 0x4d, 0xbe, 0xf5, 0x8f, 0x32, 0xc9, 0x44, 0xbc, 0x4a, 0x7f, - 0xe3, 0x03, 0xca, 0x9e, 0xc8, 0x85, 0x52, 0x80, 0x60, 0xcb, 0xe8, 0xe4, 0x3e, 0x45, 0x2c, 0x2d, - 0xfc, 0xfb, 0x69, 0x91, 0x3d, 0x83, 0x55, 0xd2, 0x88, 0xe2, 0x9b, 0x51, 0x2b, 0x80, 0x5a, 0x1b, - 0x03, 0xd0, 0xb6, 0x9f, 0x05, 0x2e, 0x47, 0xfb, 0xa8, 0x79, 0x37, 0x2a, 0x66, 0x94, 0xe2, 0xaa, - 0xfd, 0xfc, 0x50, 0xe6, 0xaa, 0x9a, 0x25, 0x79, 0x17, 0xf7, 0xff, 0xf9, 0xa1, 0x4a, 0x54, 0x35, - 0x47, 0x65, 0x78, 0xd7, 0xa0, 0x4c, 0xa5, 0x98, 0x99, 0xa7, 0x42, 0xcc, 0x39, 0x03, 0x85, 0x87, - 0x83, 0x63, 0x52, 0xb5, 0xe9, 0x82, 0x2f, 0xa1, 0x40, 0xa8, 0xa1, 0xe8, 0xb3, 0x3c, 0xfc, 0xa2, - 0x12, 0x82, 0xa9, 0x4c, 0x8d, 0xb5, 0xa4, 0x84, 0x60, 0x2a, 0xc5, 0xc1, 0x96, 0x43, 0x25, 0x38, - 0xda, 0x8a, 0x4e, 0x15, 0xe6, 0x0c, 0x0f, 0x30, 0xf1, 0x07, 0x26, 0x58, 0x3c, 0x47, 0x6f, 0x19, - 0xa5, 0x61, 0x6c, 0xab, 0x8c, 0x24, 0x00, 0xd9, 0x5c, 0x0f, 0x63, 0x0f, 0x01, 0x51, 0x57, 0xa8, - 0x8e, 0x39, 0x96, 0x8f, 0x15, 0x4d, 0x48, 0x6c, 0x46, 0xa1, 0x92, 0xb5, 0x52, 0x31, 0x41, 0x94, - 0xb2, 0x7e, 0x4a, 0xdc, 0x9a, 0xfe, 0x19, 0x79, 0xda, 0x6b, 0xe8, 0xd8, 0x10, 0x94, 0xcb, 0x03, - 0xbf, 0x56, 0x9c, 0xd2, 0x59, 0x05, 0x95, 0x8b, 0x57, 0x13, 0x59, 0xdb, 0x70, 0x0e, 0x92, 0xa6, - 0x07, 0xdb, 0x83, 0xef, 0x7a, 0x8d, 0x29, 0x7e, 0x4f, 0x66, 0xe0, 0x9e, 0x38, 0x8c, 0x09, 0xf6, - 0xa7, 0x0e, 0x17, 0xf3, 0xba, 0xab, 0x2a, 0x3f, 0x11, 0x73, 0x78, 0xb8, 0x3d, 0xbe, 0x73, 0xca, - 0x46, 0xc6, 0x67, 0xfa, 0x19, 0x3b, 0xa8, 0x4f, 0x1f, 0xea, 0x94, 0xd9, 0x0e, 0xb9, 0x83, 0x22, - 0x9d, 0xef, 0x2b, 0xa3, 0xaa, 0x39, 0x64, 0x44, 0x6f, 0x9f, 0x84, 0x27, 0xfe, 0x34, 0x15, 0x5f, - 0x56, 0xd0, 0x63, 0x1a, 0xa2, 0xe0, 0x8c, 0xd4, 0x58, 0x14, 0xd6, 0x87, 0xcb, 0x42, 0x54, 0x8b, - 0x4b, 0x7d, 0x38, 0xe6, 0x16, 0xe5, 0x42, 0x14, 0xee, 0xb3, 0xaa, 0xe1, 0x10, 0xcd, 0x5d, 0xb2, - 0x70, 0x46, 0xc7, 0xe7, 0x71, 0xb5, 0x27, 0xb0, 0xa9, 0x1a, 0x9e, 0x8b, 0x38, 0x42, 0x32, 0x1b, - 0xfa, 0xa9, 0xe9, 0xcd, 0xf8, 0xa2, 0x3d, 0xec, 0xb6, 0x40, 0x3e, 0x19, 0xba, 0xed, 0x1e, 0x61, - 0x3a, 0x3f, 0x89, 0xef, 0xe0, 0x3c, 0x34, 0x98, 0x68, 0x15, 0x99, 0x6a, 0xca, 0xf8, 0xc3, 0x1b, - 0xb8, 0x1d, 0xb0, 0xa2, 0xdb, 0x6d, 0x7f, 0xf4, 0xc8, 0x45, 0xca, 0xdd, 0xeb, 0x39, 0xc0, 0x45, - 0x6a, 0xd5, 0xcd, 0xae, 0xc7, 0x36, 0xb2, 0x30, 0x36, 0x82, 0xe5, 0x1d, 0x41, 0x0b, 0x9b, 0x95, - 0x39, 0x8c, 0x31, 0xbf, 0x15, 0x50, 0x80, 0x89, 0xa3, 0x19, 0x71, 0x35, 0xc3, 0x56, 0xa0, 0xc7, - 0xc1, 0x6b, 0x8c, 0x29, 0x9d, 0x93, 0xb5, 0x48, 0xd1, 0x60, 0x91, 0xd6, 0x45, 0x56, 0x59, 0x6e, - 0xf6, 0xdc, 0x01, 0xe5, 0xd0, 0x45, 0xd5, 0x83, 0xaf, 0x64, 0x9c, 0x5d, 0xbc, 0xab, 0x7d, 0x20, - 0x3d, 0xd2, 0xe8, 0xaf, 0x6c, 0xb9, 0x1b, 0xbd, 0x43, 0xeb, 0x5f, 0x91, 0x99, 0xf0, 0xcb, 0xd4, - 0x8d, 0x5d, 0xab, 0x75, 0x52, 0x36, 0xc9, 0xd5, 0xa8, 0xc4, 0x71, 0x91, 0x97, 0xfe, 0xcb, 0xb1, - 0x98, 0x92, 0x53, 0xac, 0x25, 0xc9, 0x89, 0xdd, 0xac, 0xa6, 0xe9, 0xb2, 0xd9, 0x75, 0x00, 0x36, - 0xd1, 0x26, 0x40, 0x07, 0xcb, 0x7a, 0x24, 0xa4, 0x51, 0xa6, 0x95, 0x50, 0x7b, 0x33, 0xa8, 0xe7, - 0x7d, 0xf3, 0x5f, 0x8c, 0xdb, 0xc0, 0xf7, 0xab, 0x94, 0xc5, 0xeb, 0xa9, 0xfb, 0xd6, 0x2f, 0xa7, - 0x4d, 0xaf, 0xce, 0xf0, 0xa8, 0x67, 0x78, 0xdb, 0x37, 0xa9, 0x8b, 0x0c, 0x34, 0x53, 0xc6, 0xec, - 0x6a, 0x73, 0xd2, 0x27, 0x81, 0x5f, 0xee, 0x4a, 0x3f, 0x66, 0x15, 0x8b, 0x29, 0xad, 0x6c, 0xe3, - 0x46, 0x0d, 0xfc, 0x49, 0xd6, 0x2c, 0x6e, 0x91, 0x89, 0x2d, 0x87, 0x55, 0xcf, 0x0d, 0x21, 0x82, - 0x8f, 0x10, 0x13, 0xc2, 0x9f, 0x01, 0x26, 0xe4, 0x9c, 0x58, 0x64, 0x21, 0x8e, 0x5e, 0x7d, 0xb2, - 0xf7, 0x61, 0xb5, 0xef, 0x8f, 0x31, 0x63, 0x33, 0x25, 0x06, 0xa7, 0x91, 0x39, 0xbc, 0x0c, 0xff, - 0xfd, 0xc8, 0xe9, 0x75, 0x73, 0x19, 0x65, 0xc5, 0x20, 0x4b, 0xaa, 0xc3, 0xa9, 0x63, 0xb9, 0x3e, - 0xee, 0x1c, 0x92, 0xc8, 0x94, 0xfc, 0xa1, 0x91, 0x61, 0x2a, 0x3c, 0x80, 0x19, 0xb9, 0x80, 0x93, - 0x3e, 0xc9, 0xe5, 0xa5, 0x94, 0xff, 0xaa, 0x2c, 0x0d, 0x2f, 0x3e, 0x1d, 0x5b, 0xbc, 0x0e, 0xd9, - 0x20, 0x5b, 0xe8, 0x77, 0xf6, 0x91, 0x9e, 0x33, 0xd2, 0x66, 0x7f, 0x5e, 0x8b, 0x14, 0x36, 0xbf, - 0xcc, 0x56, 0xaa, 0x38, 0xc3, 0xcb, 0x3e, 0x71, 0xa6, 0xc5, 0x52, 0x27, 0xe1, 0x85, 0xfa, 0x9c, - 0x62, 0x06, 0xd9, 0xf8, 0x43, 0x51, 0x82, 0x0a, 0x1f, 0x88, 0x59, 0xd9, 0x98, 0xa4, 0xcb, 0x30, - 0x76, 0x29, 0x70, 0xca, 0x34, 0xdf, 0x0e, 0xcb, 0x36, 0x04, 0x7d, 0x1f, 0x06, 0xe8, 0x6a, 0xdb, - 0x7d, 0x2e, 0x25, 0x37, 0xb4, 0x61, 0xcb, 0x80, 0x2b, 0x98, 0xfe, 0x1f, 0x4d, 0x0e, 0x12, 0x59, - 0xb2, 0xc2, 0x5d, 0xa9, 0xb9, 0xb5, 0xe5, 0xb9, 0xac, 0x4d, 0x99, 0x9c, 0xf2, 0x17, 0x27, 0x82, - 0x8e, 0x2a, 0xea, 0x47, 0xf4, 0xd1, 0xba, 0xae, 0x08, 0xb6, 0x57, 0xa7, 0x58, 0x66, 0xca, 0xf6, - 0x85, 0xe1, 0x5b, 0x13, 0x1f, 0x7c, 0xaa, 0x4e, 0xea, 0x7d, 0x91, 0x63, 0xdf, 0x04, 0xfd, 0x95, - 0xf8, 0x5b, 0xfb, 0x84, 0x31, 0x01, 0x73, 0x5f, 0x8e, 0x57, 0x93, 0xb1, 0xed, 0x1d, 0x4c, 0x4c, - 0xae, 0xc7, 0x4a, 0x9d, 0x61, 0xac, 0x8a, 0x11, 0x0d, 0x28, 0x34, 0xd6, 0x34, 0x07, 0x4c, 0x73, - 0x17, 0x18, 0x9a, 0x7f, 0xd9, 0x88, 0xfc, 0x13, 0x1d, 0x27, 0x88, 0x69, 0x72, 0xfa, 0x40, 0xb0, - 0xe7, 0x21, 0xc6, 0x01, 0xb7, 0xe9, 0x1d, 0x71, 0xce, 0xb0, 0x40, 0xeb, 0x5c, 0x60, 0x8b, 0x6b, - 0x57, 0x8a, 0xc9, 0x9f, 0xb4, 0xfe, 0xca, 0x7c, 0x59, 0xe2, 0x8c, 0x12, 0xb2, 0x49, 0x26, 0x4d, - 0x26, 0x31, 0x33, 0x1e, 0x3f, 0x60, 0x4c, 0xcc, 0xa7, 0x97, 0x89, 0xda, 0x69, 0xb2, 0xea, 0xb2, - 0x1b, 0xe9, 0xdb, 0x66, 0x14, 0xd2, 0x72, 0xfb, 0x9d, 0xde, 0xb8, 0x8b, 0x2a, 0x10, 0x84, 0xfa, - 0x4e, 0x60, 0xa0, 0x9f, 0xd3, 0x06, 0x7a, 0xd9, 0xc2, 0x88, 0xcb, 0xc6, 0xcc, 0xf2, 0xbc, 0xf5, - 0xf7, 0xe9, 0x80, 0xc0, 0x26, 0x2e, 0x48, 0xef, 0xf2, 0x47, 0x51, 0x57, 0xdb, 0xb7, 0x8a, 0x67, - 0xea, 0xc8, 0x4f, 0x00, 0x22, 0x93, 0x67, 0xdf, 0xb7, 0xff, 0x3d, 0x25, 0x66, 0xb8, 0x36, 0xae, - 0xfc, 0x48, 0x52, 0xf4, 0x27, 0x65, 0x67, 0x96, 0xf9, 0x53, 0x59, 0xf3, 0x1f, 0x4f, 0xfd, 0x1f, - 0x4d, 0x87, 0x3c, 0x4b, 0x4a, 0x8e, 0x58, 0xea, 0xe4, 0xb9, 0x84, 0x6c, 0xeb, 0xf3, 0xf1, 0xcc, - 0xc9, 0x0b, 0xca, 0xbe, 0x20, 0xbd, 0x36, 0x49, 0x9e, 0x08, 0xe7, 0xa6, 0x5f, 0x54, 0x13, 0x93, - 0x2e, 0xc3, 0x4b, 0x51, 0xe5, 0x65, 0x13, 0x57, 0xb5, 0xd1, 0x76, 0x7b, 0x27, 0x28, 0x45, 0x69, - 0x16, 0x42, 0x05, 0xb1, 0xde, 0x2a, 0x93, 0xd6, 0xcc, 0xed, 0x84, 0x05, 0x85, 0xff, 0x33, 0xad, - 0x24, 0x85, 0x48, 0xb5, 0x3e, 0x9d, 0x30, 0x75, 0x54, 0xb2, 0x5c, 0x62, 0xeb, 0xb8, 0xea, 0xe0, - 0x3b, 0x62, 0xb9, 0x6f, 0xb6, 0x94, 0xd8, 0xe2, 0xce, 0xd4, 0x51, 0xcc, 0xd2, 0xc2, 0xef, 0xa4, - 0xc4, 0x92, 0x59, 0x60, 0x78, 0x0b, 0x65, 0x89, 0x83, 0x54, 0x3a, 0xac, 0x48, 0xc8, 0x8e, 0x4c, - 0x90, 0x24, 0x5f, 0xc5, 0xd3, 0x68, 0x4b, 0x78, 0x0f, 0x15, 0xee, 0x1b, 0xe7, 0xa9, 0x0b, 0x3b, - 0x92, 0x27, 0x35, 0xde, 0x94, 0xcd, 0x29, 0x29, 0x61, 0xdc, 0x07, 0x79, 0x52, 0x12, 0x87, 0xaf, - 0xaa, 0x29, 0xb8, 0xa5, 0xb8, 0xef, 0xd0, 0xc2, 0x77, 0xda, 0xc3, 0x67, 0x0d, 0x18, 0x53, 0x9d, - 0xc9, 0x43, 0x96, 0x6c, 0x02, 0xcf, 0x4c, 0x6c, 0x60, 0xf6, 0xe0, 0x90, 0x49, 0xed, 0x2e, 0x32, - 0x1d, 0xe6, 0xf6, 0x1a, 0x6e, 0xee, 0xff, 0x4e, 0x4a, 0x09, 0xf1, 0x4c, 0x77, 0x38, 0x2b, 0x10, - 0xa9, 0xe7, 0xce, 0x85, 0x7d, 0x16, 0x30, 0x13, 0x7a, 0xf6, 0x99, 0x73, 0x12, 0x3d, 0x9b, 0x68, - 0xbf, 0xe2, 0x2e, 0xab, 0x42, 0xb9, 0xfc, 0x31, 0x74, 0x28, 0x7c, 0x28, 0xce, 0xc7, 0x0a, 0x43, - 0x18, 0xd2, 0xd4, 0x31, 0x60, 0x33, 0x0c, 0xcc, 0x98, 0x96, 0xbe, 0x55, 0x57, 0xf8, 0x33, 0x7c, - 0xc1, 0x59, 0xfa, 0x98, 0xa2, 0xe8, 0x1a, 0xa9, 0xe5, 0x04, 0xed, 0xf9, 0xcd, 0x55, 0x24, 0x72, - 0x47, 0x32, 0x27, 0x0a, 0xa5, 0x2a, 0x00, 0x67, 0x10, 0xfd, 0xc1, 0x34, 0x27, 0xea, 0xac, 0xb2, - 0x32, 0xcf, 0x85, 0x7c, 0xe1, 0xf5, 0xfb, 0x29, 0x25, 0xab, 0x46, 0x3f, 0x7b, 0x8a, 0x7a, 0x6d, - 0x72, 0x87, 0xf8, 0x03, 0xbf, 0x8d, 0xaf, 0xf6, 0xac, 0x5b, 0x17, 0x57, 0x6b, 0x9b, 0x75, 0x5b, - 0x66, 0x7e, 0x4b, 0x5b, 0xff, 0x4c, 0x46, 0xca, 0xc1, 0x14, 0x9a, 0xe8, 0xe7, 0xe7, 0x74, 0x9b, - 0xf5, 0x32, 0x7a, 0x3b, 0xd2, 0xe2, 0x4d, 0x87, 0x47, 0x3e, 0x94, 0xb7, 0xc4, 0x2c, 0x39, 0x43, - 0x86, 0x09, 0x78, 0xac, 0x77, 0x91, 0xc7, 0x98, 0xe2, 0x3f, 0x99, 0x91, 0x71, 0x33, 0x17, 0x50, - 0x61, 0xcc, 0xad, 0xd5, 0xb5, 0xd4, 0x32, 0x0a, 0x3b, 0x9b, 0xf1, 0xa7, 0xd8, 0x2f, 0x1b, 0x38, - 0x58, 0x24, 0x29, 0x0a, 0xe3, 0x16, 0xfe, 0x0c, 0x50, 0x76, 0x52, 0x67, 0xbe, 0xed, 0x4c, 0xd3, - 0xde, 0x17, 0xf3, 0xf2, 0xa3, 0x4a, 0x7d, 0x78, 0x6b, 0xda, 0xa4, 0x8b, 0x4f, 0xb8, 0x71, 0xfe, - 0x3d, 0xb1, 0x88, 0x23, 0xda, 0x72, 0xbd, 0x59, 0xc3, 0x58, 0x1b, 0xef, 0xaa, 0x57, 0x51, 0x78, - 0x53, 0xcc, 0xa9, 0x11, 0x10, 0x30, 0x78, 0xc6, 0xc1, 0x9a, 0xcc, 0x37, 0x5a, 0x59, 0xeb, 0x55, - 0x16, 0xc8, 0x25, 0x0c, 0x7f, 0xee, 0x00, 0xa8, 0xf7, 0xbb, 0x2d, 0xf4, 0x36, 0x76, 0x4e, 0x94, - 0x55, 0x12, 0xb3, 0xc8, 0x10, 0x2e, 0x4e, 0xae, 0x46, 0xd5, 0x59, 0xd7, 0x7d, 0xee, 0xfa, 0x06, - 0x2b, 0xc4, 0x0b, 0x4c, 0x6e, 0x5f, 0xdc, 0x90, 0x8d, 0x0b, 0x4f, 0x30, 0x68, 0x29, 0xff, 0x8d, - 0x24, 0x48, 0x0d, 0x12, 0xe4, 0x2b, 0x21, 0x47, 0x3b, 0xf2, 0xf9, 0x05, 0xb2, 0xd6, 0xf5, 0x5e, - 0xd8, 0xf8, 0x86, 0x39, 0x08, 0x99, 0x63, 0xd6, 0x74, 0x7a, 0x9e, 0xaf, 0xc2, 0xa3, 0xfc, 0x5e, - 0xca, 0xd4, 0x72, 0xef, 0x0e, 0xbd, 0xe7, 0x6e, 0xd7, 0x69, 0x8e, 0x41, 0xf8, 0x38, 0x91, 0x00, - 0xbb, 0x2e, 0x16, 0x54, 0x8c, 0x51, 0x35, 0x65, 0xbe, 0x00, 0x13, 0xbb, 0x14, 0x4d, 0xf6, 0xca, - 0xa7, 0x0a, 0x5b, 0xa1, 0x85, 0x6c, 0xe1, 0x3d, 0x31, 0xaf, 0xeb, 0x01, 0x0f, 0xd0, 0x66, 0x86, - 0x18, 0x6e, 0xca, 0x07, 0x4f, 0x9d, 0x38, 0x43, 0xbe, 0xca, 0xfa, 0xa0, 0xad, 0x39, 0x95, 0x63, - 0x40, 0x88, 0x1d, 0xaf, 0xcf, 0x16, 0xa5, 0x49, 0x21, 0x91, 0x0a, 0x22, 0xcf, 0x0e, 0xc2, 0x20, - 0x39, 0x38, 0xb2, 0x87, 0x72, 0x38, 0x95, 0x47, 0x19, 0xa0, 0x5f, 0x35, 0xa4, 0xc1, 0x64, 0x5a, - 0x9f, 0x29, 0xaa, 0xda, 0xf2, 0xb8, 0xa1, 0xd9, 0x28, 0xff, 0x40, 0x9c, 0x53, 0xa3, 0xda, 0x1c, - 0xd1, 0x59, 0xda, 0x9e, 0x03, 0x27, 0xde, 0xd8, 0x3c, 0xad, 0x72, 0xd4, 0x21, 0xbf, 0x85, 0x7a, - 0x8b, 0x0d, 0x80, 0x4f, 0xef, 0x50, 0x6e, 0x37, 0xa5, 0x38, 0xc3, 0xdf, 0x21, 0x97, 0x0a, 0x73, - 0x27, 0x1e, 0xb1, 0xc4, 0x1b, 0xcc, 0xab, 0xa5, 0x3d, 0xde, 0x49, 0x2d, 0x36, 0xf4, 0x06, 0xa1, - 0xc7, 0x02, 0x1a, 0x43, 0xcb, 0xb7, 0x09, 0x9a, 0x9a, 0x02, 0xcf, 0x1e, 0xd9, 0x06, 0x8c, 0x72, - 0xa3, 0x93, 0xda, 0x57, 0xbe, 0x18, 0xbb, 0x03, 0x34, 0xfc, 0xcd, 0x3a, 0xf4, 0x97, 0x3c, 0xfc, - 0x4b, 0xc5, 0x72, 0xa4, 0x4d, 0xb3, 0xe7, 0x8d, 0xac, 0x37, 0x59, 0xc5, 0x31, 0x75, 0x2c, 0x6d, - 0xcf, 0x8a, 0xed, 0xff, 0x56, 0xbc, 0x31, 0x08, 0xc8, 0x77, 0x4e, 0x6d, 0xa4, 0x21, 0xe9, 0x8c, - 0xb3, 0x0c, 0xd9, 0x74, 0xd4, 0x98, 0xbd, 0x1e, 0xb2, 0x53, 0x75, 0x74, 0x91, 0x04, 0x89, 0xee, - 0xb5, 0xa9, 0x0d, 0xcc, 0x97, 0xa2, 0x92, 0xa1, 0x54, 0xf4, 0xeb, 0x7d, 0x3e, 0x97, 0xa4, 0xae, - 0x70, 0x49, 0x0e, 0xd1, 0xdf, 0x3e, 0xf1, 0xf5, 0xc4, 0x6f, 0x67, 0x59, 0xb5, 0x34, 0xad, 0xe3, - 0x54, 0x81, 0x05, 0x09, 0xe2, 0x78, 0x38, 0xb4, 0xc3, 0xae, 0x59, 0x94, 0xb3, 0x6d, 0x60, 0x8a, - 0xad, 0x19, 0x1d, 0xeb, 0x59, 0xb7, 0x36, 0x5c, 0xc0, 0xd0, 0x69, 0x8c, 0x2a, 0xa0, 0x17, 0x3f, - 0x1e, 0x20, 0x26, 0xda, 0x31, 0x92, 0x9d, 0xeb, 0x6a, 0xee, 0x36, 0xab, 0xca, 0x49, 0xab, 0x1d, - 0x94, 0xcf, 0x29, 0xad, 0x9c, 0x2e, 0x27, 0x46, 0x7c, 0x5e, 0x69, 0x0a, 0xb0, 0x84, 0x9f, 0x96, - 0x19, 0x93, 0x5b, 0x48, 0xa8, 0x0d, 0x5e, 0x8d, 0x0b, 0xb5, 0xd0, 0x3e, 0x08, 0xa7, 0x7a, 0xa1, - 0x5a, 0xfd, 0x8e, 0x1c, 0xb9, 0x2e, 0x5d, 0x0a, 0x1e, 0x23, 0xa8, 0x52, 0x9e, 0xd7, 0xb2, 0xa1, - 0x6a, 0x78, 0x6e, 0xa3, 0x5e, 0x9f, 0x43, 0xc9, 0xad, 0x90, 0x66, 0x5f, 0xad, 0x2f, 0x28, 0x3f, - 0xa7, 0xca, 0xe9, 0xa3, 0x41, 0x79, 0x8e, 0xca, 0x01, 0xbf, 0x60, 0xe2, 0x3e, 0x5a, 0x5f, 0x50, - 0x77, 0x5e, 0xd5, 0xe9, 0xbd, 0x0a, 0xea, 0xf2, 0x2a, 0xdc, 0xa1, 0xb2, 0x3c, 0x13, 0x53, 0x73, - 0x41, 0xe9, 0xcc, 0x58, 0x66, 0x51, 0xab, 0xa0, 0xc4, 0x7d, 0xd6, 0x7d, 0x66, 0xdd, 0x43, 0xa0, - 0xd1, 0x82, 0x0b, 0x7e, 0x74, 0xa2, 0x42, 0x79, 0xc6, 0xc0, 0xe9, 0x6f, 0x52, 0x2c, 0xfc, 0x4f, - 0xe8, 0x33, 0x15, 0x92, 0x3e, 0x12, 0xf3, 0x23, 0x6c, 0x19, 0x84, 0xbd, 0x78, 0xb3, 0x78, 0x86, - 0xb1, 0x8a, 0x5c, 0x14, 0x5b, 0x1a, 0xa9, 0x03, 0x0b, 0x5b, 0x62, 0x56, 0xd6, 0x23, 0xf7, 0x4e, - 0x7f, 0x85, 0x60, 0x57, 0x16, 0x19, 0xca, 0x56, 0x2c, 0x25, 0x27, 0xf3, 0x31, 0xa9, 0x51, 0x94, - 0x56, 0xe3, 0xb9, 0x92, 0x63, 0x34, 0xe2, 0xa3, 0x9e, 0x25, 0xd4, 0x13, 0x3b, 0xdd, 0xb3, 0x8f, - 0x8e, 0x84, 0x92, 0x4b, 0xd1, 0x75, 0x91, 0x6b, 0x32, 0x89, 0xdf, 0x65, 0x4d, 0xdd, 0x1a, 0x6b, - 0x79, 0x92, 0x9e, 0x51, 0x95, 0xe1, 0xd3, 0x89, 0xa7, 0xf0, 0xdf, 0xa7, 0x12, 0x70, 0xab, 0xd1, - 0x09, 0xb1, 0x11, 0x3e, 0x18, 0x9b, 0xc1, 0xe7, 0x6b, 0x0a, 0x69, 0x45, 0x37, 0x3b, 0xa1, 0x4b, - 0x51, 0xfd, 0x55, 0x78, 0x21, 0xe6, 0xd5, 0xdf, 0xc4, 0xbc, 0xd0, 0x33, 0x38, 0xb5, 0xf0, 0x4d, - 0x10, 0x3d, 0xb1, 0x20, 0x64, 0xfe, 0xaf, 0x44, 0x06, 0x23, 0xf3, 0x3f, 0x3a, 0xec, 0x24, 0x94, - 0xdb, 0x95, 0xe3, 0xc1, 0xe8, 0x44, 0xbf, 0xaf, 0x63, 0xfa, 0x93, 0x31, 0xf9, 0xa0, 0x49, 0xdb, - 0x41, 0x2e, 0x33, 0xd6, 0x7f, 0x27, 0xd9, 0xea, 0xa0, 0x15, 0x07, 0xb7, 0x93, 0xd6, 0xc1, 0xd1, - 0x98, 0x88, 0xbf, 0x7c, 0xf6, 0x8d, 0xa4, 0x4a, 0x8a, 0x7b, 0x31, 0x39, 0x9d, 0x1e, 0xf3, 0x03, - 0x41, 0x46, 0x99, 0xcd, 0x70, 0xbe, 0x07, 0x9a, 0xd8, 0x39, 0xe9, 0xf4, 0x58, 0x54, 0x27, 0x8f, - 0xd6, 0x17, 0x4e, 0x7b, 0x88, 0x0e, 0x2e, 0xac, 0x1f, 0x5c, 0x66, 0x17, 0xe4, 0x40, 0x35, 0xad, - 0x85, 0x3b, 0x7f, 0x74, 0xd2, 0x23, 0x1d, 0x46, 0x86, 0x47, 0x07, 0x91, 0xd0, 0x1b, 0x1e, 0x62, - 0x3c, 0x59, 0x9c, 0xc5, 0x02, 0xcd, 0x02, 0x90, 0x87, 0xf1, 0x8c, 0xac, 0x0b, 0xc0, 0xc2, 0xe2, - 0x3a, 0xb2, 0x4b, 0x37, 0x93, 0x96, 0x85, 0x3a, 0x78, 0xf5, 0x22, 0xe4, 0x9f, 0xc2, 0xc2, 0xac, - 0x8f, 0x95, 0x75, 0x4f, 0xdd, 0x95, 0x60, 0xe3, 0x75, 0x94, 0x41, 0x64, 0x37, 0x28, 0x37, 0x12, - 0xfe, 0x85, 0x9a, 0xeb, 0x60, 0xba, 0xd6, 0x77, 0x94, 0xe9, 0x4d, 0xdf, 0x35, 0x63, 0x85, 0x67, - 0x1a, 0xe1, 0xdf, 0x8a, 0xe1, 0xa1, 0x86, 0x03, 0x57, 0xad, 0x6b, 0x28, 0xfc, 0x10, 0x52, 0x26, - 0xbc, 0x31, 0x79, 0xee, 0x3a, 0x2f, 0x6c, 0xa5, 0x19, 0xb1, 0x0d, 0xdb, 0x3e, 0x32, 0x9b, 0x9e, - 0x6f, 0x63, 0xbd, 0x26, 0x69, 0x28, 0x7d, 0xa2, 0xb1, 0x61, 0x04, 0x47, 0x66, 0x68, 0x94, 0x7b, - 0x6e, 0xff, 0x99, 0x6f, 0x1f, 0x78, 0xe4, 0xaf, 0xab, 0x32, 0x18, 0x3e, 0x8c, 0x72, 0x4f, 0xa4, - 0x3a, 0x66, 0xff, 0x02, 0x76, 0x31, 0xea, 0xc6, 0xdf, 0x6f, 0xa5, 0x42, 0xef, 0xb7, 0xe2, 0x94, - 0x9e, 0x25, 0x41, 0xd3, 0xa1, 0x2c, 0x11, 0x29, 0xfc, 0x75, 0x46, 0xd9, 0xf4, 0xd4, 0xc7, 0x43, - 0x1d, 0xa7, 0x93, 0x78, 0xf9, 0x1e, 0x0e, 0x7d, 0x1d, 0x18, 0x39, 0xa7, 0x39, 0x84, 0x3f, 0xaa, - 0xbe, 0xcc, 0x18, 0x1d, 0xa8, 0x0f, 0x73, 0xda, 0x7d, 0xb2, 0x3b, 0x67, 0x15, 0x0c, 0x51, 0xc9, - 0x97, 0x03, 0x28, 0x9a, 0xd1, 0x61, 0x74, 0xb1, 0x08, 0xb1, 0xdd, 0x11, 0x3a, 0x7d, 0xb0, 0xa1, - 0x1c, 0xad, 0x90, 0xed, 0x63, 0xf6, 0x0c, 0x9e, 0x0b, 0x30, 0xa8, 0x8b, 0xae, 0x67, 0x6c, 0xf1, - 0xd6, 0xcf, 0x53, 0x0e, 0xdc, 0x21, 0x20, 0xca, 0xfd, 0x9e, 0xe7, 0x75, 0x41, 0xa0, 0x68, 0x03, - 0x81, 0x57, 0x34, 0x1c, 0xa4, 0x0d, 0xb3, 0xf2, 0x10, 0xf6, 0xb1, 0x2f, 0x09, 0x38, 0xf2, 0x1e, - 0x70, 0x33, 0x5c, 0x74, 0x7b, 0xc3, 0xf1, 0x9c, 0x6e, 0xf0, 0x68, 0xb1, 0xed, 0x1c, 0xba, 0x20, - 0x62, 0xd8, 0x7e, 0x9f, 0x54, 0x85, 0x8a, 0x8e, 0xc3, 0x4c, 0xe1, 0x97, 0x83, 0x35, 0x08, 0x74, - 0xfd, 0x80, 0x8a, 0xe3, 0xbb, 0x18, 0xf4, 0x63, 0x1b, 0xb5, 0x91, 0xc7, 0x0f, 0x2c, 0xea, 0x07, - 0x98, 0x58, 0x45, 0xa2, 0xf5, 0x73, 0xca, 0x68, 0x8f, 0x9e, 0xf7, 0xb2, 0x2c, 0xa7, 0x76, 0xc0, - 0x1f, 0x0f, 0x28, 0x32, 0x0b, 0x17, 0x9f, 0x57, 0x4d, 0x07, 0x63, 0x5f, 0x99, 0xfe, 0x98, 0x62, - 0xc3, 0x82, 0x50, 0x12, 0x04, 0x50, 0xec, 0xb9, 0x23, 0x45, 0x4a, 0x2e, 0x90, 0xad, 0x7e, 0x83, - 0xed, 0xbe, 0x06, 0x3a, 0x20, 0x3d, 0x29, 0xc5, 0x64, 0xa0, 0xf3, 0x2a, 0x9b, 0xe1, 0x14, 0x89, - 0xc5, 0x08, 0xe5, 0xb7, 0xe0, 0xab, 0x32, 0xe2, 0x60, 0x64, 0x01, 0x58, 0x4c, 0x18, 0x45, 0x02, - 0xc8, 0x84, 0x61, 0x0c, 0x20, 0x09, 0x62, 0xb9, 0x10, 0x2e, 0xf3, 0x07, 0x20, 0x9a, 0xb7, 0x47, - 0x9e, 0x19, 0x0f, 0x3a, 0x6b, 0xbd, 0x2d, 0xee, 0x4d, 0x9a, 0xbb, 0xcf, 0x4e, 0x2e, 0x3e, 0x3f, - 0x24, 0x57, 0x02, 0xd1, 0x5f, 0xa6, 0x44, 0x71, 0xd2, 0x3c, 0xa3, 0x3d, 0xa6, 0xc0, 0x72, 0x55, - 0xcc, 0x98, 0xc1, 0x54, 0xd6, 0xbf, 0xe2, 0x98, 0xc5, 0xa0, 0x41, 0xe1, 0x43, 0x21, 0x82, 0x5f, - 0x13, 0xf7, 0x25, 0xa2, 0x6d, 0xe2, 0xa4, 0xd8, 0xf5, 0xe8, 0xc9, 0x35, 0x31, 0xe6, 0x5c, 0x6f, - 0xd3, 0x71, 0xba, 0x68, 0x14, 0x2e, 0xb3, 0x17, 0xb8, 0x11, 0x1f, 0x23, 0x64, 0x3e, 0xcb, 0x9a, - 0x9e, 0xe2, 0xec, 0x02, 0xf0, 0x71, 0xf4, 0x10, 0x27, 0x0c, 0x18, 0xb8, 0x10, 0xfa, 0xe3, 0x40, - 0x6e, 0x9c, 0xb7, 0x8e, 0xa6, 0x4f, 0x48, 0xc6, 0xc0, 0x32, 0x4c, 0xcc, 0xb1, 0x50, 0x58, 0x11, - 0xfb, 0x00, 0x1c, 0x7c, 0xf0, 0x48, 0xcf, 0xd0, 0x98, 0x9e, 0x36, 0x53, 0xfd, 0xa5, 0x49, 0x33, - 0xdd, 0x14, 0x6f, 0x85, 0x67, 0x1a, 0x3a, 0xa7, 0xe0, 0x40, 0x4e, 0x03, 0xfb, 0x9f, 0x61, 0x00, - 0x0c, 0xe6, 0x31, 0x71, 0x9c, 0x53, 0x00, 0x3f, 0xf1, 0x80, 0x5f, 0x8b, 0x92, 0x1f, 0xf5, 0xbe, - 0xe5, 0x11, 0x09, 0x17, 0x0a, 0xa8, 0x7f, 0x2d, 0x1b, 0xa5, 0x94, 0xd1, 0x76, 0x3a, 0xa1, 0x96, - 0xe8, 0x00, 0x02, 0x3a, 0xf4, 0x88, 0x97, 0x4f, 0x19, 0xc1, 0x91, 0x4f, 0xeb, 0x0a, 0x3c, 0x1b, - 0xf5, 0x3b, 0x29, 0xfc, 0x61, 0x4a, 0x2c, 0xa0, 0xf6, 0x60, 0xd3, 0x75, 0x7a, 0x5d, 0xb8, 0x08, - 0x0b, 0x14, 0xff, 0xd9, 0x88, 0x7a, 0x74, 0xb9, 0x58, 0x31, 0xc7, 0xc0, 0xb6, 0xc4, 0xa5, 0x5d, - 0x07, 0x2e, 0x2d, 0xa9, 0xc2, 0xc6, 0x1f, 0x55, 0xca, 0x35, 0x37, 0x76, 0xfb, 0xa3, 0x07, 0x6b, - 0xa6, 0xce, 0x44, 0x95, 0xbe, 0xff, 0xae, 0xc9, 0xbf, 0x91, 0x7e, 0x05, 0x70, 0x3a, 0x50, 0x6b, - 0x2e, 0xd5, 0xee, 0x1b, 0x07, 0x3d, 0xaf, 0xad, 0x58, 0x3d, 0x22, 0x13, 0x85, 0x56, 0x10, 0x94, - 0x81, 0xfc, 0xb6, 0x36, 0xc4, 0x22, 0xcd, 0xf8, 0x00, 0xe7, 0xaf, 0x36, 0xe1, 0xed, 0xb3, 0x6d, - 0x82, 0x5e, 0x77, 0xe1, 0x77, 0x53, 0xc8, 0xba, 0xf2, 0x96, 0x10, 0x49, 0x90, 0x7f, 0xdb, 0x2f, - 0x1c, 0x44, 0xdd, 0xd2, 0x9b, 0xf4, 0x2d, 0xb1, 0x88, 0xcf, 0x96, 0xd5, 0xb7, 0x38, 0x60, 0xf2, - 0x95, 0xf0, 0xfe, 0xb4, 0xa0, 0x01, 0xef, 0xe5, 0x63, 0xe3, 0x95, 0x95, 0x0c, 0x5b, 0xc2, 0xfa, - 0xc3, 0xb5, 0xb3, 0xcd, 0xce, 0x2c, 0xb6, 0x76, 0xf9, 0x82, 0x44, 0xaf, 0x22, 0xd9, 0x9b, 0x92, - 0x91, 0x43, 0xc4, 0x02, 0x15, 0x43, 0x0e, 0x9f, 0xf0, 0x95, 0x89, 0x5e, 0xb9, 0xf8, 0x88, 0x93, - 0xee, 0xdc, 0x53, 0x71, 0x7b, 0xe2, 0x94, 0x4e, 0x8b, 0xe5, 0x83, 0x52, 0x35, 0xd0, 0x74, 0xf4, - 0x03, 0x41, 0x66, 0x2a, 0x12, 0xf3, 0x1c, 0xf3, 0x02, 0xbc, 0x31, 0x71, 0x72, 0xd1, 0xa8, 0x39, - 0xd1, 0x89, 0xe5, 0xcb, 0xf8, 0x9a, 0x9b, 0x26, 0xaf, 0x10, 0xfa, 0xfd, 0xe2, 0x59, 0x47, 0x2b, - 0xca, 0x65, 0x17, 0x3e, 0x17, 0x73, 0xf2, 0xcf, 0x89, 0xdc, 0x4f, 0x3c, 0x1f, 0x44, 0x82, 0x2d, - 0xc8, 0xd8, 0x77, 0xf6, 0x39, 0x59, 0x33, 0xf2, 0xb7, 0xa2, 0xcf, 0x3a, 0x87, 0x26, 0x07, 0xb9, - 0xaa, 0xec, 0xb5, 0x3b, 0x47, 0x08, 0xf4, 0x2f, 0xda, 0x30, 0x73, 0xa0, 0x8b, 0xf0, 0x53, 0x7b, - 0x80, 0x5f, 0x36, 0x3c, 0xc0, 0xc9, 0xa5, 0x9e, 0xc3, 0x2d, 0xa1, 0x58, 0x8f, 0x89, 0xfa, 0x38, - 0x68, 0x5a, 0x38, 0xb2, 0x17, 0xc0, 0x4c, 0x90, 0x5c, 0x81, 0x82, 0x70, 0x51, 0x47, 0xf6, 0x0f, - 0xf5, 0xcd, 0xa8, 0x8b, 0xb2, 0x1b, 0xdf, 0x9e, 0x59, 0xb3, 0x86, 0x1c, 0xf3, 0x75, 0x06, 0x16, - 0xeb, 0xae, 0xe9, 0x5e, 0xcc, 0xf3, 0xc0, 0xb8, 0x92, 0xd2, 0x15, 0x76, 0x49, 0x64, 0x49, 0xc3, - 0xcb, 0x73, 0x5e, 0x0b, 0x7c, 0x6b, 0xa8, 0xe1, 0x8e, 0x03, 0x22, 0x0d, 0x7f, 0x1c, 0xb1, 0xa6, - 0x87, 0x09, 0x67, 0xe4, 0x2b, 0x03, 0x3d, 0xe3, 0x47, 0x46, 0xac, 0x45, 0xdd, 0x47, 0x1f, 0x34, - 0x65, 0x07, 0xa5, 0x8c, 0x4a, 0x5e, 0xb4, 0x27, 0x47, 0xc9, 0x47, 0x0f, 0x57, 0xe9, 0x69, 0xf5, - 0x3d, 0x23, 0xdc, 0xa4, 0x31, 0xd2, 0xa0, 0x77, 0x12, 0x4b, 0x43, 0x08, 0x08, 0x2e, 0xf6, 0x41, - 0x34, 0x95, 0x14, 0x00, 0xc1, 0x25, 0x55, 0xe0, 0xab, 0x91, 0xbf, 0x35, 0x32, 0xfc, 0x71, 0xcc, - 0x4d, 0x17, 0x6e, 0x0d, 0x39, 0x3a, 0x75, 0x9c, 0x58, 0x84, 0xcd, 0x59, 0xc4, 0x1c, 0x5c, 0xc2, - 0x61, 0x31, 0xd2, 0x32, 0xf4, 0x86, 0x0c, 0x31, 0x40, 0x23, 0x14, 0xc9, 0xde, 0xb5, 0x9e, 0xde, - 0xab, 0xea, 0x8d, 0xcc, 0xa8, 0x5c, 0x6b, 0xf8, 0xc8, 0x61, 0x30, 0x74, 0x31, 0x10, 0xc0, 0x89, - 0x7c, 0x8b, 0xbe, 0x16, 0x24, 0x6e, 0x60, 0xd3, 0xc2, 0x2b, 0xc5, 0x89, 0x13, 0x52, 0x09, 0x4e, - 0xee, 0x4c, 0x49, 0x70, 0x82, 0x42, 0x1e, 0x41, 0x1c, 0xef, 0xdf, 0x3f, 0x98, 0x29, 0x0c, 0xd1, - 0x8a, 0x1c, 0x5d, 0xa0, 0x8e, 0xfe, 0xa6, 0x17, 0xc8, 0x25, 0x89, 0x0b, 0xa4, 0x11, 0x8c, 0x05, - 0xd2, 0x06, 0xf9, 0x3e, 0x46, 0xed, 0x90, 0x8b, 0x7c, 0xcf, 0xb4, 0x75, 0x67, 0x8d, 0xf7, 0xb5, - 0x36, 0x92, 0xdb, 0x1d, 0x74, 0x7a, 0xca, 0xf3, 0xcf, 0xd2, 0x4e, 0x65, 0xa7, 0xbe, 0x51, 0xe1, - 0xd0, 0x24, 0xd1, 0x90, 0x9d, 0x3a, 0xd3, 0x41, 0x90, 0x47, 0xcc, 0x4c, 0x2d, 0x9c, 0x40, 0xae, - 0x29, 0xee, 0x9a, 0x36, 0xe7, 0x51, 0x62, 0x7b, 0xeb, 0x5f, 0x4d, 0x31, 0x6e, 0xa4, 0x9b, 0xa3, - 0x69, 0x3e, 0xaa, 0x97, 0x00, 0xd6, 0xd5, 0x2b, 0x1f, 0xd4, 0x43, 0x6e, 0xf3, 0x83, 0xf8, 0x84, - 0xfd, 0x88, 0x7f, 0x88, 0x39, 0x20, 0x74, 0x44, 0xa3, 0x96, 0x66, 0x0a, 0xa3, 0xe8, 0x43, 0xc0, - 0xac, 0x4a, 0x79, 0x7e, 0x3b, 0x3e, 0x0b, 0x49, 0x32, 0xe0, 0x22, 0xf8, 0x47, 0xd3, 0x26, 0x80, - 0x31, 0x57, 0xe4, 0x73, 0x7d, 0x6d, 0xcd, 0x4f, 0x07, 0x36, 0x67, 0x02, 0x64, 0xb2, 0xd4, 0xf0, - 0x73, 0x2a, 0xd2, 0x3a, 0x50, 0x21, 0x13, 0x62, 0x49, 0x82, 0x51, 0x24, 0xc1, 0xfc, 0x89, 0x7d, - 0x3e, 0x57, 0xe5, 0x03, 0x65, 0x20, 0xb5, 0x59, 0x89, 0xd4, 0xe2, 0x4a, 0x6c, 0xf9, 0x38, 0xce, - 0x41, 0xe6, 0x24, 0xc9, 0x2b, 0xf4, 0x8f, 0x33, 0x09, 0x8a, 0x6d, 0xb3, 0x93, 0xe9, 0x0e, 0xe0, - 0x3b, 0x06, 0x8f, 0x73, 0xaf, 0x78, 0xa6, 0x7e, 0x45, 0xfe, 0x59, 0xf8, 0x8b, 0xb4, 0x98, 0x0d, - 0xa6, 0xc1, 0x23, 0x85, 0xf2, 0x39, 0x04, 0x2f, 0x8f, 0xd3, 0xd2, 0xc5, 0x4b, 0xbe, 0xb0, 0x34, - 0xe9, 0xf5, 0x59, 0x3f, 0x47, 0x49, 0xb5, 0x49, 0xe1, 0xc2, 0x1f, 0x32, 0x14, 0x29, 0x28, 0xc9, - 0x1d, 0x61, 0x98, 0x04, 0x23, 0x38, 0x43, 0xf8, 0xe4, 0x67, 0x95, 0x4c, 0xda, 0x3e, 0xc0, 0xe0, - 0xb4, 0xc1, 0x5c, 0xe7, 0x94, 0x90, 0xdb, 0xa7, 0xe8, 0x12, 0xca, 0xff, 0x2c, 0x70, 0x7e, 0x59, - 0x2e, 0x74, 0x44, 0x36, 0x31, 0x1d, 0xe9, 0xd9, 0x32, 0x27, 0xc3, 0x3c, 0xa8, 0x84, 0x45, 0xc9, - 0x6c, 0xa8, 0x23, 0xf9, 0xc1, 0xcf, 0xc8, 0x47, 0x59, 0x11, 0x1d, 0x5a, 0x69, 0x00, 0x38, 0x75, - 0xcb, 0x39, 0x06, 0x62, 0xb9, 0xef, 0xf6, 0x01, 0xb5, 0x40, 0x27, 0x19, 0xf6, 0xc3, 0xbe, 0x1f, - 0xbc, 0x2f, 0x52, 0x45, 0x6b, 0xd2, 0x72, 0xf9, 0x1b, 0x29, 0x71, 0xb1, 0xbc, 0x31, 0x3e, 0x3e, - 0x3e, 0xd9, 0xeb, 0xef, 0xa3, 0xab, 0xbc, 0x0a, 0xa8, 0x7b, 0x1f, 0xf8, 0x39, 0x2c, 0x66, 0x26, - 0x4b, 0x1a, 0xb0, 0x0c, 0xdf, 0x2c, 0x8c, 0xcb, 0x14, 0x58, 0x97, 0x48, 0xc8, 0xfa, 0x54, 0x5c, - 0x68, 0xf7, 0x99, 0x9e, 0x98, 0x5d, 0x19, 0x07, 0x9d, 0x2f, 0x56, 0x82, 0xe6, 0x8c, 0x81, 0x10, - 0xb1, 0x47, 0xca, 0xec, 0xbd, 0xfe, 0xb3, 0xbe, 0xf7, 0xa2, 0x8f, 0x1e, 0x0c, 0x89, 0xda, 0x34, - 0x8e, 0xd7, 0xd0, 0x70, 0x3a, 0xee, 0x80, 0x72, 0xac, 0x73, 0x78, 0x34, 0x33, 0xc7, 0xfa, 0xb4, - 0x1e, 0x45, 0x7a, 0x78, 0x45, 0xce, 0x9a, 0xf8, 0xd3, 0x88, 0xad, 0xc1, 0xae, 0x43, 0x6f, 0x88, - 0x6c, 0x72, 0x84, 0x31, 0x43, 0x8b, 0xca, 0x9c, 0xd1, 0xbf, 0x9b, 0x8e, 0x5a, 0x66, 0xe2, 0x5f, - 0xd3, 0xf7, 0xe6, 0xbb, 0x91, 0x5c, 0x8c, 0x2b, 0xf2, 0xe5, 0xcb, 0x59, 0x3a, 0x93, 0xc7, 0x00, - 0xfd, 0xb5, 0x7e, 0x5e, 0x17, 0xda, 0xd2, 0x21, 0x14, 0x73, 0x4a, 0x2d, 0xe8, 0x06, 0xe8, 0x1c, - 0x10, 0x6b, 0x92, 0xfb, 0x06, 0xe6, 0xe7, 0x0b, 0x8a, 0xeb, 0x07, 0x07, 0x0e, 0x22, 0x96, 0x0d, - 0xf9, 0xe6, 0x2f, 0x97, 0x02, 0x7a, 0x7e, 0x39, 0xa8, 0x07, 0xce, 0xa0, 0xdd, 0x73, 0x39, 0xae, - 0x4c, 0x2e, 0x8d, 0x09, 0x3c, 0xcc, 0xba, 0x11, 0xba, 0xb6, 0xf7, 0xd8, 0xf7, 0x34, 0x13, 0xae, - 0xdc, 0x71, 0x7d, 0x1f, 0xc6, 0xe5, 0x1b, 0x99, 0xa3, 0x70, 0xc9, 0x57, 0xca, 0x32, 0xf6, 0x2c, - 0x48, 0x6d, 0xea, 0x65, 0x9a, 0x0c, 0x9c, 0x21, 0x9f, 0xbf, 0x33, 0x58, 0x5d, 0x0a, 0x3f, 0x7f, - 0xdf, 0xc1, 0x60, 0x46, 0xed, 0x5e, 0xf4, 0xbd, 0x78, 0xa2, 0x43, 0x31, 0x10, 0x0c, 0xdf, 0xfd, - 0x81, 0xba, 0x28, 0xe8, 0x3d, 0x80, 0xaf, 0xfc, 0xf0, 0x61, 0x28, 0x85, 0x58, 0x71, 0xbe, 0xc4, - 0x67, 0x17, 0x36, 0x85, 0x74, 0xf2, 0x9f, 0xd1, 0xb5, 0x9e, 0x2f, 0x3c, 0x10, 0x0b, 0xe8, 0x5a, - 0xdd, 0x43, 0x89, 0x22, 0xcc, 0x2a, 0x4e, 0x89, 0xcd, 0xfe, 0x0b, 0x69, 0xbc, 0x28, 0x98, 0xb8, - 0x37, 0x88, 0x1c, 0xa6, 0x3c, 0xa2, 0x63, 0x5c, 0x29, 0xb9, 0x68, 0x06, 0x81, 0x36, 0x83, 0x1c, - 0x7d, 0xf8, 0x48, 0xdd, 0x7d, 0xee, 0x48, 0x62, 0x8b, 0xc6, 0x77, 0x85, 0x10, 0xec, 0x21, 0x10, - 0x89, 0xb6, 0xe2, 0x4e, 0x65, 0x98, 0x5d, 0x59, 0xd5, 0x75, 0x87, 0x61, 0x34, 0x75, 0xe8, 0x98, - 0x11, 0x13, 0x03, 0x1c, 0x77, 0xa8, 0x82, 0x68, 0x2f, 0x1b, 0x85, 0x86, 0xdb, 0xd9, 0x2d, 0x71, - 0x6d, 0x3c, 0x00, 0xac, 0x85, 0xd4, 0x48, 0x47, 0x40, 0x33, 0xb8, 0xfe, 0x05, 0xad, 0x71, 0xa3, - 0xf7, 0x9c, 0xe4, 0xa0, 0x4a, 0x5a, 0x55, 0xa9, 0xe3, 0x8e, 0xd9, 0x48, 0x1f, 0xad, 0xbd, 0xff, - 0xee, 0x5e, 0x5f, 0x6a, 0xcb, 0x9c, 0xae, 0x65, 0x45, 0x6f, 0xad, 0x94, 0x3c, 0xb0, 0x5d, 0x93, - 0x5b, 0x59, 0x0f, 0xa2, 0xa8, 0x0b, 0xf0, 0xf8, 0x67, 0xd8, 0x48, 0x9b, 0x42, 0xe1, 0x4c, 0x94, - 0x4f, 0x9f, 0xb2, 0xa0, 0xfe, 0x79, 0x3a, 0xea, 0x16, 0x15, 0xed, 0x35, 0x59, 0x0e, 0x01, 0xb2, - 0x45, 0xc3, 0x29, 0x29, 0x24, 0x81, 0x6c, 0x25, 0x8e, 0x54, 0xa4, 0xd2, 0xc2, 0xcf, 0x88, 0x05, - 0xed, 0x4f, 0x27, 0xb3, 0xb3, 0xf1, 0x8f, 0xe0, 0xbc, 0x55, 0x2e, 0xb0, 0x88, 0x1f, 0x30, 0xbd, - 0xf7, 0x1a, 0xc1, 0x4d, 0x1a, 0x68, 0x67, 0xef, 0xa8, 0xfb, 0x65, 0xe1, 0xfb, 0x62, 0xe6, 0x33, - 0x25, 0x9b, 0x69, 0x47, 0x46, 0x1e, 0xb5, 0x2e, 0x2e, 0x06, 0x14, 0x46, 0x7f, 0x35, 0x2c, 0x4b, - 0x9d, 0x61, 0x15, 0x81, 0x33, 0xe0, 0x3b, 0x6c, 0xad, 0x0a, 0xe4, 0x2f, 0xba, 0x6e, 0x4d, 0x60, - 0x2c, 0x9c, 0x6e, 0x7d, 0x9c, 0x14, 0xea, 0xf5, 0x2d, 0x15, 0xef, 0x2f, 0x78, 0xbd, 0x35, 0xf2, - 0x95, 0x53, 0x6a, 0xec, 0x2d, 0x43, 0x47, 0xe9, 0xb0, 0x13, 0x5a, 0x9b, 0xc7, 0x13, 0x7e, 0x52, - 0x71, 0x0f, 0x03, 0x16, 0xa3, 0xfa, 0x3f, 0xee, 0x4d, 0xdc, 0xdc, 0xa8, 0x47, 0xc7, 0xb1, 0x7e, - 0x2e, 0xea, 0x28, 0x21, 0x9d, 0xd0, 0xf0, 0xfd, 0xa5, 0x14, 0x6b, 0x5e, 0x11, 0x57, 0x13, 0xf3, - 0xfe, 0x1a, 0x9e, 0x62, 0x24, 0xc3, 0xb0, 0x6c, 0x15, 0x73, 0x75, 0xff, 0xe9, 0x28, 0x94, 0x1b, - 0x5f, 0xc0, 0x50, 0xd5, 0x67, 0x19, 0x1f, 0x30, 0xc0, 0x33, 0x68, 0x1a, 0x1f, 0xbc, 0x1d, 0x33, - 0x10, 0x04, 0x83, 0x53, 0xf0, 0x8c, 0x33, 0xcf, 0x7f, 0xc0, 0xad, 0xe3, 0x9f, 0xb0, 0xa7, 0xec, - 0xd0, 0x86, 0x73, 0xd6, 0x2f, 0x00, 0x72, 0xea, 0x3a, 0xc9, 0x1f, 0xf8, 0xb3, 0x6c, 0xcc, 0x58, - 0x11, 0x7c, 0x41, 0x1f, 0xf4, 0x19, 0xbe, 0xf1, 0x30, 0x12, 0x1e, 0xff, 0x4e, 0xf1, 0xd4, 0x61, - 0x63, 0xa9, 0xd8, 0xcd, 0x17, 0x57, 0x1c, 0x4b, 0xe4, 0x77, 0x33, 0xc9, 0xa9, 0xd8, 0xaf, 0x8a, - 0x4b, 0x32, 0x15, 0x3b, 0xa7, 0xa0, 0xad, 0xd6, 0x6b, 0xe4, 0x41, 0x07, 0x24, 0x10, 0x28, 0x99, - 0xaa, 0x6a, 0x7e, 0xb6, 0x6d, 0xb7, 0x1a, 0xa5, 0x5a, 0xb3, 0x54, 0x6e, 0x71, 0x1e, 0xa0, 0x8b, - 0x22, 0xa7, 0x2b, 0x37, 0xd0, 0xe9, 0xae, 0x84, 0xa9, 0x7f, 0x8c, 0xd1, 0xc2, 0x91, 0xf8, 0x31, - 0x8f, 0xc3, 0x65, 0x55, 0xa5, 0xf2, 0x01, 0x71, 0x76, 0xa5, 0xdc, 0x0c, 0xe6, 0x09, 0x0e, 0xba, - 0xb5, 0xec, 0x92, 0xaa, 0x99, 0xcb, 0xdf, 0x10, 0x2f, 0x19, 0x03, 0x36, 0x2a, 0x3b, 0xa5, 0x6a, - 0xad, 0x5a, 0xdb, 0xe2, 0xb4, 0xf9, 0x98, 0x2f, 0xeb, 0x82, 0x38, 0x67, 0x36, 0xa8, 0xd7, 0x77, - 0x72, 0x0b, 0x98, 0x17, 0x28, 0xb6, 0xa8, 0x20, 0x51, 0x30, 0xe5, 0xe7, 0xbd, 0x29, 0xae, 0xa9, - 0x26, 0x7b, 0xb5, 0xc7, 0xb5, 0xfa, 0xe7, 0x35, 0x9d, 0xa2, 0x18, 0xb3, 0x7c, 0xe5, 0x16, 0xcd, - 0x49, 0xa9, 0x16, 0x94, 0x16, 0x78, 0xc9, 0x5c, 0xa5, 0xaa, 0xe1, 0x04, 0x02, 0xe8, 0x14, 0x72, - 0x55, 0x7f, 0x19, 0x46, 0xab, 0x73, 0xce, 0x5e, 0x99, 0xe5, 0x7f, 0xc5, 0xec, 0xa9, 0x36, 0x81, - 0xab, 0xce, 0x59, 0x55, 0xd6, 0xab, 0x4e, 0xb8, 0xc2, 0x81, 0x2f, 0xe8, 0xe9, 0x10, 0x64, 0xfd, - 0x5f, 0x29, 0xf5, 0x72, 0x29, 0x01, 0x66, 0x42, 0xaf, 0xda, 0xce, 0x00, 0x8e, 0x1f, 0x47, 0x53, - 0x96, 0xde, 0x2b, 0x9e, 0x69, 0x6c, 0x95, 0x99, 0x11, 0xc5, 0x31, 0x64, 0xe4, 0xbc, 0x61, 0x60, - 0xc8, 0xa5, 0x02, 0x8a, 0x29, 0x89, 0xf2, 0x38, 0xe3, 0xfc, 0xf5, 0xa9, 0x89, 0x16, 0xc3, 0x61, - 0x6d, 0x82, 0x37, 0xcc, 0xac, 0xa1, 0xff, 0x2f, 0xd2, 0xac, 0xcf, 0x61, 0xeb, 0xcf, 0x43, 0xe7, - 0xa8, 0xfd, 0xdc, 0xf5, 0x54, 0x56, 0x83, 0x09, 0x6f, 0x16, 0x22, 0xda, 0x7f, 0xf2, 0x67, 0xfc, - 0xc2, 0x06, 0x09, 0x26, 0x20, 0x4a, 0x30, 0x4b, 0xdf, 0xd3, 0x16, 0x52, 0xe3, 0xfd, 0x80, 0xdb, - 0x97, 0xd9, 0x15, 0xa4, 0xc8, 0x49, 0x59, 0x36, 0xb9, 0xaa, 0x03, 0x32, 0x40, 0x3f, 0x48, 0x5d, - 0x18, 0xbc, 0x38, 0x60, 0x66, 0x40, 0x32, 0x22, 0xc6, 0x58, 0xd2, 0xbf, 0xdd, 0x51, 0x99, 0xf1, - 0x49, 0xd8, 0xe5, 0xcc, 0x0d, 0xac, 0x1c, 0xd0, 0x09, 0xb8, 0x55, 0xb1, 0x4a, 0xb4, 0x22, 0xf4, - 0x76, 0x92, 0xb8, 0xdb, 0x95, 0xed, 0x17, 0x95, 0x78, 0x84, 0x45, 0x2c, 0x31, 0x2d, 0x2b, 0x01, - 0x4d, 0x46, 0xa5, 0x6c, 0x77, 0x50, 0xa0, 0x00, 0x46, 0xf7, 0x10, 0x3e, 0xdb, 0x45, 0x7e, 0xe0, - 0x2e, 0xc8, 0x3c, 0x57, 0x26, 0x44, 0x22, 0xc1, 0xbb, 0x32, 0x2d, 0x4c, 0x09, 0x60, 0x91, 0xfb, - 0xe2, 0xde, 0xe4, 0x16, 0xdb, 0xee, 0x31, 0xd2, 0x94, 0xd2, 0xf3, 0xb6, 0xdb, 0x6b, 0xef, 0x93, - 0x51, 0x10, 0xb0, 0xcb, 0x6b, 0xe2, 0x95, 0x29, 0x83, 0x1e, 0x1c, 0xe0, 0xdb, 0xf0, 0x5c, 0xfa, - 0xee, 0x13, 0x71, 0x31, 0x29, 0x0c, 0x43, 0xfe, 0x9a, 0x98, 0x18, 0x88, 0x01, 0xe6, 0x03, 0x33, - 0x8e, 0xd7, 0x3e, 0xaa, 0x6e, 0x3d, 0xda, 0x86, 0xff, 0x5a, 0xcd, 0x5c, 0xea, 0xee, 0x7f, 0x93, - 0x12, 0xd7, 0x2a, 0x89, 0xaf, 0x71, 0x25, 0x96, 0xe4, 0xf9, 0x4d, 0x69, 0x81, 0x2b, 0x4f, 0xe5, - 0xdf, 0x11, 0x6f, 0x9d, 0xd2, 0xac, 0xd4, 0x43, 0xef, 0xf8, 0x93, 0x0a, 0x71, 0xdd, 0x80, 0x39, - 0xdf, 0x14, 0xb7, 0x4f, 0xe9, 0x21, 0x1f, 0xed, 0x76, 0x01, 0xa1, 0x9e, 0xde, 0xb8, 0x85, 0xa6, - 0x64, 0x60, 0x54, 0x72, 0xd9, 0xbb, 0x7f, 0x07, 0x72, 0x6b, 0x92, 0x73, 0x8a, 0x3c, 0xc0, 0x89, - 0x6e, 0x2b, 0xb0, 0x61, 0x80, 0x67, 0x27, 0xb4, 0xc0, 0x13, 0x81, 0x75, 0x02, 0x4a, 0x9d, 0xd0, - 0x80, 0xbd, 0x8a, 0x60, 0x61, 0x93, 0xc7, 0xc0, 0xf9, 0xc3, 0x62, 0x26, 0x37, 0x40, 0x86, 0x06, - 0x68, 0xc4, 0xab, 0xe2, 0xc6, 0xc4, 0x79, 0xb2, 0x6f, 0x68, 0x6e, 0xe6, 0xee, 0xaf, 0x67, 0xc5, - 0xe5, 0x09, 0x56, 0x8d, 0x5b, 0xe2, 0x66, 0xc4, 0xf0, 0xa3, 0xeb, 0xec, 0x9a, 0xf3, 0x82, 0xbe, - 0xf2, 0x8d, 0xd3, 0x5a, 0xd1, 0x64, 0x53, 0xf9, 0xb7, 0xc5, 0x9b, 0x13, 0x5b, 0x61, 0x93, 0xa6, - 0x03, 0x7c, 0x83, 0x16, 0x88, 0x60, 0xf9, 0x6f, 0x89, 0x37, 0xa6, 0x76, 0x30, 0x5b, 0x67, 0xe4, - 0x7e, 0x26, 0xb7, 0x7e, 0x04, 0x2b, 0x86, 0xdd, 0x78, 0x43, 0xdc, 0x9a, 0xdc, 0x04, 0x7e, 0x7d, - 0xee, 0xf6, 0xb7, 0x3d, 0x10, 0x66, 0x67, 0xe4, 0xf5, 0x4b, 0x6e, 0xb9, 0x49, 0x6f, 0x81, 0xfa, - 0xa3, 0xde, 0x49, 0x10, 0xe6, 0x3c, 0x37, 0x9b, 0xbf, 0x23, 0x5e, 0x9b, 0xdc, 0xc5, 0x88, 0xa3, - 0x0a, 0x34, 0x78, 0xda, 0x3c, 0x76, 0xbd, 0xc1, 0xb8, 0xd7, 0x1e, 0x52, 0xcb, 0x79, 0x79, 0x67, - 0x92, 0x5b, 0x36, 0xdb, 0x3d, 0x7a, 0x86, 0x0e, 0xe4, 0x79, 0xda, 0xb7, 0xb1, 0x19, 0x88, 0xe1, - 0x84, 0xca, 0x80, 0x4c, 0xbf, 0x2e, 0xac, 0x89, 0x4d, 0xcb, 0x1e, 0xe5, 0x3f, 0x73, 0x86, 0xb9, - 0xc5, 0xbb, 0xbf, 0x98, 0x11, 0x97, 0x12, 0x2d, 0x7e, 0x98, 0x69, 0x70, 0xba, 0x31, 0x10, 0x20, - 0x82, 0xe1, 0x2e, 0xb1, 0x8d, 0x7c, 0x39, 0x0f, 0x00, 0x11, 0x9f, 0x4a, 0x30, 0x10, 0xfc, 0xd3, - 0x24, 0xd5, 0x24, 0xc0, 0xc1, 0x5d, 0xf1, 0xfa, 0xa4, 0x76, 0xa4, 0x99, 0x6d, 0x29, 0xc9, 0x52, - 0x5f, 0xef, 0xc4, 0xb6, 0x95, 0x2f, 0x07, 0x20, 0xe1, 0x06, 0x8d, 0xb3, 0x09, 0x70, 0x1b, 0x5a, - 0x09, 0x80, 0x03, 0xc2, 0xc2, 0xb4, 0x69, 0xc2, 0x8f, 0x6d, 0x0a, 0x14, 0x01, 0x00, 0x10, 0x3f, - 0xd5, 0x60, 0x9a, 0xe6, 0x19, 0xcc, 0x25, 0x00, 0xb6, 0x6e, 0xa9, 0x8f, 0x40, 0x6d, 0xd3, 0xfc, - 0xdd, 0x1f, 0xe2, 0x49, 0x24, 0x99, 0x26, 0x50, 0xe5, 0x32, 0xd9, 0x6a, 0x01, 0xa7, 0xc0, 0x1b, - 0x97, 0x58, 0xcf, 0x79, 0x9b, 0xec, 0xad, 0x4a, 0xad, 0xd2, 0xa8, 0x96, 0xf5, 0x61, 0x24, 0xb6, - 0x45, 0xa6, 0x4b, 0xe6, 0xfe, 0x54, 0x97, 0x32, 0xb1, 0x9d, 0xce, 0x15, 0x89, 0xc4, 0x01, 0x93, - 0x7c, 0x66, 0xce, 0xd4, 0xba, 0x5c, 0x2f, 0x95, 0x1f, 0x55, 0x30, 0x69, 0x28, 0x1f, 0x5e, 0x62, - 0xeb, 0x4a, 0x6d, 0xab, 0x5a, 0xab, 0xd8, 0xc0, 0xfd, 0x52, 0x2a, 0x1e, 0x38, 0x16, 0x86, 0xf9, - 0x09, 0x13, 0xb6, 0x81, 0x1f, 0x7f, 0x64, 0x6f, 0x35, 0xea, 0x7b, 0xbb, 0x70, 0x32, 0x4c, 0x52, - 0x92, 0xf7, 0x89, 0x32, 0x9b, 0x52, 0x43, 0x5a, 0x67, 0x7d, 0xb7, 0x52, 0x83, 0x13, 0x9a, 0x32, - 0x93, 0x68, 0x7a, 0xce, 0xf9, 0xfc, 0x6d, 0xf1, 0xea, 0xb4, 0xad, 0x53, 0x0d, 0x17, 0x1e, 0xce, - 0x3c, 0x4a, 0xfd, 0x7c, 0xea, 0x1b, 0xff, 0x22, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xc4, 0xa6, 0x8b, - 0x4b, 0xd8, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client_fantasy.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client_fantasy.pb.go deleted file mode 100644 index e86898f3..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_client_fantasy.pb.go +++ /dev/null @@ -1,6123 +0,0 @@ -// Code generated by protoc-gen-go. -// source: dota_gcmessages_client_fantasy.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type ETournamentGameState int32 - -const ( - ETournamentGameState_k_ETournamentGameState_Unknown ETournamentGameState = 0 - ETournamentGameState_k_ETournamentGameState_Scheduled ETournamentGameState = 1 - ETournamentGameState_k_ETournamentGameState_WaitingForLobbyToStart ETournamentGameState = 2 - ETournamentGameState_k_ETournamentGameState_Active ETournamentGameState = 3 - ETournamentGameState_k_ETournamentGameState_DireVictory ETournamentGameState = 4 - ETournamentGameState_k_ETournamentGameState_RadVictory ETournamentGameState = 5 - ETournamentGameState_k_ETournamentGameState_Canceled ETournamentGameState = 6 - ETournamentGameState_k_ETournamentTeamState_NotNeeded ETournamentGameState = 7 -) - -var ETournamentGameState_name = map[int32]string{ - 0: "k_ETournamentGameState_Unknown", - 1: "k_ETournamentGameState_Scheduled", - 2: "k_ETournamentGameState_WaitingForLobbyToStart", - 3: "k_ETournamentGameState_Active", - 4: "k_ETournamentGameState_DireVictory", - 5: "k_ETournamentGameState_RadVictory", - 6: "k_ETournamentGameState_Canceled", - 7: "k_ETournamentTeamState_NotNeeded", -} -var ETournamentGameState_value = map[string]int32{ - "k_ETournamentGameState_Unknown": 0, - "k_ETournamentGameState_Scheduled": 1, - "k_ETournamentGameState_WaitingForLobbyToStart": 2, - "k_ETournamentGameState_Active": 3, - "k_ETournamentGameState_DireVictory": 4, - "k_ETournamentGameState_RadVictory": 5, - "k_ETournamentGameState_Canceled": 6, - "k_ETournamentTeamState_NotNeeded": 7, -} - -func (x ETournamentGameState) Enum() *ETournamentGameState { - p := new(ETournamentGameState) - *p = x - return p -} -func (x ETournamentGameState) String() string { - return proto.EnumName(ETournamentGameState_name, int32(x)) -} -func (x *ETournamentGameState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETournamentGameState_value, data, "ETournamentGameState") - if err != nil { - return err - } - *x = ETournamentGameState(value) - return nil -} -func (ETournamentGameState) EnumDescriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{0} } - -type ETournamentTeamState int32 - -const ( - ETournamentTeamState_k_ETournamentTeamState_Unknown ETournamentTeamState = 0 - ETournamentTeamState_k_ETournamentTeamState_Node1 ETournamentTeamState = 1 - ETournamentTeamState_k_ETournamentTeamState_NodeMax ETournamentTeamState = 1024 - ETournamentTeamState_k_ETournamentTeamState_Eliminated ETournamentTeamState = 14003 - ETournamentTeamState_k_ETournamentTeamState_Forfeited ETournamentTeamState = 14004 - ETournamentTeamState_k_ETournamentTeamState_Finished1st ETournamentTeamState = 15001 - ETournamentTeamState_k_ETournamentTeamState_Finished2nd ETournamentTeamState = 15002 - ETournamentTeamState_k_ETournamentTeamState_Finished3rd ETournamentTeamState = 15003 - ETournamentTeamState_k_ETournamentTeamState_Finished4th ETournamentTeamState = 15004 - ETournamentTeamState_k_ETournamentTeamState_Finished5th ETournamentTeamState = 15005 - ETournamentTeamState_k_ETournamentTeamState_Finished6th ETournamentTeamState = 15006 - ETournamentTeamState_k_ETournamentTeamState_Finished7th ETournamentTeamState = 15007 - ETournamentTeamState_k_ETournamentTeamState_Finished8th ETournamentTeamState = 15008 - ETournamentTeamState_k_ETournamentTeamState_Finished9th ETournamentTeamState = 15009 - ETournamentTeamState_k_ETournamentTeamState_Finished10th ETournamentTeamState = 15010 - ETournamentTeamState_k_ETournamentTeamState_Finished11th ETournamentTeamState = 15011 - ETournamentTeamState_k_ETournamentTeamState_Finished12th ETournamentTeamState = 15012 - ETournamentTeamState_k_ETournamentTeamState_Finished13th ETournamentTeamState = 15013 - ETournamentTeamState_k_ETournamentTeamState_Finished14th ETournamentTeamState = 15014 - ETournamentTeamState_k_ETournamentTeamState_Finished15th ETournamentTeamState = 15015 - ETournamentTeamState_k_ETournamentTeamState_Finished16th ETournamentTeamState = 15016 -) - -var ETournamentTeamState_name = map[int32]string{ - 0: "k_ETournamentTeamState_Unknown", - 1: "k_ETournamentTeamState_Node1", - 1024: "k_ETournamentTeamState_NodeMax", - 14003: "k_ETournamentTeamState_Eliminated", - 14004: "k_ETournamentTeamState_Forfeited", - 15001: "k_ETournamentTeamState_Finished1st", - 15002: "k_ETournamentTeamState_Finished2nd", - 15003: "k_ETournamentTeamState_Finished3rd", - 15004: "k_ETournamentTeamState_Finished4th", - 15005: "k_ETournamentTeamState_Finished5th", - 15006: "k_ETournamentTeamState_Finished6th", - 15007: "k_ETournamentTeamState_Finished7th", - 15008: "k_ETournamentTeamState_Finished8th", - 15009: "k_ETournamentTeamState_Finished9th", - 15010: "k_ETournamentTeamState_Finished10th", - 15011: "k_ETournamentTeamState_Finished11th", - 15012: "k_ETournamentTeamState_Finished12th", - 15013: "k_ETournamentTeamState_Finished13th", - 15014: "k_ETournamentTeamState_Finished14th", - 15015: "k_ETournamentTeamState_Finished15th", - 15016: "k_ETournamentTeamState_Finished16th", -} -var ETournamentTeamState_value = map[string]int32{ - "k_ETournamentTeamState_Unknown": 0, - "k_ETournamentTeamState_Node1": 1, - "k_ETournamentTeamState_NodeMax": 1024, - "k_ETournamentTeamState_Eliminated": 14003, - "k_ETournamentTeamState_Forfeited": 14004, - "k_ETournamentTeamState_Finished1st": 15001, - "k_ETournamentTeamState_Finished2nd": 15002, - "k_ETournamentTeamState_Finished3rd": 15003, - "k_ETournamentTeamState_Finished4th": 15004, - "k_ETournamentTeamState_Finished5th": 15005, - "k_ETournamentTeamState_Finished6th": 15006, - "k_ETournamentTeamState_Finished7th": 15007, - "k_ETournamentTeamState_Finished8th": 15008, - "k_ETournamentTeamState_Finished9th": 15009, - "k_ETournamentTeamState_Finished10th": 15010, - "k_ETournamentTeamState_Finished11th": 15011, - "k_ETournamentTeamState_Finished12th": 15012, - "k_ETournamentTeamState_Finished13th": 15013, - "k_ETournamentTeamState_Finished14th": 15014, - "k_ETournamentTeamState_Finished15th": 15015, - "k_ETournamentTeamState_Finished16th": 15016, -} - -func (x ETournamentTeamState) Enum() *ETournamentTeamState { - p := new(ETournamentTeamState) - *p = x - return p -} -func (x ETournamentTeamState) String() string { - return proto.EnumName(ETournamentTeamState_name, int32(x)) -} -func (x *ETournamentTeamState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETournamentTeamState_value, data, "ETournamentTeamState") - if err != nil { - return err - } - *x = ETournamentTeamState(value) - return nil -} -func (ETournamentTeamState) EnumDescriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{1} } - -type ETournamentState int32 - -const ( - ETournamentState_k_ETournamentState_Unknown ETournamentState = 0 - ETournamentState_k_ETournamentState_Setup ETournamentState = 1 - ETournamentState_k_ETournamentState_Scheduled ETournamentState = 2 - ETournamentState_k_ETournamentState_InProgress ETournamentState = 3 - ETournamentState_k_ETournamentState_Completed ETournamentState = 4 - ETournamentState_k_ETournamentState_Canceled ETournamentState = 5 -) - -var ETournamentState_name = map[int32]string{ - 0: "k_ETournamentState_Unknown", - 1: "k_ETournamentState_Setup", - 2: "k_ETournamentState_Scheduled", - 3: "k_ETournamentState_InProgress", - 4: "k_ETournamentState_Completed", - 5: "k_ETournamentState_Canceled", -} -var ETournamentState_value = map[string]int32{ - "k_ETournamentState_Unknown": 0, - "k_ETournamentState_Setup": 1, - "k_ETournamentState_Scheduled": 2, - "k_ETournamentState_InProgress": 3, - "k_ETournamentState_Completed": 4, - "k_ETournamentState_Canceled": 5, -} - -func (x ETournamentState) Enum() *ETournamentState { - p := new(ETournamentState) - *p = x - return p -} -func (x ETournamentState) String() string { - return proto.EnumName(ETournamentState_name, int32(x)) -} -func (x *ETournamentState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETournamentState_value, data, "ETournamentState") - if err != nil { - return err - } - *x = ETournamentState(value) - return nil -} -func (ETournamentState) EnumDescriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{2} } - -type ETournamentNodeState int32 - -const ( - ETournamentNodeState_k_ETournamentNodeState_Unknown ETournamentNodeState = 0 - ETournamentNodeState_k_ETournamentNodeState_TeamsNotYetAssigned ETournamentNodeState = 1 - ETournamentNodeState_k_ETournamentNodeState_InBetweenGames ETournamentNodeState = 2 - ETournamentNodeState_k_ETournamentNodeState_GameInProgress ETournamentNodeState = 3 - ETournamentNodeState_k_ETournamentNodeState_A_Won ETournamentNodeState = 4 - ETournamentNodeState_k_ETournamentNodeState_B_Won ETournamentNodeState = 5 - ETournamentNodeState_k_ETournamentNodeState_Canceled ETournamentNodeState = 6 -) - -var ETournamentNodeState_name = map[int32]string{ - 0: "k_ETournamentNodeState_Unknown", - 1: "k_ETournamentNodeState_TeamsNotYetAssigned", - 2: "k_ETournamentNodeState_InBetweenGames", - 3: "k_ETournamentNodeState_GameInProgress", - 4: "k_ETournamentNodeState_A_Won", - 5: "k_ETournamentNodeState_B_Won", - 6: "k_ETournamentNodeState_Canceled", -} -var ETournamentNodeState_value = map[string]int32{ - "k_ETournamentNodeState_Unknown": 0, - "k_ETournamentNodeState_TeamsNotYetAssigned": 1, - "k_ETournamentNodeState_InBetweenGames": 2, - "k_ETournamentNodeState_GameInProgress": 3, - "k_ETournamentNodeState_A_Won": 4, - "k_ETournamentNodeState_B_Won": 5, - "k_ETournamentNodeState_Canceled": 6, -} - -func (x ETournamentNodeState) Enum() *ETournamentNodeState { - p := new(ETournamentNodeState) - *p = x - return p -} -func (x ETournamentNodeState) String() string { - return proto.EnumName(ETournamentNodeState_name, int32(x)) -} -func (x *ETournamentNodeState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETournamentNodeState_value, data, "ETournamentNodeState") - if err != nil { - return err - } - *x = ETournamentNodeState(value) - return nil -} -func (ETournamentNodeState) EnumDescriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{3} } - -type DOTA_2013PassportSelectionIndices int32 - -const ( - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_0 DOTA_2013PassportSelectionIndices = 0 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_1 DOTA_2013PassportSelectionIndices = 1 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_2 DOTA_2013PassportSelectionIndices = 2 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_3 DOTA_2013PassportSelectionIndices = 3 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_4 DOTA_2013PassportSelectionIndices = 4 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_5 DOTA_2013PassportSelectionIndices = 5 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_6 DOTA_2013PassportSelectionIndices = 6 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_7 DOTA_2013PassportSelectionIndices = 7 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_8 DOTA_2013PassportSelectionIndices = 8 - DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_9 DOTA_2013PassportSelectionIndices = 9 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_0 DOTA_2013PassportSelectionIndices = 10 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_1 DOTA_2013PassportSelectionIndices = 11 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_2 DOTA_2013PassportSelectionIndices = 12 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_3 DOTA_2013PassportSelectionIndices = 13 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_4 DOTA_2013PassportSelectionIndices = 14 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_5 DOTA_2013PassportSelectionIndices = 15 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_6 DOTA_2013PassportSelectionIndices = 16 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_7 DOTA_2013PassportSelectionIndices = 17 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_8 DOTA_2013PassportSelectionIndices = 18 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_9 DOTA_2013PassportSelectionIndices = 19 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_10 DOTA_2013PassportSelectionIndices = 20 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_11 DOTA_2013PassportSelectionIndices = 21 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_12 DOTA_2013PassportSelectionIndices = 22 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_13 DOTA_2013PassportSelectionIndices = 23 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_WEST_14 DOTA_2013PassportSelectionIndices = 24 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_0 DOTA_2013PassportSelectionIndices = 25 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_1 DOTA_2013PassportSelectionIndices = 26 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_2 DOTA_2013PassportSelectionIndices = 27 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_3 DOTA_2013PassportSelectionIndices = 28 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_4 DOTA_2013PassportSelectionIndices = 29 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_5 DOTA_2013PassportSelectionIndices = 30 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_6 DOTA_2013PassportSelectionIndices = 31 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_7 DOTA_2013PassportSelectionIndices = 32 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_8 DOTA_2013PassportSelectionIndices = 33 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_9 DOTA_2013PassportSelectionIndices = 34 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_10 DOTA_2013PassportSelectionIndices = 35 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_11 DOTA_2013PassportSelectionIndices = 36 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_12 DOTA_2013PassportSelectionIndices = 37 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_13 DOTA_2013PassportSelectionIndices = 38 - DOTA_2013PassportSelectionIndices_PP13_SEL_QUALPRED_EAST_14 DOTA_2013PassportSelectionIndices = 39 - DOTA_2013PassportSelectionIndices_PP13_SEL_TEAMCUP_TEAM DOTA_2013PassportSelectionIndices = 40 - DOTA_2013PassportSelectionIndices_PP13_SEL_TEAMCUP_PLAYER DOTA_2013PassportSelectionIndices = 41 - DOTA_2013PassportSelectionIndices_PP13_SEL_TEAMCUP_TEAM_LOCK DOTA_2013PassportSelectionIndices = 42 - DOTA_2013PassportSelectionIndices_PP13_SEL_TEAMCUP_PLAYER_LOCK DOTA_2013PassportSelectionIndices = 43 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_0 DOTA_2013PassportSelectionIndices = 44 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_1 DOTA_2013PassportSelectionIndices = 45 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_2 DOTA_2013PassportSelectionIndices = 46 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_3 DOTA_2013PassportSelectionIndices = 47 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_4 DOTA_2013PassportSelectionIndices = 48 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_5 DOTA_2013PassportSelectionIndices = 49 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_6 DOTA_2013PassportSelectionIndices = 50 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_7 DOTA_2013PassportSelectionIndices = 51 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_8 DOTA_2013PassportSelectionIndices = 52 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_9 DOTA_2013PassportSelectionIndices = 53 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_10 DOTA_2013PassportSelectionIndices = 54 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_11 DOTA_2013PassportSelectionIndices = 55 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_12 DOTA_2013PassportSelectionIndices = 56 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_13 DOTA_2013PassportSelectionIndices = 57 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_14 DOTA_2013PassportSelectionIndices = 58 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_15 DOTA_2013PassportSelectionIndices = 59 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_16 DOTA_2013PassportSelectionIndices = 60 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_17 DOTA_2013PassportSelectionIndices = 61 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_18 DOTA_2013PassportSelectionIndices = 62 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_19 DOTA_2013PassportSelectionIndices = 63 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_20 DOTA_2013PassportSelectionIndices = 64 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_21 DOTA_2013PassportSelectionIndices = 65 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_22 DOTA_2013PassportSelectionIndices = 66 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_23 DOTA_2013PassportSelectionIndices = 67 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_24 DOTA_2013PassportSelectionIndices = 68 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_25 DOTA_2013PassportSelectionIndices = 69 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_26 DOTA_2013PassportSelectionIndices = 70 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_27 DOTA_2013PassportSelectionIndices = 71 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_28 DOTA_2013PassportSelectionIndices = 72 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_29 DOTA_2013PassportSelectionIndices = 73 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_30 DOTA_2013PassportSelectionIndices = 74 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_31 DOTA_2013PassportSelectionIndices = 75 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_32 DOTA_2013PassportSelectionIndices = 76 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_33 DOTA_2013PassportSelectionIndices = 77 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_34 DOTA_2013PassportSelectionIndices = 78 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_35 DOTA_2013PassportSelectionIndices = 79 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_36 DOTA_2013PassportSelectionIndices = 80 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_37 DOTA_2013PassportSelectionIndices = 81 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_38 DOTA_2013PassportSelectionIndices = 82 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_39 DOTA_2013PassportSelectionIndices = 83 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_40 DOTA_2013PassportSelectionIndices = 84 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_41 DOTA_2013PassportSelectionIndices = 85 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_42 DOTA_2013PassportSelectionIndices = 86 - DOTA_2013PassportSelectionIndices_PP13_SEL_EVENTPRED_43 DOTA_2013PassportSelectionIndices = 87 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_0 DOTA_2013PassportSelectionIndices = 88 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_1 DOTA_2013PassportSelectionIndices = 89 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_2 DOTA_2013PassportSelectionIndices = 90 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_3 DOTA_2013PassportSelectionIndices = 91 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_4 DOTA_2013PassportSelectionIndices = 92 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_5 DOTA_2013PassportSelectionIndices = 93 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_6 DOTA_2013PassportSelectionIndices = 94 - DOTA_2013PassportSelectionIndices_PP13_SEL_SOLO_7 DOTA_2013PassportSelectionIndices = 95 -) - -var DOTA_2013PassportSelectionIndices_name = map[int32]string{ - 0: "PP13_SEL_ALLSTAR_PLAYER_0", - 1: "PP13_SEL_ALLSTAR_PLAYER_1", - 2: "PP13_SEL_ALLSTAR_PLAYER_2", - 3: "PP13_SEL_ALLSTAR_PLAYER_3", - 4: "PP13_SEL_ALLSTAR_PLAYER_4", - 5: "PP13_SEL_ALLSTAR_PLAYER_5", - 6: "PP13_SEL_ALLSTAR_PLAYER_6", - 7: "PP13_SEL_ALLSTAR_PLAYER_7", - 8: "PP13_SEL_ALLSTAR_PLAYER_8", - 9: "PP13_SEL_ALLSTAR_PLAYER_9", - 10: "PP13_SEL_QUALPRED_WEST_0", - 11: "PP13_SEL_QUALPRED_WEST_1", - 12: "PP13_SEL_QUALPRED_WEST_2", - 13: "PP13_SEL_QUALPRED_WEST_3", - 14: "PP13_SEL_QUALPRED_WEST_4", - 15: "PP13_SEL_QUALPRED_WEST_5", - 16: "PP13_SEL_QUALPRED_WEST_6", - 17: "PP13_SEL_QUALPRED_WEST_7", - 18: "PP13_SEL_QUALPRED_WEST_8", - 19: "PP13_SEL_QUALPRED_WEST_9", - 20: "PP13_SEL_QUALPRED_WEST_10", - 21: "PP13_SEL_QUALPRED_WEST_11", - 22: "PP13_SEL_QUALPRED_WEST_12", - 23: "PP13_SEL_QUALPRED_WEST_13", - 24: "PP13_SEL_QUALPRED_WEST_14", - 25: "PP13_SEL_QUALPRED_EAST_0", - 26: "PP13_SEL_QUALPRED_EAST_1", - 27: "PP13_SEL_QUALPRED_EAST_2", - 28: "PP13_SEL_QUALPRED_EAST_3", - 29: "PP13_SEL_QUALPRED_EAST_4", - 30: "PP13_SEL_QUALPRED_EAST_5", - 31: "PP13_SEL_QUALPRED_EAST_6", - 32: "PP13_SEL_QUALPRED_EAST_7", - 33: "PP13_SEL_QUALPRED_EAST_8", - 34: "PP13_SEL_QUALPRED_EAST_9", - 35: "PP13_SEL_QUALPRED_EAST_10", - 36: "PP13_SEL_QUALPRED_EAST_11", - 37: "PP13_SEL_QUALPRED_EAST_12", - 38: "PP13_SEL_QUALPRED_EAST_13", - 39: "PP13_SEL_QUALPRED_EAST_14", - 40: "PP13_SEL_TEAMCUP_TEAM", - 41: "PP13_SEL_TEAMCUP_PLAYER", - 42: "PP13_SEL_TEAMCUP_TEAM_LOCK", - 43: "PP13_SEL_TEAMCUP_PLAYER_LOCK", - 44: "PP13_SEL_EVENTPRED_0", - 45: "PP13_SEL_EVENTPRED_1", - 46: "PP13_SEL_EVENTPRED_2", - 47: "PP13_SEL_EVENTPRED_3", - 48: "PP13_SEL_EVENTPRED_4", - 49: "PP13_SEL_EVENTPRED_5", - 50: "PP13_SEL_EVENTPRED_6", - 51: "PP13_SEL_EVENTPRED_7", - 52: "PP13_SEL_EVENTPRED_8", - 53: "PP13_SEL_EVENTPRED_9", - 54: "PP13_SEL_EVENTPRED_10", - 55: "PP13_SEL_EVENTPRED_11", - 56: "PP13_SEL_EVENTPRED_12", - 57: "PP13_SEL_EVENTPRED_13", - 58: "PP13_SEL_EVENTPRED_14", - 59: "PP13_SEL_EVENTPRED_15", - 60: "PP13_SEL_EVENTPRED_16", - 61: "PP13_SEL_EVENTPRED_17", - 62: "PP13_SEL_EVENTPRED_18", - 63: "PP13_SEL_EVENTPRED_19", - 64: "PP13_SEL_EVENTPRED_20", - 65: "PP13_SEL_EVENTPRED_21", - 66: "PP13_SEL_EVENTPRED_22", - 67: "PP13_SEL_EVENTPRED_23", - 68: "PP13_SEL_EVENTPRED_24", - 69: "PP13_SEL_EVENTPRED_25", - 70: "PP13_SEL_EVENTPRED_26", - 71: "PP13_SEL_EVENTPRED_27", - 72: "PP13_SEL_EVENTPRED_28", - 73: "PP13_SEL_EVENTPRED_29", - 74: "PP13_SEL_EVENTPRED_30", - 75: "PP13_SEL_EVENTPRED_31", - 76: "PP13_SEL_EVENTPRED_32", - 77: "PP13_SEL_EVENTPRED_33", - 78: "PP13_SEL_EVENTPRED_34", - 79: "PP13_SEL_EVENTPRED_35", - 80: "PP13_SEL_EVENTPRED_36", - 81: "PP13_SEL_EVENTPRED_37", - 82: "PP13_SEL_EVENTPRED_38", - 83: "PP13_SEL_EVENTPRED_39", - 84: "PP13_SEL_EVENTPRED_40", - 85: "PP13_SEL_EVENTPRED_41", - 86: "PP13_SEL_EVENTPRED_42", - 87: "PP13_SEL_EVENTPRED_43", - 88: "PP13_SEL_SOLO_0", - 89: "PP13_SEL_SOLO_1", - 90: "PP13_SEL_SOLO_2", - 91: "PP13_SEL_SOLO_3", - 92: "PP13_SEL_SOLO_4", - 93: "PP13_SEL_SOLO_5", - 94: "PP13_SEL_SOLO_6", - 95: "PP13_SEL_SOLO_7", -} -var DOTA_2013PassportSelectionIndices_value = map[string]int32{ - "PP13_SEL_ALLSTAR_PLAYER_0": 0, - "PP13_SEL_ALLSTAR_PLAYER_1": 1, - "PP13_SEL_ALLSTAR_PLAYER_2": 2, - "PP13_SEL_ALLSTAR_PLAYER_3": 3, - "PP13_SEL_ALLSTAR_PLAYER_4": 4, - "PP13_SEL_ALLSTAR_PLAYER_5": 5, - "PP13_SEL_ALLSTAR_PLAYER_6": 6, - "PP13_SEL_ALLSTAR_PLAYER_7": 7, - "PP13_SEL_ALLSTAR_PLAYER_8": 8, - "PP13_SEL_ALLSTAR_PLAYER_9": 9, - "PP13_SEL_QUALPRED_WEST_0": 10, - "PP13_SEL_QUALPRED_WEST_1": 11, - "PP13_SEL_QUALPRED_WEST_2": 12, - "PP13_SEL_QUALPRED_WEST_3": 13, - "PP13_SEL_QUALPRED_WEST_4": 14, - "PP13_SEL_QUALPRED_WEST_5": 15, - "PP13_SEL_QUALPRED_WEST_6": 16, - "PP13_SEL_QUALPRED_WEST_7": 17, - "PP13_SEL_QUALPRED_WEST_8": 18, - "PP13_SEL_QUALPRED_WEST_9": 19, - "PP13_SEL_QUALPRED_WEST_10": 20, - "PP13_SEL_QUALPRED_WEST_11": 21, - "PP13_SEL_QUALPRED_WEST_12": 22, - "PP13_SEL_QUALPRED_WEST_13": 23, - "PP13_SEL_QUALPRED_WEST_14": 24, - "PP13_SEL_QUALPRED_EAST_0": 25, - "PP13_SEL_QUALPRED_EAST_1": 26, - "PP13_SEL_QUALPRED_EAST_2": 27, - "PP13_SEL_QUALPRED_EAST_3": 28, - "PP13_SEL_QUALPRED_EAST_4": 29, - "PP13_SEL_QUALPRED_EAST_5": 30, - "PP13_SEL_QUALPRED_EAST_6": 31, - "PP13_SEL_QUALPRED_EAST_7": 32, - "PP13_SEL_QUALPRED_EAST_8": 33, - "PP13_SEL_QUALPRED_EAST_9": 34, - "PP13_SEL_QUALPRED_EAST_10": 35, - "PP13_SEL_QUALPRED_EAST_11": 36, - "PP13_SEL_QUALPRED_EAST_12": 37, - "PP13_SEL_QUALPRED_EAST_13": 38, - "PP13_SEL_QUALPRED_EAST_14": 39, - "PP13_SEL_TEAMCUP_TEAM": 40, - "PP13_SEL_TEAMCUP_PLAYER": 41, - "PP13_SEL_TEAMCUP_TEAM_LOCK": 42, - "PP13_SEL_TEAMCUP_PLAYER_LOCK": 43, - "PP13_SEL_EVENTPRED_0": 44, - "PP13_SEL_EVENTPRED_1": 45, - "PP13_SEL_EVENTPRED_2": 46, - "PP13_SEL_EVENTPRED_3": 47, - "PP13_SEL_EVENTPRED_4": 48, - "PP13_SEL_EVENTPRED_5": 49, - "PP13_SEL_EVENTPRED_6": 50, - "PP13_SEL_EVENTPRED_7": 51, - "PP13_SEL_EVENTPRED_8": 52, - "PP13_SEL_EVENTPRED_9": 53, - "PP13_SEL_EVENTPRED_10": 54, - "PP13_SEL_EVENTPRED_11": 55, - "PP13_SEL_EVENTPRED_12": 56, - "PP13_SEL_EVENTPRED_13": 57, - "PP13_SEL_EVENTPRED_14": 58, - "PP13_SEL_EVENTPRED_15": 59, - "PP13_SEL_EVENTPRED_16": 60, - "PP13_SEL_EVENTPRED_17": 61, - "PP13_SEL_EVENTPRED_18": 62, - "PP13_SEL_EVENTPRED_19": 63, - "PP13_SEL_EVENTPRED_20": 64, - "PP13_SEL_EVENTPRED_21": 65, - "PP13_SEL_EVENTPRED_22": 66, - "PP13_SEL_EVENTPRED_23": 67, - "PP13_SEL_EVENTPRED_24": 68, - "PP13_SEL_EVENTPRED_25": 69, - "PP13_SEL_EVENTPRED_26": 70, - "PP13_SEL_EVENTPRED_27": 71, - "PP13_SEL_EVENTPRED_28": 72, - "PP13_SEL_EVENTPRED_29": 73, - "PP13_SEL_EVENTPRED_30": 74, - "PP13_SEL_EVENTPRED_31": 75, - "PP13_SEL_EVENTPRED_32": 76, - "PP13_SEL_EVENTPRED_33": 77, - "PP13_SEL_EVENTPRED_34": 78, - "PP13_SEL_EVENTPRED_35": 79, - "PP13_SEL_EVENTPRED_36": 80, - "PP13_SEL_EVENTPRED_37": 81, - "PP13_SEL_EVENTPRED_38": 82, - "PP13_SEL_EVENTPRED_39": 83, - "PP13_SEL_EVENTPRED_40": 84, - "PP13_SEL_EVENTPRED_41": 85, - "PP13_SEL_EVENTPRED_42": 86, - "PP13_SEL_EVENTPRED_43": 87, - "PP13_SEL_SOLO_0": 88, - "PP13_SEL_SOLO_1": 89, - "PP13_SEL_SOLO_2": 90, - "PP13_SEL_SOLO_3": 91, - "PP13_SEL_SOLO_4": 92, - "PP13_SEL_SOLO_5": 93, - "PP13_SEL_SOLO_6": 94, - "PP13_SEL_SOLO_7": 95, -} - -func (x DOTA_2013PassportSelectionIndices) Enum() *DOTA_2013PassportSelectionIndices { - p := new(DOTA_2013PassportSelectionIndices) - *p = x - return p -} -func (x DOTA_2013PassportSelectionIndices) String() string { - return proto.EnumName(DOTA_2013PassportSelectionIndices_name, int32(x)) -} -func (x *DOTA_2013PassportSelectionIndices) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_2013PassportSelectionIndices_value, data, "DOTA_2013PassportSelectionIndices") - if err != nil { - return err - } - *x = DOTA_2013PassportSelectionIndices(value) - return nil -} -func (DOTA_2013PassportSelectionIndices) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{4} -} - -type CMsgDOTACreateFantasyLeagueResponse_EResult int32 - -const ( - CMsgDOTACreateFantasyLeagueResponse_SUCCESS CMsgDOTACreateFantasyLeagueResponse_EResult = 0 - CMsgDOTACreateFantasyLeagueResponse_ERROR_UNSPECIFIED CMsgDOTACreateFantasyLeagueResponse_EResult = 1 - CMsgDOTACreateFantasyLeagueResponse_ERROR_TOO_MANY_LEAGUES CMsgDOTACreateFantasyLeagueResponse_EResult = 2 - CMsgDOTACreateFantasyLeagueResponse_ERROR_INVALID_TEAM_COUNT CMsgDOTACreateFantasyLeagueResponse_EResult = 3 - CMsgDOTACreateFantasyLeagueResponse_ERROR_CREATION_DISABLED CMsgDOTACreateFantasyLeagueResponse_EResult = 4 -) - -var CMsgDOTACreateFantasyLeagueResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_TOO_MANY_LEAGUES", - 3: "ERROR_INVALID_TEAM_COUNT", - 4: "ERROR_CREATION_DISABLED", -} -var CMsgDOTACreateFantasyLeagueResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_TOO_MANY_LEAGUES": 2, - "ERROR_INVALID_TEAM_COUNT": 3, - "ERROR_CREATION_DISABLED": 4, -} - -func (x CMsgDOTACreateFantasyLeagueResponse_EResult) Enum() *CMsgDOTACreateFantasyLeagueResponse_EResult { - p := new(CMsgDOTACreateFantasyLeagueResponse_EResult) - *p = x - return p -} -func (x CMsgDOTACreateFantasyLeagueResponse_EResult) String() string { - return proto.EnumName(CMsgDOTACreateFantasyLeagueResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTACreateFantasyLeagueResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTACreateFantasyLeagueResponse_EResult_value, data, "CMsgDOTACreateFantasyLeagueResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTACreateFantasyLeagueResponse_EResult(value) - return nil -} -func (CMsgDOTACreateFantasyLeagueResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{2, 0} -} - -type CMsgDOTAFantasyLeagueEditInfoResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueEditInfoResponse_SUCCESS CMsgDOTAFantasyLeagueEditInfoResponse_EResult = 0 - CMsgDOTAFantasyLeagueEditInfoResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueEditInfoResponse_EResult = 1 - CMsgDOTAFantasyLeagueEditInfoResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyLeagueEditInfoResponse_EResult = 2 -) - -var CMsgDOTAFantasyLeagueEditInfoResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyLeagueEditInfoResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyLeagueEditInfoResponse_EResult) Enum() *CMsgDOTAFantasyLeagueEditInfoResponse_EResult { - p := new(CMsgDOTAFantasyLeagueEditInfoResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueEditInfoResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueEditInfoResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueEditInfoResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueEditInfoResponse_EResult_value, data, "CMsgDOTAFantasyLeagueEditInfoResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueEditInfoResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueEditInfoResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{6, 0} -} - -type CMsgDOTAFantasyLeagueFindResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueFindResponse_SUCCESS CMsgDOTAFantasyLeagueFindResponse_EResult = 0 - CMsgDOTAFantasyLeagueFindResponse_ERROR_LEAGUE_NOT_FOUND CMsgDOTAFantasyLeagueFindResponse_EResult = 1 - CMsgDOTAFantasyLeagueFindResponse_ERROR_BAD_PASSWORD CMsgDOTAFantasyLeagueFindResponse_EResult = 2 - CMsgDOTAFantasyLeagueFindResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueFindResponse_EResult = 3 - CMsgDOTAFantasyLeagueFindResponse_ERROR_FULL CMsgDOTAFantasyLeagueFindResponse_EResult = 4 - CMsgDOTAFantasyLeagueFindResponse_ERROR_ALREADY_MEMBER CMsgDOTAFantasyLeagueFindResponse_EResult = 5 - CMsgDOTAFantasyLeagueFindResponse_ERROR_LEAGUE_LOCKED CMsgDOTAFantasyLeagueFindResponse_EResult = 6 -) - -var CMsgDOTAFantasyLeagueFindResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_LEAGUE_NOT_FOUND", - 2: "ERROR_BAD_PASSWORD", - 3: "ERROR_UNSPECIFIED", - 4: "ERROR_FULL", - 5: "ERROR_ALREADY_MEMBER", - 6: "ERROR_LEAGUE_LOCKED", -} -var CMsgDOTAFantasyLeagueFindResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_LEAGUE_NOT_FOUND": 1, - "ERROR_BAD_PASSWORD": 2, - "ERROR_UNSPECIFIED": 3, - "ERROR_FULL": 4, - "ERROR_ALREADY_MEMBER": 5, - "ERROR_LEAGUE_LOCKED": 6, -} - -func (x CMsgDOTAFantasyLeagueFindResponse_EResult) Enum() *CMsgDOTAFantasyLeagueFindResponse_EResult { - p := new(CMsgDOTAFantasyLeagueFindResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueFindResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueFindResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueFindResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueFindResponse_EResult_value, data, "CMsgDOTAFantasyLeagueFindResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueFindResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueFindResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{8, 0} -} - -type CMsgDOTAFantasyLeagueInfoResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueInfoResponse_SUCCESS CMsgDOTAFantasyLeagueInfoResponse_EResult = 0 - CMsgDOTAFantasyLeagueInfoResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueInfoResponse_EResult = 1 - CMsgDOTAFantasyLeagueInfoResponse_ERROR_BAD_LEAGUE_ID CMsgDOTAFantasyLeagueInfoResponse_EResult = 2 -) - -var CMsgDOTAFantasyLeagueInfoResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_BAD_LEAGUE_ID", -} -var CMsgDOTAFantasyLeagueInfoResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_BAD_LEAGUE_ID": 2, -} - -func (x CMsgDOTAFantasyLeagueInfoResponse_EResult) Enum() *CMsgDOTAFantasyLeagueInfoResponse_EResult { - p := new(CMsgDOTAFantasyLeagueInfoResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueInfoResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueInfoResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueInfoResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueInfoResponse_EResult_value, data, "CMsgDOTAFantasyLeagueInfoResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueInfoResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueInfoResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{10, 0} -} - -type CMsgDOTAFantasyLeagueMatchupsResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueMatchupsResponse_SUCCESS CMsgDOTAFantasyLeagueMatchupsResponse_EResult = 0 - CMsgDOTAFantasyLeagueMatchupsResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueMatchupsResponse_EResult = 1 - CMsgDOTAFantasyLeagueMatchupsResponse_ERROR_BAD_LEAGUE_ID CMsgDOTAFantasyLeagueMatchupsResponse_EResult = 2 - CMsgDOTAFantasyLeagueMatchupsResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyLeagueMatchupsResponse_EResult = 3 -) - -var CMsgDOTAFantasyLeagueMatchupsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_BAD_LEAGUE_ID", - 3: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyLeagueMatchupsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_BAD_LEAGUE_ID": 2, - "ERROR_NO_PERMISSION": 3, -} - -func (x CMsgDOTAFantasyLeagueMatchupsResponse_EResult) Enum() *CMsgDOTAFantasyLeagueMatchupsResponse_EResult { - p := new(CMsgDOTAFantasyLeagueMatchupsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueMatchupsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueMatchupsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueMatchupsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueMatchupsResponse_EResult_value, data, "CMsgDOTAFantasyLeagueMatchupsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueMatchupsResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueMatchupsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{12, 0} -} - -type CMsgDOTAEditFantasyTeamResponse_EResult int32 - -const ( - CMsgDOTAEditFantasyTeamResponse_SUCCESS CMsgDOTAEditFantasyTeamResponse_EResult = 0 - CMsgDOTAEditFantasyTeamResponse_ERROR_UNSPECIFIED CMsgDOTAEditFantasyTeamResponse_EResult = 1 - CMsgDOTAEditFantasyTeamResponse_ERROR_INVALID_TEAM_INFO CMsgDOTAEditFantasyTeamResponse_EResult = 2 - CMsgDOTAEditFantasyTeamResponse_ERROR_NAME_ALREADY_TAKEN CMsgDOTAEditFantasyTeamResponse_EResult = 3 - CMsgDOTAEditFantasyTeamResponse_ERROR_NO_PERMISSION CMsgDOTAEditFantasyTeamResponse_EResult = 4 -) - -var CMsgDOTAEditFantasyTeamResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_INVALID_TEAM_INFO", - 3: "ERROR_NAME_ALREADY_TAKEN", - 4: "ERROR_NO_PERMISSION", -} -var CMsgDOTAEditFantasyTeamResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_INVALID_TEAM_INFO": 2, - "ERROR_NAME_ALREADY_TAKEN": 3, - "ERROR_NO_PERMISSION": 4, -} - -func (x CMsgDOTAEditFantasyTeamResponse_EResult) Enum() *CMsgDOTAEditFantasyTeamResponse_EResult { - p := new(CMsgDOTAEditFantasyTeamResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAEditFantasyTeamResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAEditFantasyTeamResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAEditFantasyTeamResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAEditFantasyTeamResponse_EResult_value, data, "CMsgDOTAEditFantasyTeamResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAEditFantasyTeamResponse_EResult(value) - return nil -} -func (CMsgDOTAEditFantasyTeamResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{14, 0} -} - -type CMsgDOTAFantasyTeamScoreResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamScoreResponse_SUCCESS CMsgDOTAFantasyTeamScoreResponse_EResult = 0 - CMsgDOTAFantasyTeamScoreResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamScoreResponse_EResult = 1 - CMsgDOTAFantasyTeamScoreResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyTeamScoreResponse_EResult = 2 - CMsgDOTAFantasyTeamScoreResponse_ERROR_OWNER_NOT_IN_LEAGUE CMsgDOTAFantasyTeamScoreResponse_EResult = 3 -) - -var CMsgDOTAFantasyTeamScoreResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", - 3: "ERROR_OWNER_NOT_IN_LEAGUE", -} -var CMsgDOTAFantasyTeamScoreResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, - "ERROR_OWNER_NOT_IN_LEAGUE": 3, -} - -func (x CMsgDOTAFantasyTeamScoreResponse_EResult) Enum() *CMsgDOTAFantasyTeamScoreResponse_EResult { - p := new(CMsgDOTAFantasyTeamScoreResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamScoreResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamScoreResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamScoreResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamScoreResponse_EResult_value, data, "CMsgDOTAFantasyTeamScoreResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamScoreResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamScoreResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{20, 0} -} - -type CMsgDOTAFantasyTeamStandingsResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamStandingsResponse_SUCCESS CMsgDOTAFantasyTeamStandingsResponse_EResult = 0 - CMsgDOTAFantasyTeamStandingsResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamStandingsResponse_EResult = 1 - CMsgDOTAFantasyTeamStandingsResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyTeamStandingsResponse_EResult = 2 -) - -var CMsgDOTAFantasyTeamStandingsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyTeamStandingsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyTeamStandingsResponse_EResult) Enum() *CMsgDOTAFantasyTeamStandingsResponse_EResult { - p := new(CMsgDOTAFantasyTeamStandingsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamStandingsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamStandingsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamStandingsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamStandingsResponse_EResult_value, data, "CMsgDOTAFantasyTeamStandingsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamStandingsResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamStandingsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{22, 0} -} - -type CMsgDOTAFantasyPlayerScoreResponse_EResult int32 - -const ( - CMsgDOTAFantasyPlayerScoreResponse_SUCCESS CMsgDOTAFantasyPlayerScoreResponse_EResult = 0 - CMsgDOTAFantasyPlayerScoreResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyPlayerScoreResponse_EResult = 1 - CMsgDOTAFantasyPlayerScoreResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyPlayerScoreResponse_EResult = 2 -) - -var CMsgDOTAFantasyPlayerScoreResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyPlayerScoreResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyPlayerScoreResponse_EResult) Enum() *CMsgDOTAFantasyPlayerScoreResponse_EResult { - p := new(CMsgDOTAFantasyPlayerScoreResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyPlayerScoreResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyPlayerScoreResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyPlayerScoreResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyPlayerScoreResponse_EResult_value, data, "CMsgDOTAFantasyPlayerScoreResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyPlayerScoreResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyPlayerScoreResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{24, 0} -} - -type CMsgDOTAFantasyPlayerStandingsResponse_EResult int32 - -const ( - CMsgDOTAFantasyPlayerStandingsResponse_SUCCESS CMsgDOTAFantasyPlayerStandingsResponse_EResult = 0 - CMsgDOTAFantasyPlayerStandingsResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyPlayerStandingsResponse_EResult = 1 - CMsgDOTAFantasyPlayerStandingsResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyPlayerStandingsResponse_EResult = 2 -) - -var CMsgDOTAFantasyPlayerStandingsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyPlayerStandingsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyPlayerStandingsResponse_EResult) Enum() *CMsgDOTAFantasyPlayerStandingsResponse_EResult { - p := new(CMsgDOTAFantasyPlayerStandingsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyPlayerStandingsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyPlayerStandingsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyPlayerStandingsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyPlayerStandingsResponse_EResult_value, data, "CMsgDOTAFantasyPlayerStandingsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyPlayerStandingsResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyPlayerStandingsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{26, 0} -} - -type CMsgDOTAFantasyLeagueCreateResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueCreateResponse_SUCCESS CMsgDOTAFantasyLeagueCreateResponse_EResult = 0 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyLeagueCreateResponse_EResult = 1 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_BAD_SEASON_ID CMsgDOTAFantasyLeagueCreateResponse_EResult = 2 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_BAD_LEAGUE_NAME CMsgDOTAFantasyLeagueCreateResponse_EResult = 3 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_BAD_TEAM_NAME CMsgDOTAFantasyLeagueCreateResponse_EResult = 4 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueCreateResponse_EResult = 5 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_FAILED_LOGO_UPLOAD CMsgDOTAFantasyLeagueCreateResponse_EResult = 6 - CMsgDOTAFantasyLeagueCreateResponse_ERROR_NO_TICKET CMsgDOTAFantasyLeagueCreateResponse_EResult = 7 -) - -var CMsgDOTAFantasyLeagueCreateResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_NO_PERMISSION", - 2: "ERROR_BAD_SEASON_ID", - 3: "ERROR_BAD_LEAGUE_NAME", - 4: "ERROR_BAD_TEAM_NAME", - 5: "ERROR_UNSPECIFIED", - 6: "ERROR_FAILED_LOGO_UPLOAD", - 7: "ERROR_NO_TICKET", -} -var CMsgDOTAFantasyLeagueCreateResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_NO_PERMISSION": 1, - "ERROR_BAD_SEASON_ID": 2, - "ERROR_BAD_LEAGUE_NAME": 3, - "ERROR_BAD_TEAM_NAME": 4, - "ERROR_UNSPECIFIED": 5, - "ERROR_FAILED_LOGO_UPLOAD": 6, - "ERROR_NO_TICKET": 7, -} - -func (x CMsgDOTAFantasyLeagueCreateResponse_EResult) Enum() *CMsgDOTAFantasyLeagueCreateResponse_EResult { - p := new(CMsgDOTAFantasyLeagueCreateResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueCreateResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueCreateResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueCreateResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueCreateResponse_EResult_value, data, "CMsgDOTAFantasyLeagueCreateResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueCreateResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueCreateResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{30, 0} -} - -type CMsgDOTAFantasyTeamCreateResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamCreateResponse_SUCCESS CMsgDOTAFantasyTeamCreateResponse_EResult = 0 - CMsgDOTAFantasyTeamCreateResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyTeamCreateResponse_EResult = 1 - CMsgDOTAFantasyTeamCreateResponse_ERROR_FAILED_LOGO_UPLOAD CMsgDOTAFantasyTeamCreateResponse_EResult = 2 - CMsgDOTAFantasyTeamCreateResponse_ERROR_BAD_FANTASY_LEAGUE_ID CMsgDOTAFantasyTeamCreateResponse_EResult = 3 - CMsgDOTAFantasyTeamCreateResponse_ERROR_BAD_NAME CMsgDOTAFantasyTeamCreateResponse_EResult = 4 - CMsgDOTAFantasyTeamCreateResponse_ERROR_FULL CMsgDOTAFantasyTeamCreateResponse_EResult = 5 - CMsgDOTAFantasyTeamCreateResponse_ERROR_ALREADY_MEMBER CMsgDOTAFantasyTeamCreateResponse_EResult = 6 - CMsgDOTAFantasyTeamCreateResponse_ERROR_BAD_PASSWORD CMsgDOTAFantasyTeamCreateResponse_EResult = 7 - CMsgDOTAFantasyTeamCreateResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamCreateResponse_EResult = 8 - CMsgDOTAFantasyTeamCreateResponse_ERROR_NO_TICKET CMsgDOTAFantasyTeamCreateResponse_EResult = 9 - CMsgDOTAFantasyTeamCreateResponse_ERROR_LEAGUE_LOCKED CMsgDOTAFantasyTeamCreateResponse_EResult = 10 -) - -var CMsgDOTAFantasyTeamCreateResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_NO_PERMISSION", - 2: "ERROR_FAILED_LOGO_UPLOAD", - 3: "ERROR_BAD_FANTASY_LEAGUE_ID", - 4: "ERROR_BAD_NAME", - 5: "ERROR_FULL", - 6: "ERROR_ALREADY_MEMBER", - 7: "ERROR_BAD_PASSWORD", - 8: "ERROR_UNSPECIFIED", - 9: "ERROR_NO_TICKET", - 10: "ERROR_LEAGUE_LOCKED", -} -var CMsgDOTAFantasyTeamCreateResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_NO_PERMISSION": 1, - "ERROR_FAILED_LOGO_UPLOAD": 2, - "ERROR_BAD_FANTASY_LEAGUE_ID": 3, - "ERROR_BAD_NAME": 4, - "ERROR_FULL": 5, - "ERROR_ALREADY_MEMBER": 6, - "ERROR_BAD_PASSWORD": 7, - "ERROR_UNSPECIFIED": 8, - "ERROR_NO_TICKET": 9, - "ERROR_LEAGUE_LOCKED": 10, -} - -func (x CMsgDOTAFantasyTeamCreateResponse_EResult) Enum() *CMsgDOTAFantasyTeamCreateResponse_EResult { - p := new(CMsgDOTAFantasyTeamCreateResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamCreateResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamCreateResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamCreateResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamCreateResponse_EResult_value, data, "CMsgDOTAFantasyTeamCreateResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamCreateResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamCreateResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{32, 0} -} - -type CMsgDOTAFantasyLeagueEditInvitesResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueEditInvitesResponse_SUCCESS CMsgDOTAFantasyLeagueEditInvitesResponse_EResult = 0 - CMsgDOTAFantasyLeagueEditInvitesResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueEditInvitesResponse_EResult = 1 -) - -var CMsgDOTAFantasyLeagueEditInvitesResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", -} -var CMsgDOTAFantasyLeagueEditInvitesResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, -} - -func (x CMsgDOTAFantasyLeagueEditInvitesResponse_EResult) Enum() *CMsgDOTAFantasyLeagueEditInvitesResponse_EResult { - p := new(CMsgDOTAFantasyLeagueEditInvitesResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueEditInvitesResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueEditInvitesResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueEditInvitesResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueEditInvitesResponse_EResult_value, data, "CMsgDOTAFantasyLeagueEditInvitesResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueEditInvitesResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueEditInvitesResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{34, 0} -} - -type CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeagueDraftPlayerResponse_SUCCESS CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 0 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 1 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_INVALID_FANTASY_LEAGUE CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 2 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_FANTASY_LEAGUE_NOT_DRAFTING CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 3 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_OWNER_NOT_IN_LEAGUE CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 4 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_NOT_OWNERS_TURN CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 5 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_PLAYER_INVALID CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 6 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_PLAYER_UNAVAILABLE CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 7 - CMsgDOTAFantasyLeagueDraftPlayerResponse_ERROR_PLAYER_NO_VALID_SLOTS CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = 8 -) - -var CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_INVALID_FANTASY_LEAGUE", - 3: "ERROR_FANTASY_LEAGUE_NOT_DRAFTING", - 4: "ERROR_OWNER_NOT_IN_LEAGUE", - 5: "ERROR_NOT_OWNERS_TURN", - 6: "ERROR_PLAYER_INVALID", - 7: "ERROR_PLAYER_UNAVAILABLE", - 8: "ERROR_PLAYER_NO_VALID_SLOTS", -} -var CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_INVALID_FANTASY_LEAGUE": 2, - "ERROR_FANTASY_LEAGUE_NOT_DRAFTING": 3, - "ERROR_OWNER_NOT_IN_LEAGUE": 4, - "ERROR_NOT_OWNERS_TURN": 5, - "ERROR_PLAYER_INVALID": 6, - "ERROR_PLAYER_UNAVAILABLE": 7, - "ERROR_PLAYER_NO_VALID_SLOTS": 8, -} - -func (x CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult) Enum() *CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult { - p := new(CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult_value, data, "CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{38, 0} -} - -type CMsgDOTAFantasyTeamRosterSwapResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamRosterSwapResponse_SUCCESS CMsgDOTAFantasyTeamRosterSwapResponse_EResult = 0 - CMsgDOTAFantasyTeamRosterSwapResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamRosterSwapResponse_EResult = 1 - CMsgDOTAFantasyTeamRosterSwapResponse_ERROR_OWNER_NOT_IN_LEAGUE CMsgDOTAFantasyTeamRosterSwapResponse_EResult = 2 - CMsgDOTAFantasyTeamRosterSwapResponse_ERROR_SLOTS_INVALID CMsgDOTAFantasyTeamRosterSwapResponse_EResult = 3 - CMsgDOTAFantasyTeamRosterSwapResponse_ERROR_SLOT_LOCKED CMsgDOTAFantasyTeamRosterSwapResponse_EResult = 4 -) - -var CMsgDOTAFantasyTeamRosterSwapResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_OWNER_NOT_IN_LEAGUE", - 3: "ERROR_SLOTS_INVALID", - 4: "ERROR_SLOT_LOCKED", -} -var CMsgDOTAFantasyTeamRosterSwapResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_OWNER_NOT_IN_LEAGUE": 2, - "ERROR_SLOTS_INVALID": 3, - "ERROR_SLOT_LOCKED": 4, -} - -func (x CMsgDOTAFantasyTeamRosterSwapResponse_EResult) Enum() *CMsgDOTAFantasyTeamRosterSwapResponse_EResult { - p := new(CMsgDOTAFantasyTeamRosterSwapResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamRosterSwapResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamRosterSwapResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamRosterSwapResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamRosterSwapResponse_EResult_value, data, "CMsgDOTAFantasyTeamRosterSwapResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamRosterSwapResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamRosterSwapResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{40, 0} -} - -type CMsgDOTAFantasyTeamRosterAddDropResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamRosterAddDropResponse_SUCCESS CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = 0 - CMsgDOTAFantasyTeamRosterAddDropResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = 1 - CMsgDOTAFantasyTeamRosterAddDropResponse_ERROR_OWNER_NOT_IN_LEAGUE CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = 2 - CMsgDOTAFantasyTeamRosterAddDropResponse_ERROR_PLAYER_NOT_AVAILABLE CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = 3 - CMsgDOTAFantasyTeamRosterAddDropResponse_ERROR_PLAYER_NOT_ON_TEAM CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = 4 - CMsgDOTAFantasyTeamRosterAddDropResponse_ERROR_TRADE_ALREADY_PENDING CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = 5 -) - -var CMsgDOTAFantasyTeamRosterAddDropResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_OWNER_NOT_IN_LEAGUE", - 3: "ERROR_PLAYER_NOT_AVAILABLE", - 4: "ERROR_PLAYER_NOT_ON_TEAM", - 5: "ERROR_TRADE_ALREADY_PENDING", -} -var CMsgDOTAFantasyTeamRosterAddDropResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_OWNER_NOT_IN_LEAGUE": 2, - "ERROR_PLAYER_NOT_AVAILABLE": 3, - "ERROR_PLAYER_NOT_ON_TEAM": 4, - "ERROR_TRADE_ALREADY_PENDING": 5, -} - -func (x CMsgDOTAFantasyTeamRosterAddDropResponse_EResult) Enum() *CMsgDOTAFantasyTeamRosterAddDropResponse_EResult { - p := new(CMsgDOTAFantasyTeamRosterAddDropResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamRosterAddDropResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamRosterAddDropResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamRosterAddDropResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamRosterAddDropResponse_EResult_value, data, "CMsgDOTAFantasyTeamRosterAddDropResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamRosterAddDropResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamRosterAddDropResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{42, 0} -} - -type CMsgDOTAFantasyTeamTradesResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamTradesResponse_SUCCESS CMsgDOTAFantasyTeamTradesResponse_EResult = 0 - CMsgDOTAFantasyTeamTradesResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamTradesResponse_EResult = 1 - CMsgDOTAFantasyTeamTradesResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyTeamTradesResponse_EResult = 2 -) - -var CMsgDOTAFantasyTeamTradesResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyTeamTradesResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyTeamTradesResponse_EResult) Enum() *CMsgDOTAFantasyTeamTradesResponse_EResult { - p := new(CMsgDOTAFantasyTeamTradesResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamTradesResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamTradesResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamTradesResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamTradesResponse_EResult_value, data, "CMsgDOTAFantasyTeamTradesResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamTradesResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamTradesResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{44, 0} -} - -type CMsgDOTAFantasyTeamTradeCancelResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamTradeCancelResponse_SUCCESS CMsgDOTAFantasyTeamTradeCancelResponse_EResult = 0 - CMsgDOTAFantasyTeamTradeCancelResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamTradeCancelResponse_EResult = 1 - CMsgDOTAFantasyTeamTradeCancelResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyTeamTradeCancelResponse_EResult = 2 - CMsgDOTAFantasyTeamTradeCancelResponse_ERROR_NO_TRADE CMsgDOTAFantasyTeamTradeCancelResponse_EResult = 3 -) - -var CMsgDOTAFantasyTeamTradeCancelResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", - 3: "ERROR_NO_TRADE", -} -var CMsgDOTAFantasyTeamTradeCancelResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, - "ERROR_NO_TRADE": 3, -} - -func (x CMsgDOTAFantasyTeamTradeCancelResponse_EResult) Enum() *CMsgDOTAFantasyTeamTradeCancelResponse_EResult { - p := new(CMsgDOTAFantasyTeamTradeCancelResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamTradeCancelResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamTradeCancelResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamTradeCancelResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamTradeCancelResponse_EResult_value, data, "CMsgDOTAFantasyTeamTradeCancelResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamTradeCancelResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamTradeCancelResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{46, 0} -} - -type CMsgDOTAFantasyTeamRosterResponse_EResult int32 - -const ( - CMsgDOTAFantasyTeamRosterResponse_SUCCESS CMsgDOTAFantasyTeamRosterResponse_EResult = 0 - CMsgDOTAFantasyTeamRosterResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyTeamRosterResponse_EResult = 1 - CMsgDOTAFantasyTeamRosterResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyTeamRosterResponse_EResult = 2 - CMsgDOTAFantasyTeamRosterResponse_ERROR_OWNER_NOT_IN_LEAGUE CMsgDOTAFantasyTeamRosterResponse_EResult = 3 -) - -var CMsgDOTAFantasyTeamRosterResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", - 3: "ERROR_OWNER_NOT_IN_LEAGUE", -} -var CMsgDOTAFantasyTeamRosterResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, - "ERROR_OWNER_NOT_IN_LEAGUE": 3, -} - -func (x CMsgDOTAFantasyTeamRosterResponse_EResult) Enum() *CMsgDOTAFantasyTeamRosterResponse_EResult { - p := new(CMsgDOTAFantasyTeamRosterResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyTeamRosterResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyTeamRosterResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyTeamRosterResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyTeamRosterResponse_EResult_value, data, "CMsgDOTAFantasyTeamRosterResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyTeamRosterResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyTeamRosterResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{48, 0} -} - -type CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult int32 - -const ( - CMsgDOTAFantasyPlayerHisoricalStatsResponse_SUCCESS CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult = 0 - CMsgDOTAFantasyPlayerHisoricalStatsResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult = 1 - CMsgDOTAFantasyPlayerHisoricalStatsResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult = 2 -) - -var CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult) Enum() *CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult { - p := new(CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult_value, data, "CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{50, 0} -} - -type CMsgDOTAFantasyMessagesResponse_EResult int32 - -const ( - CMsgDOTAFantasyMessagesResponse_SUCCESS CMsgDOTAFantasyMessagesResponse_EResult = 0 - CMsgDOTAFantasyMessagesResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyMessagesResponse_EResult = 1 - CMsgDOTAFantasyMessagesResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyMessagesResponse_EResult = 2 -) - -var CMsgDOTAFantasyMessagesResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", -} -var CMsgDOTAFantasyMessagesResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, -} - -func (x CMsgDOTAFantasyMessagesResponse_EResult) Enum() *CMsgDOTAFantasyMessagesResponse_EResult { - p := new(CMsgDOTAFantasyMessagesResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyMessagesResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyMessagesResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyMessagesResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyMessagesResponse_EResult_value, data, "CMsgDOTAFantasyMessagesResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyMessagesResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyMessagesResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{53, 0} -} - -type CMsgDOTAFantasyRemoveOwnerResponse_EResult int32 - -const ( - CMsgDOTAFantasyRemoveOwnerResponse_SUCCESS CMsgDOTAFantasyRemoveOwnerResponse_EResult = 0 - CMsgDOTAFantasyRemoveOwnerResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyRemoveOwnerResponse_EResult = 1 - CMsgDOTAFantasyRemoveOwnerResponse_ERROR_NO_PERMISSION CMsgDOTAFantasyRemoveOwnerResponse_EResult = 2 - CMsgDOTAFantasyRemoveOwnerResponse_ERROR_LEAGUE_LOCKED CMsgDOTAFantasyRemoveOwnerResponse_EResult = 3 - CMsgDOTAFantasyRemoveOwnerResponse_ERROR_NOT_A_MEMBER CMsgDOTAFantasyRemoveOwnerResponse_EResult = 4 -) - -var CMsgDOTAFantasyRemoveOwnerResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NO_PERMISSION", - 3: "ERROR_LEAGUE_LOCKED", - 4: "ERROR_NOT_A_MEMBER", -} -var CMsgDOTAFantasyRemoveOwnerResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NO_PERMISSION": 2, - "ERROR_LEAGUE_LOCKED": 3, - "ERROR_NOT_A_MEMBER": 4, -} - -func (x CMsgDOTAFantasyRemoveOwnerResponse_EResult) Enum() *CMsgDOTAFantasyRemoveOwnerResponse_EResult { - p := new(CMsgDOTAFantasyRemoveOwnerResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyRemoveOwnerResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyRemoveOwnerResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyRemoveOwnerResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyRemoveOwnerResponse_EResult_value, data, "CMsgDOTAFantasyRemoveOwnerResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyRemoveOwnerResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyRemoveOwnerResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{55, 0} -} - -type CMsgDOTAFantasyScheduledMatchesResponse_EResult int32 - -const ( - CMsgDOTAFantasyScheduledMatchesResponse_SUCCESS CMsgDOTAFantasyScheduledMatchesResponse_EResult = 0 - CMsgDOTAFantasyScheduledMatchesResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyScheduledMatchesResponse_EResult = 1 -) - -var CMsgDOTAFantasyScheduledMatchesResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", -} -var CMsgDOTAFantasyScheduledMatchesResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, -} - -func (x CMsgDOTAFantasyScheduledMatchesResponse_EResult) Enum() *CMsgDOTAFantasyScheduledMatchesResponse_EResult { - p := new(CMsgDOTAFantasyScheduledMatchesResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyScheduledMatchesResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyScheduledMatchesResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyScheduledMatchesResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyScheduledMatchesResponse_EResult_value, data, "CMsgDOTAFantasyScheduledMatchesResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyScheduledMatchesResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyScheduledMatchesResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{57, 0} -} - -type CMsgDOTAFantasyLeaveLeagueResponse_EResult int32 - -const ( - CMsgDOTAFantasyLeaveLeagueResponse_SUCCESS CMsgDOTAFantasyLeaveLeagueResponse_EResult = 0 - CMsgDOTAFantasyLeaveLeagueResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyLeaveLeagueResponse_EResult = 1 - CMsgDOTAFantasyLeaveLeagueResponse_ERROR_NOT_MEMBER CMsgDOTAFantasyLeaveLeagueResponse_EResult = 2 - CMsgDOTAFantasyLeaveLeagueResponse_ERROR_LEAGUE_NOT_FOUND CMsgDOTAFantasyLeaveLeagueResponse_EResult = 3 - CMsgDOTAFantasyLeaveLeagueResponse_ERROR_DRAFT_ACTIVE CMsgDOTAFantasyLeaveLeagueResponse_EResult = 4 -) - -var CMsgDOTAFantasyLeaveLeagueResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NOT_MEMBER", - 3: "ERROR_LEAGUE_NOT_FOUND", - 4: "ERROR_DRAFT_ACTIVE", -} -var CMsgDOTAFantasyLeaveLeagueResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NOT_MEMBER": 2, - "ERROR_LEAGUE_NOT_FOUND": 3, - "ERROR_DRAFT_ACTIVE": 4, -} - -func (x CMsgDOTAFantasyLeaveLeagueResponse_EResult) Enum() *CMsgDOTAFantasyLeaveLeagueResponse_EResult { - p := new(CMsgDOTAFantasyLeaveLeagueResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyLeaveLeagueResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyLeaveLeagueResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyLeaveLeagueResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyLeaveLeagueResponse_EResult_value, data, "CMsgDOTAFantasyLeaveLeagueResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyLeaveLeagueResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyLeaveLeagueResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{59, 0} -} - -type CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult int32 - -const ( - CMsgDOTAFantasyPlayerScoreDetailsResponse_SUCCESS CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult = 0 - CMsgDOTAFantasyPlayerScoreDetailsResponse_ERROR_UNSPECIFIED CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult = 1 - CMsgDOTAFantasyPlayerScoreDetailsResponse_ERROR_NOT_MEMBER CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult = 2 -) - -var CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult_name = map[int32]string{ - 0: "SUCCESS", - 1: "ERROR_UNSPECIFIED", - 2: "ERROR_NOT_MEMBER", -} -var CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult_value = map[string]int32{ - "SUCCESS": 0, - "ERROR_UNSPECIFIED": 1, - "ERROR_NOT_MEMBER": 2, -} - -func (x CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult) Enum() *CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult { - p := new(CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult) - *p = x - return p -} -func (x CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult) String() string { - return proto.EnumName(CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult_name, int32(x)) -} -func (x *CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult_value, data, "CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult") - if err != nil { - return err - } - *x = CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult(value) - return nil -} -func (CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{61, 0} -} - -type CMsgGCPlayerInfo struct { - PlayerInfos []*CMsgGCPlayerInfo_PlayerInfo `protobuf:"bytes,1,rep,name=player_infos" json:"player_infos,omitempty"` - Leaderboards []*CMsgGCPlayerInfo_RegionLeaderboard `protobuf:"bytes,2,rep,name=leaderboards" json:"leaderboards,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPlayerInfo) Reset() { *m = CMsgGCPlayerInfo{} } -func (m *CMsgGCPlayerInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPlayerInfo) ProtoMessage() {} -func (*CMsgGCPlayerInfo) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{0} } - -func (m *CMsgGCPlayerInfo) GetPlayerInfos() []*CMsgGCPlayerInfo_PlayerInfo { - if m != nil { - return m.PlayerInfos - } - return nil -} - -func (m *CMsgGCPlayerInfo) GetLeaderboards() []*CMsgGCPlayerInfo_RegionLeaderboard { - if m != nil { - return m.Leaderboards - } - return nil -} - -type CMsgGCPlayerInfo_PlayerInfo struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - CountryCode *string `protobuf:"bytes,3,opt,name=country_code" json:"country_code,omitempty"` - FantasyRole *uint32 `protobuf:"varint,4,opt,name=fantasy_role" json:"fantasy_role,omitempty"` - TeamId *uint32 `protobuf:"varint,5,opt,name=team_id" json:"team_id,omitempty"` - TeamName *string `protobuf:"bytes,6,opt,name=team_name" json:"team_name,omitempty"` - TeamTag *string `protobuf:"bytes,7,opt,name=team_tag" json:"team_tag,omitempty"` - Sponsor *string `protobuf:"bytes,8,opt,name=sponsor" json:"sponsor,omitempty"` - IsLocked *bool `protobuf:"varint,9,opt,name=is_locked" json:"is_locked,omitempty"` - IsPro *bool `protobuf:"varint,10,opt,name=is_pro" json:"is_pro,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) Reset() { *m = CMsgGCPlayerInfo_PlayerInfo{} } -func (m *CMsgGCPlayerInfo_PlayerInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPlayerInfo_PlayerInfo) ProtoMessage() {} -func (*CMsgGCPlayerInfo_PlayerInfo) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{0, 0} } - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetFantasyRole() uint32 { - if m != nil && m.FantasyRole != nil { - return *m.FantasyRole - } - return 0 -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetTeamTag() string { - if m != nil && m.TeamTag != nil { - return *m.TeamTag - } - return "" -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetSponsor() string { - if m != nil && m.Sponsor != nil { - return *m.Sponsor - } - return "" -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetIsLocked() bool { - if m != nil && m.IsLocked != nil { - return *m.IsLocked - } - return false -} - -func (m *CMsgGCPlayerInfo_PlayerInfo) GetIsPro() bool { - if m != nil && m.IsPro != nil { - return *m.IsPro - } - return false -} - -type CMsgGCPlayerInfo_RegionLeaderboard struct { - Division *uint32 `protobuf:"varint,1,opt,name=division" json:"division,omitempty"` - AccountIds []uint32 `protobuf:"varint,2,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPlayerInfo_RegionLeaderboard) Reset() { *m = CMsgGCPlayerInfo_RegionLeaderboard{} } -func (m *CMsgGCPlayerInfo_RegionLeaderboard) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPlayerInfo_RegionLeaderboard) ProtoMessage() {} -func (*CMsgGCPlayerInfo_RegionLeaderboard) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{0, 1} -} - -func (m *CMsgGCPlayerInfo_RegionLeaderboard) GetDivision() uint32 { - if m != nil && m.Division != nil { - return *m.Division - } - return 0 -} - -func (m *CMsgGCPlayerInfo_RegionLeaderboard) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgDOTACreateFantasyLeagueRequest struct { - LeagueName *string `protobuf:"bytes,1,opt,name=league_name" json:"league_name,omitempty"` - LeagueLogo *uint64 `protobuf:"varint,2,opt,name=league_logo" json:"league_logo,omitempty"` - SelectionMode *Fantasy_Selection_Mode `protobuf:"varint,3,opt,name=selection_mode,enum=Fantasy_Selection_Mode,def=0" json:"selection_mode,omitempty"` - TeamCount *uint32 `protobuf:"varint,4,opt,name=team_count" json:"team_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACreateFantasyLeagueRequest) Reset() { *m = CMsgDOTACreateFantasyLeagueRequest{} } -func (m *CMsgDOTACreateFantasyLeagueRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACreateFantasyLeagueRequest) ProtoMessage() {} -func (*CMsgDOTACreateFantasyLeagueRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{1} -} - -const Default_CMsgDOTACreateFantasyLeagueRequest_SelectionMode Fantasy_Selection_Mode = Fantasy_Selection_Mode_FANTASY_SELECTION_INVALID - -func (m *CMsgDOTACreateFantasyLeagueRequest) GetLeagueName() string { - if m != nil && m.LeagueName != nil { - return *m.LeagueName - } - return "" -} - -func (m *CMsgDOTACreateFantasyLeagueRequest) GetLeagueLogo() uint64 { - if m != nil && m.LeagueLogo != nil { - return *m.LeagueLogo - } - return 0 -} - -func (m *CMsgDOTACreateFantasyLeagueRequest) GetSelectionMode() Fantasy_Selection_Mode { - if m != nil && m.SelectionMode != nil { - return *m.SelectionMode - } - return Default_CMsgDOTACreateFantasyLeagueRequest_SelectionMode -} - -func (m *CMsgDOTACreateFantasyLeagueRequest) GetTeamCount() uint32 { - if m != nil && m.TeamCount != nil { - return *m.TeamCount - } - return 0 -} - -type CMsgDOTACreateFantasyLeagueResponse struct { - Result *CMsgDOTACreateFantasyLeagueResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTACreateFantasyLeagueResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACreateFantasyLeagueResponse) Reset() { *m = CMsgDOTACreateFantasyLeagueResponse{} } -func (m *CMsgDOTACreateFantasyLeagueResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACreateFantasyLeagueResponse) ProtoMessage() {} -func (*CMsgDOTACreateFantasyLeagueResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{2} -} - -const Default_CMsgDOTACreateFantasyLeagueResponse_Result CMsgDOTACreateFantasyLeagueResponse_EResult = CMsgDOTACreateFantasyLeagueResponse_SUCCESS - -func (m *CMsgDOTACreateFantasyLeagueResponse) GetResult() CMsgDOTACreateFantasyLeagueResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTACreateFantasyLeagueResponse_Result -} - -type CMsgFantasyLeagueScoring struct { - Level *float32 `protobuf:"fixed32,1,opt,name=level" json:"level,omitempty"` - Kills *float32 `protobuf:"fixed32,2,opt,name=kills" json:"kills,omitempty"` - Deaths *float32 `protobuf:"fixed32,3,opt,name=deaths" json:"deaths,omitempty"` - Assists *float32 `protobuf:"fixed32,4,opt,name=assists" json:"assists,omitempty"` - LastHits *float32 `protobuf:"fixed32,5,opt,name=last_hits" json:"last_hits,omitempty"` - Denies *float32 `protobuf:"fixed32,6,opt,name=denies" json:"denies,omitempty"` - Gpm *float32 `protobuf:"fixed32,7,opt,name=gpm" json:"gpm,omitempty"` - Xppm *float32 `protobuf:"fixed32,8,opt,name=xppm" json:"xppm,omitempty"` - Stuns *float32 `protobuf:"fixed32,9,opt,name=stuns" json:"stuns,omitempty"` - Healing *float32 `protobuf:"fixed32,10,opt,name=healing" json:"healing,omitempty"` - TowerKills *float32 `protobuf:"fixed32,11,opt,name=tower_kills" json:"tower_kills,omitempty"` - RoshanKills *float32 `protobuf:"fixed32,12,opt,name=roshan_kills" json:"roshan_kills,omitempty"` - MultiplierPremium *float32 `protobuf:"fixed32,13,opt,name=multiplier_premium" json:"multiplier_premium,omitempty"` - MultiplierProfessional *float32 `protobuf:"fixed32,14,opt,name=multiplier_professional" json:"multiplier_professional,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgFantasyLeagueScoring) Reset() { *m = CMsgFantasyLeagueScoring{} } -func (m *CMsgFantasyLeagueScoring) String() string { return proto.CompactTextString(m) } -func (*CMsgFantasyLeagueScoring) ProtoMessage() {} -func (*CMsgFantasyLeagueScoring) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{3} } - -func (m *CMsgFantasyLeagueScoring) GetLevel() float32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetKills() float32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetDeaths() float32 { - if m != nil && m.Deaths != nil { - return *m.Deaths - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetAssists() float32 { - if m != nil && m.Assists != nil { - return *m.Assists - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetLastHits() float32 { - if m != nil && m.LastHits != nil { - return *m.LastHits - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetDenies() float32 { - if m != nil && m.Denies != nil { - return *m.Denies - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetGpm() float32 { - if m != nil && m.Gpm != nil { - return *m.Gpm - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetXppm() float32 { - if m != nil && m.Xppm != nil { - return *m.Xppm - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetStuns() float32 { - if m != nil && m.Stuns != nil { - return *m.Stuns - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetHealing() float32 { - if m != nil && m.Healing != nil { - return *m.Healing - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetTowerKills() float32 { - if m != nil && m.TowerKills != nil { - return *m.TowerKills - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetRoshanKills() float32 { - if m != nil && m.RoshanKills != nil { - return *m.RoshanKills - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetMultiplierPremium() float32 { - if m != nil && m.MultiplierPremium != nil { - return *m.MultiplierPremium - } - return 0 -} - -func (m *CMsgFantasyLeagueScoring) GetMultiplierProfessional() float32 { - if m != nil && m.MultiplierProfessional != nil { - return *m.MultiplierProfessional - } - return 0 -} - -type CMsgDOTAFantasyLeagueInfo struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - CommissionerAccountId *uint32 `protobuf:"varint,2,opt,name=commissioner_account_id" json:"commissioner_account_id,omitempty"` - FantasyLeagueName *string `protobuf:"bytes,3,opt,name=fantasy_league_name" json:"fantasy_league_name,omitempty"` - SelectionMode *Fantasy_Selection_Mode `protobuf:"varint,4,opt,name=selection_mode,enum=Fantasy_Selection_Mode,def=0" json:"selection_mode,omitempty"` - TeamCount *uint32 `protobuf:"varint,5,opt,name=team_count" json:"team_count,omitempty"` - Logo *uint64 `protobuf:"varint,6,opt,name=logo" json:"logo,omitempty"` - Scoring *CMsgFantasyLeagueScoring `protobuf:"bytes,7,opt,name=scoring" json:"scoring,omitempty"` - DraftTime *uint32 `protobuf:"varint,12,opt,name=draft_time" json:"draft_time,omitempty"` - DraftPickTime *uint32 `protobuf:"varint,13,opt,name=draft_pick_time" json:"draft_pick_time,omitempty"` - SeasonStart *uint32 `protobuf:"varint,15,opt,name=season_start" json:"season_start,omitempty"` - SeasonLength *uint32 `protobuf:"varint,16,opt,name=season_length" json:"season_length,omitempty"` - VetoVotes *uint32 `protobuf:"varint,17,opt,name=veto_votes" json:"veto_votes,omitempty"` - Acquisitions *uint32 `protobuf:"varint,18,opt,name=acquisitions" json:"acquisitions,omitempty"` - Slot_1 *uint32 `protobuf:"varint,19,opt,name=slot_1" json:"slot_1,omitempty"` - Slot_2 *uint32 `protobuf:"varint,20,opt,name=slot_2" json:"slot_2,omitempty"` - Slot_3 *uint32 `protobuf:"varint,21,opt,name=slot_3" json:"slot_3,omitempty"` - Slot_4 *uint32 `protobuf:"varint,22,opt,name=slot_4" json:"slot_4,omitempty"` - Slot_5 *uint32 `protobuf:"varint,23,opt,name=slot_5" json:"slot_5,omitempty"` - BenchSlots *uint32 `protobuf:"varint,24,opt,name=bench_slots" json:"bench_slots,omitempty"` - OwnerInfo []*CMsgDOTAFantasyLeagueInfo_OwnerInfo `protobuf:"bytes,25,rep,name=owner_info" json:"owner_info,omitempty"` - Players []uint32 `protobuf:"varint,26,rep,name=players" json:"players,omitempty"` - TimeZone *uint32 `protobuf:"varint,27,opt,name=time_zone" json:"time_zone,omitempty"` - Season *uint32 `protobuf:"varint,28,opt,name=season" json:"season,omitempty"` - Password *string `protobuf:"bytes,29,opt,name=password" json:"password,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueInfo) Reset() { *m = CMsgDOTAFantasyLeagueInfo{} } -func (m *CMsgDOTAFantasyLeagueInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueInfo) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueInfo) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{4} } - -const Default_CMsgDOTAFantasyLeagueInfo_SelectionMode Fantasy_Selection_Mode = Fantasy_Selection_Mode_FANTASY_SELECTION_INVALID - -func (m *CMsgDOTAFantasyLeagueInfo) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetCommissionerAccountId() uint32 { - if m != nil && m.CommissionerAccountId != nil { - return *m.CommissionerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetFantasyLeagueName() string { - if m != nil && m.FantasyLeagueName != nil { - return *m.FantasyLeagueName - } - return "" -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSelectionMode() Fantasy_Selection_Mode { - if m != nil && m.SelectionMode != nil { - return *m.SelectionMode - } - return Default_CMsgDOTAFantasyLeagueInfo_SelectionMode -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetTeamCount() uint32 { - if m != nil && m.TeamCount != nil { - return *m.TeamCount - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetScoring() *CMsgFantasyLeagueScoring { - if m != nil { - return m.Scoring - } - return nil -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetDraftTime() uint32 { - if m != nil && m.DraftTime != nil { - return *m.DraftTime - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetDraftPickTime() uint32 { - if m != nil && m.DraftPickTime != nil { - return *m.DraftPickTime - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSeasonStart() uint32 { - if m != nil && m.SeasonStart != nil { - return *m.SeasonStart - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSeasonLength() uint32 { - if m != nil && m.SeasonLength != nil { - return *m.SeasonLength - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetVetoVotes() uint32 { - if m != nil && m.VetoVotes != nil { - return *m.VetoVotes - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetAcquisitions() uint32 { - if m != nil && m.Acquisitions != nil { - return *m.Acquisitions - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSlot_1() uint32 { - if m != nil && m.Slot_1 != nil { - return *m.Slot_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSlot_2() uint32 { - if m != nil && m.Slot_2 != nil { - return *m.Slot_2 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSlot_3() uint32 { - if m != nil && m.Slot_3 != nil { - return *m.Slot_3 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSlot_4() uint32 { - if m != nil && m.Slot_4 != nil { - return *m.Slot_4 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSlot_5() uint32 { - if m != nil && m.Slot_5 != nil { - return *m.Slot_5 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetBenchSlots() uint32 { - if m != nil && m.BenchSlots != nil { - return *m.BenchSlots - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetOwnerInfo() []*CMsgDOTAFantasyLeagueInfo_OwnerInfo { - if m != nil { - return m.OwnerInfo - } - return nil -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetPlayers() []uint32 { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetTimeZone() uint32 { - if m != nil && m.TimeZone != nil { - return *m.TimeZone - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetSeason() uint32 { - if m != nil && m.Season != nil { - return *m.Season - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -type CMsgDOTAFantasyLeagueInfo_OwnerInfo struct { - OwnerAccountId *uint32 `protobuf:"varint,1,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - LeftLeague *bool `protobuf:"varint,2,opt,name=left_league" json:"left_league,omitempty"` - PlayerAccountId []uint32 `protobuf:"varint,3,rep,name=player_account_id" json:"player_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueInfo_OwnerInfo) Reset() { *m = CMsgDOTAFantasyLeagueInfo_OwnerInfo{} } -func (m *CMsgDOTAFantasyLeagueInfo_OwnerInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueInfo_OwnerInfo) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueInfo_OwnerInfo) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{4, 0} -} - -func (m *CMsgDOTAFantasyLeagueInfo_OwnerInfo) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueInfo_OwnerInfo) GetLeftLeague() bool { - if m != nil && m.LeftLeague != nil { - return *m.LeftLeague - } - return false -} - -func (m *CMsgDOTAFantasyLeagueInfo_OwnerInfo) GetPlayerAccountId() []uint32 { - if m != nil { - return m.PlayerAccountId - } - return nil -} - -type CMsgDOTAFantasyLeagueEditInfoRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - EditInfo *CMsgDOTAFantasyLeagueInfo `protobuf:"bytes,2,opt,name=edit_info" json:"edit_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueEditInfoRequest) Reset() { *m = CMsgDOTAFantasyLeagueEditInfoRequest{} } -func (m *CMsgDOTAFantasyLeagueEditInfoRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueEditInfoRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueEditInfoRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{5} -} - -func (m *CMsgDOTAFantasyLeagueEditInfoRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueEditInfoRequest) GetEditInfo() *CMsgDOTAFantasyLeagueInfo { - if m != nil { - return m.EditInfo - } - return nil -} - -type CMsgDOTAFantasyLeagueEditInfoResponse struct { - Result *CMsgDOTAFantasyLeagueEditInfoResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueEditInfoResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueEditInfoResponse) Reset() { *m = CMsgDOTAFantasyLeagueEditInfoResponse{} } -func (m *CMsgDOTAFantasyLeagueEditInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueEditInfoResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueEditInfoResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{6} -} - -const Default_CMsgDOTAFantasyLeagueEditInfoResponse_Result CMsgDOTAFantasyLeagueEditInfoResponse_EResult = CMsgDOTAFantasyLeagueEditInfoResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueEditInfoResponse) GetResult() CMsgDOTAFantasyLeagueEditInfoResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueEditInfoResponse_Result -} - -type CMsgDOTAFantasyLeagueFindRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Password *string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueFindRequest) Reset() { *m = CMsgDOTAFantasyLeagueFindRequest{} } -func (m *CMsgDOTAFantasyLeagueFindRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueFindRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueFindRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{7} -} - -func (m *CMsgDOTAFantasyLeagueFindRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueFindRequest) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -type CMsgDOTAFantasyLeagueFindResponse struct { - Result *CMsgDOTAFantasyLeagueFindResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueFindResponse_EResult,def=0" json:"result,omitempty"` - FantasyLeagueName *string `protobuf:"bytes,2,opt,name=fantasy_league_name" json:"fantasy_league_name,omitempty"` - CommissionerName *string `protobuf:"bytes,3,opt,name=commissioner_name" json:"commissioner_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueFindResponse) Reset() { *m = CMsgDOTAFantasyLeagueFindResponse{} } -func (m *CMsgDOTAFantasyLeagueFindResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueFindResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueFindResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{8} -} - -const Default_CMsgDOTAFantasyLeagueFindResponse_Result CMsgDOTAFantasyLeagueFindResponse_EResult = CMsgDOTAFantasyLeagueFindResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueFindResponse) GetResult() CMsgDOTAFantasyLeagueFindResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueFindResponse_Result -} - -func (m *CMsgDOTAFantasyLeagueFindResponse) GetFantasyLeagueName() string { - if m != nil && m.FantasyLeagueName != nil { - return *m.FantasyLeagueName - } - return "" -} - -func (m *CMsgDOTAFantasyLeagueFindResponse) GetCommissionerName() string { - if m != nil && m.CommissionerName != nil { - return *m.CommissionerName - } - return "" -} - -type CMsgDOTAFantasyLeagueInfoRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueInfoRequest) Reset() { *m = CMsgDOTAFantasyLeagueInfoRequest{} } -func (m *CMsgDOTAFantasyLeagueInfoRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueInfoRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueInfoRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{9} -} - -func (m *CMsgDOTAFantasyLeagueInfoRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyLeagueInfoResponse struct { - Result *CMsgDOTAFantasyLeagueInfoResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueInfoResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueInfoResponse) Reset() { *m = CMsgDOTAFantasyLeagueInfoResponse{} } -func (m *CMsgDOTAFantasyLeagueInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueInfoResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueInfoResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{10} -} - -const Default_CMsgDOTAFantasyLeagueInfoResponse_Result CMsgDOTAFantasyLeagueInfoResponse_EResult = CMsgDOTAFantasyLeagueInfoResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueInfoResponse) GetResult() CMsgDOTAFantasyLeagueInfoResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueInfoResponse_Result -} - -type CMsgDOTAFantasyLeagueMatchupsRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueMatchupsRequest) Reset() { *m = CMsgDOTAFantasyLeagueMatchupsRequest{} } -func (m *CMsgDOTAFantasyLeagueMatchupsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueMatchupsRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueMatchupsRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{11} -} - -func (m *CMsgDOTAFantasyLeagueMatchupsRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyLeagueMatchupsResponse struct { - Result *CMsgDOTAFantasyLeagueMatchupsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueMatchupsResponse_EResult,def=0" json:"result,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,2,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - WeeklyMatchups []*CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups `protobuf:"bytes,3,rep,name=weekly_matchups" json:"weekly_matchups,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse) Reset() { *m = CMsgDOTAFantasyLeagueMatchupsResponse{} } -func (m *CMsgDOTAFantasyLeagueMatchupsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueMatchupsResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueMatchupsResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{12} -} - -const Default_CMsgDOTAFantasyLeagueMatchupsResponse_Result CMsgDOTAFantasyLeagueMatchupsResponse_EResult = CMsgDOTAFantasyLeagueMatchupsResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse) GetResult() CMsgDOTAFantasyLeagueMatchupsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueMatchupsResponse_Result -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse) GetWeeklyMatchups() []*CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups { - if m != nil { - return m.WeeklyMatchups - } - return nil -} - -type CMsgDOTAFantasyLeagueMatchupsResponse_Matchup struct { - OwnerAccountId_1 *uint32 `protobuf:"varint,1,opt,name=owner_account_id_1" json:"owner_account_id_1,omitempty"` - OwnerAccountId_2 *uint32 `protobuf:"varint,2,opt,name=owner_account_id_2" json:"owner_account_id_2,omitempty"` - Score_1 *float32 `protobuf:"fixed32,3,opt,name=score_1" json:"score_1,omitempty"` - Score_2 *float32 `protobuf:"fixed32,4,opt,name=score_2" json:"score_2,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) Reset() { - *m = CMsgDOTAFantasyLeagueMatchupsResponse_Matchup{} -} -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{12, 0} -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) GetOwnerAccountId_1() uint32 { - if m != nil && m.OwnerAccountId_1 != nil { - return *m.OwnerAccountId_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) GetOwnerAccountId_2() uint32 { - if m != nil && m.OwnerAccountId_2 != nil { - return *m.OwnerAccountId_2 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) GetScore_1() float32 { - if m != nil && m.Score_1 != nil { - return *m.Score_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_Matchup) GetScore_2() float32 { - if m != nil && m.Score_2 != nil { - return *m.Score_2 - } - return 0 -} - -type CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups struct { - Matchup []*CMsgDOTAFantasyLeagueMatchupsResponse_Matchup `protobuf:"bytes,1,rep,name=matchup" json:"matchup,omitempty"` - StartTime *uint32 `protobuf:"varint,2,opt,name=start_time" json:"start_time,omitempty"` - EndTime *uint32 `protobuf:"varint,3,opt,name=end_time" json:"end_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) Reset() { - *m = CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups{} -} -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{12, 1} -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) GetMatchup() []*CMsgDOTAFantasyLeagueMatchupsResponse_Matchup { - if m != nil { - return m.Matchup - } - return nil -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups) GetEndTime() uint32 { - if m != nil && m.EndTime != nil { - return *m.EndTime - } - return 0 -} - -type CMsgDOTAEditFantasyTeamRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - TeamIndex *uint32 `protobuf:"varint,2,opt,name=team_index" json:"team_index,omitempty"` - TeamName *string `protobuf:"bytes,3,opt,name=team_name" json:"team_name,omitempty"` - TeamLogo *uint64 `protobuf:"varint,4,opt,name=team_logo" json:"team_logo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditFantasyTeamRequest) Reset() { *m = CMsgDOTAEditFantasyTeamRequest{} } -func (m *CMsgDOTAEditFantasyTeamRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditFantasyTeamRequest) ProtoMessage() {} -func (*CMsgDOTAEditFantasyTeamRequest) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{13} } - -func (m *CMsgDOTAEditFantasyTeamRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAEditFantasyTeamRequest) GetTeamIndex() uint32 { - if m != nil && m.TeamIndex != nil { - return *m.TeamIndex - } - return 0 -} - -func (m *CMsgDOTAEditFantasyTeamRequest) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTAEditFantasyTeamRequest) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -type CMsgDOTAEditFantasyTeamResponse struct { - Result *CMsgDOTAEditFantasyTeamResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAEditFantasyTeamResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAEditFantasyTeamResponse) Reset() { *m = CMsgDOTAEditFantasyTeamResponse{} } -func (m *CMsgDOTAEditFantasyTeamResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAEditFantasyTeamResponse) ProtoMessage() {} -func (*CMsgDOTAEditFantasyTeamResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{14} -} - -const Default_CMsgDOTAEditFantasyTeamResponse_Result CMsgDOTAEditFantasyTeamResponse_EResult = CMsgDOTAEditFantasyTeamResponse_SUCCESS - -func (m *CMsgDOTAEditFantasyTeamResponse) GetResult() CMsgDOTAEditFantasyTeamResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAEditFantasyTeamResponse_Result -} - -type CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID) Reset() { - *m = CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID{} -} -func (m *CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{15} -} - -func (m *CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID struct { - OwnerAccountId *uint32 `protobuf:"varint,1,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID) Reset() { - *m = CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID{} -} -func (m *CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{16} -} - -func (m *CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -type CMsgDOTAFantasyTeamInfoResponse struct { - Results []*CMsgDOTAFantasyTeamInfo `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamInfoResponse) Reset() { *m = CMsgDOTAFantasyTeamInfoResponse{} } -func (m *CMsgDOTAFantasyTeamInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamInfoResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamInfoResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{17} -} - -func (m *CMsgDOTAFantasyTeamInfoResponse) GetResults() []*CMsgDOTAFantasyTeamInfo { - if m != nil { - return m.Results - } - return nil -} - -type CMsgDOTAFantasyTeamInfo struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - OwnerAccountId *uint32 `protobuf:"varint,2,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - FantasyTeamIndex *uint32 `protobuf:"varint,3,opt,name=fantasy_team_index" json:"fantasy_team_index,omitempty"` - TeamName *string `protobuf:"bytes,4,opt,name=team_name" json:"team_name,omitempty"` - TeamLogo *uint64 `protobuf:"varint,5,opt,name=team_logo" json:"team_logo,omitempty"` - Wins *uint32 `protobuf:"varint,6,opt,name=wins" json:"wins,omitempty"` - Losses *uint32 `protobuf:"varint,7,opt,name=losses" json:"losses,omitempty"` - CurrentRoster []uint32 `protobuf:"varint,8,rep,name=current_roster" json:"current_roster,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamInfo) Reset() { *m = CMsgDOTAFantasyTeamInfo{} } -func (m *CMsgDOTAFantasyTeamInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamInfo) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamInfo) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{18} } - -func (m *CMsgDOTAFantasyTeamInfo) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamInfo) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamInfo) GetFantasyTeamIndex() uint32 { - if m != nil && m.FantasyTeamIndex != nil { - return *m.FantasyTeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamInfo) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTAFantasyTeamInfo) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamInfo) GetWins() uint32 { - if m != nil && m.Wins != nil { - return *m.Wins - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamInfo) GetLosses() uint32 { - if m != nil && m.Losses != nil { - return *m.Losses - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamInfo) GetCurrentRoster() []uint32 { - if m != nil { - return m.CurrentRoster - } - return nil -} - -type CMsgDOTAFantasyTeamScoreRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - OwnerAccountId *uint32 `protobuf:"varint,2,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - FantasyTeamIndex *uint32 `protobuf:"varint,3,opt,name=fantasy_team_index" json:"fantasy_team_index,omitempty"` - FilterMatchId *uint64 `protobuf:"varint,4,opt,name=filter_match_id" json:"filter_match_id,omitempty"` - FilterStartTime *uint32 `protobuf:"varint,5,opt,name=filter_start_time" json:"filter_start_time,omitempty"` - FilterEndTime *uint32 `protobuf:"varint,6,opt,name=filter_end_time" json:"filter_end_time,omitempty"` - IncludeBench *bool `protobuf:"varint,7,opt,name=include_bench" json:"include_bench,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) Reset() { *m = CMsgDOTAFantasyTeamScoreRequest{} } -func (m *CMsgDOTAFantasyTeamScoreRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamScoreRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamScoreRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{19} -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetFantasyTeamIndex() uint32 { - if m != nil && m.FantasyTeamIndex != nil { - return *m.FantasyTeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetFilterMatchId() uint64 { - if m != nil && m.FilterMatchId != nil { - return *m.FilterMatchId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetFilterStartTime() uint32 { - if m != nil && m.FilterStartTime != nil { - return *m.FilterStartTime - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetFilterEndTime() uint32 { - if m != nil && m.FilterEndTime != nil { - return *m.FilterEndTime - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreRequest) GetIncludeBench() bool { - if m != nil && m.IncludeBench != nil { - return *m.IncludeBench - } - return false -} - -type CMsgDOTAFantasyTeamScoreResponse struct { - Result *CMsgDOTAFantasyTeamScoreResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamScoreResponse_EResult,def=0" json:"result,omitempty"` - FantasyTeamScore *float32 `protobuf:"fixed32,2,opt,name=fantasy_team_score" json:"fantasy_team_score,omitempty"` - FantasyPlayerScore []*CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore `protobuf:"bytes,3,rep,name=fantasy_player_score" json:"fantasy_player_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamScoreResponse) Reset() { *m = CMsgDOTAFantasyTeamScoreResponse{} } -func (m *CMsgDOTAFantasyTeamScoreResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamScoreResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamScoreResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{20} -} - -const Default_CMsgDOTAFantasyTeamScoreResponse_Result CMsgDOTAFantasyTeamScoreResponse_EResult = CMsgDOTAFantasyTeamScoreResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamScoreResponse) GetResult() CMsgDOTAFantasyTeamScoreResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamScoreResponse_Result -} - -func (m *CMsgDOTAFantasyTeamScoreResponse) GetFantasyTeamScore() float32 { - if m != nil && m.FantasyTeamScore != nil { - return *m.FantasyTeamScore - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreResponse) GetFantasyPlayerScore() []*CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore { - if m != nil { - return m.FantasyPlayerScore - } - return nil -} - -type CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Score *float32 `protobuf:"fixed32,2,opt,name=score" json:"score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore) Reset() { - *m = CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore{} -} -func (m *CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{20, 0} -} - -func (m *CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore) GetScore() float32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -type CMsgDOTAFantasyTeamStandingsRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Count *uint32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` - FilterStartTime *uint32 `protobuf:"varint,3,opt,name=filter_start_time" json:"filter_start_time,omitempty"` - FilterEndTime *uint32 `protobuf:"varint,4,opt,name=filter_end_time" json:"filter_end_time,omitempty"` - FilterMatchId *uint64 `protobuf:"varint,5,opt,name=filter_match_id" json:"filter_match_id,omitempty"` - FilterLastMatch *bool `protobuf:"varint,6,opt,name=filter_last_match" json:"filter_last_match,omitempty"` - FilterInHall *bool `protobuf:"varint,7,opt,name=filter_in_hall" json:"filter_in_hall,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) Reset() { *m = CMsgDOTAFantasyTeamStandingsRequest{} } -func (m *CMsgDOTAFantasyTeamStandingsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamStandingsRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamStandingsRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{21} -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetCount() uint32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetFilterStartTime() uint32 { - if m != nil && m.FilterStartTime != nil { - return *m.FilterStartTime - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetFilterEndTime() uint32 { - if m != nil && m.FilterEndTime != nil { - return *m.FilterEndTime - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetFilterMatchId() uint64 { - if m != nil && m.FilterMatchId != nil { - return *m.FilterMatchId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetFilterLastMatch() bool { - if m != nil && m.FilterLastMatch != nil { - return *m.FilterLastMatch - } - return false -} - -func (m *CMsgDOTAFantasyTeamStandingsRequest) GetFilterInHall() bool { - if m != nil && m.FilterInHall != nil { - return *m.FilterInHall - } - return false -} - -type CMsgDOTAFantasyTeamStandingsResponse struct { - Result *CMsgDOTAFantasyTeamStandingsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamStandingsResponse_EResult,def=0" json:"result,omitempty"` - TeamScores []*CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore `protobuf:"bytes,3,rep,name=team_scores" json:"team_scores,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse) Reset() { *m = CMsgDOTAFantasyTeamStandingsResponse{} } -func (m *CMsgDOTAFantasyTeamStandingsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamStandingsResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamStandingsResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{22} -} - -const Default_CMsgDOTAFantasyTeamStandingsResponse_Result CMsgDOTAFantasyTeamStandingsResponse_EResult = CMsgDOTAFantasyTeamStandingsResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamStandingsResponse) GetResult() CMsgDOTAFantasyTeamStandingsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamStandingsResponse_Result -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse) GetTeamScores() []*CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore { - if m != nil { - return m.TeamScores - } - return nil -} - -type CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - OwnerAccountId *uint32 `protobuf:"varint,2,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - FantasyTeamIndex *uint32 `protobuf:"varint,3,opt,name=fantasy_team_index" json:"fantasy_team_index,omitempty"` - FantasyTeamLogo *uint64 `protobuf:"varint,4,opt,name=fantasy_team_logo" json:"fantasy_team_logo,omitempty"` - OwnerName *string `protobuf:"bytes,5,opt,name=owner_name" json:"owner_name,omitempty"` - FantasyTeamName *string `protobuf:"bytes,6,opt,name=fantasy_team_name" json:"fantasy_team_name,omitempty"` - Score *float32 `protobuf:"fixed32,7,opt,name=score" json:"score,omitempty"` - ScoreAgainst *float32 `protobuf:"fixed32,8,opt,name=score_against" json:"score_against,omitempty"` - Wins *uint32 `protobuf:"varint,9,opt,name=wins" json:"wins,omitempty"` - Losses *uint32 `protobuf:"varint,10,opt,name=losses" json:"losses,omitempty"` - Streak *int32 `protobuf:"varint,11,opt,name=streak" json:"streak,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) Reset() { - *m = CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore{} -} -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{22, 0} -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetFantasyTeamIndex() uint32 { - if m != nil && m.FantasyTeamIndex != nil { - return *m.FantasyTeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetFantasyTeamLogo() uint64 { - if m != nil && m.FantasyTeamLogo != nil { - return *m.FantasyTeamLogo - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetOwnerName() string { - if m != nil && m.OwnerName != nil { - return *m.OwnerName - } - return "" -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetFantasyTeamName() string { - if m != nil && m.FantasyTeamName != nil { - return *m.FantasyTeamName - } - return "" -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetScore() float32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetScoreAgainst() float32 { - if m != nil && m.ScoreAgainst != nil { - return *m.ScoreAgainst - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetWins() uint32 { - if m != nil && m.Wins != nil { - return *m.Wins - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetLosses() uint32 { - if m != nil && m.Losses != nil { - return *m.Losses - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore) GetStreak() int32 { - if m != nil && m.Streak != nil { - return *m.Streak - } - return 0 -} - -type CMsgDOTAFantasyPlayerScoreRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - PlayerAccountId *uint32 `protobuf:"varint,2,opt,name=player_account_id" json:"player_account_id,omitempty"` - FilterStartTime *uint32 `protobuf:"varint,3,opt,name=filter_start_time" json:"filter_start_time,omitempty"` - FilterEndTime *uint32 `protobuf:"varint,4,opt,name=filter_end_time" json:"filter_end_time,omitempty"` - FilterMatchId *uint64 `protobuf:"varint,5,opt,name=filter_match_id" json:"filter_match_id,omitempty"` - FilterLastMatch *bool `protobuf:"varint,6,opt,name=filter_last_match" json:"filter_last_match,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) Reset() { *m = CMsgDOTAFantasyPlayerScoreRequest{} } -func (m *CMsgDOTAFantasyPlayerScoreRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerScoreRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerScoreRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{23} -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) GetPlayerAccountId() uint32 { - if m != nil && m.PlayerAccountId != nil { - return *m.PlayerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) GetFilterStartTime() uint32 { - if m != nil && m.FilterStartTime != nil { - return *m.FilterStartTime - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) GetFilterEndTime() uint32 { - if m != nil && m.FilterEndTime != nil { - return *m.FilterEndTime - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) GetFilterMatchId() uint64 { - if m != nil && m.FilterMatchId != nil { - return *m.FilterMatchId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreRequest) GetFilterLastMatch() bool { - if m != nil && m.FilterLastMatch != nil { - return *m.FilterLastMatch - } - return false -} - -type CMsgDOTAFantasyPlayerScoreResponse struct { - Result *CMsgDOTAFantasyPlayerScoreResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyPlayerScoreResponse_EResult,def=0" json:"result,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,2,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - PlayerAccountId *uint32 `protobuf:"varint,3,opt,name=player_account_id" json:"player_account_id,omitempty"` - PlayerName *string `protobuf:"bytes,4,opt,name=player_name" json:"player_name,omitempty"` - Score *float32 `protobuf:"fixed32,5,opt,name=score" json:"score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerScoreResponse) Reset() { *m = CMsgDOTAFantasyPlayerScoreResponse{} } -func (m *CMsgDOTAFantasyPlayerScoreResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerScoreResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerScoreResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{24} -} - -const Default_CMsgDOTAFantasyPlayerScoreResponse_Result CMsgDOTAFantasyPlayerScoreResponse_EResult = CMsgDOTAFantasyPlayerScoreResponse_SUCCESS - -func (m *CMsgDOTAFantasyPlayerScoreResponse) GetResult() CMsgDOTAFantasyPlayerScoreResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyPlayerScoreResponse_Result -} - -func (m *CMsgDOTAFantasyPlayerScoreResponse) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreResponse) GetPlayerAccountId() uint32 { - if m != nil && m.PlayerAccountId != nil { - return *m.PlayerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreResponse) GetPlayerName() string { - if m != nil && m.PlayerName != nil { - return *m.PlayerName - } - return "" -} - -func (m *CMsgDOTAFantasyPlayerScoreResponse) GetScore() float32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -type CMsgDOTAFantasyPlayerStandingsRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Count *uint32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` - Role *uint32 `protobuf:"varint,3,opt,name=role" json:"role,omitempty"` - FilterStartTime *uint32 `protobuf:"varint,4,opt,name=filter_start_time" json:"filter_start_time,omitempty"` - FilterEndTime *uint32 `protobuf:"varint,5,opt,name=filter_end_time" json:"filter_end_time,omitempty"` - FilterMatchId *uint64 `protobuf:"varint,6,opt,name=filter_match_id" json:"filter_match_id,omitempty"` - FilterLastMatch *bool `protobuf:"varint,7,opt,name=filter_last_match" json:"filter_last_match,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) Reset() { *m = CMsgDOTAFantasyPlayerStandingsRequest{} } -func (m *CMsgDOTAFantasyPlayerStandingsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerStandingsRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerStandingsRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{25} -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetCount() uint32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetRole() uint32 { - if m != nil && m.Role != nil { - return *m.Role - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetFilterStartTime() uint32 { - if m != nil && m.FilterStartTime != nil { - return *m.FilterStartTime - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetFilterEndTime() uint32 { - if m != nil && m.FilterEndTime != nil { - return *m.FilterEndTime - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetFilterMatchId() uint64 { - if m != nil && m.FilterMatchId != nil { - return *m.FilterMatchId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsRequest) GetFilterLastMatch() bool { - if m != nil && m.FilterLastMatch != nil { - return *m.FilterLastMatch - } - return false -} - -type CMsgDOTAFantasyPlayerStandingsResponse struct { - Result *CMsgDOTAFantasyPlayerStandingsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyPlayerStandingsResponse_EResult,def=0" json:"result,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,2,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Role *uint32 `protobuf:"varint,3,opt,name=role" json:"role,omitempty"` - PlayerScores []*CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore `protobuf:"bytes,4,rep,name=player_scores" json:"player_scores,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse) Reset() { - *m = CMsgDOTAFantasyPlayerStandingsResponse{} -} -func (m *CMsgDOTAFantasyPlayerStandingsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerStandingsResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerStandingsResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{26} -} - -const Default_CMsgDOTAFantasyPlayerStandingsResponse_Result CMsgDOTAFantasyPlayerStandingsResponse_EResult = CMsgDOTAFantasyPlayerStandingsResponse_SUCCESS - -func (m *CMsgDOTAFantasyPlayerStandingsResponse) GetResult() CMsgDOTAFantasyPlayerStandingsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyPlayerStandingsResponse_Result -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse) GetRole() uint32 { - if m != nil && m.Role != nil { - return *m.Role - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse) GetPlayerScores() []*CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore { - if m != nil { - return m.PlayerScores - } - return nil -} - -type CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore struct { - PlayerAccountId *uint32 `protobuf:"varint,1,opt,name=player_account_id" json:"player_account_id,omitempty"` - PlayerName *string `protobuf:"bytes,2,opt,name=player_name" json:"player_name,omitempty"` - Score *float32 `protobuf:"fixed32,3,opt,name=score" json:"score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) Reset() { - *m = CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore{} -} -func (m *CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{26, 0} -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) GetPlayerAccountId() uint32 { - if m != nil && m.PlayerAccountId != nil { - return *m.PlayerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) GetPlayerName() string { - if m != nil && m.PlayerName != nil { - return *m.PlayerName - } - return "" -} - -func (m *CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore) GetScore() float32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -type CMsgDOTAFantasyPlayerInfoRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerInfoRequest) Reset() { *m = CMsgDOTAFantasyPlayerInfoRequest{} } -func (m *CMsgDOTAFantasyPlayerInfoRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerInfoRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerInfoRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{27} -} - -type CMsgDOTAFantasyPlayerInfoResponse struct { - Msg *CMsgGCPlayerInfo `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerInfoResponse) Reset() { *m = CMsgDOTAFantasyPlayerInfoResponse{} } -func (m *CMsgDOTAFantasyPlayerInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerInfoResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerInfoResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{28} -} - -func (m *CMsgDOTAFantasyPlayerInfoResponse) GetMsg() *CMsgGCPlayerInfo { - if m != nil { - return m.Msg - } - return nil -} - -type CMsgDOTAFantasyLeagueCreateRequest struct { - SeasonId *uint32 `protobuf:"varint,1,opt,name=season_id" json:"season_id,omitempty"` - FantasyLeagueName *string `protobuf:"bytes,2,opt,name=fantasy_league_name" json:"fantasy_league_name,omitempty"` - Password *string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"` - TeamName *string `protobuf:"bytes,4,opt,name=team_name" json:"team_name,omitempty"` - Logo *uint64 `protobuf:"varint,5,opt,name=logo" json:"logo,omitempty"` - TicketItemId *uint64 `protobuf:"varint,6,opt,name=ticket_item_id" json:"ticket_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) Reset() { *m = CMsgDOTAFantasyLeagueCreateRequest{} } -func (m *CMsgDOTAFantasyLeagueCreateRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueCreateRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueCreateRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{29} -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) GetSeasonId() uint32 { - if m != nil && m.SeasonId != nil { - return *m.SeasonId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) GetFantasyLeagueName() string { - if m != nil && m.FantasyLeagueName != nil { - return *m.FantasyLeagueName - } - return "" -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueCreateRequest) GetTicketItemId() uint64 { - if m != nil && m.TicketItemId != nil { - return *m.TicketItemId - } - return 0 -} - -type CMsgDOTAFantasyLeagueCreateResponse struct { - Result *CMsgDOTAFantasyLeagueCreateResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueCreateResponse_EResult,def=0" json:"result,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,2,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueCreateResponse) Reset() { *m = CMsgDOTAFantasyLeagueCreateResponse{} } -func (m *CMsgDOTAFantasyLeagueCreateResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueCreateResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueCreateResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{30} -} - -const Default_CMsgDOTAFantasyLeagueCreateResponse_Result CMsgDOTAFantasyLeagueCreateResponse_EResult = CMsgDOTAFantasyLeagueCreateResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueCreateResponse) GetResult() CMsgDOTAFantasyLeagueCreateResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueCreateResponse_Result -} - -func (m *CMsgDOTAFantasyLeagueCreateResponse) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyTeamCreateRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Password *string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` - TeamName *string `protobuf:"bytes,3,opt,name=team_name" json:"team_name,omitempty"` - Logo *uint64 `protobuf:"varint,4,opt,name=logo" json:"logo,omitempty"` - TicketItemId *uint64 `protobuf:"varint,5,opt,name=ticket_item_id" json:"ticket_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamCreateRequest) Reset() { *m = CMsgDOTAFantasyTeamCreateRequest{} } -func (m *CMsgDOTAFantasyTeamCreateRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamCreateRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamCreateRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{31} -} - -func (m *CMsgDOTAFantasyTeamCreateRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamCreateRequest) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CMsgDOTAFantasyTeamCreateRequest) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTAFantasyTeamCreateRequest) GetLogo() uint64 { - if m != nil && m.Logo != nil { - return *m.Logo - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamCreateRequest) GetTicketItemId() uint64 { - if m != nil && m.TicketItemId != nil { - return *m.TicketItemId - } - return 0 -} - -type CMsgDOTAFantasyTeamCreateResponse struct { - Result *CMsgDOTAFantasyTeamCreateResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamCreateResponse_EResult,def=0" json:"result,omitempty"` - FantasyTeamIndex *uint32 `protobuf:"varint,2,opt,name=fantasy_team_index" json:"fantasy_team_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamCreateResponse) Reset() { *m = CMsgDOTAFantasyTeamCreateResponse{} } -func (m *CMsgDOTAFantasyTeamCreateResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamCreateResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamCreateResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{32} -} - -const Default_CMsgDOTAFantasyTeamCreateResponse_Result CMsgDOTAFantasyTeamCreateResponse_EResult = CMsgDOTAFantasyTeamCreateResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamCreateResponse) GetResult() CMsgDOTAFantasyTeamCreateResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamCreateResponse_Result -} - -func (m *CMsgDOTAFantasyTeamCreateResponse) GetFantasyTeamIndex() uint32 { - if m != nil && m.FantasyTeamIndex != nil { - return *m.FantasyTeamIndex - } - return 0 -} - -type CMsgDOTAFantasyLeagueEditInvitesRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Password *string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"` - InviteChange []*CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange `protobuf:"bytes,3,rep,name=invite_change" json:"invite_change,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest) Reset() { - *m = CMsgDOTAFantasyLeagueEditInvitesRequest{} -} -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueEditInvitesRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueEditInvitesRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{33} -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest) GetInviteChange() []*CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange { - if m != nil { - return m.InviteChange - } - return nil -} - -type CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Invited *bool `protobuf:"varint,2,opt,name=invited" json:"invited,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange) Reset() { - *m = CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange{} -} -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{33, 0} -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange) GetInvited() bool { - if m != nil && m.Invited != nil { - return *m.Invited - } - return false -} - -type CMsgDOTAFantasyLeagueEditInvitesResponse struct { - Result *CMsgDOTAFantasyLeagueEditInvitesResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueEditInvitesResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueEditInvitesResponse) Reset() { - *m = CMsgDOTAFantasyLeagueEditInvitesResponse{} -} -func (m *CMsgDOTAFantasyLeagueEditInvitesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueEditInvitesResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueEditInvitesResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{34} -} - -const Default_CMsgDOTAFantasyLeagueEditInvitesResponse_Result CMsgDOTAFantasyLeagueEditInvitesResponse_EResult = CMsgDOTAFantasyLeagueEditInvitesResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueEditInvitesResponse) GetResult() CMsgDOTAFantasyLeagueEditInvitesResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueEditInvitesResponse_Result -} - -type CMsgDOTAFantasyLeagueDraftStatusRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueDraftStatusRequest) Reset() { - *m = CMsgDOTAFantasyLeagueDraftStatusRequest{} -} -func (m *CMsgDOTAFantasyLeagueDraftStatusRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueDraftStatusRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueDraftStatusRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{35} -} - -func (m *CMsgDOTAFantasyLeagueDraftStatusRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyLeagueDraftStatus struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - DraftOrder []uint32 `protobuf:"varint,2,rep,name=draft_order" json:"draft_order,omitempty"` - CurrentPick *uint32 `protobuf:"varint,3,opt,name=current_pick" json:"current_pick,omitempty"` - TimeRemaining *uint32 `protobuf:"varint,4,opt,name=time_remaining" json:"time_remaining,omitempty"` - PendingResume *bool `protobuf:"varint,5,opt,name=pending_resume" json:"pending_resume,omitempty"` - Completed *bool `protobuf:"varint,6,opt,name=completed" json:"completed,omitempty"` - AvailablePlayers []uint32 `protobuf:"varint,7,rep,name=available_players" json:"available_players,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) Reset() { *m = CMsgDOTAFantasyLeagueDraftStatus{} } -func (m *CMsgDOTAFantasyLeagueDraftStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueDraftStatus) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueDraftStatus) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{36} -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetDraftOrder() []uint32 { - if m != nil { - return m.DraftOrder - } - return nil -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetCurrentPick() uint32 { - if m != nil && m.CurrentPick != nil { - return *m.CurrentPick - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetTimeRemaining() uint32 { - if m != nil && m.TimeRemaining != nil { - return *m.TimeRemaining - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetPendingResume() bool { - if m != nil && m.PendingResume != nil { - return *m.PendingResume - } - return false -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetCompleted() bool { - if m != nil && m.Completed != nil { - return *m.Completed - } - return false -} - -func (m *CMsgDOTAFantasyLeagueDraftStatus) GetAvailablePlayers() []uint32 { - if m != nil { - return m.AvailablePlayers - } - return nil -} - -type CMsgDOTAFantasyLeagueDraftPlayerRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - TeamIndex *uint32 `protobuf:"varint,2,opt,name=team_index" json:"team_index,omitempty"` - PlayerAccountId *uint32 `protobuf:"varint,3,opt,name=player_account_id" json:"player_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueDraftPlayerRequest) Reset() { - *m = CMsgDOTAFantasyLeagueDraftPlayerRequest{} -} -func (m *CMsgDOTAFantasyLeagueDraftPlayerRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueDraftPlayerRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueDraftPlayerRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{37} -} - -func (m *CMsgDOTAFantasyLeagueDraftPlayerRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueDraftPlayerRequest) GetTeamIndex() uint32 { - if m != nil && m.TeamIndex != nil { - return *m.TeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyLeagueDraftPlayerRequest) GetPlayerAccountId() uint32 { - if m != nil && m.PlayerAccountId != nil { - return *m.PlayerAccountId - } - return 0 -} - -type CMsgDOTAFantasyLeagueDraftPlayerResponse struct { - Result *CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeagueDraftPlayerResponse) Reset() { - *m = CMsgDOTAFantasyLeagueDraftPlayerResponse{} -} -func (m *CMsgDOTAFantasyLeagueDraftPlayerResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeagueDraftPlayerResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeagueDraftPlayerResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{38} -} - -const Default_CMsgDOTAFantasyLeagueDraftPlayerResponse_Result CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult = CMsgDOTAFantasyLeagueDraftPlayerResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeagueDraftPlayerResponse) GetResult() CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeagueDraftPlayerResponse_Result -} - -type CMsgDOTAFantasyTeamRosterSwapRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - TeamIndex *uint32 `protobuf:"varint,2,opt,name=team_index" json:"team_index,omitempty"` - Timestamp *uint32 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` - Slot_1 *uint32 `protobuf:"varint,4,opt,name=slot_1" json:"slot_1,omitempty"` - Slot_2 *uint32 `protobuf:"varint,5,opt,name=slot_2" json:"slot_2,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) Reset() { *m = CMsgDOTAFantasyTeamRosterSwapRequest{} } -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamRosterSwapRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamRosterSwapRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{39} -} - -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) GetTeamIndex() uint32 { - if m != nil && m.TeamIndex != nil { - return *m.TeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) GetSlot_1() uint32 { - if m != nil && m.Slot_1 != nil { - return *m.Slot_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterSwapRequest) GetSlot_2() uint32 { - if m != nil && m.Slot_2 != nil { - return *m.Slot_2 - } - return 0 -} - -type CMsgDOTAFantasyTeamRosterSwapResponse struct { - Result *CMsgDOTAFantasyTeamRosterSwapResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamRosterSwapResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamRosterSwapResponse) Reset() { *m = CMsgDOTAFantasyTeamRosterSwapResponse{} } -func (m *CMsgDOTAFantasyTeamRosterSwapResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamRosterSwapResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamRosterSwapResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{40} -} - -const Default_CMsgDOTAFantasyTeamRosterSwapResponse_Result CMsgDOTAFantasyTeamRosterSwapResponse_EResult = CMsgDOTAFantasyTeamRosterSwapResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamRosterSwapResponse) GetResult() CMsgDOTAFantasyTeamRosterSwapResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamRosterSwapResponse_Result -} - -type CMsgDOTAFantasyTeamRosterAddDropRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - TeamIndex *uint32 `protobuf:"varint,2,opt,name=team_index" json:"team_index,omitempty"` - AddAccountId *uint32 `protobuf:"varint,5,opt,name=add_account_id" json:"add_account_id,omitempty"` - DropAccountId *uint32 `protobuf:"varint,6,opt,name=drop_account_id" json:"drop_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamRosterAddDropRequest) Reset() { - *m = CMsgDOTAFantasyTeamRosterAddDropRequest{} -} -func (m *CMsgDOTAFantasyTeamRosterAddDropRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamRosterAddDropRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamRosterAddDropRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{41} -} - -func (m *CMsgDOTAFantasyTeamRosterAddDropRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterAddDropRequest) GetTeamIndex() uint32 { - if m != nil && m.TeamIndex != nil { - return *m.TeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterAddDropRequest) GetAddAccountId() uint32 { - if m != nil && m.AddAccountId != nil { - return *m.AddAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterAddDropRequest) GetDropAccountId() uint32 { - if m != nil && m.DropAccountId != nil { - return *m.DropAccountId - } - return 0 -} - -type CMsgDOTAFantasyTeamRosterAddDropResponse struct { - Result *CMsgDOTAFantasyTeamRosterAddDropResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamRosterAddDropResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamRosterAddDropResponse) Reset() { - *m = CMsgDOTAFantasyTeamRosterAddDropResponse{} -} -func (m *CMsgDOTAFantasyTeamRosterAddDropResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamRosterAddDropResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamRosterAddDropResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{42} -} - -const Default_CMsgDOTAFantasyTeamRosterAddDropResponse_Result CMsgDOTAFantasyTeamRosterAddDropResponse_EResult = CMsgDOTAFantasyTeamRosterAddDropResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamRosterAddDropResponse) GetResult() CMsgDOTAFantasyTeamRosterAddDropResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamRosterAddDropResponse_Result -} - -type CMsgDOTAFantasyTeamTradesRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamTradesRequest) Reset() { *m = CMsgDOTAFantasyTeamTradesRequest{} } -func (m *CMsgDOTAFantasyTeamTradesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamTradesRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamTradesRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{43} -} - -func (m *CMsgDOTAFantasyTeamTradesRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyTeamTradesResponse struct { - Result *CMsgDOTAFantasyTeamTradesResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamTradesResponse_EResult,def=0" json:"result,omitempty"` - Trades []*CMsgDOTAFantasyTeamTradesResponse_Trade `protobuf:"bytes,2,rep,name=trades" json:"trades,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamTradesResponse) Reset() { *m = CMsgDOTAFantasyTeamTradesResponse{} } -func (m *CMsgDOTAFantasyTeamTradesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamTradesResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamTradesResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{44} -} - -const Default_CMsgDOTAFantasyTeamTradesResponse_Result CMsgDOTAFantasyTeamTradesResponse_EResult = CMsgDOTAFantasyTeamTradesResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamTradesResponse) GetResult() CMsgDOTAFantasyTeamTradesResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamTradesResponse_Result -} - -func (m *CMsgDOTAFantasyTeamTradesResponse) GetTrades() []*CMsgDOTAFantasyTeamTradesResponse_Trade { - if m != nil { - return m.Trades - } - return nil -} - -type CMsgDOTAFantasyTeamTradesResponse_Trade struct { - Timestamp *uint32 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - OwnerAccountId_1 *uint32 `protobuf:"varint,2,opt,name=owner_account_id_1" json:"owner_account_id_1,omitempty"` - OwnerAccountId_2 *uint32 `protobuf:"varint,3,opt,name=owner_account_id_2" json:"owner_account_id_2,omitempty"` - PlayerAccountId_1 *uint32 `protobuf:"varint,4,opt,name=player_account_id_1" json:"player_account_id_1,omitempty"` - PlayerAccountId_2 *uint32 `protobuf:"varint,5,opt,name=player_account_id_2" json:"player_account_id_2,omitempty"` - Status *uint32 `protobuf:"varint,6,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) Reset() { - *m = CMsgDOTAFantasyTeamTradesResponse_Trade{} -} -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamTradesResponse_Trade) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamTradesResponse_Trade) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{44, 0} -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) GetOwnerAccountId_1() uint32 { - if m != nil && m.OwnerAccountId_1 != nil { - return *m.OwnerAccountId_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) GetOwnerAccountId_2() uint32 { - if m != nil && m.OwnerAccountId_2 != nil { - return *m.OwnerAccountId_2 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) GetPlayerAccountId_1() uint32 { - if m != nil && m.PlayerAccountId_1 != nil { - return *m.PlayerAccountId_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) GetPlayerAccountId_2() uint32 { - if m != nil && m.PlayerAccountId_2 != nil { - return *m.PlayerAccountId_2 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradesResponse_Trade) GetStatus() uint32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CMsgDOTAFantasyTeamTradeCancelRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - TeamIndex_1 *uint32 `protobuf:"varint,3,opt,name=team_index_1" json:"team_index_1,omitempty"` - OwnerAccountId_2 *uint32 `protobuf:"varint,4,opt,name=owner_account_id_2" json:"owner_account_id_2,omitempty"` - TeamIndex_2 *uint32 `protobuf:"varint,5,opt,name=team_index_2" json:"team_index_2,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamTradeCancelRequest) Reset() { *m = CMsgDOTAFantasyTeamTradeCancelRequest{} } -func (m *CMsgDOTAFantasyTeamTradeCancelRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamTradeCancelRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamTradeCancelRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{45} -} - -func (m *CMsgDOTAFantasyTeamTradeCancelRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradeCancelRequest) GetTeamIndex_1() uint32 { - if m != nil && m.TeamIndex_1 != nil { - return *m.TeamIndex_1 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradeCancelRequest) GetOwnerAccountId_2() uint32 { - if m != nil && m.OwnerAccountId_2 != nil { - return *m.OwnerAccountId_2 - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamTradeCancelRequest) GetTeamIndex_2() uint32 { - if m != nil && m.TeamIndex_2 != nil { - return *m.TeamIndex_2 - } - return 0 -} - -type CMsgDOTAFantasyTeamTradeCancelResponse struct { - Result *CMsgDOTAFantasyTeamTradeCancelResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamTradeCancelResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamTradeCancelResponse) Reset() { - *m = CMsgDOTAFantasyTeamTradeCancelResponse{} -} -func (m *CMsgDOTAFantasyTeamTradeCancelResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamTradeCancelResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamTradeCancelResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{46} -} - -const Default_CMsgDOTAFantasyTeamTradeCancelResponse_Result CMsgDOTAFantasyTeamTradeCancelResponse_EResult = CMsgDOTAFantasyTeamTradeCancelResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamTradeCancelResponse) GetResult() CMsgDOTAFantasyTeamTradeCancelResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamTradeCancelResponse_Result -} - -type CMsgDOTAFantasyTeamRosterRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - TeamIndex *uint32 `protobuf:"varint,2,opt,name=team_index" json:"team_index,omitempty"` - OwnerAccountId *uint32 `protobuf:"varint,3,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - Timestamp *uint32 `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamRosterRequest) Reset() { *m = CMsgDOTAFantasyTeamRosterRequest{} } -func (m *CMsgDOTAFantasyTeamRosterRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamRosterRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamRosterRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{47} -} - -func (m *CMsgDOTAFantasyTeamRosterRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterRequest) GetTeamIndex() uint32 { - if m != nil && m.TeamIndex != nil { - return *m.TeamIndex - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterRequest) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyTeamRosterRequest) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -type CMsgDOTAFantasyTeamRosterResponse struct { - Result *CMsgDOTAFantasyTeamRosterResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyTeamRosterResponse_EResult,def=0" json:"result,omitempty"` - PlayerAccountIds []uint32 `protobuf:"varint,2,rep,name=player_account_ids" json:"player_account_ids,omitempty"` - PlayerLocked []bool `protobuf:"varint,3,rep,name=player_locked" json:"player_locked,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyTeamRosterResponse) Reset() { *m = CMsgDOTAFantasyTeamRosterResponse{} } -func (m *CMsgDOTAFantasyTeamRosterResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyTeamRosterResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyTeamRosterResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{48} -} - -const Default_CMsgDOTAFantasyTeamRosterResponse_Result CMsgDOTAFantasyTeamRosterResponse_EResult = CMsgDOTAFantasyTeamRosterResponse_SUCCESS - -func (m *CMsgDOTAFantasyTeamRosterResponse) GetResult() CMsgDOTAFantasyTeamRosterResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyTeamRosterResponse_Result -} - -func (m *CMsgDOTAFantasyTeamRosterResponse) GetPlayerAccountIds() []uint32 { - if m != nil { - return m.PlayerAccountIds - } - return nil -} - -func (m *CMsgDOTAFantasyTeamRosterResponse) GetPlayerLocked() []bool { - if m != nil { - return m.PlayerLocked - } - return nil -} - -type CMsgDOTAFantasyPlayerHisoricalStatsRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsRequest) Reset() { - *m = CMsgDOTAFantasyPlayerHisoricalStatsRequest{} -} -func (m *CMsgDOTAFantasyPlayerHisoricalStatsRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyPlayerHisoricalStatsRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerHisoricalStatsRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{49} -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyPlayerHisoricalStatsResponse struct { - Result *CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult,def=0" json:"result,omitempty"` - Stats []*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats `protobuf:"bytes,2,rep,name=stats" json:"stats,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse) Reset() { - *m = CMsgDOTAFantasyPlayerHisoricalStatsResponse{} -} -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyPlayerHisoricalStatsResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerHisoricalStatsResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{50} -} - -const Default_CMsgDOTAFantasyPlayerHisoricalStatsResponse_Result CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult = CMsgDOTAFantasyPlayerHisoricalStatsResponse_SUCCESS - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse) GetResult() CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyPlayerHisoricalStatsResponse_Result -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse) GetStats() []*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats { - if m != nil { - return m.Stats - } - return nil -} - -type CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator struct { - Matches *uint32 `protobuf:"varint,1,opt,name=matches" json:"matches,omitempty"` - Levels *float32 `protobuf:"fixed32,2,opt,name=levels" json:"levels,omitempty"` - Kills *float32 `protobuf:"fixed32,3,opt,name=kills" json:"kills,omitempty"` - Deaths *float32 `protobuf:"fixed32,4,opt,name=deaths" json:"deaths,omitempty"` - Assists *float32 `protobuf:"fixed32,5,opt,name=assists" json:"assists,omitempty"` - LastHits *float32 `protobuf:"fixed32,6,opt,name=last_hits" json:"last_hits,omitempty"` - Denies *float32 `protobuf:"fixed32,7,opt,name=denies" json:"denies,omitempty"` - Gpm *float32 `protobuf:"fixed32,8,opt,name=gpm" json:"gpm,omitempty"` - Xppm *float32 `protobuf:"fixed32,9,opt,name=xppm" json:"xppm,omitempty"` - Stuns *float32 `protobuf:"fixed32,10,opt,name=stuns" json:"stuns,omitempty"` - Healing *float32 `protobuf:"fixed32,11,opt,name=healing" json:"healing,omitempty"` - TowerKills *float32 `protobuf:"fixed32,12,opt,name=tower_kills" json:"tower_kills,omitempty"` - RoshanKills *float32 `protobuf:"fixed32,13,opt,name=roshan_kills" json:"roshan_kills,omitempty"` - Score *float32 `protobuf:"fixed32,14,opt,name=score" json:"score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) Reset() { - *m = CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator{} -} -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{50, 0} -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetMatches() uint32 { - if m != nil && m.Matches != nil { - return *m.Matches - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetLevels() float32 { - if m != nil && m.Levels != nil { - return *m.Levels - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetKills() float32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetDeaths() float32 { - if m != nil && m.Deaths != nil { - return *m.Deaths - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetAssists() float32 { - if m != nil && m.Assists != nil { - return *m.Assists - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetLastHits() float32 { - if m != nil && m.LastHits != nil { - return *m.LastHits - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetDenies() float32 { - if m != nil && m.Denies != nil { - return *m.Denies - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetGpm() float32 { - if m != nil && m.Gpm != nil { - return *m.Gpm - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetXppm() float32 { - if m != nil && m.Xppm != nil { - return *m.Xppm - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetStuns() float32 { - if m != nil && m.Stuns != nil { - return *m.Stuns - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetHealing() float32 { - if m != nil && m.Healing != nil { - return *m.Healing - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetTowerKills() float32 { - if m != nil && m.TowerKills != nil { - return *m.TowerKills - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetRoshanKills() float32 { - if m != nil && m.RoshanKills != nil { - return *m.RoshanKills - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator) GetScore() float32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -type CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Weeks *uint32 `protobuf:"varint,2,opt,name=weeks" json:"weeks,omitempty"` - StatsPremium *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator `protobuf:"bytes,4,opt,name=stats_premium" json:"stats_premium,omitempty"` - StatsProfessional *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator `protobuf:"bytes,5,opt,name=stats_professional" json:"stats_professional,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) Reset() { - *m = CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats{} -} -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{50, 1} -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) GetWeeks() uint32 { - if m != nil && m.Weeks != nil { - return *m.Weeks - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) GetStatsPremium() *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator { - if m != nil { - return m.StatsPremium - } - return nil -} - -func (m *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats) GetStatsProfessional() *CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator { - if m != nil { - return m.StatsProfessional - } - return nil -} - -type CMsgDOTAFantasyMessageAdd struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyMessageAdd) Reset() { *m = CMsgDOTAFantasyMessageAdd{} } -func (m *CMsgDOTAFantasyMessageAdd) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyMessageAdd) ProtoMessage() {} -func (*CMsgDOTAFantasyMessageAdd) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{51} } - -func (m *CMsgDOTAFantasyMessageAdd) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyMessageAdd) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type CMsgDOTAFantasyMessagesRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - StartMessage *uint32 `protobuf:"varint,2,opt,name=start_message" json:"start_message,omitempty"` - EndMessage *uint32 `protobuf:"varint,3,opt,name=end_message" json:"end_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyMessagesRequest) Reset() { *m = CMsgDOTAFantasyMessagesRequest{} } -func (m *CMsgDOTAFantasyMessagesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyMessagesRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyMessagesRequest) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{52} } - -func (m *CMsgDOTAFantasyMessagesRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyMessagesRequest) GetStartMessage() uint32 { - if m != nil && m.StartMessage != nil { - return *m.StartMessage - } - return 0 -} - -func (m *CMsgDOTAFantasyMessagesRequest) GetEndMessage() uint32 { - if m != nil && m.EndMessage != nil { - return *m.EndMessage - } - return 0 -} - -type CMsgDOTAFantasyMessagesResponse struct { - Result *CMsgDOTAFantasyMessagesResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyMessagesResponse_EResult,def=0" json:"result,omitempty"` - Messages []*CMsgDOTAFantasyMessagesResponse_Message `protobuf:"bytes,2,rep,name=messages" json:"messages,omitempty"` - NumTotalMessages *uint32 `protobuf:"varint,3,opt,name=num_total_messages" json:"num_total_messages,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyMessagesResponse) Reset() { *m = CMsgDOTAFantasyMessagesResponse{} } -func (m *CMsgDOTAFantasyMessagesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyMessagesResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyMessagesResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{53} -} - -const Default_CMsgDOTAFantasyMessagesResponse_Result CMsgDOTAFantasyMessagesResponse_EResult = CMsgDOTAFantasyMessagesResponse_SUCCESS - -func (m *CMsgDOTAFantasyMessagesResponse) GetResult() CMsgDOTAFantasyMessagesResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyMessagesResponse_Result -} - -func (m *CMsgDOTAFantasyMessagesResponse) GetMessages() []*CMsgDOTAFantasyMessagesResponse_Message { - if m != nil { - return m.Messages - } - return nil -} - -func (m *CMsgDOTAFantasyMessagesResponse) GetNumTotalMessages() uint32 { - if m != nil && m.NumTotalMessages != nil { - return *m.NumTotalMessages - } - return 0 -} - -type CMsgDOTAFantasyMessagesResponse_Message struct { - MessageId *uint32 `protobuf:"varint,1,opt,name=message_id" json:"message_id,omitempty"` - Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - AuthorAccountId *uint32 `protobuf:"varint,3,opt,name=author_account_id" json:"author_account_id,omitempty"` - Time *uint32 `protobuf:"varint,4,opt,name=time" json:"time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyMessagesResponse_Message) Reset() { - *m = CMsgDOTAFantasyMessagesResponse_Message{} -} -func (m *CMsgDOTAFantasyMessagesResponse_Message) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyMessagesResponse_Message) ProtoMessage() {} -func (*CMsgDOTAFantasyMessagesResponse_Message) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{53, 0} -} - -func (m *CMsgDOTAFantasyMessagesResponse_Message) GetMessageId() uint32 { - if m != nil && m.MessageId != nil { - return *m.MessageId - } - return 0 -} - -func (m *CMsgDOTAFantasyMessagesResponse_Message) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgDOTAFantasyMessagesResponse_Message) GetAuthorAccountId() uint32 { - if m != nil && m.AuthorAccountId != nil { - return *m.AuthorAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyMessagesResponse_Message) GetTime() uint32 { - if m != nil && m.Time != nil { - return *m.Time - } - return 0 -} - -type CMsgDOTAFantasyRemoveOwner struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - OwnerAccountId *uint32 `protobuf:"varint,2,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - TeamIndex *uint32 `protobuf:"varint,3,opt,name=team_index" json:"team_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyRemoveOwner) Reset() { *m = CMsgDOTAFantasyRemoveOwner{} } -func (m *CMsgDOTAFantasyRemoveOwner) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyRemoveOwner) ProtoMessage() {} -func (*CMsgDOTAFantasyRemoveOwner) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{54} } - -func (m *CMsgDOTAFantasyRemoveOwner) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyRemoveOwner) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyRemoveOwner) GetTeamIndex() uint32 { - if m != nil && m.TeamIndex != nil { - return *m.TeamIndex - } - return 0 -} - -type CMsgDOTAFantasyRemoveOwnerResponse struct { - Result *CMsgDOTAFantasyRemoveOwnerResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyRemoveOwnerResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyRemoveOwnerResponse) Reset() { *m = CMsgDOTAFantasyRemoveOwnerResponse{} } -func (m *CMsgDOTAFantasyRemoveOwnerResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyRemoveOwnerResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyRemoveOwnerResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{55} -} - -const Default_CMsgDOTAFantasyRemoveOwnerResponse_Result CMsgDOTAFantasyRemoveOwnerResponse_EResult = CMsgDOTAFantasyRemoveOwnerResponse_SUCCESS - -func (m *CMsgDOTAFantasyRemoveOwnerResponse) GetResult() CMsgDOTAFantasyRemoveOwnerResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyRemoveOwnerResponse_Result -} - -type CMsgDOTAFantasyScheduledMatchesRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyScheduledMatchesRequest) Reset() { - *m = CMsgDOTAFantasyScheduledMatchesRequest{} -} -func (m *CMsgDOTAFantasyScheduledMatchesRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyScheduledMatchesRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyScheduledMatchesRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{56} -} - -func (m *CMsgDOTAFantasyScheduledMatchesRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAFantasyScheduledMatchesResponse struct { - Result *CMsgDOTAFantasyScheduledMatchesResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyScheduledMatchesResponse_EResult,def=0" json:"result,omitempty"` - ScheduledMatchDays []*CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays `protobuf:"bytes,2,rep,name=scheduled_match_days" json:"scheduled_match_days,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyScheduledMatchesResponse) Reset() { - *m = CMsgDOTAFantasyScheduledMatchesResponse{} -} -func (m *CMsgDOTAFantasyScheduledMatchesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyScheduledMatchesResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyScheduledMatchesResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{57} -} - -const Default_CMsgDOTAFantasyScheduledMatchesResponse_Result CMsgDOTAFantasyScheduledMatchesResponse_EResult = CMsgDOTAFantasyScheduledMatchesResponse_SUCCESS - -func (m *CMsgDOTAFantasyScheduledMatchesResponse) GetResult() CMsgDOTAFantasyScheduledMatchesResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyScheduledMatchesResponse_Result -} - -func (m *CMsgDOTAFantasyScheduledMatchesResponse) GetScheduledMatchDays() []*CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays { - if m != nil { - return m.ScheduledMatchDays - } - return nil -} - -type CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays struct { - Timestamp *uint32 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - TeamIds []uint32 `protobuf:"varint,2,rep,name=team_ids" json:"team_ids,omitempty"` - LeagueIds []uint32 `protobuf:"varint,3,rep,name=league_ids" json:"league_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) Reset() { - *m = CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays{} -} -func (m *CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) ProtoMessage() {} -func (*CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{57, 0} -} - -func (m *CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) GetTeamIds() []uint32 { - if m != nil { - return m.TeamIds - } - return nil -} - -func (m *CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays) GetLeagueIds() []uint32 { - if m != nil { - return m.LeagueIds - } - return nil -} - -type CMsgDOTAFantasyLeaveLeagueRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - FantasyTeamIndex *uint32 `protobuf:"varint,2,opt,name=fantasy_team_index" json:"fantasy_team_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeaveLeagueRequest) Reset() { *m = CMsgDOTAFantasyLeaveLeagueRequest{} } -func (m *CMsgDOTAFantasyLeaveLeagueRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeaveLeagueRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyLeaveLeagueRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{58} -} - -func (m *CMsgDOTAFantasyLeaveLeagueRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyLeaveLeagueRequest) GetFantasyTeamIndex() uint32 { - if m != nil && m.FantasyTeamIndex != nil { - return *m.FantasyTeamIndex - } - return 0 -} - -type CMsgDOTAFantasyLeaveLeagueResponse struct { - Result *CMsgDOTAFantasyLeaveLeagueResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyLeaveLeagueResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyLeaveLeagueResponse) Reset() { *m = CMsgDOTAFantasyLeaveLeagueResponse{} } -func (m *CMsgDOTAFantasyLeaveLeagueResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyLeaveLeagueResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyLeaveLeagueResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{59} -} - -const Default_CMsgDOTAFantasyLeaveLeagueResponse_Result CMsgDOTAFantasyLeaveLeagueResponse_EResult = CMsgDOTAFantasyLeaveLeagueResponse_SUCCESS - -func (m *CMsgDOTAFantasyLeaveLeagueResponse) GetResult() CMsgDOTAFantasyLeaveLeagueResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyLeaveLeagueResponse_Result -} - -type CMsgDOTAFantasyPlayerScoreDetailsRequest struct { - FantasyLeagueId *uint32 `protobuf:"varint,1,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - PlayerAccountId *uint32 `protobuf:"varint,2,opt,name=player_account_id" json:"player_account_id,omitempty"` - StartTime *uint32 `protobuf:"varint,3,opt,name=start_time" json:"start_time,omitempty"` - EndTime *uint32 `protobuf:"varint,4,opt,name=end_time" json:"end_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsRequest) Reset() { - *m = CMsgDOTAFantasyPlayerScoreDetailsRequest{} -} -func (m *CMsgDOTAFantasyPlayerScoreDetailsRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerScoreDetailsRequest) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerScoreDetailsRequest) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{60} -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsRequest) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsRequest) GetPlayerAccountId() uint32 { - if m != nil && m.PlayerAccountId != nil { - return *m.PlayerAccountId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsRequest) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsRequest) GetEndTime() uint32 { - if m != nil && m.EndTime != nil { - return *m.EndTime - } - return 0 -} - -type CMsgDOTAFantasyPlayerScoreDetailsResponse struct { - Result *CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult,def=0" json:"result,omitempty"` - Data []*CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData `protobuf:"bytes,2,rep,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse) Reset() { - *m = CMsgDOTAFantasyPlayerScoreDetailsResponse{} -} -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAFantasyPlayerScoreDetailsResponse) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerScoreDetailsResponse) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{61} -} - -const Default_CMsgDOTAFantasyPlayerScoreDetailsResponse_Result CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult = CMsgDOTAFantasyPlayerScoreDetailsResponse_SUCCESS - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse) GetResult() CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTAFantasyPlayerScoreDetailsResponse_Result -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse) GetData() []*CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData { - if m != nil { - return m.Data - } - return nil -} - -type CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - SeriesId *uint32 `protobuf:"varint,2,opt,name=series_id" json:"series_id,omitempty"` - SeriesNum *uint32 `protobuf:"varint,3,opt,name=series_num" json:"series_num,omitempty"` - SeriesType *uint32 `protobuf:"varint,4,opt,name=series_type" json:"series_type,omitempty"` - LeagueTier *uint32 `protobuf:"varint,5,opt,name=league_tier" json:"league_tier,omitempty"` - LeagueId *uint32 `protobuf:"varint,6,opt,name=league_id" json:"league_id,omitempty"` - OpposingTeamId *uint32 `protobuf:"varint,7,opt,name=opposing_team_id" json:"opposing_team_id,omitempty"` - OpposingTeamLogo *uint64 `protobuf:"varint,8,opt,name=opposing_team_logo" json:"opposing_team_logo,omitempty"` - OpposingTeamName *string `protobuf:"bytes,9,opt,name=opposing_team_name" json:"opposing_team_name,omitempty"` - Stats *CMsgFantasyLeagueScoring `protobuf:"bytes,10,opt,name=stats" json:"stats,omitempty"` - OwnedBy *uint32 `protobuf:"varint,11,opt,name=owned_by" json:"owned_by,omitempty"` - Benched *bool `protobuf:"varint,12,opt,name=benched" json:"benched,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) Reset() { - *m = CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData{} -} -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) ProtoMessage() {} -func (*CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{61, 0} -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetSeriesId() uint32 { - if m != nil && m.SeriesId != nil { - return *m.SeriesId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetSeriesNum() uint32 { - if m != nil && m.SeriesNum != nil { - return *m.SeriesNum - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetLeagueTier() uint32 { - if m != nil && m.LeagueTier != nil { - return *m.LeagueTier - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetOpposingTeamId() uint32 { - if m != nil && m.OpposingTeamId != nil { - return *m.OpposingTeamId - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetOpposingTeamLogo() uint64 { - if m != nil && m.OpposingTeamLogo != nil { - return *m.OpposingTeamLogo - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetOpposingTeamName() string { - if m != nil && m.OpposingTeamName != nil { - return *m.OpposingTeamName - } - return "" -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetStats() *CMsgFantasyLeagueScoring { - if m != nil { - return m.Stats - } - return nil -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetOwnedBy() uint32 { - if m != nil && m.OwnedBy != nil { - return *m.OwnedBy - } - return 0 -} - -func (m *CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData) GetBenched() bool { - if m != nil && m.Benched != nil { - return *m.Benched - } - return false -} - -type CMsgDOTATournament struct { - Teams []*CMsgDOTATournament_Team `protobuf:"bytes,1,rep,name=teams" json:"teams,omitempty"` - Games []*CMsgDOTATournament_Game `protobuf:"bytes,2,rep,name=games" json:"games,omitempty"` - Gid *uint64 `protobuf:"varint,3,opt,name=gid" json:"gid,omitempty"` - TournamentId *uint32 `protobuf:"varint,4,opt,name=tournament_id" json:"tournament_id,omitempty"` - TournamentType *ETournamentType `protobuf:"varint,5,opt,name=tournament_type,enum=ETournamentType,def=0" json:"tournament_type,omitempty"` - TournamentTemplate *ETournamentTemplate `protobuf:"varint,6,opt,name=tournament_template,enum=ETournamentTemplate,def=0" json:"tournament_template,omitempty"` - LeagueId *uint32 `protobuf:"varint,7,opt,name=league_id" json:"league_id,omitempty"` - StartTime *uint32 `protobuf:"varint,8,opt,name=start_time" json:"start_time,omitempty"` - State *ETournamentState `protobuf:"varint,9,opt,name=state,enum=ETournamentState,def=0" json:"state,omitempty"` - Nodes []*CMsgDOTATournament_Node `protobuf:"bytes,10,rep,name=nodes" json:"nodes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATournament) Reset() { *m = CMsgDOTATournament{} } -func (m *CMsgDOTATournament) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATournament) ProtoMessage() {} -func (*CMsgDOTATournament) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{62} } - -const Default_CMsgDOTATournament_TournamentType ETournamentType = ETournamentType_k_ETournamentType_Unknown -const Default_CMsgDOTATournament_TournamentTemplate ETournamentTemplate = ETournamentTemplate_k_ETournamentTemplate_None -const Default_CMsgDOTATournament_State ETournamentState = ETournamentState_k_ETournamentState_Unknown - -func (m *CMsgDOTATournament) GetTeams() []*CMsgDOTATournament_Team { - if m != nil { - return m.Teams - } - return nil -} - -func (m *CMsgDOTATournament) GetGames() []*CMsgDOTATournament_Game { - if m != nil { - return m.Games - } - return nil -} - -func (m *CMsgDOTATournament) GetGid() uint64 { - if m != nil && m.Gid != nil { - return *m.Gid - } - return 0 -} - -func (m *CMsgDOTATournament) GetTournamentId() uint32 { - if m != nil && m.TournamentId != nil { - return *m.TournamentId - } - return 0 -} - -func (m *CMsgDOTATournament) GetTournamentType() ETournamentType { - if m != nil && m.TournamentType != nil { - return *m.TournamentType - } - return Default_CMsgDOTATournament_TournamentType -} - -func (m *CMsgDOTATournament) GetTournamentTemplate() ETournamentTemplate { - if m != nil && m.TournamentTemplate != nil { - return *m.TournamentTemplate - } - return Default_CMsgDOTATournament_TournamentTemplate -} - -func (m *CMsgDOTATournament) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTATournament) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTATournament) GetState() ETournamentState { - if m != nil && m.State != nil { - return *m.State - } - return Default_CMsgDOTATournament_State -} - -func (m *CMsgDOTATournament) GetNodes() []*CMsgDOTATournament_Node { - if m != nil { - return m.Nodes - } - return nil -} - -type CMsgDOTATournament_Team struct { - TeamId *uint32 `protobuf:"varint,1,opt,name=team_id" json:"team_id,omitempty"` - TeamName *string `protobuf:"bytes,2,opt,name=team_name" json:"team_name,omitempty"` - TeamAbbrev *string `protobuf:"bytes,3,opt,name=team_abbrev" json:"team_abbrev,omitempty"` - Players []uint32 `protobuf:"varint,4,rep,packed,name=players" json:"players,omitempty"` - Seed *uint32 `protobuf:"varint,5,opt,name=seed" json:"seed,omitempty"` - TeamLogo *uint64 `protobuf:"varint,6,opt,name=team_logo" json:"team_logo,omitempty"` - CountryCode *string `protobuf:"bytes,7,opt,name=country_code" json:"country_code,omitempty"` - NodeOrState *uint32 `protobuf:"varint,8,opt,name=node_or_state" json:"node_or_state,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATournament_Team) Reset() { *m = CMsgDOTATournament_Team{} } -func (m *CMsgDOTATournament_Team) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATournament_Team) ProtoMessage() {} -func (*CMsgDOTATournament_Team) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{62, 0} } - -func (m *CMsgDOTATournament_Team) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTATournament_Team) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTATournament_Team) GetTeamAbbrev() string { - if m != nil && m.TeamAbbrev != nil { - return *m.TeamAbbrev - } - return "" -} - -func (m *CMsgDOTATournament_Team) GetPlayers() []uint32 { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgDOTATournament_Team) GetSeed() uint32 { - if m != nil && m.Seed != nil { - return *m.Seed - } - return 0 -} - -func (m *CMsgDOTATournament_Team) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -func (m *CMsgDOTATournament_Team) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CMsgDOTATournament_Team) GetNodeOrState() uint32 { - if m != nil && m.NodeOrState != nil { - return *m.NodeOrState - } - return 0 -} - -type CMsgDOTATournament_Game struct { - GameId *uint32 `protobuf:"varint,1,opt,name=game_id" json:"game_id,omitempty"` - GoodTeamId *uint32 `protobuf:"varint,2,opt,name=good_team_id" json:"good_team_id,omitempty"` - BadTeamId *uint32 `protobuf:"varint,3,opt,name=bad_team_id" json:"bad_team_id,omitempty"` - GoodTeamSeed *uint32 `protobuf:"varint,12,opt,name=good_team_seed" json:"good_team_seed,omitempty"` - BadTeamSeed *uint32 `protobuf:"varint,13,opt,name=bad_team_seed" json:"bad_team_seed,omitempty"` - LobbyId *uint64 `protobuf:"fixed64,4,opt,name=lobby_id" json:"lobby_id,omitempty"` - MatchId *uint64 `protobuf:"varint,5,opt,name=match_id" json:"match_id,omitempty"` - GameName *string `protobuf:"bytes,6,opt,name=game_name" json:"game_name,omitempty"` - LiveStream *bool `protobuf:"varint,7,opt,name=live_stream" json:"live_stream,omitempty"` - Message *string `protobuf:"bytes,9,opt,name=message" json:"message,omitempty"` - ResultsFinal *bool `protobuf:"varint,10,opt,name=results_final" json:"results_final,omitempty"` - State *ETournamentGameState `protobuf:"varint,14,opt,name=state,enum=ETournamentGameState,def=0" json:"state,omitempty"` - NodeId *uint32 `protobuf:"varint,15,opt,name=node_id" json:"node_id,omitempty"` - StartTime *uint32 `protobuf:"varint,16,opt,name=start_time" json:"start_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATournament_Game) Reset() { *m = CMsgDOTATournament_Game{} } -func (m *CMsgDOTATournament_Game) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATournament_Game) ProtoMessage() {} -func (*CMsgDOTATournament_Game) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{62, 1} } - -const Default_CMsgDOTATournament_Game_State ETournamentGameState = ETournamentGameState_k_ETournamentGameState_Unknown - -func (m *CMsgDOTATournament_Game) GetGameId() uint32 { - if m != nil && m.GameId != nil { - return *m.GameId - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetGoodTeamId() uint32 { - if m != nil && m.GoodTeamId != nil { - return *m.GoodTeamId - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetBadTeamId() uint32 { - if m != nil && m.BadTeamId != nil { - return *m.BadTeamId - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetGoodTeamSeed() uint32 { - if m != nil && m.GoodTeamSeed != nil { - return *m.GoodTeamSeed - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetBadTeamSeed() uint32 { - if m != nil && m.BadTeamSeed != nil { - return *m.BadTeamSeed - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetGameName() string { - if m != nil && m.GameName != nil { - return *m.GameName - } - return "" -} - -func (m *CMsgDOTATournament_Game) GetLiveStream() bool { - if m != nil && m.LiveStream != nil { - return *m.LiveStream - } - return false -} - -func (m *CMsgDOTATournament_Game) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgDOTATournament_Game) GetResultsFinal() bool { - if m != nil && m.ResultsFinal != nil { - return *m.ResultsFinal - } - return false -} - -func (m *CMsgDOTATournament_Game) GetState() ETournamentGameState { - if m != nil && m.State != nil { - return *m.State - } - return Default_CMsgDOTATournament_Game_State -} - -func (m *CMsgDOTATournament_Game) GetNodeId() uint32 { - if m != nil && m.NodeId != nil { - return *m.NodeId - } - return 0 -} - -func (m *CMsgDOTATournament_Game) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -type CMsgDOTATournament_Node struct { - NodeId *uint32 `protobuf:"varint,1,opt,name=node_id" json:"node_id,omitempty"` - TeamSeedA *uint32 `protobuf:"varint,2,opt,name=team_seed_a" json:"team_seed_a,omitempty"` - TeamSeedB *uint32 `protobuf:"varint,3,opt,name=team_seed_b" json:"team_seed_b,omitempty"` - WinnerNode *uint32 `protobuf:"varint,4,opt,name=winner_node" json:"winner_node,omitempty"` - LoserNode *uint32 `protobuf:"varint,5,opt,name=loser_node" json:"loser_node,omitempty"` - SeriesType *uint32 `protobuf:"varint,7,opt,name=series_type" json:"series_type,omitempty"` - NodeState *ETournamentNodeState `protobuf:"varint,8,opt,name=node_state,enum=ETournamentNodeState,def=0" json:"node_state,omitempty"` - SeriesId *uint32 `protobuf:"varint,9,opt,name=series_id" json:"series_id,omitempty"` - StartTime *uint32 `protobuf:"varint,16,opt,name=start_time" json:"start_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATournament_Node) Reset() { *m = CMsgDOTATournament_Node{} } -func (m *CMsgDOTATournament_Node) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATournament_Node) ProtoMessage() {} -func (*CMsgDOTATournament_Node) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{62, 2} } - -const Default_CMsgDOTATournament_Node_NodeState ETournamentNodeState = ETournamentNodeState_k_ETournamentNodeState_Unknown - -func (m *CMsgDOTATournament_Node) GetNodeId() uint32 { - if m != nil && m.NodeId != nil { - return *m.NodeId - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetTeamSeedA() uint32 { - if m != nil && m.TeamSeedA != nil { - return *m.TeamSeedA - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetTeamSeedB() uint32 { - if m != nil && m.TeamSeedB != nil { - return *m.TeamSeedB - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetWinnerNode() uint32 { - if m != nil && m.WinnerNode != nil { - return *m.WinnerNode - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetLoserNode() uint32 { - if m != nil && m.LoserNode != nil { - return *m.LoserNode - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetNodeState() ETournamentNodeState { - if m != nil && m.NodeState != nil { - return *m.NodeState - } - return Default_CMsgDOTATournament_Node_NodeState -} - -func (m *CMsgDOTATournament_Node) GetSeriesId() uint32 { - if m != nil && m.SeriesId != nil { - return *m.SeriesId - } - return 0 -} - -func (m *CMsgDOTATournament_Node) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -type CMsgDOTATournamentRequest struct { - TournamentId *uint32 `protobuf:"varint,1,opt,name=tournament_id" json:"tournament_id,omitempty"` - ClientTournamentGid *uint64 `protobuf:"varint,2,opt,name=client_tournament_gid" json:"client_tournament_gid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATournamentRequest) Reset() { *m = CMsgDOTATournamentRequest{} } -func (m *CMsgDOTATournamentRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATournamentRequest) ProtoMessage() {} -func (*CMsgDOTATournamentRequest) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{63} } - -func (m *CMsgDOTATournamentRequest) GetTournamentId() uint32 { - if m != nil && m.TournamentId != nil { - return *m.TournamentId - } - return 0 -} - -func (m *CMsgDOTATournamentRequest) GetClientTournamentGid() uint64 { - if m != nil && m.ClientTournamentGid != nil { - return *m.ClientTournamentGid - } - return 0 -} - -type CMsgDOTATournamentResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result,def=2" json:"result,omitempty"` - Tournament *CMsgDOTATournament `protobuf:"bytes,2,opt,name=tournament" json:"tournament,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTATournamentResponse) Reset() { *m = CMsgDOTATournamentResponse{} } -func (m *CMsgDOTATournamentResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTATournamentResponse) ProtoMessage() {} -func (*CMsgDOTATournamentResponse) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{64} } - -const Default_CMsgDOTATournamentResponse_Result uint32 = 2 - -func (m *CMsgDOTATournamentResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgDOTATournamentResponse_Result -} - -func (m *CMsgDOTATournamentResponse) GetTournament() *CMsgDOTATournament { - if m != nil { - return m.Tournament - } - return nil -} - -type CMsgDOTAClearTournamentGame struct { - TournamentId *uint32 `protobuf:"varint,1,opt,name=tournament_id" json:"tournament_id,omitempty"` - GameId *uint32 `protobuf:"varint,2,opt,name=game_id" json:"game_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAClearTournamentGame) Reset() { *m = CMsgDOTAClearTournamentGame{} } -func (m *CMsgDOTAClearTournamentGame) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAClearTournamentGame) ProtoMessage() {} -func (*CMsgDOTAClearTournamentGame) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{65} } - -func (m *CMsgDOTAClearTournamentGame) GetTournamentId() uint32 { - if m != nil && m.TournamentId != nil { - return *m.TournamentId - } - return 0 -} - -func (m *CMsgDOTAClearTournamentGame) GetGameId() uint32 { - if m != nil && m.GameId != nil { - return *m.GameId - } - return 0 -} - -type CMsgDOTAPassportVoteTeamGuess struct { - LeagueId *uint32 `protobuf:"varint,1,opt,name=league_id" json:"league_id,omitempty"` - WinnerId *uint32 `protobuf:"varint,2,opt,name=winner_id" json:"winner_id,omitempty"` - RunnerupId *uint32 `protobuf:"varint,3,opt,name=runnerup_id" json:"runnerup_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPassportVoteTeamGuess) Reset() { *m = CMsgDOTAPassportVoteTeamGuess{} } -func (m *CMsgDOTAPassportVoteTeamGuess) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPassportVoteTeamGuess) ProtoMessage() {} -func (*CMsgDOTAPassportVoteTeamGuess) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{66} } - -func (m *CMsgDOTAPassportVoteTeamGuess) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTAPassportVoteTeamGuess) GetWinnerId() uint32 { - if m != nil && m.WinnerId != nil { - return *m.WinnerId - } - return 0 -} - -func (m *CMsgDOTAPassportVoteTeamGuess) GetRunnerupId() uint32 { - if m != nil && m.RunnerupId != nil { - return *m.RunnerupId - } - return 0 -} - -type CMsgDOTAPassportVoteGenericSelection struct { - SelectionIndex *DOTA_2013PassportSelectionIndices `protobuf:"varint,1,opt,name=selection_index,enum=DOTA_2013PassportSelectionIndices,def=0" json:"selection_index,omitempty"` - Selection *uint32 `protobuf:"varint,2,opt,name=selection" json:"selection,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPassportVoteGenericSelection) Reset() { *m = CMsgDOTAPassportVoteGenericSelection{} } -func (m *CMsgDOTAPassportVoteGenericSelection) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPassportVoteGenericSelection) ProtoMessage() {} -func (*CMsgDOTAPassportVoteGenericSelection) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{67} -} - -const Default_CMsgDOTAPassportVoteGenericSelection_SelectionIndex DOTA_2013PassportSelectionIndices = DOTA_2013PassportSelectionIndices_PP13_SEL_ALLSTAR_PLAYER_0 - -func (m *CMsgDOTAPassportVoteGenericSelection) GetSelectionIndex() DOTA_2013PassportSelectionIndices { - if m != nil && m.SelectionIndex != nil { - return *m.SelectionIndex - } - return Default_CMsgDOTAPassportVoteGenericSelection_SelectionIndex -} - -func (m *CMsgDOTAPassportVoteGenericSelection) GetSelection() uint32 { - if m != nil && m.Selection != nil { - return *m.Selection - } - return 0 -} - -type CMsgDOTAPassportStampedPlayer struct { - SteamId *uint64 `protobuf:"varint,1,opt,name=steam_id" json:"steam_id,omitempty"` - StampLevel *uint32 `protobuf:"varint,2,opt,name=stamp_level" json:"stamp_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPassportStampedPlayer) Reset() { *m = CMsgDOTAPassportStampedPlayer{} } -func (m *CMsgDOTAPassportStampedPlayer) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPassportStampedPlayer) ProtoMessage() {} -func (*CMsgDOTAPassportStampedPlayer) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{68} } - -func (m *CMsgDOTAPassportStampedPlayer) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgDOTAPassportStampedPlayer) GetStampLevel() uint32 { - if m != nil && m.StampLevel != nil { - return *m.StampLevel - } - return 0 -} - -type CMsgDOTAPassportPlayerCardChallenge struct { - ChallengeId *uint32 `protobuf:"varint,1,opt,name=challenge_id" json:"challenge_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPassportPlayerCardChallenge) Reset() { *m = CMsgDOTAPassportPlayerCardChallenge{} } -func (m *CMsgDOTAPassportPlayerCardChallenge) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPassportPlayerCardChallenge) ProtoMessage() {} -func (*CMsgDOTAPassportPlayerCardChallenge) Descriptor() ([]byte, []int) { - return dota_client_fantasy_fileDescriptor0, []int{69} -} - -func (m *CMsgDOTAPassportPlayerCardChallenge) GetChallengeId() uint32 { - if m != nil && m.ChallengeId != nil { - return *m.ChallengeId - } - return 0 -} - -type CMsgDOTAPassportVote struct { - TeamVotes []*CMsgDOTAPassportVoteTeamGuess `protobuf:"bytes,1,rep,name=team_votes" json:"team_votes,omitempty"` - GenericSelections []*CMsgDOTAPassportVoteGenericSelection `protobuf:"bytes,2,rep,name=generic_selections" json:"generic_selections,omitempty"` - StampedPlayers []*CMsgDOTAPassportStampedPlayer `protobuf:"bytes,3,rep,name=stamped_players" json:"stamped_players,omitempty"` - PlayerCardChallenges []*CMsgDOTAPassportPlayerCardChallenge `protobuf:"bytes,4,rep,name=player_card_challenges" json:"player_card_challenges,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPassportVote) Reset() { *m = CMsgDOTAPassportVote{} } -func (m *CMsgDOTAPassportVote) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPassportVote) ProtoMessage() {} -func (*CMsgDOTAPassportVote) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{70} } - -func (m *CMsgDOTAPassportVote) GetTeamVotes() []*CMsgDOTAPassportVoteTeamGuess { - if m != nil { - return m.TeamVotes - } - return nil -} - -func (m *CMsgDOTAPassportVote) GetGenericSelections() []*CMsgDOTAPassportVoteGenericSelection { - if m != nil { - return m.GenericSelections - } - return nil -} - -func (m *CMsgDOTAPassportVote) GetStampedPlayers() []*CMsgDOTAPassportStampedPlayer { - if m != nil { - return m.StampedPlayers - } - return nil -} - -func (m *CMsgDOTAPassportVote) GetPlayerCardChallenges() []*CMsgDOTAPassportPlayerCardChallenge { - if m != nil { - return m.PlayerCardChallenges - } - return nil -} - -type CMsgPassportDataRequest struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPassportDataRequest) Reset() { *m = CMsgPassportDataRequest{} } -func (m *CMsgPassportDataRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgPassportDataRequest) ProtoMessage() {} -func (*CMsgPassportDataRequest) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{71} } - -func (m *CMsgPassportDataRequest) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgPassportDataResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Result *uint32 `protobuf:"varint,2,opt,name=result,def=2" json:"result,omitempty"` - International *CMsgDOTATournament `protobuf:"bytes,5,opt,name=international" json:"international,omitempty"` - EastQualifiersPredictEndTime *uint32 `protobuf:"varint,7,opt,name=east_qualifiers_predict_end_time" json:"east_qualifiers_predict_end_time,omitempty"` - WestQualifiersPredictEndTime *uint32 `protobuf:"varint,8,opt,name=west_qualifiers_predict_end_time" json:"west_qualifiers_predict_end_time,omitempty"` - AllstarMatchEndTime *uint32 `protobuf:"varint,9,opt,name=allstar_match_end_time" json:"allstar_match_end_time,omitempty"` - LeagueGuesses *CMsgDOTAPassportVote `protobuf:"bytes,6,opt,name=league_guesses" json:"league_guesses,omitempty"` - EastQualifiersWinnerTeamId *uint32 `protobuf:"varint,10,opt,name=east_qualifiers_winner_team_id" json:"east_qualifiers_winner_team_id,omitempty"` - EastQualifiersRunnerUpTeamId *uint32 `protobuf:"varint,11,opt,name=east_qualifiers_runner_up_team_id" json:"east_qualifiers_runner_up_team_id,omitempty"` - WestQualifiersWinnerTeamId *uint32 `protobuf:"varint,12,opt,name=west_qualifiers_winner_team_id" json:"west_qualifiers_winner_team_id,omitempty"` - WestQualifiersRunnerUpTeamId *uint32 `protobuf:"varint,13,opt,name=west_qualifiers_runner_up_team_id" json:"west_qualifiers_runner_up_team_id,omitempty"` - PassportsBought *uint32 `protobuf:"varint,14,opt,name=passports_bought" json:"passports_bought,omitempty"` - OriginalPurchaserId *uint32 `protobuf:"varint,15,opt,name=original_purchaser_id" json:"original_purchaser_id,omitempty"` - FantasyTeamCount *uint32 `protobuf:"varint,16,opt,name=fantasy_team_count" json:"fantasy_team_count,omitempty"` - FantasyTeamexpiration *uint32 `protobuf:"varint,17,opt,name=fantasy_teamexpiration" json:"fantasy_teamexpiration,omitempty"` - FantasyTeamsWillLockAt *uint32 `protobuf:"varint,18,opt,name=fantasy_teams_will_lock_at" json:"fantasy_teams_will_lock_at,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPassportDataResponse) Reset() { *m = CMsgPassportDataResponse{} } -func (m *CMsgPassportDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgPassportDataResponse) ProtoMessage() {} -func (*CMsgPassportDataResponse) Descriptor() ([]byte, []int) { return dota_client_fantasy_fileDescriptor0, []int{72} } - -const Default_CMsgPassportDataResponse_Result uint32 = 2 - -func (m *CMsgPassportDataResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgPassportDataResponse_Result -} - -func (m *CMsgPassportDataResponse) GetInternational() *CMsgDOTATournament { - if m != nil { - return m.International - } - return nil -} - -func (m *CMsgPassportDataResponse) GetEastQualifiersPredictEndTime() uint32 { - if m != nil && m.EastQualifiersPredictEndTime != nil { - return *m.EastQualifiersPredictEndTime - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetWestQualifiersPredictEndTime() uint32 { - if m != nil && m.WestQualifiersPredictEndTime != nil { - return *m.WestQualifiersPredictEndTime - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetAllstarMatchEndTime() uint32 { - if m != nil && m.AllstarMatchEndTime != nil { - return *m.AllstarMatchEndTime - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetLeagueGuesses() *CMsgDOTAPassportVote { - if m != nil { - return m.LeagueGuesses - } - return nil -} - -func (m *CMsgPassportDataResponse) GetEastQualifiersWinnerTeamId() uint32 { - if m != nil && m.EastQualifiersWinnerTeamId != nil { - return *m.EastQualifiersWinnerTeamId - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetEastQualifiersRunnerUpTeamId() uint32 { - if m != nil && m.EastQualifiersRunnerUpTeamId != nil { - return *m.EastQualifiersRunnerUpTeamId - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetWestQualifiersWinnerTeamId() uint32 { - if m != nil && m.WestQualifiersWinnerTeamId != nil { - return *m.WestQualifiersWinnerTeamId - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetWestQualifiersRunnerUpTeamId() uint32 { - if m != nil && m.WestQualifiersRunnerUpTeamId != nil { - return *m.WestQualifiersRunnerUpTeamId - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetPassportsBought() uint32 { - if m != nil && m.PassportsBought != nil { - return *m.PassportsBought - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetOriginalPurchaserId() uint32 { - if m != nil && m.OriginalPurchaserId != nil { - return *m.OriginalPurchaserId - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetFantasyTeamCount() uint32 { - if m != nil && m.FantasyTeamCount != nil { - return *m.FantasyTeamCount - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetFantasyTeamexpiration() uint32 { - if m != nil && m.FantasyTeamexpiration != nil { - return *m.FantasyTeamexpiration - } - return 0 -} - -func (m *CMsgPassportDataResponse) GetFantasyTeamsWillLockAt() uint32 { - if m != nil && m.FantasyTeamsWillLockAt != nil { - return *m.FantasyTeamsWillLockAt - } - return 0 -} - -func init() { - proto.RegisterType((*CMsgGCPlayerInfo)(nil), "CMsgGCPlayerInfo") - proto.RegisterType((*CMsgGCPlayerInfo_PlayerInfo)(nil), "CMsgGCPlayerInfo.PlayerInfo") - proto.RegisterType((*CMsgGCPlayerInfo_RegionLeaderboard)(nil), "CMsgGCPlayerInfo.RegionLeaderboard") - proto.RegisterType((*CMsgDOTACreateFantasyLeagueRequest)(nil), "CMsgDOTACreateFantasyLeagueRequest") - proto.RegisterType((*CMsgDOTACreateFantasyLeagueResponse)(nil), "CMsgDOTACreateFantasyLeagueResponse") - proto.RegisterType((*CMsgFantasyLeagueScoring)(nil), "CMsgFantasyLeagueScoring") - proto.RegisterType((*CMsgDOTAFantasyLeagueInfo)(nil), "CMsgDOTAFantasyLeagueInfo") - proto.RegisterType((*CMsgDOTAFantasyLeagueInfo_OwnerInfo)(nil), "CMsgDOTAFantasyLeagueInfo.OwnerInfo") - proto.RegisterType((*CMsgDOTAFantasyLeagueEditInfoRequest)(nil), "CMsgDOTAFantasyLeagueEditInfoRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueEditInfoResponse)(nil), "CMsgDOTAFantasyLeagueEditInfoResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueFindRequest)(nil), "CMsgDOTAFantasyLeagueFindRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueFindResponse)(nil), "CMsgDOTAFantasyLeagueFindResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueInfoRequest)(nil), "CMsgDOTAFantasyLeagueInfoRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueInfoResponse)(nil), "CMsgDOTAFantasyLeagueInfoResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueMatchupsRequest)(nil), "CMsgDOTAFantasyLeagueMatchupsRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueMatchupsResponse)(nil), "CMsgDOTAFantasyLeagueMatchupsResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueMatchupsResponse_Matchup)(nil), "CMsgDOTAFantasyLeagueMatchupsResponse.Matchup") - proto.RegisterType((*CMsgDOTAFantasyLeagueMatchupsResponse_WeeklyMatchups)(nil), "CMsgDOTAFantasyLeagueMatchupsResponse.WeeklyMatchups") - proto.RegisterType((*CMsgDOTAEditFantasyTeamRequest)(nil), "CMsgDOTAEditFantasyTeamRequest") - proto.RegisterType((*CMsgDOTAEditFantasyTeamResponse)(nil), "CMsgDOTAEditFantasyTeamResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID)(nil), "CMsgDOTAFantasyTeamInfoRequestByFantasyLeagueID") - proto.RegisterType((*CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID)(nil), "CMsgDOTAFantasyTeamInfoRequestByOwnerAccountID") - proto.RegisterType((*CMsgDOTAFantasyTeamInfoResponse)(nil), "CMsgDOTAFantasyTeamInfoResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamInfo)(nil), "CMsgDOTAFantasyTeamInfo") - proto.RegisterType((*CMsgDOTAFantasyTeamScoreRequest)(nil), "CMsgDOTAFantasyTeamScoreRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamScoreResponse)(nil), "CMsgDOTAFantasyTeamScoreResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamScoreResponse_CMsgPlayerScore)(nil), "CMsgDOTAFantasyTeamScoreResponse.CMsgPlayerScore") - proto.RegisterType((*CMsgDOTAFantasyTeamStandingsRequest)(nil), "CMsgDOTAFantasyTeamStandingsRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamStandingsResponse)(nil), "CMsgDOTAFantasyTeamStandingsResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamStandingsResponse_CMsgTeamScore)(nil), "CMsgDOTAFantasyTeamStandingsResponse.CMsgTeamScore") - proto.RegisterType((*CMsgDOTAFantasyPlayerScoreRequest)(nil), "CMsgDOTAFantasyPlayerScoreRequest") - proto.RegisterType((*CMsgDOTAFantasyPlayerScoreResponse)(nil), "CMsgDOTAFantasyPlayerScoreResponse") - proto.RegisterType((*CMsgDOTAFantasyPlayerStandingsRequest)(nil), "CMsgDOTAFantasyPlayerStandingsRequest") - proto.RegisterType((*CMsgDOTAFantasyPlayerStandingsResponse)(nil), "CMsgDOTAFantasyPlayerStandingsResponse") - proto.RegisterType((*CMsgDOTAFantasyPlayerStandingsResponse_CMsgPlayerScore)(nil), "CMsgDOTAFantasyPlayerStandingsResponse.CMsgPlayerScore") - proto.RegisterType((*CMsgDOTAFantasyPlayerInfoRequest)(nil), "CMsgDOTAFantasyPlayerInfoRequest") - proto.RegisterType((*CMsgDOTAFantasyPlayerInfoResponse)(nil), "CMsgDOTAFantasyPlayerInfoResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueCreateRequest)(nil), "CMsgDOTAFantasyLeagueCreateRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueCreateResponse)(nil), "CMsgDOTAFantasyLeagueCreateResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamCreateRequest)(nil), "CMsgDOTAFantasyTeamCreateRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamCreateResponse)(nil), "CMsgDOTAFantasyTeamCreateResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueEditInvitesRequest)(nil), "CMsgDOTAFantasyLeagueEditInvitesRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueEditInvitesRequest_InviteChange)(nil), "CMsgDOTAFantasyLeagueEditInvitesRequest.InviteChange") - proto.RegisterType((*CMsgDOTAFantasyLeagueEditInvitesResponse)(nil), "CMsgDOTAFantasyLeagueEditInvitesResponse") - proto.RegisterType((*CMsgDOTAFantasyLeagueDraftStatusRequest)(nil), "CMsgDOTAFantasyLeagueDraftStatusRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueDraftStatus)(nil), "CMsgDOTAFantasyLeagueDraftStatus") - proto.RegisterType((*CMsgDOTAFantasyLeagueDraftPlayerRequest)(nil), "CMsgDOTAFantasyLeagueDraftPlayerRequest") - proto.RegisterType((*CMsgDOTAFantasyLeagueDraftPlayerResponse)(nil), "CMsgDOTAFantasyLeagueDraftPlayerResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamRosterSwapRequest)(nil), "CMsgDOTAFantasyTeamRosterSwapRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamRosterSwapResponse)(nil), "CMsgDOTAFantasyTeamRosterSwapResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamRosterAddDropRequest)(nil), "CMsgDOTAFantasyTeamRosterAddDropRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamRosterAddDropResponse)(nil), "CMsgDOTAFantasyTeamRosterAddDropResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamTradesRequest)(nil), "CMsgDOTAFantasyTeamTradesRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamTradesResponse)(nil), "CMsgDOTAFantasyTeamTradesResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamTradesResponse_Trade)(nil), "CMsgDOTAFantasyTeamTradesResponse.Trade") - proto.RegisterType((*CMsgDOTAFantasyTeamTradeCancelRequest)(nil), "CMsgDOTAFantasyTeamTradeCancelRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamTradeCancelResponse)(nil), "CMsgDOTAFantasyTeamTradeCancelResponse") - proto.RegisterType((*CMsgDOTAFantasyTeamRosterRequest)(nil), "CMsgDOTAFantasyTeamRosterRequest") - proto.RegisterType((*CMsgDOTAFantasyTeamRosterResponse)(nil), "CMsgDOTAFantasyTeamRosterResponse") - proto.RegisterType((*CMsgDOTAFantasyPlayerHisoricalStatsRequest)(nil), "CMsgDOTAFantasyPlayerHisoricalStatsRequest") - proto.RegisterType((*CMsgDOTAFantasyPlayerHisoricalStatsResponse)(nil), "CMsgDOTAFantasyPlayerHisoricalStatsResponse") - proto.RegisterType((*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerScoreAccumulator)(nil), "CMsgDOTAFantasyPlayerHisoricalStatsResponse.PlayerScoreAccumulator") - proto.RegisterType((*CMsgDOTAFantasyPlayerHisoricalStatsResponse_PlayerStats)(nil), "CMsgDOTAFantasyPlayerHisoricalStatsResponse.PlayerStats") - proto.RegisterType((*CMsgDOTAFantasyMessageAdd)(nil), "CMsgDOTAFantasyMessageAdd") - proto.RegisterType((*CMsgDOTAFantasyMessagesRequest)(nil), "CMsgDOTAFantasyMessagesRequest") - proto.RegisterType((*CMsgDOTAFantasyMessagesResponse)(nil), "CMsgDOTAFantasyMessagesResponse") - proto.RegisterType((*CMsgDOTAFantasyMessagesResponse_Message)(nil), "CMsgDOTAFantasyMessagesResponse.Message") - proto.RegisterType((*CMsgDOTAFantasyRemoveOwner)(nil), "CMsgDOTAFantasyRemoveOwner") - proto.RegisterType((*CMsgDOTAFantasyRemoveOwnerResponse)(nil), "CMsgDOTAFantasyRemoveOwnerResponse") - proto.RegisterType((*CMsgDOTAFantasyScheduledMatchesRequest)(nil), "CMsgDOTAFantasyScheduledMatchesRequest") - proto.RegisterType((*CMsgDOTAFantasyScheduledMatchesResponse)(nil), "CMsgDOTAFantasyScheduledMatchesResponse") - proto.RegisterType((*CMsgDOTAFantasyScheduledMatchesResponse_ScheduledMatchDays)(nil), "CMsgDOTAFantasyScheduledMatchesResponse.ScheduledMatchDays") - proto.RegisterType((*CMsgDOTAFantasyLeaveLeagueRequest)(nil), "CMsgDOTAFantasyLeaveLeagueRequest") - proto.RegisterType((*CMsgDOTAFantasyLeaveLeagueResponse)(nil), "CMsgDOTAFantasyLeaveLeagueResponse") - proto.RegisterType((*CMsgDOTAFantasyPlayerScoreDetailsRequest)(nil), "CMsgDOTAFantasyPlayerScoreDetailsRequest") - proto.RegisterType((*CMsgDOTAFantasyPlayerScoreDetailsResponse)(nil), "CMsgDOTAFantasyPlayerScoreDetailsResponse") - proto.RegisterType((*CMsgDOTAFantasyPlayerScoreDetailsResponse_PlayerMatchData)(nil), "CMsgDOTAFantasyPlayerScoreDetailsResponse.PlayerMatchData") - proto.RegisterType((*CMsgDOTATournament)(nil), "CMsgDOTATournament") - proto.RegisterType((*CMsgDOTATournament_Team)(nil), "CMsgDOTATournament.Team") - proto.RegisterType((*CMsgDOTATournament_Game)(nil), "CMsgDOTATournament.Game") - proto.RegisterType((*CMsgDOTATournament_Node)(nil), "CMsgDOTATournament.Node") - proto.RegisterType((*CMsgDOTATournamentRequest)(nil), "CMsgDOTATournamentRequest") - proto.RegisterType((*CMsgDOTATournamentResponse)(nil), "CMsgDOTATournamentResponse") - proto.RegisterType((*CMsgDOTAClearTournamentGame)(nil), "CMsgDOTAClearTournamentGame") - proto.RegisterType((*CMsgDOTAPassportVoteTeamGuess)(nil), "CMsgDOTAPassportVoteTeamGuess") - proto.RegisterType((*CMsgDOTAPassportVoteGenericSelection)(nil), "CMsgDOTAPassportVoteGenericSelection") - proto.RegisterType((*CMsgDOTAPassportStampedPlayer)(nil), "CMsgDOTAPassportStampedPlayer") - proto.RegisterType((*CMsgDOTAPassportPlayerCardChallenge)(nil), "CMsgDOTAPassportPlayerCardChallenge") - proto.RegisterType((*CMsgDOTAPassportVote)(nil), "CMsgDOTAPassportVote") - proto.RegisterType((*CMsgPassportDataRequest)(nil), "CMsgPassportDataRequest") - proto.RegisterType((*CMsgPassportDataResponse)(nil), "CMsgPassportDataResponse") - proto.RegisterEnum("ETournamentGameState", ETournamentGameState_name, ETournamentGameState_value) - proto.RegisterEnum("ETournamentTeamState", ETournamentTeamState_name, ETournamentTeamState_value) - proto.RegisterEnum("ETournamentState", ETournamentState_name, ETournamentState_value) - proto.RegisterEnum("ETournamentNodeState", ETournamentNodeState_name, ETournamentNodeState_value) - proto.RegisterEnum("DOTA_2013PassportSelectionIndices", DOTA_2013PassportSelectionIndices_name, DOTA_2013PassportSelectionIndices_value) - proto.RegisterEnum("CMsgDOTACreateFantasyLeagueResponse_EResult", CMsgDOTACreateFantasyLeagueResponse_EResult_name, CMsgDOTACreateFantasyLeagueResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueEditInfoResponse_EResult", CMsgDOTAFantasyLeagueEditInfoResponse_EResult_name, CMsgDOTAFantasyLeagueEditInfoResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueFindResponse_EResult", CMsgDOTAFantasyLeagueFindResponse_EResult_name, CMsgDOTAFantasyLeagueFindResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueInfoResponse_EResult", CMsgDOTAFantasyLeagueInfoResponse_EResult_name, CMsgDOTAFantasyLeagueInfoResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueMatchupsResponse_EResult", CMsgDOTAFantasyLeagueMatchupsResponse_EResult_name, CMsgDOTAFantasyLeagueMatchupsResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAEditFantasyTeamResponse_EResult", CMsgDOTAEditFantasyTeamResponse_EResult_name, CMsgDOTAEditFantasyTeamResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamScoreResponse_EResult", CMsgDOTAFantasyTeamScoreResponse_EResult_name, CMsgDOTAFantasyTeamScoreResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamStandingsResponse_EResult", CMsgDOTAFantasyTeamStandingsResponse_EResult_name, CMsgDOTAFantasyTeamStandingsResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyPlayerScoreResponse_EResult", CMsgDOTAFantasyPlayerScoreResponse_EResult_name, CMsgDOTAFantasyPlayerScoreResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyPlayerStandingsResponse_EResult", CMsgDOTAFantasyPlayerStandingsResponse_EResult_name, CMsgDOTAFantasyPlayerStandingsResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueCreateResponse_EResult", CMsgDOTAFantasyLeagueCreateResponse_EResult_name, CMsgDOTAFantasyLeagueCreateResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamCreateResponse_EResult", CMsgDOTAFantasyTeamCreateResponse_EResult_name, CMsgDOTAFantasyTeamCreateResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueEditInvitesResponse_EResult", CMsgDOTAFantasyLeagueEditInvitesResponse_EResult_name, CMsgDOTAFantasyLeagueEditInvitesResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult", CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult_name, CMsgDOTAFantasyLeagueDraftPlayerResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamRosterSwapResponse_EResult", CMsgDOTAFantasyTeamRosterSwapResponse_EResult_name, CMsgDOTAFantasyTeamRosterSwapResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamRosterAddDropResponse_EResult", CMsgDOTAFantasyTeamRosterAddDropResponse_EResult_name, CMsgDOTAFantasyTeamRosterAddDropResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamTradesResponse_EResult", CMsgDOTAFantasyTeamTradesResponse_EResult_name, CMsgDOTAFantasyTeamTradesResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamTradeCancelResponse_EResult", CMsgDOTAFantasyTeamTradeCancelResponse_EResult_name, CMsgDOTAFantasyTeamTradeCancelResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyTeamRosterResponse_EResult", CMsgDOTAFantasyTeamRosterResponse_EResult_name, CMsgDOTAFantasyTeamRosterResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult", CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult_name, CMsgDOTAFantasyPlayerHisoricalStatsResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyMessagesResponse_EResult", CMsgDOTAFantasyMessagesResponse_EResult_name, CMsgDOTAFantasyMessagesResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyRemoveOwnerResponse_EResult", CMsgDOTAFantasyRemoveOwnerResponse_EResult_name, CMsgDOTAFantasyRemoveOwnerResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyScheduledMatchesResponse_EResult", CMsgDOTAFantasyScheduledMatchesResponse_EResult_name, CMsgDOTAFantasyScheduledMatchesResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyLeaveLeagueResponse_EResult", CMsgDOTAFantasyLeaveLeagueResponse_EResult_name, CMsgDOTAFantasyLeaveLeagueResponse_EResult_value) - proto.RegisterEnum("CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult", CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult_name, CMsgDOTAFantasyPlayerScoreDetailsResponse_EResult_value) -} - -var dota_client_fantasy_fileDescriptor0 = []byte{ - // 5420 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x3b, 0x4b, 0x70, 0x1b, 0xc9, - 0x75, 0xc6, 0x8f, 0x9f, 0xe6, 0xaf, 0x05, 0xfd, 0x20, 0xe8, 0xb3, 0xd2, 0x48, 0xbb, 0x2b, 0x71, - 0xbd, 0x58, 0x02, 0x24, 0x45, 0x4a, 0x6b, 0xc7, 0x81, 0x00, 0x90, 0xcb, 0x5d, 0x12, 0xe0, 0x12, - 0xa0, 0x64, 0x6d, 0x3e, 0x53, 0x43, 0x60, 0x04, 0x4e, 0x09, 0xc0, 0x60, 0x31, 0x03, 0x72, 0x95, - 0x4a, 0xa5, 0xbc, 0x2e, 0x27, 0x95, 0x4d, 0xf9, 0x90, 0x1c, 0xed, 0x38, 0xd9, 0xc4, 0x5e, 0x3b, - 0x49, 0xa5, 0x2a, 0xe5, 0xaa, 0xe4, 0x90, 0x6b, 0xaa, 0x52, 0xf6, 0x29, 0xb6, 0x4f, 0xa9, 0xe4, - 0x90, 0x93, 0x0f, 0xc9, 0x25, 0xa9, 0xa4, 0x72, 0x4f, 0xe5, 0xf5, 0x67, 0xfe, 0xd3, 0xc3, 0xa1, - 0x96, 0xf6, 0x89, 0x44, 0xbf, 0xd7, 0x3d, 0xdd, 0xef, 0xff, 0x5e, 0xbf, 0x46, 0x77, 0x3a, 0xba, - 0xa9, 0xc8, 0xdd, 0x76, 0x5f, 0x35, 0x0c, 0xa5, 0xab, 0x1a, 0x72, 0xbb, 0xa7, 0xa9, 0x03, 0x53, - 0x7e, 0xa6, 0x0c, 0x4c, 0xc5, 0x78, 0x51, 0x18, 0x8e, 0x74, 0x53, 0xcf, 0x5f, 0x0b, 0x60, 0xe9, - 0xfd, 0xbe, 0x3e, 0x60, 0x50, 0xe9, 0x1b, 0x29, 0x84, 0x2b, 0x3b, 0x46, 0x77, 0xb3, 0xb2, 0xdb, - 0x53, 0x5e, 0xa8, 0xa3, 0xad, 0xc1, 0x33, 0x3d, 0x5b, 0x42, 0xb3, 0x43, 0xfa, 0x4b, 0xd6, 0xe0, - 0xa7, 0x91, 0x4b, 0xdc, 0x4c, 0xdd, 0x9d, 0x29, 0x5d, 0x2b, 0xf8, 0x11, 0x0b, 0xae, 0x39, 0x0f, - 0xd0, 0x6c, 0x4f, 0x55, 0x3a, 0xea, 0xe8, 0x40, 0x57, 0x46, 0x1d, 0x23, 0x97, 0xa4, 0x73, 0x6e, - 0x07, 0xe7, 0xec, 0xa9, 0x5d, 0x4d, 0x1f, 0x6c, 0x3b, 0xb8, 0xf9, 0x7f, 0x4c, 0x20, 0xe4, 0x5a, - 0x29, 0x8b, 0x90, 0xd2, 0x6e, 0xeb, 0x63, 0x38, 0x89, 0xd6, 0x81, 0x6f, 0x27, 0xee, 0xce, 0x65, - 0x67, 0x51, 0x7a, 0xa0, 0xf4, 0x55, 0x58, 0x35, 0x71, 0x77, 0x3a, 0x7b, 0x01, 0xcd, 0x52, 0xf8, - 0xe8, 0x05, 0x1c, 0xa6, 0xa3, 0xe6, 0x52, 0xd6, 0x28, 0x3f, 0xb9, 0x3c, 0xd2, 0x7b, 0x6a, 0x2e, - 0x4d, 0x67, 0x2e, 0xa0, 0x49, 0x53, 0x55, 0xfa, 0x64, 0xa9, 0x0c, 0x1d, 0x38, 0x87, 0xa6, 0xe9, - 0x00, 0x5d, 0x6f, 0x82, 0xce, 0xc4, 0x68, 0x8a, 0x0e, 0x99, 0x4a, 0x37, 0x37, 0x49, 0x47, 0x60, - 0x96, 0x31, 0xd4, 0x07, 0x86, 0x3e, 0xca, 0x4d, 0xd1, 0x01, 0x98, 0xa5, 0x19, 0x72, 0x4f, 0x6f, - 0x3f, 0x57, 0x3b, 0xb9, 0x69, 0x18, 0x9a, 0xca, 0xce, 0xa3, 0x09, 0x18, 0x02, 0x32, 0xe6, 0x10, - 0xf9, 0x9d, 0x7f, 0x88, 0xce, 0x05, 0xce, 0x46, 0x96, 0xee, 0x68, 0x47, 0x9a, 0x01, 0xc3, 0xfc, - 0x28, 0xe7, 0xd1, 0x8c, 0x73, 0x3c, 0x46, 0xa7, 0x39, 0xe9, 0x6f, 0x12, 0x48, 0x22, 0x94, 0xaa, - 0x36, 0x5a, 0xe5, 0xca, 0x48, 0x55, 0x4c, 0x75, 0x83, 0x1d, 0x05, 0xd6, 0xea, 0x8e, 0xd5, 0x3d, - 0xf5, 0xc3, 0xb1, 0x6a, 0x98, 0x64, 0x6e, 0x8f, 0x0e, 0xb0, 0xdd, 0x27, 0xe8, 0xd6, 0x9c, 0xc1, - 0x9e, 0xde, 0xd5, 0x29, 0x89, 0xd2, 0xd9, 0x77, 0xd1, 0xbc, 0xa1, 0xf6, 0xd4, 0xb6, 0x09, 0x1f, - 0x96, 0xfb, 0x16, 0x91, 0xe6, 0x4b, 0x97, 0x0b, 0x7c, 0x61, 0xb9, 0x69, 0x83, 0x77, 0x00, 0xfc, - 0xf0, 0xca, 0x46, 0xb9, 0xde, 0x2a, 0x37, 0x9f, 0xca, 0xcd, 0xda, 0x76, 0xad, 0xd2, 0xda, 0x6a, - 0xd4, 0xe5, 0xad, 0xfa, 0xe3, 0xf2, 0xf6, 0x56, 0x95, 0x30, 0x84, 0x92, 0x87, 0x6e, 0x9a, 0x91, - 0x55, 0xfa, 0xdf, 0x04, 0xba, 0x1d, 0xb9, 0x61, 0x4a, 0x3e, 0x35, 0x5b, 0x43, 0x13, 0x23, 0xd5, - 0x18, 0xf7, 0x4c, 0xba, 0xd9, 0xf9, 0xd2, 0x17, 0x0b, 0x31, 0x66, 0x15, 0x6a, 0x7b, 0x74, 0xce, - 0xc3, 0xc9, 0xe6, 0x7e, 0xa5, 0x52, 0x6b, 0x36, 0xa5, 0x6f, 0x24, 0xd0, 0x24, 0x1f, 0xcc, 0xce, - 0x20, 0x6b, 0x18, 0x7f, 0x21, 0x7b, 0x11, 0x9d, 0xab, 0xed, 0xed, 0x35, 0xf6, 0xe4, 0xfd, 0x7a, - 0x73, 0xb7, 0x56, 0xd9, 0xda, 0xd8, 0xaa, 0x55, 0x71, 0x22, 0x9b, 0x47, 0x97, 0xd8, 0x70, 0xab, - 0xd1, 0x90, 0x77, 0xca, 0xf5, 0xa7, 0xf2, 0x76, 0xad, 0xbc, 0xb9, 0x5f, 0x6b, 0xe2, 0x64, 0xf6, - 0x1a, 0xca, 0x31, 0x18, 0x3f, 0x9f, 0xdc, 0xaa, 0x95, 0x77, 0xe4, 0x4a, 0x63, 0xbf, 0xde, 0xc2, - 0xa9, 0xec, 0x55, 0x74, 0x99, 0x41, 0x2b, 0x7b, 0xb5, 0x32, 0x25, 0x43, 0x75, 0xab, 0x59, 0x7e, - 0xb4, 0x0d, 0xcb, 0xa6, 0xa5, 0x4f, 0x93, 0x28, 0x47, 0xf6, 0xef, 0xd9, 0x75, 0xb3, 0xad, 0x8f, - 0xb4, 0x41, 0x37, 0x3b, 0x87, 0x32, 0x3d, 0xf5, 0x48, 0xed, 0xd1, 0x93, 0x26, 0xc9, 0xcf, 0xe7, - 0x5a, 0xaf, 0x67, 0x50, 0x86, 0x24, 0x89, 0xb4, 0x74, 0xe0, 0xc0, 0x87, 0x06, 0x65, 0x44, 0x92, - 0x48, 0x98, 0x62, 0x18, 0x9a, 0x61, 0x1a, 0x94, 0xa2, 0x49, 0x22, 0x61, 0x3d, 0xc5, 0x30, 0xe5, - 0x43, 0x0d, 0x86, 0x32, 0xce, 0x9c, 0x81, 0xa6, 0x1a, 0x54, 0x4e, 0x93, 0x70, 0xf2, 0x54, 0x77, - 0xd8, 0xa7, 0x22, 0x9a, 0x24, 0x2a, 0xf1, 0xd1, 0x10, 0x7e, 0x4d, 0x59, 0x5f, 0x33, 0xcc, 0xf1, - 0xc0, 0xa0, 0xb2, 0x49, 0x57, 0x3f, 0x54, 0x95, 0x1e, 0x6c, 0x8b, 0x0a, 0x67, 0x92, 0x08, 0x89, - 0xa9, 0x1f, 0x83, 0x46, 0xb3, 0x3d, 0xcd, 0xd0, 0x41, 0xd0, 0x98, 0x91, 0x6e, 0x1c, 0x2a, 0x03, - 0x3e, 0x3a, 0x4b, 0x47, 0xf3, 0x28, 0xdb, 0x07, 0x3a, 0x6b, 0x43, 0xb0, 0x26, 0x23, 0x90, 0x6f, - 0xb5, 0xaf, 0x8d, 0xfb, 0xb9, 0x39, 0x0a, 0x7b, 0x05, 0x5d, 0xf6, 0xc0, 0xf4, 0x67, 0x60, 0x55, - 0x40, 0x86, 0x94, 0x5e, 0x6e, 0x9e, 0x20, 0x48, 0x3f, 0xc9, 0xa0, 0x2b, 0x16, 0x87, 0x3d, 0x54, - 0xa2, 0xaa, 0x7d, 0x05, 0x9d, 0xb3, 0x54, 0x94, 0x8b, 0xac, 0xad, 0xe1, 0xb0, 0x32, 0x31, 0x4c, - 0x1a, 0x5d, 0x0e, 0xd6, 0x76, 0x99, 0x80, 0x24, 0x45, 0xb8, 0x8a, 0xce, 0xfb, 0xe6, 0x52, 0x1d, - 0x60, 0xba, 0x1f, 0x14, 0xf7, 0xf4, 0x19, 0x89, 0x7b, 0xc6, 0xb2, 0x3f, 0x54, 0xb9, 0x26, 0xa8, - 0x72, 0x2d, 0x82, 0x75, 0x60, 0x4c, 0xa7, 0xbc, 0x98, 0x29, 0x5d, 0x29, 0x08, 0xa5, 0x02, 0x56, - 0xeb, 0x8c, 0x94, 0x67, 0xa6, 0x6c, 0x6a, 0xb0, 0xdb, 0x59, 0xba, 0xda, 0x65, 0xb4, 0xc0, 0xc6, - 0x86, 0x5a, 0xfb, 0x39, 0x03, 0xcc, 0x51, 0x00, 0x30, 0xc4, 0x50, 0x15, 0x03, 0x36, 0x69, 0x98, - 0xca, 0xc8, 0xcc, 0x2d, 0xd0, 0xd1, 0x8b, 0x68, 0x8e, 0x8f, 0xf6, 0xd4, 0x41, 0xd7, 0x3c, 0xcc, - 0x61, 0x3a, 0x0c, 0x2b, 0x1f, 0xa9, 0xa6, 0x2e, 0x1f, 0xe9, 0x26, 0x48, 0xc8, 0x39, 0x6b, 0x01, - 0xa5, 0xfd, 0xe1, 0x18, 0xec, 0x0d, 0x39, 0xaa, 0x91, 0xcb, 0xd2, 0x51, 0x90, 0x23, 0xa3, 0xa7, - 0x9b, 0x72, 0x31, 0x77, 0xde, 0xf3, 0xbb, 0x94, 0xbb, 0xe0, 0xf9, 0xbd, 0x9c, 0xbb, 0xe8, 0xf9, - 0xbd, 0x92, 0xbb, 0xe4, 0xf9, 0xbd, 0x9a, 0xbb, 0x6c, 0x99, 0xb0, 0x03, 0x75, 0xd0, 0x3e, 0x94, - 0xc9, 0xa8, 0x91, 0xcb, 0xd1, 0xc1, 0x75, 0x84, 0xf4, 0xe3, 0x01, 0xf7, 0x19, 0xb9, 0x2b, 0xd4, - 0xfc, 0xdf, 0x29, 0x08, 0x65, 0xa1, 0xd0, 0x20, 0xc8, 0x54, 0x2a, 0x40, 0x58, 0x99, 0xbb, 0x31, - 0x72, 0x79, 0x62, 0x0d, 0xa9, 0x89, 0x06, 0xa2, 0xc8, 0xbf, 0x05, 0x92, 0x90, 0xbb, 0x6a, 0x6f, - 0x81, 0xd2, 0x20, 0x77, 0x8d, 0xfe, 0x06, 0xbb, 0x3a, 0x04, 0xfd, 0x39, 0xd6, 0x47, 0x9d, 0xdc, - 0x75, 0x22, 0x02, 0xf9, 0x7d, 0x34, 0xed, 0x2c, 0x99, 0x43, 0x98, 0x6d, 0x26, 0xe0, 0x49, 0xa8, - 0xb5, 0x04, 0xd2, 0x33, 0x19, 0xa2, 0xb2, 0x35, 0x45, 0xe4, 0x92, 0x3b, 0x3c, 0x17, 0x7e, 0x8a, - 0x5a, 0xe6, 0x21, 0xba, 0x13, 0x7a, 0x86, 0x5a, 0x47, 0x33, 0xc9, 0xa7, 0x2c, 0xd3, 0x1c, 0x21, - 0xda, 0x6f, 0xa2, 0x69, 0x15, 0xb0, 0x19, 0x61, 0x92, 0x54, 0x60, 0xf2, 0x62, 0xc2, 0x48, 0x7f, - 0x9f, 0x40, 0xaf, 0x9e, 0xf0, 0x49, 0x6e, 0x5c, 0x37, 0x7d, 0xc6, 0xb5, 0x50, 0x88, 0x35, 0x2f, - 0x68, 0x5e, 0x37, 0x4e, 0x67, 0x5d, 0x2f, 0xa3, 0xf3, 0x6c, 0xb8, 0xde, 0x90, 0x77, 0x6b, 0x7b, - 0x3b, 0x5b, 0xcd, 0x26, 0x28, 0x10, 0x4e, 0x4a, 0x0d, 0x74, 0x33, 0x74, 0x07, 0x1b, 0xda, 0xa0, - 0x13, 0x83, 0x50, 0x6e, 0xa6, 0x52, 0x4f, 0x2f, 0xfd, 0x38, 0x89, 0x6e, 0x45, 0xac, 0xc8, 0xe9, - 0x50, 0xf1, 0xd1, 0x61, 0xb1, 0x70, 0xe2, 0x9c, 0x00, 0x0d, 0x44, 0xf6, 0x85, 0x45, 0x1c, 0xb0, - 0x69, 0x8f, 0x75, 0x72, 0x4c, 0x8f, 0xf4, 0x99, 0xc8, 0x35, 0xd9, 0x3e, 0x88, 0xb9, 0x1e, 0x20, - 0x56, 0x4b, 0xde, 0x00, 0x2f, 0x43, 0x28, 0x78, 0x09, 0x65, 0x19, 0xec, 0x51, 0xb9, 0x2a, 0xef, - 0x96, 0x9b, 0xcd, 0x27, 0x8d, 0xbd, 0x2a, 0xf8, 0xa6, 0x50, 0x82, 0xa7, 0x40, 0xfa, 0x11, 0x1b, - 0xde, 0xd8, 0xdf, 0xde, 0xc6, 0x69, 0x10, 0xef, 0x0b, 0xec, 0x77, 0x79, 0x1b, 0xbc, 0x54, 0xf5, - 0xa9, 0xbc, 0x53, 0xdb, 0x79, 0x54, 0xdb, 0xc3, 0x19, 0x87, 0x35, 0xfc, 0xa3, 0xdb, 0x8d, 0xca, - 0x7b, 0xb0, 0xc4, 0x84, 0xf4, 0x65, 0x01, 0x6b, 0xe2, 0xc9, 0xb0, 0xf4, 0xc3, 0x84, 0x80, 0x11, - 0x1e, 0x81, 0x8c, 0xc9, 0x88, 0x5f, 0x8c, 0x30, 0x12, 0x52, 0xf2, 0x53, 0x6f, 0x01, 0x2d, 0xa5, - 0xb2, 0x40, 0x73, 0x77, 0x14, 0xb3, 0x7d, 0x38, 0x1e, 0x1a, 0x31, 0x4e, 0xfd, 0xed, 0xb4, 0x40, - 0x15, 0x9d, 0x35, 0x4e, 0xa7, 0x8a, 0xfe, 0x79, 0x41, 0x31, 0x0c, 0xdd, 0x0d, 0xf3, 0x80, 0x75, - 0xb4, 0x70, 0xac, 0xaa, 0xcf, 0x7b, 0x2f, 0xe4, 0x3e, 0x5f, 0x86, 0xda, 0xa8, 0x99, 0xd2, 0x6a, - 0xcc, 0x8f, 0x3d, 0xa1, 0xb3, 0xad, 0xe1, 0x7c, 0x1b, 0x4d, 0xf2, 0xff, 0x89, 0xcf, 0xf7, 0xdb, - 0x4b, 0xf0, 0x16, 0x4c, 0x2b, 0xc3, 0x60, 0x25, 0xbe, 0xa5, 0x05, 0xe6, 0x09, 0x55, 0x40, 0xb6, - 0xc3, 0x1a, 0x36, 0x50, 0x62, 0x61, 0x4d, 0xfe, 0x18, 0xcd, 0x7b, 0x3f, 0x9b, 0xfd, 0x0a, 0x9a, - 0xe4, 0xfb, 0xe7, 0x89, 0x45, 0x5c, 0x5a, 0x59, 0x9b, 0x05, 0xc7, 0x47, 0xdd, 0x23, 0xf3, 0x9c, - 0x49, 0xcb, 0x74, 0xa8, 0x83, 0x0e, 0x1b, 0x49, 0x51, 0xde, 0xc9, 0x67, 0x23, 0x46, 0x22, 0x63, - 0x97, 0x92, 0xc6, 0xe8, 0x86, 0xb5, 0x6f, 0x62, 0x61, 0xf9, 0xde, 0x5b, 0x10, 0x3a, 0xc4, 0x30, - 0x75, 0x56, 0x90, 0x01, 0x26, 0x49, 0xfd, 0x88, 0x9f, 0xc1, 0x93, 0x99, 0xa4, 0xac, 0xb4, 0x83, - 0x0e, 0xd1, 0xe0, 0x83, 0x10, 0x34, 0x2d, 0xfd, 0x47, 0x02, 0xbd, 0x22, 0xfc, 0x2e, 0x97, 0xc6, - 0xb2, 0x4f, 0x1a, 0xef, 0x16, 0x4e, 0x98, 0x11, 0xd4, 0xc2, 0x8f, 0x4f, 0x19, 0x71, 0xdb, 0x71, - 0xb3, 0x27, 0xaa, 0xde, 0xaa, 0x6f, 0x34, 0xdc, 0x21, 0x77, 0xbd, 0xbc, 0x53, 0xb3, 0x8d, 0x56, - 0xab, 0xfc, 0x5e, 0x0d, 0x08, 0x29, 0xa2, 0x70, 0x5a, 0xda, 0x46, 0x6f, 0xf9, 0x24, 0x83, 0xec, - 0xd9, 0x65, 0xb1, 0x1e, 0xbd, 0xf0, 0xda, 0x95, 0x6a, 0x94, 0x32, 0xbf, 0x8b, 0x0a, 0x27, 0xad, - 0x46, 0x03, 0x88, 0x32, 0x13, 0x73, 0x58, 0x4c, 0x18, 0x45, 0xc0, 0xce, 0x5e, 0x11, 0xae, 0xc5, - 0x79, 0x70, 0x0f, 0x4d, 0x32, 0x1e, 0x58, 0xf9, 0x73, 0x4e, 0xf4, 0x79, 0xe9, 0x47, 0x09, 0x74, - 0x59, 0x00, 0x8b, 0x92, 0xa1, 0xb0, 0xed, 0x25, 0x2d, 0x95, 0xb5, 0x26, 0xb9, 0xa4, 0x2c, 0x15, - 0x94, 0xb2, 0x74, 0x50, 0xca, 0x32, 0x34, 0xc4, 0x85, 0x80, 0xf7, 0x58, 0x1b, 0xb0, 0xc4, 0x83, - 0x46, 0x5f, 0x3d, 0xdd, 0x30, 0x20, 0xcc, 0x9c, 0xa4, 0xbf, 0x2f, 0xa1, 0xf9, 0xf6, 0x78, 0x34, - 0x22, 0xc5, 0x06, 0x48, 0x20, 0x4c, 0x95, 0x64, 0xc9, 0x24, 0x58, 0xfa, 0xe7, 0x44, 0x28, 0x5d, - 0x48, 0x2c, 0xac, 0xc6, 0x50, 0x8a, 0x97, 0x3b, 0x10, 0x44, 0xd3, 0xcf, 0xb4, 0x1e, 0x6c, 0x82, - 0x99, 0x45, 0x32, 0x89, 0x6a, 0x0a, 0xfd, 0x12, 0x03, 0xb8, 0xcc, 0x45, 0xc6, 0x37, 0xc7, 0xb6, - 0x1a, 0x13, 0x56, 0xac, 0xad, 0x0d, 0xda, 0xbd, 0x71, 0x47, 0x95, 0x69, 0x88, 0x4b, 0x0f, 0x3c, - 0x25, 0xfd, 0x77, 0x32, 0xe0, 0x3e, 0x5d, 0x07, 0xe3, 0x1c, 0x7f, 0xe4, 0xd3, 0xba, 0x7b, 0x85, - 0x93, 0xa6, 0x04, 0xcd, 0xbf, 0xff, 0xa0, 0xd4, 0x98, 0xf2, 0x14, 0xb2, 0x81, 0x2e, 0x58, 0x30, - 0x1e, 0xad, 0x32, 0x28, 0x73, 0x02, 0xc5, 0x93, 0xbf, 0x46, 0x10, 0x58, 0xa1, 0x85, 0x8e, 0xe7, - 0x57, 0xd0, 0x82, 0x6f, 0x28, 0xb4, 0xf8, 0x42, 0x72, 0x4b, 0x67, 0x1b, 0x92, 0x7a, 0x36, 0xc1, - 0x62, 0xf6, 0x3a, 0xba, 0xc2, 0x00, 0x8d, 0x27, 0xf5, 0xda, 0x1e, 0x0d, 0x8f, 0xb6, 0xea, 0xdc, - 0xf4, 0x82, 0x79, 0xfd, 0xa9, 0xab, 0xc2, 0xe0, 0x3e, 0x91, 0xa9, 0x0c, 0x3a, 0x90, 0x58, 0xc5, - 0x70, 0xdf, 0x64, 0xe3, 0x2c, 0x89, 0x63, 0x42, 0x14, 0x2a, 0x0f, 0x29, 0x91, 0x3c, 0xa4, 0x45, - 0xc2, 0x95, 0xf1, 0x09, 0x17, 0xcd, 0xda, 0x29, 0x94, 0xca, 0xd0, 0x14, 0xd1, 0x0e, 0x0e, 0xd2, - 0x06, 0xf2, 0xa1, 0xd2, 0xeb, 0x71, 0x21, 0xfa, 0x38, 0x1d, 0x88, 0x48, 0x7c, 0x27, 0xe2, 0x82, - 0xb4, 0xe1, 0x13, 0xa4, 0x37, 0x0b, 0x71, 0xa6, 0x05, 0x85, 0xe9, 0x1d, 0x48, 0xfa, 0x6d, 0x21, - 0xb2, 0x82, 0x85, 0xe5, 0x78, 0x8b, 0x11, 0x24, 0x5b, 0x82, 0xf2, 0xff, 0x97, 0x40, 0x73, 0x9e, - 0x91, 0xb3, 0x57, 0x63, 0xd7, 0x82, 0x3e, 0x97, 0x47, 0x84, 0x92, 0x2d, 0x48, 0x6d, 0x56, 0xc6, - 0x8a, 0xc8, 0x3d, 0xe8, 0xae, 0x72, 0x9e, 0x2d, 0xaf, 0xac, 0x50, 0x42, 0xd2, 0x67, 0x1a, 0x92, - 0x28, 0x5d, 0x05, 0x4c, 0x9a, 0xc9, 0x2b, 0x26, 0x96, 0x85, 0x9b, 0xf6, 0x59, 0x38, 0x64, 0xe7, - 0x9b, 0xe6, 0x48, 0x55, 0x9e, 0xd3, 0x52, 0x49, 0xe6, 0xcc, 0x32, 0xa4, 0x7f, 0x08, 0xc6, 0xd1, - 0x2e, 0xf5, 0x8b, 0x21, 0xd3, 0xa1, 0xa9, 0xea, 0x2f, 0x55, 0xbe, 0xa5, 0x6f, 0x26, 0x9d, 0x62, - 0x65, 0xd8, 0x19, 0xb8, 0x14, 0x57, 0x7d, 0x52, 0xfc, 0x46, 0xe1, 0xe4, 0x49, 0xa7, 0x8a, 0x87, - 0x05, 0x59, 0x3b, 0xcf, 0xf2, 0x39, 0xc8, 0xe5, 0xe6, 0x6c, 0xb9, 0xa0, 0xd5, 0xb5, 0x33, 0x63, - 0xe9, 0x8f, 0x83, 0xf9, 0x3a, 0x3f, 0xd9, 0xcb, 0x9b, 0x2a, 0x10, 0x4e, 0x5a, 0xc3, 0x4e, 0x89, - 0x19, 0x9b, 0x16, 0x31, 0x36, 0x23, 0x62, 0xec, 0x84, 0x98, 0xb1, 0xcc, 0x40, 0xfd, 0x6e, 0x0a, - 0xbd, 0x76, 0xd2, 0x49, 0x38, 0x73, 0xdf, 0xf1, 0x31, 0xf7, 0xad, 0x42, 0xbc, 0x89, 0xa7, 0x62, - 0xb0, 0x97, 0x0a, 0x75, 0x34, 0xe7, 0x76, 0x7b, 0xa4, 0x6e, 0x4a, 0xec, 0xd9, 0x5a, 0xdc, 0x2f, - 0xfb, 0xbd, 0xdf, 0x6e, 0xd0, 0xfb, 0x85, 0x4a, 0x54, 0x22, 0x4c, 0xa2, 0x92, 0x5e, 0x89, 0x4a, - 0x9d, 0xa9, 0x44, 0x49, 0x81, 0x60, 0xc3, 0xb9, 0x1e, 0xe1, 0xb2, 0x24, 0x55, 0x04, 0x76, 0xc4, - 0x13, 0x83, 0xde, 0x40, 0xa9, 0xbe, 0xd1, 0xa5, 0x27, 0x98, 0x29, 0x9d, 0x0b, 0xdc, 0xc5, 0x48, - 0x9f, 0x26, 0x02, 0x9a, 0xcc, 0x22, 0x69, 0x56, 0x9c, 0xb7, 0xe4, 0x16, 0xe2, 0x43, 0x5e, 0x80, - 0xb4, 0xc9, 0x11, 0x59, 0x2d, 0x71, 0xd7, 0x71, 0xbc, 0x79, 0x8c, 0x4b, 0x1b, 0xad, 0x92, 0x2a, - 0x33, 0x37, 0xe0, 0x33, 0x4d, 0xad, 0xfd, 0x5c, 0x05, 0x8a, 0x9b, 0x6a, 0xdf, 0x96, 0x56, 0xe9, - 0x67, 0xc9, 0x40, 0x14, 0xe0, 0xdd, 0xe1, 0x89, 0xf7, 0x0c, 0x11, 0xb3, 0x4e, 0x23, 0x8c, 0x24, - 0x48, 0x0f, 0xe7, 0xae, 0x80, 0x8d, 0xbe, 0x94, 0xb2, 0x59, 0x2b, 0x37, 0x49, 0x91, 0x99, 0xa4, - 0x94, 0x57, 0xd0, 0xc5, 0x40, 0xae, 0x49, 0x32, 0x23, 0x77, 0x2e, 0x44, 0x40, 0x34, 0x85, 0xa2, - 0x80, 0x74, 0xb8, 0x0c, 0x65, 0x9c, 0xcc, 0x6a, 0xa3, 0xbc, 0xb5, 0x5d, 0x83, 0xd5, 0x1a, 0x9b, - 0x0d, 0x79, 0x7f, 0x77, 0xbb, 0x51, 0xae, 0xe2, 0x09, 0x10, 0xda, 0x05, 0x7b, 0x6b, 0xad, 0xad, - 0xca, 0x7b, 0xb5, 0x16, 0x9e, 0x94, 0x7e, 0x3f, 0x11, 0x1a, 0xcb, 0x7a, 0x59, 0x7e, 0x9a, 0x2a, - 0x5d, 0x58, 0xe2, 0x6a, 0x71, 0x37, 0x2d, 0xe0, 0x2e, 0xe5, 0xba, 0xf4, 0x87, 0xa9, 0x80, 0x14, - 0xbb, 0xb7, 0x12, 0xb7, 0xaa, 0x14, 0x9c, 0x73, 0x72, 0x60, 0xed, 0x4a, 0xbc, 0xa5, 0x4f, 0x92, - 0xa7, 0x65, 0x6d, 0x14, 0xd9, 0xc9, 0x2d, 0xc9, 0x55, 0x87, 0x89, 0xd6, 0x45, 0x83, 0x53, 0x53, - 0x48, 0x41, 0x40, 0x33, 0xef, 0x20, 0x70, 0x06, 0x7b, 0x6b, 0x7c, 0x19, 0x61, 0x8d, 0x6f, 0x42, - 0x50, 0x3c, 0x9c, 0x0c, 0x17, 0x91, 0xa9, 0x30, 0x21, 0x98, 0x16, 0xd5, 0x09, 0x91, 0xf4, 0xaf, - 0x09, 0xf4, 0x7a, 0x44, 0x15, 0xf9, 0x08, 0x18, 0x68, 0xbc, 0x94, 0x90, 0x6c, 0x93, 0xcc, 0x8a, - 0x4c, 0x97, 0xdb, 0x87, 0xca, 0xa0, 0xab, 0x46, 0xd7, 0xae, 0x82, 0x5f, 0x2b, 0xb0, 0x9f, 0x15, - 0x3a, 0x39, 0xbf, 0x8c, 0x66, 0xdd, 0xbf, 0x43, 0xf3, 0x96, 0x05, 0x34, 0xc9, 0xbe, 0xc8, 0xb6, - 0x30, 0x25, 0x7d, 0x3f, 0x81, 0xee, 0x9e, 0xfc, 0x35, 0x2e, 0x75, 0xef, 0xfa, 0xa4, 0xae, 0x58, - 0x88, 0x3b, 0x35, 0x58, 0x4c, 0x79, 0xf3, 0x54, 0x8e, 0x41, 0xaa, 0x0a, 0x58, 0x50, 0x25, 0x97, - 0x46, 0xe0, 0xd8, 0xcc, 0x71, 0x9c, 0xe2, 0xe5, 0x8f, 0x12, 0x82, 0x92, 0xaf, 0x6b, 0x99, 0x28, - 0x16, 0x82, 0xc7, 0x63, 0xb7, 0x54, 0xc0, 0x43, 0xc8, 0xf0, 0xe9, 0x45, 0x35, 0xbd, 0x7a, 0xe7, - 0x99, 0x3f, 0xb9, 0xbc, 0xe2, 0xae, 0x99, 0xea, 0x77, 0x5f, 0x95, 0x47, 0x6a, 0x1f, 0x42, 0x6c, - 0x72, 0x2f, 0x96, 0xb6, 0xc6, 0x87, 0x2a, 0x75, 0xc3, 0x32, 0xa1, 0x25, 0x0f, 0x4e, 0xa6, 0x88, - 0xc1, 0x68, 0xeb, 0xfd, 0x61, 0x4f, 0x25, 0xbc, 0x99, 0xb0, 0xae, 0x60, 0x94, 0x23, 0x45, 0xeb, - 0x29, 0x07, 0x3d, 0x55, 0xb6, 0xae, 0x83, 0x26, 0x69, 0x55, 0xc1, 0x88, 0x22, 0x07, 0xf3, 0x66, - 0x2f, 0x59, 0x71, 0x13, 0x47, 0x90, 0xd2, 0xd7, 0x53, 0x02, 0x59, 0xf1, 0x7c, 0xf5, 0x74, 0xb2, - 0x12, 0x32, 0x35, 0x28, 0x2b, 0x42, 0x63, 0x24, 0x88, 0x22, 0x6e, 0xa2, 0x6b, 0xde, 0xc2, 0x9b, - 0xd7, 0xe0, 0x80, 0x39, 0x7a, 0x15, 0xdd, 0xb2, 0x8c, 0x95, 0xc7, 0x14, 0x91, 0x8c, 0xbb, 0xba, - 0x57, 0xde, 0x68, 0x6d, 0xd5, 0x37, 0xc1, 0x28, 0x45, 0xe6, 0xe3, 0x69, 0xc7, 0x69, 0x11, 0x00, - 0x45, 0x69, 0xca, 0xad, 0xfd, 0xbd, 0xba, 0xdb, 0x54, 0xed, 0x6e, 0x97, 0x9f, 0xd6, 0xec, 0x9d, - 0x80, 0xa9, 0xb2, 0xed, 0x24, 0x87, 0xec, 0xd7, 0xcb, 0x8f, 0xc1, 0x62, 0x92, 0xfb, 0x74, 0x30, - 0x58, 0xb6, 0x9d, 0xe4, 0x50, 0x30, 0x50, 0xec, 0x08, 0xcd, 0xed, 0x46, 0xab, 0x89, 0xa7, 0x88, - 0xab, 0x0a, 0xcb, 0x98, 0xf7, 0x68, 0xcd, 0xa9, 0x79, 0xac, 0x0c, 0x3f, 0x47, 0xa5, 0x15, 0xe4, - 0x15, 0xa2, 0xe9, 0xfe, 0x90, 0x8b, 0xb0, 0x73, 0x47, 0x9a, 0xf6, 0xdd, 0x91, 0xd2, 0x78, 0x5a, - 0xfa, 0xaf, 0x60, 0x94, 0xef, 0xdf, 0x4a, 0xdc, 0xab, 0x80, 0xf0, 0x79, 0x41, 0x49, 0xf8, 0xed, - 0xd3, 0x09, 0x42, 0x24, 0xff, 0x5c, 0x75, 0x6c, 0x4a, 0x5c, 0x9b, 0x47, 0x29, 0x67, 0x39, 0x02, - 0xb0, 0x1c, 0x41, 0x5a, 0xfa, 0x24, 0xe8, 0x08, 0x9c, 0x8d, 0x97, 0x3b, 0x9d, 0xea, 0x48, 0x7f, - 0x59, 0xf2, 0x83, 0x59, 0x50, 0x3a, 0x1d, 0xb7, 0xce, 0x65, 0x9c, 0x7b, 0x71, 0x7d, 0xe8, 0x06, - 0xd0, 0xaa, 0x9c, 0xf4, 0x59, 0x32, 0xa0, 0x8c, 0x21, 0x7b, 0x89, 0xab, 0x8c, 0xc2, 0xa9, 0x41, - 0x16, 0xfc, 0x75, 0xe2, 0x4c, 0x79, 0x70, 0x03, 0xe5, 0x7d, 0x02, 0xdf, 0x92, 0x1d, 0x85, 0x48, - 0x05, 0xd4, 0x85, 0xaa, 0x5a, 0x9d, 0xc6, 0x81, 0xa0, 0x81, 0xb6, 0xba, 0xb4, 0xf6, 0xca, 0x55, - 0xa7, 0x8c, 0xbe, 0x5b, 0xab, 0x57, 0x89, 0x06, 0x67, 0x42, 0xee, 0xf8, 0xc8, 0x51, 0x5b, 0x23, - 0xa5, 0x13, 0xc7, 0x67, 0x4b, 0x9f, 0x84, 0x47, 0x63, 0xd6, 0xfc, 0xd3, 0x44, 0x63, 0xde, 0x39, - 0xc1, 0x68, 0x6c, 0x1d, 0x4d, 0x98, 0x14, 0x85, 0xf7, 0x89, 0xdd, 0x8d, 0xb1, 0x08, 0xfd, 0x99, - 0xff, 0x4e, 0x02, 0x65, 0xe8, 0x7f, 0x5e, 0x25, 0x16, 0x5f, 0x55, 0x15, 0x9d, 0xda, 0x53, 0xc8, - 0x35, 0x56, 0xca, 0xca, 0x66, 0x02, 0x7e, 0xc0, 0xb6, 0x04, 0xa1, 0x40, 0x6e, 0x16, 0x58, 0x9d, - 0x88, 0x78, 0x52, 0x2e, 0xa9, 0x67, 0x95, 0x02, 0xfe, 0x41, 0xb8, 0xb9, 0xa1, 0x27, 0xaf, 0x28, - 0x83, 0xb6, 0xda, 0x8b, 0xa1, 0x7b, 0xe0, 0xac, 0x1d, 0xdd, 0xe3, 0x57, 0x74, 0x22, 0x42, 0xa4, - 0x43, 0x66, 0x58, 0xb6, 0xef, 0x27, 0x89, 0x40, 0x5d, 0x20, 0xb0, 0x99, 0xb8, 0x75, 0x01, 0xc1, - 0xc4, 0xa0, 0xea, 0x7d, 0x70, 0x46, 0x65, 0x66, 0x3b, 0xd6, 0x26, 0xe1, 0x2f, 0x51, 0x1c, 0x9c, - 0x92, 0x7e, 0x27, 0x54, 0x51, 0x98, 0x4d, 0x78, 0x49, 0x9b, 0x16, 0x56, 0xf4, 0x4c, 0x05, 0x9d, - 0x0d, 0xeb, 0x9e, 0xfb, 0x7a, 0x32, 0x54, 0xd3, 0xac, 0x0d, 0x9c, 0x46, 0xd3, 0xbc, 0x73, 0x42, - 0xf3, 0x9e, 0x80, 0xf4, 0xf2, 0xae, 0x43, 0x52, 0x19, 0xe5, 0x30, 0xde, 0xd8, 0x48, 0x42, 0xf2, - 0xa9, 0x5f, 0x56, 0x81, 0x7f, 0x13, 0x2d, 0x86, 0x56, 0x30, 0xde, 0xd1, 0x0c, 0x7d, 0xa4, 0xb5, - 0x95, 0x1e, 0x09, 0x51, 0xe3, 0xd8, 0xad, 0x8f, 0x27, 0xd0, 0x1b, 0xb1, 0x56, 0xe2, 0x74, 0xdd, - 0xf1, 0xd1, 0x75, 0xa5, 0x70, 0x8a, 0xd9, 0x41, 0x0a, 0x6f, 0x92, 0xd6, 0x3b, 0xc0, 0xe0, 0xa6, - 0x6c, 0xfd, 0x54, 0xab, 0xd9, 0xc5, 0x2a, 0xd3, 0xc8, 0x7f, 0x9c, 0x44, 0x97, 0x5c, 0xd5, 0xa8, - 0x72, 0xbb, 0x3d, 0xee, 0x8f, 0x7b, 0x8a, 0xa9, 0x8f, 0x48, 0x2a, 0x43, 0x0b, 0x75, 0xaa, 0xc1, - 0x45, 0x90, 0xd4, 0xab, 0x49, 0xb3, 0xa1, 0xd5, 0x5e, 0x68, 0x77, 0x1b, 0xa6, 0x7c, 0xdd, 0x86, - 0x69, 0x7f, 0xb7, 0x61, 0x26, 0xd8, 0x6d, 0x38, 0xe1, 0xeb, 0x36, 0x9c, 0x74, 0x77, 0x1b, 0x4e, - 0x79, 0xba, 0x0d, 0xa7, 0xbd, 0xdd, 0x86, 0xc8, 0xdf, 0x6d, 0x38, 0x13, 0xd6, 0x6d, 0x38, 0x1b, - 0xda, 0x6d, 0x38, 0x67, 0x2f, 0x45, 0x4b, 0x68, 0xb4, 0x7f, 0x30, 0xff, 0x9f, 0x09, 0x34, 0xe3, - 0xa2, 0x89, 0xe8, 0x3e, 0x8a, 0xf4, 0x41, 0x18, 0x5c, 0xf3, 0x3e, 0x40, 0x73, 0x94, 0xfe, 0x76, - 0xab, 0x62, 0x9a, 0x96, 0xbb, 0x2a, 0x2f, 0xc3, 0x07, 0x3f, 0xdd, 0x65, 0x94, 0xb5, 0xd6, 0x76, - 0xb5, 0x3a, 0x66, 0xce, 0xec, 0x03, 0x67, 0xe6, 0x2f, 0x36, 0x03, 0x6d, 0x97, 0x3b, 0xac, 0xdf, - 0x1b, 0x42, 0x9c, 0x28, 0x53, 0x46, 0x04, 0x8b, 0x21, 0xf2, 0x8e, 0xab, 0xae, 0xd3, 0xd5, 0xe0, - 0x5d, 0x28, 0x4e, 0xd6, 0x7f, 0x91, 0xb2, 0x62, 0x64, 0xca, 0xee, 0x35, 0x69, 0x26, 0x49, 0xaa, - 0xd3, 0xd6, 0x20, 0x4b, 0xb0, 0xfe, 0x2d, 0x19, 0xb8, 0x2b, 0x76, 0xbe, 0x74, 0x62, 0x1f, 0x83, - 0x60, 0x46, 0x50, 0x3b, 0x1f, 0xa2, 0x29, 0xab, 0xf3, 0x5d, 0x14, 0x6b, 0x04, 0x16, 0xe1, 0x03, - 0xc4, 0x76, 0x0e, 0xc6, 0x7d, 0xd9, 0xd4, 0x4d, 0xa5, 0x27, 0xdb, 0xab, 0xd0, 0xed, 0xe7, 0x9f, - 0xa0, 0x49, 0x0b, 0x0d, 0x64, 0x94, 0x03, 0xc5, 0x74, 0xa5, 0xf9, 0xed, 0xd8, 0x3c, 0xd4, 0x43, - 0x1c, 0x04, 0xe8, 0x96, 0x53, 0xd1, 0x3f, 0x33, 0x89, 0x50, 0x51, 0xde, 0x77, 0xce, 0x3d, 0xb5, - 0xaf, 0x1f, 0xa9, 0xb4, 0xc7, 0xe1, 0xe5, 0xae, 0xef, 0xbc, 0x7e, 0x8f, 0xb1, 0xf1, 0xe7, 0xc1, - 0x12, 0xb2, 0xeb, 0x3b, 0xf1, 0x2f, 0x83, 0x42, 0x26, 0x05, 0x63, 0x82, 0xe3, 0x33, 0xf2, 0x4c, - 0x82, 0xea, 0x57, 0xca, 0x29, 0xad, 0xd1, 0xc8, 0xdc, 0x2a, 0xb9, 0xa5, 0xa5, 0x4a, 0x20, 0x00, - 0x6a, 0x82, 0x31, 0xee, 0x8c, 0x7b, 0x6a, 0x67, 0x87, 0xd9, 0xe5, 0x18, 0x7e, 0xea, 0x9f, 0x92, - 0x81, 0x8c, 0x2a, 0xb8, 0x0a, 0xa7, 0xd7, 0x96, 0x8f, 0x5e, 0x4b, 0x85, 0x98, 0x33, 0x83, 0x1a, - 0xf0, 0x14, 0x5d, 0x30, 0x2c, 0x64, 0x7e, 0x19, 0xd4, 0x51, 0x5e, 0x58, 0xda, 0xf0, 0x76, 0xec, - 0x85, 0xbd, 0x80, 0x2a, 0x2c, 0x91, 0xdf, 0x41, 0xd9, 0xe0, 0x68, 0x58, 0x60, 0x6e, 0xbd, 0xb0, - 0x70, 0x62, 0x0f, 0x90, 0x25, 0x9b, 0x3e, 0x06, 0xef, 0xb5, 0x3d, 0x65, 0x99, 0xec, 0x83, 0xb0, - 0x96, 0xc4, 0x23, 0xd5, 0xfb, 0x64, 0x22, 0x42, 0xd0, 0xa3, 0x4a, 0xc2, 0x3f, 0x0f, 0xbd, 0x19, - 0x71, 0x16, 0x8f, 0x2b, 0xd6, 0x21, 0x93, 0x3e, 0xb7, 0x58, 0x5f, 0x40, 0xd8, 0x11, 0x52, 0x2e, - 0xa2, 0xc9, 0x88, 0x76, 0x53, 0x97, 0x58, 0xd3, 0x72, 0x8f, 0x5c, 0xae, 0xb4, 0xb6, 0x1e, 0xd7, - 0x40, 0xac, 0x7f, 0x2f, 0x58, 0x10, 0x75, 0xf9, 0xa9, 0xaa, 0x6a, 0x2a, 0x5a, 0xcf, 0xf8, 0x7c, - 0x97, 0xd2, 0xde, 0x66, 0xbd, 0x54, 0xa0, 0x59, 0x8f, 0x19, 0xbd, 0x1f, 0xa6, 0xd1, 0xbd, 0x18, - 0x1b, 0xe1, 0x54, 0x7f, 0xcf, 0x47, 0xf5, 0x52, 0x21, 0xf6, 0xdc, 0xb0, 0x26, 0x89, 0x74, 0x47, - 0x31, 0x15, 0xae, 0x0e, 0x0f, 0x4f, 0xb1, 0x14, 0x03, 0x71, 0xb9, 0x37, 0x95, 0xfc, 0x0f, 0x92, - 0x68, 0xc1, 0x37, 0x46, 0x8e, 0x6a, 0xdf, 0xbf, 0x26, 0xe8, 0x5d, 0x08, 0xbd, 0x4c, 0x1b, 0x41, - 0x98, 0xe5, 0xa5, 0x11, 0x1b, 0x02, 0x77, 0xe3, 0xdc, 0x60, 0xf3, 0x31, 0xf3, 0xc5, 0xd0, 0xba, - 0xed, 0x75, 0x9e, 0xfa, 0x98, 0x9a, 0x3a, 0x72, 0x1e, 0x34, 0x39, 0xfc, 0x98, 0xb0, 0x4d, 0xf8, - 0x70, 0xa8, 0x1b, 0xa4, 0xf0, 0x6a, 0xbd, 0x7e, 0x9a, 0xb4, 0x93, 0x3f, 0x0f, 0x84, 0xde, 0xd2, - 0x4c, 0xd1, 0x9d, 0x05, 0x60, 0xf4, 0x3e, 0x67, 0x9a, 0xba, 0xaf, 0xbb, 0x56, 0x90, 0x8b, 0x4e, - 0x7a, 0xf0, 0x00, 0x27, 0x26, 0xee, 0xa3, 0x23, 0x1f, 0xbc, 0xa0, 0xd1, 0x20, 0xf5, 0x85, 0xb4, - 0x97, 0x0a, 0x12, 0x8c, 0x59, 0x5a, 0x87, 0xaf, 0x9c, 0x81, 0xbc, 0x4b, 0xdf, 0x9a, 0x46, 0x59, - 0x8b, 0x57, 0x2d, 0x7d, 0x3c, 0x22, 0x9b, 0x1d, 0x98, 0xd9, 0xd7, 0x51, 0x86, 0xec, 0x3d, 0xd8, - 0x74, 0xe7, 0xe0, 0x14, 0x48, 0xde, 0x44, 0x10, 0xbb, 0xf0, 0xd3, 0xb2, 0x83, 0xa1, 0x88, 0x9b, - 0xf0, 0x87, 0xc6, 0xc1, 0xdc, 0x57, 0x93, 0x6b, 0xb8, 0x39, 0xd3, 0x86, 0x5b, 0xad, 0x66, 0x73, - 0x60, 0x07, 0x16, 0x5c, 0xc3, 0x94, 0x63, 0x19, 0x2a, 0x9a, 0xb8, 0x50, 0x73, 0xd6, 0x6b, 0xc1, - 0xf8, 0xc3, 0x2b, 0xcf, 0x65, 0xdf, 0x90, 0xbc, 0x3f, 0x78, 0x3e, 0x00, 0x9a, 0x41, 0x62, 0x72, - 0xde, 0xbd, 0x8a, 0xda, 0x07, 0xa5, 0x32, 0x59, 0x57, 0xcb, 0x7c, 0xe9, 0x82, 0x67, 0x25, 0x0e, - 0x7b, 0x98, 0xf7, 0xae, 0xc6, 0x87, 0xe5, 0xba, 0x3e, 0x50, 0xbd, 0x82, 0x31, 0x19, 0xa2, 0x8d, - 0x53, 0x74, 0xec, 0x4b, 0x8c, 0xb5, 0x8c, 0xd3, 0xf3, 0xa5, 0x73, 0xee, 0xef, 0x90, 0x18, 0xd6, - 0xff, 0x11, 0x3a, 0x66, 0xef, 0x19, 0xc8, 0x38, 0xd0, 0x3b, 0xb4, 0x6f, 0x46, 0x48, 0xc6, 0x3a, - 0x20, 0xe4, 0xbf, 0x9b, 0x40, 0x69, 0x4a, 0x78, 0xd7, 0x8b, 0xbc, 0x44, 0xb0, 0x23, 0x31, 0x69, - 0xbd, 0x69, 0xa3, 0x43, 0xca, 0xc1, 0xc1, 0x48, 0x3d, 0xe2, 0x77, 0x8a, 0xe7, 0x9d, 0x77, 0x22, - 0xe4, 0xea, 0x7f, 0xee, 0x51, 0x12, 0x84, 0x03, 0x82, 0x27, 0x43, 0x55, 0xfd, 0x8f, 0xfb, 0x5c, - 0x8f, 0x75, 0xfc, 0x8f, 0x05, 0xd9, 0x03, 0x3f, 0xe0, 0x23, 0xd9, 0xb6, 0xac, 0xd3, 0x9e, 0x0a, - 0x93, 0xd3, 0x22, 0xff, 0xb3, 0x24, 0x4a, 0x53, 0xa6, 0xc3, 0x26, 0x89, 0x74, 0x78, 0x6a, 0x29, - 0x5d, 0x5d, 0xef, 0xd8, 0xea, 0x64, 0x47, 0xb6, 0x07, 0x8a, 0x33, 0x68, 0xdf, 0x86, 0x38, 0xa8, - 0x74, 0x73, 0xb3, 0x56, 0x74, 0x6c, 0x23, 0xd3, 0xe1, 0x39, 0xcb, 0x1a, 0xf6, 0xf4, 0x83, 0x83, - 0x17, 0x96, 0x34, 0x4d, 0x78, 0x8c, 0x46, 0xc6, 0x32, 0x1a, 0x74, 0x3b, 0xae, 0x2e, 0x27, 0x62, - 0x0b, 0xb4, 0x23, 0x55, 0xa6, 0x6d, 0x4a, 0xec, 0x51, 0xd8, 0x94, 0x3b, 0xec, 0x9c, 0xb6, 0xce, - 0xc9, 0xbb, 0x50, 0xe5, 0x67, 0x1a, 0xc9, 0x5d, 0xe8, 0x5b, 0x45, 0x90, 0x57, 0xce, 0xf3, 0x79, - 0xca, 0xf3, 0x8b, 0x6e, 0x9e, 0x93, 0xf3, 0x33, 0xbe, 0xdf, 0xf0, 0xf0, 0xdd, 0x1e, 0xb7, 0x79, - 0x0f, 0x5f, 0xa3, 0x44, 0x84, 0x6d, 0x2e, 0x84, 0x88, 0x17, 0x7d, 0xa6, 0x94, 0xff, 0x1f, 0xe0, - 0x3b, 0x11, 0x00, 0x37, 0xb6, 0x7d, 0xc1, 0x64, 0xd3, 0x42, 0x56, 0x1c, 0x8a, 0x3a, 0x83, 0x07, - 0x8e, 0x31, 0x3c, 0xd6, 0x06, 0xb4, 0x03, 0xcc, 0x7a, 0xdb, 0xc5, 0x22, 0x08, 0xdd, 0xb0, 0xc6, - 0x32, 0x61, 0x56, 0x93, 0x09, 0xfd, 0x16, 0x42, 0xf4, 0xc3, 0x0e, 0xa3, 0x7d, 0x27, 0x26, 0xdb, - 0x0b, 0x3b, 0xb1, 0x3d, 0x6e, 0x9f, 0xd8, 0x63, 0xbc, 0xa7, 0x45, 0x67, 0x96, 0xde, 0x77, 0xb2, - 0x31, 0x67, 0x35, 0xcb, 0x8f, 0x06, 0x4c, 0x08, 0xa3, 0xc6, 0x75, 0x74, 0x91, 0xbf, 0xdf, 0x75, - 0x41, 0xbb, 0x5c, 0xd2, 0xd2, 0xd2, 0x57, 0x9d, 0x70, 0xde, 0xbd, 0x24, 0xf7, 0x88, 0xe7, 0x3c, - 0x1e, 0x71, 0xee, 0x61, 0xa2, 0x04, 0x8a, 0x89, 0x9c, 0x85, 0xf8, 0xb3, 0xa3, 0xf3, 0x21, 0xda, - 0x29, 0xd5, 0xd0, 0x55, 0xfb, 0x4d, 0x26, 0xd8, 0x8b, 0x91, 0x97, 0xe3, 0xa2, 0xed, 0xba, 0x14, - 0x84, 0x45, 0x4c, 0x1f, 0xa0, 0xeb, 0xd6, 0x32, 0xbb, 0x8a, 0x01, 0xfb, 0x1a, 0x99, 0x8f, 0x75, - 0x53, 0x25, 0x2a, 0xbf, 0x09, 0xe7, 0x36, 0xbc, 0xe6, 0xc8, 0xd6, 0x7c, 0xce, 0x57, 0xb7, 0x46, - 0x8d, 0xc6, 0x64, 0x68, 0x3c, 0x74, 0x2e, 0xe3, 0xfe, 0xc8, 0x75, 0x0f, 0xe4, 0x5e, 0x7c, 0x53, - 0x05, 0x44, 0xad, 0x6d, 0xbf, 0xed, 0xcb, 0x3e, 0x46, 0x0b, 0xce, 0x3b, 0x40, 0x16, 0xcf, 0xb1, - 0x10, 0x41, 0x2a, 0x90, 0xb9, 0x72, 0x69, 0xa9, 0xb8, 0x6c, 0x2d, 0x60, 0xcf, 0xda, 0x1a, 0x74, - 0xb4, 0xb6, 0x6a, 0x3c, 0xbc, 0xb2, 0xbb, 0x5b, 0x5c, 0x26, 0x0f, 0x02, 0xe5, 0xf2, 0xf6, 0x76, - 0xb3, 0x55, 0xb6, 0xcb, 0xf0, 0x4b, 0x8c, 0xef, 0x1c, 0x9d, 0x9f, 0x77, 0x23, 0x78, 0xde, 0x26, - 0x89, 0x78, 0xd5, 0x0e, 0x8b, 0x01, 0x88, 0x16, 0x1b, 0x6e, 0x43, 0x97, 0xa6, 0xd2, 0x49, 0x50, - 0x64, 0xf6, 0x4e, 0x94, 0xad, 0xf3, 0xb6, 0xd3, 0xe0, 0x62, 0xad, 0xc3, 0x16, 0xa8, 0x28, 0xa3, - 0x4e, 0x85, 0xb4, 0x8f, 0xaa, 0xe4, 0x82, 0x9b, 0x98, 0x31, 0xeb, 0x87, 0x93, 0x52, 0x7c, 0x33, - 0x89, 0x2e, 0x84, 0x11, 0x26, 0x5b, 0xe2, 0xa9, 0x1a, 0x7b, 0x1c, 0xc8, 0x7c, 0xe1, 0x8d, 0x42, - 0x34, 0x83, 0xca, 0x28, 0xdb, 0x65, 0x04, 0x95, 0xed, 0xc3, 0x5a, 0xee, 0xf1, 0xd5, 0x42, 0x2c, - 0xfa, 0xaf, 0x01, 0xfd, 0x19, 0x11, 0xec, 0x3b, 0xdc, 0x94, 0xe0, 0xdb, 0x5e, 0x62, 0x55, 0xd1, - 0x25, 0x1e, 0x41, 0xb6, 0xe1, 0xd8, 0xb2, 0x7d, 0x54, 0xab, 0xcb, 0xeb, 0x4e, 0x21, 0x06, 0x91, - 0x20, 0x81, 0xa0, 0x7d, 0xf4, 0x16, 0x0a, 0x89, 0xc0, 0x2c, 0xad, 0x0b, 0x29, 0x24, 0x49, 0x3f, - 0x4d, 0xb3, 0xe7, 0xbc, 0x5e, 0x7c, 0xae, 0x52, 0x61, 0x95, 0x27, 0x47, 0xcd, 0x92, 0x96, 0x9a, - 0x2d, 0x92, 0xb6, 0x06, 0x53, 0x05, 0xfd, 0x30, 0xdd, 0xc5, 0xa1, 0x30, 0x4d, 0x83, 0x20, 0xea, - 0xa6, 0x4a, 0x8a, 0x6e, 0x1f, 0x8e, 0x95, 0x9e, 0xf6, 0x0c, 0x22, 0x38, 0x5a, 0xb3, 0x02, 0xe1, - 0x33, 0x9d, 0xee, 0x3d, 0x66, 0xb2, 0x00, 0xf3, 0x58, 0x3d, 0x01, 0x93, 0x79, 0xef, 0x1b, 0xe8, - 0x12, 0x9c, 0x9e, 0x58, 0x20, 0x9e, 0xdb, 0xd9, 0xf0, 0x69, 0xfe, 0xf8, 0x70, 0x9e, 0x6b, 0x5d, - 0x97, 0x30, 0x99, 0xbf, 0x25, 0x9e, 0x01, 0x03, 0x18, 0x2a, 0x37, 0xaf, 0xa1, 0x1b, 0xfe, 0x2d, - 0x72, 0x0d, 0xb5, 0x44, 0x99, 0xf5, 0xc7, 0xde, 0x43, 0xb7, 0xfc, 0x78, 0x4c, 0x6d, 0x65, 0xd0, - 0x5b, 0x0b, 0x95, 0x85, 0x7f, 0xb0, 0xa4, 0xff, 0x2c, 0xbe, 0x25, 0x67, 0xad, 0x25, 0xfd, 0x78, - 0xc1, 0x25, 0xe7, 0xac, 0xf8, 0x76, 0xc8, 0x77, 0x6d, 0xc8, 0x07, 0xfa, 0xb8, 0x7b, 0x68, 0x52, - 0x4f, 0x46, 0xad, 0x28, 0x84, 0xa1, 0x5d, 0xe2, 0xea, 0xe4, 0xe1, 0x78, 0x04, 0x72, 0x64, 0x30, - 0xeb, 0xb2, 0x10, 0x9a, 0xf2, 0xb1, 0x9e, 0x4b, 0x6c, 0x51, 0xd2, 0x0d, 0x53, 0x3f, 0x1a, 0x6a, - 0x23, 0xca, 0x54, 0xfe, 0xb6, 0x56, 0x42, 0x79, 0x37, 0x9c, 0x9c, 0xa2, 0xd7, 0xa3, 0x95, 0x73, - 0x59, 0x31, 0xd9, 0x4b, 0xdb, 0x45, 0x88, 0x1f, 0x2e, 0x84, 0xb9, 0x4c, 0x98, 0x7c, 0x82, 0x33, - 0x85, 0xf0, 0xf7, 0x0e, 0xba, 0x29, 0xc0, 0xb1, 0x93, 0x6c, 0x08, 0x78, 0x8a, 0xe8, 0x4d, 0x01, - 0xd6, 0x13, 0x45, 0x33, 0x21, 0x02, 0xdf, 0xd0, 0x47, 0xdb, 0x24, 0x9e, 0x68, 0xe9, 0x4d, 0xe2, - 0x97, 0x20, 0x35, 0xbc, 0x85, 0xae, 0x0b, 0xa6, 0x94, 0x41, 0x6d, 0x8f, 0x54, 0xc8, 0x10, 0x5f, - 0x43, 0x92, 0x00, 0xa5, 0xaa, 0x8d, 0xd4, 0xc7, 0x20, 0x78, 0xfa, 0xe8, 0x05, 0x4e, 0x93, 0x5e, - 0x02, 0x01, 0xde, 0x9e, 0xd2, 0xb1, 0xd0, 0x32, 0xd9, 0xdb, 0xe8, 0x15, 0x01, 0x1a, 0xbb, 0xf6, - 0x81, 0x93, 0x4c, 0x04, 0xce, 0xcb, 0x1b, 0xd1, 0x69, 0xf8, 0x6a, 0xd6, 0xc1, 0xff, 0x03, 0xd6, - 0xe4, 0xe2, 0xbf, 0x4f, 0x78, 0x48, 0x6a, 0x23, 0x05, 0x48, 0xea, 0x4c, 0x77, 0x48, 0x7a, 0x13, - 0x5d, 0x13, 0x7e, 0xa2, 0xa3, 0x16, 0x81, 0x9c, 0xb7, 0x85, 0xab, 0x10, 0x8c, 0x1d, 0xe5, 0x23, - 0xfc, 0xb5, 0x29, 0xa0, 0xce, 0x2d, 0x01, 0x52, 0xad, 0xa7, 0xf5, 0x41, 0xd8, 0x4c, 0xd8, 0xea, - 0xdf, 0xf6, 0x81, 0x3a, 0xa2, 0x13, 0x01, 0x53, 0x9e, 0xa9, 0xa4, 0x15, 0x09, 0xff, 0x1d, 0x49, - 0x3d, 0x24, 0x11, 0x9a, 0x36, 0xd0, 0x0c, 0xe0, 0x75, 0xd1, 0x30, 0xf1, 0xb7, 0xc6, 0x31, 0x10, - 0x4b, 0x83, 0x0e, 0xfe, 0x76, 0x1c, 0xc4, 0xe5, 0x51, 0x07, 0xff, 0x71, 0x1c, 0xc4, 0x15, 0xf3, - 0x10, 0x7f, 0x27, 0x0e, 0xe2, 0x2a, 0x20, 0xfe, 0x49, 0x1c, 0xc4, 0xfb, 0x80, 0xf8, 0xa7, 0x71, - 0x10, 0xd7, 0x00, 0xf1, 0xd3, 0x38, 0x88, 0xeb, 0x80, 0xf8, 0x67, 0x71, 0x10, 0x1f, 0x00, 0xe2, - 0x9f, 0x8f, 0xc1, 0x9c, 0xde, 0x3e, 0x89, 0xe0, 0x4b, 0x80, 0xf9, 0xdd, 0x58, 0x98, 0x45, 0xc0, - 0xfc, 0x5e, 0x2c, 0xcc, 0x12, 0x60, 0x7e, 0x16, 0x0b, 0x73, 0x19, 0x30, 0xbf, 0x1f, 0x0b, 0x93, - 0xb0, 0xe7, 0x07, 0xb1, 0x30, 0x09, 0x7f, 0xfe, 0x22, 0x16, 0x26, 0x61, 0xd0, 0x5f, 0x8e, 0x17, - 0xff, 0x25, 0x01, 0x89, 0xb6, 0x2f, 0xcf, 0x23, 0x2d, 0x0b, 0xe2, 0xec, 0x0f, 0x34, 0xec, 0x1a, - 0xca, 0x85, 0xc0, 0x9b, 0xaa, 0x39, 0x1e, 0xb2, 0xe6, 0xa4, 0x30, 0xa8, 0x6d, 0xce, 0x82, 0xb6, - 0x89, 0x61, 0x6c, 0x0d, 0x76, 0x47, 0x7a, 0x17, 0x7c, 0xad, 0x01, 0xb6, 0x29, 0x7c, 0x91, 0x8a, - 0xd5, 0x40, 0xc6, 0x3a, 0x23, 0xc2, 0x30, 0x2c, 0x53, 0x93, 0x59, 0xfc, 0x2b, 0xaf, 0x5d, 0xb6, - 0x03, 0xfb, 0x80, 0x11, 0x09, 0x84, 0xfc, 0x70, 0xc4, 0x02, 0x5a, 0x14, 0xe0, 0x10, 0x5a, 0x1a, - 0x60, 0xac, 0x9e, 0xaa, 0x66, 0xd9, 0x30, 0xb4, 0xee, 0x80, 0x5a, 0xe8, 0x7b, 0xe8, 0x55, 0x01, - 0xfe, 0xd6, 0xe0, 0x91, 0x6a, 0x1e, 0xab, 0xea, 0x80, 0xd8, 0x43, 0x03, 0x4e, 0x2f, 0x46, 0x25, - 0x18, 0x91, 0x54, 0x70, 0x50, 0xcb, 0xf2, 0x13, 0x7d, 0x00, 0x54, 0x10, 0x63, 0x3c, 0xa2, 0x18, - 0x41, 0xb3, 0xec, 0x60, 0x38, 0x66, 0x79, 0xf1, 0x7b, 0x17, 0xd1, 0xad, 0x13, 0x83, 0x65, 0x72, - 0xb9, 0x2b, 0x0c, 0x97, 0x81, 0x66, 0x11, 0xe0, 0x22, 0xeb, 0x93, 0x11, 0x81, 0x4b, 0xec, 0xe6, - 0x58, 0x04, 0x5e, 0x66, 0x9d, 0x6a, 0x22, 0xf0, 0x0a, 0xd0, 0x21, 0x02, 0xbc, 0x0a, 0x44, 0x88, - 0x00, 0xdf, 0x07, 0xaf, 0x14, 0x01, 0x5e, 0xc3, 0x93, 0x51, 0xe0, 0x75, 0x3c, 0x15, 0x05, 0x7e, - 0x80, 0xa7, 0x89, 0xb6, 0xd8, 0xe0, 0xf7, 0xf7, 0xcb, 0xdb, 0xbb, 0x7b, 0xb5, 0xaa, 0xfc, 0xa4, - 0xd6, 0x6c, 0x01, 0xd1, 0x50, 0x04, 0xb4, 0x88, 0x67, 0x22, 0xa0, 0x25, 0x3c, 0x1b, 0x01, 0x5d, - 0xc6, 0x73, 0x11, 0xd0, 0x15, 0x3c, 0x1f, 0x01, 0x5d, 0xc5, 0x0b, 0x11, 0xd0, 0xfb, 0x18, 0x47, - 0x40, 0xd7, 0xf0, 0xb9, 0x08, 0xe8, 0x3a, 0xce, 0x46, 0x40, 0x1f, 0xe0, 0xf3, 0x1e, 0x52, 0xfa, - 0xa8, 0xb1, 0x84, 0x2f, 0x44, 0x81, 0x8b, 0xf8, 0x62, 0x14, 0xb8, 0x84, 0x2f, 0x45, 0x81, 0x97, - 0xf1, 0xe5, 0x28, 0xf0, 0x0a, 0xce, 0x85, 0x6f, 0xbc, 0x56, 0xa6, 0x6c, 0xbc, 0x12, 0x01, 0x2d, - 0xe2, 0x7c, 0x04, 0xb4, 0x84, 0xaf, 0x46, 0x40, 0x97, 0xf1, 0xb5, 0x08, 0xe8, 0x0a, 0xbe, 0x1e, - 0x01, 0x5d, 0xc5, 0x37, 0x22, 0xa0, 0xf7, 0xf1, 0x2b, 0x11, 0xd0, 0x35, 0x7c, 0x33, 0x02, 0xba, - 0x8e, 0x6f, 0x45, 0x40, 0x1f, 0x60, 0x29, 0x9c, 0x94, 0x8c, 0x1a, 0x4b, 0xf8, 0x76, 0x14, 0xb8, - 0x88, 0xef, 0x44, 0x81, 0x4b, 0xf8, 0xd5, 0x28, 0xf0, 0x32, 0x7e, 0x2d, 0x0a, 0xbc, 0x82, 0x5f, - 0x27, 0x2d, 0xad, 0x36, 0x98, 0xf4, 0xd8, 0x55, 0xf6, 0x77, 0x59, 0xaf, 0xdd, 0x5d, 0xf2, 0x9c, - 0x3d, 0x00, 0x62, 0x7a, 0x8c, 0xef, 0x11, 0x9f, 0x18, 0x3a, 0x8f, 0xde, 0x23, 0xe2, 0x45, 0x62, - 0x88, 0x05, 0x93, 0x19, 0xc6, 0x1b, 0xa4, 0x63, 0xd6, 0xc6, 0xa8, 0x3d, 0xae, 0xd5, 0x5b, 0x74, - 0x67, 0x4b, 0xf8, 0x8b, 0x02, 0x48, 0x11, 0xbf, 0x29, 0x80, 0x94, 0x70, 0x41, 0x00, 0x59, 0xc6, - 0x6f, 0x09, 0x20, 0x2b, 0x78, 0x49, 0x00, 0x59, 0xc5, 0x45, 0x01, 0xe4, 0x3e, 0x2e, 0x09, 0x20, - 0x6b, 0x78, 0x59, 0x00, 0x59, 0xc7, 0x2b, 0x02, 0xc8, 0x03, 0xbc, 0xea, 0xa1, 0xbe, 0xeb, 0xa4, - 0x4b, 0xf8, 0xbe, 0x08, 0x54, 0xc4, 0x6b, 0x22, 0x50, 0x09, 0xaf, 0x8b, 0x40, 0xcb, 0xf8, 0x81, - 0x08, 0xb4, 0x82, 0x1f, 0x8a, 0x40, 0xab, 0xf8, 0x6d, 0x11, 0xe8, 0x3e, 0xfe, 0x92, 0x08, 0xb4, - 0x86, 0xbf, 0x2c, 0x02, 0xad, 0xe3, 0x5f, 0x11, 0x81, 0x1e, 0xe0, 0xaf, 0x08, 0x40, 0xa5, 0x25, - 0xfc, 0xab, 0x22, 0x50, 0x11, 0x97, 0x45, 0xa0, 0x12, 0x7e, 0x24, 0x02, 0x2d, 0xe3, 0x8a, 0x08, - 0xb4, 0x82, 0xab, 0x22, 0xd0, 0x2a, 0xae, 0x89, 0x40, 0xf7, 0xf1, 0x86, 0x08, 0xb4, 0x86, 0x37, - 0x45, 0xa0, 0x75, 0xfc, 0x8e, 0x08, 0xf4, 0x00, 0x6f, 0x09, 0x40, 0xcb, 0x4b, 0xf8, 0x5d, 0x11, - 0xa8, 0x88, 0xdf, 0x13, 0x81, 0x4a, 0x78, 0x5b, 0x04, 0x5a, 0xc6, 0x3b, 0x22, 0xd0, 0x0a, 0xae, - 0x8b, 0x40, 0xab, 0xb8, 0x21, 0x02, 0xdd, 0xc7, 0xbb, 0x22, 0xd0, 0x1a, 0x7e, 0x5f, 0x04, 0x5a, - 0xc7, 0x7b, 0x22, 0xd0, 0x03, 0xdc, 0x14, 0x80, 0x56, 0x96, 0x70, 0x4b, 0x04, 0x2a, 0xe2, 0x7d, - 0x11, 0xa8, 0x84, 0x1f, 0x8b, 0x40, 0xcb, 0xf8, 0x09, 0x79, 0x2d, 0x64, 0x83, 0x9a, 0x8d, 0xed, - 0x06, 0x18, 0xa5, 0xaf, 0x06, 0x07, 0x8b, 0xf8, 0x69, 0x70, 0xb0, 0x84, 0x3f, 0x08, 0x0e, 0x2e, - 0xe3, 0x5f, 0x0b, 0x0e, 0xae, 0xe0, 0x5f, 0x0f, 0x0e, 0xae, 0xe2, 0xdf, 0x08, 0x0e, 0xde, 0xc7, - 0xbf, 0x19, 0x1c, 0x5c, 0xc3, 0xf2, 0xa3, 0xcc, 0x3b, 0x89, 0xaf, 0x25, 0xbe, 0xf0, 0xff, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x28, 0xbf, 0xf3, 0xc9, 0x04, 0x53, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_common.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_common.pb.go deleted file mode 100644 index 429f41ce..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/dota_common.pb.go +++ /dev/null @@ -1,10997 +0,0 @@ -// Code generated by protoc-gen-go. -// source: dota_gcmessages_common.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type EDOTAGCMsg int32 - -const ( - EDOTAGCMsg_k_EMsgGCDOTABase EDOTAGCMsg = 7000 - EDOTAGCMsg_k_EMsgGCGeneralResponse EDOTAGCMsg = 7001 - EDOTAGCMsg_k_EMsgGCGameMatchSignOut EDOTAGCMsg = 7004 - EDOTAGCMsg_k_EMsgGCGameMatchSignOutResponse EDOTAGCMsg = 7005 - EDOTAGCMsg_k_EMsgGCJoinChatChannel EDOTAGCMsg = 7009 - EDOTAGCMsg_k_EMsgGCJoinChatChannelResponse EDOTAGCMsg = 7010 - EDOTAGCMsg_k_EMsgGCOtherJoinedChannel EDOTAGCMsg = 7013 - EDOTAGCMsg_k_EMsgGCOtherLeftChannel EDOTAGCMsg = 7014 - EDOTAGCMsg_k_EMsgGCMatchHistoryList EDOTAGCMsg = 7017 - EDOTAGCMsg_k_EMsgServerToGCRequestStatus EDOTAGCMsg = 7026 - EDOTAGCMsg_k_EMsgGCGetRecentMatches EDOTAGCMsg = 7027 - EDOTAGCMsg_k_EMsgGCRecentMatchesResponse EDOTAGCMsg = 7028 - EDOTAGCMsg_k_EMsgGCStartFindingMatch EDOTAGCMsg = 7033 - EDOTAGCMsg_k_EMsgGCConnectedPlayers EDOTAGCMsg = 7034 - EDOTAGCMsg_k_EMsgGCAbandonCurrentGame EDOTAGCMsg = 7035 - EDOTAGCMsg_k_EMsgGCStopFindingMatch EDOTAGCMsg = 7036 - EDOTAGCMsg_k_EMsgGCPracticeLobbyCreate EDOTAGCMsg = 7038 - EDOTAGCMsg_k_EMsgGCPracticeLobbyLeave EDOTAGCMsg = 7040 - EDOTAGCMsg_k_EMsgGCPracticeLobbyLaunch EDOTAGCMsg = 7041 - EDOTAGCMsg_k_EMsgGCPracticeLobbyList EDOTAGCMsg = 7042 - EDOTAGCMsg_k_EMsgGCPracticeLobbyListResponse EDOTAGCMsg = 7043 - EDOTAGCMsg_k_EMsgGCPracticeLobbyJoin EDOTAGCMsg = 7044 - EDOTAGCMsg_k_EMsgGCPracticeLobbySetDetails EDOTAGCMsg = 7046 - EDOTAGCMsg_k_EMsgGCPracticeLobbySetTeamSlot EDOTAGCMsg = 7047 - EDOTAGCMsg_k_EMsgGCInitialQuestionnaireResponse EDOTAGCMsg = 7049 - EDOTAGCMsg_k_EMsgGCTournamentRequest EDOTAGCMsg = 7051 - EDOTAGCMsg_k_EMsgGCTournamentResponse EDOTAGCMsg = 7052 - EDOTAGCMsg_k_EMsgGCPracticeLobbyResponse EDOTAGCMsg = 7055 - EDOTAGCMsg_k_EMsgGCBroadcastNotification EDOTAGCMsg = 7056 - EDOTAGCMsg_k_EMsgGCLiveScoreboardUpdate EDOTAGCMsg = 7057 - EDOTAGCMsg_k_EMsgGCRequestChatChannelList EDOTAGCMsg = 7060 - EDOTAGCMsg_k_EMsgGCRequestChatChannelListResponse EDOTAGCMsg = 7061 - EDOTAGCMsg_k_EMsgGCRequestMatches EDOTAGCMsg = 7064 - EDOTAGCMsg_k_EMsgGCRequestMatchesResponse EDOTAGCMsg = 7065 - EDOTAGCMsg_k_EMsgGCRequestPlayerResources EDOTAGCMsg = 7068 - EDOTAGCMsg_k_EMsgGCRequestPlayerResourcesResponse EDOTAGCMsg = 7069 - EDOTAGCMsg_k_EMsgGCReadyUp EDOTAGCMsg = 7070 - EDOTAGCMsg_k_EMsgGCKickedFromMatchmakingQueue EDOTAGCMsg = 7071 - EDOTAGCMsg_k_EMsgGCLeaverDetected EDOTAGCMsg = 7072 - EDOTAGCMsg_k_EMsgGCSpectateFriendGame EDOTAGCMsg = 7073 - EDOTAGCMsg_k_EMsgGCSpectateFriendGameResponse EDOTAGCMsg = 7074 - EDOTAGCMsg_k_EMsgGCPlayerReports EDOTAGCMsg = 7075 - EDOTAGCMsg_k_EMsgGCReportsRemainingRequest EDOTAGCMsg = 7076 - EDOTAGCMsg_k_EMsgGCReportsRemainingResponse EDOTAGCMsg = 7077 - EDOTAGCMsg_k_EMsgGCSubmitPlayerReport EDOTAGCMsg = 7078 - EDOTAGCMsg_k_EMsgGCSubmitPlayerReportResponse EDOTAGCMsg = 7079 - EDOTAGCMsg_k_EMsgGCGameChatLog EDOTAGCMsg = 7080 - EDOTAGCMsg_k_EMsgGCPracticeLobbyKick EDOTAGCMsg = 7081 - EDOTAGCMsg_k_EMsgGCReportCountsRequest EDOTAGCMsg = 7082 - EDOTAGCMsg_k_EMsgGCReportCountsResponse EDOTAGCMsg = 7083 - EDOTAGCMsg_k_EMsgGCRequestSaveGames EDOTAGCMsg = 7084 - EDOTAGCMsg_k_EMsgGCRequestSaveGamesServer EDOTAGCMsg = 7085 - EDOTAGCMsg_k_EMsgGCRequestSaveGamesResponse EDOTAGCMsg = 7086 - EDOTAGCMsg_k_EMsgGCLeaverDetectedResponse EDOTAGCMsg = 7087 - EDOTAGCMsg_k_EMsgGCPlayerFailedToConnect EDOTAGCMsg = 7088 - EDOTAGCMsg_k_EMsgGCGCToRelayConnect EDOTAGCMsg = 7089 - EDOTAGCMsg_k_EMsgGCGCToRelayConnectresponse EDOTAGCMsg = 7090 - EDOTAGCMsg_k_EMsgGCWatchGame EDOTAGCMsg = 7091 - EDOTAGCMsg_k_EMsgGCWatchGameResponse EDOTAGCMsg = 7092 - EDOTAGCMsg_k_EMsgGCBanStatusRequest EDOTAGCMsg = 7093 - EDOTAGCMsg_k_EMsgGCBanStatusResponse EDOTAGCMsg = 7094 - EDOTAGCMsg_k_EMsgGCMatchDetailsRequest EDOTAGCMsg = 7095 - EDOTAGCMsg_k_EMsgGCMatchDetailsResponse EDOTAGCMsg = 7096 - EDOTAGCMsg_k_EMsgGCCancelWatchGame EDOTAGCMsg = 7097 - EDOTAGCMsg_k_EMsgGCProfileRequest EDOTAGCMsg = 7098 - EDOTAGCMsg_k_EMsgGCProfileResponse EDOTAGCMsg = 7099 - EDOTAGCMsg_k_EMsgGCPopup EDOTAGCMsg = 7102 - EDOTAGCMsg_k_EMsgGCDOTAClearNotifySuccessfulReport EDOTAGCMsg = 7104 - EDOTAGCMsg_k_EMsgGCFriendPracticeLobbyListRequest EDOTAGCMsg = 7111 - EDOTAGCMsg_k_EMsgGCFriendPracticeLobbyListResponse EDOTAGCMsg = 7112 - EDOTAGCMsg_k_EMsgGCPracticeLobbyJoinResponse EDOTAGCMsg = 7113 - EDOTAGCMsg_k_EMsgClientEconNotification_Job EDOTAGCMsg = 7114 - EDOTAGCMsg_k_EMsgGCCreateTeam EDOTAGCMsg = 7115 - EDOTAGCMsg_k_EMsgGCCreateTeamResponse EDOTAGCMsg = 7116 - EDOTAGCMsg_k_EMsgGCDisbandTeam EDOTAGCMsg = 7117 - EDOTAGCMsg_k_EMsgGCDisbandTeamResponse EDOTAGCMsg = 7118 - EDOTAGCMsg_k_EMsgGCRequestTeamData EDOTAGCMsg = 7119 - EDOTAGCMsg_k_EMsgGCRequestTeamDataResponse EDOTAGCMsg = 7120 - EDOTAGCMsg_k_EMsgGCTeamData EDOTAGCMsg = 7121 - EDOTAGCMsg_k_EMsgGCTeamInvite_InviterToGC EDOTAGCMsg = 7122 - EDOTAGCMsg_k_EMsgGCTeamInvite_GCImmediateResponseToInviter EDOTAGCMsg = 7123 - EDOTAGCMsg_k_EMsgGCTeamInvite_GCRequestToInvitee EDOTAGCMsg = 7124 - EDOTAGCMsg_k_EMsgGCTeamInvite_InviteeResponseToGC EDOTAGCMsg = 7125 - EDOTAGCMsg_k_EMsgGCTeamInvite_GCResponseToInviter EDOTAGCMsg = 7126 - EDOTAGCMsg_k_EMsgGCTeamInvite_GCResponseToInvitee EDOTAGCMsg = 7127 - EDOTAGCMsg_k_EMsgGCKickTeamMember EDOTAGCMsg = 7128 - EDOTAGCMsg_k_EMsgGCKickTeamMemberResponse EDOTAGCMsg = 7129 - EDOTAGCMsg_k_EMsgGCLeaveTeam EDOTAGCMsg = 7130 - EDOTAGCMsg_k_EMsgGCLeaveTeamResponse EDOTAGCMsg = 7131 - EDOTAGCMsg_k_EMsgGCSuggestTeamMatchmaking EDOTAGCMsg = 7132 - EDOTAGCMsg_k_EMsgGCPlayerHeroesFavoritesAdd EDOTAGCMsg = 7133 - EDOTAGCMsg_k_EMsgGCPlayerHeroesFavoritesRemove EDOTAGCMsg = 7134 - EDOTAGCMsg_k_EMsgGCEditTeamLogo EDOTAGCMsg = 7139 - EDOTAGCMsg_k_EMsgGCEditTeamLogoResponse EDOTAGCMsg = 7140 - EDOTAGCMsg_k_EMsgGCSetShowcaseHero EDOTAGCMsg = 7141 - EDOTAGCMsg_k_EMsgGCApplyTeamToPracticeLobby EDOTAGCMsg = 7142 - EDOTAGCMsg_k_EMsgGCRequestInternatinalTicketEmail EDOTAGCMsg = 7143 - EDOTAGCMsg_k_EMsgGCTransferTeamAdmin EDOTAGCMsg = 7144 - EDOTAGCMsg_k_EMsgGCClearTournamentGame EDOTAGCMsg = 7145 - EDOTAGCMsg_k_EMsgRequestLeagueInfo EDOTAGCMsg = 7147 - EDOTAGCMsg_k_EMsgResponseLeagueInfo EDOTAGCMsg = 7148 - EDOTAGCMsg_k_EMsgGCPracticeLobbyJoinBroadcastChannel EDOTAGCMsg = 7149 - EDOTAGCMsg_k_EMsgGC_TournamentItemEvent EDOTAGCMsg = 7150 - EDOTAGCMsg_k_EMsgGC_TournamentItemEventResponse EDOTAGCMsg = 7151 - EDOTAGCMsg_k_EMsgCastMatchVote EDOTAGCMsg = 7152 - EDOTAGCMsg_k_EMsgCastMatchVoteResponse EDOTAGCMsg = 7153 - EDOTAGCMsg_k_EMsgRetrieveMatchVote EDOTAGCMsg = 7154 - EDOTAGCMsg_k_EMsgRetrieveMatchVoteResponse EDOTAGCMsg = 7155 - EDOTAGCMsg_k_EMsgTeamFanfare EDOTAGCMsg = 7156 - EDOTAGCMsg_k_EMsgResponseTeamFanfare EDOTAGCMsg = 7157 - EDOTAGCMsg_k_EMsgGC_GameServerUploadSaveGame EDOTAGCMsg = 7158 - EDOTAGCMsg_k_EMsgGC_GameServerSaveGameResult EDOTAGCMsg = 7159 - EDOTAGCMsg_k_EMsgGC_GameServerGetLoadGame EDOTAGCMsg = 7160 - EDOTAGCMsg_k_EMsgGC_GameServerGetLoadGameResult EDOTAGCMsg = 7161 - EDOTAGCMsg_k_EMsgGCTeamProfileRequest EDOTAGCMsg = 7164 - EDOTAGCMsg_k_EMsgGCTeamProfileResponse EDOTAGCMsg = 7165 - EDOTAGCMsg_k_EMsgGCEditTeamDetails EDOTAGCMsg = 7166 - EDOTAGCMsg_k_EMsgGCEditTeamDetailsResponse EDOTAGCMsg = 7167 - EDOTAGCMsg_k_EMsgGCProTeamListRequest EDOTAGCMsg = 7168 - EDOTAGCMsg_k_EMsgGCProTeamListResponse EDOTAGCMsg = 7169 - EDOTAGCMsg_k_EMsgGCReadyUpStatus EDOTAGCMsg = 7170 - EDOTAGCMsg_k_EMsgGCHallOfFame EDOTAGCMsg = 7171 - EDOTAGCMsg_k_EMsgGCHallOfFameRequest EDOTAGCMsg = 7172 - EDOTAGCMsg_k_EMsgGCHallOfFameResponse EDOTAGCMsg = 7173 - EDOTAGCMsg_k_EMsgGCGenerateDiretidePrizeList EDOTAGCMsg = 7174 - EDOTAGCMsg_k_EMsgGCRewardDiretidePrizes EDOTAGCMsg = 7176 - EDOTAGCMsg_k_EMsgGCDiretidePrizesRewardedResponse EDOTAGCMsg = 7177 - EDOTAGCMsg_k_EMsgGCHalloweenHighScoreRequest EDOTAGCMsg = 7178 - EDOTAGCMsg_k_EMsgGCHalloweenHighScoreResponse EDOTAGCMsg = 7179 - EDOTAGCMsg_k_EMsgGCGenerateDiretidePrizeListResponse EDOTAGCMsg = 7180 - EDOTAGCMsg_k_EMsgGCStorePromoPagesRequest EDOTAGCMsg = 7182 - EDOTAGCMsg_k_EMsgGCStorePromoPagesResponse EDOTAGCMsg = 7183 - EDOTAGCMsg_k_EMsgGCSpawnLootGreevil EDOTAGCMsg = 7184 - EDOTAGCMsg_k_EMsgGCDismissLootGreevil EDOTAGCMsg = 7185 - EDOTAGCMsg_k_EMsgGCToGCMatchCompleted EDOTAGCMsg = 7186 - EDOTAGCMsg_k_EMsgGCDismissLootGreevilResponse EDOTAGCMsg = 7187 - EDOTAGCMsg_k_EMsgGCBalancedShuffleLobby EDOTAGCMsg = 7188 - EDOTAGCMsg_k_EMsgGCToGCCheckLeaguePermission EDOTAGCMsg = 7189 - EDOTAGCMsg_k_EMsgGCToGCCheckLeaguePermissionResponse EDOTAGCMsg = 7190 - EDOTAGCMsg_k_EMsgGCLeagueScheduleRequest EDOTAGCMsg = 7191 - EDOTAGCMsg_k_EMsgGCLeagueScheduleResponse EDOTAGCMsg = 7192 - EDOTAGCMsg_k_EMsgGCLeagueScheduleEdit EDOTAGCMsg = 7193 - EDOTAGCMsg_k_EMsgGCLeagueScheduleEditResponse EDOTAGCMsg = 7194 - EDOTAGCMsg_k_EMsgGCLeaguesInMonthRequest EDOTAGCMsg = 7195 - EDOTAGCMsg_k_EMsgGCLeaguesInMonthResponse EDOTAGCMsg = 7196 - EDOTAGCMsg_k_EMsgGCMatchmakingStatsRequest EDOTAGCMsg = 7197 - EDOTAGCMsg_k_EMsgGCMatchmakingStatsResponse EDOTAGCMsg = 7198 - EDOTAGCMsg_k_EMsgGCBotGameCreate EDOTAGCMsg = 7199 - EDOTAGCMsg_k_EMsgGCSetMatchHistoryAccess EDOTAGCMsg = 7200 - EDOTAGCMsg_k_EMsgGCSetMatchHistoryAccessResponse EDOTAGCMsg = 7201 - EDOTAGCMsg_k_EMsgUpgradeLeagueItem EDOTAGCMsg = 7203 - EDOTAGCMsg_k_EMsgUpgradeLeagueItemResponse EDOTAGCMsg = 7204 - EDOTAGCMsg_k_EMsgGCTeamMemberProfileRequest EDOTAGCMsg = 7205 - EDOTAGCMsg_k_EMsgGCWatchDownloadedReplay EDOTAGCMsg = 7206 - EDOTAGCMsg_k_EMsgGCSetMapLocationState EDOTAGCMsg = 7207 - EDOTAGCMsg_k_EMsgGCSetMapLocationStateResponse EDOTAGCMsg = 7208 - EDOTAGCMsg_k_EMsgGCResetMapLocations EDOTAGCMsg = 7209 - EDOTAGCMsg_k_EMsgGCResetMapLocationsResponse EDOTAGCMsg = 7210 - EDOTAGCMsg_k_EMsgGCTeamOnProfile EDOTAGCMsg = 7211 - EDOTAGCMsg_k_EMsgGCSetFeaturedItems EDOTAGCMsg = 7212 - EDOTAGCMsg_k_EMsgGCFeaturedItems EDOTAGCMsg = 7215 - EDOTAGCMsg_k_EMsgRefreshPartnerAccountLink EDOTAGCMsg = 7216 - EDOTAGCMsg_k_EMsgClientsRejoinChatChannels EDOTAGCMsg = 7217 - EDOTAGCMsg_k_EMsgGCToGCGetUserChatInfo EDOTAGCMsg = 7218 - EDOTAGCMsg_k_EMsgGCToGCGetUserChatInfoResponse EDOTAGCMsg = 7219 - EDOTAGCMsg_k_EMsgGCToGCLeaveAllChatChannels EDOTAGCMsg = 7220 - EDOTAGCMsg_k_EMsgGCToGCUpdateAccountChatBan EDOTAGCMsg = 7221 - EDOTAGCMsg_k_EMsgGCGuildCreateRequest EDOTAGCMsg = 7222 - EDOTAGCMsg_k_EMsgGCGuildCreateResponse EDOTAGCMsg = 7223 - EDOTAGCMsg_k_EMsgGCGuildSetAccountRoleRequest EDOTAGCMsg = 7224 - EDOTAGCMsg_k_EMsgGCGuildSetAccountRoleResponse EDOTAGCMsg = 7225 - EDOTAGCMsg_k_EMsgGCRequestGuildData EDOTAGCMsg = 7226 - EDOTAGCMsg_k_EMsgGCGuildData EDOTAGCMsg = 7227 - EDOTAGCMsg_k_EMsgGCGuildInviteAccountRequest EDOTAGCMsg = 7228 - EDOTAGCMsg_k_EMsgGCGuildInviteAccountResponse EDOTAGCMsg = 7229 - EDOTAGCMsg_k_EMsgGCGuildCancelInviteRequest EDOTAGCMsg = 7230 - EDOTAGCMsg_k_EMsgGCGuildCancelInviteResponse EDOTAGCMsg = 7231 - EDOTAGCMsg_k_EMsgGCGuildUpdateDetailsRequest EDOTAGCMsg = 7232 - EDOTAGCMsg_k_EMsgGCGuildUpdateDetailsResponse EDOTAGCMsg = 7233 - EDOTAGCMsg_k_EMsgGCToGCCanInviteUser EDOTAGCMsg = 7234 - EDOTAGCMsg_k_EMsgGCToGCCanInviteUserResponse EDOTAGCMsg = 7235 - EDOTAGCMsg_k_EMsgGCToGCGetUserRank EDOTAGCMsg = 7236 - EDOTAGCMsg_k_EMsgGCToGCGetUserRankResponse EDOTAGCMsg = 7237 - EDOTAGCMsg_k_EMsgGCToGCUpdateTeamStats EDOTAGCMsg = 7240 - EDOTAGCMsg_k_EMsgGCToGCGetTeamRank EDOTAGCMsg = 7241 - EDOTAGCMsg_k_EMsgGCToGCGetTeamRankResponse EDOTAGCMsg = 7242 - EDOTAGCMsg_k_EMsgGCTeamIDByNameRequest EDOTAGCMsg = 7245 - EDOTAGCMsg_k_EMsgGCTeamIDByNameResponse EDOTAGCMsg = 7246 - EDOTAGCMsg_k_EMsgGCEditTeam EDOTAGCMsg = 7247 - EDOTAGCMsg_k_EMsgGCPassportDataRequest EDOTAGCMsg = 7248 - EDOTAGCMsg_k_EMsgGCPassportDataResponse EDOTAGCMsg = 7249 - EDOTAGCMsg_k_EMsgGCNotInGuildData EDOTAGCMsg = 7251 - EDOTAGCMsg_k_EMsgGCGuildInviteData EDOTAGCMsg = 7254 - EDOTAGCMsg_k_EMsgGCToGCGetLeagueAdmin EDOTAGCMsg = 7255 - EDOTAGCMsg_k_EMsgGCToGCGetLeagueAdminResponse EDOTAGCMsg = 7256 - EDOTAGCMsg_k_EMsgGCRequestLeaguePrizePool EDOTAGCMsg = 7258 - EDOTAGCMsg_k_EMsgGCRequestLeaguePrizePoolResponse EDOTAGCMsg = 7259 - EDOTAGCMsg_k_EMsgGCToGCUpdateOpenGuildPartyRequest EDOTAGCMsg = 7261 - EDOTAGCMsg_k_EMsgGCToGCUpdateOpenGuildPartyResponse EDOTAGCMsg = 7262 - EDOTAGCMsg_k_EMsgGCToGCDestroyOpenGuildPartyRequest EDOTAGCMsg = 7263 - EDOTAGCMsg_k_EMsgGCToGCDestroyOpenGuildPartyResponse EDOTAGCMsg = 7264 - EDOTAGCMsg_k_EMsgGCGuildUpdateMessage EDOTAGCMsg = 7265 - EDOTAGCMsg_k_EMsgGCPartySetOpenGuildRequest EDOTAGCMsg = 7266 - EDOTAGCMsg_k_EMsgGCPartySetOpenGuildResponse EDOTAGCMsg = 7267 - EDOTAGCMsg_k_EMsgGCGuildOpenPartyRefresh EDOTAGCMsg = 7268 - EDOTAGCMsg_k_EMsgGCJoinOpenGuildPartyRequest EDOTAGCMsg = 7269 - EDOTAGCMsg_k_EMsgGCJoinOpenGuildPartyResponse EDOTAGCMsg = 7270 - EDOTAGCMsg_k_EMsgGCLeaveChatChannel EDOTAGCMsg = 7272 - EDOTAGCMsg_k_EMsgGCChatMessage EDOTAGCMsg = 7273 - EDOTAGCMsg_k_EMsgGCGetHeroStandings EDOTAGCMsg = 7274 - EDOTAGCMsg_k_EMsgGCGetHeroStandingsResponse EDOTAGCMsg = 7275 - EDOTAGCMsg_k_EMsgGCGuildEditLogoRequest EDOTAGCMsg = 7279 - EDOTAGCMsg_k_EMsgGCGuildEditLogoResponse EDOTAGCMsg = 7280 - EDOTAGCMsg_k_EMsgGCGuildmatePracticeLobbyListRequest EDOTAGCMsg = 7281 - EDOTAGCMsg_k_EMsgGCGuildmatePracticeLobbyListResponse EDOTAGCMsg = 7282 - EDOTAGCMsg_k_EMsgGCItemEditorReservationsRequest EDOTAGCMsg = 7283 - EDOTAGCMsg_k_EMsgGCItemEditorReservationsResponse EDOTAGCMsg = 7284 - EDOTAGCMsg_k_EMsgGCItemEditorReserveItemDef EDOTAGCMsg = 7285 - EDOTAGCMsg_k_EMsgGCItemEditorReserveItemDefResponse EDOTAGCMsg = 7286 - EDOTAGCMsg_k_EMsgGCItemEditorReleaseReservation EDOTAGCMsg = 7287 - EDOTAGCMsg_k_EMsgGCItemEditorReleaseReservationResponse EDOTAGCMsg = 7288 - EDOTAGCMsg_k_EMsgGCRewardTutorialPrizes EDOTAGCMsg = 7289 - EDOTAGCMsg_k_EMsgGCLastHitChallengeHighScorePost EDOTAGCMsg = 7290 - EDOTAGCMsg_k_EMsgGCLastHitChallengeHighScoreRequest EDOTAGCMsg = 7291 - EDOTAGCMsg_k_EMsgGCLastHitChallengeHighScoreResponse EDOTAGCMsg = 7292 - EDOTAGCMsg_k_EMsgGCCreateFantasyLeagueRequest EDOTAGCMsg = 7293 - EDOTAGCMsg_k_EMsgGCCreateFantasyLeagueResponse EDOTAGCMsg = 7294 - EDOTAGCMsg_k_EMsgGCFantasyLeagueInfoRequest EDOTAGCMsg = 7297 - EDOTAGCMsg_k_EMsgGCFantasyLeagueInfoResponse EDOTAGCMsg = 7298 - EDOTAGCMsg_k_EMsgGCFantasyLeagueInfo EDOTAGCMsg = 7299 - EDOTAGCMsg_k_EMsgGCCreateFantasyTeamRequest EDOTAGCMsg = 7300 - EDOTAGCMsg_k_EMsgGCCreateFantasyTeamResponse EDOTAGCMsg = 7301 - EDOTAGCMsg_k_EMsgGCEditFantasyTeamRequest EDOTAGCMsg = 7302 - EDOTAGCMsg_k_EMsgGCEditFantasyTeamResponse EDOTAGCMsg = 7303 - EDOTAGCMsg_k_EMsgGCFantasyTeamInfoRequestByFantasyLeagueID EDOTAGCMsg = 7304 - EDOTAGCMsg_k_EMsgGCFantasyTeamInfoRequestByOwnerAccountID EDOTAGCMsg = 7305 - EDOTAGCMsg_k_EMsgGCFantasyTeamInfoResponse EDOTAGCMsg = 7306 - EDOTAGCMsg_k_EMsgGCFantasyTeamInfo EDOTAGCMsg = 7307 - EDOTAGCMsg_k_EMsgGCFantasyLivePlayerStats EDOTAGCMsg = 7308 - EDOTAGCMsg_k_EMsgGCFantasyFinalPlayerStats EDOTAGCMsg = 7309 - EDOTAGCMsg_k_EMsgGCFantasyMatch EDOTAGCMsg = 7310 - EDOTAGCMsg_k_EMsgGCToGCReloadVersions EDOTAGCMsg = 7311 - EDOTAGCMsg_k_EMsgGCFantasyTeamScoreRequest EDOTAGCMsg = 7312 - EDOTAGCMsg_k_EMsgGCFantasyTeamScoreResponse EDOTAGCMsg = 7313 - EDOTAGCMsg_k_EMsgGCFantasyTeamStandingsRequest EDOTAGCMsg = 7314 - EDOTAGCMsg_k_EMsgGCFantasyTeamStandingsResponse EDOTAGCMsg = 7315 - EDOTAGCMsg_k_EMsgGCFantasyPlayerScoreRequest EDOTAGCMsg = 7316 - EDOTAGCMsg_k_EMsgGCFantasyPlayerScoreResponse EDOTAGCMsg = 7317 - EDOTAGCMsg_k_EMsgGCFantasyPlayerStandingsRequest EDOTAGCMsg = 7318 - EDOTAGCMsg_k_EMsgGCFantasyPlayerStandingsResponse EDOTAGCMsg = 7319 - EDOTAGCMsg_k_EMsgGCFlipLobbyTeams EDOTAGCMsg = 7320 - EDOTAGCMsg_k_EMsgGCCustomGameCreate EDOTAGCMsg = 7321 - EDOTAGCMsg_k_EMsgGCFantasyPlayerInfoRequest EDOTAGCMsg = 7322 - EDOTAGCMsg_k_EMsgGCFantasyPlayerInfoResponse EDOTAGCMsg = 7323 - EDOTAGCMsg_k_EMsgGCToGCProcessPlayerReportForTarget EDOTAGCMsg = 7324 - EDOTAGCMsg_k_EMsgGCToGCProcessReportSuccess EDOTAGCMsg = 7325 - EDOTAGCMsg_k_EMsgGCNotifyAccountFlagsChange EDOTAGCMsg = 7326 - EDOTAGCMsg_k_EMsgGCSetProfilePrivacy EDOTAGCMsg = 7327 - EDOTAGCMsg_k_EMsgGCSetProfilePrivacyResponse EDOTAGCMsg = 7328 - EDOTAGCMsg_k_EMsgGCSteamProfileRequest EDOTAGCMsg = 7329 - EDOTAGCMsg_k_EMsgGCSteamProfileRequestResponse EDOTAGCMsg = 7330 - EDOTAGCMsg_k_EMsgGCFantasyLeagueCreateInfoRequest EDOTAGCMsg = 7331 - EDOTAGCMsg_k_EMsgGCFantasyLeagueCreateInfoResponse EDOTAGCMsg = 7332 - EDOTAGCMsg_k_EMsgGCFantasyLeagueInviteInfoRequest EDOTAGCMsg = 7333 - EDOTAGCMsg_k_EMsgGCFantasyLeagueInviteInfoResponse EDOTAGCMsg = 7334 - EDOTAGCMsg_k_EMsgGCClientIgnoredUser EDOTAGCMsg = 7335 - EDOTAGCMsg_k_EMsgGCFantasyLeagueCreateRequest EDOTAGCMsg = 7336 - EDOTAGCMsg_k_EMsgGCFantasyLeagueCreateResponse EDOTAGCMsg = 7337 - EDOTAGCMsg_k_EMsgGCFantasyTeamCreateRequest EDOTAGCMsg = 7338 - EDOTAGCMsg_k_EMsgGCFantasyTeamCreateResponse EDOTAGCMsg = 7339 - EDOTAGCMsg_k_EMsgGCFantasyLeagueFriendJoinListRequest EDOTAGCMsg = 7340 - EDOTAGCMsg_k_EMsgGCFantasyLeagueFriendJoinListResponse EDOTAGCMsg = 7341 - EDOTAGCMsg_k_EMsgGCClientSuspended EDOTAGCMsg = 7342 - EDOTAGCMsg_k_EMsgGCPartyMemberSetCoach EDOTAGCMsg = 7343 - EDOTAGCMsg_k_EMsgGCFantasyLeagueEditInvitesRequest EDOTAGCMsg = 7344 - EDOTAGCMsg_k_EMsgGCFantasyLeagueEditInvitesResponse EDOTAGCMsg = 7345 - EDOTAGCMsg_k_EMsgGCPracticeLobbySetCoach EDOTAGCMsg = 7346 - EDOTAGCMsg_k_EMsgGCFantasyLeagueEditInfoRequest EDOTAGCMsg = 7347 - EDOTAGCMsg_k_EMsgGCFantasyLeagueEditInfoResponse EDOTAGCMsg = 7348 - EDOTAGCMsg_k_EMsgGCFantasyLeagueDraftStatusRequest EDOTAGCMsg = 7349 - EDOTAGCMsg_k_EMsgGCFantasyLeagueDraftStatus EDOTAGCMsg = 7350 - EDOTAGCMsg_k_EMsgGCFantasyLeagueDraftPlayerRequest EDOTAGCMsg = 7351 - EDOTAGCMsg_k_EMsgGCFantasyLeagueDraftPlayerResponse EDOTAGCMsg = 7352 - EDOTAGCMsg_k_EMsgGCFantasyLeagueMatchupsRequest EDOTAGCMsg = 7353 - EDOTAGCMsg_k_EMsgGCFantasyLeagueMatchupsResponse EDOTAGCMsg = 7354 - EDOTAGCMsg_k_EMsgGCFantasyTeamRosterSwapRequest EDOTAGCMsg = 7355 - EDOTAGCMsg_k_EMsgGCFantasyTeamRosterSwapResponse EDOTAGCMsg = 7356 - EDOTAGCMsg_k_EMsgGCFantasyTeamRosterRequest EDOTAGCMsg = 7357 - EDOTAGCMsg_k_EMsgGCFantasyTeamRosterResponse EDOTAGCMsg = 7358 - EDOTAGCMsg_k_EMsgGCNexonPartnerUpdate EDOTAGCMsg = 7359 - EDOTAGCMsg_k_EMsgGCToGCProcessPCBangRewardPoints EDOTAGCMsg = 7360 - EDOTAGCMsg_k_EMsgGCFantasyTeamRosterAddDropRequest EDOTAGCMsg = 7361 - EDOTAGCMsg_k_EMsgGCFantasyTeamRosterAddDropResponse EDOTAGCMsg = 7362 - EDOTAGCMsg_k_EMsgPresentedClientTerminateDlg EDOTAGCMsg = 7363 - EDOTAGCMsg_k_EMsgGCFantasyPlayerHisoricalStatsRequest EDOTAGCMsg = 7364 - EDOTAGCMsg_k_EMsgGCFantasyPlayerHisoricalStatsResponse EDOTAGCMsg = 7365 - EDOTAGCMsg_k_EMsgGCPCBangTimedRewardMessage EDOTAGCMsg = 7366 - EDOTAGCMsg_k_EMsgGCLobbyUpdateBroadcastChannelInfo EDOTAGCMsg = 7367 - EDOTAGCMsg_k_EMsgGCFantasyTeamTradesRequest EDOTAGCMsg = 7368 - EDOTAGCMsg_k_EMsgGCFantasyTeamTradesResponse EDOTAGCMsg = 7369 - EDOTAGCMsg_k_EMsgGCFantasyTeamTradeCancelRequest EDOTAGCMsg = 7370 - EDOTAGCMsg_k_EMsgGCFantasyTeamTradeCancelResponse EDOTAGCMsg = 7371 - EDOTAGCMsg_k_EMsgGCToGCGrantTournamentItem EDOTAGCMsg = 7372 - EDOTAGCMsg_k_EMsgGCProcessFantasyScheduledEvent EDOTAGCMsg = 7373 - EDOTAGCMsg_k_EMsgGCToGCGrantPCBangRewardItem EDOTAGCMsg = 7374 - EDOTAGCMsg_k_EMsgGCToGCUpgradeTwitchViewerItems EDOTAGCMsg = 7375 - EDOTAGCMsg_k_EMsgGCToGCGetLiveMatchAffiliates EDOTAGCMsg = 7376 - EDOTAGCMsg_k_EMsgGCToGCGetLiveMatchAffiliatesResponse EDOTAGCMsg = 7377 - EDOTAGCMsg_k_EMsgGCToGCUpdatePlayerPennantCounts EDOTAGCMsg = 7378 - EDOTAGCMsg_k_EMsgGCToGCGetPlayerPennantCounts EDOTAGCMsg = 7379 - EDOTAGCMsg_k_EMsgGCToGCGetPlayerPennantCountsResponse EDOTAGCMsg = 7380 - EDOTAGCMsg_k_EMsgGCGameMatchSignOutPermissionRequest EDOTAGCMsg = 7381 - EDOTAGCMsg_k_EMsgGCGameMatchSignOutPermissionResponse EDOTAGCMsg = 7382 - EDOTAGCMsg_k_EMsgDOTAChatChannelMemberUpdate EDOTAGCMsg = 7383 - EDOTAGCMsg_k_EMsgDOTAAwardEventPoints EDOTAGCMsg = 7384 - EDOTAGCMsg_k_EMsgDOTARedeemEventPrize EDOTAGCMsg = 7385 - EDOTAGCMsg_k_EMsgDOTARedeemEventPrizeResponse EDOTAGCMsg = 7386 - EDOTAGCMsg_k_EMsgDOTAGetEventPoints EDOTAGCMsg = 7387 - EDOTAGCMsg_k_EMsgDOTAGetEventPointsResponse EDOTAGCMsg = 7388 - EDOTAGCMsg_k_EMsgGCToGCSignoutAwardEventPoints EDOTAGCMsg = 7390 - EDOTAGCMsg_k_EMsgDOTASendFriendRecruits EDOTAGCMsg = 7393 - EDOTAGCMsg_k_EMsgDOTAFriendRecruitsRequest EDOTAGCMsg = 7394 - EDOTAGCMsg_k_EMsgDOTAFriendRecruitsResponse EDOTAGCMsg = 7395 - EDOTAGCMsg_k_EMsgDOTAFriendRecruitInviteAcceptDecline EDOTAGCMsg = 7396 - EDOTAGCMsg_k_EMsgGCPartyLeaderWatchGamePrompt EDOTAGCMsg = 7397 - EDOTAGCMsg_k_EMsgDOTAFrostivusTimeElapsed EDOTAGCMsg = 7398 - EDOTAGCMsg_k_EMsgGCToGCGrantEarnedLicense EDOTAGCMsg = 7399 - EDOTAGCMsg_k_EMsgDOTALiveLeagueGameUpdate EDOTAGCMsg = 7402 - EDOTAGCMsg_k_EMsgDOTAChatGetUserList EDOTAGCMsg = 7403 - EDOTAGCMsg_k_EMsgDOTAChatGetUserListResponse EDOTAGCMsg = 7404 - EDOTAGCMsg_k_EMsgGCCompendiumSetSelection EDOTAGCMsg = 7405 - EDOTAGCMsg_k_EMsgGCCompendiumDataRequest EDOTAGCMsg = 7406 - EDOTAGCMsg_k_EMsgGCCompendiumDataResponse EDOTAGCMsg = 7407 - EDOTAGCMsg_k_EMsgDOTAGetPlayerMatchHistory EDOTAGCMsg = 7408 - EDOTAGCMsg_k_EMsgDOTAGetPlayerMatchHistoryResponse EDOTAGCMsg = 7409 - EDOTAGCMsg_k_EMsgGCToGCMatchmakingAddParty EDOTAGCMsg = 7410 - EDOTAGCMsg_k_EMsgGCToGCMatchmakingRemoveParty EDOTAGCMsg = 7411 - EDOTAGCMsg_k_EMsgGCToGCMatchmakingRemoveAllParties EDOTAGCMsg = 7412 - EDOTAGCMsg_k_EMsgGCToGCMatchmakingMatchFound EDOTAGCMsg = 7413 - EDOTAGCMsg_k_EMsgGCToGCUpdateMatchManagementStats EDOTAGCMsg = 7414 - EDOTAGCMsg_k_EMsgGCToGCUpdateMatchmakingStats EDOTAGCMsg = 7415 - EDOTAGCMsg_k_EMsgGCToServerPingRequest EDOTAGCMsg = 7416 - EDOTAGCMsg_k_EMsgGCToServerPingResponse EDOTAGCMsg = 7417 - EDOTAGCMsg_k_EMsgGCToServerConsoleCommand EDOTAGCMsg = 7418 - EDOTAGCMsg_k_EMsgGCToGCUpdateLiveLeagueGameInfo EDOTAGCMsg = 7420 - EDOTAGCMsg_k_EMsgGCMakeOffering EDOTAGCMsg = 7423 - EDOTAGCMsg_k_EMsgGCRequestOfferings EDOTAGCMsg = 7424 - EDOTAGCMsg_k_EMsgGCRequestOfferingsResponse EDOTAGCMsg = 7425 - EDOTAGCMsg_k_EMsgGCToGCProcessMatchLeaver EDOTAGCMsg = 7426 - EDOTAGCMsg_k_EMsgGCNotificationsRequest EDOTAGCMsg = 7427 - EDOTAGCMsg_k_EMsgGCNotificationsResponse EDOTAGCMsg = 7428 - EDOTAGCMsg_k_EMsgGCToGCModifyNotification EDOTAGCMsg = 7429 - EDOTAGCMsg_k_EMsgGCToGCSetNewNotifications EDOTAGCMsg = 7430 - EDOTAGCMsg_k_EMsgGCToGCSetIsLeagueAdmin EDOTAGCMsg = 7431 - EDOTAGCMsg_k_EMsgGCLeagueAdminState EDOTAGCMsg = 7432 - EDOTAGCMsg_k_EMsgGCToGCSendLeagueAdminState EDOTAGCMsg = 7433 - EDOTAGCMsg_k_EMsgGCLeagueAdminList EDOTAGCMsg = 7434 - EDOTAGCMsg_k_EMsgGCNotificationsMarkReadRequest EDOTAGCMsg = 7435 - EDOTAGCMsg_k_EMsgGCFantasyMessageAdd EDOTAGCMsg = 7436 - EDOTAGCMsg_k_EMsgGCFantasyMessagesRequest EDOTAGCMsg = 7437 - EDOTAGCMsg_k_EMsgGCFantasyMessagesResponse EDOTAGCMsg = 7438 - EDOTAGCMsg_k_EMsgGCFantasyScheduledMatchesRequest EDOTAGCMsg = 7439 - EDOTAGCMsg_k_EMsgGCFantasyScheduledMatchesResponse EDOTAGCMsg = 7440 - EDOTAGCMsg_k_EMsgGCToGCGrantLeagueAccess EDOTAGCMsg = 7441 - EDOTAGCMsg_k_EMsgGCEventGameCreate EDOTAGCMsg = 7443 - EDOTAGCMsg_k_EMsgGCPerfectWorldUserLookupRequest EDOTAGCMsg = 7444 - EDOTAGCMsg_k_EMsgGCPerfectWorldUserLookupResponse EDOTAGCMsg = 7445 - EDOTAGCMsg_k_EMsgGCToGCIncrementRecruitmentSDO EDOTAGCMsg = 7446 - EDOTAGCMsg_k_EMsgGCToGCIncrementRecruitmentLevel EDOTAGCMsg = 7447 - EDOTAGCMsg_k_EMsgGCFantasyRemoveOwner EDOTAGCMsg = 7448 - EDOTAGCMsg_k_EMsgGCFantasyRemoveOwnerResponse EDOTAGCMsg = 7449 - EDOTAGCMsg_k_EMsgGCRequestBatchPlayerResources EDOTAGCMsg = 7450 - EDOTAGCMsg_k_EMsgGCRequestBatchPlayerResourcesResponse EDOTAGCMsg = 7451 - EDOTAGCMsg_k_EMsgGCToGCSendUpdateLeagues EDOTAGCMsg = 7452 - EDOTAGCMsg_k_EMsgGCCompendiumSetSelectionResponse EDOTAGCMsg = 7453 - EDOTAGCMsg_k_EMsgGCPlayerInfoRequest EDOTAGCMsg = 7454 - EDOTAGCMsg_k_EMsgGCPlayerInfo EDOTAGCMsg = 7455 - EDOTAGCMsg_k_EMsgGCPlayerInfoSubmit EDOTAGCMsg = 7456 - EDOTAGCMsg_k_EMsgGCPlayerInfoSubmitResponse EDOTAGCMsg = 7457 - EDOTAGCMsg_k_EMsgGCToGCGetAccountLevel EDOTAGCMsg = 7458 - EDOTAGCMsg_k_EMsgGCToGCGetAccountLevelResponse EDOTAGCMsg = 7459 - EDOTAGCMsg_k_EMsgGCToGCGetAccountPartner EDOTAGCMsg = 7460 - EDOTAGCMsg_k_EMsgGCToGCGetAccountPartnerResponse EDOTAGCMsg = 7461 - EDOTAGCMsg_k_EMsgGCToGCGetAccountProfile EDOTAGCMsg = 7462 - EDOTAGCMsg_k_EMsgGCToGCGetAccountProfileResponse EDOTAGCMsg = 7463 - EDOTAGCMsg_k_EMsgDOTAGetWeekendTourneySchedule EDOTAGCMsg = 7464 - EDOTAGCMsg_k_EMsgDOTAWeekendTourneySchedule EDOTAGCMsg = 7465 - EDOTAGCMsg_k_EMsgGCJoinableCustomGameModesRequest EDOTAGCMsg = 7466 - EDOTAGCMsg_k_EMsgGCJoinableCustomGameModesResponse EDOTAGCMsg = 7467 - EDOTAGCMsg_k_EMsgGCJoinableCustomLobbiesRequest EDOTAGCMsg = 7468 - EDOTAGCMsg_k_EMsgGCJoinableCustomLobbiesResponse EDOTAGCMsg = 7469 - EDOTAGCMsg_k_EMsgGCQuickJoinCustomLobby EDOTAGCMsg = 7470 - EDOTAGCMsg_k_EMsgGCQuickJoinCustomLobbyResponse EDOTAGCMsg = 7471 - EDOTAGCMsg_k_EMsgGCToGCGrantEventPointAction EDOTAGCMsg = 7472 - EDOTAGCMsg_k_EMsgServerGetEventPoints EDOTAGCMsg = 7473 - EDOTAGCMsg_k_EMsgServerGetEventPointsResponse EDOTAGCMsg = 7474 - EDOTAGCMsg_k_EMsgServerGrantSurveyPermission EDOTAGCMsg = 7475 - EDOTAGCMsg_k_EMsgServerGrantSurveyPermissionResponse EDOTAGCMsg = 7476 - EDOTAGCMsg_k_EMsgClientProvideSurveyResult EDOTAGCMsg = 7477 - EDOTAGCMsg_k_EMsgGCToGCSetCompendiumSelection EDOTAGCMsg = 7478 - EDOTAGCMsg_k_EMsgGCToGCUpdateTI4HeroQuest EDOTAGCMsg = 7480 - EDOTAGCMsg_k_EMsgGCCompendiumDataChanged EDOTAGCMsg = 7481 - EDOTAGCMsg_k_EMsgDOTAFantasyLeagueFindRequest EDOTAGCMsg = 7482 - EDOTAGCMsg_k_EMsgDOTAFantasyLeagueFindResponse EDOTAGCMsg = 7483 - EDOTAGCMsg_k_EMsgGCHasItemQuery EDOTAGCMsg = 7484 - EDOTAGCMsg_k_EMsgGCHasItemResponse EDOTAGCMsg = 7485 - EDOTAGCMsg_k_EMsgGCConsumeFantasyTicket EDOTAGCMsg = 7486 - EDOTAGCMsg_k_EMsgGCConsumeFantasyTicketFailure EDOTAGCMsg = 7487 - EDOTAGCMsg_k_EMsgGCToGCGrantEventPointActionMsg EDOTAGCMsg = 7488 - EDOTAGCMsg_k_EMsgClientToGCTrackDialogResult EDOTAGCMsg = 7489 - EDOTAGCMsg_k_EMsgGCFantasyLeaveLeagueRequest EDOTAGCMsg = 7490 - EDOTAGCMsg_k_EMsgGCFantasyLeaveLeagueResponse EDOTAGCMsg = 7491 - EDOTAGCMsg_k_EMsgGCToGCGetCompendiumSelections EDOTAGCMsg = 7492 - EDOTAGCMsg_k_EMsgGCToGCGetCompendiumSelectionsResponse EDOTAGCMsg = 7493 - EDOTAGCMsg_k_EMsgServerToGCMatchConnectionStats EDOTAGCMsg = 7494 - EDOTAGCMsg_k_EMsgGCToClientTournamentItemDrop EDOTAGCMsg = 7495 - EDOTAGCMsg_k_EMsgSQLDelayedGrantLeagueDrop EDOTAGCMsg = 7496 - EDOTAGCMsg_k_EMsgServerGCUpdateSpectatorCount EDOTAGCMsg = 7497 - EDOTAGCMsg_k_EMsgDOTAStartDailyHeroChallengeRequest EDOTAGCMsg = 7498 - EDOTAGCMsg_k_EMsgGCFantasyPlayerScoreDetailsRequest EDOTAGCMsg = 7499 - EDOTAGCMsg_k_EMsgGCFantasyPlayerScoreDetailsResponse EDOTAGCMsg = 7500 - EDOTAGCMsg_k_EMsgGCToGCEmoticonUnlock EDOTAGCMsg = 7501 - EDOTAGCMsg_k_EMsgSignOutDraftInfo EDOTAGCMsg = 7502 - EDOTAGCMsg_k_EMsgClientToGCEmoticonDataRequest EDOTAGCMsg = 7503 - EDOTAGCMsg_k_EMsgGCToClientEmoticonData EDOTAGCMsg = 7504 - EDOTAGCMsg_k_EMsgGCPracticeLobbyToggleBroadcastChannelCameramanStatus EDOTAGCMsg = 7505 - EDOTAGCMsg_k_EMsgGCToGCCreateWeekendTourneyRequest EDOTAGCMsg = 7506 - EDOTAGCMsg_k_EMsgGCToGCCreateWeekendTourneyResponse EDOTAGCMsg = 7507 - EDOTAGCMsg_k_EMsgGCToGCCreateGenericTeamsRequest EDOTAGCMsg = 7510 - EDOTAGCMsg_k_EMsgGCToGCCreateGenericTeamsResponse EDOTAGCMsg = 7511 - EDOTAGCMsg_k_EMsgSQLLaunchOneWeekendTourney EDOTAGCMsg = 7512 - EDOTAGCMsg_k_EMsgClientToGCSetAdditionalEquips EDOTAGCMsg = 7513 - EDOTAGCMsg_k_EMsgClientToGCGetAdditionalEquips EDOTAGCMsg = 7514 - EDOTAGCMsg_k_EMsgClientToGCGetAdditionalEquipsResponse EDOTAGCMsg = 7515 - EDOTAGCMsg_k_EMsgServerToGCGetAdditionalEquips EDOTAGCMsg = 7516 - EDOTAGCMsg_k_EMsgServerToGCGetAdditionalEquipsResponse EDOTAGCMsg = 7517 - EDOTAGCMsg_k_EMsgDOTARedeemItem EDOTAGCMsg = 7518 - EDOTAGCMsg_k_EMsgDOTARedeemItemResponse EDOTAGCMsg = 7519 - EDOTAGCMsg_k_EMsgSQLGCToGCGrantAllHeroProgress EDOTAGCMsg = 7520 - EDOTAGCMsg_k_EMsgClientToGCGetAllHeroProgress EDOTAGCMsg = 7521 - EDOTAGCMsg_k_EMsgClientToGCGetAllHeroProgressResponse EDOTAGCMsg = 7522 - EDOTAGCMsg_k_EMsgGCToGCGetServerForClient EDOTAGCMsg = 7523 - EDOTAGCMsg_k_EMsgGCToGCGetServerForClientResponse EDOTAGCMsg = 7524 - EDOTAGCMsg_k_EMsgSQLProcessTournamentGameOutcome EDOTAGCMsg = 7525 - EDOTAGCMsg_k_EMsgSQLGrantTrophyToAccount EDOTAGCMsg = 7526 - EDOTAGCMsg_k_EMsgClientToGCGetTrophyList EDOTAGCMsg = 7527 - EDOTAGCMsg_k_EMsgClientToGCGetTrophyListResponse EDOTAGCMsg = 7528 - EDOTAGCMsg_k_EMsgGCToClientTrophyAwarded EDOTAGCMsg = 7529 - EDOTAGCMsg_k_EMsgGCGameBotMatchSignOut EDOTAGCMsg = 7530 - EDOTAGCMsg_k_EMsgGCGameBotMatchSignOutPermissionRequest EDOTAGCMsg = 7531 - EDOTAGCMsg_k_EMsgSignOutBotInfo EDOTAGCMsg = 7532 - EDOTAGCMsg_k_EMsgGCToGCUpdateProfileCards EDOTAGCMsg = 7533 - EDOTAGCMsg_k_EMsgClientToGCGetProfileCard EDOTAGCMsg = 7534 - EDOTAGCMsg_k_EMsgClientToGCGetProfileCardResponse EDOTAGCMsg = 7535 - EDOTAGCMsg_k_EMsgServerToGCGetProfileCard EDOTAGCMsg = 7536 - EDOTAGCMsg_k_EMsgServerToGCGetProfileCardResponse EDOTAGCMsg = 7537 - EDOTAGCMsg_k_EMsgClientToGCSetProfileCardSlots EDOTAGCMsg = 7538 - EDOTAGCMsg_k_EMsgGCToClientProfileCardUpdated EDOTAGCMsg = 7539 - EDOTAGCMsg_k_EMsgServerToGCVictoryPredictions EDOTAGCMsg = 7540 - EDOTAGCMsg_k_EMsgClientToGCMarkNotificationListRead EDOTAGCMsg = 7542 - EDOTAGCMsg_k_EMsgGCToClientNewNotificationAdded EDOTAGCMsg = 7543 - EDOTAGCMsg_k_EMsgServerToGCSuspiciousActivity EDOTAGCMsg = 7544 - EDOTAGCMsg_k_EMsgSignOutCommunicationSummary EDOTAGCMsg = 7545 - EDOTAGCMsg_k_EMsgServerToGCRequestStatus_Response EDOTAGCMsg = 7546 - EDOTAGCMsg_k_EMsgClientToGCCreateHeroStatue EDOTAGCMsg = 7547 - EDOTAGCMsg_k_EMsgGCToClientHeroStatueCreateResult EDOTAGCMsg = 7548 - EDOTAGCMsg_k_EMsgGCGCToLANServerRelayConnect EDOTAGCMsg = 7549 - EDOTAGCMsg_k_EMsgSignOutAssassinMiniGameInfo EDOTAGCMsg = 7550 - EDOTAGCMsg_k_EMsgServerToGCGetIngameEventData EDOTAGCMsg = 7551 - EDOTAGCMsg_k_EMsgGCToGCUpdateIngameEventDataBroadcast EDOTAGCMsg = 7552 - EDOTAGCMsg_k_EMsgGCToServerIngameEventData_OraclePA EDOTAGCMsg = 7553 - EDOTAGCMsg_k_EMsgServerToGCReportKillSummaries EDOTAGCMsg = 7554 - EDOTAGCMsg_k_EMsgGCToGCReportKillSummaries EDOTAGCMsg = 7555 - EDOTAGCMsg_k_EMsgGCToGCUpdateAssassinMinigame EDOTAGCMsg = 7556 - EDOTAGCMsg_k_EMsgGCToGCFantasySetMatchLeague EDOTAGCMsg = 7557 - EDOTAGCMsg_k_EMsgClientToGCRecordCompendiumStats EDOTAGCMsg = 7558 - EDOTAGCMsg_k_EMsgGCItemEditorRequestLeagueInfo EDOTAGCMsg = 7559 - EDOTAGCMsg_k_EMsgGCItemEditorLeagueInfoResponse EDOTAGCMsg = 7560 - EDOTAGCMsg_k_EMsgGCToGCUpdatePlayerPredictions EDOTAGCMsg = 7561 - EDOTAGCMsg_k_EMsgGCToServerPredictionResult EDOTAGCMsg = 7562 - EDOTAGCMsg_k_EMsgServerToGCSignoutAwardAdditionalDrops EDOTAGCMsg = 7563 - EDOTAGCMsg_k_EMsgGCToGCSignoutAwardAdditionalDrops EDOTAGCMsg = 7564 - EDOTAGCMsg_k_EMsgGCToClientEventStatusChanged EDOTAGCMsg = 7565 - EDOTAGCMsg_k_EMsgGCHasItemDefsQuery EDOTAGCMsg = 7566 - EDOTAGCMsg_k_EMsgGCHasItemDefsResponse EDOTAGCMsg = 7567 - EDOTAGCMsg_k_EMsgGCToGCReplayMonitorValidateReplay EDOTAGCMsg = 7569 - EDOTAGCMsg_k_EMsgLobbyEventPoints EDOTAGCMsg = 7572 - EDOTAGCMsg_k_EMsgGCToGCGetCustomGameTickets EDOTAGCMsg = 7573 - EDOTAGCMsg_k_EMsgGCToGCGetCustomGameTicketsResponse EDOTAGCMsg = 7574 - EDOTAGCMsg_k_EMsgGCToClientNewBloomTimingUpdated EDOTAGCMsg = 7575 - EDOTAGCMsg_k_EMsgGCToGCCustomGamePlayed EDOTAGCMsg = 7576 - EDOTAGCMsg_k_EMsgGCToGCGrantEventPointsToUser EDOTAGCMsg = 7577 - EDOTAGCMsg_k_EMsgGCToGCSetEventMMPanicFlushTime EDOTAGCMsg = 7578 - EDOTAGCMsg_k_EMsgGameserverCrashReport EDOTAGCMsg = 7579 - EDOTAGCMsg_k_EMsgGameserverCrashReportResponse EDOTAGCMsg = 7580 - EDOTAGCMsg_k_EMsgGCToClientSteamDatagramTicket EDOTAGCMsg = 7581 - EDOTAGCMsg_k_EMsgGCToGCGrantEventOwnership EDOTAGCMsg = 7582 - EDOTAGCMsg_k_EMsgGCToGCSendAccountsEventPoints EDOTAGCMsg = 7583 - EDOTAGCMsg_k_EMsgClientToGCRerollPlayerChallenge EDOTAGCMsg = 7584 - EDOTAGCMsg_k_EMsgServerToGCRerollPlayerChallenge EDOTAGCMsg = 7585 - EDOTAGCMsg_k_EMsgGCRerollPlayerChallengeResponse EDOTAGCMsg = 7586 - EDOTAGCMsg_k_EMsgSignOutUpdatePlayerChallenge EDOTAGCMsg = 7587 - EDOTAGCMsg_k_EMsgClientToGCSetPartyLeader EDOTAGCMsg = 7588 - EDOTAGCMsg_k_EMsgClientToGCCancelPartyInvites EDOTAGCMsg = 7589 - EDOTAGCMsg_k_EMsgGCToGCMasterReloadAccount EDOTAGCMsg = 7590 - EDOTAGCMsg_k_EMsgSQLGrantLeagueMatchToTicketHolders EDOTAGCMsg = 7592 - EDOTAGCMsg_k_EMsgClientToGCSetAdditionalEquipsResponse EDOTAGCMsg = 7593 - EDOTAGCMsg_k_EMsgGCToGCEmoticonUnlockNoRollback EDOTAGCMsg = 7594 - EDOTAGCMsg_k_EMsgGCToGCGetCompendiumFanfare EDOTAGCMsg = 7595 - EDOTAGCMsg_k_EMsgServerToGCHoldEventPoints EDOTAGCMsg = 7596 - EDOTAGCMsg_k_EMsgSignOutReleaseEventPointHolds EDOTAGCMsg = 7597 - EDOTAGCMsg_k_EMsgGCToGCChatNewUserSession EDOTAGCMsg = 7598 - EDOTAGCMsg_k_EMsgClientToGCGetLeagueSeries EDOTAGCMsg = 7599 - EDOTAGCMsg_k_EMsgClientToGCGetLeagueSeriesResponse EDOTAGCMsg = 7600 - EDOTAGCMsg_k_EMsgSQLGCToGCSignoutUpdateLeagueSchedule EDOTAGCMsg = 7601 - EDOTAGCMsg_k_EMsgGCToServerUpdateBroadcastCheers EDOTAGCMsg = 7602 - EDOTAGCMsg_k_EMsgClientToGCApplyGemCombiner EDOTAGCMsg = 7603 - EDOTAGCMsg_k_EMsgClientToGCCreateStaticRecipe EDOTAGCMsg = 7604 - EDOTAGCMsg_k_EMsgClientToGCCreateStaticRecipeResponse EDOTAGCMsg = 7605 - EDOTAGCMsg_k_EMsgClientToGCGetAllHeroOrder EDOTAGCMsg = 7606 - EDOTAGCMsg_k_EMsgClientToGCGetAllHeroOrderResponse EDOTAGCMsg = 7607 - EDOTAGCMsg_k_EMsgSQLGCToGCGrantBadgePoints EDOTAGCMsg = 7608 - EDOTAGCMsg_k_EMsgGCToGCGetAccountMatchStatus EDOTAGCMsg = 7609 - EDOTAGCMsg_k_EMsgGCToGCGetAccountMatchStatusResponse EDOTAGCMsg = 7610 - EDOTAGCMsg_k_EMsgGCDev_GrantWarKill EDOTAGCMsg = 8001 - EDOTAGCMsg_k_EMsgClientToGCCreateTeamShowcase EDOTAGCMsg = 8002 - EDOTAGCMsg_k_EMsgGCToClientTeamShowcaseCreateResult EDOTAGCMsg = 8003 - EDOTAGCMsg_k_EMsgServerToGCLockCharmTrading EDOTAGCMsg = 8004 - EDOTAGCMsg_k_EMsgDOTACNY2015EventPointUsage EDOTAGCMsg = 8005 - EDOTAGCMsg_k_EMsgClientToGCPlayerStatsRequest EDOTAGCMsg = 8006 - EDOTAGCMsg_k_EMsgGCToClientPlayerStatsResponse EDOTAGCMsg = 8007 - EDOTAGCMsg_k_EMsgGCClearPracticeLobbyTeam EDOTAGCMsg = 8008 - EDOTAGCMsg_k_EMsgClientToGCFindTopSourceTVGames EDOTAGCMsg = 8009 - EDOTAGCMsg_k_EMsgGCToClientFindTopSourceTVGamesResponse EDOTAGCMsg = 8010 - EDOTAGCMsg_k_EMsgGCLobbyList EDOTAGCMsg = 8011 - EDOTAGCMsg_k_EMsgGCLobbyListResponse EDOTAGCMsg = 8012 - EDOTAGCMsg_k_EMsgGCPlayerStatsMatchSignOut EDOTAGCMsg = 8013 - EDOTAGCMsg_k_EMsgClientToGCCustomGamePlayerCountRequest EDOTAGCMsg = 8014 - EDOTAGCMsg_k_EMsgGCToClientCustomGamePlayerCountResponse EDOTAGCMsg = 8015 - EDOTAGCMsg_k_EMsgClientToGCSocialFeedPostCommentRequest EDOTAGCMsg = 8016 - EDOTAGCMsg_k_EMsgGCToClientSocialFeedPostCommentResponse EDOTAGCMsg = 8017 - EDOTAGCMsg_k_EMsgClientToGCCustomGamesFriendsPlayedRequest EDOTAGCMsg = 8018 - EDOTAGCMsg_k_EMsgGCToClientCustomGamesFriendsPlayedResponse EDOTAGCMsg = 8019 - EDOTAGCMsg_k_EMsgClientToGCFriendsPlayedCustomGameRequest EDOTAGCMsg = 8020 - EDOTAGCMsg_k_EMsgGCToClientFriendsPlayedCustomGameResponse EDOTAGCMsg = 8021 - EDOTAGCMsg_k_EMsgClientToGCFeaturedHeroesRequest EDOTAGCMsg = 8022 - EDOTAGCMsg_k_EMsgGCToClientFeaturedHeroesResponse EDOTAGCMsg = 8023 - EDOTAGCMsg_k_EMsgGCTopCustomGamesList EDOTAGCMsg = 8024 - EDOTAGCMsg_k_EMsgClientToGCSocialMatchPostCommentRequest EDOTAGCMsg = 8025 - EDOTAGCMsg_k_EMsgGCToClientSocialMatchPostCommentResponse EDOTAGCMsg = 8026 - EDOTAGCMsg_k_EMsgClientToGCSocialMatchDetailsRequest EDOTAGCMsg = 8027 - EDOTAGCMsg_k_EMsgGCToClientSocialMatchDetailsResponse EDOTAGCMsg = 8028 - EDOTAGCMsg_k_EMsgClientToGCSetPartyOpen EDOTAGCMsg = 8029 - EDOTAGCMsg_k_EMsgClientToGCMergePartyInvite EDOTAGCMsg = 8030 - EDOTAGCMsg_k_EMsgGCToClientMergeGroupInviteReply EDOTAGCMsg = 8031 - EDOTAGCMsg_k_EMsgClientToGCMergePartyResponse EDOTAGCMsg = 8032 - EDOTAGCMsg_k_EMsgGCToClientMergePartyResponseReply EDOTAGCMsg = 8033 - EDOTAGCMsg_k_EMsgClientToGCGetProfileCardStats EDOTAGCMsg = 8034 - EDOTAGCMsg_k_EMsgClientToGCGetProfileCardStatsResponse EDOTAGCMsg = 8035 - EDOTAGCMsg_k_EMsgClientToGCTopLeagueMatchesRequest EDOTAGCMsg = 8036 - EDOTAGCMsg_k_EMsgClientToGCTopFriendMatchesRequest EDOTAGCMsg = 8037 - EDOTAGCMsg_k_EMsgGCToClientProfileCardStatsUpdated EDOTAGCMsg = 8040 - EDOTAGCMsg_k_EMsgServerToGCRealtimeStats EDOTAGCMsg = 8041 - EDOTAGCMsg_k_EMsgGCToServerRealtimeStatsStartStop EDOTAGCMsg = 8042 - EDOTAGCMsg_k_EMsgGCToGCGetServersForClients EDOTAGCMsg = 8045 - EDOTAGCMsg_k_EMsgGCToGCGetServersForClientsResponse EDOTAGCMsg = 8046 - EDOTAGCMsg_k_EMsgGCPracticeLobbyKickFromTeam EDOTAGCMsg = 8047 - EDOTAGCMsg_k_EMsgDOTAChatGetMemberCount EDOTAGCMsg = 8048 - EDOTAGCMsg_k_EMsgDOTAChatGetMemberCountResponse EDOTAGCMsg = 8049 - EDOTAGCMsg_k_EMsgClientToGCSocialFeedPostMessageRequest EDOTAGCMsg = 8050 - EDOTAGCMsg_k_EMsgGCToClientSocialFeedPostMessageResponse EDOTAGCMsg = 8051 - EDOTAGCMsg_k_EMsgCustomGameListenServerStartedLoading EDOTAGCMsg = 8052 - EDOTAGCMsg_k_EMsgCustomGameClientFinishedLoading EDOTAGCMsg = 8053 - EDOTAGCMsg_k_EMsgGCPracticeLobbyCloseBroadcastChannel EDOTAGCMsg = 8054 - EDOTAGCMsg_k_EMsgGCStartFindingMatchResponse EDOTAGCMsg = 8055 - EDOTAGCMsg_k_EMsgSQLGCToGCUpdateHeroMMR EDOTAGCMsg = 8056 - EDOTAGCMsg_k_EMsgSQLGCToGCGrantAccountFlag EDOTAGCMsg = 8057 - EDOTAGCMsg_k_EMsgGCToGCGetAccountFlags EDOTAGCMsg = 8058 - EDOTAGCMsg_k_EMsgGCToGCGetAccountFlagsResponse EDOTAGCMsg = 8059 - EDOTAGCMsg_k_EMsgSignOutWagerStats EDOTAGCMsg = 8060 - EDOTAGCMsg_k_EMsgGCToClientTopLeagueMatchesResponse EDOTAGCMsg = 8061 - EDOTAGCMsg_k_EMsgGCToClientTopFriendMatchesResponse EDOTAGCMsg = 8062 - EDOTAGCMsg_k_EMsgClientToGCMatchesMinimalRequest EDOTAGCMsg = 8063 - EDOTAGCMsg_k_EMsgClientToGCMatchesMinimalResponse EDOTAGCMsg = 8064 - EDOTAGCMsg_k_EMsgGCToGCGetProfileBadgePoints EDOTAGCMsg = 8065 - EDOTAGCMsg_k_EMsgGCToGCGetProfileBadgePointsResponse EDOTAGCMsg = 8066 - EDOTAGCMsg_k_EMsgGCToClientChatRegionsEnabled EDOTAGCMsg = 8067 - EDOTAGCMsg_k_EMsgClientToGCPingData EDOTAGCMsg = 8068 - EDOTAGCMsg_k_EMsgServerToGCMatchDetailsRequest EDOTAGCMsg = 8069 - EDOTAGCMsg_k_EMsgGCToServerMatchDetailsResponse EDOTAGCMsg = 8070 - EDOTAGCMsg_k_EMsgGCToGCEnsureAccountInParty EDOTAGCMsg = 8071 - EDOTAGCMsg_k_EMsgGCToGCEnsureAccountInPartyResponse EDOTAGCMsg = 8072 - EDOTAGCMsg_k_EMsgClientToGCGetProfileTickets EDOTAGCMsg = 8073 - EDOTAGCMsg_k_EMsgClientToGCGetProfileTicketsResponse EDOTAGCMsg = 8074 - EDOTAGCMsg_k_EMsgGCToClientMatchGroupsVersion EDOTAGCMsg = 8075 - EDOTAGCMsg_k_EMsgClientToGCH264Unsupported EDOTAGCMsg = 8076 - EDOTAGCMsg_k_EMsgClientToGCRequestH264Support EDOTAGCMsg = 8077 - EDOTAGCMsg_k_EMsgClientToGCGetQuestProgress EDOTAGCMsg = 8078 - EDOTAGCMsg_k_EMsgClientToGCGetQuestProgressResponse EDOTAGCMsg = 8079 - EDOTAGCMsg_k_EMsgSignOutXPCoins EDOTAGCMsg = 8080 - EDOTAGCMsg_k_EMsgGCToClientMatchSignedOut EDOTAGCMsg = 8081 - EDOTAGCMsg_k_EMsgGCGetHeroStatsHistory EDOTAGCMsg = 8082 - EDOTAGCMsg_k_EMsgGCGetHeroStatsHistoryResponse EDOTAGCMsg = 8083 - EDOTAGCMsg_k_EMsgClientToGCPrivateChatInvite EDOTAGCMsg = 8084 - EDOTAGCMsg_k_EMsgClientToGCPrivateChatKick EDOTAGCMsg = 8088 - EDOTAGCMsg_k_EMsgClientToGCPrivateChatPromote EDOTAGCMsg = 8089 - EDOTAGCMsg_k_EMsgClientToGCPrivateChatDemote EDOTAGCMsg = 8090 - EDOTAGCMsg_k_EMsgGCToClientPrivateChatResponse EDOTAGCMsg = 8091 - EDOTAGCMsg_k_EMsgClientToGCPrivateChatInfoRequest EDOTAGCMsg = 8092 - EDOTAGCMsg_k_EMsgGCToClientPrivateChatInfoResponse EDOTAGCMsg = 8093 - EDOTAGCMsg_k_EMsgClientToGCLatestBehaviorReportRequest EDOTAGCMsg = 8095 - EDOTAGCMsg_k_EMsgClientToGCLatestBehaviorReport EDOTAGCMsg = 8096 -) - -var EDOTAGCMsg_name = map[int32]string{ - 7000: "k_EMsgGCDOTABase", - 7001: "k_EMsgGCGeneralResponse", - 7004: "k_EMsgGCGameMatchSignOut", - 7005: "k_EMsgGCGameMatchSignOutResponse", - 7009: "k_EMsgGCJoinChatChannel", - 7010: "k_EMsgGCJoinChatChannelResponse", - 7013: "k_EMsgGCOtherJoinedChannel", - 7014: "k_EMsgGCOtherLeftChannel", - 7017: "k_EMsgGCMatchHistoryList", - 7026: "k_EMsgServerToGCRequestStatus", - 7027: "k_EMsgGCGetRecentMatches", - 7028: "k_EMsgGCRecentMatchesResponse", - 7033: "k_EMsgGCStartFindingMatch", - 7034: "k_EMsgGCConnectedPlayers", - 7035: "k_EMsgGCAbandonCurrentGame", - 7036: "k_EMsgGCStopFindingMatch", - 7038: "k_EMsgGCPracticeLobbyCreate", - 7040: "k_EMsgGCPracticeLobbyLeave", - 7041: "k_EMsgGCPracticeLobbyLaunch", - 7042: "k_EMsgGCPracticeLobbyList", - 7043: "k_EMsgGCPracticeLobbyListResponse", - 7044: "k_EMsgGCPracticeLobbyJoin", - 7046: "k_EMsgGCPracticeLobbySetDetails", - 7047: "k_EMsgGCPracticeLobbySetTeamSlot", - 7049: "k_EMsgGCInitialQuestionnaireResponse", - 7051: "k_EMsgGCTournamentRequest", - 7052: "k_EMsgGCTournamentResponse", - 7055: "k_EMsgGCPracticeLobbyResponse", - 7056: "k_EMsgGCBroadcastNotification", - 7057: "k_EMsgGCLiveScoreboardUpdate", - 7060: "k_EMsgGCRequestChatChannelList", - 7061: "k_EMsgGCRequestChatChannelListResponse", - 7064: "k_EMsgGCRequestMatches", - 7065: "k_EMsgGCRequestMatchesResponse", - 7068: "k_EMsgGCRequestPlayerResources", - 7069: "k_EMsgGCRequestPlayerResourcesResponse", - 7070: "k_EMsgGCReadyUp", - 7071: "k_EMsgGCKickedFromMatchmakingQueue", - 7072: "k_EMsgGCLeaverDetected", - 7073: "k_EMsgGCSpectateFriendGame", - 7074: "k_EMsgGCSpectateFriendGameResponse", - 7075: "k_EMsgGCPlayerReports", - 7076: "k_EMsgGCReportsRemainingRequest", - 7077: "k_EMsgGCReportsRemainingResponse", - 7078: "k_EMsgGCSubmitPlayerReport", - 7079: "k_EMsgGCSubmitPlayerReportResponse", - 7080: "k_EMsgGCGameChatLog", - 7081: "k_EMsgGCPracticeLobbyKick", - 7082: "k_EMsgGCReportCountsRequest", - 7083: "k_EMsgGCReportCountsResponse", - 7084: "k_EMsgGCRequestSaveGames", - 7085: "k_EMsgGCRequestSaveGamesServer", - 7086: "k_EMsgGCRequestSaveGamesResponse", - 7087: "k_EMsgGCLeaverDetectedResponse", - 7088: "k_EMsgGCPlayerFailedToConnect", - 7089: "k_EMsgGCGCToRelayConnect", - 7090: "k_EMsgGCGCToRelayConnectresponse", - 7091: "k_EMsgGCWatchGame", - 7092: "k_EMsgGCWatchGameResponse", - 7093: "k_EMsgGCBanStatusRequest", - 7094: "k_EMsgGCBanStatusResponse", - 7095: "k_EMsgGCMatchDetailsRequest", - 7096: "k_EMsgGCMatchDetailsResponse", - 7097: "k_EMsgGCCancelWatchGame", - 7098: "k_EMsgGCProfileRequest", - 7099: "k_EMsgGCProfileResponse", - 7102: "k_EMsgGCPopup", - 7104: "k_EMsgGCDOTAClearNotifySuccessfulReport", - 7111: "k_EMsgGCFriendPracticeLobbyListRequest", - 7112: "k_EMsgGCFriendPracticeLobbyListResponse", - 7113: "k_EMsgGCPracticeLobbyJoinResponse", - 7114: "k_EMsgClientEconNotification_Job", - 7115: "k_EMsgGCCreateTeam", - 7116: "k_EMsgGCCreateTeamResponse", - 7117: "k_EMsgGCDisbandTeam", - 7118: "k_EMsgGCDisbandTeamResponse", - 7119: "k_EMsgGCRequestTeamData", - 7120: "k_EMsgGCRequestTeamDataResponse", - 7121: "k_EMsgGCTeamData", - 7122: "k_EMsgGCTeamInvite_InviterToGC", - 7123: "k_EMsgGCTeamInvite_GCImmediateResponseToInviter", - 7124: "k_EMsgGCTeamInvite_GCRequestToInvitee", - 7125: "k_EMsgGCTeamInvite_InviteeResponseToGC", - 7126: "k_EMsgGCTeamInvite_GCResponseToInviter", - 7127: "k_EMsgGCTeamInvite_GCResponseToInvitee", - 7128: "k_EMsgGCKickTeamMember", - 7129: "k_EMsgGCKickTeamMemberResponse", - 7130: "k_EMsgGCLeaveTeam", - 7131: "k_EMsgGCLeaveTeamResponse", - 7132: "k_EMsgGCSuggestTeamMatchmaking", - 7133: "k_EMsgGCPlayerHeroesFavoritesAdd", - 7134: "k_EMsgGCPlayerHeroesFavoritesRemove", - 7139: "k_EMsgGCEditTeamLogo", - 7140: "k_EMsgGCEditTeamLogoResponse", - 7141: "k_EMsgGCSetShowcaseHero", - 7142: "k_EMsgGCApplyTeamToPracticeLobby", - 7143: "k_EMsgGCRequestInternatinalTicketEmail", - 7144: "k_EMsgGCTransferTeamAdmin", - 7145: "k_EMsgGCClearTournamentGame", - 7147: "k_EMsgRequestLeagueInfo", - 7148: "k_EMsgResponseLeagueInfo", - 7149: "k_EMsgGCPracticeLobbyJoinBroadcastChannel", - 7150: "k_EMsgGC_TournamentItemEvent", - 7151: "k_EMsgGC_TournamentItemEventResponse", - 7152: "k_EMsgCastMatchVote", - 7153: "k_EMsgCastMatchVoteResponse", - 7154: "k_EMsgRetrieveMatchVote", - 7155: "k_EMsgRetrieveMatchVoteResponse", - 7156: "k_EMsgTeamFanfare", - 7157: "k_EMsgResponseTeamFanfare", - 7158: "k_EMsgGC_GameServerUploadSaveGame", - 7159: "k_EMsgGC_GameServerSaveGameResult", - 7160: "k_EMsgGC_GameServerGetLoadGame", - 7161: "k_EMsgGC_GameServerGetLoadGameResult", - 7164: "k_EMsgGCTeamProfileRequest", - 7165: "k_EMsgGCTeamProfileResponse", - 7166: "k_EMsgGCEditTeamDetails", - 7167: "k_EMsgGCEditTeamDetailsResponse", - 7168: "k_EMsgGCProTeamListRequest", - 7169: "k_EMsgGCProTeamListResponse", - 7170: "k_EMsgGCReadyUpStatus", - 7171: "k_EMsgGCHallOfFame", - 7172: "k_EMsgGCHallOfFameRequest", - 7173: "k_EMsgGCHallOfFameResponse", - 7174: "k_EMsgGCGenerateDiretidePrizeList", - 7176: "k_EMsgGCRewardDiretidePrizes", - 7177: "k_EMsgGCDiretidePrizesRewardedResponse", - 7178: "k_EMsgGCHalloweenHighScoreRequest", - 7179: "k_EMsgGCHalloweenHighScoreResponse", - 7180: "k_EMsgGCGenerateDiretidePrizeListResponse", - 7182: "k_EMsgGCStorePromoPagesRequest", - 7183: "k_EMsgGCStorePromoPagesResponse", - 7184: "k_EMsgGCSpawnLootGreevil", - 7185: "k_EMsgGCDismissLootGreevil", - 7186: "k_EMsgGCToGCMatchCompleted", - 7187: "k_EMsgGCDismissLootGreevilResponse", - 7188: "k_EMsgGCBalancedShuffleLobby", - 7189: "k_EMsgGCToGCCheckLeaguePermission", - 7190: "k_EMsgGCToGCCheckLeaguePermissionResponse", - 7191: "k_EMsgGCLeagueScheduleRequest", - 7192: "k_EMsgGCLeagueScheduleResponse", - 7193: "k_EMsgGCLeagueScheduleEdit", - 7194: "k_EMsgGCLeagueScheduleEditResponse", - 7195: "k_EMsgGCLeaguesInMonthRequest", - 7196: "k_EMsgGCLeaguesInMonthResponse", - 7197: "k_EMsgGCMatchmakingStatsRequest", - 7198: "k_EMsgGCMatchmakingStatsResponse", - 7199: "k_EMsgGCBotGameCreate", - 7200: "k_EMsgGCSetMatchHistoryAccess", - 7201: "k_EMsgGCSetMatchHistoryAccessResponse", - 7203: "k_EMsgUpgradeLeagueItem", - 7204: "k_EMsgUpgradeLeagueItemResponse", - 7205: "k_EMsgGCTeamMemberProfileRequest", - 7206: "k_EMsgGCWatchDownloadedReplay", - 7207: "k_EMsgGCSetMapLocationState", - 7208: "k_EMsgGCSetMapLocationStateResponse", - 7209: "k_EMsgGCResetMapLocations", - 7210: "k_EMsgGCResetMapLocationsResponse", - 7211: "k_EMsgGCTeamOnProfile", - 7212: "k_EMsgGCSetFeaturedItems", - 7215: "k_EMsgGCFeaturedItems", - 7216: "k_EMsgRefreshPartnerAccountLink", - 7217: "k_EMsgClientsRejoinChatChannels", - 7218: "k_EMsgGCToGCGetUserChatInfo", - 7219: "k_EMsgGCToGCGetUserChatInfoResponse", - 7220: "k_EMsgGCToGCLeaveAllChatChannels", - 7221: "k_EMsgGCToGCUpdateAccountChatBan", - 7222: "k_EMsgGCGuildCreateRequest", - 7223: "k_EMsgGCGuildCreateResponse", - 7224: "k_EMsgGCGuildSetAccountRoleRequest", - 7225: "k_EMsgGCGuildSetAccountRoleResponse", - 7226: "k_EMsgGCRequestGuildData", - 7227: "k_EMsgGCGuildData", - 7228: "k_EMsgGCGuildInviteAccountRequest", - 7229: "k_EMsgGCGuildInviteAccountResponse", - 7230: "k_EMsgGCGuildCancelInviteRequest", - 7231: "k_EMsgGCGuildCancelInviteResponse", - 7232: "k_EMsgGCGuildUpdateDetailsRequest", - 7233: "k_EMsgGCGuildUpdateDetailsResponse", - 7234: "k_EMsgGCToGCCanInviteUser", - 7235: "k_EMsgGCToGCCanInviteUserResponse", - 7236: "k_EMsgGCToGCGetUserRank", - 7237: "k_EMsgGCToGCGetUserRankResponse", - 7240: "k_EMsgGCToGCUpdateTeamStats", - 7241: "k_EMsgGCToGCGetTeamRank", - 7242: "k_EMsgGCToGCGetTeamRankResponse", - 7245: "k_EMsgGCTeamIDByNameRequest", - 7246: "k_EMsgGCTeamIDByNameResponse", - 7247: "k_EMsgGCEditTeam", - 7248: "k_EMsgGCPassportDataRequest", - 7249: "k_EMsgGCPassportDataResponse", - 7251: "k_EMsgGCNotInGuildData", - 7254: "k_EMsgGCGuildInviteData", - 7255: "k_EMsgGCToGCGetLeagueAdmin", - 7256: "k_EMsgGCToGCGetLeagueAdminResponse", - 7258: "k_EMsgGCRequestLeaguePrizePool", - 7259: "k_EMsgGCRequestLeaguePrizePoolResponse", - 7261: "k_EMsgGCToGCUpdateOpenGuildPartyRequest", - 7262: "k_EMsgGCToGCUpdateOpenGuildPartyResponse", - 7263: "k_EMsgGCToGCDestroyOpenGuildPartyRequest", - 7264: "k_EMsgGCToGCDestroyOpenGuildPartyResponse", - 7265: "k_EMsgGCGuildUpdateMessage", - 7266: "k_EMsgGCPartySetOpenGuildRequest", - 7267: "k_EMsgGCPartySetOpenGuildResponse", - 7268: "k_EMsgGCGuildOpenPartyRefresh", - 7269: "k_EMsgGCJoinOpenGuildPartyRequest", - 7270: "k_EMsgGCJoinOpenGuildPartyResponse", - 7272: "k_EMsgGCLeaveChatChannel", - 7273: "k_EMsgGCChatMessage", - 7274: "k_EMsgGCGetHeroStandings", - 7275: "k_EMsgGCGetHeroStandingsResponse", - 7279: "k_EMsgGCGuildEditLogoRequest", - 7280: "k_EMsgGCGuildEditLogoResponse", - 7281: "k_EMsgGCGuildmatePracticeLobbyListRequest", - 7282: "k_EMsgGCGuildmatePracticeLobbyListResponse", - 7283: "k_EMsgGCItemEditorReservationsRequest", - 7284: "k_EMsgGCItemEditorReservationsResponse", - 7285: "k_EMsgGCItemEditorReserveItemDef", - 7286: "k_EMsgGCItemEditorReserveItemDefResponse", - 7287: "k_EMsgGCItemEditorReleaseReservation", - 7288: "k_EMsgGCItemEditorReleaseReservationResponse", - 7289: "k_EMsgGCRewardTutorialPrizes", - 7290: "k_EMsgGCLastHitChallengeHighScorePost", - 7291: "k_EMsgGCLastHitChallengeHighScoreRequest", - 7292: "k_EMsgGCLastHitChallengeHighScoreResponse", - 7293: "k_EMsgGCCreateFantasyLeagueRequest", - 7294: "k_EMsgGCCreateFantasyLeagueResponse", - 7297: "k_EMsgGCFantasyLeagueInfoRequest", - 7298: "k_EMsgGCFantasyLeagueInfoResponse", - 7299: "k_EMsgGCFantasyLeagueInfo", - 7300: "k_EMsgGCCreateFantasyTeamRequest", - 7301: "k_EMsgGCCreateFantasyTeamResponse", - 7302: "k_EMsgGCEditFantasyTeamRequest", - 7303: "k_EMsgGCEditFantasyTeamResponse", - 7304: "k_EMsgGCFantasyTeamInfoRequestByFantasyLeagueID", - 7305: "k_EMsgGCFantasyTeamInfoRequestByOwnerAccountID", - 7306: "k_EMsgGCFantasyTeamInfoResponse", - 7307: "k_EMsgGCFantasyTeamInfo", - 7308: "k_EMsgGCFantasyLivePlayerStats", - 7309: "k_EMsgGCFantasyFinalPlayerStats", - 7310: "k_EMsgGCFantasyMatch", - 7311: "k_EMsgGCToGCReloadVersions", - 7312: "k_EMsgGCFantasyTeamScoreRequest", - 7313: "k_EMsgGCFantasyTeamScoreResponse", - 7314: "k_EMsgGCFantasyTeamStandingsRequest", - 7315: "k_EMsgGCFantasyTeamStandingsResponse", - 7316: "k_EMsgGCFantasyPlayerScoreRequest", - 7317: "k_EMsgGCFantasyPlayerScoreResponse", - 7318: "k_EMsgGCFantasyPlayerStandingsRequest", - 7319: "k_EMsgGCFantasyPlayerStandingsResponse", - 7320: "k_EMsgGCFlipLobbyTeams", - 7321: "k_EMsgGCCustomGameCreate", - 7322: "k_EMsgGCFantasyPlayerInfoRequest", - 7323: "k_EMsgGCFantasyPlayerInfoResponse", - 7324: "k_EMsgGCToGCProcessPlayerReportForTarget", - 7325: "k_EMsgGCToGCProcessReportSuccess", - 7326: "k_EMsgGCNotifyAccountFlagsChange", - 7327: "k_EMsgGCSetProfilePrivacy", - 7328: "k_EMsgGCSetProfilePrivacyResponse", - 7329: "k_EMsgGCSteamProfileRequest", - 7330: "k_EMsgGCSteamProfileRequestResponse", - 7331: "k_EMsgGCFantasyLeagueCreateInfoRequest", - 7332: "k_EMsgGCFantasyLeagueCreateInfoResponse", - 7333: "k_EMsgGCFantasyLeagueInviteInfoRequest", - 7334: "k_EMsgGCFantasyLeagueInviteInfoResponse", - 7335: "k_EMsgGCClientIgnoredUser", - 7336: "k_EMsgGCFantasyLeagueCreateRequest", - 7337: "k_EMsgGCFantasyLeagueCreateResponse", - 7338: "k_EMsgGCFantasyTeamCreateRequest", - 7339: "k_EMsgGCFantasyTeamCreateResponse", - 7340: "k_EMsgGCFantasyLeagueFriendJoinListRequest", - 7341: "k_EMsgGCFantasyLeagueFriendJoinListResponse", - 7342: "k_EMsgGCClientSuspended", - 7343: "k_EMsgGCPartyMemberSetCoach", - 7344: "k_EMsgGCFantasyLeagueEditInvitesRequest", - 7345: "k_EMsgGCFantasyLeagueEditInvitesResponse", - 7346: "k_EMsgGCPracticeLobbySetCoach", - 7347: "k_EMsgGCFantasyLeagueEditInfoRequest", - 7348: "k_EMsgGCFantasyLeagueEditInfoResponse", - 7349: "k_EMsgGCFantasyLeagueDraftStatusRequest", - 7350: "k_EMsgGCFantasyLeagueDraftStatus", - 7351: "k_EMsgGCFantasyLeagueDraftPlayerRequest", - 7352: "k_EMsgGCFantasyLeagueDraftPlayerResponse", - 7353: "k_EMsgGCFantasyLeagueMatchupsRequest", - 7354: "k_EMsgGCFantasyLeagueMatchupsResponse", - 7355: "k_EMsgGCFantasyTeamRosterSwapRequest", - 7356: "k_EMsgGCFantasyTeamRosterSwapResponse", - 7357: "k_EMsgGCFantasyTeamRosterRequest", - 7358: "k_EMsgGCFantasyTeamRosterResponse", - 7359: "k_EMsgGCNexonPartnerUpdate", - 7360: "k_EMsgGCToGCProcessPCBangRewardPoints", - 7361: "k_EMsgGCFantasyTeamRosterAddDropRequest", - 7362: "k_EMsgGCFantasyTeamRosterAddDropResponse", - 7363: "k_EMsgPresentedClientTerminateDlg", - 7364: "k_EMsgGCFantasyPlayerHisoricalStatsRequest", - 7365: "k_EMsgGCFantasyPlayerHisoricalStatsResponse", - 7366: "k_EMsgGCPCBangTimedRewardMessage", - 7367: "k_EMsgGCLobbyUpdateBroadcastChannelInfo", - 7368: "k_EMsgGCFantasyTeamTradesRequest", - 7369: "k_EMsgGCFantasyTeamTradesResponse", - 7370: "k_EMsgGCFantasyTeamTradeCancelRequest", - 7371: "k_EMsgGCFantasyTeamTradeCancelResponse", - 7372: "k_EMsgGCToGCGrantTournamentItem", - 7373: "k_EMsgGCProcessFantasyScheduledEvent", - 7374: "k_EMsgGCToGCGrantPCBangRewardItem", - 7375: "k_EMsgGCToGCUpgradeTwitchViewerItems", - 7376: "k_EMsgGCToGCGetLiveMatchAffiliates", - 7377: "k_EMsgGCToGCGetLiveMatchAffiliatesResponse", - 7378: "k_EMsgGCToGCUpdatePlayerPennantCounts", - 7379: "k_EMsgGCToGCGetPlayerPennantCounts", - 7380: "k_EMsgGCToGCGetPlayerPennantCountsResponse", - 7381: "k_EMsgGCGameMatchSignOutPermissionRequest", - 7382: "k_EMsgGCGameMatchSignOutPermissionResponse", - 7383: "k_EMsgDOTAChatChannelMemberUpdate", - 7384: "k_EMsgDOTAAwardEventPoints", - 7385: "k_EMsgDOTARedeemEventPrize", - 7386: "k_EMsgDOTARedeemEventPrizeResponse", - 7387: "k_EMsgDOTAGetEventPoints", - 7388: "k_EMsgDOTAGetEventPointsResponse", - 7390: "k_EMsgGCToGCSignoutAwardEventPoints", - 7393: "k_EMsgDOTASendFriendRecruits", - 7394: "k_EMsgDOTAFriendRecruitsRequest", - 7395: "k_EMsgDOTAFriendRecruitsResponse", - 7396: "k_EMsgDOTAFriendRecruitInviteAcceptDecline", - 7397: "k_EMsgGCPartyLeaderWatchGamePrompt", - 7398: "k_EMsgDOTAFrostivusTimeElapsed", - 7399: "k_EMsgGCToGCGrantEarnedLicense", - 7402: "k_EMsgDOTALiveLeagueGameUpdate", - 7403: "k_EMsgDOTAChatGetUserList", - 7404: "k_EMsgDOTAChatGetUserListResponse", - 7405: "k_EMsgGCCompendiumSetSelection", - 7406: "k_EMsgGCCompendiumDataRequest", - 7407: "k_EMsgGCCompendiumDataResponse", - 7408: "k_EMsgDOTAGetPlayerMatchHistory", - 7409: "k_EMsgDOTAGetPlayerMatchHistoryResponse", - 7410: "k_EMsgGCToGCMatchmakingAddParty", - 7411: "k_EMsgGCToGCMatchmakingRemoveParty", - 7412: "k_EMsgGCToGCMatchmakingRemoveAllParties", - 7413: "k_EMsgGCToGCMatchmakingMatchFound", - 7414: "k_EMsgGCToGCUpdateMatchManagementStats", - 7415: "k_EMsgGCToGCUpdateMatchmakingStats", - 7416: "k_EMsgGCToServerPingRequest", - 7417: "k_EMsgGCToServerPingResponse", - 7418: "k_EMsgGCToServerConsoleCommand", - 7420: "k_EMsgGCToGCUpdateLiveLeagueGameInfo", - 7423: "k_EMsgGCMakeOffering", - 7424: "k_EMsgGCRequestOfferings", - 7425: "k_EMsgGCRequestOfferingsResponse", - 7426: "k_EMsgGCToGCProcessMatchLeaver", - 7427: "k_EMsgGCNotificationsRequest", - 7428: "k_EMsgGCNotificationsResponse", - 7429: "k_EMsgGCToGCModifyNotification", - 7430: "k_EMsgGCToGCSetNewNotifications", - 7431: "k_EMsgGCToGCSetIsLeagueAdmin", - 7432: "k_EMsgGCLeagueAdminState", - 7433: "k_EMsgGCToGCSendLeagueAdminState", - 7434: "k_EMsgGCLeagueAdminList", - 7435: "k_EMsgGCNotificationsMarkReadRequest", - 7436: "k_EMsgGCFantasyMessageAdd", - 7437: "k_EMsgGCFantasyMessagesRequest", - 7438: "k_EMsgGCFantasyMessagesResponse", - 7439: "k_EMsgGCFantasyScheduledMatchesRequest", - 7440: "k_EMsgGCFantasyScheduledMatchesResponse", - 7441: "k_EMsgGCToGCGrantLeagueAccess", - 7443: "k_EMsgGCEventGameCreate", - 7444: "k_EMsgGCPerfectWorldUserLookupRequest", - 7445: "k_EMsgGCPerfectWorldUserLookupResponse", - 7446: "k_EMsgGCToGCIncrementRecruitmentSDO", - 7447: "k_EMsgGCToGCIncrementRecruitmentLevel", - 7448: "k_EMsgGCFantasyRemoveOwner", - 7449: "k_EMsgGCFantasyRemoveOwnerResponse", - 7450: "k_EMsgGCRequestBatchPlayerResources", - 7451: "k_EMsgGCRequestBatchPlayerResourcesResponse", - 7452: "k_EMsgGCToGCSendUpdateLeagues", - 7453: "k_EMsgGCCompendiumSetSelectionResponse", - 7454: "k_EMsgGCPlayerInfoRequest", - 7455: "k_EMsgGCPlayerInfo", - 7456: "k_EMsgGCPlayerInfoSubmit", - 7457: "k_EMsgGCPlayerInfoSubmitResponse", - 7458: "k_EMsgGCToGCGetAccountLevel", - 7459: "k_EMsgGCToGCGetAccountLevelResponse", - 7460: "k_EMsgGCToGCGetAccountPartner", - 7461: "k_EMsgGCToGCGetAccountPartnerResponse", - 7462: "k_EMsgGCToGCGetAccountProfile", - 7463: "k_EMsgGCToGCGetAccountProfileResponse", - 7464: "k_EMsgDOTAGetWeekendTourneySchedule", - 7465: "k_EMsgDOTAWeekendTourneySchedule", - 7466: "k_EMsgGCJoinableCustomGameModesRequest", - 7467: "k_EMsgGCJoinableCustomGameModesResponse", - 7468: "k_EMsgGCJoinableCustomLobbiesRequest", - 7469: "k_EMsgGCJoinableCustomLobbiesResponse", - 7470: "k_EMsgGCQuickJoinCustomLobby", - 7471: "k_EMsgGCQuickJoinCustomLobbyResponse", - 7472: "k_EMsgGCToGCGrantEventPointAction", - 7473: "k_EMsgServerGetEventPoints", - 7474: "k_EMsgServerGetEventPointsResponse", - 7475: "k_EMsgServerGrantSurveyPermission", - 7476: "k_EMsgServerGrantSurveyPermissionResponse", - 7477: "k_EMsgClientProvideSurveyResult", - 7478: "k_EMsgGCToGCSetCompendiumSelection", - 7480: "k_EMsgGCToGCUpdateTI4HeroQuest", - 7481: "k_EMsgGCCompendiumDataChanged", - 7482: "k_EMsgDOTAFantasyLeagueFindRequest", - 7483: "k_EMsgDOTAFantasyLeagueFindResponse", - 7484: "k_EMsgGCHasItemQuery", - 7485: "k_EMsgGCHasItemResponse", - 7486: "k_EMsgGCConsumeFantasyTicket", - 7487: "k_EMsgGCConsumeFantasyTicketFailure", - 7488: "k_EMsgGCToGCGrantEventPointActionMsg", - 7489: "k_EMsgClientToGCTrackDialogResult", - 7490: "k_EMsgGCFantasyLeaveLeagueRequest", - 7491: "k_EMsgGCFantasyLeaveLeagueResponse", - 7492: "k_EMsgGCToGCGetCompendiumSelections", - 7493: "k_EMsgGCToGCGetCompendiumSelectionsResponse", - 7494: "k_EMsgServerToGCMatchConnectionStats", - 7495: "k_EMsgGCToClientTournamentItemDrop", - 7496: "k_EMsgSQLDelayedGrantLeagueDrop", - 7497: "k_EMsgServerGCUpdateSpectatorCount", - 7498: "k_EMsgDOTAStartDailyHeroChallengeRequest", - 7499: "k_EMsgGCFantasyPlayerScoreDetailsRequest", - 7500: "k_EMsgGCFantasyPlayerScoreDetailsResponse", - 7501: "k_EMsgGCToGCEmoticonUnlock", - 7502: "k_EMsgSignOutDraftInfo", - 7503: "k_EMsgClientToGCEmoticonDataRequest", - 7504: "k_EMsgGCToClientEmoticonData", - 7505: "k_EMsgGCPracticeLobbyToggleBroadcastChannelCameramanStatus", - 7506: "k_EMsgGCToGCCreateWeekendTourneyRequest", - 7507: "k_EMsgGCToGCCreateWeekendTourneyResponse", - 7510: "k_EMsgGCToGCCreateGenericTeamsRequest", - 7511: "k_EMsgGCToGCCreateGenericTeamsResponse", - 7512: "k_EMsgSQLLaunchOneWeekendTourney", - 7513: "k_EMsgClientToGCSetAdditionalEquips", - 7514: "k_EMsgClientToGCGetAdditionalEquips", - 7515: "k_EMsgClientToGCGetAdditionalEquipsResponse", - 7516: "k_EMsgServerToGCGetAdditionalEquips", - 7517: "k_EMsgServerToGCGetAdditionalEquipsResponse", - 7518: "k_EMsgDOTARedeemItem", - 7519: "k_EMsgDOTARedeemItemResponse", - 7520: "k_EMsgSQLGCToGCGrantAllHeroProgress", - 7521: "k_EMsgClientToGCGetAllHeroProgress", - 7522: "k_EMsgClientToGCGetAllHeroProgressResponse", - 7523: "k_EMsgGCToGCGetServerForClient", - 7524: "k_EMsgGCToGCGetServerForClientResponse", - 7525: "k_EMsgSQLProcessTournamentGameOutcome", - 7526: "k_EMsgSQLGrantTrophyToAccount", - 7527: "k_EMsgClientToGCGetTrophyList", - 7528: "k_EMsgClientToGCGetTrophyListResponse", - 7529: "k_EMsgGCToClientTrophyAwarded", - 7530: "k_EMsgGCGameBotMatchSignOut", - 7531: "k_EMsgGCGameBotMatchSignOutPermissionRequest", - 7532: "k_EMsgSignOutBotInfo", - 7533: "k_EMsgGCToGCUpdateProfileCards", - 7534: "k_EMsgClientToGCGetProfileCard", - 7535: "k_EMsgClientToGCGetProfileCardResponse", - 7536: "k_EMsgServerToGCGetProfileCard", - 7537: "k_EMsgServerToGCGetProfileCardResponse", - 7538: "k_EMsgClientToGCSetProfileCardSlots", - 7539: "k_EMsgGCToClientProfileCardUpdated", - 7540: "k_EMsgServerToGCVictoryPredictions", - 7542: "k_EMsgClientToGCMarkNotificationListRead", - 7543: "k_EMsgGCToClientNewNotificationAdded", - 7544: "k_EMsgServerToGCSuspiciousActivity", - 7545: "k_EMsgSignOutCommunicationSummary", - 7546: "k_EMsgServerToGCRequestStatus_Response", - 7547: "k_EMsgClientToGCCreateHeroStatue", - 7548: "k_EMsgGCToClientHeroStatueCreateResult", - 7549: "k_EMsgGCGCToLANServerRelayConnect", - 7550: "k_EMsgSignOutAssassinMiniGameInfo", - 7551: "k_EMsgServerToGCGetIngameEventData", - 7552: "k_EMsgGCToGCUpdateIngameEventDataBroadcast", - 7553: "k_EMsgGCToServerIngameEventData_OraclePA", - 7554: "k_EMsgServerToGCReportKillSummaries", - 7555: "k_EMsgGCToGCReportKillSummaries", - 7556: "k_EMsgGCToGCUpdateAssassinMinigame", - 7557: "k_EMsgGCToGCFantasySetMatchLeague", - 7558: "k_EMsgClientToGCRecordCompendiumStats", - 7559: "k_EMsgGCItemEditorRequestLeagueInfo", - 7560: "k_EMsgGCItemEditorLeagueInfoResponse", - 7561: "k_EMsgGCToGCUpdatePlayerPredictions", - 7562: "k_EMsgGCToServerPredictionResult", - 7563: "k_EMsgServerToGCSignoutAwardAdditionalDrops", - 7564: "k_EMsgGCToGCSignoutAwardAdditionalDrops", - 7565: "k_EMsgGCToClientEventStatusChanged", - 7566: "k_EMsgGCHasItemDefsQuery", - 7567: "k_EMsgGCHasItemDefsResponse", - 7569: "k_EMsgGCToGCReplayMonitorValidateReplay", - 7572: "k_EMsgLobbyEventPoints", - 7573: "k_EMsgGCToGCGetCustomGameTickets", - 7574: "k_EMsgGCToGCGetCustomGameTicketsResponse", - 7575: "k_EMsgGCToClientNewBloomTimingUpdated", - 7576: "k_EMsgGCToGCCustomGamePlayed", - 7577: "k_EMsgGCToGCGrantEventPointsToUser", - 7578: "k_EMsgGCToGCSetEventMMPanicFlushTime", - 7579: "k_EMsgGameserverCrashReport", - 7580: "k_EMsgGameserverCrashReportResponse", - 7581: "k_EMsgGCToClientSteamDatagramTicket", - 7582: "k_EMsgGCToGCGrantEventOwnership", - 7583: "k_EMsgGCToGCSendAccountsEventPoints", - 7584: "k_EMsgClientToGCRerollPlayerChallenge", - 7585: "k_EMsgServerToGCRerollPlayerChallenge", - 7586: "k_EMsgGCRerollPlayerChallengeResponse", - 7587: "k_EMsgSignOutUpdatePlayerChallenge", - 7588: "k_EMsgClientToGCSetPartyLeader", - 7589: "k_EMsgClientToGCCancelPartyInvites", - 7590: "k_EMsgGCToGCMasterReloadAccount", - 7592: "k_EMsgSQLGrantLeagueMatchToTicketHolders", - 7593: "k_EMsgClientToGCSetAdditionalEquipsResponse", - 7594: "k_EMsgGCToGCEmoticonUnlockNoRollback", - 7595: "k_EMsgGCToGCGetCompendiumFanfare", - 7596: "k_EMsgServerToGCHoldEventPoints", - 7597: "k_EMsgSignOutReleaseEventPointHolds", - 7598: "k_EMsgGCToGCChatNewUserSession", - 7599: "k_EMsgClientToGCGetLeagueSeries", - 7600: "k_EMsgClientToGCGetLeagueSeriesResponse", - 7601: "k_EMsgSQLGCToGCSignoutUpdateLeagueSchedule", - 7602: "k_EMsgGCToServerUpdateBroadcastCheers", - 7603: "k_EMsgClientToGCApplyGemCombiner", - 7604: "k_EMsgClientToGCCreateStaticRecipe", - 7605: "k_EMsgClientToGCCreateStaticRecipeResponse", - 7606: "k_EMsgClientToGCGetAllHeroOrder", - 7607: "k_EMsgClientToGCGetAllHeroOrderResponse", - 7608: "k_EMsgSQLGCToGCGrantBadgePoints", - 7609: "k_EMsgGCToGCGetAccountMatchStatus", - 7610: "k_EMsgGCToGCGetAccountMatchStatusResponse", - 8001: "k_EMsgGCDev_GrantWarKill", - 8002: "k_EMsgClientToGCCreateTeamShowcase", - 8003: "k_EMsgGCToClientTeamShowcaseCreateResult", - 8004: "k_EMsgServerToGCLockCharmTrading", - 8005: "k_EMsgDOTACNY2015EventPointUsage", - 8006: "k_EMsgClientToGCPlayerStatsRequest", - 8007: "k_EMsgGCToClientPlayerStatsResponse", - 8008: "k_EMsgGCClearPracticeLobbyTeam", - 8009: "k_EMsgClientToGCFindTopSourceTVGames", - 8010: "k_EMsgGCToClientFindTopSourceTVGamesResponse", - 8011: "k_EMsgGCLobbyList", - 8012: "k_EMsgGCLobbyListResponse", - 8013: "k_EMsgGCPlayerStatsMatchSignOut", - 8014: "k_EMsgClientToGCCustomGamePlayerCountRequest", - 8015: "k_EMsgGCToClientCustomGamePlayerCountResponse", - 8016: "k_EMsgClientToGCSocialFeedPostCommentRequest", - 8017: "k_EMsgGCToClientSocialFeedPostCommentResponse", - 8018: "k_EMsgClientToGCCustomGamesFriendsPlayedRequest", - 8019: "k_EMsgGCToClientCustomGamesFriendsPlayedResponse", - 8020: "k_EMsgClientToGCFriendsPlayedCustomGameRequest", - 8021: "k_EMsgGCToClientFriendsPlayedCustomGameResponse", - 8022: "k_EMsgClientToGCFeaturedHeroesRequest", - 8023: "k_EMsgGCToClientFeaturedHeroesResponse", - 8024: "k_EMsgGCTopCustomGamesList", - 8025: "k_EMsgClientToGCSocialMatchPostCommentRequest", - 8026: "k_EMsgGCToClientSocialMatchPostCommentResponse", - 8027: "k_EMsgClientToGCSocialMatchDetailsRequest", - 8028: "k_EMsgGCToClientSocialMatchDetailsResponse", - 8029: "k_EMsgClientToGCSetPartyOpen", - 8030: "k_EMsgClientToGCMergePartyInvite", - 8031: "k_EMsgGCToClientMergeGroupInviteReply", - 8032: "k_EMsgClientToGCMergePartyResponse", - 8033: "k_EMsgGCToClientMergePartyResponseReply", - 8034: "k_EMsgClientToGCGetProfileCardStats", - 8035: "k_EMsgClientToGCGetProfileCardStatsResponse", - 8036: "k_EMsgClientToGCTopLeagueMatchesRequest", - 8037: "k_EMsgClientToGCTopFriendMatchesRequest", - 8040: "k_EMsgGCToClientProfileCardStatsUpdated", - 8041: "k_EMsgServerToGCRealtimeStats", - 8042: "k_EMsgGCToServerRealtimeStatsStartStop", - 8045: "k_EMsgGCToGCGetServersForClients", - 8046: "k_EMsgGCToGCGetServersForClientsResponse", - 8047: "k_EMsgGCPracticeLobbyKickFromTeam", - 8048: "k_EMsgDOTAChatGetMemberCount", - 8049: "k_EMsgDOTAChatGetMemberCountResponse", - 8050: "k_EMsgClientToGCSocialFeedPostMessageRequest", - 8051: "k_EMsgGCToClientSocialFeedPostMessageResponse", - 8052: "k_EMsgCustomGameListenServerStartedLoading", - 8053: "k_EMsgCustomGameClientFinishedLoading", - 8054: "k_EMsgGCPracticeLobbyCloseBroadcastChannel", - 8055: "k_EMsgGCStartFindingMatchResponse", - 8056: "k_EMsgSQLGCToGCUpdateHeroMMR", - 8057: "k_EMsgSQLGCToGCGrantAccountFlag", - 8058: "k_EMsgGCToGCGetAccountFlags", - 8059: "k_EMsgGCToGCGetAccountFlagsResponse", - 8060: "k_EMsgSignOutWagerStats", - 8061: "k_EMsgGCToClientTopLeagueMatchesResponse", - 8062: "k_EMsgGCToClientTopFriendMatchesResponse", - 8063: "k_EMsgClientToGCMatchesMinimalRequest", - 8064: "k_EMsgClientToGCMatchesMinimalResponse", - 8065: "k_EMsgGCToGCGetProfileBadgePoints", - 8066: "k_EMsgGCToGCGetProfileBadgePointsResponse", - 8067: "k_EMsgGCToClientChatRegionsEnabled", - 8068: "k_EMsgClientToGCPingData", - 8069: "k_EMsgServerToGCMatchDetailsRequest", - 8070: "k_EMsgGCToServerMatchDetailsResponse", - 8071: "k_EMsgGCToGCEnsureAccountInParty", - 8072: "k_EMsgGCToGCEnsureAccountInPartyResponse", - 8073: "k_EMsgClientToGCGetProfileTickets", - 8074: "k_EMsgClientToGCGetProfileTicketsResponse", - 8075: "k_EMsgGCToClientMatchGroupsVersion", - 8076: "k_EMsgClientToGCH264Unsupported", - 8077: "k_EMsgClientToGCRequestH264Support", - 8078: "k_EMsgClientToGCGetQuestProgress", - 8079: "k_EMsgClientToGCGetQuestProgressResponse", - 8080: "k_EMsgSignOutXPCoins", - 8081: "k_EMsgGCToClientMatchSignedOut", - 8082: "k_EMsgGCGetHeroStatsHistory", - 8083: "k_EMsgGCGetHeroStatsHistoryResponse", - 8084: "k_EMsgClientToGCPrivateChatInvite", - 8088: "k_EMsgClientToGCPrivateChatKick", - 8089: "k_EMsgClientToGCPrivateChatPromote", - 8090: "k_EMsgClientToGCPrivateChatDemote", - 8091: "k_EMsgGCToClientPrivateChatResponse", - 8092: "k_EMsgClientToGCPrivateChatInfoRequest", - 8093: "k_EMsgGCToClientPrivateChatInfoResponse", - 8095: "k_EMsgClientToGCLatestBehaviorReportRequest", - 8096: "k_EMsgClientToGCLatestBehaviorReport", -} -var EDOTAGCMsg_value = map[string]int32{ - "k_EMsgGCDOTABase": 7000, - "k_EMsgGCGeneralResponse": 7001, - "k_EMsgGCGameMatchSignOut": 7004, - "k_EMsgGCGameMatchSignOutResponse": 7005, - "k_EMsgGCJoinChatChannel": 7009, - "k_EMsgGCJoinChatChannelResponse": 7010, - "k_EMsgGCOtherJoinedChannel": 7013, - "k_EMsgGCOtherLeftChannel": 7014, - "k_EMsgGCMatchHistoryList": 7017, - "k_EMsgServerToGCRequestStatus": 7026, - "k_EMsgGCGetRecentMatches": 7027, - "k_EMsgGCRecentMatchesResponse": 7028, - "k_EMsgGCStartFindingMatch": 7033, - "k_EMsgGCConnectedPlayers": 7034, - "k_EMsgGCAbandonCurrentGame": 7035, - "k_EMsgGCStopFindingMatch": 7036, - "k_EMsgGCPracticeLobbyCreate": 7038, - "k_EMsgGCPracticeLobbyLeave": 7040, - "k_EMsgGCPracticeLobbyLaunch": 7041, - "k_EMsgGCPracticeLobbyList": 7042, - "k_EMsgGCPracticeLobbyListResponse": 7043, - "k_EMsgGCPracticeLobbyJoin": 7044, - "k_EMsgGCPracticeLobbySetDetails": 7046, - "k_EMsgGCPracticeLobbySetTeamSlot": 7047, - "k_EMsgGCInitialQuestionnaireResponse": 7049, - "k_EMsgGCTournamentRequest": 7051, - "k_EMsgGCTournamentResponse": 7052, - "k_EMsgGCPracticeLobbyResponse": 7055, - "k_EMsgGCBroadcastNotification": 7056, - "k_EMsgGCLiveScoreboardUpdate": 7057, - "k_EMsgGCRequestChatChannelList": 7060, - "k_EMsgGCRequestChatChannelListResponse": 7061, - "k_EMsgGCRequestMatches": 7064, - "k_EMsgGCRequestMatchesResponse": 7065, - "k_EMsgGCRequestPlayerResources": 7068, - "k_EMsgGCRequestPlayerResourcesResponse": 7069, - "k_EMsgGCReadyUp": 7070, - "k_EMsgGCKickedFromMatchmakingQueue": 7071, - "k_EMsgGCLeaverDetected": 7072, - "k_EMsgGCSpectateFriendGame": 7073, - "k_EMsgGCSpectateFriendGameResponse": 7074, - "k_EMsgGCPlayerReports": 7075, - "k_EMsgGCReportsRemainingRequest": 7076, - "k_EMsgGCReportsRemainingResponse": 7077, - "k_EMsgGCSubmitPlayerReport": 7078, - "k_EMsgGCSubmitPlayerReportResponse": 7079, - "k_EMsgGCGameChatLog": 7080, - "k_EMsgGCPracticeLobbyKick": 7081, - "k_EMsgGCReportCountsRequest": 7082, - "k_EMsgGCReportCountsResponse": 7083, - "k_EMsgGCRequestSaveGames": 7084, - "k_EMsgGCRequestSaveGamesServer": 7085, - "k_EMsgGCRequestSaveGamesResponse": 7086, - "k_EMsgGCLeaverDetectedResponse": 7087, - "k_EMsgGCPlayerFailedToConnect": 7088, - "k_EMsgGCGCToRelayConnect": 7089, - "k_EMsgGCGCToRelayConnectresponse": 7090, - "k_EMsgGCWatchGame": 7091, - "k_EMsgGCWatchGameResponse": 7092, - "k_EMsgGCBanStatusRequest": 7093, - "k_EMsgGCBanStatusResponse": 7094, - "k_EMsgGCMatchDetailsRequest": 7095, - "k_EMsgGCMatchDetailsResponse": 7096, - "k_EMsgGCCancelWatchGame": 7097, - "k_EMsgGCProfileRequest": 7098, - "k_EMsgGCProfileResponse": 7099, - "k_EMsgGCPopup": 7102, - "k_EMsgGCDOTAClearNotifySuccessfulReport": 7104, - "k_EMsgGCFriendPracticeLobbyListRequest": 7111, - "k_EMsgGCFriendPracticeLobbyListResponse": 7112, - "k_EMsgGCPracticeLobbyJoinResponse": 7113, - "k_EMsgClientEconNotification_Job": 7114, - "k_EMsgGCCreateTeam": 7115, - "k_EMsgGCCreateTeamResponse": 7116, - "k_EMsgGCDisbandTeam": 7117, - "k_EMsgGCDisbandTeamResponse": 7118, - "k_EMsgGCRequestTeamData": 7119, - "k_EMsgGCRequestTeamDataResponse": 7120, - "k_EMsgGCTeamData": 7121, - "k_EMsgGCTeamInvite_InviterToGC": 7122, - "k_EMsgGCTeamInvite_GCImmediateResponseToInviter": 7123, - "k_EMsgGCTeamInvite_GCRequestToInvitee": 7124, - "k_EMsgGCTeamInvite_InviteeResponseToGC": 7125, - "k_EMsgGCTeamInvite_GCResponseToInviter": 7126, - "k_EMsgGCTeamInvite_GCResponseToInvitee": 7127, - "k_EMsgGCKickTeamMember": 7128, - "k_EMsgGCKickTeamMemberResponse": 7129, - "k_EMsgGCLeaveTeam": 7130, - "k_EMsgGCLeaveTeamResponse": 7131, - "k_EMsgGCSuggestTeamMatchmaking": 7132, - "k_EMsgGCPlayerHeroesFavoritesAdd": 7133, - "k_EMsgGCPlayerHeroesFavoritesRemove": 7134, - "k_EMsgGCEditTeamLogo": 7139, - "k_EMsgGCEditTeamLogoResponse": 7140, - "k_EMsgGCSetShowcaseHero": 7141, - "k_EMsgGCApplyTeamToPracticeLobby": 7142, - "k_EMsgGCRequestInternatinalTicketEmail": 7143, - "k_EMsgGCTransferTeamAdmin": 7144, - "k_EMsgGCClearTournamentGame": 7145, - "k_EMsgRequestLeagueInfo": 7147, - "k_EMsgResponseLeagueInfo": 7148, - "k_EMsgGCPracticeLobbyJoinBroadcastChannel": 7149, - "k_EMsgGC_TournamentItemEvent": 7150, - "k_EMsgGC_TournamentItemEventResponse": 7151, - "k_EMsgCastMatchVote": 7152, - "k_EMsgCastMatchVoteResponse": 7153, - "k_EMsgRetrieveMatchVote": 7154, - "k_EMsgRetrieveMatchVoteResponse": 7155, - "k_EMsgTeamFanfare": 7156, - "k_EMsgResponseTeamFanfare": 7157, - "k_EMsgGC_GameServerUploadSaveGame": 7158, - "k_EMsgGC_GameServerSaveGameResult": 7159, - "k_EMsgGC_GameServerGetLoadGame": 7160, - "k_EMsgGC_GameServerGetLoadGameResult": 7161, - "k_EMsgGCTeamProfileRequest": 7164, - "k_EMsgGCTeamProfileResponse": 7165, - "k_EMsgGCEditTeamDetails": 7166, - "k_EMsgGCEditTeamDetailsResponse": 7167, - "k_EMsgGCProTeamListRequest": 7168, - "k_EMsgGCProTeamListResponse": 7169, - "k_EMsgGCReadyUpStatus": 7170, - "k_EMsgGCHallOfFame": 7171, - "k_EMsgGCHallOfFameRequest": 7172, - "k_EMsgGCHallOfFameResponse": 7173, - "k_EMsgGCGenerateDiretidePrizeList": 7174, - "k_EMsgGCRewardDiretidePrizes": 7176, - "k_EMsgGCDiretidePrizesRewardedResponse": 7177, - "k_EMsgGCHalloweenHighScoreRequest": 7178, - "k_EMsgGCHalloweenHighScoreResponse": 7179, - "k_EMsgGCGenerateDiretidePrizeListResponse": 7180, - "k_EMsgGCStorePromoPagesRequest": 7182, - "k_EMsgGCStorePromoPagesResponse": 7183, - "k_EMsgGCSpawnLootGreevil": 7184, - "k_EMsgGCDismissLootGreevil": 7185, - "k_EMsgGCToGCMatchCompleted": 7186, - "k_EMsgGCDismissLootGreevilResponse": 7187, - "k_EMsgGCBalancedShuffleLobby": 7188, - "k_EMsgGCToGCCheckLeaguePermission": 7189, - "k_EMsgGCToGCCheckLeaguePermissionResponse": 7190, - "k_EMsgGCLeagueScheduleRequest": 7191, - "k_EMsgGCLeagueScheduleResponse": 7192, - "k_EMsgGCLeagueScheduleEdit": 7193, - "k_EMsgGCLeagueScheduleEditResponse": 7194, - "k_EMsgGCLeaguesInMonthRequest": 7195, - "k_EMsgGCLeaguesInMonthResponse": 7196, - "k_EMsgGCMatchmakingStatsRequest": 7197, - "k_EMsgGCMatchmakingStatsResponse": 7198, - "k_EMsgGCBotGameCreate": 7199, - "k_EMsgGCSetMatchHistoryAccess": 7200, - "k_EMsgGCSetMatchHistoryAccessResponse": 7201, - "k_EMsgUpgradeLeagueItem": 7203, - "k_EMsgUpgradeLeagueItemResponse": 7204, - "k_EMsgGCTeamMemberProfileRequest": 7205, - "k_EMsgGCWatchDownloadedReplay": 7206, - "k_EMsgGCSetMapLocationState": 7207, - "k_EMsgGCSetMapLocationStateResponse": 7208, - "k_EMsgGCResetMapLocations": 7209, - "k_EMsgGCResetMapLocationsResponse": 7210, - "k_EMsgGCTeamOnProfile": 7211, - "k_EMsgGCSetFeaturedItems": 7212, - "k_EMsgGCFeaturedItems": 7215, - "k_EMsgRefreshPartnerAccountLink": 7216, - "k_EMsgClientsRejoinChatChannels": 7217, - "k_EMsgGCToGCGetUserChatInfo": 7218, - "k_EMsgGCToGCGetUserChatInfoResponse": 7219, - "k_EMsgGCToGCLeaveAllChatChannels": 7220, - "k_EMsgGCToGCUpdateAccountChatBan": 7221, - "k_EMsgGCGuildCreateRequest": 7222, - "k_EMsgGCGuildCreateResponse": 7223, - "k_EMsgGCGuildSetAccountRoleRequest": 7224, - "k_EMsgGCGuildSetAccountRoleResponse": 7225, - "k_EMsgGCRequestGuildData": 7226, - "k_EMsgGCGuildData": 7227, - "k_EMsgGCGuildInviteAccountRequest": 7228, - "k_EMsgGCGuildInviteAccountResponse": 7229, - "k_EMsgGCGuildCancelInviteRequest": 7230, - "k_EMsgGCGuildCancelInviteResponse": 7231, - "k_EMsgGCGuildUpdateDetailsRequest": 7232, - "k_EMsgGCGuildUpdateDetailsResponse": 7233, - "k_EMsgGCToGCCanInviteUser": 7234, - "k_EMsgGCToGCCanInviteUserResponse": 7235, - "k_EMsgGCToGCGetUserRank": 7236, - "k_EMsgGCToGCGetUserRankResponse": 7237, - "k_EMsgGCToGCUpdateTeamStats": 7240, - "k_EMsgGCToGCGetTeamRank": 7241, - "k_EMsgGCToGCGetTeamRankResponse": 7242, - "k_EMsgGCTeamIDByNameRequest": 7245, - "k_EMsgGCTeamIDByNameResponse": 7246, - "k_EMsgGCEditTeam": 7247, - "k_EMsgGCPassportDataRequest": 7248, - "k_EMsgGCPassportDataResponse": 7249, - "k_EMsgGCNotInGuildData": 7251, - "k_EMsgGCGuildInviteData": 7254, - "k_EMsgGCToGCGetLeagueAdmin": 7255, - "k_EMsgGCToGCGetLeagueAdminResponse": 7256, - "k_EMsgGCRequestLeaguePrizePool": 7258, - "k_EMsgGCRequestLeaguePrizePoolResponse": 7259, - "k_EMsgGCToGCUpdateOpenGuildPartyRequest": 7261, - "k_EMsgGCToGCUpdateOpenGuildPartyResponse": 7262, - "k_EMsgGCToGCDestroyOpenGuildPartyRequest": 7263, - "k_EMsgGCToGCDestroyOpenGuildPartyResponse": 7264, - "k_EMsgGCGuildUpdateMessage": 7265, - "k_EMsgGCPartySetOpenGuildRequest": 7266, - "k_EMsgGCPartySetOpenGuildResponse": 7267, - "k_EMsgGCGuildOpenPartyRefresh": 7268, - "k_EMsgGCJoinOpenGuildPartyRequest": 7269, - "k_EMsgGCJoinOpenGuildPartyResponse": 7270, - "k_EMsgGCLeaveChatChannel": 7272, - "k_EMsgGCChatMessage": 7273, - "k_EMsgGCGetHeroStandings": 7274, - "k_EMsgGCGetHeroStandingsResponse": 7275, - "k_EMsgGCGuildEditLogoRequest": 7279, - "k_EMsgGCGuildEditLogoResponse": 7280, - "k_EMsgGCGuildmatePracticeLobbyListRequest": 7281, - "k_EMsgGCGuildmatePracticeLobbyListResponse": 7282, - "k_EMsgGCItemEditorReservationsRequest": 7283, - "k_EMsgGCItemEditorReservationsResponse": 7284, - "k_EMsgGCItemEditorReserveItemDef": 7285, - "k_EMsgGCItemEditorReserveItemDefResponse": 7286, - "k_EMsgGCItemEditorReleaseReservation": 7287, - "k_EMsgGCItemEditorReleaseReservationResponse": 7288, - "k_EMsgGCRewardTutorialPrizes": 7289, - "k_EMsgGCLastHitChallengeHighScorePost": 7290, - "k_EMsgGCLastHitChallengeHighScoreRequest": 7291, - "k_EMsgGCLastHitChallengeHighScoreResponse": 7292, - "k_EMsgGCCreateFantasyLeagueRequest": 7293, - "k_EMsgGCCreateFantasyLeagueResponse": 7294, - "k_EMsgGCFantasyLeagueInfoRequest": 7297, - "k_EMsgGCFantasyLeagueInfoResponse": 7298, - "k_EMsgGCFantasyLeagueInfo": 7299, - "k_EMsgGCCreateFantasyTeamRequest": 7300, - "k_EMsgGCCreateFantasyTeamResponse": 7301, - "k_EMsgGCEditFantasyTeamRequest": 7302, - "k_EMsgGCEditFantasyTeamResponse": 7303, - "k_EMsgGCFantasyTeamInfoRequestByFantasyLeagueID": 7304, - "k_EMsgGCFantasyTeamInfoRequestByOwnerAccountID": 7305, - "k_EMsgGCFantasyTeamInfoResponse": 7306, - "k_EMsgGCFantasyTeamInfo": 7307, - "k_EMsgGCFantasyLivePlayerStats": 7308, - "k_EMsgGCFantasyFinalPlayerStats": 7309, - "k_EMsgGCFantasyMatch": 7310, - "k_EMsgGCToGCReloadVersions": 7311, - "k_EMsgGCFantasyTeamScoreRequest": 7312, - "k_EMsgGCFantasyTeamScoreResponse": 7313, - "k_EMsgGCFantasyTeamStandingsRequest": 7314, - "k_EMsgGCFantasyTeamStandingsResponse": 7315, - "k_EMsgGCFantasyPlayerScoreRequest": 7316, - "k_EMsgGCFantasyPlayerScoreResponse": 7317, - "k_EMsgGCFantasyPlayerStandingsRequest": 7318, - "k_EMsgGCFantasyPlayerStandingsResponse": 7319, - "k_EMsgGCFlipLobbyTeams": 7320, - "k_EMsgGCCustomGameCreate": 7321, - "k_EMsgGCFantasyPlayerInfoRequest": 7322, - "k_EMsgGCFantasyPlayerInfoResponse": 7323, - "k_EMsgGCToGCProcessPlayerReportForTarget": 7324, - "k_EMsgGCToGCProcessReportSuccess": 7325, - "k_EMsgGCNotifyAccountFlagsChange": 7326, - "k_EMsgGCSetProfilePrivacy": 7327, - "k_EMsgGCSetProfilePrivacyResponse": 7328, - "k_EMsgGCSteamProfileRequest": 7329, - "k_EMsgGCSteamProfileRequestResponse": 7330, - "k_EMsgGCFantasyLeagueCreateInfoRequest": 7331, - "k_EMsgGCFantasyLeagueCreateInfoResponse": 7332, - "k_EMsgGCFantasyLeagueInviteInfoRequest": 7333, - "k_EMsgGCFantasyLeagueInviteInfoResponse": 7334, - "k_EMsgGCClientIgnoredUser": 7335, - "k_EMsgGCFantasyLeagueCreateRequest": 7336, - "k_EMsgGCFantasyLeagueCreateResponse": 7337, - "k_EMsgGCFantasyTeamCreateRequest": 7338, - "k_EMsgGCFantasyTeamCreateResponse": 7339, - "k_EMsgGCFantasyLeagueFriendJoinListRequest": 7340, - "k_EMsgGCFantasyLeagueFriendJoinListResponse": 7341, - "k_EMsgGCClientSuspended": 7342, - "k_EMsgGCPartyMemberSetCoach": 7343, - "k_EMsgGCFantasyLeagueEditInvitesRequest": 7344, - "k_EMsgGCFantasyLeagueEditInvitesResponse": 7345, - "k_EMsgGCPracticeLobbySetCoach": 7346, - "k_EMsgGCFantasyLeagueEditInfoRequest": 7347, - "k_EMsgGCFantasyLeagueEditInfoResponse": 7348, - "k_EMsgGCFantasyLeagueDraftStatusRequest": 7349, - "k_EMsgGCFantasyLeagueDraftStatus": 7350, - "k_EMsgGCFantasyLeagueDraftPlayerRequest": 7351, - "k_EMsgGCFantasyLeagueDraftPlayerResponse": 7352, - "k_EMsgGCFantasyLeagueMatchupsRequest": 7353, - "k_EMsgGCFantasyLeagueMatchupsResponse": 7354, - "k_EMsgGCFantasyTeamRosterSwapRequest": 7355, - "k_EMsgGCFantasyTeamRosterSwapResponse": 7356, - "k_EMsgGCFantasyTeamRosterRequest": 7357, - "k_EMsgGCFantasyTeamRosterResponse": 7358, - "k_EMsgGCNexonPartnerUpdate": 7359, - "k_EMsgGCToGCProcessPCBangRewardPoints": 7360, - "k_EMsgGCFantasyTeamRosterAddDropRequest": 7361, - "k_EMsgGCFantasyTeamRosterAddDropResponse": 7362, - "k_EMsgPresentedClientTerminateDlg": 7363, - "k_EMsgGCFantasyPlayerHisoricalStatsRequest": 7364, - "k_EMsgGCFantasyPlayerHisoricalStatsResponse": 7365, - "k_EMsgGCPCBangTimedRewardMessage": 7366, - "k_EMsgGCLobbyUpdateBroadcastChannelInfo": 7367, - "k_EMsgGCFantasyTeamTradesRequest": 7368, - "k_EMsgGCFantasyTeamTradesResponse": 7369, - "k_EMsgGCFantasyTeamTradeCancelRequest": 7370, - "k_EMsgGCFantasyTeamTradeCancelResponse": 7371, - "k_EMsgGCToGCGrantTournamentItem": 7372, - "k_EMsgGCProcessFantasyScheduledEvent": 7373, - "k_EMsgGCToGCGrantPCBangRewardItem": 7374, - "k_EMsgGCToGCUpgradeTwitchViewerItems": 7375, - "k_EMsgGCToGCGetLiveMatchAffiliates": 7376, - "k_EMsgGCToGCGetLiveMatchAffiliatesResponse": 7377, - "k_EMsgGCToGCUpdatePlayerPennantCounts": 7378, - "k_EMsgGCToGCGetPlayerPennantCounts": 7379, - "k_EMsgGCToGCGetPlayerPennantCountsResponse": 7380, - "k_EMsgGCGameMatchSignOutPermissionRequest": 7381, - "k_EMsgGCGameMatchSignOutPermissionResponse": 7382, - "k_EMsgDOTAChatChannelMemberUpdate": 7383, - "k_EMsgDOTAAwardEventPoints": 7384, - "k_EMsgDOTARedeemEventPrize": 7385, - "k_EMsgDOTARedeemEventPrizeResponse": 7386, - "k_EMsgDOTAGetEventPoints": 7387, - "k_EMsgDOTAGetEventPointsResponse": 7388, - "k_EMsgGCToGCSignoutAwardEventPoints": 7390, - "k_EMsgDOTASendFriendRecruits": 7393, - "k_EMsgDOTAFriendRecruitsRequest": 7394, - "k_EMsgDOTAFriendRecruitsResponse": 7395, - "k_EMsgDOTAFriendRecruitInviteAcceptDecline": 7396, - "k_EMsgGCPartyLeaderWatchGamePrompt": 7397, - "k_EMsgDOTAFrostivusTimeElapsed": 7398, - "k_EMsgGCToGCGrantEarnedLicense": 7399, - "k_EMsgDOTALiveLeagueGameUpdate": 7402, - "k_EMsgDOTAChatGetUserList": 7403, - "k_EMsgDOTAChatGetUserListResponse": 7404, - "k_EMsgGCCompendiumSetSelection": 7405, - "k_EMsgGCCompendiumDataRequest": 7406, - "k_EMsgGCCompendiumDataResponse": 7407, - "k_EMsgDOTAGetPlayerMatchHistory": 7408, - "k_EMsgDOTAGetPlayerMatchHistoryResponse": 7409, - "k_EMsgGCToGCMatchmakingAddParty": 7410, - "k_EMsgGCToGCMatchmakingRemoveParty": 7411, - "k_EMsgGCToGCMatchmakingRemoveAllParties": 7412, - "k_EMsgGCToGCMatchmakingMatchFound": 7413, - "k_EMsgGCToGCUpdateMatchManagementStats": 7414, - "k_EMsgGCToGCUpdateMatchmakingStats": 7415, - "k_EMsgGCToServerPingRequest": 7416, - "k_EMsgGCToServerPingResponse": 7417, - "k_EMsgGCToServerConsoleCommand": 7418, - "k_EMsgGCToGCUpdateLiveLeagueGameInfo": 7420, - "k_EMsgGCMakeOffering": 7423, - "k_EMsgGCRequestOfferings": 7424, - "k_EMsgGCRequestOfferingsResponse": 7425, - "k_EMsgGCToGCProcessMatchLeaver": 7426, - "k_EMsgGCNotificationsRequest": 7427, - "k_EMsgGCNotificationsResponse": 7428, - "k_EMsgGCToGCModifyNotification": 7429, - "k_EMsgGCToGCSetNewNotifications": 7430, - "k_EMsgGCToGCSetIsLeagueAdmin": 7431, - "k_EMsgGCLeagueAdminState": 7432, - "k_EMsgGCToGCSendLeagueAdminState": 7433, - "k_EMsgGCLeagueAdminList": 7434, - "k_EMsgGCNotificationsMarkReadRequest": 7435, - "k_EMsgGCFantasyMessageAdd": 7436, - "k_EMsgGCFantasyMessagesRequest": 7437, - "k_EMsgGCFantasyMessagesResponse": 7438, - "k_EMsgGCFantasyScheduledMatchesRequest": 7439, - "k_EMsgGCFantasyScheduledMatchesResponse": 7440, - "k_EMsgGCToGCGrantLeagueAccess": 7441, - "k_EMsgGCEventGameCreate": 7443, - "k_EMsgGCPerfectWorldUserLookupRequest": 7444, - "k_EMsgGCPerfectWorldUserLookupResponse": 7445, - "k_EMsgGCToGCIncrementRecruitmentSDO": 7446, - "k_EMsgGCToGCIncrementRecruitmentLevel": 7447, - "k_EMsgGCFantasyRemoveOwner": 7448, - "k_EMsgGCFantasyRemoveOwnerResponse": 7449, - "k_EMsgGCRequestBatchPlayerResources": 7450, - "k_EMsgGCRequestBatchPlayerResourcesResponse": 7451, - "k_EMsgGCToGCSendUpdateLeagues": 7452, - "k_EMsgGCCompendiumSetSelectionResponse": 7453, - "k_EMsgGCPlayerInfoRequest": 7454, - "k_EMsgGCPlayerInfo": 7455, - "k_EMsgGCPlayerInfoSubmit": 7456, - "k_EMsgGCPlayerInfoSubmitResponse": 7457, - "k_EMsgGCToGCGetAccountLevel": 7458, - "k_EMsgGCToGCGetAccountLevelResponse": 7459, - "k_EMsgGCToGCGetAccountPartner": 7460, - "k_EMsgGCToGCGetAccountPartnerResponse": 7461, - "k_EMsgGCToGCGetAccountProfile": 7462, - "k_EMsgGCToGCGetAccountProfileResponse": 7463, - "k_EMsgDOTAGetWeekendTourneySchedule": 7464, - "k_EMsgDOTAWeekendTourneySchedule": 7465, - "k_EMsgGCJoinableCustomGameModesRequest": 7466, - "k_EMsgGCJoinableCustomGameModesResponse": 7467, - "k_EMsgGCJoinableCustomLobbiesRequest": 7468, - "k_EMsgGCJoinableCustomLobbiesResponse": 7469, - "k_EMsgGCQuickJoinCustomLobby": 7470, - "k_EMsgGCQuickJoinCustomLobbyResponse": 7471, - "k_EMsgGCToGCGrantEventPointAction": 7472, - "k_EMsgServerGetEventPoints": 7473, - "k_EMsgServerGetEventPointsResponse": 7474, - "k_EMsgServerGrantSurveyPermission": 7475, - "k_EMsgServerGrantSurveyPermissionResponse": 7476, - "k_EMsgClientProvideSurveyResult": 7477, - "k_EMsgGCToGCSetCompendiumSelection": 7478, - "k_EMsgGCToGCUpdateTI4HeroQuest": 7480, - "k_EMsgGCCompendiumDataChanged": 7481, - "k_EMsgDOTAFantasyLeagueFindRequest": 7482, - "k_EMsgDOTAFantasyLeagueFindResponse": 7483, - "k_EMsgGCHasItemQuery": 7484, - "k_EMsgGCHasItemResponse": 7485, - "k_EMsgGCConsumeFantasyTicket": 7486, - "k_EMsgGCConsumeFantasyTicketFailure": 7487, - "k_EMsgGCToGCGrantEventPointActionMsg": 7488, - "k_EMsgClientToGCTrackDialogResult": 7489, - "k_EMsgGCFantasyLeaveLeagueRequest": 7490, - "k_EMsgGCFantasyLeaveLeagueResponse": 7491, - "k_EMsgGCToGCGetCompendiumSelections": 7492, - "k_EMsgGCToGCGetCompendiumSelectionsResponse": 7493, - "k_EMsgServerToGCMatchConnectionStats": 7494, - "k_EMsgGCToClientTournamentItemDrop": 7495, - "k_EMsgSQLDelayedGrantLeagueDrop": 7496, - "k_EMsgServerGCUpdateSpectatorCount": 7497, - "k_EMsgDOTAStartDailyHeroChallengeRequest": 7498, - "k_EMsgGCFantasyPlayerScoreDetailsRequest": 7499, - "k_EMsgGCFantasyPlayerScoreDetailsResponse": 7500, - "k_EMsgGCToGCEmoticonUnlock": 7501, - "k_EMsgSignOutDraftInfo": 7502, - "k_EMsgClientToGCEmoticonDataRequest": 7503, - "k_EMsgGCToClientEmoticonData": 7504, - "k_EMsgGCPracticeLobbyToggleBroadcastChannelCameramanStatus": 7505, - "k_EMsgGCToGCCreateWeekendTourneyRequest": 7506, - "k_EMsgGCToGCCreateWeekendTourneyResponse": 7507, - "k_EMsgGCToGCCreateGenericTeamsRequest": 7510, - "k_EMsgGCToGCCreateGenericTeamsResponse": 7511, - "k_EMsgSQLLaunchOneWeekendTourney": 7512, - "k_EMsgClientToGCSetAdditionalEquips": 7513, - "k_EMsgClientToGCGetAdditionalEquips": 7514, - "k_EMsgClientToGCGetAdditionalEquipsResponse": 7515, - "k_EMsgServerToGCGetAdditionalEquips": 7516, - "k_EMsgServerToGCGetAdditionalEquipsResponse": 7517, - "k_EMsgDOTARedeemItem": 7518, - "k_EMsgDOTARedeemItemResponse": 7519, - "k_EMsgSQLGCToGCGrantAllHeroProgress": 7520, - "k_EMsgClientToGCGetAllHeroProgress": 7521, - "k_EMsgClientToGCGetAllHeroProgressResponse": 7522, - "k_EMsgGCToGCGetServerForClient": 7523, - "k_EMsgGCToGCGetServerForClientResponse": 7524, - "k_EMsgSQLProcessTournamentGameOutcome": 7525, - "k_EMsgSQLGrantTrophyToAccount": 7526, - "k_EMsgClientToGCGetTrophyList": 7527, - "k_EMsgClientToGCGetTrophyListResponse": 7528, - "k_EMsgGCToClientTrophyAwarded": 7529, - "k_EMsgGCGameBotMatchSignOut": 7530, - "k_EMsgGCGameBotMatchSignOutPermissionRequest": 7531, - "k_EMsgSignOutBotInfo": 7532, - "k_EMsgGCToGCUpdateProfileCards": 7533, - "k_EMsgClientToGCGetProfileCard": 7534, - "k_EMsgClientToGCGetProfileCardResponse": 7535, - "k_EMsgServerToGCGetProfileCard": 7536, - "k_EMsgServerToGCGetProfileCardResponse": 7537, - "k_EMsgClientToGCSetProfileCardSlots": 7538, - "k_EMsgGCToClientProfileCardUpdated": 7539, - "k_EMsgServerToGCVictoryPredictions": 7540, - "k_EMsgClientToGCMarkNotificationListRead": 7542, - "k_EMsgGCToClientNewNotificationAdded": 7543, - "k_EMsgServerToGCSuspiciousActivity": 7544, - "k_EMsgSignOutCommunicationSummary": 7545, - "k_EMsgServerToGCRequestStatus_Response": 7546, - "k_EMsgClientToGCCreateHeroStatue": 7547, - "k_EMsgGCToClientHeroStatueCreateResult": 7548, - "k_EMsgGCGCToLANServerRelayConnect": 7549, - "k_EMsgSignOutAssassinMiniGameInfo": 7550, - "k_EMsgServerToGCGetIngameEventData": 7551, - "k_EMsgGCToGCUpdateIngameEventDataBroadcast": 7552, - "k_EMsgGCToServerIngameEventData_OraclePA": 7553, - "k_EMsgServerToGCReportKillSummaries": 7554, - "k_EMsgGCToGCReportKillSummaries": 7555, - "k_EMsgGCToGCUpdateAssassinMinigame": 7556, - "k_EMsgGCToGCFantasySetMatchLeague": 7557, - "k_EMsgClientToGCRecordCompendiumStats": 7558, - "k_EMsgGCItemEditorRequestLeagueInfo": 7559, - "k_EMsgGCItemEditorLeagueInfoResponse": 7560, - "k_EMsgGCToGCUpdatePlayerPredictions": 7561, - "k_EMsgGCToServerPredictionResult": 7562, - "k_EMsgServerToGCSignoutAwardAdditionalDrops": 7563, - "k_EMsgGCToGCSignoutAwardAdditionalDrops": 7564, - "k_EMsgGCToClientEventStatusChanged": 7565, - "k_EMsgGCHasItemDefsQuery": 7566, - "k_EMsgGCHasItemDefsResponse": 7567, - "k_EMsgGCToGCReplayMonitorValidateReplay": 7569, - "k_EMsgLobbyEventPoints": 7572, - "k_EMsgGCToGCGetCustomGameTickets": 7573, - "k_EMsgGCToGCGetCustomGameTicketsResponse": 7574, - "k_EMsgGCToClientNewBloomTimingUpdated": 7575, - "k_EMsgGCToGCCustomGamePlayed": 7576, - "k_EMsgGCToGCGrantEventPointsToUser": 7577, - "k_EMsgGCToGCSetEventMMPanicFlushTime": 7578, - "k_EMsgGameserverCrashReport": 7579, - "k_EMsgGameserverCrashReportResponse": 7580, - "k_EMsgGCToClientSteamDatagramTicket": 7581, - "k_EMsgGCToGCGrantEventOwnership": 7582, - "k_EMsgGCToGCSendAccountsEventPoints": 7583, - "k_EMsgClientToGCRerollPlayerChallenge": 7584, - "k_EMsgServerToGCRerollPlayerChallenge": 7585, - "k_EMsgGCRerollPlayerChallengeResponse": 7586, - "k_EMsgSignOutUpdatePlayerChallenge": 7587, - "k_EMsgClientToGCSetPartyLeader": 7588, - "k_EMsgClientToGCCancelPartyInvites": 7589, - "k_EMsgGCToGCMasterReloadAccount": 7590, - "k_EMsgSQLGrantLeagueMatchToTicketHolders": 7592, - "k_EMsgClientToGCSetAdditionalEquipsResponse": 7593, - "k_EMsgGCToGCEmoticonUnlockNoRollback": 7594, - "k_EMsgGCToGCGetCompendiumFanfare": 7595, - "k_EMsgServerToGCHoldEventPoints": 7596, - "k_EMsgSignOutReleaseEventPointHolds": 7597, - "k_EMsgGCToGCChatNewUserSession": 7598, - "k_EMsgClientToGCGetLeagueSeries": 7599, - "k_EMsgClientToGCGetLeagueSeriesResponse": 7600, - "k_EMsgSQLGCToGCSignoutUpdateLeagueSchedule": 7601, - "k_EMsgGCToServerUpdateBroadcastCheers": 7602, - "k_EMsgClientToGCApplyGemCombiner": 7603, - "k_EMsgClientToGCCreateStaticRecipe": 7604, - "k_EMsgClientToGCCreateStaticRecipeResponse": 7605, - "k_EMsgClientToGCGetAllHeroOrder": 7606, - "k_EMsgClientToGCGetAllHeroOrderResponse": 7607, - "k_EMsgSQLGCToGCGrantBadgePoints": 7608, - "k_EMsgGCToGCGetAccountMatchStatus": 7609, - "k_EMsgGCToGCGetAccountMatchStatusResponse": 7610, - "k_EMsgGCDev_GrantWarKill": 8001, - "k_EMsgClientToGCCreateTeamShowcase": 8002, - "k_EMsgGCToClientTeamShowcaseCreateResult": 8003, - "k_EMsgServerToGCLockCharmTrading": 8004, - "k_EMsgDOTACNY2015EventPointUsage": 8005, - "k_EMsgClientToGCPlayerStatsRequest": 8006, - "k_EMsgGCToClientPlayerStatsResponse": 8007, - "k_EMsgGCClearPracticeLobbyTeam": 8008, - "k_EMsgClientToGCFindTopSourceTVGames": 8009, - "k_EMsgGCToClientFindTopSourceTVGamesResponse": 8010, - "k_EMsgGCLobbyList": 8011, - "k_EMsgGCLobbyListResponse": 8012, - "k_EMsgGCPlayerStatsMatchSignOut": 8013, - "k_EMsgClientToGCCustomGamePlayerCountRequest": 8014, - "k_EMsgGCToClientCustomGamePlayerCountResponse": 8015, - "k_EMsgClientToGCSocialFeedPostCommentRequest": 8016, - "k_EMsgGCToClientSocialFeedPostCommentResponse": 8017, - "k_EMsgClientToGCCustomGamesFriendsPlayedRequest": 8018, - "k_EMsgGCToClientCustomGamesFriendsPlayedResponse": 8019, - "k_EMsgClientToGCFriendsPlayedCustomGameRequest": 8020, - "k_EMsgGCToClientFriendsPlayedCustomGameResponse": 8021, - "k_EMsgClientToGCFeaturedHeroesRequest": 8022, - "k_EMsgGCToClientFeaturedHeroesResponse": 8023, - "k_EMsgGCTopCustomGamesList": 8024, - "k_EMsgClientToGCSocialMatchPostCommentRequest": 8025, - "k_EMsgGCToClientSocialMatchPostCommentResponse": 8026, - "k_EMsgClientToGCSocialMatchDetailsRequest": 8027, - "k_EMsgGCToClientSocialMatchDetailsResponse": 8028, - "k_EMsgClientToGCSetPartyOpen": 8029, - "k_EMsgClientToGCMergePartyInvite": 8030, - "k_EMsgGCToClientMergeGroupInviteReply": 8031, - "k_EMsgClientToGCMergePartyResponse": 8032, - "k_EMsgGCToClientMergePartyResponseReply": 8033, - "k_EMsgClientToGCGetProfileCardStats": 8034, - "k_EMsgClientToGCGetProfileCardStatsResponse": 8035, - "k_EMsgClientToGCTopLeagueMatchesRequest": 8036, - "k_EMsgClientToGCTopFriendMatchesRequest": 8037, - "k_EMsgGCToClientProfileCardStatsUpdated": 8040, - "k_EMsgServerToGCRealtimeStats": 8041, - "k_EMsgGCToServerRealtimeStatsStartStop": 8042, - "k_EMsgGCToGCGetServersForClients": 8045, - "k_EMsgGCToGCGetServersForClientsResponse": 8046, - "k_EMsgGCPracticeLobbyKickFromTeam": 8047, - "k_EMsgDOTAChatGetMemberCount": 8048, - "k_EMsgDOTAChatGetMemberCountResponse": 8049, - "k_EMsgClientToGCSocialFeedPostMessageRequest": 8050, - "k_EMsgGCToClientSocialFeedPostMessageResponse": 8051, - "k_EMsgCustomGameListenServerStartedLoading": 8052, - "k_EMsgCustomGameClientFinishedLoading": 8053, - "k_EMsgGCPracticeLobbyCloseBroadcastChannel": 8054, - "k_EMsgGCStartFindingMatchResponse": 8055, - "k_EMsgSQLGCToGCUpdateHeroMMR": 8056, - "k_EMsgSQLGCToGCGrantAccountFlag": 8057, - "k_EMsgGCToGCGetAccountFlags": 8058, - "k_EMsgGCToGCGetAccountFlagsResponse": 8059, - "k_EMsgSignOutWagerStats": 8060, - "k_EMsgGCToClientTopLeagueMatchesResponse": 8061, - "k_EMsgGCToClientTopFriendMatchesResponse": 8062, - "k_EMsgClientToGCMatchesMinimalRequest": 8063, - "k_EMsgClientToGCMatchesMinimalResponse": 8064, - "k_EMsgGCToGCGetProfileBadgePoints": 8065, - "k_EMsgGCToGCGetProfileBadgePointsResponse": 8066, - "k_EMsgGCToClientChatRegionsEnabled": 8067, - "k_EMsgClientToGCPingData": 8068, - "k_EMsgServerToGCMatchDetailsRequest": 8069, - "k_EMsgGCToServerMatchDetailsResponse": 8070, - "k_EMsgGCToGCEnsureAccountInParty": 8071, - "k_EMsgGCToGCEnsureAccountInPartyResponse": 8072, - "k_EMsgClientToGCGetProfileTickets": 8073, - "k_EMsgClientToGCGetProfileTicketsResponse": 8074, - "k_EMsgGCToClientMatchGroupsVersion": 8075, - "k_EMsgClientToGCH264Unsupported": 8076, - "k_EMsgClientToGCRequestH264Support": 8077, - "k_EMsgClientToGCGetQuestProgress": 8078, - "k_EMsgClientToGCGetQuestProgressResponse": 8079, - "k_EMsgSignOutXPCoins": 8080, - "k_EMsgGCToClientMatchSignedOut": 8081, - "k_EMsgGCGetHeroStatsHistory": 8082, - "k_EMsgGCGetHeroStatsHistoryResponse": 8083, - "k_EMsgClientToGCPrivateChatInvite": 8084, - "k_EMsgClientToGCPrivateChatKick": 8088, - "k_EMsgClientToGCPrivateChatPromote": 8089, - "k_EMsgClientToGCPrivateChatDemote": 8090, - "k_EMsgGCToClientPrivateChatResponse": 8091, - "k_EMsgClientToGCPrivateChatInfoRequest": 8092, - "k_EMsgGCToClientPrivateChatInfoResponse": 8093, - "k_EMsgClientToGCLatestBehaviorReportRequest": 8095, - "k_EMsgClientToGCLatestBehaviorReport": 8096, -} - -func (x EDOTAGCMsg) Enum() *EDOTAGCMsg { - p := new(EDOTAGCMsg) - *p = x - return p -} -func (x EDOTAGCMsg) String() string { - return proto.EnumName(EDOTAGCMsg_name, int32(x)) -} -func (x *EDOTAGCMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EDOTAGCMsg_value, data, "EDOTAGCMsg") - if err != nil { - return err - } - *x = EDOTAGCMsg(value) - return nil -} -func (EDOTAGCMsg) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{0} } - -type ESpecialPingValue int32 - -const ( - ESpecialPingValue_k_ESpecialPingValue_NoData ESpecialPingValue = 16382 - ESpecialPingValue_k_ESpecialPingValue_Failed ESpecialPingValue = 16383 -) - -var ESpecialPingValue_name = map[int32]string{ - 16382: "k_ESpecialPingValue_NoData", - 16383: "k_ESpecialPingValue_Failed", -} -var ESpecialPingValue_value = map[string]int32{ - "k_ESpecialPingValue_NoData": 16382, - "k_ESpecialPingValue_Failed": 16383, -} - -func (x ESpecialPingValue) Enum() *ESpecialPingValue { - p := new(ESpecialPingValue) - *p = x - return p -} -func (x ESpecialPingValue) String() string { - return proto.EnumName(ESpecialPingValue_name, int32(x)) -} -func (x *ESpecialPingValue) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ESpecialPingValue_value, data, "ESpecialPingValue") - if err != nil { - return err - } - *x = ESpecialPingValue(value) - return nil -} -func (ESpecialPingValue) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{1} } - -type DOTA_GameMode int32 - -const ( - DOTA_GameMode_DOTA_GAMEMODE_NONE DOTA_GameMode = 0 - DOTA_GameMode_DOTA_GAMEMODE_AP DOTA_GameMode = 1 - DOTA_GameMode_DOTA_GAMEMODE_CM DOTA_GameMode = 2 - DOTA_GameMode_DOTA_GAMEMODE_RD DOTA_GameMode = 3 - DOTA_GameMode_DOTA_GAMEMODE_SD DOTA_GameMode = 4 - DOTA_GameMode_DOTA_GAMEMODE_AR DOTA_GameMode = 5 - DOTA_GameMode_DOTA_GAMEMODE_INTRO DOTA_GameMode = 6 - DOTA_GameMode_DOTA_GAMEMODE_HW DOTA_GameMode = 7 - DOTA_GameMode_DOTA_GAMEMODE_REVERSE_CM DOTA_GameMode = 8 - DOTA_GameMode_DOTA_GAMEMODE_XMAS DOTA_GameMode = 9 - DOTA_GameMode_DOTA_GAMEMODE_TUTORIAL DOTA_GameMode = 10 - DOTA_GameMode_DOTA_GAMEMODE_MO DOTA_GameMode = 11 - DOTA_GameMode_DOTA_GAMEMODE_LP DOTA_GameMode = 12 - DOTA_GameMode_DOTA_GAMEMODE_POOL1 DOTA_GameMode = 13 - DOTA_GameMode_DOTA_GAMEMODE_FH DOTA_GameMode = 14 - DOTA_GameMode_DOTA_GAMEMODE_CUSTOM DOTA_GameMode = 15 - DOTA_GameMode_DOTA_GAMEMODE_CD DOTA_GameMode = 16 - DOTA_GameMode_DOTA_GAMEMODE_BD DOTA_GameMode = 17 - DOTA_GameMode_DOTA_GAMEMODE_ABILITY_DRAFT DOTA_GameMode = 18 - DOTA_GameMode_DOTA_GAMEMODE_EVENT DOTA_GameMode = 19 - DOTA_GameMode_DOTA_GAMEMODE_ARDM DOTA_GameMode = 20 - DOTA_GameMode_DOTA_GAMEMODE_1V1MID DOTA_GameMode = 21 - DOTA_GameMode_DOTA_GAMEMODE_ALL_DRAFT DOTA_GameMode = 22 -) - -var DOTA_GameMode_name = map[int32]string{ - 0: "DOTA_GAMEMODE_NONE", - 1: "DOTA_GAMEMODE_AP", - 2: "DOTA_GAMEMODE_CM", - 3: "DOTA_GAMEMODE_RD", - 4: "DOTA_GAMEMODE_SD", - 5: "DOTA_GAMEMODE_AR", - 6: "DOTA_GAMEMODE_INTRO", - 7: "DOTA_GAMEMODE_HW", - 8: "DOTA_GAMEMODE_REVERSE_CM", - 9: "DOTA_GAMEMODE_XMAS", - 10: "DOTA_GAMEMODE_TUTORIAL", - 11: "DOTA_GAMEMODE_MO", - 12: "DOTA_GAMEMODE_LP", - 13: "DOTA_GAMEMODE_POOL1", - 14: "DOTA_GAMEMODE_FH", - 15: "DOTA_GAMEMODE_CUSTOM", - 16: "DOTA_GAMEMODE_CD", - 17: "DOTA_GAMEMODE_BD", - 18: "DOTA_GAMEMODE_ABILITY_DRAFT", - 19: "DOTA_GAMEMODE_EVENT", - 20: "DOTA_GAMEMODE_ARDM", - 21: "DOTA_GAMEMODE_1V1MID", - 22: "DOTA_GAMEMODE_ALL_DRAFT", -} -var DOTA_GameMode_value = map[string]int32{ - "DOTA_GAMEMODE_NONE": 0, - "DOTA_GAMEMODE_AP": 1, - "DOTA_GAMEMODE_CM": 2, - "DOTA_GAMEMODE_RD": 3, - "DOTA_GAMEMODE_SD": 4, - "DOTA_GAMEMODE_AR": 5, - "DOTA_GAMEMODE_INTRO": 6, - "DOTA_GAMEMODE_HW": 7, - "DOTA_GAMEMODE_REVERSE_CM": 8, - "DOTA_GAMEMODE_XMAS": 9, - "DOTA_GAMEMODE_TUTORIAL": 10, - "DOTA_GAMEMODE_MO": 11, - "DOTA_GAMEMODE_LP": 12, - "DOTA_GAMEMODE_POOL1": 13, - "DOTA_GAMEMODE_FH": 14, - "DOTA_GAMEMODE_CUSTOM": 15, - "DOTA_GAMEMODE_CD": 16, - "DOTA_GAMEMODE_BD": 17, - "DOTA_GAMEMODE_ABILITY_DRAFT": 18, - "DOTA_GAMEMODE_EVENT": 19, - "DOTA_GAMEMODE_ARDM": 20, - "DOTA_GAMEMODE_1V1MID": 21, - "DOTA_GAMEMODE_ALL_DRAFT": 22, -} - -func (x DOTA_GameMode) Enum() *DOTA_GameMode { - p := new(DOTA_GameMode) - *p = x - return p -} -func (x DOTA_GameMode) String() string { - return proto.EnumName(DOTA_GameMode_name, int32(x)) -} -func (x *DOTA_GameMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_GameMode_value, data, "DOTA_GameMode") - if err != nil { - return err - } - *x = DOTA_GameMode(value) - return nil -} -func (DOTA_GameMode) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{2} } - -type DOTA_GameState int32 - -const ( - DOTA_GameState_DOTA_GAMERULES_STATE_INIT DOTA_GameState = 0 - DOTA_GameState_DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD DOTA_GameState = 1 - DOTA_GameState_DOTA_GAMERULES_STATE_HERO_SELECTION DOTA_GameState = 2 - DOTA_GameState_DOTA_GAMERULES_STATE_STRATEGY_TIME DOTA_GameState = 3 - DOTA_GameState_DOTA_GAMERULES_STATE_PRE_GAME DOTA_GameState = 4 - DOTA_GameState_DOTA_GAMERULES_STATE_GAME_IN_PROGRESS DOTA_GameState = 5 - DOTA_GameState_DOTA_GAMERULES_STATE_POST_GAME DOTA_GameState = 6 - DOTA_GameState_DOTA_GAMERULES_STATE_DISCONNECT DOTA_GameState = 7 - DOTA_GameState_DOTA_GAMERULES_STATE_TEAM_SHOWCASE DOTA_GameState = 8 - DOTA_GameState_DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP DOTA_GameState = 9 - DOTA_GameState_DOTA_GAMERULES_STATE_LAST DOTA_GameState = 10 -) - -var DOTA_GameState_name = map[int32]string{ - 0: "DOTA_GAMERULES_STATE_INIT", - 1: "DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD", - 2: "DOTA_GAMERULES_STATE_HERO_SELECTION", - 3: "DOTA_GAMERULES_STATE_STRATEGY_TIME", - 4: "DOTA_GAMERULES_STATE_PRE_GAME", - 5: "DOTA_GAMERULES_STATE_GAME_IN_PROGRESS", - 6: "DOTA_GAMERULES_STATE_POST_GAME", - 7: "DOTA_GAMERULES_STATE_DISCONNECT", - 8: "DOTA_GAMERULES_STATE_TEAM_SHOWCASE", - 9: "DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP", - 10: "DOTA_GAMERULES_STATE_LAST", -} -var DOTA_GameState_value = map[string]int32{ - "DOTA_GAMERULES_STATE_INIT": 0, - "DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD": 1, - "DOTA_GAMERULES_STATE_HERO_SELECTION": 2, - "DOTA_GAMERULES_STATE_STRATEGY_TIME": 3, - "DOTA_GAMERULES_STATE_PRE_GAME": 4, - "DOTA_GAMERULES_STATE_GAME_IN_PROGRESS": 5, - "DOTA_GAMERULES_STATE_POST_GAME": 6, - "DOTA_GAMERULES_STATE_DISCONNECT": 7, - "DOTA_GAMERULES_STATE_TEAM_SHOWCASE": 8, - "DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP": 9, - "DOTA_GAMERULES_STATE_LAST": 10, -} - -func (x DOTA_GameState) Enum() *DOTA_GameState { - p := new(DOTA_GameState) - *p = x - return p -} -func (x DOTA_GameState) String() string { - return proto.EnumName(DOTA_GameState_name, int32(x)) -} -func (x *DOTA_GameState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_GameState_value, data, "DOTA_GameState") - if err != nil { - return err - } - *x = DOTA_GameState(value) - return nil -} -func (DOTA_GameState) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{3} } - -type DOTA_GC_TEAM int32 - -const ( - DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS DOTA_GC_TEAM = 0 - DOTA_GC_TEAM_DOTA_GC_TEAM_BAD_GUYS DOTA_GC_TEAM = 1 - DOTA_GC_TEAM_DOTA_GC_TEAM_BROADCASTER DOTA_GC_TEAM = 2 - DOTA_GC_TEAM_DOTA_GC_TEAM_SPECTATOR DOTA_GC_TEAM = 3 - DOTA_GC_TEAM_DOTA_GC_TEAM_PLAYER_POOL DOTA_GC_TEAM = 4 - DOTA_GC_TEAM_DOTA_GC_TEAM_NOTEAM DOTA_GC_TEAM = 5 -) - -var DOTA_GC_TEAM_name = map[int32]string{ - 0: "DOTA_GC_TEAM_GOOD_GUYS", - 1: "DOTA_GC_TEAM_BAD_GUYS", - 2: "DOTA_GC_TEAM_BROADCASTER", - 3: "DOTA_GC_TEAM_SPECTATOR", - 4: "DOTA_GC_TEAM_PLAYER_POOL", - 5: "DOTA_GC_TEAM_NOTEAM", -} -var DOTA_GC_TEAM_value = map[string]int32{ - "DOTA_GC_TEAM_GOOD_GUYS": 0, - "DOTA_GC_TEAM_BAD_GUYS": 1, - "DOTA_GC_TEAM_BROADCASTER": 2, - "DOTA_GC_TEAM_SPECTATOR": 3, - "DOTA_GC_TEAM_PLAYER_POOL": 4, - "DOTA_GC_TEAM_NOTEAM": 5, -} - -func (x DOTA_GC_TEAM) Enum() *DOTA_GC_TEAM { - p := new(DOTA_GC_TEAM) - *p = x - return p -} -func (x DOTA_GC_TEAM) String() string { - return proto.EnumName(DOTA_GC_TEAM_name, int32(x)) -} -func (x *DOTA_GC_TEAM) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_GC_TEAM_value, data, "DOTA_GC_TEAM") - if err != nil { - return err - } - *x = DOTA_GC_TEAM(value) - return nil -} -func (DOTA_GC_TEAM) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{4} } - -type DOTA_CM_PICK int32 - -const ( - DOTA_CM_PICK_DOTA_CM_RANDOM DOTA_CM_PICK = 0 - DOTA_CM_PICK_DOTA_CM_GOOD_GUYS DOTA_CM_PICK = 1 - DOTA_CM_PICK_DOTA_CM_BAD_GUYS DOTA_CM_PICK = 2 -) - -var DOTA_CM_PICK_name = map[int32]string{ - 0: "DOTA_CM_RANDOM", - 1: "DOTA_CM_GOOD_GUYS", - 2: "DOTA_CM_BAD_GUYS", -} -var DOTA_CM_PICK_value = map[string]int32{ - "DOTA_CM_RANDOM": 0, - "DOTA_CM_GOOD_GUYS": 1, - "DOTA_CM_BAD_GUYS": 2, -} - -func (x DOTA_CM_PICK) Enum() *DOTA_CM_PICK { - p := new(DOTA_CM_PICK) - *p = x - return p -} -func (x DOTA_CM_PICK) String() string { - return proto.EnumName(DOTA_CM_PICK_name, int32(x)) -} -func (x *DOTA_CM_PICK) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_CM_PICK_value, data, "DOTA_CM_PICK") - if err != nil { - return err - } - *x = DOTA_CM_PICK(value) - return nil -} -func (DOTA_CM_PICK) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{5} } - -type DOTAConnectionStateT int32 - -const ( - DOTAConnectionStateT_DOTA_CONNECTION_STATE_UNKNOWN DOTAConnectionStateT = 0 - DOTAConnectionStateT_DOTA_CONNECTION_STATE_NOT_YET_CONNECTED DOTAConnectionStateT = 1 - DOTAConnectionStateT_DOTA_CONNECTION_STATE_CONNECTED DOTAConnectionStateT = 2 - DOTAConnectionStateT_DOTA_CONNECTION_STATE_DISCONNECTED DOTAConnectionStateT = 3 - DOTAConnectionStateT_DOTA_CONNECTION_STATE_ABANDONED DOTAConnectionStateT = 4 - DOTAConnectionStateT_DOTA_CONNECTION_STATE_LOADING DOTAConnectionStateT = 5 - DOTAConnectionStateT_DOTA_CONNECTION_STATE_FAILED DOTAConnectionStateT = 6 -) - -var DOTAConnectionStateT_name = map[int32]string{ - 0: "DOTA_CONNECTION_STATE_UNKNOWN", - 1: "DOTA_CONNECTION_STATE_NOT_YET_CONNECTED", - 2: "DOTA_CONNECTION_STATE_CONNECTED", - 3: "DOTA_CONNECTION_STATE_DISCONNECTED", - 4: "DOTA_CONNECTION_STATE_ABANDONED", - 5: "DOTA_CONNECTION_STATE_LOADING", - 6: "DOTA_CONNECTION_STATE_FAILED", -} -var DOTAConnectionStateT_value = map[string]int32{ - "DOTA_CONNECTION_STATE_UNKNOWN": 0, - "DOTA_CONNECTION_STATE_NOT_YET_CONNECTED": 1, - "DOTA_CONNECTION_STATE_CONNECTED": 2, - "DOTA_CONNECTION_STATE_DISCONNECTED": 3, - "DOTA_CONNECTION_STATE_ABANDONED": 4, - "DOTA_CONNECTION_STATE_LOADING": 5, - "DOTA_CONNECTION_STATE_FAILED": 6, -} - -func (x DOTAConnectionStateT) Enum() *DOTAConnectionStateT { - p := new(DOTAConnectionStateT) - *p = x - return p -} -func (x DOTAConnectionStateT) String() string { - return proto.EnumName(DOTAConnectionStateT_name, int32(x)) -} -func (x *DOTAConnectionStateT) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTAConnectionStateT_value, data, "DOTAConnectionStateT") - if err != nil { - return err - } - *x = DOTAConnectionStateT(value) - return nil -} -func (DOTAConnectionStateT) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{6} } - -type DOTALeaverStatusT int32 - -const ( - DOTALeaverStatusT_DOTA_LEAVER_NONE DOTALeaverStatusT = 0 - DOTALeaverStatusT_DOTA_LEAVER_DISCONNECTED DOTALeaverStatusT = 1 - DOTALeaverStatusT_DOTA_LEAVER_DISCONNECTED_TOO_LONG DOTALeaverStatusT = 2 - DOTALeaverStatusT_DOTA_LEAVER_ABANDONED DOTALeaverStatusT = 3 - DOTALeaverStatusT_DOTA_LEAVER_AFK DOTALeaverStatusT = 4 - DOTALeaverStatusT_DOTA_LEAVER_NEVER_CONNECTED DOTALeaverStatusT = 5 - DOTALeaverStatusT_DOTA_LEAVER_NEVER_CONNECTED_TOO_LONG DOTALeaverStatusT = 6 - DOTALeaverStatusT_DOTA_LEAVER_FAILED_TO_READY_UP DOTALeaverStatusT = 7 - DOTALeaverStatusT_DOTA_LEAVER_DECLINED DOTALeaverStatusT = 8 -) - -var DOTALeaverStatusT_name = map[int32]string{ - 0: "DOTA_LEAVER_NONE", - 1: "DOTA_LEAVER_DISCONNECTED", - 2: "DOTA_LEAVER_DISCONNECTED_TOO_LONG", - 3: "DOTA_LEAVER_ABANDONED", - 4: "DOTA_LEAVER_AFK", - 5: "DOTA_LEAVER_NEVER_CONNECTED", - 6: "DOTA_LEAVER_NEVER_CONNECTED_TOO_LONG", - 7: "DOTA_LEAVER_FAILED_TO_READY_UP", - 8: "DOTA_LEAVER_DECLINED", -} -var DOTALeaverStatusT_value = map[string]int32{ - "DOTA_LEAVER_NONE": 0, - "DOTA_LEAVER_DISCONNECTED": 1, - "DOTA_LEAVER_DISCONNECTED_TOO_LONG": 2, - "DOTA_LEAVER_ABANDONED": 3, - "DOTA_LEAVER_AFK": 4, - "DOTA_LEAVER_NEVER_CONNECTED": 5, - "DOTA_LEAVER_NEVER_CONNECTED_TOO_LONG": 6, - "DOTA_LEAVER_FAILED_TO_READY_UP": 7, - "DOTA_LEAVER_DECLINED": 8, -} - -func (x DOTALeaverStatusT) Enum() *DOTALeaverStatusT { - p := new(DOTALeaverStatusT) - *p = x - return p -} -func (x DOTALeaverStatusT) String() string { - return proto.EnumName(DOTALeaverStatusT_name, int32(x)) -} -func (x *DOTALeaverStatusT) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTALeaverStatusT_value, data, "DOTALeaverStatusT") - if err != nil { - return err - } - *x = DOTALeaverStatusT(value) - return nil -} -func (DOTALeaverStatusT) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{7} } - -type DOTALowPriorityBanType int32 - -const ( - DOTALowPriorityBanType_DOTA_LOW_PRIORITY_BAN_ABANDON DOTALowPriorityBanType = 0 - DOTALowPriorityBanType_DOTA_LOW_PRIORITY_BAN_REPORTS DOTALowPriorityBanType = 1 - DOTALowPriorityBanType_DOTA_LOW_PRIORITY_BAN_SECONDARY_ABANDON DOTALowPriorityBanType = 2 -) - -var DOTALowPriorityBanType_name = map[int32]string{ - 0: "DOTA_LOW_PRIORITY_BAN_ABANDON", - 1: "DOTA_LOW_PRIORITY_BAN_REPORTS", - 2: "DOTA_LOW_PRIORITY_BAN_SECONDARY_ABANDON", -} -var DOTALowPriorityBanType_value = map[string]int32{ - "DOTA_LOW_PRIORITY_BAN_ABANDON": 0, - "DOTA_LOW_PRIORITY_BAN_REPORTS": 1, - "DOTA_LOW_PRIORITY_BAN_SECONDARY_ABANDON": 2, -} - -func (x DOTALowPriorityBanType) Enum() *DOTALowPriorityBanType { - p := new(DOTALowPriorityBanType) - *p = x - return p -} -func (x DOTALowPriorityBanType) String() string { - return proto.EnumName(DOTALowPriorityBanType_name, int32(x)) -} -func (x *DOTALowPriorityBanType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTALowPriorityBanType_value, data, "DOTALowPriorityBanType") - if err != nil { - return err - } - *x = DOTALowPriorityBanType(value) - return nil -} -func (DOTALowPriorityBanType) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{8} } - -type DOTALobbyReadyState int32 - -const ( - DOTALobbyReadyState_DOTALobbyReadyState_UNDECLARED DOTALobbyReadyState = 0 - DOTALobbyReadyState_DOTALobbyReadyState_ACCEPTED DOTALobbyReadyState = 1 - DOTALobbyReadyState_DOTALobbyReadyState_DECLINED DOTALobbyReadyState = 2 -) - -var DOTALobbyReadyState_name = map[int32]string{ - 0: "DOTALobbyReadyState_UNDECLARED", - 1: "DOTALobbyReadyState_ACCEPTED", - 2: "DOTALobbyReadyState_DECLINED", -} -var DOTALobbyReadyState_value = map[string]int32{ - "DOTALobbyReadyState_UNDECLARED": 0, - "DOTALobbyReadyState_ACCEPTED": 1, - "DOTALobbyReadyState_DECLINED": 2, -} - -func (x DOTALobbyReadyState) Enum() *DOTALobbyReadyState { - p := new(DOTALobbyReadyState) - *p = x - return p -} -func (x DOTALobbyReadyState) String() string { - return proto.EnumName(DOTALobbyReadyState_name, int32(x)) -} -func (x *DOTALobbyReadyState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTALobbyReadyState_value, data, "DOTALobbyReadyState") - if err != nil { - return err - } - *x = DOTALobbyReadyState(value) - return nil -} -func (DOTALobbyReadyState) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{9} } - -type DOTAGameVersion int32 - -const ( - DOTAGameVersion_GAME_VERSION_CURRENT DOTAGameVersion = 0 - DOTAGameVersion_GAME_VERSION_STABLE DOTAGameVersion = 1 -) - -var DOTAGameVersion_name = map[int32]string{ - 0: "GAME_VERSION_CURRENT", - 1: "GAME_VERSION_STABLE", -} -var DOTAGameVersion_value = map[string]int32{ - "GAME_VERSION_CURRENT": 0, - "GAME_VERSION_STABLE": 1, -} - -func (x DOTAGameVersion) Enum() *DOTAGameVersion { - p := new(DOTAGameVersion) - *p = x - return p -} -func (x DOTAGameVersion) String() string { - return proto.EnumName(DOTAGameVersion_name, int32(x)) -} -func (x *DOTAGameVersion) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTAGameVersion_value, data, "DOTAGameVersion") - if err != nil { - return err - } - *x = DOTAGameVersion(value) - return nil -} -func (DOTAGameVersion) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{10} } - -type DOTAJoinLobbyResult int32 - -const ( - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_SUCCESS DOTAJoinLobbyResult = 0 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_ALREADY_IN_GAME DOTAJoinLobbyResult = 1 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_INVALID_LOBBY DOTAJoinLobbyResult = 2 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_INCORRECT_PASSWORD DOTAJoinLobbyResult = 3 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_ACCESS_DENIED DOTAJoinLobbyResult = 4 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_GENERIC_ERROR DOTAJoinLobbyResult = 5 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_INCORRECT_VERSION DOTAJoinLobbyResult = 6 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_IN_TEAM_PARTY DOTAJoinLobbyResult = 7 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_NO_LOBBY_FOUND DOTAJoinLobbyResult = 8 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_LOBBY_FULL DOTAJoinLobbyResult = 9 - DOTAJoinLobbyResult_DOTA_JOIN_RESULT_CUSTOM_GAME_INCORRECT_VERSION DOTAJoinLobbyResult = 10 -) - -var DOTAJoinLobbyResult_name = map[int32]string{ - 0: "DOTA_JOIN_RESULT_SUCCESS", - 1: "DOTA_JOIN_RESULT_ALREADY_IN_GAME", - 2: "DOTA_JOIN_RESULT_INVALID_LOBBY", - 3: "DOTA_JOIN_RESULT_INCORRECT_PASSWORD", - 4: "DOTA_JOIN_RESULT_ACCESS_DENIED", - 5: "DOTA_JOIN_RESULT_GENERIC_ERROR", - 6: "DOTA_JOIN_RESULT_INCORRECT_VERSION", - 7: "DOTA_JOIN_RESULT_IN_TEAM_PARTY", - 8: "DOTA_JOIN_RESULT_NO_LOBBY_FOUND", - 9: "DOTA_JOIN_RESULT_LOBBY_FULL", - 10: "DOTA_JOIN_RESULT_CUSTOM_GAME_INCORRECT_VERSION", -} -var DOTAJoinLobbyResult_value = map[string]int32{ - "DOTA_JOIN_RESULT_SUCCESS": 0, - "DOTA_JOIN_RESULT_ALREADY_IN_GAME": 1, - "DOTA_JOIN_RESULT_INVALID_LOBBY": 2, - "DOTA_JOIN_RESULT_INCORRECT_PASSWORD": 3, - "DOTA_JOIN_RESULT_ACCESS_DENIED": 4, - "DOTA_JOIN_RESULT_GENERIC_ERROR": 5, - "DOTA_JOIN_RESULT_INCORRECT_VERSION": 6, - "DOTA_JOIN_RESULT_IN_TEAM_PARTY": 7, - "DOTA_JOIN_RESULT_NO_LOBBY_FOUND": 8, - "DOTA_JOIN_RESULT_LOBBY_FULL": 9, - "DOTA_JOIN_RESULT_CUSTOM_GAME_INCORRECT_VERSION": 10, -} - -func (x DOTAJoinLobbyResult) Enum() *DOTAJoinLobbyResult { - p := new(DOTAJoinLobbyResult) - *p = x - return p -} -func (x DOTAJoinLobbyResult) String() string { - return proto.EnumName(DOTAJoinLobbyResult_name, int32(x)) -} -func (x *DOTAJoinLobbyResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTAJoinLobbyResult_value, data, "DOTAJoinLobbyResult") - if err != nil { - return err - } - *x = DOTAJoinLobbyResult(value) - return nil -} -func (DOTAJoinLobbyResult) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{11} } - -type SelectionPriorityType int32 - -const ( - SelectionPriorityType_UNDEFINED SelectionPriorityType = 0 - SelectionPriorityType_RADIANT SelectionPriorityType = 1 - SelectionPriorityType_DIRE SelectionPriorityType = 2 - SelectionPriorityType_FIRST_PICK SelectionPriorityType = 3 - SelectionPriorityType_SECOND_PICK SelectionPriorityType = 4 -) - -var SelectionPriorityType_name = map[int32]string{ - 0: "UNDEFINED", - 1: "RADIANT", - 2: "DIRE", - 3: "FIRST_PICK", - 4: "SECOND_PICK", -} -var SelectionPriorityType_value = map[string]int32{ - "UNDEFINED": 0, - "RADIANT": 1, - "DIRE": 2, - "FIRST_PICK": 3, - "SECOND_PICK": 4, -} - -func (x SelectionPriorityType) Enum() *SelectionPriorityType { - p := new(SelectionPriorityType) - *p = x - return p -} -func (x SelectionPriorityType) String() string { - return proto.EnumName(SelectionPriorityType_name, int32(x)) -} -func (x *SelectionPriorityType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(SelectionPriorityType_value, data, "SelectionPriorityType") - if err != nil { - return err - } - *x = SelectionPriorityType(value) - return nil -} -func (SelectionPriorityType) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{12} } - -type DOTAMatchVote int32 - -const ( - DOTAMatchVote_DOTAMatchVote_INVALID DOTAMatchVote = 0 - DOTAMatchVote_DOTAMatchVote_POSITIVE DOTAMatchVote = 1 - DOTAMatchVote_DOTAMatchVote_NEGATIVE DOTAMatchVote = 2 -) - -var DOTAMatchVote_name = map[int32]string{ - 0: "DOTAMatchVote_INVALID", - 1: "DOTAMatchVote_POSITIVE", - 2: "DOTAMatchVote_NEGATIVE", -} -var DOTAMatchVote_value = map[string]int32{ - "DOTAMatchVote_INVALID": 0, - "DOTAMatchVote_POSITIVE": 1, - "DOTAMatchVote_NEGATIVE": 2, -} - -func (x DOTAMatchVote) Enum() *DOTAMatchVote { - p := new(DOTAMatchVote) - *p = x - return p -} -func (x DOTAMatchVote) String() string { - return proto.EnumName(DOTAMatchVote_name, int32(x)) -} -func (x *DOTAMatchVote) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTAMatchVote_value, data, "DOTAMatchVote") - if err != nil { - return err - } - *x = DOTAMatchVote(value) - return nil -} -func (DOTAMatchVote) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{13} } - -type DOTA_LobbyMemberXPBonus int32 - -const ( - DOTA_LobbyMemberXPBonus_DOTA_LobbyMemberXPBonus_DEFAULT DOTA_LobbyMemberXPBonus = 0 - DOTA_LobbyMemberXPBonus_DOTA_LobbyMemberXPBonus_BATTLE_BOOSTER DOTA_LobbyMemberXPBonus = 1 - DOTA_LobbyMemberXPBonus_DOTA_LobbyMemberXPBonus_SHARE_BONUS DOTA_LobbyMemberXPBonus = 2 - DOTA_LobbyMemberXPBonus_DOTA_LobbyMemberXPBonus_PARTY DOTA_LobbyMemberXPBonus = 3 - DOTA_LobbyMemberXPBonus_DOTA_LobbyMemberXPBonus_RECRUITMENT DOTA_LobbyMemberXPBonus = 4 - DOTA_LobbyMemberXPBonus_DOTA_LobbyMemberXPBonus_PCBANG DOTA_LobbyMemberXPBonus = 5 -) - -var DOTA_LobbyMemberXPBonus_name = map[int32]string{ - 0: "DOTA_LobbyMemberXPBonus_DEFAULT", - 1: "DOTA_LobbyMemberXPBonus_BATTLE_BOOSTER", - 2: "DOTA_LobbyMemberXPBonus_SHARE_BONUS", - 3: "DOTA_LobbyMemberXPBonus_PARTY", - 4: "DOTA_LobbyMemberXPBonus_RECRUITMENT", - 5: "DOTA_LobbyMemberXPBonus_PCBANG", -} -var DOTA_LobbyMemberXPBonus_value = map[string]int32{ - "DOTA_LobbyMemberXPBonus_DEFAULT": 0, - "DOTA_LobbyMemberXPBonus_BATTLE_BOOSTER": 1, - "DOTA_LobbyMemberXPBonus_SHARE_BONUS": 2, - "DOTA_LobbyMemberXPBonus_PARTY": 3, - "DOTA_LobbyMemberXPBonus_RECRUITMENT": 4, - "DOTA_LobbyMemberXPBonus_PCBANG": 5, -} - -func (x DOTA_LobbyMemberXPBonus) Enum() *DOTA_LobbyMemberXPBonus { - p := new(DOTA_LobbyMemberXPBonus) - *p = x - return p -} -func (x DOTA_LobbyMemberXPBonus) String() string { - return proto.EnumName(DOTA_LobbyMemberXPBonus_name, int32(x)) -} -func (x *DOTA_LobbyMemberXPBonus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_LobbyMemberXPBonus_value, data, "DOTA_LobbyMemberXPBonus") - if err != nil { - return err - } - *x = DOTA_LobbyMemberXPBonus(value) - return nil -} -func (DOTA_LobbyMemberXPBonus) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{14} } - -type DOTALobbyVisibility int32 - -const ( - DOTALobbyVisibility_DOTALobbyVisibility_Public DOTALobbyVisibility = 0 - DOTALobbyVisibility_DOTALobbyVisibility_Friends DOTALobbyVisibility = 1 - DOTALobbyVisibility_DOTALobbyVisibility_Unlisted DOTALobbyVisibility = 2 -) - -var DOTALobbyVisibility_name = map[int32]string{ - 0: "DOTALobbyVisibility_Public", - 1: "DOTALobbyVisibility_Friends", - 2: "DOTALobbyVisibility_Unlisted", -} -var DOTALobbyVisibility_value = map[string]int32{ - "DOTALobbyVisibility_Public": 0, - "DOTALobbyVisibility_Friends": 1, - "DOTALobbyVisibility_Unlisted": 2, -} - -func (x DOTALobbyVisibility) Enum() *DOTALobbyVisibility { - p := new(DOTALobbyVisibility) - *p = x - return p -} -func (x DOTALobbyVisibility) String() string { - return proto.EnumName(DOTALobbyVisibility_name, int32(x)) -} -func (x *DOTALobbyVisibility) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTALobbyVisibility_value, data, "DOTALobbyVisibility") - if err != nil { - return err - } - *x = DOTALobbyVisibility(value) - return nil -} -func (DOTALobbyVisibility) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{15} } - -type EDOTAPlayerMMRType int32 - -const ( - EDOTAPlayerMMRType_k_EDOTAPlayerMMRType_Invalid EDOTAPlayerMMRType = 0 - EDOTAPlayerMMRType_k_EDOTAPlayerMMRType_GeneralHidden EDOTAPlayerMMRType = 1 - EDOTAPlayerMMRType_k_EDOTAPlayerMMRType_SoloHidden EDOTAPlayerMMRType = 2 - EDOTAPlayerMMRType_k_EDOTAPlayerMMRType_GeneralCompetitive EDOTAPlayerMMRType = 3 - EDOTAPlayerMMRType_k_EDOTAPlayerMMRType_SoloCompetitive EDOTAPlayerMMRType = 4 - EDOTAPlayerMMRType_k_EDOTAPlayerMMRType_1v1Competitive EDOTAPlayerMMRType = 5 -) - -var EDOTAPlayerMMRType_name = map[int32]string{ - 0: "k_EDOTAPlayerMMRType_Invalid", - 1: "k_EDOTAPlayerMMRType_GeneralHidden", - 2: "k_EDOTAPlayerMMRType_SoloHidden", - 3: "k_EDOTAPlayerMMRType_GeneralCompetitive", - 4: "k_EDOTAPlayerMMRType_SoloCompetitive", - 5: "k_EDOTAPlayerMMRType_1v1Competitive", -} -var EDOTAPlayerMMRType_value = map[string]int32{ - "k_EDOTAPlayerMMRType_Invalid": 0, - "k_EDOTAPlayerMMRType_GeneralHidden": 1, - "k_EDOTAPlayerMMRType_SoloHidden": 2, - "k_EDOTAPlayerMMRType_GeneralCompetitive": 3, - "k_EDOTAPlayerMMRType_SoloCompetitive": 4, - "k_EDOTAPlayerMMRType_1v1Competitive": 5, -} - -func (x EDOTAPlayerMMRType) Enum() *EDOTAPlayerMMRType { - p := new(EDOTAPlayerMMRType) - *p = x - return p -} -func (x EDOTAPlayerMMRType) String() string { - return proto.EnumName(EDOTAPlayerMMRType_name, int32(x)) -} -func (x *EDOTAPlayerMMRType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EDOTAPlayerMMRType_value, data, "EDOTAPlayerMMRType") - if err != nil { - return err - } - *x = EDOTAPlayerMMRType(value) - return nil -} -func (EDOTAPlayerMMRType) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{16} } - -type MatchType int32 - -const ( - MatchType_MATCH_TYPE_CASUAL MatchType = 0 - MatchType_MATCH_TYPE_COOP_BOTS MatchType = 1 - MatchType_MATCH_TYPE_TEAM_RANKED MatchType = 2 - MatchType_MATCH_TYPE_LEGACY_SOLO_QUEUE MatchType = 3 - MatchType_MATCH_TYPE_COMPETITIVE MatchType = 4 - MatchType_MATCH_TYPE_WEEKEND_TOURNEY MatchType = 5 - MatchType_MATCH_TYPE_CASUAL_1V1 MatchType = 6 - MatchType_MATCH_TYPE_EVENT MatchType = 7 -) - -var MatchType_name = map[int32]string{ - 0: "MATCH_TYPE_CASUAL", - 1: "MATCH_TYPE_COOP_BOTS", - 2: "MATCH_TYPE_TEAM_RANKED", - 3: "MATCH_TYPE_LEGACY_SOLO_QUEUE", - 4: "MATCH_TYPE_COMPETITIVE", - 5: "MATCH_TYPE_WEEKEND_TOURNEY", - 6: "MATCH_TYPE_CASUAL_1V1", - 7: "MATCH_TYPE_EVENT", -} -var MatchType_value = map[string]int32{ - "MATCH_TYPE_CASUAL": 0, - "MATCH_TYPE_COOP_BOTS": 1, - "MATCH_TYPE_TEAM_RANKED": 2, - "MATCH_TYPE_LEGACY_SOLO_QUEUE": 3, - "MATCH_TYPE_COMPETITIVE": 4, - "MATCH_TYPE_WEEKEND_TOURNEY": 5, - "MATCH_TYPE_CASUAL_1V1": 6, - "MATCH_TYPE_EVENT": 7, -} - -func (x MatchType) Enum() *MatchType { - p := new(MatchType) - *p = x - return p -} -func (x MatchType) String() string { - return proto.EnumName(MatchType_name, int32(x)) -} -func (x *MatchType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MatchType_value, data, "MatchType") - if err != nil { - return err - } - *x = MatchType(value) - return nil -} -func (MatchType) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{17} } - -type DOTABotDifficulty int32 - -const ( - DOTABotDifficulty_BOT_DIFFICULTY_PASSIVE DOTABotDifficulty = 0 - DOTABotDifficulty_BOT_DIFFICULTY_EASY DOTABotDifficulty = 1 - DOTABotDifficulty_BOT_DIFFICULTY_MEDIUM DOTABotDifficulty = 2 - DOTABotDifficulty_BOT_DIFFICULTY_HARD DOTABotDifficulty = 3 - DOTABotDifficulty_BOT_DIFFICULTY_UNFAIR DOTABotDifficulty = 4 - DOTABotDifficulty_BOT_DIFFICULTY_INVALID DOTABotDifficulty = 5 - DOTABotDifficulty_BOT_DIFFICULTY_EXTRA1 DOTABotDifficulty = 6 - DOTABotDifficulty_BOT_DIFFICULTY_EXTRA2 DOTABotDifficulty = 7 - DOTABotDifficulty_BOT_DIFFICULTY_EXTRA3 DOTABotDifficulty = 8 -) - -var DOTABotDifficulty_name = map[int32]string{ - 0: "BOT_DIFFICULTY_PASSIVE", - 1: "BOT_DIFFICULTY_EASY", - 2: "BOT_DIFFICULTY_MEDIUM", - 3: "BOT_DIFFICULTY_HARD", - 4: "BOT_DIFFICULTY_UNFAIR", - 5: "BOT_DIFFICULTY_INVALID", - 6: "BOT_DIFFICULTY_EXTRA1", - 7: "BOT_DIFFICULTY_EXTRA2", - 8: "BOT_DIFFICULTY_EXTRA3", -} -var DOTABotDifficulty_value = map[string]int32{ - "BOT_DIFFICULTY_PASSIVE": 0, - "BOT_DIFFICULTY_EASY": 1, - "BOT_DIFFICULTY_MEDIUM": 2, - "BOT_DIFFICULTY_HARD": 3, - "BOT_DIFFICULTY_UNFAIR": 4, - "BOT_DIFFICULTY_INVALID": 5, - "BOT_DIFFICULTY_EXTRA1": 6, - "BOT_DIFFICULTY_EXTRA2": 7, - "BOT_DIFFICULTY_EXTRA3": 8, -} - -func (x DOTABotDifficulty) Enum() *DOTABotDifficulty { - p := new(DOTABotDifficulty) - *p = x - return p -} -func (x DOTABotDifficulty) String() string { - return proto.EnumName(DOTABotDifficulty_name, int32(x)) -} -func (x *DOTABotDifficulty) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTABotDifficulty_value, data, "DOTABotDifficulty") - if err != nil { - return err - } - *x = DOTABotDifficulty(value) - return nil -} -func (DOTABotDifficulty) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{18} } - -type MatchLanguages int32 - -const ( - MatchLanguages_MATCH_LANGUAGE_INVALID MatchLanguages = 0 - MatchLanguages_MATCH_LANGUAGE_ENGLISH MatchLanguages = 1 - MatchLanguages_MATCH_LANGUAGE_RUSSIAN MatchLanguages = 2 - MatchLanguages_MATCH_LANGUAGE_CHINESE MatchLanguages = 3 - MatchLanguages_MATCH_LANGUAGE_KOREAN MatchLanguages = 4 - MatchLanguages_MATCH_LANGUAGE_SPANISH MatchLanguages = 5 - MatchLanguages_MATCH_LANGUAGE_PORTUGUESE MatchLanguages = 6 - MatchLanguages_MATCH_LANGUAGE_ENGLISH2 MatchLanguages = 7 -) - -var MatchLanguages_name = map[int32]string{ - 0: "MATCH_LANGUAGE_INVALID", - 1: "MATCH_LANGUAGE_ENGLISH", - 2: "MATCH_LANGUAGE_RUSSIAN", - 3: "MATCH_LANGUAGE_CHINESE", - 4: "MATCH_LANGUAGE_KOREAN", - 5: "MATCH_LANGUAGE_SPANISH", - 6: "MATCH_LANGUAGE_PORTUGUESE", - 7: "MATCH_LANGUAGE_ENGLISH2", -} -var MatchLanguages_value = map[string]int32{ - "MATCH_LANGUAGE_INVALID": 0, - "MATCH_LANGUAGE_ENGLISH": 1, - "MATCH_LANGUAGE_RUSSIAN": 2, - "MATCH_LANGUAGE_CHINESE": 3, - "MATCH_LANGUAGE_KOREAN": 4, - "MATCH_LANGUAGE_SPANISH": 5, - "MATCH_LANGUAGE_PORTUGUESE": 6, - "MATCH_LANGUAGE_ENGLISH2": 7, -} - -func (x MatchLanguages) Enum() *MatchLanguages { - p := new(MatchLanguages) - *p = x - return p -} -func (x MatchLanguages) String() string { - return proto.EnumName(MatchLanguages_name, int32(x)) -} -func (x *MatchLanguages) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(MatchLanguages_value, data, "MatchLanguages") - if err != nil { - return err - } - *x = MatchLanguages(value) - return nil -} -func (MatchLanguages) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{19} } - -type ETournamentTemplate int32 - -const ( - ETournamentTemplate_k_ETournamentTemplate_None ETournamentTemplate = 0 - ETournamentTemplate_k_ETournamentTemplate_SingleElimination ETournamentTemplate = 1 -) - -var ETournamentTemplate_name = map[int32]string{ - 0: "k_ETournamentTemplate_None", - 1: "k_ETournamentTemplate_SingleElimination", -} -var ETournamentTemplate_value = map[string]int32{ - "k_ETournamentTemplate_None": 0, - "k_ETournamentTemplate_SingleElimination": 1, -} - -func (x ETournamentTemplate) Enum() *ETournamentTemplate { - p := new(ETournamentTemplate) - *p = x - return p -} -func (x ETournamentTemplate) String() string { - return proto.EnumName(ETournamentTemplate_name, int32(x)) -} -func (x *ETournamentTemplate) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETournamentTemplate_value, data, "ETournamentTemplate") - if err != nil { - return err - } - *x = ETournamentTemplate(value) - return nil -} -func (ETournamentTemplate) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{20} } - -type ETournamentType int32 - -const ( - ETournamentType_k_ETournamentType_Unknown ETournamentType = 0 - ETournamentType_k_ETournamentType_WeeklyDivision ETournamentType = 1 -) - -var ETournamentType_name = map[int32]string{ - 0: "k_ETournamentType_Unknown", - 1: "k_ETournamentType_WeeklyDivision", -} -var ETournamentType_value = map[string]int32{ - "k_ETournamentType_Unknown": 0, - "k_ETournamentType_WeeklyDivision": 1, -} - -func (x ETournamentType) Enum() *ETournamentType { - p := new(ETournamentType) - *p = x - return p -} -func (x ETournamentType) String() string { - return proto.EnumName(ETournamentType_name, int32(x)) -} -func (x *ETournamentType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETournamentType_value, data, "ETournamentType") - if err != nil { - return err - } - *x = ETournamentType(value) - return nil -} -func (ETournamentType) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{21} } - -type EEvent int32 - -const ( - EEvent_EVENT_ID_NONE EEvent = 0 - EEvent_EVENT_ID_DIRETIDE EEvent = 1 - EEvent_EVENT_ID_SPRING_FESTIVAL EEvent = 2 - EEvent_EVENT_ID_FROSTIVUS_2013 EEvent = 3 - EEvent_EVENT_ID_COMPENDIUM_2014 EEvent = 4 - EEvent_EVENT_ID_NEXON_PC_BANG EEvent = 5 - EEvent_EVENT_ID_PWRD_DAC_2015 EEvent = 6 - EEvent_EVENT_ID_NEW_BLOOM_2015 EEvent = 7 - EEvent_EVENT_ID_INTERNATIONAL_2015 EEvent = 8 - EEvent_EVENT_ID_FALL_MAJOR_2015 EEvent = 9 - EEvent_EVENT_ID_ORACLE_PA EEvent = 10 - EEvent_EVENT_ID_NEW_BLOOM_2015_PREBEAST EEvent = 11 - EEvent_EVENT_ID_FROSTIVUS EEvent = 12 - EEvent_EVENT_ID_WINTER_MAJOR_2015 EEvent = 13 -) - -var EEvent_name = map[int32]string{ - 0: "EVENT_ID_NONE", - 1: "EVENT_ID_DIRETIDE", - 2: "EVENT_ID_SPRING_FESTIVAL", - 3: "EVENT_ID_FROSTIVUS_2013", - 4: "EVENT_ID_COMPENDIUM_2014", - 5: "EVENT_ID_NEXON_PC_BANG", - 6: "EVENT_ID_PWRD_DAC_2015", - 7: "EVENT_ID_NEW_BLOOM_2015", - 8: "EVENT_ID_INTERNATIONAL_2015", - 9: "EVENT_ID_FALL_MAJOR_2015", - 10: "EVENT_ID_ORACLE_PA", - 11: "EVENT_ID_NEW_BLOOM_2015_PREBEAST", - 12: "EVENT_ID_FROSTIVUS", - 13: "EVENT_ID_WINTER_MAJOR_2015", -} -var EEvent_value = map[string]int32{ - "EVENT_ID_NONE": 0, - "EVENT_ID_DIRETIDE": 1, - "EVENT_ID_SPRING_FESTIVAL": 2, - "EVENT_ID_FROSTIVUS_2013": 3, - "EVENT_ID_COMPENDIUM_2014": 4, - "EVENT_ID_NEXON_PC_BANG": 5, - "EVENT_ID_PWRD_DAC_2015": 6, - "EVENT_ID_NEW_BLOOM_2015": 7, - "EVENT_ID_INTERNATIONAL_2015": 8, - "EVENT_ID_FALL_MAJOR_2015": 9, - "EVENT_ID_ORACLE_PA": 10, - "EVENT_ID_NEW_BLOOM_2015_PREBEAST": 11, - "EVENT_ID_FROSTIVUS": 12, - "EVENT_ID_WINTER_MAJOR_2015": 13, -} - -func (x EEvent) Enum() *EEvent { - p := new(EEvent) - *p = x - return p -} -func (x EEvent) String() string { - return proto.EnumName(EEvent_name, int32(x)) -} -func (x *EEvent) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EEvent_value, data, "EEvent") - if err != nil { - return err - } - *x = EEvent(value) - return nil -} -func (EEvent) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{22} } - -type LobbyDotaTVDelay int32 - -const ( - LobbyDotaTVDelay_LobbyDotaTV_10 LobbyDotaTVDelay = 0 - LobbyDotaTVDelay_LobbyDotaTV_120 LobbyDotaTVDelay = 1 - LobbyDotaTVDelay_LobbyDotaTV_300 LobbyDotaTVDelay = 2 -) - -var LobbyDotaTVDelay_name = map[int32]string{ - 0: "LobbyDotaTV_10", - 1: "LobbyDotaTV_120", - 2: "LobbyDotaTV_300", -} -var LobbyDotaTVDelay_value = map[string]int32{ - "LobbyDotaTV_10": 0, - "LobbyDotaTV_120": 1, - "LobbyDotaTV_300": 2, -} - -func (x LobbyDotaTVDelay) Enum() *LobbyDotaTVDelay { - p := new(LobbyDotaTVDelay) - *p = x - return p -} -func (x LobbyDotaTVDelay) String() string { - return proto.EnumName(LobbyDotaTVDelay_name, int32(x)) -} -func (x *LobbyDotaTVDelay) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(LobbyDotaTVDelay_value, data, "LobbyDotaTVDelay") - if err != nil { - return err - } - *x = LobbyDotaTVDelay(value) - return nil -} -func (LobbyDotaTVDelay) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{23} } - -type LobbyDotaPauseSetting int32 - -const ( - LobbyDotaPauseSetting_LobbyDotaPauseSetting_Unlimited LobbyDotaPauseSetting = 0 - LobbyDotaPauseSetting_LobbyDotaPauseSetting_Limited LobbyDotaPauseSetting = 1 - LobbyDotaPauseSetting_LobbyDotaPauseSetting_Disabled LobbyDotaPauseSetting = 2 -) - -var LobbyDotaPauseSetting_name = map[int32]string{ - 0: "LobbyDotaPauseSetting_Unlimited", - 1: "LobbyDotaPauseSetting_Limited", - 2: "LobbyDotaPauseSetting_Disabled", -} -var LobbyDotaPauseSetting_value = map[string]int32{ - "LobbyDotaPauseSetting_Unlimited": 0, - "LobbyDotaPauseSetting_Limited": 1, - "LobbyDotaPauseSetting_Disabled": 2, -} - -func (x LobbyDotaPauseSetting) Enum() *LobbyDotaPauseSetting { - p := new(LobbyDotaPauseSetting) - *p = x - return p -} -func (x LobbyDotaPauseSetting) String() string { - return proto.EnumName(LobbyDotaPauseSetting_name, int32(x)) -} -func (x *LobbyDotaPauseSetting) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(LobbyDotaPauseSetting_value, data, "LobbyDotaPauseSetting") - if err != nil { - return err - } - *x = LobbyDotaPauseSetting(value) - return nil -} -func (LobbyDotaPauseSetting) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{24} } - -type EMatchOutcome int32 - -const ( - EMatchOutcome_k_EMatchOutcome_Unknown EMatchOutcome = 0 - EMatchOutcome_k_EMatchOutcome_RadVictory EMatchOutcome = 2 - EMatchOutcome_k_EMatchOutcome_DireVictory EMatchOutcome = 3 - EMatchOutcome_k_EMatchOutcome_NotScored_PoorNetworkConditions EMatchOutcome = 64 - EMatchOutcome_k_EMatchOutcome_NotScored_Leaver EMatchOutcome = 65 - EMatchOutcome_k_EMatchOutcome_NotScored_ServerCrash EMatchOutcome = 66 - EMatchOutcome_k_EMatchOutcome_NotScored_NeverStarted EMatchOutcome = 67 -) - -var EMatchOutcome_name = map[int32]string{ - 0: "k_EMatchOutcome_Unknown", - 2: "k_EMatchOutcome_RadVictory", - 3: "k_EMatchOutcome_DireVictory", - 64: "k_EMatchOutcome_NotScored_PoorNetworkConditions", - 65: "k_EMatchOutcome_NotScored_Leaver", - 66: "k_EMatchOutcome_NotScored_ServerCrash", - 67: "k_EMatchOutcome_NotScored_NeverStarted", -} -var EMatchOutcome_value = map[string]int32{ - "k_EMatchOutcome_Unknown": 0, - "k_EMatchOutcome_RadVictory": 2, - "k_EMatchOutcome_DireVictory": 3, - "k_EMatchOutcome_NotScored_PoorNetworkConditions": 64, - "k_EMatchOutcome_NotScored_Leaver": 65, - "k_EMatchOutcome_NotScored_ServerCrash": 66, - "k_EMatchOutcome_NotScored_NeverStarted": 67, -} - -func (x EMatchOutcome) Enum() *EMatchOutcome { - p := new(EMatchOutcome) - *p = x - return p -} -func (x EMatchOutcome) String() string { - return proto.EnumName(EMatchOutcome_name, int32(x)) -} -func (x *EMatchOutcome) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EMatchOutcome_value, data, "EMatchOutcome") - if err != nil { - return err - } - *x = EMatchOutcome(value) - return nil -} -func (EMatchOutcome) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{25} } - -type EDOTAGCSessionNeed int32 - -const ( - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_Unknown EDOTAGCSessionNeed = 0 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserNoSessionNeeded EDOTAGCSessionNeed = 100 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserInOnlineGame EDOTAGCSessionNeed = 101 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserInLocalGame EDOTAGCSessionNeed = 102 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserInUIWasConnected EDOTAGCSessionNeed = 103 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserInUINeverConnected EDOTAGCSessionNeed = 104 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserTutorials EDOTAGCSessionNeed = 105 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserInUIWasConnectedIdle EDOTAGCSessionNeed = 106 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_UserInUINeverConnectedIdle EDOTAGCSessionNeed = 107 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_GameServerOnline EDOTAGCSessionNeed = 200 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_GameServerLocal EDOTAGCSessionNeed = 201 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_GameServerIdle EDOTAGCSessionNeed = 202 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_GameServerRelay EDOTAGCSessionNeed = 203 - EDOTAGCSessionNeed_k_EDOTAGCSessionNeed_GameServerLocalUpload EDOTAGCSessionNeed = 204 -) - -var EDOTAGCSessionNeed_name = map[int32]string{ - 0: "k_EDOTAGCSessionNeed_Unknown", - 100: "k_EDOTAGCSessionNeed_UserNoSessionNeeded", - 101: "k_EDOTAGCSessionNeed_UserInOnlineGame", - 102: "k_EDOTAGCSessionNeed_UserInLocalGame", - 103: "k_EDOTAGCSessionNeed_UserInUIWasConnected", - 104: "k_EDOTAGCSessionNeed_UserInUINeverConnected", - 105: "k_EDOTAGCSessionNeed_UserTutorials", - 106: "k_EDOTAGCSessionNeed_UserInUIWasConnectedIdle", - 107: "k_EDOTAGCSessionNeed_UserInUINeverConnectedIdle", - 200: "k_EDOTAGCSessionNeed_GameServerOnline", - 201: "k_EDOTAGCSessionNeed_GameServerLocal", - 202: "k_EDOTAGCSessionNeed_GameServerIdle", - 203: "k_EDOTAGCSessionNeed_GameServerRelay", - 204: "k_EDOTAGCSessionNeed_GameServerLocalUpload", -} -var EDOTAGCSessionNeed_value = map[string]int32{ - "k_EDOTAGCSessionNeed_Unknown": 0, - "k_EDOTAGCSessionNeed_UserNoSessionNeeded": 100, - "k_EDOTAGCSessionNeed_UserInOnlineGame": 101, - "k_EDOTAGCSessionNeed_UserInLocalGame": 102, - "k_EDOTAGCSessionNeed_UserInUIWasConnected": 103, - "k_EDOTAGCSessionNeed_UserInUINeverConnected": 104, - "k_EDOTAGCSessionNeed_UserTutorials": 105, - "k_EDOTAGCSessionNeed_UserInUIWasConnectedIdle": 106, - "k_EDOTAGCSessionNeed_UserInUINeverConnectedIdle": 107, - "k_EDOTAGCSessionNeed_GameServerOnline": 200, - "k_EDOTAGCSessionNeed_GameServerLocal": 201, - "k_EDOTAGCSessionNeed_GameServerIdle": 202, - "k_EDOTAGCSessionNeed_GameServerRelay": 203, - "k_EDOTAGCSessionNeed_GameServerLocalUpload": 204, -} - -func (x EDOTAGCSessionNeed) Enum() *EDOTAGCSessionNeed { - p := new(EDOTAGCSessionNeed) - *p = x - return p -} -func (x EDOTAGCSessionNeed) String() string { - return proto.EnumName(EDOTAGCSessionNeed_name, int32(x)) -} -func (x *EDOTAGCSessionNeed) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EDOTAGCSessionNeed_value, data, "EDOTAGCSessionNeed") - if err != nil { - return err - } - *x = EDOTAGCSessionNeed(value) - return nil -} -func (EDOTAGCSessionNeed) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{26} } - -type Fantasy_Roles int32 - -const ( - Fantasy_Roles_FANTASY_ROLE_UNDEFINED Fantasy_Roles = 0 - Fantasy_Roles_FANTASY_ROLE_CORE Fantasy_Roles = 1 - Fantasy_Roles_FANTASY_ROLE_SUPPORT Fantasy_Roles = 2 -) - -var Fantasy_Roles_name = map[int32]string{ - 0: "FANTASY_ROLE_UNDEFINED", - 1: "FANTASY_ROLE_CORE", - 2: "FANTASY_ROLE_SUPPORT", -} -var Fantasy_Roles_value = map[string]int32{ - "FANTASY_ROLE_UNDEFINED": 0, - "FANTASY_ROLE_CORE": 1, - "FANTASY_ROLE_SUPPORT": 2, -} - -func (x Fantasy_Roles) Enum() *Fantasy_Roles { - p := new(Fantasy_Roles) - *p = x - return p -} -func (x Fantasy_Roles) String() string { - return proto.EnumName(Fantasy_Roles_name, int32(x)) -} -func (x *Fantasy_Roles) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Fantasy_Roles_value, data, "Fantasy_Roles") - if err != nil { - return err - } - *x = Fantasy_Roles(value) - return nil -} -func (Fantasy_Roles) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{27} } - -type Fantasy_Team_Slots int32 - -const ( - Fantasy_Team_Slots_FANTASY_SLOT_NONE Fantasy_Team_Slots = 0 - Fantasy_Team_Slots_FANTASY_SLOT_CORE Fantasy_Team_Slots = 1 - Fantasy_Team_Slots_FANTASY_SLOT_SUPPORT Fantasy_Team_Slots = 2 - Fantasy_Team_Slots_FANTASY_SLOT_ANY Fantasy_Team_Slots = 3 - Fantasy_Team_Slots_FANTASY_SLOT_BENCH Fantasy_Team_Slots = 4 -) - -var Fantasy_Team_Slots_name = map[int32]string{ - 0: "FANTASY_SLOT_NONE", - 1: "FANTASY_SLOT_CORE", - 2: "FANTASY_SLOT_SUPPORT", - 3: "FANTASY_SLOT_ANY", - 4: "FANTASY_SLOT_BENCH", -} -var Fantasy_Team_Slots_value = map[string]int32{ - "FANTASY_SLOT_NONE": 0, - "FANTASY_SLOT_CORE": 1, - "FANTASY_SLOT_SUPPORT": 2, - "FANTASY_SLOT_ANY": 3, - "FANTASY_SLOT_BENCH": 4, -} - -func (x Fantasy_Team_Slots) Enum() *Fantasy_Team_Slots { - p := new(Fantasy_Team_Slots) - *p = x - return p -} -func (x Fantasy_Team_Slots) String() string { - return proto.EnumName(Fantasy_Team_Slots_name, int32(x)) -} -func (x *Fantasy_Team_Slots) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Fantasy_Team_Slots_value, data, "Fantasy_Team_Slots") - if err != nil { - return err - } - *x = Fantasy_Team_Slots(value) - return nil -} -func (Fantasy_Team_Slots) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{28} } - -type Fantasy_Selection_Mode int32 - -const ( - Fantasy_Selection_Mode_FANTASY_SELECTION_INVALID Fantasy_Selection_Mode = 0 - Fantasy_Selection_Mode_FANTASY_SELECTION_LOCKED Fantasy_Selection_Mode = 1 - Fantasy_Selection_Mode_FANTASY_SELECTION_SHUFFLE Fantasy_Selection_Mode = 2 - Fantasy_Selection_Mode_FANTASY_SELECTION_FREE_PICK Fantasy_Selection_Mode = 3 - Fantasy_Selection_Mode_FANTASY_SELECTION_ENDED Fantasy_Selection_Mode = 4 - Fantasy_Selection_Mode_FANTASY_SELECTION_PRE_SEASON Fantasy_Selection_Mode = 5 - Fantasy_Selection_Mode_FANTASY_SELECTION_PRE_DRAFT Fantasy_Selection_Mode = 6 - Fantasy_Selection_Mode_FANTASY_SELECTION_DRAFTING Fantasy_Selection_Mode = 7 - Fantasy_Selection_Mode_FANTASY_SELECTION_REGULAR_SEASON Fantasy_Selection_Mode = 8 -) - -var Fantasy_Selection_Mode_name = map[int32]string{ - 0: "FANTASY_SELECTION_INVALID", - 1: "FANTASY_SELECTION_LOCKED", - 2: "FANTASY_SELECTION_SHUFFLE", - 3: "FANTASY_SELECTION_FREE_PICK", - 4: "FANTASY_SELECTION_ENDED", - 5: "FANTASY_SELECTION_PRE_SEASON", - 6: "FANTASY_SELECTION_PRE_DRAFT", - 7: "FANTASY_SELECTION_DRAFTING", - 8: "FANTASY_SELECTION_REGULAR_SEASON", -} -var Fantasy_Selection_Mode_value = map[string]int32{ - "FANTASY_SELECTION_INVALID": 0, - "FANTASY_SELECTION_LOCKED": 1, - "FANTASY_SELECTION_SHUFFLE": 2, - "FANTASY_SELECTION_FREE_PICK": 3, - "FANTASY_SELECTION_ENDED": 4, - "FANTASY_SELECTION_PRE_SEASON": 5, - "FANTASY_SELECTION_PRE_DRAFT": 6, - "FANTASY_SELECTION_DRAFTING": 7, - "FANTASY_SELECTION_REGULAR_SEASON": 8, -} - -func (x Fantasy_Selection_Mode) Enum() *Fantasy_Selection_Mode { - p := new(Fantasy_Selection_Mode) - *p = x - return p -} -func (x Fantasy_Selection_Mode) String() string { - return proto.EnumName(Fantasy_Selection_Mode_name, int32(x)) -} -func (x *Fantasy_Selection_Mode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Fantasy_Selection_Mode_value, data, "Fantasy_Selection_Mode") - if err != nil { - return err - } - *x = Fantasy_Selection_Mode(value) - return nil -} -func (Fantasy_Selection_Mode) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{29} } - -type DOTA_TournamentEvents int32 - -const ( - DOTA_TournamentEvents_TE_FIRST_BLOOD DOTA_TournamentEvents = 0 - DOTA_TournamentEvents_TE_GAME_END DOTA_TournamentEvents = 1 - DOTA_TournamentEvents_TE_MULTI_KILL DOTA_TournamentEvents = 2 - DOTA_TournamentEvents_TE_HERO_DENY DOTA_TournamentEvents = 3 - DOTA_TournamentEvents_TE_AEGIS_DENY DOTA_TournamentEvents = 4 - DOTA_TournamentEvents_TE_AEGIS_STOLEN DOTA_TournamentEvents = 5 - DOTA_TournamentEvents_TE_GODLIKE DOTA_TournamentEvents = 6 - DOTA_TournamentEvents_TE_COURIER_KILL DOTA_TournamentEvents = 7 - DOTA_TournamentEvents_TE_ECHOSLAM DOTA_TournamentEvents = 8 - DOTA_TournamentEvents_TE_RAPIER DOTA_TournamentEvents = 9 - DOTA_TournamentEvents_TE_EARLY_ROSHAN DOTA_TournamentEvents = 10 - DOTA_TournamentEvents_TE_BLACK_HOLE DOTA_TournamentEvents = 11 -) - -var DOTA_TournamentEvents_name = map[int32]string{ - 0: "TE_FIRST_BLOOD", - 1: "TE_GAME_END", - 2: "TE_MULTI_KILL", - 3: "TE_HERO_DENY", - 4: "TE_AEGIS_DENY", - 5: "TE_AEGIS_STOLEN", - 6: "TE_GODLIKE", - 7: "TE_COURIER_KILL", - 8: "TE_ECHOSLAM", - 9: "TE_RAPIER", - 10: "TE_EARLY_ROSHAN", - 11: "TE_BLACK_HOLE", -} -var DOTA_TournamentEvents_value = map[string]int32{ - "TE_FIRST_BLOOD": 0, - "TE_GAME_END": 1, - "TE_MULTI_KILL": 2, - "TE_HERO_DENY": 3, - "TE_AEGIS_DENY": 4, - "TE_AEGIS_STOLEN": 5, - "TE_GODLIKE": 6, - "TE_COURIER_KILL": 7, - "TE_ECHOSLAM": 8, - "TE_RAPIER": 9, - "TE_EARLY_ROSHAN": 10, - "TE_BLACK_HOLE": 11, -} - -func (x DOTA_TournamentEvents) Enum() *DOTA_TournamentEvents { - p := new(DOTA_TournamentEvents) - *p = x - return p -} -func (x DOTA_TournamentEvents) String() string { - return proto.EnumName(DOTA_TournamentEvents_name, int32(x)) -} -func (x *DOTA_TournamentEvents) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_TournamentEvents_value, data, "DOTA_TournamentEvents") - if err != nil { - return err - } - *x = DOTA_TournamentEvents(value) - return nil -} -func (DOTA_TournamentEvents) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{30} } - -type DOTA_COMBATLOG_TYPES int32 - -const ( - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_DAMAGE DOTA_COMBATLOG_TYPES = 0 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_HEAL DOTA_COMBATLOG_TYPES = 1 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_MODIFIER_ADD DOTA_COMBATLOG_TYPES = 2 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_MODIFIER_REMOVE DOTA_COMBATLOG_TYPES = 3 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_DEATH DOTA_COMBATLOG_TYPES = 4 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_ABILITY DOTA_COMBATLOG_TYPES = 5 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_ITEM DOTA_COMBATLOG_TYPES = 6 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_LOCATION DOTA_COMBATLOG_TYPES = 7 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_GOLD DOTA_COMBATLOG_TYPES = 8 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_GAME_STATE DOTA_COMBATLOG_TYPES = 9 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_XP DOTA_COMBATLOG_TYPES = 10 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_PURCHASE DOTA_COMBATLOG_TYPES = 11 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_BUYBACK DOTA_COMBATLOG_TYPES = 12 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_ABILITY_TRIGGER DOTA_COMBATLOG_TYPES = 13 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_PLAYERSTATS DOTA_COMBATLOG_TYPES = 14 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_MULTIKILL DOTA_COMBATLOG_TYPES = 15 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_KILLSTREAK DOTA_COMBATLOG_TYPES = 16 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_TEAM_BUILDING_KILL DOTA_COMBATLOG_TYPES = 17 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_FIRST_BLOOD DOTA_COMBATLOG_TYPES = 18 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_MODIFIER_REFRESH DOTA_COMBATLOG_TYPES = 19 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_NEUTRAL_CAMP_STACK DOTA_COMBATLOG_TYPES = 20 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_PICKUP_RUNE DOTA_COMBATLOG_TYPES = 21 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_REVEALED_INVISIBLE DOTA_COMBATLOG_TYPES = 22 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_HERO_SAVED DOTA_COMBATLOG_TYPES = 23 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_MANA_RESTORED DOTA_COMBATLOG_TYPES = 24 - DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_HERO_LEVELUP DOTA_COMBATLOG_TYPES = 25 -) - -var DOTA_COMBATLOG_TYPES_name = map[int32]string{ - 0: "DOTA_COMBATLOG_DAMAGE", - 1: "DOTA_COMBATLOG_HEAL", - 2: "DOTA_COMBATLOG_MODIFIER_ADD", - 3: "DOTA_COMBATLOG_MODIFIER_REMOVE", - 4: "DOTA_COMBATLOG_DEATH", - 5: "DOTA_COMBATLOG_ABILITY", - 6: "DOTA_COMBATLOG_ITEM", - 7: "DOTA_COMBATLOG_LOCATION", - 8: "DOTA_COMBATLOG_GOLD", - 9: "DOTA_COMBATLOG_GAME_STATE", - 10: "DOTA_COMBATLOG_XP", - 11: "DOTA_COMBATLOG_PURCHASE", - 12: "DOTA_COMBATLOG_BUYBACK", - 13: "DOTA_COMBATLOG_ABILITY_TRIGGER", - 14: "DOTA_COMBATLOG_PLAYERSTATS", - 15: "DOTA_COMBATLOG_MULTIKILL", - 16: "DOTA_COMBATLOG_KILLSTREAK", - 17: "DOTA_COMBATLOG_TEAM_BUILDING_KILL", - 18: "DOTA_COMBATLOG_FIRST_BLOOD", - 19: "DOTA_COMBATLOG_MODIFIER_REFRESH", - 20: "DOTA_COMBATLOG_NEUTRAL_CAMP_STACK", - 21: "DOTA_COMBATLOG_PICKUP_RUNE", - 22: "DOTA_COMBATLOG_REVEALED_INVISIBLE", - 23: "DOTA_COMBATLOG_HERO_SAVED", - 24: "DOTA_COMBATLOG_MANA_RESTORED", - 25: "DOTA_COMBATLOG_HERO_LEVELUP", -} -var DOTA_COMBATLOG_TYPES_value = map[string]int32{ - "DOTA_COMBATLOG_DAMAGE": 0, - "DOTA_COMBATLOG_HEAL": 1, - "DOTA_COMBATLOG_MODIFIER_ADD": 2, - "DOTA_COMBATLOG_MODIFIER_REMOVE": 3, - "DOTA_COMBATLOG_DEATH": 4, - "DOTA_COMBATLOG_ABILITY": 5, - "DOTA_COMBATLOG_ITEM": 6, - "DOTA_COMBATLOG_LOCATION": 7, - "DOTA_COMBATLOG_GOLD": 8, - "DOTA_COMBATLOG_GAME_STATE": 9, - "DOTA_COMBATLOG_XP": 10, - "DOTA_COMBATLOG_PURCHASE": 11, - "DOTA_COMBATLOG_BUYBACK": 12, - "DOTA_COMBATLOG_ABILITY_TRIGGER": 13, - "DOTA_COMBATLOG_PLAYERSTATS": 14, - "DOTA_COMBATLOG_MULTIKILL": 15, - "DOTA_COMBATLOG_KILLSTREAK": 16, - "DOTA_COMBATLOG_TEAM_BUILDING_KILL": 17, - "DOTA_COMBATLOG_FIRST_BLOOD": 18, - "DOTA_COMBATLOG_MODIFIER_REFRESH": 19, - "DOTA_COMBATLOG_NEUTRAL_CAMP_STACK": 20, - "DOTA_COMBATLOG_PICKUP_RUNE": 21, - "DOTA_COMBATLOG_REVEALED_INVISIBLE": 22, - "DOTA_COMBATLOG_HERO_SAVED": 23, - "DOTA_COMBATLOG_MANA_RESTORED": 24, - "DOTA_COMBATLOG_HERO_LEVELUP": 25, -} - -func (x DOTA_COMBATLOG_TYPES) Enum() *DOTA_COMBATLOG_TYPES { - p := new(DOTA_COMBATLOG_TYPES) - *p = x - return p -} -func (x DOTA_COMBATLOG_TYPES) String() string { - return proto.EnumName(DOTA_COMBATLOG_TYPES_name, int32(x)) -} -func (x *DOTA_COMBATLOG_TYPES) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTA_COMBATLOG_TYPES_value, data, "DOTA_COMBATLOG_TYPES") - if err != nil { - return err - } - *x = DOTA_COMBATLOG_TYPES(value) - return nil -} -func (DOTA_COMBATLOG_TYPES) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{31} } - -type DOTAChatChannelTypeT int32 - -const ( - DOTAChatChannelTypeT_DOTAChannelType_Regional DOTAChatChannelTypeT = 0 - DOTAChatChannelTypeT_DOTAChannelType_Custom DOTAChatChannelTypeT = 1 - DOTAChatChannelTypeT_DOTAChannelType_Party DOTAChatChannelTypeT = 2 - DOTAChatChannelTypeT_DOTAChannelType_Lobby DOTAChatChannelTypeT = 3 - DOTAChatChannelTypeT_DOTAChannelType_Team DOTAChatChannelTypeT = 4 - DOTAChatChannelTypeT_DOTAChannelType_Guild DOTAChatChannelTypeT = 5 - DOTAChatChannelTypeT_DOTAChannelType_Fantasy DOTAChatChannelTypeT = 6 - DOTAChatChannelTypeT_DOTAChannelType_Whisper DOTAChatChannelTypeT = 7 - DOTAChatChannelTypeT_DOTAChannelType_Console DOTAChatChannelTypeT = 8 - DOTAChatChannelTypeT_DOTAChannelType_Tab DOTAChatChannelTypeT = 9 - DOTAChatChannelTypeT_DOTAChannelType_Invalid DOTAChatChannelTypeT = 10 - DOTAChatChannelTypeT_DOTAChannelType_GameAll DOTAChatChannelTypeT = 11 - DOTAChatChannelTypeT_DOTAChannelType_GameAllies DOTAChatChannelTypeT = 12 - DOTAChatChannelTypeT_DOTAChannelType_GameSpectator DOTAChatChannelTypeT = 13 - DOTAChatChannelTypeT_DOTAChannelType_GameCoaching DOTAChatChannelTypeT = 14 - DOTAChatChannelTypeT_DOTAChannelType_Cafe DOTAChatChannelTypeT = 15 - DOTAChatChannelTypeT_DOTAChannelType_CustomGame DOTAChatChannelTypeT = 16 - DOTAChatChannelTypeT_DOTAChannelType_Private DOTAChatChannelTypeT = 17 -) - -var DOTAChatChannelTypeT_name = map[int32]string{ - 0: "DOTAChannelType_Regional", - 1: "DOTAChannelType_Custom", - 2: "DOTAChannelType_Party", - 3: "DOTAChannelType_Lobby", - 4: "DOTAChannelType_Team", - 5: "DOTAChannelType_Guild", - 6: "DOTAChannelType_Fantasy", - 7: "DOTAChannelType_Whisper", - 8: "DOTAChannelType_Console", - 9: "DOTAChannelType_Tab", - 10: "DOTAChannelType_Invalid", - 11: "DOTAChannelType_GameAll", - 12: "DOTAChannelType_GameAllies", - 13: "DOTAChannelType_GameSpectator", - 14: "DOTAChannelType_GameCoaching", - 15: "DOTAChannelType_Cafe", - 16: "DOTAChannelType_CustomGame", - 17: "DOTAChannelType_Private", -} -var DOTAChatChannelTypeT_value = map[string]int32{ - "DOTAChannelType_Regional": 0, - "DOTAChannelType_Custom": 1, - "DOTAChannelType_Party": 2, - "DOTAChannelType_Lobby": 3, - "DOTAChannelType_Team": 4, - "DOTAChannelType_Guild": 5, - "DOTAChannelType_Fantasy": 6, - "DOTAChannelType_Whisper": 7, - "DOTAChannelType_Console": 8, - "DOTAChannelType_Tab": 9, - "DOTAChannelType_Invalid": 10, - "DOTAChannelType_GameAll": 11, - "DOTAChannelType_GameAllies": 12, - "DOTAChannelType_GameSpectator": 13, - "DOTAChannelType_GameCoaching": 14, - "DOTAChannelType_Cafe": 15, - "DOTAChannelType_CustomGame": 16, - "DOTAChannelType_Private": 17, -} - -func (x DOTAChatChannelTypeT) Enum() *DOTAChatChannelTypeT { - p := new(DOTAChatChannelTypeT) - *p = x - return p -} -func (x DOTAChatChannelTypeT) String() string { - return proto.EnumName(DOTAChatChannelTypeT_name, int32(x)) -} -func (x *DOTAChatChannelTypeT) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DOTAChatChannelTypeT_value, data, "DOTAChatChannelTypeT") - if err != nil { - return err - } - *x = DOTAChatChannelTypeT(value) - return nil -} -func (DOTAChatChannelTypeT) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{32} } - -type CSODOTAParty_State int32 - -const ( - CSODOTAParty_UI CSODOTAParty_State = 0 - CSODOTAParty_FINDING_MATCH CSODOTAParty_State = 1 - CSODOTAParty_IN_MATCH CSODOTAParty_State = 2 -) - -var CSODOTAParty_State_name = map[int32]string{ - 0: "UI", - 1: "FINDING_MATCH", - 2: "IN_MATCH", -} -var CSODOTAParty_State_value = map[string]int32{ - "UI": 0, - "FINDING_MATCH": 1, - "IN_MATCH": 2, -} - -func (x CSODOTAParty_State) Enum() *CSODOTAParty_State { - p := new(CSODOTAParty_State) - *p = x - return p -} -func (x CSODOTAParty_State) String() string { - return proto.EnumName(CSODOTAParty_State_name, int32(x)) -} -func (x *CSODOTAParty_State) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSODOTAParty_State_value, data, "CSODOTAParty_State") - if err != nil { - return err - } - *x = CSODOTAParty_State(value) - return nil -} -func (CSODOTAParty_State) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{2, 0} } - -type CSODOTALobby_State int32 - -const ( - CSODOTALobby_UI CSODOTALobby_State = 0 - CSODOTALobby_READYUP CSODOTALobby_State = 4 - CSODOTALobby_SERVERSETUP CSODOTALobby_State = 1 - CSODOTALobby_RUN CSODOTALobby_State = 2 - CSODOTALobby_POSTGAME CSODOTALobby_State = 3 - CSODOTALobby_NOTREADY CSODOTALobby_State = 5 - CSODOTALobby_SERVERASSIGN CSODOTALobby_State = 6 -) - -var CSODOTALobby_State_name = map[int32]string{ - 0: "UI", - 4: "READYUP", - 1: "SERVERSETUP", - 2: "RUN", - 3: "POSTGAME", - 5: "NOTREADY", - 6: "SERVERASSIGN", -} -var CSODOTALobby_State_value = map[string]int32{ - "UI": 0, - "READYUP": 4, - "SERVERSETUP": 1, - "RUN": 2, - "POSTGAME": 3, - "NOTREADY": 5, - "SERVERASSIGN": 6, -} - -func (x CSODOTALobby_State) Enum() *CSODOTALobby_State { - p := new(CSODOTALobby_State) - *p = x - return p -} -func (x CSODOTALobby_State) String() string { - return proto.EnumName(CSODOTALobby_State_name, int32(x)) -} -func (x *CSODOTALobby_State) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSODOTALobby_State_value, data, "CSODOTALobby_State") - if err != nil { - return err - } - *x = CSODOTALobby_State(value) - return nil -} -func (CSODOTALobby_State) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{12, 0} } - -type CSODOTALobby_LobbyType int32 - -const ( - CSODOTALobby_INVALID CSODOTALobby_LobbyType = -1 - CSODOTALobby_CASUAL_MATCH CSODOTALobby_LobbyType = 0 - CSODOTALobby_PRACTICE CSODOTALobby_LobbyType = 1 - CSODOTALobby_TOURNAMENT CSODOTALobby_LobbyType = 2 - CSODOTALobby_COOP_BOT_MATCH CSODOTALobby_LobbyType = 4 - CSODOTALobby_LEGACY_TEAM_MATCH CSODOTALobby_LobbyType = 5 - CSODOTALobby_LEGACY_SOLO_QUEUE_MATCH CSODOTALobby_LobbyType = 6 - CSODOTALobby_COMPETITIVE_MATCH CSODOTALobby_LobbyType = 7 - CSODOTALobby_CASUAL_1V1_MATCH CSODOTALobby_LobbyType = 8 - CSODOTALobby_WEEKEND_TOURNEY CSODOTALobby_LobbyType = 9 - CSODOTALobby_LOCAL_BOT_MATCH CSODOTALobby_LobbyType = 10 -) - -var CSODOTALobby_LobbyType_name = map[int32]string{ - -1: "INVALID", - 0: "CASUAL_MATCH", - 1: "PRACTICE", - 2: "TOURNAMENT", - 4: "COOP_BOT_MATCH", - 5: "LEGACY_TEAM_MATCH", - 6: "LEGACY_SOLO_QUEUE_MATCH", - 7: "COMPETITIVE_MATCH", - 8: "CASUAL_1V1_MATCH", - 9: "WEEKEND_TOURNEY", - 10: "LOCAL_BOT_MATCH", -} -var CSODOTALobby_LobbyType_value = map[string]int32{ - "INVALID": -1, - "CASUAL_MATCH": 0, - "PRACTICE": 1, - "TOURNAMENT": 2, - "COOP_BOT_MATCH": 4, - "LEGACY_TEAM_MATCH": 5, - "LEGACY_SOLO_QUEUE_MATCH": 6, - "COMPETITIVE_MATCH": 7, - "CASUAL_1V1_MATCH": 8, - "WEEKEND_TOURNEY": 9, - "LOCAL_BOT_MATCH": 10, -} - -func (x CSODOTALobby_LobbyType) Enum() *CSODOTALobby_LobbyType { - p := new(CSODOTALobby_LobbyType) - *p = x - return p -} -func (x CSODOTALobby_LobbyType) String() string { - return proto.EnumName(CSODOTALobby_LobbyType_name, int32(x)) -} -func (x *CSODOTALobby_LobbyType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSODOTALobby_LobbyType_value, data, "CSODOTALobby_LobbyType") - if err != nil { - return err - } - *x = CSODOTALobby_LobbyType(value) - return nil -} -func (CSODOTALobby_LobbyType) EnumDescriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{12, 1} } - -type CMsgPerfectWorldUserLookupResponse_EResultCode int32 - -const ( - CMsgPerfectWorldUserLookupResponse_SUCCESS_ACCOUNT_FOUND CMsgPerfectWorldUserLookupResponse_EResultCode = 0 - CMsgPerfectWorldUserLookupResponse_ERROR_UNKNOWN CMsgPerfectWorldUserLookupResponse_EResultCode = 1 - CMsgPerfectWorldUserLookupResponse_ERROR_USER_NAME_WRONG_FORMAT CMsgPerfectWorldUserLookupResponse_EResultCode = 2 - CMsgPerfectWorldUserLookupResponse_ERROR_NO_PERFECT_WORLD_ACCOUNT_FOUND CMsgPerfectWorldUserLookupResponse_EResultCode = 3 - CMsgPerfectWorldUserLookupResponse_ERROR_NO_LINKED_STEAM_ACCOUNT_FOUND CMsgPerfectWorldUserLookupResponse_EResultCode = 4 -) - -var CMsgPerfectWorldUserLookupResponse_EResultCode_name = map[int32]string{ - 0: "SUCCESS_ACCOUNT_FOUND", - 1: "ERROR_UNKNOWN", - 2: "ERROR_USER_NAME_WRONG_FORMAT", - 3: "ERROR_NO_PERFECT_WORLD_ACCOUNT_FOUND", - 4: "ERROR_NO_LINKED_STEAM_ACCOUNT_FOUND", -} -var CMsgPerfectWorldUserLookupResponse_EResultCode_value = map[string]int32{ - "SUCCESS_ACCOUNT_FOUND": 0, - "ERROR_UNKNOWN": 1, - "ERROR_USER_NAME_WRONG_FORMAT": 2, - "ERROR_NO_PERFECT_WORLD_ACCOUNT_FOUND": 3, - "ERROR_NO_LINKED_STEAM_ACCOUNT_FOUND": 4, -} - -func (x CMsgPerfectWorldUserLookupResponse_EResultCode) Enum() *CMsgPerfectWorldUserLookupResponse_EResultCode { - p := new(CMsgPerfectWorldUserLookupResponse_EResultCode) - *p = x - return p -} -func (x CMsgPerfectWorldUserLookupResponse_EResultCode) String() string { - return proto.EnumName(CMsgPerfectWorldUserLookupResponse_EResultCode_name, int32(x)) -} -func (x *CMsgPerfectWorldUserLookupResponse_EResultCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgPerfectWorldUserLookupResponse_EResultCode_value, data, "CMsgPerfectWorldUserLookupResponse_EResultCode") - if err != nil { - return err - } - *x = CMsgPerfectWorldUserLookupResponse_EResultCode(value) - return nil -} -func (CMsgPerfectWorldUserLookupResponse_EResultCode) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{36, 0} -} - -type CMsgDOTARedeemItemResponse_EResultCode int32 - -const ( - CMsgDOTARedeemItemResponse_k_Succeeded CMsgDOTARedeemItemResponse_EResultCode = 0 - CMsgDOTARedeemItemResponse_k_Failed CMsgDOTARedeemItemResponse_EResultCode = 1 -) - -var CMsgDOTARedeemItemResponse_EResultCode_name = map[int32]string{ - 0: "k_Succeeded", - 1: "k_Failed", -} -var CMsgDOTARedeemItemResponse_EResultCode_value = map[string]int32{ - "k_Succeeded": 0, - "k_Failed": 1, -} - -func (x CMsgDOTARedeemItemResponse_EResultCode) Enum() *CMsgDOTARedeemItemResponse_EResultCode { - p := new(CMsgDOTARedeemItemResponse_EResultCode) - *p = x - return p -} -func (x CMsgDOTARedeemItemResponse_EResultCode) String() string { - return proto.EnumName(CMsgDOTARedeemItemResponse_EResultCode_name, int32(x)) -} -func (x *CMsgDOTARedeemItemResponse_EResultCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTARedeemItemResponse_EResultCode_value, data, "CMsgDOTARedeemItemResponse_EResultCode") - if err != nil { - return err - } - *x = CMsgDOTARedeemItemResponse_EResultCode(value) - return nil -} -func (CMsgDOTARedeemItemResponse_EResultCode) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{42, 0} -} - -type CMsgDOTAProfileCard_EStatID int32 - -const ( - CMsgDOTAProfileCard_k_eStat_SoloRank CMsgDOTAProfileCard_EStatID = 1 - CMsgDOTAProfileCard_k_eStat_PartyRank CMsgDOTAProfileCard_EStatID = 2 - CMsgDOTAProfileCard_k_eStat_Wins CMsgDOTAProfileCard_EStatID = 3 - CMsgDOTAProfileCard_k_eStat_Commends CMsgDOTAProfileCard_EStatID = 4 - CMsgDOTAProfileCard_k_eStat_GamesPlayed CMsgDOTAProfileCard_EStatID = 5 - CMsgDOTAProfileCard_k_eStat_FirstMatchDate CMsgDOTAProfileCard_EStatID = 6 -) - -var CMsgDOTAProfileCard_EStatID_name = map[int32]string{ - 1: "k_eStat_SoloRank", - 2: "k_eStat_PartyRank", - 3: "k_eStat_Wins", - 4: "k_eStat_Commends", - 5: "k_eStat_GamesPlayed", - 6: "k_eStat_FirstMatchDate", -} -var CMsgDOTAProfileCard_EStatID_value = map[string]int32{ - "k_eStat_SoloRank": 1, - "k_eStat_PartyRank": 2, - "k_eStat_Wins": 3, - "k_eStat_Commends": 4, - "k_eStat_GamesPlayed": 5, - "k_eStat_FirstMatchDate": 6, -} - -func (x CMsgDOTAProfileCard_EStatID) Enum() *CMsgDOTAProfileCard_EStatID { - p := new(CMsgDOTAProfileCard_EStatID) - *p = x - return p -} -func (x CMsgDOTAProfileCard_EStatID) String() string { - return proto.EnumName(CMsgDOTAProfileCard_EStatID_name, int32(x)) -} -func (x *CMsgDOTAProfileCard_EStatID) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTAProfileCard_EStatID_value, data, "CMsgDOTAProfileCard_EStatID") - if err != nil { - return err - } - *x = CMsgDOTAProfileCard_EStatID(value) - return nil -} -func (CMsgDOTAProfileCard_EStatID) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{44, 0} -} - -type CSODOTAPlayerChallenge_EFlags int32 - -const ( - CSODOTAPlayerChallenge_eFlag_InstantRerollUncompleted CSODOTAPlayerChallenge_EFlags = 1 - CSODOTAPlayerChallenge_eFlag_QuestChallenge CSODOTAPlayerChallenge_EFlags = 2 -) - -var CSODOTAPlayerChallenge_EFlags_name = map[int32]string{ - 1: "eFlag_InstantRerollUncompleted", - 2: "eFlag_QuestChallenge", -} -var CSODOTAPlayerChallenge_EFlags_value = map[string]int32{ - "eFlag_InstantRerollUncompleted": 1, - "eFlag_QuestChallenge": 2, -} - -func (x CSODOTAPlayerChallenge_EFlags) Enum() *CSODOTAPlayerChallenge_EFlags { - p := new(CSODOTAPlayerChallenge_EFlags) - *p = x - return p -} -func (x CSODOTAPlayerChallenge_EFlags) String() string { - return proto.EnumName(CSODOTAPlayerChallenge_EFlags_name, int32(x)) -} -func (x *CSODOTAPlayerChallenge_EFlags) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSODOTAPlayerChallenge_EFlags_value, data, "CSODOTAPlayerChallenge_EFlags") - if err != nil { - return err - } - *x = CSODOTAPlayerChallenge_EFlags(value) - return nil -} -func (CSODOTAPlayerChallenge_EFlags) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{46, 0} -} - -type CMsgGCRerollPlayerChallengeResponse_EResult int32 - -const ( - CMsgGCRerollPlayerChallengeResponse_eResult_Success CMsgGCRerollPlayerChallengeResponse_EResult = 0 - CMsgGCRerollPlayerChallengeResponse_eResult_Dropped CMsgGCRerollPlayerChallengeResponse_EResult = 1 - CMsgGCRerollPlayerChallengeResponse_eResult_NotFound CMsgGCRerollPlayerChallengeResponse_EResult = 2 - CMsgGCRerollPlayerChallengeResponse_eResult_CantReroll CMsgGCRerollPlayerChallengeResponse_EResult = 3 - CMsgGCRerollPlayerChallengeResponse_eResult_ServerError CMsgGCRerollPlayerChallengeResponse_EResult = 4 -) - -var CMsgGCRerollPlayerChallengeResponse_EResult_name = map[int32]string{ - 0: "eResult_Success", - 1: "eResult_Dropped", - 2: "eResult_NotFound", - 3: "eResult_CantReroll", - 4: "eResult_ServerError", -} -var CMsgGCRerollPlayerChallengeResponse_EResult_value = map[string]int32{ - "eResult_Success": 0, - "eResult_Dropped": 1, - "eResult_NotFound": 2, - "eResult_CantReroll": 3, - "eResult_ServerError": 4, -} - -func (x CMsgGCRerollPlayerChallengeResponse_EResult) Enum() *CMsgGCRerollPlayerChallengeResponse_EResult { - p := new(CMsgGCRerollPlayerChallengeResponse_EResult) - *p = x - return p -} -func (x CMsgGCRerollPlayerChallengeResponse_EResult) String() string { - return proto.EnumName(CMsgGCRerollPlayerChallengeResponse_EResult_name, int32(x)) -} -func (x *CMsgGCRerollPlayerChallengeResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGCRerollPlayerChallengeResponse_EResult_value, data, "CMsgGCRerollPlayerChallengeResponse_EResult") - if err != nil { - return err - } - *x = CMsgGCRerollPlayerChallengeResponse_EResult(value) - return nil -} -func (CMsgGCRerollPlayerChallengeResponse_EResult) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{48, 0} -} - -type CMsgDOTARealtimeGameStats_GraphDataEStat int32 - -const ( - CMsgDOTARealtimeGameStats_GraphData_CreepGoldEarned CMsgDOTARealtimeGameStats_GraphDataEStat = 0 - CMsgDOTARealtimeGameStats_GraphData_KillGoldEarned CMsgDOTARealtimeGameStats_GraphDataEStat = 1 - CMsgDOTARealtimeGameStats_GraphData_DeathAndBuybackGoldLost CMsgDOTARealtimeGameStats_GraphDataEStat = 2 - CMsgDOTARealtimeGameStats_GraphData_XPEarned CMsgDOTARealtimeGameStats_GraphDataEStat = 3 -) - -var CMsgDOTARealtimeGameStats_GraphDataEStat_name = map[int32]string{ - 0: "CreepGoldEarned", - 1: "KillGoldEarned", - 2: "DeathAndBuybackGoldLost", - 3: "XPEarned", -} -var CMsgDOTARealtimeGameStats_GraphDataEStat_value = map[string]int32{ - "CreepGoldEarned": 0, - "KillGoldEarned": 1, - "DeathAndBuybackGoldLost": 2, - "XPEarned": 3, -} - -func (x CMsgDOTARealtimeGameStats_GraphDataEStat) Enum() *CMsgDOTARealtimeGameStats_GraphDataEStat { - p := new(CMsgDOTARealtimeGameStats_GraphDataEStat) - *p = x - return p -} -func (x CMsgDOTARealtimeGameStats_GraphDataEStat) String() string { - return proto.EnumName(CMsgDOTARealtimeGameStats_GraphDataEStat_name, int32(x)) -} -func (x *CMsgDOTARealtimeGameStats_GraphDataEStat) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTARealtimeGameStats_GraphDataEStat_value, data, "CMsgDOTARealtimeGameStats_GraphDataEStat") - if err != nil { - return err - } - *x = CMsgDOTARealtimeGameStats_GraphDataEStat(value) - return nil -} -func (CMsgDOTARealtimeGameStats_GraphDataEStat) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 11, 0} -} - -type CMsgDOTARealtimeGameStats_GraphDataELocation int32 - -const ( - CMsgDOTARealtimeGameStats_GraphData_BotLane CMsgDOTARealtimeGameStats_GraphDataELocation = 0 - CMsgDOTARealtimeGameStats_GraphData_MidLane CMsgDOTARealtimeGameStats_GraphDataELocation = 1 - CMsgDOTARealtimeGameStats_GraphData_TopLane CMsgDOTARealtimeGameStats_GraphDataELocation = 2 - CMsgDOTARealtimeGameStats_GraphData_Jungle CMsgDOTARealtimeGameStats_GraphDataELocation = 3 - CMsgDOTARealtimeGameStats_GraphData_Ancients CMsgDOTARealtimeGameStats_GraphDataELocation = 4 - CMsgDOTARealtimeGameStats_GraphData_Other CMsgDOTARealtimeGameStats_GraphDataELocation = 5 -) - -var CMsgDOTARealtimeGameStats_GraphDataELocation_name = map[int32]string{ - 0: "BotLane", - 1: "MidLane", - 2: "TopLane", - 3: "Jungle", - 4: "Ancients", - 5: "Other", -} -var CMsgDOTARealtimeGameStats_GraphDataELocation_value = map[string]int32{ - "BotLane": 0, - "MidLane": 1, - "TopLane": 2, - "Jungle": 3, - "Ancients": 4, - "Other": 5, -} - -func (x CMsgDOTARealtimeGameStats_GraphDataELocation) Enum() *CMsgDOTARealtimeGameStats_GraphDataELocation { - p := new(CMsgDOTARealtimeGameStats_GraphDataELocation) - *p = x - return p -} -func (x CMsgDOTARealtimeGameStats_GraphDataELocation) String() string { - return proto.EnumName(CMsgDOTARealtimeGameStats_GraphDataELocation_name, int32(x)) -} -func (x *CMsgDOTARealtimeGameStats_GraphDataELocation) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgDOTARealtimeGameStats_GraphDataELocation_value, data, "CMsgDOTARealtimeGameStats_GraphDataELocation") - if err != nil { - return err - } - *x = CMsgDOTARealtimeGameStats_GraphDataELocation(value) - return nil -} -func (CMsgDOTARealtimeGameStats_GraphDataELocation) EnumDescriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 11, 1} -} - -type CSODOTAGameAccountClient struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Wins *uint32 `protobuf:"varint,3,opt,name=wins" json:"wins,omitempty"` - Losses *uint32 `protobuf:"varint,4,opt,name=losses" json:"losses,omitempty"` - Xp *uint32 `protobuf:"varint,12,opt,name=xp" json:"xp,omitempty"` - Level *uint32 `protobuf:"varint,13,opt,name=level" json:"level,omitempty"` - InitialSkill *uint32 `protobuf:"varint,14,opt,name=initial_skill" json:"initial_skill,omitempty"` - LeaverCount *uint32 `protobuf:"varint,15,opt,name=leaver_count" json:"leaver_count,omitempty"` - SecondaryLeaverCount *uint32 `protobuf:"varint,58,opt,name=secondary_leaver_count" json:"secondary_leaver_count,omitempty"` - LowPriorityUntilDate *uint32 `protobuf:"varint,18,opt,name=low_priority_until_date" json:"low_priority_until_date,omitempty"` - PreventTextChatUntilDate *uint32 `protobuf:"varint,20,opt,name=prevent_text_chat_until_date" json:"prevent_text_chat_until_date,omitempty"` - PreventVoiceUntilDate *uint32 `protobuf:"varint,21,opt,name=prevent_voice_until_date" json:"prevent_voice_until_date,omitempty"` - LastAbandonedGameDate *uint32 `protobuf:"varint,22,opt,name=last_abandoned_game_date" json:"last_abandoned_game_date,omitempty"` - LastSecondaryAbandonedGameDate *uint32 `protobuf:"varint,59,opt,name=last_secondary_abandoned_game_date" json:"last_secondary_abandoned_game_date,omitempty"` - LeaverPenaltyCount *uint32 `protobuf:"varint,23,opt,name=leaver_penalty_count" json:"leaver_penalty_count,omitempty"` - CompletedGameStreak *uint32 `protobuf:"varint,24,opt,name=completed_game_streak" json:"completed_game_streak,omitempty"` - Teaching *uint32 `protobuf:"varint,28,opt,name=teaching" json:"teaching,omitempty"` - Leadership *uint32 `protobuf:"varint,29,opt,name=leadership" json:"leadership,omitempty"` - Friendly *uint32 `protobuf:"varint,30,opt,name=friendly" json:"friendly,omitempty"` - Forgiving *uint32 `protobuf:"varint,31,opt,name=forgiving" json:"forgiving,omitempty"` - AccountDisabledUntilDate *uint32 `protobuf:"varint,38,opt,name=account_disabled_until_date" json:"account_disabled_until_date,omitempty"` - AccountDisabledCount *uint32 `protobuf:"varint,39,opt,name=account_disabled_count" json:"account_disabled_count,omitempty"` - ShowcaseHeroId *uint32 `protobuf:"varint,40,opt,name=showcase_hero_id" json:"showcase_hero_id,omitempty"` - MatchDisabledUntilDate *uint32 `protobuf:"varint,41,opt,name=match_disabled_until_date" json:"match_disabled_until_date,omitempty"` - MatchDisabledCount *uint32 `protobuf:"varint,42,opt,name=match_disabled_count" json:"match_disabled_count,omitempty"` - PartnerAccountType *PartnerAccountType `protobuf:"varint,44,opt,name=partner_account_type,enum=PartnerAccountType,def=0" json:"partner_account_type,omitempty"` - PartnerAccountState *uint32 `protobuf:"varint,45,opt,name=partner_account_state" json:"partner_account_state,omitempty"` - Shutdownlawterminatetimestamp *uint32 `protobuf:"varint,47,opt,name=shutdownlawterminatetimestamp" json:"shutdownlawterminatetimestamp,omitempty"` - LowPriorityGamesRemaining *uint32 `protobuf:"varint,48,opt,name=low_priority_games_remaining" json:"low_priority_games_remaining,omitempty"` - CompetitiveRank *uint32 `protobuf:"varint,49,opt,name=competitive_rank" json:"competitive_rank,omitempty"` - CalibrationGamesRemaining *uint32 `protobuf:"varint,51,opt,name=calibration_games_remaining" json:"calibration_games_remaining,omitempty"` - SoloCompetitiveRank *uint32 `protobuf:"varint,52,opt,name=solo_competitive_rank" json:"solo_competitive_rank,omitempty"` - SoloCalibrationGamesRemaining *uint32 `protobuf:"varint,54,opt,name=solo_calibration_games_remaining" json:"solo_calibration_games_remaining,omitempty"` - Competitive_1V1Rank *uint32 `protobuf:"varint,63,opt,name=competitive_1v1_rank" json:"competitive_1v1_rank,omitempty"` - Competitive_1V1CalibrationGamesRemaining *uint32 `protobuf:"varint,64,opt,name=competitive_1v1_calibration_games_remaining" json:"competitive_1v1_calibration_games_remaining,omitempty"` - RecruitmentLevel *uint32 `protobuf:"varint,55,opt,name=recruitment_level" json:"recruitment_level,omitempty"` - HasNewNotifications *bool `protobuf:"varint,56,opt,name=has_new_notifications" json:"has_new_notifications,omitempty"` - IsLeagueAdmin *bool `protobuf:"varint,57,opt,name=is_league_admin" json:"is_league_admin,omitempty"` - CasualGamesPlayed *uint32 `protobuf:"varint,60,opt,name=casual_games_played" json:"casual_games_played,omitempty"` - SoloCompetitiveGamesPlayed *uint32 `protobuf:"varint,61,opt,name=solo_competitive_games_played" json:"solo_competitive_games_played,omitempty"` - PartyCompetitiveGamesPlayed *uint32 `protobuf:"varint,62,opt,name=party_competitive_games_played" json:"party_competitive_games_played,omitempty"` - Casual_1V1GamesPlayed *uint32 `protobuf:"varint,65,opt,name=casual_1v1_games_played" json:"casual_1v1_games_played,omitempty"` - CompetitiveTeamGamesPlayed *uint32 `protobuf:"varint,66,opt,name=competitive_team_games_played" json:"competitive_team_games_played,omitempty"` - CurrAllHeroChallengeId *uint32 `protobuf:"varint,67,opt,name=curr_all_hero_challenge_id" json:"curr_all_hero_challenge_id,omitempty"` - PlayTimePoints *uint32 `protobuf:"varint,68,opt,name=play_time_points" json:"play_time_points,omitempty"` - AccountFlags *uint32 `protobuf:"varint,69,opt,name=account_flags" json:"account_flags,omitempty"` - PlayTimeLevel *uint32 `protobuf:"varint,70,opt,name=play_time_level" json:"play_time_level,omitempty"` - PlayerBehaviorSeqNumLastReport *uint32 `protobuf:"varint,71,opt,name=player_behavior_seq_num_last_report" json:"player_behavior_seq_num_last_report,omitempty"` - PlayerBehaviorScoreLastReport *uint32 `protobuf:"varint,72,opt,name=player_behavior_score_last_report" json:"player_behavior_score_last_report,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAGameAccountClient) Reset() { *m = CSODOTAGameAccountClient{} } -func (m *CSODOTAGameAccountClient) String() string { return proto.CompactTextString(m) } -func (*CSODOTAGameAccountClient) ProtoMessage() {} -func (*CSODOTAGameAccountClient) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{0} } - -const Default_CSODOTAGameAccountClient_PartnerAccountType PartnerAccountType = PartnerAccountType_PARTNER_NONE - -func (m *CSODOTAGameAccountClient) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetWins() uint32 { - if m != nil && m.Wins != nil { - return *m.Wins - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLosses() uint32 { - if m != nil && m.Losses != nil { - return *m.Losses - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetXp() uint32 { - if m != nil && m.Xp != nil { - return *m.Xp - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetInitialSkill() uint32 { - if m != nil && m.InitialSkill != nil { - return *m.InitialSkill - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLeaverCount() uint32 { - if m != nil && m.LeaverCount != nil { - return *m.LeaverCount - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetSecondaryLeaverCount() uint32 { - if m != nil && m.SecondaryLeaverCount != nil { - return *m.SecondaryLeaverCount - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLowPriorityUntilDate() uint32 { - if m != nil && m.LowPriorityUntilDate != nil { - return *m.LowPriorityUntilDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPreventTextChatUntilDate() uint32 { - if m != nil && m.PreventTextChatUntilDate != nil { - return *m.PreventTextChatUntilDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPreventVoiceUntilDate() uint32 { - if m != nil && m.PreventVoiceUntilDate != nil { - return *m.PreventVoiceUntilDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLastAbandonedGameDate() uint32 { - if m != nil && m.LastAbandonedGameDate != nil { - return *m.LastAbandonedGameDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLastSecondaryAbandonedGameDate() uint32 { - if m != nil && m.LastSecondaryAbandonedGameDate != nil { - return *m.LastSecondaryAbandonedGameDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLeaverPenaltyCount() uint32 { - if m != nil && m.LeaverPenaltyCount != nil { - return *m.LeaverPenaltyCount - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCompletedGameStreak() uint32 { - if m != nil && m.CompletedGameStreak != nil { - return *m.CompletedGameStreak - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetTeaching() uint32 { - if m != nil && m.Teaching != nil { - return *m.Teaching - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLeadership() uint32 { - if m != nil && m.Leadership != nil { - return *m.Leadership - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetFriendly() uint32 { - if m != nil && m.Friendly != nil { - return *m.Friendly - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetForgiving() uint32 { - if m != nil && m.Forgiving != nil { - return *m.Forgiving - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetAccountDisabledUntilDate() uint32 { - if m != nil && m.AccountDisabledUntilDate != nil { - return *m.AccountDisabledUntilDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetAccountDisabledCount() uint32 { - if m != nil && m.AccountDisabledCount != nil { - return *m.AccountDisabledCount - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetShowcaseHeroId() uint32 { - if m != nil && m.ShowcaseHeroId != nil { - return *m.ShowcaseHeroId - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetMatchDisabledUntilDate() uint32 { - if m != nil && m.MatchDisabledUntilDate != nil { - return *m.MatchDisabledUntilDate - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetMatchDisabledCount() uint32 { - if m != nil && m.MatchDisabledCount != nil { - return *m.MatchDisabledCount - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPartnerAccountType() PartnerAccountType { - if m != nil && m.PartnerAccountType != nil { - return *m.PartnerAccountType - } - return Default_CSODOTAGameAccountClient_PartnerAccountType -} - -func (m *CSODOTAGameAccountClient) GetPartnerAccountState() uint32 { - if m != nil && m.PartnerAccountState != nil { - return *m.PartnerAccountState - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetShutdownlawterminatetimestamp() uint32 { - if m != nil && m.Shutdownlawterminatetimestamp != nil { - return *m.Shutdownlawterminatetimestamp - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetLowPriorityGamesRemaining() uint32 { - if m != nil && m.LowPriorityGamesRemaining != nil { - return *m.LowPriorityGamesRemaining - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCompetitiveRank() uint32 { - if m != nil && m.CompetitiveRank != nil { - return *m.CompetitiveRank - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCalibrationGamesRemaining() uint32 { - if m != nil && m.CalibrationGamesRemaining != nil { - return *m.CalibrationGamesRemaining - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetSoloCompetitiveRank() uint32 { - if m != nil && m.SoloCompetitiveRank != nil { - return *m.SoloCompetitiveRank - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetSoloCalibrationGamesRemaining() uint32 { - if m != nil && m.SoloCalibrationGamesRemaining != nil { - return *m.SoloCalibrationGamesRemaining - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCompetitive_1V1Rank() uint32 { - if m != nil && m.Competitive_1V1Rank != nil { - return *m.Competitive_1V1Rank - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCompetitive_1V1CalibrationGamesRemaining() uint32 { - if m != nil && m.Competitive_1V1CalibrationGamesRemaining != nil { - return *m.Competitive_1V1CalibrationGamesRemaining - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetRecruitmentLevel() uint32 { - if m != nil && m.RecruitmentLevel != nil { - return *m.RecruitmentLevel - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetHasNewNotifications() bool { - if m != nil && m.HasNewNotifications != nil { - return *m.HasNewNotifications - } - return false -} - -func (m *CSODOTAGameAccountClient) GetIsLeagueAdmin() bool { - if m != nil && m.IsLeagueAdmin != nil { - return *m.IsLeagueAdmin - } - return false -} - -func (m *CSODOTAGameAccountClient) GetCasualGamesPlayed() uint32 { - if m != nil && m.CasualGamesPlayed != nil { - return *m.CasualGamesPlayed - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetSoloCompetitiveGamesPlayed() uint32 { - if m != nil && m.SoloCompetitiveGamesPlayed != nil { - return *m.SoloCompetitiveGamesPlayed - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPartyCompetitiveGamesPlayed() uint32 { - if m != nil && m.PartyCompetitiveGamesPlayed != nil { - return *m.PartyCompetitiveGamesPlayed - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCasual_1V1GamesPlayed() uint32 { - if m != nil && m.Casual_1V1GamesPlayed != nil { - return *m.Casual_1V1GamesPlayed - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCompetitiveTeamGamesPlayed() uint32 { - if m != nil && m.CompetitiveTeamGamesPlayed != nil { - return *m.CompetitiveTeamGamesPlayed - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetCurrAllHeroChallengeId() uint32 { - if m != nil && m.CurrAllHeroChallengeId != nil { - return *m.CurrAllHeroChallengeId - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPlayTimePoints() uint32 { - if m != nil && m.PlayTimePoints != nil { - return *m.PlayTimePoints - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetAccountFlags() uint32 { - if m != nil && m.AccountFlags != nil { - return *m.AccountFlags - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPlayTimeLevel() uint32 { - if m != nil && m.PlayTimeLevel != nil { - return *m.PlayTimeLevel - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPlayerBehaviorSeqNumLastReport() uint32 { - if m != nil && m.PlayerBehaviorSeqNumLastReport != nil { - return *m.PlayerBehaviorSeqNumLastReport - } - return 0 -} - -func (m *CSODOTAGameAccountClient) GetPlayerBehaviorScoreLastReport() uint32 { - if m != nil && m.PlayerBehaviorScoreLastReport != nil { - return *m.PlayerBehaviorScoreLastReport - } - return 0 -} - -type CSODOTAPartyMember struct { - PartnerType *PartnerAccountType `protobuf:"varint,1,opt,name=partner_type,enum=PartnerAccountType,def=0" json:"partner_type,omitempty"` - IsCoach *bool `protobuf:"varint,2,opt,name=is_coach" json:"is_coach,omitempty"` - RegionPingCodes []uint32 `protobuf:"varint,4,rep,packed,name=region_ping_codes" json:"region_ping_codes,omitempty"` - RegionPingTimes []uint32 `protobuf:"varint,5,rep,packed,name=region_ping_times" json:"region_ping_times,omitempty"` - RegionPingFailedBitmask *uint32 `protobuf:"varint,6,opt,name=region_ping_failed_bitmask" json:"region_ping_failed_bitmask,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAPartyMember) Reset() { *m = CSODOTAPartyMember{} } -func (m *CSODOTAPartyMember) String() string { return proto.CompactTextString(m) } -func (*CSODOTAPartyMember) ProtoMessage() {} -func (*CSODOTAPartyMember) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{1} } - -const Default_CSODOTAPartyMember_PartnerType PartnerAccountType = PartnerAccountType_PARTNER_NONE - -func (m *CSODOTAPartyMember) GetPartnerType() PartnerAccountType { - if m != nil && m.PartnerType != nil { - return *m.PartnerType - } - return Default_CSODOTAPartyMember_PartnerType -} - -func (m *CSODOTAPartyMember) GetIsCoach() bool { - if m != nil && m.IsCoach != nil { - return *m.IsCoach - } - return false -} - -func (m *CSODOTAPartyMember) GetRegionPingCodes() []uint32 { - if m != nil { - return m.RegionPingCodes - } - return nil -} - -func (m *CSODOTAPartyMember) GetRegionPingTimes() []uint32 { - if m != nil { - return m.RegionPingTimes - } - return nil -} - -func (m *CSODOTAPartyMember) GetRegionPingFailedBitmask() uint32 { - if m != nil && m.RegionPingFailedBitmask != nil { - return *m.RegionPingFailedBitmask - } - return 0 -} - -type CSODOTAParty struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - LeaderId *uint64 `protobuf:"fixed64,2,opt,name=leader_id" json:"leader_id,omitempty"` - MemberIds []uint64 `protobuf:"fixed64,3,rep,name=member_ids" json:"member_ids,omitempty"` - GameModes *uint32 `protobuf:"varint,4,opt,name=game_modes" json:"game_modes,omitempty"` - State *CSODOTAParty_State `protobuf:"varint,6,opt,name=state,enum=CSODOTAParty_State,def=0" json:"state,omitempty"` - EffectiveStartedMatchmakingTime *uint32 `protobuf:"varint,7,opt,name=effective_started_matchmaking_time" json:"effective_started_matchmaking_time,omitempty"` - RawStartedMatchmakingTime *uint32 `protobuf:"varint,32,opt,name=raw_started_matchmaking_time" json:"raw_started_matchmaking_time,omitempty"` - AttemptStartTime *uint32 `protobuf:"varint,33,opt,name=attempt_start_time" json:"attempt_start_time,omitempty"` - AttemptNum *uint32 `protobuf:"varint,34,opt,name=attempt_num" json:"attempt_num,omitempty"` - Matchgroups *uint32 `protobuf:"varint,11,opt,name=matchgroups" json:"matchgroups,omitempty"` - LowPriorityAccountId *uint32 `protobuf:"varint,19,opt,name=low_priority_account_id" json:"low_priority_account_id,omitempty"` - MatchType *MatchType `protobuf:"varint,21,opt,name=match_type,enum=MatchType,def=0" json:"match_type,omitempty"` - BotDifficulty *DOTABotDifficulty `protobuf:"varint,22,opt,name=bot_difficulty,enum=DOTABotDifficulty,def=0" json:"bot_difficulty,omitempty"` - TeamId *uint32 `protobuf:"varint,23,opt,name=team_id" json:"team_id,omitempty"` - MatchDisabledUntilDate *uint32 `protobuf:"varint,24,opt,name=match_disabled_until_date" json:"match_disabled_until_date,omitempty"` - MatchDisabledAccountId *uint32 `protobuf:"varint,25,opt,name=match_disabled_account_id" json:"match_disabled_account_id,omitempty"` - MatchmakingMaxRangeMinutes *uint32 `protobuf:"varint,26,opt,name=matchmaking_max_range_minutes" json:"matchmaking_max_range_minutes,omitempty"` - Matchlanguages *uint32 `protobuf:"varint,27,opt,name=matchlanguages" json:"matchlanguages,omitempty"` - MapPreference *uint32 `protobuf:"varint,38,opt,name=map_preference" json:"map_preference,omitempty"` - Members []*CSODOTAPartyMember `protobuf:"bytes,29,rep,name=members" json:"members,omitempty"` - OpenGuildId *uint32 `protobuf:"varint,30,opt,name=open_guild_id" json:"open_guild_id,omitempty"` - CommonGuilds []uint32 `protobuf:"varint,31,rep,name=common_guilds" json:"common_guilds,omitempty"` - LowPriorityGamesRemaining *uint32 `protobuf:"varint,35,opt,name=low_priority_games_remaining" json:"low_priority_games_remaining,omitempty"` - MinLevel *uint32 `protobuf:"varint,36,opt,name=min_level" json:"min_level,omitempty"` - MaxLevel *uint32 `protobuf:"varint,37,opt,name=max_level" json:"max_level,omitempty"` - ActiveIngameEvents []EEvent `protobuf:"varint,39,rep,name=active_ingame_events,enum=EEvent" json:"active_ingame_events,omitempty"` - OpenForJoinRequests *bool `protobuf:"varint,40,opt,name=open_for_join_requests" json:"open_for_join_requests,omitempty"` - SentInvites []*CSODOTAPartyInvite `protobuf:"bytes,41,rep,name=sent_invites" json:"sent_invites,omitempty"` - RecvInvites []*CSODOTAPartyInvite `protobuf:"bytes,42,rep,name=recv_invites" json:"recv_invites,omitempty"` - AccountFlags *uint32 `protobuf:"varint,43,opt,name=account_flags" json:"account_flags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAParty) Reset() { *m = CSODOTAParty{} } -func (m *CSODOTAParty) String() string { return proto.CompactTextString(m) } -func (*CSODOTAParty) ProtoMessage() {} -func (*CSODOTAParty) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{2} } - -const Default_CSODOTAParty_State CSODOTAParty_State = CSODOTAParty_UI -const Default_CSODOTAParty_MatchType MatchType = MatchType_MATCH_TYPE_CASUAL -const Default_CSODOTAParty_BotDifficulty DOTABotDifficulty = DOTABotDifficulty_BOT_DIFFICULTY_PASSIVE - -func (m *CSODOTAParty) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CSODOTAParty) GetLeaderId() uint64 { - if m != nil && m.LeaderId != nil { - return *m.LeaderId - } - return 0 -} - -func (m *CSODOTAParty) GetMemberIds() []uint64 { - if m != nil { - return m.MemberIds - } - return nil -} - -func (m *CSODOTAParty) GetGameModes() uint32 { - if m != nil && m.GameModes != nil { - return *m.GameModes - } - return 0 -} - -func (m *CSODOTAParty) GetState() CSODOTAParty_State { - if m != nil && m.State != nil { - return *m.State - } - return Default_CSODOTAParty_State -} - -func (m *CSODOTAParty) GetEffectiveStartedMatchmakingTime() uint32 { - if m != nil && m.EffectiveStartedMatchmakingTime != nil { - return *m.EffectiveStartedMatchmakingTime - } - return 0 -} - -func (m *CSODOTAParty) GetRawStartedMatchmakingTime() uint32 { - if m != nil && m.RawStartedMatchmakingTime != nil { - return *m.RawStartedMatchmakingTime - } - return 0 -} - -func (m *CSODOTAParty) GetAttemptStartTime() uint32 { - if m != nil && m.AttemptStartTime != nil { - return *m.AttemptStartTime - } - return 0 -} - -func (m *CSODOTAParty) GetAttemptNum() uint32 { - if m != nil && m.AttemptNum != nil { - return *m.AttemptNum - } - return 0 -} - -func (m *CSODOTAParty) GetMatchgroups() uint32 { - if m != nil && m.Matchgroups != nil { - return *m.Matchgroups - } - return 0 -} - -func (m *CSODOTAParty) GetLowPriorityAccountId() uint32 { - if m != nil && m.LowPriorityAccountId != nil { - return *m.LowPriorityAccountId - } - return 0 -} - -func (m *CSODOTAParty) GetMatchType() MatchType { - if m != nil && m.MatchType != nil { - return *m.MatchType - } - return Default_CSODOTAParty_MatchType -} - -func (m *CSODOTAParty) GetBotDifficulty() DOTABotDifficulty { - if m != nil && m.BotDifficulty != nil { - return *m.BotDifficulty - } - return Default_CSODOTAParty_BotDifficulty -} - -func (m *CSODOTAParty) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CSODOTAParty) GetMatchDisabledUntilDate() uint32 { - if m != nil && m.MatchDisabledUntilDate != nil { - return *m.MatchDisabledUntilDate - } - return 0 -} - -func (m *CSODOTAParty) GetMatchDisabledAccountId() uint32 { - if m != nil && m.MatchDisabledAccountId != nil { - return *m.MatchDisabledAccountId - } - return 0 -} - -func (m *CSODOTAParty) GetMatchmakingMaxRangeMinutes() uint32 { - if m != nil && m.MatchmakingMaxRangeMinutes != nil { - return *m.MatchmakingMaxRangeMinutes - } - return 0 -} - -func (m *CSODOTAParty) GetMatchlanguages() uint32 { - if m != nil && m.Matchlanguages != nil { - return *m.Matchlanguages - } - return 0 -} - -func (m *CSODOTAParty) GetMapPreference() uint32 { - if m != nil && m.MapPreference != nil { - return *m.MapPreference - } - return 0 -} - -func (m *CSODOTAParty) GetMembers() []*CSODOTAPartyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CSODOTAParty) GetOpenGuildId() uint32 { - if m != nil && m.OpenGuildId != nil { - return *m.OpenGuildId - } - return 0 -} - -func (m *CSODOTAParty) GetCommonGuilds() []uint32 { - if m != nil { - return m.CommonGuilds - } - return nil -} - -func (m *CSODOTAParty) GetLowPriorityGamesRemaining() uint32 { - if m != nil && m.LowPriorityGamesRemaining != nil { - return *m.LowPriorityGamesRemaining - } - return 0 -} - -func (m *CSODOTAParty) GetMinLevel() uint32 { - if m != nil && m.MinLevel != nil { - return *m.MinLevel - } - return 0 -} - -func (m *CSODOTAParty) GetMaxLevel() uint32 { - if m != nil && m.MaxLevel != nil { - return *m.MaxLevel - } - return 0 -} - -func (m *CSODOTAParty) GetActiveIngameEvents() []EEvent { - if m != nil { - return m.ActiveIngameEvents - } - return nil -} - -func (m *CSODOTAParty) GetOpenForJoinRequests() bool { - if m != nil && m.OpenForJoinRequests != nil { - return *m.OpenForJoinRequests - } - return false -} - -func (m *CSODOTAParty) GetSentInvites() []*CSODOTAPartyInvite { - if m != nil { - return m.SentInvites - } - return nil -} - -func (m *CSODOTAParty) GetRecvInvites() []*CSODOTAPartyInvite { - if m != nil { - return m.RecvInvites - } - return nil -} - -func (m *CSODOTAParty) GetAccountFlags() uint32 { - if m != nil && m.AccountFlags != nil { - return *m.AccountFlags - } - return 0 -} - -type CSODOTAPartyInvite struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - SenderName *string `protobuf:"bytes,3,opt,name=sender_name" json:"sender_name,omitempty"` - Members []*CSODOTAPartyInvite_PartyMember `protobuf:"bytes,4,rep,name=members" json:"members,omitempty"` - TeamId *uint32 `protobuf:"varint,5,opt,name=team_id" json:"team_id,omitempty"` - LowPriorityStatus *bool `protobuf:"varint,6,opt,name=low_priority_status" json:"low_priority_status,omitempty"` - AsCoach *bool `protobuf:"varint,7,opt,name=as_coach" json:"as_coach,omitempty"` - InviteGid *uint64 `protobuf:"fixed64,8,opt,name=invite_gid" json:"invite_gid,omitempty"` - Engine *uint32 `protobuf:"varint,9,opt,name=engine" json:"engine,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAPartyInvite) Reset() { *m = CSODOTAPartyInvite{} } -func (m *CSODOTAPartyInvite) String() string { return proto.CompactTextString(m) } -func (*CSODOTAPartyInvite) ProtoMessage() {} -func (*CSODOTAPartyInvite) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{3} } - -func (m *CSODOTAPartyInvite) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CSODOTAPartyInvite) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CSODOTAPartyInvite) GetSenderName() string { - if m != nil && m.SenderName != nil { - return *m.SenderName - } - return "" -} - -func (m *CSODOTAPartyInvite) GetMembers() []*CSODOTAPartyInvite_PartyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CSODOTAPartyInvite) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CSODOTAPartyInvite) GetLowPriorityStatus() bool { - if m != nil && m.LowPriorityStatus != nil { - return *m.LowPriorityStatus - } - return false -} - -func (m *CSODOTAPartyInvite) GetAsCoach() bool { - if m != nil && m.AsCoach != nil { - return *m.AsCoach - } - return false -} - -func (m *CSODOTAPartyInvite) GetInviteGid() uint64 { - if m != nil && m.InviteGid != nil { - return *m.InviteGid - } - return 0 -} - -func (m *CSODOTAPartyInvite) GetEngine() uint32 { - if m != nil && m.Engine != nil { - return *m.Engine - } - return 0 -} - -type CSODOTAPartyInvite_PartyMember struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - IsCoach *bool `protobuf:"varint,4,opt,name=is_coach" json:"is_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAPartyInvite_PartyMember) Reset() { *m = CSODOTAPartyInvite_PartyMember{} } -func (m *CSODOTAPartyInvite_PartyMember) String() string { return proto.CompactTextString(m) } -func (*CSODOTAPartyInvite_PartyMember) ProtoMessage() {} -func (*CSODOTAPartyInvite_PartyMember) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{3, 0} -} - -func (m *CSODOTAPartyInvite_PartyMember) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CSODOTAPartyInvite_PartyMember) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CSODOTAPartyInvite_PartyMember) GetIsCoach() bool { - if m != nil && m.IsCoach != nil { - return *m.IsCoach - } - return false -} - -type CSODOTALobbyInvite struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - SenderName *string `protobuf:"bytes,3,opt,name=sender_name" json:"sender_name,omitempty"` - Members []*CSODOTALobbyInvite_LobbyMember `protobuf:"bytes,4,rep,name=members" json:"members,omitempty"` - CustomGameId *uint64 `protobuf:"varint,5,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - InviteGid *uint64 `protobuf:"fixed64,6,opt,name=invite_gid" json:"invite_gid,omitempty"` - CustomGameCrc *uint64 `protobuf:"fixed64,7,opt,name=custom_game_crc" json:"custom_game_crc,omitempty"` - CustomGameTimestamp *uint32 `protobuf:"fixed32,8,opt,name=custom_game_timestamp" json:"custom_game_timestamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTALobbyInvite) Reset() { *m = CSODOTALobbyInvite{} } -func (m *CSODOTALobbyInvite) String() string { return proto.CompactTextString(m) } -func (*CSODOTALobbyInvite) ProtoMessage() {} -func (*CSODOTALobbyInvite) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{4} } - -func (m *CSODOTALobbyInvite) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CSODOTALobbyInvite) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CSODOTALobbyInvite) GetSenderName() string { - if m != nil && m.SenderName != nil { - return *m.SenderName - } - return "" -} - -func (m *CSODOTALobbyInvite) GetMembers() []*CSODOTALobbyInvite_LobbyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CSODOTALobbyInvite) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CSODOTALobbyInvite) GetInviteGid() uint64 { - if m != nil && m.InviteGid != nil { - return *m.InviteGid - } - return 0 -} - -func (m *CSODOTALobbyInvite) GetCustomGameCrc() uint64 { - if m != nil && m.CustomGameCrc != nil { - return *m.CustomGameCrc - } - return 0 -} - -func (m *CSODOTALobbyInvite) GetCustomGameTimestamp() uint32 { - if m != nil && m.CustomGameTimestamp != nil { - return *m.CustomGameTimestamp - } - return 0 -} - -type CSODOTALobbyInvite_LobbyMember struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTALobbyInvite_LobbyMember) Reset() { *m = CSODOTALobbyInvite_LobbyMember{} } -func (m *CSODOTALobbyInvite_LobbyMember) String() string { return proto.CompactTextString(m) } -func (*CSODOTALobbyInvite_LobbyMember) ProtoMessage() {} -func (*CSODOTALobbyInvite_LobbyMember) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{4, 0} -} - -func (m *CSODOTALobbyInvite_LobbyMember) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CSODOTALobbyInvite_LobbyMember) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CDOTAClientHardwareSpecs struct { - LogicalProcessors *uint32 `protobuf:"varint,1,opt,name=logical_processors" json:"logical_processors,omitempty"` - CpuCyclesPerSecond *uint64 `protobuf:"fixed64,2,opt,name=cpu_cycles_per_second" json:"cpu_cycles_per_second,omitempty"` - TotalPhysicalMemory *uint64 `protobuf:"fixed64,3,opt,name=total_physical_memory" json:"total_physical_memory,omitempty"` - Is_64BitOs *bool `protobuf:"varint,4,opt,name=is_64_bit_os" json:"is_64_bit_os,omitempty"` - UploadMeasurement *uint64 `protobuf:"varint,5,opt,name=upload_measurement" json:"upload_measurement,omitempty"` - PreferNotHost *bool `protobuf:"varint,6,opt,name=prefer_not_host" json:"prefer_not_host,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTAClientHardwareSpecs) Reset() { *m = CDOTAClientHardwareSpecs{} } -func (m *CDOTAClientHardwareSpecs) String() string { return proto.CompactTextString(m) } -func (*CDOTAClientHardwareSpecs) ProtoMessage() {} -func (*CDOTAClientHardwareSpecs) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{5} } - -func (m *CDOTAClientHardwareSpecs) GetLogicalProcessors() uint32 { - if m != nil && m.LogicalProcessors != nil { - return *m.LogicalProcessors - } - return 0 -} - -func (m *CDOTAClientHardwareSpecs) GetCpuCyclesPerSecond() uint64 { - if m != nil && m.CpuCyclesPerSecond != nil { - return *m.CpuCyclesPerSecond - } - return 0 -} - -func (m *CDOTAClientHardwareSpecs) GetTotalPhysicalMemory() uint64 { - if m != nil && m.TotalPhysicalMemory != nil { - return *m.TotalPhysicalMemory - } - return 0 -} - -func (m *CDOTAClientHardwareSpecs) GetIs_64BitOs() bool { - if m != nil && m.Is_64BitOs != nil { - return *m.Is_64BitOs - } - return false -} - -func (m *CDOTAClientHardwareSpecs) GetUploadMeasurement() uint64 { - if m != nil && m.UploadMeasurement != nil { - return *m.UploadMeasurement - } - return 0 -} - -func (m *CDOTAClientHardwareSpecs) GetPreferNotHost() bool { - if m != nil && m.PreferNotHost != nil { - return *m.PreferNotHost - } - return false -} - -type CDOTASaveGame struct { - MatchId *uint64 `protobuf:"varint,5,opt,name=match_id" json:"match_id,omitempty"` - SaveTime *uint32 `protobuf:"varint,2,opt,name=save_time" json:"save_time,omitempty"` - Players []*CDOTASaveGame_Player `protobuf:"bytes,3,rep,name=players" json:"players,omitempty"` - SaveInstances []*CDOTASaveGame_SaveInstance `protobuf:"bytes,4,rep,name=save_instances" json:"save_instances,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTASaveGame) Reset() { *m = CDOTASaveGame{} } -func (m *CDOTASaveGame) String() string { return proto.CompactTextString(m) } -func (*CDOTASaveGame) ProtoMessage() {} -func (*CDOTASaveGame) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{6} } - -func (m *CDOTASaveGame) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CDOTASaveGame) GetSaveTime() uint32 { - if m != nil && m.SaveTime != nil { - return *m.SaveTime - } - return 0 -} - -func (m *CDOTASaveGame) GetPlayers() []*CDOTASaveGame_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CDOTASaveGame) GetSaveInstances() []*CDOTASaveGame_SaveInstance { - if m != nil { - return m.SaveInstances - } - return nil -} - -type CDOTASaveGame_Player struct { - Team *DOTA_GC_TEAM `protobuf:"varint,1,opt,name=team,enum=DOTA_GC_TEAM,def=0" json:"team,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Hero *string `protobuf:"bytes,3,opt,name=hero" json:"hero,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTASaveGame_Player) Reset() { *m = CDOTASaveGame_Player{} } -func (m *CDOTASaveGame_Player) String() string { return proto.CompactTextString(m) } -func (*CDOTASaveGame_Player) ProtoMessage() {} -func (*CDOTASaveGame_Player) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{6, 0} } - -const Default_CDOTASaveGame_Player_Team DOTA_GC_TEAM = DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS - -func (m *CDOTASaveGame_Player) GetTeam() DOTA_GC_TEAM { - if m != nil && m.Team != nil { - return *m.Team - } - return Default_CDOTASaveGame_Player_Team -} - -func (m *CDOTASaveGame_Player) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CDOTASaveGame_Player) GetHero() string { - if m != nil && m.Hero != nil { - return *m.Hero - } - return "" -} - -type CDOTASaveGame_SaveInstance struct { - GameTime *uint32 `protobuf:"varint,2,opt,name=game_time" json:"game_time,omitempty"` - Team1Score *uint32 `protobuf:"varint,3,opt,name=team1_score" json:"team1_score,omitempty"` - Team2Score *uint32 `protobuf:"varint,4,opt,name=team2_score" json:"team2_score,omitempty"` - PlayerPositions []*CDOTASaveGame_SaveInstance_PlayerPositions `protobuf:"bytes,5,rep,name=player_positions" json:"player_positions,omitempty"` - SaveId *uint32 `protobuf:"varint,6,opt,name=save_id" json:"save_id,omitempty"` - SaveTime *uint32 `protobuf:"varint,7,opt,name=save_time" json:"save_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTASaveGame_SaveInstance) Reset() { *m = CDOTASaveGame_SaveInstance{} } -func (m *CDOTASaveGame_SaveInstance) String() string { return proto.CompactTextString(m) } -func (*CDOTASaveGame_SaveInstance) ProtoMessage() {} -func (*CDOTASaveGame_SaveInstance) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{6, 1} } - -func (m *CDOTASaveGame_SaveInstance) GetGameTime() uint32 { - if m != nil && m.GameTime != nil { - return *m.GameTime - } - return 0 -} - -func (m *CDOTASaveGame_SaveInstance) GetTeam1Score() uint32 { - if m != nil && m.Team1Score != nil { - return *m.Team1Score - } - return 0 -} - -func (m *CDOTASaveGame_SaveInstance) GetTeam2Score() uint32 { - if m != nil && m.Team2Score != nil { - return *m.Team2Score - } - return 0 -} - -func (m *CDOTASaveGame_SaveInstance) GetPlayerPositions() []*CDOTASaveGame_SaveInstance_PlayerPositions { - if m != nil { - return m.PlayerPositions - } - return nil -} - -func (m *CDOTASaveGame_SaveInstance) GetSaveId() uint32 { - if m != nil && m.SaveId != nil { - return *m.SaveId - } - return 0 -} - -func (m *CDOTASaveGame_SaveInstance) GetSaveTime() uint32 { - if m != nil && m.SaveTime != nil { - return *m.SaveTime - } - return 0 -} - -type CDOTASaveGame_SaveInstance_PlayerPositions struct { - X *float32 `protobuf:"fixed32,1,opt,name=x" json:"x,omitempty"` - Y *float32 `protobuf:"fixed32,2,opt,name=y" json:"y,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTASaveGame_SaveInstance_PlayerPositions) Reset() { - *m = CDOTASaveGame_SaveInstance_PlayerPositions{} -} -func (m *CDOTASaveGame_SaveInstance_PlayerPositions) String() string { - return proto.CompactTextString(m) -} -func (*CDOTASaveGame_SaveInstance_PlayerPositions) ProtoMessage() {} -func (*CDOTASaveGame_SaveInstance_PlayerPositions) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{6, 1, 0} -} - -func (m *CDOTASaveGame_SaveInstance_PlayerPositions) GetX() float32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *CDOTASaveGame_SaveInstance_PlayerPositions) GetY() float32 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -type CMsgLeaverState struct { - LobbyState *uint32 `protobuf:"varint,1,opt,name=lobby_state" json:"lobby_state,omitempty"` - GameState *DOTA_GameState `protobuf:"varint,2,opt,name=game_state,enum=DOTA_GameState,def=0" json:"game_state,omitempty"` - LeaverDetected *bool `protobuf:"varint,3,opt,name=leaver_detected" json:"leaver_detected,omitempty"` - FirstBloodHappened *bool `protobuf:"varint,4,opt,name=first_blood_happened" json:"first_blood_happened,omitempty"` - DiscardMatchResults *bool `protobuf:"varint,5,opt,name=discard_match_results" json:"discard_match_results,omitempty"` - MassDisconnect *bool `protobuf:"varint,6,opt,name=mass_disconnect" json:"mass_disconnect,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeaverState) Reset() { *m = CMsgLeaverState{} } -func (m *CMsgLeaverState) String() string { return proto.CompactTextString(m) } -func (*CMsgLeaverState) ProtoMessage() {} -func (*CMsgLeaverState) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{7} } - -const Default_CMsgLeaverState_GameState DOTA_GameState = DOTA_GameState_DOTA_GAMERULES_STATE_INIT - -func (m *CMsgLeaverState) GetLobbyState() uint32 { - if m != nil && m.LobbyState != nil { - return *m.LobbyState - } - return 0 -} - -func (m *CMsgLeaverState) GetGameState() DOTA_GameState { - if m != nil && m.GameState != nil { - return *m.GameState - } - return Default_CMsgLeaverState_GameState -} - -func (m *CMsgLeaverState) GetLeaverDetected() bool { - if m != nil && m.LeaverDetected != nil { - return *m.LeaverDetected - } - return false -} - -func (m *CMsgLeaverState) GetFirstBloodHappened() bool { - if m != nil && m.FirstBloodHappened != nil { - return *m.FirstBloodHappened - } - return false -} - -func (m *CMsgLeaverState) GetDiscardMatchResults() bool { - if m != nil && m.DiscardMatchResults != nil { - return *m.DiscardMatchResults - } - return false -} - -func (m *CMsgLeaverState) GetMassDisconnect() bool { - if m != nil && m.MassDisconnect != nil { - return *m.MassDisconnect - } - return false -} - -type CDOTALobbyMember struct { - Id *uint64 `protobuf:"fixed64,1,opt,name=id" json:"id,omitempty"` - HeroId *uint32 `protobuf:"varint,2,opt,name=hero_id" json:"hero_id,omitempty"` - Team *DOTA_GC_TEAM `protobuf:"varint,3,opt,name=team,enum=DOTA_GC_TEAM,def=0" json:"team,omitempty"` - Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` - Slot *uint32 `protobuf:"varint,7,opt,name=slot" json:"slot,omitempty"` - PartyId *uint64 `protobuf:"varint,12,opt,name=party_id" json:"party_id,omitempty"` - MetaLevel *uint32 `protobuf:"varint,13,opt,name=meta_level" json:"meta_level,omitempty"` - MetaXp *uint32 `protobuf:"varint,14,opt,name=meta_xp" json:"meta_xp,omitempty"` - MetaXpAwarded *uint32 `protobuf:"varint,15,opt,name=meta_xp_awarded" json:"meta_xp_awarded,omitempty"` - LeaverStatus *DOTALeaverStatusT `protobuf:"varint,16,opt,name=leaver_status,enum=DOTALeaverStatusT,def=0" json:"leaver_status,omitempty"` - LeaverActions *uint32 `protobuf:"varint,28,opt,name=leaver_actions" json:"leaver_actions,omitempty"` - Channel *uint32 `protobuf:"varint,17,opt,name=channel" json:"channel,omitempty"` - PrizeDefIndex *uint32 `protobuf:"varint,18,opt,name=prize_def_index" json:"prize_def_index,omitempty"` - DisabledHeroId []uint32 `protobuf:"varint,20,rep,name=disabled_hero_id" json:"disabled_hero_id,omitempty"` - PartnerAccountType *PartnerAccountType `protobuf:"varint,21,opt,name=partner_account_type,enum=PartnerAccountType,def=0" json:"partner_account_type,omitempty"` - EnabledHeroId []uint32 `protobuf:"varint,22,rep,name=enabled_hero_id" json:"enabled_hero_id,omitempty"` - CoachTeam *DOTA_GC_TEAM `protobuf:"varint,23,opt,name=coach_team,enum=DOTA_GC_TEAM,def=0" json:"coach_team,omitempty"` - NexonPcBangNo *uint32 `protobuf:"varint,24,opt,name=nexon_pc_bang_no" json:"nexon_pc_bang_no,omitempty"` - NexonPcBangName *string `protobuf:"bytes,25,opt,name=nexon_pc_bang_name" json:"nexon_pc_bang_name,omitempty"` - XpBonuses []*CDOTALobbyMember_CDOTALobbyMemberXPBonus `protobuf:"bytes,27,rep,name=xp_bonuses" json:"xp_bonuses,omitempty"` - RankChange *int32 `protobuf:"zigzag32,29,opt,name=rank_change" json:"rank_change,omitempty"` - Cameraman *bool `protobuf:"varint,30,opt,name=cameraman" json:"cameraman,omitempty"` - CustomGameProductIds []uint32 `protobuf:"varint,31,rep,name=custom_game_product_ids" json:"custom_game_product_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTALobbyMember) Reset() { *m = CDOTALobbyMember{} } -func (m *CDOTALobbyMember) String() string { return proto.CompactTextString(m) } -func (*CDOTALobbyMember) ProtoMessage() {} -func (*CDOTALobbyMember) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{8} } - -const Default_CDOTALobbyMember_Team DOTA_GC_TEAM = DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS -const Default_CDOTALobbyMember_LeaverStatus DOTALeaverStatusT = DOTALeaverStatusT_DOTA_LEAVER_NONE -const Default_CDOTALobbyMember_PartnerAccountType PartnerAccountType = PartnerAccountType_PARTNER_NONE -const Default_CDOTALobbyMember_CoachTeam DOTA_GC_TEAM = DOTA_GC_TEAM_DOTA_GC_TEAM_GOOD_GUYS - -func (m *CDOTALobbyMember) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CDOTALobbyMember) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CDOTALobbyMember) GetTeam() DOTA_GC_TEAM { - if m != nil && m.Team != nil { - return *m.Team - } - return Default_CDOTALobbyMember_Team -} - -func (m *CDOTALobbyMember) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CDOTALobbyMember) GetSlot() uint32 { - if m != nil && m.Slot != nil { - return *m.Slot - } - return 0 -} - -func (m *CDOTALobbyMember) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CDOTALobbyMember) GetMetaLevel() uint32 { - if m != nil && m.MetaLevel != nil { - return *m.MetaLevel - } - return 0 -} - -func (m *CDOTALobbyMember) GetMetaXp() uint32 { - if m != nil && m.MetaXp != nil { - return *m.MetaXp - } - return 0 -} - -func (m *CDOTALobbyMember) GetMetaXpAwarded() uint32 { - if m != nil && m.MetaXpAwarded != nil { - return *m.MetaXpAwarded - } - return 0 -} - -func (m *CDOTALobbyMember) GetLeaverStatus() DOTALeaverStatusT { - if m != nil && m.LeaverStatus != nil { - return *m.LeaverStatus - } - return Default_CDOTALobbyMember_LeaverStatus -} - -func (m *CDOTALobbyMember) GetLeaverActions() uint32 { - if m != nil && m.LeaverActions != nil { - return *m.LeaverActions - } - return 0 -} - -func (m *CDOTALobbyMember) GetChannel() uint32 { - if m != nil && m.Channel != nil { - return *m.Channel - } - return 0 -} - -func (m *CDOTALobbyMember) GetPrizeDefIndex() uint32 { - if m != nil && m.PrizeDefIndex != nil { - return *m.PrizeDefIndex - } - return 0 -} - -func (m *CDOTALobbyMember) GetDisabledHeroId() []uint32 { - if m != nil { - return m.DisabledHeroId - } - return nil -} - -func (m *CDOTALobbyMember) GetPartnerAccountType() PartnerAccountType { - if m != nil && m.PartnerAccountType != nil { - return *m.PartnerAccountType - } - return Default_CDOTALobbyMember_PartnerAccountType -} - -func (m *CDOTALobbyMember) GetEnabledHeroId() []uint32 { - if m != nil { - return m.EnabledHeroId - } - return nil -} - -func (m *CDOTALobbyMember) GetCoachTeam() DOTA_GC_TEAM { - if m != nil && m.CoachTeam != nil { - return *m.CoachTeam - } - return Default_CDOTALobbyMember_CoachTeam -} - -func (m *CDOTALobbyMember) GetNexonPcBangNo() uint32 { - if m != nil && m.NexonPcBangNo != nil { - return *m.NexonPcBangNo - } - return 0 -} - -func (m *CDOTALobbyMember) GetNexonPcBangName() string { - if m != nil && m.NexonPcBangName != nil { - return *m.NexonPcBangName - } - return "" -} - -func (m *CDOTALobbyMember) GetXpBonuses() []*CDOTALobbyMember_CDOTALobbyMemberXPBonus { - if m != nil { - return m.XpBonuses - } - return nil -} - -func (m *CDOTALobbyMember) GetRankChange() int32 { - if m != nil && m.RankChange != nil { - return *m.RankChange - } - return 0 -} - -func (m *CDOTALobbyMember) GetCameraman() bool { - if m != nil && m.Cameraman != nil { - return *m.Cameraman - } - return false -} - -func (m *CDOTALobbyMember) GetCustomGameProductIds() []uint32 { - if m != nil { - return m.CustomGameProductIds - } - return nil -} - -type CDOTALobbyMember_CDOTALobbyMemberXPBonus struct { - Type *uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - XpBonus *float32 `protobuf:"fixed32,2,opt,name=xp_bonus" json:"xp_bonus,omitempty"` - SourceKey *uint64 `protobuf:"varint,3,opt,name=source_key" json:"source_key,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDOTALobbyMember_CDOTALobbyMemberXPBonus) Reset() { - *m = CDOTALobbyMember_CDOTALobbyMemberXPBonus{} -} -func (m *CDOTALobbyMember_CDOTALobbyMemberXPBonus) String() string { return proto.CompactTextString(m) } -func (*CDOTALobbyMember_CDOTALobbyMemberXPBonus) ProtoMessage() {} -func (*CDOTALobbyMember_CDOTALobbyMemberXPBonus) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{8, 0} -} - -func (m *CDOTALobbyMember_CDOTALobbyMemberXPBonus) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CDOTALobbyMember_CDOTALobbyMemberXPBonus) GetXpBonus() float32 { - if m != nil && m.XpBonus != nil { - return *m.XpBonus - } - return 0 -} - -func (m *CDOTALobbyMember_CDOTALobbyMemberXPBonus) GetSourceKey() uint64 { - if m != nil && m.SourceKey != nil { - return *m.SourceKey - } - return 0 -} - -type CLobbyTeamDetails struct { - TeamName *string `protobuf:"bytes,1,opt,name=team_name" json:"team_name,omitempty"` - TeamTag *string `protobuf:"bytes,3,opt,name=team_tag" json:"team_tag,omitempty"` - TeamId *uint32 `protobuf:"varint,4,opt,name=team_id" json:"team_id,omitempty"` - TeamLogo *uint64 `protobuf:"varint,5,opt,name=team_logo" json:"team_logo,omitempty"` - TeamBaseLogo *uint64 `protobuf:"varint,6,opt,name=team_base_logo" json:"team_base_logo,omitempty"` - TeamBannerLogo *uint64 `protobuf:"varint,7,opt,name=team_banner_logo" json:"team_banner_logo,omitempty"` - TeamComplete *bool `protobuf:"varint,8,opt,name=team_complete" json:"team_complete,omitempty"` - GuildName *string `protobuf:"bytes,9,opt,name=guild_name" json:"guild_name,omitempty"` - GuildTag *string `protobuf:"bytes,10,opt,name=guild_tag" json:"guild_tag,omitempty"` - GuildId *uint32 `protobuf:"varint,11,opt,name=guild_id" json:"guild_id,omitempty"` - GuildLogo *uint64 `protobuf:"varint,12,opt,name=guild_logo" json:"guild_logo,omitempty"` - GuildBaseLogo *uint64 `protobuf:"varint,13,opt,name=guild_base_logo" json:"guild_base_logo,omitempty"` - GuildBannerLogo *uint64 `protobuf:"varint,14,opt,name=guild_banner_logo" json:"guild_banner_logo,omitempty"` - Rank *uint32 `protobuf:"varint,15,opt,name=rank" json:"rank,omitempty"` - RankChange *int32 `protobuf:"zigzag32,16,opt,name=rank_change" json:"rank_change,omitempty"` - IsHomeTeam *bool `protobuf:"varint,17,opt,name=is_home_team" json:"is_home_team,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CLobbyTeamDetails) Reset() { *m = CLobbyTeamDetails{} } -func (m *CLobbyTeamDetails) String() string { return proto.CompactTextString(m) } -func (*CLobbyTeamDetails) ProtoMessage() {} -func (*CLobbyTeamDetails) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{9} } - -func (m *CLobbyTeamDetails) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CLobbyTeamDetails) GetTeamTag() string { - if m != nil && m.TeamTag != nil { - return *m.TeamTag - } - return "" -} - -func (m *CLobbyTeamDetails) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CLobbyTeamDetails) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -func (m *CLobbyTeamDetails) GetTeamBaseLogo() uint64 { - if m != nil && m.TeamBaseLogo != nil { - return *m.TeamBaseLogo - } - return 0 -} - -func (m *CLobbyTeamDetails) GetTeamBannerLogo() uint64 { - if m != nil && m.TeamBannerLogo != nil { - return *m.TeamBannerLogo - } - return 0 -} - -func (m *CLobbyTeamDetails) GetTeamComplete() bool { - if m != nil && m.TeamComplete != nil { - return *m.TeamComplete - } - return false -} - -func (m *CLobbyTeamDetails) GetGuildName() string { - if m != nil && m.GuildName != nil { - return *m.GuildName - } - return "" -} - -func (m *CLobbyTeamDetails) GetGuildTag() string { - if m != nil && m.GuildTag != nil { - return *m.GuildTag - } - return "" -} - -func (m *CLobbyTeamDetails) GetGuildId() uint32 { - if m != nil && m.GuildId != nil { - return *m.GuildId - } - return 0 -} - -func (m *CLobbyTeamDetails) GetGuildLogo() uint64 { - if m != nil && m.GuildLogo != nil { - return *m.GuildLogo - } - return 0 -} - -func (m *CLobbyTeamDetails) GetGuildBaseLogo() uint64 { - if m != nil && m.GuildBaseLogo != nil { - return *m.GuildBaseLogo - } - return 0 -} - -func (m *CLobbyTeamDetails) GetGuildBannerLogo() uint64 { - if m != nil && m.GuildBannerLogo != nil { - return *m.GuildBannerLogo - } - return 0 -} - -func (m *CLobbyTeamDetails) GetRank() uint32 { - if m != nil && m.Rank != nil { - return *m.Rank - } - return 0 -} - -func (m *CLobbyTeamDetails) GetRankChange() int32 { - if m != nil && m.RankChange != nil { - return *m.RankChange - } - return 0 -} - -func (m *CLobbyTeamDetails) GetIsHomeTeam() bool { - if m != nil && m.IsHomeTeam != nil { - return *m.IsHomeTeam - } - return false -} - -type CLobbyTimedRewardDetails struct { - ItemDefIndex *uint32 `protobuf:"varint,2,opt,name=item_def_index" json:"item_def_index,omitempty"` - IsSupplyCrate *bool `protobuf:"varint,3,opt,name=is_supply_crate" json:"is_supply_crate,omitempty"` - IsTimedDrop *bool `protobuf:"varint,4,opt,name=is_timed_drop" json:"is_timed_drop,omitempty"` - AccountId *uint32 `protobuf:"varint,5,opt,name=account_id" json:"account_id,omitempty"` - Origin *uint32 `protobuf:"varint,6,opt,name=origin" json:"origin,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CLobbyTimedRewardDetails) Reset() { *m = CLobbyTimedRewardDetails{} } -func (m *CLobbyTimedRewardDetails) String() string { return proto.CompactTextString(m) } -func (*CLobbyTimedRewardDetails) ProtoMessage() {} -func (*CLobbyTimedRewardDetails) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{10} } - -func (m *CLobbyTimedRewardDetails) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CLobbyTimedRewardDetails) GetIsSupplyCrate() bool { - if m != nil && m.IsSupplyCrate != nil { - return *m.IsSupplyCrate - } - return false -} - -func (m *CLobbyTimedRewardDetails) GetIsTimedDrop() bool { - if m != nil && m.IsTimedDrop != nil { - return *m.IsTimedDrop - } - return false -} - -func (m *CLobbyTimedRewardDetails) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CLobbyTimedRewardDetails) GetOrigin() uint32 { - if m != nil && m.Origin != nil { - return *m.Origin - } - return 0 -} - -type CLobbyBroadcastChannelInfo struct { - ChannelId *uint32 `protobuf:"varint,1,opt,name=channel_id" json:"channel_id,omitempty"` - CountryCode *string `protobuf:"bytes,2,opt,name=country_code" json:"country_code,omitempty"` - Description *string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - LanguageCode *string `protobuf:"bytes,4,opt,name=language_code" json:"language_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CLobbyBroadcastChannelInfo) Reset() { *m = CLobbyBroadcastChannelInfo{} } -func (m *CLobbyBroadcastChannelInfo) String() string { return proto.CompactTextString(m) } -func (*CLobbyBroadcastChannelInfo) ProtoMessage() {} -func (*CLobbyBroadcastChannelInfo) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{11} } - -func (m *CLobbyBroadcastChannelInfo) GetChannelId() uint32 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CLobbyBroadcastChannelInfo) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CLobbyBroadcastChannelInfo) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CLobbyBroadcastChannelInfo) GetLanguageCode() string { - if m != nil && m.LanguageCode != nil { - return *m.LanguageCode - } - return "" -} - -type CSODOTALobby struct { - LobbyId *uint64 `protobuf:"varint,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - Members []*CDOTALobbyMember `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` - LeftMembers []*CDOTALobbyMember `protobuf:"bytes,7,rep,name=left_members" json:"left_members,omitempty"` - LeaderId *uint64 `protobuf:"fixed64,11,opt,name=leader_id" json:"leader_id,omitempty"` - ServerId *uint64 `protobuf:"fixed64,6,opt,name=server_id,def=0" json:"server_id,omitempty"` - GameMode *uint32 `protobuf:"varint,3,opt,name=game_mode" json:"game_mode,omitempty"` - PendingInvites []uint64 `protobuf:"fixed64,10,rep,name=pending_invites" json:"pending_invites,omitempty"` - State *CSODOTALobby_State `protobuf:"varint,4,opt,name=state,enum=CSODOTALobby_State,def=0" json:"state,omitempty"` - Connect *string `protobuf:"bytes,5,opt,name=connect" json:"connect,omitempty"` - LobbyType *CSODOTALobby_LobbyType `protobuf:"varint,12,opt,name=lobby_type,enum=CSODOTALobby_LobbyType,def=-1" json:"lobby_type,omitempty"` - AllowCheats *bool `protobuf:"varint,13,opt,name=allow_cheats" json:"allow_cheats,omitempty"` - FillWithBots *bool `protobuf:"varint,14,opt,name=fill_with_bots" json:"fill_with_bots,omitempty"` - IntroMode *bool `protobuf:"varint,15,opt,name=intro_mode" json:"intro_mode,omitempty"` - GameName *string `protobuf:"bytes,16,opt,name=game_name" json:"game_name,omitempty"` - TeamDetails []*CLobbyTeamDetails `protobuf:"bytes,17,rep,name=team_details" json:"team_details,omitempty"` - TutorialLesson *uint32 `protobuf:"varint,18,opt,name=tutorial_lesson" json:"tutorial_lesson,omitempty"` - TournamentId *uint32 `protobuf:"varint,19,opt,name=tournament_id" json:"tournament_id,omitempty"` - TournamentGameId *uint32 `protobuf:"varint,20,opt,name=tournament_game_id" json:"tournament_game_id,omitempty"` - ServerRegion *uint32 `protobuf:"varint,21,opt,name=server_region,def=0" json:"server_region,omitempty"` - GameState *DOTA_GameState `protobuf:"varint,22,opt,name=game_state,enum=DOTA_GameState,def=0" json:"game_state,omitempty"` - NumSpectators *uint32 `protobuf:"varint,23,opt,name=num_spectators" json:"num_spectators,omitempty"` - Matchgroup *uint32 `protobuf:"varint,25,opt,name=matchgroup" json:"matchgroup,omitempty"` - CmPick *DOTA_CM_PICK `protobuf:"varint,28,opt,name=cm_pick,enum=DOTA_CM_PICK,def=0" json:"cm_pick,omitempty"` - MatchId *uint64 `protobuf:"varint,30,opt,name=match_id" json:"match_id,omitempty"` - AllowSpectating *bool `protobuf:"varint,31,opt,name=allow_spectating,def=1" json:"allow_spectating,omitempty"` - BotDifficulty *DOTABotDifficulty `protobuf:"varint,36,opt,name=bot_difficulty,enum=DOTABotDifficulty,def=3" json:"bot_difficulty,omitempty"` - GameVersion *DOTAGameVersion `protobuf:"varint,37,opt,name=game_version,enum=DOTAGameVersion,def=0" json:"game_version,omitempty"` - TimedRewardDetails []*CLobbyTimedRewardDetails `protobuf:"bytes,38,rep,name=timed_reward_details" json:"timed_reward_details,omitempty"` - PassKey *string `protobuf:"bytes,39,opt,name=pass_key" json:"pass_key,omitempty"` - BotSlotDifficulty []DOTABotDifficulty `protobuf:"varint,41,rep,name=bot_slot_difficulty,enum=DOTABotDifficulty" json:"bot_slot_difficulty,omitempty"` - Leagueid *uint32 `protobuf:"varint,42,opt,name=leagueid" json:"leagueid,omitempty"` - PenaltyLevelRadiant *uint32 `protobuf:"varint,43,opt,name=penalty_level_radiant,def=0" json:"penalty_level_radiant,omitempty"` - PenaltyLevelDire *uint32 `protobuf:"varint,44,opt,name=penalty_level_dire,def=0" json:"penalty_level_dire,omitempty"` - LoadGameId *uint32 `protobuf:"varint,45,opt,name=load_game_id" json:"load_game_id,omitempty"` - SeriesType *uint32 `protobuf:"varint,46,opt,name=series_type" json:"series_type,omitempty"` - RadiantSeriesWins *uint32 `protobuf:"varint,47,opt,name=radiant_series_wins" json:"radiant_series_wins,omitempty"` - DireSeriesWins *uint32 `protobuf:"varint,48,opt,name=dire_series_wins" json:"dire_series_wins,omitempty"` - LootGenerated *uint32 `protobuf:"varint,49,opt,name=loot_generated" json:"loot_generated,omitempty"` - LootAwarded *uint32 `protobuf:"varint,50,opt,name=loot_awarded" json:"loot_awarded,omitempty"` - Allchat *bool `protobuf:"varint,51,opt,name=allchat,def=0" json:"allchat,omitempty"` - DotaTvDelay *LobbyDotaTVDelay `protobuf:"varint,53,opt,name=dota_tv_delay,enum=LobbyDotaTVDelay,def=0" json:"dota_tv_delay,omitempty"` - CustomGameMode *string `protobuf:"bytes,54,opt,name=custom_game_mode" json:"custom_game_mode,omitempty"` - CustomMapName *string `protobuf:"bytes,55,opt,name=custom_map_name" json:"custom_map_name,omitempty"` - CustomDifficulty *uint32 `protobuf:"varint,56,opt,name=custom_difficulty" json:"custom_difficulty,omitempty"` - Lan *bool `protobuf:"varint,57,opt,name=lan" json:"lan,omitempty"` - BroadcastChannelInfo []*CLobbyBroadcastChannelInfo `protobuf:"bytes,58,rep,name=broadcast_channel_info" json:"broadcast_channel_info,omitempty"` - FirstLeaverAccountid *uint32 `protobuf:"varint,59,opt,name=first_leaver_accountid" json:"first_leaver_accountid,omitempty"` - SeriesId *uint32 `protobuf:"varint,60,opt,name=series_id" json:"series_id,omitempty"` - LowPriority *bool `protobuf:"varint,61,opt,name=low_priority" json:"low_priority,omitempty"` - ExtraMessages []*CSODOTALobby_CExtraMsg `protobuf:"bytes,62,rep,name=extra_messages" json:"extra_messages,omitempty"` - SaveGame *CDOTASaveGame `protobuf:"bytes,63,opt,name=save_game" json:"save_game,omitempty"` - FirstBloodHappened *bool `protobuf:"varint,65,opt,name=first_blood_happened" json:"first_blood_happened,omitempty"` - MatchOutcome *EMatchOutcome `protobuf:"varint,70,opt,name=match_outcome,enum=EMatchOutcome,def=0" json:"match_outcome,omitempty"` - MassDisconnect *bool `protobuf:"varint,67,opt,name=mass_disconnect" json:"mass_disconnect,omitempty"` - CustomGameId *uint64 `protobuf:"varint,68,opt,name=custom_game_id" json:"custom_game_id,omitempty"` - ActiveIngameEvents []EEvent `protobuf:"varint,69,rep,name=active_ingame_events,enum=EEvent" json:"active_ingame_events,omitempty"` - CustomMinPlayers *uint32 `protobuf:"varint,71,opt,name=custom_min_players" json:"custom_min_players,omitempty"` - CustomMaxPlayers *uint32 `protobuf:"varint,72,opt,name=custom_max_players" json:"custom_max_players,omitempty"` - PartnerType *PartnerAccountType `protobuf:"varint,73,opt,name=partner_type,enum=PartnerAccountType,def=0" json:"partner_type,omitempty"` - LanHostPingToServerRegion *uint32 `protobuf:"varint,74,opt,name=lan_host_ping_to_server_region" json:"lan_host_ping_to_server_region,omitempty"` - Visibility *DOTALobbyVisibility `protobuf:"varint,75,opt,name=visibility,enum=DOTALobbyVisibility,def=0" json:"visibility,omitempty"` - CustomGameCrc *uint64 `protobuf:"fixed64,76,opt,name=custom_game_crc" json:"custom_game_crc,omitempty"` - CustomGameAutoCreatedLobby *bool `protobuf:"varint,77,opt,name=custom_game_auto_created_lobby" json:"custom_game_auto_created_lobby,omitempty"` - LeagueSeriesId *uint32 `protobuf:"varint,78,opt,name=league_series_id" json:"league_series_id,omitempty"` - LeagueGameId *uint32 `protobuf:"varint,79,opt,name=league_game_id" json:"league_game_id,omitempty"` - CustomGameTimestamp *uint32 `protobuf:"fixed32,80,opt,name=custom_game_timestamp" json:"custom_game_timestamp,omitempty"` - PreviousSeriesMatches []uint64 `protobuf:"varint,81,rep,name=previous_series_matches" json:"previous_series_matches,omitempty"` - PreviousMatchOverride *uint64 `protobuf:"varint,82,opt,name=previous_match_override" json:"previous_match_override,omitempty"` - CustomGameUsesAccountRecords *bool `protobuf:"varint,83,opt,name=custom_game_uses_account_records" json:"custom_game_uses_account_records,omitempty"` - LeagueSelectionPriorityTeam *uint32 `protobuf:"varint,84,opt,name=league_selection_priority_team" json:"league_selection_priority_team,omitempty"` - LeagueSelectionPriorityChoice *SelectionPriorityType `protobuf:"varint,85,opt,name=league_selection_priority_choice,enum=SelectionPriorityType,def=0" json:"league_selection_priority_choice,omitempty"` - LeagueNonSelectionPriorityChoice *SelectionPriorityType `protobuf:"varint,86,opt,name=league_non_selection_priority_choice,enum=SelectionPriorityType,def=0" json:"league_non_selection_priority_choice,omitempty"` - GameStartTime *uint32 `protobuf:"varint,87,opt,name=game_start_time" json:"game_start_time,omitempty"` - PauseSetting *LobbyDotaPauseSetting `protobuf:"varint,88,opt,name=pause_setting,enum=LobbyDotaPauseSetting,def=0" json:"pause_setting,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTALobby) Reset() { *m = CSODOTALobby{} } -func (m *CSODOTALobby) String() string { return proto.CompactTextString(m) } -func (*CSODOTALobby) ProtoMessage() {} -func (*CSODOTALobby) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{12} } - -const Default_CSODOTALobby_ServerId uint64 = 0 -const Default_CSODOTALobby_State CSODOTALobby_State = CSODOTALobby_UI -const Default_CSODOTALobby_LobbyType CSODOTALobby_LobbyType = CSODOTALobby_INVALID -const Default_CSODOTALobby_ServerRegion uint32 = 0 -const Default_CSODOTALobby_GameState DOTA_GameState = DOTA_GameState_DOTA_GAMERULES_STATE_INIT -const Default_CSODOTALobby_CmPick DOTA_CM_PICK = DOTA_CM_PICK_DOTA_CM_RANDOM -const Default_CSODOTALobby_AllowSpectating bool = true -const Default_CSODOTALobby_BotDifficulty DOTABotDifficulty = DOTABotDifficulty_BOT_DIFFICULTY_HARD -const Default_CSODOTALobby_GameVersion DOTAGameVersion = DOTAGameVersion_GAME_VERSION_CURRENT -const Default_CSODOTALobby_PenaltyLevelRadiant uint32 = 0 -const Default_CSODOTALobby_PenaltyLevelDire uint32 = 0 -const Default_CSODOTALobby_Allchat bool = false -const Default_CSODOTALobby_DotaTvDelay LobbyDotaTVDelay = LobbyDotaTVDelay_LobbyDotaTV_10 -const Default_CSODOTALobby_MatchOutcome EMatchOutcome = EMatchOutcome_k_EMatchOutcome_Unknown -const Default_CSODOTALobby_PartnerType PartnerAccountType = PartnerAccountType_PARTNER_NONE -const Default_CSODOTALobby_Visibility DOTALobbyVisibility = DOTALobbyVisibility_DOTALobbyVisibility_Public -const Default_CSODOTALobby_LeagueSelectionPriorityChoice SelectionPriorityType = SelectionPriorityType_UNDEFINED -const Default_CSODOTALobby_LeagueNonSelectionPriorityChoice SelectionPriorityType = SelectionPriorityType_UNDEFINED -const Default_CSODOTALobby_PauseSetting LobbyDotaPauseSetting = LobbyDotaPauseSetting_LobbyDotaPauseSetting_Unlimited - -func (m *CSODOTALobby) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CSODOTALobby) GetMembers() []*CDOTALobbyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CSODOTALobby) GetLeftMembers() []*CDOTALobbyMember { - if m != nil { - return m.LeftMembers - } - return nil -} - -func (m *CSODOTALobby) GetLeaderId() uint64 { - if m != nil && m.LeaderId != nil { - return *m.LeaderId - } - return 0 -} - -func (m *CSODOTALobby) GetServerId() uint64 { - if m != nil && m.ServerId != nil { - return *m.ServerId - } - return Default_CSODOTALobby_ServerId -} - -func (m *CSODOTALobby) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CSODOTALobby) GetPendingInvites() []uint64 { - if m != nil { - return m.PendingInvites - } - return nil -} - -func (m *CSODOTALobby) GetState() CSODOTALobby_State { - if m != nil && m.State != nil { - return *m.State - } - return Default_CSODOTALobby_State -} - -func (m *CSODOTALobby) GetConnect() string { - if m != nil && m.Connect != nil { - return *m.Connect - } - return "" -} - -func (m *CSODOTALobby) GetLobbyType() CSODOTALobby_LobbyType { - if m != nil && m.LobbyType != nil { - return *m.LobbyType - } - return Default_CSODOTALobby_LobbyType -} - -func (m *CSODOTALobby) GetAllowCheats() bool { - if m != nil && m.AllowCheats != nil { - return *m.AllowCheats - } - return false -} - -func (m *CSODOTALobby) GetFillWithBots() bool { - if m != nil && m.FillWithBots != nil { - return *m.FillWithBots - } - return false -} - -func (m *CSODOTALobby) GetIntroMode() bool { - if m != nil && m.IntroMode != nil { - return *m.IntroMode - } - return false -} - -func (m *CSODOTALobby) GetGameName() string { - if m != nil && m.GameName != nil { - return *m.GameName - } - return "" -} - -func (m *CSODOTALobby) GetTeamDetails() []*CLobbyTeamDetails { - if m != nil { - return m.TeamDetails - } - return nil -} - -func (m *CSODOTALobby) GetTutorialLesson() uint32 { - if m != nil && m.TutorialLesson != nil { - return *m.TutorialLesson - } - return 0 -} - -func (m *CSODOTALobby) GetTournamentId() uint32 { - if m != nil && m.TournamentId != nil { - return *m.TournamentId - } - return 0 -} - -func (m *CSODOTALobby) GetTournamentGameId() uint32 { - if m != nil && m.TournamentGameId != nil { - return *m.TournamentGameId - } - return 0 -} - -func (m *CSODOTALobby) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return Default_CSODOTALobby_ServerRegion -} - -func (m *CSODOTALobby) GetGameState() DOTA_GameState { - if m != nil && m.GameState != nil { - return *m.GameState - } - return Default_CSODOTALobby_GameState -} - -func (m *CSODOTALobby) GetNumSpectators() uint32 { - if m != nil && m.NumSpectators != nil { - return *m.NumSpectators - } - return 0 -} - -func (m *CSODOTALobby) GetMatchgroup() uint32 { - if m != nil && m.Matchgroup != nil { - return *m.Matchgroup - } - return 0 -} - -func (m *CSODOTALobby) GetCmPick() DOTA_CM_PICK { - if m != nil && m.CmPick != nil { - return *m.CmPick - } - return Default_CSODOTALobby_CmPick -} - -func (m *CSODOTALobby) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CSODOTALobby) GetAllowSpectating() bool { - if m != nil && m.AllowSpectating != nil { - return *m.AllowSpectating - } - return Default_CSODOTALobby_AllowSpectating -} - -func (m *CSODOTALobby) GetBotDifficulty() DOTABotDifficulty { - if m != nil && m.BotDifficulty != nil { - return *m.BotDifficulty - } - return Default_CSODOTALobby_BotDifficulty -} - -func (m *CSODOTALobby) GetGameVersion() DOTAGameVersion { - if m != nil && m.GameVersion != nil { - return *m.GameVersion - } - return Default_CSODOTALobby_GameVersion -} - -func (m *CSODOTALobby) GetTimedRewardDetails() []*CLobbyTimedRewardDetails { - if m != nil { - return m.TimedRewardDetails - } - return nil -} - -func (m *CSODOTALobby) GetPassKey() string { - if m != nil && m.PassKey != nil { - return *m.PassKey - } - return "" -} - -func (m *CSODOTALobby) GetBotSlotDifficulty() []DOTABotDifficulty { - if m != nil { - return m.BotSlotDifficulty - } - return nil -} - -func (m *CSODOTALobby) GetLeagueid() uint32 { - if m != nil && m.Leagueid != nil { - return *m.Leagueid - } - return 0 -} - -func (m *CSODOTALobby) GetPenaltyLevelRadiant() uint32 { - if m != nil && m.PenaltyLevelRadiant != nil { - return *m.PenaltyLevelRadiant - } - return Default_CSODOTALobby_PenaltyLevelRadiant -} - -func (m *CSODOTALobby) GetPenaltyLevelDire() uint32 { - if m != nil && m.PenaltyLevelDire != nil { - return *m.PenaltyLevelDire - } - return Default_CSODOTALobby_PenaltyLevelDire -} - -func (m *CSODOTALobby) GetLoadGameId() uint32 { - if m != nil && m.LoadGameId != nil { - return *m.LoadGameId - } - return 0 -} - -func (m *CSODOTALobby) GetSeriesType() uint32 { - if m != nil && m.SeriesType != nil { - return *m.SeriesType - } - return 0 -} - -func (m *CSODOTALobby) GetRadiantSeriesWins() uint32 { - if m != nil && m.RadiantSeriesWins != nil { - return *m.RadiantSeriesWins - } - return 0 -} - -func (m *CSODOTALobby) GetDireSeriesWins() uint32 { - if m != nil && m.DireSeriesWins != nil { - return *m.DireSeriesWins - } - return 0 -} - -func (m *CSODOTALobby) GetLootGenerated() uint32 { - if m != nil && m.LootGenerated != nil { - return *m.LootGenerated - } - return 0 -} - -func (m *CSODOTALobby) GetLootAwarded() uint32 { - if m != nil && m.LootAwarded != nil { - return *m.LootAwarded - } - return 0 -} - -func (m *CSODOTALobby) GetAllchat() bool { - if m != nil && m.Allchat != nil { - return *m.Allchat - } - return Default_CSODOTALobby_Allchat -} - -func (m *CSODOTALobby) GetDotaTvDelay() LobbyDotaTVDelay { - if m != nil && m.DotaTvDelay != nil { - return *m.DotaTvDelay - } - return Default_CSODOTALobby_DotaTvDelay -} - -func (m *CSODOTALobby) GetCustomGameMode() string { - if m != nil && m.CustomGameMode != nil { - return *m.CustomGameMode - } - return "" -} - -func (m *CSODOTALobby) GetCustomMapName() string { - if m != nil && m.CustomMapName != nil { - return *m.CustomMapName - } - return "" -} - -func (m *CSODOTALobby) GetCustomDifficulty() uint32 { - if m != nil && m.CustomDifficulty != nil { - return *m.CustomDifficulty - } - return 0 -} - -func (m *CSODOTALobby) GetLan() bool { - if m != nil && m.Lan != nil { - return *m.Lan - } - return false -} - -func (m *CSODOTALobby) GetBroadcastChannelInfo() []*CLobbyBroadcastChannelInfo { - if m != nil { - return m.BroadcastChannelInfo - } - return nil -} - -func (m *CSODOTALobby) GetFirstLeaverAccountid() uint32 { - if m != nil && m.FirstLeaverAccountid != nil { - return *m.FirstLeaverAccountid - } - return 0 -} - -func (m *CSODOTALobby) GetSeriesId() uint32 { - if m != nil && m.SeriesId != nil { - return *m.SeriesId - } - return 0 -} - -func (m *CSODOTALobby) GetLowPriority() bool { - if m != nil && m.LowPriority != nil { - return *m.LowPriority - } - return false -} - -func (m *CSODOTALobby) GetExtraMessages() []*CSODOTALobby_CExtraMsg { - if m != nil { - return m.ExtraMessages - } - return nil -} - -func (m *CSODOTALobby) GetSaveGame() *CDOTASaveGame { - if m != nil { - return m.SaveGame - } - return nil -} - -func (m *CSODOTALobby) GetFirstBloodHappened() bool { - if m != nil && m.FirstBloodHappened != nil { - return *m.FirstBloodHappened - } - return false -} - -func (m *CSODOTALobby) GetMatchOutcome() EMatchOutcome { - if m != nil && m.MatchOutcome != nil { - return *m.MatchOutcome - } - return Default_CSODOTALobby_MatchOutcome -} - -func (m *CSODOTALobby) GetMassDisconnect() bool { - if m != nil && m.MassDisconnect != nil { - return *m.MassDisconnect - } - return false -} - -func (m *CSODOTALobby) GetCustomGameId() uint64 { - if m != nil && m.CustomGameId != nil { - return *m.CustomGameId - } - return 0 -} - -func (m *CSODOTALobby) GetActiveIngameEvents() []EEvent { - if m != nil { - return m.ActiveIngameEvents - } - return nil -} - -func (m *CSODOTALobby) GetCustomMinPlayers() uint32 { - if m != nil && m.CustomMinPlayers != nil { - return *m.CustomMinPlayers - } - return 0 -} - -func (m *CSODOTALobby) GetCustomMaxPlayers() uint32 { - if m != nil && m.CustomMaxPlayers != nil { - return *m.CustomMaxPlayers - } - return 0 -} - -func (m *CSODOTALobby) GetPartnerType() PartnerAccountType { - if m != nil && m.PartnerType != nil { - return *m.PartnerType - } - return Default_CSODOTALobby_PartnerType -} - -func (m *CSODOTALobby) GetLanHostPingToServerRegion() uint32 { - if m != nil && m.LanHostPingToServerRegion != nil { - return *m.LanHostPingToServerRegion - } - return 0 -} - -func (m *CSODOTALobby) GetVisibility() DOTALobbyVisibility { - if m != nil && m.Visibility != nil { - return *m.Visibility - } - return Default_CSODOTALobby_Visibility -} - -func (m *CSODOTALobby) GetCustomGameCrc() uint64 { - if m != nil && m.CustomGameCrc != nil { - return *m.CustomGameCrc - } - return 0 -} - -func (m *CSODOTALobby) GetCustomGameAutoCreatedLobby() bool { - if m != nil && m.CustomGameAutoCreatedLobby != nil { - return *m.CustomGameAutoCreatedLobby - } - return false -} - -func (m *CSODOTALobby) GetLeagueSeriesId() uint32 { - if m != nil && m.LeagueSeriesId != nil { - return *m.LeagueSeriesId - } - return 0 -} - -func (m *CSODOTALobby) GetLeagueGameId() uint32 { - if m != nil && m.LeagueGameId != nil { - return *m.LeagueGameId - } - return 0 -} - -func (m *CSODOTALobby) GetCustomGameTimestamp() uint32 { - if m != nil && m.CustomGameTimestamp != nil { - return *m.CustomGameTimestamp - } - return 0 -} - -func (m *CSODOTALobby) GetPreviousSeriesMatches() []uint64 { - if m != nil { - return m.PreviousSeriesMatches - } - return nil -} - -func (m *CSODOTALobby) GetPreviousMatchOverride() uint64 { - if m != nil && m.PreviousMatchOverride != nil { - return *m.PreviousMatchOverride - } - return 0 -} - -func (m *CSODOTALobby) GetCustomGameUsesAccountRecords() bool { - if m != nil && m.CustomGameUsesAccountRecords != nil { - return *m.CustomGameUsesAccountRecords - } - return false -} - -func (m *CSODOTALobby) GetLeagueSelectionPriorityTeam() uint32 { - if m != nil && m.LeagueSelectionPriorityTeam != nil { - return *m.LeagueSelectionPriorityTeam - } - return 0 -} - -func (m *CSODOTALobby) GetLeagueSelectionPriorityChoice() SelectionPriorityType { - if m != nil && m.LeagueSelectionPriorityChoice != nil { - return *m.LeagueSelectionPriorityChoice - } - return Default_CSODOTALobby_LeagueSelectionPriorityChoice -} - -func (m *CSODOTALobby) GetLeagueNonSelectionPriorityChoice() SelectionPriorityType { - if m != nil && m.LeagueNonSelectionPriorityChoice != nil { - return *m.LeagueNonSelectionPriorityChoice - } - return Default_CSODOTALobby_LeagueNonSelectionPriorityChoice -} - -func (m *CSODOTALobby) GetGameStartTime() uint32 { - if m != nil && m.GameStartTime != nil { - return *m.GameStartTime - } - return 0 -} - -func (m *CSODOTALobby) GetPauseSetting() LobbyDotaPauseSetting { - if m != nil && m.PauseSetting != nil { - return *m.PauseSetting - } - return Default_CSODOTALobby_PauseSetting -} - -type CSODOTALobby_CExtraMsg struct { - Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Contents []byte `protobuf:"bytes,2,opt,name=contents" json:"contents,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTALobby_CExtraMsg) Reset() { *m = CSODOTALobby_CExtraMsg{} } -func (m *CSODOTALobby_CExtraMsg) String() string { return proto.CompactTextString(m) } -func (*CSODOTALobby_CExtraMsg) ProtoMessage() {} -func (*CSODOTALobby_CExtraMsg) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{12, 0} } - -func (m *CSODOTALobby_CExtraMsg) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CSODOTALobby_CExtraMsg) GetContents() []byte { - if m != nil { - return m.Contents - } - return nil -} - -type CMsgLobbyEventPoints struct { - EventId *uint32 `protobuf:"varint,1,opt,name=event_id" json:"event_id,omitempty"` - AccountPoints []*CMsgLobbyEventPoints_AccountPoints `protobuf:"bytes,2,rep,name=account_points" json:"account_points,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLobbyEventPoints) Reset() { *m = CMsgLobbyEventPoints{} } -func (m *CMsgLobbyEventPoints) String() string { return proto.CompactTextString(m) } -func (*CMsgLobbyEventPoints) ProtoMessage() {} -func (*CMsgLobbyEventPoints) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{13} } - -func (m *CMsgLobbyEventPoints) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgLobbyEventPoints) GetAccountPoints() []*CMsgLobbyEventPoints_AccountPoints { - if m != nil { - return m.AccountPoints - } - return nil -} - -type CMsgLobbyEventPoints_AccountPoints struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - NormalPoints *uint32 `protobuf:"varint,2,opt,name=normal_points" json:"normal_points,omitempty"` - PremiumPoints *uint32 `protobuf:"varint,3,opt,name=premium_points" json:"premium_points,omitempty"` - Owned *bool `protobuf:"varint,4,opt,name=owned" json:"owned,omitempty"` - FavoriteTeam *uint32 `protobuf:"varint,5,opt,name=favorite_team" json:"favorite_team,omitempty"` - FavoriteTeamLevel *uint32 `protobuf:"varint,6,opt,name=favorite_team_level" json:"favorite_team_level,omitempty"` - PointsHeld *uint32 `protobuf:"varint,7,opt,name=points_held" json:"points_held,omitempty"` - PremiumPointsHeld *uint32 `protobuf:"varint,8,opt,name=premium_points_held" json:"premium_points_held,omitempty"` - FavoriteTeamFoilLevel *uint32 `protobuf:"varint,9,opt,name=favorite_team_foil_level" json:"favorite_team_foil_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLobbyEventPoints_AccountPoints) Reset() { *m = CMsgLobbyEventPoints_AccountPoints{} } -func (m *CMsgLobbyEventPoints_AccountPoints) String() string { return proto.CompactTextString(m) } -func (*CMsgLobbyEventPoints_AccountPoints) ProtoMessage() {} -func (*CMsgLobbyEventPoints_AccountPoints) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{13, 0} -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetNormalPoints() uint32 { - if m != nil && m.NormalPoints != nil { - return *m.NormalPoints - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetPremiumPoints() uint32 { - if m != nil && m.PremiumPoints != nil { - return *m.PremiumPoints - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetOwned() bool { - if m != nil && m.Owned != nil { - return *m.Owned - } - return false -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetFavoriteTeam() uint32 { - if m != nil && m.FavoriteTeam != nil { - return *m.FavoriteTeam - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetFavoriteTeamLevel() uint32 { - if m != nil && m.FavoriteTeamLevel != nil { - return *m.FavoriteTeamLevel - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetPointsHeld() uint32 { - if m != nil && m.PointsHeld != nil { - return *m.PointsHeld - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetPremiumPointsHeld() uint32 { - if m != nil && m.PremiumPointsHeld != nil { - return *m.PremiumPointsHeld - } - return 0 -} - -func (m *CMsgLobbyEventPoints_AccountPoints) GetFavoriteTeamFoilLevel() uint32 { - if m != nil && m.FavoriteTeamFoilLevel != nil { - return *m.FavoriteTeamFoilLevel - } - return 0 -} - -type CMsgDOTABroadcastNotification struct { - Message *string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTABroadcastNotification) Reset() { *m = CMsgDOTABroadcastNotification{} } -func (m *CMsgDOTABroadcastNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTABroadcastNotification) ProtoMessage() {} -func (*CMsgDOTABroadcastNotification) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{14} } - -func (m *CMsgDOTABroadcastNotification) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type CMsgDOTAPCBangTimedReward struct { - Persona *string `protobuf:"bytes,1,opt,name=persona" json:"persona,omitempty"` - Itemdef *uint32 `protobuf:"varint,2,opt,name=itemdef" json:"itemdef,omitempty"` - Pcbangname *string `protobuf:"bytes,3,opt,name=pcbangname" json:"pcbangname,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAPCBangTimedReward) Reset() { *m = CMsgDOTAPCBangTimedReward{} } -func (m *CMsgDOTAPCBangTimedReward) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAPCBangTimedReward) ProtoMessage() {} -func (*CMsgDOTAPCBangTimedReward) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{15} } - -func (m *CMsgDOTAPCBangTimedReward) GetPersona() string { - if m != nil && m.Persona != nil { - return *m.Persona - } - return "" -} - -func (m *CMsgDOTAPCBangTimedReward) GetItemdef() uint32 { - if m != nil && m.Itemdef != nil { - return *m.Itemdef - } - return 0 -} - -func (m *CMsgDOTAPCBangTimedReward) GetPcbangname() string { - if m != nil && m.Pcbangname != nil { - return *m.Pcbangname - } - return "" -} - -type CProtoItemHeroStatue struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - StatusEffectIndex *uint32 `protobuf:"varint,2,opt,name=status_effect_index" json:"status_effect_index,omitempty"` - SequenceName *string `protobuf:"bytes,3,opt,name=sequence_name" json:"sequence_name,omitempty"` - Cycle *float32 `protobuf:"fixed32,4,opt,name=cycle" json:"cycle,omitempty"` - Wearable []uint32 `protobuf:"varint,5,rep,name=wearable" json:"wearable,omitempty"` - Inscription *string `protobuf:"bytes,6,opt,name=inscription" json:"inscription,omitempty"` - Style []uint32 `protobuf:"varint,7,rep,name=style" json:"style,omitempty"` - TournamentDrop *bool `protobuf:"varint,8,opt,name=tournament_drop" json:"tournament_drop,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemHeroStatue) Reset() { *m = CProtoItemHeroStatue{} } -func (m *CProtoItemHeroStatue) String() string { return proto.CompactTextString(m) } -func (*CProtoItemHeroStatue) ProtoMessage() {} -func (*CProtoItemHeroStatue) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{16} } - -func (m *CProtoItemHeroStatue) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CProtoItemHeroStatue) GetStatusEffectIndex() uint32 { - if m != nil && m.StatusEffectIndex != nil { - return *m.StatusEffectIndex - } - return 0 -} - -func (m *CProtoItemHeroStatue) GetSequenceName() string { - if m != nil && m.SequenceName != nil { - return *m.SequenceName - } - return "" -} - -func (m *CProtoItemHeroStatue) GetCycle() float32 { - if m != nil && m.Cycle != nil { - return *m.Cycle - } - return 0 -} - -func (m *CProtoItemHeroStatue) GetWearable() []uint32 { - if m != nil { - return m.Wearable - } - return nil -} - -func (m *CProtoItemHeroStatue) GetInscription() string { - if m != nil && m.Inscription != nil { - return *m.Inscription - } - return "" -} - -func (m *CProtoItemHeroStatue) GetStyle() []uint32 { - if m != nil { - return m.Style - } - return nil -} - -func (m *CProtoItemHeroStatue) GetTournamentDrop() bool { - if m != nil && m.TournamentDrop != nil { - return *m.TournamentDrop - } - return false -} - -type CProtoItemTeamShowcase struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - StatusEffectIndex *uint32 `protobuf:"varint,2,opt,name=status_effect_index" json:"status_effect_index,omitempty"` - SequenceName *string `protobuf:"bytes,3,opt,name=sequence_name" json:"sequence_name,omitempty"` - Cycle *float32 `protobuf:"fixed32,4,opt,name=cycle" json:"cycle,omitempty"` - Wearable []uint32 `protobuf:"varint,5,rep,name=wearable" json:"wearable,omitempty"` - Inscription *string `protobuf:"bytes,6,opt,name=inscription" json:"inscription,omitempty"` - Style []uint32 `protobuf:"varint,7,rep,name=style" json:"style,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemTeamShowcase) Reset() { *m = CProtoItemTeamShowcase{} } -func (m *CProtoItemTeamShowcase) String() string { return proto.CompactTextString(m) } -func (*CProtoItemTeamShowcase) ProtoMessage() {} -func (*CProtoItemTeamShowcase) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{17} } - -func (m *CProtoItemTeamShowcase) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CProtoItemTeamShowcase) GetStatusEffectIndex() uint32 { - if m != nil && m.StatusEffectIndex != nil { - return *m.StatusEffectIndex - } - return 0 -} - -func (m *CProtoItemTeamShowcase) GetSequenceName() string { - if m != nil && m.SequenceName != nil { - return *m.SequenceName - } - return "" -} - -func (m *CProtoItemTeamShowcase) GetCycle() float32 { - if m != nil && m.Cycle != nil { - return *m.Cycle - } - return 0 -} - -func (m *CProtoItemTeamShowcase) GetWearable() []uint32 { - if m != nil { - return m.Wearable - } - return nil -} - -func (m *CProtoItemTeamShowcase) GetInscription() string { - if m != nil && m.Inscription != nil { - return *m.Inscription - } - return "" -} - -func (m *CProtoItemTeamShowcase) GetStyle() []uint32 { - if m != nil { - return m.Style - } - return nil -} - -type CMatchPlayerAbilityUpgrade struct { - Ability *uint32 `protobuf:"varint,1,opt,name=ability" json:"ability,omitempty"` - Time *uint32 `protobuf:"varint,2,opt,name=time" json:"time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMatchPlayerAbilityUpgrade) Reset() { *m = CMatchPlayerAbilityUpgrade{} } -func (m *CMatchPlayerAbilityUpgrade) String() string { return proto.CompactTextString(m) } -func (*CMatchPlayerAbilityUpgrade) ProtoMessage() {} -func (*CMatchPlayerAbilityUpgrade) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{18} } - -func (m *CMatchPlayerAbilityUpgrade) GetAbility() uint32 { - if m != nil && m.Ability != nil { - return *m.Ability - } - return 0 -} - -func (m *CMatchPlayerAbilityUpgrade) GetTime() uint32 { - if m != nil && m.Time != nil { - return *m.Time - } - return 0 -} - -type CMatchAdditionalUnitInventory struct { - UnitName *string `protobuf:"bytes,1,opt,name=unit_name" json:"unit_name,omitempty"` - Items []uint32 `protobuf:"varint,2,rep,name=items" json:"items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMatchAdditionalUnitInventory) Reset() { *m = CMatchAdditionalUnitInventory{} } -func (m *CMatchAdditionalUnitInventory) String() string { return proto.CompactTextString(m) } -func (*CMatchAdditionalUnitInventory) ProtoMessage() {} -func (*CMatchAdditionalUnitInventory) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{19} } - -func (m *CMatchAdditionalUnitInventory) GetUnitName() string { - if m != nil && m.UnitName != nil { - return *m.UnitName - } - return "" -} - -func (m *CMatchAdditionalUnitInventory) GetItems() []uint32 { - if m != nil { - return m.Items - } - return nil -} - -type CMatchHeroSelectEvent struct { - IsPick *bool `protobuf:"varint,1,opt,name=is_pick" json:"is_pick,omitempty"` - Team *uint32 `protobuf:"varint,2,opt,name=team" json:"team,omitempty"` - HeroId *uint32 `protobuf:"varint,3,opt,name=hero_id" json:"hero_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMatchHeroSelectEvent) Reset() { *m = CMatchHeroSelectEvent{} } -func (m *CMatchHeroSelectEvent) String() string { return proto.CompactTextString(m) } -func (*CMatchHeroSelectEvent) ProtoMessage() {} -func (*CMatchHeroSelectEvent) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{20} } - -func (m *CMatchHeroSelectEvent) GetIsPick() bool { - if m != nil && m.IsPick != nil { - return *m.IsPick - } - return false -} - -func (m *CMatchHeroSelectEvent) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -func (m *CMatchHeroSelectEvent) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -type CMsgDOTAProcessFantasyScheduledEvent struct { - Event *uint32 `protobuf:"varint,1,opt,name=event" json:"event,omitempty"` - Timestamp *uint32 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,3,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - Season *uint32 `protobuf:"varint,4,opt,name=season" json:"season,omitempty"` - ReferenceData *uint32 `protobuf:"varint,5,opt,name=reference_data" json:"reference_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProcessFantasyScheduledEvent) Reset() { *m = CMsgDOTAProcessFantasyScheduledEvent{} } -func (m *CMsgDOTAProcessFantasyScheduledEvent) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProcessFantasyScheduledEvent) ProtoMessage() {} -func (*CMsgDOTAProcessFantasyScheduledEvent) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{21} -} - -func (m *CMsgDOTAProcessFantasyScheduledEvent) GetEvent() uint32 { - if m != nil && m.Event != nil { - return *m.Event - } - return 0 -} - -func (m *CMsgDOTAProcessFantasyScheduledEvent) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTAProcessFantasyScheduledEvent) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -func (m *CMsgDOTAProcessFantasyScheduledEvent) GetSeason() uint32 { - if m != nil && m.Season != nil { - return *m.Season - } - return 0 -} - -func (m *CMsgDOTAProcessFantasyScheduledEvent) GetReferenceData() uint32 { - if m != nil && m.ReferenceData != nil { - return *m.ReferenceData - } - return 0 -} - -type CMsgDOTAHasItemQuery struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHasItemQuery) Reset() { *m = CMsgDOTAHasItemQuery{} } -func (m *CMsgDOTAHasItemQuery) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHasItemQuery) ProtoMessage() {} -func (*CMsgDOTAHasItemQuery) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{22} } - -func (m *CMsgDOTAHasItemQuery) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAHasItemQuery) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgDOTAHasItemResponse struct { - HasItem *bool `protobuf:"varint,1,opt,name=has_item" json:"has_item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHasItemResponse) Reset() { *m = CMsgDOTAHasItemResponse{} } -func (m *CMsgDOTAHasItemResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHasItemResponse) ProtoMessage() {} -func (*CMsgDOTAHasItemResponse) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{23} } - -func (m *CMsgDOTAHasItemResponse) GetHasItem() bool { - if m != nil && m.HasItem != nil { - return *m.HasItem - } - return false -} - -type CMsgDOTAHasItemDefsQuery struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemdefIds []uint32 `protobuf:"varint,2,rep,name=itemdef_ids" json:"itemdef_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHasItemDefsQuery) Reset() { *m = CMsgDOTAHasItemDefsQuery{} } -func (m *CMsgDOTAHasItemDefsQuery) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHasItemDefsQuery) ProtoMessage() {} -func (*CMsgDOTAHasItemDefsQuery) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{24} } - -func (m *CMsgDOTAHasItemDefsQuery) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAHasItemDefsQuery) GetItemdefIds() []uint32 { - if m != nil { - return m.ItemdefIds - } - return nil -} - -type CMsgDOTAHasItemDefsResponse struct { - HasItems *bool `protobuf:"varint,1,opt,name=has_items" json:"has_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAHasItemDefsResponse) Reset() { *m = CMsgDOTAHasItemDefsResponse{} } -func (m *CMsgDOTAHasItemDefsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAHasItemDefsResponse) ProtoMessage() {} -func (*CMsgDOTAHasItemDefsResponse) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{25} } - -func (m *CMsgDOTAHasItemDefsResponse) GetHasItems() bool { - if m != nil && m.HasItems != nil { - return *m.HasItems - } - return false -} - -type CMsgDOTAConsumeFantasyTicket struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,3,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAConsumeFantasyTicket) Reset() { *m = CMsgDOTAConsumeFantasyTicket{} } -func (m *CMsgDOTAConsumeFantasyTicket) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAConsumeFantasyTicket) ProtoMessage() {} -func (*CMsgDOTAConsumeFantasyTicket) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{26} } - -func (m *CMsgDOTAConsumeFantasyTicket) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAConsumeFantasyTicket) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgDOTAConsumeFantasyTicket) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgDOTAConsumeFantasyTicketFailure struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - FantasyLeagueId *uint32 `protobuf:"varint,3,opt,name=fantasy_league_id" json:"fantasy_league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAConsumeFantasyTicketFailure) Reset() { *m = CMsgDOTAConsumeFantasyTicketFailure{} } -func (m *CMsgDOTAConsumeFantasyTicketFailure) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAConsumeFantasyTicketFailure) ProtoMessage() {} -func (*CMsgDOTAConsumeFantasyTicketFailure) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{27} -} - -func (m *CMsgDOTAConsumeFantasyTicketFailure) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAConsumeFantasyTicketFailure) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgDOTAConsumeFantasyTicketFailure) GetFantasyLeagueId() uint32 { - if m != nil && m.FantasyLeagueId != nil { - return *m.FantasyLeagueId - } - return 0 -} - -type CMsgGCToGCFantasySetMatchLeague struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,2,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCFantasySetMatchLeague) Reset() { *m = CMsgGCToGCFantasySetMatchLeague{} } -func (m *CMsgGCToGCFantasySetMatchLeague) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCFantasySetMatchLeague) ProtoMessage() {} -func (*CMsgGCToGCFantasySetMatchLeague) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{28} -} - -func (m *CMsgGCToGCFantasySetMatchLeague) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgGCToGCFantasySetMatchLeague) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CSODOTAMapLocationState struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - LocationId *int32 `protobuf:"varint,2,opt,name=location_id" json:"location_id,omitempty"` - Completed *bool `protobuf:"varint,3,opt,name=completed" json:"completed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAMapLocationState) Reset() { *m = CSODOTAMapLocationState{} } -func (m *CSODOTAMapLocationState) String() string { return proto.CompactTextString(m) } -func (*CSODOTAMapLocationState) ProtoMessage() {} -func (*CSODOTAMapLocationState) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{29} } - -func (m *CSODOTAMapLocationState) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSODOTAMapLocationState) GetLocationId() int32 { - if m != nil && m.LocationId != nil { - return *m.LocationId - } - return 0 -} - -func (m *CSODOTAMapLocationState) GetCompleted() bool { - if m != nil && m.Completed != nil { - return *m.Completed - } - return false -} - -type CMsgNexonPartnerUpdate struct { - Messagetype *uint32 `protobuf:"varint,1,opt,name=messagetype" json:"messagetype,omitempty"` - Timeremaining *uint32 `protobuf:"varint,2,opt,name=timeremaining" json:"timeremaining,omitempty"` - Terminate *bool `protobuf:"varint,3,opt,name=terminate" json:"terminate,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgNexonPartnerUpdate) Reset() { *m = CMsgNexonPartnerUpdate{} } -func (m *CMsgNexonPartnerUpdate) String() string { return proto.CompactTextString(m) } -func (*CMsgNexonPartnerUpdate) ProtoMessage() {} -func (*CMsgNexonPartnerUpdate) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{30} } - -func (m *CMsgNexonPartnerUpdate) GetMessagetype() uint32 { - if m != nil && m.Messagetype != nil { - return *m.Messagetype - } - return 0 -} - -func (m *CMsgNexonPartnerUpdate) GetTimeremaining() uint32 { - if m != nil && m.Timeremaining != nil { - return *m.Timeremaining - } - return 0 -} - -func (m *CMsgNexonPartnerUpdate) GetTerminate() bool { - if m != nil && m.Terminate != nil { - return *m.Terminate - } - return false -} - -type CMsgMakeOffering struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMakeOffering) Reset() { *m = CMsgMakeOffering{} } -func (m *CMsgMakeOffering) String() string { return proto.CompactTextString(m) } -func (*CMsgMakeOffering) ProtoMessage() {} -func (*CMsgMakeOffering) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{31} } - -func (m *CMsgMakeOffering) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgRequestOfferings struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestOfferings) Reset() { *m = CMsgRequestOfferings{} } -func (m *CMsgRequestOfferings) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestOfferings) ProtoMessage() {} -func (*CMsgRequestOfferings) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{32} } - -type CMsgRequestOfferingsResponse struct { - Offerings []*CMsgRequestOfferingsResponse_NewYearsOffering `protobuf:"bytes,1,rep,name=offerings" json:"offerings,omitempty"` - Completed *bool `protobuf:"varint,2,opt,name=completed" json:"completed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestOfferingsResponse) Reset() { *m = CMsgRequestOfferingsResponse{} } -func (m *CMsgRequestOfferingsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestOfferingsResponse) ProtoMessage() {} -func (*CMsgRequestOfferingsResponse) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{33} } - -func (m *CMsgRequestOfferingsResponse) GetOfferings() []*CMsgRequestOfferingsResponse_NewYearsOffering { - if m != nil { - return m.Offerings - } - return nil -} - -func (m *CMsgRequestOfferingsResponse) GetCompleted() bool { - if m != nil && m.Completed != nil { - return *m.Completed - } - return false -} - -type CMsgRequestOfferingsResponse_NewYearsOffering struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestOfferingsResponse_NewYearsOffering) Reset() { - *m = CMsgRequestOfferingsResponse_NewYearsOffering{} -} -func (m *CMsgRequestOfferingsResponse_NewYearsOffering) String() string { - return proto.CompactTextString(m) -} -func (*CMsgRequestOfferingsResponse_NewYearsOffering) ProtoMessage() {} -func (*CMsgRequestOfferingsResponse_NewYearsOffering) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{33, 0} -} - -func (m *CMsgRequestOfferingsResponse_NewYearsOffering) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgRequestOfferingsResponse_NewYearsOffering) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgLeagueAdminList struct { - AccountIds []uint32 `protobuf:"varint,1,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeagueAdminList) Reset() { *m = CMsgLeagueAdminList{} } -func (m *CMsgLeagueAdminList) String() string { return proto.CompactTextString(m) } -func (*CMsgLeagueAdminList) ProtoMessage() {} -func (*CMsgLeagueAdminList) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{34} } - -func (m *CMsgLeagueAdminList) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgPerfectWorldUserLookupRequest struct { - UserName *string `protobuf:"bytes,1,opt,name=user_name" json:"user_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPerfectWorldUserLookupRequest) Reset() { *m = CMsgPerfectWorldUserLookupRequest{} } -func (m *CMsgPerfectWorldUserLookupRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgPerfectWorldUserLookupRequest) ProtoMessage() {} -func (*CMsgPerfectWorldUserLookupRequest) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{35} -} - -func (m *CMsgPerfectWorldUserLookupRequest) GetUserName() string { - if m != nil && m.UserName != nil { - return *m.UserName - } - return "" -} - -type CMsgPerfectWorldUserLookupResponse struct { - ResultCode *CMsgPerfectWorldUserLookupResponse_EResultCode `protobuf:"varint,1,opt,name=result_code,enum=CMsgPerfectWorldUserLookupResponse_EResultCode,def=0" json:"result_code,omitempty"` - AccountId *uint32 `protobuf:"varint,2,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPerfectWorldUserLookupResponse) Reset() { *m = CMsgPerfectWorldUserLookupResponse{} } -func (m *CMsgPerfectWorldUserLookupResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgPerfectWorldUserLookupResponse) ProtoMessage() {} -func (*CMsgPerfectWorldUserLookupResponse) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{36} -} - -const Default_CMsgPerfectWorldUserLookupResponse_ResultCode CMsgPerfectWorldUserLookupResponse_EResultCode = CMsgPerfectWorldUserLookupResponse_SUCCESS_ACCOUNT_FOUND - -func (m *CMsgPerfectWorldUserLookupResponse) GetResultCode() CMsgPerfectWorldUserLookupResponse_EResultCode { - if m != nil && m.ResultCode != nil { - return *m.ResultCode - } - return Default_CMsgPerfectWorldUserLookupResponse_ResultCode -} - -func (m *CMsgPerfectWorldUserLookupResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CCompendiumTimestampedData struct { - GameTime *uint32 `protobuf:"varint,1,opt,name=game_time" json:"game_time,omitempty"` - Gpm *uint32 `protobuf:"varint,2,opt,name=gpm" json:"gpm,omitempty"` - Xpm *uint32 `protobuf:"varint,3,opt,name=xpm" json:"xpm,omitempty"` - Kills *uint32 `protobuf:"varint,4,opt,name=kills" json:"kills,omitempty"` - Deaths *uint32 `protobuf:"varint,5,opt,name=deaths" json:"deaths,omitempty"` - ItemPurchases []uint32 `protobuf:"varint,6,rep,name=item_purchases" json:"item_purchases,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCompendiumTimestampedData) Reset() { *m = CCompendiumTimestampedData{} } -func (m *CCompendiumTimestampedData) String() string { return proto.CompactTextString(m) } -func (*CCompendiumTimestampedData) ProtoMessage() {} -func (*CCompendiumTimestampedData) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{37} } - -func (m *CCompendiumTimestampedData) GetGameTime() uint32 { - if m != nil && m.GameTime != nil { - return *m.GameTime - } - return 0 -} - -func (m *CCompendiumTimestampedData) GetGpm() uint32 { - if m != nil && m.Gpm != nil { - return *m.Gpm - } - return 0 -} - -func (m *CCompendiumTimestampedData) GetXpm() uint32 { - if m != nil && m.Xpm != nil { - return *m.Xpm - } - return 0 -} - -func (m *CCompendiumTimestampedData) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CCompendiumTimestampedData) GetDeaths() uint32 { - if m != nil && m.Deaths != nil { - return *m.Deaths - } - return 0 -} - -func (m *CCompendiumTimestampedData) GetItemPurchases() []uint32 { - if m != nil { - return m.ItemPurchases - } - return nil -} - -type CCompendiumGameTimeline struct { - Data []*CCompendiumTimestampedData `protobuf:"bytes,1,rep,name=data" json:"data,omitempty"` - Tags []string `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCompendiumGameTimeline) Reset() { *m = CCompendiumGameTimeline{} } -func (m *CCompendiumGameTimeline) String() string { return proto.CompactTextString(m) } -func (*CCompendiumGameTimeline) ProtoMessage() {} -func (*CCompendiumGameTimeline) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{38} } - -func (m *CCompendiumGameTimeline) GetData() []*CCompendiumTimestampedData { - if m != nil { - return m.Data - } - return nil -} - -func (m *CCompendiumGameTimeline) GetTags() []string { - if m != nil { - return m.Tags - } - return nil -} - -type CCompendiumGameList struct { - Games []*CCompendiumGameTimeline `protobuf:"bytes,1,rep,name=games" json:"games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCompendiumGameList) Reset() { *m = CCompendiumGameList{} } -func (m *CCompendiumGameList) String() string { return proto.CompactTextString(m) } -func (*CCompendiumGameList) ProtoMessage() {} -func (*CCompendiumGameList) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{39} } - -func (m *CCompendiumGameList) GetGames() []*CCompendiumGameTimeline { - if m != nil { - return m.Games - } - return nil -} - -type CAdditionalEquipSlot struct { - ClassId *uint32 `protobuf:"varint,1,opt,name=class_id" json:"class_id,omitempty"` - SlotId *uint32 `protobuf:"varint,2,opt,name=slot_id" json:"slot_id,omitempty"` - DefIndex *uint32 `protobuf:"varint,3,opt,name=def_index" json:"def_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAdditionalEquipSlot) Reset() { *m = CAdditionalEquipSlot{} } -func (m *CAdditionalEquipSlot) String() string { return proto.CompactTextString(m) } -func (*CAdditionalEquipSlot) ProtoMessage() {} -func (*CAdditionalEquipSlot) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{40} } - -func (m *CAdditionalEquipSlot) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CAdditionalEquipSlot) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CAdditionalEquipSlot) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -type CMsgDOTARedeemItem struct { - CurrencyId *uint64 `protobuf:"varint,1,opt,name=currency_id" json:"currency_id,omitempty"` - PurchaseDef *uint32 `protobuf:"varint,2,opt,name=purchase_def" json:"purchase_def,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARedeemItem) Reset() { *m = CMsgDOTARedeemItem{} } -func (m *CMsgDOTARedeemItem) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARedeemItem) ProtoMessage() {} -func (*CMsgDOTARedeemItem) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{41} } - -func (m *CMsgDOTARedeemItem) GetCurrencyId() uint64 { - if m != nil && m.CurrencyId != nil { - return *m.CurrencyId - } - return 0 -} - -func (m *CMsgDOTARedeemItem) GetPurchaseDef() uint32 { - if m != nil && m.PurchaseDef != nil { - return *m.PurchaseDef - } - return 0 -} - -type CMsgDOTARedeemItemResponse struct { - Response *CMsgDOTARedeemItemResponse_EResultCode `protobuf:"varint,1,opt,name=response,enum=CMsgDOTARedeemItemResponse_EResultCode,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARedeemItemResponse) Reset() { *m = CMsgDOTARedeemItemResponse{} } -func (m *CMsgDOTARedeemItemResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARedeemItemResponse) ProtoMessage() {} -func (*CMsgDOTARedeemItemResponse) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{42} } - -const Default_CMsgDOTARedeemItemResponse_Response CMsgDOTARedeemItemResponse_EResultCode = CMsgDOTARedeemItemResponse_k_Succeeded - -func (m *CMsgDOTARedeemItemResponse) GetResponse() CMsgDOTARedeemItemResponse_EResultCode { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgDOTARedeemItemResponse_Response -} - -type CMsgDOTACombatLogEntry struct { - Type *DOTA_COMBATLOG_TYPES `protobuf:"varint,1,opt,name=type,enum=DOTA_COMBATLOG_TYPES,def=0" json:"type,omitempty"` - TargetName *uint32 `protobuf:"varint,2,opt,name=target_name" json:"target_name,omitempty"` - TargetSourceName *uint32 `protobuf:"varint,3,opt,name=target_source_name" json:"target_source_name,omitempty"` - AttackerName *uint32 `protobuf:"varint,4,opt,name=attacker_name" json:"attacker_name,omitempty"` - DamageSourceName *uint32 `protobuf:"varint,5,opt,name=damage_source_name" json:"damage_source_name,omitempty"` - InflictorName *uint32 `protobuf:"varint,6,opt,name=inflictor_name" json:"inflictor_name,omitempty"` - IsAttackerIllusion *bool `protobuf:"varint,7,opt,name=is_attacker_illusion" json:"is_attacker_illusion,omitempty"` - IsAttackerHero *bool `protobuf:"varint,8,opt,name=is_attacker_hero" json:"is_attacker_hero,omitempty"` - IsTargetIllusion *bool `protobuf:"varint,9,opt,name=is_target_illusion" json:"is_target_illusion,omitempty"` - IsTargetHero *bool `protobuf:"varint,10,opt,name=is_target_hero" json:"is_target_hero,omitempty"` - IsVisibleRadiant *bool `protobuf:"varint,11,opt,name=is_visible_radiant" json:"is_visible_radiant,omitempty"` - IsVisibleDire *bool `protobuf:"varint,12,opt,name=is_visible_dire" json:"is_visible_dire,omitempty"` - Value *uint32 `protobuf:"varint,13,opt,name=value" json:"value,omitempty"` - Health *int32 `protobuf:"varint,14,opt,name=health" json:"health,omitempty"` - Timestamp *float32 `protobuf:"fixed32,15,opt,name=timestamp" json:"timestamp,omitempty"` - StunDuration *float32 `protobuf:"fixed32,16,opt,name=stun_duration" json:"stun_duration,omitempty"` - SlowDuration *float32 `protobuf:"fixed32,17,opt,name=slow_duration" json:"slow_duration,omitempty"` - IsAbilityToggleOn *bool `protobuf:"varint,18,opt,name=is_ability_toggle_on" json:"is_ability_toggle_on,omitempty"` - IsAbilityToggleOff *bool `protobuf:"varint,19,opt,name=is_ability_toggle_off" json:"is_ability_toggle_off,omitempty"` - AbilityLevel *uint32 `protobuf:"varint,20,opt,name=ability_level" json:"ability_level,omitempty"` - LocationX *float32 `protobuf:"fixed32,21,opt,name=location_x" json:"location_x,omitempty"` - LocationY *float32 `protobuf:"fixed32,22,opt,name=location_y" json:"location_y,omitempty"` - GoldReason *uint32 `protobuf:"varint,23,opt,name=gold_reason" json:"gold_reason,omitempty"` - TimestampRaw *float32 `protobuf:"fixed32,24,opt,name=timestamp_raw" json:"timestamp_raw,omitempty"` - ModifierDuration *float32 `protobuf:"fixed32,25,opt,name=modifier_duration" json:"modifier_duration,omitempty"` - XpReason *uint32 `protobuf:"varint,26,opt,name=xp_reason" json:"xp_reason,omitempty"` - LastHits *uint32 `protobuf:"varint,27,opt,name=last_hits" json:"last_hits,omitempty"` - AttackerTeam *uint32 `protobuf:"varint,28,opt,name=attacker_team" json:"attacker_team,omitempty"` - TargetTeam *uint32 `protobuf:"varint,29,opt,name=target_team" json:"target_team,omitempty"` - ObsWardsPlaced *uint32 `protobuf:"varint,30,opt,name=obs_wards_placed" json:"obs_wards_placed,omitempty"` - AssistPlayer0 *uint32 `protobuf:"varint,31,opt,name=assist_player0" json:"assist_player0,omitempty"` - AssistPlayer1 *uint32 `protobuf:"varint,32,opt,name=assist_player1" json:"assist_player1,omitempty"` - AssistPlayer2 *uint32 `protobuf:"varint,33,opt,name=assist_player2" json:"assist_player2,omitempty"` - AssistPlayer3 *uint32 `protobuf:"varint,34,opt,name=assist_player3" json:"assist_player3,omitempty"` - StackCount *uint32 `protobuf:"varint,35,opt,name=stack_count" json:"stack_count,omitempty"` - HiddenModifier *bool `protobuf:"varint,36,opt,name=hidden_modifier" json:"hidden_modifier,omitempty"` - IsTargetBuilding *bool `protobuf:"varint,37,opt,name=is_target_building" json:"is_target_building,omitempty"` - NeutralCampType *uint32 `protobuf:"varint,38,opt,name=neutral_camp_type" json:"neutral_camp_type,omitempty"` - RuneType *uint32 `protobuf:"varint,39,opt,name=rune_type" json:"rune_type,omitempty"` - AssistPlayers []uint32 `protobuf:"varint,40,rep,name=assist_players" json:"assist_players,omitempty"` - IsHealSave *bool `protobuf:"varint,41,opt,name=is_heal_save" json:"is_heal_save,omitempty"` - IsUltimateAbility *bool `protobuf:"varint,42,opt,name=is_ultimate_ability" json:"is_ultimate_ability,omitempty"` - AttackerHeroLevel *uint32 `protobuf:"varint,43,opt,name=attacker_hero_level" json:"attacker_hero_level,omitempty"` - TargetHeroLevel *uint32 `protobuf:"varint,44,opt,name=target_hero_level" json:"target_hero_level,omitempty"` - Xpm *uint32 `protobuf:"varint,45,opt,name=xpm" json:"xpm,omitempty"` - Gpm *uint32 `protobuf:"varint,46,opt,name=gpm" json:"gpm,omitempty"` - EventLocation *uint32 `protobuf:"varint,47,opt,name=event_location" json:"event_location,omitempty"` - TargetIsSelf *bool `protobuf:"varint,48,opt,name=target_is_self" json:"target_is_self,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTACombatLogEntry) Reset() { *m = CMsgDOTACombatLogEntry{} } -func (m *CMsgDOTACombatLogEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTACombatLogEntry) ProtoMessage() {} -func (*CMsgDOTACombatLogEntry) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{43} } - -const Default_CMsgDOTACombatLogEntry_Type DOTA_COMBATLOG_TYPES = DOTA_COMBATLOG_TYPES_DOTA_COMBATLOG_DAMAGE - -func (m *CMsgDOTACombatLogEntry) GetType() DOTA_COMBATLOG_TYPES { - if m != nil && m.Type != nil { - return *m.Type - } - return Default_CMsgDOTACombatLogEntry_Type -} - -func (m *CMsgDOTACombatLogEntry) GetTargetName() uint32 { - if m != nil && m.TargetName != nil { - return *m.TargetName - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetTargetSourceName() uint32 { - if m != nil && m.TargetSourceName != nil { - return *m.TargetSourceName - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAttackerName() uint32 { - if m != nil && m.AttackerName != nil { - return *m.AttackerName - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetDamageSourceName() uint32 { - if m != nil && m.DamageSourceName != nil { - return *m.DamageSourceName - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetInflictorName() uint32 { - if m != nil && m.InflictorName != nil { - return *m.InflictorName - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetIsAttackerIllusion() bool { - if m != nil && m.IsAttackerIllusion != nil { - return *m.IsAttackerIllusion - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsAttackerHero() bool { - if m != nil && m.IsAttackerHero != nil { - return *m.IsAttackerHero - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsTargetIllusion() bool { - if m != nil && m.IsTargetIllusion != nil { - return *m.IsTargetIllusion - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsTargetHero() bool { - if m != nil && m.IsTargetHero != nil { - return *m.IsTargetHero - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsVisibleRadiant() bool { - if m != nil && m.IsVisibleRadiant != nil { - return *m.IsVisibleRadiant - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsVisibleDire() bool { - if m != nil && m.IsVisibleDire != nil { - return *m.IsVisibleDire - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetValue() uint32 { - if m != nil && m.Value != nil { - return *m.Value - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetHealth() int32 { - if m != nil && m.Health != nil { - return *m.Health - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetTimestamp() float32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetStunDuration() float32 { - if m != nil && m.StunDuration != nil { - return *m.StunDuration - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetSlowDuration() float32 { - if m != nil && m.SlowDuration != nil { - return *m.SlowDuration - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetIsAbilityToggleOn() bool { - if m != nil && m.IsAbilityToggleOn != nil { - return *m.IsAbilityToggleOn - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsAbilityToggleOff() bool { - if m != nil && m.IsAbilityToggleOff != nil { - return *m.IsAbilityToggleOff - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetAbilityLevel() uint32 { - if m != nil && m.AbilityLevel != nil { - return *m.AbilityLevel - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetLocationX() float32 { - if m != nil && m.LocationX != nil { - return *m.LocationX - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetLocationY() float32 { - if m != nil && m.LocationY != nil { - return *m.LocationY - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetGoldReason() uint32 { - if m != nil && m.GoldReason != nil { - return *m.GoldReason - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetTimestampRaw() float32 { - if m != nil && m.TimestampRaw != nil { - return *m.TimestampRaw - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetModifierDuration() float32 { - if m != nil && m.ModifierDuration != nil { - return *m.ModifierDuration - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetXpReason() uint32 { - if m != nil && m.XpReason != nil { - return *m.XpReason - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetLastHits() uint32 { - if m != nil && m.LastHits != nil { - return *m.LastHits - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAttackerTeam() uint32 { - if m != nil && m.AttackerTeam != nil { - return *m.AttackerTeam - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetTargetTeam() uint32 { - if m != nil && m.TargetTeam != nil { - return *m.TargetTeam - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetObsWardsPlaced() uint32 { - if m != nil && m.ObsWardsPlaced != nil { - return *m.ObsWardsPlaced - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAssistPlayer0() uint32 { - if m != nil && m.AssistPlayer0 != nil { - return *m.AssistPlayer0 - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAssistPlayer1() uint32 { - if m != nil && m.AssistPlayer1 != nil { - return *m.AssistPlayer1 - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAssistPlayer2() uint32 { - if m != nil && m.AssistPlayer2 != nil { - return *m.AssistPlayer2 - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAssistPlayer3() uint32 { - if m != nil && m.AssistPlayer3 != nil { - return *m.AssistPlayer3 - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetStackCount() uint32 { - if m != nil && m.StackCount != nil { - return *m.StackCount - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetHiddenModifier() bool { - if m != nil && m.HiddenModifier != nil { - return *m.HiddenModifier - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsTargetBuilding() bool { - if m != nil && m.IsTargetBuilding != nil { - return *m.IsTargetBuilding - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetNeutralCampType() uint32 { - if m != nil && m.NeutralCampType != nil { - return *m.NeutralCampType - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetRuneType() uint32 { - if m != nil && m.RuneType != nil { - return *m.RuneType - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetAssistPlayers() []uint32 { - if m != nil { - return m.AssistPlayers - } - return nil -} - -func (m *CMsgDOTACombatLogEntry) GetIsHealSave() bool { - if m != nil && m.IsHealSave != nil { - return *m.IsHealSave - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetIsUltimateAbility() bool { - if m != nil && m.IsUltimateAbility != nil { - return *m.IsUltimateAbility - } - return false -} - -func (m *CMsgDOTACombatLogEntry) GetAttackerHeroLevel() uint32 { - if m != nil && m.AttackerHeroLevel != nil { - return *m.AttackerHeroLevel - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetTargetHeroLevel() uint32 { - if m != nil && m.TargetHeroLevel != nil { - return *m.TargetHeroLevel - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetXpm() uint32 { - if m != nil && m.Xpm != nil { - return *m.Xpm - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetGpm() uint32 { - if m != nil && m.Gpm != nil { - return *m.Gpm - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetEventLocation() uint32 { - if m != nil && m.EventLocation != nil { - return *m.EventLocation - } - return 0 -} - -func (m *CMsgDOTACombatLogEntry) GetTargetIsSelf() bool { - if m != nil && m.TargetIsSelf != nil { - return *m.TargetIsSelf - } - return false -} - -type CMsgDOTAProfileCard struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - BackgroundDefIndex *uint32 `protobuf:"varint,2,opt,name=background_def_index" json:"background_def_index,omitempty"` - Slots []*CMsgDOTAProfileCard_Slot `protobuf:"bytes,3,rep,name=slots" json:"slots,omitempty"` - BadgePoints *uint32 `protobuf:"varint,4,opt,name=badge_points" json:"badge_points,omitempty"` - EventPoints *uint32 `protobuf:"varint,5,opt,name=event_points" json:"event_points,omitempty"` - EventId *uint32 `protobuf:"varint,6,opt,name=event_id" json:"event_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard) Reset() { *m = CMsgDOTAProfileCard{} } -func (m *CMsgDOTAProfileCard) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard) ProtoMessage() {} -func (*CMsgDOTAProfileCard) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{44} } - -func (m *CMsgDOTAProfileCard) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgDOTAProfileCard) GetBackgroundDefIndex() uint32 { - if m != nil && m.BackgroundDefIndex != nil { - return *m.BackgroundDefIndex - } - return 0 -} - -func (m *CMsgDOTAProfileCard) GetSlots() []*CMsgDOTAProfileCard_Slot { - if m != nil { - return m.Slots - } - return nil -} - -func (m *CMsgDOTAProfileCard) GetBadgePoints() uint32 { - if m != nil && m.BadgePoints != nil { - return *m.BadgePoints - } - return 0 -} - -func (m *CMsgDOTAProfileCard) GetEventPoints() uint32 { - if m != nil && m.EventPoints != nil { - return *m.EventPoints - } - return 0 -} - -func (m *CMsgDOTAProfileCard) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -type CMsgDOTAProfileCard_Slot struct { - SlotId *uint32 `protobuf:"varint,1,opt,name=slot_id" json:"slot_id,omitempty"` - Trophy *CMsgDOTAProfileCard_Slot_Trophy `protobuf:"bytes,2,opt,name=trophy" json:"trophy,omitempty"` - Stat *CMsgDOTAProfileCard_Slot_Stat `protobuf:"bytes,3,opt,name=stat" json:"stat,omitempty"` - Item *CMsgDOTAProfileCard_Slot_Item `protobuf:"bytes,4,opt,name=item" json:"item,omitempty"` - Hero *CMsgDOTAProfileCard_Slot_Hero `protobuf:"bytes,5,opt,name=hero" json:"hero,omitempty"` - Emoticon *CMsgDOTAProfileCard_Slot_Emoticon `protobuf:"bytes,6,opt,name=emoticon" json:"emoticon,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard_Slot) Reset() { *m = CMsgDOTAProfileCard_Slot{} } -func (m *CMsgDOTAProfileCard_Slot) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard_Slot) ProtoMessage() {} -func (*CMsgDOTAProfileCard_Slot) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{44, 0} } - -func (m *CMsgDOTAProfileCard_Slot) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CMsgDOTAProfileCard_Slot) GetTrophy() *CMsgDOTAProfileCard_Slot_Trophy { - if m != nil { - return m.Trophy - } - return nil -} - -func (m *CMsgDOTAProfileCard_Slot) GetStat() *CMsgDOTAProfileCard_Slot_Stat { - if m != nil { - return m.Stat - } - return nil -} - -func (m *CMsgDOTAProfileCard_Slot) GetItem() *CMsgDOTAProfileCard_Slot_Item { - if m != nil { - return m.Item - } - return nil -} - -func (m *CMsgDOTAProfileCard_Slot) GetHero() *CMsgDOTAProfileCard_Slot_Hero { - if m != nil { - return m.Hero - } - return nil -} - -func (m *CMsgDOTAProfileCard_Slot) GetEmoticon() *CMsgDOTAProfileCard_Slot_Emoticon { - if m != nil { - return m.Emoticon - } - return nil -} - -type CMsgDOTAProfileCard_Slot_Trophy struct { - TrophyId *uint32 `protobuf:"varint,1,opt,name=trophy_id" json:"trophy_id,omitempty"` - TrophyScore *uint32 `protobuf:"varint,2,opt,name=trophy_score" json:"trophy_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard_Slot_Trophy) Reset() { *m = CMsgDOTAProfileCard_Slot_Trophy{} } -func (m *CMsgDOTAProfileCard_Slot_Trophy) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard_Slot_Trophy) ProtoMessage() {} -func (*CMsgDOTAProfileCard_Slot_Trophy) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{44, 0, 0} -} - -func (m *CMsgDOTAProfileCard_Slot_Trophy) GetTrophyId() uint32 { - if m != nil && m.TrophyId != nil { - return *m.TrophyId - } - return 0 -} - -func (m *CMsgDOTAProfileCard_Slot_Trophy) GetTrophyScore() uint32 { - if m != nil && m.TrophyScore != nil { - return *m.TrophyScore - } - return 0 -} - -type CMsgDOTAProfileCard_Slot_Stat struct { - StatId *CMsgDOTAProfileCard_EStatID `protobuf:"varint,1,opt,name=stat_id,enum=CMsgDOTAProfileCard_EStatID,def=1" json:"stat_id,omitempty"` - StatScore *uint32 `protobuf:"varint,2,opt,name=stat_score" json:"stat_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard_Slot_Stat) Reset() { *m = CMsgDOTAProfileCard_Slot_Stat{} } -func (m *CMsgDOTAProfileCard_Slot_Stat) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard_Slot_Stat) ProtoMessage() {} -func (*CMsgDOTAProfileCard_Slot_Stat) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{44, 0, 1} -} - -const Default_CMsgDOTAProfileCard_Slot_Stat_StatId CMsgDOTAProfileCard_EStatID = CMsgDOTAProfileCard_k_eStat_SoloRank - -func (m *CMsgDOTAProfileCard_Slot_Stat) GetStatId() CMsgDOTAProfileCard_EStatID { - if m != nil && m.StatId != nil { - return *m.StatId - } - return Default_CMsgDOTAProfileCard_Slot_Stat_StatId -} - -func (m *CMsgDOTAProfileCard_Slot_Stat) GetStatScore() uint32 { - if m != nil && m.StatScore != nil { - return *m.StatScore - } - return 0 -} - -type CMsgDOTAProfileCard_Slot_Item struct { - SerializedItem []byte `protobuf:"bytes,1,opt,name=serialized_item" json:"serialized_item,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard_Slot_Item) Reset() { *m = CMsgDOTAProfileCard_Slot_Item{} } -func (m *CMsgDOTAProfileCard_Slot_Item) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard_Slot_Item) ProtoMessage() {} -func (*CMsgDOTAProfileCard_Slot_Item) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{44, 0, 2} -} - -func (m *CMsgDOTAProfileCard_Slot_Item) GetSerializedItem() []byte { - if m != nil { - return m.SerializedItem - } - return nil -} - -func (m *CMsgDOTAProfileCard_Slot_Item) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgDOTAProfileCard_Slot_Hero struct { - HeroId *uint32 `protobuf:"varint,1,opt,name=hero_id" json:"hero_id,omitempty"` - HeroWins *uint32 `protobuf:"varint,2,opt,name=hero_wins" json:"hero_wins,omitempty"` - HeroLosses *uint32 `protobuf:"varint,3,opt,name=hero_losses" json:"hero_losses,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard_Slot_Hero) Reset() { *m = CMsgDOTAProfileCard_Slot_Hero{} } -func (m *CMsgDOTAProfileCard_Slot_Hero) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard_Slot_Hero) ProtoMessage() {} -func (*CMsgDOTAProfileCard_Slot_Hero) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{44, 0, 3} -} - -func (m *CMsgDOTAProfileCard_Slot_Hero) GetHeroId() uint32 { - if m != nil && m.HeroId != nil { - return *m.HeroId - } - return 0 -} - -func (m *CMsgDOTAProfileCard_Slot_Hero) GetHeroWins() uint32 { - if m != nil && m.HeroWins != nil { - return *m.HeroWins - } - return 0 -} - -func (m *CMsgDOTAProfileCard_Slot_Hero) GetHeroLosses() uint32 { - if m != nil && m.HeroLosses != nil { - return *m.HeroLosses - } - return 0 -} - -type CMsgDOTAProfileCard_Slot_Emoticon struct { - EmoticonId *uint32 `protobuf:"varint,1,opt,name=emoticon_id" json:"emoticon_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTAProfileCard_Slot_Emoticon) Reset() { *m = CMsgDOTAProfileCard_Slot_Emoticon{} } -func (m *CMsgDOTAProfileCard_Slot_Emoticon) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTAProfileCard_Slot_Emoticon) ProtoMessage() {} -func (*CMsgDOTAProfileCard_Slot_Emoticon) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{44, 0, 4} -} - -func (m *CMsgDOTAProfileCard_Slot_Emoticon) GetEmoticonId() uint32 { - if m != nil && m.EmoticonId != nil { - return *m.EmoticonId - } - return 0 -} - -type CMsgGCToClientNewBloomTimingUpdated struct { - IsActive *bool `protobuf:"varint,1,opt,name=is_active" json:"is_active,omitempty"` - NextTransitionTime *uint32 `protobuf:"varint,2,opt,name=next_transition_time" json:"next_transition_time,omitempty"` - BonusAmount *uint32 `protobuf:"varint,3,opt,name=bonus_amount" json:"bonus_amount,omitempty"` - StandbyDuration *uint32 `protobuf:"varint,4,opt,name=standby_duration" json:"standby_duration,omitempty"` - TransitionTime *uint32 `protobuf:"varint,5,opt,name=transition_time" json:"transition_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientNewBloomTimingUpdated) Reset() { *m = CMsgGCToClientNewBloomTimingUpdated{} } -func (m *CMsgGCToClientNewBloomTimingUpdated) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientNewBloomTimingUpdated) ProtoMessage() {} -func (*CMsgGCToClientNewBloomTimingUpdated) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{45} -} - -func (m *CMsgGCToClientNewBloomTimingUpdated) GetIsActive() bool { - if m != nil && m.IsActive != nil { - return *m.IsActive - } - return false -} - -func (m *CMsgGCToClientNewBloomTimingUpdated) GetNextTransitionTime() uint32 { - if m != nil && m.NextTransitionTime != nil { - return *m.NextTransitionTime - } - return 0 -} - -func (m *CMsgGCToClientNewBloomTimingUpdated) GetBonusAmount() uint32 { - if m != nil && m.BonusAmount != nil { - return *m.BonusAmount - } - return 0 -} - -func (m *CMsgGCToClientNewBloomTimingUpdated) GetStandbyDuration() uint32 { - if m != nil && m.StandbyDuration != nil { - return *m.StandbyDuration - } - return 0 -} - -func (m *CMsgGCToClientNewBloomTimingUpdated) GetTransitionTime() uint32 { - if m != nil && m.TransitionTime != nil { - return *m.TransitionTime - } - return 0 -} - -type CSODOTAPlayerChallenge struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - EventId *uint32 `protobuf:"varint,2,opt,name=event_id" json:"event_id,omitempty"` - SlotId *uint32 `protobuf:"varint,3,opt,name=slot_id" json:"slot_id,omitempty"` - ChallengeType *uint32 `protobuf:"varint,4,opt,name=challenge_type" json:"challenge_type,omitempty"` - IntParam_0 *uint32 `protobuf:"varint,5,opt,name=int_param_0" json:"int_param_0,omitempty"` - IntParam_1 *uint32 `protobuf:"varint,6,opt,name=int_param_1" json:"int_param_1,omitempty"` - CreatedTime *uint32 `protobuf:"varint,7,opt,name=created_time" json:"created_time,omitempty"` - Completed *uint32 `protobuf:"varint,8,opt,name=completed" json:"completed,omitempty"` - SequenceId *uint32 `protobuf:"varint,9,opt,name=sequence_id" json:"sequence_id,omitempty"` - ChallengeTier *uint32 `protobuf:"varint,10,opt,name=challenge_tier" json:"challenge_tier,omitempty"` - Flags *uint32 `protobuf:"varint,11,opt,name=flags" json:"flags,omitempty"` - Attempts *uint32 `protobuf:"varint,12,opt,name=attempts" json:"attempts,omitempty"` - CompleteLimit *uint32 `protobuf:"varint,13,opt,name=complete_limit" json:"complete_limit,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSODOTAPlayerChallenge) Reset() { *m = CSODOTAPlayerChallenge{} } -func (m *CSODOTAPlayerChallenge) String() string { return proto.CompactTextString(m) } -func (*CSODOTAPlayerChallenge) ProtoMessage() {} -func (*CSODOTAPlayerChallenge) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{46} } - -func (m *CSODOTAPlayerChallenge) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetChallengeType() uint32 { - if m != nil && m.ChallengeType != nil { - return *m.ChallengeType - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetIntParam_0() uint32 { - if m != nil && m.IntParam_0 != nil { - return *m.IntParam_0 - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetIntParam_1() uint32 { - if m != nil && m.IntParam_1 != nil { - return *m.IntParam_1 - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetCreatedTime() uint32 { - if m != nil && m.CreatedTime != nil { - return *m.CreatedTime - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetCompleted() uint32 { - if m != nil && m.Completed != nil { - return *m.Completed - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetSequenceId() uint32 { - if m != nil && m.SequenceId != nil { - return *m.SequenceId - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetChallengeTier() uint32 { - if m != nil && m.ChallengeTier != nil { - return *m.ChallengeTier - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetAttempts() uint32 { - if m != nil && m.Attempts != nil { - return *m.Attempts - } - return 0 -} - -func (m *CSODOTAPlayerChallenge) GetCompleteLimit() uint32 { - if m != nil && m.CompleteLimit != nil { - return *m.CompleteLimit - } - return 0 -} - -type CMsgClientToGCRerollPlayerChallenge struct { - EventId *uint32 `protobuf:"varint,1,opt,name=event_id" json:"event_id,omitempty"` - SequenceId *uint32 `protobuf:"varint,3,opt,name=sequence_id" json:"sequence_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCRerollPlayerChallenge) Reset() { *m = CMsgClientToGCRerollPlayerChallenge{} } -func (m *CMsgClientToGCRerollPlayerChallenge) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCRerollPlayerChallenge) ProtoMessage() {} -func (*CMsgClientToGCRerollPlayerChallenge) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{47} -} - -func (m *CMsgClientToGCRerollPlayerChallenge) GetEventId() uint32 { - if m != nil && m.EventId != nil { - return *m.EventId - } - return 0 -} - -func (m *CMsgClientToGCRerollPlayerChallenge) GetSequenceId() uint32 { - if m != nil && m.SequenceId != nil { - return *m.SequenceId - } - return 0 -} - -type CMsgGCRerollPlayerChallengeResponse struct { - Result *CMsgGCRerollPlayerChallengeResponse_EResult `protobuf:"varint,1,opt,name=result,enum=CMsgGCRerollPlayerChallengeResponse_EResult,def=0" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRerollPlayerChallengeResponse) Reset() { *m = CMsgGCRerollPlayerChallengeResponse{} } -func (m *CMsgGCRerollPlayerChallengeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRerollPlayerChallengeResponse) ProtoMessage() {} -func (*CMsgGCRerollPlayerChallengeResponse) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{48} -} - -const Default_CMsgGCRerollPlayerChallengeResponse_Result CMsgGCRerollPlayerChallengeResponse_EResult = CMsgGCRerollPlayerChallengeResponse_eResult_Success - -func (m *CMsgGCRerollPlayerChallengeResponse) GetResult() CMsgGCRerollPlayerChallengeResponse_EResult { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgGCRerollPlayerChallengeResponse_Result -} - -type CMsgGCTopCustomGamesList struct { - TopCustomGames []uint64 `protobuf:"varint,1,rep,name=top_custom_games" json:"top_custom_games,omitempty"` - GameOfTheDay *uint64 `protobuf:"varint,2,opt,name=game_of_the_day" json:"game_of_the_day,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCTopCustomGamesList) Reset() { *m = CMsgGCTopCustomGamesList{} } -func (m *CMsgGCTopCustomGamesList) String() string { return proto.CompactTextString(m) } -func (*CMsgGCTopCustomGamesList) ProtoMessage() {} -func (*CMsgGCTopCustomGamesList) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{49} } - -func (m *CMsgGCTopCustomGamesList) GetTopCustomGames() []uint64 { - if m != nil { - return m.TopCustomGames - } - return nil -} - -func (m *CMsgGCTopCustomGamesList) GetGameOfTheDay() uint64 { - if m != nil && m.GameOfTheDay != nil { - return *m.GameOfTheDay - } - return 0 -} - -type CMsgDOTARealtimeGameStats struct { - Match *CMsgDOTARealtimeGameStats_MatchDetails `protobuf:"bytes,1,opt,name=match" json:"match,omitempty"` - Teams []*CMsgDOTARealtimeGameStats_TeamDetails `protobuf:"bytes,2,rep,name=teams" json:"teams,omitempty"` - Buildings []*CMsgDOTARealtimeGameStats_BuildingDetails `protobuf:"bytes,3,rep,name=buildings" json:"buildings,omitempty"` - GraphData *CMsgDOTARealtimeGameStats_GraphData `protobuf:"bytes,4,opt,name=graph_data" json:"graph_data,omitempty"` - DeltaFrame *bool `protobuf:"varint,5,opt,name=delta_frame" json:"delta_frame,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats) Reset() { *m = CMsgDOTARealtimeGameStats{} } -func (m *CMsgDOTARealtimeGameStats) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{50} } - -func (m *CMsgDOTARealtimeGameStats) GetMatch() *CMsgDOTARealtimeGameStats_MatchDetails { - if m != nil { - return m.Match - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats) GetTeams() []*CMsgDOTARealtimeGameStats_TeamDetails { - if m != nil { - return m.Teams - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats) GetBuildings() []*CMsgDOTARealtimeGameStats_BuildingDetails { - if m != nil { - return m.Buildings - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats) GetGraphData() *CMsgDOTARealtimeGameStats_GraphData { - if m != nil { - return m.GraphData - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats) GetDeltaFrame() bool { - if m != nil && m.DeltaFrame != nil { - return *m.DeltaFrame - } - return false -} - -type CMsgDOTARealtimeGameStats_TeamDetails struct { - TeamNumber *uint32 `protobuf:"varint,1,opt,name=team_number" json:"team_number,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - TeamName *string `protobuf:"bytes,3,opt,name=team_name" json:"team_name,omitempty"` - TeamLogo *uint64 `protobuf:"fixed64,4,opt,name=team_logo" json:"team_logo,omitempty"` - Score *uint32 `protobuf:"varint,5,opt,name=score" json:"score,omitempty"` - Players []*CMsgDOTARealtimeGameStats_PlayerDetails `protobuf:"bytes,6,rep,name=players" json:"players,omitempty"` - OnlyTeam *bool `protobuf:"varint,7,opt,name=only_team" json:"only_team,omitempty"` - Cheers *uint32 `protobuf:"varint,8,opt,name=cheers" json:"cheers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) Reset() { *m = CMsgDOTARealtimeGameStats_TeamDetails{} } -func (m *CMsgDOTARealtimeGameStats_TeamDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_TeamDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_TeamDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 0} -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetTeamNumber() uint32 { - if m != nil && m.TeamNumber != nil { - return *m.TeamNumber - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetPlayers() []*CMsgDOTARealtimeGameStats_PlayerDetails { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetOnlyTeam() bool { - if m != nil && m.OnlyTeam != nil { - return *m.OnlyTeam - } - return false -} - -func (m *CMsgDOTARealtimeGameStats_TeamDetails) GetCheers() uint32 { - if m != nil && m.Cheers != nil { - return *m.Cheers - } - return 0 -} - -type CMsgDOTARealtimeGameStats_ItemDetails struct { - Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Time *int32 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` - Sold *bool `protobuf:"varint,4,opt,name=sold" json:"sold,omitempty"` - Stackcount *uint32 `protobuf:"varint,5,opt,name=stackcount" json:"stackcount,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_ItemDetails) Reset() { *m = CMsgDOTARealtimeGameStats_ItemDetails{} } -func (m *CMsgDOTARealtimeGameStats_ItemDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_ItemDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_ItemDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 1} -} - -func (m *CMsgDOTARealtimeGameStats_ItemDetails) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_ItemDetails) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTARealtimeGameStats_ItemDetails) GetTime() int32 { - if m != nil && m.Time != nil { - return *m.Time - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_ItemDetails) GetSold() bool { - if m != nil && m.Sold != nil { - return *m.Sold - } - return false -} - -func (m *CMsgDOTARealtimeGameStats_ItemDetails) GetStackcount() uint32 { - if m != nil && m.Stackcount != nil { - return *m.Stackcount - } - return 0 -} - -type CMsgDOTARealtimeGameStats_AbilityDetails struct { - Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Level *uint32 `protobuf:"varint,3,opt,name=level" json:"level,omitempty"` - Cooldown *float32 `protobuf:"fixed32,4,opt,name=cooldown" json:"cooldown,omitempty"` - CooldownMax *float32 `protobuf:"fixed32,5,opt,name=cooldown_max" json:"cooldown_max,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) Reset() { - *m = CMsgDOTARealtimeGameStats_AbilityDetails{} -} -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_AbilityDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_AbilityDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 2} -} - -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) GetId() uint32 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) GetCooldown() float32 { - if m != nil && m.Cooldown != nil { - return *m.Cooldown - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_AbilityDetails) GetCooldownMax() float32 { - if m != nil && m.CooldownMax != nil { - return *m.CooldownMax - } - return 0 -} - -type CMsgDOTARealtimeGameStats_HeroToHeroStats struct { - Victimid *uint32 `protobuf:"varint,1,opt,name=victimid" json:"victimid,omitempty"` - Kills *uint32 `protobuf:"varint,2,opt,name=kills" json:"kills,omitempty"` - Assists *uint32 `protobuf:"varint,3,opt,name=assists" json:"assists,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_HeroToHeroStats) Reset() { - *m = CMsgDOTARealtimeGameStats_HeroToHeroStats{} -} -func (m *CMsgDOTARealtimeGameStats_HeroToHeroStats) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_HeroToHeroStats) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_HeroToHeroStats) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 3} -} - -func (m *CMsgDOTARealtimeGameStats_HeroToHeroStats) GetVictimid() uint32 { - if m != nil && m.Victimid != nil { - return *m.Victimid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_HeroToHeroStats) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_HeroToHeroStats) GetAssists() uint32 { - if m != nil && m.Assists != nil { - return *m.Assists - } - return 0 -} - -type CMsgDOTARealtimeGameStats_AbilityList struct { - Id []uint32 `protobuf:"varint,1,rep,name=id" json:"id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_AbilityList) Reset() { *m = CMsgDOTARealtimeGameStats_AbilityList{} } -func (m *CMsgDOTARealtimeGameStats_AbilityList) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_AbilityList) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_AbilityList) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 4} -} - -func (m *CMsgDOTARealtimeGameStats_AbilityList) GetId() []uint32 { - if m != nil { - return m.Id - } - return nil -} - -type CMsgDOTARealtimeGameStats_PlayerDetails struct { - Accountid *uint32 `protobuf:"varint,1,opt,name=accountid" json:"accountid,omitempty"` - Playerid *uint32 `protobuf:"varint,2,opt,name=playerid" json:"playerid,omitempty"` - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Team *uint32 `protobuf:"varint,4,opt,name=team" json:"team,omitempty"` - Heroid *uint32 `protobuf:"varint,5,opt,name=heroid" json:"heroid,omitempty"` - Healthpoints *uint32 `protobuf:"varint,6,opt,name=healthpoints" json:"healthpoints,omitempty"` - Maxhealthpoints *uint32 `protobuf:"varint,7,opt,name=maxhealthpoints" json:"maxhealthpoints,omitempty"` - Healthregenrate *float32 `protobuf:"fixed32,8,opt,name=healthregenrate" json:"healthregenrate,omitempty"` - Manapoints *uint32 `protobuf:"varint,9,opt,name=manapoints" json:"manapoints,omitempty"` - Maxmanapoints *uint32 `protobuf:"varint,10,opt,name=maxmanapoints" json:"maxmanapoints,omitempty"` - Manaregenrate *float32 `protobuf:"fixed32,11,opt,name=manaregenrate" json:"manaregenrate,omitempty"` - BaseStrength *uint32 `protobuf:"varint,12,opt,name=base_strength" json:"base_strength,omitempty"` - BaseAgility *uint32 `protobuf:"varint,13,opt,name=base_agility" json:"base_agility,omitempty"` - BaseIntelligence *uint32 `protobuf:"varint,14,opt,name=base_intelligence" json:"base_intelligence,omitempty"` - BaseArmor *int32 `protobuf:"varint,15,opt,name=base_armor" json:"base_armor,omitempty"` - BaseMovespeed *uint32 `protobuf:"varint,16,opt,name=base_movespeed" json:"base_movespeed,omitempty"` - BaseDamage *uint32 `protobuf:"varint,17,opt,name=base_damage" json:"base_damage,omitempty"` - Strength *uint32 `protobuf:"varint,18,opt,name=strength" json:"strength,omitempty"` - Agility *uint32 `protobuf:"varint,19,opt,name=agility" json:"agility,omitempty"` - Intelligence *uint32 `protobuf:"varint,20,opt,name=intelligence" json:"intelligence,omitempty"` - Armor *int32 `protobuf:"varint,21,opt,name=armor" json:"armor,omitempty"` - Movespeed *uint32 `protobuf:"varint,22,opt,name=movespeed" json:"movespeed,omitempty"` - Damage *uint32 `protobuf:"varint,23,opt,name=damage" json:"damage,omitempty"` - HeroDamage *uint32 `protobuf:"varint,24,opt,name=hero_damage" json:"hero_damage,omitempty"` - TowerDamage *uint32 `protobuf:"varint,25,opt,name=tower_damage" json:"tower_damage,omitempty"` - Abilities []*CMsgDOTARealtimeGameStats_AbilityDetails `protobuf:"bytes,26,rep,name=abilities" json:"abilities,omitempty"` - Level *uint32 `protobuf:"varint,27,opt,name=level" json:"level,omitempty"` - KillCount *uint32 `protobuf:"varint,28,opt,name=kill_count" json:"kill_count,omitempty"` - DeathCount *uint32 `protobuf:"varint,29,opt,name=death_count" json:"death_count,omitempty"` - AssistsCount *uint32 `protobuf:"varint,30,opt,name=assists_count" json:"assists_count,omitempty"` - DeniesCount *uint32 `protobuf:"varint,31,opt,name=denies_count" json:"denies_count,omitempty"` - LhCount *uint32 `protobuf:"varint,32,opt,name=lh_count" json:"lh_count,omitempty"` - HeroHealing *uint32 `protobuf:"varint,33,opt,name=hero_healing" json:"hero_healing,omitempty"` - GoldPerMin *uint32 `protobuf:"varint,34,opt,name=gold_per_min" json:"gold_per_min,omitempty"` - XpPerMin *uint32 `protobuf:"varint,35,opt,name=xp_per_min" json:"xp_per_min,omitempty"` - NetGold *uint32 `protobuf:"varint,36,opt,name=net_gold" json:"net_gold,omitempty"` - Gold *uint32 `protobuf:"varint,37,opt,name=gold" json:"gold,omitempty"` - X *float32 `protobuf:"fixed32,38,opt,name=x" json:"x,omitempty"` - Y *float32 `protobuf:"fixed32,39,opt,name=y" json:"y,omitempty"` - RespawnTime *int32 `protobuf:"varint,40,opt,name=respawn_time" json:"respawn_time,omitempty"` - UltimateCooldown *uint32 `protobuf:"varint,41,opt,name=ultimate_cooldown" json:"ultimate_cooldown,omitempty"` - HasBuyback *bool `protobuf:"varint,42,opt,name=has_buyback" json:"has_buyback,omitempty"` - Items []*CMsgDOTARealtimeGameStats_ItemDetails `protobuf:"bytes,43,rep,name=items" json:"items,omitempty"` - Stashitems []*CMsgDOTARealtimeGameStats_ItemDetails `protobuf:"bytes,44,rep,name=stashitems" json:"stashitems,omitempty"` - Itemshoppinglist []*CMsgDOTARealtimeGameStats_ItemDetails `protobuf:"bytes,45,rep,name=itemshoppinglist" json:"itemshoppinglist,omitempty"` - Levelpoints []*CMsgDOTARealtimeGameStats_AbilityList `protobuf:"bytes,46,rep,name=levelpoints" json:"levelpoints,omitempty"` - HeroToHeroStats []*CMsgDOTARealtimeGameStats_HeroToHeroStats `protobuf:"bytes,47,rep,name=hero_to_hero_stats" json:"hero_to_hero_stats,omitempty"` - HasUltimate *bool `protobuf:"varint,48,opt,name=has_ultimate" json:"has_ultimate,omitempty"` - HasUltimateMana *bool `protobuf:"varint,49,opt,name=has_ultimate_mana" json:"has_ultimate_mana,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) Reset() { - *m = CMsgDOTARealtimeGameStats_PlayerDetails{} -} -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_PlayerDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_PlayerDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 5} -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetPlayerid() uint32 { - if m != nil && m.Playerid != nil { - return *m.Playerid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHeroid() uint32 { - if m != nil && m.Heroid != nil { - return *m.Heroid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHealthpoints() uint32 { - if m != nil && m.Healthpoints != nil { - return *m.Healthpoints - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetMaxhealthpoints() uint32 { - if m != nil && m.Maxhealthpoints != nil { - return *m.Maxhealthpoints - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHealthregenrate() float32 { - if m != nil && m.Healthregenrate != nil { - return *m.Healthregenrate - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetManapoints() uint32 { - if m != nil && m.Manapoints != nil { - return *m.Manapoints - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetMaxmanapoints() uint32 { - if m != nil && m.Maxmanapoints != nil { - return *m.Maxmanapoints - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetManaregenrate() float32 { - if m != nil && m.Manaregenrate != nil { - return *m.Manaregenrate - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetBaseStrength() uint32 { - if m != nil && m.BaseStrength != nil { - return *m.BaseStrength - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetBaseAgility() uint32 { - if m != nil && m.BaseAgility != nil { - return *m.BaseAgility - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetBaseIntelligence() uint32 { - if m != nil && m.BaseIntelligence != nil { - return *m.BaseIntelligence - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetBaseArmor() int32 { - if m != nil && m.BaseArmor != nil { - return *m.BaseArmor - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetBaseMovespeed() uint32 { - if m != nil && m.BaseMovespeed != nil { - return *m.BaseMovespeed - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetBaseDamage() uint32 { - if m != nil && m.BaseDamage != nil { - return *m.BaseDamage - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetStrength() uint32 { - if m != nil && m.Strength != nil { - return *m.Strength - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetAgility() uint32 { - if m != nil && m.Agility != nil { - return *m.Agility - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetIntelligence() uint32 { - if m != nil && m.Intelligence != nil { - return *m.Intelligence - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetArmor() int32 { - if m != nil && m.Armor != nil { - return *m.Armor - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetMovespeed() uint32 { - if m != nil && m.Movespeed != nil { - return *m.Movespeed - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetDamage() uint32 { - if m != nil && m.Damage != nil { - return *m.Damage - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHeroDamage() uint32 { - if m != nil && m.HeroDamage != nil { - return *m.HeroDamage - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetTowerDamage() uint32 { - if m != nil && m.TowerDamage != nil { - return *m.TowerDamage - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetAbilities() []*CMsgDOTARealtimeGameStats_AbilityDetails { - if m != nil { - return m.Abilities - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetKillCount() uint32 { - if m != nil && m.KillCount != nil { - return *m.KillCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetDeathCount() uint32 { - if m != nil && m.DeathCount != nil { - return *m.DeathCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetAssistsCount() uint32 { - if m != nil && m.AssistsCount != nil { - return *m.AssistsCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetDeniesCount() uint32 { - if m != nil && m.DeniesCount != nil { - return *m.DeniesCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetLhCount() uint32 { - if m != nil && m.LhCount != nil { - return *m.LhCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHeroHealing() uint32 { - if m != nil && m.HeroHealing != nil { - return *m.HeroHealing - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetGoldPerMin() uint32 { - if m != nil && m.GoldPerMin != nil { - return *m.GoldPerMin - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetXpPerMin() uint32 { - if m != nil && m.XpPerMin != nil { - return *m.XpPerMin - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetNetGold() uint32 { - if m != nil && m.NetGold != nil { - return *m.NetGold - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetGold() uint32 { - if m != nil && m.Gold != nil { - return *m.Gold - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetX() float32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetY() float32 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetRespawnTime() int32 { - if m != nil && m.RespawnTime != nil { - return *m.RespawnTime - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetUltimateCooldown() uint32 { - if m != nil && m.UltimateCooldown != nil { - return *m.UltimateCooldown - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHasBuyback() bool { - if m != nil && m.HasBuyback != nil { - return *m.HasBuyback - } - return false -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetItems() []*CMsgDOTARealtimeGameStats_ItemDetails { - if m != nil { - return m.Items - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetStashitems() []*CMsgDOTARealtimeGameStats_ItemDetails { - if m != nil { - return m.Stashitems - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetItemshoppinglist() []*CMsgDOTARealtimeGameStats_ItemDetails { - if m != nil { - return m.Itemshoppinglist - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetLevelpoints() []*CMsgDOTARealtimeGameStats_AbilityList { - if m != nil { - return m.Levelpoints - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHeroToHeroStats() []*CMsgDOTARealtimeGameStats_HeroToHeroStats { - if m != nil { - return m.HeroToHeroStats - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHasUltimate() bool { - if m != nil && m.HasUltimate != nil { - return *m.HasUltimate - } - return false -} - -func (m *CMsgDOTARealtimeGameStats_PlayerDetails) GetHasUltimateMana() bool { - if m != nil && m.HasUltimateMana != nil { - return *m.HasUltimateMana - } - return false -} - -type CMsgDOTARealtimeGameStats_BuildingDetails struct { - Team *uint32 `protobuf:"varint,2,opt,name=team" json:"team,omitempty"` - Heading *float32 `protobuf:"fixed32,3,opt,name=heading" json:"heading,omitempty"` - Lane *uint32 `protobuf:"varint,4,opt,name=lane" json:"lane,omitempty"` - Tier *uint32 `protobuf:"varint,5,opt,name=tier" json:"tier,omitempty"` - Type *uint32 `protobuf:"varint,6,opt,name=type" json:"type,omitempty"` - X *float32 `protobuf:"fixed32,7,opt,name=x" json:"x,omitempty"` - Y *float32 `protobuf:"fixed32,8,opt,name=y" json:"y,omitempty"` - Destroyed *bool `protobuf:"varint,9,opt,name=destroyed" json:"destroyed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) Reset() { - *m = CMsgDOTARealtimeGameStats_BuildingDetails{} -} -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_BuildingDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_BuildingDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 6} -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetHeading() float32 { - if m != nil && m.Heading != nil { - return *m.Heading - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetLane() uint32 { - if m != nil && m.Lane != nil { - return *m.Lane - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetTier() uint32 { - if m != nil && m.Tier != nil { - return *m.Tier - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetX() float32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetY() float32 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BuildingDetails) GetDestroyed() bool { - if m != nil && m.Destroyed != nil { - return *m.Destroyed - } - return false -} - -type CMsgDOTARealtimeGameStats_KillDetails struct { - PlayerId *uint32 `protobuf:"varint,1,opt,name=player_id" json:"player_id,omitempty"` - DeathTime *int32 `protobuf:"varint,2,opt,name=death_time" json:"death_time,omitempty"` - KillerPlayerId *uint32 `protobuf:"varint,3,opt,name=killer_player_id" json:"killer_player_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_KillDetails) Reset() { *m = CMsgDOTARealtimeGameStats_KillDetails{} } -func (m *CMsgDOTARealtimeGameStats_KillDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_KillDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_KillDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 7} -} - -func (m *CMsgDOTARealtimeGameStats_KillDetails) GetPlayerId() uint32 { - if m != nil && m.PlayerId != nil { - return *m.PlayerId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_KillDetails) GetDeathTime() int32 { - if m != nil && m.DeathTime != nil { - return *m.DeathTime - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_KillDetails) GetKillerPlayerId() uint32 { - if m != nil && m.KillerPlayerId != nil { - return *m.KillerPlayerId - } - return 0 -} - -type CMsgDOTARealtimeGameStats_BroadcasterDetails struct { - PlayerId *uint32 `protobuf:"varint,1,opt,name=player_id" json:"player_id,omitempty"` - SelectedHero *uint32 `protobuf:"varint,2,opt,name=selected_hero" json:"selected_hero,omitempty"` - SelectedGraph *uint32 `protobuf:"varint,3,opt,name=selected_graph" json:"selected_graph,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_BroadcasterDetails) Reset() { - *m = CMsgDOTARealtimeGameStats_BroadcasterDetails{} -} -func (m *CMsgDOTARealtimeGameStats_BroadcasterDetails) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStats_BroadcasterDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_BroadcasterDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 8} -} - -func (m *CMsgDOTARealtimeGameStats_BroadcasterDetails) GetPlayerId() uint32 { - if m != nil && m.PlayerId != nil { - return *m.PlayerId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BroadcasterDetails) GetSelectedHero() uint32 { - if m != nil && m.SelectedHero != nil { - return *m.SelectedHero - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_BroadcasterDetails) GetSelectedGraph() uint32 { - if m != nil && m.SelectedGraph != nil { - return *m.SelectedGraph - } - return 0 -} - -type CMsgDOTARealtimeGameStats_PickBanDetails struct { - Hero *uint32 `protobuf:"varint,1,opt,name=hero" json:"hero,omitempty"` - Team *uint32 `protobuf:"varint,2,opt,name=team" json:"team,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_PickBanDetails) Reset() { - *m = CMsgDOTARealtimeGameStats_PickBanDetails{} -} -func (m *CMsgDOTARealtimeGameStats_PickBanDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_PickBanDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_PickBanDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 9} -} - -func (m *CMsgDOTARealtimeGameStats_PickBanDetails) GetHero() uint32 { - if m != nil && m.Hero != nil { - return *m.Hero - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_PickBanDetails) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -type CMsgDOTARealtimeGameStats_MatchDetails struct { - ServerSteamId *uint64 `protobuf:"fixed64,1,opt,name=server_steam_id" json:"server_steam_id,omitempty"` - Matchid *uint64 `protobuf:"varint,2,opt,name=matchid" json:"matchid,omitempty"` - Timestamp *uint32 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` - TimeOfDay *float32 `protobuf:"fixed32,4,opt,name=time_of_day" json:"time_of_day,omitempty"` - IsNightstalkerNight *bool `protobuf:"varint,5,opt,name=is_nightstalker_night" json:"is_nightstalker_night,omitempty"` - GameTime *int32 `protobuf:"varint,6,opt,name=game_time" json:"game_time,omitempty"` - TeamidRadiant *uint32 `protobuf:"varint,8,opt,name=teamid_radiant" json:"teamid_radiant,omitempty"` - TeamidDire *uint32 `protobuf:"varint,9,opt,name=teamid_dire" json:"teamid_dire,omitempty"` - Picks []*CMsgDOTARealtimeGameStats_PickBanDetails `protobuf:"bytes,10,rep,name=picks" json:"picks,omitempty"` - Bans []*CMsgDOTARealtimeGameStats_PickBanDetails `protobuf:"bytes,11,rep,name=bans" json:"bans,omitempty"` - Kills []*CMsgDOTARealtimeGameStats_KillDetails `protobuf:"bytes,12,rep,name=kills" json:"kills,omitempty"` - Broadcasters []*CMsgDOTARealtimeGameStats_BroadcasterDetails `protobuf:"bytes,13,rep,name=broadcasters" json:"broadcasters,omitempty"` - GameMode *uint32 `protobuf:"varint,14,opt,name=game_mode" json:"game_mode,omitempty"` - LeagueId *uint32 `protobuf:"varint,15,opt,name=league_id" json:"league_id,omitempty"` - SingleTeam *bool `protobuf:"varint,16,opt,name=single_team" json:"single_team,omitempty"` - CheersPeak *uint32 `protobuf:"varint,17,opt,name=cheers_peak" json:"cheers_peak,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) Reset() { - *m = CMsgDOTARealtimeGameStats_MatchDetails{} -} -func (m *CMsgDOTARealtimeGameStats_MatchDetails) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_MatchDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_MatchDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 10} -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetServerSteamId() uint64 { - if m != nil && m.ServerSteamId != nil { - return *m.ServerSteamId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetMatchid() uint64 { - if m != nil && m.Matchid != nil { - return *m.Matchid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetTimeOfDay() float32 { - if m != nil && m.TimeOfDay != nil { - return *m.TimeOfDay - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetIsNightstalkerNight() bool { - if m != nil && m.IsNightstalkerNight != nil { - return *m.IsNightstalkerNight - } - return false -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetGameTime() int32 { - if m != nil && m.GameTime != nil { - return *m.GameTime - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetTeamidRadiant() uint32 { - if m != nil && m.TeamidRadiant != nil { - return *m.TeamidRadiant - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetTeamidDire() uint32 { - if m != nil && m.TeamidDire != nil { - return *m.TeamidDire - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetPicks() []*CMsgDOTARealtimeGameStats_PickBanDetails { - if m != nil { - return m.Picks - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetBans() []*CMsgDOTARealtimeGameStats_PickBanDetails { - if m != nil { - return m.Bans - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetKills() []*CMsgDOTARealtimeGameStats_KillDetails { - if m != nil { - return m.Kills - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetBroadcasters() []*CMsgDOTARealtimeGameStats_BroadcasterDetails { - if m != nil { - return m.Broadcasters - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetSingleTeam() bool { - if m != nil && m.SingleTeam != nil { - return *m.SingleTeam - } - return false -} - -func (m *CMsgDOTARealtimeGameStats_MatchDetails) GetCheersPeak() uint32 { - if m != nil && m.CheersPeak != nil { - return *m.CheersPeak - } - return 0 -} - -type CMsgDOTARealtimeGameStats_GraphData struct { - GraphGold []int32 `protobuf:"varint,1,rep,name=graph_gold" json:"graph_gold,omitempty"` - GraphXp []int32 `protobuf:"varint,2,rep,name=graph_xp" json:"graph_xp,omitempty"` - GraphKill []int32 `protobuf:"varint,3,rep,name=graph_kill" json:"graph_kill,omitempty"` - GraphTower []int32 `protobuf:"varint,4,rep,name=graph_tower" json:"graph_tower,omitempty"` - GraphRax []int32 `protobuf:"varint,5,rep,name=graph_rax" json:"graph_rax,omitempty"` - TeamLocStats []*CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats `protobuf:"bytes,6,rep,name=team_loc_stats" json:"team_loc_stats,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) Reset() { *m = CMsgDOTARealtimeGameStats_GraphData{} } -func (m *CMsgDOTARealtimeGameStats_GraphData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStats_GraphData) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_GraphData) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 11} -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) GetGraphGold() []int32 { - if m != nil { - return m.GraphGold - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) GetGraphXp() []int32 { - if m != nil { - return m.GraphXp - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) GetGraphKill() []int32 { - if m != nil { - return m.GraphKill - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) GetGraphTower() []int32 { - if m != nil { - return m.GraphTower - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) GetGraphRax() []int32 { - if m != nil { - return m.GraphRax - } - return nil -} - -func (m *CMsgDOTARealtimeGameStats_GraphData) GetTeamLocStats() []*CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats { - if m != nil { - return m.TeamLocStats - } - return nil -} - -type CMsgDOTARealtimeGameStats_GraphData_LocationStats struct { - Stats []int32 `protobuf:"varint,1,rep,name=stats" json:"stats,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_GraphData_LocationStats) Reset() { - *m = CMsgDOTARealtimeGameStats_GraphData_LocationStats{} -} -func (m *CMsgDOTARealtimeGameStats_GraphData_LocationStats) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStats_GraphData_LocationStats) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_GraphData_LocationStats) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 11, 0} -} - -func (m *CMsgDOTARealtimeGameStats_GraphData_LocationStats) GetStats() []int32 { - if m != nil { - return m.Stats - } - return nil -} - -type CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats struct { - LocStats []*CMsgDOTARealtimeGameStats_GraphData_LocationStats `protobuf:"bytes,1,rep,name=loc_stats" json:"loc_stats,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats) Reset() { - *m = CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats{} -} -func (m *CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{50, 11, 1} -} - -func (m *CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats) GetLocStats() []*CMsgDOTARealtimeGameStats_GraphData_LocationStats { - if m != nil { - return m.LocStats - } - return nil -} - -type CMsgDOTARealtimeGameStatsTerse struct { - Match *CMsgDOTARealtimeGameStatsTerse_MatchDetails `protobuf:"bytes,1,opt,name=match" json:"match,omitempty"` - Teams []*CMsgDOTARealtimeGameStatsTerse_TeamDetails `protobuf:"bytes,2,rep,name=teams" json:"teams,omitempty"` - Buildings []*CMsgDOTARealtimeGameStatsTerse_BuildingDetails `protobuf:"bytes,3,rep,name=buildings" json:"buildings,omitempty"` - GraphData *CMsgDOTARealtimeGameStatsTerse_GraphData `protobuf:"bytes,4,opt,name=graph_data" json:"graph_data,omitempty"` - DeltaFrame *bool `protobuf:"varint,5,opt,name=delta_frame" json:"delta_frame,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStatsTerse) Reset() { *m = CMsgDOTARealtimeGameStatsTerse{} } -func (m *CMsgDOTARealtimeGameStatsTerse) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStatsTerse) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStatsTerse) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{51} } - -func (m *CMsgDOTARealtimeGameStatsTerse) GetMatch() *CMsgDOTARealtimeGameStatsTerse_MatchDetails { - if m != nil { - return m.Match - } - return nil -} - -func (m *CMsgDOTARealtimeGameStatsTerse) GetTeams() []*CMsgDOTARealtimeGameStatsTerse_TeamDetails { - if m != nil { - return m.Teams - } - return nil -} - -func (m *CMsgDOTARealtimeGameStatsTerse) GetBuildings() []*CMsgDOTARealtimeGameStatsTerse_BuildingDetails { - if m != nil { - return m.Buildings - } - return nil -} - -func (m *CMsgDOTARealtimeGameStatsTerse) GetGraphData() *CMsgDOTARealtimeGameStatsTerse_GraphData { - if m != nil { - return m.GraphData - } - return nil -} - -func (m *CMsgDOTARealtimeGameStatsTerse) GetDeltaFrame() bool { - if m != nil && m.DeltaFrame != nil { - return *m.DeltaFrame - } - return false -} - -type CMsgDOTARealtimeGameStatsTerse_TeamDetails struct { - TeamNumber *uint32 `protobuf:"varint,1,opt,name=team_number" json:"team_number,omitempty"` - TeamId *uint32 `protobuf:"varint,2,opt,name=team_id" json:"team_id,omitempty"` - TeamName *string `protobuf:"bytes,3,opt,name=team_name" json:"team_name,omitempty"` - TeamLogo *uint64 `protobuf:"fixed64,4,opt,name=team_logo" json:"team_logo,omitempty"` - Score *uint32 `protobuf:"varint,5,opt,name=score" json:"score,omitempty"` - Players []*CMsgDOTARealtimeGameStatsTerse_PlayerDetails `protobuf:"bytes,6,rep,name=players" json:"players,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) Reset() { - *m = CMsgDOTARealtimeGameStatsTerse_TeamDetails{} -} -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStatsTerse_TeamDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStatsTerse_TeamDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{51, 0} -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) GetTeamNumber() uint32 { - if m != nil && m.TeamNumber != nil { - return *m.TeamNumber - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) GetTeamName() string { - if m != nil && m.TeamName != nil { - return *m.TeamName - } - return "" -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) GetTeamLogo() uint64 { - if m != nil && m.TeamLogo != nil { - return *m.TeamLogo - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_TeamDetails) GetPlayers() []*CMsgDOTARealtimeGameStatsTerse_PlayerDetails { - if m != nil { - return m.Players - } - return nil -} - -type CMsgDOTARealtimeGameStatsTerse_PlayerDetails struct { - Accountid *uint32 `protobuf:"varint,1,opt,name=accountid" json:"accountid,omitempty"` - Playerid *uint32 `protobuf:"varint,2,opt,name=playerid" json:"playerid,omitempty"` - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Team *uint32 `protobuf:"varint,4,opt,name=team" json:"team,omitempty"` - Heroid *uint32 `protobuf:"varint,5,opt,name=heroid" json:"heroid,omitempty"` - Level *uint32 `protobuf:"varint,6,opt,name=level" json:"level,omitempty"` - KillCount *uint32 `protobuf:"varint,7,opt,name=kill_count" json:"kill_count,omitempty"` - DeathCount *uint32 `protobuf:"varint,8,opt,name=death_count" json:"death_count,omitempty"` - AssistsCount *uint32 `protobuf:"varint,9,opt,name=assists_count" json:"assists_count,omitempty"` - DeniesCount *uint32 `protobuf:"varint,10,opt,name=denies_count" json:"denies_count,omitempty"` - LhCount *uint32 `protobuf:"varint,11,opt,name=lh_count" json:"lh_count,omitempty"` - Gold *uint32 `protobuf:"varint,12,opt,name=gold" json:"gold,omitempty"` - X *float32 `protobuf:"fixed32,13,opt,name=x" json:"x,omitempty"` - Y *float32 `protobuf:"fixed32,14,opt,name=y" json:"y,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) Reset() { - *m = CMsgDOTARealtimeGameStatsTerse_PlayerDetails{} -} -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStatsTerse_PlayerDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStatsTerse_PlayerDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{51, 1} -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetPlayerid() uint32 { - if m != nil && m.Playerid != nil { - return *m.Playerid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetHeroid() uint32 { - if m != nil && m.Heroid != nil { - return *m.Heroid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetKillCount() uint32 { - if m != nil && m.KillCount != nil { - return *m.KillCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetDeathCount() uint32 { - if m != nil && m.DeathCount != nil { - return *m.DeathCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetAssistsCount() uint32 { - if m != nil && m.AssistsCount != nil { - return *m.AssistsCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetDeniesCount() uint32 { - if m != nil && m.DeniesCount != nil { - return *m.DeniesCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetLhCount() uint32 { - if m != nil && m.LhCount != nil { - return *m.LhCount - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetGold() uint32 { - if m != nil && m.Gold != nil { - return *m.Gold - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetX() float32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_PlayerDetails) GetY() float32 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -type CMsgDOTARealtimeGameStatsTerse_BuildingDetails struct { - Team *uint32 `protobuf:"varint,1,opt,name=team" json:"team,omitempty"` - Heading *float32 `protobuf:"fixed32,2,opt,name=heading" json:"heading,omitempty"` - Type *uint32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"` - Lane *uint32 `protobuf:"varint,4,opt,name=lane" json:"lane,omitempty"` - Tier *uint32 `protobuf:"varint,5,opt,name=tier" json:"tier,omitempty"` - X *float32 `protobuf:"fixed32,6,opt,name=x" json:"x,omitempty"` - Y *float32 `protobuf:"fixed32,7,opt,name=y" json:"y,omitempty"` - Destroyed *bool `protobuf:"varint,8,opt,name=destroyed" json:"destroyed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) Reset() { - *m = CMsgDOTARealtimeGameStatsTerse_BuildingDetails{} -} -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStatsTerse_BuildingDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStatsTerse_BuildingDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{51, 2} -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetHeading() float32 { - if m != nil && m.Heading != nil { - return *m.Heading - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetLane() uint32 { - if m != nil && m.Lane != nil { - return *m.Lane - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetTier() uint32 { - if m != nil && m.Tier != nil { - return *m.Tier - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetX() float32 { - if m != nil && m.X != nil { - return *m.X - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetY() float32 { - if m != nil && m.Y != nil { - return *m.Y - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_BuildingDetails) GetDestroyed() bool { - if m != nil && m.Destroyed != nil { - return *m.Destroyed - } - return false -} - -type CMsgDOTARealtimeGameStatsTerse_MatchDetails struct { - ServerSteamId *uint64 `protobuf:"fixed64,1,opt,name=server_steam_id" json:"server_steam_id,omitempty"` - Matchid *uint64 `protobuf:"varint,2,opt,name=matchid" json:"matchid,omitempty"` - Timestamp *uint32 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` - GameTime *int32 `protobuf:"varint,4,opt,name=game_time" json:"game_time,omitempty"` - SteamBroadcasterAccountIds []uint32 `protobuf:"varint,6,rep,name=steam_broadcaster_account_ids" json:"steam_broadcaster_account_ids,omitempty"` - GameMode *uint32 `protobuf:"varint,7,opt,name=game_mode" json:"game_mode,omitempty"` - LeagueId *uint32 `protobuf:"varint,8,opt,name=league_id" json:"league_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) Reset() { - *m = CMsgDOTARealtimeGameStatsTerse_MatchDetails{} -} -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) String() string { - return proto.CompactTextString(m) -} -func (*CMsgDOTARealtimeGameStatsTerse_MatchDetails) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStatsTerse_MatchDetails) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{51, 3} -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetServerSteamId() uint64 { - if m != nil && m.ServerSteamId != nil { - return *m.ServerSteamId - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetMatchid() uint64 { - if m != nil && m.Matchid != nil { - return *m.Matchid - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetGameTime() int32 { - if m != nil && m.GameTime != nil { - return *m.GameTime - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetSteamBroadcasterAccountIds() []uint32 { - if m != nil { - return m.SteamBroadcasterAccountIds - } - return nil -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CMsgDOTARealtimeGameStatsTerse_MatchDetails) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -type CMsgDOTARealtimeGameStatsTerse_GraphData struct { - GraphGold []int32 `protobuf:"varint,1,rep,name=graph_gold" json:"graph_gold,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTARealtimeGameStatsTerse_GraphData) Reset() { - *m = CMsgDOTARealtimeGameStatsTerse_GraphData{} -} -func (m *CMsgDOTARealtimeGameStatsTerse_GraphData) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTARealtimeGameStatsTerse_GraphData) ProtoMessage() {} -func (*CMsgDOTARealtimeGameStatsTerse_GraphData) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{51, 4} -} - -func (m *CMsgDOTARealtimeGameStatsTerse_GraphData) GetGraphGold() []int32 { - if m != nil { - return m.GraphGold - } - return nil -} - -type CMsgGCToClientMatchGroupsVersion struct { - MatchgroupsVersion *uint32 `protobuf:"varint,1,opt,name=matchgroups_version" json:"matchgroups_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientMatchGroupsVersion) Reset() { *m = CMsgGCToClientMatchGroupsVersion{} } -func (m *CMsgGCToClientMatchGroupsVersion) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientMatchGroupsVersion) ProtoMessage() {} -func (*CMsgGCToClientMatchGroupsVersion) Descriptor() ([]byte, []int) { - return dota_common_fileDescriptor0, []int{52} -} - -func (m *CMsgGCToClientMatchGroupsVersion) GetMatchgroupsVersion() uint32 { - if m != nil && m.MatchgroupsVersion != nil { - return *m.MatchgroupsVersion - } - return 0 -} - -type CMsgDOTASDOHeroStatsHistory struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - GameMode *uint32 `protobuf:"varint,2,opt,name=game_mode" json:"game_mode,omitempty"` - LobbyType *uint32 `protobuf:"varint,3,opt,name=lobby_type" json:"lobby_type,omitempty"` - StartTime *uint32 `protobuf:"varint,4,opt,name=start_time" json:"start_time,omitempty"` - Won *bool `protobuf:"varint,5,opt,name=won" json:"won,omitempty"` - Gpm *uint32 `protobuf:"varint,6,opt,name=gpm" json:"gpm,omitempty"` - Xpm *uint32 `protobuf:"varint,7,opt,name=xpm" json:"xpm,omitempty"` - Kills *uint32 `protobuf:"varint,8,opt,name=kills" json:"kills,omitempty"` - Deaths *uint32 `protobuf:"varint,9,opt,name=deaths" json:"deaths,omitempty"` - Assists *uint32 `protobuf:"varint,10,opt,name=assists" json:"assists,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDOTASDOHeroStatsHistory) Reset() { *m = CMsgDOTASDOHeroStatsHistory{} } -func (m *CMsgDOTASDOHeroStatsHistory) String() string { return proto.CompactTextString(m) } -func (*CMsgDOTASDOHeroStatsHistory) ProtoMessage() {} -func (*CMsgDOTASDOHeroStatsHistory) Descriptor() ([]byte, []int) { return dota_common_fileDescriptor0, []int{53} } - -func (m *CMsgDOTASDOHeroStatsHistory) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetGameMode() uint32 { - if m != nil && m.GameMode != nil { - return *m.GameMode - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetLobbyType() uint32 { - if m != nil && m.LobbyType != nil { - return *m.LobbyType - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetStartTime() uint32 { - if m != nil && m.StartTime != nil { - return *m.StartTime - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetWon() bool { - if m != nil && m.Won != nil { - return *m.Won - } - return false -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetGpm() uint32 { - if m != nil && m.Gpm != nil { - return *m.Gpm - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetXpm() uint32 { - if m != nil && m.Xpm != nil { - return *m.Xpm - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetDeaths() uint32 { - if m != nil && m.Deaths != nil { - return *m.Deaths - } - return 0 -} - -func (m *CMsgDOTASDOHeroStatsHistory) GetAssists() uint32 { - if m != nil && m.Assists != nil { - return *m.Assists - } - return 0 -} - -func init() { - proto.RegisterType((*CSODOTAGameAccountClient)(nil), "CSODOTAGameAccountClient") - proto.RegisterType((*CSODOTAPartyMember)(nil), "CSODOTAPartyMember") - proto.RegisterType((*CSODOTAParty)(nil), "CSODOTAParty") - proto.RegisterType((*CSODOTAPartyInvite)(nil), "CSODOTAPartyInvite") - proto.RegisterType((*CSODOTAPartyInvite_PartyMember)(nil), "CSODOTAPartyInvite.PartyMember") - proto.RegisterType((*CSODOTALobbyInvite)(nil), "CSODOTALobbyInvite") - proto.RegisterType((*CSODOTALobbyInvite_LobbyMember)(nil), "CSODOTALobbyInvite.LobbyMember") - proto.RegisterType((*CDOTAClientHardwareSpecs)(nil), "CDOTAClientHardwareSpecs") - proto.RegisterType((*CDOTASaveGame)(nil), "CDOTASaveGame") - proto.RegisterType((*CDOTASaveGame_Player)(nil), "CDOTASaveGame.Player") - proto.RegisterType((*CDOTASaveGame_SaveInstance)(nil), "CDOTASaveGame.SaveInstance") - proto.RegisterType((*CDOTASaveGame_SaveInstance_PlayerPositions)(nil), "CDOTASaveGame.SaveInstance.PlayerPositions") - proto.RegisterType((*CMsgLeaverState)(nil), "CMsgLeaverState") - proto.RegisterType((*CDOTALobbyMember)(nil), "CDOTALobbyMember") - proto.RegisterType((*CDOTALobbyMember_CDOTALobbyMemberXPBonus)(nil), "CDOTALobbyMember.CDOTALobbyMemberXPBonus") - proto.RegisterType((*CLobbyTeamDetails)(nil), "CLobbyTeamDetails") - proto.RegisterType((*CLobbyTimedRewardDetails)(nil), "CLobbyTimedRewardDetails") - proto.RegisterType((*CLobbyBroadcastChannelInfo)(nil), "CLobbyBroadcastChannelInfo") - proto.RegisterType((*CSODOTALobby)(nil), "CSODOTALobby") - proto.RegisterType((*CSODOTALobby_CExtraMsg)(nil), "CSODOTALobby.CExtraMsg") - proto.RegisterType((*CMsgLobbyEventPoints)(nil), "CMsgLobbyEventPoints") - proto.RegisterType((*CMsgLobbyEventPoints_AccountPoints)(nil), "CMsgLobbyEventPoints.AccountPoints") - proto.RegisterType((*CMsgDOTABroadcastNotification)(nil), "CMsgDOTABroadcastNotification") - proto.RegisterType((*CMsgDOTAPCBangTimedReward)(nil), "CMsgDOTAPCBangTimedReward") - proto.RegisterType((*CProtoItemHeroStatue)(nil), "CProtoItemHeroStatue") - proto.RegisterType((*CProtoItemTeamShowcase)(nil), "CProtoItemTeamShowcase") - proto.RegisterType((*CMatchPlayerAbilityUpgrade)(nil), "CMatchPlayerAbilityUpgrade") - proto.RegisterType((*CMatchAdditionalUnitInventory)(nil), "CMatchAdditionalUnitInventory") - proto.RegisterType((*CMatchHeroSelectEvent)(nil), "CMatchHeroSelectEvent") - proto.RegisterType((*CMsgDOTAProcessFantasyScheduledEvent)(nil), "CMsgDOTAProcessFantasyScheduledEvent") - proto.RegisterType((*CMsgDOTAHasItemQuery)(nil), "CMsgDOTAHasItemQuery") - proto.RegisterType((*CMsgDOTAHasItemResponse)(nil), "CMsgDOTAHasItemResponse") - proto.RegisterType((*CMsgDOTAHasItemDefsQuery)(nil), "CMsgDOTAHasItemDefsQuery") - proto.RegisterType((*CMsgDOTAHasItemDefsResponse)(nil), "CMsgDOTAHasItemDefsResponse") - proto.RegisterType((*CMsgDOTAConsumeFantasyTicket)(nil), "CMsgDOTAConsumeFantasyTicket") - proto.RegisterType((*CMsgDOTAConsumeFantasyTicketFailure)(nil), "CMsgDOTAConsumeFantasyTicketFailure") - proto.RegisterType((*CMsgGCToGCFantasySetMatchLeague)(nil), "CMsgGCToGCFantasySetMatchLeague") - proto.RegisterType((*CSODOTAMapLocationState)(nil), "CSODOTAMapLocationState") - proto.RegisterType((*CMsgNexonPartnerUpdate)(nil), "CMsgNexonPartnerUpdate") - proto.RegisterType((*CMsgMakeOffering)(nil), "CMsgMakeOffering") - proto.RegisterType((*CMsgRequestOfferings)(nil), "CMsgRequestOfferings") - proto.RegisterType((*CMsgRequestOfferingsResponse)(nil), "CMsgRequestOfferingsResponse") - proto.RegisterType((*CMsgRequestOfferingsResponse_NewYearsOffering)(nil), "CMsgRequestOfferingsResponse.NewYearsOffering") - proto.RegisterType((*CMsgLeagueAdminList)(nil), "CMsgLeagueAdminList") - proto.RegisterType((*CMsgPerfectWorldUserLookupRequest)(nil), "CMsgPerfectWorldUserLookupRequest") - proto.RegisterType((*CMsgPerfectWorldUserLookupResponse)(nil), "CMsgPerfectWorldUserLookupResponse") - proto.RegisterType((*CCompendiumTimestampedData)(nil), "CCompendiumTimestampedData") - proto.RegisterType((*CCompendiumGameTimeline)(nil), "CCompendiumGameTimeline") - proto.RegisterType((*CCompendiumGameList)(nil), "CCompendiumGameList") - proto.RegisterType((*CAdditionalEquipSlot)(nil), "CAdditionalEquipSlot") - proto.RegisterType((*CMsgDOTARedeemItem)(nil), "CMsgDOTARedeemItem") - proto.RegisterType((*CMsgDOTARedeemItemResponse)(nil), "CMsgDOTARedeemItemResponse") - proto.RegisterType((*CMsgDOTACombatLogEntry)(nil), "CMsgDOTACombatLogEntry") - proto.RegisterType((*CMsgDOTAProfileCard)(nil), "CMsgDOTAProfileCard") - proto.RegisterType((*CMsgDOTAProfileCard_Slot)(nil), "CMsgDOTAProfileCard.Slot") - proto.RegisterType((*CMsgDOTAProfileCard_Slot_Trophy)(nil), "CMsgDOTAProfileCard.Slot.Trophy") - proto.RegisterType((*CMsgDOTAProfileCard_Slot_Stat)(nil), "CMsgDOTAProfileCard.Slot.Stat") - proto.RegisterType((*CMsgDOTAProfileCard_Slot_Item)(nil), "CMsgDOTAProfileCard.Slot.Item") - proto.RegisterType((*CMsgDOTAProfileCard_Slot_Hero)(nil), "CMsgDOTAProfileCard.Slot.Hero") - proto.RegisterType((*CMsgDOTAProfileCard_Slot_Emoticon)(nil), "CMsgDOTAProfileCard.Slot.Emoticon") - proto.RegisterType((*CMsgGCToClientNewBloomTimingUpdated)(nil), "CMsgGCToClientNewBloomTimingUpdated") - proto.RegisterType((*CSODOTAPlayerChallenge)(nil), "CSODOTAPlayerChallenge") - proto.RegisterType((*CMsgClientToGCRerollPlayerChallenge)(nil), "CMsgClientToGCRerollPlayerChallenge") - proto.RegisterType((*CMsgGCRerollPlayerChallengeResponse)(nil), "CMsgGCRerollPlayerChallengeResponse") - proto.RegisterType((*CMsgGCTopCustomGamesList)(nil), "CMsgGCTopCustomGamesList") - proto.RegisterType((*CMsgDOTARealtimeGameStats)(nil), "CMsgDOTARealtimeGameStats") - proto.RegisterType((*CMsgDOTARealtimeGameStats_TeamDetails)(nil), "CMsgDOTARealtimeGameStats.TeamDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_ItemDetails)(nil), "CMsgDOTARealtimeGameStats.ItemDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_AbilityDetails)(nil), "CMsgDOTARealtimeGameStats.AbilityDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_HeroToHeroStats)(nil), "CMsgDOTARealtimeGameStats.HeroToHeroStats") - proto.RegisterType((*CMsgDOTARealtimeGameStats_AbilityList)(nil), "CMsgDOTARealtimeGameStats.AbilityList") - proto.RegisterType((*CMsgDOTARealtimeGameStats_PlayerDetails)(nil), "CMsgDOTARealtimeGameStats.PlayerDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_BuildingDetails)(nil), "CMsgDOTARealtimeGameStats.BuildingDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_KillDetails)(nil), "CMsgDOTARealtimeGameStats.KillDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_BroadcasterDetails)(nil), "CMsgDOTARealtimeGameStats.BroadcasterDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_PickBanDetails)(nil), "CMsgDOTARealtimeGameStats.PickBanDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_MatchDetails)(nil), "CMsgDOTARealtimeGameStats.MatchDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStats_GraphData)(nil), "CMsgDOTARealtimeGameStats.GraphData") - proto.RegisterType((*CMsgDOTARealtimeGameStats_GraphData_LocationStats)(nil), "CMsgDOTARealtimeGameStats.GraphData.LocationStats") - proto.RegisterType((*CMsgDOTARealtimeGameStats_GraphData_TeamLocationStats)(nil), "CMsgDOTARealtimeGameStats.GraphData.TeamLocationStats") - proto.RegisterType((*CMsgDOTARealtimeGameStatsTerse)(nil), "CMsgDOTARealtimeGameStatsTerse") - proto.RegisterType((*CMsgDOTARealtimeGameStatsTerse_TeamDetails)(nil), "CMsgDOTARealtimeGameStatsTerse.TeamDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStatsTerse_PlayerDetails)(nil), "CMsgDOTARealtimeGameStatsTerse.PlayerDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStatsTerse_BuildingDetails)(nil), "CMsgDOTARealtimeGameStatsTerse.BuildingDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStatsTerse_MatchDetails)(nil), "CMsgDOTARealtimeGameStatsTerse.MatchDetails") - proto.RegisterType((*CMsgDOTARealtimeGameStatsTerse_GraphData)(nil), "CMsgDOTARealtimeGameStatsTerse.GraphData") - proto.RegisterType((*CMsgGCToClientMatchGroupsVersion)(nil), "CMsgGCToClientMatchGroupsVersion") - proto.RegisterType((*CMsgDOTASDOHeroStatsHistory)(nil), "CMsgDOTASDOHeroStatsHistory") - proto.RegisterEnum("EDOTAGCMsg", EDOTAGCMsg_name, EDOTAGCMsg_value) - proto.RegisterEnum("ESpecialPingValue", ESpecialPingValue_name, ESpecialPingValue_value) - proto.RegisterEnum("DOTA_GameMode", DOTA_GameMode_name, DOTA_GameMode_value) - proto.RegisterEnum("DOTA_GameState", DOTA_GameState_name, DOTA_GameState_value) - proto.RegisterEnum("DOTA_GC_TEAM", DOTA_GC_TEAM_name, DOTA_GC_TEAM_value) - proto.RegisterEnum("DOTA_CM_PICK", DOTA_CM_PICK_name, DOTA_CM_PICK_value) - proto.RegisterEnum("DOTAConnectionStateT", DOTAConnectionStateT_name, DOTAConnectionStateT_value) - proto.RegisterEnum("DOTALeaverStatusT", DOTALeaverStatusT_name, DOTALeaverStatusT_value) - proto.RegisterEnum("DOTALowPriorityBanType", DOTALowPriorityBanType_name, DOTALowPriorityBanType_value) - proto.RegisterEnum("DOTALobbyReadyState", DOTALobbyReadyState_name, DOTALobbyReadyState_value) - proto.RegisterEnum("DOTAGameVersion", DOTAGameVersion_name, DOTAGameVersion_value) - proto.RegisterEnum("DOTAJoinLobbyResult", DOTAJoinLobbyResult_name, DOTAJoinLobbyResult_value) - proto.RegisterEnum("SelectionPriorityType", SelectionPriorityType_name, SelectionPriorityType_value) - proto.RegisterEnum("DOTAMatchVote", DOTAMatchVote_name, DOTAMatchVote_value) - proto.RegisterEnum("DOTA_LobbyMemberXPBonus", DOTA_LobbyMemberXPBonus_name, DOTA_LobbyMemberXPBonus_value) - proto.RegisterEnum("DOTALobbyVisibility", DOTALobbyVisibility_name, DOTALobbyVisibility_value) - proto.RegisterEnum("EDOTAPlayerMMRType", EDOTAPlayerMMRType_name, EDOTAPlayerMMRType_value) - proto.RegisterEnum("MatchType", MatchType_name, MatchType_value) - proto.RegisterEnum("DOTABotDifficulty", DOTABotDifficulty_name, DOTABotDifficulty_value) - proto.RegisterEnum("MatchLanguages", MatchLanguages_name, MatchLanguages_value) - proto.RegisterEnum("ETournamentTemplate", ETournamentTemplate_name, ETournamentTemplate_value) - proto.RegisterEnum("ETournamentType", ETournamentType_name, ETournamentType_value) - proto.RegisterEnum("EEvent", EEvent_name, EEvent_value) - proto.RegisterEnum("LobbyDotaTVDelay", LobbyDotaTVDelay_name, LobbyDotaTVDelay_value) - proto.RegisterEnum("LobbyDotaPauseSetting", LobbyDotaPauseSetting_name, LobbyDotaPauseSetting_value) - proto.RegisterEnum("EMatchOutcome", EMatchOutcome_name, EMatchOutcome_value) - proto.RegisterEnum("EDOTAGCSessionNeed", EDOTAGCSessionNeed_name, EDOTAGCSessionNeed_value) - proto.RegisterEnum("Fantasy_Roles", Fantasy_Roles_name, Fantasy_Roles_value) - proto.RegisterEnum("Fantasy_Team_Slots", Fantasy_Team_Slots_name, Fantasy_Team_Slots_value) - proto.RegisterEnum("Fantasy_Selection_Mode", Fantasy_Selection_Mode_name, Fantasy_Selection_Mode_value) - proto.RegisterEnum("DOTA_TournamentEvents", DOTA_TournamentEvents_name, DOTA_TournamentEvents_value) - proto.RegisterEnum("DOTA_COMBATLOG_TYPES", DOTA_COMBATLOG_TYPES_name, DOTA_COMBATLOG_TYPES_value) - proto.RegisterEnum("DOTAChatChannelTypeT", DOTAChatChannelTypeT_name, DOTAChatChannelTypeT_value) - proto.RegisterEnum("CSODOTAParty_State", CSODOTAParty_State_name, CSODOTAParty_State_value) - proto.RegisterEnum("CSODOTALobby_State", CSODOTALobby_State_name, CSODOTALobby_State_value) - proto.RegisterEnum("CSODOTALobby_LobbyType", CSODOTALobby_LobbyType_name, CSODOTALobby_LobbyType_value) - proto.RegisterEnum("CMsgPerfectWorldUserLookupResponse_EResultCode", CMsgPerfectWorldUserLookupResponse_EResultCode_name, CMsgPerfectWorldUserLookupResponse_EResultCode_value) - proto.RegisterEnum("CMsgDOTARedeemItemResponse_EResultCode", CMsgDOTARedeemItemResponse_EResultCode_name, CMsgDOTARedeemItemResponse_EResultCode_value) - proto.RegisterEnum("CMsgDOTAProfileCard_EStatID", CMsgDOTAProfileCard_EStatID_name, CMsgDOTAProfileCard_EStatID_value) - proto.RegisterEnum("CSODOTAPlayerChallenge_EFlags", CSODOTAPlayerChallenge_EFlags_name, CSODOTAPlayerChallenge_EFlags_value) - proto.RegisterEnum("CMsgGCRerollPlayerChallengeResponse_EResult", CMsgGCRerollPlayerChallengeResponse_EResult_name, CMsgGCRerollPlayerChallengeResponse_EResult_value) - proto.RegisterEnum("CMsgDOTARealtimeGameStats_GraphDataEStat", CMsgDOTARealtimeGameStats_GraphDataEStat_name, CMsgDOTARealtimeGameStats_GraphDataEStat_value) - proto.RegisterEnum("CMsgDOTARealtimeGameStats_GraphDataELocation", CMsgDOTARealtimeGameStats_GraphDataELocation_name, CMsgDOTARealtimeGameStats_GraphDataELocation_value) -} - -var dota_common_fileDescriptor0 = []byte{ - // 17253 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0xbd, 0x69, 0x78, 0x5b, 0xd7, - 0x75, 0x28, 0x6a, 0x8e, 0xa2, 0x0e, 0x25, 0x6a, 0x0b, 0x96, 0x64, 0x8a, 0xb6, 0x65, 0x9b, 0x76, - 0x3c, 0xd0, 0x36, 0x2d, 0xc9, 0x8e, 0x48, 0x82, 0xb7, 0x64, 0x41, 0x00, 0xa4, 0x10, 0x81, 0x00, - 0x0c, 0x80, 0x92, 0xf5, 0xfa, 0xbe, 0x7b, 0xbe, 0x23, 0xe0, 0x90, 0x44, 0x05, 0xe2, 0x30, 0x38, - 0x80, 0x64, 0xf6, 0xfb, 0xde, 0x77, 0x9d, 0x38, 0x75, 0x9a, 0xa1, 0x69, 0x92, 0x26, 0x6d, 0x92, - 0xa6, 0x71, 0x9a, 0x34, 0x69, 0xa6, 0x36, 0x63, 0x73, 0x9b, 0xa6, 0x43, 0xd2, 0xf6, 0xb6, 0x49, - 0xd3, 0x0c, 0x9d, 0x32, 0x35, 0xc3, 0x4d, 0x9b, 0x39, 0xcd, 0x70, 0x33, 0x4f, 0x4d, 0xde, 0x5a, - 0x6b, 0x0f, 0x67, 0xef, 0x73, 0x0e, 0x28, 0xe5, 0xbd, 0xd7, 0xf7, 0x5d, 0xff, 0xb0, 0x88, 0xbd, - 0xd7, 0x9e, 0xd6, 0x5e, 0xf3, 0x5e, 0x7b, 0x1f, 0xeb, 0x86, 0xba, 0xd7, 0x71, 0xec, 0x8d, 0xda, - 0x96, 0xeb, 0xfb, 0xce, 0x86, 0xeb, 0xdb, 0x35, 0x6f, 0x6b, 0xcb, 0x6b, 0x4d, 0x6f, 0xb7, 0xbd, - 0x8e, 0x37, 0x71, 0xad, 0xdf, 0x71, 0x9d, 0x2d, 0x59, 0x27, 0x0a, 0x8f, 0x6c, 0xd4, 0xfc, 0xfa, - 0x45, 0xad, 0x0d, 0x2f, 0x9f, 0xfc, 0xda, 0xa8, 0x35, 0x9e, 0xae, 0x14, 0x33, 0xc5, 0x6a, 0x6a, - 0xc5, 0xd9, 0x72, 0x53, 0xb5, 0x9a, 0xd7, 0x6d, 0x75, 0xd2, 0xcd, 0x86, 0xdb, 0xea, 0x24, 0xc6, - 0x2d, 0xcb, 0xe1, 0x05, 0x76, 0xa3, 0x3e, 0xde, 0x77, 0x73, 0xdf, 0x9d, 0xfb, 0x97, 0x06, 0x1f, - 0x79, 0xf5, 0x8d, 0x7d, 0x89, 0x7d, 0xd6, 0xe0, 0xe5, 0x46, 0xcb, 0x1f, 0x1f, 0xc0, 0xb2, 0xc4, - 0x98, 0x35, 0xdc, 0xf4, 0x7c, 0xdf, 0xf5, 0xc7, 0x07, 0xe9, 0xb7, 0x65, 0xf5, 0x3f, 0xbc, 0x3d, - 0xbe, 0x8f, 0xfe, 0xde, 0x6f, 0x0d, 0x35, 0xdd, 0x4b, 0x6e, 0x73, 0x7c, 0x3f, 0xfd, 0x3c, 0x6c, - 0xed, 0x6f, 0xb4, 0x1a, 0x9d, 0x86, 0xd3, 0xb4, 0xfd, 0x8b, 0x8d, 0x66, 0x73, 0x7c, 0x8c, 0x8a, - 0x0f, 0x59, 0xfb, 0x9a, 0xae, 0x73, 0xc9, 0x6d, 0xdb, 0x34, 0xdc, 0xf8, 0x01, 0x2a, 0x3d, 0x66, - 0x1d, 0xf1, 0xdd, 0x9a, 0xd7, 0xaa, 0x3b, 0xed, 0x1d, 0xdb, 0xa8, 0x4f, 0x52, 0xfd, 0x4d, 0xd6, - 0x75, 0x4d, 0xef, 0xb2, 0xbd, 0xdd, 0x6e, 0x78, 0xed, 0x46, 0x67, 0xc7, 0x86, 0x9a, 0x46, 0xd3, - 0xae, 0x3b, 0x1d, 0x77, 0x3c, 0x41, 0x00, 0xb7, 0x59, 0x37, 0x6c, 0xb7, 0x61, 0x74, 0x58, 0x40, - 0xc7, 0x7d, 0xb8, 0x63, 0xd7, 0x36, 0x9d, 0x8e, 0x0e, 0x75, 0x88, 0xa0, 0x6e, 0xb6, 0xc6, 0x25, - 0xd4, 0x25, 0xaf, 0x51, 0x73, 0x75, 0x88, 0xc3, 0x12, 0xa2, 0xe9, 0xf8, 0x1d, 0xdb, 0xb9, 0xe0, - 0xb4, 0xea, 0x5e, 0xcb, 0xad, 0xdb, 0x1b, 0x80, 0x2c, 0x0e, 0x71, 0x84, 0x20, 0xa6, 0xac, 0x49, - 0x82, 0x08, 0xe6, 0x1b, 0x07, 0x3b, 0x4f, 0xb0, 0x37, 0x58, 0x87, 0xc4, 0x62, 0xb6, 0xdd, 0x96, - 0xd3, 0x84, 0x89, 0xf3, 0x45, 0x5d, 0x47, 0xb5, 0x37, 0x5a, 0x87, 0x61, 0x3b, 0xb7, 0x9b, 0x6e, - 0x47, 0x36, 0xf5, 0x3b, 0x6d, 0xd7, 0xb9, 0x38, 0x3e, 0x4e, 0xd5, 0xcc, 0x1a, 0x81, 0xed, 0xad, - 0x6d, 0x36, 0x5a, 0x1b, 0xe3, 0x37, 0x50, 0x09, 0xa0, 0x1b, 0xba, 0xab, 0xbb, 0x6d, 0x7f, 0xb3, - 0xb1, 0x3d, 0x7e, 0xa3, 0x84, 0x5a, 0x6f, 0xc3, 0x1e, 0xd6, 0x9b, 0x3b, 0xe3, 0xc7, 0xa8, 0xe4, - 0xa0, 0xb5, 0x77, 0xdd, 0x6b, 0x6f, 0x34, 0x2e, 0x61, 0xc3, 0x9b, 0xa8, 0xe8, 0x56, 0xeb, 0x7a, - 0xb9, 0xbd, 0xf5, 0x86, 0xef, 0x5c, 0x68, 0xc2, 0x80, 0xda, 0xd2, 0x6f, 0x97, 0x7b, 0x10, 0x01, - 0xe2, 0xd3, 0xbd, 0x83, 0xea, 0xc7, 0x2d, 0xe6, 0x6f, 0x7a, 0x97, 0x6b, 0x8e, 0xef, 0xda, 0x9b, - 0x6e, 0xdb, 0x43, 0x4a, 0xb9, 0x93, 0x6a, 0x6e, 0xb1, 0x8e, 0x6e, 0x39, 0x9d, 0xda, 0x66, 0x6c, - 0xe7, 0x77, 0x49, 0x4c, 0x84, 0x40, 0x78, 0xd7, 0x53, 0x54, 0xbb, 0x68, 0x1d, 0xda, 0x76, 0xda, - 0x9d, 0x16, 0x20, 0x4a, 0x4e, 0xa1, 0xb3, 0xb3, 0xed, 0x8e, 0xdf, 0x03, 0xb5, 0x63, 0x27, 0xaf, - 0x9d, 0x2e, 0xf1, 0x4a, 0x41, 0xb3, 0x55, 0xa8, 0x4a, 0xee, 0x2b, 0xa5, 0xca, 0xd5, 0x42, 0xb6, - 0x6c, 0x17, 0x8a, 0x85, 0x2c, 0xa2, 0x32, 0xdc, 0x81, 0xdf, 0xc1, 0xd1, 0xef, 0xa5, 0xfe, 0x9f, - 0x60, 0xdd, 0xe8, 0x6f, 0x76, 0x3b, 0x75, 0xef, 0x72, 0xab, 0xe9, 0x5c, 0xee, 0xb8, 0xed, 0xad, - 0x46, 0x0b, 0x6a, 0x3b, 0x0d, 0xe0, 0x91, 0x8e, 0xb3, 0xb5, 0x3d, 0x7e, 0x9f, 0x24, 0x22, 0x83, - 0xca, 0x70, 0x4f, 0x7c, 0xbb, 0xed, 0x6e, 0x39, 0x40, 0xc9, 0x80, 0xcc, 0xe3, 0x12, 0x0f, 0xb8, - 0x6d, 0xd0, 0xba, 0xd3, 0xb8, 0xe4, 0xda, 0x6d, 0xa7, 0x75, 0x71, 0xfc, 0x84, 0x44, 0x73, 0xcd, - 0x69, 0x36, 0x2e, 0xb4, 0x9d, 0x4e, 0xc3, 0x6b, 0x45, 0x9a, 0xdf, 0x2f, 0x77, 0xdd, 0xf7, 0x9a, - 0x9e, 0x1d, 0xe9, 0xe3, 0x01, 0xaa, 0xbe, 0xd3, 0xba, 0x99, 0x57, 0xef, 0xd2, 0xd1, 0x29, 0x89, - 0x52, 0xbd, 0x8f, 0x13, 0x97, 0x4e, 0xf0, 0x7e, 0x16, 0xa9, 0xf6, 0x7e, 0xeb, 0xee, 0x70, 0xed, - 0x6e, 0x5d, 0xfe, 0x3c, 0x35, 0x3a, 0x6a, 0x1d, 0x6c, 0xbb, 0xb5, 0x76, 0xb7, 0xd1, 0xd9, 0x42, - 0x1e, 0xe1, 0xec, 0x3c, 0x23, 0xa7, 0xbd, 0xe9, 0xf8, 0x76, 0xcb, 0xbd, 0x6c, 0xb7, 0xbc, 0x4e, - 0x63, 0xbd, 0x51, 0xa3, 0x8e, 0xfc, 0xf1, 0x59, 0xa8, 0x1e, 0x49, 0x5c, 0x67, 0x1d, 0x68, 0xf8, - 0xc8, 0xb9, 0x1b, 0x5d, 0xd7, 0x76, 0xea, 0x80, 0xdf, 0xf1, 0x39, 0xaa, 0xb8, 0xde, 0xba, 0x16, - 0x28, 0xa6, 0x0b, 0x52, 0x80, 0x0f, 0xb9, 0xdd, 0x74, 0x76, 0xdc, 0xfa, 0xf8, 0x7f, 0x51, 0xfb, - 0x12, 0xc6, 0x85, 0x01, 0xf6, 0x73, 0x04, 0x76, 0xbb, 0x75, 0x0c, 0x77, 0x77, 0xa7, 0x37, 0xdc, - 0x82, 0x94, 0x12, 0x62, 0x2c, 0x5c, 0xae, 0x01, 0x90, 0x92, 0xe3, 0xe9, 0x5d, 0xa0, 0xf4, 0x34, - 0xc1, 0x96, 0x08, 0x6c, 0xd2, 0x9a, 0xa8, 0x75, 0xdb, 0x40, 0x4a, 0xcd, 0x26, 0xa7, 0x74, 0x90, - 0x26, 0xcd, 0xa6, 0xdb, 0xda, 0x70, 0x91, 0xe6, 0xd3, 0x92, 0x0a, 0xb0, 0x8d, 0x8d, 0x34, 0x64, - 0x6f, 0x7b, 0x8d, 0x56, 0xc7, 0x1f, 0xcf, 0x48, 0xc1, 0x27, 0x69, 0x70, 0xbd, 0xe9, 0x6c, 0xf8, - 0xe3, 0x59, 0x2a, 0x06, 0x0c, 0x05, 0x0d, 0x38, 0x66, 0x97, 0xa9, 0xe2, 0x6e, 0xeb, 0x56, 0x1a, - 0xbd, 0x6d, 0x5f, 0x70, 0x37, 0x9d, 0x4b, 0x40, 0x7b, 0x20, 0x5b, 0x9e, 0x6c, 0xb7, 0xba, 0x5b, - 0x36, 0x09, 0x9a, 0xb6, 0xbb, 0xed, 0xb5, 0x3b, 0xe3, 0x2b, 0x04, 0x7c, 0x97, 0x75, 0x4b, 0x04, - 0xb8, 0xe6, 0xb5, 0x5d, 0x03, 0xf4, 0x34, 0x82, 0x4e, 0xbe, 0xbb, 0xcf, 0x4a, 0x08, 0x81, 0x8f, - 0xfc, 0xb3, 0xb3, 0xea, 0x6e, 0x5d, 0x70, 0xdb, 0x89, 0x19, 0x6b, 0x9f, 0x64, 0x15, 0xe2, 0xb1, - 0xbe, 0xab, 0xe5, 0x31, 0x90, 0x34, 0x0d, 0x54, 0x40, 0x20, 0x92, 0xc6, 0xfb, 0x69, 0x6f, 0x6f, - 0x44, 0x72, 0xd9, 0x40, 0x72, 0xda, 0x06, 0x1a, 0x82, 0xaa, 0x3a, 0x29, 0x86, 0x01, 0x50, 0x1e, - 0xfd, 0xac, 0x2f, 0x5c, 0x4d, 0xdc, 0x36, 0x3e, 0xa4, 0xaa, 0x01, 0xcb, 0x7a, 0xf5, 0xba, 0xd3, - 0x40, 0xb1, 0x70, 0x01, 0x68, 0xcf, 0xf1, 0x2f, 0x8e, 0x0f, 0xd3, 0x1a, 0xbe, 0xba, 0xc7, 0xda, - 0xa7, 0xaf, 0x21, 0x71, 0xc4, 0x1a, 0xe1, 0xa4, 0x20, 0xd4, 0xd4, 0xa0, 0x50, 0x53, 0x20, 0xf4, - 0xb8, 0x68, 0xc4, 0x0a, 0x9c, 0xdd, 0x30, 0x4a, 0xcb, 0x2d, 0x5a, 0x32, 0x14, 0xa1, 0xfe, 0x1a, - 0xe0, 0x65, 0x24, 0x68, 0xb7, 0xc4, 0x54, 0x39, 0x75, 0x0d, 0x71, 0x59, 0x31, 0x2c, 0x30, 0xa1, - 0x0f, 0x38, 0x5d, 0xc1, 0xaa, 0x64, 0xff, 0x5a, 0x0e, 0x05, 0xbf, 0xbb, 0xbe, 0xee, 0xd6, 0x88, - 0x74, 0xa0, 0x45, 0x1b, 0xc5, 0x36, 0x09, 0xb5, 0x2d, 0xe7, 0xa2, 0x5c, 0xe0, 0xf8, 0x1e, 0x29, - 0x49, 0xda, 0xce, 0xe5, 0xde, 0x50, 0x37, 0x13, 0xd4, 0x84, 0x95, 0x70, 0x3a, 0x1d, 0x77, 0x6b, - 0xbb, 0xc3, 0x21, 0x79, 0xdd, 0x2d, 0x54, 0x77, 0xad, 0x35, 0x2a, 0xeb, 0x80, 0x12, 0xc6, 0x27, - 0x65, 0x21, 0x75, 0xb5, 0xd1, 0xf6, 0xba, 0xdb, 0xfe, 0xf8, 0x68, 0xac, 0x6e, 0xd4, 0x14, 0xf9, - 0xb5, 0x04, 0x70, 0x02, 0x10, 0x41, 0xb2, 0x97, 0xf6, 0xfb, 0x30, 0xad, 0xd2, 0x9a, 0x5e, 0xc5, - 0x22, 0xda, 0xe6, 0x83, 0xab, 0xa9, 0x6a, 0xfa, 0xb4, 0x5d, 0x3d, 0x5f, 0xca, 0xda, 0xe9, 0x54, - 0x65, 0x2d, 0x95, 0x4f, 0x2c, 0x59, 0x63, 0x17, 0x3c, 0xd4, 0x03, 0xeb, 0xc0, 0xe8, 0x5d, 0x50, - 0x5c, 0xa4, 0xfc, 0xc6, 0x4e, 0x26, 0xa6, 0x11, 0x33, 0x4b, 0x5e, 0x27, 0xa3, 0x6a, 0x92, 0x47, - 0x96, 0x8a, 0x55, 0x3b, 0x93, 0x5b, 0x5e, 0xce, 0xa5, 0xd7, 0xf2, 0xd5, 0xf3, 0x76, 0x29, 0x55, - 0xa9, 0xe4, 0xce, 0x66, 0x13, 0x07, 0xac, 0x3d, 0xc4, 0x60, 0x30, 0x8f, 0xeb, 0xae, 0xac, 0x26, - 0xc6, 0x7b, 0x80, 0x68, 0xab, 0x39, 0x2a, 0x79, 0x58, 0x47, 0xe7, 0x96, 0xf3, 0x30, 0x8a, 0x3d, - 0x60, 0x4d, 0x90, 0x39, 0xdd, 0x0e, 0xec, 0xea, 0x04, 0x81, 0x1d, 0xb1, 0xc6, 0x08, 0xac, 0x09, - 0x75, 0x5d, 0x34, 0x83, 0xc6, 0xaf, 0x0f, 0xca, 0xb7, 0x01, 0x5b, 0xee, 0xba, 0xdb, 0x76, 0x5b, - 0x35, 0xa9, 0xfd, 0x6e, 0xb3, 0xf6, 0x70, 0x6a, 0xf1, 0x41, 0xb1, 0x0e, 0xdc, 0x39, 0x1a, 0xa2, - 0x03, 0xc1, 0x3c, 0xc0, 0xdb, 0x1e, 0xa8, 0x72, 0x7b, 0xa3, 0xdb, 0x68, 0xd6, 0x71, 0x4e, 0xc7, - 0x24, 0xcb, 0x73, 0xc3, 0x8c, 0x57, 0xf8, 0xa0, 0x76, 0x07, 0xae, 0x42, 0x9f, 0xdc, 0x2a, 0xf5, - 0x35, 0x4c, 0x5d, 0x88, 0x84, 0xdb, 0x54, 0x11, 0xac, 0x8b, 0x17, 0x3d, 0x41, 0x2c, 0xfb, 0x90, - 0xc3, 0x49, 0x0f, 0x5a, 0x22, 0x09, 0x93, 0x19, 0xe3, 0x83, 0x6e, 0x1e, 0x80, 0x7d, 0xd9, 0x33, - 0x9d, 0xcd, 0xe2, 0x6f, 0x54, 0xe2, 0x34, 0x41, 0xb0, 0x00, 0xec, 0x5f, 0x04, 0xa9, 0x04, 0xa3, - 0x3d, 0xb9, 0x0b, 0x4a, 0xce, 0x27, 0x55, 0x3d, 0x02, 0xf2, 0x63, 0x9f, 0x8f, 0xa2, 0xbd, 0xd1, - 0xba, 0xd4, 0x40, 0x64, 0xdd, 0x15, 0xb3, 0xd6, 0x1c, 0xd5, 0x21, 0x28, 0x28, 0x83, 0x4b, 0x0a, - 0x74, 0xaa, 0x37, 0x68, 0x44, 0xe4, 0xdd, 0x4d, 0xdc, 0x7b, 0xdc, 0x1a, 0x22, 0xf6, 0x49, 0x0c, - 0x5b, 0xc0, 0x40, 0xec, 0x1a, 0x58, 0xd7, 0xfe, 0xe5, 0x5c, 0x21, 0x93, 0x2b, 0xac, 0xd8, 0x44, - 0x73, 0x0c, 0xed, 0xcb, 0x91, 0x5c, 0x41, 0xfc, 0xea, 0x9f, 0x7c, 0x7d, 0xbf, 0x29, 0xb3, 0x44, - 0xff, 0xc0, 0xf5, 0x44, 0xf2, 0x31, 0x5c, 0x0f, 0xab, 0x31, 0xb8, 0x1e, 0x58, 0x44, 0x14, 0xb5, - 0x00, 0x4b, 0x64, 0xb6, 0xee, 0x4d, 0x1c, 0x0f, 0x36, 0x77, 0x90, 0x56, 0x71, 0x53, 0xcc, 0x2a, - 0xa6, 0xf5, 0x8d, 0xd6, 0x88, 0x77, 0x88, 0xf0, 0x0f, 0x7a, 0xcc, 0xd8, 0x4b, 0x14, 0x19, 0x5d, - 0x9f, 0x64, 0xc6, 0x08, 0x8a, 0x46, 0x47, 0x8a, 0xc6, 0x3d, 0x54, 0x02, 0x82, 0x86, 0xe3, 0xcd, - 0xde, 0x80, 0x2e, 0x46, 0x68, 0x6a, 0x60, 0x3c, 0x83, 0x0e, 0x69, 0xb4, 0xdc, 0xf1, 0xbd, 0xd8, - 0xe5, 0xc4, 0xa2, 0x35, 0xaa, 0x0f, 0x09, 0x96, 0x36, 0x4d, 0xb9, 0x8f, 0xa6, 0x0c, 0x5d, 0xfa, - 0x72, 0x06, 0x7c, 0x65, 0xba, 0xfc, 0x45, 0xc9, 0x35, 0x32, 0xf9, 0xe2, 0x00, 0x5b, 0x79, 0xef, - 0xc2, 0x85, 0xff, 0x7c, 0x6c, 0x69, 0xa3, 0x4c, 0xd3, 0xdf, 0x62, 0xea, 0xc0, 0x54, 0xb5, 0xae, - 0xdf, 0xf1, 0xb8, 0x36, 0x95, 0x48, 0x1b, 0x0c, 0x61, 0x61, 0x98, 0x86, 0x04, 0x3d, 0xa8, 0xc3, - 0xd6, 0xda, 0x35, 0x42, 0xd9, 0x30, 0x99, 0xc3, 0x5a, 0x45, 0x60, 0x9c, 0x21, 0xf6, 0xf6, 0x4c, - 0xdc, 0x6b, 0x8d, 0xea, 0x43, 0x5e, 0x01, 0x5b, 0x93, 0x7f, 0xde, 0x07, 0xee, 0x0e, 0xce, 0x99, - 0x7b, 0x38, 0xa7, 0x9d, 0x76, 0xfd, 0xb2, 0xd3, 0x76, 0x2b, 0xdb, 0x6e, 0xcd, 0x47, 0xc1, 0xdb, - 0xf4, 0x36, 0xc0, 0x84, 0x69, 0xc2, 0x86, 0x7a, 0x35, 0x70, 0x94, 0x3c, 0x58, 0x6c, 0x9f, 0xb2, - 0xca, 0xb7, 0xbb, 0x76, 0x6d, 0xa7, 0xd6, 0x44, 0xbb, 0xc0, 0x6d, 0x0b, 0x4b, 0x5f, 0x60, 0x0c, - 0xaa, 0x3b, 0xe0, 0x93, 0x41, 0xc3, 0xcd, 0x1d, 0x9f, 0x7a, 0x00, 0x5c, 0x79, 0xed, 0x1d, 0xc2, - 0xdd, 0x30, 0xba, 0x37, 0xb0, 0x49, 0xa7, 0x1e, 0x40, 0x3d, 0x66, 0x7b, 0x5c, 0xc5, 0x8c, 0xe0, - 0x78, 0xdd, 0xed, 0xa6, 0xe7, 0x80, 0x26, 0x70, 0xc1, 0x40, 0x01, 0x09, 0x00, 0x53, 0x12, 0x38, - 0x42, 0xbb, 0x80, 0x84, 0x11, 0xda, 0x55, 0xf6, 0xa6, 0xe7, 0x77, 0x38, 0x51, 0x4d, 0x7e, 0x60, - 0xc0, 0xda, 0x4f, 0x2b, 0xa8, 0x80, 0x07, 0x81, 0x2e, 0x1b, 0xae, 0x92, 0x4b, 0x47, 0x85, 0x60, - 0xdc, 0x52, 0xe7, 0x12, 0x47, 0x16, 0x4d, 0x10, 0xd5, 0xd9, 0x1e, 0x6e, 0x21, 0x70, 0x9d, 0x37, - 0x7a, 0xf2, 0xf0, 0xb4, 0xd1, 0xcb, 0x74, 0x89, 0x6a, 0xc1, 0x40, 0x1c, 0xa3, 0xa6, 0xe0, 0xdc, - 0x75, 0x1c, 0x90, 0x83, 0x72, 0xb3, 0xaf, 0x0f, 0x81, 0xe3, 0x1f, 0x39, 0x01, 0x33, 0x71, 0xde, - 0x1a, 0x56, 0xcd, 0x07, 0x11, 0xe1, 0xc2, 0x7c, 0xd8, 0x4f, 0x7a, 0xc1, 0x5e, 0x49, 0xdb, 0xd5, - 0x6c, 0x6a, 0x35, 0x79, 0x44, 0xff, 0x65, 0xaf, 0x14, 0x8b, 0x19, 0x7b, 0x65, 0xed, 0x7c, 0x45, - 0x6d, 0x5a, 0x3f, 0x6d, 0x1a, 0xfc, 0x42, 0xeb, 0x8a, 0x53, 0xdd, 0xc4, 0xa7, 0xfb, 0xac, 0x7d, - 0xfa, 0x58, 0xb8, 0x36, 0x45, 0x08, 0x62, 0x6d, 0x40, 0xae, 0x38, 0xe8, 0x09, 0x6e, 0xf3, 0x08, - 0x9f, 0x54, 0x14, 0x9e, 0x14, 0x85, 0x5c, 0xa9, 0x67, 0xb9, 0x79, 0x86, 0x9e, 0x97, 0xe7, 0x37, - 0xb8, 0xa5, 0x3a, 0x44, 0xeb, 0xbb, 0x7b, 0x97, 0xf5, 0x09, 0xdc, 0x94, 0x64, 0x13, 0x14, 0x03, - 0x1c, 0x49, 0x9c, 0x7a, 0xf7, 0x9b, 0x08, 0x27, 0x5d, 0x3f, 0x71, 0x87, 0x75, 0x20, 0xdc, 0x6c, - 0xaf, 0xd5, 0xf7, 0x30, 0x61, 0xa6, 0x1f, 0xff, 0xdc, 0xa1, 0xd9, 0xf7, 0x4f, 0xfe, 0x73, 0x9f, - 0x75, 0x20, 0xbd, 0xea, 0x6f, 0xe4, 0xc9, 0x25, 0xe4, 0x92, 0x11, 0x26, 0xdf, 0x44, 0xaa, 0x16, - 0xee, 0x0a, 0x27, 0xc1, 0x05, 0x61, 0xa5, 0xf0, 0xb2, 0x7e, 0xc2, 0xf0, 0x01, 0x81, 0x61, 0x28, - 0xe7, 0x26, 0xc9, 0x51, 0xfe, 0x3b, 0xb5, 0x9a, 0x2d, 0xaf, 0xe5, 0xb3, 0x15, 0xbb, 0x52, 0x4d, - 0x55, 0xb3, 0x76, 0xae, 0x90, 0xab, 0x22, 0x49, 0x09, 0xb7, 0xb3, 0x0e, 0xbe, 0x65, 0x0d, 0x2c, - 0x10, 0x42, 0xd5, 0x08, 0xba, 0x0c, 0xeb, 0x8d, 0x36, 0x18, 0x8a, 0x17, 0x9a, 0x9e, 0x57, 0xb7, - 0x37, 0x9d, 0x6d, 0xd0, 0x15, 0x50, 0x3b, 0x28, 0xcc, 0xb9, 0xc3, 0xa0, 0x76, 0x6b, 0xc0, 0x29, - 0xdc, 0x60, 0x01, 0xdd, 0xe1, 0x83, 0x86, 0xf7, 0x89, 0xd6, 0xc8, 0xc4, 0x07, 0xcb, 0xcc, 0x47, - 0xd5, 0x0c, 0xfc, 0xd0, 0x82, 0x7e, 0x05, 0xa1, 0x3e, 0x7f, 0xd8, 0x62, 0x69, 0x25, 0x1e, 0x04, - 0x7f, 0x32, 0xab, 0x5f, 0x88, 0x9f, 0x61, 0x21, 0x7e, 0x00, 0x97, 0xd2, 0x6d, 0xec, 0x17, 0x2e, - 0x0a, 0x27, 0xa1, 0x81, 0xff, 0x27, 0x24, 0x34, 0x2c, 0x49, 0xc8, 0x6f, 0x7a, 0x1d, 0x61, 0x75, - 0x31, 0xcd, 0x38, 0xdc, 0x27, 0x05, 0xd0, 0x96, 0xdb, 0x71, 0x6c, 0x3d, 0x30, 0x71, 0x00, 0xc5, - 0x1b, 0x94, 0x3d, 0xbc, 0x2d, 0x42, 0x12, 0xb8, 0x30, 0x5e, 0x60, 0x3b, 0x20, 0x23, 0xea, 0x80, - 0x10, 0x1e, 0x95, 0xf8, 0x2f, 0xd6, 0x7e, 0x81, 0x47, 0x21, 0xed, 0x99, 0xb0, 0x10, 0x69, 0xb1, - 0x6a, 0x17, 0xbb, 0xbe, 0xdd, 0x49, 0x32, 0x9a, 0x6f, 0x3e, 0x9b, 0x3a, 0x2b, 0xed, 0x65, 0x10, - 0x8a, 0xa2, 0x35, 0x2a, 0x6e, 0x24, 0xc0, 0x1b, 0xe4, 0xf8, 0xe0, 0x4f, 0x00, 0x02, 0x9b, 0xe3, - 0x07, 0x95, 0x67, 0xd0, 0x6e, 0xfc, 0x92, 0x0b, 0xbb, 0xb5, 0x0e, 0xec, 0x58, 0x77, 0x1f, 0x16, - 0x41, 0x0d, 0xf0, 0x31, 0x94, 0x1d, 0x24, 0x51, 0x77, 0x88, 0x2c, 0x8b, 0x5e, 0x0e, 0xf3, 0xe1, - 0xab, 0x35, 0xe6, 0x61, 0x4c, 0xb7, 0x65, 0xf6, 0x7c, 0x84, 0x7a, 0x9e, 0xb3, 0x2c, 0x52, 0x31, - 0xe4, 0x1c, 0x91, 0xe1, 0x76, 0xd5, 0x5b, 0x03, 0xd3, 0x6d, 0xb9, 0x0f, 0xa3, 0x3d, 0x5f, 0xb3, - 0x2f, 0x80, 0xd9, 0x05, 0x02, 0x4d, 0x98, 0x75, 0x20, 0xff, 0x42, 0x35, 0xb8, 0x85, 0x47, 0x69, - 0x0b, 0x7f, 0xce, 0xb2, 0x00, 0xf1, 0x17, 0xbc, 0x56, 0xd7, 0x27, 0x23, 0x0d, 0x79, 0xf4, 0xae, - 0xe9, 0x30, 0x3d, 0x45, 0x0a, 0x1e, 0x2a, 0x2d, 0x61, 0x13, 0x64, 0x20, 0xf4, 0x7a, 0xd1, 0x45, - 0x03, 0x23, 0x90, 0x82, 0x22, 0x07, 0x91, 0x4b, 0x6b, 0x30, 0x42, 0xdb, 0xd9, 0x72, 0x5a, 0x64, - 0xa2, 0x8d, 0x90, 0x6f, 0xa8, 0x69, 0x17, 0x10, 0xfb, 0xf5, 0x6e, 0xad, 0x43, 0xae, 0x01, 0x19, - 0x6b, 0x13, 0xab, 0xd6, 0x75, 0xbd, 0xc6, 0x00, 0x2a, 0x53, 0xae, 0x12, 0x51, 0x99, 0x9c, 0x30, - 0x67, 0x6c, 0xa4, 0x32, 0xdf, 0xeb, 0xb6, 0x6b, 0xae, 0x7d, 0xd1, 0xe5, 0x8a, 0x60, 0x70, 0xf2, - 0xd3, 0xfd, 0xd6, 0xc1, 0x34, 0xf5, 0x55, 0x05, 0x44, 0x66, 0x80, 0xbe, 0x1a, 0x4d, 0x1f, 0x27, - 0x46, 0x6a, 0xca, 0x54, 0x5d, 0x54, 0xd4, 0x71, 0x36, 0x84, 0xfe, 0xd5, 0x6c, 0x8f, 0x41, 0x29, - 0x74, 0xa8, 0x00, 0x74, 0x96, 0x27, 0x04, 0x3f, 0x10, 0x17, 0x15, 0x5d, 0xc0, 0x68, 0x0c, 0x95, - 0x0f, 0x53, 0x39, 0xec, 0x81, 0x28, 0x6f, 0x21, 0x71, 0x50, 0xcd, 0x1e, 0xaa, 0x01, 0x1b, 0x8d, - 0x6a, 0x64, 0xc8, 0x89, 0xd4, 0x2a, 0x19, 0x2a, 0xdc, 0x98, 0xa5, 0x29, 0xed, 0xa5, 0x09, 0xa0, - 0xe4, 0xa5, 0x32, 0x9c, 0x93, 0x25, 0x67, 0xa9, 0x6c, 0xde, 0x51, 0x19, 0x8c, 0xe2, 0x25, 0x34, - 0xc6, 0x3e, 0xa9, 0xcb, 0x78, 0x59, 0x30, 0xad, 0xfd, 0x54, 0x71, 0xd4, 0x3a, 0x28, 0x2b, 0x82, - 0x79, 0x8d, 0x51, 0x15, 0x20, 0x97, 0xc2, 0x16, 0x07, 0xa4, 0x30, 0xd7, 0xb7, 0x93, 0xd1, 0x76, - 0x72, 0xa5, 0xba, 0xe9, 0x6d, 0x71, 0x97, 0x9d, 0xd8, 0x66, 0x64, 0xf2, 0x31, 0xd4, 0xf0, 0x1c, - 0xc3, 0x20, 0x8c, 0xeb, 0x65, 0x17, 0x79, 0x57, 0x22, 0x1a, 0xf0, 0x03, 0x66, 0xc7, 0x96, 0xc6, - 0x52, 0xfd, 0x92, 0xd7, 0xa0, 0x2b, 0xbf, 0xbb, 0xbd, 0xdd, 0xdc, 0x01, 0xdb, 0x03, 0xe5, 0x2b, - 0x17, 0x8d, 0x18, 0xae, 0xf4, 0x49, 0xac, 0xd7, 0xed, 0x7a, 0xdb, 0xdb, 0x16, 0x32, 0x31, 0x61, - 0x04, 0x46, 0x87, 0x64, 0x10, 0x14, 0x6c, 0x40, 0x30, 0xe4, 0x84, 0x93, 0xda, 0xb6, 0x26, 0xf8, - 0x3c, 0x96, 0xda, 0xa0, 0xe2, 0x6b, 0xe0, 0x88, 0xa7, 0x39, 0x7f, 0xe7, 0x5a, 0xeb, 0x1e, 0xf6, - 0x20, 0xd8, 0x5d, 0x85, 0x56, 0x71, 0x41, 0xd4, 0x67, 0x7b, 0x87, 0x9c, 0x66, 0xa1, 0x0f, 0x61, - 0xed, 0xe0, 0x95, 0xd6, 0xda, 0x8d, 0x6d, 0x14, 0x17, 0x82, 0x18, 0x60, 0x5e, 0xd2, 0x85, 0xe1, - 0xb0, 0x38, 0xaf, 0xbd, 0x93, 0x2f, 0xbc, 0x4e, 0x39, 0xc6, 0x34, 0x34, 0x1a, 0x7d, 0x5c, 0x91, - 0x84, 0x8c, 0xbe, 0xc9, 0xc0, 0x98, 0xeb, 0x27, 0xde, 0x3a, 0x18, 0x61, 0xa5, 0xc4, 0x1d, 0x18, - 0x93, 0x5d, 0xef, 0xd8, 0x12, 0x70, 0x4f, 0x2f, 0x40, 0xc3, 0xcb, 0x1e, 0x15, 0x06, 0x0f, 0x18, - 0x95, 0xed, 0x4b, 0xbc, 0x88, 0x2c, 0xbc, 0x64, 0xdf, 0x71, 0xa5, 0xbb, 0xd1, 0xcf, 0x16, 0x6a, - 0x1a, 0xa5, 0x1c, 0x98, 0x9a, 0xe8, 0xb3, 0x49, 0x8f, 0xc2, 0x22, 0x9f, 0x5c, 0xf9, 0xdf, 0x83, - 0xa6, 0xff, 0x4d, 0x03, 0x6b, 0xfe, 0x37, 0xca, 0x4d, 0xa1, 0x77, 0x86, 0x08, 0x35, 0x0f, 0x58, - 0x16, 0x5f, 0x32, 0x31, 0xe7, 0x3e, 0x6a, 0x7d, 0x9d, 0xd9, 0x9a, 0x93, 0x07, 0x8a, 0xbf, 0x3d, - 0xb9, 0xc2, 0xd9, 0x54, 0x3e, 0x97, 0x41, 0xdc, 0x3b, 0x4d, 0x34, 0xe5, 0x6b, 0x9b, 0xae, 0x03, - 0xca, 0x6d, 0x3f, 0xed, 0x33, 0xd0, 0xcb, 0x7a, 0xa3, 0xd9, 0xb4, 0x2f, 0x37, 0x3a, 0x9b, 0xc0, - 0xdb, 0x50, 0x3e, 0x16, 0xd8, 0xf1, 0x1d, 0x10, 0x90, 0xb4, 0x92, 0x03, 0x54, 0x26, 0x17, 0x47, - 0x1c, 0xc3, 0x68, 0x2a, 0x77, 0x5a, 0xfb, 0x88, 0xb9, 0xea, 0x9c, 0xfc, 0x80, 0x42, 0x11, 0x83, - 0x89, 0xe9, 0xa8, 0x04, 0x00, 0x34, 0x74, 0xba, 0x1d, 0xa0, 0x1f, 0xb0, 0x1c, 0x9b, 0x68, 0x78, - 0xb6, 0x84, 0xb0, 0x47, 0xfe, 0x04, 0x21, 0x82, 0x9d, 0xea, 0xce, 0x3b, 0x88, 0x4e, 0xad, 0x58, - 0x9a, 0xd7, 0x87, 0x84, 0x7e, 0xd8, 0x2f, 0x70, 0xcf, 0x03, 0x29, 0x3c, 0x86, 0x8d, 0xf8, 0x37, - 0x2d, 0x88, 0x23, 0x3f, 0xb3, 0x05, 0x01, 0xe8, 0xc0, 0xf8, 0x93, 0x0f, 0xd6, 0x32, 0x80, 0xa2, - 0x71, 0x7c, 0x9d, 0x64, 0xfa, 0x20, 0x00, 0x21, 0x1c, 0xf2, 0x69, 0xd8, 0x97, 0x2d, 0x7b, 0xbb, - 0x51, 0xbb, 0x48, 0x0a, 0x4e, 0xa9, 0x8b, 0xf4, 0xaa, 0x5d, 0xca, 0xa5, 0xcf, 0x24, 0xc7, 0xe4, - 0xaf, 0x72, 0xaa, 0x90, 0x29, 0xae, 0x1a, 0x56, 0xec, 0x31, 0x12, 0x01, 0xc7, 0x2c, 0xc6, 0xb7, - 0x44, 0x8c, 0x27, 0x03, 0xd7, 0x23, 0xc9, 0xc1, 0x4e, 0xbb, 0xeb, 0x82, 0xb6, 0x0b, 0x47, 0x23, - 0x6e, 0xeb, 0x19, 0x8d, 0xb8, 0x36, 0x14, 0x8d, 0x38, 0x9d, 0x2a, 0x67, 0x40, 0x91, 0xef, 0x23, - 0x74, 0x00, 0xaa, 0x7c, 0xc4, 0xd3, 0x13, 0xa8, 0x39, 0x9b, 0x96, 0x87, 0x21, 0x67, 0x79, 0x79, - 0xf2, 0x10, 0x22, 0xc3, 0x06, 0x0d, 0x5e, 0xc9, 0x15, 0x0b, 0x76, 0x7a, 0xad, 0x5c, 0xce, 0x16, - 0xaa, 0x89, 0x19, 0xeb, 0x10, 0x97, 0x0b, 0x6d, 0x12, 0x31, 0x6a, 0x93, 0x6f, 0xa7, 0x4d, 0x3e, - 0x3a, 0xdd, 0x53, 0x08, 0x91, 0x3d, 0x02, 0x16, 0x13, 0x6a, 0x85, 0x3b, 0x88, 0x4e, 0xee, 0xb3, - 0xae, 0xc5, 0x95, 0xa0, 0xcd, 0xa2, 0x2f, 0xe7, 0x2e, 0x72, 0xe2, 0x63, 0x96, 0x83, 0x5d, 0xf0, - 0xa0, 0x2a, 0x20, 0x6b, 0x4a, 0x9c, 0x50, 0x1c, 0x96, 0x87, 0x09, 0x64, 0xd5, 0xd8, 0x6d, 0xa7, - 0xde, 0x70, 0xc0, 0x9d, 0xb8, 0x5b, 0x6e, 0xfe, 0x8d, 0x56, 0xc2, 0x84, 0xa8, 0x37, 0xda, 0x3c, - 0x96, 0x4e, 0xd5, 0x78, 0x02, 0x83, 0xae, 0x88, 0xa4, 0xa5, 0x7b, 0xa5, 0xe0, 0x05, 0x5a, 0x6a, - 0x80, 0xcb, 0x43, 0xdc, 0x34, 0x2d, 0x9d, 0x5e, 0xd1, 0xbb, 0x2d, 0x2a, 0xe9, 0x2c, 0xe8, 0xbe, - 0xc0, 0x3a, 0x69, 0xbb, 0x46, 0xcd, 0x71, 0x19, 0x63, 0x01, 0xfb, 0x12, 0xa8, 0x15, 0x8c, 0x4b, - 0x14, 0xb1, 0x75, 0x11, 0x1f, 0xa7, 0x91, 0xa1, 0x5c, 0x5a, 0x59, 0x27, 0x05, 0xf4, 0x1e, 0xd8, - 0x7d, 0x3c, 0xb0, 0xa1, 0x08, 0xf9, 0x48, 0x72, 0x68, 0xdd, 0x69, 0xfa, 0x6e, 0x62, 0xd6, 0xda, - 0x4f, 0xa7, 0x5f, 0x9d, 0x4b, 0x80, 0x71, 0x30, 0xb0, 0xc7, 0x9f, 0x48, 0xbb, 0x76, 0x90, 0x33, - 0x75, 0x06, 0xaa, 0xaa, 0x67, 0x33, 0x58, 0x91, 0x1c, 0xd3, 0x4a, 0xec, 0x13, 0xc7, 0x29, 0x42, - 0xaf, 0xe9, 0x7a, 0x62, 0xdd, 0x53, 0x84, 0xff, 0xc0, 0xf9, 0xc4, 0x20, 0x10, 0x31, 0xf0, 0x0c, - 0x55, 0x80, 0x82, 0x12, 0x15, 0xda, 0xb6, 0xcc, 0xd2, 0xfc, 0x46, 0xad, 0x01, 0x90, 0xc0, 0x22, - 0x9c, 0x3d, 0x6f, 0x1d, 0xb9, 0x20, 0xa5, 0xbc, 0xad, 0xe4, 0x3a, 0xc8, 0xf9, 0xf1, 0xa4, 0xf4, - 0x9e, 0x7a, 0xab, 0x82, 0x63, 0xd6, 0x11, 0x6e, 0x7e, 0x2b, 0xbb, 0x90, 0xb4, 0x00, 0xec, 0xc1, - 0xbc, 0x72, 0x2e, 0x38, 0x32, 0x1b, 0x32, 0x42, 0x4e, 0x28, 0x0b, 0xc2, 0x0e, 0x14, 0x10, 0x1f, - 0x01, 0x32, 0x1a, 0x73, 0x1f, 0xee, 0xb4, 0x1d, 0x5b, 0x9e, 0xf1, 0x8d, 0x2f, 0xd0, 0xe8, 0x21, - 0xe9, 0x97, 0xce, 0x22, 0x10, 0x78, 0x1c, 0x89, 0x5b, 0x84, 0xdb, 0x82, 0xf8, 0xa0, 0x03, 0x82, - 0xd1, 0x93, 0x63, 0xa6, 0x1f, 0xd4, 0xd3, 0x37, 0x48, 0xd1, 0x88, 0x0b, 0xd6, 0x7e, 0xce, 0xb4, - 0x5e, 0xb7, 0x03, 0x16, 0x84, 0x4b, 0xb1, 0xeb, 0x31, 0xe8, 0x24, 0x4b, 0x71, 0xc4, 0x22, 0x2f, - 0x4d, 0x5e, 0x77, 0xd1, 0x36, 0x0a, 0xec, 0xb5, 0xd6, 0xc5, 0x96, 0x77, 0xb9, 0x15, 0xe7, 0x3c, - 0xa4, 0xa5, 0xe0, 0x0d, 0x85, 0x0e, 0x32, 0x24, 0x13, 0x7a, 0xc5, 0xbb, 0xb2, 0x66, 0xbc, 0x0b, - 0xc4, 0xa3, 0xdc, 0xd0, 0x46, 0xcb, 0x96, 0x8e, 0xef, 0x8a, 0x14, 0x9d, 0x6a, 0xb3, 0x1f, 0x56, - 0x75, 0x14, 0x1c, 0x8f, 0x44, 0xc1, 0x73, 0x57, 0x6b, 0x38, 0xdf, 0x6e, 0x1d, 0x03, 0x6a, 0x20, - 0x3f, 0x5d, 0x84, 0xb5, 0x3d, 0xdb, 0x14, 0xc2, 0x4f, 0xa2, 0x01, 0x32, 0x96, 0x75, 0xa9, 0xe1, - 0x37, 0x2e, 0x34, 0x9a, 0xb8, 0x6d, 0x67, 0xa8, 0xfb, 0x43, 0xd3, 0x6a, 0x6f, 0xce, 0xaa, 0xba, - 0xe4, 0x44, 0x4c, 0xa1, 0x5d, 0xea, 0x5e, 0x68, 0x36, 0x6a, 0x71, 0xc1, 0x92, 0x3c, 0xa9, 0x5d, - 0x98, 0x86, 0x5e, 0xe1, 0x80, 0x4a, 0x81, 0x5a, 0x17, 0x99, 0xcd, 0x26, 0xa5, 0x38, 0xbe, 0x4a, - 0xe8, 0x05, 0x56, 0x10, 0x87, 0x32, 0x01, 0x65, 0x15, 0x14, 0x93, 0xf2, 0x1a, 0x89, 0xf8, 0xa2, - 0x8a, 0x7f, 0xc4, 0x86, 0x61, 0x4a, 0x18, 0x86, 0x41, 0x3b, 0x1a, 0x8f, 0x50, 0x1b, 0x1e, 0x78, - 0x3d, 0xa2, 0x4b, 0x22, 0x0c, 0xa0, 0xc1, 0x07, 0x61, 0x6b, 0x06, 0x0d, 0x00, 0x41, 0x32, 0x80, - 0x9c, 0x76, 0x03, 0x78, 0xb0, 0x4c, 0x3b, 0x7b, 0xa7, 0x75, 0xb3, 0x3e, 0x00, 0x9a, 0xfd, 0xca, - 0x89, 0x69, 0xbb, 0xe0, 0xc3, 0x83, 0x49, 0x5e, 0xa1, 0xc9, 0x23, 0xae, 0xe5, 0xe4, 0x9b, 0x2e, - 0x39, 0x51, 0x41, 0x00, 0x8e, 0x2c, 0xc1, 0x2a, 0x4d, 0xf9, 0x8c, 0x75, 0x73, 0x6f, 0xb8, 0xda, - 0x26, 0x9e, 0xf4, 0x8e, 0xaf, 0xd1, 0x0e, 0x1c, 0x99, 0xae, 0x48, 0x88, 0x92, 0x00, 0xa0, 0x3d, - 0xde, 0xbb, 0x56, 0xc8, 0x64, 0x97, 0x73, 0x85, 0x6c, 0x26, 0x51, 0xb4, 0x6e, 0x13, 0x9d, 0xb5, - 0xa0, 0x9b, 0xde, 0x1d, 0x9e, 0xbd, 0xda, 0x0e, 0xd1, 0x28, 0x16, 0xba, 0x58, 0x86, 0xf8, 0xcf, - 0xd1, 0xb4, 0x0b, 0xd6, 0xfe, 0x6d, 0x07, 0x96, 0x0f, 0x83, 0x74, 0x48, 0xe7, 0x3d, 0x24, 0xba, - 0x54, 0xe2, 0xac, 0x84, 0xd5, 0x15, 0x5e, 0x9b, 0xbc, 0x29, 0xb6, 0x18, 0x38, 0xac, 0xd9, 0xd8, - 0x02, 0x73, 0xaa, 0x3e, 0x71, 0x97, 0xb5, 0x37, 0xe0, 0x78, 0x4b, 0xf9, 0xdf, 0xe4, 0xb1, 0x00, - 0xd3, 0x75, 0x88, 0x7f, 0xd0, 0xd4, 0xdc, 0x37, 0x59, 0x0f, 0x47, 0x66, 0x47, 0xad, 0x3d, 0xe5, - 0x6c, 0x2a, 0x73, 0x7e, 0xad, 0xc4, 0x06, 0xc1, 0xd2, 0x1a, 0xad, 0x64, 0xcb, 0xa8, 0x06, 0xb3, - 0x55, 0x28, 0xe8, 0x4b, 0xec, 0xb1, 0x06, 0xca, 0x6b, 0x05, 0xd6, 0x8f, 0xd1, 0xda, 0x52, 0xb1, - 0x52, 0x45, 0x35, 0xc9, 0x06, 0xf0, 0x57, 0xa1, 0x58, 0xa5, 0x76, 0x6c, 0x08, 0x46, 0xd9, 0xc7, - 0x5b, 0x61, 0xfc, 0x7f, 0xa5, 0xc0, 0x86, 0x27, 0xbf, 0xd1, 0x67, 0xed, 0x55, 0x16, 0x18, 0x88, - 0x32, 0x69, 0x83, 0xb1, 0x9f, 0xca, 0xff, 0xfa, 0xb0, 0x15, 0x3f, 0x73, 0x10, 0x31, 0xe0, 0x6b, - 0x68, 0x8c, 0x72, 0x2a, 0x5d, 0xcd, 0xa5, 0xb3, 0x30, 0xf4, 0x98, 0x65, 0x55, 0x8b, 0x6b, 0xe5, - 0x02, 0x8c, 0x58, 0xa8, 0x32, 0xf4, 0xb5, 0xc6, 0xd2, 0xc5, 0x62, 0xc9, 0x46, 0x35, 0xcf, 0x5b, - 0xa0, 0x6b, 0x73, 0x30, 0x9f, 0x5d, 0x49, 0xa5, 0xcf, 0x73, 0x8f, 0x94, 0x17, 0x0f, 0x81, 0xf6, - 0xba, 0x4e, 0x14, 0x57, 0x8a, 0xf9, 0xa2, 0xfd, 0xe0, 0x5a, 0x76, 0x2d, 0x2b, 0x2a, 0x87, 0xb1, - 0x4d, 0xba, 0xb8, 0x5a, 0xca, 0x56, 0x73, 0xd5, 0xdc, 0x59, 0x59, 0xbc, 0x07, 0x26, 0xc9, 0xc4, - 0x74, 0x4e, 0x9c, 0x3d, 0x21, 0x4a, 0x47, 0x40, 0x39, 0x1e, 0x38, 0x97, 0xcd, 0x9e, 0xc9, 0x16, - 0x32, 0x36, 0x4d, 0x26, 0x7b, 0x9e, 0xa1, 0xb9, 0x7e, 0x20, 0x5f, 0x4c, 0x03, 0x64, 0x30, 0x15, - 0x6b, 0xf2, 0xef, 0xfb, 0xad, 0x43, 0x14, 0xe3, 0xc1, 0x65, 0x93, 0x88, 0x2a, 0xd1, 0xd9, 0x20, - 0xee, 0x01, 0x4f, 0x3c, 0x50, 0xbb, 0x32, 0x6f, 0x8d, 0x49, 0xb2, 0x17, 0xe7, 0x87, 0xdc, 0x40, - 0xbf, 0x75, 0x3a, 0xae, 0x83, 0x69, 0x21, 0x92, 0xf8, 0xaf, 0x89, 0x2f, 0xf5, 0x59, 0xfb, 0x8d, - 0x92, 0x90, 0xa7, 0xd2, 0x27, 0x6d, 0xca, 0x96, 0xd7, 0xde, 0xc2, 0x68, 0xa5, 0x1c, 0x41, 0xb0, - 0x3e, 0xb0, 0xe8, 0x56, 0x03, 0x2c, 0x3c, 0x51, 0x3e, 0x20, 0x33, 0x38, 0x40, 0x56, 0xab, 0x78, - 0x10, 0xb4, 0x5e, 0x77, 0x2e, 0x21, 0x4d, 0x0b, 0xbf, 0x4b, 0x45, 0xc2, 0x8d, 0x62, 0x11, 0x5c, - 0x19, 0x96, 0x66, 0x04, 0xef, 0xd2, 0xde, 0x74, 0x9b, 0x75, 0x11, 0x97, 0x81, 0x16, 0xe6, 0x78, - 0xbc, 0x72, 0x44, 0x66, 0x5c, 0x98, 0xdd, 0xad, 0x7b, 0x8d, 0xa6, 0xe8, 0x73, 0xaf, 0x38, 0x46, - 0xb8, 0x11, 0x31, 0x42, 0xc6, 0x91, 0x54, 0xab, 0x05, 0xed, 0x0c, 0x9a, 0x47, 0x74, 0x48, 0x11, - 0x72, 0x9f, 0x7a, 0xf2, 0x41, 0xeb, 0xa8, 0x6c, 0x51, 0x4a, 0x2f, 0x81, 0xfb, 0xa4, 0x19, 0x67, - 0x08, 0xbd, 0x0d, 0x8a, 0xc0, 0x6b, 0x39, 0xc2, 0x03, 0x87, 0x02, 0xf4, 0x15, 0xc1, 0x55, 0x14, - 0xf8, 0x01, 0x54, 0x6e, 0xd7, 0x30, 0x4e, 0x11, 0x04, 0xc5, 0x27, 0xdf, 0xd1, 0x07, 0x1b, 0x5b, - 0xc2, 0x4c, 0x9a, 0x1c, 0xc0, 0x9e, 0x76, 0xdb, 0x1e, 0x85, 0x7e, 0x5c, 0x3d, 0xac, 0xd5, 0x27, - 0x57, 0xcb, 0xc3, 0x45, 0x36, 0x3f, 0x2e, 0x34, 0xfc, 0xcf, 0xc3, 0x68, 0xb2, 0x3f, 0xb9, 0x8b, - 0x07, 0x4f, 0x7a, 0xc8, 0x1d, 0x30, 0x4f, 0x01, 0x67, 0xc2, 0x7c, 0x3f, 0x12, 0xcb, 0x65, 0xd7, - 0x69, 0x63, 0x7c, 0x86, 0x1f, 0x98, 0x22, 0x5e, 0xc1, 0xbe, 0x52, 0xbe, 0xe1, 0xb0, 0x6c, 0xe5, - 0x77, 0x76, 0x9a, 0x2e, 0x39, 0x6c, 0xe4, 0x61, 0x69, 0xae, 0x02, 0x39, 0xb1, 0xe4, 0xe3, 0x4f, - 0xbe, 0xa2, 0xcf, 0x3a, 0x12, 0xcc, 0x1d, 0xbd, 0x91, 0x8a, 0x48, 0xe4, 0xf8, 0xdf, 0x67, 0xf6, - 0x93, 0xf3, 0xe0, 0x45, 0x93, 0xe9, 0xc0, 0x83, 0xa9, 0x29, 0xae, 0x08, 0xd7, 0xb6, 0x37, 0xc0, - 0x02, 0xa5, 0x79, 0x3a, 0x42, 0x97, 0xf2, 0x79, 0x62, 0x4c, 0x46, 0x05, 0x86, 0x27, 0x53, 0x48, - 0x22, 0xd8, 0x38, 0x55, 0xaf, 0x53, 0x0c, 0xd6, 0x69, 0xae, 0xb5, 0x1a, 0x9d, 0x5c, 0x0b, 0x19, - 0xc8, 0x6b, 0xef, 0xa0, 0x69, 0xd5, 0x85, 0x02, 0x3d, 0xf0, 0x02, 0xe3, 0xe3, 0xb6, 0x73, 0xb6, - 0xdb, 0x3f, 0xb9, 0x62, 0x1d, 0xe6, 0x5d, 0xd0, 0xde, 0x92, 0x50, 0xe7, 0x26, 0x06, 0x92, 0x87, - 0xcf, 0xfd, 0x9b, 0x3e, 0xe2, 0x8b, 0x7d, 0x22, 0x6e, 0xd9, 0x2f, 0xc3, 0x79, 0x12, 0x83, 0xc4, - 0x45, 0x93, 0xcf, 0xea, 0xb3, 0x6e, 0x53, 0xd4, 0xc7, 0x4f, 0x17, 0x96, 0xc1, 0x82, 0x76, 0xfc, - 0x9d, 0x0a, 0xa8, 0xc9, 0x7a, 0xb7, 0xe9, 0xd6, 0x79, 0xc7, 0x30, 0x01, 0x12, 0x09, 0x62, 0x45, - 0x18, 0xe5, 0x51, 0xca, 0xb6, 0x5f, 0xe6, 0x63, 0xac, 0xf3, 0xa6, 0x32, 0xb5, 0x42, 0x8e, 0x82, - 0x41, 0x08, 0xdf, 0x75, 0xd0, 0x7d, 0x1c, 0x94, 0x3c, 0xad, 0x8e, 0x34, 0xf1, 0x44, 0xd5, 0xe1, - 0xdc, 0x0a, 0x68, 0x3d, 0x24, 0x27, 0x73, 0xda, 0xf1, 0x71, 0xff, 0x1f, 0xec, 0xba, 0x80, 0x90, - 0x38, 0x71, 0x21, 0x18, 0x41, 0x46, 0x68, 0x07, 0x27, 0xef, 0xb6, 0xae, 0x0b, 0x35, 0x2e, 0xbb, - 0xfe, 0xb6, 0xd7, 0xf2, 0xe9, 0x2c, 0x02, 0xf3, 0x41, 0x10, 0x9e, 0xa3, 0x65, 0x32, 0x6d, 0x8d, - 0x87, 0x80, 0x33, 0xee, 0xba, 0xdf, 0x7b, 0x34, 0x24, 0x0a, 0xce, 0x76, 0x14, 0x85, 0xe3, 0xbb, - 0x70, 0xdc, 0xba, 0x3e, 0xa6, 0x13, 0x35, 0x2a, 0xe0, 0x48, 0x8e, 0xea, 0x8b, 0x61, 0xff, 0xab, - 0x75, 0x83, 0x6c, 0x91, 0x06, 0x98, 0xee, 0x96, 0x2b, 0xb0, 0x5d, 0x85, 0x1d, 0x73, 0x3b, 0x57, - 0xb5, 0xd0, 0x5d, 0x10, 0x3d, 0xe9, 0x5a, 0xb7, 0xee, 0xd6, 0xff, 0x32, 0x78, 0x7a, 0xdd, 0xb6, - 0xfb, 0xff, 0x7a, 0x98, 0x65, 0xeb, 0x26, 0x1c, 0x66, 0x25, 0x5d, 0xf5, 0x56, 0xd2, 0x92, 0x5e, - 0xdc, 0x0e, 0x51, 0x64, 0x9e, 0x60, 0x0d, 0xc7, 0xb9, 0x4f, 0x1e, 0xff, 0x04, 0xfd, 0x70, 0x4e, - 0x70, 0x60, 0xcb, 0xb8, 0x0f, 0xb0, 0xea, 0x6c, 0xe7, 0x3d, 0x2e, 0x21, 0xb9, 0xae, 0xef, 0x9d, - 0xe4, 0x77, 0x14, 0x4f, 0x21, 0x38, 0xa8, 0xec, 0x69, 0x28, 0x38, 0x34, 0x54, 0x49, 0x6a, 0x3c, - 0x54, 0x36, 0x79, 0x0e, 0xa4, 0x09, 0x4c, 0xb5, 0x80, 0x11, 0x5d, 0x61, 0x2f, 0xaf, 0x6d, 0xd7, - 0xc5, 0x69, 0x86, 0x10, 0xc4, 0x5a, 0xbc, 0x14, 0x03, 0x1b, 0x40, 0xd7, 0xc1, 0xb1, 0x77, 0x7f, - 0x10, 0xd4, 0x14, 0x89, 0x58, 0xa2, 0xe3, 0x5b, 0x41, 0xf9, 0x42, 0xc7, 0xab, 0xce, 0x45, 0xb7, - 0x08, 0xc2, 0xa7, 0x0d, 0xc0, 0x3a, 0x0e, 0x69, 0xcd, 0x93, 0x47, 0x38, 0x41, 0x97, 0xf9, 0xb9, - 0xb6, 0x84, 0xf3, 0x27, 0xdf, 0xd0, 0xc7, 0x09, 0x21, 0x5c, 0xa1, 0x68, 0x27, 0x65, 0xed, 0xf5, - 0x64, 0x21, 0xf4, 0x85, 0xaa, 0x76, 0x7a, 0x7a, 0xb7, 0x16, 0xd3, 0x05, 0xf7, 0xf2, 0x79, 0x10, - 0x64, 0xbe, 0x9a, 0x8c, 0x81, 0x0c, 0xca, 0x81, 0x99, 0x38, 0x65, 0xb1, 0x38, 0xb0, 0x20, 0xee, - 0xd8, 0x83, 0xb5, 0xa6, 0xac, 0x6b, 0xc5, 0x59, 0x10, 0x6c, 0x5f, 0x0a, 0x13, 0xa6, 0xf2, 0x0d, - 0xbf, 0x43, 0x69, 0x1f, 0x6a, 0x8f, 0xf8, 0x34, 0xf7, 0x4f, 0x9e, 0xb2, 0x6e, 0x41, 0xd8, 0x92, - 0xdb, 0x46, 0x89, 0x7c, 0xce, 0x6b, 0x37, 0xeb, 0x6b, 0x60, 0x7b, 0xe7, 0x3d, 0xef, 0x62, 0x77, - 0x5b, 0xcc, 0x9e, 0x24, 0x9c, 0x2f, 0x0f, 0x72, 0xb9, 0x1a, 0x7c, 0x4f, 0xbf, 0x35, 0xb9, 0x5b, - 0x43, 0x81, 0x98, 0x5f, 0xb0, 0x46, 0xf9, 0x49, 0x0f, 0x0f, 0x30, 0xf2, 0x13, 0xbd, 0xfb, 0xa6, - 0xaf, 0xdc, 0x72, 0x3a, 0x5b, 0xa6, 0x76, 0x69, 0x68, 0x96, 0x3c, 0x5c, 0x59, 0x4b, 0xa7, 0xb3, - 0x95, 0x8a, 0x9d, 0x4a, 0xa7, 0x8b, 0x6b, 0x85, 0xaa, 0xbd, 0x0c, 0xff, 0xcf, 0x84, 0xf8, 0x82, - 0xd3, 0xe8, 0x9b, 0xfa, 0xac, 0x51, 0xad, 0x29, 0x90, 0x5f, 0x7c, 0x63, 0x9e, 0x31, 0x90, 0x2d, - 0x97, 0x8b, 0x65, 0x7b, 0xad, 0x70, 0xa6, 0x50, 0x3c, 0x57, 0x00, 0x8b, 0xf0, 0x66, 0xeb, 0x06, - 0x51, 0x54, 0x41, 0xa7, 0x0c, 0x23, 0x36, 0xe7, 0xca, 0xc5, 0xc2, 0x0a, 0xb4, 0x29, 0x83, 0x19, - 0x06, 0x36, 0xe2, 0x9d, 0xd6, 0x6d, 0x1c, 0xa2, 0x50, 0xb4, 0x4b, 0xd9, 0xf2, 0x72, 0x36, 0x5d, - 0xb5, 0xcf, 0x15, 0xcb, 0xf9, 0x4c, 0xa8, 0xfb, 0x81, 0xc4, 0x1d, 0xd6, 0xad, 0x0a, 0x32, 0x9f, - 0x2b, 0x9c, 0xc9, 0x66, 0xec, 0x0a, 0xd9, 0x90, 0x26, 0xe0, 0xe0, 0xe4, 0x23, 0x7d, 0xa0, 0x9e, - 0xd2, 0x98, 0x3b, 0xd6, 0xaa, 0x83, 0x1d, 0x53, 0x95, 0x82, 0xda, 0xad, 0x67, 0x40, 0xd6, 0x9a, - 0x67, 0x95, 0x7d, 0x32, 0x6c, 0xb0, 0xb1, 0x2d, 0x95, 0x04, 0xfc, 0x78, 0x78, 0x7b, 0x2b, 0x30, - 0xb3, 0x30, 0x21, 0x56, 0xe6, 0x1f, 0x81, 0x24, 0xaf, 0x83, 0xe3, 0xb6, 0xe9, 0x0b, 0xfb, 0x4a, - 0x86, 0xae, 0xb7, 0xbb, 0xed, 0x1a, 0x08, 0x3b, 0x17, 0x93, 0x0c, 0x90, 0x0a, 0xca, 0xc0, 0xd9, - 0xc1, 0x0c, 0xd0, 0x67, 0xc7, 0x59, 0x34, 0x1b, 0x2d, 0x4c, 0xd5, 0x18, 0x24, 0x91, 0xdf, 0x27, - 0x63, 0x10, 0xbd, 0x67, 0x8a, 0xca, 0x0b, 0x33, 0x34, 0x50, 0xdc, 0xee, 0x9d, 0x5c, 0x00, 0x2a, - 0x34, 0xfb, 0x24, 0x2a, 0xbc, 0xc3, 0x1a, 0xa2, 0x5c, 0x15, 0xd1, 0xe1, 0xf8, 0x74, 0x8f, 0x81, - 0x27, 0xf3, 0xc0, 0x8c, 0x81, 0xca, 0xcd, 0x3e, 0xb9, 0xdb, 0xd8, 0xae, 0x34, 0xbd, 0x0e, 0x79, - 0x1c, 0x4d, 0xf4, 0xf7, 0x75, 0x59, 0x48, 0x51, 0x2f, 0x75, 0xfa, 0x67, 0x30, 0x09, 0x97, 0x81, - 0x8b, 0x56, 0x42, 0x8a, 0xda, 0xb2, 0x5b, 0x77, 0xdd, 0x2d, 0x94, 0xff, 0xc8, 0x12, 0x98, 0x8d, - 0x07, 0x8a, 0x2d, 0x08, 0x6e, 0x63, 0x5c, 0x44, 0xe2, 0xc7, 0x56, 0x86, 0xdb, 0xe4, 0xf3, 0x71, - 0x97, 0x22, 0x3d, 0x28, 0x42, 0x5f, 0xb6, 0x46, 0xda, 0xe2, 0x6f, 0x41, 0xe5, 0x77, 0x4c, 0xf7, - 0x06, 0x37, 0xa8, 0x7b, 0xf4, 0xa2, 0x5d, 0xe9, 0xd6, 0x6a, 0x2e, 0x40, 0xd5, 0x27, 0xef, 0x31, - 0xc9, 0x17, 0xdc, 0x25, 0xad, 0x96, 0x7b, 0x30, 0x17, 0xed, 0x65, 0xca, 0x67, 0x63, 0x7d, 0x93, - 0xaf, 0xda, 0xcb, 0xe5, 0x25, 0xd7, 0x20, 0x5b, 0x17, 0x9c, 0x4e, 0xde, 0xdb, 0xc8, 0x62, 0xf0, - 0x3f, 0x91, 0xd4, 0x0e, 0x96, 0xc6, 0x4e, 0x1e, 0x16, 0x71, 0xd3, 0xe2, 0xea, 0x52, 0xaa, 0x9a, - 0x2f, 0xae, 0x50, 0x46, 0x56, 0x25, 0x79, 0x38, 0x54, 0x9a, 0x49, 0xad, 0xa6, 0x56, 0xb2, 0x74, - 0xec, 0xed, 0xb4, 0x41, 0xd2, 0xda, 0xea, 0x48, 0x9d, 0x47, 0x8b, 0x79, 0xa1, 0x38, 0x90, 0x52, - 0x56, 0x1a, 0xcf, 0x4b, 0xec, 0x74, 0x1c, 0x50, 0x5a, 0x42, 0x48, 0x0c, 0xca, 0x26, 0x75, 0x67, - 0x0b, 0x8f, 0x17, 0xf4, 0x26, 0x01, 0x29, 0xb6, 0xd6, 0x9b, 0x8d, 0x1a, 0xd8, 0x50, 0xb6, 0x3a, - 0x76, 0xa5, 0xd4, 0x53, 0x30, 0x89, 0x54, 0x6f, 0x40, 0xcc, 0x5d, 0x8a, 0xab, 0xee, 0x91, 0x31, - 0x07, 0xbd, 0x96, 0xce, 0xf8, 0x47, 0x64, 0x1e, 0x04, 0x1e, 0xb2, 0xf0, 0x19, 0xaa, 0x56, 0x7b, - 0x65, 0x20, 0x28, 0xa8, 0xa3, 0x36, 0x96, 0xd6, 0x86, 0x62, 0x29, 0x4d, 0x57, 0x05, 0x3b, 0x47, - 0xb5, 0xac, 0x53, 0x59, 0x47, 0x61, 0xce, 0x7d, 0x54, 0x01, 0x2c, 0x76, 0xc9, 0x69, 0x76, 0x5d, - 0x71, 0xe4, 0x0b, 0x2c, 0xb6, 0xe9, 0x3a, 0xcd, 0xce, 0x26, 0x45, 0xf5, 0x87, 0x4c, 0x53, 0xeb, - 0x00, 0x19, 0xad, 0x68, 0xda, 0x76, 0xba, 0x2d, 0xbb, 0xde, 0xe5, 0x19, 0xb2, 0x14, 0xd8, 0xe7, - 0xc5, 0x18, 0x80, 0x53, 0xc5, 0x07, 0xa9, 0x58, 0x20, 0x40, 0x04, 0x6b, 0x3a, 0xde, 0xc6, 0x06, - 0x8c, 0x2f, 0x42, 0xf9, 0x74, 0x90, 0x1e, 0x53, 0xbb, 0xbe, 0x4e, 0x21, 0x7d, 0xf2, 0xab, 0x64, - 0x1d, 0x77, 0x73, 0x0e, 0xa9, 0xec, 0x6e, 0xa9, 0x84, 0x1f, 0xa6, 0x50, 0x7e, 0xbf, 0x51, 0xc6, - 0x73, 0xf0, 0xfa, 0x71, 0xe3, 0x37, 0xbc, 0x26, 0x46, 0xa3, 0xc9, 0xfc, 0xbb, 0x4e, 0x57, 0xb2, - 0xb4, 0x22, 0x40, 0xd2, 0x65, 0x3a, 0x78, 0xed, 0x47, 0x83, 0x63, 0xcb, 0xab, 0x83, 0xa7, 0x84, - 0xb9, 0x00, 0x72, 0x09, 0x47, 0xa9, 0x0a, 0x70, 0xf0, 0xf0, 0xb6, 0xec, 0x64, 0x42, 0xb2, 0x24, - 0xa5, 0x91, 0x6e, 0x36, 0x3a, 0x32, 0x5d, 0x4e, 0x27, 0x1a, 0x32, 0x7a, 0x6f, 0x50, 0x39, 0x17, - 0x7c, 0xa7, 0xa8, 0xf0, 0x46, 0x19, 0x10, 0xf6, 0x2e, 0xf8, 0x36, 0x3a, 0x59, 0x94, 0x50, 0x5b, - 0x73, 0x65, 0x7e, 0x1c, 0xec, 0x2d, 0x08, 0x83, 0x06, 0x86, 0xcc, 0xc8, 0xb8, 0x3f, 0x2e, 0xf2, - 0xd2, 0xc3, 0xe5, 0x27, 0x44, 0x62, 0x64, 0xb8, 0xfc, 0xa4, 0x48, 0x8a, 0x0c, 0x97, 0xdf, 0x1f, - 0xe4, 0x45, 0xfa, 0x38, 0x49, 0x91, 0x54, 0x7e, 0xab, 0x3c, 0x70, 0xda, 0x6c, 0xd4, 0xeb, 0x6e, - 0xcb, 0x96, 0x28, 0xa0, 0x63, 0x83, 0x10, 0x15, 0x5e, 0xc0, 0x63, 0x49, 0xb4, 0x4a, 0x9e, 0x40, - 0x75, 0x80, 0xb0, 0x96, 0xdb, 0xed, 0xb4, 0xc1, 0x65, 0xae, 0x21, 0x2a, 0x89, 0x3d, 0x6f, 0x97, - 0xd8, 0x69, 0x77, 0x5b, 0x2e, 0x2f, 0xba, 0x23, 0x76, 0x3e, 0x98, 0x65, 0x37, 0xc0, 0xa3, 0xb6, - 0x78, 0x60, 0xe9, 0xe2, 0xdd, 0x07, 0xe7, 0x12, 0xcf, 0x81, 0xa7, 0x54, 0x68, 0x28, 0x05, 0xa9, - 0xd1, 0x00, 0x33, 0xce, 0x95, 0xf4, 0x41, 0x61, 0x7d, 0xaa, 0x34, 0x38, 0x46, 0x90, 0xc6, 0xdd, - 0xd2, 0x0f, 0xd0, 0x18, 0x43, 0x54, 0xdd, 0xa3, 0x6b, 0x96, 0x7b, 0x75, 0x9d, 0x33, 0x2d, 0x27, - 0xc7, 0x23, 0x0e, 0x92, 0x82, 0x44, 0xdc, 0x1e, 0x8f, 0x8e, 0x05, 0x07, 0x62, 0x08, 0xaf, 0xb9, - 0x4e, 0x51, 0xfb, 0x91, 0xc9, 0xef, 0x0c, 0x73, 0x93, 0x44, 0xf8, 0x2d, 0xeb, 0x20, 0xbe, 0xd2, - 0xe8, 0x2f, 0xc7, 0x59, 0xb6, 0x40, 0xff, 0x17, 0x60, 0xae, 0x78, 0x0c, 0xd4, 0xaa, 0x47, 0x0e, - 0x59, 0xef, 0x04, 0xcf, 0xae, 0xe9, 0x75, 0x64, 0x02, 0xd2, 0xd1, 0xe9, 0x98, 0x6e, 0xa7, 0x49, - 0x4f, 0x00, 0xa2, 0x2e, 0x38, 0xf5, 0x0d, 0x95, 0x41, 0x3d, 0x28, 0x83, 0xde, 0x7c, 0xe6, 0xa2, - 0x74, 0x48, 0x46, 0xb1, 0x54, 0x04, 0x85, 0xc4, 0xd0, 0xc4, 0xef, 0x0f, 0x5a, 0x83, 0xd4, 0x8d, - 0xa6, 0x5c, 0xf8, 0xfc, 0x8e, 0x5b, 0xc3, 0x1d, 0xf0, 0x7f, 0x37, 0x79, 0xea, 0xcd, 0xe8, 0xc9, - 0x9b, 0x7b, 0x4e, 0x61, 0xba, 0x4a, 0x70, 0x89, 0x7b, 0xac, 0x41, 0xf4, 0x7b, 0x49, 0x56, 0x8e, - 0x9e, 0x3c, 0xd6, 0x1b, 0x1e, 0x6d, 0x69, 0x84, 0x26, 0xcf, 0x67, 0xf0, 0x4a, 0xd0, 0xa4, 0xc1, - 0xee, 0x11, 0x89, 0x4e, 0x43, 0x57, 0x82, 0x46, 0xd7, 0x33, 0xf1, 0x00, 0xac, 0x73, 0xcb, 0xeb, - 0x34, 0x6a, 0xc2, 0x53, 0x1e, 0x3d, 0x39, 0xd9, 0xbb, 0x45, 0x56, 0x40, 0x4e, 0x9c, 0xb0, 0x86, - 0xc5, 0x4a, 0x50, 0xb8, 0xd1, 0x5f, 0xc6, 0x79, 0xb3, 0x28, 0xe2, 0x39, 0x52, 0xb4, 0x4d, 0x13, - 0xbf, 0x00, 0xd8, 0xc3, 0xc5, 0x2c, 0x02, 0xf6, 0xe0, 0x5f, 0x09, 0x3e, 0x76, 0xf2, 0x86, 0xd8, - 0xf1, 0xb2, 0x08, 0x9c, 0xcb, 0x24, 0xd9, 0x45, 0x9b, 0x0e, 0x10, 0xed, 0x8a, 0xd7, 0xf4, 0xca, - 0x4e, 0xeb, 0x22, 0xe5, 0x3f, 0x60, 0x81, 0xde, 0xf9, 0x71, 0x6b, 0x90, 0xd6, 0x0e, 0x5c, 0x88, - 0x61, 0x62, 0xa7, 0xd9, 0xf8, 0x25, 0xb7, 0x1e, 0xb8, 0x8b, 0xfb, 0x22, 0x16, 0xf1, 0xc4, 0xa2, - 0x35, 0x48, 0xeb, 0x8f, 0x84, 0x24, 0xd0, 0xe9, 0xc3, 0x02, 0x3a, 0x61, 0x52, 0x89, 0x60, 0x9c, - 0x13, 0xf8, 0x65, 0x24, 0x52, 0x70, 0x13, 0x37, 0x59, 0x23, 0x12, 0x1d, 0x08, 0x20, 0x91, 0xa8, - 0x3a, 0x9a, 0xfc, 0xf5, 0x3e, 0x6b, 0x8f, 0x58, 0x05, 0x06, 0xfa, 0xc2, 0xeb, 0x00, 0xdb, 0xf2, - 0xb0, 0x75, 0x50, 0x96, 0x52, 0x6a, 0x26, 0x15, 0x63, 0x44, 0x63, 0x9f, 0x2c, 0x3e, 0x07, 0x93, - 0x00, 0xc3, 0x51, 0x6b, 0x0e, 0x3a, 0x7d, 0x0b, 0x4c, 0x23, 0x9f, 0x61, 0xfe, 0xc3, 0xb5, 0xb2, - 0x14, 0xcd, 0x24, 0x9f, 0x42, 0x19, 0x75, 0x36, 0x04, 0x22, 0xe7, 0x88, 0xac, 0x58, 0xc6, 0x43, - 0x16, 0x72, 0xeb, 0xc0, 0x1e, 0x73, 0xd9, 0xf0, 0xe4, 0xe3, 0x7d, 0xdc, 0xc3, 0x44, 0xd7, 0x8f, - 0x27, 0x2b, 0x82, 0x43, 0xb1, 0xd4, 0xf4, 0x3c, 0xb4, 0xdd, 0x40, 0x32, 0x71, 0xdf, 0xaa, 0x8e, - 0x68, 0x40, 0xad, 0x42, 0x87, 0x22, 0x22, 0x12, 0x01, 0x6c, 0xd8, 0xc2, 0xdb, 0x4e, 0x20, 0xaf, - 0x5a, 0x3c, 0xf7, 0x4c, 0xcf, 0x96, 0x43, 0xe6, 0xc2, 0x2c, 0x15, 0xdb, 0xd9, 0x22, 0xb1, 0x38, - 0xa0, 0xae, 0xf1, 0x74, 0x9c, 0x56, 0xfd, 0xc2, 0x4e, 0xa0, 0x11, 0x06, 0xa5, 0xc0, 0x0c, 0x77, - 0xc4, 0x63, 0x08, 0x3f, 0xec, 0x07, 0x0b, 0x46, 0xe4, 0xcb, 0x92, 0x9c, 0x4b, 0xcb, 0xfb, 0x10, - 0xbb, 0xf8, 0x94, 0x47, 0x34, 0x76, 0xed, 0xd7, 0xca, 0x0f, 0x07, 0xbc, 0x3a, 0x60, 0x80, 0x8f, - 0x05, 0xb7, 0x2c, 0x48, 0xc4, 0x0e, 0xaa, 0x28, 0x01, 0x4a, 0x02, 0xa7, 0xed, 0x6c, 0xd9, 0xc7, - 0x85, 0x28, 0x30, 0x0a, 0x4f, 0x08, 0xa3, 0x04, 0x93, 0x2a, 0xc4, 0x09, 0x88, 0x96, 0x89, 0x6f, - 0xb8, 0x6c, 0x23, 0xc1, 0x51, 0xa7, 0x88, 0x62, 0xc1, 0x2c, 0xf6, 0x4a, 0xa9, 0xa8, 0x8d, 0x8f, - 0xca, 0xc2, 0x92, 0xc6, 0x3a, 0x4f, 0x69, 0x1e, 0x95, 0x42, 0x48, 0xa4, 0xe5, 0xfb, 0xe2, 0xda, - 0x1b, 0x36, 0x14, 0x03, 0xd8, 0x14, 0x89, 0xe7, 0x36, 0x07, 0x38, 0xf4, 0xc3, 0xd9, 0x65, 0x6c, - 0x99, 0x98, 0xb4, 0x8e, 0xb9, 0xf8, 0x97, 0xcd, 0xd3, 0x0c, 0x3b, 0x65, 0xa0, 0xdc, 0x66, 0x73, - 0xad, 0xa5, 0xe6, 0x05, 0x84, 0x37, 0x6e, 0x1d, 0xe2, 0x30, 0x0f, 0xa2, 0x33, 0xa7, 0xf0, 0xcb, - 0xfa, 0xc1, 0xc4, 0x26, 0xea, 0xe0, 0x94, 0x81, 0xc1, 0x01, 0xde, 0x3c, 0xbc, 0x11, 0xd1, 0xf8, - 0x72, 0x68, 0x99, 0xdc, 0xc4, 0xfe, 0x86, 0x22, 0xb6, 0xd8, 0x6e, 0x94, 0xa9, 0xbc, 0x6a, 0x0d, - 0x73, 0x9f, 0x50, 0x88, 0x84, 0x7b, 0xa6, 0xaf, 0xa2, 0x95, 0xb4, 0x98, 0x93, 0x07, 0x5c, 0xfe, - 0x07, 0xb7, 0x8a, 0x7d, 0x7f, 0xf2, 0x97, 0x80, 0xf1, 0x78, 0x11, 0x86, 0xcd, 0x43, 0xb5, 0x60, - 0x31, 0x6b, 0x85, 0x19, 0x10, 0x54, 0xdb, 0x84, 0x13, 0xe0, 0x31, 0x59, 0x58, 0xf0, 0x3a, 0xcb, - 0xa8, 0x6a, 0x80, 0x17, 0x8f, 0x58, 0x09, 0x59, 0x9a, 0x56, 0xc8, 0x04, 0x8e, 0x04, 0xde, 0x53, - 0xfd, 0xd2, 0x79, 0x5c, 0xb6, 0xdd, 0xf6, 0xda, 0xe0, 0xba, 0xad, 0xf2, 0xb8, 0x14, 0xb2, 0xd7, - 0x76, 0x9a, 0x0e, 0x9e, 0x88, 0x37, 0xc9, 0xd1, 0xc1, 0x74, 0x29, 0x6f, 0xdb, 0xd6, 0xce, 0xa3, - 0xb8, 0xcf, 0x33, 0xa8, 0x4e, 0x6d, 0xbc, 0x75, 0xbb, 0xb3, 0x89, 0x11, 0xb5, 0x1d, 0xe1, 0xb8, - 0xbf, 0x6d, 0x22, 0x08, 0x2e, 0x97, 0xd1, 0xa8, 0x04, 0x5a, 0x93, 0x39, 0x15, 0x7e, 0xe2, 0x94, - 0x35, 0x44, 0x31, 0x1a, 0x42, 0xdb, 0xa8, 0xe1, 0x5f, 0x84, 0x40, 0xf9, 0x05, 0x0c, 0x99, 0x2a, - 0xf0, 0x44, 0x6b, 0x08, 0x2d, 0x29, 0x79, 0x06, 0x70, 0xfb, 0x2e, 0xed, 0xf4, 0x6c, 0x92, 0x9f, - 0xb3, 0xf6, 0x4a, 0x03, 0x46, 0x6a, 0xdb, 0xa9, 0x5d, 0x9a, 0x2e, 0x09, 0x58, 0xd9, 0x7c, 0xd6, - 0xb2, 0x36, 0xda, 0xce, 0xf6, 0x26, 0x0f, 0x18, 0x72, 0x65, 0x76, 0xdb, 0x2e, 0xed, 0x57, 0x10, - 0x98, 0xdc, 0x48, 0xca, 0x55, 0x6a, 0x76, 0x1c, 0x7b, 0xbd, 0x2d, 0xdd, 0x85, 0x91, 0x89, 0xbf, - 0x06, 0xbf, 0x5e, 0x9f, 0x9d, 0xc8, 0xcc, 0xc5, 0x0b, 0x2c, 0x17, 0x80, 0xa1, 0x94, 0x23, 0xa8, - 0x67, 0x6a, 0xef, 0x37, 0x73, 0xe2, 0x06, 0x64, 0x02, 0x5a, 0x90, 0xf0, 0x36, 0x48, 0x07, 0x9e, - 0x18, 0x2d, 0x26, 0xf5, 0xc2, 0x25, 0xc0, 0x5c, 0x90, 0xe5, 0x3c, 0x4c, 0xcb, 0xbe, 0x73, 0x97, - 0x69, 0x73, 0x72, 0xd5, 0x72, 0xf0, 0xbc, 0x56, 0x53, 0x1c, 0x20, 0x72, 0x8f, 0x05, 0xfc, 0x83, - 0xda, 0xa6, 0x8b, 0x9d, 0x91, 0x84, 0x98, 0x38, 0x67, 0x8d, 0xf2, 0xd0, 0x23, 0x6f, 0xa1, 0x9f, - 0xa5, 0x45, 0x52, 0x98, 0x49, 0xd6, 0x0c, 0x90, 0x5b, 0x81, 0xd9, 0xa8, 0x60, 0x99, 0x07, 0xa9, - 0x63, 0x64, 0x94, 0x72, 0x9b, 0x94, 0xa6, 0x3d, 0xe1, 0x58, 0x63, 0x22, 0xb0, 0x7d, 0xe5, 0xbe, - 0xd5, 0x7d, 0xda, 0x81, 0xe0, 0x10, 0x0f, 0x7a, 0xf7, 0x2e, 0xb7, 0x44, 0x9c, 0x9d, 0xb2, 0xc8, - 0x78, 0x09, 0x9e, 0x70, 0xd3, 0x10, 0xfd, 0x13, 0x69, 0xeb, 0x00, 0xaa, 0xd1, 0xaa, 0x27, 0xcf, - 0x28, 0xe8, 0xec, 0xe9, 0x12, 0xf8, 0x70, 0x20, 0x9c, 0xe4, 0x48, 0x2a, 0x04, 0xa1, 0x62, 0xd8, - 0xdc, 0x8e, 0x95, 0xaa, 0xf4, 0xa8, 0x35, 0x2a, 0xe6, 0x49, 0x6c, 0x22, 0x27, 0x89, 0x79, 0x92, - 0x9f, 0xdb, 0x6b, 0xed, 0x8f, 0x20, 0x34, 0xc8, 0x64, 0x50, 0x27, 0x8e, 0x7c, 0x7b, 0xd4, 0x2e, - 0xcb, 0xb5, 0x0d, 0x28, 0xbc, 0x21, 0xfa, 0x07, 0x03, 0xf7, 0xac, 0xed, 0xa9, 0x04, 0x3b, 0x58, - 0x18, 0x77, 0xd7, 0x84, 0xfd, 0x37, 0xac, 0xd2, 0x74, 0x9d, 0x87, 0x8d, 0x8a, 0x3d, 0xca, 0xd0, - 0xa7, 0xd2, 0xb6, 0xbb, 0xe1, 0xb6, 0x28, 0xa7, 0x6f, 0x44, 0x7a, 0x4f, 0x5b, 0x4e, 0xcb, 0x11, - 0xc0, 0x7b, 0xa5, 0x43, 0x03, 0xbd, 0x68, 0xc5, 0x56, 0x50, 0xdc, 0x72, 0x82, 0x1e, 0x46, 0xa5, - 0xfb, 0x47, 0xa9, 0x8c, 0x78, 0x31, 0xb7, 0xb5, 0x01, 0xfe, 0xe3, 0x3e, 0xa5, 0x59, 0xb1, 0xd8, - 0xd9, 0xe0, 0x26, 0xfc, 0x7e, 0x69, 0xa5, 0x53, 0x29, 0x74, 0xeb, 0x36, 0x9b, 0x8d, 0x0d, 0xba, - 0x5d, 0x34, 0x26, 0x7d, 0x3b, 0xde, 0xa0, 0xbd, 0xe5, 0xb5, 0xc9, 0xe3, 0x1c, 0x42, 0xc5, 0x41, - 0x65, 0x5b, 0xde, 0x25, 0x90, 0x9f, 0x2e, 0xa8, 0x27, 0x26, 0xe5, 0x36, 0x95, 0x73, 0xaf, 0x5c, - 0xe4, 0x08, 0xd3, 0x05, 0x07, 0x31, 0x87, 0x84, 0xda, 0x33, 0x31, 0xfc, 0xb5, 0x72, 0x52, 0xc6, - 0xc8, 0x87, 0xe4, 0x4e, 0xf3, 0x41, 0x0f, 0x4b, 0xcf, 0x37, 0x18, 0xef, 0x88, 0x8a, 0x3f, 0xf1, - 0xa1, 0xae, 0x33, 0x6c, 0x2b, 0x51, 0x38, 0xae, 0x2c, 0x48, 0xef, 0x32, 0x7a, 0x91, 0xbc, 0xf4, - 0xa8, 0x48, 0x90, 0xde, 0xcb, 0xbd, 0x98, 0x06, 0xdd, 0xbb, 0x12, 0xa9, 0xbb, 0x3d, 0xf9, 0x30, - 0x44, 0xfa, 0x8a, 0xc0, 0xaf, 0x97, 0x38, 0x42, 0x9a, 0x14, 0x3e, 0x9c, 0xf2, 0x33, 0x29, 0x36, - 0x26, 0x0a, 0x6f, 0x54, 0x3e, 0x29, 0xa7, 0x56, 0x51, 0x7c, 0x4c, 0x4e, 0x11, 0x9c, 0xbd, 0x86, - 0x2b, 0x4b, 0x6f, 0x92, 0x88, 0x6b, 0xca, 0xe6, 0x37, 0x07, 0xd4, 0x05, 0xeb, 0x43, 0x9a, 0x41, - 0xc7, 0xef, 0x16, 0x59, 0x4a, 0x5e, 0x35, 0x5e, 0xf8, 0xc0, 0xdb, 0xab, 0x93, 0x72, 0x4e, 0xe0, - 0x24, 0xcb, 0xb2, 0x5b, 0x65, 0x8f, 0x2d, 0x70, 0x9e, 0x10, 0x5a, 0x5c, 0xd7, 0x02, 0x6a, 0xa6, - 0x5f, 0xfc, 0xa6, 0x16, 0x25, 0xff, 0xdf, 0x1e, 0x24, 0xff, 0xdf, 0x21, 0x99, 0x15, 0x63, 0x4f, - 0xce, 0x65, 0x61, 0x59, 0xdd, 0x49, 0xdb, 0x01, 0x24, 0xa3, 0xfc, 0x41, 0xc5, 0xdd, 0x77, 0xa9, - 0x6d, 0x70, 0x7c, 0xf0, 0x4f, 0x77, 0xd0, 0xd3, 0x12, 0x5e, 0xe2, 0x13, 0xe5, 0x99, 0xd5, 0xdd, - 0x57, 0x54, 0x13, 0xba, 0x00, 0x4b, 0x92, 0x28, 0xf2, 0x37, 0x79, 0xdb, 0x7b, 0x7e, 0xa6, 0xb6, - 0x3f, 0x6f, 0x31, 0x6a, 0xb6, 0x09, 0x6a, 0x19, 0xd0, 0xd5, 0x04, 0xbc, 0x83, 0xb7, 0xf9, 0xb3, - 0xf4, 0x30, 0x6f, 0x8d, 0xd2, 0x3e, 0x0b, 0x86, 0x9b, 0xbe, 0x62, 0x63, 0x5d, 0xf4, 0x2c, 0x5b, - 0x09, 0xda, 0xad, 0x8e, 0xc7, 0x7d, 0x5f, 0x74, 0x34, 0x30, 0x03, 0xed, 0x4a, 0xaa, 0x2e, 0x2c, - 0x03, 0x71, 0xd7, 0x9d, 0xc0, 0xfb, 0xe6, 0x3e, 0x2f, 0xe2, 0x5f, 0x2f, 0xb5, 0x51, 0x06, 0x50, - 0xb2, 0xda, 0xc8, 0xc4, 0xa3, 0x7d, 0xd6, 0x81, 0xb0, 0xbe, 0x8c, 0x39, 0xf9, 0x73, 0x28, 0x78, - 0x30, 0x40, 0x7b, 0x0c, 0xd5, 0x4d, 0xa7, 0x25, 0x2d, 0x57, 0xd2, 0x0d, 0xa0, 0xf6, 0x86, 0xd4, - 0x2f, 0xb4, 0x6a, 0x87, 0x03, 0x1a, 0xd9, 0x13, 0xd0, 0xc8, 0x88, 0x0c, 0xc9, 0xd4, 0xc1, 0xfa, - 0x6b, 0x7b, 0x78, 0x15, 0x99, 0xa2, 0x62, 0x13, 0x05, 0x6b, 0xf4, 0x0c, 0x30, 0x85, 0x26, 0x6a, - 0xc5, 0xb5, 0x16, 0x25, 0x6a, 0x81, 0x44, 0x39, 0x8b, 0x28, 0xcb, 0x7f, 0x08, 0xcd, 0x1a, 0x64, - 0x25, 0xbc, 0xfd, 0xa2, 0xa0, 0xb9, 0x60, 0x3f, 0x6b, 0x25, 0xd4, 0x19, 0xba, 0x21, 0xc1, 0xc3, - 0xdd, 0xd2, 0x51, 0x6f, 0x93, 0x2e, 0x8f, 0xf0, 0x68, 0x9c, 0x4a, 0x1d, 0x50, 0xc5, 0x64, 0x3a, - 0x88, 0x7e, 0xef, 0xb1, 0xc6, 0x4a, 0x8d, 0xda, 0xc5, 0x25, 0xa7, 0xa5, 0xe1, 0x8a, 0xda, 0x05, - 0xc7, 0xb5, 0x0a, 0x73, 0x13, 0x3f, 0x19, 0xb0, 0xf6, 0x19, 0xe6, 0x0f, 0xf7, 0x12, 0xf9, 0x4d, - 0x0b, 0x61, 0x1c, 0xd0, 0xd5, 0x11, 0x3a, 0xda, 0x47, 0x40, 0x75, 0x84, 0x66, 0x84, 0xee, 0x82, - 0x0b, 0x40, 0x0d, 0x6e, 0xaa, 0xa1, 0x99, 0xc6, 0x95, 0x23, 0x8f, 0xc1, 0xb5, 0x1a, 0x1b, 0x9b, - 0x1d, 0x80, 0x6d, 0x52, 0xd0, 0x13, 0x7f, 0x88, 0xcb, 0x2c, 0x46, 0xc0, 0x7e, 0x58, 0xca, 0x63, - 0x1c, 0xbb, 0x51, 0x57, 0x41, 0xc6, 0x11, 0xfd, 0x7e, 0x11, 0x94, 0x53, 0x80, 0x91, 0xab, 0x91, - 0x59, 0x6b, 0x08, 0x4f, 0x84, 0x79, 0x0e, 0xf3, 0xee, 0x52, 0x2f, 0x84, 0x97, 0x19, 0x6b, 0xf0, - 0x02, 0x38, 0x59, 0xa0, 0x60, 0x7e, 0xc6, 0x86, 0x4f, 0x94, 0x3a, 0x7b, 0xdf, 0x15, 0x19, 0x48, - 0x27, 0x99, 0x34, 0xe8, 0xaa, 0x60, 0xc7, 0x31, 0xdf, 0x19, 0x5b, 0xdf, 0xbb, 0x9b, 0x95, 0x18, - 0x4b, 0x20, 0x41, 0x2a, 0xe5, 0x98, 0x0a, 0x16, 0xaa, 0xb3, 0x47, 0x95, 0xbc, 0xef, 0xa3, 0x88, - 0x10, 0xe9, 0x22, 0x8c, 0x30, 0x8d, 0xe1, 0x7b, 0xb2, 0xad, 0x40, 0x8c, 0x3a, 0x17, 0xb9, 0x3a, - 0x9b, 0xf8, 0xfa, 0x80, 0xb5, 0x37, 0x30, 0x26, 0x13, 0xd2, 0x0c, 0x25, 0x29, 0x8a, 0x66, 0xc6, - 0x10, 0x5d, 0x38, 0xa0, 0xb2, 0x87, 0xb7, 0xc9, 0x26, 0x1e, 0x0a, 0xa0, 0xe8, 0x35, 0x91, 0x01, - 0x2a, 0xc3, 0x58, 0x28, 0x95, 0x91, 0x72, 0xa2, 0x1b, 0x6c, 0xa4, 0xe3, 0x78, 0x61, 0x9b, 0x8c, - 0x22, 0x2c, 0x2a, 0x88, 0xeb, 0x12, 0x4d, 0xaf, 0x26, 0x24, 0x08, 0xb7, 0x1a, 0x4f, 0x5d, 0x8d, - 0xb1, 0x4b, 0x16, 0xb7, 0x7e, 0x94, 0xea, 0x4f, 0x1c, 0xb3, 0xf6, 0x1b, 0x05, 0x3c, 0x99, 0x01, - 0xfb, 0xa5, 0xd9, 0x4f, 0xfc, 0x1f, 0xd6, 0xc1, 0x48, 0xa3, 0x44, 0x16, 0x30, 0xa6, 0xc6, 0xe7, - 0x27, 0x2b, 0x27, 0xaf, 0x6a, 0x7c, 0xa3, 0x9b, 0xc9, 0x5f, 0xb0, 0x86, 0x08, 0x02, 0x9d, 0xa6, - 0x74, 0xdb, 0x75, 0xb7, 0x57, 0x00, 0x6b, 0x59, 0xa7, 0xdd, 0xa2, 0xb3, 0x87, 0x84, 0x35, 0x86, - 0xbb, 0xaf, 0x95, 0xf5, 0x61, 0x22, 0x54, 0x06, 0x45, 0x44, 0xaa, 0x55, 0x5f, 0xe2, 0xea, 0x04, - 0xab, 0xf3, 0x9e, 0xdf, 0xe1, 0x29, 0x5d, 0x0f, 0x95, 0x04, 0xe8, 0xc0, 0xe4, 0x39, 0x6b, 0xaf, - 0x2b, 0x87, 0xc3, 0xa4, 0xb0, 0x25, 0xaf, 0x93, 0x07, 0x91, 0xc6, 0x33, 0xc4, 0x56, 0x1b, 0x75, - 0xfa, 0xd1, 0x87, 0x3f, 0xc0, 0x9b, 0xa2, 0x1f, 0xfd, 0xb0, 0x2f, 0xc3, 0x4f, 0xea, 0xe2, 0xb6, - 0xf3, 0x94, 0xb0, 0x54, 0xab, 0x86, 0xae, 0x2a, 0xc6, 0x43, 0xf6, 0x5a, 0x43, 0x45, 0xf0, 0x9e, - 0xda, 0x6c, 0x68, 0xf2, 0x8d, 0x23, 0xd6, 0xb1, 0x9e, 0x6b, 0xad, 0x02, 0x79, 0xb8, 0xa0, 0x27, - 0x0c, 0xdf, 0xe9, 0x9e, 0xe9, 0xdd, 0xe1, 0x4d, 0x07, 0x2a, 0x69, 0x3a, 0x50, 0x77, 0x5f, 0xa9, - 0xb1, 0xee, 0xa7, 0x2c, 0x45, 0xbd, 0xa8, 0xfb, 0xae, 0xd4, 0x3e, 0xac, 0x1a, 0x7e, 0x2e, 0xc6, - 0x95, 0xba, 0xeb, 0x4a, 0x9d, 0x5c, 0xc1, 0x9f, 0x7a, 0xcd, 0xff, 0x7f, 0xfe, 0xd4, 0x42, 0xd8, - 0x9f, 0xba, 0xf7, 0x4a, 0x73, 0x37, 0x7c, 0x80, 0x89, 0x1f, 0xf5, 0xfd, 0xa7, 0x7b, 0x05, 0xca, - 0x5c, 0x1c, 0x8e, 0x31, 0x17, 0xf7, 0xc4, 0x99, 0x8b, 0x23, 0xf1, 0xe6, 0xe2, 0xde, 0x58, 0x73, - 0xd1, 0x8a, 0x98, 0x8b, 0xa3, 0x86, 0x71, 0xb7, 0x2f, 0x50, 0xdc, 0xfb, 0x03, 0xc5, 0x3d, 0x46, - 0x3e, 0xd7, 0x6e, 0xb6, 0x42, 0x5f, 0xd8, 0x56, 0xe8, 0x97, 0xb6, 0x02, 0xd9, 0x03, 0x03, 0x72, - 0x90, 0x9e, 0x96, 0x03, 0x0d, 0x39, 0x1c, 0x0c, 0xb9, 0x27, 0x6a, 0x2b, 0xd0, 0xe9, 0xda, 0xc4, - 0xeb, 0xfb, 0xfe, 0xbf, 0xd4, 0xaa, 0x86, 0x86, 0x1c, 0x24, 0x0d, 0x89, 0xcf, 0xb5, 0xf0, 0xdb, - 0x65, 0x81, 0x86, 0xb0, 0xf5, 0x74, 0x05, 0x3a, 0xa8, 0x36, 0x95, 0xc5, 0x9e, 0xa8, 0xb2, 0x18, - 0x11, 0xd1, 0xda, 0xdd, 0x35, 0xc0, 0xe4, 0xa2, 0x75, 0xb3, 0x19, 0x16, 0xa5, 0xb5, 0xad, 0xd0, - 0xd3, 0x17, 0xe2, 0xc2, 0x06, 0x9e, 0x9a, 0x68, 0x0f, 0x62, 0xa8, 0xfb, 0x1d, 0x7d, 0xf2, 0x01, - 0x14, 0x95, 0x4c, 0x54, 0xc9, 0x14, 0x95, 0x2d, 0x78, 0x1a, 0x68, 0x01, 0x73, 0xc2, 0x62, 0xf3, - 0x69, 0x82, 0x99, 0xf7, 0x07, 0xa7, 0x72, 0xea, 0x92, 0xd1, 0x80, 0x2c, 0xd3, 0x92, 0x79, 0x07, - 0xe5, 0xd1, 0xcb, 0x65, 0x18, 0x99, 0x5b, 0x17, 0xe2, 0x1c, 0x66, 0x58, 0x3f, 0xa1, 0xd9, 0x63, - 0x3a, 0xde, 0x23, 0xa1, 0xb3, 0xff, 0xbd, 0x61, 0x47, 0x9c, 0xe8, 0x71, 0xea, 0xbd, 0xef, 0xec, - 0xb3, 0xac, 0x2c, 0xdd, 0x53, 0xc1, 0xa5, 0x00, 0x31, 0x33, 0x4c, 0xb1, 0x47, 0xb4, 0x50, 0x3e, - 0x24, 0x38, 0x8a, 0xec, 0xa3, 0xa7, 0x12, 0x37, 0x58, 0xd7, 0xc9, 0xe2, 0x15, 0xba, 0x74, 0xd1, - 0x94, 0x31, 0x39, 0xf6, 0xb1, 0x53, 0x60, 0x0b, 0x8d, 0xab, 0x5a, 0x58, 0x1e, 0xe1, 0xb1, 0xd2, - 0xd8, 0x68, 0x15, 0xbb, 0x1d, 0xf6, 0x89, 0x53, 0xb0, 0xad, 0x37, 0xf7, 0xaa, 0x56, 0xbd, 0x7c, - 0xd2, 0x18, 0xe3, 0x49, 0x60, 0xc9, 0xa7, 0x37, 0x1d, 0x79, 0xb9, 0x81, 0x7d, 0xe6, 0x54, 0xe2, - 0x36, 0xeb, 0xa6, 0x1e, 0xb5, 0xaa, 0x8f, 0x7f, 0x3d, 0x95, 0xb8, 0xc9, 0x9a, 0x90, 0x50, 0xa4, - 0x18, 0x10, 0xd4, 0xad, 0xcb, 0x6e, 0x3e, 0x67, 0x4c, 0x95, 0x00, 0xf2, 0xee, 0xba, 0x1a, 0xe5, - 0xf3, 0x46, 0x35, 0xcf, 0xd5, 0xe3, 0x5b, 0x89, 0x9e, 0x02, 0xfb, 0xd2, 0xa9, 0xc4, 0xa4, 0x75, - 0x23, 0xaf, 0xe6, 0x11, 0x40, 0x1e, 0x2d, 0xa5, 0xf4, 0x18, 0x7e, 0x4f, 0x97, 0x7d, 0xd3, 0x44, - 0x86, 0x0b, 0x0b, 0xac, 0x49, 0xca, 0x72, 0x7d, 0xf6, 0x2d, 0xad, 0x0b, 0x6c, 0xaa, 0xd5, 0xa9, - 0x55, 0x7c, 0xfb, 0x54, 0xe2, 0x98, 0x75, 0x54, 0xc2, 0x54, 0x90, 0x0e, 0x96, 0x1b, 0x74, 0xaf, - 0x8d, 0x20, 0xd9, 0x0f, 0x8c, 0x21, 0xd2, 0xfc, 0xb2, 0x83, 0x5b, 0xe7, 0xc2, 0xd1, 0x67, 0x3f, - 0x34, 0x90, 0x90, 0xe2, 0x4f, 0x87, 0xa5, 0x29, 0xbf, 0xa1, 0x83, 0xd8, 0x67, 0x3f, 0x32, 0xda, - 0x57, 0x3a, 0xde, 0xb6, 0xd1, 0xfd, 0x8f, 0x4f, 0x25, 0x6e, 0xb6, 0xae, 0x97, 0xd5, 0xa5, 0x36, - 0x9e, 0x07, 0xd4, 0x5c, 0xca, 0x16, 0x4e, 0x53, 0xf4, 0x9b, 0xfd, 0xc4, 0x18, 0xc1, 0x80, 0xa0, - 0x3b, 0xcb, 0xec, 0x91, 0x99, 0x9e, 0x5d, 0xe4, 0x9d, 0x6e, 0x0b, 0x06, 0x79, 0xca, 0x8c, 0xbe, - 0x46, 0x13, 0x02, 0x51, 0xfd, 0xd4, 0x99, 0xc4, 0xed, 0xd6, 0x2d, 0x3d, 0xeb, 0x15, 0xae, 0x1e, - 0xed, 0xdd, 0x0f, 0xee, 0x3c, 0x7b, 0xda, 0x8c, 0x4e, 0x37, 0x46, 0x7d, 0xc5, 0xed, 0x08, 0x31, - 0xc6, 0x1e, 0x9b, 0xd1, 0x49, 0x34, 0x0c, 0x45, 0xe9, 0xac, 0x4d, 0xaf, 0xc3, 0x9e, 0x3e, 0x93, - 0xb8, 0xcb, 0xba, 0x4d, 0x82, 0xe5, 0xf8, 0xdb, 0x73, 0x14, 0x4e, 0x07, 0x91, 0xd0, 0x72, 0xc0, - 0x76, 0x57, 0xf3, 0x7a, 0x86, 0x31, 0xaf, 0xaa, 0x4a, 0x9a, 0x15, 0xc4, 0xc2, 0x9e, 0x35, 0xa3, - 0xa3, 0x50, 0xaf, 0x17, 0x1d, 0x3c, 0x7b, 0x46, 0x27, 0x14, 0x63, 0x4a, 0x0a, 0xe6, 0xd7, 0x0c, - 0x98, 0xd8, 0xcc, 0x65, 0xf6, 0xdc, 0x99, 0xc4, 0x2d, 0xd6, 0x0d, 0x12, 0x26, 0xdf, 0xb8, 0xe4, - 0x56, 0x50, 0x29, 0x5f, 0xf0, 0x9c, 0x76, 0x9d, 0x9f, 0xfb, 0xb0, 0xe7, 0xcd, 0x24, 0x6e, 0xb5, - 0x8e, 0x05, 0x34, 0xf9, 0x64, 0x71, 0x40, 0x20, 0xd9, 0x82, 0x36, 0xe4, 0x05, 0x33, 0x89, 0xbb, - 0xad, 0xdb, 0x77, 0x07, 0x52, 0x13, 0x7b, 0xe1, 0x0c, 0xc8, 0xcd, 0x23, 0x21, 0x60, 0xc9, 0x02, - 0x2f, 0x8a, 0x1b, 0x2e, 0xcc, 0x03, 0x2f, 0x8e, 0x03, 0xe2, 0x14, 0x0e, 0x30, 0x94, 0x46, 0xe2, - 0xb3, 0x97, 0xc6, 0xcd, 0x29, 0x04, 0xa4, 0x7a, 0xfc, 0xed, 0x19, 0x50, 0xc8, 0x07, 0x02, 0x60, - 0xa7, 0xbe, 0xb3, 0xb6, 0xcd, 0x5e, 0x36, 0x93, 0xb8, 0xc3, 0x9a, 0x94, 0xa5, 0x67, 0x30, 0xe1, - 0xb2, 0xbe, 0xdc, 0xf6, 0xb6, 0x56, 0x83, 0x07, 0x80, 0x60, 0x83, 0xbb, 0x2e, 0x7b, 0xdc, 0x58, - 0x12, 0xbf, 0x9a, 0x9f, 0x11, 0x6f, 0x1f, 0xb0, 0x97, 0x1b, 0xbb, 0x59, 0xe1, 0x77, 0x0c, 0xdd, - 0x65, 0x7a, 0x35, 0x8f, 0x58, 0xee, 0x77, 0x8c, 0x61, 0xa2, 0x00, 0x6a, 0x96, 0xaf, 0x98, 0x49, - 0x4c, 0x58, 0x87, 0xd5, 0xb6, 0x8b, 0xb5, 0xe0, 0x9b, 0x5b, 0x3e, 0x7b, 0xa5, 0x41, 0xcb, 0xa2, - 0xb4, 0x2c, 0x93, 0x1e, 0x25, 0x65, 0xfd, 0xae, 0x41, 0xcb, 0x51, 0x28, 0x31, 0xd0, 0xab, 0xcc, - 0x29, 0x77, 0x2f, 0x6c, 0x35, 0x3a, 0xfa, 0x70, 0xec, 0xd5, 0xe6, 0x94, 0x23, 0x00, 0xaa, 0xa7, - 0xdf, 0x9b, 0x49, 0x8c, 0xe3, 0xa9, 0x64, 0x20, 0xdf, 0x91, 0x2c, 0xf2, 0xde, 0x06, 0x7b, 0x4d, - 0x6f, 0xe6, 0x44, 0x4c, 0xb3, 0xd7, 0x1a, 0x62, 0x82, 0x77, 0x9b, 0x46, 0x55, 0xef, 0xcb, 0xc5, - 0xbc, 0xce, 0xa0, 0x5e, 0x13, 0x42, 0x0c, 0xff, 0xfa, 0x19, 0x5d, 0x9a, 0x49, 0x61, 0x2c, 0xee, - 0x9c, 0xf9, 0xec, 0x0d, 0x71, 0x84, 0xa4, 0xaa, 0xb9, 0x14, 0x67, 0xbf, 0x1f, 0xc2, 0x99, 0x09, - 0xa4, 0x86, 0xfa, 0x03, 0xa3, 0x2f, 0x93, 0x06, 0x14, 0xd0, 0x1b, 0x4d, 0xc6, 0x25, 0x8c, 0xf1, - 0x4c, 0x2d, 0xb0, 0x32, 0xb8, 0xac, 0x66, 0x6f, 0x32, 0xe6, 0x8c, 0xfc, 0x5f, 0xc6, 0x6b, 0x86, - 0xb2, 0xfa, 0xcd, 0xc6, 0x74, 0xc2, 0xd5, 0x32, 0xc1, 0x8c, 0xbd, 0x65, 0x26, 0x71, 0x04, 0x4f, - 0x93, 0x39, 0xd8, 0x39, 0xb2, 0x5d, 0x90, 0xd8, 0xde, 0x6a, 0xa0, 0x5d, 0x95, 0xab, 0x19, 0xbe, - 0xcd, 0x18, 0x1d, 0xfc, 0x7f, 0xae, 0xba, 0x24, 0xce, 0xff, 0xd0, 0x68, 0xae, 0x55, 0x8b, 0xe6, - 0x6f, 0x37, 0x76, 0x4d, 0x37, 0x07, 0x65, 0x0f, 0xff, 0xdd, 0xd8, 0x35, 0x13, 0x42, 0x74, 0xf2, - 0x47, 0x33, 0xba, 0xb6, 0x4f, 0xe3, 0xd3, 0x28, 0xcd, 0x60, 0x05, 0xef, 0x30, 0x98, 0x4d, 0xa4, - 0x08, 0xc8, 0xde, 0xff, 0xd8, 0x68, 0xaa, 0x2a, 0x45, 0xc7, 0xef, 0x9c, 0x01, 0xe3, 0x69, 0xbf, - 0xaa, 0xf5, 0xb6, 0xbb, 0xdb, 0xec, 0xcf, 0x66, 0x12, 0xf7, 0x58, 0x77, 0xe8, 0x56, 0x4d, 0x1a, - 0x6c, 0xc5, 0x36, 0xc9, 0xc9, 0x1d, 0x71, 0x44, 0xb8, 0xde, 0x6d, 0x0a, 0xc2, 0x7f, 0x97, 0x21, - 0x55, 0x38, 0x8f, 0xc6, 0x28, 0x20, 0x3e, 0x99, 0xbf, 0x31, 0xba, 0xee, 0x09, 0x2c, 0x26, 0xf7, - 0x9e, 0xde, 0x5a, 0x0d, 0xb5, 0x95, 0x82, 0x7b, 0xaf, 0x46, 0x00, 0xdc, 0x32, 0xcd, 0xd6, 0xbc, - 0x96, 0x2e, 0xd7, 0xed, 0x27, 0x79, 0x17, 0xd8, 0xdf, 0xce, 0x80, 0x01, 0x9e, 0x50, 0x48, 0x24, - 0xe5, 0x8c, 0xca, 0x8a, 0xbd, 0xcf, 0x60, 0xee, 0xa0, 0x42, 0x0d, 0xf0, 0x77, 0x06, 0xcf, 0x66, - 0x1a, 0x3e, 0x5a, 0x09, 0xd4, 0xf4, 0xfd, 0xc6, 0xee, 0x6a, 0x35, 0xaa, 0xed, 0x07, 0x0c, 0xfc, - 0x0b, 0x44, 0x90, 0x13, 0x09, 0x76, 0x36, 0xfb, 0x60, 0x48, 0x48, 0x19, 0xb5, 0xaa, 0x8f, 0x0f, - 0xcd, 0xe8, 0x76, 0xa6, 0x6a, 0xfc, 0xf7, 0x06, 0x83, 0x61, 0x31, 0x7f, 0x0a, 0xca, 0xe6, 0xff, - 0x90, 0xb9, 0xc5, 0xfe, 0x61, 0x26, 0xf1, 0x80, 0x75, 0x5f, 0x0c, 0x10, 0xa8, 0xe4, 0xad, 0x2d, - 0xb7, 0xde, 0x80, 0xc5, 0xca, 0x81, 0xaa, 0x9e, 0x68, 0xc9, 0xfe, 0x71, 0x26, 0x31, 0x65, 0x3d, - 0x21, 0xb6, 0x95, 0x9c, 0xa4, 0x80, 0x75, 0xd9, 0x3f, 0x19, 0x14, 0x10, 0x99, 0x86, 0xd6, 0x3b, - 0x4c, 0xe7, 0x9f, 0x7b, 0x01, 0x63, 0xc7, 0xe1, 0x59, 0x7c, 0xf8, 0xea, 0x81, 0x5d, 0xf6, 0x11, - 0x83, 0x0b, 0x50, 0x62, 0x62, 0x03, 0xfe, 0x50, 0x02, 0xfb, 0xa8, 0x81, 0x2a, 0xb3, 0x32, 0xb0, - 0xcc, 0x0d, 0x09, 0x41, 0x02, 0x8b, 0x36, 0xf9, 0xe3, 0x06, 0x8b, 0xab, 0x72, 0xd5, 0xee, 0x5f, - 0x8c, 0xce, 0x2b, 0xdd, 0x8d, 0x0d, 0xb1, 0x89, 0x9a, 0x5a, 0x64, 0x9f, 0x30, 0x8d, 0x26, 0x12, - 0x74, 0xe8, 0x01, 0xb9, 0xfe, 0xb2, 0xb8, 0x6d, 0xe5, 0xa7, 0xea, 0x75, 0xf6, 0xc9, 0x99, 0xc4, - 0x9d, 0xd6, 0xad, 0xbb, 0x82, 0x81, 0x76, 0xf2, 0xc0, 0x6a, 0xfc, 0xd4, 0x4c, 0xe2, 0xa8, 0x75, - 0x48, 0x42, 0x66, 0xeb, 0x8d, 0x0e, 0x8f, 0x70, 0x6d, 0x78, 0xec, 0xdf, 0x0c, 0x89, 0xa2, 0x57, - 0xa9, 0x39, 0x7f, 0xd6, 0x20, 0x4b, 0x30, 0xdb, 0xe4, 0x0d, 0x24, 0x1c, 0x8c, 0x7d, 0xce, 0x98, - 0x6c, 0x0a, 0x1f, 0xe7, 0xc0, 0x1e, 0xaa, 0x9e, 0xc1, 0x84, 0xec, 0xf3, 0x71, 0x16, 0x45, 0xae, - 0x05, 0x5b, 0xd7, 0xc2, 0x47, 0x03, 0x9c, 0x26, 0xbf, 0x92, 0x91, 0x05, 0x6d, 0xda, 0x64, 0x5f, - 0x30, 0x6d, 0x3c, 0x4c, 0x6c, 0x59, 0x07, 0x1a, 0x85, 0x6e, 0x29, 0xdb, 0x9e, 0x7d, 0xd1, 0x60, - 0x25, 0x12, 0x39, 0x81, 0xa1, 0x47, 0x72, 0xee, 0x4b, 0xda, 0x9c, 0xc5, 0x60, 0x3c, 0x5d, 0x1f, - 0x2f, 0x73, 0xb3, 0xaf, 0x68, 0x72, 0x5a, 0x2e, 0x53, 0xab, 0xfe, 0xf7, 0x99, 0xc4, 0xb4, 0x75, - 0x57, 0x4f, 0x61, 0x12, 0xbe, 0x1f, 0xce, 0xbe, 0x6a, 0xe0, 0xd0, 0x0e, 0xa6, 0x82, 0x27, 0x29, - 0x74, 0x5f, 0x88, 0x7d, 0xcd, 0x30, 0x70, 0xe3, 0x40, 0x14, 0xba, 0xbf, 0xae, 0x49, 0x90, 0xb4, - 0x23, 0x0c, 0xb8, 0xb3, 0x1e, 0x98, 0x93, 0xdf, 0xd0, 0x96, 0x6d, 0xd4, 0xa8, 0xb6, 0xff, 0xcb, - 0x58, 0x76, 0x07, 0x84, 0xe6, 0x25, 0x37, 0x68, 0xff, 0x4d, 0x4d, 0x82, 0x44, 0x6a, 0x55, 0x1f, - 0xdf, 0xd2, 0x48, 0x1b, 0x51, 0xbe, 0xec, 0xb4, 0xd6, 0x9d, 0x36, 0x38, 0x4f, 0xda, 0xa6, 0x28, - 0x96, 0xd2, 0xea, 0xbf, 0x63, 0x88, 0x60, 0xfe, 0x56, 0x05, 0x19, 0x01, 0x6b, 0xf4, 0x7c, 0x9a, - 0x54, 0xfa, 0xec, 0xbb, 0xbd, 0xe0, 0x24, 0x04, 0xcf, 0x04, 0x61, 0xdf, 0x33, 0x58, 0x45, 0x83, - 0x03, 0xd7, 0x2f, 0x0f, 0x1d, 0x52, 0x67, 0xdf, 0x37, 0xf1, 0x1a, 0x0b, 0x24, 0xfa, 0xfb, 0x81, - 0xe9, 0x18, 0xc0, 0xcc, 0x43, 0xea, 0xef, 0xc7, 0x06, 0x55, 0x19, 0x00, 0x02, 0x35, 0xff, 0x61, - 0x70, 0x82, 0x64, 0x16, 0xe9, 0xeb, 0xfc, 0xc4, 0x10, 0xd0, 0xa1, 0x5a, 0xd5, 0xc7, 0x4f, 0x67, - 0x4c, 0x17, 0xcf, 0x23, 0x7e, 0xd3, 0x14, 0xdf, 0x23, 0xb3, 0xa6, 0x8b, 0xa7, 0x01, 0x88, 0x2e, - 0x9e, 0x32, 0xab, 0x9b, 0xb2, 0xc2, 0xe0, 0x16, 0x5e, 0xf2, 0x53, 0x67, 0x75, 0xcd, 0x75, 0xda, - 0x69, 0x36, 0x8b, 0xeb, 0xcb, 0x88, 0xa9, 0x47, 0x67, 0x75, 0x9e, 0x0a, 0x2a, 0xe4, 0xb0, 0x4f, - 0x9b, 0xd5, 0xe7, 0xa5, 0xd7, 0x8b, 0x51, 0x7f, 0x79, 0x56, 0xdf, 0xb7, 0x15, 0xf1, 0x3e, 0x44, - 0x06, 0x7c, 0xb3, 0x4e, 0xa3, 0xee, 0x96, 0xf0, 0x15, 0x2c, 0xf2, 0x67, 0x1e, 0x9b, 0x35, 0x2d, - 0x4b, 0x7a, 0x55, 0x43, 0x87, 0xf2, 0xd9, 0xaf, 0xcc, 0xea, 0xc2, 0xc0, 0xac, 0xe4, 0x0d, 0x34, - 0xb3, 0xef, 0x19, 0xc6, 0xb8, 0xa7, 0xe9, 0xb5, 0x11, 0xd7, 0x6d, 0x9d, 0x6e, 0x6c, 0x6c, 0x92, - 0xc3, 0x25, 0x17, 0xf0, 0xcc, 0x59, 0xdd, 0xac, 0x8e, 0x83, 0x13, 0x1d, 0x3e, 0x6b, 0x56, 0x67, - 0xef, 0x9e, 0x0b, 0x09, 0x1c, 0xc6, 0x59, 0x43, 0x66, 0x77, 0xa0, 0x2f, 0xd8, 0x95, 0x2d, 0xaf, - 0x84, 0xaf, 0x37, 0xc8, 0xd1, 0x9f, 0x33, 0xab, 0x6f, 0x7e, 0x04, 0x48, 0xfa, 0x95, 0xb3, 0x46, - 0x80, 0x00, 0x8f, 0x94, 0xf3, 0x9e, 0xd7, 0x59, 0x69, 0xbb, 0xee, 0x25, 0x90, 0x7b, 0xcf, 0x35, - 0xf6, 0x00, 0x4c, 0x84, 0xad, 0x86, 0xef, 0xeb, 0x00, 0xcf, 0x9b, 0x35, 0x9d, 0x5b, 0x61, 0x03, - 0xa6, 0x55, 0x36, 0xda, 0xf3, 0x0d, 0x24, 0x44, 0x7b, 0x50, 0x33, 0xf9, 0x75, 0x63, 0x97, 0x96, - 0x9c, 0x26, 0x1a, 0x8a, 0xf5, 0xca, 0x66, 0x77, 0x7d, 0xbd, 0x29, 0x44, 0xf6, 0x0b, 0x0c, 0xc4, - 0xe3, 0x60, 0xe9, 0x4d, 0xb7, 0x76, 0x91, 0x0b, 0xca, 0x12, 0xde, 0xff, 0xf2, 0x31, 0x62, 0xc7, - 0x5e, 0x68, 0xe0, 0xb3, 0x27, 0x9c, 0x1a, 0xfa, 0x37, 0x66, 0x75, 0x3b, 0x9e, 0x83, 0xc9, 0xeb, - 0x95, 0x12, 0x9d, 0xbf, 0x39, 0x1b, 0x72, 0x08, 0x0c, 0x18, 0xd1, 0xd1, 0x8b, 0x0c, 0x6c, 0x98, - 0x40, 0xc8, 0x7e, 0xec, 0xc5, 0x06, 0x36, 0xa2, 0x00, 0xaa, 0xa7, 0x97, 0xc4, 0x4c, 0xc9, 0xcf, - 0xb5, 0x56, 0xbd, 0x56, 0x67, 0x53, 0x4e, 0xe9, 0xb7, 0x62, 0xa6, 0x14, 0xc0, 0x88, 0x8e, 0x5e, - 0x6a, 0x90, 0x81, 0xa6, 0xd4, 0x29, 0x7a, 0x29, 0xbb, 0xfa, 0xed, 0x59, 0x5d, 0x67, 0x46, 0xa1, - 0x44, 0x67, 0x2f, 0x33, 0xf8, 0x7c, 0xc9, 0x23, 0xd5, 0x26, 0x22, 0x45, 0x8f, 0x1b, 0x33, 0x96, - 0xb7, 0x0d, 0x45, 0x4c, 0x2d, 0xc5, 0x73, 0xf3, 0x5e, 0x3e, 0xab, 0x5b, 0x66, 0xb1, 0x30, 0x6a, - 0xac, 0xdf, 0x99, 0x0d, 0x44, 0x9b, 0xb8, 0xb8, 0x2b, 0x34, 0x22, 0x28, 0x28, 0xf6, 0x4a, 0x6d, - 0x59, 0x91, 0x5a, 0xd5, 0xc7, 0xef, 0x1a, 0xcb, 0x0a, 0xac, 0xa6, 0x90, 0x9c, 0x7d, 0x95, 0x31, - 0x75, 0xf2, 0x4d, 0x32, 0xf8, 0xba, 0x3b, 0x88, 0x6b, 0x64, 0x7b, 0x3c, 0x66, 0x60, 0xaf, 0x36, - 0x84, 0x20, 0x4d, 0xdd, 0xbc, 0x11, 0xc9, 0x7e, 0x6f, 0x56, 0xb7, 0x7e, 0x62, 0x20, 0xd4, 0xb4, - 0x5e, 0x63, 0x48, 0x3e, 0x28, 0x36, 0x60, 0x7d, 0xf6, 0x5a, 0x83, 0xce, 0x23, 0xf5, 0xaa, 0x9f, - 0xd7, 0x19, 0xdb, 0x81, 0xcb, 0x2b, 0xb6, 0xc4, 0xd2, 0xd8, 0xeb, 0x4d, 0xc6, 0x76, 0x3b, 0xcb, - 0xb0, 0x4b, 0xdd, 0xb6, 0x5b, 0x47, 0x04, 0x81, 0xaf, 0x6c, 0x34, 0x35, 0xeb, 0xde, 0x38, 0xab, - 0x6b, 0xe5, 0x75, 0x70, 0x42, 0x37, 0xcd, 0x97, 0x4c, 0xf2, 0x8d, 0xd6, 0x45, 0xf6, 0x26, 0x0d, - 0x8a, 0x3b, 0x2e, 0x30, 0xb1, 0x5f, 0x34, 0xa3, 0xb5, 0x3e, 0x7b, 0xb3, 0x81, 0x36, 0x64, 0x45, - 0xd0, 0x83, 0x78, 0xf9, 0x0f, 0xa1, 0xc8, 0xb6, 0x79, 0x8b, 0x81, 0xb6, 0x18, 0x08, 0xb5, 0xdc, - 0xb7, 0x9a, 0xbb, 0xe9, 0x09, 0x73, 0x36, 0xd5, 0x6c, 0x1a, 0x43, 0xbe, 0x2d, 0x02, 0xc6, 0x83, - 0x5f, 0xf2, 0x23, 0x15, 0x00, 0x0b, 0x9e, 0x2e, 0xfb, 0x43, 0x83, 0x57, 0x57, 0xf0, 0xc0, 0x85, - 0x53, 0xb2, 0xa4, 0x8a, 0xb7, 0x1b, 0x53, 0x37, 0x00, 0xc4, 0x84, 0xfe, 0xbb, 0xc1, 0xcd, 0x04, - 0x01, 0x88, 0x16, 0xe3, 0x94, 0xbd, 0x80, 0xc0, 0xfe, 0xc8, 0x58, 0x63, 0x2c, 0xa0, 0xe8, 0xf2, - 0x1d, 0xb3, 0x31, 0x21, 0x0e, 0x6a, 0x40, 0x5e, 0xd3, 0x1f, 0xcf, 0xea, 0x56, 0x7e, 0x50, 0xfe, - 0x4e, 0x53, 0x15, 0x62, 0x39, 0x77, 0x2d, 0xe4, 0x18, 0x62, 0x22, 0x7f, 0x12, 0x9d, 0x71, 0x08, - 0x4e, 0xcc, 0xe3, 0x4f, 0x0d, 0x24, 0xf2, 0xc5, 0x93, 0xe7, 0xce, 0xc1, 0x65, 0x7f, 0x7f, 0x16, - 0x1d, 0xd7, 0x04, 0x13, 0xdd, 0xfd, 0x79, 0x14, 0x8e, 0x6f, 0x4a, 0x28, 0x9c, 0xf0, 0xae, 0xe8, - 0xfc, 0x42, 0x70, 0xa2, 0xc3, 0x77, 0xcf, 0x9a, 0x41, 0x57, 0x0a, 0x2c, 0xf0, 0x41, 0x91, 0x76, - 0xd8, 0x5f, 0x44, 0x55, 0x85, 0x5e, 0xaf, 0xfa, 0xf9, 0xcb, 0x59, 0xdd, 0x80, 0xd2, 0xa8, 0x8f, - 0x92, 0xf5, 0xff, 0xca, 0x10, 0x9e, 0xa1, 0x5a, 0xd5, 0xc7, 0xff, 0x88, 0xd0, 0x38, 0x9f, 0x33, - 0x05, 0x93, 0x51, 0x7e, 0xb2, 0xf7, 0xc4, 0x8d, 0x42, 0x6e, 0x18, 0x8e, 0xf2, 0xde, 0xb8, 0x51, - 0x64, 0xad, 0x1a, 0xe5, 0x6f, 0x67, 0xc3, 0xc6, 0x60, 0x2e, 0xb3, 0xb4, 0x53, 0xd0, 0x0c, 0xa6, - 0xf7, 0x1b, 0x1a, 0xd4, 0x84, 0x90, 0x0e, 0xfd, 0xac, 0xee, 0x8c, 0x4b, 0x8b, 0x90, 0x7d, 0xd0, - 0xb4, 0xf0, 0x1c, 0xdf, 0xc7, 0xf0, 0x08, 0x77, 0xe3, 0x79, 0xdf, 0x1f, 0x32, 0xfa, 0x36, 0x21, - 0x44, 0xdf, 0x7f, 0x3f, 0xab, 0xfb, 0xb0, 0x05, 0x0f, 0x98, 0x37, 0x20, 0xd0, 0x7f, 0x34, 0x30, - 0xa0, 0x11, 0x1e, 0xd5, 0x7e, 0x38, 0x62, 0x45, 0xa0, 0xb5, 0x1c, 0xdc, 0x66, 0x66, 0x1f, 0x31, - 0xe8, 0x22, 0x0a, 0xa0, 0x26, 0xf1, 0xd1, 0xd9, 0x98, 0x18, 0xa0, 0x50, 0xfc, 0x68, 0x47, 0x95, - 0x3c, 0xaf, 0xc9, 0x3e, 0x3e, 0x1b, 0xe3, 0xfa, 0x85, 0x80, 0x02, 0x07, 0x79, 0x56, 0x0f, 0xfb, - 0x04, 0xbb, 0x5b, 0xdc, 0x76, 0xf9, 0xfa, 0xf8, 0xdd, 0x0e, 0x81, 0xa7, 0x4f, 0xce, 0x26, 0xee, - 0xb5, 0xee, 0xbc, 0x32, 0xb4, 0xe8, 0xfc, 0x53, 0x11, 0xf0, 0x0c, 0x3f, 0x87, 0x8d, 0xef, 0xfd, - 0xd3, 0x11, 0xc3, 0xa6, 0x07, 0xb8, 0xe8, 0xfe, 0x7f, 0x46, 0x65, 0x1c, 0x9f, 0xce, 0x2a, 0xbf, - 0x58, 0xcf, 0x3e, 0x63, 0xb0, 0x39, 0x35, 0x06, 0xc1, 0xa4, 0x7a, 0x93, 0xe3, 0xfe, 0xab, 0xc1, - 0x4d, 0x31, 0x60, 0x62, 0xbc, 0x7f, 0x33, 0x14, 0x29, 0xd5, 0x21, 0x90, 0x98, 0x14, 0x69, 0x12, - 0xf6, 0x59, 0xa3, 0x2f, 0x74, 0x5f, 0xe3, 0xd7, 0xfa, 0x39, 0x63, 0xcb, 0xe3, 0xe0, 0xc4, 0xa0, - 0x9f, 0x37, 0x44, 0x26, 0xa9, 0x04, 0xfd, 0x38, 0xf1, 0x8b, 0xb3, 0x7a, 0xfc, 0x0b, 0x6b, 0xe4, - 0xe2, 0xbf, 0x34, 0x1b, 0x3a, 0xbf, 0x13, 0x87, 0xba, 0x74, 0x40, 0xe6, 0xb3, 0x2f, 0x9b, 0x22, - 0x30, 0x54, 0xad, 0x86, 0xff, 0x8a, 0xc1, 0x19, 0x34, 0x3f, 0xe4, 0x2b, 0x1e, 0xb0, 0xe0, 0x4b, - 0xf9, 0x7a, 0x14, 0x2d, 0x01, 0x88, 0xe8, 0xe6, 0x1b, 0xa6, 0x0f, 0x80, 0x30, 0x98, 0x44, 0xd8, - 0x33, 0x1a, 0xf9, 0xbf, 0x66, 0x13, 0xf7, 0x59, 0x53, 0x57, 0x03, 0x2f, 0x06, 0xf8, 0xa6, 0x61, - 0x7b, 0x91, 0x97, 0x0f, 0x73, 0xf0, 0x50, 0x14, 0x82, 0x7f, 0x2a, 0x2d, 0x0b, 0xde, 0xf9, 0xb7, - 0x0c, 0x06, 0xe9, 0x05, 0x2b, 0xcf, 0x30, 0x0d, 0x3c, 0x85, 0x81, 0x5d, 0xf1, 0xec, 0x06, 0xfb, - 0x8e, 0x41, 0xea, 0xbd, 0xc0, 0x54, 0xaf, 0xdf, 0x9d, 0x35, 0x0e, 0xe0, 0x34, 0xf0, 0xa6, 0xeb, - 0xf8, 0xae, 0x36, 0x13, 0xf6, 0xbd, 0xd9, 0xc4, 0x09, 0xeb, 0x9e, 0xab, 0x01, 0x55, 0xbd, 0x7f, - 0x3f, 0xc6, 0x25, 0xac, 0x8a, 0x97, 0x34, 0x85, 0x4b, 0xf8, 0x03, 0x03, 0x5f, 0x79, 0xc7, 0xef, - 0x9c, 0x6e, 0x04, 0x77, 0x69, 0x94, 0x13, 0x57, 0xc2, 0xc4, 0xa7, 0x1f, 0x1a, 0x6b, 0xeb, 0x09, - 0x2b, 0xd1, 0xfb, 0x23, 0x63, 0xaf, 0x77, 0x01, 0x17, 0xb3, 0xfd, 0xb1, 0xc1, 0x0a, 0xdc, 0x08, - 0x11, 0xaf, 0x7a, 0x70, 0xa9, 0x25, 0x3b, 0xfe, 0x0f, 0xc3, 0xce, 0x88, 0x05, 0x14, 0x5d, 0xfe, - 0xc4, 0xd8, 0x34, 0x03, 0x86, 0xdb, 0x5c, 0xbc, 0xc3, 0xa7, 0xcc, 0xe9, 0xcc, 0x1a, 0x03, 0x26, - 0xba, 0x7b, 0xea, 0x9c, 0xae, 0x8e, 0x23, 0x70, 0xec, 0xd1, 0x39, 0x7d, 0x38, 0x63, 0x62, 0x3c, - 0x1a, 0x29, 0x5c, 0x7e, 0x63, 0xb8, 0x18, 0x30, 0xe9, 0xf9, 0xcf, 0xe9, 0x52, 0x1e, 0x77, 0x3b, - 0xa6, 0xb3, 0xc7, 0xe6, 0xc2, 0xd1, 0x8f, 0xb8, 0xae, 0x9e, 0x3e, 0xa7, 0x87, 0x98, 0x35, 0x08, - 0x0d, 0x0d, 0x4b, 0x3b, 0xe6, 0x8a, 0x32, 0xec, 0x57, 0xe6, 0x12, 0xf7, 0x5b, 0xd3, 0x57, 0x6a, - 0x55, 0xbc, 0x1c, 0xd8, 0xcc, 0xd0, 0xe8, 0x19, 0xc6, 0x84, 0x22, 0x8d, 0xc4, 0x84, 0x9e, 0x39, - 0xa7, 0x6b, 0xca, 0x10, 0x14, 0x7b, 0x96, 0xb1, 0x72, 0x39, 0xad, 0xc6, 0x25, 0x97, 0x47, 0x5b, - 0xb9, 0xb9, 0xf1, 0xec, 0xb8, 0x81, 0x96, 0x31, 0xa6, 0xa9, 0x43, 0xfd, 0xea, 0x9c, 0x1e, 0x83, - 0x15, 0x50, 0x3c, 0x2f, 0xe0, 0x39, 0x73, 0x61, 0x7d, 0x0c, 0xbc, 0x04, 0xde, 0x90, 0xc8, 0x94, - 0xf1, 0xd9, 0xaf, 0xf5, 0x5a, 0x8a, 0x41, 0xe7, 0xcf, 0x9d, 0x8b, 0x21, 0x32, 0x0d, 0x4a, 0xac, - 0xf8, 0x79, 0x73, 0x3a, 0xd5, 0xea, 0x60, 0x81, 0xb0, 0xe5, 0x1d, 0x3e, 0x7f, 0x4e, 0x17, 0x0a, - 0xf1, 0x90, 0x32, 0x9c, 0x10, 0x47, 0xb9, 0x62, 0xf9, 0xfa, 0x1c, 0x5f, 0x30, 0xa7, 0xf3, 0x56, - 0x1c, 0x9c, 0x3c, 0xe8, 0x9e, 0xd3, 0xe5, 0x81, 0x09, 0x18, 0x9e, 0xe7, 0x6f, 0xcc, 0x19, 0xe7, - 0x4a, 0x3d, 0x60, 0x45, 0xc7, 0xbf, 0x39, 0xa7, 0xdb, 0x4d, 0xcb, 0xcd, 0xc6, 0xb6, 0x7a, 0xe7, - 0xd7, 0x67, 0x2f, 0x9a, 0x33, 0x12, 0x40, 0xd4, 0x8d, 0x33, 0xe1, 0x74, 0xbf, 0x38, 0x0e, 0xc3, - 0x7c, 0x20, 0x9d, 0x8d, 0x5f, 0xd2, 0x1b, 0x19, 0x06, 0xed, 0xfd, 0xd6, 0x5c, 0xd8, 0x1c, 0x11, - 0x6f, 0x4e, 0xe9, 0xa7, 0xc1, 0xcb, 0x5e, 0xbb, 0x4a, 0x57, 0xbe, 0xd9, 0x4b, 0xe7, 0xc2, 0x9e, - 0x96, 0x00, 0xe7, 0x80, 0xf2, 0x46, 0xde, 0x6f, 0x1b, 0x60, 0xfc, 0x28, 0x4e, 0x70, 0x05, 0xdd, - 0x69, 0x4c, 0xd3, 0xf3, 0xdc, 0xec, 0x65, 0x86, 0x0c, 0x01, 0xfb, 0x42, 0xb8, 0xb2, 0x20, 0x8f, - 0x2f, 0x39, 0xb5, 0x1d, 0xf6, 0xb8, 0xb1, 0x88, 0x48, 0xbd, 0x5a, 0xc4, 0xcb, 0xe7, 0x0c, 0x4f, - 0xbd, 0x13, 0x8d, 0xab, 0xfe, 0x8e, 0x41, 0x70, 0x31, 0x10, 0xc1, 0x19, 0x7d, 0xdc, 0x46, 0x72, - 0x29, 0xc0, 0x77, 0x40, 0xc7, 0xf2, 0x2b, 0xe7, 0x8c, 0x03, 0xc2, 0x5e, 0xc0, 0x32, 0x36, 0xd1, - 0xbb, 0x6b, 0x6e, 0x19, 0xeb, 0x5d, 0xbf, 0xaa, 0x77, 0xd7, 0x3a, 0xb0, 0xe8, 0xfa, 0xd5, 0x06, - 0x26, 0xb9, 0x73, 0x9e, 0xdb, 0x68, 0x01, 0x35, 0xd3, 0xbb, 0x3b, 0xec, 0xf7, 0xe2, 0x68, 0x5e, - 0x9f, 0xa8, 0x1c, 0xf6, 0x35, 0x71, 0x9c, 0x69, 0x02, 0x8a, 0x21, 0x5f, 0xdb, 0x8b, 0xd5, 0xcd, - 0x0e, 0x5f, 0x17, 0x47, 0x88, 0x3a, 0x98, 0x3c, 0xe9, 0x9f, 0xd3, 0xad, 0x1b, 0x63, 0x60, 0x7e, - 0xf0, 0x8a, 0xf6, 0xa0, 0x6e, 0x0e, 0xbd, 0x61, 0x2e, 0x71, 0xdc, 0xba, 0xfb, 0xaa, 0x1a, 0x88, - 0x21, 0x7e, 0xdf, 0x90, 0xb3, 0x1c, 0x49, 0x95, 0xae, 0x8f, 0x0f, 0xd3, 0xb8, 0x75, 0xf6, 0x07, - 0x73, 0xa6, 0x47, 0xa4, 0xbe, 0xac, 0x03, 0x74, 0x97, 0xc6, 0x4f, 0x1a, 0xb0, 0x37, 0xf6, 0xde, - 0x12, 0xd4, 0x35, 0x7c, 0x5b, 0x94, 0x44, 0x78, 0x93, 0xc1, 0x59, 0xbd, 0xa1, 0xc5, 0xe4, 0xde, - 0x3c, 0xd7, 0x33, 0x25, 0x48, 0x4d, 0xe0, 0x2d, 0x71, 0xc2, 0x50, 0xef, 0x32, 0x20, 0x9f, 0xb7, - 0xc6, 0xc9, 0xae, 0x30, 0xa8, 0x4c, 0x19, 0xe8, 0xbd, 0xae, 0x4c, 0xdb, 0x59, 0xef, 0x84, 0x32, - 0x08, 0xe6, 0x7a, 0xda, 0x11, 0x1a, 0x34, 0x7b, 0xfb, 0x15, 0x3a, 0x95, 0xf2, 0x45, 0x24, 0x15, - 0xf4, 0x46, 0x96, 0x01, 0x2d, 0x13, 0x0c, 0x7a, 0x23, 0x82, 0xd4, 0x59, 0x77, 0x5b, 0x4d, 0xf7, - 0x1d, 0xbd, 0x11, 0x11, 0x80, 0x8a, 0x6e, 0xff, 0xb8, 0x97, 0xb2, 0x29, 0x7b, 0x98, 0xab, 0x5a, - 0xb9, 0xec, 0xc8, 0xe7, 0xb2, 0xd8, 0x3b, 0xe3, 0xba, 0x0d, 0x83, 0x8a, 0x6e, 0xff, 0xa4, 0x17, - 0xa7, 0x70, 0x58, 0xd9, 0xe5, 0x9f, 0xf6, 0xe2, 0x14, 0x09, 0x26, 0xba, 0xfb, 0x33, 0x43, 0x55, - 0x47, 0x9f, 0x51, 0x63, 0x7f, 0x6e, 0xcc, 0x4d, 0x97, 0xe9, 0xf4, 0x98, 0x25, 0xb7, 0x7d, 0xf9, - 0xb3, 0x9f, 0xec, 0x5d, 0x71, 0xdb, 0x14, 0x0c, 0x9a, 0xaa, 0xd7, 0xf1, 0x42, 0xb5, 0x9c, 0xe2, - 0xbb, 0xe3, 0xb6, 0x29, 0x06, 0x5a, 0xcc, 0xf4, 0x2f, 0xb4, 0x15, 0x95, 0xc0, 0x15, 0x04, 0x7e, - 0x73, 0xeb, 0xe2, 0x26, 0xba, 0x7c, 0xbb, 0x2d, 0xd3, 0xdc, 0x60, 0x7f, 0x19, 0xc7, 0xfb, 0xe2, - 0x30, 0xb9, 0xe1, 0x83, 0x89, 0x5e, 0x73, 0x9a, 0x46, 0xf0, 0xfa, 0xaf, 0xe2, 0x78, 0x3f, 0xbe, - 0x81, 0x8c, 0xd8, 0x18, 0x7b, 0x10, 0x79, 0xd5, 0x53, 0x3a, 0x88, 0x7f, 0x6d, 0xa0, 0x83, 0xb8, - 0x8f, 0x23, 0x35, 0xee, 0x41, 0x6e, 0xf6, 0x37, 0xbd, 0x36, 0xb6, 0x8a, 0xd1, 0x69, 0x35, 0xdb, - 0xf7, 0xf4, 0xda, 0x58, 0x09, 0x26, 0x13, 0x43, 0x7a, 0xd1, 0x14, 0xc1, 0xf1, 0x28, 0x9b, 0xec, - 0xf3, 0x6f, 0xe3, 0x74, 0x49, 0x04, 0x56, 0x74, 0xfc, 0xbe, 0xb9, 0x48, 0xb8, 0xa9, 0xed, 0xe0, - 0x6b, 0x00, 0xfa, 0x09, 0x30, 0xfb, 0x3b, 0x83, 0xfa, 0x77, 0x7b, 0x7a, 0x92, 0xbd, 0x7f, 0x2e, - 0x1c, 0x6b, 0xa3, 0x0e, 0x75, 0xfa, 0xa2, 0x2e, 0x3f, 0x60, 0x74, 0xc9, 0x63, 0x23, 0x14, 0xb9, - 0xaf, 0x5e, 0x6e, 0xe0, 0x99, 0x6f, 0xc3, 0xbd, 0x0c, 0xf6, 0x08, 0x85, 0xa0, 0x3f, 0x38, 0x17, - 0x17, 0xef, 0x69, 0x88, 0xd3, 0xe1, 0xd4, 0x3a, 0xe8, 0x6a, 0xcc, 0xfd, 0xf0, 0xd9, 0x87, 0x0c, - 0x62, 0xe9, 0x0d, 0x18, 0x44, 0xa9, 0x22, 0xec, 0xc0, 0xb7, 0x54, 0x7c, 0x75, 0xc9, 0x6d, 0xb5, - 0x60, 0xea, 0x3c, 0xef, 0x8c, 0xfd, 0x43, 0xdc, 0x2c, 0xe2, 0x00, 0xff, 0x31, 0x6e, 0x16, 0x31, - 0x80, 0x6a, 0x16, 0xff, 0x34, 0x67, 0x78, 0xfb, 0xa1, 0x44, 0x69, 0xfd, 0x88, 0x8a, 0x6f, 0xf0, - 0x3f, 0x1b, 0x03, 0xec, 0x06, 0x2f, 0x06, 0xf8, 0xb0, 0xb6, 0x27, 0x94, 0x05, 0x15, 0x44, 0x44, - 0xb8, 0x1e, 0x13, 0xd2, 0xe1, 0x23, 0x9a, 0xf8, 0x40, 0xb8, 0x14, 0xee, 0x96, 0xf6, 0x52, 0x30, - 0xfb, 0x68, 0x08, 0x80, 0x3f, 0x6d, 0xc6, 0x21, 0xd0, 0x51, 0x66, 0x1f, 0xd3, 0x90, 0x14, 0x07, - 0xa0, 0xa6, 0xf4, 0x71, 0xcd, 0x94, 0xa5, 0x1c, 0x74, 0xb7, 0xa3, 0x0f, 0xf4, 0x2f, 0x1a, 0xfb, - 0x44, 0xab, 0x55, 0x2f, 0x9f, 0x98, 0x0b, 0x1f, 0x17, 0x20, 0x12, 0xbc, 0x6e, 0x27, 0x32, 0xf3, - 0x4f, 0xcd, 0x05, 0x3e, 0x3e, 0x65, 0xed, 0x83, 0x66, 0xe7, 0xb6, 0x40, 0x99, 0x7f, 0x96, 0xd6, - 0x67, 0x9f, 0xd1, 0x58, 0x01, 0x41, 0xcc, 0x6a, 0x15, 0xfd, 0x0a, 0xcd, 0x2c, 0x0c, 0x25, 0x83, - 0x5f, 0xda, 0x1e, 0x45, 0xc0, 0x54, 0x94, 0xdd, 0xdd, 0xee, 0x64, 0xdc, 0x1a, 0xbe, 0x77, 0xc7, - 0x3e, 0x6b, 0x90, 0x17, 0xd9, 0x18, 0x79, 0xfa, 0x20, 0x8a, 0xca, 0x8e, 0xc3, 0x03, 0xdb, 0xed, - 0x0e, 0xfb, 0x9c, 0xe6, 0xf4, 0xf1, 0x9e, 0x41, 0xc0, 0x36, 0x2e, 0x75, 0x7d, 0x94, 0x59, 0xd9, - 0xa6, 0xb3, 0xed, 0x83, 0xc5, 0xf2, 0x79, 0xc3, 0x33, 0x54, 0x5c, 0xc8, 0x2f, 0x63, 0xe5, 0xc1, - 0x7a, 0xc0, 0x39, 0x7e, 0x21, 0xd4, 0x13, 0x72, 0x0a, 0x57, 0x7f, 0x38, 0x9c, 0xa0, 0x89, 0x2f, - 0x6b, 0xe6, 0xa3, 0xa4, 0x1d, 0x11, 0xf7, 0xa6, 0xf3, 0xf4, 0xaf, 0xc4, 0xd0, 0x96, 0x56, 0xaf, - 0x10, 0xf2, 0xef, 0xc6, 0x8c, 0x82, 0x47, 0xff, 0x30, 0x61, 0x47, 0xbe, 0x73, 0xce, 0xbe, 0x6a, - 0x58, 0x3a, 0x01, 0x90, 0x1e, 0x7c, 0xfe, 0x5a, 0x8f, 0x8e, 0x8c, 0xf0, 0xf3, 0xd7, 0x43, 0x7b, - 0xa9, 0x38, 0x50, 0x3f, 0x63, 0x64, 0xdf, 0xd0, 0x44, 0x7a, 0x4f, 0xa8, 0x20, 0x7b, 0x25, 0x22, - 0x2a, 0xb5, 0xa3, 0x51, 0xd0, 0x6f, 0xb4, 0x67, 0xec, 0x9b, 0x11, 0x31, 0xa1, 0x41, 0xf1, 0x84, - 0x27, 0x0e, 0xf8, 0xad, 0xb9, 0x70, 0x28, 0x39, 0x02, 0x98, 0x6a, 0x36, 0x11, 0xb6, 0x01, 0xa2, - 0xed, 0xdb, 0x11, 0xb1, 0xaa, 0x41, 0xd3, 0x9f, 0xfc, 0x15, 0x93, 0xef, 0x18, 0xc2, 0x3f, 0x90, - 0x68, 0x04, 0xb2, 0xea, 0xb4, 0x40, 0x93, 0xa1, 0x54, 0xe7, 0x4e, 0xff, 0x77, 0x23, 0x73, 0xd5, - 0x80, 0xb5, 0x23, 0x5f, 0xf6, 0xbd, 0x39, 0xf3, 0x50, 0x83, 0x27, 0xb1, 0x94, 0xb4, 0xec, 0xe3, - 0xef, 0xcf, 0x19, 0xc7, 0x0d, 0x06, 0x84, 0xc0, 0xdf, 0x0f, 0x42, 0x34, 0xc9, 0x41, 0xf0, 0xe5, - 0x5b, 0xaf, 0xe9, 0xe2, 0x53, 0x47, 0xe0, 0x0b, 0xb3, 0x1f, 0xc6, 0xa8, 0x05, 0x9c, 0x92, 0x49, - 0x9b, 0xa4, 0x62, 0x7f, 0x6c, 0x84, 0x2c, 0xf4, 0xa7, 0x5d, 0xd9, 0x4f, 0xe7, 0x62, 0x0e, 0xce, - 0xd4, 0x2b, 0xac, 0xec, 0x91, 0x64, 0x4c, 0xda, 0x6f, 0xe4, 0x91, 0x56, 0xf6, 0x94, 0x64, 0x98, - 0x89, 0x84, 0xe6, 0x93, 0x4f, 0xe7, 0x62, 0x0a, 0xf1, 0x53, 0x93, 0xfa, 0xc2, 0xf5, 0x54, 0x4d, - 0x25, 0x32, 0x1e, 0x4d, 0xea, 0x54, 0x1d, 0x02, 0x11, 0x63, 0x3d, 0x2d, 0x32, 0xd6, 0x2a, 0x3e, - 0x2d, 0xb7, 0x63, 0xe4, 0xf4, 0xff, 0x72, 0x32, 0x4c, 0x81, 0xc0, 0x3d, 0x05, 0xf7, 0xb2, 0xd1, - 0x25, 0x7b, 0x2c, 0x69, 0x6e, 0x05, 0x41, 0xe5, 0x7c, 0xfd, 0x04, 0xe5, 0xe9, 0xc9, 0x50, 0x94, - 0x5c, 0xd6, 0xf0, 0xc3, 0xeb, 0x5f, 0x49, 0x86, 0x5d, 0x79, 0x14, 0x97, 0x11, 0xb0, 0x67, 0x24, - 0x75, 0xa7, 0x29, 0xf4, 0xde, 0x2c, 0x7b, 0x66, 0x52, 0xdf, 0x49, 0x63, 0x8a, 0xab, 0x4e, 0xfb, - 0x22, 0xe6, 0x05, 0xa9, 0x4b, 0x11, 0xc9, 0x98, 0x80, 0xa1, 0xb0, 0xbb, 0x30, 0x95, 0xf0, 0xd9, - 0xc9, 0x98, 0x38, 0x97, 0xa8, 0x57, 0x58, 0xfe, 0xd5, 0x64, 0x4c, 0x14, 0x2a, 0x00, 0x12, 0x78, - 0x7e, 0x4e, 0x32, 0xc6, 0x38, 0x52, 0x26, 0x8c, 0xba, 0x8d, 0xc0, 0xbb, 0xfc, 0xb5, 0x64, 0x8c, - 0x05, 0x1c, 0x05, 0x16, 0x5d, 0x3f, 0xd7, 0xd8, 0x66, 0x25, 0x73, 0x05, 0x5e, 0x78, 0xf4, 0xe3, - 0x79, 0x06, 0xca, 0x48, 0x41, 0x69, 0x01, 0x9c, 0x5f, 0x4f, 0xea, 0xe6, 0xc8, 0xae, 0x8f, 0xf2, - 0xb2, 0x17, 0x18, 0x0b, 0xd9, 0xfd, 0x35, 0x5d, 0xf6, 0xc2, 0x64, 0x58, 0x4f, 0xe6, 0x5a, 0x35, - 0xfe, 0xad, 0xd0, 0x72, 0xf0, 0x55, 0xf6, 0x4a, 0xa6, 0xc8, 0x7e, 0x23, 0x19, 0xb6, 0x88, 0xe2, - 0x20, 0xf3, 0x78, 0x5b, 0x92, 0xfd, 0x66, 0x52, 0xf7, 0x36, 0x04, 0x7a, 0xb8, 0xe4, 0xa2, 0x60, - 0x27, 0x7b, 0x51, 0x32, 0x26, 0xb4, 0xa0, 0x01, 0x04, 0xb7, 0x3e, 0x8c, 0xf9, 0xc9, 0x90, 0x69, - 0xf0, 0x64, 0x7b, 0x70, 0xf5, 0xe3, 0x25, 0x49, 0xdd, 0xbc, 0xdf, 0x05, 0x32, 0x08, 0x63, 0x45, - 0xb6, 0x05, 0x89, 0x59, 0x48, 0x15, 0x9e, 0x26, 0xc3, 0x5e, 0x6a, 0x20, 0x33, 0x5e, 0x39, 0x05, - 0x17, 0x4a, 0x0c, 0x6a, 0x8d, 0xc6, 0xd7, 0x5e, 0x96, 0xd4, 0x73, 0xdc, 0x82, 0x7a, 0xf6, 0xb8, - 0xc1, 0x75, 0x41, 0x05, 0xbf, 0x63, 0xc1, 0x5e, 0x9e, 0x8c, 0xe6, 0xd5, 0x06, 0xd5, 0x41, 0x2a, - 0x4c, 0x32, 0x26, 0x89, 0x42, 0xe6, 0x62, 0xd0, 0xbe, 0xbc, 0x22, 0x19, 0x93, 0x44, 0xa1, 0x43, - 0xa8, 0xbe, 0x5e, 0x19, 0x25, 0x59, 0x05, 0x29, 0x1c, 0x47, 0xf6, 0xbb, 0x11, 0x8a, 0x88, 0xc0, - 0x04, 0x97, 0x4b, 0x76, 0xeb, 0x4f, 0xe4, 0xa2, 0xbc, 0x7a, 0xb7, 0xfe, 0x42, 0x19, 0x8d, 0xbf, - 0xa7, 0xad, 0x44, 0x28, 0xe8, 0x73, 0xae, 0x7b, 0x11, 0x36, 0x87, 0x1c, 0x14, 0x57, 0x31, 0x23, - 0x7b, 0x4d, 0xd2, 0x34, 0xcb, 0x7a, 0x80, 0xbd, 0xd6, 0xd8, 0x68, 0x0c, 0x03, 0xe1, 0xb7, 0x04, - 0x82, 0x48, 0xea, 0xaa, 0xa7, 0x39, 0x67, 0xaf, 0x33, 0xd8, 0xbf, 0x27, 0xb0, 0x8c, 0x52, 0x19, - 0xf2, 0xce, 0x84, 0x46, 0x6f, 0xb1, 0x11, 0x74, 0xfc, 0x06, 0x03, 0x05, 0x3d, 0x40, 0x65, 0x64, - 0xca, 0x90, 0xe6, 0x0f, 0x76, 0x1b, 0xb5, 0x8b, 0x74, 0x0b, 0x52, 0x01, 0xef, 0xb0, 0x3f, 0x30, - 0x46, 0x8e, 0x03, 0x09, 0x2e, 0xa9, 0x24, 0x63, 0xbd, 0xb3, 0xc0, 0x52, 0x4e, 0x71, 0x43, 0xec, - 0x4d, 0x1a, 0x6b, 0xab, 0x8c, 0x55, 0xdd, 0x9e, 0x7e, 0xb3, 0xc6, 0xda, 0x71, 0x00, 0x6a, 0xc4, - 0xb7, 0x68, 0x23, 0x0a, 0x40, 0x1c, 0xb1, 0xd2, 0x85, 0x3f, 0x77, 0xb4, 0x34, 0xbd, 0xb7, 0x26, - 0x03, 0x27, 0x68, 0x17, 0xb8, 0x20, 0x32, 0x95, 0x0c, 0x67, 0x1c, 0x01, 0xf1, 0x5c, 0x6a, 0xd4, - 0x5d, 0xde, 0x42, 0x64, 0xd5, 0xfe, 0x61, 0x32, 0x6c, 0xe1, 0x50, 0xc4, 0x2c, 0xe0, 0x6f, 0x69, - 0x79, 0xbe, 0x3d, 0xa2, 0x7f, 0x45, 0xda, 0x46, 0xee, 0x01, 0x3c, 0xe9, 0x7d, 0x90, 0x67, 0xee, - 0x24, 0x7b, 0x9b, 0xa7, 0x3c, 0x6e, 0x5d, 0x67, 0xef, 0x48, 0x9a, 0x1e, 0x90, 0x19, 0x7d, 0x6c, - 0xb4, 0x94, 0xd2, 0xfb, 0xe3, 0x10, 0x6d, 0xc7, 0x00, 0xca, 0xab, 0x2d, 0x49, 0xdd, 0xd0, 0xd1, - 0xbf, 0xb5, 0xc0, 0xfe, 0xc4, 0xd0, 0x27, 0xa1, 0x2f, 0x29, 0xb0, 0x3f, 0x35, 0x68, 0x27, 0xee, - 0x1b, 0x03, 0xec, 0xcf, 0x0c, 0x59, 0xb1, 0xcb, 0x67, 0x08, 0xd8, 0x9f, 0x27, 0xc3, 0x96, 0x59, - 0x2c, 0xe9, 0x40, 0x2d, 0x7b, 0x97, 0xb6, 0xe7, 0xc1, 0xeb, 0x82, 0xd5, 0xb6, 0x53, 0xbb, 0x98, - 0x69, 0x38, 0x4d, 0x6f, 0x43, 0xec, 0xce, 0xbb, 0x93, 0xf1, 0x07, 0x8a, 0xd2, 0xd4, 0x93, 0xa8, - 0xfa, 0x8b, 0x64, 0x7c, 0x88, 0x3a, 0x80, 0x93, 0x09, 0x3c, 0x71, 0x92, 0x2f, 0x66, 0xbb, 0x7d, - 0xf6, 0x57, 0x86, 0x1e, 0xd9, 0x05, 0x32, 0x08, 0x13, 0x69, 0xeb, 0x0f, 0x2e, 0x01, 0x8b, 0x04, - 0x57, 0xba, 0xa0, 0x25, 0xdf, 0xd1, 0x60, 0x7f, 0x1d, 0xa2, 0x3a, 0x89, 0x03, 0x3d, 0xa6, 0x82, - 0xd1, 0x30, 0xf6, 0x37, 0x1a, 0x11, 0x57, 0x1e, 0xcc, 0xd3, 0x37, 0xe7, 0xdc, 0xba, 0x66, 0x36, - 0x10, 0xd4, 0x7b, 0xa2, 0xbc, 0x26, 0xa8, 0xb3, 0x22, 0xbf, 0xa2, 0x48, 0x11, 0x05, 0xf6, 0xde, - 0x64, 0x10, 0x83, 0x23, 0x27, 0x17, 0xaf, 0x10, 0x67, 0x60, 0xff, 0x76, 0x90, 0x86, 0xb5, 0x47, - 0x15, 0x45, 0xa0, 0x28, 0x19, 0x13, 0xb2, 0xd3, 0x4e, 0xbb, 0x42, 0xe9, 0x58, 0xef, 0x4b, 0xea, - 0x61, 0x8a, 0x5d, 0xc0, 0xe5, 0x5d, 0xa3, 0x64, 0xf8, 0xdc, 0x50, 0xbe, 0xa1, 0xba, 0xd6, 0x6a, - 0x7a, 0xb5, 0x8b, 0xec, 0xfd, 0xc9, 0xe0, 0xac, 0x4b, 0x04, 0x2f, 0x28, 0xa2, 0x4b, 0xca, 0xf2, - 0x03, 0xda, 0x56, 0x06, 0x34, 0x24, 0x7b, 0xd0, 0x1d, 0xc2, 0x0f, 0x86, 0xec, 0x5d, 0x71, 0x71, - 0x4a, 0x83, 0x64, 0x1f, 0x4a, 0x26, 0x16, 0xad, 0x64, 0x6c, 0x04, 0xbd, 0x4a, 0x6f, 0x68, 0x87, - 0x63, 0x78, 0x69, 0xf9, 0x8d, 0x5f, 0x11, 0xb2, 0xfe, 0xfb, 0x64, 0xd8, 0x59, 0xe3, 0x26, 0x9b, - 0xa9, 0x66, 0xe4, 0x8c, 0xfe, 0x21, 0x19, 0x3e, 0x39, 0x8b, 0x87, 0x16, 0x88, 0xfa, 0xc7, 0x88, - 0x46, 0xe4, 0xe0, 0x94, 0xfb, 0xdd, 0xa8, 0xd1, 0xd9, 0x9f, 0xec, 0xfa, 0xc3, 0xc9, 0xb0, 0x7f, - 0x17, 0x07, 0x2b, 0x3a, 0xfe, 0x88, 0xa6, 0x14, 0x81, 0xbc, 0xf8, 0x15, 0xec, 0x62, 0x2b, 0x34, - 0x0f, 0xf6, 0xd1, 0x58, 0x54, 0x63, 0x4e, 0xa2, 0xf9, 0xfe, 0xbe, 0xcf, 0x3e, 0x16, 0x0b, 0xb9, - 0x12, 0x03, 0xf9, 0x71, 0x8d, 0xbf, 0x76, 0x85, 0x0c, 0x52, 0xab, 0xb4, 0xbe, 0x03, 0xfe, 0x8a, - 0xeb, 0xfb, 0x13, 0x5a, 0xdf, 0xbb, 0x42, 0x06, 0x6f, 0x0c, 0x68, 0x12, 0xd4, 0x7c, 0x92, 0x9f, - 0x7d, 0x2a, 0x69, 0x06, 0x86, 0xa2, 0xaf, 0xf5, 0xb3, 0x4f, 0xeb, 0x33, 0x7b, 0x30, 0xaf, 0x09, - 0x3f, 0x70, 0xd0, 0x91, 0xb3, 0x40, 0xf3, 0x6c, 0xb4, 0xd1, 0xbc, 0xff, 0x9f, 0x1a, 0xa7, 0x9a, - 0xab, 0x0e, 0x01, 0x7e, 0x26, 0x19, 0x84, 0x87, 0x76, 0x03, 0x0c, 0x5e, 0x38, 0x88, 0xe8, 0xa7, - 0x15, 0xb4, 0x4d, 0x71, 0xf1, 0xcb, 0xc0, 0xfe, 0xd4, 0x05, 0xfb, 0xb7, 0x08, 0x71, 0x44, 0x81, - 0x82, 0x7b, 0x53, 0x1a, 0xd5, 0xc1, 0xaa, 0x84, 0x6b, 0x6b, 0x5e, 0x54, 0x12, 0xdf, 0x5a, 0x64, - 0x9f, 0xd3, 0x14, 0x1f, 0x62, 0x80, 0x42, 0xc4, 0xf4, 0xec, 0x73, 0xd5, 0x13, 0xa6, 0x1b, 0xfb, - 0xbc, 0x06, 0x63, 0x2c, 0x89, 0x03, 0x92, 0x4f, 0xf8, 0x05, 0x6d, 0xcc, 0x1e, 0x30, 0x6a, 0x7e, - 0x5f, 0x0c, 0xd9, 0x92, 0x02, 0x9e, 0x00, 0x53, 0xfc, 0x12, 0x06, 0xfb, 0x92, 0x61, 0x0b, 0xe3, - 0x8c, 0x97, 0xbc, 0x8e, 0xf1, 0x08, 0xc5, 0x97, 0x93, 0x7a, 0x3a, 0x50, 0x0c, 0x44, 0x34, 0xbc, - 0xfa, 0x15, 0x8d, 0x58, 0x04, 0xd0, 0x92, 0xc7, 0x85, 0xd2, 0xbf, 0xf7, 0xb0, 0x12, 0xb4, 0xc7, - 0xac, 0x7d, 0xf6, 0x55, 0x0d, 0xc8, 0x58, 0xa4, 0x06, 0xc5, 0xbe, 0xa6, 0x6d, 0x55, 0x2f, 0xa0, - 0x20, 0x9a, 0xa5, 0xf5, 0x68, 0x10, 0xbc, 0xde, 0xe3, 0x37, 0xb4, 0x1e, 0x7b, 0x01, 0x05, 0xb1, - 0xac, 0x5e, 0x2c, 0xaf, 0x01, 0xe3, 0xd3, 0x07, 0x3e, 0xfb, 0x66, 0xac, 0x2e, 0xd3, 0xc0, 0xc4, - 0x23, 0xd2, 0xec, 0x5b, 0x11, 0x2d, 0x85, 0x5d, 0x9e, 0xa5, 0x2f, 0x3c, 0xec, 0x94, 0xda, 0x6e, - 0xbd, 0x21, 0x54, 0xef, 0xb7, 0x35, 0xe9, 0x18, 0x8c, 0x8d, 0x31, 0x01, 0x3d, 0x48, 0xc0, 0x69, - 0xc1, 0xa9, 0xb3, 0xef, 0x86, 0xec, 0x0e, 0xf5, 0x90, 0xb5, 0x0e, 0x0d, 0x9c, 0x0f, 0x53, 0xf8, - 0x5e, 0xec, 0x14, 0xf0, 0x1c, 0xb7, 0x51, 0xc3, 0xaf, 0x46, 0xa2, 0x85, 0x72, 0xa9, 0xd1, 0xd9, - 0x61, 0xdf, 0xd7, 0x8d, 0x52, 0xbe, 0xc5, 0x18, 0x80, 0xea, 0xb6, 0x44, 0x77, 0x95, 0xee, 0xd6, - 0x96, 0x03, 0xe6, 0xd5, 0x0f, 0x62, 0x71, 0x6a, 0x3c, 0xfc, 0x61, 0x2b, 0x9c, 0xfe, 0x30, 0x19, - 0xbe, 0xbc, 0x1b, 0x88, 0xe7, 0xe0, 0xab, 0x6e, 0xec, 0x47, 0x21, 0x26, 0xe5, 0xa0, 0x01, 0x80, - 0x3a, 0xfc, 0x46, 0x0b, 0xe9, 0xc7, 0x86, 0x85, 0x84, 0xe0, 0xf9, 0x54, 0x81, 0xcf, 0xc4, 0xb8, - 0x39, 0xfe, 0x1f, 0xd1, 0x05, 0xa5, 0x7c, 0x1f, 0x1f, 0x7c, 0x69, 0xad, 0x36, 0x5a, 0x0d, 0x15, - 0x33, 0xfb, 0x49, 0x2c, 0x86, 0x80, 0x48, 0x72, 0xf4, 0x29, 0x54, 0x32, 0xe6, 0x48, 0x63, 0xfe, - 0x34, 0x19, 0x3e, 0xc4, 0xe0, 0xfb, 0x1c, 0x82, 0x53, 0x7a, 0x93, 0x3d, 0x32, 0x6f, 0xea, 0x3c, - 0xde, 0x7b, 0x08, 0xdc, 0x2e, 0x82, 0xea, 0x6d, 0xba, 0xa5, 0x14, 0x7b, 0xca, 0x7c, 0x9c, 0xb4, - 0xe7, 0xa9, 0x22, 0xf8, 0xca, 0x18, 0xdf, 0x01, 0x8c, 0x7c, 0x3e, 0x75, 0x3e, 0x1c, 0xf4, 0x8a, - 0x83, 0x7a, 0x74, 0x3e, 0x3e, 0x94, 0xa9, 0x63, 0x01, 0xa7, 0xc2, 0x9e, 0x36, 0x1f, 0xf6, 0x80, - 0x62, 0x3f, 0x89, 0xc5, 0x7e, 0x79, 0x3e, 0x4e, 0x54, 0x95, 0xe9, 0x2b, 0xa2, 0x9a, 0x9d, 0x48, - 0xf6, 0xde, 0x63, 0xf3, 0xba, 0xd9, 0xa9, 0xe7, 0x1c, 0x86, 0xaf, 0x76, 0x3e, 0x7d, 0x3e, 0x3e, - 0x91, 0x31, 0x26, 0x8b, 0xee, 0x57, 0xe6, 0xc3, 0xb6, 0xac, 0x71, 0x36, 0xa5, 0x31, 0xd4, 0x33, - 0xe6, 0xcd, 0x70, 0x9d, 0x88, 0xbd, 0x2a, 0x08, 0x41, 0x4b, 0xcf, 0x9c, 0x8f, 0x53, 0x9b, 0xfa, - 0x81, 0x49, 0xa0, 0x3f, 0xd1, 0xee, 0xf4, 0xd9, 0xb3, 0xe6, 0xc3, 0x56, 0xcf, 0x6e, 0xd0, 0xcf, - 0x9e, 0x8f, 0x93, 0x14, 0xb4, 0xf7, 0x9c, 0x55, 0xa4, 0x8b, 0xf4, 0xab, 0xf3, 0x7a, 0x1c, 0x24, - 0xfc, 0x45, 0x37, 0xf6, 0x9c, 0x79, 0x5d, 0xa8, 0xc7, 0x7c, 0xab, 0x8d, 0xfd, 0x5a, 0x64, 0x5e, - 0xfc, 0x5e, 0xce, 0xaa, 0xd7, 0x42, 0x64, 0x9e, 0x75, 0x9a, 0x8d, 0x3a, 0xf1, 0x10, 0x5d, 0xd6, - 0x79, 0xde, 0x7c, 0x60, 0x66, 0x86, 0xbf, 0x7d, 0xc9, 0x5e, 0x30, 0x1f, 0x0e, 0x75, 0xa2, 0x1f, - 0xa0, 0x5c, 0x7c, 0xee, 0x02, 0xf9, 0xec, 0x85, 0xf3, 0x61, 0x8b, 0x2e, 0x0e, 0x2c, 0xb8, 0x43, - 0x36, 0x6f, 0x5a, 0x74, 0xbb, 0x3c, 0xbe, 0xcf, 0x7e, 0x73, 0x3e, 0x1c, 0xae, 0x0d, 0xfa, 0x15, - 0xaf, 0xfc, 0xbf, 0x28, 0x42, 0xdc, 0x21, 0xd7, 0x0b, 0xd4, 0x36, 0xe5, 0xf2, 0xbc, 0x78, 0x3e, - 0xec, 0xa3, 0x55, 0x84, 0x57, 0xbe, 0xba, 0x5a, 0x72, 0x40, 0xba, 0x2d, 0x37, 0xbb, 0xfe, 0x26, - 0x1e, 0x14, 0xb1, 0x97, 0xe8, 0x58, 0xc6, 0xd7, 0x2e, 0x78, 0x34, 0xbe, 0xed, 0xf8, 0x9b, 0xe2, - 0x3d, 0x84, 0xdf, 0xd2, 0x09, 0x30, 0x0e, 0x22, 0xb8, 0x56, 0x16, 0x22, 0x55, 0x91, 0x3f, 0xd3, - 0x11, 0xd7, 0xfb, 0x37, 0xc0, 0x92, 0x16, 0xee, 0xe6, 0x6f, 0xcf, 0xc7, 0x1e, 0x37, 0xd3, 0x14, - 0x29, 0x24, 0xe8, 0x6f, 0x36, 0xb6, 0xd9, 0xcb, 0x22, 0xa4, 0x8f, 0x21, 0x3b, 0x61, 0x68, 0xf8, - 0xfa, 0xf6, 0x3d, 0xde, 0x83, 0x4b, 0x63, 0x9e, 0x92, 0x67, 0x2f, 0xd7, 0x60, 0x75, 0x91, 0x13, - 0x07, 0xfb, 0x3b, 0xc6, 0x06, 0xee, 0xfa, 0x34, 0x3d, 0x7b, 0x85, 0xb6, 0x3b, 0x42, 0xf6, 0xea, - 0x9c, 0x1a, 0x74, 0xfa, 0xca, 0xf9, 0x38, 0xc3, 0x00, 0x95, 0x6e, 0x70, 0xda, 0xc7, 0x7e, 0x77, - 0x3e, 0xce, 0x84, 0xe4, 0xa7, 0xf6, 0x04, 0x27, 0xb2, 0x83, 0xd8, 0xab, 0xe6, 0xa3, 0xc7, 0x51, - 0x3c, 0x19, 0x04, 0x93, 0x33, 0xa5, 0x55, 0xf6, 0x6a, 0x8d, 0x70, 0xa5, 0xe5, 0xa6, 0xa5, 0xb8, - 0x54, 0x3d, 0xbe, 0x31, 0xa7, 0xbd, 0x66, 0x1d, 0xdf, 0x90, 0x7a, 0xcd, 0x7c, 0x9c, 0xd9, 0x5e, - 0xd9, 0xc5, 0xb4, 0x7e, 0x6d, 0x84, 0xe4, 0x4c, 0x2f, 0xaf, 0xe0, 0x95, 0x01, 0x77, 0xf8, 0x32, - 0x24, 0x7b, 0x5d, 0x2c, 0xaf, 0x29, 0x59, 0x2a, 0x6f, 0x6a, 0xbf, 0x5e, 0x5b, 0x58, 0xb0, 0x4f, - 0x38, 0x43, 0x7d, 0xe7, 0xdf, 0xa0, 0x2b, 0x10, 0xf9, 0xa4, 0x18, 0xa5, 0x78, 0x07, 0x50, 0xd8, - 0xc6, 0x67, 0xbf, 0x3f, 0x1f, 0x36, 0xda, 0xf0, 0x8c, 0x12, 0x98, 0x11, 0x59, 0xa6, 0xe2, 0xf2, - 0xf0, 0xd3, 0x1f, 0xcc, 0x87, 0xc3, 0x49, 0xc6, 0xbd, 0x92, 0x0a, 0x7d, 0x8f, 0x9a, 0xbd, 0x51, - 0x13, 0x3c, 0x3d, 0xa1, 0x14, 0x6a, 0xde, 0x34, 0x1f, 0xe8, 0x50, 0xe5, 0x37, 0x08, 0x09, 0xaa, - 0xc7, 0x9f, 0x55, 0x74, 0xf2, 0xcd, 0x21, 0xb1, 0x21, 0x2f, 0xa8, 0x87, 0xb2, 0x4c, 0xf0, 0xc9, - 0x53, 0xf6, 0x96, 0xf9, 0x38, 0x6b, 0x83, 0x1e, 0x38, 0x58, 0x71, 0xb7, 0xf0, 0x6b, 0x60, 0x0d, - 0x8c, 0xde, 0xbe, 0x35, 0x9e, 0x9c, 0xc8, 0xc6, 0x40, 0xa9, 0xdc, 0xa8, 0x81, 0x4a, 0x6b, 0x6c, - 0xbb, 0xec, 0x6d, 0xf3, 0x71, 0x1e, 0x49, 0x14, 0x50, 0xad, 0xee, 0x0f, 0x7b, 0x61, 0x4c, 0xb8, - 0x30, 0xc5, 0x36, 0x92, 0xf3, 0xdb, 0x7b, 0x61, 0x4c, 0x87, 0x0a, 0xee, 0xd0, 0xcd, 0x1b, 0xf1, - 0x10, 0x4d, 0x42, 0x2c, 0xe1, 0xb7, 0x7c, 0xc4, 0xd6, 0xff, 0x51, 0x44, 0x85, 0x07, 0x11, 0x64, - 0x6e, 0xda, 0x73, 0xa7, 0xfd, 0x1d, 0xf3, 0xe1, 0x0b, 0x32, 0xb1, 0x70, 0x41, 0x8e, 0x97, 0xa1, - 0x97, 0x32, 0xee, 0x25, 0x9b, 0x86, 0x3e, 0xe7, 0xb4, 0xd1, 0xd6, 0x60, 0xef, 0x5e, 0xe8, 0x8d, - 0x4a, 0xfd, 0xcb, 0xb7, 0xec, 0x2f, 0x16, 0x4c, 0x65, 0x21, 0xd3, 0x9a, 0x02, 0x10, 0xc3, 0xc6, - 0xfb, 0xcb, 0x05, 0xcd, 0x4b, 0x57, 0xf4, 0x9e, 0x07, 0xde, 0x01, 0x3a, 0x6d, 0x53, 0xd6, 0x0e, - 0x9e, 0x69, 0xfe, 0xd5, 0x82, 0x19, 0xe1, 0x4e, 0x17, 0xce, 0x9f, 0x3c, 0x7e, 0xe2, 0x89, 0x01, - 0xb5, 0xaf, 0x51, 0x9a, 0xd2, 0xff, 0x88, 0x9d, 0xa5, 0x96, 0xea, 0x2d, 0xdd, 0x9c, 0xbf, 0x5e, - 0x88, 0x13, 0xda, 0x06, 0xa0, 0xc0, 0xcb, 0xdf, 0x2c, 0x18, 0x27, 0xee, 0xf8, 0x9e, 0x85, 0x19, - 0x42, 0xc1, 0x5b, 0x63, 0xef, 0x59, 0x08, 0xe4, 0x40, 0x30, 0x2e, 0xc6, 0x31, 0xab, 0xde, 0x76, - 0x85, 0xce, 0x64, 0xaa, 0x67, 0xf9, 0xd3, 0x4c, 0xef, 0x5d, 0xd0, 0x7d, 0x32, 0x39, 0x72, 0x1c, - 0x68, 0x70, 0xdf, 0x6d, 0xc1, 0x78, 0xd0, 0x44, 0x3d, 0x17, 0xf7, 0xbe, 0x05, 0xe3, 0x41, 0x93, - 0xc8, 0x3d, 0x97, 0xbf, 0x5b, 0x30, 0x9e, 0x81, 0x0b, 0x16, 0x67, 0x38, 0x89, 0xef, 0xd7, 0x26, - 0xa4, 0xed, 0xac, 0xa9, 0x86, 0x79, 0x8c, 0x4d, 0x62, 0xef, 0x03, 0x0b, 0x89, 0x93, 0xd6, 0xbd, - 0xe1, 0x35, 0xf4, 0x68, 0x22, 0x26, 0xf3, 0xc1, 0xd8, 0x61, 0x2a, 0x5e, 0xad, 0xe1, 0x34, 0x97, - 0x5d, 0xb7, 0x8e, 0xb7, 0x47, 0xf8, 0x27, 0x7f, 0xd4, 0x30, 0x1f, 0x8a, 0x1d, 0xa6, 0x47, 0x13, - 0x99, 0xd4, 0xb4, 0x10, 0x5c, 0x62, 0x88, 0x5b, 0x8d, 0xcf, 0x73, 0x51, 0xc4, 0x27, 0x84, 0x54, - 0xcc, 0x6a, 0x21, 0xf1, 0x44, 0xeb, 0x78, 0xef, 0x05, 0x85, 0x5b, 0xc9, 0xd8, 0xd5, 0x42, 0x70, - 0xf7, 0x41, 0xdb, 0x76, 0x1d, 0x36, 0xe8, 0x43, 0x8e, 0xf5, 0x4f, 0x0b, 0xc6, 0x4b, 0x3e, 0x92, - 0x00, 0x7a, 0x35, 0x12, 0x43, 0xfd, 0xf3, 0x42, 0x9c, 0xae, 0x97, 0xb7, 0x95, 0xf9, 0xd3, 0x32, - 0x2a, 0x4c, 0xb6, 0x10, 0xe7, 0x64, 0x85, 0x61, 0x65, 0x98, 0x6c, 0xc1, 0x0c, 0x54, 0x86, 0xbf, - 0xe5, 0xc2, 0x3e, 0xaa, 0xed, 0x42, 0x78, 0xe3, 0xf8, 0x87, 0xa5, 0xa3, 0x3b, 0xf7, 0xb1, 0x05, - 0xfd, 0x52, 0x88, 0xb9, 0x73, 0xd1, 0x36, 0x32, 0x2b, 0x6a, 0x21, 0x90, 0x58, 0xb1, 0x03, 0x85, - 0x42, 0xb2, 0xff, 0xb2, 0x60, 0x7a, 0x69, 0x91, 0x41, 0xc2, 0x31, 0xd9, 0x4f, 0x2c, 0x04, 0xc6, - 0x66, 0xd4, 0x04, 0xc1, 0x3b, 0x75, 0xec, 0x93, 0x0b, 0x71, 0x8a, 0x65, 0xd5, 0x6d, 0x6f, 0xb8, - 0x9a, 0xfd, 0xc1, 0x3e, 0xb5, 0x10, 0x67, 0xe2, 0x12, 0x18, 0x3d, 0xa4, 0x2a, 0xef, 0xfc, 0x82, - 0x3e, 0x62, 0x9f, 0x8e, 0x95, 0x49, 0x41, 0x97, 0xc1, 0x15, 0xc5, 0x05, 0xd3, 0xb0, 0xd7, 0x3a, - 0x35, 0x00, 0x79, 0xb7, 0x9f, 0x59, 0xe8, 0x11, 0x8d, 0xd4, 0x83, 0x18, 0xe4, 0xa0, 0xfd, 0xeb, - 0x42, 0x8f, 0x68, 0x64, 0x18, 0x32, 0xc8, 0xdf, 0x5a, 0x88, 0xd3, 0x5b, 0xf8, 0x32, 0x75, 0x60, - 0x3c, 0x05, 0xe4, 0xf6, 0xd9, 0x5e, 0xd0, 0x9c, 0xa6, 0x43, 0xd0, 0x9f, 0x8b, 0x5d, 0x65, 0x78, - 0x2a, 0xd2, 0x3f, 0xf8, 0xe2, 0x42, 0xfc, 0xe3, 0xa3, 0xfc, 0xe9, 0x64, 0xbe, 0xbe, 0x2f, 0x85, - 0xc8, 0x5d, 0x46, 0x08, 0x34, 0x18, 0x3a, 0x0b, 0xc0, 0x37, 0x3f, 0xd9, 0x97, 0x17, 0x62, 0xcc, - 0x30, 0xde, 0xc2, 0x57, 0x61, 0x42, 0x9f, 0x7d, 0x75, 0x21, 0xc6, 0xe5, 0x89, 0x80, 0x29, 0x84, - 0x7d, 0x6d, 0xa1, 0xe7, 0x13, 0x67, 0xf8, 0x48, 0x15, 0xbe, 0xad, 0x48, 0x7a, 0xe2, 0xeb, 0x0b, - 0x66, 0xbc, 0x55, 0xe4, 0x8b, 0xf1, 0x3c, 0x44, 0x7e, 0x8c, 0xf1, 0x0d, 0x4d, 0x95, 0xc4, 0x83, - 0x04, 0x71, 0xac, 0xab, 0x10, 0xa9, 0x22, 0x07, 0x44, 0x62, 0xff, 0x9b, 0x57, 0x21, 0x52, 0x55, - 0x13, 0xf9, 0xe8, 0x90, 0xc6, 0x67, 0x81, 0x70, 0x40, 0xd9, 0xe0, 0xb6, 0xc4, 0xeb, 0x40, 0x88, - 0x5e, 0xb7, 0x8e, 0x8f, 0xfa, 0xa0, 0xb2, 0xfe, 0xb6, 0x2e, 0xab, 0x82, 0x7b, 0x3a, 0x52, 0xd1, - 0x35, 0xfc, 0xcd, 0x00, 0xf6, 0x3b, 0x06, 0x13, 0x9b, 0xef, 0xae, 0x36, 0x3d, 0x3f, 0x72, 0x36, - 0xc1, 0xbe, 0x6b, 0xa0, 0x3a, 0xf2, 0x4e, 0xac, 0x9a, 0xf5, 0xf7, 0x34, 0x54, 0x2b, 0x6b, 0x8a, - 0x93, 0x15, 0x4a, 0xc0, 0xd5, 0xd5, 0x32, 0xfb, 0xfe, 0x42, 0x2f, 0x83, 0x4b, 0xbb, 0x93, 0xc3, - 0x7e, 0xb0, 0xd0, 0x3b, 0xe5, 0x80, 0x2e, 0xed, 0xb0, 0x1f, 0x2e, 0xf4, 0x4e, 0x39, 0x20, 0x08, - 0x35, 0xa9, 0x1f, 0x2d, 0x04, 0x27, 0x96, 0x42, 0xff, 0x9e, 0x03, 0x54, 0x8b, 0x6b, 0x68, 0x3f, - 0x8e, 0x37, 0x9d, 0x22, 0x6c, 0x27, 0x5f, 0x3c, 0xea, 0x05, 0x1e, 0xe2, 0x3b, 0x79, 0xcf, 0x31, - 0x56, 0x83, 0x08, 0x28, 0x8c, 0x10, 0x6d, 0x39, 0x2a, 0x8b, 0xfa, 0xa7, 0x0b, 0x71, 0x01, 0xda, - 0x30, 0xac, 0xe8, 0xf8, 0x91, 0xc5, 0x18, 0x8b, 0x54, 0x30, 0xb4, 0x6e, 0xb9, 0x3e, 0x65, 0x31, - 0xc6, 0x22, 0x8d, 0xc2, 0x05, 0x37, 0x29, 0x17, 0xe3, 0x42, 0x2a, 0xc8, 0x0f, 0x65, 0x77, 0x03, - 0x63, 0x3f, 0x59, 0xca, 0x1c, 0xa8, 0xb3, 0x47, 0x17, 0x03, 0xd3, 0x55, 0xb3, 0xfa, 0xf0, 0xd1, - 0x70, 0x8c, 0xe6, 0x3d, 0x6d, 0x31, 0x2e, 0xda, 0x16, 0xa7, 0x51, 0x7e, 0x79, 0xd1, 0x74, 0xe7, - 0x38, 0x74, 0xac, 0x2e, 0x79, 0x6c, 0x31, 0x2c, 0x47, 0xb2, 0x2d, 0x1f, 0xd4, 0xab, 0xbc, 0xe3, - 0xc8, 0x6f, 0x7a, 0xb3, 0xa7, 0x2f, 0x86, 0xe5, 0x48, 0x1c, 0x58, 0x10, 0xf6, 0x5a, 0x8c, 0x3b, - 0x3b, 0x0e, 0xd0, 0x24, 0x23, 0x32, 0xcf, 0x58, 0x8c, 0x53, 0x95, 0x11, 0xb8, 0xe0, 0x26, 0x65, - 0x2c, 0x2a, 0xa3, 0x0f, 0x7f, 0xb3, 0x67, 0x2d, 0xc6, 0xf9, 0x35, 0xa7, 0x4f, 0x9e, 0x7a, 0x60, - 0x0d, 0xe6, 0xbd, 0x8d, 0x81, 0x0f, 0x40, 0xf8, 0xb3, 0x17, 0xe3, 0x54, 0x9a, 0xc0, 0x22, 0x02, - 0x57, 0x38, 0x28, 0xfb, 0xd5, 0xc5, 0x38, 0x75, 0x0a, 0xf3, 0xa4, 0x94, 0x02, 0x75, 0x20, 0xf4, - 0x9c, 0xc5, 0xb8, 0xa0, 0x78, 0x18, 0x2c, 0x88, 0x80, 0x2d, 0x46, 0xce, 0x28, 0x1e, 0x2a, 0xa5, - 0x3d, 0xfc, 0x82, 0xe4, 0x73, 0x17, 0x4d, 0x77, 0x57, 0x5b, 0x28, 0x42, 0xba, 0x75, 0xb4, 0x78, - 0x9f, 0xb7, 0x68, 0x1c, 0x9c, 0xa8, 0xeb, 0xec, 0xea, 0x09, 0x73, 0xf6, 0xfc, 0x45, 0xe3, 0x95, - 0x92, 0x28, 0x44, 0x70, 0xb9, 0x32, 0x76, 0xc7, 0xe8, 0x22, 0x5e, 0xc7, 0xe5, 0xef, 0xb6, 0x90, - 0xc5, 0xf0, 0x82, 0x58, 0xc4, 0x6a, 0x70, 0xf4, 0x36, 0xec, 0x8b, 0x62, 0x11, 0xab, 0x41, 0xd1, - 0xbb, 0x55, 0x78, 0xdb, 0xf1, 0x4a, 0xc3, 0x66, 0x5c, 0x82, 0x7b, 0xc9, 0x62, 0xac, 0x9f, 0x13, - 0xc0, 0x05, 0x99, 0x62, 0x8b, 0x71, 0x2c, 0x6f, 0x2c, 0x24, 0xc8, 0xf2, 0x7a, 0xe9, 0x62, 0xbc, - 0x12, 0x0f, 0x01, 0xcb, 0x9c, 0xb1, 0xc5, 0x38, 0x03, 0x24, 0x8f, 0x97, 0x11, 0x3a, 0x4b, 0xee, - 0xa6, 0x73, 0xa9, 0xe1, 0xa9, 0xe7, 0x75, 0x79, 0xff, 0x8f, 0x2f, 0xc6, 0xf9, 0x53, 0x71, 0x2d, - 0xd8, 0xcb, 0x17, 0xa7, 0xd6, 0xac, 0x83, 0x59, 0x4c, 0x06, 0xc0, 0x1b, 0xeb, 0xc0, 0xf4, 0x67, - 0xf1, 0x0b, 0xd5, 0xc2, 0xa8, 0x0d, 0x17, 0xdb, 0x05, 0x8f, 0x64, 0xc2, 0x4f, 0xfe, 0x5b, 0x2f, - 0x00, 0xf1, 0x7d, 0xf1, 0x9f, 0xfe, 0xb7, 0xa9, 0x77, 0x0d, 0x5a, 0xfb, 0xe9, 0x1b, 0xe1, 0x32, - 0xdd, 0x09, 0xbf, 0x91, 0xc8, 0x0b, 0x52, 0xab, 0xd9, 0xd5, 0x62, 0x26, 0x6b, 0x17, 0x8a, 0x85, - 0x2c, 0xbb, 0x06, 0xbf, 0xa8, 0x68, 0x96, 0xa7, 0x4a, 0xfc, 0x3b, 0x8b, 0x66, 0x69, 0x7a, 0x95, - 0xf5, 0x47, 0x4b, 0xcb, 0x19, 0xfe, 0xdd, 0x53, 0xb3, 0xb4, 0x92, 0x61, 0x83, 0x31, 0xfd, 0x96, - 0xd9, 0x10, 0x7e, 0x91, 0xd1, 0x2c, 0xcd, 0x15, 0xaa, 0xe5, 0x22, 0x1b, 0x8e, 0x82, 0x9f, 0x3e, - 0xc7, 0xf6, 0x80, 0xc2, 0x19, 0x0f, 0x0d, 0x98, 0x3d, 0x9b, 0x2d, 0x57, 0x68, 0x3a, 0x23, 0xd1, - 0x25, 0x3d, 0xb4, 0x9a, 0xaa, 0xb0, 0xbd, 0xf8, 0x65, 0x55, 0xb3, 0xbc, 0xba, 0x56, 0x2d, 0x96, - 0x73, 0xa9, 0x3c, 0xb3, 0xa2, 0xe3, 0xac, 0x16, 0xd9, 0x68, 0xb4, 0x34, 0x5f, 0x62, 0xfb, 0xa2, - 0x93, 0x2d, 0x15, 0x8b, 0xf9, 0x13, 0x6c, 0x7f, 0x14, 0x7c, 0xf9, 0x34, 0x1b, 0xc3, 0xef, 0x75, - 0x86, 0x70, 0xb6, 0x56, 0xa9, 0x16, 0x57, 0xd9, 0x81, 0x18, 0x6c, 0x66, 0x18, 0x8b, 0x96, 0x2e, - 0x65, 0xd8, 0x41, 0xd8, 0xda, 0xeb, 0x43, 0x78, 0x5b, 0xca, 0xe5, 0x73, 0xd5, 0xf3, 0x76, 0xa6, - 0x9c, 0x5a, 0xae, 0xb2, 0x44, 0x74, 0x56, 0x80, 0x92, 0x42, 0x95, 0x5d, 0x1b, 0x45, 0x47, 0xaa, - 0x9c, 0x59, 0x65, 0x87, 0xa2, 0xf3, 0x3a, 0x71, 0xf6, 0xc4, 0x6a, 0x2e, 0xc3, 0x0e, 0xd3, 0x47, - 0x60, 0xcc, 0x16, 0xf9, 0xbc, 0x18, 0xe7, 0xc8, 0xd4, 0x9f, 0x0e, 0x58, 0x63, 0x8a, 0x84, 0x28, - 0x6f, 0x18, 0x34, 0xd5, 0x51, 0x05, 0x5f, 0x5e, 0xcb, 0x67, 0x2b, 0x76, 0xa5, 0x9a, 0xaa, 0xe2, - 0x26, 0xe6, 0xaa, 0x40, 0x4a, 0x27, 0xac, 0x7b, 0x63, 0xab, 0xcf, 0xa5, 0x72, 0x55, 0x7b, 0xb9, - 0x58, 0xb6, 0x4b, 0xf9, 0xd4, 0x79, 0xd8, 0x3e, 0xbb, 0x5a, 0xb4, 0xf3, 0xc5, 0x54, 0x06, 0xe8, - 0xec, 0x0e, 0xeb, 0xd6, 0xd8, 0x26, 0xa7, 0xb3, 0xe5, 0xa2, 0x5d, 0xc9, 0xe6, 0xb3, 0xe9, 0x6a, - 0xae, 0x58, 0x00, 0xd2, 0xbb, 0xdd, 0x9a, 0x8c, 0x05, 0xac, 0x54, 0xcb, 0xf0, 0xcf, 0xca, 0x79, - 0xbb, 0x9a, 0x5b, 0xcd, 0x02, 0x31, 0xde, 0x62, 0xdd, 0x18, 0x0b, 0x57, 0x2a, 0x67, 0xa9, 0x0c, - 0x28, 0xf3, 0x2e, 0xeb, 0x09, 0xb1, 0x20, 0xf8, 0x1b, 0x96, 0x02, 0xa0, 0xc5, 0x95, 0x72, 0xb6, - 0x52, 0x01, 0x72, 0x9d, 0xb4, 0x8e, 0xc5, 0xf7, 0x56, 0xac, 0x54, 0x79, 0x77, 0xc3, 0x20, 0xb3, - 0x6f, 0x8a, 0x85, 0xc9, 0xe4, 0x2a, 0xe9, 0x62, 0xa1, 0x00, 0x2b, 0x00, 0x42, 0xee, 0x35, 0xfd, - 0x6a, 0x36, 0xb5, 0x6a, 0x57, 0x4e, 0x17, 0xcf, 0xa5, 0x53, 0x95, 0x2c, 0x90, 0xf4, 0x94, 0x75, - 0x7b, 0x2c, 0x1c, 0x27, 0x25, 0x3e, 0xc5, 0x4a, 0xb6, 0xba, 0x56, 0x02, 0x32, 0xef, 0xb5, 0x1b, - 0xf9, 0x54, 0xa5, 0xca, 0xac, 0xa9, 0xb7, 0xf7, 0x59, 0xfb, 0x78, 0x7d, 0x9a, 0x86, 0x09, 0xd8, - 0x82, 0xff, 0xb6, 0x57, 0x8a, 0xc5, 0x8c, 0xbd, 0xb2, 0x76, 0xbe, 0x02, 0x5b, 0x77, 0xd4, 0x3a, - 0x6c, 0xd4, 0x2d, 0xa5, 0x44, 0x55, 0x5f, 0xc0, 0x83, 0xb2, 0xaa, 0x0c, 0x5b, 0x07, 0xd3, 0xad, - 0x66, 0xcb, 0xb0, 0x2f, 0xe1, 0x4e, 0x2b, 0x25, 0x58, 0x70, 0x0a, 0xd8, 0x0d, 0xf6, 0x22, 0xdc, - 0x92, 0x6f, 0x3f, 0x71, 0x11, 0xff, 0x30, 0xb2, 0x51, 0x5b, 0x28, 0xe2, 0x3f, 0x6c, 0x68, 0xaa, - 0x28, 0xe6, 0x9d, 0x86, 0x16, 0xb9, 0xf4, 0x19, 0xfc, 0x7c, 0x91, 0xfc, 0x5d, 0x4e, 0x15, 0x32, - 0xc0, 0x51, 0xd7, 0xe0, 0x47, 0x99, 0x65, 0x59, 0xb0, 0x8c, 0x40, 0x6c, 0xa5, 0xb5, 0x15, 0xf4, - 0x4f, 0xbd, 0xac, 0x9f, 0xaf, 0xce, 0xcc, 0xf6, 0x72, 0xed, 0x8e, 0xa2, 0x16, 0xb1, 0x51, 0x40, - 0x6a, 0x02, 0x87, 0x6b, 0x85, 0x33, 0x85, 0xe2, 0xb9, 0x02, 0x8c, 0x74, 0xb7, 0x75, 0x47, 0x3c, - 0x08, 0xcc, 0xd7, 0x3e, 0x9f, 0xad, 0xca, 0x8a, 0x2c, 0x92, 0xb3, 0xa4, 0x85, 0x08, 0x70, 0x00, - 0x14, 0x90, 0x72, 0x04, 0x28, 0xa0, 0x98, 0x2c, 0xca, 0xd5, 0x9e, 0x9d, 0xa5, 0x96, 0x10, 0x0d, - 0x85, 0x2c, 0x8a, 0xd9, 0x9e, 0x2b, 0x40, 0x06, 0xcb, 0x15, 0x56, 0x80, 0x88, 0x6f, 0xb6, 0x6e, - 0x88, 0x07, 0x59, 0x4e, 0xe5, 0xf2, 0xd0, 0xc9, 0xf0, 0xd4, 0x6b, 0xfa, 0xb9, 0xe8, 0xe0, 0x37, - 0x23, 0xc4, 0xf1, 0x78, 0x47, 0x61, 0x33, 0x9f, 0x4d, 0x81, 0xd4, 0x95, 0x0a, 0x43, 0xee, 0xaa, - 0x28, 0x35, 0x26, 0xdd, 0x07, 0x26, 0xd3, 0x2d, 0xbd, 0x6a, 0x81, 0xed, 0x91, 0xef, 0x61, 0x4e, - 0xfd, 0x8a, 0xde, 0x04, 0x58, 0xb0, 0xa2, 0x01, 0xfc, 0x84, 0x95, 0x51, 0xb5, 0x7c, 0x06, 0x96, - 0x29, 0xa5, 0xa2, 0x9c, 0x0a, 0xaa, 0x01, 0x0d, 0xa9, 0x43, 0x60, 0x29, 0xdc, 0xb6, 0x0b, 0x40, - 0x30, 0xf4, 0xb0, 0xe2, 0x69, 0x01, 0xc9, 0x91, 0x80, 0x22, 0xa9, 0x9c, 0x4d, 0x65, 0xce, 0xdb, - 0xc0, 0x5a, 0x7b, 0x94, 0xc8, 0x94, 0xab, 0xc8, 0xa6, 0xf3, 0x39, 0x9c, 0xdd, 0xc8, 0xd4, 0xb3, - 0xfa, 0x38, 0xc1, 0xe7, 0xbd, 0xcb, 0x60, 0x32, 0xe0, 0x6b, 0xc8, 0x3b, 0x4b, 0x4e, 0xab, 0xba, - 0xb3, 0xed, 0xaa, 0xad, 0xc8, 0x17, 0xcf, 0x81, 0x0c, 0xc9, 0x81, 0xc6, 0x01, 0xa9, 0x0d, 0x0b, - 0x93, 0xab, 0x03, 0xdc, 0xf5, 0x04, 0x29, 0x67, 0x4b, 0xc5, 0x72, 0x15, 0x49, 0x58, 0xd2, 0x5b, - 0x04, 0xa4, 0x92, 0x85, 0xe5, 0x64, 0x52, 0xe5, 0xf3, 0xaa, 0xbf, 0xfe, 0xa9, 0xff, 0x8b, 0xf3, - 0x90, 0x48, 0x15, 0x76, 0xea, 0x3b, 0x5c, 0x4e, 0x8b, 0x25, 0x86, 0x8a, 0x81, 0xa8, 0x71, 0x21, - 0xa9, 0x32, 0x2c, 0xe4, 0x1a, 0x49, 0x15, 0x61, 0x98, 0x54, 0x3a, 0x9d, 0x2d, 0xf1, 0xad, 0xec, - 0x01, 0xa1, 0x90, 0xd1, 0x3f, 0x95, 0xe1, 0x5b, 0x85, 0x0a, 0x42, 0x7e, 0x7d, 0x07, 0x30, 0x47, - 0x42, 0x0a, 0xd5, 0x34, 0x52, 0x5a, 0x7a, 0xad, 0x5c, 0x46, 0xf5, 0x74, 0x0d, 0xf2, 0xbb, 0x51, - 0x03, 0x34, 0xb8, 0x94, 0xcf, 0xb2, 0xbe, 0xa9, 0xb7, 0x0d, 0xf0, 0x55, 0xd0, 0xdd, 0x7e, 0x91, - 0xf4, 0x8c, 0x5f, 0x85, 0x96, 0x84, 0xf6, 0xa4, 0x62, 0x0e, 0x11, 0x54, 0x59, 0xcb, 0x57, 0xed, - 0xca, 0x1a, 0xcc, 0xaf, 0x82, 0x12, 0xeb, 0x36, 0xeb, 0xe6, 0x48, 0x6d, 0x2a, 0xcf, 0xf7, 0x10, - 0x4a, 0x48, 0x38, 0xf7, 0xa9, 0xcd, 0xd6, 0xa1, 0x72, 0x85, 0xb3, 0xa9, 0x7c, 0x2e, 0x03, 0x18, - 0x5e, 0x5a, 0x3a, 0x0f, 0xb4, 0x28, 0x75, 0x90, 0x09, 0x93, 0x2e, 0xc2, 0xc4, 0xd3, 0x55, 0xbb, - 0x94, 0xaa, 0x54, 0xce, 0x15, 0xc9, 0xd0, 0x89, 0xeb, 0x2c, 0x45, 0xf3, 0x01, 0xa4, 0x14, 0x72, - 0xc4, 0x8f, 0x71, 0x30, 0x2b, 0xd9, 0x42, 0xb6, 0x9c, 0x4b, 0xdb, 0xd9, 0x72, 0xb9, 0x88, 0x46, - 0x90, 0x14, 0x00, 0xf1, 0x03, 0x0a, 0xfc, 0x68, 0x94, 0x6a, 0xc2, 0x09, 0x59, 0x9a, 0x2a, 0x57, - 0xcf, 0x03, 0xa5, 0x4a, 0x21, 0xa1, 0xc3, 0x14, 0x8a, 0x7c, 0x6d, 0xa0, 0x73, 0x61, 0xcb, 0x41, - 0xab, 0x48, 0xee, 0xd1, 0x81, 0x04, 0xc4, 0x5a, 0x3e, 0x0f, 0xaa, 0xe4, 0xa4, 0x35, 0x1d, 0x01, - 0xd0, 0x55, 0x4e, 0x74, 0x76, 0xd6, 0xd4, 0x7f, 0xb5, 0x0e, 0xab, 0x64, 0x5b, 0xc9, 0x0a, 0xc4, - 0x07, 0xfb, 0xad, 0xbd, 0x48, 0x69, 0xcb, 0x44, 0x24, 0xf4, 0x91, 0xb8, 0x32, 0x88, 0xa2, 0x14, - 0x10, 0x41, 0x5f, 0x62, 0xc4, 0x1a, 0xcc, 0xe4, 0xca, 0x59, 0xc0, 0xfa, 0x98, 0x65, 0x2d, 0xe7, - 0xca, 0xa0, 0x46, 0x51, 0xc6, 0x03, 0x72, 0x0f, 0x58, 0xa3, 0x9c, 0xc2, 0x79, 0xc1, 0xe0, 0xd4, - 0x05, 0x6e, 0xc1, 0xaa, 0x87, 0xa4, 0xa5, 0xcc, 0x50, 0x05, 0x72, 0x23, 0x61, 0x0c, 0xa1, 0x85, - 0x82, 0x2a, 0x50, 0xd0, 0xb9, 0x6a, 0xee, 0x2c, 0x92, 0x40, 0xa4, 0xae, 0x90, 0x5d, 0x49, 0x51, - 0x5d, 0xff, 0xd4, 0xa3, 0xfd, 0xc2, 0x02, 0x22, 0xba, 0xe3, 0x71, 0xaa, 0x87, 0x4a, 0x4b, 0xf8, - 0x85, 0x7c, 0x85, 0xd9, 0x68, 0x15, 0xec, 0xf6, 0x72, 0x0a, 0x50, 0x04, 0x03, 0x4b, 0x7d, 0x1d, - 0x03, 0xb4, 0x94, 0xaa, 0x56, 0xf3, 0x60, 0xd4, 0x15, 0x8b, 0xa4, 0x2a, 0x03, 0x5b, 0x27, 0x06, - 0xb6, 0x72, 0x1a, 0xb8, 0x12, 0x40, 0x0b, 0x6b, 0xa0, 0xaf, 0x02, 0x29, 0x11, 0x05, 0xe4, 0xdb, - 0x3e, 0xb0, 0x5b, 0x5f, 0xb0, 0x4d, 0xe5, 0xb5, 0x5c, 0x75, 0x15, 0xb9, 0x2e, 0xa0, 0xc7, 0xb8, - 0xbe, 0xd2, 0x20, 0x47, 0x40, 0x41, 0x4c, 0x3d, 0xac, 0x49, 0x91, 0xb3, 0x0d, 0xbf, 0xc1, 0x3f, - 0xb5, 0x9a, 0x38, 0x66, 0x4d, 0xc4, 0x14, 0xdb, 0xa5, 0xee, 0x85, 0x66, 0xa3, 0x06, 0x6b, 0x17, - 0x54, 0x15, 0xae, 0x17, 0xa7, 0x01, 0x21, 0x01, 0xa2, 0x01, 0xac, 0xb5, 0xf0, 0x83, 0xb1, 0xe0, - 0xa7, 0x10, 0xfe, 0x13, 0xf4, 0x25, 0x2b, 0x71, 0x7b, 0x73, 0xb5, 0x4c, 0x14, 0x74, 0x33, 0x05, - 0xbf, 0x22, 0xe5, 0xf8, 0x9a, 0x3f, 0x66, 0x88, 0xc0, 0xd8, 0xb7, 0x93, 0xa7, 0x19, 0x85, 0x10, - 0x5f, 0xba, 0x3a, 0xdd, 0xa8, 0xd7, 0xdd, 0x16, 0x57, 0xc8, 0xb1, 0x70, 0x15, 0xaf, 0xe9, 0x09, - 0xa0, 0x7e, 0x14, 0xb9, 0xbb, 0x75, 0x46, 0x07, 0xdd, 0x9d, 0x46, 0xa7, 0x71, 0x09, 0xbf, 0x66, - 0x78, 0x27, 0xf9, 0x76, 0xf1, 0x3d, 0xea, 0x90, 0x83, 0xb8, 0x47, 0xb1, 0x90, 0x27, 0x2e, 0x9d, - 0xd0, 0x01, 0x87, 0xa6, 0xbe, 0xd0, 0x67, 0xed, 0xe5, 0x87, 0xfa, 0xb8, 0x78, 0x30, 0x6d, 0x56, - 0x53, 0xd5, 0xf4, 0x69, 0xbb, 0x7a, 0xbe, 0x04, 0x86, 0x43, 0xaa, 0xb2, 0x06, 0x8e, 0xcb, 0x35, - 0x28, 0x58, 0xf5, 0xe2, 0x62, 0xb1, 0x04, 0xf4, 0x42, 0x1a, 0x03, 0x08, 0x5c, 0xab, 0x21, 0xe9, - 0x00, 0x76, 0xd2, 0x19, 0xb2, 0x35, 0x00, 0x93, 0x5a, 0x5d, 0x1e, 0x28, 0x3f, 0x7d, 0xde, 0xae, - 0x14, 0xf3, 0x45, 0xfb, 0xc1, 0xb5, 0xec, 0x1a, 0x1a, 0xcc, 0x66, 0xeb, 0x74, 0x71, 0xb5, 0x94, - 0xad, 0x72, 0xd6, 0x19, 0x44, 0x0a, 0xd0, 0xea, 0xce, 0x65, 0xb3, 0x67, 0xb2, 0x05, 0x54, 0x95, - 0x6b, 0xe5, 0x42, 0xf6, 0x3c, 0xc3, 0x4f, 0x15, 0x1f, 0x8e, 0x4c, 0x15, 0xbd, 0x0b, 0xee, 0xcf, - 0x69, 0x55, 0xdc, 0x45, 0xd9, 0x33, 0xf5, 0xb4, 0x7e, 0x6e, 0xb7, 0x2d, 0x79, 0x9d, 0x4c, 0x63, - 0x7d, 0xbd, 0x51, 0x03, 0x39, 0xbf, 0x83, 0x53, 0x80, 0xa5, 0x80, 0xad, 0xb0, 0xbc, 0x9c, 0x4b, - 0x03, 0x5f, 0x9d, 0x27, 0xa1, 0x8b, 0x53, 0x20, 0xad, 0x11, 0xaa, 0xcb, 0xa6, 0x2a, 0xe7, 0x61, - 0xd5, 0x30, 0x76, 0xa8, 0x62, 0x35, 0x9b, 0xc9, 0xad, 0xa1, 0x9b, 0x1a, 0x6d, 0x03, 0xec, 0x85, - 0x02, 0x3c, 0xda, 0x66, 0xad, 0x00, 0xfa, 0xbf, 0x0c, 0x4b, 0x8d, 0xce, 0x41, 0x4a, 0x97, 0xa1, - 0x98, 0x66, 0xd9, 0x87, 0xc0, 0xed, 0xc0, 0x65, 0xf6, 0xa8, 0x3a, 0x09, 0x92, 0xb9, 0x47, 0xd5, - 0xfd, 0x60, 0x44, 0x7c, 0xab, 0xcf, 0x1a, 0xe3, 0x29, 0x6b, 0x4e, 0x6b, 0xa3, 0x8b, 0xd7, 0x1c, - 0x83, 0x6d, 0xc8, 0x03, 0x4f, 0xae, 0xa5, 0x56, 0xb2, 0xa6, 0x74, 0x0b, 0xd5, 0x65, 0x0b, 0x2b, - 0xf9, 0x5c, 0xe5, 0xb4, 0xbe, 0xf9, 0xaa, 0xae, 0xbc, 0x06, 0xb8, 0x4b, 0x15, 0xb8, 0x6d, 0x1e, - 0xaa, 0x4b, 0x9f, 0x06, 0xa1, 0x5c, 0xc9, 0x72, 0x54, 0x84, 0xea, 0xce, 0x14, 0x41, 0x79, 0x16, - 0x38, 0x2a, 0x42, 0x55, 0x95, 0x52, 0xaa, 0x80, 0xc3, 0x0d, 0xa1, 0xcf, 0x11, 0xaa, 0x43, 0xbb, - 0x65, 0x6d, 0x65, 0x0d, 0x7b, 0x1d, 0x46, 0x87, 0x32, 0x7e, 0xa6, 0x80, 0x10, 0x10, 0xe8, 0xd7, - 0x66, 0x83, 0x2c, 0xe5, 0xaa, 0xbb, 0xb5, 0xdd, 0x44, 0x63, 0xe5, 0x18, 0xc5, 0x32, 0xa2, 0x15, - 0x76, 0xc1, 0xa3, 0x8f, 0x8c, 0x72, 0xee, 0x8c, 0xa9, 0xaf, 0xd0, 0x77, 0x65, 0xb3, 0xcd, 0x06, - 0x3d, 0x3a, 0x82, 0x11, 0xc0, 0xbe, 0xa9, 0xb3, 0xd6, 0x01, 0x1d, 0x14, 0xf9, 0xe9, 0x46, 0x3a, - 0x66, 0x36, 0x0b, 0x41, 0x06, 0x5d, 0x6c, 0x79, 0x97, 0x5b, 0xdc, 0x8e, 0x88, 0x56, 0x63, 0x9e, - 0x7d, 0x73, 0x27, 0xd3, 0xb8, 0xd4, 0xf0, 0x79, 0xbf, 0x2f, 0x1c, 0xb0, 0x86, 0xb3, 0x74, 0x62, - 0x9f, 0x38, 0x68, 0xed, 0x27, 0x72, 0xb6, 0xc1, 0x84, 0x10, 0x26, 0x31, 0xb0, 0xac, 0x2a, 0x42, - 0xf5, 0x56, 0xcd, 0x65, 0xb2, 0xdc, 0x73, 0x52, 0xc5, 0x15, 0xb0, 0xe5, 0x0a, 0x2b, 0xf6, 0x72, - 0xb6, 0x02, 0xbc, 0x05, 0x0c, 0xdd, 0x8f, 0xb8, 0x52, 0xb5, 0xcb, 0xe5, 0x22, 0x96, 0xaf, 0x55, - 0xec, 0x93, 0xc7, 0x4f, 0xdc, 0xcf, 0x5d, 0x27, 0x55, 0x49, 0x3c, 0x59, 0x40, 0xda, 0xc6, 0xda, - 0x07, 0xf8, 0x0e, 0x05, 0x53, 0xc8, 0x3e, 0x04, 0xc6, 0x54, 0x29, 0x6d, 0x73, 0x61, 0x6e, 0xd4, - 0x95, 0xce, 0x95, 0x61, 0x42, 0xa9, 0x34, 0xb6, 0x7b, 0x22, 0xdf, 0x1e, 0xad, 0xdd, 0x39, 0x7b, - 0x29, 0x5f, 0x2c, 0xae, 0xf2, 0xca, 0x3d, 0x28, 0xce, 0x55, 0x65, 0xae, 0x00, 0x2a, 0xab, 0x90, - 0x42, 0x5f, 0x01, 0x38, 0x9a, 0x00, 0x46, 0x8c, 0x39, 0x2d, 0x63, 0xa4, 0x60, 0x35, 0xf5, 0x24, - 0x70, 0xea, 0xa9, 0x76, 0x2f, 0x46, 0x1f, 0x54, 0x6d, 0xb1, 0x9c, 0x4a, 0x83, 0xea, 0x2b, 0xa5, - 0x98, 0x85, 0xf8, 0xed, 0x31, 0x26, 0xfa, 0xe4, 0x4b, 0x59, 0x74, 0x56, 0x47, 0x8d, 0xd6, 0x0a, - 0x19, 0x6c, 0x1f, 0x12, 0x87, 0x2a, 0x3f, 0x47, 0xb3, 0xd2, 0x47, 0xdd, 0x3f, 0x55, 0xb2, 0x18, - 0xa9, 0x97, 0x8c, 0xd7, 0x71, 0xaa, 0x67, 0xe9, 0x1a, 0x0e, 0xfa, 0x8b, 0x5a, 0x99, 0x7d, 0xe2, - 0x38, 0xec, 0x10, 0x38, 0x15, 0x46, 0xd9, 0xc9, 0xe3, 0xb0, 0x3f, 0xa1, 0xc2, 0xfb, 0x8f, 0x1f, - 0x47, 0x95, 0xd4, 0x67, 0x1d, 0x56, 0xa5, 0x25, 0xa7, 0xeb, 0xbb, 0x15, 0xb7, 0xd3, 0x01, 0x52, - 0x43, 0x5d, 0x12, 0x5b, 0x41, 0x0a, 0x6d, 0xab, 0xd1, 0xa1, 0x6f, 0xed, 0x82, 0xee, 0x8e, 0x07, - 0xca, 0x0b, 0x10, 0xb2, 0x49, 0xe3, 0x41, 0x32, 0x0d, 0x9f, 0x1f, 0x0a, 0xf4, 0x4f, 0x3d, 0xde, - 0x0f, 0x54, 0x46, 0x22, 0x42, 0x64, 0xf2, 0xe3, 0xde, 0x61, 0x4c, 0x51, 0x2b, 0xd2, 0x88, 0x98, - 0xf3, 0x90, 0x51, 0x59, 0x76, 0xea, 0x22, 0x85, 0x1b, 0x68, 0xed, 0x26, 0x1e, 0x32, 0xd6, 0xeb, - 0xf1, 0xbb, 0x04, 0x12, 0x60, 0x20, 0x71, 0x3f, 0x3f, 0xd5, 0xd7, 0x01, 0x0a, 0x5e, 0x87, 0x6e, - 0x07, 0xd5, 0xed, 0x92, 0xe7, 0xb5, 0x0b, 0x6e, 0xe7, 0xb2, 0xd7, 0xbe, 0x08, 0x2e, 0x34, 0x4f, - 0x27, 0xf3, 0xd9, 0xcf, 0x0b, 0xd6, 0xe9, 0xd1, 0x48, 0xdc, 0xb2, 0x4f, 0x61, 0xb8, 0xa5, 0x37, - 0x54, 0x25, 0x48, 0x4d, 0x64, 0x4b, 0x68, 0x4d, 0xf5, 0x06, 0x2d, 0xb8, 0xc1, 0x69, 0x1d, 0x4b, - 0x4f, 0x3d, 0x36, 0x24, 0x4c, 0x07, 0x3c, 0x05, 0xa7, 0x54, 0xb0, 0x82, 0xeb, 0xd6, 0x35, 0xd3, - 0xc1, 0x28, 0xd7, 0x70, 0x75, 0x0f, 0x45, 0xeb, 0x63, 0x20, 0x7c, 0xb7, 0x5d, 0xf0, 0xb4, 0x12, - 0x18, 0xa6, 0x2e, 0x66, 0x1f, 0x0f, 0x9d, 0x6b, 0x15, 0x5b, 0xf8, 0x04, 0x08, 0x7d, 0x31, 0xc4, - 0xd5, 0x2c, 0x83, 0x38, 0x50, 0x7c, 0xf7, 0xbd, 0x49, 0x90, 0xeb, 0x89, 0x7b, 0xe9, 0xfc, 0xa3, - 0x17, 0xe4, 0x5a, 0xee, 0x9c, 0xe3, 0xab, 0x8f, 0x44, 0xb2, 0x8d, 0xc4, 0x7d, 0x14, 0x80, 0xee, - 0x0d, 0x4e, 0x98, 0x09, 0x1a, 0x6c, 0x6a, 0xd6, 0x51, 0xb4, 0x81, 0x7c, 0x1f, 0xd5, 0x67, 0x0d, - 0x0c, 0xd8, 0x5d, 0xf5, 0x3c, 0x72, 0xf5, 0xa6, 0xcb, 0x7e, 0x51, 0x10, 0xca, 0xd5, 0xce, 0x85, - 0x1a, 0x5d, 0x14, 0x67, 0x77, 0xd1, 0x46, 0xc1, 0x67, 0x55, 0x38, 0x22, 0xd9, 0x7b, 0xfa, 0x44, - 0xec, 0x7c, 0x37, 0x58, 0xc2, 0x24, 0x7b, 0x6f, 0x9f, 0x38, 0x1d, 0xd8, 0x0d, 0x94, 0xc6, 0xff, - 0xdb, 0xab, 0xe9, 0x94, 0x92, 0xf2, 0xd9, 0xfb, 0xfa, 0xc4, 0x89, 0xee, 0x15, 0xc7, 0xe7, 0x1f, - 0x9f, 0x61, 0x7f, 0xd7, 0x37, 0xf5, 0x7f, 0x5a, 0xfb, 0x45, 0x22, 0xba, 0x8d, 0x6f, 0xc0, 0x93, - 0x2a, 0x5f, 0x06, 0x6f, 0x07, 0xcc, 0x14, 0xbb, 0x5c, 0xcc, 0x67, 0x6d, 0xdd, 0x19, 0x02, 0x4d, - 0x61, 0xd4, 0x81, 0x5b, 0x85, 0x9a, 0x02, 0x8c, 0x3b, 0xa3, 0xb8, 0xb2, 0x56, 0x42, 0xbd, 0x0a, - 0x82, 0xe0, 0x99, 0x7d, 0x56, 0x42, 0x76, 0x8f, 0xc7, 0xf0, 0x36, 0x5d, 0xee, 0xd0, 0xfb, 0xa9, - 0xe4, 0x8b, 0x55, 0x4d, 0x11, 0x19, 0xc5, 0xd1, 0xee, 0xa9, 0x58, 0x75, 0x8f, 0x66, 0x9a, 0x51, - 0x93, 0x2a, 0xa0, 0x77, 0x01, 0xd2, 0xd8, 0x28, 0x5d, 0xca, 0x16, 0xd2, 0xa7, 0xc1, 0x25, 0x7b, - 0x67, 0x3f, 0x2c, 0x4d, 0x4c, 0x46, 0xf9, 0x7e, 0x36, 0x1d, 0x2f, 0x80, 0x96, 0x55, 0x4d, 0x64, - 0xd8, 0x56, 0x33, 0x61, 0x40, 0x77, 0x44, 0xab, 0xf3, 0xc5, 0xf4, 0x19, 0x8a, 0x34, 0xc4, 0x36, - 0xae, 0x9c, 0x5e, 0x5b, 0x5e, 0xce, 0x67, 0xb9, 0xf4, 0x8a, 0x56, 0x2f, 0x97, 0xb3, 0x59, 0xe9, - 0x3b, 0x82, 0x6c, 0x8c, 0x02, 0x80, 0xca, 0x24, 0x8f, 0x1c, 0x24, 0x42, 0xb4, 0x12, 0xc3, 0xc1, - 0x15, 0xd0, 0x3d, 0xe0, 0xc9, 0x0e, 0xc5, 0xf7, 0x8f, 0x10, 0x3c, 0x14, 0x3e, 0x8c, 0xe2, 0x35, - 0x0a, 0x40, 0x95, 0x18, 0x61, 0xdb, 0x83, 0x82, 0x30, 0x5a, 0x5f, 0xce, 0xae, 0xac, 0xe5, 0x53, - 0x65, 0x39, 0xcc, 0xc8, 0xd4, 0x77, 0xfb, 0x44, 0xd0, 0x2b, 0x30, 0x36, 0xc8, 0xa2, 0xf0, 0x51, - 0x63, 0x61, 0x38, 0x8e, 0xdc, 0x61, 0xd4, 0x8f, 0x88, 0x31, 0xf0, 0x87, 0x65, 0x4c, 0x1a, 0x56, - 0x02, 0x48, 0x02, 0xbb, 0x03, 0x0a, 0x56, 0xc1, 0x92, 0xcc, 0xd9, 0x67, 0x72, 0x79, 0x34, 0x21, - 0x98, 0xb5, 0x4f, 0xc6, 0xca, 0x33, 0x59, 0xda, 0x39, 0x0e, 0x94, 0xca, 0xae, 0xe4, 0x2a, 0xbc, - 0x68, 0x10, 0xb5, 0x9c, 0x2a, 0x02, 0x8f, 0x3e, 0x9f, 0xc5, 0x25, 0x83, 0xf7, 0x8d, 0xbd, 0x17, - 0x33, 0xf9, 0xdc, 0x19, 0x34, 0xdc, 0x38, 0x50, 0x1a, 0x2c, 0xfb, 0x1c, 0xa8, 0x58, 0xea, 0x7e, - 0x8f, 0x98, 0x42, 0x36, 0x7d, 0xba, 0x58, 0xc9, 0xa7, 0xf0, 0xc0, 0x05, 0x3c, 0x7b, 0x28, 0x28, - 0xa7, 0x4a, 0x00, 0x04, 0x2a, 0x9f, 0x37, 0xca, 0xa6, 0xca, 0x79, 0x24, 0x5b, 0xf0, 0x61, 0x0b, - 0xa0, 0xef, 0xf9, 0x0c, 0x96, 0xf2, 0xa9, 0xf4, 0x19, 0xfb, 0x34, 0x8c, 0xc6, 0x46, 0xa7, 0xde, - 0x35, 0x2c, 0xc2, 0x69, 0x60, 0xc9, 0x80, 0x57, 0x9c, 0x2f, 0xae, 0x90, 0x57, 0x50, 0x51, 0x51, - 0xc0, 0xa0, 0x3c, 0x93, 0x5a, 0x05, 0xab, 0x91, 0xdb, 0xfd, 0xa1, 0xaa, 0xd3, 0x59, 0x30, 0x9b, - 0xfa, 0x54, 0x2c, 0x23, 0xa8, 0x58, 0x2d, 0x82, 0x8d, 0x8d, 0xd3, 0x4e, 0x65, 0xd0, 0xe5, 0x91, - 0x1e, 0x6f, 0x0c, 0x40, 0x39, 0xbb, 0x5a, 0x3c, 0x8b, 0xd6, 0xef, 0x78, 0x64, 0x42, 0x99, 0x6c, - 0xaa, 0x7a, 0x9a, 0x9b, 0x56, 0xa1, 0x1a, 0x71, 0xfe, 0xa2, 0x1d, 0x5e, 0x05, 0x75, 0xb9, 0x6a, - 0x76, 0x95, 0xdb, 0x55, 0xa1, 0x0a, 0x20, 0x6d, 0xb2, 0x9e, 0x00, 0x8b, 0xd1, 0x56, 0x2b, 0xc5, - 0x3c, 0x46, 0x65, 0x64, 0xfc, 0x5e, 0xab, 0xa0, 0xf0, 0x3e, 0xc6, 0x66, 0x01, 0xbb, 0x2a, 0xc4, - 0xad, 0xaa, 0x1f, 0x2a, 0x01, 0x7e, 0xa3, 0x63, 0x95, 0xd6, 0xca, 0xe9, 0xd3, 0x78, 0x7c, 0x30, - 0x1a, 0x33, 0xfb, 0xa5, 0xb5, 0xf3, 0x4b, 0xb0, 0x15, 0x60, 0x4a, 0x45, 0xf1, 0x22, 0x4f, 0x96, - 0xaa, 0xe5, 0xdc, 0xca, 0x0a, 0xec, 0xe8, 0x7e, 0xe9, 0xf2, 0xeb, 0x9d, 0xf3, 0x23, 0x1b, 0x98, - 0x53, 0x85, 0x8d, 0xa9, 0x90, 0x9c, 0x86, 0x5b, 0xa4, 0x47, 0xa2, 0x97, 0x03, 0x31, 0x0b, 0xc2, - 0x8a, 0x4a, 0x15, 0xfc, 0x8a, 0x33, 0x8c, 0xa9, 0xd0, 0xb0, 0x46, 0x05, 0x74, 0x9e, 0xb0, 0x96, - 0xcb, 0x63, 0xa4, 0x9a, 0x53, 0xdd, 0xc1, 0x98, 0x39, 0xe8, 0x8c, 0x91, 0xd0, 0xc2, 0xe2, 0x31, - 0xfb, 0x0b, 0x52, 0x01, 0xfc, 0x94, 0x6b, 0x63, 0xc6, 0x2a, 0x64, 0xd7, 0xc0, 0xfb, 0xca, 0x83, - 0x97, 0xba, 0x5a, 0x42, 0x1c, 0x03, 0x4e, 0x0e, 0xc5, 0xad, 0x17, 0x24, 0xca, 0x5a, 0x09, 0x9c, - 0x28, 0x90, 0xa7, 0x87, 0x63, 0xba, 0xc1, 0x03, 0xc8, 0x14, 0x06, 0x8c, 0x41, 0xb6, 0xe5, 0x2a, - 0x39, 0x8c, 0x60, 0x1e, 0x89, 0x59, 0x38, 0x3f, 0xbf, 0x4a, 0x9d, 0x05, 0x09, 0x74, 0x9d, 0x16, - 0x80, 0x57, 0x33, 0x4e, 0x15, 0x52, 0x18, 0x67, 0xab, 0x16, 0x31, 0x18, 0x3b, 0x1e, 0x43, 0xd4, - 0xd4, 0x41, 0x1e, 0x06, 0xcb, 0xaf, 0x95, 0xd8, 0xd1, 0xa9, 0x57, 0x0c, 0x8a, 0x23, 0x8c, 0xe0, - 0x01, 0x38, 0x72, 0x54, 0x54, 0x94, 0x54, 0x2f, 0xe4, 0x29, 0x26, 0xa0, 0x23, 0x55, 0x60, 0x4c, - 0xaf, 0xe5, 0x59, 0x4d, 0xdc, 0x83, 0x0e, 0xd7, 0xf1, 0xc4, 0x8f, 0xfe, 0xb8, 0x2a, 0xfe, 0x62, - 0x85, 0x62, 0x1d, 0xbd, 0x8a, 0xd2, 0xc3, 0x06, 0xe3, 0x1a, 0xd1, 0x83, 0xf6, 0xc0, 0x39, 0x82, - 0x68, 0xf5, 0x2a, 0xa1, 0x47, 0x02, 0xee, 0xd1, 0x2b, 0xcf, 0x6d, 0x36, 0xfc, 0x6d, 0xb0, 0x1e, - 0xf7, 0xc4, 0x55, 0x8a, 0x87, 0xa7, 0x80, 0x83, 0x04, 0x6b, 0x19, 0x73, 0x71, 0x2e, 0x00, 0xef, - 0xc4, 0xb4, 0x92, 0xb1, 0x23, 0x2b, 0xae, 0x12, 0x95, 0x7b, 0xaa, 0xd9, 0x04, 0x0e, 0x12, 0x14, - 0x11, 0x53, 0x89, 0xd7, 0x08, 0xf6, 0xc9, 0xd8, 0x5c, 0xb8, 0x5e, 0xdd, 0xe7, 0x07, 0x26, 0x12, - 0xdb, 0x1d, 0x06, 0xa1, 0xe7, 0x5e, 0x31, 0x6d, 0x6c, 0x2c, 0x0e, 0x87, 0x69, 0x67, 0xdd, 0x05, - 0x16, 0x8a, 0x19, 0x3e, 0xc8, 0x42, 0x03, 0x1e, 0x8a, 0x99, 0xbb, 0xc8, 0x5c, 0x60, 0x07, 0x97, - 0x86, 0x4e, 0xf7, 0x3d, 0xd2, 0x77, 0xcd, 0xff, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x0b, 0xbb, - 0xf3, 0x21, 0xca, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/econ.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/econ.pb.go deleted file mode 100644 index db3960f2..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/econ.pb.go +++ /dev/null @@ -1,4441 +0,0 @@ -// Code generated by protoc-gen-go. -// source: econ_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type EGCItemMsg int32 - -const ( - EGCItemMsg_k_EMsgGCBase EGCItemMsg = 1000 - EGCItemMsg_k_EMsgGCSetItemPosition EGCItemMsg = 1001 - EGCItemMsg_k_EMsgGCCraft EGCItemMsg = 1002 - EGCItemMsg_k_EMsgGCCraftResponse EGCItemMsg = 1003 - EGCItemMsg_k_EMsgGCDelete EGCItemMsg = 1004 - EGCItemMsg_k_EMsgGCVerifyCacheSubscription EGCItemMsg = 1005 - EGCItemMsg_k_EMsgClientToGCNameItem EGCItemMsg = 1006 - EGCItemMsg_k_EMsgGCPaintItem EGCItemMsg = 1009 - EGCItemMsg_k_EMsgGCPaintItemResponse EGCItemMsg = 1010 - EGCItemMsg_k_EMsgGCGoldenWrenchBroadcast EGCItemMsg = 1011 - EGCItemMsg_k_EMsgGCMOTDRequest EGCItemMsg = 1012 - EGCItemMsg_k_EMsgGCMOTDRequestResponse EGCItemMsg = 1013 - EGCItemMsg_k_EMsgGCAddItemToSocket_DEPRECATED EGCItemMsg = 1014 - EGCItemMsg_k_EMsgGCAddItemToSocketResponse_DEPRECATED EGCItemMsg = 1015 - EGCItemMsg_k_EMsgGCAddSocketToBaseItem_DEPRECATED EGCItemMsg = 1016 - EGCItemMsg_k_EMsgGCAddSocketToItem_DEPRECATED EGCItemMsg = 1017 - EGCItemMsg_k_EMsgGCAddSocketToItemResponse_DEPRECATED EGCItemMsg = 1018 - EGCItemMsg_k_EMsgGCNameBaseItem EGCItemMsg = 1019 - EGCItemMsg_k_EMsgGCNameBaseItemResponse EGCItemMsg = 1020 - EGCItemMsg_k_EMsgGCRemoveSocketItem_DEPRECATED EGCItemMsg = 1021 - EGCItemMsg_k_EMsgGCRemoveSocketItemResponse_DEPRECATED EGCItemMsg = 1022 - EGCItemMsg_k_EMsgGCCustomizeItemTexture EGCItemMsg = 1023 - EGCItemMsg_k_EMsgGCCustomizeItemTextureResponse EGCItemMsg = 1024 - EGCItemMsg_k_EMsgGCUseItemRequest EGCItemMsg = 1025 - EGCItemMsg_k_EMsgGCUseItemResponse EGCItemMsg = 1026 - EGCItemMsg_k_EMsgGCGiftedItems EGCItemMsg = 1027 - EGCItemMsg_k_EMsgGCRemoveItemName EGCItemMsg = 1030 - EGCItemMsg_k_EMsgGCRemoveItemPaint EGCItemMsg = 1031 - EGCItemMsg_k_EMsgGCUnwrapGiftRequest EGCItemMsg = 1037 - EGCItemMsg_k_EMsgGCUnwrapGiftResponse EGCItemMsg = 1038 - EGCItemMsg_k_EMsgGCSetItemStyle_DEPRECATED EGCItemMsg = 1039 - EGCItemMsg_k_EMsgGCUsedClaimCodeItem EGCItemMsg = 1040 - EGCItemMsg_k_EMsgGCSortItems EGCItemMsg = 1041 - EGCItemMsg_k_EMsgGC_RevolvingLootList_DEPRECATED EGCItemMsg = 1042 - EGCItemMsg_k_EMsgGCUpdateItemSchema EGCItemMsg = 1049 - EGCItemMsg_k_EMsgGCRemoveCustomTexture EGCItemMsg = 1051 - EGCItemMsg_k_EMsgGCRemoveCustomTextureResponse EGCItemMsg = 1052 - EGCItemMsg_k_EMsgGCRemoveMakersMark EGCItemMsg = 1053 - EGCItemMsg_k_EMsgGCRemoveMakersMarkResponse EGCItemMsg = 1054 - EGCItemMsg_k_EMsgGCRemoveUniqueCraftIndex EGCItemMsg = 1055 - EGCItemMsg_k_EMsgGCRemoveUniqueCraftIndexResponse EGCItemMsg = 1056 - EGCItemMsg_k_EMsgGCSaxxyBroadcast EGCItemMsg = 1057 - EGCItemMsg_k_EMsgGCBackpackSortFinished EGCItemMsg = 1058 - EGCItemMsg_k_EMsgGCAdjustItemEquippedState EGCItemMsg = 1059 - EGCItemMsg_k_EMsgGCCollectItem EGCItemMsg = 1061 - EGCItemMsg_k_EMsgGCItemAcknowledged EGCItemMsg = 1062 - EGCItemMsg_k_EMsgGCPresets_SelectPresetForClass EGCItemMsg = 1063 - EGCItemMsg_k_EMsgGCPresets_SetItemPosition EGCItemMsg = 1064 - EGCItemMsg_k_EMsgGCPresets_SelectPresetForClassReply EGCItemMsg = 1067 - EGCItemMsg_k_EMsgClientToGCNameItemResponse EGCItemMsg = 1068 - EGCItemMsg_k_EMsgGCApplyConsumableEffects EGCItemMsg = 1069 - EGCItemMsg_k_EMsgGCConsumableExhausted EGCItemMsg = 1070 - EGCItemMsg_k_EMsgGCShowItemsPickedUp EGCItemMsg = 1071 - EGCItemMsg_k_EMsgGCClientDisplayNotification EGCItemMsg = 1072 - EGCItemMsg_k_EMsgGCApplyStrangePart EGCItemMsg = 1073 - EGCItemMsg_k_EMsgGC_IncrementKillCountResponse EGCItemMsg = 1075 - EGCItemMsg_k_EMsgGCApplyPennantUpgrade EGCItemMsg = 1076 - EGCItemMsg_k_EMsgGCSetItemPositions EGCItemMsg = 1077 - EGCItemMsg_k_EMsgGCSetItemPositions_RateLimited EGCItemMsg = 1096 - EGCItemMsg_k_EMsgGCApplyEggEssence EGCItemMsg = 1078 - EGCItemMsg_k_EMsgGCNameEggEssenceResponse EGCItemMsg = 1079 - EGCItemMsg_k_EMsgGCFulfillDynamicRecipeComponent EGCItemMsg = 1082 - EGCItemMsg_k_EMsgGCFulfillDynamicRecipeComponentResponse EGCItemMsg = 1083 - EGCItemMsg_k_EMsgGCClientRequestMarketData EGCItemMsg = 1084 - EGCItemMsg_k_EMsgGCClientRequestMarketDataResponse EGCItemMsg = 1085 - EGCItemMsg_k_EMsgGCExtractGems EGCItemMsg = 1086 - EGCItemMsg_k_EMsgGCAddSocket EGCItemMsg = 1087 - EGCItemMsg_k_EMsgGCAddItemToSocket EGCItemMsg = 1088 - EGCItemMsg_k_EMsgGCAddItemToSocketResponse EGCItemMsg = 1089 - EGCItemMsg_k_EMsgGCAddSocketResponse EGCItemMsg = 1090 - EGCItemMsg_k_EMsgGCResetStrangeGemCount EGCItemMsg = 1091 - EGCItemMsg_k_EMsgGCRequestCrateItems EGCItemMsg = 1092 - EGCItemMsg_k_EMsgGCRequestCrateItemsResponse EGCItemMsg = 1093 - EGCItemMsg_k_EMsgGCExtractGemsResponse EGCItemMsg = 1094 - EGCItemMsg_k_EMsgGCResetStrangeGemCountResponse EGCItemMsg = 1095 - EGCItemMsg_k_EMsgGCServerUseItemRequest EGCItemMsg = 1103 - EGCItemMsg_k_EMsgGCAddGiftItem EGCItemMsg = 1104 - EGCItemMsg_k_EMsgGCRemoveItemGiftMessage EGCItemMsg = 1105 - EGCItemMsg_k_EMsgGCRemoveItemGiftMessageResponse EGCItemMsg = 1106 - EGCItemMsg_k_EMsgGCRemoveItemGifterAccountId EGCItemMsg = 1107 - EGCItemMsg_k_EMsgGCRemoveItemGifterAccountIdResponse EGCItemMsg = 1108 - EGCItemMsg_k_EMsgClientToGCRemoveItemGifterAttributes EGCItemMsg = 1109 - EGCItemMsg_k_EMsgClientToGCRemoveItemName EGCItemMsg = 1110 - EGCItemMsg_k_EMsgClientToGCRemoveItemDescription EGCItemMsg = 1111 - EGCItemMsg_k_EMsgClientToGCRemoveItemAttributeResponse EGCItemMsg = 1112 - EGCItemMsg_k_EMsgGCTradingBase EGCItemMsg = 1500 - EGCItemMsg_k_EMsgGCTrading_InitiateTradeRequest EGCItemMsg = 1501 - EGCItemMsg_k_EMsgGCTrading_InitiateTradeResponse EGCItemMsg = 1502 - EGCItemMsg_k_EMsgGCTrading_StartSession EGCItemMsg = 1503 - EGCItemMsg_k_EMsgGCTrading_SessionClosed EGCItemMsg = 1509 - EGCItemMsg_k_EMsgGCTrading_InitiateTradeRequestResponse EGCItemMsg = 1514 - EGCItemMsg_k_EMsgGCServerBrowser_FavoriteServer EGCItemMsg = 1601 - EGCItemMsg_k_EMsgGCServerBrowser_BlacklistServer EGCItemMsg = 1602 - EGCItemMsg_k_EMsgGCServerRentalsBase EGCItemMsg = 1700 - EGCItemMsg_k_EMsgGCItemPreviewCheckStatus EGCItemMsg = 1701 - EGCItemMsg_k_EMsgGCItemPreviewStatusResponse EGCItemMsg = 1702 - EGCItemMsg_k_EMsgGCItemPreviewRequest EGCItemMsg = 1703 - EGCItemMsg_k_EMsgGCItemPreviewRequestResponse EGCItemMsg = 1704 - EGCItemMsg_k_EMsgGCItemPreviewExpire EGCItemMsg = 1705 - EGCItemMsg_k_EMsgGCItemPreviewExpireNotification EGCItemMsg = 1706 - EGCItemMsg_k_EMsgGCItemPreviewItemBoughtNotification EGCItemMsg = 1707 - EGCItemMsg_k_EMsgGCDev_NewItemRequest EGCItemMsg = 2001 - EGCItemMsg_k_EMsgGCDev_NewItemRequestResponse EGCItemMsg = 2002 - EGCItemMsg_k_EMsgGCStoreGetUserData EGCItemMsg = 2500 - EGCItemMsg_k_EMsgGCStoreGetUserDataResponse EGCItemMsg = 2501 - EGCItemMsg_k_EMsgGCStorePurchaseFinalize EGCItemMsg = 2504 - EGCItemMsg_k_EMsgGCStorePurchaseFinalizeResponse EGCItemMsg = 2505 - EGCItemMsg_k_EMsgGCStorePurchaseCancel EGCItemMsg = 2506 - EGCItemMsg_k_EMsgGCStorePurchaseCancelResponse EGCItemMsg = 2507 - EGCItemMsg_k_EMsgGCStorePurchaseInit EGCItemMsg = 2510 - EGCItemMsg_k_EMsgGCStorePurchaseInitResponse EGCItemMsg = 2511 - EGCItemMsg_k_EMsgGCBannedWordListRequest EGCItemMsg = 2512 - EGCItemMsg_k_EMsgGCBannedWordListResponse EGCItemMsg = 2513 - EGCItemMsg_k_EMsgGCToGCBannedWordListBroadcast EGCItemMsg = 2514 - EGCItemMsg_k_EMsgGCToGCBannedWordListUpdated EGCItemMsg = 2515 - EGCItemMsg_k_EMsgGCToGCDirtySDOCache EGCItemMsg = 2516 - EGCItemMsg_k_EMsgGCToGCDirtyMultipleSDOCache EGCItemMsg = 2517 - EGCItemMsg_k_EMsgGCToGCUpdateSQLKeyValue EGCItemMsg = 2518 - EGCItemMsg_k_EMsgGCToGCBroadcastConsoleCommand EGCItemMsg = 2521 - EGCItemMsg_k_EMsgGCServerVersionUpdated EGCItemMsg = 2522 - EGCItemMsg_k_EMsgGCApplyAutograph EGCItemMsg = 2523 - EGCItemMsg_k_EMsgGCToGCWebAPIAccountChanged EGCItemMsg = 2524 - EGCItemMsg_k_EMsgGCClientVersionUpdated EGCItemMsg = 2528 - EGCItemMsg_k_EMsgGCItemPurgatory_FinalizePurchase EGCItemMsg = 2531 - EGCItemMsg_k_EMsgGCItemPurgatory_FinalizePurchaseResponse EGCItemMsg = 2532 - EGCItemMsg_k_EMsgGCItemPurgatory_RefundPurchase EGCItemMsg = 2533 - EGCItemMsg_k_EMsgGCItemPurgatory_RefundPurchaseResponse EGCItemMsg = 2534 - EGCItemMsg_k_EMsgGCToGCPlayerStrangeCountAdjustments EGCItemMsg = 2535 - EGCItemMsg_k_EMsgGCRequestStoreSalesData EGCItemMsg = 2536 - EGCItemMsg_k_EMsgGCRequestStoreSalesDataResponse EGCItemMsg = 2537 - EGCItemMsg_k_EMsgGCRequestStoreSalesDataUpToDateResponse EGCItemMsg = 2538 - EGCItemMsg_k_EMsgGCToGCPingRequest EGCItemMsg = 2539 - EGCItemMsg_k_EMsgGCToGCPingResponse EGCItemMsg = 2540 - EGCItemMsg_k_EMsgGCToGCGetUserSessionServer EGCItemMsg = 2541 - EGCItemMsg_k_EMsgGCToGCGetUserSessionServerResponse EGCItemMsg = 2542 - EGCItemMsg_k_EMsgGCToGCGetUserServerMembers EGCItemMsg = 2543 - EGCItemMsg_k_EMsgGCToGCGetUserServerMembersResponse EGCItemMsg = 2544 - EGCItemMsg_k_EMsgGCToGCGetUserPCBangNo EGCItemMsg = 2545 - EGCItemMsg_k_EMsgGCToGCGetUserPCBangNoResponse EGCItemMsg = 2546 - EGCItemMsg_k_EMsgGCToGCCanUseDropRateBonus EGCItemMsg = 2547 - EGCItemMsg_k_EMsgSQLAddDropRateBonus EGCItemMsg = 2548 - EGCItemMsg_k_EMsgGCToGCRefreshSOCache EGCItemMsg = 2549 - EGCItemMsg_k_EMsgGCToGCApplyLocalizationDiff EGCItemMsg = 2550 - EGCItemMsg_k_EMsgGCToGCApplyLocalizationDiffResponse EGCItemMsg = 2551 - EGCItemMsg_k_EMsgGCToGCCheckAccountTradeStatus EGCItemMsg = 2552 - EGCItemMsg_k_EMsgGCToGCCheckAccountTradeStatusResponse EGCItemMsg = 2553 - EGCItemMsg_k_EMsgGCToGCGrantAccountRolledItems EGCItemMsg = 2554 - EGCItemMsg_k_EMsgGCToGCGrantSelfMadeItemToAccount EGCItemMsg = 2555 - EGCItemMsg_k_EMsgSQLUpgradeBattleBooster EGCItemMsg = 2556 - EGCItemMsg_k_EMsgGCPartnerBalanceRequest EGCItemMsg = 2557 - EGCItemMsg_k_EMsgGCPartnerBalanceResponse EGCItemMsg = 2558 - EGCItemMsg_k_EMsgGCPartnerRechargeRedirectURLRequest EGCItemMsg = 2559 - EGCItemMsg_k_EMsgGCPartnerRechargeRedirectURLResponse EGCItemMsg = 2560 - EGCItemMsg_k_EMsgGCStatueCraft EGCItemMsg = 2561 - EGCItemMsg_k_EMsgGCRedeemCode EGCItemMsg = 2562 - EGCItemMsg_k_EMsgGCRedeemCodeResponse EGCItemMsg = 2563 - EGCItemMsg_k_EMsgGCToGCItemConsumptionRollback EGCItemMsg = 2564 - EGCItemMsg_k_EMsgClientToGCWrapAndDeliverGift EGCItemMsg = 2565 - EGCItemMsg_k_EMsgClientToGCWrapAndDeliverGiftResponse EGCItemMsg = 2566 - EGCItemMsg_k_EMsgClientToGCUnpackBundleResponse EGCItemMsg = 2567 - EGCItemMsg_k_EMsgGCToClientStoreTransactionCompleted EGCItemMsg = 2568 - EGCItemMsg_k_EMsgClientToGCEquipItems EGCItemMsg = 2569 - EGCItemMsg_k_EMsgClientToGCEquipItemsResponse EGCItemMsg = 2570 - EGCItemMsg_k_EMsgClientToGCUnlockItemStyle EGCItemMsg = 2571 - EGCItemMsg_k_EMsgClientToGCUnlockItemStyleResponse EGCItemMsg = 2572 - EGCItemMsg_k_EMsgClientToGCSetItemInventoryCategory EGCItemMsg = 2573 - EGCItemMsg_k_EMsgClientToGCUnlockCrate EGCItemMsg = 2574 - EGCItemMsg_k_EMsgClientToGCUnlockCrateResponse EGCItemMsg = 2575 - EGCItemMsg_k_EMsgClientToGCUnpackBundle EGCItemMsg = 2576 - EGCItemMsg_k_EMsgClientToGCSetItemStyle EGCItemMsg = 2577 - EGCItemMsg_k_EMsgClientToGCSetItemStyleResponse EGCItemMsg = 2578 - EGCItemMsg_k_EMsgGCGenericResult EGCItemMsg = 2579 - EGCItemMsg_k_EMsgSQLGCToGCGrantBackpackSlots EGCItemMsg = 2580 - EGCItemMsg_k_EMsgClientToGCLookupAccountName EGCItemMsg = 2581 - EGCItemMsg_k_EMsgClientToGCLookupAccountNameResponse EGCItemMsg = 2582 -) - -var EGCItemMsg_name = map[int32]string{ - 1000: "k_EMsgGCBase", - 1001: "k_EMsgGCSetItemPosition", - 1002: "k_EMsgGCCraft", - 1003: "k_EMsgGCCraftResponse", - 1004: "k_EMsgGCDelete", - 1005: "k_EMsgGCVerifyCacheSubscription", - 1006: "k_EMsgClientToGCNameItem", - 1009: "k_EMsgGCPaintItem", - 1010: "k_EMsgGCPaintItemResponse", - 1011: "k_EMsgGCGoldenWrenchBroadcast", - 1012: "k_EMsgGCMOTDRequest", - 1013: "k_EMsgGCMOTDRequestResponse", - 1014: "k_EMsgGCAddItemToSocket_DEPRECATED", - 1015: "k_EMsgGCAddItemToSocketResponse_DEPRECATED", - 1016: "k_EMsgGCAddSocketToBaseItem_DEPRECATED", - 1017: "k_EMsgGCAddSocketToItem_DEPRECATED", - 1018: "k_EMsgGCAddSocketToItemResponse_DEPRECATED", - 1019: "k_EMsgGCNameBaseItem", - 1020: "k_EMsgGCNameBaseItemResponse", - 1021: "k_EMsgGCRemoveSocketItem_DEPRECATED", - 1022: "k_EMsgGCRemoveSocketItemResponse_DEPRECATED", - 1023: "k_EMsgGCCustomizeItemTexture", - 1024: "k_EMsgGCCustomizeItemTextureResponse", - 1025: "k_EMsgGCUseItemRequest", - 1026: "k_EMsgGCUseItemResponse", - 1027: "k_EMsgGCGiftedItems", - 1030: "k_EMsgGCRemoveItemName", - 1031: "k_EMsgGCRemoveItemPaint", - 1037: "k_EMsgGCUnwrapGiftRequest", - 1038: "k_EMsgGCUnwrapGiftResponse", - 1039: "k_EMsgGCSetItemStyle_DEPRECATED", - 1040: "k_EMsgGCUsedClaimCodeItem", - 1041: "k_EMsgGCSortItems", - 1042: "k_EMsgGC_RevolvingLootList_DEPRECATED", - 1049: "k_EMsgGCUpdateItemSchema", - 1051: "k_EMsgGCRemoveCustomTexture", - 1052: "k_EMsgGCRemoveCustomTextureResponse", - 1053: "k_EMsgGCRemoveMakersMark", - 1054: "k_EMsgGCRemoveMakersMarkResponse", - 1055: "k_EMsgGCRemoveUniqueCraftIndex", - 1056: "k_EMsgGCRemoveUniqueCraftIndexResponse", - 1057: "k_EMsgGCSaxxyBroadcast", - 1058: "k_EMsgGCBackpackSortFinished", - 1059: "k_EMsgGCAdjustItemEquippedState", - 1061: "k_EMsgGCCollectItem", - 1062: "k_EMsgGCItemAcknowledged", - 1063: "k_EMsgGCPresets_SelectPresetForClass", - 1064: "k_EMsgGCPresets_SetItemPosition", - 1067: "k_EMsgGCPresets_SelectPresetForClassReply", - 1068: "k_EMsgClientToGCNameItemResponse", - 1069: "k_EMsgGCApplyConsumableEffects", - 1070: "k_EMsgGCConsumableExhausted", - 1071: "k_EMsgGCShowItemsPickedUp", - 1072: "k_EMsgGCClientDisplayNotification", - 1073: "k_EMsgGCApplyStrangePart", - 1075: "k_EMsgGC_IncrementKillCountResponse", - 1076: "k_EMsgGCApplyPennantUpgrade", - 1077: "k_EMsgGCSetItemPositions", - 1096: "k_EMsgGCSetItemPositions_RateLimited", - 1078: "k_EMsgGCApplyEggEssence", - 1079: "k_EMsgGCNameEggEssenceResponse", - 1082: "k_EMsgGCFulfillDynamicRecipeComponent", - 1083: "k_EMsgGCFulfillDynamicRecipeComponentResponse", - 1084: "k_EMsgGCClientRequestMarketData", - 1085: "k_EMsgGCClientRequestMarketDataResponse", - 1086: "k_EMsgGCExtractGems", - 1087: "k_EMsgGCAddSocket", - 1088: "k_EMsgGCAddItemToSocket", - 1089: "k_EMsgGCAddItemToSocketResponse", - 1090: "k_EMsgGCAddSocketResponse", - 1091: "k_EMsgGCResetStrangeGemCount", - 1092: "k_EMsgGCRequestCrateItems", - 1093: "k_EMsgGCRequestCrateItemsResponse", - 1094: "k_EMsgGCExtractGemsResponse", - 1095: "k_EMsgGCResetStrangeGemCountResponse", - 1103: "k_EMsgGCServerUseItemRequest", - 1104: "k_EMsgGCAddGiftItem", - 1105: "k_EMsgGCRemoveItemGiftMessage", - 1106: "k_EMsgGCRemoveItemGiftMessageResponse", - 1107: "k_EMsgGCRemoveItemGifterAccountId", - 1108: "k_EMsgGCRemoveItemGifterAccountIdResponse", - 1109: "k_EMsgClientToGCRemoveItemGifterAttributes", - 1110: "k_EMsgClientToGCRemoveItemName", - 1111: "k_EMsgClientToGCRemoveItemDescription", - 1112: "k_EMsgClientToGCRemoveItemAttributeResponse", - 1500: "k_EMsgGCTradingBase", - 1501: "k_EMsgGCTrading_InitiateTradeRequest", - 1502: "k_EMsgGCTrading_InitiateTradeResponse", - 1503: "k_EMsgGCTrading_StartSession", - 1509: "k_EMsgGCTrading_SessionClosed", - 1514: "k_EMsgGCTrading_InitiateTradeRequestResponse", - 1601: "k_EMsgGCServerBrowser_FavoriteServer", - 1602: "k_EMsgGCServerBrowser_BlacklistServer", - 1700: "k_EMsgGCServerRentalsBase", - 1701: "k_EMsgGCItemPreviewCheckStatus", - 1702: "k_EMsgGCItemPreviewStatusResponse", - 1703: "k_EMsgGCItemPreviewRequest", - 1704: "k_EMsgGCItemPreviewRequestResponse", - 1705: "k_EMsgGCItemPreviewExpire", - 1706: "k_EMsgGCItemPreviewExpireNotification", - 1707: "k_EMsgGCItemPreviewItemBoughtNotification", - 2001: "k_EMsgGCDev_NewItemRequest", - 2002: "k_EMsgGCDev_NewItemRequestResponse", - 2500: "k_EMsgGCStoreGetUserData", - 2501: "k_EMsgGCStoreGetUserDataResponse", - 2504: "k_EMsgGCStorePurchaseFinalize", - 2505: "k_EMsgGCStorePurchaseFinalizeResponse", - 2506: "k_EMsgGCStorePurchaseCancel", - 2507: "k_EMsgGCStorePurchaseCancelResponse", - 2510: "k_EMsgGCStorePurchaseInit", - 2511: "k_EMsgGCStorePurchaseInitResponse", - 2512: "k_EMsgGCBannedWordListRequest", - 2513: "k_EMsgGCBannedWordListResponse", - 2514: "k_EMsgGCToGCBannedWordListBroadcast", - 2515: "k_EMsgGCToGCBannedWordListUpdated", - 2516: "k_EMsgGCToGCDirtySDOCache", - 2517: "k_EMsgGCToGCDirtyMultipleSDOCache", - 2518: "k_EMsgGCToGCUpdateSQLKeyValue", - 2521: "k_EMsgGCToGCBroadcastConsoleCommand", - 2522: "k_EMsgGCServerVersionUpdated", - 2523: "k_EMsgGCApplyAutograph", - 2524: "k_EMsgGCToGCWebAPIAccountChanged", - 2528: "k_EMsgGCClientVersionUpdated", - 2531: "k_EMsgGCItemPurgatory_FinalizePurchase", - 2532: "k_EMsgGCItemPurgatory_FinalizePurchaseResponse", - 2533: "k_EMsgGCItemPurgatory_RefundPurchase", - 2534: "k_EMsgGCItemPurgatory_RefundPurchaseResponse", - 2535: "k_EMsgGCToGCPlayerStrangeCountAdjustments", - 2536: "k_EMsgGCRequestStoreSalesData", - 2537: "k_EMsgGCRequestStoreSalesDataResponse", - 2538: "k_EMsgGCRequestStoreSalesDataUpToDateResponse", - 2539: "k_EMsgGCToGCPingRequest", - 2540: "k_EMsgGCToGCPingResponse", - 2541: "k_EMsgGCToGCGetUserSessionServer", - 2542: "k_EMsgGCToGCGetUserSessionServerResponse", - 2543: "k_EMsgGCToGCGetUserServerMembers", - 2544: "k_EMsgGCToGCGetUserServerMembersResponse", - 2545: "k_EMsgGCToGCGetUserPCBangNo", - 2546: "k_EMsgGCToGCGetUserPCBangNoResponse", - 2547: "k_EMsgGCToGCCanUseDropRateBonus", - 2548: "k_EMsgSQLAddDropRateBonus", - 2549: "k_EMsgGCToGCRefreshSOCache", - 2550: "k_EMsgGCToGCApplyLocalizationDiff", - 2551: "k_EMsgGCToGCApplyLocalizationDiffResponse", - 2552: "k_EMsgGCToGCCheckAccountTradeStatus", - 2553: "k_EMsgGCToGCCheckAccountTradeStatusResponse", - 2554: "k_EMsgGCToGCGrantAccountRolledItems", - 2555: "k_EMsgGCToGCGrantSelfMadeItemToAccount", - 2556: "k_EMsgSQLUpgradeBattleBooster", - 2557: "k_EMsgGCPartnerBalanceRequest", - 2558: "k_EMsgGCPartnerBalanceResponse", - 2559: "k_EMsgGCPartnerRechargeRedirectURLRequest", - 2560: "k_EMsgGCPartnerRechargeRedirectURLResponse", - 2561: "k_EMsgGCStatueCraft", - 2562: "k_EMsgGCRedeemCode", - 2563: "k_EMsgGCRedeemCodeResponse", - 2564: "k_EMsgGCToGCItemConsumptionRollback", - 2565: "k_EMsgClientToGCWrapAndDeliverGift", - 2566: "k_EMsgClientToGCWrapAndDeliverGiftResponse", - 2567: "k_EMsgClientToGCUnpackBundleResponse", - 2568: "k_EMsgGCToClientStoreTransactionCompleted", - 2569: "k_EMsgClientToGCEquipItems", - 2570: "k_EMsgClientToGCEquipItemsResponse", - 2571: "k_EMsgClientToGCUnlockItemStyle", - 2572: "k_EMsgClientToGCUnlockItemStyleResponse", - 2573: "k_EMsgClientToGCSetItemInventoryCategory", - 2574: "k_EMsgClientToGCUnlockCrate", - 2575: "k_EMsgClientToGCUnlockCrateResponse", - 2576: "k_EMsgClientToGCUnpackBundle", - 2577: "k_EMsgClientToGCSetItemStyle", - 2578: "k_EMsgClientToGCSetItemStyleResponse", - 2579: "k_EMsgGCGenericResult", - 2580: "k_EMsgSQLGCToGCGrantBackpackSlots", - 2581: "k_EMsgClientToGCLookupAccountName", - 2582: "k_EMsgClientToGCLookupAccountNameResponse", -} -var EGCItemMsg_value = map[string]int32{ - "k_EMsgGCBase": 1000, - "k_EMsgGCSetItemPosition": 1001, - "k_EMsgGCCraft": 1002, - "k_EMsgGCCraftResponse": 1003, - "k_EMsgGCDelete": 1004, - "k_EMsgGCVerifyCacheSubscription": 1005, - "k_EMsgClientToGCNameItem": 1006, - "k_EMsgGCPaintItem": 1009, - "k_EMsgGCPaintItemResponse": 1010, - "k_EMsgGCGoldenWrenchBroadcast": 1011, - "k_EMsgGCMOTDRequest": 1012, - "k_EMsgGCMOTDRequestResponse": 1013, - "k_EMsgGCAddItemToSocket_DEPRECATED": 1014, - "k_EMsgGCAddItemToSocketResponse_DEPRECATED": 1015, - "k_EMsgGCAddSocketToBaseItem_DEPRECATED": 1016, - "k_EMsgGCAddSocketToItem_DEPRECATED": 1017, - "k_EMsgGCAddSocketToItemResponse_DEPRECATED": 1018, - "k_EMsgGCNameBaseItem": 1019, - "k_EMsgGCNameBaseItemResponse": 1020, - "k_EMsgGCRemoveSocketItem_DEPRECATED": 1021, - "k_EMsgGCRemoveSocketItemResponse_DEPRECATED": 1022, - "k_EMsgGCCustomizeItemTexture": 1023, - "k_EMsgGCCustomizeItemTextureResponse": 1024, - "k_EMsgGCUseItemRequest": 1025, - "k_EMsgGCUseItemResponse": 1026, - "k_EMsgGCGiftedItems": 1027, - "k_EMsgGCRemoveItemName": 1030, - "k_EMsgGCRemoveItemPaint": 1031, - "k_EMsgGCUnwrapGiftRequest": 1037, - "k_EMsgGCUnwrapGiftResponse": 1038, - "k_EMsgGCSetItemStyle_DEPRECATED": 1039, - "k_EMsgGCUsedClaimCodeItem": 1040, - "k_EMsgGCSortItems": 1041, - "k_EMsgGC_RevolvingLootList_DEPRECATED": 1042, - "k_EMsgGCUpdateItemSchema": 1049, - "k_EMsgGCRemoveCustomTexture": 1051, - "k_EMsgGCRemoveCustomTextureResponse": 1052, - "k_EMsgGCRemoveMakersMark": 1053, - "k_EMsgGCRemoveMakersMarkResponse": 1054, - "k_EMsgGCRemoveUniqueCraftIndex": 1055, - "k_EMsgGCRemoveUniqueCraftIndexResponse": 1056, - "k_EMsgGCSaxxyBroadcast": 1057, - "k_EMsgGCBackpackSortFinished": 1058, - "k_EMsgGCAdjustItemEquippedState": 1059, - "k_EMsgGCCollectItem": 1061, - "k_EMsgGCItemAcknowledged": 1062, - "k_EMsgGCPresets_SelectPresetForClass": 1063, - "k_EMsgGCPresets_SetItemPosition": 1064, - "k_EMsgGCPresets_SelectPresetForClassReply": 1067, - "k_EMsgClientToGCNameItemResponse": 1068, - "k_EMsgGCApplyConsumableEffects": 1069, - "k_EMsgGCConsumableExhausted": 1070, - "k_EMsgGCShowItemsPickedUp": 1071, - "k_EMsgGCClientDisplayNotification": 1072, - "k_EMsgGCApplyStrangePart": 1073, - "k_EMsgGC_IncrementKillCountResponse": 1075, - "k_EMsgGCApplyPennantUpgrade": 1076, - "k_EMsgGCSetItemPositions": 1077, - "k_EMsgGCSetItemPositions_RateLimited": 1096, - "k_EMsgGCApplyEggEssence": 1078, - "k_EMsgGCNameEggEssenceResponse": 1079, - "k_EMsgGCFulfillDynamicRecipeComponent": 1082, - "k_EMsgGCFulfillDynamicRecipeComponentResponse": 1083, - "k_EMsgGCClientRequestMarketData": 1084, - "k_EMsgGCClientRequestMarketDataResponse": 1085, - "k_EMsgGCExtractGems": 1086, - "k_EMsgGCAddSocket": 1087, - "k_EMsgGCAddItemToSocket": 1088, - "k_EMsgGCAddItemToSocketResponse": 1089, - "k_EMsgGCAddSocketResponse": 1090, - "k_EMsgGCResetStrangeGemCount": 1091, - "k_EMsgGCRequestCrateItems": 1092, - "k_EMsgGCRequestCrateItemsResponse": 1093, - "k_EMsgGCExtractGemsResponse": 1094, - "k_EMsgGCResetStrangeGemCountResponse": 1095, - "k_EMsgGCServerUseItemRequest": 1103, - "k_EMsgGCAddGiftItem": 1104, - "k_EMsgGCRemoveItemGiftMessage": 1105, - "k_EMsgGCRemoveItemGiftMessageResponse": 1106, - "k_EMsgGCRemoveItemGifterAccountId": 1107, - "k_EMsgGCRemoveItemGifterAccountIdResponse": 1108, - "k_EMsgClientToGCRemoveItemGifterAttributes": 1109, - "k_EMsgClientToGCRemoveItemName": 1110, - "k_EMsgClientToGCRemoveItemDescription": 1111, - "k_EMsgClientToGCRemoveItemAttributeResponse": 1112, - "k_EMsgGCTradingBase": 1500, - "k_EMsgGCTrading_InitiateTradeRequest": 1501, - "k_EMsgGCTrading_InitiateTradeResponse": 1502, - "k_EMsgGCTrading_StartSession": 1503, - "k_EMsgGCTrading_SessionClosed": 1509, - "k_EMsgGCTrading_InitiateTradeRequestResponse": 1514, - "k_EMsgGCServerBrowser_FavoriteServer": 1601, - "k_EMsgGCServerBrowser_BlacklistServer": 1602, - "k_EMsgGCServerRentalsBase": 1700, - "k_EMsgGCItemPreviewCheckStatus": 1701, - "k_EMsgGCItemPreviewStatusResponse": 1702, - "k_EMsgGCItemPreviewRequest": 1703, - "k_EMsgGCItemPreviewRequestResponse": 1704, - "k_EMsgGCItemPreviewExpire": 1705, - "k_EMsgGCItemPreviewExpireNotification": 1706, - "k_EMsgGCItemPreviewItemBoughtNotification": 1707, - "k_EMsgGCDev_NewItemRequest": 2001, - "k_EMsgGCDev_NewItemRequestResponse": 2002, - "k_EMsgGCStoreGetUserData": 2500, - "k_EMsgGCStoreGetUserDataResponse": 2501, - "k_EMsgGCStorePurchaseFinalize": 2504, - "k_EMsgGCStorePurchaseFinalizeResponse": 2505, - "k_EMsgGCStorePurchaseCancel": 2506, - "k_EMsgGCStorePurchaseCancelResponse": 2507, - "k_EMsgGCStorePurchaseInit": 2510, - "k_EMsgGCStorePurchaseInitResponse": 2511, - "k_EMsgGCBannedWordListRequest": 2512, - "k_EMsgGCBannedWordListResponse": 2513, - "k_EMsgGCToGCBannedWordListBroadcast": 2514, - "k_EMsgGCToGCBannedWordListUpdated": 2515, - "k_EMsgGCToGCDirtySDOCache": 2516, - "k_EMsgGCToGCDirtyMultipleSDOCache": 2517, - "k_EMsgGCToGCUpdateSQLKeyValue": 2518, - "k_EMsgGCToGCBroadcastConsoleCommand": 2521, - "k_EMsgGCServerVersionUpdated": 2522, - "k_EMsgGCApplyAutograph": 2523, - "k_EMsgGCToGCWebAPIAccountChanged": 2524, - "k_EMsgGCClientVersionUpdated": 2528, - "k_EMsgGCItemPurgatory_FinalizePurchase": 2531, - "k_EMsgGCItemPurgatory_FinalizePurchaseResponse": 2532, - "k_EMsgGCItemPurgatory_RefundPurchase": 2533, - "k_EMsgGCItemPurgatory_RefundPurchaseResponse": 2534, - "k_EMsgGCToGCPlayerStrangeCountAdjustments": 2535, - "k_EMsgGCRequestStoreSalesData": 2536, - "k_EMsgGCRequestStoreSalesDataResponse": 2537, - "k_EMsgGCRequestStoreSalesDataUpToDateResponse": 2538, - "k_EMsgGCToGCPingRequest": 2539, - "k_EMsgGCToGCPingResponse": 2540, - "k_EMsgGCToGCGetUserSessionServer": 2541, - "k_EMsgGCToGCGetUserSessionServerResponse": 2542, - "k_EMsgGCToGCGetUserServerMembers": 2543, - "k_EMsgGCToGCGetUserServerMembersResponse": 2544, - "k_EMsgGCToGCGetUserPCBangNo": 2545, - "k_EMsgGCToGCGetUserPCBangNoResponse": 2546, - "k_EMsgGCToGCCanUseDropRateBonus": 2547, - "k_EMsgSQLAddDropRateBonus": 2548, - "k_EMsgGCToGCRefreshSOCache": 2549, - "k_EMsgGCToGCApplyLocalizationDiff": 2550, - "k_EMsgGCToGCApplyLocalizationDiffResponse": 2551, - "k_EMsgGCToGCCheckAccountTradeStatus": 2552, - "k_EMsgGCToGCCheckAccountTradeStatusResponse": 2553, - "k_EMsgGCToGCGrantAccountRolledItems": 2554, - "k_EMsgGCToGCGrantSelfMadeItemToAccount": 2555, - "k_EMsgSQLUpgradeBattleBooster": 2556, - "k_EMsgGCPartnerBalanceRequest": 2557, - "k_EMsgGCPartnerBalanceResponse": 2558, - "k_EMsgGCPartnerRechargeRedirectURLRequest": 2559, - "k_EMsgGCPartnerRechargeRedirectURLResponse": 2560, - "k_EMsgGCStatueCraft": 2561, - "k_EMsgGCRedeemCode": 2562, - "k_EMsgGCRedeemCodeResponse": 2563, - "k_EMsgGCToGCItemConsumptionRollback": 2564, - "k_EMsgClientToGCWrapAndDeliverGift": 2565, - "k_EMsgClientToGCWrapAndDeliverGiftResponse": 2566, - "k_EMsgClientToGCUnpackBundleResponse": 2567, - "k_EMsgGCToClientStoreTransactionCompleted": 2568, - "k_EMsgClientToGCEquipItems": 2569, - "k_EMsgClientToGCEquipItemsResponse": 2570, - "k_EMsgClientToGCUnlockItemStyle": 2571, - "k_EMsgClientToGCUnlockItemStyleResponse": 2572, - "k_EMsgClientToGCSetItemInventoryCategory": 2573, - "k_EMsgClientToGCUnlockCrate": 2574, - "k_EMsgClientToGCUnlockCrateResponse": 2575, - "k_EMsgClientToGCUnpackBundle": 2576, - "k_EMsgClientToGCSetItemStyle": 2577, - "k_EMsgClientToGCSetItemStyleResponse": 2578, - "k_EMsgGCGenericResult": 2579, - "k_EMsgSQLGCToGCGrantBackpackSlots": 2580, - "k_EMsgClientToGCLookupAccountName": 2581, - "k_EMsgClientToGCLookupAccountNameResponse": 2582, -} - -func (x EGCItemMsg) Enum() *EGCItemMsg { - p := new(EGCItemMsg) - *p = x - return p -} -func (x EGCItemMsg) String() string { - return proto.EnumName(EGCItemMsg_name, int32(x)) -} -func (x *EGCItemMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCItemMsg_value, data, "EGCItemMsg") - if err != nil { - return err - } - *x = EGCItemMsg(value) - return nil -} -func (EGCItemMsg) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{0} } - -type EGCMsgResponse int32 - -const ( - EGCMsgResponse_k_EGCMsgResponseOK EGCMsgResponse = 0 - EGCMsgResponse_k_EGCMsgResponseDenied EGCMsgResponse = 1 - EGCMsgResponse_k_EGCMsgResponseServerError EGCMsgResponse = 2 - EGCMsgResponse_k_EGCMsgResponseTimeout EGCMsgResponse = 3 - EGCMsgResponse_k_EGCMsgResponseInvalid EGCMsgResponse = 4 - EGCMsgResponse_k_EGCMsgResponseNoMatch EGCMsgResponse = 5 - EGCMsgResponse_k_EGCMsgResponseUnknownError EGCMsgResponse = 6 - EGCMsgResponse_k_EGCMsgResponseNotLoggedOn EGCMsgResponse = 7 - EGCMsgResponse_k_EGCMsgFailedToCreate EGCMsgResponse = 8 -) - -var EGCMsgResponse_name = map[int32]string{ - 0: "k_EGCMsgResponseOK", - 1: "k_EGCMsgResponseDenied", - 2: "k_EGCMsgResponseServerError", - 3: "k_EGCMsgResponseTimeout", - 4: "k_EGCMsgResponseInvalid", - 5: "k_EGCMsgResponseNoMatch", - 6: "k_EGCMsgResponseUnknownError", - 7: "k_EGCMsgResponseNotLoggedOn", - 8: "k_EGCMsgFailedToCreate", -} -var EGCMsgResponse_value = map[string]int32{ - "k_EGCMsgResponseOK": 0, - "k_EGCMsgResponseDenied": 1, - "k_EGCMsgResponseServerError": 2, - "k_EGCMsgResponseTimeout": 3, - "k_EGCMsgResponseInvalid": 4, - "k_EGCMsgResponseNoMatch": 5, - "k_EGCMsgResponseUnknownError": 6, - "k_EGCMsgResponseNotLoggedOn": 7, - "k_EGCMsgFailedToCreate": 8, -} - -func (x EGCMsgResponse) Enum() *EGCMsgResponse { - p := new(EGCMsgResponse) - *p = x - return p -} -func (x EGCMsgResponse) String() string { - return proto.EnumName(EGCMsgResponse_name, int32(x)) -} -func (x *EGCMsgResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCMsgResponse_value, data, "EGCMsgResponse") - if err != nil { - return err - } - *x = EGCMsgResponse(value) - return nil -} -func (EGCMsgResponse) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{1} } - -type EItemPurgatoryResponse_Finalize int32 - -const ( - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Succeeded EItemPurgatoryResponse_Finalize = 0 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_Incomplete EItemPurgatoryResponse_Finalize = 1 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_ItemsNotInPurgatory EItemPurgatoryResponse_Finalize = 2 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_CouldNotFindItems EItemPurgatoryResponse_Finalize = 3 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_NoSOCache EItemPurgatoryResponse_Finalize = 4 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_BackpackFull EItemPurgatoryResponse_Finalize = 5 -) - -var EItemPurgatoryResponse_Finalize_name = map[int32]string{ - 0: "k_ItemPurgatoryResponse_Finalize_Succeeded", - 1: "k_ItemPurgatoryResponse_Finalize_Failed_Incomplete", - 2: "k_ItemPurgatoryResponse_Finalize_Failed_ItemsNotInPurgatory", - 3: "k_ItemPurgatoryResponse_Finalize_Failed_CouldNotFindItems", - 4: "k_ItemPurgatoryResponse_Finalize_Failed_NoSOCache", - 5: "k_ItemPurgatoryResponse_Finalize_BackpackFull", -} -var EItemPurgatoryResponse_Finalize_value = map[string]int32{ - "k_ItemPurgatoryResponse_Finalize_Succeeded": 0, - "k_ItemPurgatoryResponse_Finalize_Failed_Incomplete": 1, - "k_ItemPurgatoryResponse_Finalize_Failed_ItemsNotInPurgatory": 2, - "k_ItemPurgatoryResponse_Finalize_Failed_CouldNotFindItems": 3, - "k_ItemPurgatoryResponse_Finalize_Failed_NoSOCache": 4, - "k_ItemPurgatoryResponse_Finalize_BackpackFull": 5, -} - -func (x EItemPurgatoryResponse_Finalize) Enum() *EItemPurgatoryResponse_Finalize { - p := new(EItemPurgatoryResponse_Finalize) - *p = x - return p -} -func (x EItemPurgatoryResponse_Finalize) String() string { - return proto.EnumName(EItemPurgatoryResponse_Finalize_name, int32(x)) -} -func (x *EItemPurgatoryResponse_Finalize) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EItemPurgatoryResponse_Finalize_value, data, "EItemPurgatoryResponse_Finalize") - if err != nil { - return err - } - *x = EItemPurgatoryResponse_Finalize(value) - return nil -} -func (EItemPurgatoryResponse_Finalize) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{2} -} - -type EItemPurgatoryResponse_Refund int32 - -const ( - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Succeeded EItemPurgatoryResponse_Refund = 0 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_ItemNotInPurgatory EItemPurgatoryResponse_Refund = 1 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_CouldNotFindItem EItemPurgatoryResponse_Refund = 2 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_NoSOCache EItemPurgatoryResponse_Refund = 3 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_NoDetail EItemPurgatoryResponse_Refund = 4 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_NexonWebAPI EItemPurgatoryResponse_Refund = 5 -) - -var EItemPurgatoryResponse_Refund_name = map[int32]string{ - 0: "k_ItemPurgatoryResponse_Refund_Succeeded", - 1: "k_ItemPurgatoryResponse_Refund_Failed_ItemNotInPurgatory", - 2: "k_ItemPurgatoryResponse_Refund_Failed_CouldNotFindItem", - 3: "k_ItemPurgatoryResponse_Refund_Failed_NoSOCache", - 4: "k_ItemPurgatoryResponse_Refund_Failed_NoDetail", - 5: "k_ItemPurgatoryResponse_Refund_Failed_NexonWebAPI", -} -var EItemPurgatoryResponse_Refund_value = map[string]int32{ - "k_ItemPurgatoryResponse_Refund_Succeeded": 0, - "k_ItemPurgatoryResponse_Refund_Failed_ItemNotInPurgatory": 1, - "k_ItemPurgatoryResponse_Refund_Failed_CouldNotFindItem": 2, - "k_ItemPurgatoryResponse_Refund_Failed_NoSOCache": 3, - "k_ItemPurgatoryResponse_Refund_Failed_NoDetail": 4, - "k_ItemPurgatoryResponse_Refund_Failed_NexonWebAPI": 5, -} - -func (x EItemPurgatoryResponse_Refund) Enum() *EItemPurgatoryResponse_Refund { - p := new(EItemPurgatoryResponse_Refund) - *p = x - return p -} -func (x EItemPurgatoryResponse_Refund) String() string { - return proto.EnumName(EItemPurgatoryResponse_Refund_name, int32(x)) -} -func (x *EItemPurgatoryResponse_Refund) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EItemPurgatoryResponse_Refund_value, data, "EItemPurgatoryResponse_Refund") - if err != nil { - return err - } - *x = EItemPurgatoryResponse_Refund(value) - return nil -} -func (EItemPurgatoryResponse_Refund) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{3} -} - -type EGCPartnerRequestResponse int32 - -const ( - EGCPartnerRequestResponse_k_EPartnerRequestOK EGCPartnerRequestResponse = 1 - EGCPartnerRequestResponse_k_EPartnerRequestBadAccount EGCPartnerRequestResponse = 2 - EGCPartnerRequestResponse_k_EPartnerRequestNotLinked EGCPartnerRequestResponse = 3 - EGCPartnerRequestResponse_k_EPartnerRequestUnsupportedPartnerType EGCPartnerRequestResponse = 4 -) - -var EGCPartnerRequestResponse_name = map[int32]string{ - 1: "k_EPartnerRequestOK", - 2: "k_EPartnerRequestBadAccount", - 3: "k_EPartnerRequestNotLinked", - 4: "k_EPartnerRequestUnsupportedPartnerType", -} -var EGCPartnerRequestResponse_value = map[string]int32{ - "k_EPartnerRequestOK": 1, - "k_EPartnerRequestBadAccount": 2, - "k_EPartnerRequestNotLinked": 3, - "k_EPartnerRequestUnsupportedPartnerType": 4, -} - -func (x EGCPartnerRequestResponse) Enum() *EGCPartnerRequestResponse { - p := new(EGCPartnerRequestResponse) - *p = x - return p -} -func (x EGCPartnerRequestResponse) String() string { - return proto.EnumName(EGCPartnerRequestResponse_name, int32(x)) -} -func (x *EGCPartnerRequestResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCPartnerRequestResponse_value, data, "EGCPartnerRequestResponse") - if err != nil { - return err - } - *x = EGCPartnerRequestResponse(value) - return nil -} -func (EGCPartnerRequestResponse) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{4} } - -type EGCMsgInitiateTradeResponse int32 - -const ( - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Accepted EGCMsgInitiateTradeResponse = 0 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Declined EGCMsgInitiateTradeResponse = 1 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_VAC_Banned_Initiator EGCMsgInitiateTradeResponse = 2 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_VAC_Banned_Target EGCMsgInitiateTradeResponse = 3 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Target_Already_Trading EGCMsgInitiateTradeResponse = 4 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Disabled EGCMsgInitiateTradeResponse = 5 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_NotLoggedIn EGCMsgInitiateTradeResponse = 6 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Cancel EGCMsgInitiateTradeResponse = 7 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_TooSoon EGCMsgInitiateTradeResponse = 8 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_TooSoonPenalty EGCMsgInitiateTradeResponse = 9 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Trade_Banned_Initiator EGCMsgInitiateTradeResponse = 10 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Trade_Banned_Target EGCMsgInitiateTradeResponse = 11 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Free_Account_Initiator_DEPRECATED EGCMsgInitiateTradeResponse = 12 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Shared_Account_Initiator EGCMsgInitiateTradeResponse = 13 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Service_Unavailable EGCMsgInitiateTradeResponse = 14 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Target_Blocked EGCMsgInitiateTradeResponse = 15 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_NeedVerifiedEmail EGCMsgInitiateTradeResponse = 16 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_NeedSteamGuard EGCMsgInitiateTradeResponse = 17 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_SteamGuardDuration EGCMsgInitiateTradeResponse = 18 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_TheyCannotTrade EGCMsgInitiateTradeResponse = 19 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Recent_Password_Reset EGCMsgInitiateTradeResponse = 20 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Using_New_Device EGCMsgInitiateTradeResponse = 21 - EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Sent_Invalid_Cookie EGCMsgInitiateTradeResponse = 22 -) - -var EGCMsgInitiateTradeResponse_name = map[int32]string{ - 0: "k_EGCMsgInitiateTradeResponse_Accepted", - 1: "k_EGCMsgInitiateTradeResponse_Declined", - 2: "k_EGCMsgInitiateTradeResponse_VAC_Banned_Initiator", - 3: "k_EGCMsgInitiateTradeResponse_VAC_Banned_Target", - 4: "k_EGCMsgInitiateTradeResponse_Target_Already_Trading", - 5: "k_EGCMsgInitiateTradeResponse_Disabled", - 6: "k_EGCMsgInitiateTradeResponse_NotLoggedIn", - 7: "k_EGCMsgInitiateTradeResponse_Cancel", - 8: "k_EGCMsgInitiateTradeResponse_TooSoon", - 9: "k_EGCMsgInitiateTradeResponse_TooSoonPenalty", - 10: "k_EGCMsgInitiateTradeResponse_Trade_Banned_Initiator", - 11: "k_EGCMsgInitiateTradeResponse_Trade_Banned_Target", - 12: "k_EGCMsgInitiateTradeResponse_Free_Account_Initiator_DEPRECATED", - 13: "k_EGCMsgInitiateTradeResponse_Shared_Account_Initiator", - 14: "k_EGCMsgInitiateTradeResponse_Service_Unavailable", - 15: "k_EGCMsgInitiateTradeResponse_Target_Blocked", - 16: "k_EGCMsgInitiateTradeResponse_NeedVerifiedEmail", - 17: "k_EGCMsgInitiateTradeResponse_NeedSteamGuard", - 18: "k_EGCMsgInitiateTradeResponse_SteamGuardDuration", - 19: "k_EGCMsgInitiateTradeResponse_TheyCannotTrade", - 20: "k_EGCMsgInitiateTradeResponse_Recent_Password_Reset", - 21: "k_EGCMsgInitiateTradeResponse_Using_New_Device", - 22: "k_EGCMsgInitiateTradeResponse_Sent_Invalid_Cookie", -} -var EGCMsgInitiateTradeResponse_value = map[string]int32{ - "k_EGCMsgInitiateTradeResponse_Accepted": 0, - "k_EGCMsgInitiateTradeResponse_Declined": 1, - "k_EGCMsgInitiateTradeResponse_VAC_Banned_Initiator": 2, - "k_EGCMsgInitiateTradeResponse_VAC_Banned_Target": 3, - "k_EGCMsgInitiateTradeResponse_Target_Already_Trading": 4, - "k_EGCMsgInitiateTradeResponse_Disabled": 5, - "k_EGCMsgInitiateTradeResponse_NotLoggedIn": 6, - "k_EGCMsgInitiateTradeResponse_Cancel": 7, - "k_EGCMsgInitiateTradeResponse_TooSoon": 8, - "k_EGCMsgInitiateTradeResponse_TooSoonPenalty": 9, - "k_EGCMsgInitiateTradeResponse_Trade_Banned_Initiator": 10, - "k_EGCMsgInitiateTradeResponse_Trade_Banned_Target": 11, - "k_EGCMsgInitiateTradeResponse_Free_Account_Initiator_DEPRECATED": 12, - "k_EGCMsgInitiateTradeResponse_Shared_Account_Initiator": 13, - "k_EGCMsgInitiateTradeResponse_Service_Unavailable": 14, - "k_EGCMsgInitiateTradeResponse_Target_Blocked": 15, - "k_EGCMsgInitiateTradeResponse_NeedVerifiedEmail": 16, - "k_EGCMsgInitiateTradeResponse_NeedSteamGuard": 17, - "k_EGCMsgInitiateTradeResponse_SteamGuardDuration": 18, - "k_EGCMsgInitiateTradeResponse_TheyCannotTrade": 19, - "k_EGCMsgInitiateTradeResponse_Recent_Password_Reset": 20, - "k_EGCMsgInitiateTradeResponse_Using_New_Device": 21, - "k_EGCMsgInitiateTradeResponse_Sent_Invalid_Cookie": 22, -} - -func (x EGCMsgInitiateTradeResponse) Enum() *EGCMsgInitiateTradeResponse { - p := new(EGCMsgInitiateTradeResponse) - *p = x - return p -} -func (x EGCMsgInitiateTradeResponse) String() string { - return proto.EnumName(EGCMsgInitiateTradeResponse_name, int32(x)) -} -func (x *EGCMsgInitiateTradeResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCMsgInitiateTradeResponse_value, data, "EGCMsgInitiateTradeResponse") - if err != nil { - return err - } - *x = EGCMsgInitiateTradeResponse(value) - return nil -} -func (EGCMsgInitiateTradeResponse) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{5} } - -type CMsgRequestCrateItemsResponse_EResult int32 - -const ( - CMsgRequestCrateItemsResponse_k_Succeeded CMsgRequestCrateItemsResponse_EResult = 0 - CMsgRequestCrateItemsResponse_k_Failed CMsgRequestCrateItemsResponse_EResult = 1 -) - -var CMsgRequestCrateItemsResponse_EResult_name = map[int32]string{ - 0: "k_Succeeded", - 1: "k_Failed", -} -var CMsgRequestCrateItemsResponse_EResult_value = map[string]int32{ - "k_Succeeded": 0, - "k_Failed": 1, -} - -func (x CMsgRequestCrateItemsResponse_EResult) Enum() *CMsgRequestCrateItemsResponse_EResult { - p := new(CMsgRequestCrateItemsResponse_EResult) - *p = x - return p -} -func (x CMsgRequestCrateItemsResponse_EResult) String() string { - return proto.EnumName(CMsgRequestCrateItemsResponse_EResult_name, int32(x)) -} -func (x *CMsgRequestCrateItemsResponse_EResult) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgRequestCrateItemsResponse_EResult_value, data, "CMsgRequestCrateItemsResponse_EResult") - if err != nil { - return err - } - *x = CMsgRequestCrateItemsResponse_EResult(value) - return nil -} -func (CMsgRequestCrateItemsResponse_EResult) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{22, 0} -} - -type CMsgRedeemCodeResponse_EResultCode int32 - -const ( - CMsgRedeemCodeResponse_k_Succeeded CMsgRedeemCodeResponse_EResultCode = 0 - CMsgRedeemCodeResponse_k_Failed_CodeNotFound CMsgRedeemCodeResponse_EResultCode = 1 - CMsgRedeemCodeResponse_k_Failed_CodeAlreadyUsed CMsgRedeemCodeResponse_EResultCode = 2 - CMsgRedeemCodeResponse_k_Failed_OtherError CMsgRedeemCodeResponse_EResultCode = 3 -) - -var CMsgRedeemCodeResponse_EResultCode_name = map[int32]string{ - 0: "k_Succeeded", - 1: "k_Failed_CodeNotFound", - 2: "k_Failed_CodeAlreadyUsed", - 3: "k_Failed_OtherError", -} -var CMsgRedeemCodeResponse_EResultCode_value = map[string]int32{ - "k_Succeeded": 0, - "k_Failed_CodeNotFound": 1, - "k_Failed_CodeAlreadyUsed": 2, - "k_Failed_OtherError": 3, -} - -func (x CMsgRedeemCodeResponse_EResultCode) Enum() *CMsgRedeemCodeResponse_EResultCode { - p := new(CMsgRedeemCodeResponse_EResultCode) - *p = x - return p -} -func (x CMsgRedeemCodeResponse_EResultCode) String() string { - return proto.EnumName(CMsgRedeemCodeResponse_EResultCode_name, int32(x)) -} -func (x *CMsgRedeemCodeResponse_EResultCode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgRedeemCodeResponse_EResultCode_value, data, "CMsgRedeemCodeResponse_EResultCode") - if err != nil { - return err - } - *x = CMsgRedeemCodeResponse_EResultCode(value) - return nil -} -func (CMsgRedeemCodeResponse_EResultCode) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{41, 0} -} - -type CMsgClientToGCUnpackBundleResponse_EUnpackBundle int32 - -const ( - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Succeeded CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 0 - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Failed_ItemIsNotBundle CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 1 - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Failed_UnableToCreateContainedItem CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 2 - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Failed_SOCacheError CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 3 - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Failed_ItemIsInvalid CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 4 - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Failed_BadItemQuantity CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 5 - CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Failed_UnableToDeleteItem CMsgClientToGCUnpackBundleResponse_EUnpackBundle = 6 -) - -var CMsgClientToGCUnpackBundleResponse_EUnpackBundle_name = map[int32]string{ - 0: "k_UnpackBundle_Succeeded", - 1: "k_UnpackBundle_Failed_ItemIsNotBundle", - 2: "k_UnpackBundle_Failed_UnableToCreateContainedItem", - 3: "k_UnpackBundle_Failed_SOCacheError", - 4: "k_UnpackBundle_Failed_ItemIsInvalid", - 5: "k_UnpackBundle_Failed_BadItemQuantity", - 6: "k_UnpackBundle_Failed_UnableToDeleteItem", -} -var CMsgClientToGCUnpackBundleResponse_EUnpackBundle_value = map[string]int32{ - "k_UnpackBundle_Succeeded": 0, - "k_UnpackBundle_Failed_ItemIsNotBundle": 1, - "k_UnpackBundle_Failed_UnableToCreateContainedItem": 2, - "k_UnpackBundle_Failed_SOCacheError": 3, - "k_UnpackBundle_Failed_ItemIsInvalid": 4, - "k_UnpackBundle_Failed_BadItemQuantity": 5, - "k_UnpackBundle_Failed_UnableToDeleteItem": 6, -} - -func (x CMsgClientToGCUnpackBundleResponse_EUnpackBundle) Enum() *CMsgClientToGCUnpackBundleResponse_EUnpackBundle { - p := new(CMsgClientToGCUnpackBundleResponse_EUnpackBundle) - *p = x - return p -} -func (x CMsgClientToGCUnpackBundleResponse_EUnpackBundle) String() string { - return proto.EnumName(CMsgClientToGCUnpackBundleResponse_EUnpackBundle_name, int32(x)) -} -func (x *CMsgClientToGCUnpackBundleResponse_EUnpackBundle) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgClientToGCUnpackBundleResponse_EUnpackBundle_value, data, "CMsgClientToGCUnpackBundleResponse_EUnpackBundle") - if err != nil { - return err - } - *x = CMsgClientToGCUnpackBundleResponse_EUnpackBundle(value) - return nil -} -func (CMsgClientToGCUnpackBundleResponse_EUnpackBundle) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{49, 0} -} - -type CMsgClientToGCSetItemStyleResponse_ESetStyle int32 - -const ( - CMsgClientToGCSetItemStyleResponse_k_SetStyle_Succeeded CMsgClientToGCSetItemStyleResponse_ESetStyle = 0 - CMsgClientToGCSetItemStyleResponse_k_SetStyle_Failed CMsgClientToGCSetItemStyleResponse_ESetStyle = 1 - CMsgClientToGCSetItemStyleResponse_k_SetStyle_Failed_StyleIsLocked CMsgClientToGCSetItemStyleResponse_ESetStyle = 2 -) - -var CMsgClientToGCSetItemStyleResponse_ESetStyle_name = map[int32]string{ - 0: "k_SetStyle_Succeeded", - 1: "k_SetStyle_Failed", - 2: "k_SetStyle_Failed_StyleIsLocked", -} -var CMsgClientToGCSetItemStyleResponse_ESetStyle_value = map[string]int32{ - "k_SetStyle_Succeeded": 0, - "k_SetStyle_Failed": 1, - "k_SetStyle_Failed_StyleIsLocked": 2, -} - -func (x CMsgClientToGCSetItemStyleResponse_ESetStyle) Enum() *CMsgClientToGCSetItemStyleResponse_ESetStyle { - p := new(CMsgClientToGCSetItemStyleResponse_ESetStyle) - *p = x - return p -} -func (x CMsgClientToGCSetItemStyleResponse_ESetStyle) String() string { - return proto.EnumName(CMsgClientToGCSetItemStyleResponse_ESetStyle_name, int32(x)) -} -func (x *CMsgClientToGCSetItemStyleResponse_ESetStyle) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgClientToGCSetItemStyleResponse_ESetStyle_value, data, "CMsgClientToGCSetItemStyleResponse_ESetStyle") - if err != nil { - return err - } - *x = CMsgClientToGCSetItemStyleResponse_ESetStyle(value) - return nil -} -func (CMsgClientToGCSetItemStyleResponse_ESetStyle) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{54, 0} -} - -type CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle int32 - -const ( - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Succeeded CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 0 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_PreReq CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 1 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_CantAfford CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 2 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_CantCommit CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 3 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_CantLockCache CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 4 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_CantAffordAttrib CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 5 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_CantAffordGem CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 6 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_NoCompendiumLevel CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 7 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_AlreadyUnlocked CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 8 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_OtherError CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 9 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_ItemIsInvalid CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 10 - CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Failed_ToolIsInvalid CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = 11 -) - -var CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle_name = map[int32]string{ - 0: "k_UnlockStyle_Succeeded", - 1: "k_UnlockStyle_Failed_PreReq", - 2: "k_UnlockStyle_Failed_CantAfford", - 3: "k_UnlockStyle_Failed_CantCommit", - 4: "k_UnlockStyle_Failed_CantLockCache", - 5: "k_UnlockStyle_Failed_CantAffordAttrib", - 6: "k_UnlockStyle_Failed_CantAffordGem", - 7: "k_UnlockStyle_Failed_NoCompendiumLevel", - 8: "k_UnlockStyle_Failed_AlreadyUnlocked", - 9: "k_UnlockStyle_Failed_OtherError", - 10: "k_UnlockStyle_Failed_ItemIsInvalid", - 11: "k_UnlockStyle_Failed_ToolIsInvalid", -} -var CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle_value = map[string]int32{ - "k_UnlockStyle_Succeeded": 0, - "k_UnlockStyle_Failed_PreReq": 1, - "k_UnlockStyle_Failed_CantAfford": 2, - "k_UnlockStyle_Failed_CantCommit": 3, - "k_UnlockStyle_Failed_CantLockCache": 4, - "k_UnlockStyle_Failed_CantAffordAttrib": 5, - "k_UnlockStyle_Failed_CantAffordGem": 6, - "k_UnlockStyle_Failed_NoCompendiumLevel": 7, - "k_UnlockStyle_Failed_AlreadyUnlocked": 8, - "k_UnlockStyle_Failed_OtherError": 9, - "k_UnlockStyle_Failed_ItemIsInvalid": 10, - "k_UnlockStyle_Failed_ToolIsInvalid": 11, -} - -func (x CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle) Enum() *CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle { - p := new(CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle) - *p = x - return p -} -func (x CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle) String() string { - return proto.EnumName(CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle_name, int32(x)) -} -func (x *CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle_value, data, "CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle") - if err != nil { - return err - } - *x = CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle(value) - return nil -} -func (CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{56, 0} -} - -type CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute int32 - -const ( - CMsgClientToGCRemoveItemAttributeResponse_k_RemoveItemAttribute_Succeeded CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute = 0 - CMsgClientToGCRemoveItemAttributeResponse_k_RemoveItemAttribute_Failed CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute = 1 - CMsgClientToGCRemoveItemAttributeResponse_k_RemoveItemAttribute_Failed_ItemIsInvalid CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute = 2 - CMsgClientToGCRemoveItemAttributeResponse_k_RemoveItemAttribute_Failed_AttributeCannotBeRemoved CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute = 3 - CMsgClientToGCRemoveItemAttributeResponse_k_RemoveItemAttribute_Failed_AttributeDoesntExist CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute = 4 -) - -var CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute_name = map[int32]string{ - 0: "k_RemoveItemAttribute_Succeeded", - 1: "k_RemoveItemAttribute_Failed", - 2: "k_RemoveItemAttribute_Failed_ItemIsInvalid", - 3: "k_RemoveItemAttribute_Failed_AttributeCannotBeRemoved", - 4: "k_RemoveItemAttribute_Failed_AttributeDoesntExist", -} -var CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute_value = map[string]int32{ - "k_RemoveItemAttribute_Succeeded": 0, - "k_RemoveItemAttribute_Failed": 1, - "k_RemoveItemAttribute_Failed_ItemIsInvalid": 2, - "k_RemoveItemAttribute_Failed_AttributeCannotBeRemoved": 3, - "k_RemoveItemAttribute_Failed_AttributeDoesntExist": 4, -} - -func (x CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute) Enum() *CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute { - p := new(CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute) - *p = x - return p -} -func (x CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute) String() string { - return proto.EnumName(CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute_name, int32(x)) -} -func (x *CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute_value, data, "CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute") - if err != nil { - return err - } - *x = CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute(value) - return nil -} -func (CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{61, 0} -} - -type CMsgClientToGCNameItemResponse_ENameItem int32 - -const ( - CMsgClientToGCNameItemResponse_k_NameItem_Succeeded CMsgClientToGCNameItemResponse_ENameItem = 0 - CMsgClientToGCNameItemResponse_k_NameItem_Failed CMsgClientToGCNameItemResponse_ENameItem = 1 - CMsgClientToGCNameItemResponse_k_NameItem_Failed_ToolIsInvalid CMsgClientToGCNameItemResponse_ENameItem = 2 - CMsgClientToGCNameItemResponse_k_NameItem_Failed_ItemIsInvalid CMsgClientToGCNameItemResponse_ENameItem = 3 - CMsgClientToGCNameItemResponse_k_NameItem_Failed_NameIsInvalid CMsgClientToGCNameItemResponse_ENameItem = 4 -) - -var CMsgClientToGCNameItemResponse_ENameItem_name = map[int32]string{ - 0: "k_NameItem_Succeeded", - 1: "k_NameItem_Failed", - 2: "k_NameItem_Failed_ToolIsInvalid", - 3: "k_NameItem_Failed_ItemIsInvalid", - 4: "k_NameItem_Failed_NameIsInvalid", -} -var CMsgClientToGCNameItemResponse_ENameItem_value = map[string]int32{ - "k_NameItem_Succeeded": 0, - "k_NameItem_Failed": 1, - "k_NameItem_Failed_ToolIsInvalid": 2, - "k_NameItem_Failed_ItemIsInvalid": 3, - "k_NameItem_Failed_NameIsInvalid": 4, -} - -func (x CMsgClientToGCNameItemResponse_ENameItem) Enum() *CMsgClientToGCNameItemResponse_ENameItem { - p := new(CMsgClientToGCNameItemResponse_ENameItem) - *p = x - return p -} -func (x CMsgClientToGCNameItemResponse_ENameItem) String() string { - return proto.EnumName(CMsgClientToGCNameItemResponse_ENameItem_name, int32(x)) -} -func (x *CMsgClientToGCNameItemResponse_ENameItem) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgClientToGCNameItemResponse_ENameItem_value, data, "CMsgClientToGCNameItemResponse_ENameItem") - if err != nil { - return err - } - *x = CMsgClientToGCNameItemResponse_ENameItem(value) - return nil -} -func (CMsgClientToGCNameItemResponse_ENameItem) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{63, 0} -} - -type CMsgApplyAutograph struct { - AutographItemId *uint64 `protobuf:"varint,1,opt,name=autograph_item_id" json:"autograph_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyAutograph) Reset() { *m = CMsgApplyAutograph{} } -func (m *CMsgApplyAutograph) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyAutograph) ProtoMessage() {} -func (*CMsgApplyAutograph) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{0} } - -func (m *CMsgApplyAutograph) GetAutographItemId() uint64 { - if m != nil && m.AutographItemId != nil { - return *m.AutographItemId - } - return 0 -} - -func (m *CMsgApplyAutograph) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -type CMsgAdjustItemEquippedState struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - NewClass *uint32 `protobuf:"varint,2,opt,name=new_class" json:"new_class,omitempty"` - NewSlot *uint32 `protobuf:"varint,3,opt,name=new_slot" json:"new_slot,omitempty"` - StyleIndex *uint32 `protobuf:"varint,4,opt,name=style_index" json:"style_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAdjustItemEquippedState) Reset() { *m = CMsgAdjustItemEquippedState{} } -func (m *CMsgAdjustItemEquippedState) String() string { return proto.CompactTextString(m) } -func (*CMsgAdjustItemEquippedState) ProtoMessage() {} -func (*CMsgAdjustItemEquippedState) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{1} } - -func (m *CMsgAdjustItemEquippedState) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgAdjustItemEquippedState) GetNewClass() uint32 { - if m != nil && m.NewClass != nil { - return *m.NewClass - } - return 0 -} - -func (m *CMsgAdjustItemEquippedState) GetNewSlot() uint32 { - if m != nil && m.NewSlot != nil { - return *m.NewSlot - } - return 0 -} - -func (m *CMsgAdjustItemEquippedState) GetStyleIndex() uint32 { - if m != nil && m.StyleIndex != nil { - return *m.StyleIndex - } - return 0 -} - -type CMsgEconPlayerStrangeCountAdjustment struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - StrangeCountAdjustments []*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment `protobuf:"bytes,2,rep,name=strange_count_adjustments" json:"strange_count_adjustments,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgEconPlayerStrangeCountAdjustment) Reset() { *m = CMsgEconPlayerStrangeCountAdjustment{} } -func (m *CMsgEconPlayerStrangeCountAdjustment) String() string { return proto.CompactTextString(m) } -func (*CMsgEconPlayerStrangeCountAdjustment) ProtoMessage() {} -func (*CMsgEconPlayerStrangeCountAdjustment) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{2} -} - -func (m *CMsgEconPlayerStrangeCountAdjustment) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgEconPlayerStrangeCountAdjustment) GetStrangeCountAdjustments() []*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment { - if m != nil { - return m.StrangeCountAdjustments - } - return nil -} - -type CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment struct { - EventType *uint32 `protobuf:"varint,1,opt,name=event_type" json:"event_type,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - Adjustment *uint32 `protobuf:"varint,3,opt,name=adjustment" json:"adjustment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) Reset() { - *m = CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment{} -} -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) String() string { - return proto.CompactTextString(m) -} -func (*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) ProtoMessage() {} -func (*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{2, 0} -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) GetAdjustment() uint32 { - if m != nil && m.Adjustment != nil { - return *m.Adjustment - } - return 0 -} - -type CMsgRequestItemPurgatory_FinalizePurchase struct { - ItemIds []uint64 `protobuf:"varint,1,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchase) Reset() { - *m = CMsgRequestItemPurgatory_FinalizePurchase{} -} -func (m *CMsgRequestItemPurgatory_FinalizePurchase) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestItemPurgatory_FinalizePurchase) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_FinalizePurchase) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{3} -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchase) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgRequestItemPurgatory_FinalizePurchaseResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - ItemIds []uint64 `protobuf:"varint,2,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) Reset() { - *m = CMsgRequestItemPurgatory_FinalizePurchaseResponse{} -} -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgRequestItemPurgatory_FinalizePurchaseResponse) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_FinalizePurchaseResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{4} -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgRequestItemPurgatory_RefundPurchase struct { - ItemIds []uint64 `protobuf:"varint,1,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_RefundPurchase) Reset() { - *m = CMsgRequestItemPurgatory_RefundPurchase{} -} -func (m *CMsgRequestItemPurgatory_RefundPurchase) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestItemPurgatory_RefundPurchase) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_RefundPurchase) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{5} -} - -func (m *CMsgRequestItemPurgatory_RefundPurchase) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgRequestItemPurgatory_RefundPurchaseResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_RefundPurchaseResponse) Reset() { - *m = CMsgRequestItemPurgatory_RefundPurchaseResponse{} -} -func (m *CMsgRequestItemPurgatory_RefundPurchaseResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgRequestItemPurgatory_RefundPurchaseResponse) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_RefundPurchaseResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{6} -} - -func (m *CMsgRequestItemPurgatory_RefundPurchaseResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgCraftingResponse struct { - ItemIds []uint64 `protobuf:"varint,1,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCraftingResponse) Reset() { *m = CMsgCraftingResponse{} } -func (m *CMsgCraftingResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgCraftingResponse) ProtoMessage() {} -func (*CMsgCraftingResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{7} } - -func (m *CMsgCraftingResponse) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgGCRequestStoreSalesData struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - Currency *uint32 `protobuf:"varint,2,opt,name=currency" json:"currency,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesData) Reset() { *m = CMsgGCRequestStoreSalesData{} } -func (m *CMsgGCRequestStoreSalesData) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestStoreSalesData) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesData) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{8} } - -func (m *CMsgGCRequestStoreSalesData) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesData) GetCurrency() uint32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -type CMsgGCRequestStoreSalesDataResponse struct { - SalePrice []*CMsgGCRequestStoreSalesDataResponse_Price `protobuf:"bytes,1,rep,name=sale_price" json:"sale_price,omitempty"` - Version *uint32 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` - ExpirationTime *uint32 `protobuf:"varint,3,opt,name=expiration_time" json:"expiration_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesDataResponse) Reset() { *m = CMsgGCRequestStoreSalesDataResponse{} } -func (m *CMsgGCRequestStoreSalesDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestStoreSalesDataResponse) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesDataResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{9} -} - -func (m *CMsgGCRequestStoreSalesDataResponse) GetSalePrice() []*CMsgGCRequestStoreSalesDataResponse_Price { - if m != nil { - return m.SalePrice - } - return nil -} - -func (m *CMsgGCRequestStoreSalesDataResponse) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesDataResponse) GetExpirationTime() uint32 { - if m != nil && m.ExpirationTime != nil { - return *m.ExpirationTime - } - return 0 -} - -type CMsgGCRequestStoreSalesDataResponse_Price struct { - ItemDef *uint32 `protobuf:"varint,1,opt,name=item_def" json:"item_def,omitempty"` - Price *uint32 `protobuf:"varint,2,opt,name=price" json:"price,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesDataResponse_Price) Reset() { - *m = CMsgGCRequestStoreSalesDataResponse_Price{} -} -func (m *CMsgGCRequestStoreSalesDataResponse_Price) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestStoreSalesDataResponse_Price) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesDataResponse_Price) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{9, 0} -} - -func (m *CMsgGCRequestStoreSalesDataResponse_Price) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesDataResponse_Price) GetPrice() uint32 { - if m != nil && m.Price != nil { - return *m.Price - } - return 0 -} - -type CMsgGCRequestStoreSalesDataUpToDateResponse struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - ExpirationTime *uint32 `protobuf:"varint,2,opt,name=expiration_time" json:"expiration_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) Reset() { - *m = CMsgGCRequestStoreSalesDataUpToDateResponse{} -} -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCRequestStoreSalesDataUpToDateResponse) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesDataUpToDateResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{10} -} - -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) GetExpirationTime() uint32 { - if m != nil && m.ExpirationTime != nil { - return *m.ExpirationTime - } - return 0 -} - -type CMsgGCToGCPingRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCPingRequest) Reset() { *m = CMsgGCToGCPingRequest{} } -func (m *CMsgGCToGCPingRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCPingRequest) ProtoMessage() {} -func (*CMsgGCToGCPingRequest) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{11} } - -type CMsgGCToGCPingResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCPingResponse) Reset() { *m = CMsgGCToGCPingResponse{} } -func (m *CMsgGCToGCPingResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCPingResponse) ProtoMessage() {} -func (*CMsgGCToGCPingResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{12} } - -type CMsgGCToGCGetUserSessionServer struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserSessionServer) Reset() { *m = CMsgGCToGCGetUserSessionServer{} } -func (m *CMsgGCToGCGetUserSessionServer) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserSessionServer) ProtoMessage() {} -func (*CMsgGCToGCGetUserSessionServer) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{13} } - -func (m *CMsgGCToGCGetUserSessionServer) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCToGCGetUserSessionServerResponse struct { - ServerSteamId *uint64 `protobuf:"fixed64,1,opt,name=server_steam_id" json:"server_steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserSessionServerResponse) Reset() { - *m = CMsgGCToGCGetUserSessionServerResponse{} -} -func (m *CMsgGCToGCGetUserSessionServerResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserSessionServerResponse) ProtoMessage() {} -func (*CMsgGCToGCGetUserSessionServerResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{14} -} - -func (m *CMsgGCToGCGetUserSessionServerResponse) GetServerSteamId() uint64 { - if m != nil && m.ServerSteamId != nil { - return *m.ServerSteamId - } - return 0 -} - -type CMsgGCToGCGetUserServerMembers struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - MaxSpectators *uint32 `protobuf:"varint,2,opt,name=max_spectators" json:"max_spectators,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserServerMembers) Reset() { *m = CMsgGCToGCGetUserServerMembers{} } -func (m *CMsgGCToGCGetUserServerMembers) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserServerMembers) ProtoMessage() {} -func (*CMsgGCToGCGetUserServerMembers) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{15} } - -func (m *CMsgGCToGCGetUserServerMembers) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToGCGetUserServerMembers) GetMaxSpectators() uint32 { - if m != nil && m.MaxSpectators != nil { - return *m.MaxSpectators - } - return 0 -} - -type CMsgGCToGCGetUserServerMembersResponse struct { - MemberAccountId []uint32 `protobuf:"varint,1,rep,name=member_account_id" json:"member_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserServerMembersResponse) Reset() { - *m = CMsgGCToGCGetUserServerMembersResponse{} -} -func (m *CMsgGCToGCGetUserServerMembersResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserServerMembersResponse) ProtoMessage() {} -func (*CMsgGCToGCGetUserServerMembersResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{16} -} - -func (m *CMsgGCToGCGetUserServerMembersResponse) GetMemberAccountId() []uint32 { - if m != nil { - return m.MemberAccountId - } - return nil -} - -type CMsgLookupMultipleAccountNames struct { - Accountids []uint32 `protobuf:"varint,1,rep,packed,name=accountids" json:"accountids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLookupMultipleAccountNames) Reset() { *m = CMsgLookupMultipleAccountNames{} } -func (m *CMsgLookupMultipleAccountNames) String() string { return proto.CompactTextString(m) } -func (*CMsgLookupMultipleAccountNames) ProtoMessage() {} -func (*CMsgLookupMultipleAccountNames) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{17} } - -func (m *CMsgLookupMultipleAccountNames) GetAccountids() []uint32 { - if m != nil { - return m.Accountids - } - return nil -} - -type CMsgLookupMultipleAccountNamesResponse struct { - Accounts []*CMsgLookupMultipleAccountNamesResponse_Account `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLookupMultipleAccountNamesResponse) Reset() { - *m = CMsgLookupMultipleAccountNamesResponse{} -} -func (m *CMsgLookupMultipleAccountNamesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgLookupMultipleAccountNamesResponse) ProtoMessage() {} -func (*CMsgLookupMultipleAccountNamesResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{18} -} - -func (m *CMsgLookupMultipleAccountNamesResponse) GetAccounts() []*CMsgLookupMultipleAccountNamesResponse_Account { - if m != nil { - return m.Accounts - } - return nil -} - -type CMsgLookupMultipleAccountNamesResponse_Account struct { - Accountid *uint32 `protobuf:"varint,1,opt,name=accountid" json:"accountid,omitempty"` - Persona *string `protobuf:"bytes,2,opt,name=persona" json:"persona,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLookupMultipleAccountNamesResponse_Account) Reset() { - *m = CMsgLookupMultipleAccountNamesResponse_Account{} -} -func (m *CMsgLookupMultipleAccountNamesResponse_Account) String() string { - return proto.CompactTextString(m) -} -func (*CMsgLookupMultipleAccountNamesResponse_Account) ProtoMessage() {} -func (*CMsgLookupMultipleAccountNamesResponse_Account) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{18, 0} -} - -func (m *CMsgLookupMultipleAccountNamesResponse_Account) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -func (m *CMsgLookupMultipleAccountNamesResponse_Account) GetPersona() string { - if m != nil && m.Persona != nil { - return *m.Persona - } - return "" -} - -type CMsgGCToGCGetUserPCBangNo struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserPCBangNo) Reset() { *m = CMsgGCToGCGetUserPCBangNo{} } -func (m *CMsgGCToGCGetUserPCBangNo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserPCBangNo) ProtoMessage() {} -func (*CMsgGCToGCGetUserPCBangNo) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{19} } - -func (m *CMsgGCToGCGetUserPCBangNo) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCToGCGetUserPCBangNoResponse struct { - PcBangNo *uint32 `protobuf:"varint,1,opt,name=pc_bang_no" json:"pc_bang_no,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserPCBangNoResponse) Reset() { *m = CMsgGCToGCGetUserPCBangNoResponse{} } -func (m *CMsgGCToGCGetUserPCBangNoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserPCBangNoResponse) ProtoMessage() {} -func (*CMsgGCToGCGetUserPCBangNoResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{20} -} - -func (m *CMsgGCToGCGetUserPCBangNoResponse) GetPcBangNo() uint32 { - if m != nil && m.PcBangNo != nil { - return *m.PcBangNo - } - return 0 -} - -type CMsgRequestCrateItems struct { - CrateItemDef *uint32 `protobuf:"varint,1,opt,name=crate_item_def" json:"crate_item_def,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestCrateItems) Reset() { *m = CMsgRequestCrateItems{} } -func (m *CMsgRequestCrateItems) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestCrateItems) ProtoMessage() {} -func (*CMsgRequestCrateItems) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{21} } - -func (m *CMsgRequestCrateItems) GetCrateItemDef() uint32 { - if m != nil && m.CrateItemDef != nil { - return *m.CrateItemDef - } - return 0 -} - -type CMsgRequestCrateItemsResponse struct { - Response *uint32 `protobuf:"varint,1,opt,name=response" json:"response,omitempty"` - ItemDefs []uint32 `protobuf:"varint,2,rep,name=item_defs" json:"item_defs,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestCrateItemsResponse) Reset() { *m = CMsgRequestCrateItemsResponse{} } -func (m *CMsgRequestCrateItemsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestCrateItemsResponse) ProtoMessage() {} -func (*CMsgRequestCrateItemsResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{22} } - -func (m *CMsgRequestCrateItemsResponse) GetResponse() uint32 { - if m != nil && m.Response != nil { - return *m.Response - } - return 0 -} - -func (m *CMsgRequestCrateItemsResponse) GetItemDefs() []uint32 { - if m != nil { - return m.ItemDefs - } - return nil -} - -type CMsgGCToGCCanUseDropRateBonus struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - DropRateBonus *float32 `protobuf:"fixed32,2,opt,name=drop_rate_bonus" json:"drop_rate_bonus,omitempty"` - BoosterType *uint32 `protobuf:"varint,3,opt,name=booster_type" json:"booster_type,omitempty"` - ExclusiveItemDef *uint32 `protobuf:"varint,4,opt,name=exclusive_item_def" json:"exclusive_item_def,omitempty"` - AllowEqualRate *bool `protobuf:"varint,5,opt,name=allow_equal_rate" json:"allow_equal_rate,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCCanUseDropRateBonus) Reset() { *m = CMsgGCToGCCanUseDropRateBonus{} } -func (m *CMsgGCToGCCanUseDropRateBonus) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCCanUseDropRateBonus) ProtoMessage() {} -func (*CMsgGCToGCCanUseDropRateBonus) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{23} } - -func (m *CMsgGCToGCCanUseDropRateBonus) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToGCCanUseDropRateBonus) GetDropRateBonus() float32 { - if m != nil && m.DropRateBonus != nil { - return *m.DropRateBonus - } - return 0 -} - -func (m *CMsgGCToGCCanUseDropRateBonus) GetBoosterType() uint32 { - if m != nil && m.BoosterType != nil { - return *m.BoosterType - } - return 0 -} - -func (m *CMsgGCToGCCanUseDropRateBonus) GetExclusiveItemDef() uint32 { - if m != nil && m.ExclusiveItemDef != nil { - return *m.ExclusiveItemDef - } - return 0 -} - -func (m *CMsgGCToGCCanUseDropRateBonus) GetAllowEqualRate() bool { - if m != nil && m.AllowEqualRate != nil { - return *m.AllowEqualRate - } - return false -} - -type CMsgSQLAddDropRateBonus struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - ItemDef *uint32 `protobuf:"varint,3,opt,name=item_def" json:"item_def,omitempty"` - DropRateBonus *float32 `protobuf:"fixed32,4,opt,name=drop_rate_bonus" json:"drop_rate_bonus,omitempty"` - BoosterType *uint32 `protobuf:"varint,5,opt,name=booster_type" json:"booster_type,omitempty"` - SecondsDuration *uint32 `protobuf:"varint,6,opt,name=seconds_duration" json:"seconds_duration,omitempty"` - EndTimeStamp *uint32 `protobuf:"varint,7,opt,name=end_time_stamp" json:"end_time_stamp,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSQLAddDropRateBonus) Reset() { *m = CMsgSQLAddDropRateBonus{} } -func (m *CMsgSQLAddDropRateBonus) String() string { return proto.CompactTextString(m) } -func (*CMsgSQLAddDropRateBonus) ProtoMessage() {} -func (*CMsgSQLAddDropRateBonus) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{24} } - -func (m *CMsgSQLAddDropRateBonus) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgSQLAddDropRateBonus) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgSQLAddDropRateBonus) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgSQLAddDropRateBonus) GetDropRateBonus() float32 { - if m != nil && m.DropRateBonus != nil { - return *m.DropRateBonus - } - return 0 -} - -func (m *CMsgSQLAddDropRateBonus) GetBoosterType() uint32 { - if m != nil && m.BoosterType != nil { - return *m.BoosterType - } - return 0 -} - -func (m *CMsgSQLAddDropRateBonus) GetSecondsDuration() uint32 { - if m != nil && m.SecondsDuration != nil { - return *m.SecondsDuration - } - return 0 -} - -func (m *CMsgSQLAddDropRateBonus) GetEndTimeStamp() uint32 { - if m != nil && m.EndTimeStamp != nil { - return *m.EndTimeStamp - } - return 0 -} - -type CMsgSQLUpgradeBattleBooster struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemDef *uint32 `protobuf:"varint,2,opt,name=item_def" json:"item_def,omitempty"` - BonusToAdd *float32 `protobuf:"fixed32,3,opt,name=bonus_to_add" json:"bonus_to_add,omitempty"` - BoosterType *uint32 `protobuf:"varint,4,opt,name=booster_type" json:"booster_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSQLUpgradeBattleBooster) Reset() { *m = CMsgSQLUpgradeBattleBooster{} } -func (m *CMsgSQLUpgradeBattleBooster) String() string { return proto.CompactTextString(m) } -func (*CMsgSQLUpgradeBattleBooster) ProtoMessage() {} -func (*CMsgSQLUpgradeBattleBooster) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{25} } - -func (m *CMsgSQLUpgradeBattleBooster) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgSQLUpgradeBattleBooster) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgSQLUpgradeBattleBooster) GetBonusToAdd() float32 { - if m != nil && m.BonusToAdd != nil { - return *m.BonusToAdd - } - return 0 -} - -func (m *CMsgSQLUpgradeBattleBooster) GetBoosterType() uint32 { - if m != nil && m.BoosterType != nil { - return *m.BoosterType - } - return 0 -} - -type CMsgGCToGCRefreshSOCache struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Reload *bool `protobuf:"varint,2,opt,name=reload" json:"reload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCRefreshSOCache) Reset() { *m = CMsgGCToGCRefreshSOCache{} } -func (m *CMsgGCToGCRefreshSOCache) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCRefreshSOCache) ProtoMessage() {} -func (*CMsgGCToGCRefreshSOCache) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{26} } - -func (m *CMsgGCToGCRefreshSOCache) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToGCRefreshSOCache) GetReload() bool { - if m != nil && m.Reload != nil { - return *m.Reload - } - return false -} - -type CMsgGCToGCCheckAccountTradeStatus struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Initiator *bool `protobuf:"varint,2,opt,name=initiator" json:"initiator,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCCheckAccountTradeStatus) Reset() { *m = CMsgGCToGCCheckAccountTradeStatus{} } -func (m *CMsgGCToGCCheckAccountTradeStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCCheckAccountTradeStatus) ProtoMessage() {} -func (*CMsgGCToGCCheckAccountTradeStatus) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{27} -} - -func (m *CMsgGCToGCCheckAccountTradeStatus) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToGCCheckAccountTradeStatus) GetInitiator() bool { - if m != nil && m.Initiator != nil { - return *m.Initiator - } - return false -} - -type CMsgGCToGCCheckAccountTradeStatusResponse struct { - CanTrade *bool `protobuf:"varint,1,opt,name=can_trade" json:"can_trade,omitempty"` - ErrorCode *uint32 `protobuf:"varint,2,opt,name=error_code" json:"error_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCCheckAccountTradeStatusResponse) Reset() { - *m = CMsgGCToGCCheckAccountTradeStatusResponse{} -} -func (m *CMsgGCToGCCheckAccountTradeStatusResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCCheckAccountTradeStatusResponse) ProtoMessage() {} -func (*CMsgGCToGCCheckAccountTradeStatusResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{28} -} - -func (m *CMsgGCToGCCheckAccountTradeStatusResponse) GetCanTrade() bool { - if m != nil && m.CanTrade != nil { - return *m.CanTrade - } - return false -} - -func (m *CMsgGCToGCCheckAccountTradeStatusResponse) GetErrorCode() uint32 { - if m != nil && m.ErrorCode != nil { - return *m.ErrorCode - } - return 0 -} - -type CMsgGCToGCGrantAccountRolledItems struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Items []*CMsgGCToGCGrantAccountRolledItems_Item `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` - AuditAction *uint32 `protobuf:"varint,3,opt,name=audit_action" json:"audit_action,omitempty"` - AuditData *uint32 `protobuf:"varint,4,opt,name=audit_data" json:"audit_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGrantAccountRolledItems) Reset() { *m = CMsgGCToGCGrantAccountRolledItems{} } -func (m *CMsgGCToGCGrantAccountRolledItems) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGrantAccountRolledItems) ProtoMessage() {} -func (*CMsgGCToGCGrantAccountRolledItems) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{29} -} - -func (m *CMsgGCToGCGrantAccountRolledItems) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems) GetItems() []*CMsgGCToGCGrantAccountRolledItems_Item { - if m != nil { - return m.Items - } - return nil -} - -func (m *CMsgGCToGCGrantAccountRolledItems) GetAuditAction() uint32 { - if m != nil && m.AuditAction != nil { - return *m.AuditAction - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems) GetAuditData() uint32 { - if m != nil && m.AuditData != nil { - return *m.AuditData - } - return 0 -} - -type CMsgGCToGCGrantAccountRolledItems_Item struct { - ItemDef *uint32 `protobuf:"varint,1,opt,name=item_def" json:"item_def,omitempty"` - LootLists []string `protobuf:"bytes,2,rep,name=loot_lists" json:"loot_lists,omitempty"` - IgnoreLimit *bool `protobuf:"varint,3,opt,name=ignore_limit" json:"ignore_limit,omitempty"` - Origin *uint32 `protobuf:"varint,4,opt,name=origin" json:"origin,omitempty"` - DynamicAttributes []*CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute `protobuf:"bytes,5,rep,name=dynamic_attributes" json:"dynamic_attributes,omitempty"` - AdditionalAuditEntries []*CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry `protobuf:"bytes,6,rep,name=additional_audit_entries" json:"additional_audit_entries,omitempty"` - InventoryToken *uint32 `protobuf:"varint,7,opt,name=inventory_token" json:"inventory_token,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) Reset() { - *m = CMsgGCToGCGrantAccountRolledItems_Item{} -} -func (m *CMsgGCToGCGrantAccountRolledItems_Item) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGrantAccountRolledItems_Item) ProtoMessage() {} -func (*CMsgGCToGCGrantAccountRolledItems_Item) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{29, 0} -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetLootLists() []string { - if m != nil { - return m.LootLists - } - return nil -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetIgnoreLimit() bool { - if m != nil && m.IgnoreLimit != nil { - return *m.IgnoreLimit - } - return false -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetOrigin() uint32 { - if m != nil && m.Origin != nil { - return *m.Origin - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetDynamicAttributes() []*CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute { - if m != nil { - return m.DynamicAttributes - } - return nil -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetAdditionalAuditEntries() []*CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry { - if m != nil { - return m.AdditionalAuditEntries - } - return nil -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item) GetInventoryToken() uint32 { - if m != nil && m.InventoryToken != nil { - return *m.InventoryToken - } - return 0 -} - -type CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - ValueUint32 *uint32 `protobuf:"varint,2,opt,name=value_uint32" json:"value_uint32,omitempty"` - ValueFloat *float32 `protobuf:"fixed32,3,opt,name=value_float" json:"value_float,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) Reset() { - *m = CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute{} -} -func (m *CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) ProtoMessage() {} -func (*CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{29, 0, 0} -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) GetValueUint32() uint32 { - if m != nil && m.ValueUint32 != nil { - return *m.ValueUint32 - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute) GetValueFloat() float32 { - if m != nil && m.ValueFloat != nil { - return *m.ValueFloat - } - return 0 -} - -type CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry struct { - OwnerAccountId *uint32 `protobuf:"varint,1,opt,name=owner_account_id" json:"owner_account_id,omitempty"` - AuditAction *uint32 `protobuf:"varint,2,opt,name=audit_action" json:"audit_action,omitempty"` - AuditData *uint32 `protobuf:"varint,3,opt,name=audit_data" json:"audit_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) Reset() { - *m = CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry{} -} -func (m *CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) ProtoMessage() {} -func (*CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{29, 0, 1} -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) GetOwnerAccountId() uint32 { - if m != nil && m.OwnerAccountId != nil { - return *m.OwnerAccountId - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) GetAuditAction() uint32 { - if m != nil && m.AuditAction != nil { - return *m.AuditAction - } - return 0 -} - -func (m *CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry) GetAuditData() uint32 { - if m != nil && m.AuditData != nil { - return *m.AuditData - } - return 0 -} - -type CMsgGCToGCGrantSelfMadeItemToAccount struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - Accountid *uint32 `protobuf:"varint,2,opt,name=accountid" json:"accountid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) Reset() { *m = CMsgGCToGCGrantSelfMadeItemToAccount{} } -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGrantSelfMadeItemToAccount) ProtoMessage() {} -func (*CMsgGCToGCGrantSelfMadeItemToAccount) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{30} -} - -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -type CMsgUseItem struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - TargetSteamId *uint64 `protobuf:"fixed64,2,opt,name=target_steam_id" json:"target_steam_id,omitempty"` - Gift_PotentialTargets []uint32 `protobuf:"varint,3,rep,name=gift__potential_targets" json:"gift__potential_targets,omitempty"` - Duel_ClassLock *uint32 `protobuf:"varint,4,opt,name=duel__class_lock" json:"duel__class_lock,omitempty"` - InitiatorSteamId *uint64 `protobuf:"varint,5,opt,name=initiator_steam_id" json:"initiator_steam_id,omitempty"` - Itempack_AckImmediately *bool `protobuf:"varint,6,opt,name=itempack__ack_immediately" json:"itempack__ack_immediately,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUseItem) Reset() { *m = CMsgUseItem{} } -func (m *CMsgUseItem) String() string { return proto.CompactTextString(m) } -func (*CMsgUseItem) ProtoMessage() {} -func (*CMsgUseItem) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{31} } - -func (m *CMsgUseItem) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgUseItem) GetTargetSteamId() uint64 { - if m != nil && m.TargetSteamId != nil { - return *m.TargetSteamId - } - return 0 -} - -func (m *CMsgUseItem) GetGift_PotentialTargets() []uint32 { - if m != nil { - return m.Gift_PotentialTargets - } - return nil -} - -func (m *CMsgUseItem) GetDuel_ClassLock() uint32 { - if m != nil && m.Duel_ClassLock != nil { - return *m.Duel_ClassLock - } - return 0 -} - -func (m *CMsgUseItem) GetInitiatorSteamId() uint64 { - if m != nil && m.InitiatorSteamId != nil { - return *m.InitiatorSteamId - } - return 0 -} - -func (m *CMsgUseItem) GetItempack_AckImmediately() bool { - if m != nil && m.Itempack_AckImmediately != nil { - return *m.Itempack_AckImmediately - } - return false -} - -type CMsgServerUseItem struct { - InitiatorAccountId *uint32 `protobuf:"varint,1,opt,name=initiator_account_id" json:"initiator_account_id,omitempty"` - UseItemMsg *CMsgUseItem `protobuf:"bytes,2,opt,name=use_item_msg" json:"use_item_msg,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerUseItem) Reset() { *m = CMsgServerUseItem{} } -func (m *CMsgServerUseItem) String() string { return proto.CompactTextString(m) } -func (*CMsgServerUseItem) ProtoMessage() {} -func (*CMsgServerUseItem) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{32} } - -func (m *CMsgServerUseItem) GetInitiatorAccountId() uint32 { - if m != nil && m.InitiatorAccountId != nil { - return *m.InitiatorAccountId - } - return 0 -} - -func (m *CMsgServerUseItem) GetUseItemMsg() *CMsgUseItem { - if m != nil { - return m.UseItemMsg - } - return nil -} - -type CMsgGCPartnerBalanceRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPartnerBalanceRequest) Reset() { *m = CMsgGCPartnerBalanceRequest{} } -func (m *CMsgGCPartnerBalanceRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPartnerBalanceRequest) ProtoMessage() {} -func (*CMsgGCPartnerBalanceRequest) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{33} } - -type CMsgGCPartnerBalanceResponse struct { - Result *EGCPartnerRequestResponse `protobuf:"varint,1,opt,name=result,enum=EGCPartnerRequestResponse,def=1" json:"result,omitempty"` - Balance *uint32 `protobuf:"varint,2,opt,name=balance" json:"balance,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPartnerBalanceResponse) Reset() { *m = CMsgGCPartnerBalanceResponse{} } -func (m *CMsgGCPartnerBalanceResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPartnerBalanceResponse) ProtoMessage() {} -func (*CMsgGCPartnerBalanceResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{34} } - -const Default_CMsgGCPartnerBalanceResponse_Result EGCPartnerRequestResponse = EGCPartnerRequestResponse_k_EPartnerRequestOK - -func (m *CMsgGCPartnerBalanceResponse) GetResult() EGCPartnerRequestResponse { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgGCPartnerBalanceResponse_Result -} - -func (m *CMsgGCPartnerBalanceResponse) GetBalance() uint32 { - if m != nil && m.Balance != nil { - return *m.Balance - } - return 0 -} - -type CGCStoreRechargeRedirect_LineItem struct { - ItemDefId *uint32 `protobuf:"varint,1,opt,name=item_def_id" json:"item_def_id,omitempty"` - Quantity *uint32 `protobuf:"varint,2,opt,name=quantity" json:"quantity,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCStoreRechargeRedirect_LineItem) Reset() { *m = CGCStoreRechargeRedirect_LineItem{} } -func (m *CGCStoreRechargeRedirect_LineItem) String() string { return proto.CompactTextString(m) } -func (*CGCStoreRechargeRedirect_LineItem) ProtoMessage() {} -func (*CGCStoreRechargeRedirect_LineItem) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{35} -} - -func (m *CGCStoreRechargeRedirect_LineItem) GetItemDefId() uint32 { - if m != nil && m.ItemDefId != nil { - return *m.ItemDefId - } - return 0 -} - -func (m *CGCStoreRechargeRedirect_LineItem) GetQuantity() uint32 { - if m != nil && m.Quantity != nil { - return *m.Quantity - } - return 0 -} - -type CMsgGCPartnerRechargeRedirectURLRequest struct { - LineItems []*CGCStoreRechargeRedirect_LineItem `protobuf:"bytes,1,rep,name=line_items" json:"line_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPartnerRechargeRedirectURLRequest) Reset() { - *m = CMsgGCPartnerRechargeRedirectURLRequest{} -} -func (m *CMsgGCPartnerRechargeRedirectURLRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPartnerRechargeRedirectURLRequest) ProtoMessage() {} -func (*CMsgGCPartnerRechargeRedirectURLRequest) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{36} -} - -func (m *CMsgGCPartnerRechargeRedirectURLRequest) GetLineItems() []*CGCStoreRechargeRedirect_LineItem { - if m != nil { - return m.LineItems - } - return nil -} - -type CMsgGCPartnerRechargeRedirectURLResponse struct { - Result *EGCPartnerRequestResponse `protobuf:"varint,1,opt,name=result,enum=EGCPartnerRequestResponse,def=1" json:"result,omitempty"` - Url *string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCPartnerRechargeRedirectURLResponse) Reset() { - *m = CMsgGCPartnerRechargeRedirectURLResponse{} -} -func (m *CMsgGCPartnerRechargeRedirectURLResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCPartnerRechargeRedirectURLResponse) ProtoMessage() {} -func (*CMsgGCPartnerRechargeRedirectURLResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{37} -} - -const Default_CMsgGCPartnerRechargeRedirectURLResponse_Result EGCPartnerRequestResponse = EGCPartnerRequestResponse_k_EPartnerRequestOK - -func (m *CMsgGCPartnerRechargeRedirectURLResponse) GetResult() EGCPartnerRequestResponse { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgGCPartnerRechargeRedirectURLResponse_Result -} - -func (m *CMsgGCPartnerRechargeRedirectURLResponse) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -type CMsgGCEconSQLWorkItemEmbeddedRollbackData struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - DeletedItemId *uint64 `protobuf:"varint,2,opt,name=deleted_item_id" json:"deleted_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCEconSQLWorkItemEmbeddedRollbackData) Reset() { - *m = CMsgGCEconSQLWorkItemEmbeddedRollbackData{} -} -func (m *CMsgGCEconSQLWorkItemEmbeddedRollbackData) String() string { return proto.CompactTextString(m) } -func (*CMsgGCEconSQLWorkItemEmbeddedRollbackData) ProtoMessage() {} -func (*CMsgGCEconSQLWorkItemEmbeddedRollbackData) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{38} -} - -func (m *CMsgGCEconSQLWorkItemEmbeddedRollbackData) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCEconSQLWorkItemEmbeddedRollbackData) GetDeletedItemId() uint64 { - if m != nil && m.DeletedItemId != nil { - return *m.DeletedItemId - } - return 0 -} - -type CMsgCraftStatue struct { - Heroid *uint32 `protobuf:"varint,1,opt,name=heroid" json:"heroid,omitempty"` - Sequencename *string `protobuf:"bytes,2,opt,name=sequencename" json:"sequencename,omitempty"` - Cycle *float32 `protobuf:"fixed32,3,opt,name=cycle" json:"cycle,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` - PedestalItemdef *uint32 `protobuf:"varint,5,opt,name=pedestal_itemdef" json:"pedestal_itemdef,omitempty"` - Toolid *uint64 `protobuf:"varint,6,opt,name=toolid" json:"toolid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCraftStatue) Reset() { *m = CMsgCraftStatue{} } -func (m *CMsgCraftStatue) String() string { return proto.CompactTextString(m) } -func (*CMsgCraftStatue) ProtoMessage() {} -func (*CMsgCraftStatue) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{39} } - -func (m *CMsgCraftStatue) GetHeroid() uint32 { - if m != nil && m.Heroid != nil { - return *m.Heroid - } - return 0 -} - -func (m *CMsgCraftStatue) GetSequencename() string { - if m != nil && m.Sequencename != nil { - return *m.Sequencename - } - return "" -} - -func (m *CMsgCraftStatue) GetCycle() float32 { - if m != nil && m.Cycle != nil { - return *m.Cycle - } - return 0 -} - -func (m *CMsgCraftStatue) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CMsgCraftStatue) GetPedestalItemdef() uint32 { - if m != nil && m.PedestalItemdef != nil { - return *m.PedestalItemdef - } - return 0 -} - -func (m *CMsgCraftStatue) GetToolid() uint64 { - if m != nil && m.Toolid != nil { - return *m.Toolid - } - return 0 -} - -type CMsgRedeemCode struct { - Code *string `protobuf:"bytes,1,opt,name=code" json:"code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRedeemCode) Reset() { *m = CMsgRedeemCode{} } -func (m *CMsgRedeemCode) String() string { return proto.CompactTextString(m) } -func (*CMsgRedeemCode) ProtoMessage() {} -func (*CMsgRedeemCode) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{40} } - -func (m *CMsgRedeemCode) GetCode() string { - if m != nil && m.Code != nil { - return *m.Code - } - return "" -} - -type CMsgRedeemCodeResponse struct { - Response *uint32 `protobuf:"varint,1,opt,name=response" json:"response,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRedeemCodeResponse) Reset() { *m = CMsgRedeemCodeResponse{} } -func (m *CMsgRedeemCodeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgRedeemCodeResponse) ProtoMessage() {} -func (*CMsgRedeemCodeResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{41} } - -func (m *CMsgRedeemCodeResponse) GetResponse() uint32 { - if m != nil && m.Response != nil { - return *m.Response - } - return 0 -} - -func (m *CMsgRedeemCodeResponse) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgDevNewItemRequest struct { - ItemDefName *string `protobuf:"bytes,3,opt,name=item_def_name" json:"item_def_name,omitempty"` - LootListName *string `protobuf:"bytes,4,opt,name=loot_list_name" json:"loot_list_name,omitempty"` - AttrDefName []string `protobuf:"bytes,5,rep,name=attr_def_name" json:"attr_def_name,omitempty"` - AttrValue []string `protobuf:"bytes,6,rep,name=attr_value" json:"attr_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDevNewItemRequest) Reset() { *m = CMsgDevNewItemRequest{} } -func (m *CMsgDevNewItemRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDevNewItemRequest) ProtoMessage() {} -func (*CMsgDevNewItemRequest) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{42} } - -func (m *CMsgDevNewItemRequest) GetItemDefName() string { - if m != nil && m.ItemDefName != nil { - return *m.ItemDefName - } - return "" -} - -func (m *CMsgDevNewItemRequest) GetLootListName() string { - if m != nil && m.LootListName != nil { - return *m.LootListName - } - return "" -} - -func (m *CMsgDevNewItemRequest) GetAttrDefName() []string { - if m != nil { - return m.AttrDefName - } - return nil -} - -func (m *CMsgDevNewItemRequest) GetAttrValue() []string { - if m != nil { - return m.AttrValue - } - return nil -} - -type CMsgDevNewItemRequestResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDevNewItemRequestResponse) Reset() { *m = CMsgDevNewItemRequestResponse{} } -func (m *CMsgDevNewItemRequestResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgDevNewItemRequestResponse) ProtoMessage() {} -func (*CMsgDevNewItemRequestResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{43} } - -func (m *CMsgDevNewItemRequestResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CMsgGCAddGiftItem struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCAddGiftItem) Reset() { *m = CMsgGCAddGiftItem{} } -func (m *CMsgGCAddGiftItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGCAddGiftItem) ProtoMessage() {} -func (*CMsgGCAddGiftItem) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{44} } - -func (m *CMsgGCAddGiftItem) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCAddGiftItem) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgClientToGCWrapAndDeliverGift struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - GiveToAccountId *uint32 `protobuf:"varint,2,opt,name=give_to_account_id" json:"give_to_account_id,omitempty"` - GiftMessage *string `protobuf:"bytes,3,opt,name=gift_message" json:"gift_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCWrapAndDeliverGift) Reset() { *m = CMsgClientToGCWrapAndDeliverGift{} } -func (m *CMsgClientToGCWrapAndDeliverGift) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCWrapAndDeliverGift) ProtoMessage() {} -func (*CMsgClientToGCWrapAndDeliverGift) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{45} -} - -func (m *CMsgClientToGCWrapAndDeliverGift) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGift) GetGiveToAccountId() uint32 { - if m != nil && m.GiveToAccountId != nil { - return *m.GiveToAccountId - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGift) GetGiftMessage() string { - if m != nil && m.GiftMessage != nil { - return *m.GiftMessage - } - return "" -} - -type CMsgClientToGCWrapAndDeliverGiftResponse struct { - Response *EGCMsgResponse `protobuf:"varint,1,opt,name=response,enum=EGCMsgResponse,def=0" json:"response,omitempty"` - GiftingChargeUses *uint32 `protobuf:"varint,2,opt,name=gifting_charge_uses" json:"gifting_charge_uses,omitempty"` - GiftingChargeMax *int32 `protobuf:"varint,3,opt,name=gifting_charge_max" json:"gifting_charge_max,omitempty"` - GiftingUses *uint32 `protobuf:"varint,4,opt,name=gifting_uses" json:"gifting_uses,omitempty"` - GiftingMax *int32 `protobuf:"varint,5,opt,name=gifting_max" json:"gifting_max,omitempty"` - GiftingWindowHours *uint32 `protobuf:"varint,6,opt,name=gifting_window_hours" json:"gifting_window_hours,omitempty"` - TradeRestriction *EGCMsgInitiateTradeResponse `protobuf:"varint,7,opt,name=trade_restriction,enum=EGCMsgInitiateTradeResponse,def=0" json:"trade_restriction,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) Reset() { - *m = CMsgClientToGCWrapAndDeliverGiftResponse{} -} -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCWrapAndDeliverGiftResponse) ProtoMessage() {} -func (*CMsgClientToGCWrapAndDeliverGiftResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{46} -} - -const Default_CMsgClientToGCWrapAndDeliverGiftResponse_Response EGCMsgResponse = EGCMsgResponse_k_EGCMsgResponseOK -const Default_CMsgClientToGCWrapAndDeliverGiftResponse_TradeRestriction EGCMsgInitiateTradeResponse = EGCMsgInitiateTradeResponse_k_EGCMsgInitiateTradeResponse_Accepted - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetResponse() EGCMsgResponse { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCWrapAndDeliverGiftResponse_Response -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetGiftingChargeUses() uint32 { - if m != nil && m.GiftingChargeUses != nil { - return *m.GiftingChargeUses - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetGiftingChargeMax() int32 { - if m != nil && m.GiftingChargeMax != nil { - return *m.GiftingChargeMax - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetGiftingUses() uint32 { - if m != nil && m.GiftingUses != nil { - return *m.GiftingUses - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetGiftingMax() int32 { - if m != nil && m.GiftingMax != nil { - return *m.GiftingMax - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetGiftingWindowHours() uint32 { - if m != nil && m.GiftingWindowHours != nil { - return *m.GiftingWindowHours - } - return 0 -} - -func (m *CMsgClientToGCWrapAndDeliverGiftResponse) GetTradeRestriction() EGCMsgInitiateTradeResponse { - if m != nil && m.TradeRestriction != nil { - return *m.TradeRestriction - } - return Default_CMsgClientToGCWrapAndDeliverGiftResponse_TradeRestriction -} - -type CMsgClientToGCUnwrapGift struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnwrapGift) Reset() { *m = CMsgClientToGCUnwrapGift{} } -func (m *CMsgClientToGCUnwrapGift) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnwrapGift) ProtoMessage() {} -func (*CMsgClientToGCUnwrapGift) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{47} } - -func (m *CMsgClientToGCUnwrapGift) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgClientToGCUnpackBundle struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnpackBundle) Reset() { *m = CMsgClientToGCUnpackBundle{} } -func (m *CMsgClientToGCUnpackBundle) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnpackBundle) ProtoMessage() {} -func (*CMsgClientToGCUnpackBundle) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{48} } - -func (m *CMsgClientToGCUnpackBundle) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgClientToGCUnpackBundleResponse struct { - UnpackedItemIds []uint64 `protobuf:"varint,1,rep,name=unpacked_item_ids" json:"unpacked_item_ids,omitempty"` - Response *CMsgClientToGCUnpackBundleResponse_EUnpackBundle `protobuf:"varint,2,opt,name=response,enum=CMsgClientToGCUnpackBundleResponse_EUnpackBundle,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnpackBundleResponse) Reset() { *m = CMsgClientToGCUnpackBundleResponse{} } -func (m *CMsgClientToGCUnpackBundleResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnpackBundleResponse) ProtoMessage() {} -func (*CMsgClientToGCUnpackBundleResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{49} -} - -const Default_CMsgClientToGCUnpackBundleResponse_Response CMsgClientToGCUnpackBundleResponse_EUnpackBundle = CMsgClientToGCUnpackBundleResponse_k_UnpackBundle_Succeeded - -func (m *CMsgClientToGCUnpackBundleResponse) GetUnpackedItemIds() []uint64 { - if m != nil { - return m.UnpackedItemIds - } - return nil -} - -func (m *CMsgClientToGCUnpackBundleResponse) GetResponse() CMsgClientToGCUnpackBundleResponse_EUnpackBundle { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCUnpackBundleResponse_Response -} - -type CMsgGCToClientStoreTransactionCompleted struct { - TxnId *uint64 `protobuf:"varint,1,opt,name=txn_id" json:"txn_id,omitempty"` - ItemIds []uint64 `protobuf:"varint,2,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToClientStoreTransactionCompleted) Reset() { - *m = CMsgGCToClientStoreTransactionCompleted{} -} -func (m *CMsgGCToClientStoreTransactionCompleted) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToClientStoreTransactionCompleted) ProtoMessage() {} -func (*CMsgGCToClientStoreTransactionCompleted) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{50} -} - -func (m *CMsgGCToClientStoreTransactionCompleted) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -func (m *CMsgGCToClientStoreTransactionCompleted) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgClientToGCEquipItems struct { - Equips []*CMsgAdjustItemEquippedState `protobuf:"bytes,1,rep,name=equips" json:"equips,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCEquipItems) Reset() { *m = CMsgClientToGCEquipItems{} } -func (m *CMsgClientToGCEquipItems) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCEquipItems) ProtoMessage() {} -func (*CMsgClientToGCEquipItems) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{51} } - -func (m *CMsgClientToGCEquipItems) GetEquips() []*CMsgAdjustItemEquippedState { - if m != nil { - return m.Equips - } - return nil -} - -type CMsgClientToGCEquipItemsResponse struct { - SoCacheVersionId *uint64 `protobuf:"fixed64,1,opt,name=so_cache_version_id" json:"so_cache_version_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCEquipItemsResponse) Reset() { *m = CMsgClientToGCEquipItemsResponse{} } -func (m *CMsgClientToGCEquipItemsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCEquipItemsResponse) ProtoMessage() {} -func (*CMsgClientToGCEquipItemsResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{52} -} - -func (m *CMsgClientToGCEquipItemsResponse) GetSoCacheVersionId() uint64 { - if m != nil && m.SoCacheVersionId != nil { - return *m.SoCacheVersionId - } - return 0 -} - -type CMsgClientToGCSetItemStyle struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - StyleIndex *uint32 `protobuf:"varint,2,opt,name=style_index" json:"style_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetItemStyle) Reset() { *m = CMsgClientToGCSetItemStyle{} } -func (m *CMsgClientToGCSetItemStyle) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSetItemStyle) ProtoMessage() {} -func (*CMsgClientToGCSetItemStyle) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{53} } - -func (m *CMsgClientToGCSetItemStyle) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgClientToGCSetItemStyle) GetStyleIndex() uint32 { - if m != nil && m.StyleIndex != nil { - return *m.StyleIndex - } - return 0 -} - -type CMsgClientToGCSetItemStyleResponse struct { - Response *CMsgClientToGCSetItemStyleResponse_ESetStyle `protobuf:"varint,1,opt,name=response,enum=CMsgClientToGCSetItemStyleResponse_ESetStyle,def=0" json:"response,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetItemStyleResponse) Reset() { *m = CMsgClientToGCSetItemStyleResponse{} } -func (m *CMsgClientToGCSetItemStyleResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSetItemStyleResponse) ProtoMessage() {} -func (*CMsgClientToGCSetItemStyleResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{54} -} - -const Default_CMsgClientToGCSetItemStyleResponse_Response CMsgClientToGCSetItemStyleResponse_ESetStyle = CMsgClientToGCSetItemStyleResponse_k_SetStyle_Succeeded - -func (m *CMsgClientToGCSetItemStyleResponse) GetResponse() CMsgClientToGCSetItemStyleResponse_ESetStyle { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCSetItemStyleResponse_Response -} - -type CMsgClientToGCUnlockItemStyle struct { - ItemToUnlock *uint64 `protobuf:"varint,1,opt,name=item_to_unlock" json:"item_to_unlock,omitempty"` - StyleIndex *uint32 `protobuf:"varint,2,opt,name=style_index" json:"style_index,omitempty"` - ConsumableItemIds []uint64 `protobuf:"varint,3,rep,name=consumable_item_ids" json:"consumable_item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnlockItemStyle) Reset() { *m = CMsgClientToGCUnlockItemStyle{} } -func (m *CMsgClientToGCUnlockItemStyle) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnlockItemStyle) ProtoMessage() {} -func (*CMsgClientToGCUnlockItemStyle) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{55} } - -func (m *CMsgClientToGCUnlockItemStyle) GetItemToUnlock() uint64 { - if m != nil && m.ItemToUnlock != nil { - return *m.ItemToUnlock - } - return 0 -} - -func (m *CMsgClientToGCUnlockItemStyle) GetStyleIndex() uint32 { - if m != nil && m.StyleIndex != nil { - return *m.StyleIndex - } - return 0 -} - -func (m *CMsgClientToGCUnlockItemStyle) GetConsumableItemIds() []uint64 { - if m != nil { - return m.ConsumableItemIds - } - return nil -} - -type CMsgClientToGCUnlockItemStyleResponse struct { - Response *CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle `protobuf:"varint,1,opt,name=response,enum=CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle,def=0" json:"response,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - StyleIndex *uint32 `protobuf:"varint,3,opt,name=style_index" json:"style_index,omitempty"` - StylePrereq *uint32 `protobuf:"varint,4,opt,name=style_prereq" json:"style_prereq,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnlockItemStyleResponse) Reset() { *m = CMsgClientToGCUnlockItemStyleResponse{} } -func (m *CMsgClientToGCUnlockItemStyleResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnlockItemStyleResponse) ProtoMessage() {} -func (*CMsgClientToGCUnlockItemStyleResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{56} -} - -const Default_CMsgClientToGCUnlockItemStyleResponse_Response CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle = CMsgClientToGCUnlockItemStyleResponse_k_UnlockStyle_Succeeded - -func (m *CMsgClientToGCUnlockItemStyleResponse) GetResponse() CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCUnlockItemStyleResponse_Response -} - -func (m *CMsgClientToGCUnlockItemStyleResponse) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgClientToGCUnlockItemStyleResponse) GetStyleIndex() uint32 { - if m != nil && m.StyleIndex != nil { - return *m.StyleIndex - } - return 0 -} - -func (m *CMsgClientToGCUnlockItemStyleResponse) GetStylePrereq() uint32 { - if m != nil && m.StylePrereq != nil { - return *m.StylePrereq - } - return 0 -} - -type CMsgClientToGCSetItemInventoryCategory struct { - ItemIds []uint64 `protobuf:"varint,1,rep,name=item_ids" json:"item_ids,omitempty"` - SetToValue *uint32 `protobuf:"varint,2,opt,name=set_to_value" json:"set_to_value,omitempty"` - RemoveCategories *uint32 `protobuf:"varint,3,opt,name=remove_categories" json:"remove_categories,omitempty"` - AddCategories *uint32 `protobuf:"varint,4,opt,name=add_categories" json:"add_categories,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCSetItemInventoryCategory) Reset() { - *m = CMsgClientToGCSetItemInventoryCategory{} -} -func (m *CMsgClientToGCSetItemInventoryCategory) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCSetItemInventoryCategory) ProtoMessage() {} -func (*CMsgClientToGCSetItemInventoryCategory) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{57} -} - -func (m *CMsgClientToGCSetItemInventoryCategory) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -func (m *CMsgClientToGCSetItemInventoryCategory) GetSetToValue() uint32 { - if m != nil && m.SetToValue != nil { - return *m.SetToValue - } - return 0 -} - -func (m *CMsgClientToGCSetItemInventoryCategory) GetRemoveCategories() uint32 { - if m != nil && m.RemoveCategories != nil { - return *m.RemoveCategories - } - return 0 -} - -func (m *CMsgClientToGCSetItemInventoryCategory) GetAddCategories() uint32 { - if m != nil && m.AddCategories != nil { - return *m.AddCategories - } - return 0 -} - -type CMsgClientToGCUnlockCrate struct { - CrateItemId *uint64 `protobuf:"varint,1,opt,name=crate_item_id" json:"crate_item_id,omitempty"` - KeyItemId *uint64 `protobuf:"varint,2,opt,name=key_item_id" json:"key_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnlockCrate) Reset() { *m = CMsgClientToGCUnlockCrate{} } -func (m *CMsgClientToGCUnlockCrate) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnlockCrate) ProtoMessage() {} -func (*CMsgClientToGCUnlockCrate) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{58} } - -func (m *CMsgClientToGCUnlockCrate) GetCrateItemId() uint64 { - if m != nil && m.CrateItemId != nil { - return *m.CrateItemId - } - return 0 -} - -func (m *CMsgClientToGCUnlockCrate) GetKeyItemId() uint64 { - if m != nil && m.KeyItemId != nil { - return *m.KeyItemId - } - return 0 -} - -type CMsgClientToGCUnlockCrateResponse struct { - Result *EGCMsgResponse `protobuf:"varint,1,opt,name=result,enum=EGCMsgResponse,def=0" json:"result,omitempty"` - GrantedItems []*CMsgClientToGCUnlockCrateResponse_Item `protobuf:"bytes,2,rep,name=granted_items" json:"granted_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnlockCrateResponse) Reset() { *m = CMsgClientToGCUnlockCrateResponse{} } -func (m *CMsgClientToGCUnlockCrateResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnlockCrateResponse) ProtoMessage() {} -func (*CMsgClientToGCUnlockCrateResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{59} -} - -const Default_CMsgClientToGCUnlockCrateResponse_Result EGCMsgResponse = EGCMsgResponse_k_EGCMsgResponseOK - -func (m *CMsgClientToGCUnlockCrateResponse) GetResult() EGCMsgResponse { - if m != nil && m.Result != nil { - return *m.Result - } - return Default_CMsgClientToGCUnlockCrateResponse_Result -} - -func (m *CMsgClientToGCUnlockCrateResponse) GetGrantedItems() []*CMsgClientToGCUnlockCrateResponse_Item { - if m != nil { - return m.GrantedItems - } - return nil -} - -type CMsgClientToGCUnlockCrateResponse_Item struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - DefIndex *uint32 `protobuf:"varint,2,opt,name=def_index" json:"def_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCUnlockCrateResponse_Item) Reset() { - *m = CMsgClientToGCUnlockCrateResponse_Item{} -} -func (m *CMsgClientToGCUnlockCrateResponse_Item) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCUnlockCrateResponse_Item) ProtoMessage() {} -func (*CMsgClientToGCUnlockCrateResponse_Item) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{59, 0} -} - -func (m *CMsgClientToGCUnlockCrateResponse_Item) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgClientToGCUnlockCrateResponse_Item) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -type CMsgClientToGCRemoveItemAttribute struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCRemoveItemAttribute) Reset() { *m = CMsgClientToGCRemoveItemAttribute{} } -func (m *CMsgClientToGCRemoveItemAttribute) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCRemoveItemAttribute) ProtoMessage() {} -func (*CMsgClientToGCRemoveItemAttribute) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{60} -} - -func (m *CMsgClientToGCRemoveItemAttribute) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgClientToGCRemoveItemAttributeResponse struct { - Response *CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute `protobuf:"varint,1,opt,name=response,enum=CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute,def=0" json:"response,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCRemoveItemAttributeResponse) Reset() { - *m = CMsgClientToGCRemoveItemAttributeResponse{} -} -func (m *CMsgClientToGCRemoveItemAttributeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCRemoveItemAttributeResponse) ProtoMessage() {} -func (*CMsgClientToGCRemoveItemAttributeResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{61} -} - -const Default_CMsgClientToGCRemoveItemAttributeResponse_Response CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute = CMsgClientToGCRemoveItemAttributeResponse_k_RemoveItemAttribute_Succeeded - -func (m *CMsgClientToGCRemoveItemAttributeResponse) GetResponse() CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCRemoveItemAttributeResponse_Response -} - -func (m *CMsgClientToGCRemoveItemAttributeResponse) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgClientToGCNameItem struct { - SubjectItemId *uint64 `protobuf:"varint,1,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - ToolItemId *uint64 `protobuf:"varint,2,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCNameItem) Reset() { *m = CMsgClientToGCNameItem{} } -func (m *CMsgClientToGCNameItem) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCNameItem) ProtoMessage() {} -func (*CMsgClientToGCNameItem) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{62} } - -func (m *CMsgClientToGCNameItem) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -func (m *CMsgClientToGCNameItem) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgClientToGCNameItem) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type CMsgClientToGCNameItemResponse struct { - Response *CMsgClientToGCNameItemResponse_ENameItem `protobuf:"varint,1,opt,name=response,enum=CMsgClientToGCNameItemResponse_ENameItem,def=0" json:"response,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCNameItemResponse) Reset() { *m = CMsgClientToGCNameItemResponse{} } -func (m *CMsgClientToGCNameItemResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCNameItemResponse) ProtoMessage() {} -func (*CMsgClientToGCNameItemResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{63} } - -const Default_CMsgClientToGCNameItemResponse_Response CMsgClientToGCNameItemResponse_ENameItem = CMsgClientToGCNameItemResponse_k_NameItem_Succeeded - -func (m *CMsgClientToGCNameItemResponse) GetResponse() CMsgClientToGCNameItemResponse_ENameItem { - if m != nil && m.Response != nil { - return *m.Response - } - return Default_CMsgClientToGCNameItemResponse_Response -} - -func (m *CMsgClientToGCNameItemResponse) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgGCSetItemPosition struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - NewPosition *uint32 `protobuf:"varint,2,opt,name=new_position" json:"new_position,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCSetItemPosition) Reset() { *m = CMsgGCSetItemPosition{} } -func (m *CMsgGCSetItemPosition) String() string { return proto.CompactTextString(m) } -func (*CMsgGCSetItemPosition) ProtoMessage() {} -func (*CMsgGCSetItemPosition) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{64} } - -func (m *CMsgGCSetItemPosition) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgGCSetItemPosition) GetNewPosition() uint32 { - if m != nil && m.NewPosition != nil { - return *m.NewPosition - } - return 0 -} - -type CAttribute_ItemDynamicRecipeComponent struct { - ItemDef *uint32 `protobuf:"varint,1,opt,name=item_def" json:"item_def,omitempty"` - ItemQuality *uint32 `protobuf:"varint,2,opt,name=item_quality" json:"item_quality,omitempty"` - ItemFlags *uint32 `protobuf:"varint,3,opt,name=item_flags" json:"item_flags,omitempty"` - AttributesString *string `protobuf:"bytes,4,opt,name=attributes_string" json:"attributes_string,omitempty"` - ItemCount *uint32 `protobuf:"varint,5,opt,name=item_count" json:"item_count,omitempty"` - ItemsFulfilled *uint32 `protobuf:"varint,6,opt,name=items_fulfilled" json:"items_fulfilled,omitempty"` - ItemRarity *uint32 `protobuf:"varint,7,opt,name=item_rarity" json:"item_rarity,omitempty"` - Lootlist *string `protobuf:"bytes,8,opt,name=lootlist" json:"lootlist,omitempty"` - FulfilledItemId *uint64 `protobuf:"varint,9,opt,name=fulfilled_item_id" json:"fulfilled_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_ItemDynamicRecipeComponent) Reset() { *m = CAttribute_ItemDynamicRecipeComponent{} } -func (m *CAttribute_ItemDynamicRecipeComponent) String() string { return proto.CompactTextString(m) } -func (*CAttribute_ItemDynamicRecipeComponent) ProtoMessage() {} -func (*CAttribute_ItemDynamicRecipeComponent) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{65} -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetItemQuality() uint32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetItemFlags() uint32 { - if m != nil && m.ItemFlags != nil { - return *m.ItemFlags - } - return 0 -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetAttributesString() string { - if m != nil && m.AttributesString != nil { - return *m.AttributesString - } - return "" -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetItemCount() uint32 { - if m != nil && m.ItemCount != nil { - return *m.ItemCount - } - return 0 -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetItemsFulfilled() uint32 { - if m != nil && m.ItemsFulfilled != nil { - return *m.ItemsFulfilled - } - return 0 -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetItemRarity() uint32 { - if m != nil && m.ItemRarity != nil { - return *m.ItemRarity - } - return 0 -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetLootlist() string { - if m != nil && m.Lootlist != nil { - return *m.Lootlist - } - return "" -} - -func (m *CAttribute_ItemDynamicRecipeComponent) GetFulfilledItemId() uint64 { - if m != nil && m.FulfilledItemId != nil { - return *m.FulfilledItemId - } - return 0 -} - -type CProtoItemSocket struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - AttrDefIndex *uint32 `protobuf:"varint,2,opt,name=attr_def_index" json:"attr_def_index,omitempty"` - RequiredType *uint32 `protobuf:"varint,3,opt,name=required_type" json:"required_type,omitempty"` - RequiredHero *string `protobuf:"bytes,4,opt,name=required_hero" json:"required_hero,omitempty"` - GemDefIndex *uint32 `protobuf:"varint,5,opt,name=gem_def_index" json:"gem_def_index,omitempty"` - NotTradable *bool `protobuf:"varint,6,opt,name=not_tradable" json:"not_tradable,omitempty"` - RequiredItemSlot *string `protobuf:"bytes,7,opt,name=required_item_slot" json:"required_item_slot,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket) Reset() { *m = CProtoItemSocket{} } -func (m *CProtoItemSocket) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket) ProtoMessage() {} -func (*CProtoItemSocket) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{66} } - -func (m *CProtoItemSocket) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CProtoItemSocket) GetAttrDefIndex() uint32 { - if m != nil && m.AttrDefIndex != nil { - return *m.AttrDefIndex - } - return 0 -} - -func (m *CProtoItemSocket) GetRequiredType() uint32 { - if m != nil && m.RequiredType != nil { - return *m.RequiredType - } - return 0 -} - -func (m *CProtoItemSocket) GetRequiredHero() string { - if m != nil && m.RequiredHero != nil { - return *m.RequiredHero - } - return "" -} - -func (m *CProtoItemSocket) GetGemDefIndex() uint32 { - if m != nil && m.GemDefIndex != nil { - return *m.GemDefIndex - } - return 0 -} - -func (m *CProtoItemSocket) GetNotTradable() bool { - if m != nil && m.NotTradable != nil { - return *m.NotTradable - } - return false -} - -func (m *CProtoItemSocket) GetRequiredItemSlot() string { - if m != nil && m.RequiredItemSlot != nil { - return *m.RequiredItemSlot - } - return "" -} - -type CProtoItemSocket_Empty struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_Empty) Reset() { *m = CProtoItemSocket_Empty{} } -func (m *CProtoItemSocket_Empty) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_Empty) ProtoMessage() {} -func (*CProtoItemSocket_Empty) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{67} } - -func (m *CProtoItemSocket_Empty) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -type CProtoItemSocket_Effect struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - Effect *uint32 `protobuf:"varint,2,opt,name=effect" json:"effect,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_Effect) Reset() { *m = CProtoItemSocket_Effect{} } -func (m *CProtoItemSocket_Effect) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_Effect) ProtoMessage() {} -func (*CProtoItemSocket_Effect) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{68} } - -func (m *CProtoItemSocket_Effect) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_Effect) GetEffect() uint32 { - if m != nil && m.Effect != nil { - return *m.Effect - } - return 0 -} - -type CProtoItemSocket_Color struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - Red *uint32 `protobuf:"varint,2,opt,name=red" json:"red,omitempty"` - Green *uint32 `protobuf:"varint,3,opt,name=green" json:"green,omitempty"` - Blue *uint32 `protobuf:"varint,4,opt,name=blue" json:"blue,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_Color) Reset() { *m = CProtoItemSocket_Color{} } -func (m *CProtoItemSocket_Color) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_Color) ProtoMessage() {} -func (*CProtoItemSocket_Color) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{69} } - -func (m *CProtoItemSocket_Color) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_Color) GetRed() uint32 { - if m != nil && m.Red != nil { - return *m.Red - } - return 0 -} - -func (m *CProtoItemSocket_Color) GetGreen() uint32 { - if m != nil && m.Green != nil { - return *m.Green - } - return 0 -} - -func (m *CProtoItemSocket_Color) GetBlue() uint32 { - if m != nil && m.Blue != nil { - return *m.Blue - } - return 0 -} - -type CProtoItemSocket_Strange struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - StrangeType *uint32 `protobuf:"varint,2,opt,name=strange_type" json:"strange_type,omitempty"` - StrangeValue *uint32 `protobuf:"varint,3,opt,name=strange_value" json:"strange_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_Strange) Reset() { *m = CProtoItemSocket_Strange{} } -func (m *CProtoItemSocket_Strange) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_Strange) ProtoMessage() {} -func (*CProtoItemSocket_Strange) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{70} } - -func (m *CProtoItemSocket_Strange) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_Strange) GetStrangeType() uint32 { - if m != nil && m.StrangeType != nil { - return *m.StrangeType - } - return 0 -} - -func (m *CProtoItemSocket_Strange) GetStrangeValue() uint32 { - if m != nil && m.StrangeValue != nil { - return *m.StrangeValue - } - return 0 -} - -type CProtoItemSocket_Spectator struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - GamesViewed *uint32 `protobuf:"varint,2,opt,name=games_viewed" json:"games_viewed,omitempty"` - CorporationId *uint32 `protobuf:"varint,3,opt,name=corporation_id" json:"corporation_id,omitempty"` - LeagueId *uint32 `protobuf:"varint,4,opt,name=league_id" json:"league_id,omitempty"` - TeamId *uint32 `protobuf:"varint,5,opt,name=team_id" json:"team_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_Spectator) Reset() { *m = CProtoItemSocket_Spectator{} } -func (m *CProtoItemSocket_Spectator) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_Spectator) ProtoMessage() {} -func (*CProtoItemSocket_Spectator) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{71} } - -func (m *CProtoItemSocket_Spectator) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_Spectator) GetGamesViewed() uint32 { - if m != nil && m.GamesViewed != nil { - return *m.GamesViewed - } - return 0 -} - -func (m *CProtoItemSocket_Spectator) GetCorporationId() uint32 { - if m != nil && m.CorporationId != nil { - return *m.CorporationId - } - return 0 -} - -func (m *CProtoItemSocket_Spectator) GetLeagueId() uint32 { - if m != nil && m.LeagueId != nil { - return *m.LeagueId - } - return 0 -} - -func (m *CProtoItemSocket_Spectator) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -type CProtoItemSocket_AssetModifier struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - AssetModifier *uint32 `protobuf:"varint,2,opt,name=asset_modifier" json:"asset_modifier,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_AssetModifier) Reset() { *m = CProtoItemSocket_AssetModifier{} } -func (m *CProtoItemSocket_AssetModifier) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_AssetModifier) ProtoMessage() {} -func (*CProtoItemSocket_AssetModifier) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{72} } - -func (m *CProtoItemSocket_AssetModifier) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_AssetModifier) GetAssetModifier() uint32 { - if m != nil && m.AssetModifier != nil { - return *m.AssetModifier - } - return 0 -} - -type CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - AssetModifier *uint32 `protobuf:"varint,2,opt,name=asset_modifier" json:"asset_modifier,omitempty"` - AnimModifier *uint32 `protobuf:"varint,3,opt,name=anim_modifier" json:"anim_modifier,omitempty"` - AbilityEffect *uint32 `protobuf:"varint,4,opt,name=ability_effect" json:"ability_effect,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) Reset() { - *m = CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY{} -} -func (m *CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) String() string { - return proto.CompactTextString(m) -} -func (*CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) ProtoMessage() {} -func (*CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{73} -} - -func (m *CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) GetAssetModifier() uint32 { - if m != nil && m.AssetModifier != nil { - return *m.AssetModifier - } - return 0 -} - -func (m *CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) GetAnimModifier() uint32 { - if m != nil && m.AnimModifier != nil { - return *m.AnimModifier - } - return 0 -} - -func (m *CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY) GetAbilityEffect() uint32 { - if m != nil && m.AbilityEffect != nil { - return *m.AbilityEffect - } - return 0 -} - -type CProtoItemSocket_Autograph struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - Autograph *string `protobuf:"bytes,2,opt,name=autograph" json:"autograph,omitempty"` - AutographId *uint32 `protobuf:"varint,3,opt,name=autograph_id" json:"autograph_id,omitempty"` - AutographScore *uint32 `protobuf:"varint,4,opt,name=autograph_score" json:"autograph_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_Autograph) Reset() { *m = CProtoItemSocket_Autograph{} } -func (m *CProtoItemSocket_Autograph) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_Autograph) ProtoMessage() {} -func (*CProtoItemSocket_Autograph) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{74} } - -func (m *CProtoItemSocket_Autograph) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -func (m *CProtoItemSocket_Autograph) GetAutograph() string { - if m != nil && m.Autograph != nil { - return *m.Autograph - } - return "" -} - -func (m *CProtoItemSocket_Autograph) GetAutographId() uint32 { - if m != nil && m.AutographId != nil { - return *m.AutographId - } - return 0 -} - -func (m *CProtoItemSocket_Autograph) GetAutographScore() uint32 { - if m != nil && m.AutographScore != nil { - return *m.AutographScore - } - return 0 -} - -type CProtoItemSocket_StaticVisuals struct { - Socket *CProtoItemSocket `protobuf:"bytes,1,opt,name=socket" json:"socket,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CProtoItemSocket_StaticVisuals) Reset() { *m = CProtoItemSocket_StaticVisuals{} } -func (m *CProtoItemSocket_StaticVisuals) String() string { return proto.CompactTextString(m) } -func (*CProtoItemSocket_StaticVisuals) ProtoMessage() {} -func (*CProtoItemSocket_StaticVisuals) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{75} } - -func (m *CProtoItemSocket_StaticVisuals) GetSocket() *CProtoItemSocket { - if m != nil { - return m.Socket - } - return nil -} - -type CAttribute_String struct { - Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_String) Reset() { *m = CAttribute_String{} } -func (m *CAttribute_String) String() string { return proto.CompactTextString(m) } -func (*CAttribute_String) ProtoMessage() {} -func (*CAttribute_String) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{76} } - -func (m *CAttribute_String) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CWorkshop_GetItemDailyRevenue_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - ItemId *uint32 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - DateStart *uint32 `protobuf:"varint,3,opt,name=date_start" json:"date_start,omitempty"` - DateEnd *uint32 `protobuf:"varint,4,opt,name=date_end" json:"date_end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetItemDailyRevenue_Request) Reset() { *m = CWorkshop_GetItemDailyRevenue_Request{} } -func (m *CWorkshop_GetItemDailyRevenue_Request) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_GetItemDailyRevenue_Request) ProtoMessage() {} -func (*CWorkshop_GetItemDailyRevenue_Request) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{77} -} - -func (m *CWorkshop_GetItemDailyRevenue_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_GetItemDailyRevenue_Request) GetItemId() uint32 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CWorkshop_GetItemDailyRevenue_Request) GetDateStart() uint32 { - if m != nil && m.DateStart != nil { - return *m.DateStart - } - return 0 -} - -func (m *CWorkshop_GetItemDailyRevenue_Request) GetDateEnd() uint32 { - if m != nil && m.DateEnd != nil { - return *m.DateEnd - } - return 0 -} - -type CWorkshop_GetItemDailyRevenue_Response struct { - CountryRevenue []*CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue `protobuf:"bytes,1,rep,name=country_revenue" json:"country_revenue,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetItemDailyRevenue_Response) Reset() { - *m = CWorkshop_GetItemDailyRevenue_Response{} -} -func (m *CWorkshop_GetItemDailyRevenue_Response) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_GetItemDailyRevenue_Response) ProtoMessage() {} -func (*CWorkshop_GetItemDailyRevenue_Response) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{78} -} - -func (m *CWorkshop_GetItemDailyRevenue_Response) GetCountryRevenue() []*CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue { - if m != nil { - return m.CountryRevenue - } - return nil -} - -type CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue struct { - CountryCode *string `protobuf:"bytes,1,opt,name=country_code" json:"country_code,omitempty"` - Date *uint32 `protobuf:"varint,2,opt,name=date" json:"date,omitempty"` - RevenueUsd *int64 `protobuf:"varint,3,opt,name=revenue_usd" json:"revenue_usd,omitempty"` - Units *int32 `protobuf:"varint,4,opt,name=units" json:"units,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) Reset() { - *m = CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue{} -} -func (m *CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) ProtoMessage() {} -func (*CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{78, 0} -} - -func (m *CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) GetCountryCode() string { - if m != nil && m.CountryCode != nil { - return *m.CountryCode - } - return "" -} - -func (m *CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) GetDate() uint32 { - if m != nil && m.Date != nil { - return *m.Date - } - return 0 -} - -func (m *CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) GetRevenueUsd() int64 { - if m != nil && m.RevenueUsd != nil { - return *m.RevenueUsd - } - return 0 -} - -func (m *CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue) GetUnits() int32 { - if m != nil && m.Units != nil { - return *m.Units - } - return 0 -} - -type CMsgGenericResult struct { - Eresult *uint32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGenericResult) Reset() { *m = CMsgGenericResult{} } -func (m *CMsgGenericResult) String() string { return proto.CompactTextString(m) } -func (*CMsgGenericResult) ProtoMessage() {} -func (*CMsgGenericResult) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{79} } - -const Default_CMsgGenericResult_Eresult uint32 = 2 - -func (m *CMsgGenericResult) GetEresult() uint32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CMsgGenericResult_Eresult -} - -type CMsgSQLGCToGCGrantBackpackSlots struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - AddSlots *uint32 `protobuf:"varint,2,opt,name=add_slots" json:"add_slots,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSQLGCToGCGrantBackpackSlots) Reset() { *m = CMsgSQLGCToGCGrantBackpackSlots{} } -func (m *CMsgSQLGCToGCGrantBackpackSlots) String() string { return proto.CompactTextString(m) } -func (*CMsgSQLGCToGCGrantBackpackSlots) ProtoMessage() {} -func (*CMsgSQLGCToGCGrantBackpackSlots) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{80} -} - -func (m *CMsgSQLGCToGCGrantBackpackSlots) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgSQLGCToGCGrantBackpackSlots) GetAddSlots() uint32 { - if m != nil && m.AddSlots != nil { - return *m.AddSlots - } - return 0 -} - -type CMsgClientToGCLookupAccountName struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCLookupAccountName) Reset() { *m = CMsgClientToGCLookupAccountName{} } -func (m *CMsgClientToGCLookupAccountName) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCLookupAccountName) ProtoMessage() {} -func (*CMsgClientToGCLookupAccountName) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{81} -} - -func (m *CMsgClientToGCLookupAccountName) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgClientToGCLookupAccountNameResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - AccountName *string `protobuf:"bytes,2,opt,name=account_name" json:"account_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientToGCLookupAccountNameResponse) Reset() { - *m = CMsgClientToGCLookupAccountNameResponse{} -} -func (m *CMsgClientToGCLookupAccountNameResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgClientToGCLookupAccountNameResponse) ProtoMessage() {} -func (*CMsgClientToGCLookupAccountNameResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{82} -} - -func (m *CMsgClientToGCLookupAccountNameResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgClientToGCLookupAccountNameResponse) GetAccountName() string { - if m != nil && m.AccountName != nil { - return *m.AccountName - } - return "" -} - -func init() { - proto.RegisterType((*CMsgApplyAutograph)(nil), "CMsgApplyAutograph") - proto.RegisterType((*CMsgAdjustItemEquippedState)(nil), "CMsgAdjustItemEquippedState") - proto.RegisterType((*CMsgEconPlayerStrangeCountAdjustment)(nil), "CMsgEconPlayerStrangeCountAdjustment") - proto.RegisterType((*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment)(nil), "CMsgEconPlayerStrangeCountAdjustment.CStrangeCountAdjustment") - proto.RegisterType((*CMsgRequestItemPurgatory_FinalizePurchase)(nil), "CMsgRequestItemPurgatory_FinalizePurchase") - proto.RegisterType((*CMsgRequestItemPurgatory_FinalizePurchaseResponse)(nil), "CMsgRequestItemPurgatory_FinalizePurchaseResponse") - proto.RegisterType((*CMsgRequestItemPurgatory_RefundPurchase)(nil), "CMsgRequestItemPurgatory_RefundPurchase") - proto.RegisterType((*CMsgRequestItemPurgatory_RefundPurchaseResponse)(nil), "CMsgRequestItemPurgatory_RefundPurchaseResponse") - proto.RegisterType((*CMsgCraftingResponse)(nil), "CMsgCraftingResponse") - proto.RegisterType((*CMsgGCRequestStoreSalesData)(nil), "CMsgGCRequestStoreSalesData") - proto.RegisterType((*CMsgGCRequestStoreSalesDataResponse)(nil), "CMsgGCRequestStoreSalesDataResponse") - proto.RegisterType((*CMsgGCRequestStoreSalesDataResponse_Price)(nil), "CMsgGCRequestStoreSalesDataResponse.Price") - proto.RegisterType((*CMsgGCRequestStoreSalesDataUpToDateResponse)(nil), "CMsgGCRequestStoreSalesDataUpToDateResponse") - proto.RegisterType((*CMsgGCToGCPingRequest)(nil), "CMsgGCToGCPingRequest") - proto.RegisterType((*CMsgGCToGCPingResponse)(nil), "CMsgGCToGCPingResponse") - proto.RegisterType((*CMsgGCToGCGetUserSessionServer)(nil), "CMsgGCToGCGetUserSessionServer") - proto.RegisterType((*CMsgGCToGCGetUserSessionServerResponse)(nil), "CMsgGCToGCGetUserSessionServerResponse") - proto.RegisterType((*CMsgGCToGCGetUserServerMembers)(nil), "CMsgGCToGCGetUserServerMembers") - proto.RegisterType((*CMsgGCToGCGetUserServerMembersResponse)(nil), "CMsgGCToGCGetUserServerMembersResponse") - proto.RegisterType((*CMsgLookupMultipleAccountNames)(nil), "CMsgLookupMultipleAccountNames") - proto.RegisterType((*CMsgLookupMultipleAccountNamesResponse)(nil), "CMsgLookupMultipleAccountNamesResponse") - proto.RegisterType((*CMsgLookupMultipleAccountNamesResponse_Account)(nil), "CMsgLookupMultipleAccountNamesResponse.Account") - proto.RegisterType((*CMsgGCToGCGetUserPCBangNo)(nil), "CMsgGCToGCGetUserPCBangNo") - proto.RegisterType((*CMsgGCToGCGetUserPCBangNoResponse)(nil), "CMsgGCToGCGetUserPCBangNoResponse") - proto.RegisterType((*CMsgRequestCrateItems)(nil), "CMsgRequestCrateItems") - proto.RegisterType((*CMsgRequestCrateItemsResponse)(nil), "CMsgRequestCrateItemsResponse") - proto.RegisterType((*CMsgGCToGCCanUseDropRateBonus)(nil), "CMsgGCToGCCanUseDropRateBonus") - proto.RegisterType((*CMsgSQLAddDropRateBonus)(nil), "CMsgSQLAddDropRateBonus") - proto.RegisterType((*CMsgSQLUpgradeBattleBooster)(nil), "CMsgSQLUpgradeBattleBooster") - proto.RegisterType((*CMsgGCToGCRefreshSOCache)(nil), "CMsgGCToGCRefreshSOCache") - proto.RegisterType((*CMsgGCToGCCheckAccountTradeStatus)(nil), "CMsgGCToGCCheckAccountTradeStatus") - proto.RegisterType((*CMsgGCToGCCheckAccountTradeStatusResponse)(nil), "CMsgGCToGCCheckAccountTradeStatusResponse") - proto.RegisterType((*CMsgGCToGCGrantAccountRolledItems)(nil), "CMsgGCToGCGrantAccountRolledItems") - proto.RegisterType((*CMsgGCToGCGrantAccountRolledItems_Item)(nil), "CMsgGCToGCGrantAccountRolledItems.Item") - proto.RegisterType((*CMsgGCToGCGrantAccountRolledItems_Item_DynamicAttribute)(nil), "CMsgGCToGCGrantAccountRolledItems.Item.DynamicAttribute") - proto.RegisterType((*CMsgGCToGCGrantAccountRolledItems_Item_AdditionalAuditEntry)(nil), "CMsgGCToGCGrantAccountRolledItems.Item.AdditionalAuditEntry") - proto.RegisterType((*CMsgGCToGCGrantSelfMadeItemToAccount)(nil), "CMsgGCToGCGrantSelfMadeItemToAccount") - proto.RegisterType((*CMsgUseItem)(nil), "CMsgUseItem") - proto.RegisterType((*CMsgServerUseItem)(nil), "CMsgServerUseItem") - proto.RegisterType((*CMsgGCPartnerBalanceRequest)(nil), "CMsgGCPartnerBalanceRequest") - proto.RegisterType((*CMsgGCPartnerBalanceResponse)(nil), "CMsgGCPartnerBalanceResponse") - proto.RegisterType((*CGCStoreRechargeRedirect_LineItem)(nil), "CGCStoreRechargeRedirect_LineItem") - proto.RegisterType((*CMsgGCPartnerRechargeRedirectURLRequest)(nil), "CMsgGCPartnerRechargeRedirectURLRequest") - proto.RegisterType((*CMsgGCPartnerRechargeRedirectURLResponse)(nil), "CMsgGCPartnerRechargeRedirectURLResponse") - proto.RegisterType((*CMsgGCEconSQLWorkItemEmbeddedRollbackData)(nil), "CMsgGCEconSQLWorkItemEmbeddedRollbackData") - proto.RegisterType((*CMsgCraftStatue)(nil), "CMsgCraftStatue") - proto.RegisterType((*CMsgRedeemCode)(nil), "CMsgRedeemCode") - proto.RegisterType((*CMsgRedeemCodeResponse)(nil), "CMsgRedeemCodeResponse") - proto.RegisterType((*CMsgDevNewItemRequest)(nil), "CMsgDevNewItemRequest") - proto.RegisterType((*CMsgDevNewItemRequestResponse)(nil), "CMsgDevNewItemRequestResponse") - proto.RegisterType((*CMsgGCAddGiftItem)(nil), "CMsgGCAddGiftItem") - proto.RegisterType((*CMsgClientToGCWrapAndDeliverGift)(nil), "CMsgClientToGCWrapAndDeliverGift") - proto.RegisterType((*CMsgClientToGCWrapAndDeliverGiftResponse)(nil), "CMsgClientToGCWrapAndDeliverGiftResponse") - proto.RegisterType((*CMsgClientToGCUnwrapGift)(nil), "CMsgClientToGCUnwrapGift") - proto.RegisterType((*CMsgClientToGCUnpackBundle)(nil), "CMsgClientToGCUnpackBundle") - proto.RegisterType((*CMsgClientToGCUnpackBundleResponse)(nil), "CMsgClientToGCUnpackBundleResponse") - proto.RegisterType((*CMsgGCToClientStoreTransactionCompleted)(nil), "CMsgGCToClientStoreTransactionCompleted") - proto.RegisterType((*CMsgClientToGCEquipItems)(nil), "CMsgClientToGCEquipItems") - proto.RegisterType((*CMsgClientToGCEquipItemsResponse)(nil), "CMsgClientToGCEquipItemsResponse") - proto.RegisterType((*CMsgClientToGCSetItemStyle)(nil), "CMsgClientToGCSetItemStyle") - proto.RegisterType((*CMsgClientToGCSetItemStyleResponse)(nil), "CMsgClientToGCSetItemStyleResponse") - proto.RegisterType((*CMsgClientToGCUnlockItemStyle)(nil), "CMsgClientToGCUnlockItemStyle") - proto.RegisterType((*CMsgClientToGCUnlockItemStyleResponse)(nil), "CMsgClientToGCUnlockItemStyleResponse") - proto.RegisterType((*CMsgClientToGCSetItemInventoryCategory)(nil), "CMsgClientToGCSetItemInventoryCategory") - proto.RegisterType((*CMsgClientToGCUnlockCrate)(nil), "CMsgClientToGCUnlockCrate") - proto.RegisterType((*CMsgClientToGCUnlockCrateResponse)(nil), "CMsgClientToGCUnlockCrateResponse") - proto.RegisterType((*CMsgClientToGCUnlockCrateResponse_Item)(nil), "CMsgClientToGCUnlockCrateResponse.Item") - proto.RegisterType((*CMsgClientToGCRemoveItemAttribute)(nil), "CMsgClientToGCRemoveItemAttribute") - proto.RegisterType((*CMsgClientToGCRemoveItemAttributeResponse)(nil), "CMsgClientToGCRemoveItemAttributeResponse") - proto.RegisterType((*CMsgClientToGCNameItem)(nil), "CMsgClientToGCNameItem") - proto.RegisterType((*CMsgClientToGCNameItemResponse)(nil), "CMsgClientToGCNameItemResponse") - proto.RegisterType((*CMsgGCSetItemPosition)(nil), "CMsgGCSetItemPosition") - proto.RegisterType((*CAttribute_ItemDynamicRecipeComponent)(nil), "CAttribute_ItemDynamicRecipeComponent") - proto.RegisterType((*CProtoItemSocket)(nil), "CProtoItemSocket") - proto.RegisterType((*CProtoItemSocket_Empty)(nil), "CProtoItemSocket_Empty") - proto.RegisterType((*CProtoItemSocket_Effect)(nil), "CProtoItemSocket_Effect") - proto.RegisterType((*CProtoItemSocket_Color)(nil), "CProtoItemSocket_Color") - proto.RegisterType((*CProtoItemSocket_Strange)(nil), "CProtoItemSocket_Strange") - proto.RegisterType((*CProtoItemSocket_Spectator)(nil), "CProtoItemSocket_Spectator") - proto.RegisterType((*CProtoItemSocket_AssetModifier)(nil), "CProtoItemSocket_AssetModifier") - proto.RegisterType((*CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY)(nil), "CProtoItemSocket_AssetModifier_DESERIALIZE_FROM_STRING_ONLY") - proto.RegisterType((*CProtoItemSocket_Autograph)(nil), "CProtoItemSocket_Autograph") - proto.RegisterType((*CProtoItemSocket_StaticVisuals)(nil), "CProtoItemSocket_StaticVisuals") - proto.RegisterType((*CAttribute_String)(nil), "CAttribute_String") - proto.RegisterType((*CWorkshop_GetItemDailyRevenue_Request)(nil), "CWorkshop_GetItemDailyRevenue_Request") - proto.RegisterType((*CWorkshop_GetItemDailyRevenue_Response)(nil), "CWorkshop_GetItemDailyRevenue_Response") - proto.RegisterType((*CWorkshop_GetItemDailyRevenue_Response_CountryDailyRevenue)(nil), "CWorkshop_GetItemDailyRevenue_Response.CountryDailyRevenue") - proto.RegisterType((*CMsgGenericResult)(nil), "CMsgGenericResult") - proto.RegisterType((*CMsgSQLGCToGCGrantBackpackSlots)(nil), "CMsgSQLGCToGCGrantBackpackSlots") - proto.RegisterType((*CMsgClientToGCLookupAccountName)(nil), "CMsgClientToGCLookupAccountName") - proto.RegisterType((*CMsgClientToGCLookupAccountNameResponse)(nil), "CMsgClientToGCLookupAccountNameResponse") - proto.RegisterEnum("EGCItemMsg", EGCItemMsg_name, EGCItemMsg_value) - proto.RegisterEnum("EGCMsgResponse", EGCMsgResponse_name, EGCMsgResponse_value) - proto.RegisterEnum("EItemPurgatoryResponse_Finalize", EItemPurgatoryResponse_Finalize_name, EItemPurgatoryResponse_Finalize_value) - proto.RegisterEnum("EItemPurgatoryResponse_Refund", EItemPurgatoryResponse_Refund_name, EItemPurgatoryResponse_Refund_value) - proto.RegisterEnum("EGCPartnerRequestResponse", EGCPartnerRequestResponse_name, EGCPartnerRequestResponse_value) - proto.RegisterEnum("EGCMsgInitiateTradeResponse", EGCMsgInitiateTradeResponse_name, EGCMsgInitiateTradeResponse_value) - proto.RegisterEnum("CMsgRequestCrateItemsResponse_EResult", CMsgRequestCrateItemsResponse_EResult_name, CMsgRequestCrateItemsResponse_EResult_value) - proto.RegisterEnum("CMsgRedeemCodeResponse_EResultCode", CMsgRedeemCodeResponse_EResultCode_name, CMsgRedeemCodeResponse_EResultCode_value) - proto.RegisterEnum("CMsgClientToGCUnpackBundleResponse_EUnpackBundle", CMsgClientToGCUnpackBundleResponse_EUnpackBundle_name, CMsgClientToGCUnpackBundleResponse_EUnpackBundle_value) - proto.RegisterEnum("CMsgClientToGCSetItemStyleResponse_ESetStyle", CMsgClientToGCSetItemStyleResponse_ESetStyle_name, CMsgClientToGCSetItemStyleResponse_ESetStyle_value) - proto.RegisterEnum("CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle", CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle_name, CMsgClientToGCUnlockItemStyleResponse_EUnlockStyle_value) - proto.RegisterEnum("CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute", CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute_name, CMsgClientToGCRemoveItemAttributeResponse_ERemoveItemAttribute_value) - proto.RegisterEnum("CMsgClientToGCNameItemResponse_ENameItem", CMsgClientToGCNameItemResponse_ENameItem_name, CMsgClientToGCNameItemResponse_ENameItem_value) -} - -var econ_fileDescriptor0 = []byte{ - // 6148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x3c, 0x69, 0x78, 0x24, 0xc7, - 0x55, 0x91, 0xb4, 0xda, 0x99, 0x2d, 0xad, 0x76, 0x6b, 0x7b, 0x66, 0x2f, 0x79, 0x7d, 0x8d, 0x13, - 0x7b, 0xbd, 0xf6, 0x8e, 0xe3, 0x5d, 0x3b, 0x71, 0xec, 0xc4, 0x46, 0x1a, 0xcd, 0x2a, 0xc2, 0xda, - 0x5d, 0x59, 0x23, 0xd9, 0x10, 0xbe, 0xa4, 0x69, 0x4d, 0x97, 0x46, 0x1d, 0xf5, 0x74, 0x8f, 0xbb, - 0x7b, 0x76, 0x35, 0xf9, 0x95, 0x83, 0x24, 0x5c, 0x39, 0x39, 0x3e, 0x20, 0x9c, 0x81, 0x1c, 0x10, - 0x02, 0x24, 0x5c, 0x5f, 0xb8, 0x13, 0x0c, 0x84, 0xf0, 0x41, 0x0e, 0x92, 0x00, 0x21, 0x09, 0x7c, - 0x1f, 0xe4, 0x3e, 0xc8, 0x7d, 0x27, 0xe6, 0xbd, 0xaa, 0xea, 0xee, 0xaa, 0xe9, 0x9e, 0xd6, 0x7c, - 0x1f, 0xfc, 0xb1, 0x35, 0x55, 0xaf, 0x5e, 0xbd, 0x7a, 0xf5, 0xee, 0x7a, 0xbd, 0xe4, 0x28, 0x6b, - 0xfb, 0x9e, 0xd9, 0x69, 0x77, 0x59, 0x18, 0x5a, 0x1d, 0x16, 0xd6, 0x7b, 0x81, 0x1f, 0xf9, 0x73, - 0x95, 0x30, 0x62, 0x56, 0x57, 0x1f, 0xac, 0x35, 0x89, 0xd1, 0xb8, 0x18, 0x76, 0xe6, 0x7b, 0x3d, - 0x77, 0x30, 0xdf, 0x8f, 0xfc, 0x4e, 0x60, 0xf5, 0xb6, 0x8d, 0x93, 0xe4, 0x88, 0x15, 0xff, 0x30, - 0x9d, 0x88, 0x75, 0x4d, 0xc7, 0x3e, 0x31, 0x71, 0xc3, 0xc4, 0xe9, 0x7d, 0x46, 0x95, 0x1c, 0x14, - 0x03, 0x72, 0x74, 0x12, 0x47, 0x6b, 0xdb, 0xe4, 0x1a, 0x8e, 0xc6, 0x7e, 0x6e, 0x3f, 0x8c, 0x96, - 0x61, 0xaa, 0xf9, 0x68, 0xdf, 0xe9, 0xf5, 0x98, 0xdd, 0x8a, 0xac, 0x88, 0x19, 0x87, 0x49, 0x49, - 0xc7, 0x72, 0x84, 0x1c, 0xf0, 0xd8, 0x55, 0xb3, 0xed, 0x5a, 0x61, 0xc8, 0x51, 0xcc, 0x1a, 0x94, - 0x94, 0x71, 0x28, 0x74, 0xfd, 0xe8, 0xc4, 0x14, 0x1f, 0xa9, 0x90, 0x99, 0x30, 0x1a, 0xb8, 0xcc, - 0x74, 0x3c, 0x9b, 0xed, 0x9e, 0xd8, 0x87, 0x83, 0xb5, 0x2f, 0x4c, 0x90, 0x27, 0xe2, 0x56, 0x4d, - 0x38, 0xe3, 0xaa, 0x6b, 0x0d, 0x58, 0xd0, 0x8a, 0x02, 0xcb, 0xeb, 0xb0, 0x86, 0xdf, 0xf7, 0x22, - 0x41, 0x40, 0x97, 0x79, 0x91, 0x61, 0x10, 0x62, 0xb5, 0xdb, 0x38, 0x18, 0x6f, 0x3b, 0x6b, 0xfc, - 0x30, 0x39, 0x19, 0x0a, 0x68, 0x53, 0xcc, 0x58, 0x09, 0x3c, 0x92, 0x31, 0x75, 0x7a, 0xe6, 0xdc, - 0x33, 0xea, 0xe3, 0x60, 0xaf, 0x37, 0xf2, 0xc7, 0xe7, 0xd6, 0xc8, 0xf1, 0xc6, 0x68, 0x82, 0xd8, - 0x15, 0xf8, 0xc3, 0x8c, 0x06, 0x3d, 0x26, 0x09, 0x52, 0x18, 0xc3, 0x19, 0xc9, 0xa9, 0x4e, 0x96, - 0x08, 0x3e, 0xd4, 0x9e, 0x41, 0x6e, 0x45, 0x9a, 0xd6, 0xd8, 0xa3, 0x7d, 0x26, 0xb8, 0xbb, 0xda, - 0x0f, 0x3a, 0x56, 0xe4, 0x07, 0x03, 0xf3, 0x82, 0xe3, 0x59, 0xae, 0xf3, 0x3c, 0x06, 0x23, 0xed, - 0x6d, 0x2b, 0x64, 0xc8, 0x46, 0x89, 0x31, 0x84, 0x3d, 0xa6, 0xe0, 0x6e, 0x36, 0xc8, 0x9d, 0x63, - 0x2f, 0x5f, 0x63, 0x61, 0xcf, 0xf7, 0x00, 0xcd, 0x21, 0xb2, 0x3f, 0x60, 0x61, 0xdf, 0x8d, 0x24, - 0xa1, 0x2a, 0xda, 0x49, 0x8e, 0xf6, 0x3e, 0x72, 0xcb, 0x48, 0xb4, 0x6b, 0x6c, 0xab, 0xef, 0xd9, - 0x05, 0x34, 0xcd, 0x93, 0x3b, 0xc6, 0x5c, 0x3c, 0x8a, 0xa2, 0xda, 0x69, 0x52, 0x45, 0x14, 0x8d, - 0xc0, 0xda, 0x8a, 0x1c, 0xaf, 0x93, 0xc0, 0x65, 0x37, 0xfb, 0x3e, 0x21, 0x9c, 0x4b, 0x0d, 0xb9, - 0x5d, 0x0b, 0xb6, 0x61, 0x2d, 0xcb, 0x65, 0xe1, 0xa2, 0x15, 0x59, 0x78, 0x07, 0x57, 0x58, 0x10, - 0x3a, 0xbe, 0x97, 0x9e, 0xb5, 0xdd, 0x0f, 0x02, 0xe6, 0xb5, 0x07, 0x42, 0x36, 0x6b, 0x6f, 0x9b, - 0x20, 0x37, 0x15, 0xa0, 0x48, 0xf6, 0xbe, 0x9f, 0x90, 0x10, 0x06, 0xcd, 0x5e, 0xe0, 0xb4, 0x19, - 0xdf, 0x7d, 0xe6, 0xdc, 0x99, 0xfa, 0x18, 0x2b, 0xeb, 0xab, 0xb8, 0x42, 0x25, 0x45, 0x28, 0xc5, - 0x71, 0x72, 0x98, 0xed, 0xf6, 0x9c, 0xc0, 0x8a, 0x60, 0xcc, 0x8c, 0x9c, 0x2e, 0x13, 0x32, 0x31, - 0x77, 0x9a, 0x4c, 0x8b, 0x25, 0xf1, 0x71, 0x6d, 0xb6, 0x25, 0xc9, 0x9f, 0x25, 0xd3, 0x62, 0x7f, - 0x41, 0xfb, 0x23, 0xe4, 0xb6, 0x02, 0x02, 0x36, 0x7a, 0xeb, 0x3e, 0xfc, 0x3f, 0x65, 0x73, 0x86, - 0x1b, 0x39, 0x24, 0x08, 0xc4, 0xc7, 0xc9, 0x51, 0x81, 0x78, 0xdd, 0x5f, 0x6a, 0xac, 0xf2, 0x2b, - 0xe0, 0x1b, 0xd4, 0x4e, 0x90, 0x63, 0xc3, 0x13, 0x02, 0x79, 0xed, 0x2e, 0x72, 0x5d, 0x3a, 0xb3, - 0xc4, 0xa2, 0x8d, 0x10, 0x14, 0x0c, 0x0c, 0x12, 0x60, 0x6e, 0xb1, 0x00, 0xf6, 0xcd, 0xd3, 0x5a, - 0x10, 0x96, 0x9b, 0x8b, 0x57, 0x25, 0xc4, 0x03, 0xad, 0x21, 0x1f, 0x31, 0xb9, 0xad, 0x8b, 0x51, - 0xec, 0xaf, 0xad, 0xe4, 0x6e, 0x8c, 0x90, 0x17, 0x59, 0x77, 0x13, 0xce, 0x9b, 0x6b, 0x2e, 0x8e, - 0x91, 0x43, 0x5d, 0x6b, 0xd7, 0x0c, 0x7b, 0xac, 0x1d, 0xa1, 0x6c, 0x4a, 0x53, 0x55, 0x6b, 0xe4, - 0x12, 0xa4, 0x60, 0x4b, 0x08, 0x02, 0x43, 0xda, 0xe5, 0x43, 0xa6, 0x86, 0x7c, 0x0a, 0x90, 0xdc, - 0x23, 0x48, 0x5a, 0xf1, 0xfd, 0x9d, 0x7e, 0xef, 0x22, 0xc8, 0xb5, 0xd3, 0x73, 0xd9, 0xbc, 0x80, - 0xba, 0x64, 0x81, 0x99, 0x86, 0xed, 0x63, 0x92, 0x62, 0x59, 0x9e, 0x5d, 0x98, 0xa4, 0x13, 0xb5, - 0x5f, 0x98, 0x10, 0xfb, 0x8f, 0x5e, 0x9a, 0xec, 0x3f, 0x4f, 0xca, 0x12, 0x45, 0x28, 0xc5, 0xf1, - 0x8e, 0xfa, 0x78, 0x4b, 0xeb, 0x72, 0x70, 0xee, 0x2c, 0x29, 0xc9, 0x3f, 0xd1, 0x6a, 0x27, 0x04, - 0xa5, 0x06, 0xac, 0x07, 0x07, 0xf6, 0x3d, 0x8b, 0xf3, 0xe6, 0x40, 0xed, 0x0e, 0x72, 0x32, 0xc3, - 0x9b, 0xd5, 0xc6, 0x02, 0x18, 0xc4, 0x4b, 0x7e, 0xee, 0xed, 0x3e, 0x95, 0xdc, 0x38, 0x72, 0x41, - 0x72, 0x0e, 0x58, 0xd8, 0x6b, 0x9b, 0x9b, 0x30, 0x68, 0x7a, 0xbe, 0x5c, 0x78, 0x87, 0x90, 0x3f, - 0x29, 0x75, 0x60, 0x07, 0x22, 0x86, 0x86, 0x04, 0xf9, 0x76, 0xa8, 0x8d, 0xbf, 0x4c, 0x5d, 0x31, - 0x6a, 0x1e, 0xb9, 0x36, 0x77, 0x81, 0x6a, 0x3a, 0x02, 0xf9, 0xb7, 0x3c, 0x1e, 0x9c, 0x38, 0x46, - 0x22, 0xec, 0x1e, 0xda, 0x9d, 0x52, 0x73, 0x8d, 0x1b, 0x22, 0x38, 0xfc, 0xcc, 0x8e, 0xd9, 0xea, - 0xb7, 0xdb, 0x8c, 0xd9, 0xcc, 0xa6, 0x4f, 0x30, 0x0e, 0x92, 0xf2, 0x8e, 0x79, 0xc1, 0x72, 0x5c, - 0xf8, 0x35, 0x51, 0xfb, 0xb9, 0x09, 0xb1, 0xa1, 0x38, 0x5a, 0xc3, 0xf2, 0xe0, 0x68, 0x8b, 0x81, - 0xdf, 0x5b, 0x83, 0x8d, 0x17, 0x7c, 0xaf, 0x9f, 0x2f, 0x74, 0x20, 0xc3, 0x36, 0x00, 0x99, 0xfc, - 0x04, 0x9b, 0x08, 0xc6, 0x39, 0x3b, 0x89, 0x9e, 0x77, 0xd3, 0xf7, 0x41, 0xb0, 0x03, 0xe1, 0x41, - 0x84, 0x93, 0x9c, 0x23, 0x06, 0xdb, 0x6d, 0xbb, 0xfd, 0xd0, 0xb9, 0xa2, 0x1c, 0x98, 0xfb, 0x4a, - 0xe3, 0x04, 0xa1, 0x96, 0xeb, 0xfa, 0x57, 0x4d, 0x38, 0xb1, 0xe5, 0x72, 0x8c, 0x27, 0xa6, 0x61, - 0xa6, 0x5c, 0x7b, 0xcb, 0x04, 0xf8, 0x29, 0x20, 0xad, 0xf5, 0xd0, 0xca, 0xbc, 0x6d, 0xef, 0x4d, - 0x54, 0xc6, 0x4f, 0xa9, 0x66, 0x67, 0x6a, 0x14, 0xdd, 0xfb, 0x72, 0xe9, 0x9e, 0x8e, 0x69, 0x0b, - 0x31, 0x4e, 0xb1, 0x43, 0xd3, 0xee, 0x0b, 0xe3, 0x72, 0x62, 0x7f, 0xac, 0x75, 0xcc, 0xb3, 0xb9, - 0xa5, 0x01, 0x35, 0xb6, 0xba, 0xbd, 0x13, 0x25, 0x7e, 0x7d, 0xbe, 0x30, 0xe3, 0x40, 0xf2, 0x46, - 0x0f, 0x22, 0x13, 0x9b, 0x2d, 0x58, 0x51, 0xe4, 0x02, 0xd1, 0x1c, 0x77, 0x2e, 0xd9, 0x2a, 0x95, - 0xc2, 0xa0, 0x72, 0x62, 0x80, 0x36, 0x33, 0xf2, 0xc1, 0xf9, 0xdb, 0x9c, 0xf6, 0x2c, 0x89, 0x22, - 0xd4, 0xb8, 0x9f, 0x9c, 0x48, 0xaf, 0x0f, 0xbc, 0x12, 0xc8, 0xc6, 0x76, 0xeb, 0x72, 0xc3, 0x6a, - 0x6f, 0xb3, 0xdc, 0xdd, 0xb8, 0x87, 0x72, 0x7d, 0x4b, 0xf0, 0xa8, 0x5c, 0xfb, 0x7e, 0x55, 0xb2, - 0x1b, 0xdb, 0xac, 0xbd, 0x23, 0x15, 0x69, 0x1d, 0xa9, 0xc7, 0xc8, 0x68, 0x04, 0xb7, 0x51, 0xea, - 0x3c, 0x27, 0x72, 0xd0, 0xe6, 0x48, 0x5c, 0x6b, 0x22, 0x06, 0x28, 0xc4, 0x95, 0xc8, 0x31, 0xac, - 0x6f, 0x5b, 0x60, 0xab, 0x71, 0x8a, 0xa3, 0x2c, 0xf3, 0xe0, 0x23, 0x08, 0xfc, 0x00, 0xe2, 0x1e, - 0x3b, 0x36, 0xe0, 0x1f, 0xdf, 0xa7, 0xa9, 0x1e, 0x04, 0x2d, 0x91, 0x44, 0xba, 0xe6, 0xbb, 0x20, - 0xc2, 0x42, 0x9b, 0xf2, 0x08, 0x7c, 0x0a, 0x99, 0x46, 0xbe, 0xc6, 0x31, 0xd3, 0x2d, 0xf5, 0x3d, - 0xd1, 0xd4, 0xf1, 0xbf, 0xc8, 0x67, 0xab, 0x6f, 0x3b, 0x10, 0x77, 0xb5, 0xf9, 0x85, 0x0b, 0xc9, - 0xc1, 0x1d, 0xf8, 0xa8, 0x0d, 0x0e, 0x49, 0xf0, 0x7e, 0xee, 0x5d, 0x53, 0x64, 0x1f, 0x5f, 0x92, - 0xf5, 0x6f, 0x00, 0xee, 0xfa, 0x7e, 0x64, 0xba, 0x4e, 0x28, 0xa3, 0xb6, 0x03, 0x3c, 0x2a, 0xed, - 0x78, 0xe0, 0xd8, 0x60, 0xb4, 0xeb, 0x88, 0xc0, 0xa9, 0x8c, 0x17, 0xe2, 0x07, 0x4e, 0xc7, 0xf1, - 0xa4, 0x3e, 0xac, 0x13, 0xc3, 0x1e, 0x78, 0x56, 0xd7, 0x69, 0x9b, 0x20, 0x3a, 0x81, 0xb3, 0xd9, - 0x8f, 0x58, 0x08, 0xf2, 0x88, 0x67, 0xb8, 0x67, 0xcc, 0x33, 0xd4, 0x17, 0x05, 0x86, 0xf9, 0x18, - 0x81, 0xf1, 0x1c, 0x72, 0x02, 0x24, 0xc9, 0xc1, 0x03, 0x81, 0x92, 0x89, 0x93, 0x40, 0xf0, 0x16, - 0x38, 0x80, 0x7b, 0x3f, 0xc7, 0xfd, 0xf4, 0x71, 0x71, 0xcf, 0x27, 0x78, 0xe6, 0x11, 0x4d, 0x13, - 0xb0, 0x0c, 0x50, 0xb1, 0x1c, 0x0f, 0x03, 0x47, 0x0c, 0x8e, 0x22, 0x7f, 0x87, 0x79, 0x42, 0x21, - 0xe6, 0x1e, 0x24, 0x34, 0x43, 0xcc, 0x41, 0xb2, 0x0f, 0x46, 0xc4, 0xad, 0x73, 0xb6, 0x5c, 0xb1, - 0xdc, 0x3e, 0x33, 0xfb, 0x8e, 0x17, 0x9d, 0x3f, 0x27, 0x75, 0x00, 0xe2, 0x6a, 0x31, 0xba, 0x05, - 0xc2, 0x2a, 0x78, 0x35, 0x39, 0xf7, 0x2c, 0x52, 0xcd, 0xdd, 0x1d, 0xf4, 0xd4, 0xbf, 0xea, 0x0d, - 0x3b, 0x30, 0xa9, 0x4a, 0xda, 0x65, 0x4e, 0xe6, 0x5c, 0xa6, 0x08, 0x60, 0x1f, 0x12, 0x21, 0xbb, - 0xc2, 0x80, 0x16, 0x73, 0xb7, 0x2e, 0x82, 0x74, 0xe2, 0xa9, 0xd7, 0xfd, 0xd8, 0xbf, 0x80, 0xe6, - 0xc7, 0x77, 0x2d, 0x63, 0xfe, 0x44, 0x1f, 0x52, 0xbf, 0x23, 0x64, 0x17, 0x0c, 0xd8, 0x0c, 0xe2, - 0x04, 0x93, 0xca, 0xc5, 0x24, 0x93, 0x61, 0x00, 0xd7, 0x22, 0x2b, 0xe8, 0xb0, 0x28, 0x0d, 0x05, - 0x70, 0xe5, 0x7e, 0xe3, 0x7a, 0x72, 0xbc, 0xe3, 0x6c, 0x45, 0xa6, 0xd9, 0xf3, 0x23, 0x60, 0xaa, - 0x03, 0x77, 0x26, 0x00, 0x43, 0xa0, 0x76, 0x4a, 0x58, 0x26, 0xbb, 0xcf, 0x5c, 0x53, 0x64, 0x27, - 0xa6, 0xeb, 0xb7, 0x77, 0xa4, 0xfc, 0x80, 0xad, 0x4d, 0xf4, 0x32, 0x45, 0x3b, 0xcd, 0xf7, 0xbb, - 0x91, 0x9c, 0x44, 0x02, 0x7a, 0x56, 0x7b, 0xc7, 0x34, 0xf1, 0x3f, 0x0e, 0xa4, 0x5a, 0x36, 0x80, - 0x32, 0x77, 0xc0, 0x0d, 0x5b, 0x19, 0x02, 0xf1, 0x23, 0xdc, 0x80, 0xf1, 0x48, 0x21, 0x26, 0xfc, - 0x14, 0xa9, 0xa6, 0x38, 0x33, 0x3c, 0xae, 0x91, 0x83, 0xfd, 0x50, 0xda, 0xf5, 0x6e, 0xd8, 0xe1, - 0x47, 0x98, 0x39, 0x77, 0xb0, 0xae, 0x1c, 0xbd, 0x76, 0x6d, 0x1c, 0xde, 0xae, 0x5a, 0x41, 0x04, - 0x37, 0xb5, 0x60, 0xb9, 0x96, 0xd7, 0x66, 0x71, 0x34, 0xd6, 0x23, 0xa7, 0xf2, 0xa7, 0xa5, 0xb1, - 0x78, 0x40, 0x8b, 0xab, 0x0f, 0x9d, 0x9b, 0xab, 0x37, 0x13, 0x58, 0x89, 0x23, 0x86, 0xbd, 0xb7, - 0xb2, 0x63, 0x36, 0xf5, 0xa9, 0xcb, 0x0f, 0x22, 0xeb, 0x37, 0x05, 0x4e, 0x79, 0x37, 0x68, 0xf7, - 0x96, 0x1a, 0x3c, 0xce, 0x5c, 0x63, 0x10, 0xc4, 0x03, 0x73, 0xd7, 0x80, 0x15, 0x01, 0x44, 0x51, - 0xe6, 0x8a, 0xe3, 0x89, 0x73, 0x83, 0x10, 0xa6, 0x77, 0xad, 0xd8, 0x6b, 0xf0, 0x54, 0x70, 0x29, - 0x51, 0x1c, 0x79, 0x5b, 0x22, 0xcb, 0x50, 0x28, 0xd2, 0x11, 0x6e, 0xac, 0xad, 0x48, 0x4a, 0xc0, - 0x28, 0x11, 0x17, 0xb0, 0x9b, 0xc2, 0x32, 0x89, 0x68, 0xa7, 0x56, 0xdf, 0x93, 0x92, 0xda, 0x2e, - 0x39, 0xbd, 0xf7, 0x16, 0xff, 0x5f, 0xcc, 0x9a, 0x21, 0x53, 0xfd, 0xc0, 0x95, 0xb1, 0xd2, 0x0f, - 0xc4, 0x46, 0x1d, 0xd3, 0x4d, 0xf0, 0x6b, 0x8f, 0xf8, 0xc1, 0x0e, 0x4f, 0x9e, 0x21, 0x62, 0xb4, - 0x21, 0xa2, 0x40, 0xfb, 0xb0, 0x09, 0xb2, 0xc4, 0xd3, 0x94, 0x51, 0xb1, 0x02, 0x73, 0x59, 0xc4, - 0xec, 0xa1, 0x7c, 0xfc, 0xc5, 0x13, 0xe4, 0x70, 0x92, 0x1d, 0x71, 0xef, 0xc0, 0x13, 0xa8, 0x6d, - 0x16, 0xf8, 0xaa, 0xfe, 0x86, 0x48, 0x17, 0x5c, 0x1c, 0x37, 0x19, 0x9c, 0x26, 0xcc, 0x1e, 0xda, - 0x83, 0xb6, 0xcb, 0xa4, 0x67, 0x84, 0x6b, 0xb2, 0x59, 0xd8, 0x0e, 0x9c, 0x1e, 0xd7, 0xf1, 0x7d, - 0x1c, 0x06, 0x34, 0x04, 0x52, 0x7b, 0x38, 0x10, 0xe8, 0x0e, 0xee, 0x8b, 0xb6, 0x79, 0x3a, 0x76, - 0x81, 0x91, 0xef, 0xbb, 0xb0, 0xc7, 0x7e, 0x4e, 0xc7, 0x75, 0xe4, 0x90, 0x08, 0xb9, 0x6c, 0xc6, - 0xba, 0x0d, 0x70, 0x3d, 0x68, 0xa0, 0xb8, 0x0b, 0xe2, 0x06, 0xaa, 0xf6, 0xe6, 0x09, 0x91, 0x2b, - 0xa4, 0x00, 0x05, 0xc1, 0xd8, 0x70, 0x10, 0x02, 0xa2, 0x3d, 0x23, 0x43, 0x31, 0x8e, 0x3a, 0x13, - 0x8e, 0x9d, 0x24, 0x47, 0xe3, 0x70, 0xcc, 0x44, 0x88, 0x4b, 0x7e, 0x74, 0x01, 0x18, 0x08, 0xb1, - 0x19, 0xa8, 0xdd, 0x09, 0x6d, 0x6a, 0xde, 0x0d, 0x98, 0x65, 0x0f, 0x40, 0xa7, 0x6c, 0x3a, 0x09, - 0x7c, 0xad, 0x24, 0xb3, 0x97, 0x23, 0xe0, 0x5a, 0x13, 0x7d, 0x27, 0x9d, 0xaa, 0x3d, 0x2a, 0x62, - 0xce, 0x45, 0x76, 0xe5, 0x12, 0xbb, 0x8a, 0x57, 0x15, 0x0b, 0xdf, 0x51, 0x32, 0x9b, 0x88, 0x33, - 0xe7, 0xe6, 0x14, 0xe7, 0x14, 0x58, 0xb4, 0xc4, 0x57, 0x89, 0x71, 0xc1, 0x41, 0x00, 0x47, 0x0f, - 0x94, 0x82, 0x4f, 0x73, 0x37, 0x86, 0x77, 0x8c, 0xc3, 0xdc, 0x3c, 0x73, 0xe7, 0x71, 0xa0, 0xf6, - 0x64, 0x11, 0x44, 0x66, 0xb6, 0x54, 0x33, 0xb6, 0x10, 0x0f, 0x1d, 0x86, 0xc2, 0xd7, 0x43, 0x66, - 0x71, 0x44, 0x88, 0x15, 0x18, 0xf4, 0x25, 0x30, 0x75, 0x5c, 0xdf, 0xc6, 0x89, 0xea, 0x6a, 0x8c, - 0xdc, 0xc0, 0xa5, 0xc6, 0x75, 0xc0, 0x32, 0xa2, 0xb1, 0x7e, 0x24, 0xb0, 0x7a, 0xf3, 0x9e, 0xbd, - 0xc8, 0x5c, 0x08, 0x2f, 0x03, 0x44, 0x96, 0xb5, 0xb4, 0x60, 0x15, 0x3b, 0x18, 0x7c, 0x62, 0x44, - 0x95, 0xee, 0x90, 0x84, 0x5b, 0xdc, 0xd8, 0xca, 0xaa, 0x93, 0xe0, 0x4a, 0xed, 0xb1, 0x49, 0xa1, - 0x72, 0x45, 0xfb, 0x24, 0xc7, 0xbb, 0x7b, 0x48, 0x0e, 0x0e, 0x9d, 0x3b, 0x8c, 0x4a, 0xc7, 0x85, - 0x46, 0x6a, 0x9a, 0x01, 0x9a, 0xa6, 0x8d, 0x80, 0xa2, 0x5d, 0x43, 0x2a, 0xb8, 0x33, 0x64, 0x9f, - 0xa6, 0x50, 0x67, 0x13, 0x0c, 0x69, 0x5c, 0x6b, 0xe2, 0x24, 0x6b, 0x93, 0x90, 0xe7, 0x71, 0xe2, - 0xa6, 0x63, 0x92, 0x71, 0x8e, 0xaf, 0xd8, 0x17, 0xfb, 0xcc, 0x78, 0x14, 0x41, 0xa7, 0x39, 0x28, - 0xd8, 0xee, 0x78, 0xf0, 0x2a, 0xf8, 0x2b, 0x08, 0xb4, 0xb7, 0xfd, 0x7e, 0x10, 0xca, 0x38, 0xd6, - 0x24, 0x47, 0x78, 0x04, 0x66, 0x02, 0xf9, 0xe0, 0x9e, 0x85, 0x93, 0x2c, 0xf1, 0x13, 0x9c, 0x92, - 0x27, 0x58, 0x16, 0x96, 0x9f, 0xf1, 0x20, 0x2e, 0x39, 0xce, 0xcd, 0xf1, 0x71, 0x72, 0xa7, 0x4d, - 0xf0, 0x96, 0xac, 0x07, 0x2a, 0x5f, 0xbb, 0x4d, 0xc4, 0xa7, 0x29, 0x17, 0x37, 0xbc, 0xab, 0xc0, - 0xc7, 0xdc, 0x5b, 0xaa, 0x9d, 0x25, 0x73, 0xc3, 0xc0, 0xe8, 0xab, 0x16, 0x40, 0x1d, 0xdc, 0x6c, - 0x81, 0xae, 0xf6, 0xa1, 0x29, 0x52, 0x1b, 0x0d, 0xaf, 0xe6, 0xb7, 0x7d, 0x3e, 0x9e, 0x5a, 0x20, - 0x59, 0x75, 0x31, 0x9e, 0xad, 0xdc, 0xdb, 0x24, 0x3f, 0xf5, 0x9d, 0xf5, 0xbd, 0x31, 0xd6, 0x9b, - 0xea, 0xe8, 0xbd, 0xa0, 0xa4, 0xea, 0xef, 0x54, 0xbb, 0x6b, 0x6f, 0x9b, 0x24, 0xb3, 0x1a, 0xac, - 0x50, 0xe9, 0x7c, 0x68, 0xb0, 0x05, 0xb7, 0x92, 0x27, 0x0d, 0xcd, 0x4a, 0xfd, 0x46, 0xed, 0x58, - 0x0e, 0xc1, 0x34, 0x88, 0x61, 0xb0, 0x0d, 0x77, 0x93, 0x3b, 0xf3, 0x41, 0x37, 0x3c, 0x6b, 0xd3, - 0x65, 0xeb, 0x7e, 0x03, 0x6c, 0x45, 0xc4, 0x1a, 0xbe, 0x17, 0x59, 0xe0, 0x44, 0x78, 0x00, 0x07, - 0x46, 0xe3, 0x66, 0x52, 0xcb, 0x5f, 0x26, 0x73, 0x06, 0x69, 0x43, 0x8c, 0x5b, 0xc8, 0x4d, 0x45, - 0x94, 0x2c, 0x7b, 0xa0, 0xfd, 0x8e, 0x4d, 0xf7, 0x8d, 0x26, 0x79, 0xc1, 0xe2, 0x7b, 0x3e, 0x24, - 0x5d, 0x25, 0x9d, 0x36, 0x6e, 0x27, 0xa7, 0x8b, 0x49, 0x5e, 0xe4, 0x6e, 0x82, 0x53, 0xba, 0xbf, - 0xf6, 0x60, 0xec, 0x54, 0xe1, 0x28, 0xfc, 0x36, 0xb8, 0x87, 0x04, 0x29, 0xf3, 0x42, 0x11, 0xcb, - 0x35, 0xfc, 0x6e, 0x8f, 0xbb, 0x15, 0x6e, 0xd0, 0x77, 0xbd, 0x54, 0xd9, 0xb3, 0x75, 0xc0, 0x67, - 0x0e, 0x4b, 0x21, 0x2f, 0xfd, 0x8a, 0xdc, 0xe1, 0x76, 0xb2, 0x9f, 0xe1, 0xaf, 0xd8, 0x1d, 0x9f, - 0xaa, 0x17, 0x54, 0x89, 0x6b, 0x0f, 0x0c, 0x5b, 0x9f, 0x14, 0x53, 0x22, 0x70, 0xa0, 0xd6, 0xa1, - 0x6f, 0xb6, 0x91, 0x9f, 0xa6, 0xac, 0x53, 0xa5, 0x55, 0x9e, 0x85, 0x61, 0x19, 0x6f, 0x31, 0xbe, - 0x4d, 0x0b, 0xab, 0xc8, 0x59, 0xc3, 0x35, 0x54, 0x5f, 0x16, 0x01, 0xc7, 0x47, 0x27, 0x86, 0x05, - 0x5f, 0x45, 0x92, 0xd0, 0xb1, 0x91, 0xb1, 0x4a, 0x67, 0xeb, 0x7b, 0x2f, 0xab, 0x37, 0x61, 0x94, - 0x8f, 0xdc, 0x5b, 0x05, 0x57, 0x25, 0xff, 0x56, 0xa4, 0xda, 0x22, 0x07, 0x12, 0x10, 0x70, 0xb3, - 0xb9, 0x40, 0x20, 0xcc, 0x47, 0xc9, 0x11, 0x65, 0x26, 0x2e, 0x38, 0x18, 0x37, 0x91, 0xeb, 0x33, - 0xc3, 0x26, 0xff, 0xb1, 0x1c, 0xae, 0xf8, 0xa8, 0xa4, 0x74, 0xb2, 0xe6, 0x08, 0x7f, 0xa2, 0xaa, - 0x21, 0x86, 0xb8, 0x29, 0x9f, 0xe2, 0x28, 0x1c, 0xec, 0x79, 0x9f, 0x4f, 0x15, 0xb0, 0x0b, 0xef, - 0x03, 0x62, 0x97, 0xb0, 0xdf, 0x45, 0x31, 0x4b, 0x4d, 0xc0, 0x14, 0x17, 0x8d, 0xd7, 0x4e, 0x93, - 0x27, 0x15, 0xee, 0x95, 0xb0, 0xf3, 0x39, 0x19, 0x76, 0x9e, 0xaf, 0x8f, 0xb5, 0x12, 0xed, 0x05, - 0x4e, 0x08, 0xa6, 0x1e, 0x47, 0x25, 0x48, 0x7e, 0xa6, 0x2c, 0xcb, 0xd6, 0x2f, 0x86, 0x0e, 0x33, - 0x95, 0x44, 0x44, 0x7c, 0xb0, 0x17, 0xb0, 0x80, 0x3d, 0x2a, 0xcb, 0x00, 0x1f, 0x9e, 0x22, 0x07, - 0xd5, 0x5d, 0xe0, 0xcc, 0xa3, 0xf6, 0x81, 0xab, 0xb9, 0x9e, 0x5c, 0xa3, 0x4f, 0xca, 0x6b, 0x58, - 0xc5, 0x10, 0xf4, 0xd1, 0xf8, 0x92, 0x72, 0x00, 0x1a, 0x98, 0x17, 0x6e, 0x6d, 0xf9, 0x01, 0x06, - 0x20, 0x45, 0x40, 0xa0, 0x9c, 0x90, 0xe2, 0x82, 0x21, 0x91, 0x06, 0x27, 0x17, 0x08, 0xaf, 0x9b, - 0x5b, 0x9d, 0xd4, 0x8e, 0x14, 0xec, 0x28, 0xf2, 0x47, 0xb0, 0x23, 0x45, 0x28, 0x05, 0xe8, 0x12, - 0x5a, 0x10, 0xe3, 0x0c, 0xb9, 0x39, 0x17, 0xee, 0x92, 0x8f, 0xa6, 0x83, 0x79, 0xb6, 0xd3, 0xef, - 0xae, 0xb0, 0x2b, 0xcc, 0xa5, 0x25, 0xe3, 0x34, 0x79, 0x62, 0x2e, 0x6c, 0x1c, 0x72, 0xf1, 0x19, - 0xe0, 0x5d, 0x79, 0xe4, 0xa9, 0x95, 0x10, 0xec, 0xc0, 0x48, 0x12, 0x75, 0xeb, 0x49, 0x46, 0xc2, - 0xad, 0x43, 0x7c, 0x9a, 0xc2, 0xcd, 0xd4, 0x5e, 0x24, 0xab, 0xa9, 0x19, 0xcd, 0x5d, 0x8e, 0x93, - 0xee, 0x06, 0x18, 0xa7, 0x0e, 0xfc, 0x3f, 0xfb, 0xb4, 0x20, 0x62, 0xe8, 0x08, 0x55, 0x45, 0x84, - 0x6c, 0x42, 0x29, 0xc0, 0x2b, 0x06, 0xac, 0xeb, 0x43, 0x4c, 0xd4, 0x16, 0x4b, 0xb1, 0x14, 0x30, - 0x15, 0x17, 0xb7, 0x2c, 0xdb, 0x56, 0xc7, 0x85, 0x90, 0x2d, 0x89, 0xb2, 0xe9, 0xb0, 0xbc, 0xf3, - 0x22, 0x25, 0x46, 0x8b, 0x4a, 0x41, 0x53, 0xb5, 0x5f, 0x3b, 0x6c, 0x30, 0x14, 0xf9, 0x3f, 0x36, - 0x21, 0x8a, 0x3a, 0xb9, 0x98, 0x12, 0x7d, 0x3b, 0x3f, 0x94, 0xc7, 0x8c, 0x15, 0x52, 0xdd, 0x4f, - 0x66, 0x3b, 0x98, 0xbc, 0x4b, 0x5f, 0xaf, 0x57, 0x7f, 0x0a, 0xf7, 0xe3, 0xd5, 0x8d, 0xb9, 0x33, - 0xb2, 0xa4, 0x93, 0xf7, 0x1a, 0x98, 0xa6, 0xfc, 0xc2, 0x0c, 0xdf, 0x35, 0x7c, 0x8a, 0x35, 0xce, - 0x50, 0x5c, 0x9f, 0x16, 0x3b, 0x32, 0x51, 0xcb, 0x5b, 0xa7, 0x44, 0x46, 0x55, 0xb8, 0x2c, 0x61, - 0x42, 0x90, 0x31, 0x3a, 0x0f, 0xd4, 0xc7, 0x5e, 0x5d, 0x6f, 0xe6, 0x4c, 0xde, 0x0b, 0xf2, 0x9b, - 0x33, 0x5c, 0x60, 0x88, 0x6a, 0x8f, 0x4f, 0x90, 0x6a, 0x1e, 0x2a, 0xa1, 0x0c, 0x85, 0xc8, 0xc0, - 0xda, 0xdc, 0x40, 0x4e, 0xe5, 0x03, 0x25, 0x3e, 0xa1, 0x4e, 0xce, 0x14, 0x41, 0x0c, 0xa9, 0xcd, - 0xa4, 0xf1, 0x34, 0x72, 0x77, 0x21, 0x7c, 0x32, 0x00, 0x26, 0xc1, 0x83, 0xa0, 0x89, 0x09, 0x58, - 0x1b, 0xec, 0x11, 0x8f, 0x9b, 0xc6, 0x59, 0xba, 0xe8, 0xb3, 0xd0, 0x8b, 0x9a, 0xbb, 0x90, 0x14, - 0x51, 0x7c, 0x9f, 0x3c, 0xa6, 0x73, 0x1d, 0xdf, 0x21, 0xb8, 0xa0, 0xe0, 0x73, 0x4e, 0x7f, 0xf3, - 0xb9, 0x98, 0xad, 0x67, 0x1e, 0xa1, 0x31, 0xcd, 0xd4, 0x45, 0x3f, 0xa9, 0x7d, 0x89, 0x24, 0xe3, - 0xad, 0x93, 0xe2, 0x81, 0x25, 0x8b, 0x37, 0x11, 0x80, 0x87, 0x32, 0x02, 0x70, 0x6b, 0xbd, 0x78, - 0x49, 0xbd, 0x19, 0x8f, 0xa0, 0x03, 0x8f, 0xff, 0x2e, 0xba, 0xdf, 0x37, 0x4d, 0x80, 0x4b, 0x4f, - 0x4e, 0xc4, 0x5d, 0x7a, 0x76, 0x59, 0xec, 0xd2, 0x93, 0x19, 0xdd, 0xa5, 0x0f, 0x0d, 0x0f, 0x99, - 0xb0, 0xc9, 0x7c, 0x20, 0xfd, 0x62, 0xa7, 0xf2, 0x81, 0xf8, 0xef, 0x34, 0xe4, 0xac, 0xdd, 0x1f, - 0xbf, 0xe9, 0x49, 0x1b, 0xb8, 0xea, 0x87, 0xbc, 0x24, 0x98, 0xd5, 0x59, 0xb8, 0x02, 0x7c, 0xae, - 0xef, 0x49, 0x00, 0xa9, 0xb6, 0x9f, 0x9b, 0x00, 0x8f, 0x9f, 0x5e, 0x3c, 0xa2, 0x90, 0x25, 0xca, - 0x35, 0xd6, 0x76, 0x7a, 0x0c, 0xbd, 0x83, 0xef, 0xe1, 0x6b, 0x78, 0xb6, 0xae, 0x1b, 0x77, 0x16, - 0xe0, 0x5b, 0x45, 0x52, 0x00, 0xc2, 0xbc, 0x95, 0x8f, 0x6e, 0xb9, 0x56, 0x27, 0x36, 0xa2, 0xd8, - 0x9e, 0x90, 0xd4, 0x6f, 0x4d, 0x4c, 0xae, 0xbc, 0x8e, 0x4c, 0xac, 0x63, 0x70, 0x9e, 0x87, 0xca, - 0xa2, 0x04, 0x16, 0x50, 0xd1, 0x5e, 0x99, 0x5b, 0x7d, 0x77, 0xcb, 0xc1, 0x92, 0xab, 0xcc, 0xd0, - 0xe2, 0x1a, 0x54, 0x60, 0x05, 0xb8, 0x61, 0x29, 0xae, 0x41, 0x61, 0xca, 0x8e, 0x19, 0xfb, 0x89, - 0x32, 0xc7, 0x09, 0xdb, 0x25, 0x2b, 0x13, 0x91, 0x3b, 0x20, 0x0c, 0xce, 0x04, 0xa1, 0x8d, 0x55, - 0xec, 0xa4, 0xe0, 0x91, 0x09, 0x3a, 0xb2, 0x9c, 0x0c, 0x19, 0x8d, 0x7e, 0x9c, 0xed, 0xab, 0xc1, - 0x13, 0xd8, 0xf5, 0x00, 0xe3, 0xe3, 0x00, 0xf0, 0x2a, 0x4f, 0x3a, 0xea, 0x30, 0x56, 0x6c, 0xd2, - 0x9a, 0x41, 0x47, 0x2b, 0x8e, 0x4e, 0xc7, 0x6c, 0x03, 0x3d, 0xe4, 0xc5, 0x7e, 0x8c, 0xc1, 0x44, - 0xad, 0x11, 0x33, 0xdc, 0x04, 0x07, 0x27, 0x86, 0xf7, 0x55, 0x94, 0xb8, 0x66, 0xdc, 0x07, 0x0a, - 0x37, 0x44, 0xb3, 0xd9, 0xec, 0xf6, 0xa2, 0x81, 0x71, 0x23, 0xd9, 0x1f, 0xf2, 0xdf, 0x9c, 0xf0, - 0x99, 0x73, 0x47, 0xea, 0xc3, 0x80, 0xb5, 0x15, 0x72, 0x3c, 0xbb, 0x78, 0x6b, 0x0b, 0x74, 0x74, - 0x8c, 0xd5, 0x98, 0x4e, 0x30, 0x0e, 0x2c, 0xe5, 0x85, 0xe5, 0x90, 0xd2, 0xf0, 0x5d, 0x3f, 0x18, - 0x07, 0xd9, 0x0c, 0x99, 0x82, 0xe3, 0x49, 0x5e, 0xce, 0x92, 0xe9, 0x4e, 0xc0, 0x58, 0xfc, 0xa6, - 0x00, 0xb6, 0x60, 0x13, 0x1d, 0xb2, 0xf0, 0xae, 0xcf, 0x85, 0x1c, 0x65, 0x78, 0x1b, 0xd9, 0xa5, - 0x31, 0xce, 0x46, 0x3c, 0x2e, 0x14, 0x6d, 0x23, 0xfc, 0x9a, 0x92, 0xdb, 0x8b, 0x47, 0x85, 0xf3, - 0x17, 0xc5, 0xee, 0x57, 0x4d, 0x40, 0x16, 0x92, 0xd9, 0x2c, 0x7e, 0x42, 0x1e, 0x73, 0xbb, 0x0e, - 0x3e, 0xc5, 0x9a, 0x57, 0x1c, 0x76, 0x35, 0x39, 0x20, 0xbe, 0x6a, 0xfa, 0x41, 0xcf, 0x97, 0x0f, - 0xf1, 0x8e, 0x2d, 0x4f, 0x0a, 0xce, 0xd3, 0x65, 0x56, 0xa7, 0xcf, 0x70, 0x68, 0x5f, 0x5c, 0xd7, - 0x51, 0x8b, 0xd3, 0xb3, 0xb5, 0x1f, 0x02, 0x53, 0x38, 0x4c, 0xd2, 0x7c, 0x08, 0x91, 0xcb, 0x45, - 0xdf, 0x76, 0xb6, 0x1c, 0x36, 0x16, 0x59, 0x28, 0xc5, 0xb8, 0xc6, 0xec, 0xca, 0x45, 0xf2, 0x0e, - 0xdf, 0x30, 0x41, 0xee, 0x2b, 0xc6, 0x6e, 0x2e, 0x36, 0x5b, 0xcd, 0xb5, 0xe5, 0xf9, 0x95, 0xe5, - 0x67, 0x35, 0xcd, 0x0b, 0x6b, 0x97, 0x2f, 0x9a, 0xad, 0xf5, 0xb5, 0xe5, 0x4b, 0x4b, 0xe6, 0xe5, - 0x4b, 0x2b, 0x3f, 0xf8, 0x7f, 0xd8, 0x9a, 0x97, 0xd1, 0x3c, 0xa7, 0x9b, 0x0e, 0xa7, 0x41, 0xd6, - 0xa6, 0x83, 0x46, 0xc4, 0x94, 0xd2, 0x26, 0xc4, 0xe0, 0x05, 0x79, 0x57, 0x93, 0x76, 0x3d, 0x8d, - 0x41, 0x08, 0xbe, 0x44, 0xc4, 0xf0, 0xb2, 0x60, 0xca, 0x9f, 0x41, 0x92, 0x5e, 0x29, 0x3b, 0x7d, - 0x0d, 0x4d, 0x47, 0x43, 0xb8, 0xb8, 0x58, 0x14, 0x1b, 0x39, 0x57, 0x81, 0xe9, 0xaf, 0xd3, 0x7e, - 0xd8, 0x09, 0xc1, 0xf2, 0x85, 0xe3, 0x28, 0x61, 0x8d, 0x1c, 0x51, 0xac, 0x6c, 0x8b, 0x1b, 0x40, - 0xd4, 0x00, 0x21, 0x87, 0xa2, 0xb4, 0xda, 0x05, 0x4b, 0x8c, 0x05, 0xe5, 0x70, 0xdb, 0xef, 0x99, - 0x4b, 0xc2, 0x9c, 0x2f, 0x82, 0xd5, 0x1f, 0xac, 0x61, 0x17, 0x12, 0x88, 0x4b, 0x5c, 0xba, 0x84, - 0x75, 0x56, 0xaf, 0x37, 0xaa, 0x28, 0xc8, 0x2d, 0xb0, 0x8d, 0xc1, 0x67, 0x18, 0x59, 0x41, 0xdc, - 0x9a, 0x05, 0x46, 0x92, 0x8f, 0x41, 0xa4, 0x2f, 0xcf, 0xf5, 0x11, 0x0c, 0xa3, 0xf7, 0xd8, 0x4f, - 0xba, 0xdd, 0x75, 0x72, 0x98, 0x9b, 0xe7, 0x60, 0x60, 0x06, 0x62, 0x4e, 0x96, 0x07, 0xee, 0xab, - 0x8f, 0x87, 0xa1, 0xde, 0x10, 0xcb, 0xd5, 0xc9, 0xb9, 0x67, 0x93, 0x4a, 0xce, 0x30, 0x5e, 0x4f, - 0xbc, 0x59, 0x5a, 0x77, 0x46, 0xf3, 0x80, 0xf4, 0xa7, 0x0f, 0x62, 0x92, 0x10, 0xb3, 0x1f, 0x8a, - 0x1b, 0x9c, 0x42, 0xb6, 0xf4, 0x3d, 0x27, 0x12, 0x01, 0xfa, 0x74, 0xed, 0x16, 0x59, 0x54, 0x65, - 0x1e, 0x0b, 0xd0, 0x9b, 0xf1, 0x06, 0x00, 0x83, 0x94, 0x98, 0xda, 0x94, 0x74, 0xef, 0xc4, 0xb9, - 0xda, 0x33, 0xc9, 0xf5, 0xf2, 0x99, 0x5a, 0x79, 0xef, 0x5a, 0xb0, 0xda, 0x3b, 0x58, 0x9c, 0x69, - 0x81, 0x15, 0x1e, 0xf9, 0xe6, 0x8b, 0x89, 0x01, 0x9a, 0xe9, 0xb8, 0xcd, 0xe4, 0x6e, 0x81, 0x29, - 0x8d, 0x46, 0x44, 0xd7, 0x86, 0xd2, 0xad, 0x91, 0xdb, 0x50, 0xd1, 0x12, 0xd5, 0x9d, 0x82, 0x65, - 0x6a, 0x5b, 0x45, 0xee, 0xb3, 0x9e, 0x1c, 0x4b, 0x9f, 0x05, 0xce, 0x7c, 0xe0, 0x3c, 0x21, 0x90, - 0x10, 0xe0, 0x95, 0x00, 0x6e, 0xa0, 0xf6, 0x20, 0x24, 0x08, 0x3c, 0x52, 0x58, 0xb0, 0x42, 0x46, - 0x3f, 0x59, 0x32, 0x4e, 0x61, 0x56, 0xdc, 0xcc, 0x0b, 0x1e, 0xe8, 0xa7, 0x4a, 0xb0, 0xd3, 0x6c, - 0x3c, 0xcb, 0xdf, 0x24, 0xe8, 0xa7, 0x4b, 0xe0, 0xa3, 0x8e, 0x6a, 0x63, 0x31, 0x59, 0xf4, 0x33, - 0x25, 0xb8, 0x92, 0x43, 0xf1, 0x9c, 0x28, 0x5d, 0xd1, 0xcf, 0x96, 0x8c, 0x27, 0x62, 0x08, 0x23, - 0x06, 0x1f, 0x86, 0x5b, 0xd8, 0x1a, 0xf0, 0x0c, 0xb7, 0xd5, 0xdf, 0x4c, 0x1e, 0x28, 0xe8, 0xe7, - 0x4a, 0xc6, 0xb5, 0x58, 0x07, 0x6c, 0xe6, 0x86, 0x71, 0xf4, 0xf3, 0x25, 0x30, 0x0e, 0x47, 0x62, - 0x24, 0xab, 0x96, 0xe3, 0x71, 0x4a, 0xe9, 0x17, 0x4b, 0xc6, 0x75, 0xe4, 0x64, 0x66, 0x3c, 0xa1, - 0xe8, 0x4b, 0x25, 0xa3, 0x46, 0xae, 0x8d, 0xe7, 0x97, 0x7c, 0xd7, 0x66, 0xde, 0x23, 0xd8, 0x21, - 0xb6, 0xbd, 0x10, 0xf8, 0x96, 0xdd, 0xb6, 0x20, 0x92, 0xfd, 0x72, 0x09, 0xc2, 0xbb, 0x4a, 0x0c, - 0x73, 0xf1, 0xf2, 0xfa, 0xa2, 0xd4, 0x30, 0xfa, 0x95, 0x12, 0x04, 0xea, 0xd7, 0xe4, 0xcc, 0x24, - 0xf8, 0xbf, 0x5a, 0x32, 0x6e, 0xc1, 0x7c, 0xb5, 0x19, 0xd7, 0xed, 0xc5, 0xc3, 0xa8, 0xb4, 0x0f, - 0x8b, 0xcd, 0xd5, 0xb5, 0x66, 0x63, 0x7e, 0xbd, 0xb9, 0x48, 0xbf, 0x56, 0x32, 0xee, 0xc0, 0x88, - 0x3e, 0x17, 0x30, 0x29, 0x11, 0x2b, 0x0b, 0xbe, 0x5e, 0x32, 0x6e, 0xc3, 0x64, 0x3d, 0x59, 0x20, - 0x40, 0xd7, 0x7d, 0xbc, 0x37, 0x1e, 0x0a, 0x2a, 0xc0, 0xdf, 0x18, 0x26, 0x23, 0x06, 0x1e, 0x06, - 0xfc, 0xe6, 0x30, 0x19, 0x2a, 0x60, 0x1e, 0x19, 0xdf, 0x2a, 0x41, 0x18, 0x55, 0x8d, 0x17, 0xe0, - 0x7d, 0xc4, 0xfb, 0xd3, 0x6f, 0x97, 0xc0, 0xe4, 0x9d, 0xca, 0x9b, 0x4a, 0xd8, 0xf3, 0x1d, 0xac, - 0x22, 0xdc, 0x14, 0x83, 0x88, 0x14, 0x43, 0xec, 0x38, 0x4c, 0xd8, 0x77, 0x4b, 0xc6, 0x93, 0xc9, - 0x6d, 0xa3, 0x20, 0xf3, 0x28, 0xfb, 0x9e, 0xb6, 0x7d, 0xa3, 0x1f, 0x46, 0x7e, 0xd7, 0x79, 0x9e, - 0x78, 0x99, 0x66, 0xbb, 0x51, 0x3f, 0x60, 0xf4, 0xf1, 0x92, 0x71, 0x2b, 0x16, 0x31, 0x46, 0x83, - 0x24, 0x94, 0x3e, 0xbf, 0x6c, 0x5c, 0x43, 0x8e, 0xc5, 0xa0, 0x1b, 0xf1, 0x39, 0x84, 0x1c, 0xbc, - 0xa0, 0xac, 0x6a, 0xc9, 0xc6, 0xd0, 0x21, 0x5f, 0x58, 0x56, 0xe5, 0x07, 0xab, 0xf8, 0xb2, 0x37, - 0x80, 0xbe, 0x48, 0x43, 0x9a, 0x66, 0x58, 0xc8, 0x2b, 0xfa, 0x12, 0x0d, 0x69, 0x3a, 0xc9, 0x85, - 0x98, 0xbe, 0xb4, 0xac, 0x0a, 0x76, 0xfa, 0x40, 0x10, 0x93, 0xf4, 0xb2, 0xb2, 0x71, 0x3d, 0x99, - 0xcb, 0x9b, 0x97, 0x54, 0xbd, 0xbc, 0xac, 0xaa, 0x9d, 0x5a, 0xd4, 0x54, 0x99, 0xf8, 0x0a, 0x7d, - 0x9b, 0x90, 0xd9, 0x0d, 0xd7, 0x72, 0xf8, 0x83, 0x1e, 0xbf, 0xe3, 0x57, 0x96, 0x55, 0xbd, 0x6b, - 0xf9, 0x41, 0x24, 0x4e, 0xf6, 0xaa, 0xb2, 0x71, 0x06, 0xab, 0x53, 0x62, 0x1c, 0x0c, 0xfc, 0x15, - 0xdf, 0xbd, 0x02, 0xce, 0x0c, 0x4c, 0x56, 0xb4, 0x82, 0x6f, 0x66, 0xca, 0x1e, 0xaf, 0x2e, 0xa7, - 0xaa, 0x0d, 0x7b, 0xf4, 0x6c, 0xd9, 0xbf, 0xd5, 0x02, 0x1b, 0xd0, 0xb5, 0xe8, 0xcf, 0x97, 0x55, - 0x25, 0x13, 0x7c, 0x10, 0x57, 0x15, 0x5f, 0xe3, 0x6b, 0xca, 0x59, 0x29, 0xd2, 0x20, 0x92, 0x43, - 0xff, 0xa2, 0xb6, 0x95, 0x80, 0xbc, 0x68, 0xed, 0xb0, 0x20, 0xbc, 0x68, 0x05, 0x3b, 0xf4, 0x97, - 0xca, 0xc6, 0x93, 0xc8, 0x0d, 0xa3, 0xa6, 0x13, 0x2c, 0xbf, 0x8c, 0x15, 0xad, 0xeb, 0x74, 0xb0, - 0x0d, 0xcf, 0x01, 0xc6, 0x73, 0x73, 0xb7, 0x8c, 0x41, 0x3c, 0xfd, 0x95, 0xb2, 0xaa, 0x9f, 0xf9, - 0x40, 0x09, 0xc6, 0x5f, 0xd5, 0x04, 0xa1, 0x65, 0xed, 0xee, 0x0e, 0x52, 0xfb, 0xf3, 0x6b, 0x65, - 0x55, 0x90, 0x13, 0x8f, 0x03, 0xbc, 0xbe, 0xe0, 0x78, 0x4e, 0xb8, 0x0d, 0xf9, 0xe4, 0x6b, 0xb5, - 0xcb, 0x1c, 0x51, 0x87, 0xa7, 0xbf, 0xae, 0x09, 0x62, 0x03, 0x9b, 0x54, 0xda, 0xc2, 0x4c, 0xbe, - 0x4e, 0xe3, 0x0b, 0x4f, 0xf2, 0xdb, 0x3b, 0x9e, 0x7f, 0x15, 0x12, 0xa3, 0x0e, 0xa0, 0x7f, 0x7d, - 0x59, 0xd5, 0x93, 0x55, 0xf0, 0x8c, 0x2c, 0x0a, 0xcd, 0x16, 0xc3, 0xf5, 0xe2, 0xd7, 0x05, 0x3f, - 0x68, 0x60, 0x57, 0x05, 0x7d, 0x83, 0x46, 0x49, 0x0a, 0xaa, 0x3b, 0x8e, 0x37, 0x96, 0x8d, 0x3a, - 0xb9, 0x75, 0x1c, 0x84, 0x6b, 0xac, 0xe7, 0x0e, 0xe8, 0x9b, 0x94, 0x8b, 0x19, 0x9d, 0xc4, 0xd3, - 0xdf, 0xd6, 0x2e, 0x86, 0xf7, 0xbe, 0x37, 0x92, 0x22, 0xb6, 0x48, 0x66, 0x42, 0xfa, 0x66, 0x4d, - 0x9e, 0x94, 0xf9, 0xdd, 0x6d, 0x0b, 0xd8, 0x06, 0xc7, 0xfd, 0x1d, 0x4d, 0xe8, 0x5b, 0xdb, 0x3e, - 0x7f, 0x9e, 0x0d, 0x57, 0x1d, 0x2c, 0x67, 0x6e, 0xf4, 0xe8, 0xef, 0x96, 0x8d, 0x9b, 0xc9, 0x8d, - 0x09, 0x06, 0x4e, 0xcf, 0xa2, 0x13, 0xf6, 0x5c, 0x6b, 0x70, 0xc9, 0x8f, 0x20, 0x60, 0x6d, 0xf3, - 0x50, 0x9e, 0xfe, 0x9e, 0xc6, 0x55, 0x4e, 0x8e, 0x4c, 0x4e, 0xb0, 0x7d, 0x80, 0xbe, 0x45, 0x13, - 0x5b, 0x73, 0xd9, 0x6b, 0x07, 0x0c, 0xbb, 0xc3, 0x1f, 0x84, 0x84, 0x94, 0x47, 0x3c, 0xc9, 0xb9, - 0x7e, 0x5f, 0x23, 0x99, 0x23, 0x5a, 0x65, 0x9e, 0x07, 0xf1, 0x87, 0xec, 0x98, 0xa3, 0x7f, 0xa0, - 0x6d, 0x35, 0xc4, 0xee, 0x90, 0xfe, 0xa1, 0x76, 0x81, 0xc3, 0xd3, 0x26, 0xf6, 0x08, 0xae, 0x60, - 0x7f, 0x15, 0x1c, 0xfe, 0x9d, 0x9a, 0xd9, 0xe1, 0x7b, 0x35, 0x3b, 0x9d, 0x26, 0x44, 0xe9, 0x5e, - 0x9b, 0xd1, 0x3f, 0xd2, 0x38, 0x8c, 0x17, 0x90, 0x4e, 0x26, 0xe4, 0xfe, 0xb1, 0xa6, 0xfc, 0x17, - 0x44, 0x8a, 0x9d, 0x5f, 0x2e, 0xa0, 0x7f, 0x52, 0x36, 0xce, 0x91, 0xb3, 0x63, 0xc1, 0x26, 0xf8, - 0xff, 0x54, 0x93, 0x31, 0xc1, 0x7f, 0x69, 0xf7, 0x50, 0x4f, 0x59, 0x84, 0x7d, 0x15, 0xf4, 0xcf, - 0xca, 0xc6, 0xed, 0xe4, 0x96, 0x3d, 0xa0, 0x12, 0x9c, 0x7f, 0xae, 0xe9, 0x46, 0x73, 0x17, 0xee, - 0xa9, 0x1d, 0x2d, 0xa1, 0x29, 0xfb, 0x0b, 0xcd, 0xc4, 0x25, 0x2e, 0x91, 0xfe, 0xa5, 0xce, 0x28, - 0xdd, 0x63, 0xd3, 0xbf, 0x1a, 0xd2, 0xc8, 0x5c, 0x7f, 0x4e, 0xdf, 0xae, 0x49, 0x5a, 0x82, 0x3b, - 0x99, 0x7f, 0x87, 0xa6, 0xfa, 0x6b, 0xa8, 0x18, 0x52, 0x82, 0x96, 0xb0, 0xab, 0x02, 0x64, 0x84, - 0xfe, 0xb5, 0x86, 0x22, 0xd3, 0x03, 0x4b, 0x1f, 0xd3, 0x84, 0x75, 0x64, 0x8f, 0x2c, 0xfd, 0x1b, - 0x4d, 0xc6, 0x14, 0x06, 0x24, 0x10, 0x7f, 0xab, 0x09, 0x51, 0x1e, 0x31, 0x09, 0xe8, 0xdf, 0x69, - 0x74, 0x6b, 0x8d, 0x51, 0xb1, 0x83, 0x7a, 0xb7, 0xc6, 0x70, 0xa5, 0xa3, 0x81, 0xbe, 0xa7, 0xac, - 0xc6, 0x64, 0xa9, 0xe3, 0x43, 0x80, 0x8b, 0xa2, 0xdf, 0x80, 0xbe, 0x57, 0x13, 0xb1, 0x5c, 0x98, - 0x84, 0x98, 0xf7, 0x0d, 0x71, 0x40, 0x85, 0x65, 0x81, 0x0c, 0x9f, 0x97, 0x6d, 0xfa, 0xcf, 0x9a, - 0x51, 0x1a, 0x09, 0x97, 0xe0, 0x7d, 0x7f, 0x39, 0x8d, 0x95, 0xf2, 0x4a, 0xcb, 0x72, 0x5d, 0x52, - 0xd0, 0xa2, 0x1f, 0x50, 0x94, 0x27, 0x6f, 0x01, 0x77, 0xfb, 0x1f, 0x54, 0x4e, 0x96, 0x07, 0xb4, - 0x98, 0x76, 0xed, 0xd0, 0x7f, 0x29, 0xa7, 0x41, 0xd1, 0x58, 0xc5, 0x6d, 0xfa, 0xaf, 0x1a, 0xd7, - 0xb1, 0xff, 0x00, 0x9c, 0x32, 0x8f, 0xf4, 0x3f, 0x3c, 0xa3, 0xde, 0xae, 0x9c, 0x31, 0x87, 0x3a, - 0x15, 0xc4, 0xd5, 0x7d, 0x64, 0x46, 0x65, 0xfe, 0x08, 0x50, 0xb9, 0xe1, 0x47, 0x67, 0x54, 0x49, - 0x88, 0x61, 0x5b, 0x98, 0x72, 0xca, 0x56, 0x7f, 0xfa, 0x1f, 0x33, 0xea, 0x7d, 0x27, 0x20, 0x62, - 0xb6, 0xe1, 0xfa, 0xd8, 0xba, 0xf3, 0xb1, 0x19, 0xe3, 0x4e, 0x72, 0xfb, 0x38, 0xd4, 0x25, 0x3b, - 0x7f, 0x7a, 0x46, 0xb7, 0x79, 0x28, 0x83, 0xe0, 0x54, 0xaf, 0x86, 0x2c, 0x30, 0x2f, 0x58, 0x57, - 0xfc, 0x00, 0xcc, 0x9d, 0x18, 0xa5, 0x6f, 0x3f, 0xa8, 0x1e, 0x48, 0x07, 0x5d, 0x70, 0xc1, 0xd9, - 0x62, 0xd1, 0x50, 0xc2, 0xbe, 0xe3, 0xa0, 0xe6, 0x1c, 0xe4, 0x77, 0x0a, 0x5e, 0x04, 0x19, 0x3e, - 0xe7, 0xe3, 0x6f, 0xcc, 0xaa, 0x16, 0x92, 0xdb, 0x59, 0xc8, 0x41, 0x1d, 0x76, 0x95, 0x37, 0xf7, - 0x8a, 0x86, 0x5e, 0xfa, 0xba, 0x59, 0x55, 0x24, 0x15, 0x20, 0xbd, 0xe1, 0x97, 0xbe, 0x7e, 0x56, - 0x8d, 0xe2, 0x14, 0xb8, 0xf8, 0x2a, 0xde, 0x30, 0xab, 0x06, 0xf6, 0x59, 0x80, 0x04, 0xd3, 0x1b, - 0x67, 0x55, 0xb2, 0x15, 0xc0, 0x26, 0x7e, 0x03, 0xc2, 0xe8, 0x6f, 0xce, 0xaa, 0x2c, 0xc8, 0xcc, - 0x6b, 0x7e, 0xed, 0xb7, 0x66, 0x55, 0x45, 0x51, 0x60, 0xf1, 0xcf, 0x05, 0xbf, 0xdf, 0xd9, 0x8e, - 0x34, 0xf8, 0x37, 0x69, 0xa7, 0x58, 0x64, 0x57, 0x4c, 0xbd, 0xe3, 0x89, 0xbe, 0xf7, 0xb0, 0x7a, - 0x8a, 0x2c, 0x40, 0xaa, 0xca, 0x87, 0x35, 0x37, 0x87, 0xdd, 0x0d, 0xf2, 0xcb, 0x02, 0x6e, 0xf2, - 0x1f, 0xab, 0xa8, 0xf1, 0xdb, 0xf0, 0x74, 0x6a, 0xea, 0x2a, 0xaa, 0xc0, 0x71, 0xb0, 0xf8, 0xab, - 0xa4, 0xf8, 0xbb, 0x29, 0xfa, 0xce, 0x8a, 0x26, 0x12, 0x79, 0x30, 0x09, 0xbe, 0xbf, 0xaf, 0xa8, - 0xa6, 0x53, 0x83, 0x6d, 0x60, 0xfb, 0xa4, 0x4b, 0xdf, 0x55, 0x51, 0x5d, 0x7d, 0x0e, 0x44, 0x82, - 0xeb, 0x1f, 0x2a, 0x9a, 0x78, 0xa9, 0x90, 0x28, 0xed, 0xf4, 0x9f, 0x2a, 0xaa, 0xe4, 0x64, 0xe6, - 0x13, 0x3c, 0xef, 0xd6, 0xce, 0xb8, 0x60, 0x79, 0x1e, 0xb3, 0x1f, 0xf1, 0x03, 0x1b, 0x83, 0xef, - 0x98, 0xed, 0xef, 0xa9, 0xa8, 0xa2, 0x3a, 0x0c, 0x23, 0x11, 0xbd, 0x57, 0x23, 0x1d, 0xed, 0x8b, - 0x0e, 0x98, 0xc6, 0xa9, 0xef, 0xd3, 0x48, 0xcb, 0x42, 0x8a, 0xc8, 0x1e, 0xec, 0xac, 0x76, 0x44, - 0x84, 0x5b, 0x74, 0x82, 0x68, 0xd0, 0x5a, 0x14, 0xed, 0x34, 0xf4, 0xfd, 0x19, 0x3c, 0x7c, 0x3e, - 0xfe, 0xa8, 0x25, 0x81, 0xfb, 0x80, 0x76, 0x44, 0xfe, 0x42, 0xc9, 0x77, 0x68, 0x3d, 0xb4, 0xf2, - 0x20, 0x1b, 0x3c, 0x8c, 0x25, 0x33, 0xfa, 0xc1, 0x2c, 0xf5, 0x31, 0xbd, 0x18, 0xf9, 0xf9, 0x2e, - 0x86, 0x17, 0x5d, 0xcb, 0xb3, 0xe9, 0xbf, 0x55, 0xb2, 0x2e, 0xeb, 0x61, 0xd1, 0x88, 0x12, 0x13, - 0xfe, 0xa1, 0x8a, 0x1a, 0xa5, 0xeb, 0x9f, 0x56, 0xd2, 0x7f, 0xd7, 0x64, 0x8f, 0xf7, 0xbe, 0xb1, - 0xcd, 0xf9, 0xd5, 0x65, 0xe9, 0x37, 0x1a, 0xdb, 0xe8, 0x28, 0x6d, 0xfa, 0x61, 0x6d, 0x1b, 0x61, - 0xb4, 0x87, 0xb6, 0xf9, 0xcf, 0x8a, 0x9a, 0x39, 0x14, 0x7f, 0xd7, 0x47, 0xff, 0xab, 0x62, 0x9c, - 0x27, 0xf5, 0xf1, 0x80, 0x93, 0x3b, 0xfd, 0xef, 0x8a, 0x6a, 0x1a, 0x8b, 0xbe, 0xd2, 0xa3, 0x1f, - 0xab, 0xa8, 0x86, 0x77, 0x9c, 0x0f, 0xfa, 0xe8, 0xc7, 0x2b, 0xaa, 0x79, 0xe0, 0xdf, 0x8a, 0x15, - 0x7c, 0x71, 0x19, 0xd2, 0x4f, 0x54, 0x74, 0x7f, 0x9f, 0xf3, 0x35, 0x1b, 0xfd, 0x64, 0x45, 0xf7, - 0xf7, 0x05, 0x9f, 0xdc, 0xd1, 0x4f, 0x55, 0xd4, 0x90, 0x72, 0xac, 0xaf, 0xe3, 0xe8, 0xa7, 0x2b, - 0x6a, 0x30, 0x37, 0xf4, 0xe1, 0x1b, 0xfd, 0x4c, 0x45, 0x35, 0x3b, 0xc3, 0x5f, 0xbf, 0xd1, 0xcf, - 0x66, 0xae, 0x3e, 0xef, 0x63, 0x36, 0xfa, 0xb9, 0x8a, 0x71, 0x16, 0xdb, 0xb9, 0x9a, 0x63, 0x7d, - 0xf3, 0x46, 0x3f, 0x3f, 0x1a, 0xab, 0xf2, 0x45, 0x1a, 0xfd, 0x9f, 0xd1, 0x58, 0x73, 0x3e, 0x5c, - 0xa3, 0x5f, 0xd0, 0x6c, 0x55, 0xce, 0xa7, 0x59, 0xf4, 0x8b, 0x19, 0x95, 0x19, 0xf1, 0xf1, 0x16, - 0xfd, 0x52, 0x45, 0x8d, 0x71, 0x47, 0x7c, 0x0b, 0x45, 0xbf, 0xac, 0xa8, 0x7b, 0xce, 0x67, 0x49, - 0xf4, 0x2b, 0x15, 0xd5, 0x3b, 0x64, 0x3f, 0xc9, 0xa1, 0x5f, 0xcd, 0xd8, 0x03, 0xae, 0x7a, 0x2b, - 0x7e, 0x1b, 0xa5, 0x9b, 0xbb, 0x98, 0x45, 0x67, 0x6b, 0x8b, 0x7e, 0x2d, 0x23, 0x77, 0xb9, 0x70, - 0x09, 0xf9, 0x5f, 0xcf, 0x1c, 0x74, 0xc4, 0xf7, 0x37, 0xf4, 0x1b, 0x15, 0xb5, 0xf8, 0x34, 0xc6, - 0x97, 0x3a, 0xf4, 0x9b, 0x59, 0x26, 0xe6, 0x7f, 0x1f, 0x42, 0xbf, 0xa5, 0x69, 0x7b, 0xf1, 0x87, - 0x14, 0xf4, 0xdb, 0x8a, 0xaa, 0x8c, 0xf8, 0x5e, 0x8a, 0x7e, 0x47, 0x53, 0xa7, 0xdc, 0x6f, 0x07, - 0xe8, 0x77, 0x35, 0xcb, 0x9f, 0xff, 0x01, 0x01, 0xfd, 0x9e, 0xc6, 0xcf, 0x3d, 0xfb, 0xf4, 0xe9, - 0xe3, 0x15, 0xb5, 0x76, 0xb8, 0x77, 0xd3, 0x3d, 0x7d, 0x7e, 0x55, 0x0d, 0x46, 0x45, 0x37, 0xbb, - 0x28, 0x22, 0xbf, 0xa0, 0x6a, 0x1c, 0x27, 0x46, 0xaa, 0xc2, 0x71, 0x13, 0x39, 0x7d, 0x61, 0x55, - 0x15, 0x96, 0x6c, 0x77, 0x39, 0x7d, 0x51, 0x75, 0x98, 0xf1, 0xc8, 0x41, 0x91, 0xe5, 0xf3, 0xa0, - 0x39, 0xee, 0xbd, 0xa7, 0x3f, 0x52, 0x4d, 0x83, 0x8e, 0xa2, 0x86, 0x65, 0xfa, 0xe2, 0x6a, 0x5e, - 0x9c, 0x3f, 0xba, 0xb3, 0x99, 0xbe, 0xa4, 0x9a, 0x9a, 0xd7, 0xe2, 0xae, 0x58, 0xfa, 0xd2, 0xaa, - 0x2e, 0xb3, 0x7b, 0xb4, 0x6d, 0xd2, 0x1f, 0x55, 0xce, 0x9f, 0xd7, 0x4f, 0x49, 0x7f, 0x2c, 0xf7, - 0x54, 0xd9, 0x86, 0x4b, 0xfa, 0xe3, 0xd5, 0x54, 0x79, 0x47, 0x76, 0xe3, 0xd1, 0x9f, 0xa8, 0xa6, - 0x49, 0xf4, 0x9e, 0x3d, 0x7b, 0xf4, 0x27, 0xab, 0xa9, 0x2d, 0xda, 0xbb, 0xed, 0x8a, 0xbe, 0xac, - 0x9a, 0xda, 0xa2, 0xdc, 0x36, 0x23, 0xfa, 0x72, 0xe5, 0x36, 0x0b, 0x1b, 0x91, 0xe8, 0x2b, 0xaa, - 0xa9, 0x5f, 0xcd, 0xe7, 0x39, 0x7d, 0x65, 0x2e, 0x88, 0x5a, 0xf9, 0xa4, 0xaf, 0xca, 0xbd, 0xb9, - 0xbc, 0x8e, 0x4f, 0xfa, 0xea, 0xaa, 0xfa, 0xce, 0xa1, 0x3d, 0x1f, 0xd1, 0x9f, 0xaa, 0xa6, 0x16, - 0xab, 0xe0, 0xbd, 0x88, 0xfe, 0xb4, 0x02, 0x57, 0xf0, 0xac, 0x43, 0x7f, 0x46, 0x91, 0x92, 0x31, - 0x9e, 0x7f, 0xe8, 0xcf, 0x56, 0xcf, 0xbc, 0x66, 0x92, 0x1c, 0xd2, 0x1b, 0xbd, 0x8c, 0x63, 0x24, - 0xa7, 0xf9, 0x8b, 0x3e, 0x01, 0x8e, 0x71, 0x6c, 0x78, 0x7c, 0x91, 0x79, 0x0e, 0x6f, 0x53, 0xe1, - 0x5d, 0x8f, 0xfa, 0x9c, 0xf0, 0x2b, 0xa2, 0x6b, 0x6f, 0x52, 0xf4, 0x4c, 0xea, 0x00, 0xeb, 0x4e, - 0x97, 0xf9, 0x7d, 0x6c, 0x64, 0xcc, 0x99, 0x4c, 0xbb, 0xa0, 0x73, 0x26, 0x2f, 0xf9, 0x17, 0xad, - 0xa8, 0xbd, 0x4d, 0xa7, 0x45, 0xff, 0x93, 0x3e, 0xb9, 0xe1, 0x61, 0x45, 0xd2, 0x13, 0x1b, 0xef, - 0xcf, 0xa3, 0x0c, 0x92, 0x8e, 0x15, 0xbf, 0x03, 0x51, 0xd6, 0x65, 0x8f, 0x96, 0xd4, 0x63, 0x89, - 0xa6, 0x98, 0xb8, 0xbf, 0x9b, 0x96, 0xcf, 0x7c, 0x79, 0x92, 0x5c, 0xdf, 0xd4, 0x82, 0x99, 0xe4, - 0x05, 0x21, 0x0e, 0x9a, 0x44, 0x83, 0x55, 0x31, 0x8c, 0xd6, 0xe8, 0xf3, 0x14, 0x72, 0x6e, 0x4f, - 0xf8, 0xb8, 0x85, 0xc7, 0x6b, 0x4b, 0x8d, 0x06, 0x16, 0x3f, 0x40, 0xee, 0x1b, 0x7b, 0x1d, 0x6a, - 0x30, 0x9c, 0x72, 0xd9, 0x4b, 0x60, 0xe1, 0x0a, 0x9e, 0x41, 0x9e, 0x36, 0x2e, 0x02, 0x88, 0xbd, - 0x5c, 0x1b, 0xbf, 0x96, 0x71, 0x3c, 0xe9, 0x7e, 0x64, 0x77, 0xd7, 0x78, 0xcb, 0x2f, 0xf9, 0xb1, - 0x4f, 0xde, 0x07, 0x51, 0xe1, 0xd9, 0x3d, 0x97, 0xc5, 0xd2, 0x7e, 0xa1, 0xef, 0xba, 0x74, 0xfa, - 0xcc, 0x27, 0x26, 0xc9, 0xb5, 0x23, 0xb8, 0x2e, 0x42, 0x49, 0xd1, 0xee, 0x5e, 0x04, 0xa1, 0x71, - 0xfc, 0xe9, 0xe4, 0x9e, 0x3d, 0xa0, 0x15, 0xbe, 0x0d, 0xb1, 0x6d, 0xc2, 0xb8, 0x97, 0x3c, 0x65, - 0xbc, 0xd5, 0xc3, 0x4c, 0x03, 0x96, 0x9f, 0x27, 0x77, 0x8c, 0xb7, 0x36, 0xe5, 0xd8, 0x14, 0x04, - 0xa5, 0xf5, 0x71, 0x17, 0x2d, 0xb2, 0x08, 0xfe, 0x04, 0x2e, 0x17, 0x5c, 0xce, 0xd0, 0x1a, 0xb6, - 0xeb, 0x7b, 0x22, 0xe3, 0x00, 0x4e, 0xbf, 0x76, 0x82, 0x9c, 0x1c, 0xf9, 0x01, 0x9b, 0xf8, 0x0a, - 0x2a, 0xf3, 0x09, 0x5b, 0xa2, 0xed, 0xfa, 0xc4, 0x82, 0x65, 0xc7, 0xd1, 0xc7, 0x24, 0x04, 0x72, - 0x73, 0x19, 0x00, 0xd4, 0x3a, 0xc7, 0xdb, 0xe1, 0x9d, 0x82, 0xb7, 0x71, 0x5f, 0xa1, 0xcf, 0x6f, - 0x80, 0xeb, 0xed, 0xf5, 0xfc, 0x00, 0xdc, 0x97, 0x9c, 0x58, 0x1f, 0xf4, 0x40, 0x82, 0xce, 0xfc, - 0xe3, 0x01, 0x72, 0x4d, 0xc1, 0xf7, 0x30, 0xa2, 0x17, 0x79, 0x9c, 0x0f, 0x66, 0x40, 0x14, 0xf6, - 0x84, 0x5d, 0x64, 0x6d, 0xfc, 0x88, 0x10, 0x6d, 0x1a, 0x57, 0xd4, 0x22, 0xd8, 0x87, 0xe7, 0x1b, - 0xa6, 0x48, 0x5d, 0xe3, 0x0a, 0x13, 0x37, 0x75, 0xfc, 0xd2, 0xc7, 0x5c, 0xb7, 0xce, 0xbf, 0x3c, - 0x05, 0x8e, 0xdc, 0x43, 0xee, 0x2a, 0x5e, 0x24, 0x20, 0xe3, 0xa6, 0x69, 0x53, 0x96, 0xb6, 0xe0, - 0xea, 0xf7, 0x3e, 0x92, 0x13, 0xe2, 0xbb, 0x85, 0x0d, 0xe6, 0xf2, 0x2c, 0xf7, 0x0e, 0x05, 0xb0, - 0x89, 0x69, 0x5c, 0xf6, 0xc0, 0x76, 0xf2, 0xce, 0xed, 0x22, 0x70, 0x59, 0xb6, 0x28, 0x89, 0x16, - 0xf3, 0x42, 0xf2, 0x7d, 0xbf, 0xe5, 0xfb, 0x1e, 0xc5, 0x4a, 0xe4, 0xed, 0x63, 0x81, 0xae, 0x32, - 0xb0, 0x0e, 0xd1, 0x80, 0x1e, 0x18, 0x83, 0x37, 0xfc, 0x33, 0xab, 0xcc, 0x55, 0x10, 0xa1, 0x16, - 0x63, 0xaf, 0x94, 0x97, 0x31, 0x63, 0x34, 0xc8, 0x03, 0xc5, 0xcb, 0x2e, 0x04, 0x8c, 0x8b, 0x15, - 0xef, 0x92, 0x48, 0x36, 0x54, 0x1f, 0x2b, 0x0f, 0x0a, 0xbb, 0x51, 0x84, 0xa4, 0x05, 0x01, 0x2f, - 0x76, 0xc5, 0x0e, 0xa3, 0xa1, 0xb3, 0x7b, 0xd3, 0x8d, 0xce, 0xd5, 0x69, 0x33, 0xfc, 0xbc, 0xe7, - 0x0a, 0x28, 0x36, 0xde, 0x2f, 0x3d, 0x34, 0x06, 0x6b, 0x85, 0x10, 0x2d, 0xc8, 0x8e, 0xfb, 0xc3, - 0x7b, 0xcb, 0xea, 0x25, 0x30, 0xa2, 0xbc, 0xd7, 0x02, 0xfc, 0x7c, 0xb3, 0x8b, 0xc6, 0x86, 0xee, - 0xbd, 0x0d, 0x2e, 0x6a, 0x61, 0x07, 0xda, 0x52, 0xdf, 0x0a, 0x6c, 0x7a, 0xc4, 0xb8, 0x8b, 0x3c, - 0x79, 0x8f, 0xf3, 0x24, 0xd0, 0x8b, 0xf2, 0x1f, 0x83, 0xa0, 0x86, 0x70, 0x1d, 0x85, 0xc7, 0xd9, - 0x66, 0x03, 0xd1, 0x86, 0xcc, 0xc7, 0x69, 0xc5, 0x78, 0x2a, 0x39, 0x5f, 0xbc, 0x04, 0xf2, 0x0c, - 0xfc, 0x27, 0x98, 0x56, 0xad, 0x30, 0xbc, 0xea, 0x07, 0xb6, 0xc9, 0x9f, 0x27, 0x68, 0x55, 0x18, - 0xdd, 0xa2, 0x85, 0x1b, 0x21, 0x56, 0x92, 0x2f, 0xb1, 0xab, 0x60, 0x22, 0x90, 0xf5, 0xf4, 0xe8, - 0x38, 0xb7, 0xc4, 0xef, 0x95, 0x47, 0x32, 0xe0, 0x1e, 0xfc, 0x1d, 0x87, 0xd1, 0x63, 0x0b, 0xd3, - 0xcf, 0x9c, 0x78, 0xfe, 0xc4, 0x13, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x79, 0x06, 0x37, - 0xa6, 0x4b, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/gcsdk.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/gcsdk.pb.go deleted file mode 100644 index 9e7b5da3..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/gcsdk.pb.go +++ /dev/null @@ -1,1825 +0,0 @@ -// Code generated by protoc-gen-go. -// source: gcsdk_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type ESourceEngine int32 - -const ( - ESourceEngine_k_ESE_Source1 ESourceEngine = 0 - ESourceEngine_k_ESE_Source2 ESourceEngine = 1 -) - -var ESourceEngine_name = map[int32]string{ - 0: "k_ESE_Source1", - 1: "k_ESE_Source2", -} -var ESourceEngine_value = map[string]int32{ - "k_ESE_Source1": 0, - "k_ESE_Source2": 1, -} - -func (x ESourceEngine) Enum() *ESourceEngine { - p := new(ESourceEngine) - *p = x - return p -} -func (x ESourceEngine) String() string { - return proto.EnumName(ESourceEngine_name, int32(x)) -} -func (x *ESourceEngine) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ESourceEngine_value, data, "ESourceEngine") - if err != nil { - return err - } - *x = ESourceEngine(value) - return nil -} -func (ESourceEngine) EnumDescriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{0} } - -type PartnerAccountType int32 - -const ( - PartnerAccountType_PARTNER_NONE PartnerAccountType = 0 - PartnerAccountType_PARTNER_PERFECT_WORLD PartnerAccountType = 1 - PartnerAccountType_PARTNER_NEXON PartnerAccountType = 2 - PartnerAccountType_PARTNER_INVALID PartnerAccountType = 3 -) - -var PartnerAccountType_name = map[int32]string{ - 0: "PARTNER_NONE", - 1: "PARTNER_PERFECT_WORLD", - 2: "PARTNER_NEXON", - 3: "PARTNER_INVALID", -} -var PartnerAccountType_value = map[string]int32{ - "PARTNER_NONE": 0, - "PARTNER_PERFECT_WORLD": 1, - "PARTNER_NEXON": 2, - "PARTNER_INVALID": 3, -} - -func (x PartnerAccountType) Enum() *PartnerAccountType { - p := new(PartnerAccountType) - *p = x - return p -} -func (x PartnerAccountType) String() string { - return proto.EnumName(PartnerAccountType_name, int32(x)) -} -func (x *PartnerAccountType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PartnerAccountType_value, data, "PartnerAccountType") - if err != nil { - return err - } - *x = PartnerAccountType(value) - return nil -} -func (PartnerAccountType) EnumDescriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{1} } - -type GCConnectionStatus int32 - -const ( - GCConnectionStatus_GCConnectionStatus_HAVE_SESSION GCConnectionStatus = 0 - GCConnectionStatus_GCConnectionStatus_GC_GOING_DOWN GCConnectionStatus = 1 - GCConnectionStatus_GCConnectionStatus_NO_SESSION GCConnectionStatus = 2 - GCConnectionStatus_GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE GCConnectionStatus = 3 - GCConnectionStatus_GCConnectionStatus_NO_STEAM GCConnectionStatus = 4 - GCConnectionStatus_GCConnectionStatus_SUSPENDED GCConnectionStatus = 5 - GCConnectionStatus_GCConnectionStatus_STEAM_GOING_DOWN GCConnectionStatus = 6 -) - -var GCConnectionStatus_name = map[int32]string{ - 0: "GCConnectionStatus_HAVE_SESSION", - 1: "GCConnectionStatus_GC_GOING_DOWN", - 2: "GCConnectionStatus_NO_SESSION", - 3: "GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE", - 4: "GCConnectionStatus_NO_STEAM", - 5: "GCConnectionStatus_SUSPENDED", - 6: "GCConnectionStatus_STEAM_GOING_DOWN", -} -var GCConnectionStatus_value = map[string]int32{ - "GCConnectionStatus_HAVE_SESSION": 0, - "GCConnectionStatus_GC_GOING_DOWN": 1, - "GCConnectionStatus_NO_SESSION": 2, - "GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE": 3, - "GCConnectionStatus_NO_STEAM": 4, - "GCConnectionStatus_SUSPENDED": 5, - "GCConnectionStatus_STEAM_GOING_DOWN": 6, -} - -func (x GCConnectionStatus) Enum() *GCConnectionStatus { - p := new(GCConnectionStatus) - *p = x - return p -} -func (x GCConnectionStatus) String() string { - return proto.EnumName(GCConnectionStatus_name, int32(x)) -} -func (x *GCConnectionStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(GCConnectionStatus_value, data, "GCConnectionStatus") - if err != nil { - return err - } - *x = GCConnectionStatus(value) - return nil -} -func (GCConnectionStatus) EnumDescriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{2} } - -type CMsgSHA1Digest struct { - Block1 *uint64 `protobuf:"fixed64,1,req,name=block1" json:"block1,omitempty"` - Block2 *uint64 `protobuf:"fixed64,2,req,name=block2" json:"block2,omitempty"` - Block3 *uint32 `protobuf:"fixed32,3,req,name=block3" json:"block3,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSHA1Digest) Reset() { *m = CMsgSHA1Digest{} } -func (m *CMsgSHA1Digest) String() string { return proto.CompactTextString(m) } -func (*CMsgSHA1Digest) ProtoMessage() {} -func (*CMsgSHA1Digest) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{0} } - -func (m *CMsgSHA1Digest) GetBlock1() uint64 { - if m != nil && m.Block1 != nil { - return *m.Block1 - } - return 0 -} - -func (m *CMsgSHA1Digest) GetBlock2() uint64 { - if m != nil && m.Block2 != nil { - return *m.Block2 - } - return 0 -} - -func (m *CMsgSHA1Digest) GetBlock3() uint32 { - if m != nil && m.Block3 != nil { - return *m.Block3 - } - return 0 -} - -type CMsgSOIDOwner struct { - Type *uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - Id *uint64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOIDOwner) Reset() { *m = CMsgSOIDOwner{} } -func (m *CMsgSOIDOwner) String() string { return proto.CompactTextString(m) } -func (*CMsgSOIDOwner) ProtoMessage() {} -func (*CMsgSOIDOwner) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{1} } - -func (m *CMsgSOIDOwner) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgSOIDOwner) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -type CMsgSOSingleObject struct { - TypeId *int32 `protobuf:"varint,2,opt,name=type_id" json:"type_id,omitempty"` - ObjectData []byte `protobuf:"bytes,3,opt,name=object_data" json:"object_data,omitempty"` - Version *uint64 `protobuf:"fixed64,4,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,5,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,6,opt,name=service_id" json:"service_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOSingleObject) Reset() { *m = CMsgSOSingleObject{} } -func (m *CMsgSOSingleObject) String() string { return proto.CompactTextString(m) } -func (*CMsgSOSingleObject) ProtoMessage() {} -func (*CMsgSOSingleObject) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{2} } - -func (m *CMsgSOSingleObject) GetTypeId() int32 { - if m != nil && m.TypeId != nil { - return *m.TypeId - } - return 0 -} - -func (m *CMsgSOSingleObject) GetObjectData() []byte { - if m != nil { - return m.ObjectData - } - return nil -} - -func (m *CMsgSOSingleObject) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOSingleObject) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOSingleObject) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -type CMsgSOMultipleObjects struct { - ObjectsModified []*CMsgSOMultipleObjects_SingleObject `protobuf:"bytes,2,rep,name=objects_modified" json:"objects_modified,omitempty"` - Version *uint64 `protobuf:"fixed64,3,opt,name=version" json:"version,omitempty"` - ObjectsAdded []*CMsgSOMultipleObjects_SingleObject `protobuf:"bytes,4,rep,name=objects_added" json:"objects_added,omitempty"` - ObjectsRemoved []*CMsgSOMultipleObjects_SingleObject `protobuf:"bytes,5,rep,name=objects_removed" json:"objects_removed,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,6,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,7,opt,name=service_id" json:"service_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOMultipleObjects) Reset() { *m = CMsgSOMultipleObjects{} } -func (m *CMsgSOMultipleObjects) String() string { return proto.CompactTextString(m) } -func (*CMsgSOMultipleObjects) ProtoMessage() {} -func (*CMsgSOMultipleObjects) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{3} } - -func (m *CMsgSOMultipleObjects) GetObjectsModified() []*CMsgSOMultipleObjects_SingleObject { - if m != nil { - return m.ObjectsModified - } - return nil -} - -func (m *CMsgSOMultipleObjects) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOMultipleObjects) GetObjectsAdded() []*CMsgSOMultipleObjects_SingleObject { - if m != nil { - return m.ObjectsAdded - } - return nil -} - -func (m *CMsgSOMultipleObjects) GetObjectsRemoved() []*CMsgSOMultipleObjects_SingleObject { - if m != nil { - return m.ObjectsRemoved - } - return nil -} - -func (m *CMsgSOMultipleObjects) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOMultipleObjects) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -type CMsgSOMultipleObjects_SingleObject struct { - TypeId *int32 `protobuf:"varint,1,opt,name=type_id" json:"type_id,omitempty"` - ObjectData []byte `protobuf:"bytes,2,opt,name=object_data" json:"object_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOMultipleObjects_SingleObject) Reset() { *m = CMsgSOMultipleObjects_SingleObject{} } -func (m *CMsgSOMultipleObjects_SingleObject) String() string { return proto.CompactTextString(m) } -func (*CMsgSOMultipleObjects_SingleObject) ProtoMessage() {} -func (*CMsgSOMultipleObjects_SingleObject) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{3, 0} -} - -func (m *CMsgSOMultipleObjects_SingleObject) GetTypeId() int32 { - if m != nil && m.TypeId != nil { - return *m.TypeId - } - return 0 -} - -func (m *CMsgSOMultipleObjects_SingleObject) GetObjectData() []byte { - if m != nil { - return m.ObjectData - } - return nil -} - -type CMsgSOCacheSubscribed struct { - Objects []*CMsgSOCacheSubscribed_SubscribedType `protobuf:"bytes,2,rep,name=objects" json:"objects,omitempty"` - Version *uint64 `protobuf:"fixed64,3,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,4,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,5,opt,name=service_id" json:"service_id,omitempty"` - ServiceList []uint32 `protobuf:"varint,6,rep,name=service_list" json:"service_list,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,7,opt,name=sync_version" json:"sync_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscribed) Reset() { *m = CMsgSOCacheSubscribed{} } -func (m *CMsgSOCacheSubscribed) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscribed) ProtoMessage() {} -func (*CMsgSOCacheSubscribed) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{4} } - -func (m *CMsgSOCacheSubscribed) GetObjects() []*CMsgSOCacheSubscribed_SubscribedType { - if m != nil { - return m.Objects - } - return nil -} - -func (m *CMsgSOCacheSubscribed) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheSubscribed) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOCacheSubscribed) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheSubscribed) GetServiceList() []uint32 { - if m != nil { - return m.ServiceList - } - return nil -} - -func (m *CMsgSOCacheSubscribed) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -type CMsgSOCacheSubscribed_SubscribedType struct { - TypeId *int32 `protobuf:"varint,1,opt,name=type_id" json:"type_id,omitempty"` - ObjectData [][]byte `protobuf:"bytes,2,rep,name=object_data" json:"object_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscribed_SubscribedType) Reset() { *m = CMsgSOCacheSubscribed_SubscribedType{} } -func (m *CMsgSOCacheSubscribed_SubscribedType) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscribed_SubscribedType) ProtoMessage() {} -func (*CMsgSOCacheSubscribed_SubscribedType) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{4, 0} -} - -func (m *CMsgSOCacheSubscribed_SubscribedType) GetTypeId() int32 { - if m != nil && m.TypeId != nil { - return *m.TypeId - } - return 0 -} - -func (m *CMsgSOCacheSubscribed_SubscribedType) GetObjectData() [][]byte { - if m != nil { - return m.ObjectData - } - return nil -} - -type CMsgSOCacheSubscribedUpToDate struct { - Version *uint64 `protobuf:"fixed64,1,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,2,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,3,opt,name=service_id" json:"service_id,omitempty"` - ServiceList []uint32 `protobuf:"varint,4,rep,name=service_list" json:"service_list,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,5,opt,name=sync_version" json:"sync_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscribedUpToDate) Reset() { *m = CMsgSOCacheSubscribedUpToDate{} } -func (m *CMsgSOCacheSubscribedUpToDate) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscribedUpToDate) ProtoMessage() {} -func (*CMsgSOCacheSubscribedUpToDate) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{5} } - -func (m *CMsgSOCacheSubscribedUpToDate) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetServiceList() []uint32 { - if m != nil { - return m.ServiceList - } - return nil -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -type CMsgSOCacheUnsubscribed struct { - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,2,opt,name=owner_soid" json:"owner_soid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheUnsubscribed) Reset() { *m = CMsgSOCacheUnsubscribed{} } -func (m *CMsgSOCacheUnsubscribed) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheUnsubscribed) ProtoMessage() {} -func (*CMsgSOCacheUnsubscribed) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{6} } - -func (m *CMsgSOCacheUnsubscribed) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -type CMsgSOCacheSubscriptionCheck struct { - Version *uint64 `protobuf:"fixed64,2,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,3,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,4,opt,name=service_id" json:"service_id,omitempty"` - ServiceList []uint32 `protobuf:"varint,5,rep,name=service_list" json:"service_list,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,6,opt,name=sync_version" json:"sync_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscriptionCheck) Reset() { *m = CMsgSOCacheSubscriptionCheck{} } -func (m *CMsgSOCacheSubscriptionCheck) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscriptionCheck) ProtoMessage() {} -func (*CMsgSOCacheSubscriptionCheck) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{7} } - -func (m *CMsgSOCacheSubscriptionCheck) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheSubscriptionCheck) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOCacheSubscriptionCheck) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheSubscriptionCheck) GetServiceList() []uint32 { - if m != nil { - return m.ServiceList - } - return nil -} - -func (m *CMsgSOCacheSubscriptionCheck) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -type CMsgSOCacheSubscriptionRefresh struct { - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,2,opt,name=owner_soid" json:"owner_soid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscriptionRefresh) Reset() { *m = CMsgSOCacheSubscriptionRefresh{} } -func (m *CMsgSOCacheSubscriptionRefresh) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscriptionRefresh) ProtoMessage() {} -func (*CMsgSOCacheSubscriptionRefresh) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{8} } - -func (m *CMsgSOCacheSubscriptionRefresh) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -type CMsgSOCacheVersion struct { - Version *uint64 `protobuf:"fixed64,1,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheVersion) Reset() { *m = CMsgSOCacheVersion{} } -func (m *CMsgSOCacheVersion) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheVersion) ProtoMessage() {} -func (*CMsgSOCacheVersion) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{9} } - -func (m *CMsgSOCacheVersion) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgGCMultiplexMessage struct { - Msgtype *uint32 `protobuf:"varint,1,opt,name=msgtype" json:"msgtype,omitempty"` - Payload []byte `protobuf:"bytes,2,opt,name=payload" json:"payload,omitempty"` - Steamids []uint64 `protobuf:"fixed64,3,rep,name=steamids" json:"steamids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCMultiplexMessage) Reset() { *m = CMsgGCMultiplexMessage{} } -func (m *CMsgGCMultiplexMessage) String() string { return proto.CompactTextString(m) } -func (*CMsgGCMultiplexMessage) ProtoMessage() {} -func (*CMsgGCMultiplexMessage) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{10} } - -func (m *CMsgGCMultiplexMessage) GetMsgtype() uint32 { - if m != nil && m.Msgtype != nil { - return *m.Msgtype - } - return 0 -} - -func (m *CMsgGCMultiplexMessage) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *CMsgGCMultiplexMessage) GetSteamids() []uint64 { - if m != nil { - return m.Steamids - } - return nil -} - -type CGCToGCMsgMasterAck struct { - DirIndex *uint32 `protobuf:"varint,1,opt,name=dir_index" json:"dir_index,omitempty"` - MachineName *string `protobuf:"bytes,3,opt,name=machine_name" json:"machine_name,omitempty"` - ProcessName *string `protobuf:"bytes,4,opt,name=process_name" json:"process_name,omitempty"` - Directory []*CGCToGCMsgMasterAck_Process `protobuf:"bytes,6,rep,name=directory" json:"directory,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterAck) Reset() { *m = CGCToGCMsgMasterAck{} } -func (m *CGCToGCMsgMasterAck) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterAck) ProtoMessage() {} -func (*CGCToGCMsgMasterAck) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{11} } - -func (m *CGCToGCMsgMasterAck) GetDirIndex() uint32 { - if m != nil && m.DirIndex != nil { - return *m.DirIndex - } - return 0 -} - -func (m *CGCToGCMsgMasterAck) GetMachineName() string { - if m != nil && m.MachineName != nil { - return *m.MachineName - } - return "" -} - -func (m *CGCToGCMsgMasterAck) GetProcessName() string { - if m != nil && m.ProcessName != nil { - return *m.ProcessName - } - return "" -} - -func (m *CGCToGCMsgMasterAck) GetDirectory() []*CGCToGCMsgMasterAck_Process { - if m != nil { - return m.Directory - } - return nil -} - -type CGCToGCMsgMasterAck_Process struct { - DirIndex *uint32 `protobuf:"varint,1,opt,name=dir_index" json:"dir_index,omitempty"` - TypeInstances []uint32 `protobuf:"varint,2,rep,name=type_instances" json:"type_instances,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterAck_Process) Reset() { *m = CGCToGCMsgMasterAck_Process{} } -func (m *CGCToGCMsgMasterAck_Process) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterAck_Process) ProtoMessage() {} -func (*CGCToGCMsgMasterAck_Process) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{11, 0} } - -func (m *CGCToGCMsgMasterAck_Process) GetDirIndex() uint32 { - if m != nil && m.DirIndex != nil { - return *m.DirIndex - } - return 0 -} - -func (m *CGCToGCMsgMasterAck_Process) GetTypeInstances() []uint32 { - if m != nil { - return m.TypeInstances - } - return nil -} - -type CGCToGCMsgMasterAck_Response struct { - Eresult *int32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterAck_Response) Reset() { *m = CGCToGCMsgMasterAck_Response{} } -func (m *CGCToGCMsgMasterAck_Response) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterAck_Response) ProtoMessage() {} -func (*CGCToGCMsgMasterAck_Response) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{12} } - -const Default_CGCToGCMsgMasterAck_Response_Eresult int32 = 2 - -func (m *CGCToGCMsgMasterAck_Response) GetEresult() int32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CGCToGCMsgMasterAck_Response_Eresult -} - -type CGCToGCMsgMasterStartupComplete struct { - GcInfo []*CGCToGCMsgMasterStartupComplete_GCInfo `protobuf:"bytes,1,rep,name=gc_info" json:"gc_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterStartupComplete) Reset() { *m = CGCToGCMsgMasterStartupComplete{} } -func (m *CGCToGCMsgMasterStartupComplete) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterStartupComplete) ProtoMessage() {} -func (*CGCToGCMsgMasterStartupComplete) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{13} -} - -func (m *CGCToGCMsgMasterStartupComplete) GetGcInfo() []*CGCToGCMsgMasterStartupComplete_GCInfo { - if m != nil { - return m.GcInfo - } - return nil -} - -type CGCToGCMsgMasterStartupComplete_GCInfo struct { - DirIndex *uint32 `protobuf:"varint,1,opt,name=dir_index" json:"dir_index,omitempty"` - MachineName *string `protobuf:"bytes,2,opt,name=machine_name" json:"machine_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) Reset() { - *m = CGCToGCMsgMasterStartupComplete_GCInfo{} -} -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterStartupComplete_GCInfo) ProtoMessage() {} -func (*CGCToGCMsgMasterStartupComplete_GCInfo) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{13, 0} -} - -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) GetDirIndex() uint32 { - if m != nil && m.DirIndex != nil { - return *m.DirIndex - } - return 0 -} - -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) GetMachineName() string { - if m != nil && m.MachineName != nil { - return *m.MachineName - } - return "" -} - -type CGCToGCMsgRouted struct { - MsgType *uint32 `protobuf:"varint,1,opt,name=msg_type" json:"msg_type,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - NetMessage []byte `protobuf:"bytes,3,opt,name=net_message" json:"net_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgRouted) Reset() { *m = CGCToGCMsgRouted{} } -func (m *CGCToGCMsgRouted) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgRouted) ProtoMessage() {} -func (*CGCToGCMsgRouted) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{14} } - -func (m *CGCToGCMsgRouted) GetMsgType() uint32 { - if m != nil && m.MsgType != nil { - return *m.MsgType - } - return 0 -} - -func (m *CGCToGCMsgRouted) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CGCToGCMsgRouted) GetNetMessage() []byte { - if m != nil { - return m.NetMessage - } - return nil -} - -type CGCToGCMsgRoutedReply struct { - MsgType *uint32 `protobuf:"varint,1,opt,name=msg_type" json:"msg_type,omitempty"` - NetMessage []byte `protobuf:"bytes,2,opt,name=net_message" json:"net_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgRoutedReply) Reset() { *m = CGCToGCMsgRoutedReply{} } -func (m *CGCToGCMsgRoutedReply) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgRoutedReply) ProtoMessage() {} -func (*CGCToGCMsgRoutedReply) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{15} } - -func (m *CGCToGCMsgRoutedReply) GetMsgType() uint32 { - if m != nil && m.MsgType != nil { - return *m.MsgType - } - return 0 -} - -func (m *CGCToGCMsgRoutedReply) GetNetMessage() []byte { - if m != nil { - return m.NetMessage - } - return nil -} - -type CMsgGCUpdateSubGCSessionInfo struct { - Updates []*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate `protobuf:"bytes,1,rep,name=updates" json:"updates,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCUpdateSubGCSessionInfo) Reset() { *m = CMsgGCUpdateSubGCSessionInfo{} } -func (m *CMsgGCUpdateSubGCSessionInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCUpdateSubGCSessionInfo) ProtoMessage() {} -func (*CMsgGCUpdateSubGCSessionInfo) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{16} } - -func (m *CMsgGCUpdateSubGCSessionInfo) GetUpdates() []*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate { - if m != nil { - return m.Updates - } - return nil -} - -type CMsgGCUpdateSubGCSessionInfo_CMsgUpdate struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - Ip *uint32 `protobuf:"fixed32,2,opt,name=ip" json:"ip,omitempty"` - Trusted *bool `protobuf:"varint,3,opt,name=trusted" json:"trusted,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) Reset() { - *m = CMsgGCUpdateSubGCSessionInfo_CMsgUpdate{} -} -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) String() string { return proto.CompactTextString(m) } -func (*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) ProtoMessage() {} -func (*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{16, 0} -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) GetIp() uint32 { - if m != nil && m.Ip != nil { - return *m.Ip - } - return 0 -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) GetTrusted() bool { - if m != nil && m.Trusted != nil { - return *m.Trusted - } - return false -} - -type CMsgGCRequestSubGCSessionInfo struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestSubGCSessionInfo) Reset() { *m = CMsgGCRequestSubGCSessionInfo{} } -func (m *CMsgGCRequestSubGCSessionInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestSubGCSessionInfo) ProtoMessage() {} -func (*CMsgGCRequestSubGCSessionInfo) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{17} } - -func (m *CMsgGCRequestSubGCSessionInfo) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CMsgGCRequestSubGCSessionInfoResponse struct { - Ip *uint32 `protobuf:"fixed32,1,opt,name=ip" json:"ip,omitempty"` - Trusted *bool `protobuf:"varint,2,opt,name=trusted" json:"trusted,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestSubGCSessionInfoResponse) Reset() { *m = CMsgGCRequestSubGCSessionInfoResponse{} } -func (m *CMsgGCRequestSubGCSessionInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestSubGCSessionInfoResponse) ProtoMessage() {} -func (*CMsgGCRequestSubGCSessionInfoResponse) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{18} -} - -func (m *CMsgGCRequestSubGCSessionInfoResponse) GetIp() uint32 { - if m != nil && m.Ip != nil { - return *m.Ip - } - return 0 -} - -func (m *CMsgGCRequestSubGCSessionInfoResponse) GetTrusted() bool { - if m != nil && m.Trusted != nil { - return *m.Trusted - } - return false -} - -type CMsgSOCacheHaveVersion struct { - Soid *CMsgSOIDOwner `protobuf:"bytes,1,opt,name=soid" json:"soid,omitempty"` - Version *uint64 `protobuf:"fixed64,2,opt,name=version" json:"version,omitempty"` - ServiceId *uint32 `protobuf:"varint,3,opt,name=service_id" json:"service_id,omitempty"` - CachedFileVersion *uint32 `protobuf:"varint,4,opt,name=cached_file_version" json:"cached_file_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheHaveVersion) Reset() { *m = CMsgSOCacheHaveVersion{} } -func (m *CMsgSOCacheHaveVersion) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheHaveVersion) ProtoMessage() {} -func (*CMsgSOCacheHaveVersion) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{19} } - -func (m *CMsgSOCacheHaveVersion) GetSoid() *CMsgSOIDOwner { - if m != nil { - return m.Soid - } - return nil -} - -func (m *CMsgSOCacheHaveVersion) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheHaveVersion) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheHaveVersion) GetCachedFileVersion() uint32 { - if m != nil && m.CachedFileVersion != nil { - return *m.CachedFileVersion - } - return 0 -} - -type CMsgClientHello struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - SocacheHaveVersions []*CMsgSOCacheHaveVersion `protobuf:"bytes,2,rep,name=socache_have_versions" json:"socache_have_versions,omitempty"` - ClientSessionNeed *uint32 `protobuf:"varint,3,opt,name=client_session_need" json:"client_session_need,omitempty"` - ClientLauncher *PartnerAccountType `protobuf:"varint,4,opt,name=client_launcher,enum=PartnerAccountType,def=0" json:"client_launcher,omitempty"` - SecretKey *string `protobuf:"bytes,5,opt,name=secret_key" json:"secret_key,omitempty"` - ClientLanguage *uint32 `protobuf:"varint,6,opt,name=client_language" json:"client_language,omitempty"` - Engine *ESourceEngine `protobuf:"varint,7,opt,name=engine,enum=ESourceEngine,def=0" json:"engine,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientHello) Reset() { *m = CMsgClientHello{} } -func (m *CMsgClientHello) String() string { return proto.CompactTextString(m) } -func (*CMsgClientHello) ProtoMessage() {} -func (*CMsgClientHello) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{20} } - -const Default_CMsgClientHello_ClientLauncher PartnerAccountType = PartnerAccountType_PARTNER_NONE -const Default_CMsgClientHello_Engine ESourceEngine = ESourceEngine_k_ESE_Source1 - -func (m *CMsgClientHello) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgClientHello) GetSocacheHaveVersions() []*CMsgSOCacheHaveVersion { - if m != nil { - return m.SocacheHaveVersions - } - return nil -} - -func (m *CMsgClientHello) GetClientSessionNeed() uint32 { - if m != nil && m.ClientSessionNeed != nil { - return *m.ClientSessionNeed - } - return 0 -} - -func (m *CMsgClientHello) GetClientLauncher() PartnerAccountType { - if m != nil && m.ClientLauncher != nil { - return *m.ClientLauncher - } - return Default_CMsgClientHello_ClientLauncher -} - -func (m *CMsgClientHello) GetSecretKey() string { - if m != nil && m.SecretKey != nil { - return *m.SecretKey - } - return "" -} - -func (m *CMsgClientHello) GetClientLanguage() uint32 { - if m != nil && m.ClientLanguage != nil { - return *m.ClientLanguage - } - return 0 -} - -func (m *CMsgClientHello) GetEngine() ESourceEngine { - if m != nil && m.Engine != nil { - return *m.Engine - } - return Default_CMsgClientHello_Engine -} - -type CMsgClientWelcome struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - GameData []byte `protobuf:"bytes,2,opt,name=game_data" json:"game_data,omitempty"` - OutofdateSubscribedCaches []*CMsgSOCacheSubscribed `protobuf:"bytes,3,rep,name=outofdate_subscribed_caches" json:"outofdate_subscribed_caches,omitempty"` - UptodateSubscribedCaches []*CMsgSOCacheSubscriptionCheck `protobuf:"bytes,4,rep,name=uptodate_subscribed_caches" json:"uptodate_subscribed_caches,omitempty"` - Location *CMsgClientWelcome_Location `protobuf:"bytes,5,opt,name=location" json:"location,omitempty"` - SaveGameKey []byte `protobuf:"bytes,6,opt,name=save_game_key" json:"save_game_key,omitempty"` - ItemSchemaCrc *uint32 `protobuf:"fixed32,7,opt,name=item_schema_crc" json:"item_schema_crc,omitempty"` - ItemsGameUrl *string `protobuf:"bytes,8,opt,name=items_game_url" json:"items_game_url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientWelcome) Reset() { *m = CMsgClientWelcome{} } -func (m *CMsgClientWelcome) String() string { return proto.CompactTextString(m) } -func (*CMsgClientWelcome) ProtoMessage() {} -func (*CMsgClientWelcome) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{21} } - -func (m *CMsgClientWelcome) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgClientWelcome) GetGameData() []byte { - if m != nil { - return m.GameData - } - return nil -} - -func (m *CMsgClientWelcome) GetOutofdateSubscribedCaches() []*CMsgSOCacheSubscribed { - if m != nil { - return m.OutofdateSubscribedCaches - } - return nil -} - -func (m *CMsgClientWelcome) GetUptodateSubscribedCaches() []*CMsgSOCacheSubscriptionCheck { - if m != nil { - return m.UptodateSubscribedCaches - } - return nil -} - -func (m *CMsgClientWelcome) GetLocation() *CMsgClientWelcome_Location { - if m != nil { - return m.Location - } - return nil -} - -func (m *CMsgClientWelcome) GetSaveGameKey() []byte { - if m != nil { - return m.SaveGameKey - } - return nil -} - -func (m *CMsgClientWelcome) GetItemSchemaCrc() uint32 { - if m != nil && m.ItemSchemaCrc != nil { - return *m.ItemSchemaCrc - } - return 0 -} - -func (m *CMsgClientWelcome) GetItemsGameUrl() string { - if m != nil && m.ItemsGameUrl != nil { - return *m.ItemsGameUrl - } - return "" -} - -type CMsgClientWelcome_Location struct { - Latitude *float32 `protobuf:"fixed32,1,opt,name=latitude" json:"latitude,omitempty"` - Longitude *float32 `protobuf:"fixed32,2,opt,name=longitude" json:"longitude,omitempty"` - Country *string `protobuf:"bytes,3,opt,name=country" json:"country,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientWelcome_Location) Reset() { *m = CMsgClientWelcome_Location{} } -func (m *CMsgClientWelcome_Location) String() string { return proto.CompactTextString(m) } -func (*CMsgClientWelcome_Location) ProtoMessage() {} -func (*CMsgClientWelcome_Location) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{21, 0} } - -func (m *CMsgClientWelcome_Location) GetLatitude() float32 { - if m != nil && m.Latitude != nil { - return *m.Latitude - } - return 0 -} - -func (m *CMsgClientWelcome_Location) GetLongitude() float32 { - if m != nil && m.Longitude != nil { - return *m.Longitude - } - return 0 -} - -func (m *CMsgClientWelcome_Location) GetCountry() string { - if m != nil && m.Country != nil { - return *m.Country - } - return "" -} - -type CMsgConnectionStatus struct { - Status *GCConnectionStatus `protobuf:"varint,1,opt,name=status,enum=GCConnectionStatus,def=0" json:"status,omitempty"` - ClientSessionNeed *uint32 `protobuf:"varint,2,opt,name=client_session_need" json:"client_session_need,omitempty"` - QueuePosition *int32 `protobuf:"varint,3,opt,name=queue_position" json:"queue_position,omitempty"` - QueueSize *int32 `protobuf:"varint,4,opt,name=queue_size" json:"queue_size,omitempty"` - WaitSeconds *int32 `protobuf:"varint,5,opt,name=wait_seconds" json:"wait_seconds,omitempty"` - EstimatedWaitSecondsRemaining *int32 `protobuf:"varint,6,opt,name=estimated_wait_seconds_remaining" json:"estimated_wait_seconds_remaining,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgConnectionStatus) Reset() { *m = CMsgConnectionStatus{} } -func (m *CMsgConnectionStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgConnectionStatus) ProtoMessage() {} -func (*CMsgConnectionStatus) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{22} } - -const Default_CMsgConnectionStatus_Status GCConnectionStatus = GCConnectionStatus_GCConnectionStatus_HAVE_SESSION - -func (m *CMsgConnectionStatus) GetStatus() GCConnectionStatus { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_CMsgConnectionStatus_Status -} - -func (m *CMsgConnectionStatus) GetClientSessionNeed() uint32 { - if m != nil && m.ClientSessionNeed != nil { - return *m.ClientSessionNeed - } - return 0 -} - -func (m *CMsgConnectionStatus) GetQueuePosition() int32 { - if m != nil && m.QueuePosition != nil { - return *m.QueuePosition - } - return 0 -} - -func (m *CMsgConnectionStatus) GetQueueSize() int32 { - if m != nil && m.QueueSize != nil { - return *m.QueueSize - } - return 0 -} - -func (m *CMsgConnectionStatus) GetWaitSeconds() int32 { - if m != nil && m.WaitSeconds != nil { - return *m.WaitSeconds - } - return 0 -} - -func (m *CMsgConnectionStatus) GetEstimatedWaitSecondsRemaining() int32 { - if m != nil && m.EstimatedWaitSecondsRemaining != nil { - return *m.EstimatedWaitSecondsRemaining - } - return 0 -} - -type CMsgGCToGCSOCacheSubscribe struct { - Subscriber *uint64 `protobuf:"fixed64,1,opt,name=subscriber" json:"subscriber,omitempty"` - SubscribeTo *uint64 `protobuf:"fixed64,2,opt,name=subscribe_to" json:"subscribe_to,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,3,opt,name=sync_version" json:"sync_version,omitempty"` - HaveVersions []*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions `protobuf:"bytes,4,rep,name=have_versions" json:"have_versions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCSOCacheSubscribe) Reset() { *m = CMsgGCToGCSOCacheSubscribe{} } -func (m *CMsgGCToGCSOCacheSubscribe) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCSOCacheSubscribe) ProtoMessage() {} -func (*CMsgGCToGCSOCacheSubscribe) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{23} } - -func (m *CMsgGCToGCSOCacheSubscribe) GetSubscriber() uint64 { - if m != nil && m.Subscriber != nil { - return *m.Subscriber - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe) GetSubscribeTo() uint64 { - if m != nil && m.SubscribeTo != nil { - return *m.SubscribeTo - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe) GetHaveVersions() []*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions { - if m != nil { - return m.HaveVersions - } - return nil -} - -type CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions struct { - ServiceId *uint32 `protobuf:"varint,1,opt,name=service_id" json:"service_id,omitempty"` - Version *uint64 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) Reset() { - *m = CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions{} -} -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) ProtoMessage() {} -func (*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{23, 0} -} - -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgGCToGCSOCacheUnsubscribe struct { - Subscriber *uint64 `protobuf:"fixed64,1,opt,name=subscriber" json:"subscriber,omitempty"` - UnsubscribeFrom *uint64 `protobuf:"fixed64,2,opt,name=unsubscribe_from" json:"unsubscribe_from,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCSOCacheUnsubscribe) Reset() { *m = CMsgGCToGCSOCacheUnsubscribe{} } -func (m *CMsgGCToGCSOCacheUnsubscribe) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCSOCacheUnsubscribe) ProtoMessage() {} -func (*CMsgGCToGCSOCacheUnsubscribe) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{24} } - -func (m *CMsgGCToGCSOCacheUnsubscribe) GetSubscriber() uint64 { - if m != nil && m.Subscriber != nil { - return *m.Subscriber - } - return 0 -} - -func (m *CMsgGCToGCSOCacheUnsubscribe) GetUnsubscribeFrom() uint64 { - if m != nil && m.UnsubscribeFrom != nil { - return *m.UnsubscribeFrom - } - return 0 -} - -type CMsgGCClientPing struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientPing) Reset() { *m = CMsgGCClientPing{} } -func (m *CMsgGCClientPing) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientPing) ProtoMessage() {} -func (*CMsgGCClientPing) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{25} } - -type CMsgGCToGCLoadSessionSOCache struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCLoadSessionSOCache) Reset() { *m = CMsgGCToGCLoadSessionSOCache{} } -func (m *CMsgGCToGCLoadSessionSOCache) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCLoadSessionSOCache) ProtoMessage() {} -func (*CMsgGCToGCLoadSessionSOCache) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{26} } - -func (m *CMsgGCToGCLoadSessionSOCache) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCToGCLoadSessionSOCacheResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCLoadSessionSOCacheResponse) Reset() { *m = CMsgGCToGCLoadSessionSOCacheResponse{} } -func (m *CMsgGCToGCLoadSessionSOCacheResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCLoadSessionSOCacheResponse) ProtoMessage() {} -func (*CMsgGCToGCLoadSessionSOCacheResponse) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{27} -} - -type CMsgGCToGCUpdateSessionStats struct { - UserSessions *uint32 `protobuf:"varint,1,opt,name=user_sessions" json:"user_sessions,omitempty"` - ServerSessions *uint32 `protobuf:"varint,2,opt,name=server_sessions" json:"server_sessions,omitempty"` - InLogonSurge *bool `protobuf:"varint,3,opt,name=in_logon_surge" json:"in_logon_surge,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCUpdateSessionStats) Reset() { *m = CMsgGCToGCUpdateSessionStats{} } -func (m *CMsgGCToGCUpdateSessionStats) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCUpdateSessionStats) ProtoMessage() {} -func (*CMsgGCToGCUpdateSessionStats) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{28} } - -func (m *CMsgGCToGCUpdateSessionStats) GetUserSessions() uint32 { - if m != nil && m.UserSessions != nil { - return *m.UserSessions - } - return 0 -} - -func (m *CMsgGCToGCUpdateSessionStats) GetServerSessions() uint32 { - if m != nil && m.ServerSessions != nil { - return *m.ServerSessions - } - return 0 -} - -func (m *CMsgGCToGCUpdateSessionStats) GetInLogonSurge() bool { - if m != nil && m.InLogonSurge != nil { - return *m.InLogonSurge - } - return false -} - -type CWorkshop_PopulateItemDescriptions_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Languages []*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock `protobuf:"bytes,2,rep,name=languages" json:"languages,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_PopulateItemDescriptions_Request) Reset() { - *m = CWorkshop_PopulateItemDescriptions_Request{} -} -func (m *CWorkshop_PopulateItemDescriptions_Request) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_PopulateItemDescriptions_Request) ProtoMessage() {} -func (*CWorkshop_PopulateItemDescriptions_Request) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{29} -} - -func (m *CWorkshop_PopulateItemDescriptions_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_PopulateItemDescriptions_Request) GetLanguages() []*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock { - if m != nil { - return m.Languages - } - return nil -} - -type CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription struct { - Gameitemid *uint32 `protobuf:"varint,1,opt,name=gameitemid" json:"gameitemid,omitempty"` - ItemDescription *string `protobuf:"bytes,2,opt,name=item_description" json:"item_description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) Reset() { - *m = CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription{} -} -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) ProtoMessage() {} -func (*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{29, 0} -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) GetGameitemid() uint32 { - if m != nil && m.Gameitemid != nil { - return *m.Gameitemid - } - return 0 -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) GetItemDescription() string { - if m != nil && m.ItemDescription != nil { - return *m.ItemDescription - } - return "" -} - -type CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock struct { - Language *string `protobuf:"bytes,1,opt,name=language" json:"language,omitempty"` - Descriptions []*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription `protobuf:"bytes,2,rep,name=descriptions" json:"descriptions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) Reset() { - *m = CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock{} -} -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) ProtoMessage() {} -func (*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{29, 1} -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) GetLanguage() string { - if m != nil && m.Language != nil { - return *m.Language - } - return "" -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) GetDescriptions() []*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription { - if m != nil { - return m.Descriptions - } - return nil -} - -type CWorkshop_GetContributors_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Gameitemid *uint32 `protobuf:"varint,2,opt,name=gameitemid" json:"gameitemid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetContributors_Request) Reset() { *m = CWorkshop_GetContributors_Request{} } -func (m *CWorkshop_GetContributors_Request) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_GetContributors_Request) ProtoMessage() {} -func (*CWorkshop_GetContributors_Request) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{30} -} - -func (m *CWorkshop_GetContributors_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_GetContributors_Request) GetGameitemid() uint32 { - if m != nil && m.Gameitemid != nil { - return *m.Gameitemid - } - return 0 -} - -type CWorkshop_GetContributors_Response struct { - Contributors []uint64 `protobuf:"fixed64,1,rep,name=contributors" json:"contributors,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetContributors_Response) Reset() { *m = CWorkshop_GetContributors_Response{} } -func (m *CWorkshop_GetContributors_Response) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_GetContributors_Response) ProtoMessage() {} -func (*CWorkshop_GetContributors_Response) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{31} -} - -func (m *CWorkshop_GetContributors_Response) GetContributors() []uint64 { - if m != nil { - return m.Contributors - } - return nil -} - -type CWorkshop_SetItemPaymentRules_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Gameitemid *uint32 `protobuf:"varint,2,opt,name=gameitemid" json:"gameitemid,omitempty"` - AssociatedWorkshopFiles []*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule `protobuf:"bytes,3,rep,name=associated_workshop_files" json:"associated_workshop_files,omitempty"` - PartnerAccounts []*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule `protobuf:"bytes,4,rep,name=partner_accounts" json:"partner_accounts,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Request) Reset() { *m = CWorkshop_SetItemPaymentRules_Request{} } -func (m *CWorkshop_SetItemPaymentRules_Request) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_SetItemPaymentRules_Request) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Request) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{32} -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetGameitemid() uint32 { - if m != nil && m.Gameitemid != nil { - return *m.Gameitemid - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetAssociatedWorkshopFiles() []*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule { - if m != nil { - return m.AssociatedWorkshopFiles - } - return nil -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetPartnerAccounts() []*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule { - if m != nil { - return m.PartnerAccounts - } - return nil -} - -type CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule struct { - WorkshopFileId *uint64 `protobuf:"varint,1,opt,name=workshop_file_id" json:"workshop_file_id,omitempty"` - RevenuePercentage *float32 `protobuf:"fixed32,2,opt,name=revenue_percentage" json:"revenue_percentage,omitempty"` - RuleDescription *string `protobuf:"bytes,3,opt,name=rule_description" json:"rule_description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) Reset() { - *m = CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule{} -} -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{32, 0} -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) GetWorkshopFileId() uint64 { - if m != nil && m.WorkshopFileId != nil { - return *m.WorkshopFileId - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) GetRevenuePercentage() float32 { - if m != nil && m.RevenuePercentage != nil { - return *m.RevenuePercentage - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) GetRuleDescription() string { - if m != nil && m.RuleDescription != nil { - return *m.RuleDescription - } - return "" -} - -type CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - RevenuePercentage *float32 `protobuf:"fixed32,2,opt,name=revenue_percentage" json:"revenue_percentage,omitempty"` - RuleDescription *string `protobuf:"bytes,3,opt,name=rule_description" json:"rule_description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) Reset() { - *m = CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule{} -} -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{32, 1} -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) GetRevenuePercentage() float32 { - if m != nil && m.RevenuePercentage != nil { - return *m.RevenuePercentage - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) GetRuleDescription() string { - if m != nil && m.RuleDescription != nil { - return *m.RuleDescription - } - return "" -} - -type CWorkshop_SetItemPaymentRules_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Response) Reset() { - *m = CWorkshop_SetItemPaymentRules_Response{} -} -func (m *CWorkshop_SetItemPaymentRules_Response) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_SetItemPaymentRules_Response) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Response) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{33} -} - -type CBroadcast_PostGameDataFrame_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Steamid *uint64 `protobuf:"fixed64,2,opt,name=steamid" json:"steamid,omitempty"` - BroadcastId *uint64 `protobuf:"fixed64,3,opt,name=broadcast_id" json:"broadcast_id,omitempty"` - FrameData []byte `protobuf:"bytes,4,opt,name=frame_data" json:"frame_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CBroadcast_PostGameDataFrame_Request) Reset() { *m = CBroadcast_PostGameDataFrame_Request{} } -func (m *CBroadcast_PostGameDataFrame_Request) String() string { return proto.CompactTextString(m) } -func (*CBroadcast_PostGameDataFrame_Request) ProtoMessage() {} -func (*CBroadcast_PostGameDataFrame_Request) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{34} -} - -func (m *CBroadcast_PostGameDataFrame_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CBroadcast_PostGameDataFrame_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CBroadcast_PostGameDataFrame_Request) GetBroadcastId() uint64 { - if m != nil && m.BroadcastId != nil { - return *m.BroadcastId - } - return 0 -} - -func (m *CBroadcast_PostGameDataFrame_Request) GetFrameData() []byte { - if m != nil { - return m.FrameData - } - return nil -} - -func init() { - proto.RegisterType((*CMsgSHA1Digest)(nil), "CMsgSHA1Digest") - proto.RegisterType((*CMsgSOIDOwner)(nil), "CMsgSOIDOwner") - proto.RegisterType((*CMsgSOSingleObject)(nil), "CMsgSOSingleObject") - proto.RegisterType((*CMsgSOMultipleObjects)(nil), "CMsgSOMultipleObjects") - proto.RegisterType((*CMsgSOMultipleObjects_SingleObject)(nil), "CMsgSOMultipleObjects.SingleObject") - proto.RegisterType((*CMsgSOCacheSubscribed)(nil), "CMsgSOCacheSubscribed") - proto.RegisterType((*CMsgSOCacheSubscribed_SubscribedType)(nil), "CMsgSOCacheSubscribed.SubscribedType") - proto.RegisterType((*CMsgSOCacheSubscribedUpToDate)(nil), "CMsgSOCacheSubscribedUpToDate") - proto.RegisterType((*CMsgSOCacheUnsubscribed)(nil), "CMsgSOCacheUnsubscribed") - proto.RegisterType((*CMsgSOCacheSubscriptionCheck)(nil), "CMsgSOCacheSubscriptionCheck") - proto.RegisterType((*CMsgSOCacheSubscriptionRefresh)(nil), "CMsgSOCacheSubscriptionRefresh") - proto.RegisterType((*CMsgSOCacheVersion)(nil), "CMsgSOCacheVersion") - proto.RegisterType((*CMsgGCMultiplexMessage)(nil), "CMsgGCMultiplexMessage") - proto.RegisterType((*CGCToGCMsgMasterAck)(nil), "CGCToGCMsgMasterAck") - proto.RegisterType((*CGCToGCMsgMasterAck_Process)(nil), "CGCToGCMsgMasterAck.Process") - proto.RegisterType((*CGCToGCMsgMasterAck_Response)(nil), "CGCToGCMsgMasterAck_Response") - proto.RegisterType((*CGCToGCMsgMasterStartupComplete)(nil), "CGCToGCMsgMasterStartupComplete") - proto.RegisterType((*CGCToGCMsgMasterStartupComplete_GCInfo)(nil), "CGCToGCMsgMasterStartupComplete.GCInfo") - proto.RegisterType((*CGCToGCMsgRouted)(nil), "CGCToGCMsgRouted") - proto.RegisterType((*CGCToGCMsgRoutedReply)(nil), "CGCToGCMsgRoutedReply") - proto.RegisterType((*CMsgGCUpdateSubGCSessionInfo)(nil), "CMsgGCUpdateSubGCSessionInfo") - proto.RegisterType((*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate)(nil), "CMsgGCUpdateSubGCSessionInfo.CMsgUpdate") - proto.RegisterType((*CMsgGCRequestSubGCSessionInfo)(nil), "CMsgGCRequestSubGCSessionInfo") - proto.RegisterType((*CMsgGCRequestSubGCSessionInfoResponse)(nil), "CMsgGCRequestSubGCSessionInfoResponse") - proto.RegisterType((*CMsgSOCacheHaveVersion)(nil), "CMsgSOCacheHaveVersion") - proto.RegisterType((*CMsgClientHello)(nil), "CMsgClientHello") - proto.RegisterType((*CMsgClientWelcome)(nil), "CMsgClientWelcome") - proto.RegisterType((*CMsgClientWelcome_Location)(nil), "CMsgClientWelcome.Location") - proto.RegisterType((*CMsgConnectionStatus)(nil), "CMsgConnectionStatus") - proto.RegisterType((*CMsgGCToGCSOCacheSubscribe)(nil), "CMsgGCToGCSOCacheSubscribe") - proto.RegisterType((*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions)(nil), "CMsgGCToGCSOCacheSubscribe.CMsgHaveVersions") - proto.RegisterType((*CMsgGCToGCSOCacheUnsubscribe)(nil), "CMsgGCToGCSOCacheUnsubscribe") - proto.RegisterType((*CMsgGCClientPing)(nil), "CMsgGCClientPing") - proto.RegisterType((*CMsgGCToGCLoadSessionSOCache)(nil), "CMsgGCToGCLoadSessionSOCache") - proto.RegisterType((*CMsgGCToGCLoadSessionSOCacheResponse)(nil), "CMsgGCToGCLoadSessionSOCacheResponse") - proto.RegisterType((*CMsgGCToGCUpdateSessionStats)(nil), "CMsgGCToGCUpdateSessionStats") - proto.RegisterType((*CWorkshop_PopulateItemDescriptions_Request)(nil), "CWorkshop_PopulateItemDescriptions_Request") - proto.RegisterType((*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription)(nil), "CWorkshop_PopulateItemDescriptions_Request.SingleItemDescription") - proto.RegisterType((*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock)(nil), "CWorkshop_PopulateItemDescriptions_Request.ItemDescriptionsLanguageBlock") - proto.RegisterType((*CWorkshop_GetContributors_Request)(nil), "CWorkshop_GetContributors_Request") - proto.RegisterType((*CWorkshop_GetContributors_Response)(nil), "CWorkshop_GetContributors_Response") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Request)(nil), "CWorkshop_SetItemPaymentRules_Request") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule)(nil), "CWorkshop_SetItemPaymentRules_Request.WorkshopItemPaymentRule") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule)(nil), "CWorkshop_SetItemPaymentRules_Request.PartnerItemPaymentRule") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Response)(nil), "CWorkshop_SetItemPaymentRules_Response") - proto.RegisterType((*CBroadcast_PostGameDataFrame_Request)(nil), "CBroadcast_PostGameDataFrame_Request") - proto.RegisterEnum("ESourceEngine", ESourceEngine_name, ESourceEngine_value) - proto.RegisterEnum("PartnerAccountType", PartnerAccountType_name, PartnerAccountType_value) - proto.RegisterEnum("GCConnectionStatus", GCConnectionStatus_name, GCConnectionStatus_value) -} - -var gcsdk_fileDescriptor0 = []byte{ - // 1996 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x57, 0x4b, 0x73, 0xe3, 0x58, - 0x15, 0x1e, 0xc9, 0xaf, 0xf4, 0x89, 0x9d, 0x78, 0x94, 0x49, 0x3a, 0xe3, 0x4e, 0xd3, 0x3d, 0xea, - 0xe9, 0x99, 0xd0, 0x35, 0x23, 0xa6, 0x0d, 0x0c, 0x60, 0xe8, 0xa9, 0x49, 0xdb, 0x6e, 0x27, 0x55, - 0x89, 0x1d, 0xec, 0xa4, 0xc3, 0x82, 0xaa, 0x5b, 0x8a, 0x7c, 0xe3, 0x88, 0xd8, 0x92, 0xd0, 0x95, - 0x32, 0x1d, 0x56, 0x5d, 0xc5, 0x86, 0x62, 0x01, 0x0b, 0x60, 0xcf, 0x8a, 0x3f, 0xc1, 0xef, 0x60, - 0x03, 0x6b, 0x96, 0x54, 0xf1, 0x03, 0x58, 0x70, 0xee, 0xbd, 0x92, 0x1f, 0xb2, 0x9c, 0xb8, 0x67, - 0x93, 0x52, 0xce, 0x3d, 0xef, 0xc7, 0x77, 0x8e, 0x61, 0x6b, 0x60, 0xb1, 0xfe, 0x15, 0x19, 0x58, - 0x23, 0xca, 0x98, 0x39, 0xa0, 0xcc, 0xf0, 0x7c, 0x37, 0x70, 0x2b, 0x1b, 0x2c, 0xa0, 0xe6, 0x68, - 0x96, 0xa8, 0x7f, 0x0d, 0x6b, 0xf5, 0x23, 0x36, 0xe8, 0xed, 0xef, 0x3d, 0x6f, 0xd8, 0x48, 0x0e, - 0xb4, 0x35, 0xc8, 0x9f, 0x0f, 0x5d, 0xeb, 0xea, 0xf9, 0xb6, 0xf2, 0x58, 0xdd, 0xcd, 0x8f, 0xff, - 0xaf, 0x6e, 0xab, 0x33, 0xff, 0x7f, 0x7f, 0x3b, 0x83, 0xff, 0x17, 0xf4, 0xef, 0x42, 0x49, 0x68, - 0xe8, 0x1c, 0x34, 0x3a, 0xdf, 0x38, 0xd4, 0xd7, 0x8a, 0x90, 0x0d, 0x6e, 0x3c, 0x8a, 0xe2, 0xca, - 0x6e, 0x49, 0x03, 0x50, 0xed, 0x3e, 0x8a, 0x2a, 0xbb, 0x59, 0xfd, 0xb7, 0x0a, 0x68, 0x92, 0xb7, - 0x67, 0x3b, 0x83, 0x21, 0xed, 0x9c, 0xff, 0x8a, 0x5a, 0x81, 0xb6, 0x0e, 0x05, 0x2e, 0x40, 0x22, - 0xbe, 0x9c, 0xb6, 0x01, 0xab, 0xae, 0x78, 0x22, 0x7d, 0x33, 0x30, 0xd1, 0x8e, 0xb2, 0x5b, 0xe4, - 0x5c, 0xd7, 0xd4, 0x67, 0xb6, 0xeb, 0x6c, 0x67, 0x91, 0x90, 0xd7, 0x74, 0x00, 0x97, 0x1b, 0x24, - 0xcc, 0x45, 0xc9, 0x1c, 0xd2, 0x56, 0xab, 0x6b, 0xc6, 0xac, 0x2f, 0x68, 0x9e, 0x51, 0xff, 0xda, - 0xb6, 0x84, 0xf6, 0x3c, 0xf7, 0x48, 0xff, 0x97, 0x0a, 0x9b, 0x92, 0xeb, 0x28, 0x1c, 0x06, 0xb6, - 0x17, 0xfb, 0xc1, 0xb4, 0x17, 0x50, 0x96, 0x76, 0x19, 0x19, 0xb9, 0x7d, 0xfb, 0xc2, 0xa6, 0xdc, - 0xa3, 0x0c, 0xea, 0x7d, 0x62, 0xa4, 0x4a, 0x18, 0xc9, 0x38, 0x62, 0x0f, 0x33, 0xc2, 0xc3, 0x1a, - 0x94, 0x62, 0x7d, 0x66, 0xbf, 0x8f, 0xca, 0xb2, 0xcb, 0x2b, 0xfb, 0x19, 0xac, 0xc7, 0xb2, 0x3e, - 0x1d, 0xb9, 0xd7, 0x94, 0x87, 0xb8, 0xb4, 0xf4, 0x6c, 0x6e, 0xf2, 0x4b, 0xe4, 0xa6, 0xc0, 0x73, - 0x53, 0xf9, 0x1a, 0x8a, 0x8b, 0x4a, 0xa3, 0xa4, 0x95, 0x86, 0xd7, 0xab, 0x58, 0x83, 0xb7, 0x7f, - 0x7b, 0xf8, 0x56, 0xfd, 0x1d, 0xfe, 0x59, 0xd1, 0xff, 0xa7, 0xc4, 0xd9, 0xad, 0x9b, 0xd6, 0x25, - 0xed, 0x85, 0xe7, 0xcc, 0xf2, 0xed, 0x73, 0xda, 0xd7, 0xbe, 0x84, 0x42, 0x14, 0x51, 0x94, 0xd4, - 0xa7, 0x46, 0x2a, 0xa3, 0x31, 0xf9, 0x3c, 0x41, 0xdb, 0xf3, 0x69, 0x9d, 0x0d, 0x2e, 0xbb, 0x44, - 0x70, 0x39, 0xd1, 0x8a, 0x1f, 0x40, 0x31, 0xa6, 0x0d, 0x6d, 0x16, 0x60, 0x5a, 0x32, 0x11, 0xf5, - 0xc6, 0xb1, 0x48, 0x6c, 0x83, 0x27, 0x22, 0x5f, 0xf9, 0x12, 0xd6, 0xe6, 0xdd, 0xb8, 0x23, 0x15, - 0x99, 0xdd, 0xa2, 0xfe, 0x67, 0x05, 0x1e, 0xa6, 0x46, 0x75, 0xea, 0x9d, 0xb8, 0x0d, 0x33, 0x98, - 0x09, 0x47, 0x49, 0x09, 0x47, 0x5d, 0x22, 0x9c, 0x4c, 0x6a, 0x38, 0xd9, 0xd4, 0x70, 0x78, 0xe8, - 0x79, 0xfd, 0x05, 0xdc, 0x9f, 0xf2, 0xea, 0xd4, 0x61, 0x93, 0xb2, 0x2c, 0x61, 0x5e, 0xff, 0x93, - 0x02, 0x3b, 0xf3, 0x51, 0x79, 0x01, 0x1a, 0xa8, 0x5f, 0x52, 0xeb, 0x6a, 0x3a, 0x28, 0x35, 0x25, - 0xa8, 0xcc, 0x12, 0x41, 0x65, 0x53, 0x83, 0xca, 0xa5, 0x06, 0x95, 0x17, 0x41, 0x35, 0xe0, 0x3b, - 0x0b, 0x9c, 0xea, 0xd2, 0x0b, 0x9f, 0xb2, 0xcb, 0xa5, 0x62, 0x7b, 0x1a, 0x63, 0x92, 0xd0, 0xf2, - 0x5a, 0x5a, 0x98, 0xab, 0x92, 0x7e, 0x08, 0x5b, 0x9c, 0xad, 0x55, 0x8f, 0xe7, 0xee, 0xcd, 0x91, - 0x44, 0x52, 0xce, 0x3a, 0x62, 0x83, 0x29, 0xc8, 0x43, 0x82, 0x67, 0xde, 0x0c, 0x5d, 0x53, 0x9a, - 0x2c, 0x6a, 0x65, 0x58, 0x11, 0xd8, 0x6b, 0xf7, 0x19, 0xa6, 0x22, 0x83, 0xda, 0xfe, 0xae, 0xc0, - 0x46, 0xbd, 0x55, 0x3f, 0x71, 0x5b, 0x5c, 0xe9, 0x91, 0x89, 0xcf, 0xfe, 0x1e, 0xe6, 0xf1, 0x7d, - 0xb8, 0xd7, 0xb7, 0x7d, 0x62, 0x3b, 0x7d, 0xfa, 0x26, 0xd2, 0x86, 0xb1, 0x8f, 0xd0, 0x33, 0xdb, - 0xa1, 0xc4, 0x31, 0x47, 0x54, 0xe4, 0xf2, 0x1e, 0xa7, 0x22, 0x80, 0x5b, 0xe8, 0x82, 0xa4, 0x66, - 0x05, 0xf5, 0x7b, 0x42, 0x1c, 0x5b, 0xd2, 0xf5, 0x6f, 0x44, 0x7b, 0xaf, 0x56, 0x77, 0x8c, 0x14, - 0x3b, 0xc6, 0xb1, 0x94, 0xad, 0xfc, 0x00, 0x0a, 0xd1, 0x67, 0x9a, 0xe9, 0x2d, 0x58, 0x93, 0x2d, - 0xef, 0xb0, 0xc0, 0x74, 0x90, 0x4b, 0x34, 0x79, 0x49, 0xaf, 0x62, 0x37, 0xcc, 0x2b, 0x25, 0x5d, - 0xca, 0x3c, 0xd7, 0x61, 0x14, 0x0b, 0x5b, 0xa0, 0x98, 0x7f, 0x4c, 0x94, 0x1c, 0x95, 0x9a, 0x52, - 0xd5, 0xff, 0xa0, 0xc0, 0xa3, 0xa4, 0x50, 0x2f, 0x30, 0xfd, 0x20, 0xf4, 0xea, 0xee, 0x08, 0xf3, - 0x89, 0xa3, 0xf1, 0x63, 0x28, 0x0c, 0x2c, 0xb4, 0x76, 0xe1, 0xa2, 0x1c, 0x77, 0xfe, 0x53, 0xe3, - 0x0e, 0x11, 0xa3, 0x55, 0x3f, 0x40, 0xf6, 0xca, 0x73, 0xc8, 0xcb, 0xaf, 0x65, 0x32, 0xc8, 0x8b, - 0x72, 0x0f, 0x0b, 0x5a, 0x9e, 0x28, 0xef, 0xba, 0x61, 0x80, 0xb3, 0x80, 0x85, 0xc2, 0x52, 0x92, - 0xa9, 0x5a, 0xa2, 0x3a, 0x46, 0x51, 0x97, 0x1f, 0x6f, 0xa7, 0x3c, 0x9f, 0x7b, 0x87, 0x06, 0x24, - 0x5a, 0xa4, 0x72, 0x3b, 0xe9, 0x5f, 0x21, 0xea, 0x25, 0xb4, 0x75, 0xa9, 0x37, 0xbc, 0x49, 0x51, - 0x99, 0x90, 0x17, 0x2d, 0xa2, 0xff, 0x25, 0x9a, 0xb0, 0x56, 0xfd, 0xd4, 0x43, 0x38, 0xe1, 0xdd, - 0xdc, 0xaa, 0xf7, 0x90, 0x05, 0x3b, 0x50, 0xc4, 0xf5, 0x13, 0x28, 0x84, 0xe2, 0x85, 0x45, 0xb9, - 0xd9, 0x35, 0x6e, 0xe3, 0x17, 0x8f, 0xf2, 0xa9, 0x52, 0x03, 0x98, 0xfc, 0xc7, 0xbb, 0x33, 0x6a, - 0xc6, 0x08, 0x7f, 0xf8, 0x86, 0xf6, 0x84, 0x1b, 0x05, 0x01, 0x72, 0x7e, 0x88, 0xef, 0x72, 0x66, - 0x57, 0xf4, 0x2f, 0x24, 0x9c, 0xb5, 0xea, 0x5d, 0xfa, 0xeb, 0x10, 0xcf, 0x83, 0x39, 0xbf, 0x92, - 0xea, 0x70, 0x2a, 0x9f, 0xde, 0x2a, 0x31, 0xee, 0x12, 0x69, 0x57, 0x49, 0xda, 0x55, 0x85, 0xdd, - 0x37, 0x72, 0xdc, 0xa2, 0xa9, 0xdc, 0x37, 0xaf, 0xc7, 0x93, 0xb9, 0x03, 0x59, 0x31, 0xcd, 0x4a, - 0x2a, 0xa6, 0xcc, 0x01, 0x51, 0x1a, 0x72, 0x3e, 0x80, 0x0d, 0x8b, 0xab, 0xed, 0x93, 0x0b, 0x7b, - 0x48, 0xc9, 0xf4, 0x59, 0x51, 0xd2, 0xff, 0xa8, 0xc2, 0x3a, 0xd7, 0x59, 0x1f, 0xda, 0xd4, 0x09, - 0xf6, 0xe9, 0x70, 0xe8, 0x26, 0xd1, 0xa0, 0x84, 0xbb, 0x6c, 0x93, 0xb9, 0x42, 0x07, 0xb9, 0x44, - 0xdf, 0x62, 0x15, 0xf1, 0x66, 0xbb, 0x6f, 0x2c, 0x70, 0x9e, 0x5b, 0x16, 0x7a, 0x09, 0x93, 0x19, - 0x21, 0x0e, 0xa5, 0xb1, 0x5b, 0x35, 0x58, 0x8f, 0x1e, 0x87, 0x66, 0xe8, 0xa0, 0xa4, 0x2f, 0x5c, - 0x5a, 0xab, 0x6e, 0x18, 0xc7, 0xd8, 0xf5, 0x0e, 0x9f, 0x32, 0xcb, 0x0d, 0x9d, 0x80, 0xef, 0xa3, - 0x5a, 0xf1, 0x78, 0xaf, 0x7b, 0xd2, 0x6e, 0x76, 0x49, 0xbb, 0xd3, 0x6e, 0xca, 0x30, 0x2d, 0x1f, - 0xfb, 0xea, 0x8a, 0xde, 0x08, 0xd0, 0xbf, 0xa7, 0xdd, 0x9f, 0xd2, 0xe7, 0x0c, 0x42, 0xde, 0x6c, - 0xe2, 0x02, 0xd2, 0x3e, 0x87, 0x3c, 0x75, 0x06, 0x38, 0x0f, 0x62, 0xd9, 0xad, 0x61, 0x12, 0x9b, - 0x3d, 0x37, 0xf4, 0x2d, 0xda, 0x14, 0xd4, 0x5a, 0xe9, 0x8a, 0x34, 0x7b, 0x4d, 0x22, 0x69, 0xcf, - 0xf5, 0xff, 0xaa, 0xf0, 0xfe, 0x24, 0x23, 0x67, 0x74, 0x68, 0xb9, 0x23, 0x3a, 0x9f, 0x13, 0x1c, - 0x95, 0x01, 0x8e, 0xd7, 0xd4, 0x61, 0xa0, 0xfd, 0x14, 0x1e, 0xe0, 0x28, 0xb8, 0x17, 0xbc, 0xf1, - 0xc8, 0x64, 0xe7, 0x10, 0x91, 0x39, 0x89, 0x85, 0xab, 0xd5, 0xad, 0xf4, 0x33, 0x40, 0xdb, 0x83, - 0x4a, 0xe8, 0x05, 0xee, 0x02, 0x59, 0x79, 0x4a, 0x3d, 0x34, 0x6e, 0x5d, 0x4b, 0x9f, 0xc3, 0x0a, - 0x9e, 0xaa, 0x66, 0x10, 0x2f, 0xc2, 0xd5, 0xea, 0x03, 0x63, 0x2e, 0x12, 0xe3, 0x30, 0x62, 0xd1, - 0x36, 0xa1, 0xc4, 0x78, 0x35, 0x45, 0x18, 0x3c, 0x8f, 0x79, 0x11, 0x05, 0xe6, 0xd1, 0x0e, 0xe8, - 0x88, 0x30, 0xb4, 0x31, 0x32, 0x89, 0xe5, 0x5b, 0x22, 0x6f, 0x05, 0x8e, 0x8f, 0xfc, 0x81, 0x49, - 0x81, 0xd0, 0x1f, 0x6e, 0xaf, 0xf0, 0xc4, 0xe3, 0x15, 0xb5, 0x32, 0xd6, 0x89, 0xf3, 0x3f, 0xc4, - 0xaf, 0x20, 0xec, 0xcb, 0xf9, 0x57, 0x79, 0x9e, 0x86, 0x2e, 0x26, 0x5a, 0x90, 0x54, 0x41, 0xc2, - 0x5c, 0x8a, 0xc2, 0x22, 0x6a, 0x0b, 0x78, 0xd7, 0xff, 0xad, 0xc0, 0x07, 0xc2, 0x51, 0xd7, 0x71, - 0x10, 0xce, 0x51, 0x11, 0x02, 0x5f, 0x10, 0x32, 0xad, 0x01, 0x79, 0x26, 0xbe, 0x84, 0x32, 0xde, - 0x1a, 0xad, 0x7a, 0x92, 0xa9, 0xf6, 0x68, 0x9e, 0x46, 0xf6, 0xf7, 0x5e, 0x63, 0x45, 0x9b, 0xbd, - 0xde, 0x41, 0xa7, 0xbd, 0xa8, 0x0d, 0xd5, 0x18, 0xf5, 0x71, 0x70, 0x43, 0x4a, 0x3c, 0x97, 0xd9, - 0x41, 0x7c, 0x76, 0xe5, 0x78, 0x8b, 0x49, 0x3a, 0xb3, 0x7f, 0x23, 0x17, 0x4e, 0x8e, 0x43, 0xeb, - 0x37, 0xa6, 0xcd, 0xd5, 0x58, 0xae, 0x83, 0xdb, 0x2d, 0x27, 0xa8, 0xbb, 0xf0, 0x18, 0x07, 0xdf, - 0x1e, 0x61, 0xe5, 0xfa, 0x64, 0xfa, 0x9d, 0x9f, 0xb2, 0xa6, 0xed, 0xe0, 0x85, 0x29, 0x52, 0x9b, - 0xd3, 0xff, 0xa9, 0x40, 0x45, 0xa2, 0x05, 0x87, 0xce, 0x64, 0x0f, 0x88, 0xae, 0x8e, 0xff, 0xf1, - 0x23, 0xb8, 0xe2, 0xb7, 0x40, 0x4c, 0x23, 0x81, 0x1b, 0x8d, 0x79, 0xf2, 0x42, 0x90, 0x97, 0x62, - 0x1d, 0x4a, 0xb3, 0xe3, 0x29, 0xbb, 0xe6, 0x33, 0x63, 0xb1, 0x4d, 0xf1, 0x34, 0x35, 0xb2, 0xac, - 0xf2, 0x23, 0x5c, 0x14, 0x09, 0x5a, 0x02, 0x55, 0xc6, 0x6b, 0x7f, 0x1a, 0x7a, 0xb2, 0xb8, 0x61, - 0x76, 0xe6, 0xec, 0x4c, 0x9d, 0x5e, 0xa9, 0xd1, 0x6d, 0x43, 0x39, 0x9c, 0xb0, 0x90, 0x0b, 0xdf, - 0x1d, 0xc9, 0x08, 0x75, 0x4d, 0xba, 0x81, 0xa5, 0x15, 0x95, 0x3b, 0xc6, 0x24, 0x8a, 0x45, 0x3c, - 0xb6, 0x70, 0x88, 0x07, 0x47, 0x84, 0xb3, 0x91, 0x31, 0x6e, 0xc1, 0x94, 0x90, 0x31, 0x76, 0x53, - 0xff, 0x04, 0x3e, 0xbe, 0x4d, 0x26, 0x86, 0x67, 0xfd, 0x62, 0x5a, 0x77, 0xb4, 0x64, 0x22, 0x4e, - 0xec, 0x28, 0xc6, 0x87, 0x25, 0x64, 0xfc, 0xb4, 0x92, 0x44, 0x16, 0x65, 0x01, 0x87, 0x85, 0x67, - 0x66, 0xfa, 0x61, 0xdc, 0x56, 0xb6, 0x43, 0x86, 0xee, 0x00, 0xbb, 0x8d, 0x85, 0x7e, 0xb4, 0x39, - 0x57, 0xf4, 0xff, 0xa8, 0xf0, 0xac, 0x7e, 0xe6, 0xfa, 0x57, 0xec, 0xd2, 0xf5, 0xc8, 0xb1, 0xeb, - 0x85, 0x38, 0x2f, 0xf4, 0x00, 0xe7, 0xaa, 0x41, 0xc7, 0xe3, 0xcc, 0x48, 0xb4, 0x4d, 0xb4, 0x12, - 0xe4, 0x4c, 0xcf, 0x1b, 0x27, 0xfd, 0x97, 0x38, 0x4c, 0x11, 0xb8, 0xc5, 0xe0, 0x7b, 0x60, 0x2c, - 0xaf, 0xce, 0x48, 0x3e, 0x1c, 0x46, 0xca, 0x5e, 0xf2, 0x9f, 0xb8, 0x95, 0x26, 0x6c, 0xca, 0x9f, - 0x43, 0x09, 0x36, 0x9e, 0x58, 0x3e, 0xf3, 0x7c, 0xfa, 0xc7, 0xae, 0x60, 0xe9, 0x04, 0x4c, 0xf4, - 0x27, 0x7c, 0xf2, 0xd4, 0xa8, 0xfc, 0x1e, 0x7f, 0x14, 0xdc, 0x6a, 0x48, 0xa2, 0x44, 0x84, 0xd1, - 0x8a, 0x00, 0xef, 0x33, 0x28, 0x4e, 0x29, 0x8a, 0x63, 0xdb, 0x7b, 0x97, 0xd8, 0x52, 0x5d, 0xd7, - 0x5f, 0xc1, 0x47, 0x13, 0x1d, 0x2d, 0x1a, 0x20, 0x52, 0x04, 0xd8, 0x6b, 0x08, 0xd3, 0xfe, 0xc2, - 0x2c, 0xcf, 0x86, 0x2b, 0xea, 0xa9, 0xd7, 0x40, 0xbf, 0x4d, 0x4f, 0xb4, 0xe4, 0x71, 0x2e, 0xad, - 0xa9, 0x07, 0x71, 0xbb, 0xe4, 0xf5, 0x7f, 0x64, 0xf0, 0x48, 0x18, 0x0b, 0xf7, 0x68, 0xc0, 0x9d, - 0x3c, 0x36, 0x6f, 0x46, 0xd8, 0xd8, 0xdd, 0x70, 0x48, 0xdf, 0xc5, 0x11, 0xcd, 0x84, 0x0f, 0x4d, - 0x86, 0xdb, 0xd8, 0x96, 0x70, 0x13, 0x6b, 0xe5, 0xab, 0x3d, 0x5e, 0x31, 0x5f, 0x19, 0x4b, 0x59, - 0x33, 0x62, 0xa6, 0x04, 0x03, 0x16, 0xa3, 0xec, 0xc9, 0x0d, 0x4c, 0xa2, 0x79, 0x8a, 0xa1, 0xe4, - 0xc5, 0x92, 0x9a, 0xa3, 0x05, 0x9e, 0x78, 0xaf, 0xd8, 0x70, 0x7f, 0x91, 0x4d, 0x6c, 0xa7, 0x99, - 0x58, 0xe2, 0x09, 0xce, 0x6a, 0x15, 0xd0, 0x7c, 0x7a, 0x4d, 0x1d, 0x0e, 0xd1, 0x14, 0x37, 0xb4, - 0x13, 0xc4, 0x77, 0xa4, 0xca, 0xa5, 0x7c, 0x94, 0x9e, 0x69, 0x42, 0xb1, 0x52, 0x2a, 0xe7, 0xb0, - 0x95, 0xee, 0x44, 0x1a, 0x4a, 0x7c, 0x3b, 0x1b, 0xfa, 0x2e, 0x7c, 0x72, 0x57, 0x3a, 0x22, 0x74, - 0xf1, 0x10, 0x85, 0x5e, 0xfa, 0x88, 0x3e, 0x16, 0x9e, 0xf5, 0xd8, 0xca, 0x2c, 0x68, 0x61, 0x5d, - 0xf1, 0x07, 0xb2, 0xf9, 0xca, 0xe7, 0xcb, 0x74, 0x41, 0xfd, 0xa7, 0xae, 0xcd, 0x31, 0xee, 0x9f, - 0x8f, 0xd5, 0x44, 0x07, 0x9e, 0x38, 0xfa, 0x2e, 0xfc, 0xf1, 0x2d, 0xc2, 0x57, 0x55, 0xf1, 0xd9, - 0x0f, 0xa1, 0x34, 0x73, 0xe5, 0xe0, 0x1e, 0x9e, 0xbd, 0x73, 0xca, 0xef, 0x25, 0x49, 0xd5, 0xb2, - 0xf2, 0xcc, 0x06, 0x6d, 0xfe, 0xf8, 0xc2, 0x79, 0x9d, 0x39, 0xbf, 0x50, 0xf4, 0x43, 0xd8, 0x8c, - 0x29, 0xc7, 0xcd, 0xee, 0xab, 0x66, 0xfd, 0x84, 0x9c, 0x75, 0xba, 0x87, 0x8d, 0xb2, 0xc2, 0xb5, - 0x8e, 0x99, 0x9b, 0xbf, 0xe8, 0xb4, 0xcb, 0x2a, 0xfe, 0x06, 0x58, 0x8f, 0x49, 0x07, 0xed, 0xd7, - 0x7b, 0x87, 0x07, 0x8d, 0x72, 0xe6, 0xd9, 0x5f, 0x55, 0xd0, 0xe6, 0x37, 0xb7, 0xf6, 0x04, 0xee, - 0xda, 0xe7, 0x68, 0xfe, 0x63, 0x78, 0x9c, 0xc2, 0xd4, 0xaa, 0x93, 0x56, 0xe7, 0xa0, 0xdd, 0x22, - 0x8d, 0xce, 0x59, 0x1b, 0x3d, 0xf9, 0x08, 0x1e, 0xa6, 0x70, 0xb5, 0x3b, 0x63, 0x45, 0xaa, 0xf6, - 0x05, 0x7c, 0x76, 0x2b, 0x0b, 0xfa, 0x4b, 0x0e, 0x3b, 0x2d, 0xfc, 0xf8, 0xf9, 0x69, 0xf3, 0xb4, - 0x59, 0xce, 0x68, 0x8f, 0xe0, 0xc1, 0x02, 0x89, 0x93, 0xe6, 0xde, 0x51, 0x39, 0xab, 0x3d, 0x86, - 0x9d, 0x14, 0x86, 0xde, 0x69, 0xef, 0xb8, 0xd9, 0x6e, 0x34, 0x1b, 0xe5, 0x9c, 0xf6, 0x29, 0x3c, - 0x49, 0xe3, 0xe0, 0xf2, 0xd3, 0x01, 0xe4, 0x5f, 0xe6, 0xf6, 0x95, 0xb7, 0xca, 0x7b, 0xff, 0x0f, - 0x00, 0x00, 0xff, 0xff, 0x28, 0x62, 0x57, 0xd3, 0xe3, 0x14, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/system.pb.go b/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/system.pb.go deleted file mode 100644 index bc5b1102..00000000 --- a/vendor/github.com/Philipp15b/go-steam/dota/protocol/protobuf/system.pb.go +++ /dev/null @@ -1,579 +0,0 @@ -// Code generated by protoc-gen-go. -// source: gcsystemmsgs.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package protobuf is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type EGCSystemMsg int32 - -const ( - EGCSystemMsg_k_EGCMsgInvalid EGCSystemMsg = 0 - EGCSystemMsg_k_EGCMsgMulti EGCSystemMsg = 1 - EGCSystemMsg_k_EGCMsgGenericReply EGCSystemMsg = 10 - EGCSystemMsg_k_EGCMsgSystemBase EGCSystemMsg = 50 - EGCSystemMsg_k_EGCMsgAchievementAwarded EGCSystemMsg = 51 - EGCSystemMsg_k_EGCMsgConCommand EGCSystemMsg = 52 - EGCSystemMsg_k_EGCMsgStartPlaying EGCSystemMsg = 53 - EGCSystemMsg_k_EGCMsgStopPlaying EGCSystemMsg = 54 - EGCSystemMsg_k_EGCMsgStartGameserver EGCSystemMsg = 55 - EGCSystemMsg_k_EGCMsgStopGameserver EGCSystemMsg = 56 - EGCSystemMsg_k_EGCMsgWGRequest EGCSystemMsg = 57 - EGCSystemMsg_k_EGCMsgWGResponse EGCSystemMsg = 58 - EGCSystemMsg_k_EGCMsgGetUserGameStatsSchema EGCSystemMsg = 59 - EGCSystemMsg_k_EGCMsgGetUserGameStatsSchemaResponse EGCSystemMsg = 60 - EGCSystemMsg_k_EGCMsgGetUserStatsDEPRECATED EGCSystemMsg = 61 - EGCSystemMsg_k_EGCMsgGetUserStatsResponse EGCSystemMsg = 62 - EGCSystemMsg_k_EGCMsgAppInfoUpdated EGCSystemMsg = 63 - EGCSystemMsg_k_EGCMsgValidateSession EGCSystemMsg = 64 - EGCSystemMsg_k_EGCMsgValidateSessionResponse EGCSystemMsg = 65 - EGCSystemMsg_k_EGCMsgLookupAccountFromInput EGCSystemMsg = 66 - EGCSystemMsg_k_EGCMsgSendHTTPRequest EGCSystemMsg = 67 - EGCSystemMsg_k_EGCMsgSendHTTPRequestResponse EGCSystemMsg = 68 - EGCSystemMsg_k_EGCMsgPreTestSetup EGCSystemMsg = 69 - EGCSystemMsg_k_EGCMsgRecordSupportAction EGCSystemMsg = 70 - EGCSystemMsg_k_EGCMsgGetAccountDetails_DEPRECATED EGCSystemMsg = 71 - EGCSystemMsg_k_EGCMsgReceiveInterAppMessage EGCSystemMsg = 73 - EGCSystemMsg_k_EGCMsgFindAccounts EGCSystemMsg = 74 - EGCSystemMsg_k_EGCMsgPostAlert EGCSystemMsg = 75 - EGCSystemMsg_k_EGCMsgGetLicenses EGCSystemMsg = 76 - EGCSystemMsg_k_EGCMsgGetUserStats EGCSystemMsg = 77 - EGCSystemMsg_k_EGCMsgGetCommands EGCSystemMsg = 78 - EGCSystemMsg_k_EGCMsgGetCommandsResponse EGCSystemMsg = 79 - EGCSystemMsg_k_EGCMsgAddFreeLicense EGCSystemMsg = 80 - EGCSystemMsg_k_EGCMsgAddFreeLicenseResponse EGCSystemMsg = 81 - EGCSystemMsg_k_EGCMsgGetIPLocation EGCSystemMsg = 82 - EGCSystemMsg_k_EGCMsgGetIPLocationResponse EGCSystemMsg = 83 - EGCSystemMsg_k_EGCMsgSystemStatsSchema EGCSystemMsg = 84 - EGCSystemMsg_k_EGCMsgGetSystemStats EGCSystemMsg = 85 - EGCSystemMsg_k_EGCMsgGetSystemStatsResponse EGCSystemMsg = 86 - EGCSystemMsg_k_EGCMsgSendEmail EGCSystemMsg = 87 - EGCSystemMsg_k_EGCMsgSendEmailResponse EGCSystemMsg = 88 - EGCSystemMsg_k_EGCMsgGetEmailTemplate EGCSystemMsg = 89 - EGCSystemMsg_k_EGCMsgGetEmailTemplateResponse EGCSystemMsg = 90 - EGCSystemMsg_k_EGCMsgGrantGuestPass EGCSystemMsg = 91 - EGCSystemMsg_k_EGCMsgGrantGuestPassResponse EGCSystemMsg = 92 - EGCSystemMsg_k_EGCMsgGetAccountDetails EGCSystemMsg = 93 - EGCSystemMsg_k_EGCMsgGetAccountDetailsResponse EGCSystemMsg = 94 - EGCSystemMsg_k_EGCMsgGetPersonaNames EGCSystemMsg = 95 - EGCSystemMsg_k_EGCMsgGetPersonaNamesResponse EGCSystemMsg = 96 - EGCSystemMsg_k_EGCMsgMultiplexMsg EGCSystemMsg = 97 - EGCSystemMsg_k_EGCMsgWebAPIRegisterInterfaces EGCSystemMsg = 101 - EGCSystemMsg_k_EGCMsgWebAPIJobRequest EGCSystemMsg = 102 - EGCSystemMsg_k_EGCMsgWebAPIJobRequestHttpResponse EGCSystemMsg = 104 - EGCSystemMsg_k_EGCMsgWebAPIJobRequestForwardResponse EGCSystemMsg = 105 - EGCSystemMsg_k_EGCMsgMemCachedGet EGCSystemMsg = 200 - EGCSystemMsg_k_EGCMsgMemCachedGetResponse EGCSystemMsg = 201 - EGCSystemMsg_k_EGCMsgMemCachedSet EGCSystemMsg = 202 - EGCSystemMsg_k_EGCMsgMemCachedDelete EGCSystemMsg = 203 - EGCSystemMsg_k_EGCMsgMemCachedStats EGCSystemMsg = 204 - EGCSystemMsg_k_EGCMsgMemCachedStatsResponse EGCSystemMsg = 205 - EGCSystemMsg_k_EGCMsgSQLStats EGCSystemMsg = 210 - EGCSystemMsg_k_EGCMsgSQLStatsResponse EGCSystemMsg = 211 - EGCSystemMsg_k_EGCMsgMasterSetDirectory EGCSystemMsg = 220 - EGCSystemMsg_k_EGCMsgMasterSetDirectoryResponse EGCSystemMsg = 221 - EGCSystemMsg_k_EGCMsgMasterSetWebAPIRouting EGCSystemMsg = 222 - EGCSystemMsg_k_EGCMsgMasterSetWebAPIRoutingResponse EGCSystemMsg = 223 - EGCSystemMsg_k_EGCMsgMasterSetClientMsgRouting EGCSystemMsg = 224 - EGCSystemMsg_k_EGCMsgMasterSetClientMsgRoutingResponse EGCSystemMsg = 225 - EGCSystemMsg_k_EGCMsgSetOptions EGCSystemMsg = 226 - EGCSystemMsg_k_EGCMsgSetOptionsResponse EGCSystemMsg = 227 - EGCSystemMsg_k_EGCMsgSystemBase2 EGCSystemMsg = 500 - EGCSystemMsg_k_EGCMsgGetPurchaseTrustStatus EGCSystemMsg = 501 - EGCSystemMsg_k_EGCMsgGetPurchaseTrustStatusResponse EGCSystemMsg = 502 - EGCSystemMsg_k_EGCMsgUpdateSession EGCSystemMsg = 503 - EGCSystemMsg_k_EGCMsgGCAccountVacStatusChange EGCSystemMsg = 504 - EGCSystemMsg_k_EGCMsgCheckFriendship EGCSystemMsg = 505 - EGCSystemMsg_k_EGCMsgCheckFriendshipResponse EGCSystemMsg = 506 - EGCSystemMsg_k_EGCMsgGetPartnerAccountLink EGCSystemMsg = 507 - EGCSystemMsg_k_EGCMsgGetPartnerAccountLinkResponse EGCSystemMsg = 508 - EGCSystemMsg_k_EGCMsgVSReportedSuspiciousActivity EGCSystemMsg = 509 - EGCSystemMsg_k_EGCMsgDPPartnerMicroTxns EGCSystemMsg = 512 - EGCSystemMsg_k_EGCMsgDPPartnerMicroTxnsResponse EGCSystemMsg = 513 - EGCSystemMsg_k_EGCMsgGetIPASN EGCSystemMsg = 514 - EGCSystemMsg_k_EGCMsgGetIPASNResponse EGCSystemMsg = 515 - EGCSystemMsg_k_EGCMsgGetAppFriendsList EGCSystemMsg = 516 - EGCSystemMsg_k_EGCMsgGetAppFriendsListResponse EGCSystemMsg = 517 -) - -var EGCSystemMsg_name = map[int32]string{ - 0: "k_EGCMsgInvalid", - 1: "k_EGCMsgMulti", - 10: "k_EGCMsgGenericReply", - 50: "k_EGCMsgSystemBase", - 51: "k_EGCMsgAchievementAwarded", - 52: "k_EGCMsgConCommand", - 53: "k_EGCMsgStartPlaying", - 54: "k_EGCMsgStopPlaying", - 55: "k_EGCMsgStartGameserver", - 56: "k_EGCMsgStopGameserver", - 57: "k_EGCMsgWGRequest", - 58: "k_EGCMsgWGResponse", - 59: "k_EGCMsgGetUserGameStatsSchema", - 60: "k_EGCMsgGetUserGameStatsSchemaResponse", - 61: "k_EGCMsgGetUserStatsDEPRECATED", - 62: "k_EGCMsgGetUserStatsResponse", - 63: "k_EGCMsgAppInfoUpdated", - 64: "k_EGCMsgValidateSession", - 65: "k_EGCMsgValidateSessionResponse", - 66: "k_EGCMsgLookupAccountFromInput", - 67: "k_EGCMsgSendHTTPRequest", - 68: "k_EGCMsgSendHTTPRequestResponse", - 69: "k_EGCMsgPreTestSetup", - 70: "k_EGCMsgRecordSupportAction", - 71: "k_EGCMsgGetAccountDetails_DEPRECATED", - 73: "k_EGCMsgReceiveInterAppMessage", - 74: "k_EGCMsgFindAccounts", - 75: "k_EGCMsgPostAlert", - 76: "k_EGCMsgGetLicenses", - 77: "k_EGCMsgGetUserStats", - 78: "k_EGCMsgGetCommands", - 79: "k_EGCMsgGetCommandsResponse", - 80: "k_EGCMsgAddFreeLicense", - 81: "k_EGCMsgAddFreeLicenseResponse", - 82: "k_EGCMsgGetIPLocation", - 83: "k_EGCMsgGetIPLocationResponse", - 84: "k_EGCMsgSystemStatsSchema", - 85: "k_EGCMsgGetSystemStats", - 86: "k_EGCMsgGetSystemStatsResponse", - 87: "k_EGCMsgSendEmail", - 88: "k_EGCMsgSendEmailResponse", - 89: "k_EGCMsgGetEmailTemplate", - 90: "k_EGCMsgGetEmailTemplateResponse", - 91: "k_EGCMsgGrantGuestPass", - 92: "k_EGCMsgGrantGuestPassResponse", - 93: "k_EGCMsgGetAccountDetails", - 94: "k_EGCMsgGetAccountDetailsResponse", - 95: "k_EGCMsgGetPersonaNames", - 96: "k_EGCMsgGetPersonaNamesResponse", - 97: "k_EGCMsgMultiplexMsg", - 101: "k_EGCMsgWebAPIRegisterInterfaces", - 102: "k_EGCMsgWebAPIJobRequest", - 104: "k_EGCMsgWebAPIJobRequestHttpResponse", - 105: "k_EGCMsgWebAPIJobRequestForwardResponse", - 200: "k_EGCMsgMemCachedGet", - 201: "k_EGCMsgMemCachedGetResponse", - 202: "k_EGCMsgMemCachedSet", - 203: "k_EGCMsgMemCachedDelete", - 204: "k_EGCMsgMemCachedStats", - 205: "k_EGCMsgMemCachedStatsResponse", - 210: "k_EGCMsgSQLStats", - 211: "k_EGCMsgSQLStatsResponse", - 220: "k_EGCMsgMasterSetDirectory", - 221: "k_EGCMsgMasterSetDirectoryResponse", - 222: "k_EGCMsgMasterSetWebAPIRouting", - 223: "k_EGCMsgMasterSetWebAPIRoutingResponse", - 224: "k_EGCMsgMasterSetClientMsgRouting", - 225: "k_EGCMsgMasterSetClientMsgRoutingResponse", - 226: "k_EGCMsgSetOptions", - 227: "k_EGCMsgSetOptionsResponse", - 500: "k_EGCMsgSystemBase2", - 501: "k_EGCMsgGetPurchaseTrustStatus", - 502: "k_EGCMsgGetPurchaseTrustStatusResponse", - 503: "k_EGCMsgUpdateSession", - 504: "k_EGCMsgGCAccountVacStatusChange", - 505: "k_EGCMsgCheckFriendship", - 506: "k_EGCMsgCheckFriendshipResponse", - 507: "k_EGCMsgGetPartnerAccountLink", - 508: "k_EGCMsgGetPartnerAccountLinkResponse", - 509: "k_EGCMsgVSReportedSuspiciousActivity", - 512: "k_EGCMsgDPPartnerMicroTxns", - 513: "k_EGCMsgDPPartnerMicroTxnsResponse", - 514: "k_EGCMsgGetIPASN", - 515: "k_EGCMsgGetIPASNResponse", - 516: "k_EGCMsgGetAppFriendsList", - 517: "k_EGCMsgGetAppFriendsListResponse", -} -var EGCSystemMsg_value = map[string]int32{ - "k_EGCMsgInvalid": 0, - "k_EGCMsgMulti": 1, - "k_EGCMsgGenericReply": 10, - "k_EGCMsgSystemBase": 50, - "k_EGCMsgAchievementAwarded": 51, - "k_EGCMsgConCommand": 52, - "k_EGCMsgStartPlaying": 53, - "k_EGCMsgStopPlaying": 54, - "k_EGCMsgStartGameserver": 55, - "k_EGCMsgStopGameserver": 56, - "k_EGCMsgWGRequest": 57, - "k_EGCMsgWGResponse": 58, - "k_EGCMsgGetUserGameStatsSchema": 59, - "k_EGCMsgGetUserGameStatsSchemaResponse": 60, - "k_EGCMsgGetUserStatsDEPRECATED": 61, - "k_EGCMsgGetUserStatsResponse": 62, - "k_EGCMsgAppInfoUpdated": 63, - "k_EGCMsgValidateSession": 64, - "k_EGCMsgValidateSessionResponse": 65, - "k_EGCMsgLookupAccountFromInput": 66, - "k_EGCMsgSendHTTPRequest": 67, - "k_EGCMsgSendHTTPRequestResponse": 68, - "k_EGCMsgPreTestSetup": 69, - "k_EGCMsgRecordSupportAction": 70, - "k_EGCMsgGetAccountDetails_DEPRECATED": 71, - "k_EGCMsgReceiveInterAppMessage": 73, - "k_EGCMsgFindAccounts": 74, - "k_EGCMsgPostAlert": 75, - "k_EGCMsgGetLicenses": 76, - "k_EGCMsgGetUserStats": 77, - "k_EGCMsgGetCommands": 78, - "k_EGCMsgGetCommandsResponse": 79, - "k_EGCMsgAddFreeLicense": 80, - "k_EGCMsgAddFreeLicenseResponse": 81, - "k_EGCMsgGetIPLocation": 82, - "k_EGCMsgGetIPLocationResponse": 83, - "k_EGCMsgSystemStatsSchema": 84, - "k_EGCMsgGetSystemStats": 85, - "k_EGCMsgGetSystemStatsResponse": 86, - "k_EGCMsgSendEmail": 87, - "k_EGCMsgSendEmailResponse": 88, - "k_EGCMsgGetEmailTemplate": 89, - "k_EGCMsgGetEmailTemplateResponse": 90, - "k_EGCMsgGrantGuestPass": 91, - "k_EGCMsgGrantGuestPassResponse": 92, - "k_EGCMsgGetAccountDetails": 93, - "k_EGCMsgGetAccountDetailsResponse": 94, - "k_EGCMsgGetPersonaNames": 95, - "k_EGCMsgGetPersonaNamesResponse": 96, - "k_EGCMsgMultiplexMsg": 97, - "k_EGCMsgWebAPIRegisterInterfaces": 101, - "k_EGCMsgWebAPIJobRequest": 102, - "k_EGCMsgWebAPIJobRequestHttpResponse": 104, - "k_EGCMsgWebAPIJobRequestForwardResponse": 105, - "k_EGCMsgMemCachedGet": 200, - "k_EGCMsgMemCachedGetResponse": 201, - "k_EGCMsgMemCachedSet": 202, - "k_EGCMsgMemCachedDelete": 203, - "k_EGCMsgMemCachedStats": 204, - "k_EGCMsgMemCachedStatsResponse": 205, - "k_EGCMsgSQLStats": 210, - "k_EGCMsgSQLStatsResponse": 211, - "k_EGCMsgMasterSetDirectory": 220, - "k_EGCMsgMasterSetDirectoryResponse": 221, - "k_EGCMsgMasterSetWebAPIRouting": 222, - "k_EGCMsgMasterSetWebAPIRoutingResponse": 223, - "k_EGCMsgMasterSetClientMsgRouting": 224, - "k_EGCMsgMasterSetClientMsgRoutingResponse": 225, - "k_EGCMsgSetOptions": 226, - "k_EGCMsgSetOptionsResponse": 227, - "k_EGCMsgSystemBase2": 500, - "k_EGCMsgGetPurchaseTrustStatus": 501, - "k_EGCMsgGetPurchaseTrustStatusResponse": 502, - "k_EGCMsgUpdateSession": 503, - "k_EGCMsgGCAccountVacStatusChange": 504, - "k_EGCMsgCheckFriendship": 505, - "k_EGCMsgCheckFriendshipResponse": 506, - "k_EGCMsgGetPartnerAccountLink": 507, - "k_EGCMsgGetPartnerAccountLinkResponse": 508, - "k_EGCMsgVSReportedSuspiciousActivity": 509, - "k_EGCMsgDPPartnerMicroTxns": 512, - "k_EGCMsgDPPartnerMicroTxnsResponse": 513, - "k_EGCMsgGetIPASN": 514, - "k_EGCMsgGetIPASNResponse": 515, - "k_EGCMsgGetAppFriendsList": 516, - "k_EGCMsgGetAppFriendsListResponse": 517, -} - -func (x EGCSystemMsg) Enum() *EGCSystemMsg { - p := new(EGCSystemMsg) - *p = x - return p -} -func (x EGCSystemMsg) String() string { - return proto.EnumName(EGCSystemMsg_name, int32(x)) -} -func (x *EGCSystemMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCSystemMsg_value, data, "EGCSystemMsg") - if err != nil { - return err - } - *x = EGCSystemMsg(value) - return nil -} -func (EGCSystemMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{0} } - -type ESOMsg int32 - -const ( - ESOMsg_k_ESOMsg_Create ESOMsg = 21 - ESOMsg_k_ESOMsg_Update ESOMsg = 22 - ESOMsg_k_ESOMsg_Destroy ESOMsg = 23 - ESOMsg_k_ESOMsg_CacheSubscribed ESOMsg = 24 - ESOMsg_k_ESOMsg_CacheUnsubscribed ESOMsg = 25 - ESOMsg_k_ESOMsg_UpdateMultiple ESOMsg = 26 - ESOMsg_k_ESOMsg_CacheSubscriptionRefresh ESOMsg = 28 - ESOMsg_k_ESOMsg_CacheSubscribedUpToDate ESOMsg = 29 -) - -var ESOMsg_name = map[int32]string{ - 21: "k_ESOMsg_Create", - 22: "k_ESOMsg_Update", - 23: "k_ESOMsg_Destroy", - 24: "k_ESOMsg_CacheSubscribed", - 25: "k_ESOMsg_CacheUnsubscribed", - 26: "k_ESOMsg_UpdateMultiple", - 28: "k_ESOMsg_CacheSubscriptionRefresh", - 29: "k_ESOMsg_CacheSubscribedUpToDate", -} -var ESOMsg_value = map[string]int32{ - "k_ESOMsg_Create": 21, - "k_ESOMsg_Update": 22, - "k_ESOMsg_Destroy": 23, - "k_ESOMsg_CacheSubscribed": 24, - "k_ESOMsg_CacheUnsubscribed": 25, - "k_ESOMsg_UpdateMultiple": 26, - "k_ESOMsg_CacheSubscriptionRefresh": 28, - "k_ESOMsg_CacheSubscribedUpToDate": 29, -} - -func (x ESOMsg) Enum() *ESOMsg { - p := new(ESOMsg) - *p = x - return p -} -func (x ESOMsg) String() string { - return proto.EnumName(ESOMsg_name, int32(x)) -} -func (x *ESOMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ESOMsg_value, data, "ESOMsg") - if err != nil { - return err - } - *x = ESOMsg(value) - return nil -} -func (ESOMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{1} } - -type EGCBaseClientMsg int32 - -const ( - EGCBaseClientMsg_k_EMsgGCPingRequest EGCBaseClientMsg = 3001 - EGCBaseClientMsg_k_EMsgGCPingResponse EGCBaseClientMsg = 3002 - EGCBaseClientMsg_k_EMsgGCClientWelcome EGCBaseClientMsg = 4004 - EGCBaseClientMsg_k_EMsgGCServerWelcome EGCBaseClientMsg = 4005 - EGCBaseClientMsg_k_EMsgGCClientHello EGCBaseClientMsg = 4006 - EGCBaseClientMsg_k_EMsgGCServerHello EGCBaseClientMsg = 4007 - EGCBaseClientMsg_k_EMsgGCClientConnectionStatus EGCBaseClientMsg = 4009 - EGCBaseClientMsg_k_EMsgGCServerConnectionStatus EGCBaseClientMsg = 4010 -) - -var EGCBaseClientMsg_name = map[int32]string{ - 3001: "k_EMsgGCPingRequest", - 3002: "k_EMsgGCPingResponse", - 4004: "k_EMsgGCClientWelcome", - 4005: "k_EMsgGCServerWelcome", - 4006: "k_EMsgGCClientHello", - 4007: "k_EMsgGCServerHello", - 4009: "k_EMsgGCClientConnectionStatus", - 4010: "k_EMsgGCServerConnectionStatus", -} -var EGCBaseClientMsg_value = map[string]int32{ - "k_EMsgGCPingRequest": 3001, - "k_EMsgGCPingResponse": 3002, - "k_EMsgGCClientWelcome": 4004, - "k_EMsgGCServerWelcome": 4005, - "k_EMsgGCClientHello": 4006, - "k_EMsgGCServerHello": 4007, - "k_EMsgGCClientConnectionStatus": 4009, - "k_EMsgGCServerConnectionStatus": 4010, -} - -func (x EGCBaseClientMsg) Enum() *EGCBaseClientMsg { - p := new(EGCBaseClientMsg) - *p = x - return p -} -func (x EGCBaseClientMsg) String() string { - return proto.EnumName(EGCBaseClientMsg_name, int32(x)) -} -func (x *EGCBaseClientMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCBaseClientMsg_value, data, "EGCBaseClientMsg") - if err != nil { - return err - } - *x = EGCBaseClientMsg(value) - return nil -} -func (EGCBaseClientMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{2} } - -type EGCToGCMsg int32 - -const ( - EGCToGCMsg_k_EGCToGCMsgMasterAck EGCToGCMsg = 150 - EGCToGCMsg_k_EGCToGCMsgMasterAckResponse EGCToGCMsg = 151 - EGCToGCMsg_k_EGCToGCMsgRouted EGCToGCMsg = 152 - EGCToGCMsg_k_EGCToGCMsgRoutedReply EGCToGCMsg = 153 - EGCToGCMsg_k_EMsgGCUpdateSubGCSessionInfo EGCToGCMsg = 154 - EGCToGCMsg_k_EMsgGCRequestSubGCSessionInfo EGCToGCMsg = 155 - EGCToGCMsg_k_EMsgGCRequestSubGCSessionInfoResponse EGCToGCMsg = 156 - EGCToGCMsg_k_EGCToGCMsgMasterStartupComplete EGCToGCMsg = 157 - EGCToGCMsg_k_EMsgGCToGCSOCacheSubscribe EGCToGCMsg = 158 - EGCToGCMsg_k_EMsgGCToGCSOCacheUnsubscribe EGCToGCMsg = 159 - EGCToGCMsg_k_EMsgGCToGCLoadSessionSOCache EGCToGCMsg = 160 - EGCToGCMsg_k_EMsgGCToGCLoadSessionSOCacheResponse EGCToGCMsg = 161 - EGCToGCMsg_k_EMsgGCToGCUpdateSessionStats EGCToGCMsg = 162 -) - -var EGCToGCMsg_name = map[int32]string{ - 150: "k_EGCToGCMsgMasterAck", - 151: "k_EGCToGCMsgMasterAckResponse", - 152: "k_EGCToGCMsgRouted", - 153: "k_EGCToGCMsgRoutedReply", - 154: "k_EMsgGCUpdateSubGCSessionInfo", - 155: "k_EMsgGCRequestSubGCSessionInfo", - 156: "k_EMsgGCRequestSubGCSessionInfoResponse", - 157: "k_EGCToGCMsgMasterStartupComplete", - 158: "k_EMsgGCToGCSOCacheSubscribe", - 159: "k_EMsgGCToGCSOCacheUnsubscribe", - 160: "k_EMsgGCToGCLoadSessionSOCache", - 161: "k_EMsgGCToGCLoadSessionSOCacheResponse", - 162: "k_EMsgGCToGCUpdateSessionStats", -} -var EGCToGCMsg_value = map[string]int32{ - "k_EGCToGCMsgMasterAck": 150, - "k_EGCToGCMsgMasterAckResponse": 151, - "k_EGCToGCMsgRouted": 152, - "k_EGCToGCMsgRoutedReply": 153, - "k_EMsgGCUpdateSubGCSessionInfo": 154, - "k_EMsgGCRequestSubGCSessionInfo": 155, - "k_EMsgGCRequestSubGCSessionInfoResponse": 156, - "k_EGCToGCMsgMasterStartupComplete": 157, - "k_EMsgGCToGCSOCacheSubscribe": 158, - "k_EMsgGCToGCSOCacheUnsubscribe": 159, - "k_EMsgGCToGCLoadSessionSOCache": 160, - "k_EMsgGCToGCLoadSessionSOCacheResponse": 161, - "k_EMsgGCToGCUpdateSessionStats": 162, -} - -func (x EGCToGCMsg) Enum() *EGCToGCMsg { - p := new(EGCToGCMsg) - *p = x - return p -} -func (x EGCToGCMsg) String() string { - return proto.EnumName(EGCToGCMsg_name, int32(x)) -} -func (x *EGCToGCMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCToGCMsg_value, data, "EGCToGCMsg") - if err != nil { - return err - } - *x = EGCToGCMsg(value) - return nil -} -func (EGCToGCMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{3} } - -func init() { - proto.RegisterEnum("EGCSystemMsg", EGCSystemMsg_name, EGCSystemMsg_value) - proto.RegisterEnum("ESOMsg", ESOMsg_name, ESOMsg_value) - proto.RegisterEnum("EGCBaseClientMsg", EGCBaseClientMsg_name, EGCBaseClientMsg_value) - proto.RegisterEnum("EGCToGCMsg", EGCToGCMsg_name, EGCToGCMsg_value) -} - -var system_fileDescriptor0 = []byte{ - // 1475 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x57, 0x59, 0x73, 0x1b, 0xc5, - 0x13, 0xcf, 0x96, 0xfc, 0xff, 0x3f, 0x4c, 0x41, 0xd1, 0x99, 0xc4, 0x47, 0x12, 0x27, 0x4a, 0x42, - 0x0e, 0x62, 0xa8, 0x3c, 0x84, 0xfb, 0x46, 0x91, 0x64, 0x5b, 0x41, 0x8e, 0x15, 0x4b, 0xb6, 0xb9, - 0xcd, 0x7a, 0x35, 0xb6, 0xb6, 0x2c, 0xed, 0x2c, 0x33, 0xbb, 0x26, 0x7e, 0x0b, 0xd7, 0x57, 0xe0, - 0xbe, 0x8b, 0xa3, 0xe0, 0x1b, 0xc0, 0x27, 0xe0, 0x7c, 0x81, 0x57, 0xee, 0x7c, 0x01, 0x1e, 0xb8, - 0x21, 0x55, 0xf4, 0xee, 0xce, 0xce, 0xce, 0x4a, 0xb2, 0x79, 0x93, 0xe6, 0xd7, 0xdd, 0xd3, 0xdd, - 0xd3, 0xfd, 0xeb, 0x5e, 0x42, 0xd7, 0x1d, 0xb9, 0x25, 0x03, 0xd6, 0xeb, 0xc9, 0x75, 0x79, 0xda, - 0x17, 0x3c, 0xe0, 0x53, 0x97, 0x47, 0xc9, 0x55, 0xd5, 0x99, 0x72, 0x33, 0x3e, 0x9f, 0x93, 0xeb, - 0x74, 0x0f, 0xb9, 0x66, 0x63, 0x05, 0x4f, 0xf0, 0x77, 0xcd, 0xdb, 0xb4, 0xbb, 0x6e, 0x1b, 0x76, - 0xd1, 0xdd, 0xe4, 0xea, 0xf4, 0x70, 0x2e, 0xec, 0x06, 0x2e, 0x58, 0x74, 0x82, 0xec, 0x4d, 0x8f, - 0x66, 0x98, 0xc7, 0x84, 0xeb, 0x2c, 0x30, 0xbf, 0xbb, 0x05, 0x84, 0x8e, 0x11, 0x9a, 0x22, 0x89, - 0xd9, 0xb3, 0xb6, 0x64, 0x70, 0x86, 0x1e, 0x22, 0xfb, 0xd3, 0xf3, 0x92, 0xd3, 0x71, 0xd9, 0x26, - 0xeb, 0x31, 0x2f, 0x28, 0x3d, 0x69, 0x8b, 0x36, 0x6b, 0xc3, 0x8d, 0xa6, 0x5e, 0x99, 0x7b, 0x65, - 0xde, 0xeb, 0xd9, 0x5e, 0x1b, 0x6e, 0x32, 0x6f, 0x6a, 0x06, 0xb6, 0x08, 0x1a, 0x5d, 0x7b, 0xcb, - 0xf5, 0xd6, 0xe1, 0x66, 0x3a, 0x4e, 0xf6, 0x64, 0x08, 0xf7, 0x53, 0xe0, 0x16, 0x7a, 0x80, 0x8c, - 0xe7, 0x54, 0x66, 0xec, 0x1e, 0x93, 0x4c, 0x6c, 0x32, 0x01, 0xb7, 0xd2, 0xfd, 0x64, 0xcc, 0xd4, - 0x32, 0xb0, 0xdb, 0xe8, 0x28, 0xd9, 0x9d, 0x62, 0xcb, 0x33, 0x0b, 0xec, 0x89, 0x90, 0xc9, 0x00, - 0x6e, 0x37, 0x5d, 0x8b, 0x8e, 0xa5, 0xcf, 0x3d, 0x0c, 0xe9, 0x0e, 0x7a, 0x94, 0x1c, 0xca, 0x92, - 0x10, 0x2c, 0xa2, 0x99, 0xc8, 0x1a, 0x5e, 0x19, 0xc8, 0xa6, 0xd3, 0x61, 0x3d, 0x1b, 0xee, 0xa4, - 0x53, 0xe4, 0xc4, 0xce, 0x32, 0xda, 0xde, 0x5d, 0x43, 0xec, 0xc5, 0x72, 0x95, 0x6a, 0x63, 0xa1, - 0x5a, 0x2e, 0xb5, 0xaa, 0x15, 0xb8, 0x9b, 0x1e, 0x26, 0x93, 0xc3, 0x64, 0xb4, 0x95, 0x7b, 0xcc, - 0x00, 0x4b, 0xbe, 0x5f, 0xf3, 0xd6, 0xf8, 0xa2, 0xdf, 0xb6, 0x03, 0x4c, 0xf2, 0xbd, 0x66, 0x66, - 0x96, 0xa2, 0xc7, 0xc5, 0xe3, 0x26, 0x93, 0xd2, 0xe5, 0x1e, 0xdc, 0x47, 0xaf, 0x25, 0xc5, 0x6d, - 0x40, 0x6d, 0xbd, 0x64, 0xfa, 0x58, 0xe7, 0x7c, 0x23, 0xf4, 0x4b, 0x8e, 0xc3, 0x43, 0x2f, 0x98, - 0x16, 0xbc, 0x57, 0xf3, 0xfc, 0x30, 0x80, 0xb3, 0xb9, 0xfc, 0x33, 0xaf, 0x3d, 0xdb, 0x6a, 0x35, - 0xd2, 0x64, 0x96, 0xcd, 0x5b, 0xfa, 0x40, 0x7d, 0x4b, 0xc5, 0x7c, 0xf4, 0x86, 0x60, 0x2d, 0x04, - 0x9b, 0x2c, 0x08, 0x7d, 0xa8, 0xd2, 0x22, 0x39, 0x90, 0x22, 0x0b, 0xcc, 0xe1, 0xa2, 0xdd, 0x0c, - 0x7d, 0x9f, 0x8b, 0xa0, 0xe4, 0x04, 0x51, 0x14, 0xd3, 0xf4, 0x3a, 0x72, 0xcc, 0x48, 0x90, 0xf2, - 0xae, 0xc2, 0x02, 0xdb, 0xed, 0xca, 0x15, 0x23, 0x95, 0x33, 0x66, 0x28, 0x68, 0x8a, 0xb9, 0x9b, - 0xac, 0xe6, 0x05, 0x4c, 0x60, 0xd2, 0xe6, 0x30, 0x6c, 0x7b, 0x9d, 0x41, 0xcd, 0x74, 0x64, 0xda, - 0xf5, 0xda, 0xca, 0x9c, 0x84, 0x73, 0x66, 0xad, 0x34, 0xb8, 0x0c, 0x4a, 0x5d, 0x26, 0x02, 0xb8, - 0xdf, 0x2c, 0x4a, 0xbc, 0xbe, 0xee, 0x3a, 0x0c, 0x23, 0x92, 0x50, 0xcf, 0x77, 0x4c, 0xf6, 0x70, - 0x30, 0xd7, 0xa7, 0xa2, 0x2a, 0x5f, 0xc2, 0x79, 0x33, 0x56, 0x03, 0xd0, 0x69, 0x9a, 0xcf, 0x3d, - 0x75, 0xbb, 0x3d, 0x2d, 0x18, 0x53, 0x17, 0x42, 0xc3, 0x8c, 0x2e, 0x8f, 0x69, 0xfd, 0x0b, 0x74, - 0x1f, 0x19, 0x35, 0x2e, 0xa8, 0x35, 0xea, 0xdc, 0xb1, 0xe3, 0x34, 0x2e, 0xd0, 0x23, 0xe4, 0xe0, - 0x50, 0x48, 0x6b, 0x37, 0xe9, 0x41, 0xb2, 0x2f, 0xdf, 0xe9, 0x66, 0xe5, 0xb7, 0x4c, 0xe7, 0xd0, - 0x82, 0x21, 0x01, 0x8b, 0x7d, 0x95, 0x6e, 0x60, 0xda, 0xfc, 0x92, 0x99, 0xe0, 0xa8, 0x50, 0xaa, - 0x3d, 0x7c, 0x41, 0x58, 0xce, 0xdd, 0x9a, 0x1e, 0x6b, 0xad, 0x07, 0xe8, 0x24, 0x99, 0x30, 0x2c, - 0xc7, 0x68, 0x8b, 0xf5, 0xfc, 0x2e, 0x16, 0x33, 0x3c, 0x48, 0x8f, 0x91, 0xc3, 0xdb, 0xa1, 0xda, - 0xc6, 0x43, 0x39, 0xcf, 0x85, 0xed, 0x05, 0x33, 0x51, 0x75, 0x36, 0x6c, 0x29, 0xe1, 0xe1, 0x9c, - 0xe7, 0x39, 0x4c, 0xeb, 0x3f, 0x62, 0xba, 0x38, 0x50, 0x82, 0xf0, 0x28, 0x3d, 0x4e, 0x8e, 0x6c, - 0x0b, 0x6b, 0x2b, 0x8f, 0x99, 0x5d, 0x84, 0x62, 0x0d, 0x26, 0x24, 0xf7, 0xec, 0xf3, 0x11, 0x5d, - 0xc1, 0x8a, 0xd9, 0x45, 0x7d, 0xa0, 0xb6, 0xf0, 0xb8, 0x59, 0x72, 0x31, 0x6f, 0xfb, 0x5d, 0x76, - 0x11, 0x7f, 0x83, 0x6d, 0xe6, 0x61, 0x99, 0xad, 0x96, 0x1a, 0xb5, 0x05, 0xb6, 0xee, 0xe2, 0x23, - 0x88, 0xb8, 0x03, 0xd6, 0x6c, 0x07, 0x2f, 0x61, 0x66, 0x2e, 0x13, 0xa9, 0x73, 0x7c, 0x35, 0x6d, - 0xe4, 0x35, 0xb3, 0xd1, 0xfa, 0xd1, 0xd9, 0x20, 0xf0, 0xb5, 0x1f, 0x1d, 0x7a, 0x3d, 0x39, 0xb9, - 0x9d, 0xe4, 0x34, 0x17, 0xd1, 0x04, 0xd0, 0xc2, 0x2e, 0xd6, 0x64, 0xe6, 0x34, 0xeb, 0x95, 0x6d, - 0x2c, 0xa7, 0x36, 0x86, 0x08, 0x9f, 0x58, 0x58, 0x93, 0x93, 0xc3, 0x20, 0xad, 0xfc, 0xa9, 0x35, - 0x54, 0x1b, 0xa9, 0x03, 0x3e, 0xb3, 0x30, 0x9a, 0xf1, 0x01, 0xa8, 0xc2, 0xba, 0x0c, 0x0b, 0xe3, - 0x73, 0x0b, 0xb3, 0x3d, 0x36, 0xa8, 0x18, 0x57, 0xeb, 0x17, 0x16, 0x66, 0xfb, 0xd0, 0x70, 0x50, - 0x5f, 0xfd, 0xa5, 0x85, 0xf5, 0x0a, 0xba, 0x30, 0x2f, 0xd4, 0x13, 0xdd, 0xaf, 0x2c, 0x2c, 0x86, - 0x89, 0xfe, 0x63, 0xad, 0xf5, 0xb5, 0x85, 0x3d, 0xae, 0xc7, 0xe2, 0x9c, 0x1d, 0xbd, 0x00, 0x7a, - 0x5b, 0x71, 0x05, 0x73, 0x02, 0x2e, 0xb6, 0xe0, 0x1b, 0x8b, 0x9e, 0x24, 0x47, 0xb7, 0x17, 0xd0, - 0x96, 0xbe, 0xcd, 0x3b, 0x99, 0x0a, 0xaa, 0xc7, 0xe5, 0x61, 0x10, 0x4d, 0xc6, 0xef, 0x2c, 0x7c, - 0x8a, 0x13, 0x3b, 0x0b, 0x69, 0x8b, 0xdf, 0x5b, 0xf4, 0x44, 0x56, 0xa8, 0x5a, 0xb8, 0xdc, 0x75, - 0x71, 0x6c, 0x47, 0x94, 0xa9, 0x8c, 0xfe, 0x60, 0xd1, 0xd3, 0xe4, 0xd4, 0x7f, 0xca, 0x69, 0xbb, - 0x3f, 0x5a, 0x48, 0x78, 0xd9, 0x8a, 0xc0, 0x82, 0x79, 0x3f, 0xe2, 0x15, 0x09, 0x3f, 0xe5, 0x92, - 0x91, 0x01, 0x5a, 0xf3, 0x72, 0xb4, 0x76, 0xec, 0x19, 0x5c, 0x2e, 0xce, 0xc0, 0x2f, 0x05, 0x33, - 0xfa, 0xa8, 0x21, 0x42, 0xe1, 0x74, 0x10, 0x6a, 0x89, 0x10, 0x47, 0x07, 0xe6, 0x3c, 0x94, 0xf0, - 0x6b, 0xc1, 0x8c, 0x7e, 0xb8, 0x90, 0xbe, 0xeb, 0xb7, 0x02, 0xb2, 0x80, 0x26, 0xc7, 0x64, 0x80, - 0xa6, 0x93, 0xf2, 0xf7, 0x02, 0xb6, 0x70, 0xc6, 0x23, 0x65, 0xd5, 0xc1, 0x4b, 0xb6, 0x93, 0x18, - 0x29, 0x77, 0x6c, 0x0f, 0x87, 0xc7, 0x1f, 0x05, 0xb3, 0xe4, 0xca, 0x1d, 0xe6, 0x6c, 0x4c, 0x0b, - 0x4c, 0x4a, 0x5b, 0x76, 0x5c, 0x1f, 0xfe, 0x2c, 0x60, 0x13, 0x16, 0xb7, 0x41, 0xb5, 0x1b, 0x7f, - 0x15, 0x90, 0x70, 0x4c, 0x22, 0x6e, 0xe0, 0x3a, 0x83, 0xeb, 0x96, 0xba, 0xb2, 0xee, 0x7a, 0x1b, - 0xf0, 0x77, 0x01, 0x97, 0x8c, 0xe3, 0x3b, 0xca, 0x68, 0x7b, 0xff, 0x14, 0xe8, 0xa9, 0xac, 0x6d, - 0x97, 0x9a, 0xb8, 0xb4, 0xe1, 0xec, 0xc4, 0x62, 0x0e, 0xa5, 0xef, 0x3a, 0x2e, 0x0f, 0x65, 0x34, - 0x47, 0x37, 0xdd, 0x60, 0x0b, 0xae, 0x14, 0xcc, 0xe7, 0xa8, 0x34, 0x94, 0xd5, 0x39, 0xd7, 0x11, - 0xbc, 0x75, 0x11, 0xdf, 0xeb, 0xd2, 0x88, 0x59, 0x9b, 0x83, 0x02, 0xfa, 0xd2, 0xa7, 0x46, 0xcc, - 0xde, 0x88, 0xa7, 0x49, 0xa9, 0x79, 0x1e, 0x9e, 0x1e, 0x31, 0x7b, 0x23, 0x3d, 0xd6, 0x5a, 0xcf, - 0x8c, 0xe0, 0xca, 0x98, 0xe3, 0x51, 0xdf, 0x57, 0x19, 0xaa, 0x23, 0x55, 0xc1, 0xb3, 0x23, 0x66, - 0x7d, 0x0e, 0xe0, 0xda, 0xce, 0x73, 0x23, 0x53, 0x3f, 0x5b, 0xe4, 0xff, 0xd5, 0xe6, 0x7c, 0xb6, - 0xdf, 0xc6, 0xbf, 0x57, 0xca, 0x82, 0x45, 0x53, 0x61, 0x34, 0x77, 0x98, 0x3c, 0x35, 0x8c, 0xd1, - 0xbd, 0xb1, 0xcb, 0xc9, 0x61, 0x05, 0x99, 0x4a, 0xf0, 0x2d, 0x18, 0x57, 0x94, 0xa8, 0xf4, 0x23, - 0x1e, 0x68, 0x86, 0xab, 0xd2, 0x11, 0xee, 0x2a, 0xae, 0x57, 0x13, 0x6a, 0xc7, 0x35, 0xd0, 0x45, - 0x4f, 0x66, 0xf8, 0x3e, 0x45, 0xe9, 0xe6, 0x45, 0x29, 0x2f, 0xc3, 0x7e, 0x35, 0x16, 0x06, 0x4d, - 0xfb, 0xc9, 0xd8, 0x5d, 0x13, 0x4c, 0x76, 0x60, 0x52, 0x51, 0xf7, 0x50, 0x0f, 0x16, 0xfd, 0x16, - 0xaf, 0x44, 0xde, 0x1f, 0x9c, 0xba, 0x62, 0x11, 0xc0, 0xcc, 0x44, 0xed, 0xa1, 0x3b, 0x51, 0x75, - 0x4f, 0x5c, 0xb3, 0x8d, 0xb8, 0x25, 0x13, 0x2a, 0xff, 0x68, 0x5c, 0xd1, 0xa6, 0x81, 0xa8, 0xe4, - 0x7d, 0x3c, 0xae, 0xda, 0x20, 0x86, 0x12, 0x4b, 0xcb, 0xac, 0xeb, 0xf0, 0x1e, 0x83, 0x77, 0x8a, - 0x26, 0xd6, 0x8c, 0x77, 0xe8, 0x14, 0x7b, 0xb7, 0x68, 0x5e, 0x96, 0xe8, 0xcd, 0xb2, 0x6e, 0x97, - 0xc3, 0x7b, 0x39, 0x24, 0xd1, 0x4a, 0x90, 0xf7, 0x8b, 0xaa, 0x89, 0x0d, 0x1d, 0xfc, 0x12, 0xf0, - 0x58, 0xbc, 0xd9, 0xa9, 0x26, 0xfe, 0x20, 0x27, 0x94, 0xa8, 0x0f, 0x08, 0x7d, 0x58, 0x9c, 0xba, - 0x5c, 0x20, 0x04, 0xe3, 0x6f, 0xf1, 0xb8, 0x3a, 0x74, 0x2f, 0xab, 0xff, 0x09, 0x4b, 0x95, 0x9c, - 0x0d, 0x78, 0xde, 0xd2, 0x0d, 0xd6, 0x8f, 0xe9, 0x24, 0xbc, 0x90, 0x31, 0x96, 0x92, 0x89, 0x38, - 0x0d, 0x1f, 0xf4, 0xc5, 0x6c, 0xa8, 0xe4, 0x80, 0xe4, 0x53, 0xe8, 0x25, 0xcb, 0x74, 0x55, 0x51, - 0x48, 0xb8, 0x1a, 0x79, 0x1d, 0xf3, 0x48, 0xb4, 0x99, 0xc3, 0xcb, 0x96, 0xa2, 0x81, 0x58, 0x48, - 0xbd, 0xc8, 0x80, 0xd4, 0x2b, 0x16, 0xbd, 0x21, 0x9e, 0xa1, 0x3b, 0x49, 0x69, 0x7f, 0x5f, 0xcd, - 0x98, 0x3b, 0x17, 0x53, 0xfc, 0x2d, 0x14, 0xfa, 0xb8, 0x47, 0xfa, 0xf1, 0xd4, 0x7b, 0x2d, 0x9d, - 0xa8, 0xb1, 0xd5, 0x48, 0xb4, 0x39, 0x9f, 0xaf, 0x28, 0x78, 0x3d, 0x17, 0x83, 0x21, 0x62, 0x14, - 0x36, 0xbc, 0x31, 0x20, 0x54, 0xe7, 0x76, 0x5b, 0x79, 0xa6, 0xe4, 0xe1, 0xcd, 0x74, 0xf6, 0xec, - 0x20, 0xa4, 0x23, 0x78, 0x6b, 0xc0, 0x62, 0x8e, 0x81, 0x93, 0xd9, 0xfa, 0xb6, 0x75, 0xf6, 0x7f, - 0xb3, 0xd6, 0x25, 0x6b, 0xd7, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x05, 0xab, 0xaf, 0x14, 0xda, - 0x0e, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory.go b/vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory.go deleted file mode 100644 index 93ae9efa..00000000 --- a/vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Includes inventory types as used in the trade package -*/ -package inventory - -import ( - "bytes" - "encoding/json" - "fmt" - "github.com/Philipp15b/go-steam/jsont" - "strconv" -) - -type GenericInventory map[uint32]map[uint64]*Inventory - -func NewGenericInventory() GenericInventory { - iMap := make(map[uint32]map[uint64]*Inventory) - return GenericInventory(iMap) -} - -// Get inventory for specified AppId and ContextId -func (i *GenericInventory) Get(appId uint32, contextId uint64) (*Inventory, error) { - iMap := (map[uint32]map[uint64]*Inventory)(*i) - iMap2, ok := iMap[appId] - if !ok { - return nil, fmt.Errorf("inventory for specified appId not found") - } - inv, ok := iMap2[contextId] - if !ok { - return nil, fmt.Errorf("inventory for specified contextId not found") - } - return inv, nil -} - -func (i *GenericInventory) Add(appId uint32, contextId uint64, inv *Inventory) { - iMap := (map[uint32]map[uint64]*Inventory)(*i) - iMap2, ok := iMap[appId] - if !ok { - iMap2 = make(map[uint64]*Inventory) - iMap[appId] = iMap2 - } - iMap2[contextId] = inv -} - -type Inventory struct { - Items Items `json:"rgInventory"` - Currencies Currencies `json:"rgCurrency"` - Descriptions Descriptions `json:"rgDescriptions"` - AppInfo *AppInfo `json:"rgAppInfo"` -} - -// Items key is an AssetId -type Items map[string]*Item - -func (i *Items) ToMap() map[string]*Item { - return (map[string]*Item)(*i) -} - -func (i *Items) Get(assetId uint64) (*Item, error) { - iMap := (map[string]*Item)(*i) - if item, ok := iMap[strconv.FormatUint(assetId, 10)]; ok { - return item, nil - } - return nil, fmt.Errorf("item not found") -} - -func (i *Items) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte("[]")) { - return nil - } - return json.Unmarshal(data, (*map[string]*Item)(i)) -} - -type Currencies map[string]*Currency - -func (c *Currencies) ToMap() map[string]*Currency { - return (map[string]*Currency)(*c) -} - -func (c *Currencies) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte("[]")) { - return nil - } - return json.Unmarshal(data, (*map[string]*Currency)(c)) -} - -// Descriptions key format is %d_%d, first %d is ClassId, second is InstanceId -type Descriptions map[string]*Description - -func (d *Descriptions) ToMap() map[string]*Description { - return (map[string]*Description)(*d) -} - -func (d *Descriptions) Get(classId uint64, instanceId uint64) (*Description, error) { - dMap := (map[string]*Description)(*d) - descId := fmt.Sprintf("%v_%v", classId, instanceId) - if desc, ok := dMap[descId]; ok { - return desc, nil - } - return nil, fmt.Errorf("description not found") -} - -func (d *Descriptions) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte("[]")) { - return nil - } - return json.Unmarshal(data, (*map[string]*Description)(d)) -} - -type Item struct { - Id uint64 `json:",string"` - ClassId uint64 `json:",string"` - InstanceId uint64 `json:",string"` - Amount uint64 `json:",string"` - Pos uint32 -} - -type Currency struct { - Id uint64 `json:",string"` - ClassId uint64 `json:",string"` - IsCurrency bool `json:"is_currency"` - Pos uint32 -} - -type Description struct { - AppId uint32 `json:",string"` - ClassId uint64 `json:",string"` - InstanceId uint64 `json:",string"` - - IconUrl string `json:"icon_url"` - IconUrlLarge string `json:"icon_url_large"` - IconDragUrl string `json:"icon_drag_url"` - - Name string - MarketName string `json:"market_name"` - MarketHashName string `json:"market_hash_name"` - - // Colors in hex, for example `B2B2B2` - NameColor string `json:"name_color"` - BackgroundColor string `json:"background_color"` - - Type string - - Tradable jsont.UintBool - Marketable jsont.UintBool - Commodity jsont.UintBool - MarketTradableRestriction uint32 `json:"market_tradable_restriction,string"` - - Descriptions DescriptionLines - Actions []*Action - // Application-specific data, like "def_index" and "quality" for TF2 - AppData map[string]string - Tags []*Tag -} - -type DescriptionLines []*DescriptionLine - -func (d *DescriptionLines) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte(`""`)) { - return nil - } - return json.Unmarshal(data, (*[]*DescriptionLine)(d)) -} - -type DescriptionLine struct { - Value string - Type *string // Is `html` for HTML descriptions - Color *string -} - -type Action struct { - Name string - Link string -} - -type AppInfo struct { - AppId uint32 - Name string - Icon string - Link string -} - -type Tag struct { - InternalName string `json:internal_name` - Name string - Category string - CategoryName string `json:category_name` -} diff --git a/vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory_apps.go b/vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory_apps.go deleted file mode 100644 index b652d551..00000000 --- a/vendor/github.com/Philipp15b/go-steam/economy/inventory/inventory_apps.go +++ /dev/null @@ -1,79 +0,0 @@ -package inventory - -import ( - "encoding/json" - "fmt" - "github.com/Philipp15b/go-steam/steamid" - "io/ioutil" - "net/http" - "regexp" - "strconv" -) - -type InventoryApps map[string]*InventoryApp - -func (i *InventoryApps) Get(appId uint32) (*InventoryApp, error) { - iMap := (map[string]*InventoryApp)(*i) - if inventoryApp, ok := iMap[strconv.FormatUint(uint64(appId), 10)]; ok { - return inventoryApp, nil - } - return nil, fmt.Errorf("inventory app not found") -} - -func (i *InventoryApps) ToMap() map[string]*InventoryApp { - return (map[string]*InventoryApp)(*i) -} - -type InventoryApp struct { - AppId uint32 - Name string - Icon string - Link string - AssetCount uint32 `json:"asset_count"` - InventoryLogo string `json:"inventory_logo"` - TradePermissions string `json:"trade_permissions"` - Contexts Contexts `json:"rgContexts"` -} - -type Contexts map[string]*Context - -func (c *Contexts) Get(contextId uint64) (*Context, error) { - cMap := (map[string]*Context)(*c) - if context, ok := cMap[strconv.FormatUint(contextId, 10)]; ok { - return context, nil - } - return nil, fmt.Errorf("context not found") -} - -func (c *Contexts) ToMap() map[string]*Context { - return (map[string]*Context)(*c) -} - -type Context struct { - ContextId uint64 `json:"id,string"` - AssetCount uint32 `json:"asset_count"` - Name string -} - -func GetInventoryApps(client *http.Client, steamId steamid.SteamId) (InventoryApps, error) { - resp, err := http.Get("http://steamcommunity.com/profiles/" + steamId.ToString() + "/inventory/") - if err != nil { - return nil, err - } - defer resp.Body.Close() - respBody, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - reg := regexp.MustCompile("var g_rgAppContextData = (.*?);") - inventoryAppsMatches := reg.FindSubmatch(respBody) - if inventoryAppsMatches == nil { - return nil, fmt.Errorf("profile inventory not found in steam response") - } - var inventoryApps InventoryApps - if err = json.Unmarshal(inventoryAppsMatches[1], &inventoryApps); err != nil { - return nil, err - } - - return inventoryApps, nil -} diff --git a/vendor/github.com/Philipp15b/go-steam/economy/inventory/own.go b/vendor/github.com/Philipp15b/go-steam/economy/inventory/own.go deleted file mode 100644 index 140b68ac..00000000 --- a/vendor/github.com/Philipp15b/go-steam/economy/inventory/own.go +++ /dev/null @@ -1,28 +0,0 @@ -package inventory - -import ( - "fmt" - "net/http" - "strconv" -) - -func GetPartialOwnInventory(client *http.Client, contextId uint64, appId uint32, start *uint) (*PartialInventory, error) { - // TODO: the "trading" parameter can be left off to return non-tradable items too - url := fmt.Sprintf("http://steamcommunity.com/my/inventory/json/%d/%d?trading=1", appId, contextId) - if start != nil { - url += "&start=" + strconv.FormatUint(uint64(*start), 10) - } - req, err := http.NewRequest("GET", url, nil) - if err != nil { - panic(err) - } - return DoInventoryRequest(client, req) -} - -func GetOwnInventory(client *http.Client, contextId uint64, appId uint32) (*Inventory, error) { - return GetFullInventory(func() (*PartialInventory, error) { - return GetPartialOwnInventory(client, contextId, appId, nil) - }, func(start uint) (*PartialInventory, error) { - return GetPartialOwnInventory(client, contextId, appId, &start) - }) -} diff --git a/vendor/github.com/Philipp15b/go-steam/economy/inventory/partial.go b/vendor/github.com/Philipp15b/go-steam/economy/inventory/partial.go deleted file mode 100644 index bcaad174..00000000 --- a/vendor/github.com/Philipp15b/go-steam/economy/inventory/partial.go +++ /dev/null @@ -1,91 +0,0 @@ -package inventory - -import ( - "bytes" - "encoding/json" - "errors" - "net/http" -) - -// A partial inventory as sent by the Steam API. -type PartialInventory struct { - Success bool - Error string - Inventory - More bool - MoreStart MoreStart `json:"more_start"` -} - -type MoreStart uint - -func (m *MoreStart) UnmarshalJSON(data []byte) error { - if bytes.Equal(data, []byte("false")) { - return nil - } - return json.Unmarshal(data, (*uint)(m)) -} - -func DoInventoryRequest(client *http.Client, req *http.Request) (*PartialInventory, error) { - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - inv := new(PartialInventory) - err = json.NewDecoder(resp.Body).Decode(inv) - if err != nil { - return nil, err - } - return inv, nil -} - -func GetFullInventory(getFirst func() (*PartialInventory, error), getNext func(start uint) (*PartialInventory, error)) (*Inventory, error) { - first, err := getFirst() - if err != nil { - return nil, err - } - if !first.Success { - return nil, errors.New("GetFullInventory API call failed: " + first.Error) - } - - result := &first.Inventory - var next *PartialInventory - for latest := first; latest.More; latest = next { - next, err := getNext(uint(latest.MoreStart)) - if err != nil { - return nil, err - } - if !next.Success { - return nil, errors.New("GetFullInventory API call failed: " + next.Error) - } - - result = Merge(result, &next.Inventory) - } - - return result, nil -} - -// Merges the given Inventory into a single Inventory. -// The given slice must have at least one element. The first element of the slice is used -// and modified. -func Merge(p ...*Inventory) *Inventory { - inv := p[0] - for idx, i := range p { - if idx == 0 { - continue - } - - for key, value := range i.Items { - inv.Items[key] = value - } - for key, value := range i.Descriptions { - inv.Descriptions[key] = value - } - for key, value := range i.Currencies { - inv.Currencies[key] = value - } - } - - return inv -} diff --git a/vendor/github.com/Philipp15b/go-steam/generator/generator.go b/vendor/github.com/Philipp15b/go-steam/generator/generator.go deleted file mode 100644 index 40522de7..00000000 --- a/vendor/github.com/Philipp15b/go-steam/generator/generator.go +++ /dev/null @@ -1,295 +0,0 @@ -/* -This program generates the protobuf and SteamLanguage files from the SteamKit data. -*/ -package main - -import ( - "bytes" - "fmt" - "go/ast" - "go/parser" - "go/token" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strings" -) - -var printCommands = false - -func main() { - args := strings.Join(os.Args[1:], " ") - - found := false - if strings.Contains(args, "clean") { - clean() - found = true - } - if strings.Contains(args, "steamlang") { - buildSteamLanguage() - found = true - } - if strings.Contains(args, "proto") { - buildProto() - found = true - } - - if !found { - os.Stderr.WriteString("Invalid target!\nAvailable targets: clean, proto, steamlang\n") - os.Exit(1) - } -} - -func clean() { - print("# Cleaning") - cleanGlob("../protocol/**/*.pb.go") - cleanGlob("../tf2/protocol/**/*.pb.go") - cleanGlob("../dota/protocol/**/*.pb.go") - - os.Remove("../protocol/steamlang/enums.go") - os.Remove("../protocol/steamlang/messages.go") -} - -func cleanGlob(pattern string) { - protos, _ := filepath.Glob(pattern) - for _, proto := range protos { - err := os.Remove(proto) - if err != nil { - panic(err) - } - } -} - -func buildSteamLanguage() { - print("# Building Steam Language") - exePath := "./GoSteamLanguageGenerator/bin/Debug/GoSteamLanguageGenerator.exe" - - if runtime.GOOS != "windows" { - execute("mono", exePath, "./SteamKit", "../protocol/steamlang") - } else { - execute(exePath, "./SteamKit", "../protocol/steamlang") - } - execute("gofmt", "-w", "../protocol/steamlang/enums.go", "../protocol/steamlang/messages.go") -} - -func buildProto() { - print("# Building Protobufs") - - buildProtoMap("steamclient", clientProtoFiles, "../protocol/protobuf") - buildProtoMap("tf", tf2ProtoFiles, "../tf2/protocol/protobuf") - buildProtoMap("dota", dotaProtoFiles, "../dota/protocol/protobuf") -} - -func buildProtoMap(srcSubdir string, files map[string]string, outDir string) { - os.MkdirAll(outDir, os.ModePerm) - for proto, out := range files { - full := filepath.Join(outDir, out) - compileProto("SteamKit/Resources/Protobufs", srcSubdir, proto, full) - fixProto(full) - } -} - -// Maps the proto files to their target files. -// See `SteamKit/Resources/Protobufs/steamclient/generate-base.bat` for reference. -var clientProtoFiles = map[string]string{ - "steammessages_base.proto": "base.pb.go", - "encrypted_app_ticket.proto": "app_ticket.pb.go", - - "steammessages_clientserver.proto": "client_server.pb.go", - "steammessages_clientserver_2.proto": "client_server_2.pb.go", - - "content_manifest.proto": "content_manifest.pb.go", - - "steammessages_unified_base.steamclient.proto": "unified/base.pb.go", - "steammessages_cloud.steamclient.proto": "unified/cloud.pb.go", - "steammessages_credentials.steamclient.proto": "unified/credentials.pb.go", - "steammessages_deviceauth.steamclient.proto": "unified/deviceauth.pb.go", - "steammessages_gamenotifications.steamclient.proto": "unified/gamenotifications.pb.go", - "steammessages_offline.steamclient.proto": "unified/offline.pb.go", - "steammessages_parental.steamclient.proto": "unified/parental.pb.go", - "steammessages_partnerapps.steamclient.proto": "unified/partnerapps.pb.go", - "steammessages_player.steamclient.proto": "unified/player.pb.go", - "steammessages_publishedfile.steamclient.proto": "unified/publishedfile.pb.go", -} - -var tf2ProtoFiles = map[string]string{ - "base_gcmessages.proto": "base.pb.go", - "econ_gcmessages.proto": "econ.pb.go", - "gcsdk_gcmessages.proto": "gcsdk.pb.go", - "tf_gcmessages.proto": "tf.pb.go", - "gcsystemmsgs.proto": "system.pb.go", -} - -var dotaProtoFiles = map[string]string{ - "base_gcmessages.proto": "base.pb.go", - "econ_gcmessages.proto": "econ.pb.go", - "gcsdk_gcmessages.proto": "gcsdk.pb.go", - "dota_gcmessages_common.proto": "dota_common.pb.go", - "dota_gcmessages_client.proto": "dota_client.pb.go", - "dota_gcmessages_client_fantasy.proto": "dota_client_fantasy.pb.go", - "gcsystemmsgs.proto": "system.pb.go", -} - -func compileProto(srcBase, srcSubdir, proto, target string) { - outDir, _ := filepath.Split(target) - err := os.MkdirAll(outDir, os.ModePerm) - if err != nil { - panic(err) - } - execute("protoc", "--go_out="+outDir, "-I="+srcBase+"/"+srcSubdir, "-I="+srcBase, filepath.Join(srcBase, srcSubdir, proto)) - out := strings.Replace(filepath.Join(outDir, proto), ".proto", ".pb.go", 1) - err = forceRename(out, target) - if err != nil { - panic(err) - } -} - -func forceRename(from, to string) error { - if from != to { - os.Remove(to) - } - return os.Rename(from, to) -} - -var pkgRegex = regexp.MustCompile(`(package \w+)`) -var pkgCommentRegex = regexp.MustCompile(`(?s)(\/\*.*?\*\/\n)package`) -var unusedImportCommentRegex = regexp.MustCompile("// discarding unused import .*\n") -var fileDescriptorVarRegex = regexp.MustCompile(`fileDescriptor\d+`) - -func fixProto(path string) { - // goprotobuf is really bad at dependencies, so we must fix them manually... - // It tries to load each dependency of a file as a seperate package (but in a very, very wrong way). - // Because we want some files in the same package, we'll remove those imports to local files. - - file, err := ioutil.ReadFile(path) - if err != nil { - panic(err) - } - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, path, file, parser.ImportsOnly) - if err != nil { - panic("Error parsing " + path + ": " + err.Error()) - } - - importsToRemove := make([]*ast.ImportSpec, 0) - for _, i := range f.Imports { - // We remove all local imports - if i.Path.Value == "\".\"" { - importsToRemove = append(importsToRemove, i) - } - } - - for _, itr := range importsToRemove { - // remove the package name from all types - file = bytes.Replace(file, []byte(itr.Name.Name+"."), []byte{}, -1) - // and remove the import itself - file = bytes.Replace(file, []byte(fmt.Sprintf("import %v %v\n", itr.Name.Name, itr.Path.Value)), []byte{}, -1) - } - - // remove the package comment because it just includes a list of all messages and - // collides not only with the other compiled protobuf files, but also our own documentation. - file = cutAllSubmatch(pkgCommentRegex, file, 1) - - // remove warnings - file = unusedImportCommentRegex.ReplaceAllLiteral(file, []byte{}) - - // fix the package name - file = pkgRegex.ReplaceAll(file, []byte("package "+inferPackageName(path))) - - // fix the google dependency; - // we just reuse the one from protoc-gen-go - file = bytes.Replace(file, []byte("google/protobuf"), []byte("github.com/golang/protobuf/protoc-gen-go/descriptor"), -1) - - // we need to prefix local variables created by protoc-gen-go so that they don't clash with others in the same package - filename := strings.Split(filepath.Base(path), ".")[0] - file = fileDescriptorVarRegex.ReplaceAllFunc(file, func(match []byte) []byte { - return []byte(filename + "_" + string(match)) - }) - - err = ioutil.WriteFile(path, file, os.ModePerm) - if err != nil { - panic(err) - } -} - -func inferPackageName(path string) string { - pieces := strings.Split(path, string(filepath.Separator)) - return pieces[len(pieces)-2] -} - -func cutAllSubmatch(r *regexp.Regexp, b []byte, n int) []byte { - i := r.FindSubmatchIndex(b) - return bytesCut(b, i[2*n], i[2*n+1]) -} - -// Removes the given section from the byte array -func bytesCut(b []byte, from, to int) []byte { - buf := new(bytes.Buffer) - buf.Write(b[:from]) - buf.Write(b[to:]) - return buf.Bytes() -} - -func print(text string) { os.Stdout.WriteString(text + "\n") } - -func printerr(text string) { os.Stderr.WriteString(text + "\n") } - -// This writer appends a "> " after every newline so that the outpout appears quoted. -type QuotedWriter struct { - w io.Writer - started bool -} - -func NewQuotedWriter(w io.Writer) *QuotedWriter { - return &QuotedWriter{w, false} -} - -func (w *QuotedWriter) Write(p []byte) (n int, err error) { - if !w.started { - _, err = w.w.Write([]byte("> ")) - if err != nil { - return n, err - } - w.started = true - } - - for i, c := range p { - if c == '\n' { - nw, err := w.w.Write(p[n : i+1]) - n += nw - if err != nil { - return n, err - } - - _, err = w.w.Write([]byte("> ")) - if err != nil { - return n, err - } - } - } - if n != len(p) { - nw, err := w.w.Write(p[n:len(p)]) - n += nw - return n, err - } - return -} - -func execute(command string, args ...string) { - if printCommands { - print(command + " " + strings.Join(args, " ")) - } - cmd := exec.Command(command, args...) - cmd.Stdout = NewQuotedWriter(os.Stdout) - cmd.Stderr = NewQuotedWriter(os.Stderr) - err := cmd.Run() - if err != nil { - printerr(err.Error()) - os.Exit(1) - } -} diff --git a/vendor/github.com/Philipp15b/go-steam/gsbot/gsbot.go b/vendor/github.com/Philipp15b/go-steam/gsbot/gsbot.go deleted file mode 100644 index ddcd1af6..00000000 --- a/vendor/github.com/Philipp15b/go-steam/gsbot/gsbot.go +++ /dev/null @@ -1,210 +0,0 @@ -// The GsBot package contains some useful utilites for working with the -// steam package. It implements authentication with sentries, server lists and -// logging messages and events. -// -// Every module is optional and requires an instance of the GsBot struct. -// Should a module have a `HandlePacket` method, you must register it with the -// steam.Client with `RegisterPacketHandler`. Any module with a `HandleEvent` -// method must be integrated into your event loop and should be called for each -// event you receive. -package gsbot - -import ( - "encoding/hex" - "encoding/json" - "fmt" - "io/ioutil" - "log" - "math/rand" - "net" - "os" - "path" - "reflect" - "time" - - "github.com/Philipp15b/go-steam" - "github.com/Philipp15b/go-steam/netutil" - "github.com/Philipp15b/go-steam/protocol" - "github.com/davecgh/go-spew/spew" -) - -// Base structure holding common data among GsBot modules. -type GsBot struct { - Client *steam.Client - Log *log.Logger -} - -// Creates a new GsBot with a new steam.Client where logs are written to stdout. -func Default() *GsBot { - return &GsBot{ - steam.NewClient(), - log.New(os.Stdout, "", 0), - } -} - -// This module handles authentication. It logs on automatically after a ConnectedEvent -// and saves the sentry data to a file which is also used for logon if available. -// If you're logging on for the first time Steam may require an authcode. You can then -// connect again with the new logon details. -type Auth struct { - bot *GsBot - details *LogOnDetails - sentryPath string - machineAuthHash []byte -} - -func NewAuth(bot *GsBot, details *LogOnDetails, sentryPath string) *Auth { - return &Auth{ - bot: bot, - details: details, - sentryPath: sentryPath, - } -} - -type LogOnDetails struct { - Username string - Password string - AuthCode string - TwoFactorCode string -} - -// This is called automatically after every ConnectedEvent, but must be called once again manually -// with an authcode if Steam requires it when logging on for the first time. -func (a *Auth) LogOn(details *LogOnDetails) { - a.details = details - sentry, err := ioutil.ReadFile(a.sentryPath) - if err != nil { - a.bot.Log.Printf("Error loading sentry file from path %v - This is normal if you're logging in for the first time.\n", a.sentryPath) - } - a.bot.Client.Auth.LogOn(&steam.LogOnDetails{ - Username: details.Username, - Password: details.Password, - SentryFileHash: sentry, - AuthCode: details.AuthCode, - TwoFactorCode: details.TwoFactorCode, - }) -} - -func (a *Auth) HandleEvent(event interface{}) { - switch e := event.(type) { - case *steam.ConnectedEvent: - a.LogOn(a.details) - case *steam.LoggedOnEvent: - a.bot.Log.Printf("Logged on (%v) with SteamId %v and account flags %v", e.Result, e.ClientSteamId, e.AccountFlags) - case *steam.MachineAuthUpdateEvent: - a.machineAuthHash = e.Hash - err := ioutil.WriteFile(a.sentryPath, e.Hash, 0666) - if err != nil { - panic(err) - } - } -} - -// This module saves the server list from ClientCMListEvent and uses -// it when you call `Connect()`. -type ServerList struct { - bot *GsBot - listPath string -} - -func NewServerList(bot *GsBot, listPath string) *ServerList { - return &ServerList{ - bot, - listPath, - } -} - -func (s *ServerList) HandleEvent(event interface{}) { - switch e := event.(type) { - case *steam.ClientCMListEvent: - d, err := json.Marshal(e.Addresses) - if err != nil { - panic(err) - } - err = ioutil.WriteFile(s.listPath, d, 0666) - if err != nil { - panic(err) - } - } -} - -func (s *ServerList) Connect() (bool, error) { - return s.ConnectBind(nil) -} - -func (s *ServerList) ConnectBind(laddr *net.TCPAddr) (bool, error) { - d, err := ioutil.ReadFile(s.listPath) - if err != nil { - s.bot.Log.Println("Connecting to random server.") - s.bot.Client.Connect() - return false, nil - } - var addrs []*netutil.PortAddr - err = json.Unmarshal(d, &addrs) - if err != nil { - return false, err - } - raddr := addrs[rand.Intn(len(addrs))] - s.bot.Log.Printf("Connecting to %v from server list\n", raddr) - s.bot.Client.ConnectToBind(raddr, laddr) - return true, nil -} - -// This module logs incoming packets and events to a directory. -type Debug struct { - packetId, eventId uint64 - bot *GsBot - base string -} - -func NewDebug(bot *GsBot, base string) (*Debug, error) { - base = path.Join(base, fmt.Sprint(time.Now().Unix())) - err := os.MkdirAll(path.Join(base, "events"), 0700) - if err != nil { - return nil, err - } - err = os.MkdirAll(path.Join(base, "packets"), 0700) - if err != nil { - return nil, err - } - return &Debug{ - 0, 0, - bot, - base, - }, nil -} - -func (d *Debug) HandlePacket(packet *protocol.Packet) { - d.packetId++ - name := path.Join(d.base, "packets", fmt.Sprintf("%d_%d_%s", time.Now().Unix(), d.packetId, packet.EMsg)) - - text := packet.String() + "\n\n" + hex.Dump(packet.Data) - err := ioutil.WriteFile(name+".txt", []byte(text), 0666) - if err != nil { - panic(err) - } - - err = ioutil.WriteFile(name+".bin", packet.Data, 0666) - if err != nil { - panic(err) - } -} - -func (d *Debug) HandleEvent(event interface{}) { - d.eventId++ - name := fmt.Sprintf("%d_%d_%s.txt", time.Now().Unix(), d.eventId, name(event)) - err := ioutil.WriteFile(path.Join(d.base, "events", name), []byte(spew.Sdump(event)), 0666) - if err != nil { - panic(err) - } -} - -func name(obj interface{}) string { - val := reflect.ValueOf(obj) - ind := reflect.Indirect(val) - if ind.IsValid() { - return ind.Type().Name() - } else { - return val.Type().Name() - } -} diff --git a/vendor/github.com/Philipp15b/go-steam/gsbot/gsbot/gsbot.go b/vendor/github.com/Philipp15b/go-steam/gsbot/gsbot/gsbot.go deleted file mode 100644 index 069dca50..00000000 --- a/vendor/github.com/Philipp15b/go-steam/gsbot/gsbot/gsbot.go +++ /dev/null @@ -1,56 +0,0 @@ -// A simple example that uses the modules from the gsbot package and go-steam to log on -// to the Steam network. -// -// The command expects log on data, optionally with an auth code: -// -// gsbot [username] [password] -// gsbot [username] [password] [authcode] -package main - -import ( - "fmt" - "os" - - "github.com/Philipp15b/go-steam" - "github.com/Philipp15b/go-steam/gsbot" - "github.com/Philipp15b/go-steam/protocol/steamlang" -) - -func main() { - if len(os.Args) < 3 { - fmt.Println("gsbot example\nusage: \n\tgsbot [username] [password] [authcode]") - return - } - authcode := "" - if len(os.Args) > 3 { - authcode = os.Args[3] - } - - bot := gsbot.Default() - client := bot.Client - auth := gsbot.NewAuth(bot, &gsbot.LogOnDetails{ - os.Args[1], - os.Args[2], - authcode, - }, "sentry.bin") - debug, err := gsbot.NewDebug(bot, "debug") - if err != nil { - panic(err) - } - client.RegisterPacketHandler(debug) - serverList := gsbot.NewServerList(bot, "serverlist.json") - serverList.Connect() - - for event := range client.Events() { - auth.HandleEvent(event) - debug.HandleEvent(event) - serverList.HandleEvent(event) - - switch e := event.(type) { - case error: - fmt.Printf("Error: %v", e) - case *steam.LoggedOnEvent: - client.Social.SetPersonaState(steamlang.EPersonaState_Online) - } - } -} diff --git a/vendor/github.com/Philipp15b/go-steam/jsont/jsont.go b/vendor/github.com/Philipp15b/go-steam/jsont/jsont.go deleted file mode 100644 index 0927f983..00000000 --- a/vendor/github.com/Philipp15b/go-steam/jsont/jsont.go +++ /dev/null @@ -1,19 +0,0 @@ -// Includes helper types for working with JSON data -package jsont - -import ( - "encoding/json" -) - -// A boolean value that can be unmarshaled from a number in JSON. -type UintBool bool - -func (u *UintBool) UnmarshalJSON(data []byte) error { - var n uint - err := json.Unmarshal(data, &n) - if err != nil { - return err - } - *u = n != 0 - return nil -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/base.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/base.pb.go deleted file mode 100644 index ad8394a1..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/base.pb.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_unified_base.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type EProtoExecutionSite int32 - -const ( - EProtoExecutionSite_k_EProtoExecutionSiteUnknown EProtoExecutionSite = 0 - EProtoExecutionSite_k_EProtoExecutionSiteSteamClient EProtoExecutionSite = 2 -) - -var EProtoExecutionSite_name = map[int32]string{ - 0: "k_EProtoExecutionSiteUnknown", - 2: "k_EProtoExecutionSiteSteamClient", -} -var EProtoExecutionSite_value = map[string]int32{ - "k_EProtoExecutionSiteUnknown": 0, - "k_EProtoExecutionSiteSteamClient": 2, -} - -func (x EProtoExecutionSite) Enum() *EProtoExecutionSite { - p := new(EProtoExecutionSite) - *p = x - return p -} -func (x EProtoExecutionSite) String() string { - return proto.EnumName(EProtoExecutionSite_name, int32(x)) -} -func (x *EProtoExecutionSite) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EProtoExecutionSite_value, data, "EProtoExecutionSite") - if err != nil { - return err - } - *x = EProtoExecutionSite(value) - return nil -} -func (EProtoExecutionSite) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{0} } - -type NoResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *NoResponse) Reset() { *m = NoResponse{} } -func (m *NoResponse) String() string { return proto.CompactTextString(m) } -func (*NoResponse) ProtoMessage() {} -func (*NoResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{0} } - -var E_Description = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 50000, - Name: "description", - Tag: "bytes,50000,opt,name=description", -} - -var E_ServiceDescription = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.ServiceOptions)(nil), - ExtensionType: (*string)(nil), - Field: 50000, - Name: "service_description", - Tag: "bytes,50000,opt,name=service_description", -} - -var E_ServiceExecutionSite = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.ServiceOptions)(nil), - ExtensionType: (*EProtoExecutionSite)(nil), - Field: 50008, - Name: "service_execution_site", - Tag: "varint,50008,opt,name=service_execution_site,enum=EProtoExecutionSite,def=0", -} - -var E_MethodDescription = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MethodOptions)(nil), - ExtensionType: (*string)(nil), - Field: 50000, - Name: "method_description", - Tag: "bytes,50000,opt,name=method_description", -} - -var E_EnumDescription = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumOptions)(nil), - ExtensionType: (*string)(nil), - Field: 50000, - Name: "enum_description", - Tag: "bytes,50000,opt,name=enum_description", -} - -var E_EnumValueDescription = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumValueOptions)(nil), - ExtensionType: (*string)(nil), - Field: 50000, - Name: "enum_value_description", - Tag: "bytes,50000,opt,name=enum_value_description", -} - -func init() { - proto.RegisterType((*NoResponse)(nil), "NoResponse") - proto.RegisterEnum("EProtoExecutionSite", EProtoExecutionSite_name, EProtoExecutionSite_value) - proto.RegisterExtension(E_Description) - proto.RegisterExtension(E_ServiceDescription) - proto.RegisterExtension(E_ServiceExecutionSite) - proto.RegisterExtension(E_MethodDescription) - proto.RegisterExtension(E_EnumDescription) - proto.RegisterExtension(E_EnumValueDescription) -} - -var base_fileDescriptor0 = []byte{ - // 306 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x90, 0x4d, 0x4b, 0xc3, 0x40, - 0x10, 0x86, 0x1b, 0xc5, 0x83, 0xa3, 0x48, 0x48, 0xa5, 0x88, 0x54, 0x8d, 0xe2, 0x41, 0x44, 0xb6, - 0x20, 0x1e, 0x24, 0x88, 0x07, 0x4b, 0xc4, 0x8b, 0x1f, 0x18, 0xf4, 0x26, 0x21, 0x4d, 0xa6, 0x71, - 0x69, 0xb2, 0x1b, 0xb2, 0xbb, 0xd5, 0xa3, 0x27, 0x7f, 0x9f, 0x47, 0x7f, 0x8e, 0xcd, 0x86, 0x80, - 0xf9, 0x40, 0x8f, 0xc9, 0xfb, 0x3e, 0xb3, 0xcf, 0x0c, 0x9c, 0x08, 0x89, 0x41, 0x9a, 0xa2, 0x10, - 0x41, 0x8c, 0xc2, 0x57, 0x8c, 0x4e, 0x29, 0x46, 0xfe, 0x24, 0x10, 0x48, 0x74, 0x14, 0x26, 0x14, - 0x99, 0x24, 0x59, 0xce, 0x25, 0xdf, 0xb6, 0x63, 0xce, 0xe3, 0x04, 0x47, 0xfa, 0x6b, 0xa2, 0xa6, - 0xa3, 0x08, 0x45, 0x98, 0xd3, 0x4c, 0xf2, 0xbc, 0x6c, 0x1c, 0xac, 0x03, 0xdc, 0xf1, 0x47, 0x14, - 0x19, 0x67, 0x02, 0x8f, 0x5f, 0xa0, 0xef, 0x3e, 0x14, 0xff, 0xdd, 0x77, 0x0c, 0x95, 0xa4, 0x9c, - 0x79, 0x54, 0xa2, 0x65, 0xc3, 0x70, 0xe6, 0x77, 0x04, 0x4f, 0x6c, 0xc6, 0xf8, 0x1b, 0x33, 0x7b, - 0xd6, 0x21, 0xd8, 0x9d, 0x0d, 0xaf, 0x50, 0x1a, 0x6b, 0x25, 0x73, 0xc9, 0x39, 0x83, 0xb5, 0x4a, - 0x60, 0x91, 0x5b, 0x3b, 0xa4, 0xd4, 0x23, 0x95, 0x1e, 0xb9, 0xa6, 0x98, 0x44, 0xf7, 0x3a, 0x15, - 0x5b, 0x5f, 0x9f, 0xcb, 0xb6, 0x71, 0xb4, 0xea, 0x5c, 0x42, 0x5f, 0x60, 0x3e, 0xa7, 0x21, 0xfa, - 0xbf, 0xe9, 0xbd, 0x16, 0xed, 0x95, 0xad, 0x26, 0xaf, 0x60, 0x50, 0xf1, 0x58, 0xb9, 0xf9, 0xa2, - 0xd8, 0xeb, 0xdf, 0x11, 0xdf, 0x7a, 0xc4, 0xc6, 0xe9, 0x26, 0xe9, 0xd8, 0xcd, 0xf9, 0xf3, 0x28, - 0xce, 0x05, 0x58, 0x29, 0xca, 0x57, 0x1e, 0xd5, 0xac, 0x77, 0x5b, 0x4f, 0xde, 0xea, 0x52, 0x53, - 0xfa, 0x1c, 0x4c, 0x64, 0x2a, 0xad, 0xb1, 0xc3, 0x16, 0xeb, 0x2e, 0x2a, 0x4d, 0x72, 0x0c, 0x03, - 0x4d, 0xce, 0x83, 0x44, 0xd5, 0x2f, 0xb6, 0xdf, 0xc9, 0x3f, 0x17, 0xbd, 0xc6, 0x90, 0xab, 0x95, - 0x1b, 0xe3, 0xc3, 0xe8, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xf6, 0x07, 0xbb, 0x6e, 0x02, - 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/cloud.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/cloud.pb.go deleted file mode 100644 index d42a8cf7..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/cloud.pb.go +++ /dev/null @@ -1,1424 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_cloud.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type CCloud_GetUploadServerInfo_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_GetUploadServerInfo_Request) Reset() { *m = CCloud_GetUploadServerInfo_Request{} } -func (m *CCloud_GetUploadServerInfo_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_GetUploadServerInfo_Request) ProtoMessage() {} -func (*CCloud_GetUploadServerInfo_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{0} -} - -func (m *CCloud_GetUploadServerInfo_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -type CCloud_GetUploadServerInfo_Response struct { - ServerUrl *string `protobuf:"bytes,1,opt,name=server_url" json:"server_url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_GetUploadServerInfo_Response) Reset() { *m = CCloud_GetUploadServerInfo_Response{} } -func (m *CCloud_GetUploadServerInfo_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_GetUploadServerInfo_Response) ProtoMessage() {} -func (*CCloud_GetUploadServerInfo_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{1} -} - -func (m *CCloud_GetUploadServerInfo_Response) GetServerUrl() string { - if m != nil && m.ServerUrl != nil { - return *m.ServerUrl - } - return "" -} - -type CCloud_BeginHTTPUpload_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - FileSize *uint32 `protobuf:"varint,2,opt,name=file_size" json:"file_size,omitempty"` - Filename *string `protobuf:"bytes,3,opt,name=filename" json:"filename,omitempty"` - FileSha *string `protobuf:"bytes,4,opt,name=file_sha" json:"file_sha,omitempty"` - IsPublic *bool `protobuf:"varint,5,opt,name=is_public" json:"is_public,omitempty"` - PlatformsToSync []string `protobuf:"bytes,6,rep,name=platforms_to_sync" json:"platforms_to_sync,omitempty"` - RequestHeadersNames []string `protobuf:"bytes,7,rep,name=request_headers_names" json:"request_headers_names,omitempty"` - RequestHeadersValues []string `protobuf:"bytes,8,rep,name=request_headers_values" json:"request_headers_values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_BeginHTTPUpload_Request) Reset() { *m = CCloud_BeginHTTPUpload_Request{} } -func (m *CCloud_BeginHTTPUpload_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_BeginHTTPUpload_Request) ProtoMessage() {} -func (*CCloud_BeginHTTPUpload_Request) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{2} } - -func (m *CCloud_BeginHTTPUpload_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_BeginHTTPUpload_Request) GetFileSize() uint32 { - if m != nil && m.FileSize != nil { - return *m.FileSize - } - return 0 -} - -func (m *CCloud_BeginHTTPUpload_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CCloud_BeginHTTPUpload_Request) GetFileSha() string { - if m != nil && m.FileSha != nil { - return *m.FileSha - } - return "" -} - -func (m *CCloud_BeginHTTPUpload_Request) GetIsPublic() bool { - if m != nil && m.IsPublic != nil { - return *m.IsPublic - } - return false -} - -func (m *CCloud_BeginHTTPUpload_Request) GetPlatformsToSync() []string { - if m != nil { - return m.PlatformsToSync - } - return nil -} - -func (m *CCloud_BeginHTTPUpload_Request) GetRequestHeadersNames() []string { - if m != nil { - return m.RequestHeadersNames - } - return nil -} - -func (m *CCloud_BeginHTTPUpload_Request) GetRequestHeadersValues() []string { - if m != nil { - return m.RequestHeadersValues - } - return nil -} - -type CCloud_BeginHTTPUpload_Response struct { - Ugcid *uint64 `protobuf:"fixed64,1,opt,name=ugcid" json:"ugcid,omitempty"` - Timestamp *uint32 `protobuf:"fixed32,2,opt,name=timestamp" json:"timestamp,omitempty"` - UrlHost *string `protobuf:"bytes,3,opt,name=url_host" json:"url_host,omitempty"` - UrlPath *string `protobuf:"bytes,4,opt,name=url_path" json:"url_path,omitempty"` - UseHttps *bool `protobuf:"varint,5,opt,name=use_https" json:"use_https,omitempty"` - RequestHeaders []*CCloud_BeginHTTPUpload_Response_HTTPHeaders `protobuf:"bytes,6,rep,name=request_headers" json:"request_headers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_BeginHTTPUpload_Response) Reset() { *m = CCloud_BeginHTTPUpload_Response{} } -func (m *CCloud_BeginHTTPUpload_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_BeginHTTPUpload_Response) ProtoMessage() {} -func (*CCloud_BeginHTTPUpload_Response) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{3} } - -func (m *CCloud_BeginHTTPUpload_Response) GetUgcid() uint64 { - if m != nil && m.Ugcid != nil { - return *m.Ugcid - } - return 0 -} - -func (m *CCloud_BeginHTTPUpload_Response) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CCloud_BeginHTTPUpload_Response) GetUrlHost() string { - if m != nil && m.UrlHost != nil { - return *m.UrlHost - } - return "" -} - -func (m *CCloud_BeginHTTPUpload_Response) GetUrlPath() string { - if m != nil && m.UrlPath != nil { - return *m.UrlPath - } - return "" -} - -func (m *CCloud_BeginHTTPUpload_Response) GetUseHttps() bool { - if m != nil && m.UseHttps != nil { - return *m.UseHttps - } - return false -} - -func (m *CCloud_BeginHTTPUpload_Response) GetRequestHeaders() []*CCloud_BeginHTTPUpload_Response_HTTPHeaders { - if m != nil { - return m.RequestHeaders - } - return nil -} - -type CCloud_BeginHTTPUpload_Response_HTTPHeaders struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_BeginHTTPUpload_Response_HTTPHeaders) Reset() { - *m = CCloud_BeginHTTPUpload_Response_HTTPHeaders{} -} -func (m *CCloud_BeginHTTPUpload_Response_HTTPHeaders) String() string { - return proto.CompactTextString(m) -} -func (*CCloud_BeginHTTPUpload_Response_HTTPHeaders) ProtoMessage() {} -func (*CCloud_BeginHTTPUpload_Response_HTTPHeaders) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{3, 0} -} - -func (m *CCloud_BeginHTTPUpload_Response_HTTPHeaders) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CCloud_BeginHTTPUpload_Response_HTTPHeaders) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CCloud_CommitHTTPUpload_Request struct { - TransferSucceeded *bool `protobuf:"varint,1,opt,name=transfer_succeeded" json:"transfer_succeeded,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - FileSha *string `protobuf:"bytes,3,opt,name=file_sha" json:"file_sha,omitempty"` - Filename *string `protobuf:"bytes,4,opt,name=filename" json:"filename,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_CommitHTTPUpload_Request) Reset() { *m = CCloud_CommitHTTPUpload_Request{} } -func (m *CCloud_CommitHTTPUpload_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_CommitHTTPUpload_Request) ProtoMessage() {} -func (*CCloud_CommitHTTPUpload_Request) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{4} } - -func (m *CCloud_CommitHTTPUpload_Request) GetTransferSucceeded() bool { - if m != nil && m.TransferSucceeded != nil { - return *m.TransferSucceeded - } - return false -} - -func (m *CCloud_CommitHTTPUpload_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_CommitHTTPUpload_Request) GetFileSha() string { - if m != nil && m.FileSha != nil { - return *m.FileSha - } - return "" -} - -func (m *CCloud_CommitHTTPUpload_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -type CCloud_CommitHTTPUpload_Response struct { - FileCommitted *bool `protobuf:"varint,1,opt,name=file_committed" json:"file_committed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_CommitHTTPUpload_Response) Reset() { *m = CCloud_CommitHTTPUpload_Response{} } -func (m *CCloud_CommitHTTPUpload_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_CommitHTTPUpload_Response) ProtoMessage() {} -func (*CCloud_CommitHTTPUpload_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{5} -} - -func (m *CCloud_CommitHTTPUpload_Response) GetFileCommitted() bool { - if m != nil && m.FileCommitted != nil { - return *m.FileCommitted - } - return false -} - -type CCloud_GetFileDetails_Request struct { - Ugcid *uint64 `protobuf:"varint,1,opt,name=ugcid" json:"ugcid,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_GetFileDetails_Request) Reset() { *m = CCloud_GetFileDetails_Request{} } -func (m *CCloud_GetFileDetails_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_GetFileDetails_Request) ProtoMessage() {} -func (*CCloud_GetFileDetails_Request) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{6} } - -func (m *CCloud_GetFileDetails_Request) GetUgcid() uint64 { - if m != nil && m.Ugcid != nil { - return *m.Ugcid - } - return 0 -} - -func (m *CCloud_GetFileDetails_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -type CCloud_UserFile struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Ugcid *uint64 `protobuf:"varint,2,opt,name=ugcid" json:"ugcid,omitempty"` - Filename *string `protobuf:"bytes,3,opt,name=filename" json:"filename,omitempty"` - Timestamp *uint64 `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"` - FileSize *uint32 `protobuf:"varint,5,opt,name=file_size" json:"file_size,omitempty"` - Url *string `protobuf:"bytes,6,opt,name=url" json:"url,omitempty"` - SteamidCreator *uint64 `protobuf:"fixed64,7,opt,name=steamid_creator" json:"steamid_creator,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_UserFile) Reset() { *m = CCloud_UserFile{} } -func (m *CCloud_UserFile) String() string { return proto.CompactTextString(m) } -func (*CCloud_UserFile) ProtoMessage() {} -func (*CCloud_UserFile) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{7} } - -func (m *CCloud_UserFile) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_UserFile) GetUgcid() uint64 { - if m != nil && m.Ugcid != nil { - return *m.Ugcid - } - return 0 -} - -func (m *CCloud_UserFile) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CCloud_UserFile) GetTimestamp() uint64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CCloud_UserFile) GetFileSize() uint32 { - if m != nil && m.FileSize != nil { - return *m.FileSize - } - return 0 -} - -func (m *CCloud_UserFile) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *CCloud_UserFile) GetSteamidCreator() uint64 { - if m != nil && m.SteamidCreator != nil { - return *m.SteamidCreator - } - return 0 -} - -type CCloud_GetFileDetails_Response struct { - Details *CCloud_UserFile `protobuf:"bytes,1,opt,name=details" json:"details,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_GetFileDetails_Response) Reset() { *m = CCloud_GetFileDetails_Response{} } -func (m *CCloud_GetFileDetails_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_GetFileDetails_Response) ProtoMessage() {} -func (*CCloud_GetFileDetails_Response) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{8} } - -func (m *CCloud_GetFileDetails_Response) GetDetails() *CCloud_UserFile { - if m != nil { - return m.Details - } - return nil -} - -type CCloud_EnumerateUserFiles_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - ExtendedDetails *bool `protobuf:"varint,2,opt,name=extended_details" json:"extended_details,omitempty"` - Count *uint32 `protobuf:"varint,3,opt,name=count" json:"count,omitempty"` - StartIndex *uint32 `protobuf:"varint,4,opt,name=start_index" json:"start_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_EnumerateUserFiles_Request) Reset() { *m = CCloud_EnumerateUserFiles_Request{} } -func (m *CCloud_EnumerateUserFiles_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_EnumerateUserFiles_Request) ProtoMessage() {} -func (*CCloud_EnumerateUserFiles_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{9} -} - -func (m *CCloud_EnumerateUserFiles_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_EnumerateUserFiles_Request) GetExtendedDetails() bool { - if m != nil && m.ExtendedDetails != nil { - return *m.ExtendedDetails - } - return false -} - -func (m *CCloud_EnumerateUserFiles_Request) GetCount() uint32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -func (m *CCloud_EnumerateUserFiles_Request) GetStartIndex() uint32 { - if m != nil && m.StartIndex != nil { - return *m.StartIndex - } - return 0 -} - -type CCloud_EnumerateUserFiles_Response struct { - Files []*CCloud_UserFile `protobuf:"bytes,1,rep,name=files" json:"files,omitempty"` - TotalFiles *uint32 `protobuf:"varint,2,opt,name=total_files" json:"total_files,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_EnumerateUserFiles_Response) Reset() { *m = CCloud_EnumerateUserFiles_Response{} } -func (m *CCloud_EnumerateUserFiles_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_EnumerateUserFiles_Response) ProtoMessage() {} -func (*CCloud_EnumerateUserFiles_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{10} -} - -func (m *CCloud_EnumerateUserFiles_Response) GetFiles() []*CCloud_UserFile { - if m != nil { - return m.Files - } - return nil -} - -func (m *CCloud_EnumerateUserFiles_Response) GetTotalFiles() uint32 { - if m != nil && m.TotalFiles != nil { - return *m.TotalFiles - } - return 0 -} - -type CCloud_Delete_Request struct { - Filename *string `protobuf:"bytes,1,opt,name=filename" json:"filename,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_Delete_Request) Reset() { *m = CCloud_Delete_Request{} } -func (m *CCloud_Delete_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_Delete_Request) ProtoMessage() {} -func (*CCloud_Delete_Request) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{11} } - -func (m *CCloud_Delete_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CCloud_Delete_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -type CCloud_Delete_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_Delete_Response) Reset() { *m = CCloud_Delete_Response{} } -func (m *CCloud_Delete_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_Delete_Response) ProtoMessage() {} -func (*CCloud_Delete_Response) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{12} } - -type CCloud_GetClientEncryptionKey_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_GetClientEncryptionKey_Request) Reset() { *m = CCloud_GetClientEncryptionKey_Request{} } -func (m *CCloud_GetClientEncryptionKey_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_GetClientEncryptionKey_Request) ProtoMessage() {} -func (*CCloud_GetClientEncryptionKey_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{13} -} - -type CCloud_GetClientEncryptionKey_Response struct { - Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Crc *int32 `protobuf:"varint,2,opt,name=crc" json:"crc,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_GetClientEncryptionKey_Response) Reset() { - *m = CCloud_GetClientEncryptionKey_Response{} -} -func (m *CCloud_GetClientEncryptionKey_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_GetClientEncryptionKey_Response) ProtoMessage() {} -func (*CCloud_GetClientEncryptionKey_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{14} -} - -func (m *CCloud_GetClientEncryptionKey_Response) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *CCloud_GetClientEncryptionKey_Response) GetCrc() int32 { - if m != nil && m.Crc != nil { - return *m.Crc - } - return 0 -} - -type CCloud_CDNReport_Notification struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - Url *string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` - Success *bool `protobuf:"varint,3,opt,name=success" json:"success,omitempty"` - HttpStatusCode *uint32 `protobuf:"varint,4,opt,name=http_status_code" json:"http_status_code,omitempty"` - ExpectedBytes *uint64 `protobuf:"varint,5,opt,name=expected_bytes" json:"expected_bytes,omitempty"` - ReceivedBytes *uint64 `protobuf:"varint,6,opt,name=received_bytes" json:"received_bytes,omitempty"` - Duration *uint32 `protobuf:"varint,7,opt,name=duration" json:"duration,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_CDNReport_Notification) Reset() { *m = CCloud_CDNReport_Notification{} } -func (m *CCloud_CDNReport_Notification) String() string { return proto.CompactTextString(m) } -func (*CCloud_CDNReport_Notification) ProtoMessage() {} -func (*CCloud_CDNReport_Notification) Descriptor() ([]byte, []int) { return cloud_fileDescriptor0, []int{15} } - -func (m *CCloud_CDNReport_Notification) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CCloud_CDNReport_Notification) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *CCloud_CDNReport_Notification) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *CCloud_CDNReport_Notification) GetHttpStatusCode() uint32 { - if m != nil && m.HttpStatusCode != nil { - return *m.HttpStatusCode - } - return 0 -} - -func (m *CCloud_CDNReport_Notification) GetExpectedBytes() uint64 { - if m != nil && m.ExpectedBytes != nil { - return *m.ExpectedBytes - } - return 0 -} - -func (m *CCloud_CDNReport_Notification) GetReceivedBytes() uint64 { - if m != nil && m.ReceivedBytes != nil { - return *m.ReceivedBytes - } - return 0 -} - -func (m *CCloud_CDNReport_Notification) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -type CCloud_ExternalStorageTransferReport_Notification struct { - Host *string `protobuf:"bytes,1,opt,name=host" json:"host,omitempty"` - Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - IsUpload *bool `protobuf:"varint,3,opt,name=is_upload" json:"is_upload,omitempty"` - Success *bool `protobuf:"varint,4,opt,name=success" json:"success,omitempty"` - HttpStatusCode *uint32 `protobuf:"varint,5,opt,name=http_status_code" json:"http_status_code,omitempty"` - BytesExpected *uint64 `protobuf:"varint,6,opt,name=bytes_expected" json:"bytes_expected,omitempty"` - BytesActual *uint64 `protobuf:"varint,7,opt,name=bytes_actual" json:"bytes_actual,omitempty"` - DurationMs *uint32 `protobuf:"varint,8,opt,name=duration_ms" json:"duration_ms,omitempty"` - Cellid *uint32 `protobuf:"varint,9,opt,name=cellid" json:"cellid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) Reset() { - *m = CCloud_ExternalStorageTransferReport_Notification{} -} -func (m *CCloud_ExternalStorageTransferReport_Notification) String() string { - return proto.CompactTextString(m) -} -func (*CCloud_ExternalStorageTransferReport_Notification) ProtoMessage() {} -func (*CCloud_ExternalStorageTransferReport_Notification) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{16} -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetHost() string { - if m != nil && m.Host != nil { - return *m.Host - } - return "" -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetPath() string { - if m != nil && m.Path != nil { - return *m.Path - } - return "" -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetIsUpload() bool { - if m != nil && m.IsUpload != nil { - return *m.IsUpload - } - return false -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetHttpStatusCode() uint32 { - if m != nil && m.HttpStatusCode != nil { - return *m.HttpStatusCode - } - return 0 -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetBytesExpected() uint64 { - if m != nil && m.BytesExpected != nil { - return *m.BytesExpected - } - return 0 -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetBytesActual() uint64 { - if m != nil && m.BytesActual != nil { - return *m.BytesActual - } - return 0 -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetDurationMs() uint32 { - if m != nil && m.DurationMs != nil { - return *m.DurationMs - } - return 0 -} - -func (m *CCloud_ExternalStorageTransferReport_Notification) GetCellid() uint32 { - if m != nil && m.Cellid != nil { - return *m.Cellid - } - return 0 -} - -type CCloud_ClientBeginFileUpload_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - FileSize *uint32 `protobuf:"varint,2,opt,name=file_size" json:"file_size,omitempty"` - RawFileSize *uint32 `protobuf:"varint,3,opt,name=raw_file_size" json:"raw_file_size,omitempty"` - FileSha []byte `protobuf:"bytes,4,opt,name=file_sha" json:"file_sha,omitempty"` - TimeStamp *uint64 `protobuf:"varint,5,opt,name=time_stamp" json:"time_stamp,omitempty"` - Filename *string `protobuf:"bytes,6,opt,name=filename" json:"filename,omitempty"` - PlatformsToSync *uint32 `protobuf:"varint,7,opt,name=platforms_to_sync,def=4294967295" json:"platforms_to_sync,omitempty"` - CellId *uint32 `protobuf:"varint,9,opt,name=cell_id" json:"cell_id,omitempty"` - CanEncrypt *bool `protobuf:"varint,10,opt,name=can_encrypt" json:"can_encrypt,omitempty"` - IsSharedFile *bool `protobuf:"varint,11,opt,name=is_shared_file" json:"is_shared_file,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientBeginFileUpload_Request) Reset() { *m = CCloud_ClientBeginFileUpload_Request{} } -func (m *CCloud_ClientBeginFileUpload_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientBeginFileUpload_Request) ProtoMessage() {} -func (*CCloud_ClientBeginFileUpload_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{17} -} - -const Default_CCloud_ClientBeginFileUpload_Request_PlatformsToSync uint32 = 4294967295 - -func (m *CCloud_ClientBeginFileUpload_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetFileSize() uint32 { - if m != nil && m.FileSize != nil { - return *m.FileSize - } - return 0 -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetRawFileSize() uint32 { - if m != nil && m.RawFileSize != nil { - return *m.RawFileSize - } - return 0 -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetFileSha() []byte { - if m != nil { - return m.FileSha - } - return nil -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetTimeStamp() uint64 { - if m != nil && m.TimeStamp != nil { - return *m.TimeStamp - } - return 0 -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetPlatformsToSync() uint32 { - if m != nil && m.PlatformsToSync != nil { - return *m.PlatformsToSync - } - return Default_CCloud_ClientBeginFileUpload_Request_PlatformsToSync -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetCellId() uint32 { - if m != nil && m.CellId != nil { - return *m.CellId - } - return 0 -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetCanEncrypt() bool { - if m != nil && m.CanEncrypt != nil { - return *m.CanEncrypt - } - return false -} - -func (m *CCloud_ClientBeginFileUpload_Request) GetIsSharedFile() bool { - if m != nil && m.IsSharedFile != nil { - return *m.IsSharedFile - } - return false -} - -type ClientCloudFileUploadBlockDetails struct { - UrlHost *string `protobuf:"bytes,1,opt,name=url_host" json:"url_host,omitempty"` - UrlPath *string `protobuf:"bytes,2,opt,name=url_path" json:"url_path,omitempty"` - UseHttps *bool `protobuf:"varint,3,opt,name=use_https" json:"use_https,omitempty"` - HttpMethod *int32 `protobuf:"varint,4,opt,name=http_method" json:"http_method,omitempty"` - RequestHeaders []*ClientCloudFileUploadBlockDetails_HTTPHeaders `protobuf:"bytes,5,rep,name=request_headers" json:"request_headers,omitempty"` - BlockOffset *uint64 `protobuf:"varint,6,opt,name=block_offset" json:"block_offset,omitempty"` - BlockLength *uint32 `protobuf:"varint,7,opt,name=block_length" json:"block_length,omitempty"` - ExplicitBodyData []byte `protobuf:"bytes,8,opt,name=explicit_body_data" json:"explicit_body_data,omitempty"` - MayParallelize *bool `protobuf:"varint,9,opt,name=may_parallelize" json:"may_parallelize,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ClientCloudFileUploadBlockDetails) Reset() { *m = ClientCloudFileUploadBlockDetails{} } -func (m *ClientCloudFileUploadBlockDetails) String() string { return proto.CompactTextString(m) } -func (*ClientCloudFileUploadBlockDetails) ProtoMessage() {} -func (*ClientCloudFileUploadBlockDetails) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{18} -} - -func (m *ClientCloudFileUploadBlockDetails) GetUrlHost() string { - if m != nil && m.UrlHost != nil { - return *m.UrlHost - } - return "" -} - -func (m *ClientCloudFileUploadBlockDetails) GetUrlPath() string { - if m != nil && m.UrlPath != nil { - return *m.UrlPath - } - return "" -} - -func (m *ClientCloudFileUploadBlockDetails) GetUseHttps() bool { - if m != nil && m.UseHttps != nil { - return *m.UseHttps - } - return false -} - -func (m *ClientCloudFileUploadBlockDetails) GetHttpMethod() int32 { - if m != nil && m.HttpMethod != nil { - return *m.HttpMethod - } - return 0 -} - -func (m *ClientCloudFileUploadBlockDetails) GetRequestHeaders() []*ClientCloudFileUploadBlockDetails_HTTPHeaders { - if m != nil { - return m.RequestHeaders - } - return nil -} - -func (m *ClientCloudFileUploadBlockDetails) GetBlockOffset() uint64 { - if m != nil && m.BlockOffset != nil { - return *m.BlockOffset - } - return 0 -} - -func (m *ClientCloudFileUploadBlockDetails) GetBlockLength() uint32 { - if m != nil && m.BlockLength != nil { - return *m.BlockLength - } - return 0 -} - -func (m *ClientCloudFileUploadBlockDetails) GetExplicitBodyData() []byte { - if m != nil { - return m.ExplicitBodyData - } - return nil -} - -func (m *ClientCloudFileUploadBlockDetails) GetMayParallelize() bool { - if m != nil && m.MayParallelize != nil { - return *m.MayParallelize - } - return false -} - -type ClientCloudFileUploadBlockDetails_HTTPHeaders struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ClientCloudFileUploadBlockDetails_HTTPHeaders) Reset() { - *m = ClientCloudFileUploadBlockDetails_HTTPHeaders{} -} -func (m *ClientCloudFileUploadBlockDetails_HTTPHeaders) String() string { - return proto.CompactTextString(m) -} -func (*ClientCloudFileUploadBlockDetails_HTTPHeaders) ProtoMessage() {} -func (*ClientCloudFileUploadBlockDetails_HTTPHeaders) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{18, 0} -} - -func (m *ClientCloudFileUploadBlockDetails_HTTPHeaders) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *ClientCloudFileUploadBlockDetails_HTTPHeaders) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CCloud_ClientBeginFileUpload_Response struct { - EncryptFile *bool `protobuf:"varint,1,opt,name=encrypt_file" json:"encrypt_file,omitempty"` - BlockRequests []*ClientCloudFileUploadBlockDetails `protobuf:"bytes,2,rep,name=block_requests" json:"block_requests,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientBeginFileUpload_Response) Reset() { *m = CCloud_ClientBeginFileUpload_Response{} } -func (m *CCloud_ClientBeginFileUpload_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientBeginFileUpload_Response) ProtoMessage() {} -func (*CCloud_ClientBeginFileUpload_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{19} -} - -func (m *CCloud_ClientBeginFileUpload_Response) GetEncryptFile() bool { - if m != nil && m.EncryptFile != nil { - return *m.EncryptFile - } - return false -} - -func (m *CCloud_ClientBeginFileUpload_Response) GetBlockRequests() []*ClientCloudFileUploadBlockDetails { - if m != nil { - return m.BlockRequests - } - return nil -} - -type CCloud_ClientCommitFileUpload_Request struct { - TransferSucceeded *bool `protobuf:"varint,1,opt,name=transfer_succeeded" json:"transfer_succeeded,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - FileSha []byte `protobuf:"bytes,3,opt,name=file_sha" json:"file_sha,omitempty"` - Filename *string `protobuf:"bytes,4,opt,name=filename" json:"filename,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientCommitFileUpload_Request) Reset() { *m = CCloud_ClientCommitFileUpload_Request{} } -func (m *CCloud_ClientCommitFileUpload_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientCommitFileUpload_Request) ProtoMessage() {} -func (*CCloud_ClientCommitFileUpload_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{20} -} - -func (m *CCloud_ClientCommitFileUpload_Request) GetTransferSucceeded() bool { - if m != nil && m.TransferSucceeded != nil { - return *m.TransferSucceeded - } - return false -} - -func (m *CCloud_ClientCommitFileUpload_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_ClientCommitFileUpload_Request) GetFileSha() []byte { - if m != nil { - return m.FileSha - } - return nil -} - -func (m *CCloud_ClientCommitFileUpload_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -type CCloud_ClientCommitFileUpload_Response struct { - FileCommitted *bool `protobuf:"varint,1,opt,name=file_committed" json:"file_committed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientCommitFileUpload_Response) Reset() { - *m = CCloud_ClientCommitFileUpload_Response{} -} -func (m *CCloud_ClientCommitFileUpload_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientCommitFileUpload_Response) ProtoMessage() {} -func (*CCloud_ClientCommitFileUpload_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{21} -} - -func (m *CCloud_ClientCommitFileUpload_Response) GetFileCommitted() bool { - if m != nil && m.FileCommitted != nil { - return *m.FileCommitted - } - return false -} - -type CCloud_ClientFileDownload_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Filename *string `protobuf:"bytes,2,opt,name=filename" json:"filename,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientFileDownload_Request) Reset() { *m = CCloud_ClientFileDownload_Request{} } -func (m *CCloud_ClientFileDownload_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientFileDownload_Request) ProtoMessage() {} -func (*CCloud_ClientFileDownload_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{22} -} - -func (m *CCloud_ClientFileDownload_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_ClientFileDownload_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -type CCloud_ClientFileDownload_Response struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - FileSize *uint32 `protobuf:"varint,2,opt,name=file_size" json:"file_size,omitempty"` - RawFileSize *uint32 `protobuf:"varint,3,opt,name=raw_file_size" json:"raw_file_size,omitempty"` - ShaFile []byte `protobuf:"bytes,4,opt,name=sha_file" json:"sha_file,omitempty"` - TimeStamp *uint64 `protobuf:"varint,5,opt,name=time_stamp" json:"time_stamp,omitempty"` - IsExplicitDelete *bool `protobuf:"varint,6,opt,name=is_explicit_delete" json:"is_explicit_delete,omitempty"` - UrlHost *string `protobuf:"bytes,7,opt,name=url_host" json:"url_host,omitempty"` - UrlPath *string `protobuf:"bytes,8,opt,name=url_path" json:"url_path,omitempty"` - UseHttps *bool `protobuf:"varint,9,opt,name=use_https" json:"use_https,omitempty"` - RequestHeaders []*CCloud_ClientFileDownload_Response_HTTPHeaders `protobuf:"bytes,10,rep,name=request_headers" json:"request_headers,omitempty"` - Encrypted *bool `protobuf:"varint,11,opt,name=encrypted" json:"encrypted,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientFileDownload_Response) Reset() { *m = CCloud_ClientFileDownload_Response{} } -func (m *CCloud_ClientFileDownload_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientFileDownload_Response) ProtoMessage() {} -func (*CCloud_ClientFileDownload_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{23} -} - -func (m *CCloud_ClientFileDownload_Response) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_ClientFileDownload_Response) GetFileSize() uint32 { - if m != nil && m.FileSize != nil { - return *m.FileSize - } - return 0 -} - -func (m *CCloud_ClientFileDownload_Response) GetRawFileSize() uint32 { - if m != nil && m.RawFileSize != nil { - return *m.RawFileSize - } - return 0 -} - -func (m *CCloud_ClientFileDownload_Response) GetShaFile() []byte { - if m != nil { - return m.ShaFile - } - return nil -} - -func (m *CCloud_ClientFileDownload_Response) GetTimeStamp() uint64 { - if m != nil && m.TimeStamp != nil { - return *m.TimeStamp - } - return 0 -} - -func (m *CCloud_ClientFileDownload_Response) GetIsExplicitDelete() bool { - if m != nil && m.IsExplicitDelete != nil { - return *m.IsExplicitDelete - } - return false -} - -func (m *CCloud_ClientFileDownload_Response) GetUrlHost() string { - if m != nil && m.UrlHost != nil { - return *m.UrlHost - } - return "" -} - -func (m *CCloud_ClientFileDownload_Response) GetUrlPath() string { - if m != nil && m.UrlPath != nil { - return *m.UrlPath - } - return "" -} - -func (m *CCloud_ClientFileDownload_Response) GetUseHttps() bool { - if m != nil && m.UseHttps != nil { - return *m.UseHttps - } - return false -} - -func (m *CCloud_ClientFileDownload_Response) GetRequestHeaders() []*CCloud_ClientFileDownload_Response_HTTPHeaders { - if m != nil { - return m.RequestHeaders - } - return nil -} - -func (m *CCloud_ClientFileDownload_Response) GetEncrypted() bool { - if m != nil && m.Encrypted != nil { - return *m.Encrypted - } - return false -} - -type CCloud_ClientFileDownload_Response_HTTPHeaders struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientFileDownload_Response_HTTPHeaders) Reset() { - *m = CCloud_ClientFileDownload_Response_HTTPHeaders{} -} -func (m *CCloud_ClientFileDownload_Response_HTTPHeaders) String() string { - return proto.CompactTextString(m) -} -func (*CCloud_ClientFileDownload_Response_HTTPHeaders) ProtoMessage() {} -func (*CCloud_ClientFileDownload_Response_HTTPHeaders) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{23, 0} -} - -func (m *CCloud_ClientFileDownload_Response_HTTPHeaders) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CCloud_ClientFileDownload_Response_HTTPHeaders) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CCloud_ClientDeleteFile_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Filename *string `protobuf:"bytes,2,opt,name=filename" json:"filename,omitempty"` - IsExplicitDelete *bool `protobuf:"varint,3,opt,name=is_explicit_delete" json:"is_explicit_delete,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientDeleteFile_Request) Reset() { *m = CCloud_ClientDeleteFile_Request{} } -func (m *CCloud_ClientDeleteFile_Request) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientDeleteFile_Request) ProtoMessage() {} -func (*CCloud_ClientDeleteFile_Request) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{24} -} - -func (m *CCloud_ClientDeleteFile_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CCloud_ClientDeleteFile_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CCloud_ClientDeleteFile_Request) GetIsExplicitDelete() bool { - if m != nil && m.IsExplicitDelete != nil { - return *m.IsExplicitDelete - } - return false -} - -type CCloud_ClientDeleteFile_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCloud_ClientDeleteFile_Response) Reset() { *m = CCloud_ClientDeleteFile_Response{} } -func (m *CCloud_ClientDeleteFile_Response) String() string { return proto.CompactTextString(m) } -func (*CCloud_ClientDeleteFile_Response) ProtoMessage() {} -func (*CCloud_ClientDeleteFile_Response) Descriptor() ([]byte, []int) { - return cloud_fileDescriptor0, []int{25} -} - -func init() { - proto.RegisterType((*CCloud_GetUploadServerInfo_Request)(nil), "CCloud_GetUploadServerInfo_Request") - proto.RegisterType((*CCloud_GetUploadServerInfo_Response)(nil), "CCloud_GetUploadServerInfo_Response") - proto.RegisterType((*CCloud_BeginHTTPUpload_Request)(nil), "CCloud_BeginHTTPUpload_Request") - proto.RegisterType((*CCloud_BeginHTTPUpload_Response)(nil), "CCloud_BeginHTTPUpload_Response") - proto.RegisterType((*CCloud_BeginHTTPUpload_Response_HTTPHeaders)(nil), "CCloud_BeginHTTPUpload_Response.HTTPHeaders") - proto.RegisterType((*CCloud_CommitHTTPUpload_Request)(nil), "CCloud_CommitHTTPUpload_Request") - proto.RegisterType((*CCloud_CommitHTTPUpload_Response)(nil), "CCloud_CommitHTTPUpload_Response") - proto.RegisterType((*CCloud_GetFileDetails_Request)(nil), "CCloud_GetFileDetails_Request") - proto.RegisterType((*CCloud_UserFile)(nil), "CCloud_UserFile") - proto.RegisterType((*CCloud_GetFileDetails_Response)(nil), "CCloud_GetFileDetails_Response") - proto.RegisterType((*CCloud_EnumerateUserFiles_Request)(nil), "CCloud_EnumerateUserFiles_Request") - proto.RegisterType((*CCloud_EnumerateUserFiles_Response)(nil), "CCloud_EnumerateUserFiles_Response") - proto.RegisterType((*CCloud_Delete_Request)(nil), "CCloud_Delete_Request") - proto.RegisterType((*CCloud_Delete_Response)(nil), "CCloud_Delete_Response") - proto.RegisterType((*CCloud_GetClientEncryptionKey_Request)(nil), "CCloud_GetClientEncryptionKey_Request") - proto.RegisterType((*CCloud_GetClientEncryptionKey_Response)(nil), "CCloud_GetClientEncryptionKey_Response") - proto.RegisterType((*CCloud_CDNReport_Notification)(nil), "CCloud_CDNReport_Notification") - proto.RegisterType((*CCloud_ExternalStorageTransferReport_Notification)(nil), "CCloud_ExternalStorageTransferReport_Notification") - proto.RegisterType((*CCloud_ClientBeginFileUpload_Request)(nil), "CCloud_ClientBeginFileUpload_Request") - proto.RegisterType((*ClientCloudFileUploadBlockDetails)(nil), "ClientCloudFileUploadBlockDetails") - proto.RegisterType((*ClientCloudFileUploadBlockDetails_HTTPHeaders)(nil), "ClientCloudFileUploadBlockDetails.HTTPHeaders") - proto.RegisterType((*CCloud_ClientBeginFileUpload_Response)(nil), "CCloud_ClientBeginFileUpload_Response") - proto.RegisterType((*CCloud_ClientCommitFileUpload_Request)(nil), "CCloud_ClientCommitFileUpload_Request") - proto.RegisterType((*CCloud_ClientCommitFileUpload_Response)(nil), "CCloud_ClientCommitFileUpload_Response") - proto.RegisterType((*CCloud_ClientFileDownload_Request)(nil), "CCloud_ClientFileDownload_Request") - proto.RegisterType((*CCloud_ClientFileDownload_Response)(nil), "CCloud_ClientFileDownload_Response") - proto.RegisterType((*CCloud_ClientFileDownload_Response_HTTPHeaders)(nil), "CCloud_ClientFileDownload_Response.HTTPHeaders") - proto.RegisterType((*CCloud_ClientDeleteFile_Request)(nil), "CCloud_ClientDeleteFile_Request") - proto.RegisterType((*CCloud_ClientDeleteFile_Response)(nil), "CCloud_ClientDeleteFile_Response") -} - -var cloud_fileDescriptor0 = []byte{ - // 3368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x59, 0x4b, 0x6f, 0x1c, 0xc7, - 0xb5, 0xc6, 0x88, 0x1c, 0x8a, 0x2c, 0x8a, 0xa2, 0x54, 0xbe, 0xa2, 0xc7, 0xf4, 0x43, 0xa5, 0x96, - 0x25, 0x4a, 0xf6, 0xa8, 0x24, 0xd1, 0x92, 0x65, 0x59, 0xd7, 0xd7, 0x97, 0x43, 0x52, 0x12, 0x7d, - 0xaf, 0x1e, 0x21, 0x29, 0x3b, 0xb6, 0x93, 0x34, 0x8a, 0x33, 0x35, 0x64, 0x43, 0x3d, 0xdd, 0x93, - 0xee, 0x1e, 0x91, 0xe3, 0xd8, 0x86, 0xe1, 0x2c, 0xe2, 0x45, 0xb2, 0x4b, 0x82, 0xbc, 0x80, 0x6c, - 0xb2, 0x08, 0x02, 0x78, 0x99, 0x4d, 0x90, 0x3f, 0x10, 0x20, 0x9b, 0xfc, 0x83, 0x00, 0x59, 0x65, - 0x91, 0x45, 0xfe, 0x40, 0x90, 0x73, 0x4e, 0x55, 0x3f, 0xe6, 0xc1, 0x97, 0x1f, 0x01, 0x04, 0x81, - 0x53, 0x55, 0xe7, 0xd4, 0xa9, 0xf3, 0xfc, 0xce, 0x69, 0x76, 0x2e, 0x4e, 0xb4, 0x6a, 0xb5, 0x74, - 0x1c, 0xab, 0x4d, 0x1d, 0xbb, 0x75, 0x3f, 0xec, 0x34, 0x24, 0xad, 0xd5, 0x7d, 0x4f, 0x07, 0x89, - 0x6c, 0x47, 0x61, 0x12, 0xce, 0x56, 0x7b, 0x8f, 0x75, 0x02, 0xaf, 0xe9, 0xe9, 0x86, 0xbb, 0xa1, - 0x62, 0x3d, 0x78, 0xda, 0x69, 0x30, 0x67, 0x71, 0x11, 0x39, 0xb9, 0x77, 0x74, 0xf2, 0xa8, 0xed, - 0x87, 0xaa, 0xb1, 0xa6, 0xa3, 0x27, 0x3a, 0x5a, 0x09, 0x9a, 0xa1, 0xbb, 0xaa, 0xbf, 0xdb, 0xd1, - 0x71, 0xc2, 0xff, 0x87, 0x95, 0x55, 0xbb, 0xed, 0x35, 0x2a, 0x25, 0x51, 0xba, 0x30, 0x55, 0xbb, - 0xfc, 0xe9, 0xef, 0x2b, 0x2f, 0x2f, 0xb4, 0xdb, 0x62, 0x65, 0x49, 0x24, 0xa1, 0xd8, 0xde, 0xf2, - 0xea, 0x5b, 0x42, 0x89, 0xa6, 0xe7, 0x6b, 0xb1, 0xed, 0xf9, 0xbe, 0xd8, 0xd0, 0xa2, 0x43, 0xbc, - 0x74, 0x03, 0x0e, 0x48, 0xe7, 0x26, 0x3b, 0xbb, 0xe7, 0x2d, 0x71, 0x3b, 0x0c, 0x62, 0xcd, 0x39, - 0x63, 0x31, 0x2d, 0xbb, 0x9d, 0xc8, 0xa7, 0xbb, 0x26, 0x9c, 0x1f, 0x8f, 0xb1, 0x17, 0x2c, 0x6d, - 0x4d, 0x6f, 0x7a, 0xc1, 0xdd, 0xf5, 0xf5, 0x87, 0x86, 0x43, 0x26, 0xdd, 0x9b, 0xbd, 0xd2, 0x5d, - 0x01, 0xe9, 0xaa, 0x56, 0xba, 0x66, 0x18, 0x59, 0xf1, 0x92, 0x2d, 0x6d, 0x04, 0xf4, 0x62, 0x10, - 0xcf, 0x0b, 0x36, 0x33, 0x09, 0x25, 0x7f, 0x85, 0x4d, 0xe0, 0x96, 0x1b, 0x7b, 0x1f, 0xe8, 0xca, - 0x11, 0x62, 0x22, 0x80, 0xc9, 0x73, 0x0f, 0x22, 0x0f, 0x6e, 0x54, 0xbe, 0x21, 0xc4, 0x5d, 0xe1, - 0x05, 0x62, 0xa3, 0x9b, 0xe8, 0x58, 0xf2, 0x37, 0xd8, 0x38, 0x2e, 0x07, 0xaa, 0xa5, 0x2b, 0x23, - 0x28, 0x6a, 0xed, 0x65, 0xa0, 0x99, 0xbb, 0x0f, 0xbf, 0x45, 0xd8, 0xcc, 0xef, 0x03, 0x05, 0xc5, - 0x49, 0x18, 0x11, 0x29, 0x2e, 0x1a, 0xbb, 0xf1, 0xb7, 0x0d, 0xb9, 0x1b, 0x6f, 0xa9, 0xca, 0x28, - 0x91, 0x2f, 0x01, 0xf9, 0xff, 0xde, 0xd5, 0x3b, 0x70, 0x3c, 0x42, 0xf9, 0x2e, 0x5c, 0xbb, 0x22, - 0x1a, 0x20, 0x40, 0x12, 0x5f, 0x14, 0x91, 0x6e, 0x47, 0x3a, 0x06, 0xb3, 0xe1, 0x06, 0x72, 0x59, - 0xbb, 0xbb, 0x70, 0x15, 0x77, 0xe1, 0xfd, 0xc5, 0xdb, 0x24, 0xff, 0x16, 0x9b, 0xf0, 0x62, 0xb7, - 0xdd, 0xd9, 0xf0, 0xbd, 0x7a, 0xa5, 0x0c, 0x8c, 0xc7, 0x6b, 0x2b, 0xc0, 0x78, 0x79, 0x3d, 0xea, - 0x80, 0x08, 0x05, 0xb9, 0xe2, 0xad, 0xb0, 0xe3, 0x37, 0xd0, 0x54, 0x2d, 0x15, 0x3d, 0x06, 0x43, - 0x19, 0x1a, 0x11, 0x1a, 0x31, 0x1f, 0xdd, 0x5e, 0xab, 0x8a, 0xa6, 0xf2, 0x63, 0x78, 0x0d, 0xfc, - 0x8e, 0xb6, 0x3d, 0xf0, 0x1f, 0xfe, 0x01, 0x3b, 0xd9, 0xf6, 0x55, 0x02, 0x6a, 0x6d, 0xc5, 0x6e, - 0x12, 0xba, 0x71, 0x37, 0xa8, 0x57, 0xc6, 0xc4, 0x08, 0x88, 0xef, 0xc2, 0x2d, 0xef, 0x2f, 0x44, - 0x91, 0xea, 0xa2, 0x40, 0xf6, 0x0d, 0x71, 0x5b, 0xd7, 0xbd, 0x66, 0x17, 0xff, 0x34, 0x66, 0xc8, - 0xa8, 0x49, 0x2f, 0x40, 0x7d, 0x4b, 0x3c, 0x51, 0x3e, 0x88, 0x46, 0xff, 0xc7, 0xaf, 0x0b, 0xe5, - 0xfb, 0x55, 0x70, 0xa2, 0xa0, 0x11, 0x6e, 0xc7, 0x55, 0x11, 0xc6, 0x3b, 0x55, 0xe1, 0x7b, 0x41, - 0x67, 0x47, 0xf2, 0x88, 0x9d, 0x8a, 0x8c, 0xc5, 0xdd, 0x2d, 0x0d, 0x86, 0x8b, 0x62, 0x17, 0x95, - 0x1f, 0x57, 0x8e, 0xd2, 0xfd, 0x6b, 0x70, 0xff, 0x03, 0xd4, 0x7e, 0x4c, 0x56, 0xb7, 0x47, 0x44, - 0x37, 0xec, 0xcc, 0x81, 0x47, 0x6e, 0xab, 0x20, 0xa1, 0x2b, 0x75, 0x82, 0x2f, 0x84, 0xd5, 0xc8, - 0x3a, 0x80, 0xb0, 0x4c, 0xa5, 0xb8, 0x07, 0xa2, 0x83, 0x3a, 0x7c, 0xdd, 0x4c, 0xc4, 0x86, 0xaf, - 0x82, 0xc7, 0x92, 0xff, 0xb4, 0xc4, 0x66, 0xfa, 0x2f, 0x35, 0x92, 0x56, 0xc6, 0xe9, 0xd6, 0x27, - 0x70, 0x6b, 0xf4, 0x36, 0xad, 0x7c, 0xd1, 0x6b, 0xd7, 0x41, 0xdb, 0x41, 0xa7, 0xb5, 0xa1, 0x23, - 0x54, 0x1c, 0x3d, 0x49, 0xb4, 0x3a, 0x60, 0x57, 0x38, 0x00, 0xbe, 0x97, 0xf4, 0x6c, 0x9b, 0xcb, - 0xa5, 0xf3, 0xb3, 0x51, 0x76, 0x7a, 0xd7, 0xb0, 0xb0, 0xe1, 0x74, 0x99, 0x95, 0x3b, 0x9b, 0x75, - 0x1b, 0x17, 0x63, 0xc6, 0xa5, 0x1f, 0xdd, 0x59, 0xc4, 0xb8, 0xb0, 0x2e, 0x93, 0x05, 0xa9, 0xf1, - 0x9d, 0x2b, 0x6c, 0x22, 0xf1, 0xe0, 0xfa, 0x44, 0xb5, 0xda, 0x14, 0x07, 0x47, 0x6b, 0xcf, 0x03, - 0xd1, 0x33, 0x26, 0x56, 0x45, 0xb6, 0x87, 0xe4, 0x86, 0xe2, 0x9b, 0x6c, 0x1c, 0x42, 0xd5, 0xdd, - 0x0a, 0xe3, 0xc4, 0x06, 0xc1, 0x6d, 0x20, 0xa8, 0xdd, 0x85, 0xdf, 0xf4, 0x12, 0x72, 0x05, 0x4b, - 0x9d, 0x26, 0x8a, 0x3e, 0xef, 0xcb, 0x64, 0x78, 0xe2, 0x29, 0x81, 0xcf, 0x10, 0x0f, 0x1f, 0xad, - 0x4b, 0xfe, 0xc0, 0x70, 0x6e, 0xab, 0x64, 0xcb, 0xc6, 0xc7, 0x1b, 0xc0, 0xf9, 0xe6, 0xaa, 0x06, - 0x07, 0xf2, 0x9e, 0x68, 0x81, 0x1b, 0xa8, 0xd2, 0x03, 0x72, 0x97, 0x90, 0xc3, 0x26, 0x3a, 0xb1, - 0x76, 0xb7, 0x92, 0xa4, 0x1d, 0xdb, 0xc0, 0xa0, 0x80, 0x5d, 0x01, 0x55, 0x40, 0x6c, 0x54, 0x05, - 0xec, 0x0a, 0xda, 0xad, 0xe6, 0x1e, 0x9f, 0x2d, 0x4a, 0xfe, 0x3d, 0x36, 0xdd, 0xe7, 0x09, 0xe4, - 0xf8, 0x93, 0xf3, 0x55, 0xb9, 0x8f, 0x21, 0x24, 0xae, 0xdd, 0x35, 0x34, 0xb5, 0x6b, 0x70, 0xe7, - 0x15, 0x74, 0xd3, 0x4b, 0xc6, 0xef, 0xdb, 0xca, 0x8b, 0x28, 0x18, 0x40, 0x58, 0x0c, 0x70, 0x4c, - 0x13, 0xa9, 0x16, 0x32, 0x1f, 0x99, 0x7d, 0x89, 0x4d, 0x16, 0x98, 0xf0, 0x63, 0x6c, 0x94, 0xf2, - 0x0e, 0xa5, 0x48, 0x3e, 0xc5, 0xca, 0xc4, 0x8b, 0x4c, 0x36, 0xe1, 0x7c, 0x9e, 0xbb, 0xc6, 0x62, - 0xd8, 0x6a, 0x79, 0xc9, 0x90, 0x94, 0xf9, 0x9b, 0x12, 0xe3, 0x49, 0xa4, 0x82, 0xb8, 0x09, 0xc9, - 0x36, 0xee, 0xd4, 0xeb, 0x5a, 0x83, 0x92, 0x88, 0xdf, 0x78, 0xed, 0x07, 0x25, 0x90, 0xf1, 0xd3, - 0x52, 0x31, 0x63, 0x64, 0x12, 0x81, 0xa0, 0xb9, 0xe3, 0x88, 0x47, 0xab, 0xff, 0x2f, 0x32, 0x6a, - 0x71, 0x01, 0x7f, 0x42, 0x59, 0x79, 0xe2, 0xe1, 0x2f, 0x78, 0x47, 0x64, 0x15, 0x80, 0x54, 0x24, - 0x90, 0xec, 0x53, 0xd1, 0xc5, 0x34, 0xc5, 0xc0, 0x35, 0x50, 0x3f, 0x94, 0xe7, 0x77, 0x20, 0x51, - 0x86, 0xf5, 0x7a, 0x27, 0x8a, 0xd0, 0x66, 0x3b, 0x69, 0x66, 0x37, 0x49, 0xd9, 0x03, 0xb9, 0xf4, - 0x61, 0x32, 0xbb, 0xb8, 0x87, 0x71, 0xd4, 0x52, 0x89, 0x3d, 0xa6, 0x0c, 0x6d, 0x26, 0xe3, 0x6e, - 0x72, 0x49, 0xfe, 0x93, 0x52, 0x21, 0x3f, 0x1b, 0xcf, 0xfe, 0x14, 0xd5, 0xf2, 0xf1, 0x97, 0x4d, - 0xd0, 0xfd, 0x22, 0x15, 0xcf, 0x1d, 0x40, 0xae, 0x6f, 0x14, 0xaa, 0x8e, 0x09, 0x8b, 0x37, 0x41, - 0xaa, 0x5b, 0xb7, 0xed, 0x9a, 0x50, 0xb1, 0xcd, 0xb9, 0x9e, 0x31, 0x01, 0x5e, 0x31, 0x94, 0x55, - 0xe6, 0x5b, 0xce, 0x47, 0x4c, 0xec, 0xee, 0x2e, 0x36, 0x95, 0xbc, 0xcb, 0x8e, 0x93, 0x36, 0xea, - 0x74, 0x22, 0xc9, 0x5c, 0x65, 0x01, 0x2e, 0x7f, 0x63, 0xa0, 0xb4, 0x6c, 0xa3, 0x14, 0xe8, 0x16, - 0x71, 0xdc, 0xec, 0xf8, 0x7e, 0x57, 0x64, 0x64, 0x83, 0x25, 0xc5, 0xf9, 0x61, 0x89, 0x3d, 0x9f, - 0x83, 0x03, 0x7c, 0xc8, 0x92, 0x4e, 0xc0, 0x13, 0xe2, 0xcc, 0x59, 0x6f, 0x15, 0xf3, 0xd8, 0x68, - 0xad, 0x0a, 0x77, 0x5e, 0xc8, 0x73, 0x18, 0x91, 0x66, 0xa5, 0x76, 0x13, 0x12, 0x6d, 0xc3, 0xd0, - 0xa3, 0x8b, 0x48, 0x2e, 0x7b, 0x5d, 0xe8, 0x34, 0x10, 0x3f, 0x9b, 0x42, 0x97, 0x54, 0xde, 0x0d, - 0xed, 0x87, 0xc1, 0x66, 0x4c, 0x50, 0xe5, 0x47, 0x25, 0x36, 0x6d, 0xc5, 0x79, 0x04, 0xb9, 0x05, - 0xe5, 0xc1, 0x00, 0x2b, 0x00, 0x0c, 0xfc, 0x69, 0xe4, 0x41, 0x96, 0xa3, 0xfc, 0x44, 0x3f, 0x10, - 0xe0, 0x27, 0x8b, 0x79, 0x74, 0x94, 0x0e, 0x9d, 0x2c, 0x42, 0x8c, 0x32, 0xb1, 0x99, 0x64, 0x23, - 0x08, 0x73, 0xc6, 0x88, 0xe4, 0x69, 0x36, 0x4d, 0xe0, 0xcc, 0x6b, 0xb8, 0xf5, 0x48, 0x2b, 0x00, - 0x0c, 0x50, 0xd6, 0x20, 0x6b, 0x3b, 0x8b, 0x19, 0xfc, 0x19, 0xd0, 0x8e, 0xb5, 0xcd, 0x19, 0x76, - 0xd4, 0xbe, 0x98, 0xe4, 0x9b, 0x9c, 0x3f, 0x21, 0xfb, 0x1e, 0xe0, 0xfc, 0x7d, 0x84, 0x9d, 0xb1, - 0x6b, 0xcb, 0x50, 0x4b, 0x74, 0xa4, 0x12, 0x9d, 0x6e, 0xe6, 0x7a, 0xbe, 0xd6, 0x8b, 0xa3, 0xce, - 0x81, 0xaa, 0xce, 0xe4, 0x28, 0x4f, 0xa7, 0x84, 0x99, 0xde, 0x62, 0x30, 0x81, 0xe4, 0xbf, 0x2c, - 0xb1, 0x13, 0x7a, 0x27, 0xd1, 0x01, 0x38, 0xae, 0x9b, 0x0a, 0x72, 0x84, 0xbc, 0xe3, 0x13, 0x8c, - 0x98, 0x0f, 0x2f, 0x3c, 0x68, 0x27, 0x5e, 0x08, 0x30, 0xea, 0xa2, 0x80, 0x27, 0x88, 0xf4, 0x6c, - 0x66, 0xa6, 0x0d, 0x55, 0x7f, 0x9c, 0xa2, 0x0e, 0xc3, 0xb6, 0x19, 0x76, 0x02, 0x08, 0xde, 0x25, - 0xdd, 0x54, 0x1d, 0x3f, 0xa1, 0xec, 0x18, 0x06, 0xe0, 0x46, 0x91, 0x4e, 0x3a, 0x51, 0x80, 0xf1, - 0x91, 0xc6, 0x72, 0x43, 0xa8, 0x00, 0xd2, 0x10, 0x16, 0xb5, 0x46, 0x31, 0xcc, 0x52, 0x1e, 0xfc, - 0x43, 0x56, 0xae, 0xc3, 0x5f, 0xa6, 0x3a, 0x4d, 0xd5, 0x5a, 0x20, 0x90, 0x57, 0x10, 0xe8, 0x9e, - 0xda, 0xf1, 0x5a, 0x9d, 0x56, 0xa1, 0xc0, 0x42, 0x14, 0xa7, 0x77, 0x9a, 0xeb, 0x8c, 0x68, 0x90, - 0x5b, 0xea, 0x00, 0x4d, 0x7a, 0x85, 0x52, 0x10, 0xc7, 0x86, 0x1e, 0x08, 0xaf, 0x5f, 0xb9, 0x62, - 0xaf, 0x4e, 0xc5, 0x44, 0xc8, 0x32, 0x09, 0x4e, 0x10, 0x25, 0x2e, 0xe0, 0x19, 0xbd, 0x43, 0xae, - 0x30, 0x55, 0xfb, 0x36, 0xc8, 0xf0, 0x6e, 0x41, 0x86, 0x35, 0x3c, 0x81, 0x69, 0x83, 0x0e, 0x99, - 0x52, 0x00, 0xa1, 0x9a, 0x29, 0x1c, 0x8e, 0x09, 0x95, 0xf4, 0xde, 0x8c, 0xef, 0xa4, 0x53, 0x01, - 0x12, 0xda, 0x87, 0xfb, 0x1e, 0x86, 0xf3, 0x7b, 0x19, 0xa2, 0x1f, 0x6a, 0x6a, 0xeb, 0x34, 0xa7, - 0x59, 0x99, 0x84, 0x05, 0x5b, 0x8f, 0x0c, 0x73, 0x19, 0xfe, 0x14, 0x9b, 0x4c, 0xc2, 0x44, 0xf9, - 0xae, 0x39, 0x46, 0xd1, 0xe3, 0xbc, 0xcb, 0x4e, 0xd9, 0x73, 0x4b, 0xda, 0xd7, 0x89, 0xce, 0x5c, - 0xa7, 0x18, 0x03, 0xa6, 0x28, 0x1d, 0x36, 0xee, 0x2a, 0x6c, 0xa6, 0x9f, 0xb5, 0x11, 0xd5, 0x99, - 0x63, 0xe7, 0xf2, 0x08, 0x58, 0xa4, 0xe6, 0x65, 0x39, 0xa8, 0x47, 0x5d, 0x52, 0xe0, 0xff, 0xe9, - 0x6e, 0x2a, 0x84, 0x13, 0xb0, 0xf3, 0xfb, 0x1d, 0xb4, 0xaf, 0x9f, 0x63, 0x23, 0x8f, 0x75, 0x97, - 0x24, 0x3d, 0x56, 0x9b, 0x05, 0xd1, 0x66, 0x16, 0x96, 0xd7, 0x2e, 0xcd, 0x5f, 0x7f, 0x15, 0x94, - 0x9e, 0x12, 0x08, 0x38, 0xc1, 0x9f, 0x65, 0x23, 0xf5, 0xa8, 0x4e, 0x6f, 0x28, 0xd7, 0x8e, 0xc3, - 0x41, 0xb6, 0xb8, 0xba, 0x88, 0xfa, 0x86, 0x4d, 0xe7, 0x77, 0x79, 0xe6, 0x5a, 0x5c, 0xba, 0xbf, - 0xaa, 0xdb, 0x21, 0x58, 0xfa, 0x7e, 0x98, 0x40, 0xf2, 0xad, 0x93, 0xd9, 0xf8, 0x34, 0x3b, 0x6a, - 0xa3, 0xda, 0x60, 0xb0, 0x34, 0xe6, 0xa9, 0x50, 0xd3, 0xae, 0xc9, 0x92, 0xe4, 0x9d, 0xe3, 0xbc, - 0xc2, 0x4e, 0x20, 0xd6, 0x70, 0xc1, 0x67, 0x92, 0x0e, 0x74, 0x78, 0x61, 0xc3, 0x24, 0xf9, 0x29, - 0x3e, 0xc3, 0x8e, 0xeb, 0x1d, 0xc8, 0xeb, 0x09, 0x76, 0x72, 0xd8, 0x7f, 0x50, 0x0e, 0x19, 0xc5, - 0xf5, 0x48, 0xd7, 0x35, 0x00, 0xa2, 0x74, 0x7d, 0x2c, 0xcd, 0x49, 0x8d, 0x8e, 0xf1, 0x1d, 0xca, - 0x23, 0x53, 0xce, 0x5f, 0x4b, 0xec, 0x6a, 0xea, 0x17, 0x10, 0x81, 0x11, 0xb8, 0xde, 0x1a, 0x64, - 0x19, 0xe8, 0x11, 0xd7, 0x2d, 0x0e, 0x18, 0xf6, 0x00, 0x00, 0x1a, 0x84, 0xed, 0x8c, 0x4d, 0xe1, - 0x17, 0xe1, 0xb1, 0x23, 0x69, 0x96, 0x83, 0x4e, 0xc3, 0xd4, 0x5a, 0xfb, 0x80, 0xc2, 0x8b, 0x46, - 0x77, 0x7d, 0x51, 0x39, 0x7d, 0x11, 0x09, 0xec, 0xa6, 0xef, 0xb2, 0x92, 0xff, 0x17, 0x3b, 0x66, - 0xd6, 0x55, 0x3d, 0x01, 0xf8, 0x4b, 0xd2, 0x8f, 0xa2, 0x37, 0xa6, 0xef, 0x71, 0x5b, 0x88, 0xbd, - 0x91, 0xc5, 0x71, 0x36, 0x56, 0xd7, 0xbe, 0x0f, 0xca, 0x9d, 0xa0, 0x27, 0xfe, 0xb1, 0xcc, 0x5e, - 0x4c, 0xed, 0x41, 0xd6, 0xa7, 0x92, 0x87, 0xde, 0xfc, 0x55, 0x37, 0x8c, 0x4b, 0x83, 0x0d, 0xe3, - 0x55, 0x60, 0x72, 0x29, 0xef, 0x13, 0xa1, 0x02, 0x12, 0xbe, 0x32, 0x65, 0x8f, 0xb2, 0x14, 0x75, - 0x81, 0x54, 0x94, 0x4d, 0x41, 0xe6, 0xf7, 0xd9, 0x54, 0xa4, 0xb6, 0xdd, 0x9c, 0x93, 0xc9, 0x51, - 0x37, 0x80, 0xd3, 0x2b, 0x39, 0xa7, 0x0d, 0xdd, 0xc4, 0xee, 0x51, 0x05, 0x54, 0x46, 0x11, 0x65, - 0xc4, 0x94, 0x11, 0x82, 0xc6, 0x65, 0x90, 0x35, 0xf7, 0x57, 0xc9, 0x2f, 0xf4, 0xb5, 0x94, 0xc7, - 0x6a, 0x33, 0xc0, 0x8a, 0x03, 0xc2, 0xb8, 0x74, 0x95, 0x52, 0x9b, 0xda, 0xb6, 0xb0, 0xfd, 0x25, - 0xc6, 0xb0, 0x40, 0xb9, 0xa6, 0x42, 0x91, 0x2b, 0x99, 0xb3, 0xeb, 0x83, 0x10, 0xbf, 0xd8, 0xe7, - 0x8e, 0x1d, 0xbe, 0xcf, 0x3d, 0x37, 0xac, 0x63, 0x24, 0x97, 0x7c, 0x9d, 0x5d, 0x9b, 0xbf, 0x79, - 0xed, 0xe6, 0xab, 0x37, 0xe6, 0x6f, 0x5e, 0xe7, 0xb7, 0xd9, 0x51, 0xb4, 0xa5, 0x9b, 0x1a, 0xb3, - 0x76, 0x1d, 0x2e, 0xb9, 0x6a, 0xcc, 0x38, 0x07, 0xb9, 0x17, 0xf6, 0xd0, 0x3c, 0x31, 0xc0, 0x7c, - 0x60, 0xad, 0x02, 0xd1, 0xf6, 0xa0, 0x6a, 0xc4, 0xc6, 0x83, 0x85, 0x1f, 0x1a, 0x7f, 0x45, 0x7c, - 0x34, 0x09, 0xbb, 0xae, 0x55, 0x4b, 0x85, 0x51, 0x1d, 0xfa, 0x6f, 0xe0, 0xf5, 0x9a, 0x97, 0xe2, - 0x7c, 0x33, 0xff, 0x20, 0x26, 0xf6, 0x58, 0x31, 0x23, 0x91, 0xb2, 0x8d, 0xa5, 0x29, 0x27, 0x27, - 0xbc, 0xc9, 0x8e, 0x83, 0x9f, 0x83, 0x52, 0xc1, 0x7a, 0x64, 0xac, 0xca, 0x24, 0x71, 0xbd, 0x0f, - 0x5c, 0xdf, 0xca, 0xb8, 0x52, 0x89, 0x80, 0x7f, 0x9b, 0x21, 0x21, 0x40, 0xc2, 0xf3, 0x58, 0x97, - 0xc0, 0x46, 0x4a, 0xc4, 0x50, 0xd3, 0x75, 0x00, 0x5d, 0x49, 0x82, 0xbf, 0xe3, 0xb0, 0x65, 0x11, - 0x90, 0x30, 0x5c, 0xe9, 0x6e, 0xe7, 0x9f, 0x63, 0x50, 0xa4, 0x49, 0x36, 0xf2, 0x8f, 0xdc, 0x6f, - 0x6b, 0xf0, 0xbc, 0xc7, 0xb6, 0xec, 0xf7, 0x74, 0x5c, 0xa5, 0xaf, 0xad, 0xe3, 0x3a, 0xf2, 0x95, - 0x77, 0x5c, 0x23, 0x87, 0xef, 0xb8, 0x6e, 0xb1, 0x49, 0x4a, 0x1e, 0x2d, 0x9d, 0x6c, 0x85, 0x0d, - 0x72, 0xe9, 0x72, 0xed, 0x3c, 0x70, 0x70, 0x96, 0x51, 0xea, 0x7b, 0xb4, 0x8c, 0x72, 0x20, 0x09, - 0x06, 0x2e, 0xd9, 0x60, 0x03, 0xb5, 0x25, 0xf9, 0x47, 0x83, 0xed, 0x5a, 0x99, 0x4a, 0x9d, 0x94, - 0xfb, 0x2a, 0xf9, 0xcb, 0x37, 0x6c, 0xfc, 0x35, 0x48, 0x63, 0xc8, 0xd1, 0x0d, 0x9b, 0x4d, 0x68, - 0xfe, 0x4d, 0x72, 0xab, 0x39, 0xc0, 0xeb, 0x05, 0xb3, 0x92, 0x06, 0x98, 0x91, 0x97, 0x5e, 0x41, - 0x72, 0xf0, 0x56, 0x4a, 0x09, 0x31, 0xb7, 0x09, 0xa6, 0xa0, 0x58, 0xa9, 0xbd, 0x03, 0x94, 0x6b, - 0x66, 0x65, 0x37, 0x4a, 0x71, 0x09, 0x41, 0xf8, 0x07, 0x3a, 0x0a, 0xab, 0x22, 0x08, 0x41, 0xce, - 0xa8, 0xa7, 0xf3, 0x40, 0xe7, 0xcc, 0xd7, 0x52, 0x45, 0x71, 0x97, 0x71, 0xc8, 0xc0, 0xbe, 0x57, - 0xf7, 0x12, 0x77, 0x23, 0x6c, 0x74, 0xdd, 0x86, 0x4a, 0x14, 0x25, 0xd8, 0x63, 0xb5, 0x45, 0xb8, - 0xf4, 0xcd, 0x74, 0x57, 0xe0, 0xae, 0xc0, 0x5d, 0xab, 0xf2, 0x2a, 0xbc, 0x1c, 0xab, 0x5b, 0x23, - 0x13, 0x08, 0x37, 0xab, 0x7d, 0x96, 0xe0, 0x21, 0x9b, 0x6e, 0xa9, 0x2e, 0xb8, 0x55, 0x04, 0xf8, - 0x49, 0xfb, 0x98, 0xe7, 0x26, 0xc8, 0x17, 0xde, 0x06, 0xee, 0xab, 0xbd, 0xf1, 0x63, 0xd5, 0x07, - 0xb0, 0x8a, 0x26, 0x31, 0x8d, 0x30, 0xa0, 0x74, 0x92, 0xd2, 0x8a, 0x6d, 0x0f, 0x9f, 0x6f, 0x22, - 0xc7, 0x6b, 0x79, 0xbe, 0x8a, 0xfc, 0xee, 0x25, 0x3b, 0xbe, 0xb2, 0xb4, 0xf1, 0xa1, 0x7a, 0xe5, - 0x7f, 0x94, 0x32, 0x70, 0xb1, 0x5b, 0xc9, 0xb0, 0x90, 0xe1, 0x7d, 0x76, 0xcc, 0x66, 0x0b, 0x93, - 0x03, 0x4c, 0xff, 0xb3, 0x0c, 0x6f, 0x58, 0x58, 0xc9, 0xdf, 0x30, 0x30, 0x5b, 0xb3, 0x34, 0x20, - 0xdf, 0x46, 0xd7, 0xa6, 0x45, 0xca, 0x3e, 0x3d, 0x89, 0x86, 0x6f, 0x42, 0x31, 0x24, 0x9b, 0xa7, - 0x8f, 0x00, 0xf1, 0xd0, 0x57, 0x9d, 0xfd, 0x7d, 0xd5, 0x84, 0x14, 0x39, 0x60, 0x4a, 0x8c, 0xf6, - 0x69, 0xa9, 0xc7, 0x94, 0x92, 0xdb, 0x3a, 0xc2, 0xd4, 0x6b, 0x2f, 0x72, 0xfe, 0x34, 0xd2, 0xf7, - 0x5e, 0xd3, 0xf2, 0x0d, 0xa9, 0x91, 0x6a, 0x8f, 0x01, 0x01, 0xbd, 0x3a, 0xed, 0xfa, 0x14, 0xce, - 0x7b, 0xc9, 0x13, 0xcd, 0x1d, 0x71, 0x3e, 0x11, 0x28, 0x76, 0xf7, 0x41, 0xd7, 0x3a, 0x63, 0x8b, - 0xfa, 0xfc, 0xff, 0x7c, 0x77, 0x9f, 0xbf, 0x51, 0xf2, 0x76, 0x5f, 0x73, 0x7f, 0xac, 0xf6, 0x1d, - 0xb8, 0xfc, 0xbd, 0x21, 0x3d, 0x7b, 0x56, 0x33, 0xbf, 0x40, 0xdf, 0x5e, 0xbc, 0xf1, 0x4b, 0xf6, - 0xed, 0x39, 0xab, 0xbc, 0x6f, 0xff, 0x7e, 0x29, 0xc3, 0xbb, 0xbb, 0xda, 0xf2, 0xeb, 0x6f, 0xdf, - 0x3f, 0x29, 0x65, 0xad, 0xa5, 0x91, 0x82, 0x7a, 0xd4, 0x70, 0x3b, 0xe8, 0xf1, 0x26, 0xd9, 0x8b, - 0xb8, 0x86, 0x76, 0x03, 0x79, 0x7e, 0x92, 0xfc, 0xe5, 0x82, 0xba, 0x4c, 0x2d, 0x7a, 0x06, 0x48, - 0x4e, 0x65, 0xea, 0x2a, 0x4e, 0x54, 0x9c, 0x7f, 0x95, 0xb3, 0x96, 0x67, 0xa8, 0x08, 0x56, 0x09, - 0xf3, 0xbd, 0x32, 0x9c, 0x05, 0x86, 0xa7, 0x41, 0x06, 0xdf, 0x62, 0xdd, 0x61, 0x6d, 0x09, 0xbf, - 0x33, 0x08, 0xf4, 0xa8, 0x1e, 0x1c, 0x10, 0xe8, 0x65, 0x56, 0x04, 0x46, 0x43, 0xb1, 0x1e, 0x41, - 0xcf, 0x9c, 0xd9, 0xf6, 0x96, 0x0e, 0xa0, 0x2f, 0x4e, 0x71, 0x9e, 0xe1, 0x87, 0x30, 0x0f, 0xd6, - 0x4c, 0x1a, 0x81, 0x6e, 0x7f, 0x1c, 0xbc, 0xd6, 0xe4, 0x20, 0x03, 0xf2, 0xa6, 0x81, 0xc7, 0x24, - 0xb8, 0x63, 0x9a, 0x86, 0xf9, 0xc5, 0x21, 0xe8, 0xee, 0x14, 0x1c, 0x3a, 0x39, 0x80, 0xee, 0xf8, - 0x5b, 0x8c, 0x7b, 0x04, 0xc1, 0x4d, 0x01, 0x68, 0x50, 0xeb, 0x45, 0xc5, 0x6a, 0xbc, 0x26, 0x81, - 0xe4, 0xa5, 0xdc, 0x39, 0x0c, 0xbc, 0x41, 0xd0, 0x64, 0x4f, 0x83, 0x63, 0x98, 0xf3, 0x06, 0xbf, - 0xf0, 0xcb, 0x05, 0x64, 0x72, 0x94, 0x6c, 0x46, 0xc3, 0x63, 0x42, 0x26, 0x10, 0x18, 0x77, 0x96, - 0xd7, 0x73, 0x15, 0x37, 0xa3, 0xb0, 0xd5, 0x03, 0x38, 0xc6, 0x73, 0xc0, 0xf1, 0xd0, 0xe2, 0x8c, - 0x64, 0x4b, 0x25, 0x62, 0xcb, 0x52, 0xdb, 0x7a, 0x53, 0xf7, 0x3b, 0x04, 0xcb, 0x68, 0xd2, 0x08, - 0x55, 0x01, 0xa0, 0x01, 0x4e, 0xdb, 0x4d, 0x82, 0xe1, 0x37, 0x8a, 0x80, 0xc3, 0x14, 0x99, 0x17, - 0x81, 0xa3, 0x58, 0x41, 0x48, 0x94, 0x18, 0xbc, 0x81, 0x99, 0x72, 0xad, 0x2a, 0xb4, 0x6f, 0xa1, - 0x06, 0xfe, 0xe6, 0x1f, 0x0f, 0x82, 0x05, 0x46, 0x09, 0xf8, 0xb2, 0xdc, 0xdf, 0xb1, 0xbe, 0x18, - 0x5a, 0x40, 0x75, 0x64, 0x68, 0x01, 0x5a, 0xa9, 0xac, 0x50, 0x18, 0x74, 0x79, 0xa8, 0x2a, 0xf6, - 0xb7, 0x52, 0x3e, 0xf1, 0x25, 0x39, 0x4d, 0x0b, 0x8d, 0xd2, 0x1e, 0xe4, 0x13, 0xde, 0x5e, 0xc9, - 0xd6, 0x5a, 0x58, 0x42, 0xcb, 0xdc, 0x1f, 0x91, 0xe4, 0x52, 0xc5, 0x88, 0x34, 0xfd, 0xc2, 0x3b, - 0x43, 0x5d, 0xca, 0xc0, 0xbf, 0x5b, 0x40, 0x72, 0x63, 0xa5, 0x1f, 0x32, 0x2b, 0x31, 0x67, 0x4e, - 0xcd, 0xdd, 0x42, 0x4b, 0x52, 0x8a, 0x01, 0x63, 0x27, 0x76, 0x0f, 0xc4, 0xdb, 0xd4, 0xc9, 0x9c, - 0xe3, 0xe4, 0x73, 0xca, 0xc1, 0x47, 0x1a, 0x53, 0xcc, 0x7f, 0x76, 0x82, 0x95, 0x4d, 0xc0, 0xfd, - 0xaa, 0xc4, 0x9e, 0x1a, 0xf2, 0xb1, 0x91, 0x9f, 0x95, 0xfb, 0x7f, 0xef, 0x9c, 0x7d, 0x51, 0x1e, - 0xe0, 0x73, 0xa5, 0xf3, 0x3a, 0xbc, 0xe6, 0xd5, 0x55, 0x1a, 0xf6, 0xc4, 0xe6, 0x9b, 0x19, 0x78, - 0xa5, 0xcd, 0x4c, 0x50, 0x12, 0xa0, 0xf4, 0x9a, 0x26, 0x28, 0x45, 0xcc, 0x4d, 0xea, 0x05, 0xc0, - 0xe9, 0x22, 0xc9, 0x7f, 0x7b, 0x84, 0x4d, 0xf7, 0x4d, 0x64, 0xf9, 0x69, 0xb9, 0xf7, 0x87, 0xce, - 0x59, 0xb1, 0xdf, 0x97, 0x06, 0xe7, 0x2f, 0x38, 0x71, 0xfb, 0x73, 0x89, 0xf6, 0xe3, 0x54, 0x10, - 0x4c, 0xe4, 0x28, 0x57, 0xde, 0xd5, 0xa8, 0xac, 0x65, 0x5b, 0xc3, 0xf1, 0x04, 0xcd, 0xe4, 0x70, - 0x22, 0x90, 0x35, 0x54, 0x28, 0xb1, 0x07, 0x74, 0x52, 0xdc, 0x3e, 0x40, 0xef, 0x90, 0x4e, 0xa4, - 0xb2, 0xf9, 0x1c, 0x28, 0xa2, 0x2a, 0x54, 0x13, 0x98, 0x16, 0x1c, 0xcb, 0xa2, 0x54, 0xfa, 0xb4, - 0xb5, 0x81, 0x7e, 0x06, 0x17, 0x42, 0xd2, 0x23, 0x64, 0xa4, 0x68, 0xba, 0x46, 0xf5, 0xb3, 0x6f, - 0x06, 0x2d, 0xf9, 0xe7, 0x25, 0x76, 0xa2, 0x7f, 0x95, 0x67, 0xaa, 0xd8, 0xed, 0x13, 0xc7, 0xec, - 0x19, 0xb9, 0xdf, 0x54, 0xdb, 0x59, 0x07, 0x65, 0x3d, 0x34, 0xdb, 0x71, 0xaa, 0x13, 0x2b, 0xa5, - 0x17, 0x78, 0x89, 0xa7, 0x2c, 0x6e, 0xeb, 0x1f, 0x9d, 0x63, 0x92, 0x4f, 0xc1, 0x51, 0x34, 0xd0, - 0x47, 0x6d, 0xb3, 0xe3, 0xbd, 0xa3, 0x5a, 0xfe, 0x82, 0xdc, 0x73, 0xc0, 0x3d, 0x7b, 0x5a, 0xee, - 0x3d, 0xe2, 0x75, 0x28, 0x8b, 0xa5, 0x9e, 0x96, 0xce, 0x4d, 0x71, 0x08, 0x50, 0x98, 0x7e, 0x4b, - 0xfe, 0x87, 0x12, 0xe3, 0x83, 0x33, 0x3f, 0xee, 0xc8, 0x7d, 0x47, 0xbf, 0xb3, 0x67, 0xe5, 0xfe, - 0x33, 0x43, 0xe7, 0x7d, 0x90, 0xe2, 0x9d, 0xec, 0x40, 0x5c, 0xb8, 0x3b, 0x2e, 0xf8, 0x36, 0x7a, - 0x9a, 0x12, 0x9b, 0xd0, 0x31, 0x06, 0x16, 0x91, 0xc9, 0x4c, 0xf4, 0x4e, 0x1b, 0x4d, 0x9c, 0x4f, - 0x4a, 0x21, 0xc1, 0x2b, 0xfa, 0xac, 0x28, 0x79, 0x83, 0x8d, 0x99, 0x80, 0xe6, 0x33, 0x72, 0xe8, - 0x8c, 0x71, 0xf6, 0x69, 0xb9, 0xcb, 0x80, 0xf0, 0x22, 0xc8, 0x75, 0xce, 0x2c, 0x66, 0x66, 0xc4, - 0x02, 0x63, 0xbc, 0x0e, 0x44, 0xc2, 0x01, 0x82, 0x99, 0x46, 0xfc, 0xbc, 0xc4, 0x66, 0x86, 0x0f, - 0x07, 0xf9, 0x79, 0x79, 0xa0, 0x29, 0xe3, 0xec, 0x9c, 0x3c, 0xd8, 0x90, 0xd1, 0xa1, 0xfa, 0x09, - 0x87, 0xe2, 0xa2, 0x1c, 0x85, 0xaf, 0x15, 0xbd, 0xa3, 0x46, 0xc9, 0xeb, 0x6c, 0x22, 0x1b, 0x23, - 0xe6, 0x2e, 0x33, 0x7c, 0xb2, 0x38, 0x3b, 0x29, 0xef, 0x87, 0xbd, 0x0a, 0x30, 0xa7, 0x62, 0x1b, - 0x88, 0x38, 0xc4, 0x36, 0x96, 0x00, 0x06, 0x99, 0xb3, 0x4a, 0xfe, 0xeb, 0x12, 0x7b, 0x7e, 0xcf, - 0xf9, 0x1f, 0x9f, 0x97, 0x87, 0x1e, 0x13, 0xf6, 0x4a, 0x63, 0xa7, 0x06, 0x43, 0xa5, 0x09, 0xf2, - 0x54, 0x63, 0x34, 0x91, 0x26, 0x9c, 0x5c, 0xc2, 0xcf, 0x4a, 0xec, 0xd4, 0xd0, 0x5e, 0x8c, 0x9f, - 0x93, 0x07, 0x99, 0xee, 0xcd, 0x9e, 0x97, 0x07, 0xea, 0xe8, 0x1c, 0xfa, 0x1e, 0xbe, 0x62, 0xe3, - 0x1c, 0x45, 0xb3, 0xa1, 0x9f, 0x81, 0x78, 0xfe, 0x0b, 0xf0, 0x96, 0xe1, 0xd0, 0x9a, 0xf7, 0x5d, - 0xb2, 0x5b, 0x1b, 0x95, 0x7b, 0xcb, 0x3e, 0x10, 0xdd, 0xa1, 0x82, 0x6c, 0xb6, 0xf3, 0x32, 0x6c, - 0x25, 0x82, 0xd8, 0xf2, 0x82, 0x06, 0x2a, 0x5b, 0xa7, 0x1f, 0x49, 0xf1, 0xcb, 0x06, 0x1f, 0x04, - 0x25, 0x79, 0xb0, 0xef, 0x0e, 0xc6, 0xf3, 0x60, 0xdf, 0x03, 0xd4, 0x38, 0x84, 0xdd, 0x72, 0xed, - 0xd8, 0x06, 0xdf, 0x1e, 0x93, 0xbc, 0x03, 0x39, 0xb9, 0xaf, 0x0a, 0x17, 0x72, 0xf2, 0x2e, 0x20, - 0xa4, 0x90, 0x93, 0x77, 0xab, 0xe0, 0xce, 0x73, 0x70, 0x6f, 0xc5, 0x6c, 0xe0, 0xbb, 0x4d, 0xf1, - 0xb7, 0xf7, 0xcb, 0x59, 0xf2, 0xf4, 0x85, 0xb4, 0x3c, 0x51, 0xd6, 0x31, 0x15, 0xcc, 0x78, 0x13, - 0xd6, 0x5c, 0xf2, 0xc8, 0x58, 0xd6, 0x46, 0x3e, 0x29, 0x95, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, - 0x89, 0xc7, 0x62, 0x6f, 0x34, 0x25, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/credentials.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/credentials.pb.go deleted file mode 100644 index 4da07f3e..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/credentials.pb.go +++ /dev/null @@ -1,874 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_credentials.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type CCredentials_TestAvailablePassword_Request struct { - Password *string `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"` - ShaDigestPassword []byte `protobuf:"bytes,2,opt,name=sha_digest_password" json:"sha_digest_password,omitempty"` - AccountName *string `protobuf:"bytes,3,opt,name=account_name" json:"account_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_TestAvailablePassword_Request) Reset() { - *m = CCredentials_TestAvailablePassword_Request{} -} -func (m *CCredentials_TestAvailablePassword_Request) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_TestAvailablePassword_Request) ProtoMessage() {} -func (*CCredentials_TestAvailablePassword_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{0} -} - -func (m *CCredentials_TestAvailablePassword_Request) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CCredentials_TestAvailablePassword_Request) GetShaDigestPassword() []byte { - if m != nil { - return m.ShaDigestPassword - } - return nil -} - -func (m *CCredentials_TestAvailablePassword_Request) GetAccountName() string { - if m != nil && m.AccountName != nil { - return *m.AccountName - } - return "" -} - -type CCredentials_TestAvailablePassword_Response struct { - IsValid *bool `protobuf:"varint,3,opt,name=is_valid" json:"is_valid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_TestAvailablePassword_Response) Reset() { - *m = CCredentials_TestAvailablePassword_Response{} -} -func (m *CCredentials_TestAvailablePassword_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_TestAvailablePassword_Response) ProtoMessage() {} -func (*CCredentials_TestAvailablePassword_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{1} -} - -func (m *CCredentials_TestAvailablePassword_Response) GetIsValid() bool { - if m != nil && m.IsValid != nil { - return *m.IsValid - } - return false -} - -type CCredentials_GetSteamGuardDetails_Request struct { - IncludeNewAuthentications *bool `protobuf:"varint,1,opt,name=include_new_authentications,def=1" json:"include_new_authentications,omitempty"` - Webcookie *string `protobuf:"bytes,2,opt,name=webcookie" json:"webcookie,omitempty"` - TimestampMinimumWanted *uint32 `protobuf:"fixed32,3,opt,name=timestamp_minimum_wanted" json:"timestamp_minimum_wanted,omitempty"` - Ipaddress *int32 `protobuf:"varint,4,opt,name=ipaddress" json:"ipaddress,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_GetSteamGuardDetails_Request) Reset() { - *m = CCredentials_GetSteamGuardDetails_Request{} -} -func (m *CCredentials_GetSteamGuardDetails_Request) String() string { return proto.CompactTextString(m) } -func (*CCredentials_GetSteamGuardDetails_Request) ProtoMessage() {} -func (*CCredentials_GetSteamGuardDetails_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{2} -} - -const Default_CCredentials_GetSteamGuardDetails_Request_IncludeNewAuthentications bool = true - -func (m *CCredentials_GetSteamGuardDetails_Request) GetIncludeNewAuthentications() bool { - if m != nil && m.IncludeNewAuthentications != nil { - return *m.IncludeNewAuthentications - } - return Default_CCredentials_GetSteamGuardDetails_Request_IncludeNewAuthentications -} - -func (m *CCredentials_GetSteamGuardDetails_Request) GetWebcookie() string { - if m != nil && m.Webcookie != nil { - return *m.Webcookie - } - return "" -} - -func (m *CCredentials_GetSteamGuardDetails_Request) GetTimestampMinimumWanted() uint32 { - if m != nil && m.TimestampMinimumWanted != nil { - return *m.TimestampMinimumWanted - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Request) GetIpaddress() int32 { - if m != nil && m.Ipaddress != nil { - return *m.Ipaddress - } - return 0 -} - -type CCredentials_GetSteamGuardDetails_Response struct { - IsSteamguardEnabled *bool `protobuf:"varint,1,opt,name=is_steamguard_enabled" json:"is_steamguard_enabled,omitempty"` - TimestampSteamguardEnabled *uint32 `protobuf:"fixed32,2,opt,name=timestamp_steamguard_enabled" json:"timestamp_steamguard_enabled,omitempty"` - DeprecatedNewauthentication []*CCredentials_GetSteamGuardDetails_Response_NewAuthentication `protobuf:"bytes,3,rep,name=deprecated_newauthentication" json:"deprecated_newauthentication,omitempty"` - DeprecatedMachineNameUserchosen *string `protobuf:"bytes,4,opt,name=deprecated_machine_name_userchosen" json:"deprecated_machine_name_userchosen,omitempty"` - DeprecatedTimestampMachineSteamguardEnabled *uint32 `protobuf:"fixed32,5,opt,name=deprecated_timestamp_machine_steamguard_enabled" json:"deprecated_timestamp_machine_steamguard_enabled,omitempty"` - DeprecatedAuthenticationExistsFromGeolocBeforeMintime *bool `protobuf:"varint,6,opt,name=deprecated_authentication_exists_from_geoloc_before_mintime" json:"deprecated_authentication_exists_from_geoloc_before_mintime,omitempty"` - DeprecatedMachineId *uint64 `protobuf:"varint,7,opt,name=deprecated_machine_id" json:"deprecated_machine_id,omitempty"` - SessionData []*CCredentials_GetSteamGuardDetails_Response_SessionData `protobuf:"bytes,8,rep,name=session_data" json:"session_data,omitempty"` - IsTwofactorEnabled *bool `protobuf:"varint,9,opt,name=is_twofactor_enabled" json:"is_twofactor_enabled,omitempty"` - TimestampTwofactorEnabled *uint32 `protobuf:"fixed32,10,opt,name=timestamp_twofactor_enabled" json:"timestamp_twofactor_enabled,omitempty"` - IsPhoneVerified *bool `protobuf:"varint,11,opt,name=is_phone_verified" json:"is_phone_verified,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_GetSteamGuardDetails_Response) Reset() { - *m = CCredentials_GetSteamGuardDetails_Response{} -} -func (m *CCredentials_GetSteamGuardDetails_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_GetSteamGuardDetails_Response) ProtoMessage() {} -func (*CCredentials_GetSteamGuardDetails_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{3} -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetIsSteamguardEnabled() bool { - if m != nil && m.IsSteamguardEnabled != nil { - return *m.IsSteamguardEnabled - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetTimestampSteamguardEnabled() uint32 { - if m != nil && m.TimestampSteamguardEnabled != nil { - return *m.TimestampSteamguardEnabled - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetDeprecatedNewauthentication() []*CCredentials_GetSteamGuardDetails_Response_NewAuthentication { - if m != nil { - return m.DeprecatedNewauthentication - } - return nil -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetDeprecatedMachineNameUserchosen() string { - if m != nil && m.DeprecatedMachineNameUserchosen != nil { - return *m.DeprecatedMachineNameUserchosen - } - return "" -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetDeprecatedTimestampMachineSteamguardEnabled() uint32 { - if m != nil && m.DeprecatedTimestampMachineSteamguardEnabled != nil { - return *m.DeprecatedTimestampMachineSteamguardEnabled - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetDeprecatedAuthenticationExistsFromGeolocBeforeMintime() bool { - if m != nil && m.DeprecatedAuthenticationExistsFromGeolocBeforeMintime != nil { - return *m.DeprecatedAuthenticationExistsFromGeolocBeforeMintime - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetDeprecatedMachineId() uint64 { - if m != nil && m.DeprecatedMachineId != nil { - return *m.DeprecatedMachineId - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetSessionData() []*CCredentials_GetSteamGuardDetails_Response_SessionData { - if m != nil { - return m.SessionData - } - return nil -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetIsTwofactorEnabled() bool { - if m != nil && m.IsTwofactorEnabled != nil { - return *m.IsTwofactorEnabled - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetTimestampTwofactorEnabled() uint32 { - if m != nil && m.TimestampTwofactorEnabled != nil { - return *m.TimestampTwofactorEnabled - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response) GetIsPhoneVerified() bool { - if m != nil && m.IsPhoneVerified != nil { - return *m.IsPhoneVerified - } - return false -} - -type CCredentials_GetSteamGuardDetails_Response_NewAuthentication struct { - TimestampSteamguardEnabled *uint32 `protobuf:"fixed32,1,opt,name=timestamp_steamguard_enabled" json:"timestamp_steamguard_enabled,omitempty"` - IsWebCookie *bool `protobuf:"varint,2,opt,name=is_web_cookie" json:"is_web_cookie,omitempty"` - Ipaddress *int32 `protobuf:"varint,3,opt,name=ipaddress" json:"ipaddress,omitempty"` - GeolocInfo *string `protobuf:"bytes,4,opt,name=geoloc_info" json:"geoloc_info,omitempty"` - IsRemembered *bool `protobuf:"varint,5,opt,name=is_remembered" json:"is_remembered,omitempty"` - MachineNameUserSupplied *string `protobuf:"bytes,6,opt,name=machine_name_user_supplied" json:"machine_name_user_supplied,omitempty"` - Status *int32 `protobuf:"varint,7,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) Reset() { - *m = CCredentials_GetSteamGuardDetails_Response_NewAuthentication{} -} -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_GetSteamGuardDetails_Response_NewAuthentication) ProtoMessage() {} -func (*CCredentials_GetSteamGuardDetails_Response_NewAuthentication) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{3, 0} -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetTimestampSteamguardEnabled() uint32 { - if m != nil && m.TimestampSteamguardEnabled != nil { - return *m.TimestampSteamguardEnabled - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetIsWebCookie() bool { - if m != nil && m.IsWebCookie != nil { - return *m.IsWebCookie - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetIpaddress() int32 { - if m != nil && m.Ipaddress != nil { - return *m.Ipaddress - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetGeolocInfo() string { - if m != nil && m.GeolocInfo != nil { - return *m.GeolocInfo - } - return "" -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetIsRemembered() bool { - if m != nil && m.IsRemembered != nil { - return *m.IsRemembered - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetMachineNameUserSupplied() string { - if m != nil && m.MachineNameUserSupplied != nil { - return *m.MachineNameUserSupplied - } - return "" -} - -func (m *CCredentials_GetSteamGuardDetails_Response_NewAuthentication) GetStatus() int32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type CCredentials_GetSteamGuardDetails_Response_SessionData struct { - MachineId *uint64 `protobuf:"varint,1,opt,name=machine_id" json:"machine_id,omitempty"` - MachineNameUserchosen *string `protobuf:"bytes,2,opt,name=machine_name_userchosen" json:"machine_name_userchosen,omitempty"` - TimestampMachineSteamguardEnabled *uint32 `protobuf:"fixed32,3,opt,name=timestamp_machine_steamguard_enabled" json:"timestamp_machine_steamguard_enabled,omitempty"` - AuthenticationExistsFromGeolocBeforeMintime *bool `protobuf:"varint,4,opt,name=authentication_exists_from_geoloc_before_mintime" json:"authentication_exists_from_geoloc_before_mintime,omitempty"` - Newauthentication []*CCredentials_GetSteamGuardDetails_Response_NewAuthentication `protobuf:"bytes,5,rep,name=newauthentication" json:"newauthentication,omitempty"` - AuthenticationExistsFromSameIpBeforeMintime *bool `protobuf:"varint,6,opt,name=authentication_exists_from_same_ip_before_mintime" json:"authentication_exists_from_same_ip_before_mintime,omitempty"` - PublicIpv4 *uint32 `protobuf:"varint,7,opt,name=public_ipv4" json:"public_ipv4,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) Reset() { - *m = CCredentials_GetSteamGuardDetails_Response_SessionData{} -} -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_GetSteamGuardDetails_Response_SessionData) ProtoMessage() {} -func (*CCredentials_GetSteamGuardDetails_Response_SessionData) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{3, 1} -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetMachineId() uint64 { - if m != nil && m.MachineId != nil { - return *m.MachineId - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetMachineNameUserchosen() string { - if m != nil && m.MachineNameUserchosen != nil { - return *m.MachineNameUserchosen - } - return "" -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetTimestampMachineSteamguardEnabled() uint32 { - if m != nil && m.TimestampMachineSteamguardEnabled != nil { - return *m.TimestampMachineSteamguardEnabled - } - return 0 -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetAuthenticationExistsFromGeolocBeforeMintime() bool { - if m != nil && m.AuthenticationExistsFromGeolocBeforeMintime != nil { - return *m.AuthenticationExistsFromGeolocBeforeMintime - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetNewauthentication() []*CCredentials_GetSteamGuardDetails_Response_NewAuthentication { - if m != nil { - return m.Newauthentication - } - return nil -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetAuthenticationExistsFromSameIpBeforeMintime() bool { - if m != nil && m.AuthenticationExistsFromSameIpBeforeMintime != nil { - return *m.AuthenticationExistsFromSameIpBeforeMintime - } - return false -} - -func (m *CCredentials_GetSteamGuardDetails_Response_SessionData) GetPublicIpv4() uint32 { - if m != nil && m.PublicIpv4 != nil { - return *m.PublicIpv4 - } - return 0 -} - -type CCredentials_NewMachineNotificationDialog_Request struct { - IsApproved *bool `protobuf:"varint,1,opt,name=is_approved" json:"is_approved,omitempty"` - IsWizardComplete *bool `protobuf:"varint,2,opt,name=is_wizard_complete" json:"is_wizard_complete,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_NewMachineNotificationDialog_Request) Reset() { - *m = CCredentials_NewMachineNotificationDialog_Request{} -} -func (m *CCredentials_NewMachineNotificationDialog_Request) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_NewMachineNotificationDialog_Request) ProtoMessage() {} -func (*CCredentials_NewMachineNotificationDialog_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{4} -} - -func (m *CCredentials_NewMachineNotificationDialog_Request) GetIsApproved() bool { - if m != nil && m.IsApproved != nil { - return *m.IsApproved - } - return false -} - -func (m *CCredentials_NewMachineNotificationDialog_Request) GetIsWizardComplete() bool { - if m != nil && m.IsWizardComplete != nil { - return *m.IsWizardComplete - } - return false -} - -type CCredentials_NewMachineNotificationDialog_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_NewMachineNotificationDialog_Response) Reset() { - *m = CCredentials_NewMachineNotificationDialog_Response{} -} -func (m *CCredentials_NewMachineNotificationDialog_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_NewMachineNotificationDialog_Response) ProtoMessage() {} -func (*CCredentials_NewMachineNotificationDialog_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{5} -} - -type CCredentials_ValidateEmailAddress_Request struct { - Stoken *string `protobuf:"bytes,1,opt,name=stoken" json:"stoken,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_ValidateEmailAddress_Request) Reset() { - *m = CCredentials_ValidateEmailAddress_Request{} -} -func (m *CCredentials_ValidateEmailAddress_Request) String() string { return proto.CompactTextString(m) } -func (*CCredentials_ValidateEmailAddress_Request) ProtoMessage() {} -func (*CCredentials_ValidateEmailAddress_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{6} -} - -func (m *CCredentials_ValidateEmailAddress_Request) GetStoken() string { - if m != nil && m.Stoken != nil { - return *m.Stoken - } - return "" -} - -type CCredentials_ValidateEmailAddress_Response struct { - WasValidated *bool `protobuf:"varint,1,opt,name=was_validated" json:"was_validated,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_ValidateEmailAddress_Response) Reset() { - *m = CCredentials_ValidateEmailAddress_Response{} -} -func (m *CCredentials_ValidateEmailAddress_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_ValidateEmailAddress_Response) ProtoMessage() {} -func (*CCredentials_ValidateEmailAddress_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{7} -} - -func (m *CCredentials_ValidateEmailAddress_Response) GetWasValidated() bool { - if m != nil && m.WasValidated != nil { - return *m.WasValidated - } - return false -} - -type CCredentials_SteamGuardPhishingReport_Request struct { - ParamString *string `protobuf:"bytes,1,opt,name=param_string" json:"param_string,omitempty"` - IpaddressActual *uint32 `protobuf:"varint,2,opt,name=ipaddress_actual" json:"ipaddress_actual,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_SteamGuardPhishingReport_Request) Reset() { - *m = CCredentials_SteamGuardPhishingReport_Request{} -} -func (m *CCredentials_SteamGuardPhishingReport_Request) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_SteamGuardPhishingReport_Request) ProtoMessage() {} -func (*CCredentials_SteamGuardPhishingReport_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{8} -} - -func (m *CCredentials_SteamGuardPhishingReport_Request) GetParamString() string { - if m != nil && m.ParamString != nil { - return *m.ParamString - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Request) GetIpaddressActual() uint32 { - if m != nil && m.IpaddressActual != nil { - return *m.IpaddressActual - } - return 0 -} - -type CCredentials_SteamGuardPhishingReport_Response struct { - IpaddressLoginattempt *uint32 `protobuf:"varint,1,opt,name=ipaddress_loginattempt" json:"ipaddress_loginattempt,omitempty"` - CountrynameLoginattempt *string `protobuf:"bytes,2,opt,name=countryname_loginattempt" json:"countryname_loginattempt,omitempty"` - StatenameLoginattempt *string `protobuf:"bytes,3,opt,name=statename_loginattempt" json:"statename_loginattempt,omitempty"` - CitynameLoginattempt *string `protobuf:"bytes,4,opt,name=cityname_loginattempt" json:"cityname_loginattempt,omitempty"` - IpaddressActual *uint32 `protobuf:"varint,5,opt,name=ipaddress_actual" json:"ipaddress_actual,omitempty"` - CountrynameActual *string `protobuf:"bytes,6,opt,name=countryname_actual" json:"countryname_actual,omitempty"` - StatenameActual *string `protobuf:"bytes,7,opt,name=statename_actual" json:"statename_actual,omitempty"` - CitynameActual *string `protobuf:"bytes,8,opt,name=cityname_actual" json:"cityname_actual,omitempty"` - SteamguardCode *string `protobuf:"bytes,9,opt,name=steamguard_code" json:"steamguard_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) Reset() { - *m = CCredentials_SteamGuardPhishingReport_Response{} -} -func (m *CCredentials_SteamGuardPhishingReport_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_SteamGuardPhishingReport_Response) ProtoMessage() {} -func (*CCredentials_SteamGuardPhishingReport_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{9} -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetIpaddressLoginattempt() uint32 { - if m != nil && m.IpaddressLoginattempt != nil { - return *m.IpaddressLoginattempt - } - return 0 -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetCountrynameLoginattempt() string { - if m != nil && m.CountrynameLoginattempt != nil { - return *m.CountrynameLoginattempt - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetStatenameLoginattempt() string { - if m != nil && m.StatenameLoginattempt != nil { - return *m.StatenameLoginattempt - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetCitynameLoginattempt() string { - if m != nil && m.CitynameLoginattempt != nil { - return *m.CitynameLoginattempt - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetIpaddressActual() uint32 { - if m != nil && m.IpaddressActual != nil { - return *m.IpaddressActual - } - return 0 -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetCountrynameActual() string { - if m != nil && m.CountrynameActual != nil { - return *m.CountrynameActual - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetStatenameActual() string { - if m != nil && m.StatenameActual != nil { - return *m.StatenameActual - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetCitynameActual() string { - if m != nil && m.CitynameActual != nil { - return *m.CitynameActual - } - return "" -} - -func (m *CCredentials_SteamGuardPhishingReport_Response) GetSteamguardCode() string { - if m != nil && m.SteamguardCode != nil { - return *m.SteamguardCode - } - return "" -} - -type CCredentials_AccountLockRequest_Request struct { - ParamString *string `protobuf:"bytes,1,opt,name=param_string" json:"param_string,omitempty"` - IpaddressActual *uint32 `protobuf:"varint,2,opt,name=ipaddress_actual" json:"ipaddress_actual,omitempty"` - QueryOnly *bool `protobuf:"varint,3,opt,name=query_only" json:"query_only,omitempty"` - EmailMessageType *int32 `protobuf:"varint,4,opt,name=email_message_type" json:"email_message_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_AccountLockRequest_Request) Reset() { - *m = CCredentials_AccountLockRequest_Request{} -} -func (m *CCredentials_AccountLockRequest_Request) String() string { return proto.CompactTextString(m) } -func (*CCredentials_AccountLockRequest_Request) ProtoMessage() {} -func (*CCredentials_AccountLockRequest_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{10} -} - -func (m *CCredentials_AccountLockRequest_Request) GetParamString() string { - if m != nil && m.ParamString != nil { - return *m.ParamString - } - return "" -} - -func (m *CCredentials_AccountLockRequest_Request) GetIpaddressActual() uint32 { - if m != nil && m.IpaddressActual != nil { - return *m.IpaddressActual - } - return 0 -} - -func (m *CCredentials_AccountLockRequest_Request) GetQueryOnly() bool { - if m != nil && m.QueryOnly != nil { - return *m.QueryOnly - } - return false -} - -func (m *CCredentials_AccountLockRequest_Request) GetEmailMessageType() int32 { - if m != nil && m.EmailMessageType != nil { - return *m.EmailMessageType - } - return 0 -} - -type CCredentials_AccountLockRequest_Response struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - AccountAlreadyLocked *bool `protobuf:"varint,2,opt,name=account_already_locked" json:"account_already_locked,omitempty"` - ExpiredLink *bool `protobuf:"varint,3,opt,name=expired_link" json:"expired_link,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_AccountLockRequest_Response) Reset() { - *m = CCredentials_AccountLockRequest_Response{} -} -func (m *CCredentials_AccountLockRequest_Response) String() string { return proto.CompactTextString(m) } -func (*CCredentials_AccountLockRequest_Response) ProtoMessage() {} -func (*CCredentials_AccountLockRequest_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{11} -} - -func (m *CCredentials_AccountLockRequest_Response) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *CCredentials_AccountLockRequest_Response) GetAccountAlreadyLocked() bool { - if m != nil && m.AccountAlreadyLocked != nil { - return *m.AccountAlreadyLocked - } - return false -} - -func (m *CCredentials_AccountLockRequest_Response) GetExpiredLink() bool { - if m != nil && m.ExpiredLink != nil { - return *m.ExpiredLink - } - return false -} - -type CCredentials_LastCredentialChangeTime_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_LastCredentialChangeTime_Request) Reset() { - *m = CCredentials_LastCredentialChangeTime_Request{} -} -func (m *CCredentials_LastCredentialChangeTime_Request) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_LastCredentialChangeTime_Request) ProtoMessage() {} -func (*CCredentials_LastCredentialChangeTime_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{12} -} - -type CCredentials_LastCredentialChangeTime_Response struct { - TimestampLastPasswordChange *uint32 `protobuf:"fixed32,1,opt,name=timestamp_last_password_change" json:"timestamp_last_password_change,omitempty"` - TimestampLastEmailChange *uint32 `protobuf:"fixed32,2,opt,name=timestamp_last_email_change" json:"timestamp_last_email_change,omitempty"` - TimestampLastPasswordReset *uint32 `protobuf:"fixed32,3,opt,name=timestamp_last_password_reset" json:"timestamp_last_password_reset,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_LastCredentialChangeTime_Response) Reset() { - *m = CCredentials_LastCredentialChangeTime_Response{} -} -func (m *CCredentials_LastCredentialChangeTime_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_LastCredentialChangeTime_Response) ProtoMessage() {} -func (*CCredentials_LastCredentialChangeTime_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{13} -} - -func (m *CCredentials_LastCredentialChangeTime_Response) GetTimestampLastPasswordChange() uint32 { - if m != nil && m.TimestampLastPasswordChange != nil { - return *m.TimestampLastPasswordChange - } - return 0 -} - -func (m *CCredentials_LastCredentialChangeTime_Response) GetTimestampLastEmailChange() uint32 { - if m != nil && m.TimestampLastEmailChange != nil { - return *m.TimestampLastEmailChange - } - return 0 -} - -func (m *CCredentials_LastCredentialChangeTime_Response) GetTimestampLastPasswordReset() uint32 { - if m != nil && m.TimestampLastPasswordReset != nil { - return *m.TimestampLastPasswordReset - } - return 0 -} - -type CCredentials_GetAccountAuthSecret_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_GetAccountAuthSecret_Request) Reset() { - *m = CCredentials_GetAccountAuthSecret_Request{} -} -func (m *CCredentials_GetAccountAuthSecret_Request) String() string { return proto.CompactTextString(m) } -func (*CCredentials_GetAccountAuthSecret_Request) ProtoMessage() {} -func (*CCredentials_GetAccountAuthSecret_Request) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{14} -} - -type CCredentials_GetAccountAuthSecret_Response struct { - SecretId *int32 `protobuf:"varint,1,opt,name=secret_id" json:"secret_id,omitempty"` - Secret []byte `protobuf:"bytes,2,opt,name=secret" json:"secret,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CCredentials_GetAccountAuthSecret_Response) Reset() { - *m = CCredentials_GetAccountAuthSecret_Response{} -} -func (m *CCredentials_GetAccountAuthSecret_Response) String() string { - return proto.CompactTextString(m) -} -func (*CCredentials_GetAccountAuthSecret_Response) ProtoMessage() {} -func (*CCredentials_GetAccountAuthSecret_Response) Descriptor() ([]byte, []int) { - return credentials_fileDescriptor0, []int{15} -} - -func (m *CCredentials_GetAccountAuthSecret_Response) GetSecretId() int32 { - if m != nil && m.SecretId != nil { - return *m.SecretId - } - return 0 -} - -func (m *CCredentials_GetAccountAuthSecret_Response) GetSecret() []byte { - if m != nil { - return m.Secret - } - return nil -} - -func init() { - proto.RegisterType((*CCredentials_TestAvailablePassword_Request)(nil), "CCredentials_TestAvailablePassword_Request") - proto.RegisterType((*CCredentials_TestAvailablePassword_Response)(nil), "CCredentials_TestAvailablePassword_Response") - proto.RegisterType((*CCredentials_GetSteamGuardDetails_Request)(nil), "CCredentials_GetSteamGuardDetails_Request") - proto.RegisterType((*CCredentials_GetSteamGuardDetails_Response)(nil), "CCredentials_GetSteamGuardDetails_Response") - proto.RegisterType((*CCredentials_GetSteamGuardDetails_Response_NewAuthentication)(nil), "CCredentials_GetSteamGuardDetails_Response.NewAuthentication") - proto.RegisterType((*CCredentials_GetSteamGuardDetails_Response_SessionData)(nil), "CCredentials_GetSteamGuardDetails_Response.SessionData") - proto.RegisterType((*CCredentials_NewMachineNotificationDialog_Request)(nil), "CCredentials_NewMachineNotificationDialog_Request") - proto.RegisterType((*CCredentials_NewMachineNotificationDialog_Response)(nil), "CCredentials_NewMachineNotificationDialog_Response") - proto.RegisterType((*CCredentials_ValidateEmailAddress_Request)(nil), "CCredentials_ValidateEmailAddress_Request") - proto.RegisterType((*CCredentials_ValidateEmailAddress_Response)(nil), "CCredentials_ValidateEmailAddress_Response") - proto.RegisterType((*CCredentials_SteamGuardPhishingReport_Request)(nil), "CCredentials_SteamGuardPhishingReport_Request") - proto.RegisterType((*CCredentials_SteamGuardPhishingReport_Response)(nil), "CCredentials_SteamGuardPhishingReport_Response") - proto.RegisterType((*CCredentials_AccountLockRequest_Request)(nil), "CCredentials_AccountLockRequest_Request") - proto.RegisterType((*CCredentials_AccountLockRequest_Response)(nil), "CCredentials_AccountLockRequest_Response") - proto.RegisterType((*CCredentials_LastCredentialChangeTime_Request)(nil), "CCredentials_LastCredentialChangeTime_Request") - proto.RegisterType((*CCredentials_LastCredentialChangeTime_Response)(nil), "CCredentials_LastCredentialChangeTime_Response") - proto.RegisterType((*CCredentials_GetAccountAuthSecret_Request)(nil), "CCredentials_GetAccountAuthSecret_Request") - proto.RegisterType((*CCredentials_GetAccountAuthSecret_Response)(nil), "CCredentials_GetAccountAuthSecret_Response") -} - -var credentials_fileDescriptor0 = []byte{ - // 1482 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x57, 0x5d, 0x6f, 0x14, 0xd5, - 0x1b, 0xcf, 0x94, 0xbe, 0xec, 0x3e, 0xa5, 0x7f, 0xe8, 0x40, 0x61, 0x59, 0x0a, 0x4c, 0x06, 0xfe, - 0xb6, 0xd0, 0x3a, 0x48, 0x25, 0x41, 0x25, 0xc6, 0x94, 0x56, 0x09, 0x06, 0x90, 0x00, 0x51, 0xef, - 0x4e, 0x4e, 0x67, 0x4e, 0x77, 0x4f, 0x3a, 0x33, 0x67, 0x98, 0x39, 0xb3, 0x4b, 0x4d, 0x4c, 0xc4, - 0x3b, 0xbc, 0xf0, 0xce, 0x0b, 0x13, 0x2f, 0x8d, 0x5f, 0xc0, 0xe8, 0x17, 0xf0, 0x2b, 0xf8, 0x25, - 0xbc, 0x32, 0x7e, 0x03, 0x9f, 0x73, 0xe6, 0xec, 0xfb, 0x6c, 0xbb, 0x4b, 0xbc, 0xdc, 0x39, 0xcf, - 0xcb, 0xef, 0xf9, 0x3d, 0xaf, 0x0b, 0x1b, 0x99, 0x64, 0x34, 0x8a, 0x58, 0x96, 0xd1, 0x06, 0xcb, - 0x88, 0x9f, 0xb2, 0x80, 0xc5, 0x92, 0xd3, 0x30, 0xf3, 0xf4, 0x8b, 0x1f, 0x72, 0xfc, 0xed, 0x25, - 0xa9, 0x90, 0xa2, 0xbe, 0x39, 0x28, 0x9c, 0xc7, 0x7c, 0x9f, 0xb3, 0x80, 0xec, 0xd1, 0x8c, 0x8d, - 0x4a, 0xbb, 0x2f, 0xe0, 0xc6, 0xce, 0x4e, 0xcf, 0x1e, 0x79, 0xce, 0x32, 0xb9, 0xdd, 0xa2, 0x3c, - 0xa4, 0x7b, 0x21, 0x7b, 0x42, 0xb3, 0xac, 0x2d, 0xd2, 0x80, 0x3c, 0x65, 0x2f, 0x72, 0x7c, 0xb0, - 0x4f, 0x43, 0x25, 0x31, 0xdf, 0x6a, 0x96, 0x63, 0xad, 0x57, 0xed, 0x8b, 0x70, 0x26, 0x6b, 0x52, - 0x12, 0x70, 0xf4, 0x25, 0x49, 0xf7, 0x71, 0x06, 0x1f, 0x4f, 0xda, 0x67, 0xe1, 0x24, 0xf5, 0x7d, - 0x91, 0xc7, 0x92, 0xc4, 0x34, 0x62, 0xb5, 0x13, 0x4a, 0xc5, 0xfd, 0x08, 0x36, 0x26, 0x72, 0x99, - 0x25, 0x22, 0xce, 0x98, 0xf2, 0xc9, 0x33, 0xd2, 0xa2, 0x21, 0x0f, 0xb4, 0x81, 0x8a, 0xfb, 0xf7, - 0x0c, 0x5c, 0x1f, 0xb0, 0x70, 0x9f, 0xc9, 0x67, 0x2a, 0xb2, 0xfb, 0x39, 0x4d, 0x83, 0x5d, 0x26, - 0xd1, 0x56, 0xd6, 0xc5, 0x9c, 0xc3, 0x45, 0x1e, 0xfb, 0x61, 0x1e, 0x30, 0x12, 0xb3, 0x36, 0xa1, - 0xb9, 0x6c, 0x2a, 0x3d, 0x9f, 0x4a, 0x8e, 0xf6, 0x75, 0x18, 0x95, 0x0f, 0x66, 0x65, 0x9a, 0xb3, - 0x7b, 0x9f, 0x7e, 0xfb, 0x5b, 0xed, 0x93, 0x2f, 0x9a, 0x0c, 0x25, 0x52, 0x47, 0xa4, 0x4e, 0x2c, - 0xa4, 0x23, 0x85, 0x93, 0x88, 0x24, 0x0f, 0xa9, 0x64, 0x0e, 0x7e, 0x77, 0xd0, 0xc6, 0xa0, 0x09, - 0x07, 0xe9, 0x0d, 0x03, 0x87, 0xc7, 0xfa, 0x39, 0xed, 0xc0, 0xfe, 0xc1, 0x82, 0x6a, 0x9b, 0xed, - 0xf9, 0x42, 0x1c, 0x70, 0xa6, 0xf9, 0xa8, 0xde, 0x7b, 0x65, 0xa1, 0x83, 0xaf, 0x9f, 0xa3, 0x58, - 0x9e, 0xb1, 0x74, 0x2d, 0x73, 0x34, 0x6a, 0x47, 0xc3, 0x76, 0x22, 0xea, 0x37, 0x79, 0xcc, 0x1c, - 0x65, 0xdd, 0x29, 0xd4, 0x3c, 0xe7, 0xc1, 0xbe, 0x93, 0xa0, 0x49, 0xf4, 0xb6, 0xe9, 0x70, 0xb9, - 0x16, 0x86, 0xce, 0x9e, 0x56, 0x0e, 0x14, 0xae, 0x06, 0x93, 0xda, 0xa7, 0x31, 0xd6, 0x31, 0xf0, - 0x60, 0x17, 0xc1, 0xa8, 0x4c, 0x07, 0x8e, 0xd8, 0xd7, 0x02, 0xdb, 0x8f, 0x9c, 0x0c, 0xeb, 0x01, - 0xc1, 0x7a, 0xb6, 0x03, 0x35, 0xc9, 0xb1, 0x3a, 0x24, 0x8d, 0x12, 0x12, 0xf1, 0x98, 0x47, 0x79, - 0x44, 0xda, 0x34, 0x96, 0xac, 0xa0, 0x77, 0xc1, 0x5e, 0x86, 0x2a, 0x4f, 0x68, 0x10, 0xa0, 0xdf, - 0xac, 0x36, 0x8b, 0x9f, 0xe6, 0xdc, 0xbf, 0x2a, 0x43, 0x65, 0x32, 0x86, 0x71, 0x13, 0xfb, 0x25, - 0x58, 0xc1, 0x94, 0xe9, 0x62, 0x6b, 0x28, 0x01, 0xc2, 0x62, 0x95, 0xdb, 0xa2, 0x66, 0x2a, 0xf6, - 0x35, 0x58, 0xed, 0x41, 0x28, 0x91, 0x9a, 0xd1, 0x30, 0x7c, 0x58, 0x0d, 0x18, 0x06, 0x8f, 0x2c, - 0x63, 0xf9, 0x8e, 0xd0, 0x8e, 0x60, 0x4f, 0xac, 0x2f, 0x6e, 0x7d, 0xe8, 0x4d, 0x8e, 0xcb, 0x7b, - 0xcc, 0xda, 0xdb, 0x03, 0x46, 0xec, 0x1b, 0xe0, 0xf6, 0x39, 0x31, 0x0c, 0xea, 0x62, 0x25, 0x8a, - 0x55, 0xbf, 0x29, 0x90, 0x7b, 0x4d, 0x42, 0xd5, 0xbe, 0x03, 0x37, 0xfb, 0x64, 0xfb, 0x48, 0x34, - 0x5a, 0x25, 0x91, 0xcc, 0xe9, 0x48, 0x76, 0xe0, 0x6e, 0x9f, 0xe2, 0x60, 0x18, 0x84, 0xbd, 0xe4, - 0x99, 0xcc, 0xc8, 0x7e, 0x2a, 0x22, 0xd2, 0x60, 0x22, 0x14, 0x3e, 0xd9, 0x63, 0xfb, 0x22, 0x65, - 0x2a, 0x39, 0xca, 0x49, 0x6d, 0x5e, 0x93, 0x86, 0x9c, 0x96, 0x20, 0xc5, 0x9e, 0x58, 0xc0, 0xe7, - 0x59, 0xfb, 0x11, 0x9c, 0x34, 0x29, 0x26, 0x01, 0x95, 0xb4, 0x56, 0xd1, 0xec, 0xdc, 0x99, 0x86, - 0x9d, 0x67, 0x85, 0xfe, 0x2e, 0xaa, 0xdb, 0xab, 0x70, 0x16, 0x33, 0x28, 0xdb, 0x62, 0x9f, 0xfa, - 0x52, 0xa4, 0xdd, 0x80, 0xaa, 0x1a, 0xcb, 0x55, 0xb8, 0xd8, 0x0b, 0x7f, 0x54, 0x08, 0x74, 0xd4, - 0x17, 0x60, 0x19, 0x4d, 0x24, 0x4d, 0x81, 0x30, 0x5b, 0x2c, 0xd5, 0x53, 0xa8, 0xb6, 0xa8, 0xf4, - 0xeb, 0x7f, 0x58, 0xb0, 0x3c, 0x9a, 0x8b, 0xe3, 0xca, 0xc2, 0xd2, 0x66, 0x57, 0x60, 0x09, 0xcd, - 0x62, 0x67, 0x91, 0xbe, 0xd6, 0xaa, 0x0c, 0x16, 0xad, 0xaa, 0xe3, 0x39, 0xfb, 0x0c, 0x2c, 0x1a, - 0x42, 0x79, 0xbc, 0x2f, 0x4c, 0x12, 0x0b, 0xf5, 0x94, 0x45, 0x2c, 0xda, 0x63, 0xa9, 0x49, 0x51, - 0xc5, 0x76, 0xa1, 0x3e, 0x92, 0x7c, 0x92, 0xe5, 0x49, 0x12, 0x2a, 0xd4, 0xf3, 0x5a, 0xf5, 0x7f, - 0x30, 0x8f, 0xd8, 0x64, 0x9e, 0x69, 0xca, 0xe7, 0xea, 0x7f, 0xce, 0xc0, 0x62, 0x3f, 0x67, 0x36, - 0x40, 0x5f, 0x5a, 0x2c, 0x9d, 0x96, 0x2b, 0x70, 0x7e, 0x5c, 0x51, 0xe9, 0x91, 0x60, 0x6f, 0xc2, - 0xb5, 0x89, 0x2a, 0xa9, 0x68, 0xcd, 0xf7, 0xe0, 0x9d, 0xa9, 0xcb, 0x67, 0x56, 0x07, 0xf8, 0x25, - 0x2c, 0x8f, 0xb6, 0xd0, 0xdc, 0x7f, 0xd1, 0x42, 0xef, 0xc3, 0xad, 0x23, 0x30, 0x65, 0x2a, 0x6a, - 0x9e, 0x94, 0xd7, 0x34, 0x66, 0x28, 0xc9, 0xf7, 0x42, 0x8e, 0x19, 0x4a, 0x5a, 0xb7, 0x35, 0xad, - 0x4b, 0x6e, 0x00, 0xb7, 0x06, 0xf0, 0xa0, 0xc7, 0x47, 0x05, 0x2f, 0x8f, 0x85, 0xc4, 0x2a, 0x2a, - 0x9c, 0xec, 0xe2, 0x9b, 0x68, 0x74, 0x87, 0x3c, 0x5a, 0xc2, 0xb4, 0xd2, 0x04, 0x97, 0x5a, 0xab, - 0x3b, 0x67, 0xea, 0x60, 0xab, 0x52, 0xe1, 0x5f, 0x29, 0x22, 0x7d, 0x11, 0x25, 0x21, 0x93, 0xa6, - 0x5e, 0xdc, 0xdb, 0xb0, 0x35, 0x8d, 0x97, 0x22, 0x7a, 0xf7, 0xee, 0xd0, 0xe2, 0xf9, 0x5c, 0x6d, - 0x25, 0x6c, 0xc8, 0x8f, 0x23, 0x64, 0x69, 0xbb, 0xa8, 0xbe, 0x2e, 0x26, 0x5d, 0x2f, 0xe2, 0x00, - 0x53, 0xad, 0x57, 0xa5, 0xbb, 0x33, 0x34, 0x43, 0xc7, 0x28, 0x9b, 0x19, 0x8a, 0x85, 0xda, 0xa6, - 0x66, 0xef, 0xa9, 0x96, 0x2f, 0x62, 0x72, 0x09, 0xbc, 0x3d, 0x60, 0xa4, 0x97, 0xaa, 0x27, 0x4d, - 0x9e, 0x21, 0xfe, 0xc6, 0x53, 0x96, 0x88, 0x54, 0x76, 0x51, 0xe0, 0x0e, 0x4e, 0x68, 0x4a, 0x31, - 0x13, 0x32, 0xc5, 0x57, 0xb3, 0xb6, 0x6b, 0x70, 0xba, 0xdb, 0x2e, 0x04, 0xbb, 0x37, 0xa7, 0xa1, - 0x26, 0x66, 0xc9, 0xfd, 0x75, 0x06, 0xbc, 0x49, 0x3d, 0x18, 0xa8, 0x97, 0xe1, 0x5c, 0xcf, 0x18, - 0xf2, 0xc5, 0x63, 0x2a, 0x25, 0x8b, 0x12, 0xa9, 0x9d, 0x2d, 0xa9, 0x95, 0xa3, 0x8f, 0x80, 0xf4, - 0x50, 0xf7, 0xc0, 0x80, 0x44, 0xd1, 0x05, 0x68, 0x41, 0xb5, 0x16, 0x1b, 0x7d, 0xd7, 0x27, 0x83, - 0x1a, 0x7e, 0x3e, 0x97, 0x25, 0xea, 0xb3, 0x63, 0xa3, 0x99, 0xd3, 0xae, 0xb1, 0x04, 0xfa, 0x5d, - 0x9b, 0xb7, 0xf9, 0x8e, 0x56, 0xcf, 0xa9, 0x79, 0x59, 0xd0, 0x2f, 0xe7, 0xe1, 0x54, 0xd7, 0x9d, - 0x79, 0xa8, 0x74, 0x1e, 0xfa, 0x7a, 0xd3, 0x17, 0x01, 0xd3, 0x13, 0xb1, 0xea, 0xbe, 0xb6, 0x60, - 0x6d, 0x80, 0xb5, 0xed, 0xe2, 0xee, 0x79, 0x28, 0xfc, 0x03, 0x93, 0x89, 0x37, 0xcd, 0x88, 0x9a, - 0x2b, 0xa8, 0x98, 0x1e, 0x12, 0x11, 0x87, 0x87, 0xc5, 0x09, 0xa4, 0xe2, 0x62, 0xaa, 0x6c, 0x88, - 0xb9, 0xf3, 0x88, 0x3c, 0x4c, 0x98, 0x59, 0xd6, 0x2f, 0x60, 0xfd, 0x78, 0x28, 0x26, 0x75, 0xa7, - 0x60, 0x21, 0xcb, 0x7d, 0x5f, 0x0d, 0xcd, 0xa2, 0x67, 0x30, 0x13, 0x9d, 0x93, 0x8d, 0x86, 0x29, - 0xde, 0x10, 0x87, 0x48, 0xb8, 0x7f, 0x60, 0xb6, 0x72, 0x45, 0x81, 0x67, 0x2f, 0x13, 0x8e, 0xe6, - 0x49, 0xc8, 0xe3, 0x03, 0x73, 0x91, 0xdd, 0x1c, 0xaa, 0xca, 0x87, 0x34, 0x93, 0xbd, 0xdf, 0x3b, - 0x4d, 0x1a, 0x37, 0xd8, 0x73, 0xec, 0xfb, 0x0e, 0x07, 0xee, 0xcf, 0xd6, 0x50, 0x95, 0x1d, 0xa1, - 0x61, 0xa0, 0xbe, 0x05, 0x97, 0x7b, 0x93, 0x32, 0xa4, 0x7d, 0xd7, 0x26, 0xf1, 0xb5, 0xb8, 0x59, - 0x10, 0x03, 0xcb, 0x49, 0xcb, 0x15, 0x4c, 0x19, 0xa1, 0xe2, 0xb8, 0xf8, 0x3f, 0x5c, 0x1a, 0x67, - 0x4c, 0x9d, 0x5b, 0x45, 0xdd, 0x2d, 0xb8, 0x1b, 0xa3, 0x87, 0xa6, 0x61, 0x53, 0x0d, 0xc1, 0x67, - 0x0c, 0x2f, 0xf1, 0x6e, 0x5e, 0xdd, 0xcf, 0x46, 0x6f, 0xa4, 0x32, 0x61, 0x13, 0x0e, 0x2e, 0xac, - 0xac, 0xf8, 0x64, 0x96, 0xc5, 0x9c, 0x1e, 0x18, 0xfa, 0x53, 0x71, 0x3e, 0x6f, 0xfd, 0x53, 0x85, - 0xc5, 0x3e, 0x83, 0xf6, 0xf7, 0x16, 0xac, 0x94, 0x1e, 0xcb, 0xf6, 0x86, 0x37, 0xf9, 0x11, 0x5f, - 0xdf, 0xf4, 0xa6, 0x38, 0xbf, 0xdd, 0x3a, 0x9e, 0xac, 0xe7, 0x4a, 0x65, 0x3c, 0xfb, 0x3b, 0x0b, - 0xce, 0x96, 0xad, 0x0b, 0xfb, 0x86, 0x37, 0xf1, 0x7d, 0x5e, 0xdf, 0x98, 0x62, 0xfd, 0xb8, 0x17, - 0x10, 0xcd, 0x4a, 0x99, 0x88, 0x67, 0xff, 0x6e, 0x81, 0x7b, 0xd4, 0x14, 0x47, 0x1b, 0x79, 0x28, - 0xed, 0x2d, 0x6f, 0xea, 0xed, 0x52, 0x7f, 0xd7, 0x7b, 0x83, 0x5d, 0xb1, 0x86, 0x50, 0xaf, 0x1e, - 0x0f, 0xc8, 0xb3, 0x7f, 0x42, 0x16, 0xcb, 0x76, 0xc1, 0x30, 0x8b, 0x47, 0x2d, 0x9b, 0x61, 0x16, - 0x8f, 0xdc, 0x2d, 0xee, 0x06, 0x42, 0x5b, 0xeb, 0x88, 0x38, 0x34, 0x76, 0x74, 0x87, 0x38, 0x66, - 0xfa, 0x38, 0x0d, 0xde, 0x62, 0xb1, 0x43, 0x1d, 0xbd, 0xbc, 0xec, 0x1f, 0x2d, 0xa8, 0x8d, 0xdb, - 0x01, 0xb6, 0xe7, 0x4d, 0xb5, 0x8d, 0xea, 0x37, 0xa7, 0xdc, 0x2d, 0xee, 0x2a, 0x42, 0x1d, 0xef, - 0xfe, 0x95, 0x05, 0xf6, 0xe8, 0x78, 0xb3, 0xd7, 0xbd, 0x09, 0x67, 0x71, 0xfd, 0xba, 0x37, 0xe9, - 0xa8, 0x74, 0xcf, 0x21, 0x92, 0x32, 0x67, 0xbf, 0x58, 0x70, 0x19, 0x2b, 0xb2, 0x6c, 0x78, 0x75, - 0xda, 0xc1, 0xf3, 0xa6, 0x9a, 0x8e, 0xc3, 0x2c, 0x1d, 0x3b, 0x1b, 0xdd, 0xab, 0x88, 0xed, 0xca, - 0xd1, 0x20, 0x3c, 0xfb, 0x75, 0xd1, 0xad, 0x23, 0x33, 0xa9, 0xa4, 0x5b, 0xc7, 0x0e, 0xb9, 0x92, - 0x6e, 0x1d, 0x3f, 0xe3, 0xdc, 0x1a, 0xc2, 0x2a, 0x75, 0x59, 0x3f, 0x8f, 0x2f, 0x67, 0xfa, 0x0c, - 0xe1, 0xff, 0xd3, 0xb4, 0xc5, 0x7d, 0x76, 0xef, 0xc4, 0x37, 0x96, 0xf5, 0x6f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x3c, 0x6e, 0x05, 0xde, 0xf0, 0x10, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/deviceauth.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/deviceauth.pb.go deleted file mode 100644 index ee21b081..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/deviceauth.pb.go +++ /dev/null @@ -1,694 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_deviceauth.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type CDeviceAuth_GetOwnAuthorizedDevices_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - IncludeCanceled *bool `protobuf:"varint,2,opt,name=include_canceled" json:"include_canceled,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Request) Reset() { - *m = CDeviceAuth_GetOwnAuthorizedDevices_Request{} -} -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetOwnAuthorizedDevices_Request) ProtoMessage() {} -func (*CDeviceAuth_GetOwnAuthorizedDevices_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{0} -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Request) GetIncludeCanceled() bool { - if m != nil && m.IncludeCanceled != nil { - return *m.IncludeCanceled - } - return false -} - -type CDeviceAuth_GetOwnAuthorizedDevices_Response struct { - Devices []*CDeviceAuth_GetOwnAuthorizedDevices_Response_Device `protobuf:"bytes,1,rep,name=devices" json:"devices,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response) Reset() { - *m = CDeviceAuth_GetOwnAuthorizedDevices_Response{} -} -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetOwnAuthorizedDevices_Response) ProtoMessage() {} -func (*CDeviceAuth_GetOwnAuthorizedDevices_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{1} -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response) GetDevices() []*CDeviceAuth_GetOwnAuthorizedDevices_Response_Device { - if m != nil { - return m.Devices - } - return nil -} - -type CDeviceAuth_GetOwnAuthorizedDevices_Response_Device struct { - AuthDeviceToken *uint64 `protobuf:"fixed64,1,opt,name=auth_device_token" json:"auth_device_token,omitempty"` - DeviceName *string `protobuf:"bytes,2,opt,name=device_name" json:"device_name,omitempty"` - IsPending *bool `protobuf:"varint,3,opt,name=is_pending" json:"is_pending,omitempty"` - IsCanceled *bool `protobuf:"varint,4,opt,name=is_canceled" json:"is_canceled,omitempty"` - LastTimeUsed *uint32 `protobuf:"varint,5,opt,name=last_time_used" json:"last_time_used,omitempty"` - LastBorrowerId *uint64 `protobuf:"fixed64,6,opt,name=last_borrower_id" json:"last_borrower_id,omitempty"` - LastAppPlayed *uint32 `protobuf:"varint,7,opt,name=last_app_played" json:"last_app_played,omitempty"` - IsLimited *bool `protobuf:"varint,8,opt,name=is_limited" json:"is_limited,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) Reset() { - *m = CDeviceAuth_GetOwnAuthorizedDevices_Response_Device{} -} -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) ProtoMessage() {} -func (*CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{1, 0} -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetAuthDeviceToken() uint64 { - if m != nil && m.AuthDeviceToken != nil { - return *m.AuthDeviceToken - } - return 0 -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetDeviceName() string { - if m != nil && m.DeviceName != nil { - return *m.DeviceName - } - return "" -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetIsPending() bool { - if m != nil && m.IsPending != nil { - return *m.IsPending - } - return false -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetIsCanceled() bool { - if m != nil && m.IsCanceled != nil { - return *m.IsCanceled - } - return false -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetLastTimeUsed() uint32 { - if m != nil && m.LastTimeUsed != nil { - return *m.LastTimeUsed - } - return 0 -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetLastBorrowerId() uint64 { - if m != nil && m.LastBorrowerId != nil { - return *m.LastBorrowerId - } - return 0 -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetLastAppPlayed() uint32 { - if m != nil && m.LastAppPlayed != nil { - return *m.LastAppPlayed - } - return 0 -} - -func (m *CDeviceAuth_GetOwnAuthorizedDevices_Response_Device) GetIsLimited() bool { - if m != nil && m.IsLimited != nil { - return *m.IsLimited - } - return false -} - -type CDeviceAuth_AcceptAuthorizationRequest_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - AuthDeviceToken *uint64 `protobuf:"fixed64,2,opt,name=auth_device_token" json:"auth_device_token,omitempty"` - AuthCode *uint64 `protobuf:"fixed64,3,opt,name=auth_code" json:"auth_code,omitempty"` - FromSteamid *uint64 `protobuf:"fixed64,4,opt,name=from_steamid" json:"from_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_AcceptAuthorizationRequest_Request) Reset() { - *m = CDeviceAuth_AcceptAuthorizationRequest_Request{} -} -func (m *CDeviceAuth_AcceptAuthorizationRequest_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_AcceptAuthorizationRequest_Request) ProtoMessage() {} -func (*CDeviceAuth_AcceptAuthorizationRequest_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{2} -} - -func (m *CDeviceAuth_AcceptAuthorizationRequest_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_AcceptAuthorizationRequest_Request) GetAuthDeviceToken() uint64 { - if m != nil && m.AuthDeviceToken != nil { - return *m.AuthDeviceToken - } - return 0 -} - -func (m *CDeviceAuth_AcceptAuthorizationRequest_Request) GetAuthCode() uint64 { - if m != nil && m.AuthCode != nil { - return *m.AuthCode - } - return 0 -} - -func (m *CDeviceAuth_AcceptAuthorizationRequest_Request) GetFromSteamid() uint64 { - if m != nil && m.FromSteamid != nil { - return *m.FromSteamid - } - return 0 -} - -type CDeviceAuth_AcceptAuthorizationRequest_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_AcceptAuthorizationRequest_Response) Reset() { - *m = CDeviceAuth_AcceptAuthorizationRequest_Response{} -} -func (m *CDeviceAuth_AcceptAuthorizationRequest_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_AcceptAuthorizationRequest_Response) ProtoMessage() {} -func (*CDeviceAuth_AcceptAuthorizationRequest_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{3} -} - -type CDeviceAuth_AuthorizeRemoteDevice_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - AuthDeviceToken *uint64 `protobuf:"fixed64,2,opt,name=auth_device_token" json:"auth_device_token,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_AuthorizeRemoteDevice_Request) Reset() { - *m = CDeviceAuth_AuthorizeRemoteDevice_Request{} -} -func (m *CDeviceAuth_AuthorizeRemoteDevice_Request) String() string { return proto.CompactTextString(m) } -func (*CDeviceAuth_AuthorizeRemoteDevice_Request) ProtoMessage() {} -func (*CDeviceAuth_AuthorizeRemoteDevice_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{4} -} - -func (m *CDeviceAuth_AuthorizeRemoteDevice_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_AuthorizeRemoteDevice_Request) GetAuthDeviceToken() uint64 { - if m != nil && m.AuthDeviceToken != nil { - return *m.AuthDeviceToken - } - return 0 -} - -type CDeviceAuth_AuthorizeRemoteDevice_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_AuthorizeRemoteDevice_Response) Reset() { - *m = CDeviceAuth_AuthorizeRemoteDevice_Response{} -} -func (m *CDeviceAuth_AuthorizeRemoteDevice_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_AuthorizeRemoteDevice_Response) ProtoMessage() {} -func (*CDeviceAuth_AuthorizeRemoteDevice_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{5} -} - -type CDeviceAuth_DeauthorizeRemoteDevice_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - AuthDeviceToken *uint64 `protobuf:"fixed64,2,opt,name=auth_device_token" json:"auth_device_token,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_DeauthorizeRemoteDevice_Request) Reset() { - *m = CDeviceAuth_DeauthorizeRemoteDevice_Request{} -} -func (m *CDeviceAuth_DeauthorizeRemoteDevice_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_DeauthorizeRemoteDevice_Request) ProtoMessage() {} -func (*CDeviceAuth_DeauthorizeRemoteDevice_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{6} -} - -func (m *CDeviceAuth_DeauthorizeRemoteDevice_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_DeauthorizeRemoteDevice_Request) GetAuthDeviceToken() uint64 { - if m != nil && m.AuthDeviceToken != nil { - return *m.AuthDeviceToken - } - return 0 -} - -type CDeviceAuth_DeauthorizeRemoteDevice_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_DeauthorizeRemoteDevice_Response) Reset() { - *m = CDeviceAuth_DeauthorizeRemoteDevice_Response{} -} -func (m *CDeviceAuth_DeauthorizeRemoteDevice_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_DeauthorizeRemoteDevice_Response) ProtoMessage() {} -func (*CDeviceAuth_DeauthorizeRemoteDevice_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{7} -} - -type CDeviceAuth_GetUsedAuthorizedDevices_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Request) Reset() { - *m = CDeviceAuth_GetUsedAuthorizedDevices_Request{} -} -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetUsedAuthorizedDevices_Request) ProtoMessage() {} -func (*CDeviceAuth_GetUsedAuthorizedDevices_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{8} -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CDeviceAuth_GetUsedAuthorizedDevices_Response struct { - Devices []*CDeviceAuth_GetUsedAuthorizedDevices_Response_Device `protobuf:"bytes,1,rep,name=devices" json:"devices,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response) Reset() { - *m = CDeviceAuth_GetUsedAuthorizedDevices_Response{} -} -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetUsedAuthorizedDevices_Response) ProtoMessage() {} -func (*CDeviceAuth_GetUsedAuthorizedDevices_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{9} -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response) GetDevices() []*CDeviceAuth_GetUsedAuthorizedDevices_Response_Device { - if m != nil { - return m.Devices - } - return nil -} - -type CDeviceAuth_GetUsedAuthorizedDevices_Response_Device struct { - AuthDeviceToken *uint64 `protobuf:"fixed64,1,opt,name=auth_device_token" json:"auth_device_token,omitempty"` - DeviceName *string `protobuf:"bytes,2,opt,name=device_name" json:"device_name,omitempty"` - OwnerSteamid *uint64 `protobuf:"fixed64,3,opt,name=owner_steamid" json:"owner_steamid,omitempty"` - LastTimeUsed *uint32 `protobuf:"varint,4,opt,name=last_time_used" json:"last_time_used,omitempty"` - LastAppPlayed *uint32 `protobuf:"varint,5,opt,name=last_app_played" json:"last_app_played,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) Reset() { - *m = CDeviceAuth_GetUsedAuthorizedDevices_Response_Device{} -} -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) ProtoMessage() {} -func (*CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{9, 0} -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) GetAuthDeviceToken() uint64 { - if m != nil && m.AuthDeviceToken != nil { - return *m.AuthDeviceToken - } - return 0 -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) GetDeviceName() string { - if m != nil && m.DeviceName != nil { - return *m.DeviceName - } - return "" -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) GetOwnerSteamid() uint64 { - if m != nil && m.OwnerSteamid != nil { - return *m.OwnerSteamid - } - return 0 -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) GetLastTimeUsed() uint32 { - if m != nil && m.LastTimeUsed != nil { - return *m.LastTimeUsed - } - return 0 -} - -func (m *CDeviceAuth_GetUsedAuthorizedDevices_Response_Device) GetLastAppPlayed() uint32 { - if m != nil && m.LastAppPlayed != nil { - return *m.LastAppPlayed - } - return 0 -} - -type CDeviceAuth_GetAuthorizedBorrowers_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - IncludeCanceled *bool `protobuf:"varint,2,opt,name=include_canceled" json:"include_canceled,omitempty"` - IncludePending *bool `protobuf:"varint,3,opt,name=include_pending" json:"include_pending,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Request) Reset() { - *m = CDeviceAuth_GetAuthorizedBorrowers_Request{} -} -func (m *CDeviceAuth_GetAuthorizedBorrowers_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetAuthorizedBorrowers_Request) ProtoMessage() {} -func (*CDeviceAuth_GetAuthorizedBorrowers_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{10} -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Request) GetIncludeCanceled() bool { - if m != nil && m.IncludeCanceled != nil { - return *m.IncludeCanceled - } - return false -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Request) GetIncludePending() bool { - if m != nil && m.IncludePending != nil { - return *m.IncludePending - } - return false -} - -type CDeviceAuth_GetAuthorizedBorrowers_Response struct { - Borrowers []*CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower `protobuf:"bytes,1,rep,name=borrowers" json:"borrowers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response) Reset() { - *m = CDeviceAuth_GetAuthorizedBorrowers_Response{} -} -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetAuthorizedBorrowers_Response) ProtoMessage() {} -func (*CDeviceAuth_GetAuthorizedBorrowers_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{11} -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response) GetBorrowers() []*CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower { - if m != nil { - return m.Borrowers - } - return nil -} - -type CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - IsPending *bool `protobuf:"varint,2,opt,name=is_pending" json:"is_pending,omitempty"` - IsCanceled *bool `protobuf:"varint,3,opt,name=is_canceled" json:"is_canceled,omitempty"` - TimeCreated *uint32 `protobuf:"varint,4,opt,name=time_created" json:"time_created,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) Reset() { - *m = CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower{} -} -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) ProtoMessage() {} -func (*CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{11, 0} -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) GetIsPending() bool { - if m != nil && m.IsPending != nil { - return *m.IsPending - } - return false -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) GetIsCanceled() bool { - if m != nil && m.IsCanceled != nil { - return *m.IsCanceled - } - return false -} - -func (m *CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -type CDeviceAuth_AddAuthorizedBorrowers_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - SteamidBorrower []uint64 `protobuf:"fixed64,2,rep,name=steamid_borrower" json:"steamid_borrower,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_AddAuthorizedBorrowers_Request) Reset() { - *m = CDeviceAuth_AddAuthorizedBorrowers_Request{} -} -func (m *CDeviceAuth_AddAuthorizedBorrowers_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_AddAuthorizedBorrowers_Request) ProtoMessage() {} -func (*CDeviceAuth_AddAuthorizedBorrowers_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{12} -} - -func (m *CDeviceAuth_AddAuthorizedBorrowers_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_AddAuthorizedBorrowers_Request) GetSteamidBorrower() []uint64 { - if m != nil { - return m.SteamidBorrower - } - return nil -} - -type CDeviceAuth_AddAuthorizedBorrowers_Response struct { - SecondsToWait *int32 `protobuf:"varint,1,opt,name=seconds_to_wait" json:"seconds_to_wait,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_AddAuthorizedBorrowers_Response) Reset() { - *m = CDeviceAuth_AddAuthorizedBorrowers_Response{} -} -func (m *CDeviceAuth_AddAuthorizedBorrowers_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_AddAuthorizedBorrowers_Response) ProtoMessage() {} -func (*CDeviceAuth_AddAuthorizedBorrowers_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{13} -} - -func (m *CDeviceAuth_AddAuthorizedBorrowers_Response) GetSecondsToWait() int32 { - if m != nil && m.SecondsToWait != nil { - return *m.SecondsToWait - } - return 0 -} - -type CDeviceAuth_RemoveAuthorizedBorrowers_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - SteamidBorrower []uint64 `protobuf:"fixed64,2,rep,name=steamid_borrower" json:"steamid_borrower,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_RemoveAuthorizedBorrowers_Request) Reset() { - *m = CDeviceAuth_RemoveAuthorizedBorrowers_Request{} -} -func (m *CDeviceAuth_RemoveAuthorizedBorrowers_Request) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_RemoveAuthorizedBorrowers_Request) ProtoMessage() {} -func (*CDeviceAuth_RemoveAuthorizedBorrowers_Request) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{14} -} - -func (m *CDeviceAuth_RemoveAuthorizedBorrowers_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CDeviceAuth_RemoveAuthorizedBorrowers_Request) GetSteamidBorrower() []uint64 { - if m != nil { - return m.SteamidBorrower - } - return nil -} - -type CDeviceAuth_RemoveAuthorizedBorrowers_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CDeviceAuth_RemoveAuthorizedBorrowers_Response) Reset() { - *m = CDeviceAuth_RemoveAuthorizedBorrowers_Response{} -} -func (m *CDeviceAuth_RemoveAuthorizedBorrowers_Response) String() string { - return proto.CompactTextString(m) -} -func (*CDeviceAuth_RemoveAuthorizedBorrowers_Response) ProtoMessage() {} -func (*CDeviceAuth_RemoveAuthorizedBorrowers_Response) Descriptor() ([]byte, []int) { - return deviceauth_fileDescriptor0, []int{15} -} - -func init() { - proto.RegisterType((*CDeviceAuth_GetOwnAuthorizedDevices_Request)(nil), "CDeviceAuth_GetOwnAuthorizedDevices_Request") - proto.RegisterType((*CDeviceAuth_GetOwnAuthorizedDevices_Response)(nil), "CDeviceAuth_GetOwnAuthorizedDevices_Response") - proto.RegisterType((*CDeviceAuth_GetOwnAuthorizedDevices_Response_Device)(nil), "CDeviceAuth_GetOwnAuthorizedDevices_Response.Device") - proto.RegisterType((*CDeviceAuth_AcceptAuthorizationRequest_Request)(nil), "CDeviceAuth_AcceptAuthorizationRequest_Request") - proto.RegisterType((*CDeviceAuth_AcceptAuthorizationRequest_Response)(nil), "CDeviceAuth_AcceptAuthorizationRequest_Response") - proto.RegisterType((*CDeviceAuth_AuthorizeRemoteDevice_Request)(nil), "CDeviceAuth_AuthorizeRemoteDevice_Request") - proto.RegisterType((*CDeviceAuth_AuthorizeRemoteDevice_Response)(nil), "CDeviceAuth_AuthorizeRemoteDevice_Response") - proto.RegisterType((*CDeviceAuth_DeauthorizeRemoteDevice_Request)(nil), "CDeviceAuth_DeauthorizeRemoteDevice_Request") - proto.RegisterType((*CDeviceAuth_DeauthorizeRemoteDevice_Response)(nil), "CDeviceAuth_DeauthorizeRemoteDevice_Response") - proto.RegisterType((*CDeviceAuth_GetUsedAuthorizedDevices_Request)(nil), "CDeviceAuth_GetUsedAuthorizedDevices_Request") - proto.RegisterType((*CDeviceAuth_GetUsedAuthorizedDevices_Response)(nil), "CDeviceAuth_GetUsedAuthorizedDevices_Response") - proto.RegisterType((*CDeviceAuth_GetUsedAuthorizedDevices_Response_Device)(nil), "CDeviceAuth_GetUsedAuthorizedDevices_Response.Device") - proto.RegisterType((*CDeviceAuth_GetAuthorizedBorrowers_Request)(nil), "CDeviceAuth_GetAuthorizedBorrowers_Request") - proto.RegisterType((*CDeviceAuth_GetAuthorizedBorrowers_Response)(nil), "CDeviceAuth_GetAuthorizedBorrowers_Response") - proto.RegisterType((*CDeviceAuth_GetAuthorizedBorrowers_Response_Borrower)(nil), "CDeviceAuth_GetAuthorizedBorrowers_Response.Borrower") - proto.RegisterType((*CDeviceAuth_AddAuthorizedBorrowers_Request)(nil), "CDeviceAuth_AddAuthorizedBorrowers_Request") - proto.RegisterType((*CDeviceAuth_AddAuthorizedBorrowers_Response)(nil), "CDeviceAuth_AddAuthorizedBorrowers_Response") - proto.RegisterType((*CDeviceAuth_RemoveAuthorizedBorrowers_Request)(nil), "CDeviceAuth_RemoveAuthorizedBorrowers_Request") - proto.RegisterType((*CDeviceAuth_RemoveAuthorizedBorrowers_Response)(nil), "CDeviceAuth_RemoveAuthorizedBorrowers_Response") -} - -var deviceauth_fileDescriptor0 = []byte{ - // 934 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x56, 0xdf, 0x4e, 0x3b, 0x45, - 0x14, 0xce, 0xb6, 0x50, 0x60, 0x10, 0x91, 0x51, 0xa0, 0xec, 0x85, 0x4e, 0x56, 0x2f, 0x10, 0xca, - 0x80, 0x04, 0xe3, 0xff, 0x3f, 0x20, 0xa2, 0x17, 0x26, 0x26, 0x18, 0xa3, 0x72, 0xb3, 0x99, 0xee, - 0x0e, 0x74, 0x62, 0xbb, 0xbb, 0xee, 0x4c, 0x69, 0xf0, 0x8a, 0x98, 0xf8, 0x12, 0xfa, 0x06, 0x5e, - 0x19, 0x13, 0xa2, 0x89, 0x5e, 0xf8, 0x0e, 0xbe, 0x8d, 0x57, 0xbf, 0xb3, 0xb3, 0xb3, 0x85, 0x6d, - 0x77, 0x4b, 0xb7, 0xe1, 0xaa, 0x9b, 0x73, 0xce, 0x9c, 0xf9, 0xce, 0x99, 0xf3, 0x7d, 0xa7, 0x68, - 0x47, 0x2a, 0xce, 0x7a, 0x3d, 0x2e, 0x25, 0xbb, 0xe2, 0xd2, 0xf5, 0xf9, 0xb5, 0xf0, 0x38, 0xeb, - 0xab, 0x0e, 0xd5, 0x0e, 0xaf, 0x2b, 0x78, 0xa0, 0x68, 0x14, 0x87, 0x2a, 0xb4, 0x5b, 0xf9, 0xd8, - 0x7e, 0x20, 0x2e, 0x05, 0xf7, 0xdd, 0x36, 0x93, 0x7c, 0x3c, 0xda, 0xf9, 0x16, 0xed, 0x7e, 0x72, - 0xaa, 0xd3, 0x1d, 0x43, 0x3a, 0xf7, 0x33, 0xae, 0xbe, 0x1c, 0x04, 0xc9, 0x67, 0x18, 0x8b, 0x1f, - 0xb9, 0x9f, 0xba, 0xa4, 0x7b, 0xce, 0x7f, 0xe8, 0x73, 0xa9, 0xf0, 0x2a, 0x5a, 0xd0, 0x39, 0x84, - 0xdf, 0xb4, 0x88, 0xb5, 0xdd, 0xc0, 0x4d, 0xf4, 0x82, 0x08, 0xbc, 0x6e, 0xdf, 0xe7, 0xae, 0xc7, - 0x02, 0x8f, 0x77, 0xb9, 0xdf, 0xac, 0x81, 0x67, 0xd1, 0xf9, 0xab, 0x86, 0x5a, 0xd3, 0xa5, 0x96, - 0x51, 0x18, 0x48, 0x8e, 0x3f, 0x45, 0x0b, 0x69, 0x61, 0x12, 0x72, 0xd7, 0xb7, 0x97, 0x0f, 0x8f, - 0x68, 0x95, 0xf3, 0x34, 0x35, 0xd8, 0xff, 0x5a, 0xa8, 0x91, 0x7e, 0xe2, 0x2d, 0xb4, 0x96, 0x34, - 0xc9, 0xf4, 0xcb, 0x55, 0xe1, 0xf7, 0x3c, 0x30, 0xb8, 0x5f, 0x44, 0xcb, 0xc6, 0x1a, 0xb0, 0x1e, - 0xd7, 0x90, 0x97, 0x30, 0x46, 0x48, 0x48, 0x37, 0xe2, 0x81, 0x2f, 0x82, 0xab, 0x66, 0x3d, 0x29, - 0x23, 0x09, 0x04, 0xdb, 0xb0, 0xb6, 0x39, 0x6d, 0xdc, 0x40, 0xcf, 0x77, 0x99, 0x54, 0xae, 0x12, - 0x3d, 0xee, 0xf6, 0x25, 0xd8, 0xe7, 0xc1, 0xbe, 0x92, 0x74, 0x43, 0xdb, 0xdb, 0x61, 0x1c, 0x87, - 0x03, 0x1e, 0xbb, 0xd0, 0xa7, 0x86, 0xbe, 0x6f, 0x13, 0xad, 0x6a, 0x0f, 0x8b, 0x22, 0x37, 0xea, - 0xb2, 0x1b, 0x38, 0xb2, 0xa0, 0x8f, 0xa4, 0x77, 0x76, 0x45, 0x4f, 0x28, 0xb0, 0x2d, 0xea, 0xd6, - 0xfd, 0x6c, 0xa1, 0x5c, 0xe9, 0xc7, 0x9e, 0xc7, 0x23, 0x95, 0x95, 0xce, 0x94, 0x08, 0x03, 0xf3, - 0x20, 0xe5, 0x0f, 0x53, 0x58, 0x7b, 0x4d, 0xbb, 0xd6, 0xd0, 0x92, 0x76, 0x79, 0xa1, 0xcf, 0x75, - 0x95, 0x0d, 0xfc, 0x12, 0x7a, 0xee, 0x32, 0x0e, 0x7b, 0x6e, 0x96, 0x23, 0x29, 0xb3, 0xe1, 0xbc, - 0x81, 0xf6, 0xa7, 0x86, 0x91, 0x3e, 0x82, 0xf3, 0x0d, 0x7a, 0x3d, 0x77, 0x24, 0x7b, 0xae, 0x73, - 0xde, 0x0b, 0x15, 0x4f, 0x3d, 0xb3, 0x80, 0x76, 0x5a, 0x68, 0x67, 0x9a, 0xc4, 0x06, 0xc6, 0x77, - 0xf9, 0xb1, 0x3e, 0xd5, 0x64, 0x79, 0x1a, 0x20, 0x34, 0x3f, 0xd6, 0xe5, 0xa9, 0x0d, 0x94, 0x8f, - 0xc6, 0x68, 0xf0, 0x35, 0x0c, 0xcc, 0xf4, 0x14, 0x73, 0xfe, 0xb7, 0xd0, 0xde, 0x94, 0x19, 0x0c, - 0x93, 0xce, 0x46, 0x99, 0xf4, 0x26, 0xad, 0x94, 0x20, 0xa3, 0xd2, 0xed, 0xec, 0x54, 0x5a, 0x47, - 0x2b, 0xe1, 0x20, 0x00, 0x06, 0x64, 0xb5, 0xa4, 0x73, 0x36, 0x4e, 0x9c, 0x39, 0xcd, 0x82, 0x02, - 0x7a, 0x68, 0x46, 0x39, 0x51, 0xfe, 0xd9, 0x01, 0xfa, 0x3d, 0xec, 0x13, 0xc3, 0xb2, 0x59, 0xe4, - 0x29, 0xb9, 0x31, 0xf3, 0xe4, 0x08, 0xef, 0xfc, 0x67, 0x8d, 0x49, 0x62, 0xf1, 0x95, 0xa6, 0xd9, - 0x9f, 0xa3, 0xa5, 0x8c, 0xee, 0xa5, 0xed, 0x9e, 0x94, 0x80, 0x66, 0x26, 0xfb, 0x02, 0x2d, 0x66, - 0xdf, 0xe3, 0x95, 0xe4, 0xb5, 0xa9, 0x56, 0xa4, 0x4d, 0xa9, 0x60, 0x01, 0x95, 0x75, 0x77, 0xbd, - 0x98, 0x33, 0x95, 0x35, 0x18, 0x78, 0x99, 0xa7, 0x8f, 0xef, 0x57, 0xed, 0xa3, 0x31, 0x0c, 0xb5, - 0x0d, 0x30, 0xd4, 0x61, 0x3a, 0xcf, 0xf2, 0xdd, 0x2a, 0x4d, 0x6c, 0xba, 0x05, 0x6d, 0x97, 0xdc, - 0x0b, 0x03, 0x5f, 0xc2, 0x0c, 0xb9, 0x03, 0x26, 0x94, 0xbe, 0x61, 0xde, 0xb9, 0xc8, 0x0f, 0x79, - 0xc2, 0xa5, 0x6b, 0xfe, 0x44, 0x18, 0x0f, 0xf2, 0x72, 0x3a, 0x29, 0x77, 0x0a, 0xf3, 0xf0, 0xcf, - 0x65, 0x84, 0xee, 0x4f, 0xe0, 0x5f, 0x2c, 0xb4, 0x59, 0xb2, 0x7f, 0x70, 0x8b, 0x56, 0x58, 0xa0, - 0xf6, 0x5e, 0xa5, 0x9d, 0xe6, 0x38, 0x3f, 0xdd, 0x35, 0x5f, 0x86, 0x28, 0xd2, 0x15, 0x52, 0x91, - 0xf0, 0x92, 0x0c, 0xc5, 0xc6, 0x27, 0x86, 0xe2, 0xf8, 0xce, 0x42, 0x76, 0xb9, 0x34, 0xe3, 0xfd, - 0x8a, 0xab, 0xc4, 0x3e, 0xa0, 0x55, 0x45, 0xff, 0x08, 0x50, 0x1e, 0xa4, 0x81, 0x84, 0x05, 0x43, - 0x8c, 0x3a, 0x98, 0xc4, 0x69, 0x34, 0x69, 0xdf, 0x80, 0x2f, 0x54, 0x1d, 0x1e, 0x13, 0x20, 0x7e, - 0x2c, 0xf1, 0x6f, 0x16, 0x5a, 0x2f, 0x94, 0x71, 0xbc, 0x43, 0xa7, 0xde, 0x21, 0xf6, 0x2e, 0xad, - 0xb0, 0x16, 0xde, 0x06, 0xa0, 0x47, 0xc3, 0x18, 0x02, 0x0a, 0x05, 0xf0, 0x92, 0x40, 0xd3, 0x4c, - 0xa2, 0x3a, 0x4c, 0x91, 0x0e, 0x93, 0xc4, 0x10, 0x2d, 0x43, 0x8f, 0x7f, 0x85, 0x09, 0x28, 0x91, - 0xfa, 0x91, 0x09, 0x78, 0x64, 0xd7, 0x8c, 0x4c, 0xc0, 0xa3, 0xeb, 0xe3, 0x55, 0x80, 0xfc, 0xca, - 0x39, 0xbf, 0x06, 0xc1, 0xd5, 0x78, 0x0d, 0xd0, 0x5c, 0x8f, 0xf1, 0xdf, 0x16, 0x6a, 0x96, 0xa9, - 0x3a, 0xde, 0xa3, 0x55, 0xf6, 0x8f, 0x4d, 0xab, 0xed, 0x0a, 0xe7, 0x63, 0x00, 0xf8, 0xfe, 0xe4, - 0x11, 0xd5, 0x0f, 0x4e, 0x52, 0x5d, 0x27, 0x86, 0x9b, 0x3e, 0xb9, 0x82, 0x6d, 0x21, 0x09, 0xa0, - 0xff, 0xc3, 0x42, 0x1b, 0xc5, 0x22, 0x89, 0x77, 0xe9, 0xf4, 0xea, 0x6f, 0xb7, 0xaa, 0xc8, 0xae, - 0xf3, 0x01, 0xe0, 0x7e, 0xe7, 0x21, 0x6e, 0x3d, 0x95, 0xe9, 0x04, 0x80, 0xa4, 0x1a, 0x9c, 0x80, - 0xef, 0xe1, 0x48, 0x0f, 0x6b, 0xc2, 0xbf, 0x03, 0xe8, 0x62, 0xb1, 0x1b, 0x01, 0x3d, 0x59, 0x6a, - 0x47, 0x40, 0x3f, 0x22, 0x9f, 0xce, 0x7b, 0x00, 0xfa, 0x2d, 0x08, 0x2a, 0x07, 0x6b, 0xfe, 0x49, - 0x16, 0x09, 0xc5, 0x3f, 0x16, 0xda, 0x2a, 0xd5, 0x3e, 0x4c, 0x69, 0x25, 0xfd, 0xb5, 0xf7, 0x2b, - 0x6a, 0xaa, 0xf3, 0x21, 0x60, 0x7f, 0x37, 0x8d, 0x9b, 0x05, 0xbe, 0xfd, 0x1a, 0x9c, 0x27, 0x5f, - 0x88, 0x76, 0xcc, 0xe2, 0x1b, 0xf2, 0x55, 0x87, 0xc5, 0x09, 0x3f, 0x25, 0x57, 0x0a, 0x7e, 0x25, - 0x7c, 0xc4, 0x49, 0xd8, 0x49, 0xfd, 0xd6, 0xb2, 0x9e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x27, 0xc5, - 0x15, 0xba, 0x30, 0x0d, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/gamenotifications.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/gamenotifications.pb.go deleted file mode 100644 index a3678022..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/gamenotifications.pb.go +++ /dev/null @@ -1,850 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_gamenotifications.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type CGameNotifications_Variable struct { - Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_Variable) Reset() { *m = CGameNotifications_Variable{} } -func (m *CGameNotifications_Variable) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_Variable) ProtoMessage() {} -func (*CGameNotifications_Variable) Descriptor() ([]byte, []int) { return gamenotifications_fileDescriptor0, []int{0} } - -func (m *CGameNotifications_Variable) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *CGameNotifications_Variable) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CGameNotifications_LocalizedText struct { - Token *string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - Variables []*CGameNotifications_Variable `protobuf:"bytes,2,rep,name=variables" json:"variables,omitempty"` - RenderedText *string `protobuf:"bytes,3,opt,name=rendered_text" json:"rendered_text,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_LocalizedText) Reset() { *m = CGameNotifications_LocalizedText{} } -func (m *CGameNotifications_LocalizedText) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_LocalizedText) ProtoMessage() {} -func (*CGameNotifications_LocalizedText) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{1} -} - -func (m *CGameNotifications_LocalizedText) GetToken() string { - if m != nil && m.Token != nil { - return *m.Token - } - return "" -} - -func (m *CGameNotifications_LocalizedText) GetVariables() []*CGameNotifications_Variable { - if m != nil { - return m.Variables - } - return nil -} - -func (m *CGameNotifications_LocalizedText) GetRenderedText() string { - if m != nil && m.RenderedText != nil { - return *m.RenderedText - } - return "" -} - -type CGameNotifications_UserStatus struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - State *string `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` - Title *CGameNotifications_LocalizedText `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` - Message *CGameNotifications_LocalizedText `protobuf:"bytes,4,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_UserStatus) Reset() { *m = CGameNotifications_UserStatus{} } -func (m *CGameNotifications_UserStatus) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_UserStatus) ProtoMessage() {} -func (*CGameNotifications_UserStatus) Descriptor() ([]byte, []int) { return gamenotifications_fileDescriptor0, []int{2} } - -func (m *CGameNotifications_UserStatus) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CGameNotifications_UserStatus) GetState() string { - if m != nil && m.State != nil { - return *m.State - } - return "" -} - -func (m *CGameNotifications_UserStatus) GetTitle() *CGameNotifications_LocalizedText { - if m != nil { - return m.Title - } - return nil -} - -func (m *CGameNotifications_UserStatus) GetMessage() *CGameNotifications_LocalizedText { - if m != nil { - return m.Message - } - return nil -} - -type CGameNotifications_CreateSession_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Context *uint64 `protobuf:"varint,2,opt,name=context" json:"context,omitempty"` - Title *CGameNotifications_LocalizedText `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` - Users []*CGameNotifications_UserStatus `protobuf:"bytes,4,rep,name=users" json:"users,omitempty"` - Steamid *uint64 `protobuf:"fixed64,5,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_CreateSession_Request) Reset() { - *m = CGameNotifications_CreateSession_Request{} -} -func (m *CGameNotifications_CreateSession_Request) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_CreateSession_Request) ProtoMessage() {} -func (*CGameNotifications_CreateSession_Request) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{3} -} - -func (m *CGameNotifications_CreateSession_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_CreateSession_Request) GetContext() uint64 { - if m != nil && m.Context != nil { - return *m.Context - } - return 0 -} - -func (m *CGameNotifications_CreateSession_Request) GetTitle() *CGameNotifications_LocalizedText { - if m != nil { - return m.Title - } - return nil -} - -func (m *CGameNotifications_CreateSession_Request) GetUsers() []*CGameNotifications_UserStatus { - if m != nil { - return m.Users - } - return nil -} - -func (m *CGameNotifications_CreateSession_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CGameNotifications_CreateSession_Response struct { - Sessionid *uint64 `protobuf:"varint,1,opt,name=sessionid" json:"sessionid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_CreateSession_Response) Reset() { - *m = CGameNotifications_CreateSession_Response{} -} -func (m *CGameNotifications_CreateSession_Response) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_CreateSession_Response) ProtoMessage() {} -func (*CGameNotifications_CreateSession_Response) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{4} -} - -func (m *CGameNotifications_CreateSession_Response) GetSessionid() uint64 { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return 0 -} - -type CGameNotifications_DeleteSession_Request struct { - Sessionid *uint64 `protobuf:"varint,1,opt,name=sessionid" json:"sessionid,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - Steamid *uint64 `protobuf:"fixed64,3,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_DeleteSession_Request) Reset() { - *m = CGameNotifications_DeleteSession_Request{} -} -func (m *CGameNotifications_DeleteSession_Request) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_DeleteSession_Request) ProtoMessage() {} -func (*CGameNotifications_DeleteSession_Request) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{5} -} - -func (m *CGameNotifications_DeleteSession_Request) GetSessionid() uint64 { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return 0 -} - -func (m *CGameNotifications_DeleteSession_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_DeleteSession_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CGameNotifications_DeleteSession_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_DeleteSession_Response) Reset() { - *m = CGameNotifications_DeleteSession_Response{} -} -func (m *CGameNotifications_DeleteSession_Response) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_DeleteSession_Response) ProtoMessage() {} -func (*CGameNotifications_DeleteSession_Response) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{6} -} - -type CGameNotifications_UpdateSession_Request struct { - Sessionid *uint64 `protobuf:"varint,1,opt,name=sessionid" json:"sessionid,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - Title *CGameNotifications_LocalizedText `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` - Users []*CGameNotifications_UserStatus `protobuf:"bytes,4,rep,name=users" json:"users,omitempty"` - Steamid *uint64 `protobuf:"fixed64,6,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_UpdateSession_Request) Reset() { - *m = CGameNotifications_UpdateSession_Request{} -} -func (m *CGameNotifications_UpdateSession_Request) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_UpdateSession_Request) ProtoMessage() {} -func (*CGameNotifications_UpdateSession_Request) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{7} -} - -func (m *CGameNotifications_UpdateSession_Request) GetSessionid() uint64 { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return 0 -} - -func (m *CGameNotifications_UpdateSession_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_UpdateSession_Request) GetTitle() *CGameNotifications_LocalizedText { - if m != nil { - return m.Title - } - return nil -} - -func (m *CGameNotifications_UpdateSession_Request) GetUsers() []*CGameNotifications_UserStatus { - if m != nil { - return m.Users - } - return nil -} - -func (m *CGameNotifications_UpdateSession_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CGameNotifications_UpdateSession_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_UpdateSession_Response) Reset() { - *m = CGameNotifications_UpdateSession_Response{} -} -func (m *CGameNotifications_UpdateSession_Response) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_UpdateSession_Response) ProtoMessage() {} -func (*CGameNotifications_UpdateSession_Response) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{8} -} - -type CGameNotifications_EnumerateSessions_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - IncludeAllUserMessages *bool `protobuf:"varint,3,opt,name=include_all_user_messages" json:"include_all_user_messages,omitempty"` - IncludeAuthUserMessage *bool `protobuf:"varint,4,opt,name=include_auth_user_message" json:"include_auth_user_message,omitempty"` - Language *string `protobuf:"bytes,5,opt,name=language" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_EnumerateSessions_Request) Reset() { - *m = CGameNotifications_EnumerateSessions_Request{} -} -func (m *CGameNotifications_EnumerateSessions_Request) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_EnumerateSessions_Request) ProtoMessage() {} -func (*CGameNotifications_EnumerateSessions_Request) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{9} -} - -func (m *CGameNotifications_EnumerateSessions_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_EnumerateSessions_Request) GetIncludeAllUserMessages() bool { - if m != nil && m.IncludeAllUserMessages != nil { - return *m.IncludeAllUserMessages - } - return false -} - -func (m *CGameNotifications_EnumerateSessions_Request) GetIncludeAuthUserMessage() bool { - if m != nil && m.IncludeAuthUserMessage != nil { - return *m.IncludeAuthUserMessage - } - return false -} - -func (m *CGameNotifications_EnumerateSessions_Request) GetLanguage() string { - if m != nil && m.Language != nil { - return *m.Language - } - return "" -} - -type CGameNotifications_Session struct { - Sessionid *uint64 `protobuf:"varint,1,opt,name=sessionid" json:"sessionid,omitempty"` - Appid *uint64 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - Context *uint64 `protobuf:"varint,3,opt,name=context" json:"context,omitempty"` - Title *CGameNotifications_LocalizedText `protobuf:"bytes,4,opt,name=title" json:"title,omitempty"` - TimeCreated *uint32 `protobuf:"varint,5,opt,name=time_created" json:"time_created,omitempty"` - TimeUpdated *uint32 `protobuf:"varint,6,opt,name=time_updated" json:"time_updated,omitempty"` - UserStatus []*CGameNotifications_UserStatus `protobuf:"bytes,7,rep,name=user_status" json:"user_status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_Session) Reset() { *m = CGameNotifications_Session{} } -func (m *CGameNotifications_Session) String() string { return proto.CompactTextString(m) } -func (*CGameNotifications_Session) ProtoMessage() {} -func (*CGameNotifications_Session) Descriptor() ([]byte, []int) { return gamenotifications_fileDescriptor0, []int{10} } - -func (m *CGameNotifications_Session) GetSessionid() uint64 { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return 0 -} - -func (m *CGameNotifications_Session) GetAppid() uint64 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_Session) GetContext() uint64 { - if m != nil && m.Context != nil { - return *m.Context - } - return 0 -} - -func (m *CGameNotifications_Session) GetTitle() *CGameNotifications_LocalizedText { - if m != nil { - return m.Title - } - return nil -} - -func (m *CGameNotifications_Session) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -func (m *CGameNotifications_Session) GetTimeUpdated() uint32 { - if m != nil && m.TimeUpdated != nil { - return *m.TimeUpdated - } - return 0 -} - -func (m *CGameNotifications_Session) GetUserStatus() []*CGameNotifications_UserStatus { - if m != nil { - return m.UserStatus - } - return nil -} - -type CGameNotifications_EnumerateSessions_Response struct { - Sessions []*CGameNotifications_Session `protobuf:"bytes,1,rep,name=sessions" json:"sessions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_EnumerateSessions_Response) Reset() { - *m = CGameNotifications_EnumerateSessions_Response{} -} -func (m *CGameNotifications_EnumerateSessions_Response) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_EnumerateSessions_Response) ProtoMessage() {} -func (*CGameNotifications_EnumerateSessions_Response) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{11} -} - -func (m *CGameNotifications_EnumerateSessions_Response) GetSessions() []*CGameNotifications_Session { - if m != nil { - return m.Sessions - } - return nil -} - -type CGameNotifications_GetSessionDetails_Request struct { - Sessions []*CGameNotifications_GetSessionDetails_Request_RequestedSession `protobuf:"bytes,1,rep,name=sessions" json:"sessions,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - Language *string `protobuf:"bytes,3,opt,name=language" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_GetSessionDetails_Request) Reset() { - *m = CGameNotifications_GetSessionDetails_Request{} -} -func (m *CGameNotifications_GetSessionDetails_Request) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_GetSessionDetails_Request) ProtoMessage() {} -func (*CGameNotifications_GetSessionDetails_Request) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{12} -} - -func (m *CGameNotifications_GetSessionDetails_Request) GetSessions() []*CGameNotifications_GetSessionDetails_Request_RequestedSession { - if m != nil { - return m.Sessions - } - return nil -} - -func (m *CGameNotifications_GetSessionDetails_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_GetSessionDetails_Request) GetLanguage() string { - if m != nil && m.Language != nil { - return *m.Language - } - return "" -} - -type CGameNotifications_GetSessionDetails_Request_RequestedSession struct { - Sessionid *uint64 `protobuf:"varint,1,opt,name=sessionid" json:"sessionid,omitempty"` - IncludeAuthUserMessage *bool `protobuf:"varint,3,opt,name=include_auth_user_message" json:"include_auth_user_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_GetSessionDetails_Request_RequestedSession) Reset() { - *m = CGameNotifications_GetSessionDetails_Request_RequestedSession{} -} -func (m *CGameNotifications_GetSessionDetails_Request_RequestedSession) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_GetSessionDetails_Request_RequestedSession) ProtoMessage() {} -func (*CGameNotifications_GetSessionDetails_Request_RequestedSession) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{12, 0} -} - -func (m *CGameNotifications_GetSessionDetails_Request_RequestedSession) GetSessionid() uint64 { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return 0 -} - -func (m *CGameNotifications_GetSessionDetails_Request_RequestedSession) GetIncludeAuthUserMessage() bool { - if m != nil && m.IncludeAuthUserMessage != nil { - return *m.IncludeAuthUserMessage - } - return false -} - -type CGameNotifications_GetSessionDetails_Response struct { - Sessions []*CGameNotifications_Session `protobuf:"bytes,1,rep,name=sessions" json:"sessions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_GetSessionDetails_Response) Reset() { - *m = CGameNotifications_GetSessionDetails_Response{} -} -func (m *CGameNotifications_GetSessionDetails_Response) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_GetSessionDetails_Response) ProtoMessage() {} -func (*CGameNotifications_GetSessionDetails_Response) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{13} -} - -func (m *CGameNotifications_GetSessionDetails_Response) GetSessions() []*CGameNotifications_Session { - if m != nil { - return m.Sessions - } - return nil -} - -type GameNotificationSettings struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - AllowNotifications *bool `protobuf:"varint,2,opt,name=allow_notifications" json:"allow_notifications,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *GameNotificationSettings) Reset() { *m = GameNotificationSettings{} } -func (m *GameNotificationSettings) String() string { return proto.CompactTextString(m) } -func (*GameNotificationSettings) ProtoMessage() {} -func (*GameNotificationSettings) Descriptor() ([]byte, []int) { return gamenotifications_fileDescriptor0, []int{14} } - -func (m *GameNotificationSettings) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *GameNotificationSettings) GetAllowNotifications() bool { - if m != nil && m.AllowNotifications != nil { - return *m.AllowNotifications - } - return false -} - -type CGameNotifications_UpdateNotificationSettings_Request struct { - GameNotificationSettings []*GameNotificationSettings `protobuf:"bytes,1,rep,name=game_notification_settings" json:"game_notification_settings,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_UpdateNotificationSettings_Request) Reset() { - *m = CGameNotifications_UpdateNotificationSettings_Request{} -} -func (m *CGameNotifications_UpdateNotificationSettings_Request) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_UpdateNotificationSettings_Request) ProtoMessage() {} -func (*CGameNotifications_UpdateNotificationSettings_Request) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{15} -} - -func (m *CGameNotifications_UpdateNotificationSettings_Request) GetGameNotificationSettings() []*GameNotificationSettings { - if m != nil { - return m.GameNotificationSettings - } - return nil -} - -type CGameNotifications_UpdateNotificationSettings_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_UpdateNotificationSettings_Response) Reset() { - *m = CGameNotifications_UpdateNotificationSettings_Response{} -} -func (m *CGameNotifications_UpdateNotificationSettings_Response) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_UpdateNotificationSettings_Response) ProtoMessage() {} -func (*CGameNotifications_UpdateNotificationSettings_Response) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{16} -} - -type CGameNotifications_OnNotificationsRequested_Notification struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_OnNotificationsRequested_Notification) Reset() { - *m = CGameNotifications_OnNotificationsRequested_Notification{} -} -func (m *CGameNotifications_OnNotificationsRequested_Notification) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_OnNotificationsRequested_Notification) ProtoMessage() {} -func (*CGameNotifications_OnNotificationsRequested_Notification) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{17} -} - -func (m *CGameNotifications_OnNotificationsRequested_Notification) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CGameNotifications_OnNotificationsRequested_Notification) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -type CGameNotifications_OnUserStatusChanged_Notification struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - Sessionid *uint64 `protobuf:"varint,2,opt,name=sessionid" json:"sessionid,omitempty"` - Appid *uint32 `protobuf:"varint,3,opt,name=appid" json:"appid,omitempty"` - Status *CGameNotifications_UserStatus `protobuf:"bytes,4,opt,name=status" json:"status,omitempty"` - Removed *bool `protobuf:"varint,5,opt,name=removed" json:"removed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGameNotifications_OnUserStatusChanged_Notification) Reset() { - *m = CGameNotifications_OnUserStatusChanged_Notification{} -} -func (m *CGameNotifications_OnUserStatusChanged_Notification) String() string { - return proto.CompactTextString(m) -} -func (*CGameNotifications_OnUserStatusChanged_Notification) ProtoMessage() {} -func (*CGameNotifications_OnUserStatusChanged_Notification) Descriptor() ([]byte, []int) { - return gamenotifications_fileDescriptor0, []int{18} -} - -func (m *CGameNotifications_OnUserStatusChanged_Notification) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CGameNotifications_OnUserStatusChanged_Notification) GetSessionid() uint64 { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return 0 -} - -func (m *CGameNotifications_OnUserStatusChanged_Notification) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CGameNotifications_OnUserStatusChanged_Notification) GetStatus() *CGameNotifications_UserStatus { - if m != nil { - return m.Status - } - return nil -} - -func (m *CGameNotifications_OnUserStatusChanged_Notification) GetRemoved() bool { - if m != nil && m.Removed != nil { - return *m.Removed - } - return false -} - -func init() { - proto.RegisterType((*CGameNotifications_Variable)(nil), "CGameNotifications_Variable") - proto.RegisterType((*CGameNotifications_LocalizedText)(nil), "CGameNotifications_LocalizedText") - proto.RegisterType((*CGameNotifications_UserStatus)(nil), "CGameNotifications_UserStatus") - proto.RegisterType((*CGameNotifications_CreateSession_Request)(nil), "CGameNotifications_CreateSession_Request") - proto.RegisterType((*CGameNotifications_CreateSession_Response)(nil), "CGameNotifications_CreateSession_Response") - proto.RegisterType((*CGameNotifications_DeleteSession_Request)(nil), "CGameNotifications_DeleteSession_Request") - proto.RegisterType((*CGameNotifications_DeleteSession_Response)(nil), "CGameNotifications_DeleteSession_Response") - proto.RegisterType((*CGameNotifications_UpdateSession_Request)(nil), "CGameNotifications_UpdateSession_Request") - proto.RegisterType((*CGameNotifications_UpdateSession_Response)(nil), "CGameNotifications_UpdateSession_Response") - proto.RegisterType((*CGameNotifications_EnumerateSessions_Request)(nil), "CGameNotifications_EnumerateSessions_Request") - proto.RegisterType((*CGameNotifications_Session)(nil), "CGameNotifications_Session") - proto.RegisterType((*CGameNotifications_EnumerateSessions_Response)(nil), "CGameNotifications_EnumerateSessions_Response") - proto.RegisterType((*CGameNotifications_GetSessionDetails_Request)(nil), "CGameNotifications_GetSessionDetails_Request") - proto.RegisterType((*CGameNotifications_GetSessionDetails_Request_RequestedSession)(nil), "CGameNotifications_GetSessionDetails_Request.RequestedSession") - proto.RegisterType((*CGameNotifications_GetSessionDetails_Response)(nil), "CGameNotifications_GetSessionDetails_Response") - proto.RegisterType((*GameNotificationSettings)(nil), "GameNotificationSettings") - proto.RegisterType((*CGameNotifications_UpdateNotificationSettings_Request)(nil), "CGameNotifications_UpdateNotificationSettings_Request") - proto.RegisterType((*CGameNotifications_UpdateNotificationSettings_Response)(nil), "CGameNotifications_UpdateNotificationSettings_Response") - proto.RegisterType((*CGameNotifications_OnNotificationsRequested_Notification)(nil), "CGameNotifications_OnNotificationsRequested_Notification") - proto.RegisterType((*CGameNotifications_OnUserStatusChanged_Notification)(nil), "CGameNotifications_OnUserStatusChanged_Notification") -} - -var gamenotifications_fileDescriptor0 = []byte{ - // 2245 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x8f, 0x1c, 0x47, - 0x15, 0x57, 0xef, 0xec, 0x7a, 0xd7, 0x65, 0x2c, 0x91, 0x0e, 0x12, 0x93, 0xb1, 0xe3, 0xb4, 0x3b, - 0x38, 0xde, 0x8d, 0x77, 0xcb, 0x78, 0x43, 0xfc, 0x01, 0x24, 0xc2, 0xbd, 0x8e, 0x4c, 0x24, 0xb3, - 0x49, 0xbc, 0x9b, 0x60, 0x21, 0xc4, 0xa8, 0xa6, 0xbb, 0x66, 0xa7, 0xb3, 0x3d, 0xdd, 0x43, 0x57, - 0xf5, 0x6e, 0x36, 0x07, 0x82, 0xcc, 0xd7, 0x09, 0x82, 0x48, 0x22, 0x40, 0x48, 0x91, 0x90, 0x50, - 0xc4, 0x81, 0x0b, 0x87, 0x1c, 0x41, 0x48, 0x91, 0x38, 0x72, 0xcc, 0x15, 0xce, 0xfc, 0x15, 0xbc, - 0xfa, 0xec, 0xee, 0x99, 0x1e, 0xef, 0xcc, 0x22, 0x11, 0x71, 0xb1, 0x3c, 0x5d, 0xf5, 0xde, 0xfb, - 0xd5, 0x7b, 0xbf, 0xf7, 0x51, 0xb5, 0xe8, 0x1a, 0xe3, 0x94, 0x0c, 0x87, 0x94, 0x31, 0xb2, 0x47, - 0x59, 0x77, 0x8f, 0x0c, 0x69, 0x9a, 0xf1, 0xb8, 0x1f, 0x87, 0x84, 0xc7, 0x59, 0xca, 0xb0, 0x5c, - 0x0f, 0x93, 0x98, 0xa6, 0x1c, 0x8f, 0xf2, 0x8c, 0x67, 0x9d, 0xf5, 0xba, 0x48, 0x91, 0xc2, 0x6e, - 0x1a, 0x75, 0x7b, 0x84, 0xd1, 0xc9, 0xdd, 0xfe, 0xbf, 0x16, 0xd0, 0xb9, 0xad, 0xbb, 0xa0, 0x76, - 0xbb, 0xaa, 0xb6, 0xfb, 0x06, 0xc9, 0x63, 0xd2, 0x4b, 0xa8, 0xfb, 0x91, 0x83, 0x5a, 0xfb, 0xf4, - 0xa8, 0xed, 0x78, 0xce, 0xea, 0xe9, 0xe0, 0x37, 0xce, 0xc3, 0x8f, 0xdb, 0xef, 0x39, 0xbb, 0x03, - 0xea, 0xa5, 0x20, 0xe3, 0x65, 0x7d, 0x8f, 0xc3, 0xff, 0x0f, 0xf4, 0x6e, 0x2f, 0x4e, 0xe5, 0xef, - 0x24, 0x0b, 0x49, 0x12, 0xbf, 0x4d, 0x23, 0x8f, 0xd3, 0xb7, 0xb8, 0xb7, 0xb1, 0xe1, 0x91, 0xf4, - 0xe8, 0x70, 0x40, 0x73, 0x0a, 0xcb, 0x84, 0x7b, 0x97, 0x8c, 0x80, 0x50, 0x72, 0xc9, 0x8b, 0x99, - 0xd7, 0xcf, 0x8a, 0x34, 0xf2, 0x0e, 0x63, 0x3e, 0xd0, 0x2a, 0xa4, 0x60, 0xcc, 0xe1, 0x53, 0x92, - 0x78, 0x3d, 0xea, 0xb1, 0xa2, 0xc7, 0x78, 0xcc, 0x8b, 0x88, 0xaa, 0x6d, 0x72, 0xd3, 0x5e, 0x7c, - 0x40, 0x53, 0xb0, 0x9e, 0x14, 0xd4, 0xfd, 0xb5, 0x83, 0x96, 0xe4, 0xff, 0xda, 0x0b, 0x12, 0xea, - 0xcf, 0x04, 0xd4, 0x87, 0x12, 0xaa, 0xfc, 0x3c, 0x81, 0x95, 0x67, 0x56, 0x29, 0x9f, 0x86, 0x1c, - 0xbe, 0x8e, 0x12, 0x12, 0x5a, 0x61, 0x63, 0x50, 0xa9, 0xc0, 0x9e, 0xb7, 0x45, 0x52, 0x40, 0xc9, - 0x68, 0xd2, 0x17, 0x20, 0x89, 0x91, 0x97, 0x5e, 0x04, 0x0b, 0xfb, 0x34, 0xc5, 0xfe, 0x4f, 0x5a, - 0xc8, 0x6b, 0x70, 0xf1, 0x3d, 0x63, 0x6a, 0x17, 0x2c, 0xb9, 0xdf, 0x44, 0x4b, 0x72, 0xbb, 0x76, - 0xf4, 0x2d, 0x00, 0xff, 0xfc, 0xed, 0x06, 0x75, 0xca, 0x81, 0x43, 0x32, 0x62, 0xe2, 0x00, 0x02, - 0x53, 0x44, 0x59, 0x9c, 0x03, 0x60, 0xc6, 0xf3, 0x38, 0xdd, 0xc3, 0xee, 0xcf, 0x1d, 0x74, 0xda, - 0x20, 0x64, 0xe0, 0x8c, 0xd6, 0xea, 0x99, 0xcd, 0xf3, 0xf8, 0x11, 0x31, 0x0e, 0xbe, 0x0b, 0xc6, - 0x1e, 0x80, 0xb1, 0x98, 0x71, 0x71, 0x50, 0x2b, 0xac, 0x1c, 0xc7, 0x26, 0x3d, 0x05, 0xd1, 0xac, - 0xec, 0x52, 0xb1, 0x9b, 0x70, 0xa0, 0xc1, 0xf3, 0x53, 0x07, 0x9d, 0xcd, 0x69, 0x1a, 0x41, 0xf4, - 0xa3, 0xae, 0xf0, 0x6a, 0xbb, 0x25, 0x8f, 0x98, 0x81, 0xd5, 0x7d, 0x71, 0x76, 0xcf, 0xac, 0x1a, - 0x1d, 0x39, 0xfd, 0x3e, 0x98, 0xe5, 0xf0, 0x21, 0x21, 0xe9, 0x5e, 0x01, 0x34, 0x5e, 0xf7, 0xc2, - 0x6c, 0x38, 0x4a, 0x28, 0x98, 0x97, 0xc1, 0xb7, 0x41, 0xb4, 0xb8, 0xc4, 0x89, 0xd6, 0xbd, 0xb8, - 0x2f, 0x62, 0xa0, 0x85, 0xbc, 0x43, 0xc2, 0x3c, 0x36, 0xa2, 0xa1, 0x4c, 0x00, 0xec, 0x7f, 0xb0, - 0x88, 0x9e, 0x6c, 0x70, 0xc3, 0xeb, 0x8c, 0xe6, 0x3b, 0x9c, 0xf0, 0x82, 0xb9, 0xd7, 0xd0, 0xb2, - 0xcc, 0x90, 0x38, 0x92, 0x61, 0x38, 0x15, 0x78, 0x80, 0xf1, 0xbc, 0xa0, 0x90, 0x56, 0x13, 0x7a, - 0x05, 0xec, 0xbe, 0x0c, 0x6a, 0xd5, 0x36, 0xec, 0xfe, 0x01, 0x68, 0xc7, 0x40, 0xda, 0xd0, 0xee, - 0x7d, 0x41, 0xbb, 0x77, 0x25, 0xed, 0xec, 0x56, 0x58, 0x05, 0xaa, 0xe4, 0x94, 0x44, 0x47, 0x22, - 0x17, 0xb8, 0x5e, 0x13, 0xbc, 0x57, 0x1f, 0xc1, 0xc1, 0x40, 0xb3, 0x23, 0xd8, 0x74, 0x48, 0x62, - 0x0e, 0x5e, 0x13, 0xdb, 0x84, 0x0a, 0x91, 0xef, 0x62, 0x9b, 0xf9, 0x9c, 0x09, 0xdf, 0x7b, 0x24, - 0x94, 0x7c, 0xe8, 0xe7, 0xd9, 0xd0, 0x2a, 0xc3, 0xd6, 0x43, 0xd1, 0xba, 0xa2, 0xaa, 0x16, 0xcd, - 0x0e, 0x60, 0xd1, 0xfd, 0x31, 0xc0, 0x04, 0x3f, 0x25, 0x54, 0x3a, 0xff, 0xcc, 0xe6, 0x45, 0x7c, - 0x1c, 0x23, 0x83, 0xfb, 0x70, 0x90, 0xed, 0x5d, 0x21, 0x63, 0xd8, 0xcf, 0xa0, 0xa6, 0x28, 0x22, - 0x7a, 0x51, 0xcc, 0x04, 0x62, 0xc5, 0x41, 0xb0, 0xa2, 0xce, 0x23, 0xc3, 0x17, 0xe7, 0x96, 0x49, - 0x02, 0xe8, 0x81, 0x95, 0x63, 0xd8, 0xfd, 0x95, 0x83, 0x96, 0x75, 0x65, 0x6a, 0x2f, 0xce, 0x0a, - 0xe4, 0x7b, 0x00, 0xe4, 0x3b, 0x3b, 0x45, 0x8f, 0xcf, 0x83, 0x45, 0xfe, 0x53, 0xd6, 0x93, 0x47, - 0x80, 0xf2, 0xdf, 0x5b, 0x42, 0xab, 0x0d, 0x20, 0xb6, 0x20, 0x36, 0x9c, 0xee, 0xa8, 0x6d, 0xdd, - 0xfb, 0x8a, 0x93, 0xee, 0x0d, 0xb4, 0x44, 0x46, 0x23, 0x4d, 0x90, 0xb3, 0xc1, 0x2a, 0x60, 0xfb, - 0x92, 0x88, 0x94, 0xfc, 0x28, 0x20, 0x84, 0x52, 0xac, 0x86, 0xb1, 0x9f, 0x41, 0x04, 0xde, 0x41, - 0xcb, 0x61, 0x96, 0x4a, 0xfe, 0x0b, 0xa6, 0x2c, 0x06, 0x29, 0x88, 0xbe, 0x29, 0xcc, 0x6e, 0x58, - 0x8e, 0x7a, 0x7a, 0x87, 0xae, 0x58, 0x36, 0x8c, 0x21, 0x04, 0x1d, 0x0e, 0x24, 0xf5, 0x13, 0xc6, - 0xb2, 0x30, 0x1e, 0x37, 0x21, 0xb3, 0x82, 0x65, 0xa2, 0x24, 0xf7, 0xde, 0xa4, 0x21, 0x17, 0x4c, - 0x51, 0xc7, 0xee, 0x91, 0x10, 0xca, 0x06, 0x30, 0xf5, 0x47, 0xf3, 0x53, 0xe0, 0x35, 0x80, 0xf8, - 0x2d, 0x71, 0xba, 0x69, 0xae, 0x87, 0x9a, 0xa7, 0xbd, 0x4f, 0x6d, 0xf5, 0xa6, 0x24, 0x1c, 0x18, - 0xee, 0x1b, 0x9f, 0x97, 0x0c, 0x20, 0x68, 0x49, 0xac, 0x31, 0x08, 0xbf, 0x28, 0x4c, 0x17, 0xf0, - 0x23, 0x33, 0x32, 0xd8, 0x04, 0x04, 0x58, 0x20, 0x88, 0x53, 0xc8, 0x00, 0x92, 0xa8, 0x6c, 0x92, - 0x61, 0x84, 0xbe, 0x20, 0x35, 0x99, 0xaa, 0xa1, 0x6d, 0x60, 0xf7, 0x13, 0xa7, 0x4c, 0xe3, 0x25, - 0x99, 0xc6, 0x7f, 0x16, 0x49, 0xf9, 0x27, 0x67, 0xf5, 0x95, 0x91, 0x30, 0x40, 0x92, 0x35, 0x93, - 0xbf, 0xe2, 0x0c, 0x43, 0xb2, 0x4f, 0xab, 0x65, 0x47, 0xb8, 0xae, 0x47, 0x07, 0x04, 0x4a, 0x3a, - 0x98, 0x81, 0x44, 0x84, 0xa2, 0x62, 0x23, 0xb4, 0x5e, 0x66, 0xef, 0xb0, 0x80, 0xbd, 0x3d, 0x3a, - 0x66, 0x1e, 0xf2, 0x33, 0xaa, 0x60, 0xeb, 0x51, 0x91, 0xb6, 0x24, 0x8a, 0x54, 0xf0, 0xaa, 0x1b, - 0x8d, 0x7c, 0x3f, 0x87, 0x76, 0x1c, 0xb1, 0xb2, 0xab, 0xc9, 0x74, 0xf6, 0x63, 0xb4, 0x36, 0x03, - 0x29, 0xd9, 0x08, 0xbe, 0x52, 0xf7, 0xeb, 0xe8, 0xb4, 0x56, 0xab, 0x99, 0xb9, 0x18, 0xac, 0xc1, - 0x91, 0x2f, 0xed, 0x96, 0xf6, 0xe0, 0xb0, 0x3a, 0x7e, 0x8a, 0xa1, 0x91, 0x75, 0x98, 0xff, 0xee, - 0x42, 0x63, 0x02, 0xdc, 0xa1, 0xa2, 0x9c, 0x8c, 0x27, 0xc0, 0xd5, 0x49, 0x53, 0xe7, 0xc1, 0x54, - 0xbb, 0x6e, 0x4a, 0xa4, 0xa5, 0x14, 0xc7, 0xee, 0x75, 0x93, 0x31, 0x0b, 0x32, 0x63, 0x2e, 0xc3, - 0xe6, 0xa7, 0xcb, 0x8c, 0x69, 0x48, 0x67, 0x2d, 0xf7, 0x76, 0x19, 0xc5, 0x96, 0x8c, 0x62, 0x0c, - 0x92, 0xf4, 0x7f, 0x11, 0x43, 0xec, 0x5f, 0x69, 0x74, 0xfe, 0xb8, 0x43, 0x94, 0xf3, 0xfd, 0xbf, - 0x34, 0xd7, 0x8f, 0xd7, 0x47, 0x11, 0xf9, 0x2f, 0xdc, 0x57, 0x48, 0xf1, 0xf9, 0xdd, 0x67, 0xe4, - 0x7e, 0x39, 0x7f, 0xba, 0xcb, 0x42, 0x5b, 0x71, 0xb0, 0x1c, 0xf3, 0xe8, 0x61, 0x63, 0xf6, 0x43, - 0xaf, 0x7a, 0xb9, 0xef, 0xc1, 0x2c, 0x3a, 0xee, 0x57, 0xb5, 0x59, 0x8e, 0x6d, 0x62, 0x15, 0x9c, - 0x1b, 0x0e, 0xa0, 0x21, 0x43, 0x03, 0x76, 0xff, 0xe1, 0xcc, 0x97, 0xfc, 0x1f, 0x8a, 0xb4, 0xfd, - 0x6d, 0x35, 0x6d, 0xcb, 0x21, 0x45, 0xa5, 0xd7, 0xe1, 0x20, 0x63, 0x54, 0xd7, 0x04, 0x33, 0x29, - 0x2a, 0x07, 0x48, 0x1f, 0xe6, 0xb4, 0x9f, 0x88, 0x62, 0x58, 0x8e, 0x6e, 0xba, 0x19, 0xbf, 0xdc, - 0xb7, 0x1c, 0x60, 0x1e, 0x81, 0xb1, 0x54, 0x40, 0x25, 0x89, 0xea, 0xc6, 0x75, 0x32, 0xc8, 0x53, - 0x1d, 0x59, 0xed, 0x36, 0x95, 0x63, 0x5e, 0xaf, 0x34, 0xa7, 0xfe, 0x6f, 0x2b, 0x4d, 0x33, 0xd9, - 0xc7, 0xe9, 0xab, 0xc9, 0xfe, 0xfb, 0x45, 0xb4, 0xde, 0xb0, 0xfb, 0xa5, 0xb4, 0x18, 0xd2, 0xbc, - 0x14, 0x60, 0x96, 0xf0, 0x3f, 0xa8, 0x37, 0x4c, 0x35, 0xf5, 0x8d, 0x93, 0xdd, 0x38, 0x24, 0xa2, - 0x9c, 0xc4, 0x09, 0x93, 0x1d, 0xd3, 0x33, 0x3e, 0xc4, 0x0d, 0x4c, 0x13, 0xe7, 0xe6, 0x95, 0x19, - 0x4b, 0x5b, 0xb5, 0x61, 0xca, 0x29, 0x2f, 0xf2, 0x54, 0x90, 0xee, 0x17, 0x0e, 0x7a, 0x22, 0x4e, - 0xc3, 0x04, 0x6e, 0x0e, 0x5d, 0x90, 0xea, 0x0a, 0x89, 0xae, 0xb9, 0x1d, 0xc9, 0xdc, 0x58, 0x09, - 0xf6, 0x01, 0xd4, 0x5e, 0x25, 0x66, 0x41, 0x96, 0x25, 0x14, 0x7a, 0x2e, 0xc0, 0xa1, 0xf9, 0x10, - 0x5a, 0x0f, 0x78, 0x16, 0xae, 0x2f, 0x60, 0x30, 0x97, 0x56, 0xb5, 0xb8, 0x80, 0x59, 0x89, 0x00, - 0x1b, 0x64, 0x45, 0x12, 0xa9, 0x40, 0x49, 0x7b, 0x11, 0xf6, 0xee, 0xd0, 0x3e, 0x29, 0x12, 0x2e, - 0x67, 0xe8, 0x3e, 0x49, 0xe0, 0x0a, 0xe6, 0xfe, 0xae, 0x0a, 0xa8, 0xe0, 0x83, 0x1a, 0x22, 0x39, - 0x15, 0xad, 0x04, 0x6f, 0x01, 0x20, 0x7e, 0x42, 0x40, 0xe2, 0xb7, 0xd0, 0x0b, 0x77, 0x3c, 0x11, - 0x1e, 0xa0, 0x83, 0x24, 0xd1, 0x8c, 0xe8, 0x02, 0xb4, 0x62, 0xe6, 0x67, 0xd9, 0x3c, 0x4f, 0x07, - 0x5f, 0x06, 0x2c, 0xeb, 0x15, 0x2c, 0xf7, 0xcc, 0x78, 0x0d, 0x42, 0x66, 0xda, 0xaf, 0x5c, 0xd9, - 0xa0, 0x7a, 0x7e, 0xb2, 0x88, 0x3a, 0x0d, 0x1c, 0xd1, 0xd4, 0x80, 0x8a, 0x36, 0x51, 0x02, 0x9f, - 0x06, 0x1b, 0x4f, 0xd5, 0x59, 0xa1, 0x8e, 0x12, 0xb3, 0xb2, 0xaf, 0x6f, 0x54, 0x2b, 0xe1, 0x62, - 0x70, 0x01, 0x64, 0x3a, 0x65, 0x25, 0x34, 0x47, 0xb7, 0xdb, 0x2b, 0x03, 0x57, 0xeb, 0x33, 0x19, - 0xb8, 0x1e, 0x98, 0x02, 0x3c, 0xf3, 0xa4, 0xfb, 0x0c, 0x20, 0xf4, 0xc5, 0x91, 0xc2, 0x22, 0x87, - 0x4b, 0x11, 0xd7, 0xc5, 0x74, 0xe2, 0x68, 0x5f, 0x43, 0x9f, 0xe3, 0xf1, 0x90, 0x76, 0x75, 0x27, - 0x97, 0x81, 0x3a, 0x1b, 0x5c, 0x02, 0xe9, 0x8b, 0x6a, 0x5a, 0x1b, 0x8e, 0x81, 0x85, 0x8b, 0x90, - 0xde, 0x8b, 0xdd, 0x6f, 0x68, 0x61, 0x5d, 0x27, 0x65, 0xe1, 0x3a, 0x1b, 0x3c, 0x0b, 0xc2, 0xcf, - 0x08, 0xe1, 0x84, 0x30, 0xde, 0xac, 0x41, 0x0b, 0x60, 0x37, 0x42, 0x67, 0x24, 0x67, 0x99, 0x2c, - 0xd3, 0xed, 0xe5, 0x99, 0x8a, 0xf9, 0x55, 0x30, 0x70, 0x45, 0x86, 0x58, 0xfe, 0x36, 0x23, 0x5c, - 0x59, 0x86, 0xc7, 0x7b, 0xf0, 0x43, 0x07, 0x6d, 0xcc, 0x58, 0x69, 0xf4, 0x14, 0xf4, 0x1a, 0x5a, - 0x31, 0x85, 0x00, 0x78, 0x25, 0x40, 0x9d, 0xc3, 0xd3, 0x79, 0x18, 0xf8, 0x80, 0xe8, 0x42, 0xd9, - 0x51, 0x1a, 0xca, 0x09, 0xf6, 0x3f, 0x6d, 0x35, 0x96, 0xbb, 0xbb, 0x94, 0x6b, 0x2d, 0x77, 0x54, - 0xc5, 0xb2, 0xe5, 0xee, 0xd5, 0x09, 0x0c, 0x2f, 0xe2, 0x79, 0x14, 0xe0, 0xfb, 0xe6, 0xf2, 0x6b, - 0xd2, 0x05, 0xd7, 0x07, 0x80, 0xa7, 0x00, 0xf5, 0xb9, 0xa9, 0xb4, 0x87, 0x09, 0xfb, 0x46, 0x25, - 0x83, 0xd5, 0x4d, 0x5b, 0x12, 0xe3, 0xd8, 0xb4, 0xed, 0xfc, 0xdb, 0x41, 0x9f, 0x9f, 0xb0, 0x7e, - 0x73, 0x32, 0x59, 0x2d, 0xcf, 0x6a, 0x25, 0x7c, 0x8f, 0xd6, 0xcb, 0xf7, 0x31, 0x75, 0xae, 0xf5, - 0xd9, 0xd6, 0x39, 0xff, 0x9d, 0x46, 0x72, 0x35, 0x85, 0x45, 0x93, 0x6b, 0x7b, 0x3e, 0x72, 0xd9, - 0x30, 0x19, 0x9f, 0x8c, 0x8d, 0x4f, 0xfe, 0x1f, 0x1d, 0xd4, 0x1e, 0x17, 0xdf, 0xa1, 0x5c, 0x5c, - 0xf3, 0xd9, 0xc9, 0x6f, 0x99, 0x3b, 0xe8, 0x71, 0xc8, 0xaa, 0xec, 0xb0, 0x5b, 0x7b, 0x25, 0x94, - 0xd4, 0x59, 0x09, 0xae, 0x83, 0x9a, 0xcd, 0x6f, 0x57, 0xdc, 0x29, 0x1d, 0x26, 0xf7, 0x33, 0xaf, - 0x2a, 0x50, 0x16, 0x5f, 0x30, 0x88, 0xfd, 0x03, 0xf4, 0xfc, 0xd4, 0x01, 0xa1, 0x09, 0xbe, 0x4d, - 0x86, 0x17, 0x50, 0x47, 0x94, 0xd3, 0x1a, 0x98, 0x2e, 0xd3, 0xbb, 0xb4, 0x17, 0x9f, 0xc0, 0xd3, - 0xbc, 0xe0, 0xdf, 0x44, 0xd7, 0xe7, 0xb5, 0xab, 0xa7, 0x94, 0xbf, 0x3b, 0xe8, 0x66, 0x83, 0xe8, - 0x2b, 0x69, 0xed, 0xb7, 0x25, 0x7b, 0xb7, 0xfa, 0x19, 0x22, 0x3d, 0xf6, 0x0a, 0xf4, 0x02, 0xf8, - 0xed, 0x96, 0x99, 0xe3, 0x2a, 0x95, 0x42, 0x8c, 0x9f, 0x35, 0xbf, 0xc1, 0xfc, 0x21, 0xde, 0x38, - 0xcb, 0xf7, 0x2b, 0x19, 0x93, 0xaf, 0xd6, 0x13, 0xf8, 0x0a, 0x68, 0xbb, 0x5c, 0x09, 0xa6, 0x78, - 0xcf, 0x2b, 0x25, 0xea, 0xaf, 0xbb, 0xfe, 0x5f, 0x5b, 0xe8, 0xb9, 0xc6, 0x83, 0x94, 0x95, 0x75, - 0x4b, 0x8d, 0xd7, 0xf5, 0x33, 0xbc, 0x38, 0x7e, 0x86, 0x0d, 0xb0, 0xba, 0x36, 0xe5, 0x0c, 0xcc, - 0x16, 0x65, 0x3b, 0xaa, 0x3f, 0xa8, 0xa6, 0xbd, 0xea, 0xb7, 0x2f, 0x81, 0x86, 0xdb, 0x8d, 0x17, - 0x4a, 0xdb, 0x24, 0xf4, 0x0b, 0x6f, 0xed, 0xe9, 0xab, 0x60, 0xaa, 0xfd, 0x18, 0xcd, 0xf7, 0x8c, - 0x37, 0x5a, 0xd2, 0x1b, 0xd2, 0xb7, 0x53, 0xef, 0x33, 0xd3, 0x34, 0x5a, 0x6d, 0x6f, 0xa0, 0x53, - 0xba, 0x0b, 0xa9, 0x26, 0x7b, 0x5c, 0x17, 0x92, 0x1d, 0xb6, 0x52, 0x70, 0xb6, 0xe1, 0x7a, 0x53, - 0x36, 0x24, 0x3b, 0x13, 0xbb, 0x77, 0xd1, 0x72, 0x4e, 0x87, 0xd9, 0x81, 0x6e, 0xae, 0x3a, 0x77, - 0x2a, 0x82, 0x42, 0xa7, 0x37, 0x20, 0x62, 0xee, 0x86, 0x6b, 0x85, 0xde, 0x5b, 0x3e, 0xc9, 0x99, - 0x34, 0xdf, 0xfc, 0x68, 0x05, 0x3d, 0x36, 0x81, 0x48, 0xbc, 0xd1, 0x3e, 0x26, 0x34, 0xd4, 0xae, - 0xf3, 0xee, 0x1a, 0x9e, 0xf5, 0x19, 0xaa, 0xf3, 0x2c, 0x9e, 0xf9, 0x71, 0xc0, 0xbf, 0x08, 0xd0, - 0x9f, 0x54, 0x6b, 0x4c, 0x3e, 0x1f, 0xb2, 0xa3, 0x34, 0x54, 0x73, 0x8e, 0x86, 0x69, 0xf1, 0xd4, - 0x6e, 0xb8, 0xcd, 0x78, 0x1a, 0x5f, 0x05, 0x9a, 0xf1, 0x4c, 0xb9, 0x2f, 0x4b, 0x3c, 0x6a, 0xed, - 0x38, 0x3c, 0xb5, 0x4b, 0x48, 0x33, 0x9e, 0xc6, 0x6b, 0x76, 0x33, 0x9e, 0x29, 0x57, 0x1a, 0x89, - 0x47, 0xad, 0x4d, 0xc3, 0xf3, 0x3e, 0xe0, 0x99, 0x18, 0x3c, 0xdc, 0x0d, 0x3c, 0xcf, 0x4d, 0xa8, - 0x83, 0xf1, 0x5c, 0xe3, 0x8c, 0x2f, 0x1f, 0x9f, 0xed, 0x3a, 0x40, 0x1b, 0x1f, 0x4f, 0xdc, 0x0f, - 0x01, 0xd6, 0x44, 0xcb, 0x6a, 0x86, 0x35, 0x75, 0xe0, 0x68, 0x86, 0x35, 0xbd, 0x11, 0xfa, 0x72, - 0x52, 0x84, 0x75, 0xfd, 0xc7, 0x07, 0xdb, 0xf1, 0x01, 0x9f, 0x7d, 0x25, 0x37, 0x7e, 0xfb, 0xd4, - 0x41, 0x9d, 0xe9, 0xf5, 0xda, 0xbd, 0x8e, 0x4f, 0xd4, 0x57, 0x3a, 0x37, 0xf0, 0x09, 0xfb, 0xc2, - 0x5d, 0xc0, 0xbe, 0x65, 0x42, 0x6d, 0x06, 0x0b, 0x52, 0xeb, 0x83, 0x32, 0xee, 0xf5, 0xa2, 0x3e, - 0x76, 0x38, 0xa8, 0x54, 0x9d, 0x57, 0x41, 0xd1, 0xbd, 0xdb, 0x70, 0xce, 0xfc, 0x20, 0x0e, 0xd5, - 0x3c, 0xd2, 0x2f, 0xd2, 0x50, 0xed, 0xcf, 0x69, 0x62, 0x5e, 0x20, 0xe4, 0x90, 0x22, 0xf8, 0x94, - 0x67, 0x69, 0x56, 0x34, 0x68, 0x97, 0x2a, 0xa0, 0xe2, 0x6c, 0xfe, 0x73, 0x01, 0x7d, 0x71, 0xe2, - 0x50, 0x5b, 0xf2, 0x4f, 0x75, 0xee, 0x07, 0x30, 0x2b, 0x4c, 0xeb, 0x5d, 0xee, 0x2d, 0x7c, 0xd2, - 0x4e, 0xd7, 0x39, 0x83, 0xb7, 0x33, 0xeb, 0x9b, 0x6b, 0x70, 0xa4, 0x0d, 0xbd, 0x91, 0xa9, 0xb6, - 0x64, 0x9b, 0x44, 0x36, 0x12, 0x23, 0x22, 0x1f, 0xeb, 0x76, 0x22, 0x4d, 0x1f, 0x6f, 0x68, 0x45, - 0xee, 0x57, 0xf0, 0x09, 0x7a, 0x56, 0x1d, 0xcd, 0x73, 0x80, 0xe6, 0x6a, 0x75, 0xb9, 0x8e, 0xa8, - 0x6c, 0x05, 0x83, 0xb2, 0xb9, 0x74, 0xc4, 0x4b, 0xda, 0x17, 0x94, 0xcf, 0xea, 0x48, 0xff, 0xf6, - 0x71, 0x7b, 0x21, 0x68, 0xfd, 0xd0, 0x71, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x81, 0x5e, - 0xd6, 0x51, 0x1d, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/offline.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/offline.pb.go deleted file mode 100644 index 91554fcb..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/offline.pb.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_offline.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type COffline_GetOfflineLogonTicket_Request struct { - Priority *uint32 `protobuf:"varint,1,opt,name=priority" json:"priority,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *COffline_GetOfflineLogonTicket_Request) Reset() { - *m = COffline_GetOfflineLogonTicket_Request{} -} -func (m *COffline_GetOfflineLogonTicket_Request) String() string { return proto.CompactTextString(m) } -func (*COffline_GetOfflineLogonTicket_Request) ProtoMessage() {} -func (*COffline_GetOfflineLogonTicket_Request) Descriptor() ([]byte, []int) { - return offline_fileDescriptor0, []int{0} -} - -func (m *COffline_GetOfflineLogonTicket_Request) GetPriority() uint32 { - if m != nil && m.Priority != nil { - return *m.Priority - } - return 0 -} - -type COffline_GetOfflineLogonTicket_Response struct { - SerializedTicket []byte `protobuf:"bytes,1,opt,name=serialized_ticket" json:"serialized_ticket,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *COffline_GetOfflineLogonTicket_Response) Reset() { - *m = COffline_GetOfflineLogonTicket_Response{} -} -func (m *COffline_GetOfflineLogonTicket_Response) String() string { return proto.CompactTextString(m) } -func (*COffline_GetOfflineLogonTicket_Response) ProtoMessage() {} -func (*COffline_GetOfflineLogonTicket_Response) Descriptor() ([]byte, []int) { - return offline_fileDescriptor0, []int{1} -} - -func (m *COffline_GetOfflineLogonTicket_Response) GetSerializedTicket() []byte { - if m != nil { - return m.SerializedTicket - } - return nil -} - -func (m *COffline_GetOfflineLogonTicket_Response) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type COffline_GetUnsignedOfflineLogonTicket_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *COffline_GetUnsignedOfflineLogonTicket_Request) Reset() { - *m = COffline_GetUnsignedOfflineLogonTicket_Request{} -} -func (m *COffline_GetUnsignedOfflineLogonTicket_Request) String() string { - return proto.CompactTextString(m) -} -func (*COffline_GetUnsignedOfflineLogonTicket_Request) ProtoMessage() {} -func (*COffline_GetUnsignedOfflineLogonTicket_Request) Descriptor() ([]byte, []int) { - return offline_fileDescriptor0, []int{2} -} - -type COffline_OfflineLogonTicket struct { - Accountid *uint32 `protobuf:"varint,1,opt,name=accountid" json:"accountid,omitempty"` - Rtime32CreationTime *uint32 `protobuf:"fixed32,2,opt,name=rtime32_creation_time" json:"rtime32_creation_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *COffline_OfflineLogonTicket) Reset() { *m = COffline_OfflineLogonTicket{} } -func (m *COffline_OfflineLogonTicket) String() string { return proto.CompactTextString(m) } -func (*COffline_OfflineLogonTicket) ProtoMessage() {} -func (*COffline_OfflineLogonTicket) Descriptor() ([]byte, []int) { return offline_fileDescriptor0, []int{3} } - -func (m *COffline_OfflineLogonTicket) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -func (m *COffline_OfflineLogonTicket) GetRtime32CreationTime() uint32 { - if m != nil && m.Rtime32CreationTime != nil { - return *m.Rtime32CreationTime - } - return 0 -} - -type COffline_GetUnsignedOfflineLogonTicket_Response struct { - Ticket *COffline_OfflineLogonTicket `protobuf:"bytes,1,opt,name=ticket" json:"ticket,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *COffline_GetUnsignedOfflineLogonTicket_Response) Reset() { - *m = COffline_GetUnsignedOfflineLogonTicket_Response{} -} -func (m *COffline_GetUnsignedOfflineLogonTicket_Response) String() string { - return proto.CompactTextString(m) -} -func (*COffline_GetUnsignedOfflineLogonTicket_Response) ProtoMessage() {} -func (*COffline_GetUnsignedOfflineLogonTicket_Response) Descriptor() ([]byte, []int) { - return offline_fileDescriptor0, []int{4} -} - -func (m *COffline_GetUnsignedOfflineLogonTicket_Response) GetTicket() *COffline_OfflineLogonTicket { - if m != nil { - return m.Ticket - } - return nil -} - -func init() { - proto.RegisterType((*COffline_GetOfflineLogonTicket_Request)(nil), "COffline_GetOfflineLogonTicket_Request") - proto.RegisterType((*COffline_GetOfflineLogonTicket_Response)(nil), "COffline_GetOfflineLogonTicket_Response") - proto.RegisterType((*COffline_GetUnsignedOfflineLogonTicket_Request)(nil), "COffline_GetUnsignedOfflineLogonTicket_Request") - proto.RegisterType((*COffline_OfflineLogonTicket)(nil), "COffline_OfflineLogonTicket") - proto.RegisterType((*COffline_GetUnsignedOfflineLogonTicket_Response)(nil), "COffline_GetUnsignedOfflineLogonTicket_Response") -} - -var offline_fileDescriptor0 = []byte{ - // 377 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x52, 0xcd, 0x4a, 0xf3, 0x40, - 0x14, 0x25, 0x5f, 0xe1, 0xab, 0x8e, 0x0a, 0x76, 0xa0, 0x10, 0x63, 0x0b, 0x43, 0x16, 0xb6, 0x8b, - 0x92, 0x96, 0xba, 0x52, 0x70, 0xa3, 0x88, 0x08, 0x42, 0x41, 0x14, 0x97, 0x61, 0x4c, 0x6e, 0xe2, - 0x60, 0x3a, 0x53, 0x67, 0x6e, 0x04, 0x5d, 0x89, 0xaf, 0xe2, 0x33, 0xf4, 0x01, 0x7c, 0x33, 0xf3, - 0x87, 0x56, 0xac, 0xb5, 0xdd, 0x25, 0x37, 0xe7, 0xdc, 0x9c, 0x9f, 0x4b, 0x3a, 0x06, 0x81, 0x8f, - 0xc7, 0x60, 0x0c, 0x8f, 0xc1, 0xf8, 0x2a, 0x8a, 0x12, 0x21, 0xc1, 0x2b, 0xa6, 0x41, 0x22, 0x40, - 0xa2, 0x37, 0xd1, 0x0a, 0x95, 0xd3, 0xfb, 0x0e, 0x4c, 0xa5, 0x88, 0x04, 0x84, 0xfe, 0x2d, 0x37, - 0x73, 0xd0, 0xee, 0x21, 0xd9, 0x3b, 0x19, 0x95, 0xbb, 0xfc, 0x33, 0xc0, 0xea, 0xf1, 0x42, 0xc5, - 0x4a, 0x5e, 0x89, 0xe0, 0x1e, 0xd0, 0xbf, 0x84, 0x87, 0x14, 0x0c, 0xd2, 0x6d, 0xb2, 0x36, 0xd1, - 0x42, 0x69, 0x81, 0x4f, 0xb6, 0xc5, 0xac, 0xee, 0x96, 0x7b, 0x43, 0x3a, 0x7f, 0x72, 0xcd, 0x44, - 0x49, 0x03, 0x74, 0x87, 0x34, 0x0c, 0x68, 0xc1, 0x13, 0xf1, 0x9c, 0x69, 0xc1, 0xe2, 0x6b, 0xb1, - 0x65, 0x93, 0x36, 0xc8, 0xba, 0x11, 0xb1, 0xe4, 0x98, 0x6a, 0xb0, 0xff, 0xe5, 0x23, 0x77, 0x40, - 0xbc, 0xd9, 0xc5, 0xd7, 0x32, 0x07, 0x40, 0xf8, 0xbb, 0x38, 0x77, 0x44, 0x76, 0x3f, 0x19, 0x3f, - 0x61, 0xf9, 0x3f, 0x78, 0x10, 0xa8, 0x54, 0xa2, 0x08, 0x4b, 0xf1, 0xb4, 0x4d, 0x9a, 0x1a, 0xc5, - 0x18, 0xf6, 0x87, 0x7e, 0xa0, 0x81, 0xa3, 0x50, 0xd2, 0xcf, 0xdf, 0x0b, 0x09, 0x75, 0xd7, 0x27, - 0xfd, 0xa5, 0x25, 0x54, 0x1e, 0x7b, 0xe4, 0xff, 0x8c, 0xb1, 0x8d, 0x61, 0xcb, 0x5b, 0x20, 0x69, - 0xf8, 0x56, 0x23, 0xf5, 0x6a, 0x4c, 0xa7, 0x16, 0x69, 0xce, 0x0d, 0x90, 0x76, 0xbc, 0xe5, 0xda, - 0x71, 0xba, 0xde, 0x92, 0x55, 0xb8, 0xe7, 0xaf, 0x53, 0xfb, 0x34, 0xc3, 0x30, 0xce, 0xbe, 0x2a, - 0x61, 0x5c, 0x86, 0xac, 0xb4, 0xc8, 0xaa, 0xd3, 0x62, 0x49, 0xce, 0x66, 0xa5, 0x25, 0x16, 0x29, - 0xcd, 0xf0, 0x0e, 0x58, 0x90, 0x6a, 0x9d, 0x5d, 0x0f, 0x4b, 0x33, 0x2e, 0x7d, 0xb7, 0x48, 0x7b, - 0x61, 0x38, 0xb4, 0xbf, 0x62, 0x91, 0xce, 0xc0, 0x5b, 0x31, 0x76, 0xf7, 0x28, 0xf3, 0x73, 0x50, - 0xf8, 0x91, 0x2c, 0x95, 0xab, 0x7a, 0x70, 0x5a, 0x19, 0xdd, 0xae, 0xf6, 0x67, 0x81, 0x20, 0x0a, - 0x19, 0x9b, 0x3c, 0x99, 0x47, 0x11, 0xc0, 0x71, 0xed, 0xc5, 0xb2, 0x3e, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x90, 0xd3, 0xb5, 0xf7, 0x7b, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/parental.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/parental.pb.go deleted file mode 100644 index 5d3dbac0..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/parental.pb.go +++ /dev/null @@ -1,791 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_parental.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type ParentalApp struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - IsAllowed *bool `protobuf:"varint,2,opt,name=is_allowed" json:"is_allowed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ParentalApp) Reset() { *m = ParentalApp{} } -func (m *ParentalApp) String() string { return proto.CompactTextString(m) } -func (*ParentalApp) ProtoMessage() {} -func (*ParentalApp) Descriptor() ([]byte, []int) { return parental_fileDescriptor0, []int{0} } - -func (m *ParentalApp) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *ParentalApp) GetIsAllowed() bool { - if m != nil && m.IsAllowed != nil { - return *m.IsAllowed - } - return false -} - -type ParentalSettings struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - ApplistBaseId *uint32 `protobuf:"varint,2,opt,name=applist_base_id" json:"applist_base_id,omitempty"` - ApplistBaseDescription *string `protobuf:"bytes,3,opt,name=applist_base_description" json:"applist_base_description,omitempty"` - ApplistBase []*ParentalApp `protobuf:"bytes,4,rep,name=applist_base" json:"applist_base,omitempty"` - ApplistCustom []*ParentalApp `protobuf:"bytes,5,rep,name=applist_custom" json:"applist_custom,omitempty"` - Passwordhashtype *uint32 `protobuf:"varint,6,opt,name=passwordhashtype" json:"passwordhashtype,omitempty"` - Salt []byte `protobuf:"bytes,7,opt,name=salt" json:"salt,omitempty"` - Passwordhash []byte `protobuf:"bytes,8,opt,name=passwordhash" json:"passwordhash,omitempty"` - IsEnabled *bool `protobuf:"varint,9,opt,name=is_enabled" json:"is_enabled,omitempty"` - EnabledFeatures *uint32 `protobuf:"varint,10,opt,name=enabled_features" json:"enabled_features,omitempty"` - RecoveryEmail *string `protobuf:"bytes,11,opt,name=recovery_email" json:"recovery_email,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ParentalSettings) Reset() { *m = ParentalSettings{} } -func (m *ParentalSettings) String() string { return proto.CompactTextString(m) } -func (*ParentalSettings) ProtoMessage() {} -func (*ParentalSettings) Descriptor() ([]byte, []int) { return parental_fileDescriptor0, []int{1} } - -func (m *ParentalSettings) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *ParentalSettings) GetApplistBaseId() uint32 { - if m != nil && m.ApplistBaseId != nil { - return *m.ApplistBaseId - } - return 0 -} - -func (m *ParentalSettings) GetApplistBaseDescription() string { - if m != nil && m.ApplistBaseDescription != nil { - return *m.ApplistBaseDescription - } - return "" -} - -func (m *ParentalSettings) GetApplistBase() []*ParentalApp { - if m != nil { - return m.ApplistBase - } - return nil -} - -func (m *ParentalSettings) GetApplistCustom() []*ParentalApp { - if m != nil { - return m.ApplistCustom - } - return nil -} - -func (m *ParentalSettings) GetPasswordhashtype() uint32 { - if m != nil && m.Passwordhashtype != nil { - return *m.Passwordhashtype - } - return 0 -} - -func (m *ParentalSettings) GetSalt() []byte { - if m != nil { - return m.Salt - } - return nil -} - -func (m *ParentalSettings) GetPasswordhash() []byte { - if m != nil { - return m.Passwordhash - } - return nil -} - -func (m *ParentalSettings) GetIsEnabled() bool { - if m != nil && m.IsEnabled != nil { - return *m.IsEnabled - } - return false -} - -func (m *ParentalSettings) GetEnabledFeatures() uint32 { - if m != nil && m.EnabledFeatures != nil { - return *m.EnabledFeatures - } - return 0 -} - -func (m *ParentalSettings) GetRecoveryEmail() string { - if m != nil && m.RecoveryEmail != nil { - return *m.RecoveryEmail - } - return "" -} - -type CParental_EnableParentalSettings_Request struct { - Password *string `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"` - Settings *ParentalSettings `protobuf:"bytes,2,opt,name=settings" json:"settings,omitempty"` - Sessionid *string `protobuf:"bytes,3,opt,name=sessionid" json:"sessionid,omitempty"` - Enablecode *uint32 `protobuf:"varint,4,opt,name=enablecode" json:"enablecode,omitempty"` - Steamid *uint64 `protobuf:"fixed64,10,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_EnableParentalSettings_Request) Reset() { - *m = CParental_EnableParentalSettings_Request{} -} -func (m *CParental_EnableParentalSettings_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_EnableParentalSettings_Request) ProtoMessage() {} -func (*CParental_EnableParentalSettings_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{2} -} - -func (m *CParental_EnableParentalSettings_Request) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CParental_EnableParentalSettings_Request) GetSettings() *ParentalSettings { - if m != nil { - return m.Settings - } - return nil -} - -func (m *CParental_EnableParentalSettings_Request) GetSessionid() string { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return "" -} - -func (m *CParental_EnableParentalSettings_Request) GetEnablecode() uint32 { - if m != nil && m.Enablecode != nil { - return *m.Enablecode - } - return 0 -} - -func (m *CParental_EnableParentalSettings_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CParental_EnableParentalSettings_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_EnableParentalSettings_Response) Reset() { - *m = CParental_EnableParentalSettings_Response{} -} -func (m *CParental_EnableParentalSettings_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_EnableParentalSettings_Response) ProtoMessage() {} -func (*CParental_EnableParentalSettings_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{3} -} - -type CParental_DisableParentalSettings_Request struct { - Password *string `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"` - Steamid *uint64 `protobuf:"fixed64,10,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_DisableParentalSettings_Request) Reset() { - *m = CParental_DisableParentalSettings_Request{} -} -func (m *CParental_DisableParentalSettings_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_DisableParentalSettings_Request) ProtoMessage() {} -func (*CParental_DisableParentalSettings_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{4} -} - -func (m *CParental_DisableParentalSettings_Request) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CParental_DisableParentalSettings_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CParental_DisableParentalSettings_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_DisableParentalSettings_Response) Reset() { - *m = CParental_DisableParentalSettings_Response{} -} -func (m *CParental_DisableParentalSettings_Response) String() string { - return proto.CompactTextString(m) -} -func (*CParental_DisableParentalSettings_Response) ProtoMessage() {} -func (*CParental_DisableParentalSettings_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{5} -} - -type CParental_GetParentalSettings_Request struct { - Steamid *uint64 `protobuf:"fixed64,10,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_GetParentalSettings_Request) Reset() { *m = CParental_GetParentalSettings_Request{} } -func (m *CParental_GetParentalSettings_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_GetParentalSettings_Request) ProtoMessage() {} -func (*CParental_GetParentalSettings_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{6} -} - -func (m *CParental_GetParentalSettings_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CParental_GetParentalSettings_Response struct { - Settings *ParentalSettings `protobuf:"bytes,1,opt,name=settings" json:"settings,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_GetParentalSettings_Response) Reset() { - *m = CParental_GetParentalSettings_Response{} -} -func (m *CParental_GetParentalSettings_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_GetParentalSettings_Response) ProtoMessage() {} -func (*CParental_GetParentalSettings_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{7} -} - -func (m *CParental_GetParentalSettings_Response) GetSettings() *ParentalSettings { - if m != nil { - return m.Settings - } - return nil -} - -type CParental_GetSignedParentalSettings_Request struct { - Priority *uint32 `protobuf:"varint,1,opt,name=priority" json:"priority,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_GetSignedParentalSettings_Request) Reset() { - *m = CParental_GetSignedParentalSettings_Request{} -} -func (m *CParental_GetSignedParentalSettings_Request) String() string { - return proto.CompactTextString(m) -} -func (*CParental_GetSignedParentalSettings_Request) ProtoMessage() {} -func (*CParental_GetSignedParentalSettings_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{8} -} - -func (m *CParental_GetSignedParentalSettings_Request) GetPriority() uint32 { - if m != nil && m.Priority != nil { - return *m.Priority - } - return 0 -} - -type CParental_GetSignedParentalSettings_Response struct { - SerializedSettings []byte `protobuf:"bytes,1,opt,name=serialized_settings" json:"serialized_settings,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_GetSignedParentalSettings_Response) Reset() { - *m = CParental_GetSignedParentalSettings_Response{} -} -func (m *CParental_GetSignedParentalSettings_Response) String() string { - return proto.CompactTextString(m) -} -func (*CParental_GetSignedParentalSettings_Response) ProtoMessage() {} -func (*CParental_GetSignedParentalSettings_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{9} -} - -func (m *CParental_GetSignedParentalSettings_Response) GetSerializedSettings() []byte { - if m != nil { - return m.SerializedSettings - } - return nil -} - -func (m *CParental_GetSignedParentalSettings_Response) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type CParental_SetParentalSettings_Request struct { - Password *string `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"` - Settings *ParentalSettings `protobuf:"bytes,2,opt,name=settings" json:"settings,omitempty"` - NewPassword *string `protobuf:"bytes,3,opt,name=new_password" json:"new_password,omitempty"` - Sessionid *string `protobuf:"bytes,4,opt,name=sessionid" json:"sessionid,omitempty"` - Steamid *uint64 `protobuf:"fixed64,10,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_SetParentalSettings_Request) Reset() { *m = CParental_SetParentalSettings_Request{} } -func (m *CParental_SetParentalSettings_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_SetParentalSettings_Request) ProtoMessage() {} -func (*CParental_SetParentalSettings_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{10} -} - -func (m *CParental_SetParentalSettings_Request) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CParental_SetParentalSettings_Request) GetSettings() *ParentalSettings { - if m != nil { - return m.Settings - } - return nil -} - -func (m *CParental_SetParentalSettings_Request) GetNewPassword() string { - if m != nil && m.NewPassword != nil { - return *m.NewPassword - } - return "" -} - -func (m *CParental_SetParentalSettings_Request) GetSessionid() string { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return "" -} - -func (m *CParental_SetParentalSettings_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CParental_SetParentalSettings_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_SetParentalSettings_Response) Reset() { - *m = CParental_SetParentalSettings_Response{} -} -func (m *CParental_SetParentalSettings_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_SetParentalSettings_Response) ProtoMessage() {} -func (*CParental_SetParentalSettings_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{11} -} - -type CParental_ValidateToken_Request struct { - UnlockToken *string `protobuf:"bytes,1,opt,name=unlock_token" json:"unlock_token,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ValidateToken_Request) Reset() { *m = CParental_ValidateToken_Request{} } -func (m *CParental_ValidateToken_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_ValidateToken_Request) ProtoMessage() {} -func (*CParental_ValidateToken_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{12} -} - -func (m *CParental_ValidateToken_Request) GetUnlockToken() string { - if m != nil && m.UnlockToken != nil { - return *m.UnlockToken - } - return "" -} - -type CParental_ValidateToken_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ValidateToken_Response) Reset() { *m = CParental_ValidateToken_Response{} } -func (m *CParental_ValidateToken_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_ValidateToken_Response) ProtoMessage() {} -func (*CParental_ValidateToken_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{13} -} - -type CParental_ValidatePassword_Request struct { - Password *string `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"` - Session *string `protobuf:"bytes,2,opt,name=session" json:"session,omitempty"` - SendUnlockOnSuccess *bool `protobuf:"varint,3,opt,name=send_unlock_on_success" json:"send_unlock_on_success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ValidatePassword_Request) Reset() { *m = CParental_ValidatePassword_Request{} } -func (m *CParental_ValidatePassword_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_ValidatePassword_Request) ProtoMessage() {} -func (*CParental_ValidatePassword_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{14} -} - -func (m *CParental_ValidatePassword_Request) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CParental_ValidatePassword_Request) GetSession() string { - if m != nil && m.Session != nil { - return *m.Session - } - return "" -} - -func (m *CParental_ValidatePassword_Request) GetSendUnlockOnSuccess() bool { - if m != nil && m.SendUnlockOnSuccess != nil { - return *m.SendUnlockOnSuccess - } - return false -} - -type CParental_ValidatePassword_Response struct { - Token *string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ValidatePassword_Response) Reset() { *m = CParental_ValidatePassword_Response{} } -func (m *CParental_ValidatePassword_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_ValidatePassword_Response) ProtoMessage() {} -func (*CParental_ValidatePassword_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{15} -} - -func (m *CParental_ValidatePassword_Response) GetToken() string { - if m != nil && m.Token != nil { - return *m.Token - } - return "" -} - -type CParental_LockClient_Request struct { - Session *string `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_LockClient_Request) Reset() { *m = CParental_LockClient_Request{} } -func (m *CParental_LockClient_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_LockClient_Request) ProtoMessage() {} -func (*CParental_LockClient_Request) Descriptor() ([]byte, []int) { return parental_fileDescriptor0, []int{16} } - -func (m *CParental_LockClient_Request) GetSession() string { - if m != nil && m.Session != nil { - return *m.Session - } - return "" -} - -type CParental_LockClient_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_LockClient_Response) Reset() { *m = CParental_LockClient_Response{} } -func (m *CParental_LockClient_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_LockClient_Response) ProtoMessage() {} -func (*CParental_LockClient_Response) Descriptor() ([]byte, []int) { return parental_fileDescriptor0, []int{17} } - -type CParental_RequestRecoveryCode_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_RequestRecoveryCode_Request) Reset() { *m = CParental_RequestRecoveryCode_Request{} } -func (m *CParental_RequestRecoveryCode_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_RequestRecoveryCode_Request) ProtoMessage() {} -func (*CParental_RequestRecoveryCode_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{18} -} - -type CParental_RequestRecoveryCode_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_RequestRecoveryCode_Response) Reset() { - *m = CParental_RequestRecoveryCode_Response{} -} -func (m *CParental_RequestRecoveryCode_Response) String() string { return proto.CompactTextString(m) } -func (*CParental_RequestRecoveryCode_Response) ProtoMessage() {} -func (*CParental_RequestRecoveryCode_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{19} -} - -type CParental_DisableWithRecoveryCode_Request struct { - RecoveryCode *uint32 `protobuf:"varint,1,opt,name=recovery_code" json:"recovery_code,omitempty"` - Steamid *uint64 `protobuf:"fixed64,10,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_DisableWithRecoveryCode_Request) Reset() { - *m = CParental_DisableWithRecoveryCode_Request{} -} -func (m *CParental_DisableWithRecoveryCode_Request) String() string { return proto.CompactTextString(m) } -func (*CParental_DisableWithRecoveryCode_Request) ProtoMessage() {} -func (*CParental_DisableWithRecoveryCode_Request) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{20} -} - -func (m *CParental_DisableWithRecoveryCode_Request) GetRecoveryCode() uint32 { - if m != nil && m.RecoveryCode != nil { - return *m.RecoveryCode - } - return 0 -} - -func (m *CParental_DisableWithRecoveryCode_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CParental_DisableWithRecoveryCode_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_DisableWithRecoveryCode_Response) Reset() { - *m = CParental_DisableWithRecoveryCode_Response{} -} -func (m *CParental_DisableWithRecoveryCode_Response) String() string { - return proto.CompactTextString(m) -} -func (*CParental_DisableWithRecoveryCode_Response) ProtoMessage() {} -func (*CParental_DisableWithRecoveryCode_Response) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{21} -} - -type CParental_ParentalSettingsChange_Notification struct { - SerializedSettings []byte `protobuf:"bytes,1,opt,name=serialized_settings" json:"serialized_settings,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` - Password *string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"` - Sessionid *string `protobuf:"bytes,4,opt,name=sessionid" json:"sessionid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ParentalSettingsChange_Notification) Reset() { - *m = CParental_ParentalSettingsChange_Notification{} -} -func (m *CParental_ParentalSettingsChange_Notification) String() string { - return proto.CompactTextString(m) -} -func (*CParental_ParentalSettingsChange_Notification) ProtoMessage() {} -func (*CParental_ParentalSettingsChange_Notification) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{22} -} - -func (m *CParental_ParentalSettingsChange_Notification) GetSerializedSettings() []byte { - if m != nil { - return m.SerializedSettings - } - return nil -} - -func (m *CParental_ParentalSettingsChange_Notification) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *CParental_ParentalSettingsChange_Notification) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CParental_ParentalSettingsChange_Notification) GetSessionid() string { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return "" -} - -type CParental_ParentalUnlock_Notification struct { - Password *string `protobuf:"bytes,1,opt,name=password" json:"password,omitempty"` - Sessionid *string `protobuf:"bytes,2,opt,name=sessionid" json:"sessionid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ParentalUnlock_Notification) Reset() { *m = CParental_ParentalUnlock_Notification{} } -func (m *CParental_ParentalUnlock_Notification) String() string { return proto.CompactTextString(m) } -func (*CParental_ParentalUnlock_Notification) ProtoMessage() {} -func (*CParental_ParentalUnlock_Notification) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{23} -} - -func (m *CParental_ParentalUnlock_Notification) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CParental_ParentalUnlock_Notification) GetSessionid() string { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return "" -} - -type CParental_ParentalLock_Notification struct { - Sessionid *string `protobuf:"bytes,1,opt,name=sessionid" json:"sessionid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CParental_ParentalLock_Notification) Reset() { *m = CParental_ParentalLock_Notification{} } -func (m *CParental_ParentalLock_Notification) String() string { return proto.CompactTextString(m) } -func (*CParental_ParentalLock_Notification) ProtoMessage() {} -func (*CParental_ParentalLock_Notification) Descriptor() ([]byte, []int) { - return parental_fileDescriptor0, []int{24} -} - -func (m *CParental_ParentalLock_Notification) GetSessionid() string { - if m != nil && m.Sessionid != nil { - return *m.Sessionid - } - return "" -} - -func init() { - proto.RegisterType((*ParentalApp)(nil), "ParentalApp") - proto.RegisterType((*ParentalSettings)(nil), "ParentalSettings") - proto.RegisterType((*CParental_EnableParentalSettings_Request)(nil), "CParental_EnableParentalSettings_Request") - proto.RegisterType((*CParental_EnableParentalSettings_Response)(nil), "CParental_EnableParentalSettings_Response") - proto.RegisterType((*CParental_DisableParentalSettings_Request)(nil), "CParental_DisableParentalSettings_Request") - proto.RegisterType((*CParental_DisableParentalSettings_Response)(nil), "CParental_DisableParentalSettings_Response") - proto.RegisterType((*CParental_GetParentalSettings_Request)(nil), "CParental_GetParentalSettings_Request") - proto.RegisterType((*CParental_GetParentalSettings_Response)(nil), "CParental_GetParentalSettings_Response") - proto.RegisterType((*CParental_GetSignedParentalSettings_Request)(nil), "CParental_GetSignedParentalSettings_Request") - proto.RegisterType((*CParental_GetSignedParentalSettings_Response)(nil), "CParental_GetSignedParentalSettings_Response") - proto.RegisterType((*CParental_SetParentalSettings_Request)(nil), "CParental_SetParentalSettings_Request") - proto.RegisterType((*CParental_SetParentalSettings_Response)(nil), "CParental_SetParentalSettings_Response") - proto.RegisterType((*CParental_ValidateToken_Request)(nil), "CParental_ValidateToken_Request") - proto.RegisterType((*CParental_ValidateToken_Response)(nil), "CParental_ValidateToken_Response") - proto.RegisterType((*CParental_ValidatePassword_Request)(nil), "CParental_ValidatePassword_Request") - proto.RegisterType((*CParental_ValidatePassword_Response)(nil), "CParental_ValidatePassword_Response") - proto.RegisterType((*CParental_LockClient_Request)(nil), "CParental_LockClient_Request") - proto.RegisterType((*CParental_LockClient_Response)(nil), "CParental_LockClient_Response") - proto.RegisterType((*CParental_RequestRecoveryCode_Request)(nil), "CParental_RequestRecoveryCode_Request") - proto.RegisterType((*CParental_RequestRecoveryCode_Response)(nil), "CParental_RequestRecoveryCode_Response") - proto.RegisterType((*CParental_DisableWithRecoveryCode_Request)(nil), "CParental_DisableWithRecoveryCode_Request") - proto.RegisterType((*CParental_DisableWithRecoveryCode_Response)(nil), "CParental_DisableWithRecoveryCode_Response") - proto.RegisterType((*CParental_ParentalSettingsChange_Notification)(nil), "CParental_ParentalSettingsChange_Notification") - proto.RegisterType((*CParental_ParentalUnlock_Notification)(nil), "CParental_ParentalUnlock_Notification") - proto.RegisterType((*CParental_ParentalLock_Notification)(nil), "CParental_ParentalLock_Notification") -} - -var parental_fileDescriptor0 = []byte{ - // 1337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x57, 0x41, 0x8f, 0x14, 0xc5, - 0x17, 0x4f, 0xc3, 0x02, 0xbb, 0xb5, 0xb3, 0xcb, 0x52, 0xf0, 0x87, 0x66, 0xfe, 0x02, 0x65, 0x2f, - 0xc2, 0x02, 0x4b, 0x6b, 0x56, 0x23, 0x26, 0x26, 0x12, 0x58, 0x0d, 0x26, 0x2e, 0x88, 0x0c, 0x8a, - 0x09, 0x89, 0x9d, 0xda, 0xee, 0xda, 0xd9, 0x92, 0x9e, 0xaa, 0xb6, 0xab, 0x86, 0x75, 0x3d, 0x19, - 0x63, 0xbc, 0x19, 0x2f, 0x1e, 0x34, 0xf1, 0x6e, 0xa2, 0x5e, 0x89, 0x57, 0x13, 0xbf, 0x80, 0xf1, - 0x53, 0xf8, 0x31, 0x7c, 0x5d, 0xd5, 0x3d, 0xd3, 0xbd, 0xd3, 0x33, 0xd3, 0x23, 0xb7, 0x99, 0xaa, - 0xf7, 0x5e, 0xfd, 0xde, 0x7b, 0xbf, 0x7a, 0xbf, 0x6a, 0xb4, 0xa6, 0x34, 0xa3, 0xbd, 0x1e, 0x53, - 0x8a, 0x76, 0x99, 0x0a, 0x12, 0x9a, 0x32, 0xa1, 0x69, 0xec, 0x9b, 0xe5, 0x30, 0xe6, 0xf0, 0xcf, - 0x4f, 0x52, 0xa9, 0x65, 0x7b, 0xbd, 0x6a, 0xd9, 0x17, 0x7c, 0x87, 0xb3, 0x28, 0xd8, 0xa6, 0x8a, - 0x8d, 0x5a, 0x7b, 0xaf, 0xa0, 0xc5, 0xfb, 0x79, 0xac, 0x5b, 0x49, 0x82, 0x97, 0xd0, 0x11, 0x9a, - 0x24, 0x3c, 0x72, 0x1d, 0xe2, 0xac, 0x2d, 0x61, 0x8c, 0x10, 0x57, 0x01, 0x8d, 0x63, 0xb9, 0xc7, - 0x22, 0xf7, 0x10, 0xac, 0xcd, 0x7b, 0xbf, 0x1d, 0x42, 0x2b, 0x85, 0x4b, 0x87, 0x69, 0xcd, 0x45, - 0x57, 0xe1, 0xe3, 0xe8, 0x98, 0x89, 0x9d, 0x7b, 0x1e, 0xc5, 0x67, 0xd0, 0x71, 0x08, 0x14, 0x73, - 0xa5, 0xcd, 0xc9, 0x01, 0xb7, 0xee, 0x4b, 0x98, 0x20, 0xb7, 0xb2, 0x11, 0x31, 0x15, 0xa6, 0x3c, - 0xd1, 0x5c, 0x0a, 0xf7, 0x30, 0x58, 0x2c, 0x60, 0x0f, 0xb5, 0xca, 0x16, 0xee, 0x1c, 0x39, 0xbc, - 0xb6, 0xb8, 0xd1, 0xf2, 0xcb, 0x38, 0x2f, 0xa2, 0xe5, 0xc2, 0x26, 0xec, 0x2b, 0x2d, 0x7b, 0xee, - 0x91, 0x1a, 0x2b, 0x17, 0xad, 0x24, 0x54, 0xa9, 0x3d, 0x99, 0x46, 0xbb, 0x54, 0xed, 0xea, 0xfd, - 0x84, 0xb9, 0x47, 0x0d, 0x8a, 0x16, 0x9a, 0x53, 0x34, 0xd6, 0xee, 0x31, 0xf8, 0xd7, 0xc2, 0xa7, - 0x50, 0xab, 0x6c, 0xe7, 0xce, 0x9b, 0x55, 0x9b, 0x3c, 0x13, 0x74, 0x3b, 0x86, 0xe4, 0x17, 0xb2, - 0xe4, 0xb3, 0x88, 0xf9, 0x42, 0xb0, 0xc3, 0xa8, 0xee, 0xa7, 0x4c, 0xb9, 0xc8, 0x44, 0x3c, 0x8d, - 0x96, 0x53, 0x16, 0xca, 0xa7, 0x2c, 0xdd, 0x0f, 0x58, 0x8f, 0xf2, 0xd8, 0x5d, 0xcc, 0xb2, 0xf1, - 0x7e, 0x74, 0xd0, 0xda, 0x66, 0x01, 0x2a, 0x78, 0xc7, 0x38, 0x1f, 0x2c, 0x5f, 0xf0, 0x80, 0x7d, - 0xd6, 0x67, 0x4a, 0xe3, 0x15, 0x34, 0x5f, 0x00, 0x31, 0x75, 0x5c, 0xc0, 0xab, 0x68, 0x5e, 0xe5, - 0x56, 0xa6, 0x80, 0x8b, 0x1b, 0x27, 0xfc, 0x91, 0xea, 0x9f, 0x40, 0x0b, 0x0a, 0xfa, 0x0d, 0x25, - 0x84, 0x32, 0xdb, 0x22, 0x02, 0x78, 0x0b, 0x34, 0x94, 0x51, 0x56, 0xc2, 0x0c, 0x62, 0xa9, 0x49, - 0x19, 0xe6, 0xa3, 0xde, 0x35, 0x74, 0xa5, 0x01, 0x34, 0x95, 0x48, 0xa1, 0x98, 0x77, 0xaf, 0x6c, - 0xfc, 0x36, 0x57, 0x33, 0x26, 0x32, 0x72, 0xf8, 0x3a, 0xba, 0xda, 0x24, 0x5e, 0x7e, 0xfa, 0x1b, - 0xe8, 0xa5, 0xa1, 0xf5, 0x1d, 0xa6, 0xc7, 0x9e, 0x3c, 0x72, 0xce, 0x5d, 0x74, 0x69, 0x9a, 0xa7, - 0x3d, 0xa3, 0x52, 0x6b, 0x67, 0x4c, 0xad, 0xbd, 0x9b, 0xe8, 0x5a, 0x25, 0x5c, 0x87, 0x77, 0x05, - 0x8b, 0x26, 0x16, 0x22, 0xe5, 0x32, 0xe5, 0x7a, 0xdf, 0xde, 0x29, 0xef, 0x13, 0xb4, 0xde, 0x2c, - 0x40, 0x8e, 0xea, 0xff, 0xe8, 0xa4, 0x62, 0x29, 0xa7, 0x31, 0xff, 0x02, 0x58, 0x57, 0x01, 0xd8, - 0x32, 0x9d, 0x07, 0x7f, 0xc3, 0x44, 0xc3, 0x8f, 0x96, 0xf7, 0x83, 0x53, 0x2e, 0x55, 0x67, 0x42, - 0xa9, 0xfe, 0x23, 0xdb, 0xe0, 0xb6, 0x08, 0xb6, 0x17, 0x0c, 0x5c, 0x2d, 0xe1, 0x2a, 0x1c, 0x9c, - 0xab, 0x6f, 0xf9, 0x5a, 0xb9, 0x15, 0x9d, 0x09, 0xad, 0xf0, 0x6e, 0xa0, 0x0b, 0x43, 0xcb, 0x8f, - 0x20, 0xf7, 0x88, 0x6a, 0xf6, 0x50, 0x3e, 0x61, 0x62, 0x80, 0x1e, 0x60, 0xf4, 0x45, 0x2c, 0xc3, - 0x27, 0x81, 0xce, 0xd6, 0x6d, 0x06, 0x9e, 0x87, 0xc8, 0x78, 0xc7, 0x3c, 0x78, 0x17, 0x79, 0xa3, - 0x36, 0xf7, 0xf3, 0x74, 0xa6, 0x50, 0xd8, 0xa6, 0x68, 0x8a, 0xb3, 0x80, 0xcf, 0xa3, 0xd3, 0x8a, - 0x89, 0x28, 0xc8, 0x71, 0x48, 0x11, 0xa8, 0x7e, 0x18, 0x82, 0x89, 0xa9, 0xc9, 0xbc, 0xf7, 0x1a, - 0x5a, 0x9d, 0x78, 0x50, 0xde, 0x61, 0x18, 0xba, 0xe5, 0x14, 0x5e, 0x46, 0x2f, 0x0c, 0xbd, 0xb6, - 0x20, 0xf0, 0xa6, 0x19, 0xd8, 0x15, 0x86, 0xe7, 0x30, 0xac, 0xc3, 0x05, 0x74, 0x6e, 0x8c, 0x43, - 0x9e, 0xf0, 0xe5, 0x32, 0x23, 0xf2, 0x30, 0x0f, 0xf2, 0x61, 0xb5, 0x09, 0xf3, 0xa1, 0x58, 0xab, - 0x36, 0xa8, 0xde, 0x30, 0x0f, 0xd9, 0xa9, 0x99, 0x06, 0x8f, 0xb8, 0xde, 0xad, 0x0b, 0x8b, 0xff, - 0x87, 0x96, 0x06, 0xb3, 0xd1, 0xcc, 0x23, 0xa7, 0x7e, 0x1e, 0xd5, 0x8d, 0x84, 0x9a, 0xa0, 0x39, - 0x84, 0xaf, 0x1d, 0x74, 0x7d, 0x68, 0x7e, 0x90, 0x4b, 0x9b, 0xbb, 0x54, 0x74, 0x59, 0x70, 0x4f, - 0x6a, 0xd0, 0xbf, 0x90, 0x66, 0xfa, 0x32, 0xeb, 0x55, 0xaa, 0x50, 0x60, 0x1c, 0xcb, 0xbd, 0xad, - 0x72, 0x71, 0x8b, 0x1f, 0x1f, 0x5a, 0x46, 0x54, 0x4e, 0x1f, 0x25, 0x54, 0x25, 0x9a, 0xa1, 0x14, - 0xcc, 0xb9, 0xd5, 0xd1, 0x68, 0x5b, 0x23, 0xb1, 0x2a, 0x9e, 0x26, 0xd8, 0xc6, 0xdf, 0xcb, 0x68, - 0xbe, 0x70, 0xc0, 0x7f, 0x39, 0xe8, 0x74, 0xfd, 0x40, 0xc7, 0x57, 0xfc, 0xa6, 0x72, 0xd4, 0xbe, - 0xea, 0x37, 0x97, 0x87, 0xe0, 0xab, 0x67, 0xee, 0x63, 0x6b, 0x44, 0x8a, 0xd7, 0x09, 0x29, 0x4a, - 0x4c, 0x76, 0x64, 0x4a, 0xf4, 0x2e, 0x23, 0xb1, 0xec, 0x76, 0x59, 0x44, 0xb8, 0x20, 0x34, 0x0c, - 0x65, 0x5f, 0xe8, 0x75, 0x22, 0x8d, 0xf6, 0xc3, 0x1b, 0x63, 0xbf, 0x30, 0x37, 0x96, 0x61, 0x3f, - 0xcd, 0x82, 0x0c, 0x42, 0xe0, 0x5f, 0x1d, 0x74, 0x66, 0x8c, 0x4c, 0xe0, 0x32, 0xd0, 0x29, 0xd2, - 0xd4, 0xbe, 0xe6, 0xcf, 0x20, 0x3b, 0x37, 0x20, 0xab, 0x57, 0x73, 0xab, 0x59, 0xd2, 0xc2, 0x3f, - 0x3b, 0xe8, 0x64, 0x8d, 0xd8, 0xe0, 0x4b, 0x7e, 0x23, 0x19, 0x6b, 0x5f, 0xf6, 0x9b, 0x89, 0x96, - 0x77, 0x13, 0x10, 0xbe, 0x09, 0x16, 0x95, 0xa2, 0xcd, 0x82, 0xf4, 0x1f, 0x07, 0x9d, 0x1d, 0x2b, - 0x43, 0x78, 0xdd, 0x9f, 0x41, 0xed, 0xda, 0xd7, 0xfd, 0x59, 0xa4, 0xcd, 0x13, 0x80, 0xfd, 0xd3, - 0xe7, 0xc0, 0x6e, 0x7e, 0x66, 0xdb, 0x3d, 0xd8, 0xa7, 0x9a, 0x84, 0x54, 0x90, 0xed, 0x7d, 0x02, - 0xa3, 0xc2, 0xbc, 0x79, 0xb3, 0xdf, 0x99, 0x1f, 0xcc, 0x1e, 0xc6, 0x61, 0xd1, 0x34, 0xa5, 0x33, - 0xa5, 0x29, 0x9d, 0x86, 0x4d, 0xe9, 0x4c, 0x6d, 0x4a, 0xe7, 0x39, 0x9a, 0x02, 0x48, 0x97, 0x2a, - 0xea, 0x85, 0x89, 0x3f, 0x45, 0x10, 0xdb, 0x2f, 0xfa, 0x53, 0x95, 0xef, 0x03, 0xc0, 0x75, 0x77, - 0x73, 0x97, 0x85, 0x4f, 0x08, 0xdf, 0x31, 0x47, 0x77, 0xa1, 0x30, 0x62, 0x08, 0xcd, 0x2a, 0x19, - 0x31, 0x72, 0x44, 0xb8, 0x22, 0xa1, 0x04, 0xec, 0xa1, 0x9e, 0x80, 0xf4, 0x77, 0x07, 0xad, 0x1c, - 0x94, 0x36, 0xbc, 0xea, 0x4f, 0x17, 0xd8, 0xf6, 0x45, 0xbf, 0x81, 0x38, 0x7a, 0x1f, 0x03, 0xe4, - 0x87, 0xc5, 0xb6, 0xc1, 0x90, 0xc4, 0x94, 0x0b, 0xcd, 0x3e, 0xcf, 0x2a, 0x6a, 0xad, 0x27, 0x30, - 0x84, 0x8a, 0x08, 0xfa, 0x0f, 0x33, 0x1d, 0x96, 0x44, 0x25, 0x3d, 0xfc, 0x9d, 0x83, 0xd0, 0x50, - 0x2d, 0xf1, 0x39, 0x7f, 0x92, 0xea, 0xb6, 0xcf, 0xfb, 0x93, 0x35, 0xf6, 0x36, 0xe0, 0x7c, 0xcb, - 0xcc, 0xe8, 0x7d, 0xa8, 0x9a, 0x10, 0x50, 0x35, 0x40, 0x62, 0xbf, 0xb5, 0x94, 0xa5, 0x27, 0x25, - 0xe6, 0x74, 0xf8, 0xc4, 0x20, 0x32, 0x34, 0xac, 0xb0, 0x50, 0xc9, 0x76, 0x2a, 0xf7, 0x40, 0x98, - 0xf0, 0x9f, 0xc0, 0xcf, 0x1a, 0xd5, 0xad, 0xf0, 0x73, 0x82, 0x7c, 0x57, 0xf8, 0x39, 0x51, 0xbd, - 0x1f, 0x03, 0xd8, 0x47, 0xb9, 0x05, 0x9c, 0x5f, 0x88, 0x33, 0xc9, 0xc4, 0x99, 0x6c, 0x33, 0x60, - 0x28, 0x94, 0x4e, 0xcb, 0xe2, 0xf6, 0xd8, 0x4d, 0xf3, 0x55, 0x43, 0x68, 0x14, 0xc1, 0x47, 0xcf, - 0x90, 0xbb, 0x2a, 0x61, 0xa1, 0xbd, 0x6d, 0x05, 0x23, 0x7e, 0x19, 0x0e, 0xea, 0x83, 0xe2, 0x5d, - 0x37, 0xa8, 0xc7, 0xbd, 0x1a, 0xea, 0x06, 0xf5, 0xf8, 0xc7, 0xc0, 0xeb, 0x90, 0xd1, 0xc6, 0x2d, - 0xad, 0x59, 0x2f, 0xa9, 0x64, 0x94, 0x77, 0x5c, 0x8a, 0x7a, 0xb0, 0xed, 0x73, 0xe0, 0x77, 0xf6, - 0xfe, 0xc8, 0xcd, 0x84, 0x6e, 0x3c, 0xe5, 0x21, 0xdb, 0xf8, 0x66, 0x0e, 0x2d, 0x17, 0xbb, 0x39, - 0x4f, 0x7e, 0x72, 0xd0, 0x29, 0xdb, 0xe7, 0xea, 0x53, 0x03, 0xfb, 0xfe, 0x4c, 0xaf, 0x91, 0xf6, - 0xa2, 0x7f, 0x4f, 0x0e, 0xf0, 0xdf, 0x01, 0x1c, 0x9b, 0xe5, 0x6d, 0xb2, 0x93, 0xca, 0x9e, 0xc1, - 0xc1, 0xd2, 0xac, 0x15, 0x96, 0x49, 0x44, 0xee, 0x40, 0x76, 0xa1, 0x89, 0x96, 0x71, 0x67, 0x64, - 0xa6, 0xe0, 0xef, 0x1d, 0xd4, 0xb2, 0xf0, 0xec, 0x1b, 0xa4, 0x42, 0x9e, 0x09, 0xcf, 0x93, 0x2a, - 0x9c, 0xf7, 0x01, 0xce, 0x7b, 0x0d, 0xe0, 0x58, 0x5e, 0x0f, 0x2e, 0xd6, 0x78, 0x6a, 0x7f, 0x0b, - 0x97, 0xcd, 0xc2, 0xca, 0x2e, 0x0f, 0xbe, 0xe8, 0x37, 0x78, 0xe5, 0x54, 0x21, 0x6d, 0x01, 0xa4, - 0x77, 0x1b, 0x43, 0x9a, 0x72, 0xd5, 0xda, 0x3e, 0x44, 0xbb, 0x34, 0xda, 0xf7, 0x3c, 0x86, 0x28, - 0x1d, 0xa3, 0xfe, 0x78, 0xe6, 0x1e, 0xba, 0x7d, 0xf8, 0x4b, 0xc7, 0xf9, 0x37, 0x00, 0x00, 0xff, - 0xff, 0xc4, 0x79, 0x5c, 0x8e, 0x85, 0x11, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/partnerapps.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/partnerapps.pb.go deleted file mode 100644 index bc91c39b..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/partnerapps.pb.go +++ /dev/null @@ -1,456 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_partnerapps.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type CPartnerApps_RequestUploadToken_Request struct { - Filename *string `protobuf:"bytes,1,opt,name=filename" json:"filename,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_RequestUploadToken_Request) Reset() { - *m = CPartnerApps_RequestUploadToken_Request{} -} -func (m *CPartnerApps_RequestUploadToken_Request) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_RequestUploadToken_Request) ProtoMessage() {} -func (*CPartnerApps_RequestUploadToken_Request) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{0} -} - -func (m *CPartnerApps_RequestUploadToken_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CPartnerApps_RequestUploadToken_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -type CPartnerApps_RequestUploadToken_Response struct { - UploadToken *uint64 `protobuf:"varint,1,opt,name=upload_token" json:"upload_token,omitempty"` - Location *string `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` - RoutingId *uint64 `protobuf:"varint,3,opt,name=routing_id" json:"routing_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_RequestUploadToken_Response) Reset() { - *m = CPartnerApps_RequestUploadToken_Response{} -} -func (m *CPartnerApps_RequestUploadToken_Response) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_RequestUploadToken_Response) ProtoMessage() {} -func (*CPartnerApps_RequestUploadToken_Response) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{1} -} - -func (m *CPartnerApps_RequestUploadToken_Response) GetUploadToken() uint64 { - if m != nil && m.UploadToken != nil { - return *m.UploadToken - } - return 0 -} - -func (m *CPartnerApps_RequestUploadToken_Response) GetLocation() string { - if m != nil && m.Location != nil { - return *m.Location - } - return "" -} - -func (m *CPartnerApps_RequestUploadToken_Response) GetRoutingId() uint64 { - if m != nil && m.RoutingId != nil { - return *m.RoutingId - } - return 0 -} - -type CPartnerApps_FinishUpload_Request struct { - UploadToken *uint64 `protobuf:"varint,1,opt,name=upload_token" json:"upload_token,omitempty"` - RoutingId *uint64 `protobuf:"varint,2,opt,name=routing_id" json:"routing_id,omitempty"` - AppId *uint32 `protobuf:"varint,3,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FinishUpload_Request) Reset() { *m = CPartnerApps_FinishUpload_Request{} } -func (m *CPartnerApps_FinishUpload_Request) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_FinishUpload_Request) ProtoMessage() {} -func (*CPartnerApps_FinishUpload_Request) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{2} -} - -func (m *CPartnerApps_FinishUpload_Request) GetUploadToken() uint64 { - if m != nil && m.UploadToken != nil { - return *m.UploadToken - } - return 0 -} - -func (m *CPartnerApps_FinishUpload_Request) GetRoutingId() uint64 { - if m != nil && m.RoutingId != nil { - return *m.RoutingId - } - return 0 -} - -func (m *CPartnerApps_FinishUpload_Request) GetAppId() uint32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -type CPartnerApps_FinishUploadKVSign_Response struct { - SignedInstallscript *string `protobuf:"bytes,1,opt,name=signed_installscript" json:"signed_installscript,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FinishUploadKVSign_Response) Reset() { - *m = CPartnerApps_FinishUploadKVSign_Response{} -} -func (m *CPartnerApps_FinishUploadKVSign_Response) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_FinishUploadKVSign_Response) ProtoMessage() {} -func (*CPartnerApps_FinishUploadKVSign_Response) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{3} -} - -func (m *CPartnerApps_FinishUploadKVSign_Response) GetSignedInstallscript() string { - if m != nil && m.SignedInstallscript != nil { - return *m.SignedInstallscript - } - return "" -} - -type CPartnerApps_FinishUploadLegacyDRM_Request struct { - UploadToken *uint64 `protobuf:"varint,1,opt,name=upload_token" json:"upload_token,omitempty"` - RoutingId *uint64 `protobuf:"varint,2,opt,name=routing_id" json:"routing_id,omitempty"` - AppId *uint32 `protobuf:"varint,3,opt,name=app_id" json:"app_id,omitempty"` - Flags *uint32 `protobuf:"varint,4,opt,name=flags" json:"flags,omitempty"` - ToolName *string `protobuf:"bytes,5,opt,name=tool_name" json:"tool_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) Reset() { - *m = CPartnerApps_FinishUploadLegacyDRM_Request{} -} -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) String() string { - return proto.CompactTextString(m) -} -func (*CPartnerApps_FinishUploadLegacyDRM_Request) ProtoMessage() {} -func (*CPartnerApps_FinishUploadLegacyDRM_Request) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{4} -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) GetUploadToken() uint64 { - if m != nil && m.UploadToken != nil { - return *m.UploadToken - } - return 0 -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) GetRoutingId() uint64 { - if m != nil && m.RoutingId != nil { - return *m.RoutingId - } - return 0 -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) GetAppId() uint32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Request) GetToolName() string { - if m != nil && m.ToolName != nil { - return *m.ToolName - } - return "" -} - -type CPartnerApps_FinishUploadLegacyDRM_Response struct { - FileId *string `protobuf:"bytes,1,opt,name=file_id" json:"file_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Response) Reset() { - *m = CPartnerApps_FinishUploadLegacyDRM_Response{} -} -func (m *CPartnerApps_FinishUploadLegacyDRM_Response) String() string { - return proto.CompactTextString(m) -} -func (*CPartnerApps_FinishUploadLegacyDRM_Response) ProtoMessage() {} -func (*CPartnerApps_FinishUploadLegacyDRM_Response) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{5} -} - -func (m *CPartnerApps_FinishUploadLegacyDRM_Response) GetFileId() string { - if m != nil && m.FileId != nil { - return *m.FileId - } - return "" -} - -type CPartnerApps_FinishUpload_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FinishUpload_Response) Reset() { *m = CPartnerApps_FinishUpload_Response{} } -func (m *CPartnerApps_FinishUpload_Response) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_FinishUpload_Response) ProtoMessage() {} -func (*CPartnerApps_FinishUpload_Response) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{6} -} - -type CPartnerApps_FindDRMUploads_Request struct { - AppId *int32 `protobuf:"varint,1,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FindDRMUploads_Request) Reset() { *m = CPartnerApps_FindDRMUploads_Request{} } -func (m *CPartnerApps_FindDRMUploads_Request) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_FindDRMUploads_Request) ProtoMessage() {} -func (*CPartnerApps_FindDRMUploads_Request) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{7} -} - -func (m *CPartnerApps_FindDRMUploads_Request) GetAppId() int32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -type CPartnerApps_ExistingDRMUpload struct { - FileId *string `protobuf:"bytes,1,opt,name=file_id" json:"file_id,omitempty"` - AppId *uint32 `protobuf:"varint,2,opt,name=app_id" json:"app_id,omitempty"` - ActorId *int32 `protobuf:"varint,3,opt,name=actor_id" json:"actor_id,omitempty"` - SuppliedName *string `protobuf:"bytes,5,opt,name=supplied_name" json:"supplied_name,omitempty"` - Flags *uint32 `protobuf:"varint,6,opt,name=flags" json:"flags,omitempty"` - ModType *string `protobuf:"bytes,7,opt,name=mod_type" json:"mod_type,omitempty"` - Timestamp *uint32 `protobuf:"fixed32,8,opt,name=timestamp" json:"timestamp,omitempty"` - OrigFileId *string `protobuf:"bytes,9,opt,name=orig_file_id" json:"orig_file_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_ExistingDRMUpload) Reset() { *m = CPartnerApps_ExistingDRMUpload{} } -func (m *CPartnerApps_ExistingDRMUpload) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_ExistingDRMUpload) ProtoMessage() {} -func (*CPartnerApps_ExistingDRMUpload) Descriptor() ([]byte, []int) { return partnerapps_fileDescriptor0, []int{8} } - -func (m *CPartnerApps_ExistingDRMUpload) GetFileId() string { - if m != nil && m.FileId != nil { - return *m.FileId - } - return "" -} - -func (m *CPartnerApps_ExistingDRMUpload) GetAppId() uint32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -func (m *CPartnerApps_ExistingDRMUpload) GetActorId() int32 { - if m != nil && m.ActorId != nil { - return *m.ActorId - } - return 0 -} - -func (m *CPartnerApps_ExistingDRMUpload) GetSuppliedName() string { - if m != nil && m.SuppliedName != nil { - return *m.SuppliedName - } - return "" -} - -func (m *CPartnerApps_ExistingDRMUpload) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *CPartnerApps_ExistingDRMUpload) GetModType() string { - if m != nil && m.ModType != nil { - return *m.ModType - } - return "" -} - -func (m *CPartnerApps_ExistingDRMUpload) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CPartnerApps_ExistingDRMUpload) GetOrigFileId() string { - if m != nil && m.OrigFileId != nil { - return *m.OrigFileId - } - return "" -} - -type CPartnerApps_FindDRMUploads_Response struct { - Uploads []*CPartnerApps_ExistingDRMUpload `protobuf:"bytes,1,rep,name=uploads" json:"uploads,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_FindDRMUploads_Response) Reset() { *m = CPartnerApps_FindDRMUploads_Response{} } -func (m *CPartnerApps_FindDRMUploads_Response) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_FindDRMUploads_Response) ProtoMessage() {} -func (*CPartnerApps_FindDRMUploads_Response) Descriptor() ([]byte, []int) { - return partnerapps_fileDescriptor0, []int{9} -} - -func (m *CPartnerApps_FindDRMUploads_Response) GetUploads() []*CPartnerApps_ExistingDRMUpload { - if m != nil { - return m.Uploads - } - return nil -} - -type CPartnerApps_Download_Request struct { - FileId *string `protobuf:"bytes,1,opt,name=file_id" json:"file_id,omitempty"` - AppId *int32 `protobuf:"varint,2,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_Download_Request) Reset() { *m = CPartnerApps_Download_Request{} } -func (m *CPartnerApps_Download_Request) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_Download_Request) ProtoMessage() {} -func (*CPartnerApps_Download_Request) Descriptor() ([]byte, []int) { return partnerapps_fileDescriptor0, []int{10} } - -func (m *CPartnerApps_Download_Request) GetFileId() string { - if m != nil && m.FileId != nil { - return *m.FileId - } - return "" -} - -func (m *CPartnerApps_Download_Request) GetAppId() int32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -type CPartnerApps_Download_Response struct { - DownloadUrl *string `protobuf:"bytes,1,opt,name=download_url" json:"download_url,omitempty"` - AppId *int32 `protobuf:"varint,2,opt,name=app_id" json:"app_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPartnerApps_Download_Response) Reset() { *m = CPartnerApps_Download_Response{} } -func (m *CPartnerApps_Download_Response) String() string { return proto.CompactTextString(m) } -func (*CPartnerApps_Download_Response) ProtoMessage() {} -func (*CPartnerApps_Download_Response) Descriptor() ([]byte, []int) { return partnerapps_fileDescriptor0, []int{11} } - -func (m *CPartnerApps_Download_Response) GetDownloadUrl() string { - if m != nil && m.DownloadUrl != nil { - return *m.DownloadUrl - } - return "" -} - -func (m *CPartnerApps_Download_Response) GetAppId() int32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -func init() { - proto.RegisterType((*CPartnerApps_RequestUploadToken_Request)(nil), "CPartnerApps_RequestUploadToken_Request") - proto.RegisterType((*CPartnerApps_RequestUploadToken_Response)(nil), "CPartnerApps_RequestUploadToken_Response") - proto.RegisterType((*CPartnerApps_FinishUpload_Request)(nil), "CPartnerApps_FinishUpload_Request") - proto.RegisterType((*CPartnerApps_FinishUploadKVSign_Response)(nil), "CPartnerApps_FinishUploadKVSign_Response") - proto.RegisterType((*CPartnerApps_FinishUploadLegacyDRM_Request)(nil), "CPartnerApps_FinishUploadLegacyDRM_Request") - proto.RegisterType((*CPartnerApps_FinishUploadLegacyDRM_Response)(nil), "CPartnerApps_FinishUploadLegacyDRM_Response") - proto.RegisterType((*CPartnerApps_FinishUpload_Response)(nil), "CPartnerApps_FinishUpload_Response") - proto.RegisterType((*CPartnerApps_FindDRMUploads_Request)(nil), "CPartnerApps_FindDRMUploads_Request") - proto.RegisterType((*CPartnerApps_ExistingDRMUpload)(nil), "CPartnerApps_ExistingDRMUpload") - proto.RegisterType((*CPartnerApps_FindDRMUploads_Response)(nil), "CPartnerApps_FindDRMUploads_Response") - proto.RegisterType((*CPartnerApps_Download_Request)(nil), "CPartnerApps_Download_Request") - proto.RegisterType((*CPartnerApps_Download_Response)(nil), "CPartnerApps_Download_Response") -} - -var partnerapps_fileDescriptor0 = []byte{ - // 809 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xc4, 0x96, 0x4f, 0x6f, 0xd3, 0x4a, - 0x14, 0xc5, 0xe5, 0xb6, 0x69, 0x9a, 0xe9, 0x4b, 0xdf, 0x7b, 0x56, 0x2b, 0x45, 0x11, 0xb4, 0xc6, - 0x2d, 0x22, 0xb4, 0xd5, 0x50, 0x15, 0x21, 0x36, 0x08, 0x95, 0xa6, 0x7f, 0x10, 0x05, 0x84, 0x5a, - 0x40, 0x6c, 0x50, 0x34, 0x75, 0x26, 0xe9, 0x08, 0xdb, 0x63, 0x3c, 0x63, 0x68, 0x77, 0x88, 0x15, - 0x1b, 0x3e, 0x00, 0x7b, 0x76, 0x20, 0x24, 0x24, 0xfa, 0xfd, 0xb8, 0x33, 0xb6, 0x13, 0x3b, 0x69, - 0x53, 0x23, 0x84, 0x58, 0x66, 0x7c, 0x7d, 0xee, 0x6f, 0xce, 0xdc, 0x39, 0x31, 0x5a, 0x11, 0x92, - 0x12, 0xcf, 0xa3, 0x42, 0x90, 0x2e, 0x15, 0xad, 0x80, 0x84, 0xd2, 0xa7, 0x21, 0x09, 0x02, 0x81, - 0xf5, 0x13, 0xc7, 0x65, 0xd4, 0x97, 0x38, 0x08, 0xb9, 0xe4, 0xf5, 0xd5, 0x7c, 0x71, 0xe4, 0xb3, - 0x0e, 0xa3, 0xed, 0xd6, 0x21, 0x11, 0x74, 0xb8, 0xda, 0x7e, 0x80, 0xae, 0x35, 0x9f, 0xc4, 0x7a, - 0xf7, 0x40, 0xaf, 0xb5, 0x4f, 0x5f, 0x47, 0x54, 0xc8, 0x67, 0x81, 0xcb, 0x49, 0xfb, 0x29, 0x7f, - 0x45, 0xfd, 0x74, 0xc9, 0xfc, 0x0f, 0x4d, 0x75, 0x98, 0x4b, 0x7d, 0xe2, 0xd1, 0x9a, 0x61, 0x19, - 0x8d, 0x8a, 0x59, 0x45, 0x25, 0x80, 0x60, 0xed, 0xda, 0x18, 0xfc, 0xac, 0xda, 0x1d, 0xd4, 0xb8, - 0x58, 0x4b, 0x04, 0xdc, 0x17, 0xd4, 0x9c, 0x45, 0xff, 0x44, 0x7a, 0xbd, 0x25, 0xd5, 0x03, 0x2d, - 0x38, 0xa1, 0x5a, 0xb8, 0xdc, 0x21, 0x92, 0x71, 0x5f, 0x6b, 0x56, 0x4c, 0x13, 0xa1, 0x90, 0x47, - 0x92, 0xf9, 0xdd, 0x16, 0xf4, 0x19, 0x57, 0x55, 0xf6, 0x4b, 0x74, 0x25, 0xd7, 0x67, 0x87, 0xf9, - 0x4c, 0x1c, 0xc5, 0x6d, 0x7a, 0xb4, 0x67, 0x37, 0xc8, 0xcb, 0x8d, 0xe9, 0xb5, 0x19, 0x34, 0x09, - 0xbb, 0x48, 0xe5, 0xab, 0xf6, 0xfd, 0x81, 0x6d, 0x64, 0xe5, 0xf7, 0x9e, 0x1f, 0xb0, 0x6e, 0x66, - 0x1b, 0x97, 0xd0, 0xac, 0x80, 0x05, 0xf0, 0x97, 0xf9, 0x42, 0x12, 0xd7, 0x15, 0x4e, 0xc8, 0x02, - 0x19, 0xfb, 0x63, 0x7f, 0x30, 0xd0, 0xf2, 0xb9, 0x52, 0x0f, 0x69, 0x97, 0x38, 0x27, 0x5b, 0xfb, - 0x8f, 0x7e, 0x1f, 0x59, 0x1d, 0x44, 0xc7, 0x25, 0x5d, 0x51, 0x9b, 0xd0, 0x3f, 0xff, 0x47, 0x15, - 0xc9, 0xb9, 0xdb, 0xd2, 0x47, 0x55, 0xd2, 0x28, 0x77, 0xd1, 0x4a, 0x21, 0x92, 0x64, 0x5f, 0xff, - 0xa2, 0xb2, 0x3a, 0x6b, 0xd5, 0x21, 0xde, 0xca, 0x12, 0xb2, 0x47, 0x79, 0x1e, 0xbf, 0x66, 0xdf, - 0x42, 0x8b, 0x83, 0x55, 0x6d, 0xd0, 0x8d, 0xcb, 0x7a, 0x03, 0x91, 0xc1, 0x57, 0xe2, 0x25, 0xfb, - 0x87, 0x81, 0xe6, 0x73, 0xef, 0x6d, 0x1f, 0x33, 0xa1, 0x76, 0xdc, 0x7b, 0x77, 0x08, 0x28, 0xa3, - 0xa1, 0x87, 0x4f, 0x8d, 0x0e, 0x71, 0x24, 0x0f, 0x53, 0x53, 0x4a, 0xe6, 0x1c, 0xaa, 0x8a, 0x28, - 0x08, 0x5c, 0x35, 0xfd, 0x7d, 0x27, 0xfa, 0x5e, 0x4d, 0xa6, 0xef, 0x79, 0x1c, 0x1c, 0x3f, 0x09, - 0x68, 0xad, 0xac, 0x0b, 0x94, 0x7b, 0x0c, 0xee, 0x8f, 0x24, 0x5e, 0x50, 0x9b, 0x82, 0xa5, 0xb2, - 0x3a, 0x19, 0x1e, 0xb2, 0x6e, 0x2b, 0x45, 0xa8, 0x68, 0x4f, 0x5e, 0xa0, 0xa5, 0xd1, 0xbb, 0x4d, - 0xcc, 0x5c, 0x43, 0xe5, 0xf8, 0x5c, 0x05, 0xb0, 0x8f, 0x37, 0xa6, 0xd7, 0x17, 0xf0, 0xe8, 0xdd, - 0xda, 0x1b, 0xe8, 0x72, 0xae, 0x62, 0x8b, 0xbf, 0xf5, 0x73, 0xd3, 0x7d, 0x81, 0x1d, 0x25, 0x7b, - 0x67, 0xc0, 0xd1, 0x8c, 0x42, 0xff, 0x06, 0xb6, 0xd3, 0xc5, 0x28, 0x74, 0xcf, 0xd6, 0x59, 0xff, - 0x8a, 0xd0, 0x74, 0x46, 0xc7, 0xfc, 0x6e, 0xa0, 0x5a, 0x02, 0x11, 0xdf, 0x85, 0xcc, 0xed, 0x36, - 0x1b, 0xb8, 0x60, 0x96, 0xd4, 0xaf, 0xe3, 0xa2, 0x49, 0x61, 0x6f, 0xbc, 0x3f, 0xad, 0xdd, 0x49, - 0x0a, 0xac, 0xd8, 0x47, 0x4b, 0xdf, 0x0f, 0xab, 0xc3, 0x43, 0x2b, 0x77, 0xed, 0x2c, 0xe5, 0x49, - 0x5a, 0x73, 0xc3, 0x52, 0x37, 0x13, 0x6c, 0x35, 0xbf, 0x19, 0x68, 0x2e, 0x11, 0xe8, 0x59, 0xfc, - 0xd7, 0x80, 0xe9, 0x31, 0x75, 0x22, 0x49, 0x0e, 0x01, 0x34, 0x4f, 0x0b, 0x79, 0xec, 0x40, 0x68, - 0x2b, 0xe0, 0xd3, 0x3e, 0x70, 0x73, 0x7b, 0xf7, 0x8f, 0x03, 0xef, 0x02, 0x70, 0xf3, 0x5c, 0x60, - 0x27, 0x12, 0x92, 0x7b, 0x85, 0xb8, 0xbf, 0x18, 0xc8, 0x1c, 0x4e, 0x4b, 0xd3, 0xc6, 0x17, 0xc6, - 0xf5, 0x20, 0xee, 0x88, 0xcc, 0xb5, 0x77, 0x00, 0x77, 0xb3, 0xc9, 0x3d, 0x8f, 0x49, 0xcb, 0xa3, - 0xf2, 0x88, 0x2b, 0x5a, 0x7d, 0xd8, 0x16, 0xf1, 0x07, 0x06, 0x82, 0x74, 0x24, 0x0d, 0xd5, 0x72, - 0x82, 0xcb, 0x84, 0xe5, 0x70, 0x2f, 0x70, 0xa9, 0xa4, 0xe6, 0x67, 0x70, 0x39, 0xdb, 0xa7, 0x1f, - 0x36, 0x2b, 0xb8, 0x78, 0x6a, 0xd7, 0x57, 0xf1, 0x2f, 0x04, 0xab, 0xbd, 0x06, 0xf0, 0xab, 0x79, - 0xf8, 0xb3, 0xa6, 0x22, 0x63, 0xea, 0xa7, 0x01, 0xcc, 0xde, 0x44, 0x14, 0xf2, 0x75, 0x11, 0x17, - 0x88, 0xed, 0xdb, 0x00, 0x75, 0x73, 0x18, 0xea, 0x9c, 0x93, 0xcf, 0xb0, 0x7d, 0x34, 0xd0, 0x4c, - 0x3e, 0xf5, 0xcc, 0x25, 0x5c, 0xe0, 0x1f, 0xa0, 0x7e, 0x15, 0x17, 0x49, 0x4e, 0x1b, 0x03, 0xd8, - 0xb2, 0x7a, 0x28, 0xac, 0xc7, 0x96, 0xc7, 0x61, 0x3c, 0x43, 0xea, 0xc0, 0xc7, 0x0b, 0x30, 0x30, - 0x00, 0x4c, 0x52, 0xd5, 0x3a, 0x3c, 0xb1, 0xf4, 0x77, 0x88, 0xb9, 0x87, 0xa6, 0xd2, 0xa0, 0x33, - 0xe7, 0xf1, 0xc8, 0x08, 0xad, 0x2f, 0xe0, 0xd1, 0x01, 0x59, 0x5f, 0x87, 0xe6, 0xf8, 0x80, 0x86, - 0x6f, 0x98, 0x43, 0x13, 0x5b, 0x84, 0xf6, 0x05, 0x7a, 0x59, 0x1e, 0xf1, 0xe1, 0xf3, 0xca, 0x53, - 0x2c, 0xd0, 0x3d, 0xf9, 0x22, 0x13, 0x9b, 0xe3, 0xef, 0x0c, 0xe3, 0x67, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xec, 0x20, 0xc0, 0x4b, 0xaf, 0x09, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/player.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/player.pb.go deleted file mode 100644 index 996005f8..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/player.pb.go +++ /dev/null @@ -1,586 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_player.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type CPlayer_GetGameBadgeLevels_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_GetGameBadgeLevels_Request) Reset() { *m = CPlayer_GetGameBadgeLevels_Request{} } -func (m *CPlayer_GetGameBadgeLevels_Request) String() string { return proto.CompactTextString(m) } -func (*CPlayer_GetGameBadgeLevels_Request) ProtoMessage() {} -func (*CPlayer_GetGameBadgeLevels_Request) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{0} -} - -func (m *CPlayer_GetGameBadgeLevels_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -type CPlayer_GetGameBadgeLevels_Response struct { - PlayerLevel *uint32 `protobuf:"varint,1,opt,name=player_level" json:"player_level,omitempty"` - Badges []*CPlayer_GetGameBadgeLevels_Response_Badge `protobuf:"bytes,2,rep,name=badges" json:"badges,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_GetGameBadgeLevels_Response) Reset() { *m = CPlayer_GetGameBadgeLevels_Response{} } -func (m *CPlayer_GetGameBadgeLevels_Response) String() string { return proto.CompactTextString(m) } -func (*CPlayer_GetGameBadgeLevels_Response) ProtoMessage() {} -func (*CPlayer_GetGameBadgeLevels_Response) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{1} -} - -func (m *CPlayer_GetGameBadgeLevels_Response) GetPlayerLevel() uint32 { - if m != nil && m.PlayerLevel != nil { - return *m.PlayerLevel - } - return 0 -} - -func (m *CPlayer_GetGameBadgeLevels_Response) GetBadges() []*CPlayer_GetGameBadgeLevels_Response_Badge { - if m != nil { - return m.Badges - } - return nil -} - -type CPlayer_GetGameBadgeLevels_Response_Badge struct { - Level *int32 `protobuf:"varint,1,opt,name=level" json:"level,omitempty"` - Series *int32 `protobuf:"varint,2,opt,name=series" json:"series,omitempty"` - BorderColor *uint32 `protobuf:"varint,3,opt,name=border_color" json:"border_color,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_GetGameBadgeLevels_Response_Badge) Reset() { - *m = CPlayer_GetGameBadgeLevels_Response_Badge{} -} -func (m *CPlayer_GetGameBadgeLevels_Response_Badge) String() string { return proto.CompactTextString(m) } -func (*CPlayer_GetGameBadgeLevels_Response_Badge) ProtoMessage() {} -func (*CPlayer_GetGameBadgeLevels_Response_Badge) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{1, 0} -} - -func (m *CPlayer_GetGameBadgeLevels_Response_Badge) GetLevel() int32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CPlayer_GetGameBadgeLevels_Response_Badge) GetSeries() int32 { - if m != nil && m.Series != nil { - return *m.Series - } - return 0 -} - -func (m *CPlayer_GetGameBadgeLevels_Response_Badge) GetBorderColor() uint32 { - if m != nil && m.BorderColor != nil { - return *m.BorderColor - } - return 0 -} - -type CPlayer_GetLastPlayedTimes_Request struct { - MinLastPlayed *uint32 `protobuf:"varint,1,opt,name=min_last_played" json:"min_last_played,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_GetLastPlayedTimes_Request) Reset() { *m = CPlayer_GetLastPlayedTimes_Request{} } -func (m *CPlayer_GetLastPlayedTimes_Request) String() string { return proto.CompactTextString(m) } -func (*CPlayer_GetLastPlayedTimes_Request) ProtoMessage() {} -func (*CPlayer_GetLastPlayedTimes_Request) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{2} -} - -func (m *CPlayer_GetLastPlayedTimes_Request) GetMinLastPlayed() uint32 { - if m != nil && m.MinLastPlayed != nil { - return *m.MinLastPlayed - } - return 0 -} - -type CPlayer_GetLastPlayedTimes_Response struct { - Games []*CPlayer_GetLastPlayedTimes_Response_Game `protobuf:"bytes,1,rep,name=games" json:"games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_GetLastPlayedTimes_Response) Reset() { *m = CPlayer_GetLastPlayedTimes_Response{} } -func (m *CPlayer_GetLastPlayedTimes_Response) String() string { return proto.CompactTextString(m) } -func (*CPlayer_GetLastPlayedTimes_Response) ProtoMessage() {} -func (*CPlayer_GetLastPlayedTimes_Response) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{3} -} - -func (m *CPlayer_GetLastPlayedTimes_Response) GetGames() []*CPlayer_GetLastPlayedTimes_Response_Game { - if m != nil { - return m.Games - } - return nil -} - -type CPlayer_GetLastPlayedTimes_Response_Game struct { - Appid *int32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - LastPlaytime *uint32 `protobuf:"varint,2,opt,name=last_playtime" json:"last_playtime,omitempty"` - Playtime_2Weeks *int32 `protobuf:"varint,3,opt,name=playtime_2weeks" json:"playtime_2weeks,omitempty"` - PlaytimeForever *int32 `protobuf:"varint,4,opt,name=playtime_forever" json:"playtime_forever,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_GetLastPlayedTimes_Response_Game) Reset() { - *m = CPlayer_GetLastPlayedTimes_Response_Game{} -} -func (m *CPlayer_GetLastPlayedTimes_Response_Game) String() string { return proto.CompactTextString(m) } -func (*CPlayer_GetLastPlayedTimes_Response_Game) ProtoMessage() {} -func (*CPlayer_GetLastPlayedTimes_Response_Game) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{3, 0} -} - -func (m *CPlayer_GetLastPlayedTimes_Response_Game) GetAppid() int32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPlayer_GetLastPlayedTimes_Response_Game) GetLastPlaytime() uint32 { - if m != nil && m.LastPlaytime != nil { - return *m.LastPlaytime - } - return 0 -} - -func (m *CPlayer_GetLastPlayedTimes_Response_Game) GetPlaytime_2Weeks() int32 { - if m != nil && m.Playtime_2Weeks != nil { - return *m.Playtime_2Weeks - } - return 0 -} - -func (m *CPlayer_GetLastPlayedTimes_Response_Game) GetPlaytimeForever() int32 { - if m != nil && m.PlaytimeForever != nil { - return *m.PlaytimeForever - } - return 0 -} - -type CPlayer_AcceptSSA_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_AcceptSSA_Request) Reset() { *m = CPlayer_AcceptSSA_Request{} } -func (m *CPlayer_AcceptSSA_Request) String() string { return proto.CompactTextString(m) } -func (*CPlayer_AcceptSSA_Request) ProtoMessage() {} -func (*CPlayer_AcceptSSA_Request) Descriptor() ([]byte, []int) { return player_fileDescriptor0, []int{4} } - -type CPlayer_AcceptSSA_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_AcceptSSA_Response) Reset() { *m = CPlayer_AcceptSSA_Response{} } -func (m *CPlayer_AcceptSSA_Response) String() string { return proto.CompactTextString(m) } -func (*CPlayer_AcceptSSA_Response) ProtoMessage() {} -func (*CPlayer_AcceptSSA_Response) Descriptor() ([]byte, []int) { return player_fileDescriptor0, []int{5} } - -type CPlayer_LastPlayedTimes_Notification struct { - Games []*CPlayer_GetLastPlayedTimes_Response_Game `protobuf:"bytes,1,rep,name=games" json:"games,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayer_LastPlayedTimes_Notification) Reset() { *m = CPlayer_LastPlayedTimes_Notification{} } -func (m *CPlayer_LastPlayedTimes_Notification) String() string { return proto.CompactTextString(m) } -func (*CPlayer_LastPlayedTimes_Notification) ProtoMessage() {} -func (*CPlayer_LastPlayedTimes_Notification) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{6} -} - -func (m *CPlayer_LastPlayedTimes_Notification) GetGames() []*CPlayer_GetLastPlayedTimes_Response_Game { - if m != nil { - return m.Games - } - return nil -} - -type CPlayerClient_GetSystemInformation_Request struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayerClient_GetSystemInformation_Request) Reset() { - *m = CPlayerClient_GetSystemInformation_Request{} -} -func (m *CPlayerClient_GetSystemInformation_Request) String() string { - return proto.CompactTextString(m) -} -func (*CPlayerClient_GetSystemInformation_Request) ProtoMessage() {} -func (*CPlayerClient_GetSystemInformation_Request) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{7} -} - -type CClientSystemInfo struct { - Cpu *CClientSystemInfo_CPU `protobuf:"bytes,1,opt,name=cpu" json:"cpu,omitempty"` - VideoCard *CClientSystemInfo_VideoCard `protobuf:"bytes,2,opt,name=video_card" json:"video_card,omitempty"` - OperatingSystem *string `protobuf:"bytes,3,opt,name=operating_system" json:"operating_system,omitempty"` - Os_64Bit *bool `protobuf:"varint,4,opt,name=os_64bit" json:"os_64bit,omitempty"` - SystemRamMb *int32 `protobuf:"varint,5,opt,name=system_ram_mb" json:"system_ram_mb,omitempty"` - AudioDevice *string `protobuf:"bytes,6,opt,name=audio_device" json:"audio_device,omitempty"` - AudioDriverVersion *string `protobuf:"bytes,7,opt,name=audio_driver_version" json:"audio_driver_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CClientSystemInfo) Reset() { *m = CClientSystemInfo{} } -func (m *CClientSystemInfo) String() string { return proto.CompactTextString(m) } -func (*CClientSystemInfo) ProtoMessage() {} -func (*CClientSystemInfo) Descriptor() ([]byte, []int) { return player_fileDescriptor0, []int{8} } - -func (m *CClientSystemInfo) GetCpu() *CClientSystemInfo_CPU { - if m != nil { - return m.Cpu - } - return nil -} - -func (m *CClientSystemInfo) GetVideoCard() *CClientSystemInfo_VideoCard { - if m != nil { - return m.VideoCard - } - return nil -} - -func (m *CClientSystemInfo) GetOperatingSystem() string { - if m != nil && m.OperatingSystem != nil { - return *m.OperatingSystem - } - return "" -} - -func (m *CClientSystemInfo) GetOs_64Bit() bool { - if m != nil && m.Os_64Bit != nil { - return *m.Os_64Bit - } - return false -} - -func (m *CClientSystemInfo) GetSystemRamMb() int32 { - if m != nil && m.SystemRamMb != nil { - return *m.SystemRamMb - } - return 0 -} - -func (m *CClientSystemInfo) GetAudioDevice() string { - if m != nil && m.AudioDevice != nil { - return *m.AudioDevice - } - return "" -} - -func (m *CClientSystemInfo) GetAudioDriverVersion() string { - if m != nil && m.AudioDriverVersion != nil { - return *m.AudioDriverVersion - } - return "" -} - -type CClientSystemInfo_CPU struct { - SpeedMhz *int32 `protobuf:"varint,1,opt,name=speed_mhz" json:"speed_mhz,omitempty"` - Vendor *string `protobuf:"bytes,2,opt,name=vendor" json:"vendor,omitempty"` - LogicalProcessors *int32 `protobuf:"varint,3,opt,name=logical_processors" json:"logical_processors,omitempty"` - PhysicalProcessors *int32 `protobuf:"varint,4,opt,name=physical_processors" json:"physical_processors,omitempty"` - Hyperthreading *bool `protobuf:"varint,5,opt,name=hyperthreading" json:"hyperthreading,omitempty"` - Fcmov *bool `protobuf:"varint,6,opt,name=fcmov" json:"fcmov,omitempty"` - Sse2 *bool `protobuf:"varint,7,opt,name=sse2" json:"sse2,omitempty"` - Sse3 *bool `protobuf:"varint,8,opt,name=sse3" json:"sse3,omitempty"` - Ssse3 *bool `protobuf:"varint,9,opt,name=ssse3" json:"ssse3,omitempty"` - Sse4A *bool `protobuf:"varint,10,opt,name=sse4a" json:"sse4a,omitempty"` - Sse41 *bool `protobuf:"varint,11,opt,name=sse41" json:"sse41,omitempty"` - Sse42 *bool `protobuf:"varint,12,opt,name=sse42" json:"sse42,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CClientSystemInfo_CPU) Reset() { *m = CClientSystemInfo_CPU{} } -func (m *CClientSystemInfo_CPU) String() string { return proto.CompactTextString(m) } -func (*CClientSystemInfo_CPU) ProtoMessage() {} -func (*CClientSystemInfo_CPU) Descriptor() ([]byte, []int) { return player_fileDescriptor0, []int{8, 0} } - -func (m *CClientSystemInfo_CPU) GetSpeedMhz() int32 { - if m != nil && m.SpeedMhz != nil { - return *m.SpeedMhz - } - return 0 -} - -func (m *CClientSystemInfo_CPU) GetVendor() string { - if m != nil && m.Vendor != nil { - return *m.Vendor - } - return "" -} - -func (m *CClientSystemInfo_CPU) GetLogicalProcessors() int32 { - if m != nil && m.LogicalProcessors != nil { - return *m.LogicalProcessors - } - return 0 -} - -func (m *CClientSystemInfo_CPU) GetPhysicalProcessors() int32 { - if m != nil && m.PhysicalProcessors != nil { - return *m.PhysicalProcessors - } - return 0 -} - -func (m *CClientSystemInfo_CPU) GetHyperthreading() bool { - if m != nil && m.Hyperthreading != nil { - return *m.Hyperthreading - } - return false -} - -func (m *CClientSystemInfo_CPU) GetFcmov() bool { - if m != nil && m.Fcmov != nil { - return *m.Fcmov - } - return false -} - -func (m *CClientSystemInfo_CPU) GetSse2() bool { - if m != nil && m.Sse2 != nil { - return *m.Sse2 - } - return false -} - -func (m *CClientSystemInfo_CPU) GetSse3() bool { - if m != nil && m.Sse3 != nil { - return *m.Sse3 - } - return false -} - -func (m *CClientSystemInfo_CPU) GetSsse3() bool { - if m != nil && m.Ssse3 != nil { - return *m.Ssse3 - } - return false -} - -func (m *CClientSystemInfo_CPU) GetSse4A() bool { - if m != nil && m.Sse4A != nil { - return *m.Sse4A - } - return false -} - -func (m *CClientSystemInfo_CPU) GetSse41() bool { - if m != nil && m.Sse41 != nil { - return *m.Sse41 - } - return false -} - -func (m *CClientSystemInfo_CPU) GetSse42() bool { - if m != nil && m.Sse42 != nil { - return *m.Sse42 - } - return false -} - -type CClientSystemInfo_VideoCard struct { - Driver *string `protobuf:"bytes,1,opt,name=driver" json:"driver,omitempty"` - DriverVersion *string `protobuf:"bytes,2,opt,name=driver_version" json:"driver_version,omitempty"` - DriverDate *uint32 `protobuf:"varint,3,opt,name=driver_date" json:"driver_date,omitempty"` - DirectxVersion *string `protobuf:"bytes,4,opt,name=directx_version" json:"directx_version,omitempty"` - OpenglVersion *string `protobuf:"bytes,5,opt,name=opengl_version" json:"opengl_version,omitempty"` - Vendorid *int32 `protobuf:"varint,6,opt,name=vendorid" json:"vendorid,omitempty"` - Deviceid *int32 `protobuf:"varint,7,opt,name=deviceid" json:"deviceid,omitempty"` - VramMb *int32 `protobuf:"varint,8,opt,name=vram_mb" json:"vram_mb,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CClientSystemInfo_VideoCard) Reset() { *m = CClientSystemInfo_VideoCard{} } -func (m *CClientSystemInfo_VideoCard) String() string { return proto.CompactTextString(m) } -func (*CClientSystemInfo_VideoCard) ProtoMessage() {} -func (*CClientSystemInfo_VideoCard) Descriptor() ([]byte, []int) { return player_fileDescriptor0, []int{8, 1} } - -func (m *CClientSystemInfo_VideoCard) GetDriver() string { - if m != nil && m.Driver != nil { - return *m.Driver - } - return "" -} - -func (m *CClientSystemInfo_VideoCard) GetDriverVersion() string { - if m != nil && m.DriverVersion != nil { - return *m.DriverVersion - } - return "" -} - -func (m *CClientSystemInfo_VideoCard) GetDriverDate() uint32 { - if m != nil && m.DriverDate != nil { - return *m.DriverDate - } - return 0 -} - -func (m *CClientSystemInfo_VideoCard) GetDirectxVersion() string { - if m != nil && m.DirectxVersion != nil { - return *m.DirectxVersion - } - return "" -} - -func (m *CClientSystemInfo_VideoCard) GetOpenglVersion() string { - if m != nil && m.OpenglVersion != nil { - return *m.OpenglVersion - } - return "" -} - -func (m *CClientSystemInfo_VideoCard) GetVendorid() int32 { - if m != nil && m.Vendorid != nil { - return *m.Vendorid - } - return 0 -} - -func (m *CClientSystemInfo_VideoCard) GetDeviceid() int32 { - if m != nil && m.Deviceid != nil { - return *m.Deviceid - } - return 0 -} - -func (m *CClientSystemInfo_VideoCard) GetVramMb() int32 { - if m != nil && m.VramMb != nil { - return *m.VramMb - } - return 0 -} - -type CPlayerClient_GetSystemInformation_Response struct { - SystemInfo *CClientSystemInfo `protobuf:"bytes,1,opt,name=system_info" json:"system_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPlayerClient_GetSystemInformation_Response) Reset() { - *m = CPlayerClient_GetSystemInformation_Response{} -} -func (m *CPlayerClient_GetSystemInformation_Response) String() string { - return proto.CompactTextString(m) -} -func (*CPlayerClient_GetSystemInformation_Response) ProtoMessage() {} -func (*CPlayerClient_GetSystemInformation_Response) Descriptor() ([]byte, []int) { - return player_fileDescriptor0, []int{9} -} - -func (m *CPlayerClient_GetSystemInformation_Response) GetSystemInfo() *CClientSystemInfo { - if m != nil { - return m.SystemInfo - } - return nil -} - -func init() { - proto.RegisterType((*CPlayer_GetGameBadgeLevels_Request)(nil), "CPlayer_GetGameBadgeLevels_Request") - proto.RegisterType((*CPlayer_GetGameBadgeLevels_Response)(nil), "CPlayer_GetGameBadgeLevels_Response") - proto.RegisterType((*CPlayer_GetGameBadgeLevels_Response_Badge)(nil), "CPlayer_GetGameBadgeLevels_Response.Badge") - proto.RegisterType((*CPlayer_GetLastPlayedTimes_Request)(nil), "CPlayer_GetLastPlayedTimes_Request") - proto.RegisterType((*CPlayer_GetLastPlayedTimes_Response)(nil), "CPlayer_GetLastPlayedTimes_Response") - proto.RegisterType((*CPlayer_GetLastPlayedTimes_Response_Game)(nil), "CPlayer_GetLastPlayedTimes_Response.Game") - proto.RegisterType((*CPlayer_AcceptSSA_Request)(nil), "CPlayer_AcceptSSA_Request") - proto.RegisterType((*CPlayer_AcceptSSA_Response)(nil), "CPlayer_AcceptSSA_Response") - proto.RegisterType((*CPlayer_LastPlayedTimes_Notification)(nil), "CPlayer_LastPlayedTimes_Notification") - proto.RegisterType((*CPlayerClient_GetSystemInformation_Request)(nil), "CPlayerClient_GetSystemInformation_Request") - proto.RegisterType((*CClientSystemInfo)(nil), "CClientSystemInfo") - proto.RegisterType((*CClientSystemInfo_CPU)(nil), "CClientSystemInfo.CPU") - proto.RegisterType((*CClientSystemInfo_VideoCard)(nil), "CClientSystemInfo.VideoCard") - proto.RegisterType((*CPlayerClient_GetSystemInformation_Response)(nil), "CPlayerClient_GetSystemInformation_Response") -} - -var player_fileDescriptor0 = []byte{ - // 1067 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x55, 0x4d, 0x6f, 0xdb, 0x46, - 0x10, 0x05, 0x2d, 0xcb, 0x96, 0x46, 0x76, 0x9c, 0x6c, 0x9c, 0x94, 0xa1, 0x5d, 0x60, 0x41, 0xa7, - 0xf9, 0x70, 0x1c, 0xa2, 0x55, 0x82, 0xa2, 0x68, 0x0b, 0x04, 0xb6, 0x0f, 0x41, 0x01, 0x23, 0x48, - 0xe3, 0x38, 0xa7, 0x02, 0xec, 0x8a, 0x5c, 0xc9, 0x44, 0x48, 0xae, 0xca, 0x5d, 0x29, 0x55, 0x4f, - 0x45, 0xce, 0xbd, 0x15, 0xfd, 0x1b, 0xbd, 0xb9, 0xe7, 0x00, 0xfd, 0x23, 0xfd, 0x03, 0x3d, 0xf6, - 0xde, 0xd9, 0x5d, 0x52, 0x1f, 0x96, 0x9d, 0xaa, 0x39, 0x18, 0xd6, 0xee, 0xbc, 0x1d, 0xbe, 0x79, - 0x3b, 0xf3, 0x16, 0xee, 0x48, 0xc5, 0x59, 0x96, 0x71, 0x29, 0x59, 0x8f, 0xcb, 0xb0, 0x9f, 0xb2, - 0x11, 0x2f, 0x02, 0xb3, 0x19, 0xa5, 0x09, 0xcf, 0x55, 0xd0, 0x2f, 0x84, 0x12, 0xde, 0xde, 0x2c, - 0x6e, 0x90, 0x27, 0xdd, 0x84, 0xc7, 0x61, 0x87, 0x49, 0x3e, 0x8f, 0xf6, 0x1f, 0x81, 0x7f, 0xf8, - 0xdc, 0xa4, 0x0a, 0x9f, 0x72, 0xf5, 0x94, 0x65, 0xfc, 0x80, 0xc5, 0x3d, 0x7e, 0xc4, 0x87, 0x3c, - 0x95, 0xe1, 0x0b, 0xfe, 0xc3, 0x80, 0x4b, 0x45, 0xd6, 0xa1, 0xce, 0xfa, 0xfd, 0x24, 0x76, 0x1d, - 0xea, 0xdc, 0x5b, 0xf7, 0xcf, 0x1c, 0xd8, 0x79, 0xef, 0x29, 0xd9, 0x17, 0xb9, 0xe4, 0x64, 0x13, - 0xd6, 0x2c, 0xcd, 0x30, 0xd5, 0x11, 0x7b, 0x9a, 0x7c, 0x09, 0x2b, 0x1d, 0x8d, 0x96, 0xee, 0x12, - 0xad, 0xdd, 0x6b, 0xb5, 0x77, 0x83, 0x05, 0x72, 0x05, 0x66, 0xd3, 0xfb, 0x1a, 0xea, 0xe6, 0x87, - 0x66, 0x34, 0xc9, 0x59, 0x27, 0x57, 0x60, 0x45, 0xf2, 0x22, 0x31, 0x39, 0xf5, 0x1a, 0xbf, 0xdc, - 0x11, 0x45, 0x8c, 0x39, 0x23, 0x91, 0x8a, 0xc2, 0xad, 0x19, 0xde, 0x6f, 0x9d, 0x99, 0x6a, 0x8f, - 0x98, 0x54, 0x66, 0x15, 0xbf, 0x4c, 0x50, 0xaf, 0x71, 0xb5, 0xdf, 0xc1, 0x46, 0x96, 0xe4, 0x61, - 0x8a, 0x61, 0x2b, 0x73, 0x59, 0xf7, 0xc1, 0xe1, 0xdb, 0x33, 0xf7, 0xc9, 0xcb, 0x53, 0x4e, 0x33, - 0x21, 0x15, 0x2d, 0x78, 0x84, 0x3a, 0x52, 0x0d, 0x7b, 0x68, 0x61, 0x54, 0x61, 0x1e, 0xaa, 0x10, - 0x60, 0x35, 0xa6, 0x2c, 0x2d, 0x38, 0x8b, 0x47, 0xf4, 0x75, 0x2e, 0xde, 0x48, 0xca, 0x3a, 0x62, - 0xa0, 0xfc, 0x77, 0xb3, 0xe2, 0xcd, 0x93, 0x28, 0xc5, 0xfb, 0x02, 0xea, 0x3d, 0x14, 0x43, 0xe2, - 0xb7, 0xb5, 0x4a, 0xf7, 0x83, 0x05, 0x0e, 0x05, 0x5a, 0x3e, 0x2f, 0x84, 0x65, 0xfd, 0x7f, 0xf6, - 0xd6, 0xea, 0xe4, 0x06, 0xac, 0x8f, 0x4b, 0xd2, 0x44, 0x8d, 0x54, 0xeb, 0xe4, 0x23, 0xd8, 0xa8, - 0x76, 0xc2, 0xf6, 0x1b, 0xce, 0x5f, 0x4b, 0xa3, 0x56, 0x9d, 0xb8, 0x70, 0x75, 0x1c, 0xe8, 0x8a, - 0x02, 0xd5, 0x2e, 0xdc, 0x65, 0x1d, 0xf1, 0xb7, 0xe0, 0x56, 0x45, 0x66, 0x3f, 0x8a, 0x78, 0x5f, - 0x1d, 0x1f, 0xef, 0x57, 0xea, 0xf9, 0xdb, 0xe0, 0x5d, 0x14, 0xb4, 0x04, 0xfd, 0xef, 0xe1, 0x76, - 0x15, 0x3d, 0x5f, 0xc4, 0x33, 0xa1, 0xb0, 0x55, 0x23, 0xa6, 0x12, 0x91, 0x7f, 0x78, 0xf5, 0xfe, - 0x1e, 0xec, 0x96, 0xd8, 0x43, 0x73, 0x09, 0xfa, 0xc4, 0xf1, 0x08, 0x3b, 0x3f, 0xfb, 0x26, 0xc7, - 0x32, 0x32, 0x93, 0x7f, 0xcc, 0xf6, 0x9f, 0x65, 0xb8, 0x76, 0x68, 0x81, 0x13, 0x10, 0xd9, 0x81, - 0x5a, 0xd4, 0x1f, 0x18, 0xdd, 0x5a, 0xed, 0x9b, 0xc1, 0x1c, 0x00, 0xd9, 0x9c, 0x90, 0x4f, 0x01, - 0x86, 0x49, 0xcc, 0x45, 0x18, 0xb1, 0x22, 0x36, 0x62, 0xb6, 0xda, 0xdb, 0x17, 0x60, 0x5f, 0x69, - 0xd0, 0x21, 0x62, 0xb4, 0xa2, 0xa2, 0xcf, 0x0b, 0x64, 0x90, 0xf7, 0x42, 0x69, 0x10, 0x46, 0xeb, - 0x26, 0xb9, 0x0a, 0x0d, 0x21, 0xc3, 0xcf, 0x1f, 0x77, 0x12, 0x65, 0x34, 0x6e, 0xe8, 0xdb, 0xb2, - 0x88, 0xb0, 0x60, 0x59, 0x98, 0x75, 0xdc, 0x7a, 0xd5, 0xd8, 0x6c, 0x10, 0x27, 0x22, 0x8c, 0xf9, - 0x30, 0x89, 0xb8, 0xbb, 0x62, 0x8e, 0x6f, 0xc3, 0x66, 0xb9, 0x5b, 0x24, 0x78, 0x4d, 0x21, 0xfe, - 0x49, 0xac, 0xd2, 0x5d, 0xd5, 0x51, 0xef, 0x2f, 0x07, 0x6a, 0x9a, 0xf0, 0x35, 0x68, 0xca, 0x3e, - 0x47, 0x2f, 0xc8, 0x4e, 0x7f, 0x9a, 0xcc, 0xcd, 0x90, 0xe7, 0x31, 0x4e, 0xc8, 0x92, 0x49, 0xe4, - 0x01, 0x49, 0x45, 0x0f, 0x2f, 0x21, 0x0d, 0xd1, 0x1f, 0x22, 0x34, 0x11, 0x51, 0x54, 0xfd, 0xb0, - 0x05, 0xd7, 0xfb, 0xa7, 0x23, 0x79, 0x3e, 0x68, 0x5a, 0x82, 0xdc, 0x84, 0x2b, 0xa7, 0x23, 0xac, - 0x4d, 0x9d, 0xea, 0x8e, 0xc7, 0xfa, 0x0c, 0xdf, 0x86, 0xee, 0xc1, 0x6e, 0x94, 0x89, 0xa1, 0x21, - 0xda, 0x20, 0x6b, 0xb0, 0x2c, 0x25, 0x6f, 0x1b, 0x62, 0xd5, 0xea, 0x91, 0xdb, 0xa8, 0xa0, 0xd2, - 0x2c, 0x9b, 0x93, 0x25, 0x7f, 0xcc, 0x5c, 0x98, 0x5e, 0x7e, 0xe6, 0xb6, 0xa6, 0x97, 0x6d, 0x77, - 0x4d, 0x2f, 0xbd, 0xdf, 0x1d, 0x68, 0x4e, 0x74, 0xc6, 0xaa, 0xac, 0x10, 0xa6, 0xca, 0xa6, 0x26, - 0x77, 0x4e, 0x18, 0x5b, 0xed, 0x75, 0x68, 0x95, 0xfb, 0x31, 0x53, 0xdc, 0x9a, 0x84, 0x9e, 0x87, - 0x38, 0xc1, 0xd9, 0x56, 0x3f, 0x8e, 0xd1, 0xcb, 0x55, 0x16, 0xbc, 0xbd, 0xbc, 0x97, 0x8e, 0xf7, - 0xeb, 0xd5, 0xdd, 0x59, 0x0d, 0x71, 0xd2, 0x56, 0x8c, 0x18, 0xb8, 0x63, 0xaf, 0x07, 0x77, 0x56, - 0xcd, 0xce, 0x06, 0xac, 0x0e, 0xcb, 0x7b, 0x6c, 0x98, 0x11, 0x7a, 0x05, 0x0f, 0x16, 0xea, 0xd2, - 0xd2, 0x0c, 0xee, 0x42, 0xab, 0xec, 0x86, 0x04, 0xc3, 0x65, 0x63, 0x92, 0xf9, 0x66, 0x6b, 0xff, - 0x5d, 0x83, 0x15, 0x9b, 0x97, 0xfc, 0xe1, 0x00, 0x99, 0x77, 0x54, 0xb2, 0x13, 0xfc, 0xb7, 0xe1, - 0x7b, 0xb7, 0x17, 0xf1, 0x64, 0xff, 0x04, 0xfd, 0xf0, 0xdb, 0x17, 0x5c, 0x0d, 0x8a, 0x5c, 0x1a, - 0xdb, 0x3b, 0xd6, 0xef, 0x0b, 0x35, 0x30, 0x2a, 0xba, 0x94, 0xd1, 0x01, 0xba, 0xf2, 0x9e, 0x09, - 0x99, 0x04, 0xd4, 0x78, 0x36, 0xc5, 0x02, 0xcd, 0x9e, 0x9e, 0xf0, 0x3d, 0xca, 0xf2, 0x98, 0x26, - 0x5d, 0x9a, 0xa8, 0xbb, 0x12, 0x23, 0x49, 0x4a, 0x7e, 0x73, 0xc0, 0xb5, 0x85, 0xcd, 0x0f, 0xfb, - 0x2c, 0xfd, 0x4b, 0x1c, 0x7c, 0x96, 0xfe, 0x65, 0x76, 0xe1, 0x07, 0x48, 0x7f, 0x17, 0x01, 0x96, - 0xfb, 0x79, 0x1f, 0x97, 0x63, 0x9a, 0x2c, 0x8a, 0xc4, 0x20, 0x57, 0x24, 0x82, 0xe6, 0xd8, 0xd1, - 0x88, 0x17, 0x5c, 0x6a, 0x81, 0xde, 0x56, 0xf0, 0x1e, 0x07, 0xfc, 0x18, 0xbf, 0x7a, 0xeb, 0x04, - 0x75, 0xa1, 0x89, 0xd4, 0xa9, 0x31, 0x8e, 0xe3, 0x62, 0xe5, 0x3b, 0xde, 0xf7, 0x1e, 0x62, 0xf8, - 0xfe, 0x3e, 0xc5, 0xb8, 0x6e, 0x20, 0xc3, 0x41, 0x83, 0xa4, 0xd4, 0x20, 0xab, 0xaf, 0x7d, 0x53, - 0x29, 0xf6, 0x2c, 0x6b, 0xff, 0x5a, 0x83, 0xb5, 0xe9, 0x3e, 0x22, 0xbf, 0x38, 0x70, 0xc3, 0x38, - 0xe9, 0xe8, 0xbc, 0x72, 0x9f, 0x04, 0x8b, 0x38, 0xaf, 0xd7, 0x0a, 0x9e, 0x89, 0x31, 0xd9, 0x27, - 0xc8, 0xe6, 0xab, 0xe9, 0x30, 0xed, 0x16, 0x22, 0x33, 0xec, 0x90, 0x81, 0x12, 0xd5, 0x43, 0x87, - 0x97, 0x9d, 0xe1, 0x13, 0x51, 0xbd, 0x89, 0x9a, 0xa1, 0x11, 0x91, 0xfc, 0xe9, 0xc0, 0xe6, 0x45, - 0xad, 0x4d, 0x1e, 0x04, 0x8b, 0xbb, 0xb4, 0xb7, 0x17, 0xfc, 0x8f, 0x61, 0xf1, 0x9f, 0x23, 0xe9, - 0xa3, 0xf2, 0xa8, 0xe5, 0xab, 0xc5, 0x9d, 0x70, 0x9e, 0x7a, 0xa0, 0xb5, 0xbc, 0xc9, 0x24, 0x87, - 0x7d, 0xa2, 0x0d, 0x40, 0x77, 0xae, 0xa4, 0x76, 0xe8, 0x3c, 0xdd, 0x29, 0x77, 0xe6, 0xc4, 0xaf, - 0x92, 0xe4, 0x53, 0xfa, 0xc8, 0x77, 0x67, 0xee, 0xd2, 0x41, 0xed, 0x67, 0xc7, 0xf9, 0x37, 0x00, - 0x00, 0xff, 0xff, 0x9e, 0xe2, 0xe2, 0x67, 0xb1, 0x09, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/publishedfile.pb.go b/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/publishedfile.pb.go deleted file mode 100644 index 06e85481..00000000 --- a/vendor/github.com/Philipp15b/go-steam/protocol/protobuf/unified/publishedfile.pb.go +++ /dev/null @@ -1,2702 +0,0 @@ -// Code generated by protoc-gen-go. -// source: steammessages_publishedfile.steamclient.proto -// DO NOT EDIT! - -package unified - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type PublishedFileDetails_EPublishedFileForSaleStatus int32 - -const ( - PublishedFileDetails_k_PFFSS_NotForSale PublishedFileDetails_EPublishedFileForSaleStatus = 0 - PublishedFileDetails_k_PFFSS_PendingApproval PublishedFileDetails_EPublishedFileForSaleStatus = 1 - PublishedFileDetails_k_PFFSS_ApprovedForSale PublishedFileDetails_EPublishedFileForSaleStatus = 2 - PublishedFileDetails_k_PFFSS_RejectedForSale PublishedFileDetails_EPublishedFileForSaleStatus = 3 - PublishedFileDetails_k_PFFSS_NoLongerForSale PublishedFileDetails_EPublishedFileForSaleStatus = 4 - PublishedFileDetails_k_PFFSS_TentativeApproval PublishedFileDetails_EPublishedFileForSaleStatus = 5 -) - -var PublishedFileDetails_EPublishedFileForSaleStatus_name = map[int32]string{ - 0: "k_PFFSS_NotForSale", - 1: "k_PFFSS_PendingApproval", - 2: "k_PFFSS_ApprovedForSale", - 3: "k_PFFSS_RejectedForSale", - 4: "k_PFFSS_NoLongerForSale", - 5: "k_PFFSS_TentativeApproval", -} -var PublishedFileDetails_EPublishedFileForSaleStatus_value = map[string]int32{ - "k_PFFSS_NotForSale": 0, - "k_PFFSS_PendingApproval": 1, - "k_PFFSS_ApprovedForSale": 2, - "k_PFFSS_RejectedForSale": 3, - "k_PFFSS_NoLongerForSale": 4, - "k_PFFSS_TentativeApproval": 5, -} - -func (x PublishedFileDetails_EPublishedFileForSaleStatus) Enum() *PublishedFileDetails_EPublishedFileForSaleStatus { - p := new(PublishedFileDetails_EPublishedFileForSaleStatus) - *p = x - return p -} -func (x PublishedFileDetails_EPublishedFileForSaleStatus) String() string { - return proto.EnumName(PublishedFileDetails_EPublishedFileForSaleStatus_name, int32(x)) -} -func (x *PublishedFileDetails_EPublishedFileForSaleStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PublishedFileDetails_EPublishedFileForSaleStatus_value, data, "PublishedFileDetails_EPublishedFileForSaleStatus") - if err != nil { - return err - } - *x = PublishedFileDetails_EPublishedFileForSaleStatus(value) - return nil -} -func (PublishedFileDetails_EPublishedFileForSaleStatus) EnumDescriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{9, 0} -} - -type CPublishedFile_Subscribe_Request struct { - Publishedfileid *uint64 `protobuf:"varint,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - ListType *uint32 `protobuf:"varint,2,opt,name=list_type" json:"list_type,omitempty"` - Appid *int32 `protobuf:"varint,3,opt,name=appid" json:"appid,omitempty"` - NotifyClient *bool `protobuf:"varint,4,opt,name=notify_client" json:"notify_client,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Subscribe_Request) Reset() { *m = CPublishedFile_Subscribe_Request{} } -func (m *CPublishedFile_Subscribe_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Subscribe_Request) ProtoMessage() {} -func (*CPublishedFile_Subscribe_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{0} -} - -func (m *CPublishedFile_Subscribe_Request) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *CPublishedFile_Subscribe_Request) GetListType() uint32 { - if m != nil && m.ListType != nil { - return *m.ListType - } - return 0 -} - -func (m *CPublishedFile_Subscribe_Request) GetAppid() int32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_Subscribe_Request) GetNotifyClient() bool { - if m != nil && m.NotifyClient != nil { - return *m.NotifyClient - } - return false -} - -type CPublishedFile_Subscribe_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Subscribe_Response) Reset() { *m = CPublishedFile_Subscribe_Response{} } -func (m *CPublishedFile_Subscribe_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Subscribe_Response) ProtoMessage() {} -func (*CPublishedFile_Subscribe_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{1} -} - -type CPublishedFile_Unsubscribe_Request struct { - Publishedfileid *uint64 `protobuf:"varint,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - ListType *uint32 `protobuf:"varint,2,opt,name=list_type" json:"list_type,omitempty"` - Appid *int32 `protobuf:"varint,3,opt,name=appid" json:"appid,omitempty"` - NotifyClient *bool `protobuf:"varint,4,opt,name=notify_client" json:"notify_client,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Unsubscribe_Request) Reset() { *m = CPublishedFile_Unsubscribe_Request{} } -func (m *CPublishedFile_Unsubscribe_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Unsubscribe_Request) ProtoMessage() {} -func (*CPublishedFile_Unsubscribe_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{2} -} - -func (m *CPublishedFile_Unsubscribe_Request) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *CPublishedFile_Unsubscribe_Request) GetListType() uint32 { - if m != nil && m.ListType != nil { - return *m.ListType - } - return 0 -} - -func (m *CPublishedFile_Unsubscribe_Request) GetAppid() int32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_Unsubscribe_Request) GetNotifyClient() bool { - if m != nil && m.NotifyClient != nil { - return *m.NotifyClient - } - return false -} - -type CPublishedFile_Unsubscribe_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Unsubscribe_Response) Reset() { *m = CPublishedFile_Unsubscribe_Response{} } -func (m *CPublishedFile_Unsubscribe_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Unsubscribe_Response) ProtoMessage() {} -func (*CPublishedFile_Unsubscribe_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{3} -} - -type CPublishedFile_CanSubscribe_Request struct { - Publishedfileid *uint64 `protobuf:"varint,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_CanSubscribe_Request) Reset() { *m = CPublishedFile_CanSubscribe_Request{} } -func (m *CPublishedFile_CanSubscribe_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_CanSubscribe_Request) ProtoMessage() {} -func (*CPublishedFile_CanSubscribe_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{4} -} - -func (m *CPublishedFile_CanSubscribe_Request) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -type CPublishedFile_CanSubscribe_Response struct { - CanSubscribe *bool `protobuf:"varint,1,opt,name=can_subscribe" json:"can_subscribe,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_CanSubscribe_Response) Reset() { *m = CPublishedFile_CanSubscribe_Response{} } -func (m *CPublishedFile_CanSubscribe_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_CanSubscribe_Response) ProtoMessage() {} -func (*CPublishedFile_CanSubscribe_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{5} -} - -func (m *CPublishedFile_CanSubscribe_Response) GetCanSubscribe() bool { - if m != nil && m.CanSubscribe != nil { - return *m.CanSubscribe - } - return false -} - -type CPublishedFile_Publish_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - ConsumerAppid *uint32 `protobuf:"varint,2,opt,name=consumer_appid" json:"consumer_appid,omitempty"` - Cloudfilename *string `protobuf:"bytes,3,opt,name=cloudfilename" json:"cloudfilename,omitempty"` - PreviewCloudfilename *string `protobuf:"bytes,4,opt,name=preview_cloudfilename" json:"preview_cloudfilename,omitempty"` - Title *string `protobuf:"bytes,5,opt,name=title" json:"title,omitempty"` - FileDescription *string `protobuf:"bytes,6,opt,name=file_description" json:"file_description,omitempty"` - FileType *uint32 `protobuf:"varint,7,opt,name=file_type" json:"file_type,omitempty"` - ConsumerShortcutName *string `protobuf:"bytes,8,opt,name=consumer_shortcut_name" json:"consumer_shortcut_name,omitempty"` - YoutubeUsername *string `protobuf:"bytes,9,opt,name=youtube_username" json:"youtube_username,omitempty"` - YoutubeVideoid *string `protobuf:"bytes,10,opt,name=youtube_videoid" json:"youtube_videoid,omitempty"` - Visibility *uint32 `protobuf:"varint,11,opt,name=visibility" json:"visibility,omitempty"` - RedirectUri *string `protobuf:"bytes,12,opt,name=redirect_uri" json:"redirect_uri,omitempty"` - Tags []string `protobuf:"bytes,13,rep,name=tags" json:"tags,omitempty"` - CollectionType *string `protobuf:"bytes,14,opt,name=collection_type" json:"collection_type,omitempty"` - GameType *string `protobuf:"bytes,15,opt,name=game_type" json:"game_type,omitempty"` - Url *string `protobuf:"bytes,16,opt,name=url" json:"url,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Publish_Request) Reset() { *m = CPublishedFile_Publish_Request{} } -func (m *CPublishedFile_Publish_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Publish_Request) ProtoMessage() {} -func (*CPublishedFile_Publish_Request) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{6} } - -func (m *CPublishedFile_Publish_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_Publish_Request) GetConsumerAppid() uint32 { - if m != nil && m.ConsumerAppid != nil { - return *m.ConsumerAppid - } - return 0 -} - -func (m *CPublishedFile_Publish_Request) GetCloudfilename() string { - if m != nil && m.Cloudfilename != nil { - return *m.Cloudfilename - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetPreviewCloudfilename() string { - if m != nil && m.PreviewCloudfilename != nil { - return *m.PreviewCloudfilename - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetFileDescription() string { - if m != nil && m.FileDescription != nil { - return *m.FileDescription - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetFileType() uint32 { - if m != nil && m.FileType != nil { - return *m.FileType - } - return 0 -} - -func (m *CPublishedFile_Publish_Request) GetConsumerShortcutName() string { - if m != nil && m.ConsumerShortcutName != nil { - return *m.ConsumerShortcutName - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetYoutubeUsername() string { - if m != nil && m.YoutubeUsername != nil { - return *m.YoutubeUsername - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetYoutubeVideoid() string { - if m != nil && m.YoutubeVideoid != nil { - return *m.YoutubeVideoid - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetVisibility() uint32 { - if m != nil && m.Visibility != nil { - return *m.Visibility - } - return 0 -} - -func (m *CPublishedFile_Publish_Request) GetRedirectUri() string { - if m != nil && m.RedirectUri != nil { - return *m.RedirectUri - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetTags() []string { - if m != nil { - return m.Tags - } - return nil -} - -func (m *CPublishedFile_Publish_Request) GetCollectionType() string { - if m != nil && m.CollectionType != nil { - return *m.CollectionType - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetGameType() string { - if m != nil && m.GameType != nil { - return *m.GameType - } - return "" -} - -func (m *CPublishedFile_Publish_Request) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -type CPublishedFile_Publish_Response struct { - Publishedfileid *uint64 `protobuf:"varint,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - RedirectUri *string `protobuf:"bytes,2,opt,name=redirect_uri" json:"redirect_uri,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Publish_Response) Reset() { *m = CPublishedFile_Publish_Response{} } -func (m *CPublishedFile_Publish_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Publish_Response) ProtoMessage() {} -func (*CPublishedFile_Publish_Response) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{7} } - -func (m *CPublishedFile_Publish_Response) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *CPublishedFile_Publish_Response) GetRedirectUri() string { - if m != nil && m.RedirectUri != nil { - return *m.RedirectUri - } - return "" -} - -type CPublishedFile_GetDetails_Request struct { - Publishedfileids []uint64 `protobuf:"fixed64,1,rep,name=publishedfileids" json:"publishedfileids,omitempty"` - Includetags *bool `protobuf:"varint,2,opt,name=includetags" json:"includetags,omitempty"` - Includeadditionalpreviews *bool `protobuf:"varint,3,opt,name=includeadditionalpreviews" json:"includeadditionalpreviews,omitempty"` - Includechildren *bool `protobuf:"varint,4,opt,name=includechildren" json:"includechildren,omitempty"` - Includekvtags *bool `protobuf:"varint,5,opt,name=includekvtags" json:"includekvtags,omitempty"` - Includevotes *bool `protobuf:"varint,6,opt,name=includevotes" json:"includevotes,omitempty"` - ShortDescription *bool `protobuf:"varint,8,opt,name=short_description" json:"short_description,omitempty"` - Includeforsaledata *bool `protobuf:"varint,10,opt,name=includeforsaledata" json:"includeforsaledata,omitempty"` - Includemetadata *bool `protobuf:"varint,11,opt,name=includemetadata" json:"includemetadata,omitempty"` - Language *int32 `protobuf:"varint,12,opt,name=language,def=0" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetDetails_Request) Reset() { *m = CPublishedFile_GetDetails_Request{} } -func (m *CPublishedFile_GetDetails_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetDetails_Request) ProtoMessage() {} -func (*CPublishedFile_GetDetails_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{8} -} - -const Default_CPublishedFile_GetDetails_Request_Language int32 = 0 - -func (m *CPublishedFile_GetDetails_Request) GetPublishedfileids() []uint64 { - if m != nil { - return m.Publishedfileids - } - return nil -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludetags() bool { - if m != nil && m.Includetags != nil { - return *m.Includetags - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludeadditionalpreviews() bool { - if m != nil && m.Includeadditionalpreviews != nil { - return *m.Includeadditionalpreviews - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludechildren() bool { - if m != nil && m.Includechildren != nil { - return *m.Includechildren - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludekvtags() bool { - if m != nil && m.Includekvtags != nil { - return *m.Includekvtags - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludevotes() bool { - if m != nil && m.Includevotes != nil { - return *m.Includevotes - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetShortDescription() bool { - if m != nil && m.ShortDescription != nil { - return *m.ShortDescription - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludeforsaledata() bool { - if m != nil && m.Includeforsaledata != nil { - return *m.Includeforsaledata - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetIncludemetadata() bool { - if m != nil && m.Includemetadata != nil { - return *m.Includemetadata - } - return false -} - -func (m *CPublishedFile_GetDetails_Request) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_CPublishedFile_GetDetails_Request_Language -} - -type PublishedFileDetails struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - Publishedfileid *uint64 `protobuf:"varint,2,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - Creator *uint64 `protobuf:"fixed64,3,opt,name=creator" json:"creator,omitempty"` - CreatorAppid *uint32 `protobuf:"varint,4,opt,name=creator_appid" json:"creator_appid,omitempty"` - ConsumerAppid *uint32 `protobuf:"varint,5,opt,name=consumer_appid" json:"consumer_appid,omitempty"` - ConsumerShortcutid *uint32 `protobuf:"varint,6,opt,name=consumer_shortcutid" json:"consumer_shortcutid,omitempty"` - Filename *string `protobuf:"bytes,7,opt,name=filename" json:"filename,omitempty"` - FileSize *uint64 `protobuf:"varint,8,opt,name=file_size" json:"file_size,omitempty"` - PreviewFileSize *uint64 `protobuf:"varint,9,opt,name=preview_file_size" json:"preview_file_size,omitempty"` - FileUrl *string `protobuf:"bytes,10,opt,name=file_url" json:"file_url,omitempty"` - PreviewUrl *string `protobuf:"bytes,11,opt,name=preview_url" json:"preview_url,omitempty"` - Youtubevideoid *string `protobuf:"bytes,12,opt,name=youtubevideoid" json:"youtubevideoid,omitempty"` - Url *string `protobuf:"bytes,13,opt,name=url" json:"url,omitempty"` - HcontentFile *uint64 `protobuf:"fixed64,14,opt,name=hcontent_file" json:"hcontent_file,omitempty"` - HcontentPreview *uint64 `protobuf:"fixed64,15,opt,name=hcontent_preview" json:"hcontent_preview,omitempty"` - Title *string `protobuf:"bytes,16,opt,name=title" json:"title,omitempty"` - FileDescription *string `protobuf:"bytes,17,opt,name=file_description" json:"file_description,omitempty"` - ShortDescription *string `protobuf:"bytes,18,opt,name=short_description" json:"short_description,omitempty"` - TimeCreated *uint32 `protobuf:"varint,19,opt,name=time_created" json:"time_created,omitempty"` - TimeUpdated *uint32 `protobuf:"varint,20,opt,name=time_updated" json:"time_updated,omitempty"` - Visibility *uint32 `protobuf:"varint,21,opt,name=visibility" json:"visibility,omitempty"` - Flags *uint32 `protobuf:"varint,22,opt,name=flags" json:"flags,omitempty"` - WorkshopFile *bool `protobuf:"varint,23,opt,name=workshop_file" json:"workshop_file,omitempty"` - WorkshopAccepted *bool `protobuf:"varint,24,opt,name=workshop_accepted" json:"workshop_accepted,omitempty"` - ShowSubscribeAll *bool `protobuf:"varint,25,opt,name=show_subscribe_all" json:"show_subscribe_all,omitempty"` - NumCommentsDeveloper *int32 `protobuf:"varint,26,opt,name=num_comments_developer" json:"num_comments_developer,omitempty"` - NumCommentsPublic *int32 `protobuf:"varint,27,opt,name=num_comments_public" json:"num_comments_public,omitempty"` - Banned *bool `protobuf:"varint,28,opt,name=banned" json:"banned,omitempty"` - BanReason *string `protobuf:"bytes,29,opt,name=ban_reason" json:"ban_reason,omitempty"` - Banner *uint64 `protobuf:"fixed64,30,opt,name=banner" json:"banner,omitempty"` - CanBeDeleted *bool `protobuf:"varint,31,opt,name=can_be_deleted" json:"can_be_deleted,omitempty"` - Incompatible *bool `protobuf:"varint,32,opt,name=incompatible" json:"incompatible,omitempty"` - AppName *string `protobuf:"bytes,33,opt,name=app_name" json:"app_name,omitempty"` - FileType *uint32 `protobuf:"varint,34,opt,name=file_type" json:"file_type,omitempty"` - CanSubscribe *bool `protobuf:"varint,35,opt,name=can_subscribe" json:"can_subscribe,omitempty"` - Subscriptions *uint32 `protobuf:"varint,36,opt,name=subscriptions" json:"subscriptions,omitempty"` - Favorited *uint32 `protobuf:"varint,37,opt,name=favorited" json:"favorited,omitempty"` - Followers *uint32 `protobuf:"varint,38,opt,name=followers" json:"followers,omitempty"` - LifetimeSubscriptions *uint32 `protobuf:"varint,39,opt,name=lifetime_subscriptions" json:"lifetime_subscriptions,omitempty"` - LifetimeFavorited *uint32 `protobuf:"varint,40,opt,name=lifetime_favorited" json:"lifetime_favorited,omitempty"` - LifetimeFollowers *uint32 `protobuf:"varint,41,opt,name=lifetime_followers" json:"lifetime_followers,omitempty"` - Views *uint32 `protobuf:"varint,42,opt,name=views" json:"views,omitempty"` - ImageWidth *uint32 `protobuf:"varint,43,opt,name=image_width" json:"image_width,omitempty"` - ImageHeight *uint32 `protobuf:"varint,44,opt,name=image_height" json:"image_height,omitempty"` - ImageUrl *string `protobuf:"bytes,45,opt,name=image_url" json:"image_url,omitempty"` - SpoilerTag *bool `protobuf:"varint,46,opt,name=spoiler_tag" json:"spoiler_tag,omitempty"` - Shortcutid *uint32 `protobuf:"varint,47,opt,name=shortcutid" json:"shortcutid,omitempty"` - Shortcutname *string `protobuf:"bytes,48,opt,name=shortcutname" json:"shortcutname,omitempty"` - NumChildren *uint32 `protobuf:"varint,49,opt,name=num_children" json:"num_children,omitempty"` - NumReports *uint32 `protobuf:"varint,50,opt,name=num_reports" json:"num_reports,omitempty"` - Previews []*PublishedFileDetails_Preview `protobuf:"bytes,51,rep,name=previews" json:"previews,omitempty"` - Tags []*PublishedFileDetails_Tag `protobuf:"bytes,52,rep,name=tags" json:"tags,omitempty"` - Children []*PublishedFileDetails_Child `protobuf:"bytes,53,rep,name=children" json:"children,omitempty"` - Kvtags []*PublishedFileDetails_KVTag `protobuf:"bytes,54,rep,name=kvtags" json:"kvtags,omitempty"` - VoteData *PublishedFileDetails_VoteData `protobuf:"bytes,55,opt,name=vote_data" json:"vote_data,omitempty"` - TimeSubscribed *uint32 `protobuf:"varint,56,opt,name=time_subscribed" json:"time_subscribed,omitempty"` - ForSaleData *PublishedFileDetails_ForSaleData `protobuf:"bytes,57,opt,name=for_sale_data" json:"for_sale_data,omitempty"` - Metadata *string `protobuf:"bytes,58,opt,name=metadata" json:"metadata,omitempty"` - IncompatibleActor *uint64 `protobuf:"fixed64,59,opt,name=incompatible_actor" json:"incompatible_actor,omitempty"` - IncompatibleTimestamp *uint32 `protobuf:"varint,60,opt,name=incompatible_timestamp" json:"incompatible_timestamp,omitempty"` - Language *int32 `protobuf:"varint,61,opt,name=language,def=0" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails) Reset() { *m = PublishedFileDetails{} } -func (m *PublishedFileDetails) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails) ProtoMessage() {} -func (*PublishedFileDetails) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{9} } - -const Default_PublishedFileDetails_Language int32 = 0 - -func (m *PublishedFileDetails) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *PublishedFileDetails) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *PublishedFileDetails) GetCreator() uint64 { - if m != nil && m.Creator != nil { - return *m.Creator - } - return 0 -} - -func (m *PublishedFileDetails) GetCreatorAppid() uint32 { - if m != nil && m.CreatorAppid != nil { - return *m.CreatorAppid - } - return 0 -} - -func (m *PublishedFileDetails) GetConsumerAppid() uint32 { - if m != nil && m.ConsumerAppid != nil { - return *m.ConsumerAppid - } - return 0 -} - -func (m *PublishedFileDetails) GetConsumerShortcutid() uint32 { - if m != nil && m.ConsumerShortcutid != nil { - return *m.ConsumerShortcutid - } - return 0 -} - -func (m *PublishedFileDetails) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *PublishedFileDetails) GetFileSize() uint64 { - if m != nil && m.FileSize != nil { - return *m.FileSize - } - return 0 -} - -func (m *PublishedFileDetails) GetPreviewFileSize() uint64 { - if m != nil && m.PreviewFileSize != nil { - return *m.PreviewFileSize - } - return 0 -} - -func (m *PublishedFileDetails) GetFileUrl() string { - if m != nil && m.FileUrl != nil { - return *m.FileUrl - } - return "" -} - -func (m *PublishedFileDetails) GetPreviewUrl() string { - if m != nil && m.PreviewUrl != nil { - return *m.PreviewUrl - } - return "" -} - -func (m *PublishedFileDetails) GetYoutubevideoid() string { - if m != nil && m.Youtubevideoid != nil { - return *m.Youtubevideoid - } - return "" -} - -func (m *PublishedFileDetails) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *PublishedFileDetails) GetHcontentFile() uint64 { - if m != nil && m.HcontentFile != nil { - return *m.HcontentFile - } - return 0 -} - -func (m *PublishedFileDetails) GetHcontentPreview() uint64 { - if m != nil && m.HcontentPreview != nil { - return *m.HcontentPreview - } - return 0 -} - -func (m *PublishedFileDetails) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *PublishedFileDetails) GetFileDescription() string { - if m != nil && m.FileDescription != nil { - return *m.FileDescription - } - return "" -} - -func (m *PublishedFileDetails) GetShortDescription() string { - if m != nil && m.ShortDescription != nil { - return *m.ShortDescription - } - return "" -} - -func (m *PublishedFileDetails) GetTimeCreated() uint32 { - if m != nil && m.TimeCreated != nil { - return *m.TimeCreated - } - return 0 -} - -func (m *PublishedFileDetails) GetTimeUpdated() uint32 { - if m != nil && m.TimeUpdated != nil { - return *m.TimeUpdated - } - return 0 -} - -func (m *PublishedFileDetails) GetVisibility() uint32 { - if m != nil && m.Visibility != nil { - return *m.Visibility - } - return 0 -} - -func (m *PublishedFileDetails) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *PublishedFileDetails) GetWorkshopFile() bool { - if m != nil && m.WorkshopFile != nil { - return *m.WorkshopFile - } - return false -} - -func (m *PublishedFileDetails) GetWorkshopAccepted() bool { - if m != nil && m.WorkshopAccepted != nil { - return *m.WorkshopAccepted - } - return false -} - -func (m *PublishedFileDetails) GetShowSubscribeAll() bool { - if m != nil && m.ShowSubscribeAll != nil { - return *m.ShowSubscribeAll - } - return false -} - -func (m *PublishedFileDetails) GetNumCommentsDeveloper() int32 { - if m != nil && m.NumCommentsDeveloper != nil { - return *m.NumCommentsDeveloper - } - return 0 -} - -func (m *PublishedFileDetails) GetNumCommentsPublic() int32 { - if m != nil && m.NumCommentsPublic != nil { - return *m.NumCommentsPublic - } - return 0 -} - -func (m *PublishedFileDetails) GetBanned() bool { - if m != nil && m.Banned != nil { - return *m.Banned - } - return false -} - -func (m *PublishedFileDetails) GetBanReason() string { - if m != nil && m.BanReason != nil { - return *m.BanReason - } - return "" -} - -func (m *PublishedFileDetails) GetBanner() uint64 { - if m != nil && m.Banner != nil { - return *m.Banner - } - return 0 -} - -func (m *PublishedFileDetails) GetCanBeDeleted() bool { - if m != nil && m.CanBeDeleted != nil { - return *m.CanBeDeleted - } - return false -} - -func (m *PublishedFileDetails) GetIncompatible() bool { - if m != nil && m.Incompatible != nil { - return *m.Incompatible - } - return false -} - -func (m *PublishedFileDetails) GetAppName() string { - if m != nil && m.AppName != nil { - return *m.AppName - } - return "" -} - -func (m *PublishedFileDetails) GetFileType() uint32 { - if m != nil && m.FileType != nil { - return *m.FileType - } - return 0 -} - -func (m *PublishedFileDetails) GetCanSubscribe() bool { - if m != nil && m.CanSubscribe != nil { - return *m.CanSubscribe - } - return false -} - -func (m *PublishedFileDetails) GetSubscriptions() uint32 { - if m != nil && m.Subscriptions != nil { - return *m.Subscriptions - } - return 0 -} - -func (m *PublishedFileDetails) GetFavorited() uint32 { - if m != nil && m.Favorited != nil { - return *m.Favorited - } - return 0 -} - -func (m *PublishedFileDetails) GetFollowers() uint32 { - if m != nil && m.Followers != nil { - return *m.Followers - } - return 0 -} - -func (m *PublishedFileDetails) GetLifetimeSubscriptions() uint32 { - if m != nil && m.LifetimeSubscriptions != nil { - return *m.LifetimeSubscriptions - } - return 0 -} - -func (m *PublishedFileDetails) GetLifetimeFavorited() uint32 { - if m != nil && m.LifetimeFavorited != nil { - return *m.LifetimeFavorited - } - return 0 -} - -func (m *PublishedFileDetails) GetLifetimeFollowers() uint32 { - if m != nil && m.LifetimeFollowers != nil { - return *m.LifetimeFollowers - } - return 0 -} - -func (m *PublishedFileDetails) GetViews() uint32 { - if m != nil && m.Views != nil { - return *m.Views - } - return 0 -} - -func (m *PublishedFileDetails) GetImageWidth() uint32 { - if m != nil && m.ImageWidth != nil { - return *m.ImageWidth - } - return 0 -} - -func (m *PublishedFileDetails) GetImageHeight() uint32 { - if m != nil && m.ImageHeight != nil { - return *m.ImageHeight - } - return 0 -} - -func (m *PublishedFileDetails) GetImageUrl() string { - if m != nil && m.ImageUrl != nil { - return *m.ImageUrl - } - return "" -} - -func (m *PublishedFileDetails) GetSpoilerTag() bool { - if m != nil && m.SpoilerTag != nil { - return *m.SpoilerTag - } - return false -} - -func (m *PublishedFileDetails) GetShortcutid() uint32 { - if m != nil && m.Shortcutid != nil { - return *m.Shortcutid - } - return 0 -} - -func (m *PublishedFileDetails) GetShortcutname() string { - if m != nil && m.Shortcutname != nil { - return *m.Shortcutname - } - return "" -} - -func (m *PublishedFileDetails) GetNumChildren() uint32 { - if m != nil && m.NumChildren != nil { - return *m.NumChildren - } - return 0 -} - -func (m *PublishedFileDetails) GetNumReports() uint32 { - if m != nil && m.NumReports != nil { - return *m.NumReports - } - return 0 -} - -func (m *PublishedFileDetails) GetPreviews() []*PublishedFileDetails_Preview { - if m != nil { - return m.Previews - } - return nil -} - -func (m *PublishedFileDetails) GetTags() []*PublishedFileDetails_Tag { - if m != nil { - return m.Tags - } - return nil -} - -func (m *PublishedFileDetails) GetChildren() []*PublishedFileDetails_Child { - if m != nil { - return m.Children - } - return nil -} - -func (m *PublishedFileDetails) GetKvtags() []*PublishedFileDetails_KVTag { - if m != nil { - return m.Kvtags - } - return nil -} - -func (m *PublishedFileDetails) GetVoteData() *PublishedFileDetails_VoteData { - if m != nil { - return m.VoteData - } - return nil -} - -func (m *PublishedFileDetails) GetTimeSubscribed() uint32 { - if m != nil && m.TimeSubscribed != nil { - return *m.TimeSubscribed - } - return 0 -} - -func (m *PublishedFileDetails) GetForSaleData() *PublishedFileDetails_ForSaleData { - if m != nil { - return m.ForSaleData - } - return nil -} - -func (m *PublishedFileDetails) GetMetadata() string { - if m != nil && m.Metadata != nil { - return *m.Metadata - } - return "" -} - -func (m *PublishedFileDetails) GetIncompatibleActor() uint64 { - if m != nil && m.IncompatibleActor != nil { - return *m.IncompatibleActor - } - return 0 -} - -func (m *PublishedFileDetails) GetIncompatibleTimestamp() uint32 { - if m != nil && m.IncompatibleTimestamp != nil { - return *m.IncompatibleTimestamp - } - return 0 -} - -func (m *PublishedFileDetails) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_PublishedFileDetails_Language -} - -type PublishedFileDetails_Tag struct { - Tag *string `protobuf:"bytes,1,opt,name=tag" json:"tag,omitempty"` - Adminonly *bool `protobuf:"varint,2,opt,name=adminonly" json:"adminonly,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails_Tag) Reset() { *m = PublishedFileDetails_Tag{} } -func (m *PublishedFileDetails_Tag) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails_Tag) ProtoMessage() {} -func (*PublishedFileDetails_Tag) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{9, 0} } - -func (m *PublishedFileDetails_Tag) GetTag() string { - if m != nil && m.Tag != nil { - return *m.Tag - } - return "" -} - -func (m *PublishedFileDetails_Tag) GetAdminonly() bool { - if m != nil && m.Adminonly != nil { - return *m.Adminonly - } - return false -} - -type PublishedFileDetails_Preview struct { - Previewid *uint64 `protobuf:"varint,1,opt,name=previewid" json:"previewid,omitempty"` - Sortorder *uint32 `protobuf:"varint,2,opt,name=sortorder" json:"sortorder,omitempty"` - Url *string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"` - Size *uint32 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` - Filename *string `protobuf:"bytes,5,opt,name=filename" json:"filename,omitempty"` - Youtubevideoid *string `protobuf:"bytes,6,opt,name=youtubevideoid" json:"youtubevideoid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails_Preview) Reset() { *m = PublishedFileDetails_Preview{} } -func (m *PublishedFileDetails_Preview) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails_Preview) ProtoMessage() {} -func (*PublishedFileDetails_Preview) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{9, 1} } - -func (m *PublishedFileDetails_Preview) GetPreviewid() uint64 { - if m != nil && m.Previewid != nil { - return *m.Previewid - } - return 0 -} - -func (m *PublishedFileDetails_Preview) GetSortorder() uint32 { - if m != nil && m.Sortorder != nil { - return *m.Sortorder - } - return 0 -} - -func (m *PublishedFileDetails_Preview) GetUrl() string { - if m != nil && m.Url != nil { - return *m.Url - } - return "" -} - -func (m *PublishedFileDetails_Preview) GetSize() uint32 { - if m != nil && m.Size != nil { - return *m.Size - } - return 0 -} - -func (m *PublishedFileDetails_Preview) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *PublishedFileDetails_Preview) GetYoutubevideoid() string { - if m != nil && m.Youtubevideoid != nil { - return *m.Youtubevideoid - } - return "" -} - -type PublishedFileDetails_Child struct { - Publishedfileid *uint64 `protobuf:"varint,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - Sortorder *uint32 `protobuf:"varint,2,opt,name=sortorder" json:"sortorder,omitempty"` - FileType *uint32 `protobuf:"varint,3,opt,name=file_type" json:"file_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails_Child) Reset() { *m = PublishedFileDetails_Child{} } -func (m *PublishedFileDetails_Child) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails_Child) ProtoMessage() {} -func (*PublishedFileDetails_Child) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{9, 2} } - -func (m *PublishedFileDetails_Child) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *PublishedFileDetails_Child) GetSortorder() uint32 { - if m != nil && m.Sortorder != nil { - return *m.Sortorder - } - return 0 -} - -func (m *PublishedFileDetails_Child) GetFileType() uint32 { - if m != nil && m.FileType != nil { - return *m.FileType - } - return 0 -} - -type PublishedFileDetails_KVTag struct { - Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails_KVTag) Reset() { *m = PublishedFileDetails_KVTag{} } -func (m *PublishedFileDetails_KVTag) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails_KVTag) ProtoMessage() {} -func (*PublishedFileDetails_KVTag) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{9, 3} } - -func (m *PublishedFileDetails_KVTag) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *PublishedFileDetails_KVTag) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type PublishedFileDetails_VoteData struct { - Score *float32 `protobuf:"fixed32,1,opt,name=score" json:"score,omitempty"` - VotesUp *uint32 `protobuf:"varint,2,opt,name=votes_up" json:"votes_up,omitempty"` - VotesDown *uint32 `protobuf:"varint,3,opt,name=votes_down" json:"votes_down,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails_VoteData) Reset() { *m = PublishedFileDetails_VoteData{} } -func (m *PublishedFileDetails_VoteData) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails_VoteData) ProtoMessage() {} -func (*PublishedFileDetails_VoteData) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{9, 4} -} - -func (m *PublishedFileDetails_VoteData) GetScore() float32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *PublishedFileDetails_VoteData) GetVotesUp() uint32 { - if m != nil && m.VotesUp != nil { - return *m.VotesUp - } - return 0 -} - -func (m *PublishedFileDetails_VoteData) GetVotesDown() uint32 { - if m != nil && m.VotesDown != nil { - return *m.VotesDown - } - return 0 -} - -type PublishedFileDetails_ForSaleData struct { - IsForSale *bool `protobuf:"varint,1,opt,name=is_for_sale" json:"is_for_sale,omitempty"` - PriceCategory *uint32 `protobuf:"varint,2,opt,name=price_category" json:"price_category,omitempty"` - Estatus *PublishedFileDetails_EPublishedFileForSaleStatus `protobuf:"varint,3,opt,name=estatus,enum=PublishedFileDetails_EPublishedFileForSaleStatus,def=0" json:"estatus,omitempty"` - PriceCategoryFloor *uint32 `protobuf:"varint,4,opt,name=price_category_floor" json:"price_category_floor,omitempty"` - PriceIsPayWhatYouWant *bool `protobuf:"varint,5,opt,name=price_is_pay_what_you_want" json:"price_is_pay_what_you_want,omitempty"` - DiscountPercentage *uint32 `protobuf:"varint,6,opt,name=discount_percentage" json:"discount_percentage,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PublishedFileDetails_ForSaleData) Reset() { *m = PublishedFileDetails_ForSaleData{} } -func (m *PublishedFileDetails_ForSaleData) String() string { return proto.CompactTextString(m) } -func (*PublishedFileDetails_ForSaleData) ProtoMessage() {} -func (*PublishedFileDetails_ForSaleData) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{9, 5} -} - -const Default_PublishedFileDetails_ForSaleData_Estatus PublishedFileDetails_EPublishedFileForSaleStatus = PublishedFileDetails_k_PFFSS_NotForSale - -func (m *PublishedFileDetails_ForSaleData) GetIsForSale() bool { - if m != nil && m.IsForSale != nil { - return *m.IsForSale - } - return false -} - -func (m *PublishedFileDetails_ForSaleData) GetPriceCategory() uint32 { - if m != nil && m.PriceCategory != nil { - return *m.PriceCategory - } - return 0 -} - -func (m *PublishedFileDetails_ForSaleData) GetEstatus() PublishedFileDetails_EPublishedFileForSaleStatus { - if m != nil && m.Estatus != nil { - return *m.Estatus - } - return Default_PublishedFileDetails_ForSaleData_Estatus -} - -func (m *PublishedFileDetails_ForSaleData) GetPriceCategoryFloor() uint32 { - if m != nil && m.PriceCategoryFloor != nil { - return *m.PriceCategoryFloor - } - return 0 -} - -func (m *PublishedFileDetails_ForSaleData) GetPriceIsPayWhatYouWant() bool { - if m != nil && m.PriceIsPayWhatYouWant != nil { - return *m.PriceIsPayWhatYouWant - } - return false -} - -func (m *PublishedFileDetails_ForSaleData) GetDiscountPercentage() uint32 { - if m != nil && m.DiscountPercentage != nil { - return *m.DiscountPercentage - } - return 0 -} - -type CPublishedFile_GetDetails_Response struct { - Publishedfiledetails []*PublishedFileDetails `protobuf:"bytes,1,rep,name=publishedfiledetails" json:"publishedfiledetails,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetDetails_Response) Reset() { *m = CPublishedFile_GetDetails_Response{} } -func (m *CPublishedFile_GetDetails_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetDetails_Response) ProtoMessage() {} -func (*CPublishedFile_GetDetails_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{10} -} - -func (m *CPublishedFile_GetDetails_Response) GetPublishedfiledetails() []*PublishedFileDetails { - if m != nil { - return m.Publishedfiledetails - } - return nil -} - -type CPublishedFile_GetItemInfo_Request struct { - AppId *uint32 `protobuf:"varint,1,opt,name=app_id" json:"app_id,omitempty"` - LastTimeUpdated *uint32 `protobuf:"varint,2,opt,name=last_time_updated" json:"last_time_updated,omitempty"` - WorkshopItems []*CPublishedFile_GetItemInfo_Request_WorkshopItem `protobuf:"bytes,3,rep,name=workshop_items" json:"workshop_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetItemInfo_Request) Reset() { *m = CPublishedFile_GetItemInfo_Request{} } -func (m *CPublishedFile_GetItemInfo_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetItemInfo_Request) ProtoMessage() {} -func (*CPublishedFile_GetItemInfo_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{11} -} - -func (m *CPublishedFile_GetItemInfo_Request) GetAppId() uint32 { - if m != nil && m.AppId != nil { - return *m.AppId - } - return 0 -} - -func (m *CPublishedFile_GetItemInfo_Request) GetLastTimeUpdated() uint32 { - if m != nil && m.LastTimeUpdated != nil { - return *m.LastTimeUpdated - } - return 0 -} - -func (m *CPublishedFile_GetItemInfo_Request) GetWorkshopItems() []*CPublishedFile_GetItemInfo_Request_WorkshopItem { - if m != nil { - return m.WorkshopItems - } - return nil -} - -type CPublishedFile_GetItemInfo_Request_WorkshopItem struct { - PublishedFileId *uint64 `protobuf:"fixed64,1,opt,name=published_file_id" json:"published_file_id,omitempty"` - TimeUpdated *uint32 `protobuf:"varint,2,opt,name=time_updated" json:"time_updated,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetItemInfo_Request_WorkshopItem) Reset() { - *m = CPublishedFile_GetItemInfo_Request_WorkshopItem{} -} -func (m *CPublishedFile_GetItemInfo_Request_WorkshopItem) String() string { - return proto.CompactTextString(m) -} -func (*CPublishedFile_GetItemInfo_Request_WorkshopItem) ProtoMessage() {} -func (*CPublishedFile_GetItemInfo_Request_WorkshopItem) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{11, 0} -} - -func (m *CPublishedFile_GetItemInfo_Request_WorkshopItem) GetPublishedFileId() uint64 { - if m != nil && m.PublishedFileId != nil { - return *m.PublishedFileId - } - return 0 -} - -func (m *CPublishedFile_GetItemInfo_Request_WorkshopItem) GetTimeUpdated() uint32 { - if m != nil && m.TimeUpdated != nil { - return *m.TimeUpdated - } - return 0 -} - -type CPublishedFile_GetItemInfo_Response struct { - UpdateTime *uint32 `protobuf:"varint,1,opt,name=update_time" json:"update_time,omitempty"` - WorkshopItems []*CPublishedFile_GetItemInfo_Response_WorkshopItemInfo `protobuf:"bytes,2,rep,name=workshop_items" json:"workshop_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetItemInfo_Response) Reset() { *m = CPublishedFile_GetItemInfo_Response{} } -func (m *CPublishedFile_GetItemInfo_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetItemInfo_Response) ProtoMessage() {} -func (*CPublishedFile_GetItemInfo_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{12} -} - -func (m *CPublishedFile_GetItemInfo_Response) GetUpdateTime() uint32 { - if m != nil && m.UpdateTime != nil { - return *m.UpdateTime - } - return 0 -} - -func (m *CPublishedFile_GetItemInfo_Response) GetWorkshopItems() []*CPublishedFile_GetItemInfo_Response_WorkshopItemInfo { - if m != nil { - return m.WorkshopItems - } - return nil -} - -type CPublishedFile_GetItemInfo_Response_WorkshopItemInfo struct { - PublishedFileId *uint64 `protobuf:"fixed64,1,opt,name=published_file_id" json:"published_file_id,omitempty"` - TimeUpdated *uint32 `protobuf:"varint,2,opt,name=time_updated" json:"time_updated,omitempty"` - ManifestId *uint64 `protobuf:"fixed64,3,opt,name=manifest_id" json:"manifest_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) Reset() { - *m = CPublishedFile_GetItemInfo_Response_WorkshopItemInfo{} -} -func (m *CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) String() string { - return proto.CompactTextString(m) -} -func (*CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) ProtoMessage() {} -func (*CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{12, 0} -} - -func (m *CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) GetPublishedFileId() uint64 { - if m != nil && m.PublishedFileId != nil { - return *m.PublishedFileId - } - return 0 -} - -func (m *CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) GetTimeUpdated() uint32 { - if m != nil && m.TimeUpdated != nil { - return *m.TimeUpdated - } - return 0 -} - -func (m *CPublishedFile_GetItemInfo_Response_WorkshopItemInfo) GetManifestId() uint64 { - if m != nil && m.ManifestId != nil { - return *m.ManifestId - } - return 0 -} - -type CPublishedFile_GetUserFiles_Request struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - Appid *uint32 `protobuf:"varint,2,opt,name=appid" json:"appid,omitempty"` - Page *uint32 `protobuf:"varint,4,opt,name=page,def=1" json:"page,omitempty"` - Numperpage *uint32 `protobuf:"varint,5,opt,name=numperpage,def=1" json:"numperpage,omitempty"` - Type *string `protobuf:"bytes,6,opt,name=type,def=myfiles" json:"type,omitempty"` - Sortmethod *string `protobuf:"bytes,7,opt,name=sortmethod,def=lastupdated" json:"sortmethod,omitempty"` - Privacy *uint32 `protobuf:"varint,9,opt,name=privacy" json:"privacy,omitempty"` - Requiredtags []string `protobuf:"bytes,10,rep,name=requiredtags" json:"requiredtags,omitempty"` - Excludedtags []string `protobuf:"bytes,11,rep,name=excludedtags" json:"excludedtags,omitempty"` - RequiredKvTags []*CPublishedFile_GetUserFiles_Request_KVTag `protobuf:"bytes,30,rep,name=required_kv_tags" json:"required_kv_tags,omitempty"` - Filetype *uint32 `protobuf:"varint,14,opt,name=filetype" json:"filetype,omitempty"` - CreatorAppid *uint32 `protobuf:"varint,15,opt,name=creator_appid" json:"creator_appid,omitempty"` - MatchCloudFilename *string `protobuf:"bytes,16,opt,name=match_cloud_filename" json:"match_cloud_filename,omitempty"` - CacheMaxAgeSeconds *uint32 `protobuf:"varint,27,opt,name=cache_max_age_seconds,def=0" json:"cache_max_age_seconds,omitempty"` - Language *int32 `protobuf:"varint,29,opt,name=language,def=0" json:"language,omitempty"` - Totalonly *bool `protobuf:"varint,17,opt,name=totalonly" json:"totalonly,omitempty"` - IdsOnly *bool `protobuf:"varint,18,opt,name=ids_only" json:"ids_only,omitempty"` - ReturnVoteData *bool `protobuf:"varint,19,opt,name=return_vote_data,def=1" json:"return_vote_data,omitempty"` - ReturnTags *bool `protobuf:"varint,20,opt,name=return_tags" json:"return_tags,omitempty"` - ReturnKvTags *bool `protobuf:"varint,21,opt,name=return_kv_tags,def=1" json:"return_kv_tags,omitempty"` - ReturnPreviews *bool `protobuf:"varint,22,opt,name=return_previews" json:"return_previews,omitempty"` - ReturnChildren *bool `protobuf:"varint,23,opt,name=return_children" json:"return_children,omitempty"` - ReturnShortDescription *bool `protobuf:"varint,24,opt,name=return_short_description,def=1" json:"return_short_description,omitempty"` - ReturnForSaleData *bool `protobuf:"varint,26,opt,name=return_for_sale_data" json:"return_for_sale_data,omitempty"` - ReturnMetadata *bool `protobuf:"varint,28,opt,name=return_metadata,def=0" json:"return_metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetUserFiles_Request) Reset() { *m = CPublishedFile_GetUserFiles_Request{} } -func (m *CPublishedFile_GetUserFiles_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetUserFiles_Request) ProtoMessage() {} -func (*CPublishedFile_GetUserFiles_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{13} -} - -const Default_CPublishedFile_GetUserFiles_Request_Page uint32 = 1 -const Default_CPublishedFile_GetUserFiles_Request_Numperpage uint32 = 1 -const Default_CPublishedFile_GetUserFiles_Request_Type string = "myfiles" -const Default_CPublishedFile_GetUserFiles_Request_Sortmethod string = "lastupdated" -const Default_CPublishedFile_GetUserFiles_Request_CacheMaxAgeSeconds uint32 = 0 -const Default_CPublishedFile_GetUserFiles_Request_Language int32 = 0 -const Default_CPublishedFile_GetUserFiles_Request_ReturnVoteData bool = true -const Default_CPublishedFile_GetUserFiles_Request_ReturnKvTags bool = true -const Default_CPublishedFile_GetUserFiles_Request_ReturnShortDescription bool = true -const Default_CPublishedFile_GetUserFiles_Request_ReturnMetadata bool = false - -func (m *CPublishedFile_GetUserFiles_Request) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Request) GetPage() uint32 { - if m != nil && m.Page != nil { - return *m.Page - } - return Default_CPublishedFile_GetUserFiles_Request_Page -} - -func (m *CPublishedFile_GetUserFiles_Request) GetNumperpage() uint32 { - if m != nil && m.Numperpage != nil { - return *m.Numperpage - } - return Default_CPublishedFile_GetUserFiles_Request_Numperpage -} - -func (m *CPublishedFile_GetUserFiles_Request) GetType() string { - if m != nil && m.Type != nil { - return *m.Type - } - return Default_CPublishedFile_GetUserFiles_Request_Type -} - -func (m *CPublishedFile_GetUserFiles_Request) GetSortmethod() string { - if m != nil && m.Sortmethod != nil { - return *m.Sortmethod - } - return Default_CPublishedFile_GetUserFiles_Request_Sortmethod -} - -func (m *CPublishedFile_GetUserFiles_Request) GetPrivacy() uint32 { - if m != nil && m.Privacy != nil { - return *m.Privacy - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Request) GetRequiredtags() []string { - if m != nil { - return m.Requiredtags - } - return nil -} - -func (m *CPublishedFile_GetUserFiles_Request) GetExcludedtags() []string { - if m != nil { - return m.Excludedtags - } - return nil -} - -func (m *CPublishedFile_GetUserFiles_Request) GetRequiredKvTags() []*CPublishedFile_GetUserFiles_Request_KVTag { - if m != nil { - return m.RequiredKvTags - } - return nil -} - -func (m *CPublishedFile_GetUserFiles_Request) GetFiletype() uint32 { - if m != nil && m.Filetype != nil { - return *m.Filetype - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Request) GetCreatorAppid() uint32 { - if m != nil && m.CreatorAppid != nil { - return *m.CreatorAppid - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Request) GetMatchCloudFilename() string { - if m != nil && m.MatchCloudFilename != nil { - return *m.MatchCloudFilename - } - return "" -} - -func (m *CPublishedFile_GetUserFiles_Request) GetCacheMaxAgeSeconds() uint32 { - if m != nil && m.CacheMaxAgeSeconds != nil { - return *m.CacheMaxAgeSeconds - } - return Default_CPublishedFile_GetUserFiles_Request_CacheMaxAgeSeconds -} - -func (m *CPublishedFile_GetUserFiles_Request) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_CPublishedFile_GetUserFiles_Request_Language -} - -func (m *CPublishedFile_GetUserFiles_Request) GetTotalonly() bool { - if m != nil && m.Totalonly != nil { - return *m.Totalonly - } - return false -} - -func (m *CPublishedFile_GetUserFiles_Request) GetIdsOnly() bool { - if m != nil && m.IdsOnly != nil { - return *m.IdsOnly - } - return false -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnVoteData() bool { - if m != nil && m.ReturnVoteData != nil { - return *m.ReturnVoteData - } - return Default_CPublishedFile_GetUserFiles_Request_ReturnVoteData -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnTags() bool { - if m != nil && m.ReturnTags != nil { - return *m.ReturnTags - } - return false -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnKvTags() bool { - if m != nil && m.ReturnKvTags != nil { - return *m.ReturnKvTags - } - return Default_CPublishedFile_GetUserFiles_Request_ReturnKvTags -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnPreviews() bool { - if m != nil && m.ReturnPreviews != nil { - return *m.ReturnPreviews - } - return false -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnChildren() bool { - if m != nil && m.ReturnChildren != nil { - return *m.ReturnChildren - } - return false -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnShortDescription() bool { - if m != nil && m.ReturnShortDescription != nil { - return *m.ReturnShortDescription - } - return Default_CPublishedFile_GetUserFiles_Request_ReturnShortDescription -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnForSaleData() bool { - if m != nil && m.ReturnForSaleData != nil { - return *m.ReturnForSaleData - } - return false -} - -func (m *CPublishedFile_GetUserFiles_Request) GetReturnMetadata() bool { - if m != nil && m.ReturnMetadata != nil { - return *m.ReturnMetadata - } - return Default_CPublishedFile_GetUserFiles_Request_ReturnMetadata -} - -type CPublishedFile_GetUserFiles_Request_KVTag struct { - Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetUserFiles_Request_KVTag) Reset() { - *m = CPublishedFile_GetUserFiles_Request_KVTag{} -} -func (m *CPublishedFile_GetUserFiles_Request_KVTag) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetUserFiles_Request_KVTag) ProtoMessage() {} -func (*CPublishedFile_GetUserFiles_Request_KVTag) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{13, 0} -} - -func (m *CPublishedFile_GetUserFiles_Request_KVTag) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *CPublishedFile_GetUserFiles_Request_KVTag) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CPublishedFile_GetUserFiles_Response struct { - Total *uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` - Startindex *uint32 `protobuf:"varint,2,opt,name=startindex" json:"startindex,omitempty"` - Publishedfiledetails []*PublishedFileDetails `protobuf:"bytes,3,rep,name=publishedfiledetails" json:"publishedfiledetails,omitempty"` - Apps []*CPublishedFile_GetUserFiles_Response_App `protobuf:"bytes,4,rep,name=apps" json:"apps,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetUserFiles_Response) Reset() { *m = CPublishedFile_GetUserFiles_Response{} } -func (m *CPublishedFile_GetUserFiles_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetUserFiles_Response) ProtoMessage() {} -func (*CPublishedFile_GetUserFiles_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{14} -} - -func (m *CPublishedFile_GetUserFiles_Response) GetTotal() uint32 { - if m != nil && m.Total != nil { - return *m.Total - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Response) GetStartindex() uint32 { - if m != nil && m.Startindex != nil { - return *m.Startindex - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Response) GetPublishedfiledetails() []*PublishedFileDetails { - if m != nil { - return m.Publishedfiledetails - } - return nil -} - -func (m *CPublishedFile_GetUserFiles_Response) GetApps() []*CPublishedFile_GetUserFiles_Response_App { - if m != nil { - return m.Apps - } - return nil -} - -type CPublishedFile_GetUserFiles_Response_App struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Shortcutid *uint32 `protobuf:"varint,3,opt,name=shortcutid" json:"shortcutid,omitempty"` - Private *bool `protobuf:"varint,4,opt,name=private" json:"private,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetUserFiles_Response_App) Reset() { - *m = CPublishedFile_GetUserFiles_Response_App{} -} -func (m *CPublishedFile_GetUserFiles_Response_App) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetUserFiles_Response_App) ProtoMessage() {} -func (*CPublishedFile_GetUserFiles_Response_App) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{14, 0} -} - -func (m *CPublishedFile_GetUserFiles_Response_App) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Response_App) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CPublishedFile_GetUserFiles_Response_App) GetShortcutid() uint32 { - if m != nil && m.Shortcutid != nil { - return *m.Shortcutid - } - return 0 -} - -func (m *CPublishedFile_GetUserFiles_Response_App) GetPrivate() bool { - if m != nil && m.Private != nil { - return *m.Private - } - return false -} - -type CPublishedFile_Update_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Publishedfileid *uint64 `protobuf:"fixed64,2,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - Title *string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` - FileDescription *string `protobuf:"bytes,4,opt,name=file_description" json:"file_description,omitempty"` - Visibility *uint32 `protobuf:"varint,5,opt,name=visibility" json:"visibility,omitempty"` - Tags []string `protobuf:"bytes,6,rep,name=tags" json:"tags,omitempty"` - Filename *string `protobuf:"bytes,7,opt,name=filename" json:"filename,omitempty"` - PreviewFilename *string `protobuf:"bytes,8,opt,name=preview_filename" json:"preview_filename,omitempty"` - ImageWidth *uint32 `protobuf:"varint,15,opt,name=image_width" json:"image_width,omitempty"` - ImageHeight *uint32 `protobuf:"varint,16,opt,name=image_height" json:"image_height,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Update_Request) Reset() { *m = CPublishedFile_Update_Request{} } -func (m *CPublishedFile_Update_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Update_Request) ProtoMessage() {} -func (*CPublishedFile_Update_Request) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{15} } - -func (m *CPublishedFile_Update_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_Update_Request) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *CPublishedFile_Update_Request) GetTitle() string { - if m != nil && m.Title != nil { - return *m.Title - } - return "" -} - -func (m *CPublishedFile_Update_Request) GetFileDescription() string { - if m != nil && m.FileDescription != nil { - return *m.FileDescription - } - return "" -} - -func (m *CPublishedFile_Update_Request) GetVisibility() uint32 { - if m != nil && m.Visibility != nil { - return *m.Visibility - } - return 0 -} - -func (m *CPublishedFile_Update_Request) GetTags() []string { - if m != nil { - return m.Tags - } - return nil -} - -func (m *CPublishedFile_Update_Request) GetFilename() string { - if m != nil && m.Filename != nil { - return *m.Filename - } - return "" -} - -func (m *CPublishedFile_Update_Request) GetPreviewFilename() string { - if m != nil && m.PreviewFilename != nil { - return *m.PreviewFilename - } - return "" -} - -func (m *CPublishedFile_Update_Request) GetImageWidth() uint32 { - if m != nil && m.ImageWidth != nil { - return *m.ImageWidth - } - return 0 -} - -func (m *CPublishedFile_Update_Request) GetImageHeight() uint32 { - if m != nil && m.ImageHeight != nil { - return *m.ImageHeight - } - return 0 -} - -type CPublishedFile_Update_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_Update_Response) Reset() { *m = CPublishedFile_Update_Response{} } -func (m *CPublishedFile_Update_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_Update_Response) ProtoMessage() {} -func (*CPublishedFile_Update_Response) Descriptor() ([]byte, []int) { return publishedfile_fileDescriptor0, []int{16} } - -type CPublishedFile_GetChangeHistoryEntry_Request struct { - Publishedfileid *uint64 `protobuf:"fixed64,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - Timestamp *uint32 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - Language *int32 `protobuf:"varint,3,opt,name=language" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Request) Reset() { - *m = CPublishedFile_GetChangeHistoryEntry_Request{} -} -func (m *CPublishedFile_GetChangeHistoryEntry_Request) String() string { - return proto.CompactTextString(m) -} -func (*CPublishedFile_GetChangeHistoryEntry_Request) ProtoMessage() {} -func (*CPublishedFile_GetChangeHistoryEntry_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{17} -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Request) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Request) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Request) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return 0 -} - -type CPublishedFile_GetChangeHistoryEntry_Response struct { - ChangeDescription *string `protobuf:"bytes,1,opt,name=change_description" json:"change_description,omitempty"` - Language *int32 `protobuf:"varint,2,opt,name=language" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Response) Reset() { - *m = CPublishedFile_GetChangeHistoryEntry_Response{} -} -func (m *CPublishedFile_GetChangeHistoryEntry_Response) String() string { - return proto.CompactTextString(m) -} -func (*CPublishedFile_GetChangeHistoryEntry_Response) ProtoMessage() {} -func (*CPublishedFile_GetChangeHistoryEntry_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{18} -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Response) GetChangeDescription() string { - if m != nil && m.ChangeDescription != nil { - return *m.ChangeDescription - } - return "" -} - -func (m *CPublishedFile_GetChangeHistoryEntry_Response) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return 0 -} - -type CPublishedFile_GetChangeHistory_Request struct { - Publishedfileid *uint64 `protobuf:"fixed64,1,opt,name=publishedfileid" json:"publishedfileid,omitempty"` - TotalOnly *bool `protobuf:"varint,2,opt,name=total_only" json:"total_only,omitempty"` - Startindex *uint32 `protobuf:"varint,3,opt,name=startindex" json:"startindex,omitempty"` - Count *uint32 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"` - Language *int32 `protobuf:"varint,5,opt,name=language,def=0" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetChangeHistory_Request) Reset() { - *m = CPublishedFile_GetChangeHistory_Request{} -} -func (m *CPublishedFile_GetChangeHistory_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetChangeHistory_Request) ProtoMessage() {} -func (*CPublishedFile_GetChangeHistory_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{19} -} - -const Default_CPublishedFile_GetChangeHistory_Request_Language int32 = 0 - -func (m *CPublishedFile_GetChangeHistory_Request) GetPublishedfileid() uint64 { - if m != nil && m.Publishedfileid != nil { - return *m.Publishedfileid - } - return 0 -} - -func (m *CPublishedFile_GetChangeHistory_Request) GetTotalOnly() bool { - if m != nil && m.TotalOnly != nil { - return *m.TotalOnly - } - return false -} - -func (m *CPublishedFile_GetChangeHistory_Request) GetStartindex() uint32 { - if m != nil && m.Startindex != nil { - return *m.Startindex - } - return 0 -} - -func (m *CPublishedFile_GetChangeHistory_Request) GetCount() uint32 { - if m != nil && m.Count != nil { - return *m.Count - } - return 0 -} - -func (m *CPublishedFile_GetChangeHistory_Request) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_CPublishedFile_GetChangeHistory_Request_Language -} - -type CPublishedFile_GetChangeHistory_Response struct { - Changes []*CPublishedFile_GetChangeHistory_Response_ChangeLog `protobuf:"bytes,1,rep,name=changes" json:"changes,omitempty"` - Total *uint32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetChangeHistory_Response) Reset() { - *m = CPublishedFile_GetChangeHistory_Response{} -} -func (m *CPublishedFile_GetChangeHistory_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_GetChangeHistory_Response) ProtoMessage() {} -func (*CPublishedFile_GetChangeHistory_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{20} -} - -func (m *CPublishedFile_GetChangeHistory_Response) GetChanges() []*CPublishedFile_GetChangeHistory_Response_ChangeLog { - if m != nil { - return m.Changes - } - return nil -} - -func (m *CPublishedFile_GetChangeHistory_Response) GetTotal() uint32 { - if m != nil && m.Total != nil { - return *m.Total - } - return 0 -} - -type CPublishedFile_GetChangeHistory_Response_ChangeLog struct { - Timestamp *uint32 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - ChangeDescription *string `protobuf:"bytes,2,opt,name=change_description" json:"change_description,omitempty"` - Language *int32 `protobuf:"varint,3,opt,name=language" json:"language,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_GetChangeHistory_Response_ChangeLog) Reset() { - *m = CPublishedFile_GetChangeHistory_Response_ChangeLog{} -} -func (m *CPublishedFile_GetChangeHistory_Response_ChangeLog) String() string { - return proto.CompactTextString(m) -} -func (*CPublishedFile_GetChangeHistory_Response_ChangeLog) ProtoMessage() {} -func (*CPublishedFile_GetChangeHistory_Response_ChangeLog) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{20, 0} -} - -func (m *CPublishedFile_GetChangeHistory_Response_ChangeLog) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CPublishedFile_GetChangeHistory_Response_ChangeLog) GetChangeDescription() string { - if m != nil && m.ChangeDescription != nil { - return *m.ChangeDescription - } - return "" -} - -func (m *CPublishedFile_GetChangeHistory_Response_ChangeLog) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return 0 -} - -type CPublishedFile_RefreshVotingQueue_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - MatchingFileType *uint32 `protobuf:"varint,2,opt,name=matching_file_type" json:"matching_file_type,omitempty"` - Tags []string `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` - MatchAllTags *bool `protobuf:"varint,4,opt,name=match_all_tags,def=1" json:"match_all_tags,omitempty"` - ExcludedTags []string `protobuf:"bytes,5,rep,name=excluded_tags" json:"excluded_tags,omitempty"` - DesiredQueueSize *uint32 `protobuf:"varint,6,opt,name=desired_queue_size" json:"desired_queue_size,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_RefreshVotingQueue_Request) Reset() { - *m = CPublishedFile_RefreshVotingQueue_Request{} -} -func (m *CPublishedFile_RefreshVotingQueue_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_RefreshVotingQueue_Request) ProtoMessage() {} -func (*CPublishedFile_RefreshVotingQueue_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{21} -} - -const Default_CPublishedFile_RefreshVotingQueue_Request_MatchAllTags bool = true - -func (m *CPublishedFile_RefreshVotingQueue_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_RefreshVotingQueue_Request) GetMatchingFileType() uint32 { - if m != nil && m.MatchingFileType != nil { - return *m.MatchingFileType - } - return 0 -} - -func (m *CPublishedFile_RefreshVotingQueue_Request) GetTags() []string { - if m != nil { - return m.Tags - } - return nil -} - -func (m *CPublishedFile_RefreshVotingQueue_Request) GetMatchAllTags() bool { - if m != nil && m.MatchAllTags != nil { - return *m.MatchAllTags - } - return Default_CPublishedFile_RefreshVotingQueue_Request_MatchAllTags -} - -func (m *CPublishedFile_RefreshVotingQueue_Request) GetExcludedTags() []string { - if m != nil { - return m.ExcludedTags - } - return nil -} - -func (m *CPublishedFile_RefreshVotingQueue_Request) GetDesiredQueueSize() uint32 { - if m != nil && m.DesiredQueueSize != nil { - return *m.DesiredQueueSize - } - return 0 -} - -type CPublishedFile_RefreshVotingQueue_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_RefreshVotingQueue_Response) Reset() { - *m = CPublishedFile_RefreshVotingQueue_Response{} -} -func (m *CPublishedFile_RefreshVotingQueue_Response) String() string { - return proto.CompactTextString(m) -} -func (*CPublishedFile_RefreshVotingQueue_Response) ProtoMessage() {} -func (*CPublishedFile_RefreshVotingQueue_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{22} -} - -type CPublishedFile_QueryFiles_Request struct { - QueryType *uint32 `protobuf:"varint,1,opt,name=query_type" json:"query_type,omitempty"` - Page *uint32 `protobuf:"varint,2,opt,name=page" json:"page,omitempty"` - Numperpage *uint32 `protobuf:"varint,3,opt,name=numperpage,def=1" json:"numperpage,omitempty"` - CreatorAppid *uint32 `protobuf:"varint,4,opt,name=creator_appid" json:"creator_appid,omitempty"` - Appid *uint32 `protobuf:"varint,5,opt,name=appid" json:"appid,omitempty"` - Requiredtags []string `protobuf:"bytes,6,rep,name=requiredtags" json:"requiredtags,omitempty"` - Excludedtags []string `protobuf:"bytes,7,rep,name=excludedtags" json:"excludedtags,omitempty"` - MatchAllTags *bool `protobuf:"varint,8,opt,name=match_all_tags,def=1" json:"match_all_tags,omitempty"` - RequiredFlags []string `protobuf:"bytes,9,rep,name=required_flags" json:"required_flags,omitempty"` - OmittedFlags []string `protobuf:"bytes,10,rep,name=omitted_flags" json:"omitted_flags,omitempty"` - SearchText *string `protobuf:"bytes,11,opt,name=search_text" json:"search_text,omitempty"` - Filetype *uint32 `protobuf:"varint,12,opt,name=filetype" json:"filetype,omitempty"` - ChildPublishedfileid *uint64 `protobuf:"fixed64,13,opt,name=child_publishedfileid" json:"child_publishedfileid,omitempty"` - Days *uint32 `protobuf:"varint,14,opt,name=days" json:"days,omitempty"` - IncludeRecentVotesOnly *bool `protobuf:"varint,15,opt,name=include_recent_votes_only" json:"include_recent_votes_only,omitempty"` - CacheMaxAgeSeconds *uint32 `protobuf:"varint,31,opt,name=cache_max_age_seconds,def=0" json:"cache_max_age_seconds,omitempty"` - Language *int32 `protobuf:"varint,33,opt,name=language,def=0" json:"language,omitempty"` - RequiredKvTags []*CPublishedFile_QueryFiles_Request_KVTag `protobuf:"bytes,34,rep,name=required_kv_tags" json:"required_kv_tags,omitempty"` - Totalonly *bool `protobuf:"varint,16,opt,name=totalonly" json:"totalonly,omitempty"` - ReturnVoteData *bool `protobuf:"varint,17,opt,name=return_vote_data" json:"return_vote_data,omitempty"` - ReturnTags *bool `protobuf:"varint,18,opt,name=return_tags" json:"return_tags,omitempty"` - ReturnKvTags *bool `protobuf:"varint,19,opt,name=return_kv_tags" json:"return_kv_tags,omitempty"` - ReturnPreviews *bool `protobuf:"varint,20,opt,name=return_previews" json:"return_previews,omitempty"` - ReturnChildren *bool `protobuf:"varint,21,opt,name=return_children" json:"return_children,omitempty"` - ReturnShortDescription *bool `protobuf:"varint,22,opt,name=return_short_description" json:"return_short_description,omitempty"` - ReturnForSaleData *bool `protobuf:"varint,30,opt,name=return_for_sale_data" json:"return_for_sale_data,omitempty"` - ReturnMetadata *bool `protobuf:"varint,32,opt,name=return_metadata,def=0" json:"return_metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_QueryFiles_Request) Reset() { *m = CPublishedFile_QueryFiles_Request{} } -func (m *CPublishedFile_QueryFiles_Request) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_QueryFiles_Request) ProtoMessage() {} -func (*CPublishedFile_QueryFiles_Request) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{23} -} - -const Default_CPublishedFile_QueryFiles_Request_Numperpage uint32 = 1 -const Default_CPublishedFile_QueryFiles_Request_MatchAllTags bool = true -const Default_CPublishedFile_QueryFiles_Request_CacheMaxAgeSeconds uint32 = 0 -const Default_CPublishedFile_QueryFiles_Request_Language int32 = 0 -const Default_CPublishedFile_QueryFiles_Request_ReturnMetadata bool = false - -func (m *CPublishedFile_QueryFiles_Request) GetQueryType() uint32 { - if m != nil && m.QueryType != nil { - return *m.QueryType - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetPage() uint32 { - if m != nil && m.Page != nil { - return *m.Page - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetNumperpage() uint32 { - if m != nil && m.Numperpage != nil { - return *m.Numperpage - } - return Default_CPublishedFile_QueryFiles_Request_Numperpage -} - -func (m *CPublishedFile_QueryFiles_Request) GetCreatorAppid() uint32 { - if m != nil && m.CreatorAppid != nil { - return *m.CreatorAppid - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetRequiredtags() []string { - if m != nil { - return m.Requiredtags - } - return nil -} - -func (m *CPublishedFile_QueryFiles_Request) GetExcludedtags() []string { - if m != nil { - return m.Excludedtags - } - return nil -} - -func (m *CPublishedFile_QueryFiles_Request) GetMatchAllTags() bool { - if m != nil && m.MatchAllTags != nil { - return *m.MatchAllTags - } - return Default_CPublishedFile_QueryFiles_Request_MatchAllTags -} - -func (m *CPublishedFile_QueryFiles_Request) GetRequiredFlags() []string { - if m != nil { - return m.RequiredFlags - } - return nil -} - -func (m *CPublishedFile_QueryFiles_Request) GetOmittedFlags() []string { - if m != nil { - return m.OmittedFlags - } - return nil -} - -func (m *CPublishedFile_QueryFiles_Request) GetSearchText() string { - if m != nil && m.SearchText != nil { - return *m.SearchText - } - return "" -} - -func (m *CPublishedFile_QueryFiles_Request) GetFiletype() uint32 { - if m != nil && m.Filetype != nil { - return *m.Filetype - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetChildPublishedfileid() uint64 { - if m != nil && m.ChildPublishedfileid != nil { - return *m.ChildPublishedfileid - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetDays() uint32 { - if m != nil && m.Days != nil { - return *m.Days - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Request) GetIncludeRecentVotesOnly() bool { - if m != nil && m.IncludeRecentVotesOnly != nil { - return *m.IncludeRecentVotesOnly - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetCacheMaxAgeSeconds() uint32 { - if m != nil && m.CacheMaxAgeSeconds != nil { - return *m.CacheMaxAgeSeconds - } - return Default_CPublishedFile_QueryFiles_Request_CacheMaxAgeSeconds -} - -func (m *CPublishedFile_QueryFiles_Request) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return Default_CPublishedFile_QueryFiles_Request_Language -} - -func (m *CPublishedFile_QueryFiles_Request) GetRequiredKvTags() []*CPublishedFile_QueryFiles_Request_KVTag { - if m != nil { - return m.RequiredKvTags - } - return nil -} - -func (m *CPublishedFile_QueryFiles_Request) GetTotalonly() bool { - if m != nil && m.Totalonly != nil { - return *m.Totalonly - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnVoteData() bool { - if m != nil && m.ReturnVoteData != nil { - return *m.ReturnVoteData - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnTags() bool { - if m != nil && m.ReturnTags != nil { - return *m.ReturnTags - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnKvTags() bool { - if m != nil && m.ReturnKvTags != nil { - return *m.ReturnKvTags - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnPreviews() bool { - if m != nil && m.ReturnPreviews != nil { - return *m.ReturnPreviews - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnChildren() bool { - if m != nil && m.ReturnChildren != nil { - return *m.ReturnChildren - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnShortDescription() bool { - if m != nil && m.ReturnShortDescription != nil { - return *m.ReturnShortDescription - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnForSaleData() bool { - if m != nil && m.ReturnForSaleData != nil { - return *m.ReturnForSaleData - } - return false -} - -func (m *CPublishedFile_QueryFiles_Request) GetReturnMetadata() bool { - if m != nil && m.ReturnMetadata != nil { - return *m.ReturnMetadata - } - return Default_CPublishedFile_QueryFiles_Request_ReturnMetadata -} - -type CPublishedFile_QueryFiles_Request_KVTag struct { - Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_QueryFiles_Request_KVTag) Reset() { - *m = CPublishedFile_QueryFiles_Request_KVTag{} -} -func (m *CPublishedFile_QueryFiles_Request_KVTag) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_QueryFiles_Request_KVTag) ProtoMessage() {} -func (*CPublishedFile_QueryFiles_Request_KVTag) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{23, 0} -} - -func (m *CPublishedFile_QueryFiles_Request_KVTag) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *CPublishedFile_QueryFiles_Request_KVTag) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CPublishedFile_QueryFiles_Response struct { - Total *uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` - Publishedfiledetails []*PublishedFileDetails `protobuf:"bytes,2,rep,name=publishedfiledetails" json:"publishedfiledetails,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CPublishedFile_QueryFiles_Response) Reset() { *m = CPublishedFile_QueryFiles_Response{} } -func (m *CPublishedFile_QueryFiles_Response) String() string { return proto.CompactTextString(m) } -func (*CPublishedFile_QueryFiles_Response) ProtoMessage() {} -func (*CPublishedFile_QueryFiles_Response) Descriptor() ([]byte, []int) { - return publishedfile_fileDescriptor0, []int{24} -} - -func (m *CPublishedFile_QueryFiles_Response) GetTotal() uint32 { - if m != nil && m.Total != nil { - return *m.Total - } - return 0 -} - -func (m *CPublishedFile_QueryFiles_Response) GetPublishedfiledetails() []*PublishedFileDetails { - if m != nil { - return m.Publishedfiledetails - } - return nil -} - -func init() { - proto.RegisterType((*CPublishedFile_Subscribe_Request)(nil), "CPublishedFile_Subscribe_Request") - proto.RegisterType((*CPublishedFile_Subscribe_Response)(nil), "CPublishedFile_Subscribe_Response") - proto.RegisterType((*CPublishedFile_Unsubscribe_Request)(nil), "CPublishedFile_Unsubscribe_Request") - proto.RegisterType((*CPublishedFile_Unsubscribe_Response)(nil), "CPublishedFile_Unsubscribe_Response") - proto.RegisterType((*CPublishedFile_CanSubscribe_Request)(nil), "CPublishedFile_CanSubscribe_Request") - proto.RegisterType((*CPublishedFile_CanSubscribe_Response)(nil), "CPublishedFile_CanSubscribe_Response") - proto.RegisterType((*CPublishedFile_Publish_Request)(nil), "CPublishedFile_Publish_Request") - proto.RegisterType((*CPublishedFile_Publish_Response)(nil), "CPublishedFile_Publish_Response") - proto.RegisterType((*CPublishedFile_GetDetails_Request)(nil), "CPublishedFile_GetDetails_Request") - proto.RegisterType((*PublishedFileDetails)(nil), "PublishedFileDetails") - proto.RegisterType((*PublishedFileDetails_Tag)(nil), "PublishedFileDetails.Tag") - proto.RegisterType((*PublishedFileDetails_Preview)(nil), "PublishedFileDetails.Preview") - proto.RegisterType((*PublishedFileDetails_Child)(nil), "PublishedFileDetails.Child") - proto.RegisterType((*PublishedFileDetails_KVTag)(nil), "PublishedFileDetails.KVTag") - proto.RegisterType((*PublishedFileDetails_VoteData)(nil), "PublishedFileDetails.VoteData") - proto.RegisterType((*PublishedFileDetails_ForSaleData)(nil), "PublishedFileDetails.ForSaleData") - proto.RegisterType((*CPublishedFile_GetDetails_Response)(nil), "CPublishedFile_GetDetails_Response") - proto.RegisterType((*CPublishedFile_GetItemInfo_Request)(nil), "CPublishedFile_GetItemInfo_Request") - proto.RegisterType((*CPublishedFile_GetItemInfo_Request_WorkshopItem)(nil), "CPublishedFile_GetItemInfo_Request.WorkshopItem") - proto.RegisterType((*CPublishedFile_GetItemInfo_Response)(nil), "CPublishedFile_GetItemInfo_Response") - proto.RegisterType((*CPublishedFile_GetItemInfo_Response_WorkshopItemInfo)(nil), "CPublishedFile_GetItemInfo_Response.WorkshopItemInfo") - proto.RegisterType((*CPublishedFile_GetUserFiles_Request)(nil), "CPublishedFile_GetUserFiles_Request") - proto.RegisterType((*CPublishedFile_GetUserFiles_Request_KVTag)(nil), "CPublishedFile_GetUserFiles_Request.KVTag") - proto.RegisterType((*CPublishedFile_GetUserFiles_Response)(nil), "CPublishedFile_GetUserFiles_Response") - proto.RegisterType((*CPublishedFile_GetUserFiles_Response_App)(nil), "CPublishedFile_GetUserFiles_Response.App") - proto.RegisterType((*CPublishedFile_Update_Request)(nil), "CPublishedFile_Update_Request") - proto.RegisterType((*CPublishedFile_Update_Response)(nil), "CPublishedFile_Update_Response") - proto.RegisterType((*CPublishedFile_GetChangeHistoryEntry_Request)(nil), "CPublishedFile_GetChangeHistoryEntry_Request") - proto.RegisterType((*CPublishedFile_GetChangeHistoryEntry_Response)(nil), "CPublishedFile_GetChangeHistoryEntry_Response") - proto.RegisterType((*CPublishedFile_GetChangeHistory_Request)(nil), "CPublishedFile_GetChangeHistory_Request") - proto.RegisterType((*CPublishedFile_GetChangeHistory_Response)(nil), "CPublishedFile_GetChangeHistory_Response") - proto.RegisterType((*CPublishedFile_GetChangeHistory_Response_ChangeLog)(nil), "CPublishedFile_GetChangeHistory_Response.ChangeLog") - proto.RegisterType((*CPublishedFile_RefreshVotingQueue_Request)(nil), "CPublishedFile_RefreshVotingQueue_Request") - proto.RegisterType((*CPublishedFile_RefreshVotingQueue_Response)(nil), "CPublishedFile_RefreshVotingQueue_Response") - proto.RegisterType((*CPublishedFile_QueryFiles_Request)(nil), "CPublishedFile_QueryFiles_Request") - proto.RegisterType((*CPublishedFile_QueryFiles_Request_KVTag)(nil), "CPublishedFile_QueryFiles_Request.KVTag") - proto.RegisterType((*CPublishedFile_QueryFiles_Response)(nil), "CPublishedFile_QueryFiles_Response") - proto.RegisterEnum("PublishedFileDetails_EPublishedFileForSaleStatus", PublishedFileDetails_EPublishedFileForSaleStatus_name, PublishedFileDetails_EPublishedFileForSaleStatus_value) -} - -var publishedfile_fileDescriptor0 = []byte{ - // 4973 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x5b, 0x4b, 0x70, 0x1b, 0x47, - 0x7a, 0x0e, 0xf8, 0x66, 0x53, 0x14, 0xa9, 0x31, 0x69, 0x43, 0xd0, 0x4a, 0x1a, 0x41, 0x92, 0x45, - 0x4a, 0xd4, 0x58, 0x0f, 0xcb, 0x92, 0x69, 0x7b, 0x6d, 0x41, 0x24, 0x6d, 0xda, 0x7a, 0x50, 0x24, - 0xa5, 0xb5, 0xe3, 0xdd, 0x9d, 0x1d, 0x62, 0x1a, 0xc4, 0x98, 0x03, 0x0c, 0x3c, 0x3d, 0x20, 0x8d, - 0x3d, 0x39, 0x5b, 0x95, 0xa4, 0x6a, 0x93, 0x54, 0x25, 0x95, 0x4a, 0x2a, 0xa7, 0x9c, 0x92, 0x7b, - 0x2e, 0xa9, 0x4a, 0x55, 0x2e, 0x39, 0xe6, 0x90, 0x5c, 0x72, 0xcc, 0x35, 0x95, 0x63, 0x0e, 0xb9, - 0xe4, 0x9c, 0xff, 0xff, 0xbb, 0x7b, 0x30, 0x2f, 0x90, 0x90, 0x1f, 0x7b, 0xd8, 0xb5, 0xd8, 0x8f, - 0xaf, 0xff, 0xee, 0xfe, 0x9f, 0x5f, 0x0f, 0xd8, 0x4d, 0x11, 0x71, 0xa7, 0xd5, 0xe2, 0x42, 0x38, - 0xfb, 0x5c, 0xd8, 0x9d, 0xee, 0x9e, 0xef, 0x89, 0x26, 0x77, 0x1b, 0x9e, 0xcf, 0x2d, 0xea, 0xab, - 0xfb, 0x1e, 0x6f, 0x47, 0x56, 0x27, 0x0c, 0xa2, 0xa0, 0xb2, 0x92, 0x1e, 0xde, 0x6d, 0x7b, 0x0d, - 0x8f, 0xbb, 0xf6, 0x9e, 0x23, 0x0a, 0x46, 0x57, 0x23, 0x66, 0x3e, 0xda, 0xd2, 0x88, 0x1b, 0x80, - 0x68, 0xef, 0x74, 0xf7, 0x44, 0x3d, 0xf4, 0xf6, 0xb8, 0xbd, 0xcd, 0xbf, 0xee, 0x72, 0x11, 0x19, - 0x6f, 0xb0, 0xb9, 0xd4, 0xa2, 0x9e, 0x5b, 0x2e, 0x99, 0xa5, 0xa5, 0x31, 0xe3, 0x0c, 0x9b, 0x86, - 0xd6, 0xc8, 0x8e, 0x7a, 0x1d, 0x5e, 0x1e, 0x81, 0xa6, 0x59, 0x63, 0x96, 0x8d, 0x3b, 0x9d, 0x0e, - 0x8c, 0x18, 0x85, 0x3f, 0xc7, 0x8d, 0x45, 0x36, 0xdb, 0x0e, 0x22, 0xaf, 0xd1, 0xb3, 0xe5, 0xaa, - 0xe5, 0x31, 0x68, 0x9e, 0xaa, 0x5e, 0x66, 0x97, 0x8e, 0x59, 0x55, 0x74, 0x82, 0xb6, 0xe0, 0xd5, - 0x43, 0x56, 0xcd, 0x0c, 0x7a, 0xd1, 0x16, 0xbf, 0x03, 0xe1, 0xae, 0xb2, 0xcb, 0xc7, 0xae, 0xab, - 0xc4, 0xfb, 0x69, 0x6e, 0xd8, 0x23, 0xa7, 0x3d, 0xfc, 0xe1, 0x55, 0x3f, 0x60, 0x57, 0x8e, 0x9f, - 0x2f, 0xd7, 0x41, 0x29, 0xeb, 0x4e, 0xdb, 0x8e, 0x25, 0xa0, 0xe9, 0x53, 0xd5, 0x7f, 0x63, 0xec, - 0x42, 0x66, 0xbe, 0xfa, 0x2b, 0x5e, 0xfa, 0x7d, 0xbd, 0x5d, 0x9c, 0x31, 0x5b, 0xbb, 0xf9, 0x9b, - 0x7f, 0x2c, 0x2f, 0x3f, 0xec, 0x74, 0xcc, 0x4d, 0xd7, 0x8c, 0x9a, 0x9e, 0x30, 0x51, 0x1c, 0x13, - 0xfe, 0xbb, 0xc7, 0xbd, 0xf6, 0xbe, 0x19, 0x4b, 0x69, 0x6e, 0x6c, 0x3f, 0x7b, 0x62, 0x19, 0x8f, - 0xd8, 0xe9, 0x3a, 0x08, 0xd0, 0x6d, 0xf1, 0xd0, 0x96, 0x30, 0x74, 0x88, 0xb5, 0x1b, 0x00, 0x73, - 0x6d, 0x18, 0x98, 0xdd, 0x67, 0x96, 0xf1, 0x19, 0x08, 0xef, 0x07, 0x5d, 0xda, 0x79, 0xdb, 0x69, - 0x71, 0x3a, 0xf9, 0xe9, 0xda, 0xdb, 0x80, 0x71, 0xeb, 0x29, 0xfc, 0x6d, 0x06, 0x0d, 0x00, 0xe1, - 0x12, 0x23, 0x0a, 0xf4, 0x6c, 0xd3, 0x6b, 0x53, 0x73, 0x57, 0xf0, 0xf0, 0x9a, 0x30, 0x09, 0xc2, - 0x32, 0xbe, 0x64, 0x8b, 0x9d, 0x90, 0x1f, 0x7a, 0xfc, 0xc8, 0x4e, 0x83, 0x8e, 0x11, 0xe8, 0xfb, - 0x00, 0xfa, 0xa0, 0x08, 0x14, 0x50, 0x4c, 0x47, 0x50, 0x53, 0x5f, 0x3a, 0xec, 0x04, 0x68, 0x05, - 0x68, 0x19, 0xf7, 0xd8, 0x78, 0xe4, 0x45, 0x3e, 0x2f, 0x8f, 0x13, 0xd8, 0x9b, 0x00, 0x56, 0xdd, - 0xe5, 0xdf, 0x44, 0x26, 0xb5, 0x9a, 0x8d, 0x20, 0x2c, 0x00, 0xb0, 0x8c, 0x0d, 0x36, 0x8f, 0xff, - 0xb0, 0x5d, 0x8e, 0xb7, 0xd3, 0x89, 0xbc, 0xa0, 0x5d, 0x9e, 0x20, 0x84, 0x15, 0x40, 0x58, 0x22, - 0x84, 0x44, 0xdf, 0x40, 0x9c, 0xc7, 0x6c, 0x9a, 0x70, 0x48, 0x5b, 0x27, 0xe9, 0xa0, 0xdf, 0x05, - 0x80, 0x7b, 0x4b, 0xeb, 0x3f, 0x0b, 0xc2, 0x03, 0xd1, 0x0c, 0x3a, 0x78, 0xc5, 0xbb, 0xd0, 0xbb, - 0x6c, 0xe2, 0xff, 0xe3, 0x1e, 0x75, 0x4f, 0xf6, 0xf4, 0x2c, 0x63, 0x93, 0xbd, 0x1e, 0xdf, 0x1d, - 0x8c, 0x08, 0xa3, 0x7a, 0x37, 0xb2, 0xe9, 0xa8, 0xa6, 0x48, 0xb6, 0x65, 0x80, 0xbe, 0xba, 0xa3, - 0x3a, 0x4c, 0xec, 0x18, 0x28, 0xd8, 0x26, 0x9b, 0xef, 0x05, 0xdd, 0xa8, 0x0b, 0x2a, 0x89, 0xb7, - 0x41, 0x20, 0xd3, 0x04, 0xf2, 0x16, 0x80, 0xdc, 0x58, 0x7a, 0x46, 0xfb, 0x72, 0xfc, 0x65, 0xf3, - 0x85, 0xbc, 0xac, 0x2f, 0x82, 0xee, 0x2e, 0x8c, 0x36, 0x9d, 0x7a, 0x3d, 0xe8, 0xb6, 0x23, 0x53, - 0xcf, 0xb2, 0x8c, 0x9f, 0xb3, 0x39, 0x0d, 0x75, 0xe8, 0xb9, 0x3c, 0x00, 0x95, 0x62, 0x84, 0xf4, - 0x08, 0x90, 0x3e, 0x4c, 0x20, 0xbd, 0xc4, 0x5e, 0xd4, 0x2f, 0xd8, 0xa4, 0x13, 0x03, 0xd2, 0x1c, - 0x25, 0x27, 0xa8, 0x5b, 0x56, 0xd0, 0x3f, 0x28, 0x31, 0x76, 0xe8, 0x09, 0x6f, 0xcf, 0xf3, 0xbd, - 0xa8, 0x57, 0x9e, 0xa1, 0x33, 0x6c, 0x01, 0xb2, 0xb7, 0xb4, 0xbe, 0xcd, 0x5b, 0x41, 0xc4, 0x77, - 0xa2, 0x20, 0x04, 0x9f, 0x98, 0x32, 0x9a, 0x97, 0xf1, 0x0c, 0x5c, 0x56, 0xff, 0x5b, 0x6b, 0x50, - 0x7a, 0x0d, 0x73, 0xa9, 0x13, 0x7a, 0x87, 0x4e, 0xc4, 0x57, 0xcc, 0x46, 0x08, 0x0e, 0xc3, 0x15, - 0x2b, 0x72, 0x44, 0x7d, 0xc5, 0xe4, 0x51, 0xdd, 0x5a, 0x36, 0x0e, 0xd8, 0xa9, 0x90, 0xbb, 0x5e, - 0xc8, 0xeb, 0x91, 0xdd, 0x0d, 0xbd, 0xf2, 0x29, 0xda, 0xde, 0x0b, 0x10, 0xe2, 0x79, 0x62, 0x7b, - 0x9b, 0x0d, 0x53, 0x74, 0x3b, 0x1d, 0xf0, 0x39, 0xee, 0x0a, 0x2d, 0x13, 0x72, 0xd1, 0xf5, 0xa3, - 0xb4, 0xf5, 0x28, 0xfd, 0x84, 0x43, 0x80, 0xbd, 0x82, 0xfd, 0xc1, 0x72, 0xd0, 0x0a, 0x97, 0x8c, - 0x13, 0x5e, 0x6c, 0x6f, 0x5a, 0xc6, 0x1a, 0x1b, 0x8b, 0x9c, 0x7d, 0x51, 0x9e, 0x35, 0x47, 0x61, - 0x91, 0x77, 0x60, 0x91, 0x3b, 0x0f, 0xc3, 0xd0, 0x91, 0xc2, 0x93, 0xe6, 0x42, 0x2f, 0xce, 0x80, - 0xd9, 0x7e, 0x4f, 0x4f, 0xcd, 0x1e, 0xdb, 0x17, 0x6c, 0xae, 0x1e, 0xf8, 0x3e, 0x48, 0x0c, 0xd2, - 0x49, 0xf5, 0x3b, 0x4d, 0x52, 0x7f, 0x04, 0x80, 0xef, 0x27, 0xa4, 0xd6, 0x5a, 0xd7, 0x1f, 0x5d, - 0x74, 0x44, 0x21, 0x07, 0x8b, 0x12, 0xe0, 0x4c, 0x85, 0x65, 0x3c, 0x61, 0xd3, 0xfb, 0x70, 0xf1, - 0x12, 0x74, 0x8e, 0x40, 0x57, 0x01, 0xf4, 0x9d, 0x02, 0x50, 0x1c, 0x77, 0x12, 0xdc, 0x97, 0x6c, - 0xb4, 0x1b, 0xfa, 0xe5, 0x79, 0x02, 0x7a, 0x0a, 0x40, 0x9f, 0xa6, 0xcf, 0x94, 0xb4, 0xa2, 0x3f, - 0x01, 0x34, 0x07, 0x51, 0x57, 0x64, 0xbb, 0x27, 0xd4, 0xc1, 0x3d, 0x96, 0x07, 0xe1, 0x44, 0xd4, - 0x8b, 0x1e, 0x00, 0x54, 0xc2, 0xaa, 0x6e, 0xb1, 0x8b, 0x03, 0xbd, 0xa9, 0x72, 0xc4, 0x03, 0x23, - 0xcd, 0x42, 0xe6, 0xd6, 0xd1, 0x4f, 0x4e, 0x57, 0xff, 0x67, 0x22, 0x17, 0xe4, 0x3e, 0xe6, 0xd1, - 0x1a, 0x8f, 0x1c, 0xcf, 0x17, 0xb1, 0x8f, 0xde, 0x62, 0xf3, 0x19, 0x50, 0x01, 0xa8, 0xa3, 0x4b, - 0x13, 0xf2, 0x42, 0x77, 0x78, 0x84, 0xc7, 0x93, 0x39, 0x95, 0x4d, 0x97, 0xee, 0x35, 0xe4, 0x11, - 0xa8, 0xe1, 0x21, 0x07, 0x07, 0x43, 0xa0, 0x68, 0x1b, 0x96, 0xf1, 0x9c, 0xcd, 0x78, 0xed, 0xba, - 0xdf, 0xc5, 0x46, 0xd0, 0x0e, 0x14, 0x66, 0x4a, 0xfa, 0x46, 0x3c, 0xa3, 0xb0, 0x0b, 0x27, 0x02, - 0x13, 0xbb, 0x61, 0x1b, 0xf5, 0x03, 0x1c, 0x2d, 0x4c, 0x6a, 0x39, 0x74, 0x9d, 0xca, 0xe9, 0xca, - 0x5e, 0x58, 0x4b, 0xc1, 0x5a, 0x46, 0x9d, 0x9d, 0x55, 0x90, 0x8e, 0xeb, 0x7a, 0xf2, 0xc8, 0x95, - 0xe3, 0x14, 0xe4, 0xd1, 0xa7, 0xa4, 0xb6, 0x64, 0x17, 0x50, 0x63, 0x86, 0x5b, 0xe4, 0x29, 0x9b, - 0x53, 0x8b, 0xd4, 0x9b, 0x9e, 0xef, 0x86, 0xbc, 0x2d, 0xe3, 0x71, 0xed, 0x1e, 0x40, 0xdf, 0xce, - 0x42, 0xeb, 0x31, 0x83, 0xf1, 0xb6, 0xd9, 0xac, 0xc2, 0x3b, 0x38, 0xa4, 0x93, 0x18, 0x27, 0xb4, - 0xf7, 0x00, 0xed, 0x7e, 0x16, 0xed, 0x80, 0xf7, 0xcc, 0x43, 0xc7, 0xef, 0x72, 0x69, 0x33, 0x03, - 0x31, 0x1f, 0xb3, 0x53, 0x0a, 0xf3, 0x10, 0xfc, 0x89, 0x20, 0x4f, 0x3f, 0x25, 0x6f, 0x2a, 0x0b, - 0x89, 0x03, 0x4c, 0xd7, 0x89, 0x9c, 0xe3, 0x8e, 0xf5, 0x0c, 0x39, 0xe7, 0x54, 0xf0, 0x98, 0x22, - 0xc8, 0x4f, 0x00, 0x72, 0x2d, 0x0b, 0xe9, 0x98, 0x34, 0x3c, 0x15, 0x4f, 0xbc, 0x36, 0xe6, 0x74, - 0x6e, 0x1c, 0xf2, 0xba, 0xbe, 0x9f, 0xec, 0x47, 0x91, 0x0d, 0x25, 0x32, 0xdc, 0x81, 0x70, 0x7c, - 0x8e, 0x32, 0x91, 0xdf, 0x9d, 0xaa, 0xdd, 0x82, 0x55, 0x56, 0xf2, 0x97, 0xe6, 0xd5, 0xd1, 0x15, - 0xe1, 0xb8, 0x15, 0xd3, 0x6b, 0x90, 0xfb, 0xf0, 0xea, 0xce, 0x1e, 0x7a, 0x8b, 0x5a, 0x7c, 0x49, - 0x2d, 0xd8, 0x05, 0x41, 0xcd, 0x10, 0x14, 0x45, 0x94, 0x18, 0xaa, 0x13, 0x74, 0xba, 0x3e, 0x38, - 0x4a, 0x92, 0x49, 0x8f, 0x04, 0xdd, 0xe5, 0x3e, 0x84, 0xf1, 0x17, 0x6c, 0xca, 0x77, 0xda, 0xfb, - 0x5d, 0xb0, 0x3b, 0x72, 0x90, 0xe3, 0xab, 0xa5, 0x5b, 0x52, 0x7f, 0x76, 0x3a, 0xbc, 0x8e, 0xd9, - 0xaa, 0xb4, 0x55, 0x3f, 0xa8, 0x3b, 0xbe, 0xf7, 0x6b, 0xf4, 0x7a, 0xe4, 0xcd, 0x02, 0x25, 0xa1, - 0x65, 0xae, 0xf1, 0x86, 0x03, 0x0e, 0x93, 0x8c, 0x60, 0xbd, 0xbd, 0x4f, 0x31, 0xaf, 0xfa, 0xdf, - 0xaf, 0xb1, 0x85, 0x94, 0xb9, 0x29, 0x53, 0x33, 0x4e, 0xb3, 0x09, 0xe9, 0x60, 0x65, 0x1e, 0x54, - 0x64, 0xc7, 0x23, 0x64, 0xc7, 0x73, 0x6c, 0xb2, 0x1e, 0x72, 0x07, 0xa2, 0x04, 0x29, 0xf5, 0x04, - 0xa5, 0x5e, 0xb2, 0x41, 0x65, 0x40, 0x63, 0x04, 0xf0, 0x7a, 0x2e, 0x33, 0x1a, 0xa7, 0xf6, 0x73, - 0xec, 0xb5, 0x5c, 0xd4, 0x85, 0xce, 0x09, 0xea, 0x9c, 0x67, 0x53, 0x71, 0xbe, 0x82, 0xf1, 0x7d, - 0x1a, 0x13, 0x54, 0x0a, 0xf9, 0x02, 0xf6, 0x48, 0xd7, 0x3e, 0x66, 0x9c, 0x65, 0x67, 0x74, 0x86, - 0xd3, 0xef, 0x9a, 0xa6, 0x2e, 0x35, 0xdf, 0x46, 0x17, 0x48, 0x51, 0xd3, 0x78, 0x8d, 0xcd, 0xe8, - 0xc1, 0xd8, 0x38, 0x43, 0x8d, 0x20, 0x9b, 0x8a, 0xb1, 0x3a, 0xc4, 0x52, 0x0c, 0x32, 0x66, 0xa4, - 0xf3, 0x9c, 0xa5, 0x3f, 0x60, 0x5f, 0x4d, 0x90, 0x34, 0x02, 0x37, 0x49, 0xeb, 0x90, 0xc7, 0x9f, - 0x30, 0xca, 0x6c, 0x3e, 0x6e, 0x56, 0xc8, 0xe4, 0xb6, 0x27, 0x30, 0x71, 0x96, 0xc9, 0x11, 0x39, - 0x5f, 0x1c, 0x98, 0x4b, 0x7a, 0xce, 0x50, 0xcf, 0xd9, 0x22, 0x95, 0x36, 0xa8, 0x0b, 0xbc, 0x64, - 0xe4, 0x41, 0x34, 0xa0, 0x13, 0xe5, 0x6e, 0xf9, 0x35, 0x3a, 0x16, 0xdd, 0xda, 0xed, 0xb8, 0xd4, - 0xba, 0x40, 0xad, 0x46, 0x2a, 0x94, 0x2f, 0xea, 0xe4, 0xbd, 0xe1, 0xa3, 0x1d, 0xbf, 0x4e, 0x7f, - 0xc2, 0x1e, 0x8e, 0x54, 0xfe, 0x23, 0xf7, 0xf0, 0x06, 0xea, 0x21, 0x0a, 0x10, 0x37, 0x43, 0x06, - 0xc2, 0x3b, 0x08, 0x5a, 0xa6, 0xae, 0x0a, 0x33, 0xa0, 0xf9, 0xa8, 0x9f, 0x49, 0xdb, 0x8e, 0xef, - 0x97, 0xcf, 0x52, 0xdf, 0x05, 0xf6, 0x7a, 0xbb, 0xdb, 0xb2, 0xeb, 0x01, 0x14, 0x4e, 0x10, 0x3b, - 0x40, 0xfc, 0x43, 0xee, 0x07, 0x1d, 0x1e, 0x96, 0x2b, 0x54, 0x2a, 0xc0, 0xd5, 0xa6, 0xfa, 0x65, - 0xd8, 0x2f, 0x9f, 0xa3, 0x4e, 0x50, 0xb0, 0x3d, 0xa7, 0x0d, 0xa6, 0x5d, 0xfe, 0x09, 0x81, 0x81, - 0xf4, 0xf0, 0xb7, 0x0d, 0xfb, 0x14, 0xb0, 0xfb, 0xf3, 0xb4, 0x7b, 0x3d, 0x26, 0x2c, 0x5f, 0xa0, - 0x13, 0x45, 0x1d, 0x82, 0x31, 0x7b, 0x78, 0x88, 0x3e, 0x47, 0x21, 0x2f, 0xd2, 0xdc, 0x05, 0xf2, - 0x30, 0x41, 0xab, 0x03, 0xde, 0x12, 0x2c, 0xae, 0x6c, 0x52, 0x2b, 0x5c, 0x3e, 0x28, 0x9a, 0xcc, - 0xe0, 0x2e, 0xa5, 0x94, 0x87, 0x62, 0x6b, 0x55, 0x9f, 0x48, 0xba, 0x50, 0xb8, 0x4c, 0x73, 0xa1, - 0x59, 0x35, 0xd1, 0x6d, 0x88, 0xf2, 0x15, 0x1a, 0x8d, 0x00, 0xce, 0x61, 0x10, 0x7a, 0xb8, 0xf6, - 0xd5, 0xb8, 0x09, 0x82, 0x7b, 0x70, 0xc4, 0x43, 0x51, 0x7e, 0x93, 0x9a, 0xe0, 0x5c, 0x7c, 0xaf, - 0xc1, 0xe9, 0x8a, 0xd2, 0x28, 0xd7, 0xa8, 0x1f, 0xce, 0x34, 0xee, 0xef, 0xc3, 0x2d, 0xe5, 0xfb, - 0x62, 0xdc, 0x65, 0x7d, 0x99, 0x32, 0x7a, 0x5c, 0xa7, 0x3f, 0x41, 0x95, 0xbd, 0x16, 0xf8, 0x03, - 0xfb, 0xc8, 0x73, 0xa3, 0x66, 0xf9, 0x86, 0x56, 0x0d, 0xd9, 0xd8, 0xe4, 0xde, 0x7e, 0x33, 0x2a, - 0xaf, 0x68, 0x21, 0x65, 0x2b, 0xaa, 0xf3, 0x4d, 0x6d, 0x08, 0x10, 0xa2, 0xe1, 0x34, 0x42, 0x1b, - 0xdc, 0x77, 0xd9, 0xd2, 0x97, 0x90, 0xb0, 0xc1, 0xb7, 0x34, 0xa2, 0x6e, 0xa3, 0xa3, 0xbc, 0xa5, - 0x15, 0x93, 0xee, 0x56, 0x47, 0x9d, 0xdb, 0x5a, 0x24, 0x6c, 0x85, 0x7c, 0x02, 0x26, 0x88, 0xf2, - 0x1d, 0x6a, 0x7c, 0x8b, 0x4d, 0xc5, 0x71, 0xef, 0x2e, 0x44, 0xe9, 0x99, 0x3b, 0xe7, 0xad, 0x22, - 0x9f, 0x63, 0x6d, 0xc9, 0x51, 0xc6, 0x35, 0x95, 0xa3, 0xbd, 0x4d, 0x83, 0xcf, 0x16, 0x0f, 0xde, - 0x75, 0xf6, 0x8d, 0x9b, 0x6c, 0x2a, 0x16, 0xe0, 0x1e, 0x0d, 0x3e, 0x57, 0x3c, 0xf8, 0x11, 0x8e, - 0x32, 0x6e, 0xb0, 0x09, 0x15, 0xd5, 0xde, 0x39, 0x6e, 0xf0, 0x67, 0x2f, 0x11, 0xfb, 0x36, 0x9b, - 0xc6, 0x68, 0x64, 0x93, 0xbb, 0xbe, 0x0f, 0x1b, 0x99, 0xb9, 0x73, 0xa1, 0x78, 0xfc, 0x4b, 0x18, - 0xb6, 0x06, 0xa3, 0x8c, 0x90, 0xcd, 0x25, 0xef, 0x7c, 0x0f, 0x2e, 0xf5, 0x01, 0x25, 0xd4, 0x5f, - 0x80, 0x9f, 0x7e, 0xf1, 0xac, 0xed, 0x53, 0xbc, 0xf4, 0x5c, 0x0c, 0x6e, 0x29, 0x24, 0x0b, 0x72, - 0x1c, 0x2c, 0x04, 0xf0, 0xdf, 0x90, 0x82, 0xb5, 0x5d, 0x13, 0x4a, 0x6c, 0xf8, 0x1f, 0x84, 0x7f, - 0x3f, 0x3f, 0x52, 0xae, 0x6b, 0x82, 0x9f, 0x07, 0x3f, 0xed, 0xb0, 0x59, 0x08, 0x51, 0x36, 0xc6, - 0x28, 0x29, 0xea, 0xbb, 0x24, 0xea, 0xa5, 0x62, 0x51, 0x37, 0x82, 0x70, 0x07, 0x46, 0xa2, 0xb4, - 0xb5, 0x6b, 0x20, 0xd4, 0xe5, 0x2d, 0x15, 0xb7, 0x12, 0xc9, 0x46, 0x2e, 0x7c, 0xdd, 0x67, 0x53, - 0x71, 0xdc, 0x5a, 0xa5, 0x3c, 0xf2, 0x2a, 0x4c, 0xbd, 0xf4, 0x44, 0x47, 0x28, 0x47, 0x88, 0xa0, - 0xee, 0xa1, 0x23, 0x32, 0x8f, 0xbc, 0xa8, 0x49, 0x61, 0x08, 0x34, 0xba, 0x85, 0xba, 0x9c, 0x34, - 0x4b, 0x70, 0x2d, 0x18, 0x25, 0xde, 0x23, 0x53, 0x06, 0x1b, 0x49, 0xf5, 0xe1, 0xc1, 0x89, 0xc8, - 0x69, 0x75, 0xca, 0xef, 0x93, 0xd2, 0x3c, 0x4a, 0xc4, 0xbb, 0x0f, 0x74, 0xbc, 0xb3, 0x60, 0xdd, - 0xeb, 0xbb, 0x18, 0xe5, 0x54, 0x97, 0x8e, 0xe0, 0xb2, 0xdc, 0xc4, 0x83, 0x4b, 0x86, 0xf1, 0xca, - 0x55, 0x36, 0x8a, 0x57, 0x09, 0x6e, 0x1c, 0x55, 0xbc, 0xa4, 0x7d, 0x80, 0xe3, 0xb6, 0xbc, 0x76, - 0x00, 0xd7, 0x21, 0xf3, 0xbc, 0x4a, 0xc4, 0x26, 0xb5, 0xea, 0x41, 0xaf, 0xd2, 0xd5, 0x24, 0x25, - 0x22, 0x40, 0x9b, 0x83, 0xd0, 0x05, 0x3f, 0x24, 0x29, 0x11, 0x15, 0x17, 0xa8, 0x2c, 0x37, 0x4e, - 0xb1, 0x31, 0x8a, 0x38, 0x63, 0xb9, 0x88, 0x35, 0x3e, 0x20, 0xb8, 0x50, 0xa9, 0x5b, 0xd9, 0x60, - 0xe3, 0x52, 0x2d, 0x8f, 0x23, 0x63, 0xb2, 0x2b, 0xa7, 0x3c, 0x18, 0xae, 0x3f, 0x5b, 0xb9, 0xcc, - 0xc6, 0xa5, 0xc6, 0x82, 0x54, 0x90, 0x92, 0xa9, 0x6d, 0xa2, 0xaf, 0xc0, 0xdc, 0x4c, 0xe6, 0xd5, - 0x95, 0x0f, 0xd9, 0x54, 0xac, 0xa6, 0xd0, 0x25, 0xea, 0x41, 0x28, 0x39, 0x91, 0x11, 0x94, 0x98, - 0xf2, 0x32, 0x88, 0x26, 0x6a, 0x11, 0x0c, 0x24, 0xd4, 0xe2, 0x06, 0x47, 0x6d, 0xb5, 0xca, 0xff, - 0x96, 0xd8, 0x4c, 0x42, 0x7b, 0xc8, 0xf9, 0x08, 0x5b, 0xab, 0x9e, 0xa4, 0x57, 0x70, 0xab, 0x98, - 0x08, 0x41, 0xb8, 0x02, 0x6d, 0xd8, 0x0f, 0xc2, 0x9e, 0x02, 0x7c, 0xc9, 0x26, 0xf1, 0x72, 0xa3, - 0xae, 0x4c, 0x7c, 0x4f, 0xdf, 0xb9, 0x5d, 0xac, 0x9e, 0xeb, 0xa9, 0x56, 0xb5, 0xdc, 0x0e, 0x4d, - 0x5c, 0x35, 0x0e, 0xec, 0xad, 0x8d, 0x8d, 0x9d, 0x1d, 0xfb, 0x69, 0x10, 0xa9, 0x1e, 0xe3, 0x27, - 0x6c, 0x21, 0xbd, 0x9e, 0xdd, 0xf0, 0x03, 0x50, 0x31, 0x79, 0x15, 0x55, 0x56, 0x91, 0xbd, 0x20, - 0x68, 0xc7, 0xe9, 0xd9, 0x47, 0x50, 0xbf, 0xd8, 0x70, 0x15, 0xf6, 0x91, 0xd3, 0x8e, 0x64, 0x62, - 0x8b, 0x21, 0xca, 0xf5, 0x04, 0xd5, 0xdc, 0x36, 0x04, 0xae, 0x3a, 0xc4, 0x29, 0xd4, 0x38, 0xca, - 0x3e, 0xaa, 0xff, 0x5a, 0x62, 0xe7, 0x8e, 0x11, 0x09, 0xb6, 0x5b, 0x20, 0xd4, 0xfc, 0xef, 0x01, - 0xe8, 0x1b, 0xba, 0x7d, 0x0b, 0x2a, 0x50, 0xb0, 0xaf, 0x87, 0x9d, 0x4e, 0x18, 0xc0, 0x7d, 0xcc, - 0x97, 0x92, 0x9d, 0xb2, 0x15, 0x90, 0xd5, 0xcc, 0x91, 0x64, 0xe7, 0x36, 0xff, 0x0a, 0x4a, 0xa3, - 0x7e, 0xe7, 0x68, 0xb2, 0xf3, 0x69, 0xf0, 0x38, 0x68, 0xef, 0x83, 0xc3, 0x50, 0x9d, 0x63, 0xc6, - 0x79, 0x76, 0x56, 0x77, 0xee, 0xe2, 0x26, 0x22, 0xef, 0x90, 0xc7, 0xab, 0x8e, 0x57, 0xbf, 0xc8, - 0xd1, 0x82, 0xa9, 0xb2, 0x4a, 0x15, 0x6b, 0x77, 0xe1, 0x3c, 0x93, 0x9a, 0xa8, 0x92, 0x6e, 0xaa, - 0xad, 0x66, 0xee, 0x2c, 0x16, 0x5e, 0x5a, 0xf5, 0x3f, 0x4b, 0x45, 0xd8, 0x9b, 0xe0, 0x00, 0x36, - 0xc1, 0xa9, 0xc4, 0x35, 0x1b, 0xc4, 0x72, 0x8c, 0xc6, 0x9a, 0x58, 0xc3, 0x9c, 0xc3, 0x77, 0x90, - 0x69, 0x4c, 0x26, 0x32, 0x52, 0x5d, 0x3e, 0x61, 0xa7, 0xe3, 0x74, 0x04, 0x1d, 0x09, 0x6a, 0x0d, - 0x0a, 0x70, 0xcb, 0x3a, 0x79, 0x1d, 0x4b, 0xf3, 0x3b, 0xd8, 0x01, 0x6a, 0x7f, 0x2a, 0xf9, 0x37, - 0xa5, 0x8a, 0x1a, 0x41, 0x26, 0x8b, 0x4a, 0x9e, 0x89, 0x5c, 0x4e, 0x45, 0xa2, 0x54, 0xff, 0xab, - 0x94, 0x23, 0x2c, 0xd3, 0x8b, 0xaa, 0x93, 0x03, 0x73, 0x90, 0x13, 0x69, 0x3f, 0x6a, 0x8b, 0x4f, - 0x72, 0xfb, 0x18, 0xa1, 0x7d, 0xdc, 0xb3, 0x86, 0x80, 0x4c, 0x6d, 0x04, 0x7b, 0x2a, 0x9f, 0xb3, - 0xf9, 0x6c, 0xdb, 0x2b, 0x6f, 0x08, 0x05, 0x6d, 0x39, 0x6d, 0xc8, 0x30, 0xe0, 0xe8, 0x15, 0xa7, - 0x3b, 0x51, 0xfd, 0xbf, 0xf9, 0xa2, 0x5d, 0xc6, 0x11, 0x29, 0xbe, 0xc3, 0x4f, 0xd9, 0x24, 0x91, - 0xe1, 0x7a, 0x0d, 0xc9, 0xb6, 0xed, 0x60, 0x93, 0xb9, 0xb9, 0xa6, 0x9d, 0x31, 0x72, 0x57, 0xe6, - 0x51, 0x33, 0x10, 0x92, 0x4c, 0x84, 0x80, 0x16, 0x72, 0xc5, 0x73, 0x86, 0x12, 0x88, 0xbb, 0xc8, - 0x01, 0x8e, 0x27, 0x09, 0xd2, 0xfb, 0x80, 0x74, 0x57, 0x11, 0xa4, 0x0a, 0x07, 0xba, 0x25, 0xe7, - 0xa0, 0x69, 0x49, 0x61, 0x42, 0x32, 0x94, 0x64, 0x3b, 0xa2, 0xc0, 0x32, 0x56, 0xd9, 0x18, 0x92, - 0x11, 0xd2, 0xe6, 0x57, 0x4b, 0xb7, 0x65, 0x51, 0x95, 0x20, 0x39, 0xc0, 0x58, 0x43, 0x49, 0x13, - 0x61, 0xc0, 0x40, 0x26, 0x4c, 0x16, 0x36, 0x50, 0x4b, 0x6e, 0x31, 0x06, 0xe9, 0x0a, 0xd8, 0x3d, - 0x21, 0x8c, 0x6b, 0x04, 0xc9, 0x21, 0x26, 0xf8, 0x16, 0x58, 0x1f, 0xc6, 0xed, 0xc1, 0xb6, 0x40, - 0x34, 0x35, 0x1b, 0xea, 0x35, 0xf8, 0x9b, 0x30, 0xfb, 0x45, 0x16, 0x84, 0xad, 0x31, 0x72, 0xcd, - 0xe4, 0xe2, 0x57, 0x27, 0x5b, 0x3d, 0x92, 0x5b, 0xd2, 0x9a, 0x05, 0x0c, 0x8e, 0xdc, 0x15, 0xcc, - 0xdf, 0xeb, 0x97, 0xba, 0xc8, 0x2e, 0x31, 0xf4, 0xfb, 0x10, 0x74, 0x9b, 0x81, 0x2b, 0xeb, 0x9e, - 0xd5, 0x19, 0x34, 0x16, 0x75, 0x95, 0xb5, 0x07, 0x00, 0xf7, 0x76, 0x72, 0x8b, 0x81, 0xdc, 0xa1, - 0x9c, 0xa1, 0xd9, 0x5b, 0x28, 0x74, 0xe3, 0xf2, 0x99, 0x62, 0x01, 0xec, 0xf8, 0x3d, 0x36, 0x49, - 0x74, 0x5c, 0xbd, 0x47, 0x15, 0xd2, 0x6c, 0xed, 0x3a, 0x40, 0xbd, 0xb9, 0x14, 0xc4, 0x50, 0x70, - 0xe1, 0x11, 0xec, 0x6b, 0xaf, 0x67, 0xaa, 0x71, 0xa6, 0xe0, 0x11, 0x82, 0xc3, 0xe4, 0x26, 0x52, - 0x36, 0x5f, 0x77, 0xbd, 0x90, 0xbb, 0x94, 0x45, 0x31, 0xe2, 0xd0, 0xb6, 0x01, 0xe1, 0x69, 0x72, - 0x6f, 0x44, 0xa0, 0xe1, 0xbd, 0xb5, 0xba, 0x22, 0xc2, 0x9d, 0x29, 0x72, 0x09, 0x05, 0x72, 0xb2, - 0xac, 0x0c, 0xc8, 0x2a, 0xc0, 0x59, 0x89, 0x46, 0x8f, 0xae, 0x19, 0xd4, 0x23, 0xec, 0x59, 0x86, - 0xcf, 0x4e, 0xf1, 0x6f, 0xa8, 0x62, 0x96, 0x2b, 0xcd, 0xd0, 0x4a, 0x2f, 0x61, 0xa5, 0xed, 0xc1, - 0x2b, 0x3d, 0x7d, 0xb6, 0xfb, 0xdd, 0x56, 0x6b, 0xb3, 0x79, 0xbd, 0x2f, 0xfb, 0xe0, 0xd0, 0xa6, - 0x15, 0x2f, 0x90, 0xa5, 0x5e, 0xb7, 0x86, 0x30, 0x0b, 0x99, 0x30, 0xd6, 0x96, 0x40, 0xba, 0x2b, - 0xdb, 0x0a, 0x07, 0xc9, 0x91, 0x9b, 0x09, 0x72, 0x04, 0x16, 0x86, 0xec, 0xaa, 0xde, 0x34, 0x91, - 0x5d, 0xf8, 0x40, 0xe6, 0x08, 0x31, 0x6d, 0xa8, 0x9e, 0x07, 0x12, 0x3b, 0xdb, 0x20, 0x61, 0x51, - 0x49, 0xe2, 0x89, 0x5a, 0x55, 0x2c, 0x4c, 0xf9, 0xd2, 0x05, 0xf6, 0x1c, 0x61, 0x7c, 0x0a, 0x18, - 0x1b, 0x03, 0x2c, 0x28, 0x61, 0x32, 0xda, 0x96, 0x56, 0x4c, 0xcc, 0x80, 0x24, 0x38, 0xb4, 0x43, - 0xce, 0x27, 0x14, 0x91, 0xe0, 0x22, 0x7f, 0xbd, 0x40, 0x1d, 0xf2, 0xc9, 0xc0, 0x8e, 0x33, 0x1a, - 0x49, 0x23, 0x92, 0xb4, 0x4f, 0x48, 0x2a, 0xa2, 0x09, 0x69, 0x90, 0xa9, 0x07, 0x65, 0xa0, 0xbe, - 0x62, 0x8b, 0x75, 0x07, 0x96, 0xb0, 0x5b, 0xce, 0x37, 0x36, 0x96, 0x20, 0x82, 0x43, 0xb9, 0xec, - 0x0a, 0x2a, 0x03, 0x67, 0x31, 0xab, 0x23, 0xda, 0xe6, 0x21, 0x96, 0x3a, 0x26, 0x24, 0x09, 0xbe, - 0x22, 0x80, 0xd2, 0x46, 0x11, 0x33, 0xed, 0x31, 0x72, 0xc2, 0x22, 0x15, 0x62, 0x9a, 0x24, 0x39, - 0xff, 0x83, 0x91, 0x24, 0x86, 0xc7, 0xa6, 0xa3, 0x00, 0x24, 0xa3, 0x94, 0xf1, 0x0c, 0x31, 0x37, - 0x59, 0x55, 0x8c, 0x49, 0x1c, 0x3a, 0x54, 0x4d, 0x15, 0x62, 0x66, 0x8a, 0x13, 0x13, 0xb2, 0xaa, - 0x6b, 0xc4, 0x4b, 0xe9, 0x6b, 0x22, 0x9c, 0x61, 0xac, 0x8a, 0x53, 0x9e, 0x2b, 0x6c, 0x5a, 0xc9, - 0xa0, 0x95, 0x7e, 0x0e, 0x2b, 0x7d, 0x3e, 0xcc, 0x4a, 0x19, 0x55, 0x07, 0x98, 0x21, 0xd6, 0x7b, - 0x1b, 0x55, 0x1f, 0x21, 0xec, 0x7e, 0xb1, 0x83, 0x1c, 0xc3, 0xd4, 0xea, 0x18, 0xae, 0x52, 0x5b, - 0x80, 0xd5, 0xe7, 0xb7, 0x33, 0xe4, 0x9c, 0xf1, 0x80, 0xcd, 0xa8, 0x59, 0x64, 0x2b, 0x0b, 0x24, - 0xe8, 0x65, 0x18, 0x7a, 0x71, 0x3b, 0x26, 0x49, 0x63, 0x42, 0x90, 0xa4, 0x51, 0x99, 0x84, 0xf1, - 0x19, 0x3b, 0xad, 0x66, 0x6a, 0x43, 0x5b, 0x4c, 0xac, 0x46, 0x8f, 0x6d, 0xdb, 0x31, 0xbb, 0x78, - 0x33, 0xcf, 0x2e, 0xa6, 0xc0, 0x7e, 0xc6, 0xe6, 0x14, 0x58, 0x5c, 0x5f, 0xbe, 0x4e, 0xa2, 0xfc, - 0x14, 0x70, 0x56, 0xb7, 0x33, 0x74, 0x2a, 0xd6, 0xbf, 0x54, 0x22, 0xc8, 0x27, 0x11, 0x4d, 0xff, - 0x16, 0x01, 0x6f, 0xc4, 0xc0, 0x71, 0x79, 0x49, 0x44, 0x49, 0x4a, 0x40, 0xea, 0xa2, 0x42, 0x87, - 0xce, 0xba, 0x08, 0xc7, 0x67, 0x65, 0x85, 0x93, 0xe7, 0x77, 0xca, 0x89, 0x7d, 0xaf, 0x01, 0xec, - 0x47, 0x5b, 0x49, 0xfa, 0x2f, 0x37, 0x5e, 0xf2, 0x80, 0x49, 0xe6, 0x32, 0x4b, 0x26, 0xc1, 0xd9, - 0x2e, 0xa8, 0xd5, 0xd2, 0x15, 0x61, 0x25, 0x27, 0x7a, 0xe7, 0xc4, 0xaa, 0xcf, 0xf8, 0x30, 0x3e, - 0x82, 0xb8, 0xf6, 0x23, 0x9e, 0x66, 0x75, 0xbc, 0xe1, 0xf8, 0x82, 0xd7, 0x2e, 0x02, 0xdc, 0xb9, - 0xad, 0xc1, 0x8c, 0xe5, 0x50, 0x65, 0x49, 0xf5, 0xdb, 0x91, 0xdc, 0x7b, 0x6e, 0xc6, 0xc3, 0xaa, - 0xfc, 0x0a, 0xb9, 0x34, 0xb4, 0x24, 0x95, 0x59, 0x21, 0x4f, 0x21, 0xc3, 0xba, 0xcb, 0xbf, 0x51, - 0x99, 0xcd, 0xa0, 0xe4, 0x75, 0xf4, 0x98, 0xe4, 0x15, 0x6a, 0xdb, 0x31, 0xd8, 0xb4, 0x80, 0xec, - 0x01, 0x07, 0x2d, 0x5b, 0xc3, 0x08, 0x63, 0x81, 0x93, 0xad, 0x7c, 0xcc, 0x46, 0xe1, 0x3f, 0xfd, - 0xc7, 0x71, 0x29, 0x17, 0xd4, 0x82, 0xe4, 0x27, 0x69, 0x77, 0x19, 0x36, 0x85, 0xea, 0x28, 0xa4, - 0x4b, 0xd5, 0x7b, 0x98, 0x7a, 0x38, 0xff, 0x8b, 0x09, 0x76, 0x3e, 0xfb, 0x72, 0x2e, 0x33, 0x49, - 0x9d, 0x75, 0xbd, 0x9b, 0x7e, 0x91, 0xa6, 0x88, 0x9d, 0x7c, 0x4a, 0xce, 0x18, 0xfe, 0x1e, 0x07, - 0x47, 0xb5, 0x2f, 0x43, 0xc5, 0xe3, 0x62, 0xd6, 0x76, 0xa2, 0x76, 0x17, 0x40, 0xde, 0xda, 0xca, - 0x7a, 0x8c, 0xd4, 0x1b, 0xf0, 0x11, 0xbf, 0xe6, 0x9a, 0xbe, 0x77, 0x00, 0x09, 0x1d, 0xc9, 0x83, - 0xa9, 0x96, 0x22, 0x34, 0x47, 0xfb, 0x61, 0x20, 0x19, 0x8e, 0xa9, 0x08, 0x2f, 0x7c, 0x04, 0xc4, - 0x37, 0xed, 0x3c, 0xfb, 0x29, 0x5f, 0xa0, 0x6f, 0x03, 0xcc, 0xcd, 0x04, 0xcc, 0x5a, 0x42, 0xe9, - 0x07, 0x80, 0xad, 0xa5, 0x98, 0x4e, 0xca, 0xdb, 0x24, 0x2d, 0x9f, 0x7a, 0x0e, 0x3d, 0xfe, 0x5d, - 0xd2, 0x32, 0x3e, 0x52, 0x34, 0xd3, 0x04, 0x25, 0x17, 0x77, 0x60, 0xbe, 0x95, 0xcc, 0xa9, 0xe4, - 0x23, 0x12, 0x39, 0x9f, 0x41, 0xcf, 0xbc, 0x0f, 0xb3, 0xf4, 0x74, 0xee, 0x79, 0x77, 0x43, 0x07, - 0xc5, 0x41, 0x10, 0xcf, 0xd9, 0x7c, 0x92, 0xbc, 0x4e, 0x3c, 0x37, 0x53, 0x46, 0x9c, 0x80, 0x52, - 0x14, 0x45, 0x3f, 0xce, 0x0e, 0x82, 0xfc, 0x65, 0x9a, 0x17, 0x94, 0xd9, 0xc1, 0x26, 0xa0, 0xad, - 0x17, 0x3c, 0xfd, 0xe1, 0x3b, 0x69, 0x5b, 0x39, 0x47, 0x9c, 0xbe, 0x62, 0x42, 0x85, 0x6c, 0xd6, - 0xa1, 0x4d, 0x46, 0x5a, 0x99, 0x28, 0xc9, 0x7e, 0xc2, 0xb3, 0x8c, 0x5f, 0x65, 0x28, 0xc6, 0xf9, - 0x7e, 0xfa, 0xf1, 0x3d, 0x17, 0x90, 0x80, 0x56, 0xd5, 0xcc, 0x7d, 0xa5, 0x11, 0x9b, 0x84, 0xfa, - 0x8e, 0xe4, 0x9f, 0x4a, 0x6c, 0x25, 0x6f, 0xab, 0x8f, 0x9a, 0x10, 0xfd, 0xf9, 0x27, 0x9e, 0x80, - 0xdc, 0xa8, 0xb7, 0xde, 0x8e, 0xc2, 0x5e, 0x6c, 0x44, 0xf5, 0x62, 0x92, 0x65, 0x42, 0xca, 0x3d, - 0xac, 0x25, 0x40, 0x56, 0xb0, 0xcf, 0x65, 0x41, 0x52, 0xa7, 0xb5, 0xcc, 0xa6, 0x5c, 0x4c, 0xbe, - 0x22, 0x9e, 0x81, 0x44, 0x21, 0xe6, 0xb1, 0x46, 0x34, 0x1f, 0x14, 0xa7, 0x24, 0xf4, 0x01, 0x4d, - 0xf5, 0x17, 0xec, 0xe6, 0x90, 0x92, 0x2b, 0xdf, 0x57, 0x61, 0x86, 0x5c, 0x2c, 0x65, 0x3c, 0xd2, - 0x9f, 0x26, 0xe1, 0x47, 0x08, 0xfe, 0x6f, 0x47, 0xd8, 0xb5, 0x13, 0xf0, 0x7f, 0xb7, 0x87, 0xf2, - 0x11, 0x63, 0xe4, 0xba, 0xed, 0x3e, 0xe3, 0x26, 0xeb, 0xa1, 0xed, 0xc1, 0x59, 0x92, 0xc4, 0x11, - 0x94, 0xe3, 0x58, 0x19, 0x6f, 0x3f, 0xaa, 0xb9, 0x70, 0x62, 0x6d, 0x14, 0xd7, 0xb3, 0x9c, 0x38, - 0x87, 0x71, 0x9d, 0xf9, 0x51, 0xf2, 0x02, 0xee, 0x84, 0x12, 0x72, 0xdd, 0x5d, 0xfd, 0xf7, 0x12, - 0x5b, 0x3a, 0xf9, 0x80, 0xd4, 0xd9, 0xaf, 0xb1, 0x49, 0x25, 0x8b, 0x22, 0x41, 0xee, 0x5a, 0xc3, - 0xce, 0xb5, 0x64, 0xf3, 0xe3, 0x60, 0xbf, 0x1f, 0xbd, 0x48, 0x27, 0x2a, 0x8f, 0xd9, 0x74, 0xbf, - 0x2f, 0xa5, 0x33, 0x25, 0xfd, 0x06, 0x50, 0x70, 0xe1, 0x23, 0xb9, 0x0b, 0x97, 0xfa, 0xf4, 0xcf, - 0x63, 0x6c, 0x39, 0x23, 0xd3, 0x36, 0x6f, 0x40, 0x11, 0xd4, 0x7c, 0x19, 0x60, 0xe1, 0xf6, 0xbc, - 0xcb, 0xbb, 0xfd, 0x60, 0x92, 0x09, 0x58, 0x35, 0x66, 0x50, 0xa2, 0x0f, 0xe3, 0xec, 0x3e, 0xb1, - 0x28, 0x4b, 0x72, 0xfa, 0x9a, 0x27, 0xcd, 0x7f, 0x21, 0xe7, 0xf0, 0x44, 0x8d, 0xd7, 0x9f, 0xd6, - 0x40, 0x96, 0x23, 0xfd, 0xe8, 0x28, 0xf9, 0xd1, 0x5f, 0xc2, 0xac, 0xdf, 0xdf, 0x94, 0xcf, 0x9d, - 0xc9, 0xec, 0xb3, 0xe9, 0x1c, 0x42, 0xfa, 0xe5, 0xfb, 0xf2, 0xbe, 0xd1, 0xab, 0x82, 0xfb, 0x72, - 0xda, 0xb1, 0x77, 0x96, 0x59, 0x5e, 0x43, 0x16, 0x24, 0xf8, 0xc8, 0x64, 0xcb, 0x16, 0x81, 0x05, - 0x28, 0xea, 0x18, 0xe5, 0x1d, 0x96, 0xf1, 0x57, 0x25, 0x76, 0x3a, 0x3d, 0x46, 0x06, 0x52, 0x95, - 0x4a, 0x1d, 0xc1, 0xf2, 0x22, 0xce, 0x91, 0x01, 0xb8, 0xad, 0x84, 0xa0, 0x12, 0x31, 0x2f, 0x44, - 0xbf, 0x52, 0x31, 0xd1, 0x65, 0xd1, 0x22, 0x6a, 0x5e, 0x62, 0x46, 0x64, 0xfa, 0x1c, 0xea, 0x6f, - 0xd0, 0x47, 0x9e, 0x92, 0x37, 0x55, 0x32, 0xcd, 0xea, 0x92, 0xd5, 0x56, 0x2f, 0xe7, 0x71, 0x58, - 0x59, 0x97, 0x1d, 0xb4, 0xdd, 0xdc, 0x91, 0xc4, 0x47, 0x20, 0x24, 0x28, 0x96, 0x4c, 0x86, 0x2b, - 0xb5, 0xd6, 0xfe, 0x9a, 0x2e, 0x8f, 0xf8, 0x65, 0xe2, 0x24, 0xe5, 0x27, 0x1c, 0x5a, 0xa7, 0xfb, - 0x06, 0x43, 0xf4, 0x92, 0xce, 0x41, 0x0f, 0xe9, 0xde, 0x4d, 0x9a, 0x0b, 0xdb, 0x7a, 0xe2, 0xf4, - 0xb0, 0x94, 0xaa, 0xfb, 0xa0, 0x61, 0x30, 0x69, 0x4f, 0x7a, 0x5c, 0x48, 0x6b, 0x0e, 0x79, 0x58, - 0x5d, 0x61, 0xd7, 0x87, 0x51, 0x1e, 0xe5, 0x76, 0xff, 0xc3, 0xc8, 0x7d, 0x9e, 0xf1, 0x1c, 0x0b, - 0x89, 0x34, 0x4d, 0xf4, 0x98, 0x31, 0x2a, 0x2f, 0xa4, 0x32, 0xc9, 0xac, 0x85, 0x28, 0x0b, 0xde, - 0xc6, 0x67, 0x5e, 0xf9, 0x49, 0x43, 0x5a, 0xb1, 0x08, 0x85, 0x58, 0x11, 0xd8, 0x83, 0xfc, 0xb0, - 0x10, 0x07, 0x0b, 0xab, 0x69, 0x5c, 0x50, 0x04, 0x8f, 0x54, 0xca, 0x79, 0xc0, 0x39, 0xf5, 0xa8, - 0x1b, 0x86, 0x58, 0xe2, 0x63, 0x7b, 0x86, 0xc4, 0x19, 0xfd, 0x01, 0x48, 0x9c, 0x7b, 0x85, 0x2f, - 0xd8, 0xb5, 0x0b, 0x80, 0x58, 0x79, 0xa8, 0x4b, 0x6a, 0xf5, 0x22, 0xdb, 0x2f, 0xa8, 0x0d, 0x4b, - 0x9b, 0x96, 0x4c, 0x48, 0x28, 0x43, 0xee, 0x0f, 0x97, 0x6f, 0xdc, 0x22, 0x31, 0xfe, 0x69, 0x86, - 0x4e, 0x91, 0x79, 0x08, 0x1d, 0xd4, 0x6e, 0x96, 0x33, 0x80, 0x74, 0x84, 0x67, 0x4d, 0xa3, 0xe3, - 0x84, 0x90, 0x06, 0x10, 0x5b, 0x03, 0x29, 0xdf, 0x51, 0x8e, 0x34, 0x99, 0xfc, 0x51, 0x49, 0x93, - 0xdf, 0xe6, 0xed, 0x70, 0x2a, 0x61, 0x87, 0x3e, 0x2c, 0xdb, 0x4c, 0xdb, 0xa1, 0xd4, 0xd1, 0x93, - 0xec, 0x10, 0x0a, 0x5b, 0x68, 0x0c, 0x8f, 0x3c, 0x41, 0x65, 0x45, 0x6f, 0x08, 0x33, 0xc4, 0x2c, - 0xea, 0x74, 0xcc, 0xe0, 0xc8, 0xf7, 0xee, 0x69, 0xda, 0x3c, 0x29, 0x41, 0xcc, 0xc9, 0x50, 0x4f, - 0x9a, 0x9a, 0x42, 0xdf, 0x82, 0x7b, 0x6e, 0xf7, 0xfa, 0x54, 0x03, 0xc9, 0x89, 0x1f, 0x61, 0x06, - 0x2d, 0x2f, 0x8a, 0x62, 0x44, 0xc9, 0x76, 0xd1, 0x47, 0x98, 0x1b, 0x19, 0x20, 0x7c, 0xad, 0x3b, - 0x16, 0x6c, 0x93, 0xcd, 0x08, 0xee, 0x84, 0x70, 0x58, 0x48, 0x38, 0xc8, 0xaf, 0x0e, 0x24, 0xd4, - 0xae, 0x22, 0x20, 0xe4, 0x4d, 0x2b, 0x03, 0xc6, 0x49, 0xd7, 0x84, 0x7a, 0xd5, 0x02, 0x37, 0x99, - 0xac, 0xf2, 0x1e, 0x24, 0xc8, 0xa3, 0x53, 0xaf, 0xe4, 0xa7, 0xb7, 0xd8, 0x22, 0xd5, 0xac, 0x76, - 0x36, 0xe6, 0xcf, 0x52, 0xcc, 0xa7, 0x3c, 0x7c, 0x03, 0x62, 0x2c, 0x5d, 0x8c, 0xbc, 0x2c, 0xda, - 0x62, 0xc8, 0x1b, 0x1c, 0xcc, 0xad, 0x2e, 0xcb, 0xbc, 0x7d, 0xef, 0x50, 0xdd, 0xa5, 0x65, 0xfc, - 0xa6, 0xc4, 0xc6, 0x5c, 0xa7, 0x27, 0x14, 0x8b, 0x15, 0x01, 0x42, 0x07, 0xee, 0xbc, 0x6f, 0xfc, - 0xe8, 0xbe, 0x0f, 0xec, 0x62, 0x4b, 0xb7, 0xb7, 0x9d, 0xf6, 0x01, 0x77, 0x6b, 0xbd, 0x5d, 0x00, - 0x77, 0x95, 0x8e, 0x24, 0x3f, 0x3b, 0xeb, 0x5b, 0x2b, 0xae, 0xa1, 0xd3, 0x0c, 0x7a, 0x99, 0xa2, - 0xdc, 0xf7, 0xcb, 0xdb, 0x2b, 0xf7, 0x7f, 0x61, 0x19, 0xff, 0x50, 0x8a, 0x3f, 0xb4, 0xb2, 0x43, - 0x8e, 0x2f, 0x38, 0xb6, 0x7c, 0xbd, 0xa2, 0x7c, 0x63, 0x8e, 0xf2, 0x8d, 0x3f, 0x2d, 0x81, 0x68, - 0x7f, 0x5c, 0xfa, 0x7e, 0xb2, 0xf9, 0x1e, 0xe8, 0x83, 0xf2, 0x1c, 0x74, 0xd7, 0x5f, 0xe1, 0xdd, - 0x83, 0x58, 0x89, 0xb3, 0x22, 0x3d, 0x95, 0x22, 0xe2, 0x5b, 0xa8, 0xba, 0x4f, 0x90, 0xdf, 0x0c, - 0x29, 0x33, 0xa2, 0xd3, 0x1b, 0xcc, 0x89, 0x5d, 0xfc, 0xe1, 0x39, 0xb1, 0x5f, 0x25, 0x12, 0x86, - 0x4b, 0x3a, 0x33, 0xfa, 0x0c, 0xe0, 0x3f, 0x7e, 0xac, 0x1f, 0x51, 0xd1, 0xc0, 0x49, 0x3b, 0x51, - 0xff, 0x1c, 0x52, 0x00, 0x11, 0x98, 0x47, 0xf4, 0xb9, 0x1f, 0x8f, 0x44, 0x9f, 0x99, 0x2e, 0xa6, - 0xc7, 0xfc, 0x02, 0xfa, 0xb4, 0x4a, 0xc9, 0xd2, 0x92, 0x75, 0x62, 0xb0, 0x78, 0x65, 0xf2, 0x34, - 0x45, 0xc6, 0xcd, 0xff, 0xa8, 0x64, 0x9c, 0x55, 0x40, 0x8e, 0x49, 0xfa, 0x6f, 0x28, 0x5a, 0xcc, - 0x18, 0x9e, 0x16, 0x5b, 0xcf, 0xd1, 0x62, 0xaf, 0xe5, 0x48, 0x9b, 0xef, 0x46, 0x88, 0x2d, 0xfc, - 0x58, 0x84, 0xd8, 0xe2, 0x77, 0x21, 0xc4, 0x1a, 0xc7, 0x10, 0x62, 0x92, 0xba, 0xfb, 0x71, 0xa9, - 0xb0, 0x0b, 0xdf, 0x85, 0x0a, 0x7b, 0x37, 0x4f, 0x85, 0x99, 0x49, 0x2a, 0xec, 0x2c, 0xc0, 0x2d, - 0x16, 0x52, 0x61, 0xc3, 0x91, 0x60, 0xbf, 0x1d, 0xc9, 0x3d, 0xa0, 0xa6, 0xec, 0x44, 0x95, 0x22, - 0xbb, 0x29, 0x0a, 0xac, 0xb6, 0x0e, 0xab, 0x3e, 0x7c, 0x1a, 0xab, 0xb2, 0xe4, 0xf1, 0xd1, 0x31, - 0x76, 0xd1, 0x61, 0xd1, 0xf7, 0x23, 0xe0, 0x0c, 0x85, 0x70, 0x42, 0x0f, 0x8c, 0x20, 0x9b, 0x29, - 0x6a, 0x93, 0x36, 0xfe, 0xac, 0x34, 0x80, 0x36, 0x1b, 0x39, 0x86, 0x36, 0xab, 0x7d, 0x0e, 0x8b, - 0xef, 0xae, 0x3b, 0xea, 0x59, 0x22, 0x56, 0x9d, 0x23, 0x0f, 0x22, 0x07, 0x66, 0x13, 0xea, 0x30, - 0x40, 0x10, 0x97, 0x77, 0xe4, 0x13, 0x38, 0x46, 0xc6, 0x23, 0x19, 0x4e, 0xa4, 0xd9, 0xd0, 0x8b, - 0x94, 0x7c, 0xd1, 0xeb, 0x3f, 0x0b, 0xde, 0xf9, 0xfb, 0xd3, 0x6c, 0x36, 0xb5, 0x24, 0x7e, 0xa2, - 0x3e, 0x1d, 0xff, 0xc2, 0xc3, 0xb8, 0x64, 0x9d, 0xf4, 0xcb, 0x9b, 0x4a, 0xd5, 0x3a, 0xf9, 0x67, - 0x32, 0xa4, 0x02, 0x71, 0xbb, 0xe8, 0xbf, 0x5b, 0x16, 0x7e, 0xf0, 0x6d, 0xfc, 0x49, 0x89, 0xcd, - 0x24, 0x7e, 0xcf, 0x62, 0x5c, 0xb6, 0x4e, 0xfe, 0x91, 0x4d, 0xe5, 0x8a, 0x35, 0xcc, 0x2f, 0x62, - 0x28, 0xec, 0x26, 0x7a, 0x12, 0xb2, 0x34, 0xc2, 0xa0, 0x55, 0x24, 0xcd, 0x5f, 0x97, 0xd8, 0xa9, - 0xe4, 0xcf, 0x5e, 0x8c, 0xdc, 0x4a, 0x45, 0x3f, 0xaa, 0xa9, 0x5c, 0xb5, 0x86, 0xf9, 0xe9, 0x4c, - 0x95, 0x72, 0xa6, 0x47, 0x4d, 0x5e, 0x3f, 0x40, 0x3b, 0x88, 0x85, 0x21, 0xc6, 0x46, 0x8f, 0x1e, - 0x70, 0x4c, 0xdf, 0x96, 0xd8, 0xa4, 0x5a, 0xc2, 0xb8, 0x68, 0x1d, 0xff, 0x43, 0x9b, 0x8a, 0x69, - 0x9d, 0xf0, 0xed, 0x78, 0x95, 0x6a, 0x27, 0x3d, 0x06, 0x3f, 0x4d, 0xa7, 0x87, 0x26, 0x58, 0x4c, - 0x9e, 0x8e, 0xca, 0x4d, 0x51, 0x0e, 0xfd, 0x2e, 0x6e, 0x19, 0x7f, 0x5e, 0x62, 0xac, 0xff, 0x69, - 0x83, 0x51, 0xb5, 0x4e, 0xfc, 0x9a, 0xbc, 0x72, 0xd9, 0x3a, 0xf9, 0xd3, 0x88, 0xaa, 0xca, 0x24, - 0xe5, 0xb7, 0xe3, 0x22, 0xf5, 0x71, 0xb6, 0xb3, 0x17, 0x74, 0x23, 0xfc, 0xce, 0xb8, 0xe8, 0xb3, - 0x73, 0x88, 0xc0, 0x7f, 0x09, 0xca, 0x93, 0x78, 0xe1, 0x37, 0x2e, 0x0f, 0xf1, 0x19, 0x43, 0x5e, - 0x79, 0x8a, 0xbe, 0x11, 0xf8, 0x3e, 0x52, 0xfd, 0x21, 0x28, 0x51, 0x92, 0xde, 0x36, 0xae, 0x0c, - 0xf3, 0xd6, 0x99, 0x57, 0xa2, 0x42, 0x8a, 0xbc, 0xaa, 0xe2, 0xb9, 0x16, 0x4c, 0x06, 0xda, 0xbe, - 0x0c, 0x50, 0x83, 0x3a, 0x74, 0x8b, 0x96, 0xf1, 0x6b, 0x36, 0x21, 0xc9, 0x3d, 0xe3, 0x82, 0x75, - 0x2c, 0x0f, 0x5e, 0xb9, 0x68, 0x9d, 0x40, 0x0a, 0x12, 0xf9, 0x2a, 0x1b, 0x8b, 0xcf, 0x22, 0xcb, - 0x94, 0xfe, 0x4b, 0x89, 0x2d, 0x16, 0x92, 0x6f, 0xc6, 0x4d, 0xeb, 0x55, 0xd8, 0xc5, 0x8a, 0x65, - 0xbd, 0x12, 0xa5, 0x57, 0xa5, 0xf4, 0x4e, 0x46, 0x20, 0x21, 0x53, 0x3b, 0x2a, 0xbc, 0x54, 0x22, - 0x57, 0xcf, 0xf2, 0x68, 0x1c, 0x67, 0x53, 0xba, 0x97, 0xdd, 0x83, 0xf1, 0x77, 0x25, 0x36, 0x9f, - 0x5d, 0xcc, 0x58, 0xb2, 0x86, 0x64, 0x00, 0x2b, 0xcb, 0x43, 0xd3, 0x59, 0x55, 0xfa, 0x0d, 0x40, - 0x56, 0xe6, 0x62, 0xd2, 0x2f, 0x2f, 0xe6, 0xdf, 0x94, 0x98, 0x91, 0x27, 0x16, 0x8c, 0xdc, 0xfb, - 0xfa, 0x60, 0xe6, 0xaa, 0x72, 0xc3, 0x7a, 0x05, 0xa2, 0x82, 0x3e, 0x02, 0x51, 0x03, 0x72, 0x9c, - 0x48, 0x9c, 0x38, 0xa3, 0x06, 0x1a, 0x7f, 0x04, 0x1e, 0xa3, 0x1f, 0x6f, 0xf3, 0x1e, 0x23, 0x9f, - 0xb3, 0xe6, 0x3d, 0x46, 0x41, 0xbc, 0x96, 0xda, 0xb8, 0xc5, 0x43, 0x54, 0x43, 0x41, 0x86, 0x48, - 0x29, 0x36, 0xe5, 0x96, 0x24, 0x41, 0xc6, 0x24, 0x2b, 0xf2, 0x37, 0x82, 0x44, 0xcc, 0x78, 0x75, - 0x72, 0x6d, 0xf8, 0x2d, 0xb6, 0xc8, 0x3d, 0xf0, 0xe0, 0xd9, 0xd7, 0x46, 0xbf, 0x2d, 0x95, 0xfe, - 0x3f, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x8f, 0x7b, 0xab, 0xe5, 0x3a, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/econ.go b/vendor/github.com/Philipp15b/go-steam/tf2/protocol/econ.go deleted file mode 100644 index aabb2ea8..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/econ.go +++ /dev/null @@ -1,51 +0,0 @@ -package protocol - -import ( - "encoding/binary" - "io" -) - -type MsgGCSetItemPosition struct { - AssetId, Position uint64 -} - -func (m *MsgGCSetItemPosition) Serialize(w io.Writer) error { - return binary.Write(w, binary.LittleEndian, m) -} - -type MsgGCCraft struct { - Recipe int16 // -2 = wildcard - numItems int16 - Items []uint64 -} - -func (m *MsgGCCraft) Serialize(w io.Writer) error { - m.numItems = int16(len(m.Items)) - return binary.Write(w, binary.LittleEndian, m) -} - -type MsgGCDeleteItem struct { - ItemId uint64 -} - -func (m *MsgGCDeleteItem) Serialize(w io.Writer) error { - return binary.Write(w, binary.LittleEndian, m.ItemId) -} - -type MsgGCNameItem struct { - Tool, Target uint64 - Name string -} - -func (m *MsgGCNameItem) Serialize(w io.Writer) error { - err := binary.Write(w, binary.LittleEndian, m.Tool) - if err != nil { - return err - } - err = binary.Write(w, binary.LittleEndian, m.Target) - if err != nil { - return err - } - _, err = w.Write([]byte(m.Name)) - return err -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/base.pb.go b/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/base.pb.go deleted file mode 100644 index 9a47a324..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/base.pb.go +++ /dev/null @@ -1,3676 +0,0 @@ -// Code generated by protoc-gen-go. -// source: base_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type EGCBaseMsg int32 - -const ( - EGCBaseMsg_k_EMsgGCSystemMessage EGCBaseMsg = 4001 - EGCBaseMsg_k_EMsgGCReplicateConVars EGCBaseMsg = 4002 - EGCBaseMsg_k_EMsgGCConVarUpdated EGCBaseMsg = 4003 - EGCBaseMsg_k_EMsgGCInviteToParty EGCBaseMsg = 4501 - EGCBaseMsg_k_EMsgGCInvitationCreated EGCBaseMsg = 4502 - EGCBaseMsg_k_EMsgGCPartyInviteResponse EGCBaseMsg = 4503 - EGCBaseMsg_k_EMsgGCKickFromParty EGCBaseMsg = 4504 - EGCBaseMsg_k_EMsgGCLeaveParty EGCBaseMsg = 4505 - EGCBaseMsg_k_EMsgGCServerAvailable EGCBaseMsg = 4506 - EGCBaseMsg_k_EMsgGCClientConnectToServer EGCBaseMsg = 4507 - EGCBaseMsg_k_EMsgGCGameServerInfo EGCBaseMsg = 4508 - EGCBaseMsg_k_EMsgGCError EGCBaseMsg = 4509 - EGCBaseMsg_k_EMsgGCReplay_UploadedToYouTube EGCBaseMsg = 4510 - EGCBaseMsg_k_EMsgGCLANServerAvailable EGCBaseMsg = 4511 -) - -var EGCBaseMsg_name = map[int32]string{ - 4001: "k_EMsgGCSystemMessage", - 4002: "k_EMsgGCReplicateConVars", - 4003: "k_EMsgGCConVarUpdated", - 4501: "k_EMsgGCInviteToParty", - 4502: "k_EMsgGCInvitationCreated", - 4503: "k_EMsgGCPartyInviteResponse", - 4504: "k_EMsgGCKickFromParty", - 4505: "k_EMsgGCLeaveParty", - 4506: "k_EMsgGCServerAvailable", - 4507: "k_EMsgGCClientConnectToServer", - 4508: "k_EMsgGCGameServerInfo", - 4509: "k_EMsgGCError", - 4510: "k_EMsgGCReplay_UploadedToYouTube", - 4511: "k_EMsgGCLANServerAvailable", -} -var EGCBaseMsg_value = map[string]int32{ - "k_EMsgGCSystemMessage": 4001, - "k_EMsgGCReplicateConVars": 4002, - "k_EMsgGCConVarUpdated": 4003, - "k_EMsgGCInviteToParty": 4501, - "k_EMsgGCInvitationCreated": 4502, - "k_EMsgGCPartyInviteResponse": 4503, - "k_EMsgGCKickFromParty": 4504, - "k_EMsgGCLeaveParty": 4505, - "k_EMsgGCServerAvailable": 4506, - "k_EMsgGCClientConnectToServer": 4507, - "k_EMsgGCGameServerInfo": 4508, - "k_EMsgGCError": 4509, - "k_EMsgGCReplay_UploadedToYouTube": 4510, - "k_EMsgGCLANServerAvailable": 4511, -} - -func (x EGCBaseMsg) Enum() *EGCBaseMsg { - p := new(EGCBaseMsg) - *p = x - return p -} -func (x EGCBaseMsg) String() string { - return proto.EnumName(EGCBaseMsg_name, int32(x)) -} -func (x *EGCBaseMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCBaseMsg_value, data, "EGCBaseMsg") - if err != nil { - return err - } - *x = EGCBaseMsg(value) - return nil -} -func (EGCBaseMsg) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{0} } - -type EGCBaseProtoObjectTypes int32 - -const ( - EGCBaseProtoObjectTypes_k_EProtoObjectPartyInvite EGCBaseProtoObjectTypes = 1001 - EGCBaseProtoObjectTypes_k_EProtoObjectLobbyInvite EGCBaseProtoObjectTypes = 1002 -) - -var EGCBaseProtoObjectTypes_name = map[int32]string{ - 1001: "k_EProtoObjectPartyInvite", - 1002: "k_EProtoObjectLobbyInvite", -} -var EGCBaseProtoObjectTypes_value = map[string]int32{ - "k_EProtoObjectPartyInvite": 1001, - "k_EProtoObjectLobbyInvite": 1002, -} - -func (x EGCBaseProtoObjectTypes) Enum() *EGCBaseProtoObjectTypes { - p := new(EGCBaseProtoObjectTypes) - *p = x - return p -} -func (x EGCBaseProtoObjectTypes) String() string { - return proto.EnumName(EGCBaseProtoObjectTypes_name, int32(x)) -} -func (x *EGCBaseProtoObjectTypes) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCBaseProtoObjectTypes_value, data, "EGCBaseProtoObjectTypes") - if err != nil { - return err - } - *x = EGCBaseProtoObjectTypes(value) - return nil -} -func (EGCBaseProtoObjectTypes) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{1} } - -type GCGoodbyeReason int32 - -const ( - GCGoodbyeReason_GCGoodbyeReason_GC_GOING_DOWN GCGoodbyeReason = 1 - GCGoodbyeReason_GCGoodbyeReason_NO_SESSION GCGoodbyeReason = 2 -) - -var GCGoodbyeReason_name = map[int32]string{ - 1: "GCGoodbyeReason_GC_GOING_DOWN", - 2: "GCGoodbyeReason_NO_SESSION", -} -var GCGoodbyeReason_value = map[string]int32{ - "GCGoodbyeReason_GC_GOING_DOWN": 1, - "GCGoodbyeReason_NO_SESSION": 2, -} - -func (x GCGoodbyeReason) Enum() *GCGoodbyeReason { - p := new(GCGoodbyeReason) - *p = x - return p -} -func (x GCGoodbyeReason) String() string { - return proto.EnumName(GCGoodbyeReason_name, int32(x)) -} -func (x *GCGoodbyeReason) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(GCGoodbyeReason_value, data, "GCGoodbyeReason") - if err != nil { - return err - } - *x = GCGoodbyeReason(value) - return nil -} -func (GCGoodbyeReason) EnumDescriptor() ([]byte, []int) { return base_fileDescriptor0, []int{2} } - -type CGCStorePurchaseInit_LineItem struct { - ItemDefId *uint32 `protobuf:"varint,1,opt,name=item_def_id" json:"item_def_id,omitempty"` - Quantity *uint32 `protobuf:"varint,2,opt,name=quantity" json:"quantity,omitempty"` - CostInLocalCurrency *uint32 `protobuf:"varint,3,opt,name=cost_in_local_currency" json:"cost_in_local_currency,omitempty"` - PurchaseType *uint32 `protobuf:"varint,4,opt,name=purchase_type" json:"purchase_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCStorePurchaseInit_LineItem) Reset() { *m = CGCStorePurchaseInit_LineItem{} } -func (m *CGCStorePurchaseInit_LineItem) String() string { return proto.CompactTextString(m) } -func (*CGCStorePurchaseInit_LineItem) ProtoMessage() {} -func (*CGCStorePurchaseInit_LineItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{0} } - -func (m *CGCStorePurchaseInit_LineItem) GetItemDefId() uint32 { - if m != nil && m.ItemDefId != nil { - return *m.ItemDefId - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetQuantity() uint32 { - if m != nil && m.Quantity != nil { - return *m.Quantity - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetCostInLocalCurrency() uint32 { - if m != nil && m.CostInLocalCurrency != nil { - return *m.CostInLocalCurrency - } - return 0 -} - -func (m *CGCStorePurchaseInit_LineItem) GetPurchaseType() uint32 { - if m != nil && m.PurchaseType != nil { - return *m.PurchaseType - } - return 0 -} - -type CMsgGCStorePurchaseInit struct { - Country *string `protobuf:"bytes,1,opt,name=country" json:"country,omitempty"` - Language *int32 `protobuf:"varint,2,opt,name=language" json:"language,omitempty"` - Currency *int32 `protobuf:"varint,3,opt,name=currency" json:"currency,omitempty"` - LineItems []*CGCStorePurchaseInit_LineItem `protobuf:"bytes,4,rep,name=line_items" json:"line_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseInit) Reset() { *m = CMsgGCStorePurchaseInit{} } -func (m *CMsgGCStorePurchaseInit) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseInit) ProtoMessage() {} -func (*CMsgGCStorePurchaseInit) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{1} } - -func (m *CMsgGCStorePurchaseInit) GetCountry() string { - if m != nil && m.Country != nil { - return *m.Country - } - return "" -} - -func (m *CMsgGCStorePurchaseInit) GetLanguage() int32 { - if m != nil && m.Language != nil { - return *m.Language - } - return 0 -} - -func (m *CMsgGCStorePurchaseInit) GetCurrency() int32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -func (m *CMsgGCStorePurchaseInit) GetLineItems() []*CGCStorePurchaseInit_LineItem { - if m != nil { - return m.LineItems - } - return nil -} - -type CMsgGCStorePurchaseInitResponse struct { - Result *int32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - TxnId *uint64 `protobuf:"varint,2,opt,name=txn_id" json:"txn_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseInitResponse) Reset() { *m = CMsgGCStorePurchaseInitResponse{} } -func (m *CMsgGCStorePurchaseInitResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseInitResponse) ProtoMessage() {} -func (*CMsgGCStorePurchaseInitResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{2} } - -func (m *CMsgGCStorePurchaseInitResponse) GetResult() int32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGCStorePurchaseInitResponse) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -type CSOPartyInvite struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - SenderName *string `protobuf:"bytes,3,opt,name=sender_name" json:"sender_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOPartyInvite) Reset() { *m = CSOPartyInvite{} } -func (m *CSOPartyInvite) String() string { return proto.CompactTextString(m) } -func (*CSOPartyInvite) ProtoMessage() {} -func (*CSOPartyInvite) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{3} } - -func (m *CSOPartyInvite) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CSOPartyInvite) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CSOPartyInvite) GetSenderName() string { - if m != nil && m.SenderName != nil { - return *m.SenderName - } - return "" -} - -type CSOLobbyInvite struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - SenderName *string `protobuf:"bytes,3,opt,name=sender_name" json:"sender_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOLobbyInvite) Reset() { *m = CSOLobbyInvite{} } -func (m *CSOLobbyInvite) String() string { return proto.CompactTextString(m) } -func (*CSOLobbyInvite) ProtoMessage() {} -func (*CSOLobbyInvite) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{4} } - -func (m *CSOLobbyInvite) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CSOLobbyInvite) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CSOLobbyInvite) GetSenderName() string { - if m != nil && m.SenderName != nil { - return *m.SenderName - } - return "" -} - -type CMsgSystemBroadcast struct { - Message *string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSystemBroadcast) Reset() { *m = CMsgSystemBroadcast{} } -func (m *CMsgSystemBroadcast) String() string { return proto.CompactTextString(m) } -func (*CMsgSystemBroadcast) ProtoMessage() {} -func (*CMsgSystemBroadcast) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{5} } - -func (m *CMsgSystemBroadcast) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type CMsgClientHello struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientHello) Reset() { *m = CMsgClientHello{} } -func (m *CMsgClientHello) String() string { return proto.CompactTextString(m) } -func (*CMsgClientHello) ProtoMessage() {} -func (*CMsgClientHello) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{6} } - -func (m *CMsgClientHello) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgServerHello struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerHello) Reset() { *m = CMsgServerHello{} } -func (m *CMsgServerHello) String() string { return proto.CompactTextString(m) } -func (*CMsgServerHello) ProtoMessage() {} -func (*CMsgServerHello) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{7} } - -func (m *CMsgServerHello) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgClientWelcome struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - GameData []byte `protobuf:"bytes,2,opt,name=game_data" json:"game_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientWelcome) Reset() { *m = CMsgClientWelcome{} } -func (m *CMsgClientWelcome) String() string { return proto.CompactTextString(m) } -func (*CMsgClientWelcome) ProtoMessage() {} -func (*CMsgClientWelcome) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{8} } - -func (m *CMsgClientWelcome) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgClientWelcome) GetGameData() []byte { - if m != nil { - return m.GameData - } - return nil -} - -type CMsgServerWelcome struct { - MinAllowedVersion *uint32 `protobuf:"varint,1,opt,name=min_allowed_version" json:"min_allowed_version,omitempty"` - ActiveVersion *uint32 `protobuf:"varint,2,opt,name=active_version" json:"active_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerWelcome) Reset() { *m = CMsgServerWelcome{} } -func (m *CMsgServerWelcome) String() string { return proto.CompactTextString(m) } -func (*CMsgServerWelcome) ProtoMessage() {} -func (*CMsgServerWelcome) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{9} } - -func (m *CMsgServerWelcome) GetMinAllowedVersion() uint32 { - if m != nil && m.MinAllowedVersion != nil { - return *m.MinAllowedVersion - } - return 0 -} - -func (m *CMsgServerWelcome) GetActiveVersion() uint32 { - if m != nil && m.ActiveVersion != nil { - return *m.ActiveVersion - } - return 0 -} - -type CMsgClientGoodbye struct { - Reason *GCGoodbyeReason `protobuf:"varint,1,opt,name=reason,enum=GCGoodbyeReason,def=1" json:"reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgClientGoodbye) Reset() { *m = CMsgClientGoodbye{} } -func (m *CMsgClientGoodbye) String() string { return proto.CompactTextString(m) } -func (*CMsgClientGoodbye) ProtoMessage() {} -func (*CMsgClientGoodbye) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{10} } - -const Default_CMsgClientGoodbye_Reason GCGoodbyeReason = GCGoodbyeReason_GCGoodbyeReason_GC_GOING_DOWN - -func (m *CMsgClientGoodbye) GetReason() GCGoodbyeReason { - if m != nil && m.Reason != nil { - return *m.Reason - } - return Default_CMsgClientGoodbye_Reason -} - -type CMsgServerGoodbye struct { - Reason *GCGoodbyeReason `protobuf:"varint,1,opt,name=reason,enum=GCGoodbyeReason,def=1" json:"reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerGoodbye) Reset() { *m = CMsgServerGoodbye{} } -func (m *CMsgServerGoodbye) String() string { return proto.CompactTextString(m) } -func (*CMsgServerGoodbye) ProtoMessage() {} -func (*CMsgServerGoodbye) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{11} } - -const Default_CMsgServerGoodbye_Reason GCGoodbyeReason = GCGoodbyeReason_GCGoodbyeReason_GC_GOING_DOWN - -func (m *CMsgServerGoodbye) GetReason() GCGoodbyeReason { - if m != nil && m.Reason != nil { - return *m.Reason - } - return Default_CMsgServerGoodbye_Reason -} - -type CMsgInviteToParty struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - ClientVersion *uint32 `protobuf:"varint,2,opt,name=client_version" json:"client_version,omitempty"` - TeamId *uint32 `protobuf:"varint,3,opt,name=team_id" json:"team_id,omitempty"` - AsCoach *bool `protobuf:"varint,4,opt,name=as_coach" json:"as_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgInviteToParty) Reset() { *m = CMsgInviteToParty{} } -func (m *CMsgInviteToParty) String() string { return proto.CompactTextString(m) } -func (*CMsgInviteToParty) ProtoMessage() {} -func (*CMsgInviteToParty) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{12} } - -func (m *CMsgInviteToParty) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgInviteToParty) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgInviteToParty) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgInviteToParty) GetAsCoach() bool { - if m != nil && m.AsCoach != nil { - return *m.AsCoach - } - return false -} - -type CMsgInvitationCreated struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgInvitationCreated) Reset() { *m = CMsgInvitationCreated{} } -func (m *CMsgInvitationCreated) String() string { return proto.CompactTextString(m) } -func (*CMsgInvitationCreated) ProtoMessage() {} -func (*CMsgInvitationCreated) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{13} } - -func (m *CMsgInvitationCreated) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CMsgInvitationCreated) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgPartyInviteResponse struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - Accept *bool `protobuf:"varint,2,opt,name=accept" json:"accept,omitempty"` - ClientVersion *uint32 `protobuf:"varint,3,opt,name=client_version" json:"client_version,omitempty"` - TeamId *uint32 `protobuf:"varint,4,opt,name=team_id" json:"team_id,omitempty"` - AsCoach *bool `protobuf:"varint,5,opt,name=as_coach" json:"as_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgPartyInviteResponse) Reset() { *m = CMsgPartyInviteResponse{} } -func (m *CMsgPartyInviteResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgPartyInviteResponse) ProtoMessage() {} -func (*CMsgPartyInviteResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{14} } - -func (m *CMsgPartyInviteResponse) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgPartyInviteResponse) GetAccept() bool { - if m != nil && m.Accept != nil { - return *m.Accept - } - return false -} - -func (m *CMsgPartyInviteResponse) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return 0 -} - -func (m *CMsgPartyInviteResponse) GetTeamId() uint32 { - if m != nil && m.TeamId != nil { - return *m.TeamId - } - return 0 -} - -func (m *CMsgPartyInviteResponse) GetAsCoach() bool { - if m != nil && m.AsCoach != nil { - return *m.AsCoach - } - return false -} - -type CMsgKickFromParty struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgKickFromParty) Reset() { *m = CMsgKickFromParty{} } -func (m *CMsgKickFromParty) String() string { return proto.CompactTextString(m) } -func (*CMsgKickFromParty) ProtoMessage() {} -func (*CMsgKickFromParty) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{15} } - -func (m *CMsgKickFromParty) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgLeaveParty struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeaveParty) Reset() { *m = CMsgLeaveParty{} } -func (m *CMsgLeaveParty) String() string { return proto.CompactTextString(m) } -func (*CMsgLeaveParty) ProtoMessage() {} -func (*CMsgLeaveParty) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{16} } - -type CMsgServerAvailable struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgServerAvailable) Reset() { *m = CMsgServerAvailable{} } -func (m *CMsgServerAvailable) String() string { return proto.CompactTextString(m) } -func (*CMsgServerAvailable) ProtoMessage() {} -func (*CMsgServerAvailable) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{17} } - -type CMsgLANServerAvailable struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLANServerAvailable) Reset() { *m = CMsgLANServerAvailable{} } -func (m *CMsgLANServerAvailable) String() string { return proto.CompactTextString(m) } -func (*CMsgLANServerAvailable) ProtoMessage() {} -func (*CMsgLANServerAvailable) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{18} } - -func (m *CMsgLANServerAvailable) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -type CSOEconGameAccountClient struct { - AdditionalBackpackSlots *uint32 `protobuf:"varint,1,opt,name=additional_backpack_slots,def=0" json:"additional_backpack_slots,omitempty"` - TrialAccount *bool `protobuf:"varint,2,opt,name=trial_account,def=0" json:"trial_account,omitempty"` - NeedToChooseMostHelpfulFriend *bool `protobuf:"varint,4,opt,name=need_to_choose_most_helpful_friend" json:"need_to_choose_most_helpful_friend,omitempty"` - InCoachesList *bool `protobuf:"varint,5,opt,name=in_coaches_list" json:"in_coaches_list,omitempty"` - TradeBanExpiration *uint32 `protobuf:"fixed32,6,opt,name=trade_ban_expiration" json:"trade_ban_expiration,omitempty"` - DuelBanExpiration *uint32 `protobuf:"fixed32,7,opt,name=duel_ban_expiration" json:"duel_ban_expiration,omitempty"` - PreviewItemDef *uint32 `protobuf:"varint,8,opt,name=preview_item_def,def=0" json:"preview_item_def,omitempty"` - PreventMatchUntilDate *uint32 `protobuf:"varint,18,opt,name=prevent_match_until_date" json:"prevent_match_until_date,omitempty"` - PhoneVerified *bool `protobuf:"varint,19,opt,name=phone_verified,def=0" json:"phone_verified,omitempty"` - SkillRating_6V6 *uint32 `protobuf:"varint,20,opt,name=skill_rating_6v6" json:"skill_rating_6v6,omitempty"` - SkillRating_9V9 *uint32 `protobuf:"varint,21,opt,name=skill_rating_9v9" json:"skill_rating_9v9,omitempty"` - TwoFactorEnabled *bool `protobuf:"varint,22,opt,name=two_factor_enabled,def=0" json:"two_factor_enabled,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconGameAccountClient) Reset() { *m = CSOEconGameAccountClient{} } -func (m *CSOEconGameAccountClient) String() string { return proto.CompactTextString(m) } -func (*CSOEconGameAccountClient) ProtoMessage() {} -func (*CSOEconGameAccountClient) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{19} } - -const Default_CSOEconGameAccountClient_AdditionalBackpackSlots uint32 = 0 -const Default_CSOEconGameAccountClient_TrialAccount bool = false -const Default_CSOEconGameAccountClient_PreviewItemDef uint32 = 0 -const Default_CSOEconGameAccountClient_PhoneVerified bool = false -const Default_CSOEconGameAccountClient_TwoFactorEnabled bool = false - -func (m *CSOEconGameAccountClient) GetAdditionalBackpackSlots() uint32 { - if m != nil && m.AdditionalBackpackSlots != nil { - return *m.AdditionalBackpackSlots - } - return Default_CSOEconGameAccountClient_AdditionalBackpackSlots -} - -func (m *CSOEconGameAccountClient) GetTrialAccount() bool { - if m != nil && m.TrialAccount != nil { - return *m.TrialAccount - } - return Default_CSOEconGameAccountClient_TrialAccount -} - -func (m *CSOEconGameAccountClient) GetNeedToChooseMostHelpfulFriend() bool { - if m != nil && m.NeedToChooseMostHelpfulFriend != nil { - return *m.NeedToChooseMostHelpfulFriend - } - return false -} - -func (m *CSOEconGameAccountClient) GetInCoachesList() bool { - if m != nil && m.InCoachesList != nil { - return *m.InCoachesList - } - return false -} - -func (m *CSOEconGameAccountClient) GetTradeBanExpiration() uint32 { - if m != nil && m.TradeBanExpiration != nil { - return *m.TradeBanExpiration - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetDuelBanExpiration() uint32 { - if m != nil && m.DuelBanExpiration != nil { - return *m.DuelBanExpiration - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetPreviewItemDef() uint32 { - if m != nil && m.PreviewItemDef != nil { - return *m.PreviewItemDef - } - return Default_CSOEconGameAccountClient_PreviewItemDef -} - -func (m *CSOEconGameAccountClient) GetPreventMatchUntilDate() uint32 { - if m != nil && m.PreventMatchUntilDate != nil { - return *m.PreventMatchUntilDate - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetPhoneVerified() bool { - if m != nil && m.PhoneVerified != nil { - return *m.PhoneVerified - } - return Default_CSOEconGameAccountClient_PhoneVerified -} - -func (m *CSOEconGameAccountClient) GetSkillRating_6V6() uint32 { - if m != nil && m.SkillRating_6V6 != nil { - return *m.SkillRating_6V6 - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetSkillRating_9V9() uint32 { - if m != nil && m.SkillRating_9V9 != nil { - return *m.SkillRating_9V9 - } - return 0 -} - -func (m *CSOEconGameAccountClient) GetTwoFactorEnabled() bool { - if m != nil && m.TwoFactorEnabled != nil { - return *m.TwoFactorEnabled - } - return Default_CSOEconGameAccountClient_TwoFactorEnabled -} - -type CSOItemCriteriaCondition struct { - Op *int32 `protobuf:"varint,1,opt,name=op" json:"op,omitempty"` - Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` - Required *bool `protobuf:"varint,3,opt,name=required" json:"required,omitempty"` - FloatValue *float32 `protobuf:"fixed32,4,opt,name=float_value" json:"float_value,omitempty"` - StringValue *string `protobuf:"bytes,5,opt,name=string_value" json:"string_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOItemCriteriaCondition) Reset() { *m = CSOItemCriteriaCondition{} } -func (m *CSOItemCriteriaCondition) String() string { return proto.CompactTextString(m) } -func (*CSOItemCriteriaCondition) ProtoMessage() {} -func (*CSOItemCriteriaCondition) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{20} } - -func (m *CSOItemCriteriaCondition) GetOp() int32 { - if m != nil && m.Op != nil { - return *m.Op - } - return 0 -} - -func (m *CSOItemCriteriaCondition) GetField() string { - if m != nil && m.Field != nil { - return *m.Field - } - return "" -} - -func (m *CSOItemCriteriaCondition) GetRequired() bool { - if m != nil && m.Required != nil { - return *m.Required - } - return false -} - -func (m *CSOItemCriteriaCondition) GetFloatValue() float32 { - if m != nil && m.FloatValue != nil { - return *m.FloatValue - } - return 0 -} - -func (m *CSOItemCriteriaCondition) GetStringValue() string { - if m != nil && m.StringValue != nil { - return *m.StringValue - } - return "" -} - -type CSOItemCriteria struct { - ItemLevel *uint32 `protobuf:"varint,1,opt,name=item_level" json:"item_level,omitempty"` - ItemQuality *int32 `protobuf:"varint,2,opt,name=item_quality" json:"item_quality,omitempty"` - ItemLevelSet *bool `protobuf:"varint,3,opt,name=item_level_set" json:"item_level_set,omitempty"` - ItemQualitySet *bool `protobuf:"varint,4,opt,name=item_quality_set" json:"item_quality_set,omitempty"` - InitialInventory *uint32 `protobuf:"varint,5,opt,name=initial_inventory" json:"initial_inventory,omitempty"` - InitialQuantity *uint32 `protobuf:"varint,6,opt,name=initial_quantity" json:"initial_quantity,omitempty"` - IgnoreEnabledFlag *bool `protobuf:"varint,8,opt,name=ignore_enabled_flag" json:"ignore_enabled_flag,omitempty"` - Conditions []*CSOItemCriteriaCondition `protobuf:"bytes,9,rep,name=conditions" json:"conditions,omitempty"` - RecentOnly *bool `protobuf:"varint,10,opt,name=recent_only" json:"recent_only,omitempty"` - Tags *string `protobuf:"bytes,11,opt,name=tags" json:"tags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOItemCriteria) Reset() { *m = CSOItemCriteria{} } -func (m *CSOItemCriteria) String() string { return proto.CompactTextString(m) } -func (*CSOItemCriteria) ProtoMessage() {} -func (*CSOItemCriteria) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{21} } - -func (m *CSOItemCriteria) GetItemLevel() uint32 { - if m != nil && m.ItemLevel != nil { - return *m.ItemLevel - } - return 0 -} - -func (m *CSOItemCriteria) GetItemQuality() int32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CSOItemCriteria) GetItemLevelSet() bool { - if m != nil && m.ItemLevelSet != nil { - return *m.ItemLevelSet - } - return false -} - -func (m *CSOItemCriteria) GetItemQualitySet() bool { - if m != nil && m.ItemQualitySet != nil { - return *m.ItemQualitySet - } - return false -} - -func (m *CSOItemCriteria) GetInitialInventory() uint32 { - if m != nil && m.InitialInventory != nil { - return *m.InitialInventory - } - return 0 -} - -func (m *CSOItemCriteria) GetInitialQuantity() uint32 { - if m != nil && m.InitialQuantity != nil { - return *m.InitialQuantity - } - return 0 -} - -func (m *CSOItemCriteria) GetIgnoreEnabledFlag() bool { - if m != nil && m.IgnoreEnabledFlag != nil { - return *m.IgnoreEnabledFlag - } - return false -} - -func (m *CSOItemCriteria) GetConditions() []*CSOItemCriteriaCondition { - if m != nil { - return m.Conditions - } - return nil -} - -func (m *CSOItemCriteria) GetRecentOnly() bool { - if m != nil && m.RecentOnly != nil { - return *m.RecentOnly - } - return false -} - -func (m *CSOItemCriteria) GetTags() string { - if m != nil && m.Tags != nil { - return *m.Tags - } - return "" -} - -type CSOItemRecipe struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - NA *string `protobuf:"bytes,3,opt,name=n_a" json:"n_a,omitempty"` - DescInputs *string `protobuf:"bytes,4,opt,name=desc_inputs" json:"desc_inputs,omitempty"` - DescOutputs *string `protobuf:"bytes,5,opt,name=desc_outputs" json:"desc_outputs,omitempty"` - DiA *string `protobuf:"bytes,6,opt,name=di_a" json:"di_a,omitempty"` - DiB *string `protobuf:"bytes,7,opt,name=di_b" json:"di_b,omitempty"` - DiC *string `protobuf:"bytes,8,opt,name=di_c" json:"di_c,omitempty"` - DoA *string `protobuf:"bytes,9,opt,name=do_a" json:"do_a,omitempty"` - DoB *string `protobuf:"bytes,10,opt,name=do_b" json:"do_b,omitempty"` - DoC *string `protobuf:"bytes,11,opt,name=do_c" json:"do_c,omitempty"` - RequiresAllSameClass *bool `protobuf:"varint,12,opt,name=requires_all_same_class" json:"requires_all_same_class,omitempty"` - RequiresAllSameSlot *bool `protobuf:"varint,13,opt,name=requires_all_same_slot" json:"requires_all_same_slot,omitempty"` - ClassUsageForOutput *int32 `protobuf:"varint,14,opt,name=class_usage_for_output" json:"class_usage_for_output,omitempty"` - SlotUsageForOutput *int32 `protobuf:"varint,15,opt,name=slot_usage_for_output" json:"slot_usage_for_output,omitempty"` - SetForOutput *int32 `protobuf:"varint,16,opt,name=set_for_output" json:"set_for_output,omitempty"` - InputItemsCriteria []*CSOItemCriteria `protobuf:"bytes,20,rep,name=input_items_criteria" json:"input_items_criteria,omitempty"` - OutputItemsCriteria []*CSOItemCriteria `protobuf:"bytes,21,rep,name=output_items_criteria" json:"output_items_criteria,omitempty"` - InputItemDupeCounts []uint32 `protobuf:"varint,22,rep,name=input_item_dupe_counts" json:"input_item_dupe_counts,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOItemRecipe) Reset() { *m = CSOItemRecipe{} } -func (m *CSOItemRecipe) String() string { return proto.CompactTextString(m) } -func (*CSOItemRecipe) ProtoMessage() {} -func (*CSOItemRecipe) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{22} } - -func (m *CSOItemRecipe) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOItemRecipe) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CSOItemRecipe) GetNA() string { - if m != nil && m.NA != nil { - return *m.NA - } - return "" -} - -func (m *CSOItemRecipe) GetDescInputs() string { - if m != nil && m.DescInputs != nil { - return *m.DescInputs - } - return "" -} - -func (m *CSOItemRecipe) GetDescOutputs() string { - if m != nil && m.DescOutputs != nil { - return *m.DescOutputs - } - return "" -} - -func (m *CSOItemRecipe) GetDiA() string { - if m != nil && m.DiA != nil { - return *m.DiA - } - return "" -} - -func (m *CSOItemRecipe) GetDiB() string { - if m != nil && m.DiB != nil { - return *m.DiB - } - return "" -} - -func (m *CSOItemRecipe) GetDiC() string { - if m != nil && m.DiC != nil { - return *m.DiC - } - return "" -} - -func (m *CSOItemRecipe) GetDoA() string { - if m != nil && m.DoA != nil { - return *m.DoA - } - return "" -} - -func (m *CSOItemRecipe) GetDoB() string { - if m != nil && m.DoB != nil { - return *m.DoB - } - return "" -} - -func (m *CSOItemRecipe) GetDoC() string { - if m != nil && m.DoC != nil { - return *m.DoC - } - return "" -} - -func (m *CSOItemRecipe) GetRequiresAllSameClass() bool { - if m != nil && m.RequiresAllSameClass != nil { - return *m.RequiresAllSameClass - } - return false -} - -func (m *CSOItemRecipe) GetRequiresAllSameSlot() bool { - if m != nil && m.RequiresAllSameSlot != nil { - return *m.RequiresAllSameSlot - } - return false -} - -func (m *CSOItemRecipe) GetClassUsageForOutput() int32 { - if m != nil && m.ClassUsageForOutput != nil { - return *m.ClassUsageForOutput - } - return 0 -} - -func (m *CSOItemRecipe) GetSlotUsageForOutput() int32 { - if m != nil && m.SlotUsageForOutput != nil { - return *m.SlotUsageForOutput - } - return 0 -} - -func (m *CSOItemRecipe) GetSetForOutput() int32 { - if m != nil && m.SetForOutput != nil { - return *m.SetForOutput - } - return 0 -} - -func (m *CSOItemRecipe) GetInputItemsCriteria() []*CSOItemCriteria { - if m != nil { - return m.InputItemsCriteria - } - return nil -} - -func (m *CSOItemRecipe) GetOutputItemsCriteria() []*CSOItemCriteria { - if m != nil { - return m.OutputItemsCriteria - } - return nil -} - -func (m *CSOItemRecipe) GetInputItemDupeCounts() []uint32 { - if m != nil { - return m.InputItemDupeCounts - } - return nil -} - -type CMsgDevNewItemRequest struct { - Receiver *uint64 `protobuf:"fixed64,1,opt,name=receiver" json:"receiver,omitempty"` - Criteria *CSOItemCriteria `protobuf:"bytes,2,opt,name=criteria" json:"criteria,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDevNewItemRequest) Reset() { *m = CMsgDevNewItemRequest{} } -func (m *CMsgDevNewItemRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDevNewItemRequest) ProtoMessage() {} -func (*CMsgDevNewItemRequest) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{23} } - -func (m *CMsgDevNewItemRequest) GetReceiver() uint64 { - if m != nil && m.Receiver != nil { - return *m.Receiver - } - return 0 -} - -func (m *CMsgDevNewItemRequest) GetCriteria() *CSOItemCriteria { - if m != nil { - return m.Criteria - } - return nil -} - -type CMsgDevDebugRollLootRequest struct { - Receiver *uint64 `protobuf:"fixed64,1,opt,name=receiver" json:"receiver,omitempty"` - LootListName *string `protobuf:"bytes,2,opt,name=loot_list_name" json:"loot_list_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDevDebugRollLootRequest) Reset() { *m = CMsgDevDebugRollLootRequest{} } -func (m *CMsgDevDebugRollLootRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgDevDebugRollLootRequest) ProtoMessage() {} -func (*CMsgDevDebugRollLootRequest) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{24} } - -func (m *CMsgDevDebugRollLootRequest) GetReceiver() uint64 { - if m != nil && m.Receiver != nil { - return *m.Receiver - } - return 0 -} - -func (m *CMsgDevDebugRollLootRequest) GetLootListName() string { - if m != nil && m.LootListName != nil { - return *m.LootListName - } - return "" -} - -type CMsgIncrementKillCountAttribute struct { - KillerSteamId *uint64 `protobuf:"varint,1,opt,name=killer_steam_id" json:"killer_steam_id,omitempty"` - VictimSteamId *uint64 `protobuf:"varint,2,opt,name=victim_steam_id" json:"victim_steam_id,omitempty"` - ItemId *uint64 `protobuf:"varint,3,opt,name=item_id" json:"item_id,omitempty"` - EventType *uint32 `protobuf:"varint,4,opt,name=event_type" json:"event_type,omitempty"` - IncrementValue *uint32 `protobuf:"varint,5,opt,name=increment_value" json:"increment_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgIncrementKillCountAttribute) Reset() { *m = CMsgIncrementKillCountAttribute{} } -func (m *CMsgIncrementKillCountAttribute) String() string { return proto.CompactTextString(m) } -func (*CMsgIncrementKillCountAttribute) ProtoMessage() {} -func (*CMsgIncrementKillCountAttribute) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{25} -} - -func (m *CMsgIncrementKillCountAttribute) GetKillerSteamId() uint64 { - if m != nil && m.KillerSteamId != nil { - return *m.KillerSteamId - } - return 0 -} - -func (m *CMsgIncrementKillCountAttribute) GetVictimSteamId() uint64 { - if m != nil && m.VictimSteamId != nil { - return *m.VictimSteamId - } - return 0 -} - -func (m *CMsgIncrementKillCountAttribute) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgIncrementKillCountAttribute) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -func (m *CMsgIncrementKillCountAttribute) GetIncrementValue() uint32 { - if m != nil && m.IncrementValue != nil { - return *m.IncrementValue - } - return 0 -} - -type CMsgIncrementKillCountAttribute_Multiple struct { - Msgs []*CMsgIncrementKillCountAttribute `protobuf:"bytes,1,rep,name=msgs" json:"msgs,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgIncrementKillCountAttribute_Multiple) Reset() { - *m = CMsgIncrementKillCountAttribute_Multiple{} -} -func (m *CMsgIncrementKillCountAttribute_Multiple) String() string { return proto.CompactTextString(m) } -func (*CMsgIncrementKillCountAttribute_Multiple) ProtoMessage() {} -func (*CMsgIncrementKillCountAttribute_Multiple) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{26} -} - -func (m *CMsgIncrementKillCountAttribute_Multiple) GetMsgs() []*CMsgIncrementKillCountAttribute { - if m != nil { - return m.Msgs - } - return nil -} - -type CMsgTrackUniquePlayerPairEvent struct { - KillerSteamId *uint64 `protobuf:"varint,1,opt,name=killer_steam_id" json:"killer_steam_id,omitempty"` - VictimSteamId *uint64 `protobuf:"varint,2,opt,name=victim_steam_id" json:"victim_steam_id,omitempty"` - ItemId *uint64 `protobuf:"varint,3,opt,name=item_id" json:"item_id,omitempty"` - EventType *uint32 `protobuf:"varint,4,opt,name=event_type" json:"event_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTrackUniquePlayerPairEvent) Reset() { *m = CMsgTrackUniquePlayerPairEvent{} } -func (m *CMsgTrackUniquePlayerPairEvent) String() string { return proto.CompactTextString(m) } -func (*CMsgTrackUniquePlayerPairEvent) ProtoMessage() {} -func (*CMsgTrackUniquePlayerPairEvent) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{27} } - -func (m *CMsgTrackUniquePlayerPairEvent) GetKillerSteamId() uint64 { - if m != nil && m.KillerSteamId != nil { - return *m.KillerSteamId - } - return 0 -} - -func (m *CMsgTrackUniquePlayerPairEvent) GetVictimSteamId() uint64 { - if m != nil && m.VictimSteamId != nil { - return *m.VictimSteamId - } - return 0 -} - -func (m *CMsgTrackUniquePlayerPairEvent) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgTrackUniquePlayerPairEvent) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -type CMsgApplyStrangeCountTransfer struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - ItemSrcItemId *uint64 `protobuf:"varint,2,opt,name=item_src_item_id" json:"item_src_item_id,omitempty"` - ItemDestItemId *uint64 `protobuf:"varint,3,opt,name=item_dest_item_id" json:"item_dest_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyStrangeCountTransfer) Reset() { *m = CMsgApplyStrangeCountTransfer{} } -func (m *CMsgApplyStrangeCountTransfer) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyStrangeCountTransfer) ProtoMessage() {} -func (*CMsgApplyStrangeCountTransfer) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{28} } - -func (m *CMsgApplyStrangeCountTransfer) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgApplyStrangeCountTransfer) GetItemSrcItemId() uint64 { - if m != nil && m.ItemSrcItemId != nil { - return *m.ItemSrcItemId - } - return 0 -} - -func (m *CMsgApplyStrangeCountTransfer) GetItemDestItemId() uint64 { - if m != nil && m.ItemDestItemId != nil { - return *m.ItemDestItemId - } - return 0 -} - -type CMsgApplyStrangePart struct { - StrangePartItemId *uint64 `protobuf:"varint,1,opt,name=strange_part_item_id" json:"strange_part_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyStrangePart) Reset() { *m = CMsgApplyStrangePart{} } -func (m *CMsgApplyStrangePart) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyStrangePart) ProtoMessage() {} -func (*CMsgApplyStrangePart) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{29} } - -func (m *CMsgApplyStrangePart) GetStrangePartItemId() uint64 { - if m != nil && m.StrangePartItemId != nil { - return *m.StrangePartItemId - } - return 0 -} - -func (m *CMsgApplyStrangePart) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -type CMsgApplyStrangeRestriction struct { - StrangePartItemId *uint64 `protobuf:"varint,1,opt,name=strange_part_item_id" json:"strange_part_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - StrangeAttrIndex *uint32 `protobuf:"varint,3,opt,name=strange_attr_index" json:"strange_attr_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyStrangeRestriction) Reset() { *m = CMsgApplyStrangeRestriction{} } -func (m *CMsgApplyStrangeRestriction) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyStrangeRestriction) ProtoMessage() {} -func (*CMsgApplyStrangeRestriction) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{30} } - -func (m *CMsgApplyStrangeRestriction) GetStrangePartItemId() uint64 { - if m != nil && m.StrangePartItemId != nil { - return *m.StrangePartItemId - } - return 0 -} - -func (m *CMsgApplyStrangeRestriction) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -func (m *CMsgApplyStrangeRestriction) GetStrangeAttrIndex() uint32 { - if m != nil && m.StrangeAttrIndex != nil { - return *m.StrangeAttrIndex - } - return 0 -} - -type CMsgApplyUpgradeCard struct { - UpgradeCardItemId *uint64 `protobuf:"varint,1,opt,name=upgrade_card_item_id" json:"upgrade_card_item_id,omitempty"` - SubjectItemId *uint64 `protobuf:"varint,2,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyUpgradeCard) Reset() { *m = CMsgApplyUpgradeCard{} } -func (m *CMsgApplyUpgradeCard) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyUpgradeCard) ProtoMessage() {} -func (*CMsgApplyUpgradeCard) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{31} } - -func (m *CMsgApplyUpgradeCard) GetUpgradeCardItemId() uint64 { - if m != nil && m.UpgradeCardItemId != nil { - return *m.UpgradeCardItemId - } - return 0 -} - -func (m *CMsgApplyUpgradeCard) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -type CSOEconItemAttribute struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - Value *uint32 `protobuf:"varint,2,opt,name=value" json:"value,omitempty"` - ValueBytes []byte `protobuf:"bytes,3,opt,name=value_bytes" json:"value_bytes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemAttribute) Reset() { *m = CSOEconItemAttribute{} } -func (m *CSOEconItemAttribute) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemAttribute) ProtoMessage() {} -func (*CSOEconItemAttribute) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{32} } - -func (m *CSOEconItemAttribute) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOEconItemAttribute) GetValue() uint32 { - if m != nil && m.Value != nil { - return *m.Value - } - return 0 -} - -func (m *CSOEconItemAttribute) GetValueBytes() []byte { - if m != nil { - return m.ValueBytes - } - return nil -} - -type CSOEconItemEquipped struct { - NewClass *uint32 `protobuf:"varint,1,opt,name=new_class" json:"new_class,omitempty"` - NewSlot *uint32 `protobuf:"varint,2,opt,name=new_slot" json:"new_slot,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemEquipped) Reset() { *m = CSOEconItemEquipped{} } -func (m *CSOEconItemEquipped) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemEquipped) ProtoMessage() {} -func (*CSOEconItemEquipped) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{33} } - -func (m *CSOEconItemEquipped) GetNewClass() uint32 { - if m != nil && m.NewClass != nil { - return *m.NewClass - } - return 0 -} - -func (m *CSOEconItemEquipped) GetNewSlot() uint32 { - if m != nil && m.NewSlot != nil { - return *m.NewSlot - } - return 0 -} - -type CSOEconItem struct { - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - AccountId *uint32 `protobuf:"varint,2,opt,name=account_id" json:"account_id,omitempty"` - Inventory *uint32 `protobuf:"varint,3,opt,name=inventory" json:"inventory,omitempty"` - DefIndex *uint32 `protobuf:"varint,4,opt,name=def_index" json:"def_index,omitempty"` - Quantity *uint32 `protobuf:"varint,5,opt,name=quantity" json:"quantity,omitempty"` - Level *uint32 `protobuf:"varint,6,opt,name=level" json:"level,omitempty"` - Quality *uint32 `protobuf:"varint,7,opt,name=quality" json:"quality,omitempty"` - Flags *uint32 `protobuf:"varint,8,opt,name=flags,def=0" json:"flags,omitempty"` - Origin *uint32 `protobuf:"varint,9,opt,name=origin" json:"origin,omitempty"` - CustomName *string `protobuf:"bytes,10,opt,name=custom_name" json:"custom_name,omitempty"` - CustomDesc *string `protobuf:"bytes,11,opt,name=custom_desc" json:"custom_desc,omitempty"` - Attribute []*CSOEconItemAttribute `protobuf:"bytes,12,rep,name=attribute" json:"attribute,omitempty"` - InteriorItem *CSOEconItem `protobuf:"bytes,13,opt,name=interior_item" json:"interior_item,omitempty"` - InUse *bool `protobuf:"varint,14,opt,name=in_use,def=0" json:"in_use,omitempty"` - Style *uint32 `protobuf:"varint,15,opt,name=style,def=0" json:"style,omitempty"` - OriginalId *uint64 `protobuf:"varint,16,opt,name=original_id,def=0" json:"original_id,omitempty"` - ContainsEquippedState *bool `protobuf:"varint,17,opt,name=contains_equipped_state" json:"contains_equipped_state,omitempty"` - EquippedState []*CSOEconItemEquipped `protobuf:"bytes,18,rep,name=equipped_state" json:"equipped_state,omitempty"` - ContainsEquippedStateV2 *bool `protobuf:"varint,19,opt,name=contains_equipped_state_v2" json:"contains_equipped_state_v2,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItem) Reset() { *m = CSOEconItem{} } -func (m *CSOEconItem) String() string { return proto.CompactTextString(m) } -func (*CSOEconItem) ProtoMessage() {} -func (*CSOEconItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{34} } - -const Default_CSOEconItem_Flags uint32 = 0 -const Default_CSOEconItem_InUse bool = false -const Default_CSOEconItem_Style uint32 = 0 -const Default_CSOEconItem_OriginalId uint64 = 0 - -func (m *CSOEconItem) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CSOEconItem) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconItem) GetInventory() uint32 { - if m != nil && m.Inventory != nil { - return *m.Inventory - } - return 0 -} - -func (m *CSOEconItem) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOEconItem) GetQuantity() uint32 { - if m != nil && m.Quantity != nil { - return *m.Quantity - } - return 0 -} - -func (m *CSOEconItem) GetLevel() uint32 { - if m != nil && m.Level != nil { - return *m.Level - } - return 0 -} - -func (m *CSOEconItem) GetQuality() uint32 { - if m != nil && m.Quality != nil { - return *m.Quality - } - return 0 -} - -func (m *CSOEconItem) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return Default_CSOEconItem_Flags -} - -func (m *CSOEconItem) GetOrigin() uint32 { - if m != nil && m.Origin != nil { - return *m.Origin - } - return 0 -} - -func (m *CSOEconItem) GetCustomName() string { - if m != nil && m.CustomName != nil { - return *m.CustomName - } - return "" -} - -func (m *CSOEconItem) GetCustomDesc() string { - if m != nil && m.CustomDesc != nil { - return *m.CustomDesc - } - return "" -} - -func (m *CSOEconItem) GetAttribute() []*CSOEconItemAttribute { - if m != nil { - return m.Attribute - } - return nil -} - -func (m *CSOEconItem) GetInteriorItem() *CSOEconItem { - if m != nil { - return m.InteriorItem - } - return nil -} - -func (m *CSOEconItem) GetInUse() bool { - if m != nil && m.InUse != nil { - return *m.InUse - } - return Default_CSOEconItem_InUse -} - -func (m *CSOEconItem) GetStyle() uint32 { - if m != nil && m.Style != nil { - return *m.Style - } - return Default_CSOEconItem_Style -} - -func (m *CSOEconItem) GetOriginalId() uint64 { - if m != nil && m.OriginalId != nil { - return *m.OriginalId - } - return Default_CSOEconItem_OriginalId -} - -func (m *CSOEconItem) GetContainsEquippedState() bool { - if m != nil && m.ContainsEquippedState != nil { - return *m.ContainsEquippedState - } - return false -} - -func (m *CSOEconItem) GetEquippedState() []*CSOEconItemEquipped { - if m != nil { - return m.EquippedState - } - return nil -} - -func (m *CSOEconItem) GetContainsEquippedStateV2() bool { - if m != nil && m.ContainsEquippedStateV2 != nil { - return *m.ContainsEquippedStateV2 - } - return false -} - -type CMsgAdjustItemEquippedState struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - NewClass *uint32 `protobuf:"varint,2,opt,name=new_class" json:"new_class,omitempty"` - NewSlot *uint32 `protobuf:"varint,3,opt,name=new_slot" json:"new_slot,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAdjustItemEquippedState) Reset() { *m = CMsgAdjustItemEquippedState{} } -func (m *CMsgAdjustItemEquippedState) String() string { return proto.CompactTextString(m) } -func (*CMsgAdjustItemEquippedState) ProtoMessage() {} -func (*CMsgAdjustItemEquippedState) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{35} } - -func (m *CMsgAdjustItemEquippedState) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgAdjustItemEquippedState) GetNewClass() uint32 { - if m != nil && m.NewClass != nil { - return *m.NewClass - } - return 0 -} - -func (m *CMsgAdjustItemEquippedState) GetNewSlot() uint32 { - if m != nil && m.NewSlot != nil { - return *m.NewSlot - } - return 0 -} - -type CMsgSortItems struct { - SortType *uint32 `protobuf:"varint,1,opt,name=sort_type" json:"sort_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSortItems) Reset() { *m = CMsgSortItems{} } -func (m *CMsgSortItems) String() string { return proto.CompactTextString(m) } -func (*CMsgSortItems) ProtoMessage() {} -func (*CMsgSortItems) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{36} } - -func (m *CMsgSortItems) GetSortType() uint32 { - if m != nil && m.SortType != nil { - return *m.SortType - } - return 0 -} - -type CSOEconClaimCode struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - CodeType *uint32 `protobuf:"varint,2,opt,name=code_type" json:"code_type,omitempty"` - TimeAcquired *uint32 `protobuf:"varint,3,opt,name=time_acquired" json:"time_acquired,omitempty"` - Code *string `protobuf:"bytes,4,opt,name=code" json:"code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconClaimCode) Reset() { *m = CSOEconClaimCode{} } -func (m *CSOEconClaimCode) String() string { return proto.CompactTextString(m) } -func (*CSOEconClaimCode) ProtoMessage() {} -func (*CSOEconClaimCode) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{37} } - -func (m *CSOEconClaimCode) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOEconClaimCode) GetCodeType() uint32 { - if m != nil && m.CodeType != nil { - return *m.CodeType - } - return 0 -} - -func (m *CSOEconClaimCode) GetTimeAcquired() uint32 { - if m != nil && m.TimeAcquired != nil { - return *m.TimeAcquired - } - return 0 -} - -func (m *CSOEconClaimCode) GetCode() string { - if m != nil && m.Code != nil { - return *m.Code - } - return "" -} - -type CMsgStoreGetUserData struct { - PriceSheetVersion *uint32 `protobuf:"fixed32,1,opt,name=price_sheet_version" json:"price_sheet_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgStoreGetUserData) Reset() { *m = CMsgStoreGetUserData{} } -func (m *CMsgStoreGetUserData) String() string { return proto.CompactTextString(m) } -func (*CMsgStoreGetUserData) ProtoMessage() {} -func (*CMsgStoreGetUserData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{38} } - -func (m *CMsgStoreGetUserData) GetPriceSheetVersion() uint32 { - if m != nil && m.PriceSheetVersion != nil { - return *m.PriceSheetVersion - } - return 0 -} - -type CMsgStoreGetUserDataResponse struct { - Result *int32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - Currency *int32 `protobuf:"varint,2,opt,name=currency" json:"currency,omitempty"` - Country *string `protobuf:"bytes,3,opt,name=country" json:"country,omitempty"` - PriceSheetVersion *uint32 `protobuf:"fixed32,4,opt,name=price_sheet_version" json:"price_sheet_version,omitempty"` - ExperimentData *uint64 `protobuf:"varint,5,opt,name=experiment_data,def=0" json:"experiment_data,omitempty"` - FeaturedItemIdx *int32 `protobuf:"varint,6,opt,name=featured_item_idx" json:"featured_item_idx,omitempty"` - ShowHatDescriptions *bool `protobuf:"varint,7,opt,name=show_hat_descriptions,def=1" json:"show_hat_descriptions,omitempty"` - PriceSheet []byte `protobuf:"bytes,8,opt,name=price_sheet" json:"price_sheet,omitempty"` - DefaultItemSort *int32 `protobuf:"varint,9,opt,name=default_item_sort,def=0" json:"default_item_sort,omitempty"` - PopularItems []uint32 `protobuf:"varint,10,rep,name=popular_items" json:"popular_items,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgStoreGetUserDataResponse) Reset() { *m = CMsgStoreGetUserDataResponse{} } -func (m *CMsgStoreGetUserDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgStoreGetUserDataResponse) ProtoMessage() {} -func (*CMsgStoreGetUserDataResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{39} } - -const Default_CMsgStoreGetUserDataResponse_ExperimentData uint64 = 0 -const Default_CMsgStoreGetUserDataResponse_ShowHatDescriptions bool = true -const Default_CMsgStoreGetUserDataResponse_DefaultItemSort int32 = 0 - -func (m *CMsgStoreGetUserDataResponse) GetResult() int32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetCurrency() int32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetCountry() string { - if m != nil && m.Country != nil { - return *m.Country - } - return "" -} - -func (m *CMsgStoreGetUserDataResponse) GetPriceSheetVersion() uint32 { - if m != nil && m.PriceSheetVersion != nil { - return *m.PriceSheetVersion - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetExperimentData() uint64 { - if m != nil && m.ExperimentData != nil { - return *m.ExperimentData - } - return Default_CMsgStoreGetUserDataResponse_ExperimentData -} - -func (m *CMsgStoreGetUserDataResponse) GetFeaturedItemIdx() int32 { - if m != nil && m.FeaturedItemIdx != nil { - return *m.FeaturedItemIdx - } - return 0 -} - -func (m *CMsgStoreGetUserDataResponse) GetShowHatDescriptions() bool { - if m != nil && m.ShowHatDescriptions != nil { - return *m.ShowHatDescriptions - } - return Default_CMsgStoreGetUserDataResponse_ShowHatDescriptions -} - -func (m *CMsgStoreGetUserDataResponse) GetPriceSheet() []byte { - if m != nil { - return m.PriceSheet - } - return nil -} - -func (m *CMsgStoreGetUserDataResponse) GetDefaultItemSort() int32 { - if m != nil && m.DefaultItemSort != nil { - return *m.DefaultItemSort - } - return Default_CMsgStoreGetUserDataResponse_DefaultItemSort -} - -func (m *CMsgStoreGetUserDataResponse) GetPopularItems() []uint32 { - if m != nil { - return m.PopularItems - } - return nil -} - -type CMsgUpdateItemSchema struct { - ItemsGame []byte `protobuf:"bytes,1,opt,name=items_game" json:"items_game,omitempty"` - ItemSchemaVersion *uint32 `protobuf:"fixed32,2,opt,name=item_schema_version" json:"item_schema_version,omitempty"` - ItemsGameUrl *string `protobuf:"bytes,3,opt,name=items_game_url" json:"items_game_url,omitempty"` - Signature []byte `protobuf:"bytes,4,opt,name=signature" json:"signature,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpdateItemSchema) Reset() { *m = CMsgUpdateItemSchema{} } -func (m *CMsgUpdateItemSchema) String() string { return proto.CompactTextString(m) } -func (*CMsgUpdateItemSchema) ProtoMessage() {} -func (*CMsgUpdateItemSchema) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{40} } - -func (m *CMsgUpdateItemSchema) GetItemsGame() []byte { - if m != nil { - return m.ItemsGame - } - return nil -} - -func (m *CMsgUpdateItemSchema) GetItemSchemaVersion() uint32 { - if m != nil && m.ItemSchemaVersion != nil { - return *m.ItemSchemaVersion - } - return 0 -} - -func (m *CMsgUpdateItemSchema) GetItemsGameUrl() string { - if m != nil && m.ItemsGameUrl != nil { - return *m.ItemsGameUrl - } - return "" -} - -func (m *CMsgUpdateItemSchema) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type CMsgGCError struct { - ErrorText *string `protobuf:"bytes,1,opt,name=error_text" json:"error_text,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCError) Reset() { *m = CMsgGCError{} } -func (m *CMsgGCError) String() string { return proto.CompactTextString(m) } -func (*CMsgGCError) ProtoMessage() {} -func (*CMsgGCError) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{41} } - -func (m *CMsgGCError) GetErrorText() string { - if m != nil && m.ErrorText != nil { - return *m.ErrorText - } - return "" -} - -type CMsgRequestInventoryRefresh struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestInventoryRefresh) Reset() { *m = CMsgRequestInventoryRefresh{} } -func (m *CMsgRequestInventoryRefresh) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestInventoryRefresh) ProtoMessage() {} -func (*CMsgRequestInventoryRefresh) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{42} } - -type CMsgConVarValue struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgConVarValue) Reset() { *m = CMsgConVarValue{} } -func (m *CMsgConVarValue) String() string { return proto.CompactTextString(m) } -func (*CMsgConVarValue) ProtoMessage() {} -func (*CMsgConVarValue) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{43} } - -func (m *CMsgConVarValue) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CMsgConVarValue) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CMsgReplicateConVars struct { - Convars []*CMsgConVarValue `protobuf:"bytes,1,rep,name=convars" json:"convars,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReplicateConVars) Reset() { *m = CMsgReplicateConVars{} } -func (m *CMsgReplicateConVars) String() string { return proto.CompactTextString(m) } -func (*CMsgReplicateConVars) ProtoMessage() {} -func (*CMsgReplicateConVars) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{44} } - -func (m *CMsgReplicateConVars) GetConvars() []*CMsgConVarValue { - if m != nil { - return m.Convars - } - return nil -} - -type CMsgUseItem struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - TargetSteamId *uint64 `protobuf:"fixed64,2,opt,name=target_steam_id" json:"target_steam_id,omitempty"` - Gift_PotentialTargets []uint32 `protobuf:"varint,3,rep,name=gift__potential_targets" json:"gift__potential_targets,omitempty"` - Duel_ClassLock *uint32 `protobuf:"varint,4,opt,name=duel__class_lock" json:"duel__class_lock,omitempty"` - InitiatorSteamId *uint64 `protobuf:"fixed64,5,opt,name=initiator_steam_id" json:"initiator_steam_id,omitempty"` - Itempack_AckImmediately *bool `protobuf:"varint,6,opt,name=itempack__ack_immediately" json:"itempack__ack_immediately,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUseItem) Reset() { *m = CMsgUseItem{} } -func (m *CMsgUseItem) String() string { return proto.CompactTextString(m) } -func (*CMsgUseItem) ProtoMessage() {} -func (*CMsgUseItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{45} } - -func (m *CMsgUseItem) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgUseItem) GetTargetSteamId() uint64 { - if m != nil && m.TargetSteamId != nil { - return *m.TargetSteamId - } - return 0 -} - -func (m *CMsgUseItem) GetGift_PotentialTargets() []uint32 { - if m != nil { - return m.Gift_PotentialTargets - } - return nil -} - -func (m *CMsgUseItem) GetDuel_ClassLock() uint32 { - if m != nil && m.Duel_ClassLock != nil { - return *m.Duel_ClassLock - } - return 0 -} - -func (m *CMsgUseItem) GetInitiatorSteamId() uint64 { - if m != nil && m.InitiatorSteamId != nil { - return *m.InitiatorSteamId - } - return 0 -} - -func (m *CMsgUseItem) GetItempack_AckImmediately() bool { - if m != nil && m.Itempack_AckImmediately != nil { - return *m.Itempack_AckImmediately - } - return false -} - -type CMsgReplayUploadedToYouTube struct { - YoutubeUrl *string `protobuf:"bytes,1,opt,name=youtube_url" json:"youtube_url,omitempty"` - YoutubeAccountName *string `protobuf:"bytes,2,opt,name=youtube_account_name" json:"youtube_account_name,omitempty"` - SessionId *uint64 `protobuf:"varint,3,opt,name=session_id" json:"session_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReplayUploadedToYouTube) Reset() { *m = CMsgReplayUploadedToYouTube{} } -func (m *CMsgReplayUploadedToYouTube) String() string { return proto.CompactTextString(m) } -func (*CMsgReplayUploadedToYouTube) ProtoMessage() {} -func (*CMsgReplayUploadedToYouTube) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{46} } - -func (m *CMsgReplayUploadedToYouTube) GetYoutubeUrl() string { - if m != nil && m.YoutubeUrl != nil { - return *m.YoutubeUrl - } - return "" -} - -func (m *CMsgReplayUploadedToYouTube) GetYoutubeAccountName() string { - if m != nil && m.YoutubeAccountName != nil { - return *m.YoutubeAccountName - } - return "" -} - -func (m *CMsgReplayUploadedToYouTube) GetSessionId() uint64 { - if m != nil && m.SessionId != nil { - return *m.SessionId - } - return 0 -} - -type CMsgConsumableExhausted struct { - ItemDefId *int32 `protobuf:"varint,1,opt,name=item_def_id" json:"item_def_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgConsumableExhausted) Reset() { *m = CMsgConsumableExhausted{} } -func (m *CMsgConsumableExhausted) String() string { return proto.CompactTextString(m) } -func (*CMsgConsumableExhausted) ProtoMessage() {} -func (*CMsgConsumableExhausted) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{47} } - -func (m *CMsgConsumableExhausted) GetItemDefId() int32 { - if m != nil && m.ItemDefId != nil { - return *m.ItemDefId - } - return 0 -} - -type CMsgItemAcknowledged struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Inventory *uint32 `protobuf:"varint,2,opt,name=inventory" json:"inventory,omitempty"` - DefIndex *uint32 `protobuf:"varint,3,opt,name=def_index" json:"def_index,omitempty"` - Quality *uint32 `protobuf:"varint,4,opt,name=quality" json:"quality,omitempty"` - Rarity *uint32 `protobuf:"varint,5,opt,name=rarity" json:"rarity,omitempty"` - Origin *uint32 `protobuf:"varint,6,opt,name=origin" json:"origin,omitempty"` - IsStrange *uint32 `protobuf:"varint,7,opt,name=is_strange" json:"is_strange,omitempty"` - IsUnusual *uint32 `protobuf:"varint,8,opt,name=is_unusual" json:"is_unusual,omitempty"` - Wear *float32 `protobuf:"fixed32,9,opt,name=wear" json:"wear,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgItemAcknowledged) Reset() { *m = CMsgItemAcknowledged{} } -func (m *CMsgItemAcknowledged) String() string { return proto.CompactTextString(m) } -func (*CMsgItemAcknowledged) ProtoMessage() {} -func (*CMsgItemAcknowledged) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{48} } - -func (m *CMsgItemAcknowledged) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetInventory() uint32 { - if m != nil && m.Inventory != nil { - return *m.Inventory - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetQuality() uint32 { - if m != nil && m.Quality != nil { - return *m.Quality - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetRarity() uint32 { - if m != nil && m.Rarity != nil { - return *m.Rarity - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetOrigin() uint32 { - if m != nil && m.Origin != nil { - return *m.Origin - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetIsStrange() uint32 { - if m != nil && m.IsStrange != nil { - return *m.IsStrange - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetIsUnusual() uint32 { - if m != nil && m.IsUnusual != nil { - return *m.IsUnusual - } - return 0 -} - -func (m *CMsgItemAcknowledged) GetWear() float32 { - if m != nil && m.Wear != nil { - return *m.Wear - } - return 0 -} - -type CMsgSetPresetItemPosition struct { - ClassId *uint32 `protobuf:"varint,1,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,2,opt,name=preset_id" json:"preset_id,omitempty"` - SlotId *uint32 `protobuf:"varint,3,opt,name=slot_id" json:"slot_id,omitempty"` - ItemId *uint64 `protobuf:"varint,4,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetPresetItemPosition) Reset() { *m = CMsgSetPresetItemPosition{} } -func (m *CMsgSetPresetItemPosition) String() string { return proto.CompactTextString(m) } -func (*CMsgSetPresetItemPosition) ProtoMessage() {} -func (*CMsgSetPresetItemPosition) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{49} } - -func (m *CMsgSetPresetItemPosition) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CMsgSetPresetItemPosition) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -func (m *CMsgSetPresetItemPosition) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CMsgSetPresetItemPosition) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgSetItemPositions struct { - ItemPositions []*CMsgSetItemPositions_ItemPosition `protobuf:"bytes,1,rep,name=item_positions" json:"item_positions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetItemPositions) Reset() { *m = CMsgSetItemPositions{} } -func (m *CMsgSetItemPositions) String() string { return proto.CompactTextString(m) } -func (*CMsgSetItemPositions) ProtoMessage() {} -func (*CMsgSetItemPositions) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{50} } - -func (m *CMsgSetItemPositions) GetItemPositions() []*CMsgSetItemPositions_ItemPosition { - if m != nil { - return m.ItemPositions - } - return nil -} - -type CMsgSetItemPositions_ItemPosition struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - Position *uint32 `protobuf:"varint,2,opt,name=position" json:"position,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetItemPositions_ItemPosition) Reset() { *m = CMsgSetItemPositions_ItemPosition{} } -func (m *CMsgSetItemPositions_ItemPosition) String() string { return proto.CompactTextString(m) } -func (*CMsgSetItemPositions_ItemPosition) ProtoMessage() {} -func (*CMsgSetItemPositions_ItemPosition) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{50, 0} -} - -func (m *CMsgSetItemPositions_ItemPosition) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgSetItemPositions_ItemPosition) GetPosition() uint32 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -type CSOEconItemPresetInstance struct { - ClassId *uint32 `protobuf:"varint,2,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,3,opt,name=preset_id" json:"preset_id,omitempty"` - SlotId *uint32 `protobuf:"varint,4,opt,name=slot_id" json:"slot_id,omitempty"` - ItemId *uint64 `protobuf:"varint,5,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconItemPresetInstance) Reset() { *m = CSOEconItemPresetInstance{} } -func (m *CSOEconItemPresetInstance) String() string { return proto.CompactTextString(m) } -func (*CSOEconItemPresetInstance) ProtoMessage() {} -func (*CSOEconItemPresetInstance) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{51} } - -func (m *CSOEconItemPresetInstance) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CSOEconItemPresetInstance) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -func (m *CSOEconItemPresetInstance) GetSlotId() uint32 { - if m != nil && m.SlotId != nil { - return *m.SlotId - } - return 0 -} - -func (m *CSOEconItemPresetInstance) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgSelectPresetForClass struct { - ClassId *uint32 `protobuf:"varint,1,opt,name=class_id" json:"class_id,omitempty"` - PresetId *uint32 `protobuf:"varint,2,opt,name=preset_id" json:"preset_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSelectPresetForClass) Reset() { *m = CMsgSelectPresetForClass{} } -func (m *CMsgSelectPresetForClass) String() string { return proto.CompactTextString(m) } -func (*CMsgSelectPresetForClass) ProtoMessage() {} -func (*CMsgSelectPresetForClass) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{52} } - -func (m *CMsgSelectPresetForClass) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CMsgSelectPresetForClass) GetPresetId() uint32 { - if m != nil && m.PresetId != nil { - return *m.PresetId - } - return 0 -} - -type CSOClassPresetClientData struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - ClassId *uint32 `protobuf:"varint,2,opt,name=class_id" json:"class_id,omitempty"` - ActivePresetId *uint32 `protobuf:"varint,3,opt,name=active_preset_id" json:"active_preset_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOClassPresetClientData) Reset() { *m = CSOClassPresetClientData{} } -func (m *CSOClassPresetClientData) String() string { return proto.CompactTextString(m) } -func (*CSOClassPresetClientData) ProtoMessage() {} -func (*CSOClassPresetClientData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{53} } - -func (m *CSOClassPresetClientData) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOClassPresetClientData) GetClassId() uint32 { - if m != nil && m.ClassId != nil { - return *m.ClassId - } - return 0 -} - -func (m *CSOClassPresetClientData) GetActivePresetId() uint32 { - if m != nil && m.ActivePresetId != nil { - return *m.ActivePresetId - } - return 0 -} - -type CMsgGCReportAbuse struct { - TargetSteamId *uint64 `protobuf:"fixed64,1,opt,name=target_steam_id" json:"target_steam_id,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` - Gid *uint64 `protobuf:"varint,5,opt,name=gid" json:"gid,omitempty"` - AbuseType *uint32 `protobuf:"varint,2,opt,name=abuse_type" json:"abuse_type,omitempty"` - ContentType *uint32 `protobuf:"varint,3,opt,name=content_type" json:"content_type,omitempty"` - TargetGameServerIp *uint32 `protobuf:"fixed32,6,opt,name=target_game_server_ip" json:"target_game_server_ip,omitempty"` - TargetGameServerPort *uint32 `protobuf:"varint,7,opt,name=target_game_server_port" json:"target_game_server_port,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCReportAbuse) Reset() { *m = CMsgGCReportAbuse{} } -func (m *CMsgGCReportAbuse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCReportAbuse) ProtoMessage() {} -func (*CMsgGCReportAbuse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{54} } - -func (m *CMsgGCReportAbuse) GetTargetSteamId() uint64 { - if m != nil && m.TargetSteamId != nil { - return *m.TargetSteamId - } - return 0 -} - -func (m *CMsgGCReportAbuse) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *CMsgGCReportAbuse) GetGid() uint64 { - if m != nil && m.Gid != nil { - return *m.Gid - } - return 0 -} - -func (m *CMsgGCReportAbuse) GetAbuseType() uint32 { - if m != nil && m.AbuseType != nil { - return *m.AbuseType - } - return 0 -} - -func (m *CMsgGCReportAbuse) GetContentType() uint32 { - if m != nil && m.ContentType != nil { - return *m.ContentType - } - return 0 -} - -func (m *CMsgGCReportAbuse) GetTargetGameServerIp() uint32 { - if m != nil && m.TargetGameServerIp != nil { - return *m.TargetGameServerIp - } - return 0 -} - -func (m *CMsgGCReportAbuse) GetTargetGameServerPort() uint32 { - if m != nil && m.TargetGameServerPort != nil { - return *m.TargetGameServerPort - } - return 0 -} - -type CMsgGCReportAbuseResponse struct { - TargetSteamId *uint64 `protobuf:"fixed64,1,opt,name=target_steam_id" json:"target_steam_id,omitempty"` - Result *uint32 `protobuf:"varint,2,opt,name=result" json:"result,omitempty"` - ErrorMessage *string `protobuf:"bytes,3,opt,name=error_message" json:"error_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCReportAbuseResponse) Reset() { *m = CMsgGCReportAbuseResponse{} } -func (m *CMsgGCReportAbuseResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCReportAbuseResponse) ProtoMessage() {} -func (*CMsgGCReportAbuseResponse) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{55} } - -func (m *CMsgGCReportAbuseResponse) GetTargetSteamId() uint64 { - if m != nil && m.TargetSteamId != nil { - return *m.TargetSteamId - } - return 0 -} - -func (m *CMsgGCReportAbuseResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGCReportAbuseResponse) GetErrorMessage() string { - if m != nil && m.ErrorMessage != nil { - return *m.ErrorMessage - } - return "" -} - -type CMsgGCNameItemNotification struct { - PlayerSteamid *uint64 `protobuf:"fixed64,1,opt,name=player_steamid" json:"player_steamid,omitempty"` - ItemDefIndex *uint32 `protobuf:"varint,2,opt,name=item_def_index" json:"item_def_index,omitempty"` - ItemNameCustom *string `protobuf:"bytes,3,opt,name=item_name_custom" json:"item_name_custom,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCNameItemNotification) Reset() { *m = CMsgGCNameItemNotification{} } -func (m *CMsgGCNameItemNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCNameItemNotification) ProtoMessage() {} -func (*CMsgGCNameItemNotification) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{56} } - -func (m *CMsgGCNameItemNotification) GetPlayerSteamid() uint64 { - if m != nil && m.PlayerSteamid != nil { - return *m.PlayerSteamid - } - return 0 -} - -func (m *CMsgGCNameItemNotification) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCNameItemNotification) GetItemNameCustom() string { - if m != nil && m.ItemNameCustom != nil { - return *m.ItemNameCustom - } - return "" -} - -type CMsgGCClientDisplayNotification struct { - NotificationTitleLocalizationKey *string `protobuf:"bytes,1,opt,name=notification_title_localization_key" json:"notification_title_localization_key,omitempty"` - NotificationBodyLocalizationKey *string `protobuf:"bytes,2,opt,name=notification_body_localization_key" json:"notification_body_localization_key,omitempty"` - BodySubstringKeys []string `protobuf:"bytes,3,rep,name=body_substring_keys" json:"body_substring_keys,omitempty"` - BodySubstringValues []string `protobuf:"bytes,4,rep,name=body_substring_values" json:"body_substring_values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientDisplayNotification) Reset() { *m = CMsgGCClientDisplayNotification{} } -func (m *CMsgGCClientDisplayNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientDisplayNotification) ProtoMessage() {} -func (*CMsgGCClientDisplayNotification) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{57} -} - -func (m *CMsgGCClientDisplayNotification) GetNotificationTitleLocalizationKey() string { - if m != nil && m.NotificationTitleLocalizationKey != nil { - return *m.NotificationTitleLocalizationKey - } - return "" -} - -func (m *CMsgGCClientDisplayNotification) GetNotificationBodyLocalizationKey() string { - if m != nil && m.NotificationBodyLocalizationKey != nil { - return *m.NotificationBodyLocalizationKey - } - return "" -} - -func (m *CMsgGCClientDisplayNotification) GetBodySubstringKeys() []string { - if m != nil { - return m.BodySubstringKeys - } - return nil -} - -func (m *CMsgGCClientDisplayNotification) GetBodySubstringValues() []string { - if m != nil { - return m.BodySubstringValues - } - return nil -} - -type CMsgGCShowItemsPickedUp struct { - PlayerSteamid *uint64 `protobuf:"fixed64,1,opt,name=player_steamid" json:"player_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCShowItemsPickedUp) Reset() { *m = CMsgGCShowItemsPickedUp{} } -func (m *CMsgGCShowItemsPickedUp) String() string { return proto.CompactTextString(m) } -func (*CMsgGCShowItemsPickedUp) ProtoMessage() {} -func (*CMsgGCShowItemsPickedUp) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{58} } - -func (m *CMsgGCShowItemsPickedUp) GetPlayerSteamid() uint64 { - if m != nil && m.PlayerSteamid != nil { - return *m.PlayerSteamid - } - return 0 -} - -type CMsgUpdatePeriodicEvent struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - EventType *uint32 `protobuf:"varint,2,opt,name=event_type" json:"event_type,omitempty"` - Amount *uint32 `protobuf:"varint,3,opt,name=amount" json:"amount,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpdatePeriodicEvent) Reset() { *m = CMsgUpdatePeriodicEvent{} } -func (m *CMsgUpdatePeriodicEvent) String() string { return proto.CompactTextString(m) } -func (*CMsgUpdatePeriodicEvent) ProtoMessage() {} -func (*CMsgUpdatePeriodicEvent) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{59} } - -func (m *CMsgUpdatePeriodicEvent) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgUpdatePeriodicEvent) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -func (m *CMsgUpdatePeriodicEvent) GetAmount() uint32 { - if m != nil && m.Amount != nil { - return *m.Amount - } - return 0 -} - -type CMsgGCIncrementKillCountResponse struct { - KillerAccountId *uint32 `protobuf:"varint,1,opt,name=killer_account_id" json:"killer_account_id,omitempty"` - NumKills *uint32 `protobuf:"varint,2,opt,name=num_kills" json:"num_kills,omitempty"` - ItemDef *uint32 `protobuf:"varint,3,opt,name=item_def" json:"item_def,omitempty"` - LevelType *uint32 `protobuf:"varint,4,opt,name=level_type" json:"level_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCIncrementKillCountResponse) Reset() { *m = CMsgGCIncrementKillCountResponse{} } -func (m *CMsgGCIncrementKillCountResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCIncrementKillCountResponse) ProtoMessage() {} -func (*CMsgGCIncrementKillCountResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{60} -} - -func (m *CMsgGCIncrementKillCountResponse) GetKillerAccountId() uint32 { - if m != nil && m.KillerAccountId != nil { - return *m.KillerAccountId - } - return 0 -} - -func (m *CMsgGCIncrementKillCountResponse) GetNumKills() uint32 { - if m != nil && m.NumKills != nil { - return *m.NumKills - } - return 0 -} - -func (m *CMsgGCIncrementKillCountResponse) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgGCIncrementKillCountResponse) GetLevelType() uint32 { - if m != nil && m.LevelType != nil { - return *m.LevelType - } - return 0 -} - -type CMsgGCRemoveStrangePart struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - StrangePartScoreType *uint32 `protobuf:"varint,2,opt,name=strange_part_score_type" json:"strange_part_score_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRemoveStrangePart) Reset() { *m = CMsgGCRemoveStrangePart{} } -func (m *CMsgGCRemoveStrangePart) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRemoveStrangePart) ProtoMessage() {} -func (*CMsgGCRemoveStrangePart) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{61} } - -func (m *CMsgGCRemoveStrangePart) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgGCRemoveStrangePart) GetStrangePartScoreType() uint32 { - if m != nil && m.StrangePartScoreType != nil { - return *m.StrangePartScoreType - } - return 0 -} - -type CMsgGCRemoveUpgradeCard struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - AttributeIndex *uint32 `protobuf:"varint,2,opt,name=attribute_index" json:"attribute_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRemoveUpgradeCard) Reset() { *m = CMsgGCRemoveUpgradeCard{} } -func (m *CMsgGCRemoveUpgradeCard) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRemoveUpgradeCard) ProtoMessage() {} -func (*CMsgGCRemoveUpgradeCard) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{62} } - -func (m *CMsgGCRemoveUpgradeCard) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgGCRemoveUpgradeCard) GetAttributeIndex() uint32 { - if m != nil && m.AttributeIndex != nil { - return *m.AttributeIndex - } - return 0 -} - -type CMsgGCRemoveCustomizationAttributeSimple struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRemoveCustomizationAttributeSimple) Reset() { - *m = CMsgGCRemoveCustomizationAttributeSimple{} -} -func (m *CMsgGCRemoveCustomizationAttributeSimple) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRemoveCustomizationAttributeSimple) ProtoMessage() {} -func (*CMsgGCRemoveCustomizationAttributeSimple) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{63} -} - -func (m *CMsgGCRemoveCustomizationAttributeSimple) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgGCResetStrangeScores struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCResetStrangeScores) Reset() { *m = CMsgGCResetStrangeScores{} } -func (m *CMsgGCResetStrangeScores) String() string { return proto.CompactTextString(m) } -func (*CMsgGCResetStrangeScores) ProtoMessage() {} -func (*CMsgGCResetStrangeScores) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{64} } - -func (m *CMsgGCResetStrangeScores) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgGCItemPreviewItemBoughtNotification struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCItemPreviewItemBoughtNotification) Reset() { - *m = CMsgGCItemPreviewItemBoughtNotification{} -} -func (m *CMsgGCItemPreviewItemBoughtNotification) String() string { return proto.CompactTextString(m) } -func (*CMsgGCItemPreviewItemBoughtNotification) ProtoMessage() {} -func (*CMsgGCItemPreviewItemBoughtNotification) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{65} -} - -func (m *CMsgGCItemPreviewItemBoughtNotification) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -type CMsgGCStorePurchaseCancel struct { - TxnId *uint64 `protobuf:"varint,1,opt,name=txn_id" json:"txn_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseCancel) Reset() { *m = CMsgGCStorePurchaseCancel{} } -func (m *CMsgGCStorePurchaseCancel) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseCancel) ProtoMessage() {} -func (*CMsgGCStorePurchaseCancel) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{66} } - -func (m *CMsgGCStorePurchaseCancel) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -type CMsgGCStorePurchaseCancelResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseCancelResponse) Reset() { *m = CMsgGCStorePurchaseCancelResponse{} } -func (m *CMsgGCStorePurchaseCancelResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseCancelResponse) ProtoMessage() {} -func (*CMsgGCStorePurchaseCancelResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{67} -} - -func (m *CMsgGCStorePurchaseCancelResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgGCStorePurchaseFinalize struct { - TxnId *uint64 `protobuf:"varint,1,opt,name=txn_id" json:"txn_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseFinalize) Reset() { *m = CMsgGCStorePurchaseFinalize{} } -func (m *CMsgGCStorePurchaseFinalize) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseFinalize) ProtoMessage() {} -func (*CMsgGCStorePurchaseFinalize) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{68} } - -func (m *CMsgGCStorePurchaseFinalize) GetTxnId() uint64 { - if m != nil && m.TxnId != nil { - return *m.TxnId - } - return 0 -} - -type CMsgGCStorePurchaseFinalizeResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - ItemIds []uint64 `protobuf:"varint,2,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCStorePurchaseFinalizeResponse) Reset() { *m = CMsgGCStorePurchaseFinalizeResponse{} } -func (m *CMsgGCStorePurchaseFinalizeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCStorePurchaseFinalizeResponse) ProtoMessage() {} -func (*CMsgGCStorePurchaseFinalizeResponse) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{69} -} - -func (m *CMsgGCStorePurchaseFinalizeResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGCStorePurchaseFinalizeResponse) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgGCBannedWordListRequest struct { - BanListGroupId *uint32 `protobuf:"varint,1,opt,name=ban_list_group_id" json:"ban_list_group_id,omitempty"` - WordId *uint32 `protobuf:"varint,2,opt,name=word_id" json:"word_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCBannedWordListRequest) Reset() { *m = CMsgGCBannedWordListRequest{} } -func (m *CMsgGCBannedWordListRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCBannedWordListRequest) ProtoMessage() {} -func (*CMsgGCBannedWordListRequest) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{70} } - -func (m *CMsgGCBannedWordListRequest) GetBanListGroupId() uint32 { - if m != nil && m.BanListGroupId != nil { - return *m.BanListGroupId - } - return 0 -} - -func (m *CMsgGCBannedWordListRequest) GetWordId() uint32 { - if m != nil && m.WordId != nil { - return *m.WordId - } - return 0 -} - -type CMsgGCGiftedItems struct { - GifterSteamId *uint64 `protobuf:"varint,1,opt,name=gifter_steam_id" json:"gifter_steam_id,omitempty"` - WasRandomPerson *bool `protobuf:"varint,2,opt,name=was_random_person" json:"was_random_person,omitempty"` - RecipientAccountIds []uint32 `protobuf:"varint,3,rep,name=recipient_account_ids" json:"recipient_account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCGiftedItems) Reset() { *m = CMsgGCGiftedItems{} } -func (m *CMsgGCGiftedItems) String() string { return proto.CompactTextString(m) } -func (*CMsgGCGiftedItems) ProtoMessage() {} -func (*CMsgGCGiftedItems) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{71} } - -func (m *CMsgGCGiftedItems) GetGifterSteamId() uint64 { - if m != nil && m.GifterSteamId != nil { - return *m.GifterSteamId - } - return 0 -} - -func (m *CMsgGCGiftedItems) GetWasRandomPerson() bool { - if m != nil && m.WasRandomPerson != nil { - return *m.WasRandomPerson - } - return false -} - -func (m *CMsgGCGiftedItems) GetRecipientAccountIds() []uint32 { - if m != nil { - return m.RecipientAccountIds - } - return nil -} - -type CMsgGCCollectItem struct { - CollectionItemId *uint64 `protobuf:"varint,1,opt,name=collection_item_id" json:"collection_item_id,omitempty"` - SubjectItemId *uint64 `protobuf:"varint,2,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCCollectItem) Reset() { *m = CMsgGCCollectItem{} } -func (m *CMsgGCCollectItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGCCollectItem) ProtoMessage() {} -func (*CMsgGCCollectItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{72} } - -func (m *CMsgGCCollectItem) GetCollectionItemId() uint64 { - if m != nil && m.CollectionItemId != nil { - return *m.CollectionItemId - } - return 0 -} - -func (m *CMsgGCCollectItem) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -type CMsgGCClientMarketDataRequest struct { - UserCurrency *uint32 `protobuf:"varint,1,opt,name=user_currency" json:"user_currency,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientMarketDataRequest) Reset() { *m = CMsgGCClientMarketDataRequest{} } -func (m *CMsgGCClientMarketDataRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientMarketDataRequest) ProtoMessage() {} -func (*CMsgGCClientMarketDataRequest) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{73} } - -func (m *CMsgGCClientMarketDataRequest) GetUserCurrency() uint32 { - if m != nil && m.UserCurrency != nil { - return *m.UserCurrency - } - return 0 -} - -type CMsgGCClientMarketDataEntry struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - ItemQuality *uint32 `protobuf:"varint,2,opt,name=item_quality" json:"item_quality,omitempty"` - ItemSellListings *uint32 `protobuf:"varint,3,opt,name=item_sell_listings" json:"item_sell_listings,omitempty"` - PriceInLocalCurrency *uint32 `protobuf:"varint,4,opt,name=price_in_local_currency" json:"price_in_local_currency,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientMarketDataEntry) Reset() { *m = CMsgGCClientMarketDataEntry{} } -func (m *CMsgGCClientMarketDataEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientMarketDataEntry) ProtoMessage() {} -func (*CMsgGCClientMarketDataEntry) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{74} } - -func (m *CMsgGCClientMarketDataEntry) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCClientMarketDataEntry) GetItemQuality() uint32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CMsgGCClientMarketDataEntry) GetItemSellListings() uint32 { - if m != nil && m.ItemSellListings != nil { - return *m.ItemSellListings - } - return 0 -} - -func (m *CMsgGCClientMarketDataEntry) GetPriceInLocalCurrency() uint32 { - if m != nil && m.PriceInLocalCurrency != nil { - return *m.PriceInLocalCurrency - } - return 0 -} - -type CMsgGCClientMarketData struct { - Entries []*CMsgGCClientMarketDataEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientMarketData) Reset() { *m = CMsgGCClientMarketData{} } -func (m *CMsgGCClientMarketData) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientMarketData) ProtoMessage() {} -func (*CMsgGCClientMarketData) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{75} } - -func (m *CMsgGCClientMarketData) GetEntries() []*CMsgGCClientMarketDataEntry { - if m != nil { - return m.Entries - } - return nil -} - -type CMsgApplyToolToItem struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - SubjectItemId *uint64 `protobuf:"varint,2,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyToolToItem) Reset() { *m = CMsgApplyToolToItem{} } -func (m *CMsgApplyToolToItem) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyToolToItem) ProtoMessage() {} -func (*CMsgApplyToolToItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{76} } - -func (m *CMsgApplyToolToItem) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgApplyToolToItem) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -type CMsgApplyToolToBaseItem struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - BaseitemDefIndex *uint32 `protobuf:"varint,2,opt,name=baseitem_def_index" json:"baseitem_def_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyToolToBaseItem) Reset() { *m = CMsgApplyToolToBaseItem{} } -func (m *CMsgApplyToolToBaseItem) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyToolToBaseItem) ProtoMessage() {} -func (*CMsgApplyToolToBaseItem) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{77} } - -func (m *CMsgApplyToolToBaseItem) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgApplyToolToBaseItem) GetBaseitemDefIndex() uint32 { - if m != nil && m.BaseitemDefIndex != nil { - return *m.BaseitemDefIndex - } - return 0 -} - -type CMsgRecipeComponent struct { - SubjectItemId *uint64 `protobuf:"varint,1,opt,name=subject_item_id" json:"subject_item_id,omitempty"` - AttributeIndex *uint64 `protobuf:"varint,2,opt,name=attribute_index" json:"attribute_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRecipeComponent) Reset() { *m = CMsgRecipeComponent{} } -func (m *CMsgRecipeComponent) String() string { return proto.CompactTextString(m) } -func (*CMsgRecipeComponent) ProtoMessage() {} -func (*CMsgRecipeComponent) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{78} } - -func (m *CMsgRecipeComponent) GetSubjectItemId() uint64 { - if m != nil && m.SubjectItemId != nil { - return *m.SubjectItemId - } - return 0 -} - -func (m *CMsgRecipeComponent) GetAttributeIndex() uint64 { - if m != nil && m.AttributeIndex != nil { - return *m.AttributeIndex - } - return 0 -} - -type CMsgFulfillDynamicRecipeComponent struct { - ToolItemId *uint64 `protobuf:"varint,1,opt,name=tool_item_id" json:"tool_item_id,omitempty"` - ConsumptionComponents []*CMsgRecipeComponent `protobuf:"bytes,2,rep,name=consumption_components" json:"consumption_components,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgFulfillDynamicRecipeComponent) Reset() { *m = CMsgFulfillDynamicRecipeComponent{} } -func (m *CMsgFulfillDynamicRecipeComponent) String() string { return proto.CompactTextString(m) } -func (*CMsgFulfillDynamicRecipeComponent) ProtoMessage() {} -func (*CMsgFulfillDynamicRecipeComponent) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{79} -} - -func (m *CMsgFulfillDynamicRecipeComponent) GetToolItemId() uint64 { - if m != nil && m.ToolItemId != nil { - return *m.ToolItemId - } - return 0 -} - -func (m *CMsgFulfillDynamicRecipeComponent) GetConsumptionComponents() []*CMsgRecipeComponent { - if m != nil { - return m.ConsumptionComponents - } - return nil -} - -type CMsgSetItemEffectVerticalOffset struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - Offset *float32 `protobuf:"fixed32,2,opt,name=offset" json:"offset,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetItemEffectVerticalOffset) Reset() { *m = CMsgSetItemEffectVerticalOffset{} } -func (m *CMsgSetItemEffectVerticalOffset) String() string { return proto.CompactTextString(m) } -func (*CMsgSetItemEffectVerticalOffset) ProtoMessage() {} -func (*CMsgSetItemEffectVerticalOffset) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{80} -} - -func (m *CMsgSetItemEffectVerticalOffset) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgSetItemEffectVerticalOffset) GetOffset() float32 { - if m != nil && m.Offset != nil { - return *m.Offset - } - return 0 -} - -type CMsgSetHatEffectUseHeadOrigin struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - UseHead *bool `protobuf:"varint,2,opt,name=use_head" json:"use_head,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetHatEffectUseHeadOrigin) Reset() { *m = CMsgSetHatEffectUseHeadOrigin{} } -func (m *CMsgSetHatEffectUseHeadOrigin) String() string { return proto.CompactTextString(m) } -func (*CMsgSetHatEffectUseHeadOrigin) ProtoMessage() {} -func (*CMsgSetHatEffectUseHeadOrigin) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{81} } - -func (m *CMsgSetHatEffectUseHeadOrigin) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgSetHatEffectUseHeadOrigin) GetUseHead() bool { - if m != nil && m.UseHead != nil { - return *m.UseHead - } - return false -} - -type CMsgDeliverGiftResponseGiver struct { - ResponseCode *uint32 `protobuf:"varint,1,opt,name=response_code" json:"response_code,omitempty"` - ReceiverAccountName *string `protobuf:"bytes,2,opt,name=receiver_account_name" json:"receiver_account_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgDeliverGiftResponseGiver) Reset() { *m = CMsgDeliverGiftResponseGiver{} } -func (m *CMsgDeliverGiftResponseGiver) String() string { return proto.CompactTextString(m) } -func (*CMsgDeliverGiftResponseGiver) ProtoMessage() {} -func (*CMsgDeliverGiftResponseGiver) Descriptor() ([]byte, []int) { return base_fileDescriptor0, []int{82} } - -func (m *CMsgDeliverGiftResponseGiver) GetResponseCode() uint32 { - if m != nil && m.ResponseCode != nil { - return *m.ResponseCode - } - return 0 -} - -func (m *CMsgDeliverGiftResponseGiver) GetReceiverAccountName() string { - if m != nil && m.ReceiverAccountName != nil { - return *m.ReceiverAccountName - } - return "" -} - -type CSOEconGameAccountForGameServers struct { - SkillRating *uint32 `protobuf:"varint,3,opt,name=skill_rating" json:"skill_rating,omitempty"` - SkillRating_6V6 *uint32 `protobuf:"varint,2,opt,name=skill_rating_6v6" json:"skill_rating_6v6,omitempty"` - SkillRating_9V9 *uint32 `protobuf:"varint,4,opt,name=skill_rating_9v9" json:"skill_rating_9v9,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOEconGameAccountForGameServers) Reset() { *m = CSOEconGameAccountForGameServers{} } -func (m *CSOEconGameAccountForGameServers) String() string { return proto.CompactTextString(m) } -func (*CSOEconGameAccountForGameServers) ProtoMessage() {} -func (*CSOEconGameAccountForGameServers) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{83} -} - -func (m *CSOEconGameAccountForGameServers) GetSkillRating() uint32 { - if m != nil && m.SkillRating != nil { - return *m.SkillRating - } - return 0 -} - -func (m *CSOEconGameAccountForGameServers) GetSkillRating_6V6() uint32 { - if m != nil && m.SkillRating_6V6 != nil { - return *m.SkillRating_6V6 - } - return 0 -} - -func (m *CSOEconGameAccountForGameServers) GetSkillRating_9V9() uint32 { - if m != nil && m.SkillRating_9V9 != nil { - return *m.SkillRating_9V9 - } - return 0 -} - -type CWorkshop_PopulateItemDescriptions_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Languages []*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock `protobuf:"bytes,2,rep,name=languages" json:"languages,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_PopulateItemDescriptions_Request) Reset() { - *m = CWorkshop_PopulateItemDescriptions_Request{} -} -func (m *CWorkshop_PopulateItemDescriptions_Request) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_PopulateItemDescriptions_Request) ProtoMessage() {} -func (*CWorkshop_PopulateItemDescriptions_Request) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{84} -} - -func (m *CWorkshop_PopulateItemDescriptions_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_PopulateItemDescriptions_Request) GetLanguages() []*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock { - if m != nil { - return m.Languages - } - return nil -} - -type CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription struct { - Gameitemid *uint32 `protobuf:"varint,1,opt,name=gameitemid" json:"gameitemid,omitempty"` - ItemDescription *string `protobuf:"bytes,2,opt,name=item_description" json:"item_description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) Reset() { - *m = CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription{} -} -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) ProtoMessage() {} -func (*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{84, 0} -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) GetGameitemid() uint32 { - if m != nil && m.Gameitemid != nil { - return *m.Gameitemid - } - return 0 -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription) GetItemDescription() string { - if m != nil && m.ItemDescription != nil { - return *m.ItemDescription - } - return "" -} - -type CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock struct { - Language *string `protobuf:"bytes,1,opt,name=language" json:"language,omitempty"` - Descriptions []*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription `protobuf:"bytes,2,rep,name=descriptions" json:"descriptions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) Reset() { - *m = CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock{} -} -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) ProtoMessage() {} -func (*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{84, 1} -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) GetLanguage() string { - if m != nil && m.Language != nil { - return *m.Language - } - return "" -} - -func (m *CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock) GetDescriptions() []*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription { - if m != nil { - return m.Descriptions - } - return nil -} - -type CWorkshop_GetContributors_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Gameitemid *uint32 `protobuf:"varint,2,opt,name=gameitemid" json:"gameitemid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetContributors_Request) Reset() { *m = CWorkshop_GetContributors_Request{} } -func (m *CWorkshop_GetContributors_Request) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_GetContributors_Request) ProtoMessage() {} -func (*CWorkshop_GetContributors_Request) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{85} -} - -func (m *CWorkshop_GetContributors_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_GetContributors_Request) GetGameitemid() uint32 { - if m != nil && m.Gameitemid != nil { - return *m.Gameitemid - } - return 0 -} - -type CWorkshop_GetContributors_Response struct { - Contributors []uint64 `protobuf:"fixed64,1,rep,name=contributors" json:"contributors,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_GetContributors_Response) Reset() { *m = CWorkshop_GetContributors_Response{} } -func (m *CWorkshop_GetContributors_Response) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_GetContributors_Response) ProtoMessage() {} -func (*CWorkshop_GetContributors_Response) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{86} -} - -func (m *CWorkshop_GetContributors_Response) GetContributors() []uint64 { - if m != nil { - return m.Contributors - } - return nil -} - -type CWorkshop_SetItemPaymentRules_Request struct { - Appid *uint32 `protobuf:"varint,1,opt,name=appid" json:"appid,omitempty"` - Gameitemid *uint32 `protobuf:"varint,2,opt,name=gameitemid" json:"gameitemid,omitempty"` - AssociatedWorkshopFiles []*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule `protobuf:"bytes,3,rep,name=associated_workshop_files" json:"associated_workshop_files,omitempty"` - PartnerAccounts []*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule `protobuf:"bytes,4,rep,name=partner_accounts" json:"partner_accounts,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Request) Reset() { *m = CWorkshop_SetItemPaymentRules_Request{} } -func (m *CWorkshop_SetItemPaymentRules_Request) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_SetItemPaymentRules_Request) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Request) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{87} -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetAppid() uint32 { - if m != nil && m.Appid != nil { - return *m.Appid - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetGameitemid() uint32 { - if m != nil && m.Gameitemid != nil { - return *m.Gameitemid - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetAssociatedWorkshopFiles() []*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule { - if m != nil { - return m.AssociatedWorkshopFiles - } - return nil -} - -func (m *CWorkshop_SetItemPaymentRules_Request) GetPartnerAccounts() []*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule { - if m != nil { - return m.PartnerAccounts - } - return nil -} - -type CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule struct { - WorkshopFileId *uint64 `protobuf:"varint,1,opt,name=workshop_file_id" json:"workshop_file_id,omitempty"` - RevenuePercentage *float32 `protobuf:"fixed32,2,opt,name=revenue_percentage" json:"revenue_percentage,omitempty"` - RuleDescription *string `protobuf:"bytes,3,opt,name=rule_description" json:"rule_description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) Reset() { - *m = CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule{} -} -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{87, 0} -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) GetWorkshopFileId() uint64 { - if m != nil && m.WorkshopFileId != nil { - return *m.WorkshopFileId - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) GetRevenuePercentage() float32 { - if m != nil && m.RevenuePercentage != nil { - return *m.RevenuePercentage - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule) GetRuleDescription() string { - if m != nil && m.RuleDescription != nil { - return *m.RuleDescription - } - return "" -} - -type CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - RevenuePercentage *float32 `protobuf:"fixed32,2,opt,name=revenue_percentage" json:"revenue_percentage,omitempty"` - RuleDescription *string `protobuf:"bytes,3,opt,name=rule_description" json:"rule_description,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) Reset() { - *m = CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule{} -} -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) String() string { - return proto.CompactTextString(m) -} -func (*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{87, 1} -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) GetRevenuePercentage() float32 { - if m != nil && m.RevenuePercentage != nil { - return *m.RevenuePercentage - } - return 0 -} - -func (m *CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule) GetRuleDescription() string { - if m != nil && m.RuleDescription != nil { - return *m.RuleDescription - } - return "" -} - -type CWorkshop_SetItemPaymentRules_Response struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CWorkshop_SetItemPaymentRules_Response) Reset() { - *m = CWorkshop_SetItemPaymentRules_Response{} -} -func (m *CWorkshop_SetItemPaymentRules_Response) String() string { return proto.CompactTextString(m) } -func (*CWorkshop_SetItemPaymentRules_Response) ProtoMessage() {} -func (*CWorkshop_SetItemPaymentRules_Response) Descriptor() ([]byte, []int) { - return base_fileDescriptor0, []int{88} -} - -func init() { - proto.RegisterType((*CGCStorePurchaseInit_LineItem)(nil), "CGCStorePurchaseInit_LineItem") - proto.RegisterType((*CMsgGCStorePurchaseInit)(nil), "CMsgGCStorePurchaseInit") - proto.RegisterType((*CMsgGCStorePurchaseInitResponse)(nil), "CMsgGCStorePurchaseInitResponse") - proto.RegisterType((*CSOPartyInvite)(nil), "CSOPartyInvite") - proto.RegisterType((*CSOLobbyInvite)(nil), "CSOLobbyInvite") - proto.RegisterType((*CMsgSystemBroadcast)(nil), "CMsgSystemBroadcast") - proto.RegisterType((*CMsgClientHello)(nil), "CMsgClientHello") - proto.RegisterType((*CMsgServerHello)(nil), "CMsgServerHello") - proto.RegisterType((*CMsgClientWelcome)(nil), "CMsgClientWelcome") - proto.RegisterType((*CMsgServerWelcome)(nil), "CMsgServerWelcome") - proto.RegisterType((*CMsgClientGoodbye)(nil), "CMsgClientGoodbye") - proto.RegisterType((*CMsgServerGoodbye)(nil), "CMsgServerGoodbye") - proto.RegisterType((*CMsgInviteToParty)(nil), "CMsgInviteToParty") - proto.RegisterType((*CMsgInvitationCreated)(nil), "CMsgInvitationCreated") - proto.RegisterType((*CMsgPartyInviteResponse)(nil), "CMsgPartyInviteResponse") - proto.RegisterType((*CMsgKickFromParty)(nil), "CMsgKickFromParty") - proto.RegisterType((*CMsgLeaveParty)(nil), "CMsgLeaveParty") - proto.RegisterType((*CMsgServerAvailable)(nil), "CMsgServerAvailable") - proto.RegisterType((*CMsgLANServerAvailable)(nil), "CMsgLANServerAvailable") - proto.RegisterType((*CSOEconGameAccountClient)(nil), "CSOEconGameAccountClient") - proto.RegisterType((*CSOItemCriteriaCondition)(nil), "CSOItemCriteriaCondition") - proto.RegisterType((*CSOItemCriteria)(nil), "CSOItemCriteria") - proto.RegisterType((*CSOItemRecipe)(nil), "CSOItemRecipe") - proto.RegisterType((*CMsgDevNewItemRequest)(nil), "CMsgDevNewItemRequest") - proto.RegisterType((*CMsgDevDebugRollLootRequest)(nil), "CMsgDevDebugRollLootRequest") - proto.RegisterType((*CMsgIncrementKillCountAttribute)(nil), "CMsgIncrementKillCountAttribute") - proto.RegisterType((*CMsgIncrementKillCountAttribute_Multiple)(nil), "CMsgIncrementKillCountAttribute_Multiple") - proto.RegisterType((*CMsgTrackUniquePlayerPairEvent)(nil), "CMsgTrackUniquePlayerPairEvent") - proto.RegisterType((*CMsgApplyStrangeCountTransfer)(nil), "CMsgApplyStrangeCountTransfer") - proto.RegisterType((*CMsgApplyStrangePart)(nil), "CMsgApplyStrangePart") - proto.RegisterType((*CMsgApplyStrangeRestriction)(nil), "CMsgApplyStrangeRestriction") - proto.RegisterType((*CMsgApplyUpgradeCard)(nil), "CMsgApplyUpgradeCard") - proto.RegisterType((*CSOEconItemAttribute)(nil), "CSOEconItemAttribute") - proto.RegisterType((*CSOEconItemEquipped)(nil), "CSOEconItemEquipped") - proto.RegisterType((*CSOEconItem)(nil), "CSOEconItem") - proto.RegisterType((*CMsgAdjustItemEquippedState)(nil), "CMsgAdjustItemEquippedState") - proto.RegisterType((*CMsgSortItems)(nil), "CMsgSortItems") - proto.RegisterType((*CSOEconClaimCode)(nil), "CSOEconClaimCode") - proto.RegisterType((*CMsgStoreGetUserData)(nil), "CMsgStoreGetUserData") - proto.RegisterType((*CMsgStoreGetUserDataResponse)(nil), "CMsgStoreGetUserDataResponse") - proto.RegisterType((*CMsgUpdateItemSchema)(nil), "CMsgUpdateItemSchema") - proto.RegisterType((*CMsgGCError)(nil), "CMsgGCError") - proto.RegisterType((*CMsgRequestInventoryRefresh)(nil), "CMsgRequestInventoryRefresh") - proto.RegisterType((*CMsgConVarValue)(nil), "CMsgConVarValue") - proto.RegisterType((*CMsgReplicateConVars)(nil), "CMsgReplicateConVars") - proto.RegisterType((*CMsgUseItem)(nil), "CMsgUseItem") - proto.RegisterType((*CMsgReplayUploadedToYouTube)(nil), "CMsgReplayUploadedToYouTube") - proto.RegisterType((*CMsgConsumableExhausted)(nil), "CMsgConsumableExhausted") - proto.RegisterType((*CMsgItemAcknowledged)(nil), "CMsgItemAcknowledged") - proto.RegisterType((*CMsgSetPresetItemPosition)(nil), "CMsgSetPresetItemPosition") - proto.RegisterType((*CMsgSetItemPositions)(nil), "CMsgSetItemPositions") - proto.RegisterType((*CMsgSetItemPositions_ItemPosition)(nil), "CMsgSetItemPositions.ItemPosition") - proto.RegisterType((*CSOEconItemPresetInstance)(nil), "CSOEconItemPresetInstance") - proto.RegisterType((*CMsgSelectPresetForClass)(nil), "CMsgSelectPresetForClass") - proto.RegisterType((*CSOClassPresetClientData)(nil), "CSOClassPresetClientData") - proto.RegisterType((*CMsgGCReportAbuse)(nil), "CMsgGCReportAbuse") - proto.RegisterType((*CMsgGCReportAbuseResponse)(nil), "CMsgGCReportAbuseResponse") - proto.RegisterType((*CMsgGCNameItemNotification)(nil), "CMsgGCNameItemNotification") - proto.RegisterType((*CMsgGCClientDisplayNotification)(nil), "CMsgGCClientDisplayNotification") - proto.RegisterType((*CMsgGCShowItemsPickedUp)(nil), "CMsgGCShowItemsPickedUp") - proto.RegisterType((*CMsgUpdatePeriodicEvent)(nil), "CMsgUpdatePeriodicEvent") - proto.RegisterType((*CMsgGCIncrementKillCountResponse)(nil), "CMsgGCIncrementKillCountResponse") - proto.RegisterType((*CMsgGCRemoveStrangePart)(nil), "CMsgGCRemoveStrangePart") - proto.RegisterType((*CMsgGCRemoveUpgradeCard)(nil), "CMsgGCRemoveUpgradeCard") - proto.RegisterType((*CMsgGCRemoveCustomizationAttributeSimple)(nil), "CMsgGCRemoveCustomizationAttributeSimple") - proto.RegisterType((*CMsgGCResetStrangeScores)(nil), "CMsgGCResetStrangeScores") - proto.RegisterType((*CMsgGCItemPreviewItemBoughtNotification)(nil), "CMsgGCItemPreviewItemBoughtNotification") - proto.RegisterType((*CMsgGCStorePurchaseCancel)(nil), "CMsgGCStorePurchaseCancel") - proto.RegisterType((*CMsgGCStorePurchaseCancelResponse)(nil), "CMsgGCStorePurchaseCancelResponse") - proto.RegisterType((*CMsgGCStorePurchaseFinalize)(nil), "CMsgGCStorePurchaseFinalize") - proto.RegisterType((*CMsgGCStorePurchaseFinalizeResponse)(nil), "CMsgGCStorePurchaseFinalizeResponse") - proto.RegisterType((*CMsgGCBannedWordListRequest)(nil), "CMsgGCBannedWordListRequest") - proto.RegisterType((*CMsgGCGiftedItems)(nil), "CMsgGCGiftedItems") - proto.RegisterType((*CMsgGCCollectItem)(nil), "CMsgGCCollectItem") - proto.RegisterType((*CMsgGCClientMarketDataRequest)(nil), "CMsgGCClientMarketDataRequest") - proto.RegisterType((*CMsgGCClientMarketDataEntry)(nil), "CMsgGCClientMarketDataEntry") - proto.RegisterType((*CMsgGCClientMarketData)(nil), "CMsgGCClientMarketData") - proto.RegisterType((*CMsgApplyToolToItem)(nil), "CMsgApplyToolToItem") - proto.RegisterType((*CMsgApplyToolToBaseItem)(nil), "CMsgApplyToolToBaseItem") - proto.RegisterType((*CMsgRecipeComponent)(nil), "CMsgRecipeComponent") - proto.RegisterType((*CMsgFulfillDynamicRecipeComponent)(nil), "CMsgFulfillDynamicRecipeComponent") - proto.RegisterType((*CMsgSetItemEffectVerticalOffset)(nil), "CMsgSetItemEffectVerticalOffset") - proto.RegisterType((*CMsgSetHatEffectUseHeadOrigin)(nil), "CMsgSetHatEffectUseHeadOrigin") - proto.RegisterType((*CMsgDeliverGiftResponseGiver)(nil), "CMsgDeliverGiftResponseGiver") - proto.RegisterType((*CSOEconGameAccountForGameServers)(nil), "CSOEconGameAccountForGameServers") - proto.RegisterType((*CWorkshop_PopulateItemDescriptions_Request)(nil), "CWorkshop_PopulateItemDescriptions_Request") - proto.RegisterType((*CWorkshop_PopulateItemDescriptions_Request_SingleItemDescription)(nil), "CWorkshop_PopulateItemDescriptions_Request.SingleItemDescription") - proto.RegisterType((*CWorkshop_PopulateItemDescriptions_Request_ItemDescriptionsLanguageBlock)(nil), "CWorkshop_PopulateItemDescriptions_Request.ItemDescriptionsLanguageBlock") - proto.RegisterType((*CWorkshop_GetContributors_Request)(nil), "CWorkshop_GetContributors_Request") - proto.RegisterType((*CWorkshop_GetContributors_Response)(nil), "CWorkshop_GetContributors_Response") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Request)(nil), "CWorkshop_SetItemPaymentRules_Request") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Request_WorkshopItemPaymentRule)(nil), "CWorkshop_SetItemPaymentRules_Request.WorkshopItemPaymentRule") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Request_PartnerItemPaymentRule)(nil), "CWorkshop_SetItemPaymentRules_Request.PartnerItemPaymentRule") - proto.RegisterType((*CWorkshop_SetItemPaymentRules_Response)(nil), "CWorkshop_SetItemPaymentRules_Response") - proto.RegisterEnum("EGCBaseMsg", EGCBaseMsg_name, EGCBaseMsg_value) - proto.RegisterEnum("EGCBaseProtoObjectTypes", EGCBaseProtoObjectTypes_name, EGCBaseProtoObjectTypes_value) - proto.RegisterEnum("GCGoodbyeReason", GCGoodbyeReason_name, GCGoodbyeReason_value) -} - -var base_fileDescriptor0 = []byte{ - // 3905 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x5a, 0xeb, 0x6f, 0x1c, 0x59, - 0x56, 0xa7, 0x5f, 0x7e, 0xdc, 0xd8, 0x49, 0xa7, 0x13, 0x27, 0x1d, 0xcf, 0x78, 0x92, 0x94, 0x99, - 0x25, 0xca, 0x30, 0x0d, 0x9b, 0x45, 0x83, 0x26, 0x2b, 0x58, 0x39, 0x1d, 0xc7, 0x31, 0x93, 0x87, - 0x89, 0x9d, 0x89, 0x16, 0x10, 0x45, 0x75, 0xd5, 0xed, 0x76, 0x8d, 0xab, 0xeb, 0xd6, 0xd4, 0xad, - 0xb2, 0xd3, 0x2b, 0x90, 0x56, 0x48, 0x48, 0x88, 0x6f, 0x2b, 0xde, 0x6f, 0x01, 0x12, 0xdf, 0xf7, - 0x0b, 0xf0, 0x87, 0xc0, 0x1f, 0x01, 0x12, 0xff, 0x03, 0xe7, 0x71, 0x6f, 0x77, 0x55, 0x75, 0x77, - 0x26, 0xbb, 0x5a, 0x3e, 0xcc, 0xc4, 0x7d, 0x1f, 0xe7, 0x9e, 0x7b, 0x9e, 0xbf, 0x73, 0x6e, 0x89, - 0xad, 0x81, 0xa7, 0xa5, 0x3b, 0xf2, 0xc7, 0x52, 0x6b, 0x6f, 0x24, 0x75, 0x2f, 0x49, 0x55, 0xa6, - 0xb6, 0xaf, 0xe9, 0x4c, 0x7a, 0xe3, 0xf2, 0xa0, 0xf3, 0x07, 0x62, 0xa7, 0x7f, 0xd0, 0x3f, 0xce, - 0x54, 0x2a, 0x8f, 0xf2, 0xd4, 0x3f, 0x85, 0x9d, 0x87, 0x71, 0x98, 0xb9, 0xcf, 0xc2, 0x58, 0x1e, - 0x66, 0x72, 0xdc, 0xb9, 0x26, 0x2e, 0x85, 0xf0, 0xaf, 0x1b, 0xc8, 0xa1, 0x1b, 0x06, 0xdd, 0xda, - 0x9d, 0xda, 0xbd, 0xcd, 0x4e, 0x5b, 0xac, 0x7d, 0x9d, 0x7b, 0x71, 0x16, 0x66, 0x93, 0x6e, 0x9d, - 0x46, 0x3e, 0x12, 0x37, 0x7c, 0xa5, 0x33, 0x37, 0x8c, 0xdd, 0x48, 0xf9, 0x5e, 0xe4, 0xfa, 0x79, - 0x9a, 0xca, 0xd8, 0x9f, 0x74, 0x1b, 0x34, 0xbf, 0x25, 0x36, 0x13, 0x43, 0xdf, 0xcd, 0x26, 0x89, - 0xec, 0x36, 0x71, 0xd8, 0xf9, 0xc3, 0x9a, 0xb8, 0xd9, 0x7f, 0xae, 0x47, 0x0b, 0x58, 0xe8, 0x5c, - 0x11, 0xab, 0xbe, 0xca, 0xe3, 0x2c, 0x9d, 0xd0, 0xa9, 0xeb, 0x78, 0x6a, 0xe4, 0xc5, 0xa3, 0x1c, - 0xd8, 0xa7, 0x53, 0x5b, 0x38, 0x52, 0x3a, 0xa7, 0xd5, 0x79, 0x20, 0x44, 0x04, 0xac, 0xbb, 0xc8, - 0xb3, 0x86, 0x43, 0x1a, 0xf7, 0x2e, 0x3d, 0xf8, 0xa8, 0xf7, 0xce, 0x2b, 0x3a, 0x7b, 0xe2, 0xf6, - 0x12, 0x1e, 0x5e, 0x49, 0x9d, 0xa8, 0x58, 0xcb, 0xce, 0x65, 0xb1, 0x92, 0x4a, 0x9d, 0x47, 0x19, - 0xb1, 0xd2, 0xc2, 0xdf, 0xd9, 0xdb, 0x18, 0x05, 0x82, 0x8c, 0x34, 0x9d, 0x23, 0x71, 0xb9, 0x7f, - 0xfc, 0xf2, 0xc8, 0x4b, 0xb3, 0xc9, 0x61, 0x7c, 0x0e, 0x87, 0x77, 0x6e, 0x88, 0xb5, 0x51, 0xaa, - 0xf2, 0xc4, 0x0a, 0xad, 0xf9, 0xa8, 0xf9, 0xc3, 0x7f, 0xdd, 0xa9, 0x75, 0xae, 0x8a, 0x75, 0x2d, - 0xe3, 0x40, 0xa6, 0x76, 0xf3, 0x0a, 0x8a, 0xd8, 0x0c, 0xc5, 0xde, 0x58, 0xd2, 0x45, 0xd6, 0x0d, - 0xc5, 0x67, 0x6a, 0x30, 0xf8, 0x59, 0x51, 0xfc, 0x96, 0xb8, 0x86, 0xd7, 0x3c, 0x9e, 0x80, 0x1d, - 0x8c, 0x1f, 0xa5, 0xca, 0x0b, 0x7c, 0x4f, 0x93, 0x98, 0x8d, 0x4d, 0xb0, 0x98, 0x1d, 0x47, 0x5c, - 0xc1, 0x75, 0xfd, 0x28, 0x94, 0x71, 0xf6, 0x54, 0x46, 0x91, 0xc2, 0x35, 0xe7, 0x32, 0xd5, 0xa1, - 0x8a, 0xd9, 0x00, 0xec, 0x9a, 0x63, 0x99, 0xc2, 0xf8, 0x92, 0x35, 0xbf, 0x2a, 0xae, 0xce, 0xe8, - 0xbc, 0x91, 0x91, 0xaf, 0xc6, 0x72, 0x6e, 0x15, 0x72, 0x3f, 0x02, 0x1e, 0xdd, 0xc0, 0xcb, 0x3c, - 0xe2, 0x7e, 0xc3, 0x79, 0xca, 0x1b, 0x99, 0xb8, 0xdd, 0xf8, 0x81, 0xb8, 0x36, 0x06, 0xe3, 0xf2, - 0xe0, 0xa8, 0x0b, 0x19, 0xb8, 0x65, 0x22, 0x37, 0xc4, 0x65, 0xcf, 0xcf, 0xc2, 0x73, 0x39, 0x1d, - 0x27, 0xab, 0x74, 0x4e, 0x8a, 0x2c, 0x1c, 0x28, 0x15, 0x0c, 0x26, 0xb2, 0xf3, 0x3d, 0xd4, 0xa5, - 0xa7, 0xcd, 0xe6, 0xcb, 0x0f, 0xda, 0xbd, 0x83, 0xbe, 0x99, 0x7b, 0x45, 0xe3, 0x0f, 0x77, 0x2a, - 0x03, 0xee, 0x41, 0xdf, 0x3d, 0x78, 0x79, 0xf8, 0xe2, 0xc0, 0x7d, 0xfc, 0xf2, 0xcd, 0x0b, 0x4b, - 0x95, 0xf9, 0xfb, 0x99, 0x51, 0xfd, 0x3d, 0xa6, 0xca, 0xca, 0x3e, 0x51, 0x64, 0x4b, 0x68, 0xe0, - 0xe4, 0xb5, 0x56, 0xe7, 0x2b, 0x78, 0x55, 0x9f, 0xae, 0x53, 0xbe, 0x2a, 0x0a, 0xd6, 0x2e, 0x6c, - 0x58, 0x1f, 0xf5, 0xb4, 0xeb, 0x2b, 0xcf, 0x3f, 0x25, 0x67, 0x5b, 0x73, 0xbe, 0x2b, 0xb6, 0xa6, - 0x27, 0x78, 0x19, 0x6c, 0xed, 0x03, 0xc7, 0x99, 0x0c, 0x70, 0x69, 0xd9, 0xb2, 0x4a, 0xe7, 0x92, - 0x49, 0x39, 0xe7, 0xec, 0xa8, 0x05, 0x13, 0x9f, 0x3a, 0x07, 0x2c, 0x4e, 0x70, 0x78, 0xb6, 0x1d, - 0xdc, 0xc3, 0xf3, 0x7d, 0x99, 0x64, 0xb4, 0x79, 0x6d, 0x01, 0xd3, 0x8d, 0x2a, 0xd3, 0xcd, 0x39, - 0xa6, 0x5b, 0xc4, 0xf4, 0xc7, 0x2c, 0x96, 0x2f, 0x42, 0xff, 0xec, 0x49, 0xaa, 0xc6, 0x4b, 0xc4, - 0xe2, 0xb4, 0xc1, 0x5d, 0x60, 0xd9, 0x33, 0xe9, 0x9d, 0x4b, 0x5a, 0xe3, 0x6c, 0x19, 0x73, 0x27, - 0x2d, 0xed, 0x9d, 0x7b, 0x61, 0xe4, 0x0d, 0x22, 0xe9, 0xdc, 0x17, 0x37, 0x68, 0xe1, 0xde, 0x8b, - 0xca, 0x0c, 0x85, 0x17, 0x74, 0xb7, 0x19, 0xd1, 0x3f, 0x6d, 0x88, 0x2e, 0x38, 0xe1, 0xbe, 0xaf, - 0xe2, 0x03, 0xb0, 0xd1, 0x3d, 0x9f, 0xe2, 0x11, 0x5b, 0x53, 0xe7, 0xe7, 0xc5, 0x2d, 0x2f, 0x08, - 0x42, 0x94, 0x23, 0x84, 0xbb, 0x81, 0xe7, 0x9f, 0x25, 0xf0, 0x9f, 0xab, 0x23, 0x95, 0x69, 0x36, - 0xcb, 0x87, 0xb5, 0x5f, 0xee, 0x7c, 0x28, 0x36, 0xb3, 0x34, 0x84, 0x05, 0x1e, 0x6f, 0x66, 0x81, - 0x3c, 0x6c, 0x0d, 0xbd, 0x08, 0x24, 0x77, 0x5f, 0x38, 0xb1, 0x04, 0x6b, 0xce, 0x94, 0xeb, 0x9f, - 0x2a, 0x05, 0xb1, 0x71, 0x8c, 0x41, 0xf4, 0x54, 0x46, 0xc9, 0x30, 0x8f, 0xdc, 0x61, 0x0a, 0x27, - 0xb1, 0x68, 0xd6, 0x3a, 0x37, 0xc5, 0x15, 0xb0, 0x7f, 0x12, 0x8d, 0xd4, 0x6e, 0x14, 0xea, 0x8c, - 0x25, 0x04, 0x47, 0x5c, 0xcf, 0x52, 0x2f, 0x90, 0xc0, 0x43, 0xec, 0xca, 0xb7, 0x49, 0x98, 0x92, - 0x72, 0xbb, 0x2b, 0x30, 0xbb, 0x8a, 0x7e, 0x13, 0xe4, 0x32, 0xaa, 0x4e, 0xae, 0x9a, 0xc9, 0x76, - 0x92, 0xca, 0xf3, 0x50, 0x5e, 0xb8, 0x36, 0xc8, 0x77, 0xd7, 0x2c, 0xeb, 0x77, 0x44, 0x17, 0x27, - 0x51, 0x6b, 0x63, 0x2f, 0xf3, 0x4f, 0x5d, 0x60, 0x3f, 0x8c, 0xd0, 0x51, 0x65, 0xb7, 0x43, 0xda, - 0xda, 0x11, 0x97, 0x93, 0x53, 0x15, 0x93, 0xd7, 0x85, 0xc3, 0x50, 0x06, 0xdd, 0x6b, 0xc5, 0xdb, - 0x75, 0x45, 0x5b, 0x9f, 0x85, 0x51, 0xe4, 0xe2, 0x99, 0xf1, 0xc8, 0xfd, 0xec, 0xfc, 0xb3, 0xee, - 0x75, 0xda, 0x58, 0x9d, 0xf9, 0xfc, 0xfc, 0xf3, 0xee, 0x16, 0xcd, 0xdc, 0x15, 0x9d, 0xec, 0x42, - 0xb9, 0x43, 0x70, 0x67, 0x95, 0xba, 0x32, 0x46, 0xcd, 0x04, 0xdd, 0x1b, 0x05, 0xb2, 0x4e, 0x4a, - 0x4a, 0xc1, 0xc8, 0xdd, 0x4f, 0x81, 0x6b, 0x90, 0x6e, 0x5f, 0xc5, 0xac, 0x88, 0x8e, 0x10, 0x75, - 0x95, 0x98, 0x18, 0xbd, 0x29, 0x5a, 0xc0, 0x53, 0xc4, 0x06, 0x4c, 0xd9, 0x23, 0x95, 0x5f, 0xe7, - 0x61, 0x2a, 0xd9, 0x43, 0xd6, 0x30, 0x4a, 0x0e, 0x23, 0xe5, 0x81, 0x51, 0x7a, 0x51, 0xce, 0x19, - 0xa9, 0xde, 0xb9, 0x2e, 0x36, 0x34, 0x68, 0x0c, 0x98, 0xe2, 0xd1, 0x16, 0xc5, 0xc4, 0x1f, 0xd5, - 0x21, 0xe0, 0x95, 0x0f, 0xed, 0xc0, 0x61, 0x24, 0xb4, 0x08, 0x64, 0x14, 0x99, 0x40, 0x04, 0xbb, - 0x69, 0x0c, 0xb2, 0x63, 0x64, 0x93, 0x63, 0x0b, 0xcd, 0x7f, 0xb6, 0xd2, 0xd5, 0x32, 0x33, 0x0c, - 0x80, 0x18, 0x8a, 0xab, 0x69, 0x86, 0x95, 0x7d, 0x4b, 0x5c, 0x0d, 0x21, 0xff, 0xa0, 0xe1, 0x84, - 0x31, 0xaa, 0x40, 0x41, 0x16, 0x6c, 0x59, 0xd9, 0xd9, 0xa9, 0x69, 0x0e, 0x5e, 0xa1, 0x19, 0x50, - 0x75, 0x38, 0x8a, 0x21, 0x85, 0x59, 0xb9, 0xb9, 0xc3, 0xc8, 0x1b, 0x91, 0x42, 0xd7, 0x3a, 0x9f, - 0x0a, 0xe1, 0x5b, 0x31, 0xe9, 0xee, 0x3a, 0x25, 0xc6, 0x5b, 0xbd, 0xa5, 0x82, 0x04, 0xd9, 0xa4, - 0xd2, 0x47, 0xdd, 0xab, 0x38, 0x9a, 0x74, 0x05, 0xd1, 0xd8, 0x10, 0xcd, 0xcc, 0x1b, 0xe9, 0xee, - 0x25, 0x92, 0xc9, 0x7f, 0x35, 0xc4, 0xa6, 0xd9, 0xff, 0x4a, 0xfa, 0x61, 0x22, 0x31, 0x96, 0x13, - 0x4c, 0x80, 0xcc, 0xf3, 0xd6, 0x08, 0x04, 0xb6, 0x50, 0x0a, 0x62, 0x1d, 0x5c, 0x12, 0x0d, 0x08, - 0xe1, 0x9c, 0x8f, 0xf0, 0x88, 0x40, 0x6a, 0x1f, 0x96, 0x27, 0x79, 0xa6, 0xe9, 0xe2, 0xeb, 0x28, - 0x40, 0x1a, 0x54, 0x79, 0x46, 0xa3, 0x24, 0x7e, 0xa4, 0x12, 0x84, 0xb0, 0x71, 0xa5, 0xf0, 0x6b, - 0x40, 0x36, 0x6c, 0x7f, 0xf9, 0x74, 0x4d, 0xfe, 0xa5, 0x60, 0xe5, 0x7a, 0xe1, 0xd7, 0x80, 0xd8, - 0xb7, 0xbf, 0x7c, 0x66, 0xbf, 0x73, 0x5b, 0xdc, 0x34, 0xf6, 0xa0, 0x31, 0xab, 0xb8, 0x1a, 0xb3, - 0x90, 0x1f, 0x79, 0x5a, 0x77, 0x37, 0xe8, 0xb6, 0x00, 0x69, 0xe6, 0x17, 0xa0, 0x7b, 0x77, 0x37, - 0xed, 0x3c, 0x2d, 0x77, 0x73, 0x4c, 0x9e, 0xee, 0x10, 0xec, 0x95, 0xb9, 0xee, 0x5e, 0x26, 0xad, - 0xef, 0x88, 0x2d, 0x5c, 0x3d, 0x3f, 0x7d, 0xc5, 0x1a, 0x05, 0xe8, 0xbb, 0x38, 0xde, 0xa6, 0xf1, - 0x9e, 0xb8, 0x4e, 0x12, 0x61, 0x08, 0xe3, 0xfa, 0x46, 0x35, 0xe0, 0x39, 0xa8, 0xb2, 0x76, 0x55, - 0x65, 0x9d, 0x5f, 0x12, 0x5b, 0xbc, 0xbf, 0xba, 0x61, 0x6b, 0xc9, 0x06, 0xe0, 0x7b, 0x76, 0x80, - 0x1b, 0xe4, 0x09, 0x5c, 0x1b, 0x43, 0x93, 0x06, 0x37, 0x6b, 0x40, 0xd2, 0x7c, 0xce, 0x69, 0xe2, - 0xb1, 0x3c, 0x7f, 0x21, 0x2f, 0x58, 0xbb, 0x5f, 0xe7, 0x12, 0x90, 0x02, 0x79, 0x90, 0x2f, 0x21, - 0xcd, 0xa6, 0x26, 0x19, 0x39, 0x80, 0xbf, 0xec, 0x71, 0xa8, 0xe1, 0x05, 0xc7, 0x39, 0x07, 0xe2, - 0x03, 0x43, 0xee, 0xb1, 0x1c, 0xe4, 0xa3, 0x57, 0x2a, 0x8a, 0x9e, 0x29, 0x95, 0x2d, 0x27, 0x0a, - 0x82, 0x89, 0x60, 0x01, 0x85, 0x38, 0x77, 0x66, 0x3c, 0xce, 0x8f, 0x6a, 0x8c, 0xd3, 0x0e, 0x63, - 0x3f, 0x95, 0x63, 0x30, 0xcd, 0x2f, 0x20, 0x82, 0xf4, 0x91, 0xf3, 0xbd, 0x0c, 0x3c, 0x76, 0x90, - 0x03, 0x46, 0x82, 0x20, 0x89, 0x71, 0x05, 0x80, 0x4f, 0x29, 0x3f, 0x34, 0x71, 0xe2, 0x3c, 0x04, - 0x88, 0x30, 0x76, 0x4b, 0x79, 0xad, 0x89, 0x29, 0x88, 0xe4, 0x60, 0xf2, 0x66, 0x13, 0xdd, 0x9a, - 0x83, 0xde, 0x0c, 0xa6, 0x72, 0xec, 0x35, 0xa7, 0x16, 0xe2, 0xc2, 0xa6, 0xf3, 0x5b, 0xe2, 0xde, - 0x37, 0xb0, 0xe4, 0x3e, 0x07, 0xd4, 0x18, 0x26, 0x90, 0x5f, 0x7a, 0xa2, 0x39, 0xd6, 0x23, 0xcc, - 0x0d, 0xa8, 0x97, 0x3b, 0xbd, 0x6f, 0xd8, 0xe8, 0x5c, 0x88, 0x8f, 0x70, 0xc9, 0x49, 0x0a, 0x69, - 0xe5, 0x75, 0x1c, 0x82, 0xb8, 0x8e, 0x22, 0x6f, 0x22, 0xd3, 0x23, 0x2f, 0x4c, 0xf7, 0x91, 0xc3, - 0xff, 0xa7, 0xdb, 0x3a, 0x5f, 0x41, 0x4d, 0x00, 0x07, 0xef, 0x25, 0x49, 0x34, 0x39, 0x86, 0xd4, - 0x12, 0x8f, 0x24, 0xb1, 0x06, 0x9c, 0xc4, 0x7a, 0x28, 0x53, 0x74, 0xd2, 0x4c, 0xa9, 0xc8, 0xb5, - 0xa4, 0xf8, 0x50, 0x1b, 0xcd, 0x74, 0xea, 0x4f, 0x67, 0xf8, 0x54, 0x8c, 0x66, 0x9c, 0x5e, 0x74, - 0xe6, 0x96, 0xce, 0x77, 0x7e, 0x43, 0x5c, 0xaf, 0x9e, 0x85, 0xe9, 0x1b, 0x93, 0x9a, 0xe6, 0x9f, - 0x2e, 0x62, 0x8b, 0xca, 0x51, 0x36, 0xcc, 0x96, 0x8e, 0x71, 0xc6, 0x6c, 0x69, 0x45, 0x5a, 0x80, - 0x51, 0x40, 0x9c, 0x3e, 0x85, 0xb4, 0x9f, 0x82, 0x64, 0x67, 0x5b, 0x74, 0xec, 0x1e, 0x0f, 0x14, - 0x63, 0x42, 0x1b, 0x81, 0x17, 0xf0, 0x93, 0x19, 0xeb, 0xaf, 0x93, 0x11, 0xa6, 0xe0, 0xbe, 0x97, - 0x06, 0x78, 0x4e, 0xce, 0x3f, 0x5d, 0x1f, 0x7e, 0x57, 0xce, 0x01, 0xd5, 0xe8, 0x7c, 0xf0, 0x95, - 0xf4, 0xb3, 0x0a, 0xf7, 0x48, 0x8e, 0xb1, 0x06, 0xba, 0xcf, 0xcc, 0xa4, 0x17, 0x04, 0x55, 0xc8, - 0x6c, 0x6c, 0x84, 0x0c, 0xfd, 0x20, 0x90, 0xd2, 0x4f, 0x77, 0x30, 0xc9, 0xa4, 0x26, 0xee, 0x36, - 0x9c, 0x87, 0x00, 0x7f, 0x66, 0xe4, 0xf6, 0x21, 0x8e, 0x25, 0x09, 0x40, 0x3d, 0xa0, 0x16, 0x43, - 0xb6, 0xe7, 0x38, 0x37, 0x2d, 0xe6, 0x70, 0x88, 0x22, 0x1b, 0xc3, 0xe6, 0xff, 0x6c, 0x88, 0x4b, - 0x85, 0xcd, 0x98, 0x55, 0xa7, 0xfc, 0xc3, 0x0f, 0x03, 0x65, 0x2c, 0xeb, 0x84, 0xe1, 0x67, 0x59, - 0xaa, 0x61, 0x87, 0x66, 0x5c, 0x37, 0xe7, 0x8a, 0xc6, 0x96, 0xbd, 0x07, 0x27, 0xcf, 0x15, 0x8b, - 0x06, 0x6d, 0xde, 0x5c, 0x35, 0x3b, 0x5a, 0x98, 0xc1, 0xf4, 0x0c, 0x93, 0x00, 0xb0, 0x54, 0x69, - 0x38, 0x0a, 0x63, 0x0a, 0xf0, 0x74, 0x75, 0x3f, 0xd7, 0x99, 0x1a, 0x73, 0xa0, 0x10, 0x36, 0xb1, - 0x98, 0x41, 0x4c, 0x25, 0x26, 0xdc, 0xdf, 0x13, 0xeb, 0x9e, 0x95, 0x29, 0x04, 0x78, 0x74, 0xc1, - 0xad, 0xde, 0x42, 0x81, 0xef, 0x8a, 0xcd, 0x30, 0xc6, 0xd8, 0x05, 0x91, 0x19, 0x55, 0x44, 0xe1, - 0xfe, 0xd2, 0x83, 0x8d, 0xe2, 0x6a, 0xa8, 0x67, 0x57, 0x00, 0x8d, 0xe5, 0x5a, 0x52, 0xb0, 0x9f, - 0x42, 0x1e, 0xe0, 0x58, 0x67, 0x93, 0x48, 0x52, 0x8c, 0x27, 0x8e, 0x6f, 0x88, 0x4b, 0xcc, 0x31, - 0xa6, 0xf2, 0x80, 0x62, 0x7c, 0x13, 0xc7, 0x21, 0xfd, 0x00, 0xad, 0xcc, 0x0b, 0x63, 0xed, 0x4a, - 0xa3, 0x1d, 0xf0, 0x56, 0x04, 0x57, 0x57, 0x29, 0xbd, 0xfc, 0xa2, 0xb8, 0x5c, 0x19, 0xef, 0x10, - 0xd7, 0xd7, 0x7b, 0x8b, 0xf4, 0xea, 0x88, 0xed, 0x25, 0xe4, 0xdc, 0xf3, 0x07, 0x0c, 0xcb, 0x9c, - 0x63, 0xe3, 0x1f, 0xc1, 0x57, 0x20, 0x9d, 0xe2, 0xee, 0x63, 0x5c, 0x57, 0x8c, 0x0d, 0xac, 0xea, - 0x92, 0xad, 0xd4, 0xe7, 0x6c, 0xa5, 0x61, 0x2a, 0xc1, 0x4d, 0x82, 0xd9, 0x2a, 0x25, 0x92, 0x9a, - 0xca, 0x51, 0xf8, 0xc1, 0x01, 0x85, 0x2b, 0xc1, 0xdf, 0x15, 0x6d, 0xc3, 0x73, 0x3f, 0xf2, 0xc2, - 0x71, 0x5f, 0x05, 0xb2, 0x62, 0x47, 0xd3, 0x5a, 0xd0, 0x87, 0x39, 0xde, 0x5a, 0xb7, 0x7d, 0x03, - 0x08, 0x63, 0xe0, 0x7d, 0x7e, 0x01, 0xba, 0x11, 0xac, 0xc0, 0x95, 0x0c, 0x1a, 0x9c, 0xef, 0xb0, - 0x27, 0x52, 0xf9, 0x7e, 0x20, 0xb3, 0xd7, 0x5a, 0xa6, 0x8f, 0xa1, 0x9c, 0x44, 0x40, 0x94, 0x80, - 0xf7, 0x43, 0xd6, 0x3e, 0x95, 0x32, 0x2b, 0xd5, 0x8c, 0xab, 0xce, 0x9f, 0xd5, 0xc5, 0x87, 0x8b, - 0x76, 0x2d, 0xad, 0xf9, 0x8b, 0xcd, 0x06, 0xc6, 0x75, 0x85, 0x0e, 0x05, 0x43, 0x9a, 0x25, 0x07, - 0x36, 0x09, 0x6c, 0x6f, 0x8b, 0x2b, 0x00, 0xc0, 0xc1, 0xae, 0x28, 0x8b, 0x50, 0xbd, 0xdb, 0xb2, - 0xd6, 0x00, 0x11, 0x72, 0x08, 0xb5, 0x58, 0x0e, 0x37, 0xb4, 0x61, 0xe1, 0x2d, 0x79, 0x45, 0x0b, - 0xcc, 0x71, 0x4b, 0x9f, 0xaa, 0x0b, 0xf7, 0x14, 0x80, 0x2a, 0xda, 0x73, 0x1a, 0x26, 0x8c, 0xe1, - 0x56, 0xc9, 0xf0, 0x9a, 0x59, 0x9a, 0x4b, 0x34, 0xf9, 0xc2, 0xc1, 0xe4, 0x2f, 0x1b, 0x10, 0x88, - 0xae, 0x82, 0x0f, 0x7a, 0x70, 0x03, 0xa6, 0x89, 0x6a, 0x21, 0xbf, 0x69, 0xe1, 0x91, 0xd8, 0x91, - 0x51, 0x49, 0x1e, 0x79, 0xa9, 0x69, 0x96, 0x08, 0xca, 0xfe, 0x29, 0xcb, 0xf2, 0x75, 0x82, 0x38, - 0x1f, 0x35, 0x7a, 0x0c, 0xf5, 0xc6, 0x78, 0x8a, 0x76, 0xb5, 0x8b, 0xd5, 0x3a, 0x49, 0x64, 0x83, - 0x00, 0x27, 0x11, 0xa6, 0x25, 0xa5, 0x82, 0x74, 0xd5, 0x82, 0x5e, 0xde, 0xe0, 0xe6, 0x69, 0x64, - 0x64, 0x84, 0xf6, 0x01, 0x30, 0x95, 0x2e, 0x4b, 0x92, 0xd9, 0x70, 0xee, 0x42, 0xb8, 0xa1, 0x06, - 0xcc, 0x7e, 0x9a, 0xaa, 0x94, 0x72, 0x12, 0xfe, 0xe1, 0x66, 0xf2, 0x6d, 0x66, 0x9a, 0x12, 0x3b, - 0x6c, 0xbb, 0x06, 0x35, 0x1c, 0xda, 0x68, 0xf3, 0x4a, 0x0e, 0x41, 0x47, 0xa7, 0x4e, 0xcf, 0xf4, - 0x2c, 0x54, 0xfc, 0xa5, 0x97, 0x7e, 0x89, 0xc1, 0x70, 0x8a, 0x3c, 0xb9, 0x77, 0x54, 0x0a, 0x99, - 0xeb, 0xce, 0xe7, 0x7c, 0xcb, 0x57, 0x32, 0x89, 0x42, 0x1f, 0x2e, 0xca, 0x1b, 0x35, 0x94, 0x1f, - 0xa0, 0xd1, 0xf8, 0x1c, 0xfe, 0x34, 0x69, 0xba, 0xdd, 0xab, 0xd0, 0x75, 0x7e, 0x5c, 0x63, 0x6e, - 0xc1, 0x5e, 0x28, 0x12, 0xcc, 0xb9, 0x0d, 0x44, 0xf8, 0xcc, 0x4b, 0x47, 0xa0, 0xff, 0x72, 0x09, - 0x8d, 0x2e, 0x3f, 0x0a, 0x87, 0x99, 0xeb, 0x26, 0x2a, 0x03, 0xf6, 0x11, 0xc1, 0xf3, 0x42, 0x8c, - 0xd9, 0x0d, 0x86, 0xf6, 0x54, 0xab, 0xb1, 0xcb, 0x61, 0x23, 0xed, 0xcc, 0xc4, 0x4e, 0xc8, 0x43, - 0x0c, 0xfa, 0xb1, 0x2a, 0x9a, 0x92, 0x6d, 0x11, 0xd9, 0xbb, 0xe2, 0x16, 0x32, 0x40, 0xd5, 0xa7, - 0x8b, 0xff, 0x0b, 0xc7, 0x63, 0x19, 0xc0, 0x52, 0x19, 0x71, 0x65, 0xb0, 0xe6, 0x04, 0x56, 0x7a, - 0x09, 0x20, 0x88, 0xd7, 0x09, 0x14, 0x3d, 0x81, 0x0c, 0x4e, 0xd4, 0xf7, 0x55, 0x7e, 0x92, 0x0f, - 0xc8, 0x7a, 0x26, 0x80, 0x21, 0xe1, 0x4f, 0xd2, 0x13, 0x4b, 0x0c, 0xd2, 0x98, 0x1d, 0xb4, 0x8e, - 0x5a, 0x40, 0xf2, 0xa0, 0x23, 0x2d, 0x35, 0xaa, 0x7b, 0x96, 0xcb, 0x7b, 0xdc, 0x22, 0x00, 0x61, - 0xe9, 0x7c, 0x8c, 0x05, 0xc8, 0xfe, 0xdb, 0x53, 0x0f, 0x42, 0x0d, 0x84, 0xa7, 0x05, 0x5d, 0xc4, - 0x96, 0xf3, 0xef, 0x35, 0xd6, 0x02, 0x85, 0x5f, 0xff, 0x2c, 0x56, 0x17, 0x50, 0xb3, 0x8c, 0x60, - 0xf5, 0x92, 0xd8, 0x30, 0xcb, 0x31, 0xf5, 0xf9, 0x1c, 0xd3, 0xa8, 0xa6, 0x10, 0x16, 0x1c, 0x3a, - 0xb1, 0x97, 0xce, 0x52, 0xce, 0x2c, 0x81, 0x70, 0xce, 0x41, 0xb3, 0xd6, 0xae, 0xc9, 0xf1, 0x26, - 0xed, 0xf0, 0x58, 0x1e, 0xe7, 0x1a, 0x48, 0x71, 0xee, 0x41, 0x6b, 0xba, 0x90, 0x5e, 0x4a, 0xee, - 0x53, 0x77, 0x06, 0xe2, 0x16, 0xf7, 0x16, 0xb2, 0x23, 0x30, 0x3f, 0x49, 0x91, 0xef, 0x48, 0x69, - 0x2e, 0x9d, 0x30, 0x4e, 0x90, 0xfe, 0x8a, 0xbc, 0x27, 0xb4, 0x6e, 0x96, 0x32, 0x81, 0x51, 0x2a, - 0x0e, 0xa6, 0xed, 0x9a, 0x82, 0x19, 0x35, 0x49, 0x9a, 0x7f, 0x64, 0xa4, 0x73, 0x5c, 0x26, 0xaf, - 0x3b, 0x0f, 0x4d, 0x35, 0x99, 0xd8, 0x11, 0x63, 0xaa, 0x4e, 0x6f, 0xd1, 0xf2, 0x5e, 0xf1, 0xd7, - 0xf6, 0xb7, 0xc5, 0x46, 0x89, 0xd7, 0x39, 0xe3, 0xc5, 0x5e, 0x8e, 0x99, 0x34, 0x60, 0x20, 0x83, - 0xbb, 0xce, 0x12, 0x8e, 0xb9, 0x6f, 0x0c, 0xa9, 0x25, 0xf6, 0xa9, 0x27, 0x39, 0xbd, 0x2b, 0x2d, - 0x37, 0x3d, 0xc9, 0x9b, 0xc5, 0x1b, 0x37, 0x0a, 0x13, 0x5b, 0xb3, 0x7b, 0x37, 0x0b, 0xc3, 0x05, - 0x3e, 0x28, 0x26, 0x3a, 0xdf, 0x83, 0x22, 0x9f, 0x6e, 0x13, 0x01, 0x52, 0xe2, 0x43, 0x9f, 0xa8, - 0xb4, 0x8f, 0x67, 0xbd, 0x97, 0x80, 0x01, 0x99, 0x63, 0x97, 0x80, 0x36, 0xf0, 0x76, 0x6e, 0xdb, - 0x50, 0x5e, 0x58, 0x64, 0x5f, 0xed, 0xea, 0x4d, 0xd0, 0x1b, 0x4d, 0x53, 0xb1, 0x72, 0x15, 0xe7, - 0x3f, 0x6a, 0xdc, 0x94, 0x3a, 0xe8, 0x83, 0x47, 0x41, 0x50, 0xdd, 0x1b, 0x00, 0x10, 0x58, 0xe4, - 0xf7, 0x35, 0xdb, 0x8d, 0x2d, 0x04, 0x6e, 0x53, 0xe8, 0x42, 0x29, 0x3c, 0xb2, 0xb7, 0x25, 0x86, - 0x90, 0x46, 0x31, 0xf3, 0x01, 0x20, 0xc5, 0x8c, 0x3e, 0xc5, 0xe6, 0x0d, 0xd3, 0x72, 0xd9, 0x32, - 0x87, 0x50, 0x58, 0xd5, 0xd4, 0xc3, 0x72, 0xc3, 0xc4, 0x74, 0x7b, 0x20, 0xc4, 0x2c, 0x98, 0x46, - 0x1e, 0xd9, 0xb6, 0x9d, 0xdf, 0x66, 0xcb, 0x2d, 0x71, 0x3e, 0xcd, 0x78, 0x4b, 0x6f, 0x30, 0x4b, - 0x85, 0xd3, 0xac, 0xcc, 0x11, 0xda, 0x76, 0x8e, 0xb9, 0xc3, 0x3c, 0x14, 0xdb, 0x4c, 0xfc, 0x05, - 0x1c, 0x8e, 0xd6, 0xf2, 0x42, 0x65, 0xe1, 0x10, 0x03, 0x2c, 0xda, 0x1a, 0x24, 0x84, 0x84, 0x0a, - 0x18, 0xa6, 0x5e, 0xec, 0x68, 0xce, 0x62, 0x03, 0xf9, 0xf2, 0x54, 0xfe, 0x34, 0x1e, 0x53, 0x61, - 0x4e, 0x80, 0xce, 0x9c, 0xf3, 0x6f, 0x35, 0xdb, 0xb1, 0x37, 0x4a, 0x0d, 0x35, 0x52, 0x2e, 0x9d, - 0xf6, 0x89, 0xd8, 0x8d, 0x0b, 0xbf, 0x5d, 0x80, 0x9d, 0x91, 0xe4, 0xb7, 0x89, 0xf0, 0x07, 0x3c, - 0x74, 0x26, 0xed, 0xcb, 0x02, 0xf6, 0xe1, 0x8a, 0x8b, 0x07, 0x2a, 0x98, 0xcc, 0xaf, 0xad, 0xdb, - 0x1c, 0x4f, 0xd3, 0x80, 0xe2, 0x4d, 0xa3, 0x08, 0xe6, 0x38, 0x82, 0xaf, 0xa3, 0x7a, 0x2a, 0x93, - 0x94, 0x75, 0xf8, 0x25, 0x62, 0xdd, 0xf9, 0xf6, 0xf4, 0xb5, 0x03, 0x32, 0x3a, 0xc1, 0xa5, 0xa3, - 0xd0, 0x3f, 0x93, 0xc1, 0xeb, 0x64, 0x99, 0x74, 0x9c, 0xdf, 0xe4, 0x2d, 0x9c, 0x8f, 0x8f, 0x10, - 0x95, 0x06, 0xa1, 0xcf, 0xe5, 0xdf, 0x22, 0x33, 0x2e, 0xd7, 0x73, 0x75, 0x1b, 0xf3, 0xbc, 0x31, - 0x35, 0x1f, 0xd9, 0x7c, 0x7f, 0x5f, 0xdc, 0x61, 0x2e, 0xe6, 0xab, 0xcf, 0xa9, 0x29, 0xdc, 0x16, - 0x57, 0x4d, 0x69, 0x59, 0x3d, 0x62, 0xf6, 0xea, 0x10, 0xe7, 0x63, 0x17, 0x17, 0x15, 0xc0, 0xe1, - 0xb4, 0x8b, 0xd8, 0xb0, 0xdc, 0x70, 0xcf, 0xab, 0x50, 0x5d, 0x7e, 0x61, 0x65, 0xf0, 0x4a, 0x8e, - 0xd5, 0xb9, 0x2c, 0x16, 0x7d, 0x73, 0xd1, 0x08, 0xcc, 0xb9, 0x54, 0xb2, 0x69, 0x1f, 0xbb, 0x5b, - 0xb3, 0xab, 0x39, 0xfd, 0x32, 0xb1, 0x62, 0x19, 0xb6, 0x28, 0x2f, 0x4f, 0x2b, 0x80, 0xa2, 0xa1, - 0x39, 0xdf, 0xe5, 0x22, 0xde, 0x12, 0xe9, 0x93, 0xa9, 0x19, 0xc5, 0x4f, 0xcb, 0x82, 0xe3, 0x70, - 0x8c, 0x45, 0x7c, 0x95, 0xaa, 0xf3, 0x09, 0x07, 0x2a, 0xdc, 0x0c, 0x31, 0xc2, 0xdc, 0xe6, 0x18, - 0xf9, 0xd4, 0xf3, 0x8b, 0xf7, 0xc4, 0x2f, 0x18, 0xc9, 0x73, 0x28, 0xc5, 0xce, 0x2b, 0xfe, 0xf9, - 0x48, 0xe5, 0xa3, 0xd3, 0xac, 0xea, 0x2d, 0x15, 0xaf, 0x60, 0x2c, 0xfd, 0x89, 0x75, 0xe0, 0xd2, - 0x63, 0x55, 0x1f, 0xa3, 0x71, 0x54, 0x78, 0x96, 0xe2, 0xf3, 0xbe, 0x23, 0xee, 0x2e, 0x5d, 0xbc, - 0x04, 0xe7, 0x6e, 0x3a, 0x9f, 0x32, 0x58, 0xa8, 0x6c, 0x7a, 0x82, 0x15, 0x4c, 0xf8, 0x03, 0x39, - 0x77, 0xc6, 0x81, 0xd8, 0x7d, 0xc7, 0xf2, 0x65, 0xa7, 0x4c, 0x8d, 0x25, 0x0c, 0xd0, 0x7c, 0x1a, - 0x40, 0xe8, 0xd0, 0x9e, 0xfb, 0xc8, 0x8b, 0x63, 0x19, 0xbc, 0x51, 0x69, 0xf0, 0x2c, 0xd4, 0xd3, - 0x46, 0x11, 0x40, 0x64, 0xec, 0x61, 0x53, 0x57, 0xa8, 0xf4, 0x5a, 0x41, 0xb9, 0xf3, 0x42, 0x61, - 0xa5, 0x6d, 0x83, 0xff, 0xd0, 0xc6, 0xe7, 0x03, 0xc0, 0x5b, 0x32, 0xe0, 0xc2, 0x04, 0xf4, 0x8f, - 0xf0, 0x6b, 0xbe, 0x5b, 0x02, 0x94, 0x2f, 0x3c, 0xed, 0x82, 0xe6, 0x02, 0xa8, 0x19, 0x01, 0xa1, - 0x6b, 0x93, 0xfc, 0xd6, 0xd0, 0x9f, 0x53, 0xec, 0x6d, 0xd2, 0xdb, 0xc5, 0xcc, 0x13, 0x0c, 0x60, - 0xb3, 0x2f, 0x55, 0x10, 0x87, 0x54, 0x84, 0x89, 0x8a, 0x00, 0x21, 0x60, 0x35, 0x9f, 0x7f, 0x12, - 0x3a, 0x7a, 0xbf, 0xea, 0xff, 0x33, 0xee, 0xb9, 0xd8, 0x88, 0xf6, 0xdc, 0x4b, 0xcf, 0x64, 0xc6, - 0xe5, 0x08, 0x5f, 0x1f, 0x42, 0x2e, 0x84, 0xea, 0x74, 0xf6, 0xae, 0xca, 0xca, 0xfa, 0xe3, 0x9a, - 0x95, 0x5a, 0x75, 0xe3, 0x3e, 0xd6, 0x25, 0xcb, 0xcc, 0x68, 0x61, 0xa3, 0x9a, 0x61, 0x26, 0x01, - 0x7a, 0x19, 0x45, 0x24, 0x69, 0x88, 0x60, 0xda, 0xf8, 0x32, 0xf8, 0x22, 0x97, 0x18, 0xf3, 0x4f, - 0xbc, 0xec, 0xd8, 0x07, 0xfc, 0xb2, 0x32, 0xcf, 0x49, 0xe7, 0x53, 0xb1, 0x0a, 0x03, 0x69, 0x28, - 0x2d, 0x54, 0xf9, 0xb0, 0xf7, 0x0e, 0x9e, 0x9d, 0xc7, 0xfc, 0x72, 0x43, 0x8d, 0x95, 0x13, 0xa5, - 0xa2, 0x13, 0x45, 0x72, 0x5d, 0xdc, 0x75, 0x5a, 0x2a, 0x51, 0x13, 0x67, 0x0a, 0x54, 0x1e, 0x79, - 0x06, 0xb2, 0x2f, 0xa6, 0x04, 0x97, 0xc7, 0x87, 0xf3, 0x45, 0xb9, 0x08, 0xee, 0x76, 0x8d, 0x01, - 0x34, 0xf6, 0xb9, 0xfb, 0x6a, 0x0c, 0x36, 0x6d, 0x1a, 0x70, 0xd5, 0xc3, 0xdf, 0x19, 0x6b, 0x9a, - 0x8e, 0x62, 0x8f, 0x7c, 0x92, 0x47, 0x43, 0x88, 0x9c, 0x8f, 0x27, 0x90, 0xdc, 0x42, 0xbf, 0x4a, - 0x76, 0x31, 0x7f, 0xbf, 0x82, 0x4f, 0xec, 0x08, 0xad, 0x09, 0x46, 0xb8, 0xbe, 0x5d, 0xce, 0xfe, - 0x43, 0x8d, 0x81, 0x79, 0x16, 0x9d, 0x47, 0x9c, 0x2a, 0x0d, 0x2c, 0xdc, 0x1f, 0x0e, 0x81, 0xd9, - 0x2f, 0x65, 0x9a, 0x41, 0x9c, 0x89, 0x5e, 0x0e, 0x87, 0x10, 0xb3, 0xe6, 0x23, 0x25, 0x82, 0x64, - 0x9a, 0x22, 0xa6, 0xeb, 0x40, 0x63, 0xc7, 0xd0, 0x78, 0xea, 0x65, 0x4c, 0x02, 0xaa, 0x9f, 0xa7, - 0xd2, 0x0b, 0x5e, 0x12, 0x96, 0x5e, 0x08, 0x23, 0x11, 0xce, 0x9c, 0xc2, 0x12, 0xf6, 0x24, 0xe7, - 0x84, 0xab, 0xed, 0xc7, 0x32, 0xc2, 0x56, 0x2f, 0xfa, 0xa5, 0x0d, 0x0d, 0x07, 0x38, 0x80, 0xf6, - 0x9d, 0x9a, 0x01, 0x97, 0x4a, 0xfb, 0x9a, 0xc5, 0x3b, 0xb6, 0x3d, 0xbc, 0xa0, 0x0c, 0x71, 0x22, - 0x48, 0x65, 0x73, 0x0f, 0x74, 0x00, 0x14, 0xf1, 0x17, 0xbf, 0xef, 0x69, 0x7a, 0xd1, 0x29, 0x3c, - 0x36, 0x19, 0x73, 0x5e, 0xf4, 0x38, 0x55, 0x5f, 0xfa, 0x38, 0xc5, 0x16, 0xfe, 0xbf, 0x75, 0x71, - 0xbf, 0x0f, 0x71, 0xe9, 0x0c, 0x0a, 0xf2, 0xc4, 0x3d, 0xa2, 0xea, 0x99, 0x8b, 0xe4, 0xc7, 0x85, - 0xc2, 0xdc, 0xb5, 0x2e, 0x0b, 0x35, 0xa7, 0x97, 0x24, 0xd3, 0x28, 0xf5, 0x3b, 0x62, 0xdd, 0x7e, - 0xbe, 0x60, 0x55, 0x76, 0xd8, 0x7b, 0x7f, 0x72, 0xbd, 0xea, 0xc4, 0x33, 0x43, 0xec, 0x11, 0xd6, - 0x89, 0xdb, 0xfb, 0x62, 0xeb, 0x18, 0xb8, 0x8d, 0xaa, 0xfb, 0x31, 0x07, 0x23, 0x16, 0x44, 0xfd, - 0x4c, 0x59, 0xb1, 0xd0, 0xaa, 0x08, 0x4b, 0x49, 0xa0, 0xdb, 0x7f, 0x52, 0x13, 0x3b, 0xef, 0x3c, - 0xa8, 0xf4, 0x15, 0x06, 0xa3, 0xa7, 0x37, 0xfc, 0x66, 0x33, 0x6d, 0x4c, 0xf0, 0xdd, 0xf6, 0x7e, - 0x92, 0xbb, 0x2d, 0x64, 0xdd, 0x79, 0x02, 0xce, 0x32, 0xa5, 0x71, 0x00, 0x10, 0x5e, 0xc5, 0xec, - 0x53, 0x2a, 0x5d, 0x2a, 0xe5, 0xf2, 0x75, 0xd9, 0x7b, 0x1f, 0x0a, 0xe7, 0x5d, 0x74, 0x4c, 0x86, - 0x32, 0x80, 0xdb, 0x4e, 0x50, 0xa8, 0x5a, 0xc1, 0x57, 0xae, 0x8f, 0x67, 0x9b, 0x6d, 0x75, 0xe5, - 0x4d, 0x10, 0x36, 0xbd, 0xca, 0x23, 0xf9, 0x93, 0x30, 0xd2, 0xf1, 0xc4, 0x2d, 0x28, 0x31, 0x94, - 0x8f, 0xc5, 0x79, 0xe0, 0x5e, 0x58, 0xaa, 0x10, 0x0a, 0x24, 0xa7, 0x94, 0x4b, 0x0f, 0x7e, 0xbd, - 0xf7, 0x5e, 0xa7, 0xf5, 0xec, 0xa2, 0xca, 0x02, 0x50, 0x46, 0x1b, 0xa1, 0x52, 0x3c, 0xf3, 0x17, - 0xfb, 0x19, 0xcc, 0xaf, 0xbd, 0x27, 0xe5, 0x23, 0xde, 0x5e, 0x99, 0xdf, 0x0e, 0xc5, 0xcd, 0x65, - 0x67, 0x82, 0x39, 0x95, 0xee, 0x52, 0x8a, 0xa9, 0xf4, 0x84, 0x9c, 0x4b, 0xcc, 0xab, 0xf8, 0x9e, - 0x68, 0x3f, 0xde, 0xa9, 0xe3, 0xae, 0x14, 0x76, 0x97, 0x8c, 0x90, 0xf0, 0xfd, 0xf6, 0x40, 0xdc, - 0x58, 0xcc, 0xc4, 0x42, 0xc8, 0xfb, 0x53, 0x9d, 0xe1, 0xdc, 0x13, 0xdf, 0xfa, 0x26, 0x71, 0xb0, - 0x5d, 0xdc, 0xff, 0x71, 0x43, 0x88, 0x7d, 0x44, 0x25, 0x5a, 0x42, 0x00, 0x83, 0xe3, 0xb6, 0xce, - 0xdc, 0x7d, 0x46, 0x3c, 0xf4, 0x29, 0xcd, 0x73, 0xae, 0x81, 0xda, 0xff, 0x74, 0x1b, 0xa2, 0x55, - 0xd7, 0xce, 0x55, 0x5b, 0x4b, 0xed, 0x7f, 0xbe, 0x5d, 0xdc, 0xca, 0xa3, 0x8c, 0xea, 0x83, 0xf6, - 0xbf, 0x94, 0xe6, 0x4a, 0x9f, 0x80, 0xb4, 0xff, 0x7c, 0xb7, 0xf3, 0x91, 0xb8, 0x55, 0x9a, 0x2b, - 0x7e, 0xbc, 0xd1, 0xfe, 0x8b, 0xdd, 0xce, 0x1d, 0xf1, 0x81, 0x9d, 0x5f, 0xf0, 0x7d, 0x46, 0xfb, - 0x2f, 0x77, 0x8b, 0xd4, 0x4b, 0x5f, 0x52, 0xb4, 0xff, 0x6a, 0x17, 0x72, 0x55, 0xc7, 0xce, 0xcd, - 0x3e, 0x9f, 0x68, 0xff, 0xf5, 0x6e, 0xe7, 0x43, 0x71, 0x73, 0x7a, 0xd3, 0xf2, 0xb7, 0x12, 0xed, - 0xbf, 0xd9, 0xed, 0x38, 0x62, 0x67, 0x7a, 0x19, 0x4a, 0xe3, 0x70, 0xa5, 0x18, 0x32, 0xc3, 0x89, - 0xe2, 0xc5, 0xed, 0xbf, 0xdd, 0x85, 0x5a, 0xe9, 0x86, 0x5d, 0x33, 0x8b, 0xc8, 0x87, 0xf1, 0x50, - 0xb5, 0xff, 0x6e, 0x17, 0x74, 0xb9, 0x69, 0x27, 0xa9, 0xef, 0xd7, 0xfe, 0xfb, 0xdd, 0xce, 0xc7, - 0xe2, 0x4e, 0x51, 0x80, 0xde, 0xc4, 0x9d, 0xeb, 0x56, 0xb5, 0xff, 0x61, 0x17, 0xb0, 0xc8, 0xf6, - 0x94, 0xe5, 0xb9, 0x0f, 0x39, 0xda, 0xff, 0xb8, 0x7b, 0xff, 0xfb, 0xe2, 0xa6, 0x51, 0xd9, 0x11, - 0x7e, 0xe6, 0xf6, 0x92, 0x72, 0xf4, 0x09, 0xd4, 0x0d, 0xda, 0x08, 0xb3, 0x30, 0x5c, 0x10, 0x59, - 0xfb, 0xbf, 0x57, 0xe7, 0xe7, 0x0b, 0xdf, 0x60, 0xb5, 0xff, 0x67, 0xf5, 0xfe, 0x89, 0xb8, 0x52, - 0xf9, 0x90, 0xa7, 0x73, 0x57, 0xbc, 0xfb, 0xdb, 0x9e, 0x76, 0x0d, 0xa8, 0x6e, 0x57, 0x97, 0xbc, - 0x78, 0xe9, 0x1e, 0xef, 0x1f, 0x1f, 0x1f, 0xbe, 0x7c, 0xd1, 0xae, 0x3f, 0x6a, 0x3d, 0xad, 0xfd, - 0xb0, 0xf6, 0x73, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x08, 0x44, 0xbb, 0xbb, 0x27, 0x00, - 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/econ.pb.go b/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/econ.pb.go deleted file mode 100644 index 1d2f3900..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/econ.pb.go +++ /dev/null @@ -1,1815 +0,0 @@ -// Code generated by protoc-gen-go. -// source: econ_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type EGCItemMsg int32 - -const ( - EGCItemMsg_k_EMsgGCBase EGCItemMsg = 1000 - EGCItemMsg_k_EMsgGCSetSingleItemPosition EGCItemMsg = 1001 - EGCItemMsg_k_EMsgGCCraft EGCItemMsg = 1002 - EGCItemMsg_k_EMsgGCCraftResponse EGCItemMsg = 1003 - EGCItemMsg_k_EMsgGCDelete EGCItemMsg = 1004 - EGCItemMsg_k_EMsgGCVerifyCacheSubscription EGCItemMsg = 1005 - EGCItemMsg_k_EMsgGCNameItem EGCItemMsg = 1006 - EGCItemMsg_k_EMsgGCUnlockCrate EGCItemMsg = 1007 - EGCItemMsg_k_EMsgGCUnlockCrateResponse EGCItemMsg = 1008 - EGCItemMsg_k_EMsgGCPaintItem EGCItemMsg = 1009 - EGCItemMsg_k_EMsgGCPaintItemResponse EGCItemMsg = 1010 - EGCItemMsg_k_EMsgGCGoldenWrenchBroadcast EGCItemMsg = 1011 - EGCItemMsg_k_EMsgGCMOTDRequest EGCItemMsg = 1012 - EGCItemMsg_k_EMsgGCMOTDRequestResponse EGCItemMsg = 1013 - EGCItemMsg_k_EMsgGCNameBaseItem EGCItemMsg = 1019 - EGCItemMsg_k_EMsgGCNameBaseItemResponse EGCItemMsg = 1020 - EGCItemMsg_k_EMsgGCRemoveSocketItem_DEPRECATED EGCItemMsg = 1021 - EGCItemMsg_k_EMsgGCRemoveSocketItemResponse_DEPRECATED EGCItemMsg = 1022 - EGCItemMsg_k_EMsgGCCustomizeItemTexture EGCItemMsg = 1023 - EGCItemMsg_k_EMsgGCCustomizeItemTextureResponse EGCItemMsg = 1024 - EGCItemMsg_k_EMsgGCUseItemRequest EGCItemMsg = 1025 - EGCItemMsg_k_EMsgGCUseItemResponse EGCItemMsg = 1026 - EGCItemMsg_k_EMsgGCRespawnPostLoadoutChange EGCItemMsg = 1029 - EGCItemMsg_k_EMsgGCRemoveItemName EGCItemMsg = 1030 - EGCItemMsg_k_EMsgGCRemoveItemPaint EGCItemMsg = 1031 - EGCItemMsg_k_EMsgGCGiftWrapItem EGCItemMsg = 1032 - EGCItemMsg_k_EMsgGCGiftWrapItemResponse EGCItemMsg = 1033 - EGCItemMsg_k_EMsgGCDeliverGift EGCItemMsg = 1034 - EGCItemMsg_k_EMsgGCDeliverGiftResponseReceiver EGCItemMsg = 1036 - EGCItemMsg_k_EMsgGCUnwrapGiftRequest EGCItemMsg = 1037 - EGCItemMsg_k_EMsgGCUnwrapGiftResponse EGCItemMsg = 1038 - EGCItemMsg_k_EMsgGCSetItemStyle EGCItemMsg = 1039 - EGCItemMsg_k_EMsgGCUsedClaimCodeItem EGCItemMsg = 1040 - EGCItemMsg_k_EMsgGCSortItems EGCItemMsg = 1041 - EGCItemMsg_k_EMsgGC_RevolvingLootList_DEPRECATED EGCItemMsg = 1042 - EGCItemMsg_k_EMsgGCLookupAccount EGCItemMsg = 1043 - EGCItemMsg_k_EMsgGCLookupAccountResponse EGCItemMsg = 1044 - EGCItemMsg_k_EMsgGCLookupAccountName EGCItemMsg = 1045 - EGCItemMsg_k_EMsgGCLookupAccountNameResponse EGCItemMsg = 1046 - EGCItemMsg_k_EMsgGCUpdateItemSchema EGCItemMsg = 1049 - EGCItemMsg_k_EMsgGCRequestInventoryRefresh EGCItemMsg = 1050 - EGCItemMsg_k_EMsgGCRemoveCustomTexture EGCItemMsg = 1051 - EGCItemMsg_k_EMsgGCRemoveCustomTextureResponse EGCItemMsg = 1052 - EGCItemMsg_k_EMsgGCRemoveMakersMark EGCItemMsg = 1053 - EGCItemMsg_k_EMsgGCRemoveMakersMarkResponse EGCItemMsg = 1054 - EGCItemMsg_k_EMsgGCRemoveUniqueCraftIndex EGCItemMsg = 1055 - EGCItemMsg_k_EMsgGCRemoveUniqueCraftIndexResponse EGCItemMsg = 1056 - EGCItemMsg_k_EMsgGCSaxxyBroadcast EGCItemMsg = 1057 - EGCItemMsg_k_EMsgGCBackpackSortFinished EGCItemMsg = 1058 - EGCItemMsg_k_EMsgGCAdjustItemEquippedState EGCItemMsg = 1059 - EGCItemMsg_k_EMsgGCCollectItem EGCItemMsg = 1061 - EGCItemMsg_k_EMsgGCItemAcknowledged EGCItemMsg = 1062 - EGCItemMsg_k_EMsgGCPresets_SelectPresetForClass EGCItemMsg = 1063 - EGCItemMsg_k_EMsgGCPresets_SetItemPosition EGCItemMsg = 1064 - EGCItemMsg_k_EMsgGC_ReportAbuse EGCItemMsg = 1065 - EGCItemMsg_k_EMsgGC_ReportAbuseResponse EGCItemMsg = 1066 - EGCItemMsg_k_EMsgGCPresets_SelectPresetForClassReply EGCItemMsg = 1067 - EGCItemMsg_k_EMsgGCNameItemNotification EGCItemMsg = 1068 - EGCItemMsg_k_EMsgGCClientDisplayNotification EGCItemMsg = 1069 - EGCItemMsg_k_EMsgGCApplyStrangePart EGCItemMsg = 1070 - EGCItemMsg_k_EMsgGC_IncrementKillCountAttribute EGCItemMsg = 1071 - EGCItemMsg_k_EMsgGC_IncrementKillCountResponse EGCItemMsg = 1072 - EGCItemMsg_k_EMsgGCRemoveStrangePart EGCItemMsg = 1073 - EGCItemMsg_k_EMsgGCResetStrangeScores EGCItemMsg = 1074 - EGCItemMsg_k_EMsgGCGiftedItems EGCItemMsg = 1075 - EGCItemMsg_k_EMsgGCApplyUpgradeCard EGCItemMsg = 1077 - EGCItemMsg_k_EMsgGCRemoveUpgradeCard EGCItemMsg = 1078 - EGCItemMsg_k_EMsgGCApplyStrangeRestriction EGCItemMsg = 1079 - EGCItemMsg_k_EMsgGCClientRequestMarketData EGCItemMsg = 1080 - EGCItemMsg_k_EMsgGCClientRequestMarketDataResponse EGCItemMsg = 1081 - EGCItemMsg_k_EMsgGCApplyXifier EGCItemMsg = 1082 - EGCItemMsg_k_EMsgGCApplyXifierResponse EGCItemMsg = 1083 - EGCItemMsg_k_EMsgGC_TrackUniquePlayerPairEvent EGCItemMsg = 1084 - EGCItemMsg_k_EMsgGCFulfillDynamicRecipeComponent EGCItemMsg = 1085 - EGCItemMsg_k_EMsgGCFulfillDynamicRecipeComponentResponse EGCItemMsg = 1086 - EGCItemMsg_k_EMsgGCSetItemEffectVerticalOffset EGCItemMsg = 1087 - EGCItemMsg_k_EMsgGCSetHatEffectUseHeadOrigin EGCItemMsg = 1088 - EGCItemMsg_k_EMsgGCItemEaterRecharger EGCItemMsg = 1089 - EGCItemMsg_k_EMsgGCItemEaterRechargerResponse EGCItemMsg = 1090 - EGCItemMsg_k_EMsgGCApplyBaseItemXifier EGCItemMsg = 1091 - EGCItemMsg_k_EMsgGCApplyClassTransmogrifier EGCItemMsg = 1092 - EGCItemMsg_k_EMsgGCApplyHalloweenSpellbookPage EGCItemMsg = 1093 - EGCItemMsg_k_EMsgGCRemoveKillStreak EGCItemMsg = 1094 - EGCItemMsg_k_EMsgGCRemoveKillStreakResponse EGCItemMsg = 1095 - EGCItemMsg_k_EMsgGCTFSpecificItemBroadcast EGCItemMsg = 1096 - EGCItemMsg_k_EMsgGC_IncrementKillCountAttribute_Multiple EGCItemMsg = 1097 - EGCItemMsg_k_EMsgGCDeliverGiftResponseGiver EGCItemMsg = 1098 - EGCItemMsg_k_EMsgGCSetItemPositions EGCItemMsg = 1100 - EGCItemMsg_k_EMsgGCLookupMultipleAccountNames EGCItemMsg = 1101 - EGCItemMsg_k_EMsgGCLookupMultipleAccountNamesResponse EGCItemMsg = 1102 - EGCItemMsg_k_EMsgGCTradingBase EGCItemMsg = 1500 - EGCItemMsg_k_EMsgGCTrading_InitiateTradeRequest EGCItemMsg = 1501 - EGCItemMsg_k_EMsgGCTrading_InitiateTradeResponse EGCItemMsg = 1502 - EGCItemMsg_k_EMsgGCTrading_StartSession EGCItemMsg = 1503 - EGCItemMsg_k_EMsgGCTrading_SessionClosed EGCItemMsg = 1509 - EGCItemMsg_k_EMsgGCTrading_CancelSession EGCItemMsg = 1510 - EGCItemMsg_k_EMsgGCTrading_InitiateTradeRequestResponse EGCItemMsg = 1514 - EGCItemMsg_k_EMsgGCServerBrowser_FavoriteServer EGCItemMsg = 1601 - EGCItemMsg_k_EMsgGCServerBrowser_BlacklistServer EGCItemMsg = 1602 - EGCItemMsg_k_EMsgGCServerRentalsBase EGCItemMsg = 1700 - EGCItemMsg_k_EMsgGCItemPreviewCheckStatus EGCItemMsg = 1701 - EGCItemMsg_k_EMsgGCItemPreviewStatusResponse EGCItemMsg = 1702 - EGCItemMsg_k_EMsgGCItemPreviewRequest EGCItemMsg = 1703 - EGCItemMsg_k_EMsgGCItemPreviewRequestResponse EGCItemMsg = 1704 - EGCItemMsg_k_EMsgGCItemPreviewExpire EGCItemMsg = 1705 - EGCItemMsg_k_EMsgGCItemPreviewExpireNotification EGCItemMsg = 1706 - EGCItemMsg_k_EMsgGCItemPreviewItemBoughtNotification EGCItemMsg = 1708 - EGCItemMsg_k_EMsgGCDev_NewItemRequest EGCItemMsg = 2001 - EGCItemMsg_k_EMsgGCDev_NewItemRequestResponse EGCItemMsg = 2002 - EGCItemMsg_k_EMsgGCDev_DebugRollLootRequest EGCItemMsg = 2003 - EGCItemMsg_k_EMsgGCStoreGetUserData EGCItemMsg = 2500 - EGCItemMsg_k_EMsgGCStoreGetUserDataResponse EGCItemMsg = 2501 - EGCItemMsg_k_EMsgGCStorePurchaseInit_DEPRECATED EGCItemMsg = 2502 - EGCItemMsg_k_EMsgGCStorePurchaseInitResponse_DEPRECATED EGCItemMsg = 2503 - EGCItemMsg_k_EMsgGCStorePurchaseFinalize EGCItemMsg = 2512 - EGCItemMsg_k_EMsgGCStorePurchaseFinalizeResponse EGCItemMsg = 2513 - EGCItemMsg_k_EMsgGCStorePurchaseCancel EGCItemMsg = 2514 - EGCItemMsg_k_EMsgGCStorePurchaseCancelResponse EGCItemMsg = 2515 - EGCItemMsg_k_EMsgGCStorePurchaseQueryTxn EGCItemMsg = 2508 - EGCItemMsg_k_EMsgGCStorePurchaseQueryTxnResponse EGCItemMsg = 2509 - EGCItemMsg_k_EMsgGCStorePurchaseInit EGCItemMsg = 2510 - EGCItemMsg_k_EMsgGCStorePurchaseInitResponse EGCItemMsg = 2511 - EGCItemMsg_k_EMsgGCToGCDirtySDOCache EGCItemMsg = 2516 - EGCItemMsg_k_EMsgGCToGCDirtyMultipleSDOCache EGCItemMsg = 2517 - EGCItemMsg_k_EMsgGCToGCUpdateSQLKeyValue EGCItemMsg = 2518 - EGCItemMsg_k_EMsgGCToGCBroadcastConsoleCommand EGCItemMsg = 2521 - EGCItemMsg_k_EMsgGCServerVersionUpdated EGCItemMsg = 2522 - EGCItemMsg_k_EMsgGCApplyAutograph EGCItemMsg = 2523 - EGCItemMsg_k_EMsgGCToGCWebAPIAccountChanged EGCItemMsg = 2524 - EGCItemMsg_k_EMsgGCRequestAnnouncements EGCItemMsg = 2525 - EGCItemMsg_k_EMsgGCRequestAnnouncementsResponse EGCItemMsg = 2526 - EGCItemMsg_k_EMsgGCRequestPassportItemGrant EGCItemMsg = 2527 - EGCItemMsg_k_EMsgGCClientVersionUpdated EGCItemMsg = 2528 - EGCItemMsg_k_EMsgGCItemPurgatory_FinalizePurchase EGCItemMsg = 2531 - EGCItemMsg_k_EMsgGCItemPurgatory_FinalizePurchaseResponse EGCItemMsg = 2532 - EGCItemMsg_k_EMsgGCItemPurgatory_RefundPurchase EGCItemMsg = 2533 - EGCItemMsg_k_EMsgGCItemPurgatory_RefundPurchaseResponse EGCItemMsg = 2534 - EGCItemMsg_k_EMsgGCToGCPlayerStrangeCountAdjustments EGCItemMsg = 2535 - EGCItemMsg_k_EMsgGCRequestStoreSalesData EGCItemMsg = 2536 - EGCItemMsg_k_EMsgGCRequestStoreSalesDataResponse EGCItemMsg = 2537 - EGCItemMsg_k_EMsgGCRequestStoreSalesDataUpToDateResponse EGCItemMsg = 2538 - EGCItemMsg_k_EMsgGCToGCPingRequest EGCItemMsg = 2539 - EGCItemMsg_k_EMsgGCToGCPingResponse EGCItemMsg = 2540 - EGCItemMsg_k_EMsgGCToGCGetUserSessionServer EGCItemMsg = 2541 - EGCItemMsg_k_EMsgGCToGCGetUserSessionServerResponse EGCItemMsg = 2542 - EGCItemMsg_k_EMsgGCToGCGetUserServerMembers EGCItemMsg = 2543 - EGCItemMsg_k_EMsgGCToGCGetUserServerMembersResponse EGCItemMsg = 2544 - EGCItemMsg_k_EMsgGCToGCGrantSelfMadeItemToAccount EGCItemMsg = 2555 - EGCItemMsg_k_EMsgGCToGCThankedByNewUser EGCItemMsg = 2556 - EGCItemMsg_k_EMsgGCShuffleCrateContents EGCItemMsg = 2557 - EGCItemMsg_k_EMsgGCQuestObjective_Progress EGCItemMsg = 2558 - EGCItemMsg_k_EMsgGCQuestCompleted EGCItemMsg = 2559 - EGCItemMsg_k_EMsgGCApplyDuckToken EGCItemMsg = 2560 - EGCItemMsg_k_EMsgGCQuestComplete_Request EGCItemMsg = 2561 - EGCItemMsg_k_EMsgGCQuestObjective_PointsChange EGCItemMsg = 2562 - EGCItemMsg_k_EMsgGCQuestObjective_PointsChangeResponse EGCItemMsg = 2563 - EGCItemMsg_k_EMsgGCQuestObjective_RequestLoanerItems EGCItemMsg = 2564 - EGCItemMsg_k_EMsgGCQuestObjective_RequestLoanerResponse EGCItemMsg = 2565 - EGCItemMsg_k_EMsgGCApplyStrangeCountTransfer EGCItemMsg = 2566 - EGCItemMsg_k_EMsgGCCraftCollectionUpgrade EGCItemMsg = 2567 - EGCItemMsg_k_EMsgGCCraftHalloweenOffering EGCItemMsg = 2568 - EGCItemMsg_k_EMsgGCQuestDiscard_Request EGCItemMsg = 2569 - EGCItemMsg_k_EMsgGCRemoveGiftedBy EGCItemMsg = 2570 - EGCItemMsg_k_EMsgGCRemoveGiftedByResponse EGCItemMsg = 2571 -) - -var EGCItemMsg_name = map[int32]string{ - 1000: "k_EMsgGCBase", - 1001: "k_EMsgGCSetSingleItemPosition", - 1002: "k_EMsgGCCraft", - 1003: "k_EMsgGCCraftResponse", - 1004: "k_EMsgGCDelete", - 1005: "k_EMsgGCVerifyCacheSubscription", - 1006: "k_EMsgGCNameItem", - 1007: "k_EMsgGCUnlockCrate", - 1008: "k_EMsgGCUnlockCrateResponse", - 1009: "k_EMsgGCPaintItem", - 1010: "k_EMsgGCPaintItemResponse", - 1011: "k_EMsgGCGoldenWrenchBroadcast", - 1012: "k_EMsgGCMOTDRequest", - 1013: "k_EMsgGCMOTDRequestResponse", - 1019: "k_EMsgGCNameBaseItem", - 1020: "k_EMsgGCNameBaseItemResponse", - 1021: "k_EMsgGCRemoveSocketItem_DEPRECATED", - 1022: "k_EMsgGCRemoveSocketItemResponse_DEPRECATED", - 1023: "k_EMsgGCCustomizeItemTexture", - 1024: "k_EMsgGCCustomizeItemTextureResponse", - 1025: "k_EMsgGCUseItemRequest", - 1026: "k_EMsgGCUseItemResponse", - 1029: "k_EMsgGCRespawnPostLoadoutChange", - 1030: "k_EMsgGCRemoveItemName", - 1031: "k_EMsgGCRemoveItemPaint", - 1032: "k_EMsgGCGiftWrapItem", - 1033: "k_EMsgGCGiftWrapItemResponse", - 1034: "k_EMsgGCDeliverGift", - 1036: "k_EMsgGCDeliverGiftResponseReceiver", - 1037: "k_EMsgGCUnwrapGiftRequest", - 1038: "k_EMsgGCUnwrapGiftResponse", - 1039: "k_EMsgGCSetItemStyle", - 1040: "k_EMsgGCUsedClaimCodeItem", - 1041: "k_EMsgGCSortItems", - 1042: "k_EMsgGC_RevolvingLootList_DEPRECATED", - 1043: "k_EMsgGCLookupAccount", - 1044: "k_EMsgGCLookupAccountResponse", - 1045: "k_EMsgGCLookupAccountName", - 1046: "k_EMsgGCLookupAccountNameResponse", - 1049: "k_EMsgGCUpdateItemSchema", - 1050: "k_EMsgGCRequestInventoryRefresh", - 1051: "k_EMsgGCRemoveCustomTexture", - 1052: "k_EMsgGCRemoveCustomTextureResponse", - 1053: "k_EMsgGCRemoveMakersMark", - 1054: "k_EMsgGCRemoveMakersMarkResponse", - 1055: "k_EMsgGCRemoveUniqueCraftIndex", - 1056: "k_EMsgGCRemoveUniqueCraftIndexResponse", - 1057: "k_EMsgGCSaxxyBroadcast", - 1058: "k_EMsgGCBackpackSortFinished", - 1059: "k_EMsgGCAdjustItemEquippedState", - 1061: "k_EMsgGCCollectItem", - 1062: "k_EMsgGCItemAcknowledged", - 1063: "k_EMsgGCPresets_SelectPresetForClass", - 1064: "k_EMsgGCPresets_SetItemPosition", - 1065: "k_EMsgGC_ReportAbuse", - 1066: "k_EMsgGC_ReportAbuseResponse", - 1067: "k_EMsgGCPresets_SelectPresetForClassReply", - 1068: "k_EMsgGCNameItemNotification", - 1069: "k_EMsgGCClientDisplayNotification", - 1070: "k_EMsgGCApplyStrangePart", - 1071: "k_EMsgGC_IncrementKillCountAttribute", - 1072: "k_EMsgGC_IncrementKillCountResponse", - 1073: "k_EMsgGCRemoveStrangePart", - 1074: "k_EMsgGCResetStrangeScores", - 1075: "k_EMsgGCGiftedItems", - 1077: "k_EMsgGCApplyUpgradeCard", - 1078: "k_EMsgGCRemoveUpgradeCard", - 1079: "k_EMsgGCApplyStrangeRestriction", - 1080: "k_EMsgGCClientRequestMarketData", - 1081: "k_EMsgGCClientRequestMarketDataResponse", - 1082: "k_EMsgGCApplyXifier", - 1083: "k_EMsgGCApplyXifierResponse", - 1084: "k_EMsgGC_TrackUniquePlayerPairEvent", - 1085: "k_EMsgGCFulfillDynamicRecipeComponent", - 1086: "k_EMsgGCFulfillDynamicRecipeComponentResponse", - 1087: "k_EMsgGCSetItemEffectVerticalOffset", - 1088: "k_EMsgGCSetHatEffectUseHeadOrigin", - 1089: "k_EMsgGCItemEaterRecharger", - 1090: "k_EMsgGCItemEaterRechargerResponse", - 1091: "k_EMsgGCApplyBaseItemXifier", - 1092: "k_EMsgGCApplyClassTransmogrifier", - 1093: "k_EMsgGCApplyHalloweenSpellbookPage", - 1094: "k_EMsgGCRemoveKillStreak", - 1095: "k_EMsgGCRemoveKillStreakResponse", - 1096: "k_EMsgGCTFSpecificItemBroadcast", - 1097: "k_EMsgGC_IncrementKillCountAttribute_Multiple", - 1098: "k_EMsgGCDeliverGiftResponseGiver", - 1100: "k_EMsgGCSetItemPositions", - 1101: "k_EMsgGCLookupMultipleAccountNames", - 1102: "k_EMsgGCLookupMultipleAccountNamesResponse", - 1500: "k_EMsgGCTradingBase", - 1501: "k_EMsgGCTrading_InitiateTradeRequest", - 1502: "k_EMsgGCTrading_InitiateTradeResponse", - 1503: "k_EMsgGCTrading_StartSession", - 1509: "k_EMsgGCTrading_SessionClosed", - 1510: "k_EMsgGCTrading_CancelSession", - 1514: "k_EMsgGCTrading_InitiateTradeRequestResponse", - 1601: "k_EMsgGCServerBrowser_FavoriteServer", - 1602: "k_EMsgGCServerBrowser_BlacklistServer", - 1700: "k_EMsgGCServerRentalsBase", - 1701: "k_EMsgGCItemPreviewCheckStatus", - 1702: "k_EMsgGCItemPreviewStatusResponse", - 1703: "k_EMsgGCItemPreviewRequest", - 1704: "k_EMsgGCItemPreviewRequestResponse", - 1705: "k_EMsgGCItemPreviewExpire", - 1706: "k_EMsgGCItemPreviewExpireNotification", - 1708: "k_EMsgGCItemPreviewItemBoughtNotification", - 2001: "k_EMsgGCDev_NewItemRequest", - 2002: "k_EMsgGCDev_NewItemRequestResponse", - 2003: "k_EMsgGCDev_DebugRollLootRequest", - 2500: "k_EMsgGCStoreGetUserData", - 2501: "k_EMsgGCStoreGetUserDataResponse", - 2502: "k_EMsgGCStorePurchaseInit_DEPRECATED", - 2503: "k_EMsgGCStorePurchaseInitResponse_DEPRECATED", - 2512: "k_EMsgGCStorePurchaseFinalize", - 2513: "k_EMsgGCStorePurchaseFinalizeResponse", - 2514: "k_EMsgGCStorePurchaseCancel", - 2515: "k_EMsgGCStorePurchaseCancelResponse", - 2508: "k_EMsgGCStorePurchaseQueryTxn", - 2509: "k_EMsgGCStorePurchaseQueryTxnResponse", - 2510: "k_EMsgGCStorePurchaseInit", - 2511: "k_EMsgGCStorePurchaseInitResponse", - 2516: "k_EMsgGCToGCDirtySDOCache", - 2517: "k_EMsgGCToGCDirtyMultipleSDOCache", - 2518: "k_EMsgGCToGCUpdateSQLKeyValue", - 2521: "k_EMsgGCToGCBroadcastConsoleCommand", - 2522: "k_EMsgGCServerVersionUpdated", - 2523: "k_EMsgGCApplyAutograph", - 2524: "k_EMsgGCToGCWebAPIAccountChanged", - 2525: "k_EMsgGCRequestAnnouncements", - 2526: "k_EMsgGCRequestAnnouncementsResponse", - 2527: "k_EMsgGCRequestPassportItemGrant", - 2528: "k_EMsgGCClientVersionUpdated", - 2531: "k_EMsgGCItemPurgatory_FinalizePurchase", - 2532: "k_EMsgGCItemPurgatory_FinalizePurchaseResponse", - 2533: "k_EMsgGCItemPurgatory_RefundPurchase", - 2534: "k_EMsgGCItemPurgatory_RefundPurchaseResponse", - 2535: "k_EMsgGCToGCPlayerStrangeCountAdjustments", - 2536: "k_EMsgGCRequestStoreSalesData", - 2537: "k_EMsgGCRequestStoreSalesDataResponse", - 2538: "k_EMsgGCRequestStoreSalesDataUpToDateResponse", - 2539: "k_EMsgGCToGCPingRequest", - 2540: "k_EMsgGCToGCPingResponse", - 2541: "k_EMsgGCToGCGetUserSessionServer", - 2542: "k_EMsgGCToGCGetUserSessionServerResponse", - 2543: "k_EMsgGCToGCGetUserServerMembers", - 2544: "k_EMsgGCToGCGetUserServerMembersResponse", - 2555: "k_EMsgGCToGCGrantSelfMadeItemToAccount", - 2556: "k_EMsgGCToGCThankedByNewUser", - 2557: "k_EMsgGCShuffleCrateContents", - 2558: "k_EMsgGCQuestObjective_Progress", - 2559: "k_EMsgGCQuestCompleted", - 2560: "k_EMsgGCApplyDuckToken", - 2561: "k_EMsgGCQuestComplete_Request", - 2562: "k_EMsgGCQuestObjective_PointsChange", - 2563: "k_EMsgGCQuestObjective_PointsChangeResponse", - 2564: "k_EMsgGCQuestObjective_RequestLoanerItems", - 2565: "k_EMsgGCQuestObjective_RequestLoanerResponse", - 2566: "k_EMsgGCApplyStrangeCountTransfer", - 2567: "k_EMsgGCCraftCollectionUpgrade", - 2568: "k_EMsgGCCraftHalloweenOffering", - 2569: "k_EMsgGCQuestDiscard_Request", - 2570: "k_EMsgGCRemoveGiftedBy", - 2571: "k_EMsgGCRemoveGiftedByResponse", -} -var EGCItemMsg_value = map[string]int32{ - "k_EMsgGCBase": 1000, - "k_EMsgGCSetSingleItemPosition": 1001, - "k_EMsgGCCraft": 1002, - "k_EMsgGCCraftResponse": 1003, - "k_EMsgGCDelete": 1004, - "k_EMsgGCVerifyCacheSubscription": 1005, - "k_EMsgGCNameItem": 1006, - "k_EMsgGCUnlockCrate": 1007, - "k_EMsgGCUnlockCrateResponse": 1008, - "k_EMsgGCPaintItem": 1009, - "k_EMsgGCPaintItemResponse": 1010, - "k_EMsgGCGoldenWrenchBroadcast": 1011, - "k_EMsgGCMOTDRequest": 1012, - "k_EMsgGCMOTDRequestResponse": 1013, - "k_EMsgGCNameBaseItem": 1019, - "k_EMsgGCNameBaseItemResponse": 1020, - "k_EMsgGCRemoveSocketItem_DEPRECATED": 1021, - "k_EMsgGCRemoveSocketItemResponse_DEPRECATED": 1022, - "k_EMsgGCCustomizeItemTexture": 1023, - "k_EMsgGCCustomizeItemTextureResponse": 1024, - "k_EMsgGCUseItemRequest": 1025, - "k_EMsgGCUseItemResponse": 1026, - "k_EMsgGCRespawnPostLoadoutChange": 1029, - "k_EMsgGCRemoveItemName": 1030, - "k_EMsgGCRemoveItemPaint": 1031, - "k_EMsgGCGiftWrapItem": 1032, - "k_EMsgGCGiftWrapItemResponse": 1033, - "k_EMsgGCDeliverGift": 1034, - "k_EMsgGCDeliverGiftResponseReceiver": 1036, - "k_EMsgGCUnwrapGiftRequest": 1037, - "k_EMsgGCUnwrapGiftResponse": 1038, - "k_EMsgGCSetItemStyle": 1039, - "k_EMsgGCUsedClaimCodeItem": 1040, - "k_EMsgGCSortItems": 1041, - "k_EMsgGC_RevolvingLootList_DEPRECATED": 1042, - "k_EMsgGCLookupAccount": 1043, - "k_EMsgGCLookupAccountResponse": 1044, - "k_EMsgGCLookupAccountName": 1045, - "k_EMsgGCLookupAccountNameResponse": 1046, - "k_EMsgGCUpdateItemSchema": 1049, - "k_EMsgGCRequestInventoryRefresh": 1050, - "k_EMsgGCRemoveCustomTexture": 1051, - "k_EMsgGCRemoveCustomTextureResponse": 1052, - "k_EMsgGCRemoveMakersMark": 1053, - "k_EMsgGCRemoveMakersMarkResponse": 1054, - "k_EMsgGCRemoveUniqueCraftIndex": 1055, - "k_EMsgGCRemoveUniqueCraftIndexResponse": 1056, - "k_EMsgGCSaxxyBroadcast": 1057, - "k_EMsgGCBackpackSortFinished": 1058, - "k_EMsgGCAdjustItemEquippedState": 1059, - "k_EMsgGCCollectItem": 1061, - "k_EMsgGCItemAcknowledged": 1062, - "k_EMsgGCPresets_SelectPresetForClass": 1063, - "k_EMsgGCPresets_SetItemPosition": 1064, - "k_EMsgGC_ReportAbuse": 1065, - "k_EMsgGC_ReportAbuseResponse": 1066, - "k_EMsgGCPresets_SelectPresetForClassReply": 1067, - "k_EMsgGCNameItemNotification": 1068, - "k_EMsgGCClientDisplayNotification": 1069, - "k_EMsgGCApplyStrangePart": 1070, - "k_EMsgGC_IncrementKillCountAttribute": 1071, - "k_EMsgGC_IncrementKillCountResponse": 1072, - "k_EMsgGCRemoveStrangePart": 1073, - "k_EMsgGCResetStrangeScores": 1074, - "k_EMsgGCGiftedItems": 1075, - "k_EMsgGCApplyUpgradeCard": 1077, - "k_EMsgGCRemoveUpgradeCard": 1078, - "k_EMsgGCApplyStrangeRestriction": 1079, - "k_EMsgGCClientRequestMarketData": 1080, - "k_EMsgGCClientRequestMarketDataResponse": 1081, - "k_EMsgGCApplyXifier": 1082, - "k_EMsgGCApplyXifierResponse": 1083, - "k_EMsgGC_TrackUniquePlayerPairEvent": 1084, - "k_EMsgGCFulfillDynamicRecipeComponent": 1085, - "k_EMsgGCFulfillDynamicRecipeComponentResponse": 1086, - "k_EMsgGCSetItemEffectVerticalOffset": 1087, - "k_EMsgGCSetHatEffectUseHeadOrigin": 1088, - "k_EMsgGCItemEaterRecharger": 1089, - "k_EMsgGCItemEaterRechargerResponse": 1090, - "k_EMsgGCApplyBaseItemXifier": 1091, - "k_EMsgGCApplyClassTransmogrifier": 1092, - "k_EMsgGCApplyHalloweenSpellbookPage": 1093, - "k_EMsgGCRemoveKillStreak": 1094, - "k_EMsgGCRemoveKillStreakResponse": 1095, - "k_EMsgGCTFSpecificItemBroadcast": 1096, - "k_EMsgGC_IncrementKillCountAttribute_Multiple": 1097, - "k_EMsgGCDeliverGiftResponseGiver": 1098, - "k_EMsgGCSetItemPositions": 1100, - "k_EMsgGCLookupMultipleAccountNames": 1101, - "k_EMsgGCLookupMultipleAccountNamesResponse": 1102, - "k_EMsgGCTradingBase": 1500, - "k_EMsgGCTrading_InitiateTradeRequest": 1501, - "k_EMsgGCTrading_InitiateTradeResponse": 1502, - "k_EMsgGCTrading_StartSession": 1503, - "k_EMsgGCTrading_SessionClosed": 1509, - "k_EMsgGCTrading_CancelSession": 1510, - "k_EMsgGCTrading_InitiateTradeRequestResponse": 1514, - "k_EMsgGCServerBrowser_FavoriteServer": 1601, - "k_EMsgGCServerBrowser_BlacklistServer": 1602, - "k_EMsgGCServerRentalsBase": 1700, - "k_EMsgGCItemPreviewCheckStatus": 1701, - "k_EMsgGCItemPreviewStatusResponse": 1702, - "k_EMsgGCItemPreviewRequest": 1703, - "k_EMsgGCItemPreviewRequestResponse": 1704, - "k_EMsgGCItemPreviewExpire": 1705, - "k_EMsgGCItemPreviewExpireNotification": 1706, - "k_EMsgGCItemPreviewItemBoughtNotification": 1708, - "k_EMsgGCDev_NewItemRequest": 2001, - "k_EMsgGCDev_NewItemRequestResponse": 2002, - "k_EMsgGCDev_DebugRollLootRequest": 2003, - "k_EMsgGCStoreGetUserData": 2500, - "k_EMsgGCStoreGetUserDataResponse": 2501, - "k_EMsgGCStorePurchaseInit_DEPRECATED": 2502, - "k_EMsgGCStorePurchaseInitResponse_DEPRECATED": 2503, - "k_EMsgGCStorePurchaseFinalize": 2512, - "k_EMsgGCStorePurchaseFinalizeResponse": 2513, - "k_EMsgGCStorePurchaseCancel": 2514, - "k_EMsgGCStorePurchaseCancelResponse": 2515, - "k_EMsgGCStorePurchaseQueryTxn": 2508, - "k_EMsgGCStorePurchaseQueryTxnResponse": 2509, - "k_EMsgGCStorePurchaseInit": 2510, - "k_EMsgGCStorePurchaseInitResponse": 2511, - "k_EMsgGCToGCDirtySDOCache": 2516, - "k_EMsgGCToGCDirtyMultipleSDOCache": 2517, - "k_EMsgGCToGCUpdateSQLKeyValue": 2518, - "k_EMsgGCToGCBroadcastConsoleCommand": 2521, - "k_EMsgGCServerVersionUpdated": 2522, - "k_EMsgGCApplyAutograph": 2523, - "k_EMsgGCToGCWebAPIAccountChanged": 2524, - "k_EMsgGCRequestAnnouncements": 2525, - "k_EMsgGCRequestAnnouncementsResponse": 2526, - "k_EMsgGCRequestPassportItemGrant": 2527, - "k_EMsgGCClientVersionUpdated": 2528, - "k_EMsgGCItemPurgatory_FinalizePurchase": 2531, - "k_EMsgGCItemPurgatory_FinalizePurchaseResponse": 2532, - "k_EMsgGCItemPurgatory_RefundPurchase": 2533, - "k_EMsgGCItemPurgatory_RefundPurchaseResponse": 2534, - "k_EMsgGCToGCPlayerStrangeCountAdjustments": 2535, - "k_EMsgGCRequestStoreSalesData": 2536, - "k_EMsgGCRequestStoreSalesDataResponse": 2537, - "k_EMsgGCRequestStoreSalesDataUpToDateResponse": 2538, - "k_EMsgGCToGCPingRequest": 2539, - "k_EMsgGCToGCPingResponse": 2540, - "k_EMsgGCToGCGetUserSessionServer": 2541, - "k_EMsgGCToGCGetUserSessionServerResponse": 2542, - "k_EMsgGCToGCGetUserServerMembers": 2543, - "k_EMsgGCToGCGetUserServerMembersResponse": 2544, - "k_EMsgGCToGCGrantSelfMadeItemToAccount": 2555, - "k_EMsgGCToGCThankedByNewUser": 2556, - "k_EMsgGCShuffleCrateContents": 2557, - "k_EMsgGCQuestObjective_Progress": 2558, - "k_EMsgGCQuestCompleted": 2559, - "k_EMsgGCApplyDuckToken": 2560, - "k_EMsgGCQuestComplete_Request": 2561, - "k_EMsgGCQuestObjective_PointsChange": 2562, - "k_EMsgGCQuestObjective_PointsChangeResponse": 2563, - "k_EMsgGCQuestObjective_RequestLoanerItems": 2564, - "k_EMsgGCQuestObjective_RequestLoanerResponse": 2565, - "k_EMsgGCApplyStrangeCountTransfer": 2566, - "k_EMsgGCCraftCollectionUpgrade": 2567, - "k_EMsgGCCraftHalloweenOffering": 2568, - "k_EMsgGCQuestDiscard_Request": 2569, - "k_EMsgGCRemoveGiftedBy": 2570, - "k_EMsgGCRemoveGiftedByResponse": 2571, -} - -func (x EGCItemMsg) Enum() *EGCItemMsg { - p := new(EGCItemMsg) - *p = x - return p -} -func (x EGCItemMsg) String() string { - return proto.EnumName(EGCItemMsg_name, int32(x)) -} -func (x *EGCItemMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCItemMsg_value, data, "EGCItemMsg") - if err != nil { - return err - } - *x = EGCItemMsg(value) - return nil -} -func (EGCItemMsg) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{0} } - -type EGCMsgResponse int32 - -const ( - EGCMsgResponse_k_EGCMsgResponseOK EGCMsgResponse = 0 - EGCMsgResponse_k_EGCMsgResponseDenied EGCMsgResponse = 1 - EGCMsgResponse_k_EGCMsgResponseServerError EGCMsgResponse = 2 - EGCMsgResponse_k_EGCMsgResponseTimeout EGCMsgResponse = 3 - EGCMsgResponse_k_EGCMsgResponseInvalid EGCMsgResponse = 4 - EGCMsgResponse_k_EGCMsgResponseNoMatch EGCMsgResponse = 5 - EGCMsgResponse_k_EGCMsgResponseUnknownError EGCMsgResponse = 6 - EGCMsgResponse_k_EGCMsgResponseNotLoggedOn EGCMsgResponse = 7 - EGCMsgResponse_k_EGCMsgFailedToCreate EGCMsgResponse = 8 -) - -var EGCMsgResponse_name = map[int32]string{ - 0: "k_EGCMsgResponseOK", - 1: "k_EGCMsgResponseDenied", - 2: "k_EGCMsgResponseServerError", - 3: "k_EGCMsgResponseTimeout", - 4: "k_EGCMsgResponseInvalid", - 5: "k_EGCMsgResponseNoMatch", - 6: "k_EGCMsgResponseUnknownError", - 7: "k_EGCMsgResponseNotLoggedOn", - 8: "k_EGCMsgFailedToCreate", -} -var EGCMsgResponse_value = map[string]int32{ - "k_EGCMsgResponseOK": 0, - "k_EGCMsgResponseDenied": 1, - "k_EGCMsgResponseServerError": 2, - "k_EGCMsgResponseTimeout": 3, - "k_EGCMsgResponseInvalid": 4, - "k_EGCMsgResponseNoMatch": 5, - "k_EGCMsgResponseUnknownError": 6, - "k_EGCMsgResponseNotLoggedOn": 7, - "k_EGCMsgFailedToCreate": 8, -} - -func (x EGCMsgResponse) Enum() *EGCMsgResponse { - p := new(EGCMsgResponse) - *p = x - return p -} -func (x EGCMsgResponse) String() string { - return proto.EnumName(EGCMsgResponse_name, int32(x)) -} -func (x *EGCMsgResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCMsgResponse_value, data, "EGCMsgResponse") - if err != nil { - return err - } - *x = EGCMsgResponse(value) - return nil -} -func (EGCMsgResponse) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{1} } - -type EUnlockStyle int32 - -const ( - EUnlockStyle_k_UnlockStyle_Succeeded EUnlockStyle = 0 - EUnlockStyle_k_UnlockStyle_Failed_PreReq EUnlockStyle = 1 - EUnlockStyle_k_UnlockStyle_Failed_CantAfford EUnlockStyle = 2 - EUnlockStyle_k_UnlockStyle_Failed_CantCommit EUnlockStyle = 3 - EUnlockStyle_k_UnlockStyle_Failed_CantLockCache EUnlockStyle = 4 - EUnlockStyle_k_UnlockStyle_Failed_CantAffordAttrib EUnlockStyle = 5 - EUnlockStyle_k_UnlockStyle_Failed_CantAffordGem EUnlockStyle = 6 -) - -var EUnlockStyle_name = map[int32]string{ - 0: "k_UnlockStyle_Succeeded", - 1: "k_UnlockStyle_Failed_PreReq", - 2: "k_UnlockStyle_Failed_CantAfford", - 3: "k_UnlockStyle_Failed_CantCommit", - 4: "k_UnlockStyle_Failed_CantLockCache", - 5: "k_UnlockStyle_Failed_CantAffordAttrib", - 6: "k_UnlockStyle_Failed_CantAffordGem", -} -var EUnlockStyle_value = map[string]int32{ - "k_UnlockStyle_Succeeded": 0, - "k_UnlockStyle_Failed_PreReq": 1, - "k_UnlockStyle_Failed_CantAfford": 2, - "k_UnlockStyle_Failed_CantCommit": 3, - "k_UnlockStyle_Failed_CantLockCache": 4, - "k_UnlockStyle_Failed_CantAffordAttrib": 5, - "k_UnlockStyle_Failed_CantAffordGem": 6, -} - -func (x EUnlockStyle) Enum() *EUnlockStyle { - p := new(EUnlockStyle) - *p = x - return p -} -func (x EUnlockStyle) String() string { - return proto.EnumName(EUnlockStyle_name, int32(x)) -} -func (x *EUnlockStyle) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EUnlockStyle_value, data, "EUnlockStyle") - if err != nil { - return err - } - *x = EUnlockStyle(value) - return nil -} -func (EUnlockStyle) EnumDescriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{2} } - -type EItemPurgatoryResponse_Finalize int32 - -const ( - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Succeeded EItemPurgatoryResponse_Finalize = 0 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_Incomplete EItemPurgatoryResponse_Finalize = 1 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_ItemsNotInPurgatory EItemPurgatoryResponse_Finalize = 2 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_CouldNotFindItems EItemPurgatoryResponse_Finalize = 3 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_Failed_NoSOCache EItemPurgatoryResponse_Finalize = 4 - EItemPurgatoryResponse_Finalize_k_ItemPurgatoryResponse_Finalize_BackpackFull EItemPurgatoryResponse_Finalize = 5 -) - -var EItemPurgatoryResponse_Finalize_name = map[int32]string{ - 0: "k_ItemPurgatoryResponse_Finalize_Succeeded", - 1: "k_ItemPurgatoryResponse_Finalize_Failed_Incomplete", - 2: "k_ItemPurgatoryResponse_Finalize_Failed_ItemsNotInPurgatory", - 3: "k_ItemPurgatoryResponse_Finalize_Failed_CouldNotFindItems", - 4: "k_ItemPurgatoryResponse_Finalize_Failed_NoSOCache", - 5: "k_ItemPurgatoryResponse_Finalize_BackpackFull", -} -var EItemPurgatoryResponse_Finalize_value = map[string]int32{ - "k_ItemPurgatoryResponse_Finalize_Succeeded": 0, - "k_ItemPurgatoryResponse_Finalize_Failed_Incomplete": 1, - "k_ItemPurgatoryResponse_Finalize_Failed_ItemsNotInPurgatory": 2, - "k_ItemPurgatoryResponse_Finalize_Failed_CouldNotFindItems": 3, - "k_ItemPurgatoryResponse_Finalize_Failed_NoSOCache": 4, - "k_ItemPurgatoryResponse_Finalize_BackpackFull": 5, -} - -func (x EItemPurgatoryResponse_Finalize) Enum() *EItemPurgatoryResponse_Finalize { - p := new(EItemPurgatoryResponse_Finalize) - *p = x - return p -} -func (x EItemPurgatoryResponse_Finalize) String() string { - return proto.EnumName(EItemPurgatoryResponse_Finalize_name, int32(x)) -} -func (x *EItemPurgatoryResponse_Finalize) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EItemPurgatoryResponse_Finalize_value, data, "EItemPurgatoryResponse_Finalize") - if err != nil { - return err - } - *x = EItemPurgatoryResponse_Finalize(value) - return nil -} -func (EItemPurgatoryResponse_Finalize) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{3} -} - -type EItemPurgatoryResponse_Refund int32 - -const ( - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Succeeded EItemPurgatoryResponse_Refund = 0 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_ItemNotInPurgatory EItemPurgatoryResponse_Refund = 1 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_CouldNotFindItem EItemPurgatoryResponse_Refund = 2 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_NoSOCache EItemPurgatoryResponse_Refund = 3 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_NoDetail EItemPurgatoryResponse_Refund = 4 - EItemPurgatoryResponse_Refund_k_ItemPurgatoryResponse_Refund_Failed_NexonWebAPI EItemPurgatoryResponse_Refund = 5 -) - -var EItemPurgatoryResponse_Refund_name = map[int32]string{ - 0: "k_ItemPurgatoryResponse_Refund_Succeeded", - 1: "k_ItemPurgatoryResponse_Refund_Failed_ItemNotInPurgatory", - 2: "k_ItemPurgatoryResponse_Refund_Failed_CouldNotFindItem", - 3: "k_ItemPurgatoryResponse_Refund_Failed_NoSOCache", - 4: "k_ItemPurgatoryResponse_Refund_Failed_NoDetail", - 5: "k_ItemPurgatoryResponse_Refund_Failed_NexonWebAPI", -} -var EItemPurgatoryResponse_Refund_value = map[string]int32{ - "k_ItemPurgatoryResponse_Refund_Succeeded": 0, - "k_ItemPurgatoryResponse_Refund_Failed_ItemNotInPurgatory": 1, - "k_ItemPurgatoryResponse_Refund_Failed_CouldNotFindItem": 2, - "k_ItemPurgatoryResponse_Refund_Failed_NoSOCache": 3, - "k_ItemPurgatoryResponse_Refund_Failed_NoDetail": 4, - "k_ItemPurgatoryResponse_Refund_Failed_NexonWebAPI": 5, -} - -func (x EItemPurgatoryResponse_Refund) Enum() *EItemPurgatoryResponse_Refund { - p := new(EItemPurgatoryResponse_Refund) - *p = x - return p -} -func (x EItemPurgatoryResponse_Refund) String() string { - return proto.EnumName(EItemPurgatoryResponse_Refund_name, int32(x)) -} -func (x *EItemPurgatoryResponse_Refund) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EItemPurgatoryResponse_Refund_value, data, "EItemPurgatoryResponse_Refund") - if err != nil { - return err - } - *x = EItemPurgatoryResponse_Refund(value) - return nil -} -func (EItemPurgatoryResponse_Refund) EnumDescriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{4} -} - -type CMsgApplyAutograph struct { - AutographItemId *uint64 `protobuf:"varint,1,opt,name=autograph_item_id" json:"autograph_item_id,omitempty"` - ItemItemId *uint64 `protobuf:"varint,2,opt,name=item_item_id" json:"item_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgApplyAutograph) Reset() { *m = CMsgApplyAutograph{} } -func (m *CMsgApplyAutograph) String() string { return proto.CompactTextString(m) } -func (*CMsgApplyAutograph) ProtoMessage() {} -func (*CMsgApplyAutograph) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{0} } - -func (m *CMsgApplyAutograph) GetAutographItemId() uint64 { - if m != nil && m.AutographItemId != nil { - return *m.AutographItemId - } - return 0 -} - -func (m *CMsgApplyAutograph) GetItemItemId() uint64 { - if m != nil && m.ItemItemId != nil { - return *m.ItemItemId - } - return 0 -} - -type CMsgEconPlayerStrangeCountAdjustment struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - StrangeCountAdjustments []*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment `protobuf:"bytes,2,rep,name=strange_count_adjustments" json:"strange_count_adjustments,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgEconPlayerStrangeCountAdjustment) Reset() { *m = CMsgEconPlayerStrangeCountAdjustment{} } -func (m *CMsgEconPlayerStrangeCountAdjustment) String() string { return proto.CompactTextString(m) } -func (*CMsgEconPlayerStrangeCountAdjustment) ProtoMessage() {} -func (*CMsgEconPlayerStrangeCountAdjustment) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{1} -} - -func (m *CMsgEconPlayerStrangeCountAdjustment) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgEconPlayerStrangeCountAdjustment) GetStrangeCountAdjustments() []*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment { - if m != nil { - return m.StrangeCountAdjustments - } - return nil -} - -type CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment struct { - EventType *uint32 `protobuf:"varint,1,opt,name=event_type" json:"event_type,omitempty"` - ItemId *uint64 `protobuf:"varint,2,opt,name=item_id" json:"item_id,omitempty"` - Adjustment *uint32 `protobuf:"varint,3,opt,name=adjustment" json:"adjustment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) Reset() { - *m = CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment{} -} -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) String() string { - return proto.CompactTextString(m) -} -func (*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) ProtoMessage() {} -func (*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{1, 0} -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment) GetAdjustment() uint32 { - if m != nil && m.Adjustment != nil { - return *m.Adjustment - } - return 0 -} - -type CMsgRequestItemPurgatory_FinalizePurchase struct { - ItemIds []uint64 `protobuf:"varint,1,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchase) Reset() { - *m = CMsgRequestItemPurgatory_FinalizePurchase{} -} -func (m *CMsgRequestItemPurgatory_FinalizePurchase) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestItemPurgatory_FinalizePurchase) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_FinalizePurchase) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{2} -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchase) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgRequestItemPurgatory_FinalizePurchaseResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) Reset() { - *m = CMsgRequestItemPurgatory_FinalizePurchaseResponse{} -} -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgRequestItemPurgatory_FinalizePurchaseResponse) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_FinalizePurchaseResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{3} -} - -func (m *CMsgRequestItemPurgatory_FinalizePurchaseResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgRequestItemPurgatory_RefundPurchase struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_RefundPurchase) Reset() { - *m = CMsgRequestItemPurgatory_RefundPurchase{} -} -func (m *CMsgRequestItemPurgatory_RefundPurchase) String() string { return proto.CompactTextString(m) } -func (*CMsgRequestItemPurgatory_RefundPurchase) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_RefundPurchase) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{4} -} - -func (m *CMsgRequestItemPurgatory_RefundPurchase) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgRequestItemPurgatory_RefundPurchaseResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRequestItemPurgatory_RefundPurchaseResponse) Reset() { - *m = CMsgRequestItemPurgatory_RefundPurchaseResponse{} -} -func (m *CMsgRequestItemPurgatory_RefundPurchaseResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgRequestItemPurgatory_RefundPurchaseResponse) ProtoMessage() {} -func (*CMsgRequestItemPurgatory_RefundPurchaseResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{5} -} - -func (m *CMsgRequestItemPurgatory_RefundPurchaseResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgCraftingResponse struct { - ItemIds []uint64 `protobuf:"varint,1,rep,name=item_ids" json:"item_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCraftingResponse) Reset() { *m = CMsgCraftingResponse{} } -func (m *CMsgCraftingResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgCraftingResponse) ProtoMessage() {} -func (*CMsgCraftingResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{6} } - -func (m *CMsgCraftingResponse) GetItemIds() []uint64 { - if m != nil { - return m.ItemIds - } - return nil -} - -type CMsgGCRequestStoreSalesData struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - Currency *uint32 `protobuf:"varint,2,opt,name=currency" json:"currency,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesData) Reset() { *m = CMsgGCRequestStoreSalesData{} } -func (m *CMsgGCRequestStoreSalesData) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestStoreSalesData) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesData) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{7} } - -func (m *CMsgGCRequestStoreSalesData) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesData) GetCurrency() uint32 { - if m != nil && m.Currency != nil { - return *m.Currency - } - return 0 -} - -type CMsgGCRequestStoreSalesDataResponse struct { - SalePrice []*CMsgGCRequestStoreSalesDataResponse_Price `protobuf:"bytes,1,rep,name=sale_price" json:"sale_price,omitempty"` - Version *uint32 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` - ExpirationTime *uint32 `protobuf:"varint,3,opt,name=expiration_time" json:"expiration_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesDataResponse) Reset() { *m = CMsgGCRequestStoreSalesDataResponse{} } -func (m *CMsgGCRequestStoreSalesDataResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestStoreSalesDataResponse) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesDataResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{8} -} - -func (m *CMsgGCRequestStoreSalesDataResponse) GetSalePrice() []*CMsgGCRequestStoreSalesDataResponse_Price { - if m != nil { - return m.SalePrice - } - return nil -} - -func (m *CMsgGCRequestStoreSalesDataResponse) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesDataResponse) GetExpirationTime() uint32 { - if m != nil && m.ExpirationTime != nil { - return *m.ExpirationTime - } - return 0 -} - -type CMsgGCRequestStoreSalesDataResponse_Price struct { - ItemDef *uint32 `protobuf:"varint,1,opt,name=item_def" json:"item_def,omitempty"` - Price *uint32 `protobuf:"varint,2,opt,name=price" json:"price,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesDataResponse_Price) Reset() { - *m = CMsgGCRequestStoreSalesDataResponse_Price{} -} -func (m *CMsgGCRequestStoreSalesDataResponse_Price) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestStoreSalesDataResponse_Price) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesDataResponse_Price) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{8, 0} -} - -func (m *CMsgGCRequestStoreSalesDataResponse_Price) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesDataResponse_Price) GetPrice() uint32 { - if m != nil && m.Price != nil { - return *m.Price - } - return 0 -} - -type CMsgGCRequestStoreSalesDataUpToDateResponse struct { - Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - ExpirationTime *uint32 `protobuf:"varint,2,opt,name=expiration_time" json:"expiration_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) Reset() { - *m = CMsgGCRequestStoreSalesDataUpToDateResponse{} -} -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCRequestStoreSalesDataUpToDateResponse) ProtoMessage() {} -func (*CMsgGCRequestStoreSalesDataUpToDateResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{9} -} - -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) GetVersion() uint32 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgGCRequestStoreSalesDataUpToDateResponse) GetExpirationTime() uint32 { - if m != nil && m.ExpirationTime != nil { - return *m.ExpirationTime - } - return 0 -} - -type CMsgGCToGCPingRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCPingRequest) Reset() { *m = CMsgGCToGCPingRequest{} } -func (m *CMsgGCToGCPingRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCPingRequest) ProtoMessage() {} -func (*CMsgGCToGCPingRequest) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{10} } - -type CMsgGCToGCPingResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCPingResponse) Reset() { *m = CMsgGCToGCPingResponse{} } -func (m *CMsgGCToGCPingResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCPingResponse) ProtoMessage() {} -func (*CMsgGCToGCPingResponse) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{11} } - -type CMsgGCToGCGetUserSessionServer struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserSessionServer) Reset() { *m = CMsgGCToGCGetUserSessionServer{} } -func (m *CMsgGCToGCGetUserSessionServer) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserSessionServer) ProtoMessage() {} -func (*CMsgGCToGCGetUserSessionServer) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{12} } - -func (m *CMsgGCToGCGetUserSessionServer) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGCToGCGetUserSessionServerResponse struct { - ServerSteamId *uint64 `protobuf:"fixed64,1,opt,name=server_steam_id" json:"server_steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserSessionServerResponse) Reset() { - *m = CMsgGCToGCGetUserSessionServerResponse{} -} -func (m *CMsgGCToGCGetUserSessionServerResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserSessionServerResponse) ProtoMessage() {} -func (*CMsgGCToGCGetUserSessionServerResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{13} -} - -func (m *CMsgGCToGCGetUserSessionServerResponse) GetServerSteamId() uint64 { - if m != nil && m.ServerSteamId != nil { - return *m.ServerSteamId - } - return 0 -} - -type CMsgGCToGCGetUserServerMembers struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - MaxSpectators *uint32 `protobuf:"varint,2,opt,name=max_spectators" json:"max_spectators,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserServerMembers) Reset() { *m = CMsgGCToGCGetUserServerMembers{} } -func (m *CMsgGCToGCGetUserServerMembers) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserServerMembers) ProtoMessage() {} -func (*CMsgGCToGCGetUserServerMembers) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{14} } - -func (m *CMsgGCToGCGetUserServerMembers) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGCToGCGetUserServerMembers) GetMaxSpectators() uint32 { - if m != nil && m.MaxSpectators != nil { - return *m.MaxSpectators - } - return 0 -} - -type CMsgGCToGCGetUserServerMembersResponse struct { - MemberAccountId []uint32 `protobuf:"varint,1,rep,name=member_account_id" json:"member_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGetUserServerMembersResponse) Reset() { - *m = CMsgGCToGCGetUserServerMembersResponse{} -} -func (m *CMsgGCToGCGetUserServerMembersResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGetUserServerMembersResponse) ProtoMessage() {} -func (*CMsgGCToGCGetUserServerMembersResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{15} -} - -func (m *CMsgGCToGCGetUserServerMembersResponse) GetMemberAccountId() []uint32 { - if m != nil { - return m.MemberAccountId - } - return nil -} - -type CMsgLookupMultipleAccountNames struct { - Accountids []uint32 `protobuf:"varint,1,rep,packed,name=accountids" json:"accountids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLookupMultipleAccountNames) Reset() { *m = CMsgLookupMultipleAccountNames{} } -func (m *CMsgLookupMultipleAccountNames) String() string { return proto.CompactTextString(m) } -func (*CMsgLookupMultipleAccountNames) ProtoMessage() {} -func (*CMsgLookupMultipleAccountNames) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{16} } - -func (m *CMsgLookupMultipleAccountNames) GetAccountids() []uint32 { - if m != nil { - return m.Accountids - } - return nil -} - -type CMsgLookupMultipleAccountNamesResponse struct { - Accounts []*CMsgLookupMultipleAccountNamesResponse_Account `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLookupMultipleAccountNamesResponse) Reset() { - *m = CMsgLookupMultipleAccountNamesResponse{} -} -func (m *CMsgLookupMultipleAccountNamesResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgLookupMultipleAccountNamesResponse) ProtoMessage() {} -func (*CMsgLookupMultipleAccountNamesResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{17} -} - -func (m *CMsgLookupMultipleAccountNamesResponse) GetAccounts() []*CMsgLookupMultipleAccountNamesResponse_Account { - if m != nil { - return m.Accounts - } - return nil -} - -type CMsgLookupMultipleAccountNamesResponse_Account struct { - Accountid *uint32 `protobuf:"varint,1,opt,name=accountid" json:"accountid,omitempty"` - Persona *string `protobuf:"bytes,2,opt,name=persona" json:"persona,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLookupMultipleAccountNamesResponse_Account) Reset() { - *m = CMsgLookupMultipleAccountNamesResponse_Account{} -} -func (m *CMsgLookupMultipleAccountNamesResponse_Account) String() string { - return proto.CompactTextString(m) -} -func (*CMsgLookupMultipleAccountNamesResponse_Account) ProtoMessage() {} -func (*CMsgLookupMultipleAccountNamesResponse_Account) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{17, 0} -} - -func (m *CMsgLookupMultipleAccountNamesResponse_Account) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -func (m *CMsgLookupMultipleAccountNamesResponse_Account) GetPersona() string { - if m != nil && m.Persona != nil { - return *m.Persona - } - return "" -} - -type CMsgGCToGCGrantSelfMadeItemToAccount struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - Accountid *uint32 `protobuf:"varint,2,opt,name=accountid" json:"accountid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) Reset() { *m = CMsgGCToGCGrantSelfMadeItemToAccount{} } -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCGrantSelfMadeItemToAccount) ProtoMessage() {} -func (*CMsgGCToGCGrantSelfMadeItemToAccount) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{18} -} - -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCToGCGrantSelfMadeItemToAccount) GetAccountid() uint32 { - if m != nil && m.Accountid != nil { - return *m.Accountid - } - return 0 -} - -type CMsgGCToGCThankedByNewUser struct { - NewUserAccountid *uint32 `protobuf:"varint,1,opt,name=new_user_accountid" json:"new_user_accountid,omitempty"` - ThankedUserAccountid *uint32 `protobuf:"varint,2,opt,name=thanked_user_accountid" json:"thanked_user_accountid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCThankedByNewUser) Reset() { *m = CMsgGCToGCThankedByNewUser{} } -func (m *CMsgGCToGCThankedByNewUser) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCThankedByNewUser) ProtoMessage() {} -func (*CMsgGCToGCThankedByNewUser) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{19} } - -func (m *CMsgGCToGCThankedByNewUser) GetNewUserAccountid() uint32 { - if m != nil && m.NewUserAccountid != nil { - return *m.NewUserAccountid - } - return 0 -} - -func (m *CMsgGCToGCThankedByNewUser) GetThankedUserAccountid() uint32 { - if m != nil && m.ThankedUserAccountid != nil { - return *m.ThankedUserAccountid - } - return 0 -} - -type CMsgGCShuffleCrateContents struct { - CrateItemId *uint64 `protobuf:"varint,1,opt,name=crate_item_id" json:"crate_item_id,omitempty"` - UserCodeString *string `protobuf:"bytes,2,opt,name=user_code_string" json:"user_code_string,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCShuffleCrateContents) Reset() { *m = CMsgGCShuffleCrateContents{} } -func (m *CMsgGCShuffleCrateContents) String() string { return proto.CompactTextString(m) } -func (*CMsgGCShuffleCrateContents) ProtoMessage() {} -func (*CMsgGCShuffleCrateContents) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{20} } - -func (m *CMsgGCShuffleCrateContents) GetCrateItemId() uint64 { - if m != nil && m.CrateItemId != nil { - return *m.CrateItemId - } - return 0 -} - -func (m *CMsgGCShuffleCrateContents) GetUserCodeString() string { - if m != nil && m.UserCodeString != nil { - return *m.UserCodeString - } - return "" -} - -type CMsgGCQuestObjective_Progress struct { - QuestItemId *uint64 `protobuf:"varint,1,opt,name=quest_item_id" json:"quest_item_id,omitempty"` - QuestAttribIndex *uint32 `protobuf:"varint,2,opt,name=quest_attrib_index" json:"quest_attrib_index,omitempty"` - Delta *uint32 `protobuf:"varint,3,opt,name=delta" json:"delta,omitempty"` - OwnerSteamid *uint64 `protobuf:"fixed64,4,opt,name=owner_steamid" json:"owner_steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestObjective_Progress) Reset() { *m = CMsgGCQuestObjective_Progress{} } -func (m *CMsgGCQuestObjective_Progress) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestObjective_Progress) ProtoMessage() {} -func (*CMsgGCQuestObjective_Progress) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{21} } - -func (m *CMsgGCQuestObjective_Progress) GetQuestItemId() uint64 { - if m != nil && m.QuestItemId != nil { - return *m.QuestItemId - } - return 0 -} - -func (m *CMsgGCQuestObjective_Progress) GetQuestAttribIndex() uint32 { - if m != nil && m.QuestAttribIndex != nil { - return *m.QuestAttribIndex - } - return 0 -} - -func (m *CMsgGCQuestObjective_Progress) GetDelta() uint32 { - if m != nil && m.Delta != nil { - return *m.Delta - } - return 0 -} - -func (m *CMsgGCQuestObjective_Progress) GetOwnerSteamid() uint64 { - if m != nil && m.OwnerSteamid != nil { - return *m.OwnerSteamid - } - return 0 -} - -type CMsgGCQuestObjective_PointsChange struct { - QuestItemId *uint64 `protobuf:"varint,1,opt,name=quest_item_id" json:"quest_item_id,omitempty"` - StandardPoints *uint32 `protobuf:"varint,2,opt,name=standard_points" json:"standard_points,omitempty"` - BonusPoints *uint32 `protobuf:"varint,3,opt,name=bonus_points" json:"bonus_points,omitempty"` - OwnerSteamid *uint64 `protobuf:"fixed64,4,opt,name=owner_steamid" json:"owner_steamid,omitempty"` - UpdateBasePoints *bool `protobuf:"varint,5,opt,name=update_base_points,def=0" json:"update_base_points,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestObjective_PointsChange) Reset() { *m = CMsgGCQuestObjective_PointsChange{} } -func (m *CMsgGCQuestObjective_PointsChange) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestObjective_PointsChange) ProtoMessage() {} -func (*CMsgGCQuestObjective_PointsChange) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{22} -} - -const Default_CMsgGCQuestObjective_PointsChange_UpdateBasePoints bool = false - -func (m *CMsgGCQuestObjective_PointsChange) GetQuestItemId() uint64 { - if m != nil && m.QuestItemId != nil { - return *m.QuestItemId - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChange) GetStandardPoints() uint32 { - if m != nil && m.StandardPoints != nil { - return *m.StandardPoints - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChange) GetBonusPoints() uint32 { - if m != nil && m.BonusPoints != nil { - return *m.BonusPoints - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChange) GetOwnerSteamid() uint64 { - if m != nil && m.OwnerSteamid != nil { - return *m.OwnerSteamid - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChange) GetUpdateBasePoints() bool { - if m != nil && m.UpdateBasePoints != nil { - return *m.UpdateBasePoints - } - return Default_CMsgGCQuestObjective_PointsChange_UpdateBasePoints -} - -type CMsgGCQuestObjective_PointsChangeResponse struct { - QuestItemId *uint64 `protobuf:"varint,1,opt,name=quest_item_id" json:"quest_item_id,omitempty"` - StandardPoints *uint32 `protobuf:"varint,2,opt,name=standard_points" json:"standard_points,omitempty"` - BonusPoints *uint32 `protobuf:"varint,3,opt,name=bonus_points" json:"bonus_points,omitempty"` - UpdateBasePoints *bool `protobuf:"varint,4,opt,name=update_base_points" json:"update_base_points,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestObjective_PointsChangeResponse) Reset() { - *m = CMsgGCQuestObjective_PointsChangeResponse{} -} -func (m *CMsgGCQuestObjective_PointsChangeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestObjective_PointsChangeResponse) ProtoMessage() {} -func (*CMsgGCQuestObjective_PointsChangeResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{23} -} - -func (m *CMsgGCQuestObjective_PointsChangeResponse) GetQuestItemId() uint64 { - if m != nil && m.QuestItemId != nil { - return *m.QuestItemId - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChangeResponse) GetStandardPoints() uint32 { - if m != nil && m.StandardPoints != nil { - return *m.StandardPoints - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChangeResponse) GetBonusPoints() uint32 { - if m != nil && m.BonusPoints != nil { - return *m.BonusPoints - } - return 0 -} - -func (m *CMsgGCQuestObjective_PointsChangeResponse) GetUpdateBasePoints() bool { - if m != nil && m.UpdateBasePoints != nil { - return *m.UpdateBasePoints - } - return false -} - -type CMsgGCQuestComplete_Request struct { - QuestItemId *uint64 `protobuf:"varint,1,opt,name=quest_item_id" json:"quest_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestComplete_Request) Reset() { *m = CMsgGCQuestComplete_Request{} } -func (m *CMsgGCQuestComplete_Request) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestComplete_Request) ProtoMessage() {} -func (*CMsgGCQuestComplete_Request) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{24} } - -func (m *CMsgGCQuestComplete_Request) GetQuestItemId() uint64 { - if m != nil && m.QuestItemId != nil { - return *m.QuestItemId - } - return 0 -} - -type CMsgGCQuestCompleted struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestCompleted) Reset() { *m = CMsgGCQuestCompleted{} } -func (m *CMsgGCQuestCompleted) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestCompleted) ProtoMessage() {} -func (*CMsgGCQuestCompleted) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{25} } - -type CMsgGCQuestObjective_RequestLoanerItems struct { - QuestItemId *uint64 `protobuf:"varint,1,opt,name=quest_item_id" json:"quest_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestObjective_RequestLoanerItems) Reset() { - *m = CMsgGCQuestObjective_RequestLoanerItems{} -} -func (m *CMsgGCQuestObjective_RequestLoanerItems) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestObjective_RequestLoanerItems) ProtoMessage() {} -func (*CMsgGCQuestObjective_RequestLoanerItems) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{26} -} - -func (m *CMsgGCQuestObjective_RequestLoanerItems) GetQuestItemId() uint64 { - if m != nil && m.QuestItemId != nil { - return *m.QuestItemId - } - return 0 -} - -type CMsgGCQuestObjective_RequestLoanerResponse struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestObjective_RequestLoanerResponse) Reset() { - *m = CMsgGCQuestObjective_RequestLoanerResponse{} -} -func (m *CMsgGCQuestObjective_RequestLoanerResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCQuestObjective_RequestLoanerResponse) ProtoMessage() {} -func (*CMsgGCQuestObjective_RequestLoanerResponse) Descriptor() ([]byte, []int) { - return econ_fileDescriptor0, []int{27} -} - -type CMsgCraftCollectionUpgrade struct { - ItemId []uint64 `protobuf:"varint,1,rep,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCraftCollectionUpgrade) Reset() { *m = CMsgCraftCollectionUpgrade{} } -func (m *CMsgCraftCollectionUpgrade) String() string { return proto.CompactTextString(m) } -func (*CMsgCraftCollectionUpgrade) ProtoMessage() {} -func (*CMsgCraftCollectionUpgrade) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{28} } - -func (m *CMsgCraftCollectionUpgrade) GetItemId() []uint64 { - if m != nil { - return m.ItemId - } - return nil -} - -type CMsgCraftHalloweenOffering struct { - ToolId *uint64 `protobuf:"varint,1,opt,name=tool_id" json:"tool_id,omitempty"` - ItemId []uint64 `protobuf:"varint,2,rep,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCraftHalloweenOffering) Reset() { *m = CMsgCraftHalloweenOffering{} } -func (m *CMsgCraftHalloweenOffering) String() string { return proto.CompactTextString(m) } -func (*CMsgCraftHalloweenOffering) ProtoMessage() {} -func (*CMsgCraftHalloweenOffering) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{29} } - -func (m *CMsgCraftHalloweenOffering) GetToolId() uint64 { - if m != nil && m.ToolId != nil { - return *m.ToolId - } - return 0 -} - -func (m *CMsgCraftHalloweenOffering) GetItemId() []uint64 { - if m != nil { - return m.ItemId - } - return nil -} - -type CMsgGCQuestDiscard_Request struct { - QuestItemId *uint64 `protobuf:"varint,1,opt,name=quest_item_id" json:"quest_item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCQuestDiscard_Request) Reset() { *m = CMsgGCQuestDiscard_Request{} } -func (m *CMsgGCQuestDiscard_Request) String() string { return proto.CompactTextString(m) } -func (*CMsgGCQuestDiscard_Request) ProtoMessage() {} -func (*CMsgGCQuestDiscard_Request) Descriptor() ([]byte, []int) { return econ_fileDescriptor0, []int{30} } - -func (m *CMsgGCQuestDiscard_Request) GetQuestItemId() uint64 { - if m != nil && m.QuestItemId != nil { - return *m.QuestItemId - } - return 0 -} - -func init() { - proto.RegisterType((*CMsgApplyAutograph)(nil), "CMsgApplyAutograph") - proto.RegisterType((*CMsgEconPlayerStrangeCountAdjustment)(nil), "CMsgEconPlayerStrangeCountAdjustment") - proto.RegisterType((*CMsgEconPlayerStrangeCountAdjustment_CStrangeCountAdjustment)(nil), "CMsgEconPlayerStrangeCountAdjustment.CStrangeCountAdjustment") - proto.RegisterType((*CMsgRequestItemPurgatory_FinalizePurchase)(nil), "CMsgRequestItemPurgatory_FinalizePurchase") - proto.RegisterType((*CMsgRequestItemPurgatory_FinalizePurchaseResponse)(nil), "CMsgRequestItemPurgatory_FinalizePurchaseResponse") - proto.RegisterType((*CMsgRequestItemPurgatory_RefundPurchase)(nil), "CMsgRequestItemPurgatory_RefundPurchase") - proto.RegisterType((*CMsgRequestItemPurgatory_RefundPurchaseResponse)(nil), "CMsgRequestItemPurgatory_RefundPurchaseResponse") - proto.RegisterType((*CMsgCraftingResponse)(nil), "CMsgCraftingResponse") - proto.RegisterType((*CMsgGCRequestStoreSalesData)(nil), "CMsgGCRequestStoreSalesData") - proto.RegisterType((*CMsgGCRequestStoreSalesDataResponse)(nil), "CMsgGCRequestStoreSalesDataResponse") - proto.RegisterType((*CMsgGCRequestStoreSalesDataResponse_Price)(nil), "CMsgGCRequestStoreSalesDataResponse.Price") - proto.RegisterType((*CMsgGCRequestStoreSalesDataUpToDateResponse)(nil), "CMsgGCRequestStoreSalesDataUpToDateResponse") - proto.RegisterType((*CMsgGCToGCPingRequest)(nil), "CMsgGCToGCPingRequest") - proto.RegisterType((*CMsgGCToGCPingResponse)(nil), "CMsgGCToGCPingResponse") - proto.RegisterType((*CMsgGCToGCGetUserSessionServer)(nil), "CMsgGCToGCGetUserSessionServer") - proto.RegisterType((*CMsgGCToGCGetUserSessionServerResponse)(nil), "CMsgGCToGCGetUserSessionServerResponse") - proto.RegisterType((*CMsgGCToGCGetUserServerMembers)(nil), "CMsgGCToGCGetUserServerMembers") - proto.RegisterType((*CMsgGCToGCGetUserServerMembersResponse)(nil), "CMsgGCToGCGetUserServerMembersResponse") - proto.RegisterType((*CMsgLookupMultipleAccountNames)(nil), "CMsgLookupMultipleAccountNames") - proto.RegisterType((*CMsgLookupMultipleAccountNamesResponse)(nil), "CMsgLookupMultipleAccountNamesResponse") - proto.RegisterType((*CMsgLookupMultipleAccountNamesResponse_Account)(nil), "CMsgLookupMultipleAccountNamesResponse.Account") - proto.RegisterType((*CMsgGCToGCGrantSelfMadeItemToAccount)(nil), "CMsgGCToGCGrantSelfMadeItemToAccount") - proto.RegisterType((*CMsgGCToGCThankedByNewUser)(nil), "CMsgGCToGCThankedByNewUser") - proto.RegisterType((*CMsgGCShuffleCrateContents)(nil), "CMsgGCShuffleCrateContents") - proto.RegisterType((*CMsgGCQuestObjective_Progress)(nil), "CMsgGCQuestObjective_Progress") - proto.RegisterType((*CMsgGCQuestObjective_PointsChange)(nil), "CMsgGCQuestObjective_PointsChange") - proto.RegisterType((*CMsgGCQuestObjective_PointsChangeResponse)(nil), "CMsgGCQuestObjective_PointsChangeResponse") - proto.RegisterType((*CMsgGCQuestComplete_Request)(nil), "CMsgGCQuestComplete_Request") - proto.RegisterType((*CMsgGCQuestCompleted)(nil), "CMsgGCQuestCompleted") - proto.RegisterType((*CMsgGCQuestObjective_RequestLoanerItems)(nil), "CMsgGCQuestObjective_RequestLoanerItems") - proto.RegisterType((*CMsgGCQuestObjective_RequestLoanerResponse)(nil), "CMsgGCQuestObjective_RequestLoanerResponse") - proto.RegisterType((*CMsgCraftCollectionUpgrade)(nil), "CMsgCraftCollectionUpgrade") - proto.RegisterType((*CMsgCraftHalloweenOffering)(nil), "CMsgCraftHalloweenOffering") - proto.RegisterType((*CMsgGCQuestDiscard_Request)(nil), "CMsgGCQuestDiscard_Request") - proto.RegisterEnum("EGCItemMsg", EGCItemMsg_name, EGCItemMsg_value) - proto.RegisterEnum("EGCMsgResponse", EGCMsgResponse_name, EGCMsgResponse_value) - proto.RegisterEnum("EUnlockStyle", EUnlockStyle_name, EUnlockStyle_value) - proto.RegisterEnum("EItemPurgatoryResponse_Finalize", EItemPurgatoryResponse_Finalize_name, EItemPurgatoryResponse_Finalize_value) - proto.RegisterEnum("EItemPurgatoryResponse_Refund", EItemPurgatoryResponse_Refund_name, EItemPurgatoryResponse_Refund_value) -} - -var econ_fileDescriptor0 = []byte{ - // 3370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x59, 0x79, 0x74, 0x24, 0x45, - 0xfd, 0x27, 0xc9, 0x66, 0xa7, 0xa9, 0x6c, 0x76, 0x8b, 0x9e, 0xd9, 0x83, 0x2c, 0xcb, 0x31, 0x0b, - 0xbb, 0x4b, 0xd8, 0xcd, 0xfe, 0x76, 0xf9, 0xc9, 0x43, 0x14, 0x34, 0x99, 0x99, 0x64, 0xf7, 0x91, - 0x6c, 0xb2, 0x99, 0x84, 0xe5, 0xbf, 0xb1, 0xd3, 0x5d, 0x93, 0x69, 0xd2, 0xd3, 0x3d, 0xf4, 0x91, - 0x64, 0xfc, 0x0b, 0x50, 0x4e, 0x45, 0xc5, 0xeb, 0x3d, 0xc1, 0x1b, 0x39, 0xc4, 0x5b, 0x9f, 0x0a, - 0xde, 0x20, 0x87, 0xfa, 0x00, 0x05, 0xd4, 0xf7, 0x54, 0x10, 0xdf, 0x53, 0xee, 0x53, 0xd1, 0xbf, - 0xb8, 0xfc, 0x56, 0x55, 0x77, 0x4f, 0xd5, 0x4c, 0xcf, 0x64, 0xfe, 0xf0, 0x8f, 0x7d, 0x9b, 0xa9, - 0xfa, 0xd4, 0xf7, 0xbe, 0xaa, 0x1a, 0x6d, 0x26, 0xba, 0x63, 0x97, 0x16, 0xf5, 0x2a, 0xf1, 0x3c, - 0x6d, 0x91, 0x78, 0x23, 0x35, 0xd7, 0xf1, 0x9d, 0xa1, 0xb4, 0xe7, 0x13, 0xad, 0x2a, 0x2f, 0x66, - 0x0b, 0x48, 0xcd, 0x4d, 0x79, 0x8b, 0xa3, 0xb5, 0x9a, 0x55, 0x1f, 0x0d, 0x7c, 0x67, 0xd1, 0xd5, - 0x6a, 0x15, 0xf5, 0x44, 0x74, 0x82, 0x16, 0xfd, 0x28, 0x99, 0x3e, 0xa9, 0x96, 0x4c, 0x63, 0x5b, - 0xcf, 0xa9, 0x3d, 0x7b, 0xd6, 0xa9, 0x19, 0xb4, 0x81, 0x2f, 0x84, 0xab, 0xbd, 0x74, 0x35, 0xfb, - 0x6a, 0x0f, 0x3a, 0x9d, 0xd2, 0x29, 0x00, 0xe7, 0x19, 0x4b, 0xab, 0x13, 0xb7, 0xe8, 0xbb, 0x9a, - 0xbd, 0x48, 0x72, 0x4e, 0x60, 0xfb, 0xa3, 0xc6, 0x25, 0x81, 0xe7, 0x57, 0x89, 0xed, 0xab, 0x2a, - 0x42, 0x9a, 0xae, 0xd3, 0xc5, 0x88, 0xe4, 0xa0, 0xfa, 0x3e, 0x74, 0xa2, 0xc7, 0xd1, 0x25, 0xbe, - 0xa3, 0xc5, 0x78, 0x0f, 0xe8, 0xf7, 0xed, 0x19, 0x38, 0x78, 0xfe, 0x48, 0x37, 0xd4, 0x47, 0x72, - 0xc9, 0xeb, 0x43, 0xb3, 0x68, 0x6b, 0xae, 0xbd, 0x40, 0x64, 0x19, 0xfe, 0x28, 0xf9, 0xf5, 0x1a, - 0x09, 0x05, 0xda, 0x84, 0x52, 0x92, 0x7a, 0x4c, 0xea, 0xf8, 0xc8, 0xb6, 0x3e, 0x0a, 0xca, 0x9e, - 0x8f, 0xce, 0xa4, 0x32, 0xcd, 0x92, 0x4b, 0x03, 0xe2, 0xf9, 0x87, 0x01, 0x3f, 0x13, 0xb8, 0x8b, - 0x9a, 0xef, 0xb8, 0xf5, 0xd2, 0xb8, 0x69, 0x6b, 0x96, 0xf9, 0x7e, 0x02, 0x2b, 0x7a, 0x45, 0xf3, - 0x88, 0x8a, 0x91, 0x12, 0x52, 0xf4, 0x80, 0x47, 0x1f, 0x58, 0x2c, 0x87, 0x0e, 0x74, 0x7d, 0x7c, - 0x96, 0x78, 0x35, 0xc7, 0x06, 0x32, 0x1b, 0xd1, 0x7a, 0x97, 0x78, 0x81, 0xe5, 0x73, 0x41, 0xb3, - 0xe7, 0xa1, 0xdd, 0x6d, 0x89, 0xcc, 0x92, 0x72, 0x60, 0x1b, 0xb1, 0x04, 0x82, 0x4e, 0xcc, 0x91, - 0xd9, 0x51, 0xb4, 0xbf, 0xcb, 0xb3, 0x6d, 0xd9, 0xef, 0x41, 0x19, 0x4a, 0x22, 0xe7, 0x6a, 0x65, - 0xdf, 0xb4, 0x17, 0x63, 0x5c, 0xab, 0xb6, 0xef, 0x45, 0xdb, 0x29, 0x72, 0x22, 0x17, 0xb2, 0x2b, - 0x02, 0x1b, 0x52, 0xd4, 0x2c, 0xe2, 0xe5, 0x35, 0x5f, 0xa3, 0xc2, 0x2d, 0x13, 0xd7, 0x33, 0x1d, - 0x3b, 0xf4, 0x00, 0x50, 0xd0, 0x03, 0xd7, 0x25, 0xb6, 0x5e, 0x67, 0x2e, 0x18, 0xcc, 0xde, 0xd5, - 0x83, 0x76, 0x76, 0x20, 0x11, 0xf3, 0xbe, 0x00, 0x21, 0x0f, 0x16, 0x4b, 0x35, 0xd7, 0xd4, 0x09, - 0xe3, 0x3e, 0x70, 0x70, 0x78, 0xa4, 0x8b, 0x93, 0x23, 0x33, 0xf4, 0x84, 0x28, 0x0a, 0x63, 0xac, - 0x6e, 0x45, 0x9b, 0xc8, 0x6a, 0xcd, 0x74, 0x35, 0x1f, 0xd6, 0x4a, 0xbe, 0x59, 0x25, 0x3c, 0x00, - 0x86, 0xf6, 0xa0, 0x7e, 0x7e, 0x24, 0x52, 0xd7, 0x20, 0xe5, 0x50, 0xfc, 0x41, 0xd4, 0xcf, 0xf9, - 0x73, 0xd9, 0x8f, 0xa1, 0xb3, 0x3a, 0x08, 0x30, 0x5f, 0x9b, 0x73, 0xe0, 0xff, 0x86, 0x99, 0x5b, - 0xac, 0x91, 0x20, 0x02, 0x27, 0xbc, 0x15, 0x6d, 0xe6, 0x84, 0xe7, 0x9c, 0x89, 0xdc, 0x0c, 0x73, - 0x01, 0x63, 0x90, 0xdd, 0x86, 0xb6, 0x34, 0x6f, 0x70, 0xe2, 0xd9, 0xff, 0x47, 0x27, 0x37, 0x76, - 0x26, 0x88, 0x3f, 0xef, 0x41, 0x36, 0x41, 0x4d, 0x00, 0xca, 0x45, 0xe2, 0x02, 0xdf, 0xa4, 0x14, - 0x85, 0x60, 0xd9, 0xd5, 0xf9, 0x54, 0x2c, 0x3c, 0xc8, 0xea, 0xb1, 0x95, 0x12, 0x2b, 0x37, 0x11, - 0x89, 0xf5, 0xd9, 0xc9, 0x44, 0xc6, 0x14, 0x39, 0x45, 0xaa, 0x0b, 0xa0, 0x6f, 0x62, 0x6d, 0xd8, - 0x82, 0x36, 0x56, 0xb5, 0xd5, 0x92, 0x57, 0x23, 0xba, 0x4f, 0x63, 0xd3, 0x0b, 0x35, 0xcf, 0x25, - 0x0a, 0x24, 0x50, 0x8b, 0x05, 0x82, 0x5a, 0x56, 0x65, 0x4b, 0x25, 0x89, 0x78, 0x1f, 0x10, 0x39, - 0x97, 0x8b, 0x34, 0xe9, 0x38, 0x4b, 0x41, 0x6d, 0x0a, 0xe2, 0xda, 0xac, 0x59, 0x64, 0x94, 0xa3, - 0x8e, 0x68, 0x50, 0x29, 0x81, 0x7d, 0x24, 0x52, 0x14, 0xcb, 0x83, 0x63, 0xbd, 0xb8, 0x27, 0x7b, - 0x63, 0x0f, 0xe7, 0xdf, 0xfe, 0x68, 0xcc, 0x7f, 0x14, 0x29, 0x21, 0x09, 0x2f, 0x0c, 0xc7, 0xfd, - 0x23, 0xdd, 0x1d, 0x1d, 0x09, 0x17, 0x87, 0xf6, 0xa1, 0x54, 0xf8, 0xa7, 0x7a, 0x02, 0x3a, 0x3e, - 0x16, 0xa8, 0x51, 0xad, 0x6a, 0xa0, 0xb0, 0x63, 0x6b, 0xcc, 0x36, 0xc7, 0x67, 0x8f, 0xf2, 0x5a, - 0x1c, 0xda, 0x06, 0xaa, 0x9e, 0x5f, 0x24, 0x56, 0x79, 0x4a, 0x33, 0x08, 0xcd, 0xf2, 0x39, 0x27, - 0xa2, 0x05, 0xb6, 0x8d, 0xe2, 0xb6, 0x64, 0xda, 0x06, 0x59, 0x0d, 0x09, 0x4a, 0x3c, 0xb8, 0xb9, - 0x2f, 0x46, 0x43, 0x0d, 0x92, 0x73, 0x15, 0xcd, 0x5e, 0x22, 0xc6, 0x58, 0xfd, 0x08, 0x59, 0xa1, - 0x76, 0x57, 0x87, 0x90, 0x6a, 0x93, 0x95, 0x52, 0xe0, 0x35, 0x8c, 0x1c, 0x4b, 0x77, 0x32, 0xda, - 0xe2, 0x73, 0x7c, 0xf3, 0x3e, 0xa7, 0x3c, 0x15, 0x51, 0x2e, 0x56, 0x82, 0x72, 0xd9, 0x22, 0x50, - 0x4c, 0x7c, 0x28, 0xd2, 0xb6, 0x4f, 0xab, 0xbf, 0xba, 0x19, 0x0d, 0xea, 0x74, 0xa1, 0xa9, 0x09, - 0x6d, 0x43, 0x98, 0x11, 0xd3, 0x1d, 0x83, 0x40, 0x9c, 0xb9, 0x10, 0xe0, 0xa1, 0xee, 0xab, 0x68, - 0x07, 0x27, 0x77, 0x94, 0xe6, 0xc1, 0xf4, 0xc2, 0x25, 0x10, 0x37, 0xe6, 0x32, 0x29, 0xcd, 0xb8, - 0xd0, 0xcd, 0x20, 0x60, 0x29, 0x45, 0x96, 0x22, 0x4d, 0x14, 0x41, 0x05, 0xbe, 0xac, 0xf9, 0x40, - 0x6e, 0x21, 0xb4, 0x47, 0x6f, 0x94, 0xcd, 0x06, 0xb1, 0x7c, 0x8d, 0xe7, 0x3d, 0xa5, 0xe0, 0xac, - 0xd8, 0x51, 0x80, 0x03, 0x85, 0x75, 0x2c, 0xbe, 0x6f, 0xee, 0x41, 0xa7, 0x25, 0xb3, 0x76, 0x4c, - 0x50, 0x25, 0x57, 0xa1, 0xdd, 0xa7, 0x1d, 0x7b, 0x9a, 0x35, 0xbe, 0x66, 0x1b, 0x9a, 0x6b, 0x94, - 0x6a, 0x0c, 0x1f, 0xf2, 0x86, 0x76, 0xbb, 0xe0, 0xd8, 0x81, 0x17, 0xad, 0x76, 0x12, 0x41, 0x3d, - 0x0d, 0xa9, 0x41, 0xcd, 0xa0, 0xe6, 0x5a, 0x80, 0xb2, 0x1d, 0x1d, 0xe9, 0x87, 0x3d, 0xe5, 0xbc, - 0xfe, 0xb2, 0x66, 0x41, 0xfa, 0x5f, 0xdf, 0xc3, 0xdb, 0x56, 0x47, 0x29, 0xe3, 0xd8, 0xfd, 0xdf, - 0x48, 0x3b, 0x94, 0x28, 0x16, 0x15, 0x59, 0x81, 0x72, 0xb4, 0x5d, 0x10, 0x27, 0xe7, 0x54, 0x21, - 0x17, 0x00, 0x18, 0xd6, 0xb1, 0x36, 0x02, 0x64, 0xb7, 0xf0, 0xc6, 0xd3, 0x74, 0xca, 0x80, 0x36, - 0xb3, 0x3b, 0x51, 0xb9, 0x90, 0xdc, 0xa4, 0xa3, 0x81, 0xd1, 0x68, 0x12, 0xb4, 0x8b, 0x83, 0xec, - 0x5e, 0x34, 0xbc, 0x36, 0x85, 0xb8, 0x98, 0xee, 0xe3, 0xc1, 0xcb, 0x1a, 0x60, 0xce, 0xb1, 0x2c, - 0x0a, 0x76, 0xec, 0xf9, 0x1a, 0x0c, 0x4e, 0x46, 0x53, 0xcb, 0xa5, 0x5d, 0xf0, 0x02, 0x01, 0x7e, - 0x48, 0xb3, 0x2c, 0x67, 0x85, 0x10, 0x7b, 0xba, 0x5c, 0x26, 0x34, 0x80, 0x29, 0xdc, 0x77, 0x1c, - 0xab, 0x61, 0x66, 0x69, 0x0c, 0xa1, 0xe7, 0xcf, 0x8e, 0x72, 0x85, 0x09, 0x97, 0x37, 0x3d, 0x9d, - 0x7a, 0xa0, 0xb3, 0xad, 0x86, 0xef, 0xdc, 0x8f, 0x50, 0x61, 0x22, 0x47, 0xb5, 0x86, 0xb3, 0x90, - 0xdc, 0x1b, 0x96, 0x4a, 0x05, 0x46, 0x65, 0x0c, 0xbc, 0x81, 0x9f, 0x4d, 0xa9, 0x59, 0xb4, 0x23, - 0x5a, 0x2a, 0x12, 0xbf, 0x08, 0xb2, 0x58, 0xac, 0x52, 0xcc, 0x38, 0x9e, 0x49, 0xf5, 0xc1, 0xcf, - 0xa5, 0xa0, 0x36, 0x0f, 0x46, 0x18, 0x26, 0x3e, 0x7e, 0x3e, 0x05, 0x7e, 0xdd, 0x2c, 0xad, 0x45, - 0x66, 0xc1, 0x2f, 0xa4, 0xd4, 0x34, 0xda, 0x18, 0xed, 0xe5, 0x09, 0x75, 0x0e, 0x7e, 0x31, 0xa5, - 0x9e, 0x8e, 0x4e, 0x89, 0x16, 0x2f, 0x02, 0x9d, 0xcb, 0xf5, 0x9c, 0xa6, 0x57, 0x48, 0x31, 0x58, - 0xf0, 0x74, 0xd7, 0xac, 0x31, 0x56, 0x2f, 0xa5, 0x40, 0x0f, 0x1c, 0xa1, 0x68, 0x39, 0xa4, 0x92, - 0xe0, 0x97, 0x53, 0x90, 0xf3, 0xe9, 0x68, 0x79, 0xde, 0xb6, 0x1c, 0x7d, 0x89, 0x55, 0x0a, 0xfc, - 0x4a, 0x4a, 0x3d, 0x15, 0x6d, 0x4f, 0xd8, 0x89, 0xa5, 0x79, 0x35, 0x05, 0x95, 0xee, 0x84, 0x08, - 0x31, 0xa3, 0x41, 0xf4, 0x31, 0x9a, 0xff, 0x4c, 0x41, 0x71, 0x3a, 0xb1, 0x65, 0x3d, 0x3e, 0xf7, - 0x2f, 0xc9, 0x32, 0x13, 0x8e, 0x65, 0x10, 0xfb, 0x18, 0x1d, 0x49, 0x2a, 0x63, 0xae, 0xa3, 0x19, - 0xba, 0xe6, 0xf9, 0xf8, 0x35, 0x49, 0xae, 0xa9, 0xe9, 0xb9, 0x7c, 0xe8, 0x0d, 0xfc, 0x6f, 0x49, - 0x2e, 0x61, 0x27, 0xa6, 0xff, 0x9f, 0x14, 0xf4, 0xa6, 0x8c, 0xa8, 0x2a, 0x75, 0x08, 0x13, 0xed, - 0xf5, 0x14, 0xe4, 0xf2, 0x49, 0x49, 0x5b, 0xf1, 0xe9, 0x37, 0x52, 0xea, 0x1e, 0xb4, 0x33, 0x82, - 0xcc, 0x92, 0xaa, 0xb3, 0x4c, 0x8a, 0xa0, 0x3b, 0x61, 0x4a, 0x94, 0xf2, 0x85, 0x99, 0xd9, 0x42, - 0x6e, 0x74, 0xae, 0x90, 0xc7, 0x6f, 0xa6, 0xd4, 0xff, 0x43, 0x67, 0xb5, 0x43, 0x46, 0x04, 0xc5, - 0x13, 0x6f, 0x49, 0xec, 0x73, 0x30, 0xf7, 0x3a, 0x55, 0x18, 0x47, 0x59, 0xf7, 0x20, 0xab, 0x7e, - 0xe0, 0x12, 0xfc, 0x76, 0x4a, 0x3d, 0x13, 0x9d, 0xde, 0x09, 0x12, 0x4b, 0x7a, 0x99, 0xa2, 0x6e, - 0x47, 0x5b, 0x62, 0x0f, 0x45, 0x7a, 0x70, 0x33, 0x5d, 0xae, 0xa8, 0x27, 0xa1, 0xad, 0x2d, 0x9b, - 0xe1, 0xd1, 0x2b, 0x14, 0xf5, 0x0c, 0x74, 0x6a, 0x43, 0x74, 0xaf, 0xa6, 0xad, 0xd8, 0x10, 0x96, - 0x34, 0x0f, 0x0d, 0x27, 0xf0, 0x79, 0xb9, 0xc2, 0x57, 0x4a, 0x1c, 0xb8, 0x86, 0x94, 0x0e, 0x35, - 0x1c, 0xbe, 0x4a, 0xe2, 0xd0, 0xd8, 0x64, 0x0e, 0xc7, 0x57, 0x2b, 0xa2, 0x13, 0x26, 0xcc, 0xb2, - 0x7f, 0x0c, 0x2e, 0x3d, 0xcc, 0x09, 0xd7, 0x28, 0xa2, 0x15, 0xc4, 0xad, 0x58, 0xbe, 0x6b, 0x15, - 0xd1, 0xfd, 0x10, 0xe8, 0x50, 0x2a, 0x5c, 0x8a, 0xc4, 0xd7, 0x29, 0xa2, 0x7b, 0x84, 0x9d, 0xe8, - 0xec, 0x2c, 0xd1, 0x09, 0x5d, 0xc3, 0x1f, 0x56, 0xc4, 0x30, 0x9c, 0xb7, 0x57, 0x80, 0x09, 0x07, - 0x72, 0x0b, 0x5d, 0xaf, 0xa8, 0xa7, 0xa0, 0xa1, 0xa4, 0xfd, 0x50, 0x88, 0x8f, 0x48, 0x2a, 0x14, - 0xb9, 0x5b, 0x8b, 0x7e, 0xdd, 0x22, 0xf8, 0xa3, 0x32, 0x6d, 0x8f, 0x18, 0x39, 0x4b, 0x33, 0xab, - 0x39, 0x87, 0x8f, 0x02, 0xf8, 0x63, 0x8a, 0x98, 0x1a, 0x45, 0xc7, 0x65, 0x67, 0x3d, 0x7c, 0x83, - 0xa2, 0x0e, 0xa3, 0x33, 0xa2, 0x75, 0xa8, 0x30, 0xcb, 0x8e, 0xb5, 0x0c, 0x75, 0x01, 0x66, 0x16, - 0x7f, 0xd2, 0x84, 0x12, 0x23, 0x04, 0xcb, 0xc7, 0x15, 0xb1, 0x10, 0xf0, 0xa9, 0x26, 0x9c, 0x30, - 0xf0, 0x27, 0x14, 0x31, 0x85, 0xa4, 0xbd, 0x58, 0xfc, 0x4f, 0x4a, 0x32, 0x4a, 0x18, 0xe6, 0xbf, - 0x4f, 0x29, 0xea, 0x2e, 0x74, 0x5a, 0xdb, 0xfd, 0x98, 0xce, 0xa7, 0x15, 0x75, 0x07, 0xda, 0x16, - 0xeb, 0xca, 0x1a, 0x0e, 0xb3, 0x04, 0x94, 0x98, 0xaa, 0x86, 0x3f, 0xa3, 0x88, 0xe5, 0x27, 0xba, - 0xf5, 0xd8, 0xf4, 0xea, 0x07, 0x37, 0x1e, 0xb8, 0xf0, 0xc0, 0x74, 0x50, 0xc1, 0x37, 0x2a, 0x62, - 0xd6, 0xf2, 0x60, 0xe1, 0xc1, 0x1d, 0x05, 0xfe, 0x4d, 0x4a, 0x6b, 0xde, 0x49, 0x88, 0x58, 0xa0, - 0xcf, 0x4a, 0x02, 0x71, 0xe4, 0x94, 0xb6, 0x04, 0xa3, 0xda, 0x94, 0xe6, 0x2e, 0xe1, 0xcf, 0x35, - 0xc5, 0xb6, 0xbc, 0x1d, 0x53, 0xf9, 0xbc, 0xa2, 0xee, 0x44, 0x27, 0xcb, 0xb0, 0x79, 0xdb, 0x04, - 0xf1, 0x59, 0xcd, 0x3d, 0x4c, 0xe7, 0x14, 0xfc, 0x05, 0x45, 0x3d, 0x0b, 0xed, 0xea, 0x0c, 0x8a, - 0x29, 0x7e, 0x51, 0xca, 0x96, 0xa2, 0xb6, 0xba, 0x5a, 0x6f, 0x14, 0xb4, 0x2f, 0x49, 0x41, 0x3f, - 0xa6, 0xe9, 0x4b, 0x35, 0xf8, 0x47, 0x23, 0x03, 0x2e, 0xa5, 0xa6, 0x57, 0x21, 0x06, 0xfe, 0xb2, - 0x64, 0x49, 0x7e, 0x95, 0xa6, 0x86, 0x2e, 0x5c, 0x1a, 0x98, 0xb5, 0x1a, 0x31, 0x8a, 0x3e, 0xad, - 0xcb, 0x37, 0x4b, 0xa9, 0x11, 0x36, 0x47, 0x16, 0x74, 0xb7, 0x48, 0x76, 0xa1, 0x4b, 0xa3, 0xfa, - 0x92, 0xed, 0xac, 0x58, 0xc4, 0x58, 0x04, 0xf2, 0xb7, 0x2a, 0x62, 0x65, 0x99, 0x01, 0xb7, 0x10, - 0xdf, 0x2b, 0xc1, 0x04, 0x0b, 0xe7, 0xf9, 0xaf, 0x71, 0xc7, 0x85, 0x30, 0xf6, 0x3c, 0x7c, 0x9b, - 0x24, 0x49, 0x03, 0xea, 0x4b, 0xdd, 0xeb, 0x76, 0x29, 0x3f, 0x20, 0x98, 0x6b, 0xa0, 0xcd, 0xe8, - 0x02, 0x0c, 0x90, 0xf8, 0xab, 0x92, 0xb6, 0xe2, 0x56, 0x6c, 0xad, 0x3b, 0x14, 0x75, 0x04, 0x9d, - 0xd9, 0x8d, 0x38, 0x70, 0xda, 0xaa, 0xe3, 0xaf, 0x29, 0xcd, 0xa5, 0x9b, 0x55, 0x22, 0xc7, 0x37, - 0xcb, 0xa6, 0xce, 0x2e, 0x70, 0xf8, 0xeb, 0x52, 0x44, 0xe7, 0x2c, 0x13, 0x62, 0x10, 0x9a, 0x79, - 0xcd, 0xd2, 0xea, 0x12, 0xee, 0x1b, 0x92, 0xa1, 0xd8, 0x13, 0x4d, 0xf8, 0x88, 0x31, 0xa3, 0xb9, - 0x3e, 0xfe, 0xa6, 0x64, 0xa8, 0xd2, 0x61, 0x5b, 0x77, 0x09, 0x7d, 0x9f, 0xb8, 0xd0, 0xb4, 0x2c, - 0xfe, 0xca, 0xc1, 0x46, 0xd9, 0x00, 0x9c, 0xf1, 0x2d, 0x29, 0x68, 0x13, 0xa0, 0xb1, 0xba, 0xdf, - 0x96, 0xb2, 0x31, 0x6c, 0x16, 0x02, 0xd3, 0xef, 0x48, 0xd5, 0x68, 0x96, 0xea, 0x1f, 0x6e, 0x17, - 0x75, 0xb8, 0xd4, 0x7a, 0xf8, 0xbb, 0x92, 0xdf, 0x69, 0xa1, 0x22, 0x06, 0x2f, 0x2a, 0xdf, 0x6b, - 0x55, 0x27, 0x9c, 0x94, 0x72, 0x30, 0xc6, 0xe0, 0xef, 0x27, 0x70, 0x16, 0xf7, 0x7f, 0x20, 0x87, - 0x9d, 0x60, 0x0d, 0x90, 0x02, 0x14, 0x65, 0xa3, 0x17, 0xfe, 0xa1, 0x84, 0xe2, 0xb6, 0x0d, 0x93, - 0x9d, 0xa6, 0x15, 0xf1, 0xe9, 0x8d, 0x1b, 0xdf, 0xa9, 0xa8, 0x7b, 0xd1, 0xee, 0x35, 0x50, 0xb1, - 0x4d, 0xee, 0x92, 0x54, 0x62, 0x9c, 0x2f, 0x06, 0x2f, 0x41, 0xed, 0xfe, 0x91, 0x54, 0x2e, 0x84, - 0x9d, 0xf8, 0xec, 0x8f, 0x65, 0xcb, 0xcf, 0xb9, 0x90, 0x4d, 0x3c, 0x33, 0xf9, 0x43, 0x16, 0x74, - 0x21, 0xb7, 0x40, 0x8b, 0x10, 0xfe, 0x89, 0x54, 0x73, 0xc7, 0x03, 0xab, 0x0c, 0xce, 0xc9, 0xd7, - 0x6d, 0x98, 0xef, 0x75, 0x68, 0x16, 0x66, 0x8d, 0xd0, 0x39, 0xd7, 0xb1, 0x29, 0xf6, 0xa7, 0x8a, - 0x7a, 0x10, 0xed, 0xeb, 0x0a, 0x1b, 0x4b, 0xf2, 0x33, 0x49, 0x92, 0x30, 0x49, 0x0a, 0x30, 0x7c, - 0xea, 0x3e, 0x0c, 0x63, 0x3e, 0x04, 0x9d, 0x05, 0xa3, 0x28, 0xf8, 0x13, 0xff, 0x5c, 0x8a, 0x4f, - 0x40, 0x1e, 0xd2, 0x7c, 0x0e, 0x84, 0x0e, 0x72, 0x88, 0x68, 0xc6, 0xb4, 0x6b, 0x2e, 0x9a, 0x36, - 0xfe, 0x85, 0x14, 0x0b, 0x8c, 0x1c, 0x64, 0x3e, 0xe8, 0xae, 0x57, 0x34, 0x77, 0x11, 0xcc, 0x73, - 0xb7, 0xa2, 0xee, 0x46, 0xd9, 0xf6, 0x80, 0x58, 0xb6, 0x7b, 0x5a, 0xed, 0x18, 0x0d, 0x3c, 0xa1, - 0xa5, 0x7f, 0x29, 0x55, 0x4b, 0x86, 0x60, 0x49, 0x07, 0x06, 0xb5, 0xbd, 0x2a, 0xdc, 0xed, 0x38, - 0xec, 0x5e, 0x49, 0x49, 0x06, 0x8b, 0x07, 0xed, 0x62, 0x8d, 0x58, 0xd6, 0x02, 0xf4, 0x8f, 0x19, - 0x0d, 0x66, 0x86, 0xfb, 0x12, 0xaa, 0x33, 0x4d, 0x07, 0x88, 0x29, 0xa2, 0x2d, 0xe1, 0xfb, 0x13, - 0xaa, 0x73, 0x63, 0x3b, 0x16, 0xfc, 0x01, 0x29, 0xdc, 0xe6, 0xc6, 0x81, 0x87, 0x4e, 0x13, 0x98, - 0x4a, 0xde, 0x28, 0xaa, 0xbf, 0x92, 0xdc, 0xd5, 0x29, 0x53, 0x4b, 0xd1, 0x7b, 0x00, 0xfe, 0xb5, - 0x24, 0x40, 0xc2, 0x00, 0x31, 0xc1, 0xa6, 0x87, 0xdf, 0x48, 0x6a, 0x34, 0x95, 0x3e, 0x0f, 0x3f, - 0x28, 0x79, 0xa0, 0xfd, 0x93, 0x03, 0x7e, 0x48, 0x51, 0xf7, 0xa3, 0xe1, 0xb5, 0x81, 0xb1, 0xe6, - 0x0f, 0x4b, 0x49, 0x01, 0x6e, 0x30, 0x60, 0x3e, 0x60, 0x37, 0x8a, 0xc7, 0x07, 0xc4, 0xba, 0x14, - 0xee, 0x80, 0xd2, 0x20, 0x12, 0x78, 0x9f, 0xfe, 0x26, 0xd1, 0x6c, 0xf3, 0xc4, 0x80, 0x18, 0xf3, - 0x6d, 0xa0, 0x21, 0xc3, 0xbf, 0x0e, 0x88, 0x85, 0x35, 0xc2, 0x42, 0xb3, 0x71, 0xfd, 0xf0, 0x25, - 0x0a, 0x3f, 0x39, 0x20, 0x8e, 0x1b, 0x31, 0x84, 0xef, 0xe6, 0x2c, 0x07, 0xe6, 0x1f, 0xfc, 0x54, - 0x22, 0x26, 0xa7, 0xd9, 0x3a, 0xb1, 0x22, 0x3a, 0x4f, 0x0f, 0xa8, 0x07, 0xd0, 0xde, 0x6e, 0x34, - 0x88, 0xa5, 0x7b, 0x5e, 0x52, 0x9a, 0xbf, 0x44, 0x41, 0x00, 0xac, 0xd0, 0x57, 0x8a, 0x71, 0x6d, - 0xd9, 0x71, 0xe1, 0x52, 0xc6, 0x57, 0xf1, 0xdd, 0x1b, 0x44, 0xa5, 0x65, 0xe8, 0x98, 0x05, 0xf5, - 0xc1, 0x82, 0x09, 0x2b, 0xc4, 0xde, 0xb3, 0x41, 0x2c, 0x8a, 0xd1, 0x53, 0x9b, 0xed, 0xc3, 0x5d, - 0x9e, 0xd9, 0xfa, 0x2b, 0x83, 0xe2, 0x74, 0xc0, 0x7c, 0xef, 0x92, 0x65, 0x93, 0xac, 0xe4, 0x2a, - 0x04, 0xda, 0x36, 0x74, 0xe2, 0xc0, 0xc3, 0xb7, 0x0c, 0x8a, 0xf9, 0x2c, 0x80, 0xf8, 0x7e, 0xac, - 0xc3, 0xad, 0x83, 0xcd, 0xf9, 0x1c, 0xe2, 0x22, 0x77, 0xdd, 0x36, 0xd8, 0x9c, 0xcf, 0x32, 0x20, - 0xa6, 0x74, 0xfb, 0xa0, 0x28, 0xb6, 0x00, 0x2c, 0xd0, 0x67, 0x4c, 0xe8, 0xbb, 0x83, 0xa2, 0x09, - 0x5a, 0xf6, 0xa5, 0x2e, 0x78, 0xc7, 0xa0, 0xd8, 0x80, 0x05, 0x2c, 0xcb, 0x31, 0x27, 0x58, 0xac, - 0xf8, 0x72, 0x77, 0x95, 0xb4, 0xc8, 0x93, 0xe5, 0xd2, 0x11, 0x8e, 0x8d, 0xb4, 0x78, 0x64, 0x93, - 0xa8, 0x45, 0x2b, 0x20, 0xd6, 0xe2, 0xd1, 0x4d, 0x72, 0x0a, 0x2e, 0x97, 0xf2, 0x64, 0x21, 0x58, - 0x9c, 0x85, 0x59, 0x86, 0x0e, 0xc2, 0x11, 0xbd, 0xc7, 0x36, 0x49, 0x29, 0x48, 0xdf, 0x76, 0xc3, - 0x07, 0x49, 0xd6, 0x6b, 0xee, 0x4d, 0x8b, 0x54, 0x9a, 0xb7, 0x63, 0x66, 0xf7, 0xa5, 0xa5, 0x00, - 0xa2, 0xb0, 0xe8, 0xfd, 0x9d, 0x06, 0x9e, 0x38, 0x71, 0xdf, 0x9f, 0x16, 0xc3, 0xb3, 0x05, 0x9a, - 0x74, 0xa3, 0x7b, 0x20, 0x2d, 0xdd, 0xf2, 0xc5, 0x23, 0xd1, 0xc7, 0x06, 0xfc, 0xbb, 0xb4, 0x14, - 0x97, 0x49, 0x98, 0x58, 0xda, 0x47, 0xd2, 0x62, 0xc1, 0x96, 0xb0, 0x3c, 0x95, 0xf0, 0xa3, 0x69, - 0xa9, 0xdd, 0xb4, 0x22, 0x62, 0x5a, 0x8f, 0xb5, 0x97, 0xed, 0x68, 0x40, 0xdc, 0xfa, 0xdc, 0xaa, - 0x8d, 0x1f, 0x6c, 0x2f, 0x5b, 0x84, 0x89, 0xe9, 0x3d, 0x94, 0x96, 0x72, 0xa6, 0xd9, 0x3c, 0xf8, - 0xe1, 0xb4, 0xd4, 0xde, 0xda, 0x99, 0x0f, 0xff, 0x56, 0xa2, 0x43, 0x1f, 0x3e, 0xf3, 0xa6, 0xeb, - 0xd7, 0x8b, 0xf9, 0x69, 0xf6, 0x6c, 0x81, 0x7f, 0x2f, 0xd1, 0x89, 0xf7, 0xa3, 0xaa, 0x19, 0xe3, - 0xfe, 0x20, 0xe9, 0x47, 0x71, 0xfc, 0x72, 0x52, 0x3c, 0x3a, 0x79, 0x21, 0xa9, 0x5f, 0xa4, 0x59, - 0x01, 0xc1, 0x7f, 0x94, 0xac, 0x45, 0x31, 0x71, 0xf7, 0xc8, 0x81, 0x30, 0x8e, 0x45, 0x1b, 0x7a, - 0x55, 0xb3, 0x0d, 0xfc, 0xa7, 0xb4, 0x58, 0x06, 0x79, 0x45, 0xb8, 0x88, 0x7f, 0x2d, 0xe0, 0x64, - 0x0d, 0xfc, 0xe7, 0xb4, 0x38, 0xe0, 0xcb, 0x9f, 0xf6, 0xf0, 0x5f, 0xa4, 0x70, 0xa4, 0x9c, 0x8e, - 0x91, 0x85, 0xd1, 0x99, 0xc3, 0x61, 0x91, 0xe7, 0x37, 0x6a, 0x03, 0x3f, 0x2e, 0xb1, 0x09, 0x43, - 0x7d, 0xd4, 0xb6, 0x01, 0xa3, 0xb3, 0xde, 0xe5, 0xe1, 0x27, 0xa4, 0x88, 0x4d, 0x82, 0x34, 0x6a, - 0x77, 0x5a, 0xee, 0xa6, 0x0c, 0x3a, 0x03, 0xed, 0xbb, 0x16, 0x5e, 0x39, 0xd9, 0x2b, 0x35, 0x7e, - 0x52, 0x62, 0xca, 0xc7, 0xb2, 0x26, 0xdd, 0xfe, 0x96, 0x16, 0x6f, 0x3a, 0x9d, 0x3f, 0x9b, 0xe1, - 0xbf, 0xa7, 0xd5, 0xb3, 0xd1, 0x48, 0x77, 0xe0, 0x58, 0xd6, 0x7f, 0x48, 0x6a, 0x75, 0xfa, 0x2e, - 0x86, 0x9f, 0x92, 0x12, 0xb1, 0x9b, 0x4f, 0x68, 0xf8, 0xe9, 0xb4, 0x58, 0xcd, 0xd8, 0xd7, 0x99, - 0x0e, 0x1f, 0x34, 0x3d, 0xfc, 0x8c, 0x14, 0x3c, 0x89, 0xdf, 0x8f, 0xf0, 0xb3, 0x52, 0x72, 0x74, - 0xfc, 0xc8, 0x85, 0x9f, 0x4b, 0x8b, 0xa3, 0x48, 0x57, 0xdf, 0xa3, 0xf0, 0xf3, 0x69, 0xf1, 0x05, - 0xa5, 0xe9, 0x53, 0x13, 0x7e, 0x21, 0x2d, 0x96, 0xbf, 0xe6, 0xef, 0x4d, 0xf8, 0xc5, 0x96, 0x78, - 0x4b, 0xfa, 0x7c, 0x84, 0x5f, 0x4a, 0xab, 0xfb, 0xd0, 0x9e, 0xb5, 0x60, 0x31, 0xd5, 0x97, 0xdb, - 0x53, 0x15, 0xbe, 0x01, 0xe1, 0x57, 0xda, 0x53, 0x4d, 0xf8, 0x54, 0x84, 0x5f, 0x95, 0x82, 0xab, - 0xf3, 0xd7, 0x13, 0xfc, 0xba, 0x14, 0xac, 0x49, 0xdf, 0x45, 0xf0, 0x1b, 0x72, 0xae, 0x26, 0x7c, - 0xe0, 0xc0, 0x6f, 0xa6, 0xc5, 0x01, 0xb2, 0xcd, 0x47, 0x0b, 0xfc, 0x96, 0x94, 0xd1, 0xf2, 0xa3, - 0x37, 0x7e, 0xbb, 0x35, 0xdd, 0xf3, 0x81, 0xbe, 0x34, 0xe7, 0x2c, 0x11, 0x1b, 0x5f, 0x96, 0x11, - 0xe3, 0x27, 0xf1, 0x91, 0x1d, 0x5f, 0x9e, 0x11, 0x8b, 0x4f, 0x87, 0xef, 0x02, 0xf8, 0x8a, 0x8c, - 0xf8, 0x94, 0xd8, 0xc5, 0x17, 0x04, 0xfc, 0x81, 0x8c, 0x18, 0xef, 0x6b, 0x3e, 0xcb, 0xe3, 0x0f, - 0x66, 0xc4, 0x94, 0xea, 0xe6, 0x11, 0x1e, 0x5f, 0x99, 0x11, 0xeb, 0xb0, 0x78, 0x31, 0x64, 0xd9, - 0xc4, 0x6e, 0x08, 0x65, 0xf0, 0xc6, 0x55, 0x19, 0x71, 0x56, 0x4a, 0x7e, 0xb3, 0xc7, 0x57, 0xb7, - 0x82, 0x5a, 0x5e, 0xea, 0xf1, 0x35, 0x19, 0xd1, 0xaf, 0x49, 0x8f, 0xf1, 0xf8, 0xda, 0x4c, 0xeb, - 0x93, 0x24, 0xbf, 0x0c, 0x8f, 0xd5, 0xf1, 0x75, 0x99, 0xd6, 0x37, 0x9d, 0x68, 0x33, 0x56, 0xeb, - 0x43, 0x99, 0xe1, 0x9b, 0x7a, 0xd1, 0xc6, 0xc2, 0x04, 0xff, 0x4a, 0x1f, 0x7e, 0x91, 0xd9, 0x82, - 0x54, 0x38, 0x27, 0xad, 0x4d, 0x5f, 0x88, 0x8f, 0x53, 0x87, 0x18, 0x33, 0x69, 0x3d, 0x4f, 0x6c, - 0x13, 0xc2, 0xa3, 0x07, 0xc6, 0xa1, 0xed, 0xcd, 0x7b, 0x3c, 0xfe, 0x0b, 0xae, 0xeb, 0xb8, 0xb8, - 0x17, 0x24, 0xdd, 0xda, 0x0c, 0x98, 0x33, 0xab, 0xc4, 0x09, 0x7c, 0xdc, 0x97, 0xb4, 0x79, 0xd8, - 0x5e, 0x86, 0xda, 0x69, 0xe0, 0x75, 0x49, 0x9b, 0x47, 0x9c, 0x29, 0xcd, 0xd7, 0x2b, 0xb8, 0x1f, - 0x26, 0x84, 0x93, 0x9a, 0x37, 0xe7, 0x6d, 0xfa, 0xd2, 0x63, 0x73, 0xc6, 0xeb, 0x93, 0x24, 0x83, - 0x59, 0x6e, 0xd2, 0x59, 0x84, 0x16, 0x34, 0x6d, 0xe3, 0x94, 0xa8, 0xd6, 0xb8, 0x66, 0x5a, 0xc4, - 0x98, 0x73, 0x72, 0x70, 0x01, 0xf3, 0x09, 0x56, 0x86, 0x6f, 0xe8, 0x45, 0x1b, 0x0a, 0xfc, 0xc1, - 0x9f, 0xbd, 0x76, 0x72, 0x61, 0x84, 0x85, 0x52, 0x31, 0xd0, 0x75, 0x42, 0x0c, 0x30, 0xc2, 0x71, - 0x9c, 0x95, 0xb8, 0xc9, 0xe9, 0x41, 0x8e, 0xd1, 0x59, 0x1e, 0xac, 0xb4, 0x93, 0xa6, 0x61, 0x02, - 0x00, 0xa6, 0x15, 0x7f, 0xb4, 0x5c, 0x76, 0x5c, 0x03, 0x2c, 0xd5, 0x09, 0x44, 0x3b, 0xb4, 0x49, - 0x2d, 0xb6, 0x8b, 0x4e, 0x97, 0x6d, 0x40, 0x93, 0xf4, 0xf3, 0x04, 0x1b, 0x0b, 0xd6, 0x41, 0x9b, - 0x39, 0x63, 0x0d, 0x8e, 0xfc, 0x5e, 0x08, 0xa6, 0xec, 0x44, 0x92, 0x43, 0x27, 0x48, 0x15, 0xaf, - 0x1f, 0x7e, 0xad, 0x17, 0x9d, 0x52, 0x90, 0x1a, 0x51, 0x3c, 0x0d, 0x46, 0x0d, 0x0f, 0xf2, 0x11, - 0xee, 0x79, 0x9d, 0x31, 0x92, 0xe5, 0xce, 0x41, 0x07, 0xd7, 0xc4, 0x87, 0xe2, 0xc0, 0xcd, 0x36, - 0x2c, 0x2e, 0x60, 0xd0, 0xf7, 0xa0, 0x77, 0x75, 0x7d, 0x8e, 0xe6, 0x3e, 0x78, 0xfe, 0xb0, 0x1d, - 0x63, 0xc1, 0xd8, 0xe7, 0xa3, 0x77, 0x76, 0x4b, 0x00, 0x32, 0xdd, 0x32, 0x80, 0x00, 0xac, 0x87, - 0xaf, 0x4d, 0x7d, 0xea, 0x3b, 0xd0, 0x81, 0x6e, 0x8f, 0x1f, 0x71, 0x8a, 0xd3, 0x91, 0x57, 0x0e, - 0xd0, 0xf6, 0xb8, 0xc6, 0xb1, 0xe8, 0x5d, 0x74, 0x3c, 0xb0, 0x2c, 0xdc, 0x3f, 0xfc, 0x4c, 0x2f, - 0xda, 0xd1, 0xc6, 0xea, 0x7c, 0x0c, 0x50, 0xf7, 0xd2, 0x2e, 0xd4, 0x09, 0x21, 0x59, 0xfc, 0xdd, - 0xe8, 0xdc, 0x35, 0xd0, 0x82, 0xdd, 0x9a, 0xcc, 0xd6, 0xa3, 0x9e, 0x87, 0xce, 0xe9, 0xee, 0x74, - 0xb3, 0xd1, 0xc0, 0xe4, 0x67, 0xa3, 0xfd, 0xdd, 0x9d, 0x6d, 0x58, 0xac, 0x0f, 0x06, 0x8a, 0x91, - 0x6e, 0x0f, 0xe5, 0x89, 0x0f, 0x7f, 0x82, 0x95, 0x3b, 0x38, 0xa7, 0xe9, 0x0c, 0x59, 0x75, 0x6c, - 0x3e, 0xa2, 0xe2, 0xfe, 0xb1, 0xfe, 0x43, 0x3d, 0x97, 0xf5, 0x1c, 0xf7, 0xdf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xfd, 0x1b, 0xe7, 0xaa, 0xe2, 0x26, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/gcsdk.pb.go b/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/gcsdk.pb.go deleted file mode 100644 index 028bf5b3..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/gcsdk.pb.go +++ /dev/null @@ -1,1139 +0,0 @@ -// Code generated by protoc-gen-go. -// source: gcsdk_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type PartnerAccountType int32 - -const ( - PartnerAccountType_PARTNER_NONE PartnerAccountType = 0 - PartnerAccountType_PARTNER_PERFECT_WORLD PartnerAccountType = 1 - PartnerAccountType_PARTNER_NEXON PartnerAccountType = 2 -) - -var PartnerAccountType_name = map[int32]string{ - 0: "PARTNER_NONE", - 1: "PARTNER_PERFECT_WORLD", - 2: "PARTNER_NEXON", -} -var PartnerAccountType_value = map[string]int32{ - "PARTNER_NONE": 0, - "PARTNER_PERFECT_WORLD": 1, - "PARTNER_NEXON": 2, -} - -func (x PartnerAccountType) Enum() *PartnerAccountType { - p := new(PartnerAccountType) - *p = x - return p -} -func (x PartnerAccountType) String() string { - return proto.EnumName(PartnerAccountType_name, int32(x)) -} -func (x *PartnerAccountType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PartnerAccountType_value, data, "PartnerAccountType") - if err != nil { - return err - } - *x = PartnerAccountType(value) - return nil -} -func (PartnerAccountType) EnumDescriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{0} } - -type GCConnectionStatus int32 - -const ( - GCConnectionStatus_GCConnectionStatus_HAVE_SESSION GCConnectionStatus = 0 - GCConnectionStatus_GCConnectionStatus_GC_GOING_DOWN GCConnectionStatus = 1 - GCConnectionStatus_GCConnectionStatus_NO_SESSION GCConnectionStatus = 2 - GCConnectionStatus_GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE GCConnectionStatus = 3 - GCConnectionStatus_GCConnectionStatus_NO_STEAM GCConnectionStatus = 4 - GCConnectionStatus_GCConnectionStatus_SUSPENDED GCConnectionStatus = 5 -) - -var GCConnectionStatus_name = map[int32]string{ - 0: "GCConnectionStatus_HAVE_SESSION", - 1: "GCConnectionStatus_GC_GOING_DOWN", - 2: "GCConnectionStatus_NO_SESSION", - 3: "GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE", - 4: "GCConnectionStatus_NO_STEAM", - 5: "GCConnectionStatus_SUSPENDED", -} -var GCConnectionStatus_value = map[string]int32{ - "GCConnectionStatus_HAVE_SESSION": 0, - "GCConnectionStatus_GC_GOING_DOWN": 1, - "GCConnectionStatus_NO_SESSION": 2, - "GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE": 3, - "GCConnectionStatus_NO_STEAM": 4, - "GCConnectionStatus_SUSPENDED": 5, -} - -func (x GCConnectionStatus) Enum() *GCConnectionStatus { - p := new(GCConnectionStatus) - *p = x - return p -} -func (x GCConnectionStatus) String() string { - return proto.EnumName(GCConnectionStatus_name, int32(x)) -} -func (x *GCConnectionStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(GCConnectionStatus_value, data, "GCConnectionStatus") - if err != nil { - return err - } - *x = GCConnectionStatus(value) - return nil -} -func (GCConnectionStatus) EnumDescriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{1} } - -type CMsgSOIDOwner struct { - Type *uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - Id *uint64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOIDOwner) Reset() { *m = CMsgSOIDOwner{} } -func (m *CMsgSOIDOwner) String() string { return proto.CompactTextString(m) } -func (*CMsgSOIDOwner) ProtoMessage() {} -func (*CMsgSOIDOwner) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{0} } - -func (m *CMsgSOIDOwner) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CMsgSOIDOwner) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -type CMsgSOSingleObject struct { - Owner *uint64 `protobuf:"fixed64,1,opt,name=owner" json:"owner,omitempty"` - TypeId *int32 `protobuf:"varint,2,opt,name=type_id" json:"type_id,omitempty"` - ObjectData []byte `protobuf:"bytes,3,opt,name=object_data" json:"object_data,omitempty"` - Version *uint64 `protobuf:"fixed64,4,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,5,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,6,opt,name=service_id" json:"service_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOSingleObject) Reset() { *m = CMsgSOSingleObject{} } -func (m *CMsgSOSingleObject) String() string { return proto.CompactTextString(m) } -func (*CMsgSOSingleObject) ProtoMessage() {} -func (*CMsgSOSingleObject) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{1} } - -func (m *CMsgSOSingleObject) GetOwner() uint64 { - if m != nil && m.Owner != nil { - return *m.Owner - } - return 0 -} - -func (m *CMsgSOSingleObject) GetTypeId() int32 { - if m != nil && m.TypeId != nil { - return *m.TypeId - } - return 0 -} - -func (m *CMsgSOSingleObject) GetObjectData() []byte { - if m != nil { - return m.ObjectData - } - return nil -} - -func (m *CMsgSOSingleObject) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOSingleObject) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOSingleObject) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -type CMsgSOMultipleObjects struct { - Owner *uint64 `protobuf:"fixed64,1,opt,name=owner" json:"owner,omitempty"` - Objects []*CMsgSOMultipleObjects_SingleObject `protobuf:"bytes,2,rep,name=objects" json:"objects,omitempty"` - Version *uint64 `protobuf:"fixed64,3,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,6,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,7,opt,name=service_id" json:"service_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOMultipleObjects) Reset() { *m = CMsgSOMultipleObjects{} } -func (m *CMsgSOMultipleObjects) String() string { return proto.CompactTextString(m) } -func (*CMsgSOMultipleObjects) ProtoMessage() {} -func (*CMsgSOMultipleObjects) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{2} } - -func (m *CMsgSOMultipleObjects) GetOwner() uint64 { - if m != nil && m.Owner != nil { - return *m.Owner - } - return 0 -} - -func (m *CMsgSOMultipleObjects) GetObjects() []*CMsgSOMultipleObjects_SingleObject { - if m != nil { - return m.Objects - } - return nil -} - -func (m *CMsgSOMultipleObjects) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOMultipleObjects) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOMultipleObjects) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -type CMsgSOMultipleObjects_SingleObject struct { - TypeId *int32 `protobuf:"varint,1,opt,name=type_id" json:"type_id,omitempty"` - ObjectData []byte `protobuf:"bytes,2,opt,name=object_data" json:"object_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOMultipleObjects_SingleObject) Reset() { *m = CMsgSOMultipleObjects_SingleObject{} } -func (m *CMsgSOMultipleObjects_SingleObject) String() string { return proto.CompactTextString(m) } -func (*CMsgSOMultipleObjects_SingleObject) ProtoMessage() {} -func (*CMsgSOMultipleObjects_SingleObject) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{2, 0} -} - -func (m *CMsgSOMultipleObjects_SingleObject) GetTypeId() int32 { - if m != nil && m.TypeId != nil { - return *m.TypeId - } - return 0 -} - -func (m *CMsgSOMultipleObjects_SingleObject) GetObjectData() []byte { - if m != nil { - return m.ObjectData - } - return nil -} - -type CMsgSOCacheSubscribed struct { - Owner *uint64 `protobuf:"fixed64,1,opt,name=owner" json:"owner,omitempty"` - Objects []*CMsgSOCacheSubscribed_SubscribedType `protobuf:"bytes,2,rep,name=objects" json:"objects,omitempty"` - Version *uint64 `protobuf:"fixed64,3,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,4,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,5,opt,name=service_id" json:"service_id,omitempty"` - ServiceList []uint32 `protobuf:"varint,6,rep,name=service_list" json:"service_list,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,7,opt,name=sync_version" json:"sync_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscribed) Reset() { *m = CMsgSOCacheSubscribed{} } -func (m *CMsgSOCacheSubscribed) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscribed) ProtoMessage() {} -func (*CMsgSOCacheSubscribed) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{3} } - -func (m *CMsgSOCacheSubscribed) GetOwner() uint64 { - if m != nil && m.Owner != nil { - return *m.Owner - } - return 0 -} - -func (m *CMsgSOCacheSubscribed) GetObjects() []*CMsgSOCacheSubscribed_SubscribedType { - if m != nil { - return m.Objects - } - return nil -} - -func (m *CMsgSOCacheSubscribed) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheSubscribed) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOCacheSubscribed) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheSubscribed) GetServiceList() []uint32 { - if m != nil { - return m.ServiceList - } - return nil -} - -func (m *CMsgSOCacheSubscribed) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -type CMsgSOCacheSubscribed_SubscribedType struct { - TypeId *int32 `protobuf:"varint,1,opt,name=type_id" json:"type_id,omitempty"` - ObjectData [][]byte `protobuf:"bytes,2,rep,name=object_data" json:"object_data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscribed_SubscribedType) Reset() { *m = CMsgSOCacheSubscribed_SubscribedType{} } -func (m *CMsgSOCacheSubscribed_SubscribedType) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscribed_SubscribedType) ProtoMessage() {} -func (*CMsgSOCacheSubscribed_SubscribedType) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{3, 0} -} - -func (m *CMsgSOCacheSubscribed_SubscribedType) GetTypeId() int32 { - if m != nil && m.TypeId != nil { - return *m.TypeId - } - return 0 -} - -func (m *CMsgSOCacheSubscribed_SubscribedType) GetObjectData() [][]byte { - if m != nil { - return m.ObjectData - } - return nil -} - -type CMsgSOCacheSubscribedUpToDate struct { - Version *uint64 `protobuf:"fixed64,1,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,2,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,3,opt,name=service_id" json:"service_id,omitempty"` - ServiceList []uint32 `protobuf:"varint,4,rep,name=service_list" json:"service_list,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,5,opt,name=sync_version" json:"sync_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscribedUpToDate) Reset() { *m = CMsgSOCacheSubscribedUpToDate{} } -func (m *CMsgSOCacheSubscribedUpToDate) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscribedUpToDate) ProtoMessage() {} -func (*CMsgSOCacheSubscribedUpToDate) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{4} } - -func (m *CMsgSOCacheSubscribedUpToDate) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetServiceList() []uint32 { - if m != nil { - return m.ServiceList - } - return nil -} - -func (m *CMsgSOCacheSubscribedUpToDate) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -type CMsgSOCacheUnsubscribed struct { - Owner *uint64 `protobuf:"fixed64,1,opt,name=owner" json:"owner,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheUnsubscribed) Reset() { *m = CMsgSOCacheUnsubscribed{} } -func (m *CMsgSOCacheUnsubscribed) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheUnsubscribed) ProtoMessage() {} -func (*CMsgSOCacheUnsubscribed) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{5} } - -func (m *CMsgSOCacheUnsubscribed) GetOwner() uint64 { - if m != nil && m.Owner != nil { - return *m.Owner - } - return 0 -} - -type CMsgSOCacheSubscriptionCheck struct { - Owner *uint64 `protobuf:"fixed64,1,opt,name=owner" json:"owner,omitempty"` - Version *uint64 `protobuf:"fixed64,2,opt,name=version" json:"version,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,3,opt,name=owner_soid" json:"owner_soid,omitempty"` - ServiceId *uint32 `protobuf:"varint,4,opt,name=service_id" json:"service_id,omitempty"` - ServiceList []uint32 `protobuf:"varint,5,rep,name=service_list" json:"service_list,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,6,opt,name=sync_version" json:"sync_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscriptionCheck) Reset() { *m = CMsgSOCacheSubscriptionCheck{} } -func (m *CMsgSOCacheSubscriptionCheck) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscriptionCheck) ProtoMessage() {} -func (*CMsgSOCacheSubscriptionCheck) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{6} } - -func (m *CMsgSOCacheSubscriptionCheck) GetOwner() uint64 { - if m != nil && m.Owner != nil { - return *m.Owner - } - return 0 -} - -func (m *CMsgSOCacheSubscriptionCheck) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheSubscriptionCheck) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -func (m *CMsgSOCacheSubscriptionCheck) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgSOCacheSubscriptionCheck) GetServiceList() []uint32 { - if m != nil { - return m.ServiceList - } - return nil -} - -func (m *CMsgSOCacheSubscriptionCheck) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -type CMsgSOCacheSubscriptionRefresh struct { - Owner *uint64 `protobuf:"fixed64,1,opt,name=owner" json:"owner,omitempty"` - OwnerSoid *CMsgSOIDOwner `protobuf:"bytes,2,opt,name=owner_soid" json:"owner_soid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheSubscriptionRefresh) Reset() { *m = CMsgSOCacheSubscriptionRefresh{} } -func (m *CMsgSOCacheSubscriptionRefresh) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheSubscriptionRefresh) ProtoMessage() {} -func (*CMsgSOCacheSubscriptionRefresh) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{7} } - -func (m *CMsgSOCacheSubscriptionRefresh) GetOwner() uint64 { - if m != nil && m.Owner != nil { - return *m.Owner - } - return 0 -} - -func (m *CMsgSOCacheSubscriptionRefresh) GetOwnerSoid() *CMsgSOIDOwner { - if m != nil { - return m.OwnerSoid - } - return nil -} - -type CMsgSOCacheVersion struct { - Version *uint64 `protobuf:"fixed64,1,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheVersion) Reset() { *m = CMsgSOCacheVersion{} } -func (m *CMsgSOCacheVersion) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheVersion) ProtoMessage() {} -func (*CMsgSOCacheVersion) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{8} } - -func (m *CMsgSOCacheVersion) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgGCMultiplexMessage struct { - Msgtype *uint32 `protobuf:"varint,1,opt,name=msgtype" json:"msgtype,omitempty"` - Payload []byte `protobuf:"bytes,2,opt,name=payload" json:"payload,omitempty"` - Steamids []uint64 `protobuf:"fixed64,3,rep,name=steamids" json:"steamids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCMultiplexMessage) Reset() { *m = CMsgGCMultiplexMessage{} } -func (m *CMsgGCMultiplexMessage) String() string { return proto.CompactTextString(m) } -func (*CMsgGCMultiplexMessage) ProtoMessage() {} -func (*CMsgGCMultiplexMessage) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{9} } - -func (m *CMsgGCMultiplexMessage) GetMsgtype() uint32 { - if m != nil && m.Msgtype != nil { - return *m.Msgtype - } - return 0 -} - -func (m *CMsgGCMultiplexMessage) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *CMsgGCMultiplexMessage) GetSteamids() []uint64 { - if m != nil { - return m.Steamids - } - return nil -} - -type CGCToGCMsgMasterAck struct { - DirIndex *uint32 `protobuf:"varint,1,opt,name=dir_index" json:"dir_index,omitempty"` - MachineName *string `protobuf:"bytes,3,opt,name=machine_name" json:"machine_name,omitempty"` - ProcessName *string `protobuf:"bytes,4,opt,name=process_name" json:"process_name,omitempty"` - TypeInstances []uint32 `protobuf:"varint,5,rep,name=type_instances" json:"type_instances,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterAck) Reset() { *m = CGCToGCMsgMasterAck{} } -func (m *CGCToGCMsgMasterAck) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterAck) ProtoMessage() {} -func (*CGCToGCMsgMasterAck) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{10} } - -func (m *CGCToGCMsgMasterAck) GetDirIndex() uint32 { - if m != nil && m.DirIndex != nil { - return *m.DirIndex - } - return 0 -} - -func (m *CGCToGCMsgMasterAck) GetMachineName() string { - if m != nil && m.MachineName != nil { - return *m.MachineName - } - return "" -} - -func (m *CGCToGCMsgMasterAck) GetProcessName() string { - if m != nil && m.ProcessName != nil { - return *m.ProcessName - } - return "" -} - -func (m *CGCToGCMsgMasterAck) GetTypeInstances() []uint32 { - if m != nil { - return m.TypeInstances - } - return nil -} - -type CGCToGCMsgMasterAck_Response struct { - Eresult *int32 `protobuf:"varint,1,opt,name=eresult,def=2" json:"eresult,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterAck_Response) Reset() { *m = CGCToGCMsgMasterAck_Response{} } -func (m *CGCToGCMsgMasterAck_Response) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterAck_Response) ProtoMessage() {} -func (*CGCToGCMsgMasterAck_Response) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{11} } - -const Default_CGCToGCMsgMasterAck_Response_Eresult int32 = 2 - -func (m *CGCToGCMsgMasterAck_Response) GetEresult() int32 { - if m != nil && m.Eresult != nil { - return *m.Eresult - } - return Default_CGCToGCMsgMasterAck_Response_Eresult -} - -type CGCToGCMsgMasterStartupComplete struct { - GcInfo []*CGCToGCMsgMasterStartupComplete_GCInfo `protobuf:"bytes,1,rep,name=gc_info" json:"gc_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterStartupComplete) Reset() { *m = CGCToGCMsgMasterStartupComplete{} } -func (m *CGCToGCMsgMasterStartupComplete) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterStartupComplete) ProtoMessage() {} -func (*CGCToGCMsgMasterStartupComplete) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{12} -} - -func (m *CGCToGCMsgMasterStartupComplete) GetGcInfo() []*CGCToGCMsgMasterStartupComplete_GCInfo { - if m != nil { - return m.GcInfo - } - return nil -} - -type CGCToGCMsgMasterStartupComplete_GCInfo struct { - DirIndex *uint32 `protobuf:"varint,1,opt,name=dir_index" json:"dir_index,omitempty"` - MachineName *string `protobuf:"bytes,2,opt,name=machine_name" json:"machine_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) Reset() { - *m = CGCToGCMsgMasterStartupComplete_GCInfo{} -} -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgMasterStartupComplete_GCInfo) ProtoMessage() {} -func (*CGCToGCMsgMasterStartupComplete_GCInfo) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{12, 0} -} - -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) GetDirIndex() uint32 { - if m != nil && m.DirIndex != nil { - return *m.DirIndex - } - return 0 -} - -func (m *CGCToGCMsgMasterStartupComplete_GCInfo) GetMachineName() string { - if m != nil && m.MachineName != nil { - return *m.MachineName - } - return "" -} - -type CGCToGCMsgRouted struct { - MsgType *uint32 `protobuf:"varint,1,opt,name=msg_type" json:"msg_type,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - NetMessage []byte `protobuf:"bytes,3,opt,name=net_message" json:"net_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgRouted) Reset() { *m = CGCToGCMsgRouted{} } -func (m *CGCToGCMsgRouted) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgRouted) ProtoMessage() {} -func (*CGCToGCMsgRouted) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{13} } - -func (m *CGCToGCMsgRouted) GetMsgType() uint32 { - if m != nil && m.MsgType != nil { - return *m.MsgType - } - return 0 -} - -func (m *CGCToGCMsgRouted) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CGCToGCMsgRouted) GetNetMessage() []byte { - if m != nil { - return m.NetMessage - } - return nil -} - -type CGCToGCMsgRoutedReply struct { - MsgType *uint32 `protobuf:"varint,1,opt,name=msg_type" json:"msg_type,omitempty"` - NetMessage []byte `protobuf:"bytes,2,opt,name=net_message" json:"net_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCToGCMsgRoutedReply) Reset() { *m = CGCToGCMsgRoutedReply{} } -func (m *CGCToGCMsgRoutedReply) String() string { return proto.CompactTextString(m) } -func (*CGCToGCMsgRoutedReply) ProtoMessage() {} -func (*CGCToGCMsgRoutedReply) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{14} } - -func (m *CGCToGCMsgRoutedReply) GetMsgType() uint32 { - if m != nil && m.MsgType != nil { - return *m.MsgType - } - return 0 -} - -func (m *CGCToGCMsgRoutedReply) GetNetMessage() []byte { - if m != nil { - return m.NetMessage - } - return nil -} - -type CMsgGCUpdateSubGCSessionInfo struct { - Updates []*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate `protobuf:"bytes,1,rep,name=updates" json:"updates,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCUpdateSubGCSessionInfo) Reset() { *m = CMsgGCUpdateSubGCSessionInfo{} } -func (m *CMsgGCUpdateSubGCSessionInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCUpdateSubGCSessionInfo) ProtoMessage() {} -func (*CMsgGCUpdateSubGCSessionInfo) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{15} } - -func (m *CMsgGCUpdateSubGCSessionInfo) GetUpdates() []*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate { - if m != nil { - return m.Updates - } - return nil -} - -type CMsgGCUpdateSubGCSessionInfo_CMsgUpdate struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - Ip *uint32 `protobuf:"fixed32,2,opt,name=ip" json:"ip,omitempty"` - Trusted *bool `protobuf:"varint,3,opt,name=trusted" json:"trusted,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) Reset() { - *m = CMsgGCUpdateSubGCSessionInfo_CMsgUpdate{} -} -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) String() string { return proto.CompactTextString(m) } -func (*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) ProtoMessage() {} -func (*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{15, 0} -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) GetIp() uint32 { - if m != nil && m.Ip != nil { - return *m.Ip - } - return 0 -} - -func (m *CMsgGCUpdateSubGCSessionInfo_CMsgUpdate) GetTrusted() bool { - if m != nil && m.Trusted != nil { - return *m.Trusted - } - return false -} - -type CMsgGCRequestSubGCSessionInfo struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestSubGCSessionInfo) Reset() { *m = CMsgGCRequestSubGCSessionInfo{} } -func (m *CMsgGCRequestSubGCSessionInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestSubGCSessionInfo) ProtoMessage() {} -func (*CMsgGCRequestSubGCSessionInfo) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{16} } - -func (m *CMsgGCRequestSubGCSessionInfo) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CMsgGCRequestSubGCSessionInfoResponse struct { - Ip *uint32 `protobuf:"fixed32,1,opt,name=ip" json:"ip,omitempty"` - Trusted *bool `protobuf:"varint,2,opt,name=trusted" json:"trusted,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCRequestSubGCSessionInfoResponse) Reset() { *m = CMsgGCRequestSubGCSessionInfoResponse{} } -func (m *CMsgGCRequestSubGCSessionInfoResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGCRequestSubGCSessionInfoResponse) ProtoMessage() {} -func (*CMsgGCRequestSubGCSessionInfoResponse) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{17} -} - -func (m *CMsgGCRequestSubGCSessionInfoResponse) GetIp() uint32 { - if m != nil && m.Ip != nil { - return *m.Ip - } - return 0 -} - -func (m *CMsgGCRequestSubGCSessionInfoResponse) GetTrusted() bool { - if m != nil && m.Trusted != nil { - return *m.Trusted - } - return false -} - -type CMsgGCToGCIncrementRecruitmentLevel struct { - Steamid *uint64 `protobuf:"fixed64,1,opt,name=steamid" json:"steamid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCIncrementRecruitmentLevel) Reset() { *m = CMsgGCToGCIncrementRecruitmentLevel{} } -func (m *CMsgGCToGCIncrementRecruitmentLevel) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCIncrementRecruitmentLevel) ProtoMessage() {} -func (*CMsgGCToGCIncrementRecruitmentLevel) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{18} -} - -func (m *CMsgGCToGCIncrementRecruitmentLevel) GetSteamid() uint64 { - if m != nil && m.Steamid != nil { - return *m.Steamid - } - return 0 -} - -type CMsgSOCacheHaveVersion struct { - Soid *CMsgSOIDOwner `protobuf:"bytes,1,opt,name=soid" json:"soid,omitempty"` - Version *uint64 `protobuf:"fixed64,2,opt,name=version" json:"version,omitempty"` - ServiceId *uint32 `protobuf:"varint,3,opt,name=service_id" json:"service_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSOCacheHaveVersion) Reset() { *m = CMsgSOCacheHaveVersion{} } -func (m *CMsgSOCacheHaveVersion) String() string { return proto.CompactTextString(m) } -func (*CMsgSOCacheHaveVersion) ProtoMessage() {} -func (*CMsgSOCacheHaveVersion) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{19} } - -func (m *CMsgSOCacheHaveVersion) GetSoid() *CMsgSOIDOwner { - if m != nil { - return m.Soid - } - return nil -} - -func (m *CMsgSOCacheHaveVersion) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -func (m *CMsgSOCacheHaveVersion) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -type CMsgConnectionStatus struct { - Status *GCConnectionStatus `protobuf:"varint,1,opt,name=status,enum=GCConnectionStatus,def=0" json:"status,omitempty"` - ClientSessionNeed *uint32 `protobuf:"varint,2,opt,name=client_session_need" json:"client_session_need,omitempty"` - QueuePosition *int32 `protobuf:"varint,3,opt,name=queue_position" json:"queue_position,omitempty"` - QueueSize *int32 `protobuf:"varint,4,opt,name=queue_size" json:"queue_size,omitempty"` - WaitSeconds *int32 `protobuf:"varint,5,opt,name=wait_seconds" json:"wait_seconds,omitempty"` - EstimatedWaitSecondsRemaining *int32 `protobuf:"varint,6,opt,name=estimated_wait_seconds_remaining" json:"estimated_wait_seconds_remaining,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgConnectionStatus) Reset() { *m = CMsgConnectionStatus{} } -func (m *CMsgConnectionStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgConnectionStatus) ProtoMessage() {} -func (*CMsgConnectionStatus) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{20} } - -const Default_CMsgConnectionStatus_Status GCConnectionStatus = GCConnectionStatus_GCConnectionStatus_HAVE_SESSION - -func (m *CMsgConnectionStatus) GetStatus() GCConnectionStatus { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_CMsgConnectionStatus_Status -} - -func (m *CMsgConnectionStatus) GetClientSessionNeed() uint32 { - if m != nil && m.ClientSessionNeed != nil { - return *m.ClientSessionNeed - } - return 0 -} - -func (m *CMsgConnectionStatus) GetQueuePosition() int32 { - if m != nil && m.QueuePosition != nil { - return *m.QueuePosition - } - return 0 -} - -func (m *CMsgConnectionStatus) GetQueueSize() int32 { - if m != nil && m.QueueSize != nil { - return *m.QueueSize - } - return 0 -} - -func (m *CMsgConnectionStatus) GetWaitSeconds() int32 { - if m != nil && m.WaitSeconds != nil { - return *m.WaitSeconds - } - return 0 -} - -func (m *CMsgConnectionStatus) GetEstimatedWaitSecondsRemaining() int32 { - if m != nil && m.EstimatedWaitSecondsRemaining != nil { - return *m.EstimatedWaitSecondsRemaining - } - return 0 -} - -type CMsgGCToGCSOCacheSubscribe struct { - Subscriber *uint64 `protobuf:"fixed64,1,opt,name=subscriber" json:"subscriber,omitempty"` - SubscribeTo *uint64 `protobuf:"fixed64,2,opt,name=subscribe_to" json:"subscribe_to,omitempty"` - SyncVersion *uint64 `protobuf:"fixed64,3,opt,name=sync_version" json:"sync_version,omitempty"` - HaveVersions []*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions `protobuf:"bytes,4,rep,name=have_versions" json:"have_versions,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCSOCacheSubscribe) Reset() { *m = CMsgGCToGCSOCacheSubscribe{} } -func (m *CMsgGCToGCSOCacheSubscribe) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCSOCacheSubscribe) ProtoMessage() {} -func (*CMsgGCToGCSOCacheSubscribe) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{21} } - -func (m *CMsgGCToGCSOCacheSubscribe) GetSubscriber() uint64 { - if m != nil && m.Subscriber != nil { - return *m.Subscriber - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe) GetSubscribeTo() uint64 { - if m != nil && m.SubscribeTo != nil { - return *m.SubscribeTo - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe) GetSyncVersion() uint64 { - if m != nil && m.SyncVersion != nil { - return *m.SyncVersion - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe) GetHaveVersions() []*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions { - if m != nil { - return m.HaveVersions - } - return nil -} - -type CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions struct { - ServiceId *uint32 `protobuf:"varint,1,opt,name=service_id" json:"service_id,omitempty"` - Version *uint64 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) Reset() { - *m = CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions{} -} -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) ProtoMessage() {} -func (*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) Descriptor() ([]byte, []int) { - return gcsdk_fileDescriptor0, []int{21, 0} -} - -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) GetServiceId() uint32 { - if m != nil && m.ServiceId != nil { - return *m.ServiceId - } - return 0 -} - -func (m *CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions) GetVersion() uint64 { - if m != nil && m.Version != nil { - return *m.Version - } - return 0 -} - -type CMsgGCToGCSOCacheUnsubscribe struct { - Subscriber *uint64 `protobuf:"fixed64,1,opt,name=subscriber" json:"subscriber,omitempty"` - UnsubscribeFrom *uint64 `protobuf:"fixed64,2,opt,name=unsubscribe_from" json:"unsubscribe_from,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCToGCSOCacheUnsubscribe) Reset() { *m = CMsgGCToGCSOCacheUnsubscribe{} } -func (m *CMsgGCToGCSOCacheUnsubscribe) String() string { return proto.CompactTextString(m) } -func (*CMsgGCToGCSOCacheUnsubscribe) ProtoMessage() {} -func (*CMsgGCToGCSOCacheUnsubscribe) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{22} } - -func (m *CMsgGCToGCSOCacheUnsubscribe) GetSubscriber() uint64 { - if m != nil && m.Subscriber != nil { - return *m.Subscriber - } - return 0 -} - -func (m *CMsgGCToGCSOCacheUnsubscribe) GetUnsubscribeFrom() uint64 { - if m != nil && m.UnsubscribeFrom != nil { - return *m.UnsubscribeFrom - } - return 0 -} - -type CMsgGCClientPing struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCClientPing) Reset() { *m = CMsgGCClientPing{} } -func (m *CMsgGCClientPing) String() string { return proto.CompactTextString(m) } -func (*CMsgGCClientPing) ProtoMessage() {} -func (*CMsgGCClientPing) Descriptor() ([]byte, []int) { return gcsdk_fileDescriptor0, []int{23} } - -func init() { - proto.RegisterType((*CMsgSOIDOwner)(nil), "CMsgSOIDOwner") - proto.RegisterType((*CMsgSOSingleObject)(nil), "CMsgSOSingleObject") - proto.RegisterType((*CMsgSOMultipleObjects)(nil), "CMsgSOMultipleObjects") - proto.RegisterType((*CMsgSOMultipleObjects_SingleObject)(nil), "CMsgSOMultipleObjects.SingleObject") - proto.RegisterType((*CMsgSOCacheSubscribed)(nil), "CMsgSOCacheSubscribed") - proto.RegisterType((*CMsgSOCacheSubscribed_SubscribedType)(nil), "CMsgSOCacheSubscribed.SubscribedType") - proto.RegisterType((*CMsgSOCacheSubscribedUpToDate)(nil), "CMsgSOCacheSubscribedUpToDate") - proto.RegisterType((*CMsgSOCacheUnsubscribed)(nil), "CMsgSOCacheUnsubscribed") - proto.RegisterType((*CMsgSOCacheSubscriptionCheck)(nil), "CMsgSOCacheSubscriptionCheck") - proto.RegisterType((*CMsgSOCacheSubscriptionRefresh)(nil), "CMsgSOCacheSubscriptionRefresh") - proto.RegisterType((*CMsgSOCacheVersion)(nil), "CMsgSOCacheVersion") - proto.RegisterType((*CMsgGCMultiplexMessage)(nil), "CMsgGCMultiplexMessage") - proto.RegisterType((*CGCToGCMsgMasterAck)(nil), "CGCToGCMsgMasterAck") - proto.RegisterType((*CGCToGCMsgMasterAck_Response)(nil), "CGCToGCMsgMasterAck_Response") - proto.RegisterType((*CGCToGCMsgMasterStartupComplete)(nil), "CGCToGCMsgMasterStartupComplete") - proto.RegisterType((*CGCToGCMsgMasterStartupComplete_GCInfo)(nil), "CGCToGCMsgMasterStartupComplete.GCInfo") - proto.RegisterType((*CGCToGCMsgRouted)(nil), "CGCToGCMsgRouted") - proto.RegisterType((*CGCToGCMsgRoutedReply)(nil), "CGCToGCMsgRoutedReply") - proto.RegisterType((*CMsgGCUpdateSubGCSessionInfo)(nil), "CMsgGCUpdateSubGCSessionInfo") - proto.RegisterType((*CMsgGCUpdateSubGCSessionInfo_CMsgUpdate)(nil), "CMsgGCUpdateSubGCSessionInfo.CMsgUpdate") - proto.RegisterType((*CMsgGCRequestSubGCSessionInfo)(nil), "CMsgGCRequestSubGCSessionInfo") - proto.RegisterType((*CMsgGCRequestSubGCSessionInfoResponse)(nil), "CMsgGCRequestSubGCSessionInfoResponse") - proto.RegisterType((*CMsgGCToGCIncrementRecruitmentLevel)(nil), "CMsgGCToGCIncrementRecruitmentLevel") - proto.RegisterType((*CMsgSOCacheHaveVersion)(nil), "CMsgSOCacheHaveVersion") - proto.RegisterType((*CMsgConnectionStatus)(nil), "CMsgConnectionStatus") - proto.RegisterType((*CMsgGCToGCSOCacheSubscribe)(nil), "CMsgGCToGCSOCacheSubscribe") - proto.RegisterType((*CMsgGCToGCSOCacheSubscribe_CMsgHaveVersions)(nil), "CMsgGCToGCSOCacheSubscribe.CMsgHaveVersions") - proto.RegisterType((*CMsgGCToGCSOCacheUnsubscribe)(nil), "CMsgGCToGCSOCacheUnsubscribe") - proto.RegisterType((*CMsgGCClientPing)(nil), "CMsgGCClientPing") - proto.RegisterEnum("PartnerAccountType", PartnerAccountType_name, PartnerAccountType_value) - proto.RegisterEnum("GCConnectionStatus", GCConnectionStatus_name, GCConnectionStatus_value) -} - -var gcsdk_fileDescriptor0 = []byte{ - // 1199 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x56, 0x4f, 0x73, 0xdb, 0x44, - 0x14, 0xaf, 0xfc, 0xb7, 0x7d, 0xb5, 0x83, 0x51, 0xda, 0x10, 0xdc, 0x94, 0x04, 0x85, 0x0c, 0xa1, - 0xd3, 0xf1, 0x94, 0x4c, 0x27, 0x40, 0x0e, 0xcc, 0x04, 0x59, 0x38, 0x9e, 0x49, 0xac, 0x60, 0xd9, - 0x2d, 0x33, 0x1c, 0x76, 0x14, 0x79, 0xe3, 0x88, 0xda, 0x92, 0xd0, 0x4a, 0x69, 0xc3, 0x89, 0x3b, - 0x33, 0x1c, 0x18, 0xf8, 0x02, 0x7c, 0x2c, 0x38, 0xf3, 0x19, 0xb8, 0xf2, 0x76, 0x57, 0x4a, 0x1c, - 0x59, 0x49, 0x7c, 0x93, 0xdf, 0xbe, 0x7f, 0xbf, 0xdf, 0xbe, 0xf7, 0x5b, 0xc3, 0xca, 0xd8, 0x61, - 0xa3, 0x37, 0x64, 0xec, 0x4c, 0x29, 0x63, 0xf6, 0x98, 0xb2, 0x56, 0x10, 0xfa, 0x91, 0xdf, 0x5c, - 0x66, 0x11, 0xb5, 0xa7, 0xd7, 0x8d, 0xda, 0x67, 0x50, 0xd7, 0x8f, 0xd8, 0xd8, 0x32, 0xbb, 0x6d, - 0xf3, 0xad, 0x47, 0x43, 0xb5, 0x06, 0xa5, 0xe8, 0x22, 0xa0, 0xab, 0xca, 0x86, 0xb2, 0x5d, 0x57, - 0x01, 0x0a, 0xee, 0x68, 0xb5, 0x80, 0xdf, 0x25, 0xed, 0x77, 0x05, 0x54, 0xe9, 0x6b, 0xb9, 0xde, - 0x78, 0x42, 0xcd, 0x93, 0x1f, 0xa9, 0x13, 0xa9, 0x75, 0x28, 0xfb, 0x3c, 0x52, 0x44, 0x54, 0xd4, - 0xf7, 0xa0, 0xca, 0xe3, 0x49, 0x12, 0x56, 0x56, 0x97, 0xe1, 0xa1, 0x2f, 0x3c, 0xc9, 0xc8, 0x8e, - 0xec, 0xd5, 0x22, 0x1a, 0x6b, 0xdc, 0xeb, 0x9c, 0x86, 0xcc, 0xf5, 0xbd, 0xd5, 0x92, 0x08, 0xd3, - 0x00, 0x44, 0x16, 0xc2, 0x7c, 0x8c, 0x2c, 0xa3, 0xed, 0xe1, 0xce, 0x52, 0xeb, 0x7a, 0x6b, 0xd8, - 0x0d, 0xa3, 0xe1, 0xb9, 0xeb, 0x88, 0xec, 0x15, 0xde, 0xa0, 0xf6, 0x8f, 0x02, 0x8f, 0xa5, 0xd7, - 0x51, 0x3c, 0x89, 0xdc, 0x20, 0x6d, 0x8b, 0x65, 0xfb, 0x7a, 0x09, 0x55, 0xd9, 0x06, 0xc3, 0xbe, - 0x8a, 0x98, 0x7d, 0xb3, 0x95, 0x1b, 0xd7, 0xba, 0x06, 0x6e, 0xa6, 0xcf, 0x62, 0x4e, 0x9f, 0x95, - 0x05, 0xfa, 0xac, 0xf2, 0x3e, 0x9b, 0x2f, 0xa1, 0x96, 0x4d, 0x9c, 0xd2, 0xa4, 0xe4, 0xd1, 0xc4, - 0xb9, 0xab, 0x69, 0xbf, 0x16, 0x52, 0x74, 0xba, 0xed, 0x9c, 0x51, 0x2b, 0x3e, 0x61, 0x4e, 0xe8, - 0x9e, 0xd0, 0x51, 0x16, 0xdd, 0x6e, 0x16, 0xdd, 0x56, 0x2b, 0x37, 0xae, 0x75, 0xf5, 0x39, 0xc0, - 0xf2, 0x77, 0xe1, 0x2b, 0x2d, 0x80, 0xaf, 0x2c, 0x06, 0xe5, 0x11, 0xd4, 0x52, 0xdb, 0xc4, 0x65, - 0x11, 0x32, 0x53, 0x4c, 0xac, 0x17, 0x9e, 0x43, 0xd2, 0x1a, 0x9c, 0x8b, 0x4a, 0x73, 0x17, 0x96, - 0xe6, 0xdb, 0xb8, 0x83, 0x8d, 0x22, 0xb2, 0xf1, 0x87, 0x02, 0x4f, 0x73, 0x51, 0x0d, 0x83, 0x81, - 0xdf, 0xb6, 0xa3, 0x6b, 0x70, 0x94, 0x1c, 0x38, 0x85, 0x05, 0xe0, 0x14, 0x73, 0xe1, 0x94, 0x72, - 0xe1, 0x70, 0xe8, 0x15, 0x6d, 0x1b, 0x3e, 0x98, 0xe9, 0x6a, 0xe8, 0xb1, 0x9b, 0x6e, 0x49, 0xfb, - 0x4b, 0x81, 0xb5, 0x79, 0x00, 0x41, 0x84, 0xb9, 0xf4, 0x33, 0xea, 0xbc, 0xc9, 0xd9, 0xa5, 0xb4, - 0x54, 0x21, 0x07, 0x4e, 0x71, 0x01, 0x38, 0xa5, 0x5c, 0x38, 0xe5, 0x5c, 0x38, 0x15, 0xd1, 0xa4, - 0x05, 0x1f, 0xdd, 0xd0, 0x63, 0x9f, 0x9e, 0x86, 0x94, 0x9d, 0x65, 0xbb, 0x5c, 0x80, 0x63, 0x6d, - 0x2b, 0x95, 0x0e, 0x91, 0xf4, 0x95, 0x2c, 0x38, 0x77, 0x5d, 0xda, 0x21, 0xac, 0x70, 0xb7, 0x8e, - 0x9e, 0x2e, 0xe5, 0xbb, 0x23, 0x29, 0x57, 0xdc, 0x75, 0xca, 0xc6, 0x33, 0xca, 0x84, 0x86, 0xc0, - 0xbe, 0x98, 0xf8, 0xb6, 0x2c, 0x59, 0x53, 0x1b, 0x70, 0x5f, 0x08, 0x9c, 0x3b, 0x62, 0xc8, 0x4c, - 0x11, 0xb3, 0x4d, 0x60, 0x59, 0xef, 0xe8, 0x03, 0xbf, 0xc3, 0x73, 0x1e, 0xd9, 0x78, 0x1a, 0xee, - 0x23, 0xc9, 0xef, 0xc3, 0x83, 0x91, 0x1b, 0x12, 0xd7, 0x1b, 0xd1, 0x77, 0x49, 0x32, 0x64, 0x62, - 0x8a, 0x8d, 0xb9, 0x1e, 0x25, 0x9e, 0x3d, 0xa5, 0x82, 0xd9, 0x07, 0xdc, 0x8a, 0x22, 0xe9, 0x60, - 0x07, 0xd2, 0x5a, 0x12, 0xd6, 0x15, 0x58, 0x92, 0xb3, 0xea, 0xb1, 0xc8, 0xf6, 0xf0, 0x54, 0xb2, - 0xa9, 0xed, 0xe0, 0xdd, 0xce, 0x57, 0x23, 0x7d, 0xca, 0x02, 0xdf, 0x63, 0x14, 0xef, 0xa5, 0x4a, - 0x91, 0x3e, 0x04, 0x26, 0x67, 0x7c, 0x4f, 0xd9, 0xd1, 0x7e, 0x53, 0x60, 0x3d, 0x1b, 0x64, 0x45, - 0x76, 0x18, 0xc5, 0x81, 0xee, 0x4f, 0x11, 0x3f, 0xce, 0xf4, 0x97, 0x50, 0x1d, 0x3b, 0x58, 0xed, - 0xd4, 0xc7, 0x38, 0xbe, 0xda, 0x9f, 0xb6, 0xee, 0x08, 0x69, 0x75, 0xf4, 0x2e, 0xba, 0x37, 0x3f, - 0x87, 0x8a, 0xfc, 0x5a, 0x04, 0x32, 0x27, 0xf1, 0x01, 0x5e, 0x40, 0xe3, 0x2a, 0x79, 0xdf, 0x8f, - 0x23, 0x1c, 0x62, 0x24, 0x16, 0xa9, 0x27, 0x33, 0xdc, 0x63, 0x3a, 0x46, 0x31, 0x57, 0x98, 0xaa, - 0x7c, 0x85, 0x2f, 0xac, 0x47, 0x23, 0x92, 0xbc, 0x2e, 0x52, 0xe5, 0xb5, 0xaf, 0x51, 0xbd, 0x32, - 0xd9, 0xfa, 0x34, 0x98, 0x5c, 0xe4, 0xa4, 0xcc, 0xc4, 0x4b, 0xf9, 0xfb, 0x33, 0xd9, 0x97, 0x8e, - 0x3e, 0x0c, 0x50, 0x07, 0xf8, 0x30, 0x76, 0x74, 0x0b, 0x5d, 0x70, 0x62, 0x04, 0xae, 0xaf, 0xa0, - 0x1a, 0x8b, 0x13, 0x96, 0x70, 0xb3, 0xdd, 0xba, 0xcd, 0x5f, 0x1c, 0xca, 0xa3, 0xe6, 0x1e, 0xc0, - 0xd5, 0x2f, 0x3e, 0x4d, 0xc9, 0xf0, 0x24, 0x43, 0xcd, 0x1f, 0xbe, 0x40, 0xb4, 0x51, 0x15, 0xea, - 0x14, 0xc6, 0x78, 0x2e, 0x57, 0xee, 0xbe, 0xf6, 0x42, 0xea, 0x50, 0x47, 0xef, 0xd3, 0x9f, 0x62, - 0xca, 0xa2, 0xb9, 0xbe, 0xb2, 0xe9, 0xb4, 0x36, 0x6c, 0xdd, 0x1a, 0x71, 0x39, 0x25, 0xb2, 0xae, - 0x92, 0xad, 0x5b, 0x10, 0x75, 0x77, 0x61, 0x53, 0x66, 0xe1, 0x94, 0x76, 0x3d, 0x27, 0xa4, 0x53, - 0xea, 0x45, 0x7d, 0xea, 0x84, 0xb1, 0x1b, 0xf1, 0xcf, 0x43, 0x7a, 0x4e, 0x27, 0xf3, 0xd5, 0x7f, - 0x90, 0x6b, 0x95, 0x6c, 0xdf, 0x81, 0x7d, 0x7e, 0xb9, 0x81, 0x6b, 0x50, 0x12, 0x5b, 0xab, 0xe4, - 0x4a, 0xc9, 0x9c, 0xfe, 0xe4, 0x48, 0xa5, 0xf6, 0xaf, 0x02, 0x8f, 0x78, 0x98, 0xee, 0x7b, 0x1e, - 0x0a, 0x36, 0x3a, 0xe3, 0x38, 0x46, 0x31, 0x53, 0xdb, 0x50, 0x61, 0xe2, 0x4b, 0x64, 0x5f, 0xda, - 0x59, 0xc6, 0xb9, 0xcc, 0x3a, 0xed, 0xad, 0xcf, 0xdb, 0xc8, 0xc1, 0xfe, 0x2b, 0x83, 0x58, 0x86, - 0x65, 0x75, 0xcd, 0x9e, 0xfa, 0x04, 0x96, 0x9d, 0x89, 0x8b, 0xd8, 0x08, 0x93, 0x74, 0x11, 0x8f, - 0x26, 0x84, 0xd4, 0xf9, 0x2e, 0x22, 0x9d, 0x31, 0x25, 0x81, 0xcf, 0xdc, 0x28, 0x7d, 0xc5, 0xca, - 0xbc, 0x4f, 0x69, 0x67, 0xee, 0xcf, 0x72, 0x6f, 0xcb, 0x7c, 0xe0, 0xdf, 0xda, 0x2e, 0x4f, 0xe3, - 0xf8, 0xde, 0x88, 0x09, 0xf1, 0x2e, 0xab, 0xdb, 0xb0, 0x81, 0xd7, 0xe1, 0x4e, 0x71, 0x08, 0x46, - 0x64, 0xf6, 0x9c, 0x20, 0xb9, 0xb6, 0xeb, 0xe1, 0x9b, 0x2d, 0x74, 0xb1, 0xac, 0xfd, 0xad, 0x40, - 0xf3, 0x8a, 0xfd, 0xec, 0x1b, 0x24, 0xa8, 0x49, 0x7f, 0xa4, 0xca, 0xc8, 0x05, 0x36, 0xb5, 0x91, - 0xc8, 0x4f, 0x48, 0xcc, 0xca, 0xae, 0x7c, 0x78, 0x75, 0xa8, 0x9f, 0xe1, 0xc5, 0xa4, 0x56, 0x26, - 0x9e, 0x9c, 0x87, 0x3b, 0xcf, 0x5b, 0x37, 0xd7, 0x14, 0x47, 0x33, 0xb7, 0xc9, 0x9a, 0x5f, 0xe0, - 0xfa, 0x66, 0x6c, 0x99, 0x3b, 0xbb, 0x14, 0xcf, 0xd9, 0x8b, 0x2d, 0xe1, 0xde, 0xaf, 0xcd, 0xd5, - 0x99, 0x79, 0xc9, 0x72, 0xd1, 0xad, 0x42, 0x23, 0xbe, 0x72, 0x21, 0xa7, 0xa1, 0x3f, 0x95, 0x08, - 0x35, 0x55, 0xb6, 0x81, 0x57, 0x2b, 0x6e, 0xee, 0x18, 0x49, 0x7c, 0x36, 0x00, 0xf5, 0x18, 0x55, - 0xca, 0xe3, 0xaa, 0xe8, 0xf8, 0xb1, 0x17, 0x89, 0x87, 0xbf, 0x01, 0xb5, 0xe3, 0xfd, 0xfe, 0xa0, - 0x67, 0xf4, 0x49, 0xcf, 0xec, 0x19, 0x8d, 0x7b, 0xea, 0x87, 0xf0, 0x38, 0xb5, 0x1c, 0x1b, 0xfd, - 0x6f, 0x0d, 0x7d, 0x40, 0x5e, 0x9b, 0xfd, 0xc3, 0x76, 0x43, 0x41, 0xd9, 0xa9, 0x5f, 0x3a, 0x1b, - 0xdf, 0x9b, 0xbd, 0x46, 0xe1, 0xd9, 0x7f, 0xf8, 0x9f, 0x74, 0x7e, 0x82, 0xd4, 0x4d, 0xb8, 0x6b, - 0xae, 0xb0, 0xd2, 0x27, 0xb0, 0x91, 0xe3, 0xd4, 0xd1, 0x49, 0xc7, 0xec, 0xf6, 0x3a, 0xa4, 0x6d, - 0xbe, 0xee, 0x61, 0xd1, 0x8f, 0xe1, 0x69, 0x8e, 0x57, 0xcf, 0xbc, 0x4c, 0x54, 0x50, 0x5f, 0xc0, - 0xf3, 0x5b, 0x5d, 0x48, 0xb7, 0x47, 0x0e, 0xcd, 0x0e, 0x7e, 0x7c, 0x37, 0x34, 0x86, 0x46, 0xa3, - 0xa8, 0xae, 0xc3, 0x93, 0x1b, 0x22, 0x06, 0xc6, 0xfe, 0x51, 0xa3, 0xa4, 0x6e, 0xc0, 0x5a, 0x8e, - 0x83, 0x35, 0xb4, 0x8e, 0x8d, 0x5e, 0xdb, 0x68, 0x37, 0xca, 0xdf, 0x94, 0x0f, 0x94, 0x5f, 0x94, - 0x7b, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x9a, 0x63, 0xdd, 0xed, 0x0b, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/system.pb.go b/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/system.pb.go deleted file mode 100644 index 2652efcd..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/system.pb.go +++ /dev/null @@ -1,545 +0,0 @@ -// Code generated by protoc-gen-go. -// source: gcsystemmsgs.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type EGCSystemMsg int32 - -const ( - EGCSystemMsg_k_EGCMsgInvalid EGCSystemMsg = 0 - EGCSystemMsg_k_EGCMsgMulti EGCSystemMsg = 1 - EGCSystemMsg_k_EGCMsgGenericReply EGCSystemMsg = 10 - EGCSystemMsg_k_EGCMsgSystemBase EGCSystemMsg = 50 - EGCSystemMsg_k_EGCMsgAchievementAwarded EGCSystemMsg = 51 - EGCSystemMsg_k_EGCMsgConCommand EGCSystemMsg = 52 - EGCSystemMsg_k_EGCMsgStartPlaying EGCSystemMsg = 53 - EGCSystemMsg_k_EGCMsgStopPlaying EGCSystemMsg = 54 - EGCSystemMsg_k_EGCMsgStartGameserver EGCSystemMsg = 55 - EGCSystemMsg_k_EGCMsgStopGameserver EGCSystemMsg = 56 - EGCSystemMsg_k_EGCMsgWGRequest EGCSystemMsg = 57 - EGCSystemMsg_k_EGCMsgWGResponse EGCSystemMsg = 58 - EGCSystemMsg_k_EGCMsgGetUserGameStatsSchema EGCSystemMsg = 59 - EGCSystemMsg_k_EGCMsgGetUserGameStatsSchemaResponse EGCSystemMsg = 60 - EGCSystemMsg_k_EGCMsgGetUserStatsDEPRECATED EGCSystemMsg = 61 - EGCSystemMsg_k_EGCMsgGetUserStatsResponse EGCSystemMsg = 62 - EGCSystemMsg_k_EGCMsgAppInfoUpdated EGCSystemMsg = 63 - EGCSystemMsg_k_EGCMsgValidateSession EGCSystemMsg = 64 - EGCSystemMsg_k_EGCMsgValidateSessionResponse EGCSystemMsg = 65 - EGCSystemMsg_k_EGCMsgLookupAccountFromInput EGCSystemMsg = 66 - EGCSystemMsg_k_EGCMsgSendHTTPRequest EGCSystemMsg = 67 - EGCSystemMsg_k_EGCMsgSendHTTPRequestResponse EGCSystemMsg = 68 - EGCSystemMsg_k_EGCMsgPreTestSetup EGCSystemMsg = 69 - EGCSystemMsg_k_EGCMsgRecordSupportAction EGCSystemMsg = 70 - EGCSystemMsg_k_EGCMsgGetAccountDetails_DEPRECATED EGCSystemMsg = 71 - EGCSystemMsg_k_EGCMsgReceiveInterAppMessage EGCSystemMsg = 73 - EGCSystemMsg_k_EGCMsgFindAccounts EGCSystemMsg = 74 - EGCSystemMsg_k_EGCMsgPostAlert EGCSystemMsg = 75 - EGCSystemMsg_k_EGCMsgGetLicenses EGCSystemMsg = 76 - EGCSystemMsg_k_EGCMsgGetUserStats EGCSystemMsg = 77 - EGCSystemMsg_k_EGCMsgGetCommands EGCSystemMsg = 78 - EGCSystemMsg_k_EGCMsgGetCommandsResponse EGCSystemMsg = 79 - EGCSystemMsg_k_EGCMsgAddFreeLicense EGCSystemMsg = 80 - EGCSystemMsg_k_EGCMsgAddFreeLicenseResponse EGCSystemMsg = 81 - EGCSystemMsg_k_EGCMsgGetIPLocation EGCSystemMsg = 82 - EGCSystemMsg_k_EGCMsgGetIPLocationResponse EGCSystemMsg = 83 - EGCSystemMsg_k_EGCMsgSystemStatsSchema EGCSystemMsg = 84 - EGCSystemMsg_k_EGCMsgGetSystemStats EGCSystemMsg = 85 - EGCSystemMsg_k_EGCMsgGetSystemStatsResponse EGCSystemMsg = 86 - EGCSystemMsg_k_EGCMsgSendEmail EGCSystemMsg = 87 - EGCSystemMsg_k_EGCMsgSendEmailResponse EGCSystemMsg = 88 - EGCSystemMsg_k_EGCMsgGetEmailTemplate EGCSystemMsg = 89 - EGCSystemMsg_k_EGCMsgGetEmailTemplateResponse EGCSystemMsg = 90 - EGCSystemMsg_k_EGCMsgGrantGuestPass EGCSystemMsg = 91 - EGCSystemMsg_k_EGCMsgGrantGuestPassResponse EGCSystemMsg = 92 - EGCSystemMsg_k_EGCMsgGetAccountDetails EGCSystemMsg = 93 - EGCSystemMsg_k_EGCMsgGetAccountDetailsResponse EGCSystemMsg = 94 - EGCSystemMsg_k_EGCMsgGetPersonaNames EGCSystemMsg = 95 - EGCSystemMsg_k_EGCMsgGetPersonaNamesResponse EGCSystemMsg = 96 - EGCSystemMsg_k_EGCMsgMultiplexMsg EGCSystemMsg = 97 - EGCSystemMsg_k_EGCMsgWebAPIRegisterInterfaces EGCSystemMsg = 101 - EGCSystemMsg_k_EGCMsgWebAPIJobRequest EGCSystemMsg = 102 - EGCSystemMsg_k_EGCMsgWebAPIJobRequestHttpResponse EGCSystemMsg = 104 - EGCSystemMsg_k_EGCMsgWebAPIJobRequestForwardResponse EGCSystemMsg = 105 - EGCSystemMsg_k_EGCMsgMemCachedGet EGCSystemMsg = 200 - EGCSystemMsg_k_EGCMsgMemCachedGetResponse EGCSystemMsg = 201 - EGCSystemMsg_k_EGCMsgMemCachedSet EGCSystemMsg = 202 - EGCSystemMsg_k_EGCMsgMemCachedDelete EGCSystemMsg = 203 - EGCSystemMsg_k_EGCMsgMemCachedStats EGCSystemMsg = 204 - EGCSystemMsg_k_EGCMsgMemCachedStatsResponse EGCSystemMsg = 205 - EGCSystemMsg_k_EGCMsgSQLStats EGCSystemMsg = 210 - EGCSystemMsg_k_EGCMsgSQLStatsResponse EGCSystemMsg = 211 - EGCSystemMsg_k_EGCMsgMasterSetDirectory EGCSystemMsg = 220 - EGCSystemMsg_k_EGCMsgMasterSetDirectoryResponse EGCSystemMsg = 221 - EGCSystemMsg_k_EGCMsgMasterSetWebAPIRouting EGCSystemMsg = 222 - EGCSystemMsg_k_EGCMsgMasterSetWebAPIRoutingResponse EGCSystemMsg = 223 - EGCSystemMsg_k_EGCMsgMasterSetClientMsgRouting EGCSystemMsg = 224 - EGCSystemMsg_k_EGCMsgMasterSetClientMsgRoutingResponse EGCSystemMsg = 225 - EGCSystemMsg_k_EGCMsgSetOptions EGCSystemMsg = 226 - EGCSystemMsg_k_EGCMsgSetOptionsResponse EGCSystemMsg = 227 - EGCSystemMsg_k_EGCMsgSystemBase2 EGCSystemMsg = 500 - EGCSystemMsg_k_EGCMsgGetPurchaseTrustStatus EGCSystemMsg = 501 - EGCSystemMsg_k_EGCMsgGetPurchaseTrustStatusResponse EGCSystemMsg = 502 - EGCSystemMsg_k_EGCMsgUpdateSession EGCSystemMsg = 503 - EGCSystemMsg_k_EGCMsgGCAccountVacStatusChange EGCSystemMsg = 504 - EGCSystemMsg_k_EGCMsgCheckFriendship EGCSystemMsg = 505 - EGCSystemMsg_k_EGCMsgCheckFriendshipResponse EGCSystemMsg = 506 - EGCSystemMsg_k_EGCMsgGetPartnerAccountLink EGCSystemMsg = 507 - EGCSystemMsg_k_EGCMsgGetPartnerAccountLinkResponse EGCSystemMsg = 508 - EGCSystemMsg_k_EGCMsgVSReportedSuspiciousActivity EGCSystemMsg = 509 -) - -var EGCSystemMsg_name = map[int32]string{ - 0: "k_EGCMsgInvalid", - 1: "k_EGCMsgMulti", - 10: "k_EGCMsgGenericReply", - 50: "k_EGCMsgSystemBase", - 51: "k_EGCMsgAchievementAwarded", - 52: "k_EGCMsgConCommand", - 53: "k_EGCMsgStartPlaying", - 54: "k_EGCMsgStopPlaying", - 55: "k_EGCMsgStartGameserver", - 56: "k_EGCMsgStopGameserver", - 57: "k_EGCMsgWGRequest", - 58: "k_EGCMsgWGResponse", - 59: "k_EGCMsgGetUserGameStatsSchema", - 60: "k_EGCMsgGetUserGameStatsSchemaResponse", - 61: "k_EGCMsgGetUserStatsDEPRECATED", - 62: "k_EGCMsgGetUserStatsResponse", - 63: "k_EGCMsgAppInfoUpdated", - 64: "k_EGCMsgValidateSession", - 65: "k_EGCMsgValidateSessionResponse", - 66: "k_EGCMsgLookupAccountFromInput", - 67: "k_EGCMsgSendHTTPRequest", - 68: "k_EGCMsgSendHTTPRequestResponse", - 69: "k_EGCMsgPreTestSetup", - 70: "k_EGCMsgRecordSupportAction", - 71: "k_EGCMsgGetAccountDetails_DEPRECATED", - 73: "k_EGCMsgReceiveInterAppMessage", - 74: "k_EGCMsgFindAccounts", - 75: "k_EGCMsgPostAlert", - 76: "k_EGCMsgGetLicenses", - 77: "k_EGCMsgGetUserStats", - 78: "k_EGCMsgGetCommands", - 79: "k_EGCMsgGetCommandsResponse", - 80: "k_EGCMsgAddFreeLicense", - 81: "k_EGCMsgAddFreeLicenseResponse", - 82: "k_EGCMsgGetIPLocation", - 83: "k_EGCMsgGetIPLocationResponse", - 84: "k_EGCMsgSystemStatsSchema", - 85: "k_EGCMsgGetSystemStats", - 86: "k_EGCMsgGetSystemStatsResponse", - 87: "k_EGCMsgSendEmail", - 88: "k_EGCMsgSendEmailResponse", - 89: "k_EGCMsgGetEmailTemplate", - 90: "k_EGCMsgGetEmailTemplateResponse", - 91: "k_EGCMsgGrantGuestPass", - 92: "k_EGCMsgGrantGuestPassResponse", - 93: "k_EGCMsgGetAccountDetails", - 94: "k_EGCMsgGetAccountDetailsResponse", - 95: "k_EGCMsgGetPersonaNames", - 96: "k_EGCMsgGetPersonaNamesResponse", - 97: "k_EGCMsgMultiplexMsg", - 101: "k_EGCMsgWebAPIRegisterInterfaces", - 102: "k_EGCMsgWebAPIJobRequest", - 104: "k_EGCMsgWebAPIJobRequestHttpResponse", - 105: "k_EGCMsgWebAPIJobRequestForwardResponse", - 200: "k_EGCMsgMemCachedGet", - 201: "k_EGCMsgMemCachedGetResponse", - 202: "k_EGCMsgMemCachedSet", - 203: "k_EGCMsgMemCachedDelete", - 204: "k_EGCMsgMemCachedStats", - 205: "k_EGCMsgMemCachedStatsResponse", - 210: "k_EGCMsgSQLStats", - 211: "k_EGCMsgSQLStatsResponse", - 220: "k_EGCMsgMasterSetDirectory", - 221: "k_EGCMsgMasterSetDirectoryResponse", - 222: "k_EGCMsgMasterSetWebAPIRouting", - 223: "k_EGCMsgMasterSetWebAPIRoutingResponse", - 224: "k_EGCMsgMasterSetClientMsgRouting", - 225: "k_EGCMsgMasterSetClientMsgRoutingResponse", - 226: "k_EGCMsgSetOptions", - 227: "k_EGCMsgSetOptionsResponse", - 500: "k_EGCMsgSystemBase2", - 501: "k_EGCMsgGetPurchaseTrustStatus", - 502: "k_EGCMsgGetPurchaseTrustStatusResponse", - 503: "k_EGCMsgUpdateSession", - 504: "k_EGCMsgGCAccountVacStatusChange", - 505: "k_EGCMsgCheckFriendship", - 506: "k_EGCMsgCheckFriendshipResponse", - 507: "k_EGCMsgGetPartnerAccountLink", - 508: "k_EGCMsgGetPartnerAccountLinkResponse", - 509: "k_EGCMsgVSReportedSuspiciousActivity", -} -var EGCSystemMsg_value = map[string]int32{ - "k_EGCMsgInvalid": 0, - "k_EGCMsgMulti": 1, - "k_EGCMsgGenericReply": 10, - "k_EGCMsgSystemBase": 50, - "k_EGCMsgAchievementAwarded": 51, - "k_EGCMsgConCommand": 52, - "k_EGCMsgStartPlaying": 53, - "k_EGCMsgStopPlaying": 54, - "k_EGCMsgStartGameserver": 55, - "k_EGCMsgStopGameserver": 56, - "k_EGCMsgWGRequest": 57, - "k_EGCMsgWGResponse": 58, - "k_EGCMsgGetUserGameStatsSchema": 59, - "k_EGCMsgGetUserGameStatsSchemaResponse": 60, - "k_EGCMsgGetUserStatsDEPRECATED": 61, - "k_EGCMsgGetUserStatsResponse": 62, - "k_EGCMsgAppInfoUpdated": 63, - "k_EGCMsgValidateSession": 64, - "k_EGCMsgValidateSessionResponse": 65, - "k_EGCMsgLookupAccountFromInput": 66, - "k_EGCMsgSendHTTPRequest": 67, - "k_EGCMsgSendHTTPRequestResponse": 68, - "k_EGCMsgPreTestSetup": 69, - "k_EGCMsgRecordSupportAction": 70, - "k_EGCMsgGetAccountDetails_DEPRECATED": 71, - "k_EGCMsgReceiveInterAppMessage": 73, - "k_EGCMsgFindAccounts": 74, - "k_EGCMsgPostAlert": 75, - "k_EGCMsgGetLicenses": 76, - "k_EGCMsgGetUserStats": 77, - "k_EGCMsgGetCommands": 78, - "k_EGCMsgGetCommandsResponse": 79, - "k_EGCMsgAddFreeLicense": 80, - "k_EGCMsgAddFreeLicenseResponse": 81, - "k_EGCMsgGetIPLocation": 82, - "k_EGCMsgGetIPLocationResponse": 83, - "k_EGCMsgSystemStatsSchema": 84, - "k_EGCMsgGetSystemStats": 85, - "k_EGCMsgGetSystemStatsResponse": 86, - "k_EGCMsgSendEmail": 87, - "k_EGCMsgSendEmailResponse": 88, - "k_EGCMsgGetEmailTemplate": 89, - "k_EGCMsgGetEmailTemplateResponse": 90, - "k_EGCMsgGrantGuestPass": 91, - "k_EGCMsgGrantGuestPassResponse": 92, - "k_EGCMsgGetAccountDetails": 93, - "k_EGCMsgGetAccountDetailsResponse": 94, - "k_EGCMsgGetPersonaNames": 95, - "k_EGCMsgGetPersonaNamesResponse": 96, - "k_EGCMsgMultiplexMsg": 97, - "k_EGCMsgWebAPIRegisterInterfaces": 101, - "k_EGCMsgWebAPIJobRequest": 102, - "k_EGCMsgWebAPIJobRequestHttpResponse": 104, - "k_EGCMsgWebAPIJobRequestForwardResponse": 105, - "k_EGCMsgMemCachedGet": 200, - "k_EGCMsgMemCachedGetResponse": 201, - "k_EGCMsgMemCachedSet": 202, - "k_EGCMsgMemCachedDelete": 203, - "k_EGCMsgMemCachedStats": 204, - "k_EGCMsgMemCachedStatsResponse": 205, - "k_EGCMsgSQLStats": 210, - "k_EGCMsgSQLStatsResponse": 211, - "k_EGCMsgMasterSetDirectory": 220, - "k_EGCMsgMasterSetDirectoryResponse": 221, - "k_EGCMsgMasterSetWebAPIRouting": 222, - "k_EGCMsgMasterSetWebAPIRoutingResponse": 223, - "k_EGCMsgMasterSetClientMsgRouting": 224, - "k_EGCMsgMasterSetClientMsgRoutingResponse": 225, - "k_EGCMsgSetOptions": 226, - "k_EGCMsgSetOptionsResponse": 227, - "k_EGCMsgSystemBase2": 500, - "k_EGCMsgGetPurchaseTrustStatus": 501, - "k_EGCMsgGetPurchaseTrustStatusResponse": 502, - "k_EGCMsgUpdateSession": 503, - "k_EGCMsgGCAccountVacStatusChange": 504, - "k_EGCMsgCheckFriendship": 505, - "k_EGCMsgCheckFriendshipResponse": 506, - "k_EGCMsgGetPartnerAccountLink": 507, - "k_EGCMsgGetPartnerAccountLinkResponse": 508, - "k_EGCMsgVSReportedSuspiciousActivity": 509, -} - -func (x EGCSystemMsg) Enum() *EGCSystemMsg { - p := new(EGCSystemMsg) - *p = x - return p -} -func (x EGCSystemMsg) String() string { - return proto.EnumName(EGCSystemMsg_name, int32(x)) -} -func (x *EGCSystemMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCSystemMsg_value, data, "EGCSystemMsg") - if err != nil { - return err - } - *x = EGCSystemMsg(value) - return nil -} -func (EGCSystemMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{0} } - -type ESOMsg int32 - -const ( - ESOMsg_k_ESOMsg_Create ESOMsg = 21 - ESOMsg_k_ESOMsg_Update ESOMsg = 22 - ESOMsg_k_ESOMsg_Destroy ESOMsg = 23 - ESOMsg_k_ESOMsg_CacheSubscribed ESOMsg = 24 - ESOMsg_k_ESOMsg_CacheUnsubscribed ESOMsg = 25 - ESOMsg_k_ESOMsg_UpdateMultiple ESOMsg = 26 - ESOMsg_k_ESOMsg_CacheSubscriptionCheck ESOMsg = 27 - ESOMsg_k_ESOMsg_CacheSubscriptionRefresh ESOMsg = 28 - ESOMsg_k_ESOMsg_CacheSubscribedUpToDate ESOMsg = 29 -) - -var ESOMsg_name = map[int32]string{ - 21: "k_ESOMsg_Create", - 22: "k_ESOMsg_Update", - 23: "k_ESOMsg_Destroy", - 24: "k_ESOMsg_CacheSubscribed", - 25: "k_ESOMsg_CacheUnsubscribed", - 26: "k_ESOMsg_UpdateMultiple", - 27: "k_ESOMsg_CacheSubscriptionCheck", - 28: "k_ESOMsg_CacheSubscriptionRefresh", - 29: "k_ESOMsg_CacheSubscribedUpToDate", -} -var ESOMsg_value = map[string]int32{ - "k_ESOMsg_Create": 21, - "k_ESOMsg_Update": 22, - "k_ESOMsg_Destroy": 23, - "k_ESOMsg_CacheSubscribed": 24, - "k_ESOMsg_CacheUnsubscribed": 25, - "k_ESOMsg_UpdateMultiple": 26, - "k_ESOMsg_CacheSubscriptionCheck": 27, - "k_ESOMsg_CacheSubscriptionRefresh": 28, - "k_ESOMsg_CacheSubscribedUpToDate": 29, -} - -func (x ESOMsg) Enum() *ESOMsg { - p := new(ESOMsg) - *p = x - return p -} -func (x ESOMsg) String() string { - return proto.EnumName(ESOMsg_name, int32(x)) -} -func (x *ESOMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ESOMsg_value, data, "ESOMsg") - if err != nil { - return err - } - *x = ESOMsg(value) - return nil -} -func (ESOMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{1} } - -type EGCBaseClientMsg int32 - -const ( - EGCBaseClientMsg_k_EMsgGCPingRequest EGCBaseClientMsg = 3001 - EGCBaseClientMsg_k_EMsgGCPingResponse EGCBaseClientMsg = 3002 - EGCBaseClientMsg_k_EMsgGCClientWelcome EGCBaseClientMsg = 4004 - EGCBaseClientMsg_k_EMsgGCServerWelcome EGCBaseClientMsg = 4005 - EGCBaseClientMsg_k_EMsgGCClientHello EGCBaseClientMsg = 4006 - EGCBaseClientMsg_k_EMsgGCServerHello EGCBaseClientMsg = 4007 - EGCBaseClientMsg_k_EMsgGCClientGoodbye EGCBaseClientMsg = 4008 - EGCBaseClientMsg_k_EMsgGCServerGoodbye EGCBaseClientMsg = 4009 -) - -var EGCBaseClientMsg_name = map[int32]string{ - 3001: "k_EMsgGCPingRequest", - 3002: "k_EMsgGCPingResponse", - 4004: "k_EMsgGCClientWelcome", - 4005: "k_EMsgGCServerWelcome", - 4006: "k_EMsgGCClientHello", - 4007: "k_EMsgGCServerHello", - 4008: "k_EMsgGCClientGoodbye", - 4009: "k_EMsgGCServerGoodbye", -} -var EGCBaseClientMsg_value = map[string]int32{ - "k_EMsgGCPingRequest": 3001, - "k_EMsgGCPingResponse": 3002, - "k_EMsgGCClientWelcome": 4004, - "k_EMsgGCServerWelcome": 4005, - "k_EMsgGCClientHello": 4006, - "k_EMsgGCServerHello": 4007, - "k_EMsgGCClientGoodbye": 4008, - "k_EMsgGCServerGoodbye": 4009, -} - -func (x EGCBaseClientMsg) Enum() *EGCBaseClientMsg { - p := new(EGCBaseClientMsg) - *p = x - return p -} -func (x EGCBaseClientMsg) String() string { - return proto.EnumName(EGCBaseClientMsg_name, int32(x)) -} -func (x *EGCBaseClientMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCBaseClientMsg_value, data, "EGCBaseClientMsg") - if err != nil { - return err - } - *x = EGCBaseClientMsg(value) - return nil -} -func (EGCBaseClientMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{2} } - -type EGCToGCMsg int32 - -const ( - EGCToGCMsg_k_EGCToGCMsgMasterAck EGCToGCMsg = 150 - EGCToGCMsg_k_EGCToGCMsgMasterAckResponse EGCToGCMsg = 151 - EGCToGCMsg_k_EGCToGCMsgRouted EGCToGCMsg = 152 - EGCToGCMsg_k_EGCToGCMsgRoutedReply EGCToGCMsg = 153 - EGCToGCMsg_k_EMsgGCUpdateSubGCSessionInfo EGCToGCMsg = 154 - EGCToGCMsg_k_EMsgGCRequestSubGCSessionInfo EGCToGCMsg = 155 - EGCToGCMsg_k_EMsgGCRequestSubGCSessionInfoResponse EGCToGCMsg = 156 - EGCToGCMsg_k_EGCToGCMsgMasterStartupComplete EGCToGCMsg = 157 - EGCToGCMsg_k_EMsgGCToGCSOCacheSubscribe EGCToGCMsg = 158 - EGCToGCMsg_k_EMsgGCToGCSOCacheUnsubscribe EGCToGCMsg = 159 -) - -var EGCToGCMsg_name = map[int32]string{ - 150: "k_EGCToGCMsgMasterAck", - 151: "k_EGCToGCMsgMasterAckResponse", - 152: "k_EGCToGCMsgRouted", - 153: "k_EGCToGCMsgRoutedReply", - 154: "k_EMsgGCUpdateSubGCSessionInfo", - 155: "k_EMsgGCRequestSubGCSessionInfo", - 156: "k_EMsgGCRequestSubGCSessionInfoResponse", - 157: "k_EGCToGCMsgMasterStartupComplete", - 158: "k_EMsgGCToGCSOCacheSubscribe", - 159: "k_EMsgGCToGCSOCacheUnsubscribe", -} -var EGCToGCMsg_value = map[string]int32{ - "k_EGCToGCMsgMasterAck": 150, - "k_EGCToGCMsgMasterAckResponse": 151, - "k_EGCToGCMsgRouted": 152, - "k_EGCToGCMsgRoutedReply": 153, - "k_EMsgGCUpdateSubGCSessionInfo": 154, - "k_EMsgGCRequestSubGCSessionInfo": 155, - "k_EMsgGCRequestSubGCSessionInfoResponse": 156, - "k_EGCToGCMsgMasterStartupComplete": 157, - "k_EMsgGCToGCSOCacheSubscribe": 158, - "k_EMsgGCToGCSOCacheUnsubscribe": 159, -} - -func (x EGCToGCMsg) Enum() *EGCToGCMsg { - p := new(EGCToGCMsg) - *p = x - return p -} -func (x EGCToGCMsg) String() string { - return proto.EnumName(EGCToGCMsg_name, int32(x)) -} -func (x *EGCToGCMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EGCToGCMsg_value, data, "EGCToGCMsg") - if err != nil { - return err - } - *x = EGCToGCMsg(value) - return nil -} -func (EGCToGCMsg) EnumDescriptor() ([]byte, []int) { return system_fileDescriptor0, []int{3} } - -func init() { - proto.RegisterEnum("EGCSystemMsg", EGCSystemMsg_name, EGCSystemMsg_value) - proto.RegisterEnum("ESOMsg", ESOMsg_name, ESOMsg_value) - proto.RegisterEnum("EGCBaseClientMsg", EGCBaseClientMsg_name, EGCBaseClientMsg_value) - proto.RegisterEnum("EGCToGCMsg", EGCToGCMsg_name, EGCToGCMsg_value) -} - -var system_fileDescriptor0 = []byte{ - // 1379 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x57, 0x49, 0x73, 0x1b, 0x45, - 0x14, 0xce, 0x44, 0x05, 0x87, 0x2e, 0x28, 0x5e, 0x3a, 0x89, 0xed, 0x24, 0x4e, 0x94, 0x84, 0x2c, - 0xc4, 0x50, 0x39, 0x84, 0x7d, 0x47, 0x91, 0x64, 0x59, 0xc1, 0x8e, 0x15, 0x49, 0xb6, 0xd9, 0xcd, - 0x78, 0xd4, 0xb6, 0xa6, 0x2c, 0x4d, 0x0f, 0xdd, 0x3d, 0x06, 0xdd, 0xf8, 0x13, 0xac, 0x61, 0xb9, - 0xb0, 0xfe, 0x04, 0xf8, 0x05, 0xac, 0x17, 0xb8, 0xb2, 0x73, 0x84, 0x23, 0xfb, 0x52, 0xc5, 0x9b, - 0xad, 0xa7, 0x47, 0x8b, 0xb9, 0x8d, 0xfa, 0x7b, 0x7b, 0x7f, 0xef, 0xf5, 0x13, 0xa1, 0x5b, 0x8e, - 0x1c, 0x48, 0xc5, 0xfa, 0x7d, 0xb9, 0x25, 0xcf, 0xfb, 0x82, 0x2b, 0x3e, 0x77, 0xf5, 0x00, 0xb9, - 0xae, 0x5a, 0x2b, 0xb7, 0xa2, 0xf3, 0x25, 0xb9, 0x45, 0xf7, 0x93, 0x1b, 0xb6, 0xd7, 0xf1, 0x04, - 0xbf, 0xeb, 0xde, 0x8e, 0xdd, 0x73, 0x3b, 0xb0, 0x87, 0xee, 0x23, 0xd7, 0xa7, 0x87, 0x4b, 0x41, - 0x4f, 0xb9, 0x60, 0xd1, 0x19, 0x72, 0x20, 0x3d, 0xaa, 0x31, 0x8f, 0x09, 0xd7, 0x69, 0x32, 0xbf, - 0x37, 0x00, 0x42, 0xa7, 0x08, 0x4d, 0x91, 0xd8, 0xec, 0x45, 0x5b, 0x32, 0xb8, 0x40, 0x8f, 0x91, - 0xc3, 0xe9, 0x79, 0xc9, 0xe9, 0xba, 0x6c, 0x87, 0xf5, 0x99, 0xa7, 0x4a, 0xcf, 0xda, 0xa2, 0xc3, - 0x3a, 0x70, 0xab, 0xa9, 0x57, 0xe6, 0x5e, 0x99, 0xf7, 0xfb, 0xb6, 0xd7, 0x81, 0xdb, 0x4c, 0x4f, - 0x2d, 0x65, 0x0b, 0xd5, 0xe8, 0xd9, 0x03, 0xd7, 0xdb, 0x82, 0xdb, 0xe9, 0x34, 0xd9, 0x9f, 0x21, - 0xdc, 0x4f, 0x81, 0x3b, 0xe8, 0x11, 0x32, 0x9d, 0x53, 0xa9, 0xd9, 0x7d, 0x26, 0x99, 0xd8, 0x61, - 0x02, 0xee, 0xa4, 0x87, 0xc9, 0x94, 0xa9, 0x65, 0x60, 0x77, 0xd1, 0x83, 0x64, 0x5f, 0x8a, 0xad, - 0xd5, 0x9a, 0xec, 0x99, 0x80, 0x49, 0x05, 0x77, 0x9b, 0xa1, 0x85, 0xc7, 0xd2, 0xe7, 0x1e, 0xa6, - 0x74, 0x0f, 0x3d, 0x49, 0x8e, 0x65, 0x45, 0x50, 0x2b, 0x68, 0x26, 0xb4, 0x86, 0x2e, 0x95, 0x6c, - 0x39, 0x5d, 0xd6, 0xb7, 0xe1, 0x5e, 0x3a, 0x47, 0xce, 0xec, 0x2e, 0xa3, 0xed, 0xdd, 0x37, 0xc6, - 0x5e, 0x24, 0x57, 0xa9, 0x36, 0x9a, 0xd5, 0x72, 0xa9, 0x5d, 0xad, 0xc0, 0xfd, 0xf4, 0x38, 0x99, - 0x1d, 0x27, 0xa3, 0xad, 0x3c, 0x60, 0x26, 0x58, 0xf2, 0xfd, 0xba, 0xb7, 0xc9, 0x57, 0xfc, 0x8e, - 0xad, 0xb0, 0xc8, 0x0f, 0x9a, 0x95, 0x59, 0x0d, 0x2f, 0x17, 0x8f, 0x5b, 0x4c, 0x4a, 0x97, 0x7b, - 0xf0, 0x10, 0xbd, 0x91, 0x14, 0x27, 0x80, 0xda, 0x7a, 0xc9, 0x8c, 0x71, 0x91, 0xf3, 0xed, 0xc0, - 0x2f, 0x39, 0x0e, 0x0f, 0x3c, 0x35, 0x2f, 0x78, 0xbf, 0xee, 0xf9, 0x81, 0x82, 0x8b, 0xb9, 0xfa, - 0x33, 0xaf, 0xb3, 0xd0, 0x6e, 0x37, 0xd2, 0x62, 0x96, 0x4d, 0x2f, 0x43, 0xa0, 0xf6, 0x52, 0x31, - 0x2f, 0xbd, 0x21, 0x58, 0x1b, 0xc1, 0x16, 0x53, 0x81, 0x0f, 0x55, 0x5a, 0x24, 0x47, 0x52, 0xa4, - 0xc9, 0x1c, 0x2e, 0x3a, 0xad, 0xc0, 0xf7, 0xb9, 0x50, 0x25, 0x47, 0x85, 0x59, 0xcc, 0xd3, 0x9b, - 0xc8, 0x29, 0xa3, 0x40, 0x49, 0x74, 0x15, 0xa6, 0x6c, 0xb7, 0x27, 0xd7, 0x8d, 0x52, 0xd6, 0xcc, - 0x54, 0xd0, 0x14, 0x73, 0x77, 0x58, 0xdd, 0x53, 0x4c, 0x60, 0xd1, 0x96, 0x30, 0x6d, 0x7b, 0x8b, - 0x41, 0xdd, 0x0c, 0x64, 0xde, 0xf5, 0x3a, 0x89, 0x39, 0x09, 0x97, 0x4c, 0xae, 0x34, 0xb8, 0x54, - 0xa5, 0x1e, 0x13, 0x0a, 0x1e, 0x36, 0x49, 0x89, 0xee, 0x17, 0x5d, 0x87, 0x61, 0x46, 0x12, 0x16, - 0xf3, 0x1d, 0x93, 0x5d, 0x1c, 0x2c, 0x0d, 0xa9, 0x24, 0xcc, 0x97, 0x70, 0xd9, 0xcc, 0xd5, 0x00, - 0x74, 0x99, 0x96, 0x73, 0x57, 0xdd, 0xe9, 0xcc, 0x0b, 0xc6, 0x12, 0x87, 0xd0, 0x30, 0xb3, 0xcb, - 0x63, 0x5a, 0xff, 0x0a, 0x3d, 0x44, 0x0e, 0x1a, 0x0e, 0xea, 0x8d, 0x45, 0xee, 0xd8, 0x51, 0x19, - 0x9b, 0xf4, 0x04, 0x39, 0x3a, 0x16, 0xd2, 0xda, 0x2d, 0x7a, 0x94, 0x1c, 0xca, 0x77, 0xba, 0xc9, - 0xfc, 0xb6, 0x19, 0x1c, 0x5a, 0x30, 0x24, 0x60, 0x65, 0x88, 0xe9, 0x06, 0xa6, 0xcd, 0xaf, 0x9a, - 0x05, 0x0e, 0x89, 0x52, 0xed, 0xe3, 0x0d, 0xc2, 0x5a, 0xce, 0x6b, 0x7a, 0xac, 0xb5, 0x1e, 0xa1, - 0xb3, 0x64, 0xc6, 0xb0, 0x1c, 0xa1, 0x6d, 0xd6, 0xf7, 0x7b, 0x48, 0x66, 0x78, 0x94, 0x9e, 0x22, - 0xc7, 0x27, 0xa1, 0xda, 0xc6, 0x63, 0xb9, 0xc8, 0x85, 0xed, 0xa9, 0x5a, 0xc8, 0xce, 0x86, 0x2d, - 0x25, 0x3c, 0x9e, 0x8b, 0x3c, 0x87, 0x69, 0xfd, 0x27, 0xcc, 0x10, 0x47, 0x28, 0x08, 0x4f, 0xd2, - 0xd3, 0xe4, 0xc4, 0x44, 0x58, 0x5b, 0x79, 0xca, 0xec, 0x22, 0x14, 0x6b, 0x30, 0x21, 0xb9, 0x67, - 0x5f, 0x0e, 0xc7, 0x15, 0xac, 0x9b, 0x5d, 0x34, 0x04, 0x6a, 0x0b, 0x4f, 0x9b, 0x94, 0x8b, 0xe6, - 0xb6, 0xdf, 0x63, 0xcf, 0xe1, 0x37, 0xd8, 0x66, 0x1d, 0xd6, 0xd8, 0x46, 0xa9, 0x51, 0x6f, 0xb2, - 0x2d, 0x17, 0x2f, 0x41, 0x44, 0x1d, 0xb0, 0x69, 0x3b, 0xe8, 0x84, 0x99, 0xb5, 0x8c, 0xa5, 0x2e, - 0xf1, 0x8d, 0xb4, 0x91, 0x37, 0xcd, 0x46, 0x1b, 0x46, 0x17, 0x94, 0xf2, 0x75, 0x1c, 0x5d, 0x7a, - 0x33, 0x39, 0x3b, 0x49, 0x72, 0x9e, 0x8b, 0xf0, 0x05, 0xd0, 0xc2, 0x2e, 0x72, 0x32, 0x0b, 0x9a, - 0xf5, 0xcb, 0x36, 0xd2, 0xa9, 0x83, 0x29, 0xc2, 0x47, 0x16, 0x72, 0x72, 0x76, 0x1c, 0xa4, 0x95, - 0x3f, 0xb6, 0xc6, 0x6a, 0xe3, 0xe8, 0x80, 0x4f, 0x2c, 0xcc, 0x66, 0x7a, 0x04, 0xaa, 0xb0, 0x1e, - 0x43, 0x62, 0x7c, 0x6a, 0x61, 0xb5, 0xa7, 0x46, 0x15, 0x23, 0xb6, 0x7e, 0x66, 0x61, 0xb5, 0x8f, - 0x8d, 0x07, 0xb5, 0xeb, 0xcf, 0x2d, 0xe4, 0x2b, 0x68, 0x62, 0x5e, 0x59, 0x8c, 0x75, 0xbf, 0xb0, - 0x90, 0x0c, 0x33, 0xc3, 0xc7, 0x5a, 0xeb, 0x4b, 0x0b, 0x7b, 0x5c, 0x3f, 0x8b, 0x4b, 0x76, 0x78, - 0x03, 0x18, 0x6d, 0xc5, 0x15, 0xcc, 0x51, 0x5c, 0x0c, 0xe0, 0x2b, 0x8b, 0x9e, 0x25, 0x27, 0x27, - 0x0b, 0x68, 0x4b, 0x5f, 0xe7, 0x83, 0x4c, 0x05, 0x93, 0xcb, 0xe5, 0x81, 0x0a, 0x5f, 0xc6, 0x6f, - 0x2c, 0xbc, 0x8a, 0x33, 0xbb, 0x0b, 0x69, 0x8b, 0xdf, 0x5a, 0xf4, 0x4c, 0x46, 0x54, 0x2d, 0x5c, - 0xee, 0xb9, 0xf8, 0x6c, 0x87, 0x23, 0x33, 0x31, 0xfa, 0x9d, 0x45, 0xcf, 0x93, 0x73, 0xff, 0x2b, - 0xa7, 0xed, 0x7e, 0x6f, 0xe1, 0xc0, 0xcb, 0x56, 0x04, 0xa6, 0x96, 0xfd, 0x70, 0xae, 0x48, 0xf8, - 0x21, 0x57, 0x8c, 0x0c, 0xd0, 0x9a, 0x3f, 0x86, 0x6b, 0xc7, 0xfe, 0xd1, 0xe5, 0xe2, 0x02, 0xfc, - 0x52, 0x30, 0xb3, 0x0f, 0x1b, 0x22, 0x10, 0x4e, 0x17, 0xa1, 0xb6, 0x08, 0xf0, 0xe9, 0xc0, 0x9a, - 0x07, 0x12, 0x7e, 0x2d, 0x98, 0xd9, 0x8f, 0x17, 0xd2, 0xbe, 0x7e, 0x2b, 0xe0, 0x14, 0xd0, 0xc3, - 0x31, 0x7e, 0x40, 0xd3, 0x97, 0xf2, 0xf7, 0x02, 0xb6, 0x70, 0x36, 0x47, 0xca, 0x49, 0x07, 0xaf, - 0xda, 0x4e, 0x6c, 0xa4, 0xdc, 0xb5, 0x3d, 0x7c, 0x3c, 0xfe, 0x28, 0x98, 0x94, 0x2b, 0x77, 0x99, - 0xb3, 0x3d, 0x2f, 0xb0, 0x28, 0x1d, 0xd9, 0x75, 0x7d, 0xf8, 0xb3, 0x80, 0x4d, 0x58, 0x9c, 0x80, - 0xea, 0x30, 0xfe, 0x2a, 0xe0, 0xc0, 0x31, 0x07, 0x71, 0x03, 0xd7, 0x19, 0x5c, 0xb7, 0x12, 0x97, - 0x8b, 0xae, 0xb7, 0x0d, 0x7f, 0x17, 0x70, 0xc9, 0x38, 0xbd, 0xab, 0x8c, 0xb6, 0xf7, 0x4f, 0x81, - 0x9e, 0xcb, 0xda, 0x76, 0xb5, 0x85, 0x4b, 0x1b, 0xbe, 0x9d, 0x48, 0xe6, 0x40, 0xfa, 0xae, 0xe3, - 0xf2, 0x40, 0x86, 0xef, 0xe8, 0x8e, 0xab, 0x06, 0xf0, 0x6f, 0x61, 0xee, 0x85, 0xbd, 0xe4, 0xda, - 0x6a, 0x6b, 0x39, 0xdb, 0x0b, 0xa3, 0xef, 0xf5, 0xb2, 0x60, 0xe1, 0x34, 0x3d, 0x98, 0x3b, 0x8c, - 0x4b, 0x04, 0x53, 0xf4, 0x40, 0xd4, 0x06, 0xf1, 0x61, 0x05, 0x3b, 0x5c, 0xf0, 0x01, 0x4c, 0x27, - 0xa3, 0x24, 0xd1, 0x0f, 0xfb, 0xa7, 0x15, 0x6c, 0x48, 0x47, 0xb8, 0x1b, 0xb8, 0x96, 0xcc, 0x24, - 0xbb, 0xa1, 0x81, 0xae, 0x78, 0x32, 0xc3, 0x0f, 0x25, 0xa3, 0xd0, 0x74, 0x94, 0xce, 0x33, 0x38, - 0x9c, 0x8c, 0xc2, 0x51, 0xd3, 0x11, 0x7b, 0xa2, 0xc2, 0xc2, 0x91, 0x64, 0xe6, 0x4e, 0x10, 0x6a, - 0xb2, 0x4d, 0xc1, 0x64, 0x17, 0x66, 0x93, 0xb9, 0x38, 0x36, 0xcc, 0x15, 0xbf, 0xcd, 0x2b, 0x61, - 0x8a, 0x47, 0xe7, 0x7e, 0xb2, 0x08, 0x60, 0x05, 0x43, 0xee, 0x69, 0x9a, 0x27, 0xd4, 0x8c, 0x08, - 0xd1, 0x88, 0xf8, 0x1e, 0xcf, 0xc9, 0x0f, 0xa6, 0x93, 0x99, 0x64, 0x20, 0xc9, 0x65, 0x7c, 0x38, - 0x9d, 0x70, 0x2c, 0x82, 0x62, 0x4b, 0x6b, 0xac, 0xe7, 0xf0, 0x3e, 0x83, 0xb7, 0x8a, 0x26, 0xd6, - 0x8a, 0x16, 0xd4, 0x14, 0x7b, 0xbb, 0x68, 0x3a, 0x8b, 0xf5, 0x16, 0x58, 0xaf, 0xc7, 0xe1, 0x9d, - 0x1c, 0x12, 0x6b, 0xc5, 0xc8, 0xbb, 0xc5, 0x51, 0x5f, 0x35, 0xce, 0x3b, 0x1b, 0x03, 0x06, 0xef, - 0x8d, 0xf1, 0x95, 0x62, 0xef, 0x17, 0xe7, 0x7e, 0xde, 0x4b, 0x08, 0x66, 0xdb, 0xe6, 0x11, 0x67, - 0x74, 0x5b, 0x24, 0xbf, 0xe3, 0x86, 0x2f, 0x61, 0x91, 0x5f, 0xb4, 0x34, 0x57, 0x87, 0x31, 0x9d, - 0xf2, 0x4b, 0x59, 0xf3, 0x27, 0x32, 0xe1, 0x78, 0xc0, 0x3b, 0x7e, 0x39, 0x9b, 0xcf, 0x39, 0x20, - 0xfe, 0x57, 0xf1, 0x4a, 0x3a, 0xdd, 0xa2, 0x08, 0x93, 0x6e, 0x0c, 0x36, 0xc2, 0x60, 0xa3, 0x96, - 0x0c, 0x97, 0x5c, 0x78, 0xd5, 0x4a, 0x3a, 0x2a, 0x12, 0x4a, 0xea, 0x3f, 0x22, 0x75, 0xd5, 0xa2, - 0xb7, 0x44, 0xcf, 0xd1, 0x6e, 0x52, 0x3a, 0xde, 0xd7, 0xb2, 0x21, 0x98, 0xcb, 0x29, 0xfa, 0x5b, - 0x11, 0xf8, 0xb8, 0x92, 0xf9, 0xd1, 0x03, 0xf2, 0x7a, 0xfa, 0x38, 0x45, 0x56, 0x43, 0xd1, 0xd6, - 0x72, 0x9e, 0x3f, 0xf0, 0x46, 0x2e, 0x07, 0x43, 0xc4, 0xe0, 0x3a, 0xbc, 0x69, 0x5d, 0xbc, 0x66, - 0xc1, 0x7a, 0xde, 0xda, 0xf3, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xd8, 0x05, 0xd1, 0xae, - 0x0d, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/tf.pb.go b/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/tf.pb.go deleted file mode 100644 index 7f3a5664..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/protocol/protobuf/tf.pb.go +++ /dev/null @@ -1,7122 +0,0 @@ -// Code generated by protoc-gen-go. -// source: tf_gcmessages.proto -// DO NOT EDIT! - -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type ETFGCMsg int32 - -const ( - ETFGCMsg_k_EMsgGCReportWarKill ETFGCMsg = 5001 - ETFGCMsg_k_EMsgGCVoteKickBanPlayer ETFGCMsg = 5018 - ETFGCMsg_k_EMsgGCVoteKickBanPlayerResult ETFGCMsg = 5019 - ETFGCMsg_k_EMsgGCKickPlayer_DEPRECATED ETFGCMsg = 5020 - ETFGCMsg_k_EMsgGCStartedTraining_DEPRECATED ETFGCMsg = 5021 - ETFGCMsg_k_EMsgGCFreeTrial_ChooseMostHelpfulFriend ETFGCMsg = 5022 - ETFGCMsg_k_EMsgGCRequestTF2Friends ETFGCMsg = 5023 - ETFGCMsg_k_EMsgGCRequestTF2FriendsResponse ETFGCMsg = 5024 - ETFGCMsg_k_EMsgGCReplay_SubmitContestEntry ETFGCMsg = 5026 - ETFGCMsg_k_EMsgGCReplay_SubmitContestEntryResponse ETFGCMsg = 5027 - ETFGCMsg_k_EMsgGCSaxxy_Awarded ETFGCMsg = 5029 - ETFGCMsg_k_EMsgGCFreeTrial_ThankedBySomeone ETFGCMsg = 5028 - ETFGCMsg_k_EMsgGCFreeTrial_ThankedSomeone ETFGCMsg = 5030 - ETFGCMsg_k_EMsgGCFreeTrial_ConvertedToPremium ETFGCMsg = 5031 - ETFGCMsg_k_EMsgGCMeetThePyroSilliness_BananaCraft_DEPRECATED ETFGCMsg = 5032 - ETFGCMsg_k_EMsgGCMVMARG_HighFiveSuccessResponse_DEPRECATED ETFGCMsg = 5033 - ETFGCMsg_k_EMsgGCMVMARG_HighFiveOnClient_DEPRECATED ETFGCMsg = 5034 - ETFGCMsg_k_EMsgGCCoaching_AddToCoaches ETFGCMsg = 5200 - ETFGCMsg_k_EMsgGCCoaching_AddToCoachesResponse ETFGCMsg = 5201 - ETFGCMsg_k_EMsgGCCoaching_RemoveFromCoaches ETFGCMsg = 5202 - ETFGCMsg_k_EMsgGCCoaching_RemoveFromCoachesResponse ETFGCMsg = 5203 - ETFGCMsg_k_EMsgGCCoaching_FindCoach ETFGCMsg = 5204 - ETFGCMsg_k_EMsgGCCoaching_FindCoachResponse ETFGCMsg = 5205 - ETFGCMsg_k_EMsgGCCoaching_AskCoach ETFGCMsg = 5206 - ETFGCMsg_k_EMsgGCCoaching_AskCoachResponse ETFGCMsg = 5207 - ETFGCMsg_k_EMsgGCCoaching_CoachJoinGame ETFGCMsg = 5208 - ETFGCMsg_k_EMsgGCCoaching_CoachJoining ETFGCMsg = 5209 - ETFGCMsg_k_EMsgGCCoaching_CoachJoined ETFGCMsg = 5210 - ETFGCMsg_k_EMsgGCCoaching_LikeCurrentCoach ETFGCMsg = 5211 - ETFGCMsg_k_EMsgGCCoaching_RemoveCurrentCoach ETFGCMsg = 5212 - ETFGCMsg_k_EMsgGCCoaching_AlreadyRatedCoach ETFGCMsg = 5213 - ETFGCMsg_k_EMsgGC_Duel_Request ETFGCMsg = 5500 - ETFGCMsg_k_EMsgGC_Duel_Response ETFGCMsg = 5501 - ETFGCMsg_k_EMsgGC_Duel_Results ETFGCMsg = 5502 - ETFGCMsg_k_EMsgGC_Duel_Status ETFGCMsg = 5503 - ETFGCMsg_k_EMsgGC_Halloween_ReservedItem_DEPRECATED ETFGCMsg = 5600 - ETFGCMsg_k_EMsgGC_Halloween_GrantItem_DEPRECATED ETFGCMsg = 5601 - ETFGCMsg_k_EMsgGC_Halloween_GrantItemResponse_DEPRECATED ETFGCMsg = 5604 - ETFGCMsg_k_EMsgGC_Halloween_Cheat_QueryResponse_DEPRECATED ETFGCMsg = 5605 - ETFGCMsg_k_EMsgGC_Halloween_ItemClaimed_DEPRECATED ETFGCMsg = 5606 - ETFGCMsg_k_EMsgGC_Halloween_ReservedItem ETFGCMsg = 5607 - ETFGCMsg_k_EMsgGC_Halloween_GrantItem ETFGCMsg = 5608 - ETFGCMsg_k_EMsgGC_Halloween_GrantItemResponse ETFGCMsg = 5609 - ETFGCMsg_k_EMsgGC_Halloween_Cheat_QueryResponse_DEPRECATED_2 ETFGCMsg = 5610 - ETFGCMsg_k_EMsgGC_Halloween_ItemClaimed_DEPRECATED_2 ETFGCMsg = 5611 - ETFGCMsg_k_EMsgGC_Halloween_ServerBossEvent ETFGCMsg = 5612 - ETFGCMsg_k_EMsgGC_Halloween_Merasmus2012 ETFGCMsg = 5613 - ETFGCMsg_k_EMsgGC_Halloween_UpdateMerasmusLootLevel ETFGCMsg = 5614 - ETFGCMsg_k_EMsgGC_GameServer_LevelInfo ETFGCMsg = 5700 - ETFGCMsg_k_EMsgGC_GameServer_AuthChallenge ETFGCMsg = 5701 - ETFGCMsg_k_EMsgGC_GameServer_AuthChallengeResponse ETFGCMsg = 5702 - ETFGCMsg_k_EMsgGC_GameServer_CreateIdentity ETFGCMsg = 5703 - ETFGCMsg_k_EMsgGC_GameServer_CreateIdentityResponse ETFGCMsg = 5704 - ETFGCMsg_k_EMsgGC_GameServer_List ETFGCMsg = 5705 - ETFGCMsg_k_EMsgGC_GameServer_ListResponse ETFGCMsg = 5706 - ETFGCMsg_k_EMsgGC_GameServer_AuthResult ETFGCMsg = 5707 - ETFGCMsg_k_EMsgGC_GameServer_ResetIdentity ETFGCMsg = 5708 - ETFGCMsg_k_EMsgGC_GameServer_ResetIdentityResponse ETFGCMsg = 5709 - ETFGCMsg_k_EMsgGC_Client_UseServerModificationItem ETFGCMsg = 5710 - ETFGCMsg_k_EMsgGC_Client_UseServerModificationItem_Response ETFGCMsg = 5711 - ETFGCMsg_k_EMsgGC_GameServer_UseServerModificationItem ETFGCMsg = 5712 - ETFGCMsg_k_EMsgGC_GameServer_UseServerModificationItem_Response ETFGCMsg = 5713 - ETFGCMsg_k_EMsgGC_GameServer_ServerModificationItemExpired ETFGCMsg = 5714 - ETFGCMsg_k_EMsgGC_GameServer_ModificationItemState ETFGCMsg = 5715 - ETFGCMsg_k_EMsgGC_GameServer_AckPolicy ETFGCMsg = 5716 - ETFGCMsg_k_EMsgGC_GameServer_AckPolicyResponse ETFGCMsg = 5717 - ETFGCMsg_k_EMsgGC_QP_ScoreServers ETFGCMsg = 5800 - ETFGCMsg_k_EMsgGC_QP_ScoreServersResponse ETFGCMsg = 5801 - ETFGCMsg_k_EMsgGC_QP_PlayerJoining ETFGCMsg = 5802 - ETFGCMsg_k_EMsgGC_PickupItemEligibility_Query_DEPRECATED ETFGCMsg = 6000 - ETFGCMsg_k_EMsgGC_PickupItemEligibility_Query_DEPRECATED_2 ETFGCMsg = 6001 - ETFGCMsg_k_EMsgGC_IncrementKillCountAttribute_DEPRECATED ETFGCMsg = 6100 - ETFGCMsg_k_EMsgGC_IncrementKillCountResponse_DEPRECATED ETFGCMsg = 6101 - ETFGCMsg_k_EMsgGCGameMatchSignOut ETFGCMsg = 6204 - ETFGCMsg_k_EMsgGCCreateOrUpdateParty ETFGCMsg = 6233 - ETFGCMsg_k_EMsgGCAbandonCurrentGame ETFGCMsg = 6235 - ETFGCMsg_k_EMsgForceSOCacheResend ETFGCMsg = 6237 - ETFGCMsg_k_EMsgGCRequestChatChannelList ETFGCMsg = 6260 - ETFGCMsg_k_EMsgGCRequestChatChannelListResponse ETFGCMsg = 6261 - ETFGCMsg_k_EMsgGCReadyUp ETFGCMsg = 6270 - ETFGCMsg_k_EMsgGCKickedFromMatchmakingQueue ETFGCMsg = 6271 - ETFGCMsg_k_EMsgGCLeaverDetected ETFGCMsg = 6272 - ETFGCMsg_k_EMsgGCLeaverDetectedResponse ETFGCMsg = 6287 - ETFGCMsg_k_EMsgGCPlayerFailedToConnect ETFGCMsg = 6288 - ETFGCMsg_k_EMsgGCExitMatchmaking ETFGCMsg = 6289 - ETFGCMsg_k_EMsgGCAcceptInvite ETFGCMsg = 6291 - ETFGCMsg_k_EMsgGCAcceptInviteResponse ETFGCMsg = 6292 - ETFGCMsg_k_EMsgGCMatchmakingProgress ETFGCMsg = 6293 - ETFGCMsg_k_EMsgGCMvMVictoryInfo ETFGCMsg = 6294 - ETFGCMsg_k_EMsgGCGameServerMatchmakingStatus ETFGCMsg = 6295 - ETFGCMsg_k_EMsgGCCreateOrUpdatePartyReply ETFGCMsg = 6296 - ETFGCMsg_k_EMsgGCMvMVictory ETFGCMsg = 6297 - ETFGCMsg_k_EMsgGCMvMVictoryReply ETFGCMsg = 6298 - ETFGCMsg_k_EMsgGCGameServerKickingLobby ETFGCMsg = 6299 - ETFGCMsg_k_EMsgGCLeaveGameAndPrepareToJoinParty ETFGCMsg = 6300 - ETFGCMsg_k_EMsgGCRemovePlayerFromLobby ETFGCMsg = 6301 - ETFGCMsg_k_EMsgGCSetLobbySafeToLeave ETFGCMsg = 6302 - ETFGCMsg_k_EMsgGC_UpdatePeriodicEvent ETFGCMsg = 6400 - ETFGCMsg_k_EMsgGC_DuckLeaderboard_IndividualUpdate ETFGCMsg = 6401 - ETFGCMsg_k_EMsgGC_Client2GCEconPreviewDataBlockRequest ETFGCMsg = 6402 - ETFGCMsg_k_EMsgGC_Client2GCEconPreviewDataBlockResponse ETFGCMsg = 6403 - ETFGCMsg_k_EMsgGC_ClientVerificationChallenge ETFGCMsg = 6500 - ETFGCMsg_k_EMsgGC_ClientVerificationChallengeResponse ETFGCMsg = 6501 - ETFGCMsg_k_EMsgGC_ClientVerificationVerboseResponse ETFGCMsg = 6502 - ETFGCMsg_k_EMsgGC_ClientSetItemSlotAttribute ETFGCMsg = 6503 - ETFGCMsg_k_EMsgGC_PlayerSkillRating_Adjustment ETFGCMsg = 6504 - ETFGCMsg_k_EMsgGC_SpyVsEngyWar_IndividualUpdate ETFGCMsg = 6505 - ETFGCMsg_k_EMsgGC_SpyVsEngyWar_JoinWar ETFGCMsg = 6506 - ETFGCMsg_k_EMsgGC_SpyVsEngyWar_RequestGlobalStats ETFGCMsg = 6507 - ETFGCMsg_k_EMsgGC_SpyVsEngyWar_GlobalStatsResponse ETFGCMsg = 6508 - ETFGCMsg_k_EMsgGC_SpyVsEngyWar_SetKillCamMessage ETFGCMsg = 6509 - ETFGCMsg_k_EMsgGC_WorldItemPlacement_Attribute ETFGCMsg = 6510 - ETFGCMsg_k_EMsgGC_WorldItemPlacement_Update ETFGCMsg = 6511 - ETFGCMsg_k_EMsgGC_Match_Result ETFGCMsg = 6512 - ETFGCMsg_k_EMsgGCVoteKickPlayerRequest ETFGCMsg = 6513 - ETFGCMsg_k_EMsgGCVoteKickPlayerRequestResponse ETFGCMsg = 6514 - ETFGCMsg_k_EMsgGCDev_GrantWarKill ETFGCMsg = 10001 -) - -var ETFGCMsg_name = map[int32]string{ - 5001: "k_EMsgGCReportWarKill", - 5018: "k_EMsgGCVoteKickBanPlayer", - 5019: "k_EMsgGCVoteKickBanPlayerResult", - 5020: "k_EMsgGCKickPlayer_DEPRECATED", - 5021: "k_EMsgGCStartedTraining_DEPRECATED", - 5022: "k_EMsgGCFreeTrial_ChooseMostHelpfulFriend", - 5023: "k_EMsgGCRequestTF2Friends", - 5024: "k_EMsgGCRequestTF2FriendsResponse", - 5026: "k_EMsgGCReplay_SubmitContestEntry", - 5027: "k_EMsgGCReplay_SubmitContestEntryResponse", - 5029: "k_EMsgGCSaxxy_Awarded", - 5028: "k_EMsgGCFreeTrial_ThankedBySomeone", - 5030: "k_EMsgGCFreeTrial_ThankedSomeone", - 5031: "k_EMsgGCFreeTrial_ConvertedToPremium", - 5032: "k_EMsgGCMeetThePyroSilliness_BananaCraft_DEPRECATED", - 5033: "k_EMsgGCMVMARG_HighFiveSuccessResponse_DEPRECATED", - 5034: "k_EMsgGCMVMARG_HighFiveOnClient_DEPRECATED", - 5200: "k_EMsgGCCoaching_AddToCoaches", - 5201: "k_EMsgGCCoaching_AddToCoachesResponse", - 5202: "k_EMsgGCCoaching_RemoveFromCoaches", - 5203: "k_EMsgGCCoaching_RemoveFromCoachesResponse", - 5204: "k_EMsgGCCoaching_FindCoach", - 5205: "k_EMsgGCCoaching_FindCoachResponse", - 5206: "k_EMsgGCCoaching_AskCoach", - 5207: "k_EMsgGCCoaching_AskCoachResponse", - 5208: "k_EMsgGCCoaching_CoachJoinGame", - 5209: "k_EMsgGCCoaching_CoachJoining", - 5210: "k_EMsgGCCoaching_CoachJoined", - 5211: "k_EMsgGCCoaching_LikeCurrentCoach", - 5212: "k_EMsgGCCoaching_RemoveCurrentCoach", - 5213: "k_EMsgGCCoaching_AlreadyRatedCoach", - 5500: "k_EMsgGC_Duel_Request", - 5501: "k_EMsgGC_Duel_Response", - 5502: "k_EMsgGC_Duel_Results", - 5503: "k_EMsgGC_Duel_Status", - 5600: "k_EMsgGC_Halloween_ReservedItem_DEPRECATED", - 5601: "k_EMsgGC_Halloween_GrantItem_DEPRECATED", - 5604: "k_EMsgGC_Halloween_GrantItemResponse_DEPRECATED", - 5605: "k_EMsgGC_Halloween_Cheat_QueryResponse_DEPRECATED", - 5606: "k_EMsgGC_Halloween_ItemClaimed_DEPRECATED", - 5607: "k_EMsgGC_Halloween_ReservedItem", - 5608: "k_EMsgGC_Halloween_GrantItem", - 5609: "k_EMsgGC_Halloween_GrantItemResponse", - 5610: "k_EMsgGC_Halloween_Cheat_QueryResponse_DEPRECATED_2", - 5611: "k_EMsgGC_Halloween_ItemClaimed_DEPRECATED_2", - 5612: "k_EMsgGC_Halloween_ServerBossEvent", - 5613: "k_EMsgGC_Halloween_Merasmus2012", - 5614: "k_EMsgGC_Halloween_UpdateMerasmusLootLevel", - 5700: "k_EMsgGC_GameServer_LevelInfo", - 5701: "k_EMsgGC_GameServer_AuthChallenge", - 5702: "k_EMsgGC_GameServer_AuthChallengeResponse", - 5703: "k_EMsgGC_GameServer_CreateIdentity", - 5704: "k_EMsgGC_GameServer_CreateIdentityResponse", - 5705: "k_EMsgGC_GameServer_List", - 5706: "k_EMsgGC_GameServer_ListResponse", - 5707: "k_EMsgGC_GameServer_AuthResult", - 5708: "k_EMsgGC_GameServer_ResetIdentity", - 5709: "k_EMsgGC_GameServer_ResetIdentityResponse", - 5710: "k_EMsgGC_Client_UseServerModificationItem", - 5711: "k_EMsgGC_Client_UseServerModificationItem_Response", - 5712: "k_EMsgGC_GameServer_UseServerModificationItem", - 5713: "k_EMsgGC_GameServer_UseServerModificationItem_Response", - 5714: "k_EMsgGC_GameServer_ServerModificationItemExpired", - 5715: "k_EMsgGC_GameServer_ModificationItemState", - 5716: "k_EMsgGC_GameServer_AckPolicy", - 5717: "k_EMsgGC_GameServer_AckPolicyResponse", - 5800: "k_EMsgGC_QP_ScoreServers", - 5801: "k_EMsgGC_QP_ScoreServersResponse", - 5802: "k_EMsgGC_QP_PlayerJoining", - 6000: "k_EMsgGC_PickupItemEligibility_Query_DEPRECATED", - 6001: "k_EMsgGC_PickupItemEligibility_Query_DEPRECATED_2", - 6100: "k_EMsgGC_IncrementKillCountAttribute_DEPRECATED", - 6101: "k_EMsgGC_IncrementKillCountResponse_DEPRECATED", - 6204: "k_EMsgGCGameMatchSignOut", - 6233: "k_EMsgGCCreateOrUpdateParty", - 6235: "k_EMsgGCAbandonCurrentGame", - 6237: "k_EMsgForceSOCacheResend", - 6260: "k_EMsgGCRequestChatChannelList", - 6261: "k_EMsgGCRequestChatChannelListResponse", - 6270: "k_EMsgGCReadyUp", - 6271: "k_EMsgGCKickedFromMatchmakingQueue", - 6272: "k_EMsgGCLeaverDetected", - 6287: "k_EMsgGCLeaverDetectedResponse", - 6288: "k_EMsgGCPlayerFailedToConnect", - 6289: "k_EMsgGCExitMatchmaking", - 6291: "k_EMsgGCAcceptInvite", - 6292: "k_EMsgGCAcceptInviteResponse", - 6293: "k_EMsgGCMatchmakingProgress", - 6294: "k_EMsgGCMvMVictoryInfo", - 6295: "k_EMsgGCGameServerMatchmakingStatus", - 6296: "k_EMsgGCCreateOrUpdatePartyReply", - 6297: "k_EMsgGCMvMVictory", - 6298: "k_EMsgGCMvMVictoryReply", - 6299: "k_EMsgGCGameServerKickingLobby", - 6300: "k_EMsgGCLeaveGameAndPrepareToJoinParty", - 6301: "k_EMsgGCRemovePlayerFromLobby", - 6302: "k_EMsgGCSetLobbySafeToLeave", - 6400: "k_EMsgGC_UpdatePeriodicEvent", - 6401: "k_EMsgGC_DuckLeaderboard_IndividualUpdate", - 6402: "k_EMsgGC_Client2GCEconPreviewDataBlockRequest", - 6403: "k_EMsgGC_Client2GCEconPreviewDataBlockResponse", - 6500: "k_EMsgGC_ClientVerificationChallenge", - 6501: "k_EMsgGC_ClientVerificationChallengeResponse", - 6502: "k_EMsgGC_ClientVerificationVerboseResponse", - 6503: "k_EMsgGC_ClientSetItemSlotAttribute", - 6504: "k_EMsgGC_PlayerSkillRating_Adjustment", - 6505: "k_EMsgGC_SpyVsEngyWar_IndividualUpdate", - 6506: "k_EMsgGC_SpyVsEngyWar_JoinWar", - 6507: "k_EMsgGC_SpyVsEngyWar_RequestGlobalStats", - 6508: "k_EMsgGC_SpyVsEngyWar_GlobalStatsResponse", - 6509: "k_EMsgGC_SpyVsEngyWar_SetKillCamMessage", - 6510: "k_EMsgGC_WorldItemPlacement_Attribute", - 6511: "k_EMsgGC_WorldItemPlacement_Update", - 6512: "k_EMsgGC_Match_Result", - 6513: "k_EMsgGCVoteKickPlayerRequest", - 6514: "k_EMsgGCVoteKickPlayerRequestResponse", - 10001: "k_EMsgGCDev_GrantWarKill", -} -var ETFGCMsg_value = map[string]int32{ - "k_EMsgGCReportWarKill": 5001, - "k_EMsgGCVoteKickBanPlayer": 5018, - "k_EMsgGCVoteKickBanPlayerResult": 5019, - "k_EMsgGCKickPlayer_DEPRECATED": 5020, - "k_EMsgGCStartedTraining_DEPRECATED": 5021, - "k_EMsgGCFreeTrial_ChooseMostHelpfulFriend": 5022, - "k_EMsgGCRequestTF2Friends": 5023, - "k_EMsgGCRequestTF2FriendsResponse": 5024, - "k_EMsgGCReplay_SubmitContestEntry": 5026, - "k_EMsgGCReplay_SubmitContestEntryResponse": 5027, - "k_EMsgGCSaxxy_Awarded": 5029, - "k_EMsgGCFreeTrial_ThankedBySomeone": 5028, - "k_EMsgGCFreeTrial_ThankedSomeone": 5030, - "k_EMsgGCFreeTrial_ConvertedToPremium": 5031, - "k_EMsgGCMeetThePyroSilliness_BananaCraft_DEPRECATED": 5032, - "k_EMsgGCMVMARG_HighFiveSuccessResponse_DEPRECATED": 5033, - "k_EMsgGCMVMARG_HighFiveOnClient_DEPRECATED": 5034, - "k_EMsgGCCoaching_AddToCoaches": 5200, - "k_EMsgGCCoaching_AddToCoachesResponse": 5201, - "k_EMsgGCCoaching_RemoveFromCoaches": 5202, - "k_EMsgGCCoaching_RemoveFromCoachesResponse": 5203, - "k_EMsgGCCoaching_FindCoach": 5204, - "k_EMsgGCCoaching_FindCoachResponse": 5205, - "k_EMsgGCCoaching_AskCoach": 5206, - "k_EMsgGCCoaching_AskCoachResponse": 5207, - "k_EMsgGCCoaching_CoachJoinGame": 5208, - "k_EMsgGCCoaching_CoachJoining": 5209, - "k_EMsgGCCoaching_CoachJoined": 5210, - "k_EMsgGCCoaching_LikeCurrentCoach": 5211, - "k_EMsgGCCoaching_RemoveCurrentCoach": 5212, - "k_EMsgGCCoaching_AlreadyRatedCoach": 5213, - "k_EMsgGC_Duel_Request": 5500, - "k_EMsgGC_Duel_Response": 5501, - "k_EMsgGC_Duel_Results": 5502, - "k_EMsgGC_Duel_Status": 5503, - "k_EMsgGC_Halloween_ReservedItem_DEPRECATED": 5600, - "k_EMsgGC_Halloween_GrantItem_DEPRECATED": 5601, - "k_EMsgGC_Halloween_GrantItemResponse_DEPRECATED": 5604, - "k_EMsgGC_Halloween_Cheat_QueryResponse_DEPRECATED": 5605, - "k_EMsgGC_Halloween_ItemClaimed_DEPRECATED": 5606, - "k_EMsgGC_Halloween_ReservedItem": 5607, - "k_EMsgGC_Halloween_GrantItem": 5608, - "k_EMsgGC_Halloween_GrantItemResponse": 5609, - "k_EMsgGC_Halloween_Cheat_QueryResponse_DEPRECATED_2": 5610, - "k_EMsgGC_Halloween_ItemClaimed_DEPRECATED_2": 5611, - "k_EMsgGC_Halloween_ServerBossEvent": 5612, - "k_EMsgGC_Halloween_Merasmus2012": 5613, - "k_EMsgGC_Halloween_UpdateMerasmusLootLevel": 5614, - "k_EMsgGC_GameServer_LevelInfo": 5700, - "k_EMsgGC_GameServer_AuthChallenge": 5701, - "k_EMsgGC_GameServer_AuthChallengeResponse": 5702, - "k_EMsgGC_GameServer_CreateIdentity": 5703, - "k_EMsgGC_GameServer_CreateIdentityResponse": 5704, - "k_EMsgGC_GameServer_List": 5705, - "k_EMsgGC_GameServer_ListResponse": 5706, - "k_EMsgGC_GameServer_AuthResult": 5707, - "k_EMsgGC_GameServer_ResetIdentity": 5708, - "k_EMsgGC_GameServer_ResetIdentityResponse": 5709, - "k_EMsgGC_Client_UseServerModificationItem": 5710, - "k_EMsgGC_Client_UseServerModificationItem_Response": 5711, - "k_EMsgGC_GameServer_UseServerModificationItem": 5712, - "k_EMsgGC_GameServer_UseServerModificationItem_Response": 5713, - "k_EMsgGC_GameServer_ServerModificationItemExpired": 5714, - "k_EMsgGC_GameServer_ModificationItemState": 5715, - "k_EMsgGC_GameServer_AckPolicy": 5716, - "k_EMsgGC_GameServer_AckPolicyResponse": 5717, - "k_EMsgGC_QP_ScoreServers": 5800, - "k_EMsgGC_QP_ScoreServersResponse": 5801, - "k_EMsgGC_QP_PlayerJoining": 5802, - "k_EMsgGC_PickupItemEligibility_Query_DEPRECATED": 6000, - "k_EMsgGC_PickupItemEligibility_Query_DEPRECATED_2": 6001, - "k_EMsgGC_IncrementKillCountAttribute_DEPRECATED": 6100, - "k_EMsgGC_IncrementKillCountResponse_DEPRECATED": 6101, - "k_EMsgGCGameMatchSignOut": 6204, - "k_EMsgGCCreateOrUpdateParty": 6233, - "k_EMsgGCAbandonCurrentGame": 6235, - "k_EMsgForceSOCacheResend": 6237, - "k_EMsgGCRequestChatChannelList": 6260, - "k_EMsgGCRequestChatChannelListResponse": 6261, - "k_EMsgGCReadyUp": 6270, - "k_EMsgGCKickedFromMatchmakingQueue": 6271, - "k_EMsgGCLeaverDetected": 6272, - "k_EMsgGCLeaverDetectedResponse": 6287, - "k_EMsgGCPlayerFailedToConnect": 6288, - "k_EMsgGCExitMatchmaking": 6289, - "k_EMsgGCAcceptInvite": 6291, - "k_EMsgGCAcceptInviteResponse": 6292, - "k_EMsgGCMatchmakingProgress": 6293, - "k_EMsgGCMvMVictoryInfo": 6294, - "k_EMsgGCGameServerMatchmakingStatus": 6295, - "k_EMsgGCCreateOrUpdatePartyReply": 6296, - "k_EMsgGCMvMVictory": 6297, - "k_EMsgGCMvMVictoryReply": 6298, - "k_EMsgGCGameServerKickingLobby": 6299, - "k_EMsgGCLeaveGameAndPrepareToJoinParty": 6300, - "k_EMsgGCRemovePlayerFromLobby": 6301, - "k_EMsgGCSetLobbySafeToLeave": 6302, - "k_EMsgGC_UpdatePeriodicEvent": 6400, - "k_EMsgGC_DuckLeaderboard_IndividualUpdate": 6401, - "k_EMsgGC_Client2GCEconPreviewDataBlockRequest": 6402, - "k_EMsgGC_Client2GCEconPreviewDataBlockResponse": 6403, - "k_EMsgGC_ClientVerificationChallenge": 6500, - "k_EMsgGC_ClientVerificationChallengeResponse": 6501, - "k_EMsgGC_ClientVerificationVerboseResponse": 6502, - "k_EMsgGC_ClientSetItemSlotAttribute": 6503, - "k_EMsgGC_PlayerSkillRating_Adjustment": 6504, - "k_EMsgGC_SpyVsEngyWar_IndividualUpdate": 6505, - "k_EMsgGC_SpyVsEngyWar_JoinWar": 6506, - "k_EMsgGC_SpyVsEngyWar_RequestGlobalStats": 6507, - "k_EMsgGC_SpyVsEngyWar_GlobalStatsResponse": 6508, - "k_EMsgGC_SpyVsEngyWar_SetKillCamMessage": 6509, - "k_EMsgGC_WorldItemPlacement_Attribute": 6510, - "k_EMsgGC_WorldItemPlacement_Update": 6511, - "k_EMsgGC_Match_Result": 6512, - "k_EMsgGCVoteKickPlayerRequest": 6513, - "k_EMsgGCVoteKickPlayerRequestResponse": 6514, - "k_EMsgGCDev_GrantWarKill": 10001, -} - -func (x ETFGCMsg) Enum() *ETFGCMsg { - p := new(ETFGCMsg) - *p = x - return p -} -func (x ETFGCMsg) String() string { - return proto.EnumName(ETFGCMsg_name, int32(x)) -} -func (x *ETFGCMsg) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ETFGCMsg_value, data, "ETFGCMsg") - if err != nil { - return err - } - *x = ETFGCMsg(value) - return nil -} -func (ETFGCMsg) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{0} } - -type EServerModificationItemType int32 - -const ( - EServerModificationItemType_kGameServerModificationItem_Halloween EServerModificationItemType = 1 -) - -var EServerModificationItemType_name = map[int32]string{ - 1: "kGameServerModificationItem_Halloween", -} -var EServerModificationItemType_value = map[string]int32{ - "kGameServerModificationItem_Halloween": 1, -} - -func (x EServerModificationItemType) Enum() *EServerModificationItemType { - p := new(EServerModificationItemType) - *p = x - return p -} -func (x EServerModificationItemType) String() string { - return proto.EnumName(EServerModificationItemType_name, int32(x)) -} -func (x *EServerModificationItemType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(EServerModificationItemType_value, data, "EServerModificationItemType") - if err != nil { - return err - } - *x = EServerModificationItemType(value) - return nil -} -func (EServerModificationItemType) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{1} } - -type TF_MatchmakingMode int32 - -const ( - TF_MatchmakingMode_TF_Matchmaking_INVALID TF_MatchmakingMode = 0 - TF_MatchmakingMode_TF_Matchmaking_QUICKPLAY TF_MatchmakingMode = 1 - TF_MatchmakingMode_TF_Matchmaking_TOBOR TF_MatchmakingMode = 2 - TF_MatchmakingMode_TF_Matchmaking_LADDER TF_MatchmakingMode = 3 -) - -var TF_MatchmakingMode_name = map[int32]string{ - 0: "TF_Matchmaking_INVALID", - 1: "TF_Matchmaking_QUICKPLAY", - 2: "TF_Matchmaking_TOBOR", - 3: "TF_Matchmaking_LADDER", -} -var TF_MatchmakingMode_value = map[string]int32{ - "TF_Matchmaking_INVALID": 0, - "TF_Matchmaking_QUICKPLAY": 1, - "TF_Matchmaking_TOBOR": 2, - "TF_Matchmaking_LADDER": 3, -} - -func (x TF_MatchmakingMode) Enum() *TF_MatchmakingMode { - p := new(TF_MatchmakingMode) - *p = x - return p -} -func (x TF_MatchmakingMode) String() string { - return proto.EnumName(TF_MatchmakingMode_name, int32(x)) -} -func (x *TF_MatchmakingMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TF_MatchmakingMode_value, data, "TF_MatchmakingMode") - if err != nil { - return err - } - *x = TF_MatchmakingMode(value) - return nil -} -func (TF_MatchmakingMode) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{2} } - -type TF_Matchmaking_WizardStep int32 - -const ( - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_INVALID TF_Matchmaking_WizardStep = 0 - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_TOBOR_PLAY_FOR_BRAGGING_RIGHTS TF_Matchmaking_WizardStep = 1 - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_TOBOR_TOUR_OF_DUTY TF_Matchmaking_WizardStep = 2 - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_TOBOR_CHALLENGE TF_Matchmaking_WizardStep = 3 - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_QUICKPLAY TF_Matchmaking_WizardStep = 4 - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_SEARCHING TF_Matchmaking_WizardStep = 5 - TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_LADDER TF_Matchmaking_WizardStep = 6 -) - -var TF_Matchmaking_WizardStep_name = map[int32]string{ - 0: "TF_Matchmaking_WizardStep_INVALID", - 1: "TF_Matchmaking_WizardStep_TOBOR_PLAY_FOR_BRAGGING_RIGHTS", - 2: "TF_Matchmaking_WizardStep_TOBOR_TOUR_OF_DUTY", - 3: "TF_Matchmaking_WizardStep_TOBOR_CHALLENGE", - 4: "TF_Matchmaking_WizardStep_QUICKPLAY", - 5: "TF_Matchmaking_WizardStep_SEARCHING", - 6: "TF_Matchmaking_WizardStep_LADDER", -} -var TF_Matchmaking_WizardStep_value = map[string]int32{ - "TF_Matchmaking_WizardStep_INVALID": 0, - "TF_Matchmaking_WizardStep_TOBOR_PLAY_FOR_BRAGGING_RIGHTS": 1, - "TF_Matchmaking_WizardStep_TOBOR_TOUR_OF_DUTY": 2, - "TF_Matchmaking_WizardStep_TOBOR_CHALLENGE": 3, - "TF_Matchmaking_WizardStep_QUICKPLAY": 4, - "TF_Matchmaking_WizardStep_SEARCHING": 5, - "TF_Matchmaking_WizardStep_LADDER": 6, -} - -func (x TF_Matchmaking_WizardStep) Enum() *TF_Matchmaking_WizardStep { - p := new(TF_Matchmaking_WizardStep) - *p = x - return p -} -func (x TF_Matchmaking_WizardStep) String() string { - return proto.EnumName(TF_Matchmaking_WizardStep_name, int32(x)) -} -func (x *TF_Matchmaking_WizardStep) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TF_Matchmaking_WizardStep_value, data, "TF_Matchmaking_WizardStep") - if err != nil { - return err - } - *x = TF_Matchmaking_WizardStep(value) - return nil -} -func (TF_Matchmaking_WizardStep) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{3} } - -type TF_GC_GameState int32 - -const ( - TF_GC_GameState_TF_GC_GAMESTATE_STATE_INIT TF_GC_GameState = 0 - TF_GC_GameState_TF_GC_GAMESTATE_WAIT_FOR_PLAYERS_TO_LOAD TF_GC_GameState = 1 - TF_GC_GameState_TF_GC_GAMESTATE_STRATEGY_TIME TF_GC_GameState = 3 - TF_GC_GameState_TF_GC_GAMESTATE_GAME_IN_PROGRESS TF_GC_GameState = 5 - TF_GC_GameState_TF_GC_GAMESTATE_POST_GAME TF_GC_GameState = 6 - TF_GC_GameState_TF_GC_GAMESTATE_DISCONNECT TF_GC_GameState = 7 - TF_GC_GameState_TF_GC_GAMESTATE_LAST TF_GC_GameState = 8 -) - -var TF_GC_GameState_name = map[int32]string{ - 0: "TF_GC_GAMESTATE_STATE_INIT", - 1: "TF_GC_GAMESTATE_WAIT_FOR_PLAYERS_TO_LOAD", - 3: "TF_GC_GAMESTATE_STRATEGY_TIME", - 5: "TF_GC_GAMESTATE_GAME_IN_PROGRESS", - 6: "TF_GC_GAMESTATE_POST_GAME", - 7: "TF_GC_GAMESTATE_DISCONNECT", - 8: "TF_GC_GAMESTATE_LAST", -} -var TF_GC_GameState_value = map[string]int32{ - "TF_GC_GAMESTATE_STATE_INIT": 0, - "TF_GC_GAMESTATE_WAIT_FOR_PLAYERS_TO_LOAD": 1, - "TF_GC_GAMESTATE_STRATEGY_TIME": 3, - "TF_GC_GAMESTATE_GAME_IN_PROGRESS": 5, - "TF_GC_GAMESTATE_POST_GAME": 6, - "TF_GC_GAMESTATE_DISCONNECT": 7, - "TF_GC_GAMESTATE_LAST": 8, -} - -func (x TF_GC_GameState) Enum() *TF_GC_GameState { - p := new(TF_GC_GameState) - *p = x - return p -} -func (x TF_GC_GameState) String() string { - return proto.EnumName(TF_GC_GameState_name, int32(x)) -} -func (x *TF_GC_GameState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TF_GC_GameState_value, data, "TF_GC_GameState") - if err != nil { - return err - } - *x = TF_GC_GameState(value) - return nil -} -func (TF_GC_GameState) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{4} } - -type TF_GC_TEAM int32 - -const ( - TF_GC_TEAM_TF_GC_TEAM_DEFENDERS TF_GC_TEAM = 0 - TF_GC_TEAM_TF_GC_TEAM_INVADERS TF_GC_TEAM = 1 - TF_GC_TEAM_TF_GC_TEAM_BROADCASTER TF_GC_TEAM = 2 - TF_GC_TEAM_TF_GC_TEAM_SPECTATOR TF_GC_TEAM = 3 - TF_GC_TEAM_TF_GC_TEAM_PLAYER_POOL TF_GC_TEAM = 4 - TF_GC_TEAM_TF_GC_TEAM_NOTEAM TF_GC_TEAM = 5 -) - -var TF_GC_TEAM_name = map[int32]string{ - 0: "TF_GC_TEAM_DEFENDERS", - 1: "TF_GC_TEAM_INVADERS", - 2: "TF_GC_TEAM_BROADCASTER", - 3: "TF_GC_TEAM_SPECTATOR", - 4: "TF_GC_TEAM_PLAYER_POOL", - 5: "TF_GC_TEAM_NOTEAM", -} -var TF_GC_TEAM_value = map[string]int32{ - "TF_GC_TEAM_DEFENDERS": 0, - "TF_GC_TEAM_INVADERS": 1, - "TF_GC_TEAM_BROADCASTER": 2, - "TF_GC_TEAM_SPECTATOR": 3, - "TF_GC_TEAM_PLAYER_POOL": 4, - "TF_GC_TEAM_NOTEAM": 5, -} - -func (x TF_GC_TEAM) Enum() *TF_GC_TEAM { - p := new(TF_GC_TEAM) - *p = x - return p -} -func (x TF_GC_TEAM) String() string { - return proto.EnumName(TF_GC_TEAM_name, int32(x)) -} -func (x *TF_GC_TEAM) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TF_GC_TEAM_value, data, "TF_GC_TEAM") - if err != nil { - return err - } - *x = TF_GC_TEAM(value) - return nil -} -func (TF_GC_TEAM) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{5} } - -type TFLobbyReadyState int32 - -const ( - TFLobbyReadyState_TFLobbyReadyState_UNDECLARED TFLobbyReadyState = 0 - TFLobbyReadyState_TFLobbyReadyState_ACCEPTED TFLobbyReadyState = 1 - TFLobbyReadyState_TFLobbyReadyState_DECLINED TFLobbyReadyState = 2 -) - -var TFLobbyReadyState_name = map[int32]string{ - 0: "TFLobbyReadyState_UNDECLARED", - 1: "TFLobbyReadyState_ACCEPTED", - 2: "TFLobbyReadyState_DECLINED", -} -var TFLobbyReadyState_value = map[string]int32{ - "TFLobbyReadyState_UNDECLARED": 0, - "TFLobbyReadyState_ACCEPTED": 1, - "TFLobbyReadyState_DECLINED": 2, -} - -func (x TFLobbyReadyState) Enum() *TFLobbyReadyState { - p := new(TFLobbyReadyState) - *p = x - return p -} -func (x TFLobbyReadyState) String() string { - return proto.EnumName(TFLobbyReadyState_name, int32(x)) -} -func (x *TFLobbyReadyState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TFLobbyReadyState_value, data, "TFLobbyReadyState") - if err != nil { - return err - } - *x = TFLobbyReadyState(value) - return nil -} -func (TFLobbyReadyState) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{6} } - -type ChatChannelTypeT int32 - -const ( - ChatChannelTypeT_ChatChannelType_Regional ChatChannelTypeT = 0 - ChatChannelTypeT_ChatChannelType_Custom ChatChannelTypeT = 1 - ChatChannelTypeT_ChatChannelType_Party ChatChannelTypeT = 2 - ChatChannelTypeT_ChatChannelType_Lobby ChatChannelTypeT = 3 -) - -var ChatChannelTypeT_name = map[int32]string{ - 0: "ChatChannelType_Regional", - 1: "ChatChannelType_Custom", - 2: "ChatChannelType_Party", - 3: "ChatChannelType_Lobby", -} -var ChatChannelTypeT_value = map[string]int32{ - "ChatChannelType_Regional": 0, - "ChatChannelType_Custom": 1, - "ChatChannelType_Party": 2, - "ChatChannelType_Lobby": 3, -} - -func (x ChatChannelTypeT) Enum() *ChatChannelTypeT { - p := new(ChatChannelTypeT) - *p = x - return p -} -func (x ChatChannelTypeT) String() string { - return proto.EnumName(ChatChannelTypeT_name, int32(x)) -} -func (x *ChatChannelTypeT) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ChatChannelTypeT_value, data, "ChatChannelTypeT") - if err != nil { - return err - } - *x = ChatChannelTypeT(value) - return nil -} -func (ChatChannelTypeT) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{7} } - -type ServerMatchmakingState int32 - -const ( - ServerMatchmakingState_ServerMatchmakingState_INVALID ServerMatchmakingState = 0 - ServerMatchmakingState_ServerMatchmakingState_NOT_PARTICIPATING ServerMatchmakingState = 1 - ServerMatchmakingState_ServerMatchmakingState_EMPTY ServerMatchmakingState = 2 - ServerMatchmakingState_ServerMatchmakingState_ACTIVE_SLOTS_AVAILABLE ServerMatchmakingState = 3 - ServerMatchmakingState_ServerMatchmakingState_ACTIVE_FULL ServerMatchmakingState = 4 -) - -var ServerMatchmakingState_name = map[int32]string{ - 0: "ServerMatchmakingState_INVALID", - 1: "ServerMatchmakingState_NOT_PARTICIPATING", - 2: "ServerMatchmakingState_EMPTY", - 3: "ServerMatchmakingState_ACTIVE_SLOTS_AVAILABLE", - 4: "ServerMatchmakingState_ACTIVE_FULL", -} -var ServerMatchmakingState_value = map[string]int32{ - "ServerMatchmakingState_INVALID": 0, - "ServerMatchmakingState_NOT_PARTICIPATING": 1, - "ServerMatchmakingState_EMPTY": 2, - "ServerMatchmakingState_ACTIVE_SLOTS_AVAILABLE": 3, - "ServerMatchmakingState_ACTIVE_FULL": 4, -} - -func (x ServerMatchmakingState) Enum() *ServerMatchmakingState { - p := new(ServerMatchmakingState) - *p = x - return p -} -func (x ServerMatchmakingState) String() string { - return proto.EnumName(ServerMatchmakingState_name, int32(x)) -} -func (x *ServerMatchmakingState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ServerMatchmakingState_value, data, "ServerMatchmakingState") - if err != nil { - return err - } - *x = ServerMatchmakingState(value) - return nil -} -func (ServerMatchmakingState) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{8} } - -type TF_SkillRatingMatchType int32 - -const ( - TF_SkillRatingMatchType_TF_SkillRatingMatchType_INVALID TF_SkillRatingMatchType = -1 - TF_SkillRatingMatchType_TF_SkillRatingMatchType_PUBLIC TF_SkillRatingMatchType = 0 - TF_SkillRatingMatchType_TF_SkillRatingMatchType_LADDER_6V6 TF_SkillRatingMatchType = 1 - TF_SkillRatingMatchType_TF_SkillRatingMatchType_LADDER_9V9 TF_SkillRatingMatchType = 2 -) - -var TF_SkillRatingMatchType_name = map[int32]string{ - -1: "TF_SkillRatingMatchType_INVALID", - 0: "TF_SkillRatingMatchType_PUBLIC", - 1: "TF_SkillRatingMatchType_LADDER_6V6", - 2: "TF_SkillRatingMatchType_LADDER_9V9", -} -var TF_SkillRatingMatchType_value = map[string]int32{ - "TF_SkillRatingMatchType_INVALID": -1, - "TF_SkillRatingMatchType_PUBLIC": 0, - "TF_SkillRatingMatchType_LADDER_6V6": 1, - "TF_SkillRatingMatchType_LADDER_9V9": 2, -} - -func (x TF_SkillRatingMatchType) Enum() *TF_SkillRatingMatchType { - p := new(TF_SkillRatingMatchType) - *p = x - return p -} -func (x TF_SkillRatingMatchType) String() string { - return proto.EnumName(TF_SkillRatingMatchType_name, int32(x)) -} -func (x *TF_SkillRatingMatchType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TF_SkillRatingMatchType_value, data, "TF_SkillRatingMatchType") - if err != nil { - return err - } - *x = TF_SkillRatingMatchType(value) - return nil -} -func (TF_SkillRatingMatchType) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{9} } - -type CMsgGC_GameServer_CreateIdentityResponse_EStatus int32 - -const ( - CMsgGC_GameServer_CreateIdentityResponse_kStatus_GenericFailure CMsgGC_GameServer_CreateIdentityResponse_EStatus = 0 - CMsgGC_GameServer_CreateIdentityResponse_kStatus_TooMany CMsgGC_GameServer_CreateIdentityResponse_EStatus = -1 - CMsgGC_GameServer_CreateIdentityResponse_kStatus_NoPrivs CMsgGC_GameServer_CreateIdentityResponse_EStatus = -2 - CMsgGC_GameServer_CreateIdentityResponse_kStatus_Created CMsgGC_GameServer_CreateIdentityResponse_EStatus = 1 -) - -var CMsgGC_GameServer_CreateIdentityResponse_EStatus_name = map[int32]string{ - 0: "kStatus_GenericFailure", - -1: "kStatus_TooMany", - -2: "kStatus_NoPrivs", - 1: "kStatus_Created", -} -var CMsgGC_GameServer_CreateIdentityResponse_EStatus_value = map[string]int32{ - "kStatus_GenericFailure": 0, - "kStatus_TooMany": -1, - "kStatus_NoPrivs": -2, - "kStatus_Created": 1, -} - -func (x CMsgGC_GameServer_CreateIdentityResponse_EStatus) Enum() *CMsgGC_GameServer_CreateIdentityResponse_EStatus { - p := new(CMsgGC_GameServer_CreateIdentityResponse_EStatus) - *p = x - return p -} -func (x CMsgGC_GameServer_CreateIdentityResponse_EStatus) String() string { - return proto.EnumName(CMsgGC_GameServer_CreateIdentityResponse_EStatus_name, int32(x)) -} -func (x *CMsgGC_GameServer_CreateIdentityResponse_EStatus) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGC_GameServer_CreateIdentityResponse_EStatus_value, data, "CMsgGC_GameServer_CreateIdentityResponse_EStatus") - if err != nil { - return err - } - *x = CMsgGC_GameServer_CreateIdentityResponse_EStatus(value) - return nil -} -func (CMsgGC_GameServer_CreateIdentityResponse_EStatus) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{37, 0} -} - -type CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse int32 - -const ( - CMsgGC_Client_UseServerModificationItem_Response_kServerModificationItemResponse_AlreadyInUse CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse = 1 - CMsgGC_Client_UseServerModificationItem_Response_kServerModificationItemResponse_NotOnAuthenticatedServer CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse = 2 - CMsgGC_Client_UseServerModificationItem_Response_kServerModificationItemResponse_ServerReject CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse = 3 - CMsgGC_Client_UseServerModificationItem_Response_kServerModificationItemResponse_InternalError CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse = 4 - CMsgGC_Client_UseServerModificationItem_Response_kServerModificationItemResponse_EventAlreadyActive CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse = 5 -) - -var CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse_name = map[int32]string{ - 1: "kServerModificationItemResponse_AlreadyInUse", - 2: "kServerModificationItemResponse_NotOnAuthenticatedServer", - 3: "kServerModificationItemResponse_ServerReject", - 4: "kServerModificationItemResponse_InternalError", - 5: "kServerModificationItemResponse_EventAlreadyActive", -} -var CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse_value = map[string]int32{ - "kServerModificationItemResponse_AlreadyInUse": 1, - "kServerModificationItemResponse_NotOnAuthenticatedServer": 2, - "kServerModificationItemResponse_ServerReject": 3, - "kServerModificationItemResponse_InternalError": 4, - "kServerModificationItemResponse_EventAlreadyActive": 5, -} - -func (x CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse) Enum() *CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse { - p := new(CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse) - *p = x - return p -} -func (x CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse) String() string { - return proto.EnumName(CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse_name, int32(x)) -} -func (x *CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse_value, data, "CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse") - if err != nil { - return err - } - *x = CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse(value) - return nil -} -func (CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{45, 0} -} - -type CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse int32 - -const ( - CMsgGC_GameServer_UseServerModificationItem_Response_kServerModificationItemServerResponse_Accepted CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse = 1 - CMsgGC_GameServer_UseServerModificationItem_Response_kServerModificationItemServerResponse_NoVoteCalled CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse = 2 - CMsgGC_GameServer_UseServerModificationItem_Response_kServerModificationItemServerResponse_VoteFailed CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse = 3 -) - -var CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse_name = map[int32]string{ - 1: "kServerModificationItemServerResponse_Accepted", - 2: "kServerModificationItemServerResponse_NoVoteCalled", - 3: "kServerModificationItemServerResponse_VoteFailed", -} -var CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse_value = map[string]int32{ - "kServerModificationItemServerResponse_Accepted": 1, - "kServerModificationItemServerResponse_NoVoteCalled": 2, - "kServerModificationItemServerResponse_VoteFailed": 3, -} - -func (x CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse) Enum() *CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse { - p := new(CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse) - *p = x - return p -} -func (x CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse) String() string { - return proto.EnumName(CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse_name, int32(x)) -} -func (x *CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse_value, data, "CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse") - if err != nil { - return err - } - *x = CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse(value) - return nil -} -func (CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{47, 0} -} - -type CSOTFParty_State int32 - -const ( - CSOTFParty_UI CSOTFParty_State = 0 - CSOTFParty_FINDING_MATCH CSOTFParty_State = 1 - CSOTFParty_IN_MATCH CSOTFParty_State = 2 - CSOTFParty_AWAITING_RESERVATION_CONFIRMATION CSOTFParty_State = 3 -) - -var CSOTFParty_State_name = map[int32]string{ - 0: "UI", - 1: "FINDING_MATCH", - 2: "IN_MATCH", - 3: "AWAITING_RESERVATION_CONFIRMATION", -} -var CSOTFParty_State_value = map[string]int32{ - "UI": 0, - "FINDING_MATCH": 1, - "IN_MATCH": 2, - "AWAITING_RESERVATION_CONFIRMATION": 3, -} - -func (x CSOTFParty_State) Enum() *CSOTFParty_State { - p := new(CSOTFParty_State) - *p = x - return p -} -func (x CSOTFParty_State) String() string { - return proto.EnumName(CSOTFParty_State_name, int32(x)) -} -func (x *CSOTFParty_State) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSOTFParty_State_value, data, "CSOTFParty_State") - if err != nil { - return err - } - *x = CSOTFParty_State(value) - return nil -} -func (CSOTFParty_State) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{60, 0} } - -type CTFLobbyMember_ConnectState int32 - -const ( - CTFLobbyMember_INVALID CTFLobbyMember_ConnectState = 0 - CTFLobbyMember_RESERVATION_PENDING CTFLobbyMember_ConnectState = 1 - CTFLobbyMember_RESERVED CTFLobbyMember_ConnectState = 2 - CTFLobbyMember_CONNECTED CTFLobbyMember_ConnectState = 3 - CTFLobbyMember_DISCONNECTED CTFLobbyMember_ConnectState = 5 -) - -var CTFLobbyMember_ConnectState_name = map[int32]string{ - 0: "INVALID", - 1: "RESERVATION_PENDING", - 2: "RESERVED", - 3: "CONNECTED", - 5: "DISCONNECTED", -} -var CTFLobbyMember_ConnectState_value = map[string]int32{ - "INVALID": 0, - "RESERVATION_PENDING": 1, - "RESERVED": 2, - "CONNECTED": 3, - "DISCONNECTED": 5, -} - -func (x CTFLobbyMember_ConnectState) Enum() *CTFLobbyMember_ConnectState { - p := new(CTFLobbyMember_ConnectState) - *p = x - return p -} -func (x CTFLobbyMember_ConnectState) String() string { - return proto.EnumName(CTFLobbyMember_ConnectState_name, int32(x)) -} -func (x *CTFLobbyMember_ConnectState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CTFLobbyMember_ConnectState_value, data, "CTFLobbyMember_ConnectState") - if err != nil { - return err - } - *x = CTFLobbyMember_ConnectState(value) - return nil -} -func (CTFLobbyMember_ConnectState) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{62, 0} -} - -type CSOTFLobby_State int32 - -const ( - CSOTFLobby_SERVERSETUP CSOTFLobby_State = 1 - CSOTFLobby_RUN CSOTFLobby_State = 2 - CSOTFLobby_POSTGAME CSOTFLobby_State = 3 - CSOTFLobby_NOTREADY CSOTFLobby_State = 5 - CSOTFLobby_SERVERASSIGN CSOTFLobby_State = 6 -) - -var CSOTFLobby_State_name = map[int32]string{ - 1: "SERVERSETUP", - 2: "RUN", - 3: "POSTGAME", - 5: "NOTREADY", - 6: "SERVERASSIGN", -} -var CSOTFLobby_State_value = map[string]int32{ - "SERVERSETUP": 1, - "RUN": 2, - "POSTGAME": 3, - "NOTREADY": 5, - "SERVERASSIGN": 6, -} - -func (x CSOTFLobby_State) Enum() *CSOTFLobby_State { - p := new(CSOTFLobby_State) - *p = x - return p -} -func (x CSOTFLobby_State) String() string { - return proto.EnumName(CSOTFLobby_State_name, int32(x)) -} -func (x *CSOTFLobby_State) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSOTFLobby_State_value, data, "CSOTFLobby_State") - if err != nil { - return err - } - *x = CSOTFLobby_State(value) - return nil -} -func (CSOTFLobby_State) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{65, 0} } - -type CSOTFLobby_LobbyType int32 - -const ( - CSOTFLobby_INVALID CSOTFLobby_LobbyType = -1 - CSOTFLobby_MATCH CSOTFLobby_LobbyType = 0 - CSOTFLobby_PRACTICE CSOTFLobby_LobbyType = 1 - CSOTFLobby_TOURNAMENT CSOTFLobby_LobbyType = 2 - CSOTFLobby_TUTORIAL CSOTFLobby_LobbyType = 3 -) - -var CSOTFLobby_LobbyType_name = map[int32]string{ - -1: "INVALID", - 0: "MATCH", - 1: "PRACTICE", - 2: "TOURNAMENT", - 3: "TUTORIAL", -} -var CSOTFLobby_LobbyType_value = map[string]int32{ - "INVALID": -1, - "MATCH": 0, - "PRACTICE": 1, - "TOURNAMENT": 2, - "TUTORIAL": 3, -} - -func (x CSOTFLobby_LobbyType) Enum() *CSOTFLobby_LobbyType { - p := new(CSOTFLobby_LobbyType) - *p = x - return p -} -func (x CSOTFLobby_LobbyType) String() string { - return proto.EnumName(CSOTFLobby_LobbyType_name, int32(x)) -} -func (x *CSOTFLobby_LobbyType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CSOTFLobby_LobbyType_value, data, "CSOTFLobby_LobbyType") - if err != nil { - return err - } - *x = CSOTFLobby_LobbyType(value) - return nil -} -func (CSOTFLobby_LobbyType) EnumDescriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{65, 1} } - -type CMsgGameServerMatchmakingStatus_PlayerConnectState int32 - -const ( - CMsgGameServerMatchmakingStatus_INVALID CMsgGameServerMatchmakingStatus_PlayerConnectState = 0 - CMsgGameServerMatchmakingStatus_CONNECTED CMsgGameServerMatchmakingStatus_PlayerConnectState = 1 - CMsgGameServerMatchmakingStatus_RESERVED CMsgGameServerMatchmakingStatus_PlayerConnectState = 2 -) - -var CMsgGameServerMatchmakingStatus_PlayerConnectState_name = map[int32]string{ - 0: "INVALID", - 1: "CONNECTED", - 2: "RESERVED", -} -var CMsgGameServerMatchmakingStatus_PlayerConnectState_value = map[string]int32{ - "INVALID": 0, - "CONNECTED": 1, - "RESERVED": 2, -} - -func (x CMsgGameServerMatchmakingStatus_PlayerConnectState) Enum() *CMsgGameServerMatchmakingStatus_PlayerConnectState { - p := new(CMsgGameServerMatchmakingStatus_PlayerConnectState) - *p = x - return p -} -func (x CMsgGameServerMatchmakingStatus_PlayerConnectState) String() string { - return proto.EnumName(CMsgGameServerMatchmakingStatus_PlayerConnectState_name, int32(x)) -} -func (x *CMsgGameServerMatchmakingStatus_PlayerConnectState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGameServerMatchmakingStatus_PlayerConnectState_value, data, "CMsgGameServerMatchmakingStatus_PlayerConnectState") - if err != nil { - return err - } - *x = CMsgGameServerMatchmakingStatus_PlayerConnectState(value) - return nil -} -func (CMsgGameServerMatchmakingStatus_PlayerConnectState) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{83, 0} -} - -type CMsgGameServerMatchmakingStatus_Event int32 - -const ( - CMsgGameServerMatchmakingStatus_None CMsgGameServerMatchmakingStatus_Event = 0 - CMsgGameServerMatchmakingStatus_MvMVictory CMsgGameServerMatchmakingStatus_Event = 1 - CMsgGameServerMatchmakingStatus_MvMDefeat CMsgGameServerMatchmakingStatus_Event = 2 - CMsgGameServerMatchmakingStatus_AcknowledgePlayers CMsgGameServerMatchmakingStatus_Event = 3 -) - -var CMsgGameServerMatchmakingStatus_Event_name = map[int32]string{ - 0: "None", - 1: "MvMVictory", - 2: "MvMDefeat", - 3: "AcknowledgePlayers", -} -var CMsgGameServerMatchmakingStatus_Event_value = map[string]int32{ - "None": 0, - "MvMVictory": 1, - "MvMDefeat": 2, - "AcknowledgePlayers": 3, -} - -func (x CMsgGameServerMatchmakingStatus_Event) Enum() *CMsgGameServerMatchmakingStatus_Event { - p := new(CMsgGameServerMatchmakingStatus_Event) - *p = x - return p -} -func (x CMsgGameServerMatchmakingStatus_Event) String() string { - return proto.EnumName(CMsgGameServerMatchmakingStatus_Event_name, int32(x)) -} -func (x *CMsgGameServerMatchmakingStatus_Event) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGameServerMatchmakingStatus_Event_value, data, "CMsgGameServerMatchmakingStatus_Event") - if err != nil { - return err - } - *x = CMsgGameServerMatchmakingStatus_Event(value) - return nil -} -func (CMsgGameServerMatchmakingStatus_Event) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{83, 1} -} - -type CMsgMvMVictoryInfo_GrantReason int32 - -const ( - CMsgMvMVictoryInfo_INVALID CMsgMvMVictoryInfo_GrantReason = 0 - CMsgMvMVictoryInfo_BADGE_LEVELED CMsgMvMVictoryInfo_GrantReason = 1 - CMsgMvMVictoryInfo_SQUAD_SURPLUS CMsgMvMVictoryInfo_GrantReason = 2 - CMsgMvMVictoryInfo_MANN_UP CMsgMvMVictoryInfo_GrantReason = 3 - CMsgMvMVictoryInfo_HELP_A_NOOB CMsgMvMVictoryInfo_GrantReason = 4 -) - -var CMsgMvMVictoryInfo_GrantReason_name = map[int32]string{ - 0: "INVALID", - 1: "BADGE_LEVELED", - 2: "SQUAD_SURPLUS", - 3: "MANN_UP", - 4: "HELP_A_NOOB", -} -var CMsgMvMVictoryInfo_GrantReason_value = map[string]int32{ - "INVALID": 0, - "BADGE_LEVELED": 1, - "SQUAD_SURPLUS": 2, - "MANN_UP": 3, - "HELP_A_NOOB": 4, -} - -func (x CMsgMvMVictoryInfo_GrantReason) Enum() *CMsgMvMVictoryInfo_GrantReason { - p := new(CMsgMvMVictoryInfo_GrantReason) - *p = x - return p -} -func (x CMsgMvMVictoryInfo_GrantReason) String() string { - return proto.EnumName(CMsgMvMVictoryInfo_GrantReason_name, int32(x)) -} -func (x *CMsgMvMVictoryInfo_GrantReason) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgMvMVictoryInfo_GrantReason_value, data, "CMsgMvMVictoryInfo_GrantReason") - if err != nil { - return err - } - *x = CMsgMvMVictoryInfo_GrantReason(value) - return nil -} -func (CMsgMvMVictoryInfo_GrantReason) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{85, 0} -} - -type CMsgRemovePlayerFromLobby_RemoveReason int32 - -const ( - CMsgRemovePlayerFromLobby_VOTE_KICK CMsgRemovePlayerFromLobby_RemoveReason = 0 - CMsgRemovePlayerFromLobby_IDLE_KICK CMsgRemovePlayerFromLobby_RemoveReason = 1 - CMsgRemovePlayerFromLobby_ADMIN_KICK CMsgRemovePlayerFromLobby_RemoveReason = 2 - CMsgRemovePlayerFromLobby_GAME_OVER CMsgRemovePlayerFromLobby_RemoveReason = 3 -) - -var CMsgRemovePlayerFromLobby_RemoveReason_name = map[int32]string{ - 0: "VOTE_KICK", - 1: "IDLE_KICK", - 2: "ADMIN_KICK", - 3: "GAME_OVER", -} -var CMsgRemovePlayerFromLobby_RemoveReason_value = map[string]int32{ - "VOTE_KICK": 0, - "IDLE_KICK": 1, - "ADMIN_KICK": 2, - "GAME_OVER": 3, -} - -func (x CMsgRemovePlayerFromLobby_RemoveReason) Enum() *CMsgRemovePlayerFromLobby_RemoveReason { - p := new(CMsgRemovePlayerFromLobby_RemoveReason) - *p = x - return p -} -func (x CMsgRemovePlayerFromLobby_RemoveReason) String() string { - return proto.EnumName(CMsgRemovePlayerFromLobby_RemoveReason_name, int32(x)) -} -func (x *CMsgRemovePlayerFromLobby_RemoveReason) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgRemovePlayerFromLobby_RemoveReason_value, data, "CMsgRemovePlayerFromLobby_RemoveReason") - if err != nil { - return err - } - *x = CMsgRemovePlayerFromLobby_RemoveReason(value) - return nil -} -func (CMsgRemovePlayerFromLobby_RemoveReason) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{93, 0} -} - -type CMsgGC_Match_Result_Status int32 - -const ( - CMsgGC_Match_Result_MATCH_SUCCEEDED CMsgGC_Match_Result_Status = 0 - CMsgGC_Match_Result_MATCH_FAILED_GC CMsgGC_Match_Result_Status = 1 - CMsgGC_Match_Result_MATCH_FAILED_TRUSTED CMsgGC_Match_Result_Status = 2 - CMsgGC_Match_Result_MATCH_FAILED_LEAVER CMsgGC_Match_Result_Status = 3 - CMsgGC_Match_Result_MATCH_FAILED_RATING CMsgGC_Match_Result_Status = 4 -) - -var CMsgGC_Match_Result_Status_name = map[int32]string{ - 0: "MATCH_SUCCEEDED", - 1: "MATCH_FAILED_GC", - 2: "MATCH_FAILED_TRUSTED", - 3: "MATCH_FAILED_LEAVER", - 4: "MATCH_FAILED_RATING", -} -var CMsgGC_Match_Result_Status_value = map[string]int32{ - "MATCH_SUCCEEDED": 0, - "MATCH_FAILED_GC": 1, - "MATCH_FAILED_TRUSTED": 2, - "MATCH_FAILED_LEAVER": 3, - "MATCH_FAILED_RATING": 4, -} - -func (x CMsgGC_Match_Result_Status) Enum() *CMsgGC_Match_Result_Status { - p := new(CMsgGC_Match_Result_Status) - *p = x - return p -} -func (x CMsgGC_Match_Result_Status) String() string { - return proto.EnumName(CMsgGC_Match_Result_Status_name, int32(x)) -} -func (x *CMsgGC_Match_Result_Status) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(CMsgGC_Match_Result_Status_value, data, "CMsgGC_Match_Result_Status") - if err != nil { - return err - } - *x = CMsgGC_Match_Result_Status(value) - return nil -} -func (CMsgGC_Match_Result_Status) EnumDescriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{113, 0} -} - -type CMsgTFGoldenWrenchBroadcast struct { - WrenchNumber *int32 `protobuf:"varint,1,opt,name=wrench_number" json:"wrench_number,omitempty"` - Deleted *bool `protobuf:"varint,2,opt,name=deleted" json:"deleted,omitempty"` - UserName *string `protobuf:"bytes,3,opt,name=user_name" json:"user_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFGoldenWrenchBroadcast) Reset() { *m = CMsgTFGoldenWrenchBroadcast{} } -func (m *CMsgTFGoldenWrenchBroadcast) String() string { return proto.CompactTextString(m) } -func (*CMsgTFGoldenWrenchBroadcast) ProtoMessage() {} -func (*CMsgTFGoldenWrenchBroadcast) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{0} } - -func (m *CMsgTFGoldenWrenchBroadcast) GetWrenchNumber() int32 { - if m != nil && m.WrenchNumber != nil { - return *m.WrenchNumber - } - return 0 -} - -func (m *CMsgTFGoldenWrenchBroadcast) GetDeleted() bool { - if m != nil && m.Deleted != nil { - return *m.Deleted - } - return false -} - -func (m *CMsgTFGoldenWrenchBroadcast) GetUserName() string { - if m != nil && m.UserName != nil { - return *m.UserName - } - return "" -} - -type CMsgTFSaxxyBroadcast struct { - CategoryNumber *int32 `protobuf:"varint,1,opt,name=category_number" json:"category_number,omitempty"` - UserName *string `protobuf:"bytes,2,opt,name=user_name" json:"user_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFSaxxyBroadcast) Reset() { *m = CMsgTFSaxxyBroadcast{} } -func (m *CMsgTFSaxxyBroadcast) String() string { return proto.CompactTextString(m) } -func (*CMsgTFSaxxyBroadcast) ProtoMessage() {} -func (*CMsgTFSaxxyBroadcast) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{1} } - -func (m *CMsgTFSaxxyBroadcast) GetCategoryNumber() int32 { - if m != nil && m.CategoryNumber != nil { - return *m.CategoryNumber - } - return 0 -} - -func (m *CMsgTFSaxxyBroadcast) GetUserName() string { - if m != nil && m.UserName != nil { - return *m.UserName - } - return "" -} - -type CMsgGCTFSpecificItemBroadcast struct { - ItemDefIndex *uint32 `protobuf:"varint,1,opt,name=item_def_index" json:"item_def_index,omitempty"` - WasDestruction *bool `protobuf:"varint,2,opt,name=was_destruction" json:"was_destruction,omitempty"` - UserName *string `protobuf:"bytes,3,opt,name=user_name" json:"user_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGCTFSpecificItemBroadcast) Reset() { *m = CMsgGCTFSpecificItemBroadcast{} } -func (m *CMsgGCTFSpecificItemBroadcast) String() string { return proto.CompactTextString(m) } -func (*CMsgGCTFSpecificItemBroadcast) ProtoMessage() {} -func (*CMsgGCTFSpecificItemBroadcast) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{2} } - -func (m *CMsgGCTFSpecificItemBroadcast) GetItemDefIndex() uint32 { - if m != nil && m.ItemDefIndex != nil { - return *m.ItemDefIndex - } - return 0 -} - -func (m *CMsgGCTFSpecificItemBroadcast) GetWasDestruction() bool { - if m != nil && m.WasDestruction != nil { - return *m.WasDestruction - } - return false -} - -func (m *CMsgGCTFSpecificItemBroadcast) GetUserName() string { - if m != nil && m.UserName != nil { - return *m.UserName - } - return "" -} - -type CSOTFDuelSummary struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - DuelWins *uint32 `protobuf:"varint,2,opt,name=duel_wins" json:"duel_wins,omitempty"` - DuelLosses *uint32 `protobuf:"varint,3,opt,name=duel_losses" json:"duel_losses,omitempty"` - LastDuelAccountId *uint32 `protobuf:"varint,4,opt,name=last_duel_account_id" json:"last_duel_account_id,omitempty"` - LastDuelTimestamp *uint32 `protobuf:"varint,5,opt,name=last_duel_timestamp" json:"last_duel_timestamp,omitempty"` - LastDuelStatus *uint32 `protobuf:"varint,6,opt,name=last_duel_status" json:"last_duel_status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFDuelSummary) Reset() { *m = CSOTFDuelSummary{} } -func (m *CSOTFDuelSummary) String() string { return proto.CompactTextString(m) } -func (*CSOTFDuelSummary) ProtoMessage() {} -func (*CSOTFDuelSummary) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{3} } - -func (m *CSOTFDuelSummary) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOTFDuelSummary) GetDuelWins() uint32 { - if m != nil && m.DuelWins != nil { - return *m.DuelWins - } - return 0 -} - -func (m *CSOTFDuelSummary) GetDuelLosses() uint32 { - if m != nil && m.DuelLosses != nil { - return *m.DuelLosses - } - return 0 -} - -func (m *CSOTFDuelSummary) GetLastDuelAccountId() uint32 { - if m != nil && m.LastDuelAccountId != nil { - return *m.LastDuelAccountId - } - return 0 -} - -func (m *CSOTFDuelSummary) GetLastDuelTimestamp() uint32 { - if m != nil && m.LastDuelTimestamp != nil { - return *m.LastDuelTimestamp - } - return 0 -} - -func (m *CSOTFDuelSummary) GetLastDuelStatus() uint32 { - if m != nil && m.LastDuelStatus != nil { - return *m.LastDuelStatus - } - return 0 -} - -type CSOTFMapContribution struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - DefIndex *uint32 `protobuf:"varint,2,opt,name=def_index" json:"def_index,omitempty"` - ContributionLevel *uint32 `protobuf:"varint,3,opt,name=contribution_level" json:"contribution_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFMapContribution) Reset() { *m = CSOTFMapContribution{} } -func (m *CSOTFMapContribution) String() string { return proto.CompactTextString(m) } -func (*CSOTFMapContribution) ProtoMessage() {} -func (*CSOTFMapContribution) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{4} } - -func (m *CSOTFMapContribution) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOTFMapContribution) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CSOTFMapContribution) GetContributionLevel() uint32 { - if m != nil && m.ContributionLevel != nil { - return *m.ContributionLevel - } - return 0 -} - -type CMsgTFVoteKickBanPlayer struct { - AccountIdSubject *uint32 `protobuf:"varint,1,opt,name=account_id_subject" json:"account_id_subject,omitempty"` - KickReason *uint32 `protobuf:"varint,2,opt,name=kick_reason" json:"kick_reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFVoteKickBanPlayer) Reset() { *m = CMsgTFVoteKickBanPlayer{} } -func (m *CMsgTFVoteKickBanPlayer) String() string { return proto.CompactTextString(m) } -func (*CMsgTFVoteKickBanPlayer) ProtoMessage() {} -func (*CMsgTFVoteKickBanPlayer) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{5} } - -func (m *CMsgTFVoteKickBanPlayer) GetAccountIdSubject() uint32 { - if m != nil && m.AccountIdSubject != nil { - return *m.AccountIdSubject - } - return 0 -} - -func (m *CMsgTFVoteKickBanPlayer) GetKickReason() uint32 { - if m != nil && m.KickReason != nil { - return *m.KickReason - } - return 0 -} - -type CMsgTFVoteKickBanPlayerResult struct { - AccountIdInitiator *uint32 `protobuf:"varint,1,opt,name=account_id_initiator" json:"account_id_initiator,omitempty"` - AccountIdSubject *uint32 `protobuf:"varint,2,opt,name=account_id_subject" json:"account_id_subject,omitempty"` - KickReason *uint32 `protobuf:"varint,3,opt,name=kick_reason" json:"kick_reason,omitempty"` - KickSuccessful *bool `protobuf:"varint,4,opt,name=kick_successful" json:"kick_successful,omitempty"` - NumYesVotes *uint32 `protobuf:"varint,5,opt,name=num_yes_votes" json:"num_yes_votes,omitempty"` - NumNoVotes *uint32 `protobuf:"varint,6,opt,name=num_no_votes" json:"num_no_votes,omitempty"` - NumPossibleVotes *uint32 `protobuf:"varint,7,opt,name=num_possible_votes" json:"num_possible_votes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFVoteKickBanPlayerResult) Reset() { *m = CMsgTFVoteKickBanPlayerResult{} } -func (m *CMsgTFVoteKickBanPlayerResult) String() string { return proto.CompactTextString(m) } -func (*CMsgTFVoteKickBanPlayerResult) ProtoMessage() {} -func (*CMsgTFVoteKickBanPlayerResult) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{6} } - -func (m *CMsgTFVoteKickBanPlayerResult) GetAccountIdInitiator() uint32 { - if m != nil && m.AccountIdInitiator != nil { - return *m.AccountIdInitiator - } - return 0 -} - -func (m *CMsgTFVoteKickBanPlayerResult) GetAccountIdSubject() uint32 { - if m != nil && m.AccountIdSubject != nil { - return *m.AccountIdSubject - } - return 0 -} - -func (m *CMsgTFVoteKickBanPlayerResult) GetKickReason() uint32 { - if m != nil && m.KickReason != nil { - return *m.KickReason - } - return 0 -} - -func (m *CMsgTFVoteKickBanPlayerResult) GetKickSuccessful() bool { - if m != nil && m.KickSuccessful != nil { - return *m.KickSuccessful - } - return false -} - -func (m *CMsgTFVoteKickBanPlayerResult) GetNumYesVotes() uint32 { - if m != nil && m.NumYesVotes != nil { - return *m.NumYesVotes - } - return 0 -} - -func (m *CMsgTFVoteKickBanPlayerResult) GetNumNoVotes() uint32 { - if m != nil && m.NumNoVotes != nil { - return *m.NumNoVotes - } - return 0 -} - -func (m *CMsgTFVoteKickBanPlayerResult) GetNumPossibleVotes() uint32 { - if m != nil && m.NumPossibleVotes != nil { - return *m.NumPossibleVotes - } - return 0 -} - -type CMsgTFFreeTrialChooseMostHelpfulFriend struct { - AccountIdFriend *uint32 `protobuf:"varint,1,opt,name=account_id_friend" json:"account_id_friend,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFFreeTrialChooseMostHelpfulFriend) Reset() { - *m = CMsgTFFreeTrialChooseMostHelpfulFriend{} -} -func (m *CMsgTFFreeTrialChooseMostHelpfulFriend) String() string { return proto.CompactTextString(m) } -func (*CMsgTFFreeTrialChooseMostHelpfulFriend) ProtoMessage() {} -func (*CMsgTFFreeTrialChooseMostHelpfulFriend) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{7} -} - -func (m *CMsgTFFreeTrialChooseMostHelpfulFriend) GetAccountIdFriend() uint32 { - if m != nil && m.AccountIdFriend != nil { - return *m.AccountIdFriend - } - return 0 -} - -type CMsgTFRequestTF2Friends struct { - AccountIds []uint32 `protobuf:"varint,1,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestTF2Friends) Reset() { *m = CMsgTFRequestTF2Friends{} } -func (m *CMsgTFRequestTF2Friends) String() string { return proto.CompactTextString(m) } -func (*CMsgTFRequestTF2Friends) ProtoMessage() {} -func (*CMsgTFRequestTF2Friends) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{8} } - -func (m *CMsgTFRequestTF2Friends) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CMsgTFRequestTF2FriendsResponse struct { - AccountIds []uint32 `protobuf:"varint,1,rep,name=account_ids" json:"account_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestTF2FriendsResponse) Reset() { *m = CMsgTFRequestTF2FriendsResponse{} } -func (m *CMsgTFRequestTF2FriendsResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFRequestTF2FriendsResponse) ProtoMessage() {} -func (*CMsgTFRequestTF2FriendsResponse) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{9} } - -func (m *CMsgTFRequestTF2FriendsResponse) GetAccountIds() []uint32 { - if m != nil { - return m.AccountIds - } - return nil -} - -type CSOTFPlayerInfo struct { - NumNewUsersHelped *uint32 `protobuf:"varint,1,opt,name=num_new_users_helped" json:"num_new_users_helped,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFPlayerInfo) Reset() { *m = CSOTFPlayerInfo{} } -func (m *CSOTFPlayerInfo) String() string { return proto.CompactTextString(m) } -func (*CSOTFPlayerInfo) ProtoMessage() {} -func (*CSOTFPlayerInfo) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{10} } - -func (m *CSOTFPlayerInfo) GetNumNewUsersHelped() uint32 { - if m != nil && m.NumNewUsersHelped != nil { - return *m.NumNewUsersHelped - } - return 0 -} - -type CMsgTFThankedBySomeone struct { - ThankerSteamId *uint64 `protobuf:"varint,1,opt,name=thanker_steam_id" json:"thanker_steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFThankedBySomeone) Reset() { *m = CMsgTFThankedBySomeone{} } -func (m *CMsgTFThankedBySomeone) String() string { return proto.CompactTextString(m) } -func (*CMsgTFThankedBySomeone) ProtoMessage() {} -func (*CMsgTFThankedBySomeone) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{11} } - -func (m *CMsgTFThankedBySomeone) GetThankerSteamId() uint64 { - if m != nil && m.ThankerSteamId != nil { - return *m.ThankerSteamId - } - return 0 -} - -type CMsgTFThankedSomeone struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFThankedSomeone) Reset() { *m = CMsgTFThankedSomeone{} } -func (m *CMsgTFThankedSomeone) String() string { return proto.CompactTextString(m) } -func (*CMsgTFThankedSomeone) ProtoMessage() {} -func (*CMsgTFThankedSomeone) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{12} } - -type CMsgTFFreeTrialConvertedToPremium struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFFreeTrialConvertedToPremium) Reset() { *m = CMsgTFFreeTrialConvertedToPremium{} } -func (m *CMsgTFFreeTrialConvertedToPremium) String() string { return proto.CompactTextString(m) } -func (*CMsgTFFreeTrialConvertedToPremium) ProtoMessage() {} -func (*CMsgTFFreeTrialConvertedToPremium) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{13} -} - -type CMsgSaxxyAwarded struct { - Category *uint32 `protobuf:"varint,1,opt,name=category" json:"category,omitempty"` - WinnerNames []string `protobuf:"bytes,2,rep,name=winner_names" json:"winner_names,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSaxxyAwarded) Reset() { *m = CMsgSaxxyAwarded{} } -func (m *CMsgSaxxyAwarded) String() string { return proto.CompactTextString(m) } -func (*CMsgSaxxyAwarded) ProtoMessage() {} -func (*CMsgSaxxyAwarded) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{14} } - -func (m *CMsgSaxxyAwarded) GetCategory() uint32 { - if m != nil && m.Category != nil { - return *m.Category - } - return 0 -} - -func (m *CMsgSaxxyAwarded) GetWinnerNames() []string { - if m != nil { - return m.WinnerNames - } - return nil -} - -type CMsgReplaySubmitContestEntry struct { - YoutubeUrl *string `protobuf:"bytes,1,opt,name=youtube_url" json:"youtube_url,omitempty"` - Category *uint32 `protobuf:"varint,2,opt,name=category" json:"category,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReplaySubmitContestEntry) Reset() { *m = CMsgReplaySubmitContestEntry{} } -func (m *CMsgReplaySubmitContestEntry) String() string { return proto.CompactTextString(m) } -func (*CMsgReplaySubmitContestEntry) ProtoMessage() {} -func (*CMsgReplaySubmitContestEntry) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{15} } - -func (m *CMsgReplaySubmitContestEntry) GetYoutubeUrl() string { - if m != nil && m.YoutubeUrl != nil { - return *m.YoutubeUrl - } - return "" -} - -func (m *CMsgReplaySubmitContestEntry) GetCategory() uint32 { - if m != nil && m.Category != nil { - return *m.Category - } - return 0 -} - -type CMsgReplaySubmitContestEntryResponse struct { - Success *bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReplaySubmitContestEntryResponse) Reset() { *m = CMsgReplaySubmitContestEntryResponse{} } -func (m *CMsgReplaySubmitContestEntryResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgReplaySubmitContestEntryResponse) ProtoMessage() {} -func (*CMsgReplaySubmitContestEntryResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{16} -} - -func (m *CMsgReplaySubmitContestEntryResponse) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -type CReplayCachedContestData struct { - Timestamp *uint32 `protobuf:"fixed32,1,opt,name=timestamp" json:"timestamp,omitempty"` - NumVotesLastDay *uint32 `protobuf:"varint,2,opt,name=num_votes_last_day" json:"num_votes_last_day,omitempty"` - VideoEntryIds []uint32 `protobuf:"varint,3,rep,name=video_entry_ids" json:"video_entry_ids,omitempty"` - NumFlagsLastDay *uint32 `protobuf:"varint,4,opt,name=num_flags_last_day" json:"num_flags_last_day,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CReplayCachedContestData) Reset() { *m = CReplayCachedContestData{} } -func (m *CReplayCachedContestData) String() string { return proto.CompactTextString(m) } -func (*CReplayCachedContestData) ProtoMessage() {} -func (*CReplayCachedContestData) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{17} } - -func (m *CReplayCachedContestData) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CReplayCachedContestData) GetNumVotesLastDay() uint32 { - if m != nil && m.NumVotesLastDay != nil { - return *m.NumVotesLastDay - } - return 0 -} - -func (m *CReplayCachedContestData) GetVideoEntryIds() []uint32 { - if m != nil { - return m.VideoEntryIds - } - return nil -} - -func (m *CReplayCachedContestData) GetNumFlagsLastDay() uint32 { - if m != nil && m.NumFlagsLastDay != nil { - return *m.NumFlagsLastDay - } - return 0 -} - -type CMsgTFCoaching_AddToCoaches struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_AddToCoaches) Reset() { *m = CMsgTFCoaching_AddToCoaches{} } -func (m *CMsgTFCoaching_AddToCoaches) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_AddToCoaches) ProtoMessage() {} -func (*CMsgTFCoaching_AddToCoaches) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{18} } - -type CMsgTFCoaching_RemoveFromCoaches struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_RemoveFromCoaches) Reset() { *m = CMsgTFCoaching_RemoveFromCoaches{} } -func (m *CMsgTFCoaching_RemoveFromCoaches) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_RemoveFromCoaches) ProtoMessage() {} -func (*CMsgTFCoaching_RemoveFromCoaches) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{19} -} - -type CMsgTFCoaching_FindCoach struct { - AccountIdFriendAsCoach *uint32 `protobuf:"varint,1,opt,name=account_id_friend_as_coach" json:"account_id_friend_as_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_FindCoach) Reset() { *m = CMsgTFCoaching_FindCoach{} } -func (m *CMsgTFCoaching_FindCoach) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_FindCoach) ProtoMessage() {} -func (*CMsgTFCoaching_FindCoach) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{20} } - -func (m *CMsgTFCoaching_FindCoach) GetAccountIdFriendAsCoach() uint32 { - if m != nil && m.AccountIdFriendAsCoach != nil { - return *m.AccountIdFriendAsCoach - } - return 0 -} - -type CMsgTFCoaching_FindCoachResponse struct { - FoundCoach *bool `protobuf:"varint,1,opt,name=found_coach" json:"found_coach,omitempty"` - NumLikes *uint32 `protobuf:"varint,2,opt,name=num_likes" json:"num_likes,omitempty"` - CoachName *string `protobuf:"bytes,3,opt,name=coach_name" json:"coach_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_FindCoachResponse) Reset() { *m = CMsgTFCoaching_FindCoachResponse{} } -func (m *CMsgTFCoaching_FindCoachResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_FindCoachResponse) ProtoMessage() {} -func (*CMsgTFCoaching_FindCoachResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{21} -} - -func (m *CMsgTFCoaching_FindCoachResponse) GetFoundCoach() bool { - if m != nil && m.FoundCoach != nil { - return *m.FoundCoach - } - return false -} - -func (m *CMsgTFCoaching_FindCoachResponse) GetNumLikes() uint32 { - if m != nil && m.NumLikes != nil { - return *m.NumLikes - } - return 0 -} - -func (m *CMsgTFCoaching_FindCoachResponse) GetCoachName() string { - if m != nil && m.CoachName != nil { - return *m.CoachName - } - return "" -} - -type CMsgTFCoaching_AskCoach struct { - AccountIdStudent *uint32 `protobuf:"varint,1,opt,name=account_id_student" json:"account_id_student,omitempty"` - StudentIsFriend *bool `protobuf:"varint,2,opt,name=student_is_friend" json:"student_is_friend,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_AskCoach) Reset() { *m = CMsgTFCoaching_AskCoach{} } -func (m *CMsgTFCoaching_AskCoach) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_AskCoach) ProtoMessage() {} -func (*CMsgTFCoaching_AskCoach) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{22} } - -func (m *CMsgTFCoaching_AskCoach) GetAccountIdStudent() uint32 { - if m != nil && m.AccountIdStudent != nil { - return *m.AccountIdStudent - } - return 0 -} - -func (m *CMsgTFCoaching_AskCoach) GetStudentIsFriend() bool { - if m != nil && m.StudentIsFriend != nil { - return *m.StudentIsFriend - } - return false -} - -type CMsgTFCoaching_AskCoachResponse struct { - AcceptCoachingAssignment *bool `protobuf:"varint,1,opt,name=accept_coaching_assignment" json:"accept_coaching_assignment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_AskCoachResponse) Reset() { *m = CMsgTFCoaching_AskCoachResponse{} } -func (m *CMsgTFCoaching_AskCoachResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_AskCoachResponse) ProtoMessage() {} -func (*CMsgTFCoaching_AskCoachResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{23} -} - -func (m *CMsgTFCoaching_AskCoachResponse) GetAcceptCoachingAssignment() bool { - if m != nil && m.AcceptCoachingAssignment != nil { - return *m.AcceptCoachingAssignment - } - return false -} - -type CMsgTFCoaching_CoachJoinGame struct { - JoinGame *bool `protobuf:"varint,1,opt,name=join_game" json:"join_game,omitempty"` - ServerAddress *uint32 `protobuf:"varint,2,opt,name=server_address" json:"server_address,omitempty"` - ServerPort *uint32 `protobuf:"varint,3,opt,name=server_port" json:"server_port,omitempty"` - AccountIdStudent *uint32 `protobuf:"varint,4,opt,name=account_id_student" json:"account_id_student,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_CoachJoinGame) Reset() { *m = CMsgTFCoaching_CoachJoinGame{} } -func (m *CMsgTFCoaching_CoachJoinGame) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_CoachJoinGame) ProtoMessage() {} -func (*CMsgTFCoaching_CoachJoinGame) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{24} } - -func (m *CMsgTFCoaching_CoachJoinGame) GetJoinGame() bool { - if m != nil && m.JoinGame != nil { - return *m.JoinGame - } - return false -} - -func (m *CMsgTFCoaching_CoachJoinGame) GetServerAddress() uint32 { - if m != nil && m.ServerAddress != nil { - return *m.ServerAddress - } - return 0 -} - -func (m *CMsgTFCoaching_CoachJoinGame) GetServerPort() uint32 { - if m != nil && m.ServerPort != nil { - return *m.ServerPort - } - return 0 -} - -func (m *CMsgTFCoaching_CoachJoinGame) GetAccountIdStudent() uint32 { - if m != nil && m.AccountIdStudent != nil { - return *m.AccountIdStudent - } - return 0 -} - -type CMsgTFCoaching_CoachJoining struct { - AccountIdCoach *uint32 `protobuf:"varint,1,opt,name=account_id_coach" json:"account_id_coach,omitempty"` - AccountIdStudent *uint32 `protobuf:"varint,2,opt,name=account_id_student" json:"account_id_student,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_CoachJoining) Reset() { *m = CMsgTFCoaching_CoachJoining{} } -func (m *CMsgTFCoaching_CoachJoining) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_CoachJoining) ProtoMessage() {} -func (*CMsgTFCoaching_CoachJoining) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{25} } - -func (m *CMsgTFCoaching_CoachJoining) GetAccountIdCoach() uint32 { - if m != nil && m.AccountIdCoach != nil { - return *m.AccountIdCoach - } - return 0 -} - -func (m *CMsgTFCoaching_CoachJoining) GetAccountIdStudent() uint32 { - if m != nil && m.AccountIdStudent != nil { - return *m.AccountIdStudent - } - return 0 -} - -type CMsgTFCoaching_CoachJoined struct { - AccountIdCoach *uint32 `protobuf:"varint,1,opt,name=account_id_coach" json:"account_id_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_CoachJoined) Reset() { *m = CMsgTFCoaching_CoachJoined{} } -func (m *CMsgTFCoaching_CoachJoined) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_CoachJoined) ProtoMessage() {} -func (*CMsgTFCoaching_CoachJoined) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{26} } - -func (m *CMsgTFCoaching_CoachJoined) GetAccountIdCoach() uint32 { - if m != nil && m.AccountIdCoach != nil { - return *m.AccountIdCoach - } - return 0 -} - -type CMsgTFCoaching_LikeCurrentCoach struct { - LikeCoach *bool `protobuf:"varint,1,opt,name=like_coach" json:"like_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_LikeCurrentCoach) Reset() { *m = CMsgTFCoaching_LikeCurrentCoach{} } -func (m *CMsgTFCoaching_LikeCurrentCoach) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_LikeCurrentCoach) ProtoMessage() {} -func (*CMsgTFCoaching_LikeCurrentCoach) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{27} -} - -func (m *CMsgTFCoaching_LikeCurrentCoach) GetLikeCoach() bool { - if m != nil && m.LikeCoach != nil { - return *m.LikeCoach - } - return false -} - -type CMsgTFCoaching_RemoveCurrentCoach struct { - AccountIdCoach *uint32 `protobuf:"varint,1,opt,name=account_id_coach" json:"account_id_coach,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFCoaching_RemoveCurrentCoach) Reset() { *m = CMsgTFCoaching_RemoveCurrentCoach{} } -func (m *CMsgTFCoaching_RemoveCurrentCoach) String() string { return proto.CompactTextString(m) } -func (*CMsgTFCoaching_RemoveCurrentCoach) ProtoMessage() {} -func (*CMsgTFCoaching_RemoveCurrentCoach) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{28} -} - -func (m *CMsgTFCoaching_RemoveCurrentCoach) GetAccountIdCoach() uint32 { - if m != nil && m.AccountIdCoach != nil { - return *m.AccountIdCoach - } - return 0 -} - -type CMsgTFQuickplay_ScoreServers struct { - Servers []*CMsgTFQuickplay_ScoreServers_ServerInfo `protobuf:"bytes,1,rep,name=servers" json:"servers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFQuickplay_ScoreServers) Reset() { *m = CMsgTFQuickplay_ScoreServers{} } -func (m *CMsgTFQuickplay_ScoreServers) String() string { return proto.CompactTextString(m) } -func (*CMsgTFQuickplay_ScoreServers) ProtoMessage() {} -func (*CMsgTFQuickplay_ScoreServers) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{29} } - -func (m *CMsgTFQuickplay_ScoreServers) GetServers() []*CMsgTFQuickplay_ScoreServers_ServerInfo { - if m != nil { - return m.Servers - } - return nil -} - -type CMsgTFQuickplay_ScoreServers_ServerInfo struct { - ServerAddress *uint32 `protobuf:"varint,1,opt,name=server_address" json:"server_address,omitempty"` - ServerPort *uint32 `protobuf:"varint,2,opt,name=server_port" json:"server_port,omitempty"` - NumUsers *uint32 `protobuf:"varint,3,opt,name=num_users" json:"num_users,omitempty"` - SteamId *uint64 `protobuf:"varint,4,opt,name=steam_id" json:"steam_id,omitempty"` - MaxUsers *uint32 `protobuf:"varint,5,opt,name=max_users" json:"max_users,omitempty"` - UserScore *float32 `protobuf:"fixed32,6,opt,name=user_score" json:"user_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) Reset() { - *m = CMsgTFQuickplay_ScoreServers_ServerInfo{} -} -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgTFQuickplay_ScoreServers_ServerInfo) ProtoMessage() {} -func (*CMsgTFQuickplay_ScoreServers_ServerInfo) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{29, 0} -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) GetServerAddress() uint32 { - if m != nil && m.ServerAddress != nil { - return *m.ServerAddress - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) GetServerPort() uint32 { - if m != nil && m.ServerPort != nil { - return *m.ServerPort - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) GetNumUsers() uint32 { - if m != nil && m.NumUsers != nil { - return *m.NumUsers - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) GetMaxUsers() uint32 { - if m != nil && m.MaxUsers != nil { - return *m.MaxUsers - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServers_ServerInfo) GetUserScore() float32 { - if m != nil && m.UserScore != nil { - return *m.UserScore - } - return 0 -} - -type CMsgTFQuickplay_ScoreServersResponse struct { - Servers []*CMsgTFQuickplay_ScoreServersResponse_ServerInfo `protobuf:"bytes,1,rep,name=servers" json:"servers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFQuickplay_ScoreServersResponse) Reset() { *m = CMsgTFQuickplay_ScoreServersResponse{} } -func (m *CMsgTFQuickplay_ScoreServersResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFQuickplay_ScoreServersResponse) ProtoMessage() {} -func (*CMsgTFQuickplay_ScoreServersResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{30} -} - -func (m *CMsgTFQuickplay_ScoreServersResponse) GetServers() []*CMsgTFQuickplay_ScoreServersResponse_ServerInfo { - if m != nil { - return m.Servers - } - return nil -} - -type CMsgTFQuickplay_ScoreServersResponse_ServerInfo struct { - ServerAddress *uint32 `protobuf:"varint,1,opt,name=server_address" json:"server_address,omitempty"` - ServerPort *uint32 `protobuf:"varint,2,opt,name=server_port" json:"server_port,omitempty"` - TotalScore *float32 `protobuf:"fixed32,3,opt,name=total_score" json:"total_score,omitempty"` - SteamId *uint64 `protobuf:"varint,4,opt,name=steam_id" json:"steam_id,omitempty"` - OptionsScore *uint32 `protobuf:"varint,5,opt,name=options_score" json:"options_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) Reset() { - *m = CMsgTFQuickplay_ScoreServersResponse_ServerInfo{} -} -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) String() string { - return proto.CompactTextString(m) -} -func (*CMsgTFQuickplay_ScoreServersResponse_ServerInfo) ProtoMessage() {} -func (*CMsgTFQuickplay_ScoreServersResponse_ServerInfo) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{30, 0} -} - -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) GetServerAddress() uint32 { - if m != nil && m.ServerAddress != nil { - return *m.ServerAddress - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) GetServerPort() uint32 { - if m != nil && m.ServerPort != nil { - return *m.ServerPort - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) GetTotalScore() float32 { - if m != nil && m.TotalScore != nil { - return *m.TotalScore - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgTFQuickplay_ScoreServersResponse_ServerInfo) GetOptionsScore() uint32 { - if m != nil && m.OptionsScore != nil { - return *m.OptionsScore - } - return 0 -} - -type CMsgTFQuickplay_PlayerJoining struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFQuickplay_PlayerJoining) Reset() { *m = CMsgTFQuickplay_PlayerJoining{} } -func (m *CMsgTFQuickplay_PlayerJoining) String() string { return proto.CompactTextString(m) } -func (*CMsgTFQuickplay_PlayerJoining) ProtoMessage() {} -func (*CMsgTFQuickplay_PlayerJoining) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{31} } - -func (m *CMsgTFQuickplay_PlayerJoining) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGC_GameServer_LevelInfo struct { - LevelLoaded *bool `protobuf:"varint,1,opt,name=level_loaded" json:"level_loaded,omitempty"` - LevelName *string `protobuf:"bytes,2,opt,name=level_name" json:"level_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_LevelInfo) Reset() { *m = CMsgGC_GameServer_LevelInfo{} } -func (m *CMsgGC_GameServer_LevelInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_LevelInfo) ProtoMessage() {} -func (*CMsgGC_GameServer_LevelInfo) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{32} } - -func (m *CMsgGC_GameServer_LevelInfo) GetLevelLoaded() bool { - if m != nil && m.LevelLoaded != nil { - return *m.LevelLoaded - } - return false -} - -func (m *CMsgGC_GameServer_LevelInfo) GetLevelName() string { - if m != nil && m.LevelName != nil { - return *m.LevelName - } - return "" -} - -type CMsgGC_GameServer_AuthChallenge struct { - ChallengeString *string `protobuf:"bytes,1,opt,name=challenge_string" json:"challenge_string,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_AuthChallenge) Reset() { *m = CMsgGC_GameServer_AuthChallenge{} } -func (m *CMsgGC_GameServer_AuthChallenge) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_AuthChallenge) ProtoMessage() {} -func (*CMsgGC_GameServer_AuthChallenge) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{33} -} - -func (m *CMsgGC_GameServer_AuthChallenge) GetChallengeString() string { - if m != nil && m.ChallengeString != nil { - return *m.ChallengeString - } - return "" -} - -type CMsgGC_GameServer_AuthResult struct { - Authenticated *bool `protobuf:"varint,1,opt,name=authenticated" json:"authenticated,omitempty"` - GameServerStanding *int32 `protobuf:"varint,2,opt,name=game_server_standing" json:"game_server_standing,omitempty"` - GameServerStandingTrend *int32 `protobuf:"varint,3,opt,name=game_server_standing_trend" json:"game_server_standing_trend,omitempty"` - IsValveServer *bool `protobuf:"varint,4,opt,name=is_valve_server" json:"is_valve_server,omitempty"` - Message *string `protobuf:"bytes,5,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_AuthResult) Reset() { *m = CMsgGC_GameServer_AuthResult{} } -func (m *CMsgGC_GameServer_AuthResult) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_AuthResult) ProtoMessage() {} -func (*CMsgGC_GameServer_AuthResult) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{34} } - -func (m *CMsgGC_GameServer_AuthResult) GetAuthenticated() bool { - if m != nil && m.Authenticated != nil { - return *m.Authenticated - } - return false -} - -func (m *CMsgGC_GameServer_AuthResult) GetGameServerStanding() int32 { - if m != nil && m.GameServerStanding != nil { - return *m.GameServerStanding - } - return 0 -} - -func (m *CMsgGC_GameServer_AuthResult) GetGameServerStandingTrend() int32 { - if m != nil && m.GameServerStandingTrend != nil { - return *m.GameServerStandingTrend - } - return 0 -} - -func (m *CMsgGC_GameServer_AuthResult) GetIsValveServer() bool { - if m != nil && m.IsValveServer != nil { - return *m.IsValveServer - } - return false -} - -func (m *CMsgGC_GameServer_AuthResult) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type CMsgGC_GameServer_AuthChallengeResponse struct { - GameServerAccountId *uint32 `protobuf:"varint,1,opt,name=game_server_account_id" json:"game_server_account_id,omitempty"` - HashedChallengeString []byte `protobuf:"bytes,2,opt,name=hashed_challenge_string" json:"hashed_challenge_string,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_AuthChallengeResponse) Reset() { - *m = CMsgGC_GameServer_AuthChallengeResponse{} -} -func (m *CMsgGC_GameServer_AuthChallengeResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_AuthChallengeResponse) ProtoMessage() {} -func (*CMsgGC_GameServer_AuthChallengeResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{35} -} - -func (m *CMsgGC_GameServer_AuthChallengeResponse) GetGameServerAccountId() uint32 { - if m != nil && m.GameServerAccountId != nil { - return *m.GameServerAccountId - } - return 0 -} - -func (m *CMsgGC_GameServer_AuthChallengeResponse) GetHashedChallengeString() []byte { - if m != nil { - return m.HashedChallengeString - } - return nil -} - -type CMsgGC_GameServer_CreateIdentity struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_CreateIdentity) Reset() { *m = CMsgGC_GameServer_CreateIdentity{} } -func (m *CMsgGC_GameServer_CreateIdentity) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_CreateIdentity) ProtoMessage() {} -func (*CMsgGC_GameServer_CreateIdentity) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{36} -} - -func (m *CMsgGC_GameServer_CreateIdentity) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGC_GameServer_CreateIdentityResponse struct { - AccountCreated *bool `protobuf:"varint,1,opt,name=account_created" json:"account_created,omitempty"` - GameServerAccountId *uint32 `protobuf:"varint,2,opt,name=game_server_account_id" json:"game_server_account_id,omitempty"` - GameServerIdentityToken *string `protobuf:"bytes,3,opt,name=game_server_identity_token" json:"game_server_identity_token,omitempty"` - Status *CMsgGC_GameServer_CreateIdentityResponse_EStatus `protobuf:"varint,4,opt,name=status,enum=CMsgGC_GameServer_CreateIdentityResponse_EStatus,def=0" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_CreateIdentityResponse) Reset() { - *m = CMsgGC_GameServer_CreateIdentityResponse{} -} -func (m *CMsgGC_GameServer_CreateIdentityResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_CreateIdentityResponse) ProtoMessage() {} -func (*CMsgGC_GameServer_CreateIdentityResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{37} -} - -const Default_CMsgGC_GameServer_CreateIdentityResponse_Status CMsgGC_GameServer_CreateIdentityResponse_EStatus = CMsgGC_GameServer_CreateIdentityResponse_kStatus_GenericFailure - -func (m *CMsgGC_GameServer_CreateIdentityResponse) GetAccountCreated() bool { - if m != nil && m.AccountCreated != nil { - return *m.AccountCreated - } - return false -} - -func (m *CMsgGC_GameServer_CreateIdentityResponse) GetGameServerAccountId() uint32 { - if m != nil && m.GameServerAccountId != nil { - return *m.GameServerAccountId - } - return 0 -} - -func (m *CMsgGC_GameServer_CreateIdentityResponse) GetGameServerIdentityToken() string { - if m != nil && m.GameServerIdentityToken != nil { - return *m.GameServerIdentityToken - } - return "" -} - -func (m *CMsgGC_GameServer_CreateIdentityResponse) GetStatus() CMsgGC_GameServer_CreateIdentityResponse_EStatus { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_CMsgGC_GameServer_CreateIdentityResponse_Status -} - -type CMsgGC_GameServer_List struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_List) Reset() { *m = CMsgGC_GameServer_List{} } -func (m *CMsgGC_GameServer_List) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_List) ProtoMessage() {} -func (*CMsgGC_GameServer_List) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{38} } - -func (m *CMsgGC_GameServer_List) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGC_GameServer_ListResponse struct { - OwnedGameServers []*CMsgGC_GameServer_ListResponse_GameServerIdentity `protobuf:"bytes,1,rep,name=owned_game_servers" json:"owned_game_servers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_ListResponse) Reset() { *m = CMsgGC_GameServer_ListResponse{} } -func (m *CMsgGC_GameServer_ListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_ListResponse) ProtoMessage() {} -func (*CMsgGC_GameServer_ListResponse) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{39} } - -func (m *CMsgGC_GameServer_ListResponse) GetOwnedGameServers() []*CMsgGC_GameServer_ListResponse_GameServerIdentity { - if m != nil { - return m.OwnedGameServers - } - return nil -} - -type CMsgGC_GameServer_ListResponse_GameServerIdentity struct { - GameServerAccountId *uint32 `protobuf:"varint,1,opt,name=game_server_account_id" json:"game_server_account_id,omitempty"` - GameServerIdentityToken *string `protobuf:"bytes,2,opt,name=game_server_identity_token" json:"game_server_identity_token,omitempty"` - GameServerStanding *int32 `protobuf:"varint,3,opt,name=game_server_standing" json:"game_server_standing,omitempty"` - GameServerStandingTrend *int32 `protobuf:"varint,4,opt,name=game_server_standing_trend" json:"game_server_standing_trend,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_ListResponse_GameServerIdentity) Reset() { - *m = CMsgGC_GameServer_ListResponse_GameServerIdentity{} -} -func (m *CMsgGC_GameServer_ListResponse_GameServerIdentity) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_GameServer_ListResponse_GameServerIdentity) ProtoMessage() {} -func (*CMsgGC_GameServer_ListResponse_GameServerIdentity) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{39, 0} -} - -func (m *CMsgGC_GameServer_ListResponse_GameServerIdentity) GetGameServerAccountId() uint32 { - if m != nil && m.GameServerAccountId != nil { - return *m.GameServerAccountId - } - return 0 -} - -func (m *CMsgGC_GameServer_ListResponse_GameServerIdentity) GetGameServerIdentityToken() string { - if m != nil && m.GameServerIdentityToken != nil { - return *m.GameServerIdentityToken - } - return "" -} - -func (m *CMsgGC_GameServer_ListResponse_GameServerIdentity) GetGameServerStanding() int32 { - if m != nil && m.GameServerStanding != nil { - return *m.GameServerStanding - } - return 0 -} - -func (m *CMsgGC_GameServer_ListResponse_GameServerIdentity) GetGameServerStandingTrend() int32 { - if m != nil && m.GameServerStandingTrend != nil { - return *m.GameServerStandingTrend - } - return 0 -} - -type CMsgGC_GameServer_ResetIdentity struct { - GameServerAccountId *uint32 `protobuf:"varint,1,opt,name=game_server_account_id" json:"game_server_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_ResetIdentity) Reset() { *m = CMsgGC_GameServer_ResetIdentity{} } -func (m *CMsgGC_GameServer_ResetIdentity) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_ResetIdentity) ProtoMessage() {} -func (*CMsgGC_GameServer_ResetIdentity) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{40} -} - -func (m *CMsgGC_GameServer_ResetIdentity) GetGameServerAccountId() uint32 { - if m != nil && m.GameServerAccountId != nil { - return *m.GameServerAccountId - } - return 0 -} - -type CMsgGC_GameServer_ResetIdentityResponse struct { - GameServerIdentityTokenReset *bool `protobuf:"varint,1,opt,name=game_server_identity_token_reset" json:"game_server_identity_token_reset,omitempty"` - GameServerAccountId *uint32 `protobuf:"varint,2,opt,name=game_server_account_id" json:"game_server_account_id,omitempty"` - GameServerIdentityToken *string `protobuf:"bytes,3,opt,name=game_server_identity_token" json:"game_server_identity_token,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_ResetIdentityResponse) Reset() { - *m = CMsgGC_GameServer_ResetIdentityResponse{} -} -func (m *CMsgGC_GameServer_ResetIdentityResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_ResetIdentityResponse) ProtoMessage() {} -func (*CMsgGC_GameServer_ResetIdentityResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{41} -} - -func (m *CMsgGC_GameServer_ResetIdentityResponse) GetGameServerIdentityTokenReset() bool { - if m != nil && m.GameServerIdentityTokenReset != nil { - return *m.GameServerIdentityTokenReset - } - return false -} - -func (m *CMsgGC_GameServer_ResetIdentityResponse) GetGameServerAccountId() uint32 { - if m != nil && m.GameServerAccountId != nil { - return *m.GameServerAccountId - } - return 0 -} - -func (m *CMsgGC_GameServer_ResetIdentityResponse) GetGameServerIdentityToken() string { - if m != nil && m.GameServerIdentityToken != nil { - return *m.GameServerIdentityToken - } - return "" -} - -type CMsgGC_GameServer_AckPolicy struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_AckPolicy) Reset() { *m = CMsgGC_GameServer_AckPolicy{} } -func (m *CMsgGC_GameServer_AckPolicy) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_AckPolicy) ProtoMessage() {} -func (*CMsgGC_GameServer_AckPolicy) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{42} } - -type CMsgGC_GameServer_AckPolicyResponse struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_AckPolicyResponse) Reset() { *m = CMsgGC_GameServer_AckPolicyResponse{} } -func (m *CMsgGC_GameServer_AckPolicyResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_AckPolicyResponse) ProtoMessage() {} -func (*CMsgGC_GameServer_AckPolicyResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{43} -} - -func (m *CMsgGC_GameServer_AckPolicyResponse) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgGC_GameServer_AckPolicyResponse) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type CMsgGC_Client_UseServerModificationItem struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Client_UseServerModificationItem) Reset() { - *m = CMsgGC_Client_UseServerModificationItem{} -} -func (m *CMsgGC_Client_UseServerModificationItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Client_UseServerModificationItem) ProtoMessage() {} -func (*CMsgGC_Client_UseServerModificationItem) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{44} -} - -func (m *CMsgGC_Client_UseServerModificationItem) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -type CMsgGC_Client_UseServerModificationItem_Response struct { - ResponseCode *CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse `protobuf:"varint,1,opt,name=response_code,enum=CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse,def=1" json:"response_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Client_UseServerModificationItem_Response) Reset() { - *m = CMsgGC_Client_UseServerModificationItem_Response{} -} -func (m *CMsgGC_Client_UseServerModificationItem_Response) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_Client_UseServerModificationItem_Response) ProtoMessage() {} -func (*CMsgGC_Client_UseServerModificationItem_Response) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{45} -} - -const Default_CMsgGC_Client_UseServerModificationItem_Response_ResponseCode CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse = CMsgGC_Client_UseServerModificationItem_Response_kServerModificationItemResponse_AlreadyInUse - -func (m *CMsgGC_Client_UseServerModificationItem_Response) GetResponseCode() CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse { - if m != nil && m.ResponseCode != nil { - return *m.ResponseCode - } - return Default_CMsgGC_Client_UseServerModificationItem_Response_ResponseCode -} - -type CMsgGC_GameServer_UseServerModificationItem struct { - ModificationType *EServerModificationItemType `protobuf:"varint,1,opt,name=modification_type,enum=EServerModificationItemType,def=1" json:"modification_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_UseServerModificationItem) Reset() { - *m = CMsgGC_GameServer_UseServerModificationItem{} -} -func (m *CMsgGC_GameServer_UseServerModificationItem) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_GameServer_UseServerModificationItem) ProtoMessage() {} -func (*CMsgGC_GameServer_UseServerModificationItem) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{46} -} - -const Default_CMsgGC_GameServer_UseServerModificationItem_ModificationType EServerModificationItemType = EServerModificationItemType_kGameServerModificationItem_Halloween - -func (m *CMsgGC_GameServer_UseServerModificationItem) GetModificationType() EServerModificationItemType { - if m != nil && m.ModificationType != nil { - return *m.ModificationType - } - return Default_CMsgGC_GameServer_UseServerModificationItem_ModificationType -} - -type CMsgGC_GameServer_UseServerModificationItem_Response struct { - ModificationType *EServerModificationItemType `protobuf:"varint,1,opt,name=modification_type,enum=EServerModificationItemType,def=1" json:"modification_type,omitempty"` - ServerResponseCode *CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse `protobuf:"varint,2,opt,name=server_response_code,enum=CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse,def=1" json:"server_response_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_UseServerModificationItem_Response) Reset() { - *m = CMsgGC_GameServer_UseServerModificationItem_Response{} -} -func (m *CMsgGC_GameServer_UseServerModificationItem_Response) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_GameServer_UseServerModificationItem_Response) ProtoMessage() {} -func (*CMsgGC_GameServer_UseServerModificationItem_Response) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{47} -} - -const Default_CMsgGC_GameServer_UseServerModificationItem_Response_ModificationType EServerModificationItemType = EServerModificationItemType_kGameServerModificationItem_Halloween -const Default_CMsgGC_GameServer_UseServerModificationItem_Response_ServerResponseCode CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse = CMsgGC_GameServer_UseServerModificationItem_Response_kServerModificationItemServerResponse_Accepted - -func (m *CMsgGC_GameServer_UseServerModificationItem_Response) GetModificationType() EServerModificationItemType { - if m != nil && m.ModificationType != nil { - return *m.ModificationType - } - return Default_CMsgGC_GameServer_UseServerModificationItem_Response_ModificationType -} - -func (m *CMsgGC_GameServer_UseServerModificationItem_Response) GetServerResponseCode() CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse { - if m != nil && m.ServerResponseCode != nil { - return *m.ServerResponseCode - } - return Default_CMsgGC_GameServer_UseServerModificationItem_Response_ServerResponseCode -} - -type CMsgGC_GameServer_ServerModificationItemExpired struct { - ModificationType *EServerModificationItemType `protobuf:"varint,1,opt,name=modification_type,enum=EServerModificationItemType,def=1" json:"modification_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_ServerModificationItemExpired) Reset() { - *m = CMsgGC_GameServer_ServerModificationItemExpired{} -} -func (m *CMsgGC_GameServer_ServerModificationItemExpired) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_GameServer_ServerModificationItemExpired) ProtoMessage() {} -func (*CMsgGC_GameServer_ServerModificationItemExpired) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{48} -} - -const Default_CMsgGC_GameServer_ServerModificationItemExpired_ModificationType EServerModificationItemType = EServerModificationItemType_kGameServerModificationItem_Halloween - -func (m *CMsgGC_GameServer_ServerModificationItemExpired) GetModificationType() EServerModificationItemType { - if m != nil && m.ModificationType != nil { - return *m.ModificationType - } - return Default_CMsgGC_GameServer_ServerModificationItemExpired_ModificationType -} - -type CMsgGC_GameServer_ServerModificationItem struct { - ModificationType *EServerModificationItemType `protobuf:"varint,1,opt,name=modification_type,enum=EServerModificationItemType,def=1" json:"modification_type,omitempty"` - Active *bool `protobuf:"varint,2,opt,name=active" json:"active,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_GameServer_ServerModificationItem) Reset() { - *m = CMsgGC_GameServer_ServerModificationItem{} -} -func (m *CMsgGC_GameServer_ServerModificationItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_GameServer_ServerModificationItem) ProtoMessage() {} -func (*CMsgGC_GameServer_ServerModificationItem) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{49} -} - -const Default_CMsgGC_GameServer_ServerModificationItem_ModificationType EServerModificationItemType = EServerModificationItemType_kGameServerModificationItem_Halloween - -func (m *CMsgGC_GameServer_ServerModificationItem) GetModificationType() EServerModificationItemType { - if m != nil && m.ModificationType != nil { - return *m.ModificationType - } - return Default_CMsgGC_GameServer_ServerModificationItem_ModificationType -} - -func (m *CMsgGC_GameServer_ServerModificationItem) GetActive() bool { - if m != nil && m.Active != nil { - return *m.Active - } - return false -} - -type CMsgGC_Halloween_ReservedItem struct { - X []float32 `protobuf:"fixed32,1,rep,name=x" json:"x,omitempty"` - Y []float32 `protobuf:"fixed32,2,rep,name=y" json:"y,omitempty"` - Z []float32 `protobuf:"fixed32,3,rep,name=z" json:"z,omitempty"` - SpawnMetaInfo *uint32 `protobuf:"varint,7,opt,name=spawn_meta_info" json:"spawn_meta_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Halloween_ReservedItem) Reset() { *m = CMsgGC_Halloween_ReservedItem{} } -func (m *CMsgGC_Halloween_ReservedItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Halloween_ReservedItem) ProtoMessage() {} -func (*CMsgGC_Halloween_ReservedItem) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{50} } - -func (m *CMsgGC_Halloween_ReservedItem) GetX() []float32 { - if m != nil { - return m.X - } - return nil -} - -func (m *CMsgGC_Halloween_ReservedItem) GetY() []float32 { - if m != nil { - return m.Y - } - return nil -} - -func (m *CMsgGC_Halloween_ReservedItem) GetZ() []float32 { - if m != nil { - return m.Z - } - return nil -} - -func (m *CMsgGC_Halloween_ReservedItem) GetSpawnMetaInfo() uint32 { - if m != nil && m.SpawnMetaInfo != nil { - return *m.SpawnMetaInfo - } - return 0 -} - -type CMsgGC_Halloween_GrantItem struct { - RecipientAccountId *uint32 `protobuf:"varint,1,opt,name=recipient_account_id" json:"recipient_account_id,omitempty"` - LevelId *uint32 `protobuf:"varint,2,opt,name=level_id" json:"level_id,omitempty"` - Flagged *bool `protobuf:"varint,3,opt,name=flagged" json:"flagged,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Halloween_GrantItem) Reset() { *m = CMsgGC_Halloween_GrantItem{} } -func (m *CMsgGC_Halloween_GrantItem) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Halloween_GrantItem) ProtoMessage() {} -func (*CMsgGC_Halloween_GrantItem) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{51} } - -func (m *CMsgGC_Halloween_GrantItem) GetRecipientAccountId() uint32 { - if m != nil && m.RecipientAccountId != nil { - return *m.RecipientAccountId - } - return 0 -} - -func (m *CMsgGC_Halloween_GrantItem) GetLevelId() uint32 { - if m != nil && m.LevelId != nil { - return *m.LevelId - } - return 0 -} - -func (m *CMsgGC_Halloween_GrantItem) GetFlagged() bool { - if m != nil && m.Flagged != nil { - return *m.Flagged - } - return false -} - -type CMsgGC_Halloween_GrantItemResponse struct { - RecipientAccountId *uint32 `protobuf:"varint,1,opt,name=recipient_account_id" json:"recipient_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Halloween_GrantItemResponse) Reset() { *m = CMsgGC_Halloween_GrantItemResponse{} } -func (m *CMsgGC_Halloween_GrantItemResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Halloween_GrantItemResponse) ProtoMessage() {} -func (*CMsgGC_Halloween_GrantItemResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{52} -} - -func (m *CMsgGC_Halloween_GrantItemResponse) GetRecipientAccountId() uint32 { - if m != nil && m.RecipientAccountId != nil { - return *m.RecipientAccountId - } - return 0 -} - -type CMsgGC_Halloween_ItemClaimed struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Halloween_ItemClaimed) Reset() { *m = CMsgGC_Halloween_ItemClaimed{} } -func (m *CMsgGC_Halloween_ItemClaimed) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Halloween_ItemClaimed) ProtoMessage() {} -func (*CMsgGC_Halloween_ItemClaimed) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{53} } - -type CMsgGC_PickupItemEligibility_Query struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - SecondsAgo *uint32 `protobuf:"varint,2,opt,name=seconds_ago" json:"seconds_ago,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_PickupItemEligibility_Query) Reset() { *m = CMsgGC_PickupItemEligibility_Query{} } -func (m *CMsgGC_PickupItemEligibility_Query) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_PickupItemEligibility_Query) ProtoMessage() {} -func (*CMsgGC_PickupItemEligibility_Query) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{54} -} - -func (m *CMsgGC_PickupItemEligibility_Query) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGC_PickupItemEligibility_Query) GetSecondsAgo() uint32 { - if m != nil && m.SecondsAgo != nil { - return *m.SecondsAgo - } - return 0 -} - -type CMsgGC_PickupItemEligibility_QueryResponse struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - WasEligible *bool `protobuf:"varint,2,opt,name=was_eligible" json:"was_eligible,omitempty"` - LevelId *uint32 `protobuf:"varint,3,opt,name=level_id" json:"level_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_PickupItemEligibility_QueryResponse) Reset() { - *m = CMsgGC_PickupItemEligibility_QueryResponse{} -} -func (m *CMsgGC_PickupItemEligibility_QueryResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_PickupItemEligibility_QueryResponse) ProtoMessage() {} -func (*CMsgGC_PickupItemEligibility_QueryResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{55} -} - -func (m *CMsgGC_PickupItemEligibility_QueryResponse) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CMsgGC_PickupItemEligibility_QueryResponse) GetWasEligible() bool { - if m != nil && m.WasEligible != nil { - return *m.WasEligible - } - return false -} - -func (m *CMsgGC_PickupItemEligibility_QueryResponse) GetLevelId() uint32 { - if m != nil && m.LevelId != nil { - return *m.LevelId - } - return 0 -} - -type CSOTFPartyMember struct { - OwnsTicket *bool `protobuf:"varint,2,opt,name=owns_ticket" json:"owns_ticket,omitempty"` - CompletedMissions *uint32 `protobuf:"varint,3,opt,name=completed_missions" json:"completed_missions,omitempty"` - BadgeLevel *uint32 `protobuf:"varint,4,opt,name=badge_level" json:"badge_level,omitempty"` - SquadSurplus *bool `protobuf:"varint,5,opt,name=squad_surplus" json:"squad_surplus,omitempty"` - IsBanned *bool `protobuf:"varint,8,opt,name=is_banned,def=0" json:"is_banned,omitempty"` - OwnsLadderPass *bool `protobuf:"varint,9,opt,name=owns_ladder_pass" json:"owns_ladder_pass,omitempty"` - PhoneVerified *bool `protobuf:"varint,10,opt,name=phone_verified,def=0" json:"phone_verified,omitempty"` - TwoFactorEnabled *bool `protobuf:"varint,11,opt,name=two_factor_enabled,def=0" json:"two_factor_enabled,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFPartyMember) Reset() { *m = CSOTFPartyMember{} } -func (m *CSOTFPartyMember) String() string { return proto.CompactTextString(m) } -func (*CSOTFPartyMember) ProtoMessage() {} -func (*CSOTFPartyMember) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{56} } - -const Default_CSOTFPartyMember_IsBanned bool = false -const Default_CSOTFPartyMember_PhoneVerified bool = false -const Default_CSOTFPartyMember_TwoFactorEnabled bool = false - -func (m *CSOTFPartyMember) GetOwnsTicket() bool { - if m != nil && m.OwnsTicket != nil { - return *m.OwnsTicket - } - return false -} - -func (m *CSOTFPartyMember) GetCompletedMissions() uint32 { - if m != nil && m.CompletedMissions != nil { - return *m.CompletedMissions - } - return 0 -} - -func (m *CSOTFPartyMember) GetBadgeLevel() uint32 { - if m != nil && m.BadgeLevel != nil { - return *m.BadgeLevel - } - return 0 -} - -func (m *CSOTFPartyMember) GetSquadSurplus() bool { - if m != nil && m.SquadSurplus != nil { - return *m.SquadSurplus - } - return false -} - -func (m *CSOTFPartyMember) GetIsBanned() bool { - if m != nil && m.IsBanned != nil { - return *m.IsBanned - } - return Default_CSOTFPartyMember_IsBanned -} - -func (m *CSOTFPartyMember) GetOwnsLadderPass() bool { - if m != nil && m.OwnsLadderPass != nil { - return *m.OwnsLadderPass - } - return false -} - -func (m *CSOTFPartyMember) GetPhoneVerified() bool { - if m != nil && m.PhoneVerified != nil { - return *m.PhoneVerified - } - return Default_CSOTFPartyMember_PhoneVerified -} - -func (m *CSOTFPartyMember) GetTwoFactorEnabled() bool { - if m != nil && m.TwoFactorEnabled != nil { - return *m.TwoFactorEnabled - } - return Default_CSOTFPartyMember_TwoFactorEnabled -} - -type CMsgMatchSearchCriteria struct { - MatchmakingMode *TF_MatchmakingMode `protobuf:"varint,7,opt,name=matchmaking_mode,enum=TF_MatchmakingMode,def=0" json:"matchmaking_mode,omitempty"` - LateJoinOk *bool `protobuf:"varint,5,opt,name=late_join_ok" json:"late_join_ok,omitempty"` - MvmMannupTour *string `protobuf:"bytes,10,opt,name=mvm_mannup_tour" json:"mvm_mannup_tour,omitempty"` - MvmMissions []string `protobuf:"bytes,9,rep,name=mvm_missions" json:"mvm_missions,omitempty"` - PlayForBraggingRights *bool `protobuf:"varint,6,opt,name=play_for_bragging_rights" json:"play_for_bragging_rights,omitempty"` - QuickplayGameType *uint32 `protobuf:"varint,8,opt,name=quickplay_game_type" json:"quickplay_game_type,omitempty"` - LadderGameType *uint32 `protobuf:"varint,11,opt,name=ladder_game_type" json:"ladder_game_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchSearchCriteria) Reset() { *m = CMsgMatchSearchCriteria{} } -func (m *CMsgMatchSearchCriteria) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchSearchCriteria) ProtoMessage() {} -func (*CMsgMatchSearchCriteria) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{57} } - -const Default_CMsgMatchSearchCriteria_MatchmakingMode TF_MatchmakingMode = TF_MatchmakingMode_TF_Matchmaking_INVALID - -func (m *CMsgMatchSearchCriteria) GetMatchmakingMode() TF_MatchmakingMode { - if m != nil && m.MatchmakingMode != nil { - return *m.MatchmakingMode - } - return Default_CMsgMatchSearchCriteria_MatchmakingMode -} - -func (m *CMsgMatchSearchCriteria) GetLateJoinOk() bool { - if m != nil && m.LateJoinOk != nil { - return *m.LateJoinOk - } - return false -} - -func (m *CMsgMatchSearchCriteria) GetMvmMannupTour() string { - if m != nil && m.MvmMannupTour != nil { - return *m.MvmMannupTour - } - return "" -} - -func (m *CMsgMatchSearchCriteria) GetMvmMissions() []string { - if m != nil { - return m.MvmMissions - } - return nil -} - -func (m *CMsgMatchSearchCriteria) GetPlayForBraggingRights() bool { - if m != nil && m.PlayForBraggingRights != nil { - return *m.PlayForBraggingRights - } - return false -} - -func (m *CMsgMatchSearchCriteria) GetQuickplayGameType() uint32 { - if m != nil && m.QuickplayGameType != nil { - return *m.QuickplayGameType - } - return 0 -} - -func (m *CMsgMatchSearchCriteria) GetLadderGameType() uint32 { - if m != nil && m.LadderGameType != nil { - return *m.LadderGameType - } - return 0 -} - -type CMsgCreateOrUpdateParty struct { - SearchCriteria *CMsgMatchSearchCriteria `protobuf:"bytes,1,opt,name=search_criteria" json:"search_criteria,omitempty"` - SteamLobbyId *uint64 `protobuf:"fixed64,3,opt,name=steam_lobby_id" json:"steam_lobby_id,omitempty"` - SquadSurplus *bool `protobuf:"varint,4,opt,name=squad_surplus" json:"squad_surplus,omitempty"` - WizardStep *TF_Matchmaking_WizardStep `protobuf:"varint,5,opt,name=wizard_step,enum=TF_Matchmaking_WizardStep,def=0" json:"wizard_step,omitempty"` - ClientVersion *uint32 `protobuf:"varint,6,opt,name=client_version,def=1225" json:"client_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCreateOrUpdateParty) Reset() { *m = CMsgCreateOrUpdateParty{} } -func (m *CMsgCreateOrUpdateParty) String() string { return proto.CompactTextString(m) } -func (*CMsgCreateOrUpdateParty) ProtoMessage() {} -func (*CMsgCreateOrUpdateParty) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{58} } - -const Default_CMsgCreateOrUpdateParty_WizardStep TF_Matchmaking_WizardStep = TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_INVALID -const Default_CMsgCreateOrUpdateParty_ClientVersion uint32 = 1225 - -func (m *CMsgCreateOrUpdateParty) GetSearchCriteria() *CMsgMatchSearchCriteria { - if m != nil { - return m.SearchCriteria - } - return nil -} - -func (m *CMsgCreateOrUpdateParty) GetSteamLobbyId() uint64 { - if m != nil && m.SteamLobbyId != nil { - return *m.SteamLobbyId - } - return 0 -} - -func (m *CMsgCreateOrUpdateParty) GetSquadSurplus() bool { - if m != nil && m.SquadSurplus != nil { - return *m.SquadSurplus - } - return false -} - -func (m *CMsgCreateOrUpdateParty) GetWizardStep() TF_Matchmaking_WizardStep { - if m != nil && m.WizardStep != nil { - return *m.WizardStep - } - return Default_CMsgCreateOrUpdateParty_WizardStep -} - -func (m *CMsgCreateOrUpdateParty) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return Default_CMsgCreateOrUpdateParty_ClientVersion -} - -type CMsgCreateOrUpdatePartyReply struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - WizardStep *TF_Matchmaking_WizardStep `protobuf:"varint,3,opt,name=wizard_step,enum=TF_Matchmaking_WizardStep,def=0" json:"wizard_step,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgCreateOrUpdatePartyReply) Reset() { *m = CMsgCreateOrUpdatePartyReply{} } -func (m *CMsgCreateOrUpdatePartyReply) String() string { return proto.CompactTextString(m) } -func (*CMsgCreateOrUpdatePartyReply) ProtoMessage() {} -func (*CMsgCreateOrUpdatePartyReply) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{59} } - -const Default_CMsgCreateOrUpdatePartyReply_WizardStep TF_Matchmaking_WizardStep = TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_INVALID - -func (m *CMsgCreateOrUpdatePartyReply) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -func (m *CMsgCreateOrUpdatePartyReply) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *CMsgCreateOrUpdatePartyReply) GetWizardStep() TF_Matchmaking_WizardStep { - if m != nil && m.WizardStep != nil { - return *m.WizardStep - } - return Default_CMsgCreateOrUpdatePartyReply_WizardStep -} - -type CSOTFParty struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - LeaderId *uint64 `protobuf:"fixed64,2,opt,name=leader_id" json:"leader_id,omitempty"` - MemberIds []uint64 `protobuf:"fixed64,3,rep,name=member_ids" json:"member_ids,omitempty"` - Members []*CSOTFPartyMember `protobuf:"bytes,13,rep,name=members" json:"members,omitempty"` - PendingInvites []uint64 `protobuf:"fixed64,5,rep,name=pending_invites" json:"pending_invites,omitempty"` - State *CSOTFParty_State `protobuf:"varint,6,opt,name=state,enum=CSOTFParty_State,def=0" json:"state,omitempty"` - WizardStep *TF_Matchmaking_WizardStep `protobuf:"varint,29,opt,name=wizard_step,enum=TF_Matchmaking_WizardStep,def=0" json:"wizard_step,omitempty"` - StartedMatchmakingTime *uint32 `protobuf:"varint,7,opt,name=started_matchmaking_time" json:"started_matchmaking_time,omitempty"` - SearchingPlayersByGroup []uint32 `protobuf:"varint,10,rep,name=searching_players_by_group" json:"searching_players_by_group,omitempty"` - SteamLobbyId *uint64 `protobuf:"fixed64,27,opt,name=steam_lobby_id" json:"steam_lobby_id,omitempty"` - MatchmakingMode *TF_MatchmakingMode `protobuf:"varint,30,opt,name=matchmaking_mode,enum=TF_MatchmakingMode,def=0" json:"matchmaking_mode,omitempty"` - SearchLateJoinOk *bool `protobuf:"varint,23,opt,name=search_late_join_ok" json:"search_late_join_ok,omitempty"` - SearchMvmMannupTour *string `protobuf:"bytes,32,opt,name=search_mvm_mannup_tour" json:"search_mvm_mannup_tour,omitempty"` - SearchMvmMissions []string `protobuf:"bytes,31,rep,name=search_mvm_missions" json:"search_mvm_missions,omitempty"` - SearchPlayForBraggingRights *bool `protobuf:"varint,26,opt,name=search_play_for_bragging_rights" json:"search_play_for_bragging_rights,omitempty"` - SearchQuickplayGameType *uint32 `protobuf:"varint,28,opt,name=search_quickplay_game_type" json:"search_quickplay_game_type,omitempty"` - SearchLadderGameType *uint32 `protobuf:"varint,33,opt,name=search_ladder_game_type" json:"search_ladder_game_type,omitempty"` - PreventMatchUntilDate *uint32 `protobuf:"varint,18,opt,name=prevent_match_until_date" json:"prevent_match_until_date,omitempty"` - PreventMatchAccountId *uint32 `protobuf:"varint,19,opt,name=prevent_match_account_id" json:"prevent_match_account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFParty) Reset() { *m = CSOTFParty{} } -func (m *CSOTFParty) String() string { return proto.CompactTextString(m) } -func (*CSOTFParty) ProtoMessage() {} -func (*CSOTFParty) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{60} } - -const Default_CSOTFParty_State CSOTFParty_State = CSOTFParty_UI -const Default_CSOTFParty_WizardStep TF_Matchmaking_WizardStep = TF_Matchmaking_WizardStep_TF_Matchmaking_WizardStep_INVALID -const Default_CSOTFParty_MatchmakingMode TF_MatchmakingMode = TF_MatchmakingMode_TF_Matchmaking_INVALID - -func (m *CSOTFParty) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CSOTFParty) GetLeaderId() uint64 { - if m != nil && m.LeaderId != nil { - return *m.LeaderId - } - return 0 -} - -func (m *CSOTFParty) GetMemberIds() []uint64 { - if m != nil { - return m.MemberIds - } - return nil -} - -func (m *CSOTFParty) GetMembers() []*CSOTFPartyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CSOTFParty) GetPendingInvites() []uint64 { - if m != nil { - return m.PendingInvites - } - return nil -} - -func (m *CSOTFParty) GetState() CSOTFParty_State { - if m != nil && m.State != nil { - return *m.State - } - return Default_CSOTFParty_State -} - -func (m *CSOTFParty) GetWizardStep() TF_Matchmaking_WizardStep { - if m != nil && m.WizardStep != nil { - return *m.WizardStep - } - return Default_CSOTFParty_WizardStep -} - -func (m *CSOTFParty) GetStartedMatchmakingTime() uint32 { - if m != nil && m.StartedMatchmakingTime != nil { - return *m.StartedMatchmakingTime - } - return 0 -} - -func (m *CSOTFParty) GetSearchingPlayersByGroup() []uint32 { - if m != nil { - return m.SearchingPlayersByGroup - } - return nil -} - -func (m *CSOTFParty) GetSteamLobbyId() uint64 { - if m != nil && m.SteamLobbyId != nil { - return *m.SteamLobbyId - } - return 0 -} - -func (m *CSOTFParty) GetMatchmakingMode() TF_MatchmakingMode { - if m != nil && m.MatchmakingMode != nil { - return *m.MatchmakingMode - } - return Default_CSOTFParty_MatchmakingMode -} - -func (m *CSOTFParty) GetSearchLateJoinOk() bool { - if m != nil && m.SearchLateJoinOk != nil { - return *m.SearchLateJoinOk - } - return false -} - -func (m *CSOTFParty) GetSearchMvmMannupTour() string { - if m != nil && m.SearchMvmMannupTour != nil { - return *m.SearchMvmMannupTour - } - return "" -} - -func (m *CSOTFParty) GetSearchMvmMissions() []string { - if m != nil { - return m.SearchMvmMissions - } - return nil -} - -func (m *CSOTFParty) GetSearchPlayForBraggingRights() bool { - if m != nil && m.SearchPlayForBraggingRights != nil { - return *m.SearchPlayForBraggingRights - } - return false -} - -func (m *CSOTFParty) GetSearchQuickplayGameType() uint32 { - if m != nil && m.SearchQuickplayGameType != nil { - return *m.SearchQuickplayGameType - } - return 0 -} - -func (m *CSOTFParty) GetSearchLadderGameType() uint32 { - if m != nil && m.SearchLadderGameType != nil { - return *m.SearchLadderGameType - } - return 0 -} - -func (m *CSOTFParty) GetPreventMatchUntilDate() uint32 { - if m != nil && m.PreventMatchUntilDate != nil { - return *m.PreventMatchUntilDate - } - return 0 -} - -func (m *CSOTFParty) GetPreventMatchAccountId() uint32 { - if m != nil && m.PreventMatchAccountId != nil { - return *m.PreventMatchAccountId - } - return 0 -} - -type CSOTFPartyInvite struct { - GroupId *uint64 `protobuf:"varint,1,opt,name=group_id" json:"group_id,omitempty"` - SenderId *uint64 `protobuf:"fixed64,2,opt,name=sender_id" json:"sender_id,omitempty"` - SenderName *string `protobuf:"bytes,3,opt,name=sender_name" json:"sender_name,omitempty"` - Members []*CSOTFPartyInvite_PartyMember `protobuf:"bytes,4,rep,name=members" json:"members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFPartyInvite) Reset() { *m = CSOTFPartyInvite{} } -func (m *CSOTFPartyInvite) String() string { return proto.CompactTextString(m) } -func (*CSOTFPartyInvite) ProtoMessage() {} -func (*CSOTFPartyInvite) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{61} } - -func (m *CSOTFPartyInvite) GetGroupId() uint64 { - if m != nil && m.GroupId != nil { - return *m.GroupId - } - return 0 -} - -func (m *CSOTFPartyInvite) GetSenderId() uint64 { - if m != nil && m.SenderId != nil { - return *m.SenderId - } - return 0 -} - -func (m *CSOTFPartyInvite) GetSenderName() string { - if m != nil && m.SenderName != nil { - return *m.SenderName - } - return "" -} - -func (m *CSOTFPartyInvite) GetMembers() []*CSOTFPartyInvite_PartyMember { - if m != nil { - return m.Members - } - return nil -} - -type CSOTFPartyInvite_PartyMember struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - Avatar *uint32 `protobuf:"varint,3,opt,name=avatar" json:"avatar,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFPartyInvite_PartyMember) Reset() { *m = CSOTFPartyInvite_PartyMember{} } -func (m *CSOTFPartyInvite_PartyMember) String() string { return proto.CompactTextString(m) } -func (*CSOTFPartyInvite_PartyMember) ProtoMessage() {} -func (*CSOTFPartyInvite_PartyMember) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{61, 0} -} - -func (m *CSOTFPartyInvite_PartyMember) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CSOTFPartyInvite_PartyMember) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CSOTFPartyInvite_PartyMember) GetAvatar() uint32 { - if m != nil && m.Avatar != nil { - return *m.Avatar - } - return 0 -} - -type CTFLobbyMember struct { - Id *uint64 `protobuf:"fixed64,1,opt,name=id" json:"id,omitempty"` - Team *TF_GC_TEAM `protobuf:"varint,3,opt,name=team,enum=TF_GC_TEAM,def=0" json:"team,omitempty"` - ConnectState *CTFLobbyMember_ConnectState `protobuf:"varint,13,opt,name=connect_state,enum=CTFLobbyMember_ConnectState,def=0" json:"connect_state,omitempty"` - Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` - Latitude *float32 `protobuf:"fixed32,8,opt,name=latitude" json:"latitude,omitempty"` - Longitude *float32 `protobuf:"fixed32,9,opt,name=longitude" json:"longitude,omitempty"` - ReadyState *TFLobbyReadyState `protobuf:"varint,11,opt,name=ready_state,enum=TFLobbyReadyState,def=0" json:"ready_state,omitempty"` - PartyId *uint64 `protobuf:"varint,12,opt,name=party_id" json:"party_id,omitempty"` - SquadSurplus *bool `protobuf:"varint,14,opt,name=squad_surplus" json:"squad_surplus,omitempty"` - BadgeLevel *uint32 `protobuf:"varint,15,opt,name=badge_level" json:"badge_level,omitempty"` - AbandonTime *uint32 `protobuf:"varint,16,opt,name=abandon_time,def=0" json:"abandon_time,omitempty"` - LastConnectTime *uint32 `protobuf:"varint,17,opt,name=last_connect_time" json:"last_connect_time,omitempty"` - QuittingResultsInPenalty *bool `protobuf:"varint,18,opt,name=quitting_results_in_penalty" json:"quitting_results_in_penalty,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CTFLobbyMember) Reset() { *m = CTFLobbyMember{} } -func (m *CTFLobbyMember) String() string { return proto.CompactTextString(m) } -func (*CTFLobbyMember) ProtoMessage() {} -func (*CTFLobbyMember) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{62} } - -const Default_CTFLobbyMember_Team TF_GC_TEAM = TF_GC_TEAM_TF_GC_TEAM_DEFENDERS -const Default_CTFLobbyMember_ConnectState CTFLobbyMember_ConnectState = CTFLobbyMember_INVALID -const Default_CTFLobbyMember_ReadyState TFLobbyReadyState = TFLobbyReadyState_TFLobbyReadyState_UNDECLARED -const Default_CTFLobbyMember_AbandonTime uint32 = 0 - -func (m *CTFLobbyMember) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *CTFLobbyMember) GetTeam() TF_GC_TEAM { - if m != nil && m.Team != nil { - return *m.Team - } - return Default_CTFLobbyMember_Team -} - -func (m *CTFLobbyMember) GetConnectState() CTFLobbyMember_ConnectState { - if m != nil && m.ConnectState != nil { - return *m.ConnectState - } - return Default_CTFLobbyMember_ConnectState -} - -func (m *CTFLobbyMember) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *CTFLobbyMember) GetLatitude() float32 { - if m != nil && m.Latitude != nil { - return *m.Latitude - } - return 0 -} - -func (m *CTFLobbyMember) GetLongitude() float32 { - if m != nil && m.Longitude != nil { - return *m.Longitude - } - return 0 -} - -func (m *CTFLobbyMember) GetReadyState() TFLobbyReadyState { - if m != nil && m.ReadyState != nil { - return *m.ReadyState - } - return Default_CTFLobbyMember_ReadyState -} - -func (m *CTFLobbyMember) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CTFLobbyMember) GetSquadSurplus() bool { - if m != nil && m.SquadSurplus != nil { - return *m.SquadSurplus - } - return false -} - -func (m *CTFLobbyMember) GetBadgeLevel() uint32 { - if m != nil && m.BadgeLevel != nil { - return *m.BadgeLevel - } - return 0 -} - -func (m *CTFLobbyMember) GetAbandonTime() uint32 { - if m != nil && m.AbandonTime != nil { - return *m.AbandonTime - } - return Default_CTFLobbyMember_AbandonTime -} - -func (m *CTFLobbyMember) GetLastConnectTime() uint32 { - if m != nil && m.LastConnectTime != nil { - return *m.LastConnectTime - } - return 0 -} - -func (m *CTFLobbyMember) GetQuittingResultsInPenalty() bool { - if m != nil && m.QuittingResultsInPenalty != nil { - return *m.QuittingResultsInPenalty - } - return false -} - -type CLobbyPendingPlayerReport struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Date *uint32 `protobuf:"fixed32,2,opt,name=date" json:"date,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CLobbyPendingPlayerReport) Reset() { *m = CLobbyPendingPlayerReport{} } -func (m *CLobbyPendingPlayerReport) String() string { return proto.CompactTextString(m) } -func (*CLobbyPendingPlayerReport) ProtoMessage() {} -func (*CLobbyPendingPlayerReport) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{63} } - -func (m *CLobbyPendingPlayerReport) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CLobbyPendingPlayerReport) GetDate() uint32 { - if m != nil && m.Date != nil { - return *m.Date - } - return 0 -} - -type CMsgGameMatchSignOut struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGameMatchSignOut) Reset() { *m = CMsgGameMatchSignOut{} } -func (m *CMsgGameMatchSignOut) String() string { return proto.CompactTextString(m) } -func (*CMsgGameMatchSignOut) ProtoMessage() {} -func (*CMsgGameMatchSignOut) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{64} } - -type CSOTFLobby struct { - LobbyId *uint64 `protobuf:"varint,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - Members []*CTFLobbyMember `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` - LeftMembers []*CTFLobbyMember `protobuf:"bytes,7,rep,name=left_members" json:"left_members,omitempty"` - LeaderId *uint64 `protobuf:"fixed64,11,opt,name=leader_id" json:"leader_id,omitempty"` - ServerId *uint64 `protobuf:"fixed64,6,opt,name=server_id,def=0" json:"server_id,omitempty"` - PendingInvites []uint64 `protobuf:"fixed64,10,rep,name=pending_invites" json:"pending_invites,omitempty"` - State *CSOTFLobby_State `protobuf:"varint,4,opt,name=state,enum=CSOTFLobby_State,def=1" json:"state,omitempty"` - Connect *string `protobuf:"bytes,5,opt,name=connect" json:"connect,omitempty"` - LobbyType *CSOTFLobby_LobbyType `protobuf:"varint,12,opt,name=lobby_type,enum=CSOTFLobby_LobbyType,def=-1" json:"lobby_type,omitempty"` - AllowCheats *bool `protobuf:"varint,13,opt,name=allow_cheats" json:"allow_cheats,omitempty"` - GameName *string `protobuf:"bytes,16,opt,name=game_name" json:"game_name,omitempty"` - ServerRegion *uint32 `protobuf:"varint,21,opt,name=server_region,def=0" json:"server_region,omitempty"` - GameState *TF_GC_GameState `protobuf:"varint,22,opt,name=game_state,enum=TF_GC_GameState,def=0" json:"game_state,omitempty"` - NumSpectators *uint32 `protobuf:"varint,23,opt,name=num_spectators" json:"num_spectators,omitempty"` - Matchgroup *uint32 `protobuf:"varint,25,opt,name=matchgroup" json:"matchgroup,omitempty"` - ReadyupRemainingTime *float32 `protobuf:"fixed32,26,opt,name=readyup_remaining_time" json:"readyup_remaining_time,omitempty"` - LeaverDetected *bool `protobuf:"varint,27,opt,name=leaver_detected" json:"leaver_detected,omitempty"` - AllowSpectating *bool `protobuf:"varint,31,opt,name=allow_spectating,def=1" json:"allow_spectating,omitempty"` - LoadGameLobbyId *uint64 `protobuf:"fixed64,33,opt,name=load_game_lobby_id" json:"load_game_lobby_id,omitempty"` - LoadGameSaveNumber *uint32 `protobuf:"varint,34,opt,name=load_game_save_number" json:"load_game_save_number,omitempty"` - MannupTourName *string `protobuf:"bytes,42,opt,name=mannup_tour_name" json:"mannup_tour_name,omitempty"` - MapName *string `protobuf:"bytes,38,opt,name=map_name" json:"map_name,omitempty"` - MissionName *string `protobuf:"bytes,39,opt,name=mission_name" json:"mission_name,omitempty"` - MatchGroup *uint32 `protobuf:"varint,41,opt,name=match_group" json:"match_group,omitempty"` - MatchId *uint64 `protobuf:"varint,30,opt,name=match_id,def=0" json:"match_id,omitempty"` - ReplaySalt *uint32 `protobuf:"fixed32,35,opt,name=replay_salt" json:"replay_salt,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFLobby) Reset() { *m = CSOTFLobby{} } -func (m *CSOTFLobby) String() string { return proto.CompactTextString(m) } -func (*CSOTFLobby) ProtoMessage() {} -func (*CSOTFLobby) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{65} } - -const Default_CSOTFLobby_ServerId uint64 = 0 -const Default_CSOTFLobby_State CSOTFLobby_State = CSOTFLobby_SERVERSETUP -const Default_CSOTFLobby_LobbyType CSOTFLobby_LobbyType = CSOTFLobby_INVALID -const Default_CSOTFLobby_ServerRegion uint32 = 0 -const Default_CSOTFLobby_GameState TF_GC_GameState = TF_GC_GameState_TF_GC_GAMESTATE_STATE_INIT -const Default_CSOTFLobby_AllowSpectating bool = true -const Default_CSOTFLobby_MatchId uint64 = 0 - -func (m *CSOTFLobby) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CSOTFLobby) GetMembers() []*CTFLobbyMember { - if m != nil { - return m.Members - } - return nil -} - -func (m *CSOTFLobby) GetLeftMembers() []*CTFLobbyMember { - if m != nil { - return m.LeftMembers - } - return nil -} - -func (m *CSOTFLobby) GetLeaderId() uint64 { - if m != nil && m.LeaderId != nil { - return *m.LeaderId - } - return 0 -} - -func (m *CSOTFLobby) GetServerId() uint64 { - if m != nil && m.ServerId != nil { - return *m.ServerId - } - return Default_CSOTFLobby_ServerId -} - -func (m *CSOTFLobby) GetPendingInvites() []uint64 { - if m != nil { - return m.PendingInvites - } - return nil -} - -func (m *CSOTFLobby) GetState() CSOTFLobby_State { - if m != nil && m.State != nil { - return *m.State - } - return Default_CSOTFLobby_State -} - -func (m *CSOTFLobby) GetConnect() string { - if m != nil && m.Connect != nil { - return *m.Connect - } - return "" -} - -func (m *CSOTFLobby) GetLobbyType() CSOTFLobby_LobbyType { - if m != nil && m.LobbyType != nil { - return *m.LobbyType - } - return Default_CSOTFLobby_LobbyType -} - -func (m *CSOTFLobby) GetAllowCheats() bool { - if m != nil && m.AllowCheats != nil { - return *m.AllowCheats - } - return false -} - -func (m *CSOTFLobby) GetGameName() string { - if m != nil && m.GameName != nil { - return *m.GameName - } - return "" -} - -func (m *CSOTFLobby) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return Default_CSOTFLobby_ServerRegion -} - -func (m *CSOTFLobby) GetGameState() TF_GC_GameState { - if m != nil && m.GameState != nil { - return *m.GameState - } - return Default_CSOTFLobby_GameState -} - -func (m *CSOTFLobby) GetNumSpectators() uint32 { - if m != nil && m.NumSpectators != nil { - return *m.NumSpectators - } - return 0 -} - -func (m *CSOTFLobby) GetMatchgroup() uint32 { - if m != nil && m.Matchgroup != nil { - return *m.Matchgroup - } - return 0 -} - -func (m *CSOTFLobby) GetReadyupRemainingTime() float32 { - if m != nil && m.ReadyupRemainingTime != nil { - return *m.ReadyupRemainingTime - } - return 0 -} - -func (m *CSOTFLobby) GetLeaverDetected() bool { - if m != nil && m.LeaverDetected != nil { - return *m.LeaverDetected - } - return false -} - -func (m *CSOTFLobby) GetAllowSpectating() bool { - if m != nil && m.AllowSpectating != nil { - return *m.AllowSpectating - } - return Default_CSOTFLobby_AllowSpectating -} - -func (m *CSOTFLobby) GetLoadGameLobbyId() uint64 { - if m != nil && m.LoadGameLobbyId != nil { - return *m.LoadGameLobbyId - } - return 0 -} - -func (m *CSOTFLobby) GetLoadGameSaveNumber() uint32 { - if m != nil && m.LoadGameSaveNumber != nil { - return *m.LoadGameSaveNumber - } - return 0 -} - -func (m *CSOTFLobby) GetMannupTourName() string { - if m != nil && m.MannupTourName != nil { - return *m.MannupTourName - } - return "" -} - -func (m *CSOTFLobby) GetMapName() string { - if m != nil && m.MapName != nil { - return *m.MapName - } - return "" -} - -func (m *CSOTFLobby) GetMissionName() string { - if m != nil && m.MissionName != nil { - return *m.MissionName - } - return "" -} - -func (m *CSOTFLobby) GetMatchGroup() uint32 { - if m != nil && m.MatchGroup != nil { - return *m.MatchGroup - } - return 0 -} - -func (m *CSOTFLobby) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return Default_CSOTFLobby_MatchId -} - -func (m *CSOTFLobby) GetReplaySalt() uint32 { - if m != nil && m.ReplaySalt != nil { - return *m.ReplaySalt - } - return 0 -} - -type CMsgExitMatchmaking struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgExitMatchmaking) Reset() { *m = CMsgExitMatchmaking{} } -func (m *CMsgExitMatchmaking) String() string { return proto.CompactTextString(m) } -func (*CMsgExitMatchmaking) ProtoMessage() {} -func (*CMsgExitMatchmaking) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{66} } - -type CMsgAcceptInvite struct { - PartyId *uint64 `protobuf:"varint,1,opt,name=party_id" json:"party_id,omitempty"` - SteamidLobby *uint64 `protobuf:"fixed64,2,opt,name=steamid_lobby" json:"steamid_lobby,omitempty"` - ClientVersion *uint32 `protobuf:"varint,3,opt,name=client_version,def=1225" json:"client_version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAcceptInvite) Reset() { *m = CMsgAcceptInvite{} } -func (m *CMsgAcceptInvite) String() string { return proto.CompactTextString(m) } -func (*CMsgAcceptInvite) ProtoMessage() {} -func (*CMsgAcceptInvite) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{67} } - -const Default_CMsgAcceptInvite_ClientVersion uint32 = 1225 - -func (m *CMsgAcceptInvite) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -func (m *CMsgAcceptInvite) GetSteamidLobby() uint64 { - if m != nil && m.SteamidLobby != nil { - return *m.SteamidLobby - } - return 0 -} - -func (m *CMsgAcceptInvite) GetClientVersion() uint32 { - if m != nil && m.ClientVersion != nil { - return *m.ClientVersion - } - return Default_CMsgAcceptInvite_ClientVersion -} - -type CMsgAcceptInviteResponse struct { - ResultCode *int32 `protobuf:"varint,1,opt,name=result_code" json:"result_code,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgAcceptInviteResponse) Reset() { *m = CMsgAcceptInviteResponse{} } -func (m *CMsgAcceptInviteResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgAcceptInviteResponse) ProtoMessage() {} -func (*CMsgAcceptInviteResponse) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{68} } - -func (m *CMsgAcceptInviteResponse) GetResultCode() int32 { - if m != nil && m.ResultCode != nil { - return *m.ResultCode - } - return 0 -} - -type CMsgReadyUp struct { - State *TFLobbyReadyState `protobuf:"varint,1,opt,name=state,enum=TFLobbyReadyState,def=0" json:"state,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgReadyUp) Reset() { *m = CMsgReadyUp{} } -func (m *CMsgReadyUp) String() string { return proto.CompactTextString(m) } -func (*CMsgReadyUp) ProtoMessage() {} -func (*CMsgReadyUp) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{69} } - -const Default_CMsgReadyUp_State TFLobbyReadyState = TFLobbyReadyState_TFLobbyReadyState_UNDECLARED - -func (m *CMsgReadyUp) GetState() TFLobbyReadyState { - if m != nil && m.State != nil { - return *m.State - } - return Default_CMsgReadyUp_State -} - -type CMsgMatchmakingSearchCountRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchmakingSearchCountRequest) Reset() { *m = CMsgMatchmakingSearchCountRequest{} } -func (m *CMsgMatchmakingSearchCountRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchmakingSearchCountRequest) ProtoMessage() {} -func (*CMsgMatchmakingSearchCountRequest) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{70} -} - -type CMsgMatchmakingSearchCountResponse struct { - SearchingPlayersByGroup []uint32 `protobuf:"varint,1,rep,name=searching_players_by_group" json:"searching_players_by_group,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchmakingSearchCountResponse) Reset() { *m = CMsgMatchmakingSearchCountResponse{} } -func (m *CMsgMatchmakingSearchCountResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchmakingSearchCountResponse) ProtoMessage() {} -func (*CMsgMatchmakingSearchCountResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{71} -} - -func (m *CMsgMatchmakingSearchCountResponse) GetSearchingPlayersByGroup() []uint32 { - if m != nil { - return m.SearchingPlayersByGroup - } - return nil -} - -type CMsgKickedFromMatchmakingQueue struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgKickedFromMatchmakingQueue) Reset() { *m = CMsgKickedFromMatchmakingQueue{} } -func (m *CMsgKickedFromMatchmakingQueue) String() string { return proto.CompactTextString(m) } -func (*CMsgKickedFromMatchmakingQueue) ProtoMessage() {} -func (*CMsgKickedFromMatchmakingQueue) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{72} } - -type CMsgTFPlayerFailedToConnect struct { - FailedLoaders []uint64 `protobuf:"fixed64,1,rep,name=failed_loaders" json:"failed_loaders,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFPlayerFailedToConnect) Reset() { *m = CMsgTFPlayerFailedToConnect{} } -func (m *CMsgTFPlayerFailedToConnect) String() string { return proto.CompactTextString(m) } -func (*CMsgTFPlayerFailedToConnect) ProtoMessage() {} -func (*CMsgTFPlayerFailedToConnect) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{73} } - -func (m *CMsgTFPlayerFailedToConnect) GetFailedLoaders() []uint64 { - if m != nil { - return m.FailedLoaders - } - return nil -} - -type CMsgTFJoinChatChannel struct { - PersonaName *string `protobuf:"bytes,1,opt,name=persona_name" json:"persona_name,omitempty"` - ChannelName *string `protobuf:"bytes,2,opt,name=channel_name" json:"channel_name,omitempty"` - Password *string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"` - ChannelType *ChatChannelTypeT `protobuf:"varint,4,opt,name=channel_type,enum=ChatChannelTypeT,def=0" json:"channel_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFJoinChatChannel) Reset() { *m = CMsgTFJoinChatChannel{} } -func (m *CMsgTFJoinChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgTFJoinChatChannel) ProtoMessage() {} -func (*CMsgTFJoinChatChannel) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{74} } - -const Default_CMsgTFJoinChatChannel_ChannelType ChatChannelTypeT = ChatChannelTypeT_ChatChannelType_Regional - -func (m *CMsgTFJoinChatChannel) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgTFJoinChatChannel) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgTFJoinChatChannel) GetPassword() string { - if m != nil && m.Password != nil { - return *m.Password - } - return "" -} - -func (m *CMsgTFJoinChatChannel) GetChannelType() ChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgTFJoinChatChannel_ChannelType -} - -type CMsgTFLeaveChatChannel struct { - ChannelName *string `protobuf:"bytes,1,opt,name=channel_name" json:"channel_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFLeaveChatChannel) Reset() { *m = CMsgTFLeaveChatChannel{} } -func (m *CMsgTFLeaveChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgTFLeaveChatChannel) ProtoMessage() {} -func (*CMsgTFLeaveChatChannel) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{75} } - -func (m *CMsgTFLeaveChatChannel) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -type CMsgTFJoinChatChannelResponse struct { - Response *uint32 `protobuf:"varint,1,opt,name=response" json:"response,omitempty"` - ChannelName *string `protobuf:"bytes,2,opt,name=channel_name" json:"channel_name,omitempty"` - ChannelId *uint64 `protobuf:"fixed64,3,opt,name=channel_id" json:"channel_id,omitempty"` - MaxMembers *uint32 `protobuf:"varint,4,opt,name=max_members" json:"max_members,omitempty"` - Members []*CMsgTFJoinChatChannelResponse_ChatMember `protobuf:"bytes,5,rep,name=members" json:"members,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFJoinChatChannelResponse) Reset() { *m = CMsgTFJoinChatChannelResponse{} } -func (m *CMsgTFJoinChatChannelResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFJoinChatChannelResponse) ProtoMessage() {} -func (*CMsgTFJoinChatChannelResponse) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{76} } - -func (m *CMsgTFJoinChatChannelResponse) GetResponse() uint32 { - if m != nil && m.Response != nil { - return *m.Response - } - return 0 -} - -func (m *CMsgTFJoinChatChannelResponse) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgTFJoinChatChannelResponse) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgTFJoinChatChannelResponse) GetMaxMembers() uint32 { - if m != nil && m.MaxMembers != nil { - return *m.MaxMembers - } - return 0 -} - -func (m *CMsgTFJoinChatChannelResponse) GetMembers() []*CMsgTFJoinChatChannelResponse_ChatMember { - if m != nil { - return m.Members - } - return nil -} - -type CMsgTFJoinChatChannelResponse_ChatMember struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFJoinChatChannelResponse_ChatMember) Reset() { - *m = CMsgTFJoinChatChannelResponse_ChatMember{} -} -func (m *CMsgTFJoinChatChannelResponse_ChatMember) String() string { return proto.CompactTextString(m) } -func (*CMsgTFJoinChatChannelResponse_ChatMember) ProtoMessage() {} -func (*CMsgTFJoinChatChannelResponse_ChatMember) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{76, 0} -} - -func (m *CMsgTFJoinChatChannelResponse_ChatMember) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgTFJoinChatChannelResponse_ChatMember) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -type CMsgTFOtherJoinedChatChannel struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - PersonaName *string `protobuf:"bytes,2,opt,name=persona_name" json:"persona_name,omitempty"` - SteamId *uint64 `protobuf:"fixed64,3,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFOtherJoinedChatChannel) Reset() { *m = CMsgTFOtherJoinedChatChannel{} } -func (m *CMsgTFOtherJoinedChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgTFOtherJoinedChatChannel) ProtoMessage() {} -func (*CMsgTFOtherJoinedChatChannel) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{77} } - -func (m *CMsgTFOtherJoinedChatChannel) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgTFOtherJoinedChatChannel) GetPersonaName() string { - if m != nil && m.PersonaName != nil { - return *m.PersonaName - } - return "" -} - -func (m *CMsgTFOtherJoinedChatChannel) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgTFOtherLeftChatChannel struct { - ChannelId *uint64 `protobuf:"fixed64,1,opt,name=channel_id" json:"channel_id,omitempty"` - SteamId *uint64 `protobuf:"fixed64,2,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFOtherLeftChatChannel) Reset() { *m = CMsgTFOtherLeftChatChannel{} } -func (m *CMsgTFOtherLeftChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgTFOtherLeftChatChannel) ProtoMessage() {} -func (*CMsgTFOtherLeftChatChannel) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{78} } - -func (m *CMsgTFOtherLeftChatChannel) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -func (m *CMsgTFOtherLeftChatChannel) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CMsgTFRequestDefaultChatChannel struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestDefaultChatChannel) Reset() { *m = CMsgTFRequestDefaultChatChannel{} } -func (m *CMsgTFRequestDefaultChatChannel) String() string { return proto.CompactTextString(m) } -func (*CMsgTFRequestDefaultChatChannel) ProtoMessage() {} -func (*CMsgTFRequestDefaultChatChannel) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{79} -} - -type CMsgTFRequestDefaultChatChannelResponse struct { - ChannelName *string `protobuf:"bytes,1,opt,name=channel_name" json:"channel_name,omitempty"` - ChannelId *uint64 `protobuf:"fixed64,2,opt,name=channel_id" json:"channel_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestDefaultChatChannelResponse) Reset() { - *m = CMsgTFRequestDefaultChatChannelResponse{} -} -func (m *CMsgTFRequestDefaultChatChannelResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFRequestDefaultChatChannelResponse) ProtoMessage() {} -func (*CMsgTFRequestDefaultChatChannelResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{80} -} - -func (m *CMsgTFRequestDefaultChatChannelResponse) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgTFRequestDefaultChatChannelResponse) GetChannelId() uint64 { - if m != nil && m.ChannelId != nil { - return *m.ChannelId - } - return 0 -} - -type CMsgTFRequestChatChannelList struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestChatChannelList) Reset() { *m = CMsgTFRequestChatChannelList{} } -func (m *CMsgTFRequestChatChannelList) String() string { return proto.CompactTextString(m) } -func (*CMsgTFRequestChatChannelList) ProtoMessage() {} -func (*CMsgTFRequestChatChannelList) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{81} } - -type CMsgTFRequestChatChannelListResponse struct { - Channels []*CMsgTFRequestChatChannelListResponse_ChatChannel `protobuf:"bytes,1,rep,name=channels" json:"channels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestChatChannelListResponse) Reset() { *m = CMsgTFRequestChatChannelListResponse{} } -func (m *CMsgTFRequestChatChannelListResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgTFRequestChatChannelListResponse) ProtoMessage() {} -func (*CMsgTFRequestChatChannelListResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{82} -} - -func (m *CMsgTFRequestChatChannelListResponse) GetChannels() []*CMsgTFRequestChatChannelListResponse_ChatChannel { - if m != nil { - return m.Channels - } - return nil -} - -type CMsgTFRequestChatChannelListResponse_ChatChannel struct { - ChannelName *string `protobuf:"bytes,1,opt,name=channel_name" json:"channel_name,omitempty"` - NumMembers *uint32 `protobuf:"varint,2,opt,name=num_members" json:"num_members,omitempty"` - ChannelType *ChatChannelTypeT `protobuf:"varint,3,opt,name=channel_type,enum=ChatChannelTypeT,def=0" json:"channel_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgTFRequestChatChannelListResponse_ChatChannel) Reset() { - *m = CMsgTFRequestChatChannelListResponse_ChatChannel{} -} -func (m *CMsgTFRequestChatChannelListResponse_ChatChannel) String() string { - return proto.CompactTextString(m) -} -func (*CMsgTFRequestChatChannelListResponse_ChatChannel) ProtoMessage() {} -func (*CMsgTFRequestChatChannelListResponse_ChatChannel) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{82, 0} -} - -const Default_CMsgTFRequestChatChannelListResponse_ChatChannel_ChannelType ChatChannelTypeT = ChatChannelTypeT_ChatChannelType_Regional - -func (m *CMsgTFRequestChatChannelListResponse_ChatChannel) GetChannelName() string { - if m != nil && m.ChannelName != nil { - return *m.ChannelName - } - return "" -} - -func (m *CMsgTFRequestChatChannelListResponse_ChatChannel) GetNumMembers() uint32 { - if m != nil && m.NumMembers != nil { - return *m.NumMembers - } - return 0 -} - -func (m *CMsgTFRequestChatChannelListResponse_ChatChannel) GetChannelType() ChatChannelTypeT { - if m != nil && m.ChannelType != nil { - return *m.ChannelType - } - return Default_CMsgTFRequestChatChannelListResponse_ChatChannel_ChannelType -} - -type CMsgGameServerMatchmakingStatus struct { - ServerVersion *uint32 `protobuf:"varint,16,opt,name=server_version,def=1225" json:"server_version,omitempty"` - MatchmakingState *ServerMatchmakingState `protobuf:"varint,1,opt,name=matchmaking_state,enum=ServerMatchmakingState,def=0" json:"matchmaking_state,omitempty"` - MatchmakingMode *TF_MatchmakingMode `protobuf:"varint,2,opt,name=matchmaking_mode,enum=TF_MatchmakingMode,def=0" json:"matchmaking_mode,omitempty"` - Map *string `protobuf:"bytes,3,opt,name=map" json:"map,omitempty"` - Tags *string `protobuf:"bytes,4,opt,name=tags" json:"tags,omitempty"` - BotCount *uint32 `protobuf:"varint,5,opt,name=bot_count" json:"bot_count,omitempty"` - NumSpectators *uint32 `protobuf:"varint,6,opt,name=num_spectators" json:"num_spectators,omitempty"` - MaxPlayers *uint32 `protobuf:"varint,7,opt,name=max_players" json:"max_players,omitempty"` - SlotsFree *uint32 `protobuf:"varint,8,opt,name=slots_free" json:"slots_free,omitempty"` - ServerRegion *uint32 `protobuf:"varint,9,opt,name=server_region" json:"server_region,omitempty"` - ServerLoadavg *float32 `protobuf:"fixed32,10,opt,name=server_loadavg" json:"server_loadavg,omitempty"` - ServerTrusted *bool `protobuf:"varint,11,opt,name=server_trusted" json:"server_trusted,omitempty"` - ServerDedicated *bool `protobuf:"varint,12,opt,name=server_dedicated" json:"server_dedicated,omitempty"` - Strict *uint32 `protobuf:"varint,17,opt,name=strict" json:"strict,omitempty"` - Players []*CMsgGameServerMatchmakingStatus_Player `protobuf:"bytes,13,rep,name=players" json:"players,omitempty"` - GameState *TF_GC_GameState `protobuf:"varint,14,opt,name=game_state,enum=TF_GC_GameState,def=0" json:"game_state,omitempty"` - Event *CMsgGameServerMatchmakingStatus_Event `protobuf:"varint,15,opt,name=event,enum=CMsgGameServerMatchmakingStatus_Event,def=0" json:"event,omitempty"` - MvmWave *uint32 `protobuf:"varint,18,opt,name=mvm_wave" json:"mvm_wave,omitempty"` - MvmCreditsAcquired *uint32 `protobuf:"varint,19,opt,name=mvm_credits_acquired" json:"mvm_credits_acquired,omitempty"` - MvmCreditsDropped *uint32 `protobuf:"varint,20,opt,name=mvm_credits_dropped" json:"mvm_credits_dropped,omitempty"` - SkillratingForceAverage *uint32 `protobuf:"varint,21,opt,name=skillrating_force_average" json:"skillrating_force_average,omitempty"` - LadderGameType *uint32 `protobuf:"varint,22,opt,name=ladder_game_type" json:"ladder_game_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGameServerMatchmakingStatus) Reset() { *m = CMsgGameServerMatchmakingStatus{} } -func (m *CMsgGameServerMatchmakingStatus) String() string { return proto.CompactTextString(m) } -func (*CMsgGameServerMatchmakingStatus) ProtoMessage() {} -func (*CMsgGameServerMatchmakingStatus) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{83} -} - -const Default_CMsgGameServerMatchmakingStatus_ServerVersion uint32 = 1225 -const Default_CMsgGameServerMatchmakingStatus_MatchmakingState ServerMatchmakingState = ServerMatchmakingState_ServerMatchmakingState_INVALID -const Default_CMsgGameServerMatchmakingStatus_MatchmakingMode TF_MatchmakingMode = TF_MatchmakingMode_TF_Matchmaking_INVALID -const Default_CMsgGameServerMatchmakingStatus_GameState TF_GC_GameState = TF_GC_GameState_TF_GC_GAMESTATE_STATE_INIT -const Default_CMsgGameServerMatchmakingStatus_Event CMsgGameServerMatchmakingStatus_Event = CMsgGameServerMatchmakingStatus_None - -func (m *CMsgGameServerMatchmakingStatus) GetServerVersion() uint32 { - if m != nil && m.ServerVersion != nil { - return *m.ServerVersion - } - return Default_CMsgGameServerMatchmakingStatus_ServerVersion -} - -func (m *CMsgGameServerMatchmakingStatus) GetMatchmakingState() ServerMatchmakingState { - if m != nil && m.MatchmakingState != nil { - return *m.MatchmakingState - } - return Default_CMsgGameServerMatchmakingStatus_MatchmakingState -} - -func (m *CMsgGameServerMatchmakingStatus) GetMatchmakingMode() TF_MatchmakingMode { - if m != nil && m.MatchmakingMode != nil { - return *m.MatchmakingMode - } - return Default_CMsgGameServerMatchmakingStatus_MatchmakingMode -} - -func (m *CMsgGameServerMatchmakingStatus) GetMap() string { - if m != nil && m.Map != nil { - return *m.Map - } - return "" -} - -func (m *CMsgGameServerMatchmakingStatus) GetTags() string { - if m != nil && m.Tags != nil { - return *m.Tags - } - return "" -} - -func (m *CMsgGameServerMatchmakingStatus) GetBotCount() uint32 { - if m != nil && m.BotCount != nil { - return *m.BotCount - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetNumSpectators() uint32 { - if m != nil && m.NumSpectators != nil { - return *m.NumSpectators - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetMaxPlayers() uint32 { - if m != nil && m.MaxPlayers != nil { - return *m.MaxPlayers - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetSlotsFree() uint32 { - if m != nil && m.SlotsFree != nil { - return *m.SlotsFree - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetServerRegion() uint32 { - if m != nil && m.ServerRegion != nil { - return *m.ServerRegion - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetServerLoadavg() float32 { - if m != nil && m.ServerLoadavg != nil { - return *m.ServerLoadavg - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetServerTrusted() bool { - if m != nil && m.ServerTrusted != nil { - return *m.ServerTrusted - } - return false -} - -func (m *CMsgGameServerMatchmakingStatus) GetServerDedicated() bool { - if m != nil && m.ServerDedicated != nil { - return *m.ServerDedicated - } - return false -} - -func (m *CMsgGameServerMatchmakingStatus) GetStrict() uint32 { - if m != nil && m.Strict != nil { - return *m.Strict - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetPlayers() []*CMsgGameServerMatchmakingStatus_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgGameServerMatchmakingStatus) GetGameState() TF_GC_GameState { - if m != nil && m.GameState != nil { - return *m.GameState - } - return Default_CMsgGameServerMatchmakingStatus_GameState -} - -func (m *CMsgGameServerMatchmakingStatus) GetEvent() CMsgGameServerMatchmakingStatus_Event { - if m != nil && m.Event != nil { - return *m.Event - } - return Default_CMsgGameServerMatchmakingStatus_Event -} - -func (m *CMsgGameServerMatchmakingStatus) GetMvmWave() uint32 { - if m != nil && m.MvmWave != nil { - return *m.MvmWave - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetMvmCreditsAcquired() uint32 { - if m != nil && m.MvmCreditsAcquired != nil { - return *m.MvmCreditsAcquired - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetMvmCreditsDropped() uint32 { - if m != nil && m.MvmCreditsDropped != nil { - return *m.MvmCreditsDropped - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetSkillratingForceAverage() uint32 { - if m != nil && m.SkillratingForceAverage != nil { - return *m.SkillratingForceAverage - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus) GetLadderGameType() uint32 { - if m != nil && m.LadderGameType != nil { - return *m.LadderGameType - } - return 0 -} - -type CMsgGameServerMatchmakingStatus_Player struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - ConnectState *CMsgGameServerMatchmakingStatus_PlayerConnectState `protobuf:"varint,2,opt,name=connect_state,enum=CMsgGameServerMatchmakingStatus_PlayerConnectState,def=0" json:"connect_state,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGameServerMatchmakingStatus_Player) Reset() { - *m = CMsgGameServerMatchmakingStatus_Player{} -} -func (m *CMsgGameServerMatchmakingStatus_Player) String() string { return proto.CompactTextString(m) } -func (*CMsgGameServerMatchmakingStatus_Player) ProtoMessage() {} -func (*CMsgGameServerMatchmakingStatus_Player) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{83, 0} -} - -const Default_CMsgGameServerMatchmakingStatus_Player_ConnectState CMsgGameServerMatchmakingStatus_PlayerConnectState = CMsgGameServerMatchmakingStatus_INVALID - -func (m *CMsgGameServerMatchmakingStatus_Player) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgGameServerMatchmakingStatus_Player) GetConnectState() CMsgGameServerMatchmakingStatus_PlayerConnectState { - if m != nil && m.ConnectState != nil { - return *m.ConnectState - } - return Default_CMsgGameServerMatchmakingStatus_Player_ConnectState -} - -type CMsgMatchmakingProgress struct { - AvgWaitTimeNew *uint32 `protobuf:"varint,4,opt,name=avg_wait_time_new" json:"avg_wait_time_new,omitempty"` - AvgWaitTimeJoinLate *uint32 `protobuf:"varint,5,opt,name=avg_wait_time_join_late" json:"avg_wait_time_join_late,omitempty"` - YourWaitTime *uint32 `protobuf:"varint,6,opt,name=your_wait_time" json:"your_wait_time,omitempty"` - MatchingWorldwideSearchingPlayers *uint32 `protobuf:"varint,8,opt,name=matching_worldwide_searching_players" json:"matching_worldwide_searching_players,omitempty"` - MatchingNearYouSearchingPlayers *uint32 `protobuf:"varint,9,opt,name=matching_near_you_searching_players" json:"matching_near_you_searching_players,omitempty"` - TotalWorldwideSearchingPlayers *uint32 `protobuf:"varint,13,opt,name=total_worldwide_searching_players" json:"total_worldwide_searching_players,omitempty"` - TotalNearYouSearchingPlayers *uint32 `protobuf:"varint,14,opt,name=total_near_you_searching_players" json:"total_near_you_searching_players,omitempty"` - MatchingWorldwideActivePlayers *uint32 `protobuf:"varint,15,opt,name=matching_worldwide_active_players" json:"matching_worldwide_active_players,omitempty"` - MatchingNearYouActivePlayers *uint32 `protobuf:"varint,16,opt,name=matching_near_you_active_players" json:"matching_near_you_active_players,omitempty"` - TotalWorldwideActivePlayers *uint32 `protobuf:"varint,17,opt,name=total_worldwide_active_players" json:"total_worldwide_active_players,omitempty"` - TotalNearYouActivePlayers *uint32 `protobuf:"varint,18,opt,name=total_near_you_active_players" json:"total_near_you_active_players,omitempty"` - MatchingWorldwideEmptyGameservers *uint32 `protobuf:"varint,19,opt,name=matching_worldwide_empty_gameservers" json:"matching_worldwide_empty_gameservers,omitempty"` - MatchingNearYouEmptyGameservers *uint32 `protobuf:"varint,20,opt,name=matching_near_you_empty_gameservers" json:"matching_near_you_empty_gameservers,omitempty"` - TotalWorldwideEmptyGameservers *uint32 `protobuf:"varint,21,opt,name=total_worldwide_empty_gameservers" json:"total_worldwide_empty_gameservers,omitempty"` - TotalNearYouEmptyGameservers *uint32 `protobuf:"varint,22,opt,name=total_near_you_empty_gameservers" json:"total_near_you_empty_gameservers,omitempty"` - UrgencyPct *uint32 `protobuf:"varint,1,opt,name=urgency_pct" json:"urgency_pct,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMatchmakingProgress) Reset() { *m = CMsgMatchmakingProgress{} } -func (m *CMsgMatchmakingProgress) String() string { return proto.CompactTextString(m) } -func (*CMsgMatchmakingProgress) ProtoMessage() {} -func (*CMsgMatchmakingProgress) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{84} } - -func (m *CMsgMatchmakingProgress) GetAvgWaitTimeNew() uint32 { - if m != nil && m.AvgWaitTimeNew != nil { - return *m.AvgWaitTimeNew - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetAvgWaitTimeJoinLate() uint32 { - if m != nil && m.AvgWaitTimeJoinLate != nil { - return *m.AvgWaitTimeJoinLate - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetYourWaitTime() uint32 { - if m != nil && m.YourWaitTime != nil { - return *m.YourWaitTime - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetMatchingWorldwideSearchingPlayers() uint32 { - if m != nil && m.MatchingWorldwideSearchingPlayers != nil { - return *m.MatchingWorldwideSearchingPlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetMatchingNearYouSearchingPlayers() uint32 { - if m != nil && m.MatchingNearYouSearchingPlayers != nil { - return *m.MatchingNearYouSearchingPlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetTotalWorldwideSearchingPlayers() uint32 { - if m != nil && m.TotalWorldwideSearchingPlayers != nil { - return *m.TotalWorldwideSearchingPlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetTotalNearYouSearchingPlayers() uint32 { - if m != nil && m.TotalNearYouSearchingPlayers != nil { - return *m.TotalNearYouSearchingPlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetMatchingWorldwideActivePlayers() uint32 { - if m != nil && m.MatchingWorldwideActivePlayers != nil { - return *m.MatchingWorldwideActivePlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetMatchingNearYouActivePlayers() uint32 { - if m != nil && m.MatchingNearYouActivePlayers != nil { - return *m.MatchingNearYouActivePlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetTotalWorldwideActivePlayers() uint32 { - if m != nil && m.TotalWorldwideActivePlayers != nil { - return *m.TotalWorldwideActivePlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetTotalNearYouActivePlayers() uint32 { - if m != nil && m.TotalNearYouActivePlayers != nil { - return *m.TotalNearYouActivePlayers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetMatchingWorldwideEmptyGameservers() uint32 { - if m != nil && m.MatchingWorldwideEmptyGameservers != nil { - return *m.MatchingWorldwideEmptyGameservers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetMatchingNearYouEmptyGameservers() uint32 { - if m != nil && m.MatchingNearYouEmptyGameservers != nil { - return *m.MatchingNearYouEmptyGameservers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetTotalWorldwideEmptyGameservers() uint32 { - if m != nil && m.TotalWorldwideEmptyGameservers != nil { - return *m.TotalWorldwideEmptyGameservers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetTotalNearYouEmptyGameservers() uint32 { - if m != nil && m.TotalNearYouEmptyGameservers != nil { - return *m.TotalNearYouEmptyGameservers - } - return 0 -} - -func (m *CMsgMatchmakingProgress) GetUrgencyPct() uint32 { - if m != nil && m.UrgencyPct != nil { - return *m.UrgencyPct - } - return 0 -} - -type CMsgMvMVictoryInfo struct { - Players []*CMsgMvMVictoryInfo_Player `protobuf:"bytes,1,rep,name=players" json:"players,omitempty"` - TourName *string `protobuf:"bytes,2,opt,name=tour_name" json:"tour_name,omitempty"` - MissionName *string `protobuf:"bytes,3,opt,name=mission_name" json:"mission_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMvMVictoryInfo) Reset() { *m = CMsgMvMVictoryInfo{} } -func (m *CMsgMvMVictoryInfo) String() string { return proto.CompactTextString(m) } -func (*CMsgMvMVictoryInfo) ProtoMessage() {} -func (*CMsgMvMVictoryInfo) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{85} } - -func (m *CMsgMvMVictoryInfo) GetPlayers() []*CMsgMvMVictoryInfo_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgMvMVictoryInfo) GetTourName() string { - if m != nil && m.TourName != nil { - return *m.TourName - } - return "" -} - -func (m *CMsgMvMVictoryInfo) GetMissionName() string { - if m != nil && m.MissionName != nil { - return *m.MissionName - } - return "" -} - -type CMsgMvMVictoryInfo_Item struct { - GrantReason *CMsgMvMVictoryInfo_GrantReason `protobuf:"varint,1,opt,name=grant_reason,enum=CMsgMvMVictoryInfo_GrantReason,def=0" json:"grant_reason,omitempty"` - ItemData []byte `protobuf:"bytes,2,opt,name=item_data" json:"item_data,omitempty"` - SquadSurplusClaimerSteamId *uint64 `protobuf:"fixed64,3,opt,name=squad_surplus_claimer_steam_id" json:"squad_surplus_claimer_steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMvMVictoryInfo_Item) Reset() { *m = CMsgMvMVictoryInfo_Item{} } -func (m *CMsgMvMVictoryInfo_Item) String() string { return proto.CompactTextString(m) } -func (*CMsgMvMVictoryInfo_Item) ProtoMessage() {} -func (*CMsgMvMVictoryInfo_Item) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{85, 0} } - -const Default_CMsgMvMVictoryInfo_Item_GrantReason CMsgMvMVictoryInfo_GrantReason = CMsgMvMVictoryInfo_INVALID - -func (m *CMsgMvMVictoryInfo_Item) GetGrantReason() CMsgMvMVictoryInfo_GrantReason { - if m != nil && m.GrantReason != nil { - return *m.GrantReason - } - return Default_CMsgMvMVictoryInfo_Item_GrantReason -} - -func (m *CMsgMvMVictoryInfo_Item) GetItemData() []byte { - if m != nil { - return m.ItemData - } - return nil -} - -func (m *CMsgMvMVictoryInfo_Item) GetSquadSurplusClaimerSteamId() uint64 { - if m != nil && m.SquadSurplusClaimerSteamId != nil { - return *m.SquadSurplusClaimerSteamId - } - return 0 -} - -type CMsgMvMVictoryInfo_Player struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - BadgeGranted *bool `protobuf:"varint,3,opt,name=badge_granted" json:"badge_granted,omitempty"` - BadgeProgressUpdated *bool `protobuf:"varint,4,opt,name=badge_progress_updated" json:"badge_progress_updated,omitempty"` - BadgeLeveled *bool `protobuf:"varint,5,opt,name=badge_leveled" json:"badge_leveled,omitempty"` - BadgeLevel *uint32 `protobuf:"varint,6,opt,name=badge_level" json:"badge_level,omitempty"` - BadgeProgressBits *uint32 `protobuf:"varint,7,opt,name=badge_progress_bits" json:"badge_progress_bits,omitempty"` - Items []*CMsgMvMVictoryInfo_Item `protobuf:"bytes,8,rep,name=items" json:"items,omitempty"` - VoucherMissing *bool `protobuf:"varint,9,opt,name=voucher_missing" json:"voucher_missing,omitempty"` - BadgePoints *uint32 `protobuf:"varint,10,opt,name=badge_points" json:"badge_points,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMvMVictoryInfo_Player) Reset() { *m = CMsgMvMVictoryInfo_Player{} } -func (m *CMsgMvMVictoryInfo_Player) String() string { return proto.CompactTextString(m) } -func (*CMsgMvMVictoryInfo_Player) ProtoMessage() {} -func (*CMsgMvMVictoryInfo_Player) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{85, 1} } - -func (m *CMsgMvMVictoryInfo_Player) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgMvMVictoryInfo_Player) GetBadgeGranted() bool { - if m != nil && m.BadgeGranted != nil { - return *m.BadgeGranted - } - return false -} - -func (m *CMsgMvMVictoryInfo_Player) GetBadgeProgressUpdated() bool { - if m != nil && m.BadgeProgressUpdated != nil { - return *m.BadgeProgressUpdated - } - return false -} - -func (m *CMsgMvMVictoryInfo_Player) GetBadgeLeveled() bool { - if m != nil && m.BadgeLeveled != nil { - return *m.BadgeLeveled - } - return false -} - -func (m *CMsgMvMVictoryInfo_Player) GetBadgeLevel() uint32 { - if m != nil && m.BadgeLevel != nil { - return *m.BadgeLevel - } - return 0 -} - -func (m *CMsgMvMVictoryInfo_Player) GetBadgeProgressBits() uint32 { - if m != nil && m.BadgeProgressBits != nil { - return *m.BadgeProgressBits - } - return 0 -} - -func (m *CMsgMvMVictoryInfo_Player) GetItems() []*CMsgMvMVictoryInfo_Item { - if m != nil { - return m.Items - } - return nil -} - -func (m *CMsgMvMVictoryInfo_Player) GetVoucherMissing() bool { - if m != nil && m.VoucherMissing != nil { - return *m.VoucherMissing - } - return false -} - -func (m *CMsgMvMVictoryInfo_Player) GetBadgePoints() uint32 { - if m != nil && m.BadgePoints != nil { - return *m.BadgePoints - } - return 0 -} - -type CGCMsgTFHelloResponse struct { - VersionCheck *uint32 `protobuf:"varint,1,opt,name=version_check" json:"version_check,omitempty"` - VersionChecksum []uint64 `protobuf:"varint,2,rep,name=version_checksum" json:"version_checksum,omitempty"` - VersionVerbose *uint32 `protobuf:"varint,3,opt,name=version_verbose" json:"version_verbose,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgTFHelloResponse) Reset() { *m = CGCMsgTFHelloResponse{} } -func (m *CGCMsgTFHelloResponse) String() string { return proto.CompactTextString(m) } -func (*CGCMsgTFHelloResponse) ProtoMessage() {} -func (*CGCMsgTFHelloResponse) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{86} } - -func (m *CGCMsgTFHelloResponse) GetVersionCheck() uint32 { - if m != nil && m.VersionCheck != nil { - return *m.VersionCheck - } - return 0 -} - -func (m *CGCMsgTFHelloResponse) GetVersionChecksum() []uint64 { - if m != nil { - return m.VersionChecksum - } - return nil -} - -func (m *CGCMsgTFHelloResponse) GetVersionVerbose() uint32 { - if m != nil && m.VersionVerbose != nil { - return *m.VersionVerbose - } - return 0 -} - -type CGCMsgTFSync struct { - VersionChecksum []byte `protobuf:"bytes,1,opt,name=version_checksum" json:"version_checksum,omitempty"` - VersionCheck *uint32 `protobuf:"varint,2,opt,name=version_check" json:"version_check,omitempty"` - VersionCheckEx *uint32 `protobuf:"varint,3,opt,name=version_check_ex" json:"version_check_ex,omitempty"` - VersionCheckEx2 *uint32 `protobuf:"varint,4,opt,name=version_check_ex2" json:"version_check_ex2,omitempty"` - VersionChecksumEx []byte `protobuf:"bytes,5,opt,name=version_checksum_ex" json:"version_checksum_ex,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgTFSync) Reset() { *m = CGCMsgTFSync{} } -func (m *CGCMsgTFSync) String() string { return proto.CompactTextString(m) } -func (*CGCMsgTFSync) ProtoMessage() {} -func (*CGCMsgTFSync) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{87} } - -func (m *CGCMsgTFSync) GetVersionChecksum() []byte { - if m != nil { - return m.VersionChecksum - } - return nil -} - -func (m *CGCMsgTFSync) GetVersionCheck() uint32 { - if m != nil && m.VersionCheck != nil { - return *m.VersionCheck - } - return 0 -} - -func (m *CGCMsgTFSync) GetVersionCheckEx() uint32 { - if m != nil && m.VersionCheckEx != nil { - return *m.VersionCheckEx - } - return 0 -} - -func (m *CGCMsgTFSync) GetVersionCheckEx2() uint32 { - if m != nil && m.VersionCheckEx2 != nil { - return *m.VersionCheckEx2 - } - return 0 -} - -func (m *CGCMsgTFSync) GetVersionChecksumEx() []byte { - if m != nil { - return m.VersionChecksumEx - } - return nil -} - -type CGCMsgTFSyncEx struct { - VersionChecksum *string `protobuf:"bytes,1,opt,name=version_checksum" json:"version_checksum,omitempty"` - VersionChecksumEx []byte `protobuf:"bytes,2,opt,name=version_checksum_ex" json:"version_checksum_ex,omitempty"` - VersionCheck *uint32 `protobuf:"varint,3,opt,name=version_check" json:"version_check,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgTFSyncEx) Reset() { *m = CGCMsgTFSyncEx{} } -func (m *CGCMsgTFSyncEx) String() string { return proto.CompactTextString(m) } -func (*CGCMsgTFSyncEx) ProtoMessage() {} -func (*CGCMsgTFSyncEx) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{88} } - -func (m *CGCMsgTFSyncEx) GetVersionChecksum() string { - if m != nil && m.VersionChecksum != nil { - return *m.VersionChecksum - } - return "" -} - -func (m *CGCMsgTFSyncEx) GetVersionChecksumEx() []byte { - if m != nil { - return m.VersionChecksumEx - } - return nil -} - -func (m *CGCMsgTFSyncEx) GetVersionCheck() uint32 { - if m != nil && m.VersionCheck != nil { - return *m.VersionCheck - } - return 0 -} - -type CMsgMvMVictory struct { - LegacyMissionIndex *uint32 `protobuf:"varint,1,opt,name=legacy_mission_index" json:"legacy_mission_index,omitempty"` - TourNameMannup *string `protobuf:"bytes,5,opt,name=tour_name_mannup" json:"tour_name_mannup,omitempty"` - MissionName *string `protobuf:"bytes,6,opt,name=mission_name" json:"mission_name,omitempty"` - Players []*CMsgMvMVictory_Player `protobuf:"bytes,2,rep,name=players" json:"players,omitempty"` - LobbyId *uint64 `protobuf:"varint,3,opt,name=lobby_id" json:"lobby_id,omitempty"` - EventTime *uint32 `protobuf:"fixed32,4,opt,name=event_time" json:"event_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMvMVictory) Reset() { *m = CMsgMvMVictory{} } -func (m *CMsgMvMVictory) String() string { return proto.CompactTextString(m) } -func (*CMsgMvMVictory) ProtoMessage() {} -func (*CMsgMvMVictory) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{89} } - -func (m *CMsgMvMVictory) GetLegacyMissionIndex() uint32 { - if m != nil && m.LegacyMissionIndex != nil { - return *m.LegacyMissionIndex - } - return 0 -} - -func (m *CMsgMvMVictory) GetTourNameMannup() string { - if m != nil && m.TourNameMannup != nil { - return *m.TourNameMannup - } - return "" -} - -func (m *CMsgMvMVictory) GetMissionName() string { - if m != nil && m.MissionName != nil { - return *m.MissionName - } - return "" -} - -func (m *CMsgMvMVictory) GetPlayers() []*CMsgMvMVictory_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgMvMVictory) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -func (m *CMsgMvMVictory) GetEventTime() uint32 { - if m != nil && m.EventTime != nil { - return *m.EventTime - } - return 0 -} - -type CMsgMvMVictory_Player struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - SquadSurplus *bool `protobuf:"varint,2,opt,name=squad_surplus" json:"squad_surplus,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMvMVictory_Player) Reset() { *m = CMsgMvMVictory_Player{} } -func (m *CMsgMvMVictory_Player) String() string { return proto.CompactTextString(m) } -func (*CMsgMvMVictory_Player) ProtoMessage() {} -func (*CMsgMvMVictory_Player) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{89, 0} } - -func (m *CMsgMvMVictory_Player) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgMvMVictory_Player) GetSquadSurplus() bool { - if m != nil && m.SquadSurplus != nil { - return *m.SquadSurplus - } - return false -} - -type CMsgMvMMannUpVictoryReply struct { - Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgMvMMannUpVictoryReply) Reset() { *m = CMsgMvMMannUpVictoryReply{} } -func (m *CMsgMvMMannUpVictoryReply) String() string { return proto.CompactTextString(m) } -func (*CMsgMvMMannUpVictoryReply) ProtoMessage() {} -func (*CMsgMvMMannUpVictoryReply) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{90} } - -func (m *CMsgMvMMannUpVictoryReply) GetResult() uint32 { - if m != nil && m.Result != nil { - return *m.Result - } - return 0 -} - -type CMsgGameServerKickingLobby struct { - ConnectedPlayers []uint64 `protobuf:"fixed64,1,rep,name=connected_players" json:"connected_players,omitempty"` - CreateParty *bool `protobuf:"varint,2,opt,name=create_party,def=1" json:"create_party,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGameServerKickingLobby) Reset() { *m = CMsgGameServerKickingLobby{} } -func (m *CMsgGameServerKickingLobby) String() string { return proto.CompactTextString(m) } -func (*CMsgGameServerKickingLobby) ProtoMessage() {} -func (*CMsgGameServerKickingLobby) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{91} } - -const Default_CMsgGameServerKickingLobby_CreateParty bool = true - -func (m *CMsgGameServerKickingLobby) GetConnectedPlayers() []uint64 { - if m != nil { - return m.ConnectedPlayers - } - return nil -} - -func (m *CMsgGameServerKickingLobby) GetCreateParty() bool { - if m != nil && m.CreateParty != nil { - return *m.CreateParty - } - return Default_CMsgGameServerKickingLobby_CreateParty -} - -type CMsgLeaveGameAndPrepareToJoinParty struct { - PartyId *uint64 `protobuf:"fixed64,1,opt,name=party_id" json:"party_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgLeaveGameAndPrepareToJoinParty) Reset() { *m = CMsgLeaveGameAndPrepareToJoinParty{} } -func (m *CMsgLeaveGameAndPrepareToJoinParty) String() string { return proto.CompactTextString(m) } -func (*CMsgLeaveGameAndPrepareToJoinParty) ProtoMessage() {} -func (*CMsgLeaveGameAndPrepareToJoinParty) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{92} -} - -func (m *CMsgLeaveGameAndPrepareToJoinParty) GetPartyId() uint64 { - if m != nil && m.PartyId != nil { - return *m.PartyId - } - return 0 -} - -type CMsgRemovePlayerFromLobby struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - RemoveReason *CMsgRemovePlayerFromLobby_RemoveReason `protobuf:"varint,2,opt,name=remove_reason,enum=CMsgRemovePlayerFromLobby_RemoveReason,def=0" json:"remove_reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgRemovePlayerFromLobby) Reset() { *m = CMsgRemovePlayerFromLobby{} } -func (m *CMsgRemovePlayerFromLobby) String() string { return proto.CompactTextString(m) } -func (*CMsgRemovePlayerFromLobby) ProtoMessage() {} -func (*CMsgRemovePlayerFromLobby) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{93} } - -const Default_CMsgRemovePlayerFromLobby_RemoveReason CMsgRemovePlayerFromLobby_RemoveReason = CMsgRemovePlayerFromLobby_VOTE_KICK - -func (m *CMsgRemovePlayerFromLobby) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgRemovePlayerFromLobby) GetRemoveReason() CMsgRemovePlayerFromLobby_RemoveReason { - if m != nil && m.RemoveReason != nil { - return *m.RemoveReason - } - return Default_CMsgRemovePlayerFromLobby_RemoveReason -} - -type CMsgSetLobbySafeToLeave struct { - LobbyId *uint64 `protobuf:"fixed64,1,opt,name=lobby_id" json:"lobby_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetLobbySafeToLeave) Reset() { *m = CMsgSetLobbySafeToLeave{} } -func (m *CMsgSetLobbySafeToLeave) String() string { return proto.CompactTextString(m) } -func (*CMsgSetLobbySafeToLeave) ProtoMessage() {} -func (*CMsgSetLobbySafeToLeave) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{94} } - -func (m *CMsgSetLobbySafeToLeave) GetLobbyId() uint64 { - if m != nil && m.LobbyId != nil { - return *m.LobbyId - } - return 0 -} - -type CMsgHalloween_ServerBossEvent struct { - EventCounter *uint32 `protobuf:"varint,1,opt,name=event_counter" json:"event_counter,omitempty"` - Timestamp *uint32 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - BossType *uint32 `protobuf:"varint,3,opt,name=boss_type" json:"boss_type,omitempty"` - BossLevel *uint32 `protobuf:"varint,4,opt,name=boss_level" json:"boss_level,omitempty"` - EventType *uint32 `protobuf:"varint,5,opt,name=event_type" json:"event_type,omitempty"` - PlayersInvolved *uint32 `protobuf:"varint,6,opt,name=players_involved" json:"players_involved,omitempty"` - ElapsedTime *float32 `protobuf:"fixed32,7,opt,name=elapsed_time" json:"elapsed_time,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgHalloween_ServerBossEvent) Reset() { *m = CMsgHalloween_ServerBossEvent{} } -func (m *CMsgHalloween_ServerBossEvent) String() string { return proto.CompactTextString(m) } -func (*CMsgHalloween_ServerBossEvent) ProtoMessage() {} -func (*CMsgHalloween_ServerBossEvent) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{95} } - -func (m *CMsgHalloween_ServerBossEvent) GetEventCounter() uint32 { - if m != nil && m.EventCounter != nil { - return *m.EventCounter - } - return 0 -} - -func (m *CMsgHalloween_ServerBossEvent) GetTimestamp() uint32 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *CMsgHalloween_ServerBossEvent) GetBossType() uint32 { - if m != nil && m.BossType != nil { - return *m.BossType - } - return 0 -} - -func (m *CMsgHalloween_ServerBossEvent) GetBossLevel() uint32 { - if m != nil && m.BossLevel != nil { - return *m.BossLevel - } - return 0 -} - -func (m *CMsgHalloween_ServerBossEvent) GetEventType() uint32 { - if m != nil && m.EventType != nil { - return *m.EventType - } - return 0 -} - -func (m *CMsgHalloween_ServerBossEvent) GetPlayersInvolved() uint32 { - if m != nil && m.PlayersInvolved != nil { - return *m.PlayersInvolved - } - return 0 -} - -func (m *CMsgHalloween_ServerBossEvent) GetElapsedTime() float32 { - if m != nil && m.ElapsedTime != nil { - return *m.ElapsedTime - } - return 0 -} - -type CMsgHalloween_Merasmus2012 struct { - EventCounter *uint32 `protobuf:"varint,1,opt,name=event_counter" json:"event_counter,omitempty"` - TimeSubmitted *uint32 `protobuf:"fixed32,2,opt,name=time_submitted" json:"time_submitted,omitempty"` - IsValveServer *bool `protobuf:"varint,3,opt,name=is_valve_server" json:"is_valve_server,omitempty"` - BossLevel *uint32 `protobuf:"varint,4,opt,name=boss_level" json:"boss_level,omitempty"` - SpawnedHealth *uint32 `protobuf:"varint,5,opt,name=spawned_health" json:"spawned_health,omitempty"` - RemainingHealth *uint32 `protobuf:"varint,6,opt,name=remaining_health" json:"remaining_health,omitempty"` - LifeTime *uint32 `protobuf:"varint,7,opt,name=life_time" json:"life_time,omitempty"` - BombKills *uint32 `protobuf:"varint,8,opt,name=bomb_kills" json:"bomb_kills,omitempty"` - StaffKills *uint32 `protobuf:"varint,9,opt,name=staff_kills" json:"staff_kills,omitempty"` - PvpKills *uint32 `protobuf:"varint,10,opt,name=pvp_kills" json:"pvp_kills,omitempty"` - ProphuntTime1 *uint32 `protobuf:"varint,11,opt,name=prophunt_time1" json:"prophunt_time1,omitempty"` - ProphuntTime2 *uint32 `protobuf:"varint,12,opt,name=prophunt_time2" json:"prophunt_time2,omitempty"` - DmgScout *uint32 `protobuf:"varint,13,opt,name=dmg_scout" json:"dmg_scout,omitempty"` - DmgSniper *uint32 `protobuf:"varint,14,opt,name=dmg_sniper" json:"dmg_sniper,omitempty"` - DmgSoldier *uint32 `protobuf:"varint,15,opt,name=dmg_soldier" json:"dmg_soldier,omitempty"` - DmgDemo *uint32 `protobuf:"varint,16,opt,name=dmg_demo" json:"dmg_demo,omitempty"` - DmgMedic *uint32 `protobuf:"varint,17,opt,name=dmg_medic" json:"dmg_medic,omitempty"` - DmgHeavy *uint32 `protobuf:"varint,18,opt,name=dmg_heavy" json:"dmg_heavy,omitempty"` - DmgPyro *uint32 `protobuf:"varint,19,opt,name=dmg_pyro" json:"dmg_pyro,omitempty"` - DmgSpy *uint32 `protobuf:"varint,20,opt,name=dmg_spy" json:"dmg_spy,omitempty"` - DmgEngineer *uint32 `protobuf:"varint,21,opt,name=dmg_engineer" json:"dmg_engineer,omitempty"` - ScoutCount *uint32 `protobuf:"varint,22,opt,name=scout_count" json:"scout_count,omitempty"` - SniperCount *uint32 `protobuf:"varint,23,opt,name=sniper_count" json:"sniper_count,omitempty"` - SoliderCount *uint32 `protobuf:"varint,24,opt,name=solider_count" json:"solider_count,omitempty"` - DemoCount *uint32 `protobuf:"varint,25,opt,name=demo_count" json:"demo_count,omitempty"` - MedicCount *uint32 `protobuf:"varint,26,opt,name=medic_count" json:"medic_count,omitempty"` - HeavyCount *uint32 `protobuf:"varint,27,opt,name=heavy_count" json:"heavy_count,omitempty"` - PyroCount *uint32 `protobuf:"varint,28,opt,name=pyro_count" json:"pyro_count,omitempty"` - SpyCount *uint32 `protobuf:"varint,29,opt,name=spy_count" json:"spy_count,omitempty"` - EngineerCount *uint32 `protobuf:"varint,30,opt,name=engineer_count" json:"engineer_count,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgHalloween_Merasmus2012) Reset() { *m = CMsgHalloween_Merasmus2012{} } -func (m *CMsgHalloween_Merasmus2012) String() string { return proto.CompactTextString(m) } -func (*CMsgHalloween_Merasmus2012) ProtoMessage() {} -func (*CMsgHalloween_Merasmus2012) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{96} } - -func (m *CMsgHalloween_Merasmus2012) GetEventCounter() uint32 { - if m != nil && m.EventCounter != nil { - return *m.EventCounter - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetTimeSubmitted() uint32 { - if m != nil && m.TimeSubmitted != nil { - return *m.TimeSubmitted - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetIsValveServer() bool { - if m != nil && m.IsValveServer != nil { - return *m.IsValveServer - } - return false -} - -func (m *CMsgHalloween_Merasmus2012) GetBossLevel() uint32 { - if m != nil && m.BossLevel != nil { - return *m.BossLevel - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetSpawnedHealth() uint32 { - if m != nil && m.SpawnedHealth != nil { - return *m.SpawnedHealth - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetRemainingHealth() uint32 { - if m != nil && m.RemainingHealth != nil { - return *m.RemainingHealth - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetLifeTime() uint32 { - if m != nil && m.LifeTime != nil { - return *m.LifeTime - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetBombKills() uint32 { - if m != nil && m.BombKills != nil { - return *m.BombKills - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetStaffKills() uint32 { - if m != nil && m.StaffKills != nil { - return *m.StaffKills - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetPvpKills() uint32 { - if m != nil && m.PvpKills != nil { - return *m.PvpKills - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetProphuntTime1() uint32 { - if m != nil && m.ProphuntTime1 != nil { - return *m.ProphuntTime1 - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetProphuntTime2() uint32 { - if m != nil && m.ProphuntTime2 != nil { - return *m.ProphuntTime2 - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgScout() uint32 { - if m != nil && m.DmgScout != nil { - return *m.DmgScout - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgSniper() uint32 { - if m != nil && m.DmgSniper != nil { - return *m.DmgSniper - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgSoldier() uint32 { - if m != nil && m.DmgSoldier != nil { - return *m.DmgSoldier - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgDemo() uint32 { - if m != nil && m.DmgDemo != nil { - return *m.DmgDemo - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgMedic() uint32 { - if m != nil && m.DmgMedic != nil { - return *m.DmgMedic - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgHeavy() uint32 { - if m != nil && m.DmgHeavy != nil { - return *m.DmgHeavy - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgPyro() uint32 { - if m != nil && m.DmgPyro != nil { - return *m.DmgPyro - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgSpy() uint32 { - if m != nil && m.DmgSpy != nil { - return *m.DmgSpy - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDmgEngineer() uint32 { - if m != nil && m.DmgEngineer != nil { - return *m.DmgEngineer - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetScoutCount() uint32 { - if m != nil && m.ScoutCount != nil { - return *m.ScoutCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetSniperCount() uint32 { - if m != nil && m.SniperCount != nil { - return *m.SniperCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetSoliderCount() uint32 { - if m != nil && m.SoliderCount != nil { - return *m.SoliderCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetDemoCount() uint32 { - if m != nil && m.DemoCount != nil { - return *m.DemoCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetMedicCount() uint32 { - if m != nil && m.MedicCount != nil { - return *m.MedicCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetHeavyCount() uint32 { - if m != nil && m.HeavyCount != nil { - return *m.HeavyCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetPyroCount() uint32 { - if m != nil && m.PyroCount != nil { - return *m.PyroCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetSpyCount() uint32 { - if m != nil && m.SpyCount != nil { - return *m.SpyCount - } - return 0 -} - -func (m *CMsgHalloween_Merasmus2012) GetEngineerCount() uint32 { - if m != nil && m.EngineerCount != nil { - return *m.EngineerCount - } - return 0 -} - -type CMsgUpdateHalloweenMerasmusLootLevel struct { - Players []*CMsgUpdateHalloweenMerasmusLootLevel_Player `protobuf:"bytes,1,rep,name=players" json:"players,omitempty"` - MerasmusLevel *uint32 `protobuf:"varint,2,opt,name=merasmus_level" json:"merasmus_level,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpdateHalloweenMerasmusLootLevel) Reset() { *m = CMsgUpdateHalloweenMerasmusLootLevel{} } -func (m *CMsgUpdateHalloweenMerasmusLootLevel) String() string { return proto.CompactTextString(m) } -func (*CMsgUpdateHalloweenMerasmusLootLevel) ProtoMessage() {} -func (*CMsgUpdateHalloweenMerasmusLootLevel) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{97} -} - -func (m *CMsgUpdateHalloweenMerasmusLootLevel) GetPlayers() []*CMsgUpdateHalloweenMerasmusLootLevel_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgUpdateHalloweenMerasmusLootLevel) GetMerasmusLevel() uint32 { - if m != nil && m.MerasmusLevel != nil { - return *m.MerasmusLevel - } - return 0 -} - -type CMsgUpdateHalloweenMerasmusLootLevel_Player struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgUpdateHalloweenMerasmusLootLevel_Player) Reset() { - *m = CMsgUpdateHalloweenMerasmusLootLevel_Player{} -} -func (m *CMsgUpdateHalloweenMerasmusLootLevel_Player) String() string { - return proto.CompactTextString(m) -} -func (*CMsgUpdateHalloweenMerasmusLootLevel_Player) ProtoMessage() {} -func (*CMsgUpdateHalloweenMerasmusLootLevel_Player) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{97, 0} -} - -func (m *CMsgUpdateHalloweenMerasmusLootLevel_Player) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -type CAttribute_String struct { - Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_String) Reset() { *m = CAttribute_String{} } -func (m *CAttribute_String) String() string { return proto.CompactTextString(m) } -func (*CAttribute_String) ProtoMessage() {} -func (*CAttribute_String) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{98} } - -func (m *CAttribute_String) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type CAttribute_DynamicRecipeComponent struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - ItemQuality *uint32 `protobuf:"varint,2,opt,name=item_quality" json:"item_quality,omitempty"` - ComponentFlags *uint32 `protobuf:"varint,3,opt,name=component_flags" json:"component_flags,omitempty"` - AttributesString *string `protobuf:"bytes,4,opt,name=attributes_string" json:"attributes_string,omitempty"` - NumRequired *uint32 `protobuf:"varint,5,opt,name=num_required" json:"num_required,omitempty"` - NumFulfilled *uint32 `protobuf:"varint,6,opt,name=num_fulfilled" json:"num_fulfilled,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_DynamicRecipeComponent) Reset() { *m = CAttribute_DynamicRecipeComponent{} } -func (m *CAttribute_DynamicRecipeComponent) String() string { return proto.CompactTextString(m) } -func (*CAttribute_DynamicRecipeComponent) ProtoMessage() {} -func (*CAttribute_DynamicRecipeComponent) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{99} -} - -func (m *CAttribute_DynamicRecipeComponent) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent) GetItemQuality() uint32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent) GetComponentFlags() uint32 { - if m != nil && m.ComponentFlags != nil { - return *m.ComponentFlags - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent) GetAttributesString() string { - if m != nil && m.AttributesString != nil { - return *m.AttributesString - } - return "" -} - -func (m *CAttribute_DynamicRecipeComponent) GetNumRequired() uint32 { - if m != nil && m.NumRequired != nil { - return *m.NumRequired - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent) GetNumFulfilled() uint32 { - if m != nil && m.NumFulfilled != nil { - return *m.NumFulfilled - } - return 0 -} - -type CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT struct { - DefIndex *uint32 `protobuf:"varint,1,opt,name=def_index" json:"def_index,omitempty"` - ItemDef *uint32 `protobuf:"varint,2,opt,name=item_def" json:"item_def,omitempty"` - ItemQuality *uint32 `protobuf:"varint,3,opt,name=item_quality" json:"item_quality,omitempty"` - ComponentFlags *uint32 `protobuf:"varint,4,opt,name=component_flags" json:"component_flags,omitempty"` - ItemFlags *uint32 `protobuf:"varint,5,opt,name=item_flags" json:"item_flags,omitempty"` - AttributesString *string `protobuf:"bytes,6,opt,name=attributes_string" json:"attributes_string,omitempty"` - NumRequired *uint32 `protobuf:"varint,7,opt,name=num_required" json:"num_required,omitempty"` - ItemCount *uint32 `protobuf:"varint,8,opt,name=item_count" json:"item_count,omitempty"` - NumFulfilled *uint32 `protobuf:"varint,9,opt,name=num_fulfilled" json:"num_fulfilled,omitempty"` - ItemsFulfilled *uint32 `protobuf:"varint,10,opt,name=items_fulfilled" json:"items_fulfilled,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) Reset() { - *m = CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT{} -} -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) String() string { - return proto.CompactTextString(m) -} -func (*CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) ProtoMessage() {} -func (*CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{100} -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetDefIndex() uint32 { - if m != nil && m.DefIndex != nil { - return *m.DefIndex - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetItemDef() uint32 { - if m != nil && m.ItemDef != nil { - return *m.ItemDef - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetItemQuality() uint32 { - if m != nil && m.ItemQuality != nil { - return *m.ItemQuality - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetComponentFlags() uint32 { - if m != nil && m.ComponentFlags != nil { - return *m.ComponentFlags - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetItemFlags() uint32 { - if m != nil && m.ItemFlags != nil { - return *m.ItemFlags - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetAttributesString() string { - if m != nil && m.AttributesString != nil { - return *m.AttributesString - } - return "" -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetNumRequired() uint32 { - if m != nil && m.NumRequired != nil { - return *m.NumRequired - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetItemCount() uint32 { - if m != nil && m.ItemCount != nil { - return *m.ItemCount - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetNumFulfilled() uint32 { - if m != nil && m.NumFulfilled != nil { - return *m.NumFulfilled - } - return 0 -} - -func (m *CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT) GetItemsFulfilled() uint32 { - if m != nil && m.ItemsFulfilled != nil { - return *m.ItemsFulfilled - } - return 0 -} - -type CAttribute_ItemSlotCriteria struct { - Tags *string `protobuf:"bytes,1,opt,name=tags" json:"tags,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_ItemSlotCriteria) Reset() { *m = CAttribute_ItemSlotCriteria{} } -func (m *CAttribute_ItemSlotCriteria) String() string { return proto.CompactTextString(m) } -func (*CAttribute_ItemSlotCriteria) ProtoMessage() {} -func (*CAttribute_ItemSlotCriteria) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{101} } - -func (m *CAttribute_ItemSlotCriteria) GetTags() string { - if m != nil && m.Tags != nil { - return *m.Tags - } - return "" -} - -type CMsgSetItemSlotAttribute struct { - ItemId *uint64 `protobuf:"varint,1,opt,name=item_id" json:"item_id,omitempty"` - SlotItemOriginalId *uint64 `protobuf:"varint,2,opt,name=slot_item_original_id" json:"slot_item_original_id,omitempty"` - SlotIndex *uint32 `protobuf:"varint,3,opt,name=slot_index" json:"slot_index,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgSetItemSlotAttribute) Reset() { *m = CMsgSetItemSlotAttribute{} } -func (m *CMsgSetItemSlotAttribute) String() string { return proto.CompactTextString(m) } -func (*CMsgSetItemSlotAttribute) ProtoMessage() {} -func (*CMsgSetItemSlotAttribute) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{102} } - -func (m *CMsgSetItemSlotAttribute) GetItemId() uint64 { - if m != nil && m.ItemId != nil { - return *m.ItemId - } - return 0 -} - -func (m *CMsgSetItemSlotAttribute) GetSlotItemOriginalId() uint64 { - if m != nil && m.SlotItemOriginalId != nil { - return *m.SlotItemOriginalId - } - return 0 -} - -func (m *CMsgSetItemSlotAttribute) GetSlotIndex() uint32 { - if m != nil && m.SlotIndex != nil { - return *m.SlotIndex - } - return 0 -} - -type CGCMsgTFPlayerSkillRatingAdjustment struct { - Players []*CGCMsgTFPlayerSkillRatingAdjustment_Player `protobuf:"bytes,1,rep,name=players" json:"players,omitempty"` - MatchType *TF_SkillRatingMatchType `protobuf:"varint,2,opt,name=match_type,enum=TF_SkillRatingMatchType,def=-1" json:"match_type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgTFPlayerSkillRatingAdjustment) Reset() { *m = CGCMsgTFPlayerSkillRatingAdjustment{} } -func (m *CGCMsgTFPlayerSkillRatingAdjustment) String() string { return proto.CompactTextString(m) } -func (*CGCMsgTFPlayerSkillRatingAdjustment) ProtoMessage() {} -func (*CGCMsgTFPlayerSkillRatingAdjustment) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{103} -} - -const Default_CGCMsgTFPlayerSkillRatingAdjustment_MatchType TF_SkillRatingMatchType = TF_SkillRatingMatchType_TF_SkillRatingMatchType_INVALID - -func (m *CGCMsgTFPlayerSkillRatingAdjustment) GetPlayers() []*CGCMsgTFPlayerSkillRatingAdjustment_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CGCMsgTFPlayerSkillRatingAdjustment) GetMatchType() TF_SkillRatingMatchType { - if m != nil && m.MatchType != nil { - return *m.MatchType - } - return Default_CGCMsgTFPlayerSkillRatingAdjustment_MatchType -} - -type CGCMsgTFPlayerSkillRatingAdjustment_Player struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - Adjustment *int32 `protobuf:"varint,3,opt,name=adjustment" json:"adjustment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgTFPlayerSkillRatingAdjustment_Player) Reset() { - *m = CGCMsgTFPlayerSkillRatingAdjustment_Player{} -} -func (m *CGCMsgTFPlayerSkillRatingAdjustment_Player) String() string { - return proto.CompactTextString(m) -} -func (*CGCMsgTFPlayerSkillRatingAdjustment_Player) ProtoMessage() {} -func (*CGCMsgTFPlayerSkillRatingAdjustment_Player) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{103, 0} -} - -func (m *CGCMsgTFPlayerSkillRatingAdjustment_Player) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CGCMsgTFPlayerSkillRatingAdjustment_Player) GetAdjustment() int32 { - if m != nil && m.Adjustment != nil { - return *m.Adjustment - } - return 0 -} - -type CSOTFSpyVsEngyWarData struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - Affiliation *uint32 `protobuf:"varint,2,opt,name=affiliation" json:"affiliation,omitempty"` - PointsForEngy *uint32 `protobuf:"varint,3,opt,name=points_for_engy" json:"points_for_engy,omitempty"` - PointsForSpy *uint32 `protobuf:"varint,4,opt,name=points_for_spy" json:"points_for_spy,omitempty"` - KillsForEngy *uint32 `protobuf:"varint,5,opt,name=kills_for_engy" json:"kills_for_engy,omitempty"` - KillsForSpy *uint32 `protobuf:"varint,6,opt,name=kills_for_spy" json:"kills_for_spy,omitempty"` - KillcamMessage *string `protobuf:"bytes,7,opt,name=killcam_message" json:"killcam_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFSpyVsEngyWarData) Reset() { *m = CSOTFSpyVsEngyWarData{} } -func (m *CSOTFSpyVsEngyWarData) String() string { return proto.CompactTextString(m) } -func (*CSOTFSpyVsEngyWarData) ProtoMessage() {} -func (*CSOTFSpyVsEngyWarData) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{104} } - -func (m *CSOTFSpyVsEngyWarData) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOTFSpyVsEngyWarData) GetAffiliation() uint32 { - if m != nil && m.Affiliation != nil { - return *m.Affiliation - } - return 0 -} - -func (m *CSOTFSpyVsEngyWarData) GetPointsForEngy() uint32 { - if m != nil && m.PointsForEngy != nil { - return *m.PointsForEngy - } - return 0 -} - -func (m *CSOTFSpyVsEngyWarData) GetPointsForSpy() uint32 { - if m != nil && m.PointsForSpy != nil { - return *m.PointsForSpy - } - return 0 -} - -func (m *CSOTFSpyVsEngyWarData) GetKillsForEngy() uint32 { - if m != nil && m.KillsForEngy != nil { - return *m.KillsForEngy - } - return 0 -} - -func (m *CSOTFSpyVsEngyWarData) GetKillsForSpy() uint32 { - if m != nil && m.KillsForSpy != nil { - return *m.KillsForSpy - } - return 0 -} - -func (m *CSOTFSpyVsEngyWarData) GetKillcamMessage() string { - if m != nil && m.KillcamMessage != nil { - return *m.KillcamMessage - } - return "" -} - -type CGCMsgGC_SpyVsEngyWar_IndividualUpdate struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - EngyPointsScored *uint32 `protobuf:"varint,2,opt,name=engy_points_scored" json:"engy_points_scored,omitempty"` - SpyPointsScored *uint32 `protobuf:"varint,3,opt,name=spy_points_scored" json:"spy_points_scored,omitempty"` - EngyKillsScored *uint32 `protobuf:"varint,4,opt,name=engy_kills_scored" json:"engy_kills_scored,omitempty"` - SpyKillsScored *uint32 `protobuf:"varint,5,opt,name=spy_kills_scored" json:"spy_kills_scored,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) Reset() { - *m = CGCMsgGC_SpyVsEngyWar_IndividualUpdate{} -} -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) String() string { return proto.CompactTextString(m) } -func (*CGCMsgGC_SpyVsEngyWar_IndividualUpdate) ProtoMessage() {} -func (*CGCMsgGC_SpyVsEngyWar_IndividualUpdate) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{105} -} - -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) GetEngyPointsScored() uint32 { - if m != nil && m.EngyPointsScored != nil { - return *m.EngyPointsScored - } - return 0 -} - -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) GetSpyPointsScored() uint32 { - if m != nil && m.SpyPointsScored != nil { - return *m.SpyPointsScored - } - return 0 -} - -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) GetEngyKillsScored() uint32 { - if m != nil && m.EngyKillsScored != nil { - return *m.EngyKillsScored - } - return 0 -} - -func (m *CGCMsgGC_SpyVsEngyWar_IndividualUpdate) GetSpyKillsScored() uint32 { - if m != nil && m.SpyKillsScored != nil { - return *m.SpyKillsScored - } - return 0 -} - -type CGCMsgGC_SpyVsEngyWar_JoinWar struct { - Affiliation *uint32 `protobuf:"varint,1,opt,name=affiliation" json:"affiliation,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgGC_SpyVsEngyWar_JoinWar) Reset() { *m = CGCMsgGC_SpyVsEngyWar_JoinWar{} } -func (m *CGCMsgGC_SpyVsEngyWar_JoinWar) String() string { return proto.CompactTextString(m) } -func (*CGCMsgGC_SpyVsEngyWar_JoinWar) ProtoMessage() {} -func (*CGCMsgGC_SpyVsEngyWar_JoinWar) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{106} } - -func (m *CGCMsgGC_SpyVsEngyWar_JoinWar) GetAffiliation() uint32 { - if m != nil && m.Affiliation != nil { - return *m.Affiliation - } - return 0 -} - -type CGCMsgGC_SpyVsEngyWar_SetKillCamMessage struct { - KillcamMessage *string `protobuf:"bytes,1,opt,name=killcam_message" json:"killcam_message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgGC_SpyVsEngyWar_SetKillCamMessage) Reset() { - *m = CGCMsgGC_SpyVsEngyWar_SetKillCamMessage{} -} -func (m *CGCMsgGC_SpyVsEngyWar_SetKillCamMessage) String() string { return proto.CompactTextString(m) } -func (*CGCMsgGC_SpyVsEngyWar_SetKillCamMessage) ProtoMessage() {} -func (*CGCMsgGC_SpyVsEngyWar_SetKillCamMessage) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{107} -} - -func (m *CGCMsgGC_SpyVsEngyWar_SetKillCamMessage) GetKillcamMessage() string { - if m != nil && m.KillcamMessage != nil { - return *m.KillcamMessage - } - return "" -} - -type CGCMsgGC_SpyVsEngyWar_RequestGlobalStats struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgGC_SpyVsEngyWar_RequestGlobalStats) Reset() { - *m = CGCMsgGC_SpyVsEngyWar_RequestGlobalStats{} -} -func (m *CGCMsgGC_SpyVsEngyWar_RequestGlobalStats) String() string { return proto.CompactTextString(m) } -func (*CGCMsgGC_SpyVsEngyWar_RequestGlobalStats) ProtoMessage() {} -func (*CGCMsgGC_SpyVsEngyWar_RequestGlobalStats) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{108} -} - -type CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse struct { - SpyScore *uint64 `protobuf:"varint,1,opt,name=spy_score" json:"spy_score,omitempty"` - EngyScore *uint64 `protobuf:"varint,2,opt,name=engy_score" json:"engy_score,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse) Reset() { - *m = CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse{} -} -func (m *CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse) String() string { return proto.CompactTextString(m) } -func (*CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse) ProtoMessage() {} -func (*CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{109} -} - -func (m *CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse) GetSpyScore() uint64 { - if m != nil && m.SpyScore != nil { - return *m.SpyScore - } - return 0 -} - -func (m *CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse) GetEngyScore() uint64 { - if m != nil && m.EngyScore != nil { - return *m.EngyScore - } - return 0 -} - -type CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate struct { - Score *uint32 `protobuf:"varint,2,opt,name=score" json:"score,omitempty"` - Type *uint32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"` - ScoreId []byte `protobuf:"bytes,4,opt,name=score_id" json:"score_id,omitempty"` - ScoreCheck *uint32 `protobuf:"varint,5,opt,name=score_check" json:"score_check,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) Reset() { - *m = CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate{} -} -func (m *CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) String() string { - return proto.CompactTextString(m) -} -func (*CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) ProtoMessage() {} -func (*CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{110} -} - -func (m *CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) GetType() uint32 { - if m != nil && m.Type != nil { - return *m.Type - } - return 0 -} - -func (m *CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) GetScoreId() []byte { - if m != nil { - return m.ScoreId - } - return nil -} - -func (m *CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate) GetScoreCheck() uint32 { - if m != nil && m.ScoreCheck != nil { - return *m.ScoreCheck - } - return 0 -} - -type CAttribute_WorldItemPlacement struct { - OriginalItemId *uint64 `protobuf:"varint,1,opt,name=original_item_id" json:"original_item_id,omitempty"` - PosX *float32 `protobuf:"fixed32,2,opt,name=pos_x" json:"pos_x,omitempty"` - PosY *float32 `protobuf:"fixed32,3,opt,name=pos_y" json:"pos_y,omitempty"` - PosZ *float32 `protobuf:"fixed32,4,opt,name=pos_z" json:"pos_z,omitempty"` - AngX *float32 `protobuf:"fixed32,5,opt,name=ang_x" json:"ang_x,omitempty"` - AngY *float32 `protobuf:"fixed32,6,opt,name=ang_y" json:"ang_y,omitempty"` - AngZ *float32 `protobuf:"fixed32,7,opt,name=ang_z" json:"ang_z,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CAttribute_WorldItemPlacement) Reset() { *m = CAttribute_WorldItemPlacement{} } -func (m *CAttribute_WorldItemPlacement) String() string { return proto.CompactTextString(m) } -func (*CAttribute_WorldItemPlacement) ProtoMessage() {} -func (*CAttribute_WorldItemPlacement) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{111} } - -func (m *CAttribute_WorldItemPlacement) GetOriginalItemId() uint64 { - if m != nil && m.OriginalItemId != nil { - return *m.OriginalItemId - } - return 0 -} - -func (m *CAttribute_WorldItemPlacement) GetPosX() float32 { - if m != nil && m.PosX != nil { - return *m.PosX - } - return 0 -} - -func (m *CAttribute_WorldItemPlacement) GetPosY() float32 { - if m != nil && m.PosY != nil { - return *m.PosY - } - return 0 -} - -func (m *CAttribute_WorldItemPlacement) GetPosZ() float32 { - if m != nil && m.PosZ != nil { - return *m.PosZ - } - return 0 -} - -func (m *CAttribute_WorldItemPlacement) GetAngX() float32 { - if m != nil && m.AngX != nil { - return *m.AngX - } - return 0 -} - -func (m *CAttribute_WorldItemPlacement) GetAngY() float32 { - if m != nil && m.AngY != nil { - return *m.AngY - } - return 0 -} - -func (m *CAttribute_WorldItemPlacement) GetAngZ() float32 { - if m != nil && m.AngZ != nil { - return *m.AngZ - } - return 0 -} - -type CGCMsg_WorldItemPlacement_Update struct { - OriginalItemId *uint64 `protobuf:"varint,1,opt,name=original_item_id" json:"original_item_id,omitempty"` - PosX *float32 `protobuf:"fixed32,2,opt,name=pos_x" json:"pos_x,omitempty"` - PosY *float32 `protobuf:"fixed32,3,opt,name=pos_y" json:"pos_y,omitempty"` - PosZ *float32 `protobuf:"fixed32,4,opt,name=pos_z" json:"pos_z,omitempty"` - AngX *float32 `protobuf:"fixed32,5,opt,name=ang_x" json:"ang_x,omitempty"` - AngY *float32 `protobuf:"fixed32,6,opt,name=ang_y" json:"ang_y,omitempty"` - AngZ *float32 `protobuf:"fixed32,7,opt,name=ang_z" json:"ang_z,omitempty"` - ForceRemoveAll *bool `protobuf:"varint,8,opt,name=force_remove_all" json:"force_remove_all,omitempty"` - AttribName *string `protobuf:"bytes,9,opt,name=attrib_name" json:"attrib_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CGCMsg_WorldItemPlacement_Update) Reset() { *m = CGCMsg_WorldItemPlacement_Update{} } -func (m *CGCMsg_WorldItemPlacement_Update) String() string { return proto.CompactTextString(m) } -func (*CGCMsg_WorldItemPlacement_Update) ProtoMessage() {} -func (*CGCMsg_WorldItemPlacement_Update) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{112} -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetOriginalItemId() uint64 { - if m != nil && m.OriginalItemId != nil { - return *m.OriginalItemId - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetPosX() float32 { - if m != nil && m.PosX != nil { - return *m.PosX - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetPosY() float32 { - if m != nil && m.PosY != nil { - return *m.PosY - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetPosZ() float32 { - if m != nil && m.PosZ != nil { - return *m.PosZ - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetAngX() float32 { - if m != nil && m.AngX != nil { - return *m.AngX - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetAngY() float32 { - if m != nil && m.AngY != nil { - return *m.AngY - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetAngZ() float32 { - if m != nil && m.AngZ != nil { - return *m.AngZ - } - return 0 -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetForceRemoveAll() bool { - if m != nil && m.ForceRemoveAll != nil { - return *m.ForceRemoveAll - } - return false -} - -func (m *CGCMsg_WorldItemPlacement_Update) GetAttribName() string { - if m != nil && m.AttribName != nil { - return *m.AttribName - } - return "" -} - -type CMsgGC_Match_Result struct { - MatchId *uint64 `protobuf:"varint,1,opt,name=match_id" json:"match_id,omitempty"` - MatchType *TF_SkillRatingMatchType `protobuf:"varint,2,opt,name=match_type,enum=TF_SkillRatingMatchType,def=-1" json:"match_type,omitempty"` - Status *CMsgGC_Match_Result_Status `protobuf:"varint,3,opt,name=status,enum=CMsgGC_Match_Result_Status,def=0" json:"status,omitempty"` - Duration *uint32 `protobuf:"varint,4,opt,name=duration" json:"duration,omitempty"` - RedScore *uint32 `protobuf:"varint,5,opt,name=red_score" json:"red_score,omitempty"` - BlueScore *uint32 `protobuf:"varint,6,opt,name=blue_score" json:"blue_score,omitempty"` - WinningTeam *uint32 `protobuf:"varint,7,opt,name=winning_team" json:"winning_team,omitempty"` - MapName *string `protobuf:"bytes,8,opt,name=map_name" json:"map_name,omitempty"` - GameType *uint32 `protobuf:"varint,9,opt,name=game_type,def=0" json:"game_type,omitempty"` - Players []*CMsgGC_Match_Result_Player `protobuf:"bytes,10,rep,name=players" json:"players,omitempty"` - RedSkillrating *uint32 `protobuf:"varint,11,opt,name=red_skillrating" json:"red_skillrating,omitempty"` - BlueSkillrating *uint32 `protobuf:"varint,12,opt,name=blue_skillrating" json:"blue_skillrating,omitempty"` - WinReason *uint32 `protobuf:"varint,13,opt,name=win_reason" json:"win_reason,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Match_Result) Reset() { *m = CMsgGC_Match_Result{} } -func (m *CMsgGC_Match_Result) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Match_Result) ProtoMessage() {} -func (*CMsgGC_Match_Result) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{113} } - -const Default_CMsgGC_Match_Result_MatchType TF_SkillRatingMatchType = TF_SkillRatingMatchType_TF_SkillRatingMatchType_INVALID -const Default_CMsgGC_Match_Result_Status CMsgGC_Match_Result_Status = CMsgGC_Match_Result_MATCH_SUCCEEDED -const Default_CMsgGC_Match_Result_GameType uint32 = 0 - -func (m *CMsgGC_Match_Result) GetMatchId() uint64 { - if m != nil && m.MatchId != nil { - return *m.MatchId - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetMatchType() TF_SkillRatingMatchType { - if m != nil && m.MatchType != nil { - return *m.MatchType - } - return Default_CMsgGC_Match_Result_MatchType -} - -func (m *CMsgGC_Match_Result) GetStatus() CMsgGC_Match_Result_Status { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_CMsgGC_Match_Result_Status -} - -func (m *CMsgGC_Match_Result) GetDuration() uint32 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetRedScore() uint32 { - if m != nil && m.RedScore != nil { - return *m.RedScore - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetBlueScore() uint32 { - if m != nil && m.BlueScore != nil { - return *m.BlueScore - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetWinningTeam() uint32 { - if m != nil && m.WinningTeam != nil { - return *m.WinningTeam - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetMapName() string { - if m != nil && m.MapName != nil { - return *m.MapName - } - return "" -} - -func (m *CMsgGC_Match_Result) GetGameType() uint32 { - if m != nil && m.GameType != nil { - return *m.GameType - } - return Default_CMsgGC_Match_Result_GameType -} - -func (m *CMsgGC_Match_Result) GetPlayers() []*CMsgGC_Match_Result_Player { - if m != nil { - return m.Players - } - return nil -} - -func (m *CMsgGC_Match_Result) GetRedSkillrating() uint32 { - if m != nil && m.RedSkillrating != nil { - return *m.RedSkillrating - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetBlueSkillrating() uint32 { - if m != nil && m.BlueSkillrating != nil { - return *m.BlueSkillrating - } - return 0 -} - -func (m *CMsgGC_Match_Result) GetWinReason() uint32 { - if m != nil && m.WinReason != nil { - return *m.WinReason - } - return 0 -} - -type CMsgGC_Match_Result_Player struct { - SteamId *uint64 `protobuf:"fixed64,1,opt,name=steam_id" json:"steam_id,omitempty"` - Team *uint32 `protobuf:"varint,2,opt,name=team" json:"team,omitempty"` - Score *uint32 `protobuf:"varint,3,opt,name=score" json:"score,omitempty"` - Ping *uint32 `protobuf:"varint,4,opt,name=ping" json:"ping,omitempty"` - Flags *uint32 `protobuf:"varint,5,opt,name=flags" json:"flags,omitempty"` - Skillrating *uint32 `protobuf:"varint,6,opt,name=skillrating" json:"skillrating,omitempty"` - SkillratingChange *uint32 `protobuf:"varint,7,opt,name=skillrating_change" json:"skillrating_change,omitempty"` - ClassesPlayed *uint32 `protobuf:"varint,8,opt,name=classes_played" json:"classes_played,omitempty"` - Kills *uint32 `protobuf:"varint,9,opt,name=kills" json:"kills,omitempty"` - Damage *uint32 `protobuf:"varint,10,opt,name=damage" json:"damage,omitempty"` - Healing *uint32 `protobuf:"varint,11,opt,name=healing" json:"healing,omitempty"` - Support *uint32 `protobuf:"varint,12,opt,name=support" json:"support,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Match_Result_Player) Reset() { *m = CMsgGC_Match_Result_Player{} } -func (m *CMsgGC_Match_Result_Player) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_Match_Result_Player) ProtoMessage() {} -func (*CMsgGC_Match_Result_Player) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{113, 0} } - -func (m *CMsgGC_Match_Result_Player) GetSteamId() uint64 { - if m != nil && m.SteamId != nil { - return *m.SteamId - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetTeam() uint32 { - if m != nil && m.Team != nil { - return *m.Team - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetPing() uint32 { - if m != nil && m.Ping != nil { - return *m.Ping - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetFlags() uint32 { - if m != nil && m.Flags != nil { - return *m.Flags - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetSkillrating() uint32 { - if m != nil && m.Skillrating != nil { - return *m.Skillrating - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetSkillratingChange() uint32 { - if m != nil && m.SkillratingChange != nil { - return *m.SkillratingChange - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetClassesPlayed() uint32 { - if m != nil && m.ClassesPlayed != nil { - return *m.ClassesPlayed - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetDamage() uint32 { - if m != nil && m.Damage != nil { - return *m.Damage - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetHealing() uint32 { - if m != nil && m.Healing != nil { - return *m.Healing - } - return 0 -} - -func (m *CMsgGC_Match_Result_Player) GetSupport() uint32 { - if m != nil && m.Support != nil { - return *m.Support - } - return 0 -} - -type CEconItemPreviewDataBlock struct { - Econitem *CSOEconItem `protobuf:"bytes,1,opt,name=econitem" json:"econitem,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CEconItemPreviewDataBlock) Reset() { *m = CEconItemPreviewDataBlock{} } -func (m *CEconItemPreviewDataBlock) String() string { return proto.CompactTextString(m) } -func (*CEconItemPreviewDataBlock) ProtoMessage() {} -func (*CEconItemPreviewDataBlock) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{114} } - -func (m *CEconItemPreviewDataBlock) GetEconitem() *CSOEconItem { - if m != nil { - return m.Econitem - } - return nil -} - -type CMsgGC_Client2GCEconPreviewDataBlockRequest struct { - ParamS *uint64 `protobuf:"varint,1,opt,name=param_s" json:"param_s,omitempty"` - ParamA *uint64 `protobuf:"varint,2,opt,name=param_a" json:"param_a,omitempty"` - ParamD *uint64 `protobuf:"varint,3,opt,name=param_d" json:"param_d,omitempty"` - ParamM *uint64 `protobuf:"varint,4,opt,name=param_m" json:"param_m,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockRequest) Reset() { - *m = CMsgGC_Client2GCEconPreviewDataBlockRequest{} -} -func (m *CMsgGC_Client2GCEconPreviewDataBlockRequest) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_Client2GCEconPreviewDataBlockRequest) ProtoMessage() {} -func (*CMsgGC_Client2GCEconPreviewDataBlockRequest) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{115} -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockRequest) GetParamS() uint64 { - if m != nil && m.ParamS != nil { - return *m.ParamS - } - return 0 -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockRequest) GetParamA() uint64 { - if m != nil && m.ParamA != nil { - return *m.ParamA - } - return 0 -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockRequest) GetParamD() uint64 { - if m != nil && m.ParamD != nil { - return *m.ParamD - } - return 0 -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockRequest) GetParamM() uint64 { - if m != nil && m.ParamM != nil { - return *m.ParamM - } - return 0 -} - -type CMsgGC_Client2GCEconPreviewDataBlockResponse struct { - Iteminfo *CEconItemPreviewDataBlock `protobuf:"bytes,1,opt,name=iteminfo" json:"iteminfo,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockResponse) Reset() { - *m = CMsgGC_Client2GCEconPreviewDataBlockResponse{} -} -func (m *CMsgGC_Client2GCEconPreviewDataBlockResponse) String() string { - return proto.CompactTextString(m) -} -func (*CMsgGC_Client2GCEconPreviewDataBlockResponse) ProtoMessage() {} -func (*CMsgGC_Client2GCEconPreviewDataBlockResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{116} -} - -func (m *CMsgGC_Client2GCEconPreviewDataBlockResponse) GetIteminfo() *CEconItemPreviewDataBlock { - if m != nil { - return m.Iteminfo - } - return nil -} - -type CSOTFLadderPlayerStats struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - MatchType *TF_SkillRatingMatchType `protobuf:"varint,2,opt,name=match_type,enum=TF_SkillRatingMatchType,def=-1" json:"match_type,omitempty"` - Games *uint32 `protobuf:"varint,3,opt,name=games" json:"games,omitempty"` - Kills *uint32 `protobuf:"varint,4,opt,name=kills" json:"kills,omitempty"` - Damage *uint32 `protobuf:"varint,5,opt,name=damage" json:"damage,omitempty"` - Healing *uint32 `protobuf:"varint,6,opt,name=healing" json:"healing,omitempty"` - Support *uint32 `protobuf:"varint,7,opt,name=support" json:"support,omitempty"` - Score *uint32 `protobuf:"varint,8,opt,name=score" json:"score,omitempty"` - Experience *uint32 `protobuf:"varint,9,opt,name=experience" json:"experience,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CSOTFLadderPlayerStats) Reset() { *m = CSOTFLadderPlayerStats{} } -func (m *CSOTFLadderPlayerStats) String() string { return proto.CompactTextString(m) } -func (*CSOTFLadderPlayerStats) ProtoMessage() {} -func (*CSOTFLadderPlayerStats) Descriptor() ([]byte, []int) { return tf_fileDescriptor0, []int{117} } - -const Default_CSOTFLadderPlayerStats_MatchType TF_SkillRatingMatchType = TF_SkillRatingMatchType_TF_SkillRatingMatchType_INVALID - -func (m *CSOTFLadderPlayerStats) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetMatchType() TF_SkillRatingMatchType { - if m != nil && m.MatchType != nil { - return *m.MatchType - } - return Default_CSOTFLadderPlayerStats_MatchType -} - -func (m *CSOTFLadderPlayerStats) GetGames() uint32 { - if m != nil && m.Games != nil { - return *m.Games - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetKills() uint32 { - if m != nil && m.Kills != nil { - return *m.Kills - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetDamage() uint32 { - if m != nil && m.Damage != nil { - return *m.Damage - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetHealing() uint32 { - if m != nil && m.Healing != nil { - return *m.Healing - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetSupport() uint32 { - if m != nil && m.Support != nil { - return *m.Support - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetScore() uint32 { - if m != nil && m.Score != nil { - return *m.Score - } - return 0 -} - -func (m *CSOTFLadderPlayerStats) GetExperience() uint32 { - if m != nil && m.Experience != nil { - return *m.Experience - } - return 0 -} - -type CMsgGC_TFVoteKickPlayerRequest struct { - AccountId *uint32 `protobuf:"varint,1,opt,name=account_id" json:"account_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_TFVoteKickPlayerRequest) Reset() { *m = CMsgGC_TFVoteKickPlayerRequest{} } -func (m *CMsgGC_TFVoteKickPlayerRequest) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_TFVoteKickPlayerRequest) ProtoMessage() {} -func (*CMsgGC_TFVoteKickPlayerRequest) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{118} -} - -func (m *CMsgGC_TFVoteKickPlayerRequest) GetAccountId() uint32 { - if m != nil && m.AccountId != nil { - return *m.AccountId - } - return 0 -} - -type CMsgGC_VoteKickPlayerRequestResponse struct { - Allowed *bool `protobuf:"varint,1,opt,name=allowed" json:"allowed,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CMsgGC_VoteKickPlayerRequestResponse) Reset() { *m = CMsgGC_VoteKickPlayerRequestResponse{} } -func (m *CMsgGC_VoteKickPlayerRequestResponse) String() string { return proto.CompactTextString(m) } -func (*CMsgGC_VoteKickPlayerRequestResponse) ProtoMessage() {} -func (*CMsgGC_VoteKickPlayerRequestResponse) Descriptor() ([]byte, []int) { - return tf_fileDescriptor0, []int{119} -} - -func (m *CMsgGC_VoteKickPlayerRequestResponse) GetAllowed() bool { - if m != nil && m.Allowed != nil { - return *m.Allowed - } - return false -} - -func init() { - proto.RegisterType((*CMsgTFGoldenWrenchBroadcast)(nil), "CMsgTFGoldenWrenchBroadcast") - proto.RegisterType((*CMsgTFSaxxyBroadcast)(nil), "CMsgTFSaxxyBroadcast") - proto.RegisterType((*CMsgGCTFSpecificItemBroadcast)(nil), "CMsgGCTFSpecificItemBroadcast") - proto.RegisterType((*CSOTFDuelSummary)(nil), "CSOTFDuelSummary") - proto.RegisterType((*CSOTFMapContribution)(nil), "CSOTFMapContribution") - proto.RegisterType((*CMsgTFVoteKickBanPlayer)(nil), "CMsgTFVoteKickBanPlayer") - proto.RegisterType((*CMsgTFVoteKickBanPlayerResult)(nil), "CMsgTFVoteKickBanPlayerResult") - proto.RegisterType((*CMsgTFFreeTrialChooseMostHelpfulFriend)(nil), "CMsgTFFreeTrialChooseMostHelpfulFriend") - proto.RegisterType((*CMsgTFRequestTF2Friends)(nil), "CMsgTFRequestTF2Friends") - proto.RegisterType((*CMsgTFRequestTF2FriendsResponse)(nil), "CMsgTFRequestTF2FriendsResponse") - proto.RegisterType((*CSOTFPlayerInfo)(nil), "CSOTFPlayerInfo") - proto.RegisterType((*CMsgTFThankedBySomeone)(nil), "CMsgTFThankedBySomeone") - proto.RegisterType((*CMsgTFThankedSomeone)(nil), "CMsgTFThankedSomeone") - proto.RegisterType((*CMsgTFFreeTrialConvertedToPremium)(nil), "CMsgTFFreeTrialConvertedToPremium") - proto.RegisterType((*CMsgSaxxyAwarded)(nil), "CMsgSaxxyAwarded") - proto.RegisterType((*CMsgReplaySubmitContestEntry)(nil), "CMsgReplaySubmitContestEntry") - proto.RegisterType((*CMsgReplaySubmitContestEntryResponse)(nil), "CMsgReplaySubmitContestEntryResponse") - proto.RegisterType((*CReplayCachedContestData)(nil), "CReplayCachedContestData") - proto.RegisterType((*CMsgTFCoaching_AddToCoaches)(nil), "CMsgTFCoaching_AddToCoaches") - proto.RegisterType((*CMsgTFCoaching_RemoveFromCoaches)(nil), "CMsgTFCoaching_RemoveFromCoaches") - proto.RegisterType((*CMsgTFCoaching_FindCoach)(nil), "CMsgTFCoaching_FindCoach") - proto.RegisterType((*CMsgTFCoaching_FindCoachResponse)(nil), "CMsgTFCoaching_FindCoachResponse") - proto.RegisterType((*CMsgTFCoaching_AskCoach)(nil), "CMsgTFCoaching_AskCoach") - proto.RegisterType((*CMsgTFCoaching_AskCoachResponse)(nil), "CMsgTFCoaching_AskCoachResponse") - proto.RegisterType((*CMsgTFCoaching_CoachJoinGame)(nil), "CMsgTFCoaching_CoachJoinGame") - proto.RegisterType((*CMsgTFCoaching_CoachJoining)(nil), "CMsgTFCoaching_CoachJoining") - proto.RegisterType((*CMsgTFCoaching_CoachJoined)(nil), "CMsgTFCoaching_CoachJoined") - proto.RegisterType((*CMsgTFCoaching_LikeCurrentCoach)(nil), "CMsgTFCoaching_LikeCurrentCoach") - proto.RegisterType((*CMsgTFCoaching_RemoveCurrentCoach)(nil), "CMsgTFCoaching_RemoveCurrentCoach") - proto.RegisterType((*CMsgTFQuickplay_ScoreServers)(nil), "CMsgTFQuickplay_ScoreServers") - proto.RegisterType((*CMsgTFQuickplay_ScoreServers_ServerInfo)(nil), "CMsgTFQuickplay_ScoreServers.ServerInfo") - proto.RegisterType((*CMsgTFQuickplay_ScoreServersResponse)(nil), "CMsgTFQuickplay_ScoreServersResponse") - proto.RegisterType((*CMsgTFQuickplay_ScoreServersResponse_ServerInfo)(nil), "CMsgTFQuickplay_ScoreServersResponse.ServerInfo") - proto.RegisterType((*CMsgTFQuickplay_PlayerJoining)(nil), "CMsgTFQuickplay_PlayerJoining") - proto.RegisterType((*CMsgGC_GameServer_LevelInfo)(nil), "CMsgGC_GameServer_LevelInfo") - proto.RegisterType((*CMsgGC_GameServer_AuthChallenge)(nil), "CMsgGC_GameServer_AuthChallenge") - proto.RegisterType((*CMsgGC_GameServer_AuthResult)(nil), "CMsgGC_GameServer_AuthResult") - proto.RegisterType((*CMsgGC_GameServer_AuthChallengeResponse)(nil), "CMsgGC_GameServer_AuthChallengeResponse") - proto.RegisterType((*CMsgGC_GameServer_CreateIdentity)(nil), "CMsgGC_GameServer_CreateIdentity") - proto.RegisterType((*CMsgGC_GameServer_CreateIdentityResponse)(nil), "CMsgGC_GameServer_CreateIdentityResponse") - proto.RegisterType((*CMsgGC_GameServer_List)(nil), "CMsgGC_GameServer_List") - proto.RegisterType((*CMsgGC_GameServer_ListResponse)(nil), "CMsgGC_GameServer_ListResponse") - proto.RegisterType((*CMsgGC_GameServer_ListResponse_GameServerIdentity)(nil), "CMsgGC_GameServer_ListResponse.GameServerIdentity") - proto.RegisterType((*CMsgGC_GameServer_ResetIdentity)(nil), "CMsgGC_GameServer_ResetIdentity") - proto.RegisterType((*CMsgGC_GameServer_ResetIdentityResponse)(nil), "CMsgGC_GameServer_ResetIdentityResponse") - proto.RegisterType((*CMsgGC_GameServer_AckPolicy)(nil), "CMsgGC_GameServer_AckPolicy") - proto.RegisterType((*CMsgGC_GameServer_AckPolicyResponse)(nil), "CMsgGC_GameServer_AckPolicyResponse") - proto.RegisterType((*CMsgGC_Client_UseServerModificationItem)(nil), "CMsgGC_Client_UseServerModificationItem") - proto.RegisterType((*CMsgGC_Client_UseServerModificationItem_Response)(nil), "CMsgGC_Client_UseServerModificationItem_Response") - proto.RegisterType((*CMsgGC_GameServer_UseServerModificationItem)(nil), "CMsgGC_GameServer_UseServerModificationItem") - proto.RegisterType((*CMsgGC_GameServer_UseServerModificationItem_Response)(nil), "CMsgGC_GameServer_UseServerModificationItem_Response") - proto.RegisterType((*CMsgGC_GameServer_ServerModificationItemExpired)(nil), "CMsgGC_GameServer_ServerModificationItemExpired") - proto.RegisterType((*CMsgGC_GameServer_ServerModificationItem)(nil), "CMsgGC_GameServer_ServerModificationItem") - proto.RegisterType((*CMsgGC_Halloween_ReservedItem)(nil), "CMsgGC_Halloween_ReservedItem") - proto.RegisterType((*CMsgGC_Halloween_GrantItem)(nil), "CMsgGC_Halloween_GrantItem") - proto.RegisterType((*CMsgGC_Halloween_GrantItemResponse)(nil), "CMsgGC_Halloween_GrantItemResponse") - proto.RegisterType((*CMsgGC_Halloween_ItemClaimed)(nil), "CMsgGC_Halloween_ItemClaimed") - proto.RegisterType((*CMsgGC_PickupItemEligibility_Query)(nil), "CMsgGC_PickupItemEligibility_Query") - proto.RegisterType((*CMsgGC_PickupItemEligibility_QueryResponse)(nil), "CMsgGC_PickupItemEligibility_QueryResponse") - proto.RegisterType((*CSOTFPartyMember)(nil), "CSOTFPartyMember") - proto.RegisterType((*CMsgMatchSearchCriteria)(nil), "CMsgMatchSearchCriteria") - proto.RegisterType((*CMsgCreateOrUpdateParty)(nil), "CMsgCreateOrUpdateParty") - proto.RegisterType((*CMsgCreateOrUpdatePartyReply)(nil), "CMsgCreateOrUpdatePartyReply") - proto.RegisterType((*CSOTFParty)(nil), "CSOTFParty") - proto.RegisterType((*CSOTFPartyInvite)(nil), "CSOTFPartyInvite") - proto.RegisterType((*CSOTFPartyInvite_PartyMember)(nil), "CSOTFPartyInvite.PartyMember") - proto.RegisterType((*CTFLobbyMember)(nil), "CTFLobbyMember") - proto.RegisterType((*CLobbyPendingPlayerReport)(nil), "CLobbyPendingPlayerReport") - proto.RegisterType((*CMsgGameMatchSignOut)(nil), "CMsgGameMatchSignOut") - proto.RegisterType((*CSOTFLobby)(nil), "CSOTFLobby") - proto.RegisterType((*CMsgExitMatchmaking)(nil), "CMsgExitMatchmaking") - proto.RegisterType((*CMsgAcceptInvite)(nil), "CMsgAcceptInvite") - proto.RegisterType((*CMsgAcceptInviteResponse)(nil), "CMsgAcceptInviteResponse") - proto.RegisterType((*CMsgReadyUp)(nil), "CMsgReadyUp") - proto.RegisterType((*CMsgMatchmakingSearchCountRequest)(nil), "CMsgMatchmakingSearchCountRequest") - proto.RegisterType((*CMsgMatchmakingSearchCountResponse)(nil), "CMsgMatchmakingSearchCountResponse") - proto.RegisterType((*CMsgKickedFromMatchmakingQueue)(nil), "CMsgKickedFromMatchmakingQueue") - proto.RegisterType((*CMsgTFPlayerFailedToConnect)(nil), "CMsgTFPlayerFailedToConnect") - proto.RegisterType((*CMsgTFJoinChatChannel)(nil), "CMsgTFJoinChatChannel") - proto.RegisterType((*CMsgTFLeaveChatChannel)(nil), "CMsgTFLeaveChatChannel") - proto.RegisterType((*CMsgTFJoinChatChannelResponse)(nil), "CMsgTFJoinChatChannelResponse") - proto.RegisterType((*CMsgTFJoinChatChannelResponse_ChatMember)(nil), "CMsgTFJoinChatChannelResponse.ChatMember") - proto.RegisterType((*CMsgTFOtherJoinedChatChannel)(nil), "CMsgTFOtherJoinedChatChannel") - proto.RegisterType((*CMsgTFOtherLeftChatChannel)(nil), "CMsgTFOtherLeftChatChannel") - proto.RegisterType((*CMsgTFRequestDefaultChatChannel)(nil), "CMsgTFRequestDefaultChatChannel") - proto.RegisterType((*CMsgTFRequestDefaultChatChannelResponse)(nil), "CMsgTFRequestDefaultChatChannelResponse") - proto.RegisterType((*CMsgTFRequestChatChannelList)(nil), "CMsgTFRequestChatChannelList") - proto.RegisterType((*CMsgTFRequestChatChannelListResponse)(nil), "CMsgTFRequestChatChannelListResponse") - proto.RegisterType((*CMsgTFRequestChatChannelListResponse_ChatChannel)(nil), "CMsgTFRequestChatChannelListResponse.ChatChannel") - proto.RegisterType((*CMsgGameServerMatchmakingStatus)(nil), "CMsgGameServerMatchmakingStatus") - proto.RegisterType((*CMsgGameServerMatchmakingStatus_Player)(nil), "CMsgGameServerMatchmakingStatus.Player") - proto.RegisterType((*CMsgMatchmakingProgress)(nil), "CMsgMatchmakingProgress") - proto.RegisterType((*CMsgMvMVictoryInfo)(nil), "CMsgMvMVictoryInfo") - proto.RegisterType((*CMsgMvMVictoryInfo_Item)(nil), "CMsgMvMVictoryInfo.Item") - proto.RegisterType((*CMsgMvMVictoryInfo_Player)(nil), "CMsgMvMVictoryInfo.Player") - proto.RegisterType((*CGCMsgTFHelloResponse)(nil), "CGCMsgTFHelloResponse") - proto.RegisterType((*CGCMsgTFSync)(nil), "CGCMsgTFSync") - proto.RegisterType((*CGCMsgTFSyncEx)(nil), "CGCMsgTFSyncEx") - proto.RegisterType((*CMsgMvMVictory)(nil), "CMsgMvMVictory") - proto.RegisterType((*CMsgMvMVictory_Player)(nil), "CMsgMvMVictory.Player") - proto.RegisterType((*CMsgMvMMannUpVictoryReply)(nil), "CMsgMvMMannUpVictoryReply") - proto.RegisterType((*CMsgGameServerKickingLobby)(nil), "CMsgGameServerKickingLobby") - proto.RegisterType((*CMsgLeaveGameAndPrepareToJoinParty)(nil), "CMsgLeaveGameAndPrepareToJoinParty") - proto.RegisterType((*CMsgRemovePlayerFromLobby)(nil), "CMsgRemovePlayerFromLobby") - proto.RegisterType((*CMsgSetLobbySafeToLeave)(nil), "CMsgSetLobbySafeToLeave") - proto.RegisterType((*CMsgHalloween_ServerBossEvent)(nil), "CMsgHalloween_ServerBossEvent") - proto.RegisterType((*CMsgHalloween_Merasmus2012)(nil), "CMsgHalloween_Merasmus2012") - proto.RegisterType((*CMsgUpdateHalloweenMerasmusLootLevel)(nil), "CMsgUpdateHalloweenMerasmusLootLevel") - proto.RegisterType((*CMsgUpdateHalloweenMerasmusLootLevel_Player)(nil), "CMsgUpdateHalloweenMerasmusLootLevel.Player") - proto.RegisterType((*CAttribute_String)(nil), "CAttribute_String") - proto.RegisterType((*CAttribute_DynamicRecipeComponent)(nil), "CAttribute_DynamicRecipeComponent") - proto.RegisterType((*CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT)(nil), "CAttribute_DynamicRecipeComponent_COMPAT_NEVER_SERIALIZE_THIS_OUT") - proto.RegisterType((*CAttribute_ItemSlotCriteria)(nil), "CAttribute_ItemSlotCriteria") - proto.RegisterType((*CMsgSetItemSlotAttribute)(nil), "CMsgSetItemSlotAttribute") - proto.RegisterType((*CGCMsgTFPlayerSkillRatingAdjustment)(nil), "CGCMsgTFPlayerSkillRatingAdjustment") - proto.RegisterType((*CGCMsgTFPlayerSkillRatingAdjustment_Player)(nil), "CGCMsgTFPlayerSkillRatingAdjustment.Player") - proto.RegisterType((*CSOTFSpyVsEngyWarData)(nil), "CSOTFSpyVsEngyWarData") - proto.RegisterType((*CGCMsgGC_SpyVsEngyWar_IndividualUpdate)(nil), "CGCMsgGC_SpyVsEngyWar_IndividualUpdate") - proto.RegisterType((*CGCMsgGC_SpyVsEngyWar_JoinWar)(nil), "CGCMsgGC_SpyVsEngyWar_JoinWar") - proto.RegisterType((*CGCMsgGC_SpyVsEngyWar_SetKillCamMessage)(nil), "CGCMsgGC_SpyVsEngyWar_SetKillCamMessage") - proto.RegisterType((*CGCMsgGC_SpyVsEngyWar_RequestGlobalStats)(nil), "CGCMsgGC_SpyVsEngyWar_RequestGlobalStats") - proto.RegisterType((*CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse)(nil), "CGCMsgGC_SpyVsEngyWar_GlobalStatsResponse") - proto.RegisterType((*CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate)(nil), "CGCMsgGC_PlayerDuckLeaderboard_IndividualUpdate") - proto.RegisterType((*CAttribute_WorldItemPlacement)(nil), "CAttribute_WorldItemPlacement") - proto.RegisterType((*CGCMsg_WorldItemPlacement_Update)(nil), "CGCMsg_WorldItemPlacement_Update") - proto.RegisterType((*CMsgGC_Match_Result)(nil), "CMsgGC_Match_Result") - proto.RegisterType((*CMsgGC_Match_Result_Player)(nil), "CMsgGC_Match_Result.Player") - proto.RegisterType((*CEconItemPreviewDataBlock)(nil), "CEconItemPreviewDataBlock") - proto.RegisterType((*CMsgGC_Client2GCEconPreviewDataBlockRequest)(nil), "CMsgGC_Client2GCEconPreviewDataBlockRequest") - proto.RegisterType((*CMsgGC_Client2GCEconPreviewDataBlockResponse)(nil), "CMsgGC_Client2GCEconPreviewDataBlockResponse") - proto.RegisterType((*CSOTFLadderPlayerStats)(nil), "CSOTFLadderPlayerStats") - proto.RegisterType((*CMsgGC_TFVoteKickPlayerRequest)(nil), "CMsgGC_TFVoteKickPlayerRequest") - proto.RegisterType((*CMsgGC_VoteKickPlayerRequestResponse)(nil), "CMsgGC_VoteKickPlayerRequestResponse") - proto.RegisterEnum("ETFGCMsg", ETFGCMsg_name, ETFGCMsg_value) - proto.RegisterEnum("EServerModificationItemType", EServerModificationItemType_name, EServerModificationItemType_value) - proto.RegisterEnum("TF_MatchmakingMode", TF_MatchmakingMode_name, TF_MatchmakingMode_value) - proto.RegisterEnum("TF_Matchmaking_WizardStep", TF_Matchmaking_WizardStep_name, TF_Matchmaking_WizardStep_value) - proto.RegisterEnum("TF_GC_GameState", TF_GC_GameState_name, TF_GC_GameState_value) - proto.RegisterEnum("TF_GC_TEAM", TF_GC_TEAM_name, TF_GC_TEAM_value) - proto.RegisterEnum("TFLobbyReadyState", TFLobbyReadyState_name, TFLobbyReadyState_value) - proto.RegisterEnum("ChatChannelTypeT", ChatChannelTypeT_name, ChatChannelTypeT_value) - proto.RegisterEnum("ServerMatchmakingState", ServerMatchmakingState_name, ServerMatchmakingState_value) - proto.RegisterEnum("TF_SkillRatingMatchType", TF_SkillRatingMatchType_name, TF_SkillRatingMatchType_value) - proto.RegisterEnum("CMsgGC_GameServer_CreateIdentityResponse_EStatus", CMsgGC_GameServer_CreateIdentityResponse_EStatus_name, CMsgGC_GameServer_CreateIdentityResponse_EStatus_value) - proto.RegisterEnum("CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse", CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse_name, CMsgGC_Client_UseServerModificationItem_Response_EServerModificationItemResponse_value) - proto.RegisterEnum("CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse", CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse_name, CMsgGC_GameServer_UseServerModificationItem_Response_EServerModificationItemServerResponse_value) - proto.RegisterEnum("CSOTFParty_State", CSOTFParty_State_name, CSOTFParty_State_value) - proto.RegisterEnum("CTFLobbyMember_ConnectState", CTFLobbyMember_ConnectState_name, CTFLobbyMember_ConnectState_value) - proto.RegisterEnum("CSOTFLobby_State", CSOTFLobby_State_name, CSOTFLobby_State_value) - proto.RegisterEnum("CSOTFLobby_LobbyType", CSOTFLobby_LobbyType_name, CSOTFLobby_LobbyType_value) - proto.RegisterEnum("CMsgGameServerMatchmakingStatus_PlayerConnectState", CMsgGameServerMatchmakingStatus_PlayerConnectState_name, CMsgGameServerMatchmakingStatus_PlayerConnectState_value) - proto.RegisterEnum("CMsgGameServerMatchmakingStatus_Event", CMsgGameServerMatchmakingStatus_Event_name, CMsgGameServerMatchmakingStatus_Event_value) - proto.RegisterEnum("CMsgMvMVictoryInfo_GrantReason", CMsgMvMVictoryInfo_GrantReason_name, CMsgMvMVictoryInfo_GrantReason_value) - proto.RegisterEnum("CMsgRemovePlayerFromLobby_RemoveReason", CMsgRemovePlayerFromLobby_RemoveReason_name, CMsgRemovePlayerFromLobby_RemoveReason_value) - proto.RegisterEnum("CMsgGC_Match_Result_Status", CMsgGC_Match_Result_Status_name, CMsgGC_Match_Result_Status_value) -} - -var tf_fileDescriptor0 = []byte{ - // 8381 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xc4, 0x7c, 0x6b, 0x6c, 0x24, 0xc9, - 0x79, 0x98, 0x86, 0x6f, 0xd6, 0x72, 0xb9, 0xbd, 0xbd, 0x2f, 0x1e, 0xf7, 0xdd, 0x7b, 0x77, 0xe4, - 0x91, 0xdc, 0xd9, 0xe5, 0xe8, 0x74, 0x96, 0x56, 0x8f, 0x64, 0x38, 0x1c, 0x72, 0xc7, 0xc7, 0xd7, - 0xcd, 0x0c, 0xf7, 0x7c, 0x4e, 0xa2, 0x46, 0x73, 0xa6, 0x49, 0xb6, 0x38, 0x33, 0x3d, 0xea, 0xee, - 0x21, 0x97, 0x87, 0xc0, 0x90, 0x62, 0x24, 0x46, 0x80, 0x38, 0x89, 0x20, 0x3f, 0x22, 0xf9, 0x11, - 0xe7, 0xa5, 0x48, 0x06, 0x92, 0xfc, 0xc9, 0xbf, 0x04, 0x08, 0x82, 0xc4, 0x49, 0x9c, 0xa7, 0x6c, - 0x4b, 0x49, 0x64, 0xc7, 0x81, 0x2d, 0x58, 0x96, 0x65, 0x5b, 0x8e, 0x6d, 0x24, 0x40, 0x10, 0x38, - 0x52, 0xbe, 0xef, 0xab, 0xaa, 0xee, 0xea, 0x9e, 0xee, 0x21, 0xef, 0x70, 0x42, 0x6c, 0xe8, 0x96, - 0x53, 0xf5, 0xd5, 0x57, 0x5f, 0x7d, 0xf5, 0xbd, 0xab, 0xaa, 0xd9, 0x95, 0x60, 0xdf, 0x3c, 0x68, - 0xb4, 0x6d, 0xdf, 0xb7, 0x0e, 0x6c, 0x3f, 0xdf, 0xf5, 0xdc, 0xc0, 0x9d, 0xbd, 0xe2, 0x07, 0xb6, - 0xd5, 0x4e, 0x34, 0x5e, 0xdb, 0xb3, 0x7c, 0xbb, 0x0f, 0xd6, 0xf8, 0x01, 0x76, 0xb3, 0xb4, 0xe9, - 0x1f, 0xd4, 0xd7, 0xd6, 0xdd, 0x56, 0xd3, 0xee, 0xbc, 0xe9, 0xd9, 0x9d, 0xc6, 0xe1, 0x8a, 0xe7, - 0x5a, 0xcd, 0x86, 0xe5, 0x07, 0xfa, 0x35, 0x76, 0xf1, 0x84, 0x9a, 0xcc, 0x4e, 0xaf, 0xbd, 0x67, - 0x7b, 0x33, 0xb9, 0x7b, 0xb9, 0xf9, 0x51, 0xfd, 0x12, 0x1b, 0x6f, 0xda, 0x2d, 0x3b, 0xb0, 0x9b, - 0x33, 0x43, 0xd0, 0x30, 0xa1, 0x5f, 0x66, 0x93, 0x3d, 0xdf, 0xf6, 0xcc, 0x8e, 0xd5, 0xb6, 0x67, - 0x86, 0xa1, 0x69, 0xd2, 0x58, 0x61, 0x57, 0x39, 0xe6, 0x9a, 0xf5, 0xfc, 0xf9, 0x69, 0x84, 0xf2, - 0x06, 0xbb, 0xd4, 0xb0, 0x02, 0xfb, 0xc0, 0xf5, 0x4e, 0xe3, 0x48, 0x63, 0x38, 0x86, 0x08, 0x47, - 0x83, 0xdd, 0x46, 0x1c, 0xeb, 0x25, 0xc0, 0xd2, 0xb5, 0x1b, 0xce, 0xbe, 0xd3, 0xa8, 0x04, 0x76, - 0x3b, 0x42, 0x76, 0x9d, 0x4d, 0x3b, 0xd0, 0x60, 0x36, 0xed, 0x7d, 0xd3, 0xe9, 0x34, 0xed, 0xe7, - 0x84, 0xeb, 0x22, 0x4e, 0x72, 0x62, 0xf9, 0xd0, 0xec, 0x07, 0x5e, 0xaf, 0x11, 0x38, 0x6e, 0x27, - 0x9b, 0xd0, 0x2f, 0xe5, 0x98, 0x56, 0xaa, 0x6d, 0xd7, 0xd7, 0x56, 0x7b, 0x76, 0xab, 0xd6, 0x6b, - 0xb7, 0x2d, 0xef, 0x54, 0x9f, 0x61, 0xcc, 0x6a, 0x34, 0xdc, 0x5e, 0x27, 0x30, 0x9d, 0x26, 0x47, - 0xba, 0x32, 0xf2, 0xa9, 0x2f, 0xdc, 0xce, 0x21, 0x86, 0x26, 0x00, 0x9a, 0x27, 0x4e, 0xc7, 0x27, - 0xa4, 0x17, 0xf5, 0x2b, 0xec, 0x02, 0x35, 0xb5, 0x5c, 0xdf, 0xb7, 0x7d, 0x42, 0x7b, 0x51, 0xbf, - 0xc5, 0xae, 0xb6, 0x80, 0x44, 0x93, 0x7a, 0x14, 0x5c, 0x23, 0xd4, 0x7b, 0x93, 0x5d, 0x89, 0x7a, - 0x03, 0x07, 0x76, 0x25, 0xb0, 0xda, 0xdd, 0x99, 0x51, 0xea, 0x9c, 0x61, 0x5a, 0xd4, 0x09, 0x1d, - 0x41, 0xcf, 0x9f, 0x19, 0xc3, 0x1e, 0xc3, 0x06, 0xa6, 0x22, 0xa9, 0x9b, 0x56, 0xb7, 0xe4, 0x76, - 0x02, 0xcf, 0xd9, 0xeb, 0xe1, 0xe2, 0x06, 0x90, 0x7b, 0x03, 0xc8, 0x0d, 0x99, 0x33, 0xa4, 0x74, - 0xcc, 0x32, 0xbd, 0xa1, 0xa0, 0x30, 0x5b, 0xf6, 0xb1, 0xdd, 0xe2, 0xb4, 0x1b, 0xdf, 0xcf, 0x6e, - 0xf0, 0xbd, 0x7b, 0xe6, 0x06, 0xf6, 0xeb, 0x4e, 0xe3, 0x68, 0xc5, 0xea, 0xec, 0xb4, 0xac, 0x53, - 0xdb, 0xc3, 0x61, 0xd1, 0x4c, 0xa6, 0xdf, 0xdb, 0xfb, 0x84, 0xdd, 0x08, 0x04, 0xd7, 0x81, 0x0f, - 0x47, 0x00, 0x6c, 0x7a, 0xb6, 0xe5, 0x0b, 0x8e, 0x5f, 0x34, 0xbe, 0x9c, 0xe3, 0x9b, 0x98, 0x82, - 0xac, 0x6a, 0xfb, 0xbd, 0x56, 0x80, 0x9c, 0x52, 0x50, 0x3a, 0x1d, 0x27, 0x70, 0xac, 0xc0, 0xf5, - 0x04, 0xd2, 0xf4, 0x09, 0x87, 0xd2, 0x26, 0x1c, 0x96, 0x7b, 0x4f, 0x8d, 0x7e, 0xaf, 0xd1, 0x00, - 0x61, 0xdf, 0xef, 0xb5, 0x88, 0xe7, 0x13, 0x28, 0xcc, 0x20, 0x70, 0xe6, 0xa9, 0xed, 0x9b, 0xc7, - 0x40, 0x8a, 0x2f, 0xb8, 0x7d, 0x95, 0x4d, 0x61, 0x73, 0xc7, 0x15, 0xad, 0x63, 0x72, 0x5a, 0x6c, - 0xed, 0xc2, 0x96, 0x3a, 0x7b, 0x2d, 0x5b, 0xf4, 0x8d, 0xd3, 0x92, 0x4a, 0xec, 0x65, 0xbe, 0xa2, - 0x35, 0xcf, 0xb6, 0xeb, 0x9e, 0x63, 0xb5, 0x4a, 0x87, 0xae, 0xeb, 0xdb, 0x9b, 0xae, 0x1f, 0x3c, - 0xb5, 0x5b, 0x5d, 0x98, 0x72, 0xcd, 0x73, 0xec, 0x4e, 0x53, 0x7f, 0x81, 0x5d, 0x56, 0x88, 0xdf, - 0xa7, 0x46, 0xbe, 0x2e, 0x23, 0x2f, 0x79, 0x5c, 0xb5, 0x3f, 0xd9, 0x83, 0xed, 0xaf, 0xaf, 0x15, - 0xf8, 0x20, 0x1f, 0x97, 0x15, 0x8d, 0xf2, 0x01, 0x7e, 0x18, 0xe0, 0x5f, 0x63, 0x77, 0x33, 0xe0, - 0x81, 0x8d, 0x5d, 0xb7, 0xe3, 0xdb, 0xe9, 0xe3, 0x1e, 0xb1, 0x4b, 0x24, 0x32, 0x9c, 0xe5, 0x95, - 0xce, 0xbe, 0x8b, 0x0c, 0xa7, 0x15, 0xdb, 0x27, 0x26, 0x2a, 0x83, 0x6f, 0x1e, 0x02, 0xd1, 0xb6, - 0x24, 0xac, 0xc0, 0xae, 0xf3, 0x89, 0xea, 0x87, 0x56, 0xe7, 0xc8, 0x6e, 0xae, 0x9c, 0xd6, 0xdc, - 0xb6, 0xed, 0x76, 0x6c, 0x94, 0xcb, 0x80, 0xda, 0x3c, 0x93, 0x4c, 0x8c, 0x94, 0xb5, 0x11, 0xe3, - 0xba, 0x54, 0x76, 0x31, 0x46, 0x8c, 0x30, 0x1e, 0xb0, 0xfb, 0x49, 0x4e, 0xb9, 0x9d, 0x63, 0xdb, - 0x03, 0xcb, 0x51, 0x77, 0x77, 0x3c, 0xbb, 0xed, 0xf4, 0xda, 0xc6, 0x13, 0xd0, 0x3f, 0x00, 0x22, - 0x3b, 0x51, 0x3c, 0xb1, 0xbc, 0xa6, 0xdd, 0xd4, 0x35, 0x36, 0x21, 0xad, 0x84, 0x90, 0x03, 0xd8, - 0x26, 0x50, 0xb9, 0x8e, 0xd0, 0x5d, 0x54, 0xbd, 0x61, 0x50, 0xde, 0x32, 0xbb, 0x85, 0x63, 0xab, - 0x76, 0x17, 0x96, 0x57, 0xeb, 0xed, 0xb5, 0x9d, 0x00, 0x15, 0x03, 0xf8, 0x53, 0x06, 0xd9, 0x3e, - 0x45, 0x96, 0x9c, 0xba, 0xbd, 0xa0, 0xb7, 0x67, 0x9b, 0x3d, 0xaf, 0x45, 0xa8, 0x26, 0x63, 0xc8, - 0xb9, 0x90, 0x7e, 0x1f, 0x7b, 0x71, 0x10, 0x9a, 0x90, 0xc3, 0x60, 0xf8, 0x84, 0x58, 0x11, 0xaa, - 0x09, 0xe3, 0x87, 0xd8, 0x4c, 0x89, 0x8f, 0x2a, 0x59, 0x8d, 0x43, 0xbb, 0x29, 0x46, 0xad, 0x5a, - 0x81, 0x85, 0x96, 0x22, 0xd2, 0x6c, 0x04, 0x1f, 0x97, 0x52, 0x45, 0xc2, 0x64, 0x72, 0x1d, 0xb7, - 0x04, 0x0d, 0x28, 0xb7, 0xc7, 0x4e, 0xd3, 0x76, 0x4d, 0x1b, 0xa7, 0xa4, 0x1d, 0x1c, 0xc6, 0x1d, - 0x94, 0x83, 0xf6, 0x5b, 0xd6, 0x81, 0x32, 0x88, 0xec, 0x88, 0x71, 0x5b, 0xda, 0xef, 0x92, 0x0b, - 0xf3, 0x3b, 0x9d, 0x03, 0xb3, 0xd8, 0x04, 0xd6, 0xd2, 0x2f, 0xdb, 0x37, 0x0c, 0x76, 0x2f, 0xd1, - 0x5d, 0xb5, 0xdb, 0xee, 0xb1, 0xbd, 0xe6, 0xb9, 0x6d, 0x09, 0xf3, 0x31, 0x58, 0x42, 0x1c, 0x66, - 0x0d, 0xac, 0x05, 0xfd, 0xd0, 0x0d, 0x36, 0xdb, 0x27, 0xbf, 0x26, 0x18, 0xd6, 0x06, 0xf6, 0x0a, - 0x79, 0xf9, 0x78, 0xdf, 0x1c, 0xe1, 0x78, 0x55, 0x32, 0xf7, 0x01, 0x4b, 0x53, 0x19, 0x48, 0xb6, - 0x18, 0xd7, 0xd5, 0x72, 0x8e, 0x6c, 0x69, 0x49, 0x75, 0xc6, 0x08, 0x42, 0xb5, 0xcf, 0x3b, 0x52, - 0x51, 0xa2, 0x25, 0xfa, 0x47, 0x9c, 0xbc, 0x84, 0x6d, 0x08, 0x7a, 0xe0, 0xc2, 0xa4, 0x31, 0x02, - 0xd5, 0x13, 0x0d, 0xa6, 0xe3, 0x4b, 0xd5, 0x23, 0x27, 0x00, 0x42, 0x73, 0x37, 0x03, 0x63, 0x48, - 0x30, 0x5f, 0xb8, 0xdd, 0x0d, 0x38, 0xc5, 0x08, 0x63, 0x81, 0x25, 0x38, 0xe8, 0xb4, 0xe5, 0x0c, - 0x13, 0xc6, 0xdb, 0x5c, 0xf6, 0x14, 0x34, 0xf4, 0xc7, 0xf7, 0xbb, 0x4e, 0x67, 0x1d, 0xc8, 0xc7, - 0xf5, 0x7d, 0x02, 0xfe, 0x36, 0x0f, 0x70, 0x2d, 0x7c, 0xc9, 0xe0, 0xaf, 0x40, 0xe1, 0x40, 0x01, - 0x4c, 0xab, 0xd9, 0xf4, 0x50, 0x8c, 0x42, 0x43, 0x26, 0xda, 0xbb, 0xae, 0x17, 0x08, 0x43, 0x96, - 0xbe, 0x3a, 0xbe, 0xef, 0xb5, 0xbe, 0x7d, 0x0f, 0xe7, 0x86, 0x1f, 0xa8, 0xa9, 0xca, 0x50, 0x65, - 0xb7, 0x32, 0x90, 0x72, 0x2d, 0x78, 0x8d, 0xcd, 0x66, 0x21, 0x05, 0x95, 0xcc, 0xc4, 0x69, 0x7c, - 0xa0, 0x8f, 0x9f, 0x1b, 0xb0, 0xa7, 0xa5, 0x9e, 0x07, 0xa1, 0x43, 0xc0, 0x77, 0x0a, 0x36, 0x16, - 0xf7, 0x59, 0xdd, 0x7f, 0xe3, 0xa3, 0xd2, 0x38, 0x24, 0x84, 0x33, 0x36, 0x30, 0x7b, 0xd6, 0xdf, - 0xcc, 0x49, 0xfe, 0xbf, 0xd1, 0x03, 0x7b, 0x8f, 0x3a, 0x68, 0xd6, 0x1a, 0xae, 0x67, 0xd7, 0x88, - 0x93, 0xbe, 0xfe, 0x21, 0x50, 0x56, 0xfe, 0x27, 0x99, 0xc2, 0x0b, 0x85, 0xf9, 0xfc, 0x20, 0xf8, - 0x3c, 0xff, 0x17, 0x2d, 0xe4, 0xec, 0x5f, 0xcc, 0x31, 0x16, 0xfd, 0x4c, 0xd9, 0xb6, 0x5c, 0xda, - 0xb6, 0xf1, 0xbd, 0x14, 0x62, 0x4d, 0x96, 0x55, 0xec, 0x24, 0x18, 0x9c, 0xd0, 0x60, 0xe2, 0xfe, - 0x8d, 0x20, 0x50, 0xdb, 0x7a, 0x2e, 0x80, 0x46, 0xa5, 0xec, 0x53, 0x68, 0xe2, 0x23, 0x4d, 0xe4, - 0x85, 0x86, 0x8c, 0xaf, 0xe7, 0xb8, 0x61, 0xca, 0xa2, 0x39, 0x94, 0xd7, 0x62, 0x72, 0xad, 0x8f, - 0xf3, 0xe7, 0x19, 0xa7, 0xae, 0xf9, 0xe4, 0xdd, 0x2f, 0x19, 0x1a, 0x03, 0x37, 0xb0, 0x5a, 0x82, - 0x76, 0x5c, 0xf4, 0x50, 0xca, 0xa2, 0xc1, 0x01, 0xbb, 0x5d, 0x0c, 0x36, 0x7c, 0x01, 0x48, 0x0b, - 0x37, 0xde, 0x2f, 0x03, 0x84, 0x88, 0x56, 0xee, 0xac, 0xa4, 0x34, 0xeb, 0xfd, 0xd1, 0x8d, 0xb1, - 0xce, 0x15, 0x60, 0xbd, 0x64, 0xa2, 0xae, 0x71, 0xc2, 0xcd, 0x0d, 0x8c, 0x61, 0x88, 0x7c, 0xf0, - 0x16, 0x14, 0xd0, 0x40, 0x4c, 0x66, 0x35, 0x85, 0x6b, 0x9b, 0x20, 0x29, 0xa4, 0x56, 0x25, 0xc6, - 0xfc, 0x30, 0x17, 0xde, 0x38, 0xa2, 0x62, 0x2f, 0x38, 0x2c, 0x1d, 0x5a, 0xad, 0x96, 0xdd, 0x39, - 0x20, 0xbf, 0xd7, 0x90, 0x3f, 0x40, 0x65, 0x3c, 0xa0, 0x89, 0x7b, 0x12, 0xe3, 0x6f, 0x09, 0x19, - 0xec, 0x1f, 0x2d, 0x62, 0x1b, 0x58, 0xb2, 0x05, 0xbf, 0x40, 0x9c, 0x1d, 0x74, 0x39, 0x92, 0x10, - 0xf0, 0xc0, 0x68, 0x15, 0x4c, 0xc1, 0x4a, 0x70, 0x11, 0x9d, 0x26, 0x62, 0x1d, 0xa2, 0x48, 0x18, - 0x8c, 0x4f, 0x5a, 0xaf, 0x19, 0x78, 0x68, 0xc3, 0x86, 0x09, 0x06, 0xbc, 0x05, 0x98, 0xb5, 0x63, - 0xab, 0x75, 0x2c, 0xe1, 0x44, 0x94, 0x03, 0x2e, 0x4a, 0xc4, 0xf8, 0xc4, 0xde, 0x49, 0xe3, 0x13, - 0x6c, 0xee, 0x8c, 0x05, 0x86, 0x52, 0x74, 0x87, 0x5d, 0x57, 0x27, 0x4e, 0x32, 0x5d, 0xbf, 0xcb, - 0x6e, 0x1c, 0x5a, 0x3e, 0xb8, 0x39, 0xb3, 0x8f, 0x1f, 0x48, 0xf9, 0x14, 0x58, 0x90, 0x7b, 0xfd, - 0x73, 0x95, 0x20, 0x3c, 0x0b, 0xec, 0x0a, 0x1a, 0x1a, 0x27, 0x38, 0x4d, 0xdd, 0xcd, 0x5f, 0x1d, - 0x62, 0xf3, 0x67, 0x0d, 0x0c, 0xa9, 0x84, 0xa5, 0x4b, 0x04, 0x0d, 0x82, 0x90, 0x5c, 0xcd, 0x26, - 0x9f, 0x8b, 0x69, 0x82, 0xaf, 0x8e, 0x40, 0x6c, 0x06, 0xee, 0x91, 0xcd, 0xa3, 0xc7, 0x49, 0xfd, - 0x2d, 0x36, 0x26, 0x22, 0x6e, 0x64, 0xe7, 0x74, 0x61, 0x39, 0x7f, 0x5e, 0xba, 0xf2, 0xe5, 0x1a, - 0x0d, 0x7c, 0x72, 0xfd, 0x88, 0xff, 0x61, 0xae, 0xdb, 0x10, 0xae, 0x38, 0x8d, 0x35, 0xcb, 0x69, - 0xf5, 0x3c, 0xdb, 0x38, 0x66, 0xe3, 0x02, 0x04, 0xac, 0x70, 0x06, 0x90, 0xf6, 0x3e, 0x90, 0x8d, - 0x4b, 0xb2, 0xaf, 0xee, 0xba, 0x9b, 0x56, 0xe7, 0x54, 0xfb, 0xae, 0xfc, 0xbf, 0x9c, 0xda, 0xbb, - 0x05, 0x11, 0x94, 0x73, 0xec, 0x6b, 0xdf, 0x89, 0x7a, 0xaf, 0x44, 0xbd, 0x9c, 0xc8, 0xa6, 0x96, - 0x33, 0x96, 0x78, 0x40, 0x97, 0x50, 0x15, 0x07, 0xd2, 0xa7, 0xb4, 0xad, 0xf8, 0xd1, 0x21, 0x76, - 0x27, 0x1d, 0x3c, 0xdc, 0x80, 0x2d, 0xa6, 0xbb, 0x27, 0xe0, 0x12, 0x4c, 0x85, 0x9b, 0xd2, 0xee, - 0x14, 0xf2, 0x83, 0x07, 0xe7, 0xa3, 0x76, 0xc9, 0xc0, 0xd9, 0xcf, 0xe7, 0x98, 0xde, 0xdf, 0x7c, - 0xa6, 0x34, 0x0e, 0xde, 0x4e, 0xd2, 0xee, 0x4c, 0x45, 0x1b, 0x3e, 0x87, 0xa2, 0xa1, 0x00, 0x8c, - 0x1a, 0xc5, 0x34, 0xfb, 0x00, 0xab, 0xb1, 0x83, 0xf3, 0x12, 0x6a, 0xfc, 0x64, 0x2e, 0x4d, 0x05, - 0x63, 0x38, 0x42, 0xde, 0xce, 0xb3, 0x7b, 0xd9, 0x8b, 0x82, 0x44, 0x07, 0xc6, 0xbc, 0x77, 0xd2, - 0x2e, 0xc3, 0xc7, 0x84, 0x6d, 0x68, 0x1c, 0xed, 0xb8, 0x2d, 0xa7, 0x71, 0x6a, 0xac, 0xb1, 0x07, - 0x03, 0xba, 0x43, 0x9a, 0xa7, 0xd9, 0x98, 0x47, 0xe6, 0x4e, 0x6c, 0x8c, 0x62, 0x82, 0xb8, 0x8d, - 0x7d, 0x12, 0xae, 0xbf, 0xd4, 0x72, 0x30, 0x22, 0xdb, 0xf5, 0x05, 0xb6, 0x4d, 0xb7, 0x89, 0x59, - 0xbd, 0x85, 0x5e, 0x01, 0x53, 0x7b, 0x1c, 0x4b, 0x19, 0x7d, 0x98, 0x5a, 0xfc, 0xc9, 0x30, 0x7b, - 0x7c, 0xce, 0xc1, 0x66, 0x48, 0xd1, 0x4f, 0xe4, 0xd8, 0x45, 0x4f, 0xfc, 0x80, 0xa0, 0xa1, 0xc9, - 0xe3, 0xaf, 0xe9, 0xc2, 0x1b, 0xf9, 0x77, 0x8a, 0x0a, 0xb4, 0x3a, 0x15, 0x40, 0xf6, 0x3f, 0x59, - 0x3a, 0x1a, 0x0c, 0x60, 0x16, 0x5b, 0xa0, 0x89, 0xcd, 0xd3, 0x4a, 0x07, 0x26, 0x33, 0xfe, 0xe1, - 0x10, 0xbb, 0x7b, 0x06, 0x46, 0xfd, 0x31, 0x7b, 0x47, 0x38, 0xb5, 0x9c, 0xfe, 0x11, 0xf6, 0xc1, - 0xb3, 0x46, 0x6c, 0xb9, 0xc1, 0x76, 0xa7, 0xa8, 0xba, 0x22, 0x3e, 0x40, 0x1b, 0x3a, 0xcf, 0x7c, - 0xbc, 0xbb, 0x6a, 0x63, 0xee, 0xad, 0x0d, 0xeb, 0xcb, 0xec, 0xe1, 0x59, 0x23, 0x2a, 0x90, 0x07, - 0x79, 0x1d, 0xab, 0x55, 0xf6, 0x3c, 0xd7, 0xd3, 0x46, 0xf4, 0xd7, 0x58, 0xe1, 0xac, 0x21, 0xe5, - 0x63, 0xa0, 0x4d, 0xac, 0xac, 0xd8, 0x08, 0x9c, 0x63, 0x5b, 0x1b, 0x35, 0x7e, 0x34, 0xc7, 0x16, - 0xfb, 0x65, 0x30, 0x5b, 0x7e, 0x3e, 0xce, 0x2e, 0xb7, 0x95, 0x36, 0x33, 0x38, 0xed, 0xca, 0xcd, - 0xbf, 0x95, 0xb5, 0x97, 0x75, 0x80, 0x79, 0xf2, 0xd2, 0x51, 0x84, 0xbf, 0x4f, 0x1a, 0x9e, 0x82, - 0xb7, 0x73, 0x4f, 0x6c, 0xbb, 0x63, 0xfc, 0xd5, 0x11, 0xf6, 0xea, 0x3b, 0xa0, 0x27, 0x12, 0xc9, - 0xef, 0x31, 0x61, 0xfa, 0x97, 0x72, 0xec, 0xaa, 0x50, 0xf5, 0xb8, 0xe4, 0x0f, 0xd1, 0x1c, 0x7f, - 0x26, 0xff, 0x6e, 0xa8, 0xce, 0x22, 0x4c, 0xca, 0x83, 0xd0, 0x81, 0xfc, 0xd1, 0x79, 0xc0, 0xc0, - 0x72, 0x60, 0x46, 0x65, 0x37, 0x8d, 0x5f, 0xcc, 0xb1, 0x97, 0xce, 0x85, 0x59, 0x2f, 0xb0, 0x77, - 0x88, 0x1b, 0xb4, 0x21, 0x5b, 0xd4, 0x12, 0x63, 0xb6, 0x5c, 0x2c, 0x49, 0x95, 0x30, 0x92, 0x69, - 0x82, 0x1e, 0xbc, 0xca, 0x1e, 0x9f, 0x6f, 0x1c, 0x8e, 0x42, 0x7f, 0x0d, 0xa3, 0x86, 0x8d, 0xcf, - 0xe4, 0xd8, 0xa3, 0x7e, 0xd6, 0xa6, 0xe3, 0x29, 0x3f, 0xef, 0x3a, 0x1e, 0xa4, 0x52, 0xdf, 0x6b, - 0x21, 0x05, 0x87, 0x3a, 0x7f, 0x5e, 0x9a, 0xbe, 0xe7, 0x82, 0x09, 0xde, 0xc1, 0x22, 0x6d, 0x16, - 0xd9, 0xf7, 0x5b, 0xb2, 0xa8, 0x1b, 0xc1, 0x90, 0x2f, 0x04, 0x34, 0x4d, 0x22, 0x68, 0x92, 0xe5, - 0x9e, 0x53, 0x34, 0x31, 0x84, 0x7f, 0x9e, 0x52, 0xa5, 0x87, 0xfe, 0x7c, 0x9b, 0x0a, 0x22, 0x43, - 0x18, 0x00, 0xfa, 0x5d, 0xeb, 0xa4, 0x63, 0xb6, 0xed, 0xc0, 0x32, 0x1d, 0x88, 0xf7, 0x45, 0x61, - 0xee, 0xcf, 0xf1, 0x04, 0x36, 0x86, 0x7a, 0xdd, 0xb3, 0x3a, 0x01, 0xe1, 0x85, 0x58, 0xc0, 0xb3, - 0x1b, 0x4e, 0x97, 0x2c, 0x7f, 0x5f, 0x34, 0x01, 0xe9, 0x0a, 0xcf, 0x0d, 0x42, 0x07, 0x0a, 0xae, - 0x08, 0x6b, 0x2e, 0x07, 0x36, 0x8f, 0xb9, 0x27, 0x8c, 0x15, 0x66, 0x64, 0xa3, 0x0f, 0x45, 0x76, - 0xe0, 0x34, 0xc6, 0x9d, 0x30, 0x61, 0x88, 0x70, 0xe0, 0xf0, 0x52, 0xcb, 0x72, 0xda, 0xa0, 0x1a, - 0x9b, 0xe1, 0x1c, 0x3b, 0x90, 0x0c, 0xf5, 0xba, 0x24, 0x36, 0x2d, 0xe7, 0xc0, 0xd9, 0x73, 0x5a, - 0xe8, 0xbd, 0xdf, 0xe8, 0xd9, 0x5e, 0x6a, 0x0c, 0xcd, 0x33, 0xb3, 0x86, 0xdb, 0x69, 0xfa, 0xa6, - 0x75, 0xe0, 0x8a, 0x94, 0xfe, 0x90, 0x2d, 0x9c, 0x8d, 0x2e, 0x24, 0x3d, 0x0d, 0x2d, 0xd6, 0xdd, - 0x2c, 0xdf, 0xb4, 0x69, 0x50, 0x4b, 0x6c, 0x62, 0x8c, 0x5b, 0xbc, 0x66, 0xfc, 0x0d, 0x59, 0x46, - 0xdf, 0xb1, 0xbc, 0xe0, 0x74, 0xd3, 0xc6, 0xca, 0x3e, 0xd2, 0x04, 0x91, 0xa2, 0x6f, 0x82, 0xcb, - 0x39, 0xb2, 0x03, 0x31, 0x96, 0x2a, 0xcf, 0xed, 0x2e, 0x9d, 0x1f, 0x98, 0x6d, 0xc7, 0xf7, 0x31, - 0x23, 0x14, 0x99, 0x32, 0x0c, 0xd8, 0xb3, 0x9a, 0x90, 0x56, 0xf0, 0x72, 0x34, 0x2f, 0x96, 0x43, - 0x12, 0xe5, 0x7f, 0xb2, 0x67, 0x61, 0xf5, 0xd7, 0xeb, 0xb6, 0x7a, 0x3c, 0x61, 0x9e, 0x80, 0xb4, - 0x6c, 0x12, 0x52, 0xa0, 0x3d, 0xab, 0x03, 0xa1, 0xe8, 0xcc, 0x04, 0x36, 0x3d, 0x19, 0xdd, 0xb7, - 0x5a, 0x3e, 0x25, 0x6c, 0x34, 0x6d, 0x0b, 0x72, 0x57, 0xcc, 0x54, 0x2d, 0x48, 0x5f, 0x27, 0x69, - 0xcc, 0x6d, 0x36, 0xdd, 0x3d, 0x74, 0x3b, 0xb6, 0x09, 0x32, 0x0b, 0x02, 0x0b, 0x03, 0x99, 0x3a, - 0xf0, 0x3e, 0xd3, 0x83, 0x13, 0xd7, 0xdc, 0x07, 0x81, 0x75, 0x3d, 0xd3, 0xee, 0x58, 0xb0, 0xe2, - 0xe6, 0xcc, 0x05, 0x05, 0xc4, 0xf8, 0x4e, 0x8e, 0xd7, 0xa3, 0x36, 0xad, 0xa0, 0x71, 0x58, 0xb3, - 0x2d, 0xaf, 0x71, 0x58, 0xf2, 0x20, 0x64, 0xf1, 0x1c, 0x4b, 0x2f, 0x33, 0xad, 0x8d, 0xcd, 0x6d, - 0xeb, 0x08, 0xc3, 0xc8, 0x36, 0x9a, 0xdf, 0x71, 0xd2, 0xa4, 0x2b, 0xf9, 0xfa, 0x9a, 0xb9, 0x19, - 0xf5, 0x81, 0xbe, 0xd8, 0x4f, 0xae, 0xc7, 0xdb, 0xcc, 0xca, 0xd6, 0xb3, 0xe2, 0x46, 0x65, 0x95, - 0x92, 0x57, 0xf0, 0xd0, 0x26, 0x55, 0x8f, 0xdc, 0x23, 0xb1, 0x5c, 0x90, 0xfa, 0xf6, 0x71, 0xdb, - 0x6c, 0xc3, 0x7a, 0x7b, 0x5d, 0x88, 0xe2, 0x7a, 0x1e, 0xd1, 0x3e, 0x89, 0xe0, 0xd4, 0x21, 0x39, - 0x39, 0x89, 0x95, 0x51, 0xfd, 0x1e, 0x9b, 0xa1, 0x54, 0x7a, 0x1f, 0x16, 0xb2, 0xe7, 0x81, 0x18, - 0xe3, 0x0c, 0x9e, 0x73, 0x70, 0x18, 0xf0, 0x12, 0xf7, 0x04, 0x9e, 0x41, 0x7c, 0x32, 0xcc, 0xb8, - 0x29, 0x54, 0x24, 0xd5, 0x9f, 0x88, 0xce, 0x20, 0x88, 0x7b, 0x51, 0xcf, 0x05, 0xda, 0xe8, 0x6f, - 0x0b, 0x06, 0xf0, 0x04, 0x63, 0xdb, 0xdb, 0xed, 0x36, 0xe1, 0x5f, 0xda, 0x75, 0x08, 0x0c, 0x2e, - 0xf9, 0xc4, 0x12, 0xc8, 0xcc, 0x38, 0x4f, 0x48, 0x8a, 0x2e, 0x14, 0x66, 0xf2, 0x59, 0x3c, 0xc3, - 0x42, 0x03, 0x95, 0x09, 0x5a, 0xee, 0xde, 0xde, 0xa9, 0x94, 0xa7, 0xb1, 0xfe, 0x4d, 0xe7, 0xe9, - 0x6d, 0x95, 0x5d, 0x38, 0x71, 0xde, 0xb6, 0x3c, 0xac, 0x5d, 0xd9, 0xfc, 0xc0, 0x64, 0xba, 0x30, - 0x9b, 0xe0, 0xae, 0xf9, 0x26, 0x81, 0xd4, 0x00, 0xe2, 0xc9, 0xfd, 0xcc, 0xae, 0x90, 0xdf, 0xb7, - 0xd8, 0x74, 0x83, 0xc7, 0x83, 0x98, 0xc8, 0xe0, 0x61, 0x11, 0x9d, 0x01, 0x3c, 0x19, 0x59, 0x2e, - 0x14, 0x3e, 0x60, 0x7c, 0x56, 0xe4, 0xf8, 0x29, 0xeb, 0xc5, 0xca, 0xef, 0xe9, 0x99, 0xe1, 0x6f, - 0x92, 0xe6, 0xe1, 0xf7, 0x80, 0x66, 0xe3, 0xaf, 0x8c, 0x31, 0x16, 0xa9, 0x1b, 0x70, 0x71, 0xa2, - 0x8b, 0x7f, 0x84, 0x71, 0x73, 0x74, 0x5a, 0xd5, 0x82, 0x78, 0x8a, 0xe2, 0x7f, 0xa2, 0x66, 0x0c, - 0x95, 0xbc, 0x4d, 0xda, 0x19, 0x96, 0x98, 0xc7, 0x20, 0x57, 0x18, 0xe7, 0x6d, 0xfe, 0xcc, 0x45, - 0x4a, 0xe3, 0x2e, 0xe7, 0xfb, 0x74, 0x19, 0xe4, 0xaf, 0x6b, 0xf3, 0xfc, 0xc8, 0xe9, 0x1c, 0x3b, - 0xfc, 0x00, 0x05, 0x07, 0xbf, 0xc8, 0x46, 0x31, 0x65, 0xe6, 0x35, 0xab, 0xe9, 0xd8, 0xd0, 0x3c, - 0x26, 0xa3, 0xf6, 0x93, 0xa1, 0xdd, 0x4a, 0x92, 0x09, 0xb7, 0xdf, 0x8b, 0x8d, 0x03, 0x19, 0x87, - 0x99, 0x3d, 0xb2, 0x23, 0x0a, 0x24, 0x56, 0xdd, 0xb9, 0x47, 0xc0, 0x24, 0x88, 0x0b, 0x24, 0xb6, - 0x77, 0xa9, 0xaa, 0x04, 0x26, 0x03, 0xc4, 0xdd, 0x73, 0x7b, 0x5d, 0xd0, 0x1f, 0xac, 0xaf, 0xf7, - 0x4b, 0xe0, 0x4d, 0x62, 0x54, 0x9a, 0x36, 0xdf, 0x79, 0xe7, 0xda, 0x0c, 0x6a, 0x26, 0x74, 0x22, - 0xa6, 0xd4, 0x37, 0x64, 0x12, 0x27, 0x3a, 0x93, 0xba, 0x7d, 0x8f, 0x44, 0x27, 0x1a, 0x1c, 0x53, - 0xf1, 0xbb, 0xa4, 0xe2, 0x73, 0xec, 0xae, 0xe8, 0xcc, 0xd4, 0xf4, 0x59, 0x9a, 0x25, 0xe4, 0x82, - 0x99, 0xa6, 0xf0, 0xb7, 0x64, 0x6d, 0x27, 0x24, 0x33, 0xa1, 0xf7, 0xf7, 0x09, 0x00, 0x0d, 0x8a, - 0x67, 0x63, 0x8c, 0xce, 0x99, 0x6d, 0x82, 0x9b, 0x70, 0x5a, 0x26, 0x2a, 0xc3, 0x8c, 0x9e, 0x0e, - 0xa1, 0x38, 0x93, 0x2b, 0x64, 0x3b, 0xde, 0x64, 0xa3, 0x24, 0x11, 0xfa, 0x18, 0x03, 0x99, 0xd0, - 0xde, 0x07, 0xf2, 0x79, 0x71, 0xad, 0xb2, 0xb5, 0x5a, 0xd9, 0x5a, 0x37, 0x37, 0x8b, 0xf5, 0xd2, - 0x53, 0x08, 0xdf, 0xa6, 0xd8, 0x44, 0x65, 0x4b, 0xfc, 0x1a, 0xd2, 0x5f, 0x62, 0xf7, 0x8b, 0x6f, - 0x16, 0x2b, 0x75, 0x84, 0xa8, 0x96, 0x6b, 0xe5, 0xea, 0xb3, 0x62, 0xbd, 0xb2, 0xbd, 0x65, 0x96, - 0xb6, 0xb7, 0xd6, 0x2a, 0xd5, 0x4d, 0xfa, 0x01, 0x51, 0xd8, 0x3f, 0x8f, 0x79, 0x9f, 0x0a, 0xc9, - 0x27, 0x2a, 0x05, 0xed, 0x73, 0x8a, 0x52, 0xf8, 0x20, 0xc9, 0xaa, 0x52, 0x90, 0xf3, 0xa4, 0xa6, - 0xe8, 0xe4, 0x41, 0xcf, 0x47, 0x5a, 0x31, 0x42, 0x5a, 0x71, 0x3b, 0x9f, 0x9c, 0x23, 0xaf, 0x68, - 0xc8, 0xec, 0x47, 0xd9, 0x05, 0x55, 0x61, 0xa6, 0xd8, 0x48, 0x47, 0x96, 0xfe, 0x27, 0x63, 0xe5, - 0x50, 0x3e, 0x27, 0x06, 0x46, 0xc7, 0x16, 0xc8, 0xaf, 0xf0, 0xa0, 0x3f, 0x32, 0xc2, 0xa6, 0x4b, - 0xf5, 0xb5, 0x0d, 0x94, 0x42, 0x81, 0x42, 0x63, 0x43, 0x82, 0xf6, 0x31, 0x41, 0xfb, 0x23, 0x36, - 0x82, 0x58, 0x84, 0x11, 0xb9, 0x80, 0x82, 0x08, 0xce, 0xbd, 0x5e, 0x2e, 0x6e, 0x3e, 0xb9, 0x1a, - 0xfd, 0x6d, 0xae, 0x96, 0xd7, 0xca, 0x5b, 0xab, 0xe5, 0x6a, 0x0d, 0x72, 0xc3, 0x8b, 0x10, 0x14, - 0x74, 0x20, 0x71, 0x33, 0xb9, 0x96, 0x5e, 0x14, 0xa1, 0x5d, 0x7c, 0xaa, 0x7c, 0x89, 0x03, 0x71, - 0x85, 0x1d, 0x97, 0xc2, 0x2b, 0xd7, 0x30, 0x26, 0xd7, 0x00, 0x32, 0xec, 0xe0, 0xa1, 0x01, 0xb9, - 0x89, 0x21, 0xb2, 0x2f, 0x6e, 0xe7, 0x80, 0x37, 0x4d, 0x52, 0x53, 0x99, 0x5d, 0xa0, 0x14, 0x4e, - 0x4c, 0x77, 0x81, 0xa6, 0xd3, 0xf3, 0x62, 0xb6, 0x2a, 0x76, 0xf1, 0x49, 0x6e, 0xf5, 0x35, 0x99, - 0xbb, 0x40, 0x73, 0x69, 0xa3, 0x58, 0x2d, 0xaf, 0xe2, 0x5c, 0xa1, 0x45, 0x9b, 0x92, 0xe5, 0xe3, - 0xb8, 0x47, 0x98, 0x26, 0xe1, 0x4e, 0x84, 0x0c, 0x97, 0xc4, 0x61, 0xda, 0x94, 0x05, 0x91, 0x41, - 0x13, 0xe3, 0x59, 0xb4, 0x06, 0x1a, 0x19, 0xf4, 0xdc, 0x63, 0x3c, 0x16, 0xa2, 0x23, 0x34, 0xc9, - 0x13, 0xea, 0xbd, 0x4c, 0x63, 0x1e, 0xb0, 0x9b, 0xa0, 0x1e, 0x41, 0x40, 0xea, 0x43, 0x06, 0xdd, - 0x07, 0x4b, 0x67, 0x82, 0xd1, 0xb3, 0x5a, 0xc1, 0x29, 0xc9, 0xf8, 0x84, 0xd1, 0x60, 0x53, 0x2a, - 0xa7, 0xf4, 0x0b, 0x4c, 0xf2, 0x0a, 0xa4, 0xf9, 0x06, 0xbb, 0xa2, 0xca, 0xe8, 0x4e, 0x99, 0x24, - 0x9b, 0xcb, 0x34, 0xef, 0x28, 0xaf, 0x82, 0x4c, 0x5f, 0x64, 0x93, 0x20, 0xbe, 0x5b, 0xe5, 0x52, - 0x1d, 0x7e, 0x0e, 0xc3, 0x4a, 0xa7, 0x56, 0x2b, 0xb5, 0xa8, 0x65, 0xd4, 0xf8, 0x28, 0x7b, 0xa1, - 0x44, 0xac, 0xd9, 0xe1, 0x06, 0x57, 0x1e, 0x97, 0x63, 0xc9, 0x3d, 0x35, 0x48, 0x83, 0x6d, 0x22, - 0x3d, 0x44, 0xc1, 0x1a, 0x97, 0xa7, 0xb1, 0x18, 0x9d, 0x73, 0x8f, 0xeb, 0x1c, 0x74, 0xb6, 0x7b, - 0x81, 0xf1, 0x63, 0xe3, 0xc2, 0x67, 0x10, 0x6e, 0x54, 0x8f, 0xd0, 0xe2, 0xa9, 0xea, 0x71, 0x2f, - 0x12, 0xfb, 0x21, 0x12, 0xfb, 0x4b, 0x09, 0x59, 0x01, 0xa5, 0x9c, 0x6a, 0xd9, 0xfb, 0xa0, 0xe5, - 0x02, 0x6c, 0x3c, 0x1d, 0x2c, 0xe6, 0x7c, 0x2e, 0x90, 0xcc, 0x5f, 0x45, 0xd5, 0x13, 0xf5, 0x28, - 0x12, 0xaa, 0x31, 0xdc, 0x94, 0x14, 0xd7, 0xc2, 0xc8, 0xb5, 0x3c, 0x94, 0xae, 0x65, 0x44, 0x75, - 0x2d, 0x34, 0x87, 0x70, 0x2d, 0x17, 0x88, 0xab, 0xd5, 0x5a, 0xb9, 0xbe, 0xbb, 0x83, 0x9e, 0x57, - 0xec, 0x2b, 0xaf, 0x7d, 0x43, 0xfa, 0xc8, 0xf8, 0x12, 0xc9, 0x8e, 0x4d, 0x11, 0x92, 0x6b, 0x2a, - 0x12, 0xfa, 0x2f, 0x65, 0x33, 0xe3, 0x4a, 0xf4, 0x45, 0x91, 0xb9, 0xd9, 0x38, 0x04, 0x87, 0xef, - 0x93, 0xbe, 0xd0, 0x61, 0x25, 0x19, 0x44, 0xd2, 0x06, 0x8d, 0x90, 0xcf, 0x80, 0x3c, 0xca, 0x84, - 0xfb, 0x00, 0xa3, 0x86, 0x6b, 0x52, 0xc8, 0xfe, 0x34, 0x63, 0xbc, 0xf4, 0x46, 0xb4, 0x5f, 0xa7, - 0x69, 0x35, 0xa1, 0xaa, 0x94, 0x33, 0x11, 0xe9, 0xb3, 0xa2, 0xa1, 0xb8, 0x59, 0xae, 0xd5, 0x8b, - 0xf5, 0xb2, 0xc9, 0xff, 0x5b, 0xd9, 0xaa, 0xd4, 0xd1, 0x27, 0xe1, 0x21, 0x92, 0xdf, 0x85, 0xb5, - 0xe0, 0x65, 0x08, 0x9f, 0xfc, 0x05, 0x1d, 0x12, 0x91, 0x69, 0xe5, 0xfe, 0xeb, 0x05, 0x6a, 0x03, - 0x1f, 0x42, 0x0a, 0x07, 0x86, 0xce, 0xb3, 0xdb, 0x16, 0x9d, 0x99, 0x70, 0xb9, 0x9e, 0x25, 0x85, - 0x04, 0xee, 0xc2, 0x36, 0x20, 0x9d, 0x4d, 0x08, 0xb9, 0x1b, 0x58, 0x2f, 0xbf, 0x29, 0x9c, 0x8f, - 0xc6, 0x57, 0x2a, 0xa6, 0xc1, 0xc2, 0xe8, 0x5d, 0x8a, 0x75, 0x47, 0x02, 0xaf, 0x67, 0x63, 0xa0, - 0x8e, 0xc7, 0x27, 0xdc, 0x13, 0x84, 0xa2, 0x72, 0x9f, 0x36, 0xf2, 0x36, 0xbb, 0x16, 0xf5, 0xf9, - 0x80, 0x5d, 0x5e, 0xe6, 0x31, 0x64, 0xf8, 0xa8, 0x38, 0x33, 0xce, 0xb5, 0x05, 0x69, 0x43, 0xda, - 0x56, 0x97, 0xb7, 0xbc, 0x1c, 0xc6, 0xaf, 0xdc, 0xb1, 0xf1, 0xd6, 0x39, 0x6a, 0x05, 0xb5, 0xe6, - 0x4e, 0x84, 0x2f, 0xf5, 0x15, 0x91, 0x1e, 0x4c, 0xf0, 0x46, 0xa0, 0x03, 0x5d, 0xf1, 0x08, 0x72, - 0xfb, 0x0a, 0x1a, 0x1c, 0xf2, 0x69, 0x3e, 0x28, 0xea, 0xcc, 0x03, 0xd2, 0x81, 0x6d, 0xe9, 0x69, - 0x2e, 0x31, 0x55, 0x44, 0x40, 0x17, 0xc7, 0xd9, 0x70, 0x75, 0x77, 0x0b, 0xd4, 0x10, 0x94, 0x72, - 0x67, 0xbb, 0x56, 0x47, 0xfe, 0x83, 0x16, 0xc2, 0xaf, 0xad, 0xed, 0x7a, 0xb5, 0x5c, 0x5c, 0x7d, - 0x4b, 0x1b, 0x45, 0x9d, 0xe4, 0xa3, 0x8a, 0xb5, 0x5a, 0x65, 0x7d, 0x4b, 0x1b, 0x33, 0x7e, 0x80, - 0x4d, 0x86, 0xc2, 0x02, 0x24, 0x87, 0x5a, 0xaf, 0xd4, 0xe6, 0x27, 0xd9, 0x28, 0x77, 0x5b, 0xef, - 0x23, 0xdc, 0xd5, 0x62, 0xa9, 0x5e, 0x29, 0x95, 0x61, 0xca, 0x69, 0xc6, 0xea, 0xdb, 0xbb, 0xd5, - 0x2d, 0x98, 0x69, 0xab, 0xce, 0x67, 0xae, 0xef, 0xd6, 0xb7, 0xab, 0x95, 0xe2, 0x06, 0xf8, 0xae, - 0x6b, 0xec, 0x0a, 0xaa, 0x6b, 0xf9, 0xb9, 0x13, 0x28, 0xf1, 0x03, 0xe4, 0xc9, 0x74, 0x2d, 0x82, - 0x17, 0x36, 0x84, 0x47, 0xd3, 0x92, 0x61, 0x1e, 0x19, 0x45, 0x74, 0x08, 0x4e, 0x93, 0xef, 0x90, - 0xf0, 0x2d, 0xfd, 0x21, 0xed, 0xb0, 0x12, 0xd2, 0x3e, 0xe2, 0x47, 0xfe, 0x2a, 0x6a, 0xf5, 0xa8, - 0x9e, 0x1b, 0xbf, 0xa8, 0x6e, 0x3a, 0x6a, 0x6c, 0xb1, 0x0b, 0xfc, 0x7e, 0x04, 0x88, 0xd9, 0x6e, - 0x57, 0xff, 0x53, 0x52, 0x2d, 0x73, 0xef, 0xce, 0xb8, 0xcb, 0x7b, 0x21, 0xca, 0x72, 0x45, 0x56, - 0x80, 0x66, 0x4d, 0x5c, 0x70, 0x31, 0x9e, 0xf2, 0x54, 0x38, 0x0b, 0x28, 0x3a, 0xa9, 0x1f, 0x10, - 0xe1, 0xf1, 0x3b, 0x30, 0xf7, 0xf8, 0x91, 0x06, 0x5e, 0x3e, 0xb2, 0x9b, 0x78, 0xf7, 0x41, 0xc1, - 0x09, 0x19, 0x70, 0xcf, 0x36, 0x3e, 0x20, 0xcf, 0xd3, 0xb9, 0xa9, 0xe5, 0xd5, 0x1d, 0xbc, 0x47, - 0x41, 0xd6, 0x04, 0xd5, 0x71, 0x9f, 0x9a, 0xf8, 0x79, 0xa2, 0x38, 0xed, 0x18, 0x33, 0x3e, 0x97, - 0x63, 0xd7, 0xf8, 0x38, 0x3c, 0xab, 0x2c, 0x1d, 0x5a, 0x01, 0xfc, 0x0f, 0x86, 0xb4, 0x50, 0xa8, - 0xbb, 0x00, 0xe7, 0x76, 0x2c, 0x53, 0x09, 0x02, 0xa0, 0xb5, 0xc1, 0x01, 0x94, 0x23, 0x48, 0xbe, - 0xab, 0xbe, 0x7f, 0xe2, 0x7a, 0x4d, 0x11, 0x79, 0xac, 0x44, 0x70, 0x64, 0xb9, 0x46, 0x04, 0x9f, - 0x95, 0x19, 0x50, 0x0e, 0xcd, 0xe0, 0xc9, 0x4c, 0xb2, 0xa9, 0x4a, 0xb6, 0xc8, 0x6a, 0x19, 0x79, - 0x79, 0x8f, 0x67, 0x03, 0x95, 0x3f, 0x41, 0x5b, 0x8c, 0x0a, 0x7e, 0x96, 0xf9, 0xf5, 0xf0, 0xa2, - 0x56, 0x62, 0x2d, 0x21, 0xab, 0x81, 0x4e, 0x59, 0x5a, 0x8c, 0x8a, 0x03, 0x29, 0xeb, 0xc1, 0x5b, - 0x1c, 0xa2, 0x35, 0x4c, 0xe7, 0x48, 0x9d, 0x9f, 0x9b, 0x51, 0x3c, 0x85, 0xc3, 0x9f, 0x44, 0x9e, - 0x66, 0x94, 0x5c, 0xc8, 0x2b, 0xf9, 0x81, 0x14, 0xd0, 0xfa, 0x45, 0xb0, 0xf5, 0x2a, 0xf8, 0xb2, - 0xf0, 0x57, 0x2c, 0xba, 0xca, 0x09, 0x4f, 0x13, 0xdf, 0x00, 0x7e, 0x12, 0xf1, 0x83, 0xf2, 0xce, - 0xc0, 0x76, 0x70, 0xc8, 0x0f, 0x98, 0xed, 0xa6, 0xca, 0x9a, 0x38, 0xe9, 0x03, 0x30, 0xc5, 0x66, - 0xa4, 0x25, 0x1a, 0x2b, 0xf2, 0xfa, 0x04, 0xe1, 0xde, 0x00, 0x07, 0x79, 0x16, 0xe6, 0xbe, 0x98, - 0xd0, 0xb8, 0x9f, 0xb8, 0xe5, 0xb5, 0x6a, 0xef, 0x5b, 0xa0, 0x8b, 0x0a, 0x22, 0xa3, 0xc6, 0x0f, - 0x53, 0x06, 0x80, 0x84, 0x1b, 0x96, 0xba, 0xd1, 0x09, 0x4a, 0xf8, 0xbc, 0x77, 0x24, 0x5f, 0x04, - 0x52, 0x05, 0x1b, 0x9e, 0xde, 0x19, 0xdf, 0x0a, 0x2f, 0x22, 0xa4, 0x03, 0x84, 0x53, 0x96, 0xd8, - 0x84, 0x40, 0x2e, 0x4f, 0x04, 0x97, 0xf3, 0xe7, 0x19, 0xa8, 0x8a, 0xf6, 0xec, 0x9f, 0x07, 0x73, - 0x73, 0x96, 0xbc, 0xa2, 0x44, 0xa1, 0x8b, 0x8c, 0x42, 0x15, 0x94, 0xa8, 0xa4, 0xe2, 0x0c, 0xbf, - 0x0b, 0xc5, 0xf9, 0xdf, 0xe3, 0xe2, 0xc8, 0x2f, 0xaa, 0x6e, 0x2a, 0x26, 0x88, 0x1f, 0xe0, 0xde, - 0x0a, 0xaf, 0x47, 0x48, 0xfb, 0xaa, 0x45, 0xf6, 0x15, 0x72, 0xdd, 0xcb, 0x6a, 0xe6, 0xa8, 0xda, - 0xca, 0x1b, 0xf9, 0x54, 0x94, 0xf6, 0x93, 0x3b, 0xe9, 0xed, 0x61, 0x1a, 0x99, 0x96, 0x8d, 0x0e, - 0xbd, 0xf3, 0x6c, 0xf4, 0x02, 0x1b, 0x06, 0xf7, 0x2b, 0xcc, 0x0c, 0x84, 0x8d, 0x81, 0x75, 0xc0, - 0xb5, 0x71, 0x12, 0x43, 0x9c, 0x3d, 0x17, 0xcd, 0x3e, 0x98, 0x57, 0x71, 0x27, 0xa5, 0x3f, 0x0c, - 0x19, 0x93, 0x65, 0x3a, 0xd4, 0x66, 0x61, 0x6e, 0x45, 0xae, 0x0d, 0x72, 0xe5, 0xb7, 0xdc, 0x00, - 0x2f, 0x5b, 0xd9, 0xb2, 0x8c, 0x74, 0x2d, 0x19, 0x23, 0x4d, 0x4a, 0xbc, 0xa2, 0x19, 0xed, 0xa9, - 0x75, 0x7c, 0x40, 0xa5, 0xac, 0x21, 0xa5, 0x1d, 0x02, 0x10, 0x3f, 0x90, 0xb5, 0x37, 0x0c, 0x27, - 0x44, 0x7b, 0xd3, 0x6e, 0x8a, 0x9b, 0x14, 0x53, 0xd4, 0x33, 0x8d, 0xe7, 0xf5, 0x9e, 0x03, 0x11, - 0x1f, 0x0f, 0xe2, 0x3f, 0xc8, 0xc6, 0x25, 0x55, 0xbc, 0x92, 0x31, 0x97, 0x3f, 0x63, 0x2f, 0xf3, - 0xe2, 0x66, 0x6b, 0x3c, 0x68, 0x9b, 0x7e, 0x17, 0x41, 0xdb, 0x87, 0xd9, 0x28, 0x65, 0xbf, 0x94, - 0x83, 0x4c, 0x17, 0x5e, 0x3e, 0x73, 0x66, 0x3a, 0xf1, 0x7a, 0x32, 0xb2, 0x85, 0x97, 0x2b, 0x31, - 0x2e, 0x82, 0x14, 0xff, 0x04, 0x6c, 0xb5, 0x48, 0xa7, 0x6f, 0xb1, 0xab, 0xd8, 0xd2, 0xf0, 0x60, - 0xc9, 0xc0, 0x55, 0xab, 0x01, 0xd9, 0x09, 0xfc, 0xcd, 0x53, 0x69, 0xac, 0x0c, 0xa8, 0xbd, 0x4d, - 0xcf, 0xed, 0xe2, 0x1d, 0xce, 0xab, 0xd4, 0x79, 0x9f, 0xbd, 0xe0, 0x1f, 0x39, 0xad, 0x96, 0x47, - 0x41, 0x1d, 0x56, 0x06, 0x1a, 0xb6, 0x89, 0x21, 0x20, 0x16, 0xa5, 0xae, 0x65, 0x16, 0xf8, 0x30, - 0x52, 0xbd, 0x38, 0xeb, 0xb2, 0x31, 0xc1, 0x92, 0x7e, 0xab, 0x5a, 0x4b, 0x66, 0x93, 0x5c, 0x04, - 0xdf, 0x7f, 0x4e, 0x26, 0xa7, 0x26, 0x99, 0xc6, 0xc7, 0x98, 0xde, 0xdf, 0x1d, 0xcf, 0xac, 0x62, - 0x29, 0x53, 0x22, 0x9f, 0x82, 0x40, 0x61, 0x94, 0x38, 0xa9, 0x4f, 0x30, 0xe2, 0x25, 0xc0, 0x43, - 0xc4, 0xb5, 0x79, 0xbc, 0xf9, 0xcc, 0xc1, 0x3a, 0xee, 0x29, 0x0c, 0x80, 0xf1, 0xf0, 0x1b, 0x4c, - 0x25, 0x84, 0xf4, 0x1a, 0xca, 0x99, 0x5e, 0x6c, 0x1c, 0x75, 0xdc, 0x13, 0x70, 0xe9, 0x07, 0x36, - 0x9f, 0xdc, 0x87, 0x50, 0xec, 0x2f, 0x8d, 0x2a, 0xc5, 0x5d, 0x4e, 0xff, 0x8e, 0xe7, 0x1e, 0xe0, - 0xfd, 0x27, 0xba, 0xcb, 0x7b, 0x7c, 0x00, 0x1b, 0xe4, 0xf0, 0xac, 0x11, 0xef, 0xcf, 0x0a, 0x3f, - 0x76, 0x97, 0xdd, 0x88, 0x77, 0x51, 0x91, 0x07, 0xcb, 0x3d, 0x91, 0x1e, 0x9d, 0x62, 0x1c, 0x1c, - 0x42, 0x08, 0x3d, 0x5a, 0x62, 0x2f, 0x92, 0x52, 0xe3, 0x26, 0x81, 0xfb, 0x6f, 0x35, 0x4f, 0x9c, - 0x26, 0x9e, 0xd8, 0x27, 0xe2, 0x19, 0xa1, 0x4c, 0x8b, 0xec, 0x41, 0x08, 0xdd, 0x01, 0x18, 0x13, - 0x70, 0xa6, 0x00, 0x73, 0x15, 0x7b, 0x85, 0xdd, 0xe7, 0x77, 0xb2, 0x06, 0xe1, 0xbd, 0x48, 0xa0, - 0xf3, 0xec, 0x1e, 0x07, 0x1d, 0x80, 0x74, 0x5a, 0x22, 0x4d, 0xa1, 0x97, 0x1f, 0xef, 0x84, 0xa0, - 0x97, 0x24, 0xd2, 0x7e, 0x62, 0x13, 0x90, 0x64, 0x33, 0xf5, 0x97, 0xd9, 0x9d, 0x24, 0xa5, 0x09, - 0x38, 0xae, 0xda, 0x2f, 0xb1, 0xdb, 0x09, 0x32, 0x13, 0x60, 0xfa, 0x00, 0x9e, 0xda, 0xed, 0x6e, - 0xc0, 0x8b, 0x5e, 0xf2, 0xbe, 0xca, 0x95, 0x6c, 0x9e, 0xf6, 0x03, 0x5f, 0xcd, 0xe2, 0x69, 0x3f, - 0xe8, 0xb5, 0x0c, 0x9e, 0xf6, 0x43, 0x5e, 0x97, 0xb6, 0xb4, 0xe7, 0x1d, 0xd8, 0x9d, 0xc6, 0xa9, - 0xd9, 0x95, 0x57, 0xe9, 0x8d, 0x7f, 0x31, 0xc2, 0x74, 0x12, 0xc4, 0x50, 0x88, 0xe9, 0x5a, 0xdb, - 0x62, 0x64, 0xdd, 0xb8, 0x73, 0x9d, 0xcd, 0xf7, 0x43, 0x49, 0x83, 0x86, 0xf7, 0x8f, 0xc3, 0xe4, - 0x6b, 0x28, 0x35, 0xd5, 0x22, 0x37, 0x30, 0xfb, 0xe9, 0x1c, 0x1b, 0xa1, 0x13, 0xb2, 0x8f, 0xb1, - 0xa9, 0x03, 0x3c, 0xcf, 0x92, 0x17, 0xea, 0xb9, 0xcb, 0xba, 0x9b, 0x36, 0x07, 0x9d, 0x7b, 0x55, - 0x09, 0x2c, 0x4a, 0x9d, 0x61, 0x46, 0xfe, 0x1c, 0xc3, 0x0a, 0x2c, 0x7e, 0x23, 0x0c, 0x37, 0x37, - 0x56, 0xb4, 0x31, 0x1b, 0x74, 0xd0, 0xa5, 0xdc, 0x20, 0xa7, 0xe0, 0x69, 0xf6, 0x8f, 0x73, 0x03, - 0xac, 0x0e, 0x78, 0x11, 0x5e, 0xe2, 0x21, 0xea, 0xe4, 0x79, 0x1c, 0x26, 0xbe, 0xbc, 0xb9, 0x2b, - 0x74, 0xd4, 0xec, 0x51, 0x6d, 0xbe, 0x19, 0x5d, 0xf8, 0x57, 0x2a, 0x43, 0xd0, 0x3c, 0x9a, 0x56, - 0x30, 0x1a, 0x93, 0xe6, 0x34, 0x81, 0x6b, 0x0f, 0xcc, 0xaa, 0xf0, 0x6c, 0x73, 0x6c, 0x14, 0xd7, - 0x85, 0x7a, 0x38, 0x1c, 0x1d, 0x66, 0xc4, 0x19, 0x42, 0x0c, 0xc4, 0x3b, 0xdc, 0x6e, 0xaf, 0x01, - 0xe1, 0x1f, 0xaf, 0xd5, 0x42, 0x42, 0xcd, 0xcf, 0x9d, 0x80, 0xf1, 0x02, 0x3d, 0x58, 0x86, 0xc0, - 0x27, 0x77, 0x87, 0x57, 0xa7, 0x2f, 0x28, 0x7c, 0x8c, 0x5b, 0xbc, 0xcb, 0xec, 0xe2, 0x4a, 0x71, - 0x75, 0xbd, 0x6c, 0x6e, 0x94, 0x9f, 0x95, 0x37, 0xc8, 0xea, 0x41, 0x53, 0xed, 0x8d, 0xdd, 0xe2, - 0xaa, 0x59, 0xdb, 0xad, 0xee, 0x6c, 0xec, 0xd6, 0xc0, 0x90, 0xc1, 0x90, 0xcd, 0xe2, 0xd6, 0x96, - 0x09, 0x99, 0xed, 0x30, 0xa6, 0xba, 0x4f, 0xcb, 0x1b, 0x3b, 0x66, 0xd1, 0xdc, 0xda, 0xde, 0x5e, - 0xd1, 0x46, 0x0c, 0x0b, 0xb2, 0x93, 0x75, 0x1e, 0x7d, 0x3d, 0xb5, 0x21, 0xd3, 0x0f, 0xa3, 0x34, - 0xe0, 0x8c, 0x88, 0x5b, 0xb0, 0xca, 0xd1, 0x38, 0x12, 0xe1, 0x3c, 0xf8, 0x84, 0x58, 0xb3, 0xdf, - 0x6b, 0x53, 0x09, 0x68, 0x84, 0x16, 0x26, 0x7a, 0xe0, 0xdf, 0x3d, 0xd7, 0xb7, 0x45, 0xd1, 0xf2, - 0x33, 0x39, 0x36, 0x25, 0xe7, 0xa8, 0x9d, 0x76, 0x1a, 0xa9, 0x38, 0x72, 0x24, 0x0a, 0x7d, 0x93, - 0x0e, 0xa5, 0x4e, 0x6a, 0xda, 0xcf, 0xc5, 0x61, 0x20, 0x58, 0xdc, 0x64, 0x4f, 0x21, 0x7a, 0x3f, - 0x93, 0x9c, 0x05, 0xc7, 0x8d, 0xd2, 0x2d, 0xc4, 0x8f, 0xb3, 0x69, 0x95, 0xa4, 0xf2, 0xf3, 0x4c, - 0xa2, 0x26, 0xb3, 0x10, 0x0d, 0xa5, 0x53, 0xcc, 0xd7, 0xfc, 0x1b, 0x39, 0x98, 0x20, 0x26, 0x01, - 0xf4, 0xda, 0xc7, 0x3e, 0xb0, 0x40, 0x87, 0xa5, 0x7e, 0xa9, 0xcf, 0x91, 0xf0, 0xe1, 0x84, 0xd4, - 0x44, 0x51, 0xe4, 0x17, 0x05, 0xaa, 0xa4, 0x42, 0xf2, 0x3a, 0xeb, 0x5c, 0xa4, 0xe6, 0xbc, 0x02, - 0x77, 0x3d, 0x21, 0x71, 0xf9, 0x48, 0x55, 0x62, 0xc7, 0x66, 0x23, 0x18, 0x84, 0xf1, 0x0a, 0x3c, - 0x79, 0x19, 0x64, 0xd6, 0xf8, 0xec, 0xf2, 0x60, 0xd5, 0x8a, 0x17, 0x55, 0xf9, 0x21, 0xfd, 0x22, - 0x7b, 0x41, 0xcc, 0xb8, 0x09, 0xe4, 0xee, 0x76, 0xc5, 0xbc, 0xa9, 0x07, 0x5e, 0x90, 0x91, 0xcc, - 0xc6, 0xdd, 0x3f, 0x26, 0xda, 0x20, 0xfb, 0xbc, 0xcc, 0x08, 0xbb, 0x28, 0x42, 0x06, 0x48, 0x9f, - 0x55, 0xeb, 0x35, 0xa6, 0xcf, 0x42, 0xb4, 0x4e, 0xa7, 0x6a, 0x26, 0x55, 0x35, 0xf8, 0xdc, 0xbc, - 0xf8, 0x64, 0xbc, 0xc6, 0xb3, 0x7f, 0x4a, 0x5e, 0x11, 0x73, 0xb1, 0xd3, 0xdc, 0xf1, 0x6c, 0x80, - 0xb3, 0xeb, 0x2e, 0xe6, 0x6d, 0xfc, 0xdc, 0x2b, 0x59, 0x10, 0x19, 0x33, 0x7e, 0x21, 0xc7, 0x49, - 0xe7, 0x77, 0xc9, 0x45, 0x3a, 0x0f, 0x29, 0x3f, 0x27, 0xa6, 0x9f, 0x01, 0x15, 0xbc, 0x29, 0x86, - 0xa0, 0xea, 0xb3, 0xa5, 0x69, 0x11, 0x36, 0xa6, 0x22, 0xc9, 0xf3, 0x56, 0x61, 0xfc, 0x26, 0x9f, - 0x6d, 0x43, 0xfc, 0xf7, 0x7a, 0xa5, 0xf4, 0xba, 0xf1, 0x3a, 0x9b, 0x52, 0xbb, 0x30, 0xe8, 0x08, - 0x3b, 0x79, 0x0c, 0x53, 0x59, 0xdd, 0x10, 0x3f, 0xa9, 0x28, 0x54, 0x5c, 0xdd, 0xac, 0x6c, 0xf1, - 0xdf, 0x54, 0x15, 0xc6, 0xa8, 0xd2, 0xdc, 0x7e, 0x56, 0xae, 0x42, 0x28, 0xb2, 0xc8, 0x23, 0x91, - 0x9a, 0x1d, 0xd0, 0xa4, 0x35, 0x6b, 0x1f, 0x16, 0x4e, 0xdc, 0x88, 0xed, 0x3a, 0x5f, 0xf4, 0x3f, - 0x16, 0xb9, 0x7b, 0x74, 0xa7, 0x80, 0x6f, 0xc4, 0x8a, 0xeb, 0xfb, 0x3c, 0x34, 0x82, 0x7d, 0xe6, - 0x72, 0x41, 0xe1, 0xbd, 0x2d, 0x5f, 0x57, 0xc5, 0xde, 0xa8, 0x84, 0xf7, 0xd7, 0x41, 0xbf, 0xfd, - 0x28, 0x7f, 0xa2, 0xc8, 0x9e, 0x9a, 0xd4, 0x43, 0xf9, 0x48, 0xd0, 0x10, 0x2e, 0x7c, 0xb8, 0x26, - 0x2b, 0x30, 0x4e, 0xe7, 0xd8, 0x6d, 0x1d, 0xdb, 0x4d, 0x61, 0x5e, 0x41, 0xce, 0xed, 0x96, 0xd5, - 0xf5, 0x41, 0x04, 0xc2, 0xd3, 0xb9, 0x21, 0xe3, 0xc7, 0x47, 0xb9, 0xe4, 0x44, 0x64, 0x6f, 0x42, - 0x88, 0xea, 0xb7, 0x7b, 0x7e, 0xe1, 0xf1, 0x72, 0x21, 0x8b, 0x66, 0x08, 0xa6, 0x28, 0xc8, 0xf2, - 0xe9, 0x9d, 0x8e, 0x7c, 0x84, 0x38, 0x9e, 0x76, 0x25, 0x7a, 0x58, 0x5e, 0xfb, 0xee, 0x23, 0x1f, - 0x33, 0x0d, 0xbc, 0x43, 0x02, 0x04, 0x1d, 0xda, 0x56, 0x2b, 0x38, 0x8c, 0x96, 0x10, 0x15, 0x51, - 0x45, 0xcf, 0x98, 0xe4, 0x4b, 0xcb, 0xd9, 0xb7, 0xd5, 0xd3, 0x45, 0x42, 0xdc, 0xde, 0x33, 0x31, - 0xd4, 0x96, 0x41, 0x1a, 0x9e, 0x24, 0x05, 0xd6, 0xfe, 0xbe, 0x68, 0x9c, 0x94, 0x63, 0xbb, 0xc7, - 0x5d, 0xd1, 0xc4, 0x24, 0x01, 0xe0, 0x6a, 0xba, 0x87, 0x3d, 0xa1, 0xab, 0xcb, 0xfc, 0x78, 0xbd, - 0xaf, 0xbd, 0x40, 0x89, 0x0e, 0xa1, 0x68, 0xb6, 0x0f, 0xf0, 0xe2, 0x7c, 0x2f, 0x10, 0x71, 0x1b, - 0x4c, 0x4f, 0x4d, 0x1d, 0xa7, 0x0b, 0x6b, 0x9d, 0x0e, 0xdf, 0x22, 0x62, 0x9b, 0xdb, 0x6a, 0x3a, - 0xd0, 0x78, 0x49, 0xde, 0x6d, 0xc1, 0xc6, 0x26, 0x08, 0xa7, 0x88, 0xb9, 0x04, 0xb6, 0x36, 0x66, - 0x53, 0x22, 0xbc, 0x12, 0x4d, 0xb0, 0xe6, 0xe3, 0x53, 0x11, 0x4a, 0x89, 0x71, 0xdd, 0x53, 0xcf, - 0x15, 0xe1, 0x12, 0xbe, 0xfc, 0x44, 0xf4, 0xdd, 0x53, 0x11, 0x12, 0xc1, 0xc6, 0x62, 0x83, 0xdd, - 0x39, 0x70, 0x3a, 0x36, 0x4c, 0x78, 0x2d, 0x64, 0x02, 0x12, 0x2a, 0x92, 0xc9, 0xeb, 0x12, 0x94, - 0x93, 0x2a, 0x5a, 0x6f, 0x84, 0x19, 0xa2, 0xdb, 0x72, 0x9a, 0x61, 0xf3, 0x4c, 0xb8, 0x36, 0x20, - 0x57, 0xb4, 0xbd, 0x10, 0x66, 0x9d, 0x48, 0xb0, 0x68, 0x9c, 0x95, 0x8d, 0x44, 0xb2, 0x68, 0xbc, - 0x29, 0x47, 0x23, 0xd1, 0xa2, 0xed, 0x96, 0x5c, 0x1f, 0x90, 0x2d, 0x9a, 0x6e, 0x4b, 0x5e, 0x4b, - 0xc2, 0x45, 0xfb, 0x1d, 0x32, 0x68, 0x9f, 0x13, 0xd5, 0x0e, 0x7e, 0xd4, 0x1f, 0x4a, 0xa7, 0x14, - 0xce, 0x0d, 0xd7, 0x0d, 0xe8, 0xa9, 0x81, 0xfe, 0xd1, 0x64, 0x3c, 0xb6, 0x94, 0x3f, 0xcf, 0x38, - 0x69, 0xbe, 0x61, 0xfe, 0xb6, 0xe8, 0x13, 0xc2, 0x49, 0x2a, 0x38, 0x3b, 0x9b, 0x6d, 0xb0, 0x0d, - 0x83, 0x5d, 0x2e, 0x15, 0x03, 0xfe, 0x6e, 0xd3, 0x36, 0x6b, 0x74, 0xfb, 0x1e, 0x6c, 0xc7, 0x28, - 0xc8, 0x7d, 0x4f, 0x96, 0xf2, 0xfe, 0x41, 0x8e, 0xdd, 0x57, 0x80, 0x56, 0x4f, 0xc1, 0xb7, 0x38, - 0x8d, 0x2a, 0xde, 0x4a, 0xb2, 0x4b, 0x6e, 0x1b, 0x62, 0x00, 0x34, 0x09, 0x97, 0xd5, 0xa7, 0xa1, - 0x61, 0x3d, 0x8f, 0x02, 0x38, 0xf0, 0x08, 0x78, 0x3d, 0x28, 0x7a, 0x99, 0xd6, 0x90, 0xa3, 0xf8, - 0x33, 0xb4, 0xc8, 0x41, 0x5b, 0x72, 0x16, 0x5f, 0xbe, 0x04, 0x18, 0x91, 0x8e, 0x0d, 0x2b, 0x07, - 0x9e, 0x2d, 0x92, 0xd6, 0x51, 0xb9, 0xd9, 0xf4, 0x94, 0xad, 0xd7, 0xda, 0x77, 0xf0, 0xd6, 0x9d, - 0x78, 0xd6, 0xfa, 0x73, 0x43, 0xac, 0x78, 0x26, 0xbd, 0x66, 0x69, 0x7b, 0x73, 0xa7, 0x58, 0x37, - 0xb7, 0x20, 0x1e, 0xaa, 0x9a, 0x90, 0xfc, 0x55, 0x20, 0x52, 0xfa, 0xc1, 0xb2, 0x59, 0x7f, 0x5a, - 0xa9, 0x99, 0xdb, 0xbb, 0xf5, 0xb4, 0xf5, 0x00, 0xfb, 0xe4, 0xfb, 0x60, 0xb1, 0x96, 0xe4, 0x0a, - 0x87, 0xb3, 0x56, 0x18, 0x5a, 0x39, 0x02, 0xe7, 0x6d, 0xa3, 0xd9, 0xab, 0x1e, 0x4b, 0x5d, 0xf5, - 0x78, 0x0c, 0x09, 0x17, 0xb1, 0x89, 0x74, 0x4e, 0x4c, 0x4a, 0x42, 0x28, 0xd2, 0x54, 0x3a, 0x78, - 0xa8, 0xb8, 0xc8, 0x6e, 0x2a, 0x1c, 0xa2, 0x4b, 0x89, 0x2d, 0x37, 0x08, 0x6f, 0xd1, 0xc8, 0x4a, - 0x0e, 0xdf, 0xff, 0x8f, 0xf3, 0xfa, 0x3e, 0xf8, 0x0e, 0x09, 0x18, 0x0e, 0xed, 0xbb, 0x60, 0x8d, - 0x27, 0x39, 0x58, 0xb6, 0x31, 0xa9, 0xd5, 0xf5, 0x1c, 0xd0, 0x07, 0x2b, 0xac, 0x0c, 0x8e, 0xc8, - 0xaa, 0x8e, 0x60, 0x2b, 0x0f, 0x80, 0xbe, 0x9e, 0x63, 0x0f, 0x64, 0x84, 0xc5, 0x05, 0xb5, 0x86, - 0xa6, 0xad, 0x4a, 0xd5, 0x86, 0x62, 0xf3, 0x13, 0x3d, 0x3f, 0xc0, 0x77, 0x72, 0xfa, 0x47, 0x92, - 0xea, 0xb1, 0x98, 0x3f, 0xc7, 0x30, 0xa9, 0x1d, 0x9b, 0xe2, 0xac, 0x8b, 0x7b, 0x18, 0xee, 0x96, - 0x67, 0xb0, 0x20, 0xa3, 0x8c, 0xa2, 0x44, 0x9d, 0xce, 0xef, 0xee, 0x66, 0x74, 0xc8, 0xca, 0xd7, - 0x6c, 0x7e, 0x40, 0x14, 0x84, 0x67, 0xaa, 0xe1, 0xfc, 0xfc, 0x71, 0x80, 0xf1, 0xcf, 0xb0, 0xb6, - 0x8f, 0x27, 0x85, 0xb5, 0xee, 0xe9, 0x33, 0xbf, 0xdc, 0x39, 0x38, 0x7d, 0xd3, 0xf2, 0xe8, 0x61, - 0x67, 0xf6, 0x6b, 0x6b, 0x7c, 0x81, 0xbb, 0x0f, 0xfb, 0xe6, 0x58, 0xe1, 0x9b, 0x73, 0xda, 0x53, - 0x1e, 0xf5, 0xd3, 0x0d, 0x0d, 0x30, 0x38, 0x52, 0xea, 0xd0, 0xd4, 0x47, 0x1d, 0x68, 0x53, 0x43, - 0xdf, 0x44, 0x9e, 0x22, 0x82, 0x0f, 0xb5, 0x27, 0x6a, 0x47, 0xf0, 0xb1, 0xe8, 0xc1, 0x73, 0xab, - 0xd5, 0xb0, 0xb0, 0x18, 0xca, 0xef, 0x1d, 0x8d, 0x93, 0x18, 0x7c, 0x21, 0xc7, 0x5e, 0xe6, 0xfc, - 0x5e, 0x2f, 0x99, 0xea, 0x2a, 0xcc, 0x4a, 0xa7, 0xe9, 0x1c, 0x3b, 0x4d, 0xd0, 0x01, 0x6e, 0xaa, - 0x52, 0x58, 0x32, 0xcb, 0x74, 0x9c, 0x5a, 0x24, 0x2c, 0xfc, 0xc1, 0x96, 0xbc, 0x19, 0x89, 0x6f, - 0x2b, 0xbb, 0xc9, 0xae, 0xd0, 0x24, 0xd0, 0x30, 0x4e, 0xa8, 0xe8, 0x1a, 0x91, 0xae, 0x15, 0x47, - 0xc5, 0x7a, 0xf8, 0x0b, 0xb0, 0x57, 0x21, 0x7a, 0x49, 0xa5, 0x13, 0x03, 0x3d, 0xf8, 0x37, 0xc9, - 0x57, 0x1e, 0x76, 0xae, 0xb0, 0xb9, 0xf4, 0x51, 0x20, 0xf7, 0xaf, 0xc3, 0x24, 0x25, 0xab, 0xbd, - 0xc9, 0xf9, 0x91, 0xc6, 0x22, 0xae, 0x29, 0x0b, 0x6c, 0x3e, 0x1d, 0x87, 0xa8, 0x56, 0xaf, 0x43, - 0xa0, 0x65, 0xb5, 0xb0, 0x20, 0xe5, 0x1b, 0x55, 0xf6, 0x4a, 0x3a, 0xac, 0x02, 0x14, 0x66, 0x58, - 0xc2, 0xdb, 0xf0, 0x77, 0x6e, 0xb9, 0x30, 0x34, 0x47, 0xd6, 0xf0, 0x36, 0xd2, 0x2e, 0xa3, 0xc7, - 0x1e, 0x85, 0x38, 0xb9, 0x74, 0xae, 0xf6, 0x1a, 0x47, 0x1b, 0x74, 0x6a, 0xbe, 0xe7, 0xe2, 0x6d, - 0xa9, 0xbe, 0xad, 0x02, 0x5b, 0x1f, 0x61, 0xa0, 0xa3, 0x7f, 0x25, 0x52, 0xc3, 0x7d, 0xc4, 0x4e, - 0xf9, 0xe8, 0x6e, 0x4a, 0xb8, 0x62, 0x68, 0xe1, 0x19, 0x0c, 0x67, 0xf8, 0x67, 0x31, 0x5e, 0x8c, - 0xcc, 0xc9, 0x9b, 0x58, 0xce, 0x40, 0x53, 0x01, 0x24, 0x34, 0x6c, 0x52, 0x5d, 0xbc, 0x42, 0x19, - 0xda, 0x82, 0x98, 0xbd, 0x80, 0xf9, 0xbb, 0xae, 0x6f, 0xf2, 0x1c, 0x69, 0x48, 0xfe, 0x3c, 0x15, - 0xaf, 0xfe, 0xc4, 0xcf, 0xb7, 0x69, 0x76, 0xfa, 0x69, 0x41, 0x20, 0xc5, 0x33, 0xb3, 0xf0, 0x27, - 0x97, 0xdc, 0xf0, 0xe7, 0xdb, 0x22, 0x1c, 0x84, 0xd0, 0xfd, 0x1e, 0xe7, 0x46, 0x0a, 0x45, 0xa6, - 0x58, 0xfe, 0xff, 0x07, 0xc2, 0x70, 0x4e, 0x5e, 0x42, 0x15, 0x99, 0x02, 0x38, 0x76, 0x7e, 0xe1, - 0x94, 0x04, 0x93, 0xd8, 0xc8, 0xd3, 0xb7, 0x49, 0x12, 0xaa, 0x1f, 0x19, 0xe3, 0x27, 0xba, 0xb0, - 0xa7, 0x64, 0x86, 0x4c, 0xf1, 0x18, 0xf0, 0xba, 0x72, 0x7a, 0xad, 0x5e, 0xb8, 0x78, 0x6f, 0x0d, - 0x1d, 0x58, 0x5d, 0xf9, 0x84, 0x8d, 0x9f, 0x7e, 0xdc, 0xcc, 0xa7, 0x10, 0x93, 0x17, 0x8f, 0xd5, - 0x2e, 0xd1, 0x89, 0xb5, 0x59, 0xdb, 0x2d, 0x95, 0xca, 0xe5, 0x55, 0x7e, 0xef, 0xa6, 0xd9, 0xf3, - 0xb8, 0x9e, 0x8d, 0xc8, 0xc0, 0x09, 0x54, 0x55, 0x7d, 0xb2, 0x49, 0x81, 0x2f, 0x84, 0x1b, 0xca, - 0x5b, 0xd5, 0xf0, 0x81, 0x3e, 0x5d, 0x3e, 0xc0, 0x1b, 0x4a, 0xe3, 0x52, 0x20, 0xc3, 0xe3, 0xfe, - 0x09, 0xe1, 0x23, 0x27, 0xa3, 0x8a, 0xf3, 0xa4, 0xbc, 0x32, 0xb1, 0x14, 0xb9, 0x0a, 0x46, 0xae, - 0x22, 0x9d, 0x6a, 0x61, 0xc1, 0x41, 0x9f, 0x89, 0xa4, 0xa8, 0xc6, 0x2d, 0xa2, 0x67, 0xd8, 0x29, - 0x4e, 0x98, 0xd2, 0x33, 0x25, 0x49, 0x06, 0xf2, 0x64, 0x92, 0x47, 0x01, 0xf4, 0xec, 0x7f, 0x1f, - 0x54, 0x74, 0x9a, 0x12, 0x37, 0xad, 0xb8, 0x9a, 0x85, 0x5a, 0x37, 0x2c, 0xb5, 0xae, 0x2b, 0x83, - 0x1d, 0xea, 0x54, 0x03, 0x04, 0x54, 0x39, 0x65, 0xfe, 0xf0, 0x83, 0x12, 0x6a, 0x49, 0x1e, 0x4f, - 0xa9, 0x0e, 0x64, 0x1e, 0x71, 0x1d, 0x4f, 0xeb, 0x2d, 0xfc, 0x78, 0x08, 0x4f, 0x90, 0x9b, 0x22, - 0x48, 0x00, 0xbc, 0x6a, 0x16, 0x01, 0x79, 0x77, 0xd3, 0x6a, 0xa3, 0xf1, 0x62, 0x32, 0x18, 0xc7, - 0x0c, 0x25, 0x5a, 0x3d, 0x7d, 0x9e, 0xa0, 0x4b, 0x0f, 0x73, 0x69, 0xd1, 0xc6, 0x0f, 0xb1, 0x31, - 0x71, 0x60, 0x75, 0x85, 0x25, 0x77, 0x1a, 0x32, 0xd2, 0xb0, 0x71, 0xad, 0x58, 0xd9, 0x28, 0xaf, - 0x9a, 0xeb, 0x25, 0xc8, 0x4b, 0x67, 0xd8, 0xd5, 0x58, 0x63, 0xbd, 0xba, 0x5b, 0xab, 0xd3, 0xbd, - 0xa5, 0x1b, 0xec, 0x4a, 0xac, 0x67, 0xa3, 0x5c, 0xa4, 0x5c, 0xb5, 0xaf, 0xa3, 0x5a, 0xc4, 0xfb, - 0x7a, 0xda, 0x88, 0xf1, 0x61, 0xc8, 0xc5, 0xcb, 0x0d, 0xfe, 0x24, 0x00, 0xb2, 0xf7, 0x63, 0xc7, - 0x3e, 0x41, 0x0f, 0xba, 0xd2, 0x72, 0x1b, 0x47, 0xfa, 0x1d, 0x36, 0x81, 0xf7, 0xd5, 0x51, 0x89, - 0xc5, 0x2d, 0xe1, 0x29, 0xbc, 0x9a, 0x23, 0xe1, 0x8d, 0x4f, 0x86, 0x2f, 0x7f, 0xf8, 0x6b, 0xad, - 0xc2, 0x3a, 0xe1, 0x4a, 0xe2, 0x11, 0x96, 0x1a, 0x17, 0xdf, 0xb5, 0x3c, 0xd8, 0x41, 0x5f, 0xd8, - 0x83, 0xb0, 0xc1, 0x12, 0xa1, 0x4c, 0xd8, 0x20, 0x8b, 0x25, 0x61, 0x43, 0x9b, 0xbf, 0x50, 0x36, - 0xfe, 0x2c, 0x5b, 0x3a, 0xdf, 0x94, 0xc2, 0xca, 0x2f, 0xf1, 0xf8, 0x92, 0x9e, 0x20, 0xf0, 0x25, - 0xcc, 0xe6, 0x33, 0x17, 0x6c, 0xfc, 0x9f, 0x1c, 0xbb, 0xce, 0xef, 0x1e, 0xd1, 0xc1, 0x8b, 0x08, - 0x81, 0xd0, 0x6d, 0x0c, 0x08, 0x29, 0x6a, 0xef, 0xa9, 0x71, 0x10, 0x48, 0x41, 0xb0, 0xa8, 0x10, - 0x2d, 0xa4, 0x39, 0x94, 0xb3, 0x91, 0x84, 0x9c, 0x8d, 0x26, 0xe5, 0x6c, 0x2c, 0x29, 0x67, 0xe3, - 0x71, 0xed, 0x98, 0x08, 0x6b, 0x03, 0xcf, 0x21, 0xd1, 0x03, 0x16, 0x36, 0x84, 0x8e, 0x83, 0x8f, - 0x97, 0xcf, 0x4a, 0xa3, 0x2f, 0xc1, 0xc8, 0x7b, 0x6d, 0x7c, 0x03, 0xd3, 0x5e, 0xa3, 0x8a, 0x0f, - 0x73, 0xc0, 0xa8, 0xd4, 0x31, 0xea, 0x87, 0x39, 0x78, 0xb6, 0x25, 0xde, 0x02, 0x2f, 0xfc, 0xa3, - 0x97, 0xd8, 0x44, 0xb9, 0xbe, 0x46, 0xde, 0x04, 0x74, 0xef, 0xda, 0x91, 0x59, 0x26, 0x3c, 0xfc, - 0x12, 0x1d, 0x78, 0x6d, 0x8c, 0x10, 0xb4, 0xbf, 0x3c, 0x07, 0x52, 0xf8, 0x82, 0xec, 0xeb, 0xfb, - 0x40, 0x8d, 0xf6, 0xf9, 0x39, 0xfd, 0x45, 0x76, 0x37, 0xb3, 0x9f, 0x1b, 0x25, 0xed, 0xa7, 0xe6, - 0x74, 0x83, 0xdd, 0x96, 0x50, 0x11, 0x91, 0xe6, 0x6a, 0x79, 0xa7, 0x5a, 0x2e, 0x15, 0x51, 0x7b, - 0x7e, 0x7a, 0x4e, 0x9f, 0x63, 0x86, 0x84, 0xa9, 0xf1, 0x5b, 0xcb, 0x75, 0x4f, 0x14, 0x1a, 0x14, - 0xc0, 0x9f, 0x99, 0xd3, 0xf3, 0xec, 0x15, 0x09, 0x18, 0x7e, 0x37, 0xc5, 0xcc, 0xf8, 0xc4, 0x8c, - 0xf6, 0xb3, 0xb1, 0x25, 0xf4, 0x7d, 0x1c, 0x46, 0xfb, 0x9b, 0x73, 0xfa, 0xcb, 0xec, 0x7e, 0x66, - 0xbf, 0xe4, 0xa0, 0xf6, 0x73, 0x09, 0x38, 0xfe, 0xcd, 0x80, 0xbe, 0x4f, 0xa1, 0x68, 0x7f, 0x3b, - 0x46, 0x5f, 0x26, 0x5c, 0x88, 0xf7, 0xef, 0xcc, 0xa9, 0xec, 0xa7, 0x8f, 0xbc, 0x98, 0xe2, 0x2b, - 0x2f, 0xda, 0xdf, 0x8b, 0x31, 0x25, 0x5a, 0x6b, 0xf2, 0xcb, 0x33, 0xda, 0xdf, 0x9d, 0xd3, 0x5f, - 0x62, 0xf7, 0x32, 0x01, 0x25, 0xd8, 0x17, 0xe6, 0xf4, 0x57, 0xd8, 0x8b, 0x29, 0xbc, 0xeb, 0xfb, - 0xe8, 0x8c, 0xf6, 0xf7, 0xe7, 0xf4, 0x0f, 0xb2, 0xf7, 0x4b, 0xd0, 0x4d, 0xdb, 0x0e, 0xea, 0x87, - 0xf6, 0xce, 0xa9, 0xe7, 0xd6, 0x40, 0x2e, 0x9c, 0x0e, 0x1e, 0x00, 0xc0, 0x36, 0xc3, 0xff, 0x97, - 0x3c, 0x6b, 0x3f, 0x50, 0x37, 0xe8, 0x8b, 0x73, 0xfa, 0x6b, 0x6c, 0x39, 0x1c, 0xf9, 0x6c, 0xb3, - 0x58, 0x5d, 0x37, 0x9f, 0x3a, 0x07, 0x87, 0x6b, 0xce, 0xb1, 0x5d, 0xe3, 0x5f, 0x87, 0x09, 0x9f, - 0x8a, 0x29, 0xe3, 0xbe, 0x34, 0xa7, 0x3f, 0x62, 0x0b, 0x19, 0xe3, 0xb6, 0x3b, 0xe2, 0x45, 0xaa, - 0x32, 0xe0, 0xe7, 0x63, 0x62, 0x95, 0xfa, 0x81, 0x17, 0xed, 0xcb, 0xf3, 0xfa, 0x02, 0x7b, 0x69, - 0x20, 0x4c, 0xb8, 0x13, 0xbf, 0x34, 0xaf, 0x72, 0x3b, 0xfb, 0x8b, 0x30, 0xda, 0x2f, 0xcf, 0xab, - 0x94, 0x66, 0x03, 0x86, 0x98, 0x7f, 0x65, 0x5e, 0xbf, 0xcb, 0x66, 0xfb, 0x06, 0x84, 0xdf, 0x81, - 0xd1, 0xbe, 0x92, 0x3e, 0x75, 0xdf, 0x87, 0x62, 0xb4, 0xaf, 0xce, 0xab, 0xd2, 0xdc, 0xf7, 0x7d, - 0x16, 0xed, 0x3f, 0xcf, 0xab, 0x52, 0x9a, 0xf9, 0xfd, 0x16, 0xed, 0xbf, 0xcc, 0xeb, 0x0f, 0xd8, - 0x9d, 0x3e, 0xb8, 0xd8, 0x07, 0x5a, 0xb4, 0xff, 0x3a, 0x9f, 0xca, 0x60, 0xf5, 0x4b, 0x2a, 0xda, - 0xd7, 0xe6, 0xf5, 0xfb, 0xec, 0x56, 0x36, 0x0c, 0x48, 0xf1, 0xaf, 0xa6, 0xd3, 0x94, 0xfc, 0x06, - 0x8a, 0xf6, 0x6b, 0xf3, 0xfa, 0x3c, 0x7b, 0x90, 0xc1, 0xd6, 0x18, 0xe4, 0x7f, 0x4b, 0x67, 0x97, - 0x78, 0x1b, 0x5b, 0xc5, 0x23, 0x2e, 0x0e, 0xf8, 0xeb, 0xf3, 0xaa, 0x72, 0x99, 0xf8, 0x05, 0x33, - 0x99, 0xb9, 0x68, 0x7f, 0xb2, 0xa0, 0xdf, 0x64, 0xd7, 0x93, 0x7d, 0x82, 0x3f, 0xff, 0x77, 0x21, - 0x6d, 0x20, 0xdd, 0x79, 0xd6, 0xbe, 0xb3, 0x00, 0x59, 0xdc, 0xd5, 0x78, 0x1f, 0x8f, 0x22, 0xb4, - 0xef, 0x2e, 0xa8, 0x92, 0x91, 0xf1, 0x80, 0x4f, 0x95, 0xe1, 0xdf, 0x58, 0x04, 0x1f, 0x39, 0x97, - 0x32, 0x20, 0x7c, 0x37, 0xa7, 0x42, 0xff, 0xe6, 0xa2, 0xfe, 0x2a, 0x7b, 0x34, 0x08, 0x3a, 0x4d, - 0xb1, 0x7e, 0x6b, 0x51, 0x55, 0x48, 0x65, 0x54, 0x09, 0x2f, 0xf0, 0xc6, 0x9f, 0xb8, 0xa9, 0xe3, - 0xbe, 0xb1, 0xa8, 0x5a, 0xb2, 0xf4, 0xf7, 0x78, 0x2a, 0xfc, 0x6f, 0x2f, 0xaa, 0xce, 0x20, 0x63, - 0xf1, 0xda, 0x37, 0x17, 0x55, 0x81, 0x49, 0x5b, 0x83, 0xf6, 0x3b, 0x8b, 0xaa, 0x99, 0x1a, 0xb4, - 0x4c, 0xed, 0x5b, 0x8b, 0xaa, 0x99, 0x3a, 0xf7, 0xda, 0xcc, 0x82, 0xf6, 0xbb, 0x8b, 0xfa, 0x63, - 0xb6, 0x78, 0xee, 0xd5, 0xc1, 0x88, 0xdf, 0x5b, 0x54, 0xa5, 0xce, 0xcc, 0x3c, 0x4b, 0xd0, 0x7e, - 0x3f, 0x8b, 0x11, 0x6a, 0xf5, 0x5e, 0xfb, 0xf6, 0x62, 0x86, 0xac, 0xf0, 0x44, 0xae, 0xaf, 0x28, - 0xaa, 0xfd, 0xc1, 0xa2, 0xaa, 0x8e, 0xa9, 0xdf, 0x75, 0xd1, 0xfe, 0xe5, 0x92, 0xaa, 0x6b, 0x99, - 0x5f, 0x34, 0xd1, 0x7e, 0x61, 0x29, 0xb6, 0xb7, 0x67, 0x7d, 0xf9, 0x44, 0xfb, 0x57, 0x4b, 0xb1, - 0xb5, 0x67, 0x7e, 0xec, 0x43, 0xfb, 0xd7, 0x4b, 0xb1, 0x55, 0x9d, 0xf9, 0x55, 0x10, 0xed, 0xdf, - 0x2c, 0xe9, 0xb7, 0xd9, 0x4c, 0xea, 0xaa, 0x1c, 0xd0, 0xd2, 0x5f, 0x5c, 0x52, 0x3d, 0x5b, 0xd6, - 0x57, 0x33, 0xb4, 0x7f, 0xbb, 0xa4, 0xda, 0xb3, 0xf4, 0x8f, 0xcd, 0x68, 0xff, 0x2e, 0x93, 0x39, - 0xb1, 0x6f, 0x4d, 0x68, 0xff, 0x3e, 0x93, 0x39, 0xa9, 0xdf, 0xa4, 0xd0, 0xfe, 0x43, 0x1c, 0xfe, - 0xac, 0x6f, 0x27, 0x68, 0xff, 0x71, 0x49, 0xff, 0x3e, 0x56, 0x38, 0x37, 0x7c, 0x64, 0x95, 0xfe, - 0xd3, 0x92, 0x5e, 0x60, 0x0f, 0xd3, 0x08, 0xcb, 0x9e, 0xec, 0xcb, 0x4b, 0xfa, 0x87, 0xd9, 0x6b, - 0xef, 0x68, 0x4c, 0x34, 0xe1, 0x2f, 0x2d, 0xc5, 0x4c, 0xc7, 0x79, 0x1f, 0x70, 0x6b, 0xbf, 0x9c, - 0xc9, 0xc1, 0xbe, 0xa7, 0xe3, 0x78, 0x97, 0x49, 0xfb, 0x95, 0xa5, 0x2c, 0xd1, 0x0e, 0xbf, 0xa6, - 0xa1, 0x7d, 0x65, 0x49, 0x75, 0xe5, 0x03, 0xbf, 0xb8, 0xa1, 0x7d, 0x35, 0x2e, 0x54, 0x6f, 0xec, - 0xc4, 0xbe, 0xee, 0xa4, 0x7d, 0xf1, 0x61, 0x4c, 0xa8, 0x12, 0xdd, 0x21, 0x96, 0x2f, 0x3d, 0x54, - 0x9d, 0x2d, 0x82, 0xc5, 0xbe, 0xbb, 0xa4, 0xfd, 0xfc, 0xc3, 0x98, 0x39, 0x1e, 0xf0, 0x82, 0x58, - 0x35, 0x93, 0x7f, 0x98, 0x8f, 0xf1, 0xf4, 0x7c, 0xa3, 0xc0, 0xfc, 0xfc, 0x51, 0x3e, 0x36, 0x5b, - 0xa5, 0xd3, 0xf0, 0xa8, 0xf0, 0x43, 0xa5, 0x3c, 0xcc, 0x0a, 0x94, 0x03, 0x82, 0x68, 0xb6, 0xaf, - 0x3c, 0xd2, 0xdf, 0xcf, 0xf2, 0x03, 0x46, 0xa5, 0x59, 0xfe, 0xaf, 0x3e, 0x52, 0xd9, 0x97, 0x7c, - 0x27, 0xa3, 0xfd, 0xd3, 0xc7, 0xfa, 0x3d, 0x76, 0x33, 0x74, 0xbf, 0xfd, 0xef, 0x3e, 0xb5, 0xaf, - 0x3d, 0x56, 0x03, 0x9e, 0x22, 0x7f, 0x69, 0x24, 0x5c, 0x38, 0x85, 0x16, 0xbf, 0xf6, 0x38, 0x9a, - 0x61, 0x0d, 0x4b, 0x47, 0xb5, 0x6d, 0xfa, 0x40, 0x20, 0x2a, 0x18, 0x04, 0xed, 0xbf, 0xfe, 0x58, - 0x55, 0xe7, 0xf4, 0x9b, 0xb1, 0xda, 0xff, 0x7c, 0xac, 0x2f, 0xb2, 0x97, 0x07, 0x03, 0x85, 0x7b, - 0xf9, 0xbf, 0x1e, 0xeb, 0x57, 0xd9, 0xa5, 0x08, 0x98, 0x2e, 0xea, 0x6b, 0xdf, 0x79, 0xac, 0x9a, - 0xb5, 0xec, 0xfb, 0xef, 0xda, 0x77, 0x1f, 0xab, 0xc1, 0x02, 0x1d, 0x33, 0x7b, 0xab, 0xe2, 0xb5, - 0x88, 0xf6, 0xa9, 0x65, 0x95, 0xda, 0x78, 0x67, 0x48, 0xc0, 0x5f, 0x5b, 0x56, 0x45, 0x3c, 0xf5, - 0x1a, 0xbd, 0xf6, 0xd7, 0x97, 0xf5, 0x5b, 0xec, 0x86, 0x84, 0x49, 0x3c, 0x78, 0xd0, 0x3e, 0xb3, - 0xac, 0xc6, 0x1d, 0xea, 0xe3, 0x04, 0xed, 0xb3, 0xcb, 0xaa, 0x53, 0x4d, 0x7b, 0xb7, 0xa0, 0xfd, - 0xd8, 0xb2, 0xba, 0x69, 0x29, 0x17, 0xf8, 0xb4, 0x1f, 0x5f, 0x56, 0xd7, 0x18, 0xbf, 0xbe, 0xa3, - 0xfd, 0xc4, 0xb2, 0x1a, 0x9c, 0x0d, 0xb8, 0xc9, 0xa8, 0xfd, 0xe4, 0xb2, 0xaa, 0x5c, 0x59, 0xaf, - 0x82, 0xb5, 0xbf, 0xb1, 0xac, 0xdf, 0x60, 0x7a, 0xff, 0x6c, 0xda, 0xe7, 0x62, 0x4c, 0x88, 0x3a, - 0xf8, 0xb0, 0xcf, 0xc7, 0x78, 0x9d, 0x7e, 0xa5, 0x42, 0xfb, 0xa9, 0x65, 0x55, 0x32, 0x06, 0x5f, - 0x91, 0xd0, 0x7e, 0x3a, 0xb6, 0x31, 0xa9, 0x37, 0x1a, 0xb4, 0x9f, 0x89, 0x31, 0x2f, 0xe5, 0xce, - 0x81, 0xf6, 0xb3, 0xb1, 0x1d, 0x10, 0x3e, 0x7c, 0x07, 0x52, 0x7c, 0xb0, 0x77, 0x0d, 0x1e, 0x16, - 0x7c, 0xaa, 0x10, 0x33, 0x8a, 0x67, 0x15, 0xb2, 0xb5, 0x4f, 0x17, 0x62, 0xd6, 0xfe, 0x3c, 0x45, - 0x1e, 0xed, 0x2f, 0x14, 0x62, 0xea, 0x7e, 0xae, 0x2a, 0x8d, 0xf6, 0xc3, 0x85, 0x58, 0xbc, 0xc5, - 0x07, 0x3d, 0xa3, 0x0f, 0x00, 0x70, 0x43, 0x1d, 0xc5, 0x0d, 0xbf, 0x55, 0xd0, 0x97, 0xd9, 0xd2, - 0x79, 0x40, 0x43, 0xec, 0xdf, 0x28, 0xc4, 0x22, 0x82, 0xfe, 0x21, 0xcf, 0xf8, 0x85, 0xa9, 0x70, - 0xc0, 0x6f, 0x17, 0x54, 0x51, 0x13, 0x03, 0xd2, 0xce, 0xea, 0xb4, 0x6f, 0x16, 0x62, 0x2e, 0xa1, - 0xef, 0xcc, 0xcc, 0x8c, 0x0e, 0xcd, 0xb4, 0xdf, 0x29, 0xa8, 0x32, 0x31, 0xf8, 0xb8, 0x47, 0xfb, - 0x56, 0x21, 0xe6, 0x8f, 0xd2, 0xce, 0x5c, 0xb4, 0xdf, 0x2d, 0xe8, 0x0f, 0xd9, 0x7c, 0x3a, 0x4c, - 0xff, 0xe9, 0x88, 0xf6, 0x7b, 0xf1, 0xdd, 0x3f, 0xeb, 0x80, 0x44, 0xfb, 0xfd, 0x42, 0x2c, 0x33, - 0x18, 0x7c, 0x80, 0xa3, 0x7d, 0x3b, 0xce, 0x89, 0x94, 0xe3, 0x81, 0x88, 0x6b, 0x7f, 0x50, 0x88, - 0xc5, 0x72, 0x99, 0x47, 0x09, 0xda, 0xff, 0x28, 0xc4, 0x92, 0x20, 0xb5, 0xd0, 0xac, 0xfd, 0x61, - 0x8c, 0x43, 0xa9, 0xc5, 0x27, 0xed, 0x8f, 0x62, 0x44, 0x0d, 0x2c, 0x50, 0x69, 0x7f, 0x5c, 0x50, - 0x5d, 0xce, 0xaa, 0x7d, 0xcc, 0x83, 0x7d, 0x59, 0x88, 0xfa, 0xcc, 0xd6, 0xc2, 0x53, 0x76, 0x73, - 0xc0, 0xd7, 0x56, 0x40, 0x82, 0xcf, 0xf7, 0xbd, 0x15, 0x2d, 0xb7, 0xf0, 0xc3, 0x39, 0xa6, 0xf7, - 0x3f, 0x09, 0xc0, 0x8f, 0xce, 0xa5, 0x3f, 0x0a, 0xa0, 0x8f, 0xce, 0xcd, 0x24, 0xfa, 0xde, 0xd8, - 0xad, 0x94, 0x5e, 0xdf, 0xd9, 0x28, 0xbe, 0xc5, 0x4b, 0xc2, 0x89, 0xde, 0xfa, 0xf6, 0xca, 0x76, - 0x55, 0x1b, 0x02, 0x83, 0x7d, 0x2d, 0xd1, 0xb3, 0x51, 0x5c, 0x5d, 0xc5, 0xa2, 0xf0, 0xc2, 0xd7, - 0x86, 0xd8, 0x0b, 0x99, 0x4f, 0xf8, 0xf1, 0x5d, 0xf7, 0x99, 0xef, 0xfb, 0x81, 0xae, 0x8f, 0xb0, - 0x0f, 0x66, 0x83, 0x11, 0x11, 0x26, 0xd2, 0x68, 0xae, 0xc1, 0x1f, 0x2b, 0xd5, 0xe2, 0xfa, 0x3a, - 0xbd, 0x13, 0xaf, 0xac, 0x3f, 0xad, 0xd7, 0x80, 0xee, 0xc7, 0x6c, 0xe9, 0xac, 0xd1, 0xf8, 0x2e, - 0xcf, 0xdc, 0x5e, 0x33, 0x57, 0x77, 0xeb, 0x6f, 0xc1, 0x7a, 0x1e, 0xb2, 0x57, 0xce, 0x1a, 0x51, - 0x7a, 0x5a, 0xdc, 0xd8, 0x28, 0x6f, 0xad, 0xe3, 0xa3, 0xc1, 0x39, 0xf6, 0x20, 0x1b, 0x3c, 0xe2, - 0xe0, 0xc8, 0x60, 0xc0, 0x5a, 0xb9, 0x58, 0x2d, 0x3d, 0xc5, 0x8a, 0xf9, 0x28, 0x24, 0x56, 0xf7, - 0xb2, 0x01, 0x05, 0x6f, 0xc7, 0x16, 0x3e, 0x3d, 0xc4, 0x2e, 0x25, 0x5e, 0x26, 0x40, 0x28, 0x37, - 0xe0, 0x6d, 0x02, 0xb0, 0x72, 0x89, 0xcd, 0x27, 0xfb, 0xf1, 0x61, 0x3d, 0xb1, 0x0e, 0xa9, 0x2c, - 0x57, 0x6b, 0xb0, 0x42, 0x73, 0x63, 0xbb, 0x88, 0x77, 0x4d, 0xef, 0xb3, 0xdb, 0xfd, 0xd8, 0xaa, - 0xf0, 0xcf, 0xfa, 0x5b, 0x66, 0xbd, 0x42, 0x2f, 0x26, 0x39, 0xa9, 0x31, 0x10, 0xba, 0xc0, 0x56, - 0xd9, 0x32, 0x77, 0xaa, 0xdb, 0xeb, 0xd5, 0x72, 0xad, 0x06, 0x0b, 0xba, 0x4d, 0x52, 0x10, 0x83, - 0xc2, 0x57, 0x97, 0xf4, 0x53, 0x1b, 0x4b, 0xa3, 0x3a, 0x7a, 0x0c, 0xad, 0x8d, 0x0b, 0xd1, 0x8b, - 0xf5, 0x6f, 0x14, 0x6b, 0x75, 0x6d, 0x62, 0xe1, 0x8b, 0x39, 0xc6, 0xa2, 0x17, 0xef, 0x11, 0x60, - 0xfc, 0xfd, 0x3b, 0x7f, 0x95, 0xad, 0xf4, 0xa0, 0x6c, 0x51, 0x47, 0x4e, 0x28, 0x84, 0xec, 0x58, - 0xa9, 0xc2, 0xca, 0x4b, 0x80, 0xbb, 0x8c, 0x82, 0x1d, 0x47, 0x57, 0xdb, 0x01, 0x6a, 0x8a, 0xf5, - 0x6d, 0x3c, 0xec, 0x88, 0x8f, 0xe2, 0x9c, 0x83, 0x25, 0x6d, 0x6f, 0x68, 0xf8, 0x1a, 0xf3, 0xb2, - 0xd2, 0xb7, 0xb5, 0x8d, 0xff, 0x68, 0xa3, 0x0b, 0x3d, 0x6c, 0x4e, 0x3c, 0x87, 0x04, 0x87, 0x3b, - 0xf0, 0x8d, 0x24, 0x10, 0x4e, 0xbc, 0x49, 0x42, 0x14, 0x4b, 0xa5, 0xf2, 0x0e, 0x7f, 0x05, 0x91, - 0xda, 0x8f, 0xe3, 0x2b, 0x5b, 0x78, 0x5e, 0x83, 0x76, 0xe0, 0x72, 0xdf, 0xc3, 0x27, 0x54, 0xf5, - 0xac, 0xa7, 0x4f, 0x30, 0x27, 0xac, 0x2e, 0xd9, 0x5b, 0x02, 0x17, 0xe3, 0xb6, 0x61, 0x3e, 0x50, - 0xf6, 0x64, 0x1f, 0x0f, 0x31, 0x86, 0xd2, 0xba, 0x78, 0x64, 0x31, 0xbc, 0xf0, 0xcd, 0x1c, 0xbb, - 0x9e, 0xfe, 0xb6, 0x09, 0x2c, 0xec, 0x19, 0xaf, 0x9e, 0xb8, 0xd8, 0x66, 0xc0, 0x00, 0x7b, 0xcd, - 0x9d, 0x62, 0xb5, 0x5e, 0x29, 0x55, 0x76, 0xf8, 0x81, 0x13, 0xbe, 0x5d, 0xbf, 0x95, 0x01, 0x5d, - 0xde, 0xdc, 0x21, 0x0d, 0x5f, 0x66, 0x0f, 0x33, 0x20, 0xf0, 0xb9, 0xee, 0x33, 0x10, 0xf3, 0x8d, - 0xed, 0x7a, 0xcd, 0x2c, 0x3e, 0x2b, 0x56, 0x36, 0x8a, 0x2b, 0x1b, 0x28, 0xe8, 0x2f, 0x33, 0x63, - 0xf0, 0x90, 0xb5, 0xdd, 0x0d, 0xd8, 0xfd, 0x85, 0x7f, 0x92, 0x63, 0x37, 0x32, 0xce, 0x5f, 0x60, - 0x19, 0x67, 0x1d, 0xcd, 0xa8, 0x2f, 0x89, 0x81, 0x31, 0x59, 0xd0, 0x3b, 0xbb, 0x2b, 0x1b, 0x95, - 0x12, 0x30, 0x06, 0xa8, 0xca, 0x82, 0xe1, 0x76, 0xc2, 0x7c, 0xed, 0xd9, 0x6b, 0xc0, 0x92, 0xb3, - 0xe1, 0x3e, 0xf4, 0xec, 0x43, 0xda, 0xd0, 0xca, 0xe8, 0xd3, 0xdc, 0xa7, 0x72, 0xef, 0xfb, 0x7f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x45, 0x6e, 0x73, 0x53, 0x62, 0x00, 0x00, -} diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go b/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go deleted file mode 100644 index 334362de..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Provides access to TF2 Game Coordinator functionality. -*/ -package tf2 - -import ( - "github.com/Philipp15b/go-steam" - . "github.com/Philipp15b/go-steam/protocol/gamecoordinator" - . "github.com/Philipp15b/go-steam/tf2/protocol" - "github.com/Philipp15b/go-steam/tf2/protocol/protobuf" -) - -const AppId = 440 - -// To use any methods of this, you'll need to SetPlaying(true) and wait for -// the GCReadyEvent. -type TF2 struct { - client *steam.Client -} - -// Creates a new TF2 instance and registers it as a packet handler -func New(client *steam.Client) *TF2 { - t := &TF2{client} - client.GC.RegisterPacketHandler(t) - return t -} - -func (t *TF2) SetPlaying(playing bool) { - if playing { - t.client.GC.SetGamesPlayed(AppId) - } else { - t.client.GC.SetGamesPlayed() - } -} - -func (t *TF2) SetItemPosition(itemId, position uint64) { - t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCSetSingleItemPosition), &MsgGCSetItemPosition{ - itemId, position, - })) -} - -// recipe -2 = wildcard -func (t *TF2) CraftItems(items []uint64, recipe int16) { - t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCCraft), &MsgGCCraft{ - Recipe: recipe, - Items: items, - })) -} - -func (t *TF2) DeleteItem(itemId uint64) { - t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCDelete), &MsgGCDeleteItem{itemId})) -} - -func (t *TF2) NameItem(toolId, target uint64, name string) { - t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCNameItem), &MsgGCNameItem{ - toolId, target, name, - })) -} - -type GCReadyEvent struct{} - -func (t *TF2) HandleGCPacket(packet *GCPacket) { - if packet.AppId != AppId { - return - } - switch protobuf.EGCBaseClientMsg(packet.MsgType) { - case protobuf.EGCBaseClientMsg_k_EMsgGCClientWelcome: - t.handleWelcome(packet) - } -} - -func (t *TF2) handleWelcome(packet *GCPacket) { - // the packet's body is pretty useless - t.client.Emit(&GCReadyEvent{}) -} diff --git a/vendor/github.com/Philipp15b/go-steam/trade/actions.go b/vendor/github.com/Philipp15b/go-steam/trade/actions.go deleted file mode 100644 index e9301940..00000000 --- a/vendor/github.com/Philipp15b/go-steam/trade/actions.go +++ /dev/null @@ -1,84 +0,0 @@ -package trade - -import ( - "github.com/Philipp15b/go-steam/economy/inventory" - "github.com/Philipp15b/go-steam/trade/tradeapi" - "time" -) - -type Slot uint - -func (t *Trade) action(status *tradeapi.Status, err error) error { - if err != nil { - return err - } - t.onStatus(status) - return nil -} - -// Returns the next batch of events to process. These can be queued from calls to methods -// like `AddItem` or, if there are no queued events, from a new HTTP request to Steam's API (blocking!). -// If the latter is the case, this method may also sleep before the request -// to conform to the polling interval of the official Steam client. -func (t *Trade) Poll() ([]interface{}, error) { - if t.queuedEvents != nil { - return t.Events(), nil - } - - if d := time.Since(t.lastPoll); d < pollTimeout { - time.Sleep(pollTimeout - d) - } - t.lastPoll = time.Now() - - err := t.action(t.api.GetStatus()) - if err != nil { - return nil, err - } - - return t.Events(), nil -} - -func (t *Trade) GetTheirInventory(contextId uint64, appId uint32) (*inventory.Inventory, error) { - return inventory.GetFullInventory(func() (*inventory.PartialInventory, error) { - return t.api.GetForeignInventory(contextId, appId, nil) - }, func(start uint) (*inventory.PartialInventory, error) { - return t.api.GetForeignInventory(contextId, appId, &start) - }) -} - -func (t *Trade) GetOwnInventory(contextId uint64, appId uint32) (*inventory.Inventory, error) { - return t.api.GetOwnInventory(contextId, appId) -} - -func (t *Trade) GetMain() (*tradeapi.Main, error) { - return t.api.GetMain() -} - -func (t *Trade) AddItem(slot Slot, item *Item) error { - return t.action(t.api.AddItem(uint(slot), item.AssetId, item.ContextId, item.AppId)) -} - -func (t *Trade) RemoveItem(slot Slot, item *Item) error { - return t.action(t.api.RemoveItem(uint(slot), item.AssetId, item.ContextId, item.AppId)) -} - -func (t *Trade) Chat(message string) error { - return t.action(t.api.Chat(message)) -} - -func (t *Trade) SetCurrency(amount uint, currency *Currency) error { - return t.action(t.api.SetCurrency(amount, currency.CurrencyId, currency.ContextId, currency.AppId)) -} - -func (t *Trade) SetReady(ready bool) error { - return t.action(t.api.SetReady(ready)) -} - -// This may only be called after a successful `SetReady(true)`. -func (t *Trade) Confirm() error { - return t.action(t.api.Confirm()) -} - -func (t *Trade) Cancel() error { - return t.action(t.api.Cancel()) -} diff --git a/vendor/github.com/Philipp15b/go-steam/trade/doc.go b/vendor/github.com/Philipp15b/go-steam/trade/doc.go deleted file mode 100644 index 549ad47d..00000000 --- a/vendor/github.com/Philipp15b/go-steam/trade/doc.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Allows automation of Steam Trading. - -Usage - -Like go-steam, this package is event-based. Call Poll() until the trade has ended, that is until the TradeEndedEvent is emitted. - - // After receiving the steam.TradeSessionStartEvent - t := trade.New(sessionIdCookie, steamLoginCookie, steamLoginSecure, event.Other) - for { - eventList, err := t.Poll() - if err != nil { - // error handling here - continue - } - for _, event := range eventList { - switch e := event.(type) { - case *trade.ChatEvent: - // respond to any chat message - t.Chat("Trading is awesome!") - case *trade.TradeEndedEvent: - return - // other event handlers here - } - } - } - -You can either log into steamcommunity.com and use the values of the `sessionId` and `steamLogin` cookies, -or use go-steam and after logging in with client.Web.LogOn() and receiving the WebLoggedOnEvent use the `SessionId` -and `SteamLogin` fields of steam.Web for the respective cookies. - -It is important that there is no delay between the Poll() calls greater than the timeout of the Steam client -(currently five seconds before the trade partner sees a warning) or the trade will be closed automatically by Steam. - -Notes - -All method calls to Steam APIs are blocking. This packages' and its subpackages' types are not thread-safe and no calls to any method of the same -trade instance may be done concurrently except when otherwise noted. -*/ -package trade diff --git a/vendor/github.com/Philipp15b/go-steam/trade/trade.go b/vendor/github.com/Philipp15b/go-steam/trade/trade.go deleted file mode 100644 index 4889f407..00000000 --- a/vendor/github.com/Philipp15b/go-steam/trade/trade.go +++ /dev/null @@ -1,122 +0,0 @@ -package trade - -import ( - "errors" - "time" - - "github.com/Philipp15b/go-steam/steamid" - "github.com/Philipp15b/go-steam/trade/tradeapi" -) - -const pollTimeout = time.Second - -type Trade struct { - ThemId steamid.SteamId - - MeReady, ThemReady bool - - lastPoll time.Time - queuedEvents []interface{} - api *tradeapi.Trade -} - -func New(sessionId, steamLogin, steamLoginSecure string, other steamid.SteamId) *Trade { - return &Trade{ - other, - false, false, - time.Unix(0, 0), - nil, - tradeapi.New(sessionId, steamLogin, steamLoginSecure, other), - } -} - -func (t *Trade) Version() uint { - return t.api.Version -} - -// Returns all queued events and removes them from the queue without performing a HTTP request, like Poll() would. -func (t *Trade) Events() []interface{} { - qe := t.queuedEvents - t.queuedEvents = nil - return qe -} - -func (t *Trade) onStatus(status *tradeapi.Status) error { - if !status.Success { - return errors.New("trade: returned status not successful! error message: " + status.Error) - } - - if status.NewVersion { - t.api.Version = status.Version - - t.MeReady = status.Me.Ready == true - t.ThemReady = status.Them.Ready == true - } - - switch status.TradeStatus { - case tradeapi.TradeStatus_Complete: - t.addEvent(&TradeEndedEvent{TradeEndReason_Complete}) - case tradeapi.TradeStatus_Cancelled: - t.addEvent(&TradeEndedEvent{TradeEndReason_Cancelled}) - case tradeapi.TradeStatus_Timeout: - t.addEvent(&TradeEndedEvent{TradeEndReason_Timeout}) - case tradeapi.TradeStatus_Failed: - t.addEvent(&TradeEndedEvent{TradeEndReason_Failed}) - case tradeapi.TradeStatus_Open: - // nothing - default: - // ignore too - } - - t.updateEvents(status.Events) - return nil -} - -func (t *Trade) updateEvents(events tradeapi.EventList) { - if len(events) == 0 { - return - } - - var lastLogPos uint - for i, event := range events { - if i < t.api.LogPos { - continue - } - if event.SteamId != t.ThemId { - continue - } - - if lastLogPos < i { - lastLogPos = i - } - - switch event.Action { - case tradeapi.Action_AddItem: - t.addEvent(&ItemAddedEvent{newItem(event)}) - case tradeapi.Action_RemoveItem: - t.addEvent(&ItemRemovedEvent{newItem(event)}) - case tradeapi.Action_Ready: - t.ThemReady = true - t.addEvent(new(ReadyEvent)) - case tradeapi.Action_Unready: - t.ThemReady = false - t.addEvent(new(UnreadyEvent)) - case tradeapi.Action_SetCurrency: - t.addEvent(&SetCurrencyEvent{ - newCurrency(event), - event.OldAmount, - event.NewAmount, - }) - case tradeapi.Action_ChatMessage: - t.addEvent(&ChatEvent{ - event.Text, - }) - } - } - - t.api.LogPos = uint(lastLogPos) + 1 -} - -func (t *Trade) addEvent(event interface{}) { - t.queuedEvents = append(t.queuedEvents, event) -} diff --git a/vendor/github.com/Philipp15b/go-steam/trade/tradeapi/status.go b/vendor/github.com/Philipp15b/go-steam/trade/tradeapi/status.go deleted file mode 100644 index 0a5278de..00000000 --- a/vendor/github.com/Philipp15b/go-steam/trade/tradeapi/status.go +++ /dev/null @@ -1,111 +0,0 @@ -package tradeapi - -import ( - "encoding/json" - "github.com/Philipp15b/go-steam/jsont" - "github.com/Philipp15b/go-steam/steamid" - "strconv" -) - -type Status struct { - Success bool - Error string - NewVersion bool `json:"newversion"` - TradeStatus TradeStatus `json:"trade_status"` - Version uint - LogPos int - Me User - Them User - Events EventList -} - -type TradeStatus uint - -const ( - TradeStatus_Open TradeStatus = 0 - TradeStatus_Complete = 1 - TradeStatus_Empty = 2 // when both parties trade no items - TradeStatus_Cancelled = 3 - TradeStatus_Timeout = 4 // the partner timed out - TradeStatus_Failed = 5 -) - -type EventList map[uint]*Event - -// The EventList can either be an array or an object of id -> event -func (e *EventList) UnmarshalJSON(data []byte) error { - // initialize the map if it's nil - if *e == nil { - *e = make(EventList) - } - - o := make(map[string]*Event) - err := json.Unmarshal(data, &o) - // it's an object - if err == nil { - for is, event := range o { - i, err := strconv.ParseUint(is, 10, 32) - if err != nil { - panic(err) - } - (*e)[uint(i)] = event - } - return nil - } - - // it's an array - var a []*Event - err = json.Unmarshal(data, &a) - if err != nil { - return err - } - for i, event := range a { - (*e)[uint(i)] = event - } - return nil -} - -type Event struct { - SteamId steamid.SteamId `json:",string"` - Action Action `json:",string"` - Timestamp uint64 - - AppId uint32 - ContextId uint64 `json:",string"` - AssetId uint64 `json:",string"` - - Text string // only used for chat messages - - // The following is used for SetCurrency - CurrencyId uint64 `json:",string"` - OldAmount uint64 `json:"old_amount,string"` - NewAmount uint64 `json:"amount,string"` -} - -type Action uint - -const ( - Action_AddItem Action = 0 - Action_RemoveItem = 1 - Action_Ready = 2 - Action_Unready = 3 - Action_Accept = 4 - Action_SetCurrency = 6 - Action_ChatMessage = 7 -) - -type User struct { - Ready jsont.UintBool - Confirmed jsont.UintBool - SecSinceTouch int `json:"sec_since_touch"` - ConnectionPending bool `json:"connection_pending"` - Assets interface{} - Currency interface{} // either []*Currency or empty string -} - -type Currency struct { - AppId uint64 `json:",string"` - ContextId uint64 `json:",string"` - CurrencyId uint64 `json:",string"` - Amount uint64 `json:",string"` -} diff --git a/vendor/github.com/Philipp15b/go-steam/trade/tradeapi/trade.go b/vendor/github.com/Philipp15b/go-steam/trade/tradeapi/trade.go deleted file mode 100644 index 5e9f2a98..00000000 --- a/vendor/github.com/Philipp15b/go-steam/trade/tradeapi/trade.go +++ /dev/null @@ -1,200 +0,0 @@ -/* -Wrapper around the HTTP trading API for type safety 'n' stuff. -*/ -package tradeapi - -import ( - "encoding/json" - "errors" - "fmt" - "github.com/Philipp15b/go-steam/community" - "github.com/Philipp15b/go-steam/economy/inventory" - "github.com/Philipp15b/go-steam/netutil" - "github.com/Philipp15b/go-steam/steamid" - "io/ioutil" - "net/http" - "regexp" - "strconv" - "time" -) - -const tradeUrl = "https://steamcommunity.com/trade/%d/" - -type Trade struct { - client *http.Client - other steamid.SteamId - - LogPos uint // not automatically updated - Version uint // Incremented for each item change by Steam; not automatically updated. - - // the `sessionid` cookie is sent as a parameter/POST data for CSRF protection. - sessionId string - baseUrl string -} - -// Creates a new Trade based on the given cookies `sessionid`, `steamLogin`, `steamLoginSecure` and the trade partner's Steam ID. -func New(sessionId, steamLogin, steamLoginSecure string, other steamid.SteamId) *Trade { - client := new(http.Client) - client.Timeout = 10 * time.Second - - t := &Trade{ - client: client, - other: other, - sessionId: sessionId, - baseUrl: fmt.Sprintf(tradeUrl, other), - Version: 1, - } - community.SetCookies(t.client, sessionId, steamLogin, steamLoginSecure) - return t -} - -type Main struct { - PartnerOnProbation bool -} - -var onProbationRegex = regexp.MustCompile(`var g_bTradePartnerProbation = (\w+);`) - -// Fetches the main HTML page and parses it. Thread-safe. -func (t *Trade) GetMain() (*Main, error) { - resp, err := t.client.Get(t.baseUrl) - if err != nil { - return nil, err - } - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - match := onProbationRegex.FindSubmatch(body) - if len(match) == 0 { - return nil, errors.New("tradeapi.GetMain: Could not find probation info") - } - - return &Main{ - string(match[1]) == "true", - }, nil -} - -// Ajax POSTs to an API endpoint that should return a status -func (t *Trade) postWithStatus(url string, data map[string]string) (*Status, error) { - status := new(Status) - - req := netutil.NewPostForm(url, netutil.ToUrlValues(data)) - // Tales of Madness and Pain, Episode 1: If you forget this, Steam will return an error - // saying "missing required parameter", even though they are all there. IT WAS JUST THE HEADER, ARGH! - req.Header.Add("Referer", t.baseUrl) - - resp, err := t.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - err = json.NewDecoder(resp.Body).Decode(status) - if err != nil { - return nil, err - } - return status, nil -} - -func (t *Trade) GetStatus() (*Status, error) { - return t.postWithStatus(t.baseUrl+"tradestatus/", map[string]string{ - "sessionid": t.sessionId, - "logpos": strconv.FormatUint(uint64(t.LogPos), 10), - "version": strconv.FormatUint(uint64(t.Version), 10), - }) -} - -// Thread-safe. -func (t *Trade) GetForeignInventory(contextId uint64, appId uint32, start *uint) (*inventory.PartialInventory, error) { - data := map[string]string{ - "sessionid": t.sessionId, - "steamid": fmt.Sprintf("%d", t.other), - "contextid": strconv.FormatUint(contextId, 10), - "appid": strconv.FormatUint(uint64(appId), 10), - } - if start != nil { - data["start"] = strconv.FormatUint(uint64(*start), 10) - } - - req, err := http.NewRequest("GET", t.baseUrl+"foreigninventory?"+netutil.ToUrlValues(data).Encode(), nil) - if err != nil { - panic(err) - } - req.Header.Add("Referer", t.baseUrl) - - return inventory.DoInventoryRequest(t.client, req) -} - -// Thread-safe. -func (t *Trade) GetOwnInventory(contextId uint64, appId uint32) (*inventory.Inventory, error) { - return inventory.GetOwnInventory(t.client, contextId, appId) -} - -func (t *Trade) Chat(message string) (*Status, error) { - return t.postWithStatus(t.baseUrl+"chat", map[string]string{ - "sessionid": t.sessionId, - "logpos": strconv.FormatUint(uint64(t.LogPos), 10), - "version": strconv.FormatUint(uint64(t.Version), 10), - "message": message, - }) -} - -func (t *Trade) AddItem(slot uint, itemId, contextId uint64, appId uint32) (*Status, error) { - return t.postWithStatus(t.baseUrl+"additem", map[string]string{ - "sessionid": t.sessionId, - "slot": strconv.FormatUint(uint64(slot), 10), - "itemid": strconv.FormatUint(itemId, 10), - "contextid": strconv.FormatUint(contextId, 10), - "appid": strconv.FormatUint(uint64(appId), 10), - }) -} - -func (t *Trade) RemoveItem(slot uint, itemId, contextId uint64, appId uint32) (*Status, error) { - return t.postWithStatus(t.baseUrl+"removeitem", map[string]string{ - "sessionid": t.sessionId, - "slot": strconv.FormatUint(uint64(slot), 10), - "itemid": strconv.FormatUint(itemId, 10), - "contextid": strconv.FormatUint(contextId, 10), - "appid": strconv.FormatUint(uint64(appId), 10), - }) -} - -func (t *Trade) SetCurrency(amount uint, currencyId, contextId uint64, appId uint32) (*Status, error) { - return t.postWithStatus(t.baseUrl+"setcurrency", map[string]string{ - "sessionid": t.sessionId, - "amount": strconv.FormatUint(uint64(amount), 10), - "currencyid": strconv.FormatUint(uint64(currencyId), 10), - "contextid": strconv.FormatUint(contextId, 10), - "appid": strconv.FormatUint(uint64(appId), 10), - }) -} - -func (t *Trade) SetReady(ready bool) (*Status, error) { - return t.postWithStatus(t.baseUrl+"toggleready", map[string]string{ - "sessionid": t.sessionId, - "version": strconv.FormatUint(uint64(t.Version), 10), - "ready": fmt.Sprint(ready), - }) -} - -func (t *Trade) Confirm() (*Status, error) { - return t.postWithStatus(t.baseUrl+"confirm", map[string]string{ - "sessionid": t.sessionId, - "version": strconv.FormatUint(uint64(t.Version), 10), - }) -} - -func (t *Trade) Cancel() (*Status, error) { - return t.postWithStatus(t.baseUrl+"cancel", map[string]string{ - "sessionid": t.sessionId, - }) -} - -func isSuccess(v interface{}) bool { - if m, ok := v.(map[string]interface{}); ok { - return m["success"] == true - } - return false -} diff --git a/vendor/github.com/Philipp15b/go-steam/trade/types.go b/vendor/github.com/Philipp15b/go-steam/trade/types.go deleted file mode 100644 index e6f9a537..00000000 --- a/vendor/github.com/Philipp15b/go-steam/trade/types.go +++ /dev/null @@ -1,67 +0,0 @@ -package trade - -import ( - "github.com/Philipp15b/go-steam/trade/tradeapi" -) - -type TradeEndedEvent struct { - Reason TradeEndReason -} - -type TradeEndReason uint - -const ( - TradeEndReason_Complete TradeEndReason = 1 - TradeEndReason_Cancelled = 2 - TradeEndReason_Timeout = 3 - TradeEndReason_Failed = 4 -) - -func newItem(event *tradeapi.Event) *Item { - return &Item{ - event.AppId, - event.ContextId, - event.AssetId, - } -} - -type Item struct { - AppId uint32 - ContextId uint64 - AssetId uint64 -} - -type ItemAddedEvent struct { - Item *Item -} - -type ItemRemovedEvent struct { - Item *Item -} - -type ReadyEvent struct{} -type UnreadyEvent struct{} - -func newCurrency(event *tradeapi.Event) *Currency { - return &Currency{ - event.AppId, - event.ContextId, - event.CurrencyId, - } -} - -type Currency struct { - AppId uint32 - ContextId uint64 - CurrencyId uint64 -} - -type SetCurrencyEvent struct { - Currency *Currency - OldAmount uint64 - NewAmount uint64 -} - -type ChatEvent struct { - Message string -} diff --git a/vendor/github.com/Philipp15b/go-steam/tradeoffer/client.go b/vendor/github.com/Philipp15b/go-steam/tradeoffer/client.go deleted file mode 100644 index 7bf171c3..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tradeoffer/client.go +++ /dev/null @@ -1,452 +0,0 @@ -package tradeoffer - -import ( - "encoding/json" - "fmt" - "github.com/Philipp15b/go-steam/community" - "github.com/Philipp15b/go-steam/economy/inventory" - "github.com/Philipp15b/go-steam/netutil" - "github.com/Philipp15b/go-steam/steamid" - "io/ioutil" - "net/http" - "strconv" - "time" -) - -type APIKey string - -const apiUrl = "https://api.steampowered.com/IEconService/%s/v%d" - -type Client struct { - client *http.Client - key APIKey - sessionId string -} - -func NewClient(key APIKey, sessionId, steamLogin, steamLoginSecure string) *Client { - c := &Client{ - new(http.Client), - key, - sessionId, - } - community.SetCookies(c.client, sessionId, steamLogin, steamLoginSecure) - return c -} - -func (c *Client) GetOffer(offerId uint64) (*TradeOfferResult, error) { - resp, err := c.client.Get(fmt.Sprintf(apiUrl, "GetTradeOffer", 1) + "?" + netutil.ToUrlValues(map[string]string{ - "key": string(c.key), - "tradeofferid": strconv.FormatUint(offerId, 10), - "language": "en_us", - }).Encode()) - if err != nil { - return nil, err - } - defer resp.Body.Close() - t := new(struct { - Response *TradeOfferResult - }) - if err = json.NewDecoder(resp.Body).Decode(t); err != nil { - return nil, err - } - if t.Response == nil || t.Response.Offer == nil { - return nil, newSteamErrorf("steam returned empty offer result\n") - } - - return t.Response, nil -} - -func (c *Client) GetOffers(getSent bool, getReceived bool, getDescriptions bool, activeOnly bool, historicalOnly bool, timeHistoricalCutoff *uint32) (*TradeOffersResult, error) { - if !getSent && !getReceived { - return nil, fmt.Errorf("getSent and getReceived can't be both false\n") - } - - params := map[string]string{ - "key": string(c.key), - } - if getSent { - params["get_sent_offers"] = "1" - } - if getReceived { - params["get_received_offers"] = "1" - } - if getDescriptions { - params["get_descriptions"] = "1" - params["language"] = "en_us" - } - if activeOnly { - params["active_only"] = "1" - } - if historicalOnly { - params["historical_only"] = "1" - } - if timeHistoricalCutoff != nil { - params["time_historical_cutoff"] = strconv.FormatUint(uint64(*timeHistoricalCutoff), 10) - } - resp, err := c.client.Get(fmt.Sprintf(apiUrl, "GetTradeOffers", 1) + "?" + netutil.ToUrlValues(params).Encode()) - if err != nil { - return nil, err - } - defer resp.Body.Close() - t := new(struct { - Response *TradeOffersResult - }) - if err = json.NewDecoder(resp.Body).Decode(t); err != nil { - return nil, err - } - if t.Response == nil { - return nil, newSteamErrorf("steam returned empty offers result\n") - } - return t.Response, nil -} - -// action() is used by Decline() and Cancel() -// Steam only return success and error fields for malformed requests, -// hence client shall use GetOffer() to check action result -// It is also possible to implement Decline/Cancel using steamcommunity, -// which have more predictable responses -func (c *Client) action(method string, version uint, offerId uint64) error { - resp, err := c.client.Do(netutil.NewPostForm(fmt.Sprintf(apiUrl, method, version), netutil.ToUrlValues(map[string]string{ - "key": string(c.key), - "tradeofferid": strconv.FormatUint(offerId, 10), - }))) - if err != nil { - return err - } - defer resp.Body.Close() - if resp.StatusCode != 200 { - return fmt.Errorf(method+" error: status code %d", resp.StatusCode) - } - return nil -} - -func (c *Client) Decline(offerId uint64) error { - return c.action("DeclineTradeOffer", 1, offerId) -} - -func (c *Client) Cancel(offerId uint64) error { - return c.action("CancelTradeOffer", 1, offerId) -} - -// Accept received trade offer -// It is best to confirm that offer was actually accepted -// by calling GetOffer after Accept and checking offer state -func (c *Client) Accept(offerId uint64) error { - baseurl := fmt.Sprintf("https://steamcommunity.com/tradeoffer/%d/", offerId) - req := netutil.NewPostForm(baseurl+"accept", netutil.ToUrlValues(map[string]string{ - "sessionid": c.sessionId, - "serverid": "1", - "tradeofferid": strconv.FormatUint(offerId, 10), - })) - req.Header.Add("Referer", baseurl) - - resp, err := c.client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - t := new(struct { - StrError string `json:"strError"` - }) - if err = json.NewDecoder(resp.Body).Decode(t); err != nil { - return err - } - if t.StrError != "" { - return newSteamErrorf("accept error: %v\n", t.StrError) - } - if resp.StatusCode != 200 { - return fmt.Errorf("accept error: status code %d", resp.StatusCode) - } - return nil -} - -type TradeItem struct { - AppId uint32 `json:"appid"` - ContextId uint64 `json:"contextid,string"` - Amount uint64 `json:"amount"` - AssetId uint64 `json:"assetid,string,omitempty"` - CurrencyId uint64 `json:"currencyid,string,omitempty"` -} - -// Sends a new trade offer to the given Steam user. You can optionally specify an access token if you've got one. -// In addition, `counteredOfferId` can be non-nil, indicating the trade offer this is a counter for. -// On success returns trade offer id -func (c *Client) Create(other steamid.SteamId, accessToken *string, myItems, theirItems []TradeItem, counteredOfferId *uint64, message string) (uint64, error) { - // Create new trade offer status - to := map[string]interface{}{ - "newversion": true, - "version": 3, - "me": map[string]interface{}{ - "assets": myItems, - "currency": make([]struct{}, 0), - "ready": false, - }, - "them": map[string]interface{}{ - "assets": theirItems, - "currency": make([]struct{}, 0), - "ready": false, - }, - } - - jto, err := json.Marshal(to) - if err != nil { - panic(err) - } - - // Create url parameters for request - data := map[string]string{ - "sessionid": c.sessionId, - "serverid": "1", - "partner": other.ToString(), - "tradeoffermessage": message, - "json_tradeoffer": string(jto), - } - - var referer string - if counteredOfferId != nil { - referer = fmt.Sprintf("https://steamcommunity.com/tradeoffer/%d/", *counteredOfferId) - data["tradeofferid_countered"] = strconv.FormatUint(*counteredOfferId, 10) - } else { - // Add token for non-friend offers - if accessToken != nil { - params := map[string]string{ - "trade_offer_access_token": *accessToken, - } - paramsJson, err := json.Marshal(params) - if err != nil { - panic(err) - } - - data["trade_offer_create_params"] = string(paramsJson) - - referer = "https://steamcommunity.com/tradeoffer/new/?partner=" + strconv.FormatUint(uint64(other.GetAccountId()), 10) + "&token=" + *accessToken - } else { - - referer = "https://steamcommunity.com/tradeoffer/new/?partner=" + strconv.FormatUint(uint64(other.GetAccountId()), 10) - } - } - - // Create request - req := netutil.NewPostForm("https://steamcommunity.com/tradeoffer/new/send", netutil.ToUrlValues(data)) - req.Header.Add("Referer", referer) - - // Send request - resp, err := c.client.Do(req) - if err != nil { - return 0, err - } - defer resp.Body.Close() - t := new(struct { - StrError string `json:"strError"` - TradeOfferId uint64 `json:"tradeofferid,string"` - }) - if err = json.NewDecoder(resp.Body).Decode(t); err != nil { - return 0, err - } - // strError code descriptions: - // 15 invalide trade access token - // 16 timeout - // 20 wrong contextid - // 25 can't send more offers until some is accepted/cancelled... - // 26 object is not in our inventory - // error code names are in internal/steamlang/enums.go EResult_name - if t.StrError != "" { - return 0, newSteamErrorf("create error: %v\n", t.StrError) - } - if resp.StatusCode != 200 { - return 0, fmt.Errorf("create error: status code %d", resp.StatusCode) - } - if t.TradeOfferId == 0 { - return 0, newSteamErrorf("create error: steam returned 0 for trade offer id") - } - return t.TradeOfferId, nil -} - -func (c *Client) GetOwnInventory(contextId uint64, appId uint32) (*inventory.Inventory, error) { - return inventory.GetOwnInventory(c.client, contextId, appId) -} - -func (c *Client) GetPartnerInventory(other steamid.SteamId, contextId uint64, appId uint32, offerId *uint64) (*inventory.Inventory, error) { - return inventory.GetFullInventory(func() (*inventory.PartialInventory, error) { - return c.getPartialPartnerInventory(other, contextId, appId, offerId, nil) - }, func(start uint) (*inventory.PartialInventory, error) { - return c.getPartialPartnerInventory(other, contextId, appId, offerId, &start) - }) -} - -func (c *Client) getPartialPartnerInventory(other steamid.SteamId, contextId uint64, appId uint32, offerId *uint64, start *uint) (*inventory.PartialInventory, error) { - data := map[string]string{ - "sessionid": c.sessionId, - "partner": other.ToString(), - "contextid": strconv.FormatUint(contextId, 10), - "appid": strconv.FormatUint(uint64(appId), 10), - } - if start != nil { - data["start"] = strconv.FormatUint(uint64(*start), 10) - } - - baseUrl := "https://steamcommunity.com/tradeoffer/%v/" - if offerId != nil { - baseUrl = fmt.Sprintf(baseUrl, *offerId) - } else { - baseUrl = fmt.Sprintf(baseUrl, "new") - } - - req, err := http.NewRequest("GET", baseUrl+"partnerinventory/?"+netutil.ToUrlValues(data).Encode(), nil) - if err != nil { - panic(err) - } - req.Header.Add("Referer", baseUrl+"?partner="+strconv.FormatUint(uint64(other.GetAccountId()), 10)) - - return inventory.DoInventoryRequest(c.client, req) -} - -// Can be used to verify accepted tradeoffer and find out received asset ids -func (c *Client) GetTradeReceipt(tradeId uint64) ([]*TradeReceiptItem, error) { - url := fmt.Sprintf("https://steamcommunity.com/trade/%d/receipt", tradeId) - resp, err := c.client.Get(url) - if err != nil { - return nil, err - } - defer resp.Body.Close() - respBody, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - items, err := parseTradeReceipt(respBody) - if err != nil { - return nil, newSteamErrorf("failed to parse trade receipt: %v", err) - } - return items, nil -} - -// Get duration of escrow in days. Call this before sending a trade offer -func (c *Client) GetPartnerEscrowDuration(other steamid.SteamId, accessToken *string) (*EscrowDuration, error) { - data := map[string]string{ - "partner": strconv.FormatUint(uint64(other.GetAccountId()), 10), - } - if accessToken != nil { - data["token"] = *accessToken - } - return c.getEscrowDuration("https://steamcommunity.com/tradeoffer/new/?" + netutil.ToUrlValues(data).Encode()) -} - -// Get duration of escrow in days. Call this after receiving a trade offer -func (c *Client) GetOfferEscrowDuration(offerId uint64) (*EscrowDuration, error) { - return c.getEscrowDuration("http://steamcommunity.com/tradeoffer/" + strconv.FormatUint(offerId, 10)) -} - -func (c *Client) getEscrowDuration(queryUrl string) (*EscrowDuration, error) { - resp, err := c.client.Get(queryUrl) - if err != nil { - return nil, fmt.Errorf("failed to retrieve escrow duration: %v", err) - } - defer resp.Body.Close() - respBody, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - escrowDuration, err := parseEscrowDuration(respBody) - if err != nil { - return nil, newSteamErrorf("failed to parse escrow duration: %v", err) - } - return escrowDuration, nil -} - -func (c *Client) GetOfferWithRetry(offerId uint64, retryCount int, retryDelay time.Duration) (*TradeOfferResult, error) { - var res *TradeOfferResult - return res, withRetry( - func() (err error) { - res, err = c.GetOffer(offerId) - return err - }, retryCount, retryDelay) -} - -func (c *Client) GetOffersWithRetry(getSent bool, getReceived bool, getDescriptions bool, activeOnly bool, historicalOnly bool, timeHistoricalCutoff *uint32, retryCount int, retryDelay time.Duration) (*TradeOffersResult, error) { - var res *TradeOffersResult - return res, withRetry( - func() (err error) { - res, err = c.GetOffers(getSent, getReceived, getDescriptions, activeOnly, historicalOnly, timeHistoricalCutoff) - return err - }, retryCount, retryDelay) -} - -func (c *Client) DeclineWithRetry(offerId uint64, retryCount int, retryDelay time.Duration) error { - return withRetry( - func() error { - return c.Decline(offerId) - }, retryCount, retryDelay) -} - -func (c *Client) CancelWithRetry(offerId uint64, retryCount int, retryDelay time.Duration) error { - return withRetry( - func() error { - return c.Cancel(offerId) - }, retryCount, retryDelay) -} - -func (c *Client) AcceptWithRetry(offerId uint64, retryCount int, retryDelay time.Duration) error { - return withRetry( - func() error { - return c.Accept(offerId) - }, retryCount, retryDelay) -} - -func (c *Client) CreateWithRetry(other steamid.SteamId, accessToken *string, myItems, theirItems []TradeItem, counteredOfferId *uint64, message string, retryCount int, retryDelay time.Duration) (uint64, error) { - var res uint64 - return res, withRetry( - func() (err error) { - res, err = c.Create(other, accessToken, myItems, theirItems, counteredOfferId, message) - return err - }, retryCount, retryDelay) -} - -func (c *Client) GetOwnInventoryWithRetry(contextId uint64, appId uint32, retryCount int, retryDelay time.Duration) (*inventory.Inventory, error) { - var res *inventory.Inventory - return res, withRetry( - func() (err error) { - res, err = c.GetOwnInventory(contextId, appId) - return err - }, retryCount, retryDelay) -} - -func (c *Client) GetPartnerInventoryWithRetry(other steamid.SteamId, contextId uint64, appId uint32, offerId *uint64, retryCount int, retryDelay time.Duration) (*inventory.Inventory, error) { - var res *inventory.Inventory - return res, withRetry( - func() (err error) { - res, err = c.GetPartnerInventory(other, contextId, appId, offerId) - return err - }, retryCount, retryDelay) -} - -func (c *Client) GetTradeReceiptWithRetry(tradeId uint64, retryCount int, retryDelay time.Duration) ([]*TradeReceiptItem, error) { - var res []*TradeReceiptItem - return res, withRetry( - func() (err error) { - res, err = c.GetTradeReceipt(tradeId) - return err - }, retryCount, retryDelay) -} - -func withRetry(f func() error, retryCount int, retryDelay time.Duration) error { - if retryCount <= 0 { - panic("retry count must be more than 0") - } - i := 0 - for { - i++ - if err := f(); err != nil { - // If we got steam error do not retry - if _, ok := err.(*SteamError); ok { - return err - } - if i == retryCount { - return err - } - time.Sleep(retryDelay) - continue - } - break - } - return nil -} diff --git a/vendor/github.com/Philipp15b/go-steam/tradeoffer/error.go b/vendor/github.com/Philipp15b/go-steam/tradeoffer/error.go deleted file mode 100644 index 439ee69c..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tradeoffer/error.go +++ /dev/null @@ -1,19 +0,0 @@ -package tradeoffer - -import ( - "fmt" -) - -// SteamError can be returned by Create, Accept, Decline and Cancel methods. -// It means we got response from steam, but it was in unknown format -// or request was declined. -type SteamError struct { - msg string -} - -func (e *SteamError) Error() string { - return e.msg -} -func newSteamErrorf(format string, a ...interface{}) *SteamError { - return &SteamError{fmt.Sprintf(format, a...)} -} diff --git a/vendor/github.com/Philipp15b/go-steam/tradeoffer/escrow.go b/vendor/github.com/Philipp15b/go-steam/tradeoffer/escrow.go deleted file mode 100644 index 07806716..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tradeoffer/escrow.go +++ /dev/null @@ -1,47 +0,0 @@ -package tradeoffer - -import ( - "errors" - "fmt" - "regexp" - "strconv" -) - -type EscrowDuration struct { - DaysMyEscrow uint32 - DaysTheirEscrow uint32 -} - -func parseEscrowDuration(data []byte) (*EscrowDuration, error) { - // TODO: why we are using case insensitive matching? - myRegex := regexp.MustCompile("(?i)g_daysMyEscrow[\\s=]+(\\d+);") - theirRegex := regexp.MustCompile("(?i)g_daysTheirEscrow[\\s=]+(\\d+);") - - myM := myRegex.FindSubmatch(data) - theirM := theirRegex.FindSubmatch(data) - - if myM == nil || theirM == nil { - // check if access token is valid - notFriendsRegex := regexp.MustCompile(">You are not friends with this user<") - notFriendsM := notFriendsRegex.FindSubmatch(data) - if notFriendsM == nil { - return nil, errors.New("regexp does not match") - } else { - return nil, errors.New("you are not friends with this user") - } - } - - myEscrow, err := strconv.ParseUint(string(myM[1]), 10, 32) - if err != nil { - return nil, fmt.Errorf("failed to parse my duration into uint: %v", err) - } - theirEscrow, err := strconv.ParseUint(string(theirM[1]), 10, 32) - if err != nil { - return nil, fmt.Errorf("failed to parse their duration into uint: %v", err) - } - - return &EscrowDuration{ - DaysMyEscrow: uint32(myEscrow), - DaysTheirEscrow: uint32(theirEscrow), - }, nil -} diff --git a/vendor/github.com/Philipp15b/go-steam/tradeoffer/receipt.go b/vendor/github.com/Philipp15b/go-steam/tradeoffer/receipt.go deleted file mode 100644 index 3f4b556d..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tradeoffer/receipt.go +++ /dev/null @@ -1,35 +0,0 @@ -package tradeoffer - -import ( - "encoding/json" - "fmt" - "github.com/Philipp15b/go-steam/economy/inventory" - "regexp" -) - -type TradeReceiptItem struct { - AssetId uint64 `json:"id,string"` - AppId uint32 - ContextId uint64 - Owner uint64 `json:",string"` - Pos uint32 - inventory.Description -} - -func parseTradeReceipt(data []byte) ([]*TradeReceiptItem, error) { - reg := regexp.MustCompile("oItem =\\s+(.+?});") - itemMatches := reg.FindAllSubmatch(data, -1) - if itemMatches == nil { - return nil, fmt.Errorf("items not found\n") - } - items := make([]*TradeReceiptItem, 0, len(itemMatches)) - for _, m := range itemMatches { - item := new(TradeReceiptItem) - err := json.Unmarshal(m[1], &item) - if err != nil { - return nil, err - } - items = append(items, item) - } - return items, nil -} diff --git a/vendor/github.com/Philipp15b/go-steam/tradeoffer/tradeoffer.go b/vendor/github.com/Philipp15b/go-steam/tradeoffer/tradeoffer.go deleted file mode 100644 index 1cf3aaa3..00000000 --- a/vendor/github.com/Philipp15b/go-steam/tradeoffer/tradeoffer.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Implements methods to interact with the official Trade Offer API. - -See: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService -*/ -package tradeoffer - -import ( - "encoding/json" - "github.com/Philipp15b/go-steam/economy/inventory" - "github.com/Philipp15b/go-steam/steamid" -) - -type TradeOfferState uint - -const ( - TradeOfferState_Invalid TradeOfferState = 1 // Invalid - TradeOfferState_Active = 2 // This trade offer has been sent, neither party has acted on it yet. - TradeOfferState_Accepted = 3 // The trade offer was accepted by the recipient and items were exchanged. - TradeOfferState_Countered = 4 // The recipient made a counter offer - TradeOfferState_Expired = 5 // The trade offer was not accepted before the expiration date - TradeOfferState_Canceled = 6 // The sender cancelled the offer - TradeOfferState_Declined = 7 // The recipient declined the offer - TradeOfferState_InvalidItems = 8 // Some of the items in the offer are no longer available (indicated by the missing flag in the output) - TradeOfferState_CreatedNeedsConfirmation = 9 // The offer hasn't been sent yet and is awaiting email/mobile confirmation. The offer is only visible to the sender. - TradeOfferState_CanceledBySecondFactor = 10 // Either party canceled the offer via email/mobile. The offer is visible to both parties, even if the sender canceled it before it was sent. - TradeOfferState_InEscrow = 11 // The trade has been placed on hold. The items involved in the trade have all been removed from both parties' inventories and will be automatically delivered in the future. -) - -type TradeOfferConfirmationMethod uint - -const ( - TradeOfferConfirmationMethod_Invalid TradeOfferConfirmationMethod = 0 - TradeOfferConfirmationMethod_Email = 1 - TradeOfferConfirmationMethod_MobileApp = 2 -) - -type Asset struct { - AppId uint32 `json:",string"` - ContextId uint64 `json:",string"` - AssetId uint64 `json:",string"` - CurrencyId uint64 `json:",string"` - ClassId uint64 `json:",string"` - InstanceId uint64 `json:",string"` - Amount uint64 `json:",string"` - Missing bool -} - -type TradeOffer struct { - TradeOfferId uint64 `json:",string"` - TradeId uint64 `json:",string"` - OtherAccountId uint32 `json:"accountid_other"` - OtherSteamId steamid.SteamId `json:"-"` - Message string `json:"message"` - ExpirationTime uint32 `json:"expiraton_time"` - State TradeOfferState `json:"trade_offer_state"` - ToGive []*Asset `json:"items_to_give"` - ToReceive []*Asset `json:"items_to_receive"` - IsOurOffer bool `json:"is_our_offer"` - TimeCreated uint32 `json:"time_created"` - TimeUpdated uint32 `json:"time_updated"` - EscrowEndDate uint32 `json:"escrow_end_date"` - ConfirmationMethod TradeOfferConfirmationMethod `json:"confirmation_method"` -} - -func (t *TradeOffer) UnmarshalJSON(data []byte) error { - type Alias TradeOffer - aux := struct { - *Alias - }{ - Alias: (*Alias)(t), - } - if err := json.Unmarshal(data, &aux); err != nil { - return err - } - if t.OtherAccountId == 0 { - t.OtherSteamId = steamid.SteamId(0) - return nil - } - t.OtherSteamId = steamid.SteamId(uint64(t.OtherAccountId) + 76561197960265728) - return nil -} - -type TradeOffersResult struct { - Sent []*TradeOffer `json:"trade_offers_sent"` - Received []*TradeOffer `json:"trade_offers_received"` - Descriptions []*Description -} - -type TradeOfferResult struct { - Offer *TradeOffer - Descriptions []*Description -} -type Description struct { - AppId uint32 `json:"appid"` - ClassId uint64 `json:"classid,string"` - InstanceId uint64 `json:"instanceid,string"` - - IconUrl string `json:"icon_url"` - IconUrlLarge string `json:"icon_url_large"` - - Name string - MarketName string `json:"market_name"` - MarketHashName string `json:"market_hash_name"` - - // Colors in hex, for example `B2B2B2` - NameColor string `json:"name_color"` - BackgroundColor string `json:"background_color"` - - Type string - - Tradable bool `json:"tradable"` - Commodity bool `json:"commodity"` - MarketTradableRestriction uint32 `json:"market_tradable_restriction"` - - Descriptions inventory.DescriptionLines `json:"descriptions"` - Actions []*inventory.Action `json:"actions"` -} diff --git a/vendor/github.com/alecthomas/log4go/.gitignore b/vendor/github.com/alecthomas/log4go/.gitignore new file mode 100644 index 00000000..f6207cd8 --- /dev/null +++ b/vendor/github.com/alecthomas/log4go/.gitignore @@ -0,0 +1,2 @@ +*.sw[op] +.DS_Store diff --git a/vendor/github.com/alecthomas/log4go/README b/vendor/github.com/alecthomas/log4go/README new file mode 100644 index 00000000..3361567f --- /dev/null +++ b/vendor/github.com/alecthomas/log4go/README @@ -0,0 +1,14 @@ +# This is an unmaintained fork, left only so it doesn't break imports. + +Please see http://log4go.googlecode.com/ + +Installation: +- Run `goinstall log4go.googlecode.com/hg` + +Usage: +- Add the following import: +import l4g "log4go.googlecode.com/hg" + +Acknowledgements: +- pomack + For providing awesome patches to bring log4go up to the latest Go spec diff --git a/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go b/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go deleted file mode 100644 index 698dd332..00000000 --- a/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "time" -) - -import l4g "code.google.com/p/log4go" - -func main() { - log := l4g.NewLogger() - defer log.Close() - log.AddFilter("stdout", l4g.DEBUG, l4g.NewConsoleLogWriter()) - log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02")) -} diff --git a/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go b/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go deleted file mode 100644 index efd596aa..00000000 --- a/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go +++ /dev/null @@ -1,57 +0,0 @@ -package main - -import ( - "bufio" - "fmt" - "io" - "os" - "time" -) - -import l4g "code.google.com/p/log4go" - -const ( - filename = "flw.log" -) - -func main() { - // Get a new logger instance - log := l4g.NewLogger() - - // Create a default logger that is logging messages of FINE or higher - log.AddFilter("file", l4g.FINE, l4g.NewFileLogWriter(filename, false)) - log.Close() - - /* Can also specify manually via the following: (these are the defaults) */ - flw := l4g.NewFileLogWriter(filename, false) - flw.SetFormat("[%D %T] [%L] (%S) %M") - flw.SetRotate(false) - flw.SetRotateSize(0) - flw.SetRotateLines(0) - flw.SetRotateDaily(false) - log.AddFilter("file", l4g.FINE, flw) - - // Log some experimental messages - log.Finest("Everything is created now (notice that I will not be printing to the file)") - log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02")) - log.Critical("Time to close out!") - - // Close the log - log.Close() - - // Print what was logged to the file (yes, I know I'm skipping error checking) - fd, _ := os.Open(filename) - in := bufio.NewReader(fd) - fmt.Print("Messages logged to file were: (line numbers not included)\n") - for lineno := 1; ; lineno++ { - line, err := in.ReadString('\n') - if err == io.EOF { - break - } - fmt.Printf("%3d:\t%s", lineno, line) - } - fd.Close() - - // Remove the file so it's not lying around - os.Remove(filename) -} diff --git a/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go b/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go deleted file mode 100644 index 83c80ad1..00000000 --- a/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "net" - "os" -) - -var ( - port = flag.String("p", "12124", "Port number to listen on") -) - -func e(err error) { - if err != nil { - fmt.Printf("Erroring out: %s\n", err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - // Bind to the port - bind, err := net.ResolveUDPAddr("0.0.0.0:" + *port) - e(err) - - // Create listener - listener, err := net.ListenUDP("udp", bind) - e(err) - - fmt.Printf("Listening to port %s...\n", *port) - for { - // read into a new buffer - buffer := make([]byte, 1024) - _, _, err := listener.ReadFrom(buffer) - e(err) - - // log to standard output - fmt.Println(string(buffer)) - } -} diff --git a/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go b/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go deleted file mode 100644 index 400b698c..00000000 --- a/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "time" -) - -import l4g "code.google.com/p/log4go" - -func main() { - log := l4g.NewLogger() - log.AddFilter("network", l4g.FINEST, l4g.NewSocketLogWriter("udp", "192.168.1.255:12124")) - - // Run `nc -u -l -p 12124` or similar before you run this to see the following message - log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02")) - - // This makes sure the output stream buffer is written - log.Close() -} diff --git a/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go b/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go deleted file mode 100644 index 164c2add..00000000 --- a/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import l4g "code.google.com/p/log4go" - -func main() { - // Load the configuration (isn't this easy?) - l4g.LoadConfiguration("example.xml") - - // And now we're ready! - l4g.Finest("This will only go to those of you really cool UDP kids! If you change enabled=true.") - l4g.Debug("Oh no! %d + %d = %d!", 2, 2, 2+2) - l4g.Info("About that time, eh chaps?") -} diff --git a/vendor/github.com/armon/consul-api/LICENSE b/vendor/github.com/armon/consul-api/LICENSE deleted file mode 100644 index f0e5c79e..00000000 --- a/vendor/github.com/armon/consul-api/LICENSE +++ /dev/null @@ -1,362 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/vendor/github.com/armon/consul-api/acl.go b/vendor/github.com/armon/consul-api/acl.go deleted file mode 100644 index e0179f54..00000000 --- a/vendor/github.com/armon/consul-api/acl.go +++ /dev/null @@ -1,140 +0,0 @@ -package consulapi - -const ( - // ACLCLientType is the client type token - ACLClientType = "client" - - // ACLManagementType is the management type token - ACLManagementType = "management" -) - -// ACLEntry is used to represent an ACL entry -type ACLEntry struct { - CreateIndex uint64 - ModifyIndex uint64 - ID string - Name string - Type string - Rules string -} - -// ACL can be used to query the ACL endpoints -type ACL struct { - c *Client -} - -// ACL returns a handle to the ACL endpoints -func (c *Client) ACL() *ACL { - return &ACL{c} -} - -// Create is used to generate a new token with the given parameters -func (a *ACL) Create(acl *ACLEntry, q *WriteOptions) (string, *WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/create") - r.setWriteOptions(q) - r.obj = acl - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Update is used to update the rules of an existing token -func (a *ACL) Update(acl *ACLEntry, q *WriteOptions) (*WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/update") - r.setWriteOptions(q) - r.obj = acl - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - return wm, nil -} - -// Destroy is used to destroy a given ACL token ID -func (a *ACL) Destroy(id string, q *WriteOptions) (*WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/destroy/"+id) - r.setWriteOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - return wm, nil -} - -// Clone is used to return a new token cloned from an existing one -func (a *ACL) Clone(id string, q *WriteOptions) (string, *WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/clone/"+id) - r.setWriteOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Info is used to query for information about an ACL token -func (a *ACL) Info(id string, q *QueryOptions) (*ACLEntry, *QueryMeta, error) { - r := a.c.newRequest("GET", "/v1/acl/info/"+id) - r.setQueryOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*ACLEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - if len(entries) > 0 { - return entries[0], qm, nil - } - return nil, qm, nil -} - -// List is used to get all the ACL tokens -func (a *ACL) List(q *QueryOptions) ([]*ACLEntry, *QueryMeta, error) { - r := a.c.newRequest("GET", "/v1/acl/list") - r.setQueryOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*ACLEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} diff --git a/vendor/github.com/armon/consul-api/agent.go b/vendor/github.com/armon/consul-api/agent.go deleted file mode 100644 index eec93cb9..00000000 --- a/vendor/github.com/armon/consul-api/agent.go +++ /dev/null @@ -1,272 +0,0 @@ -package consulapi - -import ( - "fmt" -) - -// AgentCheck represents a check known to the agent -type AgentCheck struct { - Node string - CheckID string - Name string - Status string - Notes string - Output string - ServiceID string - ServiceName string -} - -// AgentService represents a service known to the agent -type AgentService struct { - ID string - Service string - Tags []string - Port int -} - -// AgentMember represents a cluster member known to the agent -type AgentMember struct { - Name string - Addr string - Port uint16 - Tags map[string]string - Status int - ProtocolMin uint8 - ProtocolMax uint8 - ProtocolCur uint8 - DelegateMin uint8 - DelegateMax uint8 - DelegateCur uint8 -} - -// AgentServiceRegistration is used to register a new service -type AgentServiceRegistration struct { - ID string `json:",omitempty"` - Name string `json:",omitempty"` - Tags []string `json:",omitempty"` - Port int `json:",omitempty"` - Check *AgentServiceCheck -} - -// AgentCheckRegistration is used to register a new check -type AgentCheckRegistration struct { - ID string `json:",omitempty"` - Name string `json:",omitempty"` - Notes string `json:",omitempty"` - AgentServiceCheck -} - -// AgentServiceCheck is used to create an associated -// check for a service -type AgentServiceCheck struct { - Script string `json:",omitempty"` - Interval string `json:",omitempty"` - TTL string `json:",omitempty"` -} - -// Agent can be used to query the Agent endpoints -type Agent struct { - c *Client - - // cache the node name - nodeName string -} - -// Agent returns a handle to the agent endpoints -func (c *Client) Agent() *Agent { - return &Agent{c: c} -} - -// Self is used to query the agent we are speaking to for -// information about itself -func (a *Agent) Self() (map[string]map[string]interface{}, error) { - r := a.c.newRequest("GET", "/v1/agent/self") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out map[string]map[string]interface{} - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// NodeName is used to get the node name of the agent -func (a *Agent) NodeName() (string, error) { - if a.nodeName != "" { - return a.nodeName, nil - } - info, err := a.Self() - if err != nil { - return "", err - } - name := info["Config"]["NodeName"].(string) - a.nodeName = name - return name, nil -} - -// Checks returns the locally registered checks -func (a *Agent) Checks() (map[string]*AgentCheck, error) { - r := a.c.newRequest("GET", "/v1/agent/checks") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out map[string]*AgentCheck - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Services returns the locally registered services -func (a *Agent) Services() (map[string]*AgentService, error) { - r := a.c.newRequest("GET", "/v1/agent/services") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out map[string]*AgentService - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Members returns the known gossip members. The WAN -// flag can be used to query a server for WAN members. -func (a *Agent) Members(wan bool) ([]*AgentMember, error) { - r := a.c.newRequest("GET", "/v1/agent/members") - if wan { - r.params.Set("wan", "1") - } - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []*AgentMember - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// ServiceRegister is used to register a new service with -// the local agent -func (a *Agent) ServiceRegister(service *AgentServiceRegistration) error { - r := a.c.newRequest("PUT", "/v1/agent/service/register") - r.obj = service - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// ServiceDeregister is used to deregister a service with -// the local agent -func (a *Agent) ServiceDeregister(serviceID string) error { - r := a.c.newRequest("PUT", "/v1/agent/service/deregister/"+serviceID) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// PassTTL is used to set a TTL check to the passing state -func (a *Agent) PassTTL(checkID, note string) error { - return a.UpdateTTL(checkID, note, "pass") -} - -// WarnTTL is used to set a TTL check to the warning state -func (a *Agent) WarnTTL(checkID, note string) error { - return a.UpdateTTL(checkID, note, "warn") -} - -// FailTTL is used to set a TTL check to the failing state -func (a *Agent) FailTTL(checkID, note string) error { - return a.UpdateTTL(checkID, note, "fail") -} - -// UpdateTTL is used to update the TTL of a check -func (a *Agent) UpdateTTL(checkID, note, status string) error { - switch status { - case "pass": - case "warn": - case "fail": - default: - return fmt.Errorf("Invalid status: %s", status) - } - endpoint := fmt.Sprintf("/v1/agent/check/%s/%s", status, checkID) - r := a.c.newRequest("PUT", endpoint) - r.params.Set("note", note) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// CheckRegister is used to register a new check with -// the local agent -func (a *Agent) CheckRegister(check *AgentCheckRegistration) error { - r := a.c.newRequest("PUT", "/v1/agent/check/register") - r.obj = check - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// CheckDeregister is used to deregister a check with -// the local agent -func (a *Agent) CheckDeregister(checkID string) error { - r := a.c.newRequest("PUT", "/v1/agent/check/deregister/"+checkID) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// Join is used to instruct the agent to attempt a join to -// another cluster member -func (a *Agent) Join(addr string, wan bool) error { - r := a.c.newRequest("PUT", "/v1/agent/join/"+addr) - if wan { - r.params.Set("wan", "1") - } - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// ForceLeave is used to have the agent eject a failed node -func (a *Agent) ForceLeave(node string) error { - r := a.c.newRequest("PUT", "/v1/agent/force-leave/"+node) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} diff --git a/vendor/github.com/armon/consul-api/api.go b/vendor/github.com/armon/consul-api/api.go deleted file mode 100644 index e1335769..00000000 --- a/vendor/github.com/armon/consul-api/api.go +++ /dev/null @@ -1,323 +0,0 @@ -package consulapi - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "strconv" - "time" -) - -// QueryOptions are used to parameterize a query -type QueryOptions struct { - // Providing a datacenter overwrites the DC provided - // by the Config - Datacenter string - - // AllowStale allows any Consul server (non-leader) to service - // a read. This allows for lower latency and higher throughput - AllowStale bool - - // RequireConsistent forces the read to be fully consistent. - // This is more expensive but prevents ever performing a stale - // read. - RequireConsistent bool - - // WaitIndex is used to enable a blocking query. Waits - // until the timeout or the next index is reached - WaitIndex uint64 - - // WaitTime is used to bound the duration of a wait. - // Defaults to that of the Config, but can be overriden. - WaitTime time.Duration - - // Token is used to provide a per-request ACL token - // which overrides the agent's default token. - Token string -} - -// WriteOptions are used to parameterize a write -type WriteOptions struct { - // Providing a datacenter overwrites the DC provided - // by the Config - Datacenter string - - // Token is used to provide a per-request ACL token - // which overrides the agent's default token. - Token string -} - -// QueryMeta is used to return meta data about a query -type QueryMeta struct { - // LastIndex. This can be used as a WaitIndex to perform - // a blocking query - LastIndex uint64 - - // Time of last contact from the leader for the - // server servicing the request - LastContact time.Duration - - // Is there a known leader - KnownLeader bool - - // How long did the request take - RequestTime time.Duration -} - -// WriteMeta is used to return meta data about a write -type WriteMeta struct { - // How long did the request take - RequestTime time.Duration -} - -// HttpBasicAuth is used to authenticate http client with HTTP Basic Authentication -type HttpBasicAuth struct { - // Username to use for HTTP Basic Authentication - Username string - - // Password to use for HTTP Basic Authentication - Password string -} - -// Config is used to configure the creation of a client -type Config struct { - // Address is the address of the Consul server - Address string - - // Scheme is the URI scheme for the Consul server - Scheme string - - // Datacenter to use. If not provided, the default agent datacenter is used. - Datacenter string - - // HttpClient is the client to use. Default will be - // used if not provided. - HttpClient *http.Client - - // HttpAuth is the auth info to use for http access. - HttpAuth *HttpBasicAuth - - // WaitTime limits how long a Watch will block. If not provided, - // the agent default values will be used. - WaitTime time.Duration - - // Token is used to provide a per-request ACL token - // which overrides the agent's default token. - Token string -} - -// DefaultConfig returns a default configuration for the client -func DefaultConfig() *Config { - return &Config{ - Address: "127.0.0.1:8500", - Scheme: "http", - HttpClient: http.DefaultClient, - } -} - -// Client provides a client to the Consul API -type Client struct { - config Config -} - -// NewClient returns a new client -func NewClient(config *Config) (*Client, error) { - // bootstrap the config - defConfig := DefaultConfig() - - if len(config.Address) == 0 { - config.Address = defConfig.Address - } - - if len(config.Scheme) == 0 { - config.Scheme = defConfig.Scheme - } - - if config.HttpClient == nil { - config.HttpClient = defConfig.HttpClient - } - - client := &Client{ - config: *config, - } - return client, nil -} - -// request is used to help build up a request -type request struct { - config *Config - method string - url *url.URL - params url.Values - body io.Reader - obj interface{} -} - -// setQueryOptions is used to annotate the request with -// additional query options -func (r *request) setQueryOptions(q *QueryOptions) { - if q == nil { - return - } - if q.Datacenter != "" { - r.params.Set("dc", q.Datacenter) - } - if q.AllowStale { - r.params.Set("stale", "") - } - if q.RequireConsistent { - r.params.Set("consistent", "") - } - if q.WaitIndex != 0 { - r.params.Set("index", strconv.FormatUint(q.WaitIndex, 10)) - } - if q.WaitTime != 0 { - r.params.Set("wait", durToMsec(q.WaitTime)) - } - if q.Token != "" { - r.params.Set("token", q.Token) - } -} - -// durToMsec converts a duration to a millisecond specified string -func durToMsec(dur time.Duration) string { - return fmt.Sprintf("%dms", dur/time.Millisecond) -} - -// setWriteOptions is used to annotate the request with -// additional write options -func (r *request) setWriteOptions(q *WriteOptions) { - if q == nil { - return - } - if q.Datacenter != "" { - r.params.Set("dc", q.Datacenter) - } - if q.Token != "" { - r.params.Set("token", q.Token) - } -} - -// toHTTP converts the request to an HTTP request -func (r *request) toHTTP() (*http.Request, error) { - // Encode the query parameters - r.url.RawQuery = r.params.Encode() - - // Get the url sring - urlRaw := r.url.String() - - // Check if we should encode the body - if r.body == nil && r.obj != nil { - if b, err := encodeBody(r.obj); err != nil { - return nil, err - } else { - r.body = b - } - } - - // Create the HTTP request - req, err := http.NewRequest(r.method, urlRaw, r.body) - - // Setup auth - if err == nil && r.config.HttpAuth != nil { - req.SetBasicAuth(r.config.HttpAuth.Username, r.config.HttpAuth.Password) - } - - return req, err -} - -// newRequest is used to create a new request -func (c *Client) newRequest(method, path string) *request { - r := &request{ - config: &c.config, - method: method, - url: &url.URL{ - Scheme: c.config.Scheme, - Host: c.config.Address, - Path: path, - }, - params: make(map[string][]string), - } - if c.config.Datacenter != "" { - r.params.Set("dc", c.config.Datacenter) - } - if c.config.WaitTime != 0 { - r.params.Set("wait", durToMsec(r.config.WaitTime)) - } - if c.config.Token != "" { - r.params.Set("token", r.config.Token) - } - return r -} - -// doRequest runs a request with our client -func (c *Client) doRequest(r *request) (time.Duration, *http.Response, error) { - req, err := r.toHTTP() - if err != nil { - return 0, nil, err - } - start := time.Now() - resp, err := c.config.HttpClient.Do(req) - diff := time.Now().Sub(start) - return diff, resp, err -} - -// parseQueryMeta is used to help parse query meta-data -func parseQueryMeta(resp *http.Response, q *QueryMeta) error { - header := resp.Header - - // Parse the X-Consul-Index - index, err := strconv.ParseUint(header.Get("X-Consul-Index"), 10, 64) - if err != nil { - return fmt.Errorf("Failed to parse X-Consul-Index: %v", err) - } - q.LastIndex = index - - // Parse the X-Consul-LastContact - last, err := strconv.ParseUint(header.Get("X-Consul-LastContact"), 10, 64) - if err != nil { - return fmt.Errorf("Failed to parse X-Consul-LastContact: %v", err) - } - q.LastContact = time.Duration(last) * time.Millisecond - - // Parse the X-Consul-KnownLeader - switch header.Get("X-Consul-KnownLeader") { - case "true": - q.KnownLeader = true - default: - q.KnownLeader = false - } - return nil -} - -// decodeBody is used to JSON decode a body -func decodeBody(resp *http.Response, out interface{}) error { - dec := json.NewDecoder(resp.Body) - return dec.Decode(out) -} - -// encodeBody is used to encode a request body -func encodeBody(obj interface{}) (io.Reader, error) { - buf := bytes.NewBuffer(nil) - enc := json.NewEncoder(buf) - if err := enc.Encode(obj); err != nil { - return nil, err - } - return buf, nil -} - -// requireOK is used to wrap doRequest and check for a 200 -func requireOK(d time.Duration, resp *http.Response, e error) (time.Duration, *http.Response, error) { - if e != nil { - return d, resp, e - } - if resp.StatusCode != 200 { - var buf bytes.Buffer - io.Copy(&buf, resp.Body) - return d, resp, fmt.Errorf("Unexpected response code: %d (%s)", resp.StatusCode, buf.Bytes()) - } - return d, resp, e -} diff --git a/vendor/github.com/armon/consul-api/catalog.go b/vendor/github.com/armon/consul-api/catalog.go deleted file mode 100644 index 8080e2a9..00000000 --- a/vendor/github.com/armon/consul-api/catalog.go +++ /dev/null @@ -1,181 +0,0 @@ -package consulapi - -type Node struct { - Node string - Address string -} - -type CatalogService struct { - Node string - Address string - ServiceID string - ServiceName string - ServiceTags []string - ServicePort int -} - -type CatalogNode struct { - Node *Node - Services map[string]*AgentService -} - -type CatalogRegistration struct { - Node string - Address string - Datacenter string - Service *AgentService - Check *AgentCheck -} - -type CatalogDeregistration struct { - Node string - Address string - Datacenter string - ServiceID string - CheckID string -} - -// Catalog can be used to query the Catalog endpoints -type Catalog struct { - c *Client -} - -// Catalog returns a handle to the catalog endpoints -func (c *Client) Catalog() *Catalog { - return &Catalog{c} -} - -func (c *Catalog) Register(reg *CatalogRegistration, q *WriteOptions) (*WriteMeta, error) { - r := c.c.newRequest("PUT", "/v1/catalog/register") - r.setWriteOptions(q) - r.obj = reg - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - return wm, nil -} - -func (c *Catalog) Deregister(dereg *CatalogDeregistration, q *WriteOptions) (*WriteMeta, error) { - r := c.c.newRequest("PUT", "/v1/catalog/deregister") - r.setWriteOptions(q) - r.obj = dereg - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - return wm, nil -} - -// Datacenters is used to query for all the known datacenters -func (c *Catalog) Datacenters() ([]string, error) { - r := c.c.newRequest("GET", "/v1/catalog/datacenters") - _, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []string - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Nodes is used to query all the known nodes -func (c *Catalog) Nodes(q *QueryOptions) ([]*Node, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/nodes") - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*Node - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Services is used to query for all known services -func (c *Catalog) Services(q *QueryOptions) (map[string][]string, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/services") - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out map[string][]string - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Service is used to query catalog entries for a given service -func (c *Catalog) Service(service, tag string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/service/"+service) - r.setQueryOptions(q) - if tag != "" { - r.params.Set("tag", tag) - } - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*CatalogService - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Node is used to query for service information about a single node -func (c *Catalog) Node(node string, q *QueryOptions) (*CatalogNode, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/node/"+node) - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out *CatalogNode - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/armon/consul-api/event.go b/vendor/github.com/armon/consul-api/event.go deleted file mode 100644 index 59813d40..00000000 --- a/vendor/github.com/armon/consul-api/event.go +++ /dev/null @@ -1,104 +0,0 @@ -package consulapi - -import ( - "bytes" - "strconv" -) - -// Event can be used to query the Event endpoints -type Event struct { - c *Client -} - -// UserEvent represents an event that was fired by the user -type UserEvent struct { - ID string - Name string - Payload []byte - NodeFilter string - ServiceFilter string - TagFilter string - Version int - LTime uint64 -} - -// Event returns a handle to the event endpoints -func (c *Client) Event() *Event { - return &Event{c} -} - -// Fire is used to fire a new user event. Only the Name, Payload and Filters -// are respected. This returns the ID or an associated error. Cross DC requests -// are supported. -func (e *Event) Fire(params *UserEvent, q *WriteOptions) (string, *WriteMeta, error) { - r := e.c.newRequest("PUT", "/v1/event/fire/"+params.Name) - r.setWriteOptions(q) - if params.NodeFilter != "" { - r.params.Set("node", params.NodeFilter) - } - if params.ServiceFilter != "" { - r.params.Set("service", params.ServiceFilter) - } - if params.TagFilter != "" { - r.params.Set("tag", params.TagFilter) - } - if params.Payload != nil { - r.body = bytes.NewReader(params.Payload) - } - - rtt, resp, err := requireOK(e.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out UserEvent - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// List is used to get the most recent events an agent has received. -// This list can be optionally filtered by the name. This endpoint supports -// quasi-blocking queries. The index is not monotonic, nor does it provide provide -// LastContact or KnownLeader. -func (e *Event) List(name string, q *QueryOptions) ([]*UserEvent, *QueryMeta, error) { - r := e.c.newRequest("GET", "/v1/event/list") - r.setQueryOptions(q) - if name != "" { - r.params.Set("name", name) - } - rtt, resp, err := requireOK(e.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*UserEvent - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// IDToIndex is a bit of a hack. This simulates the index generation to -// convert an event ID into a WaitIndex. -func (e *Event) IDToIndex(uuid string) uint64 { - lower := uuid[0:8] + uuid[9:13] + uuid[14:18] - upper := uuid[19:23] + uuid[24:36] - lowVal, err := strconv.ParseUint(lower, 16, 64) - if err != nil { - panic("Failed to convert " + lower) - } - highVal, err := strconv.ParseUint(upper, 16, 64) - if err != nil { - panic("Failed to convert " + upper) - } - return lowVal ^ highVal -} diff --git a/vendor/github.com/armon/consul-api/health.go b/vendor/github.com/armon/consul-api/health.go deleted file mode 100644 index 12225790..00000000 --- a/vendor/github.com/armon/consul-api/health.go +++ /dev/null @@ -1,136 +0,0 @@ -package consulapi - -import ( - "fmt" -) - -// HealthCheck is used to represent a single check -type HealthCheck struct { - Node string - CheckID string - Name string - Status string - Notes string - Output string - ServiceID string - ServiceName string -} - -// ServiceEntry is used for the health service endpoint -type ServiceEntry struct { - Node *Node - Service *AgentService - Checks []*HealthCheck -} - -// Health can be used to query the Health endpoints -type Health struct { - c *Client -} - -// Health returns a handle to the health endpoints -func (c *Client) Health() *Health { - return &Health{c} -} - -// Node is used to query for checks belonging to a given node -func (h *Health) Node(node string, q *QueryOptions) ([]*HealthCheck, *QueryMeta, error) { - r := h.c.newRequest("GET", "/v1/health/node/"+node) - r.setQueryOptions(q) - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*HealthCheck - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Checks is used to return the checks associated with a service -func (h *Health) Checks(service string, q *QueryOptions) ([]*HealthCheck, *QueryMeta, error) { - r := h.c.newRequest("GET", "/v1/health/checks/"+service) - r.setQueryOptions(q) - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*HealthCheck - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Service is used to query health information along with service info -// for a given service. It can optionally do server-side filtering on a tag -// or nodes with passing health checks only. -func (h *Health) Service(service, tag string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) { - r := h.c.newRequest("GET", "/v1/health/service/"+service) - r.setQueryOptions(q) - if tag != "" { - r.params.Set("tag", tag) - } - if passingOnly { - r.params.Set("passing", "1") - } - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*ServiceEntry - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// State is used to retrieve all the checks in a given state. -// The wildcard "any" state can also be used for all checks. -func (h *Health) State(state string, q *QueryOptions) ([]*HealthCheck, *QueryMeta, error) { - switch state { - case "any": - case "warning": - case "critical": - case "passing": - case "unknown": - default: - return nil, nil, fmt.Errorf("Unsupported state: %v", state) - } - r := h.c.newRequest("GET", "/v1/health/state/"+state) - r.setQueryOptions(q) - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*HealthCheck - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/armon/consul-api/kv.go b/vendor/github.com/armon/consul-api/kv.go deleted file mode 100644 index 98c3b1a0..00000000 --- a/vendor/github.com/armon/consul-api/kv.go +++ /dev/null @@ -1,219 +0,0 @@ -package consulapi - -import ( - "bytes" - "fmt" - "io" - "net/http" - "strconv" - "strings" -) - -// KVPair is used to represent a single K/V entry -type KVPair struct { - Key string - CreateIndex uint64 - ModifyIndex uint64 - LockIndex uint64 - Flags uint64 - Value []byte - Session string -} - -// KVPairs is a list of KVPair objects -type KVPairs []*KVPair - -// KV is used to manipulate the K/V API -type KV struct { - c *Client -} - -// KV is used to return a handle to the K/V apis -func (c *Client) KV() *KV { - return &KV{c} -} - -// Get is used to lookup a single key -func (k *KV) Get(key string, q *QueryOptions) (*KVPair, *QueryMeta, error) { - resp, qm, err := k.getInternal(key, nil, q) - if err != nil { - return nil, nil, err - } - if resp == nil { - return nil, qm, nil - } - defer resp.Body.Close() - - var entries []*KVPair - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - if len(entries) > 0 { - return entries[0], qm, nil - } - return nil, qm, nil -} - -// List is used to lookup all keys under a prefix -func (k *KV) List(prefix string, q *QueryOptions) (KVPairs, *QueryMeta, error) { - resp, qm, err := k.getInternal(prefix, map[string]string{"recurse": ""}, q) - if err != nil { - return nil, nil, err - } - if resp == nil { - return nil, qm, nil - } - defer resp.Body.Close() - - var entries []*KVPair - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// Keys is used to list all the keys under a prefix. Optionally, -// a separator can be used to limit the responses. -func (k *KV) Keys(prefix, separator string, q *QueryOptions) ([]string, *QueryMeta, error) { - params := map[string]string{"keys": ""} - if separator != "" { - params["separator"] = separator - } - resp, qm, err := k.getInternal(prefix, params, q) - if err != nil { - return nil, nil, err - } - if resp == nil { - return nil, qm, nil - } - defer resp.Body.Close() - - var entries []string - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -func (k *KV) getInternal(key string, params map[string]string, q *QueryOptions) (*http.Response, *QueryMeta, error) { - r := k.c.newRequest("GET", "/v1/kv/"+key) - r.setQueryOptions(q) - for param, val := range params { - r.params.Set(param, val) - } - rtt, resp, err := k.c.doRequest(r) - if err != nil { - return nil, nil, err - } - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - if resp.StatusCode == 404 { - resp.Body.Close() - return nil, qm, nil - } else if resp.StatusCode != 200 { - resp.Body.Close() - return nil, nil, fmt.Errorf("Unexpected response code: %d", resp.StatusCode) - } - return resp, qm, nil -} - -// Put is used to write a new value. Only the -// Key, Flags and Value is respected. -func (k *KV) Put(p *KVPair, q *WriteOptions) (*WriteMeta, error) { - params := make(map[string]string, 1) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - _, wm, err := k.put(p.Key, params, p.Value, q) - return wm, err -} - -// CAS is used for a Check-And-Set operation. The Key, -// ModifyIndex, Flags and Value are respected. Returns true -// on success or false on failures. -func (k *KV) CAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := make(map[string]string, 2) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - params["cas"] = strconv.FormatUint(p.ModifyIndex, 10) - return k.put(p.Key, params, p.Value, q) -} - -// Acquire is used for a lock acquisiiton operation. The Key, -// Flags, Value and Session are respected. Returns true -// on success or false on failures. -func (k *KV) Acquire(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := make(map[string]string, 2) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - params["acquire"] = p.Session - return k.put(p.Key, params, p.Value, q) -} - -// Release is used for a lock release operation. The Key, -// Flags, Value and Session are respected. Returns true -// on success or false on failures. -func (k *KV) Release(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := make(map[string]string, 2) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - params["release"] = p.Session - return k.put(p.Key, params, p.Value, q) -} - -func (k *KV) put(key string, params map[string]string, body []byte, q *WriteOptions) (bool, *WriteMeta, error) { - r := k.c.newRequest("PUT", "/v1/kv/"+key) - r.setWriteOptions(q) - for param, val := range params { - r.params.Set(param, val) - } - r.body = bytes.NewReader(body) - rtt, resp, err := requireOK(k.c.doRequest(r)) - if err != nil { - return false, nil, err - } - defer resp.Body.Close() - - qm := &WriteMeta{} - qm.RequestTime = rtt - - var buf bytes.Buffer - if _, err := io.Copy(&buf, resp.Body); err != nil { - return false, nil, fmt.Errorf("Failed to read response: %v", err) - } - res := strings.Contains(string(buf.Bytes()), "true") - return res, qm, nil -} - -// Delete is used to delete a single key -func (k *KV) Delete(key string, w *WriteOptions) (*WriteMeta, error) { - return k.deleteInternal(key, nil, w) -} - -// DeleteTree is used to delete all keys under a prefix -func (k *KV) DeleteTree(prefix string, w *WriteOptions) (*WriteMeta, error) { - return k.deleteInternal(prefix, []string{"recurse"}, w) -} - -func (k *KV) deleteInternal(key string, params []string, q *WriteOptions) (*WriteMeta, error) { - r := k.c.newRequest("DELETE", "/v1/kv/"+key) - r.setWriteOptions(q) - for _, param := range params { - r.params.Set(param, "") - } - rtt, resp, err := requireOK(k.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - qm := &WriteMeta{} - qm.RequestTime = rtt - return qm, nil -} diff --git a/vendor/github.com/armon/consul-api/session.go b/vendor/github.com/armon/consul-api/session.go deleted file mode 100644 index 4fbfc5ee..00000000 --- a/vendor/github.com/armon/consul-api/session.go +++ /dev/null @@ -1,204 +0,0 @@ -package consulapi - -import ( - "time" -) - -// SessionEntry represents a session in consul -type SessionEntry struct { - CreateIndex uint64 - ID string - Name string - Node string - Checks []string - LockDelay time.Duration - Behavior string - TTL string -} - -// Session can be used to query the Session endpoints -type Session struct { - c *Client -} - -// Session returns a handle to the session endpoints -func (c *Client) Session() *Session { - return &Session{c} -} - -// CreateNoChecks is like Create but is used specifically to create -// a session with no associated health checks. -func (s *Session) CreateNoChecks(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) { - body := make(map[string]interface{}) - body["Checks"] = []string{} - if se != nil { - if se.Name != "" { - body["Name"] = se.Name - } - if se.Node != "" { - body["Node"] = se.Node - } - if se.LockDelay != 0 { - body["LockDelay"] = durToMsec(se.LockDelay) - } - if se.Behavior != "" { - body["Behavior"] = se.Behavior - } - if se.TTL != "" { - body["TTL"] = se.TTL - } - } - return s.create(body, q) - -} - -// Create makes a new session. Providing a session entry can -// customize the session. It can also be nil to use defaults. -func (s *Session) Create(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) { - var obj interface{} - if se != nil { - body := make(map[string]interface{}) - obj = body - if se.Name != "" { - body["Name"] = se.Name - } - if se.Node != "" { - body["Node"] = se.Node - } - if se.LockDelay != 0 { - body["LockDelay"] = durToMsec(se.LockDelay) - } - if len(se.Checks) > 0 { - body["Checks"] = se.Checks - } - if se.Behavior != "" { - body["Behavior"] = se.Behavior - } - if se.TTL != "" { - body["TTL"] = se.TTL - } - } - return s.create(obj, q) -} - -func (s *Session) create(obj interface{}, q *WriteOptions) (string, *WriteMeta, error) { - r := s.c.newRequest("PUT", "/v1/session/create") - r.setWriteOptions(q) - r.obj = obj - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Destroy invalides a given session -func (s *Session) Destroy(id string, q *WriteOptions) (*WriteMeta, error) { - r := s.c.newRequest("PUT", "/v1/session/destroy/"+id) - r.setWriteOptions(q) - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - return wm, nil -} - -// Renew renews the TTL on a given session -func (s *Session) Renew(id string, q *WriteOptions) (*SessionEntry, *WriteMeta, error) { - r := s.c.newRequest("PUT", "/v1/session/renew/"+id) - r.setWriteOptions(q) - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - - var entries []*SessionEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, wm, err - } - - if len(entries) > 0 { - return entries[0], wm, nil - } - return nil, wm, nil -} - -// Info looks up a single session -func (s *Session) Info(id string, q *QueryOptions) (*SessionEntry, *QueryMeta, error) { - r := s.c.newRequest("GET", "/v1/session/info/"+id) - r.setQueryOptions(q) - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*SessionEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - - if len(entries) > 0 { - return entries[0], qm, nil - } - return nil, qm, nil -} - -// List gets sessions for a node -func (s *Session) Node(node string, q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) { - r := s.c.newRequest("GET", "/v1/session/node/"+node) - r.setQueryOptions(q) - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*SessionEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// List gets all active sessions -func (s *Session) List(q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) { - r := s.c.newRequest("GET", "/v1/session/list") - r.setQueryOptions(q) - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*SessionEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} diff --git a/vendor/github.com/armon/consul-api/status.go b/vendor/github.com/armon/consul-api/status.go deleted file mode 100644 index 21c31982..00000000 --- a/vendor/github.com/armon/consul-api/status.go +++ /dev/null @@ -1,43 +0,0 @@ -package consulapi - -// Status can be used to query the Status endpoints -type Status struct { - c *Client -} - -// Status returns a handle to the status endpoints -func (c *Client) Status() *Status { - return &Status{c} -} - -// Leader is used to query for a known leader -func (s *Status) Leader() (string, error) { - r := s.c.newRequest("GET", "/v1/status/leader") - _, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return "", err - } - defer resp.Body.Close() - - var leader string - if err := decodeBody(resp, &leader); err != nil { - return "", err - } - return leader, nil -} - -// Peers is used to query for a known raft peers -func (s *Status) Peers() ([]string, error) { - r := s.c.newRequest("GET", "/v1/status/peers") - _, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var peers []string - if err := decodeBody(resp, &peers); err != nil { - return nil, err - } - return peers, nil -} diff --git a/vendor/github.com/bwmarrin/discordgo/LICENSE b/vendor/github.com/bwmarrin/discordgo/LICENSE deleted file mode 100644 index 8d062ea5..00000000 --- a/vendor/github.com/bwmarrin/discordgo/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2015, Bruce Marriner -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of discordgo nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/bwmarrin/discordgo/discord.go b/vendor/github.com/bwmarrin/discordgo/discord.go deleted file mode 100644 index 99fda30b..00000000 --- a/vendor/github.com/bwmarrin/discordgo/discord.go +++ /dev/null @@ -1,146 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains high level helper functions and easy entry points for the -// entire discordgo package. These functions are beling developed and are very -// experimental at this point. They will most likley change so please use the -// low level functions if that's a problem. - -// Package discordgo provides Discord binding for Go -package discordgo - -import ( - "errors" - "fmt" - "net/http" - "time" -) - -// VERSION of DiscordGo, follows Semantic Versioning. (http://semver.org/) -const VERSION = "0.18.0" - -// ErrMFA will be risen by New when the user has 2FA. -var ErrMFA = errors.New("account has 2FA enabled") - -// New creates a new Discord session and will automate some startup -// tasks if given enough information to do so. Currently you can pass zero -// arguments and it will return an empty Discord session. -// There are 3 ways to call New: -// With a single auth token - All requests will use the token blindly, -// no verification of the token will be done and requests may fail. -// IF THE TOKEN IS FOR A BOT, IT MUST BE PREFIXED WITH `BOT ` -// eg: `"Bot "` -// With an email and password - Discord will sign in with the provided -// credentials. -// With an email, password and auth token - Discord will verify the auth -// token, if it is invalid it will sign in with the provided -// credentials. This is the Discord recommended way to sign in. -// -// NOTE: While email/pass authentication is supported by DiscordGo it is -// HIGHLY DISCOURAGED by Discord. Please only use email/pass to obtain a token -// and then use that authentication token for all future connections. -// Also, doing any form of automation with a user (non Bot) account may result -// in that account being permanently banned from Discord. -func New(args ...interface{}) (s *Session, err error) { - - // Create an empty Session interface. - s = &Session{ - State: NewState(), - Ratelimiter: NewRatelimiter(), - StateEnabled: true, - Compress: true, - ShouldReconnectOnError: true, - ShardID: 0, - ShardCount: 1, - MaxRestRetries: 3, - Client: &http.Client{Timeout: (20 * time.Second)}, - sequence: new(int64), - LastHeartbeatAck: time.Now().UTC(), - } - - // If no arguments are passed return the empty Session interface. - if args == nil { - return - } - - // Variables used below when parsing func arguments - var auth, pass string - - // Parse passed arguments - for _, arg := range args { - - switch v := arg.(type) { - - case []string: - if len(v) > 3 { - err = fmt.Errorf("too many string parameters provided") - return - } - - // First string is either token or username - if len(v) > 0 { - auth = v[0] - } - - // If second string exists, it must be a password. - if len(v) > 1 { - pass = v[1] - } - - // If third string exists, it must be an auth token. - if len(v) > 2 { - s.Token = v[2] - } - - case string: - // First string must be either auth token or username. - // Second string must be a password. - // Only 2 input strings are supported. - - if auth == "" { - auth = v - } else if pass == "" { - pass = v - } else if s.Token == "" { - s.Token = v - } else { - err = fmt.Errorf("too many string parameters provided") - return - } - - // case Config: - // TODO: Parse configuration struct - - default: - err = fmt.Errorf("unsupported parameter type provided") - return - } - } - - // If only one string was provided, assume it is an auth token. - // Otherwise get auth token from Discord, if a token was specified - // Discord will verify it for free, or log the user in if it is - // invalid. - if pass == "" { - s.Token = auth - } else { - err = s.Login(auth, pass) - if err != nil || s.Token == "" { - if s.MFA { - err = ErrMFA - } else { - err = fmt.Errorf("Unable to fetch discord authentication token. %v", err) - } - return - } - } - - // The Session is now able to have RestAPI methods called on it. - // It is recommended that you now call Open() so that events will trigger. - - return -} diff --git a/vendor/github.com/bwmarrin/discordgo/endpoints.go b/vendor/github.com/bwmarrin/discordgo/endpoints.go deleted file mode 100644 index 335e224d..00000000 --- a/vendor/github.com/bwmarrin/discordgo/endpoints.go +++ /dev/null @@ -1,136 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains variables for all known Discord end points. All functions -// throughout the Discordgo package use these variables for all connections -// to Discord. These are all exported and you may modify them if needed. - -package discordgo - -// APIVersion is the Discord API version used for the REST and Websocket API. -var APIVersion = "6" - -// Known Discord API Endpoints. -var ( - EndpointStatus = "https://status.discordapp.com/api/v2/" - EndpointSm = EndpointStatus + "scheduled-maintenances/" - EndpointSmActive = EndpointSm + "active.json" - EndpointSmUpcoming = EndpointSm + "upcoming.json" - - EndpointDiscord = "https://discordapp.com/" - EndpointAPI = EndpointDiscord + "api/v" + APIVersion + "/" - EndpointGuilds = EndpointAPI + "guilds/" - EndpointChannels = EndpointAPI + "channels/" - EndpointUsers = EndpointAPI + "users/" - EndpointGateway = EndpointAPI + "gateway" - EndpointGatewayBot = EndpointGateway + "/bot" - EndpointWebhooks = EndpointAPI + "webhooks/" - - EndpointCDN = "https://cdn.discordapp.com/" - EndpointCDNAttachments = EndpointCDN + "attachments/" - EndpointCDNAvatars = EndpointCDN + "avatars/" - EndpointCDNIcons = EndpointCDN + "icons/" - EndpointCDNSplashes = EndpointCDN + "splashes/" - EndpointCDNChannelIcons = EndpointCDN + "channel-icons/" - - EndpointAuth = EndpointAPI + "auth/" - EndpointLogin = EndpointAuth + "login" - EndpointLogout = EndpointAuth + "logout" - EndpointVerify = EndpointAuth + "verify" - EndpointVerifyResend = EndpointAuth + "verify/resend" - EndpointForgotPassword = EndpointAuth + "forgot" - EndpointResetPassword = EndpointAuth + "reset" - EndpointRegister = EndpointAuth + "register" - - EndpointVoice = EndpointAPI + "/voice/" - EndpointVoiceRegions = EndpointVoice + "regions" - EndpointVoiceIce = EndpointVoice + "ice" - - EndpointTutorial = EndpointAPI + "tutorial/" - EndpointTutorialIndicators = EndpointTutorial + "indicators" - - EndpointTrack = EndpointAPI + "track" - EndpointSso = EndpointAPI + "sso" - EndpointReport = EndpointAPI + "report" - EndpointIntegrations = EndpointAPI + "integrations" - - EndpointUser = func(uID string) string { return EndpointUsers + uID } - EndpointUserAvatar = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".png" } - EndpointUserAvatarAnimated = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".gif" } - EndpointUserSettings = func(uID string) string { return EndpointUsers + uID + "/settings" } - EndpointUserGuilds = func(uID string) string { return EndpointUsers + uID + "/guilds" } - EndpointUserGuild = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID } - EndpointUserGuildSettings = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID + "/settings" } - EndpointUserChannels = func(uID string) string { return EndpointUsers + uID + "/channels" } - EndpointUserDevices = func(uID string) string { return EndpointUsers + uID + "/devices" } - EndpointUserConnections = func(uID string) string { return EndpointUsers + uID + "/connections" } - EndpointUserNotes = func(uID string) string { return EndpointUsers + "@me/notes/" + uID } - - EndpointGuild = func(gID string) string { return EndpointGuilds + gID } - EndpointGuildChannels = func(gID string) string { return EndpointGuilds + gID + "/channels" } - EndpointGuildMembers = func(gID string) string { return EndpointGuilds + gID + "/members" } - EndpointGuildMember = func(gID, uID string) string { return EndpointGuilds + gID + "/members/" + uID } - EndpointGuildMemberRole = func(gID, uID, rID string) string { return EndpointGuilds + gID + "/members/" + uID + "/roles/" + rID } - EndpointGuildBans = func(gID string) string { return EndpointGuilds + gID + "/bans" } - EndpointGuildBan = func(gID, uID string) string { return EndpointGuilds + gID + "/bans/" + uID } - EndpointGuildIntegrations = func(gID string) string { return EndpointGuilds + gID + "/integrations" } - EndpointGuildIntegration = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID } - EndpointGuildIntegrationSync = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID + "/sync" } - EndpointGuildRoles = func(gID string) string { return EndpointGuilds + gID + "/roles" } - EndpointGuildRole = func(gID, rID string) string { return EndpointGuilds + gID + "/roles/" + rID } - EndpointGuildInvites = func(gID string) string { return EndpointGuilds + gID + "/invites" } - EndpointGuildEmbed = func(gID string) string { return EndpointGuilds + gID + "/embed" } - EndpointGuildPrune = func(gID string) string { return EndpointGuilds + gID + "/prune" } - EndpointGuildIcon = func(gID, hash string) string { return EndpointCDNIcons + gID + "/" + hash + ".png" } - EndpointGuildSplash = func(gID, hash string) string { return EndpointCDNSplashes + gID + "/" + hash + ".png" } - EndpointGuildWebhooks = func(gID string) string { return EndpointGuilds + gID + "/webhooks" } - - EndpointChannel = func(cID string) string { return EndpointChannels + cID } - EndpointChannelPermissions = func(cID string) string { return EndpointChannels + cID + "/permissions" } - EndpointChannelPermission = func(cID, tID string) string { return EndpointChannels + cID + "/permissions/" + tID } - EndpointChannelInvites = func(cID string) string { return EndpointChannels + cID + "/invites" } - EndpointChannelTyping = func(cID string) string { return EndpointChannels + cID + "/typing" } - EndpointChannelMessages = func(cID string) string { return EndpointChannels + cID + "/messages" } - EndpointChannelMessage = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID } - EndpointChannelMessageAck = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID + "/ack" } - EndpointChannelMessagesBulkDelete = func(cID string) string { return EndpointChannel(cID) + "/messages/bulk-delete" } - EndpointChannelMessagesPins = func(cID string) string { return EndpointChannel(cID) + "/pins" } - EndpointChannelMessagePin = func(cID, mID string) string { return EndpointChannel(cID) + "/pins/" + mID } - - EndpointGroupIcon = func(cID, hash string) string { return EndpointCDNChannelIcons + cID + "/" + hash + ".png" } - - EndpointChannelWebhooks = func(cID string) string { return EndpointChannel(cID) + "/webhooks" } - EndpointWebhook = func(wID string) string { return EndpointWebhooks + wID } - EndpointWebhookToken = func(wID, token string) string { return EndpointWebhooks + wID + "/" + token } - - EndpointMessageReactionsAll = func(cID, mID string) string { - return EndpointChannelMessage(cID, mID) + "/reactions" - } - EndpointMessageReactions = func(cID, mID, eID string) string { - return EndpointChannelMessage(cID, mID) + "/reactions/" + eID - } - EndpointMessageReaction = func(cID, mID, eID, uID string) string { - return EndpointMessageReactions(cID, mID, eID) + "/" + uID - } - - EndpointRelationships = func() string { return EndpointUsers + "@me" + "/relationships" } - EndpointRelationship = func(uID string) string { return EndpointRelationships() + "/" + uID } - EndpointRelationshipsMutual = func(uID string) string { return EndpointUsers + uID + "/relationships" } - - EndpointGuildCreate = EndpointAPI + "guilds" - - EndpointInvite = func(iID string) string { return EndpointAPI + "invite/" + iID } - - EndpointIntegrationsJoin = func(iID string) string { return EndpointAPI + "integrations/" + iID + "/join" } - - EndpointEmoji = func(eID string) string { return EndpointAPI + "emojis/" + eID + ".png" } - - EndpointOauth2 = EndpointAPI + "oauth2/" - EndpointApplications = EndpointOauth2 + "applications" - EndpointApplication = func(aID string) string { return EndpointApplications + "/" + aID } - EndpointApplicationsBot = func(aID string) string { return EndpointApplications + "/" + aID + "/bot" } -) diff --git a/vendor/github.com/bwmarrin/discordgo/event.go b/vendor/github.com/bwmarrin/discordgo/event.go deleted file mode 100644 index bba396cb..00000000 --- a/vendor/github.com/bwmarrin/discordgo/event.go +++ /dev/null @@ -1,238 +0,0 @@ -package discordgo - -// EventHandler is an interface for Discord events. -type EventHandler interface { - // Type returns the type of event this handler belongs to. - Type() string - - // Handle is called whenever an event of Type() happens. - // It is the receivers responsibility to type assert that the interface - // is the expected struct. - Handle(*Session, interface{}) -} - -// EventInterfaceProvider is an interface for providing empty interfaces for -// Discord events. -type EventInterfaceProvider interface { - // Type is the type of event this handler belongs to. - Type() string - - // New returns a new instance of the struct this event handler handles. - // This is called once per event. - // The struct is provided to all handlers of the same Type(). - New() interface{} -} - -// interfaceEventType is the event handler type for interface{} events. -const interfaceEventType = "__INTERFACE__" - -// interfaceEventHandler is an event handler for interface{} events. -type interfaceEventHandler func(*Session, interface{}) - -// Type returns the event type for interface{} events. -func (eh interfaceEventHandler) Type() string { - return interfaceEventType -} - -// Handle is the handler for an interface{} event. -func (eh interfaceEventHandler) Handle(s *Session, i interface{}) { - eh(s, i) -} - -var registeredInterfaceProviders = map[string]EventInterfaceProvider{} - -// registerInterfaceProvider registers a provider so that DiscordGo can -// access it's New() method. -func registerInterfaceProvider(eh EventInterfaceProvider) { - if _, ok := registeredInterfaceProviders[eh.Type()]; ok { - return - // XXX: - // if we should error here, we need to do something with it. - // fmt.Errorf("event %s already registered", eh.Type()) - } - registeredInterfaceProviders[eh.Type()] = eh - return -} - -// eventHandlerInstance is a wrapper around an event handler, as functions -// cannot be compared directly. -type eventHandlerInstance struct { - eventHandler EventHandler -} - -// addEventHandler adds an event handler that will be fired anytime -// the Discord WSAPI matching eventHandler.Type() fires. -func (s *Session) addEventHandler(eventHandler EventHandler) func() { - s.handlersMu.Lock() - defer s.handlersMu.Unlock() - - if s.handlers == nil { - s.handlers = map[string][]*eventHandlerInstance{} - } - - ehi := &eventHandlerInstance{eventHandler} - s.handlers[eventHandler.Type()] = append(s.handlers[eventHandler.Type()], ehi) - - return func() { - s.removeEventHandlerInstance(eventHandler.Type(), ehi) - } -} - -// addEventHandler adds an event handler that will be fired the next time -// the Discord WSAPI matching eventHandler.Type() fires. -func (s *Session) addEventHandlerOnce(eventHandler EventHandler) func() { - s.handlersMu.Lock() - defer s.handlersMu.Unlock() - - if s.onceHandlers == nil { - s.onceHandlers = map[string][]*eventHandlerInstance{} - } - - ehi := &eventHandlerInstance{eventHandler} - s.onceHandlers[eventHandler.Type()] = append(s.onceHandlers[eventHandler.Type()], ehi) - - return func() { - s.removeEventHandlerInstance(eventHandler.Type(), ehi) - } -} - -// AddHandler allows you to add an event handler that will be fired anytime -// the Discord WSAPI event that matches the function fires. -// events.go contains all the Discord WSAPI events that can be fired. -// eg: -// Session.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) { -// }) -// -// or: -// Session.AddHandler(func(s *discordgo.Session, m *discordgo.PresenceUpdate) { -// }) -// The return value of this method is a function, that when called will remove the -// event handler. -func (s *Session) AddHandler(handler interface{}) func() { - eh := handlerForInterface(handler) - - if eh == nil { - s.log(LogError, "Invalid handler type, handler will never be called") - return func() {} - } - - return s.addEventHandler(eh) -} - -// AddHandlerOnce allows you to add an event handler that will be fired the next time -// the Discord WSAPI event that matches the function fires. -// See AddHandler for more details. -func (s *Session) AddHandlerOnce(handler interface{}) func() { - eh := handlerForInterface(handler) - - if eh == nil { - s.log(LogError, "Invalid handler type, handler will never be called") - return func() {} - } - - return s.addEventHandlerOnce(eh) -} - -// removeEventHandler instance removes an event handler instance. -func (s *Session) removeEventHandlerInstance(t string, ehi *eventHandlerInstance) { - s.handlersMu.Lock() - defer s.handlersMu.Unlock() - - handlers := s.handlers[t] - for i := range handlers { - if handlers[i] == ehi { - s.handlers[t] = append(handlers[:i], handlers[i+1:]...) - } - } - - onceHandlers := s.onceHandlers[t] - for i := range onceHandlers { - if onceHandlers[i] == ehi { - s.onceHandlers[t] = append(onceHandlers[:i], handlers[i+1:]...) - } - } -} - -// Handles calling permanent and once handlers for an event type. -func (s *Session) handle(t string, i interface{}) { - for _, eh := range s.handlers[t] { - if s.SyncEvents { - eh.eventHandler.Handle(s, i) - } else { - go eh.eventHandler.Handle(s, i) - } - } - - if len(s.onceHandlers[t]) > 0 { - for _, eh := range s.onceHandlers[t] { - if s.SyncEvents { - eh.eventHandler.Handle(s, i) - } else { - go eh.eventHandler.Handle(s, i) - } - } - s.onceHandlers[t] = nil - } -} - -// Handles an event type by calling internal methods, firing handlers and firing the -// interface{} event. -func (s *Session) handleEvent(t string, i interface{}) { - s.handlersMu.RLock() - defer s.handlersMu.RUnlock() - - // All events are dispatched internally first. - s.onInterface(i) - - // Then they are dispatched to anyone handling interface{} events. - s.handle(interfaceEventType, i) - - // Finally they are dispatched to any typed handlers. - s.handle(t, i) -} - -// setGuildIds will set the GuildID on all the members of a guild. -// This is done as event data does not have it set. -func setGuildIds(g *Guild) { - for _, c := range g.Channels { - c.GuildID = g.ID - } - - for _, m := range g.Members { - m.GuildID = g.ID - } - - for _, vs := range g.VoiceStates { - vs.GuildID = g.ID - } -} - -// onInterface handles all internal events and routes them to the appropriate internal handler. -func (s *Session) onInterface(i interface{}) { - switch t := i.(type) { - case *Ready: - for _, g := range t.Guilds { - setGuildIds(g) - } - s.onReady(t) - case *GuildCreate: - setGuildIds(t.Guild) - case *GuildUpdate: - setGuildIds(t.Guild) - case *VoiceServerUpdate: - go s.onVoiceServerUpdate(t) - case *VoiceStateUpdate: - go s.onVoiceStateUpdate(t) - } - err := s.State.OnInterface(s, i) - if err != nil { - s.log(LogDebug, "error dispatching internal event, %s", err) - } -} - -// onReady handles the ready event. -func (s *Session) onReady(r *Ready) { - - // Store the SessionID within the Session struct. - s.sessionID = r.SessionID -} diff --git a/vendor/github.com/bwmarrin/discordgo/eventhandlers.go b/vendor/github.com/bwmarrin/discordgo/eventhandlers.go deleted file mode 100644 index 5cc157de..00000000 --- a/vendor/github.com/bwmarrin/discordgo/eventhandlers.go +++ /dev/null @@ -1,1030 +0,0 @@ -// Code generated by \"eventhandlers\"; DO NOT EDIT -// See events.go - -package discordgo - -// Following are all the event types. -// Event type values are used to match the events returned by Discord. -// EventTypes surrounded by __ are synthetic and are internal to DiscordGo. -const ( - channelCreateEventType = "CHANNEL_CREATE" - channelDeleteEventType = "CHANNEL_DELETE" - channelPinsUpdateEventType = "CHANNEL_PINS_UPDATE" - channelUpdateEventType = "CHANNEL_UPDATE" - connectEventType = "__CONNECT__" - disconnectEventType = "__DISCONNECT__" - eventEventType = "__EVENT__" - guildBanAddEventType = "GUILD_BAN_ADD" - guildBanRemoveEventType = "GUILD_BAN_REMOVE" - guildCreateEventType = "GUILD_CREATE" - guildDeleteEventType = "GUILD_DELETE" - guildEmojisUpdateEventType = "GUILD_EMOJIS_UPDATE" - guildIntegrationsUpdateEventType = "GUILD_INTEGRATIONS_UPDATE" - guildMemberAddEventType = "GUILD_MEMBER_ADD" - guildMemberRemoveEventType = "GUILD_MEMBER_REMOVE" - guildMemberUpdateEventType = "GUILD_MEMBER_UPDATE" - guildMembersChunkEventType = "GUILD_MEMBERS_CHUNK" - guildRoleCreateEventType = "GUILD_ROLE_CREATE" - guildRoleDeleteEventType = "GUILD_ROLE_DELETE" - guildRoleUpdateEventType = "GUILD_ROLE_UPDATE" - guildUpdateEventType = "GUILD_UPDATE" - messageAckEventType = "MESSAGE_ACK" - messageCreateEventType = "MESSAGE_CREATE" - messageDeleteEventType = "MESSAGE_DELETE" - messageDeleteBulkEventType = "MESSAGE_DELETE_BULK" - messageReactionAddEventType = "MESSAGE_REACTION_ADD" - messageReactionRemoveEventType = "MESSAGE_REACTION_REMOVE" - messageReactionRemoveAllEventType = "MESSAGE_REACTION_REMOVE_ALL" - messageUpdateEventType = "MESSAGE_UPDATE" - presenceUpdateEventType = "PRESENCE_UPDATE" - presencesReplaceEventType = "PRESENCES_REPLACE" - rateLimitEventType = "__RATE_LIMIT__" - readyEventType = "READY" - relationshipAddEventType = "RELATIONSHIP_ADD" - relationshipRemoveEventType = "RELATIONSHIP_REMOVE" - resumedEventType = "RESUMED" - typingStartEventType = "TYPING_START" - userGuildSettingsUpdateEventType = "USER_GUILD_SETTINGS_UPDATE" - userNoteUpdateEventType = "USER_NOTE_UPDATE" - userSettingsUpdateEventType = "USER_SETTINGS_UPDATE" - userUpdateEventType = "USER_UPDATE" - voiceServerUpdateEventType = "VOICE_SERVER_UPDATE" - voiceStateUpdateEventType = "VOICE_STATE_UPDATE" -) - -// channelCreateEventHandler is an event handler for ChannelCreate events. -type channelCreateEventHandler func(*Session, *ChannelCreate) - -// Type returns the event type for ChannelCreate events. -func (eh channelCreateEventHandler) Type() string { - return channelCreateEventType -} - -// New returns a new instance of ChannelCreate. -func (eh channelCreateEventHandler) New() interface{} { - return &ChannelCreate{} -} - -// Handle is the handler for ChannelCreate events. -func (eh channelCreateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*ChannelCreate); ok { - eh(s, t) - } -} - -// channelDeleteEventHandler is an event handler for ChannelDelete events. -type channelDeleteEventHandler func(*Session, *ChannelDelete) - -// Type returns the event type for ChannelDelete events. -func (eh channelDeleteEventHandler) Type() string { - return channelDeleteEventType -} - -// New returns a new instance of ChannelDelete. -func (eh channelDeleteEventHandler) New() interface{} { - return &ChannelDelete{} -} - -// Handle is the handler for ChannelDelete events. -func (eh channelDeleteEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*ChannelDelete); ok { - eh(s, t) - } -} - -// channelPinsUpdateEventHandler is an event handler for ChannelPinsUpdate events. -type channelPinsUpdateEventHandler func(*Session, *ChannelPinsUpdate) - -// Type returns the event type for ChannelPinsUpdate events. -func (eh channelPinsUpdateEventHandler) Type() string { - return channelPinsUpdateEventType -} - -// New returns a new instance of ChannelPinsUpdate. -func (eh channelPinsUpdateEventHandler) New() interface{} { - return &ChannelPinsUpdate{} -} - -// Handle is the handler for ChannelPinsUpdate events. -func (eh channelPinsUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*ChannelPinsUpdate); ok { - eh(s, t) - } -} - -// channelUpdateEventHandler is an event handler for ChannelUpdate events. -type channelUpdateEventHandler func(*Session, *ChannelUpdate) - -// Type returns the event type for ChannelUpdate events. -func (eh channelUpdateEventHandler) Type() string { - return channelUpdateEventType -} - -// New returns a new instance of ChannelUpdate. -func (eh channelUpdateEventHandler) New() interface{} { - return &ChannelUpdate{} -} - -// Handle is the handler for ChannelUpdate events. -func (eh channelUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*ChannelUpdate); ok { - eh(s, t) - } -} - -// connectEventHandler is an event handler for Connect events. -type connectEventHandler func(*Session, *Connect) - -// Type returns the event type for Connect events. -func (eh connectEventHandler) Type() string { - return connectEventType -} - -// Handle is the handler for Connect events. -func (eh connectEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*Connect); ok { - eh(s, t) - } -} - -// disconnectEventHandler is an event handler for Disconnect events. -type disconnectEventHandler func(*Session, *Disconnect) - -// Type returns the event type for Disconnect events. -func (eh disconnectEventHandler) Type() string { - return disconnectEventType -} - -// Handle is the handler for Disconnect events. -func (eh disconnectEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*Disconnect); ok { - eh(s, t) - } -} - -// eventEventHandler is an event handler for Event events. -type eventEventHandler func(*Session, *Event) - -// Type returns the event type for Event events. -func (eh eventEventHandler) Type() string { - return eventEventType -} - -// Handle is the handler for Event events. -func (eh eventEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*Event); ok { - eh(s, t) - } -} - -// guildBanAddEventHandler is an event handler for GuildBanAdd events. -type guildBanAddEventHandler func(*Session, *GuildBanAdd) - -// Type returns the event type for GuildBanAdd events. -func (eh guildBanAddEventHandler) Type() string { - return guildBanAddEventType -} - -// New returns a new instance of GuildBanAdd. -func (eh guildBanAddEventHandler) New() interface{} { - return &GuildBanAdd{} -} - -// Handle is the handler for GuildBanAdd events. -func (eh guildBanAddEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildBanAdd); ok { - eh(s, t) - } -} - -// guildBanRemoveEventHandler is an event handler for GuildBanRemove events. -type guildBanRemoveEventHandler func(*Session, *GuildBanRemove) - -// Type returns the event type for GuildBanRemove events. -func (eh guildBanRemoveEventHandler) Type() string { - return guildBanRemoveEventType -} - -// New returns a new instance of GuildBanRemove. -func (eh guildBanRemoveEventHandler) New() interface{} { - return &GuildBanRemove{} -} - -// Handle is the handler for GuildBanRemove events. -func (eh guildBanRemoveEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildBanRemove); ok { - eh(s, t) - } -} - -// guildCreateEventHandler is an event handler for GuildCreate events. -type guildCreateEventHandler func(*Session, *GuildCreate) - -// Type returns the event type for GuildCreate events. -func (eh guildCreateEventHandler) Type() string { - return guildCreateEventType -} - -// New returns a new instance of GuildCreate. -func (eh guildCreateEventHandler) New() interface{} { - return &GuildCreate{} -} - -// Handle is the handler for GuildCreate events. -func (eh guildCreateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildCreate); ok { - eh(s, t) - } -} - -// guildDeleteEventHandler is an event handler for GuildDelete events. -type guildDeleteEventHandler func(*Session, *GuildDelete) - -// Type returns the event type for GuildDelete events. -func (eh guildDeleteEventHandler) Type() string { - return guildDeleteEventType -} - -// New returns a new instance of GuildDelete. -func (eh guildDeleteEventHandler) New() interface{} { - return &GuildDelete{} -} - -// Handle is the handler for GuildDelete events. -func (eh guildDeleteEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildDelete); ok { - eh(s, t) - } -} - -// guildEmojisUpdateEventHandler is an event handler for GuildEmojisUpdate events. -type guildEmojisUpdateEventHandler func(*Session, *GuildEmojisUpdate) - -// Type returns the event type for GuildEmojisUpdate events. -func (eh guildEmojisUpdateEventHandler) Type() string { - return guildEmojisUpdateEventType -} - -// New returns a new instance of GuildEmojisUpdate. -func (eh guildEmojisUpdateEventHandler) New() interface{} { - return &GuildEmojisUpdate{} -} - -// Handle is the handler for GuildEmojisUpdate events. -func (eh guildEmojisUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildEmojisUpdate); ok { - eh(s, t) - } -} - -// guildIntegrationsUpdateEventHandler is an event handler for GuildIntegrationsUpdate events. -type guildIntegrationsUpdateEventHandler func(*Session, *GuildIntegrationsUpdate) - -// Type returns the event type for GuildIntegrationsUpdate events. -func (eh guildIntegrationsUpdateEventHandler) Type() string { - return guildIntegrationsUpdateEventType -} - -// New returns a new instance of GuildIntegrationsUpdate. -func (eh guildIntegrationsUpdateEventHandler) New() interface{} { - return &GuildIntegrationsUpdate{} -} - -// Handle is the handler for GuildIntegrationsUpdate events. -func (eh guildIntegrationsUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildIntegrationsUpdate); ok { - eh(s, t) - } -} - -// guildMemberAddEventHandler is an event handler for GuildMemberAdd events. -type guildMemberAddEventHandler func(*Session, *GuildMemberAdd) - -// Type returns the event type for GuildMemberAdd events. -func (eh guildMemberAddEventHandler) Type() string { - return guildMemberAddEventType -} - -// New returns a new instance of GuildMemberAdd. -func (eh guildMemberAddEventHandler) New() interface{} { - return &GuildMemberAdd{} -} - -// Handle is the handler for GuildMemberAdd events. -func (eh guildMemberAddEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildMemberAdd); ok { - eh(s, t) - } -} - -// guildMemberRemoveEventHandler is an event handler for GuildMemberRemove events. -type guildMemberRemoveEventHandler func(*Session, *GuildMemberRemove) - -// Type returns the event type for GuildMemberRemove events. -func (eh guildMemberRemoveEventHandler) Type() string { - return guildMemberRemoveEventType -} - -// New returns a new instance of GuildMemberRemove. -func (eh guildMemberRemoveEventHandler) New() interface{} { - return &GuildMemberRemove{} -} - -// Handle is the handler for GuildMemberRemove events. -func (eh guildMemberRemoveEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildMemberRemove); ok { - eh(s, t) - } -} - -// guildMemberUpdateEventHandler is an event handler for GuildMemberUpdate events. -type guildMemberUpdateEventHandler func(*Session, *GuildMemberUpdate) - -// Type returns the event type for GuildMemberUpdate events. -func (eh guildMemberUpdateEventHandler) Type() string { - return guildMemberUpdateEventType -} - -// New returns a new instance of GuildMemberUpdate. -func (eh guildMemberUpdateEventHandler) New() interface{} { - return &GuildMemberUpdate{} -} - -// Handle is the handler for GuildMemberUpdate events. -func (eh guildMemberUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildMemberUpdate); ok { - eh(s, t) - } -} - -// guildMembersChunkEventHandler is an event handler for GuildMembersChunk events. -type guildMembersChunkEventHandler func(*Session, *GuildMembersChunk) - -// Type returns the event type for GuildMembersChunk events. -func (eh guildMembersChunkEventHandler) Type() string { - return guildMembersChunkEventType -} - -// New returns a new instance of GuildMembersChunk. -func (eh guildMembersChunkEventHandler) New() interface{} { - return &GuildMembersChunk{} -} - -// Handle is the handler for GuildMembersChunk events. -func (eh guildMembersChunkEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildMembersChunk); ok { - eh(s, t) - } -} - -// guildRoleCreateEventHandler is an event handler for GuildRoleCreate events. -type guildRoleCreateEventHandler func(*Session, *GuildRoleCreate) - -// Type returns the event type for GuildRoleCreate events. -func (eh guildRoleCreateEventHandler) Type() string { - return guildRoleCreateEventType -} - -// New returns a new instance of GuildRoleCreate. -func (eh guildRoleCreateEventHandler) New() interface{} { - return &GuildRoleCreate{} -} - -// Handle is the handler for GuildRoleCreate events. -func (eh guildRoleCreateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildRoleCreate); ok { - eh(s, t) - } -} - -// guildRoleDeleteEventHandler is an event handler for GuildRoleDelete events. -type guildRoleDeleteEventHandler func(*Session, *GuildRoleDelete) - -// Type returns the event type for GuildRoleDelete events. -func (eh guildRoleDeleteEventHandler) Type() string { - return guildRoleDeleteEventType -} - -// New returns a new instance of GuildRoleDelete. -func (eh guildRoleDeleteEventHandler) New() interface{} { - return &GuildRoleDelete{} -} - -// Handle is the handler for GuildRoleDelete events. -func (eh guildRoleDeleteEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildRoleDelete); ok { - eh(s, t) - } -} - -// guildRoleUpdateEventHandler is an event handler for GuildRoleUpdate events. -type guildRoleUpdateEventHandler func(*Session, *GuildRoleUpdate) - -// Type returns the event type for GuildRoleUpdate events. -func (eh guildRoleUpdateEventHandler) Type() string { - return guildRoleUpdateEventType -} - -// New returns a new instance of GuildRoleUpdate. -func (eh guildRoleUpdateEventHandler) New() interface{} { - return &GuildRoleUpdate{} -} - -// Handle is the handler for GuildRoleUpdate events. -func (eh guildRoleUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildRoleUpdate); ok { - eh(s, t) - } -} - -// guildUpdateEventHandler is an event handler for GuildUpdate events. -type guildUpdateEventHandler func(*Session, *GuildUpdate) - -// Type returns the event type for GuildUpdate events. -func (eh guildUpdateEventHandler) Type() string { - return guildUpdateEventType -} - -// New returns a new instance of GuildUpdate. -func (eh guildUpdateEventHandler) New() interface{} { - return &GuildUpdate{} -} - -// Handle is the handler for GuildUpdate events. -func (eh guildUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*GuildUpdate); ok { - eh(s, t) - } -} - -// messageAckEventHandler is an event handler for MessageAck events. -type messageAckEventHandler func(*Session, *MessageAck) - -// Type returns the event type for MessageAck events. -func (eh messageAckEventHandler) Type() string { - return messageAckEventType -} - -// New returns a new instance of MessageAck. -func (eh messageAckEventHandler) New() interface{} { - return &MessageAck{} -} - -// Handle is the handler for MessageAck events. -func (eh messageAckEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageAck); ok { - eh(s, t) - } -} - -// messageCreateEventHandler is an event handler for MessageCreate events. -type messageCreateEventHandler func(*Session, *MessageCreate) - -// Type returns the event type for MessageCreate events. -func (eh messageCreateEventHandler) Type() string { - return messageCreateEventType -} - -// New returns a new instance of MessageCreate. -func (eh messageCreateEventHandler) New() interface{} { - return &MessageCreate{} -} - -// Handle is the handler for MessageCreate events. -func (eh messageCreateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageCreate); ok { - eh(s, t) - } -} - -// messageDeleteEventHandler is an event handler for MessageDelete events. -type messageDeleteEventHandler func(*Session, *MessageDelete) - -// Type returns the event type for MessageDelete events. -func (eh messageDeleteEventHandler) Type() string { - return messageDeleteEventType -} - -// New returns a new instance of MessageDelete. -func (eh messageDeleteEventHandler) New() interface{} { - return &MessageDelete{} -} - -// Handle is the handler for MessageDelete events. -func (eh messageDeleteEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageDelete); ok { - eh(s, t) - } -} - -// messageDeleteBulkEventHandler is an event handler for MessageDeleteBulk events. -type messageDeleteBulkEventHandler func(*Session, *MessageDeleteBulk) - -// Type returns the event type for MessageDeleteBulk events. -func (eh messageDeleteBulkEventHandler) Type() string { - return messageDeleteBulkEventType -} - -// New returns a new instance of MessageDeleteBulk. -func (eh messageDeleteBulkEventHandler) New() interface{} { - return &MessageDeleteBulk{} -} - -// Handle is the handler for MessageDeleteBulk events. -func (eh messageDeleteBulkEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageDeleteBulk); ok { - eh(s, t) - } -} - -// messageReactionAddEventHandler is an event handler for MessageReactionAdd events. -type messageReactionAddEventHandler func(*Session, *MessageReactionAdd) - -// Type returns the event type for MessageReactionAdd events. -func (eh messageReactionAddEventHandler) Type() string { - return messageReactionAddEventType -} - -// New returns a new instance of MessageReactionAdd. -func (eh messageReactionAddEventHandler) New() interface{} { - return &MessageReactionAdd{} -} - -// Handle is the handler for MessageReactionAdd events. -func (eh messageReactionAddEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageReactionAdd); ok { - eh(s, t) - } -} - -// messageReactionRemoveEventHandler is an event handler for MessageReactionRemove events. -type messageReactionRemoveEventHandler func(*Session, *MessageReactionRemove) - -// Type returns the event type for MessageReactionRemove events. -func (eh messageReactionRemoveEventHandler) Type() string { - return messageReactionRemoveEventType -} - -// New returns a new instance of MessageReactionRemove. -func (eh messageReactionRemoveEventHandler) New() interface{} { - return &MessageReactionRemove{} -} - -// Handle is the handler for MessageReactionRemove events. -func (eh messageReactionRemoveEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageReactionRemove); ok { - eh(s, t) - } -} - -// messageReactionRemoveAllEventHandler is an event handler for MessageReactionRemoveAll events. -type messageReactionRemoveAllEventHandler func(*Session, *MessageReactionRemoveAll) - -// Type returns the event type for MessageReactionRemoveAll events. -func (eh messageReactionRemoveAllEventHandler) Type() string { - return messageReactionRemoveAllEventType -} - -// New returns a new instance of MessageReactionRemoveAll. -func (eh messageReactionRemoveAllEventHandler) New() interface{} { - return &MessageReactionRemoveAll{} -} - -// Handle is the handler for MessageReactionRemoveAll events. -func (eh messageReactionRemoveAllEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageReactionRemoveAll); ok { - eh(s, t) - } -} - -// messageUpdateEventHandler is an event handler for MessageUpdate events. -type messageUpdateEventHandler func(*Session, *MessageUpdate) - -// Type returns the event type for MessageUpdate events. -func (eh messageUpdateEventHandler) Type() string { - return messageUpdateEventType -} - -// New returns a new instance of MessageUpdate. -func (eh messageUpdateEventHandler) New() interface{} { - return &MessageUpdate{} -} - -// Handle is the handler for MessageUpdate events. -func (eh messageUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*MessageUpdate); ok { - eh(s, t) - } -} - -// presenceUpdateEventHandler is an event handler for PresenceUpdate events. -type presenceUpdateEventHandler func(*Session, *PresenceUpdate) - -// Type returns the event type for PresenceUpdate events. -func (eh presenceUpdateEventHandler) Type() string { - return presenceUpdateEventType -} - -// New returns a new instance of PresenceUpdate. -func (eh presenceUpdateEventHandler) New() interface{} { - return &PresenceUpdate{} -} - -// Handle is the handler for PresenceUpdate events. -func (eh presenceUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*PresenceUpdate); ok { - eh(s, t) - } -} - -// presencesReplaceEventHandler is an event handler for PresencesReplace events. -type presencesReplaceEventHandler func(*Session, *PresencesReplace) - -// Type returns the event type for PresencesReplace events. -func (eh presencesReplaceEventHandler) Type() string { - return presencesReplaceEventType -} - -// New returns a new instance of PresencesReplace. -func (eh presencesReplaceEventHandler) New() interface{} { - return &PresencesReplace{} -} - -// Handle is the handler for PresencesReplace events. -func (eh presencesReplaceEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*PresencesReplace); ok { - eh(s, t) - } -} - -// rateLimitEventHandler is an event handler for RateLimit events. -type rateLimitEventHandler func(*Session, *RateLimit) - -// Type returns the event type for RateLimit events. -func (eh rateLimitEventHandler) Type() string { - return rateLimitEventType -} - -// Handle is the handler for RateLimit events. -func (eh rateLimitEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*RateLimit); ok { - eh(s, t) - } -} - -// readyEventHandler is an event handler for Ready events. -type readyEventHandler func(*Session, *Ready) - -// Type returns the event type for Ready events. -func (eh readyEventHandler) Type() string { - return readyEventType -} - -// New returns a new instance of Ready. -func (eh readyEventHandler) New() interface{} { - return &Ready{} -} - -// Handle is the handler for Ready events. -func (eh readyEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*Ready); ok { - eh(s, t) - } -} - -// relationshipAddEventHandler is an event handler for RelationshipAdd events. -type relationshipAddEventHandler func(*Session, *RelationshipAdd) - -// Type returns the event type for RelationshipAdd events. -func (eh relationshipAddEventHandler) Type() string { - return relationshipAddEventType -} - -// New returns a new instance of RelationshipAdd. -func (eh relationshipAddEventHandler) New() interface{} { - return &RelationshipAdd{} -} - -// Handle is the handler for RelationshipAdd events. -func (eh relationshipAddEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*RelationshipAdd); ok { - eh(s, t) - } -} - -// relationshipRemoveEventHandler is an event handler for RelationshipRemove events. -type relationshipRemoveEventHandler func(*Session, *RelationshipRemove) - -// Type returns the event type for RelationshipRemove events. -func (eh relationshipRemoveEventHandler) Type() string { - return relationshipRemoveEventType -} - -// New returns a new instance of RelationshipRemove. -func (eh relationshipRemoveEventHandler) New() interface{} { - return &RelationshipRemove{} -} - -// Handle is the handler for RelationshipRemove events. -func (eh relationshipRemoveEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*RelationshipRemove); ok { - eh(s, t) - } -} - -// resumedEventHandler is an event handler for Resumed events. -type resumedEventHandler func(*Session, *Resumed) - -// Type returns the event type for Resumed events. -func (eh resumedEventHandler) Type() string { - return resumedEventType -} - -// New returns a new instance of Resumed. -func (eh resumedEventHandler) New() interface{} { - return &Resumed{} -} - -// Handle is the handler for Resumed events. -func (eh resumedEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*Resumed); ok { - eh(s, t) - } -} - -// typingStartEventHandler is an event handler for TypingStart events. -type typingStartEventHandler func(*Session, *TypingStart) - -// Type returns the event type for TypingStart events. -func (eh typingStartEventHandler) Type() string { - return typingStartEventType -} - -// New returns a new instance of TypingStart. -func (eh typingStartEventHandler) New() interface{} { - return &TypingStart{} -} - -// Handle is the handler for TypingStart events. -func (eh typingStartEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*TypingStart); ok { - eh(s, t) - } -} - -// userGuildSettingsUpdateEventHandler is an event handler for UserGuildSettingsUpdate events. -type userGuildSettingsUpdateEventHandler func(*Session, *UserGuildSettingsUpdate) - -// Type returns the event type for UserGuildSettingsUpdate events. -func (eh userGuildSettingsUpdateEventHandler) Type() string { - return userGuildSettingsUpdateEventType -} - -// New returns a new instance of UserGuildSettingsUpdate. -func (eh userGuildSettingsUpdateEventHandler) New() interface{} { - return &UserGuildSettingsUpdate{} -} - -// Handle is the handler for UserGuildSettingsUpdate events. -func (eh userGuildSettingsUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*UserGuildSettingsUpdate); ok { - eh(s, t) - } -} - -// userNoteUpdateEventHandler is an event handler for UserNoteUpdate events. -type userNoteUpdateEventHandler func(*Session, *UserNoteUpdate) - -// Type returns the event type for UserNoteUpdate events. -func (eh userNoteUpdateEventHandler) Type() string { - return userNoteUpdateEventType -} - -// New returns a new instance of UserNoteUpdate. -func (eh userNoteUpdateEventHandler) New() interface{} { - return &UserNoteUpdate{} -} - -// Handle is the handler for UserNoteUpdate events. -func (eh userNoteUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*UserNoteUpdate); ok { - eh(s, t) - } -} - -// userSettingsUpdateEventHandler is an event handler for UserSettingsUpdate events. -type userSettingsUpdateEventHandler func(*Session, *UserSettingsUpdate) - -// Type returns the event type for UserSettingsUpdate events. -func (eh userSettingsUpdateEventHandler) Type() string { - return userSettingsUpdateEventType -} - -// New returns a new instance of UserSettingsUpdate. -func (eh userSettingsUpdateEventHandler) New() interface{} { - return &UserSettingsUpdate{} -} - -// Handle is the handler for UserSettingsUpdate events. -func (eh userSettingsUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*UserSettingsUpdate); ok { - eh(s, t) - } -} - -// userUpdateEventHandler is an event handler for UserUpdate events. -type userUpdateEventHandler func(*Session, *UserUpdate) - -// Type returns the event type for UserUpdate events. -func (eh userUpdateEventHandler) Type() string { - return userUpdateEventType -} - -// New returns a new instance of UserUpdate. -func (eh userUpdateEventHandler) New() interface{} { - return &UserUpdate{} -} - -// Handle is the handler for UserUpdate events. -func (eh userUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*UserUpdate); ok { - eh(s, t) - } -} - -// voiceServerUpdateEventHandler is an event handler for VoiceServerUpdate events. -type voiceServerUpdateEventHandler func(*Session, *VoiceServerUpdate) - -// Type returns the event type for VoiceServerUpdate events. -func (eh voiceServerUpdateEventHandler) Type() string { - return voiceServerUpdateEventType -} - -// New returns a new instance of VoiceServerUpdate. -func (eh voiceServerUpdateEventHandler) New() interface{} { - return &VoiceServerUpdate{} -} - -// Handle is the handler for VoiceServerUpdate events. -func (eh voiceServerUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*VoiceServerUpdate); ok { - eh(s, t) - } -} - -// voiceStateUpdateEventHandler is an event handler for VoiceStateUpdate events. -type voiceStateUpdateEventHandler func(*Session, *VoiceStateUpdate) - -// Type returns the event type for VoiceStateUpdate events. -func (eh voiceStateUpdateEventHandler) Type() string { - return voiceStateUpdateEventType -} - -// New returns a new instance of VoiceStateUpdate. -func (eh voiceStateUpdateEventHandler) New() interface{} { - return &VoiceStateUpdate{} -} - -// Handle is the handler for VoiceStateUpdate events. -func (eh voiceStateUpdateEventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*VoiceStateUpdate); ok { - eh(s, t) - } -} - -func handlerForInterface(handler interface{}) EventHandler { - switch v := handler.(type) { - case func(*Session, interface{}): - return interfaceEventHandler(v) - case func(*Session, *ChannelCreate): - return channelCreateEventHandler(v) - case func(*Session, *ChannelDelete): - return channelDeleteEventHandler(v) - case func(*Session, *ChannelPinsUpdate): - return channelPinsUpdateEventHandler(v) - case func(*Session, *ChannelUpdate): - return channelUpdateEventHandler(v) - case func(*Session, *Connect): - return connectEventHandler(v) - case func(*Session, *Disconnect): - return disconnectEventHandler(v) - case func(*Session, *Event): - return eventEventHandler(v) - case func(*Session, *GuildBanAdd): - return guildBanAddEventHandler(v) - case func(*Session, *GuildBanRemove): - return guildBanRemoveEventHandler(v) - case func(*Session, *GuildCreate): - return guildCreateEventHandler(v) - case func(*Session, *GuildDelete): - return guildDeleteEventHandler(v) - case func(*Session, *GuildEmojisUpdate): - return guildEmojisUpdateEventHandler(v) - case func(*Session, *GuildIntegrationsUpdate): - return guildIntegrationsUpdateEventHandler(v) - case func(*Session, *GuildMemberAdd): - return guildMemberAddEventHandler(v) - case func(*Session, *GuildMemberRemove): - return guildMemberRemoveEventHandler(v) - case func(*Session, *GuildMemberUpdate): - return guildMemberUpdateEventHandler(v) - case func(*Session, *GuildMembersChunk): - return guildMembersChunkEventHandler(v) - case func(*Session, *GuildRoleCreate): - return guildRoleCreateEventHandler(v) - case func(*Session, *GuildRoleDelete): - return guildRoleDeleteEventHandler(v) - case func(*Session, *GuildRoleUpdate): - return guildRoleUpdateEventHandler(v) - case func(*Session, *GuildUpdate): - return guildUpdateEventHandler(v) - case func(*Session, *MessageAck): - return messageAckEventHandler(v) - case func(*Session, *MessageCreate): - return messageCreateEventHandler(v) - case func(*Session, *MessageDelete): - return messageDeleteEventHandler(v) - case func(*Session, *MessageDeleteBulk): - return messageDeleteBulkEventHandler(v) - case func(*Session, *MessageReactionAdd): - return messageReactionAddEventHandler(v) - case func(*Session, *MessageReactionRemove): - return messageReactionRemoveEventHandler(v) - case func(*Session, *MessageReactionRemoveAll): - return messageReactionRemoveAllEventHandler(v) - case func(*Session, *MessageUpdate): - return messageUpdateEventHandler(v) - case func(*Session, *PresenceUpdate): - return presenceUpdateEventHandler(v) - case func(*Session, *PresencesReplace): - return presencesReplaceEventHandler(v) - case func(*Session, *RateLimit): - return rateLimitEventHandler(v) - case func(*Session, *Ready): - return readyEventHandler(v) - case func(*Session, *RelationshipAdd): - return relationshipAddEventHandler(v) - case func(*Session, *RelationshipRemove): - return relationshipRemoveEventHandler(v) - case func(*Session, *Resumed): - return resumedEventHandler(v) - case func(*Session, *TypingStart): - return typingStartEventHandler(v) - case func(*Session, *UserGuildSettingsUpdate): - return userGuildSettingsUpdateEventHandler(v) - case func(*Session, *UserNoteUpdate): - return userNoteUpdateEventHandler(v) - case func(*Session, *UserSettingsUpdate): - return userSettingsUpdateEventHandler(v) - case func(*Session, *UserUpdate): - return userUpdateEventHandler(v) - case func(*Session, *VoiceServerUpdate): - return voiceServerUpdateEventHandler(v) - case func(*Session, *VoiceStateUpdate): - return voiceStateUpdateEventHandler(v) - } - - return nil -} - -func init() { - registerInterfaceProvider(channelCreateEventHandler(nil)) - registerInterfaceProvider(channelDeleteEventHandler(nil)) - registerInterfaceProvider(channelPinsUpdateEventHandler(nil)) - registerInterfaceProvider(channelUpdateEventHandler(nil)) - registerInterfaceProvider(guildBanAddEventHandler(nil)) - registerInterfaceProvider(guildBanRemoveEventHandler(nil)) - registerInterfaceProvider(guildCreateEventHandler(nil)) - registerInterfaceProvider(guildDeleteEventHandler(nil)) - registerInterfaceProvider(guildEmojisUpdateEventHandler(nil)) - registerInterfaceProvider(guildIntegrationsUpdateEventHandler(nil)) - registerInterfaceProvider(guildMemberAddEventHandler(nil)) - registerInterfaceProvider(guildMemberRemoveEventHandler(nil)) - registerInterfaceProvider(guildMemberUpdateEventHandler(nil)) - registerInterfaceProvider(guildMembersChunkEventHandler(nil)) - registerInterfaceProvider(guildRoleCreateEventHandler(nil)) - registerInterfaceProvider(guildRoleDeleteEventHandler(nil)) - registerInterfaceProvider(guildRoleUpdateEventHandler(nil)) - registerInterfaceProvider(guildUpdateEventHandler(nil)) - registerInterfaceProvider(messageAckEventHandler(nil)) - registerInterfaceProvider(messageCreateEventHandler(nil)) - registerInterfaceProvider(messageDeleteEventHandler(nil)) - registerInterfaceProvider(messageDeleteBulkEventHandler(nil)) - registerInterfaceProvider(messageReactionAddEventHandler(nil)) - registerInterfaceProvider(messageReactionRemoveEventHandler(nil)) - registerInterfaceProvider(messageReactionRemoveAllEventHandler(nil)) - registerInterfaceProvider(messageUpdateEventHandler(nil)) - registerInterfaceProvider(presenceUpdateEventHandler(nil)) - registerInterfaceProvider(presencesReplaceEventHandler(nil)) - registerInterfaceProvider(readyEventHandler(nil)) - registerInterfaceProvider(relationshipAddEventHandler(nil)) - registerInterfaceProvider(relationshipRemoveEventHandler(nil)) - registerInterfaceProvider(resumedEventHandler(nil)) - registerInterfaceProvider(typingStartEventHandler(nil)) - registerInterfaceProvider(userGuildSettingsUpdateEventHandler(nil)) - registerInterfaceProvider(userNoteUpdateEventHandler(nil)) - registerInterfaceProvider(userSettingsUpdateEventHandler(nil)) - registerInterfaceProvider(userUpdateEventHandler(nil)) - registerInterfaceProvider(voiceServerUpdateEventHandler(nil)) - registerInterfaceProvider(voiceStateUpdateEventHandler(nil)) -} diff --git a/vendor/github.com/bwmarrin/discordgo/events.go b/vendor/github.com/bwmarrin/discordgo/events.go deleted file mode 100644 index c78fbdd2..00000000 --- a/vendor/github.com/bwmarrin/discordgo/events.go +++ /dev/null @@ -1,253 +0,0 @@ -package discordgo - -import ( - "encoding/json" -) - -// This file contains all the possible structs that can be -// handled by AddHandler/EventHandler. -// DO NOT ADD ANYTHING BUT EVENT HANDLER STRUCTS TO THIS FILE. -//go:generate go run tools/cmd/eventhandlers/main.go - -// Connect is the data for a Connect event. -// This is a sythetic event and is not dispatched by Discord. -type Connect struct{} - -// Disconnect is the data for a Disconnect event. -// This is a sythetic event and is not dispatched by Discord. -type Disconnect struct{} - -// RateLimit is the data for a RateLimit event. -// This is a sythetic event and is not dispatched by Discord. -type RateLimit struct { - *TooManyRequests - URL string -} - -// Event provides a basic initial struct for all websocket events. -type Event struct { - Operation int `json:"op"` - Sequence int64 `json:"s"` - Type string `json:"t"` - RawData json.RawMessage `json:"d"` - // Struct contains one of the other types in this file. - Struct interface{} `json:"-"` -} - -// A Ready stores all data for the websocket READY event. -type Ready struct { - Version int `json:"v"` - SessionID string `json:"session_id"` - User *User `json:"user"` - ReadState []*ReadState `json:"read_state"` - PrivateChannels []*Channel `json:"private_channels"` - Guilds []*Guild `json:"guilds"` - - // Undocumented fields - Settings *Settings `json:"user_settings"` - UserGuildSettings []*UserGuildSettings `json:"user_guild_settings"` - Relationships []*Relationship `json:"relationships"` - Presences []*Presence `json:"presences"` - Notes map[string]string `json:"notes"` -} - -// ChannelCreate is the data for a ChannelCreate event. -type ChannelCreate struct { - *Channel -} - -// ChannelUpdate is the data for a ChannelUpdate event. -type ChannelUpdate struct { - *Channel -} - -// ChannelDelete is the data for a ChannelDelete event. -type ChannelDelete struct { - *Channel -} - -// ChannelPinsUpdate stores data for a ChannelPinsUpdate event. -type ChannelPinsUpdate struct { - LastPinTimestamp string `json:"last_pin_timestamp"` - ChannelID string `json:"channel_id"` -} - -// GuildCreate is the data for a GuildCreate event. -type GuildCreate struct { - *Guild -} - -// GuildUpdate is the data for a GuildUpdate event. -type GuildUpdate struct { - *Guild -} - -// GuildDelete is the data for a GuildDelete event. -type GuildDelete struct { - *Guild -} - -// GuildBanAdd is the data for a GuildBanAdd event. -type GuildBanAdd struct { - User *User `json:"user"` - GuildID string `json:"guild_id"` -} - -// GuildBanRemove is the data for a GuildBanRemove event. -type GuildBanRemove struct { - User *User `json:"user"` - GuildID string `json:"guild_id"` -} - -// GuildMemberAdd is the data for a GuildMemberAdd event. -type GuildMemberAdd struct { - *Member -} - -// GuildMemberUpdate is the data for a GuildMemberUpdate event. -type GuildMemberUpdate struct { - *Member -} - -// GuildMemberRemove is the data for a GuildMemberRemove event. -type GuildMemberRemove struct { - *Member -} - -// GuildRoleCreate is the data for a GuildRoleCreate event. -type GuildRoleCreate struct { - *GuildRole -} - -// GuildRoleUpdate is the data for a GuildRoleUpdate event. -type GuildRoleUpdate struct { - *GuildRole -} - -// A GuildRoleDelete is the data for a GuildRoleDelete event. -type GuildRoleDelete struct { - RoleID string `json:"role_id"` - GuildID string `json:"guild_id"` -} - -// A GuildEmojisUpdate is the data for a guild emoji update event. -type GuildEmojisUpdate struct { - GuildID string `json:"guild_id"` - Emojis []*Emoji `json:"emojis"` -} - -// A GuildMembersChunk is the data for a GuildMembersChunk event. -type GuildMembersChunk struct { - GuildID string `json:"guild_id"` - Members []*Member `json:"members"` -} - -// GuildIntegrationsUpdate is the data for a GuildIntegrationsUpdate event. -type GuildIntegrationsUpdate struct { - GuildID string `json:"guild_id"` -} - -// MessageAck is the data for a MessageAck event. -type MessageAck struct { - MessageID string `json:"message_id"` - ChannelID string `json:"channel_id"` -} - -// MessageCreate is the data for a MessageCreate event. -type MessageCreate struct { - *Message -} - -// MessageUpdate is the data for a MessageUpdate event. -type MessageUpdate struct { - *Message -} - -// MessageDelete is the data for a MessageDelete event. -type MessageDelete struct { - *Message -} - -// MessageReactionAdd is the data for a MessageReactionAdd event. -type MessageReactionAdd struct { - *MessageReaction -} - -// MessageReactionRemove is the data for a MessageReactionRemove event. -type MessageReactionRemove struct { - *MessageReaction -} - -// MessageReactionRemoveAll is the data for a MessageReactionRemoveAll event. -type MessageReactionRemoveAll struct { - *MessageReaction -} - -// PresencesReplace is the data for a PresencesReplace event. -type PresencesReplace []*Presence - -// PresenceUpdate is the data for a PresenceUpdate event. -type PresenceUpdate struct { - Presence - GuildID string `json:"guild_id"` - Roles []string `json:"roles"` -} - -// Resumed is the data for a Resumed event. -type Resumed struct { - Trace []string `json:"_trace"` -} - -// RelationshipAdd is the data for a RelationshipAdd event. -type RelationshipAdd struct { - *Relationship -} - -// RelationshipRemove is the data for a RelationshipRemove event. -type RelationshipRemove struct { - *Relationship -} - -// TypingStart is the data for a TypingStart event. -type TypingStart struct { - UserID string `json:"user_id"` - ChannelID string `json:"channel_id"` - Timestamp int `json:"timestamp"` -} - -// UserUpdate is the data for a UserUpdate event. -type UserUpdate struct { - *User -} - -// UserSettingsUpdate is the data for a UserSettingsUpdate event. -type UserSettingsUpdate map[string]interface{} - -// UserGuildSettingsUpdate is the data for a UserGuildSettingsUpdate event. -type UserGuildSettingsUpdate struct { - *UserGuildSettings -} - -// UserNoteUpdate is the data for a UserNoteUpdate event. -type UserNoteUpdate struct { - ID string `json:"id"` - Note string `json:"note"` -} - -// VoiceServerUpdate is the data for a VoiceServerUpdate event. -type VoiceServerUpdate struct { - Token string `json:"token"` - GuildID string `json:"guild_id"` - Endpoint string `json:"endpoint"` -} - -// VoiceStateUpdate is the data for a VoiceStateUpdate event. -type VoiceStateUpdate struct { - *VoiceState -} - -// MessageDeleteBulk is the data for a MessageDeleteBulk event -type MessageDeleteBulk struct { - Messages []string `json:"ids"` - ChannelID string `json:"channel_id"` -} diff --git a/vendor/github.com/bwmarrin/discordgo/examples/airhorn/main.go b/vendor/github.com/bwmarrin/discordgo/examples/airhorn/main.go deleted file mode 100644 index 21ceb76b..00000000 --- a/vendor/github.com/bwmarrin/discordgo/examples/airhorn/main.go +++ /dev/null @@ -1,211 +0,0 @@ -package main - -import ( - "encoding/binary" - "flag" - "fmt" - "io" - "os" - "os/signal" - "strings" - "syscall" - "time" - - "github.com/bwmarrin/discordgo" -) - -func init() { - flag.StringVar(&token, "t", "", "Bot Token") - flag.Parse() -} - -var token string -var buffer = make([][]byte, 0) - -func main() { - - if token == "" { - fmt.Println("No token provided. Please run: airhorn -t ") - return - } - - // Load the sound file. - err := loadSound() - if err != nil { - fmt.Println("Error loading sound: ", err) - fmt.Println("Please copy $GOPATH/src/github.com/bwmarrin/examples/airhorn/airhorn.dca to this directory.") - return - } - - // Create a new Discord session using the provided bot token. - dg, err := discordgo.New("Bot " + token) - if err != nil { - fmt.Println("Error creating Discord session: ", err) - return - } - - // Register ready as a callback for the ready events. - dg.AddHandler(ready) - - // Register messageCreate as a callback for the messageCreate events. - dg.AddHandler(messageCreate) - - // Register guildCreate as a callback for the guildCreate events. - dg.AddHandler(guildCreate) - - // Open the websocket and begin listening. - err = dg.Open() - if err != nil { - fmt.Println("Error opening Discord session: ", err) - } - - // Wait here until CTRL-C or other term signal is received. - fmt.Println("Airhorn is now running. Press CTRL-C to exit.") - sc := make(chan os.Signal, 1) - signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) - <-sc - - // Cleanly close down the Discord session. - dg.Close() -} - -// This function will be called (due to AddHandler above) when the bot receives -// the "ready" event from Discord. -func ready(s *discordgo.Session, event *discordgo.Ready) { - - // Set the playing status. - s.UpdateStatus(0, "!airhorn") -} - -// This function will be called (due to AddHandler above) every time a new -// message is created on any channel that the autenticated bot has access to. -func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { - - // Ignore all messages created by the bot itself - // This isn't required in this specific example but it's a good practice. - if m.Author.ID == s.State.User.ID { - return - } - - // check if the message is "!airhorn" - if strings.HasPrefix(m.Content, "!airhorn") { - - // Find the channel that the message came from. - c, err := s.State.Channel(m.ChannelID) - if err != nil { - // Could not find channel. - return - } - - // Find the guild for that channel. - g, err := s.State.Guild(c.GuildID) - if err != nil { - // Could not find guild. - return - } - - // Look for the message sender in that guild's current voice states. - for _, vs := range g.VoiceStates { - if vs.UserID == m.Author.ID { - err = playSound(s, g.ID, vs.ChannelID) - if err != nil { - fmt.Println("Error playing sound:", err) - } - - return - } - } - } -} - -// This function will be called (due to AddHandler above) every time a new -// guild is joined. -func guildCreate(s *discordgo.Session, event *discordgo.GuildCreate) { - - if event.Guild.Unavailable { - return - } - - for _, channel := range event.Guild.Channels { - if channel.ID == event.Guild.ID { - _, _ = s.ChannelMessageSend(channel.ID, "Airhorn is ready! Type !airhorn while in a voice channel to play a sound.") - return - } - } -} - -// loadSound attempts to load an encoded sound file from disk. -func loadSound() error { - - file, err := os.Open("airhorn.dca") - if err != nil { - fmt.Println("Error opening dca file :", err) - return err - } - - var opuslen int16 - - for { - // Read opus frame length from dca file. - err = binary.Read(file, binary.LittleEndian, &opuslen) - - // If this is the end of the file, just return. - if err == io.EOF || err == io.ErrUnexpectedEOF { - err := file.Close() - if err != nil { - return err - } - return nil - } - - if err != nil { - fmt.Println("Error reading from dca file :", err) - return err - } - - // Read encoded pcm from dca file. - InBuf := make([]byte, opuslen) - err = binary.Read(file, binary.LittleEndian, &InBuf) - - // Should not be any end of file errors - if err != nil { - fmt.Println("Error reading from dca file :", err) - return err - } - - // Append encoded pcm data to the buffer. - buffer = append(buffer, InBuf) - } -} - -// playSound plays the current buffer to the provided channel. -func playSound(s *discordgo.Session, guildID, channelID string) (err error) { - - // Join the provided voice channel. - vc, err := s.ChannelVoiceJoin(guildID, channelID, false, true) - if err != nil { - return err - } - - // Sleep for a specified amount of time before playing the sound - time.Sleep(250 * time.Millisecond) - - // Start speaking. - vc.Speaking(true) - - // Send the buffer data. - for _, buff := range buffer { - vc.OpusSend <- buff - } - - // Stop speaking - vc.Speaking(false) - - // Sleep for a specificed amount of time before ending. - time.Sleep(250 * time.Millisecond) - - // Disconnect from the provided voice channel. - vc.Disconnect() - - return nil -} diff --git a/vendor/github.com/bwmarrin/discordgo/examples/appmaker/main.go b/vendor/github.com/bwmarrin/discordgo/examples/appmaker/main.go deleted file mode 100644 index 5581dd93..00000000 --- a/vendor/github.com/bwmarrin/discordgo/examples/appmaker/main.go +++ /dev/null @@ -1,103 +0,0 @@ -package main - -import ( - "encoding/json" - "flag" - "fmt" - "os" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line options -var ( - Token string - Name string - DeleteID string - ListOnly bool -) - -func init() { - - flag.StringVar(&Token, "t", "", "Owner Account Token") - flag.StringVar(&Name, "n", "", "Name to give App/Bot") - flag.StringVar(&DeleteID, "d", "", "Application ID to delete") - flag.BoolVar(&ListOnly, "l", false, "List Applications Only") - flag.Parse() - - if Token == "" { - flag.Usage() - os.Exit(1) - } -} - -func main() { - - var err error - - // Create a new Discord session using the provided login information. - dg, err := discordgo.New(Token) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // If -l set, only display a list of existing applications - // for the given account. - if ListOnly { - - aps, err := dg.Applications() - if err != nil { - fmt.Println("error fetching applications,", err) - return - } - - for _, v := range aps { - fmt.Println("-----------------------------------------------------") - b, _ := json.MarshalIndent(v, "", " ") - fmt.Println(string(b)) - } - return - } - - // if -d set, delete the given Application - if DeleteID != "" { - err = dg.ApplicationDelete(DeleteID) - if err != nil { - fmt.Println("error deleting application,", err) - } - return - } - - if Name == "" { - flag.Usage() - os.Exit(1) - } - - // Create a new application. - ap := &discordgo.Application{} - ap.Name = Name - ap, err = dg.ApplicationCreate(ap) - if err != nil { - fmt.Println("error creating new application,", err) - return - } - - fmt.Printf("Application created successfully:\n") - b, _ := json.MarshalIndent(ap, "", " ") - fmt.Println(string(b)) - - // Create the bot account under the application we just created - bot, err := dg.ApplicationBotCreate(ap.ID) - if err != nil { - fmt.Println("error creating bot account,", err) - return - } - - fmt.Printf("Bot account created successfully.\n") - b, _ = json.MarshalIndent(bot, "", " ") - fmt.Println(string(b)) - - fmt.Println("Please save the above posted info in a secure place.") - fmt.Println("You will need that information to login with your bot account.") -} diff --git a/vendor/github.com/bwmarrin/discordgo/examples/avatar/main.go b/vendor/github.com/bwmarrin/discordgo/examples/avatar/main.go deleted file mode 100644 index e0a9c880..00000000 --- a/vendor/github.com/bwmarrin/discordgo/examples/avatar/main.go +++ /dev/null @@ -1,89 +0,0 @@ -package main - -import ( - "encoding/base64" - "flag" - "fmt" - "io/ioutil" - "net/http" - "os" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line parameters -var ( - Token string - AvatarFile string - AvatarURL string -) - -func init() { - - flag.StringVar(&Token, "t", "", "Bot Token") - flag.StringVar(&AvatarFile, "f", "", "Avatar File Name") - flag.StringVar(&AvatarURL, "u", "", "URL to the avatar image") - flag.Parse() - - if Token == "" || (AvatarFile == "" && AvatarURL == "") { - flag.Usage() - os.Exit(1) - } -} - -func main() { - - // Create a new Discord session using the provided login information. - dg, err := discordgo.New("Bot " + Token) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // Declare these here so they can be used in the below two if blocks and - // still carry over to the end of this function. - var base64img string - var contentType string - - // If we're using a URL link for the Avatar - if AvatarURL != "" { - - resp, err := http.Get(AvatarURL) - if err != nil { - fmt.Println("Error retrieving the file, ", err) - return - } - - defer func() { - _ = resp.Body.Close() - }() - - img, err := ioutil.ReadAll(resp.Body) - if err != nil { - fmt.Println("Error reading the response, ", err) - return - } - - contentType = http.DetectContentType(img) - base64img = base64.StdEncoding.EncodeToString(img) - } - - // If we're using a local file for the Avatar - if AvatarFile != "" { - img, err := ioutil.ReadFile(AvatarFile) - if err != nil { - fmt.Println(err) - } - - contentType = http.DetectContentType(img) - base64img = base64.StdEncoding.EncodeToString(img) - } - - // Now lets format our base64 image into the proper format Discord wants - // and then call UserUpdate to set it as our user's Avatar. - avatar := fmt.Sprintf("data:%s;base64,%s", contentType, base64img) - _, err = dg.UserUpdate("", "", "", avatar, "") - if err != nil { - fmt.Println(err) - } -} diff --git a/vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go b/vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go deleted file mode 100644 index 9375eadc..00000000 --- a/vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line parameters -var ( - Email string - Password string -) - -func init() { - - flag.StringVar(&Email, "e", "", "Account Email") - flag.StringVar(&Password, "p", "", "Account Password") - flag.Parse() - - if Email == "" || Password == "" { - flag.Usage() - os.Exit(1) - } -} - -func main() { - - // Create a new Discord session using the provided login information. - dg, err := discordgo.New(Email, Password) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // Print out your token. - fmt.Printf("Your Authentication Token is:\n\n%s\n", dg.Token) -} diff --git a/vendor/github.com/bwmarrin/discordgo/examples/pingpong/main.go b/vendor/github.com/bwmarrin/discordgo/examples/pingpong/main.go deleted file mode 100644 index 155e782f..00000000 --- a/vendor/github.com/bwmarrin/discordgo/examples/pingpong/main.go +++ /dev/null @@ -1,71 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - "os/signal" - "syscall" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line parameters -var ( - Token string -) - -func init() { - - flag.StringVar(&Token, "t", "", "Bot Token") - flag.Parse() -} - -func main() { - - // Create a new Discord session using the provided bot token. - dg, err := discordgo.New("Bot " + Token) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // Register the messageCreate func as a callback for MessageCreate events. - dg.AddHandler(messageCreate) - - // Open a websocket connection to Discord and begin listening. - err = dg.Open() - if err != nil { - fmt.Println("error opening connection,", err) - return - } - - // Wait here until CTRL-C or other term signal is received. - fmt.Println("Bot is now running. Press CTRL-C to exit.") - sc := make(chan os.Signal, 1) - signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) - <-sc - - // Cleanly close down the Discord session. - dg.Close() -} - -// This function will be called (due to AddHandler above) every time a new -// message is created on any channel that the autenticated bot has access to. -func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { - - // Ignore all messages created by the bot itself - // This isn't required in this specific example but it's a good practice. - if m.Author.ID == s.State.User.ID { - return - } - // If the message is "ping" reply with "Pong!" - if m.Content == "ping" { - s.ChannelMessageSend(m.ChannelID, "Pong!") - } - - // If the message is "pong" reply with "Ping!" - if m.Content == "pong" { - s.ChannelMessageSend(m.ChannelID, "Ping!") - } -} diff --git a/vendor/github.com/bwmarrin/discordgo/logging.go b/vendor/github.com/bwmarrin/discordgo/logging.go deleted file mode 100644 index 6460b35b..00000000 --- a/vendor/github.com/bwmarrin/discordgo/logging.go +++ /dev/null @@ -1,103 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains code related to discordgo package logging - -package discordgo - -import ( - "fmt" - "log" - "runtime" - "strings" -) - -const ( - - // LogError level is used for critical errors that could lead to data loss - // or panic that would not be returned to a calling function. - LogError int = iota - - // LogWarning level is used for very abnormal events and errors that are - // also returned to a calling function. - LogWarning - - // LogInformational level is used for normal non-error activity - LogInformational - - // LogDebug level is for very detailed non-error activity. This is - // very spammy and will impact performance. - LogDebug -) - -// Logger can be used to replace the standard logging for discordgo -var Logger func(msgL, caller int, format string, a ...interface{}) - -// msglog provides package wide logging consistancy for discordgo -// the format, a... portion this command follows that of fmt.Printf -// msgL : LogLevel of the message -// caller : 1 + the number of callers away from the message source -// format : Printf style message format -// a ... : comma separated list of values to pass -func msglog(msgL, caller int, format string, a ...interface{}) { - - if Logger != nil { - Logger(msgL, caller, format, a...) - } else { - - pc, file, line, _ := runtime.Caller(caller) - - files := strings.Split(file, "/") - file = files[len(files)-1] - - name := runtime.FuncForPC(pc).Name() - fns := strings.Split(name, ".") - name = fns[len(fns)-1] - - msg := fmt.Sprintf(format, a...) - - log.Printf("[DG%d] %s:%d:%s() %s\n", msgL, file, line, name, msg) - } -} - -// helper function that wraps msglog for the Session struct -// This adds a check to insure the message is only logged -// if the session log level is equal or higher than the -// message log level -func (s *Session) log(msgL int, format string, a ...interface{}) { - - if msgL > s.LogLevel { - return - } - - msglog(msgL, 2, format, a...) -} - -// helper function that wraps msglog for the VoiceConnection struct -// This adds a check to insure the message is only logged -// if the voice connection log level is equal or higher than the -// message log level -func (v *VoiceConnection) log(msgL int, format string, a ...interface{}) { - - if msgL > v.LogLevel { - return - } - - msglog(msgL, 2, format, a...) -} - -// printJSON is a helper function to display JSON data in a easy to read format. -/* NOT USED ATM -func printJSON(body []byte) { - var prettyJSON bytes.Buffer - error := json.Indent(&prettyJSON, body, "", "\t") - if error != nil { - log.Print("JSON parse error: ", error) - } - log.Println(string(prettyJSON.Bytes())) -} -*/ diff --git a/vendor/github.com/bwmarrin/discordgo/message.go b/vendor/github.com/bwmarrin/discordgo/message.go deleted file mode 100644 index 4fd468fd..00000000 --- a/vendor/github.com/bwmarrin/discordgo/message.go +++ /dev/null @@ -1,252 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains code related to the Message struct - -package discordgo - -import ( - "io" - "regexp" - "strings" -) - -// MessageType is the type of Message -type MessageType int - -// Block contains the valid known MessageType values -const ( - MessageTypeDefault MessageType = iota - MessageTypeRecipientAdd - MessageTypeRecipientRemove - MessageTypeCall - MessageTypeChannelNameChange - MessageTypeChannelIconChange - MessageTypeChannelPinnedMessage - MessageTypeGuildMemberJoin -) - -// A Message stores all data related to a specific Discord message. -type Message struct { - ID string `json:"id"` - ChannelID string `json:"channel_id"` - Content string `json:"content"` - Timestamp Timestamp `json:"timestamp"` - EditedTimestamp Timestamp `json:"edited_timestamp"` - MentionRoles []string `json:"mention_roles"` - Tts bool `json:"tts"` - MentionEveryone bool `json:"mention_everyone"` - Author *User `json:"author"` - Attachments []*MessageAttachment `json:"attachments"` - Embeds []*MessageEmbed `json:"embeds"` - Mentions []*User `json:"mentions"` - Reactions []*MessageReactions `json:"reactions"` - Type MessageType `json:"type"` -} - -// File stores info about files you e.g. send in messages. -type File struct { - Name string - ContentType string - Reader io.Reader -} - -// MessageSend stores all parameters you can send with ChannelMessageSendComplex. -type MessageSend struct { - Content string `json:"content,omitempty"` - Embed *MessageEmbed `json:"embed,omitempty"` - Tts bool `json:"tts"` - Files []*File `json:"-"` - - // TODO: Remove this when compatibility is not required. - File *File `json:"-"` -} - -// MessageEdit is used to chain parameters via ChannelMessageEditComplex, which -// is also where you should get the instance from. -type MessageEdit struct { - Content *string `json:"content,omitempty"` - Embed *MessageEmbed `json:"embed,omitempty"` - - ID string - Channel string -} - -// NewMessageEdit returns a MessageEdit struct, initialized -// with the Channel and ID. -func NewMessageEdit(channelID string, messageID string) *MessageEdit { - return &MessageEdit{ - Channel: channelID, - ID: messageID, - } -} - -// SetContent is the same as setting the variable Content, -// except it doesn't take a pointer. -func (m *MessageEdit) SetContent(str string) *MessageEdit { - m.Content = &str - return m -} - -// SetEmbed is a convenience function for setting the embed, -// so you can chain commands. -func (m *MessageEdit) SetEmbed(embed *MessageEmbed) *MessageEdit { - m.Embed = embed - return m -} - -// A MessageAttachment stores data for message attachments. -type MessageAttachment struct { - ID string `json:"id"` - URL string `json:"url"` - ProxyURL string `json:"proxy_url"` - Filename string `json:"filename"` - Width int `json:"width"` - Height int `json:"height"` - Size int `json:"size"` -} - -// MessageEmbedFooter is a part of a MessageEmbed struct. -type MessageEmbedFooter struct { - Text string `json:"text,omitempty"` - IconURL string `json:"icon_url,omitempty"` - ProxyIconURL string `json:"proxy_icon_url,omitempty"` -} - -// MessageEmbedImage is a part of a MessageEmbed struct. -type MessageEmbedImage struct { - URL string `json:"url,omitempty"` - ProxyURL string `json:"proxy_url,omitempty"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` -} - -// MessageEmbedThumbnail is a part of a MessageEmbed struct. -type MessageEmbedThumbnail struct { - URL string `json:"url,omitempty"` - ProxyURL string `json:"proxy_url,omitempty"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` -} - -// MessageEmbedVideo is a part of a MessageEmbed struct. -type MessageEmbedVideo struct { - URL string `json:"url,omitempty"` - ProxyURL string `json:"proxy_url,omitempty"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` -} - -// MessageEmbedProvider is a part of a MessageEmbed struct. -type MessageEmbedProvider struct { - URL string `json:"url,omitempty"` - Name string `json:"name,omitempty"` -} - -// MessageEmbedAuthor is a part of a MessageEmbed struct. -type MessageEmbedAuthor struct { - URL string `json:"url,omitempty"` - Name string `json:"name,omitempty"` - IconURL string `json:"icon_url,omitempty"` - ProxyIconURL string `json:"proxy_icon_url,omitempty"` -} - -// MessageEmbedField is a part of a MessageEmbed struct. -type MessageEmbedField struct { - Name string `json:"name,omitempty"` - Value string `json:"value,omitempty"` - Inline bool `json:"inline,omitempty"` -} - -// An MessageEmbed stores data for message embeds. -type MessageEmbed struct { - URL string `json:"url,omitempty"` - Type string `json:"type,omitempty"` - Title string `json:"title,omitempty"` - Description string `json:"description,omitempty"` - Timestamp string `json:"timestamp,omitempty"` - Color int `json:"color,omitempty"` - Footer *MessageEmbedFooter `json:"footer,omitempty"` - Image *MessageEmbedImage `json:"image,omitempty"` - Thumbnail *MessageEmbedThumbnail `json:"thumbnail,omitempty"` - Video *MessageEmbedVideo `json:"video,omitempty"` - Provider *MessageEmbedProvider `json:"provider,omitempty"` - Author *MessageEmbedAuthor `json:"author,omitempty"` - Fields []*MessageEmbedField `json:"fields,omitempty"` -} - -// MessageReactions holds a reactions object for a message. -type MessageReactions struct { - Count int `json:"count"` - Me bool `json:"me"` - Emoji *Emoji `json:"emoji"` -} - -// ContentWithMentionsReplaced will replace all @ mentions with the -// username of the mention. -func (m *Message) ContentWithMentionsReplaced() (content string) { - content = m.Content - - for _, user := range m.Mentions { - content = strings.NewReplacer( - "<@"+user.ID+">", "@"+user.Username, - "<@!"+user.ID+">", "@"+user.Username, - ).Replace(content) - } - return -} - -var patternChannels = regexp.MustCompile("<#[^>]*>") - -// ContentWithMoreMentionsReplaced will replace all @ mentions with the -// username of the mention, but also role IDs and more. -func (m *Message) ContentWithMoreMentionsReplaced(s *Session) (content string, err error) { - content = m.Content - - if !s.StateEnabled { - content = m.ContentWithMentionsReplaced() - return - } - - channel, err := s.State.Channel(m.ChannelID) - if err != nil { - content = m.ContentWithMentionsReplaced() - return - } - - for _, user := range m.Mentions { - nick := user.Username - - member, err := s.State.Member(channel.GuildID, user.ID) - if err == nil && member.Nick != "" { - nick = member.Nick - } - - content = strings.NewReplacer( - "<@"+user.ID+">", "@"+user.Username, - "<@!"+user.ID+">", "@"+nick, - ).Replace(content) - } - for _, roleID := range m.MentionRoles { - role, err := s.State.Role(channel.GuildID, roleID) - if err != nil || !role.Mentionable { - continue - } - - content = strings.Replace(content, "<@&"+role.ID+">", "@"+role.Name, -1) - } - - content = patternChannels.ReplaceAllStringFunc(content, func(mention string) string { - channel, err := s.State.Channel(mention[2 : len(mention)-1]) - if err != nil || channel.Type == ChannelTypeGuildVoice { - return mention - } - - return "#" + channel.Name - }) - return -} diff --git a/vendor/github.com/bwmarrin/discordgo/oauth2.go b/vendor/github.com/bwmarrin/discordgo/oauth2.go deleted file mode 100644 index 108b32fe..00000000 --- a/vendor/github.com/bwmarrin/discordgo/oauth2.go +++ /dev/null @@ -1,126 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains functions related to Discord OAuth2 endpoints - -package discordgo - -// ------------------------------------------------------------------------------------------------ -// Code specific to Discord OAuth2 Applications -// ------------------------------------------------------------------------------------------------ - -// An Application struct stores values for a Discord OAuth2 Application -type Application struct { - ID string `json:"id,omitempty"` - Name string `json:"name"` - Description string `json:"description,omitempty"` - Icon string `json:"icon,omitempty"` - Secret string `json:"secret,omitempty"` - RedirectURIs *[]string `json:"redirect_uris,omitempty"` - BotRequireCodeGrant bool `json:"bot_require_code_grant,omitempty"` - BotPublic bool `json:"bot_public,omitempty"` - RPCApplicationState int `json:"rpc_application_state,omitempty"` - Flags int `json:"flags,omitempty"` - Owner *User `json:"owner"` - Bot *User `json:"bot"` -} - -// Application returns an Application structure of a specific Application -// appID : The ID of an Application -func (s *Session) Application(appID string) (st *Application, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointApplication(appID), nil, EndpointApplication("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// Applications returns all applications for the authenticated user -func (s *Session) Applications() (st []*Application, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointApplications, nil, EndpointApplications) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ApplicationCreate creates a new Application -// name : Name of Application / Bot -// uris : Redirect URIs (Not required) -func (s *Session) ApplicationCreate(ap *Application) (st *Application, err error) { - - data := struct { - Name string `json:"name"` - Description string `json:"description"` - RedirectURIs *[]string `json:"redirect_uris,omitempty"` - }{ap.Name, ap.Description, ap.RedirectURIs} - - body, err := s.RequestWithBucketID("POST", EndpointApplications, data, EndpointApplications) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ApplicationUpdate updates an existing Application -// var : desc -func (s *Session) ApplicationUpdate(appID string, ap *Application) (st *Application, err error) { - - data := struct { - Name string `json:"name"` - Description string `json:"description"` - RedirectURIs *[]string `json:"redirect_uris,omitempty"` - }{ap.Name, ap.Description, ap.RedirectURIs} - - body, err := s.RequestWithBucketID("PUT", EndpointApplication(appID), data, EndpointApplication("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ApplicationDelete deletes an existing Application -// appID : The ID of an Application -func (s *Session) ApplicationDelete(appID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointApplication(appID), nil, EndpointApplication("")) - if err != nil { - return - } - - return -} - -// ------------------------------------------------------------------------------------------------ -// Code specific to Discord OAuth2 Application Bots -// ------------------------------------------------------------------------------------------------ - -// ApplicationBotCreate creates an Application Bot Account -// -// appID : The ID of an Application -// -// NOTE: func name may change, if I can think up something better. -func (s *Session) ApplicationBotCreate(appID string) (st *User, err error) { - - body, err := s.RequestWithBucketID("POST", EndpointApplicationsBot(appID), nil, EndpointApplicationsBot("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} diff --git a/vendor/github.com/bwmarrin/discordgo/ratelimit.go b/vendor/github.com/bwmarrin/discordgo/ratelimit.go deleted file mode 100644 index dc48c924..00000000 --- a/vendor/github.com/bwmarrin/discordgo/ratelimit.go +++ /dev/null @@ -1,194 +0,0 @@ -package discordgo - -import ( - "net/http" - "strconv" - "strings" - "sync" - "sync/atomic" - "time" -) - -// customRateLimit holds information for defining a custom rate limit -type customRateLimit struct { - suffix string - requests int - reset time.Duration -} - -// RateLimiter holds all ratelimit buckets -type RateLimiter struct { - sync.Mutex - global *int64 - buckets map[string]*Bucket - globalRateLimit time.Duration - customRateLimits []*customRateLimit -} - -// NewRatelimiter returns a new RateLimiter -func NewRatelimiter() *RateLimiter { - - return &RateLimiter{ - buckets: make(map[string]*Bucket), - global: new(int64), - customRateLimits: []*customRateLimit{ - &customRateLimit{ - suffix: "//reactions//", - requests: 1, - reset: 200 * time.Millisecond, - }, - }, - } -} - -// GetBucket retrieves or creates a bucket -func (r *RateLimiter) GetBucket(key string) *Bucket { - r.Lock() - defer r.Unlock() - - if bucket, ok := r.buckets[key]; ok { - return bucket - } - - b := &Bucket{ - Remaining: 1, - Key: key, - global: r.global, - } - - // Check if there is a custom ratelimit set for this bucket ID. - for _, rl := range r.customRateLimits { - if strings.HasSuffix(b.Key, rl.suffix) { - b.customRateLimit = rl - break - } - } - - r.buckets[key] = b - return b -} - -// GetWaitTime returns the duration you should wait for a Bucket -func (r *RateLimiter) GetWaitTime(b *Bucket, minRemaining int) time.Duration { - // If we ran out of calls and the reset time is still ahead of us - // then we need to take it easy and relax a little - if b.Remaining < minRemaining && b.reset.After(time.Now()) { - return b.reset.Sub(time.Now()) - } - - // Check for global ratelimits - sleepTo := time.Unix(0, atomic.LoadInt64(r.global)) - if now := time.Now(); now.Before(sleepTo) { - return sleepTo.Sub(now) - } - - return 0 -} - -// LockBucket Locks until a request can be made -func (r *RateLimiter) LockBucket(bucketID string) *Bucket { - return r.LockBucketObject(r.GetBucket(bucketID)) -} - -// LockBucketObject Locks an already resolved bucket until a request can be made -func (r *RateLimiter) LockBucketObject(b *Bucket) *Bucket { - b.Lock() - - if wait := r.GetWaitTime(b, 1); wait > 0 { - time.Sleep(wait) - } - - b.Remaining-- - return b -} - -// Bucket represents a ratelimit bucket, each bucket gets ratelimited individually (-global ratelimits) -type Bucket struct { - sync.Mutex - Key string - Remaining int - limit int - reset time.Time - global *int64 - - lastReset time.Time - customRateLimit *customRateLimit - Userdata interface{} -} - -// Release unlocks the bucket and reads the headers to update the buckets ratelimit info -// and locks up the whole thing in case if there's a global ratelimit. -func (b *Bucket) Release(headers http.Header) error { - defer b.Unlock() - - // Check if the bucket uses a custom ratelimiter - if rl := b.customRateLimit; rl != nil { - if time.Now().Sub(b.lastReset) >= rl.reset { - b.Remaining = rl.requests - 1 - b.lastReset = time.Now() - } - if b.Remaining < 1 { - b.reset = time.Now().Add(rl.reset) - } - return nil - } - - if headers == nil { - return nil - } - - remaining := headers.Get("X-RateLimit-Remaining") - reset := headers.Get("X-RateLimit-Reset") - global := headers.Get("X-RateLimit-Global") - retryAfter := headers.Get("Retry-After") - - // Update global and per bucket reset time if the proper headers are available - // If global is set, then it will block all buckets until after Retry-After - // If Retry-After without global is provided it will use that for the new reset - // time since it's more accurate than X-RateLimit-Reset. - // If Retry-After after is not proided, it will update the reset time from X-RateLimit-Reset - if retryAfter != "" { - parsedAfter, err := strconv.ParseInt(retryAfter, 10, 64) - if err != nil { - return err - } - - resetAt := time.Now().Add(time.Duration(parsedAfter) * time.Millisecond) - - // Lock either this single bucket or all buckets - if global != "" { - atomic.StoreInt64(b.global, resetAt.UnixNano()) - } else { - b.reset = resetAt - } - } else if reset != "" { - // Calculate the reset time by using the date header returned from discord - discordTime, err := http.ParseTime(headers.Get("Date")) - if err != nil { - return err - } - - unix, err := strconv.ParseInt(reset, 10, 64) - if err != nil { - return err - } - - // Calculate the time until reset and add it to the current local time - // some extra time is added because without it i still encountered 429's. - // The added amount is the lowest amount that gave no 429's - // in 1k requests - delta := time.Unix(unix, 0).Sub(discordTime) + time.Millisecond*250 - b.reset = time.Now().Add(delta) - } - - // Udpate remaining if header is present - if remaining != "" { - parsedRemaining, err := strconv.ParseInt(remaining, 10, 32) - if err != nil { - return err - } - b.Remaining = int(parsedRemaining) - } - - return nil -} diff --git a/vendor/github.com/bwmarrin/discordgo/restapi.go b/vendor/github.com/bwmarrin/discordgo/restapi.go deleted file mode 100644 index 5dc0467f..00000000 --- a/vendor/github.com/bwmarrin/discordgo/restapi.go +++ /dev/null @@ -1,2049 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains functions for interacting with the Discord REST/JSON API -// at the lowest level. - -package discordgo - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "image" - _ "image/jpeg" // For JPEG decoding - _ "image/png" // For PNG decoding - "io" - "io/ioutil" - "log" - "mime/multipart" - "net/http" - "net/textproto" - "net/url" - "strconv" - "strings" - "time" -) - -// All error constants -var ( - ErrJSONUnmarshal = errors.New("json unmarshal") - ErrStatusOffline = errors.New("You can't set your Status to offline") - ErrVerificationLevelBounds = errors.New("VerificationLevel out of bounds, should be between 0 and 3") - ErrPruneDaysBounds = errors.New("the number of days should be more than or equal to 1") - ErrGuildNoIcon = errors.New("guild does not have an icon set") - ErrGuildNoSplash = errors.New("guild does not have a splash set") -) - -// Request is the same as RequestWithBucketID but the bucket id is the same as the urlStr -func (s *Session) Request(method, urlStr string, data interface{}) (response []byte, err error) { - return s.RequestWithBucketID(method, urlStr, data, strings.SplitN(urlStr, "?", 2)[0]) -} - -// RequestWithBucketID makes a (GET/POST/...) Requests to Discord REST API with JSON data. -func (s *Session) RequestWithBucketID(method, urlStr string, data interface{}, bucketID string) (response []byte, err error) { - var body []byte - if data != nil { - body, err = json.Marshal(data) - if err != nil { - return - } - } - - return s.request(method, urlStr, "application/json", body, bucketID, 0) -} - -// request makes a (GET/POST/...) Requests to Discord REST API. -// Sequence is the sequence number, if it fails with a 502 it will -// retry with sequence+1 until it either succeeds or sequence >= session.MaxRestRetries -func (s *Session) request(method, urlStr, contentType string, b []byte, bucketID string, sequence int) (response []byte, err error) { - if bucketID == "" { - bucketID = strings.SplitN(urlStr, "?", 2)[0] - } - return s.RequestWithLockedBucket(method, urlStr, contentType, b, s.Ratelimiter.LockBucket(bucketID), sequence) -} - -// RequestWithLockedBucket makes a request using a bucket that's already been locked -func (s *Session) RequestWithLockedBucket(method, urlStr, contentType string, b []byte, bucket *Bucket, sequence int) (response []byte, err error) { - if s.Debug { - log.Printf("API REQUEST %8s :: %s\n", method, urlStr) - log.Printf("API REQUEST PAYLOAD :: [%s]\n", string(b)) - } - - req, err := http.NewRequest(method, urlStr, bytes.NewBuffer(b)) - if err != nil { - bucket.Release(nil) - return - } - - // Not used on initial login.. - // TODO: Verify if a login, otherwise complain about no-token - if s.Token != "" { - req.Header.Set("authorization", s.Token) - } - - req.Header.Set("Content-Type", contentType) - // TODO: Make a configurable static variable. - req.Header.Set("User-Agent", fmt.Sprintf("DiscordBot (https://github.com/bwmarrin/discordgo, v%s)", VERSION)) - - if s.Debug { - for k, v := range req.Header { - log.Printf("API REQUEST HEADER :: [%s] = %+v\n", k, v) - } - } - - resp, err := s.Client.Do(req) - if err != nil { - bucket.Release(nil) - return - } - defer func() { - err2 := resp.Body.Close() - if err2 != nil { - log.Println("error closing resp body") - } - }() - - err = bucket.Release(resp.Header) - if err != nil { - return - } - - response, err = ioutil.ReadAll(resp.Body) - if err != nil { - return - } - - if s.Debug { - - log.Printf("API RESPONSE STATUS :: %s\n", resp.Status) - for k, v := range resp.Header { - log.Printf("API RESPONSE HEADER :: [%s] = %+v\n", k, v) - } - log.Printf("API RESPONSE BODY :: [%s]\n\n\n", response) - } - - switch resp.StatusCode { - - case http.StatusOK: - case http.StatusCreated: - case http.StatusNoContent: - - // TODO check for 401 response, invalidate token if we get one. - - case http.StatusBadGateway: - // Retry sending request if possible - if sequence < s.MaxRestRetries { - - s.log(LogInformational, "%s Failed (%s), Retrying...", urlStr, resp.Status) - response, err = s.RequestWithLockedBucket(method, urlStr, contentType, b, s.Ratelimiter.LockBucketObject(bucket), sequence+1) - } else { - err = fmt.Errorf("Exceeded Max retries HTTP %s, %s", resp.Status, response) - } - - case 429: // TOO MANY REQUESTS - Rate limiting - rl := TooManyRequests{} - err = json.Unmarshal(response, &rl) - if err != nil { - s.log(LogError, "rate limit unmarshal error, %s", err) - return - } - s.log(LogInformational, "Rate Limiting %s, retry in %d", urlStr, rl.RetryAfter) - s.handleEvent(rateLimitEventType, RateLimit{TooManyRequests: &rl, URL: urlStr}) - - time.Sleep(rl.RetryAfter * time.Millisecond) - // we can make the above smarter - // this method can cause longer delays than required - - response, err = s.RequestWithLockedBucket(method, urlStr, contentType, b, s.Ratelimiter.LockBucketObject(bucket), sequence) - - default: // Error condition - err = newRestError(req, resp, response) - } - - return -} - -func unmarshal(data []byte, v interface{}) error { - err := json.Unmarshal(data, v) - if err != nil { - return ErrJSONUnmarshal - } - - return nil -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Sessions -// ------------------------------------------------------------------------------------------------ - -// Login asks the Discord server for an authentication token. -// -// NOTE: While email/pass authentication is supported by DiscordGo it is -// HIGHLY DISCOURAGED by Discord. Please only use email/pass to obtain a token -// and then use that authentication token for all future connections. -// Also, doing any form of automation with a user (non Bot) account may result -// in that account being permanently banned from Discord. -func (s *Session) Login(email, password string) (err error) { - - data := struct { - Email string `json:"email"` - Password string `json:"password"` - }{email, password} - - response, err := s.RequestWithBucketID("POST", EndpointLogin, data, EndpointLogin) - if err != nil { - return - } - - temp := struct { - Token string `json:"token"` - MFA bool `json:"mfa"` - }{} - - err = unmarshal(response, &temp) - if err != nil { - return - } - - s.Token = temp.Token - s.MFA = temp.MFA - return -} - -// Register sends a Register request to Discord, and returns the authentication token -// Note that this account is temporary and should be verified for future use. -// Another option is to save the authentication token external, but this isn't recommended. -func (s *Session) Register(username string) (token string, err error) { - - data := struct { - Username string `json:"username"` - }{username} - - response, err := s.RequestWithBucketID("POST", EndpointRegister, data, EndpointRegister) - if err != nil { - return - } - - temp := struct { - Token string `json:"token"` - }{} - - err = unmarshal(response, &temp) - if err != nil { - return - } - - token = temp.Token - return -} - -// Logout sends a logout request to Discord. -// This does not seem to actually invalidate the token. So you can still -// make API calls even after a Logout. So, it seems almost pointless to -// even use. -func (s *Session) Logout() (err error) { - - // _, err = s.Request("POST", LOGOUT, fmt.Sprintf(`{"token": "%s"}`, s.Token)) - - if s.Token == "" { - return - } - - data := struct { - Token string `json:"token"` - }{s.Token} - - _, err = s.RequestWithBucketID("POST", EndpointLogout, data, EndpointLogout) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Users -// ------------------------------------------------------------------------------------------------ - -// User returns the user details of the given userID -// userID : A user ID or "@me" which is a shortcut of current user ID -func (s *Session) User(userID string) (st *User, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointUser(userID), nil, EndpointUsers) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserAvatar is deprecated. Please use UserAvatarDecode -// userID : A user ID or "@me" which is a shortcut of current user ID -func (s *Session) UserAvatar(userID string) (img image.Image, err error) { - u, err := s.User(userID) - if err != nil { - return - } - img, err = s.UserAvatarDecode(u) - return -} - -// UserAvatarDecode returns an image.Image of a user's Avatar -// user : The user which avatar should be retrieved -func (s *Session) UserAvatarDecode(u *User) (img image.Image, err error) { - body, err := s.RequestWithBucketID("GET", EndpointUserAvatar(u.ID, u.Avatar), nil, EndpointUserAvatar("", "")) - if err != nil { - return - } - - img, _, err = image.Decode(bytes.NewReader(body)) - return -} - -// UserUpdate updates a users settings. -func (s *Session) UserUpdate(email, password, username, avatar, newPassword string) (st *User, err error) { - - // NOTE: Avatar must be either the hash/id of existing Avatar or - // data:image/png;base64,BASE64_STRING_OF_NEW_AVATAR_PNG - // to set a new avatar. - // If left blank, avatar will be set to null/blank - - data := struct { - Email string `json:"email,omitempty"` - Password string `json:"password,omitempty"` - Username string `json:"username,omitempty"` - Avatar string `json:"avatar,omitempty"` - NewPassword string `json:"new_password,omitempty"` - }{email, password, username, avatar, newPassword} - - body, err := s.RequestWithBucketID("PATCH", EndpointUser("@me"), data, EndpointUsers) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserSettings returns the settings for a given user -func (s *Session) UserSettings() (st *Settings, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointUserSettings("@me"), nil, EndpointUserSettings("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserUpdateStatus update the user status -// status : The new status (Actual valid status are 'online','idle','dnd','invisible') -func (s *Session) UserUpdateStatus(status Status) (st *Settings, err error) { - if status == StatusOffline { - err = ErrStatusOffline - return - } - - data := struct { - Status Status `json:"status"` - }{status} - - body, err := s.RequestWithBucketID("PATCH", EndpointUserSettings("@me"), data, EndpointUserSettings("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserChannels returns an array of Channel structures for all private -// channels. -func (s *Session) UserChannels() (st []*Channel, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointUserChannels("@me"), nil, EndpointUserChannels("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserChannelCreate creates a new User (Private) Channel with another User -// recipientID : A user ID for the user to which this channel is opened with. -func (s *Session) UserChannelCreate(recipientID string) (st *Channel, err error) { - - data := struct { - RecipientID string `json:"recipient_id"` - }{recipientID} - - body, err := s.RequestWithBucketID("POST", EndpointUserChannels("@me"), data, EndpointUserChannels("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserGuilds returns an array of UserGuild structures for all guilds. -// limit : The number guilds that can be returned. (max 100) -// beforeID : If provided all guilds returned will be before given ID. -// afterID : If provided all guilds returned will be after given ID. -func (s *Session) UserGuilds(limit int, beforeID, afterID string) (st []*UserGuild, err error) { - - v := url.Values{} - - if limit > 0 { - v.Set("limit", strconv.Itoa(limit)) - } - if afterID != "" { - v.Set("after", afterID) - } - if beforeID != "" { - v.Set("before", beforeID) - } - - uri := EndpointUserGuilds("@me") - - if len(v) > 0 { - uri = fmt.Sprintf("%s?%s", uri, v.Encode()) - } - - body, err := s.RequestWithBucketID("GET", uri, nil, EndpointUserGuilds("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserGuildSettingsEdit Edits the users notification settings for a guild -// guildID : The ID of the guild to edit the settings on -// settings : The settings to update -func (s *Session) UserGuildSettingsEdit(guildID string, settings *UserGuildSettingsEdit) (st *UserGuildSettings, err error) { - - body, err := s.RequestWithBucketID("PATCH", EndpointUserGuildSettings("@me", guildID), settings, EndpointUserGuildSettings("", guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// UserChannelPermissions returns the permission of a user in a channel. -// userID : The ID of the user to calculate permissions for. -// channelID : The ID of the channel to calculate permission for. -// -// NOTE: This function is now deprecated and will be removed in the future. -// Please see the same function inside state.go -func (s *Session) UserChannelPermissions(userID, channelID string) (apermissions int, err error) { - // Try to just get permissions from state. - apermissions, err = s.State.UserChannelPermissions(userID, channelID) - if err == nil { - return - } - - // Otherwise try get as much data from state as possible, falling back to the network. - channel, err := s.State.Channel(channelID) - if err != nil || channel == nil { - channel, err = s.Channel(channelID) - if err != nil { - return - } - } - - guild, err := s.State.Guild(channel.GuildID) - if err != nil || guild == nil { - guild, err = s.Guild(channel.GuildID) - if err != nil { - return - } - } - - if userID == guild.OwnerID { - apermissions = PermissionAll - return - } - - member, err := s.State.Member(guild.ID, userID) - if err != nil || member == nil { - member, err = s.GuildMember(guild.ID, userID) - if err != nil { - return - } - } - - return memberPermissions(guild, channel, member), nil -} - -// Calculates the permissions for a member. -// https://support.discordapp.com/hc/en-us/articles/206141927-How-is-the-permission-hierarchy-structured- -func memberPermissions(guild *Guild, channel *Channel, member *Member) (apermissions int) { - userID := member.User.ID - - if userID == guild.OwnerID { - apermissions = PermissionAll - return - } - - for _, role := range guild.Roles { - if role.ID == guild.ID { - apermissions |= role.Permissions - break - } - } - - for _, role := range guild.Roles { - for _, roleID := range member.Roles { - if role.ID == roleID { - apermissions |= role.Permissions - break - } - } - } - - if apermissions&PermissionAdministrator == PermissionAdministrator { - apermissions |= PermissionAll - } - - // Apply @everyone overrides from the channel. - for _, overwrite := range channel.PermissionOverwrites { - if guild.ID == overwrite.ID { - apermissions &= ^overwrite.Deny - apermissions |= overwrite.Allow - break - } - } - - denies := 0 - allows := 0 - - // Member overwrites can override role overrides, so do two passes - for _, overwrite := range channel.PermissionOverwrites { - for _, roleID := range member.Roles { - if overwrite.Type == "role" && roleID == overwrite.ID { - denies |= overwrite.Deny - allows |= overwrite.Allow - break - } - } - } - - apermissions &= ^denies - apermissions |= allows - - for _, overwrite := range channel.PermissionOverwrites { - if overwrite.Type == "member" && overwrite.ID == userID { - apermissions &= ^overwrite.Deny - apermissions |= overwrite.Allow - break - } - } - - if apermissions&PermissionAdministrator == PermissionAdministrator { - apermissions |= PermissionAllChannel - } - - return apermissions -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Guilds -// ------------------------------------------------------------------------------------------------ - -// Guild returns a Guild structure of a specific Guild. -// guildID : The ID of a Guild -func (s *Session) Guild(guildID string) (st *Guild, err error) { - if s.StateEnabled { - // Attempt to grab the guild from State first. - st, err = s.State.Guild(guildID) - if err == nil { - return - } - } - - body, err := s.RequestWithBucketID("GET", EndpointGuild(guildID), nil, EndpointGuild(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildCreate creates a new Guild -// name : A name for the Guild (2-100 characters) -func (s *Session) GuildCreate(name string) (st *Guild, err error) { - - data := struct { - Name string `json:"name"` - }{name} - - body, err := s.RequestWithBucketID("POST", EndpointGuildCreate, data, EndpointGuildCreate) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildEdit edits a new Guild -// guildID : The ID of a Guild -// g : A GuildParams struct with the values Name, Region and VerificationLevel defined. -func (s *Session) GuildEdit(guildID string, g GuildParams) (st *Guild, err error) { - - // Bounds checking for VerificationLevel, interval: [0, 3] - if g.VerificationLevel != nil { - val := *g.VerificationLevel - if val < 0 || val > 3 { - err = ErrVerificationLevelBounds - return - } - } - - //Bounds checking for regions - if g.Region != "" { - isValid := false - regions, _ := s.VoiceRegions() - for _, r := range regions { - if g.Region == r.ID { - isValid = true - } - } - if !isValid { - var valid []string - for _, r := range regions { - valid = append(valid, r.ID) - } - err = fmt.Errorf("Region not a valid region (%q)", valid) - return - } - } - - body, err := s.RequestWithBucketID("PATCH", EndpointGuild(guildID), g, EndpointGuild(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildDelete deletes a Guild. -// guildID : The ID of a Guild -func (s *Session) GuildDelete(guildID string) (st *Guild, err error) { - - body, err := s.RequestWithBucketID("DELETE", EndpointGuild(guildID), nil, EndpointGuild(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildLeave leaves a Guild. -// guildID : The ID of a Guild -func (s *Session) GuildLeave(guildID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointUserGuild("@me", guildID), nil, EndpointUserGuild("", guildID)) - return -} - -// GuildBans returns an array of User structures for all bans of a -// given guild. -// guildID : The ID of a Guild. -func (s *Session) GuildBans(guildID string) (st []*GuildBan, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointGuildBans(guildID), nil, EndpointGuildBans(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildBanCreate bans the given user from the given guild. -// guildID : The ID of a Guild. -// userID : The ID of a User -// days : The number of days of previous comments to delete. -func (s *Session) GuildBanCreate(guildID, userID string, days int) (err error) { - return s.GuildBanCreateWithReason(guildID, userID, "", days) -} - -// GuildBanCreateWithReason bans the given user from the given guild also providing a reaso. -// guildID : The ID of a Guild. -// userID : The ID of a User -// reason : The reason for this ban -// days : The number of days of previous comments to delete. -func (s *Session) GuildBanCreateWithReason(guildID, userID, reason string, days int) (err error) { - - uri := EndpointGuildBan(guildID, userID) - - queryParams := url.Values{} - if days > 0 { - queryParams.Set("delete-message-days", strconv.Itoa(days)) - } - if reason != "" { - queryParams.Set("reason", reason) - } - - if len(queryParams) > 0 { - uri += "?" + queryParams.Encode() - } - - _, err = s.RequestWithBucketID("PUT", uri, nil, EndpointGuildBan(guildID, "")) - return -} - -// GuildBanDelete removes the given user from the guild bans -// guildID : The ID of a Guild. -// userID : The ID of a User -func (s *Session) GuildBanDelete(guildID, userID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointGuildBan(guildID, userID), nil, EndpointGuildBan(guildID, "")) - return -} - -// GuildMembers returns a list of members for a guild. -// guildID : The ID of a Guild. -// after : The id of the member to return members after -// limit : max number of members to return (max 1000) -func (s *Session) GuildMembers(guildID string, after string, limit int) (st []*Member, err error) { - - uri := EndpointGuildMembers(guildID) - - v := url.Values{} - - if after != "" { - v.Set("after", after) - } - - if limit > 0 { - v.Set("limit", strconv.Itoa(limit)) - } - - if len(v) > 0 { - uri = fmt.Sprintf("%s?%s", uri, v.Encode()) - } - - body, err := s.RequestWithBucketID("GET", uri, nil, EndpointGuildMembers(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildMember returns a member of a guild. -// guildID : The ID of a Guild. -// userID : The ID of a User -func (s *Session) GuildMember(guildID, userID string) (st *Member, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointGuildMember(guildID, userID), nil, EndpointGuildMember(guildID, "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildMemberDelete removes the given user from the given guild. -// guildID : The ID of a Guild. -// userID : The ID of a User -func (s *Session) GuildMemberDelete(guildID, userID string) (err error) { - - return s.GuildMemberDeleteWithReason(guildID, userID, "") -} - -// GuildMemberDeleteWithReason removes the given user from the given guild. -// guildID : The ID of a Guild. -// userID : The ID of a User -// reason : The reason for the kick -func (s *Session) GuildMemberDeleteWithReason(guildID, userID, reason string) (err error) { - - uri := EndpointGuildMember(guildID, userID) - if reason != "" { - uri += "?reason=" + url.QueryEscape(reason) - } - - _, err = s.RequestWithBucketID("DELETE", uri, nil, EndpointGuildMember(guildID, "")) - return -} - -// GuildMemberEdit edits the roles of a member. -// guildID : The ID of a Guild. -// userID : The ID of a User. -// roles : A list of role ID's to set on the member. -func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err error) { - - data := struct { - Roles []string `json:"roles"` - }{roles} - - _, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, "")) - if err != nil { - return - } - - return -} - -// GuildMemberMove moves a guild member from one voice channel to another/none -// guildID : The ID of a Guild. -// userID : The ID of a User. -// channelID : The ID of a channel to move user to, or null? -// NOTE : I am not entirely set on the name of this function and it may change -// prior to the final 1.0.0 release of Discordgo -func (s *Session) GuildMemberMove(guildID, userID, channelID string) (err error) { - - data := struct { - ChannelID string `json:"channel_id"` - }{channelID} - - _, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, "")) - if err != nil { - return - } - - return -} - -// GuildMemberNickname updates the nickname of a guild member -// guildID : The ID of a guild -// userID : The ID of a user -// userID : The ID of a user or "@me" which is a shortcut of the current user ID -func (s *Session) GuildMemberNickname(guildID, userID, nickname string) (err error) { - - data := struct { - Nick string `json:"nick"` - }{nickname} - - if userID == "@me" { - userID += "/nick" - } - - _, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, "")) - return -} - -// GuildMemberRoleAdd adds the specified role to a given member -// guildID : The ID of a Guild. -// userID : The ID of a User. -// roleID : The ID of a Role to be assigned to the user. -func (s *Session) GuildMemberRoleAdd(guildID, userID, roleID string) (err error) { - - _, err = s.RequestWithBucketID("PUT", EndpointGuildMemberRole(guildID, userID, roleID), nil, EndpointGuildMemberRole(guildID, "", "")) - - return -} - -// GuildMemberRoleRemove removes the specified role to a given member -// guildID : The ID of a Guild. -// userID : The ID of a User. -// roleID : The ID of a Role to be removed from the user. -func (s *Session) GuildMemberRoleRemove(guildID, userID, roleID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointGuildMemberRole(guildID, userID, roleID), nil, EndpointGuildMemberRole(guildID, "", "")) - - return -} - -// GuildChannels returns an array of Channel structures for all channels of a -// given guild. -// guildID : The ID of a Guild. -func (s *Session) GuildChannels(guildID string) (st []*Channel, err error) { - - body, err := s.request("GET", EndpointGuildChannels(guildID), "", nil, EndpointGuildChannels(guildID), 0) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildChannelCreate creates a new channel in the given guild -// guildID : The ID of a Guild. -// name : Name of the channel (2-100 chars length) -// ctype : Tpye of the channel (voice or text) -func (s *Session) GuildChannelCreate(guildID, name, ctype string) (st *Channel, err error) { - - data := struct { - Name string `json:"name"` - Type string `json:"type"` - }{name, ctype} - - body, err := s.RequestWithBucketID("POST", EndpointGuildChannels(guildID), data, EndpointGuildChannels(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildChannelsReorder updates the order of channels in a guild -// guildID : The ID of a Guild. -// channels : Updated channels. -func (s *Session) GuildChannelsReorder(guildID string, channels []*Channel) (err error) { - - _, err = s.RequestWithBucketID("PATCH", EndpointGuildChannels(guildID), channels, EndpointGuildChannels(guildID)) - return -} - -// GuildInvites returns an array of Invite structures for the given guild -// guildID : The ID of a Guild. -func (s *Session) GuildInvites(guildID string) (st []*Invite, err error) { - body, err := s.RequestWithBucketID("GET", EndpointGuildInvites(guildID), nil, EndpointGuildInvites(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildRoles returns all roles for a given guild. -// guildID : The ID of a Guild. -func (s *Session) GuildRoles(guildID string) (st []*Role, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointGuildRoles(guildID), nil, EndpointGuildRoles(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return // TODO return pointer -} - -// GuildRoleCreate returns a new Guild Role. -// guildID: The ID of a Guild. -func (s *Session) GuildRoleCreate(guildID string) (st *Role, err error) { - - body, err := s.RequestWithBucketID("POST", EndpointGuildRoles(guildID), nil, EndpointGuildRoles(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildRoleEdit updates an existing Guild Role with new values -// guildID : The ID of a Guild. -// roleID : The ID of a Role. -// name : The name of the Role. -// color : The color of the role (decimal, not hex). -// hoist : Whether to display the role's users separately. -// perm : The permissions for the role. -// mention : Whether this role is mentionable -func (s *Session) GuildRoleEdit(guildID, roleID, name string, color int, hoist bool, perm int, mention bool) (st *Role, err error) { - - // Prevent sending a color int that is too big. - if color > 0xFFFFFF { - err = fmt.Errorf("color value cannot be larger than 0xFFFFFF") - return nil, err - } - - data := struct { - Name string `json:"name"` // The role's name (overwrites existing) - Color int `json:"color"` // The color the role should have (as a decimal, not hex) - Hoist bool `json:"hoist"` // Whether to display the role's users separately - Permissions int `json:"permissions"` // The overall permissions number of the role (overwrites existing) - Mentionable bool `json:"mentionable"` // Whether this role is mentionable - }{name, color, hoist, perm, mention} - - body, err := s.RequestWithBucketID("PATCH", EndpointGuildRole(guildID, roleID), data, EndpointGuildRole(guildID, "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildRoleReorder reoders guild roles -// guildID : The ID of a Guild. -// roles : A list of ordered roles. -func (s *Session) GuildRoleReorder(guildID string, roles []*Role) (st []*Role, err error) { - - body, err := s.RequestWithBucketID("PATCH", EndpointGuildRoles(guildID), roles, EndpointGuildRoles(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildRoleDelete deletes an existing role. -// guildID : The ID of a Guild. -// roleID : The ID of a Role. -func (s *Session) GuildRoleDelete(guildID, roleID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointGuildRole(guildID, roleID), nil, EndpointGuildRole(guildID, "")) - - return -} - -// GuildPruneCount Returns the number of members that would be removed in a prune operation. -// Requires 'KICK_MEMBER' permission. -// guildID : The ID of a Guild. -// days : The number of days to count prune for (1 or more). -func (s *Session) GuildPruneCount(guildID string, days uint32) (count uint32, err error) { - count = 0 - - if days <= 0 { - err = ErrPruneDaysBounds - return - } - - p := struct { - Pruned uint32 `json:"pruned"` - }{} - - uri := EndpointGuildPrune(guildID) + fmt.Sprintf("?days=%d", days) - body, err := s.RequestWithBucketID("GET", uri, nil, EndpointGuildPrune(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &p) - if err != nil { - return - } - - count = p.Pruned - - return -} - -// GuildPrune Begin as prune operation. Requires the 'KICK_MEMBERS' permission. -// Returns an object with one 'pruned' key indicating the number of members that were removed in the prune operation. -// guildID : The ID of a Guild. -// days : The number of days to count prune for (1 or more). -func (s *Session) GuildPrune(guildID string, days uint32) (count uint32, err error) { - - count = 0 - - if days <= 0 { - err = ErrPruneDaysBounds - return - } - - data := struct { - days uint32 - }{days} - - p := struct { - Pruned uint32 `json:"pruned"` - }{} - - body, err := s.RequestWithBucketID("POST", EndpointGuildPrune(guildID), data, EndpointGuildPrune(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &p) - if err != nil { - return - } - - count = p.Pruned - - return -} - -// GuildIntegrations returns an array of Integrations for a guild. -// guildID : The ID of a Guild. -func (s *Session) GuildIntegrations(guildID string) (st []*GuildIntegration, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointGuildIntegrations(guildID), nil, EndpointGuildIntegrations(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildIntegrationCreate creates a Guild Integration. -// guildID : The ID of a Guild. -// integrationType : The Integration type. -// integrationID : The ID of an integration. -func (s *Session) GuildIntegrationCreate(guildID, integrationType, integrationID string) (err error) { - - data := struct { - Type string `json:"type"` - ID string `json:"id"` - }{integrationType, integrationID} - - _, err = s.RequestWithBucketID("POST", EndpointGuildIntegrations(guildID), data, EndpointGuildIntegrations(guildID)) - return -} - -// GuildIntegrationEdit edits a Guild Integration. -// guildID : The ID of a Guild. -// integrationType : The Integration type. -// integrationID : The ID of an integration. -// expireBehavior : The behavior when an integration subscription lapses (see the integration object documentation). -// expireGracePeriod : Period (in seconds) where the integration will ignore lapsed subscriptions. -// enableEmoticons : Whether emoticons should be synced for this integration (twitch only currently). -func (s *Session) GuildIntegrationEdit(guildID, integrationID string, expireBehavior, expireGracePeriod int, enableEmoticons bool) (err error) { - - data := struct { - ExpireBehavior int `json:"expire_behavior"` - ExpireGracePeriod int `json:"expire_grace_period"` - EnableEmoticons bool `json:"enable_emoticons"` - }{expireBehavior, expireGracePeriod, enableEmoticons} - - _, err = s.RequestWithBucketID("PATCH", EndpointGuildIntegration(guildID, integrationID), data, EndpointGuildIntegration(guildID, "")) - return -} - -// GuildIntegrationDelete removes the given integration from the Guild. -// guildID : The ID of a Guild. -// integrationID : The ID of an integration. -func (s *Session) GuildIntegrationDelete(guildID, integrationID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointGuildIntegration(guildID, integrationID), nil, EndpointGuildIntegration(guildID, "")) - return -} - -// GuildIntegrationSync syncs an integration. -// guildID : The ID of a Guild. -// integrationID : The ID of an integration. -func (s *Session) GuildIntegrationSync(guildID, integrationID string) (err error) { - - _, err = s.RequestWithBucketID("POST", EndpointGuildIntegrationSync(guildID, integrationID), nil, EndpointGuildIntegration(guildID, "")) - return -} - -// GuildIcon returns an image.Image of a guild icon. -// guildID : The ID of a Guild. -func (s *Session) GuildIcon(guildID string) (img image.Image, err error) { - g, err := s.Guild(guildID) - if err != nil { - return - } - - if g.Icon == "" { - err = ErrGuildNoIcon - return - } - - body, err := s.RequestWithBucketID("GET", EndpointGuildIcon(guildID, g.Icon), nil, EndpointGuildIcon(guildID, "")) - if err != nil { - return - } - - img, _, err = image.Decode(bytes.NewReader(body)) - return -} - -// GuildSplash returns an image.Image of a guild splash image. -// guildID : The ID of a Guild. -func (s *Session) GuildSplash(guildID string) (img image.Image, err error) { - g, err := s.Guild(guildID) - if err != nil { - return - } - - if g.Splash == "" { - err = ErrGuildNoSplash - return - } - - body, err := s.RequestWithBucketID("GET", EndpointGuildSplash(guildID, g.Splash), nil, EndpointGuildSplash(guildID, "")) - if err != nil { - return - } - - img, _, err = image.Decode(bytes.NewReader(body)) - return -} - -// GuildEmbed returns the embed for a Guild. -// guildID : The ID of a Guild. -func (s *Session) GuildEmbed(guildID string) (st *GuildEmbed, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointGuildEmbed(guildID), nil, EndpointGuildEmbed(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// GuildEmbedEdit returns the embed for a Guild. -// guildID : The ID of a Guild. -func (s *Session) GuildEmbedEdit(guildID string, enabled bool, channelID string) (err error) { - - data := GuildEmbed{enabled, channelID} - - _, err = s.RequestWithBucketID("PATCH", EndpointGuildEmbed(guildID), data, EndpointGuildEmbed(guildID)) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Channels -// ------------------------------------------------------------------------------------------------ - -// Channel returns a Channel structure of a specific Channel. -// channelID : The ID of the Channel you want returned. -func (s *Session) Channel(channelID string) (st *Channel, err error) { - body, err := s.RequestWithBucketID("GET", EndpointChannel(channelID), nil, EndpointChannel(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelEdit edits the given channel -// channelID : The ID of a Channel -// name : The new name to assign the channel. -func (s *Session) ChannelEdit(channelID, name string) (*Channel, error) { - return s.ChannelEditComplex(channelID, &ChannelEdit{ - Name: name, - }) -} - -// ChannelEditComplex edits an existing channel, replacing the parameters entirely with ChannelEdit struct -// channelID : The ID of a Channel -// data : The channel struct to send -func (s *Session) ChannelEditComplex(channelID string, data *ChannelEdit) (st *Channel, err error) { - body, err := s.RequestWithBucketID("PATCH", EndpointChannel(channelID), data, EndpointChannel(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelDelete deletes the given channel -// channelID : The ID of a Channel -func (s *Session) ChannelDelete(channelID string) (st *Channel, err error) { - - body, err := s.RequestWithBucketID("DELETE", EndpointChannel(channelID), nil, EndpointChannel(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelTyping broadcasts to all members that authenticated user is typing in -// the given channel. -// channelID : The ID of a Channel -func (s *Session) ChannelTyping(channelID string) (err error) { - - _, err = s.RequestWithBucketID("POST", EndpointChannelTyping(channelID), nil, EndpointChannelTyping(channelID)) - return -} - -// ChannelMessages returns an array of Message structures for messages within -// a given channel. -// channelID : The ID of a Channel. -// limit : The number messages that can be returned. (max 100) -// beforeID : If provided all messages returned will be before given ID. -// afterID : If provided all messages returned will be after given ID. -// aroundID : If provided all messages returned will be around given ID. -func (s *Session) ChannelMessages(channelID string, limit int, beforeID, afterID, aroundID string) (st []*Message, err error) { - - uri := EndpointChannelMessages(channelID) - - v := url.Values{} - if limit > 0 { - v.Set("limit", strconv.Itoa(limit)) - } - if afterID != "" { - v.Set("after", afterID) - } - if beforeID != "" { - v.Set("before", beforeID) - } - if aroundID != "" { - v.Set("around", aroundID) - } - if len(v) > 0 { - uri = fmt.Sprintf("%s?%s", uri, v.Encode()) - } - - body, err := s.RequestWithBucketID("GET", uri, nil, EndpointChannelMessages(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelMessage gets a single message by ID from a given channel. -// channeld : The ID of a Channel -// messageID : the ID of a Message -func (s *Session) ChannelMessage(channelID, messageID string) (st *Message, err error) { - - response, err := s.RequestWithBucketID("GET", EndpointChannelMessage(channelID, messageID), nil, EndpointChannelMessage(channelID, "")) - if err != nil { - return - } - - err = unmarshal(response, &st) - return -} - -// ChannelMessageAck acknowledges and marks the given message as read -// channeld : The ID of a Channel -// messageID : the ID of a Message -// lastToken : token returned by last ack -func (s *Session) ChannelMessageAck(channelID, messageID, lastToken string) (st *Ack, err error) { - - body, err := s.RequestWithBucketID("POST", EndpointChannelMessageAck(channelID, messageID), &Ack{Token: lastToken}, EndpointChannelMessageAck(channelID, "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelMessageSend sends a message to the given channel. -// channelID : The ID of a Channel. -// content : The message to send. -func (s *Session) ChannelMessageSend(channelID string, content string) (*Message, error) { - return s.ChannelMessageSendComplex(channelID, &MessageSend{ - Content: content, - }) -} - -var quoteEscaper = strings.NewReplacer("\\", "\\\\", `"`, "\\\"") - -// ChannelMessageSendComplex sends a message to the given channel. -// channelID : The ID of a Channel. -// data : The message struct to send. -func (s *Session) ChannelMessageSendComplex(channelID string, data *MessageSend) (st *Message, err error) { - if data.Embed != nil && data.Embed.Type == "" { - data.Embed.Type = "rich" - } - - endpoint := EndpointChannelMessages(channelID) - - // TODO: Remove this when compatibility is not required. - files := data.Files - if data.File != nil { - if files == nil { - files = []*File{data.File} - } else { - err = fmt.Errorf("cannot specify both File and Files") - return - } - } - - var response []byte - if len(files) > 0 { - body := &bytes.Buffer{} - bodywriter := multipart.NewWriter(body) - - var payload []byte - payload, err = json.Marshal(data) - if err != nil { - return - } - - var p io.Writer - - h := make(textproto.MIMEHeader) - h.Set("Content-Disposition", `form-data; name="payload_json"`) - h.Set("Content-Type", "application/json") - - p, err = bodywriter.CreatePart(h) - if err != nil { - return - } - - if _, err = p.Write(payload); err != nil { - return - } - - for i, file := range files { - h := make(textproto.MIMEHeader) - h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file%d"; filename="%s"`, i, quoteEscaper.Replace(file.Name))) - contentType := file.ContentType - if contentType == "" { - contentType = "application/octet-stream" - } - h.Set("Content-Type", contentType) - - p, err = bodywriter.CreatePart(h) - if err != nil { - return - } - - if _, err = io.Copy(p, file.Reader); err != nil { - return - } - } - - err = bodywriter.Close() - if err != nil { - return - } - - response, err = s.request("POST", endpoint, bodywriter.FormDataContentType(), body.Bytes(), endpoint, 0) - } else { - response, err = s.RequestWithBucketID("POST", endpoint, data, endpoint) - } - if err != nil { - return - } - - err = unmarshal(response, &st) - return -} - -// ChannelMessageSendTTS sends a message to the given channel with Text to Speech. -// channelID : The ID of a Channel. -// content : The message to send. -func (s *Session) ChannelMessageSendTTS(channelID string, content string) (*Message, error) { - return s.ChannelMessageSendComplex(channelID, &MessageSend{ - Content: content, - Tts: true, - }) -} - -// ChannelMessageSendEmbed sends a message to the given channel with embedded data. -// channelID : The ID of a Channel. -// embed : The embed data to send. -func (s *Session) ChannelMessageSendEmbed(channelID string, embed *MessageEmbed) (*Message, error) { - return s.ChannelMessageSendComplex(channelID, &MessageSend{ - Embed: embed, - }) -} - -// ChannelMessageEdit edits an existing message, replacing it entirely with -// the given content. -// channelID : The ID of a Channel -// messageID : The ID of a Message -// content : The contents of the message -func (s *Session) ChannelMessageEdit(channelID, messageID, content string) (*Message, error) { - return s.ChannelMessageEditComplex(NewMessageEdit(channelID, messageID).SetContent(content)) -} - -// ChannelMessageEditComplex edits an existing message, replacing it entirely with -// the given MessageEdit struct -func (s *Session) ChannelMessageEditComplex(m *MessageEdit) (st *Message, err error) { - if m.Embed != nil && m.Embed.Type == "" { - m.Embed.Type = "rich" - } - - response, err := s.RequestWithBucketID("PATCH", EndpointChannelMessage(m.Channel, m.ID), m, EndpointChannelMessage(m.Channel, "")) - if err != nil { - return - } - - err = unmarshal(response, &st) - return -} - -// ChannelMessageEditEmbed edits an existing message with embedded data. -// channelID : The ID of a Channel -// messageID : The ID of a Message -// embed : The embed data to send -func (s *Session) ChannelMessageEditEmbed(channelID, messageID string, embed *MessageEmbed) (*Message, error) { - return s.ChannelMessageEditComplex(NewMessageEdit(channelID, messageID).SetEmbed(embed)) -} - -// ChannelMessageDelete deletes a message from the Channel. -func (s *Session) ChannelMessageDelete(channelID, messageID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointChannelMessage(channelID, messageID), nil, EndpointChannelMessage(channelID, "")) - return -} - -// ChannelMessagesBulkDelete bulk deletes the messages from the channel for the provided messageIDs. -// If only one messageID is in the slice call channelMessageDelete function. -// If the slice is empty do nothing. -// channelID : The ID of the channel for the messages to delete. -// messages : The IDs of the messages to be deleted. A slice of string IDs. A maximum of 100 messages. -func (s *Session) ChannelMessagesBulkDelete(channelID string, messages []string) (err error) { - - if len(messages) == 0 { - return - } - - if len(messages) == 1 { - err = s.ChannelMessageDelete(channelID, messages[0]) - return - } - - if len(messages) > 100 { - messages = messages[:100] - } - - data := struct { - Messages []string `json:"messages"` - }{messages} - - _, err = s.RequestWithBucketID("POST", EndpointChannelMessagesBulkDelete(channelID), data, EndpointChannelMessagesBulkDelete(channelID)) - return -} - -// ChannelMessagePin pins a message within a given channel. -// channelID: The ID of a channel. -// messageID: The ID of a message. -func (s *Session) ChannelMessagePin(channelID, messageID string) (err error) { - - _, err = s.RequestWithBucketID("PUT", EndpointChannelMessagePin(channelID, messageID), nil, EndpointChannelMessagePin(channelID, "")) - return -} - -// ChannelMessageUnpin unpins a message within a given channel. -// channelID: The ID of a channel. -// messageID: The ID of a message. -func (s *Session) ChannelMessageUnpin(channelID, messageID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointChannelMessagePin(channelID, messageID), nil, EndpointChannelMessagePin(channelID, "")) - return -} - -// ChannelMessagesPinned returns an array of Message structures for pinned messages -// within a given channel -// channelID : The ID of a Channel. -func (s *Session) ChannelMessagesPinned(channelID string) (st []*Message, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointChannelMessagesPins(channelID), nil, EndpointChannelMessagesPins(channelID)) - - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelFileSend sends a file to the given channel. -// channelID : The ID of a Channel. -// name: The name of the file. -// io.Reader : A reader for the file contents. -func (s *Session) ChannelFileSend(channelID, name string, r io.Reader) (*Message, error) { - return s.ChannelMessageSendComplex(channelID, &MessageSend{File: &File{Name: name, Reader: r}}) -} - -// ChannelFileSendWithMessage sends a file to the given channel with an message. -// DEPRECATED. Use ChannelMessageSendComplex instead. -// channelID : The ID of a Channel. -// content: Optional Message content. -// name: The name of the file. -// io.Reader : A reader for the file contents. -func (s *Session) ChannelFileSendWithMessage(channelID, content string, name string, r io.Reader) (*Message, error) { - return s.ChannelMessageSendComplex(channelID, &MessageSend{File: &File{Name: name, Reader: r}, Content: content}) -} - -// ChannelInvites returns an array of Invite structures for the given channel -// channelID : The ID of a Channel -func (s *Session) ChannelInvites(channelID string) (st []*Invite, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointChannelInvites(channelID), nil, EndpointChannelInvites(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelInviteCreate creates a new invite for the given channel. -// channelID : The ID of a Channel -// i : An Invite struct with the values MaxAge, MaxUses and Temporary defined. -func (s *Session) ChannelInviteCreate(channelID string, i Invite) (st *Invite, err error) { - - data := struct { - MaxAge int `json:"max_age"` - MaxUses int `json:"max_uses"` - Temporary bool `json:"temporary"` - }{i.MaxAge, i.MaxUses, i.Temporary} - - body, err := s.RequestWithBucketID("POST", EndpointChannelInvites(channelID), data, EndpointChannelInvites(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ChannelPermissionSet creates a Permission Override for the given channel. -// NOTE: This func name may changed. Using Set instead of Create because -// you can both create a new override or update an override with this function. -func (s *Session) ChannelPermissionSet(channelID, targetID, targetType string, allow, deny int) (err error) { - - data := struct { - ID string `json:"id"` - Type string `json:"type"` - Allow int `json:"allow"` - Deny int `json:"deny"` - }{targetID, targetType, allow, deny} - - _, err = s.RequestWithBucketID("PUT", EndpointChannelPermission(channelID, targetID), data, EndpointChannelPermission(channelID, "")) - return -} - -// ChannelPermissionDelete deletes a specific permission override for the given channel. -// NOTE: Name of this func may change. -func (s *Session) ChannelPermissionDelete(channelID, targetID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointChannelPermission(channelID, targetID), nil, EndpointChannelPermission(channelID, "")) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Invites -// ------------------------------------------------------------------------------------------------ - -// Invite returns an Invite structure of the given invite -// inviteID : The invite code -func (s *Session) Invite(inviteID string) (st *Invite, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointInvite(inviteID), nil, EndpointInvite("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// InviteDelete deletes an existing invite -// inviteID : the code of an invite -func (s *Session) InviteDelete(inviteID string) (st *Invite, err error) { - - body, err := s.RequestWithBucketID("DELETE", EndpointInvite(inviteID), nil, EndpointInvite("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// InviteAccept accepts an Invite to a Guild or Channel -// inviteID : The invite code -func (s *Session) InviteAccept(inviteID string) (st *Invite, err error) { - - body, err := s.RequestWithBucketID("POST", EndpointInvite(inviteID), nil, EndpointInvite("")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Voice -// ------------------------------------------------------------------------------------------------ - -// VoiceRegions returns the voice server regions -func (s *Session) VoiceRegions() (st []*VoiceRegion, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointVoiceRegions, nil, EndpointVoiceRegions) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// VoiceICE returns the voice server ICE information -func (s *Session) VoiceICE() (st *VoiceICE, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointVoiceIce, nil, EndpointVoiceIce) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Websockets -// ------------------------------------------------------------------------------------------------ - -// Gateway returns the websocket Gateway address -func (s *Session) Gateway() (gateway string, err error) { - - response, err := s.RequestWithBucketID("GET", EndpointGateway, nil, EndpointGateway) - if err != nil { - return - } - - temp := struct { - URL string `json:"url"` - }{} - - err = unmarshal(response, &temp) - if err != nil { - return - } - - gateway = temp.URL - - // Ensure the gateway always has a trailing slash. - // MacOS will fail to connect if we add query params without a trailing slash on the base domain. - if !strings.HasSuffix(gateway, "/") { - gateway += "/" - } - - return -} - -// GatewayBot returns the websocket Gateway address and the recommended number of shards -func (s *Session) GatewayBot() (st *GatewayBotResponse, err error) { - - response, err := s.RequestWithBucketID("GET", EndpointGatewayBot, nil, EndpointGatewayBot) - if err != nil { - return - } - - err = unmarshal(response, &st) - if err != nil { - return - } - - // Ensure the gateway always has a trailing slash. - // MacOS will fail to connect if we add query params without a trailing slash on the base domain. - if !strings.HasSuffix(st.URL, "/") { - st.URL += "/" - } - - return -} - -// Functions specific to Webhooks - -// WebhookCreate returns a new Webhook. -// channelID: The ID of a Channel. -// name : The name of the webhook. -// avatar : The avatar of the webhook. -func (s *Session) WebhookCreate(channelID, name, avatar string) (st *Webhook, err error) { - - data := struct { - Name string `json:"name"` - Avatar string `json:"avatar,omitempty"` - }{name, avatar} - - body, err := s.RequestWithBucketID("POST", EndpointChannelWebhooks(channelID), data, EndpointChannelWebhooks(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// ChannelWebhooks returns all webhooks for a given channel. -// channelID: The ID of a channel. -func (s *Session) ChannelWebhooks(channelID string) (st []*Webhook, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointChannelWebhooks(channelID), nil, EndpointChannelWebhooks(channelID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// GuildWebhooks returns all webhooks for a given guild. -// guildID: The ID of a Guild. -func (s *Session) GuildWebhooks(guildID string) (st []*Webhook, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointGuildWebhooks(guildID), nil, EndpointGuildWebhooks(guildID)) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// Webhook returns a webhook for a given ID -// webhookID: The ID of a webhook. -func (s *Session) Webhook(webhookID string) (st *Webhook, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointWebhook(webhookID), nil, EndpointWebhooks) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// WebhookWithToken returns a webhook for a given ID -// webhookID: The ID of a webhook. -// token : The auth token for the webhook. -func (s *Session) WebhookWithToken(webhookID, token string) (st *Webhook, err error) { - - body, err := s.RequestWithBucketID("GET", EndpointWebhookToken(webhookID, token), nil, EndpointWebhookToken("", "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// WebhookEdit updates an existing Webhook. -// webhookID: The ID of a webhook. -// name : The name of the webhook. -// avatar : The avatar of the webhook. -func (s *Session) WebhookEdit(webhookID, name, avatar string) (st *Role, err error) { - - data := struct { - Name string `json:"name,omitempty"` - Avatar string `json:"avatar,omitempty"` - }{name, avatar} - - body, err := s.RequestWithBucketID("PATCH", EndpointWebhook(webhookID), data, EndpointWebhooks) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// WebhookEditWithToken updates an existing Webhook with an auth token. -// webhookID: The ID of a webhook. -// token : The auth token for the webhook. -// name : The name of the webhook. -// avatar : The avatar of the webhook. -func (s *Session) WebhookEditWithToken(webhookID, token, name, avatar string) (st *Role, err error) { - - data := struct { - Name string `json:"name,omitempty"` - Avatar string `json:"avatar,omitempty"` - }{name, avatar} - - body, err := s.RequestWithBucketID("PATCH", EndpointWebhookToken(webhookID, token), data, EndpointWebhookToken("", "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// WebhookDelete deletes a webhook for a given ID -// webhookID: The ID of a webhook. -func (s *Session) WebhookDelete(webhookID string) (err error) { - - _, err = s.RequestWithBucketID("DELETE", EndpointWebhook(webhookID), nil, EndpointWebhooks) - - return -} - -// WebhookDeleteWithToken deletes a webhook for a given ID with an auth token. -// webhookID: The ID of a webhook. -// token : The auth token for the webhook. -func (s *Session) WebhookDeleteWithToken(webhookID, token string) (st *Webhook, err error) { - - body, err := s.RequestWithBucketID("DELETE", EndpointWebhookToken(webhookID, token), nil, EndpointWebhookToken("", "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - - return -} - -// WebhookExecute executes a webhook. -// webhookID: The ID of a webhook. -// token : The auth token for the webhook -func (s *Session) WebhookExecute(webhookID, token string, wait bool, data *WebhookParams) (err error) { - uri := EndpointWebhookToken(webhookID, token) - - if wait { - uri += "?wait=true" - } - - _, err = s.RequestWithBucketID("POST", uri, data, EndpointWebhookToken("", "")) - - return -} - -// MessageReactionAdd creates an emoji reaction to a message. -// channelID : The channel ID. -// messageID : The message ID. -// emojiID : Either the unicode emoji for the reaction, or a guild emoji identifier. -func (s *Session) MessageReactionAdd(channelID, messageID, emojiID string) error { - - _, err := s.RequestWithBucketID("PUT", EndpointMessageReaction(channelID, messageID, emojiID, "@me"), nil, EndpointMessageReaction(channelID, "", "", "")) - - return err -} - -// MessageReactionRemove deletes an emoji reaction to a message. -// channelID : The channel ID. -// messageID : The message ID. -// emojiID : Either the unicode emoji for the reaction, or a guild emoji identifier. -// userID : @me or ID of the user to delete the reaction for. -func (s *Session) MessageReactionRemove(channelID, messageID, emojiID, userID string) error { - - _, err := s.RequestWithBucketID("DELETE", EndpointMessageReaction(channelID, messageID, emojiID, userID), nil, EndpointMessageReaction(channelID, "", "", "")) - - return err -} - -// MessageReactionsRemoveAll deletes all reactions from a message -// channelID : The channel ID -// messageID : The message ID. -func (s *Session) MessageReactionsRemoveAll(channelID, messageID string) error { - - _, err := s.RequestWithBucketID("DELETE", EndpointMessageReactionsAll(channelID, messageID), nil, EndpointMessageReactionsAll(channelID, messageID)) - - return err -} - -// MessageReactions gets all the users reactions for a specific emoji. -// channelID : The channel ID. -// messageID : The message ID. -// emojiID : Either the unicode emoji for the reaction, or a guild emoji identifier. -// limit : max number of users to return (max 100) -func (s *Session) MessageReactions(channelID, messageID, emojiID string, limit int) (st []*User, err error) { - uri := EndpointMessageReactions(channelID, messageID, emojiID) - - v := url.Values{} - - if limit > 0 { - v.Set("limit", strconv.Itoa(limit)) - } - - if len(v) > 0 { - uri = fmt.Sprintf("%s?%s", uri, v.Encode()) - } - - body, err := s.RequestWithBucketID("GET", uri, nil, EndpointMessageReaction(channelID, "", "", "")) - if err != nil { - return - } - - err = unmarshal(body, &st) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to user notes -// ------------------------------------------------------------------------------------------------ - -// UserNoteSet sets the note for a specific user. -func (s *Session) UserNoteSet(userID string, message string) (err error) { - data := struct { - Note string `json:"note"` - }{message} - - _, err = s.RequestWithBucketID("PUT", EndpointUserNotes(userID), data, EndpointUserNotes("")) - return -} - -// ------------------------------------------------------------------------------------------------ -// Functions specific to Discord Relationships (Friends list) -// ------------------------------------------------------------------------------------------------ - -// RelationshipsGet returns an array of all the relationships of the user. -func (s *Session) RelationshipsGet() (r []*Relationship, err error) { - body, err := s.RequestWithBucketID("GET", EndpointRelationships(), nil, EndpointRelationships()) - if err != nil { - return - } - - err = unmarshal(body, &r) - return -} - -// relationshipCreate creates a new relationship. (I.e. send or accept a friend request, block a user.) -// relationshipType : 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req -func (s *Session) relationshipCreate(userID string, relationshipType int) (err error) { - data := struct { - Type int `json:"type"` - }{relationshipType} - - _, err = s.RequestWithBucketID("PUT", EndpointRelationship(userID), data, EndpointRelationships()) - return -} - -// RelationshipFriendRequestSend sends a friend request to a user. -// userID: ID of the user. -func (s *Session) RelationshipFriendRequestSend(userID string) (err error) { - err = s.relationshipCreate(userID, 4) - return -} - -// RelationshipFriendRequestAccept accepts a friend request from a user. -// userID: ID of the user. -func (s *Session) RelationshipFriendRequestAccept(userID string) (err error) { - err = s.relationshipCreate(userID, 1) - return -} - -// RelationshipUserBlock blocks a user. -// userID: ID of the user. -func (s *Session) RelationshipUserBlock(userID string) (err error) { - err = s.relationshipCreate(userID, 2) - return -} - -// RelationshipDelete removes the relationship with a user. -// userID: ID of the user. -func (s *Session) RelationshipDelete(userID string) (err error) { - _, err = s.RequestWithBucketID("DELETE", EndpointRelationship(userID), nil, EndpointRelationships()) - return -} - -// RelationshipsMutualGet returns an array of all the users both @me and the given user is friends with. -// userID: ID of the user. -func (s *Session) RelationshipsMutualGet(userID string) (mf []*User, err error) { - body, err := s.RequestWithBucketID("GET", EndpointRelationshipsMutual(userID), nil, EndpointRelationshipsMutual(userID)) - if err != nil { - return - } - - err = unmarshal(body, &mf) - return -} diff --git a/vendor/github.com/bwmarrin/discordgo/state.go b/vendor/github.com/bwmarrin/discordgo/state.go deleted file mode 100644 index 8158708b..00000000 --- a/vendor/github.com/bwmarrin/discordgo/state.go +++ /dev/null @@ -1,990 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains code related to state tracking. If enabled, state -// tracking will capture the initial READY packet and many other websocket -// events and maintain an in-memory state of of guilds, channels, users, and -// so forth. This information can be accessed through the Session.State struct. - -package discordgo - -import ( - "errors" - "sort" - "sync" -) - -// ErrNilState is returned when the state is nil. -var ErrNilState = errors.New("state not instantiated, please use discordgo.New() or assign Session.State") - -// ErrStateNotFound is returned when the state cache -// requested is not found -var ErrStateNotFound = errors.New("state cache not found") - -// A State contains the current known state. -// As discord sends this in a READY blob, it seems reasonable to simply -// use that struct as the data store. -type State struct { - sync.RWMutex - Ready - - MaxMessageCount int - TrackChannels bool - TrackEmojis bool - TrackMembers bool - TrackRoles bool - TrackVoice bool - TrackPresences bool - - guildMap map[string]*Guild - channelMap map[string]*Channel - memberMap map[string]map[string]*Member -} - -// NewState creates an empty state. -func NewState() *State { - return &State{ - Ready: Ready{ - PrivateChannels: []*Channel{}, - Guilds: []*Guild{}, - }, - TrackChannels: true, - TrackEmojis: true, - TrackMembers: true, - TrackRoles: true, - TrackVoice: true, - TrackPresences: true, - guildMap: make(map[string]*Guild), - channelMap: make(map[string]*Channel), - memberMap: make(map[string]map[string]*Member), - } -} - -func (s *State) createMemberMap(guild *Guild) { - members := make(map[string]*Member) - for _, m := range guild.Members { - members[m.User.ID] = m - } - s.memberMap[guild.ID] = members -} - -// GuildAdd adds a guild to the current world state, or -// updates it if it already exists. -func (s *State) GuildAdd(guild *Guild) error { - if s == nil { - return ErrNilState - } - - s.Lock() - defer s.Unlock() - - // Update the channels to point to the right guild, adding them to the channelMap as we go - for _, c := range guild.Channels { - s.channelMap[c.ID] = c - } - - // If this guild contains a new member slice, we must regenerate the member map so the pointers stay valid - if guild.Members != nil { - s.createMemberMap(guild) - } else if _, ok := s.memberMap[guild.ID]; !ok { - // Even if we have no new member slice, we still initialize the member map for this guild if it doesn't exist - s.memberMap[guild.ID] = make(map[string]*Member) - } - - if g, ok := s.guildMap[guild.ID]; ok { - // We are about to replace `g` in the state with `guild`, but first we need to - // make sure we preserve any fields that the `guild` doesn't contain from `g`. - if guild.Roles == nil { - guild.Roles = g.Roles - } - if guild.Emojis == nil { - guild.Emojis = g.Emojis - } - if guild.Members == nil { - guild.Members = g.Members - } - if guild.Presences == nil { - guild.Presences = g.Presences - } - if guild.Channels == nil { - guild.Channels = g.Channels - } - if guild.VoiceStates == nil { - guild.VoiceStates = g.VoiceStates - } - *g = *guild - return nil - } - - s.Guilds = append(s.Guilds, guild) - s.guildMap[guild.ID] = guild - - return nil -} - -// GuildRemove removes a guild from current world state. -func (s *State) GuildRemove(guild *Guild) error { - if s == nil { - return ErrNilState - } - - _, err := s.Guild(guild.ID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - delete(s.guildMap, guild.ID) - - for i, g := range s.Guilds { - if g.ID == guild.ID { - s.Guilds = append(s.Guilds[:i], s.Guilds[i+1:]...) - return nil - } - } - - return nil -} - -// Guild gets a guild by ID. -// Useful for querying if @me is in a guild: -// _, err := discordgo.Session.State.Guild(guildID) -// isInGuild := err == nil -func (s *State) Guild(guildID string) (*Guild, error) { - if s == nil { - return nil, ErrNilState - } - - s.RLock() - defer s.RUnlock() - - if g, ok := s.guildMap[guildID]; ok { - return g, nil - } - - return nil, ErrStateNotFound -} - -// PresenceAdd adds a presence to the current world state, or -// updates it if it already exists. -func (s *State) PresenceAdd(guildID string, presence *Presence) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, p := range guild.Presences { - if p.User.ID == presence.User.ID { - //guild.Presences[i] = presence - - //Update status - guild.Presences[i].Game = presence.Game - guild.Presences[i].Roles = presence.Roles - if presence.Status != "" { - guild.Presences[i].Status = presence.Status - } - if presence.Nick != "" { - guild.Presences[i].Nick = presence.Nick - } - - //Update the optionally sent user information - //ID Is a mandatory field so you should not need to check if it is empty - guild.Presences[i].User.ID = presence.User.ID - - if presence.User.Avatar != "" { - guild.Presences[i].User.Avatar = presence.User.Avatar - } - if presence.User.Discriminator != "" { - guild.Presences[i].User.Discriminator = presence.User.Discriminator - } - if presence.User.Email != "" { - guild.Presences[i].User.Email = presence.User.Email - } - if presence.User.Token != "" { - guild.Presences[i].User.Token = presence.User.Token - } - if presence.User.Username != "" { - guild.Presences[i].User.Username = presence.User.Username - } - - return nil - } - } - - guild.Presences = append(guild.Presences, presence) - return nil -} - -// PresenceRemove removes a presence from the current world state. -func (s *State) PresenceRemove(guildID string, presence *Presence) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, p := range guild.Presences { - if p.User.ID == presence.User.ID { - guild.Presences = append(guild.Presences[:i], guild.Presences[i+1:]...) - return nil - } - } - - return ErrStateNotFound -} - -// Presence gets a presence by ID from a guild. -func (s *State) Presence(guildID, userID string) (*Presence, error) { - if s == nil { - return nil, ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return nil, err - } - - for _, p := range guild.Presences { - if p.User.ID == userID { - return p, nil - } - } - - return nil, ErrStateNotFound -} - -// TODO: Consider moving Guild state update methods onto *Guild. - -// MemberAdd adds a member to the current world state, or -// updates it if it already exists. -func (s *State) MemberAdd(member *Member) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(member.GuildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - members, ok := s.memberMap[member.GuildID] - if !ok { - return ErrStateNotFound - } - - m, ok := members[member.User.ID] - if !ok { - members[member.User.ID] = member - guild.Members = append(guild.Members, member) - } else { - *m = *member // Update the actual data, which will also update the member pointer in the slice - } - - return nil -} - -// MemberRemove removes a member from current world state. -func (s *State) MemberRemove(member *Member) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(member.GuildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - members, ok := s.memberMap[member.GuildID] - if !ok { - return ErrStateNotFound - } - - _, ok = members[member.User.ID] - if !ok { - return ErrStateNotFound - } - delete(members, member.User.ID) - - for i, m := range guild.Members { - if m.User.ID == member.User.ID { - guild.Members = append(guild.Members[:i], guild.Members[i+1:]...) - return nil - } - } - - return ErrStateNotFound -} - -// Member gets a member by ID from a guild. -func (s *State) Member(guildID, userID string) (*Member, error) { - if s == nil { - return nil, ErrNilState - } - - s.RLock() - defer s.RUnlock() - - members, ok := s.memberMap[guildID] - if !ok { - return nil, ErrStateNotFound - } - - m, ok := members[userID] - if ok { - return m, nil - } - - return nil, ErrStateNotFound -} - -// RoleAdd adds a role to the current world state, or -// updates it if it already exists. -func (s *State) RoleAdd(guildID string, role *Role) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, r := range guild.Roles { - if r.ID == role.ID { - guild.Roles[i] = role - return nil - } - } - - guild.Roles = append(guild.Roles, role) - return nil -} - -// RoleRemove removes a role from current world state by ID. -func (s *State) RoleRemove(guildID, roleID string) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, r := range guild.Roles { - if r.ID == roleID { - guild.Roles = append(guild.Roles[:i], guild.Roles[i+1:]...) - return nil - } - } - - return ErrStateNotFound -} - -// Role gets a role by ID from a guild. -func (s *State) Role(guildID, roleID string) (*Role, error) { - if s == nil { - return nil, ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return nil, err - } - - s.RLock() - defer s.RUnlock() - - for _, r := range guild.Roles { - if r.ID == roleID { - return r, nil - } - } - - return nil, ErrStateNotFound -} - -// ChannelAdd adds a channel to the current world state, or -// updates it if it already exists. -// Channels may exist either as PrivateChannels or inside -// a guild. -func (s *State) ChannelAdd(channel *Channel) error { - if s == nil { - return ErrNilState - } - - s.Lock() - defer s.Unlock() - - // If the channel exists, replace it - if c, ok := s.channelMap[channel.ID]; ok { - if channel.Messages == nil { - channel.Messages = c.Messages - } - if channel.PermissionOverwrites == nil { - channel.PermissionOverwrites = c.PermissionOverwrites - } - - *c = *channel - return nil - } - - if channel.Type == ChannelTypeDM || channel.Type == ChannelTypeGroupDM { - s.PrivateChannels = append(s.PrivateChannels, channel) - } else { - guild, ok := s.guildMap[channel.GuildID] - if !ok { - return ErrStateNotFound - } - - guild.Channels = append(guild.Channels, channel) - } - - s.channelMap[channel.ID] = channel - - return nil -} - -// ChannelRemove removes a channel from current world state. -func (s *State) ChannelRemove(channel *Channel) error { - if s == nil { - return ErrNilState - } - - _, err := s.Channel(channel.ID) - if err != nil { - return err - } - - if channel.Type == ChannelTypeDM || channel.Type == ChannelTypeGroupDM { - s.Lock() - defer s.Unlock() - - for i, c := range s.PrivateChannels { - if c.ID == channel.ID { - s.PrivateChannels = append(s.PrivateChannels[:i], s.PrivateChannels[i+1:]...) - break - } - } - } else { - guild, err := s.Guild(channel.GuildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, c := range guild.Channels { - if c.ID == channel.ID { - guild.Channels = append(guild.Channels[:i], guild.Channels[i+1:]...) - break - } - } - } - - delete(s.channelMap, channel.ID) - - return nil -} - -// GuildChannel gets a channel by ID from a guild. -// This method is Deprecated, use Channel(channelID) -func (s *State) GuildChannel(guildID, channelID string) (*Channel, error) { - return s.Channel(channelID) -} - -// PrivateChannel gets a private channel by ID. -// This method is Deprecated, use Channel(channelID) -func (s *State) PrivateChannel(channelID string) (*Channel, error) { - return s.Channel(channelID) -} - -// Channel gets a channel by ID, it will look in all guilds and private channels. -func (s *State) Channel(channelID string) (*Channel, error) { - if s == nil { - return nil, ErrNilState - } - - s.RLock() - defer s.RUnlock() - - if c, ok := s.channelMap[channelID]; ok { - return c, nil - } - - return nil, ErrStateNotFound -} - -// Emoji returns an emoji for a guild and emoji id. -func (s *State) Emoji(guildID, emojiID string) (*Emoji, error) { - if s == nil { - return nil, ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return nil, err - } - - s.RLock() - defer s.RUnlock() - - for _, e := range guild.Emojis { - if e.ID == emojiID { - return e, nil - } - } - - return nil, ErrStateNotFound -} - -// EmojiAdd adds an emoji to the current world state. -func (s *State) EmojiAdd(guildID string, emoji *Emoji) error { - if s == nil { - return ErrNilState - } - - guild, err := s.Guild(guildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, e := range guild.Emojis { - if e.ID == emoji.ID { - guild.Emojis[i] = emoji - return nil - } - } - - guild.Emojis = append(guild.Emojis, emoji) - return nil -} - -// EmojisAdd adds multiple emojis to the world state. -func (s *State) EmojisAdd(guildID string, emojis []*Emoji) error { - for _, e := range emojis { - if err := s.EmojiAdd(guildID, e); err != nil { - return err - } - } - return nil -} - -// MessageAdd adds a message to the current world state, or updates it if it exists. -// If the channel cannot be found, the message is discarded. -// Messages are kept in state up to s.MaxMessageCount -func (s *State) MessageAdd(message *Message) error { - if s == nil { - return ErrNilState - } - - c, err := s.Channel(message.ChannelID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - // If the message exists, merge in the new message contents. - for _, m := range c.Messages { - if m.ID == message.ID { - if message.Content != "" { - m.Content = message.Content - } - if message.EditedTimestamp != "" { - m.EditedTimestamp = message.EditedTimestamp - } - if message.Mentions != nil { - m.Mentions = message.Mentions - } - if message.Embeds != nil { - m.Embeds = message.Embeds - } - if message.Attachments != nil { - m.Attachments = message.Attachments - } - if message.Timestamp != "" { - m.Timestamp = message.Timestamp - } - if message.Author != nil { - m.Author = message.Author - } - - return nil - } - } - - c.Messages = append(c.Messages, message) - - if len(c.Messages) > s.MaxMessageCount { - c.Messages = c.Messages[len(c.Messages)-s.MaxMessageCount:] - } - return nil -} - -// MessageRemove removes a message from the world state. -func (s *State) MessageRemove(message *Message) error { - if s == nil { - return ErrNilState - } - - return s.messageRemoveByID(message.ChannelID, message.ID) -} - -// messageRemoveByID removes a message by channelID and messageID from the world state. -func (s *State) messageRemoveByID(channelID, messageID string) error { - c, err := s.Channel(channelID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - for i, m := range c.Messages { - if m.ID == messageID { - c.Messages = append(c.Messages[:i], c.Messages[i+1:]...) - return nil - } - } - - return ErrStateNotFound -} - -func (s *State) voiceStateUpdate(update *VoiceStateUpdate) error { - guild, err := s.Guild(update.GuildID) - if err != nil { - return err - } - - s.Lock() - defer s.Unlock() - - // Handle Leaving Channel - if update.ChannelID == "" { - for i, state := range guild.VoiceStates { - if state.UserID == update.UserID { - guild.VoiceStates = append(guild.VoiceStates[:i], guild.VoiceStates[i+1:]...) - return nil - } - } - } else { - for i, state := range guild.VoiceStates { - if state.UserID == update.UserID { - guild.VoiceStates[i] = update.VoiceState - return nil - } - } - - guild.VoiceStates = append(guild.VoiceStates, update.VoiceState) - } - - return nil -} - -// Message gets a message by channel and message ID. -func (s *State) Message(channelID, messageID string) (*Message, error) { - if s == nil { - return nil, ErrNilState - } - - c, err := s.Channel(channelID) - if err != nil { - return nil, err - } - - s.RLock() - defer s.RUnlock() - - for _, m := range c.Messages { - if m.ID == messageID { - return m, nil - } - } - - return nil, ErrStateNotFound -} - -// OnReady takes a Ready event and updates all internal state. -func (s *State) onReady(se *Session, r *Ready) (err error) { - if s == nil { - return ErrNilState - } - - s.Lock() - defer s.Unlock() - - // We must track at least the current user for Voice, even - // if state is disabled, store the bare essentials. - if !se.StateEnabled { - ready := Ready{ - Version: r.Version, - SessionID: r.SessionID, - User: r.User, - } - - s.Ready = ready - - return nil - } - - s.Ready = *r - - for _, g := range s.Guilds { - s.guildMap[g.ID] = g - s.createMemberMap(g) - - for _, c := range g.Channels { - s.channelMap[c.ID] = c - } - } - - for _, c := range s.PrivateChannels { - s.channelMap[c.ID] = c - } - - return nil -} - -// OnInterface handles all events related to states. -func (s *State) OnInterface(se *Session, i interface{}) (err error) { - if s == nil { - return ErrNilState - } - - r, ok := i.(*Ready) - if ok { - return s.onReady(se, r) - } - - if !se.StateEnabled { - return nil - } - - switch t := i.(type) { - case *GuildCreate: - err = s.GuildAdd(t.Guild) - case *GuildUpdate: - err = s.GuildAdd(t.Guild) - case *GuildDelete: - err = s.GuildRemove(t.Guild) - case *GuildMemberAdd: - if s.TrackMembers { - err = s.MemberAdd(t.Member) - } - case *GuildMemberUpdate: - if s.TrackMembers { - err = s.MemberAdd(t.Member) - } - case *GuildMemberRemove: - if s.TrackMembers { - err = s.MemberRemove(t.Member) - } - case *GuildMembersChunk: - if s.TrackMembers { - for i := range t.Members { - t.Members[i].GuildID = t.GuildID - err = s.MemberAdd(t.Members[i]) - } - } - case *GuildRoleCreate: - if s.TrackRoles { - err = s.RoleAdd(t.GuildID, t.Role) - } - case *GuildRoleUpdate: - if s.TrackRoles { - err = s.RoleAdd(t.GuildID, t.Role) - } - case *GuildRoleDelete: - if s.TrackRoles { - err = s.RoleRemove(t.GuildID, t.RoleID) - } - case *GuildEmojisUpdate: - if s.TrackEmojis { - err = s.EmojisAdd(t.GuildID, t.Emojis) - } - case *ChannelCreate: - if s.TrackChannels { - err = s.ChannelAdd(t.Channel) - } - case *ChannelUpdate: - if s.TrackChannels { - err = s.ChannelAdd(t.Channel) - } - case *ChannelDelete: - if s.TrackChannels { - err = s.ChannelRemove(t.Channel) - } - case *MessageCreate: - if s.MaxMessageCount != 0 { - err = s.MessageAdd(t.Message) - } - case *MessageUpdate: - if s.MaxMessageCount != 0 { - err = s.MessageAdd(t.Message) - } - case *MessageDelete: - if s.MaxMessageCount != 0 { - err = s.MessageRemove(t.Message) - } - case *MessageDeleteBulk: - if s.MaxMessageCount != 0 { - for _, mID := range t.Messages { - s.messageRemoveByID(t.ChannelID, mID) - } - } - case *VoiceStateUpdate: - if s.TrackVoice { - err = s.voiceStateUpdate(t) - } - case *PresenceUpdate: - if s.TrackPresences { - s.PresenceAdd(t.GuildID, &t.Presence) - } - if s.TrackMembers { - if t.Status == StatusOffline { - return - } - - var m *Member - m, err = s.Member(t.GuildID, t.User.ID) - - if err != nil { - // Member not found; this is a user coming online - m = &Member{ - GuildID: t.GuildID, - Nick: t.Nick, - User: t.User, - Roles: t.Roles, - } - - } else { - - if t.Nick != "" { - m.Nick = t.Nick - } - - if t.User.Username != "" { - m.User.Username = t.User.Username - } - - // PresenceUpdates always contain a list of roles, so there's no need to check for an empty list here - m.Roles = t.Roles - - } - - err = s.MemberAdd(m) - } - - } - - return -} - -// UserChannelPermissions returns the permission of a user in a channel. -// userID : The ID of the user to calculate permissions for. -// channelID : The ID of the channel to calculate permission for. -func (s *State) UserChannelPermissions(userID, channelID string) (apermissions int, err error) { - if s == nil { - return 0, ErrNilState - } - - channel, err := s.Channel(channelID) - if err != nil { - return - } - - guild, err := s.Guild(channel.GuildID) - if err != nil { - return - } - - if userID == guild.OwnerID { - apermissions = PermissionAll - return - } - - member, err := s.Member(guild.ID, userID) - if err != nil { - return - } - - return memberPermissions(guild, channel, member), nil -} - -// UserColor returns the color of a user in a channel. -// While colors are defined at a Guild level, determining for a channel is more useful in message handlers. -// 0 is returned in cases of error, which is the color of @everyone. -// userID : The ID of the user to calculate the color for. -// channelID : The ID of the channel to calculate the color for. -func (s *State) UserColor(userID, channelID string) int { - if s == nil { - return 0 - } - - channel, err := s.Channel(channelID) - if err != nil { - return 0 - } - - guild, err := s.Guild(channel.GuildID) - if err != nil { - return 0 - } - - member, err := s.Member(guild.ID, userID) - if err != nil { - return 0 - } - - roles := Roles(guild.Roles) - sort.Sort(roles) - - for _, role := range roles { - for _, roleID := range member.Roles { - if role.ID == roleID { - if role.Color != 0 { - return role.Color - } - } - } - } - - return 0 -} diff --git a/vendor/github.com/bwmarrin/discordgo/structs.go b/vendor/github.com/bwmarrin/discordgo/structs.go deleted file mode 100644 index 19d2bad7..00000000 --- a/vendor/github.com/bwmarrin/discordgo/structs.go +++ /dev/null @@ -1,686 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains all structures for the discordgo package. These -// may be moved about later into separate files but I find it easier to have -// them all located together. - -package discordgo - -import ( - "encoding/json" - "net/http" - "sync" - "time" - - "github.com/gorilla/websocket" -) - -// A Session represents a connection to the Discord API. -type Session struct { - sync.RWMutex - - // General configurable settings. - - // Authentication token for this session - Token string - MFA bool - - // Debug for printing JSON request/responses - Debug bool // Deprecated, will be removed. - LogLevel int - - // Should the session reconnect the websocket on errors. - ShouldReconnectOnError bool - - // Should the session request compressed websocket data. - Compress bool - - // Sharding - ShardID int - ShardCount int - - // Should state tracking be enabled. - // State tracking is the best way for getting the the users - // active guilds and the members of the guilds. - StateEnabled bool - - // Whether or not to call event handlers synchronously. - // e.g false = launch event handlers in their own goroutines. - SyncEvents bool - - // Exposed but should not be modified by User. - - // Whether the Data Websocket is ready - DataReady bool // NOTE: Maye be deprecated soon - - // Max number of REST API retries - MaxRestRetries int - - // Status stores the currect status of the websocket connection - // this is being tested, may stay, may go away. - status int32 - - // Whether the Voice Websocket is ready - VoiceReady bool // NOTE: Deprecated. - - // Whether the UDP Connection is ready - UDPReady bool // NOTE: Deprecated - - // Stores a mapping of guild id's to VoiceConnections - VoiceConnections map[string]*VoiceConnection - - // Managed state object, updated internally with events when - // StateEnabled is true. - State *State - - // The http client used for REST requests - Client *http.Client - - // Stores the last HeartbeatAck that was recieved (in UTC) - LastHeartbeatAck time.Time - - // used to deal with rate limits - Ratelimiter *RateLimiter - - // Event handlers - handlersMu sync.RWMutex - handlers map[string][]*eventHandlerInstance - onceHandlers map[string][]*eventHandlerInstance - - // The websocket connection. - wsConn *websocket.Conn - - // When nil, the session is not listening. - listening chan interface{} - - // sequence tracks the current gateway api websocket sequence number - sequence *int64 - - // stores sessions current Discord Gateway - gateway string - - // stores session ID of current Gateway connection - sessionID string - - // used to make sure gateway websocket writes do not happen concurrently - wsMutex sync.Mutex -} - -// A VoiceRegion stores data for a specific voice region server. -type VoiceRegion struct { - ID string `json:"id"` - Name string `json:"name"` - Hostname string `json:"sample_hostname"` - Port int `json:"sample_port"` -} - -// A VoiceICE stores data for voice ICE servers. -type VoiceICE struct { - TTL string `json:"ttl"` - Servers []*ICEServer `json:"servers"` -} - -// A ICEServer stores data for a specific voice ICE server. -type ICEServer struct { - URL string `json:"url"` - Username string `json:"username"` - Credential string `json:"credential"` -} - -// A Invite stores all data related to a specific Discord Guild or Channel invite. -type Invite struct { - Guild *Guild `json:"guild"` - Channel *Channel `json:"channel"` - Inviter *User `json:"inviter"` - Code string `json:"code"` - CreatedAt Timestamp `json:"created_at"` - MaxAge int `json:"max_age"` - Uses int `json:"uses"` - MaxUses int `json:"max_uses"` - Revoked bool `json:"revoked"` - Temporary bool `json:"temporary"` - Unique bool `json:"unique"` -} - -// ChannelType is the type of a Channel -type ChannelType int - -// Block contains known ChannelType values -const ( - ChannelTypeGuildText ChannelType = iota - ChannelTypeDM - ChannelTypeGuildVoice - ChannelTypeGroupDM - ChannelTypeGuildCategory -) - -// A Channel holds all data related to an individual Discord channel. -type Channel struct { - ID string `json:"id"` - GuildID string `json:"guild_id"` - Name string `json:"name"` - Topic string `json:"topic"` - Type ChannelType `json:"type"` - LastMessageID string `json:"last_message_id"` - NSFW bool `json:"nsfw"` - Position int `json:"position"` - Bitrate int `json:"bitrate"` - Recipients []*User `json:"recipients"` - Messages []*Message `json:"-"` - PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"` - ParentID string `json:"parent_id"` -} - -// A ChannelEdit holds Channel Feild data for a channel edit. -type ChannelEdit struct { - Name string `json:"name,omitempty"` - Topic string `json:"topic,omitempty"` - NSFW bool `json:"nsfw,omitempty"` - Position int `json:"position"` - Bitrate int `json:"bitrate,omitempty"` - UserLimit int `json:"user_limit,omitempty"` - PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites,omitempty"` - ParentID string `json:"parent_id,omitempty"` -} - -// A PermissionOverwrite holds permission overwrite data for a Channel -type PermissionOverwrite struct { - ID string `json:"id"` - Type string `json:"type"` - Deny int `json:"deny"` - Allow int `json:"allow"` -} - -// Emoji struct holds data related to Emoji's -type Emoji struct { - ID string `json:"id"` - Name string `json:"name"` - Roles []string `json:"roles"` - Managed bool `json:"managed"` - RequireColons bool `json:"require_colons"` - Animated bool `json:"animated"` -} - -// APIName returns an correctly formatted API name for use in the MessageReactions endpoints. -func (e *Emoji) APIName() string { - if e.ID != "" && e.Name != "" { - return e.Name + ":" + e.ID - } - if e.Name != "" { - return e.Name - } - return e.ID -} - -// VerificationLevel type definition -type VerificationLevel int - -// Constants for VerificationLevel levels from 0 to 3 inclusive -const ( - VerificationLevelNone VerificationLevel = iota - VerificationLevelLow - VerificationLevelMedium - VerificationLevelHigh -) - -// A Guild holds all data related to a specific Discord Guild. Guilds are also -// sometimes referred to as Servers in the Discord client. -type Guild struct { - ID string `json:"id"` - Name string `json:"name"` - Icon string `json:"icon"` - Region string `json:"region"` - AfkChannelID string `json:"afk_channel_id"` - EmbedChannelID string `json:"embed_channel_id"` - OwnerID string `json:"owner_id"` - JoinedAt Timestamp `json:"joined_at"` - Splash string `json:"splash"` - AfkTimeout int `json:"afk_timeout"` - MemberCount int `json:"member_count"` - VerificationLevel VerificationLevel `json:"verification_level"` - EmbedEnabled bool `json:"embed_enabled"` - Large bool `json:"large"` // ?? - DefaultMessageNotifications int `json:"default_message_notifications"` - Roles []*Role `json:"roles"` - Emojis []*Emoji `json:"emojis"` - Members []*Member `json:"members"` - Presences []*Presence `json:"presences"` - Channels []*Channel `json:"channels"` - VoiceStates []*VoiceState `json:"voice_states"` - Unavailable bool `json:"unavailable"` -} - -// A UserGuild holds a brief version of a Guild -type UserGuild struct { - ID string `json:"id"` - Name string `json:"name"` - Icon string `json:"icon"` - Owner bool `json:"owner"` - Permissions int `json:"permissions"` -} - -// A GuildParams stores all the data needed to update discord guild settings -type GuildParams struct { - Name string `json:"name,omitempty"` - Region string `json:"region,omitempty"` - VerificationLevel *VerificationLevel `json:"verification_level,omitempty"` - DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` // TODO: Separate type? - AfkChannelID string `json:"afk_channel_id,omitempty"` - AfkTimeout int `json:"afk_timeout,omitempty"` - Icon string `json:"icon,omitempty"` - OwnerID string `json:"owner_id,omitempty"` - Splash string `json:"splash,omitempty"` -} - -// A Role stores information about Discord guild member roles. -type Role struct { - ID string `json:"id"` - Name string `json:"name"` - Managed bool `json:"managed"` - Mentionable bool `json:"mentionable"` - Hoist bool `json:"hoist"` - Color int `json:"color"` - Position int `json:"position"` - Permissions int `json:"permissions"` -} - -// Roles are a collection of Role -type Roles []*Role - -func (r Roles) Len() int { - return len(r) -} - -func (r Roles) Less(i, j int) bool { - return r[i].Position > r[j].Position -} - -func (r Roles) Swap(i, j int) { - r[i], r[j] = r[j], r[i] -} - -// A VoiceState stores the voice states of Guilds -type VoiceState struct { - UserID string `json:"user_id"` - SessionID string `json:"session_id"` - ChannelID string `json:"channel_id"` - GuildID string `json:"guild_id"` - Suppress bool `json:"suppress"` - SelfMute bool `json:"self_mute"` - SelfDeaf bool `json:"self_deaf"` - Mute bool `json:"mute"` - Deaf bool `json:"deaf"` -} - -// A Presence stores the online, offline, or idle and game status of Guild members. -type Presence struct { - User *User `json:"user"` - Status Status `json:"status"` - Game *Game `json:"game"` - Nick string `json:"nick"` - Roles []string `json:"roles"` - Since *int `json:"since"` -} - -// GameType is the type of "game" (see GameType* consts) in the Game struct -type GameType int - -// Valid GameType values -const ( - GameTypeGame GameType = iota - GameTypeStreaming -) - -// A Game struct holds the name of the "playing .." game for a user -type Game struct { - Name string `json:"name"` - Type GameType `json:"type"` - URL string `json:"url,omitempty"` - Details string `json:"details,omitempty"` - State string `json:"state,omitempty"` - TimeStamps TimeStamps `json:"timestamps,omitempty"` - Assets Assets `json:"assets,omitempty"` - ApplicationID string `json:"application_id,omitempty"` - Instance int8 `json:"instance,omitempty"` - // TODO: Party and Secrets (unknown structure) -} - -// A TimeStamps struct contains start and end times used in the rich presence "playing .." Game -type TimeStamps struct { - EndTimestamp int64 `json:"end,omitempty"` - StartTimestamp int64 `json:"start,omitempty"` -} - -// UnmarshalJSON unmarshals JSON into TimeStamps struct -func (t *TimeStamps) UnmarshalJSON(b []byte) error { - temp := struct { - End float64 `json:"end,omitempty"` - Start float64 `json:"start,omitempty"` - }{} - err := json.Unmarshal(b, &temp) - if err != nil { - return err - } - t.EndTimestamp = int64(temp.End) - t.StartTimestamp = int64(temp.Start) - return nil -} - -// An Assets struct contains assets and labels used in the rich presence "playing .." Game -type Assets struct { - LargeImageID string `json:"large_image,omitempty"` - SmallImageID string `json:"small_image,omitempty"` - LargeText string `json:"large_text,omitempty"` - SmallText string `json:"small_text,omitempty"` -} - -// A Member stores user information for Guild members. -type Member struct { - GuildID string `json:"guild_id"` - JoinedAt string `json:"joined_at"` - Nick string `json:"nick"` - Deaf bool `json:"deaf"` - Mute bool `json:"mute"` - User *User `json:"user"` - Roles []string `json:"roles"` -} - -// A Settings stores data for a specific users Discord client settings. -type Settings struct { - RenderEmbeds bool `json:"render_embeds"` - InlineEmbedMedia bool `json:"inline_embed_media"` - InlineAttachmentMedia bool `json:"inline_attachment_media"` - EnableTtsCommand bool `json:"enable_tts_command"` - MessageDisplayCompact bool `json:"message_display_compact"` - ShowCurrentGame bool `json:"show_current_game"` - ConvertEmoticons bool `json:"convert_emoticons"` - Locale string `json:"locale"` - Theme string `json:"theme"` - GuildPositions []string `json:"guild_positions"` - RestrictedGuilds []string `json:"restricted_guilds"` - FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"` - Status Status `json:"status"` - DetectPlatformAccounts bool `json:"detect_platform_accounts"` - DeveloperMode bool `json:"developer_mode"` -} - -// Status type definition -type Status string - -// Constants for Status with the different current available status -const ( - StatusOnline Status = "online" - StatusIdle Status = "idle" - StatusDoNotDisturb Status = "dnd" - StatusInvisible Status = "invisible" - StatusOffline Status = "offline" -) - -// FriendSourceFlags stores ... TODO :) -type FriendSourceFlags struct { - All bool `json:"all"` - MutualGuilds bool `json:"mutual_guilds"` - MutualFriends bool `json:"mutual_friends"` -} - -// A Relationship between the logged in user and Relationship.User -type Relationship struct { - User *User `json:"user"` - Type int `json:"type"` // 1 = friend, 2 = blocked, 3 = incoming friend req, 4 = sent friend req - ID string `json:"id"` -} - -// A TooManyRequests struct holds information received from Discord -// when receiving a HTTP 429 response. -type TooManyRequests struct { - Bucket string `json:"bucket"` - Message string `json:"message"` - RetryAfter time.Duration `json:"retry_after"` -} - -// A ReadState stores data on the read state of channels. -type ReadState struct { - MentionCount int `json:"mention_count"` - LastMessageID string `json:"last_message_id"` - ID string `json:"id"` -} - -// An Ack is used to ack messages -type Ack struct { - Token string `json:"token"` -} - -// A GuildRole stores data for guild roles. -type GuildRole struct { - Role *Role `json:"role"` - GuildID string `json:"guild_id"` -} - -// A GuildBan stores data for a guild ban. -type GuildBan struct { - Reason string `json:"reason"` - User *User `json:"user"` -} - -// A GuildIntegration stores data for a guild integration. -type GuildIntegration struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` - Enabled bool `json:"enabled"` - Syncing bool `json:"syncing"` - RoleID string `json:"role_id"` - ExpireBehavior int `json:"expire_behavior"` - ExpireGracePeriod int `json:"expire_grace_period"` - User *User `json:"user"` - Account *GuildIntegrationAccount `json:"account"` - SyncedAt int `json:"synced_at"` -} - -// A GuildIntegrationAccount stores data for a guild integration account. -type GuildIntegrationAccount struct { - ID string `json:"id"` - Name string `json:"name"` -} - -// A GuildEmbed stores data for a guild embed. -type GuildEmbed struct { - Enabled bool `json:"enabled"` - ChannelID string `json:"channel_id"` -} - -// A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings. -type UserGuildSettingsChannelOverride struct { - Muted bool `json:"muted"` - MessageNotifications int `json:"message_notifications"` - ChannelID string `json:"channel_id"` -} - -// A UserGuildSettings stores data for a users guild settings. -type UserGuildSettings struct { - SupressEveryone bool `json:"suppress_everyone"` - Muted bool `json:"muted"` - MobilePush bool `json:"mobile_push"` - MessageNotifications int `json:"message_notifications"` - GuildID string `json:"guild_id"` - ChannelOverrides []*UserGuildSettingsChannelOverride `json:"channel_overrides"` -} - -// A UserGuildSettingsEdit stores data for editing UserGuildSettings -type UserGuildSettingsEdit struct { - SupressEveryone bool `json:"suppress_everyone"` - Muted bool `json:"muted"` - MobilePush bool `json:"mobile_push"` - MessageNotifications int `json:"message_notifications"` - ChannelOverrides map[string]*UserGuildSettingsChannelOverride `json:"channel_overrides"` -} - -// An APIErrorMessage is an api error message returned from discord -type APIErrorMessage struct { - Code int `json:"code"` - Message string `json:"message"` -} - -// Webhook stores the data for a webhook. -type Webhook struct { - ID string `json:"id"` - GuildID string `json:"guild_id"` - ChannelID string `json:"channel_id"` - User *User `json:"user"` - Name string `json:"name"` - Avatar string `json:"avatar"` - Token string `json:"token"` -} - -// WebhookParams is a struct for webhook params, used in the WebhookExecute command. -type WebhookParams struct { - Content string `json:"content,omitempty"` - Username string `json:"username,omitempty"` - AvatarURL string `json:"avatar_url,omitempty"` - TTS bool `json:"tts,omitempty"` - File string `json:"file,omitempty"` - Embeds []*MessageEmbed `json:"embeds,omitempty"` -} - -// MessageReaction stores the data for a message reaction. -type MessageReaction struct { - UserID string `json:"user_id"` - MessageID string `json:"message_id"` - Emoji Emoji `json:"emoji"` - ChannelID string `json:"channel_id"` -} - -// GatewayBotResponse stores the data for the gateway/bot response -type GatewayBotResponse struct { - URL string `json:"url"` - Shards int `json:"shards"` -} - -// Constants for the different bit offsets of text channel permissions -const ( - PermissionReadMessages = 1 << (iota + 10) - PermissionSendMessages - PermissionSendTTSMessages - PermissionManageMessages - PermissionEmbedLinks - PermissionAttachFiles - PermissionReadMessageHistory - PermissionMentionEveryone - PermissionUseExternalEmojis -) - -// Constants for the different bit offsets of voice permissions -const ( - PermissionVoiceConnect = 1 << (iota + 20) - PermissionVoiceSpeak - PermissionVoiceMuteMembers - PermissionVoiceDeafenMembers - PermissionVoiceMoveMembers - PermissionVoiceUseVAD -) - -// Constants for general management. -const ( - PermissionChangeNickname = 1 << (iota + 26) - PermissionManageNicknames - PermissionManageRoles - PermissionManageWebhooks - PermissionManageEmojis -) - -// Constants for the different bit offsets of general permissions -const ( - PermissionCreateInstantInvite = 1 << iota - PermissionKickMembers - PermissionBanMembers - PermissionAdministrator - PermissionManageChannels - PermissionManageServer - PermissionAddReactions - PermissionViewAuditLogs - - PermissionAllText = PermissionReadMessages | - PermissionSendMessages | - PermissionSendTTSMessages | - PermissionManageMessages | - PermissionEmbedLinks | - PermissionAttachFiles | - PermissionReadMessageHistory | - PermissionMentionEveryone - PermissionAllVoice = PermissionVoiceConnect | - PermissionVoiceSpeak | - PermissionVoiceMuteMembers | - PermissionVoiceDeafenMembers | - PermissionVoiceMoveMembers | - PermissionVoiceUseVAD - PermissionAllChannel = PermissionAllText | - PermissionAllVoice | - PermissionCreateInstantInvite | - PermissionManageRoles | - PermissionManageChannels | - PermissionAddReactions | - PermissionViewAuditLogs - PermissionAll = PermissionAllChannel | - PermissionKickMembers | - PermissionBanMembers | - PermissionManageServer | - PermissionAdministrator -) - -// Block contains Discord JSON Error Response codes -const ( - ErrCodeUnknownAccount = 10001 - ErrCodeUnknownApplication = 10002 - ErrCodeUnknownChannel = 10003 - ErrCodeUnknownGuild = 10004 - ErrCodeUnknownIntegration = 10005 - ErrCodeUnknownInvite = 10006 - ErrCodeUnknownMember = 10007 - ErrCodeUnknownMessage = 10008 - ErrCodeUnknownOverwrite = 10009 - ErrCodeUnknownProvider = 10010 - ErrCodeUnknownRole = 10011 - ErrCodeUnknownToken = 10012 - ErrCodeUnknownUser = 10013 - ErrCodeUnknownEmoji = 10014 - - ErrCodeBotsCannotUseEndpoint = 20001 - ErrCodeOnlyBotsCanUseEndpoint = 20002 - - ErrCodeMaximumGuildsReached = 30001 - ErrCodeMaximumFriendsReached = 30002 - ErrCodeMaximumPinsReached = 30003 - ErrCodeMaximumGuildRolesReached = 30005 - ErrCodeTooManyReactions = 30010 - - ErrCodeUnauthorized = 40001 - - ErrCodeMissingAccess = 50001 - ErrCodeInvalidAccountType = 50002 - ErrCodeCannotExecuteActionOnDMChannel = 50003 - ErrCodeEmbedCisabled = 50004 - ErrCodeCannotEditFromAnotherUser = 50005 - ErrCodeCannotSendEmptyMessage = 50006 - ErrCodeCannotSendMessagesToThisUser = 50007 - ErrCodeCannotSendMessagesInVoiceChannel = 50008 - ErrCodeChannelVerificationLevelTooHigh = 50009 - ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010 - ErrCodeOAuth2ApplicationLimitReached = 50011 - ErrCodeInvalidOAuthState = 50012 - ErrCodeMissingPermissions = 50013 - ErrCodeInvalidAuthenticationToken = 50014 - ErrCodeNoteTooLong = 50015 - ErrCodeTooFewOrTooManyMessagesToDelete = 50016 - ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019 - ErrCodeCannotExecuteActionOnSystemMessage = 50021 - ErrCodeMessageProvidedTooOldForBulkDelete = 50034 - ErrCodeInvalidFormBody = 50035 - ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036 - - ErrCodeReactionBlocked = 90001 -) diff --git a/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go b/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go deleted file mode 100644 index 839f009d..00000000 --- a/vendor/github.com/bwmarrin/discordgo/tools/cmd/eventhandlers/main.go +++ /dev/null @@ -1,124 +0,0 @@ -package main - -import ( - "bytes" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "log" - "path/filepath" - "regexp" - "sort" - "strings" - "text/template" -) - -var eventHandlerTmpl = template.Must(template.New("eventHandler").Funcs(template.FuncMap{ - "constName": constName, - "isDiscordEvent": isDiscordEvent, - "privateName": privateName, -}).Parse(`// Code generated by \"eventhandlers\"; DO NOT EDIT -// See events.go - -package discordgo - -// Following are all the event types. -// Event type values are used to match the events returned by Discord. -// EventTypes surrounded by __ are synthetic and are internal to DiscordGo. -const ({{range .}} - {{privateName .}}EventType = "{{constName .}}"{{end}} -) -{{range .}} -// {{privateName .}}EventHandler is an event handler for {{.}} events. -type {{privateName .}}EventHandler func(*Session, *{{.}}) - -// Type returns the event type for {{.}} events. -func (eh {{privateName .}}EventHandler) Type() string { - return {{privateName .}}EventType -} -{{if isDiscordEvent .}} -// New returns a new instance of {{.}}. -func (eh {{privateName .}}EventHandler) New() interface{} { - return &{{.}}{} -}{{end}} -// Handle is the handler for {{.}} events. -func (eh {{privateName .}}EventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*{{.}}); ok { - eh(s, t) - } -} - -{{end}} -func handlerForInterface(handler interface{}) EventHandler { - switch v := handler.(type) { - case func(*Session, interface{}): - return interfaceEventHandler(v){{range .}} - case func(*Session, *{{.}}): - return {{privateName .}}EventHandler(v){{end}} - } - - return nil -} - -func init() { {{range .}}{{if isDiscordEvent .}} - registerInterfaceProvider({{privateName .}}EventHandler(nil)){{end}}{{end}} -} -`)) - -func main() { - var buf bytes.Buffer - dir := filepath.Dir(".") - - fs := token.NewFileSet() - parsedFile, err := parser.ParseFile(fs, "events.go", nil, 0) - if err != nil { - log.Fatalf("warning: internal error: could not parse events.go: %s", err) - return - } - - names := []string{} - for object := range parsedFile.Scope.Objects { - names = append(names, object) - } - sort.Strings(names) - eventHandlerTmpl.Execute(&buf, names) - - src, err := format.Source(buf.Bytes()) - if err != nil { - log.Println("warning: internal error: invalid Go generated:", err) - src = buf.Bytes() - } - - err = ioutil.WriteFile(filepath.Join(dir, strings.ToLower("eventhandlers.go")), src, 0644) - if err != nil { - log.Fatal(buf, "writing output: %s", err) - } -} - -var constRegexp = regexp.MustCompile("([a-z])([A-Z])") - -func constCase(name string) string { - return strings.ToUpper(constRegexp.ReplaceAllString(name, "${1}_${2}")) -} - -func isDiscordEvent(name string) bool { - switch { - case name == "Connect", name == "Disconnect", name == "Event", name == "RateLimit", name == "Interface": - return false - default: - return true - } -} - -func constName(name string) string { - if !isDiscordEvent(name) { - return "__" + constCase(name) + "__" - } - - return constCase(name) -} - -func privateName(name string) string { - return strings.ToLower(string(name[0])) + name[1:] -} diff --git a/vendor/github.com/bwmarrin/discordgo/types.go b/vendor/github.com/bwmarrin/discordgo/types.go deleted file mode 100644 index 780b6bb9..00000000 --- a/vendor/github.com/bwmarrin/discordgo/types.go +++ /dev/null @@ -1,58 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains custom types, currently only a timestamp wrapper. - -package discordgo - -import ( - "encoding/json" - "fmt" - "net/http" - "time" -) - -// Timestamp stores a timestamp, as sent by the Discord API. -type Timestamp string - -// Parse parses a timestamp string into a time.Time object. -// The only time this can fail is if Discord changes their timestamp format. -func (t Timestamp) Parse() (time.Time, error) { - return time.Parse(time.RFC3339, string(t)) -} - -// RESTError stores error information about a request with a bad response code. -// Message is not always present, there are cases where api calls can fail -// without returning a json message. -type RESTError struct { - Request *http.Request - Response *http.Response - ResponseBody []byte - - Message *APIErrorMessage // Message may be nil. -} - -func newRestError(req *http.Request, resp *http.Response, body []byte) *RESTError { - restErr := &RESTError{ - Request: req, - Response: resp, - ResponseBody: body, - } - - // Attempt to decode the error and assume no message was provided if it fails - var msg *APIErrorMessage - err := json.Unmarshal(body, &msg) - if err == nil { - restErr.Message = msg - } - - return restErr -} - -func (r RESTError) Error() string { - return fmt.Sprintf("HTTP %s, %s", r.Response.Status, r.ResponseBody) -} diff --git a/vendor/github.com/bwmarrin/discordgo/user.go b/vendor/github.com/bwmarrin/discordgo/user.go deleted file mode 100644 index a710f286..00000000 --- a/vendor/github.com/bwmarrin/discordgo/user.go +++ /dev/null @@ -1,47 +0,0 @@ -package discordgo - -import ( - "fmt" - "strings" -) - -// A User stores all data for an individual Discord user. -type User struct { - ID string `json:"id"` - Email string `json:"email"` - Username string `json:"username"` - Avatar string `json:"avatar"` - Discriminator string `json:"discriminator"` - Token string `json:"token"` - Verified bool `json:"verified"` - MFAEnabled bool `json:"mfa_enabled"` - Bot bool `json:"bot"` -} - -// String returns a unique identifier of the form username#discriminator -func (u *User) String() string { - return fmt.Sprintf("%s#%s", u.Username, u.Discriminator) -} - -// Mention return a string which mentions the user -func (u *User) Mention() string { - return fmt.Sprintf("<@%s>", u.ID) -} - -// AvatarURL returns a URL to the user's avatar. -// size: The size of the user's avatar as a power of two -// if size is an empty string, no size parameter will -// be added to the URL. -func (u *User) AvatarURL(size string) string { - var URL string - if strings.HasPrefix(u.Avatar, "a_") { - URL = EndpointUserAvatarAnimated(u.ID, u.Avatar) - } else { - URL = EndpointUserAvatar(u.ID, u.Avatar) - } - - if size != "" { - return URL + "?size=" + size - } - return URL -} diff --git a/vendor/github.com/bwmarrin/discordgo/voice.go b/vendor/github.com/bwmarrin/discordgo/voice.go deleted file mode 100644 index 3bbf6212..00000000 --- a/vendor/github.com/bwmarrin/discordgo/voice.go +++ /dev/null @@ -1,886 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains code related to Discord voice suppport - -package discordgo - -import ( - "encoding/binary" - "encoding/json" - "fmt" - "net" - "strings" - "sync" - "time" - - "github.com/gorilla/websocket" - "golang.org/x/crypto/nacl/secretbox" -) - -// ------------------------------------------------------------------------------------------------ -// Code related to both VoiceConnection Websocket and UDP connections. -// ------------------------------------------------------------------------------------------------ - -// A VoiceConnection struct holds all the data and functions related to a Discord Voice Connection. -type VoiceConnection struct { - sync.RWMutex - - Debug bool // If true, print extra logging -- DEPRECATED - LogLevel int - Ready bool // If true, voice is ready to send/receive audio - UserID string - GuildID string - ChannelID string - deaf bool - mute bool - speaking bool - reconnecting bool // If true, voice connection is trying to reconnect - - OpusSend chan []byte // Chan for sending opus audio - OpusRecv chan *Packet // Chan for receiving opus audio - - wsConn *websocket.Conn - wsMutex sync.Mutex - udpConn *net.UDPConn - session *Session - - sessionID string - token string - endpoint string - - // Used to send a close signal to goroutines - close chan struct{} - - // Used to allow blocking until connected - connected chan bool - - // Used to pass the sessionid from onVoiceStateUpdate - // sessionRecv chan string UNUSED ATM - - op4 voiceOP4 - op2 voiceOP2 - - voiceSpeakingUpdateHandlers []VoiceSpeakingUpdateHandler -} - -// VoiceSpeakingUpdateHandler type provides a function definition for the -// VoiceSpeakingUpdate event -type VoiceSpeakingUpdateHandler func(vc *VoiceConnection, vs *VoiceSpeakingUpdate) - -// Speaking sends a speaking notification to Discord over the voice websocket. -// This must be sent as true prior to sending audio and should be set to false -// once finished sending audio. -// b : Send true if speaking, false if not. -func (v *VoiceConnection) Speaking(b bool) (err error) { - - v.log(LogDebug, "called (%t)", b) - - type voiceSpeakingData struct { - Speaking bool `json:"speaking"` - Delay int `json:"delay"` - } - - type voiceSpeakingOp struct { - Op int `json:"op"` // Always 5 - Data voiceSpeakingData `json:"d"` - } - - if v.wsConn == nil { - return fmt.Errorf("no VoiceConnection websocket") - } - - data := voiceSpeakingOp{5, voiceSpeakingData{b, 0}} - v.wsMutex.Lock() - err = v.wsConn.WriteJSON(data) - v.wsMutex.Unlock() - - v.Lock() - defer v.Unlock() - if err != nil { - v.speaking = false - v.log(LogError, "Speaking() write json error:", err) - return - } - - v.speaking = b - - return -} - -// ChangeChannel sends Discord a request to change channels within a Guild -// !!! NOTE !!! This function may be removed in favour of just using ChannelVoiceJoin -func (v *VoiceConnection) ChangeChannel(channelID string, mute, deaf bool) (err error) { - - v.log(LogInformational, "called") - - data := voiceChannelJoinOp{4, voiceChannelJoinData{&v.GuildID, &channelID, mute, deaf}} - v.wsMutex.Lock() - err = v.session.wsConn.WriteJSON(data) - v.wsMutex.Unlock() - if err != nil { - return - } - v.ChannelID = channelID - v.deaf = deaf - v.mute = mute - v.speaking = false - - return -} - -// Disconnect disconnects from this voice channel and closes the websocket -// and udp connections to Discord. -// !!! NOTE !!! this function may be removed in favour of ChannelVoiceLeave -func (v *VoiceConnection) Disconnect() (err error) { - - // Send a OP4 with a nil channel to disconnect - if v.sessionID != "" { - data := voiceChannelJoinOp{4, voiceChannelJoinData{&v.GuildID, nil, true, true}} - v.session.wsMutex.Lock() - err = v.session.wsConn.WriteJSON(data) - v.session.wsMutex.Unlock() - v.sessionID = "" - } - - // Close websocket and udp connections - v.Close() - - v.log(LogInformational, "Deleting VoiceConnection %s", v.GuildID) - - v.session.Lock() - delete(v.session.VoiceConnections, v.GuildID) - v.session.Unlock() - - return -} - -// Close closes the voice ws and udp connections -func (v *VoiceConnection) Close() { - - v.log(LogInformational, "called") - - v.Lock() - defer v.Unlock() - - v.Ready = false - v.speaking = false - - if v.close != nil { - v.log(LogInformational, "closing v.close") - close(v.close) - v.close = nil - } - - if v.udpConn != nil { - v.log(LogInformational, "closing udp") - err := v.udpConn.Close() - if err != nil { - v.log(LogError, "error closing udp connection: ", err) - } - v.udpConn = nil - } - - if v.wsConn != nil { - v.log(LogInformational, "sending close frame") - - // To cleanly close a connection, a client should send a close - // frame and wait for the server to close the connection. - v.wsMutex.Lock() - err := v.wsConn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) - v.wsMutex.Unlock() - if err != nil { - v.log(LogError, "error closing websocket, %s", err) - } - - // TODO: Wait for Discord to actually close the connection. - time.Sleep(1 * time.Second) - - v.log(LogInformational, "closing websocket") - err = v.wsConn.Close() - if err != nil { - v.log(LogError, "error closing websocket, %s", err) - } - - v.wsConn = nil - } -} - -// AddHandler adds a Handler for VoiceSpeakingUpdate events. -func (v *VoiceConnection) AddHandler(h VoiceSpeakingUpdateHandler) { - v.Lock() - defer v.Unlock() - - v.voiceSpeakingUpdateHandlers = append(v.voiceSpeakingUpdateHandlers, h) -} - -// VoiceSpeakingUpdate is a struct for a VoiceSpeakingUpdate event. -type VoiceSpeakingUpdate struct { - UserID string `json:"user_id"` - SSRC int `json:"ssrc"` - Speaking bool `json:"speaking"` -} - -// ------------------------------------------------------------------------------------------------ -// Unexported Internal Functions Below. -// ------------------------------------------------------------------------------------------------ - -// A voiceOP4 stores the data for the voice operation 4 websocket event -// which provides us with the NaCl SecretBox encryption key -type voiceOP4 struct { - SecretKey [32]byte `json:"secret_key"` - Mode string `json:"mode"` -} - -// A voiceOP2 stores the data for the voice operation 2 websocket event -// which is sort of like the voice READY packet -type voiceOP2 struct { - SSRC uint32 `json:"ssrc"` - Port int `json:"port"` - Modes []string `json:"modes"` - HeartbeatInterval time.Duration `json:"heartbeat_interval"` -} - -// WaitUntilConnected waits for the Voice Connection to -// become ready, if it does not become ready it returns an err -func (v *VoiceConnection) waitUntilConnected() error { - - v.log(LogInformational, "called") - - i := 0 - for { - v.RLock() - ready := v.Ready - v.RUnlock() - if ready { - return nil - } - - if i > 10 { - return fmt.Errorf("timeout waiting for voice") - } - - time.Sleep(1 * time.Second) - i++ - } -} - -// Open opens a voice connection. This should be called -// after VoiceChannelJoin is used and the data VOICE websocket events -// are captured. -func (v *VoiceConnection) open() (err error) { - - v.log(LogInformational, "called") - - v.Lock() - defer v.Unlock() - - // Don't open a websocket if one is already open - if v.wsConn != nil { - v.log(LogWarning, "refusing to overwrite non-nil websocket") - return - } - - // TODO temp? loop to wait for the SessionID - i := 0 - for { - if v.sessionID != "" { - break - } - if i > 20 { // only loop for up to 1 second total - return fmt.Errorf("did not receive voice Session ID in time") - } - time.Sleep(50 * time.Millisecond) - i++ - } - - // Connect to VoiceConnection Websocket - vg := fmt.Sprintf("wss://%s", strings.TrimSuffix(v.endpoint, ":80")) - v.log(LogInformational, "connecting to voice endpoint %s", vg) - v.wsConn, _, err = websocket.DefaultDialer.Dial(vg, nil) - if err != nil { - v.log(LogWarning, "error connecting to voice endpoint %s, %s", vg, err) - v.log(LogDebug, "voice struct: %#v\n", v) - return - } - - type voiceHandshakeData struct { - ServerID string `json:"server_id"` - UserID string `json:"user_id"` - SessionID string `json:"session_id"` - Token string `json:"token"` - } - type voiceHandshakeOp struct { - Op int `json:"op"` // Always 0 - Data voiceHandshakeData `json:"d"` - } - data := voiceHandshakeOp{0, voiceHandshakeData{v.GuildID, v.UserID, v.sessionID, v.token}} - - err = v.wsConn.WriteJSON(data) - if err != nil { - v.log(LogWarning, "error sending init packet, %s", err) - return - } - - v.close = make(chan struct{}) - go v.wsListen(v.wsConn, v.close) - - // add loop/check for Ready bool here? - // then return false if not ready? - // but then wsListen will also err. - - return -} - -// wsListen listens on the voice websocket for messages and passes them -// to the voice event handler. This is automatically called by the Open func -func (v *VoiceConnection) wsListen(wsConn *websocket.Conn, close <-chan struct{}) { - - v.log(LogInformational, "called") - - for { - _, message, err := v.wsConn.ReadMessage() - if err != nil { - // Detect if we have been closed manually. If a Close() has already - // happened, the websocket we are listening on will be different to the - // current session. - v.RLock() - sameConnection := v.wsConn == wsConn - v.RUnlock() - if sameConnection { - - v.log(LogError, "voice endpoint %s websocket closed unexpectantly, %s", v.endpoint, err) - - // Start reconnect goroutine then exit. - go v.reconnect() - } - return - } - - // Pass received message to voice event handler - select { - case <-close: - return - default: - go v.onEvent(message) - } - } -} - -// wsEvent handles any voice websocket events. This is only called by the -// wsListen() function. -func (v *VoiceConnection) onEvent(message []byte) { - - v.log(LogDebug, "received: %s", string(message)) - - var e Event - if err := json.Unmarshal(message, &e); err != nil { - v.log(LogError, "unmarshall error, %s", err) - return - } - - switch e.Operation { - - case 2: // READY - - if err := json.Unmarshal(e.RawData, &v.op2); err != nil { - v.log(LogError, "OP2 unmarshall error, %s, %s", err, string(e.RawData)) - return - } - - // Start the voice websocket heartbeat to keep the connection alive - go v.wsHeartbeat(v.wsConn, v.close, v.op2.HeartbeatInterval) - // TODO monitor a chan/bool to verify this was successful - - // Start the UDP connection - err := v.udpOpen() - if err != nil { - v.log(LogError, "error opening udp connection, %s", err) - return - } - - // Start the opusSender. - // TODO: Should we allow 48000/960 values to be user defined? - if v.OpusSend == nil { - v.OpusSend = make(chan []byte, 2) - } - go v.opusSender(v.udpConn, v.close, v.OpusSend, 48000, 960) - - // Start the opusReceiver - if !v.deaf { - if v.OpusRecv == nil { - v.OpusRecv = make(chan *Packet, 2) - } - - go v.opusReceiver(v.udpConn, v.close, v.OpusRecv) - } - - return - - case 3: // HEARTBEAT response - // add code to use this to track latency? - return - - case 4: // udp encryption secret key - v.Lock() - defer v.Unlock() - - v.op4 = voiceOP4{} - if err := json.Unmarshal(e.RawData, &v.op4); err != nil { - v.log(LogError, "OP4 unmarshall error, %s, %s", err, string(e.RawData)) - return - } - return - - case 5: - if len(v.voiceSpeakingUpdateHandlers) == 0 { - return - } - - voiceSpeakingUpdate := &VoiceSpeakingUpdate{} - if err := json.Unmarshal(e.RawData, voiceSpeakingUpdate); err != nil { - v.log(LogError, "OP5 unmarshall error, %s, %s", err, string(e.RawData)) - return - } - - for _, h := range v.voiceSpeakingUpdateHandlers { - h(v, voiceSpeakingUpdate) - } - - default: - v.log(LogDebug, "unknown voice operation, %d, %s", e.Operation, string(e.RawData)) - } - - return -} - -type voiceHeartbeatOp struct { - Op int `json:"op"` // Always 3 - Data int `json:"d"` -} - -// NOTE :: When a guild voice server changes how do we shut this down -// properly, so a new connection can be setup without fuss? -// -// wsHeartbeat sends regular heartbeats to voice Discord so it knows the client -// is still connected. If you do not send these heartbeats Discord will -// disconnect the websocket connection after a few seconds. -func (v *VoiceConnection) wsHeartbeat(wsConn *websocket.Conn, close <-chan struct{}, i time.Duration) { - - if close == nil || wsConn == nil { - return - } - - var err error - ticker := time.NewTicker(i * time.Millisecond) - defer ticker.Stop() - for { - v.log(LogDebug, "sending heartbeat packet") - v.wsMutex.Lock() - err = wsConn.WriteJSON(voiceHeartbeatOp{3, int(time.Now().Unix())}) - v.wsMutex.Unlock() - if err != nil { - v.log(LogError, "error sending heartbeat to voice endpoint %s, %s", v.endpoint, err) - return - } - - select { - case <-ticker.C: - // continue loop and send heartbeat - case <-close: - return - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Code related to the VoiceConnection UDP connection -// ------------------------------------------------------------------------------------------------ - -type voiceUDPData struct { - Address string `json:"address"` // Public IP of machine running this code - Port uint16 `json:"port"` // UDP Port of machine running this code - Mode string `json:"mode"` // always "xsalsa20_poly1305" -} - -type voiceUDPD struct { - Protocol string `json:"protocol"` // Always "udp" ? - Data voiceUDPData `json:"data"` -} - -type voiceUDPOp struct { - Op int `json:"op"` // Always 1 - Data voiceUDPD `json:"d"` -} - -// udpOpen opens a UDP connection to the voice server and completes the -// initial required handshake. This connection is left open in the session -// and can be used to send or receive audio. This should only be called -// from voice.wsEvent OP2 -func (v *VoiceConnection) udpOpen() (err error) { - - v.Lock() - defer v.Unlock() - - if v.wsConn == nil { - return fmt.Errorf("nil voice websocket") - } - - if v.udpConn != nil { - return fmt.Errorf("udp connection already open") - } - - if v.close == nil { - return fmt.Errorf("nil close channel") - } - - if v.endpoint == "" { - return fmt.Errorf("empty endpoint") - } - - host := fmt.Sprintf("%s:%d", strings.TrimSuffix(v.endpoint, ":80"), v.op2.Port) - addr, err := net.ResolveUDPAddr("udp", host) - if err != nil { - v.log(LogWarning, "error resolving udp host %s, %s", host, err) - return - } - - v.log(LogInformational, "connecting to udp addr %s", addr.String()) - v.udpConn, err = net.DialUDP("udp", nil, addr) - if err != nil { - v.log(LogWarning, "error connecting to udp addr %s, %s", addr.String(), err) - return - } - - // Create a 70 byte array and put the SSRC code from the Op 2 VoiceConnection event - // into it. Then send that over the UDP connection to Discord - sb := make([]byte, 70) - binary.BigEndian.PutUint32(sb, v.op2.SSRC) - _, err = v.udpConn.Write(sb) - if err != nil { - v.log(LogWarning, "udp write error to %s, %s", addr.String(), err) - return - } - - // Create a 70 byte array and listen for the initial handshake response - // from Discord. Once we get it parse the IP and PORT information out - // of the response. This should be our public IP and PORT as Discord - // saw us. - rb := make([]byte, 70) - rlen, _, err := v.udpConn.ReadFromUDP(rb) - if err != nil { - v.log(LogWarning, "udp read error, %s, %s", addr.String(), err) - return - } - - if rlen < 70 { - v.log(LogWarning, "received udp packet too small") - return fmt.Errorf("received udp packet too small") - } - - // Loop over position 4 through 20 to grab the IP address - // Should never be beyond position 20. - var ip string - for i := 4; i < 20; i++ { - if rb[i] == 0 { - break - } - ip += string(rb[i]) - } - - // Grab port from position 68 and 69 - port := binary.LittleEndian.Uint16(rb[68:70]) - - // Take the data from above and send it back to Discord to finalize - // the UDP connection handshake. - data := voiceUDPOp{1, voiceUDPD{"udp", voiceUDPData{ip, port, "xsalsa20_poly1305"}}} - - v.wsMutex.Lock() - err = v.wsConn.WriteJSON(data) - v.wsMutex.Unlock() - if err != nil { - v.log(LogWarning, "udp write error, %#v, %s", data, err) - return - } - - // start udpKeepAlive - go v.udpKeepAlive(v.udpConn, v.close, 5*time.Second) - // TODO: find a way to check that it fired off okay - - return -} - -// udpKeepAlive sends a udp packet to keep the udp connection open -// This is still a bit of a "proof of concept" -func (v *VoiceConnection) udpKeepAlive(udpConn *net.UDPConn, close <-chan struct{}, i time.Duration) { - - if udpConn == nil || close == nil { - return - } - - var err error - var sequence uint64 - - packet := make([]byte, 8) - - ticker := time.NewTicker(i) - defer ticker.Stop() - for { - - binary.LittleEndian.PutUint64(packet, sequence) - sequence++ - - _, err = udpConn.Write(packet) - if err != nil { - v.log(LogError, "write error, %s", err) - return - } - - select { - case <-ticker.C: - // continue loop and send keepalive - case <-close: - return - } - } -} - -// opusSender will listen on the given channel and send any -// pre-encoded opus audio to Discord. Supposedly. -func (v *VoiceConnection) opusSender(udpConn *net.UDPConn, close <-chan struct{}, opus <-chan []byte, rate, size int) { - - if udpConn == nil || close == nil { - return - } - - // VoiceConnection is now ready to receive audio packets - // TODO: this needs reviewed as I think there must be a better way. - v.Lock() - v.Ready = true - v.Unlock() - defer func() { - v.Lock() - v.Ready = false - v.Unlock() - }() - - var sequence uint16 - var timestamp uint32 - var recvbuf []byte - var ok bool - udpHeader := make([]byte, 12) - var nonce [24]byte - - // build the parts that don't change in the udpHeader - udpHeader[0] = 0x80 - udpHeader[1] = 0x78 - binary.BigEndian.PutUint32(udpHeader[8:], v.op2.SSRC) - - // start a send loop that loops until buf chan is closed - ticker := time.NewTicker(time.Millisecond * time.Duration(size/(rate/1000))) - defer ticker.Stop() - for { - - // Get data from chan. If chan is closed, return. - select { - case <-close: - return - case recvbuf, ok = <-opus: - if !ok { - return - } - // else, continue loop - } - - v.RLock() - speaking := v.speaking - v.RUnlock() - if !speaking { - err := v.Speaking(true) - if err != nil { - v.log(LogError, "error sending speaking packet, %s", err) - } - } - - // Add sequence and timestamp to udpPacket - binary.BigEndian.PutUint16(udpHeader[2:], sequence) - binary.BigEndian.PutUint32(udpHeader[4:], timestamp) - - // encrypt the opus data - copy(nonce[:], udpHeader) - v.RLock() - sendbuf := secretbox.Seal(udpHeader, recvbuf, &nonce, &v.op4.SecretKey) - v.RUnlock() - - // block here until we're exactly at the right time :) - // Then send rtp audio packet to Discord over UDP - select { - case <-close: - return - case <-ticker.C: - // continue - } - _, err := udpConn.Write(sendbuf) - - if err != nil { - v.log(LogError, "udp write error, %s", err) - v.log(LogDebug, "voice struct: %#v\n", v) - return - } - - if (sequence) == 0xFFFF { - sequence = 0 - } else { - sequence++ - } - - if (timestamp + uint32(size)) >= 0xFFFFFFFF { - timestamp = 0 - } else { - timestamp += uint32(size) - } - } -} - -// A Packet contains the headers and content of a received voice packet. -type Packet struct { - SSRC uint32 - Sequence uint16 - Timestamp uint32 - Type []byte - Opus []byte - PCM []int16 -} - -// opusReceiver listens on the UDP socket for incoming packets -// and sends them across the given channel -// NOTE :: This function may change names later. -func (v *VoiceConnection) opusReceiver(udpConn *net.UDPConn, close <-chan struct{}, c chan *Packet) { - - if udpConn == nil || close == nil { - return - } - - recvbuf := make([]byte, 1024) - var nonce [24]byte - - for { - rlen, err := udpConn.Read(recvbuf) - if err != nil { - // Detect if we have been closed manually. If a Close() has already - // happened, the udp connection we are listening on will be different - // to the current session. - v.RLock() - sameConnection := v.udpConn == udpConn - v.RUnlock() - if sameConnection { - - v.log(LogError, "udp read error, %s, %s", v.endpoint, err) - v.log(LogDebug, "voice struct: %#v\n", v) - - go v.reconnect() - } - return - } - - select { - case <-close: - return - default: - // continue loop - } - - // For now, skip anything except audio. - if rlen < 12 || (recvbuf[0] != 0x80 && recvbuf[0] != 0x90) { - continue - } - - // build a audio packet struct - p := Packet{} - p.Type = recvbuf[0:2] - p.Sequence = binary.BigEndian.Uint16(recvbuf[2:4]) - p.Timestamp = binary.BigEndian.Uint32(recvbuf[4:8]) - p.SSRC = binary.BigEndian.Uint32(recvbuf[8:12]) - // decrypt opus data - copy(nonce[:], recvbuf[0:12]) - p.Opus, _ = secretbox.Open(nil, recvbuf[12:rlen], &nonce, &v.op4.SecretKey) - - if len(p.Opus) > 8 && recvbuf[0] == 0x90 { - // Extension bit is set, first 8 bytes is the extended header - p.Opus = p.Opus[8:] - } - - if c != nil { - select { - case c <- &p: - case <-close: - return - } - } - } -} - -// Reconnect will close down a voice connection then immediately try to -// reconnect to that session. -// NOTE : This func is messy and a WIP while I find what works. -// It will be cleaned up once a proven stable option is flushed out. -// aka: this is ugly shit code, please don't judge too harshly. -func (v *VoiceConnection) reconnect() { - - v.log(LogInformational, "called") - - v.Lock() - if v.reconnecting { - v.log(LogInformational, "already reconnecting to channel %s, exiting", v.ChannelID) - v.Unlock() - return - } - v.reconnecting = true - v.Unlock() - - defer func() { v.reconnecting = false }() - - // Close any currently open connections - v.Close() - - wait := time.Duration(1) - for { - - <-time.After(wait * time.Second) - wait *= 2 - if wait > 600 { - wait = 600 - } - - if v.session.DataReady == false || v.session.wsConn == nil { - v.log(LogInformational, "cannot reconnect to channel %s with unready session", v.ChannelID) - continue - } - - v.log(LogInformational, "trying to reconnect to channel %s", v.ChannelID) - - _, err := v.session.ChannelVoiceJoin(v.GuildID, v.ChannelID, v.mute, v.deaf) - if err == nil { - v.log(LogInformational, "successfully reconnected to channel %s", v.ChannelID) - return - } - - v.log(LogInformational, "error reconnecting to channel %s, %s", v.ChannelID, err) - - // if the reconnect above didn't work lets just send a disconnect - // packet to reset things. - // Send a OP4 with a nil channel to disconnect - data := voiceChannelJoinOp{4, voiceChannelJoinData{&v.GuildID, nil, true, true}} - v.session.wsMutex.Lock() - err = v.session.wsConn.WriteJSON(data) - v.session.wsMutex.Unlock() - if err != nil { - v.log(LogError, "error sending disconnect packet, %s", err) - } - - } -} diff --git a/vendor/github.com/bwmarrin/discordgo/wsapi.go b/vendor/github.com/bwmarrin/discordgo/wsapi.go deleted file mode 100644 index de66f693..00000000 --- a/vendor/github.com/bwmarrin/discordgo/wsapi.go +++ /dev/null @@ -1,845 +0,0 @@ -// Discordgo - Discord bindings for Go -// Available at https://github.com/bwmarrin/discordgo - -// Copyright 2015-2016 Bruce Marriner . All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains low level functions for interacting with the Discord -// data websocket interface. - -package discordgo - -import ( - "bytes" - "compress/zlib" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "runtime" - "sync/atomic" - "time" - - "github.com/gorilla/websocket" -) - -// ErrWSAlreadyOpen is thrown when you attempt to open -// a websocket that already is open. -var ErrWSAlreadyOpen = errors.New("web socket already opened") - -// ErrWSNotFound is thrown when you attempt to use a websocket -// that doesn't exist -var ErrWSNotFound = errors.New("no websocket connection exists") - -// ErrWSShardBounds is thrown when you try to use a shard ID that is -// less than the total shard count -var ErrWSShardBounds = errors.New("ShardID must be less than ShardCount") - -type resumePacket struct { - Op int `json:"op"` - Data struct { - Token string `json:"token"` - SessionID string `json:"session_id"` - Sequence int64 `json:"seq"` - } `json:"d"` -} - -// Open creates a websocket connection to Discord. -// See: https://discordapp.com/developers/docs/topics/gateway#connecting -func (s *Session) Open() error { - s.log(LogInformational, "called") - - var err error - - // Prevent Open or other major Session functions from - // being called while Open is still running. - s.Lock() - defer s.Unlock() - - // If the websock is already open, bail out here. - if s.wsConn != nil { - return ErrWSAlreadyOpen - } - - // Get the gateway to use for the Websocket connection - if s.gateway == "" { - s.gateway, err = s.Gateway() - if err != nil { - return err - } - - // Add the version and encoding to the URL - s.gateway = s.gateway + "?v=" + APIVersion + "&encoding=json" - } - - // Connect to the Gateway - s.log(LogInformational, "connecting to gateway %s", s.gateway) - header := http.Header{} - header.Add("accept-encoding", "zlib") - s.wsConn, _, err = websocket.DefaultDialer.Dial(s.gateway, header) - if err != nil { - s.log(LogWarning, "error connecting to gateway %s, %s", s.gateway, err) - s.gateway = "" // clear cached gateway - s.wsConn = nil // Just to be safe. - return err - } - - defer func() { - // because of this, all code below must set err to the error - // when exiting with an error :) Maybe someone has a better - // way :) - if err != nil { - s.wsConn.Close() - s.wsConn = nil - } - }() - - // The first response from Discord should be an Op 10 (Hello) Packet. - // When processed by onEvent the heartbeat goroutine will be started. - mt, m, err := s.wsConn.ReadMessage() - if err != nil { - return err - } - e, err := s.onEvent(mt, m) - if err != nil { - return err - } - if e.Operation != 10 { - err = fmt.Errorf("expecting Op 10, got Op %d instead", e.Operation) - return err - } - s.log(LogInformational, "Op 10 Hello Packet received from Discord") - s.LastHeartbeatAck = time.Now().UTC() - var h helloOp - if err = json.Unmarshal(e.RawData, &h); err != nil { - err = fmt.Errorf("error unmarshalling helloOp, %s", err) - return err - } - - // Now we send either an Op 2 Identity if this is a brand new - // connection or Op 6 Resume if we are resuming an existing connection. - sequence := atomic.LoadInt64(s.sequence) - if s.sessionID == "" && sequence == 0 { - - // Send Op 2 Identity Packet - err = s.identify() - if err != nil { - err = fmt.Errorf("error sending identify packet to gateway, %s, %s", s.gateway, err) - return err - } - - } else { - - // Send Op 6 Resume Packet - p := resumePacket{} - p.Op = 6 - p.Data.Token = s.Token - p.Data.SessionID = s.sessionID - p.Data.Sequence = sequence - - s.log(LogInformational, "sending resume packet to gateway") - s.wsMutex.Lock() - err = s.wsConn.WriteJSON(p) - s.wsMutex.Unlock() - if err != nil { - err = fmt.Errorf("error sending gateway resume packet, %s, %s", s.gateway, err) - return err - } - - } - - // A basic state is a hard requirement for Voice. - // We create it here so the below READY/RESUMED packet can populate - // the state :) - // XXX: Move to New() func? - if s.State == nil { - state := NewState() - state.TrackChannels = false - state.TrackEmojis = false - state.TrackMembers = false - state.TrackRoles = false - state.TrackVoice = false - s.State = state - } - - // Now Discord should send us a READY or RESUMED packet. - mt, m, err = s.wsConn.ReadMessage() - if err != nil { - return err - } - e, err = s.onEvent(mt, m) - if err != nil { - return err - } - if e.Type != `READY` && e.Type != `RESUMED` { - // This is not fatal, but it does not follow their API documentation. - s.log(LogWarning, "Expected READY/RESUMED, instead got:\n%#v\n", e) - } - s.log(LogInformational, "First Packet:\n%#v\n", e) - - s.log(LogInformational, "We are now connected to Discord, emitting connect event") - s.handleEvent(connectEventType, &Connect{}) - - // A VoiceConnections map is a hard requirement for Voice. - // XXX: can this be moved to when opening a voice connection? - if s.VoiceConnections == nil { - s.log(LogInformational, "creating new VoiceConnections map") - s.VoiceConnections = make(map[string]*VoiceConnection) - } - - // Create listening chan outside of listen, as it needs to happen inside the - // mutex lock and needs to exist before calling heartbeat and listen - // go rountines. - s.listening = make(chan interface{}) - - // Start sending heartbeats and reading messages from Discord. - go s.heartbeat(s.wsConn, s.listening, h.HeartbeatInterval) - go s.listen(s.wsConn, s.listening) - - s.log(LogInformational, "exiting") - return nil -} - -// listen polls the websocket connection for events, it will stop when the -// listening channel is closed, or an error occurs. -func (s *Session) listen(wsConn *websocket.Conn, listening <-chan interface{}) { - - s.log(LogInformational, "called") - - for { - - messageType, message, err := wsConn.ReadMessage() - - if err != nil { - - // Detect if we have been closed manually. If a Close() has already - // happened, the websocket we are listening on will be different to - // the current session. - s.RLock() - sameConnection := s.wsConn == wsConn - s.RUnlock() - - if sameConnection { - - s.log(LogWarning, "error reading from gateway %s websocket, %s", s.gateway, err) - // There has been an error reading, close the websocket so that - // OnDisconnect event is emitted. - err := s.Close() - if err != nil { - s.log(LogWarning, "error closing session connection, %s", err) - } - - s.log(LogInformational, "calling reconnect() now") - s.reconnect() - } - - return - } - - select { - - case <-listening: - return - - default: - s.onEvent(messageType, message) - - } - } -} - -type heartbeatOp struct { - Op int `json:"op"` - Data int64 `json:"d"` -} - -type helloOp struct { - HeartbeatInterval time.Duration `json:"heartbeat_interval"` - Trace []string `json:"_trace"` -} - -// FailedHeartbeatAcks is the Number of heartbeat intervals to wait until forcing a connection restart. -const FailedHeartbeatAcks time.Duration = 5 * time.Millisecond - -// heartbeat sends regular heartbeats to Discord so it knows the client -// is still connected. If you do not send these heartbeats Discord will -// disconnect the websocket connection after a few seconds. -func (s *Session) heartbeat(wsConn *websocket.Conn, listening <-chan interface{}, heartbeatIntervalMsec time.Duration) { - - s.log(LogInformational, "called") - - if listening == nil || wsConn == nil { - return - } - - var err error - ticker := time.NewTicker(heartbeatIntervalMsec * time.Millisecond) - defer ticker.Stop() - - for { - s.RLock() - last := s.LastHeartbeatAck - s.RUnlock() - sequence := atomic.LoadInt64(s.sequence) - s.log(LogInformational, "sending gateway websocket heartbeat seq %d", sequence) - s.wsMutex.Lock() - err = wsConn.WriteJSON(heartbeatOp{1, sequence}) - s.wsMutex.Unlock() - if err != nil || time.Now().UTC().Sub(last) > (heartbeatIntervalMsec*FailedHeartbeatAcks) { - if err != nil { - s.log(LogError, "error sending heartbeat to gateway %s, %s", s.gateway, err) - } else { - s.log(LogError, "haven't gotten a heartbeat ACK in %v, triggering a reconnection", time.Now().UTC().Sub(last)) - } - s.Close() - s.reconnect() - return - } - s.Lock() - s.DataReady = true - s.Unlock() - - select { - case <-ticker.C: - // continue loop and send heartbeat - case <-listening: - return - } - } -} - -// UpdateStatusData ia provided to UpdateStatusComplex() -type UpdateStatusData struct { - IdleSince *int `json:"since"` - Game *Game `json:"game"` - AFK bool `json:"afk"` - Status string `json:"status"` -} - -type updateStatusOp struct { - Op int `json:"op"` - Data UpdateStatusData `json:"d"` -} - -// UpdateStreamingStatus is used to update the user's streaming status. -// If idle>0 then set status to idle. -// If game!="" then set game. -// If game!="" and url!="" then set the status type to streaming with the URL set. -// if otherwise, set status to active, and no game. -func (s *Session) UpdateStreamingStatus(idle int, game string, url string) (err error) { - - s.log(LogInformational, "called") - - usd := UpdateStatusData{ - Status: "online", - } - - if idle > 0 { - usd.IdleSince = &idle - } - - if game != "" { - gameType := GameTypeGame - if url != "" { - gameType = GameTypeStreaming - } - usd.Game = &Game{ - Name: game, - Type: gameType, - URL: url, - } - } - - return s.UpdateStatusComplex(usd) -} - -// UpdateStatusComplex allows for sending the raw status update data untouched by discordgo. -func (s *Session) UpdateStatusComplex(usd UpdateStatusData) (err error) { - - s.RLock() - defer s.RUnlock() - if s.wsConn == nil { - return ErrWSNotFound - } - - s.wsMutex.Lock() - err = s.wsConn.WriteJSON(updateStatusOp{3, usd}) - s.wsMutex.Unlock() - - return -} - -// UpdateStatus is used to update the user's status. -// If idle>0 then set status to idle. -// If game!="" then set game. -// if otherwise, set status to active, and no game. -func (s *Session) UpdateStatus(idle int, game string) (err error) { - return s.UpdateStreamingStatus(idle, game, "") -} - -type requestGuildMembersData struct { - GuildID string `json:"guild_id"` - Query string `json:"query"` - Limit int `json:"limit"` -} - -type requestGuildMembersOp struct { - Op int `json:"op"` - Data requestGuildMembersData `json:"d"` -} - -// RequestGuildMembers requests guild members from the gateway -// The gateway responds with GuildMembersChunk events -// guildID : The ID of the guild to request members of -// query : String that username starts with, leave empty to return all members -// limit : Max number of items to return, or 0 to request all members matched -func (s *Session) RequestGuildMembers(guildID, query string, limit int) (err error) { - s.log(LogInformational, "called") - - s.RLock() - defer s.RUnlock() - if s.wsConn == nil { - return ErrWSNotFound - } - - data := requestGuildMembersData{ - GuildID: guildID, - Query: query, - Limit: limit, - } - - s.wsMutex.Lock() - err = s.wsConn.WriteJSON(requestGuildMembersOp{8, data}) - s.wsMutex.Unlock() - - return -} - -// onEvent is the "event handler" for all messages received on the -// Discord Gateway API websocket connection. -// -// If you use the AddHandler() function to register a handler for a -// specific event this function will pass the event along to that handler. -// -// If you use the AddHandler() function to register a handler for the -// "OnEvent" event then all events will be passed to that handler. -func (s *Session) onEvent(messageType int, message []byte) (*Event, error) { - - var err error - var reader io.Reader - reader = bytes.NewBuffer(message) - - // If this is a compressed message, uncompress it. - if messageType == websocket.BinaryMessage { - - z, err2 := zlib.NewReader(reader) - if err2 != nil { - s.log(LogError, "error uncompressing websocket message, %s", err) - return nil, err2 - } - - defer func() { - err3 := z.Close() - if err3 != nil { - s.log(LogWarning, "error closing zlib, %s", err) - } - }() - - reader = z - } - - // Decode the event into an Event struct. - var e *Event - decoder := json.NewDecoder(reader) - if err = decoder.Decode(&e); err != nil { - s.log(LogError, "error decoding websocket message, %s", err) - return e, err - } - - s.log(LogDebug, "Op: %d, Seq: %d, Type: %s, Data: %s\n\n", e.Operation, e.Sequence, e.Type, string(e.RawData)) - - // Ping request. - // Must respond with a heartbeat packet within 5 seconds - if e.Operation == 1 { - s.log(LogInformational, "sending heartbeat in response to Op1") - s.wsMutex.Lock() - err = s.wsConn.WriteJSON(heartbeatOp{1, atomic.LoadInt64(s.sequence)}) - s.wsMutex.Unlock() - if err != nil { - s.log(LogError, "error sending heartbeat in response to Op1") - return e, err - } - - return e, nil - } - - // Reconnect - // Must immediately disconnect from gateway and reconnect to new gateway. - if e.Operation == 7 { - s.log(LogInformational, "Closing and reconnecting in response to Op7") - s.Close() - s.reconnect() - return e, nil - } - - // Invalid Session - // Must respond with a Identify packet. - if e.Operation == 9 { - - s.log(LogInformational, "sending identify packet to gateway in response to Op9") - - err = s.identify() - if err != nil { - s.log(LogWarning, "error sending gateway identify packet, %s, %s", s.gateway, err) - return e, err - } - - return e, nil - } - - if e.Operation == 10 { - // Op10 is handled by Open() - return e, nil - } - - if e.Operation == 11 { - s.Lock() - s.LastHeartbeatAck = time.Now().UTC() - s.Unlock() - s.log(LogInformational, "got heartbeat ACK") - return e, nil - } - - // Do not try to Dispatch a non-Dispatch Message - if e.Operation != 0 { - // But we probably should be doing something with them. - // TEMP - s.log(LogWarning, "unknown Op: %d, Seq: %d, Type: %s, Data: %s, message: %s", e.Operation, e.Sequence, e.Type, string(e.RawData), string(message)) - return e, nil - } - - // Store the message sequence - atomic.StoreInt64(s.sequence, e.Sequence) - - // Map event to registered event handlers and pass it along to any registered handlers. - if eh, ok := registeredInterfaceProviders[e.Type]; ok { - e.Struct = eh.New() - - // Attempt to unmarshal our event. - if err = json.Unmarshal(e.RawData, e.Struct); err != nil { - s.log(LogError, "error unmarshalling %s event, %s", e.Type, err) - } - - // Send event to any registered event handlers for it's type. - // Because the above doesn't cancel this, in case of an error - // the struct could be partially populated or at default values. - // However, most errors are due to a single field and I feel - // it's better to pass along what we received than nothing at all. - // TODO: Think about that decision :) - // Either way, READY events must fire, even with errors. - s.handleEvent(e.Type, e.Struct) - } else { - s.log(LogWarning, "unknown event: Op: %d, Seq: %d, Type: %s, Data: %s", e.Operation, e.Sequence, e.Type, string(e.RawData)) - } - - // For legacy reasons, we send the raw event also, this could be useful for handling unknown events. - s.handleEvent(eventEventType, e) - - return e, nil -} - -// ------------------------------------------------------------------------------------------------ -// Code related to voice connections that initiate over the data websocket -// ------------------------------------------------------------------------------------------------ - -type voiceChannelJoinData struct { - GuildID *string `json:"guild_id"` - ChannelID *string `json:"channel_id"` - SelfMute bool `json:"self_mute"` - SelfDeaf bool `json:"self_deaf"` -} - -type voiceChannelJoinOp struct { - Op int `json:"op"` - Data voiceChannelJoinData `json:"d"` -} - -// ChannelVoiceJoin joins the session user to a voice channel. -// -// gID : Guild ID of the channel to join. -// cID : Channel ID of the channel to join. -// mute : If true, you will be set to muted upon joining. -// deaf : If true, you will be set to deafened upon joining. -func (s *Session) ChannelVoiceJoin(gID, cID string, mute, deaf bool) (voice *VoiceConnection, err error) { - - s.log(LogInformational, "called") - - s.RLock() - voice, _ = s.VoiceConnections[gID] - s.RUnlock() - - if voice == nil { - voice = &VoiceConnection{} - s.Lock() - s.VoiceConnections[gID] = voice - s.Unlock() - } - - voice.Lock() - voice.GuildID = gID - voice.ChannelID = cID - voice.deaf = deaf - voice.mute = mute - voice.session = s - voice.Unlock() - - // Send the request to Discord that we want to join the voice channel - data := voiceChannelJoinOp{4, voiceChannelJoinData{&gID, &cID, mute, deaf}} - s.wsMutex.Lock() - err = s.wsConn.WriteJSON(data) - s.wsMutex.Unlock() - if err != nil { - return - } - - // doesn't exactly work perfect yet.. TODO - err = voice.waitUntilConnected() - if err != nil { - s.log(LogWarning, "error waiting for voice to connect, %s", err) - voice.Close() - return - } - - return -} - -// onVoiceStateUpdate handles Voice State Update events on the data websocket. -func (s *Session) onVoiceStateUpdate(st *VoiceStateUpdate) { - - // If we don't have a connection for the channel, don't bother - if st.ChannelID == "" { - return - } - - // Check if we have a voice connection to update - s.RLock() - voice, exists := s.VoiceConnections[st.GuildID] - s.RUnlock() - if !exists { - return - } - - // We only care about events that are about us. - if s.State.User.ID != st.UserID { - return - } - - // Store the SessionID for later use. - voice.Lock() - voice.UserID = st.UserID - voice.sessionID = st.SessionID - voice.ChannelID = st.ChannelID - voice.Unlock() -} - -// onVoiceServerUpdate handles the Voice Server Update data websocket event. -// -// This is also fired if the Guild's voice region changes while connected -// to a voice channel. In that case, need to re-establish connection to -// the new region endpoint. -func (s *Session) onVoiceServerUpdate(st *VoiceServerUpdate) { - - s.log(LogInformational, "called") - - s.RLock() - voice, exists := s.VoiceConnections[st.GuildID] - s.RUnlock() - - // If no VoiceConnection exists, just skip this - if !exists { - return - } - - // If currently connected to voice ws/udp, then disconnect. - // Has no effect if not connected. - voice.Close() - - // Store values for later use - voice.Lock() - voice.token = st.Token - voice.endpoint = st.Endpoint - voice.GuildID = st.GuildID - voice.Unlock() - - // Open a connection to the voice server - err := voice.open() - if err != nil { - s.log(LogError, "onVoiceServerUpdate voice.open, %s", err) - } -} - -type identifyProperties struct { - OS string `json:"$os"` - Browser string `json:"$browser"` - Device string `json:"$device"` - Referer string `json:"$referer"` - ReferringDomain string `json:"$referring_domain"` -} - -type identifyData struct { - Token string `json:"token"` - Properties identifyProperties `json:"properties"` - LargeThreshold int `json:"large_threshold"` - Compress bool `json:"compress"` - Shard *[2]int `json:"shard,omitempty"` -} - -type identifyOp struct { - Op int `json:"op"` - Data identifyData `json:"d"` -} - -// identify sends the identify packet to the gateway -func (s *Session) identify() error { - - properties := identifyProperties{runtime.GOOS, - "Discordgo v" + VERSION, - "", - "", - "", - } - - data := identifyData{s.Token, - properties, - 250, - s.Compress, - nil, - } - - if s.ShardCount > 1 { - - if s.ShardID >= s.ShardCount { - return ErrWSShardBounds - } - - data.Shard = &[2]int{s.ShardID, s.ShardCount} - } - - op := identifyOp{2, data} - - s.wsMutex.Lock() - err := s.wsConn.WriteJSON(op) - s.wsMutex.Unlock() - if err != nil { - return err - } - - return nil -} - -func (s *Session) reconnect() { - - s.log(LogInformational, "called") - - var err error - - if s.ShouldReconnectOnError { - - wait := time.Duration(1) - - for { - s.log(LogInformational, "trying to reconnect to gateway") - - err = s.Open() - if err == nil { - s.log(LogInformational, "successfully reconnected to gateway") - - // I'm not sure if this is actually needed. - // if the gw reconnect works properly, voice should stay alive - // However, there seems to be cases where something "weird" - // happens. So we're doing this for now just to improve - // stability in those edge cases. - s.RLock() - defer s.RUnlock() - for _, v := range s.VoiceConnections { - - s.log(LogInformational, "reconnecting voice connection to guild %s", v.GuildID) - go v.reconnect() - - // This is here just to prevent violently spamming the - // voice reconnects - time.Sleep(1 * time.Second) - - } - return - } - - // Certain race conditions can call reconnect() twice. If this happens, we - // just break out of the reconnect loop - if err == ErrWSAlreadyOpen { - s.log(LogInformational, "Websocket already exists, no need to reconnect") - return - } - - s.log(LogError, "error reconnecting to gateway, %s", err) - - <-time.After(wait * time.Second) - wait *= 2 - if wait > 600 { - wait = 600 - } - } - } -} - -// Close closes a websocket and stops all listening/heartbeat goroutines. -// TODO: Add support for Voice WS/UDP connections -func (s *Session) Close() (err error) { - - s.log(LogInformational, "called") - s.Lock() - - s.DataReady = false - - if s.listening != nil { - s.log(LogInformational, "closing listening channel") - close(s.listening) - s.listening = nil - } - - // TODO: Close all active Voice Connections too - // this should force stop any reconnecting voice channels too - - if s.wsConn != nil { - - s.log(LogInformational, "sending close frame") - // To cleanly close a connection, a client should send a close - // frame and wait for the server to close the connection. - s.wsMutex.Lock() - err := s.wsConn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) - s.wsMutex.Unlock() - if err != nil { - s.log(LogInformational, "error closing websocket, %s", err) - } - - // TODO: Wait for Discord to actually close the connection. - time.Sleep(1 * time.Second) - - s.log(LogInformational, "closing gateway websocket") - err = s.wsConn.Close() - if err != nil { - s.log(LogInformational, "error closing websocket, %s", err) - } - - s.wsConn = nil - } - - s.Unlock() - - s.log(LogInformational, "emit disconnect event") - s.handleEvent(disconnectEventType, &Disconnect{}) - - return -} diff --git a/vendor/github.com/coreos/etcd/client/LICENSE b/vendor/github.com/coreos/etcd/client/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/client/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/client/auth_role.go b/vendor/github.com/coreos/etcd/client/auth_role.go deleted file mode 100644 index b6ba7e15..00000000 --- a/vendor/github.com/coreos/etcd/client/auth_role.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "bytes" - "context" - "encoding/json" - "net/http" - "net/url" -) - -type Role struct { - Role string `json:"role"` - Permissions Permissions `json:"permissions"` - Grant *Permissions `json:"grant,omitempty"` - Revoke *Permissions `json:"revoke,omitempty"` -} - -type Permissions struct { - KV rwPermission `json:"kv"` -} - -type rwPermission struct { - Read []string `json:"read"` - Write []string `json:"write"` -} - -type PermissionType int - -const ( - ReadPermission PermissionType = iota - WritePermission - ReadWritePermission -) - -// NewAuthRoleAPI constructs a new AuthRoleAPI that uses HTTP to -// interact with etcd's role creation and modification features. -func NewAuthRoleAPI(c Client) AuthRoleAPI { - return &httpAuthRoleAPI{ - client: c, - } -} - -type AuthRoleAPI interface { - // AddRole adds a role. - AddRole(ctx context.Context, role string) error - - // RemoveRole removes a role. - RemoveRole(ctx context.Context, role string) error - - // GetRole retrieves role details. - GetRole(ctx context.Context, role string) (*Role, error) - - // GrantRoleKV grants a role some permission prefixes for the KV store. - GrantRoleKV(ctx context.Context, role string, prefixes []string, permType PermissionType) (*Role, error) - - // RevokeRoleKV revokes some permission prefixes for a role on the KV store. - RevokeRoleKV(ctx context.Context, role string, prefixes []string, permType PermissionType) (*Role, error) - - // ListRoles lists roles. - ListRoles(ctx context.Context) ([]string, error) -} - -type httpAuthRoleAPI struct { - client httpClient -} - -type authRoleAPIAction struct { - verb string - name string - role *Role -} - -type authRoleAPIList struct{} - -func (list *authRoleAPIList) HTTPRequest(ep url.URL) *http.Request { - u := v2AuthURL(ep, "roles", "") - req, _ := http.NewRequest("GET", u.String(), nil) - req.Header.Set("Content-Type", "application/json") - return req -} - -func (l *authRoleAPIAction) HTTPRequest(ep url.URL) *http.Request { - u := v2AuthURL(ep, "roles", l.name) - if l.role == nil { - req, _ := http.NewRequest(l.verb, u.String(), nil) - return req - } - b, err := json.Marshal(l.role) - if err != nil { - panic(err) - } - body := bytes.NewReader(b) - req, _ := http.NewRequest(l.verb, u.String(), body) - req.Header.Set("Content-Type", "application/json") - return req -} - -func (r *httpAuthRoleAPI) ListRoles(ctx context.Context) ([]string, error) { - resp, body, err := r.client.Do(ctx, &authRoleAPIList{}) - if err != nil { - return nil, err - } - if err = assertStatusCode(resp.StatusCode, http.StatusOK); err != nil { - return nil, err - } - var roleList struct { - Roles []Role `json:"roles"` - } - if err = json.Unmarshal(body, &roleList); err != nil { - return nil, err - } - ret := make([]string, 0, len(roleList.Roles)) - for _, r := range roleList.Roles { - ret = append(ret, r.Role) - } - return ret, nil -} - -func (r *httpAuthRoleAPI) AddRole(ctx context.Context, rolename string) error { - role := &Role{ - Role: rolename, - } - return r.addRemoveRole(ctx, &authRoleAPIAction{ - verb: "PUT", - name: rolename, - role: role, - }) -} - -func (r *httpAuthRoleAPI) RemoveRole(ctx context.Context, rolename string) error { - return r.addRemoveRole(ctx, &authRoleAPIAction{ - verb: "DELETE", - name: rolename, - }) -} - -func (r *httpAuthRoleAPI) addRemoveRole(ctx context.Context, req *authRoleAPIAction) error { - resp, body, err := r.client.Do(ctx, req) - if err != nil { - return err - } - if err := assertStatusCode(resp.StatusCode, http.StatusOK, http.StatusCreated); err != nil { - var sec authError - err := json.Unmarshal(body, &sec) - if err != nil { - return err - } - return sec - } - return nil -} - -func (r *httpAuthRoleAPI) GetRole(ctx context.Context, rolename string) (*Role, error) { - return r.modRole(ctx, &authRoleAPIAction{ - verb: "GET", - name: rolename, - }) -} - -func buildRWPermission(prefixes []string, permType PermissionType) rwPermission { - var out rwPermission - switch permType { - case ReadPermission: - out.Read = prefixes - case WritePermission: - out.Write = prefixes - case ReadWritePermission: - out.Read = prefixes - out.Write = prefixes - } - return out -} - -func (r *httpAuthRoleAPI) GrantRoleKV(ctx context.Context, rolename string, prefixes []string, permType PermissionType) (*Role, error) { - rwp := buildRWPermission(prefixes, permType) - role := &Role{ - Role: rolename, - Grant: &Permissions{ - KV: rwp, - }, - } - return r.modRole(ctx, &authRoleAPIAction{ - verb: "PUT", - name: rolename, - role: role, - }) -} - -func (r *httpAuthRoleAPI) RevokeRoleKV(ctx context.Context, rolename string, prefixes []string, permType PermissionType) (*Role, error) { - rwp := buildRWPermission(prefixes, permType) - role := &Role{ - Role: rolename, - Revoke: &Permissions{ - KV: rwp, - }, - } - return r.modRole(ctx, &authRoleAPIAction{ - verb: "PUT", - name: rolename, - role: role, - }) -} - -func (r *httpAuthRoleAPI) modRole(ctx context.Context, req *authRoleAPIAction) (*Role, error) { - resp, body, err := r.client.Do(ctx, req) - if err != nil { - return nil, err - } - if err = assertStatusCode(resp.StatusCode, http.StatusOK); err != nil { - var sec authError - err = json.Unmarshal(body, &sec) - if err != nil { - return nil, err - } - return nil, sec - } - var role Role - if err = json.Unmarshal(body, &role); err != nil { - return nil, err - } - return &role, nil -} diff --git a/vendor/github.com/coreos/etcd/client/auth_user.go b/vendor/github.com/coreos/etcd/client/auth_user.go deleted file mode 100644 index 8e7e2efe..00000000 --- a/vendor/github.com/coreos/etcd/client/auth_user.go +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "bytes" - "context" - "encoding/json" - "net/http" - "net/url" - "path" -) - -var ( - defaultV2AuthPrefix = "/v2/auth" -) - -type User struct { - User string `json:"user"` - Password string `json:"password,omitempty"` - Roles []string `json:"roles"` - Grant []string `json:"grant,omitempty"` - Revoke []string `json:"revoke,omitempty"` -} - -// userListEntry is the user representation given by the server for ListUsers -type userListEntry struct { - User string `json:"user"` - Roles []Role `json:"roles"` -} - -type UserRoles struct { - User string `json:"user"` - Roles []Role `json:"roles"` -} - -func v2AuthURL(ep url.URL, action string, name string) *url.URL { - if name != "" { - ep.Path = path.Join(ep.Path, defaultV2AuthPrefix, action, name) - return &ep - } - ep.Path = path.Join(ep.Path, defaultV2AuthPrefix, action) - return &ep -} - -// NewAuthAPI constructs a new AuthAPI that uses HTTP to -// interact with etcd's general auth features. -func NewAuthAPI(c Client) AuthAPI { - return &httpAuthAPI{ - client: c, - } -} - -type AuthAPI interface { - // Enable auth. - Enable(ctx context.Context) error - - // Disable auth. - Disable(ctx context.Context) error -} - -type httpAuthAPI struct { - client httpClient -} - -func (s *httpAuthAPI) Enable(ctx context.Context) error { - return s.enableDisable(ctx, &authAPIAction{"PUT"}) -} - -func (s *httpAuthAPI) Disable(ctx context.Context) error { - return s.enableDisable(ctx, &authAPIAction{"DELETE"}) -} - -func (s *httpAuthAPI) enableDisable(ctx context.Context, req httpAction) error { - resp, body, err := s.client.Do(ctx, req) - if err != nil { - return err - } - if err = assertStatusCode(resp.StatusCode, http.StatusOK, http.StatusCreated); err != nil { - var sec authError - err = json.Unmarshal(body, &sec) - if err != nil { - return err - } - return sec - } - return nil -} - -type authAPIAction struct { - verb string -} - -func (l *authAPIAction) HTTPRequest(ep url.URL) *http.Request { - u := v2AuthURL(ep, "enable", "") - req, _ := http.NewRequest(l.verb, u.String(), nil) - return req -} - -type authError struct { - Message string `json:"message"` - Code int `json:"-"` -} - -func (e authError) Error() string { - return e.Message -} - -// NewAuthUserAPI constructs a new AuthUserAPI that uses HTTP to -// interact with etcd's user creation and modification features. -func NewAuthUserAPI(c Client) AuthUserAPI { - return &httpAuthUserAPI{ - client: c, - } -} - -type AuthUserAPI interface { - // AddUser adds a user. - AddUser(ctx context.Context, username string, password string) error - - // RemoveUser removes a user. - RemoveUser(ctx context.Context, username string) error - - // GetUser retrieves user details. - GetUser(ctx context.Context, username string) (*User, error) - - // GrantUser grants a user some permission roles. - GrantUser(ctx context.Context, username string, roles []string) (*User, error) - - // RevokeUser revokes some permission roles from a user. - RevokeUser(ctx context.Context, username string, roles []string) (*User, error) - - // ChangePassword changes the user's password. - ChangePassword(ctx context.Context, username string, password string) (*User, error) - - // ListUsers lists the users. - ListUsers(ctx context.Context) ([]string, error) -} - -type httpAuthUserAPI struct { - client httpClient -} - -type authUserAPIAction struct { - verb string - username string - user *User -} - -type authUserAPIList struct{} - -func (list *authUserAPIList) HTTPRequest(ep url.URL) *http.Request { - u := v2AuthURL(ep, "users", "") - req, _ := http.NewRequest("GET", u.String(), nil) - req.Header.Set("Content-Type", "application/json") - return req -} - -func (l *authUserAPIAction) HTTPRequest(ep url.URL) *http.Request { - u := v2AuthURL(ep, "users", l.username) - if l.user == nil { - req, _ := http.NewRequest(l.verb, u.String(), nil) - return req - } - b, err := json.Marshal(l.user) - if err != nil { - panic(err) - } - body := bytes.NewReader(b) - req, _ := http.NewRequest(l.verb, u.String(), body) - req.Header.Set("Content-Type", "application/json") - return req -} - -func (u *httpAuthUserAPI) ListUsers(ctx context.Context) ([]string, error) { - resp, body, err := u.client.Do(ctx, &authUserAPIList{}) - if err != nil { - return nil, err - } - if err = assertStatusCode(resp.StatusCode, http.StatusOK); err != nil { - var sec authError - err = json.Unmarshal(body, &sec) - if err != nil { - return nil, err - } - return nil, sec - } - - var userList struct { - Users []userListEntry `json:"users"` - } - - if err = json.Unmarshal(body, &userList); err != nil { - return nil, err - } - - ret := make([]string, 0, len(userList.Users)) - for _, u := range userList.Users { - ret = append(ret, u.User) - } - return ret, nil -} - -func (u *httpAuthUserAPI) AddUser(ctx context.Context, username string, password string) error { - user := &User{ - User: username, - Password: password, - } - return u.addRemoveUser(ctx, &authUserAPIAction{ - verb: "PUT", - username: username, - user: user, - }) -} - -func (u *httpAuthUserAPI) RemoveUser(ctx context.Context, username string) error { - return u.addRemoveUser(ctx, &authUserAPIAction{ - verb: "DELETE", - username: username, - }) -} - -func (u *httpAuthUserAPI) addRemoveUser(ctx context.Context, req *authUserAPIAction) error { - resp, body, err := u.client.Do(ctx, req) - if err != nil { - return err - } - if err = assertStatusCode(resp.StatusCode, http.StatusOK, http.StatusCreated); err != nil { - var sec authError - err = json.Unmarshal(body, &sec) - if err != nil { - return err - } - return sec - } - return nil -} - -func (u *httpAuthUserAPI) GetUser(ctx context.Context, username string) (*User, error) { - return u.modUser(ctx, &authUserAPIAction{ - verb: "GET", - username: username, - }) -} - -func (u *httpAuthUserAPI) GrantUser(ctx context.Context, username string, roles []string) (*User, error) { - user := &User{ - User: username, - Grant: roles, - } - return u.modUser(ctx, &authUserAPIAction{ - verb: "PUT", - username: username, - user: user, - }) -} - -func (u *httpAuthUserAPI) RevokeUser(ctx context.Context, username string, roles []string) (*User, error) { - user := &User{ - User: username, - Revoke: roles, - } - return u.modUser(ctx, &authUserAPIAction{ - verb: "PUT", - username: username, - user: user, - }) -} - -func (u *httpAuthUserAPI) ChangePassword(ctx context.Context, username string, password string) (*User, error) { - user := &User{ - User: username, - Password: password, - } - return u.modUser(ctx, &authUserAPIAction{ - verb: "PUT", - username: username, - user: user, - }) -} - -func (u *httpAuthUserAPI) modUser(ctx context.Context, req *authUserAPIAction) (*User, error) { - resp, body, err := u.client.Do(ctx, req) - if err != nil { - return nil, err - } - if err = assertStatusCode(resp.StatusCode, http.StatusOK); err != nil { - var sec authError - err = json.Unmarshal(body, &sec) - if err != nil { - return nil, err - } - return nil, sec - } - var user User - if err = json.Unmarshal(body, &user); err != nil { - var userR UserRoles - if urerr := json.Unmarshal(body, &userR); urerr != nil { - return nil, err - } - user.User = userR.User - for _, r := range userR.Roles { - user.Roles = append(user.Roles, r.Role) - } - } - return &user, nil -} diff --git a/vendor/github.com/coreos/etcd/client/cancelreq.go b/vendor/github.com/coreos/etcd/client/cancelreq.go deleted file mode 100644 index 76d1f040..00000000 --- a/vendor/github.com/coreos/etcd/client/cancelreq.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// borrowed from golang/net/context/ctxhttp/cancelreq.go - -package client - -import "net/http" - -func requestCanceler(tr CancelableTransport, req *http.Request) func() { - ch := make(chan struct{}) - req.Cancel = ch - - return func() { - close(ch) - } -} diff --git a/vendor/github.com/coreos/etcd/client/client.go b/vendor/github.com/coreos/etcd/client/client.go deleted file mode 100644 index e6874505..00000000 --- a/vendor/github.com/coreos/etcd/client/client.go +++ /dev/null @@ -1,710 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "math/rand" - "net" - "net/http" - "net/url" - "sort" - "strconv" - "sync" - "time" - - "github.com/coreos/etcd/version" -) - -var ( - ErrNoEndpoints = errors.New("client: no endpoints available") - ErrTooManyRedirects = errors.New("client: too many redirects") - ErrClusterUnavailable = errors.New("client: etcd cluster is unavailable or misconfigured") - ErrNoLeaderEndpoint = errors.New("client: no leader endpoint available") - errTooManyRedirectChecks = errors.New("client: too many redirect checks") - - // oneShotCtxValue is set on a context using WithValue(&oneShotValue) so - // that Do() will not retry a request - oneShotCtxValue interface{} -) - -var DefaultRequestTimeout = 5 * time.Second - -var DefaultTransport CancelableTransport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - TLSHandshakeTimeout: 10 * time.Second, -} - -type EndpointSelectionMode int - -const ( - // EndpointSelectionRandom is the default value of the 'SelectionMode'. - // As the name implies, the client object will pick a node from the members - // of the cluster in a random fashion. If the cluster has three members, A, B, - // and C, the client picks any node from its three members as its request - // destination. - EndpointSelectionRandom EndpointSelectionMode = iota - - // If 'SelectionMode' is set to 'EndpointSelectionPrioritizeLeader', - // requests are sent directly to the cluster leader. This reduces - // forwarding roundtrips compared to making requests to etcd followers - // who then forward them to the cluster leader. In the event of a leader - // failure, however, clients configured this way cannot prioritize among - // the remaining etcd followers. Therefore, when a client sets 'SelectionMode' - // to 'EndpointSelectionPrioritizeLeader', it must use 'client.AutoSync()' to - // maintain its knowledge of current cluster state. - // - // This mode should be used with Client.AutoSync(). - EndpointSelectionPrioritizeLeader -) - -type Config struct { - // Endpoints defines a set of URLs (schemes, hosts and ports only) - // that can be used to communicate with a logical etcd cluster. For - // example, a three-node cluster could be provided like so: - // - // Endpoints: []string{ - // "http://node1.example.com:2379", - // "http://node2.example.com:2379", - // "http://node3.example.com:2379", - // } - // - // If multiple endpoints are provided, the Client will attempt to - // use them all in the event that one or more of them are unusable. - // - // If Client.Sync is ever called, the Client may cache an alternate - // set of endpoints to continue operation. - Endpoints []string - - // Transport is used by the Client to drive HTTP requests. If not - // provided, DefaultTransport will be used. - Transport CancelableTransport - - // CheckRedirect specifies the policy for handling HTTP redirects. - // If CheckRedirect is not nil, the Client calls it before - // following an HTTP redirect. The sole argument is the number of - // requests that have already been made. If CheckRedirect returns - // an error, Client.Do will not make any further requests and return - // the error back it to the caller. - // - // If CheckRedirect is nil, the Client uses its default policy, - // which is to stop after 10 consecutive requests. - CheckRedirect CheckRedirectFunc - - // Username specifies the user credential to add as an authorization header - Username string - - // Password is the password for the specified user to add as an authorization header - // to the request. - Password string - - // HeaderTimeoutPerRequest specifies the time limit to wait for response - // header in a single request made by the Client. The timeout includes - // connection time, any redirects, and header wait time. - // - // For non-watch GET request, server returns the response body immediately. - // For PUT/POST/DELETE request, server will attempt to commit request - // before responding, which is expected to take `100ms + 2 * RTT`. - // For watch request, server returns the header immediately to notify Client - // watch start. But if server is behind some kind of proxy, the response - // header may be cached at proxy, and Client cannot rely on this behavior. - // - // Especially, wait request will ignore this timeout. - // - // One API call may send multiple requests to different etcd servers until it - // succeeds. Use context of the API to specify the overall timeout. - // - // A HeaderTimeoutPerRequest of zero means no timeout. - HeaderTimeoutPerRequest time.Duration - - // SelectionMode is an EndpointSelectionMode enum that specifies the - // policy for choosing the etcd cluster node to which requests are sent. - SelectionMode EndpointSelectionMode -} - -func (cfg *Config) transport() CancelableTransport { - if cfg.Transport == nil { - return DefaultTransport - } - return cfg.Transport -} - -func (cfg *Config) checkRedirect() CheckRedirectFunc { - if cfg.CheckRedirect == nil { - return DefaultCheckRedirect - } - return cfg.CheckRedirect -} - -// CancelableTransport mimics net/http.Transport, but requires that -// the object also support request cancellation. -type CancelableTransport interface { - http.RoundTripper - CancelRequest(req *http.Request) -} - -type CheckRedirectFunc func(via int) error - -// DefaultCheckRedirect follows up to 10 redirects, but no more. -var DefaultCheckRedirect CheckRedirectFunc = func(via int) error { - if via > 10 { - return ErrTooManyRedirects - } - return nil -} - -type Client interface { - // Sync updates the internal cache of the etcd cluster's membership. - Sync(context.Context) error - - // AutoSync periodically calls Sync() every given interval. - // The recommended sync interval is 10 seconds to 1 minute, which does - // not bring too much overhead to server and makes client catch up the - // cluster change in time. - // - // The example to use it: - // - // for { - // err := client.AutoSync(ctx, 10*time.Second) - // if err == context.DeadlineExceeded || err == context.Canceled { - // break - // } - // log.Print(err) - // } - AutoSync(context.Context, time.Duration) error - - // Endpoints returns a copy of the current set of API endpoints used - // by Client to resolve HTTP requests. If Sync has ever been called, - // this may differ from the initial Endpoints provided in the Config. - Endpoints() []string - - // SetEndpoints sets the set of API endpoints used by Client to resolve - // HTTP requests. If the given endpoints are not valid, an error will be - // returned - SetEndpoints(eps []string) error - - // GetVersion retrieves the current etcd server and cluster version - GetVersion(ctx context.Context) (*version.Versions, error) - - httpClient -} - -func New(cfg Config) (Client, error) { - c := &httpClusterClient{ - clientFactory: newHTTPClientFactory(cfg.transport(), cfg.checkRedirect(), cfg.HeaderTimeoutPerRequest), - rand: rand.New(rand.NewSource(int64(time.Now().Nanosecond()))), - selectionMode: cfg.SelectionMode, - } - if cfg.Username != "" { - c.credentials = &credentials{ - username: cfg.Username, - password: cfg.Password, - } - } - if err := c.SetEndpoints(cfg.Endpoints); err != nil { - return nil, err - } - return c, nil -} - -type httpClient interface { - Do(context.Context, httpAction) (*http.Response, []byte, error) -} - -func newHTTPClientFactory(tr CancelableTransport, cr CheckRedirectFunc, headerTimeout time.Duration) httpClientFactory { - return func(ep url.URL) httpClient { - return &redirectFollowingHTTPClient{ - checkRedirect: cr, - client: &simpleHTTPClient{ - transport: tr, - endpoint: ep, - headerTimeout: headerTimeout, - }, - } - } -} - -type credentials struct { - username string - password string -} - -type httpClientFactory func(url.URL) httpClient - -type httpAction interface { - HTTPRequest(url.URL) *http.Request -} - -type httpClusterClient struct { - clientFactory httpClientFactory - endpoints []url.URL - pinned int - credentials *credentials - sync.RWMutex - rand *rand.Rand - selectionMode EndpointSelectionMode -} - -func (c *httpClusterClient) getLeaderEndpoint(ctx context.Context, eps []url.URL) (string, error) { - ceps := make([]url.URL, len(eps)) - copy(ceps, eps) - - // To perform a lookup on the new endpoint list without using the current - // client, we'll copy it - clientCopy := &httpClusterClient{ - clientFactory: c.clientFactory, - credentials: c.credentials, - rand: c.rand, - - pinned: 0, - endpoints: ceps, - } - - mAPI := NewMembersAPI(clientCopy) - leader, err := mAPI.Leader(ctx) - if err != nil { - return "", err - } - if len(leader.ClientURLs) == 0 { - return "", ErrNoLeaderEndpoint - } - - return leader.ClientURLs[0], nil // TODO: how to handle multiple client URLs? -} - -func (c *httpClusterClient) parseEndpoints(eps []string) ([]url.URL, error) { - if len(eps) == 0 { - return []url.URL{}, ErrNoEndpoints - } - - neps := make([]url.URL, len(eps)) - for i, ep := range eps { - u, err := url.Parse(ep) - if err != nil { - return []url.URL{}, err - } - neps[i] = *u - } - return neps, nil -} - -func (c *httpClusterClient) SetEndpoints(eps []string) error { - neps, err := c.parseEndpoints(eps) - if err != nil { - return err - } - - c.Lock() - defer c.Unlock() - - c.endpoints = shuffleEndpoints(c.rand, neps) - // We're not doing anything for PrioritizeLeader here. This is - // due to not having a context meaning we can't call getLeaderEndpoint - // However, if you're using PrioritizeLeader, you've already been told - // to regularly call sync, where we do have a ctx, and can figure the - // leader. PrioritizeLeader is also quite a loose guarantee, so deal - // with it - c.pinned = 0 - - return nil -} - -func (c *httpClusterClient) Do(ctx context.Context, act httpAction) (*http.Response, []byte, error) { - action := act - c.RLock() - leps := len(c.endpoints) - eps := make([]url.URL, leps) - n := copy(eps, c.endpoints) - pinned := c.pinned - - if c.credentials != nil { - action = &authedAction{ - act: act, - credentials: *c.credentials, - } - } - c.RUnlock() - - if leps == 0 { - return nil, nil, ErrNoEndpoints - } - - if leps != n { - return nil, nil, errors.New("unable to pick endpoint: copy failed") - } - - var resp *http.Response - var body []byte - var err error - cerr := &ClusterError{} - isOneShot := ctx.Value(&oneShotCtxValue) != nil - - for i := pinned; i < leps+pinned; i++ { - k := i % leps - hc := c.clientFactory(eps[k]) - resp, body, err = hc.Do(ctx, action) - if err != nil { - cerr.Errors = append(cerr.Errors, err) - if err == ctx.Err() { - return nil, nil, ctx.Err() - } - if err == context.Canceled || err == context.DeadlineExceeded { - return nil, nil, err - } - } else if resp.StatusCode/100 == 5 { - switch resp.StatusCode { - case http.StatusInternalServerError, http.StatusServiceUnavailable: - // TODO: make sure this is a no leader response - cerr.Errors = append(cerr.Errors, fmt.Errorf("client: etcd member %s has no leader", eps[k].String())) - default: - cerr.Errors = append(cerr.Errors, fmt.Errorf("client: etcd member %s returns server error [%s]", eps[k].String(), http.StatusText(resp.StatusCode))) - } - err = cerr.Errors[0] - } - if err != nil { - if !isOneShot { - continue - } - c.Lock() - c.pinned = (k + 1) % leps - c.Unlock() - return nil, nil, err - } - if k != pinned { - c.Lock() - c.pinned = k - c.Unlock() - } - return resp, body, nil - } - - return nil, nil, cerr -} - -func (c *httpClusterClient) Endpoints() []string { - c.RLock() - defer c.RUnlock() - - eps := make([]string, len(c.endpoints)) - for i, ep := range c.endpoints { - eps[i] = ep.String() - } - - return eps -} - -func (c *httpClusterClient) Sync(ctx context.Context) error { - mAPI := NewMembersAPI(c) - ms, err := mAPI.List(ctx) - if err != nil { - return err - } - - var eps []string - for _, m := range ms { - eps = append(eps, m.ClientURLs...) - } - - neps, err := c.parseEndpoints(eps) - if err != nil { - return err - } - - npin := 0 - - switch c.selectionMode { - case EndpointSelectionRandom: - c.RLock() - eq := endpointsEqual(c.endpoints, neps) - c.RUnlock() - - if eq { - return nil - } - // When items in the endpoint list changes, we choose a new pin - neps = shuffleEndpoints(c.rand, neps) - case EndpointSelectionPrioritizeLeader: - nle, err := c.getLeaderEndpoint(ctx, neps) - if err != nil { - return ErrNoLeaderEndpoint - } - - for i, n := range neps { - if n.String() == nle { - npin = i - break - } - } - default: - return fmt.Errorf("invalid endpoint selection mode: %d", c.selectionMode) - } - - c.Lock() - defer c.Unlock() - c.endpoints = neps - c.pinned = npin - - return nil -} - -func (c *httpClusterClient) AutoSync(ctx context.Context, interval time.Duration) error { - ticker := time.NewTicker(interval) - defer ticker.Stop() - for { - err := c.Sync(ctx) - if err != nil { - return err - } - select { - case <-ctx.Done(): - return ctx.Err() - case <-ticker.C: - } - } -} - -func (c *httpClusterClient) GetVersion(ctx context.Context) (*version.Versions, error) { - act := &getAction{Prefix: "/version"} - - resp, body, err := c.Do(ctx, act) - if err != nil { - return nil, err - } - - switch resp.StatusCode { - case http.StatusOK: - if len(body) == 0 { - return nil, ErrEmptyBody - } - var vresp version.Versions - if err := json.Unmarshal(body, &vresp); err != nil { - return nil, ErrInvalidJSON - } - return &vresp, nil - default: - var etcdErr Error - if err := json.Unmarshal(body, &etcdErr); err != nil { - return nil, ErrInvalidJSON - } - return nil, etcdErr - } -} - -type roundTripResponse struct { - resp *http.Response - err error -} - -type simpleHTTPClient struct { - transport CancelableTransport - endpoint url.URL - headerTimeout time.Duration -} - -func (c *simpleHTTPClient) Do(ctx context.Context, act httpAction) (*http.Response, []byte, error) { - req := act.HTTPRequest(c.endpoint) - - if err := printcURL(req); err != nil { - return nil, nil, err - } - - isWait := false - if req != nil && req.URL != nil { - ws := req.URL.Query().Get("wait") - if len(ws) != 0 { - var err error - isWait, err = strconv.ParseBool(ws) - if err != nil { - return nil, nil, fmt.Errorf("wrong wait value %s (%v for %+v)", ws, err, req) - } - } - } - - var hctx context.Context - var hcancel context.CancelFunc - if !isWait && c.headerTimeout > 0 { - hctx, hcancel = context.WithTimeout(ctx, c.headerTimeout) - } else { - hctx, hcancel = context.WithCancel(ctx) - } - defer hcancel() - - reqcancel := requestCanceler(c.transport, req) - - rtchan := make(chan roundTripResponse, 1) - go func() { - resp, err := c.transport.RoundTrip(req) - rtchan <- roundTripResponse{resp: resp, err: err} - close(rtchan) - }() - - var resp *http.Response - var err error - - select { - case rtresp := <-rtchan: - resp, err = rtresp.resp, rtresp.err - case <-hctx.Done(): - // cancel and wait for request to actually exit before continuing - reqcancel() - rtresp := <-rtchan - resp = rtresp.resp - switch { - case ctx.Err() != nil: - err = ctx.Err() - case hctx.Err() != nil: - err = fmt.Errorf("client: endpoint %s exceeded header timeout", c.endpoint.String()) - default: - panic("failed to get error from context") - } - } - - // always check for resp nil-ness to deal with possible - // race conditions between channels above - defer func() { - if resp != nil { - resp.Body.Close() - } - }() - - if err != nil { - return nil, nil, err - } - - var body []byte - done := make(chan struct{}) - go func() { - body, err = ioutil.ReadAll(resp.Body) - done <- struct{}{} - }() - - select { - case <-ctx.Done(): - resp.Body.Close() - <-done - return nil, nil, ctx.Err() - case <-done: - } - - return resp, body, err -} - -type authedAction struct { - act httpAction - credentials credentials -} - -func (a *authedAction) HTTPRequest(url url.URL) *http.Request { - r := a.act.HTTPRequest(url) - r.SetBasicAuth(a.credentials.username, a.credentials.password) - return r -} - -type redirectFollowingHTTPClient struct { - client httpClient - checkRedirect CheckRedirectFunc -} - -func (r *redirectFollowingHTTPClient) Do(ctx context.Context, act httpAction) (*http.Response, []byte, error) { - next := act - for i := 0; i < 100; i++ { - if i > 0 { - if err := r.checkRedirect(i); err != nil { - return nil, nil, err - } - } - resp, body, err := r.client.Do(ctx, next) - if err != nil { - return nil, nil, err - } - if resp.StatusCode/100 == 3 { - hdr := resp.Header.Get("Location") - if hdr == "" { - return nil, nil, fmt.Errorf("Location header not set") - } - loc, err := url.Parse(hdr) - if err != nil { - return nil, nil, fmt.Errorf("Location header not valid URL: %s", hdr) - } - next = &redirectedHTTPAction{ - action: act, - location: *loc, - } - continue - } - return resp, body, nil - } - - return nil, nil, errTooManyRedirectChecks -} - -type redirectedHTTPAction struct { - action httpAction - location url.URL -} - -func (r *redirectedHTTPAction) HTTPRequest(ep url.URL) *http.Request { - orig := r.action.HTTPRequest(ep) - orig.URL = &r.location - return orig -} - -func shuffleEndpoints(r *rand.Rand, eps []url.URL) []url.URL { - // copied from Go 1.9<= rand.Rand.Perm - n := len(eps) - p := make([]int, n) - for i := 0; i < n; i++ { - j := r.Intn(i + 1) - p[i] = p[j] - p[j] = i - } - neps := make([]url.URL, n) - for i, k := range p { - neps[i] = eps[k] - } - return neps -} - -func endpointsEqual(left, right []url.URL) bool { - if len(left) != len(right) { - return false - } - - sLeft := make([]string, len(left)) - sRight := make([]string, len(right)) - for i, l := range left { - sLeft[i] = l.String() - } - for i, r := range right { - sRight[i] = r.String() - } - - sort.Strings(sLeft) - sort.Strings(sRight) - for i := range sLeft { - if sLeft[i] != sRight[i] { - return false - } - } - return true -} diff --git a/vendor/github.com/coreos/etcd/client/cluster_error.go b/vendor/github.com/coreos/etcd/client/cluster_error.go deleted file mode 100644 index 34618cdb..00000000 --- a/vendor/github.com/coreos/etcd/client/cluster_error.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import "fmt" - -type ClusterError struct { - Errors []error -} - -func (ce *ClusterError) Error() string { - s := ErrClusterUnavailable.Error() - for i, e := range ce.Errors { - s += fmt.Sprintf("; error #%d: %s\n", i, e) - } - return s -} - -func (ce *ClusterError) Detail() string { - s := "" - for i, e := range ce.Errors { - s += fmt.Sprintf("error #%d: %s\n", i, e) - } - return s -} diff --git a/vendor/github.com/coreos/etcd/client/curl.go b/vendor/github.com/coreos/etcd/client/curl.go deleted file mode 100644 index c8bc9fba..00000000 --- a/vendor/github.com/coreos/etcd/client/curl.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "os" -) - -var ( - cURLDebug = false -) - -func EnablecURLDebug() { - cURLDebug = true -} - -func DisablecURLDebug() { - cURLDebug = false -} - -// printcURL prints the cURL equivalent request to stderr. -// It returns an error if the body of the request cannot -// be read. -// The caller MUST cancel the request if there is an error. -func printcURL(req *http.Request) error { - if !cURLDebug { - return nil - } - var ( - command string - b []byte - err error - ) - - if req.URL != nil { - command = fmt.Sprintf("curl -X %s %s", req.Method, req.URL.String()) - } - - if req.Body != nil { - b, err = ioutil.ReadAll(req.Body) - if err != nil { - return err - } - command += fmt.Sprintf(" -d %q", string(b)) - } - - fmt.Fprintf(os.Stderr, "cURL Command: %s\n", command) - - // reset body - body := bytes.NewBuffer(b) - req.Body = ioutil.NopCloser(body) - - return nil -} diff --git a/vendor/github.com/coreos/etcd/client/discover.go b/vendor/github.com/coreos/etcd/client/discover.go deleted file mode 100644 index 442e35fe..00000000 --- a/vendor/github.com/coreos/etcd/client/discover.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "github.com/coreos/etcd/pkg/srv" -) - -// Discoverer is an interface that wraps the Discover method. -type Discoverer interface { - // Discover looks up the etcd servers for the domain. - Discover(domain string) ([]string, error) -} - -type srvDiscover struct{} - -// NewSRVDiscover constructs a new Discoverer that uses the stdlib to lookup SRV records. -func NewSRVDiscover() Discoverer { - return &srvDiscover{} -} - -func (d *srvDiscover) Discover(domain string) ([]string, error) { - srvs, err := srv.GetClient("etcd-client", domain) - if err != nil { - return nil, err - } - return srvs.Endpoints, nil -} diff --git a/vendor/github.com/coreos/etcd/client/doc.go b/vendor/github.com/coreos/etcd/client/doc.go deleted file mode 100644 index ad4eca4e..00000000 --- a/vendor/github.com/coreos/etcd/client/doc.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package client provides bindings for the etcd APIs. - -Create a Config and exchange it for a Client: - - import ( - "net/http" - "context" - - "github.com/coreos/etcd/client" - ) - - cfg := client.Config{ - Endpoints: []string{"http://127.0.0.1:2379"}, - Transport: DefaultTransport, - } - - c, err := client.New(cfg) - if err != nil { - // handle error - } - -Clients are safe for concurrent use by multiple goroutines. - -Create a KeysAPI using the Client, then use it to interact with etcd: - - kAPI := client.NewKeysAPI(c) - - // create a new key /foo with the value "bar" - _, err = kAPI.Create(context.Background(), "/foo", "bar") - if err != nil { - // handle error - } - - // delete the newly created key only if the value is still "bar" - _, err = kAPI.Delete(context.Background(), "/foo", &DeleteOptions{PrevValue: "bar"}) - if err != nil { - // handle error - } - -Use a custom context to set timeouts on your operations: - - import "time" - - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - - // set a new key, ignoring its previous state - _, err := kAPI.Set(ctx, "/ping", "pong", nil) - if err != nil { - if err == context.DeadlineExceeded { - // request took longer than 5s - } else { - // handle error - } - } - -*/ -package client diff --git a/vendor/github.com/coreos/etcd/client/integration/doc.go b/vendor/github.com/coreos/etcd/client/integration/doc.go deleted file mode 100644 index e9c58d67..00000000 --- a/vendor/github.com/coreos/etcd/client/integration/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package integration implements tests built upon embedded etcd, focusing on -// the correctness of the etcd v2 client. -package integration diff --git a/vendor/github.com/coreos/etcd/client/keys.generated.go b/vendor/github.com/coreos/etcd/client/keys.generated.go deleted file mode 100644 index 237fdbe8..00000000 --- a/vendor/github.com/coreos/etcd/client/keys.generated.go +++ /dev/null @@ -1,5218 +0,0 @@ -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package client - -import ( - "errors" - "fmt" - "reflect" - "runtime" - time "time" - - codec1978 "github.com/ugorji/go/codec" -) - -const ( - // ----- content types ---- - codecSelferC_UTF87612 = 1 - codecSelferC_RAW7612 = 0 - // ----- value types used ---- - codecSelferValueTypeArray7612 = 10 - codecSelferValueTypeMap7612 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey7612 = 2 - codecSelfer_containerMapValue7612 = 3 - codecSelfer_containerMapEnd7612 = 4 - codecSelfer_containerArrayElem7612 = 6 - codecSelfer_containerArrayEnd7612 = 7 -) - -var ( - codecSelferBitsize7612 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr7612 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer7612 struct{} - -func init() { - if codec1978.GenVersion != 8 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 8, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 time.Duration - _ = v0 - } -} - -func (x *Error) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) - } else { - r.WriteMapStart(4) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeInt(int64(x.Code)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("errorCode")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeInt(int64(x.Code)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Message)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("message")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Message)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Cause)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("cause")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Cause)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("index")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.Index)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *Error) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *Error) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "errorCode": - if r.TryDecodeAsNil() { - x.Code = 0 - } else { - yyv4 := &x.Code - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*int)(yyv4)) = int(r.DecodeInt(codecSelferBitsize7612)) - } - } - case "message": - if r.TryDecodeAsNil() { - x.Message = "" - } else { - yyv6 := &x.Message - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "cause": - if r.TryDecodeAsNil() { - x.Cause = "" - } else { - yyv8 := &x.Cause - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "index": - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv10 := &x.Index - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *Error) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Code = 0 - } else { - yyv13 := &x.Code - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*int)(yyv13)) = int(r.DecodeInt(codecSelferBitsize7612)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Message = "" - } else { - yyv15 := &x.Message - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Cause = "" - } else { - yyv17 := &x.Cause - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Index = 0 - } else { - yyv19 := &x.Index - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*uint64)(yyv19)) = uint64(r.DecodeUint(64)) - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj12-1, "") - } - r.ReadArrayEnd() -} - -func (x PrevExistType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x)) - } -} - -func (x *PrevExistType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *WatcherOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(2) - } else { - r.WriteMapStart(2) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeUint(uint64(x.AfterIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("AfterIndex")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeUint(uint64(x.AfterIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Recursive")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *WatcherOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *WatcherOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "AfterIndex": - if r.TryDecodeAsNil() { - x.AfterIndex = 0 - } else { - yyv4 := &x.AfterIndex - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*uint64)(yyv4)) = uint64(r.DecodeUint(64)) - } - } - case "Recursive": - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv6 := &x.Recursive - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *WatcherOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.AfterIndex = 0 - } else { - yyv9 := &x.AfterIndex - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*uint64)(yyv9)) = uint64(r.DecodeUint(64)) - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv11 := &x.Recursive - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj8-1, "") - } - r.ReadArrayEnd() -} - -func (x *CreateInOrderOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(1) - } else { - r.WriteMapStart(1) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("TTL")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *CreateInOrderOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *CreateInOrderOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "TTL": - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv4 := &x.TTL - yym5 := z.DecBinary() - _ = yym5 - if false { - } else if z.HasExtensions() && z.DecExt(yyv4) { - } else { - *((*int64)(yyv4)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *CreateInOrderOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv7 := &x.TTL - yym8 := z.DecBinary() - _ = yym8 - if false { - } else if z.HasExtensions() && z.DecExt(yyv7) { - } else { - *((*int64)(yyv7)) = int64(r.DecodeInt(64)) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj6-1, "") - } - r.ReadArrayEnd() -} - -func (x *SetOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(7) - } else { - r.WriteMapStart(7) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevValue")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevIndex")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - x.PrevExist.CodecEncodeSelf(e) - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevExist")) - r.WriteMapElemValue() - x.PrevExist.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("TTL")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.Refresh)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Refresh")) - r.WriteMapElemValue() - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.Refresh)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Dir")) - r.WriteMapElemValue() - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeBool(bool(x.NoValueOnSuccess)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("NoValueOnSuccess")) - r.WriteMapElemValue() - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeBool(bool(x.NoValueOnSuccess)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *SetOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *SetOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "PrevValue": - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv4 := &x.PrevValue - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "PrevIndex": - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv6 := &x.PrevIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "PrevExist": - if r.TryDecodeAsNil() { - x.PrevExist = "" - } else { - yyv8 := &x.PrevExist - yyv8.CodecDecodeSelf(d) - } - case "TTL": - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv9 := &x.TTL - yym10 := z.DecBinary() - _ = yym10 - if false { - } else if z.HasExtensions() && z.DecExt(yyv9) { - } else { - *((*int64)(yyv9)) = int64(r.DecodeInt(64)) - } - } - case "Refresh": - if r.TryDecodeAsNil() { - x.Refresh = false - } else { - yyv11 := &x.Refresh - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - case "Dir": - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv13 := &x.Dir - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - case "NoValueOnSuccess": - if r.TryDecodeAsNil() { - x.NoValueOnSuccess = false - } else { - yyv15 := &x.NoValueOnSuccess - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *SetOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj17 int - var yyb17 bool - var yyhl17 bool = l >= 0 - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv18 := &x.PrevValue - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*string)(yyv18)) = r.DecodeString() - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv20 := &x.PrevIndex - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*uint64)(yyv20)) = uint64(r.DecodeUint(64)) - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevExist = "" - } else { - yyv22 := &x.PrevExist - yyv22.CodecDecodeSelf(d) - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv23 := &x.TTL - yym24 := z.DecBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.DecExt(yyv23) { - } else { - *((*int64)(yyv23)) = int64(r.DecodeInt(64)) - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Refresh = false - } else { - yyv25 := &x.Refresh - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv27 := &x.Dir - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*bool)(yyv27)) = r.DecodeBool() - } - } - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.NoValueOnSuccess = false - } else { - yyv29 := &x.NoValueOnSuccess - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*bool)(yyv29)) = r.DecodeBool() - } - } - for { - yyj17++ - if yyhl17 { - yyb17 = yyj17 > l - } else { - yyb17 = r.CheckBreak() - } - if yyb17 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj17-1, "") - } - r.ReadArrayEnd() -} - -func (x *GetOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) - } else { - r.WriteMapStart(3) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Recursive")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Sort)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Sort")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Sort)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.Quorum)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Quorum")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.Quorum)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *GetOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *GetOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "Recursive": - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv4 := &x.Recursive - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "Sort": - if r.TryDecodeAsNil() { - x.Sort = false - } else { - yyv6 := &x.Sort - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "Quorum": - if r.TryDecodeAsNil() { - x.Quorum = false - } else { - yyv8 := &x.Quorum - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *GetOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv11 := &x.Recursive - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Sort = false - } else { - yyv13 := &x.Sort - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*bool)(yyv13)) = r.DecodeBool() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Quorum = false - } else { - yyv15 := &x.Quorum - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*bool)(yyv15)) = r.DecodeBool() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj10-1, "") - } - r.ReadArrayEnd() -} - -func (x *DeleteOptions) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) - } else { - r.WriteMapStart(4) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevValue")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevIndex")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Recursive")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Dir")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *DeleteOptions) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *DeleteOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "PrevValue": - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv4 := &x.PrevValue - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "PrevIndex": - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv6 := &x.PrevIndex - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*uint64)(yyv6)) = uint64(r.DecodeUint(64)) - } - } - case "Recursive": - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv8 := &x.Recursive - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - case "Dir": - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv10 := &x.Dir - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *DeleteOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv13 := &x.PrevValue - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv15 := &x.PrevIndex - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*uint64)(yyv15)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv17 := &x.Recursive - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv19 := &x.Dir - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj12-1, "") - } - r.ReadArrayEnd() -} - -func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(3) - } else { - r.WriteMapStart(3) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Action)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("action")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Action)) - } - } - var yyn6 bool - if x.Node == nil { - yyn6 = true - goto LABEL6 - } - LABEL6: - if yyr2 || yy2arr2 { - if yyn6 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.Node == nil { - r.EncodeNil() - } else { - x.Node.CodecEncodeSelf(e) - } - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("node")) - r.WriteMapElemValue() - if yyn6 { - r.EncodeNil() - } else { - if x.Node == nil { - r.EncodeNil() - } else { - x.Node.CodecEncodeSelf(e) - } - } - } - var yyn9 bool - if x.PrevNode == nil { - yyn9 = true - goto LABEL9 - } - LABEL9: - if yyr2 || yy2arr2 { - if yyn9 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if x.PrevNode == nil { - r.EncodeNil() - } else { - x.PrevNode.CodecEncodeSelf(e) - } - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("prevNode")) - r.WriteMapElemValue() - if yyn9 { - r.EncodeNil() - } else { - if x.PrevNode == nil { - r.EncodeNil() - } else { - x.PrevNode.CodecEncodeSelf(e) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "action": - if r.TryDecodeAsNil() { - x.Action = "" - } else { - yyv4 := &x.Action - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "node": - if x.Node == nil { - x.Node = new(Node) - } - if r.TryDecodeAsNil() { - if x.Node != nil { - x.Node = nil - } - } else { - if x.Node == nil { - x.Node = new(Node) - } - x.Node.CodecDecodeSelf(d) - } - case "prevNode": - if x.PrevNode == nil { - x.PrevNode = new(Node) - } - if r.TryDecodeAsNil() { - if x.PrevNode != nil { - x.PrevNode = nil - } - } else { - if x.PrevNode == nil { - x.PrevNode = new(Node) - } - x.PrevNode.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Action = "" - } else { - yyv9 := &x.Action - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - if x.Node == nil { - x.Node = new(Node) - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if x.Node != nil { - x.Node = nil - } - } else { - if x.Node == nil { - x.Node = new(Node) - } - x.Node.CodecDecodeSelf(d) - } - if x.PrevNode == nil { - x.PrevNode = new(Node) - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if x.PrevNode != nil { - x.PrevNode = nil - } - } else { - if x.PrevNode == nil { - x.PrevNode = new(Node) - } - x.PrevNode.CodecDecodeSelf(d) - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj8-1, "") - } - r.ReadArrayEnd() -} - -func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [8]bool - _ = yyq2 - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - yyq2[1] = x.Dir != false - yyq2[6] = x.Expiration != nil - yyq2[7] = x.TTL != 0 - if yyr2 || yy2arr2 { - r.WriteArrayStart(8) - } else { - var yynn2 = 5 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.WriteMapStart(yynn2) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("key")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[1] { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } else { - r.EncodeBool(false) - } - } else { - if yyq2[1] { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("dir")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Value)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("value")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Value)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if x.Nodes == nil { - r.EncodeNil() - } else { - x.Nodes.CodecEncodeSelf(e) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("nodes")) - r.WriteMapElemValue() - if x.Nodes == nil { - r.EncodeNil() - } else { - x.Nodes.CodecEncodeSelf(e) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.CreatedIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("createdIndex")) - r.WriteMapElemValue() - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.CreatedIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeUint(uint64(x.ModifiedIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("modifiedIndex")) - r.WriteMapElemValue() - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeUint(uint64(x.ModifiedIndex)) - } - } - var yyn21 bool - if x.Expiration == nil { - yyn21 = true - goto LABEL21 - } - LABEL21: - if yyr2 || yy2arr2 { - if yyn21 { - r.WriteArrayElem() - r.EncodeNil() - } else { - r.WriteArrayElem() - if yyq2[6] { - if x.Expiration == nil { - r.EncodeNil() - } else { - yym22 := z.EncBinary() - _ = yym22 - if false { - } else if yym23 := z.TimeRtidIfBinc(); yym23 != 0 { - r.EncodeBuiltin(yym23, x.Expiration) - } else if z.HasExtensions() && z.EncExt(x.Expiration) { - } else if yym22 { - z.EncBinaryMarshal(x.Expiration) - } else if !yym22 && z.IsJSONHandle() { - z.EncJSONMarshal(x.Expiration) - } else { - z.EncFallback(x.Expiration) - } - } - } else { - r.EncodeNil() - } - } - } else { - if yyq2[6] { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("expiration")) - r.WriteMapElemValue() - if yyn21 { - r.EncodeNil() - } else { - if x.Expiration == nil { - r.EncodeNil() - } else { - yym24 := z.EncBinary() - _ = yym24 - if false { - } else if yym25 := z.TimeRtidIfBinc(); yym25 != 0 { - r.EncodeBuiltin(yym25, x.Expiration) - } else if z.HasExtensions() && z.EncExt(x.Expiration) { - } else if yym24 { - z.EncBinaryMarshal(x.Expiration) - } else if !yym24 && z.IsJSONHandle() { - z.EncJSONMarshal(x.Expiration) - } else { - z.EncFallback(x.Expiration) - } - } - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - if yyq2[7] { - yym27 := z.EncBinary() - _ = yym27 - if false { - } else { - r.EncodeInt(int64(x.TTL)) - } - } else { - r.EncodeInt(0) - } - } else { - if yyq2[7] { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("ttl")) - r.WriteMapElemValue() - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeInt(int64(x.TTL)) - } - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv4 := &x.Key - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "dir": - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv6 := &x.Dir - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*bool)(yyv6)) = r.DecodeBool() - } - } - case "value": - if r.TryDecodeAsNil() { - x.Value = "" - } else { - yyv8 := &x.Value - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "nodes": - if r.TryDecodeAsNil() { - x.Nodes = nil - } else { - yyv10 := &x.Nodes - yyv10.CodecDecodeSelf(d) - } - case "createdIndex": - if r.TryDecodeAsNil() { - x.CreatedIndex = 0 - } else { - yyv11 := &x.CreatedIndex - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*uint64)(yyv11)) = uint64(r.DecodeUint(64)) - } - } - case "modifiedIndex": - if r.TryDecodeAsNil() { - x.ModifiedIndex = 0 - } else { - yyv13 := &x.ModifiedIndex - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*uint64)(yyv13)) = uint64(r.DecodeUint(64)) - } - } - case "expiration": - if x.Expiration == nil { - x.Expiration = new(time.Time) - } - if r.TryDecodeAsNil() { - if x.Expiration != nil { - x.Expiration = nil - } - } else { - if x.Expiration == nil { - x.Expiration = new(time.Time) - } - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if yym17 := z.TimeRtidIfBinc(); yym17 != 0 { - r.DecodeBuiltin(yym17, x.Expiration) - } else if z.HasExtensions() && z.DecExt(x.Expiration) { - } else if yym16 { - z.DecBinaryUnmarshal(x.Expiration) - } else if !yym16 && z.IsJSONHandle() { - z.DecJSONUnmarshal(x.Expiration) - } else { - z.DecFallback(x.Expiration, false) - } - } - case "ttl": - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv18 := &x.TTL - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*int64)(yyv18)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj20 int - var yyb20 bool - var yyhl20 bool = l >= 0 - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv21 := &x.Key - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(yyv21)) = r.DecodeString() - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv23 := &x.Dir - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*bool)(yyv23)) = r.DecodeBool() - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Value = "" - } else { - yyv25 := &x.Value - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(yyv25)) = r.DecodeString() - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Nodes = nil - } else { - yyv27 := &x.Nodes - yyv27.CodecDecodeSelf(d) - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.CreatedIndex = 0 - } else { - yyv28 := &x.CreatedIndex - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*uint64)(yyv28)) = uint64(r.DecodeUint(64)) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.ModifiedIndex = 0 - } else { - yyv30 := &x.ModifiedIndex - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*uint64)(yyv30)) = uint64(r.DecodeUint(64)) - } - } - if x.Expiration == nil { - x.Expiration = new(time.Time) - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - if x.Expiration != nil { - x.Expiration = nil - } - } else { - if x.Expiration == nil { - x.Expiration = new(time.Time) - } - yym33 := z.DecBinary() - _ = yym33 - if false { - } else if yym34 := z.TimeRtidIfBinc(); yym34 != 0 { - r.DecodeBuiltin(yym34, x.Expiration) - } else if z.HasExtensions() && z.DecExt(x.Expiration) { - } else if yym33 { - z.DecBinaryUnmarshal(x.Expiration) - } else if !yym33 && z.IsJSONHandle() { - z.DecJSONUnmarshal(x.Expiration) - } else { - z.DecFallback(x.Expiration, false) - } - } - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv35 := &x.TTL - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*int64)(yyv35)) = int64(r.DecodeInt(64)) - } - } - for { - yyj20++ - if yyhl20 { - yyb20 = yyj20 > l - } else { - yyb20 = r.CheckBreak() - } - if yyb20 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj20-1, "") - } - r.ReadArrayEnd() -} - -func (x Nodes) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - h.encNodes((Nodes)(x), e) - } - } -} - -func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - h.decNodes((*Nodes)(x), d) - } -} - -func (x *httpKeysAPI) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *httpKeysAPI) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *httpKeysAPI) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *httpKeysAPI) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj4 int - var yyb4 bool - var yyhl4 bool = l >= 0 - for { - yyj4++ - if yyhl4 { - yyb4 = yyj4 > l - } else { - yyb4 = r.CheckBreak() - } - if yyb4 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj4-1, "") - } - r.ReadArrayEnd() -} - -func (x *httpWatcher) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(0) - } else { - r.WriteMapStart(0) - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *httpWatcher) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *httpWatcher) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *httpWatcher) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj4 int - var yyb4 bool - var yyhl4 bool = l >= 0 - for { - yyj4++ - if yyhl4 { - yyb4 = yyj4 > l - } else { - yyb4 = r.CheckBreak() - } - if yyb4 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj4-1, "") - } - r.ReadArrayEnd() -} - -func (x *getAction) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(5) - } else { - r.WriteMapStart(5) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Prefix")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Key")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Recursive")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.Sorted)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Sorted")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.Sorted)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.Quorum)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Quorum")) - r.WriteMapElemValue() - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.Quorum)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *getAction) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *getAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv4 := &x.Prefix - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv6 := &x.Key - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Recursive": - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv8 := &x.Recursive - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - case "Sorted": - if r.TryDecodeAsNil() { - x.Sorted = false - } else { - yyv10 := &x.Sorted - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "Quorum": - if r.TryDecodeAsNil() { - x.Quorum = false - } else { - yyv12 := &x.Quorum - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *getAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj14 int - var yyb14 bool - var yyhl14 bool = l >= 0 - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv15 := &x.Prefix - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv17 := &x.Key - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv19 := &x.Recursive - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Sorted = false - } else { - yyv21 := &x.Sorted - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Quorum = false - } else { - yyv23 := &x.Quorum - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*bool)(yyv23)) = r.DecodeBool() - } - } - for { - yyj14++ - if yyhl14 { - yyb14 = yyj14 > l - } else { - yyb14 = r.CheckBreak() - } - if yyb14 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj14-1, "") - } - r.ReadArrayEnd() -} - -func (x *waitAction) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) - } else { - r.WriteMapStart(4) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Prefix")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Key")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeUint(uint64(x.WaitIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("WaitIndex")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeUint(uint64(x.WaitIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Recursive")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *waitAction) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *waitAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv4 := &x.Prefix - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv6 := &x.Key - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "WaitIndex": - if r.TryDecodeAsNil() { - x.WaitIndex = 0 - } else { - yyv8 := &x.WaitIndex - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*uint64)(yyv8)) = uint64(r.DecodeUint(64)) - } - } - case "Recursive": - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv10 := &x.Recursive - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *waitAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv13 := &x.Prefix - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv15 := &x.Key - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.WaitIndex = 0 - } else { - yyv17 := &x.WaitIndex - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*uint64)(yyv17)) = uint64(r.DecodeUint(64)) - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv19 := &x.Recursive - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj12-1, "") - } - r.ReadArrayEnd() -} - -func (x *setAction) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(10) - } else { - r.WriteMapStart(10) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Prefix")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Key")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Value)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Value")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Value)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevValue")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevIndex")) - r.WriteMapElemValue() - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - x.PrevExist.CodecEncodeSelf(e) - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevExist")) - r.WriteMapElemValue() - x.PrevExist.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym22 := z.EncBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("TTL")) - r.WriteMapElemValue() - yym23 := z.EncBinary() - _ = yym23 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeBool(bool(x.Refresh)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Refresh")) - r.WriteMapElemValue() - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeBool(bool(x.Refresh)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Dir")) - r.WriteMapElemValue() - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeBool(bool(x.NoValueOnSuccess)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("NoValueOnSuccess")) - r.WriteMapElemValue() - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeBool(bool(x.NoValueOnSuccess)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *setAction) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *setAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv4 := &x.Prefix - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv6 := &x.Key - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Value": - if r.TryDecodeAsNil() { - x.Value = "" - } else { - yyv8 := &x.Value - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "PrevValue": - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv10 := &x.PrevValue - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "PrevIndex": - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv12 := &x.PrevIndex - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*uint64)(yyv12)) = uint64(r.DecodeUint(64)) - } - } - case "PrevExist": - if r.TryDecodeAsNil() { - x.PrevExist = "" - } else { - yyv14 := &x.PrevExist - yyv14.CodecDecodeSelf(d) - } - case "TTL": - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv15 := &x.TTL - yym16 := z.DecBinary() - _ = yym16 - if false { - } else if z.HasExtensions() && z.DecExt(yyv15) { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - case "Refresh": - if r.TryDecodeAsNil() { - x.Refresh = false - } else { - yyv17 := &x.Refresh - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*bool)(yyv17)) = r.DecodeBool() - } - } - case "Dir": - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv19 := &x.Dir - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*bool)(yyv19)) = r.DecodeBool() - } - } - case "NoValueOnSuccess": - if r.TryDecodeAsNil() { - x.NoValueOnSuccess = false - } else { - yyv21 := &x.NoValueOnSuccess - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*bool)(yyv21)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *setAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj23 int - var yyb23 bool - var yyhl23 bool = l >= 0 - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv24 := &x.Prefix - yym25 := z.DecBinary() - _ = yym25 - if false { - } else { - *((*string)(yyv24)) = r.DecodeString() - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv26 := &x.Key - yym27 := z.DecBinary() - _ = yym27 - if false { - } else { - *((*string)(yyv26)) = r.DecodeString() - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Value = "" - } else { - yyv28 := &x.Value - yym29 := z.DecBinary() - _ = yym29 - if false { - } else { - *((*string)(yyv28)) = r.DecodeString() - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv30 := &x.PrevValue - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*string)(yyv30)) = r.DecodeString() - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv32 := &x.PrevIndex - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*uint64)(yyv32)) = uint64(r.DecodeUint(64)) - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevExist = "" - } else { - yyv34 := &x.PrevExist - yyv34.CodecDecodeSelf(d) - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv35 := &x.TTL - yym36 := z.DecBinary() - _ = yym36 - if false { - } else if z.HasExtensions() && z.DecExt(yyv35) { - } else { - *((*int64)(yyv35)) = int64(r.DecodeInt(64)) - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Refresh = false - } else { - yyv37 := &x.Refresh - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*bool)(yyv37)) = r.DecodeBool() - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv39 := &x.Dir - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*bool)(yyv39)) = r.DecodeBool() - } - } - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.NoValueOnSuccess = false - } else { - yyv41 := &x.NoValueOnSuccess - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*bool)(yyv41)) = r.DecodeBool() - } - } - for { - yyj23++ - if yyhl23 { - yyb23 = yyj23 > l - } else { - yyb23 = r.CheckBreak() - } - if yyb23 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj23-1, "") - } - r.ReadArrayEnd() -} - -func (x *deleteAction) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(6) - } else { - r.WriteMapStart(6) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Prefix")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Key")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Key)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevValue")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.PrevValue)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("PrevIndex")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeUint(uint64(x.PrevIndex)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Dir")) - r.WriteMapElemValue() - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeBool(bool(x.Dir)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Recursive")) - r.WriteMapElemValue() - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeBool(bool(x.Recursive)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *deleteAction) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *deleteAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv4 := &x.Prefix - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Key": - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv6 := &x.Key - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "PrevValue": - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv8 := &x.PrevValue - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "PrevIndex": - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv10 := &x.PrevIndex - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*uint64)(yyv10)) = uint64(r.DecodeUint(64)) - } - } - case "Dir": - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv12 := &x.Dir - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*bool)(yyv12)) = r.DecodeBool() - } - } - case "Recursive": - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv14 := &x.Recursive - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*bool)(yyv14)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *deleteAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj16 int - var yyb16 bool - var yyhl16 bool = l >= 0 - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv17 := &x.Prefix - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Key = "" - } else { - yyv19 := &x.Key - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(yyv19)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevValue = "" - } else { - yyv21 := &x.PrevValue - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(yyv21)) = r.DecodeString() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.PrevIndex = 0 - } else { - yyv23 := &x.PrevIndex - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*uint64)(yyv23)) = uint64(r.DecodeUint(64)) - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = false - } else { - yyv25 := &x.Dir - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Recursive = false - } else { - yyv27 := &x.Recursive - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*bool)(yyv27)) = r.DecodeBool() - } - } - for { - yyj16++ - if yyhl16 { - yyb16 = yyj16 > l - } else { - yyb16 = r.CheckBreak() - } - if yyb16 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj16-1, "") - } - r.ReadArrayEnd() -} - -func (x *createInOrderAction) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - _, _ = yysep2, yy2arr2 - const yyr2 bool = false - if yyr2 || yy2arr2 { - r.WriteArrayStart(4) - } else { - r.WriteMapStart(4) - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Prefix")) - r.WriteMapElemValue() - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Prefix)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Dir)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Dir")) - r.WriteMapElemValue() - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Dir)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Value)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("Value")) - r.WriteMapElemValue() - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeString(codecSelferC_UTF87612, string(x.Value)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayElem() - yym13 := z.EncBinary() - _ = yym13 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } else { - r.WriteMapElemKey() - r.EncodeString(codecSelferC_UTF87612, string("TTL")) - r.WriteMapElemValue() - yym14 := z.EncBinary() - _ = yym14 - if false { - } else if z.HasExtensions() && z.EncExt(x.TTL) { - } else { - r.EncodeInt(int64(x.TTL)) - } - } - if yyr2 || yy2arr2 { - r.WriteArrayEnd() - } else { - r.WriteMapEnd() - } - } - } -} - -func (x *createInOrderAction) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap7612 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray7612 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - r.ReadArrayEnd() - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr7612) - } - } -} - -func (x *createInOrderAction) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - r.ReadMapElemKey() - yys3Slc = r.DecodeStringAsBytes() - yys3 := string(yys3Slc) - r.ReadMapElemValue() - switch yys3 { - case "Prefix": - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv4 := &x.Prefix - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "Dir": - if r.TryDecodeAsNil() { - x.Dir = "" - } else { - yyv6 := &x.Dir - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "Value": - if r.TryDecodeAsNil() { - x.Value = "" - } else { - yyv8 := &x.Value - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "TTL": - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv10 := &x.TTL - yym11 := z.DecBinary() - _ = yym11 - if false { - } else if z.HasExtensions() && z.DecExt(yyv10) { - } else { - *((*int64)(yyv10)) = int64(r.DecodeInt(64)) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - r.ReadMapEnd() -} - -func (x *createInOrderAction) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj12 int - var yyb12 bool - var yyhl12 bool = l >= 0 - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Prefix = "" - } else { - yyv13 := &x.Prefix - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(yyv13)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Dir = "" - } else { - yyv15 := &x.Dir - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.Value = "" - } else { - yyv17 := &x.Value - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - r.ReadArrayEnd() - return - } - r.ReadArrayElem() - if r.TryDecodeAsNil() { - x.TTL = 0 - } else { - yyv19 := &x.TTL - yym20 := z.DecBinary() - _ = yym20 - if false { - } else if z.HasExtensions() && z.DecExt(yyv19) { - } else { - *((*int64)(yyv19)) = int64(r.DecodeInt(64)) - } - } - for { - yyj12++ - if yyhl12 { - yyb12 = yyj12 > l - } else { - yyb12 = r.CheckBreak() - } - if yyb12 { - break - } - r.ReadArrayElem() - z.DecStructFieldNotFound(yyj12-1, "") - } - r.ReadArrayEnd() -} - -func (x codecSelfer7612) encNodes(v Nodes, e *codec1978.Encoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.WriteArrayStart(len(v)) - for _, yyv1 := range v { - r.WriteArrayElem() - if yyv1 == nil { - r.EncodeNil() - } else { - yyv1.CodecEncodeSelf(e) - } - } - r.WriteArrayEnd() -} - -func (x codecSelfer7612) decNodes(v *Nodes, d *codec1978.Decoder) { - var h codecSelfer7612 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*Node{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else { - yyhl1 := yyl1 > 0 - var yyrl1 int - _ = yyrl1 - if yyhl1 { - if yyl1 > cap(yyv1) { - yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*Node, yyrl1) - } - yyc1 = true - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - } - var yyj1 int - // var yydn1 bool - for ; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { - if yyj1 == 0 && len(yyv1) == 0 { - if yyhl1 { - yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - } else { - yyrl1 = 8 - } - yyv1 = make([]*Node, yyrl1) - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - // yydn1 = r.TryDecodeAsNil() - - // if indefinite, etc, then expand the slice if necessary - var yydb1 bool - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) - yyc1 = true - - } - if yydb1 { - z.DecSwallow() - } else { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = Node{} - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(Node) - } - yyw2 := yyv1[yyj1] - yyw2.CodecDecodeSelf(d) - } - - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = make([]*Node, 0) - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } - -} diff --git a/vendor/github.com/coreos/etcd/client/keys.go b/vendor/github.com/coreos/etcd/client/keys.go deleted file mode 100644 index 8b9fd3f8..00000000 --- a/vendor/github.com/coreos/etcd/client/keys.go +++ /dev/null @@ -1,681 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -//go:generate codecgen -d 1819 -r "Node|Response|Nodes" -o keys.generated.go keys.go - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "github.com/coreos/etcd/pkg/pathutil" - "github.com/ugorji/go/codec" -) - -const ( - ErrorCodeKeyNotFound = 100 - ErrorCodeTestFailed = 101 - ErrorCodeNotFile = 102 - ErrorCodeNotDir = 104 - ErrorCodeNodeExist = 105 - ErrorCodeRootROnly = 107 - ErrorCodeDirNotEmpty = 108 - ErrorCodeUnauthorized = 110 - - ErrorCodePrevValueRequired = 201 - ErrorCodeTTLNaN = 202 - ErrorCodeIndexNaN = 203 - ErrorCodeInvalidField = 209 - ErrorCodeInvalidForm = 210 - - ErrorCodeRaftInternal = 300 - ErrorCodeLeaderElect = 301 - - ErrorCodeWatcherCleared = 400 - ErrorCodeEventIndexCleared = 401 -) - -type Error struct { - Code int `json:"errorCode"` - Message string `json:"message"` - Cause string `json:"cause"` - Index uint64 `json:"index"` -} - -func (e Error) Error() string { - return fmt.Sprintf("%v: %v (%v) [%v]", e.Code, e.Message, e.Cause, e.Index) -} - -var ( - ErrInvalidJSON = errors.New("client: response is invalid json. The endpoint is probably not valid etcd cluster endpoint.") - ErrEmptyBody = errors.New("client: response body is empty") -) - -// PrevExistType is used to define an existence condition when setting -// or deleting Nodes. -type PrevExistType string - -const ( - PrevIgnore = PrevExistType("") - PrevExist = PrevExistType("true") - PrevNoExist = PrevExistType("false") -) - -var ( - defaultV2KeysPrefix = "/v2/keys" -) - -// NewKeysAPI builds a KeysAPI that interacts with etcd's key-value -// API over HTTP. -func NewKeysAPI(c Client) KeysAPI { - return NewKeysAPIWithPrefix(c, defaultV2KeysPrefix) -} - -// NewKeysAPIWithPrefix acts like NewKeysAPI, but allows the caller -// to provide a custom base URL path. This should only be used in -// very rare cases. -func NewKeysAPIWithPrefix(c Client, p string) KeysAPI { - return &httpKeysAPI{ - client: c, - prefix: p, - } -} - -type KeysAPI interface { - // Get retrieves a set of Nodes from etcd - Get(ctx context.Context, key string, opts *GetOptions) (*Response, error) - - // Set assigns a new value to a Node identified by a given key. The caller - // may define a set of conditions in the SetOptions. If SetOptions.Dir=true - // then value is ignored. - Set(ctx context.Context, key, value string, opts *SetOptions) (*Response, error) - - // Delete removes a Node identified by the given key, optionally destroying - // all of its children as well. The caller may define a set of required - // conditions in an DeleteOptions object. - Delete(ctx context.Context, key string, opts *DeleteOptions) (*Response, error) - - // Create is an alias for Set w/ PrevExist=false - Create(ctx context.Context, key, value string) (*Response, error) - - // CreateInOrder is used to atomically create in-order keys within the given directory. - CreateInOrder(ctx context.Context, dir, value string, opts *CreateInOrderOptions) (*Response, error) - - // Update is an alias for Set w/ PrevExist=true - Update(ctx context.Context, key, value string) (*Response, error) - - // Watcher builds a new Watcher targeted at a specific Node identified - // by the given key. The Watcher may be configured at creation time - // through a WatcherOptions object. The returned Watcher is designed - // to emit events that happen to a Node, and optionally to its children. - Watcher(key string, opts *WatcherOptions) Watcher -} - -type WatcherOptions struct { - // AfterIndex defines the index after-which the Watcher should - // start emitting events. For example, if a value of 5 is - // provided, the first event will have an index >= 6. - // - // Setting AfterIndex to 0 (default) means that the Watcher - // should start watching for events starting at the current - // index, whatever that may be. - AfterIndex uint64 - - // Recursive specifies whether or not the Watcher should emit - // events that occur in children of the given keyspace. If set - // to false (default), events will be limited to those that - // occur for the exact key. - Recursive bool -} - -type CreateInOrderOptions struct { - // TTL defines a period of time after-which the Node should - // expire and no longer exist. Values <= 0 are ignored. Given - // that the zero-value is ignored, TTL cannot be used to set - // a TTL of 0. - TTL time.Duration -} - -type SetOptions struct { - // PrevValue specifies what the current value of the Node must - // be in order for the Set operation to succeed. - // - // Leaving this field empty means that the caller wishes to - // ignore the current value of the Node. This cannot be used - // to compare the Node's current value to an empty string. - // - // PrevValue is ignored if Dir=true - PrevValue string - - // PrevIndex indicates what the current ModifiedIndex of the - // Node must be in order for the Set operation to succeed. - // - // If PrevIndex is set to 0 (default), no comparison is made. - PrevIndex uint64 - - // PrevExist specifies whether the Node must currently exist - // (PrevExist) or not (PrevNoExist). If the caller does not - // care about existence, set PrevExist to PrevIgnore, or simply - // leave it unset. - PrevExist PrevExistType - - // TTL defines a period of time after-which the Node should - // expire and no longer exist. Values <= 0 are ignored. Given - // that the zero-value is ignored, TTL cannot be used to set - // a TTL of 0. - TTL time.Duration - - // Refresh set to true means a TTL value can be updated - // without firing a watch or changing the node value. A - // value must not be provided when refreshing a key. - Refresh bool - - // Dir specifies whether or not this Node should be created as a directory. - Dir bool - - // NoValueOnSuccess specifies whether the response contains the current value of the Node. - // If set, the response will only contain the current value when the request fails. - NoValueOnSuccess bool -} - -type GetOptions struct { - // Recursive defines whether or not all children of the Node - // should be returned. - Recursive bool - - // Sort instructs the server whether or not to sort the Nodes. - // If true, the Nodes are sorted alphabetically by key in - // ascending order (A to z). If false (default), the Nodes will - // not be sorted and the ordering used should not be considered - // predictable. - Sort bool - - // Quorum specifies whether it gets the latest committed value that - // has been applied in quorum of members, which ensures external - // consistency (or linearizability). - Quorum bool -} - -type DeleteOptions struct { - // PrevValue specifies what the current value of the Node must - // be in order for the Delete operation to succeed. - // - // Leaving this field empty means that the caller wishes to - // ignore the current value of the Node. This cannot be used - // to compare the Node's current value to an empty string. - PrevValue string - - // PrevIndex indicates what the current ModifiedIndex of the - // Node must be in order for the Delete operation to succeed. - // - // If PrevIndex is set to 0 (default), no comparison is made. - PrevIndex uint64 - - // Recursive defines whether or not all children of the Node - // should be deleted. If set to true, all children of the Node - // identified by the given key will be deleted. If left unset - // or explicitly set to false, only a single Node will be - // deleted. - Recursive bool - - // Dir specifies whether or not this Node should be removed as a directory. - Dir bool -} - -type Watcher interface { - // Next blocks until an etcd event occurs, then returns a Response - // representing that event. The behavior of Next depends on the - // WatcherOptions used to construct the Watcher. Next is designed to - // be called repeatedly, each time blocking until a subsequent event - // is available. - // - // If the provided context is cancelled, Next will return a non-nil - // error. Any other failures encountered while waiting for the next - // event (connection issues, deserialization failures, etc) will - // also result in a non-nil error. - Next(context.Context) (*Response, error) -} - -type Response struct { - // Action is the name of the operation that occurred. Possible values - // include get, set, delete, update, create, compareAndSwap, - // compareAndDelete and expire. - Action string `json:"action"` - - // Node represents the state of the relevant etcd Node. - Node *Node `json:"node"` - - // PrevNode represents the previous state of the Node. PrevNode is non-nil - // only if the Node existed before the action occurred and the action - // caused a change to the Node. - PrevNode *Node `json:"prevNode"` - - // Index holds the cluster-level index at the time the Response was generated. - // This index is not tied to the Node(s) contained in this Response. - Index uint64 `json:"-"` - - // ClusterID holds the cluster-level ID reported by the server. This - // should be different for different etcd clusters. - ClusterID string `json:"-"` -} - -type Node struct { - // Key represents the unique location of this Node (e.g. "/foo/bar"). - Key string `json:"key"` - - // Dir reports whether node describes a directory. - Dir bool `json:"dir,omitempty"` - - // Value is the current data stored on this Node. If this Node - // is a directory, Value will be empty. - Value string `json:"value"` - - // Nodes holds the children of this Node, only if this Node is a directory. - // This slice of will be arbitrarily deep (children, grandchildren, great- - // grandchildren, etc.) if a recursive Get or Watch request were made. - Nodes Nodes `json:"nodes"` - - // CreatedIndex is the etcd index at-which this Node was created. - CreatedIndex uint64 `json:"createdIndex"` - - // ModifiedIndex is the etcd index at-which this Node was last modified. - ModifiedIndex uint64 `json:"modifiedIndex"` - - // Expiration is the server side expiration time of the key. - Expiration *time.Time `json:"expiration,omitempty"` - - // TTL is the time to live of the key in second. - TTL int64 `json:"ttl,omitempty"` -} - -func (n *Node) String() string { - return fmt.Sprintf("{Key: %s, CreatedIndex: %d, ModifiedIndex: %d, TTL: %d}", n.Key, n.CreatedIndex, n.ModifiedIndex, n.TTL) -} - -// TTLDuration returns the Node's TTL as a time.Duration object -func (n *Node) TTLDuration() time.Duration { - return time.Duration(n.TTL) * time.Second -} - -type Nodes []*Node - -// interfaces for sorting - -func (ns Nodes) Len() int { return len(ns) } -func (ns Nodes) Less(i, j int) bool { return ns[i].Key < ns[j].Key } -func (ns Nodes) Swap(i, j int) { ns[i], ns[j] = ns[j], ns[i] } - -type httpKeysAPI struct { - client httpClient - prefix string -} - -func (k *httpKeysAPI) Set(ctx context.Context, key, val string, opts *SetOptions) (*Response, error) { - act := &setAction{ - Prefix: k.prefix, - Key: key, - Value: val, - } - - if opts != nil { - act.PrevValue = opts.PrevValue - act.PrevIndex = opts.PrevIndex - act.PrevExist = opts.PrevExist - act.TTL = opts.TTL - act.Refresh = opts.Refresh - act.Dir = opts.Dir - act.NoValueOnSuccess = opts.NoValueOnSuccess - } - - doCtx := ctx - if act.PrevExist == PrevNoExist { - doCtx = context.WithValue(doCtx, &oneShotCtxValue, &oneShotCtxValue) - } - resp, body, err := k.client.Do(doCtx, act) - if err != nil { - return nil, err - } - - return unmarshalHTTPResponse(resp.StatusCode, resp.Header, body) -} - -func (k *httpKeysAPI) Create(ctx context.Context, key, val string) (*Response, error) { - return k.Set(ctx, key, val, &SetOptions{PrevExist: PrevNoExist}) -} - -func (k *httpKeysAPI) CreateInOrder(ctx context.Context, dir, val string, opts *CreateInOrderOptions) (*Response, error) { - act := &createInOrderAction{ - Prefix: k.prefix, - Dir: dir, - Value: val, - } - - if opts != nil { - act.TTL = opts.TTL - } - - resp, body, err := k.client.Do(ctx, act) - if err != nil { - return nil, err - } - - return unmarshalHTTPResponse(resp.StatusCode, resp.Header, body) -} - -func (k *httpKeysAPI) Update(ctx context.Context, key, val string) (*Response, error) { - return k.Set(ctx, key, val, &SetOptions{PrevExist: PrevExist}) -} - -func (k *httpKeysAPI) Delete(ctx context.Context, key string, opts *DeleteOptions) (*Response, error) { - act := &deleteAction{ - Prefix: k.prefix, - Key: key, - } - - if opts != nil { - act.PrevValue = opts.PrevValue - act.PrevIndex = opts.PrevIndex - act.Dir = opts.Dir - act.Recursive = opts.Recursive - } - - doCtx := context.WithValue(ctx, &oneShotCtxValue, &oneShotCtxValue) - resp, body, err := k.client.Do(doCtx, act) - if err != nil { - return nil, err - } - - return unmarshalHTTPResponse(resp.StatusCode, resp.Header, body) -} - -func (k *httpKeysAPI) Get(ctx context.Context, key string, opts *GetOptions) (*Response, error) { - act := &getAction{ - Prefix: k.prefix, - Key: key, - } - - if opts != nil { - act.Recursive = opts.Recursive - act.Sorted = opts.Sort - act.Quorum = opts.Quorum - } - - resp, body, err := k.client.Do(ctx, act) - if err != nil { - return nil, err - } - - return unmarshalHTTPResponse(resp.StatusCode, resp.Header, body) -} - -func (k *httpKeysAPI) Watcher(key string, opts *WatcherOptions) Watcher { - act := waitAction{ - Prefix: k.prefix, - Key: key, - } - - if opts != nil { - act.Recursive = opts.Recursive - if opts.AfterIndex > 0 { - act.WaitIndex = opts.AfterIndex + 1 - } - } - - return &httpWatcher{ - client: k.client, - nextWait: act, - } -} - -type httpWatcher struct { - client httpClient - nextWait waitAction -} - -func (hw *httpWatcher) Next(ctx context.Context) (*Response, error) { - for { - httpresp, body, err := hw.client.Do(ctx, &hw.nextWait) - if err != nil { - return nil, err - } - - resp, err := unmarshalHTTPResponse(httpresp.StatusCode, httpresp.Header, body) - if err != nil { - if err == ErrEmptyBody { - continue - } - return nil, err - } - - hw.nextWait.WaitIndex = resp.Node.ModifiedIndex + 1 - return resp, nil - } -} - -// v2KeysURL forms a URL representing the location of a key. -// The endpoint argument represents the base URL of an etcd -// server. The prefix is the path needed to route from the -// provided endpoint's path to the root of the keys API -// (typically "/v2/keys"). -func v2KeysURL(ep url.URL, prefix, key string) *url.URL { - // We concatenate all parts together manually. We cannot use - // path.Join because it does not reserve trailing slash. - // We call CanonicalURLPath to further cleanup the path. - if prefix != "" && prefix[0] != '/' { - prefix = "/" + prefix - } - if key != "" && key[0] != '/' { - key = "/" + key - } - ep.Path = pathutil.CanonicalURLPath(ep.Path + prefix + key) - return &ep -} - -type getAction struct { - Prefix string - Key string - Recursive bool - Sorted bool - Quorum bool -} - -func (g *getAction) HTTPRequest(ep url.URL) *http.Request { - u := v2KeysURL(ep, g.Prefix, g.Key) - - params := u.Query() - params.Set("recursive", strconv.FormatBool(g.Recursive)) - params.Set("sorted", strconv.FormatBool(g.Sorted)) - params.Set("quorum", strconv.FormatBool(g.Quorum)) - u.RawQuery = params.Encode() - - req, _ := http.NewRequest("GET", u.String(), nil) - return req -} - -type waitAction struct { - Prefix string - Key string - WaitIndex uint64 - Recursive bool -} - -func (w *waitAction) HTTPRequest(ep url.URL) *http.Request { - u := v2KeysURL(ep, w.Prefix, w.Key) - - params := u.Query() - params.Set("wait", "true") - params.Set("waitIndex", strconv.FormatUint(w.WaitIndex, 10)) - params.Set("recursive", strconv.FormatBool(w.Recursive)) - u.RawQuery = params.Encode() - - req, _ := http.NewRequest("GET", u.String(), nil) - return req -} - -type setAction struct { - Prefix string - Key string - Value string - PrevValue string - PrevIndex uint64 - PrevExist PrevExistType - TTL time.Duration - Refresh bool - Dir bool - NoValueOnSuccess bool -} - -func (a *setAction) HTTPRequest(ep url.URL) *http.Request { - u := v2KeysURL(ep, a.Prefix, a.Key) - - params := u.Query() - form := url.Values{} - - // we're either creating a directory or setting a key - if a.Dir { - params.Set("dir", strconv.FormatBool(a.Dir)) - } else { - // These options are only valid for setting a key - if a.PrevValue != "" { - params.Set("prevValue", a.PrevValue) - } - form.Add("value", a.Value) - } - - // Options which apply to both setting a key and creating a dir - if a.PrevIndex != 0 { - params.Set("prevIndex", strconv.FormatUint(a.PrevIndex, 10)) - } - if a.PrevExist != PrevIgnore { - params.Set("prevExist", string(a.PrevExist)) - } - if a.TTL > 0 { - form.Add("ttl", strconv.FormatUint(uint64(a.TTL.Seconds()), 10)) - } - - if a.Refresh { - form.Add("refresh", "true") - } - if a.NoValueOnSuccess { - params.Set("noValueOnSuccess", strconv.FormatBool(a.NoValueOnSuccess)) - } - - u.RawQuery = params.Encode() - body := strings.NewReader(form.Encode()) - - req, _ := http.NewRequest("PUT", u.String(), body) - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - - return req -} - -type deleteAction struct { - Prefix string - Key string - PrevValue string - PrevIndex uint64 - Dir bool - Recursive bool -} - -func (a *deleteAction) HTTPRequest(ep url.URL) *http.Request { - u := v2KeysURL(ep, a.Prefix, a.Key) - - params := u.Query() - if a.PrevValue != "" { - params.Set("prevValue", a.PrevValue) - } - if a.PrevIndex != 0 { - params.Set("prevIndex", strconv.FormatUint(a.PrevIndex, 10)) - } - if a.Dir { - params.Set("dir", "true") - } - if a.Recursive { - params.Set("recursive", "true") - } - u.RawQuery = params.Encode() - - req, _ := http.NewRequest("DELETE", u.String(), nil) - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - - return req -} - -type createInOrderAction struct { - Prefix string - Dir string - Value string - TTL time.Duration -} - -func (a *createInOrderAction) HTTPRequest(ep url.URL) *http.Request { - u := v2KeysURL(ep, a.Prefix, a.Dir) - - form := url.Values{} - form.Add("value", a.Value) - if a.TTL > 0 { - form.Add("ttl", strconv.FormatUint(uint64(a.TTL.Seconds()), 10)) - } - body := strings.NewReader(form.Encode()) - - req, _ := http.NewRequest("POST", u.String(), body) - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - return req -} - -func unmarshalHTTPResponse(code int, header http.Header, body []byte) (res *Response, err error) { - switch code { - case http.StatusOK, http.StatusCreated: - if len(body) == 0 { - return nil, ErrEmptyBody - } - res, err = unmarshalSuccessfulKeysResponse(header, body) - default: - err = unmarshalFailedKeysResponse(body) - } - return res, err -} - -func unmarshalSuccessfulKeysResponse(header http.Header, body []byte) (*Response, error) { - var res Response - err := codec.NewDecoderBytes(body, new(codec.JsonHandle)).Decode(&res) - if err != nil { - return nil, ErrInvalidJSON - } - if header.Get("X-Etcd-Index") != "" { - res.Index, err = strconv.ParseUint(header.Get("X-Etcd-Index"), 10, 64) - if err != nil { - return nil, err - } - } - res.ClusterID = header.Get("X-Etcd-Cluster-ID") - return &res, nil -} - -func unmarshalFailedKeysResponse(body []byte) error { - var etcdErr Error - if err := json.Unmarshal(body, &etcdErr); err != nil { - return ErrInvalidJSON - } - return etcdErr -} diff --git a/vendor/github.com/coreos/etcd/client/members.go b/vendor/github.com/coreos/etcd/client/members.go deleted file mode 100644 index aafa3d1b..00000000 --- a/vendor/github.com/coreos/etcd/client/members.go +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - "path" - - "github.com/coreos/etcd/pkg/types" -) - -var ( - defaultV2MembersPrefix = "/v2/members" - defaultLeaderSuffix = "/leader" -) - -type Member struct { - // ID is the unique identifier of this Member. - ID string `json:"id"` - - // Name is a human-readable, non-unique identifier of this Member. - Name string `json:"name"` - - // PeerURLs represents the HTTP(S) endpoints this Member uses to - // participate in etcd's consensus protocol. - PeerURLs []string `json:"peerURLs"` - - // ClientURLs represents the HTTP(S) endpoints on which this Member - // serves its client-facing APIs. - ClientURLs []string `json:"clientURLs"` -} - -type memberCollection []Member - -func (c *memberCollection) UnmarshalJSON(data []byte) error { - d := struct { - Members []Member - }{} - - if err := json.Unmarshal(data, &d); err != nil { - return err - } - - if d.Members == nil { - *c = make([]Member, 0) - return nil - } - - *c = d.Members - return nil -} - -type memberCreateOrUpdateRequest struct { - PeerURLs types.URLs -} - -func (m *memberCreateOrUpdateRequest) MarshalJSON() ([]byte, error) { - s := struct { - PeerURLs []string `json:"peerURLs"` - }{ - PeerURLs: make([]string, len(m.PeerURLs)), - } - - for i, u := range m.PeerURLs { - s.PeerURLs[i] = u.String() - } - - return json.Marshal(&s) -} - -// NewMembersAPI constructs a new MembersAPI that uses HTTP to -// interact with etcd's membership API. -func NewMembersAPI(c Client) MembersAPI { - return &httpMembersAPI{ - client: c, - } -} - -type MembersAPI interface { - // List enumerates the current cluster membership. - List(ctx context.Context) ([]Member, error) - - // Add instructs etcd to accept a new Member into the cluster. - Add(ctx context.Context, peerURL string) (*Member, error) - - // Remove demotes an existing Member out of the cluster. - Remove(ctx context.Context, mID string) error - - // Update instructs etcd to update an existing Member in the cluster. - Update(ctx context.Context, mID string, peerURLs []string) error - - // Leader gets current leader of the cluster - Leader(ctx context.Context) (*Member, error) -} - -type httpMembersAPI struct { - client httpClient -} - -func (m *httpMembersAPI) List(ctx context.Context) ([]Member, error) { - req := &membersAPIActionList{} - resp, body, err := m.client.Do(ctx, req) - if err != nil { - return nil, err - } - - if err := assertStatusCode(resp.StatusCode, http.StatusOK); err != nil { - return nil, err - } - - var mCollection memberCollection - if err := json.Unmarshal(body, &mCollection); err != nil { - return nil, err - } - - return []Member(mCollection), nil -} - -func (m *httpMembersAPI) Add(ctx context.Context, peerURL string) (*Member, error) { - urls, err := types.NewURLs([]string{peerURL}) - if err != nil { - return nil, err - } - - req := &membersAPIActionAdd{peerURLs: urls} - resp, body, err := m.client.Do(ctx, req) - if err != nil { - return nil, err - } - - if err := assertStatusCode(resp.StatusCode, http.StatusCreated, http.StatusConflict); err != nil { - return nil, err - } - - if resp.StatusCode != http.StatusCreated { - var merr membersError - if err := json.Unmarshal(body, &merr); err != nil { - return nil, err - } - return nil, merr - } - - var memb Member - if err := json.Unmarshal(body, &memb); err != nil { - return nil, err - } - - return &memb, nil -} - -func (m *httpMembersAPI) Update(ctx context.Context, memberID string, peerURLs []string) error { - urls, err := types.NewURLs(peerURLs) - if err != nil { - return err - } - - req := &membersAPIActionUpdate{peerURLs: urls, memberID: memberID} - resp, body, err := m.client.Do(ctx, req) - if err != nil { - return err - } - - if err := assertStatusCode(resp.StatusCode, http.StatusNoContent, http.StatusNotFound, http.StatusConflict); err != nil { - return err - } - - if resp.StatusCode != http.StatusNoContent { - var merr membersError - if err := json.Unmarshal(body, &merr); err != nil { - return err - } - return merr - } - - return nil -} - -func (m *httpMembersAPI) Remove(ctx context.Context, memberID string) error { - req := &membersAPIActionRemove{memberID: memberID} - resp, _, err := m.client.Do(ctx, req) - if err != nil { - return err - } - - return assertStatusCode(resp.StatusCode, http.StatusNoContent, http.StatusGone) -} - -func (m *httpMembersAPI) Leader(ctx context.Context) (*Member, error) { - req := &membersAPIActionLeader{} - resp, body, err := m.client.Do(ctx, req) - if err != nil { - return nil, err - } - - if err := assertStatusCode(resp.StatusCode, http.StatusOK); err != nil { - return nil, err - } - - var leader Member - if err := json.Unmarshal(body, &leader); err != nil { - return nil, err - } - - return &leader, nil -} - -type membersAPIActionList struct{} - -func (l *membersAPIActionList) HTTPRequest(ep url.URL) *http.Request { - u := v2MembersURL(ep) - req, _ := http.NewRequest("GET", u.String(), nil) - return req -} - -type membersAPIActionRemove struct { - memberID string -} - -func (d *membersAPIActionRemove) HTTPRequest(ep url.URL) *http.Request { - u := v2MembersURL(ep) - u.Path = path.Join(u.Path, d.memberID) - req, _ := http.NewRequest("DELETE", u.String(), nil) - return req -} - -type membersAPIActionAdd struct { - peerURLs types.URLs -} - -func (a *membersAPIActionAdd) HTTPRequest(ep url.URL) *http.Request { - u := v2MembersURL(ep) - m := memberCreateOrUpdateRequest{PeerURLs: a.peerURLs} - b, _ := json.Marshal(&m) - req, _ := http.NewRequest("POST", u.String(), bytes.NewReader(b)) - req.Header.Set("Content-Type", "application/json") - return req -} - -type membersAPIActionUpdate struct { - memberID string - peerURLs types.URLs -} - -func (a *membersAPIActionUpdate) HTTPRequest(ep url.URL) *http.Request { - u := v2MembersURL(ep) - m := memberCreateOrUpdateRequest{PeerURLs: a.peerURLs} - u.Path = path.Join(u.Path, a.memberID) - b, _ := json.Marshal(&m) - req, _ := http.NewRequest("PUT", u.String(), bytes.NewReader(b)) - req.Header.Set("Content-Type", "application/json") - return req -} - -func assertStatusCode(got int, want ...int) (err error) { - for _, w := range want { - if w == got { - return nil - } - } - return fmt.Errorf("unexpected status code %d", got) -} - -type membersAPIActionLeader struct{} - -func (l *membersAPIActionLeader) HTTPRequest(ep url.URL) *http.Request { - u := v2MembersURL(ep) - u.Path = path.Join(u.Path, defaultLeaderSuffix) - req, _ := http.NewRequest("GET", u.String(), nil) - return req -} - -// v2MembersURL add the necessary path to the provided endpoint -// to route requests to the default v2 members API. -func v2MembersURL(ep url.URL) *url.URL { - ep.Path = path.Join(ep.Path, defaultV2MembersPrefix) - return &ep -} - -type membersError struct { - Message string `json:"message"` - Code int `json:"-"` -} - -func (e membersError) Error() string { - return e.Message -} diff --git a/vendor/github.com/coreos/etcd/client/util.go b/vendor/github.com/coreos/etcd/client/util.go deleted file mode 100644 index 15a8babf..00000000 --- a/vendor/github.com/coreos/etcd/client/util.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package client - -import ( - "regexp" -) - -var ( - roleNotFoundRegExp *regexp.Regexp - userNotFoundRegExp *regexp.Regexp -) - -func init() { - roleNotFoundRegExp = regexp.MustCompile("auth: Role .* does not exist.") - userNotFoundRegExp = regexp.MustCompile("auth: User .* does not exist.") -} - -// IsKeyNotFound returns true if the error code is ErrorCodeKeyNotFound. -func IsKeyNotFound(err error) bool { - if cErr, ok := err.(Error); ok { - return cErr.Code == ErrorCodeKeyNotFound - } - return false -} - -// IsRoleNotFound returns true if the error means role not found of v2 API. -func IsRoleNotFound(err error) bool { - if ae, ok := err.(authError); ok { - return roleNotFoundRegExp.MatchString(ae.Message) - } - return false -} - -// IsUserNotFound returns true if the error means user not found of v2 API. -func IsUserNotFound(err error) bool { - if ae, ok := err.(authError); ok { - return userNotFoundRegExp.MatchString(ae.Message) - } - return false -} diff --git a/vendor/github.com/coreos/etcd/pkg/pathutil/LICENSE b/vendor/github.com/coreos/etcd/pkg/pathutil/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/pkg/pathutil/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/pkg/pathutil/path.go b/vendor/github.com/coreos/etcd/pkg/pathutil/path.go deleted file mode 100644 index f26254ba..00000000 --- a/vendor/github.com/coreos/etcd/pkg/pathutil/path.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package pathutil implements utility functions for handling slash-separated -// paths. -package pathutil - -import "path" - -// CanonicalURLPath returns the canonical url path for p, which follows the rules: -// 1. the path always starts with "/" -// 2. replace multiple slashes with a single slash -// 3. replace each '.' '..' path name element with equivalent one -// 4. keep the trailing slash -// The function is borrowed from stdlib http.cleanPath in server.go. -func CanonicalURLPath(p string) string { - if p == "" { - return "/" - } - if p[0] != '/' { - p = "/" + p - } - np := path.Clean(p) - // path.Clean removes trailing slash except for root, - // put the trailing slash back if necessary. - if p[len(p)-1] == '/' && np != "/" { - np += "/" - } - return np -} diff --git a/vendor/github.com/coreos/etcd/pkg/srv/LICENSE b/vendor/github.com/coreos/etcd/pkg/srv/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/pkg/srv/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/pkg/srv/srv.go b/vendor/github.com/coreos/etcd/pkg/srv/srv.go deleted file mode 100644 index e1df5254..00000000 --- a/vendor/github.com/coreos/etcd/pkg/srv/srv.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package srv looks up DNS SRV records. -package srv - -import ( - "fmt" - "net" - "net/url" - "strings" - - "github.com/coreos/etcd/pkg/types" -) - -var ( - // indirection for testing - lookupSRV = net.LookupSRV // net.DefaultResolver.LookupSRV when ctxs don't conflict - resolveTCPAddr = net.ResolveTCPAddr -) - -// GetCluster gets the cluster information via DNS discovery. -// Also sees each entry as a separate instance. -func GetCluster(serviceScheme, service, name, dns string, apurls types.URLs) ([]string, error) { - tempName := int(0) - tcp2ap := make(map[string]url.URL) - - // First, resolve the apurls - for _, url := range apurls { - tcpAddr, err := resolveTCPAddr("tcp", url.Host) - if err != nil { - return nil, err - } - tcp2ap[tcpAddr.String()] = url - } - - stringParts := []string{} - updateNodeMap := func(service, scheme string) error { - _, addrs, err := lookupSRV(service, "tcp", dns) - if err != nil { - return err - } - for _, srv := range addrs { - port := fmt.Sprintf("%d", srv.Port) - host := net.JoinHostPort(srv.Target, port) - tcpAddr, terr := resolveTCPAddr("tcp", host) - if terr != nil { - err = terr - continue - } - n := "" - url, ok := tcp2ap[tcpAddr.String()] - if ok { - n = name - } - if n == "" { - n = fmt.Sprintf("%d", tempName) - tempName++ - } - // SRV records have a trailing dot but URL shouldn't. - shortHost := strings.TrimSuffix(srv.Target, ".") - urlHost := net.JoinHostPort(shortHost, port) - if ok && url.Scheme != scheme { - err = fmt.Errorf("bootstrap at %s from DNS for %s has scheme mismatch with expected peer %s", scheme+"://"+urlHost, service, url.String()) - } else { - stringParts = append(stringParts, fmt.Sprintf("%s=%s://%s", n, scheme, urlHost)) - } - } - if len(stringParts) == 0 { - return err - } - return nil - } - - err := updateNodeMap(service, serviceScheme) - if err != nil { - return nil, fmt.Errorf("error querying DNS SRV records for _%s %s", service, err) - } - return stringParts, nil -} - -type SRVClients struct { - Endpoints []string - SRVs []*net.SRV -} - -// GetClient looks up the client endpoints for a service and domain. -func GetClient(service, domain string) (*SRVClients, error) { - var urls []*url.URL - var srvs []*net.SRV - - updateURLs := func(service, scheme string) error { - _, addrs, err := lookupSRV(service, "tcp", domain) - if err != nil { - return err - } - for _, srv := range addrs { - urls = append(urls, &url.URL{ - Scheme: scheme, - Host: net.JoinHostPort(srv.Target, fmt.Sprintf("%d", srv.Port)), - }) - } - srvs = append(srvs, addrs...) - return nil - } - - errHTTPS := updateURLs(service+"-ssl", "https") - errHTTP := updateURLs(service, "http") - - if errHTTPS != nil && errHTTP != nil { - return nil, fmt.Errorf("dns lookup errors: %s and %s", errHTTPS, errHTTP) - } - - endpoints := make([]string, len(urls)) - for i := range urls { - endpoints[i] = urls[i].String() - } - return &SRVClients{Endpoints: endpoints, SRVs: srvs}, nil -} diff --git a/vendor/github.com/coreos/etcd/pkg/types/LICENSE b/vendor/github.com/coreos/etcd/pkg/types/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/pkg/types/doc.go b/vendor/github.com/coreos/etcd/pkg/types/doc.go deleted file mode 100644 index de8ef0bd..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package types declares various data types and implements type-checking -// functions. -package types diff --git a/vendor/github.com/coreos/etcd/pkg/types/id.go b/vendor/github.com/coreos/etcd/pkg/types/id.go deleted file mode 100644 index 1b042d9c..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/id.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "strconv" -) - -// ID represents a generic identifier which is canonically -// stored as a uint64 but is typically represented as a -// base-16 string for input/output -type ID uint64 - -func (i ID) String() string { - return strconv.FormatUint(uint64(i), 16) -} - -// IDFromString attempts to create an ID from a base-16 string. -func IDFromString(s string) (ID, error) { - i, err := strconv.ParseUint(s, 16, 64) - return ID(i), err -} - -// IDSlice implements the sort interface -type IDSlice []ID - -func (p IDSlice) Len() int { return len(p) } -func (p IDSlice) Less(i, j int) bool { return uint64(p[i]) < uint64(p[j]) } -func (p IDSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/coreos/etcd/pkg/types/set.go b/vendor/github.com/coreos/etcd/pkg/types/set.go deleted file mode 100644 index c111b0c0..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/set.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "reflect" - "sort" - "sync" -) - -type Set interface { - Add(string) - Remove(string) - Contains(string) bool - Equals(Set) bool - Length() int - Values() []string - Copy() Set - Sub(Set) Set -} - -func NewUnsafeSet(values ...string) *unsafeSet { - set := &unsafeSet{make(map[string]struct{})} - for _, v := range values { - set.Add(v) - } - return set -} - -func NewThreadsafeSet(values ...string) *tsafeSet { - us := NewUnsafeSet(values...) - return &tsafeSet{us, sync.RWMutex{}} -} - -type unsafeSet struct { - d map[string]struct{} -} - -// Add adds a new value to the set (no-op if the value is already present) -func (us *unsafeSet) Add(value string) { - us.d[value] = struct{}{} -} - -// Remove removes the given value from the set -func (us *unsafeSet) Remove(value string) { - delete(us.d, value) -} - -// Contains returns whether the set contains the given value -func (us *unsafeSet) Contains(value string) (exists bool) { - _, exists = us.d[value] - return exists -} - -// ContainsAll returns whether the set contains all given values -func (us *unsafeSet) ContainsAll(values []string) bool { - for _, s := range values { - if !us.Contains(s) { - return false - } - } - return true -} - -// Equals returns whether the contents of two sets are identical -func (us *unsafeSet) Equals(other Set) bool { - v1 := sort.StringSlice(us.Values()) - v2 := sort.StringSlice(other.Values()) - v1.Sort() - v2.Sort() - return reflect.DeepEqual(v1, v2) -} - -// Length returns the number of elements in the set -func (us *unsafeSet) Length() int { - return len(us.d) -} - -// Values returns the values of the Set in an unspecified order. -func (us *unsafeSet) Values() (values []string) { - values = make([]string, 0) - for val := range us.d { - values = append(values, val) - } - return values -} - -// Copy creates a new Set containing the values of the first -func (us *unsafeSet) Copy() Set { - cp := NewUnsafeSet() - for val := range us.d { - cp.Add(val) - } - - return cp -} - -// Sub removes all elements in other from the set -func (us *unsafeSet) Sub(other Set) Set { - oValues := other.Values() - result := us.Copy().(*unsafeSet) - - for _, val := range oValues { - if _, ok := result.d[val]; !ok { - continue - } - delete(result.d, val) - } - - return result -} - -type tsafeSet struct { - us *unsafeSet - m sync.RWMutex -} - -func (ts *tsafeSet) Add(value string) { - ts.m.Lock() - defer ts.m.Unlock() - ts.us.Add(value) -} - -func (ts *tsafeSet) Remove(value string) { - ts.m.Lock() - defer ts.m.Unlock() - ts.us.Remove(value) -} - -func (ts *tsafeSet) Contains(value string) (exists bool) { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Contains(value) -} - -func (ts *tsafeSet) Equals(other Set) bool { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Equals(other) -} - -func (ts *tsafeSet) Length() int { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Length() -} - -func (ts *tsafeSet) Values() (values []string) { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Values() -} - -func (ts *tsafeSet) Copy() Set { - ts.m.RLock() - defer ts.m.RUnlock() - usResult := ts.us.Copy().(*unsafeSet) - return &tsafeSet{usResult, sync.RWMutex{}} -} - -func (ts *tsafeSet) Sub(other Set) Set { - ts.m.RLock() - defer ts.m.RUnlock() - usResult := ts.us.Sub(other).(*unsafeSet) - return &tsafeSet{usResult, sync.RWMutex{}} -} diff --git a/vendor/github.com/coreos/etcd/pkg/types/slice.go b/vendor/github.com/coreos/etcd/pkg/types/slice.go deleted file mode 100644 index 0dd9ca79..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/slice.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -// Uint64Slice implements sort interface -type Uint64Slice []uint64 - -func (p Uint64Slice) Len() int { return len(p) } -func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/coreos/etcd/pkg/types/urls.go b/vendor/github.com/coreos/etcd/pkg/types/urls.go deleted file mode 100644 index 9e5d03ff..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/urls.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "errors" - "fmt" - "net" - "net/url" - "sort" - "strings" -) - -type URLs []url.URL - -func NewURLs(strs []string) (URLs, error) { - all := make([]url.URL, len(strs)) - if len(all) == 0 { - return nil, errors.New("no valid URLs given") - } - for i, in := range strs { - in = strings.TrimSpace(in) - u, err := url.Parse(in) - if err != nil { - return nil, err - } - if u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "unix" && u.Scheme != "unixs" { - return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in) - } - if _, _, err := net.SplitHostPort(u.Host); err != nil { - return nil, fmt.Errorf(`URL address does not have the form "host:port": %s`, in) - } - if u.Path != "" { - return nil, fmt.Errorf("URL must not contain a path: %s", in) - } - all[i] = *u - } - us := URLs(all) - us.Sort() - - return us, nil -} - -func MustNewURLs(strs []string) URLs { - urls, err := NewURLs(strs) - if err != nil { - panic(err) - } - return urls -} - -func (us URLs) String() string { - return strings.Join(us.StringSlice(), ",") -} - -func (us *URLs) Sort() { - sort.Sort(us) -} -func (us URLs) Len() int { return len(us) } -func (us URLs) Less(i, j int) bool { return us[i].String() < us[j].String() } -func (us URLs) Swap(i, j int) { us[i], us[j] = us[j], us[i] } - -func (us URLs) StringSlice() []string { - out := make([]string, len(us)) - for i := range us { - out[i] = us[i].String() - } - - return out -} diff --git a/vendor/github.com/coreos/etcd/pkg/types/urlsmap.go b/vendor/github.com/coreos/etcd/pkg/types/urlsmap.go deleted file mode 100644 index 47690cc3..00000000 --- a/vendor/github.com/coreos/etcd/pkg/types/urlsmap.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "sort" - "strings" -) - -// URLsMap is a map from a name to its URLs. -type URLsMap map[string]URLs - -// NewURLsMap returns a URLsMap instantiated from the given string, -// which consists of discovery-formatted names-to-URLs, like: -// mach0=http://1.1.1.1:2380,mach0=http://2.2.2.2::2380,mach1=http://3.3.3.3:2380,mach2=http://4.4.4.4:2380 -func NewURLsMap(s string) (URLsMap, error) { - m := parse(s) - - cl := URLsMap{} - for name, urls := range m { - us, err := NewURLs(urls) - if err != nil { - return nil, err - } - cl[name] = us - } - return cl, nil -} - -// NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The -// string values in the map can be multiple values separated by the sep string. -func NewURLsMapFromStringMap(m map[string]string, sep string) (URLsMap, error) { - var err error - um := URLsMap{} - for k, v := range m { - um[k], err = NewURLs(strings.Split(v, sep)) - if err != nil { - return nil, err - } - } - return um, nil -} - -// String turns URLsMap into discovery-formatted name-to-URLs sorted by name. -func (c URLsMap) String() string { - var pairs []string - for name, urls := range c { - for _, url := range urls { - pairs = append(pairs, fmt.Sprintf("%s=%s", name, url.String())) - } - } - sort.Strings(pairs) - return strings.Join(pairs, ",") -} - -// URLs returns a list of all URLs. -// The returned list is sorted in ascending lexicographical order. -func (c URLsMap) URLs() []string { - var urls []string - for _, us := range c { - for _, u := range us { - urls = append(urls, u.String()) - } - } - sort.Strings(urls) - return urls -} - -// Len returns the size of URLsMap. -func (c URLsMap) Len() int { - return len(c) -} - -// parse parses the given string and returns a map listing the values specified for each key. -func parse(s string) map[string][]string { - m := make(map[string][]string) - for s != "" { - key := s - if i := strings.IndexAny(key, ","); i >= 0 { - key, s = key[:i], key[i+1:] - } else { - s = "" - } - if key == "" { - continue - } - value := "" - if i := strings.Index(key, "="); i >= 0 { - key, value = key[:i], key[i+1:] - } - m[key] = append(m[key], value) - } - return m -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/LICENSE b/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/semver.go b/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/semver.go deleted file mode 100644 index 110fc23e..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/semver.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2013-2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Semantic Versions http://semver.org -package semver - -import ( - "bytes" - "errors" - "fmt" - "strconv" - "strings" -) - -type Version struct { - Major int64 - Minor int64 - Patch int64 - PreRelease PreRelease - Metadata string -} - -type PreRelease string - -func splitOff(input *string, delim string) (val string) { - parts := strings.SplitN(*input, delim, 2) - - if len(parts) == 2 { - *input = parts[0] - val = parts[1] - } - - return val -} - -func New(version string) *Version { - return Must(NewVersion(version)) -} - -func NewVersion(version string) (*Version, error) { - v := Version{} - - if err := v.Set(version); err != nil { - return nil, err - } - - return &v, nil -} - -// Must is a helper for wrapping NewVersion and will panic if err is not nil. -func Must(v *Version, err error) *Version { - if err != nil { - panic(err) - } - return v -} - -// Set parses and updates v from the given version string. Implements flag.Value -func (v *Version) Set(version string) error { - metadata := splitOff(&version, "+") - preRelease := PreRelease(splitOff(&version, "-")) - dotParts := strings.SplitN(version, ".", 3) - - if len(dotParts) != 3 { - return fmt.Errorf("%s is not in dotted-tri format", version) - } - - parsed := make([]int64, 3, 3) - - for i, v := range dotParts[:3] { - val, err := strconv.ParseInt(v, 10, 64) - parsed[i] = val - if err != nil { - return err - } - } - - v.Metadata = metadata - v.PreRelease = preRelease - v.Major = parsed[0] - v.Minor = parsed[1] - v.Patch = parsed[2] - return nil -} - -func (v Version) String() string { - var buffer bytes.Buffer - - fmt.Fprintf(&buffer, "%d.%d.%d", v.Major, v.Minor, v.Patch) - - if v.PreRelease != "" { - fmt.Fprintf(&buffer, "-%s", v.PreRelease) - } - - if v.Metadata != "" { - fmt.Fprintf(&buffer, "+%s", v.Metadata) - } - - return buffer.String() -} - -func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error { - var data string - if err := unmarshal(&data); err != nil { - return err - } - return v.Set(data) -} - -func (v Version) MarshalJSON() ([]byte, error) { - return []byte(`"` + v.String() + `"`), nil -} - -func (v *Version) UnmarshalJSON(data []byte) error { - l := len(data) - if l == 0 || string(data) == `""` { - return nil - } - if l < 2 || data[0] != '"' || data[l-1] != '"' { - return errors.New("invalid semver string") - } - return v.Set(string(data[1 : l-1])) -} - -// Compare tests if v is less than, equal to, or greater than versionB, -// returning -1, 0, or +1 respectively. -func (v Version) Compare(versionB Version) int { - if cmp := recursiveCompare(v.Slice(), versionB.Slice()); cmp != 0 { - return cmp - } - return preReleaseCompare(v, versionB) -} - -// Equal tests if v is equal to versionB. -func (v Version) Equal(versionB Version) bool { - return v.Compare(versionB) == 0 -} - -// LessThan tests if v is less than versionB. -func (v Version) LessThan(versionB Version) bool { - return v.Compare(versionB) < 0 -} - -// Slice converts the comparable parts of the semver into a slice of integers. -func (v Version) Slice() []int64 { - return []int64{v.Major, v.Minor, v.Patch} -} - -func (p PreRelease) Slice() []string { - preRelease := string(p) - return strings.Split(preRelease, ".") -} - -func preReleaseCompare(versionA Version, versionB Version) int { - a := versionA.PreRelease - b := versionB.PreRelease - - /* Handle the case where if two versions are otherwise equal it is the - * one without a PreRelease that is greater */ - if len(a) == 0 && (len(b) > 0) { - return 1 - } else if len(b) == 0 && (len(a) > 0) { - return -1 - } - - // If there is a prerelease, check and compare each part. - return recursivePreReleaseCompare(a.Slice(), b.Slice()) -} - -func recursiveCompare(versionA []int64, versionB []int64) int { - if len(versionA) == 0 { - return 0 - } - - a := versionA[0] - b := versionB[0] - - if a > b { - return 1 - } else if a < b { - return -1 - } - - return recursiveCompare(versionA[1:], versionB[1:]) -} - -func recursivePreReleaseCompare(versionA []string, versionB []string) int { - // A larger set of pre-release fields has a higher precedence than a smaller set, - // if all of the preceding identifiers are equal. - if len(versionA) == 0 { - if len(versionB) > 0 { - return -1 - } - return 0 - } else if len(versionB) == 0 { - // We're longer than versionB so return 1. - return 1 - } - - a := versionA[0] - b := versionB[0] - - aInt := false - bInt := false - - aI, err := strconv.Atoi(versionA[0]) - if err == nil { - aInt = true - } - - bI, err := strconv.Atoi(versionB[0]) - if err == nil { - bInt = true - } - - // Handle Integer Comparison - if aInt && bInt { - if aI > bI { - return 1 - } else if aI < bI { - return -1 - } - } - - // Handle String Comparison - if a > b { - return 1 - } else if a < b { - return -1 - } - - return recursivePreReleaseCompare(versionA[1:], versionB[1:]) -} - -// BumpMajor increments the Major field by 1 and resets all other fields to their default values -func (v *Version) BumpMajor() { - v.Major += 1 - v.Minor = 0 - v.Patch = 0 - v.PreRelease = PreRelease("") - v.Metadata = "" -} - -// BumpMinor increments the Minor field by 1 and resets all other fields to their default values -func (v *Version) BumpMinor() { - v.Minor += 1 - v.Patch = 0 - v.PreRelease = PreRelease("") - v.Metadata = "" -} - -// BumpPatch increments the Patch field by 1 and resets all other fields to their default values -func (v *Version) BumpPatch() { - v.Patch += 1 - v.PreRelease = PreRelease("") - v.Metadata = "" -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/sort.go b/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/sort.go deleted file mode 100644 index e256b41a..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/coreos/go-semver/semver/sort.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013-2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package semver - -import ( - "sort" -) - -type Versions []*Version - -func (s Versions) Len() int { - return len(s) -} - -func (s Versions) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -func (s Versions) Less(i, j int) bool { - return s[i].LessThan(*s[j]) -} - -// Sort sorts the given slice of Version -func Sort(versions []*Version) { - sort.Sort(Versions(versions)) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/0doc.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/0doc.go deleted file mode 100644 index cfb804ec..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/0doc.go +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -/* -High Performance, Feature-Rich Idiomatic Go 1.4+ codec/encoding library for -binc, msgpack, cbor, json - -Supported Serialization formats are: - - - msgpack: https://github.com/msgpack/msgpack - - binc: http://github.com/ugorji/binc - - cbor: http://cbor.io http://tools.ietf.org/html/rfc7049 - - json: http://json.org http://tools.ietf.org/html/rfc7159 - - simple: - -To install: - - go get github.com/ugorji/go/codec - -This package will carefully use 'unsafe' for performance reasons in specific places. -You can build without unsafe use by passing the safe or appengine tag -i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 -go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from -go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. - -For detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer . - -The idiomatic Go support is as seen in other encoding packages in -the standard library (ie json, xml, gob, etc). - -Rich Feature Set includes: - - - Simple but extremely powerful and feature-rich API - - Support for go1.4 and above, while selectively using newer APIs for later releases - - Good code coverage ( > 70% ) - - Very High Performance. - Our extensive benchmarks show us outperforming Gob, Json, Bson, etc by 2-4X. - - Careful selected use of 'unsafe' for targeted performance gains. - 100% mode exists where 'unsafe' is not used at all. - - Lock-free (sans mutex) concurrency for scaling to 100's of cores - - Multiple conversions: - Package coerces types where appropriate - e.g. decode an int in the stream into a float, etc. - - Corner Cases: - Overflows, nil maps/slices, nil values in streams are handled correctly - - Standard field renaming via tags - - Support for omitting empty fields during an encoding - - Encoding from any value and decoding into pointer to any value - (struct, slice, map, primitives, pointers, interface{}, etc) - - Extensions to support efficient encoding/decoding of any named types - - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces - - Decoding without a schema (into a interface{}). - Includes Options to configure what specific map or slice type to use - when decoding an encoded list or map into a nil interface{} - - Encode a struct as an array, and decode struct from an array in the data stream - - Comprehensive support for anonymous fields - - Fast (no-reflection) encoding/decoding of common maps and slices - - Code-generation for faster performance. - - Support binary (e.g. messagepack, cbor) and text (e.g. json) formats - - Support indefinite-length formats to enable true streaming - (for formats which support it e.g. json, cbor) - - Support canonical encoding, where a value is ALWAYS encoded as same sequence of bytes. - This mostly applies to maps, where iteration order is non-deterministic. - - NIL in data stream decoded as zero value - - Never silently skip data when decoding. - User decides whether to return an error or silently skip data when keys or indexes - in the data stream do not map to fields in the struct. - - Detect and error when encoding a cyclic reference (instead of stack overflow shutdown) - - Encode/Decode from/to chan types (for iterative streaming support) - - Drop-in replacement for encoding/json. `json:` key in struct tag supported. - - Provides a RPC Server and Client Codec for net/rpc communication protocol. - - Handle unique idiosyncrasies of codecs e.g. - - For messagepack, configure how ambiguities in handling raw bytes are resolved - - For messagepack, provide rpc server/client codec to support - msgpack-rpc protocol defined at: - https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md - -Extension Support - -Users can register a function to handle the encoding or decoding of -their custom types. - -There are no restrictions on what the custom type can be. Some examples: - - type BisSet []int - type BitSet64 uint64 - type UUID string - type MyStructWithUnexportedFields struct { a int; b bool; c []int; } - type GifImage struct { ... } - -As an illustration, MyStructWithUnexportedFields would normally be -encoded as an empty map because it has no exported fields, while UUID -would be encoded as a string. However, with extension support, you can -encode any of these however you like. - -RPC - -RPC Client and Server Codecs are implemented, so the codecs can be used -with the standard net/rpc package. - -Usage - -The Handle is SAFE for concurrent READ, but NOT SAFE for concurrent modification. - -The Encoder and Decoder are NOT safe for concurrent use. - -Consequently, the usage model is basically: - - - Create and initialize the Handle before any use. - Once created, DO NOT modify it. - - Multiple Encoders or Decoders can now use the Handle concurrently. - They only read information off the Handle (never write). - - However, each Encoder or Decoder MUST not be used concurrently - - To re-use an Encoder/Decoder, call Reset(...) on it first. - This allows you use state maintained on the Encoder/Decoder. - -Sample usage model: - - // create and configure Handle - var ( - bh codec.BincHandle - mh codec.MsgpackHandle - ch codec.CborHandle - ) - - mh.MapType = reflect.TypeOf(map[string]interface{}(nil)) - - // configure extensions - // e.g. for msgpack, define functions and enable Time support for tag 1 - // mh.SetExt(reflect.TypeOf(time.Time{}), 1, myExt) - - // create and use decoder/encoder - var ( - r io.Reader - w io.Writer - b []byte - h = &bh // or mh to use msgpack - ) - - dec = codec.NewDecoder(r, h) - dec = codec.NewDecoderBytes(b, h) - err = dec.Decode(&v) - - enc = codec.NewEncoder(w, h) - enc = codec.NewEncoderBytes(&b, h) - err = enc.Encode(v) - - //RPC Server - go func() { - for { - conn, err := listener.Accept() - rpcCodec := codec.GoRpc.ServerCodec(conn, h) - //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h) - rpc.ServeCodec(rpcCodec) - } - }() - - //RPC Communication (client side) - conn, err = net.Dial("tcp", "localhost:5555") - rpcCodec := codec.GoRpc.ClientCodec(conn, h) - //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) - client := rpc.NewClientWithCodec(rpcCodec) - -Running Tests - -To run tests, use the following: - - go test - -To run the full suite of tests, use the following: - - go test -tags alltests -run Suite - -You can run the tag 'safe' to run tests or build in safe mode. e.g. - - go test -tags safe -run Json - go test -tags "alltests safe" -run Suite - -Running Benchmarks - -Please see http://github.com/ugorji/go-codec-bench . - -*/ -package codec - diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/LICENSE b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/binc.go deleted file mode 100644 index be5b7d33..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/binc.go +++ /dev/null @@ -1,946 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "math" - "reflect" - "time" -) - -const bincDoPrune = true // No longer needed. Needed before as C lib did not support pruning. - -// vd as low 4 bits (there are 16 slots) -const ( - bincVdSpecial byte = iota - bincVdPosInt - bincVdNegInt - bincVdFloat - - bincVdString - bincVdByteArray - bincVdArray - bincVdMap - - bincVdTimestamp - bincVdSmallInt - bincVdUnicodeOther - bincVdSymbol - - bincVdDecimal - _ // open slot - _ // open slot - bincVdCustomExt = 0x0f -) - -const ( - bincSpNil byte = iota - bincSpFalse - bincSpTrue - bincSpNan - bincSpPosInf - bincSpNegInf - bincSpZeroFloat - bincSpZero - bincSpNegOne -) - -const ( - bincFlBin16 byte = iota - bincFlBin32 - _ // bincFlBin32e - bincFlBin64 - _ // bincFlBin64e - // others not currently supported -) - -type bincEncDriver struct { - e *Encoder - w encWriter - m map[string]uint16 // symbols - b [scratchByteArrayLen]byte - s uint16 // symbols sequencer - // encNoSeparator - encDriverNoopContainerWriter -} - -func (e *bincEncDriver) IsBuiltinType(rt uintptr) bool { - return rt == timeTypId -} - -func (e *bincEncDriver) EncodeBuiltin(rt uintptr, v interface{}) { - if rt == timeTypId { - var bs []byte - switch x := v.(type) { - case time.Time: - bs = encodeTime(x) - case *time.Time: - bs = encodeTime(*x) - default: - e.e.errorf("binc error encoding builtin: expect time.Time, received %T", v) - } - e.w.writen1(bincVdTimestamp<<4 | uint8(len(bs))) - e.w.writeb(bs) - } -} - -func (e *bincEncDriver) EncodeNil() { - e.w.writen1(bincVdSpecial<<4 | bincSpNil) -} - -func (e *bincEncDriver) EncodeBool(b bool) { - if b { - e.w.writen1(bincVdSpecial<<4 | bincSpTrue) - } else { - e.w.writen1(bincVdSpecial<<4 | bincSpFalse) - } -} - -func (e *bincEncDriver) EncodeFloat32(f float32) { - if f == 0 { - e.w.writen1(bincVdSpecial<<4 | bincSpZeroFloat) - return - } - e.w.writen1(bincVdFloat<<4 | bincFlBin32) - bigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f)) -} - -func (e *bincEncDriver) EncodeFloat64(f float64) { - if f == 0 { - e.w.writen1(bincVdSpecial<<4 | bincSpZeroFloat) - return - } - bigen.PutUint64(e.b[:8], math.Float64bits(f)) - if bincDoPrune { - i := 7 - for ; i >= 0 && (e.b[i] == 0); i-- { - } - i++ - if i <= 6 { - e.w.writen1(bincVdFloat<<4 | 0x8 | bincFlBin64) - e.w.writen1(byte(i)) - e.w.writeb(e.b[:i]) - return - } - } - e.w.writen1(bincVdFloat<<4 | bincFlBin64) - e.w.writeb(e.b[:8]) -} - -func (e *bincEncDriver) encIntegerPrune(bd byte, pos bool, v uint64, lim uint8) { - if lim == 4 { - bigen.PutUint32(e.b[:lim], uint32(v)) - } else { - bigen.PutUint64(e.b[:lim], v) - } - if bincDoPrune { - i := pruneSignExt(e.b[:lim], pos) - e.w.writen1(bd | lim - 1 - byte(i)) - e.w.writeb(e.b[i:lim]) - } else { - e.w.writen1(bd | lim - 1) - e.w.writeb(e.b[:lim]) - } -} - -func (e *bincEncDriver) EncodeInt(v int64) { - const nbd byte = bincVdNegInt << 4 - if v >= 0 { - e.encUint(bincVdPosInt<<4, true, uint64(v)) - } else if v == -1 { - e.w.writen1(bincVdSpecial<<4 | bincSpNegOne) - } else { - e.encUint(bincVdNegInt<<4, false, uint64(-v)) - } -} - -func (e *bincEncDriver) EncodeUint(v uint64) { - e.encUint(bincVdPosInt<<4, true, v) -} - -func (e *bincEncDriver) encUint(bd byte, pos bool, v uint64) { - if v == 0 { - e.w.writen1(bincVdSpecial<<4 | bincSpZero) - } else if pos && v >= 1 && v <= 16 { - e.w.writen1(bincVdSmallInt<<4 | byte(v-1)) - } else if v <= math.MaxUint8 { - e.w.writen2(bd|0x0, byte(v)) - } else if v <= math.MaxUint16 { - e.w.writen1(bd | 0x01) - bigenHelper{e.b[:2], e.w}.writeUint16(uint16(v)) - } else if v <= math.MaxUint32 { - e.encIntegerPrune(bd, pos, v, 4) - } else { - e.encIntegerPrune(bd, pos, v, 8) - } -} - -func (e *bincEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, _ *Encoder) { - bs := ext.WriteExt(rv) - if bs == nil { - e.EncodeNil() - return - } - e.encodeExtPreamble(uint8(xtag), len(bs)) - e.w.writeb(bs) -} - -func (e *bincEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) { - e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) - e.w.writeb(re.Data) -} - -func (e *bincEncDriver) encodeExtPreamble(xtag byte, length int) { - e.encLen(bincVdCustomExt<<4, uint64(length)) - e.w.writen1(xtag) -} - -func (e *bincEncDriver) WriteArrayStart(length int) { - e.encLen(bincVdArray<<4, uint64(length)) -} - -func (e *bincEncDriver) WriteMapStart(length int) { - e.encLen(bincVdMap<<4, uint64(length)) -} - -func (e *bincEncDriver) EncodeString(c charEncoding, v string) { - l := uint64(len(v)) - e.encBytesLen(c, l) - if l > 0 { - e.w.writestr(v) - } -} - -func (e *bincEncDriver) EncodeSymbol(v string) { - // if WriteSymbolsNoRefs { - // e.encodeString(c_UTF8, v) - // return - // } - - //symbols only offer benefit when string length > 1. - //This is because strings with length 1 take only 2 bytes to store - //(bd with embedded length, and single byte for string val). - - l := len(v) - if l == 0 { - e.encBytesLen(c_UTF8, 0) - return - } else if l == 1 { - e.encBytesLen(c_UTF8, 1) - e.w.writen1(v[0]) - return - } - if e.m == nil { - e.m = make(map[string]uint16, 16) - } - ui, ok := e.m[v] - if ok { - if ui <= math.MaxUint8 { - e.w.writen2(bincVdSymbol<<4, byte(ui)) - } else { - e.w.writen1(bincVdSymbol<<4 | 0x8) - bigenHelper{e.b[:2], e.w}.writeUint16(ui) - } - } else { - e.s++ - ui = e.s - //ui = uint16(atomic.AddUint32(&e.s, 1)) - e.m[v] = ui - var lenprec uint8 - if l <= math.MaxUint8 { - // lenprec = 0 - } else if l <= math.MaxUint16 { - lenprec = 1 - } else if int64(l) <= math.MaxUint32 { - lenprec = 2 - } else { - lenprec = 3 - } - if ui <= math.MaxUint8 { - e.w.writen2(bincVdSymbol<<4|0x0|0x4|lenprec, byte(ui)) - } else { - e.w.writen1(bincVdSymbol<<4 | 0x8 | 0x4 | lenprec) - bigenHelper{e.b[:2], e.w}.writeUint16(ui) - } - if lenprec == 0 { - e.w.writen1(byte(l)) - } else if lenprec == 1 { - bigenHelper{e.b[:2], e.w}.writeUint16(uint16(l)) - } else if lenprec == 2 { - bigenHelper{e.b[:4], e.w}.writeUint32(uint32(l)) - } else { - bigenHelper{e.b[:8], e.w}.writeUint64(uint64(l)) - } - e.w.writestr(v) - } -} - -func (e *bincEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - l := uint64(len(v)) - e.encBytesLen(c, l) - if l > 0 { - e.w.writeb(v) - } -} - -func (e *bincEncDriver) encBytesLen(c charEncoding, length uint64) { - //TODO: support bincUnicodeOther (for now, just use string or bytearray) - if c == c_RAW { - e.encLen(bincVdByteArray<<4, length) - } else { - e.encLen(bincVdString<<4, length) - } -} - -func (e *bincEncDriver) encLen(bd byte, l uint64) { - if l < 12 { - e.w.writen1(bd | uint8(l+4)) - } else { - e.encLenNumber(bd, l) - } -} - -func (e *bincEncDriver) encLenNumber(bd byte, v uint64) { - if v <= math.MaxUint8 { - e.w.writen2(bd, byte(v)) - } else if v <= math.MaxUint16 { - e.w.writen1(bd | 0x01) - bigenHelper{e.b[:2], e.w}.writeUint16(uint16(v)) - } else if v <= math.MaxUint32 { - e.w.writen1(bd | 0x02) - bigenHelper{e.b[:4], e.w}.writeUint32(uint32(v)) - } else { - e.w.writen1(bd | 0x03) - bigenHelper{e.b[:8], e.w}.writeUint64(uint64(v)) - } -} - -//------------------------------------ - -type bincDecSymbol struct { - s string - b []byte - i uint16 -} - -type bincDecDriver struct { - d *Decoder - h *BincHandle - r decReader - br bool // bytes reader - bdRead bool - bd byte - vd byte - vs byte - // noStreamingCodec - // decNoSeparator - b [scratchByteArrayLen]byte - - // linear searching on this slice is ok, - // because we typically expect < 32 symbols in each stream. - s []bincDecSymbol - decDriverNoopContainerReader -} - -func (d *bincDecDriver) readNextBd() { - d.bd = d.r.readn1() - d.vd = d.bd >> 4 - d.vs = d.bd & 0x0f - d.bdRead = true -} - -func (d *bincDecDriver) uncacheRead() { - if d.bdRead { - d.r.unreadn1() - d.bdRead = false - } -} - -func (d *bincDecDriver) ContainerType() (vt valueType) { - if !d.bdRead { - d.readNextBd() - } - if d.vd == bincVdSpecial && d.vs == bincSpNil { - return valueTypeNil - } else if d.vd == bincVdByteArray { - return valueTypeBytes - } else if d.vd == bincVdString { - return valueTypeString - } else if d.vd == bincVdArray { - return valueTypeArray - } else if d.vd == bincVdMap { - return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) - } - return valueTypeUnset -} - -func (d *bincDecDriver) TryDecodeAsNil() bool { - if !d.bdRead { - d.readNextBd() - } - if d.bd == bincVdSpecial<<4|bincSpNil { - d.bdRead = false - return true - } - return false -} - -func (d *bincDecDriver) IsBuiltinType(rt uintptr) bool { - return rt == timeTypId -} - -func (d *bincDecDriver) DecodeBuiltin(rt uintptr, v interface{}) { - if !d.bdRead { - d.readNextBd() - } - if rt == timeTypId { - if d.vd != bincVdTimestamp { - d.d.errorf("Invalid d.vd. Expecting 0x%x. Received: 0x%x", bincVdTimestamp, d.vd) - return - } - tt, err := decodeTime(d.r.readx(int(d.vs))) - if err != nil { - panic(err) - } - var vt *time.Time = v.(*time.Time) - *vt = tt - d.bdRead = false - } -} - -func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) { - if vs&0x8 == 0 { - d.r.readb(d.b[0:defaultLen]) - } else { - l := d.r.readn1() - if l > 8 { - d.d.errorf("At most 8 bytes used to represent float. Received: %v bytes", l) - return - } - for i := l; i < 8; i++ { - d.b[i] = 0 - } - d.r.readb(d.b[0:l]) - } -} - -func (d *bincDecDriver) decFloat() (f float64) { - //if true { f = math.Float64frombits(bigen.Uint64(d.r.readx(8))); break; } - if x := d.vs & 0x7; x == bincFlBin32 { - d.decFloatPre(d.vs, 4) - f = float64(math.Float32frombits(bigen.Uint32(d.b[0:4]))) - } else if x == bincFlBin64 { - d.decFloatPre(d.vs, 8) - f = math.Float64frombits(bigen.Uint64(d.b[0:8])) - } else { - d.d.errorf("only float32 and float64 are supported. d.vd: 0x%x, d.vs: 0x%x", d.vd, d.vs) - return - } - return -} - -func (d *bincDecDriver) decUint() (v uint64) { - // need to inline the code (interface conversion and type assertion expensive) - switch d.vs { - case 0: - v = uint64(d.r.readn1()) - case 1: - d.r.readb(d.b[6:8]) - v = uint64(bigen.Uint16(d.b[6:8])) - case 2: - d.b[4] = 0 - d.r.readb(d.b[5:8]) - v = uint64(bigen.Uint32(d.b[4:8])) - case 3: - d.r.readb(d.b[4:8]) - v = uint64(bigen.Uint32(d.b[4:8])) - case 4, 5, 6: - lim := int(7 - d.vs) - d.r.readb(d.b[lim:8]) - for i := 0; i < lim; i++ { - d.b[i] = 0 - } - v = uint64(bigen.Uint64(d.b[:8])) - case 7: - d.r.readb(d.b[:8]) - v = uint64(bigen.Uint64(d.b[:8])) - default: - d.d.errorf("unsigned integers with greater than 64 bits of precision not supported") - return - } - return -} - -func (d *bincDecDriver) decCheckInteger() (ui uint64, neg bool) { - if !d.bdRead { - d.readNextBd() - } - vd, vs := d.vd, d.vs - if vd == bincVdPosInt { - ui = d.decUint() - } else if vd == bincVdNegInt { - ui = d.decUint() - neg = true - } else if vd == bincVdSmallInt { - ui = uint64(d.vs) + 1 - } else if vd == bincVdSpecial { - if vs == bincSpZero { - //i = 0 - } else if vs == bincSpNegOne { - neg = true - ui = 1 - } else { - d.d.errorf("numeric decode fails for special value: d.vs: 0x%x", d.vs) - return - } - } else { - d.d.errorf("number can only be decoded from uint or int values. d.bd: 0x%x, d.vd: 0x%x", d.bd, d.vd) - return - } - return -} - -func (d *bincDecDriver) DecodeInt(bitsize uint8) (i int64) { - ui, neg := d.decCheckInteger() - i, overflow := chkOvf.SignedInt(ui) - if overflow { - d.d.errorf("simple: overflow converting %v to signed integer", ui) - return - } - if neg { - i = -i - } - if chkOvf.Int(i, bitsize) { - d.d.errorf("binc: overflow integer: %v for num bits: %v", i, bitsize) - return - } - d.bdRead = false - return -} - -func (d *bincDecDriver) DecodeUint(bitsize uint8) (ui uint64) { - ui, neg := d.decCheckInteger() - if neg { - d.d.errorf("Assigning negative signed value to unsigned type") - return - } - if chkOvf.Uint(ui, bitsize) { - d.d.errorf("binc: overflow integer: %v", ui) - return - } - d.bdRead = false - return -} - -func (d *bincDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { - if !d.bdRead { - d.readNextBd() - } - vd, vs := d.vd, d.vs - if vd == bincVdSpecial { - d.bdRead = false - if vs == bincSpNan { - return math.NaN() - } else if vs == bincSpPosInf { - return math.Inf(1) - } else if vs == bincSpZeroFloat || vs == bincSpZero { - return - } else if vs == bincSpNegInf { - return math.Inf(-1) - } else { - d.d.errorf("Invalid d.vs decoding float where d.vd=bincVdSpecial: %v", d.vs) - return - } - } else if vd == bincVdFloat { - f = d.decFloat() - } else { - f = float64(d.DecodeInt(64)) - } - if chkOverflow32 && chkOvf.Float32(f) { - d.d.errorf("binc: float32 overflow: %v", f) - return - } - d.bdRead = false - return -} - -// bool can be decoded from bool only (single byte). -func (d *bincDecDriver) DecodeBool() (b bool) { - if !d.bdRead { - d.readNextBd() - } - if bd := d.bd; bd == (bincVdSpecial | bincSpFalse) { - // b = false - } else if bd == (bincVdSpecial | bincSpTrue) { - b = true - } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) - return - } - d.bdRead = false - return -} - -func (d *bincDecDriver) ReadMapStart() (length int) { - if !d.bdRead { - d.readNextBd() - } - if d.vd != bincVdMap { - d.d.errorf("Invalid d.vd for map. Expecting 0x%x. Got: 0x%x", bincVdMap, d.vd) - return - } - length = d.decLen() - d.bdRead = false - return -} - -func (d *bincDecDriver) ReadArrayStart() (length int) { - if !d.bdRead { - d.readNextBd() - } - if d.vd != bincVdArray { - d.d.errorf("Invalid d.vd for array. Expecting 0x%x. Got: 0x%x", bincVdArray, d.vd) - return - } - length = d.decLen() - d.bdRead = false - return -} - -func (d *bincDecDriver) decLen() int { - if d.vs > 3 { - return int(d.vs - 4) - } - return int(d.decLenNumber()) -} - -func (d *bincDecDriver) decLenNumber() (v uint64) { - if x := d.vs; x == 0 { - v = uint64(d.r.readn1()) - } else if x == 1 { - d.r.readb(d.b[6:8]) - v = uint64(bigen.Uint16(d.b[6:8])) - } else if x == 2 { - d.r.readb(d.b[4:8]) - v = uint64(bigen.Uint32(d.b[4:8])) - } else { - d.r.readb(d.b[:8]) - v = bigen.Uint64(d.b[:8]) - } - return -} - -func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) (bs2 []byte, s string) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == bincVdSpecial<<4|bincSpNil { - d.bdRead = false - return - } - var slen int = -1 - // var ok bool - switch d.vd { - case bincVdString, bincVdByteArray: - slen = d.decLen() - if zerocopy { - if d.br { - bs2 = d.r.readx(slen) - } else if len(bs) == 0 { - bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, d.b[:]) - } else { - bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, bs) - } - } else { - bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, bs) - } - if withString { - s = string(bs2) - } - case bincVdSymbol: - // zerocopy doesn't apply for symbols, - // as the values must be stored in a table for later use. - // - //from vs: extract numSymbolBytes, containsStringVal, strLenPrecision, - //extract symbol - //if containsStringVal, read it and put in map - //else look in map for string value - var symbol uint16 - vs := d.vs - if vs&0x8 == 0 { - symbol = uint16(d.r.readn1()) - } else { - symbol = uint16(bigen.Uint16(d.r.readx(2))) - } - if d.s == nil { - d.s = make([]bincDecSymbol, 0, 16) - } - - if vs&0x4 == 0 { - for i := range d.s { - j := &d.s[i] - if j.i == symbol { - bs2 = j.b - if withString { - if j.s == "" && bs2 != nil { - j.s = string(bs2) - } - s = j.s - } - break - } - } - } else { - switch vs & 0x3 { - case 0: - slen = int(d.r.readn1()) - case 1: - slen = int(bigen.Uint16(d.r.readx(2))) - case 2: - slen = int(bigen.Uint32(d.r.readx(4))) - case 3: - slen = int(bigen.Uint64(d.r.readx(8))) - } - // since using symbols, do not store any part of - // the parameter bs in the map, as it might be a shared buffer. - // bs2 = decByteSlice(d.r, slen, bs) - bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, nil) - if withString { - s = string(bs2) - } - d.s = append(d.s, bincDecSymbol{i: symbol, s: s, b: bs2}) - } - default: - d.d.errorf("Invalid d.vd. Expecting string:0x%x, bytearray:0x%x or symbol: 0x%x. Got: 0x%x", - bincVdString, bincVdByteArray, bincVdSymbol, d.vd) - return - } - d.bdRead = false - return -} - -func (d *bincDecDriver) DecodeString() (s string) { - // DecodeBytes does not accommodate symbols, whose impl stores string version in map. - // Use decStringAndBytes directly. - // return string(d.DecodeBytes(d.b[:], true, true)) - _, s = d.decStringAndBytes(d.b[:], true, true) - return -} - -func (d *bincDecDriver) DecodeStringAsBytes() (s []byte) { - s, _ = d.decStringAndBytes(d.b[:], false, true) - return -} - -func (d *bincDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == bincVdSpecial<<4|bincSpNil { - d.bdRead = false - return nil - } - var clen int - if d.vd == bincVdString || d.vd == bincVdByteArray { - clen = d.decLen() - } else { - d.d.errorf("Invalid d.vd for bytes. Expecting string:0x%x or bytearray:0x%x. Got: 0x%x", - bincVdString, bincVdByteArray, d.vd) - return - } - d.bdRead = false - if zerocopy { - if d.br { - return d.r.readx(clen) - } else if len(bs) == 0 { - bs = d.b[:] - } - } - return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) -} - -func (d *bincDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { - if xtag > 0xff { - d.d.errorf("decodeExt: tag must be <= 0xff; got: %v", xtag) - return - } - realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) - realxtag = uint64(realxtag1) - if ext == nil { - re := rv.(*RawExt) - re.Tag = realxtag - re.Data = detachZeroCopyBytes(d.br, re.Data, xbs) - } else { - ext.ReadExt(rv, xbs) - } - return -} - -func (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) { - if !d.bdRead { - d.readNextBd() - } - if d.vd == bincVdCustomExt { - l := d.decLen() - xtag = d.r.readn1() - if verifyTag && xtag != tag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) - return - } - xbs = d.r.readx(l) - } else if d.vd == bincVdByteArray { - xbs = d.DecodeBytes(nil, true) - } else { - d.d.errorf("Invalid d.vd for extensions (Expecting extensions or byte array). Got: 0x%x", d.vd) - return - } - d.bdRead = false - return -} - -func (d *bincDecDriver) DecodeNaked() { - if !d.bdRead { - d.readNextBd() - } - - n := d.d.n - var decodeFurther bool - - switch d.vd { - case bincVdSpecial: - switch d.vs { - case bincSpNil: - n.v = valueTypeNil - case bincSpFalse: - n.v = valueTypeBool - n.b = false - case bincSpTrue: - n.v = valueTypeBool - n.b = true - case bincSpNan: - n.v = valueTypeFloat - n.f = math.NaN() - case bincSpPosInf: - n.v = valueTypeFloat - n.f = math.Inf(1) - case bincSpNegInf: - n.v = valueTypeFloat - n.f = math.Inf(-1) - case bincSpZeroFloat: - n.v = valueTypeFloat - n.f = float64(0) - case bincSpZero: - n.v = valueTypeUint - n.u = uint64(0) // int8(0) - case bincSpNegOne: - n.v = valueTypeInt - n.i = int64(-1) // int8(-1) - default: - d.d.errorf("decodeNaked: Unrecognized special value 0x%x", d.vs) - } - case bincVdSmallInt: - n.v = valueTypeUint - n.u = uint64(int8(d.vs)) + 1 // int8(d.vs) + 1 - case bincVdPosInt: - n.v = valueTypeUint - n.u = d.decUint() - case bincVdNegInt: - n.v = valueTypeInt - n.i = -(int64(d.decUint())) - case bincVdFloat: - n.v = valueTypeFloat - n.f = d.decFloat() - case bincVdSymbol: - n.v = valueTypeSymbol - n.s = d.DecodeString() - case bincVdString: - n.v = valueTypeString - n.s = d.DecodeString() - case bincVdByteArray: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) - case bincVdTimestamp: - n.v = valueTypeTimestamp - tt, err := decodeTime(d.r.readx(int(d.vs))) - if err != nil { - panic(err) - } - n.t = tt - case bincVdCustomExt: - n.v = valueTypeExt - l := d.decLen() - n.u = uint64(d.r.readn1()) - n.l = d.r.readx(l) - case bincVdArray: - n.v = valueTypeArray - decodeFurther = true - case bincVdMap: - n.v = valueTypeMap - decodeFurther = true - default: - d.d.errorf("decodeNaked: Unrecognized d.vd: 0x%x", d.vd) - } - - if !decodeFurther { - d.bdRead = false - } - if n.v == valueTypeUint && d.h.SignedInteger { - n.v = valueTypeInt - n.i = int64(n.u) - } - return -} - -//------------------------------------ - -//BincHandle is a Handle for the Binc Schema-Free Encoding Format -//defined at https://github.com/ugorji/binc . -// -//BincHandle currently supports all Binc features with the following EXCEPTIONS: -// - only integers up to 64 bits of precision are supported. -// big integers are unsupported. -// - Only IEEE 754 binary32 and binary64 floats are supported (ie Go float32 and float64 types). -// extended precision and decimal IEEE 754 floats are unsupported. -// - Only UTF-8 strings supported. -// Unicode_Other Binc types (UTF16, UTF32) are currently unsupported. -// -//Note that these EXCEPTIONS are temporary and full support is possible and may happen soon. -type BincHandle struct { - BasicHandle - binaryEncodingType - noElemSeparators -} - -func (h *BincHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{b: ext}) -} - -func (h *BincHandle) newEncDriver(e *Encoder) encDriver { - return &bincEncDriver{e: e, w: e.w} -} - -func (h *BincHandle) newDecDriver(d *Decoder) decDriver { - return &bincDecDriver{d: d, h: h, r: d.r, br: d.bytes} -} - -func (_ *BincHandle) IsBuiltinType(rt uintptr) bool { - return rt == timeTypId -} - -func (e *bincEncDriver) reset() { - e.w = e.e.w - e.s = 0 - e.m = nil -} - -func (d *bincDecDriver) reset() { - d.r, d.br = d.d.r, d.d.bytes - d.s = nil - d.bd, d.bdRead, d.vd, d.vs = 0, false, 0, 0 -} - -var _ decDriver = (*bincDecDriver)(nil) -var _ encDriver = (*bincEncDriver)(nil) diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/cbor.go deleted file mode 100644 index 592cee85..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/cbor.go +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "math" - "reflect" -) - -const ( - cborMajorUint byte = iota - cborMajorNegInt - cborMajorBytes - cborMajorText - cborMajorArray - cborMajorMap - cborMajorTag - cborMajorOther -) - -const ( - cborBdFalse byte = 0xf4 + iota - cborBdTrue - cborBdNil - cborBdUndefined - cborBdExt - cborBdFloat16 - cborBdFloat32 - cborBdFloat64 -) - -const ( - cborBdIndefiniteBytes byte = 0x5f - cborBdIndefiniteString = 0x7f - cborBdIndefiniteArray = 0x9f - cborBdIndefiniteMap = 0xbf - cborBdBreak = 0xff -) - -const ( - CborStreamBytes byte = 0x5f - CborStreamString = 0x7f - CborStreamArray = 0x9f - CborStreamMap = 0xbf - CborStreamBreak = 0xff -) - -const ( - cborBaseUint byte = 0x00 - cborBaseNegInt = 0x20 - cborBaseBytes = 0x40 - cborBaseString = 0x60 - cborBaseArray = 0x80 - cborBaseMap = 0xa0 - cborBaseTag = 0xc0 - cborBaseSimple = 0xe0 -) - -// ------------------- - -type cborEncDriver struct { - noBuiltInTypes - encDriverNoopContainerWriter - // encNoSeparator - e *Encoder - w encWriter - h *CborHandle - x [8]byte -} - -func (e *cborEncDriver) EncodeNil() { - e.w.writen1(cborBdNil) -} - -func (e *cborEncDriver) EncodeBool(b bool) { - if b { - e.w.writen1(cborBdTrue) - } else { - e.w.writen1(cborBdFalse) - } -} - -func (e *cborEncDriver) EncodeFloat32(f float32) { - e.w.writen1(cborBdFloat32) - bigenHelper{e.x[:4], e.w}.writeUint32(math.Float32bits(f)) -} - -func (e *cborEncDriver) EncodeFloat64(f float64) { - e.w.writen1(cborBdFloat64) - bigenHelper{e.x[:8], e.w}.writeUint64(math.Float64bits(f)) -} - -func (e *cborEncDriver) encUint(v uint64, bd byte) { - if v <= 0x17 { - e.w.writen1(byte(v) + bd) - } else if v <= math.MaxUint8 { - e.w.writen2(bd+0x18, uint8(v)) - } else if v <= math.MaxUint16 { - e.w.writen1(bd + 0x19) - bigenHelper{e.x[:2], e.w}.writeUint16(uint16(v)) - } else if v <= math.MaxUint32 { - e.w.writen1(bd + 0x1a) - bigenHelper{e.x[:4], e.w}.writeUint32(uint32(v)) - } else { // if v <= math.MaxUint64 { - e.w.writen1(bd + 0x1b) - bigenHelper{e.x[:8], e.w}.writeUint64(v) - } -} - -func (e *cborEncDriver) EncodeInt(v int64) { - if v < 0 { - e.encUint(uint64(-1-v), cborBaseNegInt) - } else { - e.encUint(uint64(v), cborBaseUint) - } -} - -func (e *cborEncDriver) EncodeUint(v uint64) { - e.encUint(v, cborBaseUint) -} - -func (e *cborEncDriver) encLen(bd byte, length int) { - e.encUint(uint64(length), bd) -} - -func (e *cborEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { - e.encUint(uint64(xtag), cborBaseTag) - if v := ext.ConvertExt(rv); v == nil { - e.EncodeNil() - } else { - en.encode(v) - } -} - -func (e *cborEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { - e.encUint(uint64(re.Tag), cborBaseTag) - if false && re.Data != nil { - en.encode(re.Data) - } else if re.Value != nil { - en.encode(re.Value) - } else { - e.EncodeNil() - } -} - -func (e *cborEncDriver) WriteArrayStart(length int) { - if e.h.IndefiniteLength { - e.w.writen1(cborBdIndefiniteArray) - } else { - e.encLen(cborBaseArray, length) - } -} - -func (e *cborEncDriver) WriteMapStart(length int) { - if e.h.IndefiniteLength { - e.w.writen1(cborBdIndefiniteMap) - } else { - e.encLen(cborBaseMap, length) - } -} - -func (e *cborEncDriver) WriteMapEnd() { - if e.h.IndefiniteLength { - e.w.writen1(cborBdBreak) - } -} - -func (e *cborEncDriver) WriteArrayEnd() { - if e.h.IndefiniteLength { - e.w.writen1(cborBdBreak) - } -} - -func (e *cborEncDriver) EncodeString(c charEncoding, v string) { - e.encLen(cborBaseString, len(v)) - e.w.writestr(v) -} - -func (e *cborEncDriver) EncodeSymbol(v string) { - e.EncodeString(c_UTF8, v) -} - -func (e *cborEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - if c == c_RAW { - e.encLen(cborBaseBytes, len(v)) - } else { - e.encLen(cborBaseString, len(v)) - } - e.w.writeb(v) -} - -// ---------------------- - -type cborDecDriver struct { - d *Decoder - h *CborHandle - r decReader - b [scratchByteArrayLen]byte - br bool // bytes reader - bdRead bool - bd byte - noBuiltInTypes - // decNoSeparator - decDriverNoopContainerReader -} - -func (d *cborDecDriver) readNextBd() { - d.bd = d.r.readn1() - d.bdRead = true -} - -func (d *cborDecDriver) uncacheRead() { - if d.bdRead { - d.r.unreadn1() - d.bdRead = false - } -} - -func (d *cborDecDriver) ContainerType() (vt valueType) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == cborBdNil { - return valueTypeNil - } else if d.bd == cborBdIndefiniteBytes || (d.bd >= cborBaseBytes && d.bd < cborBaseString) { - return valueTypeBytes - } else if d.bd == cborBdIndefiniteString || (d.bd >= cborBaseString && d.bd < cborBaseArray) { - return valueTypeString - } else if d.bd == cborBdIndefiniteArray || (d.bd >= cborBaseArray && d.bd < cborBaseMap) { - return valueTypeArray - } else if d.bd == cborBdIndefiniteMap || (d.bd >= cborBaseMap && d.bd < cborBaseTag) { - return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) - } - return valueTypeUnset -} - -func (d *cborDecDriver) TryDecodeAsNil() bool { - if !d.bdRead { - d.readNextBd() - } - // treat Nil and Undefined as nil values - if d.bd == cborBdNil || d.bd == cborBdUndefined { - d.bdRead = false - return true - } - return false -} - -func (d *cborDecDriver) CheckBreak() bool { - if !d.bdRead { - d.readNextBd() - } - if d.bd == cborBdBreak { - d.bdRead = false - return true - } - return false -} - -func (d *cborDecDriver) decUint() (ui uint64) { - v := d.bd & 0x1f - if v <= 0x17 { - ui = uint64(v) - } else { - if v == 0x18 { - ui = uint64(d.r.readn1()) - } else if v == 0x19 { - ui = uint64(bigen.Uint16(d.r.readx(2))) - } else if v == 0x1a { - ui = uint64(bigen.Uint32(d.r.readx(4))) - } else if v == 0x1b { - ui = uint64(bigen.Uint64(d.r.readx(8))) - } else { - d.d.errorf("decUint: Invalid descriptor: %v", d.bd) - return - } - } - return -} - -func (d *cborDecDriver) decCheckInteger() (neg bool) { - if !d.bdRead { - d.readNextBd() - } - major := d.bd >> 5 - if major == cborMajorUint { - } else if major == cborMajorNegInt { - neg = true - } else { - d.d.errorf("invalid major: %v (bd: %v)", major, d.bd) - return - } - return -} - -func (d *cborDecDriver) DecodeInt(bitsize uint8) (i int64) { - neg := d.decCheckInteger() - ui := d.decUint() - // check if this number can be converted to an int without overflow - var overflow bool - if neg { - if i, overflow = chkOvf.SignedInt(ui + 1); overflow { - d.d.errorf("cbor: overflow converting %v to signed integer", ui+1) - return - } - i = -i - } else { - if i, overflow = chkOvf.SignedInt(ui); overflow { - d.d.errorf("cbor: overflow converting %v to signed integer", ui) - return - } - } - if chkOvf.Int(i, bitsize) { - d.d.errorf("cbor: overflow integer: %v", i) - return - } - d.bdRead = false - return -} - -func (d *cborDecDriver) DecodeUint(bitsize uint8) (ui uint64) { - if d.decCheckInteger() { - d.d.errorf("Assigning negative signed value to unsigned type") - return - } - ui = d.decUint() - if chkOvf.Uint(ui, bitsize) { - d.d.errorf("cbor: overflow integer: %v", ui) - return - } - d.bdRead = false - return -} - -func (d *cborDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { - if !d.bdRead { - d.readNextBd() - } - if bd := d.bd; bd == cborBdFloat16 { - f = float64(math.Float32frombits(halfFloatToFloatBits(bigen.Uint16(d.r.readx(2))))) - } else if bd == cborBdFloat32 { - f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) - } else if bd == cborBdFloat64 { - f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) - } else if bd >= cborBaseUint && bd < cborBaseBytes { - f = float64(d.DecodeInt(64)) - } else { - d.d.errorf("Float only valid from float16/32/64: Invalid descriptor: %v", bd) - return - } - if chkOverflow32 && chkOvf.Float32(f) { - d.d.errorf("cbor: float32 overflow: %v", f) - return - } - d.bdRead = false - return -} - -// bool can be decoded from bool only (single byte). -func (d *cborDecDriver) DecodeBool() (b bool) { - if !d.bdRead { - d.readNextBd() - } - if bd := d.bd; bd == cborBdTrue { - b = true - } else if bd == cborBdFalse { - } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) - return - } - d.bdRead = false - return -} - -func (d *cborDecDriver) ReadMapStart() (length int) { - if !d.bdRead { - d.readNextBd() - } - d.bdRead = false - if d.bd == cborBdIndefiniteMap { - return -1 - } - return d.decLen() -} - -func (d *cborDecDriver) ReadArrayStart() (length int) { - if !d.bdRead { - d.readNextBd() - } - d.bdRead = false - if d.bd == cborBdIndefiniteArray { - return -1 - } - return d.decLen() -} - -func (d *cborDecDriver) decLen() int { - return int(d.decUint()) -} - -func (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte { - d.bdRead = false - for { - if d.CheckBreak() { - break - } - if major := d.bd >> 5; major != cborMajorBytes && major != cborMajorText { - d.d.errorf("cbor: expect bytes or string major type in indefinite string/bytes; got: %v, byte: %v", major, d.bd) - return nil - } - n := d.decLen() - oldLen := len(bs) - newLen := oldLen + n - if newLen > cap(bs) { - bs2 := make([]byte, newLen, 2*cap(bs)+n) - copy(bs2, bs) - bs = bs2 - } else { - bs = bs[:newLen] - } - d.r.readb(bs[oldLen:newLen]) - // bs = append(bs, d.r.readn()...) - d.bdRead = false - } - d.bdRead = false - return bs -} - -func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == cborBdNil || d.bd == cborBdUndefined { - d.bdRead = false - return nil - } - if d.bd == cborBdIndefiniteBytes || d.bd == cborBdIndefiniteString { - if bs == nil { - return d.decAppendIndefiniteBytes(nil) - } - return d.decAppendIndefiniteBytes(bs[:0]) - } - clen := d.decLen() - d.bdRead = false - if zerocopy { - if d.br { - return d.r.readx(clen) - } else if len(bs) == 0 { - bs = d.b[:] - } - } - return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) -} - -func (d *cborDecDriver) DecodeString() (s string) { - return string(d.DecodeBytes(d.b[:], true)) -} - -func (d *cborDecDriver) DecodeStringAsBytes() (s []byte) { - return d.DecodeBytes(d.b[:], true) -} - -func (d *cborDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { - if !d.bdRead { - d.readNextBd() - } - u := d.decUint() - d.bdRead = false - realxtag = u - if ext == nil { - re := rv.(*RawExt) - re.Tag = realxtag - d.d.decode(&re.Value) - } else if xtag != realxtag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", realxtag, xtag) - return - } else { - var v interface{} - d.d.decode(&v) - ext.UpdateExt(rv, v) - } - d.bdRead = false - return -} - -func (d *cborDecDriver) DecodeNaked() { - if !d.bdRead { - d.readNextBd() - } - - n := d.d.n - var decodeFurther bool - - switch d.bd { - case cborBdNil: - n.v = valueTypeNil - case cborBdFalse: - n.v = valueTypeBool - n.b = false - case cborBdTrue: - n.v = valueTypeBool - n.b = true - case cborBdFloat16, cborBdFloat32: - n.v = valueTypeFloat - n.f = d.DecodeFloat(true) - case cborBdFloat64: - n.v = valueTypeFloat - n.f = d.DecodeFloat(false) - case cborBdIndefiniteBytes: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) - case cborBdIndefiniteString: - n.v = valueTypeString - n.s = d.DecodeString() - case cborBdIndefiniteArray: - n.v = valueTypeArray - decodeFurther = true - case cborBdIndefiniteMap: - n.v = valueTypeMap - decodeFurther = true - default: - switch { - case d.bd >= cborBaseUint && d.bd < cborBaseNegInt: - if d.h.SignedInteger { - n.v = valueTypeInt - n.i = d.DecodeInt(64) - } else { - n.v = valueTypeUint - n.u = d.DecodeUint(64) - } - case d.bd >= cborBaseNegInt && d.bd < cborBaseBytes: - n.v = valueTypeInt - n.i = d.DecodeInt(64) - case d.bd >= cborBaseBytes && d.bd < cborBaseString: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) - case d.bd >= cborBaseString && d.bd < cborBaseArray: - n.v = valueTypeString - n.s = d.DecodeString() - case d.bd >= cborBaseArray && d.bd < cborBaseMap: - n.v = valueTypeArray - decodeFurther = true - case d.bd >= cborBaseMap && d.bd < cborBaseTag: - n.v = valueTypeMap - decodeFurther = true - case d.bd >= cborBaseTag && d.bd < cborBaseSimple: - n.v = valueTypeExt - n.u = d.decUint() - n.l = nil - // d.bdRead = false - // d.d.decode(&re.Value) // handled by decode itself. - // decodeFurther = true - default: - d.d.errorf("decodeNaked: Unrecognized d.bd: 0x%x", d.bd) - return - } - } - - if !decodeFurther { - d.bdRead = false - } - return -} - -// ------------------------- - -// CborHandle is a Handle for the CBOR encoding format, -// defined at http://tools.ietf.org/html/rfc7049 and documented further at http://cbor.io . -// -// CBOR is comprehensively supported, including support for: -// - indefinite-length arrays/maps/bytes/strings -// - (extension) tags in range 0..0xffff (0 .. 65535) -// - half, single and double-precision floats -// - all numbers (1, 2, 4 and 8-byte signed and unsigned integers) -// - nil, true, false, ... -// - arrays and maps, bytes and text strings -// -// None of the optional extensions (with tags) defined in the spec are supported out-of-the-box. -// Users can implement them as needed (using SetExt), including spec-documented ones: -// - timestamp, BigNum, BigFloat, Decimals, Encoded Text (e.g. URL, regexp, base64, MIME Message), etc. -// -// To encode with indefinite lengths (streaming), users will use -// (Must)Encode methods of *Encoder, along with writing CborStreamXXX constants. -// -// For example, to encode "one-byte" as an indefinite length string: -// var buf bytes.Buffer -// e := NewEncoder(&buf, new(CborHandle)) -// buf.WriteByte(CborStreamString) -// e.MustEncode("one-") -// e.MustEncode("byte") -// buf.WriteByte(CborStreamBreak) -// encodedBytes := buf.Bytes() -// var vv interface{} -// NewDecoderBytes(buf.Bytes(), new(CborHandle)).MustDecode(&vv) -// // Now, vv contains the same string "one-byte" -// -type CborHandle struct { - binaryEncodingType - noElemSeparators - BasicHandle - - // IndefiniteLength=true, means that we encode using indefinitelength - IndefiniteLength bool -} - -func (h *CborHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{i: ext}) -} - -func (h *CborHandle) newEncDriver(e *Encoder) encDriver { - return &cborEncDriver{e: e, w: e.w, h: h} -} - -func (h *CborHandle) newDecDriver(d *Decoder) decDriver { - return &cborDecDriver{d: d, h: h, r: d.r, br: d.bytes} -} - -func (e *cborEncDriver) reset() { - e.w = e.e.w -} - -func (d *cborDecDriver) reset() { - d.r, d.br = d.d.r, d.d.bytes - d.bd, d.bdRead = 0, false -} - -var _ decDriver = (*cborDecDriver)(nil) -var _ encDriver = (*cborEncDriver)(nil) diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/decode.go deleted file mode 100644 index 246533f3..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/decode.go +++ /dev/null @@ -1,2520 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "encoding" - "errors" - "fmt" - "io" - "reflect" - "sync" - "time" -) - -// Some tagging information for error messages. -const ( - msgBadDesc = "Unrecognized descriptor byte" - msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v" -) - -var ( - onlyMapOrArrayCanDecodeIntoStructErr = errors.New("only encoded map or array can be decoded into a struct") - cannotDecodeIntoNilErr = errors.New("cannot decode into nil") - - decUnreadByteNothingToReadErr = errors.New("cannot unread - nothing has been read") - decUnreadByteLastByteNotReadErr = errors.New("cannot unread - last byte has not been read") - decUnreadByteUnknownErr = errors.New("cannot unread - reason unknown") -) - -// decReader abstracts the reading source, allowing implementations that can -// read from an io.Reader or directly off a byte slice with zero-copying. -type decReader interface { - unreadn1() - - // readx will use the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR - // just return a view of the []byte being decoded from. - // Ensure you call detachZeroCopyBytes later if this needs to be sent outside codec control. - readx(n int) []byte - readb([]byte) - readn1() uint8 - readn3() (uint8, uint8, uint8) - readn4() (uint8, uint8, uint8, uint8) - // readn1eof() (v uint8, eof bool) - numread() int // number of bytes read - track() - stopTrack() []byte - - // skip will skip any byte that matches, and return the first non-matching byte - skip(accept *bitset256) (token byte) - // readTo will read any byte that matches, stopping once no-longer matching. - readTo(in []byte, accept *bitset256) (out []byte) - // readUntil will read, only stopping once it matches the 'stop' byte. - readUntil(in []byte, stop byte) (out []byte) -} - -// type decReaderByteScanner interface { -// io.Reader -// io.ByteScanner -// } - -type decDriver interface { - // this will check if the next token is a break. - CheckBreak() bool - // Note: TryDecodeAsNil should be careful not to share any temporary []byte with - // the rest of the decDriver. This is because sometimes, we optimize by holding onto - // a transient []byte, and ensuring the only other call we make to the decDriver - // during that time is maybe a TryDecodeAsNil() call. - TryDecodeAsNil() bool - // vt is one of: Bytes, String, Nil, Slice or Map. Return unSet if not known. - ContainerType() (vt valueType) - // IsBuiltinType(rt uintptr) bool - DecodeBuiltin(rt uintptr, v interface{}) - - // DecodeNaked will decode primitives (number, bool, string, []byte) and RawExt. - // For maps and arrays, it will not do the decoding in-band, but will signal - // the decoder, so that is done later, by setting the decNaked.valueType field. - // - // Note: Numbers are decoded as int64, uint64, float64 only (no smaller sized number types). - // for extensions, DecodeNaked must read the tag and the []byte if it exists. - // if the []byte is not read, then kInterfaceNaked will treat it as a Handle - // that stores the subsequent value in-band, and complete reading the RawExt. - // - // extensions should also use readx to decode them, for efficiency. - // kInterface will extract the detached byte slice if it has to pass it outside its realm. - DecodeNaked() - DecodeInt(bitsize uint8) (i int64) - DecodeUint(bitsize uint8) (ui uint64) - DecodeFloat(chkOverflow32 bool) (f float64) - DecodeBool() (b bool) - // DecodeString can also decode symbols. - // It looks redundant as DecodeBytes is available. - // However, some codecs (e.g. binc) support symbols and can - // return a pre-stored string value, meaning that it can bypass - // the cost of []byte->string conversion. - DecodeString() (s string) - DecodeStringAsBytes() (v []byte) - - // DecodeBytes may be called directly, without going through reflection. - // Consequently, it must be designed to handle possible nil. - DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) - // DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) - - // decodeExt will decode into a *RawExt or into an extension. - DecodeExt(v interface{}, xtag uint64, ext Ext) (realxtag uint64) - // decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) - ReadArrayStart() int - ReadArrayElem() - ReadArrayEnd() - ReadMapStart() int - ReadMapElemKey() - ReadMapElemValue() - ReadMapEnd() - - reset() - uncacheRead() -} - -// type decNoSeparator struct {} -// func (_ decNoSeparator) ReadEnd() {} - -type decDriverNoopContainerReader struct{} - -func (_ decDriverNoopContainerReader) ReadArrayStart() (v int) { return } -func (_ decDriverNoopContainerReader) ReadArrayElem() {} -func (_ decDriverNoopContainerReader) ReadArrayEnd() {} -func (_ decDriverNoopContainerReader) ReadMapStart() (v int) { return } -func (_ decDriverNoopContainerReader) ReadMapElemKey() {} -func (_ decDriverNoopContainerReader) ReadMapElemValue() {} -func (_ decDriverNoopContainerReader) ReadMapEnd() {} -func (_ decDriverNoopContainerReader) CheckBreak() (v bool) { return } - -// func (_ decNoSeparator) uncacheRead() {} - -type DecodeOptions struct { - // MapType specifies type to use during schema-less decoding of a map in the stream. - // If nil, we use map[interface{}]interface{} - MapType reflect.Type - - // SliceType specifies type to use during schema-less decoding of an array in the stream. - // If nil, we use []interface{} - SliceType reflect.Type - - // MaxInitLen defines the maxinum initial length that we "make" a collection (string, slice, map, chan). - // If 0 or negative, we default to a sensible value based on the size of an element in the collection. - // - // For example, when decoding, a stream may say that it has 2^64 elements. - // We should not auto-matically provision a slice of that length, to prevent Out-Of-Memory crash. - // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. - MaxInitLen int - - // If ErrorIfNoField, return an error when decoding a map - // from a codec stream into a struct, and no matching struct field is found. - ErrorIfNoField bool - - // If ErrorIfNoArrayExpand, return an error when decoding a slice/array that cannot be expanded. - // For example, the stream contains an array of 8 items, but you are decoding into a [4]T array, - // or you are decoding into a slice of length 4 which is non-addressable (and so cannot be set). - ErrorIfNoArrayExpand bool - - // If SignedInteger, use the int64 during schema-less decoding of unsigned values (not uint64). - SignedInteger bool - - // MapValueReset controls how we decode into a map value. - // - // By default, we MAY retrieve the mapping for a key, and then decode into that. - // However, especially with big maps, that retrieval may be expensive and unnecessary - // if the stream already contains all that is necessary to recreate the value. - // - // If true, we will never retrieve the previous mapping, - // but rather decode into a new value and set that in the map. - // - // If false, we will retrieve the previous mapping if necessary e.g. - // the previous mapping is a pointer, or is a struct or array with pre-set state, - // or is an interface. - MapValueReset bool - - // SliceElementReset: on decoding a slice, reset the element to a zero value first. - // - // concern: if the slice already contained some garbage, we will decode into that garbage. - SliceElementReset bool - - // InterfaceReset controls how we decode into an interface. - // - // By default, when we see a field that is an interface{...}, - // or a map with interface{...} value, we will attempt decoding into the - // "contained" value. - // - // However, this prevents us from reading a string into an interface{} - // that formerly contained a number. - // - // If true, we will decode into a new "blank" value, and set that in the interface. - // If false, we will decode into whatever is contained in the interface. - InterfaceReset bool - - // InternString controls interning of strings during decoding. - // - // Some handles, e.g. json, typically will read map keys as strings. - // If the set of keys are finite, it may help reduce allocation to - // look them up from a map (than to allocate them afresh). - // - // Note: Handles will be smart when using the intern functionality. - // Every string should not be interned. - // An excellent use-case for interning is struct field names, - // or map keys where key type is string. - InternString bool - - // PreferArrayOverSlice controls whether to decode to an array or a slice. - // - // This only impacts decoding into a nil interface{}. - // Consequently, it has no effect on codecgen. - // - // *Note*: This only applies if using go1.5 and above, - // as it requires reflect.ArrayOf support which was absent before go1.5. - PreferArrayOverSlice bool - - // DeleteOnNilMapValue controls how to decode a nil value in the stream. - // - // If true, we will delete the mapping of the key. - // Else, just set the mapping to the zero value of the type. - DeleteOnNilMapValue bool - - // ReaderBufferSize is the size of the buffer used when reading. - // - // if > 0, we use a smart buffer internally for performance purposes. - ReaderBufferSize int -} - -// ------------------------------------ - -type bufioDecReader struct { - buf []byte - r io.Reader - - c int // cursor - n int // num read - err error - - trb bool - tr []byte - - b [8]byte -} - -func (z *bufioDecReader) reset(r io.Reader) { - z.r, z.c, z.n, z.err, z.trb = r, 0, 0, nil, false - if z.tr != nil { - z.tr = z.tr[:0] - } -} - -func (z *bufioDecReader) Read(p []byte) (n int, err error) { - if z.err != nil { - return 0, z.err - } - p0 := p - n = copy(p, z.buf[z.c:]) - z.c += n - if z.c == len(z.buf) { - z.c = 0 - } - z.n += n - if len(p) == n { - if z.c == 0 { - z.buf = z.buf[:1] - z.buf[0] = p[len(p)-1] - z.c = 1 - } - if z.trb { - z.tr = append(z.tr, p0[:n]...) - } - return - } - p = p[n:] - var n2 int - // if we are here, then z.buf is all read - if len(p) > len(z.buf) { - n2, err = decReadFull(z.r, p) - n += n2 - z.n += n2 - z.err = err - // don't return EOF if some bytes were read. keep for next time. - if n > 0 && err == io.EOF { - err = nil - } - // always keep last byte in z.buf - z.buf = z.buf[:1] - z.buf[0] = p[len(p)-1] - z.c = 1 - if z.trb { - z.tr = append(z.tr, p0[:n]...) - } - return - } - // z.c is now 0, and len(p) <= len(z.buf) - for len(p) > 0 && z.err == nil { - // println("len(p) loop starting ... ") - z.c = 0 - z.buf = z.buf[0:cap(z.buf)] - n2, err = z.r.Read(z.buf) - if n2 > 0 { - if err == io.EOF { - err = nil - } - z.buf = z.buf[:n2] - n2 = copy(p, z.buf) - z.c = n2 - n += n2 - z.n += n2 - p = p[n2:] - } - z.err = err - // println("... len(p) loop done") - } - if z.c == 0 { - z.buf = z.buf[:1] - z.buf[0] = p[len(p)-1] - z.c = 1 - } - if z.trb { - z.tr = append(z.tr, p0[:n]...) - } - return -} - -func (z *bufioDecReader) ReadByte() (b byte, err error) { - z.b[0] = 0 - _, err = z.Read(z.b[:1]) - b = z.b[0] - return -} - -func (z *bufioDecReader) UnreadByte() (err error) { - if z.err != nil { - return z.err - } - if z.c > 0 { - z.c-- - z.n-- - if z.trb { - z.tr = z.tr[:len(z.tr)-1] - } - return - } - return decUnreadByteNothingToReadErr -} - -func (z *bufioDecReader) numread() int { - return z.n -} - -func (z *bufioDecReader) readx(n int) (bs []byte) { - if n <= 0 || z.err != nil { - return - } - if z.c+n <= len(z.buf) { - bs = z.buf[z.c : z.c+n] - z.n += n - z.c += n - if z.trb { - z.tr = append(z.tr, bs...) - } - return - } - bs = make([]byte, n) - _, err := z.Read(bs) - if err != nil { - panic(err) - } - return -} - -func (z *bufioDecReader) readb(bs []byte) { - _, err := z.Read(bs) - if err != nil { - panic(err) - } -} - -// func (z *bufioDecReader) readn1eof() (b uint8, eof bool) { -// b, err := z.ReadByte() -// if err != nil { -// if err == io.EOF { -// eof = true -// } else { -// panic(err) -// } -// } -// return -// } - -func (z *bufioDecReader) readn1() (b uint8) { - b, err := z.ReadByte() - if err != nil { - panic(err) - } - return -} - -func (z *bufioDecReader) readn3() (b1, b2, b3 uint8) { - z.readb(z.b[:3]) - return z.b[0], z.b[1], z.b[2] -} - -func (z *bufioDecReader) readn4() (b1, b2, b3, b4 uint8) { - z.readb(z.b[:4]) - return z.b[0], z.b[1], z.b[2], z.b[3] -} - -func (z *bufioDecReader) search(in []byte, accept *bitset256, stop, flag uint8) (token byte, out []byte) { - // flag: 1 (skip), 2 (readTo), 4 (readUntil) - if flag == 4 { - for i := z.c; i < len(z.buf); i++ { - if z.buf[i] == stop { - token = z.buf[i] - z.n = z.n + (i - z.c) - 1 - i++ - out = z.buf[z.c:i] - if z.trb { - z.tr = append(z.tr, z.buf[z.c:i]...) - } - z.c = i - return - } - } - } else { - for i := z.c; i < len(z.buf); i++ { - if !accept.isset(z.buf[i]) { - token = z.buf[i] - z.n = z.n + (i - z.c) - 1 - if flag == 1 { - i++ - } else { - out = z.buf[z.c:i] - } - if z.trb { - z.tr = append(z.tr, z.buf[z.c:i]...) - } - z.c = i - return - } - } - } - z.n += len(z.buf) - z.c - if flag != 1 { - out = append(in, z.buf[z.c:]...) - } - if z.trb { - z.tr = append(z.tr, z.buf[z.c:]...) - } - var n2 int - if z.err != nil { - return - } - for { - z.c = 0 - z.buf = z.buf[0:cap(z.buf)] - n2, z.err = z.r.Read(z.buf) - if n2 > 0 && z.err != nil { - z.err = nil - } - z.buf = z.buf[:n2] - if flag == 4 { - for i := 0; i < n2; i++ { - if z.buf[i] == stop { - token = z.buf[i] - z.n += i - 1 - i++ - out = append(out, z.buf[z.c:i]...) - if z.trb { - z.tr = append(z.tr, z.buf[z.c:i]...) - } - z.c = i - return - } - } - } else { - for i := 0; i < n2; i++ { - if !accept.isset(z.buf[i]) { - token = z.buf[i] - z.n += i - 1 - if flag == 1 { - i++ - } - if flag != 1 { - out = append(out, z.buf[z.c:i]...) - } - if z.trb { - z.tr = append(z.tr, z.buf[z.c:i]...) - } - z.c = i - return - } - } - } - if flag != 1 { - out = append(out, z.buf[:n2]...) - } - z.n += n2 - if z.err != nil { - return - } - if z.trb { - z.tr = append(z.tr, z.buf[:n2]...) - } - } -} - -func (z *bufioDecReader) skip(accept *bitset256) (token byte) { - token, _ = z.search(nil, accept, 0, 1) - return -} - -func (z *bufioDecReader) readTo(in []byte, accept *bitset256) (out []byte) { - _, out = z.search(in, accept, 0, 2) - return -} - -func (z *bufioDecReader) readUntil(in []byte, stop byte) (out []byte) { - _, out = z.search(in, nil, stop, 4) - return -} - -func (z *bufioDecReader) unreadn1() { - err := z.UnreadByte() - if err != nil { - panic(err) - } -} - -func (z *bufioDecReader) track() { - if z.tr != nil { - z.tr = z.tr[:0] - } - z.trb = true -} - -func (z *bufioDecReader) stopTrack() (bs []byte) { - z.trb = false - return z.tr -} - -// ioDecReader is a decReader that reads off an io.Reader. -// -// It also has a fallback implementation of ByteScanner if needed. -type ioDecReader struct { - r io.Reader // the reader passed in - - rr io.Reader - br io.ByteScanner - - l byte // last byte - ls byte // last byte status. 0: init-canDoNothing, 1: canRead, 2: canUnread - b [4]byte // tiny buffer for reading single bytes - trb bool // tracking bytes turned on - - // temp byte array re-used internally for efficiency during read. - // shares buffer with Decoder, so we keep size of struct within 8 words. - x *[scratchByteArrayLen]byte - n int // num read - tr []byte // tracking bytes read -} - -func (z *ioDecReader) reset(r io.Reader) { - z.r = r - z.rr = r - z.l, z.ls, z.n, z.trb = 0, 0, 0, false - if z.tr != nil { - z.tr = z.tr[:0] - } - var ok bool - if z.br, ok = r.(io.ByteScanner); !ok { - z.br = z - z.rr = z - } -} - -func (z *ioDecReader) Read(p []byte) (n int, err error) { - if len(p) == 0 { - return - } - var firstByte bool - if z.ls == 1 { - z.ls = 2 - p[0] = z.l - if len(p) == 1 { - n = 1 - return - } - firstByte = true - p = p[1:] - } - n, err = z.r.Read(p) - if n > 0 { - if err == io.EOF && n == len(p) { - err = nil // read was successful, so postpone EOF (till next time) - } - z.l = p[n-1] - z.ls = 2 - } - if firstByte { - n++ - } - return -} - -func (z *ioDecReader) ReadByte() (c byte, err error) { - n, err := z.Read(z.b[:1]) - if n == 1 { - c = z.b[0] - if err == io.EOF { - err = nil // read was successful, so postpone EOF (till next time) - } - } - return -} - -func (z *ioDecReader) UnreadByte() (err error) { - switch z.ls { - case 2: - z.ls = 1 - case 0: - err = decUnreadByteNothingToReadErr - case 1: - err = decUnreadByteLastByteNotReadErr - default: - err = decUnreadByteUnknownErr - } - return -} - -func (z *ioDecReader) numread() int { - return z.n -} - -func (z *ioDecReader) readx(n int) (bs []byte) { - if n <= 0 { - return - } - if n < len(z.x) { - bs = z.x[:n] - } else { - bs = make([]byte, n) - } - if _, err := decReadFull(z.rr, bs); err != nil { - panic(err) - } - z.n += len(bs) - if z.trb { - z.tr = append(z.tr, bs...) - } - return -} - -func (z *ioDecReader) readb(bs []byte) { - // if len(bs) == 0 { - // return - // } - if _, err := decReadFull(z.rr, bs); err != nil { - panic(err) - } - z.n += len(bs) - if z.trb { - z.tr = append(z.tr, bs...) - } -} - -func (z *ioDecReader) readn1eof() (b uint8, eof bool) { - b, err := z.br.ReadByte() - if err == nil { - z.n++ - if z.trb { - z.tr = append(z.tr, b) - } - } else if err == io.EOF { - eof = true - } else { - panic(err) - } - return -} - -func (z *ioDecReader) readn1() (b uint8) { - var err error - if b, err = z.br.ReadByte(); err == nil { - z.n++ - if z.trb { - z.tr = append(z.tr, b) - } - return - } - panic(err) -} - -func (z *ioDecReader) readn3() (b1, b2, b3 uint8) { - z.readb(z.b[:3]) - return z.b[0], z.b[1], z.b[2] -} - -func (z *ioDecReader) readn4() (b1, b2, b3, b4 uint8) { - z.readb(z.b[:4]) - return z.b[0], z.b[1], z.b[2], z.b[3] -} - -func (z *ioDecReader) skip(accept *bitset256) (token byte) { - for { - var eof bool - token, eof = z.readn1eof() - if eof { - return - } - if accept.isset(token) { - continue - } - return - } -} - -func (z *ioDecReader) readTo(in []byte, accept *bitset256) (out []byte) { - out = in - for { - token, eof := z.readn1eof() - if eof { - return - } - if accept.isset(token) { - out = append(out, token) - } else { - z.unreadn1() - return - } - } -} - -func (z *ioDecReader) readUntil(in []byte, stop byte) (out []byte) { - out = in - for { - token, eof := z.readn1eof() - if eof { - panic(io.EOF) - } - out = append(out, token) - if token == stop { - return - } - } -} - -func (z *ioDecReader) unreadn1() { - err := z.br.UnreadByte() - if err != nil { - panic(err) - } - z.n-- - if z.trb { - if l := len(z.tr) - 1; l >= 0 { - z.tr = z.tr[:l] - } - } -} - -func (z *ioDecReader) track() { - if z.tr != nil { - z.tr = z.tr[:0] - } - z.trb = true -} - -func (z *ioDecReader) stopTrack() (bs []byte) { - z.trb = false - return z.tr -} - -// ------------------------------------ - -var bytesDecReaderCannotUnreadErr = errors.New("cannot unread last byte read") - -// bytesDecReader is a decReader that reads off a byte slice with zero copying -type bytesDecReader struct { - b []byte // data - c int // cursor - a int // available - t int // track start -} - -func (z *bytesDecReader) reset(in []byte) { - z.b = in - z.a = len(in) - z.c = 0 - z.t = 0 -} - -func (z *bytesDecReader) numread() int { - return z.c -} - -func (z *bytesDecReader) unreadn1() { - if z.c == 0 || len(z.b) == 0 { - panic(bytesDecReaderCannotUnreadErr) - } - z.c-- - z.a++ - return -} - -func (z *bytesDecReader) readx(n int) (bs []byte) { - // slicing from a non-constant start position is more expensive, - // as more computation is required to decipher the pointer start position. - // However, we do it only once, and it's better than reslicing both z.b and return value. - - if n <= 0 { - } else if z.a == 0 { - panic(io.EOF) - } else if n > z.a { - panic(io.ErrUnexpectedEOF) - } else { - c0 := z.c - z.c = c0 + n - z.a = z.a - n - bs = z.b[c0:z.c] - } - return -} - -func (z *bytesDecReader) readb(bs []byte) { - copy(bs, z.readx(len(bs))) -} - -func (z *bytesDecReader) readn1() (v uint8) { - if z.a == 0 { - panic(io.EOF) - } - v = z.b[z.c] - z.c++ - z.a-- - return -} - -func (z *bytesDecReader) readn3() (b1, b2, b3 uint8) { - if 3 > z.a { - panic(io.ErrUnexpectedEOF) - } - b3 = z.b[z.c+2] - b2 = z.b[z.c+1] - b1 = z.b[z.c] - z.c += 3 - z.a -= 3 - return -} - -func (z *bytesDecReader) readn4() (b1, b2, b3, b4 uint8) { - if 4 > z.a { - panic(io.ErrUnexpectedEOF) - } - b4 = z.b[z.c+3] - b3 = z.b[z.c+2] - b2 = z.b[z.c+1] - b1 = z.b[z.c] - z.c += 4 - z.a -= 4 - return -} - -// func (z *bytesDecReader) readn1eof() (v uint8, eof bool) { -// if z.a == 0 { -// eof = true -// return -// } -// v = z.b[z.c] -// z.c++ -// z.a-- -// return -// } - -func (z *bytesDecReader) skip(accept *bitset256) (token byte) { - if z.a == 0 { - return - } - blen := len(z.b) - for i := z.c; i < blen; i++ { - if !accept.isset(z.b[i]) { - token = z.b[i] - i++ - z.a -= (i - z.c) - z.c = i - return - } - } - z.a, z.c = 0, blen - return -} - -func (z *bytesDecReader) readTo(_ []byte, accept *bitset256) (out []byte) { - if z.a == 0 { - return - } - blen := len(z.b) - for i := z.c; i < blen; i++ { - if !accept.isset(z.b[i]) { - out = z.b[z.c:i] - z.a -= (i - z.c) - z.c = i - return - } - } - out = z.b[z.c:] - z.a, z.c = 0, blen - return -} - -func (z *bytesDecReader) readUntil(_ []byte, stop byte) (out []byte) { - if z.a == 0 { - panic(io.EOF) - } - blen := len(z.b) - for i := z.c; i < blen; i++ { - if z.b[i] == stop { - i++ - out = z.b[z.c:i] - z.a -= (i - z.c) - z.c = i - return - } - } - z.a, z.c = 0, blen - panic(io.EOF) -} - -func (z *bytesDecReader) track() { - z.t = z.c -} - -func (z *bytesDecReader) stopTrack() (bs []byte) { - return z.b[z.t:z.c] -} - -// ---------------------------------------- - -func (d *Decoder) builtin(f *codecFnInfo, rv reflect.Value) { - d.d.DecodeBuiltin(f.ti.rtid, rv2i(rv)) -} - -func (d *Decoder) rawExt(f *codecFnInfo, rv reflect.Value) { - d.d.DecodeExt(rv2i(rv), 0, nil) -} - -func (d *Decoder) ext(f *codecFnInfo, rv reflect.Value) { - d.d.DecodeExt(rv2i(rv), f.xfTag, f.xfFn) -} - -func (d *Decoder) getValueForUnmarshalInterface(rv reflect.Value, indir int8) (v interface{}) { - if indir == -1 { - v = rv2i(rv.Addr()) - } else if indir == 0 { - v = rv2i(rv) - } else { - for j := int8(0); j < indir; j++ { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) - } - rv = rv.Elem() - } - v = rv2i(rv) - } - return -} - -func (d *Decoder) selferUnmarshal(f *codecFnInfo, rv reflect.Value) { - d.getValueForUnmarshalInterface(rv, f.ti.csIndir).(Selfer).CodecDecodeSelf(d) -} - -func (d *Decoder) binaryUnmarshal(f *codecFnInfo, rv reflect.Value) { - bm := d.getValueForUnmarshalInterface(rv, f.ti.bunmIndir).(encoding.BinaryUnmarshaler) - xbs := d.d.DecodeBytes(nil, true) - if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil { - panic(fnerr) - } -} - -func (d *Decoder) textUnmarshal(f *codecFnInfo, rv reflect.Value) { - tm := d.getValueForUnmarshalInterface(rv, f.ti.tunmIndir).(encoding.TextUnmarshaler) - fnerr := tm.UnmarshalText(d.d.DecodeStringAsBytes()) - if fnerr != nil { - panic(fnerr) - } -} - -func (d *Decoder) jsonUnmarshal(f *codecFnInfo, rv reflect.Value) { - tm := d.getValueForUnmarshalInterface(rv, f.ti.junmIndir).(jsonUnmarshaler) - // bs := d.d.DecodeBytes(d.b[:], true, true) - // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself. - fnerr := tm.UnmarshalJSON(d.nextValueBytes()) - if fnerr != nil { - panic(fnerr) - } -} - -func (d *Decoder) kErr(f *codecFnInfo, rv reflect.Value) { - d.errorf("no decoding function defined for kind %v", rv.Kind()) -} - -// var kIntfCtr uint64 - -func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) { - // nil interface: - // use some hieristics to decode it appropriately - // based on the detected next value in the stream. - n := d.naked() - d.d.DecodeNaked() - if n.v == valueTypeNil { - return - } - // We cannot decode non-nil stream value into nil interface with methods (e.g. io.Reader). - // if num := f.ti.rt.NumMethod(); num > 0 { - if f.ti.numMeth > 0 { - d.errorf("cannot decode non-nil codec value into nil %v (%v methods)", f.ti.rt, f.ti.numMeth) - return - } - // var useRvn bool - switch n.v { - case valueTypeMap: - if d.mtid == 0 || d.mtid == mapIntfIntfTypId { - if n.lm < arrayCacheLen { - n.ma[n.lm] = nil - rvn = n.rr[decNakedMapIntfIntfIdx*arrayCacheLen+n.lm] - n.lm++ - d.decode(&n.ma[n.lm-1]) - n.lm-- - } else { - var v2 map[interface{}]interface{} - d.decode(&v2) - rvn = reflect.ValueOf(&v2).Elem() - } - } else if d.mtid == mapStrIntfTypId { // for json performance - if n.ln < arrayCacheLen { - n.na[n.ln] = nil - rvn = n.rr[decNakedMapStrIntfIdx*arrayCacheLen+n.ln] - n.ln++ - d.decode(&n.na[n.ln-1]) - n.ln-- - } else { - var v2 map[string]interface{} - d.decode(&v2) - rvn = reflect.ValueOf(&v2).Elem() - } - } else { - rvn = reflect.New(d.h.MapType) - if useLookupRecognizedTypes && d.mtr { // isRecognizedRtid(d.mtid) { - d.decode(rv2i(rvn)) - rvn = rvn.Elem() - } else { - rvn = rvn.Elem() - d.decodeValue(rvn, nil, false, true) - } - } - case valueTypeArray: - if d.stid == 0 || d.stid == intfSliceTypId { - if n.ls < arrayCacheLen { - n.sa[n.ls] = nil - rvn = n.rr[decNakedSliceIntfIdx*arrayCacheLen+n.ls] - n.ls++ - d.decode(&n.sa[n.ls-1]) - n.ls-- - } else { - var v2 []interface{} - d.decode(&v2) - rvn = reflect.ValueOf(&v2).Elem() - } - if reflectArrayOfSupported && d.stid == 0 && d.h.PreferArrayOverSlice { - rvn2 := reflect.New(reflectArrayOf(rvn.Len(), intfTyp)).Elem() - reflect.Copy(rvn2, rvn) - rvn = rvn2 - } - } else { - rvn = reflect.New(d.h.SliceType) - if useLookupRecognizedTypes && d.str { // isRecognizedRtid(d.stid) { - d.decode(rv2i(rvn)) - rvn = rvn.Elem() - } else { - rvn = rvn.Elem() - d.decodeValue(rvn, nil, false, true) - } - } - case valueTypeExt: - var v interface{} - tag, bytes := n.u, n.l // calling decode below might taint the values - if bytes == nil { - if n.li < arrayCacheLen { - n.ia[n.li] = nil - n.li++ - d.decode(&n.ia[n.li-1]) - // v = *(&n.ia[l]) - n.li-- - v = n.ia[n.li] - n.ia[n.li] = nil - } else { - d.decode(&v) - } - } - bfn := d.h.getExtForTag(tag) - if bfn == nil { - var re RawExt - re.Tag = tag - re.Data = detachZeroCopyBytes(d.bytes, nil, bytes) - re.Value = v - rvn = reflect.ValueOf(&re).Elem() - } else { - rvnA := reflect.New(bfn.rt) - if bytes != nil { - bfn.ext.ReadExt(rv2i(rvnA), bytes) - } else { - bfn.ext.UpdateExt(rv2i(rvnA), v) - } - rvn = rvnA.Elem() - } - case valueTypeNil: - // no-op - case valueTypeInt: - rvn = n.rr[decNakedIntIdx] // d.np.get(&n.i) - case valueTypeUint: - rvn = n.rr[decNakedUintIdx] // d.np.get(&n.u) - case valueTypeFloat: - rvn = n.rr[decNakedFloatIdx] // d.np.get(&n.f) - case valueTypeBool: - rvn = n.rr[decNakedBoolIdx] // d.np.get(&n.b) - case valueTypeString, valueTypeSymbol: - rvn = n.rr[decNakedStringIdx] // d.np.get(&n.s) - case valueTypeBytes: - rvn = n.rr[decNakedBytesIdx] // d.np.get(&n.l) - case valueTypeTimestamp: - rvn = n.rr[decNakedTimeIdx] // d.np.get(&n.t) - default: - panic(fmt.Errorf("kInterfaceNaked: unexpected valueType: %d", n.v)) - } - return -} - -func (d *Decoder) kInterface(f *codecFnInfo, rv reflect.Value) { - // Note: - // A consequence of how kInterface works, is that - // if an interface already contains something, we try - // to decode into what was there before. - // We do not replace with a generic value (as got from decodeNaked). - - // every interface passed here MUST be settable. - var rvn reflect.Value - if rv.IsNil() { - if rvn = d.kInterfaceNaked(f); rvn.IsValid() { - rv.Set(rvn) - } - return - } - if d.h.InterfaceReset { - if rvn = d.kInterfaceNaked(f); rvn.IsValid() { - rv.Set(rvn) - } else { - // reset to zero value based on current type in there. - rv.Set(reflect.Zero(rv.Elem().Type())) - } - return - } - - // now we have a non-nil interface value, meaning it contains a type - rvn = rv.Elem() - if d.d.TryDecodeAsNil() { - rv.Set(reflect.Zero(rvn.Type())) - return - } - - // Note: interface{} is settable, but underlying type may not be. - // Consequently, we MAY have to create a decodable value out of the underlying value, - // decode into it, and reset the interface itself. - // fmt.Printf(">>>> kInterface: rvn type: %v, rv type: %v\n", rvn.Type(), rv.Type()) - - rvn2, canDecode := isDecodeable(rvn) - if canDecode { - d.decodeValue(rvn2, nil, true, true) - return - } - - rvn2 = reflect.New(rvn.Type()).Elem() - rvn2.Set(rvn) - d.decodeValue(rvn2, nil, true, true) - rv.Set(rvn2) -} - -func (d *Decoder) kStruct(f *codecFnInfo, rv reflect.Value) { - // checking if recognized within kstruct is too expensive. - // only check where you can determine if valid outside the loop - // ie on homogenous collections: slices, arrays and maps. - // - // if true, we don't create too many decFn's. - // It's a delicate balance. - const checkRecognized bool = false // false: TODO - - fti := f.ti - dd := d.d - elemsep := d.hh.hasElemSeparators() - sfn := structFieldNode{v: rv, update: true} - ctyp := dd.ContainerType() - if ctyp == valueTypeMap { - containerLen := dd.ReadMapStart() - if containerLen == 0 { - dd.ReadMapEnd() - return - } - tisfi := fti.sfi - hasLen := containerLen >= 0 - - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - // rvkencname := dd.DecodeString() - if elemsep { - dd.ReadMapElemKey() - } - rvkencnameB := dd.DecodeStringAsBytes() - rvkencname := stringView(rvkencnameB) - // rvksi := ti.getForEncName(rvkencname) - if elemsep { - dd.ReadMapElemValue() - } - if k := fti.indexForEncName(rvkencname); k > -1 { - si := tisfi[k] - if dd.TryDecodeAsNil() { - si.setToZeroValue(rv) - } else { - d.decodeValue(sfn.field(si), nil, checkRecognized, true) - } - } else { - d.structFieldNotFound(-1, rvkencname) - } - // keepAlive4StringView(rvkencnameB) // maintain ref 4 stringView // not needed, as reference is outside loop - } - dd.ReadMapEnd() - } else if ctyp == valueTypeArray { - containerLen := dd.ReadArrayStart() - if containerLen == 0 { - dd.ReadArrayEnd() - return - } - // Not much gain from doing it two ways for array. - // Arrays are not used as much for structs. - hasLen := containerLen >= 0 - for j, si := range fti.sfip { - if (hasLen && j == containerLen) || (!hasLen && dd.CheckBreak()) { - break - } - if elemsep { - dd.ReadArrayElem() - } - if dd.TryDecodeAsNil() { - si.setToZeroValue(rv) - } else { - d.decodeValue(sfn.field(si), nil, checkRecognized, true) - } - } - if containerLen > len(fti.sfip) { - // read remaining values and throw away - for j := len(fti.sfip); j < containerLen; j++ { - if elemsep { - dd.ReadArrayElem() - } - d.structFieldNotFound(j, "") - } - } - dd.ReadArrayEnd() - } else { - d.error(onlyMapOrArrayCanDecodeIntoStructErr) - return - } -} - -func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { - // A slice can be set from a map or array in stream. - // This way, the order can be kept (as order is lost with map). - ti := f.ti - dd := d.d - rtelem0 := ti.rt.Elem() - ctyp := dd.ContainerType() - if ctyp == valueTypeBytes || ctyp == valueTypeString { - // you can only decode bytes or string in the stream into a slice or array of bytes - if !(ti.rtid == uint8SliceTypId || rtelem0.Kind() == reflect.Uint8) { - d.errorf("bytes or string in the stream must be decoded into a slice or array of bytes, not %v", ti.rt) - } - if f.seq == seqTypeChan { - bs2 := dd.DecodeBytes(nil, true) - ch := rv2i(rv).(chan<- byte) - for _, b := range bs2 { - ch <- b - } - } else { - rvbs := rv.Bytes() - bs2 := dd.DecodeBytes(rvbs, false) - if rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) { - if rv.CanSet() { - rv.SetBytes(bs2) - } else { - copy(rvbs, bs2) - } - } - } - return - } - - // array := f.seq == seqTypeChan - - slh, containerLenS := d.decSliceHelperStart() // only expects valueType(Array|Map) - - // an array can never return a nil slice. so no need to check f.array here. - if containerLenS == 0 { - if rv.CanSet() { - if f.seq == seqTypeSlice { - if rv.IsNil() { - rv.Set(reflect.MakeSlice(ti.rt, 0, 0)) - } else { - rv.SetLen(0) - } - } else if f.seq == seqTypeChan { - if rv.IsNil() { - rv.Set(reflect.MakeChan(ti.rt, 0)) - } - } - } - slh.End() - return - } - - rtelem0Size := int(rtelem0.Size()) - rtElem0Kind := rtelem0.Kind() - rtElem0Id := rt2id(rtelem0) - rtelem0Mut := !isImmutableKind(rtElem0Kind) - rtelem := rtelem0 - rtelemkind := rtelem.Kind() - for rtelemkind == reflect.Ptr { - rtelem = rtelem.Elem() - rtelemkind = rtelem.Kind() - } - - var fn *codecFn - - var rv0, rv9 reflect.Value - rv0 = rv - rvChanged := false - - rvlen := rv.Len() - rvcap := rv.Cap() - hasLen := containerLenS > 0 - if hasLen && f.seq == seqTypeSlice { - if containerLenS > rvcap { - oldRvlenGtZero := rvlen > 0 - rvlen = decInferLen(containerLenS, d.h.MaxInitLen, int(rtelem0.Size())) - if rvlen <= rvcap { - if rv.CanSet() { - rv.SetLen(rvlen) - } else { - rv = rv.Slice(0, rvlen) - rvChanged = true - } - } else { - rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) - rvcap = rvlen - rvChanged = true - } - if rvChanged && oldRvlenGtZero && !isImmutableKind(rtelem0.Kind()) { - reflect.Copy(rv, rv0) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap) - } - } else if containerLenS != rvlen { - rvlen = containerLenS - if rv.CanSet() { - rv.SetLen(rvlen) - } else { - rv = rv.Slice(0, rvlen) - rvChanged = true - } - } - } - - var recognizedRtid, recognizedRtidPtr bool - if useLookupRecognizedTypes { - recognizedRtid = isRecognizedRtid(rtElem0Id) - recognizedRtidPtr = isRecognizedRtidPtr(rtElem0Id) - } - - // consider creating new element once, and just decoding into it. - var rtelem0Zero reflect.Value - var rtelem0ZeroValid bool - var decodeAsNil bool - var j int - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && (f.seq == seqTypeSlice || f.seq == seqTypeChan) && rv.IsNil() { - if hasLen { - rvlen = decInferLen(containerLenS, d.h.MaxInitLen, rtelem0Size) - } else { - rvlen = 8 - } - if f.seq == seqTypeSlice { - rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) - rvChanged = true - } else if f.seq == seqTypeChan { - rv.Set(reflect.MakeChan(ti.rt, rvlen)) - } - } - slh.ElemContainerState(j) - decodeAsNil = dd.TryDecodeAsNil() - if f.seq == seqTypeChan { - if decodeAsNil { - rv.Send(reflect.Zero(rtelem0)) - continue - } - if rtelem0Mut || !rv9.IsValid() { // || (rtElem0Kind == reflect.Ptr && rv9.IsNil()) { - rv9 = reflect.New(rtelem0).Elem() - } - if useLookupRecognizedTypes && (recognizedRtid || recognizedRtidPtr) { - d.decode(rv2i(rv9.Addr())) - } else { - if fn == nil { - fn = d.cf.get(rtelem, true, true) - } - d.decodeValue(rv9, fn, false, true) - } - rv.Send(rv9) - } else { - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= rvlen { - if f.seq == seqTypeArray { - d.arrayCannotExpand(rvlen, j+1) - decodeIntoBlank = true - } else { // if f.seq == seqTypeSlice - // rv = reflect.Append(rv, reflect.Zero(rtelem0)) // uses append logic, plus varargs - var rvcap2 int - rv9, rvcap2, rvChanged = decExpandSliceRV(rv, ti.rt, rtelem0Size, 1, rvlen, rvcap) - rvlen++ - if rvChanged { - rv = rv9 - rvcap = rvcap2 - } - } - } - if decodeIntoBlank { - if !decodeAsNil { - d.swallow() - } - } else { - rv9 = rv.Index(j) - if d.h.SliceElementReset || decodeAsNil { - if !rtelem0ZeroValid { - rtelem0ZeroValid = true - rtelem0Zero = reflect.Zero(rtelem0) - } - rv9.Set(rtelem0Zero) - } - if decodeAsNil { - continue - } - - if useLookupRecognizedTypes && recognizedRtid { - d.decode(rv2i(rv9.Addr())) - } else if useLookupRecognizedTypes && recognizedRtidPtr { // && !rv9.IsNil() { - if rv9.IsNil() { - rv9.Set(reflect.New(rtelem)) - } - d.decode(rv2i(rv9)) - } else { - if fn == nil { - fn = d.cf.get(rtelem, true, true) - } - d.decodeValue(rv9, fn, false, true) - } - } - } - } - if f.seq == seqTypeSlice { - if j < rvlen { - if rv.CanSet() { - rv.SetLen(j) - } else { - rv = rv.Slice(0, j) - rvChanged = true - } - rvlen = j - } else if j == 0 && rv.IsNil() { - rv = reflect.MakeSlice(ti.rt, 0, 0) - rvChanged = true - } - } - slh.End() - - if rvChanged { - rv0.Set(rv) - } -} - -// func (d *Decoder) kArray(f *codecFnInfo, rv reflect.Value) { -// // d.decodeValueFn(rv.Slice(0, rv.Len())) -// f.kSlice(rv.Slice(0, rv.Len())) -// } - -func (d *Decoder) kMap(f *codecFnInfo, rv reflect.Value) { - dd := d.d - containerLen := dd.ReadMapStart() - elemsep := d.hh.hasElemSeparators() - ti := f.ti - if rv.IsNil() { - rv.Set(makeMapReflect(ti.rt, containerLen)) - } - - if containerLen == 0 { - dd.ReadMapEnd() - return - } - - ktype, vtype := ti.rt.Key(), ti.rt.Elem() - ktypeId := rt2id(ktype) - vtypeId := rt2id(vtype) - vtypeKind := vtype.Kind() - var recognizedKtyp, recognizedVtyp, recognizedPtrKtyp, recognizedPtrVtyp bool - if useLookupRecognizedTypes { - recognizedKtyp = isRecognizedRtid(ktypeId) - recognizedVtyp = isRecognizedRtid(vtypeId) - recognizedPtrKtyp = isRecognizedRtidPtr(ktypeId) - recognizedPtrVtyp = isRecognizedRtidPtr(vtypeId) - } - - var keyFn, valFn *codecFn - var ktypeLo, vtypeLo reflect.Type - for ktypeLo = ktype; ktypeLo.Kind() == reflect.Ptr; ktypeLo = ktypeLo.Elem() { - } - - for vtypeLo = vtype; vtypeLo.Kind() == reflect.Ptr; vtypeLo = vtypeLo.Elem() { - } - - var mapGet, mapSet bool - rvvImmut := isImmutableKind(vtypeKind) - if !d.h.MapValueReset { - // if pointer, mapGet = true - // if interface, mapGet = true if !DecodeNakedAlways (else false) - // if builtin, mapGet = false - // else mapGet = true - if vtypeKind == reflect.Ptr { - mapGet = true - } else if vtypeKind == reflect.Interface { - if !d.h.InterfaceReset { - mapGet = true - } - } else if !rvvImmut { - mapGet = true - } - } - - var rvk, rvkp, rvv, rvz reflect.Value - rvkMut := !isImmutableKind(ktype.Kind()) // if ktype is immutable, then re-use the same rvk. - ktypeIsString := ktypeId == stringTypId - ktypeIsIntf := ktypeId == intfTypId - hasLen := containerLen > 0 - var kstrbs []byte - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if elemsep { - dd.ReadMapElemKey() - } - // if a nil key, just ignore the mapped value and continue - if dd.TryDecodeAsNil() { - if elemsep { - dd.ReadMapElemValue() - } - d.swallow() - continue - } - if rvkMut || !rvkp.IsValid() { - rvkp = reflect.New(ktype) - rvk = rvkp.Elem() - } - if ktypeIsString { - kstrbs = dd.DecodeStringAsBytes() - rvk.SetString(stringView(kstrbs)) - // NOTE: if doing an insert, you MUST use a real string (not stringview) - } else if useLookupRecognizedTypes && recognizedKtyp { - d.decode(rv2i(rvkp)) - // rvk = rvkp.Elem() //TODO: remove, unnecessary - } else if useLookupRecognizedTypes && recognizedPtrKtyp { - if rvk.IsNil() { - rvk = reflect.New(ktypeLo) - } - d.decode(rv2i(rvk)) - } else { - if keyFn == nil { - keyFn = d.cf.get(ktypeLo, true, true) - } - d.decodeValue(rvk, keyFn, false, true) - } - // special case if a byte array. - if ktypeIsIntf { - rvk = rvk.Elem() - if rvk.Type() == uint8SliceTyp { - rvk = reflect.ValueOf(d.string(rvk.Bytes())) - } - } - - if elemsep { - dd.ReadMapElemValue() - } - - // Brittle, but OK per TryDecodeAsNil() contract. - // i.e. TryDecodeAsNil never shares slices with other decDriver procedures - if dd.TryDecodeAsNil() { - if ktypeIsString { - rvk.SetString(d.string(kstrbs)) - } - if d.h.DeleteOnNilMapValue { - rv.SetMapIndex(rvk, reflect.Value{}) - } else { - rv.SetMapIndex(rvk, reflect.Zero(vtype)) - } - continue - } - - mapSet = true // set to false if u do a get, and its a non-nil pointer - if mapGet { - // mapGet true only in case where kind=Ptr|Interface or kind is otherwise mutable. - rvv = rv.MapIndex(rvk) - if !rvv.IsValid() { - rvv = reflect.New(vtype).Elem() - } else if vtypeKind == reflect.Ptr { - if rvv.IsNil() { - rvv = reflect.New(vtype).Elem() - } else { - mapSet = false - } - } else if vtypeKind == reflect.Interface { - // not addressable, and thus not settable. - // e MUST create a settable/addressable variant - rvv2 := reflect.New(rvv.Type()).Elem() - if !rvv.IsNil() { - rvv2.Set(rvv) - } - rvv = rvv2 - } - // else it is ~mutable, and we can just decode into it directly - } else if rvvImmut { - if !rvz.IsValid() { - rvz = reflect.New(vtype).Elem() - } - rvv = rvz - } else { - rvv = reflect.New(vtype).Elem() - } - - // We MUST be done with the stringview of the key, before decoding the value - // so that we don't bastardize the reused byte array. - if mapSet && ktypeIsString { - rvk.SetString(d.string(kstrbs)) - } - if useLookupRecognizedTypes && recognizedVtyp && rvv.CanAddr() { - d.decode(rv2i(rvv.Addr())) - } else if useLookupRecognizedTypes && recognizedPtrVtyp { - if rvv.IsNil() { - rvv = reflect.New(vtypeLo) - mapSet = true - } - d.decode(rv2i(rvv)) - } else { - if valFn == nil { - valFn = d.cf.get(vtypeLo, true, true) - } - d.decodeValue(rvv, valFn, false, true) - // d.decodeValueFn(rvv, valFn) - } - if mapSet { - rv.SetMapIndex(rvk, rvv) - } - // if ktypeIsString { - // // keepAlive4StringView(kstrbs) // not needed, as reference is outside loop - // } - } - - dd.ReadMapEnd() -} - -// decNaked is used to keep track of the primitives decoded. -// Without it, we would have to decode each primitive and wrap it -// in an interface{}, causing an allocation. -// In this model, the primitives are decoded in a "pseudo-atomic" fashion, -// so we can rest assured that no other decoding happens while these -// primitives are being decoded. -// -// maps and arrays are not handled by this mechanism. -// However, RawExt is, and we accommodate for extensions that decode -// RawExt from DecodeNaked, but need to decode the value subsequently. -// kInterfaceNaked and swallow, which call DecodeNaked, handle this caveat. -// -// However, decNaked also keeps some arrays of default maps and slices -// used in DecodeNaked. This way, we can get a pointer to it -// without causing a new heap allocation. -// -// kInterfaceNaked will ensure that there is no allocation for the common -// uses. -type decNaked struct { - // r RawExt // used for RawExt, uint, []byte. - u uint64 - i int64 - f float64 - l []byte - s string - t time.Time - - b bool - - inited bool - - v valueType - - li, lm, ln, ls int8 - - // array/stacks for reducing allocation - // keep arrays at the bottom? Chance is that they are not used much. - ia [arrayCacheLen]interface{} - ma [arrayCacheLen]map[interface{}]interface{} - na [arrayCacheLen]map[string]interface{} - sa [arrayCacheLen][]interface{} - // ra [2]RawExt - - rr [5 * arrayCacheLen]reflect.Value -} - -const ( - decNakedUintIdx = iota - decNakedIntIdx - decNakedFloatIdx - decNakedBytesIdx - decNakedStringIdx - decNakedTimeIdx - decNakedBoolIdx -) -const ( - _ = iota // maps to the scalars above - decNakedIntfIdx - decNakedMapIntfIntfIdx - decNakedMapStrIntfIdx - decNakedSliceIntfIdx -) - -func (n *decNaked) init() { - if n.inited { - return - } - // n.ms = n.ma[:0] - // n.is = n.ia[:0] - // n.ns = n.na[:0] - // n.ss = n.sa[:0] - - n.rr[decNakedUintIdx] = reflect.ValueOf(&n.u).Elem() - n.rr[decNakedIntIdx] = reflect.ValueOf(&n.i).Elem() - n.rr[decNakedFloatIdx] = reflect.ValueOf(&n.f).Elem() - n.rr[decNakedBytesIdx] = reflect.ValueOf(&n.l).Elem() - n.rr[decNakedStringIdx] = reflect.ValueOf(&n.s).Elem() - n.rr[decNakedTimeIdx] = reflect.ValueOf(&n.t).Elem() - n.rr[decNakedBoolIdx] = reflect.ValueOf(&n.b).Elem() - - for i := range [arrayCacheLen]struct{}{} { - n.rr[decNakedIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.ia[i])).Elem() - n.rr[decNakedMapIntfIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.ma[i])).Elem() - n.rr[decNakedMapStrIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.na[i])).Elem() - n.rr[decNakedSliceIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.sa[i])).Elem() - } - n.inited = true - // n.rr[] = reflect.ValueOf(&n.) -} - -func (n *decNaked) reset() { - if n == nil { - return - } - n.li, n.lm, n.ln, n.ls = 0, 0, 0, 0 -} - -type rtid2rv struct { - rtid uintptr - rv reflect.Value -} - -// A Decoder reads and decodes an object from an input stream in the codec format. -type Decoder struct { - // hopefully, reduce derefencing cost by laying the decReader inside the Decoder. - // Try to put things that go together to fit within a cache line (8 words). - - d decDriver - // NOTE: Decoder shouldn't call it's read methods, - // as the handler MAY need to do some coordination. - r decReader - hh Handle - h *BasicHandle - - mtr, mtrp, str, strp bool // - - be bool // is binary encoding - bytes bool // is bytes reader - js bool // is json handle - - // ---- cpu cache line boundary? - - rb bytesDecReader - ri ioDecReader - bi bufioDecReader - - // cr containerStateRecv - - n *decNaked - nsp *sync.Pool - - // ---- cpu cache line boundary? - - is map[string]string // used for interning strings - - // cache the mapTypeId and sliceTypeId for faster comparisons - mtid uintptr - stid uintptr - - b [scratchByteArrayLen]byte - // _ uintptr // for alignment purposes, so next one starts from a cache line - - err error - // ---- cpu cache line boundary? - - cf codecFner - // _ [64]byte // force alignment??? -} - -// NewDecoder returns a Decoder for decoding a stream of bytes from an io.Reader. -// -// For efficiency, Users are encouraged to pass in a memory buffered reader -// (eg bufio.Reader, bytes.Buffer). -func NewDecoder(r io.Reader, h Handle) *Decoder { - d := newDecoder(h) - d.Reset(r) - return d -} - -// NewDecoderBytes returns a Decoder which efficiently decodes directly -// from a byte slice with zero copying. -func NewDecoderBytes(in []byte, h Handle) *Decoder { - d := newDecoder(h) - d.ResetBytes(in) - return d -} - -var defaultDecNaked decNaked - -func newDecoder(h Handle) *Decoder { - d := &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()} - - // NOTE: do not initialize d.n here. It is lazily initialized in d.naked() - - _, d.js = h.(*JsonHandle) - if d.h.InternString { - d.is = make(map[string]string, 32) - } - d.d = h.newDecDriver(d) - // d.cr, _ = d.d.(containerStateRecv) - return d -} - -// naked must be called before each call to .DecodeNaked, -// as they will use it. -func (d *Decoder) naked() *decNaked { - if d.n == nil { - // consider one of: - // - get from sync.Pool (if GC is frequent, there's no value here) - // - new alloc (safest. only init'ed if it a naked decode will be done) - // - field in Decoder (makes the Decoder struct very big) - // To support using a decoder where a DecodeNaked is not needed, - // we prefer #1 or #2. - // d.n = new(decNaked) // &d.nv // new(decNaked) // grab from a sync.Pool - // d.n.init() - var v interface{} - d.nsp, v = pool.decNaked() - d.n = v.(*decNaked) - } - return d.n -} - -func (d *Decoder) resetCommon() { - d.n.reset() - d.d.reset() - d.cf.reset(d.hh) - d.err = nil - // reset all things which were cached from the Handle, - // but could be changed. - d.mtid, d.stid = 0, 0 - d.mtr, d.mtrp, d.str, d.strp = false, false, false, false - if d.h.MapType != nil { - d.mtid = rt2id(d.h.MapType) - if useLookupRecognizedTypes { - d.mtr = isRecognizedRtid(d.mtid) - d.mtrp = isRecognizedRtidPtr(d.mtid) - } - } - if d.h.SliceType != nil { - d.stid = rt2id(d.h.SliceType) - if useLookupRecognizedTypes { - d.str = isRecognizedRtid(d.stid) - d.strp = isRecognizedRtidPtr(d.stid) - } - } -} - -func (d *Decoder) Reset(r io.Reader) { - if d.h.ReaderBufferSize > 0 { - d.bi.buf = make([]byte, 0, d.h.ReaderBufferSize) - d.bi.reset(r) - d.r = &d.bi - } else { - d.ri.x = &d.b - // d.s = d.sa[:0] - d.ri.reset(r) - d.r = &d.ri - } - d.resetCommon() -} - -func (d *Decoder) ResetBytes(in []byte) { - d.bytes = true - d.rb.reset(in) - d.r = &d.rb - d.resetCommon() -} - -// Decode decodes the stream from reader and stores the result in the -// value pointed to by v. v cannot be a nil pointer. v can also be -// a reflect.Value of a pointer. -// -// Note that a pointer to a nil interface is not a nil pointer. -// If you do not know what type of stream it is, pass in a pointer to a nil interface. -// We will decode and store a value in that nil interface. -// -// Sample usages: -// // Decoding into a non-nil typed value -// var f float32 -// err = codec.NewDecoder(r, handle).Decode(&f) -// -// // Decoding into nil interface -// var v interface{} -// dec := codec.NewDecoder(r, handle) -// err = dec.Decode(&v) -// -// When decoding into a nil interface{}, we will decode into an appropriate value based -// on the contents of the stream: -// - Numbers are decoded as float64, int64 or uint64. -// - Other values are decoded appropriately depending on the type: -// bool, string, []byte, time.Time, etc -// - Extensions are decoded as RawExt (if no ext function registered for the tag) -// Configurations exist on the Handle to override defaults -// (e.g. for MapType, SliceType and how to decode raw bytes). -// -// When decoding into a non-nil interface{} value, the mode of encoding is based on the -// type of the value. When a value is seen: -// - If an extension is registered for it, call that extension function -// - If it implements BinaryUnmarshaler, call its UnmarshalBinary(data []byte) error -// - Else decode it based on its reflect.Kind -// -// There are some special rules when decoding into containers (slice/array/map/struct). -// Decode will typically use the stream contents to UPDATE the container. -// - A map can be decoded from a stream map, by updating matching keys. -// - A slice can be decoded from a stream array, -// by updating the first n elements, where n is length of the stream. -// - A slice can be decoded from a stream map, by decoding as if -// it contains a sequence of key-value pairs. -// - A struct can be decoded from a stream map, by updating matching fields. -// - A struct can be decoded from a stream array, -// by updating fields as they occur in the struct (by index). -// -// When decoding a stream map or array with length of 0 into a nil map or slice, -// we reset the destination map or slice to a zero-length value. -// -// However, when decoding a stream nil, we reset the destination container -// to its "zero" value (e.g. nil for slice/map, etc). -// -func (d *Decoder) Decode(v interface{}) (err error) { - defer panicToErrs2(&d.err, &err) - d.MustDecode(v) - return -} - -// MustDecode is like Decode, but panics if unable to Decode. -// This provides insight to the code location that triggered the error. -func (d *Decoder) MustDecode(v interface{}) { - // TODO: Top-level: ensure that v is a pointer and not nil. - if d.err != nil { - panic(d.err) - } - if d.d.TryDecodeAsNil() { - d.setZero(v) - } else { - d.decode(v) - } - if d.nsp != nil { - if d.n != nil { - d.nsp.Put(d.n) - d.n = nil - } - d.nsp = nil - } - d.n = nil - // xprintf(">>>>>>>> >>>>>>>> num decFns: %v\n", d.cf.sn) -} - -// // this is not a smart swallow, as it allocates objects and does unnecessary work. -// func (d *Decoder) swallowViaHammer() { -// var blank interface{} -// d.decodeValueNoFn(reflect.ValueOf(&blank).Elem()) -// } - -func (d *Decoder) swallow() { - // smarter decode that just swallows the content - dd := d.d - if dd.TryDecodeAsNil() { - return - } - elemsep := d.hh.hasElemSeparators() - switch dd.ContainerType() { - case valueTypeMap: - containerLen := dd.ReadMapStart() - hasLen := containerLen >= 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - // if clenGtEqualZero {if j >= containerLen {break} } else if dd.CheckBreak() {break} - if elemsep { - dd.ReadMapElemKey() - } - d.swallow() - if elemsep { - dd.ReadMapElemValue() - } - d.swallow() - } - dd.ReadMapEnd() - case valueTypeArray: - containerLen := dd.ReadArrayStart() - hasLen := containerLen >= 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if elemsep { - dd.ReadArrayElem() - } - d.swallow() - } - dd.ReadArrayEnd() - case valueTypeBytes: - dd.DecodeBytes(d.b[:], true) - case valueTypeString: - dd.DecodeStringAsBytes() - default: - // these are all primitives, which we can get from decodeNaked - // if RawExt using Value, complete the processing. - n := d.naked() - dd.DecodeNaked() - if n.v == valueTypeExt && n.l == nil { - if n.li < arrayCacheLen { - n.ia[n.li] = nil - n.li++ - d.decode(&n.ia[n.li-1]) - n.ia[n.li-1] = nil - n.li-- - } else { - var v2 interface{} - d.decode(&v2) - } - } - } -} - -func (d *Decoder) setZero(iv interface{}) { - if iv == nil || definitelyNil(iv) { - return - } - switch v := iv.(type) { - case *string: - *v = "" - case *bool: - *v = false - case *int: - *v = 0 - case *int8: - *v = 0 - case *int16: - *v = 0 - case *int32: - *v = 0 - case *int64: - *v = 0 - case *uint: - *v = 0 - case *uint8: - *v = 0 - case *uint16: - *v = 0 - case *uint32: - *v = 0 - case *uint64: - *v = 0 - case *float32: - *v = 0 - case *float64: - *v = 0 - case *[]uint8: - *v = nil - case *Raw: - *v = nil - case reflect.Value: - v = d.ensureDecodeable(v) - if v.CanSet() { - v.Set(reflect.Zero(v.Type())) - } // TODO: else drain if chan, clear if map, set all to nil if slice??? - default: - if !fastpathDecodeSetZeroTypeSwitch(iv, d) { - v := reflect.ValueOf(iv) - v = d.ensureDecodeable(v) - if v.CanSet() { - v.Set(reflect.Zero(v.Type())) - } // TODO: else drain if chan, clear if map, set all to nil if slice??? - } - } -} - -func (d *Decoder) decode(iv interface{}) { - // check nil and interfaces explicitly, - // so that type switches just have a run of constant non-interface types. - if iv == nil { - d.error(cannotDecodeIntoNilErr) - return - } - if v, ok := iv.(Selfer); ok { - v.CodecDecodeSelf(d) - return - } - - switch v := iv.(type) { - // case nil: - // case Selfer: - - case reflect.Value: - v = d.ensureDecodeable(v) - d.decodeValue(v, nil, false, true) // TODO: maybe ask to recognize ... - - case *string: - *v = d.d.DecodeString() - case *bool: - *v = d.d.DecodeBool() - case *int: - *v = int(d.d.DecodeInt(intBitsize)) - case *int8: - *v = int8(d.d.DecodeInt(8)) - case *int16: - *v = int16(d.d.DecodeInt(16)) - case *int32: - *v = int32(d.d.DecodeInt(32)) - case *int64: - *v = d.d.DecodeInt(64) - case *uint: - *v = uint(d.d.DecodeUint(uintBitsize)) - case *uint8: - *v = uint8(d.d.DecodeUint(8)) - case *uint16: - *v = uint16(d.d.DecodeUint(16)) - case *uint32: - *v = uint32(d.d.DecodeUint(32)) - case *uint64: - *v = d.d.DecodeUint(64) - case *float32: - *v = float32(d.d.DecodeFloat(true)) - case *float64: - *v = d.d.DecodeFloat(false) - case *[]uint8: - *v = d.d.DecodeBytes(*v, false) - - case *Raw: - *v = d.rawBytes() - - case *interface{}: - d.decodeValue(reflect.ValueOf(iv).Elem(), nil, false, true) // TODO: consider recognize here - // d.decodeValueNotNil(reflect.ValueOf(iv).Elem()) - - default: - if !fastpathDecodeTypeSwitch(iv, d) { - v := reflect.ValueOf(iv) - v = d.ensureDecodeable(v) - d.decodeValue(v, nil, false, false) - // d.decodeValueFallback(v) - } - } -} - -func (d *Decoder) decodeValue(rv reflect.Value, fn *codecFn, tryRecognized, chkAll bool) { - // If stream is not containing a nil value, then we can deref to the base - // non-pointer value, and decode into that. - var rvp reflect.Value - var rvpValid bool - if rv.Kind() == reflect.Ptr { - rvpValid = true - for { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) - } - rvp = rv - rv = rv.Elem() - if rv.Kind() != reflect.Ptr { - break - } - } - } - - if useLookupRecognizedTypes && tryRecognized && isRecognizedRtid(rv2rtid(rv)) { - if rvpValid { - d.decode(rv2i(rvp)) - return - } else if rv.CanAddr() { - d.decode(rv2i(rv.Addr())) - return - } - } - - if fn == nil { - // always pass checkCodecSelfer=true, in case T or ****T is passed, where *T is a Selfer - fn = d.cf.get(rv.Type(), chkAll, true) // chkAll, chkAll) - } - if fn.i.addr { - if rvpValid { - fn.fd(d, &fn.i, rvp) - } else if rv.CanAddr() { - fn.fd(d, &fn.i, rv.Addr()) - } else { - fn.fd(d, &fn.i, rv) - } - } else { - fn.fd(d, &fn.i, rv) - } - // return rv -} - -func (d *Decoder) structFieldNotFound(index int, rvkencname string) { - // NOTE: rvkencname may be a stringView, so don't pass it to another function. - if d.h.ErrorIfNoField { - if index >= 0 { - d.errorf("no matching struct field found when decoding stream array at index %v", index) - return - } else if rvkencname != "" { - d.errorf("no matching struct field found when decoding stream map with key " + rvkencname) - return - } - } - d.swallow() -} - -func (d *Decoder) arrayCannotExpand(sliceLen, streamLen int) { - if d.h.ErrorIfNoArrayExpand { - d.errorf("cannot expand array len during decode from %v to %v", sliceLen, streamLen) - } -} - -func isDecodeable(rv reflect.Value) (rv2 reflect.Value, canDecode bool) { - switch rv.Kind() { - case reflect.Array: - return rv, true - case reflect.Ptr: - if !rv.IsNil() { - return rv.Elem(), true - } - case reflect.Slice, reflect.Chan, reflect.Map: - if !rv.IsNil() { - return rv, true - } - } - return -} - -func (d *Decoder) ensureDecodeable(rv reflect.Value) (rv2 reflect.Value) { - // decode can take any reflect.Value that is a inherently addressable i.e. - // - array - // - non-nil chan (we will SEND to it) - // - non-nil slice (we will set its elements) - // - non-nil map (we will put into it) - // - non-nil pointer (we can "update" it) - rv2, canDecode := isDecodeable(rv) - if canDecode { - return - } - if !rv.IsValid() { - d.error(cannotDecodeIntoNilErr) - return - } - if !rv.CanInterface() { - d.errorf("cannot decode into a value without an interface: %v", rv) - return - } - rvi := rv2i(rv) - d.errorf("cannot decode into value of kind: %v, type: %T, %v", rv.Kind(), rvi, rvi) - return -} - -// func (d *Decoder) chkPtrValue(rv reflect.Value) { -// // We can only decode into a non-nil pointer -// if rv.Kind() == reflect.Ptr && !rv.IsNil() { -// return -// } -// d.errNotValidPtrValue(rv) -// } - -// func (d *Decoder) errNotValidPtrValue(rv reflect.Value) { -// if !rv.IsValid() { -// d.error(cannotDecodeIntoNilErr) -// return -// } -// if !rv.CanInterface() { -// d.errorf("cannot decode into a value without an interface: %v", rv) -// return -// } -// rvi := rv2i(rv) -// d.errorf("cannot decode into non-pointer or nil pointer. Got: %v, %T, %v", rv.Kind(), rvi, rvi) -// } - -func (d *Decoder) error(err error) { - panic(err) -} - -func (d *Decoder) errorf(format string, params ...interface{}) { - params2 := make([]interface{}, len(params)+1) - params2[0] = d.r.numread() - copy(params2[1:], params) - err := fmt.Errorf("[pos %d]: "+format, params2...) - panic(err) -} - -// Possibly get an interned version of a string -// -// This should mostly be used for map keys, where the key type is string. -// This is because keys of a map/struct are typically reused across many objects. -func (d *Decoder) string(v []byte) (s string) { - if d.is == nil { - return string(v) // don't return stringView, as we need a real string here. - } - s, ok := d.is[string(v)] // no allocation here, per go implementation - if !ok { - s = string(v) // new allocation here - d.is[s] = s - } - return s -} - -// nextValueBytes returns the next value in the stream as a set of bytes. -func (d *Decoder) nextValueBytes() (bs []byte) { - d.d.uncacheRead() - d.r.track() - d.swallow() - bs = d.r.stopTrack() - return -} - -func (d *Decoder) rawBytes() []byte { - // ensure that this is not a view into the bytes - // i.e. make new copy always. - bs := d.nextValueBytes() - bs2 := make([]byte, len(bs)) - copy(bs2, bs) - return bs2 -} - -// -------------------------------------------------- - -// decSliceHelper assists when decoding into a slice, from a map or an array in the stream. -// A slice can be set from a map or array in stream. This supports the MapBySlice interface. -type decSliceHelper struct { - d *Decoder - // ct valueType - array bool -} - -func (d *Decoder) decSliceHelperStart() (x decSliceHelper, clen int) { - dd := d.d - ctyp := dd.ContainerType() - if ctyp == valueTypeArray { - x.array = true - clen = dd.ReadArrayStart() - } else if ctyp == valueTypeMap { - clen = dd.ReadMapStart() * 2 - } else { - d.errorf("only encoded map or array can be decoded into a slice (%d)", ctyp) - } - // x.ct = ctyp - x.d = d - return -} - -func (x decSliceHelper) End() { - if x.array { - x.d.d.ReadArrayEnd() - } else { - x.d.d.ReadMapEnd() - } -} - -func (x decSliceHelper) ElemContainerState(index int) { - if x.array { - x.d.d.ReadArrayElem() - } else { - if index%2 == 0 { - x.d.d.ReadMapElemKey() - } else { - x.d.d.ReadMapElemValue() - } - } -} - -func decByteSlice(r decReader, clen, maxInitLen int, bs []byte) (bsOut []byte) { - if clen == 0 { - return zeroByteSlice - } - if len(bs) == clen { - bsOut = bs - r.readb(bsOut) - } else if cap(bs) >= clen { - bsOut = bs[:clen] - r.readb(bsOut) - } else { - // bsOut = make([]byte, clen) - len2 := decInferLen(clen, maxInitLen, 1) - bsOut = make([]byte, len2) - r.readb(bsOut) - for len2 < clen { - len3 := decInferLen(clen-len2, maxInitLen, 1) - bs3 := bsOut - bsOut = make([]byte, len2+len3) - copy(bsOut, bs3) - r.readb(bsOut[len2:]) - len2 += len3 - } - } - return -} - -func detachZeroCopyBytes(isBytesReader bool, dest []byte, in []byte) (out []byte) { - if xlen := len(in); xlen > 0 { - if isBytesReader || xlen <= scratchByteArrayLen { - if cap(dest) >= xlen { - out = dest[:xlen] - } else { - out = make([]byte, xlen) - } - copy(out, in) - return - } - } - return in -} - -// decInferLen will infer a sensible length, given the following: -// - clen: length wanted. -// - maxlen: max length to be returned. -// if <= 0, it is unset, and we infer it based on the unit size -// - unit: number of bytes for each element of the collection -func decInferLen(clen, maxlen, unit int) (rvlen int) { - // handle when maxlen is not set i.e. <= 0 - if clen <= 0 { - return - } - if maxlen <= 0 { - // no maxlen defined. Use maximum of 256K memory, with a floor of 4K items. - // maxlen = 256 * 1024 / unit - // if maxlen < (4 * 1024) { - // maxlen = 4 * 1024 - // } - if unit < (256 / 4) { - maxlen = 256 * 1024 / unit - } else { - maxlen = 4 * 1024 - } - } - if clen > maxlen { - rvlen = maxlen - } else { - rvlen = clen - } - return -} - -func decExpandSliceRV(s reflect.Value, st reflect.Type, stElemSize, num, slen, scap int) ( - s2 reflect.Value, scap2 int, changed bool) { - l1 := slen + num // new slice length - if l1 < slen { - panic("expandSlice: slice overflow") - } - if l1 <= scap { - if s.CanSet() { - s.SetLen(l1) - } else { - s2 = s.Slice(0, l1) - scap2 = scap - changed = true - } - return - } - scap2 = growCap(scap, stElemSize, num) - s2 = reflect.MakeSlice(st, l1, scap2) - changed = true - reflect.Copy(s2, s) - return -} - -func decReadFull(r io.Reader, bs []byte) (n int, err error) { - var nn int - for n < len(bs) && err == nil { - nn, err = r.Read(bs[n:]) - if nn > 0 { - if err == io.EOF { - // leave EOF for next time - err = nil - } - n += nn - } - } - - // do not do this - it serves no purpose - // if n != len(bs) && err == io.EOF { err = io.ErrUnexpectedEOF } - return -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/encode.go deleted file mode 100644 index dd15a2f4..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/encode.go +++ /dev/null @@ -1,1414 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "bufio" - "encoding" - "fmt" - "io" - "reflect" - "sort" - "sync" -) - -const defEncByteBufSize = 1 << 6 // 4:16, 6:64, 8:256, 10:1024 - -// AsSymbolFlag defines what should be encoded as symbols. -type AsSymbolFlag uint8 - -const ( - // AsSymbolDefault is default. - // Currently, this means only encode struct field names as symbols. - // The default is subject to change. - AsSymbolDefault AsSymbolFlag = iota - - // AsSymbolAll means encode anything which could be a symbol as a symbol. - AsSymbolAll = 0xfe - - // AsSymbolNone means do not encode anything as a symbol. - AsSymbolNone = 1 << iota - - // AsSymbolMapStringKeys means encode keys in map[string]XXX as symbols. - AsSymbolMapStringKeysFlag - - // AsSymbolStructFieldName means encode struct field names as symbols. - AsSymbolStructFieldNameFlag -) - -// encWriter abstracts writing to a byte array or to an io.Writer. -type encWriter interface { - writeb([]byte) - writestr(string) - writen1(byte) - writen2(byte, byte) - writen4(byte, byte, byte, byte) - writen5(byte, byte, byte, byte, byte) - atEndOfEncode() -} - -// encDriver abstracts the actual codec (binc vs msgpack, etc) -type encDriver interface { - // IsBuiltinType(rt uintptr) bool - EncodeBuiltin(rt uintptr, v interface{}) - EncodeNil() - EncodeInt(i int64) - EncodeUint(i uint64) - EncodeBool(b bool) - EncodeFloat32(f float32) - EncodeFloat64(f float64) - // encodeExtPreamble(xtag byte, length int) - EncodeRawExt(re *RawExt, e *Encoder) - EncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder) - WriteArrayStart(length int) - WriteArrayElem() - WriteArrayEnd() - WriteMapStart(length int) - WriteMapElemKey() - WriteMapElemValue() - WriteMapEnd() - EncodeString(c charEncoding, v string) - EncodeSymbol(v string) - EncodeStringBytes(c charEncoding, v []byte) - //TODO - //encBignum(f *big.Int) - //encStringRunes(c charEncoding, v []rune) - - reset() - atEndOfEncode() -} - -type ioEncStringWriter interface { - WriteString(s string) (n int, err error) -} - -type ioEncFlusher interface { - Flush() error -} - -type encDriverAsis interface { - EncodeAsis(v []byte) -} - -// type encNoSeparator struct{} -// func (_ encNoSeparator) EncodeEnd() {} - -type encDriverNoopContainerWriter struct{} - -func (_ encDriverNoopContainerWriter) WriteArrayStart(length int) {} -func (_ encDriverNoopContainerWriter) WriteArrayElem() {} -func (_ encDriverNoopContainerWriter) WriteArrayEnd() {} -func (_ encDriverNoopContainerWriter) WriteMapStart(length int) {} -func (_ encDriverNoopContainerWriter) WriteMapElemKey() {} -func (_ encDriverNoopContainerWriter) WriteMapElemValue() {} -func (_ encDriverNoopContainerWriter) WriteMapEnd() {} -func (_ encDriverNoopContainerWriter) atEndOfEncode() {} - -// type ioEncWriterWriter interface { -// WriteByte(c byte) error -// WriteString(s string) (n int, err error) -// Write(p []byte) (n int, err error) -// } - -type EncodeOptions struct { - // Encode a struct as an array, and not as a map - StructToArray bool - - // Canonical representation means that encoding a value will always result in the same - // sequence of bytes. - // - // This only affects maps, as the iteration order for maps is random. - // - // The implementation MAY use the natural sort order for the map keys if possible: - // - // - If there is a natural sort order (ie for number, bool, string or []byte keys), - // then the map keys are first sorted in natural order and then written - // with corresponding map values to the strema. - // - If there is no natural sort order, then the map keys will first be - // encoded into []byte, and then sorted, - // before writing the sorted keys and the corresponding map values to the stream. - // - Canonical bool - - // CheckCircularRef controls whether we check for circular references - // and error fast during an encode. - // - // If enabled, an error is received if a pointer to a struct - // references itself either directly or through one of its fields (iteratively). - // - // This is opt-in, as there may be a performance hit to checking circular references. - CheckCircularRef bool - - // RecursiveEmptyCheck controls whether we descend into interfaces, structs and pointers - // when checking if a value is empty. - // - // Note that this may make OmitEmpty more expensive, as it incurs a lot more reflect calls. - RecursiveEmptyCheck bool - - // Raw controls whether we encode Raw values. - // This is a "dangerous" option and must be explicitly set. - // If set, we blindly encode Raw values as-is, without checking - // if they are a correct representation of a value in that format. - // If unset, we error out. - Raw bool - - // AsSymbols defines what should be encoded as symbols. - // - // Encoding as symbols can reduce the encoded size significantly. - // - // However, during decoding, each string to be encoded as a symbol must - // be checked to see if it has been seen before. Consequently, encoding time - // will increase if using symbols, because string comparisons has a clear cost. - // - // Sample values: - // AsSymbolNone - // AsSymbolAll - // AsSymbolMapStringKeys - // AsSymbolMapStringKeysFlag | AsSymbolStructFieldNameFlag - AsSymbols AsSymbolFlag - - // WriterBufferSize is the size of the buffer used when writing. - // - // if > 0, we use a smart buffer internally for performance purposes. - WriterBufferSize int -} - -// --------------------------------------------- - -type simpleIoEncWriter struct { - io.Writer -} - -// type bufIoEncWriter struct { -// w io.Writer -// buf []byte -// err error -// } - -// func (x *bufIoEncWriter) Write(b []byte) (n int, err error) { -// if x.err != nil { -// return 0, x.err -// } -// if cap(x.buf)-len(x.buf) >= len(b) { -// x.buf = append(x.buf, b) -// return len(b), nil -// } -// n, err = x.w.Write(x.buf) -// if err != nil { -// x.err = err -// return 0, x.err -// } -// n, err = x.w.Write(b) -// x.err = err -// return -// } - -// ioEncWriter implements encWriter and can write to an io.Writer implementation -type ioEncWriter struct { - w io.Writer - ww io.Writer - bw io.ByteWriter - sw ioEncStringWriter - fw ioEncFlusher - b [8]byte -} - -func (z *ioEncWriter) WriteByte(b byte) (err error) { - // x.bs[0] = b - // _, err = x.ww.Write(x.bs[:]) - z.b[0] = b - _, err = z.w.Write(z.b[:1]) - return -} - -func (z *ioEncWriter) WriteString(s string) (n int, err error) { - return z.w.Write(bytesView(s)) -} - -func (z *ioEncWriter) writeb(bs []byte) { - // if len(bs) == 0 { - // return - // } - if _, err := z.ww.Write(bs); err != nil { - panic(err) - } -} - -func (z *ioEncWriter) writestr(s string) { - // if len(s) == 0 { - // return - // } - if _, err := z.sw.WriteString(s); err != nil { - panic(err) - } -} - -func (z *ioEncWriter) writen1(b byte) { - if err := z.bw.WriteByte(b); err != nil { - panic(err) - } -} - -func (z *ioEncWriter) writen2(b1, b2 byte) { - var err error - if err = z.bw.WriteByte(b1); err == nil { - if err = z.bw.WriteByte(b2); err == nil { - return - } - } - panic(err) -} - -func (z *ioEncWriter) writen4(b1, b2, b3, b4 byte) { - z.b[0], z.b[1], z.b[2], z.b[3] = b1, b2, b3, b4 - if _, err := z.ww.Write(z.b[:4]); err != nil { - panic(err) - } -} - -func (z *ioEncWriter) writen5(b1, b2, b3, b4, b5 byte) { - z.b[0], z.b[1], z.b[2], z.b[3], z.b[4] = b1, b2, b3, b4, b5 - if _, err := z.ww.Write(z.b[:5]); err != nil { - panic(err) - } -} - -func (z *ioEncWriter) atEndOfEncode() { - if z.fw != nil { - z.fw.Flush() - } -} - -// ---------------------------------------- - -// bytesEncWriter implements encWriter and can write to an byte slice. -// It is used by Marshal function. -type bytesEncWriter struct { - b []byte - c int // cursor - out *[]byte // write out on atEndOfEncode -} - -func (z *bytesEncWriter) writeb(s []byte) { - oc, a := z.growNoAlloc(len(s)) - if a { - z.growAlloc(len(s), oc) - } - copy(z.b[oc:], s) -} - -func (z *bytesEncWriter) writestr(s string) { - oc, a := z.growNoAlloc(len(s)) - if a { - z.growAlloc(len(s), oc) - } - copy(z.b[oc:], s) -} - -func (z *bytesEncWriter) writen1(b1 byte) { - oc, a := z.growNoAlloc(1) - if a { - z.growAlloc(1, oc) - } - z.b[oc] = b1 -} - -func (z *bytesEncWriter) writen2(b1, b2 byte) { - oc, a := z.growNoAlloc(2) - if a { - z.growAlloc(2, oc) - } - z.b[oc+1] = b2 - z.b[oc] = b1 -} - -func (z *bytesEncWriter) writen4(b1, b2, b3, b4 byte) { - oc, a := z.growNoAlloc(4) - if a { - z.growAlloc(4, oc) - } - z.b[oc+3] = b4 - z.b[oc+2] = b3 - z.b[oc+1] = b2 - z.b[oc] = b1 -} - -func (z *bytesEncWriter) writen5(b1, b2, b3, b4, b5 byte) { - oc, a := z.growNoAlloc(5) - if a { - z.growAlloc(5, oc) - } - z.b[oc+4] = b5 - z.b[oc+3] = b4 - z.b[oc+2] = b3 - z.b[oc+1] = b2 - z.b[oc] = b1 -} - -func (z *bytesEncWriter) atEndOfEncode() { - *(z.out) = z.b[:z.c] -} - -// have a growNoalloc(n int), which can be inlined. -// if allocation is needed, then call growAlloc(n int) - -func (z *bytesEncWriter) growNoAlloc(n int) (oldcursor int, allocNeeded bool) { - oldcursor = z.c - z.c = z.c + n - if z.c > len(z.b) { - if z.c > cap(z.b) { - allocNeeded = true - } else { - z.b = z.b[:cap(z.b)] - } - } - return -} - -func (z *bytesEncWriter) growAlloc(n int, oldcursor int) { - // appendslice logic (if cap < 1024, *2, else *1.25): more expensive. many copy calls. - // bytes.Buffer model (2*cap + n): much better - // bs := make([]byte, 2*cap(z.b)+n) - bs := make([]byte, growCap(cap(z.b), 1, n)) - copy(bs, z.b[:oldcursor]) - z.b = bs -} - -// --------------------------------------------- - -func (e *Encoder) builtin(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeBuiltin(f.ti.rtid, rv2i(rv)) -} - -func (e *Encoder) raw(f *codecFnInfo, rv reflect.Value) { - e.rawBytes(rv2i(rv).(Raw)) -} - -func (e *Encoder) rawExt(f *codecFnInfo, rv reflect.Value) { - // rev := rv2i(rv).(RawExt) - // e.e.EncodeRawExt(&rev, e) - var re *RawExt - if rv.CanAddr() { - re = rv2i(rv.Addr()).(*RawExt) - } else { - rev := rv2i(rv).(RawExt) - re = &rev - } - e.e.EncodeRawExt(re, e) -} - -func (e *Encoder) ext(f *codecFnInfo, rv reflect.Value) { - // if this is a struct|array and it was addressable, then pass the address directly (not the value) - if k := rv.Kind(); (k == reflect.Struct || k == reflect.Array) && rv.CanAddr() { - rv = rv.Addr() - } - e.e.EncodeExt(rv2i(rv), f.xfTag, f.xfFn, e) -} - -func (e *Encoder) getValueForMarshalInterface(rv reflect.Value, indir int8) (v interface{}, proceed bool) { - if indir == 0 { - v = rv2i(rv) - } else if indir == -1 { - // If a non-pointer was passed to Encode(), then that value is not addressable. - // Take addr if addressable, else copy value to an addressable value. - if rv.CanAddr() { - v = rv2i(rv.Addr()) - } else { - rv2 := reflect.New(rv.Type()) - rv2.Elem().Set(rv) - v = rv2i(rv2) - } - } else { - for j := int8(0); j < indir; j++ { - if rv.IsNil() { - e.e.EncodeNil() - return - } - rv = rv.Elem() - } - v = rv2i(rv) - } - return v, true -} - -func (e *Encoder) selferMarshal(f *codecFnInfo, rv reflect.Value) { - if v, proceed := e.getValueForMarshalInterface(rv, f.ti.csIndir); proceed { - v.(Selfer).CodecEncodeSelf(e) - } -} - -func (e *Encoder) binaryMarshal(f *codecFnInfo, rv reflect.Value) { - if v, proceed := e.getValueForMarshalInterface(rv, f.ti.bmIndir); proceed { - bs, fnerr := v.(encoding.BinaryMarshaler).MarshalBinary() - e.marshal(bs, fnerr, false, c_RAW) - } -} - -func (e *Encoder) textMarshal(f *codecFnInfo, rv reflect.Value) { - if v, proceed := e.getValueForMarshalInterface(rv, f.ti.tmIndir); proceed { - bs, fnerr := v.(encoding.TextMarshaler).MarshalText() - e.marshal(bs, fnerr, false, c_UTF8) - } -} - -func (e *Encoder) jsonMarshal(f *codecFnInfo, rv reflect.Value) { - if v, proceed := e.getValueForMarshalInterface(rv, f.ti.jmIndir); proceed { - bs, fnerr := v.(jsonMarshaler).MarshalJSON() - e.marshal(bs, fnerr, true, c_UTF8) - } -} - -func (e *Encoder) kBool(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeBool(rv.Bool()) -} - -func (e *Encoder) kString(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeString(c_UTF8, rv.String()) -} - -func (e *Encoder) kFloat64(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeFloat64(rv.Float()) -} - -func (e *Encoder) kFloat32(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeFloat32(float32(rv.Float())) -} - -func (e *Encoder) kInt(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeInt(rv.Int()) -} - -func (e *Encoder) kUint(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeUint(rv.Uint()) -} - -func (e *Encoder) kInvalid(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeNil() -} - -func (e *Encoder) kErr(f *codecFnInfo, rv reflect.Value) { - e.errorf("unsupported kind %s, for %#v", rv.Kind(), rv) -} - -func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) { - ti := f.ti - ee := e.e - // array may be non-addressable, so we have to manage with care - // (don't call rv.Bytes, rv.Slice, etc). - // E.g. type struct S{B [2]byte}; - // Encode(S{}) will bomb on "panic: slice of unaddressable array". - if f.seq != seqTypeArray { - if rv.IsNil() { - ee.EncodeNil() - return - } - // If in this method, then there was no extension function defined. - // So it's okay to treat as []byte. - if ti.rtid == uint8SliceTypId { - ee.EncodeStringBytes(c_RAW, rv.Bytes()) - return - } - } - elemsep := e.hh.hasElemSeparators() - rtelem := ti.rt.Elem() - l := rv.Len() - if ti.rtid == uint8SliceTypId || rtelem.Kind() == reflect.Uint8 { - switch f.seq { - case seqTypeArray: - if rv.CanAddr() { - ee.EncodeStringBytes(c_RAW, rv.Slice(0, l).Bytes()) - } else { - var bs []byte - if l <= cap(e.b) { - bs = e.b[:l] - } else { - bs = make([]byte, l) - } - reflect.Copy(reflect.ValueOf(bs), rv) - ee.EncodeStringBytes(c_RAW, bs) - } - return - case seqTypeSlice: - ee.EncodeStringBytes(c_RAW, rv.Bytes()) - return - } - } - if ti.rtid == uint8SliceTypId && f.seq == seqTypeChan { - bs := e.b[:0] - // do not use range, so that the number of elements encoded - // does not change, and encoding does not hang waiting on someone to close chan. - // for b := range rv2i(rv).(<-chan byte) { bs = append(bs, b) } - ch := rv2i(rv).(<-chan byte) - for i := 0; i < l; i++ { - bs = append(bs, <-ch) - } - ee.EncodeStringBytes(c_RAW, bs) - return - } - - if ti.mbs { - if l%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", l) - return - } - ee.WriteMapStart(l / 2) - } else { - ee.WriteArrayStart(l) - } - - if l > 0 { - var fn *codecFn - var recognizedVtyp = useLookupRecognizedTypes && isRecognizedRtidOrPtr(rt2id(rtelem)) - if !recognizedVtyp { - for rtelem.Kind() == reflect.Ptr { - rtelem = rtelem.Elem() - } - // if kind is reflect.Interface, do not pre-determine the - // encoding type, because preEncodeValue may break it down to - // a concrete type and kInterface will bomb. - if rtelem.Kind() != reflect.Interface { - fn = e.cf.get(rtelem, true, true) - } - } - // TODO: Consider perf implication of encoding odd index values as symbols if type is string - for j := 0; j < l; j++ { - if elemsep { - if ti.mbs { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } else { - ee.WriteArrayElem() - } - } - if f.seq == seqTypeChan { - if rv2, ok2 := rv.Recv(); ok2 { - if useLookupRecognizedTypes && recognizedVtyp { - e.encode(rv2i(rv2)) - } else { - e.encodeValue(rv2, fn, true) - } - } else { - ee.EncodeNil() // WE HAVE TO DO SOMETHING, so nil if nothing received. - } - } else { - if useLookupRecognizedTypes && recognizedVtyp { - e.encode(rv2i(rv.Index(j))) - } else { - e.encodeValue(rv.Index(j), fn, true) - } - } - } - } - - if ti.mbs { - ee.WriteMapEnd() - } else { - ee.WriteArrayEnd() - } -} - -func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) { - fti := f.ti - elemsep := e.hh.hasElemSeparators() - tisfi := fti.sfip - toMap := !(fti.toArray || e.h.StructToArray) - if toMap { - tisfi = fti.sfi - } - ee := e.e - - sfn := structFieldNode{v: rv, update: false} - if toMap { - ee.WriteMapStart(len(tisfi)) - // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - if !elemsep { - for _, si := range tisfi { - if asSymbols { - ee.EncodeSymbol(si.encName) - } else { - ee.EncodeString(c_UTF8, si.encName) - } - e.encodeValue(sfn.field(si), nil, true) - } - } else { - for _, si := range tisfi { - ee.WriteMapElemKey() - if asSymbols { - ee.EncodeSymbol(si.encName) - } else { - ee.EncodeString(c_UTF8, si.encName) - } - ee.WriteMapElemValue() - e.encodeValue(sfn.field(si), nil, true) - } - } - ee.WriteMapEnd() - } else { - ee.WriteArrayStart(len(tisfi)) - if !elemsep { - for _, si := range tisfi { - e.encodeValue(sfn.field(si), nil, true) - } - } else { - for _, si := range tisfi { - ee.WriteArrayElem() - e.encodeValue(sfn.field(si), nil, true) - } - } - ee.WriteArrayEnd() - } -} - -func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { - fti := f.ti - elemsep := e.hh.hasElemSeparators() - tisfi := fti.sfip - toMap := !(fti.toArray || e.h.StructToArray) - // if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct) - if toMap { - tisfi = fti.sfi - } - newlen := len(fti.sfi) - ee := e.e - - // Use sync.Pool to reduce allocating slices unnecessarily. - // The cost of sync.Pool is less than the cost of new allocation. - // - // Each element of the array pools one of encStructPool(8|16|32|64). - // It allows the re-use of slices up to 64 in length. - // A performance cost of encoding structs was collecting - // which values were empty and should be omitted. - // We needed slices of reflect.Value and string to collect them. - // This shared pool reduces the amount of unnecessary creation we do. - // The cost is that of locking sometimes, but sync.Pool is efficient - // enough to reduce thread contention. - - var spool *sync.Pool - var poolv interface{} - var fkvs []stringRv - if newlen <= 8 { - spool, poolv = pool.stringRv8() - fkvs = poolv.(*[8]stringRv)[:newlen] - } else if newlen <= 16 { - spool, poolv = pool.stringRv16() - fkvs = poolv.(*[16]stringRv)[:newlen] - } else if newlen <= 32 { - spool, poolv = pool.stringRv32() - fkvs = poolv.(*[32]stringRv)[:newlen] - } else if newlen <= 64 { - spool, poolv = pool.stringRv64() - fkvs = poolv.(*[64]stringRv)[:newlen] - } else if newlen <= 128 { - spool, poolv = pool.stringRv128() - fkvs = poolv.(*[128]stringRv)[:newlen] - } else { - fkvs = make([]stringRv, newlen) - } - - newlen = 0 - var kv stringRv - recur := e.h.RecursiveEmptyCheck - sfn := structFieldNode{v: rv, update: false} - for _, si := range tisfi { - // kv.r = si.field(rv, false) - kv.r = sfn.field(si) - if toMap { - if si.omitEmpty && isEmptyValue(kv.r, recur, recur) { - continue - } - kv.v = si.encName - } else { - // use the zero value. - // if a reference or struct, set to nil (so you do not output too much) - if si.omitEmpty && isEmptyValue(kv.r, recur, recur) { - switch kv.r.Kind() { - case reflect.Struct, reflect.Interface, reflect.Ptr, reflect.Array, reflect.Map, reflect.Slice: - kv.r = reflect.Value{} //encode as nil - } - } - } - fkvs[newlen] = kv - newlen++ - } - - if toMap { - ee.WriteMapStart(newlen) - // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - if !elemsep { - for j := 0; j < newlen; j++ { - kv = fkvs[j] - if asSymbols { - ee.EncodeSymbol(kv.v) - } else { - ee.EncodeString(c_UTF8, kv.v) - } - e.encodeValue(kv.r, nil, true) - } - } else { - for j := 0; j < newlen; j++ { - kv = fkvs[j] - ee.WriteMapElemKey() - if asSymbols { - ee.EncodeSymbol(kv.v) - } else { - ee.EncodeString(c_UTF8, kv.v) - } - ee.WriteMapElemValue() - e.encodeValue(kv.r, nil, true) - } - } - ee.WriteMapEnd() - } else { - ee.WriteArrayStart(newlen) - if !elemsep { - for j := 0; j < newlen; j++ { - e.encodeValue(fkvs[j].r, nil, true) - } - } else { - for j := 0; j < newlen; j++ { - ee.WriteArrayElem() - e.encodeValue(fkvs[j].r, nil, true) - } - } - ee.WriteArrayEnd() - } - - // do not use defer. Instead, use explicit pool return at end of function. - // defer has a cost we are trying to avoid. - // If there is a panic and these slices are not returned, it is ok. - if spool != nil { - spool.Put(poolv) - } -} - -func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { - ee := e.e - if rv.IsNil() { - ee.EncodeNil() - return - } - - l := rv.Len() - ee.WriteMapStart(l) - elemsep := e.hh.hasElemSeparators() - if l == 0 { - ee.WriteMapEnd() - return - } - var asSymbols bool - // determine the underlying key and val encFn's for the map. - // This eliminates some work which is done for each loop iteration i.e. - // rv.Type(), ref.ValueOf(rt).Pointer(), then check map/list for fn. - // - // However, if kind is reflect.Interface, do not pre-determine the - // encoding type, because preEncodeValue may break it down to - // a concrete type and kInterface will bomb. - var keyFn, valFn *codecFn - ti := f.ti - rtkey0 := ti.rt.Key() - rtkey := rtkey0 - rtval0 := ti.rt.Elem() - rtval := rtval0 - rtkeyid := rt2id(rtkey0) - rtvalid := rt2id(rtval0) - for rtval.Kind() == reflect.Ptr { - rtval = rtval.Elem() - } - if rtval.Kind() != reflect.Interface { - valFn = e.cf.get(rtval, true, true) - } - mks := rv.MapKeys() - - if e.h.Canonical { - e.kMapCanonical(rtkey, rv, mks, valFn, asSymbols) - ee.WriteMapEnd() - return - } - - var recognizedKtyp, recognizedVtyp bool - var keyTypeIsString = rtkeyid == stringTypId - if keyTypeIsString { - asSymbols = e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - } else { - if useLookupRecognizedTypes { - if recognizedKtyp = isRecognizedRtidOrPtr(rtkeyid); recognizedKtyp { - goto LABEL1 - } - } - for rtkey.Kind() == reflect.Ptr { - rtkey = rtkey.Elem() - } - if rtkey.Kind() != reflect.Interface { - rtkeyid = rt2id(rtkey) - keyFn = e.cf.get(rtkey, true, true) - } - } - - // for j, lmks := 0, len(mks); j < lmks; j++ { -LABEL1: - recognizedVtyp = useLookupRecognizedTypes && isRecognizedRtidOrPtr(rtvalid) - for j := range mks { - if elemsep { - ee.WriteMapElemKey() - } - if keyTypeIsString { - if asSymbols { - ee.EncodeSymbol(mks[j].String()) - } else { - ee.EncodeString(c_UTF8, mks[j].String()) - } - } else if useLookupRecognizedTypes && recognizedKtyp { - e.encode(rv2i(mks[j])) - } else { - e.encodeValue(mks[j], keyFn, true) - } - if elemsep { - ee.WriteMapElemValue() - } - if useLookupRecognizedTypes && recognizedVtyp { - e.encode(rv2i(rv.MapIndex(mks[j]))) - } else { - e.encodeValue(rv.MapIndex(mks[j]), valFn, true) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []reflect.Value, valFn *codecFn, asSymbols bool) { - ee := e.e - elemsep := e.hh.hasElemSeparators() - // we previously did out-of-band if an extension was registered. - // This is not necessary, as the natural kind is sufficient for ordering. - - // WHAT IS THIS? rtkeyid can never be a []uint8, per spec - // if rtkeyid == uint8SliceTypId { - // mksv := make([]bytesRv, len(mks)) - // for i, k := range mks { - // v := &mksv[i] - // v.r = k - // v.v = k.Bytes() - // } - // sort.Sort(bytesRvSlice(mksv)) - // for i := range mksv { - // if elemsep { - // ee.WriteMapElemKey() - // } - // ee.EncodeStringBytes(c_RAW, mksv[i].v) - // if elemsep { - // ee.WriteMapElemValue() - // } - // e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - // } - // return - // } - - switch rtkey.Kind() { - case reflect.Bool: - mksv := make([]boolRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Bool() - } - sort.Sort(boolRvSlice(mksv)) - for i := range mksv { - if elemsep { - ee.WriteMapElemKey() - } - ee.EncodeBool(mksv[i].v) - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - } - case reflect.String: - mksv := make([]stringRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.String() - } - sort.Sort(stringRvSlice(mksv)) - for i := range mksv { - if elemsep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(mksv[i].v) - } else { - ee.EncodeString(c_UTF8, mksv[i].v) - } - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - } - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr: - mksv := make([]uintRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Uint() - } - sort.Sort(uintRvSlice(mksv)) - for i := range mksv { - if elemsep { - ee.WriteMapElemKey() - } - ee.EncodeUint(mksv[i].v) - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - } - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - mksv := make([]intRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Int() - } - sort.Sort(intRvSlice(mksv)) - for i := range mksv { - if elemsep { - ee.WriteMapElemKey() - } - ee.EncodeInt(mksv[i].v) - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - } - case reflect.Float32: - mksv := make([]floatRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Float() - } - sort.Sort(floatRvSlice(mksv)) - for i := range mksv { - if elemsep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(mksv[i].v)) - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - } - case reflect.Float64: - mksv := make([]floatRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Float() - } - sort.Sort(floatRvSlice(mksv)) - for i := range mksv { - if elemsep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(mksv[i].v) - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) - } - default: - // out-of-band - // first encode each key to a []byte first, then sort them, then record - var mksv []byte = make([]byte, 0, len(mks)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - mksbv := make([]bytesRv, len(mks)) - for i, k := range mks { - v := &mksbv[i] - l := len(mksv) - e2.MustEncode(k) - v.r = k - v.v = mksv[l:] - } - sort.Sort(bytesRvSlice(mksbv)) - for j := range mksbv { - if elemsep { - ee.WriteMapElemKey() - } - e.asis(mksbv[j].v) - if elemsep { - ee.WriteMapElemValue() - } - e.encodeValue(rv.MapIndex(mksbv[j].r), valFn, true) - } - } -} - -// // -------------------------------------------------- - -// An Encoder writes an object to an output stream in the codec format. -type Encoder struct { - // hopefully, reduce derefencing cost by laying the encWriter inside the Encoder - e encDriver - // NOTE: Encoder shouldn't call it's write methods, - // as the handler MAY need to do some coordination. - w encWriter - - hh Handle - h *BasicHandle - - // ---- cpu cache line boundary? - - wi ioEncWriter - wb bytesEncWriter - bw bufio.Writer - - // cr containerStateRecv - as encDriverAsis - // ---- cpu cache line boundary? - - ci set - err error - - b [scratchByteArrayLen]byte - cf codecFner -} - -// NewEncoder returns an Encoder for encoding into an io.Writer. -// -// For efficiency, Users are encouraged to pass in a memory buffered writer -// (eg bufio.Writer, bytes.Buffer). -func NewEncoder(w io.Writer, h Handle) *Encoder { - e := newEncoder(h) - e.Reset(w) - return e -} - -// NewEncoderBytes returns an encoder for encoding directly and efficiently -// into a byte slice, using zero-copying to temporary slices. -// -// It will potentially replace the output byte slice pointed to. -// After encoding, the out parameter contains the encoded contents. -func NewEncoderBytes(out *[]byte, h Handle) *Encoder { - e := newEncoder(h) - e.ResetBytes(out) - return e -} - -func newEncoder(h Handle) *Encoder { - e := &Encoder{hh: h, h: h.getBasicHandle()} - e.e = h.newEncDriver(e) - e.as, _ = e.e.(encDriverAsis) - // e.cr, _ = e.e.(containerStateRecv) - return e -} - -// Reset the Encoder with a new output stream. -// -// This accommodates using the state of the Encoder, -// where it has "cached" information about sub-engines. -func (e *Encoder) Reset(w io.Writer) { - var ok bool - e.wi.w = w - if e.h.WriterBufferSize > 0 { - bw := bufio.NewWriterSize(w, e.h.WriterBufferSize) - e.bw = *bw - e.wi.bw = &e.bw - e.wi.sw = &e.bw - e.wi.fw = &e.bw - e.wi.ww = &e.bw - } else { - if e.wi.bw, ok = w.(io.ByteWriter); !ok { - e.wi.bw = &e.wi - } - if e.wi.sw, ok = w.(ioEncStringWriter); !ok { - e.wi.sw = &e.wi - } - e.wi.fw, _ = w.(ioEncFlusher) - e.wi.ww = w - } - e.w = &e.wi - e.e.reset() - e.cf.reset(e.hh) - e.err = nil -} - -func (e *Encoder) ResetBytes(out *[]byte) { - in := *out - if in == nil { - in = make([]byte, defEncByteBufSize) - } - e.wb.b, e.wb.out, e.wb.c = in, out, 0 - e.w = &e.wb - e.e.reset() - e.cf.reset(e.hh) - e.err = nil -} - -// Encode writes an object into a stream. -// -// Encoding can be configured via the struct tag for the fields. -// The "codec" key in struct field's tag value is the key name, -// followed by an optional comma and options. -// Note that the "json" key is used in the absence of the "codec" key. -// -// To set an option on all fields (e.g. omitempty on all fields), you -// can create a field called _struct, and set flags on it. -// -// Struct values "usually" encode as maps. Each exported struct field is encoded unless: -// - the field's tag is "-", OR -// - the field is empty (empty or the zero value) and its tag specifies the "omitempty" option. -// -// When encoding as a map, the first string in the tag (before the comma) -// is the map key string to use when encoding. -// -// However, struct values may encode as arrays. This happens when: -// - StructToArray Encode option is set, OR -// - the tag on the _struct field sets the "toarray" option -// Note that omitempty is ignored when encoding struct values as arrays, -// as an entry must be encoded for each field, to maintain its position. -// -// Values with types that implement MapBySlice are encoded as stream maps. -// -// The empty values (for omitempty option) are false, 0, any nil pointer -// or interface value, and any array, slice, map, or string of length zero. -// -// Anonymous fields are encoded inline except: -// - the struct tag specifies a replacement name (first value) -// - the field is of an interface type -// -// Examples: -// -// // NOTE: 'json:' can be used as struct tag key, in place 'codec:' below. -// type MyStruct struct { -// _struct bool `codec:",omitempty"` //set omitempty for every field -// Field1 string `codec:"-"` //skip this field -// Field2 int `codec:"myName"` //Use key "myName" in encode stream -// Field3 int32 `codec:",omitempty"` //use key "Field3". Omit if empty. -// Field4 bool `codec:"f4,omitempty"` //use key "f4". Omit if empty. -// io.Reader //use key "Reader". -// MyStruct `codec:"my1" //use key "my1". -// MyStruct //inline it -// ... -// } -// -// type MyStruct struct { -// _struct bool `codec:",toarray"` //encode struct as an array -// } -// -// The mode of encoding is based on the type of the value. When a value is seen: -// - If a Selfer, call its CodecEncodeSelf method -// - If an extension is registered for it, call that extension function -// - If it implements encoding.(Binary|Text|JSON)Marshaler, call its Marshal(Binary|Text|JSON) method -// - Else encode it based on its reflect.Kind -// -// Note that struct field names and keys in map[string]XXX will be treated as symbols. -// Some formats support symbols (e.g. binc) and will properly encode the string -// only once in the stream, and use a tag to refer to it thereafter. -func (e *Encoder) Encode(v interface{}) (err error) { - defer panicToErrs2(&e.err, &err) - e.MustEncode(v) - return -} - -// MustEncode is like Encode, but panics if unable to Encode. -// This provides insight to the code location that triggered the error. -func (e *Encoder) MustEncode(v interface{}) { - if e.err != nil { - panic(e.err) - } - e.encode(v) - e.e.atEndOfEncode() - e.w.atEndOfEncode() -} - -func (e *Encoder) encode(iv interface{}) { - if iv == nil || definitelyNil(iv) { - e.e.EncodeNil() - return - } - if v, ok := iv.(Selfer); ok { - v.CodecEncodeSelf(e) - return - } - - switch v := iv.(type) { - // case nil: - // e.e.EncodeNil() - // case Selfer: - // v.CodecEncodeSelf(e) - case Raw: - e.rawBytes(v) - case reflect.Value: - e.encodeValue(v, nil, true) - - case string: - e.e.EncodeString(c_UTF8, v) - case bool: - e.e.EncodeBool(v) - case int: - e.e.EncodeInt(int64(v)) - case int8: - e.e.EncodeInt(int64(v)) - case int16: - e.e.EncodeInt(int64(v)) - case int32: - e.e.EncodeInt(int64(v)) - case int64: - e.e.EncodeInt(v) - case uint: - e.e.EncodeUint(uint64(v)) - case uint8: - e.e.EncodeUint(uint64(v)) - case uint16: - e.e.EncodeUint(uint64(v)) - case uint32: - e.e.EncodeUint(uint64(v)) - case uint64: - e.e.EncodeUint(v) - case uintptr: - e.e.EncodeUint(uint64(v)) - case float32: - e.e.EncodeFloat32(v) - case float64: - e.e.EncodeFloat64(v) - - case []uint8: - e.e.EncodeStringBytes(c_RAW, v) - - case *string: - e.e.EncodeString(c_UTF8, *v) - case *bool: - e.e.EncodeBool(*v) - case *int: - e.e.EncodeInt(int64(*v)) - case *int8: - e.e.EncodeInt(int64(*v)) - case *int16: - e.e.EncodeInt(int64(*v)) - case *int32: - e.e.EncodeInt(int64(*v)) - case *int64: - e.e.EncodeInt(*v) - case *uint: - e.e.EncodeUint(uint64(*v)) - case *uint8: - e.e.EncodeUint(uint64(*v)) - case *uint16: - e.e.EncodeUint(uint64(*v)) - case *uint32: - e.e.EncodeUint(uint64(*v)) - case *uint64: - e.e.EncodeUint(*v) - case *uintptr: - e.e.EncodeUint(uint64(*v)) - case *float32: - e.e.EncodeFloat32(*v) - case *float64: - e.e.EncodeFloat64(*v) - - case *[]uint8: - e.e.EncodeStringBytes(c_RAW, *v) - - default: - if !fastpathEncodeTypeSwitch(iv, e) { - e.encodeValue(reflect.ValueOf(iv), nil, false) - } - } -} - -func (e *Encoder) encodeValue(rv reflect.Value, fn *codecFn, checkFastpath bool) { - // if a valid fn is passed, it MUST BE for the dereferenced type of rv - var sptr uintptr -TOP: - switch rv.Kind() { - case reflect.Ptr: - if rv.IsNil() { - e.e.EncodeNil() - return - } - rv = rv.Elem() - if e.h.CheckCircularRef && rv.Kind() == reflect.Struct { - // TODO: Movable pointers will be an issue here. Future problem. - sptr = rv.UnsafeAddr() - break TOP - } - goto TOP - case reflect.Interface: - if rv.IsNil() { - e.e.EncodeNil() - return - } - rv = rv.Elem() - goto TOP - case reflect.Slice, reflect.Map: - if rv.IsNil() { - e.e.EncodeNil() - return - } - case reflect.Invalid, reflect.Func: - e.e.EncodeNil() - return - } - - if sptr != 0 && (&e.ci).add(sptr) { - e.errorf("circular reference found: # %d", sptr) - } - - if fn == nil { - rt := rv.Type() - // TODO: calling isRecognizedRtid here is a major slowdown - if false && useLookupRecognizedTypes && isRecognizedRtidOrPtr(rt2id(rt)) { - e.encode(rv2i(rv)) - return - } - // always pass checkCodecSelfer=true, in case T or ****T is passed, where *T is a Selfer - fn = e.cf.get(rt, checkFastpath, true) - } - fn.fe(e, &fn.i, rv) - if sptr != 0 { - (&e.ci).remove(sptr) - } -} - -func (e *Encoder) marshal(bs []byte, fnerr error, asis bool, c charEncoding) { - if fnerr != nil { - panic(fnerr) - } - if bs == nil { - e.e.EncodeNil() - } else if asis { - e.asis(bs) - } else { - e.e.EncodeStringBytes(c, bs) - } -} - -func (e *Encoder) asis(v []byte) { - if e.as == nil { - e.w.writeb(v) - } else { - e.as.EncodeAsis(v) - } -} - -func (e *Encoder) rawBytes(vv Raw) { - v := []byte(vv) - if !e.h.Raw { - e.errorf("Raw values cannot be encoded: %v", v) - } - if e.as == nil { - e.w.writeb(v) - } else { - e.as.EncodeAsis(v) - } -} - -func (e *Encoder) errorf(format string, params ...interface{}) { - err := fmt.Errorf(format, params...) - panic(err) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.generated.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.generated.go deleted file mode 100644 index 69b11fcf..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.generated.go +++ /dev/null @@ -1,33034 +0,0 @@ -// +build !notfastpath - -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED from fast-path.go.tmpl -// ************************************************************ - -package codec - -// Fast path functions try to create a fast path encode or decode implementation -// for common maps and slices. -// -// We define the functions and register then in this single file -// so as not to pollute the encode.go and decode.go, and create a dependency in there. -// This file can be omitted without causing a build failure. -// -// The advantage of fast paths is: -// - Many calls bypass reflection altogether -// -// Currently support -// - slice of all builtin types, -// - map of all builtin types to string or interface value -// - symmetrical maps of all builtin types (e.g. str-str, uint8-uint8) -// This should provide adequate "typical" implementations. -// -// Note that fast track decode functions must handle values for which an address cannot be obtained. -// For example: -// m2 := map[string]int{} -// p2 := []interface{}{m2} -// // decoding into p2 will bomb if fast track functions do not treat like unaddressable. -// - -import ( - "reflect" - "sort" -) - -const fastpathEnabled = true - -type fastpathT struct{} - -var fastpathTV fastpathT - -type fastpathE struct { - rtid uintptr - rt reflect.Type - encfn func(*Encoder, *codecFnInfo, reflect.Value) - decfn func(*Decoder, *codecFnInfo, reflect.Value) -} - -type fastpathA [271]fastpathE - -func (x *fastpathA) index(rtid uintptr) int { - // use binary search to grab the index (adapted from sort/search.go) - h, i, j := 0, 0, 271 // len(x) - for i < j { - h = i + (j-i)/2 - if x[h].rtid < rtid { - i = h + 1 - } else { - j = h - } - } - if i < 271 && x[i].rtid == rtid { - return i - } - return -1 -} - -type fastpathAslice []fastpathE - -func (x fastpathAslice) Len() int { return len(x) } -func (x fastpathAslice) Less(i, j int) bool { return x[i].rtid < x[j].rtid } -func (x fastpathAslice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -var fastpathAV fastpathA - -// due to possible initialization loop error, make fastpath in an init() -func init() { - i := 0 - fn := func(v interface{}, - fe func(*Encoder, *codecFnInfo, reflect.Value), - fd func(*Decoder, *codecFnInfo, reflect.Value)) (f fastpathE) { - xrt := reflect.TypeOf(v) - xptr := rt2id(xrt) - if useLookupRecognizedTypes { - recognizedRtids = append(recognizedRtids, xptr) - recognizedRtidPtrs = append(recognizedRtidPtrs, rt2id(reflect.PtrTo(xrt))) - } - fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} - i++ - return - } - - fn([]interface{}(nil), (*Encoder).fastpathEncSliceIntfR, (*Decoder).fastpathDecSliceIntfR) - fn([]string(nil), (*Encoder).fastpathEncSliceStringR, (*Decoder).fastpathDecSliceStringR) - fn([]float32(nil), (*Encoder).fastpathEncSliceFloat32R, (*Decoder).fastpathDecSliceFloat32R) - fn([]float64(nil), (*Encoder).fastpathEncSliceFloat64R, (*Decoder).fastpathDecSliceFloat64R) - fn([]uint(nil), (*Encoder).fastpathEncSliceUintR, (*Decoder).fastpathDecSliceUintR) - fn([]uint16(nil), (*Encoder).fastpathEncSliceUint16R, (*Decoder).fastpathDecSliceUint16R) - fn([]uint32(nil), (*Encoder).fastpathEncSliceUint32R, (*Decoder).fastpathDecSliceUint32R) - fn([]uint64(nil), (*Encoder).fastpathEncSliceUint64R, (*Decoder).fastpathDecSliceUint64R) - fn([]uintptr(nil), (*Encoder).fastpathEncSliceUintptrR, (*Decoder).fastpathDecSliceUintptrR) - fn([]int(nil), (*Encoder).fastpathEncSliceIntR, (*Decoder).fastpathDecSliceIntR) - fn([]int8(nil), (*Encoder).fastpathEncSliceInt8R, (*Decoder).fastpathDecSliceInt8R) - fn([]int16(nil), (*Encoder).fastpathEncSliceInt16R, (*Decoder).fastpathDecSliceInt16R) - fn([]int32(nil), (*Encoder).fastpathEncSliceInt32R, (*Decoder).fastpathDecSliceInt32R) - fn([]int64(nil), (*Encoder).fastpathEncSliceInt64R, (*Decoder).fastpathDecSliceInt64R) - fn([]bool(nil), (*Encoder).fastpathEncSliceBoolR, (*Decoder).fastpathDecSliceBoolR) - - fn(map[interface{}]interface{}(nil), (*Encoder).fastpathEncMapIntfIntfR, (*Decoder).fastpathDecMapIntfIntfR) - fn(map[interface{}]string(nil), (*Encoder).fastpathEncMapIntfStringR, (*Decoder).fastpathDecMapIntfStringR) - fn(map[interface{}]uint(nil), (*Encoder).fastpathEncMapIntfUintR, (*Decoder).fastpathDecMapIntfUintR) - fn(map[interface{}]uint8(nil), (*Encoder).fastpathEncMapIntfUint8R, (*Decoder).fastpathDecMapIntfUint8R) - fn(map[interface{}]uint16(nil), (*Encoder).fastpathEncMapIntfUint16R, (*Decoder).fastpathDecMapIntfUint16R) - fn(map[interface{}]uint32(nil), (*Encoder).fastpathEncMapIntfUint32R, (*Decoder).fastpathDecMapIntfUint32R) - fn(map[interface{}]uint64(nil), (*Encoder).fastpathEncMapIntfUint64R, (*Decoder).fastpathDecMapIntfUint64R) - fn(map[interface{}]uintptr(nil), (*Encoder).fastpathEncMapIntfUintptrR, (*Decoder).fastpathDecMapIntfUintptrR) - fn(map[interface{}]int(nil), (*Encoder).fastpathEncMapIntfIntR, (*Decoder).fastpathDecMapIntfIntR) - fn(map[interface{}]int8(nil), (*Encoder).fastpathEncMapIntfInt8R, (*Decoder).fastpathDecMapIntfInt8R) - fn(map[interface{}]int16(nil), (*Encoder).fastpathEncMapIntfInt16R, (*Decoder).fastpathDecMapIntfInt16R) - fn(map[interface{}]int32(nil), (*Encoder).fastpathEncMapIntfInt32R, (*Decoder).fastpathDecMapIntfInt32R) - fn(map[interface{}]int64(nil), (*Encoder).fastpathEncMapIntfInt64R, (*Decoder).fastpathDecMapIntfInt64R) - fn(map[interface{}]float32(nil), (*Encoder).fastpathEncMapIntfFloat32R, (*Decoder).fastpathDecMapIntfFloat32R) - fn(map[interface{}]float64(nil), (*Encoder).fastpathEncMapIntfFloat64R, (*Decoder).fastpathDecMapIntfFloat64R) - fn(map[interface{}]bool(nil), (*Encoder).fastpathEncMapIntfBoolR, (*Decoder).fastpathDecMapIntfBoolR) - fn(map[string]interface{}(nil), (*Encoder).fastpathEncMapStringIntfR, (*Decoder).fastpathDecMapStringIntfR) - fn(map[string]string(nil), (*Encoder).fastpathEncMapStringStringR, (*Decoder).fastpathDecMapStringStringR) - fn(map[string]uint(nil), (*Encoder).fastpathEncMapStringUintR, (*Decoder).fastpathDecMapStringUintR) - fn(map[string]uint8(nil), (*Encoder).fastpathEncMapStringUint8R, (*Decoder).fastpathDecMapStringUint8R) - fn(map[string]uint16(nil), (*Encoder).fastpathEncMapStringUint16R, (*Decoder).fastpathDecMapStringUint16R) - fn(map[string]uint32(nil), (*Encoder).fastpathEncMapStringUint32R, (*Decoder).fastpathDecMapStringUint32R) - fn(map[string]uint64(nil), (*Encoder).fastpathEncMapStringUint64R, (*Decoder).fastpathDecMapStringUint64R) - fn(map[string]uintptr(nil), (*Encoder).fastpathEncMapStringUintptrR, (*Decoder).fastpathDecMapStringUintptrR) - fn(map[string]int(nil), (*Encoder).fastpathEncMapStringIntR, (*Decoder).fastpathDecMapStringIntR) - fn(map[string]int8(nil), (*Encoder).fastpathEncMapStringInt8R, (*Decoder).fastpathDecMapStringInt8R) - fn(map[string]int16(nil), (*Encoder).fastpathEncMapStringInt16R, (*Decoder).fastpathDecMapStringInt16R) - fn(map[string]int32(nil), (*Encoder).fastpathEncMapStringInt32R, (*Decoder).fastpathDecMapStringInt32R) - fn(map[string]int64(nil), (*Encoder).fastpathEncMapStringInt64R, (*Decoder).fastpathDecMapStringInt64R) - fn(map[string]float32(nil), (*Encoder).fastpathEncMapStringFloat32R, (*Decoder).fastpathDecMapStringFloat32R) - fn(map[string]float64(nil), (*Encoder).fastpathEncMapStringFloat64R, (*Decoder).fastpathDecMapStringFloat64R) - fn(map[string]bool(nil), (*Encoder).fastpathEncMapStringBoolR, (*Decoder).fastpathDecMapStringBoolR) - fn(map[float32]interface{}(nil), (*Encoder).fastpathEncMapFloat32IntfR, (*Decoder).fastpathDecMapFloat32IntfR) - fn(map[float32]string(nil), (*Encoder).fastpathEncMapFloat32StringR, (*Decoder).fastpathDecMapFloat32StringR) - fn(map[float32]uint(nil), (*Encoder).fastpathEncMapFloat32UintR, (*Decoder).fastpathDecMapFloat32UintR) - fn(map[float32]uint8(nil), (*Encoder).fastpathEncMapFloat32Uint8R, (*Decoder).fastpathDecMapFloat32Uint8R) - fn(map[float32]uint16(nil), (*Encoder).fastpathEncMapFloat32Uint16R, (*Decoder).fastpathDecMapFloat32Uint16R) - fn(map[float32]uint32(nil), (*Encoder).fastpathEncMapFloat32Uint32R, (*Decoder).fastpathDecMapFloat32Uint32R) - fn(map[float32]uint64(nil), (*Encoder).fastpathEncMapFloat32Uint64R, (*Decoder).fastpathDecMapFloat32Uint64R) - fn(map[float32]uintptr(nil), (*Encoder).fastpathEncMapFloat32UintptrR, (*Decoder).fastpathDecMapFloat32UintptrR) - fn(map[float32]int(nil), (*Encoder).fastpathEncMapFloat32IntR, (*Decoder).fastpathDecMapFloat32IntR) - fn(map[float32]int8(nil), (*Encoder).fastpathEncMapFloat32Int8R, (*Decoder).fastpathDecMapFloat32Int8R) - fn(map[float32]int16(nil), (*Encoder).fastpathEncMapFloat32Int16R, (*Decoder).fastpathDecMapFloat32Int16R) - fn(map[float32]int32(nil), (*Encoder).fastpathEncMapFloat32Int32R, (*Decoder).fastpathDecMapFloat32Int32R) - fn(map[float32]int64(nil), (*Encoder).fastpathEncMapFloat32Int64R, (*Decoder).fastpathDecMapFloat32Int64R) - fn(map[float32]float32(nil), (*Encoder).fastpathEncMapFloat32Float32R, (*Decoder).fastpathDecMapFloat32Float32R) - fn(map[float32]float64(nil), (*Encoder).fastpathEncMapFloat32Float64R, (*Decoder).fastpathDecMapFloat32Float64R) - fn(map[float32]bool(nil), (*Encoder).fastpathEncMapFloat32BoolR, (*Decoder).fastpathDecMapFloat32BoolR) - fn(map[float64]interface{}(nil), (*Encoder).fastpathEncMapFloat64IntfR, (*Decoder).fastpathDecMapFloat64IntfR) - fn(map[float64]string(nil), (*Encoder).fastpathEncMapFloat64StringR, (*Decoder).fastpathDecMapFloat64StringR) - fn(map[float64]uint(nil), (*Encoder).fastpathEncMapFloat64UintR, (*Decoder).fastpathDecMapFloat64UintR) - fn(map[float64]uint8(nil), (*Encoder).fastpathEncMapFloat64Uint8R, (*Decoder).fastpathDecMapFloat64Uint8R) - fn(map[float64]uint16(nil), (*Encoder).fastpathEncMapFloat64Uint16R, (*Decoder).fastpathDecMapFloat64Uint16R) - fn(map[float64]uint32(nil), (*Encoder).fastpathEncMapFloat64Uint32R, (*Decoder).fastpathDecMapFloat64Uint32R) - fn(map[float64]uint64(nil), (*Encoder).fastpathEncMapFloat64Uint64R, (*Decoder).fastpathDecMapFloat64Uint64R) - fn(map[float64]uintptr(nil), (*Encoder).fastpathEncMapFloat64UintptrR, (*Decoder).fastpathDecMapFloat64UintptrR) - fn(map[float64]int(nil), (*Encoder).fastpathEncMapFloat64IntR, (*Decoder).fastpathDecMapFloat64IntR) - fn(map[float64]int8(nil), (*Encoder).fastpathEncMapFloat64Int8R, (*Decoder).fastpathDecMapFloat64Int8R) - fn(map[float64]int16(nil), (*Encoder).fastpathEncMapFloat64Int16R, (*Decoder).fastpathDecMapFloat64Int16R) - fn(map[float64]int32(nil), (*Encoder).fastpathEncMapFloat64Int32R, (*Decoder).fastpathDecMapFloat64Int32R) - fn(map[float64]int64(nil), (*Encoder).fastpathEncMapFloat64Int64R, (*Decoder).fastpathDecMapFloat64Int64R) - fn(map[float64]float32(nil), (*Encoder).fastpathEncMapFloat64Float32R, (*Decoder).fastpathDecMapFloat64Float32R) - fn(map[float64]float64(nil), (*Encoder).fastpathEncMapFloat64Float64R, (*Decoder).fastpathDecMapFloat64Float64R) - fn(map[float64]bool(nil), (*Encoder).fastpathEncMapFloat64BoolR, (*Decoder).fastpathDecMapFloat64BoolR) - fn(map[uint]interface{}(nil), (*Encoder).fastpathEncMapUintIntfR, (*Decoder).fastpathDecMapUintIntfR) - fn(map[uint]string(nil), (*Encoder).fastpathEncMapUintStringR, (*Decoder).fastpathDecMapUintStringR) - fn(map[uint]uint(nil), (*Encoder).fastpathEncMapUintUintR, (*Decoder).fastpathDecMapUintUintR) - fn(map[uint]uint8(nil), (*Encoder).fastpathEncMapUintUint8R, (*Decoder).fastpathDecMapUintUint8R) - fn(map[uint]uint16(nil), (*Encoder).fastpathEncMapUintUint16R, (*Decoder).fastpathDecMapUintUint16R) - fn(map[uint]uint32(nil), (*Encoder).fastpathEncMapUintUint32R, (*Decoder).fastpathDecMapUintUint32R) - fn(map[uint]uint64(nil), (*Encoder).fastpathEncMapUintUint64R, (*Decoder).fastpathDecMapUintUint64R) - fn(map[uint]uintptr(nil), (*Encoder).fastpathEncMapUintUintptrR, (*Decoder).fastpathDecMapUintUintptrR) - fn(map[uint]int(nil), (*Encoder).fastpathEncMapUintIntR, (*Decoder).fastpathDecMapUintIntR) - fn(map[uint]int8(nil), (*Encoder).fastpathEncMapUintInt8R, (*Decoder).fastpathDecMapUintInt8R) - fn(map[uint]int16(nil), (*Encoder).fastpathEncMapUintInt16R, (*Decoder).fastpathDecMapUintInt16R) - fn(map[uint]int32(nil), (*Encoder).fastpathEncMapUintInt32R, (*Decoder).fastpathDecMapUintInt32R) - fn(map[uint]int64(nil), (*Encoder).fastpathEncMapUintInt64R, (*Decoder).fastpathDecMapUintInt64R) - fn(map[uint]float32(nil), (*Encoder).fastpathEncMapUintFloat32R, (*Decoder).fastpathDecMapUintFloat32R) - fn(map[uint]float64(nil), (*Encoder).fastpathEncMapUintFloat64R, (*Decoder).fastpathDecMapUintFloat64R) - fn(map[uint]bool(nil), (*Encoder).fastpathEncMapUintBoolR, (*Decoder).fastpathDecMapUintBoolR) - fn(map[uint8]interface{}(nil), (*Encoder).fastpathEncMapUint8IntfR, (*Decoder).fastpathDecMapUint8IntfR) - fn(map[uint8]string(nil), (*Encoder).fastpathEncMapUint8StringR, (*Decoder).fastpathDecMapUint8StringR) - fn(map[uint8]uint(nil), (*Encoder).fastpathEncMapUint8UintR, (*Decoder).fastpathDecMapUint8UintR) - fn(map[uint8]uint8(nil), (*Encoder).fastpathEncMapUint8Uint8R, (*Decoder).fastpathDecMapUint8Uint8R) - fn(map[uint8]uint16(nil), (*Encoder).fastpathEncMapUint8Uint16R, (*Decoder).fastpathDecMapUint8Uint16R) - fn(map[uint8]uint32(nil), (*Encoder).fastpathEncMapUint8Uint32R, (*Decoder).fastpathDecMapUint8Uint32R) - fn(map[uint8]uint64(nil), (*Encoder).fastpathEncMapUint8Uint64R, (*Decoder).fastpathDecMapUint8Uint64R) - fn(map[uint8]uintptr(nil), (*Encoder).fastpathEncMapUint8UintptrR, (*Decoder).fastpathDecMapUint8UintptrR) - fn(map[uint8]int(nil), (*Encoder).fastpathEncMapUint8IntR, (*Decoder).fastpathDecMapUint8IntR) - fn(map[uint8]int8(nil), (*Encoder).fastpathEncMapUint8Int8R, (*Decoder).fastpathDecMapUint8Int8R) - fn(map[uint8]int16(nil), (*Encoder).fastpathEncMapUint8Int16R, (*Decoder).fastpathDecMapUint8Int16R) - fn(map[uint8]int32(nil), (*Encoder).fastpathEncMapUint8Int32R, (*Decoder).fastpathDecMapUint8Int32R) - fn(map[uint8]int64(nil), (*Encoder).fastpathEncMapUint8Int64R, (*Decoder).fastpathDecMapUint8Int64R) - fn(map[uint8]float32(nil), (*Encoder).fastpathEncMapUint8Float32R, (*Decoder).fastpathDecMapUint8Float32R) - fn(map[uint8]float64(nil), (*Encoder).fastpathEncMapUint8Float64R, (*Decoder).fastpathDecMapUint8Float64R) - fn(map[uint8]bool(nil), (*Encoder).fastpathEncMapUint8BoolR, (*Decoder).fastpathDecMapUint8BoolR) - fn(map[uint16]interface{}(nil), (*Encoder).fastpathEncMapUint16IntfR, (*Decoder).fastpathDecMapUint16IntfR) - fn(map[uint16]string(nil), (*Encoder).fastpathEncMapUint16StringR, (*Decoder).fastpathDecMapUint16StringR) - fn(map[uint16]uint(nil), (*Encoder).fastpathEncMapUint16UintR, (*Decoder).fastpathDecMapUint16UintR) - fn(map[uint16]uint8(nil), (*Encoder).fastpathEncMapUint16Uint8R, (*Decoder).fastpathDecMapUint16Uint8R) - fn(map[uint16]uint16(nil), (*Encoder).fastpathEncMapUint16Uint16R, (*Decoder).fastpathDecMapUint16Uint16R) - fn(map[uint16]uint32(nil), (*Encoder).fastpathEncMapUint16Uint32R, (*Decoder).fastpathDecMapUint16Uint32R) - fn(map[uint16]uint64(nil), (*Encoder).fastpathEncMapUint16Uint64R, (*Decoder).fastpathDecMapUint16Uint64R) - fn(map[uint16]uintptr(nil), (*Encoder).fastpathEncMapUint16UintptrR, (*Decoder).fastpathDecMapUint16UintptrR) - fn(map[uint16]int(nil), (*Encoder).fastpathEncMapUint16IntR, (*Decoder).fastpathDecMapUint16IntR) - fn(map[uint16]int8(nil), (*Encoder).fastpathEncMapUint16Int8R, (*Decoder).fastpathDecMapUint16Int8R) - fn(map[uint16]int16(nil), (*Encoder).fastpathEncMapUint16Int16R, (*Decoder).fastpathDecMapUint16Int16R) - fn(map[uint16]int32(nil), (*Encoder).fastpathEncMapUint16Int32R, (*Decoder).fastpathDecMapUint16Int32R) - fn(map[uint16]int64(nil), (*Encoder).fastpathEncMapUint16Int64R, (*Decoder).fastpathDecMapUint16Int64R) - fn(map[uint16]float32(nil), (*Encoder).fastpathEncMapUint16Float32R, (*Decoder).fastpathDecMapUint16Float32R) - fn(map[uint16]float64(nil), (*Encoder).fastpathEncMapUint16Float64R, (*Decoder).fastpathDecMapUint16Float64R) - fn(map[uint16]bool(nil), (*Encoder).fastpathEncMapUint16BoolR, (*Decoder).fastpathDecMapUint16BoolR) - fn(map[uint32]interface{}(nil), (*Encoder).fastpathEncMapUint32IntfR, (*Decoder).fastpathDecMapUint32IntfR) - fn(map[uint32]string(nil), (*Encoder).fastpathEncMapUint32StringR, (*Decoder).fastpathDecMapUint32StringR) - fn(map[uint32]uint(nil), (*Encoder).fastpathEncMapUint32UintR, (*Decoder).fastpathDecMapUint32UintR) - fn(map[uint32]uint8(nil), (*Encoder).fastpathEncMapUint32Uint8R, (*Decoder).fastpathDecMapUint32Uint8R) - fn(map[uint32]uint16(nil), (*Encoder).fastpathEncMapUint32Uint16R, (*Decoder).fastpathDecMapUint32Uint16R) - fn(map[uint32]uint32(nil), (*Encoder).fastpathEncMapUint32Uint32R, (*Decoder).fastpathDecMapUint32Uint32R) - fn(map[uint32]uint64(nil), (*Encoder).fastpathEncMapUint32Uint64R, (*Decoder).fastpathDecMapUint32Uint64R) - fn(map[uint32]uintptr(nil), (*Encoder).fastpathEncMapUint32UintptrR, (*Decoder).fastpathDecMapUint32UintptrR) - fn(map[uint32]int(nil), (*Encoder).fastpathEncMapUint32IntR, (*Decoder).fastpathDecMapUint32IntR) - fn(map[uint32]int8(nil), (*Encoder).fastpathEncMapUint32Int8R, (*Decoder).fastpathDecMapUint32Int8R) - fn(map[uint32]int16(nil), (*Encoder).fastpathEncMapUint32Int16R, (*Decoder).fastpathDecMapUint32Int16R) - fn(map[uint32]int32(nil), (*Encoder).fastpathEncMapUint32Int32R, (*Decoder).fastpathDecMapUint32Int32R) - fn(map[uint32]int64(nil), (*Encoder).fastpathEncMapUint32Int64R, (*Decoder).fastpathDecMapUint32Int64R) - fn(map[uint32]float32(nil), (*Encoder).fastpathEncMapUint32Float32R, (*Decoder).fastpathDecMapUint32Float32R) - fn(map[uint32]float64(nil), (*Encoder).fastpathEncMapUint32Float64R, (*Decoder).fastpathDecMapUint32Float64R) - fn(map[uint32]bool(nil), (*Encoder).fastpathEncMapUint32BoolR, (*Decoder).fastpathDecMapUint32BoolR) - fn(map[uint64]interface{}(nil), (*Encoder).fastpathEncMapUint64IntfR, (*Decoder).fastpathDecMapUint64IntfR) - fn(map[uint64]string(nil), (*Encoder).fastpathEncMapUint64StringR, (*Decoder).fastpathDecMapUint64StringR) - fn(map[uint64]uint(nil), (*Encoder).fastpathEncMapUint64UintR, (*Decoder).fastpathDecMapUint64UintR) - fn(map[uint64]uint8(nil), (*Encoder).fastpathEncMapUint64Uint8R, (*Decoder).fastpathDecMapUint64Uint8R) - fn(map[uint64]uint16(nil), (*Encoder).fastpathEncMapUint64Uint16R, (*Decoder).fastpathDecMapUint64Uint16R) - fn(map[uint64]uint32(nil), (*Encoder).fastpathEncMapUint64Uint32R, (*Decoder).fastpathDecMapUint64Uint32R) - fn(map[uint64]uint64(nil), (*Encoder).fastpathEncMapUint64Uint64R, (*Decoder).fastpathDecMapUint64Uint64R) - fn(map[uint64]uintptr(nil), (*Encoder).fastpathEncMapUint64UintptrR, (*Decoder).fastpathDecMapUint64UintptrR) - fn(map[uint64]int(nil), (*Encoder).fastpathEncMapUint64IntR, (*Decoder).fastpathDecMapUint64IntR) - fn(map[uint64]int8(nil), (*Encoder).fastpathEncMapUint64Int8R, (*Decoder).fastpathDecMapUint64Int8R) - fn(map[uint64]int16(nil), (*Encoder).fastpathEncMapUint64Int16R, (*Decoder).fastpathDecMapUint64Int16R) - fn(map[uint64]int32(nil), (*Encoder).fastpathEncMapUint64Int32R, (*Decoder).fastpathDecMapUint64Int32R) - fn(map[uint64]int64(nil), (*Encoder).fastpathEncMapUint64Int64R, (*Decoder).fastpathDecMapUint64Int64R) - fn(map[uint64]float32(nil), (*Encoder).fastpathEncMapUint64Float32R, (*Decoder).fastpathDecMapUint64Float32R) - fn(map[uint64]float64(nil), (*Encoder).fastpathEncMapUint64Float64R, (*Decoder).fastpathDecMapUint64Float64R) - fn(map[uint64]bool(nil), (*Encoder).fastpathEncMapUint64BoolR, (*Decoder).fastpathDecMapUint64BoolR) - fn(map[uintptr]interface{}(nil), (*Encoder).fastpathEncMapUintptrIntfR, (*Decoder).fastpathDecMapUintptrIntfR) - fn(map[uintptr]string(nil), (*Encoder).fastpathEncMapUintptrStringR, (*Decoder).fastpathDecMapUintptrStringR) - fn(map[uintptr]uint(nil), (*Encoder).fastpathEncMapUintptrUintR, (*Decoder).fastpathDecMapUintptrUintR) - fn(map[uintptr]uint8(nil), (*Encoder).fastpathEncMapUintptrUint8R, (*Decoder).fastpathDecMapUintptrUint8R) - fn(map[uintptr]uint16(nil), (*Encoder).fastpathEncMapUintptrUint16R, (*Decoder).fastpathDecMapUintptrUint16R) - fn(map[uintptr]uint32(nil), (*Encoder).fastpathEncMapUintptrUint32R, (*Decoder).fastpathDecMapUintptrUint32R) - fn(map[uintptr]uint64(nil), (*Encoder).fastpathEncMapUintptrUint64R, (*Decoder).fastpathDecMapUintptrUint64R) - fn(map[uintptr]uintptr(nil), (*Encoder).fastpathEncMapUintptrUintptrR, (*Decoder).fastpathDecMapUintptrUintptrR) - fn(map[uintptr]int(nil), (*Encoder).fastpathEncMapUintptrIntR, (*Decoder).fastpathDecMapUintptrIntR) - fn(map[uintptr]int8(nil), (*Encoder).fastpathEncMapUintptrInt8R, (*Decoder).fastpathDecMapUintptrInt8R) - fn(map[uintptr]int16(nil), (*Encoder).fastpathEncMapUintptrInt16R, (*Decoder).fastpathDecMapUintptrInt16R) - fn(map[uintptr]int32(nil), (*Encoder).fastpathEncMapUintptrInt32R, (*Decoder).fastpathDecMapUintptrInt32R) - fn(map[uintptr]int64(nil), (*Encoder).fastpathEncMapUintptrInt64R, (*Decoder).fastpathDecMapUintptrInt64R) - fn(map[uintptr]float32(nil), (*Encoder).fastpathEncMapUintptrFloat32R, (*Decoder).fastpathDecMapUintptrFloat32R) - fn(map[uintptr]float64(nil), (*Encoder).fastpathEncMapUintptrFloat64R, (*Decoder).fastpathDecMapUintptrFloat64R) - fn(map[uintptr]bool(nil), (*Encoder).fastpathEncMapUintptrBoolR, (*Decoder).fastpathDecMapUintptrBoolR) - fn(map[int]interface{}(nil), (*Encoder).fastpathEncMapIntIntfR, (*Decoder).fastpathDecMapIntIntfR) - fn(map[int]string(nil), (*Encoder).fastpathEncMapIntStringR, (*Decoder).fastpathDecMapIntStringR) - fn(map[int]uint(nil), (*Encoder).fastpathEncMapIntUintR, (*Decoder).fastpathDecMapIntUintR) - fn(map[int]uint8(nil), (*Encoder).fastpathEncMapIntUint8R, (*Decoder).fastpathDecMapIntUint8R) - fn(map[int]uint16(nil), (*Encoder).fastpathEncMapIntUint16R, (*Decoder).fastpathDecMapIntUint16R) - fn(map[int]uint32(nil), (*Encoder).fastpathEncMapIntUint32R, (*Decoder).fastpathDecMapIntUint32R) - fn(map[int]uint64(nil), (*Encoder).fastpathEncMapIntUint64R, (*Decoder).fastpathDecMapIntUint64R) - fn(map[int]uintptr(nil), (*Encoder).fastpathEncMapIntUintptrR, (*Decoder).fastpathDecMapIntUintptrR) - fn(map[int]int(nil), (*Encoder).fastpathEncMapIntIntR, (*Decoder).fastpathDecMapIntIntR) - fn(map[int]int8(nil), (*Encoder).fastpathEncMapIntInt8R, (*Decoder).fastpathDecMapIntInt8R) - fn(map[int]int16(nil), (*Encoder).fastpathEncMapIntInt16R, (*Decoder).fastpathDecMapIntInt16R) - fn(map[int]int32(nil), (*Encoder).fastpathEncMapIntInt32R, (*Decoder).fastpathDecMapIntInt32R) - fn(map[int]int64(nil), (*Encoder).fastpathEncMapIntInt64R, (*Decoder).fastpathDecMapIntInt64R) - fn(map[int]float32(nil), (*Encoder).fastpathEncMapIntFloat32R, (*Decoder).fastpathDecMapIntFloat32R) - fn(map[int]float64(nil), (*Encoder).fastpathEncMapIntFloat64R, (*Decoder).fastpathDecMapIntFloat64R) - fn(map[int]bool(nil), (*Encoder).fastpathEncMapIntBoolR, (*Decoder).fastpathDecMapIntBoolR) - fn(map[int8]interface{}(nil), (*Encoder).fastpathEncMapInt8IntfR, (*Decoder).fastpathDecMapInt8IntfR) - fn(map[int8]string(nil), (*Encoder).fastpathEncMapInt8StringR, (*Decoder).fastpathDecMapInt8StringR) - fn(map[int8]uint(nil), (*Encoder).fastpathEncMapInt8UintR, (*Decoder).fastpathDecMapInt8UintR) - fn(map[int8]uint8(nil), (*Encoder).fastpathEncMapInt8Uint8R, (*Decoder).fastpathDecMapInt8Uint8R) - fn(map[int8]uint16(nil), (*Encoder).fastpathEncMapInt8Uint16R, (*Decoder).fastpathDecMapInt8Uint16R) - fn(map[int8]uint32(nil), (*Encoder).fastpathEncMapInt8Uint32R, (*Decoder).fastpathDecMapInt8Uint32R) - fn(map[int8]uint64(nil), (*Encoder).fastpathEncMapInt8Uint64R, (*Decoder).fastpathDecMapInt8Uint64R) - fn(map[int8]uintptr(nil), (*Encoder).fastpathEncMapInt8UintptrR, (*Decoder).fastpathDecMapInt8UintptrR) - fn(map[int8]int(nil), (*Encoder).fastpathEncMapInt8IntR, (*Decoder).fastpathDecMapInt8IntR) - fn(map[int8]int8(nil), (*Encoder).fastpathEncMapInt8Int8R, (*Decoder).fastpathDecMapInt8Int8R) - fn(map[int8]int16(nil), (*Encoder).fastpathEncMapInt8Int16R, (*Decoder).fastpathDecMapInt8Int16R) - fn(map[int8]int32(nil), (*Encoder).fastpathEncMapInt8Int32R, (*Decoder).fastpathDecMapInt8Int32R) - fn(map[int8]int64(nil), (*Encoder).fastpathEncMapInt8Int64R, (*Decoder).fastpathDecMapInt8Int64R) - fn(map[int8]float32(nil), (*Encoder).fastpathEncMapInt8Float32R, (*Decoder).fastpathDecMapInt8Float32R) - fn(map[int8]float64(nil), (*Encoder).fastpathEncMapInt8Float64R, (*Decoder).fastpathDecMapInt8Float64R) - fn(map[int8]bool(nil), (*Encoder).fastpathEncMapInt8BoolR, (*Decoder).fastpathDecMapInt8BoolR) - fn(map[int16]interface{}(nil), (*Encoder).fastpathEncMapInt16IntfR, (*Decoder).fastpathDecMapInt16IntfR) - fn(map[int16]string(nil), (*Encoder).fastpathEncMapInt16StringR, (*Decoder).fastpathDecMapInt16StringR) - fn(map[int16]uint(nil), (*Encoder).fastpathEncMapInt16UintR, (*Decoder).fastpathDecMapInt16UintR) - fn(map[int16]uint8(nil), (*Encoder).fastpathEncMapInt16Uint8R, (*Decoder).fastpathDecMapInt16Uint8R) - fn(map[int16]uint16(nil), (*Encoder).fastpathEncMapInt16Uint16R, (*Decoder).fastpathDecMapInt16Uint16R) - fn(map[int16]uint32(nil), (*Encoder).fastpathEncMapInt16Uint32R, (*Decoder).fastpathDecMapInt16Uint32R) - fn(map[int16]uint64(nil), (*Encoder).fastpathEncMapInt16Uint64R, (*Decoder).fastpathDecMapInt16Uint64R) - fn(map[int16]uintptr(nil), (*Encoder).fastpathEncMapInt16UintptrR, (*Decoder).fastpathDecMapInt16UintptrR) - fn(map[int16]int(nil), (*Encoder).fastpathEncMapInt16IntR, (*Decoder).fastpathDecMapInt16IntR) - fn(map[int16]int8(nil), (*Encoder).fastpathEncMapInt16Int8R, (*Decoder).fastpathDecMapInt16Int8R) - fn(map[int16]int16(nil), (*Encoder).fastpathEncMapInt16Int16R, (*Decoder).fastpathDecMapInt16Int16R) - fn(map[int16]int32(nil), (*Encoder).fastpathEncMapInt16Int32R, (*Decoder).fastpathDecMapInt16Int32R) - fn(map[int16]int64(nil), (*Encoder).fastpathEncMapInt16Int64R, (*Decoder).fastpathDecMapInt16Int64R) - fn(map[int16]float32(nil), (*Encoder).fastpathEncMapInt16Float32R, (*Decoder).fastpathDecMapInt16Float32R) - fn(map[int16]float64(nil), (*Encoder).fastpathEncMapInt16Float64R, (*Decoder).fastpathDecMapInt16Float64R) - fn(map[int16]bool(nil), (*Encoder).fastpathEncMapInt16BoolR, (*Decoder).fastpathDecMapInt16BoolR) - fn(map[int32]interface{}(nil), (*Encoder).fastpathEncMapInt32IntfR, (*Decoder).fastpathDecMapInt32IntfR) - fn(map[int32]string(nil), (*Encoder).fastpathEncMapInt32StringR, (*Decoder).fastpathDecMapInt32StringR) - fn(map[int32]uint(nil), (*Encoder).fastpathEncMapInt32UintR, (*Decoder).fastpathDecMapInt32UintR) - fn(map[int32]uint8(nil), (*Encoder).fastpathEncMapInt32Uint8R, (*Decoder).fastpathDecMapInt32Uint8R) - fn(map[int32]uint16(nil), (*Encoder).fastpathEncMapInt32Uint16R, (*Decoder).fastpathDecMapInt32Uint16R) - fn(map[int32]uint32(nil), (*Encoder).fastpathEncMapInt32Uint32R, (*Decoder).fastpathDecMapInt32Uint32R) - fn(map[int32]uint64(nil), (*Encoder).fastpathEncMapInt32Uint64R, (*Decoder).fastpathDecMapInt32Uint64R) - fn(map[int32]uintptr(nil), (*Encoder).fastpathEncMapInt32UintptrR, (*Decoder).fastpathDecMapInt32UintptrR) - fn(map[int32]int(nil), (*Encoder).fastpathEncMapInt32IntR, (*Decoder).fastpathDecMapInt32IntR) - fn(map[int32]int8(nil), (*Encoder).fastpathEncMapInt32Int8R, (*Decoder).fastpathDecMapInt32Int8R) - fn(map[int32]int16(nil), (*Encoder).fastpathEncMapInt32Int16R, (*Decoder).fastpathDecMapInt32Int16R) - fn(map[int32]int32(nil), (*Encoder).fastpathEncMapInt32Int32R, (*Decoder).fastpathDecMapInt32Int32R) - fn(map[int32]int64(nil), (*Encoder).fastpathEncMapInt32Int64R, (*Decoder).fastpathDecMapInt32Int64R) - fn(map[int32]float32(nil), (*Encoder).fastpathEncMapInt32Float32R, (*Decoder).fastpathDecMapInt32Float32R) - fn(map[int32]float64(nil), (*Encoder).fastpathEncMapInt32Float64R, (*Decoder).fastpathDecMapInt32Float64R) - fn(map[int32]bool(nil), (*Encoder).fastpathEncMapInt32BoolR, (*Decoder).fastpathDecMapInt32BoolR) - fn(map[int64]interface{}(nil), (*Encoder).fastpathEncMapInt64IntfR, (*Decoder).fastpathDecMapInt64IntfR) - fn(map[int64]string(nil), (*Encoder).fastpathEncMapInt64StringR, (*Decoder).fastpathDecMapInt64StringR) - fn(map[int64]uint(nil), (*Encoder).fastpathEncMapInt64UintR, (*Decoder).fastpathDecMapInt64UintR) - fn(map[int64]uint8(nil), (*Encoder).fastpathEncMapInt64Uint8R, (*Decoder).fastpathDecMapInt64Uint8R) - fn(map[int64]uint16(nil), (*Encoder).fastpathEncMapInt64Uint16R, (*Decoder).fastpathDecMapInt64Uint16R) - fn(map[int64]uint32(nil), (*Encoder).fastpathEncMapInt64Uint32R, (*Decoder).fastpathDecMapInt64Uint32R) - fn(map[int64]uint64(nil), (*Encoder).fastpathEncMapInt64Uint64R, (*Decoder).fastpathDecMapInt64Uint64R) - fn(map[int64]uintptr(nil), (*Encoder).fastpathEncMapInt64UintptrR, (*Decoder).fastpathDecMapInt64UintptrR) - fn(map[int64]int(nil), (*Encoder).fastpathEncMapInt64IntR, (*Decoder).fastpathDecMapInt64IntR) - fn(map[int64]int8(nil), (*Encoder).fastpathEncMapInt64Int8R, (*Decoder).fastpathDecMapInt64Int8R) - fn(map[int64]int16(nil), (*Encoder).fastpathEncMapInt64Int16R, (*Decoder).fastpathDecMapInt64Int16R) - fn(map[int64]int32(nil), (*Encoder).fastpathEncMapInt64Int32R, (*Decoder).fastpathDecMapInt64Int32R) - fn(map[int64]int64(nil), (*Encoder).fastpathEncMapInt64Int64R, (*Decoder).fastpathDecMapInt64Int64R) - fn(map[int64]float32(nil), (*Encoder).fastpathEncMapInt64Float32R, (*Decoder).fastpathDecMapInt64Float32R) - fn(map[int64]float64(nil), (*Encoder).fastpathEncMapInt64Float64R, (*Decoder).fastpathDecMapInt64Float64R) - fn(map[int64]bool(nil), (*Encoder).fastpathEncMapInt64BoolR, (*Decoder).fastpathDecMapInt64BoolR) - fn(map[bool]interface{}(nil), (*Encoder).fastpathEncMapBoolIntfR, (*Decoder).fastpathDecMapBoolIntfR) - fn(map[bool]string(nil), (*Encoder).fastpathEncMapBoolStringR, (*Decoder).fastpathDecMapBoolStringR) - fn(map[bool]uint(nil), (*Encoder).fastpathEncMapBoolUintR, (*Decoder).fastpathDecMapBoolUintR) - fn(map[bool]uint8(nil), (*Encoder).fastpathEncMapBoolUint8R, (*Decoder).fastpathDecMapBoolUint8R) - fn(map[bool]uint16(nil), (*Encoder).fastpathEncMapBoolUint16R, (*Decoder).fastpathDecMapBoolUint16R) - fn(map[bool]uint32(nil), (*Encoder).fastpathEncMapBoolUint32R, (*Decoder).fastpathDecMapBoolUint32R) - fn(map[bool]uint64(nil), (*Encoder).fastpathEncMapBoolUint64R, (*Decoder).fastpathDecMapBoolUint64R) - fn(map[bool]uintptr(nil), (*Encoder).fastpathEncMapBoolUintptrR, (*Decoder).fastpathDecMapBoolUintptrR) - fn(map[bool]int(nil), (*Encoder).fastpathEncMapBoolIntR, (*Decoder).fastpathDecMapBoolIntR) - fn(map[bool]int8(nil), (*Encoder).fastpathEncMapBoolInt8R, (*Decoder).fastpathDecMapBoolInt8R) - fn(map[bool]int16(nil), (*Encoder).fastpathEncMapBoolInt16R, (*Decoder).fastpathDecMapBoolInt16R) - fn(map[bool]int32(nil), (*Encoder).fastpathEncMapBoolInt32R, (*Decoder).fastpathDecMapBoolInt32R) - fn(map[bool]int64(nil), (*Encoder).fastpathEncMapBoolInt64R, (*Decoder).fastpathDecMapBoolInt64R) - fn(map[bool]float32(nil), (*Encoder).fastpathEncMapBoolFloat32R, (*Decoder).fastpathDecMapBoolFloat32R) - fn(map[bool]float64(nil), (*Encoder).fastpathEncMapBoolFloat64R, (*Decoder).fastpathDecMapBoolFloat64R) - fn(map[bool]bool(nil), (*Encoder).fastpathEncMapBoolBoolR, (*Decoder).fastpathDecMapBoolBoolR) - - sort.Sort(fastpathAslice(fastpathAV[:])) -} - -// -- encode - -// -- -- fast path type switch -func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { - switch v := iv.(type) { - - case []interface{}: - fastpathTV.EncSliceIntfV(v, e) - case *[]interface{}: - fastpathTV.EncSliceIntfV(*v, e) - - case map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(v, e) - case *map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(*v, e) - - case map[interface{}]string: - fastpathTV.EncMapIntfStringV(v, e) - case *map[interface{}]string: - fastpathTV.EncMapIntfStringV(*v, e) - - case map[interface{}]uint: - fastpathTV.EncMapIntfUintV(v, e) - case *map[interface{}]uint: - fastpathTV.EncMapIntfUintV(*v, e) - - case map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(v, e) - case *map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(*v, e) - - case map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(v, e) - case *map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(*v, e) - - case map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(v, e) - case *map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(*v, e) - - case map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(v, e) - case *map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(*v, e) - - case map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(v, e) - case *map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(*v, e) - - case map[interface{}]int: - fastpathTV.EncMapIntfIntV(v, e) - case *map[interface{}]int: - fastpathTV.EncMapIntfIntV(*v, e) - - case map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(v, e) - case *map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(*v, e) - - case map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(v, e) - case *map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(*v, e) - - case map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(v, e) - case *map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(*v, e) - - case map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(v, e) - case *map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(*v, e) - - case map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(v, e) - case *map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(*v, e) - - case map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(v, e) - case *map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(*v, e) - - case map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(v, e) - case *map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(*v, e) - - case []string: - fastpathTV.EncSliceStringV(v, e) - case *[]string: - fastpathTV.EncSliceStringV(*v, e) - - case map[string]interface{}: - fastpathTV.EncMapStringIntfV(v, e) - case *map[string]interface{}: - fastpathTV.EncMapStringIntfV(*v, e) - - case map[string]string: - fastpathTV.EncMapStringStringV(v, e) - case *map[string]string: - fastpathTV.EncMapStringStringV(*v, e) - - case map[string]uint: - fastpathTV.EncMapStringUintV(v, e) - case *map[string]uint: - fastpathTV.EncMapStringUintV(*v, e) - - case map[string]uint8: - fastpathTV.EncMapStringUint8V(v, e) - case *map[string]uint8: - fastpathTV.EncMapStringUint8V(*v, e) - - case map[string]uint16: - fastpathTV.EncMapStringUint16V(v, e) - case *map[string]uint16: - fastpathTV.EncMapStringUint16V(*v, e) - - case map[string]uint32: - fastpathTV.EncMapStringUint32V(v, e) - case *map[string]uint32: - fastpathTV.EncMapStringUint32V(*v, e) - - case map[string]uint64: - fastpathTV.EncMapStringUint64V(v, e) - case *map[string]uint64: - fastpathTV.EncMapStringUint64V(*v, e) - - case map[string]uintptr: - fastpathTV.EncMapStringUintptrV(v, e) - case *map[string]uintptr: - fastpathTV.EncMapStringUintptrV(*v, e) - - case map[string]int: - fastpathTV.EncMapStringIntV(v, e) - case *map[string]int: - fastpathTV.EncMapStringIntV(*v, e) - - case map[string]int8: - fastpathTV.EncMapStringInt8V(v, e) - case *map[string]int8: - fastpathTV.EncMapStringInt8V(*v, e) - - case map[string]int16: - fastpathTV.EncMapStringInt16V(v, e) - case *map[string]int16: - fastpathTV.EncMapStringInt16V(*v, e) - - case map[string]int32: - fastpathTV.EncMapStringInt32V(v, e) - case *map[string]int32: - fastpathTV.EncMapStringInt32V(*v, e) - - case map[string]int64: - fastpathTV.EncMapStringInt64V(v, e) - case *map[string]int64: - fastpathTV.EncMapStringInt64V(*v, e) - - case map[string]float32: - fastpathTV.EncMapStringFloat32V(v, e) - case *map[string]float32: - fastpathTV.EncMapStringFloat32V(*v, e) - - case map[string]float64: - fastpathTV.EncMapStringFloat64V(v, e) - case *map[string]float64: - fastpathTV.EncMapStringFloat64V(*v, e) - - case map[string]bool: - fastpathTV.EncMapStringBoolV(v, e) - case *map[string]bool: - fastpathTV.EncMapStringBoolV(*v, e) - - case []float32: - fastpathTV.EncSliceFloat32V(v, e) - case *[]float32: - fastpathTV.EncSliceFloat32V(*v, e) - - case map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(v, e) - case *map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(*v, e) - - case map[float32]string: - fastpathTV.EncMapFloat32StringV(v, e) - case *map[float32]string: - fastpathTV.EncMapFloat32StringV(*v, e) - - case map[float32]uint: - fastpathTV.EncMapFloat32UintV(v, e) - case *map[float32]uint: - fastpathTV.EncMapFloat32UintV(*v, e) - - case map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(v, e) - case *map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(*v, e) - - case map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(v, e) - case *map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(*v, e) - - case map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(v, e) - case *map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(*v, e) - - case map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(v, e) - case *map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(*v, e) - - case map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(v, e) - case *map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(*v, e) - - case map[float32]int: - fastpathTV.EncMapFloat32IntV(v, e) - case *map[float32]int: - fastpathTV.EncMapFloat32IntV(*v, e) - - case map[float32]int8: - fastpathTV.EncMapFloat32Int8V(v, e) - case *map[float32]int8: - fastpathTV.EncMapFloat32Int8V(*v, e) - - case map[float32]int16: - fastpathTV.EncMapFloat32Int16V(v, e) - case *map[float32]int16: - fastpathTV.EncMapFloat32Int16V(*v, e) - - case map[float32]int32: - fastpathTV.EncMapFloat32Int32V(v, e) - case *map[float32]int32: - fastpathTV.EncMapFloat32Int32V(*v, e) - - case map[float32]int64: - fastpathTV.EncMapFloat32Int64V(v, e) - case *map[float32]int64: - fastpathTV.EncMapFloat32Int64V(*v, e) - - case map[float32]float32: - fastpathTV.EncMapFloat32Float32V(v, e) - case *map[float32]float32: - fastpathTV.EncMapFloat32Float32V(*v, e) - - case map[float32]float64: - fastpathTV.EncMapFloat32Float64V(v, e) - case *map[float32]float64: - fastpathTV.EncMapFloat32Float64V(*v, e) - - case map[float32]bool: - fastpathTV.EncMapFloat32BoolV(v, e) - case *map[float32]bool: - fastpathTV.EncMapFloat32BoolV(*v, e) - - case []float64: - fastpathTV.EncSliceFloat64V(v, e) - case *[]float64: - fastpathTV.EncSliceFloat64V(*v, e) - - case map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(v, e) - case *map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(*v, e) - - case map[float64]string: - fastpathTV.EncMapFloat64StringV(v, e) - case *map[float64]string: - fastpathTV.EncMapFloat64StringV(*v, e) - - case map[float64]uint: - fastpathTV.EncMapFloat64UintV(v, e) - case *map[float64]uint: - fastpathTV.EncMapFloat64UintV(*v, e) - - case map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(v, e) - case *map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(*v, e) - - case map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(v, e) - case *map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(*v, e) - - case map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(v, e) - case *map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(*v, e) - - case map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(v, e) - case *map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(*v, e) - - case map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(v, e) - case *map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(*v, e) - - case map[float64]int: - fastpathTV.EncMapFloat64IntV(v, e) - case *map[float64]int: - fastpathTV.EncMapFloat64IntV(*v, e) - - case map[float64]int8: - fastpathTV.EncMapFloat64Int8V(v, e) - case *map[float64]int8: - fastpathTV.EncMapFloat64Int8V(*v, e) - - case map[float64]int16: - fastpathTV.EncMapFloat64Int16V(v, e) - case *map[float64]int16: - fastpathTV.EncMapFloat64Int16V(*v, e) - - case map[float64]int32: - fastpathTV.EncMapFloat64Int32V(v, e) - case *map[float64]int32: - fastpathTV.EncMapFloat64Int32V(*v, e) - - case map[float64]int64: - fastpathTV.EncMapFloat64Int64V(v, e) - case *map[float64]int64: - fastpathTV.EncMapFloat64Int64V(*v, e) - - case map[float64]float32: - fastpathTV.EncMapFloat64Float32V(v, e) - case *map[float64]float32: - fastpathTV.EncMapFloat64Float32V(*v, e) - - case map[float64]float64: - fastpathTV.EncMapFloat64Float64V(v, e) - case *map[float64]float64: - fastpathTV.EncMapFloat64Float64V(*v, e) - - case map[float64]bool: - fastpathTV.EncMapFloat64BoolV(v, e) - case *map[float64]bool: - fastpathTV.EncMapFloat64BoolV(*v, e) - - case []uint: - fastpathTV.EncSliceUintV(v, e) - case *[]uint: - fastpathTV.EncSliceUintV(*v, e) - - case map[uint]interface{}: - fastpathTV.EncMapUintIntfV(v, e) - case *map[uint]interface{}: - fastpathTV.EncMapUintIntfV(*v, e) - - case map[uint]string: - fastpathTV.EncMapUintStringV(v, e) - case *map[uint]string: - fastpathTV.EncMapUintStringV(*v, e) - - case map[uint]uint: - fastpathTV.EncMapUintUintV(v, e) - case *map[uint]uint: - fastpathTV.EncMapUintUintV(*v, e) - - case map[uint]uint8: - fastpathTV.EncMapUintUint8V(v, e) - case *map[uint]uint8: - fastpathTV.EncMapUintUint8V(*v, e) - - case map[uint]uint16: - fastpathTV.EncMapUintUint16V(v, e) - case *map[uint]uint16: - fastpathTV.EncMapUintUint16V(*v, e) - - case map[uint]uint32: - fastpathTV.EncMapUintUint32V(v, e) - case *map[uint]uint32: - fastpathTV.EncMapUintUint32V(*v, e) - - case map[uint]uint64: - fastpathTV.EncMapUintUint64V(v, e) - case *map[uint]uint64: - fastpathTV.EncMapUintUint64V(*v, e) - - case map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(v, e) - case *map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(*v, e) - - case map[uint]int: - fastpathTV.EncMapUintIntV(v, e) - case *map[uint]int: - fastpathTV.EncMapUintIntV(*v, e) - - case map[uint]int8: - fastpathTV.EncMapUintInt8V(v, e) - case *map[uint]int8: - fastpathTV.EncMapUintInt8V(*v, e) - - case map[uint]int16: - fastpathTV.EncMapUintInt16V(v, e) - case *map[uint]int16: - fastpathTV.EncMapUintInt16V(*v, e) - - case map[uint]int32: - fastpathTV.EncMapUintInt32V(v, e) - case *map[uint]int32: - fastpathTV.EncMapUintInt32V(*v, e) - - case map[uint]int64: - fastpathTV.EncMapUintInt64V(v, e) - case *map[uint]int64: - fastpathTV.EncMapUintInt64V(*v, e) - - case map[uint]float32: - fastpathTV.EncMapUintFloat32V(v, e) - case *map[uint]float32: - fastpathTV.EncMapUintFloat32V(*v, e) - - case map[uint]float64: - fastpathTV.EncMapUintFloat64V(v, e) - case *map[uint]float64: - fastpathTV.EncMapUintFloat64V(*v, e) - - case map[uint]bool: - fastpathTV.EncMapUintBoolV(v, e) - case *map[uint]bool: - fastpathTV.EncMapUintBoolV(*v, e) - - case map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(v, e) - case *map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(*v, e) - - case map[uint8]string: - fastpathTV.EncMapUint8StringV(v, e) - case *map[uint8]string: - fastpathTV.EncMapUint8StringV(*v, e) - - case map[uint8]uint: - fastpathTV.EncMapUint8UintV(v, e) - case *map[uint8]uint: - fastpathTV.EncMapUint8UintV(*v, e) - - case map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(v, e) - case *map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(*v, e) - - case map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(v, e) - case *map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(*v, e) - - case map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(v, e) - case *map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(*v, e) - - case map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(v, e) - case *map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(*v, e) - - case map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(v, e) - case *map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(*v, e) - - case map[uint8]int: - fastpathTV.EncMapUint8IntV(v, e) - case *map[uint8]int: - fastpathTV.EncMapUint8IntV(*v, e) - - case map[uint8]int8: - fastpathTV.EncMapUint8Int8V(v, e) - case *map[uint8]int8: - fastpathTV.EncMapUint8Int8V(*v, e) - - case map[uint8]int16: - fastpathTV.EncMapUint8Int16V(v, e) - case *map[uint8]int16: - fastpathTV.EncMapUint8Int16V(*v, e) - - case map[uint8]int32: - fastpathTV.EncMapUint8Int32V(v, e) - case *map[uint8]int32: - fastpathTV.EncMapUint8Int32V(*v, e) - - case map[uint8]int64: - fastpathTV.EncMapUint8Int64V(v, e) - case *map[uint8]int64: - fastpathTV.EncMapUint8Int64V(*v, e) - - case map[uint8]float32: - fastpathTV.EncMapUint8Float32V(v, e) - case *map[uint8]float32: - fastpathTV.EncMapUint8Float32V(*v, e) - - case map[uint8]float64: - fastpathTV.EncMapUint8Float64V(v, e) - case *map[uint8]float64: - fastpathTV.EncMapUint8Float64V(*v, e) - - case map[uint8]bool: - fastpathTV.EncMapUint8BoolV(v, e) - case *map[uint8]bool: - fastpathTV.EncMapUint8BoolV(*v, e) - - case []uint16: - fastpathTV.EncSliceUint16V(v, e) - case *[]uint16: - fastpathTV.EncSliceUint16V(*v, e) - - case map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(v, e) - case *map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(*v, e) - - case map[uint16]string: - fastpathTV.EncMapUint16StringV(v, e) - case *map[uint16]string: - fastpathTV.EncMapUint16StringV(*v, e) - - case map[uint16]uint: - fastpathTV.EncMapUint16UintV(v, e) - case *map[uint16]uint: - fastpathTV.EncMapUint16UintV(*v, e) - - case map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(v, e) - case *map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(*v, e) - - case map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(v, e) - case *map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(*v, e) - - case map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(v, e) - case *map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(*v, e) - - case map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(v, e) - case *map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(*v, e) - - case map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(v, e) - case *map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(*v, e) - - case map[uint16]int: - fastpathTV.EncMapUint16IntV(v, e) - case *map[uint16]int: - fastpathTV.EncMapUint16IntV(*v, e) - - case map[uint16]int8: - fastpathTV.EncMapUint16Int8V(v, e) - case *map[uint16]int8: - fastpathTV.EncMapUint16Int8V(*v, e) - - case map[uint16]int16: - fastpathTV.EncMapUint16Int16V(v, e) - case *map[uint16]int16: - fastpathTV.EncMapUint16Int16V(*v, e) - - case map[uint16]int32: - fastpathTV.EncMapUint16Int32V(v, e) - case *map[uint16]int32: - fastpathTV.EncMapUint16Int32V(*v, e) - - case map[uint16]int64: - fastpathTV.EncMapUint16Int64V(v, e) - case *map[uint16]int64: - fastpathTV.EncMapUint16Int64V(*v, e) - - case map[uint16]float32: - fastpathTV.EncMapUint16Float32V(v, e) - case *map[uint16]float32: - fastpathTV.EncMapUint16Float32V(*v, e) - - case map[uint16]float64: - fastpathTV.EncMapUint16Float64V(v, e) - case *map[uint16]float64: - fastpathTV.EncMapUint16Float64V(*v, e) - - case map[uint16]bool: - fastpathTV.EncMapUint16BoolV(v, e) - case *map[uint16]bool: - fastpathTV.EncMapUint16BoolV(*v, e) - - case []uint32: - fastpathTV.EncSliceUint32V(v, e) - case *[]uint32: - fastpathTV.EncSliceUint32V(*v, e) - - case map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(v, e) - case *map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(*v, e) - - case map[uint32]string: - fastpathTV.EncMapUint32StringV(v, e) - case *map[uint32]string: - fastpathTV.EncMapUint32StringV(*v, e) - - case map[uint32]uint: - fastpathTV.EncMapUint32UintV(v, e) - case *map[uint32]uint: - fastpathTV.EncMapUint32UintV(*v, e) - - case map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(v, e) - case *map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(*v, e) - - case map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(v, e) - case *map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(*v, e) - - case map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(v, e) - case *map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(*v, e) - - case map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(v, e) - case *map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(*v, e) - - case map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(v, e) - case *map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(*v, e) - - case map[uint32]int: - fastpathTV.EncMapUint32IntV(v, e) - case *map[uint32]int: - fastpathTV.EncMapUint32IntV(*v, e) - - case map[uint32]int8: - fastpathTV.EncMapUint32Int8V(v, e) - case *map[uint32]int8: - fastpathTV.EncMapUint32Int8V(*v, e) - - case map[uint32]int16: - fastpathTV.EncMapUint32Int16V(v, e) - case *map[uint32]int16: - fastpathTV.EncMapUint32Int16V(*v, e) - - case map[uint32]int32: - fastpathTV.EncMapUint32Int32V(v, e) - case *map[uint32]int32: - fastpathTV.EncMapUint32Int32V(*v, e) - - case map[uint32]int64: - fastpathTV.EncMapUint32Int64V(v, e) - case *map[uint32]int64: - fastpathTV.EncMapUint32Int64V(*v, e) - - case map[uint32]float32: - fastpathTV.EncMapUint32Float32V(v, e) - case *map[uint32]float32: - fastpathTV.EncMapUint32Float32V(*v, e) - - case map[uint32]float64: - fastpathTV.EncMapUint32Float64V(v, e) - case *map[uint32]float64: - fastpathTV.EncMapUint32Float64V(*v, e) - - case map[uint32]bool: - fastpathTV.EncMapUint32BoolV(v, e) - case *map[uint32]bool: - fastpathTV.EncMapUint32BoolV(*v, e) - - case []uint64: - fastpathTV.EncSliceUint64V(v, e) - case *[]uint64: - fastpathTV.EncSliceUint64V(*v, e) - - case map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(v, e) - case *map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(*v, e) - - case map[uint64]string: - fastpathTV.EncMapUint64StringV(v, e) - case *map[uint64]string: - fastpathTV.EncMapUint64StringV(*v, e) - - case map[uint64]uint: - fastpathTV.EncMapUint64UintV(v, e) - case *map[uint64]uint: - fastpathTV.EncMapUint64UintV(*v, e) - - case map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(v, e) - case *map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(*v, e) - - case map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(v, e) - case *map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(*v, e) - - case map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(v, e) - case *map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(*v, e) - - case map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(v, e) - case *map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(*v, e) - - case map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(v, e) - case *map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(*v, e) - - case map[uint64]int: - fastpathTV.EncMapUint64IntV(v, e) - case *map[uint64]int: - fastpathTV.EncMapUint64IntV(*v, e) - - case map[uint64]int8: - fastpathTV.EncMapUint64Int8V(v, e) - case *map[uint64]int8: - fastpathTV.EncMapUint64Int8V(*v, e) - - case map[uint64]int16: - fastpathTV.EncMapUint64Int16V(v, e) - case *map[uint64]int16: - fastpathTV.EncMapUint64Int16V(*v, e) - - case map[uint64]int32: - fastpathTV.EncMapUint64Int32V(v, e) - case *map[uint64]int32: - fastpathTV.EncMapUint64Int32V(*v, e) - - case map[uint64]int64: - fastpathTV.EncMapUint64Int64V(v, e) - case *map[uint64]int64: - fastpathTV.EncMapUint64Int64V(*v, e) - - case map[uint64]float32: - fastpathTV.EncMapUint64Float32V(v, e) - case *map[uint64]float32: - fastpathTV.EncMapUint64Float32V(*v, e) - - case map[uint64]float64: - fastpathTV.EncMapUint64Float64V(v, e) - case *map[uint64]float64: - fastpathTV.EncMapUint64Float64V(*v, e) - - case map[uint64]bool: - fastpathTV.EncMapUint64BoolV(v, e) - case *map[uint64]bool: - fastpathTV.EncMapUint64BoolV(*v, e) - - case []uintptr: - fastpathTV.EncSliceUintptrV(v, e) - case *[]uintptr: - fastpathTV.EncSliceUintptrV(*v, e) - - case map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(v, e) - case *map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(*v, e) - - case map[uintptr]string: - fastpathTV.EncMapUintptrStringV(v, e) - case *map[uintptr]string: - fastpathTV.EncMapUintptrStringV(*v, e) - - case map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(v, e) - case *map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(*v, e) - - case map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(v, e) - case *map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(*v, e) - - case map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(v, e) - case *map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(*v, e) - - case map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(v, e) - case *map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(*v, e) - - case map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(v, e) - case *map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(*v, e) - - case map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(v, e) - case *map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(*v, e) - - case map[uintptr]int: - fastpathTV.EncMapUintptrIntV(v, e) - case *map[uintptr]int: - fastpathTV.EncMapUintptrIntV(*v, e) - - case map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(v, e) - case *map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(*v, e) - - case map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(v, e) - case *map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(*v, e) - - case map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(v, e) - case *map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(*v, e) - - case map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(v, e) - case *map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(*v, e) - - case map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(v, e) - case *map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(*v, e) - - case map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(v, e) - case *map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(*v, e) - - case map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(v, e) - case *map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(*v, e) - - case []int: - fastpathTV.EncSliceIntV(v, e) - case *[]int: - fastpathTV.EncSliceIntV(*v, e) - - case map[int]interface{}: - fastpathTV.EncMapIntIntfV(v, e) - case *map[int]interface{}: - fastpathTV.EncMapIntIntfV(*v, e) - - case map[int]string: - fastpathTV.EncMapIntStringV(v, e) - case *map[int]string: - fastpathTV.EncMapIntStringV(*v, e) - - case map[int]uint: - fastpathTV.EncMapIntUintV(v, e) - case *map[int]uint: - fastpathTV.EncMapIntUintV(*v, e) - - case map[int]uint8: - fastpathTV.EncMapIntUint8V(v, e) - case *map[int]uint8: - fastpathTV.EncMapIntUint8V(*v, e) - - case map[int]uint16: - fastpathTV.EncMapIntUint16V(v, e) - case *map[int]uint16: - fastpathTV.EncMapIntUint16V(*v, e) - - case map[int]uint32: - fastpathTV.EncMapIntUint32V(v, e) - case *map[int]uint32: - fastpathTV.EncMapIntUint32V(*v, e) - - case map[int]uint64: - fastpathTV.EncMapIntUint64V(v, e) - case *map[int]uint64: - fastpathTV.EncMapIntUint64V(*v, e) - - case map[int]uintptr: - fastpathTV.EncMapIntUintptrV(v, e) - case *map[int]uintptr: - fastpathTV.EncMapIntUintptrV(*v, e) - - case map[int]int: - fastpathTV.EncMapIntIntV(v, e) - case *map[int]int: - fastpathTV.EncMapIntIntV(*v, e) - - case map[int]int8: - fastpathTV.EncMapIntInt8V(v, e) - case *map[int]int8: - fastpathTV.EncMapIntInt8V(*v, e) - - case map[int]int16: - fastpathTV.EncMapIntInt16V(v, e) - case *map[int]int16: - fastpathTV.EncMapIntInt16V(*v, e) - - case map[int]int32: - fastpathTV.EncMapIntInt32V(v, e) - case *map[int]int32: - fastpathTV.EncMapIntInt32V(*v, e) - - case map[int]int64: - fastpathTV.EncMapIntInt64V(v, e) - case *map[int]int64: - fastpathTV.EncMapIntInt64V(*v, e) - - case map[int]float32: - fastpathTV.EncMapIntFloat32V(v, e) - case *map[int]float32: - fastpathTV.EncMapIntFloat32V(*v, e) - - case map[int]float64: - fastpathTV.EncMapIntFloat64V(v, e) - case *map[int]float64: - fastpathTV.EncMapIntFloat64V(*v, e) - - case map[int]bool: - fastpathTV.EncMapIntBoolV(v, e) - case *map[int]bool: - fastpathTV.EncMapIntBoolV(*v, e) - - case []int8: - fastpathTV.EncSliceInt8V(v, e) - case *[]int8: - fastpathTV.EncSliceInt8V(*v, e) - - case map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(v, e) - case *map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(*v, e) - - case map[int8]string: - fastpathTV.EncMapInt8StringV(v, e) - case *map[int8]string: - fastpathTV.EncMapInt8StringV(*v, e) - - case map[int8]uint: - fastpathTV.EncMapInt8UintV(v, e) - case *map[int8]uint: - fastpathTV.EncMapInt8UintV(*v, e) - - case map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(v, e) - case *map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(*v, e) - - case map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(v, e) - case *map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(*v, e) - - case map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(v, e) - case *map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(*v, e) - - case map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(v, e) - case *map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(*v, e) - - case map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(v, e) - case *map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(*v, e) - - case map[int8]int: - fastpathTV.EncMapInt8IntV(v, e) - case *map[int8]int: - fastpathTV.EncMapInt8IntV(*v, e) - - case map[int8]int8: - fastpathTV.EncMapInt8Int8V(v, e) - case *map[int8]int8: - fastpathTV.EncMapInt8Int8V(*v, e) - - case map[int8]int16: - fastpathTV.EncMapInt8Int16V(v, e) - case *map[int8]int16: - fastpathTV.EncMapInt8Int16V(*v, e) - - case map[int8]int32: - fastpathTV.EncMapInt8Int32V(v, e) - case *map[int8]int32: - fastpathTV.EncMapInt8Int32V(*v, e) - - case map[int8]int64: - fastpathTV.EncMapInt8Int64V(v, e) - case *map[int8]int64: - fastpathTV.EncMapInt8Int64V(*v, e) - - case map[int8]float32: - fastpathTV.EncMapInt8Float32V(v, e) - case *map[int8]float32: - fastpathTV.EncMapInt8Float32V(*v, e) - - case map[int8]float64: - fastpathTV.EncMapInt8Float64V(v, e) - case *map[int8]float64: - fastpathTV.EncMapInt8Float64V(*v, e) - - case map[int8]bool: - fastpathTV.EncMapInt8BoolV(v, e) - case *map[int8]bool: - fastpathTV.EncMapInt8BoolV(*v, e) - - case []int16: - fastpathTV.EncSliceInt16V(v, e) - case *[]int16: - fastpathTV.EncSliceInt16V(*v, e) - - case map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(v, e) - case *map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(*v, e) - - case map[int16]string: - fastpathTV.EncMapInt16StringV(v, e) - case *map[int16]string: - fastpathTV.EncMapInt16StringV(*v, e) - - case map[int16]uint: - fastpathTV.EncMapInt16UintV(v, e) - case *map[int16]uint: - fastpathTV.EncMapInt16UintV(*v, e) - - case map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(v, e) - case *map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(*v, e) - - case map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(v, e) - case *map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(*v, e) - - case map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(v, e) - case *map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(*v, e) - - case map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(v, e) - case *map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(*v, e) - - case map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(v, e) - case *map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(*v, e) - - case map[int16]int: - fastpathTV.EncMapInt16IntV(v, e) - case *map[int16]int: - fastpathTV.EncMapInt16IntV(*v, e) - - case map[int16]int8: - fastpathTV.EncMapInt16Int8V(v, e) - case *map[int16]int8: - fastpathTV.EncMapInt16Int8V(*v, e) - - case map[int16]int16: - fastpathTV.EncMapInt16Int16V(v, e) - case *map[int16]int16: - fastpathTV.EncMapInt16Int16V(*v, e) - - case map[int16]int32: - fastpathTV.EncMapInt16Int32V(v, e) - case *map[int16]int32: - fastpathTV.EncMapInt16Int32V(*v, e) - - case map[int16]int64: - fastpathTV.EncMapInt16Int64V(v, e) - case *map[int16]int64: - fastpathTV.EncMapInt16Int64V(*v, e) - - case map[int16]float32: - fastpathTV.EncMapInt16Float32V(v, e) - case *map[int16]float32: - fastpathTV.EncMapInt16Float32V(*v, e) - - case map[int16]float64: - fastpathTV.EncMapInt16Float64V(v, e) - case *map[int16]float64: - fastpathTV.EncMapInt16Float64V(*v, e) - - case map[int16]bool: - fastpathTV.EncMapInt16BoolV(v, e) - case *map[int16]bool: - fastpathTV.EncMapInt16BoolV(*v, e) - - case []int32: - fastpathTV.EncSliceInt32V(v, e) - case *[]int32: - fastpathTV.EncSliceInt32V(*v, e) - - case map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(v, e) - case *map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(*v, e) - - case map[int32]string: - fastpathTV.EncMapInt32StringV(v, e) - case *map[int32]string: - fastpathTV.EncMapInt32StringV(*v, e) - - case map[int32]uint: - fastpathTV.EncMapInt32UintV(v, e) - case *map[int32]uint: - fastpathTV.EncMapInt32UintV(*v, e) - - case map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(v, e) - case *map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(*v, e) - - case map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(v, e) - case *map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(*v, e) - - case map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(v, e) - case *map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(*v, e) - - case map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(v, e) - case *map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(*v, e) - - case map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(v, e) - case *map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(*v, e) - - case map[int32]int: - fastpathTV.EncMapInt32IntV(v, e) - case *map[int32]int: - fastpathTV.EncMapInt32IntV(*v, e) - - case map[int32]int8: - fastpathTV.EncMapInt32Int8V(v, e) - case *map[int32]int8: - fastpathTV.EncMapInt32Int8V(*v, e) - - case map[int32]int16: - fastpathTV.EncMapInt32Int16V(v, e) - case *map[int32]int16: - fastpathTV.EncMapInt32Int16V(*v, e) - - case map[int32]int32: - fastpathTV.EncMapInt32Int32V(v, e) - case *map[int32]int32: - fastpathTV.EncMapInt32Int32V(*v, e) - - case map[int32]int64: - fastpathTV.EncMapInt32Int64V(v, e) - case *map[int32]int64: - fastpathTV.EncMapInt32Int64V(*v, e) - - case map[int32]float32: - fastpathTV.EncMapInt32Float32V(v, e) - case *map[int32]float32: - fastpathTV.EncMapInt32Float32V(*v, e) - - case map[int32]float64: - fastpathTV.EncMapInt32Float64V(v, e) - case *map[int32]float64: - fastpathTV.EncMapInt32Float64V(*v, e) - - case map[int32]bool: - fastpathTV.EncMapInt32BoolV(v, e) - case *map[int32]bool: - fastpathTV.EncMapInt32BoolV(*v, e) - - case []int64: - fastpathTV.EncSliceInt64V(v, e) - case *[]int64: - fastpathTV.EncSliceInt64V(*v, e) - - case map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(v, e) - case *map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(*v, e) - - case map[int64]string: - fastpathTV.EncMapInt64StringV(v, e) - case *map[int64]string: - fastpathTV.EncMapInt64StringV(*v, e) - - case map[int64]uint: - fastpathTV.EncMapInt64UintV(v, e) - case *map[int64]uint: - fastpathTV.EncMapInt64UintV(*v, e) - - case map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(v, e) - case *map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(*v, e) - - case map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(v, e) - case *map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(*v, e) - - case map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(v, e) - case *map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(*v, e) - - case map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(v, e) - case *map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(*v, e) - - case map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(v, e) - case *map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(*v, e) - - case map[int64]int: - fastpathTV.EncMapInt64IntV(v, e) - case *map[int64]int: - fastpathTV.EncMapInt64IntV(*v, e) - - case map[int64]int8: - fastpathTV.EncMapInt64Int8V(v, e) - case *map[int64]int8: - fastpathTV.EncMapInt64Int8V(*v, e) - - case map[int64]int16: - fastpathTV.EncMapInt64Int16V(v, e) - case *map[int64]int16: - fastpathTV.EncMapInt64Int16V(*v, e) - - case map[int64]int32: - fastpathTV.EncMapInt64Int32V(v, e) - case *map[int64]int32: - fastpathTV.EncMapInt64Int32V(*v, e) - - case map[int64]int64: - fastpathTV.EncMapInt64Int64V(v, e) - case *map[int64]int64: - fastpathTV.EncMapInt64Int64V(*v, e) - - case map[int64]float32: - fastpathTV.EncMapInt64Float32V(v, e) - case *map[int64]float32: - fastpathTV.EncMapInt64Float32V(*v, e) - - case map[int64]float64: - fastpathTV.EncMapInt64Float64V(v, e) - case *map[int64]float64: - fastpathTV.EncMapInt64Float64V(*v, e) - - case map[int64]bool: - fastpathTV.EncMapInt64BoolV(v, e) - case *map[int64]bool: - fastpathTV.EncMapInt64BoolV(*v, e) - - case []bool: - fastpathTV.EncSliceBoolV(v, e) - case *[]bool: - fastpathTV.EncSliceBoolV(*v, e) - - case map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(v, e) - case *map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(*v, e) - - case map[bool]string: - fastpathTV.EncMapBoolStringV(v, e) - case *map[bool]string: - fastpathTV.EncMapBoolStringV(*v, e) - - case map[bool]uint: - fastpathTV.EncMapBoolUintV(v, e) - case *map[bool]uint: - fastpathTV.EncMapBoolUintV(*v, e) - - case map[bool]uint8: - fastpathTV.EncMapBoolUint8V(v, e) - case *map[bool]uint8: - fastpathTV.EncMapBoolUint8V(*v, e) - - case map[bool]uint16: - fastpathTV.EncMapBoolUint16V(v, e) - case *map[bool]uint16: - fastpathTV.EncMapBoolUint16V(*v, e) - - case map[bool]uint32: - fastpathTV.EncMapBoolUint32V(v, e) - case *map[bool]uint32: - fastpathTV.EncMapBoolUint32V(*v, e) - - case map[bool]uint64: - fastpathTV.EncMapBoolUint64V(v, e) - case *map[bool]uint64: - fastpathTV.EncMapBoolUint64V(*v, e) - - case map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(v, e) - case *map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(*v, e) - - case map[bool]int: - fastpathTV.EncMapBoolIntV(v, e) - case *map[bool]int: - fastpathTV.EncMapBoolIntV(*v, e) - - case map[bool]int8: - fastpathTV.EncMapBoolInt8V(v, e) - case *map[bool]int8: - fastpathTV.EncMapBoolInt8V(*v, e) - - case map[bool]int16: - fastpathTV.EncMapBoolInt16V(v, e) - case *map[bool]int16: - fastpathTV.EncMapBoolInt16V(*v, e) - - case map[bool]int32: - fastpathTV.EncMapBoolInt32V(v, e) - case *map[bool]int32: - fastpathTV.EncMapBoolInt32V(*v, e) - - case map[bool]int64: - fastpathTV.EncMapBoolInt64V(v, e) - case *map[bool]int64: - fastpathTV.EncMapBoolInt64V(*v, e) - - case map[bool]float32: - fastpathTV.EncMapBoolFloat32V(v, e) - case *map[bool]float32: - fastpathTV.EncMapBoolFloat32V(*v, e) - - case map[bool]float64: - fastpathTV.EncMapBoolFloat64V(v, e) - case *map[bool]float64: - fastpathTV.EncMapBoolFloat64V(*v, e) - - case map[bool]bool: - fastpathTV.EncMapBoolBoolV(v, e) - case *map[bool]bool: - fastpathTV.EncMapBoolBoolV(*v, e) - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { - switch v := iv.(type) { - - case []interface{}: - fastpathTV.EncSliceIntfV(v, e) - case *[]interface{}: - fastpathTV.EncSliceIntfV(*v, e) - - case []string: - fastpathTV.EncSliceStringV(v, e) - case *[]string: - fastpathTV.EncSliceStringV(*v, e) - - case []float32: - fastpathTV.EncSliceFloat32V(v, e) - case *[]float32: - fastpathTV.EncSliceFloat32V(*v, e) - - case []float64: - fastpathTV.EncSliceFloat64V(v, e) - case *[]float64: - fastpathTV.EncSliceFloat64V(*v, e) - - case []uint: - fastpathTV.EncSliceUintV(v, e) - case *[]uint: - fastpathTV.EncSliceUintV(*v, e) - - case []uint16: - fastpathTV.EncSliceUint16V(v, e) - case *[]uint16: - fastpathTV.EncSliceUint16V(*v, e) - - case []uint32: - fastpathTV.EncSliceUint32V(v, e) - case *[]uint32: - fastpathTV.EncSliceUint32V(*v, e) - - case []uint64: - fastpathTV.EncSliceUint64V(v, e) - case *[]uint64: - fastpathTV.EncSliceUint64V(*v, e) - - case []uintptr: - fastpathTV.EncSliceUintptrV(v, e) - case *[]uintptr: - fastpathTV.EncSliceUintptrV(*v, e) - - case []int: - fastpathTV.EncSliceIntV(v, e) - case *[]int: - fastpathTV.EncSliceIntV(*v, e) - - case []int8: - fastpathTV.EncSliceInt8V(v, e) - case *[]int8: - fastpathTV.EncSliceInt8V(*v, e) - - case []int16: - fastpathTV.EncSliceInt16V(v, e) - case *[]int16: - fastpathTV.EncSliceInt16V(*v, e) - - case []int32: - fastpathTV.EncSliceInt32V(v, e) - case *[]int32: - fastpathTV.EncSliceInt32V(*v, e) - - case []int64: - fastpathTV.EncSliceInt64V(v, e) - case *[]int64: - fastpathTV.EncSliceInt64V(*v, e) - - case []bool: - fastpathTV.EncSliceBoolV(v, e) - case *[]bool: - fastpathTV.EncSliceBoolV(*v, e) - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { - switch v := iv.(type) { - - case map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(v, e) - case *map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(*v, e) - - case map[interface{}]string: - fastpathTV.EncMapIntfStringV(v, e) - case *map[interface{}]string: - fastpathTV.EncMapIntfStringV(*v, e) - - case map[interface{}]uint: - fastpathTV.EncMapIntfUintV(v, e) - case *map[interface{}]uint: - fastpathTV.EncMapIntfUintV(*v, e) - - case map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(v, e) - case *map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(*v, e) - - case map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(v, e) - case *map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(*v, e) - - case map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(v, e) - case *map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(*v, e) - - case map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(v, e) - case *map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(*v, e) - - case map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(v, e) - case *map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(*v, e) - - case map[interface{}]int: - fastpathTV.EncMapIntfIntV(v, e) - case *map[interface{}]int: - fastpathTV.EncMapIntfIntV(*v, e) - - case map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(v, e) - case *map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(*v, e) - - case map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(v, e) - case *map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(*v, e) - - case map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(v, e) - case *map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(*v, e) - - case map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(v, e) - case *map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(*v, e) - - case map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(v, e) - case *map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(*v, e) - - case map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(v, e) - case *map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(*v, e) - - case map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(v, e) - case *map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(*v, e) - - case map[string]interface{}: - fastpathTV.EncMapStringIntfV(v, e) - case *map[string]interface{}: - fastpathTV.EncMapStringIntfV(*v, e) - - case map[string]string: - fastpathTV.EncMapStringStringV(v, e) - case *map[string]string: - fastpathTV.EncMapStringStringV(*v, e) - - case map[string]uint: - fastpathTV.EncMapStringUintV(v, e) - case *map[string]uint: - fastpathTV.EncMapStringUintV(*v, e) - - case map[string]uint8: - fastpathTV.EncMapStringUint8V(v, e) - case *map[string]uint8: - fastpathTV.EncMapStringUint8V(*v, e) - - case map[string]uint16: - fastpathTV.EncMapStringUint16V(v, e) - case *map[string]uint16: - fastpathTV.EncMapStringUint16V(*v, e) - - case map[string]uint32: - fastpathTV.EncMapStringUint32V(v, e) - case *map[string]uint32: - fastpathTV.EncMapStringUint32V(*v, e) - - case map[string]uint64: - fastpathTV.EncMapStringUint64V(v, e) - case *map[string]uint64: - fastpathTV.EncMapStringUint64V(*v, e) - - case map[string]uintptr: - fastpathTV.EncMapStringUintptrV(v, e) - case *map[string]uintptr: - fastpathTV.EncMapStringUintptrV(*v, e) - - case map[string]int: - fastpathTV.EncMapStringIntV(v, e) - case *map[string]int: - fastpathTV.EncMapStringIntV(*v, e) - - case map[string]int8: - fastpathTV.EncMapStringInt8V(v, e) - case *map[string]int8: - fastpathTV.EncMapStringInt8V(*v, e) - - case map[string]int16: - fastpathTV.EncMapStringInt16V(v, e) - case *map[string]int16: - fastpathTV.EncMapStringInt16V(*v, e) - - case map[string]int32: - fastpathTV.EncMapStringInt32V(v, e) - case *map[string]int32: - fastpathTV.EncMapStringInt32V(*v, e) - - case map[string]int64: - fastpathTV.EncMapStringInt64V(v, e) - case *map[string]int64: - fastpathTV.EncMapStringInt64V(*v, e) - - case map[string]float32: - fastpathTV.EncMapStringFloat32V(v, e) - case *map[string]float32: - fastpathTV.EncMapStringFloat32V(*v, e) - - case map[string]float64: - fastpathTV.EncMapStringFloat64V(v, e) - case *map[string]float64: - fastpathTV.EncMapStringFloat64V(*v, e) - - case map[string]bool: - fastpathTV.EncMapStringBoolV(v, e) - case *map[string]bool: - fastpathTV.EncMapStringBoolV(*v, e) - - case map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(v, e) - case *map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(*v, e) - - case map[float32]string: - fastpathTV.EncMapFloat32StringV(v, e) - case *map[float32]string: - fastpathTV.EncMapFloat32StringV(*v, e) - - case map[float32]uint: - fastpathTV.EncMapFloat32UintV(v, e) - case *map[float32]uint: - fastpathTV.EncMapFloat32UintV(*v, e) - - case map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(v, e) - case *map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(*v, e) - - case map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(v, e) - case *map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(*v, e) - - case map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(v, e) - case *map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(*v, e) - - case map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(v, e) - case *map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(*v, e) - - case map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(v, e) - case *map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(*v, e) - - case map[float32]int: - fastpathTV.EncMapFloat32IntV(v, e) - case *map[float32]int: - fastpathTV.EncMapFloat32IntV(*v, e) - - case map[float32]int8: - fastpathTV.EncMapFloat32Int8V(v, e) - case *map[float32]int8: - fastpathTV.EncMapFloat32Int8V(*v, e) - - case map[float32]int16: - fastpathTV.EncMapFloat32Int16V(v, e) - case *map[float32]int16: - fastpathTV.EncMapFloat32Int16V(*v, e) - - case map[float32]int32: - fastpathTV.EncMapFloat32Int32V(v, e) - case *map[float32]int32: - fastpathTV.EncMapFloat32Int32V(*v, e) - - case map[float32]int64: - fastpathTV.EncMapFloat32Int64V(v, e) - case *map[float32]int64: - fastpathTV.EncMapFloat32Int64V(*v, e) - - case map[float32]float32: - fastpathTV.EncMapFloat32Float32V(v, e) - case *map[float32]float32: - fastpathTV.EncMapFloat32Float32V(*v, e) - - case map[float32]float64: - fastpathTV.EncMapFloat32Float64V(v, e) - case *map[float32]float64: - fastpathTV.EncMapFloat32Float64V(*v, e) - - case map[float32]bool: - fastpathTV.EncMapFloat32BoolV(v, e) - case *map[float32]bool: - fastpathTV.EncMapFloat32BoolV(*v, e) - - case map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(v, e) - case *map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(*v, e) - - case map[float64]string: - fastpathTV.EncMapFloat64StringV(v, e) - case *map[float64]string: - fastpathTV.EncMapFloat64StringV(*v, e) - - case map[float64]uint: - fastpathTV.EncMapFloat64UintV(v, e) - case *map[float64]uint: - fastpathTV.EncMapFloat64UintV(*v, e) - - case map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(v, e) - case *map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(*v, e) - - case map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(v, e) - case *map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(*v, e) - - case map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(v, e) - case *map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(*v, e) - - case map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(v, e) - case *map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(*v, e) - - case map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(v, e) - case *map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(*v, e) - - case map[float64]int: - fastpathTV.EncMapFloat64IntV(v, e) - case *map[float64]int: - fastpathTV.EncMapFloat64IntV(*v, e) - - case map[float64]int8: - fastpathTV.EncMapFloat64Int8V(v, e) - case *map[float64]int8: - fastpathTV.EncMapFloat64Int8V(*v, e) - - case map[float64]int16: - fastpathTV.EncMapFloat64Int16V(v, e) - case *map[float64]int16: - fastpathTV.EncMapFloat64Int16V(*v, e) - - case map[float64]int32: - fastpathTV.EncMapFloat64Int32V(v, e) - case *map[float64]int32: - fastpathTV.EncMapFloat64Int32V(*v, e) - - case map[float64]int64: - fastpathTV.EncMapFloat64Int64V(v, e) - case *map[float64]int64: - fastpathTV.EncMapFloat64Int64V(*v, e) - - case map[float64]float32: - fastpathTV.EncMapFloat64Float32V(v, e) - case *map[float64]float32: - fastpathTV.EncMapFloat64Float32V(*v, e) - - case map[float64]float64: - fastpathTV.EncMapFloat64Float64V(v, e) - case *map[float64]float64: - fastpathTV.EncMapFloat64Float64V(*v, e) - - case map[float64]bool: - fastpathTV.EncMapFloat64BoolV(v, e) - case *map[float64]bool: - fastpathTV.EncMapFloat64BoolV(*v, e) - - case map[uint]interface{}: - fastpathTV.EncMapUintIntfV(v, e) - case *map[uint]interface{}: - fastpathTV.EncMapUintIntfV(*v, e) - - case map[uint]string: - fastpathTV.EncMapUintStringV(v, e) - case *map[uint]string: - fastpathTV.EncMapUintStringV(*v, e) - - case map[uint]uint: - fastpathTV.EncMapUintUintV(v, e) - case *map[uint]uint: - fastpathTV.EncMapUintUintV(*v, e) - - case map[uint]uint8: - fastpathTV.EncMapUintUint8V(v, e) - case *map[uint]uint8: - fastpathTV.EncMapUintUint8V(*v, e) - - case map[uint]uint16: - fastpathTV.EncMapUintUint16V(v, e) - case *map[uint]uint16: - fastpathTV.EncMapUintUint16V(*v, e) - - case map[uint]uint32: - fastpathTV.EncMapUintUint32V(v, e) - case *map[uint]uint32: - fastpathTV.EncMapUintUint32V(*v, e) - - case map[uint]uint64: - fastpathTV.EncMapUintUint64V(v, e) - case *map[uint]uint64: - fastpathTV.EncMapUintUint64V(*v, e) - - case map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(v, e) - case *map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(*v, e) - - case map[uint]int: - fastpathTV.EncMapUintIntV(v, e) - case *map[uint]int: - fastpathTV.EncMapUintIntV(*v, e) - - case map[uint]int8: - fastpathTV.EncMapUintInt8V(v, e) - case *map[uint]int8: - fastpathTV.EncMapUintInt8V(*v, e) - - case map[uint]int16: - fastpathTV.EncMapUintInt16V(v, e) - case *map[uint]int16: - fastpathTV.EncMapUintInt16V(*v, e) - - case map[uint]int32: - fastpathTV.EncMapUintInt32V(v, e) - case *map[uint]int32: - fastpathTV.EncMapUintInt32V(*v, e) - - case map[uint]int64: - fastpathTV.EncMapUintInt64V(v, e) - case *map[uint]int64: - fastpathTV.EncMapUintInt64V(*v, e) - - case map[uint]float32: - fastpathTV.EncMapUintFloat32V(v, e) - case *map[uint]float32: - fastpathTV.EncMapUintFloat32V(*v, e) - - case map[uint]float64: - fastpathTV.EncMapUintFloat64V(v, e) - case *map[uint]float64: - fastpathTV.EncMapUintFloat64V(*v, e) - - case map[uint]bool: - fastpathTV.EncMapUintBoolV(v, e) - case *map[uint]bool: - fastpathTV.EncMapUintBoolV(*v, e) - - case map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(v, e) - case *map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(*v, e) - - case map[uint8]string: - fastpathTV.EncMapUint8StringV(v, e) - case *map[uint8]string: - fastpathTV.EncMapUint8StringV(*v, e) - - case map[uint8]uint: - fastpathTV.EncMapUint8UintV(v, e) - case *map[uint8]uint: - fastpathTV.EncMapUint8UintV(*v, e) - - case map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(v, e) - case *map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(*v, e) - - case map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(v, e) - case *map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(*v, e) - - case map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(v, e) - case *map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(*v, e) - - case map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(v, e) - case *map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(*v, e) - - case map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(v, e) - case *map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(*v, e) - - case map[uint8]int: - fastpathTV.EncMapUint8IntV(v, e) - case *map[uint8]int: - fastpathTV.EncMapUint8IntV(*v, e) - - case map[uint8]int8: - fastpathTV.EncMapUint8Int8V(v, e) - case *map[uint8]int8: - fastpathTV.EncMapUint8Int8V(*v, e) - - case map[uint8]int16: - fastpathTV.EncMapUint8Int16V(v, e) - case *map[uint8]int16: - fastpathTV.EncMapUint8Int16V(*v, e) - - case map[uint8]int32: - fastpathTV.EncMapUint8Int32V(v, e) - case *map[uint8]int32: - fastpathTV.EncMapUint8Int32V(*v, e) - - case map[uint8]int64: - fastpathTV.EncMapUint8Int64V(v, e) - case *map[uint8]int64: - fastpathTV.EncMapUint8Int64V(*v, e) - - case map[uint8]float32: - fastpathTV.EncMapUint8Float32V(v, e) - case *map[uint8]float32: - fastpathTV.EncMapUint8Float32V(*v, e) - - case map[uint8]float64: - fastpathTV.EncMapUint8Float64V(v, e) - case *map[uint8]float64: - fastpathTV.EncMapUint8Float64V(*v, e) - - case map[uint8]bool: - fastpathTV.EncMapUint8BoolV(v, e) - case *map[uint8]bool: - fastpathTV.EncMapUint8BoolV(*v, e) - - case map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(v, e) - case *map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(*v, e) - - case map[uint16]string: - fastpathTV.EncMapUint16StringV(v, e) - case *map[uint16]string: - fastpathTV.EncMapUint16StringV(*v, e) - - case map[uint16]uint: - fastpathTV.EncMapUint16UintV(v, e) - case *map[uint16]uint: - fastpathTV.EncMapUint16UintV(*v, e) - - case map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(v, e) - case *map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(*v, e) - - case map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(v, e) - case *map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(*v, e) - - case map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(v, e) - case *map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(*v, e) - - case map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(v, e) - case *map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(*v, e) - - case map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(v, e) - case *map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(*v, e) - - case map[uint16]int: - fastpathTV.EncMapUint16IntV(v, e) - case *map[uint16]int: - fastpathTV.EncMapUint16IntV(*v, e) - - case map[uint16]int8: - fastpathTV.EncMapUint16Int8V(v, e) - case *map[uint16]int8: - fastpathTV.EncMapUint16Int8V(*v, e) - - case map[uint16]int16: - fastpathTV.EncMapUint16Int16V(v, e) - case *map[uint16]int16: - fastpathTV.EncMapUint16Int16V(*v, e) - - case map[uint16]int32: - fastpathTV.EncMapUint16Int32V(v, e) - case *map[uint16]int32: - fastpathTV.EncMapUint16Int32V(*v, e) - - case map[uint16]int64: - fastpathTV.EncMapUint16Int64V(v, e) - case *map[uint16]int64: - fastpathTV.EncMapUint16Int64V(*v, e) - - case map[uint16]float32: - fastpathTV.EncMapUint16Float32V(v, e) - case *map[uint16]float32: - fastpathTV.EncMapUint16Float32V(*v, e) - - case map[uint16]float64: - fastpathTV.EncMapUint16Float64V(v, e) - case *map[uint16]float64: - fastpathTV.EncMapUint16Float64V(*v, e) - - case map[uint16]bool: - fastpathTV.EncMapUint16BoolV(v, e) - case *map[uint16]bool: - fastpathTV.EncMapUint16BoolV(*v, e) - - case map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(v, e) - case *map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(*v, e) - - case map[uint32]string: - fastpathTV.EncMapUint32StringV(v, e) - case *map[uint32]string: - fastpathTV.EncMapUint32StringV(*v, e) - - case map[uint32]uint: - fastpathTV.EncMapUint32UintV(v, e) - case *map[uint32]uint: - fastpathTV.EncMapUint32UintV(*v, e) - - case map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(v, e) - case *map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(*v, e) - - case map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(v, e) - case *map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(*v, e) - - case map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(v, e) - case *map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(*v, e) - - case map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(v, e) - case *map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(*v, e) - - case map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(v, e) - case *map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(*v, e) - - case map[uint32]int: - fastpathTV.EncMapUint32IntV(v, e) - case *map[uint32]int: - fastpathTV.EncMapUint32IntV(*v, e) - - case map[uint32]int8: - fastpathTV.EncMapUint32Int8V(v, e) - case *map[uint32]int8: - fastpathTV.EncMapUint32Int8V(*v, e) - - case map[uint32]int16: - fastpathTV.EncMapUint32Int16V(v, e) - case *map[uint32]int16: - fastpathTV.EncMapUint32Int16V(*v, e) - - case map[uint32]int32: - fastpathTV.EncMapUint32Int32V(v, e) - case *map[uint32]int32: - fastpathTV.EncMapUint32Int32V(*v, e) - - case map[uint32]int64: - fastpathTV.EncMapUint32Int64V(v, e) - case *map[uint32]int64: - fastpathTV.EncMapUint32Int64V(*v, e) - - case map[uint32]float32: - fastpathTV.EncMapUint32Float32V(v, e) - case *map[uint32]float32: - fastpathTV.EncMapUint32Float32V(*v, e) - - case map[uint32]float64: - fastpathTV.EncMapUint32Float64V(v, e) - case *map[uint32]float64: - fastpathTV.EncMapUint32Float64V(*v, e) - - case map[uint32]bool: - fastpathTV.EncMapUint32BoolV(v, e) - case *map[uint32]bool: - fastpathTV.EncMapUint32BoolV(*v, e) - - case map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(v, e) - case *map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(*v, e) - - case map[uint64]string: - fastpathTV.EncMapUint64StringV(v, e) - case *map[uint64]string: - fastpathTV.EncMapUint64StringV(*v, e) - - case map[uint64]uint: - fastpathTV.EncMapUint64UintV(v, e) - case *map[uint64]uint: - fastpathTV.EncMapUint64UintV(*v, e) - - case map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(v, e) - case *map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(*v, e) - - case map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(v, e) - case *map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(*v, e) - - case map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(v, e) - case *map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(*v, e) - - case map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(v, e) - case *map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(*v, e) - - case map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(v, e) - case *map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(*v, e) - - case map[uint64]int: - fastpathTV.EncMapUint64IntV(v, e) - case *map[uint64]int: - fastpathTV.EncMapUint64IntV(*v, e) - - case map[uint64]int8: - fastpathTV.EncMapUint64Int8V(v, e) - case *map[uint64]int8: - fastpathTV.EncMapUint64Int8V(*v, e) - - case map[uint64]int16: - fastpathTV.EncMapUint64Int16V(v, e) - case *map[uint64]int16: - fastpathTV.EncMapUint64Int16V(*v, e) - - case map[uint64]int32: - fastpathTV.EncMapUint64Int32V(v, e) - case *map[uint64]int32: - fastpathTV.EncMapUint64Int32V(*v, e) - - case map[uint64]int64: - fastpathTV.EncMapUint64Int64V(v, e) - case *map[uint64]int64: - fastpathTV.EncMapUint64Int64V(*v, e) - - case map[uint64]float32: - fastpathTV.EncMapUint64Float32V(v, e) - case *map[uint64]float32: - fastpathTV.EncMapUint64Float32V(*v, e) - - case map[uint64]float64: - fastpathTV.EncMapUint64Float64V(v, e) - case *map[uint64]float64: - fastpathTV.EncMapUint64Float64V(*v, e) - - case map[uint64]bool: - fastpathTV.EncMapUint64BoolV(v, e) - case *map[uint64]bool: - fastpathTV.EncMapUint64BoolV(*v, e) - - case map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(v, e) - case *map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(*v, e) - - case map[uintptr]string: - fastpathTV.EncMapUintptrStringV(v, e) - case *map[uintptr]string: - fastpathTV.EncMapUintptrStringV(*v, e) - - case map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(v, e) - case *map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(*v, e) - - case map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(v, e) - case *map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(*v, e) - - case map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(v, e) - case *map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(*v, e) - - case map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(v, e) - case *map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(*v, e) - - case map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(v, e) - case *map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(*v, e) - - case map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(v, e) - case *map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(*v, e) - - case map[uintptr]int: - fastpathTV.EncMapUintptrIntV(v, e) - case *map[uintptr]int: - fastpathTV.EncMapUintptrIntV(*v, e) - - case map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(v, e) - case *map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(*v, e) - - case map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(v, e) - case *map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(*v, e) - - case map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(v, e) - case *map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(*v, e) - - case map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(v, e) - case *map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(*v, e) - - case map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(v, e) - case *map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(*v, e) - - case map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(v, e) - case *map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(*v, e) - - case map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(v, e) - case *map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(*v, e) - - case map[int]interface{}: - fastpathTV.EncMapIntIntfV(v, e) - case *map[int]interface{}: - fastpathTV.EncMapIntIntfV(*v, e) - - case map[int]string: - fastpathTV.EncMapIntStringV(v, e) - case *map[int]string: - fastpathTV.EncMapIntStringV(*v, e) - - case map[int]uint: - fastpathTV.EncMapIntUintV(v, e) - case *map[int]uint: - fastpathTV.EncMapIntUintV(*v, e) - - case map[int]uint8: - fastpathTV.EncMapIntUint8V(v, e) - case *map[int]uint8: - fastpathTV.EncMapIntUint8V(*v, e) - - case map[int]uint16: - fastpathTV.EncMapIntUint16V(v, e) - case *map[int]uint16: - fastpathTV.EncMapIntUint16V(*v, e) - - case map[int]uint32: - fastpathTV.EncMapIntUint32V(v, e) - case *map[int]uint32: - fastpathTV.EncMapIntUint32V(*v, e) - - case map[int]uint64: - fastpathTV.EncMapIntUint64V(v, e) - case *map[int]uint64: - fastpathTV.EncMapIntUint64V(*v, e) - - case map[int]uintptr: - fastpathTV.EncMapIntUintptrV(v, e) - case *map[int]uintptr: - fastpathTV.EncMapIntUintptrV(*v, e) - - case map[int]int: - fastpathTV.EncMapIntIntV(v, e) - case *map[int]int: - fastpathTV.EncMapIntIntV(*v, e) - - case map[int]int8: - fastpathTV.EncMapIntInt8V(v, e) - case *map[int]int8: - fastpathTV.EncMapIntInt8V(*v, e) - - case map[int]int16: - fastpathTV.EncMapIntInt16V(v, e) - case *map[int]int16: - fastpathTV.EncMapIntInt16V(*v, e) - - case map[int]int32: - fastpathTV.EncMapIntInt32V(v, e) - case *map[int]int32: - fastpathTV.EncMapIntInt32V(*v, e) - - case map[int]int64: - fastpathTV.EncMapIntInt64V(v, e) - case *map[int]int64: - fastpathTV.EncMapIntInt64V(*v, e) - - case map[int]float32: - fastpathTV.EncMapIntFloat32V(v, e) - case *map[int]float32: - fastpathTV.EncMapIntFloat32V(*v, e) - - case map[int]float64: - fastpathTV.EncMapIntFloat64V(v, e) - case *map[int]float64: - fastpathTV.EncMapIntFloat64V(*v, e) - - case map[int]bool: - fastpathTV.EncMapIntBoolV(v, e) - case *map[int]bool: - fastpathTV.EncMapIntBoolV(*v, e) - - case map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(v, e) - case *map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(*v, e) - - case map[int8]string: - fastpathTV.EncMapInt8StringV(v, e) - case *map[int8]string: - fastpathTV.EncMapInt8StringV(*v, e) - - case map[int8]uint: - fastpathTV.EncMapInt8UintV(v, e) - case *map[int8]uint: - fastpathTV.EncMapInt8UintV(*v, e) - - case map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(v, e) - case *map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(*v, e) - - case map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(v, e) - case *map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(*v, e) - - case map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(v, e) - case *map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(*v, e) - - case map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(v, e) - case *map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(*v, e) - - case map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(v, e) - case *map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(*v, e) - - case map[int8]int: - fastpathTV.EncMapInt8IntV(v, e) - case *map[int8]int: - fastpathTV.EncMapInt8IntV(*v, e) - - case map[int8]int8: - fastpathTV.EncMapInt8Int8V(v, e) - case *map[int8]int8: - fastpathTV.EncMapInt8Int8V(*v, e) - - case map[int8]int16: - fastpathTV.EncMapInt8Int16V(v, e) - case *map[int8]int16: - fastpathTV.EncMapInt8Int16V(*v, e) - - case map[int8]int32: - fastpathTV.EncMapInt8Int32V(v, e) - case *map[int8]int32: - fastpathTV.EncMapInt8Int32V(*v, e) - - case map[int8]int64: - fastpathTV.EncMapInt8Int64V(v, e) - case *map[int8]int64: - fastpathTV.EncMapInt8Int64V(*v, e) - - case map[int8]float32: - fastpathTV.EncMapInt8Float32V(v, e) - case *map[int8]float32: - fastpathTV.EncMapInt8Float32V(*v, e) - - case map[int8]float64: - fastpathTV.EncMapInt8Float64V(v, e) - case *map[int8]float64: - fastpathTV.EncMapInt8Float64V(*v, e) - - case map[int8]bool: - fastpathTV.EncMapInt8BoolV(v, e) - case *map[int8]bool: - fastpathTV.EncMapInt8BoolV(*v, e) - - case map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(v, e) - case *map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(*v, e) - - case map[int16]string: - fastpathTV.EncMapInt16StringV(v, e) - case *map[int16]string: - fastpathTV.EncMapInt16StringV(*v, e) - - case map[int16]uint: - fastpathTV.EncMapInt16UintV(v, e) - case *map[int16]uint: - fastpathTV.EncMapInt16UintV(*v, e) - - case map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(v, e) - case *map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(*v, e) - - case map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(v, e) - case *map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(*v, e) - - case map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(v, e) - case *map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(*v, e) - - case map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(v, e) - case *map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(*v, e) - - case map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(v, e) - case *map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(*v, e) - - case map[int16]int: - fastpathTV.EncMapInt16IntV(v, e) - case *map[int16]int: - fastpathTV.EncMapInt16IntV(*v, e) - - case map[int16]int8: - fastpathTV.EncMapInt16Int8V(v, e) - case *map[int16]int8: - fastpathTV.EncMapInt16Int8V(*v, e) - - case map[int16]int16: - fastpathTV.EncMapInt16Int16V(v, e) - case *map[int16]int16: - fastpathTV.EncMapInt16Int16V(*v, e) - - case map[int16]int32: - fastpathTV.EncMapInt16Int32V(v, e) - case *map[int16]int32: - fastpathTV.EncMapInt16Int32V(*v, e) - - case map[int16]int64: - fastpathTV.EncMapInt16Int64V(v, e) - case *map[int16]int64: - fastpathTV.EncMapInt16Int64V(*v, e) - - case map[int16]float32: - fastpathTV.EncMapInt16Float32V(v, e) - case *map[int16]float32: - fastpathTV.EncMapInt16Float32V(*v, e) - - case map[int16]float64: - fastpathTV.EncMapInt16Float64V(v, e) - case *map[int16]float64: - fastpathTV.EncMapInt16Float64V(*v, e) - - case map[int16]bool: - fastpathTV.EncMapInt16BoolV(v, e) - case *map[int16]bool: - fastpathTV.EncMapInt16BoolV(*v, e) - - case map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(v, e) - case *map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(*v, e) - - case map[int32]string: - fastpathTV.EncMapInt32StringV(v, e) - case *map[int32]string: - fastpathTV.EncMapInt32StringV(*v, e) - - case map[int32]uint: - fastpathTV.EncMapInt32UintV(v, e) - case *map[int32]uint: - fastpathTV.EncMapInt32UintV(*v, e) - - case map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(v, e) - case *map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(*v, e) - - case map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(v, e) - case *map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(*v, e) - - case map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(v, e) - case *map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(*v, e) - - case map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(v, e) - case *map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(*v, e) - - case map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(v, e) - case *map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(*v, e) - - case map[int32]int: - fastpathTV.EncMapInt32IntV(v, e) - case *map[int32]int: - fastpathTV.EncMapInt32IntV(*v, e) - - case map[int32]int8: - fastpathTV.EncMapInt32Int8V(v, e) - case *map[int32]int8: - fastpathTV.EncMapInt32Int8V(*v, e) - - case map[int32]int16: - fastpathTV.EncMapInt32Int16V(v, e) - case *map[int32]int16: - fastpathTV.EncMapInt32Int16V(*v, e) - - case map[int32]int32: - fastpathTV.EncMapInt32Int32V(v, e) - case *map[int32]int32: - fastpathTV.EncMapInt32Int32V(*v, e) - - case map[int32]int64: - fastpathTV.EncMapInt32Int64V(v, e) - case *map[int32]int64: - fastpathTV.EncMapInt32Int64V(*v, e) - - case map[int32]float32: - fastpathTV.EncMapInt32Float32V(v, e) - case *map[int32]float32: - fastpathTV.EncMapInt32Float32V(*v, e) - - case map[int32]float64: - fastpathTV.EncMapInt32Float64V(v, e) - case *map[int32]float64: - fastpathTV.EncMapInt32Float64V(*v, e) - - case map[int32]bool: - fastpathTV.EncMapInt32BoolV(v, e) - case *map[int32]bool: - fastpathTV.EncMapInt32BoolV(*v, e) - - case map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(v, e) - case *map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(*v, e) - - case map[int64]string: - fastpathTV.EncMapInt64StringV(v, e) - case *map[int64]string: - fastpathTV.EncMapInt64StringV(*v, e) - - case map[int64]uint: - fastpathTV.EncMapInt64UintV(v, e) - case *map[int64]uint: - fastpathTV.EncMapInt64UintV(*v, e) - - case map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(v, e) - case *map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(*v, e) - - case map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(v, e) - case *map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(*v, e) - - case map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(v, e) - case *map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(*v, e) - - case map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(v, e) - case *map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(*v, e) - - case map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(v, e) - case *map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(*v, e) - - case map[int64]int: - fastpathTV.EncMapInt64IntV(v, e) - case *map[int64]int: - fastpathTV.EncMapInt64IntV(*v, e) - - case map[int64]int8: - fastpathTV.EncMapInt64Int8V(v, e) - case *map[int64]int8: - fastpathTV.EncMapInt64Int8V(*v, e) - - case map[int64]int16: - fastpathTV.EncMapInt64Int16V(v, e) - case *map[int64]int16: - fastpathTV.EncMapInt64Int16V(*v, e) - - case map[int64]int32: - fastpathTV.EncMapInt64Int32V(v, e) - case *map[int64]int32: - fastpathTV.EncMapInt64Int32V(*v, e) - - case map[int64]int64: - fastpathTV.EncMapInt64Int64V(v, e) - case *map[int64]int64: - fastpathTV.EncMapInt64Int64V(*v, e) - - case map[int64]float32: - fastpathTV.EncMapInt64Float32V(v, e) - case *map[int64]float32: - fastpathTV.EncMapInt64Float32V(*v, e) - - case map[int64]float64: - fastpathTV.EncMapInt64Float64V(v, e) - case *map[int64]float64: - fastpathTV.EncMapInt64Float64V(*v, e) - - case map[int64]bool: - fastpathTV.EncMapInt64BoolV(v, e) - case *map[int64]bool: - fastpathTV.EncMapInt64BoolV(*v, e) - - case map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(v, e) - case *map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(*v, e) - - case map[bool]string: - fastpathTV.EncMapBoolStringV(v, e) - case *map[bool]string: - fastpathTV.EncMapBoolStringV(*v, e) - - case map[bool]uint: - fastpathTV.EncMapBoolUintV(v, e) - case *map[bool]uint: - fastpathTV.EncMapBoolUintV(*v, e) - - case map[bool]uint8: - fastpathTV.EncMapBoolUint8V(v, e) - case *map[bool]uint8: - fastpathTV.EncMapBoolUint8V(*v, e) - - case map[bool]uint16: - fastpathTV.EncMapBoolUint16V(v, e) - case *map[bool]uint16: - fastpathTV.EncMapBoolUint16V(*v, e) - - case map[bool]uint32: - fastpathTV.EncMapBoolUint32V(v, e) - case *map[bool]uint32: - fastpathTV.EncMapBoolUint32V(*v, e) - - case map[bool]uint64: - fastpathTV.EncMapBoolUint64V(v, e) - case *map[bool]uint64: - fastpathTV.EncMapBoolUint64V(*v, e) - - case map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(v, e) - case *map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(*v, e) - - case map[bool]int: - fastpathTV.EncMapBoolIntV(v, e) - case *map[bool]int: - fastpathTV.EncMapBoolIntV(*v, e) - - case map[bool]int8: - fastpathTV.EncMapBoolInt8V(v, e) - case *map[bool]int8: - fastpathTV.EncMapBoolInt8V(*v, e) - - case map[bool]int16: - fastpathTV.EncMapBoolInt16V(v, e) - case *map[bool]int16: - fastpathTV.EncMapBoolInt16V(*v, e) - - case map[bool]int32: - fastpathTV.EncMapBoolInt32V(v, e) - case *map[bool]int32: - fastpathTV.EncMapBoolInt32V(*v, e) - - case map[bool]int64: - fastpathTV.EncMapBoolInt64V(v, e) - case *map[bool]int64: - fastpathTV.EncMapBoolInt64V(*v, e) - - case map[bool]float32: - fastpathTV.EncMapBoolFloat32V(v, e) - case *map[bool]float32: - fastpathTV.EncMapBoolFloat32V(*v, e) - - case map[bool]float64: - fastpathTV.EncMapBoolFloat64V(v, e) - case *map[bool]float64: - fastpathTV.EncMapBoolFloat64V(*v, e) - - case map[bool]bool: - fastpathTV.EncMapBoolBoolV(v, e) - case *map[bool]bool: - fastpathTV.EncMapBoolBoolV(*v, e) - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -// -- -- fast path functions - -func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceIntfV(rv2i(rv).([]interface{}), e) - } else { - fastpathTV.EncSliceIntfV(rv2i(rv).([]interface{}), e) - } -} -func (_ fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - e.encode(v2) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - e.encode(v2) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceStringV(rv2i(rv).([]string), e) - } else { - fastpathTV.EncSliceStringV(rv2i(rv).([]string), e) - } -} -func (_ fastpathT) EncSliceStringV(v []string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeString(c_UTF8, v2) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeString(c_UTF8, v2) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceFloat32V(rv2i(rv).([]float32), e) - } else { - fastpathTV.EncSliceFloat32V(rv2i(rv).([]float32), e) - } -} -func (_ fastpathT) EncSliceFloat32V(v []float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeFloat32(v2) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeFloat32(v2) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceFloat64V(rv2i(rv).([]float64), e) - } else { - fastpathTV.EncSliceFloat64V(rv2i(rv).([]float64), e) - } -} -func (_ fastpathT) EncSliceFloat64V(v []float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeFloat64(v2) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeFloat64(v2) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceUintR(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUintV(rv2i(rv).([]uint), e) - } else { - fastpathTV.EncSliceUintV(rv2i(rv).([]uint), e) - } -} -func (_ fastpathT) EncSliceUintV(v []uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceUint16R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUint16V(rv2i(rv).([]uint16), e) - } else { - fastpathTV.EncSliceUint16V(rv2i(rv).([]uint16), e) - } -} -func (_ fastpathT) EncSliceUint16V(v []uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceUint32R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUint32V(rv2i(rv).([]uint32), e) - } else { - fastpathTV.EncSliceUint32V(rv2i(rv).([]uint32), e) - } -} -func (_ fastpathT) EncSliceUint32V(v []uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUint64V(rv2i(rv).([]uint64), e) - } else { - fastpathTV.EncSliceUint64V(rv2i(rv).([]uint64), e) - } -} -func (_ fastpathT) EncSliceUint64V(v []uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeUint(uint64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceUintptrR(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUintptrV(rv2i(rv).([]uintptr), e) - } else { - fastpathTV.EncSliceUintptrV(rv2i(rv).([]uintptr), e) - } -} -func (_ fastpathT) EncSliceUintptrV(v []uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - e.encode(v2) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceUintptrV(v []uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - e.encode(v2) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceIntV(rv2i(rv).([]int), e) - } else { - fastpathTV.EncSliceIntV(rv2i(rv).([]int), e) - } -} -func (_ fastpathT) EncSliceIntV(v []int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeInt(int64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeInt(int64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceInt8R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt8V(rv2i(rv).([]int8), e) - } else { - fastpathTV.EncSliceInt8V(rv2i(rv).([]int8), e) - } -} -func (_ fastpathT) EncSliceInt8V(v []int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeInt(int64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeInt(int64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceInt16R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt16V(rv2i(rv).([]int16), e) - } else { - fastpathTV.EncSliceInt16V(rv2i(rv).([]int16), e) - } -} -func (_ fastpathT) EncSliceInt16V(v []int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeInt(int64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeInt(int64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt32V(rv2i(rv).([]int32), e) - } else { - fastpathTV.EncSliceInt32V(rv2i(rv).([]int32), e) - } -} -func (_ fastpathT) EncSliceInt32V(v []int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeInt(int64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeInt(int64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt64V(rv2i(rv).([]int64), e) - } else { - fastpathTV.EncSliceInt64V(rv2i(rv).([]int64), e) - } -} -func (_ fastpathT) EncSliceInt64V(v []int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeInt(int64(v2)) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeInt(int64(v2)) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceBoolV(rv2i(rv).([]bool), e) - } else { - fastpathTV.EncSliceBoolV(rv2i(rv).([]bool), e) - } -} -func (_ fastpathT) EncSliceBoolV(v []bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteArrayStart(len(v)) - for _, v2 := range v { - if esep { - ee.WriteArrayElem() - } - ee.EncodeBool(v2) - } - ee.WriteArrayEnd() -} - -func (_ fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.WriteMapStart(len(v) / 2) - for j, v2 := range v { - if esep { - if j%2 == 0 { - ee.WriteMapElemKey() - } else { - ee.WriteMapElemValue() - } - } - ee.EncodeBool(v2) - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfIntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfIntfV(rv2i(rv).(map[interface{}]interface{}), e) -} -func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfStringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfStringV(rv2i(rv).(map[interface{}]string), e) -} -func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfUintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfUintV(rv2i(rv).(map[interface{}]uint), e) -} -func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfUint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfUint8V(rv2i(rv).(map[interface{}]uint8), e) -} -func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfUint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfUint16V(rv2i(rv).(map[interface{}]uint16), e) -} -func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfUint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfUint32V(rv2i(rv).(map[interface{}]uint32), e) -} -func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfUint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfUint64V(rv2i(rv).(map[interface{}]uint64), e) -} -func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfUintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfUintptrV(rv2i(rv).(map[interface{}]uintptr), e) -} -func (_ fastpathT) EncMapIntfUintptrV(v map[interface{}]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfIntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfIntV(rv2i(rv).(map[interface{}]int), e) -} -func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfInt8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfInt8V(rv2i(rv).(map[interface{}]int8), e) -} -func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfInt16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfInt16V(rv2i(rv).(map[interface{}]int16), e) -} -func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfInt32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfInt32V(rv2i(rv).(map[interface{}]int32), e) -} -func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfInt64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfInt64V(rv2i(rv).(map[interface{}]int64), e) -} -func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfFloat32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfFloat32V(rv2i(rv).(map[interface{}]float32), e) -} -func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfFloat64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfFloat64V(rv2i(rv).(map[interface{}]float64), e) -} -func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntfBoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntfBoolV(rv2i(rv).(map[interface{}]bool), e) -} -func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.asis(v2[j].v) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e) -} -func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - e.encode(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringStringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringStringV(rv2i(rv).(map[string]string), e) -} -func (_ fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[string(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringUintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringUintV(rv2i(rv).(map[string]uint), e) -} -func (_ fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e) -} -func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringUint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringUint16V(rv2i(rv).(map[string]uint16), e) -} -func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringUint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringUint32V(rv2i(rv).(map[string]uint32), e) -} -func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringUint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringUint64V(rv2i(rv).(map[string]uint64), e) -} -func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringUintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringUintptrV(rv2i(rv).(map[string]uintptr), e) -} -func (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - e.encode(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringIntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringIntV(rv2i(rv).(map[string]int), e) -} -func (_ fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringInt8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringInt8V(rv2i(rv).(map[string]int8), e) -} -func (_ fastpathT) EncMapStringInt8V(v map[string]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringInt16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringInt16V(rv2i(rv).(map[string]int16), e) -} -func (_ fastpathT) EncMapStringInt16V(v map[string]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringInt32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringInt32V(rv2i(rv).(map[string]int32), e) -} -func (_ fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringInt64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringInt64V(rv2i(rv).(map[string]int64), e) -} -func (_ fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringFloat32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringFloat32V(rv2i(rv).(map[string]float32), e) -} -func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e) -} -func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapStringBoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapStringBoolV(rv2i(rv).(map[string]bool), e) -} -func (_ fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32IntfV(rv2i(rv).(map[float32]interface{}), e) -} -func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32StringV(rv2i(rv).(map[float32]string), e) -} -func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32UintV(rv2i(rv).(map[float32]uint), e) -} -func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Uint8V(rv2i(rv).(map[float32]uint8), e) -} -func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Uint16V(rv2i(rv).(map[float32]uint16), e) -} -func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Uint32V(rv2i(rv).(map[float32]uint32), e) -} -func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Uint64V(rv2i(rv).(map[float32]uint64), e) -} -func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32UintptrV(rv2i(rv).(map[float32]uintptr), e) -} -func (_ fastpathT) EncMapFloat32UintptrV(v map[float32]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32IntV(rv2i(rv).(map[float32]int), e) -} -func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Int8V(rv2i(rv).(map[float32]int8), e) -} -func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Int16V(rv2i(rv).(map[float32]int16), e) -} -func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Int32V(rv2i(rv).(map[float32]int32), e) -} -func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Int64V(rv2i(rv).(map[float32]int64), e) -} -func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Float32V(rv2i(rv).(map[float32]float32), e) -} -func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32Float64V(rv2i(rv).(map[float32]float64), e) -} -func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat32BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat32BoolV(rv2i(rv).(map[float32]bool), e) -} -func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(float32(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat32(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64IntfV(rv2i(rv).(map[float64]interface{}), e) -} -func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64StringV(rv2i(rv).(map[float64]string), e) -} -func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64UintV(rv2i(rv).(map[float64]uint), e) -} -func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Uint8V(rv2i(rv).(map[float64]uint8), e) -} -func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Uint16V(rv2i(rv).(map[float64]uint16), e) -} -func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Uint32V(rv2i(rv).(map[float64]uint32), e) -} -func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Uint64V(rv2i(rv).(map[float64]uint64), e) -} -func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64UintptrV(rv2i(rv).(map[float64]uintptr), e) -} -func (_ fastpathT) EncMapFloat64UintptrV(v map[float64]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64IntV(rv2i(rv).(map[float64]int), e) -} -func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Int8V(rv2i(rv).(map[float64]int8), e) -} -func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Int16V(rv2i(rv).(map[float64]int16), e) -} -func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Int32V(rv2i(rv).(map[float64]int32), e) -} -func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Int64V(rv2i(rv).(map[float64]int64), e) -} -func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Float32V(rv2i(rv).(map[float64]float32), e) -} -func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64Float64V(rv2i(rv).(map[float64]float64), e) -} -func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapFloat64BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapFloat64BoolV(rv2i(rv).(map[float64]bool), e) -} -func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(float64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeFloat64(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintIntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintIntfV(rv2i(rv).(map[uint]interface{}), e) -} -func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintStringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintStringV(rv2i(rv).(map[uint]string), e) -} -func (_ fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintUintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintUintV(rv2i(rv).(map[uint]uint), e) -} -func (_ fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintUint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintUint8V(rv2i(rv).(map[uint]uint8), e) -} -func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintUint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintUint16V(rv2i(rv).(map[uint]uint16), e) -} -func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintUint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintUint32V(rv2i(rv).(map[uint]uint32), e) -} -func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintUint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintUint64V(rv2i(rv).(map[uint]uint64), e) -} -func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintUintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintUintptrV(rv2i(rv).(map[uint]uintptr), e) -} -func (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintIntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintIntV(rv2i(rv).(map[uint]int), e) -} -func (_ fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintInt8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintInt8V(rv2i(rv).(map[uint]int8), e) -} -func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintInt16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintInt16V(rv2i(rv).(map[uint]int16), e) -} -func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintInt32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintInt32V(rv2i(rv).(map[uint]int32), e) -} -func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintInt64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintInt64V(rv2i(rv).(map[uint]int64), e) -} -func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintFloat32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintFloat32V(rv2i(rv).(map[uint]float32), e) -} -func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintFloat64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintFloat64V(rv2i(rv).(map[uint]float64), e) -} -func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintBoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintBoolV(rv2i(rv).(map[uint]bool), e) -} -func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e) -} -func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8StringV(rv2i(rv).(map[uint8]string), e) -} -func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8UintV(rv2i(rv).(map[uint8]uint), e) -} -func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e) -} -func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Uint16V(rv2i(rv).(map[uint8]uint16), e) -} -func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Uint32V(rv2i(rv).(map[uint8]uint32), e) -} -func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), e) -} -func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), e) -} -func (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8IntV(rv2i(rv).(map[uint8]int), e) -} -func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Int8V(rv2i(rv).(map[uint8]int8), e) -} -func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Int16V(rv2i(rv).(map[uint8]int16), e) -} -func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Int32V(rv2i(rv).(map[uint8]int32), e) -} -func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Int64V(rv2i(rv).(map[uint8]int64), e) -} -func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Float32V(rv2i(rv).(map[uint8]float32), e) -} -func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8Float64V(rv2i(rv).(map[uint8]float64), e) -} -func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint8BoolV(rv2i(rv).(map[uint8]bool), e) -} -func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16IntfV(rv2i(rv).(map[uint16]interface{}), e) -} -func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16StringV(rv2i(rv).(map[uint16]string), e) -} -func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16UintV(rv2i(rv).(map[uint16]uint), e) -} -func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Uint8V(rv2i(rv).(map[uint16]uint8), e) -} -func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Uint16V(rv2i(rv).(map[uint16]uint16), e) -} -func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Uint32V(rv2i(rv).(map[uint16]uint32), e) -} -func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Uint64V(rv2i(rv).(map[uint16]uint64), e) -} -func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16UintptrV(rv2i(rv).(map[uint16]uintptr), e) -} -func (_ fastpathT) EncMapUint16UintptrV(v map[uint16]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16IntV(rv2i(rv).(map[uint16]int), e) -} -func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Int8V(rv2i(rv).(map[uint16]int8), e) -} -func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Int16V(rv2i(rv).(map[uint16]int16), e) -} -func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Int32V(rv2i(rv).(map[uint16]int32), e) -} -func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Int64V(rv2i(rv).(map[uint16]int64), e) -} -func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Float32V(rv2i(rv).(map[uint16]float32), e) -} -func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16Float64V(rv2i(rv).(map[uint16]float64), e) -} -func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint16BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint16BoolV(rv2i(rv).(map[uint16]bool), e) -} -func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32IntfV(rv2i(rv).(map[uint32]interface{}), e) -} -func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32StringV(rv2i(rv).(map[uint32]string), e) -} -func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32UintV(rv2i(rv).(map[uint32]uint), e) -} -func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Uint8V(rv2i(rv).(map[uint32]uint8), e) -} -func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Uint16V(rv2i(rv).(map[uint32]uint16), e) -} -func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Uint32V(rv2i(rv).(map[uint32]uint32), e) -} -func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Uint64V(rv2i(rv).(map[uint32]uint64), e) -} -func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32UintptrV(rv2i(rv).(map[uint32]uintptr), e) -} -func (_ fastpathT) EncMapUint32UintptrV(v map[uint32]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32IntV(rv2i(rv).(map[uint32]int), e) -} -func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Int8V(rv2i(rv).(map[uint32]int8), e) -} -func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Int16V(rv2i(rv).(map[uint32]int16), e) -} -func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Int32V(rv2i(rv).(map[uint32]int32), e) -} -func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Int64V(rv2i(rv).(map[uint32]int64), e) -} -func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Float32V(rv2i(rv).(map[uint32]float32), e) -} -func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32Float64V(rv2i(rv).(map[uint32]float64), e) -} -func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint32BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint32BoolV(rv2i(rv).(map[uint32]bool), e) -} -func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), e) -} -func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64StringV(rv2i(rv).(map[uint64]string), e) -} -func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64UintV(rv2i(rv).(map[uint64]uint), e) -} -func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e) -} -func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Uint16V(rv2i(rv).(map[uint64]uint16), e) -} -func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Uint32V(rv2i(rv).(map[uint64]uint32), e) -} -func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), e) -} -func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), e) -} -func (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64IntV(rv2i(rv).(map[uint64]int), e) -} -func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Int8V(rv2i(rv).(map[uint64]int8), e) -} -func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Int16V(rv2i(rv).(map[uint64]int16), e) -} -func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Int32V(rv2i(rv).(map[uint64]int32), e) -} -func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Int64V(rv2i(rv).(map[uint64]int64), e) -} -func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Float32V(rv2i(rv).(map[uint64]float32), e) -} -func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64Float64V(rv2i(rv).(map[uint64]float64), e) -} -func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUint64BoolV(rv2i(rv).(map[uint64]bool), e) -} -func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(uint64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeUint(uint64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), e) -} -func (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrStringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrStringV(rv2i(rv).(map[uintptr]string), e) -} -func (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrUintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrUintV(rv2i(rv).(map[uintptr]uint), e) -} -func (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), e) -} -func (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrUint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrUint16V(rv2i(rv).(map[uintptr]uint16), e) -} -func (_ fastpathT) EncMapUintptrUint16V(v map[uintptr]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrUint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrUint32V(rv2i(rv).(map[uintptr]uint32), e) -} -func (_ fastpathT) EncMapUintptrUint32V(v map[uintptr]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), e) -} -func (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), e) -} -func (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrIntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrIntV(rv2i(rv).(map[uintptr]int), e) -} -func (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrInt8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrInt8V(rv2i(rv).(map[uintptr]int8), e) -} -func (_ fastpathT) EncMapUintptrInt8V(v map[uintptr]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrInt16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrInt16V(rv2i(rv).(map[uintptr]int16), e) -} -func (_ fastpathT) EncMapUintptrInt16V(v map[uintptr]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrInt32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrInt32V(rv2i(rv).(map[uintptr]int32), e) -} -func (_ fastpathT) EncMapUintptrInt32V(v map[uintptr]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), e) -} -func (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), e) -} -func (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), e) -} -func (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), e) -} -func (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - e.encode(uintptr(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - e.encode(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntIntfV(rv2i(rv).(map[int]interface{}), e) -} -func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntStringV(rv2i(rv).(map[int]string), e) -} -func (_ fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[int(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntUintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntUintV(rv2i(rv).(map[int]uint), e) -} -func (_ fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e) -} -func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntUint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntUint16V(rv2i(rv).(map[int]uint16), e) -} -func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntUint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntUint32V(rv2i(rv).(map[int]uint32), e) -} -func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntUint64V(rv2i(rv).(map[int]uint64), e) -} -func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntUintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntUintptrV(rv2i(rv).(map[int]uintptr), e) -} -func (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntIntV(rv2i(rv).(map[int]int), e) -} -func (_ fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntInt8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntInt8V(rv2i(rv).(map[int]int8), e) -} -func (_ fastpathT) EncMapIntInt8V(v map[int]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntInt16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntInt16V(rv2i(rv).(map[int]int16), e) -} -func (_ fastpathT) EncMapIntInt16V(v map[int]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntInt32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntInt32V(rv2i(rv).(map[int]int32), e) -} -func (_ fastpathT) EncMapIntInt32V(v map[int]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntInt64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntInt64V(rv2i(rv).(map[int]int64), e) -} -func (_ fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntFloat32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntFloat32V(rv2i(rv).(map[int]float32), e) -} -func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntFloat64V(rv2i(rv).(map[int]float64), e) -} -func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapIntBoolV(rv2i(rv).(map[int]bool), e) -} -func (_ fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8IntfV(rv2i(rv).(map[int8]interface{}), e) -} -func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8StringV(rv2i(rv).(map[int8]string), e) -} -func (_ fastpathT) EncMapInt8StringV(v map[int8]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8UintV(rv2i(rv).(map[int8]uint), e) -} -func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Uint8V(rv2i(rv).(map[int8]uint8), e) -} -func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Uint16V(rv2i(rv).(map[int8]uint16), e) -} -func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Uint32V(rv2i(rv).(map[int8]uint32), e) -} -func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Uint64V(rv2i(rv).(map[int8]uint64), e) -} -func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8UintptrV(rv2i(rv).(map[int8]uintptr), e) -} -func (_ fastpathT) EncMapInt8UintptrV(v map[int8]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8IntV(rv2i(rv).(map[int8]int), e) -} -func (_ fastpathT) EncMapInt8IntV(v map[int8]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Int8V(rv2i(rv).(map[int8]int8), e) -} -func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Int16V(rv2i(rv).(map[int8]int16), e) -} -func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Int32V(rv2i(rv).(map[int8]int32), e) -} -func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Int64V(rv2i(rv).(map[int8]int64), e) -} -func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Float32V(rv2i(rv).(map[int8]float32), e) -} -func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8Float64V(rv2i(rv).(map[int8]float64), e) -} -func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt8BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt8BoolV(rv2i(rv).(map[int8]bool), e) -} -func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int8(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16IntfV(rv2i(rv).(map[int16]interface{}), e) -} -func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16StringV(rv2i(rv).(map[int16]string), e) -} -func (_ fastpathT) EncMapInt16StringV(v map[int16]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16UintV(rv2i(rv).(map[int16]uint), e) -} -func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Uint8V(rv2i(rv).(map[int16]uint8), e) -} -func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Uint16V(rv2i(rv).(map[int16]uint16), e) -} -func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Uint32V(rv2i(rv).(map[int16]uint32), e) -} -func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Uint64V(rv2i(rv).(map[int16]uint64), e) -} -func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16UintptrV(rv2i(rv).(map[int16]uintptr), e) -} -func (_ fastpathT) EncMapInt16UintptrV(v map[int16]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16IntV(rv2i(rv).(map[int16]int), e) -} -func (_ fastpathT) EncMapInt16IntV(v map[int16]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Int8V(rv2i(rv).(map[int16]int8), e) -} -func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Int16V(rv2i(rv).(map[int16]int16), e) -} -func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Int32V(rv2i(rv).(map[int16]int32), e) -} -func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Int64V(rv2i(rv).(map[int16]int64), e) -} -func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Float32V(rv2i(rv).(map[int16]float32), e) -} -func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16Float64V(rv2i(rv).(map[int16]float64), e) -} -func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt16BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt16BoolV(rv2i(rv).(map[int16]bool), e) -} -func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int16(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32IntfV(rv2i(rv).(map[int32]interface{}), e) -} -func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32StringV(rv2i(rv).(map[int32]string), e) -} -func (_ fastpathT) EncMapInt32StringV(v map[int32]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32UintV(rv2i(rv).(map[int32]uint), e) -} -func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Uint8V(rv2i(rv).(map[int32]uint8), e) -} -func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Uint16V(rv2i(rv).(map[int32]uint16), e) -} -func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Uint32V(rv2i(rv).(map[int32]uint32), e) -} -func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Uint64V(rv2i(rv).(map[int32]uint64), e) -} -func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32UintptrV(rv2i(rv).(map[int32]uintptr), e) -} -func (_ fastpathT) EncMapInt32UintptrV(v map[int32]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32IntV(rv2i(rv).(map[int32]int), e) -} -func (_ fastpathT) EncMapInt32IntV(v map[int32]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Int8V(rv2i(rv).(map[int32]int8), e) -} -func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Int16V(rv2i(rv).(map[int32]int16), e) -} -func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Int32V(rv2i(rv).(map[int32]int32), e) -} -func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Int64V(rv2i(rv).(map[int32]int64), e) -} -func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Float32V(rv2i(rv).(map[int32]float32), e) -} -func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32Float64V(rv2i(rv).(map[int32]float64), e) -} -func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt32BoolV(rv2i(rv).(map[int32]bool), e) -} -func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int32(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64IntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64IntfV(rv2i(rv).(map[int64]interface{}), e) -} -func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64StringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64StringV(rv2i(rv).(map[int64]string), e) -} -func (_ fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64UintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64UintV(rv2i(rv).(map[int64]uint), e) -} -func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Uint8V(rv2i(rv).(map[int64]uint8), e) -} -func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Uint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Uint16V(rv2i(rv).(map[int64]uint16), e) -} -func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Uint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Uint32V(rv2i(rv).(map[int64]uint32), e) -} -func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Uint64V(rv2i(rv).(map[int64]uint64), e) -} -func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), e) -} -func (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64IntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64IntV(rv2i(rv).(map[int64]int), e) -} -func (_ fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Int8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Int8V(rv2i(rv).(map[int64]int8), e) -} -func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Int16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Int16V(rv2i(rv).(map[int64]int16), e) -} -func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Int32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Int32V(rv2i(rv).(map[int64]int32), e) -} -func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Int64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Int64V(rv2i(rv).(map[int64]int64), e) -} -func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Float32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Float32V(rv2i(rv).(map[int64]float32), e) -} -func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64Float64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64Float64V(rv2i(rv).(map[int64]float64), e) -} -func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapInt64BoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapInt64BoolV(rv2i(rv).(map[int64]bool), e) -} -func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(int64(k2))) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeInt(int64(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolIntfR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolIntfV(rv2i(rv).(map[bool]interface{}), e) -} -func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolStringR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolStringV(rv2i(rv).(map[bool]string), e) -} -func (_ fastpathT) EncMapBoolStringV(v map[bool]string, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeString(c_UTF8, v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolUintR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolUintV(rv2i(rv).(map[bool]uint), e) -} -func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolUint8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolUint8V(rv2i(rv).(map[bool]uint8), e) -} -func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolUint16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolUint16V(rv2i(rv).(map[bool]uint16), e) -} -func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolUint32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolUint32V(rv2i(rv).(map[bool]uint32), e) -} -func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolUint64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolUint64V(rv2i(rv).(map[bool]uint64), e) -} -func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeUint(uint64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolUintptrR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolUintptrV(rv2i(rv).(map[bool]uintptr), e) -} -func (_ fastpathT) EncMapBoolUintptrV(v map[bool]uintptr, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - e.encode(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - e.encode(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolIntR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolIntV(rv2i(rv).(map[bool]int), e) -} -func (_ fastpathT) EncMapBoolIntV(v map[bool]int, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolInt8R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolInt8V(rv2i(rv).(map[bool]int8), e) -} -func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolInt16R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolInt16V(rv2i(rv).(map[bool]int16), e) -} -func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolInt32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolInt32V(rv2i(rv).(map[bool]int32), e) -} -func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolInt64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolInt64V(rv2i(rv).(map[bool]int64), e) -} -func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeInt(int64(v2)) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolFloat32R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolFloat32V(rv2i(rv).(map[bool]float32), e) -} -func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat32(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolFloat64R(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolFloat64V(rv2i(rv).(map[bool]float64), e) -} -func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeFloat64(v2) - } - } - ee.WriteMapEnd() -} - -func (e *Encoder) fastpathEncMapBoolBoolR(f *codecFnInfo, rv reflect.Value) { - fastpathTV.EncMapBoolBoolV(rv2i(rv).(map[bool]bool), e) -} -func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, e *Encoder) { - ee, esep := e.e, e.hh.hasElemSeparators() - ee.WriteMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(bool(k2)) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if esep { - ee.WriteMapElemKey() - } - ee.EncodeBool(k2) - if esep { - ee.WriteMapElemValue() - } - ee.EncodeBool(v2) - } - } - ee.WriteMapEnd() -} - -// -- decode - -// -- -- fast path type switch -func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { - switch v := iv.(type) { - - case []interface{}: - fastpathTV.DecSliceIntfV(v, false, d) - case *[]interface{}: - if v2, changed2 := fastpathTV.DecSliceIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]interface{}: - fastpathTV.DecMapIntfIntfV(v, false, d) - case *map[interface{}]interface{}: - if v2, changed2 := fastpathTV.DecMapIntfIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]string: - fastpathTV.DecMapIntfStringV(v, false, d) - case *map[interface{}]string: - if v2, changed2 := fastpathTV.DecMapIntfStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]uint: - fastpathTV.DecMapIntfUintV(v, false, d) - case *map[interface{}]uint: - if v2, changed2 := fastpathTV.DecMapIntfUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]uint8: - fastpathTV.DecMapIntfUint8V(v, false, d) - case *map[interface{}]uint8: - if v2, changed2 := fastpathTV.DecMapIntfUint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]uint16: - fastpathTV.DecMapIntfUint16V(v, false, d) - case *map[interface{}]uint16: - if v2, changed2 := fastpathTV.DecMapIntfUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]uint32: - fastpathTV.DecMapIntfUint32V(v, false, d) - case *map[interface{}]uint32: - if v2, changed2 := fastpathTV.DecMapIntfUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]uint64: - fastpathTV.DecMapIntfUint64V(v, false, d) - case *map[interface{}]uint64: - if v2, changed2 := fastpathTV.DecMapIntfUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]uintptr: - fastpathTV.DecMapIntfUintptrV(v, false, d) - case *map[interface{}]uintptr: - if v2, changed2 := fastpathTV.DecMapIntfUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]int: - fastpathTV.DecMapIntfIntV(v, false, d) - case *map[interface{}]int: - if v2, changed2 := fastpathTV.DecMapIntfIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]int8: - fastpathTV.DecMapIntfInt8V(v, false, d) - case *map[interface{}]int8: - if v2, changed2 := fastpathTV.DecMapIntfInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]int16: - fastpathTV.DecMapIntfInt16V(v, false, d) - case *map[interface{}]int16: - if v2, changed2 := fastpathTV.DecMapIntfInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]int32: - fastpathTV.DecMapIntfInt32V(v, false, d) - case *map[interface{}]int32: - if v2, changed2 := fastpathTV.DecMapIntfInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]int64: - fastpathTV.DecMapIntfInt64V(v, false, d) - case *map[interface{}]int64: - if v2, changed2 := fastpathTV.DecMapIntfInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]float32: - fastpathTV.DecMapIntfFloat32V(v, false, d) - case *map[interface{}]float32: - if v2, changed2 := fastpathTV.DecMapIntfFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]float64: - fastpathTV.DecMapIntfFloat64V(v, false, d) - case *map[interface{}]float64: - if v2, changed2 := fastpathTV.DecMapIntfFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[interface{}]bool: - fastpathTV.DecMapIntfBoolV(v, false, d) - case *map[interface{}]bool: - if v2, changed2 := fastpathTV.DecMapIntfBoolV(*v, true, d); changed2 { - *v = v2 - } - - case []string: - fastpathTV.DecSliceStringV(v, false, d) - case *[]string: - if v2, changed2 := fastpathTV.DecSliceStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[string]interface{}: - fastpathTV.DecMapStringIntfV(v, false, d) - case *map[string]interface{}: - if v2, changed2 := fastpathTV.DecMapStringIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[string]string: - fastpathTV.DecMapStringStringV(v, false, d) - case *map[string]string: - if v2, changed2 := fastpathTV.DecMapStringStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[string]uint: - fastpathTV.DecMapStringUintV(v, false, d) - case *map[string]uint: - if v2, changed2 := fastpathTV.DecMapStringUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[string]uint8: - fastpathTV.DecMapStringUint8V(v, false, d) - case *map[string]uint8: - if v2, changed2 := fastpathTV.DecMapStringUint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]uint16: - fastpathTV.DecMapStringUint16V(v, false, d) - case *map[string]uint16: - if v2, changed2 := fastpathTV.DecMapStringUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]uint32: - fastpathTV.DecMapStringUint32V(v, false, d) - case *map[string]uint32: - if v2, changed2 := fastpathTV.DecMapStringUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]uint64: - fastpathTV.DecMapStringUint64V(v, false, d) - case *map[string]uint64: - if v2, changed2 := fastpathTV.DecMapStringUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]uintptr: - fastpathTV.DecMapStringUintptrV(v, false, d) - case *map[string]uintptr: - if v2, changed2 := fastpathTV.DecMapStringUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[string]int: - fastpathTV.DecMapStringIntV(v, false, d) - case *map[string]int: - if v2, changed2 := fastpathTV.DecMapStringIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[string]int8: - fastpathTV.DecMapStringInt8V(v, false, d) - case *map[string]int8: - if v2, changed2 := fastpathTV.DecMapStringInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]int16: - fastpathTV.DecMapStringInt16V(v, false, d) - case *map[string]int16: - if v2, changed2 := fastpathTV.DecMapStringInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]int32: - fastpathTV.DecMapStringInt32V(v, false, d) - case *map[string]int32: - if v2, changed2 := fastpathTV.DecMapStringInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]int64: - fastpathTV.DecMapStringInt64V(v, false, d) - case *map[string]int64: - if v2, changed2 := fastpathTV.DecMapStringInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]float32: - fastpathTV.DecMapStringFloat32V(v, false, d) - case *map[string]float32: - if v2, changed2 := fastpathTV.DecMapStringFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]float64: - fastpathTV.DecMapStringFloat64V(v, false, d) - case *map[string]float64: - if v2, changed2 := fastpathTV.DecMapStringFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[string]bool: - fastpathTV.DecMapStringBoolV(v, false, d) - case *map[string]bool: - if v2, changed2 := fastpathTV.DecMapStringBoolV(*v, true, d); changed2 { - *v = v2 - } - - case []float32: - fastpathTV.DecSliceFloat32V(v, false, d) - case *[]float32: - if v2, changed2 := fastpathTV.DecSliceFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]interface{}: - fastpathTV.DecMapFloat32IntfV(v, false, d) - case *map[float32]interface{}: - if v2, changed2 := fastpathTV.DecMapFloat32IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]string: - fastpathTV.DecMapFloat32StringV(v, false, d) - case *map[float32]string: - if v2, changed2 := fastpathTV.DecMapFloat32StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]uint: - fastpathTV.DecMapFloat32UintV(v, false, d) - case *map[float32]uint: - if v2, changed2 := fastpathTV.DecMapFloat32UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]uint8: - fastpathTV.DecMapFloat32Uint8V(v, false, d) - case *map[float32]uint8: - if v2, changed2 := fastpathTV.DecMapFloat32Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]uint16: - fastpathTV.DecMapFloat32Uint16V(v, false, d) - case *map[float32]uint16: - if v2, changed2 := fastpathTV.DecMapFloat32Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]uint32: - fastpathTV.DecMapFloat32Uint32V(v, false, d) - case *map[float32]uint32: - if v2, changed2 := fastpathTV.DecMapFloat32Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]uint64: - fastpathTV.DecMapFloat32Uint64V(v, false, d) - case *map[float32]uint64: - if v2, changed2 := fastpathTV.DecMapFloat32Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]uintptr: - fastpathTV.DecMapFloat32UintptrV(v, false, d) - case *map[float32]uintptr: - if v2, changed2 := fastpathTV.DecMapFloat32UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]int: - fastpathTV.DecMapFloat32IntV(v, false, d) - case *map[float32]int: - if v2, changed2 := fastpathTV.DecMapFloat32IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]int8: - fastpathTV.DecMapFloat32Int8V(v, false, d) - case *map[float32]int8: - if v2, changed2 := fastpathTV.DecMapFloat32Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]int16: - fastpathTV.DecMapFloat32Int16V(v, false, d) - case *map[float32]int16: - if v2, changed2 := fastpathTV.DecMapFloat32Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]int32: - fastpathTV.DecMapFloat32Int32V(v, false, d) - case *map[float32]int32: - if v2, changed2 := fastpathTV.DecMapFloat32Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]int64: - fastpathTV.DecMapFloat32Int64V(v, false, d) - case *map[float32]int64: - if v2, changed2 := fastpathTV.DecMapFloat32Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]float32: - fastpathTV.DecMapFloat32Float32V(v, false, d) - case *map[float32]float32: - if v2, changed2 := fastpathTV.DecMapFloat32Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]float64: - fastpathTV.DecMapFloat32Float64V(v, false, d) - case *map[float32]float64: - if v2, changed2 := fastpathTV.DecMapFloat32Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float32]bool: - fastpathTV.DecMapFloat32BoolV(v, false, d) - case *map[float32]bool: - if v2, changed2 := fastpathTV.DecMapFloat32BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []float64: - fastpathTV.DecSliceFloat64V(v, false, d) - case *[]float64: - if v2, changed2 := fastpathTV.DecSliceFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]interface{}: - fastpathTV.DecMapFloat64IntfV(v, false, d) - case *map[float64]interface{}: - if v2, changed2 := fastpathTV.DecMapFloat64IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]string: - fastpathTV.DecMapFloat64StringV(v, false, d) - case *map[float64]string: - if v2, changed2 := fastpathTV.DecMapFloat64StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]uint: - fastpathTV.DecMapFloat64UintV(v, false, d) - case *map[float64]uint: - if v2, changed2 := fastpathTV.DecMapFloat64UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]uint8: - fastpathTV.DecMapFloat64Uint8V(v, false, d) - case *map[float64]uint8: - if v2, changed2 := fastpathTV.DecMapFloat64Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]uint16: - fastpathTV.DecMapFloat64Uint16V(v, false, d) - case *map[float64]uint16: - if v2, changed2 := fastpathTV.DecMapFloat64Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]uint32: - fastpathTV.DecMapFloat64Uint32V(v, false, d) - case *map[float64]uint32: - if v2, changed2 := fastpathTV.DecMapFloat64Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]uint64: - fastpathTV.DecMapFloat64Uint64V(v, false, d) - case *map[float64]uint64: - if v2, changed2 := fastpathTV.DecMapFloat64Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]uintptr: - fastpathTV.DecMapFloat64UintptrV(v, false, d) - case *map[float64]uintptr: - if v2, changed2 := fastpathTV.DecMapFloat64UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]int: - fastpathTV.DecMapFloat64IntV(v, false, d) - case *map[float64]int: - if v2, changed2 := fastpathTV.DecMapFloat64IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]int8: - fastpathTV.DecMapFloat64Int8V(v, false, d) - case *map[float64]int8: - if v2, changed2 := fastpathTV.DecMapFloat64Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]int16: - fastpathTV.DecMapFloat64Int16V(v, false, d) - case *map[float64]int16: - if v2, changed2 := fastpathTV.DecMapFloat64Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]int32: - fastpathTV.DecMapFloat64Int32V(v, false, d) - case *map[float64]int32: - if v2, changed2 := fastpathTV.DecMapFloat64Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]int64: - fastpathTV.DecMapFloat64Int64V(v, false, d) - case *map[float64]int64: - if v2, changed2 := fastpathTV.DecMapFloat64Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]float32: - fastpathTV.DecMapFloat64Float32V(v, false, d) - case *map[float64]float32: - if v2, changed2 := fastpathTV.DecMapFloat64Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]float64: - fastpathTV.DecMapFloat64Float64V(v, false, d) - case *map[float64]float64: - if v2, changed2 := fastpathTV.DecMapFloat64Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[float64]bool: - fastpathTV.DecMapFloat64BoolV(v, false, d) - case *map[float64]bool: - if v2, changed2 := fastpathTV.DecMapFloat64BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []uint: - fastpathTV.DecSliceUintV(v, false, d) - case *[]uint: - if v2, changed2 := fastpathTV.DecSliceUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]interface{}: - fastpathTV.DecMapUintIntfV(v, false, d) - case *map[uint]interface{}: - if v2, changed2 := fastpathTV.DecMapUintIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]string: - fastpathTV.DecMapUintStringV(v, false, d) - case *map[uint]string: - if v2, changed2 := fastpathTV.DecMapUintStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]uint: - fastpathTV.DecMapUintUintV(v, false, d) - case *map[uint]uint: - if v2, changed2 := fastpathTV.DecMapUintUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]uint8: - fastpathTV.DecMapUintUint8V(v, false, d) - case *map[uint]uint8: - if v2, changed2 := fastpathTV.DecMapUintUint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]uint16: - fastpathTV.DecMapUintUint16V(v, false, d) - case *map[uint]uint16: - if v2, changed2 := fastpathTV.DecMapUintUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]uint32: - fastpathTV.DecMapUintUint32V(v, false, d) - case *map[uint]uint32: - if v2, changed2 := fastpathTV.DecMapUintUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]uint64: - fastpathTV.DecMapUintUint64V(v, false, d) - case *map[uint]uint64: - if v2, changed2 := fastpathTV.DecMapUintUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]uintptr: - fastpathTV.DecMapUintUintptrV(v, false, d) - case *map[uint]uintptr: - if v2, changed2 := fastpathTV.DecMapUintUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]int: - fastpathTV.DecMapUintIntV(v, false, d) - case *map[uint]int: - if v2, changed2 := fastpathTV.DecMapUintIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]int8: - fastpathTV.DecMapUintInt8V(v, false, d) - case *map[uint]int8: - if v2, changed2 := fastpathTV.DecMapUintInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]int16: - fastpathTV.DecMapUintInt16V(v, false, d) - case *map[uint]int16: - if v2, changed2 := fastpathTV.DecMapUintInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]int32: - fastpathTV.DecMapUintInt32V(v, false, d) - case *map[uint]int32: - if v2, changed2 := fastpathTV.DecMapUintInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]int64: - fastpathTV.DecMapUintInt64V(v, false, d) - case *map[uint]int64: - if v2, changed2 := fastpathTV.DecMapUintInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]float32: - fastpathTV.DecMapUintFloat32V(v, false, d) - case *map[uint]float32: - if v2, changed2 := fastpathTV.DecMapUintFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]float64: - fastpathTV.DecMapUintFloat64V(v, false, d) - case *map[uint]float64: - if v2, changed2 := fastpathTV.DecMapUintFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint]bool: - fastpathTV.DecMapUintBoolV(v, false, d) - case *map[uint]bool: - if v2, changed2 := fastpathTV.DecMapUintBoolV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]interface{}: - fastpathTV.DecMapUint8IntfV(v, false, d) - case *map[uint8]interface{}: - if v2, changed2 := fastpathTV.DecMapUint8IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]string: - fastpathTV.DecMapUint8StringV(v, false, d) - case *map[uint8]string: - if v2, changed2 := fastpathTV.DecMapUint8StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]uint: - fastpathTV.DecMapUint8UintV(v, false, d) - case *map[uint8]uint: - if v2, changed2 := fastpathTV.DecMapUint8UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]uint8: - fastpathTV.DecMapUint8Uint8V(v, false, d) - case *map[uint8]uint8: - if v2, changed2 := fastpathTV.DecMapUint8Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]uint16: - fastpathTV.DecMapUint8Uint16V(v, false, d) - case *map[uint8]uint16: - if v2, changed2 := fastpathTV.DecMapUint8Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]uint32: - fastpathTV.DecMapUint8Uint32V(v, false, d) - case *map[uint8]uint32: - if v2, changed2 := fastpathTV.DecMapUint8Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]uint64: - fastpathTV.DecMapUint8Uint64V(v, false, d) - case *map[uint8]uint64: - if v2, changed2 := fastpathTV.DecMapUint8Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]uintptr: - fastpathTV.DecMapUint8UintptrV(v, false, d) - case *map[uint8]uintptr: - if v2, changed2 := fastpathTV.DecMapUint8UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]int: - fastpathTV.DecMapUint8IntV(v, false, d) - case *map[uint8]int: - if v2, changed2 := fastpathTV.DecMapUint8IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]int8: - fastpathTV.DecMapUint8Int8V(v, false, d) - case *map[uint8]int8: - if v2, changed2 := fastpathTV.DecMapUint8Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]int16: - fastpathTV.DecMapUint8Int16V(v, false, d) - case *map[uint8]int16: - if v2, changed2 := fastpathTV.DecMapUint8Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]int32: - fastpathTV.DecMapUint8Int32V(v, false, d) - case *map[uint8]int32: - if v2, changed2 := fastpathTV.DecMapUint8Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]int64: - fastpathTV.DecMapUint8Int64V(v, false, d) - case *map[uint8]int64: - if v2, changed2 := fastpathTV.DecMapUint8Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]float32: - fastpathTV.DecMapUint8Float32V(v, false, d) - case *map[uint8]float32: - if v2, changed2 := fastpathTV.DecMapUint8Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]float64: - fastpathTV.DecMapUint8Float64V(v, false, d) - case *map[uint8]float64: - if v2, changed2 := fastpathTV.DecMapUint8Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint8]bool: - fastpathTV.DecMapUint8BoolV(v, false, d) - case *map[uint8]bool: - if v2, changed2 := fastpathTV.DecMapUint8BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []uint16: - fastpathTV.DecSliceUint16V(v, false, d) - case *[]uint16: - if v2, changed2 := fastpathTV.DecSliceUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]interface{}: - fastpathTV.DecMapUint16IntfV(v, false, d) - case *map[uint16]interface{}: - if v2, changed2 := fastpathTV.DecMapUint16IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]string: - fastpathTV.DecMapUint16StringV(v, false, d) - case *map[uint16]string: - if v2, changed2 := fastpathTV.DecMapUint16StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]uint: - fastpathTV.DecMapUint16UintV(v, false, d) - case *map[uint16]uint: - if v2, changed2 := fastpathTV.DecMapUint16UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]uint8: - fastpathTV.DecMapUint16Uint8V(v, false, d) - case *map[uint16]uint8: - if v2, changed2 := fastpathTV.DecMapUint16Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]uint16: - fastpathTV.DecMapUint16Uint16V(v, false, d) - case *map[uint16]uint16: - if v2, changed2 := fastpathTV.DecMapUint16Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]uint32: - fastpathTV.DecMapUint16Uint32V(v, false, d) - case *map[uint16]uint32: - if v2, changed2 := fastpathTV.DecMapUint16Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]uint64: - fastpathTV.DecMapUint16Uint64V(v, false, d) - case *map[uint16]uint64: - if v2, changed2 := fastpathTV.DecMapUint16Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]uintptr: - fastpathTV.DecMapUint16UintptrV(v, false, d) - case *map[uint16]uintptr: - if v2, changed2 := fastpathTV.DecMapUint16UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]int: - fastpathTV.DecMapUint16IntV(v, false, d) - case *map[uint16]int: - if v2, changed2 := fastpathTV.DecMapUint16IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]int8: - fastpathTV.DecMapUint16Int8V(v, false, d) - case *map[uint16]int8: - if v2, changed2 := fastpathTV.DecMapUint16Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]int16: - fastpathTV.DecMapUint16Int16V(v, false, d) - case *map[uint16]int16: - if v2, changed2 := fastpathTV.DecMapUint16Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]int32: - fastpathTV.DecMapUint16Int32V(v, false, d) - case *map[uint16]int32: - if v2, changed2 := fastpathTV.DecMapUint16Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]int64: - fastpathTV.DecMapUint16Int64V(v, false, d) - case *map[uint16]int64: - if v2, changed2 := fastpathTV.DecMapUint16Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]float32: - fastpathTV.DecMapUint16Float32V(v, false, d) - case *map[uint16]float32: - if v2, changed2 := fastpathTV.DecMapUint16Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]float64: - fastpathTV.DecMapUint16Float64V(v, false, d) - case *map[uint16]float64: - if v2, changed2 := fastpathTV.DecMapUint16Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint16]bool: - fastpathTV.DecMapUint16BoolV(v, false, d) - case *map[uint16]bool: - if v2, changed2 := fastpathTV.DecMapUint16BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []uint32: - fastpathTV.DecSliceUint32V(v, false, d) - case *[]uint32: - if v2, changed2 := fastpathTV.DecSliceUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]interface{}: - fastpathTV.DecMapUint32IntfV(v, false, d) - case *map[uint32]interface{}: - if v2, changed2 := fastpathTV.DecMapUint32IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]string: - fastpathTV.DecMapUint32StringV(v, false, d) - case *map[uint32]string: - if v2, changed2 := fastpathTV.DecMapUint32StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]uint: - fastpathTV.DecMapUint32UintV(v, false, d) - case *map[uint32]uint: - if v2, changed2 := fastpathTV.DecMapUint32UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]uint8: - fastpathTV.DecMapUint32Uint8V(v, false, d) - case *map[uint32]uint8: - if v2, changed2 := fastpathTV.DecMapUint32Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]uint16: - fastpathTV.DecMapUint32Uint16V(v, false, d) - case *map[uint32]uint16: - if v2, changed2 := fastpathTV.DecMapUint32Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]uint32: - fastpathTV.DecMapUint32Uint32V(v, false, d) - case *map[uint32]uint32: - if v2, changed2 := fastpathTV.DecMapUint32Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]uint64: - fastpathTV.DecMapUint32Uint64V(v, false, d) - case *map[uint32]uint64: - if v2, changed2 := fastpathTV.DecMapUint32Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]uintptr: - fastpathTV.DecMapUint32UintptrV(v, false, d) - case *map[uint32]uintptr: - if v2, changed2 := fastpathTV.DecMapUint32UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]int: - fastpathTV.DecMapUint32IntV(v, false, d) - case *map[uint32]int: - if v2, changed2 := fastpathTV.DecMapUint32IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]int8: - fastpathTV.DecMapUint32Int8V(v, false, d) - case *map[uint32]int8: - if v2, changed2 := fastpathTV.DecMapUint32Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]int16: - fastpathTV.DecMapUint32Int16V(v, false, d) - case *map[uint32]int16: - if v2, changed2 := fastpathTV.DecMapUint32Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]int32: - fastpathTV.DecMapUint32Int32V(v, false, d) - case *map[uint32]int32: - if v2, changed2 := fastpathTV.DecMapUint32Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]int64: - fastpathTV.DecMapUint32Int64V(v, false, d) - case *map[uint32]int64: - if v2, changed2 := fastpathTV.DecMapUint32Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]float32: - fastpathTV.DecMapUint32Float32V(v, false, d) - case *map[uint32]float32: - if v2, changed2 := fastpathTV.DecMapUint32Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]float64: - fastpathTV.DecMapUint32Float64V(v, false, d) - case *map[uint32]float64: - if v2, changed2 := fastpathTV.DecMapUint32Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint32]bool: - fastpathTV.DecMapUint32BoolV(v, false, d) - case *map[uint32]bool: - if v2, changed2 := fastpathTV.DecMapUint32BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []uint64: - fastpathTV.DecSliceUint64V(v, false, d) - case *[]uint64: - if v2, changed2 := fastpathTV.DecSliceUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]interface{}: - fastpathTV.DecMapUint64IntfV(v, false, d) - case *map[uint64]interface{}: - if v2, changed2 := fastpathTV.DecMapUint64IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]string: - fastpathTV.DecMapUint64StringV(v, false, d) - case *map[uint64]string: - if v2, changed2 := fastpathTV.DecMapUint64StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]uint: - fastpathTV.DecMapUint64UintV(v, false, d) - case *map[uint64]uint: - if v2, changed2 := fastpathTV.DecMapUint64UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]uint8: - fastpathTV.DecMapUint64Uint8V(v, false, d) - case *map[uint64]uint8: - if v2, changed2 := fastpathTV.DecMapUint64Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]uint16: - fastpathTV.DecMapUint64Uint16V(v, false, d) - case *map[uint64]uint16: - if v2, changed2 := fastpathTV.DecMapUint64Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]uint32: - fastpathTV.DecMapUint64Uint32V(v, false, d) - case *map[uint64]uint32: - if v2, changed2 := fastpathTV.DecMapUint64Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]uint64: - fastpathTV.DecMapUint64Uint64V(v, false, d) - case *map[uint64]uint64: - if v2, changed2 := fastpathTV.DecMapUint64Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]uintptr: - fastpathTV.DecMapUint64UintptrV(v, false, d) - case *map[uint64]uintptr: - if v2, changed2 := fastpathTV.DecMapUint64UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]int: - fastpathTV.DecMapUint64IntV(v, false, d) - case *map[uint64]int: - if v2, changed2 := fastpathTV.DecMapUint64IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]int8: - fastpathTV.DecMapUint64Int8V(v, false, d) - case *map[uint64]int8: - if v2, changed2 := fastpathTV.DecMapUint64Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]int16: - fastpathTV.DecMapUint64Int16V(v, false, d) - case *map[uint64]int16: - if v2, changed2 := fastpathTV.DecMapUint64Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]int32: - fastpathTV.DecMapUint64Int32V(v, false, d) - case *map[uint64]int32: - if v2, changed2 := fastpathTV.DecMapUint64Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]int64: - fastpathTV.DecMapUint64Int64V(v, false, d) - case *map[uint64]int64: - if v2, changed2 := fastpathTV.DecMapUint64Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]float32: - fastpathTV.DecMapUint64Float32V(v, false, d) - case *map[uint64]float32: - if v2, changed2 := fastpathTV.DecMapUint64Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]float64: - fastpathTV.DecMapUint64Float64V(v, false, d) - case *map[uint64]float64: - if v2, changed2 := fastpathTV.DecMapUint64Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uint64]bool: - fastpathTV.DecMapUint64BoolV(v, false, d) - case *map[uint64]bool: - if v2, changed2 := fastpathTV.DecMapUint64BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []uintptr: - fastpathTV.DecSliceUintptrV(v, false, d) - case *[]uintptr: - if v2, changed2 := fastpathTV.DecSliceUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]interface{}: - fastpathTV.DecMapUintptrIntfV(v, false, d) - case *map[uintptr]interface{}: - if v2, changed2 := fastpathTV.DecMapUintptrIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]string: - fastpathTV.DecMapUintptrStringV(v, false, d) - case *map[uintptr]string: - if v2, changed2 := fastpathTV.DecMapUintptrStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]uint: - fastpathTV.DecMapUintptrUintV(v, false, d) - case *map[uintptr]uint: - if v2, changed2 := fastpathTV.DecMapUintptrUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]uint8: - fastpathTV.DecMapUintptrUint8V(v, false, d) - case *map[uintptr]uint8: - if v2, changed2 := fastpathTV.DecMapUintptrUint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]uint16: - fastpathTV.DecMapUintptrUint16V(v, false, d) - case *map[uintptr]uint16: - if v2, changed2 := fastpathTV.DecMapUintptrUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]uint32: - fastpathTV.DecMapUintptrUint32V(v, false, d) - case *map[uintptr]uint32: - if v2, changed2 := fastpathTV.DecMapUintptrUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]uint64: - fastpathTV.DecMapUintptrUint64V(v, false, d) - case *map[uintptr]uint64: - if v2, changed2 := fastpathTV.DecMapUintptrUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]uintptr: - fastpathTV.DecMapUintptrUintptrV(v, false, d) - case *map[uintptr]uintptr: - if v2, changed2 := fastpathTV.DecMapUintptrUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]int: - fastpathTV.DecMapUintptrIntV(v, false, d) - case *map[uintptr]int: - if v2, changed2 := fastpathTV.DecMapUintptrIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]int8: - fastpathTV.DecMapUintptrInt8V(v, false, d) - case *map[uintptr]int8: - if v2, changed2 := fastpathTV.DecMapUintptrInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]int16: - fastpathTV.DecMapUintptrInt16V(v, false, d) - case *map[uintptr]int16: - if v2, changed2 := fastpathTV.DecMapUintptrInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]int32: - fastpathTV.DecMapUintptrInt32V(v, false, d) - case *map[uintptr]int32: - if v2, changed2 := fastpathTV.DecMapUintptrInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]int64: - fastpathTV.DecMapUintptrInt64V(v, false, d) - case *map[uintptr]int64: - if v2, changed2 := fastpathTV.DecMapUintptrInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]float32: - fastpathTV.DecMapUintptrFloat32V(v, false, d) - case *map[uintptr]float32: - if v2, changed2 := fastpathTV.DecMapUintptrFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]float64: - fastpathTV.DecMapUintptrFloat64V(v, false, d) - case *map[uintptr]float64: - if v2, changed2 := fastpathTV.DecMapUintptrFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[uintptr]bool: - fastpathTV.DecMapUintptrBoolV(v, false, d) - case *map[uintptr]bool: - if v2, changed2 := fastpathTV.DecMapUintptrBoolV(*v, true, d); changed2 { - *v = v2 - } - - case []int: - fastpathTV.DecSliceIntV(v, false, d) - case *[]int: - if v2, changed2 := fastpathTV.DecSliceIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[int]interface{}: - fastpathTV.DecMapIntIntfV(v, false, d) - case *map[int]interface{}: - if v2, changed2 := fastpathTV.DecMapIntIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[int]string: - fastpathTV.DecMapIntStringV(v, false, d) - case *map[int]string: - if v2, changed2 := fastpathTV.DecMapIntStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[int]uint: - fastpathTV.DecMapIntUintV(v, false, d) - case *map[int]uint: - if v2, changed2 := fastpathTV.DecMapIntUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[int]uint8: - fastpathTV.DecMapIntUint8V(v, false, d) - case *map[int]uint8: - if v2, changed2 := fastpathTV.DecMapIntUint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]uint16: - fastpathTV.DecMapIntUint16V(v, false, d) - case *map[int]uint16: - if v2, changed2 := fastpathTV.DecMapIntUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]uint32: - fastpathTV.DecMapIntUint32V(v, false, d) - case *map[int]uint32: - if v2, changed2 := fastpathTV.DecMapIntUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]uint64: - fastpathTV.DecMapIntUint64V(v, false, d) - case *map[int]uint64: - if v2, changed2 := fastpathTV.DecMapIntUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]uintptr: - fastpathTV.DecMapIntUintptrV(v, false, d) - case *map[int]uintptr: - if v2, changed2 := fastpathTV.DecMapIntUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[int]int: - fastpathTV.DecMapIntIntV(v, false, d) - case *map[int]int: - if v2, changed2 := fastpathTV.DecMapIntIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[int]int8: - fastpathTV.DecMapIntInt8V(v, false, d) - case *map[int]int8: - if v2, changed2 := fastpathTV.DecMapIntInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]int16: - fastpathTV.DecMapIntInt16V(v, false, d) - case *map[int]int16: - if v2, changed2 := fastpathTV.DecMapIntInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]int32: - fastpathTV.DecMapIntInt32V(v, false, d) - case *map[int]int32: - if v2, changed2 := fastpathTV.DecMapIntInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]int64: - fastpathTV.DecMapIntInt64V(v, false, d) - case *map[int]int64: - if v2, changed2 := fastpathTV.DecMapIntInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]float32: - fastpathTV.DecMapIntFloat32V(v, false, d) - case *map[int]float32: - if v2, changed2 := fastpathTV.DecMapIntFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]float64: - fastpathTV.DecMapIntFloat64V(v, false, d) - case *map[int]float64: - if v2, changed2 := fastpathTV.DecMapIntFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int]bool: - fastpathTV.DecMapIntBoolV(v, false, d) - case *map[int]bool: - if v2, changed2 := fastpathTV.DecMapIntBoolV(*v, true, d); changed2 { - *v = v2 - } - - case []int8: - fastpathTV.DecSliceInt8V(v, false, d) - case *[]int8: - if v2, changed2 := fastpathTV.DecSliceInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]interface{}: - fastpathTV.DecMapInt8IntfV(v, false, d) - case *map[int8]interface{}: - if v2, changed2 := fastpathTV.DecMapInt8IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]string: - fastpathTV.DecMapInt8StringV(v, false, d) - case *map[int8]string: - if v2, changed2 := fastpathTV.DecMapInt8StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]uint: - fastpathTV.DecMapInt8UintV(v, false, d) - case *map[int8]uint: - if v2, changed2 := fastpathTV.DecMapInt8UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]uint8: - fastpathTV.DecMapInt8Uint8V(v, false, d) - case *map[int8]uint8: - if v2, changed2 := fastpathTV.DecMapInt8Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]uint16: - fastpathTV.DecMapInt8Uint16V(v, false, d) - case *map[int8]uint16: - if v2, changed2 := fastpathTV.DecMapInt8Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]uint32: - fastpathTV.DecMapInt8Uint32V(v, false, d) - case *map[int8]uint32: - if v2, changed2 := fastpathTV.DecMapInt8Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]uint64: - fastpathTV.DecMapInt8Uint64V(v, false, d) - case *map[int8]uint64: - if v2, changed2 := fastpathTV.DecMapInt8Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]uintptr: - fastpathTV.DecMapInt8UintptrV(v, false, d) - case *map[int8]uintptr: - if v2, changed2 := fastpathTV.DecMapInt8UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]int: - fastpathTV.DecMapInt8IntV(v, false, d) - case *map[int8]int: - if v2, changed2 := fastpathTV.DecMapInt8IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]int8: - fastpathTV.DecMapInt8Int8V(v, false, d) - case *map[int8]int8: - if v2, changed2 := fastpathTV.DecMapInt8Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]int16: - fastpathTV.DecMapInt8Int16V(v, false, d) - case *map[int8]int16: - if v2, changed2 := fastpathTV.DecMapInt8Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]int32: - fastpathTV.DecMapInt8Int32V(v, false, d) - case *map[int8]int32: - if v2, changed2 := fastpathTV.DecMapInt8Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]int64: - fastpathTV.DecMapInt8Int64V(v, false, d) - case *map[int8]int64: - if v2, changed2 := fastpathTV.DecMapInt8Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]float32: - fastpathTV.DecMapInt8Float32V(v, false, d) - case *map[int8]float32: - if v2, changed2 := fastpathTV.DecMapInt8Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]float64: - fastpathTV.DecMapInt8Float64V(v, false, d) - case *map[int8]float64: - if v2, changed2 := fastpathTV.DecMapInt8Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int8]bool: - fastpathTV.DecMapInt8BoolV(v, false, d) - case *map[int8]bool: - if v2, changed2 := fastpathTV.DecMapInt8BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []int16: - fastpathTV.DecSliceInt16V(v, false, d) - case *[]int16: - if v2, changed2 := fastpathTV.DecSliceInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]interface{}: - fastpathTV.DecMapInt16IntfV(v, false, d) - case *map[int16]interface{}: - if v2, changed2 := fastpathTV.DecMapInt16IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]string: - fastpathTV.DecMapInt16StringV(v, false, d) - case *map[int16]string: - if v2, changed2 := fastpathTV.DecMapInt16StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]uint: - fastpathTV.DecMapInt16UintV(v, false, d) - case *map[int16]uint: - if v2, changed2 := fastpathTV.DecMapInt16UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]uint8: - fastpathTV.DecMapInt16Uint8V(v, false, d) - case *map[int16]uint8: - if v2, changed2 := fastpathTV.DecMapInt16Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]uint16: - fastpathTV.DecMapInt16Uint16V(v, false, d) - case *map[int16]uint16: - if v2, changed2 := fastpathTV.DecMapInt16Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]uint32: - fastpathTV.DecMapInt16Uint32V(v, false, d) - case *map[int16]uint32: - if v2, changed2 := fastpathTV.DecMapInt16Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]uint64: - fastpathTV.DecMapInt16Uint64V(v, false, d) - case *map[int16]uint64: - if v2, changed2 := fastpathTV.DecMapInt16Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]uintptr: - fastpathTV.DecMapInt16UintptrV(v, false, d) - case *map[int16]uintptr: - if v2, changed2 := fastpathTV.DecMapInt16UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]int: - fastpathTV.DecMapInt16IntV(v, false, d) - case *map[int16]int: - if v2, changed2 := fastpathTV.DecMapInt16IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]int8: - fastpathTV.DecMapInt16Int8V(v, false, d) - case *map[int16]int8: - if v2, changed2 := fastpathTV.DecMapInt16Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]int16: - fastpathTV.DecMapInt16Int16V(v, false, d) - case *map[int16]int16: - if v2, changed2 := fastpathTV.DecMapInt16Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]int32: - fastpathTV.DecMapInt16Int32V(v, false, d) - case *map[int16]int32: - if v2, changed2 := fastpathTV.DecMapInt16Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]int64: - fastpathTV.DecMapInt16Int64V(v, false, d) - case *map[int16]int64: - if v2, changed2 := fastpathTV.DecMapInt16Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]float32: - fastpathTV.DecMapInt16Float32V(v, false, d) - case *map[int16]float32: - if v2, changed2 := fastpathTV.DecMapInt16Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]float64: - fastpathTV.DecMapInt16Float64V(v, false, d) - case *map[int16]float64: - if v2, changed2 := fastpathTV.DecMapInt16Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int16]bool: - fastpathTV.DecMapInt16BoolV(v, false, d) - case *map[int16]bool: - if v2, changed2 := fastpathTV.DecMapInt16BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []int32: - fastpathTV.DecSliceInt32V(v, false, d) - case *[]int32: - if v2, changed2 := fastpathTV.DecSliceInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]interface{}: - fastpathTV.DecMapInt32IntfV(v, false, d) - case *map[int32]interface{}: - if v2, changed2 := fastpathTV.DecMapInt32IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]string: - fastpathTV.DecMapInt32StringV(v, false, d) - case *map[int32]string: - if v2, changed2 := fastpathTV.DecMapInt32StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]uint: - fastpathTV.DecMapInt32UintV(v, false, d) - case *map[int32]uint: - if v2, changed2 := fastpathTV.DecMapInt32UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]uint8: - fastpathTV.DecMapInt32Uint8V(v, false, d) - case *map[int32]uint8: - if v2, changed2 := fastpathTV.DecMapInt32Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]uint16: - fastpathTV.DecMapInt32Uint16V(v, false, d) - case *map[int32]uint16: - if v2, changed2 := fastpathTV.DecMapInt32Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]uint32: - fastpathTV.DecMapInt32Uint32V(v, false, d) - case *map[int32]uint32: - if v2, changed2 := fastpathTV.DecMapInt32Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]uint64: - fastpathTV.DecMapInt32Uint64V(v, false, d) - case *map[int32]uint64: - if v2, changed2 := fastpathTV.DecMapInt32Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]uintptr: - fastpathTV.DecMapInt32UintptrV(v, false, d) - case *map[int32]uintptr: - if v2, changed2 := fastpathTV.DecMapInt32UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]int: - fastpathTV.DecMapInt32IntV(v, false, d) - case *map[int32]int: - if v2, changed2 := fastpathTV.DecMapInt32IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]int8: - fastpathTV.DecMapInt32Int8V(v, false, d) - case *map[int32]int8: - if v2, changed2 := fastpathTV.DecMapInt32Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]int16: - fastpathTV.DecMapInt32Int16V(v, false, d) - case *map[int32]int16: - if v2, changed2 := fastpathTV.DecMapInt32Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]int32: - fastpathTV.DecMapInt32Int32V(v, false, d) - case *map[int32]int32: - if v2, changed2 := fastpathTV.DecMapInt32Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]int64: - fastpathTV.DecMapInt32Int64V(v, false, d) - case *map[int32]int64: - if v2, changed2 := fastpathTV.DecMapInt32Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]float32: - fastpathTV.DecMapInt32Float32V(v, false, d) - case *map[int32]float32: - if v2, changed2 := fastpathTV.DecMapInt32Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]float64: - fastpathTV.DecMapInt32Float64V(v, false, d) - case *map[int32]float64: - if v2, changed2 := fastpathTV.DecMapInt32Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int32]bool: - fastpathTV.DecMapInt32BoolV(v, false, d) - case *map[int32]bool: - if v2, changed2 := fastpathTV.DecMapInt32BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []int64: - fastpathTV.DecSliceInt64V(v, false, d) - case *[]int64: - if v2, changed2 := fastpathTV.DecSliceInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]interface{}: - fastpathTV.DecMapInt64IntfV(v, false, d) - case *map[int64]interface{}: - if v2, changed2 := fastpathTV.DecMapInt64IntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]string: - fastpathTV.DecMapInt64StringV(v, false, d) - case *map[int64]string: - if v2, changed2 := fastpathTV.DecMapInt64StringV(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]uint: - fastpathTV.DecMapInt64UintV(v, false, d) - case *map[int64]uint: - if v2, changed2 := fastpathTV.DecMapInt64UintV(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]uint8: - fastpathTV.DecMapInt64Uint8V(v, false, d) - case *map[int64]uint8: - if v2, changed2 := fastpathTV.DecMapInt64Uint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]uint16: - fastpathTV.DecMapInt64Uint16V(v, false, d) - case *map[int64]uint16: - if v2, changed2 := fastpathTV.DecMapInt64Uint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]uint32: - fastpathTV.DecMapInt64Uint32V(v, false, d) - case *map[int64]uint32: - if v2, changed2 := fastpathTV.DecMapInt64Uint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]uint64: - fastpathTV.DecMapInt64Uint64V(v, false, d) - case *map[int64]uint64: - if v2, changed2 := fastpathTV.DecMapInt64Uint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]uintptr: - fastpathTV.DecMapInt64UintptrV(v, false, d) - case *map[int64]uintptr: - if v2, changed2 := fastpathTV.DecMapInt64UintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]int: - fastpathTV.DecMapInt64IntV(v, false, d) - case *map[int64]int: - if v2, changed2 := fastpathTV.DecMapInt64IntV(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]int8: - fastpathTV.DecMapInt64Int8V(v, false, d) - case *map[int64]int8: - if v2, changed2 := fastpathTV.DecMapInt64Int8V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]int16: - fastpathTV.DecMapInt64Int16V(v, false, d) - case *map[int64]int16: - if v2, changed2 := fastpathTV.DecMapInt64Int16V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]int32: - fastpathTV.DecMapInt64Int32V(v, false, d) - case *map[int64]int32: - if v2, changed2 := fastpathTV.DecMapInt64Int32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]int64: - fastpathTV.DecMapInt64Int64V(v, false, d) - case *map[int64]int64: - if v2, changed2 := fastpathTV.DecMapInt64Int64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]float32: - fastpathTV.DecMapInt64Float32V(v, false, d) - case *map[int64]float32: - if v2, changed2 := fastpathTV.DecMapInt64Float32V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]float64: - fastpathTV.DecMapInt64Float64V(v, false, d) - case *map[int64]float64: - if v2, changed2 := fastpathTV.DecMapInt64Float64V(*v, true, d); changed2 { - *v = v2 - } - - case map[int64]bool: - fastpathTV.DecMapInt64BoolV(v, false, d) - case *map[int64]bool: - if v2, changed2 := fastpathTV.DecMapInt64BoolV(*v, true, d); changed2 { - *v = v2 - } - - case []bool: - fastpathTV.DecSliceBoolV(v, false, d) - case *[]bool: - if v2, changed2 := fastpathTV.DecSliceBoolV(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]interface{}: - fastpathTV.DecMapBoolIntfV(v, false, d) - case *map[bool]interface{}: - if v2, changed2 := fastpathTV.DecMapBoolIntfV(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]string: - fastpathTV.DecMapBoolStringV(v, false, d) - case *map[bool]string: - if v2, changed2 := fastpathTV.DecMapBoolStringV(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]uint: - fastpathTV.DecMapBoolUintV(v, false, d) - case *map[bool]uint: - if v2, changed2 := fastpathTV.DecMapBoolUintV(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]uint8: - fastpathTV.DecMapBoolUint8V(v, false, d) - case *map[bool]uint8: - if v2, changed2 := fastpathTV.DecMapBoolUint8V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]uint16: - fastpathTV.DecMapBoolUint16V(v, false, d) - case *map[bool]uint16: - if v2, changed2 := fastpathTV.DecMapBoolUint16V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]uint32: - fastpathTV.DecMapBoolUint32V(v, false, d) - case *map[bool]uint32: - if v2, changed2 := fastpathTV.DecMapBoolUint32V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]uint64: - fastpathTV.DecMapBoolUint64V(v, false, d) - case *map[bool]uint64: - if v2, changed2 := fastpathTV.DecMapBoolUint64V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]uintptr: - fastpathTV.DecMapBoolUintptrV(v, false, d) - case *map[bool]uintptr: - if v2, changed2 := fastpathTV.DecMapBoolUintptrV(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]int: - fastpathTV.DecMapBoolIntV(v, false, d) - case *map[bool]int: - if v2, changed2 := fastpathTV.DecMapBoolIntV(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]int8: - fastpathTV.DecMapBoolInt8V(v, false, d) - case *map[bool]int8: - if v2, changed2 := fastpathTV.DecMapBoolInt8V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]int16: - fastpathTV.DecMapBoolInt16V(v, false, d) - case *map[bool]int16: - if v2, changed2 := fastpathTV.DecMapBoolInt16V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]int32: - fastpathTV.DecMapBoolInt32V(v, false, d) - case *map[bool]int32: - if v2, changed2 := fastpathTV.DecMapBoolInt32V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]int64: - fastpathTV.DecMapBoolInt64V(v, false, d) - case *map[bool]int64: - if v2, changed2 := fastpathTV.DecMapBoolInt64V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]float32: - fastpathTV.DecMapBoolFloat32V(v, false, d) - case *map[bool]float32: - if v2, changed2 := fastpathTV.DecMapBoolFloat32V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]float64: - fastpathTV.DecMapBoolFloat64V(v, false, d) - case *map[bool]float64: - if v2, changed2 := fastpathTV.DecMapBoolFloat64V(*v, true, d); changed2 { - *v = v2 - } - - case map[bool]bool: - fastpathTV.DecMapBoolBoolV(v, false, d) - case *map[bool]bool: - if v2, changed2 := fastpathTV.DecMapBoolBoolV(*v, true, d); changed2 { - *v = v2 - } - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -func fastpathDecodeSetZeroTypeSwitch(iv interface{}, d *Decoder) bool { - switch v := iv.(type) { - - case *[]interface{}: - *v = nil - - case *map[interface{}]interface{}: - *v = nil - - case *map[interface{}]string: - *v = nil - - case *map[interface{}]uint: - *v = nil - - case *map[interface{}]uint8: - *v = nil - - case *map[interface{}]uint16: - *v = nil - - case *map[interface{}]uint32: - *v = nil - - case *map[interface{}]uint64: - *v = nil - - case *map[interface{}]uintptr: - *v = nil - - case *map[interface{}]int: - *v = nil - - case *map[interface{}]int8: - *v = nil - - case *map[interface{}]int16: - *v = nil - - case *map[interface{}]int32: - *v = nil - - case *map[interface{}]int64: - *v = nil - - case *map[interface{}]float32: - *v = nil - - case *map[interface{}]float64: - *v = nil - - case *map[interface{}]bool: - *v = nil - - case *[]string: - *v = nil - - case *map[string]interface{}: - *v = nil - - case *map[string]string: - *v = nil - - case *map[string]uint: - *v = nil - - case *map[string]uint8: - *v = nil - - case *map[string]uint16: - *v = nil - - case *map[string]uint32: - *v = nil - - case *map[string]uint64: - *v = nil - - case *map[string]uintptr: - *v = nil - - case *map[string]int: - *v = nil - - case *map[string]int8: - *v = nil - - case *map[string]int16: - *v = nil - - case *map[string]int32: - *v = nil - - case *map[string]int64: - *v = nil - - case *map[string]float32: - *v = nil - - case *map[string]float64: - *v = nil - - case *map[string]bool: - *v = nil - - case *[]float32: - *v = nil - - case *map[float32]interface{}: - *v = nil - - case *map[float32]string: - *v = nil - - case *map[float32]uint: - *v = nil - - case *map[float32]uint8: - *v = nil - - case *map[float32]uint16: - *v = nil - - case *map[float32]uint32: - *v = nil - - case *map[float32]uint64: - *v = nil - - case *map[float32]uintptr: - *v = nil - - case *map[float32]int: - *v = nil - - case *map[float32]int8: - *v = nil - - case *map[float32]int16: - *v = nil - - case *map[float32]int32: - *v = nil - - case *map[float32]int64: - *v = nil - - case *map[float32]float32: - *v = nil - - case *map[float32]float64: - *v = nil - - case *map[float32]bool: - *v = nil - - case *[]float64: - *v = nil - - case *map[float64]interface{}: - *v = nil - - case *map[float64]string: - *v = nil - - case *map[float64]uint: - *v = nil - - case *map[float64]uint8: - *v = nil - - case *map[float64]uint16: - *v = nil - - case *map[float64]uint32: - *v = nil - - case *map[float64]uint64: - *v = nil - - case *map[float64]uintptr: - *v = nil - - case *map[float64]int: - *v = nil - - case *map[float64]int8: - *v = nil - - case *map[float64]int16: - *v = nil - - case *map[float64]int32: - *v = nil - - case *map[float64]int64: - *v = nil - - case *map[float64]float32: - *v = nil - - case *map[float64]float64: - *v = nil - - case *map[float64]bool: - *v = nil - - case *[]uint: - *v = nil - - case *map[uint]interface{}: - *v = nil - - case *map[uint]string: - *v = nil - - case *map[uint]uint: - *v = nil - - case *map[uint]uint8: - *v = nil - - case *map[uint]uint16: - *v = nil - - case *map[uint]uint32: - *v = nil - - case *map[uint]uint64: - *v = nil - - case *map[uint]uintptr: - *v = nil - - case *map[uint]int: - *v = nil - - case *map[uint]int8: - *v = nil - - case *map[uint]int16: - *v = nil - - case *map[uint]int32: - *v = nil - - case *map[uint]int64: - *v = nil - - case *map[uint]float32: - *v = nil - - case *map[uint]float64: - *v = nil - - case *map[uint]bool: - *v = nil - - case *map[uint8]interface{}: - *v = nil - - case *map[uint8]string: - *v = nil - - case *map[uint8]uint: - *v = nil - - case *map[uint8]uint8: - *v = nil - - case *map[uint8]uint16: - *v = nil - - case *map[uint8]uint32: - *v = nil - - case *map[uint8]uint64: - *v = nil - - case *map[uint8]uintptr: - *v = nil - - case *map[uint8]int: - *v = nil - - case *map[uint8]int8: - *v = nil - - case *map[uint8]int16: - *v = nil - - case *map[uint8]int32: - *v = nil - - case *map[uint8]int64: - *v = nil - - case *map[uint8]float32: - *v = nil - - case *map[uint8]float64: - *v = nil - - case *map[uint8]bool: - *v = nil - - case *[]uint16: - *v = nil - - case *map[uint16]interface{}: - *v = nil - - case *map[uint16]string: - *v = nil - - case *map[uint16]uint: - *v = nil - - case *map[uint16]uint8: - *v = nil - - case *map[uint16]uint16: - *v = nil - - case *map[uint16]uint32: - *v = nil - - case *map[uint16]uint64: - *v = nil - - case *map[uint16]uintptr: - *v = nil - - case *map[uint16]int: - *v = nil - - case *map[uint16]int8: - *v = nil - - case *map[uint16]int16: - *v = nil - - case *map[uint16]int32: - *v = nil - - case *map[uint16]int64: - *v = nil - - case *map[uint16]float32: - *v = nil - - case *map[uint16]float64: - *v = nil - - case *map[uint16]bool: - *v = nil - - case *[]uint32: - *v = nil - - case *map[uint32]interface{}: - *v = nil - - case *map[uint32]string: - *v = nil - - case *map[uint32]uint: - *v = nil - - case *map[uint32]uint8: - *v = nil - - case *map[uint32]uint16: - *v = nil - - case *map[uint32]uint32: - *v = nil - - case *map[uint32]uint64: - *v = nil - - case *map[uint32]uintptr: - *v = nil - - case *map[uint32]int: - *v = nil - - case *map[uint32]int8: - *v = nil - - case *map[uint32]int16: - *v = nil - - case *map[uint32]int32: - *v = nil - - case *map[uint32]int64: - *v = nil - - case *map[uint32]float32: - *v = nil - - case *map[uint32]float64: - *v = nil - - case *map[uint32]bool: - *v = nil - - case *[]uint64: - *v = nil - - case *map[uint64]interface{}: - *v = nil - - case *map[uint64]string: - *v = nil - - case *map[uint64]uint: - *v = nil - - case *map[uint64]uint8: - *v = nil - - case *map[uint64]uint16: - *v = nil - - case *map[uint64]uint32: - *v = nil - - case *map[uint64]uint64: - *v = nil - - case *map[uint64]uintptr: - *v = nil - - case *map[uint64]int: - *v = nil - - case *map[uint64]int8: - *v = nil - - case *map[uint64]int16: - *v = nil - - case *map[uint64]int32: - *v = nil - - case *map[uint64]int64: - *v = nil - - case *map[uint64]float32: - *v = nil - - case *map[uint64]float64: - *v = nil - - case *map[uint64]bool: - *v = nil - - case *[]uintptr: - *v = nil - - case *map[uintptr]interface{}: - *v = nil - - case *map[uintptr]string: - *v = nil - - case *map[uintptr]uint: - *v = nil - - case *map[uintptr]uint8: - *v = nil - - case *map[uintptr]uint16: - *v = nil - - case *map[uintptr]uint32: - *v = nil - - case *map[uintptr]uint64: - *v = nil - - case *map[uintptr]uintptr: - *v = nil - - case *map[uintptr]int: - *v = nil - - case *map[uintptr]int8: - *v = nil - - case *map[uintptr]int16: - *v = nil - - case *map[uintptr]int32: - *v = nil - - case *map[uintptr]int64: - *v = nil - - case *map[uintptr]float32: - *v = nil - - case *map[uintptr]float64: - *v = nil - - case *map[uintptr]bool: - *v = nil - - case *[]int: - *v = nil - - case *map[int]interface{}: - *v = nil - - case *map[int]string: - *v = nil - - case *map[int]uint: - *v = nil - - case *map[int]uint8: - *v = nil - - case *map[int]uint16: - *v = nil - - case *map[int]uint32: - *v = nil - - case *map[int]uint64: - *v = nil - - case *map[int]uintptr: - *v = nil - - case *map[int]int: - *v = nil - - case *map[int]int8: - *v = nil - - case *map[int]int16: - *v = nil - - case *map[int]int32: - *v = nil - - case *map[int]int64: - *v = nil - - case *map[int]float32: - *v = nil - - case *map[int]float64: - *v = nil - - case *map[int]bool: - *v = nil - - case *[]int8: - *v = nil - - case *map[int8]interface{}: - *v = nil - - case *map[int8]string: - *v = nil - - case *map[int8]uint: - *v = nil - - case *map[int8]uint8: - *v = nil - - case *map[int8]uint16: - *v = nil - - case *map[int8]uint32: - *v = nil - - case *map[int8]uint64: - *v = nil - - case *map[int8]uintptr: - *v = nil - - case *map[int8]int: - *v = nil - - case *map[int8]int8: - *v = nil - - case *map[int8]int16: - *v = nil - - case *map[int8]int32: - *v = nil - - case *map[int8]int64: - *v = nil - - case *map[int8]float32: - *v = nil - - case *map[int8]float64: - *v = nil - - case *map[int8]bool: - *v = nil - - case *[]int16: - *v = nil - - case *map[int16]interface{}: - *v = nil - - case *map[int16]string: - *v = nil - - case *map[int16]uint: - *v = nil - - case *map[int16]uint8: - *v = nil - - case *map[int16]uint16: - *v = nil - - case *map[int16]uint32: - *v = nil - - case *map[int16]uint64: - *v = nil - - case *map[int16]uintptr: - *v = nil - - case *map[int16]int: - *v = nil - - case *map[int16]int8: - *v = nil - - case *map[int16]int16: - *v = nil - - case *map[int16]int32: - *v = nil - - case *map[int16]int64: - *v = nil - - case *map[int16]float32: - *v = nil - - case *map[int16]float64: - *v = nil - - case *map[int16]bool: - *v = nil - - case *[]int32: - *v = nil - - case *map[int32]interface{}: - *v = nil - - case *map[int32]string: - *v = nil - - case *map[int32]uint: - *v = nil - - case *map[int32]uint8: - *v = nil - - case *map[int32]uint16: - *v = nil - - case *map[int32]uint32: - *v = nil - - case *map[int32]uint64: - *v = nil - - case *map[int32]uintptr: - *v = nil - - case *map[int32]int: - *v = nil - - case *map[int32]int8: - *v = nil - - case *map[int32]int16: - *v = nil - - case *map[int32]int32: - *v = nil - - case *map[int32]int64: - *v = nil - - case *map[int32]float32: - *v = nil - - case *map[int32]float64: - *v = nil - - case *map[int32]bool: - *v = nil - - case *[]int64: - *v = nil - - case *map[int64]interface{}: - *v = nil - - case *map[int64]string: - *v = nil - - case *map[int64]uint: - *v = nil - - case *map[int64]uint8: - *v = nil - - case *map[int64]uint16: - *v = nil - - case *map[int64]uint32: - *v = nil - - case *map[int64]uint64: - *v = nil - - case *map[int64]uintptr: - *v = nil - - case *map[int64]int: - *v = nil - - case *map[int64]int8: - *v = nil - - case *map[int64]int16: - *v = nil - - case *map[int64]int32: - *v = nil - - case *map[int64]int64: - *v = nil - - case *map[int64]float32: - *v = nil - - case *map[int64]float64: - *v = nil - - case *map[int64]bool: - *v = nil - - case *[]bool: - *v = nil - - case *map[bool]interface{}: - *v = nil - - case *map[bool]string: - *v = nil - - case *map[bool]uint: - *v = nil - - case *map[bool]uint8: - *v = nil - - case *map[bool]uint16: - *v = nil - - case *map[bool]uint32: - *v = nil - - case *map[bool]uint64: - *v = nil - - case *map[bool]uintptr: - *v = nil - - case *map[bool]int: - *v = nil - - case *map[bool]int8: - *v = nil - - case *map[bool]int16: - *v = nil - - case *map[bool]int32: - *v = nil - - case *map[bool]int64: - *v = nil - - case *map[bool]float32: - *v = nil - - case *map[bool]float64: - *v = nil - - case *map[bool]bool: - *v = nil - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -// -- -- fast path functions - -func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]interface{}) - if v, changed := fastpathTV.DecSliceIntfV(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceIntfV(rv2i(rv).([]interface{}), !array, d) - } -} - -func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) { - if v, changed := f.DecSliceIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceIntfV(v []interface{}, canChange bool, d *Decoder) (_ []interface{}, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []interface{}{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]interface{}, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) - } else { - xlen = 8 - } - v = make([]interface{}, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, nil) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - d.decode(&v[j]) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]interface{}, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]string) - if v, changed := fastpathTV.DecSliceStringV(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceStringV(rv2i(rv).([]string), !array, d) - } -} - -func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) { - if v, changed := f.DecSliceStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceStringV(v []string, canChange bool, d *Decoder) (_ []string, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []string{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]string, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) - } else { - xlen = 8 - } - v = make([]string, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, "") - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = dd.DecodeString() - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]string, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]float32) - if v, changed := fastpathTV.DecSliceFloat32V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceFloat32V(rv2i(rv).([]float32), !array, d) - } -} - -func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) { - if v, changed := f.DecSliceFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceFloat32V(v []float32, canChange bool, d *Decoder) (_ []float32, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []float32{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]float32, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) - } else { - xlen = 8 - } - v = make([]float32, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = float32(dd.DecodeFloat(true)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]float32, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]float64) - if v, changed := fastpathTV.DecSliceFloat64V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceFloat64V(rv2i(rv).([]float64), !array, d) - } -} - -func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) { - if v, changed := f.DecSliceFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceFloat64V(v []float64, canChange bool, d *Decoder) (_ []float64, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []float64{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]float64, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - } else { - xlen = 8 - } - v = make([]float64, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = dd.DecodeFloat(false) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]float64, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]uint) - if v, changed := fastpathTV.DecSliceUintV(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceUintV(rv2i(rv).([]uint), !array, d) - } -} - -func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) { - if v, changed := f.DecSliceUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUintV(v []uint, canChange bool, d *Decoder) (_ []uint, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []uint{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - } else { - xlen = 8 - } - v = make([]uint, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = uint(dd.DecodeUint(uintBitsize)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]uint, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]uint16) - if v, changed := fastpathTV.DecSliceUint16V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceUint16V(rv2i(rv).([]uint16), !array, d) - } -} - -func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) { - if v, changed := f.DecSliceUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUint16V(v []uint16, canChange bool, d *Decoder) (_ []uint16, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []uint16{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint16, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) - } else { - xlen = 8 - } - v = make([]uint16, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = uint16(dd.DecodeUint(16)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]uint16, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]uint32) - if v, changed := fastpathTV.DecSliceUint32V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceUint32V(rv2i(rv).([]uint32), !array, d) - } -} - -func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) { - if v, changed := f.DecSliceUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUint32V(v []uint32, canChange bool, d *Decoder) (_ []uint32, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []uint32{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint32, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) - } else { - xlen = 8 - } - v = make([]uint32, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = uint32(dd.DecodeUint(32)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]uint32, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]uint64) - if v, changed := fastpathTV.DecSliceUint64V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceUint64V(rv2i(rv).([]uint64), !array, d) - } -} - -func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) { - if v, changed := f.DecSliceUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUint64V(v []uint64, canChange bool, d *Decoder) (_ []uint64, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []uint64{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint64, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - } else { - xlen = 8 - } - v = make([]uint64, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = dd.DecodeUint(64) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]uint64, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceUintptrR(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]uintptr) - if v, changed := fastpathTV.DecSliceUintptrV(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceUintptrV(rv2i(rv).([]uintptr), !array, d) - } -} - -func (f fastpathT) DecSliceUintptrX(vp *[]uintptr, d *Decoder) { - if v, changed := f.DecSliceUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUintptrV(v []uintptr, canChange bool, d *Decoder) (_ []uintptr, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []uintptr{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uintptr, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - } else { - xlen = 8 - } - v = make([]uintptr, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = uintptr(dd.DecodeUint(uintBitsize)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]uintptr, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]int) - if v, changed := fastpathTV.DecSliceIntV(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceIntV(rv2i(rv).([]int), !array, d) - } -} - -func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) { - if v, changed := f.DecSliceIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceIntV(v []int, canChange bool, d *Decoder) (_ []int, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []int{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - } else { - xlen = 8 - } - v = make([]int, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = int(dd.DecodeInt(intBitsize)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]int, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]int8) - if v, changed := fastpathTV.DecSliceInt8V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceInt8V(rv2i(rv).([]int8), !array, d) - } -} - -func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) { - if v, changed := f.DecSliceInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt8V(v []int8, canChange bool, d *Decoder) (_ []int8, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []int8{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int8, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) - } else { - xlen = 8 - } - v = make([]int8, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = int8(dd.DecodeInt(8)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]int8, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]int16) - if v, changed := fastpathTV.DecSliceInt16V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceInt16V(rv2i(rv).([]int16), !array, d) - } -} - -func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) { - if v, changed := f.DecSliceInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt16V(v []int16, canChange bool, d *Decoder) (_ []int16, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []int16{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int16, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) - } else { - xlen = 8 - } - v = make([]int16, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = int16(dd.DecodeInt(16)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]int16, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]int32) - if v, changed := fastpathTV.DecSliceInt32V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceInt32V(rv2i(rv).([]int32), !array, d) - } -} - -func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) { - if v, changed := f.DecSliceInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt32V(v []int32, canChange bool, d *Decoder) (_ []int32, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []int32{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int32, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) - } else { - xlen = 8 - } - v = make([]int32, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = int32(dd.DecodeInt(32)) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]int32, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]int64) - if v, changed := fastpathTV.DecSliceInt64V(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceInt64V(rv2i(rv).([]int64), !array, d) - } -} - -func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) { - if v, changed := f.DecSliceInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt64V(v []int64, canChange bool, d *Decoder) (_ []int64, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []int64{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int64, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) - } else { - xlen = 8 - } - v = make([]int64, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = dd.DecodeInt(64) - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]int64, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) { - if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { - var vp = rv2i(rv).(*[]bool) - if v, changed := fastpathTV.DecSliceBoolV(*vp, !array, d); changed { - *vp = v - } - } else { - fastpathTV.DecSliceBoolV(rv2i(rv).([]bool), !array, d) - } -} - -func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) { - if v, changed := f.DecSliceBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecSliceBoolV(v []bool, canChange bool, d *Decoder) (_ []bool, changed bool) { - dd := d.d - - slh, containerLenS := d.decSliceHelperStart() - if containerLenS == 0 { - if canChange { - if v == nil { - v = []bool{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - - hasLen := containerLenS > 0 - var xlen int - if hasLen && canChange { - if containerLenS > cap(v) { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]bool, xlen) - } - changed = true - } else if containerLenS != len(v) { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { - if j == 0 && len(v) == 0 { - if hasLen { - xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) - } else { - xlen = 8 - } - v = make([]bool, xlen) - changed = true - } - // if indefinite, etc, then expand the slice if necessary - var decodeIntoBlank bool - if j >= len(v) { - if canChange { - v = append(v, false) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - decodeIntoBlank = true - } - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { - v[j] = dd.DecodeBool() - } - } - if canChange { - if j < len(v) { - v = v[:j] - changed = true - } else if j == 0 && v == nil { - v = make([]bool, 0) - changed = true - } - } - slh.End() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfIntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]interface{}) - if v, changed := fastpathTV.DecMapIntfIntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfIntfV(rv2i(rv).(map[interface{}]interface{}), false, d) -} -func (f fastpathT) DecMapIntfIntfX(vp *map[interface{}]interface{}, d *Decoder) { - if v, changed := f.DecMapIntfIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, canChange bool, - d *Decoder) (_ map[interface{}]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[interface{}]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk interface{} - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfStringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]string) - if v, changed := fastpathTV.DecMapIntfStringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfStringV(rv2i(rv).(map[interface{}]string), false, d) -} -func (f fastpathT) DecMapIntfStringX(vp *map[interface{}]string, d *Decoder) { - if v, changed := f.DecMapIntfStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, canChange bool, - d *Decoder) (_ map[interface{}]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[interface{}]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfUintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]uint) - if v, changed := fastpathTV.DecMapIntfUintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfUintV(rv2i(rv).(map[interface{}]uint), false, d) -} -func (f fastpathT) DecMapIntfUintX(vp *map[interface{}]uint, d *Decoder) { - if v, changed := f.DecMapIntfUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, canChange bool, - d *Decoder) (_ map[interface{}]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfUint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]uint8) - if v, changed := fastpathTV.DecMapIntfUint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfUint8V(rv2i(rv).(map[interface{}]uint8), false, d) -} -func (f fastpathT) DecMapIntfUint8X(vp *map[interface{}]uint8, d *Decoder) { - if v, changed := f.DecMapIntfUint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, canChange bool, - d *Decoder) (_ map[interface{}]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[interface{}]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfUint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]uint16) - if v, changed := fastpathTV.DecMapIntfUint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfUint16V(rv2i(rv).(map[interface{}]uint16), false, d) -} -func (f fastpathT) DecMapIntfUint16X(vp *map[interface{}]uint16, d *Decoder) { - if v, changed := f.DecMapIntfUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, canChange bool, - d *Decoder) (_ map[interface{}]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[interface{}]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfUint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]uint32) - if v, changed := fastpathTV.DecMapIntfUint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfUint32V(rv2i(rv).(map[interface{}]uint32), false, d) -} -func (f fastpathT) DecMapIntfUint32X(vp *map[interface{}]uint32, d *Decoder) { - if v, changed := f.DecMapIntfUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, canChange bool, - d *Decoder) (_ map[interface{}]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[interface{}]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfUint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]uint64) - if v, changed := fastpathTV.DecMapIntfUint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfUint64V(rv2i(rv).(map[interface{}]uint64), false, d) -} -func (f fastpathT) DecMapIntfUint64X(vp *map[interface{}]uint64, d *Decoder) { - if v, changed := f.DecMapIntfUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, canChange bool, - d *Decoder) (_ map[interface{}]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfUintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]uintptr) - if v, changed := fastpathTV.DecMapIntfUintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfUintptrV(rv2i(rv).(map[interface{}]uintptr), false, d) -} -func (f fastpathT) DecMapIntfUintptrX(vp *map[interface{}]uintptr, d *Decoder) { - if v, changed := f.DecMapIntfUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUintptrV(v map[interface{}]uintptr, canChange bool, - d *Decoder) (_ map[interface{}]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfIntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]int) - if v, changed := fastpathTV.DecMapIntfIntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfIntV(rv2i(rv).(map[interface{}]int), false, d) -} -func (f fastpathT) DecMapIntfIntX(vp *map[interface{}]int, d *Decoder) { - if v, changed := f.DecMapIntfIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, canChange bool, - d *Decoder) (_ map[interface{}]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfInt8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]int8) - if v, changed := fastpathTV.DecMapIntfInt8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfInt8V(rv2i(rv).(map[interface{}]int8), false, d) -} -func (f fastpathT) DecMapIntfInt8X(vp *map[interface{}]int8, d *Decoder) { - if v, changed := f.DecMapIntfInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, canChange bool, - d *Decoder) (_ map[interface{}]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[interface{}]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfInt16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]int16) - if v, changed := fastpathTV.DecMapIntfInt16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfInt16V(rv2i(rv).(map[interface{}]int16), false, d) -} -func (f fastpathT) DecMapIntfInt16X(vp *map[interface{}]int16, d *Decoder) { - if v, changed := f.DecMapIntfInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, canChange bool, - d *Decoder) (_ map[interface{}]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[interface{}]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfInt32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]int32) - if v, changed := fastpathTV.DecMapIntfInt32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfInt32V(rv2i(rv).(map[interface{}]int32), false, d) -} -func (f fastpathT) DecMapIntfInt32X(vp *map[interface{}]int32, d *Decoder) { - if v, changed := f.DecMapIntfInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, canChange bool, - d *Decoder) (_ map[interface{}]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[interface{}]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfInt64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]int64) - if v, changed := fastpathTV.DecMapIntfInt64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfInt64V(rv2i(rv).(map[interface{}]int64), false, d) -} -func (f fastpathT) DecMapIntfInt64X(vp *map[interface{}]int64, d *Decoder) { - if v, changed := f.DecMapIntfInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, canChange bool, - d *Decoder) (_ map[interface{}]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfFloat32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]float32) - if v, changed := fastpathTV.DecMapIntfFloat32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfFloat32V(rv2i(rv).(map[interface{}]float32), false, d) -} -func (f fastpathT) DecMapIntfFloat32X(vp *map[interface{}]float32, d *Decoder) { - if v, changed := f.DecMapIntfFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, canChange bool, - d *Decoder) (_ map[interface{}]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[interface{}]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfFloat64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]float64) - if v, changed := fastpathTV.DecMapIntfFloat64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfFloat64V(rv2i(rv).(map[interface{}]float64), false, d) -} -func (f fastpathT) DecMapIntfFloat64X(vp *map[interface{}]float64, d *Decoder) { - if v, changed := f.DecMapIntfFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, canChange bool, - d *Decoder) (_ map[interface{}]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntfBoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[interface{}]bool) - if v, changed := fastpathTV.DecMapIntfBoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntfBoolV(rv2i(rv).(map[interface{}]bool), false, d) -} -func (f fastpathT) DecMapIntfBoolX(vp *map[interface{}]bool, d *Decoder) { - if v, changed := f.DecMapIntfBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, canChange bool, - d *Decoder) (_ map[interface{}]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[interface{}]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk interface{} - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]interface{}) - if v, changed := fastpathTV.DecMapStringIntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringIntfV(rv2i(rv).(map[string]interface{}), false, d) -} -func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) { - if v, changed := f.DecMapStringIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, canChange bool, - d *Decoder) (_ map[string]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[string]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk string - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]string) - if v, changed := fastpathTV.DecMapStringStringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringStringV(rv2i(rv).(map[string]string), false, d) -} -func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) { - if v, changed := f.DecMapStringStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringStringV(v map[string]string, canChange bool, - d *Decoder) (_ map[string]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[string]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]uint) - if v, changed := fastpathTV.DecMapStringUintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringUintV(rv2i(rv).(map[string]uint), false, d) -} -func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) { - if v, changed := f.DecMapStringUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUintV(v map[string]uint, canChange bool, - d *Decoder) (_ map[string]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]uint8) - if v, changed := fastpathTV.DecMapStringUint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringUint8V(rv2i(rv).(map[string]uint8), false, d) -} -func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) { - if v, changed := f.DecMapStringUint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, canChange bool, - d *Decoder) (_ map[string]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[string]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringUint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]uint16) - if v, changed := fastpathTV.DecMapStringUint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringUint16V(rv2i(rv).(map[string]uint16), false, d) -} -func (f fastpathT) DecMapStringUint16X(vp *map[string]uint16, d *Decoder) { - if v, changed := f.DecMapStringUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, canChange bool, - d *Decoder) (_ map[string]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[string]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringUint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]uint32) - if v, changed := fastpathTV.DecMapStringUint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringUint32V(rv2i(rv).(map[string]uint32), false, d) -} -func (f fastpathT) DecMapStringUint32X(vp *map[string]uint32, d *Decoder) { - if v, changed := f.DecMapStringUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, canChange bool, - d *Decoder) (_ map[string]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[string]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]uint64) - if v, changed := fastpathTV.DecMapStringUint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringUint64V(rv2i(rv).(map[string]uint64), false, d) -} -func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) { - if v, changed := f.DecMapStringUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, canChange bool, - d *Decoder) (_ map[string]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringUintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]uintptr) - if v, changed := fastpathTV.DecMapStringUintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringUintptrV(rv2i(rv).(map[string]uintptr), false, d) -} -func (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, d *Decoder) { - if v, changed := f.DecMapStringUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUintptrV(v map[string]uintptr, canChange bool, - d *Decoder) (_ map[string]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]int) - if v, changed := fastpathTV.DecMapStringIntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringIntV(rv2i(rv).(map[string]int), false, d) -} -func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) { - if v, changed := f.DecMapStringIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringIntV(v map[string]int, canChange bool, - d *Decoder) (_ map[string]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringInt8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]int8) - if v, changed := fastpathTV.DecMapStringInt8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringInt8V(rv2i(rv).(map[string]int8), false, d) -} -func (f fastpathT) DecMapStringInt8X(vp *map[string]int8, d *Decoder) { - if v, changed := f.DecMapStringInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt8V(v map[string]int8, canChange bool, - d *Decoder) (_ map[string]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[string]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringInt16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]int16) - if v, changed := fastpathTV.DecMapStringInt16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringInt16V(rv2i(rv).(map[string]int16), false, d) -} -func (f fastpathT) DecMapStringInt16X(vp *map[string]int16, d *Decoder) { - if v, changed := f.DecMapStringInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt16V(v map[string]int16, canChange bool, - d *Decoder) (_ map[string]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[string]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringInt32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]int32) - if v, changed := fastpathTV.DecMapStringInt32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringInt32V(rv2i(rv).(map[string]int32), false, d) -} -func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, d *Decoder) { - if v, changed := f.DecMapStringInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt32V(v map[string]int32, canChange bool, - d *Decoder) (_ map[string]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[string]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]int64) - if v, changed := fastpathTV.DecMapStringInt64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringInt64V(rv2i(rv).(map[string]int64), false, d) -} -func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) { - if v, changed := f.DecMapStringInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt64V(v map[string]int64, canChange bool, - d *Decoder) (_ map[string]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]float32) - if v, changed := fastpathTV.DecMapStringFloat32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringFloat32V(rv2i(rv).(map[string]float32), false, d) -} -func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) { - if v, changed := f.DecMapStringFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, canChange bool, - d *Decoder) (_ map[string]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[string]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]float64) - if v, changed := fastpathTV.DecMapStringFloat64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringFloat64V(rv2i(rv).(map[string]float64), false, d) -} -func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) { - if v, changed := f.DecMapStringFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, canChange bool, - d *Decoder) (_ map[string]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[string]bool) - if v, changed := fastpathTV.DecMapStringBoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapStringBoolV(rv2i(rv).(map[string]bool), false, d) -} -func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) { - if v, changed := f.DecMapStringBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringBoolV(v map[string]bool, canChange bool, - d *Decoder) (_ map[string]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[string]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk string - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeString() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]interface{}) - if v, changed := fastpathTV.DecMapFloat32IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32IntfV(rv2i(rv).(map[float32]interface{}), false, d) -} -func (f fastpathT) DecMapFloat32IntfX(vp *map[float32]interface{}, d *Decoder) { - if v, changed := f.DecMapFloat32IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, canChange bool, - d *Decoder) (_ map[float32]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[float32]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk float32 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]string) - if v, changed := fastpathTV.DecMapFloat32StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32StringV(rv2i(rv).(map[float32]string), false, d) -} -func (f fastpathT) DecMapFloat32StringX(vp *map[float32]string, d *Decoder) { - if v, changed := f.DecMapFloat32StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, canChange bool, - d *Decoder) (_ map[float32]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[float32]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]uint) - if v, changed := fastpathTV.DecMapFloat32UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32UintV(rv2i(rv).(map[float32]uint), false, d) -} -func (f fastpathT) DecMapFloat32UintX(vp *map[float32]uint, d *Decoder) { - if v, changed := f.DecMapFloat32UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, canChange bool, - d *Decoder) (_ map[float32]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]uint8) - if v, changed := fastpathTV.DecMapFloat32Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Uint8V(rv2i(rv).(map[float32]uint8), false, d) -} -func (f fastpathT) DecMapFloat32Uint8X(vp *map[float32]uint8, d *Decoder) { - if v, changed := f.DecMapFloat32Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, canChange bool, - d *Decoder) (_ map[float32]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[float32]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]uint16) - if v, changed := fastpathTV.DecMapFloat32Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Uint16V(rv2i(rv).(map[float32]uint16), false, d) -} -func (f fastpathT) DecMapFloat32Uint16X(vp *map[float32]uint16, d *Decoder) { - if v, changed := f.DecMapFloat32Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, canChange bool, - d *Decoder) (_ map[float32]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[float32]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]uint32) - if v, changed := fastpathTV.DecMapFloat32Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Uint32V(rv2i(rv).(map[float32]uint32), false, d) -} -func (f fastpathT) DecMapFloat32Uint32X(vp *map[float32]uint32, d *Decoder) { - if v, changed := f.DecMapFloat32Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, canChange bool, - d *Decoder) (_ map[float32]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[float32]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]uint64) - if v, changed := fastpathTV.DecMapFloat32Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Uint64V(rv2i(rv).(map[float32]uint64), false, d) -} -func (f fastpathT) DecMapFloat32Uint64X(vp *map[float32]uint64, d *Decoder) { - if v, changed := f.DecMapFloat32Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, canChange bool, - d *Decoder) (_ map[float32]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]uintptr) - if v, changed := fastpathTV.DecMapFloat32UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32UintptrV(rv2i(rv).(map[float32]uintptr), false, d) -} -func (f fastpathT) DecMapFloat32UintptrX(vp *map[float32]uintptr, d *Decoder) { - if v, changed := f.DecMapFloat32UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32UintptrV(v map[float32]uintptr, canChange bool, - d *Decoder) (_ map[float32]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]int) - if v, changed := fastpathTV.DecMapFloat32IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32IntV(rv2i(rv).(map[float32]int), false, d) -} -func (f fastpathT) DecMapFloat32IntX(vp *map[float32]int, d *Decoder) { - if v, changed := f.DecMapFloat32IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, canChange bool, - d *Decoder) (_ map[float32]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]int8) - if v, changed := fastpathTV.DecMapFloat32Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Int8V(rv2i(rv).(map[float32]int8), false, d) -} -func (f fastpathT) DecMapFloat32Int8X(vp *map[float32]int8, d *Decoder) { - if v, changed := f.DecMapFloat32Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, canChange bool, - d *Decoder) (_ map[float32]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[float32]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]int16) - if v, changed := fastpathTV.DecMapFloat32Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Int16V(rv2i(rv).(map[float32]int16), false, d) -} -func (f fastpathT) DecMapFloat32Int16X(vp *map[float32]int16, d *Decoder) { - if v, changed := f.DecMapFloat32Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, canChange bool, - d *Decoder) (_ map[float32]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[float32]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]int32) - if v, changed := fastpathTV.DecMapFloat32Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Int32V(rv2i(rv).(map[float32]int32), false, d) -} -func (f fastpathT) DecMapFloat32Int32X(vp *map[float32]int32, d *Decoder) { - if v, changed := f.DecMapFloat32Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, canChange bool, - d *Decoder) (_ map[float32]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[float32]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]int64) - if v, changed := fastpathTV.DecMapFloat32Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Int64V(rv2i(rv).(map[float32]int64), false, d) -} -func (f fastpathT) DecMapFloat32Int64X(vp *map[float32]int64, d *Decoder) { - if v, changed := f.DecMapFloat32Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, canChange bool, - d *Decoder) (_ map[float32]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]float32) - if v, changed := fastpathTV.DecMapFloat32Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Float32V(rv2i(rv).(map[float32]float32), false, d) -} -func (f fastpathT) DecMapFloat32Float32X(vp *map[float32]float32, d *Decoder) { - if v, changed := f.DecMapFloat32Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, canChange bool, - d *Decoder) (_ map[float32]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[float32]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]float64) - if v, changed := fastpathTV.DecMapFloat32Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32Float64V(rv2i(rv).(map[float32]float64), false, d) -} -func (f fastpathT) DecMapFloat32Float64X(vp *map[float32]float64, d *Decoder) { - if v, changed := f.DecMapFloat32Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, canChange bool, - d *Decoder) (_ map[float32]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat32BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float32]bool) - if v, changed := fastpathTV.DecMapFloat32BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat32BoolV(rv2i(rv).(map[float32]bool), false, d) -} -func (f fastpathT) DecMapFloat32BoolX(vp *map[float32]bool, d *Decoder) { - if v, changed := f.DecMapFloat32BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, canChange bool, - d *Decoder) (_ map[float32]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[float32]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float32 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = float32(dd.DecodeFloat(true)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]interface{}) - if v, changed := fastpathTV.DecMapFloat64IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64IntfV(rv2i(rv).(map[float64]interface{}), false, d) -} -func (f fastpathT) DecMapFloat64IntfX(vp *map[float64]interface{}, d *Decoder) { - if v, changed := f.DecMapFloat64IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, canChange bool, - d *Decoder) (_ map[float64]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[float64]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk float64 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]string) - if v, changed := fastpathTV.DecMapFloat64StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64StringV(rv2i(rv).(map[float64]string), false, d) -} -func (f fastpathT) DecMapFloat64StringX(vp *map[float64]string, d *Decoder) { - if v, changed := f.DecMapFloat64StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, canChange bool, - d *Decoder) (_ map[float64]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[float64]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]uint) - if v, changed := fastpathTV.DecMapFloat64UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64UintV(rv2i(rv).(map[float64]uint), false, d) -} -func (f fastpathT) DecMapFloat64UintX(vp *map[float64]uint, d *Decoder) { - if v, changed := f.DecMapFloat64UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, canChange bool, - d *Decoder) (_ map[float64]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]uint8) - if v, changed := fastpathTV.DecMapFloat64Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Uint8V(rv2i(rv).(map[float64]uint8), false, d) -} -func (f fastpathT) DecMapFloat64Uint8X(vp *map[float64]uint8, d *Decoder) { - if v, changed := f.DecMapFloat64Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, canChange bool, - d *Decoder) (_ map[float64]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[float64]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]uint16) - if v, changed := fastpathTV.DecMapFloat64Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Uint16V(rv2i(rv).(map[float64]uint16), false, d) -} -func (f fastpathT) DecMapFloat64Uint16X(vp *map[float64]uint16, d *Decoder) { - if v, changed := f.DecMapFloat64Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, canChange bool, - d *Decoder) (_ map[float64]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[float64]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]uint32) - if v, changed := fastpathTV.DecMapFloat64Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Uint32V(rv2i(rv).(map[float64]uint32), false, d) -} -func (f fastpathT) DecMapFloat64Uint32X(vp *map[float64]uint32, d *Decoder) { - if v, changed := f.DecMapFloat64Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, canChange bool, - d *Decoder) (_ map[float64]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float64]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]uint64) - if v, changed := fastpathTV.DecMapFloat64Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Uint64V(rv2i(rv).(map[float64]uint64), false, d) -} -func (f fastpathT) DecMapFloat64Uint64X(vp *map[float64]uint64, d *Decoder) { - if v, changed := f.DecMapFloat64Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, canChange bool, - d *Decoder) (_ map[float64]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]uintptr) - if v, changed := fastpathTV.DecMapFloat64UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64UintptrV(rv2i(rv).(map[float64]uintptr), false, d) -} -func (f fastpathT) DecMapFloat64UintptrX(vp *map[float64]uintptr, d *Decoder) { - if v, changed := f.DecMapFloat64UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64UintptrV(v map[float64]uintptr, canChange bool, - d *Decoder) (_ map[float64]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]int) - if v, changed := fastpathTV.DecMapFloat64IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64IntV(rv2i(rv).(map[float64]int), false, d) -} -func (f fastpathT) DecMapFloat64IntX(vp *map[float64]int, d *Decoder) { - if v, changed := f.DecMapFloat64IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, canChange bool, - d *Decoder) (_ map[float64]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]int8) - if v, changed := fastpathTV.DecMapFloat64Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Int8V(rv2i(rv).(map[float64]int8), false, d) -} -func (f fastpathT) DecMapFloat64Int8X(vp *map[float64]int8, d *Decoder) { - if v, changed := f.DecMapFloat64Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, canChange bool, - d *Decoder) (_ map[float64]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[float64]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]int16) - if v, changed := fastpathTV.DecMapFloat64Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Int16V(rv2i(rv).(map[float64]int16), false, d) -} -func (f fastpathT) DecMapFloat64Int16X(vp *map[float64]int16, d *Decoder) { - if v, changed := f.DecMapFloat64Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, canChange bool, - d *Decoder) (_ map[float64]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[float64]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]int32) - if v, changed := fastpathTV.DecMapFloat64Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Int32V(rv2i(rv).(map[float64]int32), false, d) -} -func (f fastpathT) DecMapFloat64Int32X(vp *map[float64]int32, d *Decoder) { - if v, changed := f.DecMapFloat64Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, canChange bool, - d *Decoder) (_ map[float64]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float64]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]int64) - if v, changed := fastpathTV.DecMapFloat64Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Int64V(rv2i(rv).(map[float64]int64), false, d) -} -func (f fastpathT) DecMapFloat64Int64X(vp *map[float64]int64, d *Decoder) { - if v, changed := f.DecMapFloat64Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, canChange bool, - d *Decoder) (_ map[float64]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]float32) - if v, changed := fastpathTV.DecMapFloat64Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Float32V(rv2i(rv).(map[float64]float32), false, d) -} -func (f fastpathT) DecMapFloat64Float32X(vp *map[float64]float32, d *Decoder) { - if v, changed := f.DecMapFloat64Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, canChange bool, - d *Decoder) (_ map[float64]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float64]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]float64) - if v, changed := fastpathTV.DecMapFloat64Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64Float64V(rv2i(rv).(map[float64]float64), false, d) -} -func (f fastpathT) DecMapFloat64Float64X(vp *map[float64]float64, d *Decoder) { - if v, changed := f.DecMapFloat64Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, canChange bool, - d *Decoder) (_ map[float64]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapFloat64BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[float64]bool) - if v, changed := fastpathTV.DecMapFloat64BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapFloat64BoolV(rv2i(rv).(map[float64]bool), false, d) -} -func (f fastpathT) DecMapFloat64BoolX(vp *map[float64]bool, d *Decoder) { - if v, changed := f.DecMapFloat64BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, canChange bool, - d *Decoder) (_ map[float64]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[float64]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk float64 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeFloat(false) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]interface{}) - if v, changed := fastpathTV.DecMapUintIntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintIntfV(rv2i(rv).(map[uint]interface{}), false, d) -} -func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) { - if v, changed := f.DecMapUintIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, canChange bool, - d *Decoder) (_ map[uint]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]string) - if v, changed := fastpathTV.DecMapUintStringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintStringV(rv2i(rv).(map[uint]string), false, d) -} -func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) { - if v, changed := f.DecMapUintStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintStringV(v map[uint]string, canChange bool, - d *Decoder) (_ map[uint]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]uint) - if v, changed := fastpathTV.DecMapUintUintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintUintV(rv2i(rv).(map[uint]uint), false, d) -} -func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) { - if v, changed := f.DecMapUintUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUintV(v map[uint]uint, canChange bool, - d *Decoder) (_ map[uint]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]uint8) - if v, changed := fastpathTV.DecMapUintUint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintUint8V(rv2i(rv).(map[uint]uint8), false, d) -} -func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) { - if v, changed := f.DecMapUintUint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, canChange bool, - d *Decoder) (_ map[uint]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintUint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]uint16) - if v, changed := fastpathTV.DecMapUintUint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintUint16V(rv2i(rv).(map[uint]uint16), false, d) -} -func (f fastpathT) DecMapUintUint16X(vp *map[uint]uint16, d *Decoder) { - if v, changed := f.DecMapUintUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, canChange bool, - d *Decoder) (_ map[uint]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintUint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]uint32) - if v, changed := fastpathTV.DecMapUintUint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintUint32V(rv2i(rv).(map[uint]uint32), false, d) -} -func (f fastpathT) DecMapUintUint32X(vp *map[uint]uint32, d *Decoder) { - if v, changed := f.DecMapUintUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, canChange bool, - d *Decoder) (_ map[uint]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]uint64) - if v, changed := fastpathTV.DecMapUintUint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintUint64V(rv2i(rv).(map[uint]uint64), false, d) -} -func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) { - if v, changed := f.DecMapUintUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, canChange bool, - d *Decoder) (_ map[uint]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintUintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]uintptr) - if v, changed := fastpathTV.DecMapUintUintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintUintptrV(rv2i(rv).(map[uint]uintptr), false, d) -} -func (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, d *Decoder) { - if v, changed := f.DecMapUintUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUintptrV(v map[uint]uintptr, canChange bool, - d *Decoder) (_ map[uint]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]int) - if v, changed := fastpathTV.DecMapUintIntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintIntV(rv2i(rv).(map[uint]int), false, d) -} -func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) { - if v, changed := f.DecMapUintIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintIntV(v map[uint]int, canChange bool, - d *Decoder) (_ map[uint]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintInt8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]int8) - if v, changed := fastpathTV.DecMapUintInt8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintInt8V(rv2i(rv).(map[uint]int8), false, d) -} -func (f fastpathT) DecMapUintInt8X(vp *map[uint]int8, d *Decoder) { - if v, changed := f.DecMapUintInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, canChange bool, - d *Decoder) (_ map[uint]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintInt16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]int16) - if v, changed := fastpathTV.DecMapUintInt16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintInt16V(rv2i(rv).(map[uint]int16), false, d) -} -func (f fastpathT) DecMapUintInt16X(vp *map[uint]int16, d *Decoder) { - if v, changed := f.DecMapUintInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, canChange bool, - d *Decoder) (_ map[uint]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintInt32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]int32) - if v, changed := fastpathTV.DecMapUintInt32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintInt32V(rv2i(rv).(map[uint]int32), false, d) -} -func (f fastpathT) DecMapUintInt32X(vp *map[uint]int32, d *Decoder) { - if v, changed := f.DecMapUintInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, canChange bool, - d *Decoder) (_ map[uint]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]int64) - if v, changed := fastpathTV.DecMapUintInt64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintInt64V(rv2i(rv).(map[uint]int64), false, d) -} -func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) { - if v, changed := f.DecMapUintInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, canChange bool, - d *Decoder) (_ map[uint]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]float32) - if v, changed := fastpathTV.DecMapUintFloat32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintFloat32V(rv2i(rv).(map[uint]float32), false, d) -} -func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) { - if v, changed := f.DecMapUintFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, canChange bool, - d *Decoder) (_ map[uint]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]float64) - if v, changed := fastpathTV.DecMapUintFloat64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintFloat64V(rv2i(rv).(map[uint]float64), false, d) -} -func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) { - if v, changed := f.DecMapUintFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, canChange bool, - d *Decoder) (_ map[uint]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint]bool) - if v, changed := fastpathTV.DecMapUintBoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintBoolV(rv2i(rv).(map[uint]bool), false, d) -} -func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) { - if v, changed := f.DecMapUintBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, canChange bool, - d *Decoder) (_ map[uint]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]interface{}) - if v, changed := fastpathTV.DecMapUint8IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), false, d) -} -func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) { - if v, changed := f.DecMapUint8IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, canChange bool, - d *Decoder) (_ map[uint8]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[uint8]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint8 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]string) - if v, changed := fastpathTV.DecMapUint8StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8StringV(rv2i(rv).(map[uint8]string), false, d) -} -func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) { - if v, changed := f.DecMapUint8StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, canChange bool, - d *Decoder) (_ map[uint8]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[uint8]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]uint) - if v, changed := fastpathTV.DecMapUint8UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8UintV(rv2i(rv).(map[uint8]uint), false, d) -} -func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) { - if v, changed := f.DecMapUint8UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, canChange bool, - d *Decoder) (_ map[uint8]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]uint8) - if v, changed := fastpathTV.DecMapUint8Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), false, d) -} -func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) { - if v, changed := f.DecMapUint8Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, canChange bool, - d *Decoder) (_ map[uint8]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[uint8]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]uint16) - if v, changed := fastpathTV.DecMapUint8Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Uint16V(rv2i(rv).(map[uint8]uint16), false, d) -} -func (f fastpathT) DecMapUint8Uint16X(vp *map[uint8]uint16, d *Decoder) { - if v, changed := f.DecMapUint8Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, canChange bool, - d *Decoder) (_ map[uint8]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint8]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]uint32) - if v, changed := fastpathTV.DecMapUint8Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Uint32V(rv2i(rv).(map[uint8]uint32), false, d) -} -func (f fastpathT) DecMapUint8Uint32X(vp *map[uint8]uint32, d *Decoder) { - if v, changed := f.DecMapUint8Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, canChange bool, - d *Decoder) (_ map[uint8]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint8]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]uint64) - if v, changed := fastpathTV.DecMapUint8Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), false, d) -} -func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) { - if v, changed := f.DecMapUint8Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, canChange bool, - d *Decoder) (_ map[uint8]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]uintptr) - if v, changed := fastpathTV.DecMapUint8UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), false, d) -} -func (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, d *Decoder) { - if v, changed := f.DecMapUint8UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, canChange bool, - d *Decoder) (_ map[uint8]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]int) - if v, changed := fastpathTV.DecMapUint8IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8IntV(rv2i(rv).(map[uint8]int), false, d) -} -func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) { - if v, changed := f.DecMapUint8IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, canChange bool, - d *Decoder) (_ map[uint8]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]int8) - if v, changed := fastpathTV.DecMapUint8Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Int8V(rv2i(rv).(map[uint8]int8), false, d) -} -func (f fastpathT) DecMapUint8Int8X(vp *map[uint8]int8, d *Decoder) { - if v, changed := f.DecMapUint8Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, canChange bool, - d *Decoder) (_ map[uint8]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[uint8]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]int16) - if v, changed := fastpathTV.DecMapUint8Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Int16V(rv2i(rv).(map[uint8]int16), false, d) -} -func (f fastpathT) DecMapUint8Int16X(vp *map[uint8]int16, d *Decoder) { - if v, changed := f.DecMapUint8Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, canChange bool, - d *Decoder) (_ map[uint8]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint8]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]int32) - if v, changed := fastpathTV.DecMapUint8Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Int32V(rv2i(rv).(map[uint8]int32), false, d) -} -func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, d *Decoder) { - if v, changed := f.DecMapUint8Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, canChange bool, - d *Decoder) (_ map[uint8]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint8]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]int64) - if v, changed := fastpathTV.DecMapUint8Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Int64V(rv2i(rv).(map[uint8]int64), false, d) -} -func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) { - if v, changed := f.DecMapUint8Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, canChange bool, - d *Decoder) (_ map[uint8]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]float32) - if v, changed := fastpathTV.DecMapUint8Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Float32V(rv2i(rv).(map[uint8]float32), false, d) -} -func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) { - if v, changed := f.DecMapUint8Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, canChange bool, - d *Decoder) (_ map[uint8]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint8]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]float64) - if v, changed := fastpathTV.DecMapUint8Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8Float64V(rv2i(rv).(map[uint8]float64), false, d) -} -func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) { - if v, changed := f.DecMapUint8Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, canChange bool, - d *Decoder) (_ map[uint8]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint8]bool) - if v, changed := fastpathTV.DecMapUint8BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint8BoolV(rv2i(rv).(map[uint8]bool), false, d) -} -func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) { - if v, changed := f.DecMapUint8BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, canChange bool, - d *Decoder) (_ map[uint8]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[uint8]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint8 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint8(dd.DecodeUint(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]interface{}) - if v, changed := fastpathTV.DecMapUint16IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16IntfV(rv2i(rv).(map[uint16]interface{}), false, d) -} -func (f fastpathT) DecMapUint16IntfX(vp *map[uint16]interface{}, d *Decoder) { - if v, changed := f.DecMapUint16IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, canChange bool, - d *Decoder) (_ map[uint16]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[uint16]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint16 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]string) - if v, changed := fastpathTV.DecMapUint16StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16StringV(rv2i(rv).(map[uint16]string), false, d) -} -func (f fastpathT) DecMapUint16StringX(vp *map[uint16]string, d *Decoder) { - if v, changed := f.DecMapUint16StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, canChange bool, - d *Decoder) (_ map[uint16]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[uint16]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]uint) - if v, changed := fastpathTV.DecMapUint16UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16UintV(rv2i(rv).(map[uint16]uint), false, d) -} -func (f fastpathT) DecMapUint16UintX(vp *map[uint16]uint, d *Decoder) { - if v, changed := f.DecMapUint16UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, canChange bool, - d *Decoder) (_ map[uint16]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]uint8) - if v, changed := fastpathTV.DecMapUint16Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Uint8V(rv2i(rv).(map[uint16]uint8), false, d) -} -func (f fastpathT) DecMapUint16Uint8X(vp *map[uint16]uint8, d *Decoder) { - if v, changed := f.DecMapUint16Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, canChange bool, - d *Decoder) (_ map[uint16]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint16]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]uint16) - if v, changed := fastpathTV.DecMapUint16Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Uint16V(rv2i(rv).(map[uint16]uint16), false, d) -} -func (f fastpathT) DecMapUint16Uint16X(vp *map[uint16]uint16, d *Decoder) { - if v, changed := f.DecMapUint16Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, canChange bool, - d *Decoder) (_ map[uint16]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[uint16]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]uint32) - if v, changed := fastpathTV.DecMapUint16Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Uint32V(rv2i(rv).(map[uint16]uint32), false, d) -} -func (f fastpathT) DecMapUint16Uint32X(vp *map[uint16]uint32, d *Decoder) { - if v, changed := f.DecMapUint16Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, canChange bool, - d *Decoder) (_ map[uint16]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint16]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]uint64) - if v, changed := fastpathTV.DecMapUint16Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Uint64V(rv2i(rv).(map[uint16]uint64), false, d) -} -func (f fastpathT) DecMapUint16Uint64X(vp *map[uint16]uint64, d *Decoder) { - if v, changed := f.DecMapUint16Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, canChange bool, - d *Decoder) (_ map[uint16]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]uintptr) - if v, changed := fastpathTV.DecMapUint16UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16UintptrV(rv2i(rv).(map[uint16]uintptr), false, d) -} -func (f fastpathT) DecMapUint16UintptrX(vp *map[uint16]uintptr, d *Decoder) { - if v, changed := f.DecMapUint16UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16UintptrV(v map[uint16]uintptr, canChange bool, - d *Decoder) (_ map[uint16]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]int) - if v, changed := fastpathTV.DecMapUint16IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16IntV(rv2i(rv).(map[uint16]int), false, d) -} -func (f fastpathT) DecMapUint16IntX(vp *map[uint16]int, d *Decoder) { - if v, changed := f.DecMapUint16IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, canChange bool, - d *Decoder) (_ map[uint16]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]int8) - if v, changed := fastpathTV.DecMapUint16Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Int8V(rv2i(rv).(map[uint16]int8), false, d) -} -func (f fastpathT) DecMapUint16Int8X(vp *map[uint16]int8, d *Decoder) { - if v, changed := f.DecMapUint16Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, canChange bool, - d *Decoder) (_ map[uint16]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint16]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]int16) - if v, changed := fastpathTV.DecMapUint16Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Int16V(rv2i(rv).(map[uint16]int16), false, d) -} -func (f fastpathT) DecMapUint16Int16X(vp *map[uint16]int16, d *Decoder) { - if v, changed := f.DecMapUint16Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, canChange bool, - d *Decoder) (_ map[uint16]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[uint16]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]int32) - if v, changed := fastpathTV.DecMapUint16Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Int32V(rv2i(rv).(map[uint16]int32), false, d) -} -func (f fastpathT) DecMapUint16Int32X(vp *map[uint16]int32, d *Decoder) { - if v, changed := f.DecMapUint16Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, canChange bool, - d *Decoder) (_ map[uint16]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint16]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]int64) - if v, changed := fastpathTV.DecMapUint16Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Int64V(rv2i(rv).(map[uint16]int64), false, d) -} -func (f fastpathT) DecMapUint16Int64X(vp *map[uint16]int64, d *Decoder) { - if v, changed := f.DecMapUint16Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, canChange bool, - d *Decoder) (_ map[uint16]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]float32) - if v, changed := fastpathTV.DecMapUint16Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Float32V(rv2i(rv).(map[uint16]float32), false, d) -} -func (f fastpathT) DecMapUint16Float32X(vp *map[uint16]float32, d *Decoder) { - if v, changed := f.DecMapUint16Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, canChange bool, - d *Decoder) (_ map[uint16]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint16]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]float64) - if v, changed := fastpathTV.DecMapUint16Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16Float64V(rv2i(rv).(map[uint16]float64), false, d) -} -func (f fastpathT) DecMapUint16Float64X(vp *map[uint16]float64, d *Decoder) { - if v, changed := f.DecMapUint16Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, canChange bool, - d *Decoder) (_ map[uint16]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint16BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint16]bool) - if v, changed := fastpathTV.DecMapUint16BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint16BoolV(rv2i(rv).(map[uint16]bool), false, d) -} -func (f fastpathT) DecMapUint16BoolX(vp *map[uint16]bool, d *Decoder) { - if v, changed := f.DecMapUint16BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, canChange bool, - d *Decoder) (_ map[uint16]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint16]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint16 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint16(dd.DecodeUint(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]interface{}) - if v, changed := fastpathTV.DecMapUint32IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32IntfV(rv2i(rv).(map[uint32]interface{}), false, d) -} -func (f fastpathT) DecMapUint32IntfX(vp *map[uint32]interface{}, d *Decoder) { - if v, changed := f.DecMapUint32IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, canChange bool, - d *Decoder) (_ map[uint32]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[uint32]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint32 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]string) - if v, changed := fastpathTV.DecMapUint32StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32StringV(rv2i(rv).(map[uint32]string), false, d) -} -func (f fastpathT) DecMapUint32StringX(vp *map[uint32]string, d *Decoder) { - if v, changed := f.DecMapUint32StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, canChange bool, - d *Decoder) (_ map[uint32]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[uint32]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]uint) - if v, changed := fastpathTV.DecMapUint32UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32UintV(rv2i(rv).(map[uint32]uint), false, d) -} -func (f fastpathT) DecMapUint32UintX(vp *map[uint32]uint, d *Decoder) { - if v, changed := f.DecMapUint32UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, canChange bool, - d *Decoder) (_ map[uint32]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]uint8) - if v, changed := fastpathTV.DecMapUint32Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Uint8V(rv2i(rv).(map[uint32]uint8), false, d) -} -func (f fastpathT) DecMapUint32Uint8X(vp *map[uint32]uint8, d *Decoder) { - if v, changed := f.DecMapUint32Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, canChange bool, - d *Decoder) (_ map[uint32]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint32]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]uint16) - if v, changed := fastpathTV.DecMapUint32Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Uint16V(rv2i(rv).(map[uint32]uint16), false, d) -} -func (f fastpathT) DecMapUint32Uint16X(vp *map[uint32]uint16, d *Decoder) { - if v, changed := f.DecMapUint32Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, canChange bool, - d *Decoder) (_ map[uint32]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint32]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]uint32) - if v, changed := fastpathTV.DecMapUint32Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Uint32V(rv2i(rv).(map[uint32]uint32), false, d) -} -func (f fastpathT) DecMapUint32Uint32X(vp *map[uint32]uint32, d *Decoder) { - if v, changed := f.DecMapUint32Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, canChange bool, - d *Decoder) (_ map[uint32]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[uint32]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]uint64) - if v, changed := fastpathTV.DecMapUint32Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Uint64V(rv2i(rv).(map[uint32]uint64), false, d) -} -func (f fastpathT) DecMapUint32Uint64X(vp *map[uint32]uint64, d *Decoder) { - if v, changed := f.DecMapUint32Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, canChange bool, - d *Decoder) (_ map[uint32]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]uintptr) - if v, changed := fastpathTV.DecMapUint32UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32UintptrV(rv2i(rv).(map[uint32]uintptr), false, d) -} -func (f fastpathT) DecMapUint32UintptrX(vp *map[uint32]uintptr, d *Decoder) { - if v, changed := f.DecMapUint32UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32UintptrV(v map[uint32]uintptr, canChange bool, - d *Decoder) (_ map[uint32]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]int) - if v, changed := fastpathTV.DecMapUint32IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32IntV(rv2i(rv).(map[uint32]int), false, d) -} -func (f fastpathT) DecMapUint32IntX(vp *map[uint32]int, d *Decoder) { - if v, changed := f.DecMapUint32IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, canChange bool, - d *Decoder) (_ map[uint32]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]int8) - if v, changed := fastpathTV.DecMapUint32Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Int8V(rv2i(rv).(map[uint32]int8), false, d) -} -func (f fastpathT) DecMapUint32Int8X(vp *map[uint32]int8, d *Decoder) { - if v, changed := f.DecMapUint32Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, canChange bool, - d *Decoder) (_ map[uint32]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint32]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]int16) - if v, changed := fastpathTV.DecMapUint32Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Int16V(rv2i(rv).(map[uint32]int16), false, d) -} -func (f fastpathT) DecMapUint32Int16X(vp *map[uint32]int16, d *Decoder) { - if v, changed := f.DecMapUint32Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, canChange bool, - d *Decoder) (_ map[uint32]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint32]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]int32) - if v, changed := fastpathTV.DecMapUint32Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Int32V(rv2i(rv).(map[uint32]int32), false, d) -} -func (f fastpathT) DecMapUint32Int32X(vp *map[uint32]int32, d *Decoder) { - if v, changed := f.DecMapUint32Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, canChange bool, - d *Decoder) (_ map[uint32]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[uint32]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]int64) - if v, changed := fastpathTV.DecMapUint32Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Int64V(rv2i(rv).(map[uint32]int64), false, d) -} -func (f fastpathT) DecMapUint32Int64X(vp *map[uint32]int64, d *Decoder) { - if v, changed := f.DecMapUint32Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, canChange bool, - d *Decoder) (_ map[uint32]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]float32) - if v, changed := fastpathTV.DecMapUint32Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Float32V(rv2i(rv).(map[uint32]float32), false, d) -} -func (f fastpathT) DecMapUint32Float32X(vp *map[uint32]float32, d *Decoder) { - if v, changed := f.DecMapUint32Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, canChange bool, - d *Decoder) (_ map[uint32]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[uint32]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]float64) - if v, changed := fastpathTV.DecMapUint32Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32Float64V(rv2i(rv).(map[uint32]float64), false, d) -} -func (f fastpathT) DecMapUint32Float64X(vp *map[uint32]float64, d *Decoder) { - if v, changed := f.DecMapUint32Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, canChange bool, - d *Decoder) (_ map[uint32]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint32BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint32]bool) - if v, changed := fastpathTV.DecMapUint32BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint32BoolV(rv2i(rv).(map[uint32]bool), false, d) -} -func (f fastpathT) DecMapUint32BoolX(vp *map[uint32]bool, d *Decoder) { - if v, changed := f.DecMapUint32BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, canChange bool, - d *Decoder) (_ map[uint32]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint32]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint32 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uint32(dd.DecodeUint(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]interface{}) - if v, changed := fastpathTV.DecMapUint64IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), false, d) -} -func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) { - if v, changed := f.DecMapUint64IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, canChange bool, - d *Decoder) (_ map[uint64]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint64]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint64 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]string) - if v, changed := fastpathTV.DecMapUint64StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64StringV(rv2i(rv).(map[uint64]string), false, d) -} -func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) { - if v, changed := f.DecMapUint64StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, canChange bool, - d *Decoder) (_ map[uint64]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint64]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]uint) - if v, changed := fastpathTV.DecMapUint64UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64UintV(rv2i(rv).(map[uint64]uint), false, d) -} -func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) { - if v, changed := f.DecMapUint64UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, canChange bool, - d *Decoder) (_ map[uint64]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]uint8) - if v, changed := fastpathTV.DecMapUint64Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), false, d) -} -func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) { - if v, changed := f.DecMapUint64Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, canChange bool, - d *Decoder) (_ map[uint64]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint64]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]uint16) - if v, changed := fastpathTV.DecMapUint64Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Uint16V(rv2i(rv).(map[uint64]uint16), false, d) -} -func (f fastpathT) DecMapUint64Uint16X(vp *map[uint64]uint16, d *Decoder) { - if v, changed := f.DecMapUint64Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, canChange bool, - d *Decoder) (_ map[uint64]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint64]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]uint32) - if v, changed := fastpathTV.DecMapUint64Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Uint32V(rv2i(rv).(map[uint64]uint32), false, d) -} -func (f fastpathT) DecMapUint64Uint32X(vp *map[uint64]uint32, d *Decoder) { - if v, changed := f.DecMapUint64Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, canChange bool, - d *Decoder) (_ map[uint64]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint64]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]uint64) - if v, changed := fastpathTV.DecMapUint64Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), false, d) -} -func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) { - if v, changed := f.DecMapUint64Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, canChange bool, - d *Decoder) (_ map[uint64]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]uintptr) - if v, changed := fastpathTV.DecMapUint64UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), false, d) -} -func (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, d *Decoder) { - if v, changed := f.DecMapUint64UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, canChange bool, - d *Decoder) (_ map[uint64]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]int) - if v, changed := fastpathTV.DecMapUint64IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64IntV(rv2i(rv).(map[uint64]int), false, d) -} -func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) { - if v, changed := f.DecMapUint64IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, canChange bool, - d *Decoder) (_ map[uint64]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]int8) - if v, changed := fastpathTV.DecMapUint64Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Int8V(rv2i(rv).(map[uint64]int8), false, d) -} -func (f fastpathT) DecMapUint64Int8X(vp *map[uint64]int8, d *Decoder) { - if v, changed := f.DecMapUint64Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, canChange bool, - d *Decoder) (_ map[uint64]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint64]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]int16) - if v, changed := fastpathTV.DecMapUint64Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Int16V(rv2i(rv).(map[uint64]int16), false, d) -} -func (f fastpathT) DecMapUint64Int16X(vp *map[uint64]int16, d *Decoder) { - if v, changed := f.DecMapUint64Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, canChange bool, - d *Decoder) (_ map[uint64]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint64]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]int32) - if v, changed := fastpathTV.DecMapUint64Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Int32V(rv2i(rv).(map[uint64]int32), false, d) -} -func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, d *Decoder) { - if v, changed := f.DecMapUint64Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, canChange bool, - d *Decoder) (_ map[uint64]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint64]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]int64) - if v, changed := fastpathTV.DecMapUint64Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Int64V(rv2i(rv).(map[uint64]int64), false, d) -} -func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) { - if v, changed := f.DecMapUint64Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, canChange bool, - d *Decoder) (_ map[uint64]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]float32) - if v, changed := fastpathTV.DecMapUint64Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Float32V(rv2i(rv).(map[uint64]float32), false, d) -} -func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) { - if v, changed := f.DecMapUint64Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, canChange bool, - d *Decoder) (_ map[uint64]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint64]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]float64) - if v, changed := fastpathTV.DecMapUint64Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64Float64V(rv2i(rv).(map[uint64]float64), false, d) -} -func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) { - if v, changed := f.DecMapUint64Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, canChange bool, - d *Decoder) (_ map[uint64]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uint64]bool) - if v, changed := fastpathTV.DecMapUint64BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUint64BoolV(rv2i(rv).(map[uint64]bool), false, d) -} -func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) { - if v, changed := f.DecMapUint64BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, canChange bool, - d *Decoder) (_ map[uint64]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint64]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uint64 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeUint(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]interface{}) - if v, changed := fastpathTV.DecMapUintptrIntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), false, d) -} -func (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, d *Decoder) { - if v, changed := f.DecMapUintptrIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, canChange bool, - d *Decoder) (_ map[uintptr]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uintptr]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uintptr - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrStringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]string) - if v, changed := fastpathTV.DecMapUintptrStringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrStringV(rv2i(rv).(map[uintptr]string), false, d) -} -func (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, d *Decoder) { - if v, changed := f.DecMapUintptrStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrStringV(v map[uintptr]string, canChange bool, - d *Decoder) (_ map[uintptr]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uintptr]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrUintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]uint) - if v, changed := fastpathTV.DecMapUintptrUintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrUintV(rv2i(rv).(map[uintptr]uint), false, d) -} -func (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, d *Decoder) { - if v, changed := f.DecMapUintptrUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUintV(v map[uintptr]uint, canChange bool, - d *Decoder) (_ map[uintptr]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]uint8) - if v, changed := fastpathTV.DecMapUintptrUint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), false, d) -} -func (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, d *Decoder) { - if v, changed := f.DecMapUintptrUint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, canChange bool, - d *Decoder) (_ map[uintptr]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uintptr]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrUint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]uint16) - if v, changed := fastpathTV.DecMapUintptrUint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrUint16V(rv2i(rv).(map[uintptr]uint16), false, d) -} -func (f fastpathT) DecMapUintptrUint16X(vp *map[uintptr]uint16, d *Decoder) { - if v, changed := f.DecMapUintptrUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint16V(v map[uintptr]uint16, canChange bool, - d *Decoder) (_ map[uintptr]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uintptr]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrUint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]uint32) - if v, changed := fastpathTV.DecMapUintptrUint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrUint32V(rv2i(rv).(map[uintptr]uint32), false, d) -} -func (f fastpathT) DecMapUintptrUint32X(vp *map[uintptr]uint32, d *Decoder) { - if v, changed := f.DecMapUintptrUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint32V(v map[uintptr]uint32, canChange bool, - d *Decoder) (_ map[uintptr]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uintptr]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]uint64) - if v, changed := fastpathTV.DecMapUintptrUint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), false, d) -} -func (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, d *Decoder) { - if v, changed := f.DecMapUintptrUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, canChange bool, - d *Decoder) (_ map[uintptr]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]uintptr) - if v, changed := fastpathTV.DecMapUintptrUintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), false, d) -} -func (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, d *Decoder) { - if v, changed := f.DecMapUintptrUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, canChange bool, - d *Decoder) (_ map[uintptr]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrIntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]int) - if v, changed := fastpathTV.DecMapUintptrIntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrIntV(rv2i(rv).(map[uintptr]int), false, d) -} -func (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, d *Decoder) { - if v, changed := f.DecMapUintptrIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrIntV(v map[uintptr]int, canChange bool, - d *Decoder) (_ map[uintptr]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrInt8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]int8) - if v, changed := fastpathTV.DecMapUintptrInt8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrInt8V(rv2i(rv).(map[uintptr]int8), false, d) -} -func (f fastpathT) DecMapUintptrInt8X(vp *map[uintptr]int8, d *Decoder) { - if v, changed := f.DecMapUintptrInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt8V(v map[uintptr]int8, canChange bool, - d *Decoder) (_ map[uintptr]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uintptr]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrInt16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]int16) - if v, changed := fastpathTV.DecMapUintptrInt16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrInt16V(rv2i(rv).(map[uintptr]int16), false, d) -} -func (f fastpathT) DecMapUintptrInt16X(vp *map[uintptr]int16, d *Decoder) { - if v, changed := f.DecMapUintptrInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt16V(v map[uintptr]int16, canChange bool, - d *Decoder) (_ map[uintptr]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uintptr]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrInt32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]int32) - if v, changed := fastpathTV.DecMapUintptrInt32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrInt32V(rv2i(rv).(map[uintptr]int32), false, d) -} -func (f fastpathT) DecMapUintptrInt32X(vp *map[uintptr]int32, d *Decoder) { - if v, changed := f.DecMapUintptrInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt32V(v map[uintptr]int32, canChange bool, - d *Decoder) (_ map[uintptr]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uintptr]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]int64) - if v, changed := fastpathTV.DecMapUintptrInt64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), false, d) -} -func (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, d *Decoder) { - if v, changed := f.DecMapUintptrInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, canChange bool, - d *Decoder) (_ map[uintptr]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]float32) - if v, changed := fastpathTV.DecMapUintptrFloat32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), false, d) -} -func (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, d *Decoder) { - if v, changed := f.DecMapUintptrFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, canChange bool, - d *Decoder) (_ map[uintptr]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uintptr]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]float64) - if v, changed := fastpathTV.DecMapUintptrFloat64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), false, d) -} -func (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, d *Decoder) { - if v, changed := f.DecMapUintptrFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, canChange bool, - d *Decoder) (_ map[uintptr]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[uintptr]bool) - if v, changed := fastpathTV.DecMapUintptrBoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), false, d) -} -func (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, d *Decoder) { - if v, changed := f.DecMapUintptrBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, canChange bool, - d *Decoder) (_ map[uintptr]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uintptr]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk uintptr - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]interface{}) - if v, changed := fastpathTV.DecMapIntIntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntIntfV(rv2i(rv).(map[int]interface{}), false, d) -} -func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) { - if v, changed := f.DecMapIntIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, canChange bool, - d *Decoder) (_ map[int]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]string) - if v, changed := fastpathTV.DecMapIntStringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntStringV(rv2i(rv).(map[int]string), false, d) -} -func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) { - if v, changed := f.DecMapIntStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntStringV(v map[int]string, canChange bool, - d *Decoder) (_ map[int]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]uint) - if v, changed := fastpathTV.DecMapIntUintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntUintV(rv2i(rv).(map[int]uint), false, d) -} -func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) { - if v, changed := f.DecMapIntUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUintV(v map[int]uint, canChange bool, - d *Decoder) (_ map[int]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]uint8) - if v, changed := fastpathTV.DecMapIntUint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntUint8V(rv2i(rv).(map[int]uint8), false, d) -} -func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) { - if v, changed := f.DecMapIntUint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, canChange bool, - d *Decoder) (_ map[int]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntUint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]uint16) - if v, changed := fastpathTV.DecMapIntUint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntUint16V(rv2i(rv).(map[int]uint16), false, d) -} -func (f fastpathT) DecMapIntUint16X(vp *map[int]uint16, d *Decoder) { - if v, changed := f.DecMapIntUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, canChange bool, - d *Decoder) (_ map[int]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntUint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]uint32) - if v, changed := fastpathTV.DecMapIntUint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntUint32V(rv2i(rv).(map[int]uint32), false, d) -} -func (f fastpathT) DecMapIntUint32X(vp *map[int]uint32, d *Decoder) { - if v, changed := f.DecMapIntUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, canChange bool, - d *Decoder) (_ map[int]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]uint64) - if v, changed := fastpathTV.DecMapIntUint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntUint64V(rv2i(rv).(map[int]uint64), false, d) -} -func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) { - if v, changed := f.DecMapIntUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, canChange bool, - d *Decoder) (_ map[int]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntUintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]uintptr) - if v, changed := fastpathTV.DecMapIntUintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntUintptrV(rv2i(rv).(map[int]uintptr), false, d) -} -func (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, d *Decoder) { - if v, changed := f.DecMapIntUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUintptrV(v map[int]uintptr, canChange bool, - d *Decoder) (_ map[int]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]int) - if v, changed := fastpathTV.DecMapIntIntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntIntV(rv2i(rv).(map[int]int), false, d) -} -func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) { - if v, changed := f.DecMapIntIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntIntV(v map[int]int, canChange bool, - d *Decoder) (_ map[int]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntInt8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]int8) - if v, changed := fastpathTV.DecMapIntInt8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntInt8V(rv2i(rv).(map[int]int8), false, d) -} -func (f fastpathT) DecMapIntInt8X(vp *map[int]int8, d *Decoder) { - if v, changed := f.DecMapIntInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt8V(v map[int]int8, canChange bool, - d *Decoder) (_ map[int]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntInt16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]int16) - if v, changed := fastpathTV.DecMapIntInt16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntInt16V(rv2i(rv).(map[int]int16), false, d) -} -func (f fastpathT) DecMapIntInt16X(vp *map[int]int16, d *Decoder) { - if v, changed := f.DecMapIntInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt16V(v map[int]int16, canChange bool, - d *Decoder) (_ map[int]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntInt32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]int32) - if v, changed := fastpathTV.DecMapIntInt32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntInt32V(rv2i(rv).(map[int]int32), false, d) -} -func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, d *Decoder) { - if v, changed := f.DecMapIntInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt32V(v map[int]int32, canChange bool, - d *Decoder) (_ map[int]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]int64) - if v, changed := fastpathTV.DecMapIntInt64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntInt64V(rv2i(rv).(map[int]int64), false, d) -} -func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) { - if v, changed := f.DecMapIntInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt64V(v map[int]int64, canChange bool, - d *Decoder) (_ map[int]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]float32) - if v, changed := fastpathTV.DecMapIntFloat32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntFloat32V(rv2i(rv).(map[int]float32), false, d) -} -func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) { - if v, changed := f.DecMapIntFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, canChange bool, - d *Decoder) (_ map[int]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]float64) - if v, changed := fastpathTV.DecMapIntFloat64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntFloat64V(rv2i(rv).(map[int]float64), false, d) -} -func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) { - if v, changed := f.DecMapIntFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, canChange bool, - d *Decoder) (_ map[int]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int]bool) - if v, changed := fastpathTV.DecMapIntBoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapIntBoolV(rv2i(rv).(map[int]bool), false, d) -} -func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) { - if v, changed := f.DecMapIntBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntBoolV(v map[int]bool, canChange bool, - d *Decoder) (_ map[int]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int(dd.DecodeInt(intBitsize)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]interface{}) - if v, changed := fastpathTV.DecMapInt8IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8IntfV(rv2i(rv).(map[int8]interface{}), false, d) -} -func (f fastpathT) DecMapInt8IntfX(vp *map[int8]interface{}, d *Decoder) { - if v, changed := f.DecMapInt8IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, canChange bool, - d *Decoder) (_ map[int8]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[int8]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int8 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]string) - if v, changed := fastpathTV.DecMapInt8StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8StringV(rv2i(rv).(map[int8]string), false, d) -} -func (f fastpathT) DecMapInt8StringX(vp *map[int8]string, d *Decoder) { - if v, changed := f.DecMapInt8StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8StringV(v map[int8]string, canChange bool, - d *Decoder) (_ map[int8]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[int8]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]uint) - if v, changed := fastpathTV.DecMapInt8UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8UintV(rv2i(rv).(map[int8]uint), false, d) -} -func (f fastpathT) DecMapInt8UintX(vp *map[int8]uint, d *Decoder) { - if v, changed := f.DecMapInt8UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, canChange bool, - d *Decoder) (_ map[int8]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]uint8) - if v, changed := fastpathTV.DecMapInt8Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Uint8V(rv2i(rv).(map[int8]uint8), false, d) -} -func (f fastpathT) DecMapInt8Uint8X(vp *map[int8]uint8, d *Decoder) { - if v, changed := f.DecMapInt8Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, canChange bool, - d *Decoder) (_ map[int8]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[int8]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]uint16) - if v, changed := fastpathTV.DecMapInt8Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Uint16V(rv2i(rv).(map[int8]uint16), false, d) -} -func (f fastpathT) DecMapInt8Uint16X(vp *map[int8]uint16, d *Decoder) { - if v, changed := f.DecMapInt8Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, canChange bool, - d *Decoder) (_ map[int8]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int8]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]uint32) - if v, changed := fastpathTV.DecMapInt8Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Uint32V(rv2i(rv).(map[int8]uint32), false, d) -} -func (f fastpathT) DecMapInt8Uint32X(vp *map[int8]uint32, d *Decoder) { - if v, changed := f.DecMapInt8Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, canChange bool, - d *Decoder) (_ map[int8]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int8]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]uint64) - if v, changed := fastpathTV.DecMapInt8Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Uint64V(rv2i(rv).(map[int8]uint64), false, d) -} -func (f fastpathT) DecMapInt8Uint64X(vp *map[int8]uint64, d *Decoder) { - if v, changed := f.DecMapInt8Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, canChange bool, - d *Decoder) (_ map[int8]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]uintptr) - if v, changed := fastpathTV.DecMapInt8UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8UintptrV(rv2i(rv).(map[int8]uintptr), false, d) -} -func (f fastpathT) DecMapInt8UintptrX(vp *map[int8]uintptr, d *Decoder) { - if v, changed := f.DecMapInt8UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8UintptrV(v map[int8]uintptr, canChange bool, - d *Decoder) (_ map[int8]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]int) - if v, changed := fastpathTV.DecMapInt8IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8IntV(rv2i(rv).(map[int8]int), false, d) -} -func (f fastpathT) DecMapInt8IntX(vp *map[int8]int, d *Decoder) { - if v, changed := f.DecMapInt8IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8IntV(v map[int8]int, canChange bool, - d *Decoder) (_ map[int8]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]int8) - if v, changed := fastpathTV.DecMapInt8Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Int8V(rv2i(rv).(map[int8]int8), false, d) -} -func (f fastpathT) DecMapInt8Int8X(vp *map[int8]int8, d *Decoder) { - if v, changed := f.DecMapInt8Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, canChange bool, - d *Decoder) (_ map[int8]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[int8]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]int16) - if v, changed := fastpathTV.DecMapInt8Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Int16V(rv2i(rv).(map[int8]int16), false, d) -} -func (f fastpathT) DecMapInt8Int16X(vp *map[int8]int16, d *Decoder) { - if v, changed := f.DecMapInt8Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, canChange bool, - d *Decoder) (_ map[int8]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int8]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]int32) - if v, changed := fastpathTV.DecMapInt8Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Int32V(rv2i(rv).(map[int8]int32), false, d) -} -func (f fastpathT) DecMapInt8Int32X(vp *map[int8]int32, d *Decoder) { - if v, changed := f.DecMapInt8Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, canChange bool, - d *Decoder) (_ map[int8]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int8]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]int64) - if v, changed := fastpathTV.DecMapInt8Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Int64V(rv2i(rv).(map[int8]int64), false, d) -} -func (f fastpathT) DecMapInt8Int64X(vp *map[int8]int64, d *Decoder) { - if v, changed := f.DecMapInt8Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, canChange bool, - d *Decoder) (_ map[int8]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]float32) - if v, changed := fastpathTV.DecMapInt8Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Float32V(rv2i(rv).(map[int8]float32), false, d) -} -func (f fastpathT) DecMapInt8Float32X(vp *map[int8]float32, d *Decoder) { - if v, changed := f.DecMapInt8Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, canChange bool, - d *Decoder) (_ map[int8]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int8]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]float64) - if v, changed := fastpathTV.DecMapInt8Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8Float64V(rv2i(rv).(map[int8]float64), false, d) -} -func (f fastpathT) DecMapInt8Float64X(vp *map[int8]float64, d *Decoder) { - if v, changed := f.DecMapInt8Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, canChange bool, - d *Decoder) (_ map[int8]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt8BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int8]bool) - if v, changed := fastpathTV.DecMapInt8BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt8BoolV(rv2i(rv).(map[int8]bool), false, d) -} -func (f fastpathT) DecMapInt8BoolX(vp *map[int8]bool, d *Decoder) { - if v, changed := f.DecMapInt8BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, canChange bool, - d *Decoder) (_ map[int8]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[int8]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int8 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int8(dd.DecodeInt(8)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]interface{}) - if v, changed := fastpathTV.DecMapInt16IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16IntfV(rv2i(rv).(map[int16]interface{}), false, d) -} -func (f fastpathT) DecMapInt16IntfX(vp *map[int16]interface{}, d *Decoder) { - if v, changed := f.DecMapInt16IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, canChange bool, - d *Decoder) (_ map[int16]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[int16]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int16 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]string) - if v, changed := fastpathTV.DecMapInt16StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16StringV(rv2i(rv).(map[int16]string), false, d) -} -func (f fastpathT) DecMapInt16StringX(vp *map[int16]string, d *Decoder) { - if v, changed := f.DecMapInt16StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16StringV(v map[int16]string, canChange bool, - d *Decoder) (_ map[int16]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[int16]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]uint) - if v, changed := fastpathTV.DecMapInt16UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16UintV(rv2i(rv).(map[int16]uint), false, d) -} -func (f fastpathT) DecMapInt16UintX(vp *map[int16]uint, d *Decoder) { - if v, changed := f.DecMapInt16UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, canChange bool, - d *Decoder) (_ map[int16]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]uint8) - if v, changed := fastpathTV.DecMapInt16Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Uint8V(rv2i(rv).(map[int16]uint8), false, d) -} -func (f fastpathT) DecMapInt16Uint8X(vp *map[int16]uint8, d *Decoder) { - if v, changed := f.DecMapInt16Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, canChange bool, - d *Decoder) (_ map[int16]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int16]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]uint16) - if v, changed := fastpathTV.DecMapInt16Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Uint16V(rv2i(rv).(map[int16]uint16), false, d) -} -func (f fastpathT) DecMapInt16Uint16X(vp *map[int16]uint16, d *Decoder) { - if v, changed := f.DecMapInt16Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, canChange bool, - d *Decoder) (_ map[int16]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[int16]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]uint32) - if v, changed := fastpathTV.DecMapInt16Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Uint32V(rv2i(rv).(map[int16]uint32), false, d) -} -func (f fastpathT) DecMapInt16Uint32X(vp *map[int16]uint32, d *Decoder) { - if v, changed := f.DecMapInt16Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, canChange bool, - d *Decoder) (_ map[int16]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int16]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]uint64) - if v, changed := fastpathTV.DecMapInt16Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Uint64V(rv2i(rv).(map[int16]uint64), false, d) -} -func (f fastpathT) DecMapInt16Uint64X(vp *map[int16]uint64, d *Decoder) { - if v, changed := f.DecMapInt16Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, canChange bool, - d *Decoder) (_ map[int16]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]uintptr) - if v, changed := fastpathTV.DecMapInt16UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16UintptrV(rv2i(rv).(map[int16]uintptr), false, d) -} -func (f fastpathT) DecMapInt16UintptrX(vp *map[int16]uintptr, d *Decoder) { - if v, changed := f.DecMapInt16UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16UintptrV(v map[int16]uintptr, canChange bool, - d *Decoder) (_ map[int16]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]int) - if v, changed := fastpathTV.DecMapInt16IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16IntV(rv2i(rv).(map[int16]int), false, d) -} -func (f fastpathT) DecMapInt16IntX(vp *map[int16]int, d *Decoder) { - if v, changed := f.DecMapInt16IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16IntV(v map[int16]int, canChange bool, - d *Decoder) (_ map[int16]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]int8) - if v, changed := fastpathTV.DecMapInt16Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Int8V(rv2i(rv).(map[int16]int8), false, d) -} -func (f fastpathT) DecMapInt16Int8X(vp *map[int16]int8, d *Decoder) { - if v, changed := f.DecMapInt16Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, canChange bool, - d *Decoder) (_ map[int16]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int16]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]int16) - if v, changed := fastpathTV.DecMapInt16Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Int16V(rv2i(rv).(map[int16]int16), false, d) -} -func (f fastpathT) DecMapInt16Int16X(vp *map[int16]int16, d *Decoder) { - if v, changed := f.DecMapInt16Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, canChange bool, - d *Decoder) (_ map[int16]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[int16]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]int32) - if v, changed := fastpathTV.DecMapInt16Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Int32V(rv2i(rv).(map[int16]int32), false, d) -} -func (f fastpathT) DecMapInt16Int32X(vp *map[int16]int32, d *Decoder) { - if v, changed := f.DecMapInt16Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, canChange bool, - d *Decoder) (_ map[int16]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int16]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]int64) - if v, changed := fastpathTV.DecMapInt16Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Int64V(rv2i(rv).(map[int16]int64), false, d) -} -func (f fastpathT) DecMapInt16Int64X(vp *map[int16]int64, d *Decoder) { - if v, changed := f.DecMapInt16Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, canChange bool, - d *Decoder) (_ map[int16]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]float32) - if v, changed := fastpathTV.DecMapInt16Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Float32V(rv2i(rv).(map[int16]float32), false, d) -} -func (f fastpathT) DecMapInt16Float32X(vp *map[int16]float32, d *Decoder) { - if v, changed := f.DecMapInt16Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, canChange bool, - d *Decoder) (_ map[int16]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int16]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]float64) - if v, changed := fastpathTV.DecMapInt16Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16Float64V(rv2i(rv).(map[int16]float64), false, d) -} -func (f fastpathT) DecMapInt16Float64X(vp *map[int16]float64, d *Decoder) { - if v, changed := f.DecMapInt16Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, canChange bool, - d *Decoder) (_ map[int16]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt16BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int16]bool) - if v, changed := fastpathTV.DecMapInt16BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt16BoolV(rv2i(rv).(map[int16]bool), false, d) -} -func (f fastpathT) DecMapInt16BoolX(vp *map[int16]bool, d *Decoder) { - if v, changed := f.DecMapInt16BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, canChange bool, - d *Decoder) (_ map[int16]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int16]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int16 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int16(dd.DecodeInt(16)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]interface{}) - if v, changed := fastpathTV.DecMapInt32IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32IntfV(rv2i(rv).(map[int32]interface{}), false, d) -} -func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, d *Decoder) { - if v, changed := f.DecMapInt32IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, canChange bool, - d *Decoder) (_ map[int32]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[int32]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int32 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]string) - if v, changed := fastpathTV.DecMapInt32StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32StringV(rv2i(rv).(map[int32]string), false, d) -} -func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, d *Decoder) { - if v, changed := f.DecMapInt32StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32StringV(v map[int32]string, canChange bool, - d *Decoder) (_ map[int32]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[int32]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]uint) - if v, changed := fastpathTV.DecMapInt32UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32UintV(rv2i(rv).(map[int32]uint), false, d) -} -func (f fastpathT) DecMapInt32UintX(vp *map[int32]uint, d *Decoder) { - if v, changed := f.DecMapInt32UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, canChange bool, - d *Decoder) (_ map[int32]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]uint8) - if v, changed := fastpathTV.DecMapInt32Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Uint8V(rv2i(rv).(map[int32]uint8), false, d) -} -func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, d *Decoder) { - if v, changed := f.DecMapInt32Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, canChange bool, - d *Decoder) (_ map[int32]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int32]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]uint16) - if v, changed := fastpathTV.DecMapInt32Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Uint16V(rv2i(rv).(map[int32]uint16), false, d) -} -func (f fastpathT) DecMapInt32Uint16X(vp *map[int32]uint16, d *Decoder) { - if v, changed := f.DecMapInt32Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, canChange bool, - d *Decoder) (_ map[int32]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int32]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]uint32) - if v, changed := fastpathTV.DecMapInt32Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Uint32V(rv2i(rv).(map[int32]uint32), false, d) -} -func (f fastpathT) DecMapInt32Uint32X(vp *map[int32]uint32, d *Decoder) { - if v, changed := f.DecMapInt32Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, canChange bool, - d *Decoder) (_ map[int32]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[int32]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]uint64) - if v, changed := fastpathTV.DecMapInt32Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Uint64V(rv2i(rv).(map[int32]uint64), false, d) -} -func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, d *Decoder) { - if v, changed := f.DecMapInt32Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, canChange bool, - d *Decoder) (_ map[int32]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]uintptr) - if v, changed := fastpathTV.DecMapInt32UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32UintptrV(rv2i(rv).(map[int32]uintptr), false, d) -} -func (f fastpathT) DecMapInt32UintptrX(vp *map[int32]uintptr, d *Decoder) { - if v, changed := f.DecMapInt32UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32UintptrV(v map[int32]uintptr, canChange bool, - d *Decoder) (_ map[int32]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]int) - if v, changed := fastpathTV.DecMapInt32IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32IntV(rv2i(rv).(map[int32]int), false, d) -} -func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, d *Decoder) { - if v, changed := f.DecMapInt32IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32IntV(v map[int32]int, canChange bool, - d *Decoder) (_ map[int32]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]int8) - if v, changed := fastpathTV.DecMapInt32Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Int8V(rv2i(rv).(map[int32]int8), false, d) -} -func (f fastpathT) DecMapInt32Int8X(vp *map[int32]int8, d *Decoder) { - if v, changed := f.DecMapInt32Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, canChange bool, - d *Decoder) (_ map[int32]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int32]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]int16) - if v, changed := fastpathTV.DecMapInt32Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Int16V(rv2i(rv).(map[int32]int16), false, d) -} -func (f fastpathT) DecMapInt32Int16X(vp *map[int32]int16, d *Decoder) { - if v, changed := f.DecMapInt32Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, canChange bool, - d *Decoder) (_ map[int32]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int32]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]int32) - if v, changed := fastpathTV.DecMapInt32Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Int32V(rv2i(rv).(map[int32]int32), false, d) -} -func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, d *Decoder) { - if v, changed := f.DecMapInt32Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, canChange bool, - d *Decoder) (_ map[int32]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[int32]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]int64) - if v, changed := fastpathTV.DecMapInt32Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Int64V(rv2i(rv).(map[int32]int64), false, d) -} -func (f fastpathT) DecMapInt32Int64X(vp *map[int32]int64, d *Decoder) { - if v, changed := f.DecMapInt32Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, canChange bool, - d *Decoder) (_ map[int32]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]float32) - if v, changed := fastpathTV.DecMapInt32Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Float32V(rv2i(rv).(map[int32]float32), false, d) -} -func (f fastpathT) DecMapInt32Float32X(vp *map[int32]float32, d *Decoder) { - if v, changed := f.DecMapInt32Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, canChange bool, - d *Decoder) (_ map[int32]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[int32]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]float64) - if v, changed := fastpathTV.DecMapInt32Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32Float64V(rv2i(rv).(map[int32]float64), false, d) -} -func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, d *Decoder) { - if v, changed := f.DecMapInt32Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, canChange bool, - d *Decoder) (_ map[int32]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int32]bool) - if v, changed := fastpathTV.DecMapInt32BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt32BoolV(rv2i(rv).(map[int32]bool), false, d) -} -func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, d *Decoder) { - if v, changed := f.DecMapInt32BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, canChange bool, - d *Decoder) (_ map[int32]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int32]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int32 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = int32(dd.DecodeInt(32)) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]interface{}) - if v, changed := fastpathTV.DecMapInt64IntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64IntfV(rv2i(rv).(map[int64]interface{}), false, d) -} -func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) { - if v, changed := f.DecMapInt64IntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, canChange bool, - d *Decoder) (_ map[int64]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int64]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int64 - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]string) - if v, changed := fastpathTV.DecMapInt64StringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64StringV(rv2i(rv).(map[int64]string), false, d) -} -func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) { - if v, changed := f.DecMapInt64StringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64StringV(v map[int64]string, canChange bool, - d *Decoder) (_ map[int64]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int64]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]uint) - if v, changed := fastpathTV.DecMapInt64UintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64UintV(rv2i(rv).(map[int64]uint), false, d) -} -func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) { - if v, changed := f.DecMapInt64UintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, canChange bool, - d *Decoder) (_ map[int64]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]uint8) - if v, changed := fastpathTV.DecMapInt64Uint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Uint8V(rv2i(rv).(map[int64]uint8), false, d) -} -func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) { - if v, changed := f.DecMapInt64Uint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, canChange bool, - d *Decoder) (_ map[int64]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int64]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Uint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]uint16) - if v, changed := fastpathTV.DecMapInt64Uint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Uint16V(rv2i(rv).(map[int64]uint16), false, d) -} -func (f fastpathT) DecMapInt64Uint16X(vp *map[int64]uint16, d *Decoder) { - if v, changed := f.DecMapInt64Uint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, canChange bool, - d *Decoder) (_ map[int64]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int64]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Uint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]uint32) - if v, changed := fastpathTV.DecMapInt64Uint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Uint32V(rv2i(rv).(map[int64]uint32), false, d) -} -func (f fastpathT) DecMapInt64Uint32X(vp *map[int64]uint32, d *Decoder) { - if v, changed := f.DecMapInt64Uint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, canChange bool, - d *Decoder) (_ map[int64]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int64]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]uint64) - if v, changed := fastpathTV.DecMapInt64Uint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Uint64V(rv2i(rv).(map[int64]uint64), false, d) -} -func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) { - if v, changed := f.DecMapInt64Uint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, canChange bool, - d *Decoder) (_ map[int64]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]uintptr) - if v, changed := fastpathTV.DecMapInt64UintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), false, d) -} -func (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, d *Decoder) { - if v, changed := f.DecMapInt64UintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, canChange bool, - d *Decoder) (_ map[int64]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]int) - if v, changed := fastpathTV.DecMapInt64IntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64IntV(rv2i(rv).(map[int64]int), false, d) -} -func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) { - if v, changed := f.DecMapInt64IntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64IntV(v map[int64]int, canChange bool, - d *Decoder) (_ map[int64]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Int8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]int8) - if v, changed := fastpathTV.DecMapInt64Int8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Int8V(rv2i(rv).(map[int64]int8), false, d) -} -func (f fastpathT) DecMapInt64Int8X(vp *map[int64]int8, d *Decoder) { - if v, changed := f.DecMapInt64Int8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, canChange bool, - d *Decoder) (_ map[int64]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int64]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Int16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]int16) - if v, changed := fastpathTV.DecMapInt64Int16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Int16V(rv2i(rv).(map[int64]int16), false, d) -} -func (f fastpathT) DecMapInt64Int16X(vp *map[int64]int16, d *Decoder) { - if v, changed := f.DecMapInt64Int16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, canChange bool, - d *Decoder) (_ map[int64]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int64]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Int32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]int32) - if v, changed := fastpathTV.DecMapInt64Int32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Int32V(rv2i(rv).(map[int64]int32), false, d) -} -func (f fastpathT) DecMapInt64Int32X(vp *map[int64]int32, d *Decoder) { - if v, changed := f.DecMapInt64Int32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, canChange bool, - d *Decoder) (_ map[int64]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int64]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]int64) - if v, changed := fastpathTV.DecMapInt64Int64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Int64V(rv2i(rv).(map[int64]int64), false, d) -} -func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) { - if v, changed := f.DecMapInt64Int64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, canChange bool, - d *Decoder) (_ map[int64]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]float32) - if v, changed := fastpathTV.DecMapInt64Float32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Float32V(rv2i(rv).(map[int64]float32), false, d) -} -func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) { - if v, changed := f.DecMapInt64Float32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, canChange bool, - d *Decoder) (_ map[int64]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int64]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]float64) - if v, changed := fastpathTV.DecMapInt64Float64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64Float64V(rv2i(rv).(map[int64]float64), false, d) -} -func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) { - if v, changed := f.DecMapInt64Float64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, canChange bool, - d *Decoder) (_ map[int64]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[int64]bool) - if v, changed := fastpathTV.DecMapInt64BoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapInt64BoolV(rv2i(rv).(map[int64]bool), false, d) -} -func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) { - if v, changed := f.DecMapInt64BoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, canChange bool, - d *Decoder) (_ map[int64]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int64]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk int64 - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeInt(64) - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolIntfR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]interface{}) - if v, changed := fastpathTV.DecMapBoolIntfV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolIntfV(rv2i(rv).(map[bool]interface{}), false, d) -} -func (f fastpathT) DecMapBoolIntfX(vp *map[bool]interface{}, d *Decoder) { - if v, changed := f.DecMapBoolIntfV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, canChange bool, - d *Decoder) (_ map[bool]interface{}, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[bool]interface{}, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk bool - var mv interface{} - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = nil - } - continue - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolStringR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]string) - if v, changed := fastpathTV.DecMapBoolStringV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolStringV(rv2i(rv).(map[bool]string), false, d) -} -func (f fastpathT) DecMapBoolStringX(vp *map[bool]string, d *Decoder) { - if v, changed := f.DecMapBoolStringV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolStringV(v map[bool]string, canChange bool, - d *Decoder) (_ map[bool]string, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[bool]string, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv string - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = "" - } - continue - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolUintR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]uint) - if v, changed := fastpathTV.DecMapBoolUintV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolUintV(rv2i(rv).(map[bool]uint), false, d) -} -func (f fastpathT) DecMapBoolUintX(vp *map[bool]uint, d *Decoder) { - if v, changed := f.DecMapBoolUintV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, canChange bool, - d *Decoder) (_ map[bool]uint, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]uint, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv uint - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolUint8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]uint8) - if v, changed := fastpathTV.DecMapBoolUint8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolUint8V(rv2i(rv).(map[bool]uint8), false, d) -} -func (f fastpathT) DecMapBoolUint8X(vp *map[bool]uint8, d *Decoder) { - if v, changed := f.DecMapBoolUint8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, canChange bool, - d *Decoder) (_ map[bool]uint8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[bool]uint8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv uint8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolUint16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]uint16) - if v, changed := fastpathTV.DecMapBoolUint16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolUint16V(rv2i(rv).(map[bool]uint16), false, d) -} -func (f fastpathT) DecMapBoolUint16X(vp *map[bool]uint16, d *Decoder) { - if v, changed := f.DecMapBoolUint16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, canChange bool, - d *Decoder) (_ map[bool]uint16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[bool]uint16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv uint16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolUint32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]uint32) - if v, changed := fastpathTV.DecMapBoolUint32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolUint32V(rv2i(rv).(map[bool]uint32), false, d) -} -func (f fastpathT) DecMapBoolUint32X(vp *map[bool]uint32, d *Decoder) { - if v, changed := f.DecMapBoolUint32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, canChange bool, - d *Decoder) (_ map[bool]uint32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[bool]uint32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv uint32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolUint64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]uint64) - if v, changed := fastpathTV.DecMapBoolUint64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolUint64V(rv2i(rv).(map[bool]uint64), false, d) -} -func (f fastpathT) DecMapBoolUint64X(vp *map[bool]uint64, d *Decoder) { - if v, changed := f.DecMapBoolUint64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, canChange bool, - d *Decoder) (_ map[bool]uint64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]uint64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv uint64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolUintptrR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]uintptr) - if v, changed := fastpathTV.DecMapBoolUintptrV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolUintptrV(rv2i(rv).(map[bool]uintptr), false, d) -} -func (f fastpathT) DecMapBoolUintptrX(vp *map[bool]uintptr, d *Decoder) { - if v, changed := f.DecMapBoolUintptrV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUintptrV(v map[bool]uintptr, canChange bool, - d *Decoder) (_ map[bool]uintptr, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]uintptr, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv uintptr - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolIntR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]int) - if v, changed := fastpathTV.DecMapBoolIntV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolIntV(rv2i(rv).(map[bool]int), false, d) -} -func (f fastpathT) DecMapBoolIntX(vp *map[bool]int, d *Decoder) { - if v, changed := f.DecMapBoolIntV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolIntV(v map[bool]int, canChange bool, - d *Decoder) (_ map[bool]int, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]int, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv int - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolInt8R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]int8) - if v, changed := fastpathTV.DecMapBoolInt8V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolInt8V(rv2i(rv).(map[bool]int8), false, d) -} -func (f fastpathT) DecMapBoolInt8X(vp *map[bool]int8, d *Decoder) { - if v, changed := f.DecMapBoolInt8V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, canChange bool, - d *Decoder) (_ map[bool]int8, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[bool]int8, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv int8 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolInt16R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]int16) - if v, changed := fastpathTV.DecMapBoolInt16V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolInt16V(rv2i(rv).(map[bool]int16), false, d) -} -func (f fastpathT) DecMapBoolInt16X(vp *map[bool]int16, d *Decoder) { - if v, changed := f.DecMapBoolInt16V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, canChange bool, - d *Decoder) (_ map[bool]int16, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[bool]int16, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv int16 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolInt32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]int32) - if v, changed := fastpathTV.DecMapBoolInt32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolInt32V(rv2i(rv).(map[bool]int32), false, d) -} -func (f fastpathT) DecMapBoolInt32X(vp *map[bool]int32, d *Decoder) { - if v, changed := f.DecMapBoolInt32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, canChange bool, - d *Decoder) (_ map[bool]int32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[bool]int32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv int32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolInt64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]int64) - if v, changed := fastpathTV.DecMapBoolInt64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolInt64V(rv2i(rv).(map[bool]int64), false, d) -} -func (f fastpathT) DecMapBoolInt64X(vp *map[bool]int64, d *Decoder) { - if v, changed := f.DecMapBoolInt64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, canChange bool, - d *Decoder) (_ map[bool]int64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]int64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv int64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolFloat32R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]float32) - if v, changed := fastpathTV.DecMapBoolFloat32V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolFloat32V(rv2i(rv).(map[bool]float32), false, d) -} -func (f fastpathT) DecMapBoolFloat32X(vp *map[bool]float32, d *Decoder) { - if v, changed := f.DecMapBoolFloat32V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, canChange bool, - d *Decoder) (_ map[bool]float32, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[bool]float32, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv float32 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolFloat64R(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]float64) - if v, changed := fastpathTV.DecMapBoolFloat64V(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolFloat64V(rv2i(rv).(map[bool]float64), false, d) -} -func (f fastpathT) DecMapBoolFloat64X(vp *map[bool]float64, d *Decoder) { - if v, changed := f.DecMapBoolFloat64V(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, canChange bool, - d *Decoder) (_ map[bool]float64, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]float64, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv float64 - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = 0 - } - continue - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} - -func (d *Decoder) fastpathDecMapBoolBoolR(f *codecFnInfo, rv reflect.Value) { - if rv.Kind() == reflect.Ptr { - vp := rv2i(rv).(*map[bool]bool) - if v, changed := fastpathTV.DecMapBoolBoolV(*vp, true, d); changed { - *vp = v - } - return - } - fastpathTV.DecMapBoolBoolV(rv2i(rv).(map[bool]bool), false, d) -} -func (f fastpathT) DecMapBoolBoolX(vp *map[bool]bool, d *Decoder) { - if v, changed := f.DecMapBoolBoolV(*vp, true, d); changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, canChange bool, - d *Decoder) (_ map[bool]bool, changed bool) { - dd, esep := d.d, d.hh.hasElemSeparators() - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[bool]bool, xlen) - changed = true - } - if containerLen == 0 { - dd.ReadMapEnd() - return v, changed - } - - var mk bool - var mv bool - hasLen := containerLen > 0 - for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { - if esep { - dd.ReadMapElemKey() - } - mk = dd.DecodeBool() - if esep { - dd.ReadMapElemValue() - } - if dd.TryDecodeAsNil() { - if d.h.DeleteOnNilMapValue { - delete(v, mk) - } else { - v[mk] = false - } - continue - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - dd.ReadMapEnd() - return v, changed -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.not.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.not.go deleted file mode 100644 index 9573d64a..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/fast-path.not.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build notfastpath - -package codec - -import "reflect" - -const fastpathEnabled = false - -// The generated fast-path code is very large, and adds a few seconds to the build time. -// This causes test execution, execution of small tools which use codec, etc -// to take a long time. -// -// To mitigate, we now support the notfastpath tag. -// This tag disables fastpath during build, allowing for faster build, test execution, -// short-program runs, etc. - -func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false } -func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false } -func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false } -func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false } -func fastpathDecodeSetZeroTypeSwitch(iv interface{}, d *Decoder) bool { return false } - -type fastpathT struct{} -type fastpathE struct { - rtid uintptr - rt reflect.Type - encfn func(*Encoder, *codecFnInfo, reflect.Value) - decfn func(*Decoder, *codecFnInfo, reflect.Value) -} -type fastpathA [0]fastpathE - -func (x fastpathA) index(rtid uintptr) int { return -1 } - -var fastpathAV fastpathA -var fastpathTV fastpathT diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen-helper.generated.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen-helper.generated.go deleted file mode 100644 index 9293463d..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen-helper.generated.go +++ /dev/null @@ -1,250 +0,0 @@ -/* // +build ignore */ - -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED from gen-helper.go.tmpl -// ************************************************************ - -package codec - -import ( - "encoding" - "reflect" -) - -// GenVersion is the current version of codecgen. -const GenVersion = 8 - -// This file is used to generate helper code for codecgen. -// The values here i.e. genHelper(En|De)coder are not to be used directly by -// library users. They WILL change continuously and without notice. -// -// To help enforce this, we create an unexported type with exported members. -// The only way to get the type is via the one exported type that we control (somewhat). -// -// When static codecs are created for types, they will use this value -// to perform encoding or decoding of primitives or known slice or map types. - -// GenHelperEncoder is exported so that it can be used externally by codecgen. -// -// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. -func GenHelperEncoder(e *Encoder) (genHelperEncoder, encDriver) { - return genHelperEncoder{e: e}, e.e -} - -// GenHelperDecoder is exported so that it can be used externally by codecgen. -// -// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. -func GenHelperDecoder(d *Decoder) (genHelperDecoder, decDriver) { - return genHelperDecoder{d: d}, d.d -} - -// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. -func BasicHandleDoNotUse(h Handle) *BasicHandle { - return h.getBasicHandle() -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -type genHelperEncoder struct { - e *Encoder - F fastpathT -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -type genHelperDecoder struct { - d *Decoder - F fastpathT -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncBasicHandle() *BasicHandle { - return f.e.h -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncBinary() bool { - return f.e.cf.be // f.e.hh.isBinaryEncoding() -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncFallback(iv interface{}) { - // println(">>>>>>>>> EncFallback") - // f.e.encodeI(iv, false, false) - f.e.encodeValue(reflect.ValueOf(iv), nil, false) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) { - bs, fnerr := iv.MarshalText() - f.e.marshal(bs, fnerr, false, c_UTF8) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) { - bs, fnerr := iv.MarshalJSON() - f.e.marshal(bs, fnerr, true, c_UTF8) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) { - bs, fnerr := iv.MarshalBinary() - f.e.marshal(bs, fnerr, false, c_RAW) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncRaw(iv Raw) { - f.e.rawBytes(iv) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) TimeRtidIfBinc() uintptr { - if _, ok := f.e.hh.(*BincHandle); ok { - return timeTypId - } - return 0 -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) IsJSONHandle() bool { - return f.e.cf.js -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) HasExtensions() bool { - return len(f.e.h.extHandle) != 0 -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncExt(v interface{}) (r bool) { - rt := reflect.TypeOf(v) - if rt.Kind() == reflect.Ptr { - rt = rt.Elem() - } - rtid := rt2id(rt) - if xfFn := f.e.h.getExt(rtid); xfFn != nil { - f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) - return true - } - return false -} - -// ---------------- DECODER FOLLOWS ----------------- - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecBasicHandle() *BasicHandle { - return f.d.h -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecBinary() bool { - return f.d.be // f.d.hh.isBinaryEncoding() -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecSwallow() { - f.d.swallow() -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecScratchBuffer() []byte { - return f.d.b[:] -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) { - // println(">>>>>>>>> DecFallback") - rv := reflect.ValueOf(iv) - if chkPtr { - rv = f.d.ensureDecodeable(rv) - } - f.d.decodeValue(rv, nil, false, false) - // f.d.decodeValueFallback(rv) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecSliceHelperStart() (decSliceHelper, int) { - return f.d.decSliceHelperStart() -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecStructFieldNotFound(index int, name string) { - f.d.structFieldNotFound(index, name) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) { - f.d.arrayCannotExpand(sliceLen, streamLen) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) { - fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes()) - if fnerr != nil { - panic(fnerr) - } -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { - // bs := f.dd.DecodeStringAsBytes() - // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself. - fnerr := tm.UnmarshalJSON(f.d.nextValueBytes()) - if fnerr != nil { - panic(fnerr) - } -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) { - fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, true)) - if fnerr != nil { - panic(fnerr) - } -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecRaw() []byte { - return f.d.rawBytes() -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) TimeRtidIfBinc() uintptr { - if _, ok := f.d.hh.(*BincHandle); ok { - return timeTypId - } - return 0 -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) IsJSONHandle() bool { - return f.d.js -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) HasExtensions() bool { - return len(f.d.h.extHandle) != 0 -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecExt(v interface{}) (r bool) { - rt := reflect.TypeOf(v).Elem() - rtid := rt2id(rt) - if xfFn := f.d.h.getExt(rtid); xfFn != nil { - f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) - return true - } - return false -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int) { - return decInferLen(clen, maxlen, unit) -} - -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) StringView(v []byte) string { - return stringView(v) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.generated.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.generated.go deleted file mode 100644 index b50a6024..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.generated.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -// DO NOT EDIT. THIS FILE IS AUTO-GENERATED FROM gen-dec-(map|array).go.tmpl - -const genDecMapTmpl = ` -{{var "v"}} := *{{ .Varname }} -{{var "l"}} := r.ReadMapStart() -{{var "bh"}} := z.DecBasicHandle() -if {{var "v"}} == nil { - {{var "rl"}} := z.DecInferLen({{var "l"}}, {{var "bh"}}.MaxInitLen, {{ .Size }}) - {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}}) - *{{ .Varname }} = {{var "v"}} -} -var {{var "mk"}} {{ .KTyp }} -var {{var "mv"}} {{ .Typ }} -var {{var "mg"}}, {{var "mdn"}} {{if decElemKindPtr}}, {{var "ms"}}, {{var "mok"}}{{end}} bool -if {{var "bh"}}.MapValueReset { - {{if decElemKindPtr}}{{var "mg"}} = true - {{else if decElemKindIntf}}if !{{var "bh"}}.InterfaceReset { {{var "mg"}} = true } - {{else if not decElemKindImmutable}}{{var "mg"}} = true - {{end}} } -if {{var "l"}} != 0 { -{{var "hl"}} := {{var "l"}} > 0 - for {{var "j"}} := 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { - r.ReadMapElemKey() {{/* z.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }}) */}} - {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} -{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */}}if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { - {{var "mk"}} = string({{var "bv"}}) - }{{ end }}{{if decElemKindPtr}} - {{var "ms"}} = true{{end}} - if {{var "mg"}} { - {{if decElemKindPtr}}{{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{var "mk"}}] - if {{var "mok"}} { - {{var "ms"}} = false - } {{else}}{{var "mv"}} = {{var "v"}}[{{var "mk"}}] {{end}} - } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} - r.ReadMapElemValue() {{/* z.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }}) */}} - {{var "mdn"}} = false - {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ $y := printf "%vmdn%v" .TempVar .Rand }}{{ decLineVar $x $y }} - if {{var "mdn"}} { - if {{ var "bh" }}.DeleteOnNilMapValue { delete({{var "v"}}, {{var "mk"}}) } else { {{var "v"}}[{{var "mk"}}] = {{decElemZero}} } - } else if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil { - {{var "v"}}[{{var "mk"}}] = {{var "mv"}} - } -} -} // else len==0: TODO: Should we clear map entries? -r.ReadMapEnd() {{/* z.DecSendContainerState(codecSelfer_containerMapEnd{{ .Sfx }}) */}} -` - -const genDecListTmpl = ` -{{var "v"}} := {{if not isArray}}*{{end}}{{ .Varname }} -{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}}{{if not isArray}} -var {{var "c"}} bool {{/* // changed */}} -_ = {{var "c"}}{{end}} -if {{var "l"}} == 0 { - {{if isSlice }}if {{var "v"}} == nil { - {{var "v"}} = []{{ .Typ }}{} - {{var "c"}} = true - } else if len({{var "v"}}) != 0 { - {{var "v"}} = {{var "v"}}[:0] - {{var "c"}} = true - } {{end}} {{if isChan }}if {{var "v"}} == nil { - {{var "v"}} = make({{ .CTyp }}, 0) - {{var "c"}} = true - } {{end}} -} else { - {{var "hl"}} := {{var "l"}} > 0 - var {{var "rl"}} int; _ = {{var "rl"}} - {{if isSlice }} if {{var "hl"}} { - if {{var "l"}} > cap({{var "v"}}) { - {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) - if {{var "rl"}} <= cap({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "rl"}}] - } else { - {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) - } - {{var "c"}} = true - } else if {{var "l"}} != len({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "l"}}] - {{var "c"}} = true - } - } {{end}} - var {{var "j"}} int - // var {{var "dn"}} bool - for ; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { - {{if not isArray}} if {{var "j"}} == 0 && len({{var "v"}}) == 0 { - if {{var "hl"}} { - {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) - } else { - {{var "rl"}} = 8 - } - {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) - {{var "c"}} = true - }{{end}} - {{var "h"}}.ElemContainerState({{var "j"}}) - // {{var "dn"}} = r.TryDecodeAsNil() - {{if isChan}}{{ $x := printf "%[1]vv%[2]v" .TempVar .Rand }}var {{var $x}} {{ .Typ }} - {{ decLineVar $x }} - {{var "v"}} <- {{ $x }} - {{else}} - // if indefinite, etc, then expand the slice if necessary - var {{var "db"}} bool - if {{var "j"}} >= len({{var "v"}}) { - {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}); {{var "c"}} = true - {{else}} z.DecArrayCannotExpand(len(v), {{var "j"}}+1); {{var "db"}} = true - {{end}} - } - if {{var "db"}} { - z.DecSwallow() - } else { - {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} - } - {{end}} - } - {{if isSlice}} if {{var "j"}} < len({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "j"}}] - {{var "c"}} = true - } else if {{var "j"}} == 0 && {{var "v"}} == nil { - {{var "v"}} = make([]{{ .Typ }}, 0) - {{var "c"}} = true - } {{end}} -} -{{var "h"}}.End() -{{if not isArray }}if {{var "c"}} { - *{{ .Varname }} = {{var "v"}} -}{{end}} - -` - diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.go deleted file mode 100644 index 043f10d8..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/gen.go +++ /dev/null @@ -1,2014 +0,0 @@ -// +build codecgen.exec - -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "bytes" - "encoding/base64" - "errors" - "fmt" - "go/format" - "io" - "io/ioutil" - "math/rand" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "sync" - "text/template" - "time" - "unicode" - "unicode/utf8" -) - -// --------------------------------------------------- -// codecgen supports the full cycle of reflection-based codec: -// - RawExt -// - Raw -// - Builtins -// - Extensions -// - (Binary|Text|JSON)(Unm|M)arshal -// - generic by-kind -// -// This means that, for dynamic things, we MUST use reflection to at least get the reflect.Type. -// In those areas, we try to only do reflection or interface-conversion when NECESSARY: -// - Extensions, only if Extensions are configured. -// -// However, codecgen doesn't support the following: -// - Canonical option. (codecgen IGNORES it currently) -// This is just because it has not been implemented. -// -// During encode/decode, Selfer takes precedence. -// A type implementing Selfer will know how to encode/decode itself statically. -// -// The following field types are supported: -// array: [n]T -// slice: []T -// map: map[K]V -// primitive: [u]int[n], float(32|64), bool, string -// struct -// -// --------------------------------------------------- -// Note that a Selfer cannot call (e|d).(En|De)code on itself, -// as this will cause a circular reference, as (En|De)code will call Selfer methods. -// Any type that implements Selfer must implement completely and not fallback to (En|De)code. -// -// In addition, code in this file manages the generation of fast-path implementations of -// encode/decode of slices/maps of primitive keys/values. -// -// Users MUST re-generate their implementations whenever the code shape changes. -// The generated code will panic if it was generated with a version older than the supporting library. -// --------------------------------------------------- -// -// codec framework is very feature rich. -// When encoding or decoding into an interface, it depends on the runtime type of the interface. -// The type of the interface may be a named type, an extension, etc. -// Consequently, we fallback to runtime codec for encoding/decoding interfaces. -// In addition, we fallback for any value which cannot be guaranteed at runtime. -// This allows us support ANY value, including any named types, specifically those which -// do not implement our interfaces (e.g. Selfer). -// -// This explains some slowness compared to other code generation codecs (e.g. msgp). -// This reduction in speed is only seen when your refers to interfaces, -// e.g. type T struct { A interface{}; B []interface{}; C map[string]interface{} } -// -// codecgen will panic if the file was generated with an old version of the library in use. -// -// Note: -// It was a conscious decision to have gen.go always explicitly call EncodeNil or TryDecodeAsNil. -// This way, there isn't a function call overhead just to see that we should not enter a block of code. -// -// Note: -// codecgen-generated code depends on the variables defined by fast-path.generated.go. -// consequently, you cannot run with tags "codecgen notfastpath". - -// GenVersion is the current version of codecgen. -// -// NOTE: Increment this value each time codecgen changes fundamentally. -// Fundamental changes are: -// - helper methods change (signature change, new ones added, some removed, etc) -// - codecgen command line changes -// -// v1: Initial Version -// v2: -// v3: Changes for Kubernetes: -// changes in signature of some unpublished helper methods and codecgen cmdline arguments. -// v4: Removed separator support from (en|de)cDriver, and refactored codec(gen) -// v5: changes to support faster json decoding. Let encoder/decoder maintain state of collections. -// v6: removed unsafe from gen, and now uses codecgen.exec tag -const genVersion = 8 - -const ( - genCodecPkg = "codec1978" - genTempVarPfx = "yy" - genTopLevelVarName = "x" - - // ignore canBeNil parameter, and always set to true. - // This is because nil can appear anywhere, so we should always check. - genAnythingCanBeNil = true - - // if genUseOneFunctionForDecStructMap, make a single codecDecodeSelferFromMap function; - // else make codecDecodeSelferFromMap{LenPrefix,CheckBreak} so that conditionals - // are not executed a lot. - // - // From testing, it didn't make much difference in runtime, so keep as true (one function only) - genUseOneFunctionForDecStructMap = true -) - -type genStructMapStyle uint8 - -const ( - genStructMapStyleConsolidated genStructMapStyle = iota - genStructMapStyleLenPrefix - genStructMapStyleCheckBreak -) - -var ( - genAllTypesSamePkgErr = errors.New("All types must be in the same package") - genExpectArrayOrMapErr = errors.New("unexpected type. Expecting array/map/slice") - genBase64enc = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789__") - genQNameRegex = regexp.MustCompile(`[A-Za-z_.]+`) -) - -// genRunner holds some state used during a Gen run. -type genRunner struct { - w io.Writer // output - c uint64 // counter used for generating varsfx - t []reflect.Type // list of types to run selfer on - - tc reflect.Type // currently running selfer on this type - te map[uintptr]bool // types for which the encoder has been created - td map[uintptr]bool // types for which the decoder has been created - cp string // codec import path - - im map[string]reflect.Type // imports to add - imn map[string]string // package names of imports to add - imc uint64 // counter for import numbers - - is map[reflect.Type]struct{} // types seen during import search - bp string // base PkgPath, for which we are generating for - - cpfx string // codec package prefix - - tm map[reflect.Type]struct{} // types for which enc/dec must be generated - ts []reflect.Type // types for which enc/dec must be generated - - xs string // top level variable/constant suffix - hn string // fn helper type name - - ti *TypeInfos - // rr *rand.Rand // random generator for file-specific types - - nx bool // no extensions -} - -// Gen will write a complete go file containing Selfer implementations for each -// type passed. All the types must be in the same package. -// -// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. -func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool, - ti *TypeInfos, typ ...reflect.Type) { - // All types passed to this method do not have a codec.Selfer method implemented directly. - // codecgen already checks the AST and skips any types that define the codec.Selfer methods. - // Consequently, there's no need to check and trim them if they implement codec.Selfer - - if len(typ) == 0 { - return - } - x := genRunner{ - w: w, - t: typ, - te: make(map[uintptr]bool), - td: make(map[uintptr]bool), - im: make(map[string]reflect.Type), - imn: make(map[string]string), - is: make(map[reflect.Type]struct{}), - tm: make(map[reflect.Type]struct{}), - ts: []reflect.Type{}, - bp: genImportPath(typ[0]), - xs: uid, - ti: ti, - nx: noExtensions, - } - if x.ti == nil { - x.ti = defTypeInfos - } - if x.xs == "" { - rr := rand.New(rand.NewSource(time.Now().UnixNano())) - x.xs = strconv.FormatInt(rr.Int63n(9999), 10) - } - - // gather imports first: - x.cp = genImportPath(reflect.TypeOf(x)) - x.imn[x.cp] = genCodecPkg - for _, t := range typ { - // fmt.Printf("###########: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name()) - if genImportPath(t) != x.bp { - panic(genAllTypesSamePkgErr) - } - x.genRefPkgs(t) - } - if buildTags != "" { - x.line("// +build " + buildTags) - x.line("") - } - x.line(` - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -`) - x.line("package " + pkgName) - x.line("") - x.line("import (") - if x.cp != x.bp { - x.cpfx = genCodecPkg + "." - x.linef("%s \"%s\"", genCodecPkg, x.cp) - } - // use a sorted set of im keys, so that we can get consistent output - imKeys := make([]string, 0, len(x.im)) - for k, _ := range x.im { - imKeys = append(imKeys, k) - } - sort.Strings(imKeys) - for _, k := range imKeys { // for k, _ := range x.im { - x.linef("%s \"%s\"", x.imn[k], k) - } - // add required packages - for _, k := range [...]string{"reflect", "runtime", "fmt", "errors"} { - if _, ok := x.im[k]; !ok { - x.line("\"" + k + "\"") - } - } - x.line(")") - x.line("") - - x.line("const (") - x.linef("// ----- content types ----") - x.linef("codecSelferC_UTF8%s = %v", x.xs, int64(c_UTF8)) - x.linef("codecSelferC_RAW%s = %v", x.xs, int64(c_RAW)) - x.linef("// ----- value types used ----") - x.linef("codecSelferValueTypeArray%s = %v", x.xs, int64(valueTypeArray)) - x.linef("codecSelferValueTypeMap%s = %v", x.xs, int64(valueTypeMap)) - x.linef("// ----- containerStateValues ----") - x.linef("codecSelfer_containerMapKey%s = %v", x.xs, int64(containerMapKey)) - x.linef("codecSelfer_containerMapValue%s = %v", x.xs, int64(containerMapValue)) - x.linef("codecSelfer_containerMapEnd%s = %v", x.xs, int64(containerMapEnd)) - x.linef("codecSelfer_containerArrayElem%s = %v", x.xs, int64(containerArrayElem)) - x.linef("codecSelfer_containerArrayEnd%s = %v", x.xs, int64(containerArrayEnd)) - x.line(")") - x.line("var (") - x.line("codecSelferBitsize" + x.xs + " = uint8(reflect.TypeOf(uint(0)).Bits())") - x.line("codecSelferOnlyMapOrArrayEncodeToStructErr" + x.xs + " = errors.New(`only encoded map or array can be decoded into a struct`)") - x.line(")") - x.line("") - - x.hn = "codecSelfer" + x.xs - x.line("type " + x.hn + " struct{}") - x.line("") - - x.varsfxreset() - x.line("func init() {") - x.linef("if %sGenVersion != %v {", x.cpfx, genVersion) - x.line("_, file, _, _ := runtime.Caller(0)") - x.line(`err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", `) - x.linef(`%v, %sGenVersion, file)`, genVersion, x.cpfx) - x.line("panic(err)") - x.linef("}") - x.line("if false { // reference the types, but skip this branch at build/run time") - var n int - // for k, t := range x.im { - for _, k := range imKeys { - t := x.im[k] - x.linef("var v%v %s.%s", n, x.imn[k], t.Name()) - n++ - } - if n > 0 { - x.out("_") - for i := 1; i < n; i++ { - x.out(", _") - } - x.out(" = v0") - for i := 1; i < n; i++ { - x.outf(", v%v", i) - } - } - x.line("} ") // close if false - x.line("}") // close init - x.line("") - - // generate rest of type info - for _, t := range typ { - x.tc = t - x.selfer(true) - x.selfer(false) - } - - for _, t := range x.ts { - rtid := rt2id(t) - // generate enc functions for all these slice/map types. - x.varsfxreset() - x.linef("func (x %s) enc%s(v %s%s, e *%sEncoder) {", x.hn, x.genMethodNameT(t), x.arr2str(t, "*"), x.genTypeName(t), x.cpfx) - x.genRequiredMethodVars(true) - switch t.Kind() { - case reflect.Array, reflect.Slice, reflect.Chan: - x.encListFallback("v", t) - case reflect.Map: - x.encMapFallback("v", t) - default: - panic(genExpectArrayOrMapErr) - } - x.line("}") - x.line("") - - // generate dec functions for all these slice/map types. - x.varsfxreset() - x.linef("func (x %s) dec%s(v *%s, d *%sDecoder) {", x.hn, x.genMethodNameT(t), x.genTypeName(t), x.cpfx) - x.genRequiredMethodVars(false) - switch t.Kind() { - case reflect.Array, reflect.Slice, reflect.Chan: - x.decListFallback("v", rtid, t) - case reflect.Map: - x.decMapFallback("v", rtid, t) - default: - panic(genExpectArrayOrMapErr) - } - x.line("}") - x.line("") - } - - x.line("") -} - -func (x *genRunner) checkForSelfer(t reflect.Type, varname string) bool { - // return varname != genTopLevelVarName && t != x.tc - // the only time we checkForSelfer is if we are not at the TOP of the generated code. - return varname != genTopLevelVarName -} - -func (x *genRunner) arr2str(t reflect.Type, s string) string { - if t.Kind() == reflect.Array { - return s - } - return "" -} - -func (x *genRunner) genRequiredMethodVars(encode bool) { - x.line("var h " + x.hn) - if encode { - x.line("z, r := " + x.cpfx + "GenHelperEncoder(e)") - } else { - x.line("z, r := " + x.cpfx + "GenHelperDecoder(d)") - } - x.line("_, _, _ = h, z, r") -} - -func (x *genRunner) genRefPkgs(t reflect.Type) { - if _, ok := x.is[t]; ok { - return - } - // fmt.Printf(">>>>>>: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name()) - x.is[t] = struct{}{} - tpkg, tname := genImportPath(t), t.Name() - if tpkg != "" && tpkg != x.bp && tpkg != x.cp && tname != "" && tname[0] >= 'A' && tname[0] <= 'Z' { - if _, ok := x.im[tpkg]; !ok { - x.im[tpkg] = t - if idx := strings.LastIndex(tpkg, "/"); idx < 0 { - x.imn[tpkg] = tpkg - } else { - x.imc++ - x.imn[tpkg] = "pkg" + strconv.FormatUint(x.imc, 10) + "_" + genGoIdentifier(tpkg[idx+1:], false) - } - } - } - switch t.Kind() { - case reflect.Array, reflect.Slice, reflect.Ptr, reflect.Chan: - x.genRefPkgs(t.Elem()) - case reflect.Map: - x.genRefPkgs(t.Elem()) - x.genRefPkgs(t.Key()) - case reflect.Struct: - for i := 0; i < t.NumField(); i++ { - if fname := t.Field(i).Name; fname != "" && fname[0] >= 'A' && fname[0] <= 'Z' { - x.genRefPkgs(t.Field(i).Type) - } - } - } -} - -func (x *genRunner) line(s string) { - x.out(s) - if len(s) == 0 || s[len(s)-1] != '\n' { - x.out("\n") - } -} - -func (x *genRunner) varsfx() string { - x.c++ - return strconv.FormatUint(x.c, 10) -} - -func (x *genRunner) varsfxreset() { - x.c = 0 -} - -func (x *genRunner) out(s string) { - if _, err := io.WriteString(x.w, s); err != nil { - panic(err) - } -} - -func (x *genRunner) linef(s string, params ...interface{}) { - x.line(fmt.Sprintf(s, params...)) -} - -func (x *genRunner) outf(s string, params ...interface{}) { - x.out(fmt.Sprintf(s, params...)) -} - -func (x *genRunner) genTypeName(t reflect.Type) (n string) { - // defer func() { fmt.Printf(">>>> ####: genTypeName: t: %v, name: '%s'\n", t, n) }() - - // if the type has a PkgPath, which doesn't match the current package, - // then include it. - // We cannot depend on t.String() because it includes current package, - // or t.PkgPath because it includes full import path, - // - var ptrPfx string - for t.Kind() == reflect.Ptr { - ptrPfx += "*" - t = t.Elem() - } - if tn := t.Name(); tn != "" { - return ptrPfx + x.genTypeNamePrim(t) - } - switch t.Kind() { - case reflect.Map: - return ptrPfx + "map[" + x.genTypeName(t.Key()) + "]" + x.genTypeName(t.Elem()) - case reflect.Slice: - return ptrPfx + "[]" + x.genTypeName(t.Elem()) - case reflect.Array: - return ptrPfx + "[" + strconv.FormatInt(int64(t.Len()), 10) + "]" + x.genTypeName(t.Elem()) - case reflect.Chan: - return ptrPfx + t.ChanDir().String() + " " + x.genTypeName(t.Elem()) - default: - if t == intfTyp { - return ptrPfx + "interface{}" - } else { - return ptrPfx + x.genTypeNamePrim(t) - } - } -} - -func (x *genRunner) genTypeNamePrim(t reflect.Type) (n string) { - if t.Name() == "" { - return t.String() - } else if genImportPath(t) == "" || genImportPath(t) == genImportPath(x.tc) { - return t.Name() - } else { - return x.imn[genImportPath(t)] + "." + t.Name() - // return t.String() // best way to get the package name inclusive - } -} - -func (x *genRunner) genZeroValueR(t reflect.Type) string { - // if t is a named type, w - switch t.Kind() { - case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func, - reflect.Slice, reflect.Map, reflect.Invalid: - return "nil" - case reflect.Bool: - return "false" - case reflect.String: - return `""` - case reflect.Struct, reflect.Array: - return x.genTypeName(t) + "{}" - default: // all numbers - return "0" - } -} - -func (x *genRunner) genMethodNameT(t reflect.Type) (s string) { - return genMethodNameT(t, x.tc) -} - -func (x *genRunner) selfer(encode bool) { - t := x.tc - t0 := t - // always make decode use a pointer receiver, - // and structs always use a ptr receiver (encode|decode) - isptr := !encode || t.Kind() == reflect.Struct - x.varsfxreset() - fnSigPfx := "func (x " - if isptr { - fnSigPfx += "*" - } - fnSigPfx += x.genTypeName(t) - - x.out(fnSigPfx) - if isptr { - t = reflect.PtrTo(t) - } - if encode { - x.line(") CodecEncodeSelf(e *" + x.cpfx + "Encoder) {") - x.genRequiredMethodVars(true) - // x.enc(genTopLevelVarName, t) - x.encVar(genTopLevelVarName, t) - } else { - x.line(") CodecDecodeSelf(d *" + x.cpfx + "Decoder) {") - x.genRequiredMethodVars(false) - // do not use decVar, as there is no need to check TryDecodeAsNil - // or way to elegantly handle that, and also setting it to a - // non-nil value doesn't affect the pointer passed. - // x.decVar(genTopLevelVarName, t, false) - x.dec(genTopLevelVarName, t0) - } - x.line("}") - x.line("") - - if encode || t0.Kind() != reflect.Struct { - return - } - - // write is containerMap - if genUseOneFunctionForDecStructMap { - x.out(fnSigPfx) - x.line(") codecDecodeSelfFromMap(l int, d *" + x.cpfx + "Decoder) {") - x.genRequiredMethodVars(false) - x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleConsolidated) - x.line("}") - x.line("") - } else { - x.out(fnSigPfx) - x.line(") codecDecodeSelfFromMapLenPrefix(l int, d *" + x.cpfx + "Decoder) {") - x.genRequiredMethodVars(false) - x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleLenPrefix) - x.line("}") - x.line("") - - x.out(fnSigPfx) - x.line(") codecDecodeSelfFromMapCheckBreak(l int, d *" + x.cpfx + "Decoder) {") - x.genRequiredMethodVars(false) - x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleCheckBreak) - x.line("}") - x.line("") - } - - // write containerArray - x.out(fnSigPfx) - x.line(") codecDecodeSelfFromArray(l int, d *" + x.cpfx + "Decoder) {") - x.genRequiredMethodVars(false) - x.decStructArray(genTopLevelVarName, "l", "return", rt2id(t0), t0) - x.line("}") - x.line("") - -} - -// used for chan, array, slice, map -func (x *genRunner) xtraSM(varname string, encode bool, t reflect.Type) { - if encode { - x.linef("h.enc%s((%s%s)(%s), e)", x.genMethodNameT(t), x.arr2str(t, "*"), x.genTypeName(t), varname) - } else { - x.linef("h.dec%s((*%s)(%s), d)", x.genMethodNameT(t), x.genTypeName(t), varname) - } - x.registerXtraT(t) -} - -func (x *genRunner) registerXtraT(t reflect.Type) { - // recursively register the types - if _, ok := x.tm[t]; ok { - return - } - var tkey reflect.Type - switch t.Kind() { - case reflect.Chan, reflect.Slice, reflect.Array: - case reflect.Map: - tkey = t.Key() - default: - return - } - x.tm[t] = struct{}{} - x.ts = append(x.ts, t) - // check if this refers to any xtra types eg. a slice of array: add the array - x.registerXtraT(t.Elem()) - if tkey != nil { - x.registerXtraT(tkey) - } -} - -// encVar will encode a variable. -// The parameter, t, is the reflect.Type of the variable itself -func (x *genRunner) encVar(varname string, t reflect.Type) { - // fmt.Printf(">>>>>> varname: %s, t: %v\n", varname, t) - var checkNil bool - switch t.Kind() { - case reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map, reflect.Chan: - checkNil = true - } - if checkNil { - x.linef("if %s == nil { r.EncodeNil() } else { ", varname) - } - switch t.Kind() { - case reflect.Ptr: - switch t.Elem().Kind() { - case reflect.Struct, reflect.Array: - x.enc(varname, genNonPtr(t)) - default: - i := x.varsfx() - x.line(genTempVarPfx + i + " := *" + varname) - x.enc(genTempVarPfx+i, genNonPtr(t)) - } - case reflect.Struct, reflect.Array: - i := x.varsfx() - x.line(genTempVarPfx + i + " := &" + varname) - x.enc(genTempVarPfx+i, t) - default: - x.enc(varname, t) - } - - if checkNil { - x.line("}") - } - -} - -// enc will encode a variable (varname) of type t, -// except t is of kind reflect.Struct or reflect.Array, wherein varname is of type ptrTo(T) (to prevent copying) -func (x *genRunner) enc(varname string, t reflect.Type) { - rtid := rt2id(t) - // We call CodecEncodeSelf if one of the following are honored: - // - the type already implements Selfer, call that - // - the type has a Selfer implementation just created, use that - // - the type is in the list of the ones we will generate for, but it is not currently being generated - - mi := x.varsfx() - tptr := reflect.PtrTo(t) - tk := t.Kind() - if x.checkForSelfer(t, varname) { - if tk == reflect.Array || tk == reflect.Struct { // varname is of type *T - if tptr.Implements(selferTyp) || t.Implements(selferTyp) { - x.line(varname + ".CodecEncodeSelf(e)") - return - } - } else { // varname is of type T - if t.Implements(selferTyp) { - x.line(varname + ".CodecEncodeSelf(e)") - return - } else if tptr.Implements(selferTyp) { - x.linef("%ssf%s := &%s", genTempVarPfx, mi, varname) - x.linef("%ssf%s.CodecEncodeSelf(e)", genTempVarPfx, mi) - return - } - } - - if _, ok := x.te[rtid]; ok { - x.line(varname + ".CodecEncodeSelf(e)") - return - } - } - - inlist := false - for _, t0 := range x.t { - if t == t0 { - inlist = true - if x.checkForSelfer(t, varname) { - x.line(varname + ".CodecEncodeSelf(e)") - return - } - break - } - } - - var rtidAdded bool - if t == x.tc { - x.te[rtid] = true - rtidAdded = true - } - - // check if - // - type is RawExt, Raw - // - the type implements (Text|JSON|Binary)(Unm|M)arshal - x.linef("%sm%s := z.EncBinary()", genTempVarPfx, mi) - x.linef("_ = %sm%s", genTempVarPfx, mi) - x.line("if false {") //start if block - defer func() { x.line("}") }() //end if block - - if t == rawTyp { - x.linef("} else { z.EncRaw(%v)", varname) - return - } - if t == rawExtTyp { - x.linef("} else { r.EncodeRawExt(%v, e)", varname) - return - } - // HACK: Support for Builtins. - // Currently, only Binc supports builtins, and the only builtin type is time.Time. - // Have a method that returns the rtid for time.Time if Handle is Binc. - if t == timeTyp { - vrtid := genTempVarPfx + "m" + x.varsfx() - x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) - x.linef("r.EncodeBuiltin(%s, %s)", vrtid, varname) - } - // only check for extensions if the type is named, and has a packagePath. - if !x.nx && genImportPath(t) != "" && t.Name() != "" { - // first check if extensions are configued, before doing the interface conversion - x.linef("} else if z.HasExtensions() && z.EncExt(%s) {", varname) - } - if tk == reflect.Array || tk == reflect.Struct { // varname is of type *T - if t.Implements(binaryMarshalerTyp) || tptr.Implements(binaryMarshalerTyp) { - x.linef("} else if %sm%s { z.EncBinaryMarshal(%v) ", genTempVarPfx, mi, varname) - } - if t.Implements(jsonMarshalerTyp) || tptr.Implements(jsonMarshalerTyp) { - x.linef("} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", genTempVarPfx, mi, varname) - } else if t.Implements(textMarshalerTyp) || tptr.Implements(textMarshalerTyp) { - x.linef("} else if !%sm%s { z.EncTextMarshal(%v) ", genTempVarPfx, mi, varname) - } - } else { // varname is of type T - if t.Implements(binaryMarshalerTyp) { - x.linef("} else if %sm%s { z.EncBinaryMarshal(%v) ", genTempVarPfx, mi, varname) - } else if tptr.Implements(binaryMarshalerTyp) { - x.linef("} else if %sm%s { z.EncBinaryMarshal(&%v) ", genTempVarPfx, mi, varname) - } - if t.Implements(jsonMarshalerTyp) { - x.linef("} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", genTempVarPfx, mi, varname) - } else if tptr.Implements(jsonMarshalerTyp) { - x.linef("} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(&%v) ", genTempVarPfx, mi, varname) - } else if t.Implements(textMarshalerTyp) { - x.linef("} else if !%sm%s { z.EncTextMarshal(%v) ", genTempVarPfx, mi, varname) - } else if tptr.Implements(textMarshalerTyp) { - x.linef("} else if !%sm%s { z.EncTextMarshal(&%v) ", genTempVarPfx, mi, varname) - } - } - x.line("} else {") - - switch t.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - x.line("r.EncodeInt(int64(" + varname + "))") - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - x.line("r.EncodeUint(uint64(" + varname + "))") - case reflect.Float32: - x.line("r.EncodeFloat32(float32(" + varname + "))") - case reflect.Float64: - x.line("r.EncodeFloat64(float64(" + varname + "))") - case reflect.Bool: - x.line("r.EncodeBool(bool(" + varname + "))") - case reflect.String: - x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(" + varname + "))") - case reflect.Chan: - x.xtraSM(varname, true, t) - // x.encListFallback(varname, rtid, t) - case reflect.Array: - x.xtraSM(varname, true, t) - case reflect.Slice: - // if nil, call dedicated function - // if a []uint8, call dedicated function - // if a known fastpath slice, call dedicated function - // else write encode function in-line. - // - if elements are primitives or Selfers, call dedicated function on each member. - // - else call Encoder.encode(XXX) on it. - if rtid == uint8SliceTypId { - x.line("r.EncodeStringBytes(codecSelferC_RAW" + x.xs + ", []byte(" + varname + "))") - } else if fastpathAV.index(rtid) != -1 { - g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)") - } else { - x.xtraSM(varname, true, t) - // x.encListFallback(varname, rtid, t) - } - case reflect.Map: - // if nil, call dedicated function - // if a known fastpath map, call dedicated function - // else write encode function in-line. - // - if elements are primitives or Selfers, call dedicated function on each member. - // - else call Encoder.encode(XXX) on it. - // x.line("if " + varname + " == nil { \nr.EncodeNil()\n } else { ") - if fastpathAV.index(rtid) != -1 { - g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)") - } else { - x.xtraSM(varname, true, t) - // x.encMapFallback(varname, rtid, t) - } - case reflect.Struct: - if !inlist { - delete(x.te, rtid) - x.line("z.EncFallback(" + varname + ")") - break - } - x.encStruct(varname, rtid, t) - default: - if rtidAdded { - delete(x.te, rtid) - } - x.line("z.EncFallback(" + varname + ")") - } -} - -func (x *genRunner) encZero(t reflect.Type) { - switch t.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - x.line("r.EncodeInt(0)") - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - x.line("r.EncodeUint(0)") - case reflect.Float32: - x.line("r.EncodeFloat32(0)") - case reflect.Float64: - x.line("r.EncodeFloat64(0)") - case reflect.Bool: - x.line("r.EncodeBool(false)") - case reflect.String: - x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + `, "")`) - default: - x.line("r.EncodeNil()") - } -} - -func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { - // Use knowledge from structfieldinfo (mbs, encodable fields. Ignore omitempty. ) - // replicate code in kStruct i.e. for each field, deref type to non-pointer, and call x.enc on it - - // if t === type currently running selfer on, do for all - ti := x.ti.get(rtid, t) - i := x.varsfx() - sepVarname := genTempVarPfx + "sep" + i - numfieldsvar := genTempVarPfx + "q" + i - ti2arrayvar := genTempVarPfx + "r" + i - struct2arrvar := genTempVarPfx + "2arr" + i - - x.line(sepVarname + " := !z.EncBinary()") - x.linef("%s := z.EncBasicHandle().StructToArray", struct2arrvar) - tisfi := ti.sfip // always use sequence from file. decStruct expects same thing. - // due to omitEmpty, we need to calculate the - // number of non-empty things we write out first. - // This is required as we need to pre-determine the size of the container, - // to support length-prefixing. - if ti.anyOmitEmpty { - x.linef("var %s [%v]bool", numfieldsvar, len(tisfi)) - x.linef("_ = %s", numfieldsvar) - } - x.linef("_, _ = %s, %s", sepVarname, struct2arrvar) - x.linef("const %s bool = %v", ti2arrayvar, ti.toArray) - var nn int - if ti.anyOmitEmpty { - for j, si := range tisfi { - if !si.omitEmpty { - nn++ - continue - } - var t2 reflect.StructField - var omitline string - { - t2typ := t - varname3 := varname - for ij, ix := range si.is { - if uint8(ij) == si.nis { - break - } - for t2typ.Kind() == reflect.Ptr { - t2typ = t2typ.Elem() - } - t2 = t2typ.Field(int(ix)) - t2typ = t2.Type - varname3 = varname3 + "." + t2.Name - if t2typ.Kind() == reflect.Ptr { - omitline += varname3 + " != nil && " - } - } - } - // never check omitEmpty on a struct type, as it may contain uncomparable map/slice/etc. - // also, for maps/slices/arrays, check if len ! 0 (not if == zero value) - switch t2.Type.Kind() { - case reflect.Struct: - omitline += " true" - case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan: - omitline += "len(" + varname + "." + t2.Name + ") != 0" - default: - omitline += varname + "." + t2.Name + " != " + x.genZeroValueR(t2.Type) - } - x.linef("%s[%v] = %s", numfieldsvar, j, omitline) - } - } - // x.linef("var %snn%s int", genTempVarPfx, i) - x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { - x.linef("r.WriteArrayStart(%d)", len(tisfi)) - x.linef("} else {") // if not ti.toArray - if ti.anyOmitEmpty { - x.linef("var %snn%s = %v", genTempVarPfx, i, nn) - x.linef("for _, b := range %s { if b { %snn%s++ } }", numfieldsvar, genTempVarPfx, i) - x.linef("r.WriteMapStart(%snn%s)", genTempVarPfx, i) - x.linef("%snn%s = %v", genTempVarPfx, i, 0) - } else { - x.linef("r.WriteMapStart(%d)", len(tisfi)) - } - x.line("}") // close if not StructToArray - - for j, si := range tisfi { - i := x.varsfx() - isNilVarName := genTempVarPfx + "n" + i - var labelUsed bool - var t2 reflect.StructField - { - t2typ := t - varname3 := varname - for ij, ix := range si.is { - if uint8(ij) == si.nis { - break - } - // fmt.Printf("%%%% %v, ix: %v\n", t2typ, ix) - for t2typ.Kind() == reflect.Ptr { - t2typ = t2typ.Elem() - } - t2 = t2typ.Field(int(ix)) - t2typ = t2.Type - varname3 = varname3 + "." + t2.Name - if t2typ.Kind() == reflect.Ptr { - if !labelUsed { - x.line("var " + isNilVarName + " bool") - } - x.line("if " + varname3 + " == nil { " + isNilVarName + " = true ") - x.line("goto LABEL" + i) - x.line("}") - labelUsed = true - // "varname3 = new(" + x.genTypeName(t3.Elem()) + ") }") - } - } - // t2 = t.FieldByIndex(si.is) - } - if labelUsed { - x.line("LABEL" + i + ":") - } - // if the type of the field is a Selfer, or one of the ones - - x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray - if labelUsed { - x.linef("if %s { r.WriteArrayElem(); r.EncodeNil() } else { ", isNilVarName) - // x.linef("if %s { z.EncSendContainerState(codecSelfer_containerArrayElem%s); r.EncodeNil() } else { ", isNilVarName, x.xs) - } - x.line("r.WriteArrayElem()") // x.linef("z.EncSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) - if si.omitEmpty { - x.linef("if %s[%v] {", numfieldsvar, j) - } - x.encVar(varname+"."+t2.Name, t2.Type) - if si.omitEmpty { - x.linef("} else {") - x.encZero(t2.Type) - x.linef("}") - } - if labelUsed { - x.line("}") - } - - x.linef("} else {") // if not ti.toArray - - if si.omitEmpty { - x.linef("if %s[%v] {", numfieldsvar, j) - } - x.line("r.WriteMapElemKey()") // x.linef("z.EncSendContainerState(codecSelfer_containerMapKey%s)", x.xs) - x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(\"" + si.encName + "\"))") - x.line("r.WriteMapElemValue()") // x.linef("z.EncSendContainerState(codecSelfer_containerMapValue%s)", x.xs) - if labelUsed { - x.line("if " + isNilVarName + " { r.EncodeNil() } else { ") - x.encVar(varname+"."+t2.Name, t2.Type) - x.line("}") - } else { - x.encVar(varname+"."+t2.Name, t2.Type) - } - if si.omitEmpty { - x.line("}") - } - x.linef("} ") // end if/else ti.toArray - } - x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { - x.line("r.WriteArrayEnd()") // x.linef("z.EncSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) - x.line("} else {") - x.line("r.WriteMapEnd()") // x.linef("z.EncSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) - x.line("}") - -} - -func (x *genRunner) encListFallback(varname string, t reflect.Type) { - if t.AssignableTo(uint8SliceTyp) { - x.linef("r.EncodeStringBytes(codecSelferC_RAW%s, []byte(%s))", x.xs, varname) - return - } - if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 { - x.linef("r.EncodeStringBytes(codecSelferC_RAW%s, ([%v]byte(%s))[:])", x.xs, t.Len(), varname) - return - } - i := x.varsfx() - g := genTempVarPfx - x.line("r.WriteArrayStart(len(" + varname + "))") - if t.Kind() == reflect.Chan { - x.linef("for %si%s, %si2%s := 0, len(%s); %si%s < %si2%s; %si%s++ {", g, i, g, i, varname, g, i, g, i, g, i) - x.line("r.WriteArrayElem()") // x.linef("z.EncSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) - x.linef("%sv%s := <-%s", g, i, varname) - } else { - // x.linef("for %si%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) - x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname) - x.line("r.WriteArrayElem()") // x.linef("z.EncSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) - } - x.encVar(genTempVarPfx+"v"+i, t.Elem()) - x.line("}") - x.line("r.WriteArrayEnd()") // x.linef("z.EncSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) -} - -func (x *genRunner) encMapFallback(varname string, t reflect.Type) { - // TODO: expand this to handle canonical. - i := x.varsfx() - x.line("r.WriteMapStart(len(" + varname + "))") - x.linef("for %sk%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) - // x.line("for " + genTempVarPfx + "k" + i + ", " + genTempVarPfx + "v" + i + " := range " + varname + " {") - x.line("r.WriteMapElemKey()") // f("z.EncSendContainerState(codecSelfer_containerMapKey%s)", x.xs) - x.encVar(genTempVarPfx+"k"+i, t.Key()) - x.line("r.WriteMapElemValue()") // f("z.EncSendContainerState(codecSelfer_containerMapValue%s)", x.xs) - x.encVar(genTempVarPfx+"v"+i, t.Elem()) - x.line("}") - x.line("r.WriteMapEnd()") // f("z.EncSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) -} - -func (x *genRunner) decVar(varname, decodedNilVarname string, t reflect.Type, canBeNil bool) { - // We only encode as nil if a nillable value. - // This removes some of the wasted checks for TryDecodeAsNil. - // We need to think about this more, to see what happens if omitempty, etc - // cause a nil value to be stored when something is expected. - // This could happen when decoding from a struct encoded as an array. - // For that, decVar should be called with canNil=true, to force true as its value. - i := x.varsfx() - if !canBeNil { - canBeNil = genAnythingCanBeNil || !genIsImmutable(t) - } - if canBeNil { - x.line("if r.TryDecodeAsNil() {") - if decodedNilVarname != "" { - x.line(decodedNilVarname + " = true") - } else if t.Kind() == reflect.Ptr { - x.line("if " + varname + " != nil { ") - - // if varname is a field of a struct (has a dot in it), - // then just set it to nil - if strings.IndexByte(varname, '.') != -1 { - x.line(varname + " = nil") - } else { - x.line("*" + varname + " = " + x.genZeroValueR(t.Elem())) - } - x.line("}") - } else { - x.line(varname + " = " + x.genZeroValueR(t)) - } - x.line("} else {") - } else { - x.line("// cannot be nil") - } - if t.Kind() != reflect.Ptr { - if x.decTryAssignPrimitive(varname, t) { - x.line(genTempVarPfx + "v" + i + " := &" + varname) - x.dec(genTempVarPfx+"v"+i, t) - } - } else { - x.linef("if %s == nil { %s = new(%s) }", varname, varname, x.genTypeName(t.Elem())) - // Ensure we set underlying ptr to a non-nil value (so we can deref to it later). - // There's a chance of a **T in here which is nil. - var ptrPfx string - for t = t.Elem(); t.Kind() == reflect.Ptr; t = t.Elem() { - ptrPfx += "*" - x.linef("if %s%s == nil { %s%s = new(%s)}", - ptrPfx, varname, ptrPfx, varname, x.genTypeName(t)) - } - // if varname has [ in it, then create temp variable for this ptr thingie - if strings.Index(varname, "[") >= 0 { - varname2 := genTempVarPfx + "w" + i - x.line(varname2 + " := " + varname) - varname = varname2 - } - - if ptrPfx == "" { - x.dec(varname, t) - } else { - x.line(genTempVarPfx + "z" + i + " := " + ptrPfx + varname) - x.dec(genTempVarPfx+"z"+i, t) - } - - } - - if canBeNil { - x.line("} ") - } -} - -// dec will decode a variable (varname) of type ptrTo(t). -// t is always a basetype (i.e. not of kind reflect.Ptr). -func (x *genRunner) dec(varname string, t reflect.Type) { - // assumptions: - // - the varname is to a pointer already. No need to take address of it - // - t is always a baseType T (not a *T, etc). - rtid := rt2id(t) - tptr := reflect.PtrTo(t) - if x.checkForSelfer(t, varname) { - if t.Implements(selferTyp) || tptr.Implements(selferTyp) { - x.line(varname + ".CodecDecodeSelf(d)") - return - } - if _, ok := x.td[rtid]; ok { - x.line(varname + ".CodecDecodeSelf(d)") - return - } - } - - inlist := false - for _, t0 := range x.t { - if t == t0 { - inlist = true - if x.checkForSelfer(t, varname) { - x.line(varname + ".CodecDecodeSelf(d)") - return - } - break - } - } - - var rtidAdded bool - if t == x.tc { - x.td[rtid] = true - rtidAdded = true - } - - // check if - // - type is Raw, RawExt - // - the type implements (Text|JSON|Binary)(Unm|M)arshal - mi := x.varsfx() - x.linef("%sm%s := z.DecBinary()", genTempVarPfx, mi) - x.linef("_ = %sm%s", genTempVarPfx, mi) - x.line("if false {") //start if block - defer func() { x.line("}") }() //end if block - - if t == rawTyp { - x.linef("} else { *%v = z.DecRaw()", varname) - return - } - if t == rawExtTyp { - x.linef("} else { r.DecodeExt(%v, 0, nil)", varname) - return - } - - // HACK: Support for Builtins. - // Currently, only Binc supports builtins, and the only builtin type is time.Time. - // Have a method that returns the rtid for time.Time if Handle is Binc. - if t == timeTyp { - vrtid := genTempVarPfx + "m" + x.varsfx() - x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) - x.linef("r.DecodeBuiltin(%s, %s)", vrtid, varname) - } - // only check for extensions if the type is named, and has a packagePath. - if !x.nx && genImportPath(t) != "" && t.Name() != "" { - // first check if extensions are configued, before doing the interface conversion - x.linef("} else if z.HasExtensions() && z.DecExt(%s) {", varname) - } - - if t.Implements(binaryUnmarshalerTyp) || tptr.Implements(binaryUnmarshalerTyp) { - x.linef("} else if %sm%s { z.DecBinaryUnmarshal(%v) ", genTempVarPfx, mi, varname) - } - if t.Implements(jsonUnmarshalerTyp) || tptr.Implements(jsonUnmarshalerTyp) { - x.linef("} else if !%sm%s && z.IsJSONHandle() { z.DecJSONUnmarshal(%v)", genTempVarPfx, mi, varname) - } else if t.Implements(textUnmarshalerTyp) || tptr.Implements(textUnmarshalerTyp) { - x.linef("} else if !%sm%s { z.DecTextUnmarshal(%v)", genTempVarPfx, mi, varname) - } - - x.line("} else {") - - // Since these are pointers, we cannot share, and have to use them one by one - switch t.Kind() { - case reflect.Int: - x.line("*((*int)(" + varname + ")) = int(r.DecodeInt(codecSelferBitsize" + x.xs + "))") - // x.line("z.DecInt((*int)(" + varname + "))") - case reflect.Int8: - x.line("*((*int8)(" + varname + ")) = int8(r.DecodeInt(8))") - // x.line("z.DecInt8((*int8)(" + varname + "))") - case reflect.Int16: - x.line("*((*int16)(" + varname + ")) = int16(r.DecodeInt(16))") - // x.line("z.DecInt16((*int16)(" + varname + "))") - case reflect.Int32: - x.line("*((*int32)(" + varname + ")) = int32(r.DecodeInt(32))") - // x.line("z.DecInt32((*int32)(" + varname + "))") - case reflect.Int64: - x.line("*((*int64)(" + varname + ")) = int64(r.DecodeInt(64))") - // x.line("z.DecInt64((*int64)(" + varname + "))") - - case reflect.Uint: - x.line("*((*uint)(" + varname + ")) = uint(r.DecodeUint(codecSelferBitsize" + x.xs + "))") - // x.line("z.DecUint((*uint)(" + varname + "))") - case reflect.Uint8: - x.line("*((*uint8)(" + varname + ")) = uint8(r.DecodeUint(8))") - // x.line("z.DecUint8((*uint8)(" + varname + "))") - case reflect.Uint16: - x.line("*((*uint16)(" + varname + ")) = uint16(r.DecodeUint(16))") - //x.line("z.DecUint16((*uint16)(" + varname + "))") - case reflect.Uint32: - x.line("*((*uint32)(" + varname + ")) = uint32(r.DecodeUint(32))") - //x.line("z.DecUint32((*uint32)(" + varname + "))") - case reflect.Uint64: - x.line("*((*uint64)(" + varname + ")) = uint64(r.DecodeUint(64))") - //x.line("z.DecUint64((*uint64)(" + varname + "))") - case reflect.Uintptr: - x.line("*((*uintptr)(" + varname + ")) = uintptr(r.DecodeUint(codecSelferBitsize" + x.xs + "))") - - case reflect.Float32: - x.line("*((*float32)(" + varname + ")) = float32(r.DecodeFloat(true))") - //x.line("z.DecFloat32((*float32)(" + varname + "))") - case reflect.Float64: - x.line("*((*float64)(" + varname + ")) = float64(r.DecodeFloat(false))") - // x.line("z.DecFloat64((*float64)(" + varname + "))") - - case reflect.Bool: - x.line("*((*bool)(" + varname + ")) = r.DecodeBool()") - // x.line("z.DecBool((*bool)(" + varname + "))") - case reflect.String: - x.line("*((*string)(" + varname + ")) = r.DecodeString()") - // x.line("z.DecString((*string)(" + varname + "))") - case reflect.Array, reflect.Chan: - x.xtraSM(varname, false, t) - // x.decListFallback(varname, rtid, true, t) - case reflect.Slice: - // if a []uint8, call dedicated function - // if a known fastpath slice, call dedicated function - // else write encode function in-line. - // - if elements are primitives or Selfers, call dedicated function on each member. - // - else call Encoder.encode(XXX) on it. - if rtid == uint8SliceTypId { - x.line("*" + varname + " = r.DecodeBytes(*(*[]byte)(" + varname + "), false)") - } else if fastpathAV.index(rtid) != -1 { - g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", d)") - } else { - x.xtraSM(varname, false, t) - // x.decListFallback(varname, rtid, false, t) - } - case reflect.Map: - // if a known fastpath map, call dedicated function - // else write encode function in-line. - // - if elements are primitives or Selfers, call dedicated function on each member. - // - else call Encoder.encode(XXX) on it. - if fastpathAV.index(rtid) != -1 { - g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", d)") - } else { - x.xtraSM(varname, false, t) - // x.decMapFallback(varname, rtid, t) - } - case reflect.Struct: - if inlist { - x.decStruct(varname, rtid, t) - } else { - // delete(x.td, rtid) - x.line("z.DecFallback(" + varname + ", false)") - } - default: - if rtidAdded { - delete(x.te, rtid) - } - x.line("z.DecFallback(" + varname + ", true)") - } -} - -func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type) (tryAsPtr bool) { - // This should only be used for exact primitives (ie un-named types). - // Named types may be implementations of Selfer, Unmarshaler, etc. - // They should be handled by dec(...) - - if t.Name() != "" { - tryAsPtr = true - return - } - - switch t.Kind() { - case reflect.Int: - x.linef("%s = r.DecodeInt(codecSelferBitsize%s)", varname, x.xs) - case reflect.Int8: - x.linef("%s = r.DecodeInt(8)", varname) - case reflect.Int16: - x.linef("%s = r.DecodeInt(16)", varname) - case reflect.Int32: - x.linef("%s = r.DecodeInt(32)", varname) - case reflect.Int64: - x.linef("%s = r.DecodeInt(64)", varname) - - case reflect.Uint: - x.linef("%s = r.DecodeUint(codecSelferBitsize%s)", varname, x.xs) - case reflect.Uint8: - x.linef("%s = r.DecodeUint(8)", varname) - case reflect.Uint16: - x.linef("%s = r.DecodeUint(16)", varname) - case reflect.Uint32: - x.linef("%s = r.DecodeUint(32)", varname) - case reflect.Uint64: - x.linef("%s = r.DecodeUint(64)", varname) - case reflect.Uintptr: - x.linef("%s = r.DecodeUint(codecSelferBitsize%s)", varname, x.xs) - - case reflect.Float32: - x.linef("%s = r.DecodeFloat(true)", varname) - case reflect.Float64: - x.linef("%s = r.DecodeFloat(false)", varname) - - case reflect.Bool: - x.linef("%s = r.DecodeBool()", varname) - case reflect.String: - x.linef("%s = r.DecodeString()", varname) - default: - tryAsPtr = true - } - return -} - -func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type) { - if t.AssignableTo(uint8SliceTyp) { - x.line("*" + varname + " = r.DecodeBytes(*((*[]byte)(" + varname + ")), false)") - return - } - if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 { - x.linef("r.DecodeBytes( ((*[%s]byte)(%s))[:], true)", t.Len(), varname) - return - } - type tstruc struct { - TempVar string - Rand string - Varname string - CTyp string - Typ string - Immutable bool - Size int - } - telem := t.Elem() - ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(t), x.genTypeName(telem), genIsImmutable(telem), int(telem.Size())} - - funcs := make(template.FuncMap) - - funcs["decLineVar"] = func(varname string) string { - x.decVar(varname, "", telem, false) - return "" - } - // funcs["decLine"] = func(pfx string) string { - // x.decVar(ts.TempVar+pfx+ts.Rand, "", reflect.PtrTo(telem), false) - // return "" - // } - funcs["var"] = func(s string) string { - return ts.TempVar + s + ts.Rand - } - funcs["zero"] = func() string { - return x.genZeroValueR(telem) - } - funcs["isArray"] = func() bool { - return t.Kind() == reflect.Array - } - funcs["isSlice"] = func() bool { - return t.Kind() == reflect.Slice - } - funcs["isChan"] = func() bool { - return t.Kind() == reflect.Chan - } - tm, err := template.New("").Funcs(funcs).Parse(genDecListTmpl) - if err != nil { - panic(err) - } - if err = tm.Execute(x.w, &ts); err != nil { - panic(err) - } -} - -func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) { - type tstruc struct { - TempVar string - Sfx string - Rand string - Varname string - KTyp string - Typ string - Size int - } - telem := t.Elem() - tkey := t.Key() - ts := tstruc{ - genTempVarPfx, x.xs, x.varsfx(), varname, x.genTypeName(tkey), - x.genTypeName(telem), int(telem.Size() + tkey.Size()), - } - - funcs := make(template.FuncMap) - funcs["decElemZero"] = func() string { - return x.genZeroValueR(telem) - } - funcs["decElemKindImmutable"] = func() bool { - return genIsImmutable(telem) - } - funcs["decElemKindPtr"] = func() bool { - return telem.Kind() == reflect.Ptr - } - funcs["decElemKindIntf"] = func() bool { - return telem.Kind() == reflect.Interface - } - funcs["decLineVarK"] = func(varname string) string { - x.decVar(varname, "", tkey, false) - return "" - } - funcs["decLineVar"] = func(varname, decodedNilVarname string) string { - x.decVar(varname, decodedNilVarname, telem, false) - return "" - } - // funcs["decLineK"] = func(pfx string) string { - // x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(tkey), false) - // return "" - // } - // funcs["decLine"] = func(pfx string) string { - // x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(telem), false) - // return "" - // } - funcs["var"] = func(s string) string { - return ts.TempVar + s + ts.Rand - } - - tm, err := template.New("").Funcs(funcs).Parse(genDecMapTmpl) - if err != nil { - panic(err) - } - if err = tm.Execute(x.w, &ts); err != nil { - panic(err) - } -} - -func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintptr, t reflect.Type) { - ti := x.ti.get(rtid, t) - tisfi := ti.sfip // always use sequence from file. decStruct expects same thing. - x.line("switch (" + kName + ") {") - for _, si := range tisfi { - x.line("case \"" + si.encName + "\":") - var t2 reflect.StructField - { - //we must accommodate anonymous fields, where the embedded field is a nil pointer in the value. - // t2 = t.FieldByIndex(si.is) - t2typ := t - varname3 := varname - for ij, ix := range si.is { - if uint8(ij) == si.nis { - break - } - for t2typ.Kind() == reflect.Ptr { - t2typ = t2typ.Elem() - } - t2 = t2typ.Field(int(ix)) - t2typ = t2.Type - varname3 = varname3 + "." + t2.Name - if t2typ.Kind() == reflect.Ptr { - x.linef("if %s == nil { %s = new(%s) }", varname3, varname3, x.genTypeName(t2typ.Elem())) - } - } - } - x.decVar(varname+"."+t2.Name, "", t2.Type, false) - } - x.line("default:") - // pass the slice here, so that the string will not escape, and maybe save allocation - x.line("z.DecStructFieldNotFound(-1, " + kName + ")") - x.line("} // end switch " + kName) -} - -func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t reflect.Type, style genStructMapStyle) { - tpfx := genTempVarPfx - i := x.varsfx() - kName := tpfx + "s" + i - - // x.line("var " + kName + "Arr = [32]byte{} // default string to decode into") - // x.line("var " + kName + "Slc = " + kName + "Arr[:] // default slice to decode into") - // use the scratch buffer to avoid allocation (most field names are < 32). - - x.line("var " + kName + "Slc = z.DecScratchBuffer() // default slice to decode into") - - x.line("_ = " + kName + "Slc") - switch style { - case genStructMapStyleLenPrefix: - x.linef("for %sj%s := 0; %sj%s < %s; %sj%s++ {", tpfx, i, tpfx, i, lenvarname, tpfx, i) - case genStructMapStyleCheckBreak: - x.linef("for %sj%s := 0; !r.CheckBreak(); %sj%s++ {", tpfx, i, tpfx, i) - default: // 0, otherwise. - x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length - x.linef("for %sj%s := 0; ; %sj%s++ {", tpfx, i, tpfx, i) - x.linef("if %shl%s { if %sj%s >= %s { break }", tpfx, i, tpfx, i, lenvarname) - x.line("} else { if r.CheckBreak() { break }; }") - } - x.line("r.ReadMapElemKey()") // f("z.DecSendContainerState(codecSelfer_containerMapKey%s)", x.xs) - x.line(kName + "Slc = r.DecodeStringAsBytes()") - // let string be scoped to this loop alone, so it doesn't escape. - x.line(kName + " := string(" + kName + "Slc)") - x.line("r.ReadMapElemValue()") // f("z.DecSendContainerState(codecSelfer_containerMapValue%s)", x.xs) - x.decStructMapSwitch(kName, varname, rtid, t) - - x.line("} // end for " + tpfx + "j" + i) - x.line("r.ReadMapEnd()") // f("z.DecSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) -} - -func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid uintptr, t reflect.Type) { - tpfx := genTempVarPfx - i := x.varsfx() - ti := x.ti.get(rtid, t) - tisfi := ti.sfip // always use sequence from file. decStruct expects same thing. - x.linef("var %sj%s int", tpfx, i) - x.linef("var %sb%s bool", tpfx, i) // break - x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length - for _, si := range tisfi { - var t2 reflect.StructField - { - //we must accommodate anonymous fields, where the embedded field is a nil pointer in the value. - // t2 = t.FieldByIndex(si.is) - t2typ := t - varname3 := varname - for ij, ix := range si.is { - if uint8(ij) == si.nis { - break - } - for t2typ.Kind() == reflect.Ptr { - t2typ = t2typ.Elem() - } - t2 = t2typ.Field(int(ix)) - t2typ = t2.Type - varname3 = varname3 + "." + t2.Name - if t2typ.Kind() == reflect.Ptr { - x.linef("if %s == nil { %s = new(%s) }", varname3, varname3, x.genTypeName(t2typ.Elem())) - } - } - } - - x.linef("%sj%s++; if %shl%s { %sb%s = %sj%s > %s } else { %sb%s = r.CheckBreak() }", - tpfx, i, tpfx, i, tpfx, i, - tpfx, i, lenvarname, tpfx, i) - x.linef("if %sb%s { r.ReadArrayEnd(); %s }", tpfx, i, breakString) - // x.linef("if %sb%s { z.DecSendContainerState(codecSelfer_containerArrayEnd%s); %s }", tpfx, i, x.xs, breakString) - x.line("r.ReadArrayElem()") // f("z.DecSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) - x.decVar(varname+"."+t2.Name, "", t2.Type, true) - } - // read remaining values and throw away. - x.line("for {") - x.linef("%sj%s++; if %shl%s { %sb%s = %sj%s > %s } else { %sb%s = r.CheckBreak() }", - tpfx, i, tpfx, i, tpfx, i, - tpfx, i, lenvarname, tpfx, i) - x.linef("if %sb%s { break }", tpfx, i) - x.line("r.ReadArrayElem()") // f("z.DecSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) - x.linef(`z.DecStructFieldNotFound(%sj%s - 1, "")`, tpfx, i) - x.line("}") - x.line("r.ReadArrayEnd()") // f("z.DecSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) -} - -func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { - // if container is map - i := x.varsfx() - x.linef("%sct%s := r.ContainerType()", genTempVarPfx, i) - x.linef("if %sct%s == codecSelferValueTypeMap%s {", genTempVarPfx, i, x.xs) - x.line(genTempVarPfx + "l" + i + " := r.ReadMapStart()") - x.linef("if %sl%s == 0 {", genTempVarPfx, i) - x.line("r.ReadMapEnd()") // f("z.DecSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) - if genUseOneFunctionForDecStructMap { - x.line("} else { ") - x.linef("x.codecDecodeSelfFromMap(%sl%s, d)", genTempVarPfx, i) - } else { - x.line("} else if " + genTempVarPfx + "l" + i + " > 0 { ") - x.line("x.codecDecodeSelfFromMapLenPrefix(" + genTempVarPfx + "l" + i + ", d)") - x.line("} else {") - x.line("x.codecDecodeSelfFromMapCheckBreak(" + genTempVarPfx + "l" + i + ", d)") - } - x.line("}") - - // else if container is array - x.linef("} else if %sct%s == codecSelferValueTypeArray%s {", genTempVarPfx, i, x.xs) - x.line(genTempVarPfx + "l" + i + " := r.ReadArrayStart()") - x.linef("if %sl%s == 0 {", genTempVarPfx, i) - x.line("r.ReadArrayEnd()") // f("z.DecSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) - x.line("} else { ") - x.linef("x.codecDecodeSelfFromArray(%sl%s, d)", genTempVarPfx, i) - x.line("}") - // else panic - x.line("} else { ") - x.line("panic(codecSelferOnlyMapOrArrayEncodeToStructErr" + x.xs + ")") - x.line("} ") -} - -// -------- - -type genV struct { - // genV is either a primitive (Primitive != "") or a map (MapKey != "") or a slice - MapKey string - Elem string - Primitive string - Size int -} - -func (x *genRunner) newGenV(t reflect.Type) (v genV) { - switch t.Kind() { - case reflect.Slice, reflect.Array: - te := t.Elem() - v.Elem = x.genTypeName(te) - v.Size = int(te.Size()) - case reflect.Map: - te, tk := t.Elem(), t.Key() - v.Elem = x.genTypeName(te) - v.MapKey = x.genTypeName(tk) - v.Size = int(te.Size() + tk.Size()) - default: - panic("unexpected type for newGenV. Requires map or slice type") - } - return -} - -func (x *genV) MethodNamePfx(prefix string, prim bool) string { - var name []byte - if prefix != "" { - name = append(name, prefix...) - } - if prim { - name = append(name, genTitleCaseName(x.Primitive)...) - } else { - if x.MapKey == "" { - name = append(name, "Slice"...) - } else { - name = append(name, "Map"...) - name = append(name, genTitleCaseName(x.MapKey)...) - } - name = append(name, genTitleCaseName(x.Elem)...) - } - return string(name) - -} - -// genImportPath returns import path of a non-predeclared named typed, or an empty string otherwise. -// -// This handles the misbehaviour that occurs when 1.5-style vendoring is enabled, -// where PkgPath returns the full path, including the vendoring pre-fix that should have been stripped. -// We strip it here. -func genImportPath(t reflect.Type) (s string) { - s = t.PkgPath() - if genCheckVendor { - // HACK: always handle vendoring. It should be typically on in go 1.6, 1.7 - s = stripVendor(s) - } - return -} - -// A go identifier is (letter|_)[letter|number|_]* -func genGoIdentifier(s string, checkFirstChar bool) string { - b := make([]byte, 0, len(s)) - t := make([]byte, 4) - var n int - for i, r := range s { - if checkFirstChar && i == 0 && !unicode.IsLetter(r) { - b = append(b, '_') - } - // r must be unicode_letter, unicode_digit or _ - if unicode.IsLetter(r) || unicode.IsDigit(r) { - n = utf8.EncodeRune(t, r) - b = append(b, t[:n]...) - } else { - b = append(b, '_') - } - } - return string(b) -} - -func genNonPtr(t reflect.Type) reflect.Type { - for t.Kind() == reflect.Ptr { - t = t.Elem() - } - return t -} - -func genTitleCaseName(s string) string { - switch s { - case "interface{}", "interface {}": - return "Intf" - default: - return strings.ToUpper(s[0:1]) + s[1:] - } -} - -func genMethodNameT(t reflect.Type, tRef reflect.Type) (n string) { - var ptrPfx string - for t.Kind() == reflect.Ptr { - ptrPfx += "Ptrto" - t = t.Elem() - } - tstr := t.String() - if tn := t.Name(); tn != "" { - if tRef != nil && genImportPath(t) == genImportPath(tRef) { - return ptrPfx + tn - } else { - if genQNameRegex.MatchString(tstr) { - return ptrPfx + strings.Replace(tstr, ".", "_", 1000) - } else { - return ptrPfx + genCustomTypeName(tstr) - } - } - } - switch t.Kind() { - case reflect.Map: - return ptrPfx + "Map" + genMethodNameT(t.Key(), tRef) + genMethodNameT(t.Elem(), tRef) - case reflect.Slice: - return ptrPfx + "Slice" + genMethodNameT(t.Elem(), tRef) - case reflect.Array: - return ptrPfx + "Array" + strconv.FormatInt(int64(t.Len()), 10) + genMethodNameT(t.Elem(), tRef) - case reflect.Chan: - var cx string - switch t.ChanDir() { - case reflect.SendDir: - cx = "ChanSend" - case reflect.RecvDir: - cx = "ChanRecv" - default: - cx = "Chan" - } - return ptrPfx + cx + genMethodNameT(t.Elem(), tRef) - default: - if t == intfTyp { - return ptrPfx + "Interface" - } else { - if tRef != nil && genImportPath(t) == genImportPath(tRef) { - if t.Name() != "" { - return ptrPfx + t.Name() - } else { - return ptrPfx + genCustomTypeName(tstr) - } - } else { - // best way to get the package name inclusive - // return ptrPfx + strings.Replace(tstr, ".", "_", 1000) - // return ptrPfx + genBase64enc.EncodeToString([]byte(tstr)) - if t.Name() != "" && genQNameRegex.MatchString(tstr) { - return ptrPfx + strings.Replace(tstr, ".", "_", 1000) - } else { - return ptrPfx + genCustomTypeName(tstr) - } - } - } - } -} - -// genCustomNameForType base64encodes the t.String() value in such a way -// that it can be used within a function name. -func genCustomTypeName(tstr string) string { - len2 := genBase64enc.EncodedLen(len(tstr)) - bufx := make([]byte, len2) - genBase64enc.Encode(bufx, []byte(tstr)) - for i := len2 - 1; i >= 0; i-- { - if bufx[i] == '=' { - len2-- - } else { - break - } - } - return string(bufx[:len2]) -} - -func genIsImmutable(t reflect.Type) (v bool) { - return isImmutableKind(t.Kind()) -} - -type genInternal struct { - Version int - Values []genV -} - -func (x genInternal) FastpathLen() (l int) { - for _, v := range x.Values { - if v.Primitive == "" { - l++ - } - } - return -} - -func genInternalZeroValue(s string) string { - switch s { - case "interface{}", "interface {}": - return "nil" - case "bool": - return "false" - case "string": - return `""` - default: - return "0" - } -} - -func genInternalEncCommandAsString(s string, vname string) string { - switch s { - case "uint", "uint8", "uint16", "uint32", "uint64": - return "ee.EncodeUint(uint64(" + vname + "))" - case "int", "int8", "int16", "int32", "int64": - return "ee.EncodeInt(int64(" + vname + "))" - case "string": - return "ee.EncodeString(c_UTF8, " + vname + ")" - case "float32": - return "ee.EncodeFloat32(" + vname + ")" - case "float64": - return "ee.EncodeFloat64(" + vname + ")" - case "bool": - return "ee.EncodeBool(" + vname + ")" - case "symbol": - return "ee.EncodeSymbol(" + vname + ")" - default: - return "e.encode(" + vname + ")" - } -} - -func genInternalDecCommandAsString(s string) string { - switch s { - case "uint": - return "uint(dd.DecodeUint(uintBitsize))" - case "uint8": - return "uint8(dd.DecodeUint(8))" - case "uint16": - return "uint16(dd.DecodeUint(16))" - case "uint32": - return "uint32(dd.DecodeUint(32))" - case "uint64": - return "dd.DecodeUint(64)" - case "uintptr": - return "uintptr(dd.DecodeUint(uintBitsize))" - case "int": - return "int(dd.DecodeInt(intBitsize))" - case "int8": - return "int8(dd.DecodeInt(8))" - case "int16": - return "int16(dd.DecodeInt(16))" - case "int32": - return "int32(dd.DecodeInt(32))" - case "int64": - return "dd.DecodeInt(64)" - - case "string": - return "dd.DecodeString()" - case "float32": - return "float32(dd.DecodeFloat(true))" - case "float64": - return "dd.DecodeFloat(false)" - case "bool": - return "dd.DecodeBool()" - default: - panic(errors.New("gen internal: unknown type for decode: " + s)) - } -} - -func genInternalSortType(s string, elem bool) string { - for _, v := range [...]string{"int", "uint", "float", "bool", "string"} { - if strings.HasPrefix(s, v) { - if elem { - if v == "int" || v == "uint" || v == "float" { - return v + "64" - } else { - return v - } - } - return v + "Slice" - } - } - panic("sorttype: unexpected type: " + s) -} - -func stripVendor(s string) string { - // HACK: Misbehaviour occurs in go 1.5. May have to re-visit this later. - // if s contains /vendor/ OR startsWith vendor/, then return everything after it. - const vendorStart = "vendor/" - const vendorInline = "/vendor/" - if i := strings.LastIndex(s, vendorInline); i >= 0 { - s = s[i+len(vendorInline):] - } else if strings.HasPrefix(s, vendorStart) { - s = s[len(vendorStart):] - } - return s -} - -// var genInternalMu sync.Mutex -var genInternalV = genInternal{Version: genVersion} -var genInternalTmplFuncs template.FuncMap -var genInternalOnce sync.Once - -func genInternalInit() { - types := [...]string{ - "interface{}", - "string", - "float32", - "float64", - "uint", - "uint8", - "uint16", - "uint32", - "uint64", - "uintptr", - "int", - "int8", - "int16", - "int32", - "int64", - "bool", - } - // keep as slice, so it is in specific iteration order. - // Initial order was uint64, string, interface{}, int, int64 - mapvaltypes := [...]string{ - "interface{}", - "string", - "uint", - "uint8", - "uint16", - "uint32", - "uint64", - "uintptr", - "int", - "int8", - "int16", - "int32", - "int64", - "float32", - "float64", - "bool", - } - wordSizeBytes := int(intBitsize) / 8 - - mapvaltypes2 := map[string]int{ - "interface{}": 2 * wordSizeBytes, - "string": 2 * wordSizeBytes, - "uint": 1 * wordSizeBytes, - "uint8": 1, - "uint16": 2, - "uint32": 4, - "uint64": 8, - "uintptr": 1 * wordSizeBytes, - "int": 1 * wordSizeBytes, - "int8": 1, - "int16": 2, - "int32": 4, - "int64": 8, - "float32": 4, - "float64": 8, - "bool": 1, - } - var gt = genInternal{Version: genVersion} - - // For each slice or map type, there must be a (symmetrical) Encode and Decode fast-path function - for _, s := range types { - gt.Values = append(gt.Values, genV{Primitive: s, Size: mapvaltypes2[s]}) - if s != "uint8" { // do not generate fast path for slice of bytes. Treat specially already. - gt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]}) - } - if _, ok := mapvaltypes2[s]; !ok { - gt.Values = append(gt.Values, genV{MapKey: s, Elem: s, Size: 2 * mapvaltypes2[s]}) - } - for _, ms := range mapvaltypes { - gt.Values = append(gt.Values, genV{MapKey: s, Elem: ms, Size: mapvaltypes2[s] + mapvaltypes2[ms]}) - } - } - - funcs := make(template.FuncMap) - // funcs["haspfx"] = strings.HasPrefix - funcs["encmd"] = genInternalEncCommandAsString - funcs["decmd"] = genInternalDecCommandAsString - funcs["zerocmd"] = genInternalZeroValue - funcs["hasprefix"] = strings.HasPrefix - funcs["sorttype"] = genInternalSortType - - genInternalV = gt - genInternalTmplFuncs = funcs -} - -// genInternalGoFile is used to generate source files from templates. -// It is run by the program author alone. -// Unfortunately, it has to be exported so that it can be called from a command line tool. -// *** DO NOT USE *** -func genInternalGoFile(r io.Reader, w io.Writer) (err error) { - genInternalOnce.Do(genInternalInit) - - gt := genInternalV - - t := template.New("").Funcs(genInternalTmplFuncs) - - tmplstr, err := ioutil.ReadAll(r) - if err != nil { - return - } - - if t, err = t.Parse(string(tmplstr)); err != nil { - return - } - - var out bytes.Buffer - err = t.Execute(&out, gt) - if err != nil { - return - } - - bout, err := format.Source(out.Bytes()) - if err != nil { - w.Write(out.Bytes()) // write out if error, so we can still see. - // w.Write(bout) // write out if error, as much as possible, so we can still see. - return - } - w.Write(bout) - return -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go deleted file mode 100644 index 7567e2c0..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build go1.5 - -package codec - -import "reflect" - -const reflectArrayOfSupported = true - -func reflectArrayOf(count int, elem reflect.Type) reflect.Type { - return reflect.ArrayOf(count, elem) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go deleted file mode 100644 index ec94bd0c..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build !go1.5 - -package codec - -import "reflect" - -const reflectArrayOfSupported = false - -func reflectArrayOf(count int, elem reflect.Type) reflect.Type { - panic("codec: reflect.ArrayOf unsupported in this go version") -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go deleted file mode 100644 index 51fe40e5..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build go1.9 - -package codec - -import "reflect" - -func makeMapReflect(t reflect.Type, size int) reflect.Value { - if size < 0 { - return reflect.MakeMapWithSize(t, 4) - } - return reflect.MakeMapWithSize(t, size) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go deleted file mode 100644 index d4b9c2c8..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build !go1.9 - -package codec - -import "reflect" - -func makeMapReflect(t reflect.Type, size int) reflect.Value { - return reflect.MakeMap(t) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go deleted file mode 100644 index dcd8c3d1..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build !go1.4 - -package codec - -// This codec package will only work for go1.4 and above. -// This is for the following reasons: -// - go 1.4 was released in 2014 -// - go runtime is written fully in go -// - interface only holds pointers -// - reflect.Value is stabilized as 3 words - -func init() { - panic("codec: go 1.3 and below are not supported") -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go deleted file mode 100644 index 68626e1c..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build go1.5,!go1.6 - -package codec - -import "os" - -var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go deleted file mode 100644 index 344f5967..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build go1.6,!go1.7 - -package codec - -import "os" - -var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go deleted file mode 100644 index de91d294..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build go1.7 - -package codec - -const genCheckVendor = true diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go deleted file mode 100644 index 9d007bfe..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build !go1.5 - -package codec - -var genCheckVendor = false diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper.go deleted file mode 100644 index b846df0d..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper.go +++ /dev/null @@ -1,1944 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -// Contains code shared by both encode and decode. - -// Some shared ideas around encoding/decoding -// ------------------------------------------ -// -// If an interface{} is passed, we first do a type assertion to see if it is -// a primitive type or a map/slice of primitive types, and use a fastpath to handle it. -// -// If we start with a reflect.Value, we are already in reflect.Value land and -// will try to grab the function for the underlying Type and directly call that function. -// This is more performant than calling reflect.Value.Interface(). -// -// This still helps us bypass many layers of reflection, and give best performance. -// -// Containers -// ------------ -// Containers in the stream are either associative arrays (key-value pairs) or -// regular arrays (indexed by incrementing integers). -// -// Some streams support indefinite-length containers, and use a breaking -// byte-sequence to denote that the container has come to an end. -// -// Some streams also are text-based, and use explicit separators to denote the -// end/beginning of different values. -// -// During encode, we use a high-level condition to determine how to iterate through -// the container. That decision is based on whether the container is text-based (with -// separators) or binary (without separators). If binary, we do not even call the -// encoding of separators. -// -// During decode, we use a different high-level condition to determine how to iterate -// through the containers. That decision is based on whether the stream contained -// a length prefix, or if it used explicit breaks. If length-prefixed, we assume that -// it has to be binary, and we do not even try to read separators. -// -// Philosophy -// ------------ -// On decode, this codec will update containers appropriately: -// - If struct, update fields from stream into fields of struct. -// If field in stream not found in struct, handle appropriately (based on option). -// If a struct field has no corresponding value in the stream, leave it AS IS. -// If nil in stream, set value to nil/zero value. -// - If map, update map from stream. -// If the stream value is NIL, set the map to nil. -// - if slice, try to update up to length of array in stream. -// if container len is less than stream array length, -// and container cannot be expanded, handled (based on option). -// This means you can decode 4-element stream array into 1-element array. -// -// ------------------------------------ -// On encode, user can specify omitEmpty. This means that the value will be omitted -// if the zero value. The problem may occur during decode, where omitted values do not affect -// the value being decoded into. This means that if decoding into a struct with an -// int field with current value=5, and the field is omitted in the stream, then after -// decoding, the value will still be 5 (not 0). -// omitEmpty only works if you guarantee that you always decode into zero-values. -// -// ------------------------------------ -// We could have truncated a map to remove keys not available in the stream, -// or set values in the struct which are not in the stream to their zero values. -// We decided against it because there is no efficient way to do it. -// We may introduce it as an option later. -// However, that will require enabling it for both runtime and code generation modes. -// -// To support truncate, we need to do 2 passes over the container: -// map -// - first collect all keys (e.g. in k1) -// - for each key in stream, mark k1 that the key should not be removed -// - after updating map, do second pass and call delete for all keys in k1 which are not marked -// struct: -// - for each field, track the *typeInfo s1 -// - iterate through all s1, and for each one not marked, set value to zero -// - this involves checking the possible anonymous fields which are nil ptrs. -// too much work. -// -// ------------------------------------------ -// Error Handling is done within the library using panic. -// -// This way, the code doesn't have to keep checking if an error has happened, -// and we don't have to keep sending the error value along with each call -// or storing it in the En|Decoder and checking it constantly along the way. -// -// The disadvantage is that small functions which use panics cannot be inlined. -// The code accounts for that by only using panics behind an interface; -// since interface calls cannot be inlined, this is irrelevant. -// -// We considered storing the error is En|Decoder. -// - once it has its err field set, it cannot be used again. -// - panicing will be optional, controlled by const flag. -// - code should always check error first and return early. -// We eventually decided against it as it makes the code clumsier to always -// check for these error conditions. - -import ( - "bytes" - "encoding" - "encoding/binary" - "errors" - "fmt" - "math" - "os" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "time" -) - -const ( - scratchByteArrayLen = 32 - // initCollectionCap = 16 // 32 is defensive. 16 is preferred. - - // Support encoding.(Binary|Text)(Unm|M)arshaler. - // This constant flag will enable or disable it. - supportMarshalInterfaces = true - - // for debugging, set this to false, to catch panic traces. - // Note that this will always cause rpc tests to fail, since they need io.EOF sent via panic. - recoverPanicToErr = true - - // arrayCacheLen is the length of the cache used in encoder or decoder for - // allowing zero-alloc initialization. - arrayCacheLen = 8 - - // We tried an optimization, where we detect if a type is one of the known types - // we optimized for (e.g. int, []uint64, etc). - // - // However, we notice some worse performance when using this optimization. - // So we hide it behind a flag, to turn on if needed. - useLookupRecognizedTypes = false - - // using recognized allows us to do d.decode(interface{}) instead of d.decodeValue(reflect.Value) - // when we can infer that the kind of the interface{} is one of the ones hard-coded in the - // type switch for known types or the ones defined by fast-path. - // - // However, it seems we get better performance when we don't recognize, and just let - // reflection handle it. - // - // Reasoning is as below: - // typeswitch is a binary search with a branch to a code-point. - // getdecfn is a binary search with a call to a function pointer. - // - // both are about the same. - // - // so: why prefer typeswitch? - // - // is recognized does the following: - // - lookup rtid - // - check if in sorted list - // - calls decode(type switch) - // - 1 or 2 binary search to a point in code - // - branch there - // - // vs getdecfn - // - lookup rtid - // - check in sorted list for a function pointer - // - calls it to decode using reflection (optimized) - - // always set xDebug = false before releasing software - xDebug = true -) - -var ( - oneByteArr = [1]byte{0} - zeroByteSlice = oneByteArr[:0:0] -) - -var pool pooler - -func init() { - pool.init() -} - -// type findCodecFnMode uint8 - -// const ( -// findCodecFnModeMap findCodecFnMode = iota -// findCodecFnModeBinarySearch -// findCodecFnModeLinearSearch -// ) - -type charEncoding uint8 - -const ( - c_RAW charEncoding = iota - c_UTF8 - c_UTF16LE - c_UTF16BE - c_UTF32LE - c_UTF32BE -) - -// valueType is the stream type -type valueType uint8 - -const ( - valueTypeUnset valueType = iota - valueTypeNil - valueTypeInt - valueTypeUint - valueTypeFloat - valueTypeBool - valueTypeString - valueTypeSymbol - valueTypeBytes - valueTypeMap - valueTypeArray - valueTypeTimestamp - valueTypeExt - - // valueTypeInvalid = 0xff -) - -func (x valueType) String() string { - switch x { - case valueTypeNil: - return "Nil" - case valueTypeInt: - return "Int" - case valueTypeUint: - return "Uint" - case valueTypeFloat: - return "Float" - case valueTypeBool: - return "Bool" - case valueTypeString: - return "String" - case valueTypeSymbol: - return "Symbol" - case valueTypeBytes: - return "Bytes" - case valueTypeMap: - return "Map" - case valueTypeArray: - return "Array" - case valueTypeTimestamp: - return "Timestamp" - case valueTypeExt: - return "Ext" - } - return strconv.FormatInt(int64(x), 10) -} - -type seqType uint8 - -const ( - _ seqType = iota - seqTypeArray - seqTypeSlice - seqTypeChan -) - -// note that containerMapStart and containerArraySend are not sent. -// This is because the ReadXXXStart and EncodeXXXStart already does these. -type containerState uint8 - -const ( - _ containerState = iota - - containerMapStart // slot left open, since Driver method already covers it - containerMapKey - containerMapValue - containerMapEnd - containerArrayStart // slot left open, since Driver methods already cover it - containerArrayElem - containerArrayEnd -) - -// sfiIdx used for tracking where a (field/enc)Name is seen in a []*structFieldInfo -type sfiIdx struct { - name string - index int -} - -// do not recurse if a containing type refers to an embedded type -// which refers back to its containing type (via a pointer). -// The second time this back-reference happens, break out, -// so as not to cause an infinite loop. -const rgetMaxRecursion = 2 - -// Anecdotally, we believe most types have <= 12 fields. -// Java's PMD rules set TooManyFields threshold to 15. -const typeInfoLoadArrayLen = 12 - -type typeInfoLoad struct { - fNames []string - encNames []string - etypes []uintptr - sfis []*structFieldInfo -} - -type typeInfoLoadArray struct { - fNames [typeInfoLoadArrayLen]string - encNames [typeInfoLoadArrayLen]string - etypes [typeInfoLoadArrayLen]uintptr - sfis [typeInfoLoadArrayLen]*structFieldInfo - sfiidx [typeInfoLoadArrayLen]sfiIdx -} - -// type containerStateRecv interface { -// sendContainerState(containerState) -// } - -// mirror json.Marshaler and json.Unmarshaler here, -// so we don't import the encoding/json package -type jsonMarshaler interface { - MarshalJSON() ([]byte, error) -} -type jsonUnmarshaler interface { - UnmarshalJSON([]byte) error -} - -// type byteAccepter func(byte) bool - -var ( - bigen = binary.BigEndian - structInfoFieldName = "_struct" - - mapStrIntfTyp = reflect.TypeOf(map[string]interface{}(nil)) - mapIntfIntfTyp = reflect.TypeOf(map[interface{}]interface{}(nil)) - intfSliceTyp = reflect.TypeOf([]interface{}(nil)) - intfTyp = intfSliceTyp.Elem() - - stringTyp = reflect.TypeOf("") - timeTyp = reflect.TypeOf(time.Time{}) - rawExtTyp = reflect.TypeOf(RawExt{}) - rawTyp = reflect.TypeOf(Raw{}) - uint8SliceTyp = reflect.TypeOf([]uint8(nil)) - - mapBySliceTyp = reflect.TypeOf((*MapBySlice)(nil)).Elem() - - binaryMarshalerTyp = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem() - binaryUnmarshalerTyp = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem() - - textMarshalerTyp = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() - textUnmarshalerTyp = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() - - jsonMarshalerTyp = reflect.TypeOf((*jsonMarshaler)(nil)).Elem() - jsonUnmarshalerTyp = reflect.TypeOf((*jsonUnmarshaler)(nil)).Elem() - - selferTyp = reflect.TypeOf((*Selfer)(nil)).Elem() - - uint8SliceTypId = rt2id(uint8SliceTyp) - rawExtTypId = rt2id(rawExtTyp) - rawTypId = rt2id(rawTyp) - intfTypId = rt2id(intfTyp) - timeTypId = rt2id(timeTyp) - stringTypId = rt2id(stringTyp) - - mapStrIntfTypId = rt2id(mapStrIntfTyp) - mapIntfIntfTypId = rt2id(mapIntfIntfTyp) - intfSliceTypId = rt2id(intfSliceTyp) - // mapBySliceTypId = rt2id(mapBySliceTyp) - - intBitsize uint8 = uint8(reflect.TypeOf(int(0)).Bits()) - uintBitsize uint8 = uint8(reflect.TypeOf(uint(0)).Bits()) - - bsAll0x00 = []byte{0, 0, 0, 0, 0, 0, 0, 0} - bsAll0xff = []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} - - chkOvf checkOverflow - - noFieldNameToStructFieldInfoErr = errors.New("no field name passed to parseStructFieldInfo") -) - -var defTypeInfos = NewTypeInfos([]string{"codec", "json"}) - -var immutableKindsSet = [32]bool{ - // reflect.Invalid: , - reflect.Bool: true, - reflect.Int: true, - reflect.Int8: true, - reflect.Int16: true, - reflect.Int32: true, - reflect.Int64: true, - reflect.Uint: true, - reflect.Uint8: true, - reflect.Uint16: true, - reflect.Uint32: true, - reflect.Uint64: true, - reflect.Uintptr: true, - reflect.Float32: true, - reflect.Float64: true, - reflect.Complex64: true, - reflect.Complex128: true, - // reflect.Array - // reflect.Chan - // reflect.Func: true, - // reflect.Interface - // reflect.Map - // reflect.Ptr - // reflect.Slice - reflect.String: true, - // reflect.Struct - // reflect.UnsafePointer -} - -var recognizedRtids []uintptr -var recognizedRtidPtrs []uintptr -var recognizedRtidOrPtrs []uintptr - -func init() { - if !useLookupRecognizedTypes { - return - } - for _, v := range [...]interface{}{ - float32(0), - float64(0), - uintptr(0), - uint(0), - uint8(0), - uint16(0), - uint32(0), - uint64(0), - uintptr(0), - int(0), - int8(0), - int16(0), - int32(0), - int64(0), - bool(false), - string(""), - Raw{}, - []byte(nil), - } { - rt := reflect.TypeOf(v) - recognizedRtids = append(recognizedRtids, rt2id(rt)) - recognizedRtidPtrs = append(recognizedRtidPtrs, rt2id(reflect.PtrTo(rt))) - } -} - -func containsU(s []uintptr, v uintptr) bool { - // return false // TODO: REMOVE - h, i, j := 0, 0, len(s) - for i < j { - h = i + (j-i)/2 - if s[h] < v { - i = h + 1 - } else { - j = h - } - } - if i < len(s) && s[i] == v { - return true - } - return false -} - -func isRecognizedRtid(rtid uintptr) bool { - return containsU(recognizedRtids, rtid) -} - -func isRecognizedRtidPtr(rtid uintptr) bool { - return containsU(recognizedRtidPtrs, rtid) -} - -func isRecognizedRtidOrPtr(rtid uintptr) bool { - return containsU(recognizedRtidOrPtrs, rtid) -} - -// Selfer defines methods by which a value can encode or decode itself. -// -// Any type which implements Selfer will be able to encode or decode itself. -// Consequently, during (en|de)code, this takes precedence over -// (text|binary)(M|Unm)arshal or extension support. -type Selfer interface { - CodecEncodeSelf(*Encoder) - CodecDecodeSelf(*Decoder) -} - -// MapBySlice represents a slice which should be encoded as a map in the stream. -// The slice contains a sequence of key-value pairs. -// This affords storing a map in a specific sequence in the stream. -// -// The support of MapBySlice affords the following: -// - A slice type which implements MapBySlice will be encoded as a map -// - A slice can be decoded from a map in the stream -type MapBySlice interface { - MapBySlice() -} - -// WARNING: DO NOT USE DIRECTLY. EXPORTED FOR GODOC BENEFIT. WILL BE REMOVED. -// -// BasicHandle encapsulates the common options and extension functions. -type BasicHandle struct { - // TypeInfos is used to get the type info for any type. - // - // If not configured, the default TypeInfos is used, which uses struct tag keys: codec, json - TypeInfos *TypeInfos - - extHandle - EncodeOptions - DecodeOptions - noBuiltInTypeChecker -} - -func (x *BasicHandle) getBasicHandle() *BasicHandle { - return x -} - -func (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { - if x.TypeInfos == nil { - return defTypeInfos.get(rtid, rt) - } - return x.TypeInfos.get(rtid, rt) -} - -// Handle is the interface for a specific encoding format. -// -// Typically, a Handle is pre-configured before first time use, -// and not modified while in use. Such a pre-configured Handle -// is safe for concurrent access. -type Handle interface { - getBasicHandle() *BasicHandle - newEncDriver(w *Encoder) encDriver - newDecDriver(r *Decoder) decDriver - isBinary() bool - hasElemSeparators() bool - IsBuiltinType(rtid uintptr) bool -} - -// Raw represents raw formatted bytes. -// We "blindly" store it during encode and store the raw bytes during decode. -// Note: it is dangerous during encode, so we may gate the behaviour behind an Encode flag which must be explicitly set. -type Raw []byte - -// RawExt represents raw unprocessed extension data. -// Some codecs will decode extension data as a *RawExt if there is no registered extension for the tag. -// -// Only one of Data or Value is nil. If Data is nil, then the content of the RawExt is in the Value. -type RawExt struct { - Tag uint64 - // Data is the []byte which represents the raw ext. If Data is nil, ext is exposed in Value. - // Data is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types - Data []byte - // Value represents the extension, if Data is nil. - // Value is used by codecs (e.g. cbor, json) which use the format to do custom serialization of the types. - Value interface{} -} - -// BytesExt handles custom (de)serialization of types to/from []byte. -// It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types. -type BytesExt interface { - // WriteExt converts a value to a []byte. - // - // Note: v *may* be a pointer to the extension type, if the extension type was a struct or array. - WriteExt(v interface{}) []byte - - // ReadExt updates a value from a []byte. - ReadExt(dst interface{}, src []byte) -} - -// InterfaceExt handles custom (de)serialization of types to/from another interface{} value. -// The Encoder or Decoder will then handle the further (de)serialization of that known type. -// -// It is used by codecs (e.g. cbor, json) which use the format to do custom serialization of the types. -type InterfaceExt interface { - // ConvertExt converts a value into a simpler interface for easy encoding e.g. convert time.Time to int64. - // - // Note: v *may* be a pointer to the extension type, if the extension type was a struct or array. - ConvertExt(v interface{}) interface{} - - // UpdateExt updates a value from a simpler interface for easy decoding e.g. convert int64 to time.Time. - UpdateExt(dst interface{}, src interface{}) -} - -// Ext handles custom (de)serialization of custom types / extensions. -type Ext interface { - BytesExt - InterfaceExt -} - -// addExtWrapper is a wrapper implementation to support former AddExt exported method. -type addExtWrapper struct { - encFn func(reflect.Value) ([]byte, error) - decFn func(reflect.Value, []byte) error -} - -func (x addExtWrapper) WriteExt(v interface{}) []byte { - bs, err := x.encFn(reflect.ValueOf(v)) - if err != nil { - panic(err) - } - return bs -} - -func (x addExtWrapper) ReadExt(v interface{}, bs []byte) { - if err := x.decFn(reflect.ValueOf(v), bs); err != nil { - panic(err) - } -} - -func (x addExtWrapper) ConvertExt(v interface{}) interface{} { - return x.WriteExt(v) -} - -func (x addExtWrapper) UpdateExt(dest interface{}, v interface{}) { - x.ReadExt(dest, v.([]byte)) -} - -type setExtWrapper struct { - b BytesExt - i InterfaceExt -} - -func (x *setExtWrapper) WriteExt(v interface{}) []byte { - if x.b == nil { - panic("BytesExt.WriteExt is not supported") - } - return x.b.WriteExt(v) -} - -func (x *setExtWrapper) ReadExt(v interface{}, bs []byte) { - if x.b == nil { - panic("BytesExt.WriteExt is not supported") - - } - x.b.ReadExt(v, bs) -} - -func (x *setExtWrapper) ConvertExt(v interface{}) interface{} { - if x.i == nil { - panic("InterfaceExt.ConvertExt is not supported") - - } - return x.i.ConvertExt(v) -} - -func (x *setExtWrapper) UpdateExt(dest interface{}, v interface{}) { - if x.i == nil { - panic("InterfaceExxt.UpdateExt is not supported") - - } - x.i.UpdateExt(dest, v) -} - -type binaryEncodingType struct{} - -func (_ binaryEncodingType) isBinary() bool { return true } - -type textEncodingType struct{} - -func (_ textEncodingType) isBinary() bool { return false } - -// noBuiltInTypes is embedded into many types which do not support builtins -// e.g. msgpack, simple, cbor. - -type noBuiltInTypeChecker struct{} - -func (_ noBuiltInTypeChecker) IsBuiltinType(rt uintptr) bool { return false } - -type noBuiltInTypes struct{ noBuiltInTypeChecker } - -func (_ noBuiltInTypes) EncodeBuiltin(rt uintptr, v interface{}) {} -func (_ noBuiltInTypes) DecodeBuiltin(rt uintptr, v interface{}) {} - -// type noStreamingCodec struct{} -// func (_ noStreamingCodec) CheckBreak() bool { return false } -// func (_ noStreamingCodec) hasElemSeparators() bool { return false } - -type noElemSeparators struct{} - -func (_ noElemSeparators) hasElemSeparators() (v bool) { return } - -// bigenHelper. -// Users must already slice the x completely, because we will not reslice. -type bigenHelper struct { - x []byte // must be correctly sliced to appropriate len. slicing is a cost. - w encWriter -} - -func (z bigenHelper) writeUint16(v uint16) { - bigen.PutUint16(z.x, v) - z.w.writeb(z.x) -} - -func (z bigenHelper) writeUint32(v uint32) { - bigen.PutUint32(z.x, v) - z.w.writeb(z.x) -} - -func (z bigenHelper) writeUint64(v uint64) { - bigen.PutUint64(z.x, v) - z.w.writeb(z.x) -} - -type extTypeTagFn struct { - rtid uintptr - rt reflect.Type - tag uint64 - ext Ext -} - -type extHandle []extTypeTagFn - -// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead. -// -// AddExt registes an encode and decode function for a reflect.Type. -// AddExt internally calls SetExt. -// To deregister an Ext, call AddExt with nil encfn and/or nil decfn. -func (o *extHandle) AddExt( - rt reflect.Type, tag byte, - encfn func(reflect.Value) ([]byte, error), decfn func(reflect.Value, []byte) error, -) (err error) { - if encfn == nil || decfn == nil { - return o.SetExt(rt, uint64(tag), nil) - } - return o.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn}) -} - -// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead. -// -// Note that the type must be a named type, and specifically not -// a pointer or Interface. An error is returned if that is not honored. -// -// To Deregister an ext, call SetExt with nil Ext -func (o *extHandle) SetExt(rt reflect.Type, tag uint64, ext Ext) (err error) { - // o is a pointer, because we may need to initialize it - if rt.PkgPath() == "" || rt.Kind() == reflect.Interface { - err = fmt.Errorf("codec.Handle.AddExt: Takes named type, not a pointer or interface: %T", - reflect.Zero(rt).Interface()) - return - } - - rtid := rt2id(rt) - for _, v := range *o { - if v.rtid == rtid { - v.tag, v.ext = tag, ext - return - } - } - - if *o == nil { - *o = make([]extTypeTagFn, 0, 4) - } - *o = append(*o, extTypeTagFn{rtid, rt, tag, ext}) - return -} - -func (o extHandle) getExt(rtid uintptr) *extTypeTagFn { - var v *extTypeTagFn - for i := range o { - v = &o[i] - if v.rtid == rtid { - return v - } - } - return nil -} - -func (o extHandle) getExtForTag(tag uint64) *extTypeTagFn { - var v *extTypeTagFn - for i := range o { - v = &o[i] - if v.tag == tag { - return v - } - } - return nil -} - -const maxLevelsEmbedding = 16 - -type structFieldInfo struct { - encName string // encode name - fieldName string // field name - - is [maxLevelsEmbedding]uint16 // (recursive/embedded) field index in struct - nis uint8 // num levels of embedding. if 1, then it's not embedded. - omitEmpty bool - toArray bool // if field is _struct, is the toArray set? -} - -func (si *structFieldInfo) setToZeroValue(v reflect.Value) { - if v, valid := si.field(v, false); valid { - v.Set(reflect.Zero(v.Type())) - } -} - -// rv returns the field of the struct. -// If anonymous, it returns an Invalid -func (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value, valid bool) { - // replicate FieldByIndex - for i, x := range si.is { - if uint8(i) == si.nis { - break - } - if v, valid = baseStructRv(v, update); !valid { - return - } - v = v.Field(int(x)) - } - - return v, true -} - -func (si *structFieldInfo) fieldval(v reflect.Value, update bool) reflect.Value { - v, _ = si.field(v, update) - return v -} - -func parseStructFieldInfo(fname string, stag string) *structFieldInfo { - // if fname == "" { - // panic(noFieldNameToStructFieldInfoErr) - // } - si := structFieldInfo{ - encName: fname, - } - - if stag != "" { - for i, s := range strings.Split(stag, ",") { - if i == 0 { - if s != "" { - si.encName = s - } - } else { - if s == "omitempty" { - si.omitEmpty = true - } else if s == "toarray" { - si.toArray = true - } - } - } - } - // si.encNameBs = []byte(si.encName) - return &si -} - -type sfiSortedByEncName []*structFieldInfo - -func (p sfiSortedByEncName) Len() int { - return len(p) -} - -func (p sfiSortedByEncName) Less(i, j int) bool { - return p[i].encName < p[j].encName -} - -func (p sfiSortedByEncName) Swap(i, j int) { - p[i], p[j] = p[j], p[i] -} - -const structFieldNodeNumToCache = 4 - -type structFieldNodeCache struct { - rv [structFieldNodeNumToCache]reflect.Value - idx [structFieldNodeNumToCache]uint32 - num uint8 -} - -func (x *structFieldNodeCache) get(key uint32) (fv reflect.Value, valid bool) { - // defer func() { fmt.Printf(">>>> found in cache2? %v\n", valid) }() - for i, k := range &x.idx { - if uint8(i) == x.num { - return // break - } - if key == k { - return x.rv[i], true - } - } - return -} - -func (x *structFieldNodeCache) tryAdd(fv reflect.Value, key uint32) { - if x.num < structFieldNodeNumToCache { - x.rv[x.num] = fv - x.idx[x.num] = key - x.num++ - return - } -} - -type structFieldNode struct { - v reflect.Value - cache2 structFieldNodeCache - cache3 structFieldNodeCache - update bool -} - -func (x *structFieldNode) field(si *structFieldInfo) (fv reflect.Value) { - // return si.fieldval(x.v, x.update) - // Note: we only cache if nis=2 or nis=3 i.e. up to 2 levels of embedding - // This mostly saves us time on the repeated calls to v.Elem, v.Field, etc. - var valid bool - switch si.nis { - case 1: - fv = x.v.Field(int(si.is[0])) - case 2: - if fv, valid = x.cache2.get(uint32(si.is[0])); valid { - fv = fv.Field(int(si.is[1])) - return - } - fv = x.v.Field(int(si.is[0])) - if fv, valid = baseStructRv(fv, x.update); !valid { - return - } - x.cache2.tryAdd(fv, uint32(si.is[0])) - fv = fv.Field(int(si.is[1])) - case 3: - var key uint32 = uint32(si.is[0])<<16 | uint32(si.is[1]) - if fv, valid = x.cache3.get(key); valid { - fv = fv.Field(int(si.is[2])) - return - } - fv = x.v.Field(int(si.is[0])) - if fv, valid = baseStructRv(fv, x.update); !valid { - return - } - fv = fv.Field(int(si.is[1])) - if fv, valid = baseStructRv(fv, x.update); !valid { - return - } - x.cache3.tryAdd(fv, key) - fv = fv.Field(int(si.is[2])) - default: - fv, _ = si.field(x.v, x.update) - } - return -} - -func baseStructRv(v reflect.Value, update bool) (v2 reflect.Value, valid bool) { - for v.Kind() == reflect.Ptr { - if v.IsNil() { - if !update { - return - } - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() - } - return v, true -} - -// typeInfo keeps information about each type referenced in the encode/decode sequence. -// -// During an encode/decode sequence, we work as below: -// - If base is a built in type, en/decode base value -// - If base is registered as an extension, en/decode base value -// - If type is binary(M/Unm)arshaler, call Binary(M/Unm)arshal method -// - If type is text(M/Unm)arshaler, call Text(M/Unm)arshal method -// - Else decode appropriately based on the reflect.Kind -type typeInfo struct { - sfi []*structFieldInfo // sorted. Used when enc/dec struct to map. - sfip []*structFieldInfo // unsorted. Used when enc/dec struct to array. - - rt reflect.Type - rtid uintptr - // rv0 reflect.Value // saved zero value, used if immutableKind - - numMeth uint16 // number of methods - - // baseId gives pointer to the base reflect.Type, after deferencing - // the pointers. E.g. base type of ***time.Time is time.Time. - base reflect.Type - baseId uintptr - baseIndir int8 // number of indirections to get to base - - anyOmitEmpty bool - - mbs bool // base type (T or *T) is a MapBySlice - - bm bool // base type (T or *T) is a binaryMarshaler - bunm bool // base type (T or *T) is a binaryUnmarshaler - bmIndir int8 // number of indirections to get to binaryMarshaler type - bunmIndir int8 // number of indirections to get to binaryUnmarshaler type - - tm bool // base type (T or *T) is a textMarshaler - tunm bool // base type (T or *T) is a textUnmarshaler - tmIndir int8 // number of indirections to get to textMarshaler type - tunmIndir int8 // number of indirections to get to textUnmarshaler type - - jm bool // base type (T or *T) is a jsonMarshaler - junm bool // base type (T or *T) is a jsonUnmarshaler - jmIndir int8 // number of indirections to get to jsonMarshaler type - junmIndir int8 // number of indirections to get to jsonUnmarshaler type - - cs bool // base type (T or *T) is a Selfer - csIndir int8 // number of indirections to get to Selfer type - - toArray bool // whether this (struct) type should be encoded as an array -} - -// define length beyond which we do a binary search instead of a linear search. -// From our testing, linear search seems faster than binary search up to 16-field structs. -// However, we set to 8 similar to what python does for hashtables. -const indexForEncNameBinarySearchThreshold = 8 - -func (ti *typeInfo) indexForEncName(name string) int { - // NOTE: name may be a stringView, so don't pass it to another function. - //tisfi := ti.sfi - sfilen := len(ti.sfi) - if sfilen < indexForEncNameBinarySearchThreshold { - for i, si := range ti.sfi { - if si.encName == name { - return i - } - } - return -1 - } - // binary search. adapted from sort/search.go. - h, i, j := 0, 0, sfilen - for i < j { - h = i + (j-i)/2 - if ti.sfi[h].encName < name { - i = h + 1 - } else { - j = h - } - } - if i < sfilen && ti.sfi[i].encName == name { - return i - } - return -1 -} - -type rtid2ti struct { - rtid uintptr - ti *typeInfo -} - -// TypeInfos caches typeInfo for each type on first inspection. -// -// It is configured with a set of tag keys, which are used to get -// configuration for the type. -type TypeInfos struct { - infos atomicTypeInfoSlice // formerly map[uintptr]*typeInfo, now *[]rtid2ti - mu sync.Mutex - tags []string -} - -// NewTypeInfos creates a TypeInfos given a set of struct tags keys. -// -// This allows users customize the struct tag keys which contain configuration -// of their types. -func NewTypeInfos(tags []string) *TypeInfos { - return &TypeInfos{tags: tags} -} - -func (x *TypeInfos) structTag(t reflect.StructTag) (s string) { - // check for tags: codec, json, in that order. - // this allows seamless support for many configured structs. - for _, x := range x.tags { - s = t.Get(x) - if s != "" { - return s - } - } - return -} - -func (x *TypeInfos) find(sp *[]rtid2ti, rtid uintptr) (idx int, ti *typeInfo) { - // binary search. adapted from sort/search.go. - // if sp == nil { - // return -1, nil - // } - s := *sp - h, i, j := 0, 0, len(s) - for i < j { - h = i + (j-i)/2 - if s[h].rtid < rtid { - i = h + 1 - } else { - j = h - } - } - if i < len(s) && s[i].rtid == rtid { - return i, s[i].ti - } - return i, nil -} - -func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) { - sp := x.infos.load() - var idx int - if sp != nil { - idx, pti = x.find(sp, rtid) - if pti != nil { - return - } - } - - // do not hold lock while computing this. - // it may lead to duplication, but that's ok. - ti := typeInfo{rt: rt, rtid: rtid} - // ti.rv0 = reflect.Zero(rt) - - ti.numMeth = uint16(rt.NumMethod()) - var ok bool - var indir int8 - if ok, indir = implementsIntf(rt, binaryMarshalerTyp); ok { - ti.bm, ti.bmIndir = true, indir - } - if ok, indir = implementsIntf(rt, binaryUnmarshalerTyp); ok { - ti.bunm, ti.bunmIndir = true, indir - } - if ok, indir = implementsIntf(rt, textMarshalerTyp); ok { - ti.tm, ti.tmIndir = true, indir - } - if ok, indir = implementsIntf(rt, textUnmarshalerTyp); ok { - ti.tunm, ti.tunmIndir = true, indir - } - if ok, indir = implementsIntf(rt, jsonMarshalerTyp); ok { - ti.jm, ti.jmIndir = true, indir - } - if ok, indir = implementsIntf(rt, jsonUnmarshalerTyp); ok { - ti.junm, ti.junmIndir = true, indir - } - if ok, indir = implementsIntf(rt, selferTyp); ok { - ti.cs, ti.csIndir = true, indir - } - if ok, _ = implementsIntf(rt, mapBySliceTyp); ok { - ti.mbs = true - } - - pt := rt - var ptIndir int8 - // for ; pt.Kind() == reflect.Ptr; pt, ptIndir = pt.Elem(), ptIndir+1 { } - for pt.Kind() == reflect.Ptr { - pt = pt.Elem() - ptIndir++ - } - if ptIndir == 0 { - ti.base = rt - ti.baseId = rtid - } else { - ti.base = pt - ti.baseId = rt2id(pt) - ti.baseIndir = ptIndir - } - - if rt.Kind() == reflect.Struct { - var omitEmpty bool - if f, ok := rt.FieldByName(structInfoFieldName); ok { - siInfo := parseStructFieldInfo(structInfoFieldName, x.structTag(f.Tag)) - ti.toArray = siInfo.toArray - omitEmpty = siInfo.omitEmpty - } - pp, pi := pool.tiLoad() - pv := pi.(*typeInfoLoadArray) - pv.etypes[0] = ti.baseId - vv := typeInfoLoad{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]} - x.rget(rt, rtid, omitEmpty, nil, &vv) - ti.sfip, ti.sfi, ti.anyOmitEmpty = rgetResolveSFI(vv.sfis, pv.sfiidx[:0]) - pp.Put(pi) - } - // sfi = sfip - - var vs []rtid2ti - x.mu.Lock() - sp = x.infos.load() - if sp == nil { - pti = &ti - vs = []rtid2ti{{rtid, pti}} - x.infos.store(&vs) - } else { - idx, pti = x.find(sp, rtid) - if pti == nil { - s := *sp - pti = &ti - vs = make([]rtid2ti, len(s)+1) - copy(vs, s[:idx]) - vs[idx] = rtid2ti{rtid, pti} - copy(vs[idx+1:], s[idx:]) - x.infos.store(&vs) - } - } - x.mu.Unlock() - return -} - -func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, omitEmpty bool, - indexstack []uint16, pv *typeInfoLoad, -) { - // Read up fields and store how to access the value. - // - // It uses go's rules for message selectors, - // which say that the field with the shallowest depth is selected. - // - // Note: we consciously use slices, not a map, to simulate a set. - // Typically, types have < 16 fields, - // and iteration using equals is faster than maps there - flen := rt.NumField() - if flen > (1< maxLevelsEmbedding-1 { - panic(fmt.Errorf("codec: only supports up to %v depth of embedding - type has %v depth", maxLevelsEmbedding-1, len(indexstack))) - } - si.nis = uint8(len(indexstack)) + 1 - copy(si.is[:], indexstack) - si.is[len(indexstack)] = j - - if omitEmpty { - si.omitEmpty = true - } - pv.sfis = append(pv.sfis, si) - } -} - -// resolves the struct field info got from a call to rget. -// Returns a trimmed, unsorted and sorted []*structFieldInfo. -func rgetResolveSFI(x []*structFieldInfo, pv []sfiIdx) (y, z []*structFieldInfo, anyOmitEmpty bool) { - var n int - for i, v := range x { - xn := v.encName // TODO: fieldName or encName? use encName for now. - var found bool - for j, k := range pv { - if k.name == xn { - // one of them must be reset to nil, and the index updated appropriately to the other one - if v.nis == x[k.index].nis { - } else if v.nis < x[k.index].nis { - pv[j].index = i - if x[k.index] != nil { - x[k.index] = nil - n++ - } - } else { - if x[i] != nil { - x[i] = nil - n++ - } - } - found = true - break - } - } - if !found { - pv = append(pv, sfiIdx{xn, i}) - } - } - - // remove all the nils - y = make([]*structFieldInfo, len(x)-n) - n = 0 - for _, v := range x { - if v == nil { - continue - } - if !anyOmitEmpty && v.omitEmpty { - anyOmitEmpty = true - } - y[n] = v - n++ - } - - z = make([]*structFieldInfo, len(y)) - copy(z, y) - sort.Sort(sfiSortedByEncName(z)) - return -} - -func xprintf(format string, a ...interface{}) { - if xDebug { - fmt.Fprintf(os.Stderr, format, a...) - } -} - -func panicToErr(err *error) { - if recoverPanicToErr { - if x := recover(); x != nil { - // if false && xDebug { - // fmt.Printf("panic'ing with: %v\n", x) - // debug.PrintStack() - // } - panicValToErr(x, err) - } - } -} - -func panicToErrs2(err1, err2 *error) { - if recoverPanicToErr { - if x := recover(); x != nil { - panicValToErr(x, err1) - panicValToErr(x, err2) - } - } -} - -// func doPanic(tag string, format string, params ...interface{}) { -// params2 := make([]interface{}, len(params)+1) -// params2[0] = tag -// copy(params2[1:], params) -// panic(fmt.Errorf("%s: "+format, params2...)) -// } - -func isImmutableKind(k reflect.Kind) (v bool) { - return immutableKindsSet[k] - // return false || - // k == reflect.Int || - // k == reflect.Int8 || - // k == reflect.Int16 || - // k == reflect.Int32 || - // k == reflect.Int64 || - // k == reflect.Uint || - // k == reflect.Uint8 || - // k == reflect.Uint16 || - // k == reflect.Uint32 || - // k == reflect.Uint64 || - // k == reflect.Uintptr || - // k == reflect.Float32 || - // k == reflect.Float64 || - // k == reflect.Bool || - // k == reflect.String -} - -// ---- - -type codecFnInfo struct { - ti *typeInfo - xfFn Ext - xfTag uint64 - seq seqType - addr bool -} - -// codecFn encapsulates the captured variables and the encode function. -// This way, we only do some calculations one times, and pass to the -// code block that should be called (encapsulated in a function) -// instead of executing the checks every time. -type codecFn struct { - i codecFnInfo - fe func(*Encoder, *codecFnInfo, reflect.Value) - fd func(*Decoder, *codecFnInfo, reflect.Value) -} - -type codecRtidFn struct { - rtid uintptr - fn codecFn -} - -type codecFner struct { - hh Handle - h *BasicHandle - cs [arrayCacheLen]*[arrayCacheLen]codecRtidFn - s []*[arrayCacheLen]codecRtidFn - sn uint32 - be bool - js bool - cf [arrayCacheLen]codecRtidFn -} - -func (c *codecFner) reset(hh Handle) { - c.hh = hh - c.h = hh.getBasicHandle() - _, c.js = hh.(*JsonHandle) - c.be = hh.isBinary() -} - -func (c *codecFner) get(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *codecFn) { - rtid := rt2id(rt) - var j uint32 - var sn uint32 = c.sn - if sn == 0 { - c.s = c.cs[:1] - c.s[0] = &c.cf - c.cf[0].rtid = rtid - fn = &(c.cf[0].fn) - c.sn = 1 - } else { - LOOP1: - for _, x := range c.s { - for i := range x { - if j == sn { - break LOOP1 - } - if x[i].rtid == rtid { - fn = &(x[i].fn) - return - } - j++ - } - } - sx, sy := sn/arrayCacheLen, sn%arrayCacheLen - if sy == 0 { - c.s = append(c.s, &[arrayCacheLen]codecRtidFn{}) - } - c.s[sx][sy].rtid = rtid - fn = &(c.s[sx][sy].fn) - c.sn++ - } - - ti := c.h.getTypeInfo(rtid, rt) - fi := &(fn.i) - fi.ti = ti - - if checkCodecSelfer && ti.cs { - fn.fe = (*Encoder).selferMarshal - fn.fd = (*Decoder).selferUnmarshal - } else if rtid == rawTypId { - fn.fe = (*Encoder).raw - fn.fd = (*Decoder).raw - } else if rtid == rawExtTypId { - fn.fe = (*Encoder).rawExt - fn.fd = (*Decoder).rawExt - fn.i.addr = true - } else if c.hh.IsBuiltinType(rtid) { - fn.fe = (*Encoder).builtin - fn.fd = (*Decoder).builtin - fn.i.addr = true - } else if xfFn := c.h.getExt(rtid); xfFn != nil { - fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext - fn.fe = (*Encoder).ext - fn.fd = (*Decoder).ext - fn.i.addr = true - } else if supportMarshalInterfaces && c.be && ti.bm { - fn.fe = (*Encoder).binaryMarshal - fn.fd = (*Decoder).binaryUnmarshal - } else if supportMarshalInterfaces && !c.be && c.js && ti.jm { - //If JSON, we should check JSONMarshal before textMarshal - fn.fe = (*Encoder).jsonMarshal - fn.fd = (*Decoder).jsonUnmarshal - } else if supportMarshalInterfaces && !c.be && ti.tm { - fn.fe = (*Encoder).textMarshal - fn.fd = (*Decoder).textUnmarshal - } else { - rk := rt.Kind() - if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { - if rt.PkgPath() == "" { // un-named slice or map - if idx := fastpathAV.index(rtid); idx != -1 { - fn.fe = fastpathAV[idx].encfn - fn.fd = fastpathAV[idx].decfn - fn.i.addr = true - } - } else { - // use mapping for underlying type if there - var rtu reflect.Type - if rk == reflect.Map { - rtu = reflect.MapOf(rt.Key(), rt.Elem()) - } else { - rtu = reflect.SliceOf(rt.Elem()) - } - rtuid := rt2id(rtu) - if idx := fastpathAV.index(rtuid); idx != -1 { - xfnf := fastpathAV[idx].encfn - xrt := fastpathAV[idx].rt - fn.fe = func(e *Encoder, xf *codecFnInfo, xrv reflect.Value) { - xfnf(e, xf, xrv.Convert(xrt)) - } - fn.i.addr = true - xfnf2 := fastpathAV[idx].decfn - fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) { - xfnf2(d, xf, xrv.Convert(reflect.PtrTo(xrt))) - } - } - } - } - if fn.fe == nil && fn.fd == nil { - switch rk { - case reflect.Bool: - fn.fe = (*Encoder).kBool - fn.fd = (*Decoder).kBool - case reflect.String: - fn.fe = (*Encoder).kString - fn.fd = (*Decoder).kString - case reflect.Int: - fn.fd = (*Decoder).kInt - fn.fe = (*Encoder).kInt - case reflect.Int8: - fn.fe = (*Encoder).kInt - fn.fd = (*Decoder).kInt8 - case reflect.Int16: - fn.fe = (*Encoder).kInt - fn.fd = (*Decoder).kInt16 - case reflect.Int32: - fn.fe = (*Encoder).kInt - fn.fd = (*Decoder).kInt32 - case reflect.Int64: - fn.fe = (*Encoder).kInt - fn.fd = (*Decoder).kInt64 - case reflect.Uint: - fn.fd = (*Decoder).kUint - fn.fe = (*Encoder).kUint - case reflect.Uint8: - fn.fe = (*Encoder).kUint - fn.fd = (*Decoder).kUint8 - case reflect.Uint16: - fn.fe = (*Encoder).kUint - fn.fd = (*Decoder).kUint16 - case reflect.Uint32: - fn.fe = (*Encoder).kUint - fn.fd = (*Decoder).kUint32 - case reflect.Uint64: - fn.fe = (*Encoder).kUint - fn.fd = (*Decoder).kUint64 - // case reflect.Ptr: - // fn.fd = (*Decoder).kPtr - case reflect.Uintptr: - fn.fe = (*Encoder).kUint - fn.fd = (*Decoder).kUintptr - case reflect.Float32: - fn.fe = (*Encoder).kFloat32 - fn.fd = (*Decoder).kFloat32 - case reflect.Float64: - fn.fe = (*Encoder).kFloat64 - fn.fd = (*Decoder).kFloat64 - case reflect.Invalid: - fn.fe = (*Encoder).kInvalid - case reflect.Chan: - fi.seq = seqTypeChan - fn.fe = (*Encoder).kSlice - fn.fd = (*Decoder).kSlice - case reflect.Slice: - fi.seq = seqTypeSlice - fn.fe = (*Encoder).kSlice - fn.fd = (*Decoder).kSlice - case reflect.Array: - fi.seq = seqTypeArray - fn.fe = (*Encoder).kSlice - fi.addr = false - rt2 := reflect.SliceOf(rt.Elem()) - fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) { - // println(">>>>>> decoding an array ... ") - d.cf.get(rt2, true, false).fd(d, xf, xrv.Slice(0, xrv.Len())) - // println(">>>>>> decoding an array ... DONE") - } - // fn.fd = (*Decoder).kArray - case reflect.Struct: - if ti.anyOmitEmpty { - fn.fe = (*Encoder).kStruct - } else { - fn.fe = (*Encoder).kStructNoOmitempty - } - fn.fd = (*Decoder).kStruct - // reflect.Ptr and reflect.Interface are handled already by preEncodeValue - // case reflect.Ptr: - // fn.fe = (*Encoder).kPtr - // case reflect.Interface: - // fn.fe = (*Encoder).kInterface - case reflect.Map: - fn.fe = (*Encoder).kMap - fn.fd = (*Decoder).kMap - case reflect.Interface: - // encode: reflect.Interface are handled already by preEncodeValue - fn.fd = (*Decoder).kInterface - default: - fn.fe = (*Encoder).kErr - fn.fd = (*Decoder).kErr - } - } - } - - return -} - -// ---- - -// these functions must be inlinable, and not call anybody -type checkOverflow struct{} - -func (_ checkOverflow) Float32(f float64) (overflow bool) { - if f < 0 { - f = -f - } - return math.MaxFloat32 < f && f <= math.MaxFloat64 -} - -func (_ checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) { - if bitsize == 0 || bitsize >= 64 || v == 0 { - return - } - if trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc { - overflow = true - } - return -} - -func (_ checkOverflow) Int(v int64, bitsize uint8) (overflow bool) { - if bitsize == 0 || bitsize >= 64 || v == 0 { - return - } - if trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc { - overflow = true - } - return -} - -func (_ checkOverflow) SignedInt(v uint64) (i int64, overflow bool) { - //e.g. -127 to 128 for int8 - pos := (v >> 63) == 0 - ui2 := v & 0x7fffffffffffffff - if pos { - if ui2 > math.MaxInt64 { - overflow = true - return - } - } else { - if ui2 > math.MaxInt64-1 { - overflow = true - return - } - } - i = int64(v) - return -} - -// ------------------ SORT ----------------- - -func isNaN(f float64) bool { return f != f } - -// ----------------------- - -type intSlice []int64 -type uintSlice []uint64 -type uintptrSlice []uintptr -type floatSlice []float64 -type boolSlice []bool -type stringSlice []string -type bytesSlice [][]byte - -func (p intSlice) Len() int { return len(p) } -func (p intSlice) Less(i, j int) bool { return p[i] < p[j] } -func (p intSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p uintSlice) Len() int { return len(p) } -func (p uintSlice) Less(i, j int) bool { return p[i] < p[j] } -func (p uintSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p uintptrSlice) Len() int { return len(p) } -func (p uintptrSlice) Less(i, j int) bool { return p[i] < p[j] } -func (p uintptrSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p floatSlice) Len() int { return len(p) } -func (p floatSlice) Less(i, j int) bool { - return p[i] < p[j] || isNaN(p[i]) && !isNaN(p[j]) -} -func (p floatSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p stringSlice) Len() int { return len(p) } -func (p stringSlice) Less(i, j int) bool { return p[i] < p[j] } -func (p stringSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p bytesSlice) Len() int { return len(p) } -func (p bytesSlice) Less(i, j int) bool { return bytes.Compare(p[i], p[j]) == -1 } -func (p bytesSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p boolSlice) Len() int { return len(p) } -func (p boolSlice) Less(i, j int) bool { return !p[i] && p[j] } -func (p boolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// --------------------- - -type intRv struct { - v int64 - r reflect.Value -} -type intRvSlice []intRv -type uintRv struct { - v uint64 - r reflect.Value -} -type uintRvSlice []uintRv -type floatRv struct { - v float64 - r reflect.Value -} -type floatRvSlice []floatRv -type boolRv struct { - v bool - r reflect.Value -} -type boolRvSlice []boolRv -type stringRv struct { - v string - r reflect.Value -} -type stringRvSlice []stringRv -type bytesRv struct { - v []byte - r reflect.Value -} -type bytesRvSlice []bytesRv - -func (p intRvSlice) Len() int { return len(p) } -func (p intRvSlice) Less(i, j int) bool { return p[i].v < p[j].v } -func (p intRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p uintRvSlice) Len() int { return len(p) } -func (p uintRvSlice) Less(i, j int) bool { return p[i].v < p[j].v } -func (p uintRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p floatRvSlice) Len() int { return len(p) } -func (p floatRvSlice) Less(i, j int) bool { - return p[i].v < p[j].v || isNaN(p[i].v) && !isNaN(p[j].v) -} -func (p floatRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p stringRvSlice) Len() int { return len(p) } -func (p stringRvSlice) Less(i, j int) bool { return p[i].v < p[j].v } -func (p stringRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p bytesRvSlice) Len() int { return len(p) } -func (p bytesRvSlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 } -func (p bytesRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p boolRvSlice) Len() int { return len(p) } -func (p boolRvSlice) Less(i, j int) bool { return !p[i].v && p[j].v } -func (p boolRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// ----------------- - -type bytesI struct { - v []byte - i interface{} -} - -type bytesISlice []bytesI - -func (p bytesISlice) Len() int { return len(p) } -func (p bytesISlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 } -func (p bytesISlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// ----------------- - -type set []uintptr - -func (s *set) add(v uintptr) (exists bool) { - // e.ci is always nil, or len >= 1 - x := *s - if x == nil { - x = make([]uintptr, 1, 8) - x[0] = v - *s = x - return - } - // typically, length will be 1. make this perform. - if len(x) == 1 { - if j := x[0]; j == 0 { - x[0] = v - } else if j == v { - exists = true - } else { - x = append(x, v) - *s = x - } - return - } - // check if it exists - for _, j := range x { - if j == v { - exists = true - return - } - } - // try to replace a "deleted" slot - for i, j := range x { - if j == 0 { - x[i] = v - return - } - } - // if unable to replace deleted slot, just append it. - x = append(x, v) - *s = x - return -} - -func (s *set) remove(v uintptr) (exists bool) { - x := *s - if len(x) == 0 { - return - } - if len(x) == 1 { - if x[0] == v { - x[0] = 0 - } - return - } - for i, j := range x { - if j == v { - exists = true - x[i] = 0 // set it to 0, as way to delete it. - // copy(x[i:], x[i+1:]) - // x = x[:len(x)-1] - return - } - } - return -} - -// ------ - -// bitset types are better than [256]bool, because they permit the whole -// bitset array being on a single cache line and use less memory. - -// given x > 0 and n > 0 and x is exactly 2^n, then pos/x === pos>>n AND pos%x === pos&(x-1). -// consequently, pos/32 === pos>>5, pos/16 === pos>>4, pos/8 === pos>>3, pos%8 == pos&7 - -type bitset256 [32]byte - -func (x *bitset256) set(pos byte) { - x[pos>>3] |= (1 << (pos & 7)) -} -func (x *bitset256) unset(pos byte) { - x[pos>>3] &^= (1 << (pos & 7)) -} -func (x *bitset256) isset(pos byte) bool { - return x[pos>>3]&(1<<(pos&7)) != 0 -} - -type bitset128 [16]byte - -func (x *bitset128) set(pos byte) { - x[pos>>3] |= (1 << (pos & 7)) -} -func (x *bitset128) unset(pos byte) { - x[pos>>3] &^= (1 << (pos & 7)) -} -func (x *bitset128) isset(pos byte) bool { - return x[pos>>3]&(1<<(pos&7)) != 0 -} - -// ------------ - -type pooler struct { - // for stringRV - strRv8, strRv16, strRv32, strRv64, strRv128 sync.Pool - // for the decNaked - dn sync.Pool - tiload sync.Pool -} - -func (p *pooler) init() { - p.strRv8.New = func() interface{} { return new([8]stringRv) } - p.strRv16.New = func() interface{} { return new([16]stringRv) } - p.strRv32.New = func() interface{} { return new([32]stringRv) } - p.strRv64.New = func() interface{} { return new([64]stringRv) } - p.strRv128.New = func() interface{} { return new([128]stringRv) } - p.dn.New = func() interface{} { x := new(decNaked); x.init(); return x } - p.tiload.New = func() interface{} { return new(typeInfoLoadArray) } -} - -func (p *pooler) stringRv8() (sp *sync.Pool, v interface{}) { - return &p.strRv8, p.strRv8.Get() -} -func (p *pooler) stringRv16() (sp *sync.Pool, v interface{}) { - return &p.strRv16, p.strRv16.Get() -} -func (p *pooler) stringRv32() (sp *sync.Pool, v interface{}) { - return &p.strRv32, p.strRv32.Get() -} -func (p *pooler) stringRv64() (sp *sync.Pool, v interface{}) { - return &p.strRv64, p.strRv64.Get() -} -func (p *pooler) stringRv128() (sp *sync.Pool, v interface{}) { - return &p.strRv128, p.strRv128.Get() -} -func (p *pooler) decNaked() (sp *sync.Pool, v interface{}) { - return &p.dn, p.dn.Get() -} -func (p *pooler) tiLoad() (sp *sync.Pool, v interface{}) { - return &p.tiload, p.tiload.Get() -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_internal.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_internal.go deleted file mode 100644 index eb18e2cc..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_internal.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -// All non-std package dependencies live in this file, -// so porting to different environment is easy (just update functions). - -import ( - "errors" - "fmt" - "math" - "reflect" -) - -func panicValToErr(panicVal interface{}, err *error) { - if panicVal == nil { - return - } - // case nil - switch xerr := panicVal.(type) { - case error: - *err = xerr - case string: - *err = errors.New(xerr) - default: - *err = fmt.Errorf("%v", panicVal) - } - return -} - -func hIsEmptyValue(v reflect.Value, deref, checkStruct bool) bool { - switch v.Kind() { - case reflect.Invalid: - return true - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - if deref { - if v.IsNil() { - return true - } - return hIsEmptyValue(v.Elem(), deref, checkStruct) - } else { - return v.IsNil() - } - case reflect.Struct: - if !checkStruct { - return false - } - // return true if all fields are empty. else return false. - // we cannot use equality check, because some fields may be maps/slices/etc - // and consequently the structs are not comparable. - // return v.Interface() == reflect.Zero(v.Type()).Interface() - for i, n := 0, v.NumField(); i < n; i++ { - if !hIsEmptyValue(v.Field(i), deref, checkStruct) { - return false - } - } - return true - } - return false -} - -func isEmptyValue(v reflect.Value, deref, checkStruct bool) bool { - return hIsEmptyValue(v, deref, checkStruct) -} - -func pruneSignExt(v []byte, pos bool) (n int) { - if len(v) < 2 { - } else if pos && v[0] == 0 { - for ; v[n] == 0 && n+1 < len(v) && (v[n+1]&(1<<7) == 0); n++ { - } - } else if !pos && v[0] == 0xff { - for ; v[n] == 0xff && n+1 < len(v) && (v[n+1]&(1<<7) != 0); n++ { - } - } - return -} - -func implementsIntf(typ, iTyp reflect.Type) (success bool, indir int8) { - if typ == nil { - return - } - rt := typ - // The type might be a pointer and we need to keep - // dereferencing to the base type until we find an implementation. - for { - if rt.Implements(iTyp) { - return true, indir - } - if p := rt; p.Kind() == reflect.Ptr { - indir++ - if indir >= math.MaxInt8 { // insane number of indirections - return false, 0 - } - rt = p.Elem() - continue - } - break - } - // No luck yet, but if this is a base type (non-pointer), the pointer might satisfy. - if typ.Kind() != reflect.Ptr { - // Not a pointer, but does the pointer work? - if reflect.PtrTo(typ).Implements(iTyp) { - return true, -1 - } - } - return false, 0 -} - -// validate that this function is correct ... -// culled from OGRE (Object-Oriented Graphics Rendering Engine) -// function: halfToFloatI (http://stderr.org/doc/ogre-doc/api/OgreBitwise_8h-source.html) -func halfFloatToFloatBits(yy uint16) (d uint32) { - y := uint32(yy) - s := (y >> 15) & 0x01 - e := (y >> 10) & 0x1f - m := y & 0x03ff - - if e == 0 { - if m == 0 { // plu or minus 0 - return s << 31 - } else { // Denormalized number -- renormalize it - for (m & 0x00000400) == 0 { - m <<= 1 - e -= 1 - } - e += 1 - const zz uint32 = 0x0400 - m &= ^zz - } - } else if e == 31 { - if m == 0 { // Inf - return (s << 31) | 0x7f800000 - } else { // NaN - return (s << 31) | 0x7f800000 | (m << 13) - } - } - e = e + (127 - 15) - m = m << 13 - return (s << 31) | (e << 23) | m -} - -// GrowCap will return a new capacity for a slice, given the following: -// - oldCap: current capacity -// - unit: in-memory size of an element -// - num: number of elements to add -func growCap(oldCap, unit, num int) (newCap int) { - // appendslice logic (if cap < 1024, *2, else *1.25): - // leads to many copy calls, especially when copying bytes. - // bytes.Buffer model (2*cap + n): much better for bytes. - // smarter way is to take the byte-size of the appended element(type) into account - - // maintain 3 thresholds: - // t1: if cap <= t1, newcap = 2x - // t2: if cap <= t2, newcap = 1.75x - // t3: if cap <= t3, newcap = 1.5x - // else newcap = 1.25x - // - // t1, t2, t3 >= 1024 always. - // i.e. if unit size >= 16, then always do 2x or 1.25x (ie t1, t2, t3 are all same) - // - // With this, appending for bytes increase by: - // 100% up to 4K - // 75% up to 8K - // 50% up to 16K - // 25% beyond that - - // unit can be 0 e.g. for struct{}{}; handle that appropriately - var t1, t2, t3 int // thresholds - if unit <= 1 { - t1, t2, t3 = 4*1024, 8*1024, 16*1024 - } else if unit < 16 { - t3 = 16 / unit * 1024 - t1 = t3 * 1 / 4 - t2 = t3 * 2 / 4 - } else { - t1, t2, t3 = 1024, 1024, 1024 - } - - var x int // temporary variable - - // x is multiplier here: one of 5, 6, 7 or 8; incr of 25%, 50%, 75% or 100% respectively - if oldCap <= t1 { // [0,t1] - x = 8 - } else if oldCap > t3 { // (t3,infinity] - x = 5 - } else if oldCap <= t2 { // (t1,t2] - x = 7 - } else { // (t2,t3] - x = 6 - } - newCap = x * oldCap / 4 - - if num > 0 { - newCap += num - } - - // ensure newCap is a multiple of 64 (if it is > 64) or 16. - if newCap > 64 { - if x = newCap % 64; x != 0 { - x = newCap / 64 - newCap = 64 * (x + 1) - } - } else { - if x = newCap % 16; x != 0 { - x = newCap / 16 - newCap = 16 * (x + 1) - } - } - return -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go deleted file mode 100644 index 9d9d048e..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go +++ /dev/null @@ -1,156 +0,0 @@ -// +build !go1.7 safe appengine - -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "reflect" - "sync/atomic" -) - -// stringView returns a view of the []byte as a string. -// In unsafe mode, it doesn't incur allocation and copying caused by conversion. -// In regular safe mode, it is an allocation and copy. -// -// Usage: Always maintain a reference to v while result of this call is in use, -// and call keepAlive4BytesView(v) at point where done with view. -func stringView(v []byte) string { - return string(v) -} - -// bytesView returns a view of the string as a []byte. -// In unsafe mode, it doesn't incur allocation and copying caused by conversion. -// In regular safe mode, it is an allocation and copy. -// -// Usage: Always maintain a reference to v while result of this call is in use, -// and call keepAlive4BytesView(v) at point where done with view. -func bytesView(v string) []byte { - return []byte(v) -} - -func definitelyNil(v interface{}) bool { - return false - // rv := reflect.ValueOf(v) - // switch rv.Kind() { - // case reflect.Invalid: - // return true - // case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Slice, reflect.Map, reflect.Func: - // return rv.IsNil() - // default: - // return false - // } -} - -// // keepAlive4BytesView maintains a reference to the input parameter for bytesView. -// // -// // Usage: call this at point where done with the bytes view. -// func keepAlive4BytesView(v string) {} - -// // keepAlive4BytesView maintains a reference to the input parameter for stringView. -// // -// // Usage: call this at point where done with the string view. -// func keepAlive4StringView(v []byte) {} - -func rv2i(rv reflect.Value) interface{} { - return rv.Interface() -} - -func rt2id(rt reflect.Type) uintptr { - return reflect.ValueOf(rt).Pointer() -} - -func rv2rtid(rv reflect.Value) uintptr { - return reflect.ValueOf(rv.Type()).Pointer() -} - -// -------------------------- -// type ptrToRvMap struct{} - -// func (_ *ptrToRvMap) init() {} -// func (_ *ptrToRvMap) get(i interface{}) reflect.Value { -// return reflect.ValueOf(i).Elem() -// } - -// -------------------------- -type atomicTypeInfoSlice struct { - v atomic.Value -} - -func (x *atomicTypeInfoSlice) load() *[]rtid2ti { - i := x.v.Load() - if i == nil { - return nil - } - return i.(*[]rtid2ti) -} - -func (x *atomicTypeInfoSlice) store(p *[]rtid2ti) { - x.v.Store(p) -} - -// -------------------------- -func (d *Decoder) raw(f *codecFnInfo, rv reflect.Value) { - rv.SetBytes(d.rawBytes()) -} - -func (d *Decoder) kString(f *codecFnInfo, rv reflect.Value) { - rv.SetString(d.d.DecodeString()) -} - -func (d *Decoder) kBool(f *codecFnInfo, rv reflect.Value) { - rv.SetBool(d.d.DecodeBool()) -} - -func (d *Decoder) kFloat32(f *codecFnInfo, rv reflect.Value) { - rv.SetFloat(d.d.DecodeFloat(true)) -} - -func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) { - rv.SetFloat(d.d.DecodeFloat(false)) -} - -func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) { - rv.SetInt(d.d.DecodeInt(intBitsize)) -} - -func (d *Decoder) kInt8(f *codecFnInfo, rv reflect.Value) { - rv.SetInt(d.d.DecodeInt(8)) -} - -func (d *Decoder) kInt16(f *codecFnInfo, rv reflect.Value) { - rv.SetInt(d.d.DecodeInt(16)) -} - -func (d *Decoder) kInt32(f *codecFnInfo, rv reflect.Value) { - rv.SetInt(d.d.DecodeInt(32)) -} - -func (d *Decoder) kInt64(f *codecFnInfo, rv reflect.Value) { - rv.SetInt(d.d.DecodeInt(64)) -} - -func (d *Decoder) kUint(f *codecFnInfo, rv reflect.Value) { - rv.SetUint(d.d.DecodeUint(uintBitsize)) -} - -func (d *Decoder) kUintptr(f *codecFnInfo, rv reflect.Value) { - rv.SetUint(d.d.DecodeUint(uintBitsize)) -} - -func (d *Decoder) kUint8(f *codecFnInfo, rv reflect.Value) { - rv.SetUint(d.d.DecodeUint(8)) -} - -func (d *Decoder) kUint16(f *codecFnInfo, rv reflect.Value) { - rv.SetUint(d.d.DecodeUint(16)) -} - -func (d *Decoder) kUint32(f *codecFnInfo, rv reflect.Value) { - rv.SetUint(d.d.DecodeUint(32)) -} - -func (d *Decoder) kUint64(f *codecFnInfo, rv reflect.Value) { - rv.SetUint(d.d.DecodeUint(64)) -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_unsafe.go deleted file mode 100644 index c7c01b81..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/helper_unsafe.go +++ /dev/null @@ -1,418 +0,0 @@ -// +build !safe -// +build !appengine -// +build go1.7 - -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "reflect" - "sync/atomic" - "unsafe" -) - -// This file has unsafe variants of some helper methods. -// NOTE: See helper_not_unsafe.go for the usage information. - -// var zeroRTv [4]uintptr - -const unsafeFlagIndir = 1 << 7 // keep in sync with GO_ROOT/src/reflect/value.go - -type unsafeString struct { - Data uintptr - Len int -} - -type unsafeSlice struct { - Data uintptr - Len int - Cap int -} - -type unsafeIntf struct { - typ unsafe.Pointer - word unsafe.Pointer -} - -type unsafeReflectValue struct { - typ unsafe.Pointer - ptr unsafe.Pointer - flag uintptr -} - -func stringView(v []byte) string { - if len(v) == 0 { - return "" - } - - bx := (*unsafeSlice)(unsafe.Pointer(&v)) - sx := unsafeString{bx.Data, bx.Len} - return *(*string)(unsafe.Pointer(&sx)) -} - -func bytesView(v string) []byte { - if len(v) == 0 { - return zeroByteSlice - } - - sx := (*unsafeString)(unsafe.Pointer(&v)) - bx := unsafeSlice{sx.Data, sx.Len, sx.Len} - return *(*[]byte)(unsafe.Pointer(&bx)) -} - -func definitelyNil(v interface{}) bool { - return (*unsafeIntf)(unsafe.Pointer(&v)).word == nil -} - -// func keepAlive4BytesView(v string) { -// runtime.KeepAlive(v) -// } - -// func keepAlive4StringView(v []byte) { -// runtime.KeepAlive(v) -// } - -// TODO: consider a more generally-known optimization for reflect.Value ==> Interface -// -// Currently, we use this fragile method that taps into implememtation details from -// the source go stdlib reflect/value.go, -// and trims the implementation. -func rv2i(rv reflect.Value) interface{} { - if false { - return rv.Interface() - } - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - // references that are single-words (map, ptr) may be double-referenced as flagIndir - kk := urv.flag & (1<<5 - 1) - if (kk == uintptr(reflect.Map) || kk == uintptr(reflect.Ptr)) && urv.flag&unsafeFlagIndir != 0 { - return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) - } - return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) -} - -func rt2id(rt reflect.Type) uintptr { - return uintptr(((*unsafeIntf)(unsafe.Pointer(&rt))).word) -} - -func rv2rtid(rv reflect.Value) uintptr { - return uintptr((*unsafeReflectValue)(unsafe.Pointer(&rv)).typ) -} - -// func rv0t(rt reflect.Type) reflect.Value { -// ut := (*unsafeIntf)(unsafe.Pointer(&rt)) -// // we need to determine whether ifaceIndir, and then whether to just pass 0 as the ptr -// uv := unsafeReflectValue{ut.word, &zeroRTv, flag(rt.Kind())} -// return *(*reflect.Value)(unsafe.Pointer(&uv}) -// } - -// -------------------------- -type atomicTypeInfoSlice struct { - v unsafe.Pointer -} - -func (x *atomicTypeInfoSlice) load() *[]rtid2ti { - return (*[]rtid2ti)(atomic.LoadPointer(&x.v)) -} - -func (x *atomicTypeInfoSlice) store(p *[]rtid2ti) { - atomic.StorePointer(&x.v, unsafe.Pointer(p)) -} - -// -------------------------- -func (d *Decoder) raw(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - // if urv.flag&unsafeFlagIndir != 0 { - // urv.ptr = *(*unsafe.Pointer)(urv.ptr) - // } - *(*[]byte)(urv.ptr) = d.rawBytes() -} - -func (d *Decoder) kString(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*string)(urv.ptr) = d.d.DecodeString() -} - -func (d *Decoder) kBool(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*bool)(urv.ptr) = d.d.DecodeBool() -} - -func (d *Decoder) kFloat32(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*float32)(urv.ptr) = float32(d.d.DecodeFloat(true)) -} - -func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*float64)(urv.ptr) = d.d.DecodeFloat(false) -} - -func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*int)(urv.ptr) = int(d.d.DecodeInt(intBitsize)) -} - -func (d *Decoder) kInt8(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*int8)(urv.ptr) = int8(d.d.DecodeInt(8)) -} - -func (d *Decoder) kInt16(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*int16)(urv.ptr) = int16(d.d.DecodeInt(16)) -} - -func (d *Decoder) kInt32(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*int32)(urv.ptr) = int32(d.d.DecodeInt(32)) -} - -func (d *Decoder) kInt64(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*int64)(urv.ptr) = d.d.DecodeInt(64) -} - -func (d *Decoder) kUint(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*uint)(urv.ptr) = uint(d.d.DecodeUint(uintBitsize)) -} - -func (d *Decoder) kUintptr(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*uintptr)(urv.ptr) = uintptr(d.d.DecodeUint(uintBitsize)) -} - -func (d *Decoder) kUint8(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*uint8)(urv.ptr) = uint8(d.d.DecodeUint(8)) -} - -func (d *Decoder) kUint16(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*uint16)(urv.ptr) = uint16(d.d.DecodeUint(16)) -} - -func (d *Decoder) kUint32(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*uint32)(urv.ptr) = uint32(d.d.DecodeUint(32)) -} - -func (d *Decoder) kUint64(f *codecFnInfo, rv reflect.Value) { - urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - *(*uint64)(urv.ptr) = d.d.DecodeUint(64) -} - -// ------------ - -// func rt2id(rt reflect.Type) uintptr { -// return uintptr(((*unsafeIntf)(unsafe.Pointer(&rt))).word) -// // var i interface{} = rt -// // // ui := (*unsafeIntf)(unsafe.Pointer(&i)) -// // return ((*unsafeIntf)(unsafe.Pointer(&i))).word -// } - -// func rv2i(rv reflect.Value) interface{} { -// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) -// // non-reference type: already indir -// // reference type: depend on flagIndir property ('cos maybe was double-referenced) -// // const (unsafeRvFlagKindMask = 1<<5 - 1 , unsafeRvFlagIndir = 1 << 7 ) -// // rvk := reflect.Kind(urv.flag & (1<<5 - 1)) -// // if (rvk == reflect.Chan || -// // rvk == reflect.Func || -// // rvk == reflect.Interface || -// // rvk == reflect.Map || -// // rvk == reflect.Ptr || -// // rvk == reflect.UnsafePointer) && urv.flag&(1<<8) != 0 { -// // fmt.Printf(">>>>> ---- double indirect reference: %v, %v\n", rvk, rv.Type()) -// // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) -// // } -// if urv.flag&(1<<5-1) == uintptr(reflect.Map) && urv.flag&(1<<7) != 0 { -// // fmt.Printf(">>>>> ---- double indirect reference: %v, %v\n", rvk, rv.Type()) -// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) -// } -// // fmt.Printf(">>>>> ++++ direct reference: %v, %v\n", rvk, rv.Type()) -// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) -// } - -// const ( -// unsafeRvFlagKindMask = 1<<5 - 1 -// unsafeRvKindDirectIface = 1 << 5 -// unsafeRvFlagIndir = 1 << 7 -// unsafeRvFlagAddr = 1 << 8 -// unsafeRvFlagMethod = 1 << 9 - -// _USE_RV_INTERFACE bool = false -// _UNSAFE_RV_DEBUG = true -// ) - -// type unsafeRtype struct { -// _ [2]uintptr -// _ uint32 -// _ uint8 -// _ uint8 -// _ uint8 -// kind uint8 -// _ [2]uintptr -// _ int32 -// } - -// func _rv2i(rv reflect.Value) interface{} { -// // Note: From use, -// // - it's never an interface -// // - the only calls here are for ifaceIndir types. -// // (though that conditional is wrong) -// // To know for sure, we need the value of t.kind (which is not exposed). -// // -// // Need to validate the path: type is indirect ==> only value is indirect ==> default (value is direct) -// // - Type indirect, Value indirect: ==> numbers, boolean, slice, struct, array, string -// // - Type Direct, Value indirect: ==> map??? -// // - Type Direct, Value direct: ==> pointers, unsafe.Pointer, func, chan, map -// // -// // TRANSLATES TO: -// // if typeIndirect { } else if valueIndirect { } else { } -// // -// // Since we don't deal with funcs, then "flagNethod" is unset, and can be ignored. - -// if _USE_RV_INTERFACE { -// return rv.Interface() -// } -// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - -// // if urv.flag&unsafeRvFlagMethod != 0 || urv.flag&unsafeRvFlagKindMask == uintptr(reflect.Interface) { -// // println("***** IS flag method or interface: delegating to rv.Interface()") -// // return rv.Interface() -// // } - -// // if urv.flag&unsafeRvFlagKindMask == uintptr(reflect.Interface) { -// // println("***** IS Interface: delegate to rv.Interface") -// // return rv.Interface() -// // } -// // if urv.flag&unsafeRvFlagKindMask&unsafeRvKindDirectIface == 0 { -// // if urv.flag&unsafeRvFlagAddr == 0 { -// // println("***** IS ifaceIndir typ") -// // // ui := unsafeIntf{word: urv.ptr, typ: urv.typ} -// // // return *(*interface{})(unsafe.Pointer(&ui)) -// // // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) -// // } -// // } else if urv.flag&unsafeRvFlagIndir != 0 { -// // println("***** IS flagindir") -// // // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) -// // } else { -// // println("***** NOT flagindir") -// // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) -// // } -// // println("***** default: delegate to rv.Interface") - -// urt := (*unsafeRtype)(unsafe.Pointer(urv.typ)) -// if _UNSAFE_RV_DEBUG { -// fmt.Printf(">>>> start: %v: ", rv.Type()) -// fmt.Printf("%v - %v\n", *urv, *urt) -// } -// if urt.kind&unsafeRvKindDirectIface == 0 { -// if _UNSAFE_RV_DEBUG { -// fmt.Printf("**** +ifaceIndir type: %v\n", rv.Type()) -// } -// // println("***** IS ifaceIndir typ") -// // if true || urv.flag&unsafeRvFlagAddr == 0 { -// // // println(" ***** IS NOT addr") -// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) -// // } -// } else if urv.flag&unsafeRvFlagIndir != 0 { -// if _UNSAFE_RV_DEBUG { -// fmt.Printf("**** +flagIndir type: %v\n", rv.Type()) -// } -// // println("***** IS flagindir") -// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) -// } else { -// if _UNSAFE_RV_DEBUG { -// fmt.Printf("**** -flagIndir type: %v\n", rv.Type()) -// } -// // println("***** NOT flagindir") -// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) -// } -// // println("***** default: delegating to rv.Interface()") -// // return rv.Interface() -// } - -// var staticM0 = make(map[string]uint64) -// var staticI0 = (int32)(-5) - -// func staticRv2iTest() { -// i0 := (int32)(-5) -// m0 := make(map[string]uint16) -// m0["1"] = 1 -// for _, i := range []interface{}{ -// (int)(7), -// (uint)(8), -// (int16)(-9), -// (uint16)(19), -// (uintptr)(77), -// (bool)(true), -// float32(-32.7), -// float64(64.9), -// complex(float32(19), 5), -// complex(float64(-32), 7), -// [4]uint64{1, 2, 3, 4}, -// (chan<- int)(nil), // chan, -// rv2i, // func -// io.Writer(ioutil.Discard), -// make(map[string]uint), -// (map[string]uint)(nil), -// staticM0, -// m0, -// &m0, -// i0, -// &i0, -// &staticI0, -// &staticM0, -// []uint32{6, 7, 8}, -// "abc", -// Raw{}, -// RawExt{}, -// &Raw{}, -// &RawExt{}, -// unsafe.Pointer(&i0), -// } { -// i2 := rv2i(reflect.ValueOf(i)) -// eq := reflect.DeepEqual(i, i2) -// fmt.Printf(">>>> %v == %v? %v\n", i, i2, eq) -// } -// // os.Exit(0) -// } - -// func init() { -// staticRv2iTest() -// } - -// func rv2i(rv reflect.Value) interface{} { -// if _USE_RV_INTERFACE || rv.Kind() == reflect.Interface || rv.CanAddr() { -// return rv.Interface() -// } -// // var i interface{} -// // ui := (*unsafeIntf)(unsafe.Pointer(&i)) -// var ui unsafeIntf -// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) -// // fmt.Printf("urv: flag: %b, typ: %b, ptr: %b\n", urv.flag, uintptr(urv.typ), uintptr(urv.ptr)) -// if (urv.flag&unsafeRvFlagKindMask)&unsafeRvKindDirectIface == 0 { -// if urv.flag&unsafeRvFlagAddr != 0 { -// println("***** indirect and addressable! Needs typed move - delegate to rv.Interface()") -// return rv.Interface() -// } -// println("****** indirect type/kind") -// ui.word = urv.ptr -// } else if urv.flag&unsafeRvFlagIndir != 0 { -// println("****** unsafe rv flag indir") -// ui.word = *(*unsafe.Pointer)(urv.ptr) -// } else { -// println("****** default: assign prt to word directly") -// ui.word = urv.ptr -// } -// // ui.word = urv.ptr -// ui.typ = urv.typ -// // fmt.Printf("(pointers) ui.typ: %p, word: %p\n", ui.typ, ui.word) -// // fmt.Printf("(binary) ui.typ: %b, word: %b\n", uintptr(ui.typ), uintptr(ui.word)) -// return *(*interface{})(unsafe.Pointer(&ui)) -// // return i -// } diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/json.go deleted file mode 100644 index a6af2c80..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/json.go +++ /dev/null @@ -1,1172 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -// By default, this json support uses base64 encoding for bytes, because you cannot -// store and read any arbitrary string in json (only unicode). -// However, the user can configre how to encode/decode bytes. -// -// This library specifically supports UTF-8 for encoding and decoding only. -// -// Note that the library will happily encode/decode things which are not valid -// json e.g. a map[int64]string. We do it for consistency. With valid json, -// we will encode and decode appropriately. -// Users can specify their map type if necessary to force it. -// -// Note: -// - we cannot use strconv.Quote and strconv.Unquote because json quotes/unquotes differently. -// We implement it here. -// - Also, strconv.ParseXXX for floats and integers -// - only works on strings resulting in unnecessary allocation and []byte-string conversion. -// - it does a lot of redundant checks, because json numbers are simpler that what it supports. -// - We parse numbers (floats and integers) directly here. -// We only delegate parsing floats if it is a hairy float which could cause a loss of precision. -// In that case, we delegate to strconv.ParseFloat. -// -// Note: -// - encode does not beautify. There is no whitespace when encoding. -// - rpc calls which take single integer arguments or write single numeric arguments will need care. - -// Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver -// MUST not call one-another. - -import ( - "bytes" - "encoding/base64" - "reflect" - "strconv" - "unicode/utf16" - "unicode/utf8" -) - -//-------------------------------- - -var ( - // jsonLiterals = [...]byte{'t', 'r', 'u', 'e', 'f', 'a', 'l', 's', 'e', 'n', 'u', 'l', 'l'} - - // jsonFloat64Pow10 = [...]float64{ - // 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - // 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - // 1e20, 1e21, 1e22, - // } - - // jsonUint64Pow10 = [...]uint64{ - // 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - // 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - // } - - // jsonTabs and jsonSpaces are used as caches for indents - jsonTabs, jsonSpaces string - - jsonCharHtmlSafeSet bitset128 - jsonCharSafeSet bitset128 - jsonCharWhitespaceSet bitset256 - jsonNumSet bitset256 - // jsonIsFloatSet bitset256 - - jsonU4Set [256]byte -) - -const ( - // jsonUnreadAfterDecNum controls whether we unread after decoding a number. - // - // instead of unreading, just update d.tok (iff it's not a whitespace char) - // However, doing this means that we may HOLD onto some data which belongs to another stream. - // Thus, it is safest to unread the data when done. - // keep behind a constant flag for now. - jsonUnreadAfterDecNum = true - - // If !jsonValidateSymbols, decoding will be faster, by skipping some checks: - // - If we see first character of null, false or true, - // do not validate subsequent characters. - // - e.g. if we see a n, assume null and skip next 3 characters, - // and do not validate they are ull. - // P.S. Do not expect a significant decoding boost from this. - jsonValidateSymbols = true - - jsonSpacesOrTabsLen = 128 - - jsonU4SetErrVal = 128 -) - -func init() { - var bs [jsonSpacesOrTabsLen]byte - for i := 0; i < jsonSpacesOrTabsLen; i++ { - bs[i] = ' ' - } - jsonSpaces = string(bs[:]) - - for i := 0; i < jsonSpacesOrTabsLen; i++ { - bs[i] = '\t' - } - jsonTabs = string(bs[:]) - - // populate the safe values as true: note: ASCII control characters are (0-31) - // jsonCharSafeSet: all true except (0-31) " \ - // jsonCharHtmlSafeSet: all true except (0-31) " \ < > & - var i byte - for i = 32; i < utf8.RuneSelf; i++ { - switch i { - case '"', '\\': - case '<', '>', '&': - jsonCharSafeSet.set(i) // = true - default: - jsonCharSafeSet.set(i) - jsonCharHtmlSafeSet.set(i) - } - } - for i = 0; i <= utf8.RuneSelf; i++ { - switch i { - case ' ', '\t', '\r', '\n': - jsonCharWhitespaceSet.set(i) - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '.', '+', '-': - jsonNumSet.set(i) - } - } - for j := range jsonU4Set { - switch i = byte(j); i { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - jsonU4Set[i] = i - '0' - case 'a', 'b', 'c', 'd', 'e', 'f': - jsonU4Set[i] = i - 'a' + 10 - case 'A', 'B', 'C', 'D', 'E', 'F': - jsonU4Set[i] = i - 'A' + 10 - default: - jsonU4Set[i] = jsonU4SetErrVal - } - // switch i = byte(j); i { - // case 'e', 'E', '.': - // jsonIsFloatSet.set(i) - // } - } - // jsonU4Set[255] = jsonU4SetErrVal -} - -type jsonEncDriver struct { - e *Encoder - w encWriter - h *JsonHandle - b [64]byte // scratch - bs []byte // scratch - se setExtWrapper - ds string // indent string - dl uint16 // indent level - dt bool // indent using tabs - d bool // indent - c containerState - noBuiltInTypes -} - -// indent is done as below: -// - newline and indent are added before each mapKey or arrayElem -// - newline and indent are added before each ending, -// except there was no entry (so we can have {} or []) - -func (e *jsonEncDriver) WriteArrayStart(length int) { - if e.d { - e.dl++ - } - e.w.writen1('[') - e.c = containerArrayStart -} - -func (e *jsonEncDriver) WriteArrayElem() { - if e.c != containerArrayStart { - e.w.writen1(',') - } - if e.d { - e.writeIndent() - } - e.c = containerArrayElem -} - -func (e *jsonEncDriver) WriteArrayEnd() { - if e.d { - e.dl-- - if e.c != containerArrayStart { - e.writeIndent() - } - } - e.w.writen1(']') - e.c = containerArrayEnd -} - -func (e *jsonEncDriver) WriteMapStart(length int) { - if e.d { - e.dl++ - } - e.w.writen1('{') - e.c = containerMapStart -} - -func (e *jsonEncDriver) WriteMapElemKey() { - if e.c != containerMapStart { - e.w.writen1(',') - } - if e.d { - e.writeIndent() - } - e.c = containerMapKey -} - -func (e *jsonEncDriver) WriteMapElemValue() { - if e.d { - e.w.writen2(':', ' ') - } else { - e.w.writen1(':') - } - e.c = containerMapValue -} - -func (e *jsonEncDriver) WriteMapEnd() { - if e.d { - e.dl-- - if e.c != containerMapStart { - e.writeIndent() - } - } - e.w.writen1('}') - e.c = containerMapEnd -} - -// func (e *jsonEncDriver) sendContainerState(c containerState) { -// // determine whether to output separators -// switch c { -// case containerMapKey: -// if e.c != containerMapStart { -// e.w.writen1(',') -// } -// if e.d { -// e.writeIndent() -// } -// case containerMapValue: -// if e.d { -// e.w.writen2(':', ' ') -// } else { -// e.w.writen1(':') -// } -// case containerMapEnd: -// if e.d { -// e.dl-- -// if e.c != containerMapStart { -// e.writeIndent() -// } -// } -// e.w.writen1('}') -// case containerArrayElem: -// if e.c != containerArrayStart { -// e.w.writen1(',') -// } -// if e.d { -// e.writeIndent() -// } -// case containerArrayEnd: -// if e.d { -// e.dl-- -// if e.c != containerArrayStart { -// e.writeIndent() -// } -// } -// e.w.writen1(']') -// } -// e.c = c -// } - -func (e *jsonEncDriver) writeIndent() { - e.w.writen1('\n') - if x := len(e.ds) * int(e.dl); x <= jsonSpacesOrTabsLen { - if e.dt { - e.w.writestr(jsonTabs[:x]) - } else { - e.w.writestr(jsonSpaces[:x]) - } - } else { - for i := uint16(0); i < e.dl; i++ { - e.w.writestr(e.ds) - } - } -} - -func (e *jsonEncDriver) EncodeNil() { - e.w.writen4('n', 'u', 'l', 'l') // e.w.writeb(jsonLiterals[9:13]) // null -} - -func (e *jsonEncDriver) EncodeBool(b bool) { - if b { - e.w.writen4('t', 'r', 'u', 'e') // e.w.writeb(jsonLiterals[0:4]) // true - } else { - e.w.writen5('f', 'a', 'l', 's', 'e') // e.w.writeb(jsonLiterals[4:9]) // false - } -} - -func (e *jsonEncDriver) EncodeFloat32(f float32) { - e.encodeFloat(float64(f), 32) -} - -func (e *jsonEncDriver) EncodeFloat64(f float64) { - e.encodeFloat(f, 64) -} - -func (e *jsonEncDriver) encodeFloat(f float64, numbits int) { - x := strconv.AppendFloat(e.b[:0], f, 'G', -1, numbits) - // if bytes.IndexByte(x, 'E') == -1 && bytes.IndexByte(x, '.') == -1 { - if !jsonIsFloatBytesB2(x) { - x = append(x, '.', '0') - } - e.w.writeb(x) -} - -func (e *jsonEncDriver) EncodeInt(v int64) { - if x := e.h.IntegerAsString; x == 'A' || x == 'L' && (v > 1<<53 || v < -(1<<53)) { - e.w.writen1('"') - e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) - e.w.writen1('"') - return - } - e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) -} - -func (e *jsonEncDriver) EncodeUint(v uint64) { - if x := e.h.IntegerAsString; x == 'A' || x == 'L' && v > 1<<53 { - e.w.writen1('"') - e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) - e.w.writen1('"') - return - } - e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) -} - -func (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { - if v := ext.ConvertExt(rv); v == nil { - e.w.writen4('n', 'u', 'l', 'l') // e.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() - } else { - en.encode(v) - } -} - -func (e *jsonEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { - // only encodes re.Value (never re.Data) - if re.Value == nil { - e.w.writen4('n', 'u', 'l', 'l') // e.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() - } else { - en.encode(re.Value) - } -} - -func (e *jsonEncDriver) EncodeString(c charEncoding, v string) { - e.quoteStr(v) -} - -func (e *jsonEncDriver) EncodeSymbol(v string) { - e.quoteStr(v) -} - -func (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - // if encoding raw bytes and RawBytesExt is configured, use it to encode - if c == c_RAW && e.se.i != nil { - e.EncodeExt(v, 0, &e.se, e.e) - return - } - if c == c_RAW { - slen := base64.StdEncoding.EncodedLen(len(v)) - if cap(e.bs) >= slen { - e.bs = e.bs[:slen] - } else { - e.bs = make([]byte, slen) - } - base64.StdEncoding.Encode(e.bs, v) - e.w.writen1('"') - e.w.writeb(e.bs) - e.w.writen1('"') - } else { - e.quoteStr(stringView(v)) - } -} - -func (e *jsonEncDriver) EncodeAsis(v []byte) { - e.w.writeb(v) -} - -func (e *jsonEncDriver) quoteStr(s string) { - // adapted from std pkg encoding/json - const hex = "0123456789abcdef" - w := e.w - w.writen1('"') - var start int - for i, slen := 0, len(s); i < slen; { - // encode all bytes < 0x20 (except \r, \n). - // also encode < > & to prevent security holes when served to some browsers. - if b := s[i]; b < utf8.RuneSelf { - // if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' { - if jsonCharHtmlSafeSet.isset(b) || (e.h.HTMLCharsAsIs && jsonCharSafeSet.isset(b)) { - i++ - continue - } - if start < i { - w.writestr(s[start:i]) - } - switch b { - case '\\', '"': - w.writen2('\\', b) - case '\n': - w.writen2('\\', 'n') - case '\r': - w.writen2('\\', 'r') - case '\b': - w.writen2('\\', 'b') - case '\f': - w.writen2('\\', 'f') - case '\t': - w.writen2('\\', 't') - default: - w.writestr(`\u00`) - w.writen2(hex[b>>4], hex[b&0xF]) - } - i++ - start = i - continue - } - c, size := utf8.DecodeRuneInString(s[i:]) - if c == utf8.RuneError && size == 1 { - if start < i { - w.writestr(s[start:i]) - } - w.writestr(`\ufffd`) - i += size - start = i - continue - } - // U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR. - // Both technically valid JSON, but bomb on JSONP, so fix here unconditionally. - if c == '\u2028' || c == '\u2029' { - if start < i { - w.writestr(s[start:i]) - } - w.writestr(`\u202`) - w.writen1(hex[c&0xF]) - i += size - start = i - continue - } - i += size - } - if start < len(s) { - w.writestr(s[start:]) - } - w.writen1('"') -} - -func (e *jsonEncDriver) atEndOfEncode() { - if e.h.TermWhitespace { - if e.d { - e.w.writen1('\n') - } else { - e.w.writen1(' ') - } - } -} - -type jsonDecDriver struct { - noBuiltInTypes - d *Decoder - h *JsonHandle - r decReader - - c containerState - // tok is used to store the token read right after skipWhiteSpace. - tok uint8 - - fnull bool // found null from appendStringAsBytes - - bstr [8]byte // scratch used for string \UXXX parsing - b [64]byte // scratch, used for parsing strings or numbers - b2 [64]byte // scratch, used only for decodeBytes (after base64) - bs []byte // scratch. Initialized from b. Used for parsing strings or numbers. - - se setExtWrapper - - // n jsonNum -} - -func jsonIsWS(b byte) bool { - // return b == ' ' || b == '\t' || b == '\r' || b == '\n' - return jsonCharWhitespaceSet.isset(b) -} - -func (d *jsonDecDriver) uncacheRead() { - if d.tok != 0 { - d.r.unreadn1() - d.tok = 0 - } -} - -func (d *jsonDecDriver) ReadMapStart() int { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.tok != '{' { - d.d.errorf("json: expect char '%c' but got char '%c'", '{', d.tok) - } - d.tok = 0 - d.c = containerMapStart - return -1 -} - -func (d *jsonDecDriver) ReadArrayStart() int { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.tok != '[' { - d.d.errorf("json: expect char '%c' but got char '%c'", '[', d.tok) - } - d.tok = 0 - d.c = containerArrayStart - return -1 -} - -func (d *jsonDecDriver) CheckBreak() bool { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - return d.tok == '}' || d.tok == ']' -} - -func (d *jsonDecDriver) ReadArrayElem() { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.c != containerArrayStart { - const xc uint8 = ',' - if d.tok != xc { - d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) - } - d.tok = 0 - } - d.c = containerArrayElem -} - -func (d *jsonDecDriver) ReadArrayEnd() { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - const xc uint8 = ']' - if d.tok != xc { - d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) - } - d.tok = 0 - d.c = containerArrayEnd -} - -func (d *jsonDecDriver) ReadMapElemKey() { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.c != containerMapStart { - const xc uint8 = ',' - if d.tok != xc { - d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) - } - d.tok = 0 - } - d.c = containerMapKey -} - -func (d *jsonDecDriver) ReadMapElemValue() { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - const xc uint8 = ':' - if d.tok != xc { - d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) - } - d.tok = 0 - d.c = containerMapValue -} - -func (d *jsonDecDriver) ReadMapEnd() { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - const xc uint8 = '}' - if d.tok != xc { - d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) - } - d.tok = 0 - d.c = containerMapEnd -} - -// func (d *jsonDecDriver) readContainerState(c containerState, xc uint8, check bool) { -// if d.tok == 0 { -// d.tok = d.r.skip(&jsonCharWhitespaceSet) -// } -// if check { -// if d.tok != xc { -// d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) -// } -// d.tok = 0 -// } -// d.c = c -// } - -// func (d *jsonDecDriver) sendContainerState(c containerState) { -// if d.tok == 0 { -// d.tok = d.r.skip(&jsonCharWhitespaceSet) -// } -// var xc uint8 // char expected -// switch c { -// case containerMapKey: -// if d.c != containerMapStart { -// xc = ',' -// } -// case containerMapValue: -// xc = ':' -// case containerMapEnd: -// xc = '}' -// case containerArrayElem: -// if d.c != containerArrayStart { -// xc = ',' -// } -// case containerArrayEnd: -// xc = ']' -// } -// if xc != 0 { -// if d.tok != xc { -// d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) -// } -// d.tok = 0 -// } -// d.c = c -// } - -// func (d *jsonDecDriver) readLiteralIdx(fromIdx, toIdx uint8) { -// bs := d.r.readx(int(toIdx - fromIdx)) -// d.tok = 0 -// if jsonValidateSymbols && !bytes.Equal(bs, jsonLiterals[fromIdx:toIdx]) { -// d.d.errorf("json: expecting %s: got %s", jsonLiterals[fromIdx:toIdx], bs) -// return -// } -// } - -func (d *jsonDecDriver) readSymbol3(v1, v2, v3 uint8) { - b1, b2, b3 := d.r.readn3() - d.tok = 0 - if jsonValidateSymbols && (b1 != v1 || b2 != v2 || b3 != v3) { - d.d.errorf("json: expecting %c, %c, %c: got %c, %c, %c", b1, b2, b3, v1, v2, v3) - return - } -} - -func (d *jsonDecDriver) readSymbol4(v1, v2, v3, v4 uint8) { - b1, b2, b3, b4 := d.r.readn4() - d.tok = 0 - if jsonValidateSymbols && (b1 != v1 || b2 != v2 || b3 != v3 || b4 != v4) { - d.d.errorf("json: expecting %c, %c, %c, %c: got %c, %c, %c, %c", b1, b2, b3, b4, v1, v2, v3, v4) - return - } -} - -func (d *jsonDecDriver) TryDecodeAsNil() bool { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.tok == 'n' { - d.readSymbol3('u', 'l', 'l') // d.readLiteralIdx(10, 13) // ull - return true - } - return false -} - -func (d *jsonDecDriver) DecodeBool() bool { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.tok == 'f' { - d.readSymbol4('a', 'l', 's', 'e') // d.readLiteralIdx(5, 9) // alse - return false - } - if d.tok == 't' { - d.readSymbol3('r', 'u', 'e') // d.readLiteralIdx(1, 4) // rue - return true - } - d.d.errorf("json: decode bool: got first char %c", d.tok) - return false // "unreachable" -} - -func (d *jsonDecDriver) ContainerType() (vt valueType) { - // check container type by checking the first char - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if b := d.tok; b == '{' { - return valueTypeMap - } else if b == '[' { - return valueTypeArray - } else if b == 'n' { - return valueTypeNil - } else if b == '"' { - return valueTypeString - } - return valueTypeUnset - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) - // return false // "unreachable" -} - -func (d *jsonDecDriver) decNumBytes() (bs []byte) { - // stores num bytes in d.bs - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - if d.tok == '"' { - bs = d.r.readUntil(d.b2[:0], '"') - bs = bs[:len(bs)-1] - } else { - d.r.unreadn1() - bs = d.r.readTo(d.bs[:0], &jsonNumSet) - } - d.tok = 0 - return bs -} - -func (d *jsonDecDriver) DecodeUint(bitsize uint8) (u uint64) { - bs := d.decNumBytes() - u, err := strconv.ParseUint(stringView(bs), 10, int(bitsize)) - if err != nil { - d.d.errorf("json: decode uint from %s: %v", bs, err) - return - } - return -} - -func (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) { - bs := d.decNumBytes() - i, err := strconv.ParseInt(stringView(bs), 10, int(bitsize)) - if err != nil { - d.d.errorf("json: decode int from %s: %v", bs, err) - return - } - return -} - -func (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { - bs := d.decNumBytes() - bitsize := 64 - if chkOverflow32 { - bitsize = 32 - } - f, err := strconv.ParseFloat(stringView(bs), bitsize) - if err != nil { - d.d.errorf("json: decode float from %s: %v", bs, err) - return - } - return -} - -func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { - if ext == nil { - re := rv.(*RawExt) - re.Tag = xtag - d.d.decode(&re.Value) - } else { - var v interface{} - d.d.decode(&v) - ext.UpdateExt(rv, v) - } - return -} - -func (d *jsonDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { - // if decoding into raw bytes, and the RawBytesExt is configured, use it to decode. - if d.se.i != nil { - bsOut = bs - d.DecodeExt(&bsOut, 0, &d.se) - return - } - d.appendStringAsBytes() - // base64 encodes []byte{} as "", and we encode nil []byte as null. - // Consequently, base64 should decode null as a nil []byte, and "" as an empty []byte{}. - // appendStringAsBytes returns a zero-len slice for both, so as not to reset d.bs. - // However, it sets a fnull field to true, so we can check if a null was found. - if len(d.bs) == 0 { - if d.fnull { - return nil - } - return []byte{} - } - bs0 := d.bs - slen := base64.StdEncoding.DecodedLen(len(bs0)) - if slen <= cap(bs) { - bsOut = bs[:slen] - } else if zerocopy && slen <= cap(d.b2) { - bsOut = d.b2[:slen] - } else { - bsOut = make([]byte, slen) - } - slen2, err := base64.StdEncoding.Decode(bsOut, bs0) - if err != nil { - d.d.errorf("json: error decoding base64 binary '%s': %v", bs0, err) - return nil - } - if slen != slen2 { - bsOut = bsOut[:slen2] - } - return -} - -const jsonAlwaysReturnInternString = false - -func (d *jsonDecDriver) DecodeString() (s string) { - d.appendStringAsBytes() - // if x := d.s.sc; x != nil && x.so && x.st == '}' { // map key - if jsonAlwaysReturnInternString || d.c == containerMapKey { - return d.d.string(d.bs) - } - return string(d.bs) -} - -func (d *jsonDecDriver) DecodeStringAsBytes() (s []byte) { - d.appendStringAsBytes() - return d.bs -} - -func (d *jsonDecDriver) appendStringAsBytes() { - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - - d.fnull = false - if d.tok != '"' { - // d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok) - // handle non-string scalar: null, true, false or a number - switch d.tok { - case 'n': - d.readSymbol3('u', 'l', 'l') // d.readLiteralIdx(10, 13) // ull - d.bs = d.bs[:0] - d.fnull = true - case 'f': - d.readSymbol4('a', 'l', 's', 'e') // d.readLiteralIdx(5, 9) // alse - d.bs = d.bs[:5] - copy(d.bs, "false") - case 't': - d.readSymbol3('r', 'u', 'e') // d.readLiteralIdx(1, 4) // rue - d.bs = d.bs[:4] - copy(d.bs, "true") - default: - // try to parse a valid number - bs := d.decNumBytes() - d.bs = d.bs[:len(bs)] - copy(d.bs, bs) - } - return - } - - d.tok = 0 - r := d.r - var cs = r.readUntil(d.b2[:0], '"') - var cslen = len(cs) - var c uint8 - v := d.bs[:0] - // append on each byte seen can be expensive, so we just - // keep track of where we last read a contiguous set of - // non-special bytes (using cursor variable), - // and when we see a special byte - // e.g. end-of-slice, " or \, - // we will append the full range into the v slice before proceeding - for i, cursor := 0, 0; ; { - if i == cslen { - v = append(v, cs[cursor:]...) - cs = r.readUntil(d.b2[:0], '"') - cslen = len(cs) - i, cursor = 0, 0 - } - c = cs[i] - if c == '"' { - v = append(v, cs[cursor:i]...) - break - } - if c != '\\' { - i++ - continue - } - v = append(v, cs[cursor:i]...) - i++ - c = cs[i] - switch c { - case '"', '\\', '/', '\'': - v = append(v, c) - case 'b': - v = append(v, '\b') - case 'f': - v = append(v, '\f') - case 'n': - v = append(v, '\n') - case 'r': - v = append(v, '\r') - case 't': - v = append(v, '\t') - case 'u': - var r rune - var rr uint32 - c = cs[i+4] // may help reduce bounds-checking - for j := 1; j < 5; j++ { - c = jsonU4Set[cs[i+j]] - if c == jsonU4SetErrVal { - d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, c) - } - rr = rr*16 + uint32(c) - } - r = rune(rr) - i += 4 - if utf16.IsSurrogate(r) { - if !(cs[i+2] == 'u' && cs[i+i] == '\\') { - d.d.errorf(`json: unquoteStr: invalid unicode sequence. Expecting \u`) - return - } - i += 2 - c = cs[i+4] // may help reduce bounds-checking - var rr1 uint32 - for j := 1; j < 5; j++ { - c = jsonU4Set[cs[i+j]] - if c == jsonU4SetErrVal { - d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, c) - } - rr1 = rr1*16 + uint32(c) - } - r = utf16.DecodeRune(r, rune(rr1)) - i += 4 - } - w2 := utf8.EncodeRune(d.bstr[:], r) - v = append(v, d.bstr[:w2]...) - default: - d.d.errorf("json: unsupported escaped value: %c", c) - } - i++ - cursor = i - } - d.bs = v -} - -// func (d *jsonDecDriver) jsonU4Arr(bs [4]byte) (r rune) { -// // u, _ := strconv.ParseUint(string(d.bstr[:4]), 16, 64) -// var u uint32 -// for _, v := range bs { -// if '0' <= v && v <= '9' { -// v = v - '0' -// } else if 'a' <= v && v <= 'f' { -// v = v - 'a' + 10 -// } else if 'A' <= v && v <= 'f' { -// v = v - 'A' + 10 -// } else { -// // d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, v) -// return utf8.RuneError -// } -// u = u*16 + uint32(v) -// } -// return rune(u) -// } - -func (d *jsonDecDriver) DecodeNaked() { - z := d.d.n - // var decodeFurther bool - - if d.tok == 0 { - d.tok = d.r.skip(&jsonCharWhitespaceSet) - } - switch d.tok { - case 'n': - d.readSymbol3('u', 'l', 'l') // d.readLiteralIdx(10, 13) // ull - z.v = valueTypeNil - case 'f': - d.readSymbol4('a', 'l', 's', 'e') // d.readLiteralIdx(5, 9) // alse - z.v = valueTypeBool - z.b = false - case 't': - d.readSymbol3('r', 'u', 'e') // d.readLiteralIdx(1, 4) // rue - z.v = valueTypeBool - z.b = true - case '{': - z.v = valueTypeMap // don't consume. kInterfaceNaked will call ReadMapStart - case '[': - z.v = valueTypeArray // don't consume. kInterfaceNaked will call ReadArrayStart - case '"': - z.v = valueTypeString - z.s = d.DecodeString() - default: // number - bs := d.decNumBytes() - var err error - if len(bs) == 0 { - d.d.errorf("json: decode number from empty string") - return - } else if d.h.PreferFloat || jsonIsFloatBytesB3(bs) { // bytes.IndexByte(bs, '.') != -1 ||... - // } else if d.h.PreferFloat || bytes.ContainsAny(bs, ".eE") { - z.v = valueTypeFloat - z.f, err = strconv.ParseFloat(stringView(bs), 64) - } else if d.h.SignedInteger || bs[0] == '-' { - z.v = valueTypeInt - z.i, err = strconv.ParseInt(stringView(bs), 10, 64) - } else { - z.v = valueTypeUint - z.u, err = strconv.ParseUint(stringView(bs), 10, 64) - } - if err != nil { - if z.v == valueTypeInt || z.v == valueTypeUint { - if v, ok := err.(*strconv.NumError); ok && (v.Err == strconv.ErrRange || v.Err == strconv.ErrSyntax) { - z.v = valueTypeFloat - z.f, err = strconv.ParseFloat(stringView(bs), 64) - } - } - if err != nil { - d.d.errorf("json: decode number from %s: %v", bs, err) - return - } - } - } - // if decodeFurther { - // d.s.sc.retryRead() - // } - return -} - -//---------------------- - -// JsonHandle is a handle for JSON encoding format. -// -// Json is comprehensively supported: -// - decodes numbers into interface{} as int, uint or float64 -// - configurable way to encode/decode []byte . -// by default, encodes and decodes []byte using base64 Std Encoding -// - UTF-8 support for encoding and decoding -// -// It has better performance than the json library in the standard library, -// by leveraging the performance improvements of the codec library and -// minimizing allocations. -// -// In addition, it doesn't read more bytes than necessary during a decode, which allows -// reading multiple values from a stream containing json and non-json content. -// For example, a user can read a json value, then a cbor value, then a msgpack value, -// all from the same stream in sequence. -type JsonHandle struct { - textEncodingType - BasicHandle - - // RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way. - // If not configured, raw bytes are encoded to/from base64 text. - RawBytesExt InterfaceExt - - // Indent indicates how a value is encoded. - // - If positive, indent by that number of spaces. - // - If negative, indent by that number of tabs. - Indent int8 - - // IntegerAsString controls how integers (signed and unsigned) are encoded. - // - // Per the JSON Spec, JSON numbers are 64-bit floating point numbers. - // Consequently, integers > 2^53 cannot be represented as a JSON number without losing precision. - // This can be mitigated by configuring how to encode integers. - // - // IntegerAsString interpretes the following values: - // - if 'L', then encode integers > 2^53 as a json string. - // - if 'A', then encode all integers as a json string - // containing the exact integer representation as a decimal. - // - else encode all integers as a json number (default) - IntegerAsString uint8 - - // HTMLCharsAsIs controls how to encode some special characters to html: < > & - // - // By default, we encode them as \uXXX - // to prevent security holes when served from some browsers. - HTMLCharsAsIs bool - - // PreferFloat says that we will default to decoding a number as a float. - // If not set, we will examine the characters of the number and decode as an - // integer type if it doesn't have any of the characters [.eE]. - PreferFloat bool - - // TermWhitespace says that we add a whitespace character - // at the end of an encoding. - // - // The whitespace is important, especially if using numbers in a context - // where multiple items are written to a stream. - TermWhitespace bool -} - -func (h *JsonHandle) hasElemSeparators() bool { return true } - -func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{i: ext}) -} - -func (h *JsonHandle) newEncDriver(e *Encoder) encDriver { - hd := jsonEncDriver{e: e, h: h} - hd.bs = hd.b[:0] - - hd.reset() - - return &hd -} - -func (h *JsonHandle) newDecDriver(d *Decoder) decDriver { - // d := jsonDecDriver{r: r.(*bytesDecReader), h: h} - hd := jsonDecDriver{d: d, h: h} - hd.bs = hd.b[:0] - hd.reset() - return &hd -} - -func (e *jsonEncDriver) reset() { - e.w = e.e.w - e.se.i = e.h.RawBytesExt - if e.bs != nil { - e.bs = e.bs[:0] - } - e.d, e.dt, e.dl, e.ds = false, false, 0, "" - e.c = 0 - if e.h.Indent > 0 { - e.d = true - e.ds = jsonSpaces[:e.h.Indent] - } else if e.h.Indent < 0 { - e.d = true - e.dt = true - e.ds = jsonTabs[:-(e.h.Indent)] - } -} - -func (d *jsonDecDriver) reset() { - d.r = d.d.r - d.se.i = d.h.RawBytesExt - if d.bs != nil { - d.bs = d.bs[:0] - } - d.c, d.tok = 0, 0 - // d.n.reset() -} - -// func jsonIsFloatBytes(bs []byte) bool { -// for _, v := range bs { -// // if v == '.' || v == 'e' || v == 'E' { -// if jsonIsFloatSet.isset(v) { -// return true -// } -// } -// return false -// } - -func jsonIsFloatBytesB2(bs []byte) bool { - return bytes.IndexByte(bs, '.') != -1 || - bytes.IndexByte(bs, 'E') != -1 -} - -func jsonIsFloatBytesB3(bs []byte) bool { - return bytes.IndexByte(bs, '.') != -1 || - bytes.IndexByte(bs, 'E') != -1 || - bytes.IndexByte(bs, 'e') != -1 -} - -// var jsonEncodeTerminate = []byte{' '} - -// func (h *JsonHandle) rpcEncodeTerminate() []byte { -// return jsonEncodeTerminate -// } - -var _ decDriver = (*jsonDecDriver)(nil) -var _ encDriver = (*jsonEncDriver)(nil) diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/msgpack.go deleted file mode 100644 index fcc3177a..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/msgpack.go +++ /dev/null @@ -1,899 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -/* -MSGPACK - -Msgpack-c implementation powers the c, c++, python, ruby, etc libraries. -We need to maintain compatibility with it and how it encodes integer values -without caring about the type. - -For compatibility with behaviour of msgpack-c reference implementation: - - Go intX (>0) and uintX - IS ENCODED AS - msgpack +ve fixnum, unsigned - - Go intX (<0) - IS ENCODED AS - msgpack -ve fixnum, signed - -*/ -package codec - -import ( - "fmt" - "io" - "math" - "net/rpc" - "reflect" -) - -const ( - mpPosFixNumMin byte = 0x00 - mpPosFixNumMax = 0x7f - mpFixMapMin = 0x80 - mpFixMapMax = 0x8f - mpFixArrayMin = 0x90 - mpFixArrayMax = 0x9f - mpFixStrMin = 0xa0 - mpFixStrMax = 0xbf - mpNil = 0xc0 - _ = 0xc1 - mpFalse = 0xc2 - mpTrue = 0xc3 - mpFloat = 0xca - mpDouble = 0xcb - mpUint8 = 0xcc - mpUint16 = 0xcd - mpUint32 = 0xce - mpUint64 = 0xcf - mpInt8 = 0xd0 - mpInt16 = 0xd1 - mpInt32 = 0xd2 - mpInt64 = 0xd3 - - // extensions below - mpBin8 = 0xc4 - mpBin16 = 0xc5 - mpBin32 = 0xc6 - mpExt8 = 0xc7 - mpExt16 = 0xc8 - mpExt32 = 0xc9 - mpFixExt1 = 0xd4 - mpFixExt2 = 0xd5 - mpFixExt4 = 0xd6 - mpFixExt8 = 0xd7 - mpFixExt16 = 0xd8 - - mpStr8 = 0xd9 // new - mpStr16 = 0xda - mpStr32 = 0xdb - - mpArray16 = 0xdc - mpArray32 = 0xdd - - mpMap16 = 0xde - mpMap32 = 0xdf - - mpNegFixNumMin = 0xe0 - mpNegFixNumMax = 0xff -) - -// MsgpackSpecRpcMultiArgs is a special type which signifies to the MsgpackSpecRpcCodec -// that the backend RPC service takes multiple arguments, which have been arranged -// in sequence in the slice. -// -// The Codec then passes it AS-IS to the rpc service (without wrapping it in an -// array of 1 element). -type MsgpackSpecRpcMultiArgs []interface{} - -// A MsgpackContainer type specifies the different types of msgpackContainers. -type msgpackContainerType struct { - fixCutoff int - bFixMin, b8, b16, b32 byte - hasFixMin, has8, has8Always bool -} - -var ( - msgpackContainerStr = msgpackContainerType{32, mpFixStrMin, mpStr8, mpStr16, mpStr32, true, true, false} - msgpackContainerBin = msgpackContainerType{0, 0, mpBin8, mpBin16, mpBin32, false, true, true} - msgpackContainerList = msgpackContainerType{16, mpFixArrayMin, 0, mpArray16, mpArray32, true, false, false} - msgpackContainerMap = msgpackContainerType{16, mpFixMapMin, 0, mpMap16, mpMap32, true, false, false} -) - -//--------------------------------------------- - -type msgpackEncDriver struct { - noBuiltInTypes - encDriverNoopContainerWriter - // encNoSeparator - e *Encoder - w encWriter - h *MsgpackHandle - x [8]byte -} - -func (e *msgpackEncDriver) EncodeNil() { - e.w.writen1(mpNil) -} - -func (e *msgpackEncDriver) EncodeInt(i int64) { - if i >= 0 { - e.EncodeUint(uint64(i)) - } else if i >= -32 { - e.w.writen1(byte(i)) - } else if i >= math.MinInt8 { - e.w.writen2(mpInt8, byte(i)) - } else if i >= math.MinInt16 { - e.w.writen1(mpInt16) - bigenHelper{e.x[:2], e.w}.writeUint16(uint16(i)) - } else if i >= math.MinInt32 { - e.w.writen1(mpInt32) - bigenHelper{e.x[:4], e.w}.writeUint32(uint32(i)) - } else { - e.w.writen1(mpInt64) - bigenHelper{e.x[:8], e.w}.writeUint64(uint64(i)) - } -} - -func (e *msgpackEncDriver) EncodeUint(i uint64) { - if i <= math.MaxInt8 { - e.w.writen1(byte(i)) - } else if i <= math.MaxUint8 { - e.w.writen2(mpUint8, byte(i)) - } else if i <= math.MaxUint16 { - e.w.writen1(mpUint16) - bigenHelper{e.x[:2], e.w}.writeUint16(uint16(i)) - } else if i <= math.MaxUint32 { - e.w.writen1(mpUint32) - bigenHelper{e.x[:4], e.w}.writeUint32(uint32(i)) - } else { - e.w.writen1(mpUint64) - bigenHelper{e.x[:8], e.w}.writeUint64(uint64(i)) - } -} - -func (e *msgpackEncDriver) EncodeBool(b bool) { - if b { - e.w.writen1(mpTrue) - } else { - e.w.writen1(mpFalse) - } -} - -func (e *msgpackEncDriver) EncodeFloat32(f float32) { - e.w.writen1(mpFloat) - bigenHelper{e.x[:4], e.w}.writeUint32(math.Float32bits(f)) -} - -func (e *msgpackEncDriver) EncodeFloat64(f float64) { - e.w.writen1(mpDouble) - bigenHelper{e.x[:8], e.w}.writeUint64(math.Float64bits(f)) -} - -func (e *msgpackEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext, _ *Encoder) { - bs := ext.WriteExt(v) - if bs == nil { - e.EncodeNil() - return - } - if e.h.WriteExt { - e.encodeExtPreamble(uint8(xtag), len(bs)) - e.w.writeb(bs) - } else { - e.EncodeStringBytes(c_RAW, bs) - } -} - -func (e *msgpackEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) { - e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) - e.w.writeb(re.Data) -} - -func (e *msgpackEncDriver) encodeExtPreamble(xtag byte, l int) { - if l == 1 { - e.w.writen2(mpFixExt1, xtag) - } else if l == 2 { - e.w.writen2(mpFixExt2, xtag) - } else if l == 4 { - e.w.writen2(mpFixExt4, xtag) - } else if l == 8 { - e.w.writen2(mpFixExt8, xtag) - } else if l == 16 { - e.w.writen2(mpFixExt16, xtag) - } else if l < 256 { - e.w.writen2(mpExt8, byte(l)) - e.w.writen1(xtag) - } else if l < 65536 { - e.w.writen1(mpExt16) - bigenHelper{e.x[:2], e.w}.writeUint16(uint16(l)) - e.w.writen1(xtag) - } else { - e.w.writen1(mpExt32) - bigenHelper{e.x[:4], e.w}.writeUint32(uint32(l)) - e.w.writen1(xtag) - } -} - -func (e *msgpackEncDriver) WriteArrayStart(length int) { - e.writeContainerLen(msgpackContainerList, length) -} - -func (e *msgpackEncDriver) WriteMapStart(length int) { - e.writeContainerLen(msgpackContainerMap, length) -} - -func (e *msgpackEncDriver) EncodeString(c charEncoding, s string) { - slen := len(s) - if c == c_RAW && e.h.WriteExt { - e.writeContainerLen(msgpackContainerBin, slen) - } else { - e.writeContainerLen(msgpackContainerStr, slen) - } - if slen > 0 { - e.w.writestr(s) - } -} - -func (e *msgpackEncDriver) EncodeSymbol(v string) { - e.EncodeString(c_UTF8, v) -} - -func (e *msgpackEncDriver) EncodeStringBytes(c charEncoding, bs []byte) { - slen := len(bs) - if c == c_RAW && e.h.WriteExt { - e.writeContainerLen(msgpackContainerBin, slen) - } else { - e.writeContainerLen(msgpackContainerStr, slen) - } - if slen > 0 { - e.w.writeb(bs) - } -} - -func (e *msgpackEncDriver) writeContainerLen(ct msgpackContainerType, l int) { - if ct.hasFixMin && l < ct.fixCutoff { - e.w.writen1(ct.bFixMin | byte(l)) - } else if ct.has8 && l < 256 && (ct.has8Always || e.h.WriteExt) { - e.w.writen2(ct.b8, uint8(l)) - } else if l < 65536 { - e.w.writen1(ct.b16) - bigenHelper{e.x[:2], e.w}.writeUint16(uint16(l)) - } else { - e.w.writen1(ct.b32) - bigenHelper{e.x[:4], e.w}.writeUint32(uint32(l)) - } -} - -//--------------------------------------------- - -type msgpackDecDriver struct { - d *Decoder - r decReader // *Decoder decReader decReaderT - h *MsgpackHandle - b [scratchByteArrayLen]byte - bd byte - bdRead bool - br bool // bytes reader - noBuiltInTypes - // noStreamingCodec - // decNoSeparator - decDriverNoopContainerReader -} - -// Note: This returns either a primitive (int, bool, etc) for non-containers, -// or a containerType, or a specific type denoting nil or extension. -// It is called when a nil interface{} is passed, leaving it up to the DecDriver -// to introspect the stream and decide how best to decode. -// It deciphers the value by looking at the stream first. -func (d *msgpackDecDriver) DecodeNaked() { - if !d.bdRead { - d.readNextBd() - } - bd := d.bd - n := d.d.n - var decodeFurther bool - - switch bd { - case mpNil: - n.v = valueTypeNil - d.bdRead = false - case mpFalse: - n.v = valueTypeBool - n.b = false - case mpTrue: - n.v = valueTypeBool - n.b = true - - case mpFloat: - n.v = valueTypeFloat - n.f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) - case mpDouble: - n.v = valueTypeFloat - n.f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) - - case mpUint8: - n.v = valueTypeUint - n.u = uint64(d.r.readn1()) - case mpUint16: - n.v = valueTypeUint - n.u = uint64(bigen.Uint16(d.r.readx(2))) - case mpUint32: - n.v = valueTypeUint - n.u = uint64(bigen.Uint32(d.r.readx(4))) - case mpUint64: - n.v = valueTypeUint - n.u = uint64(bigen.Uint64(d.r.readx(8))) - - case mpInt8: - n.v = valueTypeInt - n.i = int64(int8(d.r.readn1())) - case mpInt16: - n.v = valueTypeInt - n.i = int64(int16(bigen.Uint16(d.r.readx(2)))) - case mpInt32: - n.v = valueTypeInt - n.i = int64(int32(bigen.Uint32(d.r.readx(4)))) - case mpInt64: - n.v = valueTypeInt - n.i = int64(int64(bigen.Uint64(d.r.readx(8)))) - - default: - switch { - case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax: - // positive fixnum (always signed) - n.v = valueTypeInt - n.i = int64(int8(bd)) - case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax: - // negative fixnum - n.v = valueTypeInt - n.i = int64(int8(bd)) - case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax: - if d.h.RawToString { - n.v = valueTypeString - n.s = d.DecodeString() - } else { - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) - } - case bd == mpBin8, bd == mpBin16, bd == mpBin32: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) - case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: - n.v = valueTypeArray - decodeFurther = true - case bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax: - n.v = valueTypeMap - decodeFurther = true - case bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32: - n.v = valueTypeExt - clen := d.readExtLen() - n.u = uint64(d.r.readn1()) - n.l = d.r.readx(clen) - default: - d.d.errorf("Nil-Deciphered DecodeValue: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) - } - } - if !decodeFurther { - d.bdRead = false - } - if n.v == valueTypeUint && d.h.SignedInteger { - n.v = valueTypeInt - n.i = int64(n.u) - } - return -} - -// int can be decoded from msgpack type: intXXX or uintXXX -func (d *msgpackDecDriver) DecodeInt(bitsize uint8) (i int64) { - if !d.bdRead { - d.readNextBd() - } - switch d.bd { - case mpUint8: - i = int64(uint64(d.r.readn1())) - case mpUint16: - i = int64(uint64(bigen.Uint16(d.r.readx(2)))) - case mpUint32: - i = int64(uint64(bigen.Uint32(d.r.readx(4)))) - case mpUint64: - i = int64(bigen.Uint64(d.r.readx(8))) - case mpInt8: - i = int64(int8(d.r.readn1())) - case mpInt16: - i = int64(int16(bigen.Uint16(d.r.readx(2)))) - case mpInt32: - i = int64(int32(bigen.Uint32(d.r.readx(4)))) - case mpInt64: - i = int64(bigen.Uint64(d.r.readx(8))) - default: - switch { - case d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax: - i = int64(int8(d.bd)) - case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax: - i = int64(int8(d.bd)) - default: - d.d.errorf("Unhandled single-byte unsigned integer value: %s: %x", msgBadDesc, d.bd) - return - } - } - // check overflow (logic adapted from std pkg reflect/value.go OverflowUint() - if bitsize > 0 { - if trunc := (i << (64 - bitsize)) >> (64 - bitsize); i != trunc { - d.d.errorf("Overflow int value: %v", i) - return - } - } - d.bdRead = false - return -} - -// uint can be decoded from msgpack type: intXXX or uintXXX -func (d *msgpackDecDriver) DecodeUint(bitsize uint8) (ui uint64) { - if !d.bdRead { - d.readNextBd() - } - switch d.bd { - case mpUint8: - ui = uint64(d.r.readn1()) - case mpUint16: - ui = uint64(bigen.Uint16(d.r.readx(2))) - case mpUint32: - ui = uint64(bigen.Uint32(d.r.readx(4))) - case mpUint64: - ui = bigen.Uint64(d.r.readx(8)) - case mpInt8: - if i := int64(int8(d.r.readn1())); i >= 0 { - ui = uint64(i) - } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) - return - } - case mpInt16: - if i := int64(int16(bigen.Uint16(d.r.readx(2)))); i >= 0 { - ui = uint64(i) - } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) - return - } - case mpInt32: - if i := int64(int32(bigen.Uint32(d.r.readx(4)))); i >= 0 { - ui = uint64(i) - } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) - return - } - case mpInt64: - if i := int64(bigen.Uint64(d.r.readx(8))); i >= 0 { - ui = uint64(i) - } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) - return - } - default: - switch { - case d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax: - ui = uint64(d.bd) - case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax: - d.d.errorf("Assigning negative signed value: %v, to unsigned type", int(d.bd)) - return - default: - d.d.errorf("Unhandled single-byte unsigned integer value: %s: %x", msgBadDesc, d.bd) - return - } - } - // check overflow (logic adapted from std pkg reflect/value.go OverflowUint() - if bitsize > 0 { - if trunc := (ui << (64 - bitsize)) >> (64 - bitsize); ui != trunc { - d.d.errorf("Overflow uint value: %v", ui) - return - } - } - d.bdRead = false - return -} - -// float can either be decoded from msgpack type: float, double or intX -func (d *msgpackDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == mpFloat { - f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) - } else if d.bd == mpDouble { - f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) - } else { - f = float64(d.DecodeInt(0)) - } - if chkOverflow32 && chkOvf.Float32(f) { - d.d.errorf("msgpack: float32 overflow: %v", f) - return - } - d.bdRead = false - return -} - -// bool can be decoded from bool, fixnum 0 or 1. -func (d *msgpackDecDriver) DecodeBool() (b bool) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == mpFalse || d.bd == 0 { - // b = false - } else if d.bd == mpTrue || d.bd == 1 { - b = true - } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) - return - } - d.bdRead = false - return -} - -func (d *msgpackDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { - if !d.bdRead { - d.readNextBd() - } - - // DecodeBytes could be from: bin str fixstr fixarray array ... - var clen int - vt := d.ContainerType() - switch vt { - case valueTypeBytes: - // valueTypeBytes may be a mpBin or an mpStr container - if bd := d.bd; bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { - clen = d.readContainerLen(msgpackContainerBin) - } else { - clen = d.readContainerLen(msgpackContainerStr) - } - case valueTypeString: - clen = d.readContainerLen(msgpackContainerStr) - case valueTypeArray: - clen = d.readContainerLen(msgpackContainerList) - // ensure everything after is one byte each - for i := 0; i < clen; i++ { - d.readNextBd() - if d.bd == mpNil { - bs = append(bs, 0) - } else if d.bd == mpUint8 { - bs = append(bs, d.r.readn1()) - } else { - d.d.errorf("cannot read non-byte into a byte array") - return - } - } - d.bdRead = false - return bs - default: - d.d.errorf("invalid container type: expecting bin|str|array") - return - } - - // these are (bin|str)(8|16|32) - // println("DecodeBytes: clen: ", clen) - d.bdRead = false - // bytes may be nil, so handle it. if nil, clen=-1. - if clen < 0 { - return nil - } - if zerocopy { - if d.br { - return d.r.readx(clen) - } else if len(bs) == 0 { - bs = d.b[:] - } - } - return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) -} - -func (d *msgpackDecDriver) DecodeString() (s string) { - return string(d.DecodeBytes(d.b[:], true)) -} - -func (d *msgpackDecDriver) DecodeStringAsBytes() (s []byte) { - return d.DecodeBytes(d.b[:], true) -} - -func (d *msgpackDecDriver) readNextBd() { - d.bd = d.r.readn1() - d.bdRead = true -} - -func (d *msgpackDecDriver) uncacheRead() { - if d.bdRead { - d.r.unreadn1() - d.bdRead = false - } -} - -func (d *msgpackDecDriver) ContainerType() (vt valueType) { - if !d.bdRead { - d.readNextBd() - } - bd := d.bd - if bd == mpNil { - return valueTypeNil - } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 || - (!d.h.RawToString && - (bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax))) { - return valueTypeBytes - } else if d.h.RawToString && - (bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax)) { - return valueTypeString - } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { - return valueTypeArray - } else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) { - return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) - } - return valueTypeUnset -} - -func (d *msgpackDecDriver) TryDecodeAsNil() (v bool) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == mpNil { - d.bdRead = false - v = true - } - return -} - -func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) { - bd := d.bd - if bd == mpNil { - clen = -1 // to represent nil - } else if bd == ct.b8 { - clen = int(d.r.readn1()) - } else if bd == ct.b16 { - clen = int(bigen.Uint16(d.r.readx(2))) - } else if bd == ct.b32 { - clen = int(bigen.Uint32(d.r.readx(4))) - } else if (ct.bFixMin & bd) == ct.bFixMin { - clen = int(ct.bFixMin ^ bd) - } else { - d.d.errorf("readContainerLen: %s: hex: %x, decimal: %d", msgBadDesc, bd, bd) - return - } - d.bdRead = false - return -} - -func (d *msgpackDecDriver) ReadMapStart() int { - if !d.bdRead { - d.readNextBd() - } - return d.readContainerLen(msgpackContainerMap) -} - -func (d *msgpackDecDriver) ReadArrayStart() int { - if !d.bdRead { - d.readNextBd() - } - return d.readContainerLen(msgpackContainerList) -} - -func (d *msgpackDecDriver) readExtLen() (clen int) { - switch d.bd { - case mpNil: - clen = -1 // to represent nil - case mpFixExt1: - clen = 1 - case mpFixExt2: - clen = 2 - case mpFixExt4: - clen = 4 - case mpFixExt8: - clen = 8 - case mpFixExt16: - clen = 16 - case mpExt8: - clen = int(d.r.readn1()) - case mpExt16: - clen = int(bigen.Uint16(d.r.readx(2))) - case mpExt32: - clen = int(bigen.Uint32(d.r.readx(4))) - default: - d.d.errorf("decoding ext bytes: found unexpected byte: %x", d.bd) - return - } - return -} - -func (d *msgpackDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { - if xtag > 0xff { - d.d.errorf("decodeExt: tag must be <= 0xff; got: %v", xtag) - return - } - realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) - realxtag = uint64(realxtag1) - if ext == nil { - re := rv.(*RawExt) - re.Tag = realxtag - re.Data = detachZeroCopyBytes(d.br, re.Data, xbs) - } else { - ext.ReadExt(rv, xbs) - } - return -} - -func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) { - if !d.bdRead { - d.readNextBd() - } - xbd := d.bd - if xbd == mpBin8 || xbd == mpBin16 || xbd == mpBin32 { - xbs = d.DecodeBytes(nil, true) - } else if xbd == mpStr8 || xbd == mpStr16 || xbd == mpStr32 || - (xbd >= mpFixStrMin && xbd <= mpFixStrMax) { - xbs = d.DecodeStringAsBytes() - } else { - clen := d.readExtLen() - xtag = d.r.readn1() - if verifyTag && xtag != tag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) - return - } - xbs = d.r.readx(clen) - } - d.bdRead = false - return -} - -//-------------------------------------------------- - -//MsgpackHandle is a Handle for the Msgpack Schema-Free Encoding Format. -type MsgpackHandle struct { - BasicHandle - - // RawToString controls how raw bytes are decoded into a nil interface{}. - RawToString bool - - // WriteExt flag supports encoding configured extensions with extension tags. - // It also controls whether other elements of the new spec are encoded (ie Str8). - // - // With WriteExt=false, configured extensions are serialized as raw bytes - // and Str8 is not encoded. - // - // A stream can still be decoded into a typed value, provided an appropriate value - // is provided, but the type cannot be inferred from the stream. If no appropriate - // type is provided (e.g. decoding into a nil interface{}), you get back - // a []byte or string based on the setting of RawToString. - WriteExt bool - binaryEncodingType - noElemSeparators -} - -func (h *MsgpackHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{b: ext}) -} - -func (h *MsgpackHandle) newEncDriver(e *Encoder) encDriver { - return &msgpackEncDriver{e: e, w: e.w, h: h} -} - -func (h *MsgpackHandle) newDecDriver(d *Decoder) decDriver { - return &msgpackDecDriver{d: d, h: h, r: d.r, br: d.bytes} -} - -func (e *msgpackEncDriver) reset() { - e.w = e.e.w -} - -func (d *msgpackDecDriver) reset() { - d.r, d.br = d.d.r, d.d.bytes - d.bd, d.bdRead = 0, false -} - -//-------------------------------------------------- - -type msgpackSpecRpcCodec struct { - rpcCodec -} - -// /////////////// Spec RPC Codec /////////////////// -func (c *msgpackSpecRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error { - // WriteRequest can write to both a Go service, and other services that do - // not abide by the 1 argument rule of a Go service. - // We discriminate based on if the body is a MsgpackSpecRpcMultiArgs - var bodyArr []interface{} - if m, ok := body.(MsgpackSpecRpcMultiArgs); ok { - bodyArr = ([]interface{})(m) - } else { - bodyArr = []interface{}{body} - } - r2 := []interface{}{0, uint32(r.Seq), r.ServiceMethod, bodyArr} - return c.write(r2, nil, false, true) -} - -func (c *msgpackSpecRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { - var moe interface{} - if r.Error != "" { - moe = r.Error - } - if moe != nil && body != nil { - body = nil - } - r2 := []interface{}{1, uint32(r.Seq), moe, body} - return c.write(r2, nil, false, true) -} - -func (c *msgpackSpecRpcCodec) ReadResponseHeader(r *rpc.Response) error { - return c.parseCustomHeader(1, &r.Seq, &r.Error) -} - -func (c *msgpackSpecRpcCodec) ReadRequestHeader(r *rpc.Request) error { - return c.parseCustomHeader(0, &r.Seq, &r.ServiceMethod) -} - -func (c *msgpackSpecRpcCodec) ReadRequestBody(body interface{}) error { - if body == nil { // read and discard - return c.read(nil) - } - bodyArr := []interface{}{body} - return c.read(&bodyArr) -} - -func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint64, methodOrError *string) (err error) { - - if c.isClosed() { - return io.EOF - } - - // We read the response header by hand - // so that the body can be decoded on its own from the stream at a later time. - - const fia byte = 0x94 //four item array descriptor value - // Not sure why the panic of EOF is swallowed above. - // if bs1 := c.dec.r.readn1(); bs1 != fia { - // err = fmt.Errorf("Unexpected value for array descriptor: Expecting %v. Received %v", fia, bs1) - // return - // } - var b byte - b, err = c.br.ReadByte() - if err != nil { - return - } - if b != fia { - err = fmt.Errorf("Unexpected value for array descriptor: Expecting %v. Received %v", fia, b) - return - } - - if err = c.read(&b); err != nil { - return - } - if b != expectTypeByte { - err = fmt.Errorf("Unexpected byte descriptor in header. Expecting %v. Received %v", expectTypeByte, b) - return - } - if err = c.read(msgid); err != nil { - return - } - if err = c.read(methodOrError); err != nil { - return - } - return -} - -//-------------------------------------------------- - -// msgpackSpecRpc is the implementation of Rpc that uses custom communication protocol -// as defined in the msgpack spec at https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md -type msgpackSpecRpc struct{} - -// MsgpackSpecRpc implements Rpc using the communication protocol defined in -// the msgpack spec at https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md . -// Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered. -var MsgpackSpecRpc msgpackSpecRpc - -func (x msgpackSpecRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { - return &msgpackSpecRpcCodec{newRPCCodec(conn, h)} -} - -func (x msgpackSpecRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec { - return &msgpackSpecRpcCodec{newRPCCodec(conn, h)} -} - -var _ decDriver = (*msgpackDecDriver)(nil) -var _ encDriver = (*msgpackEncDriver)(nil) diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/noop.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/noop.go deleted file mode 100644 index 015af581..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/noop.go +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build ignore - -package codec - -import ( - "math/rand" - "time" -) - -// NoopHandle returns a no-op handle. It basically does nothing. -// It is only useful for benchmarking, as it gives an idea of the -// overhead from the codec framework. -// -// LIBRARY USERS: *** DO NOT USE *** -func NoopHandle(slen int) *noopHandle { - h := noopHandle{} - h.rand = rand.New(rand.NewSource(time.Now().UnixNano())) - h.B = make([][]byte, slen) - h.S = make([]string, slen) - for i := 0; i < len(h.S); i++ { - b := make([]byte, i+1) - for j := 0; j < len(b); j++ { - b[j] = 'a' + byte(i) - } - h.B[i] = b - h.S[i] = string(b) - } - return &h -} - -// noopHandle does nothing. -// It is used to simulate the overhead of the codec framework. -type noopHandle struct { - BasicHandle - binaryEncodingType - noopDrv // noopDrv is unexported here, so we can get a copy of it when needed. -} - -type noopDrv struct { - d *Decoder - e *Encoder - i int - S []string - B [][]byte - mks []bool // stack. if map (true), else if array (false) - mk bool // top of stack. what container are we on? map or array? - ct valueType // last response for IsContainerType. - cb int // counter for ContainerType - rand *rand.Rand -} - -func (h *noopDrv) r(v int) int { return h.rand.Intn(v) } -func (h *noopDrv) m(v int) int { h.i++; return h.i % v } - -func (h *noopDrv) newEncDriver(e *Encoder) encDriver { h.e = e; return h } -func (h *noopDrv) newDecDriver(d *Decoder) decDriver { h.d = d; return h } - -func (h *noopDrv) reset() {} -func (h *noopDrv) uncacheRead() {} - -// --- encDriver - -// stack functions (for map and array) -func (h *noopDrv) start(b bool) { - // println("start", len(h.mks)+1) - h.mks = append(h.mks, b) - h.mk = b -} -func (h *noopDrv) end() { - // println("end: ", len(h.mks)-1) - h.mks = h.mks[:len(h.mks)-1] - if len(h.mks) > 0 { - h.mk = h.mks[len(h.mks)-1] - } else { - h.mk = false - } -} - -func (h *noopDrv) EncodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) EncodeNil() {} -func (h *noopDrv) EncodeInt(i int64) {} -func (h *noopDrv) EncodeUint(i uint64) {} -func (h *noopDrv) EncodeBool(b bool) {} -func (h *noopDrv) EncodeFloat32(f float32) {} -func (h *noopDrv) EncodeFloat64(f float64) {} -func (h *noopDrv) EncodeRawExt(re *RawExt, e *Encoder) {} -func (h *noopDrv) EncodeArrayStart(length int) { h.start(true) } -func (h *noopDrv) EncodeMapStart(length int) { h.start(false) } -func (h *noopDrv) EncodeEnd() { h.end() } - -func (h *noopDrv) EncodeString(c charEncoding, v string) {} -func (h *noopDrv) EncodeSymbol(v string) {} -func (h *noopDrv) EncodeStringBytes(c charEncoding, v []byte) {} - -func (h *noopDrv) EncodeExt(rv interface{}, xtag uint64, ext Ext, e *Encoder) {} - -// ---- decDriver -func (h *noopDrv) initReadNext() {} -func (h *noopDrv) CheckBreak() bool { return false } -func (h *noopDrv) IsBuiltinType(rt uintptr) bool { return false } -func (h *noopDrv) DecodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) DecodeInt(bitsize uint8) (i int64) { return int64(h.m(15)) } -func (h *noopDrv) DecodeUint(bitsize uint8) (ui uint64) { return uint64(h.m(35)) } -func (h *noopDrv) DecodeFloat(chkOverflow32 bool) (f float64) { return float64(h.m(95)) } -func (h *noopDrv) DecodeBool() (b bool) { return h.m(2) == 0 } -func (h *noopDrv) DecodeString() (s string) { return h.S[h.m(8)] } -func (h *noopDrv) DecodeStringAsBytes() []byte { return h.DecodeBytes(nil, true) } - -func (h *noopDrv) DecodeBytes(bs []byte, zerocopy bool) []byte { return h.B[h.m(len(h.B))] } - -func (h *noopDrv) ReadEnd() { h.end() } - -// toggle map/slice -func (h *noopDrv) ReadMapStart() int { h.start(true); return h.m(10) } -func (h *noopDrv) ReadArrayStart() int { h.start(false); return h.m(10) } - -func (h *noopDrv) ContainerType() (vt valueType) { - // return h.m(2) == 0 - // handle kStruct, which will bomb is it calls this and doesn't get back a map or array. - // consequently, if the return value is not map or array, reset it to one of them based on h.m(7) % 2 - // for kstruct: at least one out of every 2 times, return one of valueTypeMap or Array (else kstruct bombs) - // however, every 10th time it is called, we just return something else. - var vals = [...]valueType{valueTypeArray, valueTypeMap} - // ------------ TAKE ------------ - // if h.cb%2 == 0 { - // if h.ct == valueTypeMap || h.ct == valueTypeArray { - // } else { - // h.ct = vals[h.m(2)] - // } - // } else if h.cb%5 == 0 { - // h.ct = valueType(h.m(8)) - // } else { - // h.ct = vals[h.m(2)] - // } - // ------------ TAKE ------------ - // if h.cb%16 == 0 { - // h.ct = valueType(h.cb % 8) - // } else { - // h.ct = vals[h.cb%2] - // } - h.ct = vals[h.cb%2] - h.cb++ - return h.ct - - // if h.ct == valueTypeNil || h.ct == valueTypeString || h.ct == valueTypeBytes { - // return h.ct - // } - // return valueTypeUnset - // TODO: may need to tweak this so it works. - // if h.ct == valueTypeMap && vt == valueTypeArray || h.ct == valueTypeArray && vt == valueTypeMap { - // h.cb = !h.cb - // h.ct = vt - // return h.cb - // } - // // go in a loop and check it. - // h.ct = vt - // h.cb = h.m(7) == 0 - // return h.cb -} -func (h *noopDrv) TryDecodeAsNil() bool { - if h.mk { - return false - } else { - return h.m(8) == 0 - } -} -func (h *noopDrv) DecodeExt(rv interface{}, xtag uint64, ext Ext) uint64 { - return 0 -} - -func (h *noopDrv) DecodeNaked() { - // use h.r (random) not h.m() because h.m() could cause the same value to be given. - var sk int - if h.mk { - // if mapkey, do not support values of nil OR bytes, array, map or rawext - sk = h.r(7) + 1 - } else { - sk = h.r(12) - } - n := &h.d.n - switch sk { - case 0: - n.v = valueTypeNil - case 1: - n.v, n.b = valueTypeBool, false - case 2: - n.v, n.b = valueTypeBool, true - case 3: - n.v, n.i = valueTypeInt, h.DecodeInt(64) - case 4: - n.v, n.u = valueTypeUint, h.DecodeUint(64) - case 5: - n.v, n.f = valueTypeFloat, h.DecodeFloat(true) - case 6: - n.v, n.f = valueTypeFloat, h.DecodeFloat(false) - case 7: - n.v, n.s = valueTypeString, h.DecodeString() - case 8: - n.v, n.l = valueTypeBytes, h.B[h.m(len(h.B))] - case 9: - n.v = valueTypeArray - case 10: - n.v = valueTypeMap - default: - n.v = valueTypeExt - n.u = h.DecodeUint(64) - n.l = h.B[h.m(len(h.B))] - } - h.ct = n.v - return -} diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/rpc.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/rpc.go deleted file mode 100644 index 4c307804..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/rpc.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "bufio" - "errors" - "io" - "net/rpc" - "sync" -) - -// // rpcEncodeTerminator allows a handler specify a []byte terminator to send after each Encode. -// // -// // Some codecs like json need to put a space after each encoded value, to serve as a -// // delimiter for things like numbers (else json codec will continue reading till EOF). -// type rpcEncodeTerminator interface { -// rpcEncodeTerminate() []byte -// } - -// Rpc provides a rpc Server or Client Codec for rpc communication. -type Rpc interface { - ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec - ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec -} - -// RpcCodecBuffered allows access to the underlying bufio.Reader/Writer -// used by the rpc connection. It accommodates use-cases where the connection -// should be used by rpc and non-rpc functions, e.g. streaming a file after -// sending an rpc response. -type RpcCodecBuffered interface { - BufferedReader() *bufio.Reader - BufferedWriter() *bufio.Writer -} - -// ------------------------------------- - -// rpcCodec defines the struct members and common methods. -type rpcCodec struct { - rwc io.ReadWriteCloser - dec *Decoder - enc *Encoder - bw *bufio.Writer - br *bufio.Reader - mu sync.Mutex - h Handle - - cls bool - clsmu sync.RWMutex -} - -func newRPCCodec(conn io.ReadWriteCloser, h Handle) rpcCodec { - bw := bufio.NewWriter(conn) - br := bufio.NewReader(conn) - - // defensive: ensure that jsonH has TermWhitespace turned on. - if jsonH, ok := h.(*JsonHandle); ok && !jsonH.TermWhitespace { - panic(errors.New("rpc requires a JsonHandle with TermWhitespace set to true")) - } - - return rpcCodec{ - rwc: conn, - bw: bw, - br: br, - enc: NewEncoder(bw, h), - dec: NewDecoder(br, h), - h: h, - } -} - -func (c *rpcCodec) BufferedReader() *bufio.Reader { - return c.br -} - -func (c *rpcCodec) BufferedWriter() *bufio.Writer { - return c.bw -} - -func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2, doFlush bool) (err error) { - if c.isClosed() { - return io.EOF - } - if err = c.enc.Encode(obj1); err != nil { - return - } - // t, tOk := c.h.(rpcEncodeTerminator) - // if tOk { - // c.bw.Write(t.rpcEncodeTerminate()) - // } - if writeObj2 { - if err = c.enc.Encode(obj2); err != nil { - return - } - // if tOk { - // c.bw.Write(t.rpcEncodeTerminate()) - // } - } - if doFlush { - return c.bw.Flush() - } - return -} - -func (c *rpcCodec) read(obj interface{}) (err error) { - if c.isClosed() { - return io.EOF - } - //If nil is passed in, we should still attempt to read content to nowhere. - if obj == nil { - var obj2 interface{} - return c.dec.Decode(&obj2) - } - return c.dec.Decode(obj) -} - -func (c *rpcCodec) isClosed() bool { - c.clsmu.RLock() - x := c.cls - c.clsmu.RUnlock() - return x -} - -func (c *rpcCodec) Close() error { - if c.isClosed() { - return io.EOF - } - c.clsmu.Lock() - c.cls = true - c.clsmu.Unlock() - return c.rwc.Close() -} - -func (c *rpcCodec) ReadResponseBody(body interface{}) error { - return c.read(body) -} - -// ------------------------------------- - -type goRpcCodec struct { - rpcCodec -} - -func (c *goRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error { - // Must protect for concurrent access as per API - c.mu.Lock() - defer c.mu.Unlock() - return c.write(r, body, true, true) -} - -func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { - c.mu.Lock() - defer c.mu.Unlock() - return c.write(r, body, true, true) -} - -func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error { - return c.read(r) -} - -func (c *goRpcCodec) ReadRequestHeader(r *rpc.Request) error { - return c.read(r) -} - -func (c *goRpcCodec) ReadRequestBody(body interface{}) error { - return c.read(body) -} - -// ------------------------------------- - -// goRpc is the implementation of Rpc that uses the communication protocol -// as defined in net/rpc package. -type goRpc struct{} - -// GoRpc implements Rpc using the communication protocol defined in net/rpc package. -// Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered. -var GoRpc goRpc - -func (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { - return &goRpcCodec{newRPCCodec(conn, h)} -} - -func (x goRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec { - return &goRpcCodec{newRPCCodec(conn, h)} -} - -var _ RpcCodecBuffered = (*rpcCodec)(nil) // ensure *rpcCodec implements RpcCodecBuffered diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/simple.go deleted file mode 100644 index b69a15e7..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/simple.go +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "math" - "reflect" -) - -const ( - _ uint8 = iota - simpleVdNil = 1 - simpleVdFalse = 2 - simpleVdTrue = 3 - simpleVdFloat32 = 4 - simpleVdFloat64 = 5 - - // each lasts for 4 (ie n, n+1, n+2, n+3) - simpleVdPosInt = 8 - simpleVdNegInt = 12 - - // containers: each lasts for 4 (ie n, n+1, n+2, ... n+7) - simpleVdString = 216 - simpleVdByteArray = 224 - simpleVdArray = 232 - simpleVdMap = 240 - simpleVdExt = 248 -) - -type simpleEncDriver struct { - noBuiltInTypes - encDriverNoopContainerWriter - // encNoSeparator - e *Encoder - h *SimpleHandle - w encWriter - b [8]byte -} - -func (e *simpleEncDriver) EncodeNil() { - e.w.writen1(simpleVdNil) -} - -func (e *simpleEncDriver) EncodeBool(b bool) { - if b { - e.w.writen1(simpleVdTrue) - } else { - e.w.writen1(simpleVdFalse) - } -} - -func (e *simpleEncDriver) EncodeFloat32(f float32) { - e.w.writen1(simpleVdFloat32) - bigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f)) -} - -func (e *simpleEncDriver) EncodeFloat64(f float64) { - e.w.writen1(simpleVdFloat64) - bigenHelper{e.b[:8], e.w}.writeUint64(math.Float64bits(f)) -} - -func (e *simpleEncDriver) EncodeInt(v int64) { - if v < 0 { - e.encUint(uint64(-v), simpleVdNegInt) - } else { - e.encUint(uint64(v), simpleVdPosInt) - } -} - -func (e *simpleEncDriver) EncodeUint(v uint64) { - e.encUint(v, simpleVdPosInt) -} - -func (e *simpleEncDriver) encUint(v uint64, bd uint8) { - if v <= math.MaxUint8 { - e.w.writen2(bd, uint8(v)) - } else if v <= math.MaxUint16 { - e.w.writen1(bd + 1) - bigenHelper{e.b[:2], e.w}.writeUint16(uint16(v)) - } else if v <= math.MaxUint32 { - e.w.writen1(bd + 2) - bigenHelper{e.b[:4], e.w}.writeUint32(uint32(v)) - } else { // if v <= math.MaxUint64 { - e.w.writen1(bd + 3) - bigenHelper{e.b[:8], e.w}.writeUint64(v) - } -} - -func (e *simpleEncDriver) encLen(bd byte, length int) { - if length == 0 { - e.w.writen1(bd) - } else if length <= math.MaxUint8 { - e.w.writen1(bd + 1) - e.w.writen1(uint8(length)) - } else if length <= math.MaxUint16 { - e.w.writen1(bd + 2) - bigenHelper{e.b[:2], e.w}.writeUint16(uint16(length)) - } else if int64(length) <= math.MaxUint32 { - e.w.writen1(bd + 3) - bigenHelper{e.b[:4], e.w}.writeUint32(uint32(length)) - } else { - e.w.writen1(bd + 4) - bigenHelper{e.b[:8], e.w}.writeUint64(uint64(length)) - } -} - -func (e *simpleEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, _ *Encoder) { - bs := ext.WriteExt(rv) - if bs == nil { - e.EncodeNil() - return - } - e.encodeExtPreamble(uint8(xtag), len(bs)) - e.w.writeb(bs) -} - -func (e *simpleEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) { - e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) - e.w.writeb(re.Data) -} - -func (e *simpleEncDriver) encodeExtPreamble(xtag byte, length int) { - e.encLen(simpleVdExt, length) - e.w.writen1(xtag) -} - -func (e *simpleEncDriver) WriteArrayStart(length int) { - e.encLen(simpleVdArray, length) -} - -func (e *simpleEncDriver) WriteMapStart(length int) { - e.encLen(simpleVdMap, length) -} - -func (e *simpleEncDriver) EncodeString(c charEncoding, v string) { - e.encLen(simpleVdString, len(v)) - e.w.writestr(v) -} - -func (e *simpleEncDriver) EncodeSymbol(v string) { - e.EncodeString(c_UTF8, v) -} - -func (e *simpleEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - e.encLen(simpleVdByteArray, len(v)) - e.w.writeb(v) -} - -//------------------------------------ - -type simpleDecDriver struct { - d *Decoder - h *SimpleHandle - r decReader - bdRead bool - bd byte - br bool // bytes reader - b [scratchByteArrayLen]byte - noBuiltInTypes - // noStreamingCodec - decDriverNoopContainerReader -} - -func (d *simpleDecDriver) readNextBd() { - d.bd = d.r.readn1() - d.bdRead = true -} - -func (d *simpleDecDriver) uncacheRead() { - if d.bdRead { - d.r.unreadn1() - d.bdRead = false - } -} - -func (d *simpleDecDriver) ContainerType() (vt valueType) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == simpleVdNil { - return valueTypeNil - } else if d.bd == simpleVdByteArray || d.bd == simpleVdByteArray+1 || - d.bd == simpleVdByteArray+2 || d.bd == simpleVdByteArray+3 || d.bd == simpleVdByteArray+4 { - return valueTypeBytes - } else if d.bd == simpleVdString || d.bd == simpleVdString+1 || - d.bd == simpleVdString+2 || d.bd == simpleVdString+3 || d.bd == simpleVdString+4 { - return valueTypeString - } else if d.bd == simpleVdArray || d.bd == simpleVdArray+1 || - d.bd == simpleVdArray+2 || d.bd == simpleVdArray+3 || d.bd == simpleVdArray+4 { - return valueTypeArray - } else if d.bd == simpleVdMap || d.bd == simpleVdMap+1 || - d.bd == simpleVdMap+2 || d.bd == simpleVdMap+3 || d.bd == simpleVdMap+4 { - return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) - } - return valueTypeUnset -} - -func (d *simpleDecDriver) TryDecodeAsNil() bool { - if !d.bdRead { - d.readNextBd() - } - if d.bd == simpleVdNil { - d.bdRead = false - return true - } - return false -} - -func (d *simpleDecDriver) decCheckInteger() (ui uint64, neg bool) { - if !d.bdRead { - d.readNextBd() - } - switch d.bd { - case simpleVdPosInt: - ui = uint64(d.r.readn1()) - case simpleVdPosInt + 1: - ui = uint64(bigen.Uint16(d.r.readx(2))) - case simpleVdPosInt + 2: - ui = uint64(bigen.Uint32(d.r.readx(4))) - case simpleVdPosInt + 3: - ui = uint64(bigen.Uint64(d.r.readx(8))) - case simpleVdNegInt: - ui = uint64(d.r.readn1()) - neg = true - case simpleVdNegInt + 1: - ui = uint64(bigen.Uint16(d.r.readx(2))) - neg = true - case simpleVdNegInt + 2: - ui = uint64(bigen.Uint32(d.r.readx(4))) - neg = true - case simpleVdNegInt + 3: - ui = uint64(bigen.Uint64(d.r.readx(8))) - neg = true - default: - d.d.errorf("decIntAny: Integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd) - return - } - // don't do this check, because callers may only want the unsigned value. - // if ui > math.MaxInt64 { - // d.d.errorf("decIntAny: Integer out of range for signed int64: %v", ui) - // return - // } - return -} - -func (d *simpleDecDriver) DecodeInt(bitsize uint8) (i int64) { - ui, neg := d.decCheckInteger() - i, overflow := chkOvf.SignedInt(ui) - if overflow { - d.d.errorf("simple: overflow converting %v to signed integer", ui) - return - } - if neg { - i = -i - } - if chkOvf.Int(i, bitsize) { - d.d.errorf("simple: overflow integer: %v", i) - return - } - d.bdRead = false - return -} - -func (d *simpleDecDriver) DecodeUint(bitsize uint8) (ui uint64) { - ui, neg := d.decCheckInteger() - if neg { - d.d.errorf("Assigning negative signed value to unsigned type") - return - } - if chkOvf.Uint(ui, bitsize) { - d.d.errorf("simple: overflow integer: %v", ui) - return - } - d.bdRead = false - return -} - -func (d *simpleDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == simpleVdFloat32 { - f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) - } else if d.bd == simpleVdFloat64 { - f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) - } else { - if d.bd >= simpleVdPosInt && d.bd <= simpleVdNegInt+3 { - f = float64(d.DecodeInt(64)) - } else { - d.d.errorf("Float only valid from float32/64: Invalid descriptor: %v", d.bd) - return - } - } - if chkOverflow32 && chkOvf.Float32(f) { - d.d.errorf("msgpack: float32 overflow: %v", f) - return - } - d.bdRead = false - return -} - -// bool can be decoded from bool only (single byte). -func (d *simpleDecDriver) DecodeBool() (b bool) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == simpleVdTrue { - b = true - } else if d.bd == simpleVdFalse { - } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) - return - } - d.bdRead = false - return -} - -func (d *simpleDecDriver) ReadMapStart() (length int) { - if !d.bdRead { - d.readNextBd() - } - d.bdRead = false - return d.decLen() -} - -func (d *simpleDecDriver) ReadArrayStart() (length int) { - if !d.bdRead { - d.readNextBd() - } - d.bdRead = false - return d.decLen() -} - -func (d *simpleDecDriver) decLen() int { - switch d.bd % 8 { - case 0: - return 0 - case 1: - return int(d.r.readn1()) - case 2: - return int(bigen.Uint16(d.r.readx(2))) - case 3: - ui := uint64(bigen.Uint32(d.r.readx(4))) - if chkOvf.Uint(ui, intBitsize) { - d.d.errorf("simple: overflow integer: %v", ui) - return 0 - } - return int(ui) - case 4: - ui := bigen.Uint64(d.r.readx(8)) - if chkOvf.Uint(ui, intBitsize) { - d.d.errorf("simple: overflow integer: %v", ui) - return 0 - } - return int(ui) - } - d.d.errorf("decLen: Cannot read length: bd%%8 must be in range 0..4. Got: %d", d.bd%8) - return -1 -} - -func (d *simpleDecDriver) DecodeString() (s string) { - return string(d.DecodeBytes(d.b[:], true)) -} - -func (d *simpleDecDriver) DecodeStringAsBytes() (s []byte) { - return d.DecodeBytes(d.b[:], true) -} - -func (d *simpleDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { - if !d.bdRead { - d.readNextBd() - } - if d.bd == simpleVdNil { - d.bdRead = false - return - } - clen := d.decLen() - d.bdRead = false - if zerocopy { - if d.br { - return d.r.readx(clen) - } else if len(bs) == 0 { - bs = d.b[:] - } - } - return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) -} - -func (d *simpleDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { - if xtag > 0xff { - d.d.errorf("decodeExt: tag must be <= 0xff; got: %v", xtag) - return - } - realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) - realxtag = uint64(realxtag1) - if ext == nil { - re := rv.(*RawExt) - re.Tag = realxtag - re.Data = detachZeroCopyBytes(d.br, re.Data, xbs) - } else { - ext.ReadExt(rv, xbs) - } - return -} - -func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) { - if !d.bdRead { - d.readNextBd() - } - switch d.bd { - case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: - l := d.decLen() - xtag = d.r.readn1() - if verifyTag && xtag != tag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) - return - } - xbs = d.r.readx(l) - case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - xbs = d.DecodeBytes(nil, true) - default: - d.d.errorf("Invalid d.bd for extensions (Expecting extensions or byte array). Got: 0x%x", d.bd) - return - } - d.bdRead = false - return -} - -func (d *simpleDecDriver) DecodeNaked() { - if !d.bdRead { - d.readNextBd() - } - - n := d.d.n - var decodeFurther bool - - switch d.bd { - case simpleVdNil: - n.v = valueTypeNil - case simpleVdFalse: - n.v = valueTypeBool - n.b = false - case simpleVdTrue: - n.v = valueTypeBool - n.b = true - case simpleVdPosInt, simpleVdPosInt + 1, simpleVdPosInt + 2, simpleVdPosInt + 3: - if d.h.SignedInteger { - n.v = valueTypeInt - n.i = d.DecodeInt(64) - } else { - n.v = valueTypeUint - n.u = d.DecodeUint(64) - } - case simpleVdNegInt, simpleVdNegInt + 1, simpleVdNegInt + 2, simpleVdNegInt + 3: - n.v = valueTypeInt - n.i = d.DecodeInt(64) - case simpleVdFloat32: - n.v = valueTypeFloat - n.f = d.DecodeFloat(true) - case simpleVdFloat64: - n.v = valueTypeFloat - n.f = d.DecodeFloat(false) - case simpleVdString, simpleVdString + 1, simpleVdString + 2, simpleVdString + 3, simpleVdString + 4: - n.v = valueTypeString - n.s = d.DecodeString() - case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) - case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: - n.v = valueTypeExt - l := d.decLen() - n.u = uint64(d.r.readn1()) - n.l = d.r.readx(l) - case simpleVdArray, simpleVdArray + 1, simpleVdArray + 2, simpleVdArray + 3, simpleVdArray + 4: - n.v = valueTypeArray - decodeFurther = true - case simpleVdMap, simpleVdMap + 1, simpleVdMap + 2, simpleVdMap + 3, simpleVdMap + 4: - n.v = valueTypeMap - decodeFurther = true - default: - d.d.errorf("decodeNaked: Unrecognized d.bd: 0x%x", d.bd) - } - - if !decodeFurther { - d.bdRead = false - } - return -} - -//------------------------------------ - -// SimpleHandle is a Handle for a very simple encoding format. -// -// simple is a simplistic codec similar to binc, but not as compact. -// - Encoding of a value is always preceded by the descriptor byte (bd) -// - True, false, nil are encoded fully in 1 byte (the descriptor) -// - Integers (intXXX, uintXXX) are encoded in 1, 2, 4 or 8 bytes (plus a descriptor byte). -// There are positive (uintXXX and intXXX >= 0) and negative (intXXX < 0) integers. -// - Floats are encoded in 4 or 8 bytes (plus a descriptor byte) -// - Lenght of containers (strings, bytes, array, map, extensions) -// are encoded in 0, 1, 2, 4 or 8 bytes. -// Zero-length containers have no length encoded. -// For others, the number of bytes is given by pow(2, bd%3) -// - maps are encoded as [bd] [length] [[key][value]]... -// - arrays are encoded as [bd] [length] [value]... -// - extensions are encoded as [bd] [length] [tag] [byte]... -// - strings/bytearrays are encoded as [bd] [length] [byte]... -// -// The full spec will be published soon. -type SimpleHandle struct { - BasicHandle - binaryEncodingType - noElemSeparators -} - -func (h *SimpleHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{b: ext}) -} - -func (h *SimpleHandle) newEncDriver(e *Encoder) encDriver { - return &simpleEncDriver{e: e, w: e.w, h: h} -} - -func (h *SimpleHandle) newDecDriver(d *Decoder) decDriver { - return &simpleDecDriver{d: d, h: h, r: d.r, br: d.bytes} -} - -func (e *simpleEncDriver) reset() { - e.w = e.e.w -} - -func (d *simpleDecDriver) reset() { - d.r, d.br = d.d.r, d.d.bytes - d.bd, d.bdRead = 0, false -} - -var _ decDriver = (*simpleDecDriver)(nil) -var _ encDriver = (*simpleEncDriver)(nil) diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/time.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/time.go deleted file mode 100644 index 55841d4c..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/time.go +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import ( - "fmt" - "time" -) - -var timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - -type timeExt struct{} - -func (x timeExt) WriteExt(v interface{}) (bs []byte) { - switch v2 := v.(type) { - case time.Time: - bs = encodeTime(v2) - case *time.Time: - bs = encodeTime(*v2) - default: - panic(fmt.Errorf("unsupported format for time conversion: expecting time.Time; got %T", v2)) - } - return -} -func (x timeExt) ReadExt(v interface{}, bs []byte) { - tt, err := decodeTime(bs) - if err != nil { - panic(err) - } - *(v.(*time.Time)) = tt -} - -func (x timeExt) ConvertExt(v interface{}) interface{} { - return x.WriteExt(v) -} -func (x timeExt) UpdateExt(v interface{}, src interface{}) { - x.ReadExt(v, src.([]byte)) -} - -// EncodeTime encodes a time.Time as a []byte, including -// information on the instant in time and UTC offset. -// -// Format Description -// -// A timestamp is composed of 3 components: -// -// - secs: signed integer representing seconds since unix epoch -// - nsces: unsigned integer representing fractional seconds as a -// nanosecond offset within secs, in the range 0 <= nsecs < 1e9 -// - tz: signed integer representing timezone offset in minutes east of UTC, -// and a dst (daylight savings time) flag -// -// When encoding a timestamp, the first byte is the descriptor, which -// defines which components are encoded and how many bytes are used to -// encode secs and nsecs components. *If secs/nsecs is 0 or tz is UTC, it -// is not encoded in the byte array explicitly*. -// -// Descriptor 8 bits are of the form `A B C DDD EE`: -// A: Is secs component encoded? 1 = true -// B: Is nsecs component encoded? 1 = true -// C: Is tz component encoded? 1 = true -// DDD: Number of extra bytes for secs (range 0-7). -// If A = 1, secs encoded in DDD+1 bytes. -// If A = 0, secs is not encoded, and is assumed to be 0. -// If A = 1, then we need at least 1 byte to encode secs. -// DDD says the number of extra bytes beyond that 1. -// E.g. if DDD=0, then secs is represented in 1 byte. -// if DDD=2, then secs is represented in 3 bytes. -// EE: Number of extra bytes for nsecs (range 0-3). -// If B = 1, nsecs encoded in EE+1 bytes (similar to secs/DDD above) -// -// Following the descriptor bytes, subsequent bytes are: -// -// secs component encoded in `DDD + 1` bytes (if A == 1) -// nsecs component encoded in `EE + 1` bytes (if B == 1) -// tz component encoded in 2 bytes (if C == 1) -// -// secs and nsecs components are integers encoded in a BigEndian -// 2-complement encoding format. -// -// tz component is encoded as 2 bytes (16 bits). Most significant bit 15 to -// Least significant bit 0 are described below: -// -// Timezone offset has a range of -12:00 to +14:00 (ie -720 to +840 minutes). -// Bit 15 = have\_dst: set to 1 if we set the dst flag. -// Bit 14 = dst\_on: set to 1 if dst is in effect at the time, or 0 if not. -// Bits 13..0 = timezone offset in minutes. It is a signed integer in Big Endian format. -// -func encodeTime(t time.Time) []byte { - //t := rv.Interface().(time.Time) - tsecs, tnsecs := t.Unix(), t.Nanosecond() - var ( - bd byte - btmp [8]byte - bs [16]byte - i int = 1 - ) - l := t.Location() - if l == time.UTC { - l = nil - } - if tsecs != 0 { - bd = bd | 0x80 - bigen.PutUint64(btmp[:], uint64(tsecs)) - f := pruneSignExt(btmp[:], tsecs >= 0) - bd = bd | (byte(7-f) << 2) - copy(bs[i:], btmp[f:]) - i = i + (8 - f) - } - if tnsecs != 0 { - bd = bd | 0x40 - bigen.PutUint32(btmp[:4], uint32(tnsecs)) - f := pruneSignExt(btmp[:4], true) - bd = bd | byte(3-f) - copy(bs[i:], btmp[f:4]) - i = i + (4 - f) - } - if l != nil { - bd = bd | 0x20 - // Note that Go Libs do not give access to dst flag. - _, zoneOffset := t.Zone() - //zoneName, zoneOffset := t.Zone() - zoneOffset /= 60 - z := uint16(zoneOffset) - bigen.PutUint16(btmp[:2], z) - // clear dst flags - bs[i] = btmp[0] & 0x3f - bs[i+1] = btmp[1] - i = i + 2 - } - bs[0] = bd - return bs[0:i] -} - -// DecodeTime decodes a []byte into a time.Time. -func decodeTime(bs []byte) (tt time.Time, err error) { - bd := bs[0] - var ( - tsec int64 - tnsec uint32 - tz uint16 - i byte = 1 - i2 byte - n byte - ) - if bd&(1<<7) != 0 { - var btmp [8]byte - n = ((bd >> 2) & 0x7) + 1 - i2 = i + n - copy(btmp[8-n:], bs[i:i2]) - //if first bit of bs[i] is set, then fill btmp[0..8-n] with 0xff (ie sign extend it) - if bs[i]&(1<<7) != 0 { - copy(btmp[0:8-n], bsAll0xff) - //for j,k := byte(0), 8-n; j < k; j++ { btmp[j] = 0xff } - } - i = i2 - tsec = int64(bigen.Uint64(btmp[:])) - } - if bd&(1<<6) != 0 { - var btmp [4]byte - n = (bd & 0x3) + 1 - i2 = i + n - copy(btmp[4-n:], bs[i:i2]) - i = i2 - tnsec = bigen.Uint32(btmp[:]) - } - if bd&(1<<5) == 0 { - tt = time.Unix(tsec, int64(tnsec)).UTC() - return - } - // In stdlib time.Parse, when a date is parsed without a zone name, it uses "" as zone name. - // However, we need name here, so it can be shown when time is printed. - // Zone name is in form: UTC-08:00. - // Note that Go Libs do not give access to dst flag, so we ignore dst bits - - i2 = i + 2 - tz = bigen.Uint16(bs[i:i2]) - i = i2 - // sign extend sign bit into top 2 MSB (which were dst bits): - if tz&(1<<13) == 0 { // positive - tz = tz & 0x3fff //clear 2 MSBs: dst bits - } else { // negative - tz = tz | 0xc000 //set 2 MSBs: dst bits - //tzname[3] = '-' (TODO: verify. this works here) - } - tzint := int16(tz) - if tzint == 0 { - tt = time.Unix(tsec, int64(tnsec)).UTC() - } else { - // For Go Time, do not use a descriptive timezone. - // It's unnecessary, and makes it harder to do a reflect.DeepEqual. - // The Offset already tells what the offset should be, if not on UTC and unknown zone name. - // var zoneName = timeLocUTCName(tzint) - tt = time.Unix(tsec, int64(tnsec)).In(time.FixedZone("", int(tzint)*60)) - } - return -} - -// func timeLocUTCName(tzint int16) string { -// if tzint == 0 { -// return "UTC" -// } -// var tzname = []byte("UTC+00:00") -// //tzname := fmt.Sprintf("UTC%s%02d:%02d", tzsign, tz/60, tz%60) //perf issue using Sprintf. inline below. -// //tzhr, tzmin := tz/60, tz%60 //faster if u convert to int first -// var tzhr, tzmin int16 -// if tzint < 0 { -// tzname[3] = '-' // (TODO: verify. this works here) -// tzhr, tzmin = -tzint/60, (-tzint)%60 -// } else { -// tzhr, tzmin = tzint/60, tzint%60 -// } -// tzname[4] = timeDigits[tzhr/10] -// tzname[5] = timeDigits[tzhr%10] -// tzname[7] = timeDigits[tzmin/10] -// tzname[8] = timeDigits[tzmin%10] -// return string(tzname) -// //return time.FixedZone(string(tzname), int(tzint)*60) -// } diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/xml.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/xml.go deleted file mode 100644 index 9386775d..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/xml.go +++ /dev/null @@ -1,426 +0,0 @@ -// +build ignore - -package codec - -import "reflect" - -/* - -A strict Non-validating namespace-aware XML 1.0 parser and (en|de)coder. - -We are attempting this due to perceived issues with encoding/xml: - - Complicated. It tried to do too much, and is not as simple to use as json. - - Due to over-engineering, reflection is over-used AND performance suffers: - java is 6X faster:http://fabsk.eu/blog/category/informatique/dev/golang/ - even PYTHON performs better: http://outgoing.typepad.com/outgoing/2014/07/exploring-golang.html - -codec framework will offer the following benefits - - VASTLY improved performance (when using reflection-mode or codecgen) - - simplicity and consistency: with the rest of the supported formats - - all other benefits of codec framework (streaming, codegeneration, etc) - -codec is not a drop-in replacement for encoding/xml. -It is a replacement, based on the simplicity and performance of codec. -Look at it like JAXB for Go. - -Challenges: - - - Need to output XML preamble, with all namespaces at the right location in the output. - - Each "end" block is dynamic, so we need to maintain a context-aware stack - - How to decide when to use an attribute VS an element - - How to handle chardata, attr, comment EXPLICITLY. - - Should it output fragments? - e.g. encoding a bool should just output true OR false, which is not well-formed XML. - -Extend the struct tag. See representative example: - type X struct { - ID uint8 codec:"xid|http://ugorji.net/x-namespace id,omitempty,toarray,attr,cdata" - } - -Based on this, we encode - - fields as elements, BUT encode as attributes if struct tag contains ",attr". - - text as entity-escaped text, BUT encode as CDATA if struct tag contains ",cdata". - -In this mode, we only encode as attribute if ",attr" is found, and only encode as CDATA -if ",cdata" is found in the struct tag. - -To handle namespaces: - - XMLHandle is denoted as being namespace-aware. - Consequently, we WILL use the ns:name pair to encode and decode if defined, else use the plain name. - - *Encoder and *Decoder know whether the Handle "prefers" namespaces. - - add *Encoder.getEncName(*structFieldInfo). - No one calls *structFieldInfo.indexForEncName directly anymore - - add *Decoder.getStructFieldInfo(encName string) // encName here is either like abc, or h1:nsabc - No one accesses .encName anymore except in - - let encode.go and decode.go use these (for consistency) - - only problem exists for gen.go, where we create a big switch on encName. - Now, we also have to add a switch on strings.endsWith(kName, encNsName) - - gen.go will need to have many more methods, and then double-on the 2 switch loops like: - switch k { - case "abc" : x.abc() - case "def" : x.def() - default { - switch { - case !nsAware: panic(...) - case strings.endsWith("nsabc"): x.abc() - default: panic(...) - } - } - } - -The structure below accomodates this: - - type typeInfo struct { - sfi []*structFieldInfo // sorted by encName - sfins // sorted by namespace - sfia // sorted, to have those with attributes at the top. Needed to write XML appropriately. - sfip // unsorted - } - type structFieldInfo struct { - encName - nsEncName - ns string - attr bool - cdata bool - } - -indexForEncName is now an internal helper function that takes a sorted array -(one of ti.sfins or ti.sfi). It is only used by *Encoder.getStructFieldInfo(...) - -There will be a separate parser from the builder. -The parser will have a method: next() xmlToken method. - -xmlToken has fields: - - type uint8: 0 | ElementStart | ElementEnd | AttrKey | AttrVal | Text - - value string - - ns string - -SEE: http://www.xml.com/pub/a/98/10/guide0.html?page=3#ENTDECL - -The following are skipped when parsing: - - External Entities (from external file) - - Notation Declaration e.g. - - Entity Declarations & References - - XML Declaration (assume UTF-8) - - XML Directive i.e. - - Other Declarations: Notation, etc. - - Comment - - Processing Instruction - - schema / DTD for validation: - We are not a VALIDATING parser. Validation is done elsewhere. - However, some parts of the DTD internal subset are used (SEE BELOW). - For Attribute List Declarations e.g. - - We considered using the ATTLIST to get "default" value, but not to validate the contents. (VETOED) - -The following XML features are supported - - Namespace - - Element - - Attribute - - cdata - - Unicode escape - -The following DTD (when as an internal sub-set) features are supported: - - Internal Entities e.g. - AND entities for the set: [<>&"'] - - Parameter entities e.g. - - -At decode time, a structure containing the following is kept - - namespace mapping - - default attribute values - - all internal entities (<>&"' and others written in the document) - -When decode starts, it parses XML namespace declarations and creates a map in the -xmlDecDriver. While parsing, that map continously gets updated. -The only problem happens when a namespace declaration happens on the node that it defines. -e.g. -To handle this, each Element must be fully parsed at a time, -even if it amounts to multiple tokens which are returned one at a time on request. - -xmlns is a special attribute name. - - It is used to define namespaces, including the default - - It is never returned as an AttrKey or AttrVal. - *We may decide later to allow user to use it e.g. you want to parse the xmlns mappings into a field.* - -Number, bool, null, mapKey, etc can all be decoded from any xmlToken. -This accomodates map[int]string for example. - -It should be possible to create a schema from the types, -or vice versa (generate types from schema with appropriate tags). -This is however out-of-scope from this parsing project. - -We should write all namespace information at the first point that it is referenced in the tree, -and use the mapping for all child nodes and attributes. This means that state is maintained -at a point in the tree. This also means that calls to Decode or MustDecode will reset some state. - -When decoding, it is important to keep track of entity references and default attribute values. -It seems these can only be stored in the DTD components. We should honor them when decoding. - -Configuration for XMLHandle will look like this: - - XMLHandle - DefaultNS string - // Encoding: - NS map[string]string // ns URI to key, used for encoding - // Decoding: in case ENTITY declared in external schema or dtd, store info needed here - Entities map[string]string // map of entity rep to character - - -During encode, if a namespace mapping is not defined for a namespace found on a struct, -then we create a mapping for it using nsN (where N is 1..1000000, and doesn't conflict -with any other namespace mapping). - -Note that different fields in a struct can have different namespaces. -However, all fields will default to the namespace on the _struct field (if defined). - -An XML document is a name, a map of attributes and a list of children. -Consequently, we cannot "DecodeNaked" into a map[string]interface{} (for example). -We have to "DecodeNaked" into something that resembles XML data. - -To support DecodeNaked (decode into nil interface{}) we have to define some "supporting" types: - type Name struct { // Prefered. Less allocations due to conversions. - Local string - Space string - } - type Element struct { - Name Name - Attrs map[Name]string - Children []interface{} // each child is either *Element or string - } -Only two "supporting" types are exposed for XML: Name and Element. - -We considered 'type Name string' where Name is like "Space Local" (space-separated). -We decided against it, because each creation of a name would lead to -double allocation (first convert []byte to string, then concatenate them into a string). -The benefit is that it is faster to read Attrs from a map. But given that Element is a value -object, we want to eschew methods and have public exposed variables. - -We also considered the following, where xml types were not value objects, and we used -intelligent accessor methods to extract information and for performance. -*** WE DECIDED AGAINST THIS. *** - type Attr struct { - Name Name - Value string - } - // Element is a ValueObject: There are no accessor methods. - // Make element self-contained. - type Element struct { - Name Name - attrsMap map[string]string // where key is "Space Local" - attrs []Attr - childrenT []string - childrenE []Element - childrenI []int // each child is a index into T or E. - } - func (x *Element) child(i) interface{} // returns string or *Element - -Per XML spec and our default handling, white space is insignificant between elements, -specifically between parent-child or siblings. White space occuring alone between start -and end element IS significant. However, if xml:space='preserve', then we 'preserve' -all whitespace. This is more critical when doing a DecodeNaked, but MAY not be as critical -when decoding into a typed value. - -**Note: there is no xml: namespace. The xml: attributes were defined before namespaces.** -**So treat them as just "directives" that should be interpreted to mean something**. - -On encoding, we don't add any prettifying markup (indenting, etc). - -A document or element can only be encoded/decoded from/to a struct. In this mode: - - struct name maps to element name (or tag-info from _struct field) - - fields are mapped to child elements or attributes - -A map is either encoded as attributes on current element, or as a set of child elements. -Maps are encoded as attributes iff their keys and values are primitives (number, bool, string). - -A list is encoded as a set of child elements. - -Primitives (number, bool, string) are encoded as an element, attribute or text -depending on the context. - -Extensions must encode themselves as a text string. - -Encoding is tough, specifically when encoding mappings, because we need to encode -as either attribute or element. To do this, we need to default to encoding as attributes, -and then let Encoder inform the Handle when to start encoding as nodes. -i.e. Encoder does something like: - - h.EncodeMapStart() - h.Encode(), h.Encode(), ... - h.EncodeMapNotAttrSignal() // this is not a bool, because it's a signal - h.Encode(), h.Encode(), ... - h.EncodeEnd() - -Only XMLHandle understands this, and will set itself to start encoding as elements. - -This support extends to maps. For example, if a struct field is a map, and it has -the struct tag signifying it should be attr, then all its fields are encoded as attributes. -e.g. - - type X struct { - M map[string]int `codec:"m,attr"` // encode as attributes - } - -Question: - - if encoding a map, what if map keys have spaces in them??? - Then they cannot be attributes or child elements. Error. - -Misc: - - - For attribute values, normalize by trimming beginning and ending white space, - and converting every white space sequence to a single space. - - ATTLIST restrictions are enforced. - e.g. default value of xml:space, skipping xml:XYZ style attributes, etc. - - Consider supporting NON-STRICT mode (e.g. to handle HTML parsing). - Some elements e.g. br, hr, etc need not close and should be auto-closed - ... (see http://www.w3.org/TR/html4/loose.dtd) - An expansive set of entities are pre-defined. - - Have easy way to create a HTML parser: - add a HTML() method to XMLHandle, that will set Strict=false, specify AutoClose, - and add HTML Entities to the list. - - Support validating element/attribute XMLName before writing it. - Keep this behind a flag, which is set to false by default (for performance). - type XMLHandle struct { - CheckName bool - } - -ROADMAP (1 weeks): - - build encoder (1 day) - - build decoder (based off xmlParser) (1 day) - - implement xmlParser (2 days). - Look at encoding/xml for inspiration. - - integrate and TEST (1 days) - - write article and post it (1 day) - - -*/ - -// ----------- PARSER ------------------- - -type xmlTokenType uint8 - -const ( - _ xmlTokenType = iota << 1 - xmlTokenElemStart - xmlTokenElemEnd - xmlTokenAttrKey - xmlTokenAttrVal - xmlTokenText -) - -type xmlToken struct { - Type xmlTokenType - Value string - Namespace string // blank for AttrVal and Text -} - -type xmlParser struct { - r decReader - toks []xmlToken // list of tokens. - ptr int // ptr into the toks slice - done bool // nothing else to parse. r now returns EOF. -} - -func (x *xmlParser) next() (t *xmlToken) { - // once x.done, or x.ptr == len(x.toks) == 0, then return nil (to signify finish) - if !x.done && len(x.toks) == 0 { - x.nextTag() - } - // parses one element at a time (into possible many tokens) - if x.ptr < len(x.toks) { - t = &(x.toks[x.ptr]) - x.ptr++ - if x.ptr == len(x.toks) { - x.ptr = 0 - x.toks = x.toks[:0] - } - } - return -} - -// nextTag will parses the next element and fill up toks. -// It set done flag if/once EOF is reached. -func (x *xmlParser) nextTag() { - // TODO: implement. -} - -// ----------- ENCODER ------------------- - -type xmlEncDriver struct { - e *Encoder - w encWriter - h *XMLHandle - b [64]byte // scratch - bs []byte // scratch - // s jsonStack - noBuiltInTypes -} - -// ----------- DECODER ------------------- - -type xmlDecDriver struct { - d *Decoder - h *XMLHandle - r decReader // *bytesDecReader decReader - ct valueType // container type. one of unset, array or map. - bstr [8]byte // scratch used for string \UXXX parsing - b [64]byte // scratch - - // wsSkipped bool // whitespace skipped - - // s jsonStack - - noBuiltInTypes -} - -// DecodeNaked will decode into an XMLNode - -// XMLName is a value object representing a namespace-aware NAME -type XMLName struct { - Local string - Space string -} - -// XMLNode represents a "union" of the different types of XML Nodes. -// Only one of fields (Text or *Element) is set. -type XMLNode struct { - Element *Element - Text string -} - -// XMLElement is a value object representing an fully-parsed XML element. -type XMLElement struct { - Name Name - Attrs map[XMLName]string - // Children is a list of child nodes, each being a *XMLElement or string - Children []XMLNode -} - -// ----------- HANDLE ------------------- - -type XMLHandle struct { - BasicHandle - textEncodingType - - DefaultNS string - NS map[string]string // ns URI to key, for encoding - Entities map[string]string // entity representation to string, for encoding. -} - -func (h *XMLHandle) newEncDriver(e *Encoder) encDriver { - return &xmlEncDriver{e: e, w: e.w, h: h} -} - -func (h *XMLHandle) newDecDriver(d *Decoder) decDriver { - // d := xmlDecDriver{r: r.(*bytesDecReader), h: h} - hd := xmlDecDriver{d: d, r: d.r, h: h} - hd.n.bytes = d.b[:] - return &hd -} - -func (h *XMLHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{i: ext}) -} - -var _ decDriver = (*xmlDecDriver)(nil) -var _ encDriver = (*xmlEncDriver)(nil) diff --git a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/z.go b/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/z.go deleted file mode 100644 index b6ac0769..00000000 --- a/vendor/github.com/coreos/etcd/vendor/github.com/ugorji/go/codec/z.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -package codec - -import "sort" - -// TODO: this is brittle, as it depends on z.go's init() being called last. -// The current build tools all honor that files are passed in lexical order. -// However, we should consider using an init_channel, -// that each person doing init will write to. - -func init() { - if !useLookupRecognizedTypes { - return - } - sort.Sort(uintptrSlice(recognizedRtids)) - sort.Sort(uintptrSlice(recognizedRtidPtrs)) - recognizedRtidOrPtrs = make([]uintptr, len(recognizedRtids)+len(recognizedRtidPtrs)) - copy(recognizedRtidOrPtrs, recognizedRtids) - copy(recognizedRtidOrPtrs[len(recognizedRtids):], recognizedRtidPtrs) - sort.Sort(uintptrSlice(recognizedRtidOrPtrs)) -} diff --git a/vendor/github.com/coreos/etcd/version/LICENSE b/vendor/github.com/coreos/etcd/version/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/coreos/etcd/version/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/version/version.go b/vendor/github.com/coreos/etcd/version/version.go deleted file mode 100644 index c55a8357..00000000 --- a/vendor/github.com/coreos/etcd/version/version.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package version implements etcd version parsing and contains latest version -// information. -package version - -import ( - "fmt" - "strings" - - "github.com/coreos/go-semver/semver" -) - -var ( - // MinClusterVersion is the min cluster version this etcd binary is compatible with. - MinClusterVersion = "3.0.0" - Version = "3.3.0+git" - APIVersion = "unknown" - - // Git SHA Value will be set during build - GitSHA = "Not provided (use ./build instead of go build)" -) - -func init() { - ver, err := semver.NewVersion(Version) - if err == nil { - APIVersion = fmt.Sprintf("%d.%d", ver.Major, ver.Minor) - } -} - -type Versions struct { - Server string `json:"etcdserver"` - Cluster string `json:"etcdcluster"` - // TODO: raft state machine version -} - -// Cluster only keeps the major.minor. -func Cluster(v string) string { - vs := strings.Split(v, ".") - if len(vs) <= 2 { - return v - } - return fmt.Sprintf("%s.%s", vs[0], vs[1]) -} diff --git a/vendor/github.com/daaku/go.zipexe/license b/vendor/github.com/daaku/go.zipexe/license deleted file mode 100644 index 6a2f15c1..00000000 --- a/vendor/github.com/daaku/go.zipexe/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright © 2012-2015 Carlos Castillo - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the “Software”), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/daaku/go.zipexe/zipexe.go b/vendor/github.com/daaku/go.zipexe/zipexe.go deleted file mode 100644 index 60046062..00000000 --- a/vendor/github.com/daaku/go.zipexe/zipexe.go +++ /dev/null @@ -1,142 +0,0 @@ -// Package zipexe attempts to open an executable binary file as a zip file. -package zipexe - -import ( - "archive/zip" - "debug/elf" - "debug/macho" - "debug/pe" - "errors" - "io" - "os" -) - -// Opens a zip file by path. -func Open(path string) (*zip.Reader, error) { - _, rd, err := OpenCloser(path) - return rd, err -} - -// OpenCloser is like Open but returns an additional Closer to avoid leaking open files. -func OpenCloser(path string) (io.Closer, *zip.Reader, error) { - file, err := os.Open(path) - if err != nil { - return nil, nil, err - } - finfo, err := file.Stat() - if err != nil { - return nil, nil, err - } - zr, err := NewReader(file, finfo.Size()) - if err != nil { - return nil, nil, err - } - return file, zr, nil -} - -// Open a zip file, specially handling various binaries that may have been -// augmented with zip data. -func NewReader(rda io.ReaderAt, size int64) (*zip.Reader, error) { - handlers := []func(io.ReaderAt, int64) (*zip.Reader, error){ - zip.NewReader, - zipExeReaderMacho, - zipExeReaderElf, - zipExeReaderPe, - } - - for _, handler := range handlers { - zfile, err := handler(rda, size) - if err == nil { - return zfile, nil - } - } - return nil, errors.New("Couldn't Open As Executable") -} - -// zipExeReaderMacho treats the file as a Mach-O binary -// (Mac OS X / Darwin executable) and attempts to find a zip archive. -func zipExeReaderMacho(rda io.ReaderAt, size int64) (*zip.Reader, error) { - file, err := macho.NewFile(rda) - if err != nil { - return nil, err - } - - var max int64 - for _, load := range file.Loads { - seg, ok := load.(*macho.Segment) - if ok { - // Check if the segment contains a zip file - if zfile, err := zip.NewReader(seg, int64(seg.Filesz)); err == nil { - return zfile, nil - } - - // Otherwise move end of file pointer - end := int64(seg.Offset + seg.Filesz) - if end > max { - max = end - } - } - } - - // No zip file within binary, try appended to end - section := io.NewSectionReader(rda, max, size-max) - return zip.NewReader(section, section.Size()) -} - -// zipExeReaderPe treats the file as a Portable Exectuable binary -// (Windows executable) and attempts to find a zip archive. -func zipExeReaderPe(rda io.ReaderAt, size int64) (*zip.Reader, error) { - file, err := pe.NewFile(rda) - if err != nil { - return nil, err - } - - var max int64 - for _, sec := range file.Sections { - // Check if this section has a zip file - if zfile, err := zip.NewReader(sec, int64(sec.Size)); err == nil { - return zfile, nil - } - - // Otherwise move end of file pointer - end := int64(sec.Offset + sec.Size) - if end > max { - max = end - } - } - - // No zip file within binary, try appended to end - section := io.NewSectionReader(rda, max, size-max) - return zip.NewReader(section, section.Size()) -} - -// zipExeReaderElf treats the file as a ELF binary -// (linux/BSD/etc... executable) and attempts to find a zip archive. -func zipExeReaderElf(rda io.ReaderAt, size int64) (*zip.Reader, error) { - file, err := elf.NewFile(rda) - if err != nil { - return nil, err - } - - var max int64 - for _, sect := range file.Sections { - if sect.Type == elf.SHT_NOBITS { - continue - } - - // Check if this section has a zip file - if zfile, err := zip.NewReader(sect, int64(sect.Size)); err == nil { - return zfile, nil - } - - // Otherwise move end of file pointer - end := int64(sect.Offset + sect.Size) - if end > max { - max = end - } - } - - // No zip file within binary, try appended to end - section := io.NewSectionReader(rda, max, size-max) - return zip.NewReader(section, section.Size()) -} diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE new file mode 100644 index 00000000..c8364161 --- /dev/null +++ b/vendor/github.com/davecgh/go-spew/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2012-2016 Dave Collins + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/davecgh/go-spew/spew/LICENSE b/vendor/github.com/davecgh/go-spew/spew/LICENSE deleted file mode 100644 index c8364161..00000000 --- a/vendor/github.com/davecgh/go-spew/spew/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2012-2016 Dave Collins - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/dfordsoft/golib/LICENSE b/vendor/github.com/dfordsoft/golib/LICENSE new file mode 100644 index 00000000..0d9b5ada --- /dev/null +++ b/vendor/github.com/dfordsoft/golib/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 DForD Software + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/dfordsoft/golib/ic/LICENSE b/vendor/github.com/dfordsoft/golib/ic/LICENSE deleted file mode 100644 index 0d9b5ada..00000000 --- a/vendor/github.com/dfordsoft/golib/ic/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 DForD Software - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/dgrijalva/jwt-go/.gitignore b/vendor/github.com/dgrijalva/jwt-go/.gitignore new file mode 100644 index 00000000..80bed650 --- /dev/null +++ b/vendor/github.com/dgrijalva/jwt-go/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +bin + + diff --git a/vendor/github.com/dgrijalva/jwt-go/.travis.yml b/vendor/github.com/dgrijalva/jwt-go/.travis.yml new file mode 100644 index 00000000..1027f56c --- /dev/null +++ b/vendor/github.com/dgrijalva/jwt-go/.travis.yml @@ -0,0 +1,13 @@ +language: go + +script: + - go vet ./... + - go test -v ./... + +go: + - 1.3 + - 1.4 + - 1.5 + - 1.6 + - 1.7 + - tip diff --git a/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md b/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md new file mode 100644 index 00000000..7fc1f793 --- /dev/null +++ b/vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md @@ -0,0 +1,97 @@ +## Migration Guide from v2 -> v3 + +Version 3 adds several new, frequently requested features. To do so, it introduces a few breaking changes. We've worked to keep these as minimal as possible. This guide explains the breaking changes and how you can quickly update your code. + +### `Token.Claims` is now an interface type + +The most requested feature from the 2.0 verison of this library was the ability to provide a custom type to the JSON parser for claims. This was implemented by introducing a new interface, `Claims`, to replace `map[string]interface{}`. We also included two concrete implementations of `Claims`: `MapClaims` and `StandardClaims`. + +`MapClaims` is an alias for `map[string]interface{}` with built in validation behavior. It is the default claims type when using `Parse`. The usage is unchanged except you must type cast the claims property. + +The old example for parsing a token looked like this.. + +```go + if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { + fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) + } +``` + +is now directly mapped to... + +```go + if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil { + claims := token.Claims.(jwt.MapClaims) + fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) + } +``` + +`StandardClaims` is designed to be embedded in your custom type. You can supply a custom claims type with the new `ParseWithClaims` function. Here's an example of using a custom claims type. + +```go + type MyCustomClaims struct { + User string + *StandardClaims + } + + if token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, keyLookupFunc); err == nil { + claims := token.Claims.(*MyCustomClaims) + fmt.Printf("Token for user %v expires %v", claims.User, claims.StandardClaims.ExpiresAt) + } +``` + +### `ParseFromRequest` has been moved + +To keep this library focused on the tokens without becoming overburdened with complex request processing logic, `ParseFromRequest` and its new companion `ParseFromRequestWithClaims` have been moved to a subpackage, `request`. The method signatues have also been augmented to receive a new argument: `Extractor`. + +`Extractors` do the work of picking the token string out of a request. The interface is simple and composable. + +This simple parsing example: + +```go + if token, err := jwt.ParseFromRequest(tokenString, req, keyLookupFunc); err == nil { + fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"]) + } +``` + +is directly mapped to: + +```go + if token, err := request.ParseFromRequest(req, request.OAuth2Extractor, keyLookupFunc); err == nil { + claims := token.Claims.(jwt.MapClaims) + fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"]) + } +``` + +There are several concrete `Extractor` types provided for your convenience: + +* `HeaderExtractor` will search a list of headers until one contains content. +* `ArgumentExtractor` will search a list of keys in request query and form arguments until one contains content. +* `MultiExtractor` will try a list of `Extractors` in order until one returns content. +* `AuthorizationHeaderExtractor` will look in the `Authorization` header for a `Bearer` token. +* `OAuth2Extractor` searches the places an OAuth2 token would be specified (per the spec): `Authorization` header and `access_token` argument +* `PostExtractionFilter` wraps an `Extractor`, allowing you to process the content before it's parsed. A simple example is stripping the `Bearer ` text from a header + + +### RSA signing methods no longer accept `[]byte` keys + +Due to a [critical vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/), we've decided the convenience of accepting `[]byte` instead of `rsa.PublicKey` or `rsa.PrivateKey` isn't worth the risk of misuse. + +To replace this behavior, we've added two helper methods: `ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)` and `ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)`. These are just simple helpers for unpacking PEM encoded PKCS1 and PKCS8 keys. If your keys are encoded any other way, all you need to do is convert them to the `crypto/rsa` package's types. + +```go + func keyLookupFunc(*Token) (interface{}, error) { + // Don't forget to validate the alg is what you expect: + if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { + return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) + } + + // Look up key + key, err := lookupPublicKey(token.Header["kid"]) + if err != nil { + return nil, err + } + + // Unpack key from PEM encoded PKCS8 + return jwt.ParseRSAPublicKeyFromPEM(key) + } +``` diff --git a/vendor/github.com/dgrijalva/jwt-go/README.md b/vendor/github.com/dgrijalva/jwt-go/README.md new file mode 100644 index 00000000..70bae69e --- /dev/null +++ b/vendor/github.com/dgrijalva/jwt-go/README.md @@ -0,0 +1,85 @@ +A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html) + +[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go) + +**BREAKING CHANGES:*** Version 3.0.0 is here. It includes _a lot_ of changes including a few that break the API. We've tried to break as few things as possible, so there should just be a few type signature changes. A full list of breaking changes is available in `VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating your code. + +**NOTICE:** It's important that you [validate the `alg` presented is what you expect](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/). This library attempts to make it easy to do the right thing by requiring key types match the expected alg, but you should take the extra step to verify it in your usage. See the examples provided. + + +## What the heck is a JWT? + +JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens. + +In short, it's a signed JSON object that does something useful (for example, authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is made of three parts, separated by `.`'s. The first two parts are JSON objects, that have been [base64url](http://tools.ietf.org/html/rfc4648) encoded. The last part is the signature, encoded the same way. + +The first part is called the header. It contains the necessary information for verifying the last part, the signature. For example, which encryption method was used for signing and what key was used. + +The part in the middle is the interesting bit. It's called the Claims and contains the actual stuff you care about. Refer to [the RFC](http://self-issued.info/docs/draft-jones-json-web-token.html) for information about reserved keys and the proper way to add your own. + +## What's in the box? + +This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own. + +## Examples + +See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage: + +* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac) +* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac) +* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples) + +## Extensions + +This library publishes all the necessary components for adding your own signing methods. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`. + +Here's an example of an extension that integrates with the Google App Engine signing tools: https://github.com/someone1/gcp-jwt-go + +## Compliance + +This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.org/info/rfc7519) dated May 2015 with a few notable differences: + +* In order to protect against accidental use of [Unsecured JWTs](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#UnsecuredJWT), tokens using `alg=none` will only be accepted if the constant `jwt.UnsafeAllowNoneSignatureType` is provided as the key. + +## Project Status & Versioning + +This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few backwards-incompatible changes outside of major version updates (and only with good reason). + +This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull requests will land on `master`. Periodically, versions will be tagged from `master`. You can find all the releases on [the project releases page](https://github.com/dgrijalva/jwt-go/releases). + +While we try to make it obvious when we make breaking changes, there isn't a great mechanism for pushing announcements out to users. You may want to use this alternative package include: `gopkg.in/dgrijalva/jwt-go.v2`. It will do the right thing WRT semantic versioning. + +## Usage Tips + +### Signing vs Encryption + +A token is simply a JSON object that is signed by its author. this tells you exactly two things about the data: + +* The author of the token was in the possession of the signing secret +* The data has not been modified since it was signed + +It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library. + +### Choosing a Signing Method + +There are several signing methods available, and you should probably take the time to learn about the various options before choosing one. The principal design decision is most likely going to be symmetric vs asymmetric. + +Symmetric signing methods, such as HSA, use only a single secret. This is probably the simplest signing method to use since any `[]byte` can be used as a valid secret. They are also slightly computationally faster to use, though this rarely is enough to matter. Symmetric signing methods work the best when both producers and consumers of tokens are trusted, or even the same system. Since the same secret is used to both sign and validate tokens, you can't easily distribute the key for validation. + +Asymmetric signing methods, such as RSA, use different keys for signing and verifying tokens. This makes it possible to produce tokens with a private key, and allow any consumer to access the public key for verification. + +### JWT and OAuth + +It's worth mentioning that OAuth and JWT are not the same thing. A JWT token is simply a signed JSON object. It can be used anywhere such a thing is useful. There is some confusion, though, as JWT is the most common type of bearer token used in OAuth2 authentication. + +Without going too far down the rabbit hole, here's a description of the interaction of these technologies: + +* OAuth is a protocol for allowing an identity provider to be separate from the service a user is logging in to. For example, whenever you use Facebook to log into a different service (Yelp, Spotify, etc), you are using OAuth. +* OAuth defines several options for passing around authentication data. One popular method is called a "bearer token". A bearer token is simply a string that _should_ only be held by an authenticated user. Thus, simply presenting this token proves your identity. You can probably derive from here why a JWT might make a good bearer token. +* Because bearer tokens are used for authentication, it's important they're kept secret. This is why transactions that use bearer tokens typically happen over SSL. + +## More + +Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go). + +The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in to documentation. diff --git a/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md b/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md new file mode 100644 index 00000000..b605b450 --- /dev/null +++ b/vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md @@ -0,0 +1,105 @@ +## `jwt-go` Version History + +#### 3.0.0 + +* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code + * Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods. + * `ParseFromRequest` has been moved to `request` subpackage and usage has changed + * The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims. +* Other Additions and Changes + * Added `Claims` interface type to allow users to decode the claims into a custom type + * Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into. + * Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage + * Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims` + * Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`. + * Added several new, more specific, validation errors to error type bitmask + * Moved examples from README to executable example files + * Signing method registry is now thread safe + * Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser) + +#### 2.7.0 + +This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes. + +* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying +* Error text for expired tokens includes how long it's been expired +* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM` +* Documentation updates + +#### 2.6.0 + +* Exposed inner error within ValidationError +* Fixed validation errors when using UseJSONNumber flag +* Added several unit tests + +#### 2.5.0 + +* Added support for signing method none. You shouldn't use this. The API tries to make this clear. +* Updated/fixed some documentation +* Added more helpful error message when trying to parse tokens that begin with `BEARER ` + +#### 2.4.0 + +* Added new type, Parser, to allow for configuration of various parsing parameters + * You can now specify a list of valid signing methods. Anything outside this set will be rejected. + * You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON +* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go) +* Fixed some bugs with ECDSA parsing + +#### 2.3.0 + +* Added support for ECDSA signing methods +* Added support for RSA PSS signing methods (requires go v1.4) + +#### 2.2.0 + +* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`. Result will now be the parsed token and an error, instead of a panic. + +#### 2.1.0 + +Backwards compatible API change that was missed in 2.0.0. + +* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte` + +#### 2.0.0 + +There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change. + +The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`. + +It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`. + +* **Compatibility Breaking Changes** + * `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct` + * `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct` + * `KeyFunc` now returns `interface{}` instead of `[]byte` + * `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key + * `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key +* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type. + * Added public package global `SigningMethodHS256` + * Added public package global `SigningMethodHS384` + * Added public package global `SigningMethodHS512` +* Renamed type `SigningMethodRS256` to `SigningMethodRSA`. Specific sizes are now just instances of this type. + * Added public package global `SigningMethodRS256` + * Added public package global `SigningMethodRS384` + * Added public package global `SigningMethodRS512` +* Moved sample private key for HMAC tests from an inline value to a file on disk. Value is unchanged. +* Refactored the RSA implementation to be easier to read +* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM` + +#### 1.0.2 + +* Fixed bug in parsing public keys from certificates +* Added more tests around the parsing of keys for RS256 +* Code refactoring in RS256 implementation. No functional changes + +#### 1.0.1 + +* Fixed panic if RS256 signing method was passed an invalid key + +#### 1.0.0 + +* First versioned release +* API stabilized +* Supports creating, signing, parsing, and validating JWT tokens +* Supports RS256 and HS256 signing methods \ No newline at end of file diff --git a/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go b/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go deleted file mode 100644 index 727182a9..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go +++ /dev/null @@ -1,282 +0,0 @@ -// A useful example app. You can use this to debug your tokens on the command line. -// This is also a great place to look at how you might use this library. -// -// Example usage: -// The following will create and sign a token, then verify it and output the original claims. -// echo {\"foo\":\"bar\"} | bin/jwt -key test/sample_key -alg RS256 -sign - | bin/jwt -key test/sample_key.pub -verify - -package main - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "io/ioutil" - "os" - "regexp" - "strings" - - jwt "github.com/dgrijalva/jwt-go" -) - -var ( - // Options - flagAlg = flag.String("alg", "", "signing algorithm identifier") - flagKey = flag.String("key", "", "path to key file or '-' to read from stdin") - flagCompact = flag.Bool("compact", false, "output compact JSON") - flagDebug = flag.Bool("debug", false, "print out all kinds of debug data") - flagClaims = make(ArgList) - flagHead = make(ArgList) - - // Modes - exactly one of these is required - flagSign = flag.String("sign", "", "path to claims object to sign, '-' to read from stdin, or '+' to use only -claim args") - flagVerify = flag.String("verify", "", "path to JWT token to verify or '-' to read from stdin") - flagShow = flag.String("show", "", "path to JWT file or '-' to read from stdin") -) - -func main() { - // Plug in Var flags - flag.Var(flagClaims, "claim", "add additional claims. may be used more than once") - flag.Var(flagHead, "header", "add additional header params. may be used more than once") - - // Usage message if you ask for -help or if you mess up inputs. - flag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - fmt.Fprintf(os.Stderr, " One of the following flags is required: sign, verify\n") - flag.PrintDefaults() - } - - // Parse command line options - flag.Parse() - - // Do the thing. If something goes wrong, print error to stderr - // and exit with a non-zero status code - if err := start(); err != nil { - fmt.Fprintf(os.Stderr, "Error: %v\n", err) - os.Exit(1) - } -} - -// Figure out which thing to do and then do that -func start() error { - if *flagSign != "" { - return signToken() - } else if *flagVerify != "" { - return verifyToken() - } else if *flagShow != "" { - return showToken() - } else { - flag.Usage() - return fmt.Errorf("None of the required flags are present. What do you want me to do?") - } -} - -// Helper func: Read input from specified file or stdin -func loadData(p string) ([]byte, error) { - if p == "" { - return nil, fmt.Errorf("No path specified") - } - - var rdr io.Reader - if p == "-" { - rdr = os.Stdin - } else if p == "+" { - return []byte("{}"), nil - } else { - if f, err := os.Open(p); err == nil { - rdr = f - defer f.Close() - } else { - return nil, err - } - } - return ioutil.ReadAll(rdr) -} - -// Print a json object in accordance with the prophecy (or the command line options) -func printJSON(j interface{}) error { - var out []byte - var err error - - if *flagCompact == false { - out, err = json.MarshalIndent(j, "", " ") - } else { - out, err = json.Marshal(j) - } - - if err == nil { - fmt.Println(string(out)) - } - - return err -} - -// Verify a token and output the claims. This is a great example -// of how to verify and view a token. -func verifyToken() error { - // get the token - tokData, err := loadData(*flagVerify) - if err != nil { - return fmt.Errorf("Couldn't read token: %v", err) - } - - // trim possible whitespace from token - tokData = regexp.MustCompile(`\s*$`).ReplaceAll(tokData, []byte{}) - if *flagDebug { - fmt.Fprintf(os.Stderr, "Token len: %v bytes\n", len(tokData)) - } - - // Parse the token. Load the key from command line option - token, err := jwt.Parse(string(tokData), func(t *jwt.Token) (interface{}, error) { - data, err := loadData(*flagKey) - if err != nil { - return nil, err - } - if isEs() { - return jwt.ParseECPublicKeyFromPEM(data) - } else if isRs() { - return jwt.ParseRSAPublicKeyFromPEM(data) - } - return data, nil - }) - - // Print some debug data - if *flagDebug && token != nil { - fmt.Fprintf(os.Stderr, "Header:\n%v\n", token.Header) - fmt.Fprintf(os.Stderr, "Claims:\n%v\n", token.Claims) - } - - // Print an error if we can't parse for some reason - if err != nil { - return fmt.Errorf("Couldn't parse token: %v", err) - } - - // Is token invalid? - if !token.Valid { - return fmt.Errorf("Token is invalid") - } - - // Print the token details - if err := printJSON(token.Claims); err != nil { - return fmt.Errorf("Failed to output claims: %v", err) - } - - return nil -} - -// Create, sign, and output a token. This is a great, simple example of -// how to use this library to create and sign a token. -func signToken() error { - // get the token data from command line arguments - tokData, err := loadData(*flagSign) - if err != nil { - return fmt.Errorf("Couldn't read token: %v", err) - } else if *flagDebug { - fmt.Fprintf(os.Stderr, "Token: %v bytes", len(tokData)) - } - - // parse the JSON of the claims - var claims jwt.MapClaims - if err := json.Unmarshal(tokData, &claims); err != nil { - return fmt.Errorf("Couldn't parse claims JSON: %v", err) - } - - // add command line claims - if len(flagClaims) > 0 { - for k, v := range flagClaims { - claims[k] = v - } - } - - // get the key - var key interface{} - key, err = loadData(*flagKey) - if err != nil { - return fmt.Errorf("Couldn't read key: %v", err) - } - - // get the signing alg - alg := jwt.GetSigningMethod(*flagAlg) - if alg == nil { - return fmt.Errorf("Couldn't find signing method: %v", *flagAlg) - } - - // create a new token - token := jwt.NewWithClaims(alg, claims) - - // add command line headers - if len(flagHead) > 0 { - for k, v := range flagHead { - token.Header[k] = v - } - } - - if isEs() { - if k, ok := key.([]byte); !ok { - return fmt.Errorf("Couldn't convert key data to key") - } else { - key, err = jwt.ParseECPrivateKeyFromPEM(k) - if err != nil { - return err - } - } - } else if isRs() { - if k, ok := key.([]byte); !ok { - return fmt.Errorf("Couldn't convert key data to key") - } else { - key, err = jwt.ParseRSAPrivateKeyFromPEM(k) - if err != nil { - return err - } - } - } - - if out, err := token.SignedString(key); err == nil { - fmt.Println(out) - } else { - return fmt.Errorf("Error signing token: %v", err) - } - - return nil -} - -// showToken pretty-prints the token on the command line. -func showToken() error { - // get the token - tokData, err := loadData(*flagShow) - if err != nil { - return fmt.Errorf("Couldn't read token: %v", err) - } - - // trim possible whitespace from token - tokData = regexp.MustCompile(`\s*$`).ReplaceAll(tokData, []byte{}) - if *flagDebug { - fmt.Fprintf(os.Stderr, "Token len: %v bytes\n", len(tokData)) - } - - token, err := jwt.Parse(string(tokData), nil) - if token == nil { - return fmt.Errorf("malformed token: %v", err) - } - - // Print the token details - fmt.Println("Header:") - if err := printJSON(token.Header); err != nil { - return fmt.Errorf("Failed to output header: %v", err) - } - - fmt.Println("Claims:") - if err := printJSON(token.Claims); err != nil { - return fmt.Errorf("Failed to output claims: %v", err) - } - - return nil -} - -func isEs() bool { - return strings.HasPrefix(*flagAlg, "ES") -} - -func isRs() bool { - return strings.HasPrefix(*flagAlg, "RS") -} diff --git a/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/args.go b/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/args.go deleted file mode 100644 index a5bba5b1..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/args.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "strings" -) - -type ArgList map[string]string - -func (l ArgList) String() string { - data, _ := json.Marshal(l) - return string(data) -} - -func (l ArgList) Set(arg string) error { - parts := strings.SplitN(arg, "=", 2) - if len(parts) != 2 { - return fmt.Errorf("Invalid argument '%v'. Must use format 'key=value'. %v", arg, parts) - } - l[parts[0]] = parts[1] - return nil -} diff --git a/vendor/github.com/dgrijalva/jwt-go/request/doc.go b/vendor/github.com/dgrijalva/jwt-go/request/doc.go deleted file mode 100644 index c01069c9..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/request/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Utility package for extracting JWT tokens from -// HTTP requests. -// -// The main function is ParseFromRequest and it's WithClaims variant. -// See examples for how to use the various Extractor implementations -// or roll your own. -package request diff --git a/vendor/github.com/dgrijalva/jwt-go/request/extractor.go b/vendor/github.com/dgrijalva/jwt-go/request/extractor.go deleted file mode 100644 index 14414fe2..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/request/extractor.go +++ /dev/null @@ -1,81 +0,0 @@ -package request - -import ( - "errors" - "net/http" -) - -// Errors -var ( - ErrNoTokenInRequest = errors.New("no token present in request") -) - -// Interface for extracting a token from an HTTP request. -// The ExtractToken method should return a token string or an error. -// If no token is present, you must return ErrNoTokenInRequest. -type Extractor interface { - ExtractToken(*http.Request) (string, error) -} - -// Extractor for finding a token in a header. Looks at each specified -// header in order until there's a match -type HeaderExtractor []string - -func (e HeaderExtractor) ExtractToken(req *http.Request) (string, error) { - // loop over header names and return the first one that contains data - for _, header := range e { - if ah := req.Header.Get(header); ah != "" { - return ah, nil - } - } - return "", ErrNoTokenInRequest -} - -// Extract token from request arguments. This includes a POSTed form or -// GET URL arguments. Argument names are tried in order until there's a match. -// This extractor calls `ParseMultipartForm` on the request -type ArgumentExtractor []string - -func (e ArgumentExtractor) ExtractToken(req *http.Request) (string, error) { - // Make sure form is parsed - req.ParseMultipartForm(10e6) - - // loop over arg names and return the first one that contains data - for _, arg := range e { - if ah := req.Form.Get(arg); ah != "" { - return ah, nil - } - } - - return "", ErrNoTokenInRequest -} - -// Tries Extractors in order until one returns a token string or an error occurs -type MultiExtractor []Extractor - -func (e MultiExtractor) ExtractToken(req *http.Request) (string, error) { - // loop over header names and return the first one that contains data - for _, extractor := range e { - if tok, err := extractor.ExtractToken(req); tok != "" { - return tok, nil - } else if err != ErrNoTokenInRequest { - return "", err - } - } - return "", ErrNoTokenInRequest -} - -// Wrap an Extractor in this to post-process the value before it's handed off. -// See AuthorizationHeaderExtractor for an example -type PostExtractionFilter struct { - Extractor - Filter func(string) (string, error) -} - -func (e *PostExtractionFilter) ExtractToken(req *http.Request) (string, error) { - if tok, err := e.Extractor.ExtractToken(req); tok != "" { - return e.Filter(tok) - } else { - return "", err - } -} diff --git a/vendor/github.com/dgrijalva/jwt-go/request/oauth2.go b/vendor/github.com/dgrijalva/jwt-go/request/oauth2.go deleted file mode 100644 index 5948694a..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/request/oauth2.go +++ /dev/null @@ -1,28 +0,0 @@ -package request - -import ( - "strings" -) - -// Strips 'Bearer ' prefix from bearer token string -func stripBearerPrefixFromTokenString(tok string) (string, error) { - // Should be a bearer token - if len(tok) > 6 && strings.ToUpper(tok[0:7]) == "BEARER " { - return tok[7:], nil - } - return tok, nil -} - -// Extract bearer token from Authorization header -// Uses PostExtractionFilter to strip "Bearer " prefix from header -var AuthorizationHeaderExtractor = &PostExtractionFilter{ - HeaderExtractor{"Authorization"}, - stripBearerPrefixFromTokenString, -} - -// Extractor for OAuth2 access tokens. Looks in 'Authorization' -// header then 'access_token' argument for a token. -var OAuth2Extractor = &MultiExtractor{ - AuthorizationHeaderExtractor, - ArgumentExtractor{"access_token"}, -} diff --git a/vendor/github.com/dgrijalva/jwt-go/request/request.go b/vendor/github.com/dgrijalva/jwt-go/request/request.go deleted file mode 100644 index 1807b396..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/request/request.go +++ /dev/null @@ -1,24 +0,0 @@ -package request - -import ( - "github.com/dgrijalva/jwt-go" - "net/http" -) - -// Extract and parse a JWT token from an HTTP request. -// This behaves the same as Parse, but accepts a request and an extractor -// instead of a token string. The Extractor interface allows you to define -// the logic for extracting a token. Several useful implementations are provided. -func ParseFromRequest(req *http.Request, extractor Extractor, keyFunc jwt.Keyfunc) (token *jwt.Token, err error) { - return ParseFromRequestWithClaims(req, extractor, jwt.MapClaims{}, keyFunc) -} - -// ParseFromRequest but with custom Claims type -func ParseFromRequestWithClaims(req *http.Request, extractor Extractor, claims jwt.Claims, keyFunc jwt.Keyfunc) (token *jwt.Token, err error) { - // Extract token from request - if tokStr, err := extractor.ExtractToken(req); err == nil { - return jwt.ParseWithClaims(tokStr, claims, keyFunc) - } else { - return nil, err - } -} diff --git a/vendor/github.com/dgrijalva/jwt-go/test/helpers.go b/vendor/github.com/dgrijalva/jwt-go/test/helpers.go deleted file mode 100644 index f84c3ef6..00000000 --- a/vendor/github.com/dgrijalva/jwt-go/test/helpers.go +++ /dev/null @@ -1,42 +0,0 @@ -package test - -import ( - "crypto/rsa" - "github.com/dgrijalva/jwt-go" - "io/ioutil" -) - -func LoadRSAPrivateKeyFromDisk(location string) *rsa.PrivateKey { - keyData, e := ioutil.ReadFile(location) - if e != nil { - panic(e.Error()) - } - key, e := jwt.ParseRSAPrivateKeyFromPEM(keyData) - if e != nil { - panic(e.Error()) - } - return key -} - -func LoadRSAPublicKeyFromDisk(location string) *rsa.PublicKey { - keyData, e := ioutil.ReadFile(location) - if e != nil { - panic(e.Error()) - } - key, e := jwt.ParseRSAPublicKeyFromPEM(keyData) - if e != nil { - panic(e.Error()) - } - return key -} - -func MakeSampleToken(c jwt.Claims, key interface{}) string { - token := jwt.NewWithClaims(jwt.SigningMethodRS256, c) - s, e := token.SignedString(key) - - if e != nil { - panic(e.Error()) - } - - return s -} diff --git a/vendor/github.com/facebookgo/clock/LICENSE b/vendor/github.com/facebookgo/clock/LICENSE deleted file mode 100644 index ce212cb1..00000000 --- a/vendor/github.com/facebookgo/clock/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ben Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/facebookgo/clock/clock.go b/vendor/github.com/facebookgo/clock/clock.go deleted file mode 100644 index bca1a7ba..00000000 --- a/vendor/github.com/facebookgo/clock/clock.go +++ /dev/null @@ -1,363 +0,0 @@ -package clock - -import ( - "runtime" - "sort" - "sync" - "time" -) - -// Clock represents an interface to the functions in the standard library time -// package. Two implementations are available in the clock package. The first -// is a real-time clock which simply wraps the time package's functions. The -// second is a mock clock which will only make forward progress when -// programmatically adjusted. -type Clock interface { - After(d time.Duration) <-chan time.Time - AfterFunc(d time.Duration, f func()) *Timer - Now() time.Time - Sleep(d time.Duration) - Tick(d time.Duration) <-chan time.Time - Ticker(d time.Duration) *Ticker - Timer(d time.Duration) *Timer -} - -// New returns an instance of a real-time clock. -func New() Clock { - return &clock{} -} - -// clock implements a real-time clock by simply wrapping the time package functions. -type clock struct{} - -func (c *clock) After(d time.Duration) <-chan time.Time { return time.After(d) } - -func (c *clock) AfterFunc(d time.Duration, f func()) *Timer { - return &Timer{timer: time.AfterFunc(d, f)} -} - -func (c *clock) Now() time.Time { return time.Now() } - -func (c *clock) Sleep(d time.Duration) { time.Sleep(d) } - -func (c *clock) Tick(d time.Duration) <-chan time.Time { return time.Tick(d) } - -func (c *clock) Ticker(d time.Duration) *Ticker { - t := time.NewTicker(d) - return &Ticker{C: t.C, ticker: t} -} - -func (c *clock) Timer(d time.Duration) *Timer { - t := time.NewTimer(d) - return &Timer{C: t.C, timer: t} -} - -// Mock represents a mock clock that only moves forward programmically. -// It can be preferable to a real-time clock when testing time-based functionality. -type Mock struct { - mu sync.Mutex - now time.Time // current time - timers clockTimers // tickers & timers - - calls Calls - waiting []waiting - callsMutex sync.Mutex -} - -// NewMock returns an instance of a mock clock. -// The current time of the mock clock on initialization is the Unix epoch. -func NewMock() *Mock { - return &Mock{now: time.Unix(0, 0)} -} - -// Add moves the current time of the mock clock forward by the duration. -// This should only be called from a single goroutine at a time. -func (m *Mock) Add(d time.Duration) { - // Calculate the final current time. - t := m.now.Add(d) - - // Continue to execute timers until there are no more before the new time. - for { - if !m.runNextTimer(t) { - break - } - } - - // Ensure that we end with the new time. - m.mu.Lock() - m.now = t - m.mu.Unlock() - - // Give a small buffer to make sure the other goroutines get handled. - gosched() -} - -// runNextTimer executes the next timer in chronological order and moves the -// current time to the timer's next tick time. The next time is not executed if -// it's next time if after the max time. Returns true if a timer is executed. -func (m *Mock) runNextTimer(max time.Time) bool { - m.mu.Lock() - - // Sort timers by time. - sort.Sort(m.timers) - - // If we have no more timers then exit. - if len(m.timers) == 0 { - m.mu.Unlock() - return false - } - - // Retrieve next timer. Exit if next tick is after new time. - t := m.timers[0] - if t.Next().After(max) { - m.mu.Unlock() - return false - } - - // Move "now" forward and unlock clock. - m.now = t.Next() - m.mu.Unlock() - - // Execute timer. - t.Tick(m.now) - return true -} - -// After waits for the duration to elapse and then sends the current time on the returned channel. -func (m *Mock) After(d time.Duration) <-chan time.Time { - defer m.inc(&m.calls.After) - return m.Timer(d).C -} - -// AfterFunc waits for the duration to elapse and then executes a function. -// A Timer is returned that can be stopped. -func (m *Mock) AfterFunc(d time.Duration, f func()) *Timer { - defer m.inc(&m.calls.AfterFunc) - t := m.Timer(d) - t.C = nil - t.fn = f - return t -} - -// Now returns the current wall time on the mock clock. -func (m *Mock) Now() time.Time { - defer m.inc(&m.calls.Now) - m.mu.Lock() - defer m.mu.Unlock() - return m.now -} - -// Sleep pauses the goroutine for the given duration on the mock clock. -// The clock must be moved forward in a separate goroutine. -func (m *Mock) Sleep(d time.Duration) { - defer m.inc(&m.calls.Sleep) - <-m.After(d) -} - -// Tick is a convenience function for Ticker(). -// It will return a ticker channel that cannot be stopped. -func (m *Mock) Tick(d time.Duration) <-chan time.Time { - defer m.inc(&m.calls.Tick) - return m.Ticker(d).C -} - -// Ticker creates a new instance of Ticker. -func (m *Mock) Ticker(d time.Duration) *Ticker { - defer m.inc(&m.calls.Ticker) - m.mu.Lock() - defer m.mu.Unlock() - ch := make(chan time.Time) - t := &Ticker{ - C: ch, - c: ch, - mock: m, - d: d, - next: m.now.Add(d), - } - m.timers = append(m.timers, (*internalTicker)(t)) - return t -} - -// Timer creates a new instance of Timer. -func (m *Mock) Timer(d time.Duration) *Timer { - defer m.inc(&m.calls.Timer) - m.mu.Lock() - defer m.mu.Unlock() - ch := make(chan time.Time) - t := &Timer{ - C: ch, - c: ch, - mock: m, - next: m.now.Add(d), - } - m.timers = append(m.timers, (*internalTimer)(t)) - return t -} - -func (m *Mock) removeClockTimer(t clockTimer) { - m.mu.Lock() - defer m.mu.Unlock() - for i, timer := range m.timers { - if timer == t { - copy(m.timers[i:], m.timers[i+1:]) - m.timers[len(m.timers)-1] = nil - m.timers = m.timers[:len(m.timers)-1] - break - } - } - sort.Sort(m.timers) -} - -func (m *Mock) inc(addr *uint32) { - m.callsMutex.Lock() - defer m.callsMutex.Unlock() - *addr++ - var newWaiting []waiting - for _, w := range m.waiting { - if m.calls.atLeast(w.expected) { - close(w.done) - continue - } - newWaiting = append(newWaiting, w) - } - m.waiting = newWaiting -} - -// Wait waits for at least the relevant calls before returning. The expected -// Calls are always over the lifetime of the Mock. Values in the Calls struct -// are used as the minimum number of calls, this allows you to wait for only -// the calls you care about. -func (m *Mock) Wait(s Calls) { - m.callsMutex.Lock() - if m.calls.atLeast(s) { - m.callsMutex.Unlock() - return - } - done := make(chan struct{}) - m.waiting = append(m.waiting, waiting{expected: s, done: done}) - m.callsMutex.Unlock() - <-done -} - -// clockTimer represents an object with an associated start time. -type clockTimer interface { - Next() time.Time - Tick(time.Time) -} - -// clockTimers represents a list of sortable timers. -type clockTimers []clockTimer - -func (a clockTimers) Len() int { return len(a) } -func (a clockTimers) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a clockTimers) Less(i, j int) bool { return a[i].Next().Before(a[j].Next()) } - -// Timer represents a single event. -// The current time will be sent on C, unless the timer was created by AfterFunc. -type Timer struct { - C <-chan time.Time - c chan time.Time - timer *time.Timer // realtime impl, if set - next time.Time // next tick time - mock *Mock // mock clock, if set - fn func() // AfterFunc function, if set -} - -// Stop turns off the ticker. -func (t *Timer) Stop() { - if t.timer != nil { - t.timer.Stop() - } else { - t.mock.removeClockTimer((*internalTimer)(t)) - } -} - -type internalTimer Timer - -func (t *internalTimer) Next() time.Time { return t.next } -func (t *internalTimer) Tick(now time.Time) { - if t.fn != nil { - t.fn() - } else { - t.c <- now - } - t.mock.removeClockTimer((*internalTimer)(t)) - gosched() -} - -// Ticker holds a channel that receives "ticks" at regular intervals. -type Ticker struct { - C <-chan time.Time - c chan time.Time - ticker *time.Ticker // realtime impl, if set - next time.Time // next tick time - mock *Mock // mock clock, if set - d time.Duration // time between ticks -} - -// Stop turns off the ticker. -func (t *Ticker) Stop() { - if t.ticker != nil { - t.ticker.Stop() - } else { - t.mock.removeClockTimer((*internalTicker)(t)) - } -} - -type internalTicker Ticker - -func (t *internalTicker) Next() time.Time { return t.next } -func (t *internalTicker) Tick(now time.Time) { - select { - case t.c <- now: - case <-time.After(1 * time.Millisecond): - } - t.next = now.Add(t.d) - gosched() -} - -// Sleep momentarily so that other goroutines can process. -func gosched() { runtime.Gosched() } - -// Calls keeps track of the count of calls for each of the methods on the Clock -// interface. -type Calls struct { - After uint32 - AfterFunc uint32 - Now uint32 - Sleep uint32 - Tick uint32 - Ticker uint32 - Timer uint32 -} - -// atLeast returns true if at least the number of calls in o have been made. -func (c Calls) atLeast(o Calls) bool { - if c.After < o.After { - return false - } - if c.AfterFunc < o.AfterFunc { - return false - } - if c.Now < o.Now { - return false - } - if c.Sleep < o.Sleep { - return false - } - if c.Tick < o.Tick { - return false - } - if c.Ticker < o.Ticker { - return false - } - if c.Timer < o.Timer { - return false - } - return true -} - -type waiting struct { - expected Calls - done chan struct{} -} diff --git a/vendor/github.com/facebookgo/grace/gracehttp/http.go b/vendor/github.com/facebookgo/grace/gracehttp/http.go deleted file mode 100644 index fa3ac883..00000000 --- a/vendor/github.com/facebookgo/grace/gracehttp/http.go +++ /dev/null @@ -1,190 +0,0 @@ -// Package gracehttp provides easy to use graceful restart -// functionality for HTTP server. -package gracehttp - -import ( - "bytes" - "crypto/tls" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "sync" - "syscall" - - "github.com/facebookgo/grace/gracenet" - "github.com/facebookgo/httpdown" -) - -var ( - logger *log.Logger - didInherit = os.Getenv("LISTEN_FDS") != "" - ppid = os.Getppid() -) - -// An app contains one or more servers and associated configuration. -type app struct { - servers []*http.Server - http *httpdown.HTTP - net *gracenet.Net - listeners []net.Listener - sds []httpdown.Server - errors chan error -} - -func newApp(servers []*http.Server) *app { - return &app{ - servers: servers, - http: &httpdown.HTTP{}, - net: &gracenet.Net{}, - listeners: make([]net.Listener, 0, len(servers)), - sds: make([]httpdown.Server, 0, len(servers)), - - // 2x num servers for possible Close or Stop errors + 1 for possible - // StartProcess error. - errors: make(chan error, 1+(len(servers)*2)), - } -} - -func (a *app) listen() error { - for _, s := range a.servers { - // TODO: default addresses - l, err := a.net.Listen("tcp", s.Addr) - if err != nil { - return err - } - if s.TLSConfig != nil { - l = tls.NewListener(l, s.TLSConfig) - } - a.listeners = append(a.listeners, l) - } - return nil -} - -func (a *app) serve() { - for i, s := range a.servers { - a.sds = append(a.sds, a.http.Serve(s, a.listeners[i])) - } -} - -func (a *app) wait() { - var wg sync.WaitGroup - wg.Add(len(a.sds) * 2) // Wait & Stop - go a.signalHandler(&wg) - for _, s := range a.sds { - go func(s httpdown.Server) { - defer wg.Done() - if err := s.Wait(); err != nil { - a.errors <- err - } - }(s) - } - wg.Wait() -} - -func (a *app) term(wg *sync.WaitGroup) { - for _, s := range a.sds { - go func(s httpdown.Server) { - defer wg.Done() - if err := s.Stop(); err != nil { - a.errors <- err - } - }(s) - } -} - -func (a *app) signalHandler(wg *sync.WaitGroup) { - ch := make(chan os.Signal, 10) - signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR2) - for { - sig := <-ch - switch sig { - case syscall.SIGINT, syscall.SIGTERM: - // this ensures a subsequent INT/TERM will trigger standard go behaviour of - // terminating. - signal.Stop(ch) - a.term(wg) - return - case syscall.SIGUSR2: - // we only return here if there's an error, otherwise the new process - // will send us a TERM when it's ready to trigger the actual shutdown. - if _, err := a.net.StartProcess(); err != nil { - a.errors <- err - } - } - } -} - -// Serve will serve the given http.Servers and will monitor for signals -// allowing for graceful termination (SIGTERM) or restart (SIGUSR2). -func Serve(servers ...*http.Server) error { - a := newApp(servers) - - // Acquire Listeners - if err := a.listen(); err != nil { - return err - } - - // Some useful logging. - if logger != nil { - if didInherit { - if ppid == 1 { - logger.Printf("Listening on init activated %s", pprintAddr(a.listeners)) - } else { - const msg = "Graceful handoff of %s with new pid %d and old pid %d" - logger.Printf(msg, pprintAddr(a.listeners), os.Getpid(), ppid) - } - } else { - const msg = "Serving %s with pid %d" - logger.Printf(msg, pprintAddr(a.listeners), os.Getpid()) - } - } - - // Start serving. - a.serve() - - // Close the parent if we inherited and it wasn't init that started us. - if didInherit && ppid != 1 { - if err := syscall.Kill(ppid, syscall.SIGTERM); err != nil { - return fmt.Errorf("failed to close parent: %s", err) - } - } - - waitdone := make(chan struct{}) - go func() { - defer close(waitdone) - a.wait() - }() - - select { - case err := <-a.errors: - if err == nil { - panic("unexpected nil error") - } - return err - case <-waitdone: - if logger != nil { - logger.Printf("Exiting pid %d.", os.Getpid()) - } - return nil - } -} - -// Used for pretty printing addresses. -func pprintAddr(listeners []net.Listener) []byte { - var out bytes.Buffer - for i, l := range listeners { - if i != 0 { - fmt.Fprint(&out, ", ") - } - fmt.Fprint(&out, l.Addr()) - } - return out.Bytes() -} - -// SetLogger sets logger to be able to grab some useful logs -func SetLogger(l *log.Logger) { - logger = l -} diff --git a/vendor/github.com/facebookgo/grace/gracehttp/license b/vendor/github.com/facebookgo/grace/gracehttp/license deleted file mode 100644 index 3aea8753..00000000 --- a/vendor/github.com/facebookgo/grace/gracehttp/license +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For grace software - -Copyright (c) 2015, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/facebookgo/grace/gracenet/license b/vendor/github.com/facebookgo/grace/gracenet/license deleted file mode 100644 index 3aea8753..00000000 --- a/vendor/github.com/facebookgo/grace/gracenet/license +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For grace software - -Copyright (c) 2015, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/facebookgo/grace/gracenet/net.go b/vendor/github.com/facebookgo/grace/gracenet/net.go deleted file mode 100644 index a980954a..00000000 --- a/vendor/github.com/facebookgo/grace/gracenet/net.go +++ /dev/null @@ -1,252 +0,0 @@ -// Package gracenet provides a family of Listen functions that either open a -// fresh connection or provide an inherited connection from when the process -// was started. The behave like their counterparts in the net package, but -// transparently provide support for graceful restarts without dropping -// connections. This is provided in a systemd socket activation compatible form -// to allow using socket activation. -// -// BUG: Doesn't handle closing of listeners. -package gracenet - -import ( - "fmt" - "net" - "os" - "os/exec" - "strconv" - "strings" - "sync" -) - -const ( - // Used to indicate a graceful restart in the new process. - envCountKey = "LISTEN_FDS" - envCountKeyPrefix = envCountKey + "=" -) - -// In order to keep the working directory the same as when we started we record -// it at startup. -var originalWD, _ = os.Getwd() - -// Net provides the family of Listen functions and maintains the associated -// state. Typically you will have only once instance of Net per application. -type Net struct { - inherited []net.Listener - active []net.Listener - mutex sync.Mutex - inheritOnce sync.Once - - // used in tests to override the default behavior of starting from fd 3. - fdStart int -} - -func (n *Net) inherit() error { - var retErr error - n.inheritOnce.Do(func() { - n.mutex.Lock() - defer n.mutex.Unlock() - countStr := os.Getenv(envCountKey) - if countStr == "" { - return - } - count, err := strconv.Atoi(countStr) - if err != nil { - retErr = fmt.Errorf("found invalid count value: %s=%s", envCountKey, countStr) - return - } - - // In tests this may be overridden. - fdStart := n.fdStart - if fdStart == 0 { - // In normal operations if we are inheriting, the listeners will begin at - // fd 3. - fdStart = 3 - } - - for i := fdStart; i < fdStart+count; i++ { - file := os.NewFile(uintptr(i), "listener") - l, err := net.FileListener(file) - if err != nil { - file.Close() - retErr = fmt.Errorf("error inheriting socket fd %d: %s", i, err) - return - } - if err := file.Close(); err != nil { - retErr = fmt.Errorf("error closing inherited socket fd %d: %s", i, err) - return - } - n.inherited = append(n.inherited, l) - } - }) - return retErr -} - -// Listen announces on the local network address laddr. The network net must be -// a stream-oriented network: "tcp", "tcp4", "tcp6", "unix" or "unixpacket". It -// returns an inherited net.Listener for the matching network and address, or -// creates a new one using net.Listen. -func (n *Net) Listen(nett, laddr string) (net.Listener, error) { - switch nett { - default: - return nil, net.UnknownNetworkError(nett) - case "tcp", "tcp4", "tcp6": - addr, err := net.ResolveTCPAddr(nett, laddr) - if err != nil { - return nil, err - } - return n.ListenTCP(nett, addr) - case "unix", "unixpacket", "invalid_unix_net_for_test": - addr, err := net.ResolveUnixAddr(nett, laddr) - if err != nil { - return nil, err - } - return n.ListenUnix(nett, addr) - } -} - -// ListenTCP announces on the local network address laddr. The network net must -// be: "tcp", "tcp4" or "tcp6". It returns an inherited net.Listener for the -// matching network and address, or creates a new one using net.ListenTCP. -func (n *Net) ListenTCP(nett string, laddr *net.TCPAddr) (*net.TCPListener, error) { - if err := n.inherit(); err != nil { - return nil, err - } - - n.mutex.Lock() - defer n.mutex.Unlock() - - // look for an inherited listener - for i, l := range n.inherited { - if l == nil { // we nil used inherited listeners - continue - } - if isSameAddr(l.Addr(), laddr) { - n.inherited[i] = nil - n.active = append(n.active, l) - return l.(*net.TCPListener), nil - } - } - - // make a fresh listener - l, err := net.ListenTCP(nett, laddr) - if err != nil { - return nil, err - } - n.active = append(n.active, l) - return l, nil -} - -// ListenUnix announces on the local network address laddr. The network net -// must be a: "unix" or "unixpacket". It returns an inherited net.Listener for -// the matching network and address, or creates a new one using net.ListenUnix. -func (n *Net) ListenUnix(nett string, laddr *net.UnixAddr) (*net.UnixListener, error) { - if err := n.inherit(); err != nil { - return nil, err - } - - n.mutex.Lock() - defer n.mutex.Unlock() - - // look for an inherited listener - for i, l := range n.inherited { - if l == nil { // we nil used inherited listeners - continue - } - if isSameAddr(l.Addr(), laddr) { - n.inherited[i] = nil - n.active = append(n.active, l) - return l.(*net.UnixListener), nil - } - } - - // make a fresh listener - l, err := net.ListenUnix(nett, laddr) - if err != nil { - return nil, err - } - n.active = append(n.active, l) - return l, nil -} - -// activeListeners returns a snapshot copy of the active listeners. -func (n *Net) activeListeners() ([]net.Listener, error) { - n.mutex.Lock() - defer n.mutex.Unlock() - ls := make([]net.Listener, len(n.active)) - copy(ls, n.active) - return ls, nil -} - -func isSameAddr(a1, a2 net.Addr) bool { - if a1.Network() != a2.Network() { - return false - } - a1s := a1.String() - a2s := a2.String() - if a1s == a2s { - return true - } - - // This allows for ipv6 vs ipv4 local addresses to compare as equal. This - // scenario is common when listening on localhost. - const ipv6prefix = "[::]" - a1s = strings.TrimPrefix(a1s, ipv6prefix) - a2s = strings.TrimPrefix(a2s, ipv6prefix) - const ipv4prefix = "0.0.0.0" - a1s = strings.TrimPrefix(a1s, ipv4prefix) - a2s = strings.TrimPrefix(a2s, ipv4prefix) - return a1s == a2s -} - -// StartProcess starts a new process passing it the active listeners. It -// doesn't fork, but starts a new process using the same environment and -// arguments as when it was originally started. This allows for a newly -// deployed binary to be started. It returns the pid of the newly started -// process when successful. -func (n *Net) StartProcess() (int, error) { - listeners, err := n.activeListeners() - if err != nil { - return 0, err - } - - // Extract the fds from the listeners. - files := make([]*os.File, len(listeners)) - for i, l := range listeners { - files[i], err = l.(filer).File() - if err != nil { - return 0, err - } - defer files[i].Close() - } - - // Use the original binary location. This works with symlinks such that if - // the file it points to has been changed we will use the updated symlink. - argv0, err := exec.LookPath(os.Args[0]) - if err != nil { - return 0, err - } - - // Pass on the environment and replace the old count key with the new one. - var env []string - for _, v := range os.Environ() { - if !strings.HasPrefix(v, envCountKeyPrefix) { - env = append(env, v) - } - } - env = append(env, fmt.Sprintf("%s%d", envCountKeyPrefix, len(listeners))) - - allFiles := append([]*os.File{os.Stdin, os.Stdout, os.Stderr}, files...) - process, err := os.StartProcess(argv0, os.Args, &os.ProcAttr{ - Dir: originalWD, - Env: env, - Files: allFiles, - }) - if err != nil { - return 0, err - } - return process.Pid, nil -} - -type filer interface { - File() (*os.File, error) -} diff --git a/vendor/github.com/facebookgo/httpdown/httpdown.go b/vendor/github.com/facebookgo/httpdown/httpdown.go deleted file mode 100644 index 34c5dea9..00000000 --- a/vendor/github.com/facebookgo/httpdown/httpdown.go +++ /dev/null @@ -1,376 +0,0 @@ -// Package httpdown provides http.ConnState enabled graceful termination of -// http.Server. -package httpdown - -import ( - "crypto/tls" - "fmt" - "net" - "net/http" - "os" - "os/signal" - "sync" - "syscall" - "time" - - "github.com/facebookgo/clock" - "github.com/facebookgo/stats" -) - -const ( - defaultStopTimeout = time.Minute - defaultKillTimeout = time.Minute -) - -// A Server allows encapsulates the process of accepting new connections and -// serving them, and gracefully shutting down the listener without dropping -// active connections. -type Server interface { - // Wait waits for the serving loop to finish. This will happen when Stop is - // called, at which point it returns no error, or if there is an error in the - // serving loop. You must call Wait after calling Serve or ListenAndServe. - Wait() error - - // Stop stops the listener. It will block until all connections have been - // closed. - Stop() error -} - -// HTTP defines the configuration for serving a http.Server. Multiple calls to -// Serve or ListenAndServe can be made on the same HTTP instance. The default -// timeouts of 1 minute each result in a maximum of 2 minutes before a Stop() -// returns. -type HTTP struct { - // StopTimeout is the duration before we begin force closing connections. - // Defaults to 1 minute. - StopTimeout time.Duration - - // KillTimeout is the duration before which we completely give up and abort - // even though we still have connected clients. This is useful when a large - // number of client connections exist and closing them can take a long time. - // Note, this is in addition to the StopTimeout. Defaults to 1 minute. - KillTimeout time.Duration - - // Stats is optional. If provided, it will be used to record various metrics. - Stats stats.Client - - // Clock allows for testing timing related functionality. Do not specify this - // in production code. - Clock clock.Clock -} - -// Serve provides the low-level API which is useful if you're creating your own -// net.Listener. -func (h HTTP) Serve(s *http.Server, l net.Listener) Server { - stopTimeout := h.StopTimeout - if stopTimeout == 0 { - stopTimeout = defaultStopTimeout - } - killTimeout := h.KillTimeout - if killTimeout == 0 { - killTimeout = defaultKillTimeout - } - klock := h.Clock - if klock == nil { - klock = clock.New() - } - - ss := &server{ - stopTimeout: stopTimeout, - killTimeout: killTimeout, - stats: h.Stats, - clock: klock, - oldConnState: s.ConnState, - listener: l, - server: s, - serveDone: make(chan struct{}), - serveErr: make(chan error, 1), - new: make(chan net.Conn), - active: make(chan net.Conn), - idle: make(chan net.Conn), - closed: make(chan net.Conn), - stop: make(chan chan struct{}), - kill: make(chan chan struct{}), - } - s.ConnState = ss.connState - go ss.manage() - go ss.serve() - return ss -} - -// ListenAndServe returns a Server for the given http.Server. It is equivalent -// to ListenAndServe from the standard library, but returns immediately. -// Requests will be accepted in a background goroutine. If the http.Server has -// a non-nil TLSConfig, a TLS enabled listener will be setup. -func (h HTTP) ListenAndServe(s *http.Server) (Server, error) { - addr := s.Addr - if addr == "" { - if s.TLSConfig == nil { - addr = ":http" - } else { - addr = ":https" - } - } - l, err := net.Listen("tcp", addr) - if err != nil { - stats.BumpSum(h.Stats, "listen.error", 1) - return nil, err - } - if s.TLSConfig != nil { - l = tls.NewListener(l, s.TLSConfig) - } - return h.Serve(s, l), nil -} - -// server manages the serving process and allows for gracefully stopping it. -type server struct { - stopTimeout time.Duration - killTimeout time.Duration - stats stats.Client - clock clock.Clock - - oldConnState func(net.Conn, http.ConnState) - server *http.Server - serveDone chan struct{} - serveErr chan error - listener net.Listener - - new chan net.Conn - active chan net.Conn - idle chan net.Conn - closed chan net.Conn - stop chan chan struct{} - kill chan chan struct{} - - stopOnce sync.Once - stopErr error -} - -func (s *server) connState(c net.Conn, cs http.ConnState) { - if s.oldConnState != nil { - s.oldConnState(c, cs) - } - - switch cs { - case http.StateNew: - s.new <- c - case http.StateActive: - s.active <- c - case http.StateIdle: - s.idle <- c - case http.StateHijacked, http.StateClosed: - s.closed <- c - } -} - -func (s *server) manage() { - defer func() { - close(s.new) - close(s.active) - close(s.idle) - close(s.closed) - close(s.stop) - close(s.kill) - }() - - var stopDone chan struct{} - - conns := map[net.Conn]http.ConnState{} - var countNew, countActive, countIdle float64 - - // decConn decrements the count associated with the current state of the - // given connection. - decConn := func(c net.Conn) { - switch conns[c] { - default: - panic(fmt.Errorf("unknown existing connection: %s", c)) - case http.StateNew: - countNew-- - case http.StateActive: - countActive-- - case http.StateIdle: - countIdle-- - } - } - - // setup a ticker to report various values every minute. if we don't have a - // Stats implementation provided, we Stop it so it never ticks. - statsTicker := s.clock.Ticker(time.Minute) - if s.stats == nil { - statsTicker.Stop() - } - - for { - select { - case <-statsTicker.C: - // we'll only get here when s.stats is not nil - s.stats.BumpAvg("http-state.new", countNew) - s.stats.BumpAvg("http-state.active", countActive) - s.stats.BumpAvg("http-state.idle", countIdle) - s.stats.BumpAvg("http-state.total", countNew+countActive+countIdle) - case c := <-s.new: - conns[c] = http.StateNew - countNew++ - case c := <-s.active: - decConn(c) - countActive++ - - conns[c] = http.StateActive - case c := <-s.idle: - decConn(c) - countIdle++ - - conns[c] = http.StateIdle - - // if we're already stopping, close it - if stopDone != nil { - c.Close() - } - case c := <-s.closed: - stats.BumpSum(s.stats, "conn.closed", 1) - decConn(c) - delete(conns, c) - - // if we're waiting to stop and are all empty, we just closed the last - // connection and we're done. - if stopDone != nil && len(conns) == 0 { - close(stopDone) - return - } - case stopDone = <-s.stop: - // if we're already all empty, we're already done - if len(conns) == 0 { - close(stopDone) - return - } - - // close current idle connections right away - for c, cs := range conns { - if cs == http.StateIdle { - c.Close() - } - } - - // continue the loop and wait for all the ConnState updates which will - // eventually close(stopDone) and return from this goroutine. - - case killDone := <-s.kill: - // force close all connections - stats.BumpSum(s.stats, "kill.conn.count", float64(len(conns))) - for c := range conns { - c.Close() - } - - // don't block the kill. - close(killDone) - - // continue the loop and we wait for all the ConnState updates and will - // return from this goroutine when we're all done. otherwise we'll try to - // send those ConnState updates on closed channels. - - } - } -} - -func (s *server) serve() { - stats.BumpSum(s.stats, "serve", 1) - s.serveErr <- s.server.Serve(s.listener) - close(s.serveDone) - close(s.serveErr) -} - -func (s *server) Wait() error { - if err := <-s.serveErr; !isUseOfClosedError(err) { - return err - } - return nil -} - -func (s *server) Stop() error { - s.stopOnce.Do(func() { - defer stats.BumpTime(s.stats, "stop.time").End() - stats.BumpSum(s.stats, "stop", 1) - - // first disable keep-alive for new connections - s.server.SetKeepAlivesEnabled(false) - - // then close the listener so new connections can't connect come thru - closeErr := s.listener.Close() - <-s.serveDone - - // then trigger the background goroutine to stop and wait for it - stopDone := make(chan struct{}) - s.stop <- stopDone - - // wait for stop - select { - case <-stopDone: - case <-s.clock.After(s.stopTimeout): - defer stats.BumpTime(s.stats, "kill.time").End() - stats.BumpSum(s.stats, "kill", 1) - - // stop timed out, wait for kill - killDone := make(chan struct{}) - s.kill <- killDone - select { - case <-killDone: - case <-s.clock.After(s.killTimeout): - // kill timed out, give up - stats.BumpSum(s.stats, "kill.timeout", 1) - } - } - - if closeErr != nil && !isUseOfClosedError(closeErr) { - stats.BumpSum(s.stats, "listener.close.error", 1) - s.stopErr = closeErr - } - }) - return s.stopErr -} - -func isUseOfClosedError(err error) bool { - if err == nil { - return false - } - if opErr, ok := err.(*net.OpError); ok { - err = opErr.Err - } - return err.Error() == "use of closed network connection" -} - -// ListenAndServe is a convenience function to serve and wait for a SIGTERM -// or SIGINT before shutting down. -func ListenAndServe(s *http.Server, hd *HTTP) error { - if hd == nil { - hd = &HTTP{} - } - hs, err := hd.ListenAndServe(s) - if err != nil { - return err - } - - waiterr := make(chan error, 1) - go func() { - defer close(waiterr) - waiterr <- hs.Wait() - }() - - signals := make(chan os.Signal, 10) - signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT) - - select { - case err := <-waiterr: - if err != nil { - return err - } - case <-signals: - signal.Stop(signals) - if err := hs.Stop(); err != nil { - return err - } - if err := <-waiterr; err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/facebookgo/httpdown/httpdown_example/main.go b/vendor/github.com/facebookgo/httpdown/httpdown_example/main.go deleted file mode 100644 index 9e3c0bff..00000000 --- a/vendor/github.com/facebookgo/httpdown/httpdown_example/main.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "net/http" - "os" - "time" - - "github.com/facebookgo/httpdown" -) - -func handler(w http.ResponseWriter, r *http.Request) { - duration, err := time.ParseDuration(r.FormValue("duration")) - if err != nil { - http.Error(w, err.Error(), 400) - return - } - fmt.Fprintf(w, "going to sleep %s with pid %d\n", duration, os.Getpid()) - w.(http.Flusher).Flush() - time.Sleep(duration) - fmt.Fprintf(w, "slept %s with pid %d\n", duration, os.Getpid()) -} - -func main() { - server := &http.Server{ - Addr: "127.0.0.1:8080", - Handler: http.HandlerFunc(handler), - } - hd := &httpdown.HTTP{ - StopTimeout: 10 * time.Second, - KillTimeout: 1 * time.Second, - } - - flag.StringVar(&server.Addr, "addr", server.Addr, "http address") - flag.DurationVar(&hd.StopTimeout, "stop-timeout", hd.StopTimeout, "stop timeout") - flag.DurationVar(&hd.KillTimeout, "kill-timeout", hd.KillTimeout, "kill timeout") - flag.Parse() - - if err := httpdown.ListenAndServe(server, hd); err != nil { - panic(err) - } -} diff --git a/vendor/github.com/facebookgo/httpdown/license b/vendor/github.com/facebookgo/httpdown/license deleted file mode 100644 index d849082f..00000000 --- a/vendor/github.com/facebookgo/httpdown/license +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For httpdown software - -Copyright (c) 2015, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/facebookgo/stats/aggregation.go b/vendor/github.com/facebookgo/stats/aggregation.go deleted file mode 100644 index 8f57fb7f..00000000 --- a/vendor/github.com/facebookgo/stats/aggregation.go +++ /dev/null @@ -1,35 +0,0 @@ -package stats - -import "sort" - -// Average returns the average value -func Average(values []float64) float64 { - if len(values) == 0 { - return 0 - } - - var val float64 - for _, point := range values { - val += point - } - return val / float64(len(values)) -} - -// Sum returns the sum of all the given values -func Sum(values []float64) float64 { - var val float64 - for _, point := range values { - val += point - } - return val -} - -// Percentiles returns a map containing the asked for percentiles -func Percentiles(values []float64, percentiles map[string]float64) map[string]float64 { - sort.Float64s(values) - results := map[string]float64{} - for label, p := range percentiles { - results[label] = values[int(float64(len(values))*p)] - } - return results -} diff --git a/vendor/github.com/facebookgo/stats/counter.go b/vendor/github.com/facebookgo/stats/counter.go deleted file mode 100644 index 59a0ed1e..00000000 --- a/vendor/github.com/facebookgo/stats/counter.go +++ /dev/null @@ -1,112 +0,0 @@ -package stats - -import "fmt" - -// Type is the type of aggregation of apply -type Type int - -const ( - AggregateAvg Type = iota - AggregateSum - AggregateHistogram -) - -var ( - // HistogramPercentiles is used to determine which percentiles to return for - // SimpleCounter.Aggregate - HistogramPercentiles = map[string]float64{ - "p50": 0.5, - "p95": 0.95, - "p99": 0.99, - } - - // MinSamplesForPercentiles is used by SimpleCounter.Aggregate to determine - // what the minimum number of samples is required for percentile analysis - MinSamplesForPercentiles = 10 -) - -// Aggregates can be used to merge counters together. This is not goroutine safe -type Aggregates map[string]Counter - -// Add adds the counter for aggregation. This is not goroutine safe -func (a Aggregates) Add(c Counter) error { - key := c.FullKey() - if counter, ok := a[key]; ok { - if counter.GetType() != c.GetType() { - return fmt.Errorf("stats: mismatched aggregation type for: %s", key) - } - counter.AddValues(c.GetValues()...) - } else { - a[key] = c - } - return nil -} - -// Counter is the interface used by Aggregates to merge counters together -type Counter interface { - // FullKey is used to uniquely identify the counter - FullKey() string - - // AddValues adds values for aggregation - AddValues(...float64) - - // GetValues returns the values for aggregation - GetValues() []float64 - - // GetType returns the type of aggregation to apply - GetType() Type -} - -// SimpleCounter is a basic implementation of the Counter interface -type SimpleCounter struct { - Key string - Values []float64 - Type Type -} - -// FullKey is part of the Counter interace -func (s *SimpleCounter) FullKey() string { - return s.Key -} - -// GetValues is part of the Counter interface -func (s *SimpleCounter) GetValues() []float64 { - return s.Values -} - -// AddValues is part of the Counter interface -func (s *SimpleCounter) AddValues(vs ...float64) { - s.Values = append(s.Values, vs...) -} - -// GetType is part of the Counter interface -func (s *SimpleCounter) GetType() Type { - return s.Type -} - -// Aggregate aggregates the provided values appropriately, returning a map -// from key to value. If AggregateHistogram is specified, the map will contain -// the relevant percentiles as specified by HistogramPercentiles -func (s *SimpleCounter) Aggregate() map[string]float64 { - switch s.Type { - case AggregateAvg: - return map[string]float64{ - s.Key: Average(s.Values), - } - case AggregateSum: - return map[string]float64{ - s.Key: Sum(s.Values), - } - case AggregateHistogram: - histogram := map[string]float64{ - s.Key: Average(s.Values), - } - if len(s.Values) > MinSamplesForPercentiles { - for k, v := range Percentiles(s.Values, HistogramPercentiles) { - histogram[fmt.Sprintf("%s.%s", s.Key, k)] = v - } - } - return histogram - } - panic("stats: unsupported aggregation type") -} diff --git a/vendor/github.com/facebookgo/stats/license b/vendor/github.com/facebookgo/stats/license deleted file mode 100644 index feae8707..00000000 --- a/vendor/github.com/facebookgo/stats/license +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For stats software - -Copyright (c) 2015, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/facebookgo/stats/stats.go b/vendor/github.com/facebookgo/stats/stats.go deleted file mode 100644 index b833506a..00000000 --- a/vendor/github.com/facebookgo/stats/stats.go +++ /dev/null @@ -1,166 +0,0 @@ -// Package stats defines a lightweight interface for collecting statistics. It -// doesn't provide an implementation, just the shared interface. -package stats - -// Client provides methods to collection statistics. -type Client interface { - // BumpAvg bumps the average for the given key. - BumpAvg(key string, val float64) - - // BumpSum bumps the sum for the given key. - BumpSum(key string, val float64) - - // BumpHistogram bumps the histogram for the given key. - BumpHistogram(key string, val float64) - - // BumpTime is a special version of BumpHistogram which is specialized for - // timers. Calling it starts the timer, and it returns a value on which End() - // can be called to indicate finishing the timer. A convenient way of - // recording the duration of a function is calling it like such at the top of - // the function: - // - // defer s.BumpTime("my.function").End() - BumpTime(key string) interface { - End() - } -} - -// PrefixClient adds multiple keys for the same value, with each prefix -// added to the key and calls the underlying client. -func PrefixClient(prefixes []string, client Client) Client { - return &prefixClient{ - Prefixes: prefixes, - Client: client, - } -} - -type prefixClient struct { - Prefixes []string - Client Client -} - -func (p *prefixClient) BumpAvg(key string, val float64) { - for _, prefix := range p.Prefixes { - p.Client.BumpAvg(prefix+key, val) - } -} - -func (p *prefixClient) BumpSum(key string, val float64) { - for _, prefix := range p.Prefixes { - p.Client.BumpSum(prefix+key, val) - } -} - -func (p *prefixClient) BumpHistogram(key string, val float64) { - for _, prefix := range p.Prefixes { - p.Client.BumpHistogram(prefix+key, val) - } -} - -func (p *prefixClient) BumpTime(key string) interface { - End() -} { - var m multiEnder - for _, prefix := range p.Prefixes { - m = append(m, p.Client.BumpTime(prefix+key)) - } - return m -} - -// multiEnder combines many enders together. -type multiEnder []interface { - End() -} - -func (m multiEnder) End() { - for _, e := range m { - e.End() - } -} - -// HookClient is useful for testing. It provides optional hooks for each -// expected method in the interface, which if provided will be called. If a -// hook is not provided, it will be ignored. -type HookClient struct { - BumpAvgHook func(key string, val float64) - BumpSumHook func(key string, val float64) - BumpHistogramHook func(key string, val float64) - BumpTimeHook func(key string) interface { - End() - } -} - -// BumpAvg will call BumpAvgHook if defined. -func (c *HookClient) BumpAvg(key string, val float64) { - if c.BumpAvgHook != nil { - c.BumpAvgHook(key, val) - } -} - -// BumpSum will call BumpSumHook if defined. -func (c *HookClient) BumpSum(key string, val float64) { - if c.BumpSumHook != nil { - c.BumpSumHook(key, val) - } -} - -// BumpHistogram will call BumpHistogramHook if defined. -func (c *HookClient) BumpHistogram(key string, val float64) { - if c.BumpHistogramHook != nil { - c.BumpHistogramHook(key, val) - } -} - -// BumpTime will call BumpTimeHook if defined. -func (c *HookClient) BumpTime(key string) interface { - End() -} { - if c.BumpTimeHook != nil { - return c.BumpTimeHook(key) - } - return NoOpEnd -} - -type noOpEnd struct{} - -func (n noOpEnd) End() {} - -// NoOpEnd provides a dummy value for use in tests as valid return value for -// BumpTime(). -var NoOpEnd = noOpEnd{} - -// BumpAvg calls BumpAvg on the Client if it isn't nil. This is useful when a -// component has an optional stats.Client. -func BumpAvg(c Client, key string, val float64) { - if c != nil { - c.BumpAvg(key, val) - } -} - -// BumpSum calls BumpSum on the Client if it isn't nil. This is useful when a -// component has an optional stats.Client. -func BumpSum(c Client, key string, val float64) { - if c != nil { - c.BumpSum(key, val) - } -} - -// BumpHistogram calls BumpHistogram on the Client if it isn't nil. This is -// useful when a component has an optional stats.Client. -func BumpHistogram(c Client, key string, val float64) { - if c != nil { - c.BumpHistogram(key, val) - } -} - -// BumpTime calls BumpTime on the Client if it isn't nil. If the Client is nil -// it still returns a valid return value which will be a no-op. This is useful -// when a component has an optional stats.Client. -func BumpTime(c Client, key string) interface { - End() -} { - if c != nil { - return c.BumpTime(key) - } - return NoOpEnd -} diff --git a/vendor/github.com/facebookgo/stats/stopper.go b/vendor/github.com/facebookgo/stats/stopper.go deleted file mode 100644 index 38e8eab8..00000000 --- a/vendor/github.com/facebookgo/stats/stopper.go +++ /dev/null @@ -1,17 +0,0 @@ -package stats - -import "time" - -// Stopper calls Client.BumpSum and Client.BumpHistogram when End'ed -type Stopper struct { - Key string - Start time.Time - Client Client -} - -// End the Stopper -func (s *Stopper) End() { - since := time.Since(s.Start).Seconds() * 1000.0 - s.Client.BumpSum(s.Key+".total", since) - s.Client.BumpHistogram(s.Key, since) -} diff --git a/vendor/github.com/fsnotify/fsnotify/.editorconfig b/vendor/github.com/fsnotify/fsnotify/.editorconfig new file mode 100644 index 00000000..ba49e3c2 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 diff --git a/vendor/github.com/fsnotify/fsnotify/.gitignore b/vendor/github.com/fsnotify/fsnotify/.gitignore new file mode 100644 index 00000000..4cd0cbaf --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.gitignore @@ -0,0 +1,6 @@ +# Setup a Global .gitignore for OS and editor generated files: +# https://help.github.com/articles/ignoring-files +# git config --global core.excludesfile ~/.gitignore_global + +.vagrant +*.sublime-project diff --git a/vendor/github.com/fsnotify/fsnotify/.travis.yml b/vendor/github.com/fsnotify/fsnotify/.travis.yml new file mode 100644 index 00000000..981d1bb8 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.travis.yml @@ -0,0 +1,30 @@ +sudo: false +language: go + +go: + - 1.8.x + - 1.9.x + - tip + +matrix: + allow_failures: + - go: tip + fast_finish: true + +before_script: + - go get -u github.com/golang/lint/golint + +script: + - go test -v --race ./... + +after_script: + - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" + - test -z "$(golint ./... | tee /dev/stderr)" + - go vet ./... + +os: + - linux + - osx + +notifications: + email: false diff --git a/vendor/github.com/fsnotify/fsnotify/AUTHORS b/vendor/github.com/fsnotify/fsnotify/AUTHORS new file mode 100644 index 00000000..5ab5d41c --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/AUTHORS @@ -0,0 +1,52 @@ +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# You can update this list using the following command: +# +# $ git shortlog -se | awk '{print $2 " " $3 " " $4}' + +# Please keep the list sorted. + +Aaron L +Adrien Bustany +Amit Krishnan +Anmol Sethi +Bjørn Erik Pedersen +Bruno Bigras +Caleb Spare +Case Nelson +Chris Howey +Christoffer Buchholz +Daniel Wagner-Hall +Dave Cheney +Evan Phoenix +Francisco Souza +Hari haran +John C Barstow +Kelvin Fo +Ken-ichirou MATSUZAWA +Matt Layher +Nathan Youngman +Nickolai Zeldovich +Patrick +Paul Hammond +Pawel Knap +Pieter Droogendijk +Pursuit92 +Riku Voipio +Rob Figueiredo +Rodrigo Chiossi +Slawek Ligus +Soge Zhang +Tiffany Jernigan +Tilak Sharma +Tom Payne +Travis Cline +Tudor Golubenco +Vahe Khachikyan +Yukang +bronze1man +debrando +henrikedwards +铁哥 diff --git a/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md new file mode 100644 index 00000000..be4d7ea2 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md @@ -0,0 +1,317 @@ +# Changelog + +## v1.4.7 / 2018-01-09 + +* BSD/macOS: Fix possible deadlock on closing the watcher on kqueue (thanks @nhooyr and @glycerine) +* Tests: Fix missing verb on format string (thanks @rchiossi) +* Linux: Fix deadlock in Remove (thanks @aarondl) +* Linux: Watch.Add improvements (avoid race, fix consistency, reduce garbage) (thanks @twpayne) +* Docs: Moved FAQ into the README (thanks @vahe) +* Linux: Properly handle inotify's IN_Q_OVERFLOW event (thanks @zeldovich) +* Docs: replace references to OS X with macOS + +## v1.4.2 / 2016-10-10 + +* Linux: use InotifyInit1 with IN_CLOEXEC to stop leaking a file descriptor to a child process when using fork/exec [#178](https://github.com/fsnotify/fsnotify/pull/178) (thanks @pattyshack) + +## v1.4.1 / 2016-10-04 + +* Fix flaky inotify stress test on Linux [#177](https://github.com/fsnotify/fsnotify/pull/177) (thanks @pattyshack) + +## v1.4.0 / 2016-10-01 + +* add a String() method to Event.Op [#165](https://github.com/fsnotify/fsnotify/pull/165) (thanks @oozie) + +## v1.3.1 / 2016-06-28 + +* Windows: fix for double backslash when watching the root of a drive [#151](https://github.com/fsnotify/fsnotify/issues/151) (thanks @brunoqc) + +## v1.3.0 / 2016-04-19 + +* Support linux/arm64 by [patching](https://go-review.googlesource.com/#/c/21971/) x/sys/unix and switching to to it from syscall (thanks @suihkulokki) [#135](https://github.com/fsnotify/fsnotify/pull/135) + +## v1.2.10 / 2016-03-02 + +* Fix golint errors in windows.go [#121](https://github.com/fsnotify/fsnotify/pull/121) (thanks @tiffanyfj) + +## v1.2.9 / 2016-01-13 + +kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsnotify/pull/111) (thanks @bep) + +## v1.2.8 / 2015-12-17 + +* kqueue: fix race condition in Close [#105](https://github.com/fsnotify/fsnotify/pull/105) (thanks @djui for reporting the issue and @ppknap for writing a failing test) +* inotify: fix race in test +* enable race detection for continuous integration (Linux, Mac, Windows) + +## v1.2.5 / 2015-10-17 + +* inotify: use epoll_create1 for arm64 support (requires Linux 2.6.27 or later) [#100](https://github.com/fsnotify/fsnotify/pull/100) (thanks @suihkulokki) +* inotify: fix path leaks [#73](https://github.com/fsnotify/fsnotify/pull/73) (thanks @chamaken) +* kqueue: watch for rename events on subdirectories [#83](https://github.com/fsnotify/fsnotify/pull/83) (thanks @guotie) +* kqueue: avoid infinite loops from symlinks cycles [#101](https://github.com/fsnotify/fsnotify/pull/101) (thanks @illicitonion) + +## v1.2.1 / 2015-10-14 + +* kqueue: don't watch named pipes [#98](https://github.com/fsnotify/fsnotify/pull/98) (thanks @evanphx) + +## v1.2.0 / 2015-02-08 + +* inotify: use epoll to wake up readEvents [#66](https://github.com/fsnotify/fsnotify/pull/66) (thanks @PieterD) +* inotify: closing watcher should now always shut down goroutine [#63](https://github.com/fsnotify/fsnotify/pull/63) (thanks @PieterD) +* kqueue: close kqueue after removing watches, fixes [#59](https://github.com/fsnotify/fsnotify/issues/59) + +## v1.1.1 / 2015-02-05 + +* inotify: Retry read on EINTR [#61](https://github.com/fsnotify/fsnotify/issues/61) (thanks @PieterD) + +## v1.1.0 / 2014-12-12 + +* kqueue: rework internals [#43](https://github.com/fsnotify/fsnotify/pull/43) + * add low-level functions + * only need to store flags on directories + * less mutexes [#13](https://github.com/fsnotify/fsnotify/issues/13) + * done can be an unbuffered channel + * remove calls to os.NewSyscallError +* More efficient string concatenation for Event.String() [#52](https://github.com/fsnotify/fsnotify/pull/52) (thanks @mdlayher) +* kqueue: fix regression in rework causing subdirectories to be watched [#48](https://github.com/fsnotify/fsnotify/issues/48) +* kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) + +## v1.0.4 / 2014-09-07 + +* kqueue: add dragonfly to the build tags. +* Rename source code files, rearrange code so exported APIs are at the top. +* Add done channel to example code. [#37](https://github.com/fsnotify/fsnotify/pull/37) (thanks @chenyukang) + +## v1.0.3 / 2014-08-19 + +* [Fix] Windows MOVED_TO now translates to Create like on BSD and Linux. [#36](https://github.com/fsnotify/fsnotify/issues/36) + +## v1.0.2 / 2014-08-17 + +* [Fix] Missing create events on macOS. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) +* [Fix] Make ./path and path equivalent. (thanks @zhsso) + +## v1.0.0 / 2014-08-15 + +* [API] Remove AddWatch on Windows, use Add. +* Improve documentation for exported identifiers. [#30](https://github.com/fsnotify/fsnotify/issues/30) +* Minor updates based on feedback from golint. + +## dev / 2014-07-09 + +* Moved to [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify). +* Use os.NewSyscallError instead of returning errno (thanks @hariharan-uno) + +## dev / 2014-07-04 + +* kqueue: fix incorrect mutex used in Close() +* Update example to demonstrate usage of Op. + +## dev / 2014-06-28 + +* [API] Don't set the Write Op for attribute notifications [#4](https://github.com/fsnotify/fsnotify/issues/4) +* Fix for String() method on Event (thanks Alex Brainman) +* Don't build on Plan 9 or Solaris (thanks @4ad) + +## dev / 2014-06-21 + +* Events channel of type Event rather than *Event. +* [internal] use syscall constants directly for inotify and kqueue. +* [internal] kqueue: rename events to kevents and fileEvent to event. + +## dev / 2014-06-19 + +* Go 1.3+ required on Windows (uses syscall.ERROR_MORE_DATA internally). +* [internal] remove cookie from Event struct (unused). +* [internal] Event struct has the same definition across every OS. +* [internal] remove internal watch and removeWatch methods. + +## dev / 2014-06-12 + +* [API] Renamed Watch() to Add() and RemoveWatch() to Remove(). +* [API] Pluralized channel names: Events and Errors. +* [API] Renamed FileEvent struct to Event. +* [API] Op constants replace methods like IsCreate(). + +## dev / 2014-06-12 + +* Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) + +## dev / 2014-05-23 + +* [API] Remove current implementation of WatchFlags. + * current implementation doesn't take advantage of OS for efficiency + * provides little benefit over filtering events as they are received, but has extra bookkeeping and mutexes + * no tests for the current implementation + * not fully implemented on Windows [#93](https://github.com/howeyc/fsnotify/issues/93#issuecomment-39285195) + +## v0.9.3 / 2014-12-31 + +* kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) + +## v0.9.2 / 2014-08-17 + +* [Backport] Fix missing create events on macOS. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) + +## v0.9.1 / 2014-06-12 + +* Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) + +## v0.9.0 / 2014-01-17 + +* IsAttrib() for events that only concern a file's metadata [#79][] (thanks @abustany) +* [Fix] kqueue: fix deadlock [#77][] (thanks @cespare) +* [NOTICE] Development has moved to `code.google.com/p/go.exp/fsnotify` in preparation for inclusion in the Go standard library. + +## v0.8.12 / 2013-11-13 + +* [API] Remove FD_SET and friends from Linux adapter + +## v0.8.11 / 2013-11-02 + +* [Doc] Add Changelog [#72][] (thanks @nathany) +* [Doc] Spotlight and double modify events on macOS [#62][] (reported by @paulhammond) + +## v0.8.10 / 2013-10-19 + +* [Fix] kqueue: remove file watches when parent directory is removed [#71][] (reported by @mdwhatcott) +* [Fix] kqueue: race between Close and readEvents [#70][] (reported by @bernerdschaefer) +* [Doc] specify OS-specific limits in README (thanks @debrando) + +## v0.8.9 / 2013-09-08 + +* [Doc] Contributing (thanks @nathany) +* [Doc] update package path in example code [#63][] (thanks @paulhammond) +* [Doc] GoCI badge in README (Linux only) [#60][] +* [Doc] Cross-platform testing with Vagrant [#59][] (thanks @nathany) + +## v0.8.8 / 2013-06-17 + +* [Fix] Windows: handle `ERROR_MORE_DATA` on Windows [#49][] (thanks @jbowtie) + +## v0.8.7 / 2013-06-03 + +* [API] Make syscall flags internal +* [Fix] inotify: ignore event changes +* [Fix] race in symlink test [#45][] (reported by @srid) +* [Fix] tests on Windows +* lower case error messages + +## v0.8.6 / 2013-05-23 + +* kqueue: Use EVT_ONLY flag on Darwin +* [Doc] Update README with full example + +## v0.8.5 / 2013-05-09 + +* [Fix] inotify: allow monitoring of "broken" symlinks (thanks @tsg) + +## v0.8.4 / 2013-04-07 + +* [Fix] kqueue: watch all file events [#40][] (thanks @ChrisBuchholz) + +## v0.8.3 / 2013-03-13 + +* [Fix] inoitfy/kqueue memory leak [#36][] (reported by @nbkolchin) +* [Fix] kqueue: use fsnFlags for watching a directory [#33][] (reported by @nbkolchin) + +## v0.8.2 / 2013-02-07 + +* [Doc] add Authors +* [Fix] fix data races for map access [#29][] (thanks @fsouza) + +## v0.8.1 / 2013-01-09 + +* [Fix] Windows path separators +* [Doc] BSD License + +## v0.8.0 / 2012-11-09 + +* kqueue: directory watching improvements (thanks @vmirage) +* inotify: add `IN_MOVED_TO` [#25][] (requested by @cpisto) +* [Fix] kqueue: deleting watched directory [#24][] (reported by @jakerr) + +## v0.7.4 / 2012-10-09 + +* [Fix] inotify: fixes from https://codereview.appspot.com/5418045/ (ugorji) +* [Fix] kqueue: preserve watch flags when watching for delete [#21][] (reported by @robfig) +* [Fix] kqueue: watch the directory even if it isn't a new watch (thanks @robfig) +* [Fix] kqueue: modify after recreation of file + +## v0.7.3 / 2012-09-27 + +* [Fix] kqueue: watch with an existing folder inside the watched folder (thanks @vmirage) +* [Fix] kqueue: no longer get duplicate CREATE events + +## v0.7.2 / 2012-09-01 + +* kqueue: events for created directories + +## v0.7.1 / 2012-07-14 + +* [Fix] for renaming files + +## v0.7.0 / 2012-07-02 + +* [Feature] FSNotify flags +* [Fix] inotify: Added file name back to event path + +## v0.6.0 / 2012-06-06 + +* kqueue: watch files after directory created (thanks @tmc) + +## v0.5.1 / 2012-05-22 + +* [Fix] inotify: remove all watches before Close() + +## v0.5.0 / 2012-05-03 + +* [API] kqueue: return errors during watch instead of sending over channel +* kqueue: match symlink behavior on Linux +* inotify: add `DELETE_SELF` (requested by @taralx) +* [Fix] kqueue: handle EINTR (reported by @robfig) +* [Doc] Godoc example [#1][] (thanks @davecheney) + +## v0.4.0 / 2012-03-30 + +* Go 1 released: build with go tool +* [Feature] Windows support using winfsnotify +* Windows does not have attribute change notifications +* Roll attribute notifications into IsModify + +## v0.3.0 / 2012-02-19 + +* kqueue: add files when watch directory + +## v0.2.0 / 2011-12-30 + +* update to latest Go weekly code + +## v0.1.0 / 2011-10-19 + +* kqueue: add watch on file creation to match inotify +* kqueue: create file event +* inotify: ignore `IN_IGNORED` events +* event String() +* linux: common FileEvent functions +* initial commit + +[#79]: https://github.com/howeyc/fsnotify/pull/79 +[#77]: https://github.com/howeyc/fsnotify/pull/77 +[#72]: https://github.com/howeyc/fsnotify/issues/72 +[#71]: https://github.com/howeyc/fsnotify/issues/71 +[#70]: https://github.com/howeyc/fsnotify/issues/70 +[#63]: https://github.com/howeyc/fsnotify/issues/63 +[#62]: https://github.com/howeyc/fsnotify/issues/62 +[#60]: https://github.com/howeyc/fsnotify/issues/60 +[#59]: https://github.com/howeyc/fsnotify/issues/59 +[#49]: https://github.com/howeyc/fsnotify/issues/49 +[#45]: https://github.com/howeyc/fsnotify/issues/45 +[#40]: https://github.com/howeyc/fsnotify/issues/40 +[#36]: https://github.com/howeyc/fsnotify/issues/36 +[#33]: https://github.com/howeyc/fsnotify/issues/33 +[#29]: https://github.com/howeyc/fsnotify/issues/29 +[#25]: https://github.com/howeyc/fsnotify/issues/25 +[#24]: https://github.com/howeyc/fsnotify/issues/24 +[#21]: https://github.com/howeyc/fsnotify/issues/21 diff --git a/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md b/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md new file mode 100644 index 00000000..828a60b2 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md @@ -0,0 +1,77 @@ +# Contributing + +## Issues + +* Request features and report bugs using the [GitHub Issue Tracker](https://github.com/fsnotify/fsnotify/issues). +* Please indicate the platform you are using fsnotify on. +* A code example to reproduce the problem is appreciated. + +## Pull Requests + +### Contributor License Agreement + +fsnotify is derived from code in the [golang.org/x/exp](https://godoc.org/golang.org/x/exp) package and it may be included [in the standard library](https://github.com/fsnotify/fsnotify/issues/1) in the future. Therefore fsnotify carries the same [LICENSE](https://github.com/fsnotify/fsnotify/blob/master/LICENSE) as Go. Contributors retain their copyright, so you need to fill out a short form before we can accept your contribution: [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual). + +Please indicate that you have signed the CLA in your pull request. + +### How fsnotify is Developed + +* Development is done on feature branches. +* Tests are run on BSD, Linux, macOS and Windows. +* Pull requests are reviewed and [applied to master][am] using [hub][]. + * Maintainers may modify or squash commits rather than asking contributors to. +* To issue a new release, the maintainers will: + * Update the CHANGELOG + * Tag a version, which will become available through gopkg.in. + +### How to Fork + +For smooth sailing, always use the original import path. Installing with `go get` makes this easy. + +1. Install from GitHub (`go get -u github.com/fsnotify/fsnotify`) +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Ensure everything works and the tests pass (see below) +4. Commit your changes (`git commit -am 'Add some feature'`) + +Contribute upstream: + +1. Fork fsnotify on GitHub +2. Add your remote (`git remote add fork git@github.com:mycompany/repo.git`) +3. Push to the branch (`git push fork my-new-feature`) +4. Create a new Pull Request on GitHub + +This workflow is [thoroughly explained by Katrina Owen](https://splice.com/blog/contributing-open-source-git-repositories-go/). + +### Testing + +fsnotify uses build tags to compile different code on Linux, BSD, macOS, and Windows. + +Before doing a pull request, please do your best to test your changes on multiple platforms, and list which platforms you were able/unable to test on. + +To aid in cross-platform testing there is a Vagrantfile for Linux and BSD. + +* Install [Vagrant](http://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) +* Setup [Vagrant Gopher](https://github.com/nathany/vagrant-gopher) in your `src` folder. +* Run `vagrant up` from the project folder. You can also setup just one box with `vagrant up linux` or `vagrant up bsd` (note: the BSD box doesn't support Windows hosts at this time, and NFS may prompt for your host OS password) +* Once setup, you can run the test suite on a given OS with a single command `vagrant ssh linux -c 'cd fsnotify/fsnotify; go test'`. +* When you're done, you will want to halt or destroy the Vagrant boxes. + +Notice: fsnotify file system events won't trigger in shared folders. The tests get around this limitation by using the /tmp directory. + +Right now there is no equivalent solution for Windows and macOS, but there are Windows VMs [freely available from Microsoft](http://www.modern.ie/en-us/virtualization-tools#downloads). + +### Maintainers + +Help maintaining fsnotify is welcome. To be a maintainer: + +* Submit a pull request and sign the CLA as above. +* You must be able to run the test suite on Mac, Windows, Linux and BSD. + +To keep master clean, the fsnotify project uses the "apply mail" workflow outlined in Nathaniel Talbott's post ["Merge pull request" Considered Harmful][am]. This requires installing [hub][]. + +All code changes should be internal pull requests. + +Releases are tagged using [Semantic Versioning](http://semver.org/). + +[hub]: https://github.com/github/hub +[am]: http://blog.spreedly.com/2014/06/24/merge-pull-request-considered-harmful/#.VGa5yZPF_Zs diff --git a/vendor/github.com/fsnotify/fsnotify/README.md b/vendor/github.com/fsnotify/fsnotify/README.md new file mode 100644 index 00000000..39932074 --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/README.md @@ -0,0 +1,79 @@ +# File system notifications for Go + +[![GoDoc](https://godoc.org/github.com/fsnotify/fsnotify?status.svg)](https://godoc.org/github.com/fsnotify/fsnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/fsnotify/fsnotify)](https://goreportcard.com/report/github.com/fsnotify/fsnotify) + +fsnotify utilizes [golang.org/x/sys](https://godoc.org/golang.org/x/sys) rather than `syscall` from the standard library. Ensure you have the latest version installed by running: + +```console +go get -u golang.org/x/sys/... +``` + +Cross platform: Windows, Linux, BSD and macOS. + +|Adapter |OS |Status | +|----------|----------|----------| +|inotify |Linux 2.6.27 or later, Android\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| +|kqueue |BSD, macOS, iOS\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| +|ReadDirectoryChangesW|Windows|Supported [![Build status](https://ci.appveyor.com/api/projects/status/ivwjubaih4r0udeh/branch/master?svg=true)](https://ci.appveyor.com/project/NathanYoungman/fsnotify/branch/master)| +|FSEvents |macOS |[Planned](https://github.com/fsnotify/fsnotify/issues/11)| +|FEN |Solaris 11 |[In Progress](https://github.com/fsnotify/fsnotify/issues/12)| +|fanotify |Linux 2.6.37+ | | +|USN Journals |Windows |[Maybe](https://github.com/fsnotify/fsnotify/issues/53)| +|Polling |*All* |[Maybe](https://github.com/fsnotify/fsnotify/issues/9)| + +\* Android and iOS are untested. + +Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) and consult the [FAQ](#faq) for usage information. + +## API stability + +fsnotify is a fork of [howeyc/fsnotify](https://godoc.org/github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA). + +All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). Further API changes are [planned](https://github.com/fsnotify/fsnotify/milestones), and will be tagged with a new major revision number. + +Go 1.6 supports dependencies located in the `vendor/` folder. Unless you are creating a library, it is recommended that you copy fsnotify into `vendor/github.com/fsnotify/fsnotify` within your project, and likewise for `golang.org/x/sys`. + +## Contributing + +Please refer to [CONTRIBUTING][] before opening an issue or pull request. + +## Example + +See [example_test.go](https://github.com/fsnotify/fsnotify/blob/master/example_test.go). + +## FAQ + +**When a file is moved to another directory is it still being watched?** + +No (it shouldn't be, unless you are watching where it was moved to). + +**When I watch a directory, are all subdirectories watched as well?** + +No, you must add watches for any directory you want to watch (a recursive watcher is on the roadmap [#18][]). + +**Do I have to watch the Error and Event channels in a separate goroutine?** + +As of now, yes. Looking into making this single-thread friendly (see [howeyc #7][#7]) + +**Why am I receiving multiple events for the same file on OS X?** + +Spotlight indexing on OS X can result in multiple events (see [howeyc #62][#62]). A temporary workaround is to add your folder(s) to the *Spotlight Privacy settings* until we have a native FSEvents implementation (see [#11][]). + +**How many files can be watched at once?** + +There are OS-specific limits as to how many watches can be created: +* Linux: /proc/sys/fs/inotify/max_user_watches contains the limit, reaching this limit results in a "no space left on device" error. +* BSD / OSX: sysctl variables "kern.maxfiles" and "kern.maxfilesperproc", reaching these limits results in a "too many open files" error. + +[#62]: https://github.com/howeyc/fsnotify/issues/62 +[#18]: https://github.com/fsnotify/fsnotify/issues/18 +[#11]: https://github.com/fsnotify/fsnotify/issues/11 +[#7]: https://github.com/howeyc/fsnotify/issues/7 + +[contributing]: https://github.com/fsnotify/fsnotify/blob/master/CONTRIBUTING.md + +## Related Projects + +* [notify](https://github.com/rjeczalik/notify) +* [fsevents](https://github.com/fsnotify/fsevents) + diff --git a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/.gitignore b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/.gitignore new file mode 100644 index 00000000..aa7ac806 --- /dev/null +++ b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/.gitignore @@ -0,0 +1,2 @@ +.idea/ +coverage.out diff --git a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/.travis.yml b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/.travis.yml new file mode 100644 index 00000000..8408fb7b --- /dev/null +++ b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/.travis.yml @@ -0,0 +1,5 @@ +language: go + +go: + - 1.4 + - tip \ No newline at end of file diff --git a/vendor/github.com/go-telegram-bot-api/telegram-bot-api/README.md b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/README.md new file mode 100644 index 00000000..d9a6873d --- /dev/null +++ b/vendor/github.com/go-telegram-bot-api/telegram-bot-api/README.md @@ -0,0 +1,118 @@ +# Golang bindings for the Telegram Bot API + +[![GoDoc](https://godoc.org/github.com/go-telegram-bot-api/telegram-bot-api?status.svg)](http://godoc.org/github.com/go-telegram-bot-api/telegram-bot-api) +[![Travis](https://travis-ci.org/go-telegram-bot-api/telegram-bot-api.svg)](https://travis-ci.org/go-telegram-bot-api/telegram-bot-api) + +All methods have been added, and all features should be available. +If you want a feature that hasn't been added yet or something is broken, +open an issue and I'll see what I can do. + +All methods are fairly self explanatory, and reading the godoc page should +explain everything. If something isn't clear, open an issue or submit +a pull request. + +The scope of this project is just to provide a wrapper around the API +without any additional features. There are other projects for creating +something with plugins and command handlers without having to design +all that yourself. + +Use `github.com/go-telegram-bot-api/telegram-bot-api` for the latest +version, or use `gopkg.in/telegram-bot-api.v4` for the stable build. + +Join [the development group](https://telegram.me/go_telegram_bot_api) if +you want to ask questions or discuss development. + +## Example + +This is a very simple bot that just displays any gotten updates, +then replies it to that chat. + +```go +package main + +import ( + "log" + "gopkg.in/telegram-bot-api.v4" +) + +func main() { + bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken") + if err != nil { + log.Panic(err) + } + + bot.Debug = true + + log.Printf("Authorized on account %s", bot.Self.UserName) + + u := tgbotapi.NewUpdate(0) + u.Timeout = 60 + + updates, err := bot.GetUpdatesChan(u) + + for update := range updates { + if update.Message == nil { + continue + } + + log.Printf("[%s] %s", update.Message.From.UserName, update.Message.Text) + + msg := tgbotapi.NewMessage(update.Message.Chat.ID, update.Message.Text) + msg.ReplyToMessageID = update.Message.MessageID + + bot.Send(msg) + } +} +``` + +If you need to use webhooks (if you wish to run on Google App Engine), +you may use a slightly different method. + +```go +package main + +import ( + "gopkg.in/telegram-bot-api.v4" + "log" + "net/http" +) + +func main() { + bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken") + if err != nil { + log.Fatal(err) + } + + bot.Debug = true + + log.Printf("Authorized on account %s", bot.Self.UserName) + + _, err = bot.SetWebhook(tgbotapi.NewWebhookWithCert("https://www.google.com:8443/"+bot.Token, "cert.pem")) + if err != nil { + log.Fatal(err) + } + info, err := bot.GetWebhookInfo() + if err != nil { + log.Fatal(err) + } + if info.LastErrorDate != 0 { + log.Printf("[Telegram callback failed]%s", info.LastErrorMessage) + } + updates := bot.ListenForWebhook("/" + bot.Token) + go http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil) + + for update := range updates { + log.Printf("%+v\n", update) + } +} +``` + +If you need, you may generate a self signed certficate, as this requires +HTTPS / TLS. The above example tells Telegram that this is your +certificate and that it should be trusted, even though it is not +properly signed. + + openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3560 -subj "//O=Org\CN=Test" -nodes + +Now that [Let's Encrypt](https://letsencrypt.org) has entered public beta, +you may wish to generate your free TLS certificate there. diff --git a/vendor/github.com/golang/protobuf/AUTHORS b/vendor/github.com/golang/protobuf/AUTHORS new file mode 100644 index 00000000..15167cd7 --- /dev/null +++ b/vendor/github.com/golang/protobuf/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/golang/protobuf/CONTRIBUTORS b/vendor/github.com/golang/protobuf/CONTRIBUTORS new file mode 100644 index 00000000..1c4577e9 --- /dev/null +++ b/vendor/github.com/golang/protobuf/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/golang/protobuf/LICENSE b/vendor/github.com/golang/protobuf/LICENSE new file mode 100644 index 00000000..1b1b1921 --- /dev/null +++ b/vendor/github.com/golang/protobuf/LICENSE @@ -0,0 +1,31 @@ +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/golang/protobuf/proto/LICENSE b/vendor/github.com/golang/protobuf/proto/LICENSE deleted file mode 100644 index 1b1b1921..00000000 --- a/vendor/github.com/golang/protobuf/proto/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/golang/protobuf/proto/Makefile b/vendor/github.com/golang/protobuf/proto/Makefile new file mode 100644 index 00000000..e2e0651a --- /dev/null +++ b/vendor/github.com/golang/protobuf/proto/Makefile @@ -0,0 +1,43 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +install: + go install + +test: install generate-test-pbs + go test + + +generate-test-pbs: + make install + make -C testdata + protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. proto3_proto/proto3.proto + make diff --git a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go b/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go deleted file mode 100644 index cc4d0489..00000000 --- a/vendor/github.com/golang/protobuf/proto/proto3_proto/proto3.pb.go +++ /dev/null @@ -1,347 +0,0 @@ -// Code generated by protoc-gen-go. -// source: proto3_proto/proto3.proto -// DO NOT EDIT! - -/* -Package proto3_proto is a generated protocol buffer package. - -It is generated from these files: - proto3_proto/proto3.proto - -It has these top-level messages: - Message - Nested - MessageWithMap - IntMap - IntMaps -*/ -package proto3_proto - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/any" -import testdata "github.com/golang/protobuf/proto/testdata" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Message_Humour int32 - -const ( - Message_UNKNOWN Message_Humour = 0 - Message_PUNS Message_Humour = 1 - Message_SLAPSTICK Message_Humour = 2 - Message_BILL_BAILEY Message_Humour = 3 -) - -var Message_Humour_name = map[int32]string{ - 0: "UNKNOWN", - 1: "PUNS", - 2: "SLAPSTICK", - 3: "BILL_BAILEY", -} -var Message_Humour_value = map[string]int32{ - "UNKNOWN": 0, - "PUNS": 1, - "SLAPSTICK": 2, - "BILL_BAILEY": 3, -} - -func (x Message_Humour) String() string { - return proto.EnumName(Message_Humour_name, int32(x)) -} -func (Message_Humour) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } - -type Message struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"` - HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm,json=heightInCm" json:"height_in_cm,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - ResultCount int64 `protobuf:"varint,7,opt,name=result_count,json=resultCount" json:"result_count,omitempty"` - TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman,json=trueScotsman" json:"true_scotsman,omitempty"` - Score float32 `protobuf:"fixed32,9,opt,name=score" json:"score,omitempty"` - Key []uint64 `protobuf:"varint,5,rep,packed,name=key" json:"key,omitempty"` - ShortKey []int32 `protobuf:"varint,19,rep,packed,name=short_key,json=shortKey" json:"short_key,omitempty"` - Nested *Nested `protobuf:"bytes,6,opt,name=nested" json:"nested,omitempty"` - RFunny []Message_Humour `protobuf:"varint,16,rep,packed,name=r_funny,json=rFunny,enum=proto3_proto.Message_Humour" json:"r_funny,omitempty"` - Terrain map[string]*Nested `protobuf:"bytes,10,rep,name=terrain" json:"terrain,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Proto2Field *testdata.SubDefaults `protobuf:"bytes,11,opt,name=proto2_field,json=proto2Field" json:"proto2_field,omitempty"` - Proto2Value map[string]*testdata.SubDefaults `protobuf:"bytes,13,rep,name=proto2_value,json=proto2Value" json:"proto2_value,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Anything *google_protobuf.Any `protobuf:"bytes,14,opt,name=anything" json:"anything,omitempty"` - ManyThings []*google_protobuf.Any `protobuf:"bytes,15,rep,name=many_things,json=manyThings" json:"many_things,omitempty"` - Submessage *Message `protobuf:"bytes,17,opt,name=submessage" json:"submessage,omitempty"` - Children []*Message `protobuf:"bytes,18,rep,name=children" json:"children,omitempty"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Message) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Message) GetHilarity() Message_Humour { - if m != nil { - return m.Hilarity - } - return Message_UNKNOWN -} - -func (m *Message) GetHeightInCm() uint32 { - if m != nil { - return m.HeightInCm - } - return 0 -} - -func (m *Message) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *Message) GetResultCount() int64 { - if m != nil { - return m.ResultCount - } - return 0 -} - -func (m *Message) GetTrueScotsman() bool { - if m != nil { - return m.TrueScotsman - } - return false -} - -func (m *Message) GetScore() float32 { - if m != nil { - return m.Score - } - return 0 -} - -func (m *Message) GetKey() []uint64 { - if m != nil { - return m.Key - } - return nil -} - -func (m *Message) GetShortKey() []int32 { - if m != nil { - return m.ShortKey - } - return nil -} - -func (m *Message) GetNested() *Nested { - if m != nil { - return m.Nested - } - return nil -} - -func (m *Message) GetRFunny() []Message_Humour { - if m != nil { - return m.RFunny - } - return nil -} - -func (m *Message) GetTerrain() map[string]*Nested { - if m != nil { - return m.Terrain - } - return nil -} - -func (m *Message) GetProto2Field() *testdata.SubDefaults { - if m != nil { - return m.Proto2Field - } - return nil -} - -func (m *Message) GetProto2Value() map[string]*testdata.SubDefaults { - if m != nil { - return m.Proto2Value - } - return nil -} - -func (m *Message) GetAnything() *google_protobuf.Any { - if m != nil { - return m.Anything - } - return nil -} - -func (m *Message) GetManyThings() []*google_protobuf.Any { - if m != nil { - return m.ManyThings - } - return nil -} - -func (m *Message) GetSubmessage() *Message { - if m != nil { - return m.Submessage - } - return nil -} - -func (m *Message) GetChildren() []*Message { - if m != nil { - return m.Children - } - return nil -} - -type Nested struct { - Bunny string `protobuf:"bytes,1,opt,name=bunny" json:"bunny,omitempty"` - Cute bool `protobuf:"varint,2,opt,name=cute" json:"cute,omitempty"` -} - -func (m *Nested) Reset() { *m = Nested{} } -func (m *Nested) String() string { return proto.CompactTextString(m) } -func (*Nested) ProtoMessage() {} -func (*Nested) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Nested) GetBunny() string { - if m != nil { - return m.Bunny - } - return "" -} - -func (m *Nested) GetCute() bool { - if m != nil { - return m.Cute - } - return false -} - -type MessageWithMap struct { - ByteMapping map[bool][]byte `protobuf:"bytes,1,rep,name=byte_mapping,json=byteMapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } -func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } -func (*MessageWithMap) ProtoMessage() {} -func (*MessageWithMap) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *MessageWithMap) GetByteMapping() map[bool][]byte { - if m != nil { - return m.ByteMapping - } - return nil -} - -type IntMap struct { - Rtt map[int32]int32 `protobuf:"bytes,1,rep,name=rtt" json:"rtt,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` -} - -func (m *IntMap) Reset() { *m = IntMap{} } -func (m *IntMap) String() string { return proto.CompactTextString(m) } -func (*IntMap) ProtoMessage() {} -func (*IntMap) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *IntMap) GetRtt() map[int32]int32 { - if m != nil { - return m.Rtt - } - return nil -} - -type IntMaps struct { - Maps []*IntMap `protobuf:"bytes,1,rep,name=maps" json:"maps,omitempty"` -} - -func (m *IntMaps) Reset() { *m = IntMaps{} } -func (m *IntMaps) String() string { return proto.CompactTextString(m) } -func (*IntMaps) ProtoMessage() {} -func (*IntMaps) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *IntMaps) GetMaps() []*IntMap { - if m != nil { - return m.Maps - } - return nil -} - -func init() { - proto.RegisterType((*Message)(nil), "proto3_proto.Message") - proto.RegisterType((*Nested)(nil), "proto3_proto.Nested") - proto.RegisterType((*MessageWithMap)(nil), "proto3_proto.MessageWithMap") - proto.RegisterType((*IntMap)(nil), "proto3_proto.IntMap") - proto.RegisterType((*IntMaps)(nil), "proto3_proto.IntMaps") - proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value) -} - -func init() { proto.RegisterFile("proto3_proto/proto3.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x53, 0x6d, 0x6f, 0xf3, 0x34, - 0x14, 0x25, 0x4d, 0x5f, 0xd2, 0x9b, 0x74, 0x0b, 0x5e, 0x91, 0xbc, 0x02, 0x52, 0x28, 0x12, 0x8a, - 0x78, 0x49, 0xa1, 0xd3, 0xd0, 0x84, 0x10, 0x68, 0x1b, 0x9b, 0xa8, 0xd6, 0x95, 0xca, 0xdd, 0x98, - 0xf8, 0x14, 0xa5, 0xad, 0xdb, 0x46, 0x34, 0x4e, 0x49, 0x1c, 0xa4, 0xfc, 0x1d, 0xfe, 0x28, 0x8f, - 0x6c, 0xa7, 0x5d, 0x36, 0x65, 0xcf, 0xf3, 0x29, 0xf6, 0xf1, 0xb9, 0xf7, 0x9c, 0x1c, 0x5f, 0xc3, - 0xe9, 0x2e, 0x89, 0x79, 0x7c, 0xe6, 0xcb, 0xcf, 0x40, 0x6d, 0x3c, 0xf9, 0x41, 0x56, 0xf9, 0xa8, - 0x77, 0xba, 0x8e, 0xe3, 0xf5, 0x96, 0x2a, 0xca, 0x3c, 0x5b, 0x0d, 0x02, 0x96, 0x2b, 0x62, 0xef, - 0x84, 0xd3, 0x94, 0x2f, 0x03, 0x1e, 0x0c, 0xc4, 0x42, 0x81, 0xfd, 0xff, 0x5b, 0xd0, 0xba, 0xa7, - 0x69, 0x1a, 0xac, 0x29, 0x42, 0x50, 0x67, 0x41, 0x44, 0xb1, 0xe6, 0x68, 0x6e, 0x9b, 0xc8, 0x35, - 0xba, 0x00, 0x63, 0x13, 0x6e, 0x83, 0x24, 0xe4, 0x39, 0xae, 0x39, 0x9a, 0x7b, 0x34, 0xfc, 0xcc, - 0x2b, 0x0b, 0x7a, 0x45, 0xb1, 0xf7, 0x7b, 0x16, 0xc5, 0x59, 0x42, 0x0e, 0x6c, 0xe4, 0x80, 0xb5, - 0xa1, 0xe1, 0x7a, 0xc3, 0xfd, 0x90, 0xf9, 0x8b, 0x08, 0xeb, 0x8e, 0xe6, 0x76, 0x08, 0x28, 0x6c, - 0xc4, 0xae, 0x23, 0xa1, 0x27, 0xec, 0xe0, 0xba, 0xa3, 0xb9, 0x16, 0x91, 0x6b, 0xf4, 0x05, 0x58, - 0x09, 0x4d, 0xb3, 0x2d, 0xf7, 0x17, 0x71, 0xc6, 0x38, 0x6e, 0x39, 0x9a, 0xab, 0x13, 0x53, 0x61, - 0xd7, 0x02, 0x42, 0x5f, 0x42, 0x87, 0x27, 0x19, 0xf5, 0xd3, 0x45, 0xcc, 0xd3, 0x28, 0x60, 0xd8, - 0x70, 0x34, 0xd7, 0x20, 0x96, 0x00, 0x67, 0x05, 0x86, 0xba, 0xd0, 0x48, 0x17, 0x71, 0x42, 0x71, - 0xdb, 0xd1, 0xdc, 0x1a, 0x51, 0x1b, 0x64, 0x83, 0xfe, 0x37, 0xcd, 0x71, 0xc3, 0xd1, 0xdd, 0x3a, - 0x11, 0x4b, 0xf4, 0x29, 0xb4, 0xd3, 0x4d, 0x9c, 0x70, 0x5f, 0xe0, 0x27, 0x8e, 0xee, 0x36, 0x88, - 0x21, 0x81, 0x3b, 0x9a, 0xa3, 0x6f, 0xa1, 0xc9, 0x68, 0xca, 0xe9, 0x12, 0x37, 0x1d, 0xcd, 0x35, - 0x87, 0xdd, 0x97, 0xbf, 0x3e, 0x91, 0x67, 0xa4, 0xe0, 0xa0, 0x73, 0x68, 0x25, 0xfe, 0x2a, 0x63, - 0x2c, 0xc7, 0xb6, 0xa3, 0x7f, 0x30, 0xa9, 0x66, 0x72, 0x2b, 0xb8, 0xe8, 0x67, 0x68, 0x71, 0x9a, - 0x24, 0x41, 0xc8, 0x30, 0x38, 0xba, 0x6b, 0x0e, 0xfb, 0xd5, 0x65, 0x0f, 0x8a, 0x74, 0xc3, 0x78, - 0x92, 0x93, 0x7d, 0x09, 0xba, 0x00, 0x75, 0xff, 0x43, 0x7f, 0x15, 0xd2, 0xed, 0x12, 0x9b, 0xd2, - 0xe8, 0x27, 0xde, 0xfe, 0xae, 0xbd, 0x59, 0x36, 0xff, 0x8d, 0xae, 0x82, 0x6c, 0xcb, 0x53, 0x62, - 0x2a, 0xea, 0xad, 0x60, 0xa2, 0xd1, 0xa1, 0xf2, 0xdf, 0x60, 0x9b, 0x51, 0xdc, 0x91, 0xe2, 0x5f, - 0x55, 0x8b, 0x4f, 0x25, 0xf3, 0x4f, 0x41, 0x54, 0x06, 0x8a, 0x56, 0x12, 0x41, 0xdf, 0x83, 0x11, - 0xb0, 0x9c, 0x6f, 0x42, 0xb6, 0xc6, 0x47, 0x45, 0x52, 0x6a, 0x0e, 0xbd, 0xfd, 0x1c, 0x7a, 0x97, - 0x2c, 0x27, 0x07, 0x16, 0x3a, 0x07, 0x33, 0x0a, 0x58, 0xee, 0xcb, 0x5d, 0x8a, 0x8f, 0xa5, 0x76, - 0x75, 0x11, 0x08, 0xe2, 0x83, 0xe4, 0xa1, 0x73, 0x80, 0x34, 0x9b, 0x47, 0xca, 0x14, 0xfe, 0xb8, - 0xf8, 0xd7, 0x2a, 0xc7, 0xa4, 0x44, 0x44, 0x3f, 0x80, 0xb1, 0xd8, 0x84, 0xdb, 0x65, 0x42, 0x19, - 0x46, 0x52, 0xea, 0x8d, 0xa2, 0x03, 0xad, 0x37, 0x05, 0xab, 0x1c, 0xf8, 0x7e, 0x72, 0xd4, 0xd3, - 0x90, 0x93, 0xf3, 0x35, 0x34, 0x54, 0x70, 0xb5, 0xf7, 0xcc, 0x86, 0xa2, 0xfc, 0x54, 0xbb, 0xd0, - 0x7a, 0x8f, 0x60, 0xbf, 0x4e, 0xb1, 0xa2, 0xeb, 0x37, 0x2f, 0xbb, 0xbe, 0x71, 0x91, 0xcf, 0x6d, - 0xfb, 0xbf, 0x42, 0x53, 0x0d, 0x14, 0x32, 0xa1, 0xf5, 0x38, 0xb9, 0x9b, 0xfc, 0xf1, 0x34, 0xb1, - 0x3f, 0x42, 0x06, 0xd4, 0xa7, 0x8f, 0x93, 0x99, 0xad, 0xa1, 0x0e, 0xb4, 0x67, 0xe3, 0xcb, 0xe9, - 0xec, 0x61, 0x74, 0x7d, 0x67, 0xd7, 0xd0, 0x31, 0x98, 0x57, 0xa3, 0xf1, 0xd8, 0xbf, 0xba, 0x1c, - 0x8d, 0x6f, 0xfe, 0xb2, 0xf5, 0xfe, 0x10, 0x9a, 0xca, 0xac, 0x78, 0x33, 0x73, 0x39, 0xbe, 0xca, - 0x8f, 0xda, 0x88, 0x57, 0xba, 0xc8, 0xb8, 0x32, 0x64, 0x10, 0xb9, 0xee, 0xff, 0xa7, 0xc1, 0x51, - 0x91, 0xd9, 0x53, 0xc8, 0x37, 0xf7, 0xc1, 0x0e, 0x4d, 0xc1, 0x9a, 0xe7, 0x9c, 0xfa, 0x51, 0xb0, - 0xdb, 0x89, 0x39, 0xd0, 0x64, 0xce, 0xdf, 0x55, 0xe6, 0x5c, 0xd4, 0x78, 0x57, 0x39, 0xa7, 0xf7, - 0x8a, 0x5f, 0x4c, 0xd5, 0xfc, 0x19, 0xe9, 0xfd, 0x02, 0xf6, 0x6b, 0x42, 0x39, 0x30, 0x43, 0x05, - 0xd6, 0x2d, 0x07, 0x66, 0x95, 0x93, 0xf9, 0x07, 0x9a, 0x23, 0xc6, 0x85, 0xb7, 0x01, 0xe8, 0x09, - 0xe7, 0x85, 0xa5, 0xcf, 0x5f, 0x5a, 0x52, 0x14, 0x8f, 0x70, 0xae, 0x2c, 0x08, 0x66, 0xef, 0x47, - 0x30, 0xf6, 0x40, 0x59, 0xb2, 0x51, 0x21, 0xd9, 0x28, 0x4b, 0x9e, 0x41, 0x4b, 0xf5, 0x4b, 0x91, - 0x0b, 0xf5, 0x28, 0xd8, 0xa5, 0x85, 0x68, 0xb7, 0x4a, 0x94, 0x48, 0xc6, 0xbc, 0xa9, 0x8e, 0xde, - 0x05, 0x00, 0x00, 0xff, 0xff, 0x75, 0x38, 0xad, 0x84, 0xe4, 0x05, 0x00, 0x00, -} diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/LICENSE b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/LICENSE deleted file mode 100644 index 1b1b1921..00000000 --- a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile new file mode 100644 index 00000000..41a2d04d --- /dev/null +++ b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile @@ -0,0 +1,36 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Not stored here, but descriptor.proto is in https://github.com/google/protobuf/ +# at src/google/protobuf/descriptor.proto +regenerate: + @echo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION + protoc --go_out=../../../../.. -I$(HOME)/src/protobuf/include $(HOME)/src/protobuf/include/google/protobuf/descriptor.proto diff --git a/vendor/github.com/golang/protobuf/ptypes/any/LICENSE b/vendor/github.com/golang/protobuf/ptypes/any/LICENSE deleted file mode 100644 index 1b1b1921..00000000 --- a/vendor/github.com/golang/protobuf/ptypes/any/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go deleted file mode 100644 index 1fbaa44c..00000000 --- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/golang/protobuf/ptypes/any/any.proto - -/* -Package any is a generated protocol buffer package. - -It is generated from these files: - github.com/golang/protobuf/ptypes/any/any.proto - -It has these top-level messages: - Any -*/ -package any - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -type Any struct { - // A URL/resource name whose content describes the type of the - // serialized protocol buffer message. - // - // For URLs which use the scheme `http`, `https`, or no scheme, the - // following restrictions and interpretations apply: - // - // * If no scheme is provided, `https` is assumed. - // * The last segment of the URL's path must represent the fully - // qualified name of the type (as in `path/google.protobuf.Duration`). - // The name should be in a canonical form (e.g., leading "." is - // not accepted). - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"` - // Must be a valid serialized protocol buffer of the above specified type. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Any) Reset() { *m = Any{} } -func (m *Any) String() string { return proto.CompactTextString(m) } -func (*Any) ProtoMessage() {} -func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } -func (*Any) XXX_WellKnownType() string { return "Any" } - -func (m *Any) GetTypeUrl() string { - if m != nil { - return m.TypeUrl - } - return "" -} - -func (m *Any) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func init() { - proto.RegisterType((*Any)(nil), "google.protobuf.Any") -} - -func init() { proto.RegisterFile("github.com/golang/protobuf/ptypes/any/any.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 184 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28, - 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xcc, - 0xab, 0x04, 0x61, 0x3d, 0xb0, 0xb8, 0x10, 0x7f, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x1e, 0x4c, - 0x95, 0x92, 0x19, 0x17, 0xb3, 0x63, 0x5e, 0xa5, 0x90, 0x24, 0x17, 0x07, 0x48, 0x79, 0x7c, 0x69, - 0x51, 0x8e, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x3b, 0x88, 0x1f, 0x5a, 0x94, 0x23, 0x24, - 0xc2, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a, 0x2a, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0xe1, - 0x38, 0xe5, 0x73, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1, 0x19, 0xe7, 0xc4, 0xe1, 0x98, 0x57, 0x19, - 0x00, 0xe2, 0x04, 0x30, 0x46, 0xa9, 0x12, 0xe5, 0xb8, 0x45, 0x4c, 0xcc, 0xee, 0x01, 0x4e, 0xab, - 0x98, 0xe4, 0xdc, 0x21, 0x46, 0x05, 0x40, 0x95, 0xe8, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, - 0x97, 0xe7, 0x85, 0x80, 0x94, 0x26, 0xb1, 0x81, 0xf5, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x45, 0x1f, 0x1a, 0xf2, 0xf3, 0x00, 0x00, 0x00, -} diff --git a/vendor/github.com/google/go-querystring/query/LICENSE b/vendor/github.com/google/go-querystring/query/LICENSE deleted file mode 100644 index ae121a1e..00000000 --- a/vendor/github.com/google/go-querystring/query/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Google. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go deleted file mode 100644 index 19437b34..00000000 --- a/vendor/github.com/google/go-querystring/query/encode.go +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package query implements encoding of structs into URL query parameters. -// -// As a simple example: -// -// type Options struct { -// Query string `url:"q"` -// ShowAll bool `url:"all"` -// Page int `url:"page"` -// } -// -// opt := Options{ "foo", true, 2 } -// v, _ := query.Values(opt) -// fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2" -// -// The exact mapping between Go values and url.Values is described in the -// documentation for the Values() function. -package query - -import ( - "bytes" - "fmt" - "net/url" - "reflect" - "strconv" - "strings" - "time" -) - -var timeType = reflect.TypeOf(time.Time{}) - -var encoderType = reflect.TypeOf(new(Encoder)).Elem() - -// Encoder is an interface implemented by any type that wishes to encode -// itself into URL values in a non-standard way. -type Encoder interface { - EncodeValues(key string, v *url.Values) error -} - -// Values returns the url.Values encoding of v. -// -// Values expects to be passed a struct, and traverses it recursively using the -// following encoding rules. -// -// Each exported struct field is encoded as a URL parameter unless -// -// - the field's tag is "-", or -// - the field is empty and its tag specifies the "omitempty" option -// -// The empty values are false, 0, any nil pointer or interface value, any array -// slice, map, or string of length zero, and any time.Time that returns true -// for IsZero(). -// -// The URL parameter name defaults to the struct field name but can be -// specified in the struct field's tag value. The "url" key in the struct -// field's tag value is the key name, followed by an optional comma and -// options. For example: -// -// // Field is ignored by this package. -// Field int `url:"-"` -// -// // Field appears as URL parameter "myName". -// Field int `url:"myName"` -// -// // Field appears as URL parameter "myName" and the field is omitted if -// // its value is empty -// Field int `url:"myName,omitempty"` -// -// // Field appears as URL parameter "Field" (the default), but the field -// // is skipped if empty. Note the leading comma. -// Field int `url:",omitempty"` -// -// For encoding individual field values, the following type-dependent rules -// apply: -// -// Boolean values default to encoding as the strings "true" or "false". -// Including the "int" option signals that the field should be encoded as the -// strings "1" or "0". -// -// time.Time values default to encoding as RFC3339 timestamps. Including the -// "unix" option signals that the field should be encoded as a Unix time (see -// time.Unix()) -// -// Slice and Array values default to encoding as multiple URL values of the -// same name. Including the "comma" option signals that the field should be -// encoded as a single comma-delimited value. Including the "space" option -// similarly encodes the value as a single space-delimited string. Including -// the "semicolon" option will encode the value as a semicolon-delimited string. -// Including the "brackets" option signals that the multiple URL values should -// have "[]" appended to the value name. "numbered" will append a number to -// the end of each incidence of the value name, example: -// name0=value0&name1=value1, etc. -// -// Anonymous struct fields are usually encoded as if their inner exported -// fields were fields in the outer struct, subject to the standard Go -// visibility rules. An anonymous struct field with a name given in its URL -// tag is treated as having that name, rather than being anonymous. -// -// Non-nil pointer values are encoded as the value pointed to. -// -// Nested structs are encoded including parent fields in value names for -// scoping. e.g: -// -// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO" -// -// All other values are encoded using their default string representation. -// -// Multiple fields that encode to the same URL parameter name will be included -// as multiple URL values of the same name. -func Values(v interface{}) (url.Values, error) { - values := make(url.Values) - val := reflect.ValueOf(v) - for val.Kind() == reflect.Ptr { - if val.IsNil() { - return values, nil - } - val = val.Elem() - } - - if v == nil { - return values, nil - } - - if val.Kind() != reflect.Struct { - return nil, fmt.Errorf("query: Values() expects struct input. Got %v", val.Kind()) - } - - err := reflectValue(values, val, "") - return values, err -} - -// reflectValue populates the values parameter from the struct fields in val. -// Embedded structs are followed recursively (using the rules defined in the -// Values function documentation) breadth-first. -func reflectValue(values url.Values, val reflect.Value, scope string) error { - var embedded []reflect.Value - - typ := val.Type() - for i := 0; i < typ.NumField(); i++ { - sf := typ.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { // unexported - continue - } - - sv := val.Field(i) - tag := sf.Tag.Get("url") - if tag == "-" { - continue - } - name, opts := parseTag(tag) - if name == "" { - if sf.Anonymous && sv.Kind() == reflect.Struct { - // save embedded struct for later processing - embedded = append(embedded, sv) - continue - } - - name = sf.Name - } - - if scope != "" { - name = scope + "[" + name + "]" - } - - if opts.Contains("omitempty") && isEmptyValue(sv) { - continue - } - - if sv.Type().Implements(encoderType) { - if !reflect.Indirect(sv).IsValid() { - sv = reflect.New(sv.Type().Elem()) - } - - m := sv.Interface().(Encoder) - if err := m.EncodeValues(name, &values); err != nil { - return err - } - continue - } - - if sv.Kind() == reflect.Slice || sv.Kind() == reflect.Array { - var del byte - if opts.Contains("comma") { - del = ',' - } else if opts.Contains("space") { - del = ' ' - } else if opts.Contains("semicolon") { - del = ';' - } else if opts.Contains("brackets") { - name = name + "[]" - } - - if del != 0 { - s := new(bytes.Buffer) - first := true - for i := 0; i < sv.Len(); i++ { - if first { - first = false - } else { - s.WriteByte(del) - } - s.WriteString(valueString(sv.Index(i), opts)) - } - values.Add(name, s.String()) - } else { - for i := 0; i < sv.Len(); i++ { - k := name - if opts.Contains("numbered") { - k = fmt.Sprintf("%s%d", name, i) - } - values.Add(k, valueString(sv.Index(i), opts)) - } - } - continue - } - - if sv.Type() == timeType { - values.Add(name, valueString(sv, opts)) - continue - } - - for sv.Kind() == reflect.Ptr { - if sv.IsNil() { - break - } - sv = sv.Elem() - } - - if sv.Kind() == reflect.Struct { - reflectValue(values, sv, name) - continue - } - - values.Add(name, valueString(sv, opts)) - } - - for _, f := range embedded { - if err := reflectValue(values, f, scope); err != nil { - return err - } - } - - return nil -} - -// valueString returns the string representation of a value. -func valueString(v reflect.Value, opts tagOptions) string { - for v.Kind() == reflect.Ptr { - if v.IsNil() { - return "" - } - v = v.Elem() - } - - if v.Kind() == reflect.Bool && opts.Contains("int") { - if v.Bool() { - return "1" - } - return "0" - } - - if v.Type() == timeType { - t := v.Interface().(time.Time) - if opts.Contains("unix") { - return strconv.FormatInt(t.Unix(), 10) - } - return t.Format(time.RFC3339) - } - - return fmt.Sprint(v.Interface()) -} - -// isEmptyValue checks if a value should be considered empty for the purposes -// of omitting fields with the "omitempty" option. -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - if v.Type() == timeType { - return v.Interface().(time.Time).IsZero() - } - - return false -} - -// tagOptions is the string following a comma in a struct field's "url" tag, or -// the empty string. It does not include the leading comma. -type tagOptions []string - -// parseTag splits a struct field's url tag into its name and comma-separated -// options. -func parseTag(tag string) (string, tagOptions) { - s := strings.Split(tag, ",") - return s[0], s[1:] -} - -// Contains checks whether the tagOptions contains the specified option. -func (o tagOptions) Contains(option string) bool { - for _, s := range o { - if s == option { - return true - } - } - return false -} diff --git a/vendor/github.com/google/gops/LICENSE b/vendor/github.com/google/gops/LICENSE new file mode 100644 index 00000000..55e52a01 --- /dev/null +++ b/vendor/github.com/google/gops/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/google/gops/agent/LICENSE b/vendor/github.com/google/gops/agent/LICENSE deleted file mode 100644 index 55e52a01..00000000 --- a/vendor/github.com/google/gops/agent/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2016 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/google/gops/internal/LICENSE b/vendor/github.com/google/gops/internal/LICENSE deleted file mode 100644 index 55e52a01..00000000 --- a/vendor/github.com/google/gops/internal/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2016 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/google/gops/internal/dwarf/dwarf.go b/vendor/github.com/google/gops/internal/dwarf/dwarf.go deleted file mode 100644 index c72ef5b0..00000000 --- a/vendor/github.com/google/gops/internal/dwarf/dwarf.go +++ /dev/null @@ -1,600 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package dwarf generates DWARF debugging information. -// DWARF generation is split between the compiler and the linker, -// this package contains the shared code. -package dwarf - -import ( - "fmt" -) - -// InfoPrefix is the prefix for all the symbols containing DWARF info entries. -const InfoPrefix = "go.info." - -// Sym represents a symbol. -type Sym interface { -} - -// A Var represents a local variable or a function parameter. -type Var struct { - Name string - Abbrev int // Either DW_ABRV_AUTO or DW_ABRV_PARAM - Offset int32 - Type Sym - Link *Var -} - -// A Context specifies how to add data to a Sym. -type Context interface { - PtrSize() int - AddInt(s Sym, size int, i int64) - AddBytes(s Sym, b []byte) - AddAddress(s Sym, t interface{}, ofs int64) - AddSectionOffset(s Sym, size int, t interface{}, ofs int64) - AddString(s Sym, v string) - SymValue(s Sym) int64 -} - -// AppendUleb128 appends v to b using DWARF's unsigned LEB128 encoding. -func AppendUleb128(b []byte, v uint64) []byte { - for { - c := uint8(v & 0x7f) - v >>= 7 - if v != 0 { - c |= 0x80 - } - b = append(b, c) - if c&0x80 == 0 { - break - } - } - return b -} - -// AppendSleb128 appends v to b using DWARF's signed LEB128 encoding. -func AppendSleb128(b []byte, v int64) []byte { - for { - c := uint8(v & 0x7f) - s := uint8(v & 0x40) - v >>= 7 - if (v != -1 || s == 0) && (v != 0 || s != 0) { - c |= 0x80 - } - b = append(b, c) - if c&0x80 == 0 { - break - } - } - return b -} - -var encbuf [20]byte - -// AppendUleb128 appends v to s using DWARF's unsigned LEB128 encoding. -func Uleb128put(ctxt Context, s Sym, v int64) { - b := AppendUleb128(encbuf[:0], uint64(v)) - ctxt.AddBytes(s, b) -} - -// AppendUleb128 appends v to s using DWARF's signed LEB128 encoding. -func Sleb128put(ctxt Context, s Sym, v int64) { - b := AppendSleb128(encbuf[:0], v) - ctxt.AddBytes(s, b) -} - -/* - * Defining Abbrevs. This is hardcoded, and there will be - * only a handful of them. The DWARF spec places no restriction on - * the ordering of attributes in the Abbrevs and DIEs, and we will - * always write them out in the order of declaration in the abbrev. - */ -type dwAttrForm struct { - attr uint16 - form uint8 -} - -// Go-specific type attributes. -const ( - DW_AT_go_kind = 0x2900 - DW_AT_go_key = 0x2901 - DW_AT_go_elem = 0x2902 - - DW_AT_internal_location = 253 // params and locals; not emitted -) - -// Index into the abbrevs table below. -// Keep in sync with ispubname() and ispubtype() below. -// ispubtype considers >= NULLTYPE public -const ( - DW_ABRV_NULL = iota - DW_ABRV_COMPUNIT - DW_ABRV_FUNCTION - DW_ABRV_VARIABLE - DW_ABRV_AUTO - DW_ABRV_PARAM - DW_ABRV_STRUCTFIELD - DW_ABRV_FUNCTYPEPARAM - DW_ABRV_DOTDOTDOT - DW_ABRV_ARRAYRANGE - DW_ABRV_NULLTYPE - DW_ABRV_BASETYPE - DW_ABRV_ARRAYTYPE - DW_ABRV_CHANTYPE - DW_ABRV_FUNCTYPE - DW_ABRV_IFACETYPE - DW_ABRV_MAPTYPE - DW_ABRV_PTRTYPE - DW_ABRV_BARE_PTRTYPE // only for void*, no DW_AT_type attr to please gdb 6. - DW_ABRV_SLICETYPE - DW_ABRV_STRINGTYPE - DW_ABRV_STRUCTTYPE - DW_ABRV_TYPEDECL - DW_NABRV -) - -type dwAbbrev struct { - tag uint8 - children uint8 - attr []dwAttrForm -} - -var abbrevs = [DW_NABRV]dwAbbrev{ - /* The mandatory DW_ABRV_NULL entry. */ - {0, 0, []dwAttrForm{}}, - - /* COMPUNIT */ - { - DW_TAG_compile_unit, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_language, DW_FORM_data1}, - {DW_AT_low_pc, DW_FORM_addr}, - {DW_AT_high_pc, DW_FORM_addr}, - {DW_AT_stmt_list, DW_FORM_data4}, - {DW_AT_comp_dir, DW_FORM_string}, - }, - }, - - /* FUNCTION */ - { - DW_TAG_subprogram, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_low_pc, DW_FORM_addr}, - {DW_AT_high_pc, DW_FORM_addr}, - {DW_AT_external, DW_FORM_flag}, - }, - }, - - /* VARIABLE */ - { - DW_TAG_variable, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_location, DW_FORM_block1}, - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_external, DW_FORM_flag}, - }, - }, - - /* AUTO */ - { - DW_TAG_variable, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_location, DW_FORM_block1}, - {DW_AT_type, DW_FORM_ref_addr}, - }, - }, - - /* PARAM */ - { - DW_TAG_formal_parameter, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_location, DW_FORM_block1}, - {DW_AT_type, DW_FORM_ref_addr}, - }, - }, - - /* STRUCTFIELD */ - { - DW_TAG_member, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_data_member_location, DW_FORM_block1}, - {DW_AT_type, DW_FORM_ref_addr}, - }, - }, - - /* FUNCTYPEPARAM */ - { - DW_TAG_formal_parameter, - DW_CHILDREN_no, - - // No name! - []dwAttrForm{ - {DW_AT_type, DW_FORM_ref_addr}, - }, - }, - - /* DOTDOTDOT */ - { - DW_TAG_unspecified_parameters, - DW_CHILDREN_no, - []dwAttrForm{}, - }, - - /* ARRAYRANGE */ - { - DW_TAG_subrange_type, - DW_CHILDREN_no, - - // No name! - []dwAttrForm{ - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_count, DW_FORM_udata}, - }, - }, - - // Below here are the types considered public by ispubtype - /* NULLTYPE */ - { - DW_TAG_unspecified_type, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - }, - }, - - /* BASETYPE */ - { - DW_TAG_base_type, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_encoding, DW_FORM_data1}, - {DW_AT_byte_size, DW_FORM_data1}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* ARRAYTYPE */ - // child is subrange with upper bound - { - DW_TAG_array_type, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_byte_size, DW_FORM_udata}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* CHANTYPE */ - { - DW_TAG_typedef, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_go_kind, DW_FORM_data1}, - {DW_AT_go_elem, DW_FORM_ref_addr}, - }, - }, - - /* FUNCTYPE */ - { - DW_TAG_subroutine_type, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - // {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* IFACETYPE */ - { - DW_TAG_typedef, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* MAPTYPE */ - { - DW_TAG_typedef, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_go_kind, DW_FORM_data1}, - {DW_AT_go_key, DW_FORM_ref_addr}, - {DW_AT_go_elem, DW_FORM_ref_addr}, - }, - }, - - /* PTRTYPE */ - { - DW_TAG_pointer_type, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_type, DW_FORM_ref_addr}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* BARE_PTRTYPE */ - { - DW_TAG_pointer_type, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - }, - }, - - /* SLICETYPE */ - { - DW_TAG_structure_type, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_byte_size, DW_FORM_udata}, - {DW_AT_go_kind, DW_FORM_data1}, - {DW_AT_go_elem, DW_FORM_ref_addr}, - }, - }, - - /* STRINGTYPE */ - { - DW_TAG_structure_type, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_byte_size, DW_FORM_udata}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* STRUCTTYPE */ - { - DW_TAG_structure_type, - DW_CHILDREN_yes, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_byte_size, DW_FORM_udata}, - {DW_AT_go_kind, DW_FORM_data1}, - }, - }, - - /* TYPEDECL */ - { - DW_TAG_typedef, - DW_CHILDREN_no, - []dwAttrForm{ - {DW_AT_name, DW_FORM_string}, - {DW_AT_type, DW_FORM_ref_addr}, - }, - }, -} - -// GetAbbrev returns the contents of the .debug_abbrev section. -func GetAbbrev() []byte { - var buf []byte - for i := 1; i < DW_NABRV; i++ { - // See section 7.5.3 - buf = AppendUleb128(buf, uint64(i)) - - buf = AppendUleb128(buf, uint64(abbrevs[i].tag)) - buf = append(buf, byte(abbrevs[i].children)) - for _, f := range abbrevs[i].attr { - buf = AppendUleb128(buf, uint64(f.attr)) - buf = AppendUleb128(buf, uint64(f.form)) - } - buf = append(buf, 0, 0) - } - return append(buf, 0) -} - -/* - * Debugging Information Entries and their attributes. - */ - -// DWAttr represents an attribute of a DWDie. -// -// For DW_CLS_string and _block, value should contain the length, and -// data the data, for _reference, value is 0 and data is a DWDie* to -// the referenced instance, for all others, value is the whole thing -// and data is null. -type DWAttr struct { - Link *DWAttr - Atr uint16 // DW_AT_ - Cls uint8 // DW_CLS_ - Value int64 - Data interface{} -} - -// DWDie represents a DWARF debug info entry. -type DWDie struct { - Abbrev int - Link *DWDie - Child *DWDie - Attr *DWAttr - Sym Sym -} - -func putattr(ctxt Context, s Sym, abbrev int, form int, cls int, value int64, data interface{}) error { - switch form { - case DW_FORM_addr: // address - ctxt.AddAddress(s, data, value) - - case DW_FORM_block1: // block - if cls == DW_CLS_ADDRESS { - ctxt.AddInt(s, 1, int64(1+ctxt.PtrSize())) - ctxt.AddInt(s, 1, DW_OP_addr) - ctxt.AddAddress(s, data, 0) - break - } - - value &= 0xff - ctxt.AddInt(s, 1, value) - p := data.([]byte)[:value] - ctxt.AddBytes(s, p) - - case DW_FORM_block2: // block - value &= 0xffff - - ctxt.AddInt(s, 2, value) - p := data.([]byte)[:value] - ctxt.AddBytes(s, p) - - case DW_FORM_block4: // block - value &= 0xffffffff - - ctxt.AddInt(s, 4, value) - p := data.([]byte)[:value] - ctxt.AddBytes(s, p) - - case DW_FORM_block: // block - Uleb128put(ctxt, s, value) - - p := data.([]byte)[:value] - ctxt.AddBytes(s, p) - - case DW_FORM_data1: // constant - ctxt.AddInt(s, 1, value) - - case DW_FORM_data2: // constant - ctxt.AddInt(s, 2, value) - - case DW_FORM_data4: // constant, {line,loclist,mac,rangelist}ptr - if cls == DW_CLS_PTR { // DW_AT_stmt_list - ctxt.AddSectionOffset(s, 4, data, 0) - break - } - ctxt.AddInt(s, 4, value) - - case DW_FORM_data8: // constant, {line,loclist,mac,rangelist}ptr - ctxt.AddInt(s, 8, value) - - case DW_FORM_sdata: // constant - Sleb128put(ctxt, s, value) - - case DW_FORM_udata: // constant - Uleb128put(ctxt, s, value) - - case DW_FORM_string: // string - str := data.(string) - ctxt.AddString(s, str) - // TODO(ribrdb): verify padded strings are never used and remove this - for i := int64(len(str)); i < value; i++ { - ctxt.AddInt(s, 1, 0) - } - - case DW_FORM_flag: // flag - if value != 0 { - ctxt.AddInt(s, 1, 1) - } else { - ctxt.AddInt(s, 1, 0) - } - - // In DWARF 2 (which is what we claim to generate), - // the ref_addr is the same size as a normal address. - // In DWARF 3 it is always 32 bits, unless emitting a large - // (> 4 GB of debug info aka "64-bit") unit, which we don't implement. - case DW_FORM_ref_addr: // reference to a DIE in the .info section - if data == nil { - return fmt.Errorf("dwarf: null reference in %d", abbrev) - } else { - ctxt.AddSectionOffset(s, ctxt.PtrSize(), data, 0) - } - - case DW_FORM_ref1, // reference within the compilation unit - DW_FORM_ref2, // reference - DW_FORM_ref4, // reference - DW_FORM_ref8, // reference - DW_FORM_ref_udata, // reference - - DW_FORM_strp, // string - DW_FORM_indirect: // (see Section 7.5.3) - fallthrough - default: - return fmt.Errorf("dwarf: unsupported attribute form %d / class %d", form, cls) - } - return nil -} - -// PutAttrs writes the attributes for a DIE to symbol 's'. -// -// Note that we can (and do) add arbitrary attributes to a DIE, but -// only the ones actually listed in the Abbrev will be written out. -func PutAttrs(ctxt Context, s Sym, abbrev int, attr *DWAttr) { -Outer: - for _, f := range abbrevs[abbrev].attr { - for ap := attr; ap != nil; ap = ap.Link { - if ap.Atr == f.attr { - putattr(ctxt, s, abbrev, int(f.form), int(ap.Cls), ap.Value, ap.Data) - continue Outer - } - } - - putattr(ctxt, s, abbrev, int(f.form), 0, 0, nil) - } -} - -// HasChildren returns true if 'die' uses an abbrev that supports children. -func HasChildren(die *DWDie) bool { - return abbrevs[die.Abbrev].children != 0 -} - -// PutFunc writes a DIE for a function to s. -// It also writes child DIEs for each variable in vars. -func PutFunc(ctxt Context, s Sym, name string, external bool, startPC Sym, size int64, vars *Var) { - Uleb128put(ctxt, s, DW_ABRV_FUNCTION) - putattr(ctxt, s, DW_ABRV_FUNCTION, DW_FORM_string, DW_CLS_STRING, int64(len(name)), name) - putattr(ctxt, s, DW_ABRV_FUNCTION, DW_FORM_addr, DW_CLS_ADDRESS, 0, startPC) - putattr(ctxt, s, DW_ABRV_FUNCTION, DW_FORM_addr, DW_CLS_ADDRESS, size+ctxt.SymValue(startPC), startPC) - var ev int64 - if external { - ev = 1 - } - putattr(ctxt, s, DW_ABRV_FUNCTION, DW_FORM_flag, DW_CLS_FLAG, ev, 0) - names := make(map[string]bool) - for v := vars; v != nil; v = v.Link { - var n string - if names[v.Name] { - n = fmt.Sprintf("%s#%d", v.Name, len(names)) - } else { - n = v.Name - } - names[n] = true - - Uleb128put(ctxt, s, int64(v.Abbrev)) - putattr(ctxt, s, v.Abbrev, DW_FORM_string, DW_CLS_STRING, int64(len(n)), n) - loc := append(encbuf[:0], DW_OP_call_frame_cfa) - if v.Offset != 0 { - loc = append(loc, DW_OP_consts) - loc = AppendSleb128(loc, int64(v.Offset)) - loc = append(loc, DW_OP_plus) - } - putattr(ctxt, s, v.Abbrev, DW_FORM_block1, DW_CLS_BLOCK, int64(len(loc)), loc) - putattr(ctxt, s, v.Abbrev, DW_FORM_ref_addr, DW_CLS_REFERENCE, 0, v.Type) - - } - Uleb128put(ctxt, s, 0) -} diff --git a/vendor/github.com/google/gops/internal/dwarf/dwarf_defs.go b/vendor/github.com/google/gops/internal/dwarf/dwarf_defs.go deleted file mode 100644 index d1870b57..00000000 --- a/vendor/github.com/google/gops/internal/dwarf/dwarf_defs.go +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package dwarf - -// Cut, pasted, tr-and-awk'ed from tables in -// http://dwarfstd.org/doc/Dwarf3.pdf - -// Table 18 -const ( - DW_TAG_array_type = 0x01 - DW_TAG_class_type = 0x02 - DW_TAG_entry_point = 0x03 - DW_TAG_enumeration_type = 0x04 - DW_TAG_formal_parameter = 0x05 - DW_TAG_imported_declaration = 0x08 - DW_TAG_label = 0x0a - DW_TAG_lexical_block = 0x0b - DW_TAG_member = 0x0d - DW_TAG_pointer_type = 0x0f - DW_TAG_reference_type = 0x10 - DW_TAG_compile_unit = 0x11 - DW_TAG_string_type = 0x12 - DW_TAG_structure_type = 0x13 - DW_TAG_subroutine_type = 0x15 - DW_TAG_typedef = 0x16 - DW_TAG_union_type = 0x17 - DW_TAG_unspecified_parameters = 0x18 - DW_TAG_variant = 0x19 - DW_TAG_common_block = 0x1a - DW_TAG_common_inclusion = 0x1b - DW_TAG_inheritance = 0x1c - DW_TAG_inlined_subroutine = 0x1d - DW_TAG_module = 0x1e - DW_TAG_ptr_to_member_type = 0x1f - DW_TAG_set_type = 0x20 - DW_TAG_subrange_type = 0x21 - DW_TAG_with_stmt = 0x22 - DW_TAG_access_declaration = 0x23 - DW_TAG_base_type = 0x24 - DW_TAG_catch_block = 0x25 - DW_TAG_const_type = 0x26 - DW_TAG_constant = 0x27 - DW_TAG_enumerator = 0x28 - DW_TAG_file_type = 0x29 - DW_TAG_friend = 0x2a - DW_TAG_namelist = 0x2b - DW_TAG_namelist_item = 0x2c - DW_TAG_packed_type = 0x2d - DW_TAG_subprogram = 0x2e - DW_TAG_template_type_parameter = 0x2f - DW_TAG_template_value_parameter = 0x30 - DW_TAG_thrown_type = 0x31 - DW_TAG_try_block = 0x32 - DW_TAG_variant_part = 0x33 - DW_TAG_variable = 0x34 - DW_TAG_volatile_type = 0x35 - // Dwarf3 - DW_TAG_dwarf_procedure = 0x36 - DW_TAG_restrict_type = 0x37 - DW_TAG_interface_type = 0x38 - DW_TAG_namespace = 0x39 - DW_TAG_imported_module = 0x3a - DW_TAG_unspecified_type = 0x3b - DW_TAG_partial_unit = 0x3c - DW_TAG_imported_unit = 0x3d - DW_TAG_condition = 0x3f - DW_TAG_shared_type = 0x40 - // Dwarf4 - DW_TAG_type_unit = 0x41 - DW_TAG_rvalue_reference_type = 0x42 - DW_TAG_template_alias = 0x43 - - // User defined - DW_TAG_lo_user = 0x4080 - DW_TAG_hi_user = 0xffff -) - -// Table 19 -const ( - DW_CHILDREN_no = 0x00 - DW_CHILDREN_yes = 0x01 -) - -// Not from the spec, but logically belongs here -const ( - DW_CLS_ADDRESS = 0x01 + iota - DW_CLS_BLOCK - DW_CLS_CONSTANT - DW_CLS_FLAG - DW_CLS_PTR // lineptr, loclistptr, macptr, rangelistptr - DW_CLS_REFERENCE - DW_CLS_ADDRLOC - DW_CLS_STRING -) - -// Table 20 -const ( - DW_AT_sibling = 0x01 // reference - DW_AT_location = 0x02 // block, loclistptr - DW_AT_name = 0x03 // string - DW_AT_ordering = 0x09 // constant - DW_AT_byte_size = 0x0b // block, constant, reference - DW_AT_bit_offset = 0x0c // block, constant, reference - DW_AT_bit_size = 0x0d // block, constant, reference - DW_AT_stmt_list = 0x10 // lineptr - DW_AT_low_pc = 0x11 // address - DW_AT_high_pc = 0x12 // address - DW_AT_language = 0x13 // constant - DW_AT_discr = 0x15 // reference - DW_AT_discr_value = 0x16 // constant - DW_AT_visibility = 0x17 // constant - DW_AT_import = 0x18 // reference - DW_AT_string_length = 0x19 // block, loclistptr - DW_AT_common_reference = 0x1a // reference - DW_AT_comp_dir = 0x1b // string - DW_AT_const_value = 0x1c // block, constant, string - DW_AT_containing_type = 0x1d // reference - DW_AT_default_value = 0x1e // reference - DW_AT_inline = 0x20 // constant - DW_AT_is_optional = 0x21 // flag - DW_AT_lower_bound = 0x22 // block, constant, reference - DW_AT_producer = 0x25 // string - DW_AT_prototyped = 0x27 // flag - DW_AT_return_addr = 0x2a // block, loclistptr - DW_AT_start_scope = 0x2c // constant - DW_AT_bit_stride = 0x2e // constant - DW_AT_upper_bound = 0x2f // block, constant, reference - DW_AT_abstract_origin = 0x31 // reference - DW_AT_accessibility = 0x32 // constant - DW_AT_address_class = 0x33 // constant - DW_AT_artificial = 0x34 // flag - DW_AT_base_types = 0x35 // reference - DW_AT_calling_convention = 0x36 // constant - DW_AT_count = 0x37 // block, constant, reference - DW_AT_data_member_location = 0x38 // block, constant, loclistptr - DW_AT_decl_column = 0x39 // constant - DW_AT_decl_file = 0x3a // constant - DW_AT_decl_line = 0x3b // constant - DW_AT_declaration = 0x3c // flag - DW_AT_discr_list = 0x3d // block - DW_AT_encoding = 0x3e // constant - DW_AT_external = 0x3f // flag - DW_AT_frame_base = 0x40 // block, loclistptr - DW_AT_friend = 0x41 // reference - DW_AT_identifier_case = 0x42 // constant - DW_AT_macro_info = 0x43 // macptr - DW_AT_namelist_item = 0x44 // block - DW_AT_priority = 0x45 // reference - DW_AT_segment = 0x46 // block, loclistptr - DW_AT_specification = 0x47 // reference - DW_AT_static_link = 0x48 // block, loclistptr - DW_AT_type = 0x49 // reference - DW_AT_use_location = 0x4a // block, loclistptr - DW_AT_variable_parameter = 0x4b // flag - DW_AT_virtuality = 0x4c // constant - DW_AT_vtable_elem_location = 0x4d // block, loclistptr - // Dwarf3 - DW_AT_allocated = 0x4e // block, constant, reference - DW_AT_associated = 0x4f // block, constant, reference - DW_AT_data_location = 0x50 // block - DW_AT_byte_stride = 0x51 // block, constant, reference - DW_AT_entry_pc = 0x52 // address - DW_AT_use_UTF8 = 0x53 // flag - DW_AT_extension = 0x54 // reference - DW_AT_ranges = 0x55 // rangelistptr - DW_AT_trampoline = 0x56 // address, flag, reference, string - DW_AT_call_column = 0x57 // constant - DW_AT_call_file = 0x58 // constant - DW_AT_call_line = 0x59 // constant - DW_AT_description = 0x5a // string - DW_AT_binary_scale = 0x5b // constant - DW_AT_decimal_scale = 0x5c // constant - DW_AT_small = 0x5d // reference - DW_AT_decimal_sign = 0x5e // constant - DW_AT_digit_count = 0x5f // constant - DW_AT_picture_string = 0x60 // string - DW_AT_mutable = 0x61 // flag - DW_AT_threads_scaled = 0x62 // flag - DW_AT_explicit = 0x63 // flag - DW_AT_object_pointer = 0x64 // reference - DW_AT_endianity = 0x65 // constant - DW_AT_elemental = 0x66 // flag - DW_AT_pure = 0x67 // flag - DW_AT_recursive = 0x68 // flag - - DW_AT_lo_user = 0x2000 // --- - DW_AT_hi_user = 0x3fff // --- -) - -// Table 21 -const ( - DW_FORM_addr = 0x01 // address - DW_FORM_block2 = 0x03 // block - DW_FORM_block4 = 0x04 // block - DW_FORM_data2 = 0x05 // constant - DW_FORM_data4 = 0x06 // constant, lineptr, loclistptr, macptr, rangelistptr - DW_FORM_data8 = 0x07 // constant, lineptr, loclistptr, macptr, rangelistptr - DW_FORM_string = 0x08 // string - DW_FORM_block = 0x09 // block - DW_FORM_block1 = 0x0a // block - DW_FORM_data1 = 0x0b // constant - DW_FORM_flag = 0x0c // flag - DW_FORM_sdata = 0x0d // constant - DW_FORM_strp = 0x0e // string - DW_FORM_udata = 0x0f // constant - DW_FORM_ref_addr = 0x10 // reference - DW_FORM_ref1 = 0x11 // reference - DW_FORM_ref2 = 0x12 // reference - DW_FORM_ref4 = 0x13 // reference - DW_FORM_ref8 = 0x14 // reference - DW_FORM_ref_udata = 0x15 // reference - DW_FORM_indirect = 0x16 // (see Section 7.5.3) -) - -// Table 24 (#operands, notes) -const ( - DW_OP_addr = 0x03 // 1 constant address (size target specific) - DW_OP_deref = 0x06 // 0 - DW_OP_const1u = 0x08 // 1 1-byte constant - DW_OP_const1s = 0x09 // 1 1-byte constant - DW_OP_const2u = 0x0a // 1 2-byte constant - DW_OP_const2s = 0x0b // 1 2-byte constant - DW_OP_const4u = 0x0c // 1 4-byte constant - DW_OP_const4s = 0x0d // 1 4-byte constant - DW_OP_const8u = 0x0e // 1 8-byte constant - DW_OP_const8s = 0x0f // 1 8-byte constant - DW_OP_constu = 0x10 // 1 ULEB128 constant - DW_OP_consts = 0x11 // 1 SLEB128 constant - DW_OP_dup = 0x12 // 0 - DW_OP_drop = 0x13 // 0 - DW_OP_over = 0x14 // 0 - DW_OP_pick = 0x15 // 1 1-byte stack index - DW_OP_swap = 0x16 // 0 - DW_OP_rot = 0x17 // 0 - DW_OP_xderef = 0x18 // 0 - DW_OP_abs = 0x19 // 0 - DW_OP_and = 0x1a // 0 - DW_OP_div = 0x1b // 0 - DW_OP_minus = 0x1c // 0 - DW_OP_mod = 0x1d // 0 - DW_OP_mul = 0x1e // 0 - DW_OP_neg = 0x1f // 0 - DW_OP_not = 0x20 // 0 - DW_OP_or = 0x21 // 0 - DW_OP_plus = 0x22 // 0 - DW_OP_plus_uconst = 0x23 // 1 ULEB128 addend - DW_OP_shl = 0x24 // 0 - DW_OP_shr = 0x25 // 0 - DW_OP_shra = 0x26 // 0 - DW_OP_xor = 0x27 // 0 - DW_OP_skip = 0x2f // 1 signed 2-byte constant - DW_OP_bra = 0x28 // 1 signed 2-byte constant - DW_OP_eq = 0x29 // 0 - DW_OP_ge = 0x2a // 0 - DW_OP_gt = 0x2b // 0 - DW_OP_le = 0x2c // 0 - DW_OP_lt = 0x2d // 0 - DW_OP_ne = 0x2e // 0 - DW_OP_lit0 = 0x30 // 0 ... - DW_OP_lit31 = 0x4f // 0 literals 0..31 = (DW_OP_lit0 + literal) - DW_OP_reg0 = 0x50 // 0 .. - DW_OP_reg31 = 0x6f // 0 reg 0..31 = (DW_OP_reg0 + regnum) - DW_OP_breg0 = 0x70 // 1 ... - DW_OP_breg31 = 0x8f // 1 SLEB128 offset base register 0..31 = (DW_OP_breg0 + regnum) - DW_OP_regx = 0x90 // 1 ULEB128 register - DW_OP_fbreg = 0x91 // 1 SLEB128 offset - DW_OP_bregx = 0x92 // 2 ULEB128 register followed by SLEB128 offset - DW_OP_piece = 0x93 // 1 ULEB128 size of piece addressed - DW_OP_deref_size = 0x94 // 1 1-byte size of data retrieved - DW_OP_xderef_size = 0x95 // 1 1-byte size of data retrieved - DW_OP_nop = 0x96 // 0 - DW_OP_push_object_address = 0x97 // 0 - DW_OP_call2 = 0x98 // 1 2-byte offset of DIE - DW_OP_call4 = 0x99 // 1 4-byte offset of DIE - DW_OP_call_ref = 0x9a // 1 4- or 8-byte offset of DIE - DW_OP_form_tls_address = 0x9b // 0 - DW_OP_call_frame_cfa = 0x9c // 0 - DW_OP_bit_piece = 0x9d // 2 - DW_OP_lo_user = 0xe0 - DW_OP_hi_user = 0xff -) - -// Table 25 -const ( - DW_ATE_address = 0x01 - DW_ATE_boolean = 0x02 - DW_ATE_complex_float = 0x03 - DW_ATE_float = 0x04 - DW_ATE_signed = 0x05 - DW_ATE_signed_char = 0x06 - DW_ATE_unsigned = 0x07 - DW_ATE_unsigned_char = 0x08 - DW_ATE_imaginary_float = 0x09 - DW_ATE_packed_decimal = 0x0a - DW_ATE_numeric_string = 0x0b - DW_ATE_edited = 0x0c - DW_ATE_signed_fixed = 0x0d - DW_ATE_unsigned_fixed = 0x0e - DW_ATE_decimal_float = 0x0f - DW_ATE_lo_user = 0x80 - DW_ATE_hi_user = 0xff -) - -// Table 26 -const ( - DW_DS_unsigned = 0x01 - DW_DS_leading_overpunch = 0x02 - DW_DS_trailing_overpunch = 0x03 - DW_DS_leading_separate = 0x04 - DW_DS_trailing_separate = 0x05 -) - -// Table 27 -const ( - DW_END_default = 0x00 - DW_END_big = 0x01 - DW_END_little = 0x02 - DW_END_lo_user = 0x40 - DW_END_hi_user = 0xff -) - -// Table 28 -const ( - DW_ACCESS_public = 0x01 - DW_ACCESS_protected = 0x02 - DW_ACCESS_private = 0x03 -) - -// Table 29 -const ( - DW_VIS_local = 0x01 - DW_VIS_exported = 0x02 - DW_VIS_qualified = 0x03 -) - -// Table 30 -const ( - DW_VIRTUALITY_none = 0x00 - DW_VIRTUALITY_virtual = 0x01 - DW_VIRTUALITY_pure_virtual = 0x02 -) - -// Table 31 -const ( - DW_LANG_C89 = 0x0001 - DW_LANG_C = 0x0002 - DW_LANG_Ada83 = 0x0003 - DW_LANG_C_plus_plus = 0x0004 - DW_LANG_Cobol74 = 0x0005 - DW_LANG_Cobol85 = 0x0006 - DW_LANG_Fortran77 = 0x0007 - DW_LANG_Fortran90 = 0x0008 - DW_LANG_Pascal83 = 0x0009 - DW_LANG_Modula2 = 0x000a - // Dwarf3 - DW_LANG_Java = 0x000b - DW_LANG_C99 = 0x000c - DW_LANG_Ada95 = 0x000d - DW_LANG_Fortran95 = 0x000e - DW_LANG_PLI = 0x000f - DW_LANG_ObjC = 0x0010 - DW_LANG_ObjC_plus_plus = 0x0011 - DW_LANG_UPC = 0x0012 - DW_LANG_D = 0x0013 - // Dwarf4 - DW_LANG_Python = 0x0014 - // Dwarf5 - DW_LANG_Go = 0x0016 - - DW_LANG_lo_user = 0x8000 - DW_LANG_hi_user = 0xffff -) - -// Table 32 -const ( - DW_ID_case_sensitive = 0x00 - DW_ID_up_case = 0x01 - DW_ID_down_case = 0x02 - DW_ID_case_insensitive = 0x03 -) - -// Table 33 -const ( - DW_CC_normal = 0x01 - DW_CC_program = 0x02 - DW_CC_nocall = 0x03 - DW_CC_lo_user = 0x40 - DW_CC_hi_user = 0xff -) - -// Table 34 -const ( - DW_INL_not_inlined = 0x00 - DW_INL_inlined = 0x01 - DW_INL_declared_not_inlined = 0x02 - DW_INL_declared_inlined = 0x03 -) - -// Table 35 -const ( - DW_ORD_row_major = 0x00 - DW_ORD_col_major = 0x01 -) - -// Table 36 -const ( - DW_DSC_label = 0x00 - DW_DSC_range = 0x01 -) - -// Table 37 -const ( - DW_LNS_copy = 0x01 - DW_LNS_advance_pc = 0x02 - DW_LNS_advance_line = 0x03 - DW_LNS_set_file = 0x04 - DW_LNS_set_column = 0x05 - DW_LNS_negate_stmt = 0x06 - DW_LNS_set_basic_block = 0x07 - DW_LNS_const_add_pc = 0x08 - DW_LNS_fixed_advance_pc = 0x09 - // Dwarf3 - DW_LNS_set_prologue_end = 0x0a - DW_LNS_set_epilogue_begin = 0x0b - DW_LNS_set_isa = 0x0c -) - -// Table 38 -const ( - DW_LNE_end_sequence = 0x01 - DW_LNE_set_address = 0x02 - DW_LNE_define_file = 0x03 - DW_LNE_lo_user = 0x80 - DW_LNE_hi_user = 0xff -) - -// Table 39 -const ( - DW_MACINFO_define = 0x01 - DW_MACINFO_undef = 0x02 - DW_MACINFO_start_file = 0x03 - DW_MACINFO_end_file = 0x04 - DW_MACINFO_vendor_ext = 0xff -) - -// Table 40. -const ( - // operand,... - DW_CFA_nop = 0x00 - DW_CFA_set_loc = 0x01 // address - DW_CFA_advance_loc1 = 0x02 // 1-byte delta - DW_CFA_advance_loc2 = 0x03 // 2-byte delta - DW_CFA_advance_loc4 = 0x04 // 4-byte delta - DW_CFA_offset_extended = 0x05 // ULEB128 register, ULEB128 offset - DW_CFA_restore_extended = 0x06 // ULEB128 register - DW_CFA_undefined = 0x07 // ULEB128 register - DW_CFA_same_value = 0x08 // ULEB128 register - DW_CFA_register = 0x09 // ULEB128 register, ULEB128 register - DW_CFA_remember_state = 0x0a - DW_CFA_restore_state = 0x0b - - DW_CFA_def_cfa = 0x0c // ULEB128 register, ULEB128 offset - DW_CFA_def_cfa_register = 0x0d // ULEB128 register - DW_CFA_def_cfa_offset = 0x0e // ULEB128 offset - DW_CFA_def_cfa_expression = 0x0f // BLOCK - DW_CFA_expression = 0x10 // ULEB128 register, BLOCK - DW_CFA_offset_extended_sf = 0x11 // ULEB128 register, SLEB128 offset - DW_CFA_def_cfa_sf = 0x12 // ULEB128 register, SLEB128 offset - DW_CFA_def_cfa_offset_sf = 0x13 // SLEB128 offset - DW_CFA_val_offset = 0x14 // ULEB128, ULEB128 - DW_CFA_val_offset_sf = 0x15 // ULEB128, SLEB128 - DW_CFA_val_expression = 0x16 // ULEB128, BLOCK - - DW_CFA_lo_user = 0x1c - DW_CFA_hi_user = 0x3f - - // Opcodes that take an addend operand. - DW_CFA_advance_loc = 0x1 << 6 // +delta - DW_CFA_offset = 0x2 << 6 // +register (ULEB128 offset) - DW_CFA_restore = 0x3 << 6 // +register -) diff --git a/vendor/github.com/google/gops/internal/goobj/read.go b/vendor/github.com/google/gops/internal/goobj/read.go deleted file mode 100644 index 8a6f13bc..00000000 --- a/vendor/github.com/google/gops/internal/goobj/read.go +++ /dev/null @@ -1,714 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package goobj implements reading of Go object files and archives. -// -// TODO(rsc): Decide where this package should live. (golang.org/issue/6932) -// TODO(rsc): Decide the appropriate integer types for various fields. -// TODO(rsc): Write tests. (File format still up in the air a little.) -package goobj - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "strconv" - "strings" - - "github.com/google/gops/internal/obj" -) - -// A SymKind describes the kind of memory represented by a symbol. -type SymKind int - -// This list is taken from include/link.h. - -// Defined SymKind values. -// TODO(rsc): Give idiomatic Go names. -// TODO(rsc): Reduce the number of symbol types in the object files. -const ( - // readonly, executable - STEXT = SymKind(obj.STEXT) - SELFRXSECT = SymKind(obj.SELFRXSECT) - - // readonly, non-executable - STYPE = SymKind(obj.STYPE) - SSTRING = SymKind(obj.SSTRING) - SGOSTRING = SymKind(obj.SGOSTRING) - SGOFUNC = SymKind(obj.SGOFUNC) - SRODATA = SymKind(obj.SRODATA) - SFUNCTAB = SymKind(obj.SFUNCTAB) - STYPELINK = SymKind(obj.STYPELINK) - SITABLINK = SymKind(obj.SITABLINK) - SSYMTAB = SymKind(obj.SSYMTAB) // TODO: move to unmapped section - SPCLNTAB = SymKind(obj.SPCLNTAB) - SELFROSECT = SymKind(obj.SELFROSECT) - - // writable, non-executable - SMACHOPLT = SymKind(obj.SMACHOPLT) - SELFSECT = SymKind(obj.SELFSECT) - SMACHO = SymKind(obj.SMACHO) // Mach-O __nl_symbol_ptr - SMACHOGOT = SymKind(obj.SMACHOGOT) - SWINDOWS = SymKind(obj.SWINDOWS) - SELFGOT = SymKind(obj.SELFGOT) - SNOPTRDATA = SymKind(obj.SNOPTRDATA) - SINITARR = SymKind(obj.SINITARR) - SDATA = SymKind(obj.SDATA) - SBSS = SymKind(obj.SBSS) - SNOPTRBSS = SymKind(obj.SNOPTRBSS) - STLSBSS = SymKind(obj.STLSBSS) - - // not mapped - SXREF = SymKind(obj.SXREF) - SMACHOSYMSTR = SymKind(obj.SMACHOSYMSTR) - SMACHOSYMTAB = SymKind(obj.SMACHOSYMTAB) - SMACHOINDIRECTPLT = SymKind(obj.SMACHOINDIRECTPLT) - SMACHOINDIRECTGOT = SymKind(obj.SMACHOINDIRECTGOT) - SFILE = SymKind(obj.SFILE) - SFILEPATH = SymKind(obj.SFILEPATH) - SCONST = SymKind(obj.SCONST) - SDYNIMPORT = SymKind(obj.SDYNIMPORT) - SHOSTOBJ = SymKind(obj.SHOSTOBJ) -) - -var symKindStrings = []string{ - SBSS: "SBSS", - SCONST: "SCONST", - SDATA: "SDATA", - SDYNIMPORT: "SDYNIMPORT", - SELFROSECT: "SELFROSECT", - SELFRXSECT: "SELFRXSECT", - SELFSECT: "SELFSECT", - SFILE: "SFILE", - SFILEPATH: "SFILEPATH", - SFUNCTAB: "SFUNCTAB", - SGOFUNC: "SGOFUNC", - SGOSTRING: "SGOSTRING", - SHOSTOBJ: "SHOSTOBJ", - SINITARR: "SINITARR", - SMACHO: "SMACHO", - SMACHOGOT: "SMACHOGOT", - SMACHOINDIRECTGOT: "SMACHOINDIRECTGOT", - SMACHOINDIRECTPLT: "SMACHOINDIRECTPLT", - SMACHOPLT: "SMACHOPLT", - SMACHOSYMSTR: "SMACHOSYMSTR", - SMACHOSYMTAB: "SMACHOSYMTAB", - SNOPTRBSS: "SNOPTRBSS", - SNOPTRDATA: "SNOPTRDATA", - SPCLNTAB: "SPCLNTAB", - SRODATA: "SRODATA", - SSTRING: "SSTRING", - SSYMTAB: "SSYMTAB", - STEXT: "STEXT", - STLSBSS: "STLSBSS", - STYPE: "STYPE", - STYPELINK: "STYPELINK", - SITABLINK: "SITABLINK", - SWINDOWS: "SWINDOWS", - SXREF: "SXREF", -} - -func (k SymKind) String() string { - if k < 0 || int(k) >= len(symKindStrings) { - return fmt.Sprintf("SymKind(%d)", k) - } - return symKindStrings[k] -} - -// A Sym is a named symbol in an object file. -type Sym struct { - SymID // symbol identifier (name and version) - Kind SymKind // kind of symbol - DupOK bool // are duplicate definitions okay? - Size int // size of corresponding data - Type SymID // symbol for Go type information - Data Data // memory image of symbol - Reloc []Reloc // relocations to apply to Data - Func *Func // additional data for functions -} - -// A SymID - the combination of Name and Version - uniquely identifies -// a symbol within a package. -type SymID struct { - // Name is the name of a symbol. - Name string - - // Version is zero for symbols with global visibility. - // Symbols with only file visibility (such as file-level static - // declarations in C) have a non-zero version distinguishing - // a symbol in one file from a symbol of the same name - // in another file - Version int -} - -func (s SymID) String() string { - if s.Version == 0 { - return s.Name - } - return fmt.Sprintf("%s<%d>", s.Name, s.Version) -} - -// A Data is a reference to data stored in an object file. -// It records the offset and size of the data, so that a client can -// read the data only if necessary. -type Data struct { - Offset int64 - Size int64 -} - -// A Reloc describes a relocation applied to a memory image to refer -// to an address within a particular symbol. -type Reloc struct { - // The bytes at [Offset, Offset+Size) within the containing Sym - // should be updated to refer to the address Add bytes after the start - // of the symbol Sym. - Offset int - Size int - Sym SymID - Add int - - // The Type records the form of address expected in the bytes - // described by the previous fields: absolute, PC-relative, and so on. - // TODO(rsc): The interpretation of Type is not exposed by this package. - Type obj.RelocType -} - -// A Var describes a variable in a function stack frame: a declared -// local variable, an input argument, or an output result. -type Var struct { - // The combination of Name, Kind, and Offset uniquely - // identifies a variable in a function stack frame. - // Using fewer of these - in particular, using only Name - does not. - Name string // Name of variable. - Kind int // TODO(rsc): Define meaning. - Offset int // Frame offset. TODO(rsc): Define meaning. - - Type SymID // Go type for variable. -} - -// Func contains additional per-symbol information specific to functions. -type Func struct { - Args int // size in bytes of argument frame: inputs and outputs - Frame int // size in bytes of local variable frame - Leaf bool // function omits save of link register (ARM) - NoSplit bool // function omits stack split prologue - Var []Var // detail about local variables - PCSP Data // PC → SP offset map - PCFile Data // PC → file number map (index into File) - PCLine Data // PC → line number map - PCData []Data // PC → runtime support data map - FuncData []FuncData // non-PC-specific runtime support data - File []string // paths indexed by PCFile -} - -// TODO: Add PCData []byte and PCDataIter (similar to liblink). - -// A FuncData is a single function-specific data value. -type FuncData struct { - Sym SymID // symbol holding data - Offset int64 // offset into symbol for funcdata pointer -} - -// A Package is a parsed Go object file or archive defining a Go package. -type Package struct { - ImportPath string // import path denoting this package - Imports []string // packages imported by this package - SymRefs []SymID // list of symbol names and versions referred to by this pack - Syms []*Sym // symbols defined by this package - MaxVersion int // maximum Version in any SymID in Syms - Arch string // architecture -} - -var ( - archiveHeader = []byte("!\n") - archiveMagic = []byte("`\n") - goobjHeader = []byte("go objec") // truncated to size of archiveHeader - - errCorruptArchive = errors.New("corrupt archive") - errTruncatedArchive = errors.New("truncated archive") - errCorruptObject = errors.New("corrupt object file") - errNotObject = errors.New("unrecognized object file format") -) - -// An objReader is an object file reader. -type objReader struct { - p *Package - b *bufio.Reader - f io.ReadSeeker - err error - offset int64 - dataOffset int64 - limit int64 - tmp [256]byte - pkgprefix string -} - -// importPathToPrefix returns the prefix that will be used in the -// final symbol table for the given import path. -// We escape '%', '"', all control characters and non-ASCII bytes, -// and any '.' after the final slash. -// -// See ../../../cmd/ld/lib.c:/^pathtoprefix and -// ../../../cmd/gc/subr.c:/^pathtoprefix. -func importPathToPrefix(s string) string { - // find index of last slash, if any, or else -1. - // used for determining whether an index is after the last slash. - slash := strings.LastIndex(s, "/") - - // check for chars that need escaping - n := 0 - for r := 0; r < len(s); r++ { - if c := s[r]; c <= ' ' || (c == '.' && r > slash) || c == '%' || c == '"' || c >= 0x7F { - n++ - } - } - - // quick exit - if n == 0 { - return s - } - - // escape - const hex = "0123456789abcdef" - p := make([]byte, 0, len(s)+2*n) - for r := 0; r < len(s); r++ { - if c := s[r]; c <= ' ' || (c == '.' && r > slash) || c == '%' || c == '"' || c >= 0x7F { - p = append(p, '%', hex[c>>4], hex[c&0xF]) - } else { - p = append(p, c) - } - } - - return string(p) -} - -// init initializes r to read package p from f. -func (r *objReader) init(f io.ReadSeeker, p *Package) { - r.f = f - r.p = p - r.offset, _ = f.Seek(0, io.SeekCurrent) - r.limit, _ = f.Seek(0, io.SeekEnd) - f.Seek(r.offset, io.SeekStart) - r.b = bufio.NewReader(f) - r.pkgprefix = importPathToPrefix(p.ImportPath) + "." -} - -// error records that an error occurred. -// It returns only the first error, so that an error -// caused by an earlier error does not discard information -// about the earlier error. -func (r *objReader) error(err error) error { - if r.err == nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - r.err = err - } - // panic("corrupt") // useful for debugging - return r.err -} - -// readByte reads and returns a byte from the input file. -// On I/O error or EOF, it records the error but returns byte 0. -// A sequence of 0 bytes will eventually terminate any -// parsing state in the object file. In particular, it ends the -// reading of a varint. -func (r *objReader) readByte() byte { - if r.err != nil { - return 0 - } - if r.offset >= r.limit { - r.error(io.ErrUnexpectedEOF) - return 0 - } - b, err := r.b.ReadByte() - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - r.error(err) - b = 0 - } else { - r.offset++ - } - return b -} - -// read reads exactly len(b) bytes from the input file. -// If an error occurs, read returns the error but also -// records it, so it is safe for callers to ignore the result -// as long as delaying the report is not a problem. -func (r *objReader) readFull(b []byte) error { - if r.err != nil { - return r.err - } - if r.offset+int64(len(b)) > r.limit { - return r.error(io.ErrUnexpectedEOF) - } - n, err := io.ReadFull(r.b, b) - r.offset += int64(n) - if err != nil { - return r.error(err) - } - return nil -} - -// readInt reads a zigzag varint from the input file. -func (r *objReader) readInt() int { - var u uint64 - - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - r.error(errCorruptObject) - return 0 - } - c := r.readByte() - u |= uint64(c&0x7F) << shift - if c&0x80 == 0 { - break - } - } - - v := int64(u>>1) ^ (int64(u) << 63 >> 63) - if int64(int(v)) != v { - r.error(errCorruptObject) // TODO - return 0 - } - return int(v) -} - -// readString reads a length-delimited string from the input file. -func (r *objReader) readString() string { - n := r.readInt() - buf := make([]byte, n) - r.readFull(buf) - return string(buf) -} - -// readSymID reads a SymID from the input file. -func (r *objReader) readSymID() SymID { - i := r.readInt() - return r.p.SymRefs[i] -} - -func (r *objReader) readRef() { - name, vers := r.readString(), r.readInt() - - // In a symbol name in an object file, "". denotes the - // prefix for the package in which the object file has been found. - // Expand it. - name = strings.Replace(name, `"".`, r.pkgprefix, -1) - - // An individual object file only records version 0 (extern) or 1 (static). - // To make static symbols unique across all files being read, we - // replace version 1 with the version corresponding to the current - // file number. The number is incremented on each call to parseObject. - if vers != 0 { - vers = r.p.MaxVersion - } - r.p.SymRefs = append(r.p.SymRefs, SymID{name, vers}) -} - -// readData reads a data reference from the input file. -func (r *objReader) readData() Data { - n := r.readInt() - d := Data{Offset: r.dataOffset, Size: int64(n)} - r.dataOffset += int64(n) - return d -} - -// skip skips n bytes in the input. -func (r *objReader) skip(n int64) { - if n < 0 { - r.error(fmt.Errorf("debug/goobj: internal error: misuse of skip")) - } - if n < int64(len(r.tmp)) { - // Since the data is so small, a just reading from the buffered - // reader is better than flushing the buffer and seeking. - r.readFull(r.tmp[:n]) - } else if n <= int64(r.b.Buffered()) { - // Even though the data is not small, it has already been read. - // Advance the buffer instead of seeking. - for n > int64(len(r.tmp)) { - r.readFull(r.tmp[:]) - n -= int64(len(r.tmp)) - } - r.readFull(r.tmp[:n]) - } else { - // Seek, giving up buffered data. - _, err := r.f.Seek(r.offset+n, io.SeekStart) - if err != nil { - r.error(err) - } - r.offset += n - r.b.Reset(r.f) - } -} - -// Parse parses an object file or archive from r, -// assuming that its import path is pkgpath. -func Parse(r io.ReadSeeker, pkgpath string) (*Package, error) { - if pkgpath == "" { - pkgpath = `""` - } - p := new(Package) - p.ImportPath = pkgpath - - var rd objReader - rd.init(r, p) - err := rd.readFull(rd.tmp[:8]) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return nil, err - } - - switch { - default: - return nil, errNotObject - - case bytes.Equal(rd.tmp[:8], archiveHeader): - if err := rd.parseArchive(); err != nil { - return nil, err - } - case bytes.Equal(rd.tmp[:8], goobjHeader): - if err := rd.parseObject(goobjHeader); err != nil { - return nil, err - } - } - - return p, nil -} - -// trimSpace removes trailing spaces from b and returns the corresponding string. -// This effectively parses the form used in archive headers. -func trimSpace(b []byte) string { - return string(bytes.TrimRight(b, " ")) -} - -// parseArchive parses a Unix archive of Go object files. -// TODO(rsc): Need to skip non-Go object files. -// TODO(rsc): Maybe record table of contents in r.p so that -// linker can avoid having code to parse archives too. -func (r *objReader) parseArchive() error { - for r.offset < r.limit { - if err := r.readFull(r.tmp[:60]); err != nil { - return err - } - data := r.tmp[:60] - - // Each file is preceded by this text header (slice indices in first column): - // 0:16 name - // 16:28 date - // 28:34 uid - // 34:40 gid - // 40:48 mode - // 48:58 size - // 58:60 magic - `\n - // We only care about name, size, and magic. - // The fields are space-padded on the right. - // The size is in decimal. - // The file data - size bytes - follows the header. - // Headers are 2-byte aligned, so if size is odd, an extra padding - // byte sits between the file data and the next header. - // The file data that follows is padded to an even number of bytes: - // if size is odd, an extra padding byte is inserted betw the next header. - if len(data) < 60 { - return errTruncatedArchive - } - if !bytes.Equal(data[58:60], archiveMagic) { - return errCorruptArchive - } - name := trimSpace(data[0:16]) - size, err := strconv.ParseInt(trimSpace(data[48:58]), 10, 64) - if err != nil { - return errCorruptArchive - } - data = data[60:] - fsize := size + size&1 - if fsize < 0 || fsize < size { - return errCorruptArchive - } - switch name { - case "__.PKGDEF": - r.skip(size) - default: - oldLimit := r.limit - r.limit = r.offset + size - if err := r.parseObject(nil); err != nil { - return fmt.Errorf("parsing archive member %q: %v", name, err) - } - r.skip(r.limit - r.offset) - r.limit = oldLimit - } - if size&1 != 0 { - r.skip(1) - } - } - return nil -} - -// parseObject parses a single Go object file. -// The prefix is the bytes already read from the file, -// typically in order to detect that this is an object file. -// The object file consists of a textual header ending in "\n!\n" -// and then the part we want to parse begins. -// The format of that part is defined in a comment at the top -// of src/liblink/objfile.c. -func (r *objReader) parseObject(prefix []byte) error { - r.p.MaxVersion++ - h := make([]byte, 0, 256) - h = append(h, prefix...) - var c1, c2, c3 byte - for { - c1, c2, c3 = c2, c3, r.readByte() - h = append(h, c3) - // The new export format can contain 0 bytes. - // Don't consider them errors, only look for r.err != nil. - if r.err != nil { - return errCorruptObject - } - if c1 == '\n' && c2 == '!' && c3 == '\n' { - break - } - } - - hs := strings.Fields(string(h)) - if len(hs) >= 4 { - r.p.Arch = hs[3] - } - // TODO: extract OS + build ID if/when we need it - - r.readFull(r.tmp[:8]) - if !bytes.Equal(r.tmp[:8], []byte("\x00\x00go17ld")) { - return r.error(errCorruptObject) - } - - b := r.readByte() - if b != 1 { - return r.error(errCorruptObject) - } - - // Direct package dependencies. - for { - s := r.readString() - if s == "" { - break - } - r.p.Imports = append(r.p.Imports, s) - } - - r.p.SymRefs = []SymID{{"", 0}} - for { - if b := r.readByte(); b != 0xfe { - if b != 0xff { - return r.error(errCorruptObject) - } - break - } - - r.readRef() - } - - dataLength := r.readInt() - r.readInt() // n relocations - ignore - r.readInt() // n pcdata - ignore - r.readInt() // n autom - ignore - r.readInt() // n funcdata - ignore - r.readInt() // n files - ignore - - r.dataOffset = r.offset - r.skip(int64(dataLength)) - - // Symbols. - for { - if b := r.readByte(); b != 0xfe { - if b != 0xff { - return r.error(errCorruptObject) - } - break - } - - typ := r.readInt() - s := &Sym{SymID: r.readSymID()} - r.p.Syms = append(r.p.Syms, s) - s.Kind = SymKind(typ) - flags := r.readInt() - s.DupOK = flags&1 != 0 - s.Size = r.readInt() - s.Type = r.readSymID() - s.Data = r.readData() - s.Reloc = make([]Reloc, r.readInt()) - for i := range s.Reloc { - rel := &s.Reloc[i] - rel.Offset = r.readInt() - rel.Size = r.readInt() - rel.Type = obj.RelocType(r.readInt()) - rel.Add = r.readInt() - rel.Sym = r.readSymID() - } - - if s.Kind == STEXT { - f := new(Func) - s.Func = f - f.Args = r.readInt() - f.Frame = r.readInt() - flags := r.readInt() - f.Leaf = flags&1 != 0 - f.NoSplit = r.readInt() != 0 - f.Var = make([]Var, r.readInt()) - for i := range f.Var { - v := &f.Var[i] - v.Name = r.readSymID().Name - v.Offset = r.readInt() - v.Kind = r.readInt() - v.Type = r.readSymID() - } - - f.PCSP = r.readData() - f.PCFile = r.readData() - f.PCLine = r.readData() - f.PCData = make([]Data, r.readInt()) - for i := range f.PCData { - f.PCData[i] = r.readData() - } - f.FuncData = make([]FuncData, r.readInt()) - for i := range f.FuncData { - f.FuncData[i].Sym = r.readSymID() - } - for i := range f.FuncData { - f.FuncData[i].Offset = int64(r.readInt()) // TODO - } - f.File = make([]string, r.readInt()) - for i := range f.File { - f.File[i] = r.readSymID().Name - } - } - } - - r.readFull(r.tmp[:7]) - if !bytes.Equal(r.tmp[:7], []byte("\xffgo17ld")) { - return r.error(errCorruptObject) - } - - return nil -} - -func (r *Reloc) String(insnOffset uint64) string { - delta := r.Offset - int(insnOffset) - s := fmt.Sprintf("[%d:%d]%s", delta, delta+r.Size, r.Type) - if r.Sym.Name != "" { - if r.Add != 0 { - return fmt.Sprintf("%s:%s+%d", s, r.Sym.Name, r.Add) - } - return fmt.Sprintf("%s:%s", s, r.Sym.Name) - } - if r.Add != 0 { - return fmt.Sprintf("%s:%d", s, r.Add) - } - return s -} diff --git a/vendor/github.com/google/gops/internal/obj/addrtype_string.go b/vendor/github.com/google/gops/internal/obj/addrtype_string.go deleted file mode 100644 index 48d498dc..00000000 --- a/vendor/github.com/google/gops/internal/obj/addrtype_string.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by "stringer -type AddrType cmd/internal/obj"; DO NOT EDIT - -package obj - -import "fmt" - -const ( - _AddrType_name_0 = "TYPE_NONE" - _AddrType_name_1 = "TYPE_BRANCHTYPE_TEXTSIZETYPE_MEMTYPE_CONSTTYPE_FCONSTTYPE_SCONSTTYPE_REGTYPE_ADDRTYPE_SHIFTTYPE_REGREGTYPE_REGREG2TYPE_INDIRTYPE_REGLIST" -) - -var ( - _AddrType_index_0 = [...]uint8{0, 9} - _AddrType_index_1 = [...]uint8{0, 11, 24, 32, 42, 53, 64, 72, 81, 91, 102, 114, 124, 136} -) - -func (i AddrType) String() string { - switch { - case i == 0: - return _AddrType_name_0 - case 6 <= i && i <= 18: - i -= 6 - return _AddrType_name_1[_AddrType_index_1[i]:_AddrType_index_1[i+1]] - default: - return fmt.Sprintf("AddrType(%d)", i) - } -} diff --git a/vendor/github.com/google/gops/internal/obj/arm/a.out.go b/vendor/github.com/google/gops/internal/obj/arm/a.out.go deleted file mode 100644 index a3e0c180..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm/a.out.go +++ /dev/null @@ -1,338 +0,0 @@ -// Inferno utils/5c/5.out.h -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/5c/5.out.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm - -import "github.com/google/gops/internal/obj" - -//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p arm - -const ( - NSNAME = 8 - NSYM = 50 - NREG = 16 -) - -/* -1 disables use of REGARG */ -const ( - REGARG = -1 -) - -const ( - REG_R0 = obj.RBaseARM + iota // must be 16-aligned - REG_R1 - REG_R2 - REG_R3 - REG_R4 - REG_R5 - REG_R6 - REG_R7 - REG_R8 - REG_R9 - REG_R10 - REG_R11 - REG_R12 - REG_R13 - REG_R14 - REG_R15 - - REG_F0 // must be 16-aligned - REG_F1 - REG_F2 - REG_F3 - REG_F4 - REG_F5 - REG_F6 - REG_F7 - REG_F8 - REG_F9 - REG_F10 - REG_F11 - REG_F12 - REG_F13 - REG_F14 - REG_F15 - - REG_FPSR // must be 2-aligned - REG_FPCR - - REG_CPSR // must be 2-aligned - REG_SPSR - - MAXREG - REGRET = REG_R0 - /* compiler allocates R1 up as temps */ - /* compiler allocates register variables R3 up */ - /* compiler allocates external registers R10 down */ - REGEXT = REG_R10 - /* these two registers are declared in runtime.h */ - REGG = REGEXT - 0 - REGM = REGEXT - 1 - - REGCTXT = REG_R7 - REGTMP = REG_R11 - REGSP = REG_R13 - REGLINK = REG_R14 - REGPC = REG_R15 - - NFREG = 16 - /* compiler allocates register variables F0 up */ - /* compiler allocates external registers F7 down */ - FREGRET = REG_F0 - FREGEXT = REG_F7 - FREGTMP = REG_F15 -) - -const ( - C_NONE = iota - C_REG - C_REGREG - C_REGREG2 - C_REGLIST - C_SHIFT - C_FREG - C_PSR - C_FCR - - C_RCON /* 0xff rotated */ - C_NCON /* ~RCON */ - C_SCON /* 0xffff */ - C_LCON - C_LCONADDR - C_ZFCON - C_SFCON - C_LFCON - - C_RACON - C_LACON - - C_SBRA - C_LBRA - - C_HAUTO /* halfword insn offset (-0xff to 0xff) */ - C_FAUTO /* float insn offset (0 to 0x3fc, word aligned) */ - C_HFAUTO /* both H and F */ - C_SAUTO /* -0xfff to 0xfff */ - C_LAUTO - - C_HOREG - C_FOREG - C_HFOREG - C_SOREG - C_ROREG - C_SROREG /* both nil and R */ - C_LOREG - - C_PC - C_SP - C_HREG - - C_ADDR /* reference to relocatable address */ - - // TLS "var" in local exec mode: will become a constant offset from - // thread local base that is ultimately chosen by the program linker. - C_TLS_LE - - // TLS "var" in initial exec mode: will become a memory address (chosen - // by the program linker) that the dynamic linker will fill with the - // offset from the thread local base. - C_TLS_IE - - C_TEXTSIZE - - C_GOK - - C_NCLASS /* must be the last */ -) - -const ( - AAND = obj.ABaseARM + obj.A_ARCHSPECIFIC + iota - AEOR - ASUB - ARSB - AADD - AADC - ASBC - ARSC - ATST - ATEQ - ACMP - ACMN - AORR - ABIC - - AMVN - - /* - * Do not reorder or fragment the conditional branch - * opcodes, or the predication code will break - */ - ABEQ - ABNE - ABCS - ABHS - ABCC - ABLO - ABMI - ABPL - ABVS - ABVC - ABHI - ABLS - ABGE - ABLT - ABGT - ABLE - - AMOVWD - AMOVWF - AMOVDW - AMOVFW - AMOVFD - AMOVDF - AMOVF - AMOVD - - ACMPF - ACMPD - AADDF - AADDD - ASUBF - ASUBD - AMULF - AMULD - ADIVF - ADIVD - ASQRTF - ASQRTD - AABSF - AABSD - ANEGF - ANEGD - - ASRL - ASRA - ASLL - AMULU - ADIVU - AMUL - ADIV - AMOD - AMODU - - AMOVB - AMOVBS - AMOVBU - AMOVH - AMOVHS - AMOVHU - AMOVW - AMOVM - ASWPBU - ASWPW - - ARFE - ASWI - AMULA - - AWORD - - AMULL - AMULAL - AMULLU - AMULALU - - ABX - ABXRET - ADWORD - - ALDREX - ASTREX - ALDREXD - ASTREXD - - APLD - - ACLZ - - AMULWT - AMULWB - AMULAWT - AMULAWB - - ADATABUNDLE - ADATABUNDLEEND - - AMRC // MRC/MCR - - ALAST - - // aliases - AB = obj.AJMP - ABL = obj.ACALL -) - -/* scond byte */ -const ( - C_SCOND = (1 << 4) - 1 - C_SBIT = 1 << 4 - C_PBIT = 1 << 5 - C_WBIT = 1 << 6 - C_FBIT = 1 << 7 /* psr flags-only */ - C_UBIT = 1 << 7 /* up bit, unsigned bit */ - - // These constants are the ARM condition codes encodings, - // XORed with 14 so that C_SCOND_NONE has value 0, - // so that a zeroed Prog.scond means "always execute". - C_SCOND_XOR = 14 - - C_SCOND_EQ = 0 ^ C_SCOND_XOR - C_SCOND_NE = 1 ^ C_SCOND_XOR - C_SCOND_HS = 2 ^ C_SCOND_XOR - C_SCOND_LO = 3 ^ C_SCOND_XOR - C_SCOND_MI = 4 ^ C_SCOND_XOR - C_SCOND_PL = 5 ^ C_SCOND_XOR - C_SCOND_VS = 6 ^ C_SCOND_XOR - C_SCOND_VC = 7 ^ C_SCOND_XOR - C_SCOND_HI = 8 ^ C_SCOND_XOR - C_SCOND_LS = 9 ^ C_SCOND_XOR - C_SCOND_GE = 10 ^ C_SCOND_XOR - C_SCOND_LT = 11 ^ C_SCOND_XOR - C_SCOND_GT = 12 ^ C_SCOND_XOR - C_SCOND_LE = 13 ^ C_SCOND_XOR - C_SCOND_NONE = 14 ^ C_SCOND_XOR - C_SCOND_NV = 15 ^ C_SCOND_XOR - - /* D_SHIFT type */ - SHIFT_LL = 0 << 5 - SHIFT_LR = 1 << 5 - SHIFT_AR = 2 << 5 - SHIFT_RR = 3 << 5 -) diff --git a/vendor/github.com/google/gops/internal/obj/arm/anames.go b/vendor/github.com/google/gops/internal/obj/arm/anames.go deleted file mode 100644 index 42abc946..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm/anames.go +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by stringer -i a.out.go -o anames.go -p arm -// Do not edit. - -package arm - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ - obj.A_ARCHSPECIFIC: "AND", - "EOR", - "SUB", - "RSB", - "ADD", - "ADC", - "SBC", - "RSC", - "TST", - "TEQ", - "CMP", - "CMN", - "ORR", - "BIC", - "MVN", - "BEQ", - "BNE", - "BCS", - "BHS", - "BCC", - "BLO", - "BMI", - "BPL", - "BVS", - "BVC", - "BHI", - "BLS", - "BGE", - "BLT", - "BGT", - "BLE", - "MOVWD", - "MOVWF", - "MOVDW", - "MOVFW", - "MOVFD", - "MOVDF", - "MOVF", - "MOVD", - "CMPF", - "CMPD", - "ADDF", - "ADDD", - "SUBF", - "SUBD", - "MULF", - "MULD", - "DIVF", - "DIVD", - "SQRTF", - "SQRTD", - "ABSF", - "ABSD", - "NEGF", - "NEGD", - "SRL", - "SRA", - "SLL", - "MULU", - "DIVU", - "MUL", - "DIV", - "MOD", - "MODU", - "MOVB", - "MOVBS", - "MOVBU", - "MOVH", - "MOVHS", - "MOVHU", - "MOVW", - "MOVM", - "SWPBU", - "SWPW", - "RFE", - "SWI", - "MULA", - "WORD", - "MULL", - "MULAL", - "MULLU", - "MULALU", - "BX", - "BXRET", - "DWORD", - "LDREX", - "STREX", - "LDREXD", - "STREXD", - "PLD", - "CLZ", - "MULWT", - "MULWB", - "MULAWT", - "MULAWB", - "DATABUNDLE", - "DATABUNDLEEND", - "MRC", - "LAST", -} diff --git a/vendor/github.com/google/gops/internal/obj/arm/anames5.go b/vendor/github.com/google/gops/internal/obj/arm/anames5.go deleted file mode 100644 index 7fdd9623..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm/anames5.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package arm - -var cnames5 = []string{ - "NONE", - "REG", - "REGREG", - "REGREG2", - "REGLIST", - "SHIFT", - "FREG", - "PSR", - "FCR", - "RCON", - "NCON", - "SCON", - "LCON", - "LCONADDR", - "ZFCON", - "SFCON", - "LFCON", - "RACON", - "LACON", - "SBRA", - "LBRA", - "HAUTO", - "FAUTO", - "HFAUTO", - "SAUTO", - "LAUTO", - "HOREG", - "FOREG", - "HFOREG", - "SOREG", - "ROREG", - "SROREG", - "LOREG", - "PC", - "SP", - "HREG", - "ADDR", - "C_TLS_LE", - "C_TLS_IE", - "TEXTSIZE", - "GOK", - "NCLASS", - "SCOND = (1<<4)-1", - "SBIT = 1<<4", - "PBIT = 1<<5", - "WBIT = 1<<6", - "FBIT = 1<<7", - "UBIT = 1<<7", - "SCOND_XOR = 14", - "SCOND_EQ = 0 ^ C_SCOND_XOR", - "SCOND_NE = 1 ^ C_SCOND_XOR", - "SCOND_HS = 2 ^ C_SCOND_XOR", - "SCOND_LO = 3 ^ C_SCOND_XOR", - "SCOND_MI = 4 ^ C_SCOND_XOR", - "SCOND_PL = 5 ^ C_SCOND_XOR", - "SCOND_VS = 6 ^ C_SCOND_XOR", - "SCOND_VC = 7 ^ C_SCOND_XOR", - "SCOND_HI = 8 ^ C_SCOND_XOR", - "SCOND_LS = 9 ^ C_SCOND_XOR", - "SCOND_GE = 10 ^ C_SCOND_XOR", - "SCOND_LT = 11 ^ C_SCOND_XOR", - "SCOND_GT = 12 ^ C_SCOND_XOR", - "SCOND_LE = 13 ^ C_SCOND_XOR", - "SCOND_NONE = 14 ^ C_SCOND_XOR", - "SCOND_NV = 15 ^ C_SCOND_XOR", -} diff --git a/vendor/github.com/google/gops/internal/obj/arm/asm5.go b/vendor/github.com/google/gops/internal/obj/arm/asm5.go deleted file mode 100644 index aa8149d5..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm/asm5.go +++ /dev/null @@ -1,2846 +0,0 @@ -// Inferno utils/5l/span.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/5l/span.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm - -import ( - "fmt" - "log" - "math" - "sort" - - "github.com/google/gops/internal/obj" -) - -type Optab struct { - as obj.As - a1 uint8 - a2 int8 - a3 uint8 - type_ uint8 - size int8 - param int16 - flag int8 - pcrelsiz uint8 -} - -type Opcross [32][2][32]uint8 - -const ( - LFROM = 1 << 0 - LTO = 1 << 1 - LPOOL = 1 << 2 - LPCREL = 1 << 3 -) - -var optab = []Optab{ - /* struct Optab: - OPCODE, from, prog->reg, to, type,size,param,flag */ - {obj.ATEXT, C_ADDR, C_NONE, C_TEXTSIZE, 0, 0, 0, 0, 0}, - {AADD, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {AADD, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {AMVN, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {ACMP, C_REG, C_REG, C_NONE, 1, 4, 0, 0, 0}, - {AADD, C_RCON, C_REG, C_REG, 2, 4, 0, 0, 0}, - {AADD, C_RCON, C_NONE, C_REG, 2, 4, 0, 0, 0}, - {AMOVW, C_RCON, C_NONE, C_REG, 2, 4, 0, 0, 0}, - {AMVN, C_RCON, C_NONE, C_REG, 2, 4, 0, 0, 0}, - {ACMP, C_RCON, C_REG, C_NONE, 2, 4, 0, 0, 0}, - {AADD, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, - {AADD, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, - {AMVN, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, - {ACMP, C_SHIFT, C_REG, C_NONE, 3, 4, 0, 0, 0}, - {AMOVW, C_RACON, C_NONE, C_REG, 4, 4, REGSP, 0, 0}, - {AB, C_NONE, C_NONE, C_SBRA, 5, 4, 0, LPOOL, 0}, - {ABL, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, - {ABX, C_NONE, C_NONE, C_SBRA, 74, 20, 0, 0, 0}, - {ABEQ, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, - {ABEQ, C_RCON, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // prediction hinted form, hint ignored - - {AB, C_NONE, C_NONE, C_ROREG, 6, 4, 0, LPOOL, 0}, - {ABL, C_NONE, C_NONE, C_ROREG, 7, 4, 0, 0, 0}, - {ABL, C_REG, C_NONE, C_ROREG, 7, 4, 0, 0, 0}, - {ABX, C_NONE, C_NONE, C_ROREG, 75, 12, 0, 0, 0}, - {ABXRET, C_NONE, C_NONE, C_ROREG, 76, 4, 0, 0, 0}, - {ASLL, C_RCON, C_REG, C_REG, 8, 4, 0, 0, 0}, - {ASLL, C_RCON, C_NONE, C_REG, 8, 4, 0, 0, 0}, - {ASLL, C_REG, C_NONE, C_REG, 9, 4, 0, 0, 0}, - {ASLL, C_REG, C_REG, C_REG, 9, 4, 0, 0, 0}, - {ASWI, C_NONE, C_NONE, C_NONE, 10, 4, 0, 0, 0}, - {ASWI, C_NONE, C_NONE, C_LOREG, 10, 4, 0, 0, 0}, - {ASWI, C_NONE, C_NONE, C_LCON, 10, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_LCON, 11, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_LCONADDR, 11, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_ADDR, 11, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_TLS_LE, 103, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_TLS_IE, 104, 4, 0, 0, 0}, - {AMOVW, C_NCON, C_NONE, C_REG, 12, 4, 0, 0, 0}, - {AMOVW, C_LCON, C_NONE, C_REG, 12, 4, 0, LFROM, 0}, - {AMOVW, C_LCONADDR, C_NONE, C_REG, 12, 4, 0, LFROM | LPCREL, 4}, - {AADD, C_NCON, C_REG, C_REG, 13, 8, 0, 0, 0}, - {AADD, C_NCON, C_NONE, C_REG, 13, 8, 0, 0, 0}, - {AMVN, C_NCON, C_NONE, C_REG, 13, 8, 0, 0, 0}, - {ACMP, C_NCON, C_REG, C_NONE, 13, 8, 0, 0, 0}, - {AADD, C_LCON, C_REG, C_REG, 13, 8, 0, LFROM, 0}, - {AADD, C_LCON, C_NONE, C_REG, 13, 8, 0, LFROM, 0}, - {AMVN, C_LCON, C_NONE, C_REG, 13, 8, 0, LFROM, 0}, - {ACMP, C_LCON, C_REG, C_NONE, 13, 8, 0, LFROM, 0}, - {AMOVB, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {AMOVBS, C_REG, C_NONE, C_REG, 14, 8, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_REG, 58, 4, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {AMOVHS, C_REG, C_NONE, C_REG, 14, 8, 0, 0, 0}, - {AMOVHU, C_REG, C_NONE, C_REG, 14, 8, 0, 0, 0}, - {AMUL, C_REG, C_REG, C_REG, 15, 4, 0, 0, 0}, - {AMUL, C_REG, C_NONE, C_REG, 15, 4, 0, 0, 0}, - {ADIV, C_REG, C_REG, C_REG, 16, 4, 0, 0, 0}, - {ADIV, C_REG, C_NONE, C_REG, 16, 4, 0, 0, 0}, - {AMULL, C_REG, C_REG, C_REGREG, 17, 4, 0, 0, 0}, - {AMULA, C_REG, C_REG, C_REGREG2, 17, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, - {AMOVW, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, - {AMOVB, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, - {AMOVB, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, - {AMOVBS, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, - {AMOVBS, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, - {AMOVW, C_SAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVW, C_SOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVBU, C_SAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVBU, C_SOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, - {AMOVW, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, - {AMOVW, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, - {AMOVB, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, - {AMOVB, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, - {AMOVB, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, - {AMOVBS, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, - {AMOVBS, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, - {AMOVBS, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, - {AMOVBU, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, - {AMOVBU, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, - {AMOVBU, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, - {AMOVW, C_TLS_LE, C_NONE, C_REG, 101, 4, 0, LFROM, 0}, - {AMOVW, C_TLS_IE, C_NONE, C_REG, 102, 8, 0, LFROM, 0}, - {AMOVW, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, LFROM, 0}, - {AMOVW, C_LOREG, C_NONE, C_REG, 31, 8, 0, LFROM, 0}, - {AMOVW, C_ADDR, C_NONE, C_REG, 65, 8, 0, LFROM | LPCREL, 4}, - {AMOVBU, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, LFROM, 0}, - {AMOVBU, C_LOREG, C_NONE, C_REG, 31, 8, 0, LFROM, 0}, - {AMOVBU, C_ADDR, C_NONE, C_REG, 65, 8, 0, LFROM | LPCREL, 4}, - {AMOVW, C_LACON, C_NONE, C_REG, 34, 8, REGSP, LFROM, 0}, - {AMOVW, C_PSR, C_NONE, C_REG, 35, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_PSR, 36, 4, 0, 0, 0}, - {AMOVW, C_RCON, C_NONE, C_PSR, 37, 4, 0, 0, 0}, - {AMOVM, C_REGLIST, C_NONE, C_SOREG, 38, 4, 0, 0, 0}, - {AMOVM, C_SOREG, C_NONE, C_REGLIST, 39, 4, 0, 0, 0}, - {ASWPW, C_SOREG, C_REG, C_REG, 40, 4, 0, 0, 0}, - {ARFE, C_NONE, C_NONE, C_NONE, 41, 4, 0, 0, 0}, - {AMOVF, C_FREG, C_NONE, C_FAUTO, 50, 4, REGSP, 0, 0}, - {AMOVF, C_FREG, C_NONE, C_FOREG, 50, 4, 0, 0, 0}, - {AMOVF, C_FAUTO, C_NONE, C_FREG, 51, 4, REGSP, 0, 0}, - {AMOVF, C_FOREG, C_NONE, C_FREG, 51, 4, 0, 0, 0}, - {AMOVF, C_FREG, C_NONE, C_LAUTO, 52, 12, REGSP, LTO, 0}, - {AMOVF, C_FREG, C_NONE, C_LOREG, 52, 12, 0, LTO, 0}, - {AMOVF, C_LAUTO, C_NONE, C_FREG, 53, 12, REGSP, LFROM, 0}, - {AMOVF, C_LOREG, C_NONE, C_FREG, 53, 12, 0, LFROM, 0}, - {AMOVF, C_FREG, C_NONE, C_ADDR, 68, 8, 0, LTO | LPCREL, 4}, - {AMOVF, C_ADDR, C_NONE, C_FREG, 69, 8, 0, LFROM | LPCREL, 4}, - {AADDF, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AADDF, C_FREG, C_REG, C_FREG, 54, 4, 0, 0, 0}, - {AMOVF, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_FCR, 56, 4, 0, 0, 0}, - {AMOVW, C_FCR, C_NONE, C_REG, 57, 4, 0, 0, 0}, - {AMOVW, C_SHIFT, C_NONE, C_REG, 59, 4, 0, 0, 0}, - {AMOVBU, C_SHIFT, C_NONE, C_REG, 59, 4, 0, 0, 0}, - {AMOVB, C_SHIFT, C_NONE, C_REG, 60, 4, 0, 0, 0}, - {AMOVBS, C_SHIFT, C_NONE, C_REG, 60, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, - {AMOVB, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, - {AMOVBS, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_HAUTO, 70, 4, REGSP, 0, 0}, - {AMOVH, C_REG, C_NONE, C_HOREG, 70, 4, 0, 0, 0}, - {AMOVHS, C_REG, C_NONE, C_HAUTO, 70, 4, REGSP, 0, 0}, - {AMOVHS, C_REG, C_NONE, C_HOREG, 70, 4, 0, 0, 0}, - {AMOVHU, C_REG, C_NONE, C_HAUTO, 70, 4, REGSP, 0, 0}, - {AMOVHU, C_REG, C_NONE, C_HOREG, 70, 4, 0, 0, 0}, - {AMOVB, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, - {AMOVB, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, - {AMOVBS, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, - {AMOVBS, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, - {AMOVH, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, - {AMOVH, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, - {AMOVHS, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, - {AMOVHS, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, - {AMOVHU, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, - {AMOVHU, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_LAUTO, 72, 8, REGSP, LTO, 0}, - {AMOVH, C_REG, C_NONE, C_LOREG, 72, 8, 0, LTO, 0}, - {AMOVH, C_REG, C_NONE, C_ADDR, 94, 8, 0, LTO | LPCREL, 4}, - {AMOVHS, C_REG, C_NONE, C_LAUTO, 72, 8, REGSP, LTO, 0}, - {AMOVHS, C_REG, C_NONE, C_LOREG, 72, 8, 0, LTO, 0}, - {AMOVHS, C_REG, C_NONE, C_ADDR, 94, 8, 0, LTO | LPCREL, 4}, - {AMOVHU, C_REG, C_NONE, C_LAUTO, 72, 8, REGSP, LTO, 0}, - {AMOVHU, C_REG, C_NONE, C_LOREG, 72, 8, 0, LTO, 0}, - {AMOVHU, C_REG, C_NONE, C_ADDR, 94, 8, 0, LTO | LPCREL, 4}, - {AMOVB, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, - {AMOVB, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, - {AMOVB, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, - {AMOVBS, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, - {AMOVBS, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, - {AMOVBS, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, - {AMOVH, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, - {AMOVH, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, - {AMOVH, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, - {AMOVHS, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, - {AMOVHS, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, - {AMOVHS, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, - {AMOVHU, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, - {AMOVHU, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, - {AMOVHU, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, - {ALDREX, C_SOREG, C_NONE, C_REG, 77, 4, 0, 0, 0}, - {ASTREX, C_SOREG, C_REG, C_REG, 78, 4, 0, 0, 0}, - {AMOVF, C_ZFCON, C_NONE, C_FREG, 80, 8, 0, 0, 0}, - {AMOVF, C_SFCON, C_NONE, C_FREG, 81, 4, 0, 0, 0}, - {ACMPF, C_FREG, C_REG, C_NONE, 82, 8, 0, 0, 0}, - {ACMPF, C_FREG, C_NONE, C_NONE, 83, 8, 0, 0, 0}, - {AMOVFW, C_FREG, C_NONE, C_FREG, 84, 4, 0, 0, 0}, - {AMOVWF, C_FREG, C_NONE, C_FREG, 85, 4, 0, 0, 0}, - {AMOVFW, C_FREG, C_NONE, C_REG, 86, 8, 0, 0, 0}, - {AMOVWF, C_REG, C_NONE, C_FREG, 87, 8, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_FREG, 88, 4, 0, 0, 0}, - {AMOVW, C_FREG, C_NONE, C_REG, 89, 4, 0, 0, 0}, - {ATST, C_REG, C_NONE, C_NONE, 90, 4, 0, 0, 0}, - {ALDREXD, C_SOREG, C_NONE, C_REG, 91, 4, 0, 0, 0}, - {ASTREXD, C_SOREG, C_REG, C_REG, 92, 4, 0, 0, 0}, - {APLD, C_SOREG, C_NONE, C_NONE, 95, 4, 0, 0, 0}, - {obj.AUNDEF, C_NONE, C_NONE, C_NONE, 96, 4, 0, 0, 0}, - {ACLZ, C_REG, C_NONE, C_REG, 97, 4, 0, 0, 0}, - {AMULWT, C_REG, C_REG, C_REG, 98, 4, 0, 0, 0}, - {AMULAWT, C_REG, C_REG, C_REGREG2, 99, 4, 0, 0, 0}, - {obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, 0, 0, 0, 0, 0}, - {obj.APCDATA, C_LCON, C_NONE, C_LCON, 0, 0, 0, 0, 0}, - {obj.AFUNCDATA, C_LCON, C_NONE, C_ADDR, 0, 0, 0, 0, 0}, - {obj.ANOP, C_NONE, C_NONE, C_NONE, 0, 0, 0, 0, 0}, - {obj.ADUFFZERO, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as ABL - {obj.ADUFFCOPY, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as ABL - - {ADATABUNDLE, C_NONE, C_NONE, C_NONE, 100, 4, 0, 0, 0}, - {ADATABUNDLEEND, C_NONE, C_NONE, C_NONE, 100, 0, 0, 0, 0}, - {obj.AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0, 0, 0}, -} - -var pool struct { - start uint32 - size uint32 - extra uint32 -} - -var oprange [ALAST & obj.AMask][]Optab - -var xcmp [C_GOK + 1][C_GOK + 1]bool - -var deferreturn *obj.LSym - -// Note about encoding: Prog.scond holds the condition encoding, -// but XOR'ed with C_SCOND_XOR, so that C_SCOND_NONE == 0. -// The code that shifts the value << 28 has the responsibility -// for XORing with C_SCOND_XOR too. - -// asmoutnacl assembles the instruction p. It replaces asmout for NaCl. -// It returns the total number of bytes put in out, and it can change -// p->pc if extra padding is necessary. -// In rare cases, asmoutnacl might split p into two instructions. -// origPC is the PC for this Prog (no padding is taken into account). -func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint32) int { - size := int(o.size) - - // instruction specific - switch p.As { - default: - if out != nil { - asmout(ctxt, p, o, out) - } - - case ADATABUNDLE, // align to 16-byte boundary - ADATABUNDLEEND: // zero width instruction, just to align next instruction to 16-byte boundary - p.Pc = (p.Pc + 15) &^ 15 - - if out != nil { - asmout(ctxt, p, o, out) - } - - case obj.AUNDEF, - APLD: - size = 4 - if out != nil { - switch p.As { - case obj.AUNDEF: - out[0] = 0xe7fedef0 // NACL_INSTR_ARM_ABORT_NOW (UDF #0xEDE0) - - case APLD: - out[0] = 0xe1a01001 // (MOVW R1, R1) - } - } - - case AB, ABL: - if p.To.Type != obj.TYPE_MEM { - if out != nil { - asmout(ctxt, p, o, out) - } - } else { - if p.To.Offset != 0 || size != 4 || p.To.Reg > REG_R15 || p.To.Reg < REG_R0 { - ctxt.Diag("unsupported instruction: %v", p) - } - if p.Pc&15 == 12 { - p.Pc += 4 - } - if out != nil { - out[0] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03c0013f | (uint32(p.To.Reg)&15)<<12 | (uint32(p.To.Reg)&15)<<16 // BIC $0xc000000f, Rx - if p.As == AB { - out[1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff10 | (uint32(p.To.Reg)&15)<<0 // BX Rx - } else { // ABL - out[1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff30 | (uint32(p.To.Reg)&15)<<0 // BLX Rx - } - } - - size = 8 - } - - // align the last instruction (the actual BL) to the last instruction in a bundle - if p.As == ABL { - if deferreturn == nil { - deferreturn = obj.Linklookup(ctxt, "runtime.deferreturn", 0) - } - if p.To.Sym == deferreturn { - p.Pc = ((int64(origPC) + 15) &^ 15) + 16 - int64(size) - } else { - p.Pc += (16 - ((p.Pc + int64(size)) & 15)) & 15 - } - } - - case ALDREX, - ALDREXD, - AMOVB, - AMOVBS, - AMOVBU, - AMOVD, - AMOVF, - AMOVH, - AMOVHS, - AMOVHU, - AMOVM, - AMOVW, - ASTREX, - ASTREXD: - if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_R15 && p.From.Reg == REG_R13 { // MOVW.W x(R13), PC - if out != nil { - asmout(ctxt, p, o, out) - } - if size == 4 { - if out != nil { - // Note: 5c and 5g reg.c know that DIV/MOD smashes R12 - // so that this return instruction expansion is valid. - out[0] = out[0] &^ 0x3000 // change PC to R12 - out[1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03ccc13f // BIC $0xc000000f, R12 - out[2] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff1c // BX R12 - } - - size += 8 - if (p.Pc+int64(size))&15 == 4 { - p.Pc += 4 - } - break - } else { - // if the instruction used more than 4 bytes, then it must have used a very large - // offset to update R13, so we need to additionally mask R13. - if out != nil { - out[size/4-1] &^= 0x3000 // change PC to R12 - out[size/4] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03cdd103 // BIC $0xc0000000, R13 - out[size/4+1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03ccc13f // BIC $0xc000000f, R12 - out[size/4+2] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff1c // BX R12 - } - - // p->pc+size is only ok at 4 or 12 mod 16. - if (p.Pc+int64(size))%8 == 0 { - p.Pc += 4 - } - size += 12 - break - } - } - - if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_R15 { - ctxt.Diag("unsupported instruction (move to another register and use indirect jump instead): %v", p) - } - - if p.To.Type == obj.TYPE_MEM && p.To.Reg == REG_R13 && (p.Scond&C_WBIT != 0) && size > 4 { - // function prolog with very large frame size: MOVW.W R14,-100004(R13) - // split it into two instructions: - // ADD $-100004, R13 - // MOVW R14, 0(R13) - q := ctxt.NewProg() - - p.Scond &^= C_WBIT - *q = *p - a := &p.To - var a2 *obj.Addr - if p.To.Type == obj.TYPE_MEM { - a2 = &q.To - } else { - a2 = &q.From - } - nocache(q) - nocache(p) - - // insert q after p - q.Link = p.Link - - p.Link = q - q.Pcond = nil - - // make p into ADD $X, R13 - p.As = AADD - - p.From = *a - p.From.Reg = 0 - p.From.Type = obj.TYPE_CONST - p.To = obj.Addr{} - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R13 - - // make q into p but load/store from 0(R13) - q.Spadj = 0 - - *a2 = obj.Addr{} - a2.Type = obj.TYPE_MEM - a2.Reg = REG_R13 - a2.Sym = nil - a2.Offset = 0 - size = int(oplook(ctxt, p).size) - break - } - - if (p.To.Type == obj.TYPE_MEM && p.To.Reg != REG_R9) || // MOVW Rx, X(Ry), y != 9 - (p.From.Type == obj.TYPE_MEM && p.From.Reg != REG_R9) { // MOVW X(Rx), Ry, x != 9 - var a *obj.Addr - if p.To.Type == obj.TYPE_MEM { - a = &p.To - } else { - a = &p.From - } - reg := int(a.Reg) - if size == 4 { - // if addr.reg == 0, then it is probably load from x(FP) with small x, no need to modify. - if reg == 0 { - if out != nil { - asmout(ctxt, p, o, out) - } - } else { - if out != nil { - out[0] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03c00103 | (uint32(reg)&15)<<16 | (uint32(reg)&15)<<12 // BIC $0xc0000000, Rx - } - if p.Pc&15 == 12 { - p.Pc += 4 - } - size += 4 - if out != nil { - asmout(ctxt, p, o, out[1:]) - } - } - - break - } else { - // if a load/store instruction takes more than 1 word to implement, then - // we need to separate the instruction into two: - // 1. explicitly load the address into R11. - // 2. load/store from R11. - // This won't handle .W/.P, so we should reject such code. - if p.Scond&(C_PBIT|C_WBIT) != 0 { - ctxt.Diag("unsupported instruction (.P/.W): %v", p) - } - q := ctxt.NewProg() - *q = *p - var a2 *obj.Addr - if p.To.Type == obj.TYPE_MEM { - a2 = &q.To - } else { - a2 = &q.From - } - nocache(q) - nocache(p) - - // insert q after p - q.Link = p.Link - - p.Link = q - q.Pcond = nil - - // make p into MOVW $X(R), R11 - p.As = AMOVW - - p.From = *a - p.From.Type = obj.TYPE_ADDR - p.To = obj.Addr{} - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R11 - - // make q into p but load/store from 0(R11) - *a2 = obj.Addr{} - - a2.Type = obj.TYPE_MEM - a2.Reg = REG_R11 - a2.Sym = nil - a2.Offset = 0 - size = int(oplook(ctxt, p).size) - break - } - } else if out != nil { - asmout(ctxt, p, o, out) - } - } - - // destination register specific - if p.To.Type == obj.TYPE_REG { - switch p.To.Reg { - case REG_R9: - ctxt.Diag("invalid instruction, cannot write to R9: %v", p) - - case REG_R13: - if out != nil { - out[size/4] = 0xe3cdd103 // BIC $0xc0000000, R13 - } - if (p.Pc+int64(size))&15 == 0 { - p.Pc += 4 - } - size += 4 - } - } - - return size -} - -func span5(ctxt *obj.Link, cursym *obj.LSym) { - var p *obj.Prog - var op *obj.Prog - - p = cursym.Text - if p == nil || p.Link == nil { // handle external functions and ELF section symbols - return - } - - if oprange[AAND&obj.AMask] == nil { - buildop(ctxt) - } - - ctxt.Cursym = cursym - - ctxt.Autosize = int32(p.To.Offset + 4) - c := int32(0) - - op = p - p = p.Link - var i int - var m int - var o *Optab - for ; p != nil || ctxt.Blitrl != nil; op, p = p, p.Link { - if p == nil { - if checkpool(ctxt, op, 0) { - p = op - continue - } - - // can't happen: blitrl is not nil, but checkpool didn't flushpool - ctxt.Diag("internal inconsistency") - - break - } - - ctxt.Curp = p - p.Pc = int64(c) - o = oplook(ctxt, p) - if ctxt.Headtype != obj.Hnacl { - m = int(o.size) - } else { - m = asmoutnacl(ctxt, c, p, o, nil) - c = int32(p.Pc) // asmoutnacl might change pc for alignment - o = oplook(ctxt, p) // asmoutnacl might change p in rare cases - } - - if m%4 != 0 || p.Pc%4 != 0 { - ctxt.Diag("!pc invalid: %v size=%d", p, m) - } - - // must check literal pool here in case p generates many instructions - if ctxt.Blitrl != nil { - i = m - if checkpool(ctxt, op, i) { - p = op - continue - } - } - - if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP && p.As != obj.AUSEFIELD) { - ctxt.Diag("zero-width instruction\n%v", p) - continue - } - - switch o.flag & (LFROM | LTO | LPOOL) { - case LFROM: - addpool(ctxt, p, &p.From) - - case LTO: - addpool(ctxt, p, &p.To) - - case LPOOL: - if p.Scond&C_SCOND == C_SCOND_NONE { - flushpool(ctxt, p, 0, 0) - } - } - - if p.As == AMOVW && p.To.Type == obj.TYPE_REG && p.To.Reg == REGPC && p.Scond&C_SCOND == C_SCOND_NONE { - flushpool(ctxt, p, 0, 0) - } - c += int32(m) - } - - cursym.Size = int64(c) - - /* - * if any procedure is large enough to - * generate a large SBRA branch, then - * generate extra passes putting branches - * around jmps to fix. this is rare. - */ - times := 0 - - var bflag int - var opc int32 - var out [6 + 3]uint32 - for { - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f span1\n", obj.Cputime()) - } - bflag = 0 - c = 0 - times++ - cursym.Text.Pc = 0 // force re-layout the code. - for p = cursym.Text; p != nil; p = p.Link { - ctxt.Curp = p - o = oplook(ctxt, p) - if int64(c) > p.Pc { - p.Pc = int64(c) - } - - /* very large branches - if(o->type == 6 && p->pcond) { - otxt = p->pcond->pc - c; - if(otxt < 0) - otxt = -otxt; - if(otxt >= (1L<<17) - 10) { - q = emallocz(sizeof(Prog)); - q->link = p->link; - p->link = q; - q->as = AB; - q->to.type = TYPE_BRANCH; - q->pcond = p->pcond; - p->pcond = q; - q = emallocz(sizeof(Prog)); - q->link = p->link; - p->link = q; - q->as = AB; - q->to.type = TYPE_BRANCH; - q->pcond = q->link->link; - bflag = 1; - } - } - */ - opc = int32(p.Pc) - - if ctxt.Headtype != obj.Hnacl { - m = int(o.size) - } else { - m = asmoutnacl(ctxt, c, p, o, nil) - } - if p.Pc != int64(opc) { - bflag = 1 - } - - //print("%v pc changed %d to %d in iter. %d\n", p, opc, (int32)p->pc, times); - c = int32(p.Pc + int64(m)) - - if m%4 != 0 || p.Pc%4 != 0 { - ctxt.Diag("pc invalid: %v size=%d", p, m) - } - - if m/4 > len(out) { - ctxt.Diag("instruction size too large: %d > %d", m/4, len(out)) - } - if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP && p.As != obj.AUSEFIELD) { - if p.As == obj.ATEXT { - ctxt.Autosize = int32(p.To.Offset + 4) - continue - } - - ctxt.Diag("zero-width instruction\n%v", p) - continue - } - } - - cursym.Size = int64(c) - if bflag == 0 { - break - } - } - - if c%4 != 0 { - ctxt.Diag("sym->size=%d, invalid", c) - } - - /* - * lay out the code. all the pc-relative code references, - * even cross-function, are resolved now; - * only data references need to be relocated. - * with more work we could leave cross-function - * code references to be relocated too, and then - * perhaps we'd be able to parallelize the span loop above. - */ - - p = cursym.Text - ctxt.Autosize = int32(p.To.Offset + 4) - cursym.Grow(cursym.Size) - - bp := cursym.P - c = int32(p.Pc) // even p->link might need extra padding - var v int - for p = p.Link; p != nil; p = p.Link { - ctxt.Pc = p.Pc - ctxt.Curp = p - o = oplook(ctxt, p) - opc = int32(p.Pc) - if ctxt.Headtype != obj.Hnacl { - asmout(ctxt, p, o, out[:]) - m = int(o.size) - } else { - m = asmoutnacl(ctxt, c, p, o, out[:]) - if int64(opc) != p.Pc { - ctxt.Diag("asmoutnacl broken: pc changed (%d->%d) in last stage: %v", opc, int32(p.Pc), p) - } - } - - if m%4 != 0 || p.Pc%4 != 0 { - ctxt.Diag("final stage: pc invalid: %v size=%d", p, m) - } - - if int64(c) > p.Pc { - ctxt.Diag("PC padding invalid: want %#d, has %#d: %v", p.Pc, c, p) - } - for int64(c) != p.Pc { - // emit 0xe1a00000 (MOVW R0, R0) - bp[0] = 0x00 - bp = bp[1:] - - bp[0] = 0x00 - bp = bp[1:] - bp[0] = 0xa0 - bp = bp[1:] - bp[0] = 0xe1 - bp = bp[1:] - c += 4 - } - - for i = 0; i < m/4; i++ { - v = int(out[i]) - bp[0] = byte(v) - bp = bp[1:] - bp[0] = byte(v >> 8) - bp = bp[1:] - bp[0] = byte(v >> 16) - bp = bp[1:] - bp[0] = byte(v >> 24) - bp = bp[1:] - } - - c += int32(m) - } -} - -/* - * when the first reference to the literal pool threatens - * to go out of range of a 12-bit PC-relative offset, - * drop the pool now, and branch round it. - * this happens only in extended basic blocks that exceed 4k. - */ -func checkpool(ctxt *obj.Link, p *obj.Prog, sz int) bool { - if pool.size >= 0xff0 || immaddr(int32((p.Pc+int64(sz)+4)+4+int64(12+pool.size)-int64(pool.start+8))) == 0 { - return flushpool(ctxt, p, 1, 0) - } else if p.Link == nil { - return flushpool(ctxt, p, 2, 0) - } - return false -} - -func flushpool(ctxt *obj.Link, p *obj.Prog, skip int, force int) bool { - if ctxt.Blitrl != nil { - if skip != 0 { - if false && skip == 1 { - fmt.Printf("note: flush literal pool at %x: len=%d ref=%x\n", uint64(p.Pc+4), pool.size, pool.start) - } - q := ctxt.NewProg() - q.As = AB - q.To.Type = obj.TYPE_BRANCH - q.Pcond = p.Link - q.Link = ctxt.Blitrl - q.Lineno = p.Lineno - ctxt.Blitrl = q - } else if force == 0 && (p.Pc+int64(12+pool.size)-int64(pool.start) < 2048) { // 12 take into account the maximum nacl literal pool alignment padding size - return false - } - if ctxt.Headtype == obj.Hnacl && pool.size%16 != 0 { - // if pool is not multiple of 16 bytes, add an alignment marker - q := ctxt.NewProg() - - q.As = ADATABUNDLEEND - ctxt.Elitrl.Link = q - ctxt.Elitrl = q - } - - // The line number for constant pool entries doesn't really matter. - // We set it to the line number of the preceding instruction so that - // there are no deltas to encode in the pc-line tables. - for q := ctxt.Blitrl; q != nil; q = q.Link { - q.Lineno = p.Lineno - } - - ctxt.Elitrl.Link = p.Link - p.Link = ctxt.Blitrl - - ctxt.Blitrl = nil /* BUG: should refer back to values until out-of-range */ - ctxt.Elitrl = nil - pool.size = 0 - pool.start = 0 - pool.extra = 0 - return true - } - - return false -} - -func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { - var t obj.Prog - - c := aclass(ctxt, a) - - t.Ctxt = ctxt - t.As = AWORD - - switch c { - default: - t.To.Offset = a.Offset - t.To.Sym = a.Sym - t.To.Type = a.Type - t.To.Name = a.Name - - if ctxt.Flag_shared && t.To.Sym != nil { - t.Rel = p - } - - case C_SROREG, - C_LOREG, - C_ROREG, - C_FOREG, - C_SOREG, - C_HOREG, - C_FAUTO, - C_SAUTO, - C_LAUTO, - C_LACON: - t.To.Type = obj.TYPE_CONST - t.To.Offset = ctxt.Instoffset - } - - if t.Rel == nil { - for q := ctxt.Blitrl; q != nil; q = q.Link { /* could hash on t.t0.offset */ - if q.Rel == nil && q.To == t.To { - p.Pcond = q - return - } - } - } - - if ctxt.Headtype == obj.Hnacl && pool.size%16 == 0 { - // start a new data bundle - q := ctxt.NewProg() - q.As = ADATABUNDLE - q.Pc = int64(pool.size) - pool.size += 4 - if ctxt.Blitrl == nil { - ctxt.Blitrl = q - pool.start = uint32(p.Pc) - } else { - ctxt.Elitrl.Link = q - } - - ctxt.Elitrl = q - } - - q := ctxt.NewProg() - *q = t - q.Pc = int64(pool.size) - - if ctxt.Blitrl == nil { - ctxt.Blitrl = q - pool.start = uint32(p.Pc) - } else { - ctxt.Elitrl.Link = q - } - ctxt.Elitrl = q - pool.size += 4 - - p.Pcond = q -} - -func regoff(ctxt *obj.Link, a *obj.Addr) int32 { - ctxt.Instoffset = 0 - aclass(ctxt, a) - return int32(ctxt.Instoffset) -} - -func immrot(v uint32) int32 { - for i := 0; i < 16; i++ { - if v&^0xff == 0 { - return int32(uint32(int32(i)<<8) | v | 1<<25) - } - v = v<<2 | v>>30 - } - - return 0 -} - -func immaddr(v int32) int32 { - if v >= 0 && v <= 0xfff { - return v&0xfff | 1<<24 | 1<<23 /* pre indexing */ /* pre indexing, up */ - } - if v >= -0xfff && v < 0 { - return -v&0xfff | 1<<24 /* pre indexing */ - } - return 0 -} - -func immfloat(v int32) bool { - return v&0xC03 == 0 /* offset will fit in floating-point load/store */ -} - -func immhalf(v int32) bool { - if v >= 0 && v <= 0xff { - return v|1<<24|1<<23 != 0 /* pre indexing */ /* pre indexing, up */ - } - if v >= -0xff && v < 0 { - return -v&0xff|1<<24 != 0 /* pre indexing */ - } - return false -} - -func aclass(ctxt *obj.Link, a *obj.Addr) int { - switch a.Type { - case obj.TYPE_NONE: - return C_NONE - - case obj.TYPE_REG: - ctxt.Instoffset = 0 - if REG_R0 <= a.Reg && a.Reg <= REG_R15 { - return C_REG - } - if REG_F0 <= a.Reg && a.Reg <= REG_F15 { - return C_FREG - } - if a.Reg == REG_FPSR || a.Reg == REG_FPCR { - return C_FCR - } - if a.Reg == REG_CPSR || a.Reg == REG_SPSR { - return C_PSR - } - return C_GOK - - case obj.TYPE_REGREG: - return C_REGREG - - case obj.TYPE_REGREG2: - return C_REGREG2 - - case obj.TYPE_REGLIST: - return C_REGLIST - - case obj.TYPE_SHIFT: - return C_SHIFT - - case obj.TYPE_MEM: - switch a.Name { - case obj.NAME_EXTERN, - obj.NAME_GOTREF, - obj.NAME_STATIC: - if a.Sym == nil || a.Sym.Name == "" { - fmt.Printf("null sym external\n") - return C_GOK - } - - ctxt.Instoffset = 0 // s.b. unused but just in case - if a.Sym.Type == obj.STLSBSS { - if ctxt.Flag_shared { - return C_TLS_IE - } else { - return C_TLS_LE - } - } - - return C_ADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if t := immaddr(int32(ctxt.Instoffset)); t != 0 { - if immhalf(int32(ctxt.Instoffset)) { - if immfloat(t) { - return C_HFAUTO - } - return C_HAUTO - } - - if immfloat(t) { - return C_FAUTO - } - return C_SAUTO - } - - return C_LAUTO - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 4 - if t := immaddr(int32(ctxt.Instoffset)); t != 0 { - if immhalf(int32(ctxt.Instoffset)) { - if immfloat(t) { - return C_HFAUTO - } - return C_HAUTO - } - - if immfloat(t) { - return C_FAUTO - } - return C_SAUTO - } - - return C_LAUTO - - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if t := immaddr(int32(ctxt.Instoffset)); t != 0 { - if immhalf(int32(ctxt.Instoffset)) { /* n.b. that it will also satisfy immrot */ - if immfloat(t) { - return C_HFOREG - } - return C_HOREG - } - - if immfloat(t) { - return C_FOREG /* n.b. that it will also satisfy immrot */ - } - if immrot(uint32(ctxt.Instoffset)) != 0 { - return C_SROREG - } - if immhalf(int32(ctxt.Instoffset)) { - return C_HOREG - } - return C_SOREG - } - - if immrot(uint32(ctxt.Instoffset)) != 0 { - return C_ROREG - } - return C_LOREG - } - - return C_GOK - - case obj.TYPE_FCONST: - if chipzero5(ctxt, a.Val.(float64)) >= 0 { - return C_ZFCON - } - if chipfloat5(ctxt, a.Val.(float64)) >= 0 { - return C_SFCON - } - return C_LFCON - - case obj.TYPE_TEXTSIZE: - return C_TEXTSIZE - - case obj.TYPE_CONST, - obj.TYPE_ADDR: - switch a.Name { - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if a.Reg != 0 { - return aconsize(ctxt) - } - - if immrot(uint32(ctxt.Instoffset)) != 0 { - return C_RCON - } - if immrot(^uint32(ctxt.Instoffset)) != 0 { - return C_NCON - } - return C_LCON - - case obj.NAME_EXTERN, - obj.NAME_GOTREF, - obj.NAME_STATIC: - s := a.Sym - if s == nil { - break - } - ctxt.Instoffset = 0 // s.b. unused but just in case - return C_LCONADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - return aconsize(ctxt) - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 4 - return aconsize(ctxt) - } - - return C_GOK - - case obj.TYPE_BRANCH: - return C_SBRA - } - - return C_GOK -} - -func aconsize(ctxt *obj.Link) int { - if immrot(uint32(ctxt.Instoffset)) != 0 { - return C_RACON - } - if immrot(uint32(-ctxt.Instoffset)) != 0 { - return C_RACON - } - return C_LACON -} - -func prasm(p *obj.Prog) { - fmt.Printf("%v\n", p) -} - -func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { - a1 := int(p.Optab) - if a1 != 0 { - return &optab[a1-1] - } - a1 = int(p.From.Class) - if a1 == 0 { - a1 = aclass(ctxt, &p.From) + 1 - p.From.Class = int8(a1) - } - - a1-- - a3 := int(p.To.Class) - if a3 == 0 { - a3 = aclass(ctxt, &p.To) + 1 - p.To.Class = int8(a3) - } - - a3-- - a2 := C_NONE - if p.Reg != 0 { - a2 = C_REG - } - - if false { /*debug['O']*/ - fmt.Printf("oplook %v %v %v %v\n", p.As, DRconv(a1), DRconv(a2), DRconv(a3)) - fmt.Printf("\t\t%d %d\n", p.From.Type, p.To.Type) - } - - ops := oprange[p.As&obj.AMask] - c1 := &xcmp[a1] - c3 := &xcmp[a3] - for i := range ops { - op := &ops[i] - if int(op.a2) == a2 && c1[op.a1] && c3[op.a3] { - p.Optab = uint16(cap(optab) - cap(ops) + i + 1) - return op - } - } - - ctxt.Diag("illegal combination %v; %v %v %v, %d %d", p, DRconv(a1), DRconv(a2), DRconv(a3), p.From.Type, p.To.Type) - ctxt.Diag("from %d %d to %d %d\n", p.From.Type, p.From.Name, p.To.Type, p.To.Name) - prasm(p) - if ops == nil { - ops = optab - } - return &ops[0] -} - -func cmp(a int, b int) bool { - if a == b { - return true - } - switch a { - case C_LCON: - if b == C_RCON || b == C_NCON { - return true - } - - case C_LACON: - if b == C_RACON { - return true - } - - case C_LFCON: - if b == C_ZFCON || b == C_SFCON { - return true - } - - case C_HFAUTO: - return b == C_HAUTO || b == C_FAUTO - - case C_FAUTO, C_HAUTO: - return b == C_HFAUTO - - case C_SAUTO: - return cmp(C_HFAUTO, b) - - case C_LAUTO: - return cmp(C_SAUTO, b) - - case C_HFOREG: - return b == C_HOREG || b == C_FOREG - - case C_FOREG, C_HOREG: - return b == C_HFOREG - - case C_SROREG: - return cmp(C_SOREG, b) || cmp(C_ROREG, b) - - case C_SOREG, C_ROREG: - return b == C_SROREG || cmp(C_HFOREG, b) - - case C_LOREG: - return cmp(C_SROREG, b) - - case C_LBRA: - if b == C_SBRA { - return true - } - - case C_HREG: - return cmp(C_SP, b) || cmp(C_PC, b) - } - - return false -} - -type ocmp []Optab - -func (x ocmp) Len() int { - return len(x) -} - -func (x ocmp) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} - -func (x ocmp) Less(i, j int) bool { - p1 := &x[i] - p2 := &x[j] - n := int(p1.as) - int(p2.as) - if n != 0 { - return n < 0 - } - n = int(p1.a1) - int(p2.a1) - if n != 0 { - return n < 0 - } - n = int(p1.a2) - int(p2.a2) - if n != 0 { - return n < 0 - } - n = int(p1.a3) - int(p2.a3) - if n != 0 { - return n < 0 - } - return false -} - -func opset(a, b0 obj.As) { - oprange[a&obj.AMask] = oprange[b0] -} - -func buildop(ctxt *obj.Link) { - var n int - - for i := 0; i < C_GOK; i++ { - for n = 0; n < C_GOK; n++ { - if cmp(n, i) { - xcmp[i][n] = true - } - } - } - for n = 0; optab[n].as != obj.AXXX; n++ { - if optab[n].flag&LPCREL != 0 { - if ctxt.Flag_shared { - optab[n].size += int8(optab[n].pcrelsiz) - } else { - optab[n].flag &^= LPCREL - } - } - } - - sort.Sort(ocmp(optab[:n])) - for i := 0; i < n; i++ { - r := optab[i].as - r0 := r & obj.AMask - start := i - for optab[i].as == r { - i++ - } - oprange[r0] = optab[start:i] - i-- - - switch r { - default: - ctxt.Diag("unknown op in build: %v", r) - log.Fatalf("bad code") - - case AADD: - opset(AAND, r0) - opset(AEOR, r0) - opset(ASUB, r0) - opset(ARSB, r0) - opset(AADC, r0) - opset(ASBC, r0) - opset(ARSC, r0) - opset(AORR, r0) - opset(ABIC, r0) - - case ACMP: - opset(ATEQ, r0) - opset(ACMN, r0) - - case AMVN: - break - - case ABEQ: - opset(ABNE, r0) - opset(ABCS, r0) - opset(ABHS, r0) - opset(ABCC, r0) - opset(ABLO, r0) - opset(ABMI, r0) - opset(ABPL, r0) - opset(ABVS, r0) - opset(ABVC, r0) - opset(ABHI, r0) - opset(ABLS, r0) - opset(ABGE, r0) - opset(ABLT, r0) - opset(ABGT, r0) - opset(ABLE, r0) - - case ASLL: - opset(ASRL, r0) - opset(ASRA, r0) - - case AMUL: - opset(AMULU, r0) - - case ADIV: - opset(AMOD, r0) - opset(AMODU, r0) - opset(ADIVU, r0) - - case AMOVW, - AMOVB, - AMOVBS, - AMOVBU, - AMOVH, - AMOVHS, - AMOVHU: - break - - case ASWPW: - opset(ASWPBU, r0) - - case AB, - ABL, - ABX, - ABXRET, - obj.ADUFFZERO, - obj.ADUFFCOPY, - ASWI, - AWORD, - AMOVM, - ARFE, - obj.ATEXT, - obj.AUSEFIELD, - obj.ATYPE: - break - - case AADDF: - opset(AADDD, r0) - opset(ASUBF, r0) - opset(ASUBD, r0) - opset(AMULF, r0) - opset(AMULD, r0) - opset(ADIVF, r0) - opset(ADIVD, r0) - opset(ASQRTF, r0) - opset(ASQRTD, r0) - opset(AMOVFD, r0) - opset(AMOVDF, r0) - opset(AABSF, r0) - opset(AABSD, r0) - opset(ANEGF, r0) - opset(ANEGD, r0) - - case ACMPF: - opset(ACMPD, r0) - - case AMOVF: - opset(AMOVD, r0) - - case AMOVFW: - opset(AMOVDW, r0) - - case AMOVWF: - opset(AMOVWD, r0) - - case AMULL: - opset(AMULAL, r0) - opset(AMULLU, r0) - opset(AMULALU, r0) - - case AMULWT: - opset(AMULWB, r0) - - case AMULAWT: - opset(AMULAWB, r0) - - case AMULA, - ALDREX, - ASTREX, - ALDREXD, - ASTREXD, - ATST, - APLD, - obj.AUNDEF, - ACLZ, - obj.AFUNCDATA, - obj.APCDATA, - obj.ANOP, - ADATABUNDLE, - ADATABUNDLEEND: - break - } - } -} - -func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { - ctxt.Printp = p - o1 := uint32(0) - o2 := uint32(0) - o3 := uint32(0) - o4 := uint32(0) - o5 := uint32(0) - o6 := uint32(0) - ctxt.Armsize += int32(o.size) - if false { /*debug['P']*/ - fmt.Printf("%x: %v\ttype %d\n", uint32(p.Pc), p, o.type_) - } - switch o.type_ { - default: - ctxt.Diag("unknown asm %d", o.type_) - prasm(p) - - case 0: /* pseudo ops */ - if false { /*debug['G']*/ - fmt.Printf("%x: %s: arm\n", uint32(p.Pc), p.From.Sym.Name) - } - - case 1: /* op R,[R],R */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - rf := int(p.From.Reg) - rt := int(p.To.Reg) - r := int(p.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = 0 - } - if p.As == AMOVB || p.As == AMOVH || p.As == AMOVW || p.As == AMVN { - r = 0 - } else if r == 0 { - r = rt - } - o1 |= (uint32(rf)&15)<<0 | (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 - - case 2: /* movbu $I,[R],R */ - aclass(ctxt, &p.From) - - o1 = oprrr(ctxt, p.As, int(p.Scond)) - o1 |= uint32(immrot(uint32(ctxt.Instoffset))) - rt := int(p.To.Reg) - r := int(p.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = 0 - } - if p.As == AMOVW || p.As == AMVN { - r = 0 - } else if r == 0 { - r = rt - } - o1 |= (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 - - case 3: /* add R<<[IR],[R],R */ - o1 = mov(ctxt, p) - - case 4: /* MOVW $off(R), R -> add $off,[R],R */ - aclass(ctxt, &p.From) - if ctxt.Instoffset < 0 { - o1 = oprrr(ctxt, ASUB, int(p.Scond)) - o1 |= uint32(immrot(uint32(-ctxt.Instoffset))) - } else { - o1 = oprrr(ctxt, AADD, int(p.Scond)) - o1 |= uint32(immrot(uint32(ctxt.Instoffset))) - } - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 |= (uint32(r) & 15) << 16 - o1 |= (uint32(p.To.Reg) & 15) << 12 - - case 5: /* bra s */ - o1 = opbra(ctxt, p, p.As, int(p.Scond)) - - v := int32(-8) - if p.To.Sym != nil { - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - v += int32(p.To.Offset) - rel.Add = int64(o1) | (int64(v)>>2)&0xffffff - rel.Type = obj.R_CALLARM - break - } - - if p.Pcond != nil { - v = int32((p.Pcond.Pc - ctxt.Pc) - 8) - } - o1 |= (uint32(v) >> 2) & 0xffffff - - case 6: /* b ,O(R) -> add $O,R,PC */ - aclass(ctxt, &p.To) - - o1 = oprrr(ctxt, AADD, int(p.Scond)) - o1 |= uint32(immrot(uint32(ctxt.Instoffset))) - o1 |= (uint32(p.To.Reg) & 15) << 16 - o1 |= (REGPC & 15) << 12 - - case 7: /* bl (R) -> blx R */ - aclass(ctxt, &p.To) - - if ctxt.Instoffset != 0 { - ctxt.Diag("%v: doesn't support BL offset(REG) with non-zero offset %d", p, ctxt.Instoffset) - } - o1 = oprrr(ctxt, ABL, int(p.Scond)) - o1 |= (uint32(p.To.Reg) & 15) << 0 - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 0 - rel.Type = obj.R_CALLIND - - case 8: /* sll $c,[R],R -> mov (R<<$c),R */ - aclass(ctxt, &p.From) - - o1 = oprrr(ctxt, p.As, int(p.Scond)) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o1 |= (uint32(r) & 15) << 0 - o1 |= uint32((ctxt.Instoffset & 31) << 7) - o1 |= (uint32(p.To.Reg) & 15) << 12 - - case 9: /* sll R,[R],R -> mov (R< lr */ - aclass(ctxt, &p.From) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = olr(ctxt, int32(ctxt.Instoffset), r, int(p.To.Reg), int(p.Scond)) - if p.As != AMOVW { - o1 |= 1 << 22 - } - - case 30: /* mov/movb/movbu R,L(R) */ - o1 = omvl(ctxt, p, &p.To, REGTMP) - - if o1 == 0 { - break - } - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o2 = osrr(ctxt, int(p.From.Reg), REGTMP&15, r, int(p.Scond)) - if p.As != AMOVW { - o2 |= 1 << 22 - } - - case 31: /* mov/movbu L(R),R -> lr[b] */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o2 = olrr(ctxt, REGTMP&15, r, int(p.To.Reg), int(p.Scond)) - if p.As == AMOVBU || p.As == AMOVBS || p.As == AMOVB { - o2 |= 1 << 22 - } - - case 34: /* mov $lacon,R */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - - o2 = oprrr(ctxt, AADD, int(p.Scond)) - o2 |= REGTMP & 15 - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o2 |= (uint32(r) & 15) << 16 - if p.To.Type != obj.TYPE_NONE { - o2 |= (uint32(p.To.Reg) & 15) << 12 - } - - case 35: /* mov PSR,R */ - o1 = 2<<23 | 0xf<<16 | 0<<0 - - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - o1 |= (uint32(p.From.Reg) & 1) << 22 - o1 |= (uint32(p.To.Reg) & 15) << 12 - - case 36: /* mov R,PSR */ - o1 = 2<<23 | 0x29f<<12 | 0<<4 - - if p.Scond&C_FBIT != 0 { - o1 ^= 0x010 << 12 - } - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - o1 |= (uint32(p.To.Reg) & 1) << 22 - o1 |= (uint32(p.From.Reg) & 15) << 0 - - case 37: /* mov $con,PSR */ - aclass(ctxt, &p.From) - - o1 = 2<<23 | 0x29f<<12 | 0<<4 - if p.Scond&C_FBIT != 0 { - o1 ^= 0x010 << 12 - } - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - o1 |= uint32(immrot(uint32(ctxt.Instoffset))) - o1 |= (uint32(p.To.Reg) & 1) << 22 - o1 |= (uint32(p.From.Reg) & 15) << 0 - - case 38, 39: - switch o.type_ { - case 38: /* movm $con,oreg -> stm */ - o1 = 0x4 << 25 - - o1 |= uint32(p.From.Offset & 0xffff) - o1 |= (uint32(p.To.Reg) & 15) << 16 - aclass(ctxt, &p.To) - - case 39: /* movm oreg,$con -> ldm */ - o1 = 0x4<<25 | 1<<20 - - o1 |= uint32(p.To.Offset & 0xffff) - o1 |= (uint32(p.From.Reg) & 15) << 16 - aclass(ctxt, &p.From) - } - - if ctxt.Instoffset != 0 { - ctxt.Diag("offset must be zero in MOVM; %v", p) - } - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - if p.Scond&C_PBIT != 0 { - o1 |= 1 << 24 - } - if p.Scond&C_UBIT != 0 { - o1 |= 1 << 23 - } - if p.Scond&C_SBIT != 0 { - o1 |= 1 << 22 - } - if p.Scond&C_WBIT != 0 { - o1 |= 1 << 21 - } - - case 40: /* swp oreg,reg,reg */ - aclass(ctxt, &p.From) - - if ctxt.Instoffset != 0 { - ctxt.Diag("offset must be zero in SWP") - } - o1 = 0x2<<23 | 0x9<<4 - if p.As != ASWPW { - o1 |= 1 << 22 - } - o1 |= (uint32(p.From.Reg) & 15) << 16 - o1 |= (uint32(p.Reg) & 15) << 0 - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 41: /* rfe -> movm.s.w.u 0(r13),[r15] */ - o1 = 0xe8fd8000 - - case 50: /* floating point store */ - v := regoff(ctxt, &p.To) - - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o1 = ofsr(ctxt, p.As, int(p.From.Reg), v, r, int(p.Scond), p) - - case 51: /* floating point load */ - v := regoff(ctxt, &p.From) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = ofsr(ctxt, p.As, int(p.To.Reg), v, r, int(p.Scond), p) | 1<<20 - - case 52: /* floating point store, int32 offset UGLY */ - o1 = omvl(ctxt, p, &p.To, REGTMP) - - if o1 == 0 { - break - } - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o2 = oprrr(ctxt, AADD, int(p.Scond)) | (REGTMP&15)<<12 | (REGTMP&15)<<16 | (uint32(r)&15)<<0 - o3 = ofsr(ctxt, p.As, int(p.From.Reg), 0, REGTMP, int(p.Scond), p) - - case 53: /* floating point load, int32 offset UGLY */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o2 = oprrr(ctxt, AADD, int(p.Scond)) | (REGTMP&15)<<12 | (REGTMP&15)<<16 | (uint32(r)&15)<<0 - o3 = ofsr(ctxt, p.As, int(p.To.Reg), 0, (REGTMP&15), int(p.Scond), p) | 1<<20 - - case 54: /* floating point arith */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - rf := int(p.From.Reg) - rt := int(p.To.Reg) - r := int(p.Reg) - if r == 0 { - r = rt - if p.As == AMOVF || p.As == AMOVD || p.As == AMOVFD || p.As == AMOVDF || p.As == ASQRTF || p.As == ASQRTD || p.As == AABSF || p.As == AABSD || p.As == ANEGF || p.As == ANEGD { - r = 0 - } - } - - o1 |= (uint32(rf)&15)<<0 | (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 - - case 56: /* move to FP[CS]R */ - o1 = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0xe<<24 | 1<<8 | 1<<4 - - o1 |= ((uint32(p.To.Reg)&1)+1)<<21 | (uint32(p.From.Reg)&15)<<12 - - case 57: /* move from FP[CS]R */ - o1 = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0xe<<24 | 1<<8 | 1<<4 - - o1 |= ((uint32(p.From.Reg)&1)+1)<<21 | (uint32(p.To.Reg)&15)<<12 | 1<<20 - - case 58: /* movbu R,R */ - o1 = oprrr(ctxt, AAND, int(p.Scond)) - - o1 |= uint32(immrot(0xff)) - rt := int(p.To.Reg) - r := int(p.From.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = 0 - } - if r == 0 { - r = rt - } - o1 |= (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 - - case 59: /* movw/bu R< ldr indexed */ - if p.From.Reg == 0 { - if p.As != AMOVW { - ctxt.Diag("byte MOV from shifter operand") - } - o1 = mov(ctxt, p) - break - } - - if p.From.Offset&(1<<4) != 0 { - ctxt.Diag("bad shift in LDR") - } - o1 = olrr(ctxt, int(p.From.Offset), int(p.From.Reg), int(p.To.Reg), int(p.Scond)) - if p.As == AMOVBU { - o1 |= 1 << 22 - } - - case 60: /* movb R(R),R -> ldrsb indexed */ - if p.From.Reg == 0 { - ctxt.Diag("byte MOV from shifter operand") - o1 = mov(ctxt, p) - break - } - - if p.From.Offset&(^0xf) != 0 { - ctxt.Diag("bad shift in LDRSB") - } - o1 = olhrr(ctxt, int(p.From.Offset), int(p.From.Reg), int(p.To.Reg), int(p.Scond)) - o1 ^= 1<<5 | 1<<6 - - case 61: /* movw/b/bu R,R<<[IR](R) -> str indexed */ - if p.To.Reg == 0 { - ctxt.Diag("MOV to shifter operand") - } - o1 = osrr(ctxt, int(p.From.Reg), int(p.To.Offset), int(p.To.Reg), int(p.Scond)) - if p.As == AMOVB || p.As == AMOVBS || p.As == AMOVBU { - o1 |= 1 << 22 - } - - /* reloc ops */ - case 64: /* mov/movb/movbu R,addr */ - o1 = omvl(ctxt, p, &p.To, REGTMP) - - if o1 == 0 { - break - } - o2 = osr(ctxt, p.As, int(p.From.Reg), 0, REGTMP, int(p.Scond)) - if o.flag&LPCREL != 0 { - o3 = o2 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 - } - - case 65: /* mov/movbu addr,R */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - o2 = olr(ctxt, 0, REGTMP, int(p.To.Reg), int(p.Scond)) - if p.As == AMOVBU || p.As == AMOVBS || p.As == AMOVB { - o2 |= 1 << 22 - } - if o.flag&LPCREL != 0 { - o3 = o2 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 - } - - case 101: /* movw tlsvar,R, local exec*/ - if p.Scond&C_SCOND != C_SCOND_NONE { - ctxt.Diag("conditional tls") - } - o1 = omvl(ctxt, p, &p.From, int(p.To.Reg)) - - case 102: /* movw tlsvar,R, initial exec*/ - if p.Scond&C_SCOND != C_SCOND_NONE { - ctxt.Diag("conditional tls") - } - o1 = omvl(ctxt, p, &p.From, int(p.To.Reg)) - o2 = olrr(ctxt, int(p.To.Reg)&15, (REGPC & 15), int(p.To.Reg), int(p.Scond)) - - case 103: /* word tlsvar, local exec */ - if p.To.Sym == nil { - ctxt.Diag("nil sym in tls %v", p) - } - if p.To.Offset != 0 { - ctxt.Diag("offset against tls var in %v", p) - } - // This case happens with words generated in the PC stream as part of - // the literal pool. - rel := obj.Addrel(ctxt.Cursym) - - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Type = obj.R_TLS_LE - o1 = 0 - - case 104: /* word tlsvar, initial exec */ - if p.To.Sym == nil { - ctxt.Diag("nil sym in tls %v", p) - } - if p.To.Offset != 0 { - ctxt.Diag("offset against tls var in %v", p) - } - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Type = obj.R_TLS_IE - rel.Add = ctxt.Pc - p.Rel.Pc - 8 - int64(rel.Siz) - - case 68: /* floating point store -> ADDR */ - o1 = omvl(ctxt, p, &p.To, REGTMP) - - if o1 == 0 { - break - } - o2 = ofsr(ctxt, p.As, int(p.From.Reg), 0, REGTMP, int(p.Scond), p) - if o.flag&LPCREL != 0 { - o3 = o2 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 - } - - case 69: /* floating point load <- ADDR */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - o2 = ofsr(ctxt, p.As, int(p.To.Reg), 0, (REGTMP&15), int(p.Scond), p) | 1<<20 - if o.flag&LPCREL != 0 { - o3 = o2 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 - } - - /* ArmV4 ops: */ - case 70: /* movh/movhu R,O(R) -> strh */ - aclass(ctxt, &p.To) - - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o1 = oshr(ctxt, int(p.From.Reg), int32(ctxt.Instoffset), r, int(p.Scond)) - - case 71: /* movb/movh/movhu O(R),R -> ldrsb/ldrsh/ldrh */ - aclass(ctxt, &p.From) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = olhr(ctxt, int32(ctxt.Instoffset), r, int(p.To.Reg), int(p.Scond)) - if p.As == AMOVB || p.As == AMOVBS { - o1 ^= 1<<5 | 1<<6 - } else if p.As == AMOVH || p.As == AMOVHS { - o1 ^= (1 << 6) - } - - case 72: /* movh/movhu R,L(R) -> strh */ - o1 = omvl(ctxt, p, &p.To, REGTMP) - - if o1 == 0 { - break - } - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o2 = oshrr(ctxt, int(p.From.Reg), REGTMP&15, r, int(p.Scond)) - - case 73: /* movb/movh/movhu L(R),R -> ldrsb/ldrsh/ldrh */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o2 = olhrr(ctxt, REGTMP&15, r, int(p.To.Reg), int(p.Scond)) - if p.As == AMOVB || p.As == AMOVBS { - o2 ^= 1<<5 | 1<<6 - } else if p.As == AMOVH || p.As == AMOVHS { - o2 ^= (1 << 6) - } - - case 74: /* bx $I */ - ctxt.Diag("ABX $I") - - case 75: /* bx O(R) */ - aclass(ctxt, &p.To) - - if ctxt.Instoffset != 0 { - ctxt.Diag("non-zero offset in ABX") - } - - /* - o1 = oprrr(ctxt, AADD, p->scond) | immrot(0) | ((REGPC&15)<<16) | ((REGLINK&15)<<12); // mov PC, LR - o2 = (((p->scond&C_SCOND) ^ C_SCOND_XOR)<<28) | (0x12fff<<8) | (1<<4) | ((p->to.reg&15) << 0); // BX R - */ - // p->to.reg may be REGLINK - o1 = oprrr(ctxt, AADD, int(p.Scond)) - - o1 |= uint32(immrot(uint32(ctxt.Instoffset))) - o1 |= (uint32(p.To.Reg) & 15) << 16 - o1 |= (REGTMP & 15) << 12 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | uint32(immrot(0)) | (REGPC&15)<<16 | (REGLINK&15)<<12 // mov PC, LR - o3 = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x12fff<<8 | 1<<4 | REGTMP&15 // BX Rtmp - - case 76: /* bx O(R) when returning from fn*/ - ctxt.Diag("ABXRET") - - case 77: /* ldrex oreg,reg */ - aclass(ctxt, &p.From) - - if ctxt.Instoffset != 0 { - ctxt.Diag("offset must be zero in LDREX") - } - o1 = 0x19<<20 | 0xf9f - o1 |= (uint32(p.From.Reg) & 15) << 16 - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 78: /* strex reg,oreg,reg */ - aclass(ctxt, &p.From) - - if ctxt.Instoffset != 0 { - ctxt.Diag("offset must be zero in STREX") - } - o1 = 0x18<<20 | 0xf90 - o1 |= (uint32(p.From.Reg) & 15) << 16 - o1 |= (uint32(p.Reg) & 15) << 0 - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 80: /* fmov zfcon,freg */ - if p.As == AMOVD { - o1 = 0xeeb00b00 // VMOV imm 64 - o2 = oprrr(ctxt, ASUBD, int(p.Scond)) - } else { - o1 = 0x0eb00a00 // VMOV imm 32 - o2 = oprrr(ctxt, ASUBF, int(p.Scond)) - } - - v := int32(0x70) // 1.0 - r := (int(p.To.Reg) & 15) << 0 - - // movf $1.0, r - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - o1 |= (uint32(r) & 15) << 12 - o1 |= (uint32(v) & 0xf) << 0 - o1 |= (uint32(v) & 0xf0) << 12 - - // subf r,r,r - o2 |= (uint32(r)&15)<<0 | (uint32(r)&15)<<16 | (uint32(r)&15)<<12 - - case 81: /* fmov sfcon,freg */ - o1 = 0x0eb00a00 // VMOV imm 32 - if p.As == AMOVD { - o1 = 0xeeb00b00 // VMOV imm 64 - } - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - o1 |= (uint32(p.To.Reg) & 15) << 12 - v := int32(chipfloat5(ctxt, p.From.Val.(float64))) - o1 |= (uint32(v) & 0xf) << 0 - o1 |= (uint32(v) & 0xf0) << 12 - - case 82: /* fcmp freg,freg, */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.Reg)&15)<<12 | (uint32(p.From.Reg)&15)<<0 - o2 = 0x0ef1fa10 // VMRS R15 - o2 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 83: /* fcmp freg,, */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.From.Reg)&15)<<12 | 1<<16 - o2 = 0x0ef1fa10 // VMRS R15 - o2 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 84: /* movfw freg,freg - truncate float-to-fix */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 0 - o1 |= (uint32(p.To.Reg) & 15) << 12 - - case 85: /* movwf freg,freg - fix-to-float */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 0 - o1 |= (uint32(p.To.Reg) & 15) << 12 - - // macro for movfw freg,FTMP; movw FTMP,reg - case 86: /* movfw freg,reg - truncate float-to-fix */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 0 - o1 |= (FREGTMP & 15) << 12 - o2 = oprrr(ctxt, -AMOVFW, int(p.Scond)) - o2 |= (FREGTMP & 15) << 16 - o2 |= (uint32(p.To.Reg) & 15) << 12 - - // macro for movw reg,FTMP; movwf FTMP,freg - case 87: /* movwf reg,freg - fix-to-float */ - o1 = oprrr(ctxt, -AMOVWF, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 12 - o1 |= (FREGTMP & 15) << 16 - o2 = oprrr(ctxt, p.As, int(p.Scond)) - o2 |= (FREGTMP & 15) << 0 - o2 |= (uint32(p.To.Reg) & 15) << 12 - - case 88: /* movw reg,freg */ - o1 = oprrr(ctxt, -AMOVWF, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 12 - o1 |= (uint32(p.To.Reg) & 15) << 16 - - case 89: /* movw freg,reg */ - o1 = oprrr(ctxt, -AMOVFW, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 16 - o1 |= (uint32(p.To.Reg) & 15) << 12 - - case 90: /* tst reg */ - o1 = oprrr(ctxt, -ACMP, int(p.Scond)) - - o1 |= (uint32(p.From.Reg) & 15) << 16 - - case 91: /* ldrexd oreg,reg */ - aclass(ctxt, &p.From) - - if ctxt.Instoffset != 0 { - ctxt.Diag("offset must be zero in LDREX") - } - o1 = 0x1b<<20 | 0xf9f - o1 |= (uint32(p.From.Reg) & 15) << 16 - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 92: /* strexd reg,oreg,reg */ - aclass(ctxt, &p.From) - - if ctxt.Instoffset != 0 { - ctxt.Diag("offset must be zero in STREX") - } - o1 = 0x1a<<20 | 0xf90 - o1 |= (uint32(p.From.Reg) & 15) << 16 - o1 |= (uint32(p.Reg) & 15) << 0 - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 - - case 93: /* movb/movh/movhu addr,R -> ldrsb/ldrsh/ldrh */ - o1 = omvl(ctxt, p, &p.From, REGTMP) - - if o1 == 0 { - break - } - o2 = olhr(ctxt, 0, REGTMP, int(p.To.Reg), int(p.Scond)) - if p.As == AMOVB || p.As == AMOVBS { - o2 ^= 1<<5 | 1<<6 - } else if p.As == AMOVH || p.As == AMOVHS { - o2 ^= (1 << 6) - } - if o.flag&LPCREL != 0 { - o3 = o2 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 - } - - case 94: /* movh/movhu R,addr -> strh */ - o1 = omvl(ctxt, p, &p.To, REGTMP) - - if o1 == 0 { - break - } - o2 = oshr(ctxt, int(p.From.Reg), 0, REGTMP, int(p.Scond)) - if o.flag&LPCREL != 0 { - o3 = o2 - o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 - } - - case 95: /* PLD off(reg) */ - o1 = 0xf5d0f000 - - o1 |= (uint32(p.From.Reg) & 15) << 16 - if p.From.Offset < 0 { - o1 &^= (1 << 23) - o1 |= uint32((-p.From.Offset) & 0xfff) - } else { - o1 |= uint32(p.From.Offset & 0xfff) - } - - // This is supposed to be something that stops execution. - // It's not supposed to be reached, ever, but if it is, we'd - // like to be able to tell how we got there. Assemble as - // 0xf7fabcfd which is guaranteed to raise undefined instruction - // exception. - case 96: /* UNDEF */ - o1 = 0xf7fabcfd - - case 97: /* CLZ Rm, Rd */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= (uint32(p.From.Reg) & 15) << 0 - - case 98: /* MULW{T,B} Rs, Rm, Rd */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.To.Reg) & 15) << 16 - o1 |= (uint32(p.From.Reg) & 15) << 8 - o1 |= (uint32(p.Reg) & 15) << 0 - - case 99: /* MULAW{T,B} Rs, Rm, Rn, Rd */ - o1 = oprrr(ctxt, p.As, int(p.Scond)) - - o1 |= (uint32(p.To.Reg) & 15) << 12 - o1 |= (uint32(p.From.Reg) & 15) << 8 - o1 |= (uint32(p.Reg) & 15) << 0 - o1 |= uint32((p.To.Offset & 15) << 16) - - // DATABUNDLE: BKPT $0x5be0, signify the start of NaCl data bundle; - // DATABUNDLEEND: zero width alignment marker - case 100: - if p.As == ADATABUNDLE { - o1 = 0xe125be70 - } - } - - out[0] = o1 - out[1] = o2 - out[2] = o3 - out[3] = o4 - out[4] = o5 - out[5] = o6 - return -} - -func mov(ctxt *obj.Link, p *obj.Prog) uint32 { - aclass(ctxt, &p.From) - o1 := oprrr(ctxt, p.As, int(p.Scond)) - o1 |= uint32(p.From.Offset) - rt := int(p.To.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = 0 - } - r := int(p.Reg) - if p.As == AMOVW || p.As == AMVN { - r = 0 - } else if r == 0 { - r = rt - } - o1 |= (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 - return o1 -} - -func oprrr(ctxt *obj.Link, a obj.As, sc int) uint32 { - o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 - if sc&C_SBIT != 0 { - o |= 1 << 20 - } - if sc&(C_PBIT|C_WBIT) != 0 { - ctxt.Diag(".nil/.W on dp instruction") - } - switch a { - case AMULU, AMUL: - return o | 0x0<<21 | 0x9<<4 - case AMULA: - return o | 0x1<<21 | 0x9<<4 - case AMULLU: - return o | 0x4<<21 | 0x9<<4 - case AMULL: - return o | 0x6<<21 | 0x9<<4 - case AMULALU: - return o | 0x5<<21 | 0x9<<4 - case AMULAL: - return o | 0x7<<21 | 0x9<<4 - case AAND: - return o | 0x0<<21 - case AEOR: - return o | 0x1<<21 - case ASUB: - return o | 0x2<<21 - case ARSB: - return o | 0x3<<21 - case AADD: - return o | 0x4<<21 - case AADC: - return o | 0x5<<21 - case ASBC: - return o | 0x6<<21 - case ARSC: - return o | 0x7<<21 - case ATST: - return o | 0x8<<21 | 1<<20 - case ATEQ: - return o | 0x9<<21 | 1<<20 - case ACMP: - return o | 0xa<<21 | 1<<20 - case ACMN: - return o | 0xb<<21 | 1<<20 - case AORR: - return o | 0xc<<21 - - case AMOVB, AMOVH, AMOVW: - return o | 0xd<<21 - case ABIC: - return o | 0xe<<21 - case AMVN: - return o | 0xf<<21 - case ASLL: - return o | 0xd<<21 | 0<<5 - case ASRL: - return o | 0xd<<21 | 1<<5 - case ASRA: - return o | 0xd<<21 | 2<<5 - case ASWI: - return o | 0xf<<24 - - case AADDD: - return o | 0xe<<24 | 0x3<<20 | 0xb<<8 | 0<<4 - case AADDF: - return o | 0xe<<24 | 0x3<<20 | 0xa<<8 | 0<<4 - case ASUBD: - return o | 0xe<<24 | 0x3<<20 | 0xb<<8 | 4<<4 - case ASUBF: - return o | 0xe<<24 | 0x3<<20 | 0xa<<8 | 4<<4 - case AMULD: - return o | 0xe<<24 | 0x2<<20 | 0xb<<8 | 0<<4 - case AMULF: - return o | 0xe<<24 | 0x2<<20 | 0xa<<8 | 0<<4 - case ADIVD: - return o | 0xe<<24 | 0x8<<20 | 0xb<<8 | 0<<4 - case ADIVF: - return o | 0xe<<24 | 0x8<<20 | 0xa<<8 | 0<<4 - case ASQRTD: - return o | 0xe<<24 | 0xb<<20 | 1<<16 | 0xb<<8 | 0xc<<4 - case ASQRTF: - return o | 0xe<<24 | 0xb<<20 | 1<<16 | 0xa<<8 | 0xc<<4 - case AABSD: - return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xb<<8 | 0xc<<4 - case AABSF: - return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xa<<8 | 0xc<<4 - case ANEGD: - return o | 0xe<<24 | 0xb<<20 | 1<<16 | 0xb<<8 | 0x4<<4 - case ANEGF: - return o | 0xe<<24 | 0xb<<20 | 1<<16 | 0xa<<8 | 0x4<<4 - case ACMPD: - return o | 0xe<<24 | 0xb<<20 | 4<<16 | 0xb<<8 | 0xc<<4 - case ACMPF: - return o | 0xe<<24 | 0xb<<20 | 4<<16 | 0xa<<8 | 0xc<<4 - - case AMOVF: - return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xa<<8 | 4<<4 - case AMOVD: - return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xb<<8 | 4<<4 - - case AMOVDF: - return o | 0xe<<24 | 0xb<<20 | 7<<16 | 0xa<<8 | 0xc<<4 | 1<<8 // dtof - case AMOVFD: - return o | 0xe<<24 | 0xb<<20 | 7<<16 | 0xa<<8 | 0xc<<4 | 0<<8 // dtof - - case AMOVWF: - if sc&C_UBIT == 0 { - o |= 1 << 7 /* signed */ - } - return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 0<<18 | 0<<8 // toint, double - - case AMOVWD: - if sc&C_UBIT == 0 { - o |= 1 << 7 /* signed */ - } - return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 0<<18 | 1<<8 // toint, double - - case AMOVFW: - if sc&C_UBIT == 0 { - o |= 1 << 16 /* signed */ - } - return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 1<<18 | 0<<8 | 1<<7 // toint, double, trunc - - case AMOVDW: - if sc&C_UBIT == 0 { - o |= 1 << 16 /* signed */ - } - return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 1<<18 | 1<<8 | 1<<7 // toint, double, trunc - - case -AMOVWF: // copy WtoF - return o | 0xe<<24 | 0x0<<20 | 0xb<<8 | 1<<4 - - case -AMOVFW: // copy FtoW - return o | 0xe<<24 | 0x1<<20 | 0xb<<8 | 1<<4 - - case -ACMP: // cmp imm - return o | 0x3<<24 | 0x5<<20 - - // CLZ doesn't support .nil - case ACLZ: - return o&(0xf<<28) | 0x16f<<16 | 0xf1<<4 - - case AMULWT: - return o&(0xf<<28) | 0x12<<20 | 0xe<<4 - - case AMULWB: - return o&(0xf<<28) | 0x12<<20 | 0xa<<4 - - case AMULAWT: - return o&(0xf<<28) | 0x12<<20 | 0xc<<4 - - case AMULAWB: - return o&(0xf<<28) | 0x12<<20 | 0x8<<4 - - case ABL: // BLX REG - return o&(0xf<<28) | 0x12fff3<<4 - } - - ctxt.Diag("bad rrr %d", a) - prasm(ctxt.Curp) - return 0 -} - -func opbra(ctxt *obj.Link, p *obj.Prog, a obj.As, sc int) uint32 { - if sc&(C_SBIT|C_PBIT|C_WBIT) != 0 { - ctxt.Diag("%v: .nil/.nil/.W on bra instruction", p) - } - sc &= C_SCOND - sc ^= C_SCOND_XOR - if a == ABL || a == obj.ADUFFZERO || a == obj.ADUFFCOPY { - return uint32(sc)<<28 | 0x5<<25 | 0x1<<24 - } - if sc != 0xe { - ctxt.Diag("%v: .COND on bcond instruction", p) - } - switch a { - case ABEQ: - return 0x0<<28 | 0x5<<25 - case ABNE: - return 0x1<<28 | 0x5<<25 - case ABCS: - return 0x2<<28 | 0x5<<25 - case ABHS: - return 0x2<<28 | 0x5<<25 - case ABCC: - return 0x3<<28 | 0x5<<25 - case ABLO: - return 0x3<<28 | 0x5<<25 - case ABMI: - return 0x4<<28 | 0x5<<25 - case ABPL: - return 0x5<<28 | 0x5<<25 - case ABVS: - return 0x6<<28 | 0x5<<25 - case ABVC: - return 0x7<<28 | 0x5<<25 - case ABHI: - return 0x8<<28 | 0x5<<25 - case ABLS: - return 0x9<<28 | 0x5<<25 - case ABGE: - return 0xa<<28 | 0x5<<25 - case ABLT: - return 0xb<<28 | 0x5<<25 - case ABGT: - return 0xc<<28 | 0x5<<25 - case ABLE: - return 0xd<<28 | 0x5<<25 - case AB: - return 0xe<<28 | 0x5<<25 - } - - ctxt.Diag("bad bra %v", a) - prasm(ctxt.Curp) - return 0 -} - -func olr(ctxt *obj.Link, v int32, b int, r int, sc int) uint32 { - if sc&C_SBIT != 0 { - ctxt.Diag(".nil on LDR/STR instruction") - } - o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 - if sc&C_PBIT == 0 { - o |= 1 << 24 - } - if sc&C_UBIT == 0 { - o |= 1 << 23 - } - if sc&C_WBIT != 0 { - o |= 1 << 21 - } - o |= 1<<26 | 1<<20 - if v < 0 { - if sc&C_UBIT != 0 { - ctxt.Diag(".U on neg offset") - } - v = -v - o ^= 1 << 23 - } - - if v >= 1<<12 || v < 0 { - ctxt.Diag("literal span too large: %d (R%d)\n%v", v, b, ctxt.Printp) - } - o |= uint32(v) - o |= (uint32(b) & 15) << 16 - o |= (uint32(r) & 15) << 12 - return o -} - -func olhr(ctxt *obj.Link, v int32, b int, r int, sc int) uint32 { - if sc&C_SBIT != 0 { - ctxt.Diag(".nil on LDRH/STRH instruction") - } - o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 - if sc&C_PBIT == 0 { - o |= 1 << 24 - } - if sc&C_WBIT != 0 { - o |= 1 << 21 - } - o |= 1<<23 | 1<<20 | 0xb<<4 - if v < 0 { - v = -v - o ^= 1 << 23 - } - - if v >= 1<<8 || v < 0 { - ctxt.Diag("literal span too large: %d (R%d)\n%v", v, b, ctxt.Printp) - } - o |= uint32(v)&0xf | (uint32(v)>>4)<<8 | 1<<22 - o |= (uint32(b) & 15) << 16 - o |= (uint32(r) & 15) << 12 - return o -} - -func osr(ctxt *obj.Link, a obj.As, r int, v int32, b int, sc int) uint32 { - o := olr(ctxt, v, b, r, sc) ^ (1 << 20) - if a != AMOVW { - o |= 1 << 22 - } - return o -} - -func oshr(ctxt *obj.Link, r int, v int32, b int, sc int) uint32 { - o := olhr(ctxt, v, b, r, sc) ^ (1 << 20) - return o -} - -func osrr(ctxt *obj.Link, r int, i int, b int, sc int) uint32 { - return olr(ctxt, int32(i), b, r, sc) ^ (1<<25 | 1<<20) -} - -func oshrr(ctxt *obj.Link, r int, i int, b int, sc int) uint32 { - return olhr(ctxt, int32(i), b, r, sc) ^ (1<<22 | 1<<20) -} - -func olrr(ctxt *obj.Link, i int, b int, r int, sc int) uint32 { - return olr(ctxt, int32(i), b, r, sc) ^ (1 << 25) -} - -func olhrr(ctxt *obj.Link, i int, b int, r int, sc int) uint32 { - return olhr(ctxt, int32(i), b, r, sc) ^ (1 << 22) -} - -func ofsr(ctxt *obj.Link, a obj.As, r int, v int32, b int, sc int, p *obj.Prog) uint32 { - if sc&C_SBIT != 0 { - ctxt.Diag(".nil on FLDR/FSTR instruction: %v", p) - } - o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 - if sc&C_PBIT == 0 { - o |= 1 << 24 - } - if sc&C_WBIT != 0 { - o |= 1 << 21 - } - o |= 6<<25 | 1<<24 | 1<<23 | 10<<8 - if v < 0 { - v = -v - o ^= 1 << 23 - } - - if v&3 != 0 { - ctxt.Diag("odd offset for floating point op: %d\n%v", v, p) - } else if v >= 1<<10 || v < 0 { - ctxt.Diag("literal span too large: %d\n%v", v, p) - } - o |= (uint32(v) >> 2) & 0xFF - o |= (uint32(b) & 15) << 16 - o |= (uint32(r) & 15) << 12 - - switch a { - default: - ctxt.Diag("bad fst %v", a) - fallthrough - - case AMOVD: - o |= 1 << 8 - fallthrough - - case AMOVF: - break - } - - return o -} - -func omvl(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, dr int) uint32 { - var o1 uint32 - if p.Pcond == nil { - aclass(ctxt, a) - v := immrot(^uint32(ctxt.Instoffset)) - if v == 0 { - ctxt.Diag("missing literal") - prasm(p) - return 0 - } - - o1 = oprrr(ctxt, AMVN, int(p.Scond)&C_SCOND) - o1 |= uint32(v) - o1 |= (uint32(dr) & 15) << 12 - } else { - v := int32(p.Pcond.Pc - p.Pc - 8) - o1 = olr(ctxt, v, REGPC, dr, int(p.Scond)&C_SCOND) - } - - return o1 -} - -func chipzero5(ctxt *obj.Link, e float64) int { - // We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions. - if obj.GOARM < 7 || e != 0 { - return -1 - } - return 0 -} - -func chipfloat5(ctxt *obj.Link, e float64) int { - // We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions. - if obj.GOARM < 7 { - return -1 - } - - ei := math.Float64bits(e) - l := uint32(ei) - h := uint32(ei >> 32) - - if l != 0 || h&0xffff != 0 { - return -1 - } - h1 := h & 0x7fc00000 - if h1 != 0x40000000 && h1 != 0x3fc00000 { - return -1 - } - n := 0 - - // sign bit (a) - if h&0x80000000 != 0 { - n |= 1 << 7 - } - - // exp sign bit (b) - if h1 == 0x3fc00000 { - n |= 1 << 6 - } - - // rest of exp and mantissa (cd-efgh) - n |= int((h >> 16) & 0x3f) - - //print("match %.8lux %.8lux %d\n", l, h, n); - return n -} - -func nocache(p *obj.Prog) { - p.Optab = 0 - p.From.Class = 0 - if p.From3 != nil { - p.From3.Class = 0 - } - p.To.Class = 0 -} diff --git a/vendor/github.com/google/gops/internal/obj/arm/list5.go b/vendor/github.com/google/gops/internal/obj/arm/list5.go deleted file mode 100644 index f6c50168..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm/list5.go +++ /dev/null @@ -1,84 +0,0 @@ -// Inferno utils/5c/list.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/5c/list.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm - -import ( - "fmt" - - "github.com/google/gops/internal/obj" -) - -func init() { - obj.RegisterRegister(obj.RBaseARM, MAXREG, Rconv) - obj.RegisterOpcode(obj.ABaseARM, Anames) -} - -func Rconv(r int) string { - if r == 0 { - return "NONE" - } - if r == REGG { - // Special case. - return "g" - } - if REG_R0 <= r && r <= REG_R15 { - return fmt.Sprintf("R%d", r-REG_R0) - } - if REG_F0 <= r && r <= REG_F15 { - return fmt.Sprintf("F%d", r-REG_F0) - } - - switch r { - case REG_FPSR: - return "FPSR" - - case REG_FPCR: - return "FPCR" - - case REG_CPSR: - return "CPSR" - - case REG_SPSR: - return "SPSR" - } - - return fmt.Sprintf("Rgok(%d)", r-obj.RBaseARM) -} - -func DRconv(a int) string { - s := "C_??" - if a >= C_NONE && a <= C_NCLASS { - s = cnames5[a] - } - var fp string - fp += s - return fp -} diff --git a/vendor/github.com/google/gops/internal/obj/arm/obj5.go b/vendor/github.com/google/gops/internal/obj/arm/obj5.go deleted file mode 100644 index 2c4e39b7..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm/obj5.go +++ /dev/null @@ -1,1055 +0,0 @@ -// Derived from Inferno utils/5c/swt.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/5c/swt.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm - -import ( - "fmt" - "log" - "math" - - "github.com/google/gops/internal/obj" - "github.com/google/gops/internal/sys" -) - -var progedit_tlsfallback *obj.LSym - -func progedit(ctxt *obj.Link, p *obj.Prog) { - p.From.Class = 0 - p.To.Class = 0 - - // Rewrite B/BL to symbol as TYPE_BRANCH. - switch p.As { - case AB, - ABL, - obj.ADUFFZERO, - obj.ADUFFCOPY: - if p.To.Type == obj.TYPE_MEM && (p.To.Name == obj.NAME_EXTERN || p.To.Name == obj.NAME_STATIC) && p.To.Sym != nil { - p.To.Type = obj.TYPE_BRANCH - } - } - - // Replace TLS register fetches on older ARM processors. - switch p.As { - // Treat MRC 15, 0, , C13, C0, 3 specially. - case AMRC: - if p.To.Offset&0xffff0fff == 0xee1d0f70 { - // Because the instruction might be rewritten to a BL which returns in R0 - // the register must be zero. - if p.To.Offset&0xf000 != 0 { - ctxt.Diag("%v: TLS MRC instruction must write to R0 as it might get translated into a BL instruction", p.Line()) - } - - if obj.GOARM < 7 { - // Replace it with BL runtime.read_tls_fallback(SB) for ARM CPUs that lack the tls extension. - if progedit_tlsfallback == nil { - progedit_tlsfallback = obj.Linklookup(ctxt, "runtime.read_tls_fallback", 0) - } - - // MOVW LR, R11 - p.As = AMOVW - - p.From.Type = obj.TYPE_REG - p.From.Reg = REGLINK - p.To.Type = obj.TYPE_REG - p.To.Reg = REGTMP - - // BL runtime.read_tls_fallback(SB) - p = obj.Appendp(ctxt, p) - - p.As = ABL - p.To.Type = obj.TYPE_BRANCH - p.To.Sym = progedit_tlsfallback - p.To.Offset = 0 - - // MOVW R11, LR - p = obj.Appendp(ctxt, p) - - p.As = AMOVW - p.From.Type = obj.TYPE_REG - p.From.Reg = REGTMP - p.To.Type = obj.TYPE_REG - p.To.Reg = REGLINK - break - } - } - - // Otherwise, MRC/MCR instructions need no further treatment. - p.As = AWORD - } - - // Rewrite float constants to values stored in memory. - switch p.As { - case AMOVF: - if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.Val.(float64)) < 0 && (chipzero5(ctxt, p.From.Val.(float64)) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { - f32 := float32(p.From.Val.(float64)) - i32 := math.Float32bits(f32) - literal := fmt.Sprintf("$f32.%08x", i32) - s := obj.Linklookup(ctxt, literal, 0) - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - case AMOVD: - if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.Val.(float64)) < 0 && (chipzero5(ctxt, p.From.Val.(float64)) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { - i64 := math.Float64bits(p.From.Val.(float64)) - literal := fmt.Sprintf("$f64.%016x", i64) - s := obj.Linklookup(ctxt, literal, 0) - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - } - - if ctxt.Flag_dynlink { - rewriteToUseGot(ctxt, p) - } -} - -// Rewrite p, if necessary, to access global data via the global offset table. -func rewriteToUseGot(ctxt *obj.Link, p *obj.Prog) { - if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO { - // ADUFFxxx $offset - // becomes - // MOVW runtime.duffxxx@GOT, R9 - // ADD $offset, R9 - // CALL (R9) - var sym *obj.LSym - if p.As == obj.ADUFFZERO { - sym = obj.Linklookup(ctxt, "runtime.duffzero", 0) - } else { - sym = obj.Linklookup(ctxt, "runtime.duffcopy", 0) - } - offset := p.To.Offset - p.As = AMOVW - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - p.From.Sym = sym - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R9 - p.To.Name = obj.NAME_NONE - p.To.Offset = 0 - p.To.Sym = nil - p1 := obj.Appendp(ctxt, p) - p1.As = AADD - p1.From.Type = obj.TYPE_CONST - p1.From.Offset = offset - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REG_R9 - p2 := obj.Appendp(ctxt, p1) - p2.As = obj.ACALL - p2.To.Type = obj.TYPE_MEM - p2.To.Reg = REG_R9 - return - } - - // We only care about global data: NAME_EXTERN means a global - // symbol in the Go sense, and p.Sym.Local is true for a few - // internally defined symbols. - if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - // MOVW $sym, Rx becomes MOVW sym@GOT, Rx - // MOVW $sym+, Rx becomes MOVW sym@GOT, Rx; ADD , Rx - if p.As != AMOVW { - ctxt.Diag("do not know how to handle TYPE_ADDR in %v with -dynlink", p) - } - if p.To.Type != obj.TYPE_REG { - ctxt.Diag("do not know how to handle LEAQ-type insn to non-register in %v with -dynlink", p) - } - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - if p.From.Offset != 0 { - q := obj.Appendp(ctxt, p) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = p.From.Offset - q.To = p.To - p.From.Offset = 0 - } - } - if p.From3 != nil && p.From3.Name == obj.NAME_EXTERN { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - var source *obj.Addr - // MOVx sym, Ry becomes MOVW sym@GOT, R9; MOVx (R9), Ry - // MOVx Ry, sym becomes MOVW sym@GOT, R9; MOVx Ry, (R9) - // An addition may be inserted between the two MOVs if there is an offset. - if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p) - } - source = &p.From - } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - source = &p.To - } else { - return - } - if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { - return - } - if source.Sym.Type == obj.STLSBSS { - return - } - if source.Type != obj.TYPE_MEM { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - p1 := obj.Appendp(ctxt, p) - p2 := obj.Appendp(ctxt, p1) - - p1.As = AMOVW - p1.From.Type = obj.TYPE_MEM - p1.From.Sym = source.Sym - p1.From.Name = obj.NAME_GOTREF - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REG_R9 - - p2.As = p.As - p2.From = p.From - p2.To = p.To - if p.From.Name == obj.NAME_EXTERN { - p2.From.Reg = REG_R9 - p2.From.Name = obj.NAME_NONE - p2.From.Sym = nil - } else if p.To.Name == obj.NAME_EXTERN { - p2.To.Reg = REG_R9 - p2.To.Name = obj.NAME_NONE - p2.To.Sym = nil - } else { - return - } - obj.Nopout(p) -} - -// Prog.mark -const ( - FOLL = 1 << 0 - LABEL = 1 << 1 - LEAF = 1 << 2 -) - -func preprocess(ctxt *obj.Link, cursym *obj.LSym) { - autosize := int32(0) - - ctxt.Cursym = cursym - - if cursym.Text == nil || cursym.Text.Link == nil { - return - } - - softfloat(ctxt, cursym) - - p := cursym.Text - autoffset := int32(p.To.Offset) - if autoffset < 0 { - autoffset = 0 - } - cursym.Locals = autoffset - cursym.Args = p.To.Val.(int32) - - /* - * find leaf subroutines - * strip NOPs - * expand RET - * expand BECOME pseudo - */ - var q1 *obj.Prog - var q *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - switch p.As { - case obj.ATEXT: - p.Mark |= LEAF - - case obj.ARET: - break - - case ADIV, ADIVU, AMOD, AMODU: - q = p - if ctxt.Sym_div == nil { - initdiv(ctxt) - } - cursym.Text.Mark &^= LEAF - continue - - case obj.ANOP: - q1 = p.Link - q.Link = q1 /* q is non-nop */ - if q1 != nil { - q1.Mark |= p.Mark - } - continue - - case ABL, - ABX, - obj.ADUFFZERO, - obj.ADUFFCOPY: - cursym.Text.Mark &^= LEAF - fallthrough - - case AB, - ABEQ, - ABNE, - ABCS, - ABHS, - ABCC, - ABLO, - ABMI, - ABPL, - ABVS, - ABVC, - ABHI, - ABLS, - ABGE, - ABLT, - ABGT, - ABLE: - q1 = p.Pcond - if q1 != nil { - for q1.As == obj.ANOP { - q1 = q1.Link - p.Pcond = q1 - } - } - } - - q = p - } - - var p1 *obj.Prog - var p2 *obj.Prog - var q2 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - o := p.As - switch o { - case obj.ATEXT: - autosize = int32(p.To.Offset + 4) - if autosize <= 4 { - if cursym.Text.Mark&LEAF != 0 { - p.To.Offset = -4 - autosize = 0 - } - } - - if autosize == 0 && cursym.Text.Mark&LEAF == 0 { - if ctxt.Debugvlog != 0 { - ctxt.Logf("save suppressed in: %s\n", cursym.Name) - } - - cursym.Text.Mark |= LEAF - } - - if cursym.Text.Mark&LEAF != 0 { - cursym.Set(obj.AttrLeaf, true) - if autosize == 0 { - break - } - } - - if p.From3.Offset&obj.NOSPLIT == 0 { - p = stacksplit(ctxt, p, autosize) // emit split check - } - - // MOVW.W R14,$-autosize(SP) - p = obj.Appendp(ctxt, p) - - p.As = AMOVW - p.Scond |= C_WBIT - p.From.Type = obj.TYPE_REG - p.From.Reg = REGLINK - p.To.Type = obj.TYPE_MEM - p.To.Offset = int64(-autosize) - p.To.Reg = REGSP - p.Spadj = autosize - - if cursym.Text.From3.Offset&obj.WRAPPER != 0 { - // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame - // - // MOVW g_panic(g), R1 - // CMP $0, R1 - // B.EQ end - // MOVW panic_argp(R1), R2 - // ADD $(autosize+4), R13, R3 - // CMP R2, R3 - // B.NE end - // ADD $4, R13, R4 - // MOVW R4, panic_argp(R1) - // end: - // NOP - // - // The NOP is needed to give the jumps somewhere to land. - // It is a liblink NOP, not an ARM NOP: it encodes to 0 instruction bytes. - - p = obj.Appendp(ctxt, p) - - p.As = AMOVW - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_CONST - p.From.Offset = 0 - p.Reg = REG_R1 - - p = obj.Appendp(ctxt, p) - p.As = ABEQ - p.To.Type = obj.TYPE_BRANCH - p1 = p - - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_R1 - p.From.Offset = 0 // Panic.argp - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(autosize) + 4 - p.Reg = REG_R13 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R3 - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R2 - p.Reg = REG_R3 - - p = obj.Appendp(ctxt, p) - p.As = ABNE - p.To.Type = obj.TYPE_BRANCH - p2 = p - - p = obj.Appendp(ctxt, p) - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = 4 - p.Reg = REG_R13 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R4 - p.To.Type = obj.TYPE_MEM - p.To.Reg = REG_R1 - p.To.Offset = 0 // Panic.argp - - p = obj.Appendp(ctxt, p) - - p.As = obj.ANOP - p1.Pcond = p - p2.Pcond = p - } - - case obj.ARET: - nocache(p) - if cursym.Text.Mark&LEAF != 0 { - if autosize == 0 { - p.As = AB - p.From = obj.Addr{} - if p.To.Sym != nil { // retjmp - p.To.Type = obj.TYPE_BRANCH - } else { - p.To.Type = obj.TYPE_MEM - p.To.Offset = 0 - p.To.Reg = REGLINK - } - - break - } - } - - p.As = AMOVW - p.Scond |= C_PBIT - p.From.Type = obj.TYPE_MEM - p.From.Offset = int64(autosize) - p.From.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REGPC - - // If there are instructions following - // this ARET, they come from a branch - // with the same stackframe, so no spadj. - if p.To.Sym != nil { // retjmp - p.To.Reg = REGLINK - q2 = obj.Appendp(ctxt, p) - q2.As = AB - q2.To.Type = obj.TYPE_BRANCH - q2.To.Sym = p.To.Sym - p.To.Sym = nil - p = q2 - } - - case AADD: - if p.From.Type == obj.TYPE_CONST && p.From.Reg == 0 && p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP { - p.Spadj = int32(-p.From.Offset) - } - - case ASUB: - if p.From.Type == obj.TYPE_CONST && p.From.Reg == 0 && p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP { - p.Spadj = int32(p.From.Offset) - } - - case ADIV, ADIVU, AMOD, AMODU: - if cursym.Text.From3.Offset&obj.NOSPLIT != 0 { - ctxt.Diag("cannot divide in NOSPLIT function") - } - if ctxt.Debugdivmod != 0 { - break - } - if p.From.Type != obj.TYPE_REG { - break - } - if p.To.Type != obj.TYPE_REG { - break - } - - // Make copy because we overwrite p below. - q1 := *p - if q1.Reg == REGTMP || q1.Reg == 0 && q1.To.Reg == REGTMP { - ctxt.Diag("div already using REGTMP: %v", p) - } - - /* MOV m(g),REGTMP */ - p.As = AMOVW - p.Lineno = q1.Lineno - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 6 * 4 // offset of g.m - p.Reg = 0 - p.To.Type = obj.TYPE_REG - p.To.Reg = REGTMP - - /* MOV a,m_divmod(REGTMP) */ - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.Lineno = q1.Lineno - p.From.Type = obj.TYPE_REG - p.From.Reg = q1.From.Reg - p.To.Type = obj.TYPE_MEM - p.To.Reg = REGTMP - p.To.Offset = 8 * 4 // offset of m.divmod - - /* MOV b, R8 */ - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.Lineno = q1.Lineno - p.From.Type = obj.TYPE_REG - p.From.Reg = q1.Reg - if q1.Reg == 0 { - p.From.Reg = q1.To.Reg - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R8 - p.To.Offset = 0 - - /* CALL appropriate */ - p = obj.Appendp(ctxt, p) - p.As = ABL - p.Lineno = q1.Lineno - p.To.Type = obj.TYPE_BRANCH - switch o { - case ADIV: - p.To.Sym = ctxt.Sym_div - - case ADIVU: - p.To.Sym = ctxt.Sym_divu - - case AMOD: - p.To.Sym = ctxt.Sym_mod - - case AMODU: - p.To.Sym = ctxt.Sym_modu - } - - /* MOV REGTMP, b */ - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.Lineno = q1.Lineno - p.From.Type = obj.TYPE_REG - p.From.Reg = REGTMP - p.From.Offset = 0 - p.To.Type = obj.TYPE_REG - p.To.Reg = q1.To.Reg - - case AMOVW: - if (p.Scond&C_WBIT != 0) && p.To.Type == obj.TYPE_MEM && p.To.Reg == REGSP { - p.Spadj = int32(-p.To.Offset) - } - if (p.Scond&C_PBIT != 0) && p.From.Type == obj.TYPE_MEM && p.From.Reg == REGSP && p.To.Reg != REGPC { - p.Spadj = int32(-p.From.Offset) - } - if p.From.Type == obj.TYPE_ADDR && p.From.Reg == REGSP && p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP { - p.Spadj = int32(-p.From.Offset) - } - } - } -} - -func isfloatreg(a *obj.Addr) bool { - return a.Type == obj.TYPE_REG && REG_F0 <= a.Reg && a.Reg <= REG_F15 -} - -func softfloat(ctxt *obj.Link, cursym *obj.LSym) { - if obj.GOARM > 5 { - return - } - - symsfloat := obj.Linklookup(ctxt, "_sfloat", 0) - - wasfloat := 0 - for p := cursym.Text; p != nil; p = p.Link { - if p.Pcond != nil { - p.Pcond.Mark |= LABEL - } - } - var next *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - switch p.As { - case AMOVW: - if isfloatreg(&p.To) || isfloatreg(&p.From) { - goto soft - } - goto notsoft - - case AMOVWD, - AMOVWF, - AMOVDW, - AMOVFW, - AMOVFD, - AMOVDF, - AMOVF, - AMOVD, - ACMPF, - ACMPD, - AADDF, - AADDD, - ASUBF, - ASUBD, - AMULF, - AMULD, - ADIVF, - ADIVD, - ASQRTF, - ASQRTD, - AABSF, - AABSD, - ANEGF, - ANEGD: - goto soft - - default: - goto notsoft - } - - soft: - if wasfloat == 0 || (p.Mark&LABEL != 0) { - next = ctxt.NewProg() - *next = *p - - // BL _sfloat(SB) - *p = obj.Prog{} - p.Ctxt = ctxt - p.Link = next - p.As = ABL - p.To.Type = obj.TYPE_BRANCH - p.To.Sym = symsfloat - p.Lineno = next.Lineno - - p = next - wasfloat = 1 - } - - continue - - notsoft: - wasfloat = 0 - } -} - -func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { - // MOVW g_stackguard(g), R1 - p = obj.Appendp(ctxt, p) - - p.As = AMOVW - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - - if framesize <= obj.StackSmall { - // small stack: SP < stackguard - // CMP stackguard, SP - p = obj.Appendp(ctxt, p) - - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.Reg = REGSP - } else if framesize <= obj.StackBig { - // large stack: SP-framesize < stackguard-StackSmall - // MOVW $-framesize(SP), R2 - // CMP stackguard, R2 - p = obj.Appendp(ctxt, p) - - p.As = AMOVW - p.From.Type = obj.TYPE_ADDR - p.From.Reg = REGSP - p.From.Offset = int64(-framesize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.Reg = REG_R2 - } else { - // Such a large stack we need to protect against wraparound - // if SP is close to zero. - // SP-stackguard+StackGuard < framesize + (StackGuard-StackSmall) - // The +StackGuard on both sides is required to keep the left side positive: - // SP is allowed to be slightly below stackguard. See stack.h. - // CMP $StackPreempt, R1 - // MOVW.NE $StackGuard(SP), R2 - // SUB.NE R1, R2 - // MOVW.NE $(framesize+(StackGuard-StackSmall)), R3 - // CMP.NE R3, R2 - p = obj.Appendp(ctxt, p) - - p.As = ACMP - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(uint32(obj.StackPreempt & (1<<32 - 1))) - p.Reg = REG_R1 - - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.From.Type = obj.TYPE_ADDR - p.From.Reg = REGSP - p.From.Offset = obj.StackGuard - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - p.Scond = C_SCOND_NE - - p = obj.Appendp(ctxt, p) - p.As = ASUB - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - p.Scond = C_SCOND_NE - - p = obj.Appendp(ctxt, p) - p.As = AMOVW - p.From.Type = obj.TYPE_ADDR - p.From.Offset = int64(framesize) + (obj.StackGuard - obj.StackSmall) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R3 - p.Scond = C_SCOND_NE - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.Reg = REG_R2 - p.Scond = C_SCOND_NE - } - - // BLS call-to-morestack - bls := obj.Appendp(ctxt, p) - bls.As = ABLS - bls.To.Type = obj.TYPE_BRANCH - - var last *obj.Prog - for last = ctxt.Cursym.Text; last.Link != nil; last = last.Link { - } - - // Now we are at the end of the function, but logically - // we are still in function prologue. We need to fix the - // SP data and PCDATA. - spfix := obj.Appendp(ctxt, last) - spfix.As = obj.ANOP - spfix.Spadj = -framesize - - pcdata := obj.Appendp(ctxt, spfix) - pcdata.Lineno = ctxt.Cursym.Text.Lineno - pcdata.Mode = ctxt.Cursym.Text.Mode - pcdata.As = obj.APCDATA - pcdata.From.Type = obj.TYPE_CONST - pcdata.From.Offset = obj.PCDATA_StackMapIndex - pcdata.To.Type = obj.TYPE_CONST - pcdata.To.Offset = -1 // pcdata starts at -1 at function entry - - // MOVW LR, R3 - movw := obj.Appendp(ctxt, pcdata) - movw.As = AMOVW - movw.From.Type = obj.TYPE_REG - movw.From.Reg = REGLINK - movw.To.Type = obj.TYPE_REG - movw.To.Reg = REG_R3 - - bls.Pcond = movw - - // BL runtime.morestack - call := obj.Appendp(ctxt, movw) - call.As = obj.ACALL - call.To.Type = obj.TYPE_BRANCH - morestack := "runtime.morestack" - switch { - case ctxt.Cursym.CFunc(): - morestack = "runtime.morestackc" - case ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0: - morestack = "runtime.morestack_noctxt" - } - call.To.Sym = obj.Linklookup(ctxt, morestack, 0) - - // B start - b := obj.Appendp(ctxt, call) - b.As = obj.AJMP - b.To.Type = obj.TYPE_BRANCH - b.Pcond = ctxt.Cursym.Text.Link - b.Spadj = +framesize - - return bls -} - -func initdiv(ctxt *obj.Link) { - if ctxt.Sym_div != nil { - return - } - ctxt.Sym_div = obj.Linklookup(ctxt, "_div", 0) - ctxt.Sym_divu = obj.Linklookup(ctxt, "_divu", 0) - ctxt.Sym_mod = obj.Linklookup(ctxt, "_mod", 0) - ctxt.Sym_modu = obj.Linklookup(ctxt, "_modu", 0) -} - -func follow(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - firstp := ctxt.NewProg() - lastp := firstp - xfol(ctxt, s.Text, &lastp) - lastp.Link = nil - s.Text = firstp.Link -} - -func relinv(a obj.As) obj.As { - switch a { - case ABEQ: - return ABNE - case ABNE: - return ABEQ - case ABCS: - return ABCC - case ABHS: - return ABLO - case ABCC: - return ABCS - case ABLO: - return ABHS - case ABMI: - return ABPL - case ABPL: - return ABMI - case ABVS: - return ABVC - case ABVC: - return ABVS - case ABHI: - return ABLS - case ABLS: - return ABHI - case ABGE: - return ABLT - case ABLT: - return ABGE - case ABGT: - return ABLE - case ABLE: - return ABGT - } - - log.Fatalf("unknown relation: %s", Anames[a]) - return 0 -} - -func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { - var q *obj.Prog - var r *obj.Prog - var i int - -loop: - if p == nil { - return - } - a := p.As - if a == AB { - q = p.Pcond - if q != nil && q.As != obj.ATEXT { - p.Mark |= FOLL - p = q - if p.Mark&FOLL == 0 { - goto loop - } - } - } - - if p.Mark&FOLL != 0 { - i = 0 - q = p - for ; i < 4; i, q = i+1, q.Link { - if q == *last || q == nil { - break - } - a = q.As - if a == obj.ANOP { - i-- - continue - } - - if a == AB || (a == obj.ARET && q.Scond == C_SCOND_NONE) || a == ARFE || a == obj.AUNDEF { - goto copy - } - if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { - continue - } - if a != ABEQ && a != ABNE { - continue - } - - copy: - for { - r = ctxt.NewProg() - *r = *p - if r.Mark&FOLL == 0 { - fmt.Printf("can't happen 1\n") - } - r.Mark |= FOLL - if p != q { - p = p.Link - (*last).Link = r - *last = r - continue - } - - (*last).Link = r - *last = r - if a == AB || (a == obj.ARET && q.Scond == C_SCOND_NONE) || a == ARFE || a == obj.AUNDEF { - return - } - r.As = ABNE - if a == ABNE { - r.As = ABEQ - } - r.Pcond = p.Link - r.Link = p.Pcond - if r.Link.Mark&FOLL == 0 { - xfol(ctxt, r.Link, last) - } - if r.Pcond.Mark&FOLL == 0 { - fmt.Printf("can't happen 2\n") - } - return - } - } - - a = AB - q = ctxt.NewProg() - q.As = a - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.To.Offset = p.Pc - q.Pcond = p - p = q - } - - p.Mark |= FOLL - (*last).Link = p - *last = p - if a == AB || (a == obj.ARET && p.Scond == C_SCOND_NONE) || a == ARFE || a == obj.AUNDEF { - return - } - - if p.Pcond != nil { - if a != ABL && a != ABX && p.Link != nil { - q = obj.Brchain(ctxt, p.Link) - if a != obj.ATEXT { - if q != nil && (q.Mark&FOLL != 0) { - p.As = relinv(a) - p.Link = p.Pcond - p.Pcond = q - } - } - - xfol(ctxt, p.Link, last) - q = obj.Brchain(ctxt, p.Pcond) - if q == nil { - q = p.Pcond - } - if q.Mark&FOLL != 0 { - p.Pcond = q - return - } - - p = q - goto loop - } - } - - p = p.Link - goto loop -} - -var unaryDst = map[obj.As]bool{ - ASWI: true, - AWORD: true, -} - -var Linkarm = obj.LinkArch{ - Arch: sys.ArchARM, - Preprocess: preprocess, - Assemble: span5, - Follow: follow, - Progedit: progedit, - UnaryDst: unaryDst, -} diff --git a/vendor/github.com/google/gops/internal/obj/arm64/a.out.go b/vendor/github.com/google/gops/internal/obj/arm64/a.out.go deleted file mode 100644 index b3a27d43..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm64/a.out.go +++ /dev/null @@ -1,719 +0,0 @@ -// cmd/7c/7.out.h from Vita Nuova. -// https://code.google.com/p/ken-cc/source/browse/src/cmd/7c/7.out.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm64 - -import "github.com/google/gops/internal/obj" - -const ( - NSNAME = 8 - NSYM = 50 - NREG = 32 /* number of general registers */ - NFREG = 32 /* number of floating point registers */ -) - -// General purpose registers, kept in the low bits of Prog.Reg. -const ( - // integer - REG_R0 = obj.RBaseARM64 + iota - REG_R1 - REG_R2 - REG_R3 - REG_R4 - REG_R5 - REG_R6 - REG_R7 - REG_R8 - REG_R9 - REG_R10 - REG_R11 - REG_R12 - REG_R13 - REG_R14 - REG_R15 - REG_R16 - REG_R17 - REG_R18 - REG_R19 - REG_R20 - REG_R21 - REG_R22 - REG_R23 - REG_R24 - REG_R25 - REG_R26 - REG_R27 - REG_R28 - REG_R29 - REG_R30 - REG_R31 - - // scalar floating point - REG_F0 - REG_F1 - REG_F2 - REG_F3 - REG_F4 - REG_F5 - REG_F6 - REG_F7 - REG_F8 - REG_F9 - REG_F10 - REG_F11 - REG_F12 - REG_F13 - REG_F14 - REG_F15 - REG_F16 - REG_F17 - REG_F18 - REG_F19 - REG_F20 - REG_F21 - REG_F22 - REG_F23 - REG_F24 - REG_F25 - REG_F26 - REG_F27 - REG_F28 - REG_F29 - REG_F30 - REG_F31 - - // SIMD - REG_V0 - REG_V1 - REG_V2 - REG_V3 - REG_V4 - REG_V5 - REG_V6 - REG_V7 - REG_V8 - REG_V9 - REG_V10 - REG_V11 - REG_V12 - REG_V13 - REG_V14 - REG_V15 - REG_V16 - REG_V17 - REG_V18 - REG_V19 - REG_V20 - REG_V21 - REG_V22 - REG_V23 - REG_V24 - REG_V25 - REG_V26 - REG_V27 - REG_V28 - REG_V29 - REG_V30 - REG_V31 - - // The EQ in - // CSET EQ, R0 - // is encoded as TYPE_REG, even though it's not really a register. - COND_EQ - COND_NE - COND_HS - COND_LO - COND_MI - COND_PL - COND_VS - COND_VC - COND_HI - COND_LS - COND_GE - COND_LT - COND_GT - COND_LE - COND_AL - COND_NV - - REG_RSP = REG_V31 + 32 // to differentiate ZR/SP, REG_RSP&0x1f = 31 -) - -// Not registers, but flags that can be combined with regular register -// constants to indicate extended register conversion. When checking, -// you should subtract obj.RBaseARM64 first. From this difference, bit 11 -// indicates extended register, bits 8-10 select the conversion mode. -const REG_EXT = obj.RBaseARM64 + 1<<11 - -const ( - REG_UXTB = REG_EXT + iota<<8 - REG_UXTH - REG_UXTW - REG_UXTX - REG_SXTB - REG_SXTH - REG_SXTW - REG_SXTX -) - -// Special registers, after subtracting obj.RBaseARM64, bit 12 indicates -// a special register and the low bits select the register. -const ( - REG_SPECIAL = obj.RBaseARM64 + 1<<12 + iota - REG_DAIF - REG_NZCV - REG_FPSR - REG_FPCR - REG_SPSR_EL1 - REG_ELR_EL1 - REG_SPSR_EL2 - REG_ELR_EL2 - REG_CurrentEL - REG_SP_EL0 - REG_SPSel - REG_DAIFSet - REG_DAIFClr -) - -// Register assignments: -// -// compiler allocates R0 up as temps -// compiler allocates register variables R7-R25 -// compiler allocates external registers R26 down -// -// compiler allocates register variables F7-F26 -// compiler allocates external registers F26 down -const ( - REGMIN = REG_R7 // register variables allocated from here to REGMAX - REGRT1 = REG_R16 // ARM64 IP0, for external linker, runtime, duffzero and duffcopy - REGRT2 = REG_R17 // ARM64 IP1, for external linker, runtime, duffcopy - REGPR = REG_R18 // ARM64 platform register, unused in the Go toolchain - REGMAX = REG_R25 - - REGCTXT = REG_R26 // environment for closures - REGTMP = REG_R27 // reserved for liblink - REGG = REG_R28 // G - REGFP = REG_R29 // frame pointer, unused in the Go toolchain - REGLINK = REG_R30 - - // ARM64 uses R31 as both stack pointer and zero register, - // depending on the instruction. To differentiate RSP from ZR, - // we use a different numeric value for REGZERO and REGSP. - REGZERO = REG_R31 - REGSP = REG_RSP - - FREGRET = REG_F0 - FREGMIN = REG_F7 // first register variable - FREGMAX = REG_F26 // last register variable for 7g only - FREGEXT = REG_F26 // first external register -) - -const ( - BIG = 2048 - 8 -) - -const ( - /* mark flags */ - LABEL = 1 << iota - LEAF - FLOAT - BRANCH - LOAD - FCMP - SYNC - LIST - FOLL - NOSCHED -) - -const ( - C_NONE = iota - C_REG // R0..R30 - C_RSP // R0..R30, RSP - C_FREG // F0..F31 - C_VREG // V0..V31 - C_PAIR // (Rn, Rm) - C_SHIFT // Rn<<2 - C_EXTREG // Rn.UXTB<<3 - C_SPR // REG_NZCV - C_COND // EQ, NE, etc - - C_ZCON // $0 or ZR - C_ADDCON0 // 12-bit unsigned, unshifted - C_ADDCON // 12-bit unsigned, shifted left by 0 or 12 - C_MOVCON // generated by a 16-bit constant, optionally inverted and/or shifted by multiple of 16 - C_BITCON // bitfield and logical immediate masks - C_ABCON0 // could be C_ADDCON0 or C_BITCON - C_ABCON // could be C_ADDCON or C_BITCON - C_MBCON // could be C_MOVCON or C_BITCON - C_LCON // 32-bit constant - C_VCON // 64-bit constant - C_FCON // floating-point constant - C_VCONADDR // 64-bit memory address - - C_AACON // ADDCON offset in auto constant $a(FP) - C_LACON // 32-bit offset in auto constant $a(FP) - C_AECON // ADDCON offset in extern constant $e(SB) - - // TODO(aram): only one branch class should be enough - C_SBRA // for TYPE_BRANCH - C_LBRA - - C_NPAUTO // -512 <= x < 0, 0 mod 8 - C_NSAUTO // -256 <= x < 0 - C_PSAUTO // 0 to 255 - C_PPAUTO // 0 to 504, 0 mod 8 - C_UAUTO4K // 0 to 4095 - C_UAUTO8K // 0 to 8190, 0 mod 2 - C_UAUTO16K // 0 to 16380, 0 mod 4 - C_UAUTO32K // 0 to 32760, 0 mod 8 - C_UAUTO64K // 0 to 65520, 0 mod 16 - C_LAUTO // any other 32-bit constant - - C_SEXT1 // 0 to 4095, direct - C_SEXT2 // 0 to 8190 - C_SEXT4 // 0 to 16380 - C_SEXT8 // 0 to 32760 - C_SEXT16 // 0 to 65520 - C_LEXT - - // TODO(aram): s/AUTO/INDIR/ - C_ZOREG // 0(R) - C_NPOREG // mirror NPAUTO, etc - C_NSOREG - C_PSOREG - C_PPOREG - C_UOREG4K - C_UOREG8K - C_UOREG16K - C_UOREG32K - C_UOREG64K - C_LOREG - - C_ADDR // TODO(aram): explain difference from C_VCONADDR - - // The GOT slot for a symbol in -dynlink mode. - C_GOTADDR - - // TLS "var" in local exec mode: will become a constant offset from - // thread local base that is ultimately chosen by the program linker. - C_TLS_LE - - // TLS "var" in initial exec mode: will become a memory address (chosen - // by the program linker) that the dynamic linker will fill with the - // offset from the thread local base. - C_TLS_IE - - C_ROFF // register offset (including register extended) - - C_GOK - C_TEXTSIZE - C_NCLASS // must be last -) - -const ( - C_XPRE = 1 << 6 // match arm.C_WBIT, so Prog.String know how to print it - C_XPOST = 1 << 5 // match arm.C_PBIT, so Prog.String know how to print it -) - -//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p arm64 - -const ( - AADC = obj.ABaseARM64 + obj.A_ARCHSPECIFIC + iota - AADCS - AADCSW - AADCW - AADD - AADDS - AADDSW - AADDW - AADR - AADRP - AAND - AANDS - AANDSW - AANDW - AASR - AASRW - AAT - ABFI - ABFIW - ABFM - ABFMW - ABFXIL - ABFXILW - ABIC - ABICS - ABICSW - ABICW - ABRK - ACBNZ - ACBNZW - ACBZ - ACBZW - ACCMN - ACCMNW - ACCMP - ACCMPW - ACINC - ACINCW - ACINV - ACINVW - ACLREX - ACLS - ACLSW - ACLZ - ACLZW - ACMN - ACMNW - ACMP - ACMPW - ACNEG - ACNEGW - ACRC32B - ACRC32CB - ACRC32CH - ACRC32CW - ACRC32CX - ACRC32H - ACRC32W - ACRC32X - ACSEL - ACSELW - ACSET - ACSETM - ACSETMW - ACSETW - ACSINC - ACSINCW - ACSINV - ACSINVW - ACSNEG - ACSNEGW - ADC - ADCPS1 - ADCPS2 - ADCPS3 - ADMB - ADRPS - ADSB - AEON - AEONW - AEOR - AEORW - AERET - AEXTR - AEXTRW - AHINT - AHLT - AHVC - AIC - AISB - ALDAR - ALDARB - ALDARH - ALDARW - ALDAXP - ALDAXPW - ALDAXR - ALDAXRB - ALDAXRH - ALDAXRW - ALDP - ALDXR - ALDXRB - ALDXRH - ALDXRW - ALDXP - ALDXPW - ALSL - ALSLW - ALSR - ALSRW - AMADD - AMADDW - AMNEG - AMNEGW - AMOVK - AMOVKW - AMOVN - AMOVNW - AMOVZ - AMOVZW - AMRS - AMSR - AMSUB - AMSUBW - AMUL - AMULW - AMVN - AMVNW - ANEG - ANEGS - ANEGSW - ANEGW - ANGC - ANGCS - ANGCSW - ANGCW - AORN - AORNW - AORR - AORRW - APRFM - APRFUM - ARBIT - ARBITW - AREM - AREMW - AREV - AREV16 - AREV16W - AREV32 - AREVW - AROR - ARORW - ASBC - ASBCS - ASBCSW - ASBCW - ASBFIZ - ASBFIZW - ASBFM - ASBFMW - ASBFX - ASBFXW - ASDIV - ASDIVW - ASEV - ASEVL - ASMADDL - ASMC - ASMNEGL - ASMSUBL - ASMULH - ASMULL - ASTXR - ASTXRB - ASTXRH - ASTXP - ASTXPW - ASTXRW - ASTLP - ASTLPW - ASTLR - ASTLRB - ASTLRH - ASTLRW - ASTLXP - ASTLXPW - ASTLXR - ASTLXRB - ASTLXRH - ASTLXRW - ASTP - ASUB - ASUBS - ASUBSW - ASUBW - ASVC - ASXTB - ASXTBW - ASXTH - ASXTHW - ASXTW - ASYS - ASYSL - ATBNZ - ATBZ - ATLBI - ATST - ATSTW - AUBFIZ - AUBFIZW - AUBFM - AUBFMW - AUBFX - AUBFXW - AUDIV - AUDIVW - AUMADDL - AUMNEGL - AUMSUBL - AUMULH - AUMULL - AUREM - AUREMW - AUXTB - AUXTH - AUXTW - AUXTBW - AUXTHW - AWFE - AWFI - AYIELD - AMOVB - AMOVBU - AMOVH - AMOVHU - AMOVW - AMOVWU - AMOVD - AMOVNP - AMOVNPW - AMOVP - AMOVPD - AMOVPQ - AMOVPS - AMOVPSW - AMOVPW - ABEQ - ABNE - ABCS - ABHS - ABCC - ABLO - ABMI - ABPL - ABVS - ABVC - ABHI - ABLS - ABGE - ABLT - ABGT - ABLE - AFABSD - AFABSS - AFADDD - AFADDS - AFCCMPD - AFCCMPED - AFCCMPS - AFCCMPES - AFCMPD - AFCMPED - AFCMPES - AFCMPS - AFCVTSD - AFCVTDS - AFCVTZSD - AFCVTZSDW - AFCVTZSS - AFCVTZSSW - AFCVTZUD - AFCVTZUDW - AFCVTZUS - AFCVTZUSW - AFDIVD - AFDIVS - AFMOVD - AFMOVS - AFMULD - AFMULS - AFNEGD - AFNEGS - AFSQRTD - AFSQRTS - AFSUBD - AFSUBS - ASCVTFD - ASCVTFS - ASCVTFWD - ASCVTFWS - AUCVTFD - AUCVTFS - AUCVTFWD - AUCVTFWS - AWORD - ADWORD - AFCSELS - AFCSELD - AFMAXS - AFMINS - AFMAXD - AFMIND - AFMAXNMS - AFMAXNMD - AFNMULS - AFNMULD - AFRINTNS - AFRINTND - AFRINTPS - AFRINTPD - AFRINTMS - AFRINTMD - AFRINTZS - AFRINTZD - AFRINTAS - AFRINTAD - AFRINTXS - AFRINTXD - AFRINTIS - AFRINTID - AFMADDS - AFMADDD - AFMSUBS - AFMSUBD - AFNMADDS - AFNMADDD - AFNMSUBS - AFNMSUBD - AFMINNMS - AFMINNMD - AFCVTDH - AFCVTHS - AFCVTHD - AFCVTSH - AAESD - AAESE - AAESIMC - AAESMC - ASHA1C - ASHA1H - ASHA1M - ASHA1P - ASHA1SU0 - ASHA1SU1 - ASHA256H - ASHA256H2 - ASHA256SU0 - ASHA256SU1 - ALAST - AB = obj.AJMP - ABL = obj.ACALL -) - -const ( - // shift types - SHIFT_LL = 0 << 22 - SHIFT_LR = 1 << 22 - SHIFT_AR = 2 << 22 -) diff --git a/vendor/github.com/google/gops/internal/obj/arm64/anames.go b/vendor/github.com/google/gops/internal/obj/arm64/anames.go deleted file mode 100644 index d1334596..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm64/anames.go +++ /dev/null @@ -1,370 +0,0 @@ -// Generated by stringer -i a.out.go -o anames.go -p arm64 -// Do not edit. - -package arm64 - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ - obj.A_ARCHSPECIFIC: "ADC", - "ADCS", - "ADCSW", - "ADCW", - "ADD", - "ADDS", - "ADDSW", - "ADDW", - "ADR", - "ADRP", - "AND", - "ANDS", - "ANDSW", - "ANDW", - "ASR", - "ASRW", - "AT", - "BFI", - "BFIW", - "BFM", - "BFMW", - "BFXIL", - "BFXILW", - "BIC", - "BICS", - "BICSW", - "BICW", - "BRK", - "CBNZ", - "CBNZW", - "CBZ", - "CBZW", - "CCMN", - "CCMNW", - "CCMP", - "CCMPW", - "CINC", - "CINCW", - "CINV", - "CINVW", - "CLREX", - "CLS", - "CLSW", - "CLZ", - "CLZW", - "CMN", - "CMNW", - "CMP", - "CMPW", - "CNEG", - "CNEGW", - "CRC32B", - "CRC32CB", - "CRC32CH", - "CRC32CW", - "CRC32CX", - "CRC32H", - "CRC32W", - "CRC32X", - "CSEL", - "CSELW", - "CSET", - "CSETM", - "CSETMW", - "CSETW", - "CSINC", - "CSINCW", - "CSINV", - "CSINVW", - "CSNEG", - "CSNEGW", - "DC", - "DCPS1", - "DCPS2", - "DCPS3", - "DMB", - "DRPS", - "DSB", - "EON", - "EONW", - "EOR", - "EORW", - "ERET", - "EXTR", - "EXTRW", - "HINT", - "HLT", - "HVC", - "IC", - "ISB", - "LDAR", - "LDARB", - "LDARH", - "LDARW", - "LDAXP", - "LDAXPW", - "LDAXR", - "LDAXRB", - "LDAXRH", - "LDAXRW", - "LDP", - "LDXR", - "LDXRB", - "LDXRH", - "LDXRW", - "LDXP", - "LDXPW", - "LSL", - "LSLW", - "LSR", - "LSRW", - "MADD", - "MADDW", - "MNEG", - "MNEGW", - "MOVK", - "MOVKW", - "MOVN", - "MOVNW", - "MOVZ", - "MOVZW", - "MRS", - "MSR", - "MSUB", - "MSUBW", - "MUL", - "MULW", - "MVN", - "MVNW", - "NEG", - "NEGS", - "NEGSW", - "NEGW", - "NGC", - "NGCS", - "NGCSW", - "NGCW", - "ORN", - "ORNW", - "ORR", - "ORRW", - "PRFM", - "PRFUM", - "RBIT", - "RBITW", - "REM", - "REMW", - "REV", - "REV16", - "REV16W", - "REV32", - "REVW", - "ROR", - "RORW", - "SBC", - "SBCS", - "SBCSW", - "SBCW", - "SBFIZ", - "SBFIZW", - "SBFM", - "SBFMW", - "SBFX", - "SBFXW", - "SDIV", - "SDIVW", - "SEV", - "SEVL", - "SMADDL", - "SMC", - "SMNEGL", - "SMSUBL", - "SMULH", - "SMULL", - "STXR", - "STXRB", - "STXRH", - "STXP", - "STXPW", - "STXRW", - "STLP", - "STLPW", - "STLR", - "STLRB", - "STLRH", - "STLRW", - "STLXP", - "STLXPW", - "STLXR", - "STLXRB", - "STLXRH", - "STLXRW", - "STP", - "SUB", - "SUBS", - "SUBSW", - "SUBW", - "SVC", - "SXTB", - "SXTBW", - "SXTH", - "SXTHW", - "SXTW", - "SYS", - "SYSL", - "TBNZ", - "TBZ", - "TLBI", - "TST", - "TSTW", - "UBFIZ", - "UBFIZW", - "UBFM", - "UBFMW", - "UBFX", - "UBFXW", - "UDIV", - "UDIVW", - "UMADDL", - "UMNEGL", - "UMSUBL", - "UMULH", - "UMULL", - "UREM", - "UREMW", - "UXTB", - "UXTH", - "UXTW", - "UXTBW", - "UXTHW", - "WFE", - "WFI", - "YIELD", - "MOVB", - "MOVBU", - "MOVH", - "MOVHU", - "MOVW", - "MOVWU", - "MOVD", - "MOVNP", - "MOVNPW", - "MOVP", - "MOVPD", - "MOVPQ", - "MOVPS", - "MOVPSW", - "MOVPW", - "BEQ", - "BNE", - "BCS", - "BHS", - "BCC", - "BLO", - "BMI", - "BPL", - "BVS", - "BVC", - "BHI", - "BLS", - "BGE", - "BLT", - "BGT", - "BLE", - "FABSD", - "FABSS", - "FADDD", - "FADDS", - "FCCMPD", - "FCCMPED", - "FCCMPS", - "FCCMPES", - "FCMPD", - "FCMPED", - "FCMPES", - "FCMPS", - "FCVTSD", - "FCVTDS", - "FCVTZSD", - "FCVTZSDW", - "FCVTZSS", - "FCVTZSSW", - "FCVTZUD", - "FCVTZUDW", - "FCVTZUS", - "FCVTZUSW", - "FDIVD", - "FDIVS", - "FMOVD", - "FMOVS", - "FMULD", - "FMULS", - "FNEGD", - "FNEGS", - "FSQRTD", - "FSQRTS", - "FSUBD", - "FSUBS", - "SCVTFD", - "SCVTFS", - "SCVTFWD", - "SCVTFWS", - "UCVTFD", - "UCVTFS", - "UCVTFWD", - "UCVTFWS", - "WORD", - "DWORD", - "FCSELS", - "FCSELD", - "FMAXS", - "FMINS", - "FMAXD", - "FMIND", - "FMAXNMS", - "FMAXNMD", - "FNMULS", - "FNMULD", - "FRINTNS", - "FRINTND", - "FRINTPS", - "FRINTPD", - "FRINTMS", - "FRINTMD", - "FRINTZS", - "FRINTZD", - "FRINTAS", - "FRINTAD", - "FRINTXS", - "FRINTXD", - "FRINTIS", - "FRINTID", - "FMADDS", - "FMADDD", - "FMSUBS", - "FMSUBD", - "FNMADDS", - "FNMADDD", - "FNMSUBS", - "FNMSUBD", - "FMINNMS", - "FMINNMD", - "FCVTDH", - "FCVTHS", - "FCVTHD", - "FCVTSH", - "AESD", - "AESE", - "AESIMC", - "AESMC", - "SHA1C", - "SHA1H", - "SHA1M", - "SHA1P", - "SHA1SU0", - "SHA1SU1", - "SHA256H", - "SHA256H2", - "SHA256SU0", - "SHA256SU1", - "LAST", -} diff --git a/vendor/github.com/google/gops/internal/obj/arm64/anames7.go b/vendor/github.com/google/gops/internal/obj/arm64/anames7.go deleted file mode 100644 index d55b34f9..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm64/anames7.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package arm64 - -var cnames7 = []string{ - "NONE", - "REG", - "RSP", - "FREG", - "VREG", - "PAIR", - "SHIFT", - "EXTREG", - "SPR", - "COND", - "ZCON", - "ADDCON0", - "ADDCON", - "MOVCON", - "BITCON", - "ABCON0", - "ABCON", - "MBCON", - "LCON", - "VCON", - "FCON", - "VCONADDR", - "AACON", - "LACON", - "AECON", - "SBRA", - "LBRA", - "NPAUTO", - "NSAUTO", - "PSAUTO", - "PPAUTO", - "UAUTO4K", - "UAUTO8K", - "UAUTO16K", - "UAUTO32K", - "UAUTO64K", - "LAUTO", - "SEXT1", - "SEXT2", - "SEXT4", - "SEXT8", - "SEXT16", - "LEXT", - "ZOREG", - "NPOREG", - "NSOREG", - "PSOREG", - "PPOREG", - "UOREG4K", - "UOREG8K", - "UOREG16K", - "UOREG32K", - "UOREG64K", - "LOREG", - "ADDR", - "GOTADDR", - "TLS_LE", - "TLS_IE", - "ROFF", - "GOK", - "TEXTSIZE", - "NCLASS", -} diff --git a/vendor/github.com/google/gops/internal/obj/arm64/asm7.go b/vendor/github.com/google/gops/internal/obj/arm64/asm7.go deleted file mode 100644 index a6dae2e4..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm64/asm7.go +++ /dev/null @@ -1,4374 +0,0 @@ -// cmd/7l/asm.c, cmd/7l/asmout.c, cmd/7l/optab.c, cmd/7l/span.c, cmd/ld/sub.c, cmd/ld/mod.c, from Vita Nuova. -// https://code.google.com/p/ken-cc/source/browse/ -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm64 - -import ( - "fmt" - "log" - "math" - "sort" - - "github.com/google/gops/internal/obj" -) - -const ( - funcAlign = 16 -) - -const ( - REGFROM = 1 -) - -type Optab struct { - as obj.As - a1 uint8 - a2 uint8 - a3 uint8 - type_ int8 - size int8 - param int16 - flag int8 - scond uint16 -} - -var oprange [ALAST & obj.AMask][]Optab - -var xcmp [C_NCLASS][C_NCLASS]bool - -const ( - S32 = 0 << 31 - S64 = 1 << 31 - Sbit = 1 << 29 - LSL0_32 = 2 << 13 - LSL0_64 = 3 << 13 -) - -func OPDP2(x uint32) uint32 { - return 0<<30 | 0<<29 | 0xd6<<21 | x<<10 -} - -func OPDP3(sf uint32, op54 uint32, op31 uint32, o0 uint32) uint32 { - return sf<<31 | op54<<29 | 0x1B<<24 | op31<<21 | o0<<15 -} - -func OPBcc(x uint32) uint32 { - return 0x2A<<25 | 0<<24 | 0<<4 | x&15 -} - -func OPBLR(x uint32) uint32 { - /* x=0, JMP; 1, CALL; 2, RET */ - return 0x6B<<25 | 0<<23 | x<<21 | 0x1F<<16 | 0<<10 -} - -func SYSOP(l uint32, op0 uint32, op1 uint32, crn uint32, crm uint32, op2 uint32, rt uint32) uint32 { - return 0x354<<22 | l<<21 | op0<<19 | op1<<16 | crn&15<<12 | crm&15<<8 | op2<<5 | rt -} - -func SYSHINT(x uint32) uint32 { - return SYSOP(0, 0, 3, 2, 0, x, 0x1F) -} - -func LDSTR12U(sz uint32, v uint32, opc uint32) uint32 { - return sz<<30 | 7<<27 | v<<26 | 1<<24 | opc<<22 -} - -func LDSTR9S(sz uint32, v uint32, opc uint32) uint32 { - return sz<<30 | 7<<27 | v<<26 | 0<<24 | opc<<22 -} - -func LD2STR(o uint32) uint32 { - return o &^ (3 << 22) -} - -func LDSTX(sz uint32, o2 uint32, l uint32, o1 uint32, o0 uint32) uint32 { - return sz<<30 | 0x8<<24 | o2<<23 | l<<22 | o1<<21 | o0<<15 -} - -func FPCMP(m uint32, s uint32, type_ uint32, op uint32, op2 uint32) uint32 { - return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | op<<14 | 8<<10 | op2 -} - -func FPCCMP(m uint32, s uint32, type_ uint32, op uint32) uint32 { - return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | 1<<10 | op<<4 -} - -func FPOP1S(m uint32, s uint32, type_ uint32, op uint32) uint32 { - return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | op<<15 | 0x10<<10 -} - -func FPOP2S(m uint32, s uint32, type_ uint32, op uint32) uint32 { - return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | op<<12 | 2<<10 -} - -func FPCVTI(sf uint32, s uint32, type_ uint32, rmode uint32, op uint32) uint32 { - return sf<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | rmode<<19 | op<<16 | 0<<10 -} - -func ADR(p uint32, o uint32, rt uint32) uint32 { - return p<<31 | (o&3)<<29 | 0x10<<24 | ((o>>2)&0x7FFFF)<<5 | rt&31 -} - -func OPBIT(x uint32) uint32 { - return 1<<30 | 0<<29 | 0xD6<<21 | 0<<16 | x<<10 -} - -const ( - LFROM = 1 << 0 - LTO = 1 << 1 -) - -var optab = []Optab{ - /* struct Optab: - OPCODE, from, prog->reg, to, type,size,param,flag,scond */ - {obj.ATEXT, C_ADDR, C_NONE, C_TEXTSIZE, 0, 0, 0, 0, 0}, - - /* arithmetic operations */ - {AADD, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {AADD, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {AADC, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {AADC, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {ANEG, C_REG, C_NONE, C_REG, 25, 4, 0, 0, 0}, - {ANEG, C_NONE, C_NONE, C_REG, 25, 4, 0, 0, 0}, - {ANGC, C_REG, C_NONE, C_REG, 17, 4, 0, 0, 0}, - {ACMP, C_REG, C_REG, C_NONE, 1, 4, 0, 0, 0}, - {AADD, C_ADDCON, C_RSP, C_RSP, 2, 4, 0, 0, 0}, - {AADD, C_ADDCON, C_NONE, C_RSP, 2, 4, 0, 0, 0}, - {ACMP, C_ADDCON, C_RSP, C_NONE, 2, 4, 0, 0, 0}, - {AADD, C_MOVCON, C_RSP, C_RSP, 62, 8, 0, 0, 0}, - {AADD, C_MOVCON, C_NONE, C_RSP, 62, 8, 0, 0, 0}, - {ACMP, C_MOVCON, C_RSP, C_NONE, 62, 8, 0, 0, 0}, - {AADD, C_BITCON, C_RSP, C_RSP, 62, 8, 0, 0, 0}, - {AADD, C_BITCON, C_NONE, C_RSP, 62, 8, 0, 0, 0}, - {ACMP, C_BITCON, C_RSP, C_NONE, 62, 8, 0, 0, 0}, - {AADD, C_VCON, C_RSP, C_RSP, 13, 8, 0, LFROM, 0}, - {AADD, C_VCON, C_NONE, C_RSP, 13, 8, 0, LFROM, 0}, - {ACMP, C_VCON, C_REG, C_NONE, 13, 8, 0, LFROM, 0}, - {AADD, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, - {AADD, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, - {AMVN, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, - {ACMP, C_SHIFT, C_REG, C_NONE, 3, 4, 0, 0, 0}, - {ANEG, C_SHIFT, C_NONE, C_REG, 26, 4, 0, 0, 0}, - {AADD, C_REG, C_RSP, C_RSP, 27, 4, 0, 0, 0}, - {AADD, C_REG, C_NONE, C_RSP, 27, 4, 0, 0, 0}, - {ACMP, C_REG, C_RSP, C_NONE, 27, 4, 0, 0, 0}, - {AADD, C_EXTREG, C_RSP, C_RSP, 27, 4, 0, 0, 0}, - {AADD, C_EXTREG, C_NONE, C_RSP, 27, 4, 0, 0, 0}, - {AMVN, C_EXTREG, C_NONE, C_RSP, 27, 4, 0, 0, 0}, - {ACMP, C_EXTREG, C_RSP, C_NONE, 27, 4, 0, 0, 0}, - {AADD, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {AADD, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - - /* logical operations */ - {AAND, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {AAND, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {ABIC, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {ABIC, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {AAND, C_BITCON, C_REG, C_REG, 53, 4, 0, 0, 0}, - {AAND, C_BITCON, C_NONE, C_REG, 53, 4, 0, 0, 0}, - {ABIC, C_BITCON, C_REG, C_REG, 53, 4, 0, 0, 0}, - {ABIC, C_BITCON, C_NONE, C_REG, 53, 4, 0, 0, 0}, - {AAND, C_MOVCON, C_REG, C_REG, 62, 8, 0, 0, 0}, - {AAND, C_MOVCON, C_NONE, C_REG, 62, 8, 0, 0, 0}, - {ABIC, C_MOVCON, C_REG, C_REG, 62, 8, 0, 0, 0}, - {ABIC, C_MOVCON, C_NONE, C_REG, 62, 8, 0, 0, 0}, - {AAND, C_VCON, C_REG, C_REG, 28, 8, 0, LFROM, 0}, - {AAND, C_VCON, C_NONE, C_REG, 28, 8, 0, LFROM, 0}, - {ABIC, C_VCON, C_REG, C_REG, 28, 8, 0, LFROM, 0}, - {ABIC, C_VCON, C_NONE, C_REG, 28, 8, 0, LFROM, 0}, - {AAND, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, - {AAND, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, - {ABIC, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, - {ABIC, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, - {AMOVD, C_RSP, C_NONE, C_RSP, 24, 4, 0, 0, 0}, - {AMVN, C_REG, C_NONE, C_REG, 24, 4, 0, 0, 0}, - {AMOVB, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, /* also MOVHU */ - {AMOVW, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, /* also MOVWU */ - /* TODO: MVN C_SHIFT */ - - /* MOVs that become MOVK/MOVN/MOVZ/ADD/SUB/OR */ - {AMOVW, C_MOVCON, C_NONE, C_REG, 32, 4, 0, 0, 0}, - {AMOVD, C_MOVCON, C_NONE, C_REG, 32, 4, 0, 0, 0}, - - // TODO: these don't work properly. - // { AMOVW, C_ADDCON, C_NONE, C_REG, 2, 4, 0 , 0}, - // { AMOVD, C_ADDCON, C_NONE, C_REG, 2, 4, 0 , 0}, - {AMOVW, C_BITCON, C_NONE, C_REG, 32, 4, 0, 0, 0}, - {AMOVD, C_BITCON, C_NONE, C_REG, 32, 4, 0, 0, 0}, - - {AMOVK, C_VCON, C_NONE, C_REG, 33, 4, 0, 0, 0}, - {AMOVD, C_AACON, C_NONE, C_REG, 4, 4, REGFROM, 0, 0}, - {ASDIV, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, - {ASDIV, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, - {AB, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, - {ABL, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, - {AB, C_NONE, C_NONE, C_ZOREG, 6, 4, 0, 0, 0}, - {ABL, C_NONE, C_NONE, C_REG, 6, 4, 0, 0, 0}, - {ABL, C_REG, C_NONE, C_REG, 6, 4, 0, 0, 0}, - {ABL, C_NONE, C_NONE, C_ZOREG, 6, 4, 0, 0, 0}, - {obj.ARET, C_NONE, C_NONE, C_REG, 6, 4, 0, 0, 0}, - {obj.ARET, C_NONE, C_NONE, C_ZOREG, 6, 4, 0, 0, 0}, - {AADRP, C_SBRA, C_NONE, C_REG, 60, 4, 0, 0, 0}, - {AADR, C_SBRA, C_NONE, C_REG, 61, 4, 0, 0, 0}, - {ABFM, C_VCON, C_REG, C_REG, 42, 4, 0, 0, 0}, - {ABFI, C_VCON, C_REG, C_REG, 43, 4, 0, 0, 0}, - {AEXTR, C_VCON, C_REG, C_REG, 44, 4, 0, 0, 0}, - {ASXTB, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, - {ACLS, C_REG, C_NONE, C_REG, 46, 4, 0, 0, 0}, - {ABEQ, C_NONE, C_NONE, C_SBRA, 7, 4, 0, 0, 0}, - {ALSL, C_VCON, C_REG, C_REG, 8, 4, 0, 0, 0}, - {ALSL, C_VCON, C_NONE, C_REG, 8, 4, 0, 0, 0}, - {ALSL, C_REG, C_NONE, C_REG, 9, 4, 0, 0, 0}, - {ALSL, C_REG, C_REG, C_REG, 9, 4, 0, 0, 0}, - {ASVC, C_NONE, C_NONE, C_VCON, 10, 4, 0, 0, 0}, - {ASVC, C_NONE, C_NONE, C_NONE, 10, 4, 0, 0, 0}, - {ADWORD, C_NONE, C_NONE, C_VCON, 11, 8, 0, 0, 0}, - {ADWORD, C_NONE, C_NONE, C_LEXT, 11, 8, 0, 0, 0}, - {ADWORD, C_NONE, C_NONE, C_ADDR, 11, 8, 0, 0, 0}, - {ADWORD, C_NONE, C_NONE, C_LACON, 11, 8, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_LCON, 14, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_LEXT, 14, 4, 0, 0, 0}, - {AWORD, C_NONE, C_NONE, C_ADDR, 14, 4, 0, 0, 0}, - {AMOVW, C_VCON, C_NONE, C_REG, 12, 4, 0, LFROM, 0}, - {AMOVW, C_VCONADDR, C_NONE, C_REG, 68, 8, 0, 0, 0}, - {AMOVD, C_VCON, C_NONE, C_REG, 12, 4, 0, LFROM, 0}, - {AMOVD, C_VCONADDR, C_NONE, C_REG, 68, 8, 0, 0, 0}, - {AMOVB, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AMOVD, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AMOVB, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, - {AMOVBU, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, - {AMOVH, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, - {AMOVW, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, - {AMOVD, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, - {AMOVD, C_GOTADDR, C_NONE, C_REG, 71, 8, 0, 0, 0}, - {AMOVD, C_TLS_LE, C_NONE, C_REG, 69, 4, 0, 0, 0}, - {AMOVD, C_TLS_IE, C_NONE, C_REG, 70, 8, 0, 0, 0}, - {AMUL, C_REG, C_REG, C_REG, 15, 4, 0, 0, 0}, - {AMUL, C_REG, C_NONE, C_REG, 15, 4, 0, 0, 0}, - {AMADD, C_REG, C_REG, C_REG, 15, 4, 0, 0, 0}, - {AREM, C_REG, C_REG, C_REG, 16, 8, 0, 0, 0}, - {AREM, C_REG, C_NONE, C_REG, 16, 8, 0, 0, 0}, - {ACSEL, C_COND, C_REG, C_REG, 18, 4, 0, 0, 0}, /* from3 optional */ - {ACSET, C_COND, C_NONE, C_REG, 18, 4, 0, 0, 0}, - {ACCMN, C_COND, C_REG, C_VCON, 19, 4, 0, 0, 0}, /* from3 either C_REG or C_VCON */ - - /* scaled 12-bit unsigned displacement store */ - {AMOVB, C_REG, C_NONE, C_UAUTO4K, 20, 4, REGSP, 0, 0}, - {AMOVB, C_REG, C_NONE, C_UOREG4K, 20, 4, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_UAUTO4K, 20, 4, REGSP, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_UOREG4K, 20, 4, 0, 0, 0}, - - {AMOVH, C_REG, C_NONE, C_UAUTO8K, 20, 4, REGSP, 0, 0}, - {AMOVH, C_REG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_UOREG8K, 20, 4, 0, 0, 0}, - - {AMOVW, C_REG, C_NONE, C_UAUTO16K, 20, 4, REGSP, 0, 0}, - {AMOVW, C_REG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_UOREG16K, 20, 4, 0, 0, 0}, - - /* unscaled 9-bit signed displacement store */ - {AMOVB, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - {AMOVB, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - - {AMOVH, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - {AMOVH, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - {AMOVW, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - - {AMOVD, C_REG, C_NONE, C_UAUTO32K, 20, 4, REGSP, 0, 0}, - {AMOVD, C_REG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, - {AMOVD, C_REG, C_NONE, C_UOREG32K, 20, 4, 0, 0, 0}, - {AMOVD, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - {AMOVD, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - - /* short displacement load */ - {AMOVB, C_UAUTO4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVB, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVB, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVB, C_UOREG4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVB, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - - {AMOVBU, C_UAUTO4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVBU, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVBU, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVBU, C_UOREG4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVBU, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - - {AMOVH, C_UAUTO8K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVH, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVH, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVH, C_UOREG8K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVH, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - - {AMOVW, C_UAUTO16K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVW, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVW, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVW, C_UOREG16K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVW, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - - {AMOVD, C_UAUTO32K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVD, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVD, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, - {AMOVD, C_UOREG32K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - {AMOVD, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, - - /* long displacement store */ - {AMOVB, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, - {AMOVB, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, - {AMOVBU, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, - {AMOVH, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, - {AMOVH, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, - {AMOVW, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, - {AMOVW, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, - {AMOVD, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, - {AMOVD, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, - - /* long displacement load */ - {AMOVB, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, - {AMOVB, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVB, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVBU, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, - {AMOVBU, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVBU, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVH, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, - {AMOVH, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVH, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVW, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, - {AMOVW, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVW, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVD, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, - {AMOVD, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - {AMOVD, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, - - /* load long effective stack address (load int32 offset and add) */ - {AMOVD, C_LACON, C_NONE, C_REG, 34, 8, REGSP, LFROM, 0}, - - /* pre/post-indexed load (unscaled, signed 9-bit offset) */ - {AMOVD, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, - {AMOVW, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, - {AMOVH, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, - {AMOVB, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, - {AMOVBU, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, - {AFMOVS, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPOST}, - {AFMOVD, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPOST}, - {AMOVD, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, - {AMOVW, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, - {AMOVH, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, - {AMOVB, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, - {AMOVBU, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, - {AFMOVS, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPRE}, - {AFMOVD, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPRE}, - - /* pre/post-indexed store (unscaled, signed 9-bit offset) */ - {AMOVD, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AMOVW, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AMOVH, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AMOVB, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AMOVBU, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AFMOVS, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AFMOVD, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, - {AMOVD, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - {AMOVW, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - {AMOVH, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - {AMOVB, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - {AMOVBU, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - {AFMOVS, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - {AFMOVD, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, - - /* pre/post-indexed load/store register pair - (unscaled, signed 10-bit quad-aligned offset) */ - {ALDP, C_LOREG, C_NONE, C_PAIR, 66, 4, 0, 0, C_XPRE}, - {ALDP, C_LOREG, C_NONE, C_PAIR, 66, 4, 0, 0, C_XPOST}, - {ASTP, C_PAIR, C_NONE, C_LOREG, 67, 4, 0, 0, C_XPRE}, - {ASTP, C_PAIR, C_NONE, C_LOREG, 67, 4, 0, 0, C_XPOST}, - - /* special */ - {AMOVD, C_SPR, C_NONE, C_REG, 35, 4, 0, 0, 0}, - {AMRS, C_SPR, C_NONE, C_REG, 35, 4, 0, 0, 0}, - {AMOVD, C_REG, C_NONE, C_SPR, 36, 4, 0, 0, 0}, - {AMSR, C_REG, C_NONE, C_SPR, 36, 4, 0, 0, 0}, - {AMOVD, C_VCON, C_NONE, C_SPR, 37, 4, 0, 0, 0}, - {AMSR, C_VCON, C_NONE, C_SPR, 37, 4, 0, 0, 0}, - {AERET, C_NONE, C_NONE, C_NONE, 41, 4, 0, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_UAUTO16K, 20, 4, REGSP, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_UOREG16K, 20, 4, 0, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_UAUTO32K, 20, 4, REGSP, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_UOREG32K, 20, 4, 0, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, - {AFMOVS, C_UAUTO16K, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, - {AFMOVS, C_NSAUTO, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, - {AFMOVS, C_ZOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, - {AFMOVS, C_UOREG16K, C_NONE, C_FREG, 21, 4, 0, 0, 0}, - {AFMOVS, C_NSOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, - {AFMOVD, C_UAUTO32K, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, - {AFMOVD, C_NSAUTO, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, - {AFMOVD, C_ZOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, - {AFMOVD, C_UOREG32K, C_NONE, C_FREG, 21, 4, 0, 0, 0}, - {AFMOVD, C_NSOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, - {AFMOVS, C_FREG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, - {AFMOVD, C_FREG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, - {AFMOVD, C_FREG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, - {AFMOVS, C_LAUTO, C_NONE, C_FREG, 31, 8, REGSP, LFROM, 0}, - {AFMOVS, C_LOREG, C_NONE, C_FREG, 31, 8, 0, LFROM, 0}, - {AFMOVD, C_LAUTO, C_NONE, C_FREG, 31, 8, REGSP, LFROM, 0}, - {AFMOVD, C_LOREG, C_NONE, C_FREG, 31, 8, 0, LFROM, 0}, - {AFMOVS, C_FREG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AFMOVS, C_ADDR, C_NONE, C_FREG, 65, 12, 0, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, - {AFMOVD, C_ADDR, C_NONE, C_FREG, 65, 12, 0, 0, 0}, - {AFADDS, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AFADDS, C_FREG, C_FREG, C_FREG, 54, 4, 0, 0, 0}, - {AFADDS, C_FCON, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AFADDS, C_FCON, C_FREG, C_FREG, 54, 4, 0, 0, 0}, - {AFMOVS, C_FCON, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AFMOVD, C_FCON, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, - {AFCVTZSD, C_FREG, C_NONE, C_REG, 29, 4, 0, 0, 0}, - {ASCVTFD, C_REG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, - {AFMOVS, C_REG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, - {AFMOVS, C_FREG, C_NONE, C_REG, 29, 4, 0, 0, 0}, - {AFMOVD, C_REG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, - {AFMOVD, C_FREG, C_NONE, C_REG, 29, 4, 0, 0, 0}, - {AFCMPS, C_FREG, C_FREG, C_NONE, 56, 4, 0, 0, 0}, - {AFCMPS, C_FCON, C_FREG, C_NONE, 56, 4, 0, 0, 0}, - {AFCCMPS, C_COND, C_REG, C_VCON, 57, 4, 0, 0, 0}, - {AFCSELD, C_COND, C_REG, C_FREG, 18, 4, 0, 0, 0}, - {AFCVTSD, C_FREG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, - {ACLREX, C_NONE, C_NONE, C_VCON, 38, 4, 0, 0, 0}, - {ACLREX, C_NONE, C_NONE, C_NONE, 38, 4, 0, 0, 0}, - {ACBZ, C_REG, C_NONE, C_SBRA, 39, 4, 0, 0, 0}, - {ATBZ, C_VCON, C_REG, C_SBRA, 40, 4, 0, 0, 0}, - {ASYS, C_VCON, C_NONE, C_NONE, 50, 4, 0, 0, 0}, - {ASYS, C_VCON, C_REG, C_NONE, 50, 4, 0, 0, 0}, - {ASYSL, C_VCON, C_NONE, C_REG, 50, 4, 0, 0, 0}, - {ADMB, C_VCON, C_NONE, C_NONE, 51, 4, 0, 0, 0}, - {AHINT, C_VCON, C_NONE, C_NONE, 52, 4, 0, 0, 0}, - {ALDAR, C_ZOREG, C_NONE, C_REG, 58, 4, 0, 0, 0}, - {ALDXR, C_ZOREG, C_NONE, C_REG, 58, 4, 0, 0, 0}, - {ALDAXR, C_ZOREG, C_NONE, C_REG, 58, 4, 0, 0, 0}, - {ALDXP, C_ZOREG, C_REG, C_REG, 58, 4, 0, 0, 0}, - {ASTLR, C_REG, C_NONE, C_ZOREG, 59, 4, 0, 0, 0}, // to3=C_NONE - {ASTXR, C_REG, C_NONE, C_ZOREG, 59, 4, 0, 0, 0}, // to3=C_REG - {ASTLXR, C_REG, C_NONE, C_ZOREG, 59, 4, 0, 0, 0}, // to3=C_REG - - // { ASTXP, C_REG, C_NONE, C_ZOREG, 59, 4, 0 , 0}, // TODO(aram): - - {AAESD, C_VREG, C_NONE, C_VREG, 29, 4, 0, 0, 0}, - {ASHA1C, C_VREG, C_REG, C_VREG, 1, 4, 0, 0, 0}, - - {obj.AUNDEF, C_NONE, C_NONE, C_NONE, 90, 4, 0, 0, 0}, - {obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, 0, 0, 0, 0, 0}, - {obj.APCDATA, C_VCON, C_NONE, C_VCON, 0, 0, 0, 0, 0}, - {obj.AFUNCDATA, C_VCON, C_NONE, C_ADDR, 0, 0, 0, 0, 0}, - {obj.ANOP, C_NONE, C_NONE, C_NONE, 0, 0, 0, 0, 0}, - {obj.ADUFFZERO, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as AB/ABL - {obj.ADUFFCOPY, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as AB/ABL - - {obj.AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0, 0, 0}, -} - -/* - * valid pstate field values, and value to use in instruction - */ -var pstatefield = []struct { - a uint32 - b uint32 -}{ - {REG_SPSel, 0<<16 | 4<<12 | 5<<5}, - {REG_DAIFSet, 3<<16 | 4<<12 | 6<<5}, - {REG_DAIFClr, 3<<16 | 4<<12 | 7<<5}, -} - -var pool struct { - start uint32 - size uint32 -} - -func prasm(p *obj.Prog) { - fmt.Printf("%v\n", p) -} - -func span7(ctxt *obj.Link, cursym *obj.LSym) { - p := cursym.Text - if p == nil || p.Link == nil { // handle external functions and ELF section symbols - return - } - ctxt.Cursym = cursym - ctxt.Autosize = int32(p.To.Offset&0xffffffff) + 8 - - if oprange[AAND&obj.AMask] == nil { - buildop(ctxt) - } - - bflag := 1 - c := int64(0) - p.Pc = c - var m int - var o *Optab - for p = p.Link; p != nil; p = p.Link { - ctxt.Curp = p - if p.As == ADWORD && (c&7) != 0 { - c += 4 - } - p.Pc = c - o = oplook(ctxt, p) - m = int(o.size) - if m == 0 { - if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD { - ctxt.Diag("zero-width instruction\n%v", p) - } - continue - } - - switch o.flag & (LFROM | LTO) { - case LFROM: - addpool(ctxt, p, &p.From) - - case LTO: - addpool(ctxt, p, &p.To) - break - } - - if p.As == AB || p.As == obj.ARET || p.As == AERET { /* TODO: other unconditional operations */ - checkpool(ctxt, p, 0) - } - c += int64(m) - if ctxt.Blitrl != nil { - checkpool(ctxt, p, 1) - } - } - - cursym.Size = c - - /* - * if any procedure is large enough to - * generate a large SBRA branch, then - * generate extra passes putting branches - * around jmps to fix. this is rare. - */ - for bflag != 0 { - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f span1\n", obj.Cputime()) - } - bflag = 0 - c = 0 - for p = cursym.Text.Link; p != nil; p = p.Link { - if p.As == ADWORD && (c&7) != 0 { - c += 4 - } - p.Pc = c - o = oplook(ctxt, p) - - /* very large branches */ - if o.type_ == 7 && p.Pcond != nil { - otxt := p.Pcond.Pc - c - if otxt <= -(1<<18)+10 || otxt >= (1<<18)-10 { - q := ctxt.NewProg() - q.Link = p.Link - p.Link = q - q.As = AB - q.To.Type = obj.TYPE_BRANCH - q.Pcond = p.Pcond - p.Pcond = q - q = ctxt.NewProg() - q.Link = p.Link - p.Link = q - q.As = AB - q.To.Type = obj.TYPE_BRANCH - q.Pcond = q.Link.Link - bflag = 1 - } - } - m = int(o.size) - - if m == 0 { - if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD { - ctxt.Diag("zero-width instruction\n%v", p) - } - continue - } - - c += int64(m) - } - } - - c += -c & (funcAlign - 1) - cursym.Size = c - - /* - * lay out the code, emitting code and data relocations. - */ - cursym.Grow(cursym.Size) - bp := cursym.P - psz := int32(0) - var i int - var out [6]uint32 - for p := cursym.Text.Link; p != nil; p = p.Link { - ctxt.Pc = p.Pc - ctxt.Curp = p - o = oplook(ctxt, p) - - // need to align DWORDs on 8-byte boundary. The ISA doesn't - // require it, but the various 64-bit loads we generate assume it. - if o.as == ADWORD && psz%8 != 0 { - bp[3] = 0 - bp[2] = bp[3] - bp[1] = bp[2] - bp[0] = bp[1] - bp = bp[4:] - psz += 4 - } - - if int(o.size) > 4*len(out) { - log.Fatalf("out array in span7 is too small, need at least %d for %v", o.size/4, p) - } - asmout(ctxt, p, o, out[:]) - for i = 0; i < int(o.size/4); i++ { - ctxt.Arch.ByteOrder.PutUint32(bp, out[i]) - bp = bp[4:] - psz += 4 - } - } -} - -/* - * when the first reference to the literal pool threatens - * to go out of range of a 1Mb PC-relative offset - * drop the pool now, and branch round it. - */ -func checkpool(ctxt *obj.Link, p *obj.Prog, skip int) { - if pool.size >= 0xffff0 || !ispcdisp(int32(p.Pc+4+int64(pool.size)-int64(pool.start)+8)) { - flushpool(ctxt, p, skip) - } else if p.Link == nil { - flushpool(ctxt, p, 2) - } -} - -func flushpool(ctxt *obj.Link, p *obj.Prog, skip int) { - if ctxt.Blitrl != nil { - if skip != 0 { - if ctxt.Debugvlog != 0 && skip == 1 { - fmt.Printf("note: flush literal pool at %#x: len=%d ref=%x\n", uint64(p.Pc+4), pool.size, pool.start) - } - q := ctxt.NewProg() - q.As = AB - q.To.Type = obj.TYPE_BRANCH - q.Pcond = p.Link - q.Link = ctxt.Blitrl - q.Lineno = p.Lineno - ctxt.Blitrl = q - } else if p.Pc+int64(pool.size)-int64(pool.start) < maxPCDisp { - return - } - - // The line number for constant pool entries doesn't really matter. - // We set it to the line number of the preceding instruction so that - // there are no deltas to encode in the pc-line tables. - for q := ctxt.Blitrl; q != nil; q = q.Link { - q.Lineno = p.Lineno - } - - ctxt.Elitrl.Link = p.Link - p.Link = ctxt.Blitrl - - ctxt.Blitrl = nil /* BUG: should refer back to values until out-of-range */ - ctxt.Elitrl = nil - pool.size = 0 - pool.start = 0 - } -} - -/* - * TODO: hash - */ -func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { - c := aclass(ctxt, a) - lit := ctxt.Instoffset - t := *ctxt.NewProg() - t.As = AWORD - sz := 4 - - // MOVD foo(SB), R is actually - // MOVD addr, REGTMP - // MOVD REGTMP, R - // where addr is the address of the DWORD containing the address of foo. - if p.As == AMOVD || c == C_ADDR || c == C_VCON || int64(lit) != int64(int32(lit)) || uint64(lit) != uint64(uint32(lit)) { - // conservative: don't know if we want signed or unsigned extension. - // in case of ambiguity, store 64-bit - t.As = ADWORD - sz = 8 - } - - switch c { - // TODO(aram): remove. - default: - if a.Name != obj.NAME_EXTERN { - fmt.Printf("addpool: %v in %v shouldn't go to default case\n", DRconv(c), p) - } - - t.To.Offset = a.Offset - t.To.Sym = a.Sym - t.To.Type = a.Type - t.To.Name = a.Name - - /* This is here because MOV uint12<<12, R is disabled in optab. - Because of this, we need to load the constant from memory. */ - case C_ADDCON: - fallthrough - - case C_PSAUTO, - C_PPAUTO, - C_UAUTO4K, - C_UAUTO8K, - C_UAUTO16K, - C_UAUTO32K, - C_UAUTO64K, - C_NSAUTO, - C_NPAUTO, - C_LAUTO, - C_PPOREG, - C_PSOREG, - C_UOREG4K, - C_UOREG8K, - C_UOREG16K, - C_UOREG32K, - C_UOREG64K, - C_NSOREG, - C_NPOREG, - C_LOREG, - C_LACON, - C_LCON, - C_VCON: - if a.Name == obj.NAME_EXTERN { - fmt.Printf("addpool: %v in %v needs reloc\n", DRconv(c), p) - } - - t.To.Type = obj.TYPE_CONST - t.To.Offset = lit - break - } - - for q := ctxt.Blitrl; q != nil; q = q.Link { /* could hash on t.t0.offset */ - if q.To == t.To { - p.Pcond = q - return - } - } - - q := ctxt.NewProg() - *q = t - q.Pc = int64(pool.size) - if ctxt.Blitrl == nil { - ctxt.Blitrl = q - pool.start = uint32(p.Pc) - } else { - ctxt.Elitrl.Link = q - } - ctxt.Elitrl = q - pool.size = -pool.size & (funcAlign - 1) - pool.size += uint32(sz) - p.Pcond = q -} - -func regoff(ctxt *obj.Link, a *obj.Addr) uint32 { - ctxt.Instoffset = 0 - aclass(ctxt, a) - return uint32(ctxt.Instoffset) -} - -// Maximum PC-relative displacement. -// The actual limit is ±2²⁰, but we are conservative -// to avoid needing to recompute the literal pool flush points -// as span-dependent jumps are enlarged. -const maxPCDisp = 512 * 1024 - -// ispcdisp reports whether v is a valid PC-relative displacement. -func ispcdisp(v int32) bool { - return -maxPCDisp < v && v < maxPCDisp && v&3 == 0 -} - -func isaddcon(v int64) bool { - /* uimm12 or uimm24? */ - if v < 0 { - return false - } - if (v & 0xFFF) == 0 { - v >>= 12 - } - return v <= 0xFFF -} - -// isbitcon returns whether a constant can be encoded into a logical instruction. -// bitcon has a binary form of repetition of a bit sequence of length 2, 4, 8, 16, 32, or 64, -// which itself is a rotate (w.r.t. the length of the unit) of a sequence of ones. -// special cases: 0 and -1 are not bitcon. -// this function needs to run against virtually all the constants, so it needs to be fast. -// for this reason, bitcon testing and bitcon encoding are separate functions. -func isbitcon(x uint64) bool { - if x == 1<<64-1 || x == 0 { - return false - } - // determine the period and sign-extend a unit to 64 bits - switch { - case x != x>>32|x<<32: - // period is 64 - // nothing to do - case x != x>>16|x<<48: - // period is 32 - x = uint64(int64(int32(x))) - case x != x>>8|x<<56: - // period is 16 - x = uint64(int64(int16(x))) - case x != x>>4|x<<60: - // period is 8 - x = uint64(int64(int8(x))) - default: - // period is 4 or 2, always true - // 0001, 0010, 0100, 1000 -- 0001 rotate - // 0011, 0110, 1100, 1001 -- 0011 rotate - // 0111, 1011, 1101, 1110 -- 0111 rotate - // 0101, 1010 -- 01 rotate, repeat - return true - } - return sequenceOfOnes(x) || sequenceOfOnes(^x) -} - -// sequenceOfOnes tests whether a constant is a sequence of ones in binary, with leading and trailing zeros -func sequenceOfOnes(x uint64) bool { - y := x & -x // lowest set bit of x. x is good iff x+y is a power of 2 - y += x - return (y-1)&y == 0 -} - -// bitconEncode returns the encoding of a bitcon used in logical instructions -// x is known to be a bitcon -// a bitcon is a sequence of n ones at low bits (i.e. 1<>32|x<<32: - period = 64 - case x != x>>16|x<<48: - period = 32 - x = uint64(int64(int32(x))) - case x != x>>8|x<<56: - period = 16 - x = uint64(int64(int16(x))) - case x != x>>4|x<<60: - period = 8 - x = uint64(int64(int8(x))) - case x != x>>2|x<<62: - period = 4 - x = uint64(int64(x<<60) >> 60) - default: - period = 2 - x = uint64(int64(x<<62) >> 62) - } - neg := false - if int64(x) < 0 { - x = ^x - neg = true - } - y := x & -x // lowest set bit of x. - s := log2(y) - n := log2(x+y) - s // x (or ^x) is a sequence of n ones left shifted by s bits - if neg { - // ^x is a sequence of n ones left shifted by s bits - // adjust n, s for x - s = n + s - n = period - n - } - - N := uint32(0) - if mode == 64 && period == 64 { - N = 1 - } - R := (period - s) & (period - 1) & uint32(mode-1) // shift amount of right rotate - S := (n - 1) | 63&^(period<<1-1) // low bits = #ones - 1, high bits encodes period - return N<<22 | R<<16 | S<<10 -} - -func log2(x uint64) uint32 { - if x == 0 { - panic("log2 of 0") - } - n := uint32(0) - if x >= 1<<32 { - x >>= 32 - n += 32 - } - if x >= 1<<16 { - x >>= 16 - n += 16 - } - if x >= 1<<8 { - x >>= 8 - n += 8 - } - if x >= 1<<4 { - x >>= 4 - n += 4 - } - if x >= 1<<2 { - x >>= 2 - n += 2 - } - if x >= 1<<1 { - x >>= 1 - n += 1 - } - return n -} - -func autoclass(l int64) int { - if l < 0 { - if l >= -256 { - return C_NSAUTO - } - if l >= -512 && (l&7) == 0 { - return C_NPAUTO - } - return C_LAUTO - } - - if l <= 255 { - return C_PSAUTO - } - if l <= 504 && (l&7) == 0 { - return C_PPAUTO - } - if l <= 4095 { - return C_UAUTO4K - } - if l <= 8190 && (l&1) == 0 { - return C_UAUTO8K - } - if l <= 16380 && (l&3) == 0 { - return C_UAUTO16K - } - if l <= 32760 && (l&7) == 0 { - return C_UAUTO32K - } - if l <= 65520 && (l&0xF) == 0 { - return C_UAUTO64K - } - return C_LAUTO -} - -func oregclass(l int64) int { - if l == 0 { - return C_ZOREG - } - return autoclass(l) - C_NPAUTO + C_NPOREG -} - -/* - * given an offset v and a class c (see above) - * return the offset value to use in the instruction, - * scaled if necessary - */ -func offsetshift(ctxt *obj.Link, v int64, c int) int64 { - s := 0 - if c >= C_SEXT1 && c <= C_SEXT16 { - s = c - C_SEXT1 - } else if c >= C_UAUTO4K && c <= C_UAUTO64K { - s = c - C_UAUTO4K - } else if c >= C_UOREG4K && c <= C_UOREG64K { - s = c - C_UOREG4K - } - vs := v >> uint(s) - if vs<= REG_SPECIAL: - return C_SPR - } - return C_GOK -} - -func aclass(ctxt *obj.Link, a *obj.Addr) int { - switch a.Type { - case obj.TYPE_NONE: - return C_NONE - - case obj.TYPE_REG: - return rclass(a.Reg) - - case obj.TYPE_REGREG: - return C_PAIR - - case obj.TYPE_SHIFT: - return C_SHIFT - - case obj.TYPE_MEM: - switch a.Name { - case obj.NAME_EXTERN, obj.NAME_STATIC: - if a.Sym == nil { - break - } - ctxt.Instoffset = a.Offset - if a.Sym != nil { // use relocation - if a.Sym.Type == obj.STLSBSS { - if ctxt.Flag_shared { - return C_TLS_IE - } else { - return C_TLS_LE - } - } - return C_ADDR - } - return C_LEXT - - case obj.NAME_GOTREF: - return C_GOTADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - return autoclass(ctxt.Instoffset) - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 - return autoclass(ctxt.Instoffset) - - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - return oregclass(ctxt.Instoffset) - } - return C_GOK - - case obj.TYPE_FCONST: - return C_FCON - - case obj.TYPE_TEXTSIZE: - return C_TEXTSIZE - - case obj.TYPE_CONST, obj.TYPE_ADDR: - switch a.Name { - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if a.Reg != 0 && a.Reg != REGZERO { - goto aconsize - } - v := ctxt.Instoffset - if v == 0 { - return C_ZCON - } - if isaddcon(v) { - if v <= 0xFFF { - if isbitcon(uint64(v)) { - return C_ABCON0 - } - return C_ADDCON0 - } - if isbitcon(uint64(v)) { - return C_ABCON - } - return C_ADDCON - } - - t := movcon(v) - if t >= 0 { - if isbitcon(uint64(v)) { - return C_MBCON - } - return C_MOVCON - } - - t = movcon(^v) - if t >= 0 { - if isbitcon(uint64(v)) { - return C_MBCON - } - return C_MOVCON - } - - if isbitcon(uint64(v)) { - return C_BITCON - } - - if uint64(v) == uint64(uint32(v)) || v == int64(int32(v)) { - return C_LCON - } - return C_VCON - - case obj.NAME_EXTERN, obj.NAME_STATIC: - if a.Sym == nil { - break - } - if a.Sym.Type == obj.STLSBSS { - ctxt.Diag("taking address of TLS variable is not supported") - } - ctxt.Instoffset = a.Offset - return C_VCONADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - goto aconsize - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 - goto aconsize - } - return C_GOK - - aconsize: - if isaddcon(ctxt.Instoffset) { - return C_AACON - } - return C_LACON - - case obj.TYPE_BRANCH: - return C_SBRA - } - - return C_GOK -} - -func oclass(a *obj.Addr) int { - return int(a.Class) - 1 -} - -func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { - a1 := int(p.Optab) - if a1 != 0 { - return &optab[a1-1] - } - a1 = int(p.From.Class) - if a1 == 0 { - a1 = aclass(ctxt, &p.From) + 1 - p.From.Class = int8(a1) - } - - a1-- - a3 := int(p.To.Class) - if a3 == 0 { - a3 = aclass(ctxt, &p.To) + 1 - p.To.Class = int8(a3) - } - - a3-- - a2 := C_NONE - if p.Reg != 0 { - a2 = rclass(p.Reg) - } - - if false { - fmt.Printf("oplook %v %d %d %d\n", p.As, a1, a2, a3) - fmt.Printf("\t\t%d %d\n", p.From.Type, p.To.Type) - } - - ops := oprange[p.As&obj.AMask] - c1 := &xcmp[a1] - c2 := &xcmp[a2] - c3 := &xcmp[a3] - c4 := &xcmp[p.Scond>>5] - for i := range ops { - op := &ops[i] - if (int(op.a2) == a2 || c2[op.a2]) && c4[op.scond>>5] && c1[op.a1] && c3[op.a3] { - p.Optab = uint16(cap(optab) - cap(ops) + i + 1) - return op - } - } - - ctxt.Diag("illegal combination %v %v %v %v, %d %d", p, DRconv(a1), DRconv(a2), DRconv(a3), p.From.Type, p.To.Type) - prasm(p) - if ops == nil { - ops = optab - } - return &ops[0] -} - -func cmp(a int, b int) bool { - if a == b { - return true - } - switch a { - case C_RSP: - if b == C_REG { - return true - } - - case C_REG: - if b == C_ZCON { - return true - } - - case C_ADDCON0: - if b == C_ZCON || b == C_ABCON0 { - return true - } - - case C_ADDCON: - if b == C_ZCON || b == C_ABCON0 || b == C_ADDCON0 || b == C_ABCON { - return true - } - - case C_BITCON: - if b == C_ABCON0 || b == C_ABCON || b == C_MBCON { - return true - } - - case C_MOVCON: - if b == C_MBCON || b == C_ZCON || b == C_ADDCON0 { - return true - } - - case C_LCON: - if b == C_ZCON || b == C_BITCON || b == C_ADDCON || b == C_ADDCON0 || b == C_ABCON || b == C_ABCON0 || b == C_MBCON || b == C_MOVCON { - return true - } - - case C_VCON: - return cmp(C_LCON, b) - - case C_LACON: - if b == C_AACON { - return true - } - - case C_SEXT2: - if b == C_SEXT1 { - return true - } - - case C_SEXT4: - if b == C_SEXT1 || b == C_SEXT2 { - return true - } - - case C_SEXT8: - if b >= C_SEXT1 && b <= C_SEXT4 { - return true - } - - case C_SEXT16: - if b >= C_SEXT1 && b <= C_SEXT8 { - return true - } - - case C_LEXT: - if b >= C_SEXT1 && b <= C_SEXT16 { - return true - } - - case C_PPAUTO: - if b == C_PSAUTO { - return true - } - - case C_UAUTO4K: - if b == C_PSAUTO || b == C_PPAUTO { - return true - } - - case C_UAUTO8K: - return cmp(C_UAUTO4K, b) - - case C_UAUTO16K: - return cmp(C_UAUTO8K, b) - - case C_UAUTO32K: - return cmp(C_UAUTO16K, b) - - case C_UAUTO64K: - return cmp(C_UAUTO32K, b) - - case C_NPAUTO: - return cmp(C_NSAUTO, b) - - case C_LAUTO: - return cmp(C_NPAUTO, b) || cmp(C_UAUTO64K, b) - - case C_PSOREG: - if b == C_ZOREG { - return true - } - - case C_PPOREG: - if b == C_ZOREG || b == C_PSOREG { - return true - } - - case C_UOREG4K: - if b == C_ZOREG || b == C_PSAUTO || b == C_PSOREG || b == C_PPAUTO || b == C_PPOREG { - return true - } - - case C_UOREG8K: - return cmp(C_UOREG4K, b) - - case C_UOREG16K: - return cmp(C_UOREG8K, b) - - case C_UOREG32K: - return cmp(C_UOREG16K, b) - - case C_UOREG64K: - return cmp(C_UOREG32K, b) - - case C_NPOREG: - return cmp(C_NSOREG, b) - - case C_LOREG: - return cmp(C_NPOREG, b) || cmp(C_UOREG64K, b) - - case C_LBRA: - if b == C_SBRA { - return true - } - } - - return false -} - -type ocmp []Optab - -func (x ocmp) Len() int { - return len(x) -} - -func (x ocmp) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} - -func (x ocmp) Less(i, j int) bool { - p1 := &x[i] - p2 := &x[j] - if p1.as != p2.as { - return p1.as < p2.as - } - if p1.a1 != p2.a1 { - return p1.a1 < p2.a1 - } - if p1.a2 != p2.a2 { - return p1.a2 < p2.a2 - } - if p1.a3 != p2.a3 { - return p1.a3 < p2.a3 - } - if p1.scond != p2.scond { - return p1.scond < p2.scond - } - return false -} - -func oprangeset(a obj.As, t []Optab) { - oprange[a&obj.AMask] = t -} - -func buildop(ctxt *obj.Link) { - var n int - for i := 0; i < C_GOK; i++ { - for n = 0; n < C_GOK; n++ { - if cmp(n, i) { - xcmp[i][n] = true - } - } - } - for n = 0; optab[n].as != obj.AXXX; n++ { - } - sort.Sort(ocmp(optab[:n])) - for i := 0; i < n; i++ { - r := optab[i].as - start := i - for optab[i].as == r { - i++ - } - t := optab[start:i] - i-- - oprangeset(r, t) - switch r { - default: - ctxt.Diag("unknown op in build: %v", r) - log.Fatalf("bad code") - - case AADD: - oprangeset(AADDS, t) - oprangeset(ASUB, t) - oprangeset(ASUBS, t) - oprangeset(AADDW, t) - oprangeset(AADDSW, t) - oprangeset(ASUBW, t) - oprangeset(ASUBSW, t) - - case AAND: /* logical immediate, logical shifted register */ - oprangeset(AANDS, t) - - oprangeset(AANDSW, t) - oprangeset(AANDW, t) - oprangeset(AEOR, t) - oprangeset(AEORW, t) - oprangeset(AORR, t) - oprangeset(AORRW, t) - - case ABIC: /* only logical shifted register */ - oprangeset(ABICS, t) - - oprangeset(ABICSW, t) - oprangeset(ABICW, t) - oprangeset(AEON, t) - oprangeset(AEONW, t) - oprangeset(AORN, t) - oprangeset(AORNW, t) - - case ANEG: - oprangeset(ANEGS, t) - oprangeset(ANEGSW, t) - oprangeset(ANEGW, t) - - case AADC: /* rn=Rd */ - oprangeset(AADCW, t) - - oprangeset(AADCS, t) - oprangeset(AADCSW, t) - oprangeset(ASBC, t) - oprangeset(ASBCW, t) - oprangeset(ASBCS, t) - oprangeset(ASBCSW, t) - - case ANGC: /* rn=REGZERO */ - oprangeset(ANGCW, t) - - oprangeset(ANGCS, t) - oprangeset(ANGCSW, t) - - case ACMP: - oprangeset(ACMPW, t) - oprangeset(ACMN, t) - oprangeset(ACMNW, t) - - case ATST: - oprangeset(ATSTW, t) - - /* register/register, and shifted */ - case AMVN: - oprangeset(AMVNW, t) - - case AMOVK: - oprangeset(AMOVKW, t) - oprangeset(AMOVN, t) - oprangeset(AMOVNW, t) - oprangeset(AMOVZ, t) - oprangeset(AMOVZW, t) - - case ABEQ: - oprangeset(ABNE, t) - oprangeset(ABCS, t) - oprangeset(ABHS, t) - oprangeset(ABCC, t) - oprangeset(ABLO, t) - oprangeset(ABMI, t) - oprangeset(ABPL, t) - oprangeset(ABVS, t) - oprangeset(ABVC, t) - oprangeset(ABHI, t) - oprangeset(ABLS, t) - oprangeset(ABGE, t) - oprangeset(ABLT, t) - oprangeset(ABGT, t) - oprangeset(ABLE, t) - - case ALSL: - oprangeset(ALSLW, t) - oprangeset(ALSR, t) - oprangeset(ALSRW, t) - oprangeset(AASR, t) - oprangeset(AASRW, t) - oprangeset(AROR, t) - oprangeset(ARORW, t) - - case ACLS: - oprangeset(ACLSW, t) - oprangeset(ACLZ, t) - oprangeset(ACLZW, t) - oprangeset(ARBIT, t) - oprangeset(ARBITW, t) - oprangeset(AREV, t) - oprangeset(AREVW, t) - oprangeset(AREV16, t) - oprangeset(AREV16W, t) - oprangeset(AREV32, t) - - case ASDIV: - oprangeset(ASDIVW, t) - oprangeset(AUDIV, t) - oprangeset(AUDIVW, t) - oprangeset(ACRC32B, t) - oprangeset(ACRC32CB, t) - oprangeset(ACRC32CH, t) - oprangeset(ACRC32CW, t) - oprangeset(ACRC32CX, t) - oprangeset(ACRC32H, t) - oprangeset(ACRC32W, t) - oprangeset(ACRC32X, t) - - case AMADD: - oprangeset(AMADDW, t) - oprangeset(AMSUB, t) - oprangeset(AMSUBW, t) - oprangeset(ASMADDL, t) - oprangeset(ASMSUBL, t) - oprangeset(AUMADDL, t) - oprangeset(AUMSUBL, t) - - case AREM: - oprangeset(AREMW, t) - oprangeset(AUREM, t) - oprangeset(AUREMW, t) - - case AMUL: - oprangeset(AMULW, t) - oprangeset(AMNEG, t) - oprangeset(AMNEGW, t) - oprangeset(ASMNEGL, t) - oprangeset(ASMULL, t) - oprangeset(ASMULH, t) - oprangeset(AUMNEGL, t) - oprangeset(AUMULH, t) - oprangeset(AUMULL, t) - - case AMOVB: - oprangeset(AMOVBU, t) - - case AMOVH: - oprangeset(AMOVHU, t) - - case AMOVW: - oprangeset(AMOVWU, t) - - case ABFM: - oprangeset(ABFMW, t) - oprangeset(ASBFM, t) - oprangeset(ASBFMW, t) - oprangeset(AUBFM, t) - oprangeset(AUBFMW, t) - - case ABFI: - oprangeset(ABFIW, t) - oprangeset(ABFXIL, t) - oprangeset(ABFXILW, t) - oprangeset(ASBFIZ, t) - oprangeset(ASBFIZW, t) - oprangeset(ASBFX, t) - oprangeset(ASBFXW, t) - oprangeset(AUBFIZ, t) - oprangeset(AUBFIZW, t) - oprangeset(AUBFX, t) - oprangeset(AUBFXW, t) - - case AEXTR: - oprangeset(AEXTRW, t) - - case ASXTB: - oprangeset(ASXTBW, t) - oprangeset(ASXTH, t) - oprangeset(ASXTHW, t) - oprangeset(ASXTW, t) - oprangeset(AUXTB, t) - oprangeset(AUXTH, t) - oprangeset(AUXTW, t) - oprangeset(AUXTBW, t) - oprangeset(AUXTHW, t) - - case ACCMN: - oprangeset(ACCMNW, t) - oprangeset(ACCMP, t) - oprangeset(ACCMPW, t) - - case ACSEL: - oprangeset(ACSELW, t) - oprangeset(ACSINC, t) - oprangeset(ACSINCW, t) - oprangeset(ACSINV, t) - oprangeset(ACSINVW, t) - oprangeset(ACSNEG, t) - oprangeset(ACSNEGW, t) - - // aliases Rm=Rn, !cond - oprangeset(ACINC, t) - - oprangeset(ACINCW, t) - oprangeset(ACINV, t) - oprangeset(ACINVW, t) - oprangeset(ACNEG, t) - oprangeset(ACNEGW, t) - - // aliases, Rm=Rn=REGZERO, !cond - case ACSET: - oprangeset(ACSETW, t) - - oprangeset(ACSETM, t) - oprangeset(ACSETMW, t) - - case AMOVD, - AMOVBU, - AB, - ABL, - AWORD, - ADWORD, - obj.ARET, - obj.ATEXT, - ASTP, - ALDP: - break - - case AERET: - oprangeset(AWFE, t) - oprangeset(AWFI, t) - oprangeset(AYIELD, t) - oprangeset(ASEV, t) - oprangeset(ASEVL, t) - oprangeset(ADRPS, t) - - case ACBZ: - oprangeset(ACBZW, t) - oprangeset(ACBNZ, t) - oprangeset(ACBNZW, t) - - case ATBZ: - oprangeset(ATBNZ, t) - - case AADR, AADRP: - break - - case ACLREX: - break - - case ASVC: - oprangeset(AHLT, t) - oprangeset(AHVC, t) - oprangeset(ASMC, t) - oprangeset(ABRK, t) - oprangeset(ADCPS1, t) - oprangeset(ADCPS2, t) - oprangeset(ADCPS3, t) - - case AFADDS: - oprangeset(AFADDD, t) - oprangeset(AFSUBS, t) - oprangeset(AFSUBD, t) - oprangeset(AFMULS, t) - oprangeset(AFMULD, t) - oprangeset(AFNMULS, t) - oprangeset(AFNMULD, t) - oprangeset(AFDIVS, t) - oprangeset(AFMAXD, t) - oprangeset(AFMAXS, t) - oprangeset(AFMIND, t) - oprangeset(AFMINS, t) - oprangeset(AFMAXNMD, t) - oprangeset(AFMAXNMS, t) - oprangeset(AFMINNMD, t) - oprangeset(AFMINNMS, t) - oprangeset(AFDIVD, t) - - case AFCVTSD: - oprangeset(AFCVTDS, t) - oprangeset(AFABSD, t) - oprangeset(AFABSS, t) - oprangeset(AFNEGD, t) - oprangeset(AFNEGS, t) - oprangeset(AFSQRTD, t) - oprangeset(AFSQRTS, t) - oprangeset(AFRINTNS, t) - oprangeset(AFRINTND, t) - oprangeset(AFRINTPS, t) - oprangeset(AFRINTPD, t) - oprangeset(AFRINTMS, t) - oprangeset(AFRINTMD, t) - oprangeset(AFRINTZS, t) - oprangeset(AFRINTZD, t) - oprangeset(AFRINTAS, t) - oprangeset(AFRINTAD, t) - oprangeset(AFRINTXS, t) - oprangeset(AFRINTXD, t) - oprangeset(AFRINTIS, t) - oprangeset(AFRINTID, t) - oprangeset(AFCVTDH, t) - oprangeset(AFCVTHS, t) - oprangeset(AFCVTHD, t) - oprangeset(AFCVTSH, t) - - case AFCMPS: - oprangeset(AFCMPD, t) - oprangeset(AFCMPES, t) - oprangeset(AFCMPED, t) - - case AFCCMPS: - oprangeset(AFCCMPD, t) - oprangeset(AFCCMPES, t) - oprangeset(AFCCMPED, t) - - case AFCSELD: - oprangeset(AFCSELS, t) - - case AFMOVS, AFMOVD: - break - - case AFCVTZSD: - oprangeset(AFCVTZSDW, t) - oprangeset(AFCVTZSS, t) - oprangeset(AFCVTZSSW, t) - oprangeset(AFCVTZUD, t) - oprangeset(AFCVTZUDW, t) - oprangeset(AFCVTZUS, t) - oprangeset(AFCVTZUSW, t) - - case ASCVTFD: - oprangeset(ASCVTFS, t) - oprangeset(ASCVTFWD, t) - oprangeset(ASCVTFWS, t) - oprangeset(AUCVTFD, t) - oprangeset(AUCVTFS, t) - oprangeset(AUCVTFWD, t) - oprangeset(AUCVTFWS, t) - - case ASYS: - oprangeset(AAT, t) - oprangeset(ADC, t) - oprangeset(AIC, t) - oprangeset(ATLBI, t) - - case ASYSL, AHINT: - break - - case ADMB: - oprangeset(ADSB, t) - oprangeset(AISB, t) - - case AMRS, AMSR: - break - - case ALDAR: - oprangeset(ALDARW, t) - fallthrough - - case ALDXR: - oprangeset(ALDXRB, t) - oprangeset(ALDXRH, t) - oprangeset(ALDXRW, t) - - case ALDAXR: - oprangeset(ALDAXRB, t) - oprangeset(ALDAXRH, t) - oprangeset(ALDAXRW, t) - - case ALDXP: - oprangeset(ALDXPW, t) - - case ASTLR: - oprangeset(ASTLRW, t) - - case ASTXR: - oprangeset(ASTXRB, t) - oprangeset(ASTXRH, t) - oprangeset(ASTXRW, t) - - case ASTLXR: - oprangeset(ASTLXRB, t) - oprangeset(ASTLXRH, t) - oprangeset(ASTLXRW, t) - - case ASTXP: - oprangeset(ASTXPW, t) - - case AAESD: - oprangeset(AAESE, t) - oprangeset(AAESMC, t) - oprangeset(AAESIMC, t) - oprangeset(ASHA1H, t) - oprangeset(ASHA1SU1, t) - oprangeset(ASHA256SU0, t) - - case ASHA1C: - oprangeset(ASHA1P, t) - oprangeset(ASHA1M, t) - oprangeset(ASHA1SU0, t) - oprangeset(ASHA256H, t) - oprangeset(ASHA256H2, t) - oprangeset(ASHA256SU1, t) - - case obj.ANOP, - obj.AUNDEF, - obj.AUSEFIELD, - obj.AFUNCDATA, - obj.APCDATA, - obj.ADUFFZERO, - obj.ADUFFCOPY: - break - } - } -} - -func chipfloat7(ctxt *obj.Link, e float64) int { - ei := math.Float64bits(e) - l := uint32(int32(ei)) - h := uint32(int32(ei >> 32)) - - if l != 0 || h&0xffff != 0 { - return -1 - } - h1 := h & 0x7fc00000 - if h1 != 0x40000000 && h1 != 0x3fc00000 { - return -1 - } - n := 0 - - // sign bit (a) - if h&0x80000000 != 0 { - n |= 1 << 7 - } - - // exp sign bit (b) - if h1 == 0x3fc00000 { - n |= 1 << 6 - } - - // rest of exp and mantissa (cd-efgh) - n |= int((h >> 16) & 0x3f) - - //print("match %.8lux %.8lux %d\n", l, h, n); - return n -} - -/* form offset parameter to SYS; special register number */ -func SYSARG5(op0 int, op1 int, Cn int, Cm int, op2 int) int { - return op0<<19 | op1<<16 | Cn<<12 | Cm<<8 | op2<<5 -} - -func SYSARG4(op1 int, Cn int, Cm int, op2 int) int { - return SYSARG5(0, op1, Cn, Cm, op2) -} - -func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { - o1 := uint32(0) - o2 := uint32(0) - o3 := uint32(0) - o4 := uint32(0) - o5 := uint32(0) - if false { /*debug['P']*/ - fmt.Printf("%x: %v\ttype %d\n", uint32(p.Pc), p, o.type_) - } - switch o.type_ { - default: - ctxt.Diag("unknown asm %d", o.type_) - prasm(p) - - case 0: /* pseudo ops */ - break - - case 1: /* op Rm,[Rn],Rd; default Rn=Rd -> op Rm<<0,[Rn,]Rd (shifted register) */ - o1 = oprrr(ctxt, p.As) - - rf := int(p.From.Reg) - rt := int(p.To.Reg) - r := int(p.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = REGZERO - } - if r == 0 { - r = rt - } - o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | uint32(rt&31) - - case 2: /* add/sub $(uimm12|uimm24)[,R],R; cmp $(uimm12|uimm24),R */ - o1 = opirr(ctxt, p.As) - - rt := int(p.To.Reg) - if p.To.Type == obj.TYPE_NONE { - if (o1 & Sbit) == 0 { - ctxt.Diag("ineffective ZR destination\n%v", p) - } - rt = REGZERO - } - - r := int(p.Reg) - if r == 0 { - r = rt - } - v := int32(regoff(ctxt, &p.From)) - o1 = oaddi(ctxt, int32(o1), v, r, rt) - - case 3: /* op R<>= 12 - o1 |= 1 << 22 /* shift, by 12 */ - } - - o1 |= ((uint32(v) & 0xFFF) << 10) | (uint32(r&31) << 5) | uint32(rt&31) - - case 5: /* b s; bl s */ - o1 = opbra(ctxt, p.As) - - if p.To.Sym == nil { - o1 |= uint32(brdist(ctxt, p, 0, 26, 2)) - break - } - - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - rel.Type = obj.R_CALLARM64 - - case 6: /* b ,O(R); bl ,O(R) */ - o1 = opbrr(ctxt, p.As) - - o1 |= uint32(p.To.Reg&31) << 5 - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 0 - rel.Type = obj.R_CALLIND - - case 7: /* beq s */ - o1 = opbra(ctxt, p.As) - - o1 |= uint32(brdist(ctxt, p, 0, 19, 2) << 5) - - case 8: /* lsl $c,[R],R -> ubfm $(W-1)-c,$(-c MOD (W-1)),Rn,Rd */ - rt := int(p.To.Reg) - - rf := int(p.Reg) - if rf == 0 { - rf = rt - } - v := int32(p.From.Offset) - switch p.As { - case AASR: - o1 = opbfm(ctxt, ASBFM, int(v), 63, rf, rt) - - case AASRW: - o1 = opbfm(ctxt, ASBFMW, int(v), 31, rf, rt) - - case ALSL: - o1 = opbfm(ctxt, AUBFM, int((64-v)&63), int(63-v), rf, rt) - - case ALSLW: - o1 = opbfm(ctxt, AUBFMW, int((32-v)&31), int(31-v), rf, rt) - - case ALSR: - o1 = opbfm(ctxt, AUBFM, int(v), 63, rf, rt) - - case ALSRW: - o1 = opbfm(ctxt, AUBFMW, int(v), 31, rf, rt) - - case AROR: - o1 = opextr(ctxt, AEXTR, v, rf, rf, rt) - - case ARORW: - o1 = opextr(ctxt, AEXTRW, v, rf, rf, rt) - - default: - ctxt.Diag("bad shift $con\n%v", ctxt.Curp) - break - } - - case 9: /* lsl Rm,[Rn],Rd -> lslv Rm, Rn, Rd */ - o1 = oprrr(ctxt, p.As) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o1 |= (uint32(p.From.Reg&31) << 16) | (uint32(r&31) << 5) | uint32(p.To.Reg&31) - - case 10: /* brk/hvc/.../svc [$con] */ - o1 = opimm(ctxt, p.As) - - if p.To.Type != obj.TYPE_NONE { - o1 |= uint32((p.To.Offset & 0xffff) << 5) - } - - case 11: /* dword */ - aclass(ctxt, &p.To) - - o1 = uint32(ctxt.Instoffset) - o2 = uint32(ctxt.Instoffset >> 32) - if p.To.Sym != nil { - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - rel.Type = obj.R_ADDR - o2 = 0 - o1 = o2 - } - - case 12: /* movT $vcon, reg */ - o1 = omovlit(ctxt, p.As, p, &p.From, int(p.To.Reg)) - - case 13: /* addop $vcon, [R], R (64 bit literal); cmp $lcon,R -> addop $lcon,R, ZR */ - o1 = omovlit(ctxt, AMOVD, p, &p.From, REGTMP) - - if !(o1 != 0) { - break - } - rt := int(p.To.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = REGZERO - } - r := int(p.Reg) - if r == 0 { - r = rt - } - if p.To.Type != obj.TYPE_NONE && (p.To.Reg == REGSP || r == REGSP) { - o2 = opxrrr(ctxt, p.As) - o2 |= REGTMP & 31 << 16 - o2 |= LSL0_64 - } else { - o2 = oprrr(ctxt, p.As) - o2 |= REGTMP & 31 << 16 /* shift is 0 */ - } - - o2 |= uint32(r&31) << 5 - o2 |= uint32(rt & 31) - - case 14: /* word */ - if aclass(ctxt, &p.To) == C_ADDR { - ctxt.Diag("address constant needs DWORD\n%v", p) - } - o1 = uint32(ctxt.Instoffset) - if p.To.Sym != nil { - // This case happens with words generated - // in the PC stream as part of the literal pool. - rel := obj.Addrel(ctxt.Cursym) - - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - rel.Type = obj.R_ADDR - o1 = 0 - } - - case 15: /* mul/mneg/umulh/umull r,[r,]r; madd/msub Rm,Rn,Ra,Rd */ - o1 = oprrr(ctxt, p.As) - - rf := int(p.From.Reg) - rt := int(p.To.Reg) - var r int - var ra int - if p.From3Type() == obj.TYPE_REG { - r = int(p.From3.Reg) - ra = int(p.Reg) - if ra == 0 { - ra = REGZERO - } - } else { - r = int(p.Reg) - if r == 0 { - r = rt - } - ra = REGZERO - } - - o1 |= (uint32(rf&31) << 16) | (uint32(ra&31) << 10) | (uint32(r&31) << 5) | uint32(rt&31) - - case 16: /* XremY R[,R],R -> XdivY; XmsubY */ - o1 = oprrr(ctxt, p.As) - - rf := int(p.From.Reg) - rt := int(p.To.Reg) - r := int(p.Reg) - if r == 0 { - r = rt - } - o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | REGTMP&31 - o2 = oprrr(ctxt, AMSUBW) - o2 |= o1 & (1 << 31) /* same size */ - o2 |= (uint32(rf&31) << 16) | (uint32(r&31) << 10) | (REGTMP & 31 << 5) | uint32(rt&31) - - case 17: /* op Rm,[Rn],Rd; default Rn=ZR */ - o1 = oprrr(ctxt, p.As) - - rf := int(p.From.Reg) - rt := int(p.To.Reg) - r := int(p.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = REGZERO - } - if r == 0 { - r = REGZERO - } - o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | uint32(rt&31) - - case 18: /* csel cond,Rn,Rm,Rd; cinc/cinv/cneg cond,Rn,Rd; cset cond,Rd */ - o1 = oprrr(ctxt, p.As) - - cond := int(p.From.Reg) - r := int(p.Reg) - var rf int - if r != 0 { - if p.From3Type() == obj.TYPE_NONE { - /* CINC/CINV/CNEG */ - rf = r - - cond ^= 1 - } else { - rf = int(p.From3.Reg) /* CSEL */ - } - } else { - /* CSET */ - if p.From3Type() != obj.TYPE_NONE { - ctxt.Diag("invalid combination\n%v", p) - } - rf = REGZERO - r = rf - cond ^= 1 - } - - rt := int(p.To.Reg) - o1 |= (uint32(rf&31) << 16) | (uint32(cond&31) << 12) | (uint32(r&31) << 5) | uint32(rt&31) - - case 19: /* CCMN cond, (Rm|uimm5),Rn, uimm4 -> ccmn Rn,Rm,uimm4,cond */ - nzcv := int(p.To.Offset) - - cond := int(p.From.Reg) - var rf int - if p.From3.Type == obj.TYPE_REG { - o1 = oprrr(ctxt, p.As) - rf = int(p.From3.Reg) /* Rm */ - } else { - o1 = opirr(ctxt, p.As) - rf = int(p.From3.Offset & 0x1F) - } - - o1 |= (uint32(rf&31) << 16) | (uint32(cond) << 12) | (uint32(p.Reg&31) << 5) | uint32(nzcv) - - case 20: /* movT R,O(R) -> strT */ - v := int32(regoff(ctxt, &p.To)) - sz := int32(1 << uint(movesize(p.As))) - - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - if v < 0 || v%sz != 0 { /* unscaled 9-bit signed */ - o1 = olsr9s(ctxt, int32(opstr9(ctxt, p.As)), v, r, int(p.From.Reg)) - } else { - v = int32(offsetshift(ctxt, int64(v), int(o.a3))) - o1 = olsr12u(ctxt, int32(opstr12(ctxt, p.As)), v, r, int(p.From.Reg)) - } - - case 21: /* movT O(R),R -> ldrT */ - v := int32(regoff(ctxt, &p.From)) - sz := int32(1 << uint(movesize(p.As))) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - if v < 0 || v%sz != 0 { /* unscaled 9-bit signed */ - o1 = olsr9s(ctxt, int32(opldr9(ctxt, p.As)), v, r, int(p.To.Reg)) - } else { - v = int32(offsetshift(ctxt, int64(v), int(o.a1))) - //print("offset=%lld v=%ld a1=%d\n", instoffset, v, o->a1); - o1 = olsr12u(ctxt, int32(opldr12(ctxt, p.As)), v, r, int(p.To.Reg)) - } - - case 22: /* movT (R)O!,R; movT O(R)!, R -> ldrT */ - v := int32(p.From.Offset) - - if v < -256 || v > 255 { - ctxt.Diag("offset out of range\n%v", p) - } - o1 = opldrpp(ctxt, p.As) - if o.scond == C_XPOST { - o1 |= 1 << 10 - } else { - o1 |= 3 << 10 - } - o1 |= ((uint32(v) & 0x1FF) << 12) | (uint32(p.From.Reg&31) << 5) | uint32(p.To.Reg&31) - - case 23: /* movT R,(R)O!; movT O(R)!, R -> strT */ - v := int32(p.To.Offset) - - if v < -256 || v > 255 { - ctxt.Diag("offset out of range\n%v", p) - } - o1 = LD2STR(opldrpp(ctxt, p.As)) - if o.scond == C_XPOST { - o1 |= 1 << 10 - } else { - o1 |= 3 << 10 - } - o1 |= ((uint32(v) & 0x1FF) << 12) | (uint32(p.To.Reg&31) << 5) | uint32(p.From.Reg&31) - - case 24: /* mov/mvn Rs,Rd -> add $0,Rs,Rd or orr Rs,ZR,Rd */ - rf := int(p.From.Reg) - rt := int(p.To.Reg) - s := rf == REGSP || rt == REGSP - if p.As == AMVN || p.As == AMVNW { - if s { - ctxt.Diag("illegal SP reference\n%v", p) - } - o1 = oprrr(ctxt, p.As) - o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) - } else if s { - o1 = opirr(ctxt, p.As) - o1 |= (uint32(rf&31) << 5) | uint32(rt&31) - } else { - o1 = oprrr(ctxt, p.As) - o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) - } - - case 25: /* negX Rs, Rd -> subX Rs<<0, ZR, Rd */ - o1 = oprrr(ctxt, p.As) - - rf := int(p.From.Reg) - if rf == C_NONE { - rf = int(p.To.Reg) - } - rt := int(p.To.Reg) - o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) - - case 26: /* negX Rm< subX Rm< strT */ - s := movesize(o.as) - - if s < 0 { - ctxt.Diag("unexpected long move, op %v tab %v\n%v", p.As, o.as, p) - } - v := int32(regoff(ctxt, &p.To)) - if v < 0 { - ctxt.Diag("negative large offset\n%v", p) - } - if (v & ((1 << uint(s)) - 1)) != 0 { - ctxt.Diag("misaligned offset\n%v", p) - } - hi := v - (v & (0xFFF << uint(s))) - if (hi & 0xFFF) != 0 { - ctxt.Diag("internal: miscalculated offset %d [%d]\n%v", v, s, p) - } - - //fprint(2, "v=%ld (%#lux) s=%d hi=%ld (%#lux) v'=%ld (%#lux)\n", v, v, s, hi, hi, ((v-hi)>>s)&0xFFF, ((v-hi)>>s)&0xFFF); - r := int(p.To.Reg) - - if r == 0 { - r = int(o.param) - } - o1 = oaddi(ctxt, int32(opirr(ctxt, AADD)), hi, r, REGTMP) - o2 = olsr12u(ctxt, int32(opstr12(ctxt, p.As)), ((v-hi)>>uint(s))&0xFFF, REGTMP, int(p.From.Reg)) - - case 31: /* movT L(R), R -> ldrT */ - s := movesize(o.as) - - if s < 0 { - ctxt.Diag("unexpected long move, op %v tab %v\n%v", p.As, o.as, p) - } - v := int32(regoff(ctxt, &p.From)) - if v < 0 { - ctxt.Diag("negative large offset\n%v", p) - } - if (v & ((1 << uint(s)) - 1)) != 0 { - ctxt.Diag("misaligned offset\n%v", p) - } - hi := v - (v & (0xFFF << uint(s))) - if (hi & 0xFFF) != 0 { - ctxt.Diag("internal: miscalculated offset %d [%d]\n%v", v, s, p) - } - - //fprint(2, "v=%ld (%#lux) s=%d hi=%ld (%#lux) v'=%ld (%#lux)\n", v, v, s, hi, hi, ((v-hi)>>s)&0xFFF, ((v-hi)>>s)&0xFFF); - r := int(p.From.Reg) - - if r == 0 { - r = int(o.param) - } - o1 = oaddi(ctxt, int32(opirr(ctxt, AADD)), hi, r, REGTMP) - o2 = olsr12u(ctxt, int32(opldr12(ctxt, p.As)), ((v-hi)>>uint(s))&0xFFF, REGTMP, int(p.To.Reg)) - - case 32: /* mov $con, R -> movz/movn */ - o1 = omovconst(ctxt, p.As, p, &p.From, int(p.To.Reg)) - - case 33: /* movk $uimm16 << pos */ - o1 = opirr(ctxt, p.As) - - d := p.From.Offset - if (d >> 16) != 0 { - ctxt.Diag("requires uimm16\n%v", p) - } - s := 0 - if p.From3Type() != obj.TYPE_NONE { - if p.From3.Type != obj.TYPE_CONST { - ctxt.Diag("missing bit position\n%v", p) - } - s = int(p.From3.Offset / 16) - if (s*16&0xF) != 0 || s >= 4 || (o1&S64) == 0 && s >= 2 { - ctxt.Diag("illegal bit position\n%v", p) - } - } - - rt := int(p.To.Reg) - o1 |= uint32(((d & 0xFFFF) << 5) | int64((uint32(s)&3)<<21) | int64(rt&31)) - - case 34: /* mov $lacon,R */ - o1 = omovlit(ctxt, AMOVD, p, &p.From, REGTMP) - - if !(o1 != 0) { - break - } - o2 = opxrrr(ctxt, AADD) - o2 |= REGTMP & 31 << 16 - o2 |= LSL0_64 - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o2 |= uint32(r&31) << 5 - o2 |= uint32(p.To.Reg & 31) - - case 35: /* mov SPR,R -> mrs */ - o1 = oprrr(ctxt, AMRS) - - v := int32(p.From.Offset) - if (o1 & uint32(v&^(3<<19))) != 0 { - ctxt.Diag("MRS register value overlap\n%v", p) - } - o1 |= uint32(v) - o1 |= uint32(p.To.Reg & 31) - - case 36: /* mov R,SPR */ - o1 = oprrr(ctxt, AMSR) - - v := int32(p.To.Offset) - if (o1 & uint32(v&^(3<<19))) != 0 { - ctxt.Diag("MSR register value overlap\n%v", p) - } - o1 |= uint32(v) - o1 |= uint32(p.From.Reg & 31) - - case 37: /* mov $con,PSTATEfield -> MSR [immediate] */ - if (uint64(p.From.Offset) &^ uint64(0xF)) != 0 { - ctxt.Diag("illegal immediate for PSTATE field\n%v", p) - } - o1 = opirr(ctxt, AMSR) - o1 |= uint32((p.From.Offset & 0xF) << 8) /* Crm */ - v := int32(0) - for i := 0; i < len(pstatefield); i++ { - if int64(pstatefield[i].a) == p.To.Offset { - v = int32(pstatefield[i].b) - break - } - } - - if v == 0 { - ctxt.Diag("illegal PSTATE field for immediate move\n%v", p) - } - o1 |= uint32(v) - - case 38: /* clrex [$imm] */ - o1 = opimm(ctxt, p.As) - - if p.To.Type == obj.TYPE_NONE { - o1 |= 0xF << 8 - } else { - o1 |= uint32((p.To.Offset & 0xF) << 8) - } - - case 39: /* cbz R, rel */ - o1 = opirr(ctxt, p.As) - - o1 |= uint32(p.From.Reg & 31) - o1 |= uint32(brdist(ctxt, p, 0, 19, 2) << 5) - - case 40: /* tbz */ - o1 = opirr(ctxt, p.As) - - v := int32(p.From.Offset) - if v < 0 || v > 63 { - ctxt.Diag("illegal bit number\n%v", p) - } - o1 |= ((uint32(v) & 0x20) << (31 - 5)) | ((uint32(v) & 0x1F) << 19) - o1 |= uint32(brdist(ctxt, p, 0, 14, 2) << 5) - o1 |= uint32(p.Reg) - - case 41: /* eret, nop, others with no operands */ - o1 = op0(ctxt, p.As) - - case 42: /* bfm R,r,s,R */ - o1 = opbfm(ctxt, p.As, int(p.From.Offset), int(p.From3.Offset), int(p.Reg), int(p.To.Reg)) - - case 43: /* bfm aliases */ - r := int(p.From.Offset) - - s := int(p.From3.Offset) - rf := int(p.Reg) - rt := int(p.To.Reg) - if rf == 0 { - rf = rt - } - switch p.As { - case ABFI: - o1 = opbfm(ctxt, ABFM, 64-r, s-1, rf, rt) - - case ABFIW: - o1 = opbfm(ctxt, ABFMW, 32-r, s-1, rf, rt) - - case ABFXIL: - o1 = opbfm(ctxt, ABFM, r, r+s-1, rf, rt) - - case ABFXILW: - o1 = opbfm(ctxt, ABFMW, r, r+s-1, rf, rt) - - case ASBFIZ: - o1 = opbfm(ctxt, ASBFM, 64-r, s-1, rf, rt) - - case ASBFIZW: - o1 = opbfm(ctxt, ASBFMW, 32-r, s-1, rf, rt) - - case ASBFX: - o1 = opbfm(ctxt, ASBFM, r, r+s-1, rf, rt) - - case ASBFXW: - o1 = opbfm(ctxt, ASBFMW, r, r+s-1, rf, rt) - - case AUBFIZ: - o1 = opbfm(ctxt, AUBFM, 64-r, s-1, rf, rt) - - case AUBFIZW: - o1 = opbfm(ctxt, AUBFMW, 32-r, s-1, rf, rt) - - case AUBFX: - o1 = opbfm(ctxt, AUBFM, r, r+s-1, rf, rt) - - case AUBFXW: - o1 = opbfm(ctxt, AUBFMW, r, r+s-1, rf, rt) - - default: - ctxt.Diag("bad bfm alias\n%v", ctxt.Curp) - break - } - - case 44: /* extr $b, Rn, Rm, Rd */ - o1 = opextr(ctxt, p.As, int32(p.From.Offset), int(p.From3.Reg), int(p.Reg), int(p.To.Reg)) - - case 45: /* sxt/uxt[bhw] R,R; movT R,R -> sxtT R,R */ - rf := int(p.From.Reg) - - rt := int(p.To.Reg) - as := p.As - if rf == REGZERO { - as = AMOVWU /* clearer in disassembly */ - } - switch as { - case AMOVB, ASXTB: - o1 = opbfm(ctxt, ASBFM, 0, 7, rf, rt) - - case AMOVH, ASXTH: - o1 = opbfm(ctxt, ASBFM, 0, 15, rf, rt) - - case AMOVW, ASXTW: - o1 = opbfm(ctxt, ASBFM, 0, 31, rf, rt) - - case AMOVBU, AUXTB: - o1 = opbfm(ctxt, AUBFM, 0, 7, rf, rt) - - case AMOVHU, AUXTH: - o1 = opbfm(ctxt, AUBFM, 0, 15, rf, rt) - - case AMOVWU: - o1 = oprrr(ctxt, as) | (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) - - case AUXTW: - o1 = opbfm(ctxt, AUBFM, 0, 31, rf, rt) - - case ASXTBW: - o1 = opbfm(ctxt, ASBFMW, 0, 7, rf, rt) - - case ASXTHW: - o1 = opbfm(ctxt, ASBFMW, 0, 15, rf, rt) - - case AUXTBW: - o1 = opbfm(ctxt, AUBFMW, 0, 7, rf, rt) - - case AUXTHW: - o1 = opbfm(ctxt, AUBFMW, 0, 15, rf, rt) - - default: - ctxt.Diag("bad sxt %v", as) - break - } - - case 46: /* cls */ - o1 = opbit(ctxt, p.As) - - o1 |= uint32(p.From.Reg&31) << 5 - o1 |= uint32(p.To.Reg & 31) - - case 47: /* movT R,V(R) -> strT (huge offset) */ - o1 = omovlit(ctxt, AMOVW, p, &p.To, REGTMP) - - if !(o1 != 0) { - break - } - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o2 = olsxrr(ctxt, p.As, REGTMP, r, int(p.From.Reg)) - - case 48: /* movT V(R), R -> ldrT (huge offset) */ - o1 = omovlit(ctxt, AMOVW, p, &p.From, REGTMP) - - if !(o1 != 0) { - break - } - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o2 = olsxrr(ctxt, p.As, REGTMP, r, int(p.To.Reg)) - - case 50: /* sys/sysl */ - o1 = opirr(ctxt, p.As) - - if (p.From.Offset &^ int64(SYSARG4(0x7, 0xF, 0xF, 0x7))) != 0 { - ctxt.Diag("illegal SYS argument\n%v", p) - } - o1 |= uint32(p.From.Offset) - if p.To.Type == obj.TYPE_REG { - o1 |= uint32(p.To.Reg & 31) - } else if p.Reg != 0 { - o1 |= uint32(p.Reg & 31) - } else { - o1 |= 0x1F - } - - case 51: /* dmb */ - o1 = opirr(ctxt, p.As) - - if p.From.Type == obj.TYPE_CONST { - o1 |= uint32((p.From.Offset & 0xF) << 8) - } - - case 52: /* hint */ - o1 = opirr(ctxt, p.As) - - o1 |= uint32((p.From.Offset & 0x7F) << 5) - - case 53: /* and/or/eor/bic/... $bitcon, Rn, Rd */ - a := p.As - rt := int(p.To.Reg) - r := int(p.Reg) - if r == 0 { - r = rt - } - mode := 64 - v := uint64(p.From.Offset) - switch p.As { - case AANDW, AORRW, AEORW, AANDSW: - mode = 32 - case ABIC, AORN, AEON, ABICS: - v = ^v - case ABICW, AORNW, AEONW, ABICSW: - v = ^v - mode = 32 - } - o1 = opirr(ctxt, a) - o1 |= bitconEncode(v, mode) | uint32(r&31)<<5 | uint32(rt&31) - - case 54: /* floating point arith */ - o1 = oprrr(ctxt, p.As) - - var rf int - if p.From.Type == obj.TYPE_CONST { - rf = chipfloat7(ctxt, p.From.Val.(float64)) - if rf < 0 || true { - ctxt.Diag("invalid floating-point immediate\n%v", p) - rf = 0 - } - - rf |= (1 << 3) - } else { - rf = int(p.From.Reg) - } - rt := int(p.To.Reg) - r := int(p.Reg) - if (o1&(0x1F<<24)) == (0x1E<<24) && (o1&(1<<11)) == 0 { /* monadic */ - r = rf - rf = 0 - } else if r == 0 { - r = rt - } - o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | uint32(rt&31) - - case 56: /* floating point compare */ - o1 = oprrr(ctxt, p.As) - - var rf int - if p.From.Type == obj.TYPE_CONST { - o1 |= 8 /* zero */ - rf = 0 - } else { - rf = int(p.From.Reg) - } - rt := int(p.Reg) - o1 |= uint32(rf&31)<<16 | uint32(rt&31)<<5 - - case 57: /* floating point conditional compare */ - o1 = oprrr(ctxt, p.As) - - cond := int(p.From.Reg) - nzcv := int(p.To.Offset) - if nzcv&^0xF != 0 { - ctxt.Diag("implausible condition\n%v", p) - } - rf := int(p.Reg) - if p.From3 == nil || p.From3.Reg < REG_F0 || p.From3.Reg > REG_F31 { - ctxt.Diag("illegal FCCMP\n%v", p) - break - } - rt := int(p.From3.Reg) - o1 |= uint32(rf&31)<<16 | uint32(cond)<<12 | uint32(rt&31)<<5 | uint32(nzcv) - - case 58: /* ldar/ldxr/ldaxr */ - o1 = opload(ctxt, p.As) - - o1 |= 0x1F << 16 - o1 |= uint32(p.From.Reg) << 5 - if p.Reg != 0 { - o1 |= uint32(p.Reg) << 10 - } else { - o1 |= 0x1F << 10 - } - o1 |= uint32(p.To.Reg & 31) - - case 59: /* stxr/stlxr */ - o1 = opstore(ctxt, p.As) - - if p.RegTo2 != obj.REG_NONE { - o1 |= uint32(p.RegTo2&31) << 16 - } else { - o1 |= 0x1F << 16 - } - - // TODO(aram): add support for STXP - o1 |= uint32(p.To.Reg&31) << 5 - - o1 |= uint32(p.From.Reg & 31) - - case 60: /* adrp label,r */ - d := brdist(ctxt, p, 12, 21, 0) - - o1 = ADR(1, uint32(d), uint32(p.To.Reg)) - - case 61: /* adr label, r */ - d := brdist(ctxt, p, 0, 21, 0) - - o1 = ADR(0, uint32(d), uint32(p.To.Reg)) - - case 62: /* op $movcon, [R], R -> mov $movcon, REGTMP + op REGTMP, [R], R */ - if p.Reg == REGTMP { - ctxt.Diag("cannot use REGTMP as source: %v\n", p) - } - o1 = omovconst(ctxt, AMOVD, p, &p.From, REGTMP) - - rt := int(p.To.Reg) - if p.To.Type == obj.TYPE_NONE { - rt = REGZERO - } - r := int(p.Reg) - if r == 0 { - r = rt - } - if p.To.Type != obj.TYPE_NONE && (p.To.Reg == REGSP || r == REGSP) { - o2 = opxrrr(ctxt, p.As) - o2 |= REGTMP & 31 << 16 - o2 |= LSL0_64 - } else { - o2 = oprrr(ctxt, p.As) - o2 |= REGTMP & 31 << 16 /* shift is 0 */ - } - o2 |= uint32(r&31) << 5 - o2 |= uint32(rt & 31) - - /* reloc ops */ - case 64: /* movT R,addr -> adrp + add + movT R, (REGTMP) */ - o1 = ADR(1, 0, REGTMP) - o2 = opirr(ctxt, AADD) | REGTMP&31<<5 | REGTMP&31 - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - rel.Type = obj.R_ADDRARM64 - o3 = olsr12u(ctxt, int32(opstr12(ctxt, p.As)), 0, REGTMP, int(p.From.Reg)) - - case 65: /* movT addr,R -> adrp + add + movT (REGTMP), R */ - o1 = ADR(1, 0, REGTMP) - o2 = opirr(ctxt, AADD) | REGTMP&31<<5 | REGTMP&31 - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDRARM64 - o3 = olsr12u(ctxt, int32(opldr12(ctxt, p.As)), 0, REGTMP, int(p.To.Reg)) - - case 66: /* ldp O(R)!, (r1, r2); ldp (R)O!, (r1, r2) */ - v := int32(p.From.Offset) - - if v < -512 || v > 504 { - ctxt.Diag("offset out of range\n%v", p) - } - if o.scond == C_XPOST { - o1 |= 1 << 23 - } else { - o1 |= 3 << 23 - } - o1 |= 1 << 22 - o1 |= uint32(int64(2<<30|5<<27|((uint32(v)/8)&0x7f)<<15) | p.To.Offset<<10 | int64(uint32(p.From.Reg&31)<<5) | int64(p.To.Reg&31)) - - case 67: /* stp (r1, r2), O(R)!; stp (r1, r2), (R)O! */ - v := int32(p.To.Offset) - - if v < -512 || v > 504 { - ctxt.Diag("offset out of range\n%v", p) - } - if o.scond == C_XPOST { - o1 |= 1 << 23 - } else { - o1 |= 3 << 23 - } - o1 |= uint32(int64(2<<30|5<<27|((uint32(v)/8)&0x7f)<<15) | p.From.Offset<<10 | int64(uint32(p.To.Reg&31)<<5) | int64(p.From.Reg&31)) - - case 68: /* movT $vconaddr(SB), reg -> adrp + add + reloc */ - if p.As == AMOVW { - ctxt.Diag("invalid load of 32-bit address: %v", p) - } - o1 = ADR(1, 0, uint32(p.To.Reg)) - o2 = opirr(ctxt, AADD) | uint32(p.To.Reg&31)<<5 | uint32(p.To.Reg&31) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDRARM64 - - case 69: /* LE model movd $tlsvar, reg -> movz reg, 0 + reloc */ - o1 = opirr(ctxt, AMOVZ) - o1 |= uint32(p.To.Reg & 31) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Type = obj.R_ARM64_TLS_LE - if p.From.Offset != 0 { - ctxt.Diag("invalid offset on MOVW $tlsvar") - } - - case 70: /* IE model movd $tlsvar, reg -> adrp REGTMP, 0; ldr reg, [REGTMP, #0] + relocs */ - o1 = ADR(1, 0, REGTMP) - o2 = olsr12u(ctxt, int32(opldr12(ctxt, AMOVD)), 0, REGTMP, int(p.To.Reg)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Add = 0 - rel.Type = obj.R_ARM64_TLS_IE - if p.From.Offset != 0 { - ctxt.Diag("invalid offset on MOVW $tlsvar") - } - - case 71: /* movd sym@GOT, reg -> adrp REGTMP, #0; ldr reg, [REGTMP, #0] + relocs */ - o1 = ADR(1, 0, REGTMP) - o2 = olsr12u(ctxt, int32(opldr12(ctxt, AMOVD)), 0, REGTMP, int(p.To.Reg)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Add = 0 - rel.Type = obj.R_ARM64_GOTPCREL - - // This is supposed to be something that stops execution. - // It's not supposed to be reached, ever, but if it is, we'd - // like to be able to tell how we got there. Assemble as - // 0xbea71700 which is guaranteed to raise undefined instruction - // exception. - case 90: - o1 = 0xbea71700 - - break - } - - out[0] = o1 - out[1] = o2 - out[2] = o3 - out[3] = o4 - out[4] = o5 - return -} - -/* - * basic Rm op Rn -> Rd (using shifted register with 0) - * also op Rn -> Rt - * also Rm*Rn op Ra -> Rd - */ -func oprrr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AADC: - return S64 | 0<<30 | 0<<29 | 0xd0<<21 | 0<<10 - - case AADCW: - return S32 | 0<<30 | 0<<29 | 0xd0<<21 | 0<<10 - - case AADCS: - return S64 | 0<<30 | 1<<29 | 0xd0<<21 | 0<<10 - - case AADCSW: - return S32 | 0<<30 | 1<<29 | 0xd0<<21 | 0<<10 - - case ANGC, ASBC: - return S64 | 1<<30 | 0<<29 | 0xd0<<21 | 0<<10 - - case ANGCS, ASBCS: - return S64 | 1<<30 | 1<<29 | 0xd0<<21 | 0<<10 - - case ANGCW, ASBCW: - return S32 | 1<<30 | 0<<29 | 0xd0<<21 | 0<<10 - - case ANGCSW, ASBCSW: - return S32 | 1<<30 | 1<<29 | 0xd0<<21 | 0<<10 - - case AADD: - return S64 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case AADDW: - return S32 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case ACMN, AADDS: - return S64 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case ACMNW, AADDSW: - return S32 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case ASUB: - return S64 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case ASUBW: - return S32 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case ACMP, ASUBS: - return S64 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case ACMPW, ASUBSW: - return S32 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 - - case AAND: - return S64 | 0<<29 | 0xA<<24 - - case AANDW: - return S32 | 0<<29 | 0xA<<24 - - case AMOVD, AORR: - return S64 | 1<<29 | 0xA<<24 - - // case AMOVW: - case AMOVWU, AORRW: - return S32 | 1<<29 | 0xA<<24 - - case AEOR: - return S64 | 2<<29 | 0xA<<24 - - case AEORW: - return S32 | 2<<29 | 0xA<<24 - - case AANDS: - return S64 | 3<<29 | 0xA<<24 - - case AANDSW: - return S32 | 3<<29 | 0xA<<24 - - case ABIC: - return S64 | 0<<29 | 0xA<<24 | 1<<21 - - case ABICW: - return S32 | 0<<29 | 0xA<<24 | 1<<21 - - case ABICS: - return S64 | 3<<29 | 0xA<<24 | 1<<21 - - case ABICSW: - return S32 | 3<<29 | 0xA<<24 | 1<<21 - - case AEON: - return S64 | 2<<29 | 0xA<<24 | 1<<21 - - case AEONW: - return S32 | 2<<29 | 0xA<<24 | 1<<21 - - case AMVN, AORN: - return S64 | 1<<29 | 0xA<<24 | 1<<21 - - case AMVNW, AORNW: - return S32 | 1<<29 | 0xA<<24 | 1<<21 - - case AASR: - return S64 | OPDP2(10) /* also ASRV */ - - case AASRW: - return S32 | OPDP2(10) - - case ALSL: - return S64 | OPDP2(8) - - case ALSLW: - return S32 | OPDP2(8) - - case ALSR: - return S64 | OPDP2(9) - - case ALSRW: - return S32 | OPDP2(9) - - case AROR: - return S64 | OPDP2(11) - - case ARORW: - return S32 | OPDP2(11) - - case ACCMN: - return S64 | 0<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 /* cond<<12 | nzcv<<0 */ - - case ACCMNW: - return S32 | 0<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 - - case ACCMP: - return S64 | 1<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 /* imm5<<16 | cond<<12 | nzcv<<0 */ - - case ACCMPW: - return S32 | 1<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 - - case ACRC32B: - return S32 | OPDP2(16) - - case ACRC32H: - return S32 | OPDP2(17) - - case ACRC32W: - return S32 | OPDP2(18) - - case ACRC32X: - return S64 | OPDP2(19) - - case ACRC32CB: - return S32 | OPDP2(20) - - case ACRC32CH: - return S32 | OPDP2(21) - - case ACRC32CW: - return S32 | OPDP2(22) - - case ACRC32CX: - return S64 | OPDP2(23) - - case ACSEL: - return S64 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 - - case ACSELW: - return S32 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 - - case ACSET: - return S64 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 - - case ACSETW: - return S32 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 - - case ACSETM: - return S64 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 - - case ACSETMW: - return S32 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 - - case ACINC, ACSINC: - return S64 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 - - case ACINCW, ACSINCW: - return S32 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 - - case ACINV, ACSINV: - return S64 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 - - case ACINVW, ACSINVW: - return S32 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 - - case ACNEG, ACSNEG: - return S64 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 - - case ACNEGW, ACSNEGW: - return S32 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 - - case AMUL, AMADD: - return S64 | 0<<29 | 0x1B<<24 | 0<<21 | 0<<15 - - case AMULW, AMADDW: - return S32 | 0<<29 | 0x1B<<24 | 0<<21 | 0<<15 - - case AMNEG, AMSUB: - return S64 | 0<<29 | 0x1B<<24 | 0<<21 | 1<<15 - - case AMNEGW, AMSUBW: - return S32 | 0<<29 | 0x1B<<24 | 0<<21 | 1<<15 - - case AMRS: - return SYSOP(1, 2, 0, 0, 0, 0, 0) - - case AMSR: - return SYSOP(0, 2, 0, 0, 0, 0, 0) - - case ANEG: - return S64 | 1<<30 | 0<<29 | 0xB<<24 | 0<<21 - - case ANEGW: - return S32 | 1<<30 | 0<<29 | 0xB<<24 | 0<<21 - - case ANEGS: - return S64 | 1<<30 | 1<<29 | 0xB<<24 | 0<<21 - - case ANEGSW: - return S32 | 1<<30 | 1<<29 | 0xB<<24 | 0<<21 - - case AREM, ASDIV: - return S64 | OPDP2(3) - - case AREMW, ASDIVW: - return S32 | OPDP2(3) - - case ASMULL, ASMADDL: - return OPDP3(1, 0, 1, 0) - - case ASMNEGL, ASMSUBL: - return OPDP3(1, 0, 1, 1) - - case ASMULH: - return OPDP3(1, 0, 2, 0) - - case AUMULL, AUMADDL: - return OPDP3(1, 0, 5, 0) - - case AUMNEGL, AUMSUBL: - return OPDP3(1, 0, 5, 1) - - case AUMULH: - return OPDP3(1, 0, 6, 0) - - case AUREM, AUDIV: - return S64 | OPDP2(2) - - case AUREMW, AUDIVW: - return S32 | OPDP2(2) - - case AAESE: - return 0x4E<<24 | 2<<20 | 8<<16 | 4<<12 | 2<<10 - - case AAESD: - return 0x4E<<24 | 2<<20 | 8<<16 | 5<<12 | 2<<10 - - case AAESMC: - return 0x4E<<24 | 2<<20 | 8<<16 | 6<<12 | 2<<10 - - case AAESIMC: - return 0x4E<<24 | 2<<20 | 8<<16 | 7<<12 | 2<<10 - - case ASHA1C: - return 0x5E<<24 | 0<<12 - - case ASHA1P: - return 0x5E<<24 | 1<<12 - - case ASHA1M: - return 0x5E<<24 | 2<<12 - - case ASHA1SU0: - return 0x5E<<24 | 3<<12 - - case ASHA256H: - return 0x5E<<24 | 4<<12 - - case ASHA256H2: - return 0x5E<<24 | 5<<12 - - case ASHA256SU1: - return 0x5E<<24 | 6<<12 - - case ASHA1H: - return 0x5E<<24 | 2<<20 | 8<<16 | 0<<12 | 2<<10 - - case ASHA1SU1: - return 0x5E<<24 | 2<<20 | 8<<16 | 1<<12 | 2<<10 - - case ASHA256SU0: - return 0x5E<<24 | 2<<20 | 8<<16 | 2<<12 | 2<<10 - - case AFCVTZSD: - return FPCVTI(1, 0, 1, 3, 0) - - case AFCVTZSDW: - return FPCVTI(0, 0, 1, 3, 0) - - case AFCVTZSS: - return FPCVTI(1, 0, 0, 3, 0) - - case AFCVTZSSW: - return FPCVTI(0, 0, 0, 3, 0) - - case AFCVTZUD: - return FPCVTI(1, 0, 1, 3, 1) - - case AFCVTZUDW: - return FPCVTI(0, 0, 1, 3, 1) - - case AFCVTZUS: - return FPCVTI(1, 0, 0, 3, 1) - - case AFCVTZUSW: - return FPCVTI(0, 0, 0, 3, 1) - - case ASCVTFD: - return FPCVTI(1, 0, 1, 0, 2) - - case ASCVTFS: - return FPCVTI(1, 0, 0, 0, 2) - - case ASCVTFWD: - return FPCVTI(0, 0, 1, 0, 2) - - case ASCVTFWS: - return FPCVTI(0, 0, 0, 0, 2) - - case AUCVTFD: - return FPCVTI(1, 0, 1, 0, 3) - - case AUCVTFS: - return FPCVTI(1, 0, 0, 0, 3) - - case AUCVTFWD: - return FPCVTI(0, 0, 1, 0, 3) - - case AUCVTFWS: - return FPCVTI(0, 0, 0, 0, 3) - - case AFADDS: - return FPOP2S(0, 0, 0, 2) - - case AFADDD: - return FPOP2S(0, 0, 1, 2) - - case AFSUBS: - return FPOP2S(0, 0, 0, 3) - - case AFSUBD: - return FPOP2S(0, 0, 1, 3) - - case AFMULS: - return FPOP2S(0, 0, 0, 0) - - case AFMULD: - return FPOP2S(0, 0, 1, 0) - - case AFDIVS: - return FPOP2S(0, 0, 0, 1) - - case AFDIVD: - return FPOP2S(0, 0, 1, 1) - - case AFMAXS: - return FPOP2S(0, 0, 0, 4) - - case AFMINS: - return FPOP2S(0, 0, 0, 5) - - case AFMAXD: - return FPOP2S(0, 0, 1, 4) - - case AFMIND: - return FPOP2S(0, 0, 1, 5) - - case AFMAXNMS: - return FPOP2S(0, 0, 0, 6) - - case AFMAXNMD: - return FPOP2S(0, 0, 1, 6) - - case AFMINNMS: - return FPOP2S(0, 0, 0, 7) - - case AFMINNMD: - return FPOP2S(0, 0, 1, 7) - - case AFNMULS: - return FPOP2S(0, 0, 0, 8) - - case AFNMULD: - return FPOP2S(0, 0, 1, 8) - - case AFCMPS: - return FPCMP(0, 0, 0, 0, 0) - - case AFCMPD: - return FPCMP(0, 0, 1, 0, 0) - - case AFCMPES: - return FPCMP(0, 0, 0, 0, 16) - - case AFCMPED: - return FPCMP(0, 0, 1, 0, 16) - - case AFCCMPS: - return FPCCMP(0, 0, 0, 0) - - case AFCCMPD: - return FPCCMP(0, 0, 1, 0) - - case AFCCMPES: - return FPCCMP(0, 0, 0, 1) - - case AFCCMPED: - return FPCCMP(0, 0, 1, 1) - - case AFCSELS: - return 0x1E<<24 | 0<<22 | 1<<21 | 3<<10 - - case AFCSELD: - return 0x1E<<24 | 1<<22 | 1<<21 | 3<<10 - - case AFMOVS: - return FPOP1S(0, 0, 0, 0) - - case AFABSS: - return FPOP1S(0, 0, 0, 1) - - case AFNEGS: - return FPOP1S(0, 0, 0, 2) - - case AFSQRTS: - return FPOP1S(0, 0, 0, 3) - - case AFCVTSD: - return FPOP1S(0, 0, 0, 5) - - case AFCVTSH: - return FPOP1S(0, 0, 0, 7) - - case AFRINTNS: - return FPOP1S(0, 0, 0, 8) - - case AFRINTPS: - return FPOP1S(0, 0, 0, 9) - - case AFRINTMS: - return FPOP1S(0, 0, 0, 10) - - case AFRINTZS: - return FPOP1S(0, 0, 0, 11) - - case AFRINTAS: - return FPOP1S(0, 0, 0, 12) - - case AFRINTXS: - return FPOP1S(0, 0, 0, 14) - - case AFRINTIS: - return FPOP1S(0, 0, 0, 15) - - case AFMOVD: - return FPOP1S(0, 0, 1, 0) - - case AFABSD: - return FPOP1S(0, 0, 1, 1) - - case AFNEGD: - return FPOP1S(0, 0, 1, 2) - - case AFSQRTD: - return FPOP1S(0, 0, 1, 3) - - case AFCVTDS: - return FPOP1S(0, 0, 1, 4) - - case AFCVTDH: - return FPOP1S(0, 0, 1, 7) - - case AFRINTND: - return FPOP1S(0, 0, 1, 8) - - case AFRINTPD: - return FPOP1S(0, 0, 1, 9) - - case AFRINTMD: - return FPOP1S(0, 0, 1, 10) - - case AFRINTZD: - return FPOP1S(0, 0, 1, 11) - - case AFRINTAD: - return FPOP1S(0, 0, 1, 12) - - case AFRINTXD: - return FPOP1S(0, 0, 1, 14) - - case AFRINTID: - return FPOP1S(0, 0, 1, 15) - - case AFCVTHS: - return FPOP1S(0, 0, 3, 4) - - case AFCVTHD: - return FPOP1S(0, 0, 3, 5) - } - - ctxt.Diag("bad rrr %d %v", a, a) - prasm(ctxt.Curp) - return 0 -} - -/* - * imm -> Rd - * imm op Rn -> Rd - */ -func opirr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - /* op $addcon, Rn, Rd */ - case AMOVD, AADD: - return S64 | 0<<30 | 0<<29 | 0x11<<24 - - case ACMN, AADDS: - return S64 | 0<<30 | 1<<29 | 0x11<<24 - - case AMOVW, AADDW: - return S32 | 0<<30 | 0<<29 | 0x11<<24 - - case ACMNW, AADDSW: - return S32 | 0<<30 | 1<<29 | 0x11<<24 - - case ASUB: - return S64 | 1<<30 | 0<<29 | 0x11<<24 - - case ACMP, ASUBS: - return S64 | 1<<30 | 1<<29 | 0x11<<24 - - case ASUBW: - return S32 | 1<<30 | 0<<29 | 0x11<<24 - - case ACMPW, ASUBSW: - return S32 | 1<<30 | 1<<29 | 0x11<<24 - - /* op $imm(SB), Rd; op label, Rd */ - case AADR: - return 0<<31 | 0x10<<24 - - case AADRP: - return 1<<31 | 0x10<<24 - - /* op $bimm, Rn, Rd */ - case AAND, ABIC: - return S64 | 0<<29 | 0x24<<23 - - case AANDW, ABICW: - return S32 | 0<<29 | 0x24<<23 | 0<<22 - - case AORR, AORN: - return S64 | 1<<29 | 0x24<<23 - - case AORRW, AORNW: - return S32 | 1<<29 | 0x24<<23 | 0<<22 - - case AEOR, AEON: - return S64 | 2<<29 | 0x24<<23 - - case AEORW, AEONW: - return S32 | 2<<29 | 0x24<<23 | 0<<22 - - case AANDS, ABICS: - return S64 | 3<<29 | 0x24<<23 - - case AANDSW, ABICSW: - return S32 | 3<<29 | 0x24<<23 | 0<<22 - - case AASR: - return S64 | 0<<29 | 0x26<<23 /* alias of SBFM */ - - case AASRW: - return S32 | 0<<29 | 0x26<<23 | 0<<22 - - /* op $width, $lsb, Rn, Rd */ - case ABFI: - return S64 | 2<<29 | 0x26<<23 | 1<<22 - /* alias of BFM */ - - case ABFIW: - return S32 | 2<<29 | 0x26<<23 | 0<<22 - - /* op $imms, $immr, Rn, Rd */ - case ABFM: - return S64 | 1<<29 | 0x26<<23 | 1<<22 - - case ABFMW: - return S32 | 1<<29 | 0x26<<23 | 0<<22 - - case ASBFM: - return S64 | 0<<29 | 0x26<<23 | 1<<22 - - case ASBFMW: - return S32 | 0<<29 | 0x26<<23 | 0<<22 - - case AUBFM: - return S64 | 2<<29 | 0x26<<23 | 1<<22 - - case AUBFMW: - return S32 | 2<<29 | 0x26<<23 | 0<<22 - - case ABFXIL: - return S64 | 1<<29 | 0x26<<23 | 1<<22 /* alias of BFM */ - - case ABFXILW: - return S32 | 1<<29 | 0x26<<23 | 0<<22 - - case AEXTR: - return S64 | 0<<29 | 0x27<<23 | 1<<22 | 0<<21 - - case AEXTRW: - return S32 | 0<<29 | 0x27<<23 | 0<<22 | 0<<21 - - case ACBNZ: - return S64 | 0x1A<<25 | 1<<24 - - case ACBNZW: - return S32 | 0x1A<<25 | 1<<24 - - case ACBZ: - return S64 | 0x1A<<25 | 0<<24 - - case ACBZW: - return S32 | 0x1A<<25 | 0<<24 - - case ACCMN: - return S64 | 0<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 /* imm5<<16 | cond<<12 | nzcv<<0 */ - - case ACCMNW: - return S32 | 0<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 - - case ACCMP: - return S64 | 1<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 /* imm5<<16 | cond<<12 | nzcv<<0 */ - - case ACCMPW: - return S32 | 1<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 - - case AMOVK: - return S64 | 3<<29 | 0x25<<23 - - case AMOVKW: - return S32 | 3<<29 | 0x25<<23 - - case AMOVN: - return S64 | 0<<29 | 0x25<<23 - - case AMOVNW: - return S32 | 0<<29 | 0x25<<23 - - case AMOVZ: - return S64 | 2<<29 | 0x25<<23 - - case AMOVZW: - return S32 | 2<<29 | 0x25<<23 - - case AMSR: - return SYSOP(0, 0, 0, 4, 0, 0, 0x1F) /* MSR (immediate) */ - - case AAT, - ADC, - AIC, - ATLBI, - ASYS: - return SYSOP(0, 1, 0, 0, 0, 0, 0) - - case ASYSL: - return SYSOP(1, 1, 0, 0, 0, 0, 0) - - case ATBZ: - return 0x36 << 24 - - case ATBNZ: - return 0x37 << 24 - - case ADSB: - return SYSOP(0, 0, 3, 3, 0, 4, 0x1F) - - case ADMB: - return SYSOP(0, 0, 3, 3, 0, 5, 0x1F) - - case AISB: - return SYSOP(0, 0, 3, 3, 0, 6, 0x1F) - - case AHINT: - return SYSOP(0, 0, 3, 2, 0, 0, 0x1F) - } - - ctxt.Diag("bad irr %v", a) - prasm(ctxt.Curp) - return 0 -} - -func opbit(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ACLS: - return S64 | OPBIT(5) - - case ACLSW: - return S32 | OPBIT(5) - - case ACLZ: - return S64 | OPBIT(4) - - case ACLZW: - return S32 | OPBIT(4) - - case ARBIT: - return S64 | OPBIT(0) - - case ARBITW: - return S32 | OPBIT(0) - - case AREV: - return S64 | OPBIT(3) - - case AREVW: - return S32 | OPBIT(2) - - case AREV16: - return S64 | OPBIT(1) - - case AREV16W: - return S32 | OPBIT(1) - - case AREV32: - return S64 | OPBIT(2) - - default: - ctxt.Diag("bad bit op\n%v", ctxt.Curp) - return 0 - } -} - -/* - * add/subtract extended register - */ -func opxrrr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AADD: - return S64 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 - - case AADDW: - return S32 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 - - case ACMN, AADDS: - return S64 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 - - case ACMNW, AADDSW: - return S32 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 - - case ASUB: - return S64 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 - - case ASUBW: - return S32 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 - - case ACMP, ASUBS: - return S64 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 - - case ACMPW, ASUBSW: - return S32 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 - } - - ctxt.Diag("bad opxrrr %v\n%v", a, ctxt.Curp) - return 0 -} - -func opimm(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ASVC: - return 0xD4<<24 | 0<<21 | 1 /* imm16<<5 */ - - case AHVC: - return 0xD4<<24 | 0<<21 | 2 - - case ASMC: - return 0xD4<<24 | 0<<21 | 3 - - case ABRK: - return 0xD4<<24 | 1<<21 | 0 - - case AHLT: - return 0xD4<<24 | 2<<21 | 0 - - case ADCPS1: - return 0xD4<<24 | 5<<21 | 1 - - case ADCPS2: - return 0xD4<<24 | 5<<21 | 2 - - case ADCPS3: - return 0xD4<<24 | 5<<21 | 3 - - case ACLREX: - return SYSOP(0, 0, 3, 3, 0, 2, 0x1F) - } - - ctxt.Diag("bad imm %v", a) - prasm(ctxt.Curp) - return 0 -} - -func brdist(ctxt *obj.Link, p *obj.Prog, preshift int, flen int, shift int) int64 { - v := int64(0) - t := int64(0) - if p.Pcond != nil { - v = (p.Pcond.Pc >> uint(preshift)) - (ctxt.Pc >> uint(preshift)) - if (v & ((1 << uint(shift)) - 1)) != 0 { - ctxt.Diag("misaligned label\n%v", p) - } - v >>= uint(shift) - t = int64(1) << uint(flen-1) - if v < -t || v >= t { - ctxt.Diag("branch too far %#x vs %#x [%p]\n%v\n%v", v, t, ctxt.Blitrl, p, p.Pcond) - panic("branch too far") - } - } - - return v & ((t << 1) - 1) -} - -/* - * pc-relative branches - */ -func opbra(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ABEQ: - return OPBcc(0x0) - - case ABNE: - return OPBcc(0x1) - - case ABCS: - return OPBcc(0x2) - - case ABHS: - return OPBcc(0x2) - - case ABCC: - return OPBcc(0x3) - - case ABLO: - return OPBcc(0x3) - - case ABMI: - return OPBcc(0x4) - - case ABPL: - return OPBcc(0x5) - - case ABVS: - return OPBcc(0x6) - - case ABVC: - return OPBcc(0x7) - - case ABHI: - return OPBcc(0x8) - - case ABLS: - return OPBcc(0x9) - - case ABGE: - return OPBcc(0xa) - - case ABLT: - return OPBcc(0xb) - - case ABGT: - return OPBcc(0xc) - - case ABLE: - return OPBcc(0xd) /* imm19<<5 | cond */ - - case AB: - return 0<<31 | 5<<26 /* imm26 */ - - case obj.ADUFFZERO, obj.ADUFFCOPY, ABL: - return 1<<31 | 5<<26 - } - - ctxt.Diag("bad bra %v", a) - prasm(ctxt.Curp) - return 0 -} - -func opbrr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ABL: - return OPBLR(1) /* BLR */ - - case AB: - return OPBLR(0) /* BR */ - - case obj.ARET: - return OPBLR(2) /* RET */ - } - - ctxt.Diag("bad brr %v", a) - prasm(ctxt.Curp) - return 0 -} - -func op0(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ADRPS: - return 0x6B<<25 | 5<<21 | 0x1F<<16 | 0x1F<<5 - - case AERET: - return 0x6B<<25 | 4<<21 | 0x1F<<16 | 0<<10 | 0x1F<<5 - - // case ANOP: - // return SYSHINT(0) - - case AYIELD: - return SYSHINT(1) - - case AWFE: - return SYSHINT(2) - - case AWFI: - return SYSHINT(3) - - case ASEV: - return SYSHINT(4) - - case ASEVL: - return SYSHINT(5) - } - - ctxt.Diag("bad op0 %v", a) - prasm(ctxt.Curp) - return 0 -} - -/* - * register offset - */ -func opload(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ALDAR: - return LDSTX(3, 1, 1, 0, 1) | 0x1F<<10 - - case ALDARW: - return LDSTX(2, 1, 1, 0, 1) | 0x1F<<10 - - case ALDARB: - return LDSTX(0, 1, 1, 0, 1) | 0x1F<<10 - - case ALDARH: - return LDSTX(1, 1, 1, 0, 1) | 0x1F<<10 - - case ALDAXP: - return LDSTX(3, 0, 1, 1, 1) - - case ALDAXPW: - return LDSTX(2, 0, 1, 1, 1) - - case ALDAXR: - return LDSTX(3, 0, 1, 0, 1) | 0x1F<<10 - - case ALDAXRW: - return LDSTX(2, 0, 1, 0, 1) | 0x1F<<10 - - case ALDAXRB: - return LDSTX(0, 0, 1, 0, 1) | 0x1F<<10 - - case ALDAXRH: - return LDSTX(1, 0, 1, 0, 1) | 0x1F<<10 - - case ALDXR: - return LDSTX(3, 0, 1, 0, 0) | 0x1F<<10 - - case ALDXRB: - return LDSTX(0, 0, 1, 0, 0) | 0x1F<<10 - - case ALDXRH: - return LDSTX(1, 0, 1, 0, 0) | 0x1F<<10 - - case ALDXRW: - return LDSTX(2, 0, 1, 0, 0) | 0x1F<<10 - - case ALDXP: - return LDSTX(3, 0, 1, 1, 0) - - case ALDXPW: - return LDSTX(2, 0, 1, 1, 0) - - case AMOVNP: - return S64 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 - - case AMOVNPW: - return S32 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 - } - - ctxt.Diag("bad opload %v\n%v", a, ctxt.Curp) - return 0 -} - -func opstore(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ASTLR: - return LDSTX(3, 1, 0, 0, 1) | 0x1F<<10 - - case ASTLRB: - return LDSTX(0, 1, 0, 0, 1) | 0x1F<<10 - - case ASTLRH: - return LDSTX(1, 1, 0, 0, 1) | 0x1F<<10 - - case ASTLP: - return LDSTX(3, 0, 0, 1, 1) - - case ASTLPW: - return LDSTX(2, 0, 0, 1, 1) - - case ASTLRW: - return LDSTX(2, 1, 0, 0, 1) | 0x1F<<10 - - case ASTLXP: - return LDSTX(2, 0, 0, 1, 1) - - case ASTLXPW: - return LDSTX(3, 0, 0, 1, 1) - - case ASTLXR: - return LDSTX(3, 0, 0, 0, 1) | 0x1F<<10 - - case ASTLXRB: - return LDSTX(0, 0, 0, 0, 1) | 0x1F<<10 - - case ASTLXRH: - return LDSTX(1, 0, 0, 0, 1) | 0x1F<<10 - - case ASTLXRW: - return LDSTX(2, 0, 0, 0, 1) | 0x1F<<10 - - case ASTXR: - return LDSTX(3, 0, 0, 0, 0) | 0x1F<<10 - - case ASTXRB: - return LDSTX(0, 0, 0, 0, 0) | 0x1F<<10 - - case ASTXRH: - return LDSTX(1, 0, 0, 0, 0) | 0x1F<<10 - - case ASTXP: - return LDSTX(3, 0, 0, 1, 0) - - case ASTXPW: - return LDSTX(2, 0, 0, 1, 0) - - case ASTXRW: - return LDSTX(2, 0, 0, 0, 0) | 0x1F<<10 - - case AMOVNP: - return S64 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 - - case AMOVNPW: - return S32 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 - } - - ctxt.Diag("bad opstore %v\n%v", a, ctxt.Curp) - return 0 -} - -/* - * load/store register (unsigned immediate) C3.3.13 - * these produce 64-bit values (when there's an option) - */ -func olsr12u(ctxt *obj.Link, o int32, v int32, b int, r int) uint32 { - if v < 0 || v >= (1<<12) { - ctxt.Diag("offset out of range: %d\n%v", v, ctxt.Curp) - } - o |= (v & 0xFFF) << 10 - o |= int32(b&31) << 5 - o |= int32(r & 31) - return uint32(o) -} - -func opldr12(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVD: - return LDSTR12U(3, 0, 1) /* imm12<<10 | Rn<<5 | Rt */ - - case AMOVW: - return LDSTR12U(2, 0, 2) - - case AMOVWU: - return LDSTR12U(2, 0, 1) - - case AMOVH: - return LDSTR12U(1, 0, 2) - - case AMOVHU: - return LDSTR12U(1, 0, 1) - - case AMOVB: - return LDSTR12U(0, 0, 2) - - case AMOVBU: - return LDSTR12U(0, 0, 1) - - case AFMOVS: - return LDSTR12U(2, 1, 1) - - case AFMOVD: - return LDSTR12U(3, 1, 1) - } - - ctxt.Diag("bad opldr12 %v\n%v", a, ctxt.Curp) - return 0 -} - -func opstr12(ctxt *obj.Link, a obj.As) uint32 { - return LD2STR(opldr12(ctxt, a)) -} - -/* - * load/store register (unscaled immediate) C3.3.12 - */ -func olsr9s(ctxt *obj.Link, o int32, v int32, b int, r int) uint32 { - if v < -256 || v > 255 { - ctxt.Diag("offset out of range: %d\n%v", v, ctxt.Curp) - } - o |= (v & 0x1FF) << 12 - o |= int32(b&31) << 5 - o |= int32(r & 31) - return uint32(o) -} - -func opldr9(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVD: - return LDSTR9S(3, 0, 1) /* simm9<<12 | Rn<<5 | Rt */ - - case AMOVW: - return LDSTR9S(2, 0, 2) - - case AMOVWU: - return LDSTR9S(2, 0, 1) - - case AMOVH: - return LDSTR9S(1, 0, 2) - - case AMOVHU: - return LDSTR9S(1, 0, 1) - - case AMOVB: - return LDSTR9S(0, 0, 2) - - case AMOVBU: - return LDSTR9S(0, 0, 1) - - case AFMOVS: - return LDSTR9S(2, 1, 1) - - case AFMOVD: - return LDSTR9S(3, 1, 1) - } - - ctxt.Diag("bad opldr9 %v\n%v", a, ctxt.Curp) - return 0 -} - -func opstr9(ctxt *obj.Link, a obj.As) uint32 { - return LD2STR(opldr9(ctxt, a)) -} - -func opldrpp(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVD: - return 3<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 /* simm9<<12 | Rn<<5 | Rt */ - - case AMOVW: - return 2<<30 | 7<<27 | 0<<26 | 0<<24 | 2<<22 - - case AMOVWU: - return 2<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 - - case AMOVH: - return 1<<30 | 7<<27 | 0<<26 | 0<<24 | 2<<22 - - case AMOVHU: - return 1<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 - - case AMOVB: - return 0<<30 | 7<<27 | 0<<26 | 0<<24 | 2<<22 - - case AMOVBU: - return 0<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 - } - - ctxt.Diag("bad opldr %v\n%v", a, ctxt.Curp) - return 0 -} - -/* - * load/store register (extended register) - */ -func olsxrr(ctxt *obj.Link, as obj.As, rt int, r1 int, r2 int) uint32 { - ctxt.Diag("need load/store extended register\n%v", ctxt.Curp) - return 0xffffffff -} - -func oaddi(ctxt *obj.Link, o1 int32, v int32, r int, rt int) uint32 { - if (v & 0xFFF000) != 0 { - if v&0xFFF != 0 { - ctxt.Diag("%v misuses oaddi", ctxt.Curp) - } - v >>= 12 - o1 |= 1 << 22 - } - - o1 |= ((v & 0xFFF) << 10) | (int32(r&31) << 5) | int32(rt&31) - return uint32(o1) -} - -/* - * load a a literal value into dr - */ -func omovlit(ctxt *obj.Link, as obj.As, p *obj.Prog, a *obj.Addr, dr int) uint32 { - var o1 int32 - if p.Pcond == nil { /* not in literal pool */ - aclass(ctxt, a) - ctxt.Logf("omovlit add %d (%#x)\n", ctxt.Instoffset, uint64(ctxt.Instoffset)) - - /* TODO: could be clever, and use general constant builder */ - o1 = int32(opirr(ctxt, AADD)) - - v := int32(ctxt.Instoffset) - if v != 0 && (v&0xFFF) == 0 { - v >>= 12 - o1 |= 1 << 22 /* shift, by 12 */ - } - - o1 |= ((v & 0xFFF) << 10) | (REGZERO & 31 << 5) | int32(dr&31) - } else { - fp := 0 - w := 0 /* default: 32 bit, unsigned */ - switch as { - case AFMOVS: - fp = 1 - - case AFMOVD: - fp = 1 - w = 1 /* 64 bit simd&fp */ - - case AMOVD: - if p.Pcond.As == ADWORD { - w = 1 /* 64 bit */ - } else if p.Pcond.To.Offset < 0 { - w = 2 /* sign extend */ - } - - case AMOVB, AMOVH, AMOVW: - w = 2 /* 32 bit, sign-extended to 64 */ - break - } - - v := int32(brdist(ctxt, p, 0, 19, 2)) - o1 = (int32(w) << 30) | (int32(fp) << 26) | (3 << 27) - o1 |= (v & 0x7FFFF) << 5 - o1 |= int32(dr & 31) - } - - return uint32(o1) -} - -// load a constant (MOVCON or BITCON) in a into rt -func omovconst(ctxt *obj.Link, as obj.As, p *obj.Prog, a *obj.Addr, rt int) (o1 uint32) { - if c := oclass(a); c == C_BITCON || c == C_ABCON || c == C_ABCON0 { - // or $bitcon, REGZERO, rt - mode := 64 - var as1 obj.As - switch as { - case AMOVW: - as1 = AORRW - mode = 32 - case AMOVD: - as1 = AORR - } - o1 = opirr(ctxt, as1) - o1 |= bitconEncode(uint64(a.Offset), mode) | uint32(REGZERO&31)<<5 | uint32(rt&31) - return o1 - } - - r := 32 - if as == AMOVD { - r = 64 - } - d := a.Offset - s := movcon(d) - if s < 0 || s >= r { - d = ^d - s = movcon(d) - if s < 0 || s >= r { - ctxt.Diag("impossible move wide: %#x\n%v", uint64(a.Offset), p) - } - if as == AMOVD { - o1 = opirr(ctxt, AMOVN) - } else { - o1 = opirr(ctxt, AMOVNW) - } - } else { - if as == AMOVD { - o1 = opirr(ctxt, AMOVZ) - } else { - o1 = opirr(ctxt, AMOVZW) - } - } - o1 |= uint32((((d >> uint(s*16)) & 0xFFFF) << 5) | int64((uint32(s)&3)<<21) | int64(rt&31)) - return o1 -} - -func opbfm(ctxt *obj.Link, a obj.As, r int, s int, rf int, rt int) uint32 { - var c uint32 - o := opirr(ctxt, a) - if (o & (1 << 31)) == 0 { - c = 32 - } else { - c = 64 - } - if r < 0 || uint32(r) >= c { - ctxt.Diag("illegal bit number\n%v", ctxt.Curp) - } - o |= (uint32(r) & 0x3F) << 16 - if s < 0 || uint32(s) >= c { - ctxt.Diag("illegal bit number\n%v", ctxt.Curp) - } - o |= (uint32(s) & 0x3F) << 10 - o |= (uint32(rf&31) << 5) | uint32(rt&31) - return o -} - -func opextr(ctxt *obj.Link, a obj.As, v int32, rn int, rm int, rt int) uint32 { - var c uint32 - o := opirr(ctxt, a) - if (o & (1 << 31)) != 0 { - c = 63 - } else { - c = 31 - } - if v < 0 || uint32(v) > c { - ctxt.Diag("illegal bit number\n%v", ctxt.Curp) - } - o |= uint32(v) << 10 - o |= uint32(rn&31) << 5 - o |= uint32(rm&31) << 16 - o |= uint32(rt & 31) - return o -} - -/* - * size in log2(bytes) - */ -func movesize(a obj.As) int { - switch a { - case AMOVD: - return 3 - - case AMOVW, AMOVWU: - return 2 - - case AMOVH, AMOVHU: - return 1 - - case AMOVB, AMOVBU: - return 0 - - case AFMOVS: - return 2 - - case AFMOVD: - return 3 - - default: - return -1 - } -} diff --git a/vendor/github.com/google/gops/internal/obj/arm64/list7.go b/vendor/github.com/google/gops/internal/obj/arm64/list7.go deleted file mode 100644 index 01971b85..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm64/list7.go +++ /dev/null @@ -1,115 +0,0 @@ -// cmd/7l/list.c and cmd/7l/sub.c from Vita Nuova. -// https://code.google.com/p/ken-cc/source/browse/ -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm64 - -import ( - "fmt" - - "github.com/google/gops/internal/obj" -) - -var strcond = [16]string{ - "EQ", - "NE", - "HS", - "LO", - "MI", - "PL", - "VS", - "VC", - "HI", - "LS", - "GE", - "LT", - "GT", - "LE", - "AL", - "NV", -} - -func init() { - obj.RegisterRegister(obj.RBaseARM64, REG_SPECIAL+1024, Rconv) - obj.RegisterOpcode(obj.ABaseARM64, Anames) -} - -func Rconv(r int) string { - if r == REGG { - return "g" - } - switch { - case REG_R0 <= r && r <= REG_R30: - return fmt.Sprintf("R%d", r-REG_R0) - case r == REG_R31: - return "ZR" - case REG_F0 <= r && r <= REG_F31: - return fmt.Sprintf("F%d", r-REG_F0) - case REG_V0 <= r && r <= REG_V31: - return fmt.Sprintf("V%d", r-REG_V0) - case COND_EQ <= r && r <= COND_NV: - return strcond[r-COND_EQ] - case r == REGSP: - return "RSP" - case r == REG_DAIF: - return "DAIF" - case r == REG_NZCV: - return "NZCV" - case r == REG_FPSR: - return "FPSR" - case r == REG_FPCR: - return "FPCR" - case r == REG_SPSR_EL1: - return "SPSR_EL1" - case r == REG_ELR_EL1: - return "ELR_EL1" - case r == REG_SPSR_EL2: - return "SPSR_EL2" - case r == REG_ELR_EL2: - return "ELR_EL2" - case r == REG_CurrentEL: - return "CurrentEL" - case r == REG_SP_EL0: - return "SP_EL0" - case r == REG_SPSel: - return "SPSel" - case r == REG_DAIFSet: - return "DAIFSet" - case r == REG_DAIFClr: - return "DAIFClr" - } - return fmt.Sprintf("badreg(%d)", r) -} - -func DRconv(a int) string { - if a >= C_NONE && a <= C_NCLASS { - return cnames7[a] - } - return "C_??" -} diff --git a/vendor/github.com/google/gops/internal/obj/arm64/obj7.go b/vendor/github.com/google/gops/internal/obj/arm64/obj7.go deleted file mode 100644 index 2d9d1aa7..00000000 --- a/vendor/github.com/google/gops/internal/obj/arm64/obj7.go +++ /dev/null @@ -1,1005 +0,0 @@ -// cmd/7l/noop.c, cmd/7l/obj.c, cmd/ld/pass.c from Vita Nuova. -// https://code.google.com/p/ken-cc/source/browse/ -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package arm64 - -import ( - "fmt" - "log" - "math" - - "github.com/google/gops/internal/obj" - "github.com/google/gops/internal/sys" -) - -var complements = []obj.As{ - AADD: ASUB, - AADDW: ASUBW, - ASUB: AADD, - ASUBW: AADDW, - ACMP: ACMN, - ACMPW: ACMNW, - ACMN: ACMP, - ACMNW: ACMPW, -} - -func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { - // MOV g_stackguard(g), R1 - p = obj.Appendp(ctxt, p) - - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - - q := (*obj.Prog)(nil) - if framesize <= obj.StackSmall { - // small stack: SP < stackguard - // MOV SP, R2 - // CMP stackguard, R2 - p = obj.Appendp(ctxt, p) - - p.As = AMOVD - p.From.Type = obj.TYPE_REG - p.From.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.Reg = REG_R2 - } else if framesize <= obj.StackBig { - // large stack: SP-framesize < stackguard-StackSmall - // SUB $framesize, SP, R2 - // CMP stackguard, R2 - p = obj.Appendp(ctxt, p) - - p.As = ASUB - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.Reg = REG_R2 - } else { - // Such a large stack we need to protect against wraparound - // if SP is close to zero. - // SP-stackguard+StackGuard < framesize + (StackGuard-StackSmall) - // The +StackGuard on both sides is required to keep the left side positive: - // SP is allowed to be slightly below stackguard. See stack.h. - // CMP $StackPreempt, R1 - // BEQ label_of_call_to_morestack - // ADD $StackGuard, SP, R2 - // SUB R1, R2 - // MOV $(framesize+(StackGuard-StackSmall)), R3 - // CMP R3, R2 - p = obj.Appendp(ctxt, p) - - p.As = ACMP - p.From.Type = obj.TYPE_CONST - p.From.Offset = obj.StackPreempt - p.Reg = REG_R1 - - p = obj.Appendp(ctxt, p) - q = p - p.As = ABEQ - p.To.Type = obj.TYPE_BRANCH - - p = obj.Appendp(ctxt, p) - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = obj.StackGuard - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = ASUB - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + (obj.StackGuard - obj.StackSmall) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R3 - - p = obj.Appendp(ctxt, p) - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.Reg = REG_R2 - } - - // BLS do-morestack - bls := obj.Appendp(ctxt, p) - bls.As = ABLS - bls.To.Type = obj.TYPE_BRANCH - - var last *obj.Prog - for last = ctxt.Cursym.Text; last.Link != nil; last = last.Link { - } - - // Now we are at the end of the function, but logically - // we are still in function prologue. We need to fix the - // SP data and PCDATA. - spfix := obj.Appendp(ctxt, last) - spfix.As = obj.ANOP - spfix.Spadj = -framesize - - pcdata := obj.Appendp(ctxt, spfix) - pcdata.Lineno = ctxt.Cursym.Text.Lineno - pcdata.Mode = ctxt.Cursym.Text.Mode - pcdata.As = obj.APCDATA - pcdata.From.Type = obj.TYPE_CONST - pcdata.From.Offset = obj.PCDATA_StackMapIndex - pcdata.To.Type = obj.TYPE_CONST - pcdata.To.Offset = -1 // pcdata starts at -1 at function entry - - // MOV LR, R3 - movlr := obj.Appendp(ctxt, pcdata) - movlr.As = AMOVD - movlr.From.Type = obj.TYPE_REG - movlr.From.Reg = REGLINK - movlr.To.Type = obj.TYPE_REG - movlr.To.Reg = REG_R3 - if q != nil { - q.Pcond = movlr - } - bls.Pcond = movlr - - debug := movlr - if false { - debug = obj.Appendp(ctxt, debug) - debug.As = AMOVD - debug.From.Type = obj.TYPE_CONST - debug.From.Offset = int64(framesize) - debug.To.Type = obj.TYPE_REG - debug.To.Reg = REGTMP - } - - // BL runtime.morestack(SB) - call := obj.Appendp(ctxt, debug) - call.As = ABL - call.To.Type = obj.TYPE_BRANCH - morestack := "runtime.morestack" - switch { - case ctxt.Cursym.CFunc(): - morestack = "runtime.morestackc" - case ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0: - morestack = "runtime.morestack_noctxt" - } - call.To.Sym = obj.Linklookup(ctxt, morestack, 0) - - // B start - jmp := obj.Appendp(ctxt, call) - jmp.As = AB - jmp.To.Type = obj.TYPE_BRANCH - jmp.Pcond = ctxt.Cursym.Text.Link - jmp.Spadj = +framesize - - // placeholder for bls's jump target - // p = obj.Appendp(ctxt, p) - // p.As = obj.ANOP - - return bls -} - -func progedit(ctxt *obj.Link, p *obj.Prog) { - p.From.Class = 0 - p.To.Class = 0 - - // $0 results in C_ZCON, which matches both C_REG and various - // C_xCON, however the C_REG cases in asmout don't expect a - // constant, so they will use the register fields and assemble - // a R0. To prevent that, rewrite $0 as ZR. - if p.From.Type == obj.TYPE_CONST && p.From.Offset == 0 { - p.From.Type = obj.TYPE_REG - p.From.Reg = REGZERO - } - if p.To.Type == obj.TYPE_CONST && p.To.Offset == 0 { - p.To.Type = obj.TYPE_REG - p.To.Reg = REGZERO - } - - // Rewrite BR/BL to symbol as TYPE_BRANCH. - switch p.As { - case AB, - ABL, - obj.ARET, - obj.ADUFFZERO, - obj.ADUFFCOPY: - if p.To.Sym != nil { - p.To.Type = obj.TYPE_BRANCH - } - break - } - - // Rewrite float constants to values stored in memory. - switch p.As { - case AFMOVS: - if p.From.Type == obj.TYPE_FCONST { - f32 := float32(p.From.Val.(float64)) - i32 := math.Float32bits(f32) - if i32 == 0 { - p.From.Type = obj.TYPE_REG - p.From.Reg = REGZERO - break - } - literal := fmt.Sprintf("$f32.%08x", i32) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 4 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - case AFMOVD: - if p.From.Type == obj.TYPE_FCONST { - i64 := math.Float64bits(p.From.Val.(float64)) - if i64 == 0 { - p.From.Type = obj.TYPE_REG - p.From.Reg = REGZERO - break - } - literal := fmt.Sprintf("$f64.%016x", i64) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - break - } - - // Rewrite negative immediates as positive immediates with - // complementary instruction. - switch p.As { - case AADD, ASUB, ACMP, ACMN: - if p.From.Type == obj.TYPE_CONST && p.From.Offset < 0 && p.From.Offset != -1<<63 { - p.From.Offset = -p.From.Offset - p.As = complements[p.As] - } - case AADDW, ASUBW, ACMPW, ACMNW: - if p.From.Type == obj.TYPE_CONST && p.From.Offset < 0 && int32(p.From.Offset) != -1<<31 { - p.From.Offset = -p.From.Offset - p.As = complements[p.As] - } - } - - // For 32-bit logical instruction with constant, - // rewrite the high 32-bit to be a repetition of - // the low 32-bit, so that the BITCON test can be - // shared for both 32-bit and 64-bit. 32-bit ops - // will zero the high 32-bit of the destination - // register anyway. - switch p.As { - case AANDW, AORRW, AEORW, AANDSW: - if p.From.Type == obj.TYPE_CONST { - v := p.From.Offset & 0xffffffff - p.From.Offset = v | v<<32 - } - } - - if ctxt.Flag_dynlink { - rewriteToUseGot(ctxt, p) - } -} - -// Rewrite p, if necessary, to access global data via the global offset table. -func rewriteToUseGot(ctxt *obj.Link, p *obj.Prog) { - if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO { - // ADUFFxxx $offset - // becomes - // MOVD runtime.duffxxx@GOT, REGTMP - // ADD $offset, REGTMP - // CALL REGTMP - var sym *obj.LSym - if p.As == obj.ADUFFZERO { - sym = obj.Linklookup(ctxt, "runtime.duffzero", 0) - } else { - sym = obj.Linklookup(ctxt, "runtime.duffcopy", 0) - } - offset := p.To.Offset - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - p.From.Sym = sym - p.To.Type = obj.TYPE_REG - p.To.Reg = REGTMP - p.To.Name = obj.NAME_NONE - p.To.Offset = 0 - p.To.Sym = nil - p1 := obj.Appendp(ctxt, p) - p1.As = AADD - p1.From.Type = obj.TYPE_CONST - p1.From.Offset = offset - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REGTMP - p2 := obj.Appendp(ctxt, p1) - p2.As = obj.ACALL - p2.To.Type = obj.TYPE_REG - p2.To.Reg = REGTMP - } - - // We only care about global data: NAME_EXTERN means a global - // symbol in the Go sense, and p.Sym.Local is true for a few - // internally defined symbols. - if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - // MOVD $sym, Rx becomes MOVD sym@GOT, Rx - // MOVD $sym+, Rx becomes MOVD sym@GOT, Rx; ADD , Rx - if p.As != AMOVD { - ctxt.Diag("do not know how to handle TYPE_ADDR in %v with -dynlink", p) - } - if p.To.Type != obj.TYPE_REG { - ctxt.Diag("do not know how to handle LEAQ-type insn to non-register in %v with -dynlink", p) - } - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - if p.From.Offset != 0 { - q := obj.Appendp(ctxt, p) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = p.From.Offset - q.To = p.To - p.From.Offset = 0 - } - } - if p.From3 != nil && p.From3.Name == obj.NAME_EXTERN { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - var source *obj.Addr - // MOVx sym, Ry becomes MOVD sym@GOT, REGTMP; MOVx (REGTMP), Ry - // MOVx Ry, sym becomes MOVD sym@GOT, REGTMP; MOVD Ry, (REGTMP) - // An addition may be inserted between the two MOVs if there is an offset. - if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p) - } - source = &p.From - } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - source = &p.To - } else { - return - } - if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { - return - } - if source.Sym.Type == obj.STLSBSS { - return - } - if source.Type != obj.TYPE_MEM { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - p1 := obj.Appendp(ctxt, p) - p2 := obj.Appendp(ctxt, p1) - p1.As = AMOVD - p1.From.Type = obj.TYPE_MEM - p1.From.Sym = source.Sym - p1.From.Name = obj.NAME_GOTREF - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REGTMP - - p2.As = p.As - p2.From = p.From - p2.To = p.To - if p.From.Name == obj.NAME_EXTERN { - p2.From.Reg = REGTMP - p2.From.Name = obj.NAME_NONE - p2.From.Sym = nil - } else if p.To.Name == obj.NAME_EXTERN { - p2.To.Reg = REGTMP - p2.To.Name = obj.NAME_NONE - p2.To.Sym = nil - } else { - return - } - obj.Nopout(p) -} - -func follow(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - firstp := ctxt.NewProg() - lastp := firstp - xfol(ctxt, s.Text, &lastp) - lastp.Link = nil - s.Text = firstp.Link -} - -func relinv(a obj.As) obj.As { - switch a { - case ABEQ: - return ABNE - case ABNE: - return ABEQ - case ABCS: - return ABCC - case ABHS: - return ABLO - case ABCC: - return ABCS - case ABLO: - return ABHS - case ABMI: - return ABPL - case ABPL: - return ABMI - case ABVS: - return ABVC - case ABVC: - return ABVS - case ABHI: - return ABLS - case ABLS: - return ABHI - case ABGE: - return ABLT - case ABLT: - return ABGE - case ABGT: - return ABLE - case ABLE: - return ABGT - case ACBZ: - return ACBNZ - case ACBNZ: - return ACBZ - case ACBZW: - return ACBNZW - case ACBNZW: - return ACBZW - } - - log.Fatalf("unknown relation: %s", Anames[a-obj.ABaseARM64]) - return 0 -} - -func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { - var q *obj.Prog - var r *obj.Prog - var i int - -loop: - if p == nil { - return - } - a := p.As - if a == AB { - q = p.Pcond - if q != nil { - p.Mark |= FOLL - p = q - if !(p.Mark&FOLL != 0) { - goto loop - } - } - } - - if p.Mark&FOLL != 0 { - i = 0 - q = p - for ; i < 4; i, q = i+1, q.Link { - if q == *last || q == nil { - break - } - a = q.As - if a == obj.ANOP { - i-- - continue - } - - if a == AB || a == obj.ARET || a == AERET { - goto copy - } - if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { - continue - } - if a != ABEQ && a != ABNE { - continue - } - - copy: - for { - r = ctxt.NewProg() - *r = *p - if !(r.Mark&FOLL != 0) { - fmt.Printf("can't happen 1\n") - } - r.Mark |= FOLL - if p != q { - p = p.Link - (*last).Link = r - *last = r - continue - } - - (*last).Link = r - *last = r - if a == AB || a == obj.ARET || a == AERET { - return - } - if a == ABNE { - r.As = ABEQ - } else { - r.As = ABNE - } - r.Pcond = p.Link - r.Link = p.Pcond - if !(r.Link.Mark&FOLL != 0) { - xfol(ctxt, r.Link, last) - } - if !(r.Pcond.Mark&FOLL != 0) { - fmt.Printf("can't happen 2\n") - } - return - } - } - - a = AB - q = ctxt.NewProg() - q.As = a - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.To.Offset = p.Pc - q.Pcond = p - p = q - } - - p.Mark |= FOLL - (*last).Link = p - *last = p - if a == AB || a == obj.ARET || a == AERET { - return - } - if p.Pcond != nil { - if a != ABL && p.Link != nil { - q = obj.Brchain(ctxt, p.Link) - if a != obj.ATEXT { - if q != nil && (q.Mark&FOLL != 0) { - p.As = relinv(a) - p.Link = p.Pcond - p.Pcond = q - } - } - - xfol(ctxt, p.Link, last) - q = obj.Brchain(ctxt, p.Pcond) - if q == nil { - q = p.Pcond - } - if q.Mark&FOLL != 0 { - p.Pcond = q - return - } - - p = q - goto loop - } - } - - p = p.Link - goto loop -} - -func preprocess(ctxt *obj.Link, cursym *obj.LSym) { - ctxt.Cursym = cursym - - if cursym.Text == nil || cursym.Text.Link == nil { - return - } - - p := cursym.Text - textstksiz := p.To.Offset - aoffset := int32(textstksiz) - - cursym.Args = p.To.Val.(int32) - cursym.Locals = int32(textstksiz) - - /* - * find leaf subroutines - * strip NOPs - * expand RET - */ - q := (*obj.Prog)(nil) - var q1 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - switch p.As { - case obj.ATEXT: - p.Mark |= LEAF - - case obj.ARET: - break - - case obj.ANOP: - q1 = p.Link - q.Link = q1 /* q is non-nop */ - q1.Mark |= p.Mark - continue - - case ABL, - obj.ADUFFZERO, - obj.ADUFFCOPY: - cursym.Text.Mark &^= LEAF - fallthrough - - case ACBNZ, - ACBZ, - ACBNZW, - ACBZW, - ATBZ, - ATBNZ, - AB, - ABEQ, - ABNE, - ABCS, - ABHS, - ABCC, - ABLO, - ABMI, - ABPL, - ABVS, - ABVC, - ABHI, - ABLS, - ABGE, - ABLT, - ABGT, - ABLE, - AADR, /* strange */ - AADRP: - q1 = p.Pcond - - if q1 != nil { - for q1.As == obj.ANOP { - q1 = q1.Link - p.Pcond = q1 - } - } - - break - } - - q = p - } - - var q2 *obj.Prog - var retjmp *obj.LSym - for p := cursym.Text; p != nil; p = p.Link { - o := p.As - switch o { - case obj.ATEXT: - cursym.Text = p - if textstksiz < 0 { - ctxt.Autosize = 0 - } else { - ctxt.Autosize = int32(textstksiz + 8) - } - if (cursym.Text.Mark&LEAF != 0) && ctxt.Autosize <= 8 { - ctxt.Autosize = 0 - } else if ctxt.Autosize&(16-1) != 0 { - // The frame includes an LR. - // If the frame size is 8, it's only an LR, - // so there's no potential for breaking references to - // local variables by growing the frame size, - // because there are no local variables. - // But otherwise, if there is a non-empty locals section, - // the author of the code is responsible for making sure - // that the frame size is 8 mod 16. - if ctxt.Autosize == 8 { - ctxt.Autosize += 8 - cursym.Locals += 8 - } else { - ctxt.Diag("%v: unaligned frame size %d - must be 8 mod 16 (or 0)", p, ctxt.Autosize-8) - } - } - p.To.Offset = int64(ctxt.Autosize) - 8 - if ctxt.Autosize == 0 && !(cursym.Text.Mark&LEAF != 0) { - if ctxt.Debugvlog != 0 { - ctxt.Logf("save suppressed in: %s\n", cursym.Text.From.Sym.Name) - } - cursym.Text.Mark |= LEAF - } - - if !(p.From3.Offset&obj.NOSPLIT != 0) { - p = stacksplit(ctxt, p, ctxt.Autosize) // emit split check - } - - aoffset = ctxt.Autosize - if aoffset > 0xF0 { - aoffset = 0xF0 - } - if cursym.Text.Mark&LEAF != 0 { - cursym.Set(obj.AttrLeaf, true) - if ctxt.Autosize == 0 { - break - } - } - - // Frame is non-empty. Make sure to save link register, even if - // it is a leaf function, so that traceback works. - q = p - if ctxt.Autosize > aoffset { - // Frame size is too large for a MOVD.W instruction. - // Store link register before decrementing SP, so if a signal comes - // during the execution of the function prologue, the traceback - // code will not see a half-updated stack frame. - q = obj.Appendp(ctxt, q) - q.Lineno = p.Lineno - q.As = ASUB - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(ctxt.Autosize) - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REGTMP - - q = obj.Appendp(ctxt, q) - q.Lineno = p.Lineno - q.As = AMOVD - q.From.Type = obj.TYPE_REG - q.From.Reg = REGLINK - q.To.Type = obj.TYPE_MEM - q.To.Reg = REGTMP - - q1 = obj.Appendp(ctxt, q) - q1.Lineno = p.Lineno - q1.As = AMOVD - q1.From.Type = obj.TYPE_REG - q1.From.Reg = REGTMP - q1.To.Type = obj.TYPE_REG - q1.To.Reg = REGSP - q1.Spadj = ctxt.Autosize - } else { - // small frame, update SP and save LR in a single MOVD.W instruction - q1 = obj.Appendp(ctxt, q) - q1.As = AMOVD - q1.Lineno = p.Lineno - q1.From.Type = obj.TYPE_REG - q1.From.Reg = REGLINK - q1.To.Type = obj.TYPE_MEM - q1.Scond = C_XPRE - q1.To.Offset = int64(-aoffset) - q1.To.Reg = REGSP - q1.Spadj = aoffset - } - - if cursym.Text.From3.Offset&obj.WRAPPER != 0 { - // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame - // - // MOV g_panic(g), R1 - // CMP ZR, R1 - // BEQ end - // MOV panic_argp(R1), R2 - // ADD $(autosize+8), RSP, R3 - // CMP R2, R3 - // BNE end - // ADD $8, RSP, R4 - // MOVD R4, panic_argp(R1) - // end: - // NOP - // - // The NOP is needed to give the jumps somewhere to land. - // It is a liblink NOP, not a ARM64 NOP: it encodes to 0 instruction bytes. - q = q1 - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_MEM - q.From.Reg = REGG - q.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R1 - - q = obj.Appendp(ctxt, q) - q.As = ACMP - q.From.Type = obj.TYPE_REG - q.From.Reg = REGZERO - q.Reg = REG_R1 - - q = obj.Appendp(ctxt, q) - q.As = ABEQ - q.To.Type = obj.TYPE_BRANCH - q1 = q - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_MEM - q.From.Reg = REG_R1 - q.From.Offset = 0 // Panic.argp - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R2 - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(ctxt.Autosize) + 8 - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R3 - - q = obj.Appendp(ctxt, q) - q.As = ACMP - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R2 - q.Reg = REG_R3 - - q = obj.Appendp(ctxt, q) - q.As = ABNE - q.To.Type = obj.TYPE_BRANCH - q2 = q - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = 8 - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R4 - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R4 - q.To.Type = obj.TYPE_MEM - q.To.Reg = REG_R1 - q.To.Offset = 0 // Panic.argp - - q = obj.Appendp(ctxt, q) - - q.As = obj.ANOP - q1.Pcond = q - q2.Pcond = q - } - - case obj.ARET: - nocache(p) - if p.From.Type == obj.TYPE_CONST { - ctxt.Diag("using BECOME (%v) is not supported!", p) - break - } - - retjmp = p.To.Sym - p.To = obj.Addr{} - if cursym.Text.Mark&LEAF != 0 { - if ctxt.Autosize != 0 { - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(ctxt.Autosize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REGSP - p.Spadj = -ctxt.Autosize - } - } else { - /* want write-back pre-indexed SP+autosize -> SP, loading REGLINK*/ - aoffset = ctxt.Autosize - - if aoffset > 0xF0 { - aoffset = 0xF0 - } - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.Scond = C_XPOST - p.From.Offset = int64(aoffset) - p.From.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REGLINK - p.Spadj = -aoffset - if ctxt.Autosize > aoffset { - q = ctxt.NewProg() - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(ctxt.Autosize) - int64(aoffset) - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Link = p.Link - q.Spadj = int32(-q.From.Offset) - q.Lineno = p.Lineno - p.Link = q - p = q - } - } - - if p.As != obj.ARET { - q = ctxt.NewProg() - q.Lineno = p.Lineno - q.Link = p.Link - p.Link = q - p = q - } - - if retjmp != nil { // retjmp - p.As = AB - p.To.Type = obj.TYPE_BRANCH - p.To.Sym = retjmp - p.Spadj = +ctxt.Autosize - break - } - - p.As = obj.ARET - p.To.Type = obj.TYPE_MEM - p.To.Offset = 0 - p.To.Reg = REGLINK - p.Spadj = +ctxt.Autosize - - case AADD, ASUB: - if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { - if p.As == AADD { - p.Spadj = int32(-p.From.Offset) - } else { - p.Spadj = int32(+p.From.Offset) - } - } - break - } - } -} - -func nocache(p *obj.Prog) { - p.Optab = 0 - p.From.Class = 0 - p.To.Class = 0 -} - -var unaryDst = map[obj.As]bool{ - AWORD: true, - ADWORD: true, - ABL: true, - AB: true, - ASVC: true, -} - -var Linkarm64 = obj.LinkArch{ - Arch: sys.ArchARM64, - Preprocess: preprocess, - Assemble: span7, - Follow: follow, - Progedit: progedit, - UnaryDst: unaryDst, -} diff --git a/vendor/github.com/google/gops/internal/obj/data.go b/vendor/github.com/google/gops/internal/obj/data.go deleted file mode 100644 index 0ccb053f..00000000 --- a/vendor/github.com/google/gops/internal/obj/data.go +++ /dev/null @@ -1,190 +0,0 @@ -// Derived from Inferno utils/6l/obj.c and utils/6l/span.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/obj.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/span.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package obj - -import ( - "log" - "math" -) - -// Grow increases the length of s.P to lsiz. -func (s *LSym) Grow(lsiz int64) { - siz := int(lsiz) - if int64(siz) != lsiz { - log.Fatalf("LSym.Grow size %d too long", lsiz) - } - if len(s.P) >= siz { - return - } - // TODO(dfc) append cap-len at once, rather than - // one byte at a time. - for cap(s.P) < siz { - s.P = append(s.P[:cap(s.P)], 0) - } - s.P = s.P[:siz] -} - -// GrowCap increases the capacity of s.P to c. -func (s *LSym) GrowCap(c int64) { - if int64(cap(s.P)) >= c { - return - } - if s.P == nil { - s.P = make([]byte, 0, c) - return - } - b := make([]byte, len(s.P), c) - copy(b, s.P) - s.P = b -} - -// prepwrite prepares to write data of size siz into s at offset off. -func (s *LSym) prepwrite(ctxt *Link, off int64, siz int) { - if off < 0 || siz < 0 || off >= 1<<30 { - log.Fatalf("prepwrite: bad off=%d siz=%d", off, siz) - } - if s.Type == SBSS || s.Type == STLSBSS { - ctxt.Diag("cannot supply data for BSS var") - } - l := off + int64(siz) - s.Grow(l) - if l > s.Size { - s.Size = l - } -} - -// WriteFloat32 writes f into s at offset off. -func (s *LSym) WriteFloat32(ctxt *Link, off int64, f float32) { - s.prepwrite(ctxt, off, 4) - ctxt.Arch.ByteOrder.PutUint32(s.P[off:], math.Float32bits(f)) -} - -// WriteFloat64 writes f into s at offset off. -func (s *LSym) WriteFloat64(ctxt *Link, off int64, f float64) { - s.prepwrite(ctxt, off, 8) - ctxt.Arch.ByteOrder.PutUint64(s.P[off:], math.Float64bits(f)) -} - -// WriteInt writes an integer i of size siz into s at offset off. -func (s *LSym) WriteInt(ctxt *Link, off int64, siz int, i int64) { - s.prepwrite(ctxt, off, siz) - switch siz { - default: - ctxt.Diag("WriteInt: bad integer size: %d", siz) - case 1: - s.P[off] = byte(i) - case 2: - ctxt.Arch.ByteOrder.PutUint16(s.P[off:], uint16(i)) - case 4: - ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(i)) - case 8: - ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(i)) - } -} - -// WriteAddr writes an address of size siz into s at offset off. -// rsym and roff specify the relocation for the address. -func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) { - if siz != ctxt.Arch.PtrSize { - ctxt.Diag("WriteAddr: bad address size %d in %s", siz, s.Name) - } - s.prepwrite(ctxt, off, siz) - r := Addrel(s) - r.Off = int32(off) - if int64(r.Off) != off { - ctxt.Diag("WriteAddr: off overflow %d in %s", off, s.Name) - } - r.Siz = uint8(siz) - r.Sym = rsym - r.Type = R_ADDR - r.Add = roff -} - -// WriteOff writes a 4 byte offset to rsym+roff into s at offset off. -// After linking the 4 bytes stored at s+off will be -// rsym+roff-(start of section that s is in). -func (s *LSym) WriteOff(ctxt *Link, off int64, rsym *LSym, roff int64) { - s.prepwrite(ctxt, off, 4) - r := Addrel(s) - r.Off = int32(off) - if int64(r.Off) != off { - ctxt.Diag("WriteOff: off overflow %d in %s", off, s.Name) - } - r.Siz = 4 - r.Sym = rsym - r.Type = R_ADDROFF - r.Add = roff -} - -// WriteString writes a string of size siz into s at offset off. -func (s *LSym) WriteString(ctxt *Link, off int64, siz int, str string) { - if siz < len(str) { - ctxt.Diag("WriteString: bad string size: %d < %d", siz, len(str)) - } - s.prepwrite(ctxt, off, siz) - copy(s.P[off:off+int64(siz)], str) -} - -// WriteBytes writes a slice of bytes into s at offset off. -func (s *LSym) WriteBytes(ctxt *Link, off int64, b []byte) int64 { - s.prepwrite(ctxt, off, len(b)) - copy(s.P[off:], b) - return off + int64(len(b)) -} - -func Addrel(s *LSym) *Reloc { - s.R = append(s.R, Reloc{}) - return &s.R[len(s.R)-1] -} - -func Setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 { - if s.Type == 0 { - s.Type = SDATA - } - if s.Size < off+wid { - s.Size = off + wid - s.Grow(s.Size) - } - - switch wid { - case 1: - s.P[off] = uint8(v) - case 2: - ctxt.Arch.ByteOrder.PutUint16(s.P[off:], uint16(v)) - case 4: - ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(v)) - case 8: - ctxt.Arch.ByteOrder.PutUint64(s.P[off:], v) - } - - return off + wid -} diff --git a/vendor/github.com/google/gops/internal/obj/flag.go b/vendor/github.com/google/gops/internal/obj/flag.go deleted file mode 100644 index ff69fd9d..00000000 --- a/vendor/github.com/google/gops/internal/obj/flag.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -import ( - "flag" - "fmt" - "os" - "strconv" -) - -func Flagfn2(string, string, func(string, string)) { panic("flag") } - -func Flagcount(name, usage string, val *int) { - flag.Var((*count)(val), name, usage) -} - -func Flagint32(name, usage string, val *int32) { - flag.Var((*int32Value)(val), name, usage) -} - -func Flagint64(name, usage string, val *int64) { - flag.Int64Var(val, name, *val, usage) -} - -func Flagstr(name, usage string, val *string) { - flag.StringVar(val, name, *val, usage) -} - -func Flagfn0(name, usage string, f func()) { - flag.Var(fn0(f), name, usage) -} - -func Flagfn1(name, usage string, f func(string)) { - flag.Var(fn1(f), name, usage) -} - -func Flagprint(fd int) { - if fd == 1 { - flag.CommandLine.SetOutput(os.Stdout) - } - flag.PrintDefaults() -} - -func Flagparse(usage func()) { - flag.Usage = usage - flag.Parse() -} - -// count is a flag.Value that is like a flag.Bool and a flag.Int. -// If used as -name, it increments the count, but -name=x sets the count. -// Used for verbose flag -v. -type count int - -func (c *count) String() string { - return fmt.Sprint(int(*c)) -} - -func (c *count) Set(s string) error { - switch s { - case "true": - *c++ - case "false": - *c = 0 - default: - n, err := strconv.Atoi(s) - if err != nil { - return fmt.Errorf("invalid count %q", s) - } - *c = count(n) - } - return nil -} - -func (c *count) IsBoolFlag() bool { - return true -} - -type int32Value int32 - -func (i *int32Value) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 64) - *i = int32Value(v) - return err -} - -func (i *int32Value) Get() interface{} { return int32(*i) } - -func (i *int32Value) String() string { return fmt.Sprint(*i) } - -type fn0 func() - -func (f fn0) Set(s string) error { - f() - return nil -} - -func (f fn0) Get() interface{} { return nil } - -func (f fn0) String() string { return "" } - -func (f fn0) IsBoolFlag() bool { - return true -} - -type fn1 func(string) - -func (f fn1) Set(s string) error { - f(s) - return nil -} - -func (f fn1) String() string { return "" } diff --git a/vendor/github.com/google/gops/internal/obj/funcdata.go b/vendor/github.com/google/gops/internal/obj/funcdata.go deleted file mode 100644 index 62256a3e..00000000 --- a/vendor/github.com/google/gops/internal/obj/funcdata.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -// This file defines the IDs for PCDATA and FUNCDATA instructions -// in Go binaries. It is included by assembly sources, so it must -// be written using #defines. -// -// The Go compiler also #includes this file, for now. -// -// symtab.go also contains a copy of these constants. - -// Pseudo-assembly statements. - -// GO_ARGS, GO_RESULTS_INITIALIZED, and NO_LOCAL_POINTERS are macros -// that communicate to the runtime information about the location and liveness -// of pointers in an assembly function's arguments, results, and stack frame. -// This communication is only required in assembly functions that make calls -// to other functions that might be preempted or grow the stack. -// NOSPLIT functions that make no calls do not need to use these macros. - -// GO_ARGS indicates that the Go prototype for this assembly function -// defines the pointer map for the function's arguments. -// GO_ARGS should be the first instruction in a function that uses it. -// It can be omitted if there are no arguments at all. -// GO_ARGS is inserted implicitly by the linker for any function -// that also has a Go prototype and therefore is usually not necessary -// to write explicitly. - -// GO_RESULTS_INITIALIZED indicates that the assembly function -// has initialized the stack space for its results and that those results -// should be considered live for the remainder of the function. - -// NO_LOCAL_POINTERS indicates that the assembly function stores -// no pointers to heap objects in its local stack variables. - -// ArgsSizeUnknown is set in Func.argsize to mark all functions -// whose argument size is unknown (C vararg functions, and -// assembly code without an explicit specification). -// This value is generated by the compiler, assembler, or linker. -const ( - PCDATA_StackMapIndex = 0 - FUNCDATA_ArgsPointerMaps = 0 - FUNCDATA_LocalsPointerMaps = 1 - ArgsSizeUnknown = -0x80000000 -) diff --git a/vendor/github.com/google/gops/internal/obj/go.go b/vendor/github.com/google/gops/internal/obj/go.go deleted file mode 100644 index 1852dc74..00000000 --- a/vendor/github.com/google/gops/internal/obj/go.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -import ( - "fmt" - "os" - "strings" -) - -// go-specific code shared across loaders (5l, 6l, 8l). - -var ( - framepointer_enabled int - Fieldtrack_enabled int -) - -// Toolchain experiments. -// These are controlled by the GOEXPERIMENT environment -// variable recorded when the toolchain is built. -// This list is also known to cmd/gc. -var exper = []struct { - name string - val *int -}{ - {"fieldtrack", &Fieldtrack_enabled}, - {"framepointer", &framepointer_enabled}, -} - -func addexp(s string) { - // Could do general integer parsing here, but the runtime copy doesn't yet. - v := 1 - name := s - if len(name) > 2 && name[:2] == "no" { - v = 0 - name = name[2:] - } - for i := 0; i < len(exper); i++ { - if exper[i].name == name { - if exper[i].val != nil { - *exper[i].val = v - } - return - } - } - - fmt.Printf("unknown experiment %s\n", s) - os.Exit(2) -} - -func init() { - framepointer_enabled = 1 // default - for _, f := range strings.Split(goexperiment, ",") { - if f != "" { - addexp(f) - } - } -} - -func Framepointer_enabled(goos, goarch string) bool { - return framepointer_enabled != 0 && goarch == "amd64" && goos != "nacl" -} - -func Nopout(p *Prog) { - p.As = ANOP - p.Scond = 0 - p.From = Addr{} - p.From3 = nil - p.Reg = 0 - p.To = Addr{} -} - -func Expstring() string { - buf := "X" - for i := range exper { - if *exper[i].val != 0 { - buf += "," + exper[i].name - } - } - if buf == "X" { - buf += ",none" - } - return "X:" + buf[2:] -} diff --git a/vendor/github.com/google/gops/internal/obj/ld.go b/vendor/github.com/google/gops/internal/obj/ld.go deleted file mode 100644 index 54fde2f2..00000000 --- a/vendor/github.com/google/gops/internal/obj/ld.go +++ /dev/null @@ -1,92 +0,0 @@ -// Derived from Inferno utils/6l/obj.c and utils/6l/span.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/obj.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/span.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package obj - -/* - * add library to library list. - * srcref: src file referring to package - * objref: object file referring to package - * file: object file, e.g., /home/rsc/go/pkg/container/vector.a - * pkg: package import path, e.g. container/vector - */ - -const ( - LOG = 5 -) - -func mkfwd(sym *LSym) { - var dwn [LOG]int32 - var cnt [LOG]int32 - var lst [LOG]*Prog - - for i := 0; i < LOG; i++ { - if i == 0 { - cnt[i] = 1 - } else { - cnt[i] = LOG * cnt[i-1] - } - dwn[i] = 1 - lst[i] = nil - } - - i := 0 - for p := sym.Text; p != nil && p.Link != nil; p = p.Link { - i-- - if i < 0 { - i = LOG - 1 - } - p.Forwd = nil - dwn[i]-- - if dwn[i] <= 0 { - dwn[i] = cnt[i] - if lst[i] != nil { - lst[i].Forwd = p - } - lst[i] = p - } - } -} - -func Copyp(ctxt *Link, q *Prog) *Prog { - p := ctxt.NewProg() - *p = *q - return p -} - -func Appendp(ctxt *Link, q *Prog) *Prog { - p := ctxt.NewProg() - p.Link = q.Link - q.Link = p - p.Lineno = q.Lineno - p.Mode = q.Mode - return p -} diff --git a/vendor/github.com/google/gops/internal/obj/link.go b/vendor/github.com/google/gops/internal/obj/link.go deleted file mode 100644 index e2530615..00000000 --- a/vendor/github.com/google/gops/internal/obj/link.go +++ /dev/null @@ -1,974 +0,0 @@ -// Derived from Inferno utils/6l/l.h and related files. -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/l.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package obj - -import ( - "bufio" - "fmt" - - "github.com/google/gops/internal/sys" -) - -// An Addr is an argument to an instruction. -// The general forms and their encodings are: -// -// sym±offset(symkind)(reg)(index*scale) -// Memory reference at address &sym(symkind) + offset + reg + index*scale. -// Any of sym(symkind), ±offset, (reg), (index*scale), and *scale can be omitted. -// If (reg) and *scale are both omitted, the resulting expression (index) is parsed as (reg). -// To force a parsing as index*scale, write (index*1). -// Encoding: -// type = TYPE_MEM -// name = symkind (NAME_AUTO, ...) or 0 (NAME_NONE) -// sym = sym -// offset = ±offset -// reg = reg (REG_*) -// index = index (REG_*) -// scale = scale (1, 2, 4, 8) -// -// $ -// Effective address of memory reference , defined above. -// Encoding: same as memory reference, but type = TYPE_ADDR. -// -// $<±integer value> -// This is a special case of $, in which only ±offset is present. -// It has a separate type for easy recognition. -// Encoding: -// type = TYPE_CONST -// offset = ±integer value -// -// * -// Indirect reference through memory reference , defined above. -// Only used on x86 for CALL/JMP *sym(SB), which calls/jumps to a function -// pointer stored in the data word sym(SB), not a function named sym(SB). -// Encoding: same as above, but type = TYPE_INDIR. -// -// $*$ -// No longer used. -// On machines with actual SB registers, $*$ forced the -// instruction encoding to use a full 32-bit constant, never a -// reference relative to SB. -// -// $ -// Floating point constant value. -// Encoding: -// type = TYPE_FCONST -// val = floating point value -// -// $ -// String literal value (raw bytes used for DATA instruction). -// Encoding: -// type = TYPE_SCONST -// val = string -// -// -// Any register: integer, floating point, control, segment, and so on. -// If looking for specific register kind, must check type and reg value range. -// Encoding: -// type = TYPE_REG -// reg = reg (REG_*) -// -// x(PC) -// Encoding: -// type = TYPE_BRANCH -// val = Prog* reference OR ELSE offset = target pc (branch takes priority) -// -// $±x-±y -// Final argument to TEXT, specifying local frame size x and argument size y. -// In this form, x and y are integer literals only, not arbitrary expressions. -// This avoids parsing ambiguities due to the use of - as a separator. -// The ± are optional. -// If the final argument to TEXT omits the -±y, the encoding should still -// use TYPE_TEXTSIZE (not TYPE_CONST), with u.argsize = ArgsSizeUnknown. -// Encoding: -// type = TYPE_TEXTSIZE -// offset = x -// val = int32(y) -// -// reg<>shift, reg->shift, reg@>shift -// Shifted register value, for ARM and ARM64. -// In this form, reg must be a register and shift can be a register or an integer constant. -// Encoding: -// type = TYPE_SHIFT -// On ARM: -// offset = (reg&15) | shifttype<<5 | count -// shifttype = 0, 1, 2, 3 for <<, >>, ->, @> -// count = (reg&15)<<8 | 1<<4 for a register shift count, (n&31)<<7 for an integer constant. -// On ARM64: -// offset = (reg&31)<<16 | shifttype<<22 | (count&63)<<10 -// shifttype = 0, 1, 2 for <<, >>, -> -// -// (reg, reg) -// A destination register pair. When used as the last argument of an instruction, -// this form makes clear that both registers are destinations. -// Encoding: -// type = TYPE_REGREG -// reg = first register -// offset = second register -// -// [reg, reg, reg-reg] -// Register list for ARM. -// Encoding: -// type = TYPE_REGLIST -// offset = bit mask of registers in list; R0 is low bit. -// -// reg, reg -// Register pair for ARM. -// TYPE_REGREG2 -// -// (reg+reg) -// Register pair for PPC64. -// Encoding: -// type = TYPE_MEM -// reg = first register -// index = second register -// scale = 1 -// -type Addr struct { - Reg int16 - Index int16 - Scale int16 // Sometimes holds a register. - Type AddrType - Name int8 - Class int8 - Offset int64 - Sym *LSym - - // argument value: - // for TYPE_SCONST, a string - // for TYPE_FCONST, a float64 - // for TYPE_BRANCH, a *Prog (optional) - // for TYPE_TEXTSIZE, an int32 (optional) - Val interface{} - - Node interface{} // for use by compiler -} - -type AddrType uint8 - -const ( - NAME_NONE = 0 + iota - NAME_EXTERN - NAME_STATIC - NAME_AUTO - NAME_PARAM - // A reference to name@GOT(SB) is a reference to the entry in the global offset - // table for 'name'. - NAME_GOTREF -) - -const ( - TYPE_NONE AddrType = 0 - - TYPE_BRANCH AddrType = 5 + iota - TYPE_TEXTSIZE - TYPE_MEM - TYPE_CONST - TYPE_FCONST - TYPE_SCONST - TYPE_REG - TYPE_ADDR - TYPE_SHIFT - TYPE_REGREG - TYPE_REGREG2 - TYPE_INDIR - TYPE_REGLIST -) - -// Prog describes a single machine instruction. -// -// The general instruction form is: -// -// As.Scond From, Reg, From3, To, RegTo2 -// -// where As is an opcode and the others are arguments: -// From, Reg, From3 are sources, and To, RegTo2 are destinations. -// Usually, not all arguments are present. -// For example, MOVL R1, R2 encodes using only As=MOVL, From=R1, To=R2. -// The Scond field holds additional condition bits for systems (like arm) -// that have generalized conditional execution. -// -// Jump instructions use the Pcond field to point to the target instruction, -// which must be in the same linked list as the jump instruction. -// -// The Progs for a given function are arranged in a list linked through the Link field. -// -// Each Prog is charged to a specific source line in the debug information, -// specified by Lineno, an index into the line history (see LineHist). -// Every Prog has a Ctxt field that defines various context, including the current LineHist. -// Progs should be allocated using ctxt.NewProg(), not new(Prog). -// -// The other fields not yet mentioned are for use by the back ends and should -// be left zeroed by creators of Prog lists. -type Prog struct { - Ctxt *Link // linker context - Link *Prog // next Prog in linked list - From Addr // first source operand - From3 *Addr // third source operand (second is Reg below) - To Addr // destination operand (second is RegTo2 below) - Pcond *Prog // target of conditional jump - Opt interface{} // available to optimization passes to hold per-Prog state - Forwd *Prog // for x86 back end - Rel *Prog // for x86, arm back ends - Pc int64 // for back ends or assembler: virtual or actual program counter, depending on phase - Lineno int32 // line number of this instruction - Spadj int32 // effect of instruction on stack pointer (increment or decrement amount) - As As // assembler opcode - Reg int16 // 2nd source operand - RegTo2 int16 // 2nd destination operand - Mark uint16 // bitmask of arch-specific items - Optab uint16 // arch-specific opcode index - Scond uint8 // condition bits for conditional instruction (e.g., on ARM) - Back uint8 // for x86 back end: backwards branch state - Ft uint8 // for x86 back end: type index of Prog.From - Tt uint8 // for x86 back end: type index of Prog.To - Isize uint8 // for x86 back end: size of the instruction in bytes - Mode int8 // for x86 back end: 32- or 64-bit mode -} - -// From3Type returns From3.Type, or TYPE_NONE when From3 is nil. -func (p *Prog) From3Type() AddrType { - if p.From3 == nil { - return TYPE_NONE - } - return p.From3.Type -} - -// From3Offset returns From3.Offset, or 0 when From3 is nil. -func (p *Prog) From3Offset() int64 { - if p.From3 == nil { - return 0 - } - return p.From3.Offset -} - -// An As denotes an assembler opcode. -// There are some portable opcodes, declared here in package obj, -// that are common to all architectures. -// However, the majority of opcodes are arch-specific -// and are declared in their respective architecture's subpackage. -type As int16 - -// These are the portable opcodes. -const ( - AXXX As = iota - ACALL - ADUFFCOPY - ADUFFZERO - AEND - AFUNCDATA - AJMP - ANOP - APCDATA - ARET - ATEXT - ATYPE - AUNDEF - AUSEFIELD - AVARDEF - AVARKILL - AVARLIVE - A_ARCHSPECIFIC -) - -// Each architecture is allotted a distinct subspace of opcode values -// for declaring its arch-specific opcodes. -// Within this subspace, the first arch-specific opcode should be -// at offset A_ARCHSPECIFIC. -// -// Subspaces are aligned to a power of two so opcodes can be masked -// with AMask and used as compact array indices. -const ( - ABase386 = (1 + iota) << 10 - ABaseARM - ABaseAMD64 - ABasePPC64 - ABaseARM64 - ABaseMIPS64 - ABaseS390X - - AllowedOpCodes = 1 << 10 // The number of opcodes available for any given architecture. - AMask = AllowedOpCodes - 1 // AND with this to use the opcode as an array index. -) - -// An LSym is the sort of symbol that is written to an object file. -type LSym struct { - Name string - Type SymKind - Version int16 - Attribute - - RefIdx int // Index of this symbol in the symbol reference list. - Args int32 - Locals int32 - Size int64 - Gotype *LSym - Autom *Auto - Text *Prog - Pcln *Pcln - P []byte - R []Reloc -} - -// Attribute is a set of symbol attributes. -type Attribute int16 - -const ( - AttrDuplicateOK Attribute = 1 << iota - AttrCFunc - AttrNoSplit - AttrLeaf - AttrSeenGlobl - AttrOnList - - // MakeTypelink means that the type should have an entry in the typelink table. - AttrMakeTypelink - - // ReflectMethod means the function may call reflect.Type.Method or - // reflect.Type.MethodByName. Matching is imprecise (as reflect.Type - // can be used through a custom interface), so ReflectMethod may be - // set in some cases when the reflect package is not called. - // - // Used by the linker to determine what methods can be pruned. - AttrReflectMethod - - // Local means make the symbol local even when compiling Go code to reference Go - // symbols in other shared libraries, as in this mode symbols are global by - // default. "local" here means in the sense of the dynamic linker, i.e. not - // visible outside of the module (shared library or executable) that contains its - // definition. (When not compiling to support Go shared libraries, all symbols are - // local in this sense unless there is a cgo_export_* directive). - AttrLocal -) - -func (a Attribute) DuplicateOK() bool { return a&AttrDuplicateOK != 0 } -func (a Attribute) MakeTypelink() bool { return a&AttrMakeTypelink != 0 } -func (a Attribute) CFunc() bool { return a&AttrCFunc != 0 } -func (a Attribute) NoSplit() bool { return a&AttrNoSplit != 0 } -func (a Attribute) Leaf() bool { return a&AttrLeaf != 0 } -func (a Attribute) SeenGlobl() bool { return a&AttrSeenGlobl != 0 } -func (a Attribute) OnList() bool { return a&AttrOnList != 0 } -func (a Attribute) ReflectMethod() bool { return a&AttrReflectMethod != 0 } -func (a Attribute) Local() bool { return a&AttrLocal != 0 } - -func (a *Attribute) Set(flag Attribute, value bool) { - if value { - *a |= flag - } else { - *a &^= flag - } -} - -// The compiler needs LSym to satisfy fmt.Stringer, because it stores -// an LSym in ssa.ExternSymbol. -func (s *LSym) String() string { - return s.Name -} - -type Pcln struct { - Pcsp Pcdata - Pcfile Pcdata - Pcline Pcdata - Pcdata []Pcdata - Funcdata []*LSym - Funcdataoff []int64 - File []*LSym - Lastfile *LSym - Lastindex int -} - -// A SymKind describes the kind of memory represented by a symbol. -type SymKind int16 - -// Defined SymKind values. -// -// TODO(rsc): Give idiomatic Go names. -// TODO(rsc): Reduce the number of symbol types in the object files. -//go:generate stringer -type=SymKind -const ( - Sxxx SymKind = iota - STEXT - SELFRXSECT - - // Read-only sections. - STYPE - SSTRING - SGOSTRING - SGOFUNC - SGCBITS - SRODATA - SFUNCTAB - - SELFROSECT - SMACHOPLT - - // Read-only sections with relocations. - // - // Types STYPE-SFUNCTAB above are written to the .rodata section by default. - // When linking a shared object, some conceptually "read only" types need to - // be written to by relocations and putting them in a section called - // ".rodata" interacts poorly with the system linkers. The GNU linkers - // support this situation by arranging for sections of the name - // ".data.rel.ro.XXX" to be mprotected read only by the dynamic linker after - // relocations have applied, so when the Go linker is creating a shared - // object it checks all objects of the above types and bumps any object that - // has a relocation to it to the corresponding type below, which are then - // written to sections with appropriate magic names. - STYPERELRO - SSTRINGRELRO - SGOSTRINGRELRO - SGOFUNCRELRO - SGCBITSRELRO - SRODATARELRO - SFUNCTABRELRO - - // Part of .data.rel.ro if it exists, otherwise part of .rodata. - STYPELINK - SITABLINK - SSYMTAB - SPCLNTAB - - // Writable sections. - SELFSECT - SMACHO - SMACHOGOT - SWINDOWS - SELFGOT - SNOPTRDATA - SINITARR - SDATA - SBSS - SNOPTRBSS - STLSBSS - SXREF - SMACHOSYMSTR - SMACHOSYMTAB - SMACHOINDIRECTPLT - SMACHOINDIRECTGOT - SFILE - SFILEPATH - SCONST - SDYNIMPORT - SHOSTOBJ - SDWARFSECT - SDWARFINFO - SSUB = SymKind(1 << 8) - SMASK = SymKind(SSUB - 1) - SHIDDEN = SymKind(1 << 9) - SCONTAINER = SymKind(1 << 10) // has a sub-symbol -) - -// ReadOnly are the symbol kinds that form read-only sections. In some -// cases, if they will require relocations, they are transformed into -// rel-ro sections using RelROMap. -var ReadOnly = []SymKind{ - STYPE, - SSTRING, - SGOSTRING, - SGOFUNC, - SGCBITS, - SRODATA, - SFUNCTAB, -} - -// RelROMap describes the transformation of read-only symbols to rel-ro -// symbols. -var RelROMap = map[SymKind]SymKind{ - STYPE: STYPERELRO, - SSTRING: SSTRINGRELRO, - SGOSTRING: SGOSTRINGRELRO, - SGOFUNC: SGOFUNCRELRO, - SGCBITS: SGCBITSRELRO, - SRODATA: SRODATARELRO, - SFUNCTAB: SFUNCTABRELRO, -} - -type Reloc struct { - Off int32 - Siz uint8 - Type RelocType - Add int64 - Sym *LSym -} - -type RelocType int32 - -//go:generate stringer -type=RelocType -const ( - R_ADDR RelocType = 1 + iota - // R_ADDRPOWER relocates a pair of "D-form" instructions (instructions with 16-bit - // immediates in the low half of the instruction word), usually addis followed by - // another add or a load, inserting the "high adjusted" 16 bits of the address of - // the referenced symbol into the immediate field of the first instruction and the - // low 16 bits into that of the second instruction. - R_ADDRPOWER - // R_ADDRARM64 relocates an adrp, add pair to compute the address of the - // referenced symbol. - R_ADDRARM64 - // R_ADDRMIPS (only used on mips64) resolves to the low 16 bits of an external - // address, by encoding it into the instruction. - R_ADDRMIPS - // R_ADDROFF resolves to a 32-bit offset from the beginning of the section - // holding the data being relocated to the referenced symbol. - R_ADDROFF - R_SIZE - R_CALL - R_CALLARM - R_CALLARM64 - R_CALLIND - R_CALLPOWER - // R_CALLMIPS (only used on mips64) resolves to non-PC-relative target address - // of a CALL (JAL) instruction, by encoding the address into the instruction. - R_CALLMIPS - R_CONST - R_PCREL - // R_TLS_LE, used on 386, amd64, and ARM, resolves to the offset of the - // thread-local symbol from the thread local base and is used to implement the - // "local exec" model for tls access (r.Sym is not set on intel platforms but is - // set to a TLS symbol -- runtime.tlsg -- in the linker when externally linking). - R_TLS_LE - // R_TLS_IE, used 386, amd64, and ARM resolves to the PC-relative offset to a GOT - // slot containing the offset from the thread-local symbol from the thread local - // base and is used to implemented the "initial exec" model for tls access (r.Sym - // is not set on intel platforms but is set to a TLS symbol -- runtime.tlsg -- in - // the linker when externally linking). - R_TLS_IE - R_GOTOFF - R_PLT0 - R_PLT1 - R_PLT2 - R_USEFIELD - // R_USETYPE resolves to an *rtype, but no relocation is created. The - // linker uses this as a signal that the pointed-to type information - // should be linked into the final binary, even if there are no other - // direct references. (This is used for types reachable by reflection.) - R_USETYPE - // R_METHODOFF resolves to a 32-bit offset from the beginning of the section - // holding the data being relocated to the referenced symbol. - // It is a variant of R_ADDROFF used when linking from the uncommonType of a - // *rtype, and may be set to zero by the linker if it determines the method - // text is unreachable by the linked program. - R_METHODOFF - R_POWER_TOC - R_GOTPCREL - // R_JMPMIPS (only used on mips64) resolves to non-PC-relative target address - // of a JMP instruction, by encoding the address into the instruction. - // The stack nosplit check ignores this since it is not a function call. - R_JMPMIPS - // R_DWARFREF resolves to the offset of the symbol from its section. - R_DWARFREF - - // Platform dependent relocations. Architectures with fixed width instructions - // have the inherent issue that a 32-bit (or 64-bit!) displacement cannot be - // stuffed into a 32-bit instruction, so an address needs to be spread across - // several instructions, and in turn this requires a sequence of relocations, each - // updating a part of an instruction. This leads to relocation codes that are - // inherently processor specific. - - // Arm64. - - // Set a MOV[NZ] immediate field to bits [15:0] of the offset from the thread - // local base to the thread local variable defined by the referenced (thread - // local) symbol. Error if the offset does not fit into 16 bits. - R_ARM64_TLS_LE - - // Relocates an ADRP; LD64 instruction sequence to load the offset between - // the thread local base and the thread local variable defined by the - // referenced (thread local) symbol from the GOT. - R_ARM64_TLS_IE - - // R_ARM64_GOTPCREL relocates an adrp, ld64 pair to compute the address of the GOT - // slot of the referenced symbol. - R_ARM64_GOTPCREL - - // PPC64. - - // R_POWER_TLS_LE is used to implement the "local exec" model for tls - // access. It resolves to the offset of the thread-local symbol from the - // thread pointer (R13) and inserts this value into the low 16 bits of an - // instruction word. - R_POWER_TLS_LE - - // R_POWER_TLS_IE is used to implement the "initial exec" model for tls access. It - // relocates a D-form, DS-form instruction sequence like R_ADDRPOWER_DS. It - // inserts to the offset of GOT slot for the thread-local symbol from the TOC (the - // GOT slot is filled by the dynamic linker with the offset of the thread-local - // symbol from the thread pointer (R13)). - R_POWER_TLS_IE - - // R_POWER_TLS marks an X-form instruction such as "MOVD 0(R13)(R31*1), g" as - // accessing a particular thread-local symbol. It does not affect code generation - // but is used by the system linker when relaxing "initial exec" model code to - // "local exec" model code. - R_POWER_TLS - - // R_ADDRPOWER_DS is similar to R_ADDRPOWER above, but assumes the second - // instruction is a "DS-form" instruction, which has an immediate field occupying - // bits [15:2] of the instruction word. Bits [15:2] of the address of the - // relocated symbol are inserted into this field; it is an error if the last two - // bits of the address are not 0. - R_ADDRPOWER_DS - - // R_ADDRPOWER_PCREL relocates a D-form, DS-form instruction sequence like - // R_ADDRPOWER_DS but inserts the offset of the GOT slot for the referenced symbol - // from the TOC rather than the symbol's address. - R_ADDRPOWER_GOT - - // R_ADDRPOWER_PCREL relocates two D-form instructions like R_ADDRPOWER, but - // inserts the displacement from the place being relocated to the address of the - // the relocated symbol instead of just its address. - R_ADDRPOWER_PCREL - - // R_ADDRPOWER_TOCREL relocates two D-form instructions like R_ADDRPOWER, but - // inserts the offset from the TOC to the address of the the relocated symbol - // rather than the symbol's address. - R_ADDRPOWER_TOCREL - - // R_ADDRPOWER_TOCREL relocates a D-form, DS-form instruction sequence like - // R_ADDRPOWER_DS but inserts the offset from the TOC to the address of the the - // relocated symbol rather than the symbol's address. - R_ADDRPOWER_TOCREL_DS - - // R_PCRELDBL relocates s390x 2-byte aligned PC-relative addresses. - // TODO(mundaym): remove once variants can be serialized - see issue 14218. - R_PCRELDBL - - // R_ADDRMIPSU (only used on mips64) resolves to the sign-adjusted "upper" 16 - // bits (bit 16-31) of an external address, by encoding it into the instruction. - R_ADDRMIPSU - // R_ADDRMIPSTLS (only used on mips64) resolves to the low 16 bits of a TLS - // address (offset from thread pointer), by encoding it into the instruction. - R_ADDRMIPSTLS -) - -// IsDirectJump returns whether r is a relocation for a direct jump. -// A direct jump is a CALL or JMP instruction that takes the target address -// as immediate. The address is embedded into the instruction, possibly -// with limited width. -// An indirect jump is a CALL or JMP instruction that takes the target address -// in register or memory. -func (r RelocType) IsDirectJump() bool { - switch r { - case R_CALL, R_CALLARM, R_CALLARM64, R_CALLPOWER, R_CALLMIPS, R_JMPMIPS: - return true - } - return false -} - -type Auto struct { - Asym *LSym - Link *Auto - Aoffset int32 - Name int16 - Gotype *LSym -} - -// Auto.name -const ( - A_AUTO = 1 + iota - A_PARAM -) - -type Pcdata struct { - P []byte -} - -// symbol version, incremented each time a file is loaded. -// version==1 is reserved for savehist. -const ( - HistVersion = 1 -) - -// Link holds the context for writing object code from a compiler -// to be linker input or for reading that input into the linker. -type Link struct { - Headtype HeadType - Arch *LinkArch - Debugasm int32 - Debugvlog int32 - Debugdivmod int32 - Debugpcln int32 - Flag_shared bool - Flag_dynlink bool - Flag_optimize bool - Bso *bufio.Writer - Pathname string - Hash map[SymVer]*LSym - LineHist LineHist - Imports []string - Plists []*Plist - Sym_div *LSym - Sym_divu *LSym - Sym_mod *LSym - Sym_modu *LSym - Plan9privates *LSym - Curp *Prog - Printp *Prog - Blitrl *Prog - Elitrl *Prog - Rexflag int - Vexflag int - Rep int - Repn int - Lock int - Asmode int - AsmBuf AsmBuf // instruction buffer for x86 - Instoffset int64 - Autosize int32 - Armsize int32 - Pc int64 - DiagFunc func(string, ...interface{}) - Mode int - Cursym *LSym - Version int - Errors int - - Framepointer_enabled bool - - // state for writing objects - Text []*LSym - Data []*LSym - - // Cache of Progs - allocIdx int - progs [10000]Prog -} - -func (ctxt *Link) Diag(format string, args ...interface{}) { - ctxt.Errors++ - ctxt.DiagFunc(format, args...) -} - -func (ctxt *Link) Logf(format string, args ...interface{}) { - fmt.Fprintf(ctxt.Bso, format, args...) - ctxt.Bso.Flush() -} - -// The smallest possible offset from the hardware stack pointer to a local -// variable on the stack. Architectures that use a link register save its value -// on the stack in the function prologue and so always have a pointer between -// the hardware stack pointer and the local variable area. -func (ctxt *Link) FixedFrameSize() int64 { - switch ctxt.Arch.Family { - case sys.AMD64, sys.I386: - return 0 - case sys.PPC64: - // PIC code on ppc64le requires 32 bytes of stack, and it's easier to - // just use that much stack always on ppc64x. - return int64(4 * ctxt.Arch.PtrSize) - default: - return int64(ctxt.Arch.PtrSize) - } -} - -type SymVer struct { - Name string - Version int // TODO: make int16 to match LSym.Version? -} - -// LinkArch is the definition of a single architecture. -type LinkArch struct { - *sys.Arch - Preprocess func(*Link, *LSym) - Assemble func(*Link, *LSym) - Follow func(*Link, *LSym) - Progedit func(*Link, *Prog) - UnaryDst map[As]bool // Instruction takes one operand, a destination. -} - -// HeadType is the executable header type. -type HeadType uint8 - -const ( - Hunknown HeadType = iota - Hdarwin - Hdragonfly - Hfreebsd - Hlinux - Hnacl - Hnetbsd - Hopenbsd - Hplan9 - Hsolaris - Hwindows - Hwindowsgui -) - -func (h *HeadType) Set(s string) error { - switch s { - case "darwin": - *h = Hdarwin - case "dragonfly": - *h = Hdragonfly - case "freebsd": - *h = Hfreebsd - case "linux", "android": - *h = Hlinux - case "nacl": - *h = Hnacl - case "netbsd": - *h = Hnetbsd - case "openbsd": - *h = Hopenbsd - case "plan9": - *h = Hplan9 - case "solaris": - *h = Hsolaris - case "windows": - *h = Hwindows - case "windowsgui": - *h = Hwindowsgui - default: - return fmt.Errorf("invalid headtype: %q", s) - } - return nil -} - -func (h *HeadType) String() string { - switch *h { - case Hdarwin: - return "darwin" - case Hdragonfly: - return "dragonfly" - case Hfreebsd: - return "freebsd" - case Hlinux: - return "linux" - case Hnacl: - return "nacl" - case Hnetbsd: - return "netbsd" - case Hopenbsd: - return "openbsd" - case Hplan9: - return "plan9" - case Hsolaris: - return "solaris" - case Hwindows: - return "windows" - case Hwindowsgui: - return "windowsgui" - } - return fmt.Sprintf("HeadType(%d)", *h) -} - -// AsmBuf is a simple buffer to assemble variable-length x86 instructions into. -type AsmBuf struct { - buf [100]byte - off int -} - -// Put1 appends one byte to the end of the buffer. -func (a *AsmBuf) Put1(x byte) { - a.buf[a.off] = x - a.off++ -} - -// Put2 appends two bytes to the end of the buffer. -func (a *AsmBuf) Put2(x, y byte) { - a.buf[a.off+0] = x - a.buf[a.off+1] = y - a.off += 2 -} - -// Put3 appends three bytes to the end of the buffer. -func (a *AsmBuf) Put3(x, y, z byte) { - a.buf[a.off+0] = x - a.buf[a.off+1] = y - a.buf[a.off+2] = z - a.off += 3 -} - -// Put4 appends four bytes to the end of the buffer. -func (a *AsmBuf) Put4(x, y, z, w byte) { - a.buf[a.off+0] = x - a.buf[a.off+1] = y - a.buf[a.off+2] = z - a.buf[a.off+3] = w - a.off += 4 -} - -// PutInt16 writes v into the buffer using little-endian encoding. -func (a *AsmBuf) PutInt16(v int16) { - a.buf[a.off+0] = byte(v) - a.buf[a.off+1] = byte(v >> 8) - a.off += 2 -} - -// PutInt32 writes v into the buffer using little-endian encoding. -func (a *AsmBuf) PutInt32(v int32) { - a.buf[a.off+0] = byte(v) - a.buf[a.off+1] = byte(v >> 8) - a.buf[a.off+2] = byte(v >> 16) - a.buf[a.off+3] = byte(v >> 24) - a.off += 4 -} - -// PutInt64 writes v into the buffer using little-endian encoding. -func (a *AsmBuf) PutInt64(v int64) { - a.buf[a.off+0] = byte(v) - a.buf[a.off+1] = byte(v >> 8) - a.buf[a.off+2] = byte(v >> 16) - a.buf[a.off+3] = byte(v >> 24) - a.buf[a.off+4] = byte(v >> 32) - a.buf[a.off+5] = byte(v >> 40) - a.buf[a.off+6] = byte(v >> 48) - a.buf[a.off+7] = byte(v >> 56) - a.off += 8 -} - -// Put copies b into the buffer. -func (a *AsmBuf) Put(b []byte) { - copy(a.buf[a.off:], b) - a.off += len(b) -} - -// Insert inserts b at offset i. -func (a *AsmBuf) Insert(i int, b byte) { - a.off++ - copy(a.buf[i+1:a.off], a.buf[i:a.off-1]) - a.buf[i] = b -} - -// Last returns the byte at the end of the buffer. -func (a *AsmBuf) Last() byte { return a.buf[a.off-1] } - -// Len returns the length of the buffer. -func (a *AsmBuf) Len() int { return a.off } - -// Bytes returns the contents of the buffer. -func (a *AsmBuf) Bytes() []byte { return a.buf[:a.off] } - -// Reset empties the buffer. -func (a *AsmBuf) Reset() { a.off = 0 } - -// Peek returns the byte at offset i. -func (a *AsmBuf) Peek(i int) byte { return a.buf[i] } diff --git a/vendor/github.com/google/gops/internal/obj/mips/a.out.go b/vendor/github.com/google/gops/internal/obj/mips/a.out.go deleted file mode 100644 index e0e51eed..00000000 --- a/vendor/github.com/google/gops/internal/obj/mips/a.out.go +++ /dev/null @@ -1,375 +0,0 @@ -// cmd/9c/9.out.h from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package mips - -import "github.com/google/gops/internal/obj" - -//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p mips - -/* - * mips 64 - */ -const ( - NSNAME = 8 - NSYM = 50 - NREG = 32 /* number of general registers */ - NFREG = 32 /* number of floating point registers */ -) - -const ( - REG_R0 = obj.RBaseMIPS64 + iota - REG_R1 - REG_R2 - REG_R3 - REG_R4 - REG_R5 - REG_R6 - REG_R7 - REG_R8 - REG_R9 - REG_R10 - REG_R11 - REG_R12 - REG_R13 - REG_R14 - REG_R15 - REG_R16 - REG_R17 - REG_R18 - REG_R19 - REG_R20 - REG_R21 - REG_R22 - REG_R23 - REG_R24 - REG_R25 - REG_R26 - REG_R27 - REG_R28 - REG_R29 - REG_R30 - REG_R31 - - REG_F0 - REG_F1 - REG_F2 - REG_F3 - REG_F4 - REG_F5 - REG_F6 - REG_F7 - REG_F8 - REG_F9 - REG_F10 - REG_F11 - REG_F12 - REG_F13 - REG_F14 - REG_F15 - REG_F16 - REG_F17 - REG_F18 - REG_F19 - REG_F20 - REG_F21 - REG_F22 - REG_F23 - REG_F24 - REG_F25 - REG_F26 - REG_F27 - REG_F28 - REG_F29 - REG_F30 - REG_F31 - - REG_HI - REG_LO - - // co-processor 0 control registers - REG_M0 - REG_M1 - REG_M2 - REG_M3 - REG_M4 - REG_M5 - REG_M6 - REG_M7 - REG_M8 - REG_M9 - REG_M10 - REG_M11 - REG_M12 - REG_M13 - REG_M14 - REG_M15 - REG_M16 - REG_M17 - REG_M18 - REG_M19 - REG_M20 - REG_M21 - REG_M22 - REG_M23 - REG_M24 - REG_M25 - REG_M26 - REG_M27 - REG_M28 - REG_M29 - REG_M30 - REG_M31 - - // FPU control registers - REG_FCR0 - REG_FCR1 - REG_FCR2 - REG_FCR3 - REG_FCR4 - REG_FCR5 - REG_FCR6 - REG_FCR7 - REG_FCR8 - REG_FCR9 - REG_FCR10 - REG_FCR11 - REG_FCR12 - REG_FCR13 - REG_FCR14 - REG_FCR15 - REG_FCR16 - REG_FCR17 - REG_FCR18 - REG_FCR19 - REG_FCR20 - REG_FCR21 - REG_FCR22 - REG_FCR23 - REG_FCR24 - REG_FCR25 - REG_FCR26 - REG_FCR27 - REG_FCR28 - REG_FCR29 - REG_FCR30 - REG_FCR31 - - REG_LAST = REG_FCR31 // the last defined register - - REG_SPECIAL = REG_M0 - - REGZERO = REG_R0 /* set to zero */ - REGSP = REG_R29 - REGSB = REG_R28 - REGLINK = REG_R31 - REGRET = REG_R1 - REGARG = -1 /* -1 disables passing the first argument in register */ - REGRT1 = REG_R1 /* reserved for runtime, duffzero and duffcopy */ - REGRT2 = REG_R2 /* reserved for runtime, duffcopy */ - REGCTXT = REG_R22 /* context for closures */ - REGG = REG_R30 /* G */ - REGTMP = REG_R23 /* used by the linker */ - FREGRET = REG_F0 -) - -const ( - BIG = 32766 -) - -const ( - /* mark flags */ - FOLL = 1 << 0 - LABEL = 1 << 1 - LEAF = 1 << 2 - SYNC = 1 << 3 - BRANCH = 1 << 4 - LOAD = 1 << 5 - FCMP = 1 << 6 - NOSCHED = 1 << 7 - - NSCHED = 20 -) - -const ( - C_NONE = iota - C_REG - C_FREG - C_FCREG - C_MREG /* special processor register */ - C_HI - C_LO - C_ZCON - C_SCON /* 16 bit signed */ - C_UCON /* 32 bit signed, low 16 bits 0 */ - C_ADD0CON - C_AND0CON - C_ADDCON /* -0x8000 <= v < 0 */ - C_ANDCON /* 0 < v <= 0xFFFF */ - C_LCON /* other 32 */ - C_DCON /* other 64 (could subdivide further) */ - C_SACON /* $n(REG) where n <= int16 */ - C_SECON - C_LACON /* $n(REG) where int16 < n <= int32 */ - C_LECON - C_DACON /* $n(REG) where int32 < n */ - C_STCON /* $tlsvar */ - C_SBRA - C_LBRA - C_SAUTO - C_LAUTO - C_SEXT - C_LEXT - C_ZOREG - C_SOREG - C_LOREG - C_GOK - C_ADDR - C_TLS - C_TEXTSIZE - - C_NCLASS /* must be the last */ -) - -const ( - AABSD = obj.ABaseMIPS64 + obj.A_ARCHSPECIFIC + iota - AABSF - AABSW - AADD - AADDD - AADDF - AADDU - AADDW - AAND - ABEQ - ABFPF - ABFPT - ABGEZ - ABGEZAL - ABGTZ - ABLEZ - ABLTZ - ABLTZAL - ABNE - ABREAK - ACMPEQD - ACMPEQF - ACMPGED - ACMPGEF - ACMPGTD - ACMPGTF - ADIV - ADIVD - ADIVF - ADIVU - ADIVW - AGOK - ALUI - AMOVB - AMOVBU - AMOVD - AMOVDF - AMOVDW - AMOVF - AMOVFD - AMOVFW - AMOVH - AMOVHU - AMOVW - AMOVWD - AMOVWF - AMOVWL - AMOVWR - AMUL - AMULD - AMULF - AMULU - AMULW - ANEGD - ANEGF - ANEGW - ANOR - AOR - AREM - AREMU - ARFE - ASGT - ASGTU - ASLL - ASRA - ASRL - ASUB - ASUBD - ASUBF - ASUBU - ASUBW - ASYSCALL - ATLBP - ATLBR - ATLBWI - ATLBWR - AWORD - AXOR - - /* 64-bit */ - AMOVV - AMOVVL - AMOVVR - ASLLV - ASRAV - ASRLV - ADIVV - ADIVVU - AREMV - AREMVU - AMULV - AMULVU - AADDV - AADDVU - ASUBV - ASUBVU - - /* 64-bit FP */ - ATRUNCFV - ATRUNCDV - ATRUNCFW - ATRUNCDW - AMOVWU - AMOVFV - AMOVDV - AMOVVF - AMOVVD - - ALAST - - // aliases - AJMP = obj.AJMP - AJAL = obj.ACALL - ARET = obj.ARET -) diff --git a/vendor/github.com/google/gops/internal/obj/mips/anames.go b/vendor/github.com/google/gops/internal/obj/mips/anames.go deleted file mode 100644 index 06a366fc..00000000 --- a/vendor/github.com/google/gops/internal/obj/mips/anames.go +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by stringer -i a.out.go -o anames.go -p mips -// Do not edit. - -package mips - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ - obj.A_ARCHSPECIFIC: "ABSD", - "ABSF", - "ABSW", - "ADD", - "ADDD", - "ADDF", - "ADDU", - "ADDW", - "AND", - "BEQ", - "BFPF", - "BFPT", - "BGEZ", - "BGEZAL", - "BGTZ", - "BLEZ", - "BLTZ", - "BLTZAL", - "BNE", - "BREAK", - "CMPEQD", - "CMPEQF", - "CMPGED", - "CMPGEF", - "CMPGTD", - "CMPGTF", - "DIV", - "DIVD", - "DIVF", - "DIVU", - "DIVW", - "GOK", - "LUI", - "MOVB", - "MOVBU", - "MOVD", - "MOVDF", - "MOVDW", - "MOVF", - "MOVFD", - "MOVFW", - "MOVH", - "MOVHU", - "MOVW", - "MOVWD", - "MOVWF", - "MOVWL", - "MOVWR", - "MUL", - "MULD", - "MULF", - "MULU", - "MULW", - "NEGD", - "NEGF", - "NEGW", - "NOR", - "OR", - "REM", - "REMU", - "RFE", - "SGT", - "SGTU", - "SLL", - "SRA", - "SRL", - "SUB", - "SUBD", - "SUBF", - "SUBU", - "SUBW", - "SYSCALL", - "TLBP", - "TLBR", - "TLBWI", - "TLBWR", - "WORD", - "XOR", - "MOVV", - "MOVVL", - "MOVVR", - "SLLV", - "SRAV", - "SRLV", - "DIVV", - "DIVVU", - "REMV", - "REMVU", - "MULV", - "MULVU", - "ADDV", - "ADDVU", - "SUBV", - "SUBVU", - "TRUNCFV", - "TRUNCDV", - "TRUNCFW", - "TRUNCDW", - "MOVWU", - "MOVFV", - "MOVDV", - "MOVVF", - "MOVVD", - "LAST", -} diff --git a/vendor/github.com/google/gops/internal/obj/mips/anames0.go b/vendor/github.com/google/gops/internal/obj/mips/anames0.go deleted file mode 100644 index c56d34ea..00000000 --- a/vendor/github.com/google/gops/internal/obj/mips/anames0.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mips - -var cnames0 = []string{ - "NONE", - "REG", - "FREG", - "FCREG", - "MREG", - "HI", - "LO", - "ZCON", - "SCON", - "UCON", - "ADD0CON", - "AND0CON", - "ADDCON", - "ANDCON", - "LCON", - "DCON", - "SACON", - "SECON", - "LACON", - "LECON", - "DACON", - "STCON", - "SBRA", - "LBRA", - "SAUTO", - "LAUTO", - "SEXT", - "LEXT", - "ZOREG", - "SOREG", - "LOREG", - "GOK", - "ADDR", - "TLS", - "TEXTSIZE", - "NCLASS", -} diff --git a/vendor/github.com/google/gops/internal/obj/mips/asm0.go b/vendor/github.com/google/gops/internal/obj/mips/asm0.go deleted file mode 100644 index ef4ceddc..00000000 --- a/vendor/github.com/google/gops/internal/obj/mips/asm0.go +++ /dev/null @@ -1,1783 +0,0 @@ -// cmd/9l/optab.c, cmd/9l/asmout.c from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package mips - -import ( - "fmt" - "log" - "sort" - - "github.com/google/gops/internal/obj" -) - -// Instruction layout. - -const ( - funcAlign = 8 -) - -const ( - r0iszero = 1 -) - -type Optab struct { - as obj.As - a1 uint8 - a2 uint8 - a3 uint8 - type_ int8 - size int8 - param int16 -} - -var optab = []Optab{ - {obj.ATEXT, C_LEXT, C_NONE, C_TEXTSIZE, 0, 0, 0}, - {obj.ATEXT, C_ADDR, C_NONE, C_TEXTSIZE, 0, 0, 0}, - - {AMOVW, C_REG, C_NONE, C_REG, 1, 4, 0}, - {AMOVV, C_REG, C_NONE, C_REG, 1, 4, 0}, - {AMOVB, C_REG, C_NONE, C_REG, 12, 8, 0}, - {AMOVBU, C_REG, C_NONE, C_REG, 13, 4, 0}, - {AMOVWU, C_REG, C_NONE, C_REG, 14, 8, 0}, - - {ASUB, C_REG, C_REG, C_REG, 2, 4, 0}, - {AADD, C_REG, C_REG, C_REG, 2, 4, 0}, - {AAND, C_REG, C_REG, C_REG, 2, 4, 0}, - {ASUB, C_REG, C_NONE, C_REG, 2, 4, 0}, - {AADD, C_REG, C_NONE, C_REG, 2, 4, 0}, - {AAND, C_REG, C_NONE, C_REG, 2, 4, 0}, - - {ASLL, C_REG, C_NONE, C_REG, 9, 4, 0}, - {ASLL, C_REG, C_REG, C_REG, 9, 4, 0}, - - {AADDF, C_FREG, C_NONE, C_FREG, 32, 4, 0}, - {AADDF, C_FREG, C_REG, C_FREG, 32, 4, 0}, - {ACMPEQF, C_FREG, C_REG, C_NONE, 32, 4, 0}, - {AABSF, C_FREG, C_NONE, C_FREG, 33, 4, 0}, - {AMOVF, C_FREG, C_NONE, C_FREG, 33, 4, 0}, - {AMOVD, C_FREG, C_NONE, C_FREG, 33, 4, 0}, - - {AMOVW, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVWU, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVV, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVB, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVBU, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVWL, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVW, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVWU, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVV, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVB, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVBU, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVWL, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVW, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVWU, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVV, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVB, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVBU, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVWL, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - - {AMOVW, C_SEXT, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVWU, C_SEXT, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVV, C_SEXT, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVB, C_SEXT, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVBU, C_SEXT, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVWL, C_SEXT, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVW, C_SAUTO, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVWU, C_SAUTO, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVV, C_SAUTO, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVB, C_SAUTO, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVBU, C_SAUTO, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVWL, C_SAUTO, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVW, C_SOREG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVWU, C_SOREG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVV, C_SOREG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVB, C_SOREG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVBU, C_SOREG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVWL, C_SOREG, C_NONE, C_REG, 8, 4, REGZERO}, - - {AMOVW, C_REG, C_NONE, C_LEXT, 35, 12, REGSB}, - {AMOVWU, C_REG, C_NONE, C_LEXT, 35, 12, REGSB}, - {AMOVV, C_REG, C_NONE, C_LEXT, 35, 12, REGSB}, - {AMOVB, C_REG, C_NONE, C_LEXT, 35, 12, REGSB}, - {AMOVBU, C_REG, C_NONE, C_LEXT, 35, 12, REGSB}, - {AMOVW, C_REG, C_NONE, C_LAUTO, 35, 12, REGSP}, - {AMOVWU, C_REG, C_NONE, C_LAUTO, 35, 12, REGSP}, - {AMOVV, C_REG, C_NONE, C_LAUTO, 35, 12, REGSP}, - {AMOVB, C_REG, C_NONE, C_LAUTO, 35, 12, REGSP}, - {AMOVBU, C_REG, C_NONE, C_LAUTO, 35, 12, REGSP}, - {AMOVW, C_REG, C_NONE, C_LOREG, 35, 12, REGZERO}, - {AMOVWU, C_REG, C_NONE, C_LOREG, 35, 12, REGZERO}, - {AMOVV, C_REG, C_NONE, C_LOREG, 35, 12, REGZERO}, - {AMOVB, C_REG, C_NONE, C_LOREG, 35, 12, REGZERO}, - {AMOVBU, C_REG, C_NONE, C_LOREG, 35, 12, REGZERO}, - {AMOVW, C_REG, C_NONE, C_ADDR, 50, 12, 0}, - {AMOVWU, C_REG, C_NONE, C_ADDR, 50, 12, 0}, - {AMOVV, C_REG, C_NONE, C_ADDR, 50, 12, 0}, - {AMOVB, C_REG, C_NONE, C_ADDR, 50, 12, 0}, - {AMOVBU, C_REG, C_NONE, C_ADDR, 50, 12, 0}, - {AMOVW, C_REG, C_NONE, C_TLS, 53, 8, 0}, - {AMOVWU, C_REG, C_NONE, C_TLS, 53, 8, 0}, - {AMOVV, C_REG, C_NONE, C_TLS, 53, 8, 0}, - {AMOVB, C_REG, C_NONE, C_TLS, 53, 8, 0}, - {AMOVBU, C_REG, C_NONE, C_TLS, 53, 8, 0}, - - {AMOVW, C_LEXT, C_NONE, C_REG, 36, 12, REGSB}, - {AMOVWU, C_LEXT, C_NONE, C_REG, 36, 12, REGSB}, - {AMOVV, C_LEXT, C_NONE, C_REG, 36, 12, REGSB}, - {AMOVB, C_LEXT, C_NONE, C_REG, 36, 12, REGSB}, - {AMOVBU, C_LEXT, C_NONE, C_REG, 36, 12, REGSB}, - {AMOVW, C_LAUTO, C_NONE, C_REG, 36, 12, REGSP}, - {AMOVWU, C_LAUTO, C_NONE, C_REG, 36, 12, REGSP}, - {AMOVV, C_LAUTO, C_NONE, C_REG, 36, 12, REGSP}, - {AMOVB, C_LAUTO, C_NONE, C_REG, 36, 12, REGSP}, - {AMOVBU, C_LAUTO, C_NONE, C_REG, 36, 12, REGSP}, - {AMOVW, C_LOREG, C_NONE, C_REG, 36, 12, REGZERO}, - {AMOVWU, C_LOREG, C_NONE, C_REG, 36, 12, REGZERO}, - {AMOVV, C_LOREG, C_NONE, C_REG, 36, 12, REGZERO}, - {AMOVB, C_LOREG, C_NONE, C_REG, 36, 12, REGZERO}, - {AMOVBU, C_LOREG, C_NONE, C_REG, 36, 12, REGZERO}, - {AMOVW, C_ADDR, C_NONE, C_REG, 51, 12, 0}, - {AMOVWU, C_ADDR, C_NONE, C_REG, 51, 12, 0}, - {AMOVV, C_ADDR, C_NONE, C_REG, 51, 12, 0}, - {AMOVB, C_ADDR, C_NONE, C_REG, 51, 12, 0}, - {AMOVBU, C_ADDR, C_NONE, C_REG, 51, 12, 0}, - {AMOVW, C_TLS, C_NONE, C_REG, 54, 8, 0}, - {AMOVWU, C_TLS, C_NONE, C_REG, 54, 8, 0}, - {AMOVV, C_TLS, C_NONE, C_REG, 54, 8, 0}, - {AMOVB, C_TLS, C_NONE, C_REG, 54, 8, 0}, - {AMOVBU, C_TLS, C_NONE, C_REG, 54, 8, 0}, - - {AMOVW, C_SECON, C_NONE, C_REG, 3, 4, REGSB}, - {AMOVV, C_SECON, C_NONE, C_REG, 3, 4, REGSB}, - {AMOVW, C_SACON, C_NONE, C_REG, 3, 4, REGSP}, - {AMOVV, C_SACON, C_NONE, C_REG, 3, 4, REGSP}, - {AMOVW, C_LECON, C_NONE, C_REG, 52, 12, REGSB}, - {AMOVV, C_LECON, C_NONE, C_REG, 52, 12, REGSB}, - {AMOVW, C_LACON, C_NONE, C_REG, 26, 12, REGSP}, - {AMOVV, C_LACON, C_NONE, C_REG, 26, 12, REGSP}, - {AMOVW, C_ADDCON, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVV, C_ADDCON, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVW, C_ANDCON, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVV, C_ANDCON, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVW, C_STCON, C_NONE, C_REG, 55, 8, 0}, - {AMOVV, C_STCON, C_NONE, C_REG, 55, 8, 0}, - - {AMOVW, C_UCON, C_NONE, C_REG, 24, 4, 0}, - {AMOVV, C_UCON, C_NONE, C_REG, 24, 4, 0}, - {AMOVW, C_LCON, C_NONE, C_REG, 19, 8, 0}, - {AMOVV, C_LCON, C_NONE, C_REG, 19, 8, 0}, - - {AMOVW, C_HI, C_NONE, C_REG, 20, 4, 0}, - {AMOVV, C_HI, C_NONE, C_REG, 20, 4, 0}, - {AMOVW, C_LO, C_NONE, C_REG, 20, 4, 0}, - {AMOVV, C_LO, C_NONE, C_REG, 20, 4, 0}, - {AMOVW, C_REG, C_NONE, C_HI, 21, 4, 0}, - {AMOVV, C_REG, C_NONE, C_HI, 21, 4, 0}, - {AMOVW, C_REG, C_NONE, C_LO, 21, 4, 0}, - {AMOVV, C_REG, C_NONE, C_LO, 21, 4, 0}, - - {AMUL, C_REG, C_REG, C_NONE, 22, 4, 0}, - - {AADD, C_ADD0CON, C_REG, C_REG, 4, 4, 0}, - {AADD, C_ADD0CON, C_NONE, C_REG, 4, 4, 0}, - {AADD, C_ANDCON, C_REG, C_REG, 10, 8, 0}, - {AADD, C_ANDCON, C_NONE, C_REG, 10, 8, 0}, - - {AAND, C_AND0CON, C_REG, C_REG, 4, 4, 0}, - {AAND, C_AND0CON, C_NONE, C_REG, 4, 4, 0}, - {AAND, C_ADDCON, C_REG, C_REG, 10, 8, 0}, - {AAND, C_ADDCON, C_NONE, C_REG, 10, 8, 0}, - - {AADD, C_UCON, C_REG, C_REG, 25, 8, 0}, - {AADD, C_UCON, C_NONE, C_REG, 25, 8, 0}, - {AAND, C_UCON, C_REG, C_REG, 25, 8, 0}, - {AAND, C_UCON, C_NONE, C_REG, 25, 8, 0}, - - {AADD, C_LCON, C_NONE, C_REG, 23, 12, 0}, - {AAND, C_LCON, C_NONE, C_REG, 23, 12, 0}, - {AADD, C_LCON, C_REG, C_REG, 23, 12, 0}, - {AAND, C_LCON, C_REG, C_REG, 23, 12, 0}, - - {ASLL, C_SCON, C_REG, C_REG, 16, 4, 0}, - {ASLL, C_SCON, C_NONE, C_REG, 16, 4, 0}, - - {ASYSCALL, C_NONE, C_NONE, C_NONE, 5, 4, 0}, - - {ABEQ, C_REG, C_REG, C_SBRA, 6, 4, 0}, - {ABEQ, C_REG, C_NONE, C_SBRA, 6, 4, 0}, - {ABLEZ, C_REG, C_NONE, C_SBRA, 6, 4, 0}, - {ABFPT, C_NONE, C_NONE, C_SBRA, 6, 8, 0}, - - {AJMP, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, - {AJAL, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, - - {AJMP, C_NONE, C_NONE, C_ZOREG, 18, 4, REGZERO}, - {AJAL, C_NONE, C_NONE, C_ZOREG, 18, 4, REGLINK}, - - {AMOVW, C_SEXT, C_NONE, C_FREG, 27, 4, REGSB}, - {AMOVF, C_SEXT, C_NONE, C_FREG, 27, 4, REGSB}, - {AMOVD, C_SEXT, C_NONE, C_FREG, 27, 4, REGSB}, - {AMOVW, C_SAUTO, C_NONE, C_FREG, 27, 4, REGSP}, - {AMOVF, C_SAUTO, C_NONE, C_FREG, 27, 4, REGSP}, - {AMOVD, C_SAUTO, C_NONE, C_FREG, 27, 4, REGSP}, - {AMOVW, C_SOREG, C_NONE, C_FREG, 27, 4, REGZERO}, - {AMOVF, C_SOREG, C_NONE, C_FREG, 27, 4, REGZERO}, - {AMOVD, C_SOREG, C_NONE, C_FREG, 27, 4, REGZERO}, - - {AMOVW, C_LEXT, C_NONE, C_FREG, 27, 12, REGSB}, - {AMOVF, C_LEXT, C_NONE, C_FREG, 27, 12, REGSB}, - {AMOVD, C_LEXT, C_NONE, C_FREG, 27, 12, REGSB}, - {AMOVW, C_LAUTO, C_NONE, C_FREG, 27, 12, REGSP}, - {AMOVF, C_LAUTO, C_NONE, C_FREG, 27, 12, REGSP}, - {AMOVD, C_LAUTO, C_NONE, C_FREG, 27, 12, REGSP}, - {AMOVW, C_LOREG, C_NONE, C_FREG, 27, 12, REGZERO}, - {AMOVF, C_LOREG, C_NONE, C_FREG, 27, 12, REGZERO}, - {AMOVD, C_LOREG, C_NONE, C_FREG, 27, 12, REGZERO}, - {AMOVF, C_ADDR, C_NONE, C_FREG, 51, 12, 0}, - {AMOVD, C_ADDR, C_NONE, C_FREG, 51, 12, 0}, - - {AMOVW, C_FREG, C_NONE, C_SEXT, 28, 4, REGSB}, - {AMOVF, C_FREG, C_NONE, C_SEXT, 28, 4, REGSB}, - {AMOVD, C_FREG, C_NONE, C_SEXT, 28, 4, REGSB}, - {AMOVW, C_FREG, C_NONE, C_SAUTO, 28, 4, REGSP}, - {AMOVF, C_FREG, C_NONE, C_SAUTO, 28, 4, REGSP}, - {AMOVD, C_FREG, C_NONE, C_SAUTO, 28, 4, REGSP}, - {AMOVW, C_FREG, C_NONE, C_SOREG, 28, 4, REGZERO}, - {AMOVF, C_FREG, C_NONE, C_SOREG, 28, 4, REGZERO}, - {AMOVD, C_FREG, C_NONE, C_SOREG, 28, 4, REGZERO}, - - {AMOVW, C_FREG, C_NONE, C_LEXT, 28, 12, REGSB}, - {AMOVF, C_FREG, C_NONE, C_LEXT, 28, 12, REGSB}, - {AMOVD, C_FREG, C_NONE, C_LEXT, 28, 12, REGSB}, - {AMOVW, C_FREG, C_NONE, C_LAUTO, 28, 12, REGSP}, - {AMOVF, C_FREG, C_NONE, C_LAUTO, 28, 12, REGSP}, - {AMOVD, C_FREG, C_NONE, C_LAUTO, 28, 12, REGSP}, - {AMOVW, C_FREG, C_NONE, C_LOREG, 28, 12, REGZERO}, - {AMOVF, C_FREG, C_NONE, C_LOREG, 28, 12, REGZERO}, - {AMOVD, C_FREG, C_NONE, C_LOREG, 28, 12, REGZERO}, - {AMOVF, C_FREG, C_NONE, C_ADDR, 50, 12, 0}, - {AMOVD, C_FREG, C_NONE, C_ADDR, 50, 12, 0}, - - {AMOVW, C_REG, C_NONE, C_FREG, 30, 4, 0}, - {AMOVW, C_FREG, C_NONE, C_REG, 31, 4, 0}, - {AMOVV, C_REG, C_NONE, C_FREG, 47, 4, 0}, - {AMOVV, C_FREG, C_NONE, C_REG, 48, 4, 0}, - - {AMOVW, C_ADDCON, C_NONE, C_FREG, 34, 8, 0}, - {AMOVW, C_ANDCON, C_NONE, C_FREG, 34, 8, 0}, - - {AMOVW, C_REG, C_NONE, C_MREG, 37, 4, 0}, - {AMOVV, C_REG, C_NONE, C_MREG, 37, 4, 0}, - {AMOVW, C_MREG, C_NONE, C_REG, 38, 4, 0}, - {AMOVV, C_MREG, C_NONE, C_REG, 38, 4, 0}, - - {AWORD, C_LCON, C_NONE, C_NONE, 40, 4, 0}, - - {AMOVW, C_REG, C_NONE, C_FCREG, 41, 8, 0}, - {AMOVV, C_REG, C_NONE, C_FCREG, 41, 8, 0}, - {AMOVW, C_FCREG, C_NONE, C_REG, 42, 4, 0}, - {AMOVV, C_FCREG, C_NONE, C_REG, 42, 4, 0}, - - {ABREAK, C_REG, C_NONE, C_SEXT, 7, 4, REGSB}, /* really CACHE instruction */ - {ABREAK, C_REG, C_NONE, C_SAUTO, 7, 4, REGSP}, - {ABREAK, C_REG, C_NONE, C_SOREG, 7, 4, REGZERO}, - {ABREAK, C_NONE, C_NONE, C_NONE, 5, 4, 0}, - - {obj.AUNDEF, C_NONE, C_NONE, C_NONE, 49, 4, 0}, - {obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, 0, 0, 0}, - {obj.APCDATA, C_LCON, C_NONE, C_LCON, 0, 0, 0}, - {obj.AFUNCDATA, C_SCON, C_NONE, C_ADDR, 0, 0, 0}, - {obj.ANOP, C_NONE, C_NONE, C_NONE, 0, 0, 0}, - {obj.ADUFFZERO, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, // same as AJMP - {obj.ADUFFCOPY, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, // same as AJMP - - {obj.AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0}, -} - -var oprange [ALAST & obj.AMask][]Optab - -var xcmp [C_NCLASS][C_NCLASS]bool - -func span0(ctxt *obj.Link, cursym *obj.LSym) { - p := cursym.Text - if p == nil || p.Link == nil { // handle external functions and ELF section symbols - return - } - ctxt.Cursym = cursym - ctxt.Autosize = int32(p.To.Offset + 8) - - if oprange[AOR&obj.AMask] == nil { - buildop(ctxt) - } - - c := int64(0) - p.Pc = c - - var m int - var o *Optab - for p = p.Link; p != nil; p = p.Link { - ctxt.Curp = p - p.Pc = c - o = oplook(ctxt, p) - m = int(o.size) - if m == 0 { - if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD { - ctxt.Diag("zero-width instruction\n%v", p) - } - continue - } - - c += int64(m) - } - - cursym.Size = c - - /* - * if any procedure is large enough to - * generate a large SBRA branch, then - * generate extra passes putting branches - * around jmps to fix. this is rare. - */ - bflag := 1 - - var otxt int64 - var q *obj.Prog - for bflag != 0 { - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f span1\n", obj.Cputime()) - } - bflag = 0 - c = 0 - for p = cursym.Text.Link; p != nil; p = p.Link { - p.Pc = c - o = oplook(ctxt, p) - - // very large conditional branches - if o.type_ == 6 && p.Pcond != nil { - otxt = p.Pcond.Pc - c - if otxt < -(1<<17)+10 || otxt >= (1<<17)-10 { - q = ctxt.NewProg() - q.Link = p.Link - p.Link = q - q.As = AJMP - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.Pcond = p.Pcond - p.Pcond = q - q = ctxt.NewProg() - q.Link = p.Link - p.Link = q - q.As = AJMP - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.Pcond = q.Link.Link - - addnop(ctxt, p.Link) - addnop(ctxt, p) - bflag = 1 - } - } - - m = int(o.size) - if m == 0 { - if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD { - ctxt.Diag("zero-width instruction\n%v", p) - } - continue - } - - c += int64(m) - } - - cursym.Size = c - } - - c += -c & (funcAlign - 1) - cursym.Size = c - - /* - * lay out the code, emitting code and data relocations. - */ - - cursym.Grow(cursym.Size) - - bp := cursym.P - var i int32 - var out [4]uint32 - for p := cursym.Text.Link; p != nil; p = p.Link { - ctxt.Pc = p.Pc - ctxt.Curp = p - o = oplook(ctxt, p) - if int(o.size) > 4*len(out) { - log.Fatalf("out array in span0 is too small, need at least %d for %v", o.size/4, p) - } - asmout(ctxt, p, o, out[:]) - for i = 0; i < int32(o.size/4); i++ { - ctxt.Arch.ByteOrder.PutUint32(bp, out[i]) - bp = bp[4:] - } - } -} - -func isint32(v int64) bool { - return int64(int32(v)) == v -} - -func isuint32(v uint64) bool { - return uint64(uint32(v)) == v -} - -func aclass(ctxt *obj.Link, a *obj.Addr) int { - switch a.Type { - case obj.TYPE_NONE: - return C_NONE - - case obj.TYPE_REG: - if REG_R0 <= a.Reg && a.Reg <= REG_R31 { - return C_REG - } - if REG_F0 <= a.Reg && a.Reg <= REG_F31 { - return C_FREG - } - if REG_M0 <= a.Reg && a.Reg <= REG_M31 { - return C_MREG - } - if REG_FCR0 <= a.Reg && a.Reg <= REG_FCR31 { - return C_FCREG - } - if a.Reg == REG_LO { - return C_LO - } - if a.Reg == REG_HI { - return C_HI - } - return C_GOK - - case obj.TYPE_MEM: - switch a.Name { - case obj.NAME_EXTERN, - obj.NAME_STATIC: - if a.Sym == nil { - break - } - ctxt.Instoffset = a.Offset - if a.Sym != nil { // use relocation - if a.Sym.Type == obj.STLSBSS { - return C_TLS - } - return C_ADDR - } - return C_LEXT - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SAUTO - } - return C_LAUTO - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SAUTO - } - return C_LAUTO - - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if ctxt.Instoffset == 0 { - return C_ZOREG - } - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SOREG - } - return C_LOREG - } - - return C_GOK - - case obj.TYPE_TEXTSIZE: - return C_TEXTSIZE - - case obj.TYPE_CONST, - obj.TYPE_ADDR: - switch a.Name { - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if a.Reg != 0 { - if -BIG <= ctxt.Instoffset && ctxt.Instoffset <= BIG { - return C_SACON - } - if isint32(ctxt.Instoffset) { - return C_LACON - } - return C_DACON - } - - goto consize - - case obj.NAME_EXTERN, - obj.NAME_STATIC: - s := a.Sym - if s == nil { - break - } - if s.Type == obj.SCONST { - ctxt.Instoffset = a.Offset - goto consize - } - - ctxt.Instoffset = a.Offset - if s.Type == obj.STLSBSS { - return C_STCON // address of TLS variable - } - return C_LECON - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SACON - } - return C_LACON - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SACON - } - return C_LACON - } - - return C_GOK - - consize: - if ctxt.Instoffset >= 0 { - if ctxt.Instoffset == 0 { - return C_ZCON - } - if ctxt.Instoffset <= 0x7fff { - return C_SCON - } - if ctxt.Instoffset <= 0xffff { - return C_ANDCON - } - if ctxt.Instoffset&0xffff == 0 && isuint32(uint64(ctxt.Instoffset)) { /* && (instoffset & (1<<31)) == 0) */ - return C_UCON - } - if isint32(ctxt.Instoffset) || isuint32(uint64(ctxt.Instoffset)) { - return C_LCON - } - return C_LCON // C_DCON - } - - if ctxt.Instoffset >= -0x8000 { - return C_ADDCON - } - if ctxt.Instoffset&0xffff == 0 && isint32(ctxt.Instoffset) { - return C_UCON - } - if isint32(ctxt.Instoffset) { - return C_LCON - } - return C_LCON // C_DCON - - case obj.TYPE_BRANCH: - return C_SBRA - } - - return C_GOK -} - -func prasm(p *obj.Prog) { - fmt.Printf("%v\n", p) -} - -func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { - if oprange[AOR&obj.AMask] == nil { - buildop(ctxt) - } - - a1 := int(p.Optab) - if a1 != 0 { - return &optab[a1-1] - } - a1 = int(p.From.Class) - if a1 == 0 { - a1 = aclass(ctxt, &p.From) + 1 - p.From.Class = int8(a1) - } - - a1-- - a3 := int(p.To.Class) - if a3 == 0 { - a3 = aclass(ctxt, &p.To) + 1 - p.To.Class = int8(a3) - } - - a3-- - a2 := C_NONE - if p.Reg != 0 { - a2 = C_REG - } - - //print("oplook %P %d %d %d\n", p, a1, a2, a3); - - ops := oprange[p.As&obj.AMask] - c1 := &xcmp[a1] - c3 := &xcmp[a3] - for i := range ops { - op := &ops[i] - if int(op.a2) == a2 && c1[op.a1] && c3[op.a3] { - p.Optab = uint16(cap(optab) - cap(ops) + i + 1) - return op - } - } - - ctxt.Diag("illegal combination %v %v %v %v", p.As, DRconv(a1), DRconv(a2), DRconv(a3)) - prasm(p) - if ops == nil { - ops = optab - } - return &ops[0] -} - -func cmp(a int, b int) bool { - if a == b { - return true - } - switch a { - case C_LCON: - if b == C_ZCON || b == C_SCON || b == C_UCON || b == C_ADDCON || b == C_ANDCON { - return true - } - - case C_ADD0CON: - if b == C_ADDCON { - return true - } - fallthrough - - case C_ADDCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_AND0CON: - if b == C_ANDCON { - return true - } - fallthrough - - case C_ANDCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_UCON: - if b == C_ZCON { - return true - } - - case C_SCON: - if b == C_ZCON { - return true - } - - case C_LACON: - if b == C_SACON { - return true - } - - case C_LBRA: - if b == C_SBRA { - return true - } - - case C_LEXT: - if b == C_SEXT { - return true - } - - case C_LAUTO: - if b == C_SAUTO { - return true - } - - case C_REG: - if b == C_ZCON { - return r0iszero != 0 /*TypeKind(100016)*/ - } - - case C_LOREG: - if b == C_ZOREG || b == C_SOREG { - return true - } - - case C_SOREG: - if b == C_ZOREG { - return true - } - } - - return false -} - -type ocmp []Optab - -func (x ocmp) Len() int { - return len(x) -} - -func (x ocmp) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} - -func (x ocmp) Less(i, j int) bool { - p1 := &x[i] - p2 := &x[j] - n := int(p1.as) - int(p2.as) - if n != 0 { - return n < 0 - } - n = int(p1.a1) - int(p2.a1) - if n != 0 { - return n < 0 - } - n = int(p1.a2) - int(p2.a2) - if n != 0 { - return n < 0 - } - n = int(p1.a3) - int(p2.a3) - if n != 0 { - return n < 0 - } - return false -} - -func opset(a, b0 obj.As) { - oprange[a&obj.AMask] = oprange[b0] -} - -func buildop(ctxt *obj.Link) { - var n int - - for i := 0; i < C_NCLASS; i++ { - for n = 0; n < C_NCLASS; n++ { - if cmp(n, i) { - xcmp[i][n] = true - } - } - } - for n = 0; optab[n].as != obj.AXXX; n++ { - } - sort.Sort(ocmp(optab[:n])) - for i := 0; i < n; i++ { - r := optab[i].as - r0 := r & obj.AMask - start := i - for optab[i].as == r { - i++ - } - oprange[r0] = optab[start:i] - i-- - - switch r { - default: - ctxt.Diag("unknown op in build: %v", r) - log.Fatalf("bad code") - - case AABSF: - opset(AMOVFD, r0) - opset(AMOVDF, r0) - opset(AMOVWF, r0) - opset(AMOVFW, r0) - opset(AMOVWD, r0) - opset(AMOVDW, r0) - opset(ANEGF, r0) - opset(ANEGD, r0) - opset(AABSD, r0) - opset(ATRUNCDW, r0) - opset(ATRUNCFW, r0) - opset(ATRUNCDV, r0) - opset(ATRUNCFV, r0) - opset(AMOVVF, r0) - opset(AMOVFV, r0) - opset(AMOVVD, r0) - opset(AMOVDV, r0) - - case AADD: - opset(ASGT, r0) - opset(ASGTU, r0) - opset(AADDU, r0) - opset(AADDV, r0) - opset(AADDVU, r0) - - case AADDF: - opset(ADIVF, r0) - opset(ADIVD, r0) - opset(AMULF, r0) - opset(AMULD, r0) - opset(ASUBF, r0) - opset(ASUBD, r0) - opset(AADDD, r0) - - case AAND: - opset(AOR, r0) - opset(AXOR, r0) - - case ABEQ: - opset(ABNE, r0) - - case ABLEZ: - opset(ABGEZ, r0) - opset(ABGEZAL, r0) - opset(ABLTZ, r0) - opset(ABLTZAL, r0) - opset(ABGTZ, r0) - - case AMOVB: - opset(AMOVH, r0) - - case AMOVBU: - opset(AMOVHU, r0) - - case AMUL: - opset(AREM, r0) - opset(AREMU, r0) - opset(ADIVU, r0) - opset(AMULU, r0) - opset(ADIV, r0) - opset(ADIVV, r0) - opset(ADIVVU, r0) - opset(AMULV, r0) - opset(AMULVU, r0) - opset(AREMV, r0) - opset(AREMVU, r0) - - case ASLL: - opset(ASRL, r0) - opset(ASRA, r0) - opset(ASLLV, r0) - opset(ASRAV, r0) - opset(ASRLV, r0) - - case ASUB: - opset(ASUBU, r0) - opset(ASUBV, r0) - opset(ASUBVU, r0) - opset(ANOR, r0) - - case ASYSCALL: - opset(ATLBP, r0) - opset(ATLBR, r0) - opset(ATLBWI, r0) - opset(ATLBWR, r0) - - case ACMPEQF: - opset(ACMPGTF, r0) - opset(ACMPGTD, r0) - opset(ACMPGEF, r0) - opset(ACMPGED, r0) - opset(ACMPEQD, r0) - - case ABFPT: - opset(ABFPF, r0) - - case AMOVWL: - opset(AMOVWR, r0) - opset(AMOVVR, r0) - opset(AMOVVL, r0) - - case AMOVW, - AMOVD, - AMOVF, - AMOVV, - ABREAK, - ARFE, - AJAL, - AJMP, - AMOVWU, - AWORD, - obj.ANOP, - obj.ATEXT, - obj.AUNDEF, - obj.AUSEFIELD, - obj.AFUNCDATA, - obj.APCDATA, - obj.ADUFFZERO, - obj.ADUFFCOPY: - break - } - } -} - -func OP(x uint32, y uint32) uint32 { - return x<<3 | y<<0 -} - -func SP(x uint32, y uint32) uint32 { - return x<<29 | y<<26 -} - -func BCOND(x uint32, y uint32) uint32 { - return x<<19 | y<<16 -} - -func MMU(x uint32, y uint32) uint32 { - return SP(2, 0) | 16<<21 | x<<3 | y<<0 -} - -func FPF(x uint32, y uint32) uint32 { - return SP(2, 1) | 16<<21 | x<<3 | y<<0 -} - -func FPD(x uint32, y uint32) uint32 { - return SP(2, 1) | 17<<21 | x<<3 | y<<0 -} - -func FPW(x uint32, y uint32) uint32 { - return SP(2, 1) | 20<<21 | x<<3 | y<<0 -} - -func FPV(x uint32, y uint32) uint32 { - return SP(2, 1) | 21<<21 | x<<3 | y<<0 -} - -func OP_RRR(op uint32, r1 uint32, r2 uint32, r3 uint32) uint32 { - return op | (r1&31)<<16 | (r2&31)<<21 | (r3&31)<<11 -} - -func OP_IRR(op uint32, i uint32, r2 uint32, r3 uint32) uint32 { - return op | i&0xFFFF | (r2&31)<<21 | (r3&31)<<16 -} - -func OP_SRR(op uint32, s uint32, r2 uint32, r3 uint32) uint32 { - return op | (s&31)<<6 | (r2&31)<<16 | (r3&31)<<11 -} - -func OP_FRRR(op uint32, r1 uint32, r2 uint32, r3 uint32) uint32 { - return op | (r1&31)<<16 | (r2&31)<<11 | (r3&31)<<6 -} - -func OP_JMP(op uint32, i uint32) uint32 { - return op | i&0x3FFFFFF -} - -func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { - o1 := uint32(0) - o2 := uint32(0) - o3 := uint32(0) - o4 := uint32(0) - - switch o.type_ { - default: - ctxt.Diag("unknown type %d %v", o.type_) - prasm(p) - - case 0: /* pseudo ops */ - break - - case 1: /* mov r1,r2 ==> OR r1,r0,r2 */ - a := AOR - if p.As == AMOVW { - a = AADDU // sign-extended to high 32 bits - } - o1 = OP_RRR(oprrr(ctxt, a), uint32(p.From.Reg), uint32(REGZERO), uint32(p.To.Reg)) - - case 2: /* add/sub r1,[r2],r3 */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = OP_RRR(oprrr(ctxt, p.As), uint32(p.From.Reg), uint32(r), uint32(p.To.Reg)) - - case 3: /* mov $soreg, r ==> or/add $i,o,r */ - v := regoff(ctxt, &p.From) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - a := AADDVU - if o.a1 == C_ANDCON { - a = AOR - } - - o1 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(r), uint32(p.To.Reg)) - - case 4: /* add $scon,[r1],r2 */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - - o1 = OP_IRR(opirr(ctxt, p.As), uint32(v), uint32(r), uint32(p.To.Reg)) - - case 5: /* syscall */ - o1 = oprrr(ctxt, p.As) - - case 6: /* beq r1,[r2],sbra */ - v := int32(0) - if p.Pcond == nil { - v = int32(-4) >> 2 - } else { - v = int32(p.Pcond.Pc-p.Pc-4) >> 2 - } - if (v<<16)>>16 != v { - ctxt.Diag("short branch too far\n%v", p) - } - o1 = OP_IRR(opirr(ctxt, p.As), uint32(v), uint32(p.From.Reg), uint32(p.Reg)) - // for ABFPT and ABFPF only: always fill delay slot with 0 - // see comments in func preprocess for details. - o2 = 0 - - case 7: /* mov r, soreg ==> sw o(r) */ - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - v := regoff(ctxt, &p.To) - o1 = OP_IRR(opirr(ctxt, p.As), uint32(v), uint32(r), uint32(p.From.Reg)) - - case 8: /* mov soreg, r ==> lw o(r) */ - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - v := regoff(ctxt, &p.From) - o1 = OP_IRR(opirr(ctxt, -p.As), uint32(v), uint32(r), uint32(p.To.Reg)) - - case 9: /* sll r1,[r2],r3 */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = OP_RRR(oprrr(ctxt, p.As), uint32(r), uint32(p.From.Reg), uint32(p.To.Reg)) - - case 10: /* add $con,[r1],r2 ==> mov $con, t; add t,[r1],r2 */ - v := regoff(ctxt, &p.From) - a := AOR - if v < 0 { - a = AADDU - } - o1 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(0), uint32(REGTMP)) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o2 = OP_RRR(oprrr(ctxt, p.As), uint32(REGTMP), uint32(r), uint32(p.To.Reg)) - - case 11: /* jmp lbra */ - v := int32(0) - if aclass(ctxt, &p.To) == C_SBRA && p.To.Sym == nil && p.As == AJMP { - // use PC-relative branch for short branches - // BEQ R0, R0, sbra - if p.Pcond == nil { - v = int32(-4) >> 2 - } else { - v = int32(p.Pcond.Pc-p.Pc-4) >> 2 - } - if (v<<16)>>16 == v { - o1 = OP_IRR(opirr(ctxt, ABEQ), uint32(v), uint32(REGZERO), uint32(REGZERO)) - break - } - } - if p.Pcond == nil { - v = int32(p.Pc) >> 2 - } else { - v = int32(p.Pcond.Pc) >> 2 - } - o1 = OP_JMP(opirr(ctxt, p.As), uint32(v)) - if p.To.Sym == nil { - p.To.Sym = ctxt.Cursym.Text.From.Sym - p.To.Offset = p.Pcond.Pc - } - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - if p.As == AJAL { - rel.Type = obj.R_CALLMIPS - } else { - rel.Type = obj.R_JMPMIPS - } - - case 12: /* movbs r,r */ - v := 16 - if p.As == AMOVB { - v = 24 - } - o1 = OP_SRR(opirr(ctxt, ASLL), uint32(v), uint32(p.From.Reg), uint32(p.To.Reg)) - o2 = OP_SRR(opirr(ctxt, ASRA), uint32(v), uint32(p.To.Reg), uint32(p.To.Reg)) - - case 13: /* movbu r,r */ - if p.As == AMOVBU { - o1 = OP_IRR(opirr(ctxt, AAND), uint32(0xff), uint32(p.From.Reg), uint32(p.To.Reg)) - } else { - o1 = OP_IRR(opirr(ctxt, AAND), uint32(0xffff), uint32(p.From.Reg), uint32(p.To.Reg)) - } - - case 14: /* movwu r,r */ - o1 = OP_SRR(opirr(ctxt, -ASLLV), uint32(0), uint32(p.From.Reg), uint32(p.To.Reg)) - o2 = OP_SRR(opirr(ctxt, -ASRLV), uint32(0), uint32(p.To.Reg), uint32(p.To.Reg)) - - case 16: /* sll $c,[r1],r2 */ - v := regoff(ctxt, &p.From) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - - /* OP_SRR will use only the low 5 bits of the shift value */ - if v >= 32 && vshift(p.As) { - o1 = OP_SRR(opirr(ctxt, -p.As), uint32(v-32), uint32(r), uint32(p.To.Reg)) - } else { - o1 = OP_SRR(opirr(ctxt, p.As), uint32(v), uint32(r), uint32(p.To.Reg)) - } - - case 18: /* jmp [r1],0(r2) */ - r := int(p.Reg) - if r == 0 { - r = int(o.param) - } - o1 = OP_RRR(oprrr(ctxt, p.As), uint32(0), uint32(p.To.Reg), uint32(r)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 0 - rel.Type = obj.R_CALLIND - - case 19: /* mov $lcon,r ==> lu+or */ - v := regoff(ctxt, &p.From) - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(v>>16), uint32(REGZERO), uint32(p.To.Reg)) - o2 = OP_IRR(opirr(ctxt, AOR), uint32(v), uint32(p.To.Reg), uint32(p.To.Reg)) - - case 20: /* mov lo/hi,r */ - a := OP(2, 0) /* mfhi */ - if p.From.Reg == REG_LO { - a = OP(2, 2) /* mflo */ - } - o1 = OP_RRR(a, uint32(REGZERO), uint32(REGZERO), uint32(p.To.Reg)) - - case 21: /* mov r,lo/hi */ - a := OP(2, 1) /* mthi */ - if p.To.Reg == REG_LO { - a = OP(2, 3) /* mtlo */ - } - o1 = OP_RRR(a, uint32(REGZERO), uint32(p.From.Reg), uint32(REGZERO)) - - case 22: /* mul r1,r2 */ - o1 = OP_RRR(oprrr(ctxt, p.As), uint32(p.From.Reg), uint32(p.Reg), uint32(REGZERO)) - - case 23: /* add $lcon,r1,r2 ==> lu+or+add */ - v := regoff(ctxt, &p.From) - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(v>>16), uint32(REGZERO), uint32(REGTMP)) - o2 = OP_IRR(opirr(ctxt, AOR), uint32(v), uint32(REGTMP), uint32(REGTMP)) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o3 = OP_RRR(oprrr(ctxt, p.As), uint32(REGTMP), uint32(r), uint32(p.To.Reg)) - - case 24: /* mov $ucon,r ==> lu r */ - v := regoff(ctxt, &p.From) - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(v>>16), uint32(REGZERO), uint32(p.To.Reg)) - - case 25: /* add/and $ucon,[r1],r2 ==> lu $con,t; add t,[r1],r2 */ - v := regoff(ctxt, &p.From) - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(v>>16), uint32(REGZERO), uint32(REGTMP)) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o2 = OP_RRR(oprrr(ctxt, p.As), uint32(REGTMP), uint32(r), uint32(p.To.Reg)) - - case 26: /* mov $lsext/auto/oreg,r ==> lu+or+add */ - v := regoff(ctxt, &p.From) - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(v>>16), uint32(REGZERO), uint32(REGTMP)) - o2 = OP_IRR(opirr(ctxt, AOR), uint32(v), uint32(REGTMP), uint32(REGTMP)) - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o3 = OP_RRR(oprrr(ctxt, AADDVU), uint32(REGTMP), uint32(r), uint32(p.To.Reg)) - - case 27: /* mov [sl]ext/auto/oreg,fr ==> lwc1 o(r) */ - v := regoff(ctxt, &p.From) - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - a := -AMOVF - if p.As == AMOVD { - a = -AMOVD - } - switch o.size { - case 12: - o1 = OP_IRR(opirr(ctxt, ALUI), uint32((v+1<<15)>>16), uint32(REGZERO), uint32(REGTMP)) - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(r), uint32(REGTMP), uint32(REGTMP)) - o3 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(REGTMP), uint32(p.To.Reg)) - - case 4: - o1 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(r), uint32(p.To.Reg)) - } - - case 28: /* mov fr,[sl]ext/auto/oreg ==> swc1 o(r) */ - v := regoff(ctxt, &p.To) - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - a := AMOVF - if p.As == AMOVD { - a = AMOVD - } - switch o.size { - case 12: - o1 = OP_IRR(opirr(ctxt, ALUI), uint32((v+1<<15)>>16), uint32(REGZERO), uint32(REGTMP)) - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(r), uint32(REGTMP), uint32(REGTMP)) - o3 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(REGTMP), uint32(p.From.Reg)) - - case 4: - o1 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(r), uint32(p.From.Reg)) - } - - case 30: /* movw r,fr */ - a := SP(2, 1) | (4 << 21) /* mtc1 */ - o1 = OP_RRR(a, uint32(p.From.Reg), uint32(0), uint32(p.To.Reg)) - - case 31: /* movw fr,r */ - a := SP(2, 1) | (0 << 21) /* mtc1 */ - o1 = OP_RRR(a, uint32(p.To.Reg), uint32(0), uint32(p.From.Reg)) - - case 32: /* fadd fr1,[fr2],fr3 */ - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o1 = OP_FRRR(oprrr(ctxt, p.As), uint32(p.From.Reg), uint32(r), uint32(p.To.Reg)) - - case 33: /* fabs fr1, fr3 */ - o1 = OP_FRRR(oprrr(ctxt, p.As), uint32(0), uint32(p.From.Reg), uint32(p.To.Reg)) - - case 34: /* mov $con,fr ==> or/add $i,t; mov t,fr */ - v := regoff(ctxt, &p.From) - a := AADDU - if o.a1 == C_ANDCON { - a = AOR - } - o1 = OP_IRR(opirr(ctxt, a), uint32(v), uint32(0), uint32(REGTMP)) - o2 = OP_RRR(SP(2, 1)|(4<<21), uint32(REGTMP), uint32(0), uint32(p.To.Reg)) /* mtc1 */ - - case 35: /* mov r,lext/auto/oreg ==> sw o(REGTMP) */ - v := regoff(ctxt, &p.To) - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o1 = OP_IRR(opirr(ctxt, ALUI), uint32((v+1<<15)>>16), uint32(REGZERO), uint32(REGTMP)) - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(r), uint32(REGTMP), uint32(REGTMP)) - o3 = OP_IRR(opirr(ctxt, p.As), uint32(v), uint32(REGTMP), uint32(p.From.Reg)) - - case 36: /* mov lext/auto/oreg,r ==> lw o(REGTMP) */ - v := regoff(ctxt, &p.From) - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = OP_IRR(opirr(ctxt, ALUI), uint32((v+1<<15)>>16), uint32(REGZERO), uint32(REGTMP)) - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(r), uint32(REGTMP), uint32(REGTMP)) - o3 = OP_IRR(opirr(ctxt, -p.As), uint32(v), uint32(REGTMP), uint32(p.To.Reg)) - - case 37: /* movw r,mr */ - a := SP(2, 0) | (4 << 21) /* mtc0 */ - if p.As == AMOVV { - a = SP(2, 0) | (5 << 21) /* dmtc0 */ - } - o1 = OP_RRR(a, uint32(p.From.Reg), uint32(0), uint32(p.To.Reg)) - - case 38: /* movw mr,r */ - a := SP(2, 0) | (0 << 21) /* mfc0 */ - if p.As == AMOVV { - a = SP(2, 0) | (1 << 21) /* dmfc0 */ - } - o1 = OP_RRR(a, uint32(p.To.Reg), uint32(0), uint32(p.From.Reg)) - - case 40: /* word */ - o1 = uint32(regoff(ctxt, &p.From)) - - case 41: /* movw f,fcr */ - o1 = OP_RRR(SP(2, 1)|(2<<21), uint32(REGZERO), uint32(0), uint32(p.To.Reg)) /* mfcc1 */ - o2 = OP_RRR(SP(2, 1)|(6<<21), uint32(p.From.Reg), uint32(0), uint32(p.To.Reg)) /* mtcc1 */ - - case 42: /* movw fcr,r */ - o1 = OP_RRR(SP(2, 1)|(2<<21), uint32(p.To.Reg), uint32(0), uint32(p.From.Reg)) /* mfcc1 */ - - case 47: /* movv r,fr */ - a := SP(2, 1) | (5 << 21) /* dmtc1 */ - o1 = OP_RRR(a, uint32(p.From.Reg), uint32(0), uint32(p.To.Reg)) - - case 48: /* movv fr,r */ - a := SP(2, 1) | (1 << 21) /* dmtc1 */ - o1 = OP_RRR(a, uint32(p.To.Reg), uint32(0), uint32(p.From.Reg)) - - case 49: /* undef */ - o1 = 52 /* trap -- teq r0, r0 */ - - /* relocation operations */ - case 50: /* mov r,addr ==> lu + add REGSB, REGTMP + sw o(REGTMP) */ - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(0), uint32(REGZERO), uint32(REGTMP)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - rel.Type = obj.R_ADDRMIPSU - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(REGSB), uint32(REGTMP), uint32(REGTMP)) - o3 = OP_IRR(opirr(ctxt, p.As), uint32(0), uint32(REGTMP), uint32(p.From.Reg)) - rel2 := obj.Addrel(ctxt.Cursym) - rel2.Off = int32(ctxt.Pc + 8) - rel2.Siz = 4 - rel2.Sym = p.To.Sym - rel2.Add = p.To.Offset - rel2.Type = obj.R_ADDRMIPS - - case 51: /* mov addr,r ==> lu + add REGSB, REGTMP + lw o(REGTMP) */ - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(0), uint32(REGZERO), uint32(REGTMP)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDRMIPSU - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(REGSB), uint32(REGTMP), uint32(REGTMP)) - o3 = OP_IRR(opirr(ctxt, -p.As), uint32(0), uint32(REGTMP), uint32(p.To.Reg)) - rel2 := obj.Addrel(ctxt.Cursym) - rel2.Off = int32(ctxt.Pc + 8) - rel2.Siz = 4 - rel2.Sym = p.From.Sym - rel2.Add = p.From.Offset - rel2.Type = obj.R_ADDRMIPS - - case 52: /* mov $lext, r ==> lu + add REGSB, r + add */ - o1 = OP_IRR(opirr(ctxt, ALUI), uint32(0), uint32(REGZERO), uint32(p.To.Reg)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDRMIPSU - o2 = OP_RRR(oprrr(ctxt, AADDVU), uint32(REGSB), uint32(p.To.Reg), uint32(p.To.Reg)) - o3 = OP_IRR(opirr(ctxt, AADDVU), uint32(0), uint32(p.To.Reg), uint32(p.To.Reg)) - rel2 := obj.Addrel(ctxt.Cursym) - rel2.Off = int32(ctxt.Pc + 8) - rel2.Siz = 4 - rel2.Sym = p.From.Sym - rel2.Add = p.From.Offset - rel2.Type = obj.R_ADDRMIPS - - case 53: /* mov r, tlsvar ==> rdhwr + sw o(r3) */ - // clobbers R3 ! - // load thread pointer with RDHWR, R3 is used for fast kernel emulation on Linux - o1 = (037<<26 + 073) | (29 << 11) | (3 << 16) // rdhwr $29, r3 - o2 = OP_IRR(opirr(ctxt, p.As), uint32(0), uint32(REG_R3), uint32(p.From.Reg)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + 4) - rel.Siz = 4 - rel.Sym = p.To.Sym - rel.Add = p.To.Offset - rel.Type = obj.R_ADDRMIPSTLS - - case 54: /* mov tlsvar, r ==> rdhwr + lw o(r3) */ - // clobbers R3 ! - o1 = (037<<26 + 073) | (29 << 11) | (3 << 16) // rdhwr $29, r3 - o2 = OP_IRR(opirr(ctxt, -p.As), uint32(0), uint32(REG_R3), uint32(p.To.Reg)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + 4) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDRMIPSTLS - - case 55: /* mov $tlsvar, r ==> rdhwr + add */ - // clobbers R3 ! - o1 = (037<<26 + 073) | (29 << 11) | (3 << 16) // rdhwr $29, r3 - o2 = OP_IRR(opirr(ctxt, AADDVU), uint32(0), uint32(REG_R3), uint32(p.To.Reg)) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + 4) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDRMIPSTLS - } - - out[0] = o1 - out[1] = o2 - out[2] = o3 - out[3] = o4 - return -} - -func vregoff(ctxt *obj.Link, a *obj.Addr) int64 { - ctxt.Instoffset = 0 - aclass(ctxt, a) - return ctxt.Instoffset -} - -func regoff(ctxt *obj.Link, a *obj.Addr) int32 { - return int32(vregoff(ctxt, a)) -} - -func oprrr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AADD: - return OP(4, 0) - case AADDU: - return OP(4, 1) - case ASGT: - return OP(5, 2) - case ASGTU: - return OP(5, 3) - case AAND: - return OP(4, 4) - case AOR: - return OP(4, 5) - case AXOR: - return OP(4, 6) - case ASUB: - return OP(4, 2) - case ASUBU: - return OP(4, 3) - case ANOR: - return OP(4, 7) - case ASLL: - return OP(0, 4) - case ASRL: - return OP(0, 6) - case ASRA: - return OP(0, 7) - case ASLLV: - return OP(2, 4) - case ASRLV: - return OP(2, 6) - case ASRAV: - return OP(2, 7) - case AADDV: - return OP(5, 4) - case AADDVU: - return OP(5, 5) - case ASUBV: - return OP(5, 6) - case ASUBVU: - return OP(5, 7) - case AREM, - ADIV: - return OP(3, 2) - case AREMU, - ADIVU: - return OP(3, 3) - case AMUL: - return OP(3, 0) - case AMULU: - return OP(3, 1) - case AREMV, - ADIVV: - return OP(3, 6) - case AREMVU, - ADIVVU: - return OP(3, 7) - case AMULV: - return OP(3, 4) - case AMULVU: - return OP(3, 5) - - case AJMP: - return OP(1, 0) - case AJAL: - return OP(1, 1) - - case ABREAK: - return OP(1, 5) - case ASYSCALL: - return OP(1, 4) - case ATLBP: - return MMU(1, 0) - case ATLBR: - return MMU(0, 1) - case ATLBWI: - return MMU(0, 2) - case ATLBWR: - return MMU(0, 6) - case ARFE: - return MMU(2, 0) - - case ADIVF: - return FPF(0, 3) - case ADIVD: - return FPD(0, 3) - case AMULF: - return FPF(0, 2) - case AMULD: - return FPD(0, 2) - case ASUBF: - return FPF(0, 1) - case ASUBD: - return FPD(0, 1) - case AADDF: - return FPF(0, 0) - case AADDD: - return FPD(0, 0) - case ATRUNCFV: - return FPF(1, 1) - case ATRUNCDV: - return FPD(1, 1) - case ATRUNCFW: - return FPF(1, 5) - case ATRUNCDW: - return FPD(1, 5) - case AMOVFV: - return FPF(4, 5) - case AMOVDV: - return FPD(4, 5) - case AMOVVF: - return FPV(4, 0) - case AMOVVD: - return FPV(4, 1) - case AMOVFW: - return FPF(4, 4) - case AMOVDW: - return FPD(4, 4) - case AMOVWF: - return FPW(4, 0) - case AMOVDF: - return FPD(4, 0) - case AMOVWD: - return FPW(4, 1) - case AMOVFD: - return FPF(4, 1) - case AABSF: - return FPF(0, 5) - case AABSD: - return FPD(0, 5) - case AMOVF: - return FPF(0, 6) - case AMOVD: - return FPD(0, 6) - case ANEGF: - return FPF(0, 7) - case ANEGD: - return FPD(0, 7) - case ACMPEQF: - return FPF(6, 2) - case ACMPEQD: - return FPD(6, 2) - case ACMPGTF: - return FPF(7, 4) - case ACMPGTD: - return FPD(7, 4) - case ACMPGEF: - return FPF(7, 6) - case ACMPGED: - return FPD(7, 6) - } - - if a < 0 { - ctxt.Diag("bad rrr opcode -%v", -a) - } else { - ctxt.Diag("bad rrr opcode %v", a) - } - return 0 -} - -func opirr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AADD: - return SP(1, 0) - case AADDU: - return SP(1, 1) - case ASGT: - return SP(1, 2) - case ASGTU: - return SP(1, 3) - case AAND: - return SP(1, 4) - case AOR: - return SP(1, 5) - case AXOR: - return SP(1, 6) - case ALUI: - return SP(1, 7) - case ASLL: - return OP(0, 0) - case ASRL: - return OP(0, 2) - case ASRA: - return OP(0, 3) - case AADDV: - return SP(3, 0) - case AADDVU: - return SP(3, 1) - - case AJMP: - return SP(0, 2) - case AJAL, - obj.ADUFFZERO, - obj.ADUFFCOPY: - return SP(0, 3) - case ABEQ: - return SP(0, 4) - case -ABEQ: - return SP(2, 4) /* likely */ - case ABNE: - return SP(0, 5) - case -ABNE: - return SP(2, 5) /* likely */ - case ABGEZ: - return SP(0, 1) | BCOND(0, 1) - case -ABGEZ: - return SP(0, 1) | BCOND(0, 3) /* likely */ - case ABGEZAL: - return SP(0, 1) | BCOND(2, 1) - case -ABGEZAL: - return SP(0, 1) | BCOND(2, 3) /* likely */ - case ABGTZ: - return SP(0, 7) - case -ABGTZ: - return SP(2, 7) /* likely */ - case ABLEZ: - return SP(0, 6) - case -ABLEZ: - return SP(2, 6) /* likely */ - case ABLTZ: - return SP(0, 1) | BCOND(0, 0) - case -ABLTZ: - return SP(0, 1) | BCOND(0, 2) /* likely */ - case ABLTZAL: - return SP(0, 1) | BCOND(2, 0) - case -ABLTZAL: - return SP(0, 1) | BCOND(2, 2) /* likely */ - case ABFPT: - return SP(2, 1) | (257 << 16) - case -ABFPT: - return SP(2, 1) | (259 << 16) /* likely */ - case ABFPF: - return SP(2, 1) | (256 << 16) - case -ABFPF: - return SP(2, 1) | (258 << 16) /* likely */ - - case AMOVB, - AMOVBU: - return SP(5, 0) - case AMOVH, - AMOVHU: - return SP(5, 1) - case AMOVW, - AMOVWU: - return SP(5, 3) - case AMOVV: - return SP(7, 7) - case AMOVF: - return SP(7, 1) - case AMOVD: - return SP(7, 5) - case AMOVWL: - return SP(5, 2) - case AMOVWR: - return SP(5, 6) - case AMOVVL: - return SP(5, 4) - case AMOVVR: - return SP(5, 5) - - case ABREAK: - return SP(5, 7) - - case -AMOVWL: - return SP(4, 2) - case -AMOVWR: - return SP(4, 6) - case -AMOVVL: - return SP(3, 2) - case -AMOVVR: - return SP(3, 3) - case -AMOVB: - return SP(4, 0) - case -AMOVBU: - return SP(4, 4) - case -AMOVH: - return SP(4, 1) - case -AMOVHU: - return SP(4, 5) - case -AMOVW: - return SP(4, 3) - case -AMOVWU: - return SP(4, 7) - case -AMOVV: - return SP(6, 7) - case -AMOVF: - return SP(6, 1) - case -AMOVD: - return SP(6, 5) - - case ASLLV: - return OP(7, 0) - case ASRLV: - return OP(7, 2) - case ASRAV: - return OP(7, 3) - case -ASLLV: - return OP(7, 4) - case -ASRLV: - return OP(7, 6) - case -ASRAV: - return OP(7, 7) - } - - if a < 0 { - ctxt.Diag("bad irr opcode -%v", -a) - } else { - ctxt.Diag("bad irr opcode %v", a) - } - return 0 -} - -func vshift(a obj.As) bool { - switch a { - case ASLLV, - ASRLV, - ASRAV: - return true - } - return false -} diff --git a/vendor/github.com/google/gops/internal/obj/mips/list0.go b/vendor/github.com/google/gops/internal/obj/mips/list0.go deleted file mode 100644 index ac11abf6..00000000 --- a/vendor/github.com/google/gops/internal/obj/mips/list0.go +++ /dev/null @@ -1,85 +0,0 @@ -// cmd/9l/list.c from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package mips - -import ( - "fmt" - - "github.com/google/gops/internal/obj" -) - -func init() { - obj.RegisterRegister(obj.RBaseMIPS64, REG_LAST&^1023+1024, Rconv) - obj.RegisterOpcode(obj.ABaseMIPS64, Anames) -} - -func Rconv(r int) string { - if r == 0 { - return "NONE" - } - if r == REGG { - // Special case. - return "g" - } - if r == REGSB { - // Special case. - return "RSB" - } - if REG_R0 <= r && r <= REG_R31 { - return fmt.Sprintf("R%d", r-REG_R0) - } - if REG_F0 <= r && r <= REG_F31 { - return fmt.Sprintf("F%d", r-REG_F0) - } - if REG_M0 <= r && r <= REG_M31 { - return fmt.Sprintf("M%d", r-REG_M0) - } - if REG_FCR0 <= r && r <= REG_FCR31 { - return fmt.Sprintf("FCR%d", r-REG_FCR0) - } - if r == REG_HI { - return "HI" - } - if r == REG_LO { - return "LO" - } - - return fmt.Sprintf("Rgok(%d)", r-obj.RBaseMIPS64) -} - -func DRconv(a int) string { - s := "C_??" - if a >= C_NONE && a <= C_NCLASS { - s = cnames0[a] - } - var fp string - fp += s - return fp -} diff --git a/vendor/github.com/google/gops/internal/obj/mips/obj0.go b/vendor/github.com/google/gops/internal/obj/mips/obj0.go deleted file mode 100644 index d2895395..00000000 --- a/vendor/github.com/google/gops/internal/obj/mips/obj0.go +++ /dev/null @@ -1,1497 +0,0 @@ -// cmd/9l/noop.c, cmd/9l/pass.c, cmd/9l/span.c from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package mips - -import ( - "fmt" - "math" - - "github.com/google/gops/internal/obj" - "github.com/google/gops/internal/sys" -) - -func progedit(ctxt *obj.Link, p *obj.Prog) { - p.From.Class = 0 - p.To.Class = 0 - - // Rewrite JMP/JAL to symbol as TYPE_BRANCH. - switch p.As { - case AJMP, - AJAL, - ARET, - obj.ADUFFZERO, - obj.ADUFFCOPY: - if p.To.Sym != nil { - p.To.Type = obj.TYPE_BRANCH - } - } - - // Rewrite float constants to values stored in memory. - switch p.As { - case AMOVF: - if p.From.Type == obj.TYPE_FCONST { - f32 := float32(p.From.Val.(float64)) - i32 := math.Float32bits(f32) - if i32 == 0 { - p.As = AMOVV - p.From.Type = obj.TYPE_REG - p.From.Reg = REGZERO - break - } - literal := fmt.Sprintf("$f32.%08x", i32) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 4 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - case AMOVD: - if p.From.Type == obj.TYPE_FCONST { - i64 := math.Float64bits(p.From.Val.(float64)) - if i64 == 0 { - p.As = AMOVV - p.From.Type = obj.TYPE_REG - p.From.Reg = REGZERO - break - } - literal := fmt.Sprintf("$f64.%016x", i64) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - // Put >32-bit constants in memory and load them - case AMOVV: - if p.From.Type == obj.TYPE_CONST && p.From.Name == obj.NAME_NONE && p.From.Reg == 0 && int64(int32(p.From.Offset)) != p.From.Offset { - literal := fmt.Sprintf("$i64.%016x", uint64(p.From.Offset)) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - } - - // Rewrite SUB constants into ADD. - switch p.As { - case ASUB: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADD - } - - case ASUBU: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADDU - } - - case ASUBV: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADDV - } - - case ASUBVU: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADDVU - } - } -} - -func preprocess(ctxt *obj.Link, cursym *obj.LSym) { - // TODO(minux): add morestack short-cuts with small fixed frame-size. - ctxt.Cursym = cursym - - // a switch for enabling/disabling instruction scheduling - nosched := true - - if cursym.Text == nil || cursym.Text.Link == nil { - return - } - - p := cursym.Text - textstksiz := p.To.Offset - - cursym.Args = p.To.Val.(int32) - cursym.Locals = int32(textstksiz) - - /* - * find leaf subroutines - * strip NOPs - * expand RET - * expand BECOME pseudo - */ - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f noops\n", obj.Cputime()) - } - - var q *obj.Prog - var q1 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - switch p.As { - /* too hard, just leave alone */ - case obj.ATEXT: - q = p - - p.Mark |= LABEL | LEAF | SYNC - if p.Link != nil { - p.Link.Mark |= LABEL - } - - /* too hard, just leave alone */ - case AMOVW, - AMOVV: - q = p - if p.To.Type == obj.TYPE_REG && p.To.Reg >= REG_SPECIAL { - p.Mark |= LABEL | SYNC - break - } - if p.From.Type == obj.TYPE_REG && p.From.Reg >= REG_SPECIAL { - p.Mark |= LABEL | SYNC - } - - /* too hard, just leave alone */ - case ASYSCALL, - AWORD, - ATLBWR, - ATLBWI, - ATLBP, - ATLBR: - q = p - p.Mark |= LABEL | SYNC - - case ANOR: - q = p - if p.To.Type == obj.TYPE_REG { - if p.To.Reg == REGZERO { - p.Mark |= LABEL | SYNC - } - } - - case ABGEZAL, - ABLTZAL, - AJAL, - obj.ADUFFZERO, - obj.ADUFFCOPY: - cursym.Text.Mark &^= LEAF - fallthrough - - case AJMP, - ABEQ, - ABGEZ, - ABGTZ, - ABLEZ, - ABLTZ, - ABNE, - ABFPT, ABFPF: - if p.As == ABFPT || p.As == ABFPF { - // We don't treat ABFPT and ABFPF as branches here, - // so that we will always fill nop (0x0) in their - // delay slot during assembly. - // This is to workaround a kernel FPU emulator bug - // where it uses the user stack to simulate the - // instruction in the delay slot if it's not 0x0, - // and somehow that leads to SIGSEGV when the kernel - // jump to the stack. - p.Mark |= SYNC - } else { - p.Mark |= BRANCH - } - q = p - q1 = p.Pcond - if q1 != nil { - for q1.As == obj.ANOP { - q1 = q1.Link - p.Pcond = q1 - } - - if q1.Mark&LEAF == 0 { - q1.Mark |= LABEL - } - } - //else { - // p.Mark |= LABEL - //} - q1 = p.Link - if q1 != nil { - q1.Mark |= LABEL - } - continue - - case ARET: - q = p - if p.Link != nil { - p.Link.Mark |= LABEL - } - continue - - case obj.ANOP: - q1 = p.Link - q.Link = q1 /* q is non-nop */ - q1.Mark |= p.Mark - continue - - default: - q = p - continue - } - } - - autosize := int32(0) - var p1 *obj.Prog - var p2 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - o := p.As - switch o { - case obj.ATEXT: - autosize = int32(textstksiz + 8) - if (p.Mark&LEAF != 0) && autosize <= 8 { - autosize = 0 - } else if autosize&4 != 0 { - autosize += 4 - } - p.To.Offset = int64(autosize) - 8 - - if p.From3.Offset&obj.NOSPLIT == 0 { - p = stacksplit(ctxt, p, autosize) // emit split check - } - - q = p - - if autosize != 0 { - // Make sure to save link register for non-empty frame, even if - // it is a leaf function, so that traceback works. - // Store link register before decrement SP, so if a signal comes - // during the execution of the function prologue, the traceback - // code will not see a half-updated stack frame. - q = obj.Appendp(ctxt, q) - q.As = AMOVV - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REGLINK - q.To.Type = obj.TYPE_MEM - q.To.Offset = int64(-autosize) - q.To.Reg = REGSP - - q = obj.Appendp(ctxt, q) - q.As = AADDV - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(-autosize) - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Spadj = +autosize - } else if cursym.Text.Mark&LEAF == 0 { - if cursym.Text.From3.Offset&obj.NOSPLIT != 0 { - if ctxt.Debugvlog != 0 { - ctxt.Logf("save suppressed in: %s\n", cursym.Name) - } - - cursym.Text.Mark |= LEAF - } - } - - if cursym.Text.Mark&LEAF != 0 { - cursym.Set(obj.AttrLeaf, true) - break - } - - if cursym.Text.From3.Offset&obj.WRAPPER != 0 { - // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame - // - // MOVV g_panic(g), R1 - // BEQ R1, end - // MOVV panic_argp(R1), R2 - // ADDV $(autosize+8), R29, R3 - // BNE R2, R3, end - // ADDV $8, R29, R2 - // MOVV R2, panic_argp(R1) - // end: - // NOP - // - // The NOP is needed to give the jumps somewhere to land. - // It is a liblink NOP, not an mips NOP: it encodes to 0 instruction bytes. - - q = obj.Appendp(ctxt, q) - - q.As = AMOVV - q.From.Type = obj.TYPE_MEM - q.From.Reg = REGG - q.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R1 - - q = obj.Appendp(ctxt, q) - q.As = ABEQ - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R1 - q.To.Type = obj.TYPE_BRANCH - q.Mark |= BRANCH - p1 = q - - q = obj.Appendp(ctxt, q) - q.As = AMOVV - q.From.Type = obj.TYPE_MEM - q.From.Reg = REG_R1 - q.From.Offset = 0 // Panic.argp - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R2 - - q = obj.Appendp(ctxt, q) - q.As = AADDV - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(autosize) + 8 - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R3 - - q = obj.Appendp(ctxt, q) - q.As = ABNE - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R2 - q.Reg = REG_R3 - q.To.Type = obj.TYPE_BRANCH - q.Mark |= BRANCH - p2 = q - - q = obj.Appendp(ctxt, q) - q.As = AADDV - q.From.Type = obj.TYPE_CONST - q.From.Offset = 8 - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R2 - - q = obj.Appendp(ctxt, q) - q.As = AMOVV - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R2 - q.To.Type = obj.TYPE_MEM - q.To.Reg = REG_R1 - q.To.Offset = 0 // Panic.argp - - q = obj.Appendp(ctxt, q) - - q.As = obj.ANOP - p1.Pcond = q - p2.Pcond = q - } - - case ARET: - if p.From.Type == obj.TYPE_CONST { - ctxt.Diag("using BECOME (%v) is not supported!", p) - break - } - - retSym := p.To.Sym - p.To.Name = obj.NAME_NONE // clear fields as we may modify p to other instruction - p.To.Sym = nil - - if cursym.Text.Mark&LEAF != 0 { - if autosize == 0 { - p.As = AJMP - p.From = obj.Addr{} - if retSym != nil { // retjmp - p.To.Type = obj.TYPE_BRANCH - p.To.Name = obj.NAME_EXTERN - p.To.Sym = retSym - } else { - p.To.Type = obj.TYPE_MEM - p.To.Reg = REGLINK - p.To.Offset = 0 - } - p.Mark |= BRANCH - break - } - - p.As = AADDV - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(autosize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REGSP - p.Spadj = -autosize - - q = ctxt.NewProg() - q.As = AJMP - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_MEM - q.To.Offset = 0 - q.To.Reg = REGLINK - q.Mark |= BRANCH - q.Spadj = +autosize - - q.Link = p.Link - p.Link = q - break - } - - p.As = AMOVV - p.From.Type = obj.TYPE_MEM - p.From.Offset = 0 - p.From.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - if retSym != nil { // retjmp from non-leaf, need to restore LINK register - p.To.Reg = REGLINK - } - - if autosize != 0 { - q = ctxt.NewProg() - q.As = AADDV - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(autosize) - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Spadj = -autosize - - q.Link = p.Link - p.Link = q - } - - q1 = ctxt.NewProg() - q1.As = AJMP - q1.Lineno = p.Lineno - if retSym != nil { // retjmp - q1.To.Type = obj.TYPE_BRANCH - q1.To.Name = obj.NAME_EXTERN - q1.To.Sym = retSym - } else { - q1.To.Type = obj.TYPE_MEM - q1.To.Offset = 0 - q1.To.Reg = REG_R4 - } - q1.Mark |= BRANCH - q1.Spadj = +autosize - - q1.Link = q.Link - q.Link = q1 - - case AADDV, - AADDVU: - if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { - p.Spadj = int32(-p.From.Offset) - } - } - } - - if nosched { - // if we don't do instruction scheduling, simply add - // NOP after each branch instruction. - for p = cursym.Text; p != nil; p = p.Link { - if p.Mark&BRANCH != 0 { - addnop(ctxt, p) - } - } - return - } - - // instruction scheduling - q = nil // p - 1 - q1 = cursym.Text // top of block - o := 0 // count of instructions - for p = cursym.Text; p != nil; p = p1 { - p1 = p.Link - o++ - if p.Mark&NOSCHED != 0 { - if q1 != p { - sched(ctxt, q1, q) - } - for ; p != nil; p = p.Link { - if p.Mark&NOSCHED == 0 { - break - } - q = p - } - p1 = p - q1 = p - o = 0 - continue - } - if p.Mark&(LABEL|SYNC) != 0 { - if q1 != p { - sched(ctxt, q1, q) - } - q1 = p - o = 1 - } - if p.Mark&(BRANCH|SYNC) != 0 { - sched(ctxt, q1, p) - q1 = p1 - o = 0 - } - if o >= NSCHED { - sched(ctxt, q1, p) - q1 = p1 - o = 0 - } - q = p - } -} - -func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { - // MOVV g_stackguard(g), R1 - p = obj.Appendp(ctxt, p) - - p.As = AMOVV - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - - var q *obj.Prog - if framesize <= obj.StackSmall { - // small stack: SP < stackguard - // AGTU SP, stackguard, R1 - p = obj.Appendp(ctxt, p) - - p.As = ASGTU - p.From.Type = obj.TYPE_REG - p.From.Reg = REGSP - p.Reg = REG_R1 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - } else if framesize <= obj.StackBig { - // large stack: SP-framesize < stackguard-StackSmall - // ADDV $-framesize, SP, R2 - // SGTU R2, stackguard, R1 - p = obj.Appendp(ctxt, p) - - p.As = AADDV - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(-framesize) - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = ASGTU - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R2 - p.Reg = REG_R1 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - } else { - // Such a large stack we need to protect against wraparound. - // If SP is close to zero: - // SP-stackguard+StackGuard <= framesize + (StackGuard-StackSmall) - // The +StackGuard on both sides is required to keep the left side positive: - // SP is allowed to be slightly below stackguard. See stack.h. - // - // Preemption sets stackguard to StackPreempt, a very large value. - // That breaks the math above, so we have to check for that explicitly. - // // stackguard is R1 - // MOVV $StackPreempt, R2 - // BEQ R1, R2, label-of-call-to-morestack - // ADDV $StackGuard, SP, R2 - // SUBVU R1, R2 - // MOVV $(framesize+(StackGuard-StackSmall)), R1 - // SGTU R2, R1, R1 - p = obj.Appendp(ctxt, p) - - p.As = AMOVV - p.From.Type = obj.TYPE_CONST - p.From.Offset = obj.StackPreempt - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - q = p - p.As = ABEQ - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.Reg = REG_R2 - p.To.Type = obj.TYPE_BRANCH - p.Mark |= BRANCH - - p = obj.Appendp(ctxt, p) - p.As = AADDV - p.From.Type = obj.TYPE_CONST - p.From.Offset = obj.StackGuard - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = ASUBVU - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - - p = obj.Appendp(ctxt, p) - p.As = AMOVV - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + obj.StackGuard - obj.StackSmall - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - - p = obj.Appendp(ctxt, p) - p.As = ASGTU - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R2 - p.Reg = REG_R1 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R1 - } - - // q1: BNE R1, done - p = obj.Appendp(ctxt, p) - q1 := p - - p.As = ABNE - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R1 - p.To.Type = obj.TYPE_BRANCH - p.Mark |= BRANCH - - // MOVV LINK, R3 - p = obj.Appendp(ctxt, p) - - p.As = AMOVV - p.From.Type = obj.TYPE_REG - p.From.Reg = REGLINK - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R3 - if q != nil { - q.Pcond = p - p.Mark |= LABEL - } - - // JAL runtime.morestack(SB) - p = obj.Appendp(ctxt, p) - - p.As = AJAL - p.To.Type = obj.TYPE_BRANCH - if ctxt.Cursym.CFunc() { - p.To.Sym = obj.Linklookup(ctxt, "runtime.morestackc", 0) - } else if ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0 { - p.To.Sym = obj.Linklookup(ctxt, "runtime.morestack_noctxt", 0) - } else { - p.To.Sym = obj.Linklookup(ctxt, "runtime.morestack", 0) - } - p.Mark |= BRANCH - - // JMP start - p = obj.Appendp(ctxt, p) - - p.As = AJMP - p.To.Type = obj.TYPE_BRANCH - p.Pcond = ctxt.Cursym.Text.Link - p.Mark |= BRANCH - - // placeholder for q1's jump target - p = obj.Appendp(ctxt, p) - - p.As = obj.ANOP // zero-width place holder - q1.Pcond = p - - return p -} - -func addnop(ctxt *obj.Link, p *obj.Prog) { - q := ctxt.NewProg() - // we want to use the canonical NOP (SLL $0,R0,R0) here, - // however, as the assembler will always replace $0 - // as R0, we have to resort to manually encode the SLL - // instruction as WORD $0. - q.As = AWORD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Name = obj.NAME_NONE - q.From.Offset = 0 - - q.Link = p.Link - p.Link = q -} - -const ( - E_HILO = 1 << 0 - E_FCR = 1 << 1 - E_MCR = 1 << 2 - E_MEM = 1 << 3 - E_MEMSP = 1 << 4 /* uses offset and size */ - E_MEMSB = 1 << 5 /* uses offset and size */ - ANYMEM = E_MEM | E_MEMSP | E_MEMSB - //DELAY = LOAD|BRANCH|FCMP - DELAY = BRANCH /* only schedule branch */ -) - -type Dep struct { - ireg uint32 - freg uint32 - cc uint32 -} - -type Sch struct { - p obj.Prog - set Dep - used Dep - soffset int32 - size uint8 - nop uint8 - comp bool -} - -func sched(ctxt *obj.Link, p0, pe *obj.Prog) { - var sch [NSCHED]Sch - - /* - * build side structure - */ - s := sch[:] - for p := p0; ; p = p.Link { - s[0].p = *p - markregused(ctxt, &s[0]) - if p == pe { - break - } - s = s[1:] - } - se := s - - for i := cap(sch) - cap(se); i >= 0; i-- { - s = sch[i:] - if s[0].p.Mark&DELAY == 0 { - continue - } - if -cap(s) < -cap(se) { - if !conflict(&s[0], &s[1]) { - continue - } - } - - var t []Sch - var j int - for j = cap(sch) - cap(s) - 1; j >= 0; j-- { - t = sch[j:] - if t[0].comp { - if s[0].p.Mark&BRANCH != 0 { - goto no2 - } - } - if t[0].p.Mark&DELAY != 0 { - if -cap(s) >= -cap(se) || conflict(&t[0], &s[1]) { - goto no2 - } - } - for u := t[1:]; -cap(u) <= -cap(s); u = u[1:] { - if depend(ctxt, &u[0], &t[0]) { - goto no2 - } - } - goto out2 - no2: - } - - if s[0].p.Mark&BRANCH != 0 { - s[0].nop = 1 - } - continue - - out2: - // t[0] is the instruction being moved to fill the delay - stmp := t[0] - copy(t[:i-j], t[1:i-j+1]) - s[0] = stmp - - if t[i-j-1].p.Mark&BRANCH != 0 { - // t[i-j] is being put into a branch delay slot - // combine its Spadj with the branch instruction - t[i-j-1].p.Spadj += t[i-j].p.Spadj - t[i-j].p.Spadj = 0 - } - - i-- - } - - /* - * put it all back - */ - var p *obj.Prog - var q *obj.Prog - for s, p = sch[:], p0; -cap(s) <= -cap(se); s, p = s[1:], q { - q = p.Link - if q != s[0].p.Link { - *p = s[0].p - p.Link = q - } - for s[0].nop != 0 { - s[0].nop-- - addnop(ctxt, p) - } - } -} - -func markregused(ctxt *obj.Link, s *Sch) { - p := &s.p - s.comp = compound(ctxt, p) - s.nop = 0 - if s.comp { - s.set.ireg |= 1 << (REGTMP - REG_R0) - s.used.ireg |= 1 << (REGTMP - REG_R0) - } - - ar := 0 /* dest is really reference */ - ad := 0 /* source/dest is really address */ - ld := 0 /* opcode is load instruction */ - sz := 20 /* size of load/store for overlap computation */ - - /* - * flags based on opcode - */ - switch p.As { - case obj.ATEXT: - ctxt.Autosize = int32(p.To.Offset + 8) - ad = 1 - - case AJAL: - c := p.Reg - if c == 0 { - c = REGLINK - } - s.set.ireg |= 1 << uint(c-REG_R0) - ar = 1 - ad = 1 - - case ABGEZAL, - ABLTZAL: - s.set.ireg |= 1 << (REGLINK - REG_R0) - fallthrough - case ABEQ, - ABGEZ, - ABGTZ, - ABLEZ, - ABLTZ, - ABNE: - ar = 1 - ad = 1 - - case ABFPT, - ABFPF: - ad = 1 - s.used.cc |= E_FCR - - case ACMPEQD, - ACMPEQF, - ACMPGED, - ACMPGEF, - ACMPGTD, - ACMPGTF: - ar = 1 - s.set.cc |= E_FCR - p.Mark |= FCMP - - case AJMP: - ar = 1 - ad = 1 - - case AMOVB, - AMOVBU: - sz = 1 - ld = 1 - - case AMOVH, - AMOVHU: - sz = 2 - ld = 1 - - case AMOVF, - AMOVW, - AMOVWL, - AMOVWR: - sz = 4 - ld = 1 - - case AMOVD, - AMOVV, - AMOVVL, - AMOVVR: - sz = 8 - ld = 1 - - case ADIV, - ADIVU, - AMUL, - AMULU, - AREM, - AREMU, - ADIVV, - ADIVVU, - AMULV, - AMULVU, - AREMV, - AREMVU: - s.set.cc = E_HILO - fallthrough - case AADD, - AADDU, - AADDV, - AADDVU, - AAND, - ANOR, - AOR, - ASGT, - ASGTU, - ASLL, - ASRA, - ASRL, - ASLLV, - ASRAV, - ASRLV, - ASUB, - ASUBU, - ASUBV, - ASUBVU, - AXOR, - - AADDD, - AADDF, - AADDW, - ASUBD, - ASUBF, - ASUBW, - AMULF, - AMULD, - AMULW, - ADIVF, - ADIVD, - ADIVW: - if p.Reg == 0 { - if p.To.Type == obj.TYPE_REG { - p.Reg = p.To.Reg - } - //if(p->reg == NREG) - // print("botch %P\n", p); - } - } - - /* - * flags based on 'to' field - */ - c := int(p.To.Class) - if c == 0 { - c = aclass(ctxt, &p.To) + 1 - p.To.Class = int8(c) - } - c-- - switch c { - default: - fmt.Printf("unknown class %d %v\n", c, p) - - case C_ZCON, - C_SCON, - C_ADD0CON, - C_AND0CON, - C_ADDCON, - C_ANDCON, - C_UCON, - C_LCON, - C_NONE, - C_SBRA, - C_LBRA, - C_ADDR, - C_TEXTSIZE: - break - - case C_HI, - C_LO: - s.set.cc |= E_HILO - - case C_FCREG: - s.set.cc |= E_FCR - - case C_MREG: - s.set.cc |= E_MCR - - case C_ZOREG, - C_SOREG, - C_LOREG: - c = int(p.To.Reg) - s.used.ireg |= 1 << uint(c-REG_R0) - if ad != 0 { - break - } - s.size = uint8(sz) - s.soffset = regoff(ctxt, &p.To) - - m := uint32(ANYMEM) - if c == REGSB { - m = E_MEMSB - } - if c == REGSP { - m = E_MEMSP - } - - if ar != 0 { - s.used.cc |= m - } else { - s.set.cc |= m - } - - case C_SACON, - C_LACON: - s.used.ireg |= 1 << (REGSP - REG_R0) - - case C_SECON, - C_LECON: - s.used.ireg |= 1 << (REGSB - REG_R0) - - case C_REG: - if ar != 0 { - s.used.ireg |= 1 << uint(p.To.Reg-REG_R0) - } else { - s.set.ireg |= 1 << uint(p.To.Reg-REG_R0) - } - - case C_FREG: - if ar != 0 { - s.used.freg |= 1 << uint(p.To.Reg-REG_F0) - } else { - s.set.freg |= 1 << uint(p.To.Reg-REG_F0) - } - if ld != 0 && p.From.Type == obj.TYPE_REG { - p.Mark |= LOAD - } - - case C_SAUTO, - C_LAUTO: - s.used.ireg |= 1 << (REGSP - REG_R0) - if ad != 0 { - break - } - s.size = uint8(sz) - s.soffset = regoff(ctxt, &p.To) - - if ar != 0 { - s.used.cc |= E_MEMSP - } else { - s.set.cc |= E_MEMSP - } - - case C_SEXT, - C_LEXT: - s.used.ireg |= 1 << (REGSB - REG_R0) - if ad != 0 { - break - } - s.size = uint8(sz) - s.soffset = regoff(ctxt, &p.To) - - if ar != 0 { - s.used.cc |= E_MEMSB - } else { - s.set.cc |= E_MEMSB - } - } - - /* - * flags based on 'from' field - */ - c = int(p.From.Class) - if c == 0 { - c = aclass(ctxt, &p.From) + 1 - p.From.Class = int8(c) - } - c-- - switch c { - default: - fmt.Printf("unknown class %d %v\n", c, p) - - case C_ZCON, - C_SCON, - C_ADD0CON, - C_AND0CON, - C_ADDCON, - C_ANDCON, - C_UCON, - C_LCON, - C_NONE, - C_SBRA, - C_LBRA, - C_ADDR, - C_TEXTSIZE: - break - - case C_HI, - C_LO: - s.used.cc |= E_HILO - - case C_FCREG: - s.used.cc |= E_FCR - - case C_MREG: - s.used.cc |= E_MCR - - case C_ZOREG, - C_SOREG, - C_LOREG: - c = int(p.From.Reg) - s.used.ireg |= 1 << uint(c-REG_R0) - if ld != 0 { - p.Mark |= LOAD - } - s.size = uint8(sz) - s.soffset = regoff(ctxt, &p.From) - - m := uint32(ANYMEM) - if c == REGSB { - m = E_MEMSB - } - if c == REGSP { - m = E_MEMSP - } - - s.used.cc |= m - - case C_SACON, - C_LACON: - c = int(p.From.Reg) - if c == 0 { - c = REGSP - } - s.used.ireg |= 1 << uint(c-REG_R0) - - case C_SECON, - C_LECON: - s.used.ireg |= 1 << (REGSB - REG_R0) - - case C_REG: - s.used.ireg |= 1 << uint(p.From.Reg-REG_R0) - - case C_FREG: - s.used.freg |= 1 << uint(p.From.Reg-REG_F0) - if ld != 0 && p.To.Type == obj.TYPE_REG { - p.Mark |= LOAD - } - - case C_SAUTO, - C_LAUTO: - s.used.ireg |= 1 << (REGSP - REG_R0) - if ld != 0 { - p.Mark |= LOAD - } - if ad != 0 { - break - } - s.size = uint8(sz) - s.soffset = regoff(ctxt, &p.From) - - s.used.cc |= E_MEMSP - - case C_SEXT: - case C_LEXT: - s.used.ireg |= 1 << (REGSB - REG_R0) - if ld != 0 { - p.Mark |= LOAD - } - if ad != 0 { - break - } - s.size = uint8(sz) - s.soffset = regoff(ctxt, &p.From) - - s.used.cc |= E_MEMSB - } - - c = int(p.Reg) - if c != 0 { - if REG_F0 <= c && c <= REG_F31 { - s.used.freg |= 1 << uint(c-REG_F0) - } else { - s.used.ireg |= 1 << uint(c-REG_R0) - } - } - s.set.ireg &^= (1 << (REGZERO - REG_R0)) /* R0 can't be set */ -} - -/* - * test to see if two instructions can be - * interchanged without changing semantics - */ -func depend(ctxt *obj.Link, sa, sb *Sch) bool { - if sa.set.ireg&(sb.set.ireg|sb.used.ireg) != 0 { - return true - } - if sb.set.ireg&sa.used.ireg != 0 { - return true - } - - if sa.set.freg&(sb.set.freg|sb.used.freg) != 0 { - return true - } - if sb.set.freg&sa.used.freg != 0 { - return true - } - - /* - * special case. - * loads from same address cannot pass. - * this is for hardware fifo's and the like - */ - if sa.used.cc&sb.used.cc&E_MEM != 0 { - if sa.p.Reg == sb.p.Reg { - if regoff(ctxt, &sa.p.From) == regoff(ctxt, &sb.p.From) { - return true - } - } - } - - x := (sa.set.cc & (sb.set.cc | sb.used.cc)) | (sb.set.cc & sa.used.cc) - if x != 0 { - /* - * allow SB and SP to pass each other. - * allow SB to pass SB iff doffsets are ok - * anything else conflicts - */ - if x != E_MEMSP && x != E_MEMSB { - return true - } - x = sa.set.cc | sb.set.cc | sa.used.cc | sb.used.cc - if x&E_MEM != 0 { - return true - } - if offoverlap(sa, sb) { - return true - } - } - - return false -} - -func offoverlap(sa, sb *Sch) bool { - if sa.soffset < sb.soffset { - if sa.soffset+int32(sa.size) > sb.soffset { - return true - } - return false - } - if sb.soffset+int32(sb.size) > sa.soffset { - return true - } - return false -} - -/* - * test 2 adjacent instructions - * and find out if inserted instructions - * are desired to prevent stalls. - */ -func conflict(sa, sb *Sch) bool { - if sa.set.ireg&sb.used.ireg != 0 { - return true - } - if sa.set.freg&sb.used.freg != 0 { - return true - } - if sa.set.cc&sb.used.cc != 0 { - return true - } - return false -} - -func compound(ctxt *obj.Link, p *obj.Prog) bool { - o := oplook(ctxt, p) - if o.size != 4 { - return true - } - if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSB { - return true - } - return false -} - -func follow(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - firstp := ctxt.NewProg() - lastp := firstp - xfol(ctxt, s.Text, &lastp) - lastp.Link = nil - s.Text = firstp.Link -} - -func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { - var q *obj.Prog - var r *obj.Prog - var i int - -loop: - if p == nil { - return - } - a := p.As - if a == AJMP { - q = p.Pcond - if (p.Mark&NOSCHED != 0) || q != nil && (q.Mark&NOSCHED != 0) { - p.Mark |= FOLL - (*last).Link = p - *last = p - p = p.Link - xfol(ctxt, p, last) - p = q - if p != nil && p.Mark&FOLL == 0 { - goto loop - } - return - } - - if q != nil { - p.Mark |= FOLL - p = q - if p.Mark&FOLL == 0 { - goto loop - } - } - } - - if p.Mark&FOLL != 0 { - i = 0 - q = p - for ; i < 4; i, q = i+1, q.Link { - if q == *last || (q.Mark&NOSCHED != 0) { - break - } - a = q.As - if a == obj.ANOP { - i-- - continue - } - - if a == AJMP || a == ARET || a == ARFE { - goto copy - } - if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { - continue - } - if a != ABEQ && a != ABNE { - continue - } - - copy: - for { - r = ctxt.NewProg() - *r = *p - if r.Mark&FOLL == 0 { - fmt.Printf("can't happen 1\n") - } - r.Mark |= FOLL - if p != q { - p = p.Link - (*last).Link = r - *last = r - continue - } - - (*last).Link = r - *last = r - if a == AJMP || a == ARET || a == ARFE { - return - } - r.As = ABNE - if a == ABNE { - r.As = ABEQ - } - r.Pcond = p.Link - r.Link = p.Pcond - if r.Link.Mark&FOLL == 0 { - xfol(ctxt, r.Link, last) - } - if r.Pcond.Mark&FOLL == 0 { - fmt.Printf("can't happen 2\n") - } - return - } - } - - a = AJMP - q = ctxt.NewProg() - q.As = a - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.To.Offset = p.Pc - q.Pcond = p - p = q - } - - p.Mark |= FOLL - (*last).Link = p - *last = p - if a == AJMP || a == ARET || a == ARFE { - if p.Mark&NOSCHED != 0 { - p = p.Link - goto loop - } - - return - } - - if p.Pcond != nil { - if a != AJAL && p.Link != nil { - xfol(ctxt, p.Link, last) - p = p.Pcond - if p == nil || (p.Mark&FOLL != 0) { - return - } - goto loop - } - } - - p = p.Link - goto loop -} - -var Linkmips64 = obj.LinkArch{ - Arch: sys.ArchMIPS64, - Preprocess: preprocess, - Assemble: span0, - Follow: follow, - Progedit: progedit, -} - -var Linkmips64le = obj.LinkArch{ - Arch: sys.ArchMIPS64LE, - Preprocess: preprocess, - Assemble: span0, - Follow: follow, - Progedit: progedit, -} diff --git a/vendor/github.com/google/gops/internal/obj/obj.go b/vendor/github.com/google/gops/internal/obj/obj.go deleted file mode 100644 index 566263d3..00000000 --- a/vendor/github.com/google/gops/internal/obj/obj.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -import ( - "fmt" - "path/filepath" - "sort" - "strings" -) - -// A LineHist records the history of the file input stack, which maps the virtual line number, -// an incrementing count of lines processed in any input file and typically named lineno, -// to a stack of file:line pairs showing the path of inclusions that led to that position. -// The first line directive (//line in Go, #line in assembly) is treated as pushing -// a new entry on the stack, so that errors can report both the actual and translated -// line number. -// -// In typical use, the virtual lineno begins at 1, and file line numbers also begin at 1, -// but the only requirements placed upon the numbers by this code are: -// - calls to Push, Update, and Pop must be monotonically increasing in lineno -// - except as specified by those methods, virtual and file line number increase -// together, so that given (only) calls Push(10, "x.go", 1) and Pop(15), -// virtual line 12 corresponds to x.go line 3. -type LineHist struct { - Top *LineStack // current top of stack - Ranges []LineRange // ranges for lookup - Dir string // directory to qualify relative paths - TrimPathPrefix string // remove leading TrimPath from recorded file names - PrintFilenameOnly bool // ignore path when pretty-printing a line; internal use only - GOROOT string // current GOROOT -} - -// A LineStack is an entry in the recorded line history. -// Although the history at any given line number is a stack, -// the record for all line processed forms a tree, with common -// stack prefixes acting as parents. -type LineStack struct { - Parent *LineStack // parent in inclusion stack - Lineno int // virtual line number where this entry takes effect - File string // file name used to open source file, for error messages - AbsFile string // absolute file name, for pcln tables - FileLine int // line number in file at Lineno - Directive bool - Sym *LSym // for linkgetline - TODO(rsc): remove -} - -func (stk *LineStack) fileLineAt(lineno int) int { - return stk.FileLine + lineno - stk.Lineno -} - -// The span of valid linenos in the recorded line history can be broken -// into a set of ranges, each with a particular stack. -// A LineRange records one such range. -type LineRange struct { - Start int // starting lineno - Stack *LineStack // top of stack for this range -} - -// startRange starts a new range with the given top of stack. -func (h *LineHist) startRange(lineno int, top *LineStack) { - h.Top = top - h.Ranges = append(h.Ranges, LineRange{top.Lineno, top}) -} - -// setFile sets stk.File = file and also derives stk.AbsFile. -func (h *LineHist) setFile(stk *LineStack, file string) { - // Note: The exclusion of stk.Directive may be wrong but matches what we've done before. - // The check for < avoids putting a path prefix on "". - abs := file - if h.Dir != "" && !filepath.IsAbs(file) && !strings.HasPrefix(file, "<") && !stk.Directive { - abs = filepath.Join(h.Dir, file) - } - - // Remove leading TrimPathPrefix, or else rewrite $GOROOT to literal $GOROOT. - if h.TrimPathPrefix != "" && hasPathPrefix(abs, h.TrimPathPrefix) { - if abs == h.TrimPathPrefix { - abs = "" - } else { - abs = abs[len(h.TrimPathPrefix)+1:] - } - } else if hasPathPrefix(abs, h.GOROOT) { - abs = "$GOROOT" + abs[len(h.GOROOT):] - } - if abs == "" { - abs = "??" - } - abs = filepath.Clean(abs) - stk.AbsFile = abs - - if file == "" { - file = "??" - } - stk.File = file -} - -// Does s have t as a path prefix? -// That is, does s == t or does s begin with t followed by a slash? -// For portability, we allow ASCII case folding, so that hasPathPrefix("a/b/c", "A/B") is true. -// Similarly, we allow slash folding, so that hasPathPrefix("a/b/c", "a\\b") is true. -// We do not allow full Unicode case folding, for fear of causing more confusion -// or harm than good. (For an example of the kinds of things that can go wrong, -// see http://article.gmane.org/gmane.linux.kernel/1853266.) -func hasPathPrefix(s string, t string) bool { - if len(t) > len(s) { - return false - } - var i int - for i = 0; i < len(t); i++ { - cs := int(s[i]) - ct := int(t[i]) - if 'A' <= cs && cs <= 'Z' { - cs += 'a' - 'A' - } - if 'A' <= ct && ct <= 'Z' { - ct += 'a' - 'A' - } - if cs == '\\' { - cs = '/' - } - if ct == '\\' { - ct = '/' - } - if cs != ct { - return false - } - } - return i >= len(s) || s[i] == '/' || s[i] == '\\' -} - -// Push records that at that lineno a new file with the given name was pushed onto the input stack. -func (h *LineHist) Push(lineno int, file string) { - stk := &LineStack{ - Parent: h.Top, - Lineno: lineno, - FileLine: 1, - } - h.setFile(stk, file) - h.startRange(lineno, stk) -} - -// Pop records that at lineno the current file was popped from the input stack. -func (h *LineHist) Pop(lineno int) { - top := h.Top - if top == nil { - return - } - if top.Directive && top.Parent != nil { // pop #line level too - top = top.Parent - } - next := top.Parent - if next == nil { - h.Top = nil - h.Ranges = append(h.Ranges, LineRange{lineno, nil}) - return - } - - // Popping included file. Update parent offset to account for - // the virtual line number range taken by the included file. - // Cannot modify the LineStack directly, or else lookups - // for the earlier line numbers will get the wrong answers, - // so make a new one. - stk := new(LineStack) - *stk = *next - stk.Lineno = lineno - stk.FileLine = next.fileLineAt(top.Lineno) - h.startRange(lineno, stk) -} - -// Update records that at lineno the file name and line number were changed using -// a line directive (//line in Go, #line in assembly). -func (h *LineHist) Update(lineno int, file string, line int) { - top := h.Top - if top == nil { - return // shouldn't happen - } - var stk *LineStack - if top.Directive { - // Update existing entry, except make copy to avoid changing earlier history. - stk = new(LineStack) - *stk = *top - } else { - // Push new entry. - stk = &LineStack{ - Parent: top, - Directive: true, - } - } - stk.Lineno = lineno - if stk.File != file { - h.setFile(stk, file) // only retain string if needed - } - stk.FileLine = line - h.startRange(lineno, stk) -} - -// AddImport adds a package to the list of imported packages. -func (ctxt *Link) AddImport(pkg string) { - ctxt.Imports = append(ctxt.Imports, pkg) -} - -// At returns the input stack in effect at lineno. -func (h *LineHist) At(lineno int) *LineStack { - i := sort.Search(len(h.Ranges), func(i int) bool { - return h.Ranges[i].Start > lineno - }) - // Found first entry beyond lineno. - if i == 0 { - return nil - } - return h.Ranges[i-1].Stack -} - -// LineString returns a string giving the file and line number -// corresponding to lineno, for use in error messages. -func (h *LineHist) LineString(lineno int) string { - stk := h.At(lineno) - if stk == nil { - return "" - } - - filename := stk.File - if h.PrintFilenameOnly { - filename = filepath.Base(filename) - } - text := fmt.Sprintf("%s:%d", filename, stk.fileLineAt(lineno)) - if stk.Directive && stk.Parent != nil { - stk = stk.Parent - filename = stk.File - if h.PrintFilenameOnly { - filename = filepath.Base(filename) - } - text += fmt.Sprintf("[%s:%d]", filename, stk.fileLineAt(lineno)) - } - const showFullStack = false // was used by old C compilers - if showFullStack { - for stk.Parent != nil { - lineno = stk.Lineno - 1 - stk = stk.Parent - text += fmt.Sprintf(" %s:%d", filename, stk.fileLineAt(lineno)) - if stk.Directive && stk.Parent != nil { - stk = stk.Parent - text += fmt.Sprintf("[%s:%d]", filename, stk.fileLineAt(lineno)) - } - } - } - return text -} - -// FileLine returns the file name and line number -// at the top of the stack for the given lineno. -func (h *LineHist) FileLine(lineno int) (file string, line int) { - stk := h.At(lineno) - if stk == nil { - return "??", 0 - } - return stk.File, stk.fileLineAt(lineno) -} - -// AbsFileLine returns the absolute file name and line number -// at the top of the stack for the given lineno. -func (h *LineHist) AbsFileLine(lineno int) (file string, line int) { - stk := h.At(lineno) - if stk == nil { - return "??", 0 - } - return stk.AbsFile, stk.fileLineAt(lineno) -} - -// This is a simplified copy of linklinefmt above. -// It doesn't allow printing the full stack, and it returns the file name and line number separately. -// TODO: Unify with linklinefmt somehow. -func linkgetline(ctxt *Link, lineno int32) (f *LSym, l int32) { - stk := ctxt.LineHist.At(int(lineno)) - if stk == nil || stk.AbsFile == "" { - return Linklookup(ctxt, "??", HistVersion), 0 - } - if stk.Sym == nil { - stk.Sym = Linklookup(ctxt, stk.AbsFile, HistVersion) - } - return stk.Sym, int32(stk.fileLineAt(int(lineno))) -} - -func Linkprfile(ctxt *Link, line int) { - fmt.Printf("%s ", ctxt.LineHist.LineString(line)) -} - -func fieldtrack(ctxt *Link, cursym *LSym) { - p := cursym.Text - if p == nil || p.Link == nil { // handle external functions and ELF section symbols - return - } - ctxt.Cursym = cursym - - for ; p != nil; p = p.Link { - if p.As == AUSEFIELD { - r := Addrel(ctxt.Cursym) - r.Off = 0 - r.Siz = 0 - r.Sym = p.From.Sym - r.Type = R_USEFIELD - } - } -} diff --git a/vendor/github.com/google/gops/internal/obj/objfile.go b/vendor/github.com/google/gops/internal/obj/objfile.go deleted file mode 100644 index 8a897f09..00000000 --- a/vendor/github.com/google/gops/internal/obj/objfile.go +++ /dev/null @@ -1,606 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Writing of Go object files. -// -// Originally, Go object files were Plan 9 object files, but no longer. -// Now they are more like standard object files, in that each symbol is defined -// by an associated memory image (bytes) and a list of relocations to apply -// during linking. We do not (yet?) use a standard file format, however. -// For now, the format is chosen to be as simple as possible to read and write. -// It may change for reasons of efficiency, or we may even switch to a -// standard file format if there are compelling benefits to doing so. -// See golang.org/s/go13linker for more background. -// -// The file format is: -// -// - magic header: "\x00\x00go17ld" -// - byte 1 - version number -// - sequence of strings giving dependencies (imported packages) -// - empty string (marks end of sequence) -// - sequence of symbol references used by the defined symbols -// - byte 0xff (marks end of sequence) -// - sequence of integer lengths: -// - total data length -// - total number of relocations -// - total number of pcdata -// - total number of automatics -// - total number of funcdata -// - total number of files -// - data, the content of the defined symbols -// - sequence of defined symbols -// - byte 0xff (marks end of sequence) -// - magic footer: "\xff\xffgo17ld" -// -// All integers are stored in a zigzag varint format. -// See golang.org/s/go12symtab for a definition. -// -// Data blocks and strings are both stored as an integer -// followed by that many bytes. -// -// A symbol reference is a string name followed by a version. -// -// A symbol points to other symbols using an index into the symbol -// reference sequence. Index 0 corresponds to a nil LSym* pointer. -// In the symbol layout described below "symref index" stands for this -// index. -// -// Each symbol is laid out as the following fields (taken from LSym*): -// -// - byte 0xfe (sanity check for synchronization) -// - type [int] -// - name & version [symref index] -// - flags [int] -// 1<<0 dupok -// 1<<1 local -// 1<<2 add to typelink table -// - size [int] -// - gotype [symref index] -// - p [data block] -// - nr [int] -// - r [nr relocations, sorted by off] -// -// If type == STEXT, there are a few more fields: -// -// - args [int] -// - locals [int] -// - nosplit [int] -// - flags [int] -// 1<<0 leaf -// 1<<1 C function -// 1<<2 function may call reflect.Type.Method -// - nlocal [int] -// - local [nlocal automatics] -// - pcln [pcln table] -// -// Each relocation has the encoding: -// -// - off [int] -// - siz [int] -// - type [int] -// - add [int] -// - sym [symref index] -// -// Each local has the encoding: -// -// - asym [symref index] -// - offset [int] -// - type [int] -// - gotype [symref index] -// -// The pcln table has the encoding: -// -// - pcsp [data block] -// - pcfile [data block] -// - pcline [data block] -// - npcdata [int] -// - pcdata [npcdata data blocks] -// - nfuncdata [int] -// - funcdata [nfuncdata symref index] -// - funcdatasym [nfuncdata ints] -// - nfile [int] -// - file [nfile symref index] -// -// The file layout and meaning of type integers are architecture-independent. -// -// TODO(rsc): The file format is good for a first pass but needs work. -// - There are SymID in the object file that should really just be strings. - -package obj - -import ( - "bufio" - "fmt" - "log" - "path/filepath" - "sort" - - "github.com/google/gops/internal/dwarf" - "github.com/google/gops/internal/sys" -) - -// The Go and C compilers, and the assembler, call writeobj to write -// out a Go object file. The linker does not call this; the linker -// does not write out object files. -func Writeobjdirect(ctxt *Link, b *bufio.Writer) { - Flushplist(ctxt) - WriteObjFile(ctxt, b) -} - -// objWriter writes Go object files. -type objWriter struct { - wr *bufio.Writer - ctxt *Link - // Temporary buffer for zigzag int writing. - varintbuf [10]uint8 - - // Provide the the index of a symbol reference by symbol name. - // One map for versioned symbols and one for unversioned symbols. - // Used for deduplicating the symbol reference list. - refIdx map[string]int - vrefIdx map[string]int - - // Number of objects written of each type. - nRefs int - nData int - nReloc int - nPcdata int - nAutom int - nFuncdata int - nFile int -} - -func (w *objWriter) addLengths(s *LSym) { - w.nData += len(s.P) - w.nReloc += len(s.R) - - if s.Type != STEXT { - return - } - - pc := s.Pcln - - data := 0 - data += len(pc.Pcsp.P) - data += len(pc.Pcfile.P) - data += len(pc.Pcline.P) - for i := 0; i < len(pc.Pcdata); i++ { - data += len(pc.Pcdata[i].P) - } - - w.nData += data - w.nPcdata += len(pc.Pcdata) - - autom := 0 - for a := s.Autom; a != nil; a = a.Link { - autom++ - } - w.nAutom += autom - w.nFuncdata += len(pc.Funcdataoff) - w.nFile += len(pc.File) -} - -func (w *objWriter) writeLengths() { - w.writeInt(int64(w.nData)) - w.writeInt(int64(w.nReloc)) - w.writeInt(int64(w.nPcdata)) - w.writeInt(int64(w.nAutom)) - w.writeInt(int64(w.nFuncdata)) - w.writeInt(int64(w.nFile)) -} - -func newObjWriter(ctxt *Link, b *bufio.Writer) *objWriter { - return &objWriter{ - ctxt: ctxt, - wr: b, - vrefIdx: make(map[string]int), - refIdx: make(map[string]int), - } -} - -func WriteObjFile(ctxt *Link, b *bufio.Writer) { - w := newObjWriter(ctxt, b) - - // Magic header - w.wr.WriteString("\x00\x00go17ld") - - // Version - w.wr.WriteByte(1) - - // Autolib - for _, pkg := range ctxt.Imports { - w.writeString(pkg) - } - w.writeString("") - - // Symbol references - for _, s := range ctxt.Text { - w.writeRefs(s) - w.addLengths(s) - } - for _, s := range ctxt.Data { - w.writeRefs(s) - w.addLengths(s) - } - // End symbol references - w.wr.WriteByte(0xff) - - // Lengths - w.writeLengths() - - // Data block - for _, s := range ctxt.Text { - w.wr.Write(s.P) - pc := s.Pcln - w.wr.Write(pc.Pcsp.P) - w.wr.Write(pc.Pcfile.P) - w.wr.Write(pc.Pcline.P) - for i := 0; i < len(pc.Pcdata); i++ { - w.wr.Write(pc.Pcdata[i].P) - } - } - for _, s := range ctxt.Data { - w.wr.Write(s.P) - } - - // Symbols - for _, s := range ctxt.Text { - w.writeSym(s) - } - for _, s := range ctxt.Data { - w.writeSym(s) - } - - // Magic footer - w.wr.WriteString("\xff\xffgo17ld") -} - -// Symbols are prefixed so their content doesn't get confused with the magic footer. -const symPrefix = 0xfe - -func (w *objWriter) writeRef(s *LSym, isPath bool) { - if s == nil || s.RefIdx != 0 { - return - } - var m map[string]int - switch s.Version { - case 0: - m = w.refIdx - case 1: - m = w.vrefIdx - default: - log.Fatalf("%s: invalid version number %d", s.Name, s.Version) - } - - idx := m[s.Name] - if idx != 0 { - s.RefIdx = idx - return - } - w.wr.WriteByte(symPrefix) - if isPath { - w.writeString(filepath.ToSlash(s.Name)) - } else { - w.writeString(s.Name) - } - w.writeInt(int64(s.Version)) - w.nRefs++ - s.RefIdx = w.nRefs - m[s.Name] = w.nRefs -} - -func (w *objWriter) writeRefs(s *LSym) { - w.writeRef(s, false) - w.writeRef(s.Gotype, false) - for i := range s.R { - w.writeRef(s.R[i].Sym, false) - } - - if s.Type == STEXT { - for a := s.Autom; a != nil; a = a.Link { - w.writeRef(a.Asym, false) - w.writeRef(a.Gotype, false) - } - pc := s.Pcln - for _, d := range pc.Funcdata { - w.writeRef(d, false) - } - for _, f := range pc.File { - w.writeRef(f, true) - } - } -} - -func (w *objWriter) writeSymDebug(s *LSym) { - ctxt := w.ctxt - fmt.Fprintf(ctxt.Bso, "%s ", s.Name) - if s.Version != 0 { - fmt.Fprintf(ctxt.Bso, "v=%d ", s.Version) - } - if s.Type != 0 { - fmt.Fprintf(ctxt.Bso, "t=%d ", s.Type) - } - if s.DuplicateOK() { - fmt.Fprintf(ctxt.Bso, "dupok ") - } - if s.CFunc() { - fmt.Fprintf(ctxt.Bso, "cfunc ") - } - if s.NoSplit() { - fmt.Fprintf(ctxt.Bso, "nosplit ") - } - fmt.Fprintf(ctxt.Bso, "size=%d", s.Size) - if s.Type == STEXT { - fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x", uint64(s.Args), uint64(s.Locals)) - if s.Leaf() { - fmt.Fprintf(ctxt.Bso, " leaf") - } - } - - fmt.Fprintf(ctxt.Bso, "\n") - for p := s.Text; p != nil; p = p.Link { - fmt.Fprintf(ctxt.Bso, "\t%#04x %v\n", uint(int(p.Pc)), p) - } - var c int - var j int - for i := 0; i < len(s.P); { - fmt.Fprintf(ctxt.Bso, "\t%#04x", uint(i)) - for j = i; j < i+16 && j < len(s.P); j++ { - fmt.Fprintf(ctxt.Bso, " %02x", s.P[j]) - } - for ; j < i+16; j++ { - fmt.Fprintf(ctxt.Bso, " ") - } - fmt.Fprintf(ctxt.Bso, " ") - for j = i; j < i+16 && j < len(s.P); j++ { - c = int(s.P[j]) - if ' ' <= c && c <= 0x7e { - fmt.Fprintf(ctxt.Bso, "%c", c) - } else { - fmt.Fprintf(ctxt.Bso, ".") - } - } - - fmt.Fprintf(ctxt.Bso, "\n") - i += 16 - } - - sort.Sort(relocByOff(s.R)) // generate stable output - for _, r := range s.R { - name := "" - if r.Sym != nil { - name = r.Sym.Name - } else if r.Type == R_TLS_LE { - name = "TLS" - } - if ctxt.Arch.InFamily(sys.ARM, sys.PPC64) { - fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type, name, uint64(r.Add)) - } else { - fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, name, r.Add) - } - } -} - -func (w *objWriter) writeSym(s *LSym) { - ctxt := w.ctxt - if ctxt.Debugasm != 0 { - w.writeSymDebug(s) - } - - w.wr.WriteByte(symPrefix) - w.writeInt(int64(s.Type)) - w.writeRefIndex(s) - flags := int64(0) - if s.DuplicateOK() { - flags |= 1 - } - if s.Local() { - flags |= 1 << 1 - } - if s.MakeTypelink() { - flags |= 1 << 2 - } - w.writeInt(flags) - w.writeInt(s.Size) - w.writeRefIndex(s.Gotype) - w.writeInt(int64(len(s.P))) - - w.writeInt(int64(len(s.R))) - var r *Reloc - for i := 0; i < len(s.R); i++ { - r = &s.R[i] - w.writeInt(int64(r.Off)) - w.writeInt(int64(r.Siz)) - w.writeInt(int64(r.Type)) - w.writeInt(r.Add) - w.writeRefIndex(r.Sym) - } - - if s.Type != STEXT { - return - } - - w.writeInt(int64(s.Args)) - w.writeInt(int64(s.Locals)) - if s.NoSplit() { - w.writeInt(1) - } else { - w.writeInt(0) - } - flags = int64(0) - if s.Leaf() { - flags |= 1 - } - if s.CFunc() { - flags |= 1 << 1 - } - if s.ReflectMethod() { - flags |= 1 << 2 - } - w.writeInt(flags) - n := 0 - for a := s.Autom; a != nil; a = a.Link { - n++ - } - w.writeInt(int64(n)) - for a := s.Autom; a != nil; a = a.Link { - w.writeRefIndex(a.Asym) - w.writeInt(int64(a.Aoffset)) - if a.Name == NAME_AUTO { - w.writeInt(A_AUTO) - } else if a.Name == NAME_PARAM { - w.writeInt(A_PARAM) - } else { - log.Fatalf("%s: invalid local variable type %d", s.Name, a.Name) - } - w.writeRefIndex(a.Gotype) - } - - pc := s.Pcln - w.writeInt(int64(len(pc.Pcsp.P))) - w.writeInt(int64(len(pc.Pcfile.P))) - w.writeInt(int64(len(pc.Pcline.P))) - w.writeInt(int64(len(pc.Pcdata))) - for i := 0; i < len(pc.Pcdata); i++ { - w.writeInt(int64(len(pc.Pcdata[i].P))) - } - w.writeInt(int64(len(pc.Funcdataoff))) - for i := 0; i < len(pc.Funcdataoff); i++ { - w.writeRefIndex(pc.Funcdata[i]) - } - for i := 0; i < len(pc.Funcdataoff); i++ { - w.writeInt(pc.Funcdataoff[i]) - } - w.writeInt(int64(len(pc.File))) - for _, f := range pc.File { - w.writeRefIndex(f) - } -} - -func (w *objWriter) writeInt(sval int64) { - var v uint64 - uv := (uint64(sval) << 1) ^ uint64(sval>>63) - p := w.varintbuf[:] - for v = uv; v >= 0x80; v >>= 7 { - p[0] = uint8(v | 0x80) - p = p[1:] - } - p[0] = uint8(v) - p = p[1:] - w.wr.Write(w.varintbuf[:len(w.varintbuf)-len(p)]) -} - -func (w *objWriter) writeString(s string) { - w.writeInt(int64(len(s))) - w.wr.WriteString(s) -} - -func (w *objWriter) writeRefIndex(s *LSym) { - if s == nil { - w.writeInt(0) - return - } - if s.RefIdx == 0 { - log.Fatalln("writing an unreferenced symbol", s.Name) - } - w.writeInt(int64(s.RefIdx)) -} - -// relocByOff sorts relocations by their offsets. -type relocByOff []Reloc - -func (x relocByOff) Len() int { return len(x) } -func (x relocByOff) Less(i, j int) bool { return x[i].Off < x[j].Off } -func (x relocByOff) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -// implement dwarf.Context -type dwCtxt struct{ *Link } - -func (c dwCtxt) PtrSize() int { - return c.Arch.PtrSize -} -func (c dwCtxt) AddInt(s dwarf.Sym, size int, i int64) { - ls := s.(*LSym) - ls.WriteInt(c.Link, ls.Size, size, i) -} -func (c dwCtxt) AddBytes(s dwarf.Sym, b []byte) { - ls := s.(*LSym) - ls.WriteBytes(c.Link, ls.Size, b) -} -func (c dwCtxt) AddString(s dwarf.Sym, v string) { - ls := s.(*LSym) - ls.WriteString(c.Link, ls.Size, len(v), v) - ls.WriteInt(c.Link, ls.Size, 1, 0) -} -func (c dwCtxt) SymValue(s dwarf.Sym) int64 { - return 0 -} -func (c dwCtxt) AddAddress(s dwarf.Sym, data interface{}, value int64) { - rsym := data.(*LSym) - ls := s.(*LSym) - size := c.PtrSize() - ls.WriteAddr(c.Link, ls.Size, size, rsym, value) -} -func (c dwCtxt) AddSectionOffset(s dwarf.Sym, size int, t interface{}, ofs int64) { - ls := s.(*LSym) - rsym := t.(*LSym) - ls.WriteAddr(c.Link, ls.Size, size, rsym, ofs) - r := &ls.R[len(ls.R)-1] - r.Type = R_DWARFREF -} - -func gendwarf(ctxt *Link, text []*LSym) []*LSym { - dctxt := dwCtxt{ctxt} - var dw []*LSym - - for _, s := range text { - dsym := Linklookup(ctxt, dwarf.InfoPrefix+s.Name, int(s.Version)) - if dsym.Size != 0 { - continue - } - dw = append(dw, dsym) - dsym.Type = SDWARFINFO - dsym.Set(AttrDuplicateOK, s.DuplicateOK()) - var vars dwarf.Var - var abbrev int - var offs int32 - for a := s.Autom; a != nil; a = a.Link { - switch a.Name { - case NAME_AUTO: - abbrev = dwarf.DW_ABRV_AUTO - offs = a.Aoffset - if ctxt.FixedFrameSize() == 0 { - offs -= int32(ctxt.Arch.PtrSize) - } - if Framepointer_enabled(GOOS, GOARCH) { - offs -= int32(ctxt.Arch.PtrSize) - } - - case NAME_PARAM: - abbrev = dwarf.DW_ABRV_PARAM - offs = a.Aoffset + int32(ctxt.FixedFrameSize()) - - default: - continue - } - typename := dwarf.InfoPrefix + a.Gotype.Name[len("type."):] - dwvar := &dwarf.Var{ - Name: a.Asym.Name, - Abbrev: abbrev, - Offset: int32(offs), - Type: Linklookup(ctxt, typename, 0), - } - dws := &vars.Link - for ; *dws != nil; dws = &(*dws).Link { - if offs <= (*dws).Offset { - break - } - } - dwvar.Link = *dws - *dws = dwvar - } - dwarf.PutFunc(dctxt, dsym, s.Name, s.Version == 0, s, s.Size, vars.Link) - } - return dw -} diff --git a/vendor/github.com/google/gops/internal/obj/pass.go b/vendor/github.com/google/gops/internal/obj/pass.go deleted file mode 100644 index 1d2f74b9..00000000 --- a/vendor/github.com/google/gops/internal/obj/pass.go +++ /dev/null @@ -1,217 +0,0 @@ -// Inferno utils/6l/pass.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/pass.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package obj - -// Code and data passes. - -func Brchain(ctxt *Link, p *Prog) *Prog { - for i := 0; i < 20; i++ { - if p == nil || p.As != AJMP || p.Pcond == nil { - return p - } - p = p.Pcond - } - - return nil -} - -func brloop(ctxt *Link, p *Prog) *Prog { - var q *Prog - - c := 0 - for q = p; q != nil; q = q.Pcond { - if q.As != AJMP || q.Pcond == nil { - break - } - c++ - if c >= 5000 { - return nil - } - } - - return q -} - -func checkaddr(ctxt *Link, p *Prog, a *Addr) { - // Check expected encoding, especially TYPE_CONST vs TYPE_ADDR. - switch a.Type { - case TYPE_NONE: - return - - case TYPE_BRANCH: - if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name != 0 { - break - } - return - - case TYPE_TEXTSIZE: - if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name != 0 { - break - } - return - - //if(a->u.bits != 0) - // break; - case TYPE_MEM: - return - - // TODO(rsc): After fixing SHRQ, check a->index != 0 too. - case TYPE_CONST: - if a.Name != 0 || a.Sym != nil || a.Reg != 0 { - ctxt.Diag("argument is TYPE_CONST, should be TYPE_ADDR, in %v", p) - return - } - - if a.Reg != 0 || a.Scale != 0 || a.Name != 0 || a.Sym != nil || a.Val != nil { - break - } - return - - case TYPE_FCONST, TYPE_SCONST: - if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name != 0 || a.Offset != 0 || a.Sym != nil { - break - } - return - - // TODO(rsc): After fixing PINSRQ, check a->offset != 0 too. - // TODO(rsc): After fixing SHRQ, check a->index != 0 too. - case TYPE_REG: - if a.Scale != 0 || a.Name != 0 || a.Sym != nil { - break - } - return - - case TYPE_ADDR: - if a.Val != nil { - break - } - if a.Reg == 0 && a.Index == 0 && a.Scale == 0 && a.Name == 0 && a.Sym == nil { - ctxt.Diag("argument is TYPE_ADDR, should be TYPE_CONST, in %v", p) - } - return - - case TYPE_SHIFT: - if a.Index != 0 || a.Scale != 0 || a.Name != 0 || a.Sym != nil || a.Val != nil { - break - } - return - - case TYPE_REGREG: - if a.Index != 0 || a.Scale != 0 || a.Name != 0 || a.Sym != nil || a.Val != nil { - break - } - return - - case TYPE_REGREG2: - return - - case TYPE_REGLIST: - return - - // Expect sym and name to be set, nothing else. - // Technically more is allowed, but this is only used for *name(SB). - case TYPE_INDIR: - if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name == 0 || a.Offset != 0 || a.Sym == nil || a.Val != nil { - break - } - return - } - - ctxt.Diag("invalid encoding for argument %v", p) -} - -func linkpatch(ctxt *Link, sym *LSym) { - var c int32 - var name string - var q *Prog - - ctxt.Cursym = sym - - for p := sym.Text; p != nil; p = p.Link { - checkaddr(ctxt, p, &p.From) - if p.From3 != nil { - checkaddr(ctxt, p, p.From3) - } - checkaddr(ctxt, p, &p.To) - - if ctxt.Arch.Progedit != nil { - ctxt.Arch.Progedit(ctxt, p) - } - if p.To.Type != TYPE_BRANCH { - continue - } - if p.To.Val != nil { - // TODO: Remove To.Val.(*Prog) in favor of p->pcond. - p.Pcond = p.To.Val.(*Prog) - continue - } - - if p.To.Sym != nil { - continue - } - c = int32(p.To.Offset) - for q = sym.Text; q != nil; { - if int64(c) == q.Pc { - break - } - if q.Forwd != nil && int64(c) >= q.Forwd.Pc { - q = q.Forwd - } else { - q = q.Link - } - } - - if q == nil { - name = "" - if p.To.Sym != nil { - name = p.To.Sym.Name - } - ctxt.Diag("branch out of range (%#x)\n%v [%s]", uint32(c), p, name) - p.To.Type = TYPE_NONE - } - - p.To.Val = q - p.Pcond = q - } - - if ctxt.Flag_optimize { - for p := sym.Text; p != nil; p = p.Link { - if p.Pcond != nil { - p.Pcond = brloop(ctxt, p.Pcond) - if p.Pcond != nil { - if p.To.Type == TYPE_BRANCH { - p.To.Offset = p.Pcond.Pc - } - } - } - } - } -} diff --git a/vendor/github.com/google/gops/internal/obj/pcln.go b/vendor/github.com/google/gops/internal/obj/pcln.go deleted file mode 100644 index d9893e42..00000000 --- a/vendor/github.com/google/gops/internal/obj/pcln.go +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -import "log" - -func addvarint(ctxt *Link, d *Pcdata, val uint32) { - var v uint32 - for v = val; v >= 0x80; v >>= 7 { - d.P = append(d.P, uint8(v|0x80)) - } - d.P = append(d.P, uint8(v)) -} - -// funcpctab writes to dst a pc-value table mapping the code in func to the values -// returned by valfunc parameterized by arg. The invocation of valfunc to update the -// current value is, for each p, -// -// val = valfunc(func, val, p, 0, arg); -// record val as value at p->pc; -// val = valfunc(func, val, p, 1, arg); -// -// where func is the function, val is the current value, p is the instruction being -// considered, and arg can be used to further parameterize valfunc. -func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*Link, *LSym, int32, *Prog, int32, interface{}) int32, arg interface{}) { - // To debug a specific function, uncomment lines and change name. - dbg := 0 - - //if func_.Name == "main.main" || desc == "pctospadj" { - // dbg = 1 - //} - - ctxt.Debugpcln += int32(dbg) - - dst.P = dst.P[:0] - - if ctxt.Debugpcln != 0 { - ctxt.Logf("funcpctab %s [valfunc=%s]\n", func_.Name, desc) - } - - val := int32(-1) - oldval := val - if func_.Text == nil { - ctxt.Debugpcln -= int32(dbg) - return - } - - pc := func_.Text.Pc - - if ctxt.Debugpcln != 0 { - ctxt.Logf("%6x %6d %v\n", uint64(pc), val, func_.Text) - } - - started := int32(0) - var delta uint32 - for p := func_.Text; p != nil; p = p.Link { - // Update val. If it's not changing, keep going. - val = valfunc(ctxt, func_, val, p, 0, arg) - - if val == oldval && started != 0 { - val = valfunc(ctxt, func_, val, p, 1, arg) - if ctxt.Debugpcln != 0 { - ctxt.Logf("%6x %6s %v\n", uint64(p.Pc), "", p) - } - continue - } - - // If the pc of the next instruction is the same as the - // pc of this instruction, this instruction is not a real - // instruction. Keep going, so that we only emit a delta - // for a true instruction boundary in the program. - if p.Link != nil && p.Link.Pc == p.Pc { - val = valfunc(ctxt, func_, val, p, 1, arg) - if ctxt.Debugpcln != 0 { - ctxt.Logf("%6x %6s %v\n", uint64(p.Pc), "", p) - } - continue - } - - // The table is a sequence of (value, pc) pairs, where each - // pair states that the given value is in effect from the current position - // up to the given pc, which becomes the new current position. - // To generate the table as we scan over the program instructions, - // we emit a "(value" when pc == func->value, and then - // each time we observe a change in value we emit ", pc) (value". - // When the scan is over, we emit the closing ", pc)". - // - // The table is delta-encoded. The value deltas are signed and - // transmitted in zig-zag form, where a complement bit is placed in bit 0, - // and the pc deltas are unsigned. Both kinds of deltas are sent - // as variable-length little-endian base-128 integers, - // where the 0x80 bit indicates that the integer continues. - - if ctxt.Debugpcln != 0 { - ctxt.Logf("%6x %6d %v\n", uint64(p.Pc), val, p) - } - - if started != 0 { - addvarint(ctxt, dst, uint32((p.Pc-pc)/int64(ctxt.Arch.MinLC))) - pc = p.Pc - } - - delta = uint32(val) - uint32(oldval) - if delta>>31 != 0 { - delta = 1 | ^(delta << 1) - } else { - delta <<= 1 - } - addvarint(ctxt, dst, delta) - oldval = val - started = 1 - val = valfunc(ctxt, func_, val, p, 1, arg) - } - - if started != 0 { - if ctxt.Debugpcln != 0 { - ctxt.Logf("%6x done\n", uint64(func_.Text.Pc+func_.Size)) - } - addvarint(ctxt, dst, uint32((func_.Size-pc)/int64(ctxt.Arch.MinLC))) - addvarint(ctxt, dst, 0) // terminator - } - - if ctxt.Debugpcln != 0 { - ctxt.Logf("wrote %d bytes to %p\n", len(dst.P), dst) - for i := 0; i < len(dst.P); i++ { - ctxt.Logf(" %02x", dst.P[i]) - } - ctxt.Logf("\n") - } - - ctxt.Debugpcln -= int32(dbg) -} - -// pctofileline computes either the file number (arg == 0) -// or the line number (arg == 1) to use at p. -// Because p->lineno applies to p, phase == 0 (before p) -// takes care of the update. -func pctofileline(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 { - if p.As == ATEXT || p.As == ANOP || p.As == AUSEFIELD || p.Lineno == 0 || phase == 1 { - return oldval - } - f, l := linkgetline(ctxt, p.Lineno) - if f == nil { - // print("getline failed for %s %v\n", ctxt->cursym->name, p); - return oldval - } - - if arg == nil { - return l - } - pcln := arg.(*Pcln) - - if f == pcln.Lastfile { - return int32(pcln.Lastindex) - } - - for i, file := range pcln.File { - if file == f { - pcln.Lastfile = f - pcln.Lastindex = i - return int32(i) - } - } - i := len(pcln.File) - pcln.File = append(pcln.File, f) - pcln.Lastfile = f - pcln.Lastindex = i - return int32(i) -} - -// pctospadj computes the sp adjustment in effect. -// It is oldval plus any adjustment made by p itself. -// The adjustment by p takes effect only after p, so we -// apply the change during phase == 1. -func pctospadj(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 { - if oldval == -1 { // starting - oldval = 0 - } - if phase == 0 { - return oldval - } - if oldval+p.Spadj < -10000 || oldval+p.Spadj > 1100000000 { - ctxt.Diag("overflow in spadj: %d + %d = %d", oldval, p.Spadj, oldval+p.Spadj) - log.Fatalf("bad code") - } - - return oldval + p.Spadj -} - -// pctopcdata computes the pcdata value in effect at p. -// A PCDATA instruction sets the value in effect at future -// non-PCDATA instructions. -// Since PCDATA instructions have no width in the final code, -// it does not matter which phase we use for the update. -func pctopcdata(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 { - if phase == 0 || p.As != APCDATA || p.From.Offset != int64(arg.(uint32)) { - return oldval - } - if int64(int32(p.To.Offset)) != p.To.Offset { - ctxt.Diag("overflow in PCDATA instruction: %v", p) - log.Fatalf("bad code") - } - - return int32(p.To.Offset) -} - -func linkpcln(ctxt *Link, cursym *LSym) { - ctxt.Cursym = cursym - - pcln := new(Pcln) - cursym.Pcln = pcln - - npcdata := 0 - nfuncdata := 0 - for p := cursym.Text; p != nil; p = p.Link { - // Find the highest ID of any used PCDATA table. This ignores PCDATA table - // that consist entirely of "-1", since that's the assumed default value. - // From.Offset is table ID - // To.Offset is data - if p.As == APCDATA && p.From.Offset >= int64(npcdata) && p.To.Offset != -1 { // ignore -1 as we start at -1, if we only see -1, nothing changed - npcdata = int(p.From.Offset + 1) - } - // Find the highest ID of any FUNCDATA table. - // From.Offset is table ID - if p.As == AFUNCDATA && p.From.Offset >= int64(nfuncdata) { - nfuncdata = int(p.From.Offset + 1) - } - } - - pcln.Pcdata = make([]Pcdata, npcdata) - pcln.Pcdata = pcln.Pcdata[:npcdata] - pcln.Funcdata = make([]*LSym, nfuncdata) - pcln.Funcdataoff = make([]int64, nfuncdata) - pcln.Funcdataoff = pcln.Funcdataoff[:nfuncdata] - - funcpctab(ctxt, &pcln.Pcsp, cursym, "pctospadj", pctospadj, nil) - funcpctab(ctxt, &pcln.Pcfile, cursym, "pctofile", pctofileline, pcln) - funcpctab(ctxt, &pcln.Pcline, cursym, "pctoline", pctofileline, nil) - - // tabulate which pc and func data we have. - havepc := make([]uint32, (npcdata+31)/32) - havefunc := make([]uint32, (nfuncdata+31)/32) - for p := cursym.Text; p != nil; p = p.Link { - if p.As == AFUNCDATA { - if (havefunc[p.From.Offset/32]>>uint64(p.From.Offset%32))&1 != 0 { - ctxt.Diag("multiple definitions for FUNCDATA $%d", p.From.Offset) - } - havefunc[p.From.Offset/32] |= 1 << uint64(p.From.Offset%32) - } - - if p.As == APCDATA && p.To.Offset != -1 { - havepc[p.From.Offset/32] |= 1 << uint64(p.From.Offset%32) - } - } - - // pcdata. - for i := 0; i < npcdata; i++ { - if (havepc[i/32]>>uint(i%32))&1 == 0 { - continue - } - funcpctab(ctxt, &pcln.Pcdata[i], cursym, "pctopcdata", pctopcdata, interface{}(uint32(i))) - } - - // funcdata - if nfuncdata > 0 { - var i int - for p := cursym.Text; p != nil; p = p.Link { - if p.As == AFUNCDATA { - i = int(p.From.Offset) - pcln.Funcdataoff[i] = p.To.Offset - if p.To.Type != TYPE_CONST { - // TODO: Dedup. - //funcdata_bytes += p->to.sym->size; - pcln.Funcdata[i] = p.To.Sym - } - } - } - } -} diff --git a/vendor/github.com/google/gops/internal/obj/plist.go b/vendor/github.com/google/gops/internal/obj/plist.go deleted file mode 100644 index 804ea637..00000000 --- a/vendor/github.com/google/gops/internal/obj/plist.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -import ( - "fmt" - "log" - "strings" -) - -type Plist struct { - Firstpc *Prog -} - -/* - * start a new Prog list. - */ -func Linknewplist(ctxt *Link) *Plist { - pl := new(Plist) - ctxt.Plists = append(ctxt.Plists, pl) - return pl -} - -func Flushplist(ctxt *Link) { - flushplist(ctxt, ctxt.Debugasm == 0) -} -func FlushplistNoFree(ctxt *Link) { - flushplist(ctxt, false) -} -func flushplist(ctxt *Link, freeProgs bool) { - // Build list of symbols, and assign instructions to lists. - // Ignore ctxt->plist boundaries. There are no guarantees there, - // and the assemblers just use one big list. - var curtext *LSym - var etext *Prog - var text []*LSym - - for _, pl := range ctxt.Plists { - var plink *Prog - for p := pl.Firstpc; p != nil; p = plink { - if ctxt.Debugasm != 0 && ctxt.Debugvlog != 0 { - fmt.Printf("obj: %v\n", p) - } - plink = p.Link - p.Link = nil - - switch p.As { - case AEND: - continue - - case ATYPE: - // Assume each TYPE instruction describes - // a different local variable or parameter, - // so no dedup. - // Using only the TYPE instructions means - // that we discard location information about local variables - // in C and assembly functions; that information is inferred - // from ordinary references, because there are no TYPE - // instructions there. Without the type information, gdb can't - // use the locations, so we don't bother to save them. - // If something else could use them, we could arrange to - // preserve them. - if curtext == nil { - continue - } - a := new(Auto) - a.Asym = p.From.Sym - a.Aoffset = int32(p.From.Offset) - a.Name = int16(p.From.Name) - a.Gotype = p.To.Sym - a.Link = curtext.Autom - curtext.Autom = a - continue - - case ATEXT: - s := p.From.Sym - if s == nil { - // func _() { } - curtext = nil - - continue - } - - if s.Text != nil { - log.Fatalf("duplicate TEXT for %s", s.Name) - } - if s.OnList() { - log.Fatalf("symbol %s listed multiple times", s.Name) - } - s.Set(AttrOnList, true) - text = append(text, s) - flag := int(p.From3Offset()) - if flag&DUPOK != 0 { - s.Set(AttrDuplicateOK, true) - } - if flag&NOSPLIT != 0 { - s.Set(AttrNoSplit, true) - } - if flag&REFLECTMETHOD != 0 { - s.Set(AttrReflectMethod, true) - } - s.Type = STEXT - s.Text = p - etext = p - curtext = s - continue - - case AFUNCDATA: - // Rewrite reference to go_args_stackmap(SB) to the Go-provided declaration information. - if curtext == nil { // func _() {} - continue - } - if p.To.Sym.Name == "go_args_stackmap" { - if p.From.Type != TYPE_CONST || p.From.Offset != FUNCDATA_ArgsPointerMaps { - ctxt.Diag("FUNCDATA use of go_args_stackmap(SB) without FUNCDATA_ArgsPointerMaps") - } - p.To.Sym = Linklookup(ctxt, fmt.Sprintf("%s.args_stackmap", curtext.Name), int(curtext.Version)) - } - - } - - if curtext == nil { - etext = nil - continue - } - etext.Link = p - etext = p - } - } - - // Add reference to Go arguments for C or assembly functions without them. - for _, s := range text { - if !strings.HasPrefix(s.Name, "\"\".") { - continue - } - found := false - var p *Prog - for p = s.Text; p != nil; p = p.Link { - if p.As == AFUNCDATA && p.From.Type == TYPE_CONST && p.From.Offset == FUNCDATA_ArgsPointerMaps { - found = true - break - } - } - - if !found { - p = Appendp(ctxt, s.Text) - p.As = AFUNCDATA - p.From.Type = TYPE_CONST - p.From.Offset = FUNCDATA_ArgsPointerMaps - p.To.Type = TYPE_MEM - p.To.Name = NAME_EXTERN - p.To.Sym = Linklookup(ctxt, fmt.Sprintf("%s.args_stackmap", s.Name), int(s.Version)) - } - } - - // Turn functions into machine code images. - for _, s := range text { - mkfwd(s) - linkpatch(ctxt, s) - if ctxt.Flag_optimize { - ctxt.Arch.Follow(ctxt, s) - } - ctxt.Arch.Preprocess(ctxt, s) - ctxt.Arch.Assemble(ctxt, s) - fieldtrack(ctxt, s) - linkpcln(ctxt, s) - if freeProgs { - s.Text = nil - } - } - - // Add to running list in ctxt. - ctxt.Text = append(ctxt.Text, text...) - ctxt.Data = append(ctxt.Data, gendwarf(ctxt, text)...) - ctxt.Plists = nil - ctxt.Curp = nil - if freeProgs { - ctxt.freeProgs() - } -} - -func (ctxt *Link) Globl(s *LSym, size int64, flag int) { - if s.SeenGlobl() { - fmt.Printf("duplicate %v\n", s) - } - s.Set(AttrSeenGlobl, true) - if s.OnList() { - log.Fatalf("symbol %s listed multiple times", s.Name) - } - s.Set(AttrOnList, true) - ctxt.Data = append(ctxt.Data, s) - s.Size = size - if s.Type == 0 || s.Type == SXREF { - s.Type = SBSS - } - if flag&DUPOK != 0 { - s.Set(AttrDuplicateOK, true) - } - if flag&RODATA != 0 { - s.Type = SRODATA - } else if flag&NOPTR != 0 { - s.Type = SNOPTRBSS - } else if flag&TLSBSS != 0 { - s.Type = STLSBSS - } -} diff --git a/vendor/github.com/google/gops/internal/obj/ppc64/a.out.go b/vendor/github.com/google/gops/internal/obj/ppc64/a.out.go deleted file mode 100644 index 48d8ed15..00000000 --- a/vendor/github.com/google/gops/internal/obj/ppc64/a.out.go +++ /dev/null @@ -1,941 +0,0 @@ -// cmd/9c/9.out.h from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package ppc64 - -import "github.com/google/gops/internal/obj" - -//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p ppc64 - -/* - * powerpc 64 - */ -const ( - NSNAME = 8 - NSYM = 50 - NREG = 32 /* number of general registers */ - NFREG = 32 /* number of floating point registers */ -) - -const ( - /* RBasePPC64 = 4096 */ - /* R0=4096 ... R31=4127 */ - REG_R0 = obj.RBasePPC64 + iota - REG_R1 - REG_R2 - REG_R3 - REG_R4 - REG_R5 - REG_R6 - REG_R7 - REG_R8 - REG_R9 - REG_R10 - REG_R11 - REG_R12 - REG_R13 - REG_R14 - REG_R15 - REG_R16 - REG_R17 - REG_R18 - REG_R19 - REG_R20 - REG_R21 - REG_R22 - REG_R23 - REG_R24 - REG_R25 - REG_R26 - REG_R27 - REG_R28 - REG_R29 - REG_R30 - REG_R31 - - /* F0=4128 ... F31=4159 */ - REG_F0 - REG_F1 - REG_F2 - REG_F3 - REG_F4 - REG_F5 - REG_F6 - REG_F7 - REG_F8 - REG_F9 - REG_F10 - REG_F11 - REG_F12 - REG_F13 - REG_F14 - REG_F15 - REG_F16 - REG_F17 - REG_F18 - REG_F19 - REG_F20 - REG_F21 - REG_F22 - REG_F23 - REG_F24 - REG_F25 - REG_F26 - REG_F27 - REG_F28 - REG_F29 - REG_F30 - REG_F31 - - /* V0=4160 ... V31=4191 */ - REG_V0 - REG_V1 - REG_V2 - REG_V3 - REG_V4 - REG_V5 - REG_V6 - REG_V7 - REG_V8 - REG_V9 - REG_V10 - REG_V11 - REG_V12 - REG_V13 - REG_V14 - REG_V15 - REG_V16 - REG_V17 - REG_V18 - REG_V19 - REG_V20 - REG_V21 - REG_V22 - REG_V23 - REG_V24 - REG_V25 - REG_V26 - REG_V27 - REG_V28 - REG_V29 - REG_V30 - REG_V31 - - /* VS0=4192 ... VS63=4255 */ - REG_VS0 - REG_VS1 - REG_VS2 - REG_VS3 - REG_VS4 - REG_VS5 - REG_VS6 - REG_VS7 - REG_VS8 - REG_VS9 - REG_VS10 - REG_VS11 - REG_VS12 - REG_VS13 - REG_VS14 - REG_VS15 - REG_VS16 - REG_VS17 - REG_VS18 - REG_VS19 - REG_VS20 - REG_VS21 - REG_VS22 - REG_VS23 - REG_VS24 - REG_VS25 - REG_VS26 - REG_VS27 - REG_VS28 - REG_VS29 - REG_VS30 - REG_VS31 - REG_VS32 - REG_VS33 - REG_VS34 - REG_VS35 - REG_VS36 - REG_VS37 - REG_VS38 - REG_VS39 - REG_VS40 - REG_VS41 - REG_VS42 - REG_VS43 - REG_VS44 - REG_VS45 - REG_VS46 - REG_VS47 - REG_VS48 - REG_VS49 - REG_VS50 - REG_VS51 - REG_VS52 - REG_VS53 - REG_VS54 - REG_VS55 - REG_VS56 - REG_VS57 - REG_VS58 - REG_VS59 - REG_VS60 - REG_VS61 - REG_VS62 - REG_VS63 - - REG_CR0 - REG_CR1 - REG_CR2 - REG_CR3 - REG_CR4 - REG_CR5 - REG_CR6 - REG_CR7 - - REG_MSR - REG_FPSCR - REG_CR - - REG_SPECIAL = REG_CR0 - - REG_SPR0 = obj.RBasePPC64 + 1024 // first of 1024 registers - REG_DCR0 = obj.RBasePPC64 + 2048 // first of 1024 registers - - REG_XER = REG_SPR0 + 1 - REG_LR = REG_SPR0 + 8 - REG_CTR = REG_SPR0 + 9 - - REGZERO = REG_R0 /* set to zero */ - REGSP = REG_R1 - REGSB = REG_R2 - REGRET = REG_R3 - REGARG = -1 /* -1 disables passing the first argument in register */ - REGRT1 = REG_R3 /* reserved for runtime, duffzero and duffcopy */ - REGRT2 = REG_R4 /* reserved for runtime, duffcopy */ - REGMIN = REG_R7 /* register variables allocated from here to REGMAX */ - REGCTXT = REG_R11 /* context for closures */ - REGTLS = REG_R13 /* C ABI TLS base pointer */ - REGMAX = REG_R27 - REGEXT = REG_R30 /* external registers allocated from here down */ - REGG = REG_R30 /* G */ - REGTMP = REG_R31 /* used by the linker */ - FREGRET = REG_F0 - FREGMIN = REG_F17 /* first register variable */ - FREGMAX = REG_F26 /* last register variable for 9g only */ - FREGEXT = REG_F26 /* first external register */ -) - -/* - * GENERAL: - * - * compiler allocates R3 up as temps - * compiler allocates register variables R7-R27 - * compiler allocates external registers R30 down - * - * compiler allocates register variables F17-F26 - * compiler allocates external registers F26 down - */ -const ( - BIG = 32768 - 8 -) - -const ( - /* mark flags */ - LABEL = 1 << 0 - LEAF = 1 << 1 - FLOAT = 1 << 2 - BRANCH = 1 << 3 - LOAD = 1 << 4 - FCMP = 1 << 5 - SYNC = 1 << 6 - LIST = 1 << 7 - FOLL = 1 << 8 - NOSCHED = 1 << 9 -) - -// Values for use in branch instruction BC -// BC B0,BI,label -// BO is type of branch + likely bits described below -// BI is CR value + branch type -// ex: BEQ CR2,label is BC 12,10,label -// 12 = BO_BCR -// 10 = BI_CR2 + BI_EQ - -const ( - BI_CR0 = 0 - BI_CR1 = 4 - BI_CR2 = 8 - BI_CR3 = 12 - BI_CR4 = 16 - BI_CR5 = 20 - BI_CR6 = 24 - BI_CR7 = 28 - BI_LT = 0 - BI_GT = 1 - BI_EQ = 2 - BI_OVF = 3 -) - -// Values for the BO field. Add the branch type to -// the likely bits, if a likely setting is known. -// If branch likely or unlikely is not known, don't set it. -// e.g. branch on cr+likely = 15 - -const ( - BO_BCTR = 16 // branch on ctr value - BO_BCR = 12 // branch on cr value - BO_BCRBCTR = 8 // branch on ctr and cr value - BO_NOTBCR = 4 // branch on not cr value - BO_UNLIKELY = 2 // value for unlikely - BO_LIKELY = 3 // value for likely -) - -// Bit settings from the CR - -const ( - C_COND_LT = iota // 0 result is negative - C_COND_GT // 1 result is positive - C_COND_EQ // 2 result is zero - C_COND_SO // 3 summary overflow or FP compare w/ NaN -) - -const ( - C_NONE = iota - C_REG - C_FREG - C_VREG - C_VSREG - C_CREG - C_SPR /* special processor register */ - C_ZCON - C_SCON /* 16 bit signed */ - C_UCON /* 32 bit signed, low 16 bits 0 */ - C_ADDCON /* -0x8000 <= v < 0 */ - C_ANDCON /* 0 < v <= 0xFFFF */ - C_LCON /* other 32 */ - C_DCON /* other 64 (could subdivide further) */ - C_SACON /* $n(REG) where n <= int16 */ - C_SECON - C_LACON /* $n(REG) where int16 < n <= int32 */ - C_LECON - C_DACON /* $n(REG) where int32 < n */ - C_SBRA - C_LBRA - C_LBRAPIC - C_SAUTO - C_LAUTO - C_SEXT - C_LEXT - C_ZOREG // conjecture: either (1) register + zeroed offset, or (2) "R0" implies zero or C_REG - C_SOREG // register + signed offset - C_LOREG - C_FPSCR - C_MSR - C_XER - C_LR - C_CTR - C_ANY - C_GOK - C_ADDR - C_GOTADDR - C_TLS_LE - C_TLS_IE - C_TEXTSIZE - - C_NCLASS /* must be the last */ -) - -const ( - AADD = obj.ABasePPC64 + obj.A_ARCHSPECIFIC + iota - AADDCC - AADDV - AADDVCC - AADDC - AADDCCC - AADDCV - AADDCVCC - AADDME - AADDMECC - AADDMEVCC - AADDMEV - AADDE - AADDECC - AADDEVCC - AADDEV - AADDZE - AADDZECC - AADDZEVCC - AADDZEV - AAND - AANDCC - AANDN - AANDNCC - ABC - ABCL - ABEQ - ABGE // not LT = G/E/U - ABGT - ABLE // not GT = L/E/U - ABLT - ABNE // not EQ = L/G/U - ABVC // Unordered-clear - ABVS // Unordered-set - ACMP - ACMPU - ACNTLZW - ACNTLZWCC - ACRAND - ACRANDN - ACREQV - ACRNAND - ACRNOR - ACROR - ACRORN - ACRXOR - ADIVW - ADIVWCC - ADIVWVCC - ADIVWV - ADIVWU - ADIVWUCC - ADIVWUVCC - ADIVWUV - AEQV - AEQVCC - AEXTSB - AEXTSBCC - AEXTSH - AEXTSHCC - AFABS - AFABSCC - AFADD - AFADDCC - AFADDS - AFADDSCC - AFCMPO - AFCMPU - AFCTIW - AFCTIWCC - AFCTIWZ - AFCTIWZCC - AFDIV - AFDIVCC - AFDIVS - AFDIVSCC - AFMADD - AFMADDCC - AFMADDS - AFMADDSCC - AFMOVD - AFMOVDCC - AFMOVDU - AFMOVS - AFMOVSU - AFMOVSX - AFMOVSZ - AFMSUB - AFMSUBCC - AFMSUBS - AFMSUBSCC - AFMUL - AFMULCC - AFMULS - AFMULSCC - AFNABS - AFNABSCC - AFNEG - AFNEGCC - AFNMADD - AFNMADDCC - AFNMADDS - AFNMADDSCC - AFNMSUB - AFNMSUBCC - AFNMSUBS - AFNMSUBSCC - AFRSP - AFRSPCC - AFSUB - AFSUBCC - AFSUBS - AFSUBSCC - AISEL - AMOVMW - ALBAR - ALSW - ALWAR - ALWSYNC - AMOVDBR - AMOVWBR - AMOVB - AMOVBU - AMOVBZ - AMOVBZU - AMOVH - AMOVHBR - AMOVHU - AMOVHZ - AMOVHZU - AMOVW - AMOVWU - AMOVFL - AMOVCRFS - AMTFSB0 - AMTFSB0CC - AMTFSB1 - AMTFSB1CC - AMULHW - AMULHWCC - AMULHWU - AMULHWUCC - AMULLW - AMULLWCC - AMULLWVCC - AMULLWV - ANAND - ANANDCC - ANEG - ANEGCC - ANEGVCC - ANEGV - ANOR - ANORCC - AOR - AORCC - AORN - AORNCC - AREM - AREMCC - AREMV - AREMVCC - AREMU - AREMUCC - AREMUV - AREMUVCC - ARFI - ARLWMI - ARLWMICC - ARLWNM - ARLWNMCC - ASLW - ASLWCC - ASRW - ASRAW - ASRAWCC - ASRWCC - ASTBCCC - ASTSW - ASTWCCC - ASUB - ASUBCC - ASUBVCC - ASUBC - ASUBCCC - ASUBCV - ASUBCVCC - ASUBME - ASUBMECC - ASUBMEVCC - ASUBMEV - ASUBV - ASUBE - ASUBECC - ASUBEV - ASUBEVCC - ASUBZE - ASUBZECC - ASUBZEVCC - ASUBZEV - ASYNC - AXOR - AXORCC - - ADCBF - ADCBI - ADCBST - ADCBT - ADCBTST - ADCBZ - AECIWX - AECOWX - AEIEIO - AICBI - AISYNC - APTESYNC - ATLBIE - ATLBIEL - ATLBSYNC - ATW - - ASYSCALL - AWORD - - ARFCI - - /* optional on 32-bit */ - AFRES - AFRESCC - AFRIM - AFRIMCC - AFRIP - AFRIPCC - AFRIZ - AFRIZCC - AFRSQRTE - AFRSQRTECC - AFSEL - AFSELCC - AFSQRT - AFSQRTCC - AFSQRTS - AFSQRTSCC - - /* 64-bit */ - - ACNTLZD - ACNTLZDCC - ACMPW /* CMP with L=0 */ - ACMPWU - ADIVD - ADIVDCC - ADIVDE - ADIVDECC - ADIVDEU - ADIVDEUCC - ADIVDVCC - ADIVDV - ADIVDU - ADIVDUCC - ADIVDUVCC - ADIVDUV - AEXTSW - AEXTSWCC - /* AFCFIW; AFCFIWCC */ - AFCFID - AFCFIDCC - AFCFIDU - AFCFIDUCC - AFCTID - AFCTIDCC - AFCTIDZ - AFCTIDZCC - ALDAR - AMOVD - AMOVDU - AMOVWZ - AMOVWZU - AMULHD - AMULHDCC - AMULHDU - AMULHDUCC - AMULLD - AMULLDCC - AMULLDVCC - AMULLDV - ARFID - ARLDMI - ARLDMICC - ARLDIMI - ARLDIMICC - ARLDC - ARLDCCC - ARLDCR - ARLDCRCC - ARLDICR - ARLDICRCC - ARLDCL - ARLDCLCC - ARLDICL - ARLDICLCC - ASLBIA - ASLBIE - ASLBMFEE - ASLBMFEV - ASLBMTE - ASLD - ASLDCC - ASRD - ASRAD - ASRADCC - ASRDCC - ASTDCCC - ATD - - /* 64-bit pseudo operation */ - ADWORD - AREMD - AREMDCC - AREMDV - AREMDVCC - AREMDU - AREMDUCC - AREMDUV - AREMDUVCC - - /* more 64-bit operations */ - AHRFID - - /* Vector */ - ALV - ALVEBX - ALVEHX - ALVEWX - ALVX - ALVXL - ALVSL - ALVSR - ASTV - ASTVEBX - ASTVEHX - ASTVEWX - ASTVX - ASTVXL - AVAND - AVANDL - AVANDC - AVNAND - AVOR - AVORL - AVORC - AVNOR - AVXOR - AVEQV - AVADDUM - AVADDUBM - AVADDUHM - AVADDUWM - AVADDUDM - AVADDUQM - AVADDCU - AVADDCUQ - AVADDCUW - AVADDUS - AVADDUBS - AVADDUHS - AVADDUWS - AVADDSS - AVADDSBS - AVADDSHS - AVADDSWS - AVADDE - AVADDEUQM - AVADDECUQ - AVSUBUM - AVSUBUBM - AVSUBUHM - AVSUBUWM - AVSUBUDM - AVSUBUQM - AVSUBCU - AVSUBCUQ - AVSUBCUW - AVSUBUS - AVSUBUBS - AVSUBUHS - AVSUBUWS - AVSUBSS - AVSUBSBS - AVSUBSHS - AVSUBSWS - AVSUBE - AVSUBEUQM - AVSUBECUQ - AVR - AVRLB - AVRLH - AVRLW - AVRLD - AVS - AVSLB - AVSLH - AVSLW - AVSL - AVSLO - AVSRB - AVSRH - AVSRW - AVSR - AVSRO - AVSLD - AVSRD - AVSA - AVSRAB - AVSRAH - AVSRAW - AVSRAD - AVSOI - AVSLDOI - AVCLZ - AVCLZB - AVCLZH - AVCLZW - AVCLZD - AVPOPCNT - AVPOPCNTB - AVPOPCNTH - AVPOPCNTW - AVPOPCNTD - AVCMPEQ - AVCMPEQUB - AVCMPEQUBCC - AVCMPEQUH - AVCMPEQUHCC - AVCMPEQUW - AVCMPEQUWCC - AVCMPEQUD - AVCMPEQUDCC - AVCMPGT - AVCMPGTUB - AVCMPGTUBCC - AVCMPGTUH - AVCMPGTUHCC - AVCMPGTUW - AVCMPGTUWCC - AVCMPGTUD - AVCMPGTUDCC - AVCMPGTSB - AVCMPGTSBCC - AVCMPGTSH - AVCMPGTSHCC - AVCMPGTSW - AVCMPGTSWCC - AVCMPGTSD - AVCMPGTSDCC - AVPERM - AVSEL - AVSPLT - AVSPLTB - AVSPLTH - AVSPLTW - AVSPLTI - AVSPLTISB - AVSPLTISH - AVSPLTISW - AVCIPH - AVCIPHER - AVCIPHERLAST - AVNCIPH - AVNCIPHER - AVNCIPHERLAST - AVSBOX - AVSHASIGMA - AVSHASIGMAW - AVSHASIGMAD - - /* VSX */ - ALXV - ALXVD2X - ALXVDSX - ALXVW4X - ASTXV - ASTXVD2X - ASTXVW4X - ALXS - ALXSDX - ASTXS - ASTXSDX - ALXSI - ALXSIWAX - ALXSIWZX - ASTXSI - ASTXSIWX - AMFVSR - AMFVSRD - AMFVSRWZ - AMTVSR - AMTVSRD - AMTVSRWA - AMTVSRWZ - AXXLAND - AXXLANDQ - AXXLANDC - AXXLEQV - AXXLNAND - AXXLOR - AXXLORC - AXXLNOR - AXXLORQ - AXXLXOR - AXXSEL - AXXMRG - AXXMRGHW - AXXMRGLW - AXXSPLT - AXXSPLTW - AXXPERM - AXXPERMDI - AXXSI - AXXSLDWI - AXSCV - AXSCVDPSP - AXSCVSPDP - AXSCVDPSPN - AXSCVSPDPN - AXVCV - AXVCVDPSP - AXVCVSPDP - AXSCVX - AXSCVDPSXDS - AXSCVDPSXWS - AXSCVDPUXDS - AXSCVDPUXWS - AXSCVXP - AXSCVSXDDP - AXSCVUXDDP - AXSCVSXDSP - AXSCVUXDSP - AXVCVX - AXVCVDPSXDS - AXVCVDPSXWS - AXVCVDPUXDS - AXVCVDPUXWS - AXVCVSPSXDS - AXVCVSPSXWS - AXVCVSPUXDS - AXVCVSPUXWS - AXVCVXP - AXVCVSXDDP - AXVCVSXWDP - AXVCVUXDDP - AXVCVUXWDP - AXVCVSXDSP - AXVCVSXWSP - AXVCVUXDSP - AXVCVUXWSP - - ALAST - - // aliases - ABR = obj.AJMP - ABL = obj.ACALL -) diff --git a/vendor/github.com/google/gops/internal/obj/ppc64/anames.go b/vendor/github.com/google/gops/internal/obj/ppc64/anames.go deleted file mode 100644 index 12aca66a..00000000 --- a/vendor/github.com/google/gops/internal/obj/ppc64/anames.go +++ /dev/null @@ -1,549 +0,0 @@ -// Generated by stringer -i a.out.go -o anames.go -p ppc64 -// Do not edit. - -package ppc64 - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ - obj.A_ARCHSPECIFIC: "ADD", - "ADDCC", - "ADDV", - "ADDVCC", - "ADDC", - "ADDCCC", - "ADDCV", - "ADDCVCC", - "ADDME", - "ADDMECC", - "ADDMEVCC", - "ADDMEV", - "ADDE", - "ADDECC", - "ADDEVCC", - "ADDEV", - "ADDZE", - "ADDZECC", - "ADDZEVCC", - "ADDZEV", - "AND", - "ANDCC", - "ANDN", - "ANDNCC", - "BC", - "BCL", - "BEQ", - "BGE", - "BGT", - "BLE", - "BLT", - "BNE", - "BVC", - "BVS", - "CMP", - "CMPU", - "CNTLZW", - "CNTLZWCC", - "CRAND", - "CRANDN", - "CREQV", - "CRNAND", - "CRNOR", - "CROR", - "CRORN", - "CRXOR", - "DIVW", - "DIVWCC", - "DIVWVCC", - "DIVWV", - "DIVWU", - "DIVWUCC", - "DIVWUVCC", - "DIVWUV", - "EQV", - "EQVCC", - "EXTSB", - "EXTSBCC", - "EXTSH", - "EXTSHCC", - "FABS", - "FABSCC", - "FADD", - "FADDCC", - "FADDS", - "FADDSCC", - "FCMPO", - "FCMPU", - "FCTIW", - "FCTIWCC", - "FCTIWZ", - "FCTIWZCC", - "FDIV", - "FDIVCC", - "FDIVS", - "FDIVSCC", - "FMADD", - "FMADDCC", - "FMADDS", - "FMADDSCC", - "FMOVD", - "FMOVDCC", - "FMOVDU", - "FMOVS", - "FMOVSU", - "FMOVSX", - "FMOVSZ", - "FMSUB", - "FMSUBCC", - "FMSUBS", - "FMSUBSCC", - "FMUL", - "FMULCC", - "FMULS", - "FMULSCC", - "FNABS", - "FNABSCC", - "FNEG", - "FNEGCC", - "FNMADD", - "FNMADDCC", - "FNMADDS", - "FNMADDSCC", - "FNMSUB", - "FNMSUBCC", - "FNMSUBS", - "FNMSUBSCC", - "FRSP", - "FRSPCC", - "FSUB", - "FSUBCC", - "FSUBS", - "FSUBSCC", - "ISEL", - "MOVMW", - "LBAR", - "LSW", - "LWAR", - "LWSYNC", - "MOVDBR", - "MOVWBR", - "MOVB", - "MOVBU", - "MOVBZ", - "MOVBZU", - "MOVH", - "MOVHBR", - "MOVHU", - "MOVHZ", - "MOVHZU", - "MOVW", - "MOVWU", - "MOVFL", - "MOVCRFS", - "MTFSB0", - "MTFSB0CC", - "MTFSB1", - "MTFSB1CC", - "MULHW", - "MULHWCC", - "MULHWU", - "MULHWUCC", - "MULLW", - "MULLWCC", - "MULLWVCC", - "MULLWV", - "NAND", - "NANDCC", - "NEG", - "NEGCC", - "NEGVCC", - "NEGV", - "NOR", - "NORCC", - "OR", - "ORCC", - "ORN", - "ORNCC", - "REM", - "REMCC", - "REMV", - "REMVCC", - "REMU", - "REMUCC", - "REMUV", - "REMUVCC", - "RFI", - "RLWMI", - "RLWMICC", - "RLWNM", - "RLWNMCC", - "SLW", - "SLWCC", - "SRW", - "SRAW", - "SRAWCC", - "SRWCC", - "STBCCC", - "STSW", - "STWCCC", - "SUB", - "SUBCC", - "SUBVCC", - "SUBC", - "SUBCCC", - "SUBCV", - "SUBCVCC", - "SUBME", - "SUBMECC", - "SUBMEVCC", - "SUBMEV", - "SUBV", - "SUBE", - "SUBECC", - "SUBEV", - "SUBEVCC", - "SUBZE", - "SUBZECC", - "SUBZEVCC", - "SUBZEV", - "SYNC", - "XOR", - "XORCC", - "DCBF", - "DCBI", - "DCBST", - "DCBT", - "DCBTST", - "DCBZ", - "ECIWX", - "ECOWX", - "EIEIO", - "ICBI", - "ISYNC", - "PTESYNC", - "TLBIE", - "TLBIEL", - "TLBSYNC", - "TW", - "SYSCALL", - "WORD", - "RFCI", - "FRES", - "FRESCC", - "FRIM", - "FRIMCC", - "FRIP", - "FRIPCC", - "FRIZ", - "FRIZCC", - "FRSQRTE", - "FRSQRTECC", - "FSEL", - "FSELCC", - "FSQRT", - "FSQRTCC", - "FSQRTS", - "FSQRTSCC", - "CNTLZD", - "CNTLZDCC", - "CMPW", - "CMPWU", - "DIVD", - "DIVDCC", - "DIVDE", - "DIVDECC", - "DIVDEU", - "DIVDEUCC", - "DIVDVCC", - "DIVDV", - "DIVDU", - "DIVDUCC", - "DIVDUVCC", - "DIVDUV", - "EXTSW", - "EXTSWCC", - "FCFID", - "FCFIDCC", - "FCFIDU", - "FCFIDUCC", - "FCTID", - "FCTIDCC", - "FCTIDZ", - "FCTIDZCC", - "LDAR", - "MOVD", - "MOVDU", - "MOVWZ", - "MOVWZU", - "MULHD", - "MULHDCC", - "MULHDU", - "MULHDUCC", - "MULLD", - "MULLDCC", - "MULLDVCC", - "MULLDV", - "RFID", - "RLDMI", - "RLDMICC", - "RLDIMI", - "RLDIMICC", - "RLDC", - "RLDCCC", - "RLDCR", - "RLDCRCC", - "RLDICR", - "RLDICRCC", - "RLDCL", - "RLDCLCC", - "RLDICL", - "RLDICLCC", - "SLBIA", - "SLBIE", - "SLBMFEE", - "SLBMFEV", - "SLBMTE", - "SLD", - "SLDCC", - "SRD", - "SRAD", - "SRADCC", - "SRDCC", - "STDCCC", - "TD", - "DWORD", - "REMD", - "REMDCC", - "REMDV", - "REMDVCC", - "REMDU", - "REMDUCC", - "REMDUV", - "REMDUVCC", - "HRFID", - "LV", - "LVEBX", - "LVEHX", - "LVEWX", - "LVX", - "LVXL", - "LVSL", - "LVSR", - "STV", - "STVEBX", - "STVEHX", - "STVEWX", - "STVX", - "STVXL", - "VAND", - "VANDL", - "VANDC", - "VNAND", - "VOR", - "VORL", - "VORC", - "VNOR", - "VXOR", - "VEQV", - "VADDUM", - "VADDUBM", - "VADDUHM", - "VADDUWM", - "VADDUDM", - "VADDUQM", - "VADDCU", - "VADDCUQ", - "VADDCUW", - "VADDUS", - "VADDUBS", - "VADDUHS", - "VADDUWS", - "VADDSS", - "VADDSBS", - "VADDSHS", - "VADDSWS", - "VADDE", - "VADDEUQM", - "VADDECUQ", - "VSUBUM", - "VSUBUBM", - "VSUBUHM", - "VSUBUWM", - "VSUBUDM", - "VSUBUQM", - "VSUBCU", - "VSUBCUQ", - "VSUBCUW", - "VSUBUS", - "VSUBUBS", - "VSUBUHS", - "VSUBUWS", - "VSUBSS", - "VSUBSBS", - "VSUBSHS", - "VSUBSWS", - "VSUBE", - "VSUBEUQM", - "VSUBECUQ", - "VR", - "VRLB", - "VRLH", - "VRLW", - "VRLD", - "VS", - "VSLB", - "VSLH", - "VSLW", - "VSL", - "VSLO", - "VSRB", - "VSRH", - "VSRW", - "VSR", - "VSRO", - "VSLD", - "VSRD", - "VSA", - "VSRAB", - "VSRAH", - "VSRAW", - "VSRAD", - "VSOI", - "VSLDOI", - "VCLZ", - "VCLZB", - "VCLZH", - "VCLZW", - "VCLZD", - "VPOPCNT", - "VPOPCNTB", - "VPOPCNTH", - "VPOPCNTW", - "VPOPCNTD", - "VCMPEQ", - "VCMPEQUB", - "VCMPEQUBCC", - "VCMPEQUH", - "VCMPEQUHCC", - "VCMPEQUW", - "VCMPEQUWCC", - "VCMPEQUD", - "VCMPEQUDCC", - "VCMPGT", - "VCMPGTUB", - "VCMPGTUBCC", - "VCMPGTUH", - "VCMPGTUHCC", - "VCMPGTUW", - "VCMPGTUWCC", - "VCMPGTUD", - "VCMPGTUDCC", - "VCMPGTSB", - "VCMPGTSBCC", - "VCMPGTSH", - "VCMPGTSHCC", - "VCMPGTSW", - "VCMPGTSWCC", - "VCMPGTSD", - "VCMPGTSDCC", - "VPERM", - "VSEL", - "VSPLT", - "VSPLTB", - "VSPLTH", - "VSPLTW", - "VSPLTI", - "VSPLTISB", - "VSPLTISH", - "VSPLTISW", - "VCIPH", - "VCIPHER", - "VCIPHERLAST", - "VNCIPH", - "VNCIPHER", - "VNCIPHERLAST", - "VSBOX", - "VSHASIGMA", - "VSHASIGMAW", - "VSHASIGMAD", - "LXV", - "LXVD2X", - "LXVDSX", - "LXVW4X", - "STXV", - "STXVD2X", - "STXVW4X", - "LXS", - "LXSDX", - "STXS", - "STXSDX", - "LXSI", - "LXSIWAX", - "LXSIWZX", - "STXSI", - "STXSIWX", - "MFVSR", - "MFVSRD", - "MFVSRWZ", - "MTVSR", - "MTVSRD", - "MTVSRWA", - "MTVSRWZ", - "XXLAND", - "XXLANDQ", - "XXLANDC", - "XXLEQV", - "XXLNAND", - "XXLOR", - "XXLORC", - "XXLNOR", - "XXLORQ", - "XXLXOR", - "XXSEL", - "XXMRG", - "XXMRGHW", - "XXMRGLW", - "XXSPLT", - "XXSPLTW", - "XXPERM", - "XXPERMDI", - "XXSI", - "XXSLDWI", - "XSCV", - "XSCVDPSP", - "XSCVSPDP", - "XSCVDPSPN", - "XSCVSPDPN", - "XVCV", - "XVCVDPSP", - "XVCVSPDP", - "XSCVX", - "XSCVDPSXDS", - "XSCVDPSXWS", - "XSCVDPUXDS", - "XSCVDPUXWS", - "XSCVXP", - "XSCVSXDDP", - "XSCVUXDDP", - "XSCVSXDSP", - "XSCVUXDSP", - "XVCVX", - "XVCVDPSXDS", - "XVCVDPSXWS", - "XVCVDPUXDS", - "XVCVDPUXWS", - "XVCVSPSXDS", - "XVCVSPSXWS", - "XVCVSPUXDS", - "XVCVSPUXWS", - "XVCVXP", - "XVCVSXDDP", - "XVCVSXWDP", - "XVCVUXDDP", - "XVCVUXWDP", - "XVCVSXDSP", - "XVCVSXWSP", - "XVCVUXDSP", - "XVCVUXWSP", - "LAST", -} diff --git a/vendor/github.com/google/gops/internal/obj/ppc64/anames9.go b/vendor/github.com/google/gops/internal/obj/ppc64/anames9.go deleted file mode 100644 index 6ec7b7b5..00000000 --- a/vendor/github.com/google/gops/internal/obj/ppc64/anames9.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ppc64 - -var cnames9 = []string{ - "NONE", - "REG", - "FREG", - "VREG", - "VSREG", - "CREG", - "SPR", - "ZCON", - "SCON", - "UCON", - "ADDCON", - "ANDCON", - "LCON", - "DCON", - "SACON", - "SECON", - "LACON", - "LECON", - "DACON", - "SBRA", - "LBRA", - "SAUTO", - "LAUTO", - "SEXT", - "LEXT", - "ZOREG", - "SOREG", - "LOREG", - "FPSCR", - "MSR", - "XER", - "LR", - "CTR", - "ANY", - "GOK", - "ADDR", - "GOTADDR", - "TLS_LE", - "TLS_IE", - "TEXTSIZE", - "NCLASS", -} diff --git a/vendor/github.com/google/gops/internal/obj/ppc64/asm9.go b/vendor/github.com/google/gops/internal/obj/ppc64/asm9.go deleted file mode 100644 index 31bdeb68..00000000 --- a/vendor/github.com/google/gops/internal/obj/ppc64/asm9.go +++ /dev/null @@ -1,4552 +0,0 @@ -// cmd/9l/optab.c, cmd/9l/asmout.c from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package ppc64 - -import ( - "encoding/binary" - "fmt" - "log" - "sort" - - "github.com/google/gops/internal/obj" -) - -// Instruction layout. - -const ( - funcAlign = 8 -) - -const ( - r0iszero = 1 -) - -type Optab struct { - as obj.As // Opcode - a1 uint8 - a2 uint8 - a3 uint8 - a4 uint8 - type_ int8 // cases in asmout below. E.g., 44 = st r,(ra+rb); 45 = ld (ra+rb), r - size int8 - param int16 -} - -var optab = []Optab{ - {obj.ATEXT, C_LEXT, C_NONE, C_NONE, C_TEXTSIZE, 0, 0, 0}, - {obj.ATEXT, C_LEXT, C_NONE, C_LCON, C_TEXTSIZE, 0, 0, 0}, - {obj.ATEXT, C_ADDR, C_NONE, C_NONE, C_TEXTSIZE, 0, 0, 0}, - {obj.ATEXT, C_ADDR, C_NONE, C_LCON, C_TEXTSIZE, 0, 0, 0}, - /* move register */ - {AMOVD, C_REG, C_NONE, C_NONE, C_REG, 1, 4, 0}, - {AMOVB, C_REG, C_NONE, C_NONE, C_REG, 12, 4, 0}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_REG, 13, 4, 0}, - {AMOVW, C_REG, C_NONE, C_NONE, C_REG, 12, 4, 0}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_REG, 13, 4, 0}, - {AADD, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, - {AADD, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, - {AADD, C_ADDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, - {AADD, C_ADDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, - {AADD, C_UCON, C_REG, C_NONE, C_REG, 20, 4, 0}, - {AADD, C_UCON, C_NONE, C_NONE, C_REG, 20, 4, 0}, - {AADD, C_LCON, C_REG, C_NONE, C_REG, 22, 12, 0}, - {AADD, C_LCON, C_NONE, C_NONE, C_REG, 22, 12, 0}, - {AADDC, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, - {AADDC, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, - {AADDC, C_ADDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, - {AADDC, C_ADDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, - {AADDC, C_LCON, C_REG, C_NONE, C_REG, 22, 12, 0}, - {AADDC, C_LCON, C_NONE, C_NONE, C_REG, 22, 12, 0}, - {AAND, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, /* logical, no literal */ - {AAND, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {AANDCC, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, - {AANDCC, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {AANDCC, C_ANDCON, C_NONE, C_NONE, C_REG, 58, 4, 0}, - {AANDCC, C_ANDCON, C_REG, C_NONE, C_REG, 58, 4, 0}, - {AANDCC, C_UCON, C_NONE, C_NONE, C_REG, 59, 4, 0}, - {AANDCC, C_UCON, C_REG, C_NONE, C_REG, 59, 4, 0}, - {AANDCC, C_LCON, C_NONE, C_NONE, C_REG, 23, 12, 0}, - {AANDCC, C_LCON, C_REG, C_NONE, C_REG, 23, 12, 0}, - {AMULLW, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, - {AMULLW, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, - {AMULLW, C_ADDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, - {AMULLW, C_ADDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, - {AMULLW, C_ANDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, - {AMULLW, C_ANDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, - {AMULLW, C_LCON, C_REG, C_NONE, C_REG, 22, 12, 0}, - {AMULLW, C_LCON, C_NONE, C_NONE, C_REG, 22, 12, 0}, - {ASUBC, C_REG, C_REG, C_NONE, C_REG, 10, 4, 0}, - {ASUBC, C_REG, C_NONE, C_NONE, C_REG, 10, 4, 0}, - {ASUBC, C_REG, C_NONE, C_ADDCON, C_REG, 27, 4, 0}, - {ASUBC, C_REG, C_NONE, C_LCON, C_REG, 28, 12, 0}, - {AOR, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, /* logical, literal not cc (or/xor) */ - {AOR, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {AOR, C_ANDCON, C_NONE, C_NONE, C_REG, 58, 4, 0}, - {AOR, C_ANDCON, C_REG, C_NONE, C_REG, 58, 4, 0}, - {AOR, C_UCON, C_NONE, C_NONE, C_REG, 59, 4, 0}, - {AOR, C_UCON, C_REG, C_NONE, C_REG, 59, 4, 0}, - {AOR, C_LCON, C_NONE, C_NONE, C_REG, 23, 12, 0}, - {AOR, C_LCON, C_REG, C_NONE, C_REG, 23, 12, 0}, - {ADIVW, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, /* op r1[,r2],r3 */ - {ADIVW, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, - {ASUB, C_REG, C_REG, C_NONE, C_REG, 10, 4, 0}, /* op r2[,r1],r3 */ - {ASUB, C_REG, C_NONE, C_NONE, C_REG, 10, 4, 0}, - {ASLW, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {ASLW, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, - {ASLD, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {ASLD, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, - {ASLD, C_SCON, C_REG, C_NONE, C_REG, 25, 4, 0}, - {ASLD, C_SCON, C_NONE, C_NONE, C_REG, 25, 4, 0}, - {ASLW, C_SCON, C_REG, C_NONE, C_REG, 57, 4, 0}, - {ASLW, C_SCON, C_NONE, C_NONE, C_REG, 57, 4, 0}, - {ASRAW, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {ASRAW, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, - {ASRAW, C_SCON, C_REG, C_NONE, C_REG, 56, 4, 0}, - {ASRAW, C_SCON, C_NONE, C_NONE, C_REG, 56, 4, 0}, - {ASRAD, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, - {ASRAD, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, - {ASRAD, C_SCON, C_REG, C_NONE, C_REG, 56, 4, 0}, - {ASRAD, C_SCON, C_NONE, C_NONE, C_REG, 56, 4, 0}, - {ARLWMI, C_SCON, C_REG, C_LCON, C_REG, 62, 4, 0}, - {ARLWMI, C_REG, C_REG, C_LCON, C_REG, 63, 4, 0}, - {ARLDMI, C_SCON, C_REG, C_LCON, C_REG, 30, 4, 0}, - {ARLDC, C_SCON, C_REG, C_LCON, C_REG, 29, 4, 0}, - {ARLDCL, C_SCON, C_REG, C_LCON, C_REG, 29, 4, 0}, - {ARLDCL, C_REG, C_REG, C_LCON, C_REG, 14, 4, 0}, - {ARLDICL, C_REG, C_REG, C_LCON, C_REG, 14, 4, 0}, - {ARLDICL, C_SCON, C_REG, C_LCON, C_REG, 14, 4, 0}, - {ARLDCL, C_REG, C_NONE, C_LCON, C_REG, 14, 4, 0}, - {AFADD, C_FREG, C_NONE, C_NONE, C_FREG, 2, 4, 0}, - {AFADD, C_FREG, C_FREG, C_NONE, C_FREG, 2, 4, 0}, - {AFABS, C_FREG, C_NONE, C_NONE, C_FREG, 33, 4, 0}, - {AFABS, C_NONE, C_NONE, C_NONE, C_FREG, 33, 4, 0}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_FREG, 33, 4, 0}, - {AFMADD, C_FREG, C_FREG, C_FREG, C_FREG, 34, 4, 0}, - {AFMUL, C_FREG, C_NONE, C_NONE, C_FREG, 32, 4, 0}, - {AFMUL, C_FREG, C_FREG, C_NONE, C_FREG, 32, 4, 0}, - - /* store, short offset */ - {AMOVD, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVW, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVWZ, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVBZ, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVBZU, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVB, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVBU, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, - {AMOVD, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVW, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVB, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, - {AMOVD, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVW, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVB, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AMOVD, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVW, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVBZU, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVB, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AMOVBU, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - - /* load, short offset */ - {AMOVD, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVW, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVWZ, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVBZ, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVBZU, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVB, C_ZOREG, C_REG, C_NONE, C_REG, 9, 8, REGZERO}, - {AMOVBU, C_ZOREG, C_REG, C_NONE, C_REG, 9, 8, REGZERO}, - {AMOVD, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVW, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVWZ, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVBZ, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, - {AMOVB, C_SEXT, C_NONE, C_NONE, C_REG, 9, 8, REGSB}, - {AMOVD, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVW, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVWZ, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVBZ, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, - {AMOVB, C_SAUTO, C_NONE, C_NONE, C_REG, 9, 8, REGSP}, - {AMOVD, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVW, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVWZ, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVBZ, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVBZU, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, - {AMOVB, C_SOREG, C_NONE, C_NONE, C_REG, 9, 8, REGZERO}, - {AMOVBU, C_SOREG, C_NONE, C_NONE, C_REG, 9, 8, REGZERO}, - - /* store, long offset */ - {AMOVD, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, - {AMOVW, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, - {AMOVB, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, - {AMOVD, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, - {AMOVW, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, - {AMOVB, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, - {AMOVD, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, - {AMOVW, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, - {AMOVB, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, - {AMOVD, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, - {AMOVW, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, - {AMOVBZ, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, - {AMOVB, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, - - /* load, long offset */ - {AMOVD, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, - {AMOVW, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, - {AMOVWZ, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, - {AMOVBZ, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, - {AMOVB, C_LEXT, C_NONE, C_NONE, C_REG, 37, 12, REGSB}, - {AMOVD, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, - {AMOVW, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, - {AMOVWZ, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, - {AMOVBZ, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, - {AMOVB, C_LAUTO, C_NONE, C_NONE, C_REG, 37, 12, REGSP}, - {AMOVD, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, - {AMOVW, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, - {AMOVWZ, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, - {AMOVBZ, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, - {AMOVB, C_LOREG, C_NONE, C_NONE, C_REG, 37, 12, REGZERO}, - {AMOVD, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, - {AMOVW, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, - {AMOVWZ, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, - {AMOVBZ, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, - {AMOVB, C_ADDR, C_NONE, C_NONE, C_REG, 76, 12, 0}, - - {AMOVD, C_TLS_LE, C_NONE, C_NONE, C_REG, 79, 4, 0}, - {AMOVD, C_TLS_IE, C_NONE, C_NONE, C_REG, 80, 8, 0}, - - {AMOVD, C_GOTADDR, C_NONE, C_NONE, C_REG, 81, 8, 0}, - - /* load constant */ - {AMOVD, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, - {AMOVD, C_SACON, C_NONE, C_NONE, C_REG, 3, 4, REGSP}, - {AMOVD, C_LECON, C_NONE, C_NONE, C_REG, 26, 8, REGSB}, - {AMOVD, C_LACON, C_NONE, C_NONE, C_REG, 26, 8, REGSP}, - {AMOVD, C_ADDCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVW, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, /* TO DO: check */ - {AMOVW, C_SACON, C_NONE, C_NONE, C_REG, 3, 4, REGSP}, - {AMOVW, C_LECON, C_NONE, C_NONE, C_REG, 26, 8, REGSB}, - {AMOVW, C_LACON, C_NONE, C_NONE, C_REG, 26, 8, REGSP}, - {AMOVW, C_ADDCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVWZ, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, /* TO DO: check */ - {AMOVWZ, C_SACON, C_NONE, C_NONE, C_REG, 3, 4, REGSP}, - {AMOVWZ, C_LECON, C_NONE, C_NONE, C_REG, 26, 8, REGSB}, - {AMOVWZ, C_LACON, C_NONE, C_NONE, C_REG, 26, 8, REGSP}, - {AMOVWZ, C_ADDCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, - - /* load unsigned/long constants (TO DO: check) */ - {AMOVD, C_UCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVD, C_LCON, C_NONE, C_NONE, C_REG, 19, 8, 0}, - {AMOVW, C_UCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVW, C_LCON, C_NONE, C_NONE, C_REG, 19, 8, 0}, - {AMOVWZ, C_UCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, - {AMOVWZ, C_LCON, C_NONE, C_NONE, C_REG, 19, 8, 0}, - {AMOVHBR, C_ZOREG, C_REG, C_NONE, C_REG, 45, 4, 0}, - {AMOVHBR, C_ZOREG, C_NONE, C_NONE, C_REG, 45, 4, 0}, - {AMOVHBR, C_REG, C_REG, C_NONE, C_ZOREG, 44, 4, 0}, - {AMOVHBR, C_REG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, - {ASYSCALL, C_NONE, C_NONE, C_NONE, C_NONE, 5, 4, 0}, - {ASYSCALL, C_REG, C_NONE, C_NONE, C_NONE, 77, 12, 0}, - {ASYSCALL, C_SCON, C_NONE, C_NONE, C_NONE, 77, 12, 0}, - {ABEQ, C_NONE, C_NONE, C_NONE, C_SBRA, 16, 4, 0}, - {ABEQ, C_CREG, C_NONE, C_NONE, C_SBRA, 16, 4, 0}, - {ABR, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, - {ABR, C_NONE, C_NONE, C_NONE, C_LBRAPIC, 11, 8, 0}, - {ABC, C_SCON, C_REG, C_NONE, C_SBRA, 16, 4, 0}, - {ABC, C_SCON, C_REG, C_NONE, C_LBRA, 17, 4, 0}, - {ABR, C_NONE, C_NONE, C_NONE, C_LR, 18, 4, 0}, - {ABR, C_NONE, C_NONE, C_NONE, C_CTR, 18, 4, 0}, - {ABR, C_REG, C_NONE, C_NONE, C_CTR, 18, 4, 0}, - {ABR, C_NONE, C_NONE, C_NONE, C_ZOREG, 15, 8, 0}, - {ABC, C_NONE, C_REG, C_NONE, C_LR, 18, 4, 0}, - {ABC, C_NONE, C_REG, C_NONE, C_CTR, 18, 4, 0}, - {ABC, C_SCON, C_REG, C_NONE, C_LR, 18, 4, 0}, - {ABC, C_SCON, C_REG, C_NONE, C_CTR, 18, 4, 0}, - {ABC, C_NONE, C_NONE, C_NONE, C_ZOREG, 15, 8, 0}, - {AFMOVD, C_SEXT, C_NONE, C_NONE, C_FREG, 8, 4, REGSB}, - {AFMOVD, C_SAUTO, C_NONE, C_NONE, C_FREG, 8, 4, REGSP}, - {AFMOVD, C_SOREG, C_NONE, C_NONE, C_FREG, 8, 4, REGZERO}, - {AFMOVD, C_LEXT, C_NONE, C_NONE, C_FREG, 36, 8, REGSB}, - {AFMOVD, C_LAUTO, C_NONE, C_NONE, C_FREG, 36, 8, REGSP}, - {AFMOVD, C_LOREG, C_NONE, C_NONE, C_FREG, 36, 8, REGZERO}, - {AFMOVD, C_ADDR, C_NONE, C_NONE, C_FREG, 75, 8, 0}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, - {AFMOVD, C_FREG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, - {AFMOVSX, C_ZOREG, C_REG, C_NONE, C_FREG, 45, 4, 0}, - {AFMOVSX, C_ZOREG, C_NONE, C_NONE, C_FREG, 45, 4, 0}, - {AFMOVSX, C_FREG, C_REG, C_NONE, C_ZOREG, 44, 4, 0}, - {AFMOVSX, C_FREG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, - {AFMOVSZ, C_ZOREG, C_REG, C_NONE, C_FREG, 45, 4, 0}, - {AFMOVSZ, C_ZOREG, C_NONE, C_NONE, C_FREG, 45, 4, 0}, - {ASYNC, C_NONE, C_NONE, C_NONE, C_NONE, 46, 4, 0}, - {AWORD, C_LCON, C_NONE, C_NONE, C_NONE, 40, 4, 0}, - {ADWORD, C_LCON, C_NONE, C_NONE, C_NONE, 31, 8, 0}, - {ADWORD, C_DCON, C_NONE, C_NONE, C_NONE, 31, 8, 0}, - {AADDME, C_REG, C_NONE, C_NONE, C_REG, 47, 4, 0}, - {AEXTSB, C_REG, C_NONE, C_NONE, C_REG, 48, 4, 0}, - {AEXTSB, C_NONE, C_NONE, C_NONE, C_REG, 48, 4, 0}, - {AISEL, C_LCON, C_REG, C_REG, C_REG, 84, 4, 0}, - {AISEL, C_ZCON, C_REG, C_REG, C_REG, 84, 4, 0}, - {ANEG, C_REG, C_NONE, C_NONE, C_REG, 47, 4, 0}, - {ANEG, C_NONE, C_NONE, C_NONE, C_REG, 47, 4, 0}, - {AREM, C_REG, C_NONE, C_NONE, C_REG, 50, 12, 0}, - {AREM, C_REG, C_REG, C_NONE, C_REG, 50, 12, 0}, - {AREMU, C_REG, C_NONE, C_NONE, C_REG, 50, 16, 0}, - {AREMU, C_REG, C_REG, C_NONE, C_REG, 50, 16, 0}, - {AREMD, C_REG, C_NONE, C_NONE, C_REG, 51, 12, 0}, - {AREMD, C_REG, C_REG, C_NONE, C_REG, 51, 12, 0}, - {AREMDU, C_REG, C_NONE, C_NONE, C_REG, 51, 12, 0}, - {AREMDU, C_REG, C_REG, C_NONE, C_REG, 51, 12, 0}, - {AMTFSB0, C_SCON, C_NONE, C_NONE, C_NONE, 52, 4, 0}, - {AMOVFL, C_FPSCR, C_NONE, C_NONE, C_FREG, 53, 4, 0}, - {AMOVFL, C_FREG, C_NONE, C_NONE, C_FPSCR, 64, 4, 0}, - {AMOVFL, C_FREG, C_NONE, C_LCON, C_FPSCR, 64, 4, 0}, - {AMOVFL, C_LCON, C_NONE, C_NONE, C_FPSCR, 65, 4, 0}, - {AMOVD, C_MSR, C_NONE, C_NONE, C_REG, 54, 4, 0}, /* mfmsr */ - {AMOVD, C_REG, C_NONE, C_NONE, C_MSR, 54, 4, 0}, /* mtmsrd */ - {AMOVWZ, C_REG, C_NONE, C_NONE, C_MSR, 54, 4, 0}, /* mtmsr */ - - /* Vector instructions */ - - /* Vector load */ - {ALV, C_SOREG, C_NONE, C_NONE, C_VREG, 45, 4, 0}, /* vector load, x-form */ - - /* Vector store */ - {ASTV, C_VREG, C_NONE, C_NONE, C_SOREG, 44, 4, 0}, /* vector store, x-form */ - - /* Vector logical */ - {AVAND, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector and, vx-form */ - {AVOR, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector or, vx-form */ - - /* Vector add */ - {AVADDUM, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector add unsigned modulo, vx-form */ - {AVADDCU, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector add & write carry unsigned, vx-form */ - {AVADDUS, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector add unsigned saturate, vx-form */ - {AVADDSS, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector add signed saturate, vx-form */ - {AVADDE, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector add extended, va-form */ - - /* Vector subtract */ - {AVSUBUM, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector subtract unsigned modulo, vx-form */ - {AVSUBCU, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector subtract & write carry unsigned, vx-form */ - {AVSUBUS, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector subtract unsigned saturate, vx-form */ - {AVSUBSS, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector subtract signed saturate, vx-form */ - {AVSUBE, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector subtract extended, va-form */ - - /* Vector rotate */ - {AVR, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector rotate, vx-form */ - - /* Vector shift */ - {AVS, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector shift, vx-form */ - {AVSA, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector shift algebraic, vx-form */ - {AVSOI, C_ANDCON, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector shift by octet immediate, va-form */ - - /* Vector count */ - {AVCLZ, C_VREG, C_NONE, C_NONE, C_VREG, 85, 4, 0}, /* vector count leading zeros, vx-form */ - {AVPOPCNT, C_VREG, C_NONE, C_NONE, C_VREG, 85, 4, 0}, /* vector population count, vx-form */ - - /* Vector compare */ - {AVCMPEQ, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector compare equal, vc-form */ - {AVCMPGT, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector compare greater than, vc-form */ - - /* Vector permute */ - {AVPERM, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector permute, va-form */ - - /* Vector select */ - {AVSEL, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector select, va-form */ - - /* Vector splat */ - {AVSPLT, C_SCON, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector splat, vx-form */ - {AVSPLT, C_ADDCON, C_VREG, C_NONE, C_VREG, 82, 4, 0}, - {AVSPLTI, C_SCON, C_NONE, C_NONE, C_VREG, 82, 4, 0}, /* vector splat immediate, vx-form */ - {AVSPLTI, C_ADDCON, C_NONE, C_NONE, C_VREG, 82, 4, 0}, - - /* Vector AES */ - {AVCIPH, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector AES cipher, vx-form */ - {AVNCIPH, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector AES inverse cipher, vx-form */ - {AVSBOX, C_VREG, C_NONE, C_NONE, C_VREG, 82, 4, 0}, /* vector AES subbytes, vx-form */ - - /* Vector SHA */ - {AVSHASIGMA, C_ANDCON, C_VREG, C_ANDCON, C_VREG, 82, 4, 0}, /* vector SHA sigma, vx-form */ - - /* VSX vector load */ - {ALXV, C_SOREG, C_NONE, C_NONE, C_VSREG, 87, 4, 0}, /* vsx vector load, xx1-form */ - - /* VSX vector store */ - {ASTXV, C_VSREG, C_NONE, C_NONE, C_SOREG, 86, 4, 0}, /* vsx vector store, xx1-form */ - - /* VSX scalar load */ - {ALXS, C_SOREG, C_NONE, C_NONE, C_VSREG, 87, 4, 0}, /* vsx scalar load, xx1-form */ - - /* VSX scalar store */ - {ASTXS, C_VSREG, C_NONE, C_NONE, C_SOREG, 86, 4, 0}, /* vsx scalar store, xx1-form */ - - /* VSX scalar as integer load */ - {ALXSI, C_SOREG, C_NONE, C_NONE, C_VSREG, 87, 4, 0}, /* vsx scalar as integer load, xx1-form */ - - /* VSX scalar store as integer */ - {ASTXSI, C_VSREG, C_NONE, C_NONE, C_SOREG, 86, 4, 0}, /* vsx scalar as integer store, xx1-form */ - - /* VSX move from VSR */ - {AMFVSR, C_VSREG, C_NONE, C_NONE, C_REG, 88, 4, 0}, /* vsx move from vsr, xx1-form */ - - /* VSX move to VSR */ - {AMTVSR, C_REG, C_NONE, C_NONE, C_VSREG, 88, 4, 0}, /* vsx move to vsr, xx1-form */ - - /* VSX logical */ - {AXXLAND, C_VSREG, C_VSREG, C_NONE, C_VSREG, 90, 4, 0}, /* vsx and, xx3-form */ - {AXXLOR, C_VSREG, C_VSREG, C_NONE, C_VSREG, 90, 4, 0}, /* vsx or, xx3-form */ - - /* VSX select */ - {AXXSEL, C_VSREG, C_VSREG, C_VSREG, C_VSREG, 91, 4, 0}, /* vsx select, xx4-form */ - - /* VSX merge */ - {AXXMRG, C_VSREG, C_VSREG, C_NONE, C_VSREG, 90, 4, 0}, /* vsx merge, xx3-form */ - - /* VSX splat */ - {AXXSPLT, C_VSREG, C_NONE, C_SCON, C_VSREG, 89, 4, 0}, /* vsx splat, xx2-form */ - - /* VSX permute */ - {AXXPERM, C_VSREG, C_VSREG, C_SCON, C_VSREG, 90, 4, 0}, /* vsx permute, xx3-form */ - - /* VSX shift */ - {AXXSI, C_VSREG, C_VSREG, C_SCON, C_VSREG, 90, 4, 0}, /* vsx shift immediate, xx3-form */ - - /* VSX scalar FP-FP conversion */ - {AXSCV, C_VSREG, C_NONE, C_NONE, C_VSREG, 89, 4, 0}, /* vsx scalar fp-fp conversion, xx2-form */ - - /* VSX vector FP-FP conversion */ - {AXVCV, C_VSREG, C_NONE, C_NONE, C_VSREG, 89, 4, 0}, /* vsx vector fp-fp conversion, xx2-form */ - - /* VSX scalar FP-integer conversion */ - {AXSCVX, C_VSREG, C_NONE, C_NONE, C_VSREG, 89, 4, 0}, /* vsx scalar fp-integer conversion, xx2-form */ - - /* VSX scalar integer-FP conversion */ - {AXSCVXP, C_VSREG, C_NONE, C_NONE, C_VSREG, 89, 4, 0}, /* vsx scalar integer-fp conversion, xx2-form */ - - /* VSX vector FP-integer conversion */ - {AXVCVX, C_VSREG, C_NONE, C_NONE, C_VSREG, 89, 4, 0}, /* vsx vector fp-integer conversion, xx2-form */ - - /* VSX vector integer-FP conversion */ - {AXVCVXP, C_VSREG, C_NONE, C_NONE, C_VSREG, 89, 4, 0}, /* vsx vector integer-fp conversion, xx2-form */ - - /* 64-bit special registers */ - {AMOVD, C_REG, C_NONE, C_NONE, C_SPR, 66, 4, 0}, - {AMOVD, C_REG, C_NONE, C_NONE, C_LR, 66, 4, 0}, - {AMOVD, C_REG, C_NONE, C_NONE, C_CTR, 66, 4, 0}, - {AMOVD, C_REG, C_NONE, C_NONE, C_XER, 66, 4, 0}, - {AMOVD, C_SPR, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVD, C_LR, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVD, C_CTR, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVD, C_XER, C_NONE, C_NONE, C_REG, 66, 4, 0}, - - /* 32-bit special registers (gloss over sign-extension or not?) */ - {AMOVW, C_REG, C_NONE, C_NONE, C_SPR, 66, 4, 0}, - {AMOVW, C_REG, C_NONE, C_NONE, C_CTR, 66, 4, 0}, - {AMOVW, C_REG, C_NONE, C_NONE, C_XER, 66, 4, 0}, - {AMOVW, C_SPR, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVW, C_XER, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_SPR, 66, 4, 0}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_CTR, 66, 4, 0}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_XER, 66, 4, 0}, - {AMOVWZ, C_SPR, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVWZ, C_XER, C_NONE, C_NONE, C_REG, 66, 4, 0}, - {AMOVFL, C_FPSCR, C_NONE, C_NONE, C_CREG, 73, 4, 0}, - {AMOVFL, C_CREG, C_NONE, C_NONE, C_CREG, 67, 4, 0}, - {AMOVW, C_CREG, C_NONE, C_NONE, C_REG, 68, 4, 0}, - {AMOVWZ, C_CREG, C_NONE, C_NONE, C_REG, 68, 4, 0}, - {AMOVFL, C_REG, C_NONE, C_LCON, C_CREG, 69, 4, 0}, - {AMOVFL, C_REG, C_NONE, C_NONE, C_CREG, 69, 4, 0}, - {AMOVW, C_REG, C_NONE, C_NONE, C_CREG, 69, 4, 0}, - {AMOVWZ, C_REG, C_NONE, C_NONE, C_CREG, 69, 4, 0}, - {ACMP, C_REG, C_NONE, C_NONE, C_REG, 70, 4, 0}, - {ACMP, C_REG, C_REG, C_NONE, C_REG, 70, 4, 0}, - {ACMP, C_REG, C_NONE, C_NONE, C_ADDCON, 71, 4, 0}, - {ACMP, C_REG, C_REG, C_NONE, C_ADDCON, 71, 4, 0}, - {ACMPU, C_REG, C_NONE, C_NONE, C_REG, 70, 4, 0}, - {ACMPU, C_REG, C_REG, C_NONE, C_REG, 70, 4, 0}, - {ACMPU, C_REG, C_NONE, C_NONE, C_ANDCON, 71, 4, 0}, - {ACMPU, C_REG, C_REG, C_NONE, C_ANDCON, 71, 4, 0}, - {AFCMPO, C_FREG, C_NONE, C_NONE, C_FREG, 70, 4, 0}, - {AFCMPO, C_FREG, C_REG, C_NONE, C_FREG, 70, 4, 0}, - {ATW, C_LCON, C_REG, C_NONE, C_REG, 60, 4, 0}, - {ATW, C_LCON, C_REG, C_NONE, C_ADDCON, 61, 4, 0}, - {ADCBF, C_ZOREG, C_NONE, C_NONE, C_NONE, 43, 4, 0}, - {ADCBF, C_ZOREG, C_REG, C_NONE, C_NONE, 43, 4, 0}, - {AECOWX, C_REG, C_REG, C_NONE, C_ZOREG, 44, 4, 0}, - {AECIWX, C_ZOREG, C_REG, C_NONE, C_REG, 45, 4, 0}, - {AECOWX, C_REG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, - {AECIWX, C_ZOREG, C_NONE, C_NONE, C_REG, 45, 4, 0}, - {AEIEIO, C_NONE, C_NONE, C_NONE, C_NONE, 46, 4, 0}, - {ATLBIE, C_REG, C_NONE, C_NONE, C_NONE, 49, 4, 0}, - {ATLBIE, C_SCON, C_NONE, C_NONE, C_REG, 49, 4, 0}, - {ASLBMFEE, C_REG, C_NONE, C_NONE, C_REG, 55, 4, 0}, - {ASLBMTE, C_REG, C_NONE, C_NONE, C_REG, 55, 4, 0}, - {ASTSW, C_REG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, - {ASTSW, C_REG, C_NONE, C_LCON, C_ZOREG, 41, 4, 0}, - {ALSW, C_ZOREG, C_NONE, C_NONE, C_REG, 45, 4, 0}, - {ALSW, C_ZOREG, C_NONE, C_LCON, C_REG, 42, 4, 0}, - {obj.AUNDEF, C_NONE, C_NONE, C_NONE, C_NONE, 78, 4, 0}, - {obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, C_NONE, 0, 0, 0}, - {obj.APCDATA, C_LCON, C_NONE, C_NONE, C_LCON, 0, 0, 0}, - {obj.AFUNCDATA, C_SCON, C_NONE, C_NONE, C_ADDR, 0, 0, 0}, - {obj.ANOP, C_NONE, C_NONE, C_NONE, C_NONE, 0, 0, 0}, - {obj.ADUFFZERO, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, // same as ABR/ABL - {obj.ADUFFCOPY, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, // same as ABR/ABL - - {obj.AXXX, C_NONE, C_NONE, C_NONE, C_NONE, 0, 4, 0}, -} - -var oprange [ALAST & obj.AMask][]Optab - -var xcmp [C_NCLASS][C_NCLASS]bool - -func span9(ctxt *obj.Link, cursym *obj.LSym) { - p := cursym.Text - if p == nil || p.Link == nil { // handle external functions and ELF section symbols - return - } - ctxt.Cursym = cursym - ctxt.Autosize = int32(p.To.Offset) - - if oprange[AANDN&obj.AMask] == nil { - buildop(ctxt) - } - - c := int64(0) - p.Pc = c - - var m int - var o *Optab - for p = p.Link; p != nil; p = p.Link { - ctxt.Curp = p - p.Pc = c - o = oplook(ctxt, p) - m = int(o.size) - if m == 0 { - if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD { - ctxt.Diag("zero-width instruction\n%v", p) - } - continue - } - - c += int64(m) - } - - cursym.Size = c - - /* - * if any procedure is large enough to - * generate a large SBRA branch, then - * generate extra passes putting branches - * around jmps to fix. this is rare. - */ - bflag := 1 - - var otxt int64 - var q *obj.Prog - for bflag != 0 { - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f span1\n", obj.Cputime()) - } - bflag = 0 - c = 0 - for p = cursym.Text.Link; p != nil; p = p.Link { - p.Pc = c - o = oplook(ctxt, p) - - // very large conditional branches - if (o.type_ == 16 || o.type_ == 17) && p.Pcond != nil { - otxt = p.Pcond.Pc - c - if otxt < -(1<<15)+10 || otxt >= (1<<15)-10 { - q = ctxt.NewProg() - q.Link = p.Link - p.Link = q - q.As = ABR - q.To.Type = obj.TYPE_BRANCH - q.Pcond = p.Pcond - p.Pcond = q - q = ctxt.NewProg() - q.Link = p.Link - p.Link = q - q.As = ABR - q.To.Type = obj.TYPE_BRANCH - q.Pcond = q.Link.Link - - //addnop(p->link); - //addnop(p); - bflag = 1 - } - } - - m = int(o.size) - if m == 0 { - if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != obj.AUSEFIELD { - ctxt.Diag("zero-width instruction\n%v", p) - } - continue - } - - c += int64(m) - } - - cursym.Size = c - } - - c += -c & (funcAlign - 1) - cursym.Size = c - - /* - * lay out the code, emitting code and data relocations. - */ - - cursym.Grow(cursym.Size) - - bp := cursym.P - var i int32 - var out [6]uint32 - for p := cursym.Text.Link; p != nil; p = p.Link { - ctxt.Pc = p.Pc - ctxt.Curp = p - o = oplook(ctxt, p) - if int(o.size) > 4*len(out) { - log.Fatalf("out array in span9 is too small, need at least %d for %v", o.size/4, p) - } - asmout(ctxt, p, o, out[:]) - for i = 0; i < int32(o.size/4); i++ { - ctxt.Arch.ByteOrder.PutUint32(bp, out[i]) - bp = bp[4:] - } - } -} - -func isint32(v int64) bool { - return int64(int32(v)) == v -} - -func isuint32(v uint64) bool { - return uint64(uint32(v)) == v -} - -func aclass(ctxt *obj.Link, a *obj.Addr) int { - switch a.Type { - case obj.TYPE_NONE: - return C_NONE - - case obj.TYPE_REG: - if REG_R0 <= a.Reg && a.Reg <= REG_R31 { - return C_REG - } - if REG_F0 <= a.Reg && a.Reg <= REG_F31 { - return C_FREG - } - if REG_V0 <= a.Reg && a.Reg <= REG_V31 { - return C_VREG - } - if REG_VS0 <= a.Reg && a.Reg <= REG_VS63 { - return C_VSREG - } - if REG_CR0 <= a.Reg && a.Reg <= REG_CR7 || a.Reg == REG_CR { - return C_CREG - } - if REG_SPR0 <= a.Reg && a.Reg <= REG_SPR0+1023 { - switch a.Reg { - case REG_LR: - return C_LR - - case REG_XER: - return C_XER - - case REG_CTR: - return C_CTR - } - - return C_SPR - } - - if REG_DCR0 <= a.Reg && a.Reg <= REG_DCR0+1023 { - return C_SPR - } - if a.Reg == REG_FPSCR { - return C_FPSCR - } - if a.Reg == REG_MSR { - return C_MSR - } - return C_GOK - - case obj.TYPE_MEM: - switch a.Name { - case obj.NAME_EXTERN, - obj.NAME_STATIC: - if a.Sym == nil { - break - } - ctxt.Instoffset = a.Offset - if a.Sym != nil { // use relocation - if a.Sym.Type == obj.STLSBSS { - if ctxt.Flag_shared { - return C_TLS_IE - } else { - return C_TLS_LE - } - } - return C_ADDR - } - return C_LEXT - - case obj.NAME_GOTREF: - return C_GOTADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SAUTO - } - return C_LAUTO - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + ctxt.FixedFrameSize() - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SAUTO - } - return C_LAUTO - - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if ctxt.Instoffset == 0 { - return C_ZOREG - } - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SOREG - } - return C_LOREG - } - - return C_GOK - - case obj.TYPE_TEXTSIZE: - return C_TEXTSIZE - - case obj.TYPE_CONST, - obj.TYPE_ADDR: - switch a.Name { - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if a.Reg != 0 { - if -BIG <= ctxt.Instoffset && ctxt.Instoffset <= BIG { - return C_SACON - } - if isint32(ctxt.Instoffset) { - return C_LACON - } - return C_DACON - } - - goto consize - - case obj.NAME_EXTERN, - obj.NAME_STATIC: - s := a.Sym - if s == nil { - break - } - if s.Type == obj.SCONST { - ctxt.Instoffset = a.Offset - goto consize - } - - ctxt.Instoffset = a.Offset - - /* not sure why this barfs */ - return C_LCON - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SACON - } - return C_LACON - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + ctxt.FixedFrameSize() - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SACON - } - return C_LACON - } - - return C_GOK - - consize: - if ctxt.Instoffset >= 0 { - if ctxt.Instoffset == 0 { - return C_ZCON - } - if ctxt.Instoffset <= 0x7fff { - return C_SCON - } - if ctxt.Instoffset <= 0xffff { - return C_ANDCON - } - if ctxt.Instoffset&0xffff == 0 && isuint32(uint64(ctxt.Instoffset)) { /* && (instoffset & (1<<31)) == 0) */ - return C_UCON - } - if isint32(ctxt.Instoffset) || isuint32(uint64(ctxt.Instoffset)) { - return C_LCON - } - return C_DCON - } - - if ctxt.Instoffset >= -0x8000 { - return C_ADDCON - } - if ctxt.Instoffset&0xffff == 0 && isint32(ctxt.Instoffset) { - return C_UCON - } - if isint32(ctxt.Instoffset) { - return C_LCON - } - return C_DCON - - case obj.TYPE_BRANCH: - if a.Sym != nil && ctxt.Flag_dynlink { - return C_LBRAPIC - } - return C_SBRA - } - - return C_GOK -} - -func prasm(p *obj.Prog) { - fmt.Printf("%v\n", p) -} - -func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { - a1 := int(p.Optab) - if a1 != 0 { - return &optab[a1-1] - } - a1 = int(p.From.Class) - if a1 == 0 { - a1 = aclass(ctxt, &p.From) + 1 - p.From.Class = int8(a1) - } - - a1-- - a3 := C_NONE + 1 - if p.From3 != nil { - a3 = int(p.From3.Class) - if a3 == 0 { - a3 = aclass(ctxt, p.From3) + 1 - p.From3.Class = int8(a3) - } - } - - a3-- - a4 := int(p.To.Class) - if a4 == 0 { - a4 = aclass(ctxt, &p.To) + 1 - p.To.Class = int8(a4) - } - - a4-- - a2 := C_NONE - if p.Reg != 0 { - if REG_R0 <= p.Reg && p.Reg <= REG_R31 { - a2 = C_REG - } else if REG_V0 <= p.Reg && p.Reg <= REG_V31 { - a2 = C_VREG - } else if REG_VS0 <= p.Reg && p.Reg <= REG_VS63 { - a2 = C_VSREG - } else if REG_F0 <= p.Reg && p.Reg <= REG_F31 { - a2 = C_FREG - } - } - - //print("oplook %v %d %d %d %d\n", p, a1, a2, a3, a4); - ops := oprange[p.As&obj.AMask] - c1 := &xcmp[a1] - c3 := &xcmp[a3] - c4 := &xcmp[a4] - for i := range ops { - op := &ops[i] - if int(op.a2) == a2 && c1[op.a1] && c3[op.a3] && c4[op.a4] { - p.Optab = uint16(cap(optab) - cap(ops) + i + 1) - return op - } - } - - ctxt.Diag("illegal combination %v %v %v %v %v", p.As, DRconv(a1), DRconv(a2), DRconv(a3), DRconv(a4)) - prasm(p) - if ops == nil { - ops = optab - } - return &ops[0] -} - -func cmp(a int, b int) bool { - if a == b { - return true - } - switch a { - case C_LCON: - if b == C_ZCON || b == C_SCON || b == C_UCON || b == C_ADDCON || b == C_ANDCON { - return true - } - - case C_ADDCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_ANDCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_SPR: - if b == C_LR || b == C_XER || b == C_CTR { - return true - } - - case C_UCON: - if b == C_ZCON { - return true - } - - case C_SCON: - if b == C_ZCON { - return true - } - - case C_LACON: - if b == C_SACON { - return true - } - - case C_LBRA: - if b == C_SBRA { - return true - } - - case C_LEXT: - if b == C_SEXT { - return true - } - - case C_LAUTO: - if b == C_SAUTO { - return true - } - - case C_REG: - if b == C_ZCON { - return r0iszero != 0 /*TypeKind(100016)*/ - } - - case C_LOREG: - if b == C_ZOREG || b == C_SOREG { - return true - } - - case C_SOREG: - if b == C_ZOREG { - return true - } - - case C_ANY: - return true - } - - return false -} - -type ocmp []Optab - -func (x ocmp) Len() int { - return len(x) -} - -func (x ocmp) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} - -func (x ocmp) Less(i, j int) bool { - p1 := &x[i] - p2 := &x[j] - n := int(p1.as) - int(p2.as) - if n != 0 { - return n < 0 - } - n = int(p1.a1) - int(p2.a1) - if n != 0 { - return n < 0 - } - n = int(p1.a2) - int(p2.a2) - if n != 0 { - return n < 0 - } - n = int(p1.a3) - int(p2.a3) - if n != 0 { - return n < 0 - } - n = int(p1.a4) - int(p2.a4) - if n != 0 { - return n < 0 - } - return false -} -func opset(a, b0 obj.As) { - oprange[a&obj.AMask] = oprange[b0] -} - -func buildop(ctxt *obj.Link) { - var n int - - for i := 0; i < C_NCLASS; i++ { - for n = 0; n < C_NCLASS; n++ { - if cmp(n, i) { - xcmp[i][n] = true - } - } - } - for n = 0; optab[n].as != obj.AXXX; n++ { - } - sort.Sort(ocmp(optab[:n])) - for i := 0; i < n; i++ { - r := optab[i].as - r0 := r & obj.AMask - start := i - for optab[i].as == r { - i++ - } - oprange[r0] = optab[start:i] - i-- - - switch r { - default: - ctxt.Diag("unknown op in build: %v", r) - log.Fatalf("instruction missing from switch in asm9.go:buildop: %v", r) - - case ADCBF: /* unary indexed: op (b+a); op (b) */ - opset(ADCBI, r0) - - opset(ADCBST, r0) - opset(ADCBT, r0) - opset(ADCBTST, r0) - opset(ADCBZ, r0) - opset(AICBI, r0) - - case AECOWX: /* indexed store: op s,(b+a); op s,(b) */ - opset(ASTWCCC, r0) - opset(ASTBCCC, r0) - - opset(ASTDCCC, r0) - - case AREM: /* macro */ - opset(AREMCC, r0) - - opset(AREMV, r0) - opset(AREMVCC, r0) - - case AREMU: - opset(AREMU, r0) - opset(AREMUCC, r0) - opset(AREMUV, r0) - opset(AREMUVCC, r0) - - case AREMD: - opset(AREMDCC, r0) - opset(AREMDV, r0) - opset(AREMDVCC, r0) - - case AREMDU: - opset(AREMDU, r0) - opset(AREMDUCC, r0) - opset(AREMDUV, r0) - opset(AREMDUVCC, r0) - - case ADIVW: /* op Rb[,Ra],Rd */ - opset(AMULHW, r0) - - opset(AMULHWCC, r0) - opset(AMULHWU, r0) - opset(AMULHWUCC, r0) - opset(AMULLWCC, r0) - opset(AMULLWVCC, r0) - opset(AMULLWV, r0) - opset(ADIVWCC, r0) - opset(ADIVWV, r0) - opset(ADIVWVCC, r0) - opset(ADIVWU, r0) - opset(ADIVWUCC, r0) - opset(ADIVWUV, r0) - opset(ADIVWUVCC, r0) - opset(AADDCC, r0) - opset(AADDCV, r0) - opset(AADDCVCC, r0) - opset(AADDV, r0) - opset(AADDVCC, r0) - opset(AADDE, r0) - opset(AADDECC, r0) - opset(AADDEV, r0) - opset(AADDEVCC, r0) - opset(ACRAND, r0) - opset(ACRANDN, r0) - opset(ACREQV, r0) - opset(ACRNAND, r0) - opset(ACRNOR, r0) - opset(ACROR, r0) - opset(ACRORN, r0) - opset(ACRXOR, r0) - opset(AMULHD, r0) - opset(AMULHDCC, r0) - opset(AMULHDU, r0) - opset(AMULHDUCC, r0) - opset(AMULLD, r0) - opset(AMULLDCC, r0) - opset(AMULLDVCC, r0) - opset(AMULLDV, r0) - opset(ADIVD, r0) - opset(ADIVDCC, r0) - opset(ADIVDE, r0) - opset(ADIVDEU, r0) - opset(ADIVDECC, r0) - opset(ADIVDEUCC, r0) - opset(ADIVDVCC, r0) - opset(ADIVDV, r0) - opset(ADIVDU, r0) - opset(ADIVDUCC, r0) - opset(ADIVDUVCC, r0) - opset(ADIVDUCC, r0) - - case AMOVBZ: /* lbz, stz, rlwm(r/r), lhz, lha, stz, and x variants */ - opset(AMOVH, r0) - - opset(AMOVHZ, r0) - - case AMOVBZU: /* lbz[x]u, stb[x]u, lhz[x]u, lha[x]u, sth[u]x, ld[x]u, std[u]x */ - opset(AMOVHU, r0) - - opset(AMOVHZU, r0) - opset(AMOVWU, r0) - opset(AMOVWZU, r0) - opset(AMOVDU, r0) - opset(AMOVMW, r0) - - case ALV: /* lvebx, lvehx, lvewx, lvx, lvxl, lvsl, lvsr */ - opset(ALVEBX, r0) - opset(ALVEHX, r0) - opset(ALVEWX, r0) - opset(ALVX, r0) - opset(ALVXL, r0) - opset(ALVSL, r0) - opset(ALVSR, r0) - - case ASTV: /* stvebx, stvehx, stvewx, stvx, stvxl */ - opset(ASTVEBX, r0) - opset(ASTVEHX, r0) - opset(ASTVEWX, r0) - opset(ASTVX, r0) - opset(ASTVXL, r0) - - case AVAND: /* vand, vandc, vnand */ - opset(AVANDL, r0) - opset(AVANDC, r0) - opset(AVNAND, r0) - - case AVOR: /* vor, vorc, vxor, vnor, veqv */ - opset(AVORL, r0) - opset(AVORC, r0) - opset(AVXOR, r0) - opset(AVNOR, r0) - opset(AVEQV, r0) - - case AVADDUM: /* vaddubm, vadduhm, vadduwm, vaddudm, vadduqm */ - opset(AVADDUBM, r0) - opset(AVADDUHM, r0) - opset(AVADDUWM, r0) - opset(AVADDUDM, r0) - opset(AVADDUQM, r0) - - case AVADDCU: /* vaddcuq, vaddcuw */ - opset(AVADDCUQ, r0) - opset(AVADDCUW, r0) - - case AVADDUS: /* vaddubs, vadduhs, vadduws */ - opset(AVADDUBS, r0) - opset(AVADDUHS, r0) - opset(AVADDUWS, r0) - - case AVADDSS: /* vaddsbs, vaddshs, vaddsws */ - opset(AVADDSBS, r0) - opset(AVADDSHS, r0) - opset(AVADDSWS, r0) - - case AVADDE: /* vaddeuqm, vaddecuq */ - opset(AVADDEUQM, r0) - opset(AVADDECUQ, r0) - - case AVSUBUM: /* vsububm, vsubuhm, vsubuwm, vsubudm, vsubuqm */ - opset(AVSUBUBM, r0) - opset(AVSUBUHM, r0) - opset(AVSUBUWM, r0) - opset(AVSUBUDM, r0) - opset(AVSUBUQM, r0) - - case AVSUBCU: /* vsubcuq, vsubcuw */ - opset(AVSUBCUQ, r0) - opset(AVSUBCUW, r0) - - case AVSUBUS: /* vsububs, vsubuhs, vsubuws */ - opset(AVSUBUBS, r0) - opset(AVSUBUHS, r0) - opset(AVSUBUWS, r0) - - case AVSUBSS: /* vsubsbs, vsubshs, vsubsws */ - opset(AVSUBSBS, r0) - opset(AVSUBSHS, r0) - opset(AVSUBSWS, r0) - - case AVSUBE: /* vsubeuqm, vsubecuq */ - opset(AVSUBEUQM, r0) - opset(AVSUBECUQ, r0) - - case AVR: /* vrlb, vrlh, vrlw, vrld */ - opset(AVRLB, r0) - opset(AVRLH, r0) - opset(AVRLW, r0) - opset(AVRLD, r0) - - case AVS: /* vs[l,r], vs[l,r]o, vs[l,r]b, vs[l,r]h, vs[l,r]w, vs[l,r]d */ - opset(AVSLB, r0) - opset(AVSLH, r0) - opset(AVSLW, r0) - opset(AVSL, r0) - opset(AVSLO, r0) - opset(AVSRB, r0) - opset(AVSRH, r0) - opset(AVSRW, r0) - opset(AVSR, r0) - opset(AVSRO, r0) - opset(AVSLD, r0) - opset(AVSRD, r0) - - case AVSA: /* vsrab, vsrah, vsraw, vsrad */ - opset(AVSRAB, r0) - opset(AVSRAH, r0) - opset(AVSRAW, r0) - opset(AVSRAD, r0) - - case AVSOI: /* vsldoi */ - opset(AVSLDOI, r0) - - case AVCLZ: /* vclzb, vclzh, vclzw, vclzd */ - opset(AVCLZB, r0) - opset(AVCLZH, r0) - opset(AVCLZW, r0) - opset(AVCLZD, r0) - - case AVPOPCNT: /* vpopcntb, vpopcnth, vpopcntw, vpopcntd */ - opset(AVPOPCNTB, r0) - opset(AVPOPCNTH, r0) - opset(AVPOPCNTW, r0) - opset(AVPOPCNTD, r0) - - case AVCMPEQ: /* vcmpequb[.], vcmpequh[.], vcmpequw[.], vcmpequd[.] */ - opset(AVCMPEQUB, r0) - opset(AVCMPEQUBCC, r0) - opset(AVCMPEQUH, r0) - opset(AVCMPEQUHCC, r0) - opset(AVCMPEQUW, r0) - opset(AVCMPEQUWCC, r0) - opset(AVCMPEQUD, r0) - opset(AVCMPEQUDCC, r0) - - case AVCMPGT: /* vcmpgt[u,s]b[.], vcmpgt[u,s]h[.], vcmpgt[u,s]w[.], vcmpgt[u,s]d[.] */ - opset(AVCMPGTUB, r0) - opset(AVCMPGTUBCC, r0) - opset(AVCMPGTUH, r0) - opset(AVCMPGTUHCC, r0) - opset(AVCMPGTUW, r0) - opset(AVCMPGTUWCC, r0) - opset(AVCMPGTUD, r0) - opset(AVCMPGTUDCC, r0) - opset(AVCMPGTSB, r0) - opset(AVCMPGTSBCC, r0) - opset(AVCMPGTSH, r0) - opset(AVCMPGTSHCC, r0) - opset(AVCMPGTSW, r0) - opset(AVCMPGTSWCC, r0) - opset(AVCMPGTSD, r0) - opset(AVCMPGTSDCC, r0) - - case AVPERM: /* vperm */ - opset(AVPERM, r0) - - case AVSEL: /* vsel */ - opset(AVSEL, r0) - - case AVSPLT: /* vspltb, vsplth, vspltw */ - opset(AVSPLTB, r0) - opset(AVSPLTH, r0) - opset(AVSPLTW, r0) - - case AVSPLTI: /* vspltisb, vspltish, vspltisw */ - opset(AVSPLTISB, r0) - opset(AVSPLTISH, r0) - opset(AVSPLTISW, r0) - - case AVCIPH: /* vcipher, vcipherlast */ - opset(AVCIPHER, r0) - opset(AVCIPHERLAST, r0) - - case AVNCIPH: /* vncipher, vncipherlast */ - opset(AVNCIPHER, r0) - opset(AVNCIPHERLAST, r0) - - case AVSBOX: /* vsbox */ - opset(AVSBOX, r0) - - case AVSHASIGMA: /* vshasigmaw, vshasigmad */ - opset(AVSHASIGMAW, r0) - opset(AVSHASIGMAD, r0) - - case ALXV: /* lxvd2x, lxvdsx, lxvw4x */ - opset(ALXVD2X, r0) - opset(ALXVDSX, r0) - opset(ALXVW4X, r0) - - case ASTXV: /* stxvd2x, stxvdsx, stxvw4x */ - opset(ASTXVD2X, r0) - opset(ASTXVW4X, r0) - - case ALXS: /* lxsdx */ - opset(ALXSDX, r0) - - case ASTXS: /* stxsdx */ - opset(ASTXSDX, r0) - - case ALXSI: /* lxsiwax, lxsiwzx */ - opset(ALXSIWAX, r0) - opset(ALXSIWZX, r0) - - case ASTXSI: /* stxsiwx */ - opset(ASTXSIWX, r0) - - case AMFVSR: /* mfvsrd, mfvsrwz */ - opset(AMFVSRD, r0) - opset(AMFVSRWZ, r0) - - case AMTVSR: /* mtvsrd, mtvsrwa, mtvsrwz */ - opset(AMTVSRD, r0) - opset(AMTVSRWA, r0) - opset(AMTVSRWZ, r0) - - case AXXLAND: /* xxland, xxlandc, xxleqv, xxlnand */ - opset(AXXLANDQ, r0) - opset(AXXLANDC, r0) - opset(AXXLEQV, r0) - opset(AXXLNAND, r0) - - case AXXLOR: /* xxlorc, xxlnor, xxlor, xxlxor */ - opset(AXXLORC, r0) - opset(AXXLNOR, r0) - opset(AXXLORQ, r0) - opset(AXXLXOR, r0) - - case AXXSEL: /* xxsel */ - opset(AXXSEL, r0) - - case AXXMRG: /* xxmrghw, xxmrglw */ - opset(AXXMRGHW, r0) - opset(AXXMRGLW, r0) - - case AXXSPLT: /* xxspltw */ - opset(AXXSPLTW, r0) - - case AXXPERM: /* xxpermdi */ - opset(AXXPERMDI, r0) - - case AXXSI: /* xxsldwi */ - opset(AXXSLDWI, r0) - - case AXSCV: /* xscvdpsp, xscvspdp, xscvdpspn, xscvspdpn */ - opset(AXSCVDPSP, r0) - opset(AXSCVSPDP, r0) - opset(AXSCVDPSPN, r0) - opset(AXSCVSPDPN, r0) - - case AXVCV: /* xvcvdpsp, xvcvspdp */ - opset(AXVCVDPSP, r0) - opset(AXVCVSPDP, r0) - - case AXSCVX: /* xscvdpsxds, xscvdpsxws, xscvdpuxds, xscvdpuxws */ - opset(AXSCVDPSXDS, r0) - opset(AXSCVDPSXWS, r0) - opset(AXSCVDPUXDS, r0) - opset(AXSCVDPUXWS, r0) - - case AXSCVXP: /* xscvsxddp, xscvuxddp, xscvsxdsp, xscvuxdsp */ - opset(AXSCVSXDDP, r0) - opset(AXSCVUXDDP, r0) - opset(AXSCVSXDSP, r0) - opset(AXSCVUXDSP, r0) - - case AXVCVX: /* xvcvdpsxds, xvcvdpsxws, xvcvdpuxds, xvcvdpuxws, xvcvspsxds, xvcvspsxws, xvcvspuxds, xvcvspuxws */ - opset(AXVCVDPSXDS, r0) - opset(AXVCVDPSXWS, r0) - opset(AXVCVDPUXDS, r0) - opset(AXVCVDPUXWS, r0) - opset(AXVCVSPSXDS, r0) - opset(AXVCVSPSXWS, r0) - opset(AXVCVSPUXDS, r0) - opset(AXVCVSPUXWS, r0) - - case AXVCVXP: /* xvcvsxddp, xvcvsxwdp, xvcvuxddp, xvcvuxwdp, xvcvsxdsp, xvcvsxwsp, xvcvuxdsp, xvcvuxwsp */ - opset(AXVCVSXDDP, r0) - opset(AXVCVSXWDP, r0) - opset(AXVCVUXDDP, r0) - opset(AXVCVUXWDP, r0) - opset(AXVCVSXDSP, r0) - opset(AXVCVSXWSP, r0) - opset(AXVCVUXDSP, r0) - opset(AXVCVUXWSP, r0) - - case AAND: /* logical op Rb,Rs,Ra; no literal */ - opset(AANDN, r0) - - opset(AANDNCC, r0) - opset(AEQV, r0) - opset(AEQVCC, r0) - opset(ANAND, r0) - opset(ANANDCC, r0) - opset(ANOR, r0) - opset(ANORCC, r0) - opset(AORCC, r0) - opset(AORN, r0) - opset(AORNCC, r0) - opset(AXORCC, r0) - - case AADDME: /* op Ra, Rd */ - opset(AADDMECC, r0) - - opset(AADDMEV, r0) - opset(AADDMEVCC, r0) - opset(AADDZE, r0) - opset(AADDZECC, r0) - opset(AADDZEV, r0) - opset(AADDZEVCC, r0) - opset(ASUBME, r0) - opset(ASUBMECC, r0) - opset(ASUBMEV, r0) - opset(ASUBMEVCC, r0) - opset(ASUBZE, r0) - opset(ASUBZECC, r0) - opset(ASUBZEV, r0) - opset(ASUBZEVCC, r0) - - case AADDC: - opset(AADDCCC, r0) - - case ABEQ: - opset(ABGE, r0) - opset(ABGT, r0) - opset(ABLE, r0) - opset(ABLT, r0) - opset(ABNE, r0) - opset(ABVC, r0) - opset(ABVS, r0) - - case ABR: - opset(ABL, r0) - - case ABC: - opset(ABCL, r0) - - case AEXTSB: /* op Rs, Ra */ - opset(AEXTSBCC, r0) - - opset(AEXTSH, r0) - opset(AEXTSHCC, r0) - opset(ACNTLZW, r0) - opset(ACNTLZWCC, r0) - opset(ACNTLZD, r0) - opset(AEXTSW, r0) - opset(AEXTSWCC, r0) - opset(ACNTLZDCC, r0) - - case AFABS: /* fop [s,]d */ - opset(AFABSCC, r0) - - opset(AFNABS, r0) - opset(AFNABSCC, r0) - opset(AFNEG, r0) - opset(AFNEGCC, r0) - opset(AFRSP, r0) - opset(AFRSPCC, r0) - opset(AFCTIW, r0) - opset(AFCTIWCC, r0) - opset(AFCTIWZ, r0) - opset(AFCTIWZCC, r0) - opset(AFCTID, r0) - opset(AFCTIDCC, r0) - opset(AFCTIDZ, r0) - opset(AFCTIDZCC, r0) - opset(AFCFID, r0) - opset(AFCFIDCC, r0) - opset(AFCFIDU, r0) - opset(AFCFIDUCC, r0) - opset(AFRES, r0) - opset(AFRESCC, r0) - opset(AFRIM, r0) - opset(AFRIMCC, r0) - opset(AFRIP, r0) - opset(AFRIPCC, r0) - opset(AFRIZ, r0) - opset(AFRIZCC, r0) - opset(AFRSQRTE, r0) - opset(AFRSQRTECC, r0) - opset(AFSQRT, r0) - opset(AFSQRTCC, r0) - opset(AFSQRTS, r0) - opset(AFSQRTSCC, r0) - - case AFADD: - opset(AFADDS, r0) - opset(AFADDCC, r0) - opset(AFADDSCC, r0) - opset(AFDIV, r0) - opset(AFDIVS, r0) - opset(AFDIVCC, r0) - opset(AFDIVSCC, r0) - opset(AFSUB, r0) - opset(AFSUBS, r0) - opset(AFSUBCC, r0) - opset(AFSUBSCC, r0) - - case AFMADD: - opset(AFMADDCC, r0) - opset(AFMADDS, r0) - opset(AFMADDSCC, r0) - opset(AFMSUB, r0) - opset(AFMSUBCC, r0) - opset(AFMSUBS, r0) - opset(AFMSUBSCC, r0) - opset(AFNMADD, r0) - opset(AFNMADDCC, r0) - opset(AFNMADDS, r0) - opset(AFNMADDSCC, r0) - opset(AFNMSUB, r0) - opset(AFNMSUBCC, r0) - opset(AFNMSUBS, r0) - opset(AFNMSUBSCC, r0) - opset(AFSEL, r0) - opset(AFSELCC, r0) - - case AFMUL: - opset(AFMULS, r0) - opset(AFMULCC, r0) - opset(AFMULSCC, r0) - - case AFCMPO: - opset(AFCMPU, r0) - - case AISEL: - opset(AISEL, r0) - - case AMTFSB0: - opset(AMTFSB0CC, r0) - opset(AMTFSB1, r0) - opset(AMTFSB1CC, r0) - - case ANEG: /* op [Ra,] Rd */ - opset(ANEGCC, r0) - - opset(ANEGV, r0) - opset(ANEGVCC, r0) - - case AOR: /* or/xor Rb,Rs,Ra; ori/xori $uimm,Rs,Ra; oris/xoris $uimm,Rs,Ra */ - opset(AXOR, r0) - - case ASLW: - opset(ASLWCC, r0) - opset(ASRW, r0) - opset(ASRWCC, r0) - - case ASLD: - opset(ASLDCC, r0) - opset(ASRD, r0) - opset(ASRDCC, r0) - - case ASRAW: /* sraw Rb,Rs,Ra; srawi sh,Rs,Ra */ - opset(ASRAWCC, r0) - - case ASRAD: /* sraw Rb,Rs,Ra; srawi sh,Rs,Ra */ - opset(ASRADCC, r0) - - case ASUB: /* SUB Ra,Rb,Rd => subf Rd,ra,rb */ - opset(ASUB, r0) - - opset(ASUBCC, r0) - opset(ASUBV, r0) - opset(ASUBVCC, r0) - opset(ASUBCCC, r0) - opset(ASUBCV, r0) - opset(ASUBCVCC, r0) - opset(ASUBE, r0) - opset(ASUBECC, r0) - opset(ASUBEV, r0) - opset(ASUBEVCC, r0) - - case ASYNC: - opset(AISYNC, r0) - opset(ALWSYNC, r0) - opset(APTESYNC, r0) - opset(ATLBSYNC, r0) - - case ARLWMI: - opset(ARLWMICC, r0) - opset(ARLWNM, r0) - opset(ARLWNMCC, r0) - - case ARLDMI: - opset(ARLDMICC, r0) - opset(ARLDIMI, r0) - opset(ARLDIMICC, r0) - - case ARLDC: - opset(ARLDCCC, r0) - - case ARLDCL: - opset(ARLDCR, r0) - opset(ARLDCLCC, r0) - opset(ARLDCRCC, r0) - - case ARLDICL: - opset(ARLDICLCC, r0) - opset(ARLDICR, r0) - opset(ARLDICRCC, r0) - - case AFMOVD: - opset(AFMOVDCC, r0) - opset(AFMOVDU, r0) - opset(AFMOVS, r0) - opset(AFMOVSU, r0) - - case AECIWX: - opset(ALBAR, r0) - opset(ALWAR, r0) - opset(ALDAR, r0) - - case ASYSCALL: /* just the op; flow of control */ - opset(ARFI, r0) - - opset(ARFCI, r0) - opset(ARFID, r0) - opset(AHRFID, r0) - - case AMOVHBR: - opset(AMOVWBR, r0) - opset(AMOVDBR, r0) - - case ASLBMFEE: - opset(ASLBMFEV, r0) - - case ATW: - opset(ATD, r0) - - case ATLBIE: - opset(ASLBIE, r0) - opset(ATLBIEL, r0) - - case AEIEIO: - opset(ASLBIA, r0) - - case ACMP: - opset(ACMPW, r0) - - case ACMPU: - opset(ACMPWU, r0) - - case AADD, - AANDCC, /* and. Rb,Rs,Ra; andi. $uimm,Rs,Ra; andis. $uimm,Rs,Ra */ - AFMOVSX, - AFMOVSZ, - ALSW, - AMOVW, - /* load/store/move word with sign extension; special 32-bit move; move 32-bit literals */ - AMOVWZ, /* load/store/move word with zero extension; move 32-bit literals */ - AMOVD, /* load/store/move 64-bit values, including 32-bit literals with/without sign-extension */ - AMOVB, /* macro: move byte with sign extension */ - AMOVBU, /* macro: move byte with sign extension & update */ - AMOVFL, - AMULLW, - /* op $s[,r2],r3; op r1[,r2],r3; no cc/v */ - ASUBC, /* op r1,$s,r3; op r1[,r2],r3 */ - ASTSW, - ASLBMTE, - AWORD, - ADWORD, - obj.ANOP, - obj.ATEXT, - obj.AUNDEF, - obj.AUSEFIELD, - obj.AFUNCDATA, - obj.APCDATA, - obj.ADUFFZERO, - obj.ADUFFCOPY: - break - } - } -} - -func OPVXX1(o uint32, xo uint32, oe uint32) uint32 { - return o<<26 | xo<<1 | oe<<11 -} - -func OPVXX2(o uint32, xo uint32, oe uint32) uint32 { - return o<<26 | xo<<2 | oe<<11 -} - -func OPVXX3(o uint32, xo uint32, oe uint32) uint32 { - return o<<26 | xo<<3 | oe<<11 -} - -func OPVXX4(o uint32, xo uint32, oe uint32) uint32 { - return o<<26 | xo<<4 | oe<<11 -} - -func OPVX(o uint32, xo uint32, oe uint32, rc uint32) uint32 { - return o<<26 | xo | oe<<11 | rc&1 -} - -func OPVC(o uint32, xo uint32, oe uint32, rc uint32) uint32 { - return o<<26 | xo | oe<<11 | (rc&1)<<10 -} - -func OPVCC(o uint32, xo uint32, oe uint32, rc uint32) uint32 { - return o<<26 | xo<<1 | oe<<10 | rc&1 -} - -func OPCC(o uint32, xo uint32, rc uint32) uint32 { - return OPVCC(o, xo, 0, rc) -} - -func OP(o uint32, xo uint32) uint32 { - return OPVCC(o, xo, 0, 0) -} - -/* the order is dest, a/s, b/imm for both arithmetic and logical operations */ -func AOP_RRR(op uint32, d uint32, a uint32, b uint32) uint32 { - return op | (d&31)<<21 | (a&31)<<16 | (b&31)<<11 -} - -/* VX-form 2-register operands, r/r/none */ -func AOP_RR(op uint32, d uint32, a uint32) uint32 { - return op | (d&31)<<21 | (a&31)<<11 -} - -/* VA-form 4-register operands */ -func AOP_RRRR(op uint32, d uint32, a uint32, b uint32, c uint32) uint32 { - return op | (d&31)<<21 | (a&31)<<16 | (b&31)<<11 | (c&31)<<6 -} - -func AOP_IRR(op uint32, d uint32, a uint32, simm uint32) uint32 { - return op | (d&31)<<21 | (a&31)<<16 | simm&0xFFFF -} - -/* VX-form 2-register + UIM operands */ -func AOP_VIRR(op uint32, d uint32, a uint32, simm uint32) uint32 { - return op | (d&31)<<21 | (simm&0xFFFF)<<16 | (a&31)<<11 -} - -/* VX-form 2-register + ST + SIX operands */ -func AOP_IIRR(op uint32, d uint32, a uint32, sbit uint32, simm uint32) uint32 { - return op | (d&31)<<21 | (a&31)<<16 | (sbit&1)<<15 | (simm&0xF)<<11 -} - -/* VA-form 3-register + SHB operands */ -func AOP_IRRR(op uint32, d uint32, a uint32, b uint32, simm uint32) uint32 { - return op | (d&31)<<21 | (a&31)<<16 | (b&31)<<11 | (simm&0xF)<<6 -} - -/* VX-form 1-register + SIM operands */ -func AOP_IR(op uint32, d uint32, simm uint32) uint32 { - return op | (d&31)<<21 | (simm&31)<<16 -} - -/* XX1-form 3-register operands, 1 VSR operand */ -func AOP_XX1(op uint32, d uint32, a uint32, b uint32) uint32 { - /* For the XX-form encodings, we need the VSX register number to be exactly */ - /* between 0-63, so we can properly set the rightmost bits. */ - r := d - REG_VS0 - return op | (r&31)<<21 | (a&31)<<16 | (b&31)<<11 | (r&32)>>5 -} - -/* XX2-form 3-register operands, 2 VSR operands */ -func AOP_XX2(op uint32, d uint32, a uint32, b uint32) uint32 { - xt := d - REG_VS0 - xb := b - REG_VS0 - return op | (xt&31)<<21 | (a&3)<<16 | (xb&31)<<11 | (xb&32)>>4 | (xt&32)>>5 -} - -/* XX3-form 3 VSR operands */ -func AOP_XX3(op uint32, d uint32, a uint32, b uint32) uint32 { - xt := d - REG_VS0 - xa := a - REG_VS0 - xb := b - REG_VS0 - return op | (xt&31)<<21 | (xa&31)<<16 | (xb&31)<<11 | (xa&32)>>3 | (xb&32)>>4 | (xt&32)>>5 -} - -/* XX3-form 3 VSR operands + immediate */ -func AOP_XX3I(op uint32, d uint32, a uint32, b uint32, c uint32) uint32 { - xt := d - REG_VS0 - xa := a - REG_VS0 - xb := b - REG_VS0 - return op | (xt&31)<<21 | (xa&31)<<16 | (xb&31)<<11 | (c&3)<<8 | (xa&32)>>3 | (xb&32)>>4 | (xt&32)>>5 -} - -/* XX4-form, 4 VSR operands */ -func AOP_XX4(op uint32, d uint32, a uint32, b uint32, c uint32) uint32 { - xt := d - REG_VS0 - xa := a - REG_VS0 - xb := b - REG_VS0 - xc := c - REG_VS0 - return op | (xt&31)<<21 | (xa&31)<<16 | (xb&31)<<11 | (xc&31)<<6 | (xc&32)>>2 | (xa&32)>>3 | (xb&32)>>4 | (xt&32)>>5 -} - -func LOP_RRR(op uint32, a uint32, s uint32, b uint32) uint32 { - return op | (s&31)<<21 | (a&31)<<16 | (b&31)<<11 -} - -func LOP_IRR(op uint32, a uint32, s uint32, uimm uint32) uint32 { - return op | (s&31)<<21 | (a&31)<<16 | uimm&0xFFFF -} - -func OP_BR(op uint32, li uint32, aa uint32) uint32 { - return op | li&0x03FFFFFC | aa<<1 -} - -func OP_BC(op uint32, bo uint32, bi uint32, bd uint32, aa uint32) uint32 { - return op | (bo&0x1F)<<21 | (bi&0x1F)<<16 | bd&0xFFFC | aa<<1 -} - -func OP_BCR(op uint32, bo uint32, bi uint32) uint32 { - return op | (bo&0x1F)<<21 | (bi&0x1F)<<16 -} - -func OP_RLW(op uint32, a uint32, s uint32, sh uint32, mb uint32, me uint32) uint32 { - return op | (s&31)<<21 | (a&31)<<16 | (sh&31)<<11 | (mb&31)<<6 | (me&31)<<1 -} - -func AOP_ISEL(op uint32, t uint32, a uint32, b uint32, bc uint32) uint32 { - return op | (t&31)<<21 | (a&31)<<16 | (b&31)<<11 | (bc&0x1F)<<6 -} - -const ( - /* each rhs is OPVCC(_, _, _, _) */ - OP_ADD = 31<<26 | 266<<1 | 0<<10 | 0 - OP_ADDI = 14<<26 | 0<<1 | 0<<10 | 0 - OP_ADDIS = 15<<26 | 0<<1 | 0<<10 | 0 - OP_ANDI = 28<<26 | 0<<1 | 0<<10 | 0 - OP_EXTSB = 31<<26 | 954<<1 | 0<<10 | 0 - OP_EXTSH = 31<<26 | 922<<1 | 0<<10 | 0 - OP_EXTSW = 31<<26 | 986<<1 | 0<<10 | 0 - OP_ISEL = 31<<26 | 15<<1 | 0<<10 | 0 - OP_MCRF = 19<<26 | 0<<1 | 0<<10 | 0 - OP_MCRFS = 63<<26 | 64<<1 | 0<<10 | 0 - OP_MCRXR = 31<<26 | 512<<1 | 0<<10 | 0 - OP_MFCR = 31<<26 | 19<<1 | 0<<10 | 0 - OP_MFFS = 63<<26 | 583<<1 | 0<<10 | 0 - OP_MFMSR = 31<<26 | 83<<1 | 0<<10 | 0 - OP_MFSPR = 31<<26 | 339<<1 | 0<<10 | 0 - OP_MFSR = 31<<26 | 595<<1 | 0<<10 | 0 - OP_MFSRIN = 31<<26 | 659<<1 | 0<<10 | 0 - OP_MTCRF = 31<<26 | 144<<1 | 0<<10 | 0 - OP_MTFSF = 63<<26 | 711<<1 | 0<<10 | 0 - OP_MTFSFI = 63<<26 | 134<<1 | 0<<10 | 0 - OP_MTMSR = 31<<26 | 146<<1 | 0<<10 | 0 - OP_MTMSRD = 31<<26 | 178<<1 | 0<<10 | 0 - OP_MTSPR = 31<<26 | 467<<1 | 0<<10 | 0 - OP_MTSR = 31<<26 | 210<<1 | 0<<10 | 0 - OP_MTSRIN = 31<<26 | 242<<1 | 0<<10 | 0 - OP_MULLW = 31<<26 | 235<<1 | 0<<10 | 0 - OP_MULLD = 31<<26 | 233<<1 | 0<<10 | 0 - OP_OR = 31<<26 | 444<<1 | 0<<10 | 0 - OP_ORI = 24<<26 | 0<<1 | 0<<10 | 0 - OP_ORIS = 25<<26 | 0<<1 | 0<<10 | 0 - OP_RLWINM = 21<<26 | 0<<1 | 0<<10 | 0 - OP_SUBF = 31<<26 | 40<<1 | 0<<10 | 0 - OP_RLDIC = 30<<26 | 4<<1 | 0<<10 | 0 - OP_RLDICR = 30<<26 | 2<<1 | 0<<10 | 0 - OP_RLDICL = 30<<26 | 0<<1 | 0<<10 | 0 -) - -func oclass(a *obj.Addr) int { - return int(a.Class) - 1 -} - -const ( - D_FORM = iota - DS_FORM -) - -// opform returns the form (D_FORM or DS_FORM) of an instruction. Used to decide on -// which relocation to use with a load or store and only supports the needed -// instructions. -func opform(ctxt *obj.Link, insn uint32) int { - switch insn { - default: - ctxt.Diag("bad insn in loadform: %x", insn) - case OPVCC(58, 0, 0, 0), // ld - OPVCC(58, 0, 0, 0) | 1<<1, // lwa - OPVCC(62, 0, 0, 0): // std - return DS_FORM - case OP_ADDI, // add - OPVCC(32, 0, 0, 0), // lwz - OPVCC(42, 0, 0, 0), // lha - OPVCC(40, 0, 0, 0), // lhz - OPVCC(34, 0, 0, 0), // lbz - OPVCC(50, 0, 0, 0), // lfd - OPVCC(48, 0, 0, 0), // lfs - OPVCC(36, 0, 0, 0), // stw - OPVCC(44, 0, 0, 0), // sth - OPVCC(38, 0, 0, 0), // stb - OPVCC(54, 0, 0, 0), // stfd - OPVCC(52, 0, 0, 0): // stfs - return D_FORM - } - return 0 -} - -// Encode instructions and create relocation for accessing s+d according to the -// instruction op with source or destination (as appropriate) register reg. -func symbolAccess(ctxt *obj.Link, s *obj.LSym, d int64, reg int16, op uint32) (o1, o2 uint32) { - var base uint32 - form := opform(ctxt, op) - if ctxt.Flag_shared { - base = REG_R2 - } else { - base = REG_R0 - } - o1 = AOP_IRR(OP_ADDIS, REGTMP, base, 0) - o2 = AOP_IRR(op, uint32(reg), REGTMP, 0) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = s - rel.Add = d - if ctxt.Flag_shared { - switch form { - case D_FORM: - rel.Type = obj.R_ADDRPOWER_TOCREL - case DS_FORM: - rel.Type = obj.R_ADDRPOWER_TOCREL_DS - } - - } else { - switch form { - case D_FORM: - rel.Type = obj.R_ADDRPOWER - case DS_FORM: - rel.Type = obj.R_ADDRPOWER_DS - } - } - return -} - -/* - * 32-bit masks - */ -func getmask(m []byte, v uint32) bool { - m[1] = 0 - m[0] = m[1] - if v != ^uint32(0) && v&(1<<31) != 0 && v&1 != 0 { /* MB > ME */ - if getmask(m, ^v) { - i := int(m[0]) - m[0] = m[1] + 1 - m[1] = byte(i - 1) - return true - } - - return false - } - - for i := 0; i < 32; i++ { - if v&(1<= 32 || v&(1<= 64 || v&(uint64(1)<> 16) - if isuint32(uint64(d)) { - return LOP_IRR(OP_ORIS, uint32(r), REGZERO, uint32(v)) - } - return AOP_IRR(OP_ADDIS, uint32(r), REGZERO, uint32(v)) -} - -func high16adjusted(d int32) uint16 { - if d&0x8000 != 0 { - return uint16((d >> 16) + 1) - } - return uint16(d >> 16) -} - -func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { - o1 := uint32(0) - o2 := uint32(0) - o3 := uint32(0) - o4 := uint32(0) - o5 := uint32(0) - - //print("%v => case %d\n", p, o->type); - switch o.type_ { - default: - ctxt.Diag("unknown type %d", o.type_) - prasm(p) - - case 0: /* pseudo ops */ - break - - case 1: /* mov r1,r2 ==> OR Rs,Rs,Ra */ - if p.To.Reg == REGZERO && p.From.Type == obj.TYPE_CONST { - v := regoff(ctxt, &p.From) - if r0iszero != 0 /*TypeKind(100016)*/ && v != 0 { - //nerrors--; - ctxt.Diag("literal operation on R0\n%v", p) - } - - o1 = LOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(v)) - break - } - - o1 = LOP_RRR(OP_OR, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.From.Reg)) - - case 2: /* int/cr/fp op Rb,[Ra],Rd */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(p.From.Reg)) - - case 3: /* mov $soreg/addcon/ucon, r ==> addis/addi $i,reg',r */ - d := vregoff(ctxt, &p.From) - - v := int32(d) - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - if r0iszero != 0 /*TypeKind(100016)*/ && p.To.Reg == 0 && (r != 0 || v != 0) { - ctxt.Diag("literal operation on R0\n%v", p) - } - a := OP_ADDI - if o.a1 == C_UCON { - if d&0xffff != 0 { - log.Fatalf("invalid handling of %v", p) - } - v >>= 16 - if r == REGZERO && isuint32(uint64(d)) { - o1 = LOP_IRR(OP_ORIS, uint32(p.To.Reg), REGZERO, uint32(v)) - break - } - - a = OP_ADDIS - } else { - if int64(int16(d)) != d { - log.Fatalf("invalid handling of %v", p) - } - } - - o1 = AOP_IRR(uint32(a), uint32(p.To.Reg), uint32(r), uint32(v)) - - case 4: /* add/mul $scon,[r1],r2 */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - if r0iszero != 0 /*TypeKind(100016)*/ && p.To.Reg == 0 { - ctxt.Diag("literal operation on R0\n%v", p) - } - if int32(int16(v)) != v { - log.Fatalf("mishandled instruction %v", p) - } - o1 = AOP_IRR(opirr(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(v)) - - case 5: /* syscall */ - o1 = oprrr(ctxt, p.As) - - case 6: /* logical op Rb,[Rs,]Ra; no literal */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = LOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(p.From.Reg)) - - case 7: /* mov r, soreg ==> stw o(r) */ - r := int(p.To.Reg) - - if r == 0 { - r = int(o.param) - } - v := regoff(ctxt, &p.To) - if p.To.Type == obj.TYPE_MEM && p.To.Index != 0 { - if v != 0 { - ctxt.Diag("illegal indexed instruction\n%v", p) - } - if ctxt.Flag_shared && r == REG_R13 { - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - // This (and the matching part in the load case - // below) are the only places in the ppc64 toolchain - // that knows the name of the tls variable. Possibly - // we could add some assembly syntax so that the name - // of the variable does not have to be assumed. - rel.Sym = obj.Linklookup(ctxt, "runtime.tls_g", 0) - rel.Type = obj.R_POWER_TLS - } - o1 = AOP_RRR(opstorex(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Index), uint32(r)) - } else { - if int32(int16(v)) != v { - log.Fatalf("mishandled instruction %v", p) - } - o1 = AOP_IRR(opstore(ctxt, p.As), uint32(p.From.Reg), uint32(r), uint32(v)) - } - - case 8: /* mov soreg, r ==> lbz/lhz/lwz o(r) */ - r := int(p.From.Reg) - - if r == 0 { - r = int(o.param) - } - v := regoff(ctxt, &p.From) - if p.From.Type == obj.TYPE_MEM && p.From.Index != 0 { - if v != 0 { - ctxt.Diag("illegal indexed instruction\n%v", p) - } - if ctxt.Flag_shared && r == REG_R13 { - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = obj.Linklookup(ctxt, "runtime.tls_g", 0) - rel.Type = obj.R_POWER_TLS - } - o1 = AOP_RRR(oploadx(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Index), uint32(r)) - } else { - if int32(int16(v)) != v { - log.Fatalf("mishandled instruction %v", p) - } - o1 = AOP_IRR(opload(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(v)) - } - - case 9: /* movb soreg, r ==> lbz o(r),r2; extsb r2,r2 */ - r := int(p.From.Reg) - - if r == 0 { - r = int(o.param) - } - v := regoff(ctxt, &p.From) - if p.From.Type == obj.TYPE_MEM && p.From.Index != 0 { - if v != 0 { - ctxt.Diag("illegal indexed instruction\n%v", p) - } - o1 = AOP_RRR(oploadx(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Index), uint32(r)) - } else { - o1 = AOP_IRR(opload(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(v)) - } - o2 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.To.Reg), 0) - - case 10: /* sub Ra,[Rb],Rd => subf Rd,Ra,Rb */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(r)) - - case 11: /* br/bl lbra */ - v := int32(0) - - if p.Pcond != nil { - v = int32(p.Pcond.Pc - p.Pc) - if v&03 != 0 { - ctxt.Diag("odd branch target address\n%v", p) - v &^= 03 - } - - if v < -(1<<25) || v >= 1<<24 { - ctxt.Diag("branch too far\n%v", p) - } - } - - o1 = OP_BR(opirr(ctxt, p.As), uint32(v), 0) - if p.To.Sym != nil { - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.To.Sym - v += int32(p.To.Offset) - if v&03 != 0 { - ctxt.Diag("odd branch target address\n%v", p) - v &^= 03 - } - - rel.Add = int64(v) - rel.Type = obj.R_CALLPOWER - } - o2 = 0x60000000 // nop, sometimes overwritten by ld r2, 24(r1) when dynamic linking - - case 12: /* movb r,r (extsb); movw r,r (extsw) */ - if p.To.Reg == REGZERO && p.From.Type == obj.TYPE_CONST { - v := regoff(ctxt, &p.From) - if r0iszero != 0 /*TypeKind(100016)*/ && v != 0 { - ctxt.Diag("literal operation on R0\n%v", p) - } - - o1 = LOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(v)) - break - } - - if p.As == AMOVW { - o1 = LOP_RRR(OP_EXTSW, uint32(p.To.Reg), uint32(p.From.Reg), 0) - } else { - o1 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.From.Reg), 0) - } - - case 13: /* mov[bhw]z r,r; uses rlwinm not andi. to avoid changing CC */ - if p.As == AMOVBZ { - o1 = OP_RLW(OP_RLWINM, uint32(p.To.Reg), uint32(p.From.Reg), 0, 24, 31) - } else if p.As == AMOVH { - o1 = LOP_RRR(OP_EXTSH, uint32(p.To.Reg), uint32(p.From.Reg), 0) - } else if p.As == AMOVHZ { - o1 = OP_RLW(OP_RLWINM, uint32(p.To.Reg), uint32(p.From.Reg), 0, 16, 31) - } else if p.As == AMOVWZ { - o1 = OP_RLW(OP_RLDIC, uint32(p.To.Reg), uint32(p.From.Reg), 0, 0, 0) | 1<<5 /* MB=32 */ - } else { - ctxt.Diag("internal: bad mov[bhw]z\n%v", p) - } - - case 14: /* rldc[lr] Rb,Rs,$mask,Ra -- left, right give different masks */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - d := vregoff(ctxt, p.From3) - var a int - switch p.As { - - // These opcodes expect a mask operand that has to be converted into the - // appropriate operand. The way these were defined, not all valid masks are possible. - // Left here for compatibility in case they were used or generated. - case ARLDCL, ARLDCLCC: - var mask [2]uint8 - maskgen64(ctxt, p, mask[:], uint64(d)) - - a = int(mask[0]) /* MB */ - if mask[1] != 63 { - ctxt.Diag("invalid mask for rotate: %x (end != bit 63)\n%v", uint64(d), p) - } - - case ARLDCR, ARLDCRCC: - var mask [2]uint8 - maskgen64(ctxt, p, mask[:], uint64(d)) - - a = int(mask[1]) /* ME */ - if mask[0] != 0 { - ctxt.Diag("invalid mask for rotate: %x (start != 0)\n%v", uint64(d), p) - } - - // These opcodes use a shift count like the ppc64 asm, no mask conversion done - case ARLDICR, ARLDICRCC, ARLDICL, ARLDICLCC: - a = int(d) - - default: - ctxt.Diag("unexpected op in rldc case\n%v", p) - a = 0 - } - - o1 = LOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(p.From.Reg)) - o1 |= (uint32(a) & 31) << 6 - if a&0x20 != 0 { - o1 |= 1 << 5 /* mb[5] is top bit */ - } - - case 17, /* bc bo,bi,lbra (same for now) */ - 16: /* bc bo,bi,sbra */ - a := 0 - - r := int(p.Reg) - - if p.From.Type == obj.TYPE_CONST { - a = int(regoff(ctxt, &p.From)) - } else if p.From.Type == obj.TYPE_REG { - if r != 0 { - ctxt.Diag("unexpected register setting for branch with CR: %d\n", r) - } - // BI values for the CR - switch p.From.Reg { - case REG_CR0: - r = BI_CR0 - case REG_CR1: - r = BI_CR1 - case REG_CR2: - r = BI_CR2 - case REG_CR3: - r = BI_CR3 - case REG_CR4: - r = BI_CR4 - case REG_CR5: - r = BI_CR5 - case REG_CR6: - r = BI_CR6 - case REG_CR7: - r = BI_CR7 - default: - ctxt.Diag("unrecognized register: expecting CR\n") - } - } - v := int32(0) - if p.Pcond != nil { - v = int32(p.Pcond.Pc - p.Pc) - } - if v&03 != 0 { - ctxt.Diag("odd branch target address\n%v", p) - v &^= 03 - } - - if v < -(1<<16) || v >= 1<<15 { - ctxt.Diag("branch too far\n%v", p) - } - o1 = OP_BC(opirr(ctxt, p.As), uint32(a), uint32(r), uint32(v), 0) - - case 15: /* br/bl (r) => mov r,lr; br/bl (lr) */ - var v int32 - if p.As == ABC || p.As == ABCL { - v = regoff(ctxt, &p.To) & 31 - } else { - v = 20 /* unconditional */ - } - o1 = AOP_RRR(OP_MTSPR, uint32(p.To.Reg), 0, 0) | (REG_LR&0x1f)<<16 | ((REG_LR>>5)&0x1f)<<11 - o2 = OPVCC(19, 16, 0, 0) - if p.As == ABL || p.As == ABCL { - o2 |= 1 - } - o2 = OP_BCR(o2, uint32(v), uint32(p.To.Index)) - - case 18: /* br/bl (lr/ctr); bc/bcl bo,bi,(lr/ctr) */ - var v int32 - if p.As == ABC || p.As == ABCL { - v = regoff(ctxt, &p.From) & 31 - } else { - v = 20 /* unconditional */ - } - r := int(p.Reg) - if r == 0 { - r = 0 - } - switch oclass(&p.To) { - case C_CTR: - o1 = OPVCC(19, 528, 0, 0) - - case C_LR: - o1 = OPVCC(19, 16, 0, 0) - - default: - ctxt.Diag("bad optab entry (18): %d\n%v", p.To.Class, p) - v = 0 - } - - if p.As == ABL || p.As == ABCL { - o1 |= 1 - } - o1 = OP_BCR(o1, uint32(v), uint32(r)) - - case 19: /* mov $lcon,r ==> cau+or */ - d := vregoff(ctxt, &p.From) - - if p.From.Sym == nil { - o1 = loadu32(int(p.To.Reg), d) - o2 = LOP_IRR(OP_ORI, uint32(p.To.Reg), uint32(p.To.Reg), uint32(int32(d))) - } else { - o1, o2 = symbolAccess(ctxt, p.From.Sym, d, p.To.Reg, OP_ADDI) - } - - //if(dlm) reloc(&p->from, p->pc, 0); - - case 20: /* add $ucon,,r */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - if p.As == AADD && (r0iszero == 0 /*TypeKind(100016)*/ && p.Reg == 0 || r0iszero != 0 /*TypeKind(100016)*/ && p.To.Reg == 0) { - ctxt.Diag("literal operation on R0\n%v", p) - } - o1 = AOP_IRR(opirr(ctxt, -p.As), uint32(p.To.Reg), uint32(r), uint32(v)>>16) - - case 22: /* add $lcon,r1,r2 ==> cau+or+add */ /* could do add/sub more efficiently */ - if p.To.Reg == REGTMP || p.Reg == REGTMP { - ctxt.Diag("can't synthesize large constant\n%v", p) - } - d := vregoff(ctxt, &p.From) - o1 = loadu32(REGTMP, d) - o2 = LOP_IRR(OP_ORI, REGTMP, REGTMP, uint32(int32(d))) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o3 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), REGTMP, uint32(r)) - if p.From.Sym != nil { - ctxt.Diag("%v is not supported", p) - } - - //if(dlm) reloc(&p->from, p->pc, 0); - - case 23: /* and $lcon,r1,r2 ==> cau+or+and */ /* masks could be done using rlnm etc. */ - if p.To.Reg == REGTMP || p.Reg == REGTMP { - ctxt.Diag("can't synthesize large constant\n%v", p) - } - d := vregoff(ctxt, &p.From) - o1 = loadu32(REGTMP, d) - o2 = LOP_IRR(OP_ORI, REGTMP, REGTMP, uint32(int32(d))) - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o3 = LOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), REGTMP, uint32(r)) - if p.From.Sym != nil { - ctxt.Diag("%v is not supported", p) - } - - //if(dlm) reloc(&p->from, p->pc, 0); - - /*24*/ - case 25: - /* sld[.] $sh,rS,rA -> rldicr[.] $sh,rS,mask(0,63-sh),rA; srd[.] -> rldicl */ - v := regoff(ctxt, &p.From) - - if v < 0 { - v = 0 - } else if v > 63 { - v = 63 - } - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - var a int - switch p.As { - case ASLD, ASLDCC: - a = int(63 - v) - o1 = OP_RLDICR - - case ASRD, ASRDCC: - a = int(v) - v = 64 - v - o1 = OP_RLDICL - - default: - ctxt.Diag("unexpected op in sldi case\n%v", p) - a = 0 - o1 = 0 - } - - o1 = AOP_RRR(o1, uint32(r), uint32(p.To.Reg), (uint32(v) & 0x1F)) - o1 |= (uint32(a) & 31) << 6 - if v&0x20 != 0 { - o1 |= 1 << 1 - } - if a&0x20 != 0 { - o1 |= 1 << 5 /* mb[5] is top bit */ - } - if p.As == ASLDCC || p.As == ASRDCC { - o1 |= 1 /* Rc */ - } - - case 26: /* mov $lsext/auto/oreg,,r2 ==> addis+addi */ - if p.To.Reg == REGTMP { - ctxt.Diag("can't synthesize large constant\n%v", p) - } - v := regoff(ctxt, &p.From) - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) - o2 = AOP_IRR(OP_ADDI, uint32(p.To.Reg), REGTMP, uint32(v)) - - case 27: /* subc ra,$simm,rd => subfic rd,ra,$simm */ - v := regoff(ctxt, p.From3) - - r := int(p.From.Reg) - o1 = AOP_IRR(opirr(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(v)) - - case 28: /* subc r1,$lcon,r2 ==> cau+or+subfc */ - if p.To.Reg == REGTMP || p.From.Reg == REGTMP { - ctxt.Diag("can't synthesize large constant\n%v", p) - } - v := regoff(ctxt, p.From3) - o1 = AOP_IRR(OP_ADDIS, REGTMP, REGZERO, uint32(v)>>16) - o2 = LOP_IRR(OP_ORI, REGTMP, REGTMP, uint32(v)) - o3 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), REGTMP) - if p.From.Sym != nil { - ctxt.Diag("%v is not supported", p) - } - - //if(dlm) reloc(&p->from3, p->pc, 0); - - case 29: /* rldic[lr]? $sh,s,$mask,a -- left, right, plain give different masks */ - v := regoff(ctxt, &p.From) - - d := vregoff(ctxt, p.From3) - var mask [2]uint8 - maskgen64(ctxt, p, mask[:], uint64(d)) - var a int - switch p.As { - case ARLDC, ARLDCCC: - a = int(mask[0]) /* MB */ - if int32(mask[1]) != (63 - v) { - ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) - } - - case ARLDCL, ARLDCLCC: - a = int(mask[0]) /* MB */ - if mask[1] != 63 { - ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) - } - - case ARLDCR, ARLDCRCC: - a = int(mask[1]) /* ME */ - if mask[0] != 0 { - ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) - } - - default: - ctxt.Diag("unexpected op in rldic case\n%v", p) - a = 0 - } - - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.Reg), uint32(p.To.Reg), (uint32(v) & 0x1F)) - o1 |= (uint32(a) & 31) << 6 - if v&0x20 != 0 { - o1 |= 1 << 1 - } - if a&0x20 != 0 { - o1 |= 1 << 5 /* mb[5] is top bit */ - } - - case 30: /* rldimi $sh,s,$mask,a */ - v := regoff(ctxt, &p.From) - - d := vregoff(ctxt, p.From3) - - // Original opcodes had mask operands which had to be converted to a shift count as expected by - // the ppc64 asm. - switch p.As { - case ARLDMI, ARLDMICC: - var mask [2]uint8 - maskgen64(ctxt, p, mask[:], uint64(d)) - if int32(mask[1]) != (63 - v) { - ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) - } - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.Reg), uint32(p.To.Reg), (uint32(v) & 0x1F)) - o1 |= (uint32(mask[0]) & 31) << 6 - if v&0x20 != 0 { - o1 |= 1 << 1 - } - if mask[0]&0x20 != 0 { - o1 |= 1 << 5 /* mb[5] is top bit */ - } - - // Opcodes with shift count operands. - case ARLDIMI, ARLDIMICC: - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.Reg), uint32(p.To.Reg), (uint32(v) & 0x1F)) - o1 |= (uint32(d) & 31) << 6 - if v&0x20 != 0 { - o1 |= 1 << 1 - } - } - - case 31: /* dword */ - d := vregoff(ctxt, &p.From) - - if ctxt.Arch.ByteOrder == binary.BigEndian { - o1 = uint32(d >> 32) - o2 = uint32(d) - } else { - o1 = uint32(d) - o2 = uint32(d >> 32) - } - - if p.From.Sym != nil { - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Add = p.From.Offset - rel.Type = obj.R_ADDR - o2 = 0 - o1 = o2 - } - - case 32: /* fmul frc,fra,frd */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(r), 0) | (uint32(p.From.Reg)&31)<<6 - - case 33: /* fabs [frb,]frd; fmr. frb,frd */ - r := int(p.From.Reg) - - if oclass(&p.From) == C_NONE { - r = int(p.To.Reg) - } - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), 0, uint32(r)) - - case 34: /* FMADDx fra,frb,frc,frd (d=a*b+c); FSELx a<0? (d=b): (d=c) */ - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg)) | (uint32(p.From3.Reg)&31)<<6 - - case 35: /* mov r,lext/lauto/loreg ==> cau $(v>>16),sb,r'; store o(r') */ - v := regoff(ctxt, &p.To) - - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) - o2 = AOP_IRR(opstore(ctxt, p.As), uint32(p.From.Reg), REGTMP, uint32(v)) - - case 36: /* mov bz/h/hz lext/lauto/lreg,r ==> lbz/lha/lhz etc */ - v := regoff(ctxt, &p.From) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) - o2 = AOP_IRR(opload(ctxt, p.As), uint32(p.To.Reg), REGTMP, uint32(v)) - - case 37: /* movb lext/lauto/lreg,r ==> lbz o(reg),r; extsb r */ - v := regoff(ctxt, &p.From) - - r := int(p.From.Reg) - if r == 0 { - r = int(o.param) - } - o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) - o2 = AOP_IRR(opload(ctxt, p.As), uint32(p.To.Reg), REGTMP, uint32(v)) - o3 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.To.Reg), 0) - - case 40: /* word */ - o1 = uint32(regoff(ctxt, &p.From)) - - case 41: /* stswi */ - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Reg), 0) | (uint32(regoff(ctxt, p.From3))&0x7F)<<11 - - case 42: /* lswi */ - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), 0) | (uint32(regoff(ctxt, p.From3))&0x7F)<<11 - - case 43: /* unary indexed source: dcbf (b); dcbf (a+b) */ - o1 = AOP_RRR(oprrr(ctxt, p.As), 0, uint32(p.From.Index), uint32(p.From.Reg)) - - case 44: /* indexed store */ - o1 = AOP_RRR(opstorex(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Index), uint32(p.To.Reg)) - - case 45: /* indexed load */ - o1 = AOP_RRR(oploadx(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Index), uint32(p.From.Reg)) - - case 46: /* plain op */ - o1 = oprrr(ctxt, p.As) - - case 47: /* op Ra, Rd; also op [Ra,] Rd */ - r := int(p.From.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(r), 0) - - case 48: /* op Rs, Ra */ - r := int(p.From.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - o1 = LOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(r), 0) - - case 49: /* op Rb; op $n, Rb */ - if p.From.Type != obj.TYPE_REG { /* tlbie $L, rB */ - v := regoff(ctxt, &p.From) & 1 - o1 = AOP_RRR(oprrr(ctxt, p.As), 0, 0, uint32(p.To.Reg)) | uint32(v)<<21 - } else { - o1 = AOP_RRR(oprrr(ctxt, p.As), 0, 0, uint32(p.From.Reg)) - } - - case 50: /* rem[u] r1[,r2],r3 */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - v := oprrr(ctxt, p.As) - t := v & (1<<10 | 1) /* OE|Rc */ - o1 = AOP_RRR(v&^t, REGTMP, uint32(r), uint32(p.From.Reg)) - o2 = AOP_RRR(OP_MULLW, REGTMP, REGTMP, uint32(p.From.Reg)) - o3 = AOP_RRR(OP_SUBF|t, uint32(p.To.Reg), REGTMP, uint32(r)) - if p.As == AREMU { - o4 = o3 - - /* Clear top 32 bits */ - o3 = OP_RLW(OP_RLDIC, REGTMP, REGTMP, 0, 0, 0) | 1<<5 - } - - case 51: /* remd[u] r1[,r2],r3 */ - r := int(p.Reg) - - if r == 0 { - r = int(p.To.Reg) - } - v := oprrr(ctxt, p.As) - t := v & (1<<10 | 1) /* OE|Rc */ - o1 = AOP_RRR(v&^t, REGTMP, uint32(r), uint32(p.From.Reg)) - o2 = AOP_RRR(OP_MULLD, REGTMP, REGTMP, uint32(p.From.Reg)) - o3 = AOP_RRR(OP_SUBF|t, uint32(p.To.Reg), REGTMP, uint32(r)) - - case 52: /* mtfsbNx cr(n) */ - v := regoff(ctxt, &p.From) & 31 - - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(v), 0, 0) - - case 53: /* mffsX ,fr1 */ - o1 = AOP_RRR(OP_MFFS, uint32(p.To.Reg), 0, 0) - - case 54: /* mov msr,r1; mov r1, msr*/ - if oclass(&p.From) == C_REG { - if p.As == AMOVD { - o1 = AOP_RRR(OP_MTMSRD, uint32(p.From.Reg), 0, 0) - } else { - o1 = AOP_RRR(OP_MTMSR, uint32(p.From.Reg), 0, 0) - } - } else { - o1 = AOP_RRR(OP_MFMSR, uint32(p.To.Reg), 0, 0) - } - - case 55: /* op Rb, Rd */ - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), 0, uint32(p.From.Reg)) - - case 56: /* sra $sh,[s,]a; srd $sh,[s,]a */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(r), uint32(p.To.Reg), uint32(v)&31) - if (p.As == ASRAD || p.As == ASRADCC) && (v&0x20 != 0) { - o1 |= 1 << 1 /* mb[5] */ - } - - case 57: /* slw $sh,[s,]a -> rlwinm ... */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - - /* - * Let user (gs) shoot himself in the foot. - * qc has already complained. - * - if(v < 0 || v > 31) - ctxt->diag("illegal shift %ld\n%v", v, p); - */ - if v < 0 { - v = 0 - } else if v > 32 { - v = 32 - } - var mask [2]uint8 - if p.As == ASRW || p.As == ASRWCC { /* shift right */ - mask[0] = uint8(v) - mask[1] = 31 - v = 32 - v - } else { - mask[0] = 0 - mask[1] = uint8(31 - v) - } - - o1 = OP_RLW(OP_RLWINM, uint32(p.To.Reg), uint32(r), uint32(v), uint32(mask[0]), uint32(mask[1])) - if p.As == ASLWCC || p.As == ASRWCC { - o1 |= 1 /* Rc */ - } - - case 58: /* logical $andcon,[s],a */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o1 = LOP_IRR(opirr(ctxt, p.As), uint32(p.To.Reg), uint32(r), uint32(v)) - - case 59: /* or/and $ucon,,r */ - v := regoff(ctxt, &p.From) - - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - o1 = LOP_IRR(opirr(ctxt, -p.As), uint32(p.To.Reg), uint32(r), uint32(v)>>16) /* oris, xoris, andis */ - - case 60: /* tw to,a,b */ - r := int(regoff(ctxt, &p.From) & 31) - - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(r), uint32(p.Reg), uint32(p.To.Reg)) - - case 61: /* tw to,a,$simm */ - r := int(regoff(ctxt, &p.From) & 31) - - v := regoff(ctxt, &p.To) - o1 = AOP_IRR(opirr(ctxt, p.As), uint32(r), uint32(p.Reg), uint32(v)) - - case 62: /* rlwmi $sh,s,$mask,a */ - v := regoff(ctxt, &p.From) - - var mask [2]uint8 - maskgen(ctxt, p, mask[:], uint32(regoff(ctxt, p.From3))) - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.Reg), uint32(p.To.Reg), uint32(v)) - o1 |= (uint32(mask[0])&31)<<6 | (uint32(mask[1])&31)<<1 - - case 63: /* rlwmi b,s,$mask,a */ - var mask [2]uint8 - maskgen(ctxt, p, mask[:], uint32(regoff(ctxt, p.From3))) - - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.Reg), uint32(p.To.Reg), uint32(p.From.Reg)) - o1 |= (uint32(mask[0])&31)<<6 | (uint32(mask[1])&31)<<1 - - case 64: /* mtfsf fr[, $m] {,fpcsr} */ - var v int32 - if p.From3Type() != obj.TYPE_NONE { - v = regoff(ctxt, p.From3) & 255 - } else { - v = 255 - } - o1 = OP_MTFSF | uint32(v)<<17 | uint32(p.From.Reg)<<11 - - case 65: /* MOVFL $imm,FPSCR(n) => mtfsfi crfd,imm */ - if p.To.Reg == 0 { - ctxt.Diag("must specify FPSCR(n)\n%v", p) - } - o1 = OP_MTFSFI | (uint32(p.To.Reg)&15)<<23 | (uint32(regoff(ctxt, &p.From))&31)<<12 - - case 66: /* mov spr,r1; mov r1,spr, also dcr */ - var r int - var v int32 - if REG_R0 <= p.From.Reg && p.From.Reg <= REG_R31 { - r = int(p.From.Reg) - v = int32(p.To.Reg) - if REG_DCR0 <= v && v <= REG_DCR0+1023 { - o1 = OPVCC(31, 451, 0, 0) /* mtdcr */ - } else { - o1 = OPVCC(31, 467, 0, 0) /* mtspr */ - } - } else { - r = int(p.To.Reg) - v = int32(p.From.Reg) - if REG_DCR0 <= v && v <= REG_DCR0+1023 { - o1 = OPVCC(31, 323, 0, 0) /* mfdcr */ - } else { - o1 = OPVCC(31, 339, 0, 0) /* mfspr */ - } - } - - o1 = AOP_RRR(o1, uint32(r), 0, 0) | (uint32(v)&0x1f)<<16 | ((uint32(v)>>5)&0x1f)<<11 - - case 67: /* mcrf crfD,crfS */ - if p.From.Type != obj.TYPE_REG || p.From.Reg < REG_CR0 || REG_CR7 < p.From.Reg || p.To.Type != obj.TYPE_REG || p.To.Reg < REG_CR0 || REG_CR7 < p.To.Reg { - ctxt.Diag("illegal CR field number\n%v", p) - } - o1 = AOP_RRR(OP_MCRF, ((uint32(p.To.Reg) & 7) << 2), ((uint32(p.From.Reg) & 7) << 2), 0) - - case 68: /* mfcr rD; mfocrf CRM,rD */ - if p.From.Type == obj.TYPE_REG && REG_CR0 <= p.From.Reg && p.From.Reg <= REG_CR7 { - v := int32(1 << uint(7-(p.To.Reg&7))) /* CR(n) */ - o1 = AOP_RRR(OP_MFCR, uint32(p.To.Reg), 0, 0) | 1<<20 | uint32(v)<<12 /* new form, mfocrf */ - } else { - o1 = AOP_RRR(OP_MFCR, uint32(p.To.Reg), 0, 0) /* old form, whole register */ - } - - case 69: /* mtcrf CRM,rS */ - var v int32 - if p.From3Type() != obj.TYPE_NONE { - if p.To.Reg != 0 { - ctxt.Diag("can't use both mask and CR(n)\n%v", p) - } - v = regoff(ctxt, p.From3) & 0xff - } else { - if p.To.Reg == 0 { - v = 0xff /* CR */ - } else { - v = 1 << uint(7-(p.To.Reg&7)) /* CR(n) */ - } - } - - o1 = AOP_RRR(OP_MTCRF, uint32(p.From.Reg), 0, 0) | uint32(v)<<12 - - case 70: /* [f]cmp r,r,cr*/ - var r int - if p.Reg == 0 { - r = 0 - } else { - r = (int(p.Reg) & 7) << 2 - } - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(r), uint32(p.From.Reg), uint32(p.To.Reg)) - - case 71: /* cmp[l] r,i,cr*/ - var r int - if p.Reg == 0 { - r = 0 - } else { - r = (int(p.Reg) & 7) << 2 - } - o1 = AOP_RRR(opirr(ctxt, p.As), uint32(r), uint32(p.From.Reg), 0) | uint32(regoff(ctxt, &p.To))&0xffff - - case 72: /* slbmte (Rb+Rs -> slb[Rb]) -> Rs, Rb */ - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.From.Reg), 0, uint32(p.To.Reg)) - - case 73: /* mcrfs crfD,crfS */ - if p.From.Type != obj.TYPE_REG || p.From.Reg != REG_FPSCR || p.To.Type != obj.TYPE_REG || p.To.Reg < REG_CR0 || REG_CR7 < p.To.Reg { - ctxt.Diag("illegal FPSCR/CR field number\n%v", p) - } - o1 = AOP_RRR(OP_MCRFS, ((uint32(p.To.Reg) & 7) << 2), ((0 & 7) << 2), 0) - - case 77: /* syscall $scon, syscall Rx */ - if p.From.Type == obj.TYPE_CONST { - if p.From.Offset > BIG || p.From.Offset < -BIG { - ctxt.Diag("illegal syscall, sysnum too large: %v", p) - } - o1 = AOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(p.From.Offset)) - } else if p.From.Type == obj.TYPE_REG { - o1 = LOP_RRR(OP_OR, REGZERO, uint32(p.From.Reg), uint32(p.From.Reg)) - } else { - ctxt.Diag("illegal syscall: %v", p) - o1 = 0x7fe00008 // trap always - } - - o2 = oprrr(ctxt, p.As) - o3 = AOP_RRR(oprrr(ctxt, AXOR), REGZERO, REGZERO, REGZERO) // XOR R0, R0 - - case 78: /* undef */ - o1 = 0 /* "An instruction consisting entirely of binary 0s is guaranteed - always to be an illegal instruction." */ - - /* relocation operations */ - case 74: - v := vregoff(ctxt, &p.To) - o1, o2 = symbolAccess(ctxt, p.To.Sym, v, p.From.Reg, opstore(ctxt, p.As)) - - //if(dlm) reloc(&p->to, p->pc, 1); - - case 75: - v := vregoff(ctxt, &p.From) - o1, o2 = symbolAccess(ctxt, p.From.Sym, v, p.To.Reg, opload(ctxt, p.As)) - - //if(dlm) reloc(&p->from, p->pc, 1); - - case 76: - v := vregoff(ctxt, &p.From) - o1, o2 = symbolAccess(ctxt, p.From.Sym, v, p.To.Reg, opload(ctxt, p.As)) - o3 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.To.Reg), 0) - - //if(dlm) reloc(&p->from, p->pc, 1); - - case 79: - if p.From.Offset != 0 { - ctxt.Diag("invalid offset against tls var %v", p) - } - o1 = AOP_IRR(OP_ADDI, uint32(p.To.Reg), REGZERO, 0) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Type = obj.R_POWER_TLS_LE - - case 80: - if p.From.Offset != 0 { - ctxt.Diag("invalid offset against tls var %v", p) - } - o1 = AOP_IRR(OP_ADDIS, uint32(p.To.Reg), REG_R2, 0) - o2 = AOP_IRR(opload(ctxt, AMOVD), uint32(p.To.Reg), uint32(p.To.Reg), 0) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Type = obj.R_POWER_TLS_IE - - case 81: - v := vregoff(ctxt, &p.To) - if v != 0 { - ctxt.Diag("invalid offset against GOT slot %v", p) - } - - o1 = AOP_IRR(OP_ADDIS, uint32(p.To.Reg), REG_R2, 0) - o2 = AOP_IRR(opload(ctxt, AMOVD), uint32(p.To.Reg), uint32(p.To.Reg), 0) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Type = obj.R_ADDRPOWER_GOT - case 82: /* vector instructions, VX-form and VC-form */ - if p.From.Type == obj.TYPE_REG { - /* reg reg none OR reg reg reg */ - /* 3-register operand order: VRA, VRB, VRT */ - /* 2-register operand order: VRA, VRT */ - o1 = AOP_RRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg)) - } else if p.From3Type() == obj.TYPE_CONST { - /* imm imm reg reg */ - /* operand order: SIX, VRA, ST, VRT */ - six := int(regoff(ctxt, &p.From)) - st := int(regoff(ctxt, p.From3)) - o1 = AOP_IIRR(opiirr(ctxt, p.As), uint32(p.To.Reg), uint32(p.Reg), uint32(st), uint32(six)) - } else if p.From3Type() == obj.TYPE_NONE && p.Reg != 0 { - /* imm reg reg */ - /* operand order: UIM, VRB, VRT */ - uim := int(regoff(ctxt, &p.From)) - o1 = AOP_VIRR(opirr(ctxt, p.As), uint32(p.To.Reg), uint32(p.Reg), uint32(uim)) - } else { - /* imm reg */ - /* operand order: SIM, VRT */ - sim := int(regoff(ctxt, &p.From)) - o1 = AOP_IR(opirr(ctxt, p.As), uint32(p.To.Reg), uint32(sim)) - } - - case 83: /* vector instructions, VA-form */ - if p.From.Type == obj.TYPE_REG { - /* reg reg reg reg */ - /* 4-register operand order: VRA, VRB, VRC, VRT */ - o1 = AOP_RRRR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), uint32(p.From3.Reg)) - } else if p.From.Type == obj.TYPE_CONST { - /* imm reg reg reg */ - /* operand order: SHB, VRA, VRB, VRT */ - shb := int(regoff(ctxt, &p.From)) - o1 = AOP_IRRR(opirrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.Reg), uint32(p.From3.Reg), uint32(shb)) - } - - case 84: // ISEL BC,RA,RB,RT -> isel rt,ra,rb,bc - bc := vregoff(ctxt, &p.From) - - // rt = To.Reg, ra = p.Reg, rb = p.From3.Reg - o1 = AOP_ISEL(OP_ISEL, uint32(p.To.Reg), uint32(p.Reg), uint32(p.From3.Reg), uint32(bc)) - - case 85: /* vector instructions, VX-form */ - /* reg none reg */ - /* 2-register operand order: VRB, VRT */ - o1 = AOP_RR(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg)) - - case 86: /* VSX indexed store, XX1-form */ - /* reg reg reg */ - /* 3-register operand order: XT, (RB)(RA*1) */ - o1 = AOP_XX1(opstorex(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Index), uint32(p.To.Reg)) - - case 87: /* VSX indexed load, XX1-form */ - /* reg reg reg */ - /* 3-register operand order: (RB)(RA*1), XT */ - o1 = AOP_XX1(oploadx(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Index), uint32(p.From.Reg)) - - case 88: /* VSX instructions, XX1-form */ - /* reg reg none OR reg reg reg */ - /* 3-register operand order: RA, RB, XT */ - /* 2-register operand order: XS, RA or RA, XT */ - xt := int32(p.To.Reg) - xs := int32(p.From.Reg) - if REG_VS0 <= xt && xt <= REG_VS63 { - o1 = AOP_XX1(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg)) - } else if REG_VS0 <= xs && xs <= REG_VS63 { - o1 = AOP_XX1(oprrr(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Reg), uint32(p.Reg)) - } - - case 89: /* VSX instructions, XX2-form */ - /* reg none reg OR reg imm reg */ - /* 2-register operand order: XB, XT or XB, UIM, XT*/ - uim := int(regoff(ctxt, p.From3)) - o1 = AOP_XX2(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(uim), uint32(p.From.Reg)) - - case 90: /* VSX instructions, XX3-form */ - if p.From3Type() == obj.TYPE_NONE { - /* reg reg reg */ - /* 3-register operand order: XA, XB, XT */ - o1 = AOP_XX3(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg)) - } else if p.From3Type() == obj.TYPE_CONST { - /* reg reg reg imm */ - /* operand order: XA, XB, DM, XT */ - dm := int(regoff(ctxt, p.From3)) - o1 = AOP_XX3I(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), uint32(dm)) - } - - case 91: /* VSX instructions, XX4-form */ - /* reg reg reg reg */ - /* 3-register operand order: XA, XB, XC, XT */ - o1 = AOP_XX4(oprrr(ctxt, p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), uint32(p.From3.Reg)) - - } - - out[0] = o1 - out[1] = o2 - out[2] = o3 - out[3] = o4 - out[4] = o5 - return -} - -func vregoff(ctxt *obj.Link, a *obj.Addr) int64 { - ctxt.Instoffset = 0 - if a != nil { - aclass(ctxt, a) - } - return ctxt.Instoffset -} - -func regoff(ctxt *obj.Link, a *obj.Addr) int32 { - return int32(vregoff(ctxt, a)) -} - -func oprrr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AADD: - return OPVCC(31, 266, 0, 0) - case AADDCC: - return OPVCC(31, 266, 0, 1) - case AADDV: - return OPVCC(31, 266, 1, 0) - case AADDVCC: - return OPVCC(31, 266, 1, 1) - case AADDC: - return OPVCC(31, 10, 0, 0) - case AADDCCC: - return OPVCC(31, 10, 0, 1) - case AADDCV: - return OPVCC(31, 10, 1, 0) - case AADDCVCC: - return OPVCC(31, 10, 1, 1) - case AADDE: - return OPVCC(31, 138, 0, 0) - case AADDECC: - return OPVCC(31, 138, 0, 1) - case AADDEV: - return OPVCC(31, 138, 1, 0) - case AADDEVCC: - return OPVCC(31, 138, 1, 1) - case AADDME: - return OPVCC(31, 234, 0, 0) - case AADDMECC: - return OPVCC(31, 234, 0, 1) - case AADDMEV: - return OPVCC(31, 234, 1, 0) - case AADDMEVCC: - return OPVCC(31, 234, 1, 1) - case AADDZE: - return OPVCC(31, 202, 0, 0) - case AADDZECC: - return OPVCC(31, 202, 0, 1) - case AADDZEV: - return OPVCC(31, 202, 1, 0) - case AADDZEVCC: - return OPVCC(31, 202, 1, 1) - - case AAND: - return OPVCC(31, 28, 0, 0) - case AANDCC: - return OPVCC(31, 28, 0, 1) - case AANDN: - return OPVCC(31, 60, 0, 0) - case AANDNCC: - return OPVCC(31, 60, 0, 1) - - case ACMP: - return OPVCC(31, 0, 0, 0) | 1<<21 /* L=1 */ - case ACMPU: - return OPVCC(31, 32, 0, 0) | 1<<21 - case ACMPW: - return OPVCC(31, 0, 0, 0) /* L=0 */ - case ACMPWU: - return OPVCC(31, 32, 0, 0) - - case ACNTLZW: - return OPVCC(31, 26, 0, 0) - case ACNTLZWCC: - return OPVCC(31, 26, 0, 1) - case ACNTLZD: - return OPVCC(31, 58, 0, 0) - case ACNTLZDCC: - return OPVCC(31, 58, 0, 1) - - case ACRAND: - return OPVCC(19, 257, 0, 0) - case ACRANDN: - return OPVCC(19, 129, 0, 0) - case ACREQV: - return OPVCC(19, 289, 0, 0) - case ACRNAND: - return OPVCC(19, 225, 0, 0) - case ACRNOR: - return OPVCC(19, 33, 0, 0) - case ACROR: - return OPVCC(19, 449, 0, 0) - case ACRORN: - return OPVCC(19, 417, 0, 0) - case ACRXOR: - return OPVCC(19, 193, 0, 0) - - case ADCBF: - return OPVCC(31, 86, 0, 0) - case ADCBI: - return OPVCC(31, 470, 0, 0) - case ADCBST: - return OPVCC(31, 54, 0, 0) - case ADCBT: - return OPVCC(31, 278, 0, 0) - case ADCBTST: - return OPVCC(31, 246, 0, 0) - case ADCBZ: - return OPVCC(31, 1014, 0, 0) - - case AREM, ADIVW: - return OPVCC(31, 491, 0, 0) - - case AREMCC, ADIVWCC: - return OPVCC(31, 491, 0, 1) - - case AREMV, ADIVWV: - return OPVCC(31, 491, 1, 0) - - case AREMVCC, ADIVWVCC: - return OPVCC(31, 491, 1, 1) - - case AREMU, ADIVWU: - return OPVCC(31, 459, 0, 0) - - case AREMUCC, ADIVWUCC: - return OPVCC(31, 459, 0, 1) - - case AREMUV, ADIVWUV: - return OPVCC(31, 459, 1, 0) - - case AREMUVCC, ADIVWUVCC: - return OPVCC(31, 459, 1, 1) - - case AREMD, ADIVD: - return OPVCC(31, 489, 0, 0) - - case AREMDCC, ADIVDCC: - return OPVCC(31, 489, 0, 1) - - case ADIVDE: - return OPVCC(31, 425, 0, 0) - - case ADIVDECC: - return OPVCC(31, 425, 0, 1) - - case ADIVDEU: - return OPVCC(31, 393, 0, 0) - - case ADIVDEUCC: - return OPVCC(31, 393, 0, 1) - - case AREMDV, ADIVDV: - return OPVCC(31, 489, 1, 0) - - case AREMDVCC, ADIVDVCC: - return OPVCC(31, 489, 1, 1) - - case AREMDU, ADIVDU: - return OPVCC(31, 457, 0, 0) - - case AREMDUCC, ADIVDUCC: - return OPVCC(31, 457, 0, 1) - - case AREMDUV, ADIVDUV: - return OPVCC(31, 457, 1, 0) - - case AREMDUVCC, ADIVDUVCC: - return OPVCC(31, 457, 1, 1) - - case AEIEIO: - return OPVCC(31, 854, 0, 0) - - case AEQV: - return OPVCC(31, 284, 0, 0) - case AEQVCC: - return OPVCC(31, 284, 0, 1) - - case AEXTSB: - return OPVCC(31, 954, 0, 0) - case AEXTSBCC: - return OPVCC(31, 954, 0, 1) - case AEXTSH: - return OPVCC(31, 922, 0, 0) - case AEXTSHCC: - return OPVCC(31, 922, 0, 1) - case AEXTSW: - return OPVCC(31, 986, 0, 0) - case AEXTSWCC: - return OPVCC(31, 986, 0, 1) - - case AFABS: - return OPVCC(63, 264, 0, 0) - case AFABSCC: - return OPVCC(63, 264, 0, 1) - case AFADD: - return OPVCC(63, 21, 0, 0) - case AFADDCC: - return OPVCC(63, 21, 0, 1) - case AFADDS: - return OPVCC(59, 21, 0, 0) - case AFADDSCC: - return OPVCC(59, 21, 0, 1) - case AFCMPO: - return OPVCC(63, 32, 0, 0) - case AFCMPU: - return OPVCC(63, 0, 0, 0) - case AFCFID: - return OPVCC(63, 846, 0, 0) - case AFCFIDCC: - return OPVCC(63, 846, 0, 1) - case AFCFIDU: - return OPVCC(63, 974, 0, 0) - case AFCFIDUCC: - return OPVCC(63, 974, 0, 1) - case AFCTIW: - return OPVCC(63, 14, 0, 0) - case AFCTIWCC: - return OPVCC(63, 14, 0, 1) - case AFCTIWZ: - return OPVCC(63, 15, 0, 0) - case AFCTIWZCC: - return OPVCC(63, 15, 0, 1) - case AFCTID: - return OPVCC(63, 814, 0, 0) - case AFCTIDCC: - return OPVCC(63, 814, 0, 1) - case AFCTIDZ: - return OPVCC(63, 815, 0, 0) - case AFCTIDZCC: - return OPVCC(63, 815, 0, 1) - case AFDIV: - return OPVCC(63, 18, 0, 0) - case AFDIVCC: - return OPVCC(63, 18, 0, 1) - case AFDIVS: - return OPVCC(59, 18, 0, 0) - case AFDIVSCC: - return OPVCC(59, 18, 0, 1) - case AFMADD: - return OPVCC(63, 29, 0, 0) - case AFMADDCC: - return OPVCC(63, 29, 0, 1) - case AFMADDS: - return OPVCC(59, 29, 0, 0) - case AFMADDSCC: - return OPVCC(59, 29, 0, 1) - - case AFMOVS, AFMOVD: - return OPVCC(63, 72, 0, 0) /* load */ - case AFMOVDCC: - return OPVCC(63, 72, 0, 1) - case AFMSUB: - return OPVCC(63, 28, 0, 0) - case AFMSUBCC: - return OPVCC(63, 28, 0, 1) - case AFMSUBS: - return OPVCC(59, 28, 0, 0) - case AFMSUBSCC: - return OPVCC(59, 28, 0, 1) - case AFMUL: - return OPVCC(63, 25, 0, 0) - case AFMULCC: - return OPVCC(63, 25, 0, 1) - case AFMULS: - return OPVCC(59, 25, 0, 0) - case AFMULSCC: - return OPVCC(59, 25, 0, 1) - case AFNABS: - return OPVCC(63, 136, 0, 0) - case AFNABSCC: - return OPVCC(63, 136, 0, 1) - case AFNEG: - return OPVCC(63, 40, 0, 0) - case AFNEGCC: - return OPVCC(63, 40, 0, 1) - case AFNMADD: - return OPVCC(63, 31, 0, 0) - case AFNMADDCC: - return OPVCC(63, 31, 0, 1) - case AFNMADDS: - return OPVCC(59, 31, 0, 0) - case AFNMADDSCC: - return OPVCC(59, 31, 0, 1) - case AFNMSUB: - return OPVCC(63, 30, 0, 0) - case AFNMSUBCC: - return OPVCC(63, 30, 0, 1) - case AFNMSUBS: - return OPVCC(59, 30, 0, 0) - case AFNMSUBSCC: - return OPVCC(59, 30, 0, 1) - case AFRES: - return OPVCC(59, 24, 0, 0) - case AFRESCC: - return OPVCC(59, 24, 0, 1) - case AFRIM: - return OPVCC(63, 488, 0, 0) - case AFRIMCC: - return OPVCC(63, 488, 0, 1) - case AFRIP: - return OPVCC(63, 456, 0, 0) - case AFRIPCC: - return OPVCC(63, 456, 0, 1) - case AFRIZ: - return OPVCC(63, 424, 0, 0) - case AFRIZCC: - return OPVCC(63, 424, 0, 1) - case AFRSP: - return OPVCC(63, 12, 0, 0) - case AFRSPCC: - return OPVCC(63, 12, 0, 1) - case AFRSQRTE: - return OPVCC(63, 26, 0, 0) - case AFRSQRTECC: - return OPVCC(63, 26, 0, 1) - case AFSEL: - return OPVCC(63, 23, 0, 0) - case AFSELCC: - return OPVCC(63, 23, 0, 1) - case AFSQRT: - return OPVCC(63, 22, 0, 0) - case AFSQRTCC: - return OPVCC(63, 22, 0, 1) - case AFSQRTS: - return OPVCC(59, 22, 0, 0) - case AFSQRTSCC: - return OPVCC(59, 22, 0, 1) - case AFSUB: - return OPVCC(63, 20, 0, 0) - case AFSUBCC: - return OPVCC(63, 20, 0, 1) - case AFSUBS: - return OPVCC(59, 20, 0, 0) - case AFSUBSCC: - return OPVCC(59, 20, 0, 1) - - case AICBI: - return OPVCC(31, 982, 0, 0) - case AISYNC: - return OPVCC(19, 150, 0, 0) - - case AMTFSB0: - return OPVCC(63, 70, 0, 0) - case AMTFSB0CC: - return OPVCC(63, 70, 0, 1) - case AMTFSB1: - return OPVCC(63, 38, 0, 0) - case AMTFSB1CC: - return OPVCC(63, 38, 0, 1) - - case AMULHW: - return OPVCC(31, 75, 0, 0) - case AMULHWCC: - return OPVCC(31, 75, 0, 1) - case AMULHWU: - return OPVCC(31, 11, 0, 0) - case AMULHWUCC: - return OPVCC(31, 11, 0, 1) - case AMULLW: - return OPVCC(31, 235, 0, 0) - case AMULLWCC: - return OPVCC(31, 235, 0, 1) - case AMULLWV: - return OPVCC(31, 235, 1, 0) - case AMULLWVCC: - return OPVCC(31, 235, 1, 1) - - case AMULHD: - return OPVCC(31, 73, 0, 0) - case AMULHDCC: - return OPVCC(31, 73, 0, 1) - case AMULHDU: - return OPVCC(31, 9, 0, 0) - case AMULHDUCC: - return OPVCC(31, 9, 0, 1) - case AMULLD: - return OPVCC(31, 233, 0, 0) - case AMULLDCC: - return OPVCC(31, 233, 0, 1) - case AMULLDV: - return OPVCC(31, 233, 1, 0) - case AMULLDVCC: - return OPVCC(31, 233, 1, 1) - - case ANAND: - return OPVCC(31, 476, 0, 0) - case ANANDCC: - return OPVCC(31, 476, 0, 1) - case ANEG: - return OPVCC(31, 104, 0, 0) - case ANEGCC: - return OPVCC(31, 104, 0, 1) - case ANEGV: - return OPVCC(31, 104, 1, 0) - case ANEGVCC: - return OPVCC(31, 104, 1, 1) - case ANOR: - return OPVCC(31, 124, 0, 0) - case ANORCC: - return OPVCC(31, 124, 0, 1) - case AOR: - return OPVCC(31, 444, 0, 0) - case AORCC: - return OPVCC(31, 444, 0, 1) - case AORN: - return OPVCC(31, 412, 0, 0) - case AORNCC: - return OPVCC(31, 412, 0, 1) - - case ARFI: - return OPVCC(19, 50, 0, 0) - case ARFCI: - return OPVCC(19, 51, 0, 0) - case ARFID: - return OPVCC(19, 18, 0, 0) - case AHRFID: - return OPVCC(19, 274, 0, 0) - - case ARLWMI: - return OPVCC(20, 0, 0, 0) - case ARLWMICC: - return OPVCC(20, 0, 0, 1) - case ARLWNM: - return OPVCC(23, 0, 0, 0) - case ARLWNMCC: - return OPVCC(23, 0, 0, 1) - - case ARLDCL: - return OPVCC(30, 8, 0, 0) - case ARLDCR: - return OPVCC(30, 9, 0, 0) - - case ARLDICL: - return OPVCC(30, 0, 0, 0) - case ARLDICLCC: - return OPVCC(30, 0, 0, 1) - case ARLDICR: - return OPVCC(30, 0, 0, 0) | 2<<1 // rldicr - case ARLDICRCC: - return OPVCC(30, 0, 0, 1) | 2<<1 // rldicr. - - case ASYSCALL: - return OPVCC(17, 1, 0, 0) - - case ASLW: - return OPVCC(31, 24, 0, 0) - case ASLWCC: - return OPVCC(31, 24, 0, 1) - case ASLD: - return OPVCC(31, 27, 0, 0) - case ASLDCC: - return OPVCC(31, 27, 0, 1) - - case ASRAW: - return OPVCC(31, 792, 0, 0) - case ASRAWCC: - return OPVCC(31, 792, 0, 1) - case ASRAD: - return OPVCC(31, 794, 0, 0) - case ASRADCC: - return OPVCC(31, 794, 0, 1) - - case ASRW: - return OPVCC(31, 536, 0, 0) - case ASRWCC: - return OPVCC(31, 536, 0, 1) - case ASRD: - return OPVCC(31, 539, 0, 0) - case ASRDCC: - return OPVCC(31, 539, 0, 1) - - case ASUB: - return OPVCC(31, 40, 0, 0) - case ASUBCC: - return OPVCC(31, 40, 0, 1) - case ASUBV: - return OPVCC(31, 40, 1, 0) - case ASUBVCC: - return OPVCC(31, 40, 1, 1) - case ASUBC: - return OPVCC(31, 8, 0, 0) - case ASUBCCC: - return OPVCC(31, 8, 0, 1) - case ASUBCV: - return OPVCC(31, 8, 1, 0) - case ASUBCVCC: - return OPVCC(31, 8, 1, 1) - case ASUBE: - return OPVCC(31, 136, 0, 0) - case ASUBECC: - return OPVCC(31, 136, 0, 1) - case ASUBEV: - return OPVCC(31, 136, 1, 0) - case ASUBEVCC: - return OPVCC(31, 136, 1, 1) - case ASUBME: - return OPVCC(31, 232, 0, 0) - case ASUBMECC: - return OPVCC(31, 232, 0, 1) - case ASUBMEV: - return OPVCC(31, 232, 1, 0) - case ASUBMEVCC: - return OPVCC(31, 232, 1, 1) - case ASUBZE: - return OPVCC(31, 200, 0, 0) - case ASUBZECC: - return OPVCC(31, 200, 0, 1) - case ASUBZEV: - return OPVCC(31, 200, 1, 0) - case ASUBZEVCC: - return OPVCC(31, 200, 1, 1) - - case ASYNC: - return OPVCC(31, 598, 0, 0) - case ALWSYNC: - return OPVCC(31, 598, 0, 0) | 1<<21 - - case APTESYNC: - return OPVCC(31, 598, 0, 0) | 2<<21 - - case ATLBIE: - return OPVCC(31, 306, 0, 0) - case ATLBIEL: - return OPVCC(31, 274, 0, 0) - case ATLBSYNC: - return OPVCC(31, 566, 0, 0) - case ASLBIA: - return OPVCC(31, 498, 0, 0) - case ASLBIE: - return OPVCC(31, 434, 0, 0) - case ASLBMFEE: - return OPVCC(31, 915, 0, 0) - case ASLBMFEV: - return OPVCC(31, 851, 0, 0) - case ASLBMTE: - return OPVCC(31, 402, 0, 0) - - case ATW: - return OPVCC(31, 4, 0, 0) - case ATD: - return OPVCC(31, 68, 0, 0) - - /* Vector (VMX/Altivec) instructions */ - /* ISA 2.03 enables these for PPC970. For POWERx processors, these */ - /* are enabled starting at POWER6 (ISA 2.05). */ - case AVANDL: - return OPVX(4, 1028, 0, 0) /* vand - v2.03 */ - case AVANDC: - return OPVX(4, 1092, 0, 0) /* vandc - v2.03 */ - case AVNAND: - return OPVX(4, 1412, 0, 0) /* vnand - v2.07 */ - - case AVORL: - return OPVX(4, 1156, 0, 0) /* vor - v2.03 */ - case AVORC: - return OPVX(4, 1348, 0, 0) /* vorc - v2.07 */ - case AVNOR: - return OPVX(4, 1284, 0, 0) /* vnor - v2.03 */ - case AVXOR: - return OPVX(4, 1220, 0, 0) /* vxor - v2.03 */ - case AVEQV: - return OPVX(4, 1668, 0, 0) /* veqv - v2.07 */ - - case AVADDUBM: - return OPVX(4, 0, 0, 0) /* vaddubm - v2.03 */ - case AVADDUHM: - return OPVX(4, 64, 0, 0) /* vadduhm - v2.03 */ - case AVADDUWM: - return OPVX(4, 128, 0, 0) /* vadduwm - v2.03 */ - case AVADDUDM: - return OPVX(4, 192, 0, 0) /* vaddudm - v2.07 */ - case AVADDUQM: - return OPVX(4, 256, 0, 0) /* vadduqm - v2.07 */ - - case AVADDCUQ: - return OPVX(4, 320, 0, 0) /* vaddcuq - v2.07 */ - case AVADDCUW: - return OPVX(4, 384, 0, 0) /* vaddcuw - v2.03 */ - - case AVADDUBS: - return OPVX(4, 512, 0, 0) /* vaddubs - v2.03 */ - case AVADDUHS: - return OPVX(4, 576, 0, 0) /* vadduhs - v2.03 */ - case AVADDUWS: - return OPVX(4, 640, 0, 0) /* vadduws - v2.03 */ - - case AVADDSBS: - return OPVX(4, 768, 0, 0) /* vaddsbs - v2.03 */ - case AVADDSHS: - return OPVX(4, 832, 0, 0) /* vaddshs - v2.03 */ - case AVADDSWS: - return OPVX(4, 896, 0, 0) /* vaddsws - v2.03 */ - - case AVADDEUQM: - return OPVX(4, 60, 0, 0) /* vaddeuqm - v2.07 */ - case AVADDECUQ: - return OPVX(4, 61, 0, 0) /* vaddecuq - v2.07 */ - - case AVSUBUBM: - return OPVX(4, 1024, 0, 0) /* vsububm - v2.03 */ - case AVSUBUHM: - return OPVX(4, 1088, 0, 0) /* vsubuhm - v2.03 */ - case AVSUBUWM: - return OPVX(4, 1152, 0, 0) /* vsubuwm - v2.03 */ - case AVSUBUDM: - return OPVX(4, 1216, 0, 0) /* vsubudm - v2.07 */ - case AVSUBUQM: - return OPVX(4, 1280, 0, 0) /* vsubuqm - v2.07 */ - - case AVSUBCUQ: - return OPVX(4, 1344, 0, 0) /* vsubcuq - v2.07 */ - case AVSUBCUW: - return OPVX(4, 1408, 0, 0) /* vsubcuw - v2.03 */ - - case AVSUBUBS: - return OPVX(4, 1536, 0, 0) /* vsububs - v2.03 */ - case AVSUBUHS: - return OPVX(4, 1600, 0, 0) /* vsubuhs - v2.03 */ - case AVSUBUWS: - return OPVX(4, 1664, 0, 0) /* vsubuws - v2.03 */ - - case AVSUBSBS: - return OPVX(4, 1792, 0, 0) /* vsubsbs - v2.03 */ - case AVSUBSHS: - return OPVX(4, 1856, 0, 0) /* vsubshs - v2.03 */ - case AVSUBSWS: - return OPVX(4, 1920, 0, 0) /* vsubsws - v2.03 */ - - case AVSUBEUQM: - return OPVX(4, 62, 0, 0) /* vsubeuqm - v2.07 */ - case AVSUBECUQ: - return OPVX(4, 63, 0, 0) /* vsubecuq - v2.07 */ - - case AVRLB: - return OPVX(4, 4, 0, 0) /* vrlb - v2.03 */ - case AVRLH: - return OPVX(4, 68, 0, 0) /* vrlh - v2.03 */ - case AVRLW: - return OPVX(4, 132, 0, 0) /* vrlw - v2.03 */ - case AVRLD: - return OPVX(4, 196, 0, 0) /* vrld - v2.07 */ - - case AVSLB: - return OPVX(4, 260, 0, 0) /* vslh - v2.03 */ - case AVSLH: - return OPVX(4, 324, 0, 0) /* vslh - v2.03 */ - case AVSLW: - return OPVX(4, 388, 0, 0) /* vslw - v2.03 */ - case AVSL: - return OPVX(4, 452, 0, 0) /* vsl - v2.03 */ - case AVSLO: - return OPVX(4, 1036, 0, 0) /* vsl - v2.03 */ - case AVSRB: - return OPVX(4, 516, 0, 0) /* vsrb - v2.03 */ - case AVSRH: - return OPVX(4, 580, 0, 0) /* vsrh - v2.03 */ - case AVSRW: - return OPVX(4, 644, 0, 0) /* vsrw - v2.03 */ - case AVSR: - return OPVX(4, 708, 0, 0) /* vsr - v2.03 */ - case AVSRO: - return OPVX(4, 1100, 0, 0) /* vsro - v2.03 */ - case AVSLD: - return OPVX(4, 1476, 0, 0) /* vsld - v2.07 */ - case AVSRD: - return OPVX(4, 1732, 0, 0) /* vsrd - v2.07 */ - - case AVSRAB: - return OPVX(4, 772, 0, 0) /* vsrab - v2.03 */ - case AVSRAH: - return OPVX(4, 836, 0, 0) /* vsrah - v2.03 */ - case AVSRAW: - return OPVX(4, 900, 0, 0) /* vsraw - v2.03 */ - case AVSRAD: - return OPVX(4, 964, 0, 0) /* vsrad - v2.07 */ - - case AVCLZB: - return OPVX(4, 1794, 0, 0) /* vclzb - v2.07 */ - case AVCLZH: - return OPVX(4, 1858, 0, 0) /* vclzh - v2.07 */ - case AVCLZW: - return OPVX(4, 1922, 0, 0) /* vclzw - v2.07 */ - case AVCLZD: - return OPVX(4, 1986, 0, 0) /* vclzd - v2.07 */ - - case AVPOPCNTB: - return OPVX(4, 1795, 0, 0) /* vpopcntb - v2.07 */ - case AVPOPCNTH: - return OPVX(4, 1859, 0, 0) /* vpopcnth - v2.07 */ - case AVPOPCNTW: - return OPVX(4, 1923, 0, 0) /* vpopcntw - v2.07 */ - case AVPOPCNTD: - return OPVX(4, 1987, 0, 0) /* vpopcntd - v2.07 */ - - case AVCMPEQUB: - return OPVC(4, 6, 0, 0) /* vcmpequb - v2.03 */ - case AVCMPEQUBCC: - return OPVC(4, 6, 0, 1) /* vcmpequb. - v2.03 */ - case AVCMPEQUH: - return OPVC(4, 70, 0, 0) /* vcmpequh - v2.03 */ - case AVCMPEQUHCC: - return OPVC(4, 70, 0, 1) /* vcmpequh. - v2.03 */ - case AVCMPEQUW: - return OPVC(4, 134, 0, 0) /* vcmpequw - v2.03 */ - case AVCMPEQUWCC: - return OPVC(4, 134, 0, 1) /* vcmpequw. - v2.03 */ - case AVCMPEQUD: - return OPVC(4, 199, 0, 0) /* vcmpequd - v2.07 */ - case AVCMPEQUDCC: - return OPVC(4, 199, 0, 1) /* vcmpequd. - v2.07 */ - - case AVCMPGTUB: - return OPVC(4, 518, 0, 0) /* vcmpgtub - v2.03 */ - case AVCMPGTUBCC: - return OPVC(4, 518, 0, 1) /* vcmpgtub. - v2.03 */ - case AVCMPGTUH: - return OPVC(4, 582, 0, 0) /* vcmpgtuh - v2.03 */ - case AVCMPGTUHCC: - return OPVC(4, 582, 0, 1) /* vcmpgtuh. - v2.03 */ - case AVCMPGTUW: - return OPVC(4, 646, 0, 0) /* vcmpgtuw - v2.03 */ - case AVCMPGTUWCC: - return OPVC(4, 646, 0, 1) /* vcmpgtuw. - v2.03 */ - case AVCMPGTUD: - return OPVC(4, 711, 0, 0) /* vcmpgtud - v2.07 */ - case AVCMPGTUDCC: - return OPVC(4, 711, 0, 1) /* vcmpgtud. v2.07 */ - case AVCMPGTSB: - return OPVC(4, 774, 0, 0) /* vcmpgtsb - v2.03 */ - case AVCMPGTSBCC: - return OPVC(4, 774, 0, 1) /* vcmpgtsb. - v2.03 */ - case AVCMPGTSH: - return OPVC(4, 838, 0, 0) /* vcmpgtsh - v2.03 */ - case AVCMPGTSHCC: - return OPVC(4, 838, 0, 1) /* vcmpgtsh. - v2.03 */ - case AVCMPGTSW: - return OPVC(4, 902, 0, 0) /* vcmpgtsw - v2.03 */ - case AVCMPGTSWCC: - return OPVC(4, 902, 0, 1) /* vcmpgtsw. - v2.03 */ - case AVCMPGTSD: - return OPVC(4, 967, 0, 0) /* vcmpgtsd - v2.07 */ - case AVCMPGTSDCC: - return OPVC(4, 967, 0, 1) /* vcmpgtsd. - v2.07 */ - - case AVPERM: - return OPVX(4, 43, 0, 0) /* vperm - v2.03 */ - - case AVSEL: - return OPVX(4, 42, 0, 0) /* vsel - v2.03 */ - - case AVCIPHER: - return OPVX(4, 1288, 0, 0) /* vcipher - v2.07 */ - case AVCIPHERLAST: - return OPVX(4, 1289, 0, 0) /* vcipherlast - v2.07 */ - case AVNCIPHER: - return OPVX(4, 1352, 0, 0) /* vncipher - v2.07 */ - case AVNCIPHERLAST: - return OPVX(4, 1353, 0, 0) /* vncipherlast - v2.07 */ - case AVSBOX: - return OPVX(4, 1480, 0, 0) /* vsbox - v2.07 */ - /* End of vector instructions */ - - /* Vector scalar (VSX) instructions */ - /* ISA 2.06 enables these for POWER7. */ - case AMFVSRD: - return OPVXX1(31, 51, 0) /* mfvsrd - v2.07 */ - case AMFVSRWZ: - return OPVXX1(31, 115, 0) /* mfvsrwz - v2.07 */ - - case AMTVSRD: - return OPVXX1(31, 179, 0) /* mtvsrd - v2.07 */ - case AMTVSRWA: - return OPVXX1(31, 211, 0) /* mtvsrwa - v2.07 */ - case AMTVSRWZ: - return OPVXX1(31, 243, 0) /* mtvsrwz - v2.07 */ - - case AXXLANDQ: - return OPVXX3(60, 130, 0) /* xxland - v2.06 */ - case AXXLANDC: - return OPVXX3(60, 138, 0) /* xxlandc - v2.06 */ - case AXXLEQV: - return OPVXX3(60, 186, 0) /* xxleqv - v2.07 */ - case AXXLNAND: - return OPVXX3(60, 178, 0) /* xxlnand - v2.07 */ - - case AXXLORC: - return OPVXX3(60, 170, 0) /* xxlorc - v2.07 */ - case AXXLNOR: - return OPVXX3(60, 162, 0) /* xxlnor - v2.06 */ - case AXXLORQ: - return OPVXX3(60, 146, 0) /* xxlor - v2.06 */ - case AXXLXOR: - return OPVXX3(60, 154, 0) /* xxlxor - v2.06 */ - - case AXXSEL: - return OPVXX4(60, 3, 0) /* xxsel - v2.06 */ - - case AXXMRGHW: - return OPVXX3(60, 18, 0) /* xxmrghw - v2.06 */ - case AXXMRGLW: - return OPVXX3(60, 50, 0) /* xxmrglw - v2.06 */ - - case AXXSPLTW: - return OPVXX2(60, 164, 0) /* xxspltw - v2.06 */ - - case AXXPERMDI: - return OPVXX3(60, 10, 0) /* xxpermdi - v2.06 */ - - case AXXSLDWI: - return OPVXX3(60, 2, 0) /* xxsldwi - v2.06 */ - - case AXSCVDPSP: - return OPVXX2(60, 265, 0) /* xscvdpsp - v2.06 */ - case AXSCVSPDP: - return OPVXX2(60, 329, 0) /* xscvspdp - v2.06 */ - case AXSCVDPSPN: - return OPVXX2(60, 267, 0) /* xscvdpspn - v2.07 */ - case AXSCVSPDPN: - return OPVXX2(60, 331, 0) /* xscvspdpn - v2.07 */ - - case AXVCVDPSP: - return OPVXX2(60, 393, 0) /* xvcvdpsp - v2.06 */ - case AXVCVSPDP: - return OPVXX2(60, 457, 0) /* xvcvspdp - v2.06 */ - - case AXSCVDPSXDS: - return OPVXX2(60, 344, 0) /* xscvdpsxds - v2.06 */ - case AXSCVDPSXWS: - return OPVXX2(60, 88, 0) /* xscvdpsxws - v2.06 */ - case AXSCVDPUXDS: - return OPVXX2(60, 328, 0) /* xscvdpuxds - v2.06 */ - case AXSCVDPUXWS: - return OPVXX2(60, 72, 0) /* xscvdpuxws - v2.06 */ - - case AXSCVSXDDP: - return OPVXX2(60, 376, 0) /* xscvsxddp - v2.06 */ - case AXSCVUXDDP: - return OPVXX2(60, 360, 0) /* xscvuxddp - v2.06 */ - case AXSCVSXDSP: - return OPVXX2(60, 312, 0) /* xscvsxdsp - v2.06 */ - case AXSCVUXDSP: - return OPVXX2(60, 296, 0) /* xscvuxdsp - v2.06 */ - - case AXVCVDPSXDS: - return OPVXX2(60, 472, 0) /* xvcvdpsxds - v2.06 */ - case AXVCVDPSXWS: - return OPVXX2(60, 216, 0) /* xvcvdpsxws - v2.06 */ - case AXVCVDPUXDS: - return OPVXX2(60, 456, 0) /* xvcvdpuxds - v2.06 */ - case AXVCVDPUXWS: - return OPVXX2(60, 200, 0) /* xvcvdpuxws - v2.06 */ - case AXVCVSPSXDS: - return OPVXX2(60, 408, 0) /* xvcvspsxds - v2.07 */ - case AXVCVSPSXWS: - return OPVXX2(60, 152, 0) /* xvcvspsxws - v2.07 */ - case AXVCVSPUXDS: - return OPVXX2(60, 392, 0) /* xvcvspuxds - v2.07 */ - case AXVCVSPUXWS: - return OPVXX2(60, 136, 0) /* xvcvspuxws - v2.07 */ - - case AXVCVSXDDP: - return OPVXX2(60, 504, 0) /* xvcvsxddp - v2.06 */ - case AXVCVSXWDP: - return OPVXX2(60, 248, 0) /* xvcvsxwdp - v2.06 */ - case AXVCVUXDDP: - return OPVXX2(60, 488, 0) /* xvcvuxddp - v2.06 */ - case AXVCVUXWDP: - return OPVXX2(60, 232, 0) /* xvcvuxwdp - v2.06 */ - case AXVCVSXDSP: - return OPVXX2(60, 440, 0) /* xvcvsxdsp - v2.06 */ - case AXVCVSXWSP: - return OPVXX2(60, 184, 0) /* xvcvsxwsp - v2.06 */ - case AXVCVUXDSP: - return OPVXX2(60, 424, 0) /* xvcvuxdsp - v2.06 */ - case AXVCVUXWSP: - return OPVXX2(60, 168, 0) /* xvcvuxwsp - v2.06 */ - /* End of VSX instructions */ - - case AXOR: - return OPVCC(31, 316, 0, 0) - case AXORCC: - return OPVCC(31, 316, 0, 1) - } - - ctxt.Diag("bad r/r, r/r/r or r/r/r/r opcode %v", a) - return 0 -} - -func opirrr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - /* Vector (VMX/Altivec) instructions */ - /* ISA 2.03 enables these for PPC970. For POWERx processors, these */ - /* are enabled starting at POWER6 (ISA 2.05). */ - case AVSLDOI: - return OPVX(4, 44, 0, 0) /* vsldoi - v2.03 */ - } - - ctxt.Diag("bad i/r/r/r opcode %v", a) - return 0 -} - -func opiirr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - /* Vector (VMX/Altivec) instructions */ - /* ISA 2.07 enables these for POWER8 and beyond. */ - case AVSHASIGMAW: - return OPVX(4, 1666, 0, 0) /* vshasigmaw - v2.07 */ - case AVSHASIGMAD: - return OPVX(4, 1730, 0, 0) /* vshasigmad - v2.07 */ - } - - ctxt.Diag("bad i/i/r/r opcode %v", a) - return 0 -} - -func opirr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AADD: - return OPVCC(14, 0, 0, 0) - case AADDC: - return OPVCC(12, 0, 0, 0) - case AADDCCC: - return OPVCC(13, 0, 0, 0) - case -AADD: - return OPVCC(15, 0, 0, 0) /* ADDIS/CAU */ - - case AANDCC: - return OPVCC(28, 0, 0, 0) - case -AANDCC: - return OPVCC(29, 0, 0, 0) /* ANDIS./ANDIU. */ - - case ABR: - return OPVCC(18, 0, 0, 0) - case ABL: - return OPVCC(18, 0, 0, 0) | 1 - case obj.ADUFFZERO: - return OPVCC(18, 0, 0, 0) | 1 - case obj.ADUFFCOPY: - return OPVCC(18, 0, 0, 0) | 1 - case ABC: - return OPVCC(16, 0, 0, 0) - case ABCL: - return OPVCC(16, 0, 0, 0) | 1 - - case ABEQ: - return AOP_RRR(16<<26, 12, 2, 0) - case ABGE: - return AOP_RRR(16<<26, 4, 0, 0) - case ABGT: - return AOP_RRR(16<<26, 12, 1, 0) - case ABLE: - return AOP_RRR(16<<26, 4, 1, 0) - case ABLT: - return AOP_RRR(16<<26, 12, 0, 0) - case ABNE: - return AOP_RRR(16<<26, 4, 2, 0) - case ABVC: - return AOP_RRR(16<<26, 4, 3, 0) // apparently unordered-clear - case ABVS: - return AOP_RRR(16<<26, 12, 3, 0) // apparently unordered-set - - case ACMP: - return OPVCC(11, 0, 0, 0) | 1<<21 /* L=1 */ - case ACMPU: - return OPVCC(10, 0, 0, 0) | 1<<21 - case ACMPW: - return OPVCC(11, 0, 0, 0) /* L=0 */ - case ACMPWU: - return OPVCC(10, 0, 0, 0) - case ALSW: - return OPVCC(31, 597, 0, 0) - - case AMULLW: - return OPVCC(7, 0, 0, 0) - - case AOR: - return OPVCC(24, 0, 0, 0) - case -AOR: - return OPVCC(25, 0, 0, 0) /* ORIS/ORIU */ - - case ARLWMI: - return OPVCC(20, 0, 0, 0) /* rlwimi */ - case ARLWMICC: - return OPVCC(20, 0, 0, 1) - case ARLDMI: - return OPVCC(30, 0, 0, 0) | 3<<2 /* rldimi */ - case ARLDMICC: - return OPVCC(30, 0, 0, 1) | 3<<2 - case ARLDIMI: - return OPVCC(30, 0, 0, 0) | 3<<2 /* rldimi */ - case ARLDIMICC: - return OPVCC(30, 0, 0, 1) | 3<<2 - case ARLWNM: - return OPVCC(21, 0, 0, 0) /* rlwinm */ - case ARLWNMCC: - return OPVCC(21, 0, 0, 1) - - case ARLDCL: - return OPVCC(30, 0, 0, 0) /* rldicl */ - case ARLDCLCC: - return OPVCC(30, 0, 0, 1) - case ARLDCR: - return OPVCC(30, 1, 0, 0) /* rldicr */ - case ARLDCRCC: - return OPVCC(30, 1, 0, 1) - case ARLDC: - return OPVCC(30, 0, 0, 0) | 2<<2 - case ARLDCCC: - return OPVCC(30, 0, 0, 1) | 2<<2 - - case ASRAW: - return OPVCC(31, 824, 0, 0) - case ASRAWCC: - return OPVCC(31, 824, 0, 1) - case ASRAD: - return OPVCC(31, (413 << 1), 0, 0) - case ASRADCC: - return OPVCC(31, (413 << 1), 0, 1) - - case ASTSW: - return OPVCC(31, 725, 0, 0) - - case ASUBC: - return OPVCC(8, 0, 0, 0) - - case ATW: - return OPVCC(3, 0, 0, 0) - case ATD: - return OPVCC(2, 0, 0, 0) - - /* Vector (VMX/Altivec) instructions */ - /* ISA 2.03 enables these for PPC970. For POWERx processors, these */ - /* are enabled starting at POWER6 (ISA 2.05). */ - case AVSPLTB: - return OPVX(4, 524, 0, 0) /* vspltb - v2.03 */ - case AVSPLTH: - return OPVX(4, 588, 0, 0) /* vsplth - v2.03 */ - case AVSPLTW: - return OPVX(4, 652, 0, 0) /* vspltw - v2.03 */ - - case AVSPLTISB: - return OPVX(4, 780, 0, 0) /* vspltisb - v2.03 */ - case AVSPLTISH: - return OPVX(4, 844, 0, 0) /* vspltish - v2.03 */ - case AVSPLTISW: - return OPVX(4, 908, 0, 0) /* vspltisw - v2.03 */ - /* End of vector instructions */ - - case AXOR: - return OPVCC(26, 0, 0, 0) /* XORIL */ - case -AXOR: - return OPVCC(27, 0, 0, 0) /* XORIU */ - } - - ctxt.Diag("bad opcode i/r or i/r/r %v", a) - return 0 -} - -/* - * load o(a),d - */ -func opload(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVD: - return OPVCC(58, 0, 0, 0) /* ld */ - case AMOVDU: - return OPVCC(58, 0, 0, 1) /* ldu */ - case AMOVWZ: - return OPVCC(32, 0, 0, 0) /* lwz */ - case AMOVWZU: - return OPVCC(33, 0, 0, 0) /* lwzu */ - case AMOVW: - return OPVCC(58, 0, 0, 0) | 1<<1 /* lwa */ - - /* no AMOVWU */ - case AMOVB, AMOVBZ: - return OPVCC(34, 0, 0, 0) - /* load */ - - case AMOVBU, AMOVBZU: - return OPVCC(35, 0, 0, 0) - case AFMOVD: - return OPVCC(50, 0, 0, 0) - case AFMOVDU: - return OPVCC(51, 0, 0, 0) - case AFMOVS: - return OPVCC(48, 0, 0, 0) - case AFMOVSU: - return OPVCC(49, 0, 0, 0) - case AMOVH: - return OPVCC(42, 0, 0, 0) - case AMOVHU: - return OPVCC(43, 0, 0, 0) - case AMOVHZ: - return OPVCC(40, 0, 0, 0) - case AMOVHZU: - return OPVCC(41, 0, 0, 0) - case AMOVMW: - return OPVCC(46, 0, 0, 0) /* lmw */ - } - - ctxt.Diag("bad load opcode %v", a) - return 0 -} - -/* - * indexed load a(b),d - */ -func oploadx(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVWZ: - return OPVCC(31, 23, 0, 0) /* lwzx */ - case AMOVWZU: - return OPVCC(31, 55, 0, 0) /* lwzux */ - case AMOVW: - return OPVCC(31, 341, 0, 0) /* lwax */ - case AMOVWU: - return OPVCC(31, 373, 0, 0) /* lwaux */ - - case AMOVB, AMOVBZ: - return OPVCC(31, 87, 0, 0) /* lbzx */ - - case AMOVBU, AMOVBZU: - return OPVCC(31, 119, 0, 0) /* lbzux */ - case AFMOVD: - return OPVCC(31, 599, 0, 0) /* lfdx */ - case AFMOVDU: - return OPVCC(31, 631, 0, 0) /* lfdux */ - case AFMOVS: - return OPVCC(31, 535, 0, 0) /* lfsx */ - case AFMOVSU: - return OPVCC(31, 567, 0, 0) /* lfsux */ - case AFMOVSX: - return OPVCC(31, 855, 0, 0) /* lfiwax - power6, isa 2.05 */ - case AFMOVSZ: - return OPVCC(31, 887, 0, 0) /* lfiwzx - power7, isa 2.06 */ - case AMOVH: - return OPVCC(31, 343, 0, 0) /* lhax */ - case AMOVHU: - return OPVCC(31, 375, 0, 0) /* lhaux */ - case AMOVHBR: - return OPVCC(31, 790, 0, 0) /* lhbrx */ - case AMOVWBR: - return OPVCC(31, 534, 0, 0) /* lwbrx */ - case AMOVDBR: - return OPVCC(31, 532, 0, 0) /* ldbrx */ - case AMOVHZ: - return OPVCC(31, 279, 0, 0) /* lhzx */ - case AMOVHZU: - return OPVCC(31, 311, 0, 0) /* lhzux */ - case AECIWX: - return OPVCC(31, 310, 0, 0) /* eciwx */ - case ALBAR: - return OPVCC(31, 52, 0, 0) /* lbarx */ - case ALWAR: - return OPVCC(31, 20, 0, 0) /* lwarx */ - case ALDAR: - return OPVCC(31, 84, 0, 0) - case ALSW: - return OPVCC(31, 533, 0, 0) /* lswx */ - case AMOVD: - return OPVCC(31, 21, 0, 0) /* ldx */ - case AMOVDU: - return OPVCC(31, 53, 0, 0) /* ldux */ - - /* Vector (VMX/Altivec) instructions */ - /* ISA 2.03 enables these for PPC970. For POWERx processors, these */ - /* are enabled starting at POWER6 (ISA 2.05). */ - case ALVEBX: - return OPVCC(31, 7, 0, 0) /* lvebx - v2.03 */ - case ALVEHX: - return OPVCC(31, 39, 0, 0) /* lvehx - v2.03 */ - case ALVEWX: - return OPVCC(31, 71, 0, 0) /* lvewx - v2.03 */ - case ALVX: - return OPVCC(31, 103, 0, 0) /* lvx - v2.03 */ - case ALVXL: - return OPVCC(31, 359, 0, 0) /* lvxl - v2.03 */ - case ALVSL: - return OPVCC(31, 6, 0, 0) /* lvsl - v2.03 */ - case ALVSR: - return OPVCC(31, 38, 0, 0) /* lvsr - v2.03 */ - /* End of vector instructions */ - - /* Vector scalar (VSX) instructions */ - /* ISA 2.06 enables these for POWER7. */ - case ALXVD2X: - return OPVXX1(31, 844, 0) /* lxvd2x - v2.06 */ - case ALXVDSX: - return OPVXX1(31, 332, 0) /* lxvdsx - v2.06 */ - case ALXVW4X: - return OPVXX1(31, 780, 0) /* lxvw4x - v2.06 */ - - case ALXSDX: - return OPVXX1(31, 588, 0) /* lxsdx - v2.06 */ - - case ALXSIWAX: - return OPVXX1(31, 76, 0) /* lxsiwax - v2.07 */ - case ALXSIWZX: - return OPVXX1(31, 12, 0) /* lxsiwzx - v2.07 */ - /* End of vector scalar instructions */ - - } - - ctxt.Diag("bad loadx opcode %v", a) - return 0 -} - -/* - * store s,o(d) - */ -func opstore(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVB, AMOVBZ: - return OPVCC(38, 0, 0, 0) /* stb */ - - case AMOVBU, AMOVBZU: - return OPVCC(39, 0, 0, 0) /* stbu */ - case AFMOVD: - return OPVCC(54, 0, 0, 0) /* stfd */ - case AFMOVDU: - return OPVCC(55, 0, 0, 0) /* stfdu */ - case AFMOVS: - return OPVCC(52, 0, 0, 0) /* stfs */ - case AFMOVSU: - return OPVCC(53, 0, 0, 0) /* stfsu */ - - case AMOVHZ, AMOVH: - return OPVCC(44, 0, 0, 0) /* sth */ - - case AMOVHZU, AMOVHU: - return OPVCC(45, 0, 0, 0) /* sthu */ - case AMOVMW: - return OPVCC(47, 0, 0, 0) /* stmw */ - case ASTSW: - return OPVCC(31, 725, 0, 0) /* stswi */ - - case AMOVWZ, AMOVW: - return OPVCC(36, 0, 0, 0) /* stw */ - - case AMOVWZU, AMOVWU: - return OPVCC(37, 0, 0, 0) /* stwu */ - case AMOVD: - return OPVCC(62, 0, 0, 0) /* std */ - case AMOVDU: - return OPVCC(62, 0, 0, 1) /* stdu */ - } - - ctxt.Diag("unknown store opcode %v", a) - return 0 -} - -/* - * indexed store s,a(b) - */ -func opstorex(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case AMOVB, AMOVBZ: - return OPVCC(31, 215, 0, 0) /* stbx */ - - case AMOVBU, AMOVBZU: - return OPVCC(31, 247, 0, 0) /* stbux */ - case AFMOVD: - return OPVCC(31, 727, 0, 0) /* stfdx */ - case AFMOVDU: - return OPVCC(31, 759, 0, 0) /* stfdux */ - case AFMOVS: - return OPVCC(31, 663, 0, 0) /* stfsx */ - case AFMOVSU: - return OPVCC(31, 695, 0, 0) /* stfsux */ - case AFMOVSX: - return OPVCC(31, 983, 0, 0) /* stfiwx */ - - case AMOVHZ, AMOVH: - return OPVCC(31, 407, 0, 0) /* sthx */ - case AMOVHBR: - return OPVCC(31, 918, 0, 0) /* sthbrx */ - - case AMOVHZU, AMOVHU: - return OPVCC(31, 439, 0, 0) /* sthux */ - - case AMOVWZ, AMOVW: - return OPVCC(31, 151, 0, 0) /* stwx */ - - case AMOVWZU, AMOVWU: - return OPVCC(31, 183, 0, 0) /* stwux */ - case ASTSW: - return OPVCC(31, 661, 0, 0) /* stswx */ - case AMOVWBR: - return OPVCC(31, 662, 0, 0) /* stwbrx */ - case ASTBCCC: - return OPVCC(31, 694, 0, 1) /* stbcx. */ - case ASTWCCC: - return OPVCC(31, 150, 0, 1) /* stwcx. */ - case ASTDCCC: - return OPVCC(31, 214, 0, 1) /* stwdx. */ - case AECOWX: - return OPVCC(31, 438, 0, 0) /* ecowx */ - case AMOVD: - return OPVCC(31, 149, 0, 0) /* stdx */ - case AMOVDU: - return OPVCC(31, 181, 0, 0) /* stdux */ - - /* Vector (VMX/Altivec) instructions */ - /* ISA 2.03 enables these for PPC970. For POWERx processors, these */ - /* are enabled starting at POWER6 (ISA 2.05). */ - case ASTVEBX: - return OPVCC(31, 135, 0, 0) /* stvebx - v2.03 */ - case ASTVEHX: - return OPVCC(31, 167, 0, 0) /* stvehx - v2.03 */ - case ASTVEWX: - return OPVCC(31, 199, 0, 0) /* stvewx - v2.03 */ - case ASTVX: - return OPVCC(31, 231, 0, 0) /* stvx - v2.03 */ - case ASTVXL: - return OPVCC(31, 487, 0, 0) /* stvxl - v2.03 */ - /* End of vector instructions */ - - /* Vector scalar (VSX) instructions */ - /* ISA 2.06 enables these for POWER7. */ - case ASTXVD2X: - return OPVXX1(31, 972, 0) /* stxvd2x - v2.06 */ - case ASTXVW4X: - return OPVXX1(31, 908, 0) /* stxvw4x - v2.06 */ - - case ASTXSDX: - return OPVXX1(31, 716, 0) /* stxsdx - v2.06 */ - - case ASTXSIWX: - return OPVXX1(31, 140, 0) /* stxsiwx - v2.07 */ - /* End of vector scalar instructions */ - - } - - ctxt.Diag("unknown storex opcode %v", a) - return 0 -} diff --git a/vendor/github.com/google/gops/internal/obj/ppc64/list9.go b/vendor/github.com/google/gops/internal/obj/ppc64/list9.go deleted file mode 100644 index 0ceac09b..00000000 --- a/vendor/github.com/google/gops/internal/obj/ppc64/list9.go +++ /dev/null @@ -1,105 +0,0 @@ -// cmd/9l/list.c from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package ppc64 - -import ( - "fmt" - - "github.com/google/gops/internal/obj" -) - -func init() { - obj.RegisterRegister(obj.RBasePPC64, REG_DCR0+1024, Rconv) - obj.RegisterOpcode(obj.ABasePPC64, Anames) -} - -func Rconv(r int) string { - if r == 0 { - return "NONE" - } - if r == REGG { - // Special case. - return "g" - } - if REG_R0 <= r && r <= REG_R31 { - return fmt.Sprintf("R%d", r-REG_R0) - } - if REG_F0 <= r && r <= REG_F31 { - return fmt.Sprintf("F%d", r-REG_F0) - } - if REG_V0 <= r && r <= REG_V31 { - return fmt.Sprintf("V%d", r-REG_V0) - } - if REG_VS0 <= r && r <= REG_VS63 { - return fmt.Sprintf("VS%d", r-REG_VS0) - } - if REG_CR0 <= r && r <= REG_CR7 { - return fmt.Sprintf("CR%d", r-REG_CR0) - } - if r == REG_CR { - return "CR" - } - if REG_SPR0 <= r && r <= REG_SPR0+1023 { - switch r { - case REG_XER: - return "XER" - - case REG_LR: - return "LR" - - case REG_CTR: - return "CTR" - } - - return fmt.Sprintf("SPR(%d)", r-REG_SPR0) - } - - if REG_DCR0 <= r && r <= REG_DCR0+1023 { - return fmt.Sprintf("DCR(%d)", r-REG_DCR0) - } - if r == REG_FPSCR { - return "FPSCR" - } - if r == REG_MSR { - return "MSR" - } - - return fmt.Sprintf("Rgok(%d)", r-obj.RBasePPC64) -} - -func DRconv(a int) string { - s := "C_??" - if a >= C_NONE && a <= C_NCLASS { - s = cnames9[a] - } - var fp string - fp += s - return fp -} diff --git a/vendor/github.com/google/gops/internal/obj/ppc64/obj9.go b/vendor/github.com/google/gops/internal/obj/ppc64/obj9.go deleted file mode 100644 index 6cff162c..00000000 --- a/vendor/github.com/google/gops/internal/obj/ppc64/obj9.go +++ /dev/null @@ -1,1251 +0,0 @@ -// cmd/9l/noop.c, cmd/9l/pass.c, cmd/9l/span.c from Vita Nuova. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package ppc64 - -import ( - "fmt" - "math" - - "github.com/google/gops/internal/obj" - "github.com/google/gops/internal/sys" -) - -func progedit(ctxt *obj.Link, p *obj.Prog) { - p.From.Class = 0 - p.To.Class = 0 - - // Rewrite BR/BL to symbol as TYPE_BRANCH. - switch p.As { - case ABR, - ABL, - obj.ARET, - obj.ADUFFZERO, - obj.ADUFFCOPY: - if p.To.Sym != nil { - p.To.Type = obj.TYPE_BRANCH - } - } - - // Rewrite float constants to values stored in memory. - switch p.As { - case AFMOVS: - if p.From.Type == obj.TYPE_FCONST { - f32 := float32(p.From.Val.(float64)) - i32 := math.Float32bits(f32) - literal := fmt.Sprintf("$f32.%08x", i32) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 4 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - case AFMOVD: - if p.From.Type == obj.TYPE_FCONST { - i64 := math.Float64bits(p.From.Val.(float64)) - literal := fmt.Sprintf("$f64.%016x", i64) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - // Put >32-bit constants in memory and load them - case AMOVD: - if p.From.Type == obj.TYPE_CONST && p.From.Name == obj.NAME_NONE && p.From.Reg == 0 && int64(int32(p.From.Offset)) != p.From.Offset { - literal := fmt.Sprintf("$i64.%016x", uint64(p.From.Offset)) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - } - - // Rewrite SUB constants into ADD. - switch p.As { - case ASUBC: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADDC - } - - case ASUBCCC: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADDCCC - } - - case ASUB: - if p.From.Type == obj.TYPE_CONST { - p.From.Offset = -p.From.Offset - p.As = AADD - } - } - if ctxt.Flag_dynlink { - rewriteToUseGot(ctxt, p) - } -} - -// Rewrite p, if necessary, to access global data via the global offset table. -func rewriteToUseGot(ctxt *obj.Link, p *obj.Prog) { - if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO { - // ADUFFxxx $offset - // becomes - // MOVD runtime.duffxxx@GOT, R12 - // ADD $offset, R12 - // MOVD R12, CTR - // BL (CTR) - var sym *obj.LSym - if p.As == obj.ADUFFZERO { - sym = obj.Linklookup(ctxt, "runtime.duffzero", 0) - } else { - sym = obj.Linklookup(ctxt, "runtime.duffcopy", 0) - } - offset := p.To.Offset - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - p.From.Sym = sym - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R12 - p.To.Name = obj.NAME_NONE - p.To.Offset = 0 - p.To.Sym = nil - p1 := obj.Appendp(ctxt, p) - p1.As = AADD - p1.From.Type = obj.TYPE_CONST - p1.From.Offset = offset - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REG_R12 - p2 := obj.Appendp(ctxt, p1) - p2.As = AMOVD - p2.From.Type = obj.TYPE_REG - p2.From.Reg = REG_R12 - p2.To.Type = obj.TYPE_REG - p2.To.Reg = REG_CTR - p3 := obj.Appendp(ctxt, p2) - p3.As = obj.ACALL - p3.From.Type = obj.TYPE_REG - p3.From.Reg = REG_R12 - p3.To.Type = obj.TYPE_REG - p3.To.Reg = REG_CTR - } - - // We only care about global data: NAME_EXTERN means a global - // symbol in the Go sense, and p.Sym.Local is true for a few - // internally defined symbols. - if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - // MOVD $sym, Rx becomes MOVD sym@GOT, Rx - // MOVD $sym+, Rx becomes MOVD sym@GOT, Rx; ADD , Rx - if p.As != AMOVD { - ctxt.Diag("do not know how to handle TYPE_ADDR in %v with -dynlink", p) - } - if p.To.Type != obj.TYPE_REG { - ctxt.Diag("do not know how to handle LEAQ-type insn to non-register in %v with -dynlink", p) - } - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - if p.From.Offset != 0 { - q := obj.Appendp(ctxt, p) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = p.From.Offset - q.To = p.To - p.From.Offset = 0 - } - } - if p.From3 != nil && p.From3.Name == obj.NAME_EXTERN { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - var source *obj.Addr - // MOVx sym, Ry becomes MOVD sym@GOT, REGTMP; MOVx (REGTMP), Ry - // MOVx Ry, sym becomes MOVD sym@GOT, REGTMP; MOVx Ry, (REGTMP) - // An addition may be inserted between the two MOVs if there is an offset. - if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p) - } - source = &p.From - } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - source = &p.To - } else { - return - } - if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { - return - } - if source.Sym.Type == obj.STLSBSS { - return - } - if source.Type != obj.TYPE_MEM { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - p1 := obj.Appendp(ctxt, p) - p2 := obj.Appendp(ctxt, p1) - - p1.As = AMOVD - p1.From.Type = obj.TYPE_MEM - p1.From.Sym = source.Sym - p1.From.Name = obj.NAME_GOTREF - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REGTMP - - p2.As = p.As - p2.From = p.From - p2.To = p.To - if p.From.Name == obj.NAME_EXTERN { - p2.From.Reg = REGTMP - p2.From.Name = obj.NAME_NONE - p2.From.Sym = nil - } else if p.To.Name == obj.NAME_EXTERN { - p2.To.Reg = REGTMP - p2.To.Name = obj.NAME_NONE - p2.To.Sym = nil - } else { - return - } - obj.Nopout(p) -} - -func preprocess(ctxt *obj.Link, cursym *obj.LSym) { - // TODO(minux): add morestack short-cuts with small fixed frame-size. - ctxt.Cursym = cursym - - if cursym.Text == nil || cursym.Text.Link == nil { - return - } - - p := cursym.Text - textstksiz := p.To.Offset - if textstksiz == -8 { - // Compatibility hack. - p.From3.Offset |= obj.NOFRAME - textstksiz = 0 - } - if textstksiz%8 != 0 { - ctxt.Diag("frame size %d not a multiple of 8", textstksiz) - } - if p.From3.Offset&obj.NOFRAME != 0 { - if textstksiz != 0 { - ctxt.Diag("NOFRAME functions must have a frame size of 0, not %d", textstksiz) - } - } - - cursym.Args = p.To.Val.(int32) - cursym.Locals = int32(textstksiz) - - /* - * find leaf subroutines - * strip NOPs - * expand RET - * expand BECOME pseudo - */ - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f noops\n", obj.Cputime()) - } - - var q *obj.Prog - var q1 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - switch p.As { - /* too hard, just leave alone */ - case obj.ATEXT: - q = p - - p.Mark |= LABEL | LEAF | SYNC - if p.Link != nil { - p.Link.Mark |= LABEL - } - - case ANOR: - q = p - if p.To.Type == obj.TYPE_REG { - if p.To.Reg == REGZERO { - p.Mark |= LABEL | SYNC - } - } - - case ALWAR, - ALBAR, - ASTBCCC, - ASTWCCC, - AECIWX, - AECOWX, - AEIEIO, - AICBI, - AISYNC, - ATLBIE, - ATLBIEL, - ASLBIA, - ASLBIE, - ASLBMFEE, - ASLBMFEV, - ASLBMTE, - ADCBF, - ADCBI, - ADCBST, - ADCBT, - ADCBTST, - ADCBZ, - ASYNC, - ATLBSYNC, - APTESYNC, - ALWSYNC, - ATW, - AWORD, - ARFI, - ARFCI, - ARFID, - AHRFID: - q = p - p.Mark |= LABEL | SYNC - continue - - case AMOVW, AMOVWZ, AMOVD: - q = p - if p.From.Reg >= REG_SPECIAL || p.To.Reg >= REG_SPECIAL { - p.Mark |= LABEL | SYNC - } - continue - - case AFABS, - AFABSCC, - AFADD, - AFADDCC, - AFCTIW, - AFCTIWCC, - AFCTIWZ, - AFCTIWZCC, - AFDIV, - AFDIVCC, - AFMADD, - AFMADDCC, - AFMOVD, - AFMOVDU, - /* case AFMOVDS: */ - AFMOVS, - AFMOVSU, - - /* case AFMOVSD: */ - AFMSUB, - AFMSUBCC, - AFMUL, - AFMULCC, - AFNABS, - AFNABSCC, - AFNEG, - AFNEGCC, - AFNMADD, - AFNMADDCC, - AFNMSUB, - AFNMSUBCC, - AFRSP, - AFRSPCC, - AFSUB, - AFSUBCC: - q = p - - p.Mark |= FLOAT - continue - - case ABL, - ABCL, - obj.ADUFFZERO, - obj.ADUFFCOPY: - cursym.Text.Mark &^= LEAF - fallthrough - - case ABC, - ABEQ, - ABGE, - ABGT, - ABLE, - ABLT, - ABNE, - ABR, - ABVC, - ABVS: - p.Mark |= BRANCH - q = p - q1 = p.Pcond - if q1 != nil { - for q1.As == obj.ANOP { - q1 = q1.Link - p.Pcond = q1 - } - - if q1.Mark&LEAF == 0 { - q1.Mark |= LABEL - } - } else { - p.Mark |= LABEL - } - q1 = p.Link - if q1 != nil { - q1.Mark |= LABEL - } - continue - - case AFCMPO, AFCMPU: - q = p - p.Mark |= FCMP | FLOAT - continue - - case obj.ARET: - q = p - if p.Link != nil { - p.Link.Mark |= LABEL - } - continue - - case obj.ANOP: - q1 = p.Link - q.Link = q1 /* q is non-nop */ - q1.Mark |= p.Mark - continue - - default: - q = p - continue - } - } - - autosize := int32(0) - var p1 *obj.Prog - var p2 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - o := p.As - switch o { - case obj.ATEXT: - autosize = int32(textstksiz) - - if p.Mark&LEAF != 0 && autosize == 0 { - // A leaf function with no locals has no frame. - p.From3.Offset |= obj.NOFRAME - } - - if p.From3.Offset&obj.NOFRAME == 0 { - // If there is a stack frame at all, it includes - // space to save the LR. - autosize += int32(ctxt.FixedFrameSize()) - } - - if p.Mark&LEAF != 0 && autosize < obj.StackSmall { - // A leaf function with a small stack can be marked - // NOSPLIT, avoiding a stack check. - p.From3.Offset |= obj.NOSPLIT - } - - p.To.Offset = int64(autosize) - - q = p - - if ctxt.Flag_shared && cursym.Name != "runtime.duffzero" && cursym.Name != "runtime.duffcopy" && cursym.Name != "runtime.stackBarrier" { - // When compiling Go into PIC, all functions must start - // with instructions to load the TOC pointer into r2: - // - // addis r2, r12, .TOC.-func@ha - // addi r2, r2, .TOC.-func@l+4 - // - // We could probably skip this prologue in some situations - // but it's a bit subtle. However, it is both safe and - // necessary to leave the prologue off duffzero and - // duffcopy as we rely on being able to jump to a specific - // instruction offset for them, and stackBarrier is only - // ever called from an overwritten LR-save slot on the - // stack (when r12 will not be remotely the right thing) - // but fortunately does not access global data. - // - // These are AWORDS because there is no (afaict) way to - // generate the addis instruction except as part of the - // load of a large constant, and in that case there is no - // way to use r12 as the source. - q = obj.Appendp(ctxt, q) - q.As = AWORD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Offset = 0x3c4c0000 - q = obj.Appendp(ctxt, q) - q.As = AWORD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Offset = 0x38420000 - rel := obj.Addrel(ctxt.Cursym) - rel.Off = 0 - rel.Siz = 8 - rel.Sym = obj.Linklookup(ctxt, ".TOC.", 0) - rel.Type = obj.R_ADDRPOWER_PCREL - } - - if cursym.Text.From3.Offset&obj.NOSPLIT == 0 { - q = stacksplit(ctxt, q, autosize) // emit split check - } - - if autosize != 0 { - // Make sure to save link register for non-empty frame, even if - // it is a leaf function, so that traceback works. - if cursym.Text.Mark&LEAF == 0 && autosize >= -BIG && autosize <= BIG { - // Use MOVDU to adjust R1 when saving R31, if autosize is small. - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_LR - q.To.Type = obj.TYPE_REG - q.To.Reg = REGTMP - - q = obj.Appendp(ctxt, q) - q.As = AMOVDU - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REGTMP - q.To.Type = obj.TYPE_MEM - q.To.Offset = int64(-autosize) - q.To.Reg = REGSP - q.Spadj = int32(autosize) - } else { - // Frame size is too large for a MOVDU instruction. - // Store link register before decrementing SP, so if a signal comes - // during the execution of the function prologue, the traceback - // code will not see a half-updated stack frame. - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_LR - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R29 // REGTMP may be used to synthesize large offset in the next instruction - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R29 - q.To.Type = obj.TYPE_MEM - q.To.Offset = int64(-autosize) - q.To.Reg = REGSP - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(-autosize) - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Spadj = +autosize - } - } else if cursym.Text.Mark&LEAF == 0 { - // A very few functions that do not return to their caller - // (e.g. gogo) are not identified as leaves but still have - // no frame. - cursym.Text.Mark |= LEAF - } - - if cursym.Text.Mark&LEAF != 0 { - cursym.Set(obj.AttrLeaf, true) - break - } - - if ctxt.Flag_shared { - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R2 - q.To.Type = obj.TYPE_MEM - q.To.Reg = REGSP - q.To.Offset = 24 - } - - if cursym.Text.From3.Offset&obj.WRAPPER != 0 { - // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame - // - // MOVD g_panic(g), R3 - // CMP R0, R3 - // BEQ end - // MOVD panic_argp(R3), R4 - // ADD $(autosize+8), R1, R5 - // CMP R4, R5 - // BNE end - // ADD $8, R1, R6 - // MOVD R6, panic_argp(R3) - // end: - // NOP - // - // The NOP is needed to give the jumps somewhere to land. - // It is a liblink NOP, not a ppc64 NOP: it encodes to 0 instruction bytes. - - q = obj.Appendp(ctxt, q) - - q.As = AMOVD - q.From.Type = obj.TYPE_MEM - q.From.Reg = REGG - q.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R3 - - q = obj.Appendp(ctxt, q) - q.As = ACMP - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R0 - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R3 - - q = obj.Appendp(ctxt, q) - q.As = ABEQ - q.To.Type = obj.TYPE_BRANCH - p1 = q - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_MEM - q.From.Reg = REG_R3 - q.From.Offset = 0 // Panic.argp - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R4 - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(autosize) + ctxt.FixedFrameSize() - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R5 - - q = obj.Appendp(ctxt, q) - q.As = ACMP - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R4 - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R5 - - q = obj.Appendp(ctxt, q) - q.As = ABNE - q.To.Type = obj.TYPE_BRANCH - p2 = q - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = ctxt.FixedFrameSize() - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R6 - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R6 - q.To.Type = obj.TYPE_MEM - q.To.Reg = REG_R3 - q.To.Offset = 0 // Panic.argp - - q = obj.Appendp(ctxt, q) - - q.As = obj.ANOP - p1.Pcond = q - p2.Pcond = q - } - - case obj.ARET: - if p.From.Type == obj.TYPE_CONST { - ctxt.Diag("using BECOME (%v) is not supported!", p) - break - } - - retTarget := p.To.Sym - - if cursym.Text.Mark&LEAF != 0 { - if autosize == 0 { - p.As = ABR - p.From = obj.Addr{} - if retTarget == nil { - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_LR - } else { - p.To.Type = obj.TYPE_BRANCH - p.To.Sym = retTarget - } - p.Mark |= BRANCH - break - } - - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(autosize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REGSP - p.Spadj = -autosize - - q = ctxt.NewProg() - q.As = ABR - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_LR - q.Mark |= BRANCH - q.Spadj = +autosize - - q.Link = p.Link - p.Link = q - break - } - - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Offset = 0 - p.From.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REGTMP - - q = ctxt.NewProg() - q.As = AMOVD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_REG - q.From.Reg = REGTMP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_LR - - q.Link = p.Link - p.Link = q - p = q - - if false { - // Debug bad returns - q = ctxt.NewProg() - - q.As = AMOVD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_MEM - q.From.Offset = 0 - q.From.Reg = REGTMP - q.To.Type = obj.TYPE_REG - q.To.Reg = REGTMP - - q.Link = p.Link - p.Link = q - p = q - } - - if autosize != 0 { - q = ctxt.NewProg() - q.As = AADD - q.Lineno = p.Lineno - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(autosize) - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Spadj = -autosize - - q.Link = p.Link - p.Link = q - } - - q1 = ctxt.NewProg() - q1.As = ABR - q1.Lineno = p.Lineno - if retTarget == nil { - q1.To.Type = obj.TYPE_REG - q1.To.Reg = REG_LR - } else { - q1.To.Type = obj.TYPE_BRANCH - q1.To.Sym = retTarget - } - q1.Mark |= BRANCH - q1.Spadj = +autosize - - q1.Link = q.Link - q.Link = q1 - case AADD: - if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { - p.Spadj = int32(-p.From.Offset) - } - } - } -} - -/* -// instruction scheduling - if(debug['Q'] == 0) - return; - - curtext = nil; - q = nil; // p - 1 - q1 = firstp; // top of block - o = 0; // count of instructions - for(p = firstp; p != nil; p = p1) { - p1 = p->link; - o++; - if(p->mark & NOSCHED){ - if(q1 != p){ - sched(q1, q); - } - for(; p != nil; p = p->link){ - if(!(p->mark & NOSCHED)) - break; - q = p; - } - p1 = p; - q1 = p; - o = 0; - continue; - } - if(p->mark & (LABEL|SYNC)) { - if(q1 != p) - sched(q1, q); - q1 = p; - o = 1; - } - if(p->mark & (BRANCH|SYNC)) { - sched(q1, p); - q1 = p1; - o = 0; - } - if(o >= NSCHED) { - sched(q1, p); - q1 = p1; - o = 0; - } - q = p; - } -*/ -func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { - p0 := p // save entry point, but skipping the two instructions setting R2 in shared mode - - // MOVD g_stackguard(g), R3 - p = obj.Appendp(ctxt, p) - - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R3 - - var q *obj.Prog - if framesize <= obj.StackSmall { - // small stack: SP < stackguard - // CMP stackguard, SP - p = obj.Appendp(ctxt, p) - - p.As = ACMPU - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.To.Type = obj.TYPE_REG - p.To.Reg = REGSP - } else if framesize <= obj.StackBig { - // large stack: SP-framesize < stackguard-StackSmall - // ADD $-framesize, SP, R4 - // CMP stackguard, R4 - p = obj.Appendp(ctxt, p) - - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(-framesize) - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.As = ACMPU - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - } else { - // Such a large stack we need to protect against wraparound. - // If SP is close to zero: - // SP-stackguard+StackGuard <= framesize + (StackGuard-StackSmall) - // The +StackGuard on both sides is required to keep the left side positive: - // SP is allowed to be slightly below stackguard. See stack.h. - // - // Preemption sets stackguard to StackPreempt, a very large value. - // That breaks the math above, so we have to check for that explicitly. - // // stackguard is R3 - // CMP R3, $StackPreempt - // BEQ label-of-call-to-morestack - // ADD $StackGuard, SP, R4 - // SUB R3, R4 - // MOVD $(framesize+(StackGuard-StackSmall)), R31 - // CMPU R31, R4 - p = obj.Appendp(ctxt, p) - - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.To.Type = obj.TYPE_CONST - p.To.Offset = obj.StackPreempt - - p = obj.Appendp(ctxt, p) - q = p - p.As = ABEQ - p.To.Type = obj.TYPE_BRANCH - - p = obj.Appendp(ctxt, p) - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = obj.StackGuard - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.As = ASUB - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + obj.StackGuard - obj.StackSmall - p.To.Type = obj.TYPE_REG - p.To.Reg = REGTMP - - p = obj.Appendp(ctxt, p) - p.As = ACMPU - p.From.Type = obj.TYPE_REG - p.From.Reg = REGTMP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - } - - // q1: BLT done - p = obj.Appendp(ctxt, p) - q1 := p - - p.As = ABLT - p.To.Type = obj.TYPE_BRANCH - - // MOVD LR, R5 - p = obj.Appendp(ctxt, p) - - p.As = AMOVD - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_LR - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R5 - if q != nil { - q.Pcond = p - } - - var morestacksym *obj.LSym - if ctxt.Cursym.CFunc() { - morestacksym = obj.Linklookup(ctxt, "runtime.morestackc", 0) - } else if ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0 { - morestacksym = obj.Linklookup(ctxt, "runtime.morestack_noctxt", 0) - } else { - morestacksym = obj.Linklookup(ctxt, "runtime.morestack", 0) - } - - if ctxt.Flag_shared { - // In PPC64 PIC code, R2 is used as TOC pointer derived from R12 - // which is the address of function entry point when entering - // the function. We need to preserve R2 across call to morestack. - // Fortunately, in shared mode, 8(SP) and 16(SP) are reserved in - // the caller's frame, but not used (0(SP) is caller's saved LR, - // 24(SP) is caller's saved R2). Use 8(SP) to save this function's R2. - - // MOVD R12, 8(SP) - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R2 - p.To.Type = obj.TYPE_MEM - p.To.Reg = REGSP - p.To.Offset = 8 - } - - if ctxt.Flag_dynlink { - // Avoid calling morestack via a PLT when dynamically linking. The - // PLT stubs generated by the system linker on ppc64le when "std r2, - // 24(r1)" to save the TOC pointer in their callers stack - // frame. Unfortunately (and necessarily) morestack is called before - // the function that calls it sets up its frame and so the PLT ends - // up smashing the saved TOC pointer for its caller's caller. - // - // According to the ABI documentation there is a mechanism to avoid - // the TOC save that the PLT stub does (put a R_PPC64_TOCSAVE - // relocation on the nop after the call to morestack) but at the time - // of writing it is not supported at all by gold and my attempt to - // use it with ld.bfd caused an internal linker error. So this hack - // seems preferable. - - // MOVD $runtime.morestack(SB), R12 - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Sym = morestacksym - p.From.Name = obj.NAME_GOTREF - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R12 - - // MOVD R12, CTR - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R12 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_CTR - - // BL CTR - p = obj.Appendp(ctxt, p) - p.As = obj.ACALL - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R12 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_CTR - } else { - // BL runtime.morestack(SB) - p = obj.Appendp(ctxt, p) - - p.As = ABL - p.To.Type = obj.TYPE_BRANCH - p.To.Sym = morestacksym - } - - if ctxt.Flag_shared { - // MOVD 8(SP), R2 - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGSP - p.From.Offset = 8 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R2 - } - - // BR start - p = obj.Appendp(ctxt, p) - p.As = ABR - p.To.Type = obj.TYPE_BRANCH - p.Pcond = p0.Link - - // placeholder for q1's jump target - p = obj.Appendp(ctxt, p) - - p.As = obj.ANOP // zero-width place holder - q1.Pcond = p - - return p -} - -func follow(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - firstp := ctxt.NewProg() - lastp := firstp - xfol(ctxt, s.Text, &lastp) - lastp.Link = nil - s.Text = firstp.Link -} - -func relinv(a obj.As) obj.As { - switch a { - case ABEQ: - return ABNE - case ABNE: - return ABEQ - - case ABGE: - return ABLT - case ABLT: - return ABGE - - case ABGT: - return ABLE - case ABLE: - return ABGT - - case ABVC: - return ABVS - case ABVS: - return ABVC - } - - return 0 -} - -func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { - var q *obj.Prog - var r *obj.Prog - var b obj.As - var i int - -loop: - if p == nil { - return - } - a := p.As - if a == ABR { - q = p.Pcond - if (p.Mark&NOSCHED != 0) || q != nil && (q.Mark&NOSCHED != 0) { - p.Mark |= FOLL - (*last).Link = p - *last = p - p = p.Link - xfol(ctxt, p, last) - p = q - if p != nil && p.Mark&FOLL == 0 { - goto loop - } - return - } - - if q != nil { - p.Mark |= FOLL - p = q - if p.Mark&FOLL == 0 { - goto loop - } - } - } - - if p.Mark&FOLL != 0 { - i = 0 - q = p - for ; i < 4; i, q = i+1, q.Link { - if q == *last || (q.Mark&NOSCHED != 0) { - break - } - b = 0 /* set */ - a = q.As - if a == obj.ANOP { - i-- - continue - } - - if a == ABR || a == obj.ARET || a == ARFI || a == ARFCI || a == ARFID || a == AHRFID { - goto copy - } - if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { - continue - } - b = relinv(a) - if b == 0 { - continue - } - - copy: - for { - r = ctxt.NewProg() - *r = *p - if r.Mark&FOLL == 0 { - fmt.Printf("can't happen 1\n") - } - r.Mark |= FOLL - if p != q { - p = p.Link - (*last).Link = r - *last = r - continue - } - - (*last).Link = r - *last = r - if a == ABR || a == obj.ARET || a == ARFI || a == ARFCI || a == ARFID || a == AHRFID { - return - } - r.As = b - r.Pcond = p.Link - r.Link = p.Pcond - if r.Link.Mark&FOLL == 0 { - xfol(ctxt, r.Link, last) - } - if r.Pcond.Mark&FOLL == 0 { - fmt.Printf("can't happen 2\n") - } - return - } - } - - a = ABR - q = ctxt.NewProg() - q.As = a - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.To.Offset = p.Pc - q.Pcond = p - p = q - } - - p.Mark |= FOLL - (*last).Link = p - *last = p - if a == ABR || a == obj.ARET || a == ARFI || a == ARFCI || a == ARFID || a == AHRFID { - if p.Mark&NOSCHED != 0 { - p = p.Link - goto loop - } - - return - } - - if p.Pcond != nil { - if a != ABL && p.Link != nil { - xfol(ctxt, p.Link, last) - p = p.Pcond - if p == nil || (p.Mark&FOLL != 0) { - return - } - goto loop - } - } - - p = p.Link - goto loop -} - -var Linkppc64 = obj.LinkArch{ - Arch: sys.ArchPPC64, - Preprocess: preprocess, - Assemble: span9, - Follow: follow, - Progedit: progedit, -} - -var Linkppc64le = obj.LinkArch{ - Arch: sys.ArchPPC64LE, - Preprocess: preprocess, - Assemble: span9, - Follow: follow, - Progedit: progedit, -} diff --git a/vendor/github.com/google/gops/internal/obj/reloctype_string.go b/vendor/github.com/google/gops/internal/obj/reloctype_string.go deleted file mode 100644 index 6de617cd..00000000 --- a/vendor/github.com/google/gops/internal/obj/reloctype_string.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by "stringer -type=RelocType"; DO NOT EDIT - -package obj - -import "fmt" - -const _RelocType_name = "R_ADDRR_ADDRPOWERR_ADDRARM64R_ADDRMIPSR_ADDROFFR_SIZER_CALLR_CALLARMR_CALLARM64R_CALLINDR_CALLPOWERR_CALLMIPSR_CONSTR_PCRELR_TLS_LER_TLS_IER_GOTOFFR_PLT0R_PLT1R_PLT2R_USEFIELDR_USETYPER_METHODOFFR_POWER_TOCR_GOTPCRELR_JMPMIPSR_DWARFREFR_ARM64_TLS_LER_ARM64_TLS_IER_ARM64_GOTPCRELR_POWER_TLS_LER_POWER_TLS_IER_POWER_TLSR_ADDRPOWER_DSR_ADDRPOWER_GOTR_ADDRPOWER_PCRELR_ADDRPOWER_TOCRELR_ADDRPOWER_TOCREL_DSR_PCRELDBLR_ADDRMIPSUR_ADDRMIPSTLS" - -var _RelocType_index = [...]uint16{0, 6, 17, 28, 38, 47, 53, 59, 68, 79, 88, 99, 109, 116, 123, 131, 139, 147, 153, 159, 165, 175, 184, 195, 206, 216, 225, 235, 249, 263, 279, 293, 307, 318, 332, 347, 364, 382, 403, 413, 424, 437} - -func (i RelocType) String() string { - i -= 1 - if i < 0 || i >= RelocType(len(_RelocType_index)-1) { - return fmt.Sprintf("RelocType(%d)", i+1) - } - return _RelocType_name[_RelocType_index[i]:_RelocType_index[i+1]] -} diff --git a/vendor/github.com/google/gops/internal/obj/s390x/a.out.go b/vendor/github.com/google/gops/internal/obj/s390x/a.out.go deleted file mode 100644 index df7192f3..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/a.out.go +++ /dev/null @@ -1,926 +0,0 @@ -// Based on cmd/internal/obj/ppc64/a.out.go. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package s390x - -import "github.com/google/gops/internal/obj" - -//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p s390x - -const ( - NSNAME = 8 - NSYM = 50 - NREG = 16 // number of general purpose registers - NFREG = 16 // number of floating point registers -) - -const ( - // General purpose registers (GPRs). - REG_R0 = obj.RBaseS390X + iota - REG_R1 - REG_R2 - REG_R3 - REG_R4 - REG_R5 - REG_R6 - REG_R7 - REG_R8 - REG_R9 - REG_R10 - REG_R11 - REG_R12 - REG_R13 - REG_R14 - REG_R15 - - // Floating point registers (FPRs). - REG_F0 - REG_F1 - REG_F2 - REG_F3 - REG_F4 - REG_F5 - REG_F6 - REG_F7 - REG_F8 - REG_F9 - REG_F10 - REG_F11 - REG_F12 - REG_F13 - REG_F14 - REG_F15 - - // Vector registers (VRs) - only available when the vector - // facility is installed. - // V0-V15 are aliases for F0-F15. - // We keep them in a separate space to make printing etc. easier - // If the code generator ever emits vector instructions it will - // need to take into account the aliasing. - REG_V0 - REG_V1 - REG_V2 - REG_V3 - REG_V4 - REG_V5 - REG_V6 - REG_V7 - REG_V8 - REG_V9 - REG_V10 - REG_V11 - REG_V12 - REG_V13 - REG_V14 - REG_V15 - REG_V16 - REG_V17 - REG_V18 - REG_V19 - REG_V20 - REG_V21 - REG_V22 - REG_V23 - REG_V24 - REG_V25 - REG_V26 - REG_V27 - REG_V28 - REG_V29 - REG_V30 - REG_V31 - - // Access registers (ARs). - // The thread pointer is typically stored in the register pair - // AR0 and AR1. - REG_AR0 - REG_AR1 - REG_AR2 - REG_AR3 - REG_AR4 - REG_AR5 - REG_AR6 - REG_AR7 - REG_AR8 - REG_AR9 - REG_AR10 - REG_AR11 - REG_AR12 - REG_AR13 - REG_AR14 - REG_AR15 - - REG_RESERVED // end of allocated registers - - REGZERO = REG_R0 // set to zero - REGARG = -1 // -1 disables passing the first argument in register - REGRT1 = REG_R3 // used during zeroing of the stack - not reserved - REGRT2 = REG_R4 // used during zeroing of the stack - not reserved - REGTMP = REG_R10 // scratch register used in the assembler and linker - REGTMP2 = REG_R11 // scratch register used in the assembler and linker - REGCTXT = REG_R12 // context for closures - REGG = REG_R13 // G - REG_LR = REG_R14 // link register - REGSP = REG_R15 // stack pointer -) - -const ( - BIG = 32768 - 8 - DISP12 = 4096 - DISP16 = 65536 - DISP20 = 1048576 -) - -const ( - // mark flags - LABEL = 1 << 0 - LEAF = 1 << 1 - FLOAT = 1 << 2 - BRANCH = 1 << 3 - LOAD = 1 << 4 - FCMP = 1 << 5 - SYNC = 1 << 6 - LIST = 1 << 7 - FOLL = 1 << 8 - NOSCHED = 1 << 9 -) - -const ( // comments from func aclass in asmz.go - C_NONE = iota - C_REG // general-purpose register (64-bit) - C_FREG // floating-point register (64-bit) - C_VREG // vector register (128-bit) - C_AREG // access register (32-bit) - C_ZCON // constant == 0 - C_SCON // 0 <= constant <= 0x7fff (positive int16) - C_UCON // constant & 0xffff == 0 (int16 or uint16) - C_ADDCON // 0 > constant >= -0x8000 (negative int16) - C_ANDCON // constant <= 0xffff - C_LCON // constant (int32 or uint32) - C_DCON // constant (int64 or uint64) - C_SACON // computed address, 16-bit displacement, possibly SP-relative - C_LACON // computed address, 32-bit displacement, possibly SP-relative - C_DACON // computed address, 64-bit displacment? - C_SBRA // short branch - C_LBRA // long branch - C_SAUTO // short auto - C_LAUTO // long auto - C_ZOREG // heap address, register-based, displacement == 0 - C_SOREG // heap address, register-based, int16 displacement - C_LOREG // heap address, register-based, int32 displacement - C_TLS_LE // TLS - local exec model (for executables) - C_TLS_IE // TLS - initial exec model (for shared libraries loaded at program startup) - C_GOK // general address - C_ADDR // relocation for extern or static symbols (loads and stores) - C_SYMADDR // relocation for extern or static symbols (address taking) - C_GOTADDR // GOT slot for a symbol in -dynlink mode - C_TEXTSIZE // text size - C_ANY - C_NCLASS // must be the last -) - -const ( - // integer arithmetic - AADD = obj.ABaseS390X + obj.A_ARCHSPECIFIC + iota - AADDC - AADDE - AADDW - ADIVW - ADIVWU - ADIVD - ADIVDU - AMODW - AMODWU - AMODD - AMODDU - AMULLW - AMULLD - AMULHD - AMULHDU - ASUB - ASUBC - ASUBV - ASUBE - ASUBW - ANEG - ANEGW - - // integer moves - AMOVWBR - AMOVB - AMOVBZ - AMOVH - AMOVHBR - AMOVHZ - AMOVW - AMOVWZ - AMOVD - AMOVDBR - - // conditional moves - AMOVDEQ - AMOVDGE - AMOVDGT - AMOVDLE - AMOVDLT - AMOVDNE - - // find leftmost one - AFLOGR - - // integer bitwise - AAND - AANDW - AOR - AORW - AXOR - AXORW - ASLW - ASLD - ASRW - ASRAW - ASRD - ASRAD - ARLL - ARLLG - - // floating point - AFABS - AFADD - AFADDS - AFCMPO - AFCMPU - ACEBR - AFDIV - AFDIVS - AFMADD - AFMADDS - AFMOVD - AFMOVS - AFMSUB - AFMSUBS - AFMUL - AFMULS - AFNABS - AFNEG - AFNEGS - AFNMADD - AFNMADDS - AFNMSUB - AFNMSUBS - ALEDBR - ALDEBR - AFSUB - AFSUBS - AFSQRT - AFSQRTS - AFIEBR - AFIDBR - - // convert from int32/int64 to float/float64 - ACEFBRA - ACDFBRA - ACEGBRA - ACDGBRA - - // convert from float/float64 to int32/int64 - ACFEBRA - ACFDBRA - ACGEBRA - ACGDBRA - - // convert from uint32/uint64 to float/float64 - ACELFBR - ACDLFBR - ACELGBR - ACDLGBR - - // convert from float/float64 to uint32/uint64 - ACLFEBR - ACLFDBR - ACLGEBR - ACLGDBR - - // compare - ACMP - ACMPU - ACMPW - ACMPWU - - // compare and swap - ACS - ACSG - - // serialize - ASYNC - - // branch - ABC - ABCL - ABEQ - ABGE - ABGT - ABLE - ABLT - ABLEU - ABLTU - ABNE - ABVC - ABVS - ASYSCALL - - // compare and branch - ACMPBEQ - ACMPBGE - ACMPBGT - ACMPBLE - ACMPBLT - ACMPBNE - ACMPUBEQ - ACMPUBGE - ACMPUBGT - ACMPUBLE - ACMPUBLT - ACMPUBNE - - // storage-and-storage - AMVC - ACLC - AXC - AOC - ANC - - // load - AEXRL - ALARL - ALA - ALAY - - // interlocked load and op - ALAA - ALAAG - ALAAL - ALAALG - ALAN - ALANG - ALAX - ALAXG - ALAO - ALAOG - - // load/store multiple - ALMY - ALMG - ASTMY - ASTMG - - // store clock - ASTCK - ASTCKC - ASTCKE - ASTCKF - - // macros - ACLEAR - - // vector - AVA - AVAB - AVAH - AVAF - AVAG - AVAQ - AVACC - AVACCB - AVACCH - AVACCF - AVACCG - AVACCQ - AVAC - AVACQ - AVACCC - AVACCCQ - AVN - AVNC - AVAVG - AVAVGB - AVAVGH - AVAVGF - AVAVGG - AVAVGL - AVAVGLB - AVAVGLH - AVAVGLF - AVAVGLG - AVCKSM - AVCEQ - AVCEQB - AVCEQH - AVCEQF - AVCEQG - AVCEQBS - AVCEQHS - AVCEQFS - AVCEQGS - AVCH - AVCHB - AVCHH - AVCHF - AVCHG - AVCHBS - AVCHHS - AVCHFS - AVCHGS - AVCHL - AVCHLB - AVCHLH - AVCHLF - AVCHLG - AVCHLBS - AVCHLHS - AVCHLFS - AVCHLGS - AVCLZ - AVCLZB - AVCLZH - AVCLZF - AVCLZG - AVCTZ - AVCTZB - AVCTZH - AVCTZF - AVCTZG - AVEC - AVECB - AVECH - AVECF - AVECG - AVECL - AVECLB - AVECLH - AVECLF - AVECLG - AVERIM - AVERIMB - AVERIMH - AVERIMF - AVERIMG - AVERLL - AVERLLB - AVERLLH - AVERLLF - AVERLLG - AVERLLV - AVERLLVB - AVERLLVH - AVERLLVF - AVERLLVG - AVESLV - AVESLVB - AVESLVH - AVESLVF - AVESLVG - AVESL - AVESLB - AVESLH - AVESLF - AVESLG - AVESRA - AVESRAB - AVESRAH - AVESRAF - AVESRAG - AVESRAV - AVESRAVB - AVESRAVH - AVESRAVF - AVESRAVG - AVESRL - AVESRLB - AVESRLH - AVESRLF - AVESRLG - AVESRLV - AVESRLVB - AVESRLVH - AVESRLVF - AVESRLVG - AVX - AVFAE - AVFAEB - AVFAEH - AVFAEF - AVFAEBS - AVFAEHS - AVFAEFS - AVFAEZB - AVFAEZH - AVFAEZF - AVFAEZBS - AVFAEZHS - AVFAEZFS - AVFEE - AVFEEB - AVFEEH - AVFEEF - AVFEEBS - AVFEEHS - AVFEEFS - AVFEEZB - AVFEEZH - AVFEEZF - AVFEEZBS - AVFEEZHS - AVFEEZFS - AVFENE - AVFENEB - AVFENEH - AVFENEF - AVFENEBS - AVFENEHS - AVFENEFS - AVFENEZB - AVFENEZH - AVFENEZF - AVFENEZBS - AVFENEZHS - AVFENEZFS - AVFA - AVFADB - AWFADB - AWFK - AWFKDB - AVFCE - AVFCEDB - AVFCEDBS - AWFCEDB - AWFCEDBS - AVFCH - AVFCHDB - AVFCHDBS - AWFCHDB - AWFCHDBS - AVFCHE - AVFCHEDB - AVFCHEDBS - AWFCHEDB - AWFCHEDBS - AWFC - AWFCDB - AVCDG - AVCDGB - AWCDGB - AVCDLG - AVCDLGB - AWCDLGB - AVCGD - AVCGDB - AWCGDB - AVCLGD - AVCLGDB - AWCLGDB - AVFD - AVFDDB - AWFDDB - AVLDE - AVLDEB - AWLDEB - AVLED - AVLEDB - AWLEDB - AVFM - AVFMDB - AWFMDB - AVFMA - AVFMADB - AWFMADB - AVFMS - AVFMSDB - AWFMSDB - AVFPSO - AVFPSODB - AWFPSODB - AVFLCDB - AWFLCDB - AVFLNDB - AWFLNDB - AVFLPDB - AWFLPDB - AVFSQ - AVFSQDB - AWFSQDB - AVFS - AVFSDB - AWFSDB - AVFTCI - AVFTCIDB - AWFTCIDB - AVGFM - AVGFMB - AVGFMH - AVGFMF - AVGFMG - AVGFMA - AVGFMAB - AVGFMAH - AVGFMAF - AVGFMAG - AVGEF - AVGEG - AVGBM - AVZERO - AVONE - AVGM - AVGMB - AVGMH - AVGMF - AVGMG - AVISTR - AVISTRB - AVISTRH - AVISTRF - AVISTRBS - AVISTRHS - AVISTRFS - AVL - AVLR - AVLREP - AVLREPB - AVLREPH - AVLREPF - AVLREPG - AVLC - AVLCB - AVLCH - AVLCF - AVLCG - AVLEH - AVLEF - AVLEG - AVLEB - AVLEIH - AVLEIF - AVLEIG - AVLEIB - AVFI - AVFIDB - AWFIDB - AVLGV - AVLGVB - AVLGVH - AVLGVF - AVLGVG - AVLLEZ - AVLLEZB - AVLLEZH - AVLLEZF - AVLLEZG - AVLM - AVLP - AVLPB - AVLPH - AVLPF - AVLPG - AVLBB - AVLVG - AVLVGB - AVLVGH - AVLVGF - AVLVGG - AVLVGP - AVLL - AVMX - AVMXB - AVMXH - AVMXF - AVMXG - AVMXL - AVMXLB - AVMXLH - AVMXLF - AVMXLG - AVMRH - AVMRHB - AVMRHH - AVMRHF - AVMRHG - AVMRL - AVMRLB - AVMRLH - AVMRLF - AVMRLG - AVMN - AVMNB - AVMNH - AVMNF - AVMNG - AVMNL - AVMNLB - AVMNLH - AVMNLF - AVMNLG - AVMAE - AVMAEB - AVMAEH - AVMAEF - AVMAH - AVMAHB - AVMAHH - AVMAHF - AVMALE - AVMALEB - AVMALEH - AVMALEF - AVMALH - AVMALHB - AVMALHH - AVMALHF - AVMALO - AVMALOB - AVMALOH - AVMALOF - AVMAL - AVMALB - AVMALHW - AVMALF - AVMAO - AVMAOB - AVMAOH - AVMAOF - AVME - AVMEB - AVMEH - AVMEF - AVMH - AVMHB - AVMHH - AVMHF - AVMLE - AVMLEB - AVMLEH - AVMLEF - AVMLH - AVMLHB - AVMLHH - AVMLHF - AVMLO - AVMLOB - AVMLOH - AVMLOF - AVML - AVMLB - AVMLHW - AVMLF - AVMO - AVMOB - AVMOH - AVMOF - AVNO - AVNOT - AVO - AVPK - AVPKH - AVPKF - AVPKG - AVPKLS - AVPKLSH - AVPKLSF - AVPKLSG - AVPKLSHS - AVPKLSFS - AVPKLSGS - AVPKS - AVPKSH - AVPKSF - AVPKSG - AVPKSHS - AVPKSFS - AVPKSGS - AVPERM - AVPDI - AVPOPCT - AVREP - AVREPB - AVREPH - AVREPF - AVREPG - AVREPI - AVREPIB - AVREPIH - AVREPIF - AVREPIG - AVSCEF - AVSCEG - AVSEL - AVSL - AVSLB - AVSLDB - AVSRA - AVSRAB - AVSRL - AVSRLB - AVSEG - AVSEGB - AVSEGH - AVSEGF - AVST - AVSTEH - AVSTEF - AVSTEG - AVSTEB - AVSTM - AVSTL - AVSTRC - AVSTRCB - AVSTRCH - AVSTRCF - AVSTRCBS - AVSTRCHS - AVSTRCFS - AVSTRCZB - AVSTRCZH - AVSTRCZF - AVSTRCZBS - AVSTRCZHS - AVSTRCZFS - AVS - AVSB - AVSH - AVSF - AVSG - AVSQ - AVSCBI - AVSCBIB - AVSCBIH - AVSCBIF - AVSCBIG - AVSCBIQ - AVSBCBI - AVSBCBIQ - AVSBI - AVSBIQ - AVSUMG - AVSUMGH - AVSUMGF - AVSUMQ - AVSUMQF - AVSUMQG - AVSUM - AVSUMB - AVSUMH - AVTM - AVUPH - AVUPHB - AVUPHH - AVUPHF - AVUPLH - AVUPLHB - AVUPLHH - AVUPLHF - AVUPLL - AVUPLLB - AVUPLLH - AVUPLLF - AVUPL - AVUPLB - AVUPLHW - AVUPLF - - // binary - ABYTE - AWORD - ADWORD - - // end marker - ALAST - - // aliases - ABR = obj.AJMP - ABL = obj.ACALL -) diff --git a/vendor/github.com/google/gops/internal/obj/s390x/anames.go b/vendor/github.com/google/gops/internal/obj/s390x/anames.go deleted file mode 100644 index b7e49e2d..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/anames.go +++ /dev/null @@ -1,675 +0,0 @@ -// Generated by stringer -i a.out.go -o anames.go -p s390x -// Do not edit. - -package s390x - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ - obj.A_ARCHSPECIFIC: "ADD", - "ADDC", - "ADDE", - "ADDW", - "DIVW", - "DIVWU", - "DIVD", - "DIVDU", - "MODW", - "MODWU", - "MODD", - "MODDU", - "MULLW", - "MULLD", - "MULHD", - "MULHDU", - "SUB", - "SUBC", - "SUBV", - "SUBE", - "SUBW", - "NEG", - "NEGW", - "MOVWBR", - "MOVB", - "MOVBZ", - "MOVH", - "MOVHBR", - "MOVHZ", - "MOVW", - "MOVWZ", - "MOVD", - "MOVDBR", - "MOVDEQ", - "MOVDGE", - "MOVDGT", - "MOVDLE", - "MOVDLT", - "MOVDNE", - "FLOGR", - "AND", - "ANDW", - "OR", - "ORW", - "XOR", - "XORW", - "SLW", - "SLD", - "SRW", - "SRAW", - "SRD", - "SRAD", - "RLL", - "RLLG", - "FABS", - "FADD", - "FADDS", - "FCMPO", - "FCMPU", - "CEBR", - "FDIV", - "FDIVS", - "FMADD", - "FMADDS", - "FMOVD", - "FMOVS", - "FMSUB", - "FMSUBS", - "FMUL", - "FMULS", - "FNABS", - "FNEG", - "FNEGS", - "FNMADD", - "FNMADDS", - "FNMSUB", - "FNMSUBS", - "LEDBR", - "LDEBR", - "FSUB", - "FSUBS", - "FSQRT", - "FSQRTS", - "FIEBR", - "FIDBR", - "CEFBRA", - "CDFBRA", - "CEGBRA", - "CDGBRA", - "CFEBRA", - "CFDBRA", - "CGEBRA", - "CGDBRA", - "CELFBR", - "CDLFBR", - "CELGBR", - "CDLGBR", - "CLFEBR", - "CLFDBR", - "CLGEBR", - "CLGDBR", - "CMP", - "CMPU", - "CMPW", - "CMPWU", - "CS", - "CSG", - "SYNC", - "BC", - "BCL", - "BEQ", - "BGE", - "BGT", - "BLE", - "BLT", - "BLEU", - "BLTU", - "BNE", - "BVC", - "BVS", - "SYSCALL", - "CMPBEQ", - "CMPBGE", - "CMPBGT", - "CMPBLE", - "CMPBLT", - "CMPBNE", - "CMPUBEQ", - "CMPUBGE", - "CMPUBGT", - "CMPUBLE", - "CMPUBLT", - "CMPUBNE", - "MVC", - "CLC", - "XC", - "OC", - "NC", - "EXRL", - "LARL", - "LA", - "LAY", - "LAA", - "LAAG", - "LAAL", - "LAALG", - "LAN", - "LANG", - "LAX", - "LAXG", - "LAO", - "LAOG", - "LMY", - "LMG", - "STMY", - "STMG", - "STCK", - "STCKC", - "STCKE", - "STCKF", - "CLEAR", - "VA", - "VAB", - "VAH", - "VAF", - "VAG", - "VAQ", - "VACC", - "VACCB", - "VACCH", - "VACCF", - "VACCG", - "VACCQ", - "VAC", - "VACQ", - "VACCC", - "VACCCQ", - "VN", - "VNC", - "VAVG", - "VAVGB", - "VAVGH", - "VAVGF", - "VAVGG", - "VAVGL", - "VAVGLB", - "VAVGLH", - "VAVGLF", - "VAVGLG", - "VCKSM", - "VCEQ", - "VCEQB", - "VCEQH", - "VCEQF", - "VCEQG", - "VCEQBS", - "VCEQHS", - "VCEQFS", - "VCEQGS", - "VCH", - "VCHB", - "VCHH", - "VCHF", - "VCHG", - "VCHBS", - "VCHHS", - "VCHFS", - "VCHGS", - "VCHL", - "VCHLB", - "VCHLH", - "VCHLF", - "VCHLG", - "VCHLBS", - "VCHLHS", - "VCHLFS", - "VCHLGS", - "VCLZ", - "VCLZB", - "VCLZH", - "VCLZF", - "VCLZG", - "VCTZ", - "VCTZB", - "VCTZH", - "VCTZF", - "VCTZG", - "VEC", - "VECB", - "VECH", - "VECF", - "VECG", - "VECL", - "VECLB", - "VECLH", - "VECLF", - "VECLG", - "VERIM", - "VERIMB", - "VERIMH", - "VERIMF", - "VERIMG", - "VERLL", - "VERLLB", - "VERLLH", - "VERLLF", - "VERLLG", - "VERLLV", - "VERLLVB", - "VERLLVH", - "VERLLVF", - "VERLLVG", - "VESLV", - "VESLVB", - "VESLVH", - "VESLVF", - "VESLVG", - "VESL", - "VESLB", - "VESLH", - "VESLF", - "VESLG", - "VESRA", - "VESRAB", - "VESRAH", - "VESRAF", - "VESRAG", - "VESRAV", - "VESRAVB", - "VESRAVH", - "VESRAVF", - "VESRAVG", - "VESRL", - "VESRLB", - "VESRLH", - "VESRLF", - "VESRLG", - "VESRLV", - "VESRLVB", - "VESRLVH", - "VESRLVF", - "VESRLVG", - "VX", - "VFAE", - "VFAEB", - "VFAEH", - "VFAEF", - "VFAEBS", - "VFAEHS", - "VFAEFS", - "VFAEZB", - "VFAEZH", - "VFAEZF", - "VFAEZBS", - "VFAEZHS", - "VFAEZFS", - "VFEE", - "VFEEB", - "VFEEH", - "VFEEF", - "VFEEBS", - "VFEEHS", - "VFEEFS", - "VFEEZB", - "VFEEZH", - "VFEEZF", - "VFEEZBS", - "VFEEZHS", - "VFEEZFS", - "VFENE", - "VFENEB", - "VFENEH", - "VFENEF", - "VFENEBS", - "VFENEHS", - "VFENEFS", - "VFENEZB", - "VFENEZH", - "VFENEZF", - "VFENEZBS", - "VFENEZHS", - "VFENEZFS", - "VFA", - "VFADB", - "WFADB", - "WFK", - "WFKDB", - "VFCE", - "VFCEDB", - "VFCEDBS", - "WFCEDB", - "WFCEDBS", - "VFCH", - "VFCHDB", - "VFCHDBS", - "WFCHDB", - "WFCHDBS", - "VFCHE", - "VFCHEDB", - "VFCHEDBS", - "WFCHEDB", - "WFCHEDBS", - "WFC", - "WFCDB", - "VCDG", - "VCDGB", - "WCDGB", - "VCDLG", - "VCDLGB", - "WCDLGB", - "VCGD", - "VCGDB", - "WCGDB", - "VCLGD", - "VCLGDB", - "WCLGDB", - "VFD", - "VFDDB", - "WFDDB", - "VLDE", - "VLDEB", - "WLDEB", - "VLED", - "VLEDB", - "WLEDB", - "VFM", - "VFMDB", - "WFMDB", - "VFMA", - "VFMADB", - "WFMADB", - "VFMS", - "VFMSDB", - "WFMSDB", - "VFPSO", - "VFPSODB", - "WFPSODB", - "VFLCDB", - "WFLCDB", - "VFLNDB", - "WFLNDB", - "VFLPDB", - "WFLPDB", - "VFSQ", - "VFSQDB", - "WFSQDB", - "VFS", - "VFSDB", - "WFSDB", - "VFTCI", - "VFTCIDB", - "WFTCIDB", - "VGFM", - "VGFMB", - "VGFMH", - "VGFMF", - "VGFMG", - "VGFMA", - "VGFMAB", - "VGFMAH", - "VGFMAF", - "VGFMAG", - "VGEF", - "VGEG", - "VGBM", - "VZERO", - "VONE", - "VGM", - "VGMB", - "VGMH", - "VGMF", - "VGMG", - "VISTR", - "VISTRB", - "VISTRH", - "VISTRF", - "VISTRBS", - "VISTRHS", - "VISTRFS", - "VL", - "VLR", - "VLREP", - "VLREPB", - "VLREPH", - "VLREPF", - "VLREPG", - "VLC", - "VLCB", - "VLCH", - "VLCF", - "VLCG", - "VLEH", - "VLEF", - "VLEG", - "VLEB", - "VLEIH", - "VLEIF", - "VLEIG", - "VLEIB", - "VFI", - "VFIDB", - "WFIDB", - "VLGV", - "VLGVB", - "VLGVH", - "VLGVF", - "VLGVG", - "VLLEZ", - "VLLEZB", - "VLLEZH", - "VLLEZF", - "VLLEZG", - "VLM", - "VLP", - "VLPB", - "VLPH", - "VLPF", - "VLPG", - "VLBB", - "VLVG", - "VLVGB", - "VLVGH", - "VLVGF", - "VLVGG", - "VLVGP", - "VLL", - "VMX", - "VMXB", - "VMXH", - "VMXF", - "VMXG", - "VMXL", - "VMXLB", - "VMXLH", - "VMXLF", - "VMXLG", - "VMRH", - "VMRHB", - "VMRHH", - "VMRHF", - "VMRHG", - "VMRL", - "VMRLB", - "VMRLH", - "VMRLF", - "VMRLG", - "VMN", - "VMNB", - "VMNH", - "VMNF", - "VMNG", - "VMNL", - "VMNLB", - "VMNLH", - "VMNLF", - "VMNLG", - "VMAE", - "VMAEB", - "VMAEH", - "VMAEF", - "VMAH", - "VMAHB", - "VMAHH", - "VMAHF", - "VMALE", - "VMALEB", - "VMALEH", - "VMALEF", - "VMALH", - "VMALHB", - "VMALHH", - "VMALHF", - "VMALO", - "VMALOB", - "VMALOH", - "VMALOF", - "VMAL", - "VMALB", - "VMALHW", - "VMALF", - "VMAO", - "VMAOB", - "VMAOH", - "VMAOF", - "VME", - "VMEB", - "VMEH", - "VMEF", - "VMH", - "VMHB", - "VMHH", - "VMHF", - "VMLE", - "VMLEB", - "VMLEH", - "VMLEF", - "VMLH", - "VMLHB", - "VMLHH", - "VMLHF", - "VMLO", - "VMLOB", - "VMLOH", - "VMLOF", - "VML", - "VMLB", - "VMLHW", - "VMLF", - "VMO", - "VMOB", - "VMOH", - "VMOF", - "VNO", - "VNOT", - "VO", - "VPK", - "VPKH", - "VPKF", - "VPKG", - "VPKLS", - "VPKLSH", - "VPKLSF", - "VPKLSG", - "VPKLSHS", - "VPKLSFS", - "VPKLSGS", - "VPKS", - "VPKSH", - "VPKSF", - "VPKSG", - "VPKSHS", - "VPKSFS", - "VPKSGS", - "VPERM", - "VPDI", - "VPOPCT", - "VREP", - "VREPB", - "VREPH", - "VREPF", - "VREPG", - "VREPI", - "VREPIB", - "VREPIH", - "VREPIF", - "VREPIG", - "VSCEF", - "VSCEG", - "VSEL", - "VSL", - "VSLB", - "VSLDB", - "VSRA", - "VSRAB", - "VSRL", - "VSRLB", - "VSEG", - "VSEGB", - "VSEGH", - "VSEGF", - "VST", - "VSTEH", - "VSTEF", - "VSTEG", - "VSTEB", - "VSTM", - "VSTL", - "VSTRC", - "VSTRCB", - "VSTRCH", - "VSTRCF", - "VSTRCBS", - "VSTRCHS", - "VSTRCFS", - "VSTRCZB", - "VSTRCZH", - "VSTRCZF", - "VSTRCZBS", - "VSTRCZHS", - "VSTRCZFS", - "VS", - "VSB", - "VSH", - "VSF", - "VSG", - "VSQ", - "VSCBI", - "VSCBIB", - "VSCBIH", - "VSCBIF", - "VSCBIG", - "VSCBIQ", - "VSBCBI", - "VSBCBIQ", - "VSBI", - "VSBIQ", - "VSUMG", - "VSUMGH", - "VSUMGF", - "VSUMQ", - "VSUMQF", - "VSUMQG", - "VSUM", - "VSUMB", - "VSUMH", - "VTM", - "VUPH", - "VUPHB", - "VUPHH", - "VUPHF", - "VUPLH", - "VUPLHB", - "VUPLHH", - "VUPLHF", - "VUPLL", - "VUPLLB", - "VUPLLH", - "VUPLLF", - "VUPL", - "VUPLB", - "VUPLHW", - "VUPLF", - "BYTE", - "WORD", - "DWORD", - "LAST", -} diff --git a/vendor/github.com/google/gops/internal/obj/s390x/anamesz.go b/vendor/github.com/google/gops/internal/obj/s390x/anamesz.go deleted file mode 100644 index 9c9b4d58..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/anamesz.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package s390x - -var cnamesz = []string{ - "NONE", - "REG", - "FREG", - "VREG", - "AREG", - "ZCON", - "SCON", - "UCON", - "ADDCON", - "ANDCON", - "LCON", - "DCON", - "SACON", - "LACON", - "DACON", - "SBRA", - "LBRA", - "SAUTO", - "LAUTO", - "ZOREG", - "SOREG", - "LOREG", - "TLS_LE", - "TLS_IE", - "GOK", - "ADDR", - "SYMADDR", - "GOTADDR", - "TEXTSIZE", - "ANY", - "NCLASS", -} diff --git a/vendor/github.com/google/gops/internal/obj/s390x/asmz.go b/vendor/github.com/google/gops/internal/obj/s390x/asmz.go deleted file mode 100644 index e3116462..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/asmz.go +++ /dev/null @@ -1,4766 +0,0 @@ -// Based on cmd/internal/obj/ppc64/asm9.go. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package s390x - -import ( - "log" - "math" - "sort" - - "github.com/google/gops/internal/obj" -) - -// instruction layout. -const ( - funcAlign = 16 -) - -type Optab struct { - as obj.As // opcode - a1 uint8 // From - a2 uint8 // Reg - a3 uint8 // From3 - a4 uint8 // To - type_ int8 - param int16 // REGSP for auto variables -} - -var optab = []Optab{ - // instruction, From, Reg, From3, To, type, param - Optab{obj.ATEXT, C_ADDR, C_NONE, C_NONE, C_TEXTSIZE, 0, 0}, - Optab{obj.ATEXT, C_ADDR, C_NONE, C_LCON, C_TEXTSIZE, 0, 0}, - - // move register - Optab{AMOVD, C_REG, C_NONE, C_NONE, C_REG, 1, 0}, - Optab{AMOVB, C_REG, C_NONE, C_NONE, C_REG, 1, 0}, - Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_REG, 1, 0}, - Optab{AMOVW, C_REG, C_NONE, C_NONE, C_REG, 1, 0}, - Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_REG, 1, 0}, - Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_FREG, 1, 0}, - Optab{AMOVDBR, C_REG, C_NONE, C_NONE, C_REG, 1, 0}, - - // load constant - Optab{AMOVD, C_LACON, C_NONE, C_NONE, C_REG, 26, REGSP}, - Optab{AMOVW, C_LACON, C_NONE, C_NONE, C_REG, 26, REGSP}, - Optab{AMOVWZ, C_LACON, C_NONE, C_NONE, C_REG, 26, REGSP}, - Optab{AMOVD, C_DCON, C_NONE, C_NONE, C_REG, 3, 0}, - Optab{AMOVW, C_DCON, C_NONE, C_NONE, C_REG, 3, 0}, - Optab{AMOVWZ, C_DCON, C_NONE, C_NONE, C_REG, 3, 0}, - Optab{AMOVB, C_DCON, C_NONE, C_NONE, C_REG, 3, 0}, - Optab{AMOVBZ, C_DCON, C_NONE, C_NONE, C_REG, 3, 0}, - - // store constant - Optab{AMOVD, C_LCON, C_NONE, C_NONE, C_ADDR, 73, 0}, - Optab{AMOVW, C_LCON, C_NONE, C_NONE, C_ADDR, 73, 0}, - Optab{AMOVWZ, C_LCON, C_NONE, C_NONE, C_ADDR, 73, 0}, - Optab{AMOVBZ, C_LCON, C_NONE, C_NONE, C_ADDR, 73, 0}, - Optab{AMOVB, C_LCON, C_NONE, C_NONE, C_ADDR, 73, 0}, - Optab{AMOVD, C_LCON, C_NONE, C_NONE, C_LAUTO, 72, REGSP}, - Optab{AMOVW, C_LCON, C_NONE, C_NONE, C_LAUTO, 72, REGSP}, - Optab{AMOVWZ, C_LCON, C_NONE, C_NONE, C_LAUTO, 72, REGSP}, - Optab{AMOVB, C_LCON, C_NONE, C_NONE, C_LAUTO, 72, REGSP}, - Optab{AMOVBZ, C_LCON, C_NONE, C_NONE, C_LAUTO, 72, REGSP}, - Optab{AMOVD, C_LCON, C_NONE, C_NONE, C_LOREG, 72, 0}, - Optab{AMOVW, C_LCON, C_NONE, C_NONE, C_LOREG, 72, 0}, - Optab{AMOVWZ, C_LCON, C_NONE, C_NONE, C_LOREG, 72, 0}, - Optab{AMOVB, C_LCON, C_NONE, C_NONE, C_LOREG, 72, 0}, - Optab{AMOVBZ, C_LCON, C_NONE, C_NONE, C_LOREG, 72, 0}, - - // store - Optab{AMOVD, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVW, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVB, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVDBR, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVHBR, C_REG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AMOVD, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVW, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVB, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVDBR, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVHBR, C_REG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AMOVD, C_REG, C_NONE, C_NONE, C_ADDR, 74, 0}, - Optab{AMOVW, C_REG, C_NONE, C_NONE, C_ADDR, 74, 0}, - Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_ADDR, 74, 0}, - Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_ADDR, 74, 0}, - Optab{AMOVB, C_REG, C_NONE, C_NONE, C_ADDR, 74, 0}, - - // load - Optab{AMOVD, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVW, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVWZ, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVBZ, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVB, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVDBR, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVHBR, C_LAUTO, C_NONE, C_NONE, C_REG, 36, REGSP}, - Optab{AMOVD, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVW, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVWZ, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVBZ, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVB, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVDBR, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVHBR, C_LOREG, C_NONE, C_NONE, C_REG, 36, 0}, - Optab{AMOVD, C_ADDR, C_NONE, C_NONE, C_REG, 75, 0}, - Optab{AMOVW, C_ADDR, C_NONE, C_NONE, C_REG, 75, 0}, - Optab{AMOVWZ, C_ADDR, C_NONE, C_NONE, C_REG, 75, 0}, - Optab{AMOVBZ, C_ADDR, C_NONE, C_NONE, C_REG, 75, 0}, - Optab{AMOVB, C_ADDR, C_NONE, C_NONE, C_REG, 75, 0}, - - // interlocked load and op - Optab{ALAAG, C_REG, C_REG, C_NONE, C_LOREG, 99, 0}, - - // integer arithmetic - Optab{AADD, C_REG, C_REG, C_NONE, C_REG, 2, 0}, - Optab{AADD, C_REG, C_NONE, C_NONE, C_REG, 2, 0}, - Optab{AADD, C_LCON, C_REG, C_NONE, C_REG, 22, 0}, - Optab{AADD, C_LCON, C_NONE, C_NONE, C_REG, 22, 0}, - Optab{AADD, C_LOREG, C_NONE, C_NONE, C_REG, 12, 0}, - Optab{AADD, C_LAUTO, C_NONE, C_NONE, C_REG, 12, REGSP}, - Optab{ASUB, C_LCON, C_REG, C_NONE, C_REG, 21, 0}, - Optab{ASUB, C_LCON, C_NONE, C_NONE, C_REG, 21, 0}, - Optab{ASUB, C_LOREG, C_NONE, C_NONE, C_REG, 12, 0}, - Optab{ASUB, C_LAUTO, C_NONE, C_NONE, C_REG, 12, REGSP}, - Optab{AMULHD, C_REG, C_NONE, C_NONE, C_REG, 4, 0}, - Optab{AMULHD, C_REG, C_REG, C_NONE, C_REG, 4, 0}, - Optab{ADIVW, C_REG, C_REG, C_NONE, C_REG, 2, 0}, - Optab{ADIVW, C_REG, C_NONE, C_NONE, C_REG, 2, 0}, - Optab{ASUB, C_REG, C_REG, C_NONE, C_REG, 10, 0}, - Optab{ASUB, C_REG, C_NONE, C_NONE, C_REG, 10, 0}, - Optab{ANEG, C_REG, C_NONE, C_NONE, C_REG, 47, 0}, - Optab{ANEG, C_NONE, C_NONE, C_NONE, C_REG, 47, 0}, - - // integer logical - Optab{AAND, C_REG, C_REG, C_NONE, C_REG, 6, 0}, - Optab{AAND, C_REG, C_NONE, C_NONE, C_REG, 6, 0}, - Optab{AAND, C_LCON, C_NONE, C_NONE, C_REG, 23, 0}, - Optab{AAND, C_LOREG, C_NONE, C_NONE, C_REG, 12, 0}, - Optab{AAND, C_LAUTO, C_NONE, C_NONE, C_REG, 12, REGSP}, - Optab{AANDW, C_REG, C_REG, C_NONE, C_REG, 6, 0}, - Optab{AANDW, C_REG, C_NONE, C_NONE, C_REG, 6, 0}, - Optab{AANDW, C_LCON, C_NONE, C_NONE, C_REG, 24, 0}, - Optab{AANDW, C_LOREG, C_NONE, C_NONE, C_REG, 12, 0}, - Optab{AANDW, C_LAUTO, C_NONE, C_NONE, C_REG, 12, REGSP}, - Optab{ASLD, C_REG, C_NONE, C_NONE, C_REG, 7, 0}, - Optab{ASLD, C_REG, C_REG, C_NONE, C_REG, 7, 0}, - Optab{ASLD, C_SCON, C_REG, C_NONE, C_REG, 7, 0}, - Optab{ASLD, C_SCON, C_NONE, C_NONE, C_REG, 7, 0}, - - // compare and swap - Optab{ACSG, C_REG, C_REG, C_NONE, C_SOREG, 79, 0}, - - // floating point - Optab{AFADD, C_FREG, C_NONE, C_NONE, C_FREG, 2, 0}, - Optab{AFADD, C_FREG, C_FREG, C_NONE, C_FREG, 2, 0}, - Optab{AFABS, C_FREG, C_NONE, C_NONE, C_FREG, 33, 0}, - Optab{AFABS, C_NONE, C_NONE, C_NONE, C_FREG, 33, 0}, - Optab{AFMADD, C_FREG, C_FREG, C_FREG, C_FREG, 34, 0}, - Optab{AFMUL, C_FREG, C_NONE, C_NONE, C_FREG, 32, 0}, - Optab{AFMUL, C_FREG, C_FREG, C_NONE, C_FREG, 32, 0}, - Optab{AFMOVD, C_LAUTO, C_NONE, C_NONE, C_FREG, 36, REGSP}, - Optab{AFMOVD, C_LOREG, C_NONE, C_NONE, C_FREG, 36, 0}, - Optab{AFMOVD, C_ADDR, C_NONE, C_NONE, C_FREG, 75, 0}, - Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_LAUTO, 35, REGSP}, - Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_LOREG, 35, 0}, - Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_ADDR, 74, 0}, - Optab{AFMOVD, C_ZCON, C_NONE, C_NONE, C_FREG, 67, 0}, - Optab{ACEFBRA, C_REG, C_NONE, C_NONE, C_FREG, 82, 0}, - Optab{ACFEBRA, C_FREG, C_NONE, C_NONE, C_REG, 83, 0}, - Optab{AFIEBR, C_SCON, C_FREG, C_NONE, C_FREG, 48, 0}, - - // load symbol address (plus offset) - Optab{AMOVD, C_SYMADDR, C_NONE, C_NONE, C_REG, 19, 0}, - Optab{AMOVD, C_GOTADDR, C_NONE, C_NONE, C_REG, 93, 0}, - Optab{AMOVD, C_TLS_LE, C_NONE, C_NONE, C_REG, 94, 0}, - Optab{AMOVD, C_TLS_IE, C_NONE, C_NONE, C_REG, 95, 0}, - - // system call - Optab{ASYSCALL, C_NONE, C_NONE, C_NONE, C_NONE, 5, 0}, - Optab{ASYSCALL, C_SCON, C_NONE, C_NONE, C_NONE, 77, 0}, - - // branch - Optab{ABEQ, C_NONE, C_NONE, C_NONE, C_SBRA, 16, 0}, - Optab{ABR, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 0}, - Optab{ABC, C_SCON, C_REG, C_NONE, C_LBRA, 16, 0}, - Optab{ABR, C_NONE, C_NONE, C_NONE, C_REG, 18, 0}, - Optab{ABR, C_REG, C_NONE, C_NONE, C_REG, 18, 0}, - Optab{ABR, C_NONE, C_NONE, C_NONE, C_ZOREG, 15, 0}, - Optab{ABC, C_NONE, C_NONE, C_NONE, C_ZOREG, 15, 0}, - Optab{ACMPBEQ, C_REG, C_REG, C_NONE, C_SBRA, 89, 0}, - Optab{ACMPBEQ, C_REG, C_NONE, C_ADDCON, C_SBRA, 90, 0}, - Optab{ACMPBEQ, C_REG, C_NONE, C_SCON, C_SBRA, 90, 0}, - Optab{ACMPUBEQ, C_REG, C_REG, C_NONE, C_SBRA, 89, 0}, - Optab{ACMPUBEQ, C_REG, C_NONE, C_ANDCON, C_SBRA, 90, 0}, - - // move on condition - Optab{AMOVDEQ, C_REG, C_NONE, C_NONE, C_REG, 17, 0}, - - // find leftmost one - Optab{AFLOGR, C_REG, C_NONE, C_NONE, C_REG, 8, 0}, - - // compare - Optab{ACMP, C_REG, C_NONE, C_NONE, C_REG, 70, 0}, - Optab{ACMP, C_REG, C_NONE, C_NONE, C_LCON, 71, 0}, - Optab{ACMPU, C_REG, C_NONE, C_NONE, C_REG, 70, 0}, - Optab{ACMPU, C_REG, C_NONE, C_NONE, C_LCON, 71, 0}, - Optab{AFCMPO, C_FREG, C_NONE, C_NONE, C_FREG, 70, 0}, - Optab{AFCMPO, C_FREG, C_REG, C_NONE, C_FREG, 70, 0}, - - // 32-bit access registers - Optab{AMOVW, C_AREG, C_NONE, C_NONE, C_REG, 68, 0}, - Optab{AMOVWZ, C_AREG, C_NONE, C_NONE, C_REG, 68, 0}, - Optab{AMOVW, C_REG, C_NONE, C_NONE, C_AREG, 69, 0}, - Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_AREG, 69, 0}, - - // macros - Optab{ACLEAR, C_LCON, C_NONE, C_NONE, C_LOREG, 96, 0}, - Optab{ACLEAR, C_LCON, C_NONE, C_NONE, C_LAUTO, 96, REGSP}, - - // load/store multiple - Optab{ASTMG, C_REG, C_REG, C_NONE, C_LOREG, 97, 0}, - Optab{ASTMG, C_REG, C_REG, C_NONE, C_LAUTO, 97, REGSP}, - Optab{ALMG, C_LOREG, C_REG, C_NONE, C_REG, 98, 0}, - Optab{ALMG, C_LAUTO, C_REG, C_NONE, C_REG, 98, REGSP}, - - // bytes - Optab{ABYTE, C_SCON, C_NONE, C_NONE, C_NONE, 40, 0}, - Optab{AWORD, C_LCON, C_NONE, C_NONE, C_NONE, 40, 0}, - Optab{ADWORD, C_LCON, C_NONE, C_NONE, C_NONE, 31, 0}, - Optab{ADWORD, C_DCON, C_NONE, C_NONE, C_NONE, 31, 0}, - - // fast synchronization - Optab{ASYNC, C_NONE, C_NONE, C_NONE, C_NONE, 81, 0}, - - // store clock - Optab{ASTCK, C_NONE, C_NONE, C_NONE, C_SAUTO, 88, REGSP}, - Optab{ASTCK, C_NONE, C_NONE, C_NONE, C_SOREG, 88, 0}, - - // storage and storage - Optab{AMVC, C_LOREG, C_NONE, C_SCON, C_LOREG, 84, 0}, - Optab{AMVC, C_LOREG, C_NONE, C_SCON, C_LAUTO, 84, REGSP}, - Optab{AMVC, C_LAUTO, C_NONE, C_SCON, C_LAUTO, 84, REGSP}, - - // address - Optab{ALARL, C_LCON, C_NONE, C_NONE, C_REG, 85, 0}, - Optab{ALARL, C_SYMADDR, C_NONE, C_NONE, C_REG, 85, 0}, - Optab{ALA, C_SOREG, C_NONE, C_NONE, C_REG, 86, 0}, - Optab{ALA, C_SAUTO, C_NONE, C_NONE, C_REG, 86, REGSP}, - Optab{AEXRL, C_SYMADDR, C_NONE, C_NONE, C_REG, 87, 0}, - - // misc - Optab{obj.AUNDEF, C_NONE, C_NONE, C_NONE, C_NONE, 78, 0}, - Optab{obj.APCDATA, C_LCON, C_NONE, C_NONE, C_LCON, 0, 0}, - Optab{obj.AFUNCDATA, C_SCON, C_NONE, C_NONE, C_ADDR, 0, 0}, - Optab{obj.ANOP, C_NONE, C_NONE, C_NONE, C_NONE, 0, 0}, - Optab{obj.ANOP, C_SAUTO, C_NONE, C_NONE, C_NONE, 0, 0}, - - // vector instructions - - // VRX store - Optab{AVST, C_VREG, C_NONE, C_NONE, C_SOREG, 100, 0}, - Optab{AVST, C_VREG, C_NONE, C_NONE, C_SAUTO, 100, REGSP}, - Optab{AVSTEG, C_VREG, C_NONE, C_SCON, C_SOREG, 100, 0}, - Optab{AVSTEG, C_VREG, C_NONE, C_SCON, C_SAUTO, 100, REGSP}, - - // VRX load - Optab{AVL, C_SOREG, C_NONE, C_NONE, C_VREG, 101, 0}, - Optab{AVL, C_SAUTO, C_NONE, C_NONE, C_VREG, 101, REGSP}, - Optab{AVLEG, C_SOREG, C_NONE, C_SCON, C_VREG, 101, 0}, - Optab{AVLEG, C_SAUTO, C_NONE, C_SCON, C_VREG, 101, REGSP}, - - // VRV scatter - Optab{AVSCEG, C_VREG, C_NONE, C_SCON, C_SOREG, 102, 0}, - Optab{AVSCEG, C_VREG, C_NONE, C_SCON, C_SAUTO, 102, REGSP}, - - // VRV gather - Optab{AVGEG, C_SOREG, C_NONE, C_SCON, C_VREG, 103, 0}, - Optab{AVGEG, C_SAUTO, C_NONE, C_SCON, C_VREG, 103, REGSP}, - - // VRS element shift/rotate and load gr to/from vr element - Optab{AVESLG, C_SCON, C_VREG, C_NONE, C_VREG, 104, 0}, - Optab{AVESLG, C_REG, C_VREG, C_NONE, C_VREG, 104, 0}, - Optab{AVESLG, C_SCON, C_NONE, C_NONE, C_VREG, 104, 0}, - Optab{AVESLG, C_REG, C_NONE, C_NONE, C_VREG, 104, 0}, - Optab{AVLGVG, C_SCON, C_VREG, C_NONE, C_REG, 104, 0}, - Optab{AVLGVG, C_REG, C_VREG, C_NONE, C_REG, 104, 0}, - Optab{AVLVGG, C_SCON, C_REG, C_NONE, C_VREG, 104, 0}, - Optab{AVLVGG, C_REG, C_REG, C_NONE, C_VREG, 104, 0}, - - // VRS store multiple - Optab{AVSTM, C_VREG, C_VREG, C_NONE, C_SOREG, 105, 0}, - Optab{AVSTM, C_VREG, C_VREG, C_NONE, C_SAUTO, 105, REGSP}, - - // VRS load multiple - Optab{AVLM, C_SOREG, C_VREG, C_NONE, C_VREG, 106, 0}, - Optab{AVLM, C_SAUTO, C_VREG, C_NONE, C_VREG, 106, REGSP}, - - // VRS store with length - Optab{AVSTL, C_VREG, C_NONE, C_REG, C_SOREG, 107, 0}, - Optab{AVSTL, C_VREG, C_NONE, C_REG, C_SAUTO, 107, REGSP}, - - // VRS load with length - Optab{AVLL, C_SOREG, C_NONE, C_REG, C_VREG, 108, 0}, - Optab{AVLL, C_SAUTO, C_NONE, C_REG, C_VREG, 108, REGSP}, - - // VRI-a - Optab{AVGBM, C_ANDCON, C_NONE, C_NONE, C_VREG, 109, 0}, - Optab{AVZERO, C_NONE, C_NONE, C_NONE, C_VREG, 109, 0}, - Optab{AVREPIG, C_ADDCON, C_NONE, C_NONE, C_VREG, 109, 0}, - Optab{AVREPIG, C_SCON, C_NONE, C_NONE, C_VREG, 109, 0}, - Optab{AVLEIG, C_ADDCON, C_NONE, C_SCON, C_VREG, 109, 0}, - Optab{AVLEIG, C_SCON, C_NONE, C_SCON, C_VREG, 109, 0}, - - // VRI-b generate mask - Optab{AVGMG, C_SCON, C_NONE, C_SCON, C_VREG, 110, 0}, - - // VRI-c replicate - Optab{AVREPG, C_UCON, C_VREG, C_NONE, C_VREG, 111, 0}, - - // VRI-d element rotate and insert under mask and - // shift left double by byte - Optab{AVERIMG, C_VREG, C_VREG, C_SCON, C_VREG, 112, 0}, - Optab{AVSLDB, C_VREG, C_VREG, C_SCON, C_VREG, 112, 0}, - - // VRI-d fp test data class immediate - Optab{AVFTCIDB, C_SCON, C_VREG, C_NONE, C_VREG, 113, 0}, - - // VRR-a load reg - Optab{AVLR, C_VREG, C_NONE, C_NONE, C_VREG, 114, 0}, - - // VRR-a compare - Optab{AVECG, C_VREG, C_NONE, C_NONE, C_VREG, 115, 0}, - - // VRR-b - Optab{AVCEQG, C_VREG, C_VREG, C_NONE, C_VREG, 117, 0}, - Optab{AVFAEF, C_VREG, C_VREG, C_NONE, C_VREG, 117, 0}, - Optab{AVPKSG, C_VREG, C_VREG, C_NONE, C_VREG, 117, 0}, - - // VRR-c - Optab{AVAQ, C_VREG, C_VREG, C_NONE, C_VREG, 118, 0}, - Optab{AVAQ, C_VREG, C_NONE, C_NONE, C_VREG, 118, 0}, - Optab{AVNOT, C_VREG, C_NONE, C_NONE, C_VREG, 118, 0}, - Optab{AVPDI, C_VREG, C_VREG, C_SCON, C_VREG, 123, 0}, - - // VRR-c shifts - Optab{AVERLLVG, C_VREG, C_VREG, C_NONE, C_VREG, 119, 0}, - Optab{AVERLLVG, C_VREG, C_NONE, C_NONE, C_VREG, 119, 0}, - - // VRR-d - // 2 3 1 4 - Optab{AVACQ, C_VREG, C_VREG, C_VREG, C_VREG, 120, 0}, - - // VRR-e - Optab{AVSEL, C_VREG, C_VREG, C_VREG, C_VREG, 121, 0}, - - // VRR-f - Optab{AVLVGP, C_REG, C_REG, C_NONE, C_VREG, 122, 0}, -} - -var oprange [ALAST & obj.AMask][]Optab - -var xcmp [C_NCLASS][C_NCLASS]bool - -func spanz(ctxt *obj.Link, cursym *obj.LSym) { - p := cursym.Text - if p == nil || p.Link == nil { // handle external functions and ELF section symbols - return - } - ctxt.Cursym = cursym - ctxt.Autosize = int32(p.To.Offset) - - if oprange[AORW&obj.AMask] == nil { - buildop(ctxt) - } - - buffer := make([]byte, 0) - changed := true - loop := 0 - for changed { - if loop > 10 { - ctxt.Diag("stuck in spanz loop") - break - } - changed = false - buffer = buffer[:0] - ctxt.Cursym.R = make([]obj.Reloc, 0) - for p := cursym.Text; p != nil; p = p.Link { - pc := int64(len(buffer)) - if pc != p.Pc { - changed = true - } - p.Pc = pc - ctxt.Pc = p.Pc - ctxt.Curp = p - asmout(ctxt, &buffer) - if pc == int64(len(buffer)) { - switch p.As { - case obj.ANOP, obj.AFUNCDATA, obj.APCDATA, obj.ATEXT: - // ok - default: - ctxt.Diag("zero-width instruction\n%v", p) - } - } - } - loop++ - } - - cursym.Size = int64(len(buffer)) - if cursym.Size%funcAlign != 0 { - cursym.Size += funcAlign - (cursym.Size % funcAlign) - } - cursym.Grow(cursym.Size) - copy(cursym.P, buffer) -} - -func isint32(v int64) bool { - return int64(int32(v)) == v -} - -func isuint32(v uint64) bool { - return uint64(uint32(v)) == v -} - -func aclass(ctxt *obj.Link, a *obj.Addr) int { - switch a.Type { - case obj.TYPE_NONE: - return C_NONE - - case obj.TYPE_REG: - if REG_R0 <= a.Reg && a.Reg <= REG_R15 { - return C_REG - } - if REG_F0 <= a.Reg && a.Reg <= REG_F15 { - return C_FREG - } - if REG_AR0 <= a.Reg && a.Reg <= REG_AR15 { - return C_AREG - } - if REG_V0 <= a.Reg && a.Reg <= REG_V31 { - return C_VREG - } - return C_GOK - - case obj.TYPE_MEM: - switch a.Name { - case obj.NAME_EXTERN, - obj.NAME_STATIC: - if a.Sym == nil { - // must have a symbol - break - } - ctxt.Instoffset = a.Offset - if a.Sym.Type == obj.STLSBSS { - if ctxt.Flag_shared { - return C_TLS_IE // initial exec model - } - return C_TLS_LE // local exec model - } - return C_ADDR - - case obj.NAME_GOTREF: - return C_GOTADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SAUTO - } - return C_LAUTO - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + ctxt.FixedFrameSize() - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SAUTO - } - return C_LAUTO - - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if ctxt.Instoffset == 0 { - return C_ZOREG - } - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SOREG - } - return C_LOREG - } - - return C_GOK - - case obj.TYPE_TEXTSIZE: - return C_TEXTSIZE - - case obj.TYPE_FCONST: - if f64, ok := a.Val.(float64); ok && math.Float64bits(f64) == 0 { - return C_ZCON - } - ctxt.Diag("cannot handle the floating point constant %v", a.Val) - - case obj.TYPE_CONST, - obj.TYPE_ADDR: - switch a.Name { - case obj.NAME_NONE: - ctxt.Instoffset = a.Offset - if a.Reg != 0 { - if -BIG <= ctxt.Instoffset && ctxt.Instoffset <= BIG { - return C_SACON - } - if isint32(ctxt.Instoffset) { - return C_LACON - } - return C_DACON - } - goto consize - - case obj.NAME_EXTERN, - obj.NAME_STATIC: - s := a.Sym - if s == nil { - break - } - ctxt.Instoffset = a.Offset - if s.Type == obj.SCONST { - goto consize - } - - return C_SYMADDR - - case obj.NAME_AUTO: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SACON - } - return C_LACON - - case obj.NAME_PARAM: - ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + ctxt.FixedFrameSize() - if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { - return C_SACON - } - return C_LACON - } - - return C_GOK - - consize: - if ctxt.Instoffset == 0 { - return C_ZCON - } - if ctxt.Instoffset >= 0 { - if ctxt.Instoffset <= 0x7fff { - return C_SCON - } - if ctxt.Instoffset <= 0xffff { - return C_ANDCON - } - if ctxt.Instoffset&0xffff == 0 && isuint32(uint64(ctxt.Instoffset)) { /* && (instoffset & (1<<31)) == 0) */ - return C_UCON - } - if isint32(ctxt.Instoffset) || isuint32(uint64(ctxt.Instoffset)) { - return C_LCON - } - return C_DCON - } - - if ctxt.Instoffset >= -0x8000 { - return C_ADDCON - } - if ctxt.Instoffset&0xffff == 0 && isint32(ctxt.Instoffset) { - return C_UCON - } - if isint32(ctxt.Instoffset) { - return C_LCON - } - return C_DCON - - case obj.TYPE_BRANCH: - return C_SBRA - } - - return C_GOK -} - -func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { - a1 := int(p.Optab) - if a1 != 0 { - return &optab[a1-1] - } - a1 = int(p.From.Class) - if a1 == 0 { - a1 = aclass(ctxt, &p.From) + 1 - p.From.Class = int8(a1) - } - - a1-- - a3 := C_NONE + 1 - if p.From3 != nil { - a3 = int(p.From3.Class) - if a3 == 0 { - a3 = aclass(ctxt, p.From3) + 1 - p.From3.Class = int8(a3) - } - } - - a3-- - a4 := int(p.To.Class) - if a4 == 0 { - a4 = aclass(ctxt, &p.To) + 1 - p.To.Class = int8(a4) - } - - a4-- - a2 := C_NONE - if p.Reg != 0 { - if REG_R0 <= p.Reg && p.Reg <= REG_R15 { - a2 = C_REG - } else if REG_V0 <= p.Reg && p.Reg <= REG_V31 { - a2 = C_VREG - } else if REG_F0 <= p.Reg && p.Reg <= REG_F15 { - a2 = C_FREG - } else if REG_AR0 <= p.Reg && p.Reg <= REG_AR15 { - a2 = C_AREG - } - } - - ops := oprange[p.As&obj.AMask] - c1 := &xcmp[a1] - c2 := &xcmp[a2] - c3 := &xcmp[a3] - c4 := &xcmp[a4] - for i := range ops { - op := &ops[i] - if (int(op.a2) == a2 || c2[op.a2]) && c4[op.a4] && c1[op.a1] && c3[op.a3] { - p.Optab = uint16(cap(optab) - cap(ops) + i + 1) - return op - } - } - - // cannot find a case; abort - ctxt.Diag("illegal combination %v %v %v %v %v\n", p.As, DRconv(a1), DRconv(a2), DRconv(a3), DRconv(a4)) - ctxt.Diag("prog: %v\n", p) - return nil -} - -func cmp(a int, b int) bool { - if a == b { - return true - } - switch a { - case C_DCON: - if b == C_LCON { - return true - } - fallthrough - case C_LCON: - if b == C_ZCON || b == C_SCON || b == C_UCON || b == C_ADDCON || b == C_ANDCON { - return true - } - - case C_ADDCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_ANDCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_UCON: - if b == C_ZCON || b == C_SCON { - return true - } - - case C_SCON: - if b == C_ZCON { - return true - } - - case C_LACON: - if b == C_SACON { - return true - } - - case C_LBRA: - if b == C_SBRA { - return true - } - - case C_LAUTO: - if b == C_SAUTO { - return true - } - - case C_LOREG: - if b == C_ZOREG || b == C_SOREG { - return true - } - - case C_SOREG: - if b == C_ZOREG { - return true - } - - case C_ANY: - return true - } - - return false -} - -type ocmp []Optab - -func (x ocmp) Len() int { - return len(x) -} - -func (x ocmp) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} - -func (x ocmp) Less(i, j int) bool { - p1 := &x[i] - p2 := &x[j] - n := int(p1.as) - int(p2.as) - if n != 0 { - return n < 0 - } - n = int(p1.a1) - int(p2.a1) - if n != 0 { - return n < 0 - } - n = int(p1.a2) - int(p2.a2) - if n != 0 { - return n < 0 - } - n = int(p1.a3) - int(p2.a3) - if n != 0 { - return n < 0 - } - n = int(p1.a4) - int(p2.a4) - if n != 0 { - return n < 0 - } - return false -} -func opset(a, b obj.As) { - oprange[a&obj.AMask] = oprange[b&obj.AMask] -} - -func buildop(ctxt *obj.Link) { - for i := 0; i < C_NCLASS; i++ { - for n := 0; n < C_NCLASS; n++ { - if cmp(n, i) { - xcmp[i][n] = true - } - } - } - sort.Sort(ocmp(optab)) - for i := 0; i < len(optab); i++ { - r := optab[i].as - start := i - for ; i+1 < len(optab); i++ { - if optab[i+1].as != r { - break - } - } - oprange[r&obj.AMask] = optab[start : i+1] - - // opset() aliases optab ranges for similar instructions, to reduce the number of optabs in the array. - // oprange[] is used by oplook() to find the Optab entry that applies to a given Prog. - switch r { - case AADD: - opset(AADDC, r) - opset(AADDW, r) - opset(AMULLD, r) - opset(AMULLW, r) - case ADIVW: - opset(AADDE, r) - opset(ADIVD, r) - opset(ADIVDU, r) - opset(ADIVWU, r) - opset(AMODD, r) - opset(AMODDU, r) - opset(AMODW, r) - opset(AMODWU, r) - case AMULHD: - opset(AMULHDU, r) - case AMOVBZ: - opset(AMOVH, r) - opset(AMOVHZ, r) - case ALA: - opset(ALAY, r) - case AMVC: - opset(ACLC, r) - opset(AXC, r) - opset(AOC, r) - opset(ANC, r) - case ASTCK: - opset(ASTCKC, r) - opset(ASTCKE, r) - opset(ASTCKF, r) - case ALAAG: - opset(ALAA, r) - opset(ALAAL, r) - opset(ALAALG, r) - opset(ALAN, r) - opset(ALANG, r) - opset(ALAX, r) - opset(ALAXG, r) - opset(ALAO, r) - opset(ALAOG, r) - case ASTMG: - opset(ASTMY, r) - case ALMG: - opset(ALMY, r) - case ABEQ: - opset(ABGE, r) - opset(ABGT, r) - opset(ABLE, r) - opset(ABLT, r) - opset(ABNE, r) - opset(ABVC, r) - opset(ABVS, r) - opset(ABLEU, r) - opset(ABLTU, r) - case ABR: - opset(ABL, r) - case ABC: - opset(ABCL, r) - case AFABS: - opset(AFNABS, r) - opset(AFNEG, r) - opset(AFNEGS, r) - opset(ALEDBR, r) - opset(ALDEBR, r) - opset(AFSQRT, r) - opset(AFSQRTS, r) - case AFADD: - opset(AFADDS, r) - opset(AFDIV, r) - opset(AFDIVS, r) - opset(AFSUB, r) - opset(AFSUBS, r) - case AFMADD: - opset(AFMADDS, r) - opset(AFMSUB, r) - opset(AFMSUBS, r) - opset(AFNMADD, r) - opset(AFNMADDS, r) - opset(AFNMSUB, r) - opset(AFNMSUBS, r) - case AFMUL: - opset(AFMULS, r) - case AFCMPO: - opset(AFCMPU, r) - opset(ACEBR, r) - case AAND: - opset(AOR, r) - opset(AXOR, r) - case AANDW: - opset(AORW, r) - opset(AXORW, r) - case ASLD: - opset(ASRD, r) - opset(ASLW, r) - opset(ASRW, r) - opset(ASRAD, r) - opset(ASRAW, r) - opset(ARLL, r) - opset(ARLLG, r) - case ACSG: - opset(ACS, r) - case ASUB: - opset(ASUBC, r) - opset(ASUBE, r) - opset(ASUBW, r) - case ANEG: - opset(ANEGW, r) - case AFMOVD: - opset(AFMOVS, r) - case AMOVDBR: - opset(AMOVWBR, r) - case ACMP: - opset(ACMPW, r) - case ACMPU: - opset(ACMPWU, r) - case ACEFBRA: - opset(ACDFBRA, r) - opset(ACEGBRA, r) - opset(ACDGBRA, r) - opset(ACELFBR, r) - opset(ACDLFBR, r) - opset(ACELGBR, r) - opset(ACDLGBR, r) - case ACFEBRA: - opset(ACFDBRA, r) - opset(ACGEBRA, r) - opset(ACGDBRA, r) - opset(ACLFEBR, r) - opset(ACLFDBR, r) - opset(ACLGEBR, r) - opset(ACLGDBR, r) - case AFIEBR: - opset(AFIDBR, r) - case ACMPBEQ: - opset(ACMPBGE, r) - opset(ACMPBGT, r) - opset(ACMPBLE, r) - opset(ACMPBLT, r) - opset(ACMPBNE, r) - case ACMPUBEQ: - opset(ACMPUBGE, r) - opset(ACMPUBGT, r) - opset(ACMPUBLE, r) - opset(ACMPUBLT, r) - opset(ACMPUBNE, r) - case AMOVDEQ: - opset(AMOVDGE, r) - opset(AMOVDGT, r) - opset(AMOVDLE, r) - opset(AMOVDLT, r) - opset(AMOVDNE, r) - case AVL: - opset(AVLLEZB, r) - opset(AVLLEZH, r) - opset(AVLLEZF, r) - opset(AVLLEZG, r) - opset(AVLREPB, r) - opset(AVLREPH, r) - opset(AVLREPF, r) - opset(AVLREPG, r) - case AVLEG: - opset(AVLBB, r) - opset(AVLEB, r) - opset(AVLEH, r) - opset(AVLEF, r) - opset(AVLEG, r) - opset(AVLREP, r) - case AVSTEG: - opset(AVSTEB, r) - opset(AVSTEH, r) - opset(AVSTEF, r) - case AVSCEG: - opset(AVSCEF, r) - case AVGEG: - opset(AVGEF, r) - case AVESLG: - opset(AVESLB, r) - opset(AVESLH, r) - opset(AVESLF, r) - opset(AVERLLB, r) - opset(AVERLLH, r) - opset(AVERLLF, r) - opset(AVERLLG, r) - opset(AVESRAB, r) - opset(AVESRAH, r) - opset(AVESRAF, r) - opset(AVESRAG, r) - opset(AVESRLB, r) - opset(AVESRLH, r) - opset(AVESRLF, r) - opset(AVESRLG, r) - case AVLGVG: - opset(AVLGVB, r) - opset(AVLGVH, r) - opset(AVLGVF, r) - case AVLVGG: - opset(AVLVGB, r) - opset(AVLVGH, r) - opset(AVLVGF, r) - case AVZERO: - opset(AVONE, r) - case AVREPIG: - opset(AVREPIB, r) - opset(AVREPIH, r) - opset(AVREPIF, r) - case AVLEIG: - opset(AVLEIB, r) - opset(AVLEIH, r) - opset(AVLEIF, r) - case AVGMG: - opset(AVGMB, r) - opset(AVGMH, r) - opset(AVGMF, r) - case AVREPG: - opset(AVREPB, r) - opset(AVREPH, r) - opset(AVREPF, r) - case AVERIMG: - opset(AVERIMB, r) - opset(AVERIMH, r) - opset(AVERIMF, r) - case AVFTCIDB: - opset(AWFTCIDB, r) - case AVLR: - opset(AVUPHB, r) - opset(AVUPHH, r) - opset(AVUPHF, r) - opset(AVUPLHB, r) - opset(AVUPLHH, r) - opset(AVUPLHF, r) - opset(AVUPLB, r) - opset(AVUPLHW, r) - opset(AVUPLF, r) - opset(AVUPLLB, r) - opset(AVUPLLH, r) - opset(AVUPLLF, r) - opset(AVCLZB, r) - opset(AVCLZH, r) - opset(AVCLZF, r) - opset(AVCLZG, r) - opset(AVCTZB, r) - opset(AVCTZH, r) - opset(AVCTZF, r) - opset(AVCTZG, r) - opset(AVLDEB, r) - opset(AWLDEB, r) - opset(AVFLCDB, r) - opset(AWFLCDB, r) - opset(AVFLNDB, r) - opset(AWFLNDB, r) - opset(AVFLPDB, r) - opset(AWFLPDB, r) - opset(AVFSQDB, r) - opset(AWFSQDB, r) - opset(AVISTRB, r) - opset(AVISTRH, r) - opset(AVISTRF, r) - opset(AVISTRBS, r) - opset(AVISTRHS, r) - opset(AVISTRFS, r) - opset(AVLCB, r) - opset(AVLCH, r) - opset(AVLCF, r) - opset(AVLCG, r) - opset(AVLPB, r) - opset(AVLPH, r) - opset(AVLPF, r) - opset(AVLPG, r) - opset(AVPOPCT, r) - opset(AVSEGB, r) - opset(AVSEGH, r) - opset(AVSEGF, r) - case AVECG: - opset(AVECB, r) - opset(AVECH, r) - opset(AVECF, r) - opset(AVECLB, r) - opset(AVECLH, r) - opset(AVECLF, r) - opset(AVECLG, r) - opset(AWFCDB, r) - opset(AWFKDB, r) - case AVCEQG: - opset(AVCEQB, r) - opset(AVCEQH, r) - opset(AVCEQF, r) - opset(AVCEQBS, r) - opset(AVCEQHS, r) - opset(AVCEQFS, r) - opset(AVCEQGS, r) - opset(AVCHB, r) - opset(AVCHH, r) - opset(AVCHF, r) - opset(AVCHG, r) - opset(AVCHBS, r) - opset(AVCHHS, r) - opset(AVCHFS, r) - opset(AVCHGS, r) - opset(AVCHLB, r) - opset(AVCHLH, r) - opset(AVCHLF, r) - opset(AVCHLG, r) - opset(AVCHLBS, r) - opset(AVCHLHS, r) - opset(AVCHLFS, r) - opset(AVCHLGS, r) - case AVFAEF: - opset(AVFAEB, r) - opset(AVFAEH, r) - opset(AVFAEBS, r) - opset(AVFAEHS, r) - opset(AVFAEFS, r) - opset(AVFAEZB, r) - opset(AVFAEZH, r) - opset(AVFAEZF, r) - opset(AVFAEZBS, r) - opset(AVFAEZHS, r) - opset(AVFAEZFS, r) - opset(AVFEEB, r) - opset(AVFEEH, r) - opset(AVFEEF, r) - opset(AVFEEBS, r) - opset(AVFEEHS, r) - opset(AVFEEFS, r) - opset(AVFEEZB, r) - opset(AVFEEZH, r) - opset(AVFEEZF, r) - opset(AVFEEZBS, r) - opset(AVFEEZHS, r) - opset(AVFEEZFS, r) - opset(AVFENEB, r) - opset(AVFENEH, r) - opset(AVFENEF, r) - opset(AVFENEBS, r) - opset(AVFENEHS, r) - opset(AVFENEFS, r) - opset(AVFENEZB, r) - opset(AVFENEZH, r) - opset(AVFENEZF, r) - opset(AVFENEZBS, r) - opset(AVFENEZHS, r) - opset(AVFENEZFS, r) - case AVPKSG: - opset(AVPKSH, r) - opset(AVPKSF, r) - opset(AVPKSHS, r) - opset(AVPKSFS, r) - opset(AVPKSGS, r) - opset(AVPKLSH, r) - opset(AVPKLSF, r) - opset(AVPKLSG, r) - opset(AVPKLSHS, r) - opset(AVPKLSFS, r) - opset(AVPKLSGS, r) - case AVAQ: - opset(AVAB, r) - opset(AVAH, r) - opset(AVAF, r) - opset(AVAG, r) - opset(AVACCB, r) - opset(AVACCH, r) - opset(AVACCF, r) - opset(AVACCG, r) - opset(AVACCQ, r) - opset(AVN, r) - opset(AVNC, r) - opset(AVAVGB, r) - opset(AVAVGH, r) - opset(AVAVGF, r) - opset(AVAVGG, r) - opset(AVAVGLB, r) - opset(AVAVGLH, r) - opset(AVAVGLF, r) - opset(AVAVGLG, r) - opset(AVCKSM, r) - opset(AVX, r) - opset(AVFADB, r) - opset(AWFADB, r) - opset(AVFCEDB, r) - opset(AVFCEDBS, r) - opset(AWFCEDB, r) - opset(AWFCEDBS, r) - opset(AVFCHDB, r) - opset(AVFCHDBS, r) - opset(AWFCHDB, r) - opset(AWFCHDBS, r) - opset(AVFCHEDB, r) - opset(AVFCHEDBS, r) - opset(AWFCHEDB, r) - opset(AWFCHEDBS, r) - opset(AVFMDB, r) - opset(AWFMDB, r) - opset(AVGFMB, r) - opset(AVGFMH, r) - opset(AVGFMF, r) - opset(AVGFMG, r) - opset(AVMXB, r) - opset(AVMXH, r) - opset(AVMXF, r) - opset(AVMXG, r) - opset(AVMXLB, r) - opset(AVMXLH, r) - opset(AVMXLF, r) - opset(AVMXLG, r) - opset(AVMNB, r) - opset(AVMNH, r) - opset(AVMNF, r) - opset(AVMNG, r) - opset(AVMNLB, r) - opset(AVMNLH, r) - opset(AVMNLF, r) - opset(AVMNLG, r) - opset(AVMRHB, r) - opset(AVMRHH, r) - opset(AVMRHF, r) - opset(AVMRHG, r) - opset(AVMRLB, r) - opset(AVMRLH, r) - opset(AVMRLF, r) - opset(AVMRLG, r) - opset(AVMEB, r) - opset(AVMEH, r) - opset(AVMEF, r) - opset(AVMLEB, r) - opset(AVMLEH, r) - opset(AVMLEF, r) - opset(AVMOB, r) - opset(AVMOH, r) - opset(AVMOF, r) - opset(AVMLOB, r) - opset(AVMLOH, r) - opset(AVMLOF, r) - opset(AVMHB, r) - opset(AVMHH, r) - opset(AVMHF, r) - opset(AVMLHB, r) - opset(AVMLHH, r) - opset(AVMLHF, r) - opset(AVMLH, r) - opset(AVMLHW, r) - opset(AVMLF, r) - opset(AVNO, r) - opset(AVO, r) - opset(AVPKH, r) - opset(AVPKF, r) - opset(AVPKG, r) - opset(AVSUMGH, r) - opset(AVSUMGF, r) - opset(AVSUMQF, r) - opset(AVSUMQG, r) - opset(AVSUMB, r) - opset(AVSUMH, r) - case AVERLLVG: - opset(AVERLLVB, r) - opset(AVERLLVH, r) - opset(AVERLLVF, r) - opset(AVESLVB, r) - opset(AVESLVH, r) - opset(AVESLVF, r) - opset(AVESLVG, r) - opset(AVESRAVB, r) - opset(AVESRAVH, r) - opset(AVESRAVF, r) - opset(AVESRAVG, r) - opset(AVESRLVB, r) - opset(AVESRLVH, r) - opset(AVESRLVF, r) - opset(AVESRLVG, r) - opset(AVFDDB, r) - opset(AWFDDB, r) - opset(AVFSDB, r) - opset(AWFSDB, r) - opset(AVSL, r) - opset(AVSLB, r) - opset(AVSRA, r) - opset(AVSRAB, r) - opset(AVSRL, r) - opset(AVSRLB, r) - opset(AVSF, r) - opset(AVSG, r) - opset(AVSQ, r) - opset(AVSCBIB, r) - opset(AVSCBIH, r) - opset(AVSCBIF, r) - opset(AVSCBIG, r) - opset(AVSCBIQ, r) - case AVACQ: - opset(AVACCCQ, r) - opset(AVGFMAB, r) - opset(AVGFMAH, r) - opset(AVGFMAF, r) - opset(AVGFMAG, r) - opset(AVMALB, r) - opset(AVMALHW, r) - opset(AVMALF, r) - opset(AVMAHB, r) - opset(AVMAHH, r) - opset(AVMAHF, r) - opset(AVMALHB, r) - opset(AVMALHH, r) - opset(AVMALHF, r) - opset(AVMAEB, r) - opset(AVMAEH, r) - opset(AVMAEF, r) - opset(AVMALEB, r) - opset(AVMALEH, r) - opset(AVMALEF, r) - opset(AVMAOB, r) - opset(AVMAOH, r) - opset(AVMAOF, r) - opset(AVMALOB, r) - opset(AVMALOH, r) - opset(AVMALOF, r) - opset(AVSTRCB, r) - opset(AVSTRCH, r) - opset(AVSTRCF, r) - opset(AVSTRCBS, r) - opset(AVSTRCHS, r) - opset(AVSTRCFS, r) - opset(AVSTRCZB, r) - opset(AVSTRCZH, r) - opset(AVSTRCZF, r) - opset(AVSTRCZBS, r) - opset(AVSTRCZHS, r) - opset(AVSTRCZFS, r) - opset(AVSBCBIQ, r) - opset(AVSBIQ, r) - case AVSEL: - opset(AVFMADB, r) - opset(AWFMADB, r) - opset(AVFMSDB, r) - opset(AWFMSDB, r) - opset(AVPERM, r) - } - } -} - -const ( - op_A uint32 = 0x5A00 // FORMAT_RX1 ADD (32) - op_AD uint32 = 0x6A00 // FORMAT_RX1 ADD NORMALIZED (long HFP) - op_ADB uint32 = 0xED1A // FORMAT_RXE ADD (long BFP) - op_ADBR uint32 = 0xB31A // FORMAT_RRE ADD (long BFP) - op_ADR uint32 = 0x2A00 // FORMAT_RR ADD NORMALIZED (long HFP) - op_ADTR uint32 = 0xB3D2 // FORMAT_RRF1 ADD (long DFP) - op_ADTRA uint32 = 0xB3D2 // FORMAT_RRF1 ADD (long DFP) - op_AE uint32 = 0x7A00 // FORMAT_RX1 ADD NORMALIZED (short HFP) - op_AEB uint32 = 0xED0A // FORMAT_RXE ADD (short BFP) - op_AEBR uint32 = 0xB30A // FORMAT_RRE ADD (short BFP) - op_AER uint32 = 0x3A00 // FORMAT_RR ADD NORMALIZED (short HFP) - op_AFI uint32 = 0xC209 // FORMAT_RIL1 ADD IMMEDIATE (32) - op_AG uint32 = 0xE308 // FORMAT_RXY1 ADD (64) - op_AGF uint32 = 0xE318 // FORMAT_RXY1 ADD (64<-32) - op_AGFI uint32 = 0xC208 // FORMAT_RIL1 ADD IMMEDIATE (64<-32) - op_AGFR uint32 = 0xB918 // FORMAT_RRE ADD (64<-32) - op_AGHI uint32 = 0xA70B // FORMAT_RI1 ADD HALFWORD IMMEDIATE (64) - op_AGHIK uint32 = 0xECD9 // FORMAT_RIE4 ADD IMMEDIATE (64<-16) - op_AGR uint32 = 0xB908 // FORMAT_RRE ADD (64) - op_AGRK uint32 = 0xB9E8 // FORMAT_RRF1 ADD (64) - op_AGSI uint32 = 0xEB7A // FORMAT_SIY ADD IMMEDIATE (64<-8) - op_AH uint32 = 0x4A00 // FORMAT_RX1 ADD HALFWORD - op_AHHHR uint32 = 0xB9C8 // FORMAT_RRF1 ADD HIGH (32) - op_AHHLR uint32 = 0xB9D8 // FORMAT_RRF1 ADD HIGH (32) - op_AHI uint32 = 0xA70A // FORMAT_RI1 ADD HALFWORD IMMEDIATE (32) - op_AHIK uint32 = 0xECD8 // FORMAT_RIE4 ADD IMMEDIATE (32<-16) - op_AHY uint32 = 0xE37A // FORMAT_RXY1 ADD HALFWORD - op_AIH uint32 = 0xCC08 // FORMAT_RIL1 ADD IMMEDIATE HIGH (32) - op_AL uint32 = 0x5E00 // FORMAT_RX1 ADD LOGICAL (32) - op_ALC uint32 = 0xE398 // FORMAT_RXY1 ADD LOGICAL WITH CARRY (32) - op_ALCG uint32 = 0xE388 // FORMAT_RXY1 ADD LOGICAL WITH CARRY (64) - op_ALCGR uint32 = 0xB988 // FORMAT_RRE ADD LOGICAL WITH CARRY (64) - op_ALCR uint32 = 0xB998 // FORMAT_RRE ADD LOGICAL WITH CARRY (32) - op_ALFI uint32 = 0xC20B // FORMAT_RIL1 ADD LOGICAL IMMEDIATE (32) - op_ALG uint32 = 0xE30A // FORMAT_RXY1 ADD LOGICAL (64) - op_ALGF uint32 = 0xE31A // FORMAT_RXY1 ADD LOGICAL (64<-32) - op_ALGFI uint32 = 0xC20A // FORMAT_RIL1 ADD LOGICAL IMMEDIATE (64<-32) - op_ALGFR uint32 = 0xB91A // FORMAT_RRE ADD LOGICAL (64<-32) - op_ALGHSIK uint32 = 0xECDB // FORMAT_RIE4 ADD LOGICAL WITH SIGNED IMMEDIATE (64<-16) - op_ALGR uint32 = 0xB90A // FORMAT_RRE ADD LOGICAL (64) - op_ALGRK uint32 = 0xB9EA // FORMAT_RRF1 ADD LOGICAL (64) - op_ALGSI uint32 = 0xEB7E // FORMAT_SIY ADD LOGICAL WITH SIGNED IMMEDIATE (64<-8) - op_ALHHHR uint32 = 0xB9CA // FORMAT_RRF1 ADD LOGICAL HIGH (32) - op_ALHHLR uint32 = 0xB9DA // FORMAT_RRF1 ADD LOGICAL HIGH (32) - op_ALHSIK uint32 = 0xECDA // FORMAT_RIE4 ADD LOGICAL WITH SIGNED IMMEDIATE (32<-16) - op_ALR uint32 = 0x1E00 // FORMAT_RR ADD LOGICAL (32) - op_ALRK uint32 = 0xB9FA // FORMAT_RRF1 ADD LOGICAL (32) - op_ALSI uint32 = 0xEB6E // FORMAT_SIY ADD LOGICAL WITH SIGNED IMMEDIATE (32<-8) - op_ALSIH uint32 = 0xCC0A // FORMAT_RIL1 ADD LOGICAL WITH SIGNED IMMEDIATE HIGH (32) - op_ALSIHN uint32 = 0xCC0B // FORMAT_RIL1 ADD LOGICAL WITH SIGNED IMMEDIATE HIGH (32) - op_ALY uint32 = 0xE35E // FORMAT_RXY1 ADD LOGICAL (32) - op_AP uint32 = 0xFA00 // FORMAT_SS2 ADD DECIMAL - op_AR uint32 = 0x1A00 // FORMAT_RR ADD (32) - op_ARK uint32 = 0xB9F8 // FORMAT_RRF1 ADD (32) - op_ASI uint32 = 0xEB6A // FORMAT_SIY ADD IMMEDIATE (32<-8) - op_AU uint32 = 0x7E00 // FORMAT_RX1 ADD UNNORMALIZED (short HFP) - op_AUR uint32 = 0x3E00 // FORMAT_RR ADD UNNORMALIZED (short HFP) - op_AW uint32 = 0x6E00 // FORMAT_RX1 ADD UNNORMALIZED (long HFP) - op_AWR uint32 = 0x2E00 // FORMAT_RR ADD UNNORMALIZED (long HFP) - op_AXBR uint32 = 0xB34A // FORMAT_RRE ADD (extended BFP) - op_AXR uint32 = 0x3600 // FORMAT_RR ADD NORMALIZED (extended HFP) - op_AXTR uint32 = 0xB3DA // FORMAT_RRF1 ADD (extended DFP) - op_AXTRA uint32 = 0xB3DA // FORMAT_RRF1 ADD (extended DFP) - op_AY uint32 = 0xE35A // FORMAT_RXY1 ADD (32) - op_BAKR uint32 = 0xB240 // FORMAT_RRE BRANCH AND STACK - op_BAL uint32 = 0x4500 // FORMAT_RX1 BRANCH AND LINK - op_BALR uint32 = 0x0500 // FORMAT_RR BRANCH AND LINK - op_BAS uint32 = 0x4D00 // FORMAT_RX1 BRANCH AND SAVE - op_BASR uint32 = 0x0D00 // FORMAT_RR BRANCH AND SAVE - op_BASSM uint32 = 0x0C00 // FORMAT_RR BRANCH AND SAVE AND SET MODE - op_BC uint32 = 0x4700 // FORMAT_RX2 BRANCH ON CONDITION - op_BCR uint32 = 0x0700 // FORMAT_RR BRANCH ON CONDITION - op_BCT uint32 = 0x4600 // FORMAT_RX1 BRANCH ON COUNT (32) - op_BCTG uint32 = 0xE346 // FORMAT_RXY1 BRANCH ON COUNT (64) - op_BCTGR uint32 = 0xB946 // FORMAT_RRE BRANCH ON COUNT (64) - op_BCTR uint32 = 0x0600 // FORMAT_RR BRANCH ON COUNT (32) - op_BPP uint32 = 0xC700 // FORMAT_SMI BRANCH PREDICTION PRELOAD - op_BPRP uint32 = 0xC500 // FORMAT_MII BRANCH PREDICTION RELATIVE PRELOAD - op_BRAS uint32 = 0xA705 // FORMAT_RI2 BRANCH RELATIVE AND SAVE - op_BRASL uint32 = 0xC005 // FORMAT_RIL2 BRANCH RELATIVE AND SAVE LONG - op_BRC uint32 = 0xA704 // FORMAT_RI3 BRANCH RELATIVE ON CONDITION - op_BRCL uint32 = 0xC004 // FORMAT_RIL3 BRANCH RELATIVE ON CONDITION LONG - op_BRCT uint32 = 0xA706 // FORMAT_RI2 BRANCH RELATIVE ON COUNT (32) - op_BRCTG uint32 = 0xA707 // FORMAT_RI2 BRANCH RELATIVE ON COUNT (64) - op_BRCTH uint32 = 0xCC06 // FORMAT_RIL2 BRANCH RELATIVE ON COUNT HIGH (32) - op_BRXH uint32 = 0x8400 // FORMAT_RSI BRANCH RELATIVE ON INDEX HIGH (32) - op_BRXHG uint32 = 0xEC44 // FORMAT_RIE5 BRANCH RELATIVE ON INDEX HIGH (64) - op_BRXLE uint32 = 0x8500 // FORMAT_RSI BRANCH RELATIVE ON INDEX LOW OR EQ. (32) - op_BRXLG uint32 = 0xEC45 // FORMAT_RIE5 BRANCH RELATIVE ON INDEX LOW OR EQ. (64) - op_BSA uint32 = 0xB25A // FORMAT_RRE BRANCH AND SET AUTHORITY - op_BSG uint32 = 0xB258 // FORMAT_RRE BRANCH IN SUBSPACE GROUP - op_BSM uint32 = 0x0B00 // FORMAT_RR BRANCH AND SET MODE - op_BXH uint32 = 0x8600 // FORMAT_RS1 BRANCH ON INDEX HIGH (32) - op_BXHG uint32 = 0xEB44 // FORMAT_RSY1 BRANCH ON INDEX HIGH (64) - op_BXLE uint32 = 0x8700 // FORMAT_RS1 BRANCH ON INDEX LOW OR EQUAL (32) - op_BXLEG uint32 = 0xEB45 // FORMAT_RSY1 BRANCH ON INDEX LOW OR EQUAL (64) - op_C uint32 = 0x5900 // FORMAT_RX1 COMPARE (32) - op_CD uint32 = 0x6900 // FORMAT_RX1 COMPARE (long HFP) - op_CDB uint32 = 0xED19 // FORMAT_RXE COMPARE (long BFP) - op_CDBR uint32 = 0xB319 // FORMAT_RRE COMPARE (long BFP) - op_CDFBR uint32 = 0xB395 // FORMAT_RRE CONVERT FROM FIXED (32 to long BFP) - op_CDFBRA uint32 = 0xB395 // FORMAT_RRF5 CONVERT FROM FIXED (32 to long BFP) - op_CDFR uint32 = 0xB3B5 // FORMAT_RRE CONVERT FROM FIXED (32 to long HFP) - op_CDFTR uint32 = 0xB951 // FORMAT_RRE CONVERT FROM FIXED (32 to long DFP) - op_CDGBR uint32 = 0xB3A5 // FORMAT_RRE CONVERT FROM FIXED (64 to long BFP) - op_CDGBRA uint32 = 0xB3A5 // FORMAT_RRF5 CONVERT FROM FIXED (64 to long BFP) - op_CDGR uint32 = 0xB3C5 // FORMAT_RRE CONVERT FROM FIXED (64 to long HFP) - op_CDGTR uint32 = 0xB3F1 // FORMAT_RRE CONVERT FROM FIXED (64 to long DFP) - op_CDGTRA uint32 = 0xB3F1 // FORMAT_RRF5 CONVERT FROM FIXED (64 to long DFP) - op_CDLFBR uint32 = 0xB391 // FORMAT_RRF5 CONVERT FROM LOGICAL (32 to long BFP) - op_CDLFTR uint32 = 0xB953 // FORMAT_RRF5 CONVERT FROM LOGICAL (32 to long DFP) - op_CDLGBR uint32 = 0xB3A1 // FORMAT_RRF5 CONVERT FROM LOGICAL (64 to long BFP) - op_CDLGTR uint32 = 0xB952 // FORMAT_RRF5 CONVERT FROM LOGICAL (64 to long DFP) - op_CDR uint32 = 0x2900 // FORMAT_RR COMPARE (long HFP) - op_CDS uint32 = 0xBB00 // FORMAT_RS1 COMPARE DOUBLE AND SWAP (32) - op_CDSG uint32 = 0xEB3E // FORMAT_RSY1 COMPARE DOUBLE AND SWAP (64) - op_CDSTR uint32 = 0xB3F3 // FORMAT_RRE CONVERT FROM SIGNED PACKED (64 to long DFP) - op_CDSY uint32 = 0xEB31 // FORMAT_RSY1 COMPARE DOUBLE AND SWAP (32) - op_CDTR uint32 = 0xB3E4 // FORMAT_RRE COMPARE (long DFP) - op_CDUTR uint32 = 0xB3F2 // FORMAT_RRE CONVERT FROM UNSIGNED PACKED (64 to long DFP) - op_CDZT uint32 = 0xEDAA // FORMAT_RSL CONVERT FROM ZONED (to long DFP) - op_CE uint32 = 0x7900 // FORMAT_RX1 COMPARE (short HFP) - op_CEB uint32 = 0xED09 // FORMAT_RXE COMPARE (short BFP) - op_CEBR uint32 = 0xB309 // FORMAT_RRE COMPARE (short BFP) - op_CEDTR uint32 = 0xB3F4 // FORMAT_RRE COMPARE BIASED EXPONENT (long DFP) - op_CEFBR uint32 = 0xB394 // FORMAT_RRE CONVERT FROM FIXED (32 to short BFP) - op_CEFBRA uint32 = 0xB394 // FORMAT_RRF5 CONVERT FROM FIXED (32 to short BFP) - op_CEFR uint32 = 0xB3B4 // FORMAT_RRE CONVERT FROM FIXED (32 to short HFP) - op_CEGBR uint32 = 0xB3A4 // FORMAT_RRE CONVERT FROM FIXED (64 to short BFP) - op_CEGBRA uint32 = 0xB3A4 // FORMAT_RRF5 CONVERT FROM FIXED (64 to short BFP) - op_CEGR uint32 = 0xB3C4 // FORMAT_RRE CONVERT FROM FIXED (64 to short HFP) - op_CELFBR uint32 = 0xB390 // FORMAT_RRF5 CONVERT FROM LOGICAL (32 to short BFP) - op_CELGBR uint32 = 0xB3A0 // FORMAT_RRF5 CONVERT FROM LOGICAL (64 to short BFP) - op_CER uint32 = 0x3900 // FORMAT_RR COMPARE (short HFP) - op_CEXTR uint32 = 0xB3FC // FORMAT_RRE COMPARE BIASED EXPONENT (extended DFP) - op_CFC uint32 = 0xB21A // FORMAT_S COMPARE AND FORM CODEWORD - op_CFDBR uint32 = 0xB399 // FORMAT_RRF5 CONVERT TO FIXED (long BFP to 32) - op_CFDBRA uint32 = 0xB399 // FORMAT_RRF5 CONVERT TO FIXED (long BFP to 32) - op_CFDR uint32 = 0xB3B9 // FORMAT_RRF5 CONVERT TO FIXED (long HFP to 32) - op_CFDTR uint32 = 0xB941 // FORMAT_RRF5 CONVERT TO FIXED (long DFP to 32) - op_CFEBR uint32 = 0xB398 // FORMAT_RRF5 CONVERT TO FIXED (short BFP to 32) - op_CFEBRA uint32 = 0xB398 // FORMAT_RRF5 CONVERT TO FIXED (short BFP to 32) - op_CFER uint32 = 0xB3B8 // FORMAT_RRF5 CONVERT TO FIXED (short HFP to 32) - op_CFI uint32 = 0xC20D // FORMAT_RIL1 COMPARE IMMEDIATE (32) - op_CFXBR uint32 = 0xB39A // FORMAT_RRF5 CONVERT TO FIXED (extended BFP to 32) - op_CFXBRA uint32 = 0xB39A // FORMAT_RRF5 CONVERT TO FIXED (extended BFP to 32) - op_CFXR uint32 = 0xB3BA // FORMAT_RRF5 CONVERT TO FIXED (extended HFP to 32) - op_CFXTR uint32 = 0xB949 // FORMAT_RRF5 CONVERT TO FIXED (extended DFP to 32) - op_CG uint32 = 0xE320 // FORMAT_RXY1 COMPARE (64) - op_CGDBR uint32 = 0xB3A9 // FORMAT_RRF5 CONVERT TO FIXED (long BFP to 64) - op_CGDBRA uint32 = 0xB3A9 // FORMAT_RRF5 CONVERT TO FIXED (long BFP to 64) - op_CGDR uint32 = 0xB3C9 // FORMAT_RRF5 CONVERT TO FIXED (long HFP to 64) - op_CGDTR uint32 = 0xB3E1 // FORMAT_RRF5 CONVERT TO FIXED (long DFP to 64) - op_CGDTRA uint32 = 0xB3E1 // FORMAT_RRF5 CONVERT TO FIXED (long DFP to 64) - op_CGEBR uint32 = 0xB3A8 // FORMAT_RRF5 CONVERT TO FIXED (short BFP to 64) - op_CGEBRA uint32 = 0xB3A8 // FORMAT_RRF5 CONVERT TO FIXED (short BFP to 64) - op_CGER uint32 = 0xB3C8 // FORMAT_RRF5 CONVERT TO FIXED (short HFP to 64) - op_CGF uint32 = 0xE330 // FORMAT_RXY1 COMPARE (64<-32) - op_CGFI uint32 = 0xC20C // FORMAT_RIL1 COMPARE IMMEDIATE (64<-32) - op_CGFR uint32 = 0xB930 // FORMAT_RRE COMPARE (64<-32) - op_CGFRL uint32 = 0xC60C // FORMAT_RIL2 COMPARE RELATIVE LONG (64<-32) - op_CGH uint32 = 0xE334 // FORMAT_RXY1 COMPARE HALFWORD (64<-16) - op_CGHI uint32 = 0xA70F // FORMAT_RI1 COMPARE HALFWORD IMMEDIATE (64<-16) - op_CGHRL uint32 = 0xC604 // FORMAT_RIL2 COMPARE HALFWORD RELATIVE LONG (64<-16) - op_CGHSI uint32 = 0xE558 // FORMAT_SIL COMPARE HALFWORD IMMEDIATE (64<-16) - op_CGIB uint32 = 0xECFC // FORMAT_RIS COMPARE IMMEDIATE AND BRANCH (64<-8) - op_CGIJ uint32 = 0xEC7C // FORMAT_RIE3 COMPARE IMMEDIATE AND BRANCH RELATIVE (64<-8) - op_CGIT uint32 = 0xEC70 // FORMAT_RIE1 COMPARE IMMEDIATE AND TRAP (64<-16) - op_CGR uint32 = 0xB920 // FORMAT_RRE COMPARE (64) - op_CGRB uint32 = 0xECE4 // FORMAT_RRS COMPARE AND BRANCH (64) - op_CGRJ uint32 = 0xEC64 // FORMAT_RIE2 COMPARE AND BRANCH RELATIVE (64) - op_CGRL uint32 = 0xC608 // FORMAT_RIL2 COMPARE RELATIVE LONG (64) - op_CGRT uint32 = 0xB960 // FORMAT_RRF3 COMPARE AND TRAP (64) - op_CGXBR uint32 = 0xB3AA // FORMAT_RRF5 CONVERT TO FIXED (extended BFP to 64) - op_CGXBRA uint32 = 0xB3AA // FORMAT_RRF5 CONVERT TO FIXED (extended BFP to 64) - op_CGXR uint32 = 0xB3CA // FORMAT_RRF5 CONVERT TO FIXED (extended HFP to 64) - op_CGXTR uint32 = 0xB3E9 // FORMAT_RRF5 CONVERT TO FIXED (extended DFP to 64) - op_CGXTRA uint32 = 0xB3E9 // FORMAT_RRF5 CONVERT TO FIXED (extended DFP to 64) - op_CH uint32 = 0x4900 // FORMAT_RX1 COMPARE HALFWORD (32<-16) - op_CHF uint32 = 0xE3CD // FORMAT_RXY1 COMPARE HIGH (32) - op_CHHR uint32 = 0xB9CD // FORMAT_RRE COMPARE HIGH (32) - op_CHHSI uint32 = 0xE554 // FORMAT_SIL COMPARE HALFWORD IMMEDIATE (16) - op_CHI uint32 = 0xA70E // FORMAT_RI1 COMPARE HALFWORD IMMEDIATE (32<-16) - op_CHLR uint32 = 0xB9DD // FORMAT_RRE COMPARE HIGH (32) - op_CHRL uint32 = 0xC605 // FORMAT_RIL2 COMPARE HALFWORD RELATIVE LONG (32<-16) - op_CHSI uint32 = 0xE55C // FORMAT_SIL COMPARE HALFWORD IMMEDIATE (32<-16) - op_CHY uint32 = 0xE379 // FORMAT_RXY1 COMPARE HALFWORD (32<-16) - op_CIB uint32 = 0xECFE // FORMAT_RIS COMPARE IMMEDIATE AND BRANCH (32<-8) - op_CIH uint32 = 0xCC0D // FORMAT_RIL1 COMPARE IMMEDIATE HIGH (32) - op_CIJ uint32 = 0xEC7E // FORMAT_RIE3 COMPARE IMMEDIATE AND BRANCH RELATIVE (32<-8) - op_CIT uint32 = 0xEC72 // FORMAT_RIE1 COMPARE IMMEDIATE AND TRAP (32<-16) - op_CKSM uint32 = 0xB241 // FORMAT_RRE CHECKSUM - op_CL uint32 = 0x5500 // FORMAT_RX1 COMPARE LOGICAL (32) - op_CLC uint32 = 0xD500 // FORMAT_SS1 COMPARE LOGICAL (character) - op_CLCL uint32 = 0x0F00 // FORMAT_RR COMPARE LOGICAL LONG - op_CLCLE uint32 = 0xA900 // FORMAT_RS1 COMPARE LOGICAL LONG EXTENDED - op_CLCLU uint32 = 0xEB8F // FORMAT_RSY1 COMPARE LOGICAL LONG UNICODE - op_CLFDBR uint32 = 0xB39D // FORMAT_RRF5 CONVERT TO LOGICAL (long BFP to 32) - op_CLFDTR uint32 = 0xB943 // FORMAT_RRF5 CONVERT TO LOGICAL (long DFP to 32) - op_CLFEBR uint32 = 0xB39C // FORMAT_RRF5 CONVERT TO LOGICAL (short BFP to 32) - op_CLFHSI uint32 = 0xE55D // FORMAT_SIL COMPARE LOGICAL IMMEDIATE (32<-16) - op_CLFI uint32 = 0xC20F // FORMAT_RIL1 COMPARE LOGICAL IMMEDIATE (32) - op_CLFIT uint32 = 0xEC73 // FORMAT_RIE1 COMPARE LOGICAL IMMEDIATE AND TRAP (32<-16) - op_CLFXBR uint32 = 0xB39E // FORMAT_RRF5 CONVERT TO LOGICAL (extended BFP to 32) - op_CLFXTR uint32 = 0xB94B // FORMAT_RRF5 CONVERT TO LOGICAL (extended DFP to 32) - op_CLG uint32 = 0xE321 // FORMAT_RXY1 COMPARE LOGICAL (64) - op_CLGDBR uint32 = 0xB3AD // FORMAT_RRF5 CONVERT TO LOGICAL (long BFP to 64) - op_CLGDTR uint32 = 0xB942 // FORMAT_RRF5 CONVERT TO LOGICAL (long DFP to 64) - op_CLGEBR uint32 = 0xB3AC // FORMAT_RRF5 CONVERT TO LOGICAL (short BFP to 64) - op_CLGF uint32 = 0xE331 // FORMAT_RXY1 COMPARE LOGICAL (64<-32) - op_CLGFI uint32 = 0xC20E // FORMAT_RIL1 COMPARE LOGICAL IMMEDIATE (64<-32) - op_CLGFR uint32 = 0xB931 // FORMAT_RRE COMPARE LOGICAL (64<-32) - op_CLGFRL uint32 = 0xC60E // FORMAT_RIL2 COMPARE LOGICAL RELATIVE LONG (64<-32) - op_CLGHRL uint32 = 0xC606 // FORMAT_RIL2 COMPARE LOGICAL RELATIVE LONG (64<-16) - op_CLGHSI uint32 = 0xE559 // FORMAT_SIL COMPARE LOGICAL IMMEDIATE (64<-16) - op_CLGIB uint32 = 0xECFD // FORMAT_RIS COMPARE LOGICAL IMMEDIATE AND BRANCH (64<-8) - op_CLGIJ uint32 = 0xEC7D // FORMAT_RIE3 COMPARE LOGICAL IMMEDIATE AND BRANCH RELATIVE (64<-8) - op_CLGIT uint32 = 0xEC71 // FORMAT_RIE1 COMPARE LOGICAL IMMEDIATE AND TRAP (64<-16) - op_CLGR uint32 = 0xB921 // FORMAT_RRE COMPARE LOGICAL (64) - op_CLGRB uint32 = 0xECE5 // FORMAT_RRS COMPARE LOGICAL AND BRANCH (64) - op_CLGRJ uint32 = 0xEC65 // FORMAT_RIE2 COMPARE LOGICAL AND BRANCH RELATIVE (64) - op_CLGRL uint32 = 0xC60A // FORMAT_RIL2 COMPARE LOGICAL RELATIVE LONG (64) - op_CLGRT uint32 = 0xB961 // FORMAT_RRF3 COMPARE LOGICAL AND TRAP (64) - op_CLGT uint32 = 0xEB2B // FORMAT_RSY2 COMPARE LOGICAL AND TRAP (64) - op_CLGXBR uint32 = 0xB3AE // FORMAT_RRF5 CONVERT TO LOGICAL (extended BFP to 64) - op_CLGXTR uint32 = 0xB94A // FORMAT_RRF5 CONVERT TO LOGICAL (extended DFP to 64) - op_CLHF uint32 = 0xE3CF // FORMAT_RXY1 COMPARE LOGICAL HIGH (32) - op_CLHHR uint32 = 0xB9CF // FORMAT_RRE COMPARE LOGICAL HIGH (32) - op_CLHHSI uint32 = 0xE555 // FORMAT_SIL COMPARE LOGICAL IMMEDIATE (16) - op_CLHLR uint32 = 0xB9DF // FORMAT_RRE COMPARE LOGICAL HIGH (32) - op_CLHRL uint32 = 0xC607 // FORMAT_RIL2 COMPARE LOGICAL RELATIVE LONG (32<-16) - op_CLI uint32 = 0x9500 // FORMAT_SI COMPARE LOGICAL (immediate) - op_CLIB uint32 = 0xECFF // FORMAT_RIS COMPARE LOGICAL IMMEDIATE AND BRANCH (32<-8) - op_CLIH uint32 = 0xCC0F // FORMAT_RIL1 COMPARE LOGICAL IMMEDIATE HIGH (32) - op_CLIJ uint32 = 0xEC7F // FORMAT_RIE3 COMPARE LOGICAL IMMEDIATE AND BRANCH RELATIVE (32<-8) - op_CLIY uint32 = 0xEB55 // FORMAT_SIY COMPARE LOGICAL (immediate) - op_CLM uint32 = 0xBD00 // FORMAT_RS2 COMPARE LOGICAL CHAR. UNDER MASK (low) - op_CLMH uint32 = 0xEB20 // FORMAT_RSY2 COMPARE LOGICAL CHAR. UNDER MASK (high) - op_CLMY uint32 = 0xEB21 // FORMAT_RSY2 COMPARE LOGICAL CHAR. UNDER MASK (low) - op_CLR uint32 = 0x1500 // FORMAT_RR COMPARE LOGICAL (32) - op_CLRB uint32 = 0xECF7 // FORMAT_RRS COMPARE LOGICAL AND BRANCH (32) - op_CLRJ uint32 = 0xEC77 // FORMAT_RIE2 COMPARE LOGICAL AND BRANCH RELATIVE (32) - op_CLRL uint32 = 0xC60F // FORMAT_RIL2 COMPARE LOGICAL RELATIVE LONG (32) - op_CLRT uint32 = 0xB973 // FORMAT_RRF3 COMPARE LOGICAL AND TRAP (32) - op_CLST uint32 = 0xB25D // FORMAT_RRE COMPARE LOGICAL STRING - op_CLT uint32 = 0xEB23 // FORMAT_RSY2 COMPARE LOGICAL AND TRAP (32) - op_CLY uint32 = 0xE355 // FORMAT_RXY1 COMPARE LOGICAL (32) - op_CMPSC uint32 = 0xB263 // FORMAT_RRE COMPRESSION CALL - op_CP uint32 = 0xF900 // FORMAT_SS2 COMPARE DECIMAL - op_CPSDR uint32 = 0xB372 // FORMAT_RRF2 COPY SIGN (long) - op_CPYA uint32 = 0xB24D // FORMAT_RRE COPY ACCESS - op_CR uint32 = 0x1900 // FORMAT_RR COMPARE (32) - op_CRB uint32 = 0xECF6 // FORMAT_RRS COMPARE AND BRANCH (32) - op_CRDTE uint32 = 0xB98F // FORMAT_RRF2 COMPARE AND REPLACE DAT TABLE ENTRY - op_CRJ uint32 = 0xEC76 // FORMAT_RIE2 COMPARE AND BRANCH RELATIVE (32) - op_CRL uint32 = 0xC60D // FORMAT_RIL2 COMPARE RELATIVE LONG (32) - op_CRT uint32 = 0xB972 // FORMAT_RRF3 COMPARE AND TRAP (32) - op_CS uint32 = 0xBA00 // FORMAT_RS1 COMPARE AND SWAP (32) - op_CSCH uint32 = 0xB230 // FORMAT_S CLEAR SUBCHANNEL - op_CSDTR uint32 = 0xB3E3 // FORMAT_RRF4 CONVERT TO SIGNED PACKED (long DFP to 64) - op_CSG uint32 = 0xEB30 // FORMAT_RSY1 COMPARE AND SWAP (64) - op_CSP uint32 = 0xB250 // FORMAT_RRE COMPARE AND SWAP AND PURGE - op_CSPG uint32 = 0xB98A // FORMAT_RRE COMPARE AND SWAP AND PURGE - op_CSST uint32 = 0xC802 // FORMAT_SSF COMPARE AND SWAP AND STORE - op_CSXTR uint32 = 0xB3EB // FORMAT_RRF4 CONVERT TO SIGNED PACKED (extended DFP to 128) - op_CSY uint32 = 0xEB14 // FORMAT_RSY1 COMPARE AND SWAP (32) - op_CU12 uint32 = 0xB2A7 // FORMAT_RRF3 CONVERT UTF-8 TO UTF-16 - op_CU14 uint32 = 0xB9B0 // FORMAT_RRF3 CONVERT UTF-8 TO UTF-32 - op_CU21 uint32 = 0xB2A6 // FORMAT_RRF3 CONVERT UTF-16 TO UTF-8 - op_CU24 uint32 = 0xB9B1 // FORMAT_RRF3 CONVERT UTF-16 TO UTF-32 - op_CU41 uint32 = 0xB9B2 // FORMAT_RRE CONVERT UTF-32 TO UTF-8 - op_CU42 uint32 = 0xB9B3 // FORMAT_RRE CONVERT UTF-32 TO UTF-16 - op_CUDTR uint32 = 0xB3E2 // FORMAT_RRE CONVERT TO UNSIGNED PACKED (long DFP to 64) - op_CUSE uint32 = 0xB257 // FORMAT_RRE COMPARE UNTIL SUBSTRING EQUAL - op_CUTFU uint32 = 0xB2A7 // FORMAT_RRF3 CONVERT UTF-8 TO UNICODE - op_CUUTF uint32 = 0xB2A6 // FORMAT_RRF3 CONVERT UNICODE TO UTF-8 - op_CUXTR uint32 = 0xB3EA // FORMAT_RRE CONVERT TO UNSIGNED PACKED (extended DFP to 128) - op_CVB uint32 = 0x4F00 // FORMAT_RX1 CONVERT TO BINARY (32) - op_CVBG uint32 = 0xE30E // FORMAT_RXY1 CONVERT TO BINARY (64) - op_CVBY uint32 = 0xE306 // FORMAT_RXY1 CONVERT TO BINARY (32) - op_CVD uint32 = 0x4E00 // FORMAT_RX1 CONVERT TO DECIMAL (32) - op_CVDG uint32 = 0xE32E // FORMAT_RXY1 CONVERT TO DECIMAL (64) - op_CVDY uint32 = 0xE326 // FORMAT_RXY1 CONVERT TO DECIMAL (32) - op_CXBR uint32 = 0xB349 // FORMAT_RRE COMPARE (extended BFP) - op_CXFBR uint32 = 0xB396 // FORMAT_RRE CONVERT FROM FIXED (32 to extended BFP) - op_CXFBRA uint32 = 0xB396 // FORMAT_RRF5 CONVERT FROM FIXED (32 to extended BFP) - op_CXFR uint32 = 0xB3B6 // FORMAT_RRE CONVERT FROM FIXED (32 to extended HFP) - op_CXFTR uint32 = 0xB959 // FORMAT_RRE CONVERT FROM FIXED (32 to extended DFP) - op_CXGBR uint32 = 0xB3A6 // FORMAT_RRE CONVERT FROM FIXED (64 to extended BFP) - op_CXGBRA uint32 = 0xB3A6 // FORMAT_RRF5 CONVERT FROM FIXED (64 to extended BFP) - op_CXGR uint32 = 0xB3C6 // FORMAT_RRE CONVERT FROM FIXED (64 to extended HFP) - op_CXGTR uint32 = 0xB3F9 // FORMAT_RRE CONVERT FROM FIXED (64 to extended DFP) - op_CXGTRA uint32 = 0xB3F9 // FORMAT_RRF5 CONVERT FROM FIXED (64 to extended DFP) - op_CXLFBR uint32 = 0xB392 // FORMAT_RRF5 CONVERT FROM LOGICAL (32 to extended BFP) - op_CXLFTR uint32 = 0xB95B // FORMAT_RRF5 CONVERT FROM LOGICAL (32 to extended DFP) - op_CXLGBR uint32 = 0xB3A2 // FORMAT_RRF5 CONVERT FROM LOGICAL (64 to extended BFP) - op_CXLGTR uint32 = 0xB95A // FORMAT_RRF5 CONVERT FROM LOGICAL (64 to extended DFP) - op_CXR uint32 = 0xB369 // FORMAT_RRE COMPARE (extended HFP) - op_CXSTR uint32 = 0xB3FB // FORMAT_RRE CONVERT FROM SIGNED PACKED (128 to extended DFP) - op_CXTR uint32 = 0xB3EC // FORMAT_RRE COMPARE (extended DFP) - op_CXUTR uint32 = 0xB3FA // FORMAT_RRE CONVERT FROM UNSIGNED PACKED (128 to ext. DFP) - op_CXZT uint32 = 0xEDAB // FORMAT_RSL CONVERT FROM ZONED (to extended DFP) - op_CY uint32 = 0xE359 // FORMAT_RXY1 COMPARE (32) - op_CZDT uint32 = 0xEDA8 // FORMAT_RSL CONVERT TO ZONED (from long DFP) - op_CZXT uint32 = 0xEDA9 // FORMAT_RSL CONVERT TO ZONED (from extended DFP) - op_D uint32 = 0x5D00 // FORMAT_RX1 DIVIDE (32<-64) - op_DD uint32 = 0x6D00 // FORMAT_RX1 DIVIDE (long HFP) - op_DDB uint32 = 0xED1D // FORMAT_RXE DIVIDE (long BFP) - op_DDBR uint32 = 0xB31D // FORMAT_RRE DIVIDE (long BFP) - op_DDR uint32 = 0x2D00 // FORMAT_RR DIVIDE (long HFP) - op_DDTR uint32 = 0xB3D1 // FORMAT_RRF1 DIVIDE (long DFP) - op_DDTRA uint32 = 0xB3D1 // FORMAT_RRF1 DIVIDE (long DFP) - op_DE uint32 = 0x7D00 // FORMAT_RX1 DIVIDE (short HFP) - op_DEB uint32 = 0xED0D // FORMAT_RXE DIVIDE (short BFP) - op_DEBR uint32 = 0xB30D // FORMAT_RRE DIVIDE (short BFP) - op_DER uint32 = 0x3D00 // FORMAT_RR DIVIDE (short HFP) - op_DIDBR uint32 = 0xB35B // FORMAT_RRF2 DIVIDE TO INTEGER (long BFP) - op_DIEBR uint32 = 0xB353 // FORMAT_RRF2 DIVIDE TO INTEGER (short BFP) - op_DL uint32 = 0xE397 // FORMAT_RXY1 DIVIDE LOGICAL (32<-64) - op_DLG uint32 = 0xE387 // FORMAT_RXY1 DIVIDE LOGICAL (64<-128) - op_DLGR uint32 = 0xB987 // FORMAT_RRE DIVIDE LOGICAL (64<-128) - op_DLR uint32 = 0xB997 // FORMAT_RRE DIVIDE LOGICAL (32<-64) - op_DP uint32 = 0xFD00 // FORMAT_SS2 DIVIDE DECIMAL - op_DR uint32 = 0x1D00 // FORMAT_RR DIVIDE (32<-64) - op_DSG uint32 = 0xE30D // FORMAT_RXY1 DIVIDE SINGLE (64) - op_DSGF uint32 = 0xE31D // FORMAT_RXY1 DIVIDE SINGLE (64<-32) - op_DSGFR uint32 = 0xB91D // FORMAT_RRE DIVIDE SINGLE (64<-32) - op_DSGR uint32 = 0xB90D // FORMAT_RRE DIVIDE SINGLE (64) - op_DXBR uint32 = 0xB34D // FORMAT_RRE DIVIDE (extended BFP) - op_DXR uint32 = 0xB22D // FORMAT_RRE DIVIDE (extended HFP) - op_DXTR uint32 = 0xB3D9 // FORMAT_RRF1 DIVIDE (extended DFP) - op_DXTRA uint32 = 0xB3D9 // FORMAT_RRF1 DIVIDE (extended DFP) - op_EAR uint32 = 0xB24F // FORMAT_RRE EXTRACT ACCESS - op_ECAG uint32 = 0xEB4C // FORMAT_RSY1 EXTRACT CACHE ATTRIBUTE - op_ECTG uint32 = 0xC801 // FORMAT_SSF EXTRACT CPU TIME - op_ED uint32 = 0xDE00 // FORMAT_SS1 EDIT - op_EDMK uint32 = 0xDF00 // FORMAT_SS1 EDIT AND MARK - op_EEDTR uint32 = 0xB3E5 // FORMAT_RRE EXTRACT BIASED EXPONENT (long DFP to 64) - op_EEXTR uint32 = 0xB3ED // FORMAT_RRE EXTRACT BIASED EXPONENT (extended DFP to 64) - op_EFPC uint32 = 0xB38C // FORMAT_RRE EXTRACT FPC - op_EPAIR uint32 = 0xB99A // FORMAT_RRE EXTRACT PRIMARY ASN AND INSTANCE - op_EPAR uint32 = 0xB226 // FORMAT_RRE EXTRACT PRIMARY ASN - op_EPSW uint32 = 0xB98D // FORMAT_RRE EXTRACT PSW - op_EREG uint32 = 0xB249 // FORMAT_RRE EXTRACT STACKED REGISTERS (32) - op_EREGG uint32 = 0xB90E // FORMAT_RRE EXTRACT STACKED REGISTERS (64) - op_ESAIR uint32 = 0xB99B // FORMAT_RRE EXTRACT SECONDARY ASN AND INSTANCE - op_ESAR uint32 = 0xB227 // FORMAT_RRE EXTRACT SECONDARY ASN - op_ESDTR uint32 = 0xB3E7 // FORMAT_RRE EXTRACT SIGNIFICANCE (long DFP) - op_ESEA uint32 = 0xB99D // FORMAT_RRE EXTRACT AND SET EXTENDED AUTHORITY - op_ESTA uint32 = 0xB24A // FORMAT_RRE EXTRACT STACKED STATE - op_ESXTR uint32 = 0xB3EF // FORMAT_RRE EXTRACT SIGNIFICANCE (extended DFP) - op_ETND uint32 = 0xB2EC // FORMAT_RRE EXTRACT TRANSACTION NESTING DEPTH - op_EX uint32 = 0x4400 // FORMAT_RX1 EXECUTE - op_EXRL uint32 = 0xC600 // FORMAT_RIL2 EXECUTE RELATIVE LONG - op_FIDBR uint32 = 0xB35F // FORMAT_RRF5 LOAD FP INTEGER (long BFP) - op_FIDBRA uint32 = 0xB35F // FORMAT_RRF5 LOAD FP INTEGER (long BFP) - op_FIDR uint32 = 0xB37F // FORMAT_RRE LOAD FP INTEGER (long HFP) - op_FIDTR uint32 = 0xB3D7 // FORMAT_RRF5 LOAD FP INTEGER (long DFP) - op_FIEBR uint32 = 0xB357 // FORMAT_RRF5 LOAD FP INTEGER (short BFP) - op_FIEBRA uint32 = 0xB357 // FORMAT_RRF5 LOAD FP INTEGER (short BFP) - op_FIER uint32 = 0xB377 // FORMAT_RRE LOAD FP INTEGER (short HFP) - op_FIXBR uint32 = 0xB347 // FORMAT_RRF5 LOAD FP INTEGER (extended BFP) - op_FIXBRA uint32 = 0xB347 // FORMAT_RRF5 LOAD FP INTEGER (extended BFP) - op_FIXR uint32 = 0xB367 // FORMAT_RRE LOAD FP INTEGER (extended HFP) - op_FIXTR uint32 = 0xB3DF // FORMAT_RRF5 LOAD FP INTEGER (extended DFP) - op_FLOGR uint32 = 0xB983 // FORMAT_RRE FIND LEFTMOST ONE - op_HDR uint32 = 0x2400 // FORMAT_RR HALVE (long HFP) - op_HER uint32 = 0x3400 // FORMAT_RR HALVE (short HFP) - op_HSCH uint32 = 0xB231 // FORMAT_S HALT SUBCHANNEL - op_IAC uint32 = 0xB224 // FORMAT_RRE INSERT ADDRESS SPACE CONTROL - op_IC uint32 = 0x4300 // FORMAT_RX1 INSERT CHARACTER - op_ICM uint32 = 0xBF00 // FORMAT_RS2 INSERT CHARACTERS UNDER MASK (low) - op_ICMH uint32 = 0xEB80 // FORMAT_RSY2 INSERT CHARACTERS UNDER MASK (high) - op_ICMY uint32 = 0xEB81 // FORMAT_RSY2 INSERT CHARACTERS UNDER MASK (low) - op_ICY uint32 = 0xE373 // FORMAT_RXY1 INSERT CHARACTER - op_IDTE uint32 = 0xB98E // FORMAT_RRF2 INVALIDATE DAT TABLE ENTRY - op_IEDTR uint32 = 0xB3F6 // FORMAT_RRF2 INSERT BIASED EXPONENT (64 to long DFP) - op_IEXTR uint32 = 0xB3FE // FORMAT_RRF2 INSERT BIASED EXPONENT (64 to extended DFP) - op_IIHF uint32 = 0xC008 // FORMAT_RIL1 INSERT IMMEDIATE (high) - op_IIHH uint32 = 0xA500 // FORMAT_RI1 INSERT IMMEDIATE (high high) - op_IIHL uint32 = 0xA501 // FORMAT_RI1 INSERT IMMEDIATE (high low) - op_IILF uint32 = 0xC009 // FORMAT_RIL1 INSERT IMMEDIATE (low) - op_IILH uint32 = 0xA502 // FORMAT_RI1 INSERT IMMEDIATE (low high) - op_IILL uint32 = 0xA503 // FORMAT_RI1 INSERT IMMEDIATE (low low) - op_IPK uint32 = 0xB20B // FORMAT_S INSERT PSW KEY - op_IPM uint32 = 0xB222 // FORMAT_RRE INSERT PROGRAM MASK - op_IPTE uint32 = 0xB221 // FORMAT_RRF1 INVALIDATE PAGE TABLE ENTRY - op_ISKE uint32 = 0xB229 // FORMAT_RRE INSERT STORAGE KEY EXTENDED - op_IVSK uint32 = 0xB223 // FORMAT_RRE INSERT VIRTUAL STORAGE KEY - op_KDB uint32 = 0xED18 // FORMAT_RXE COMPARE AND SIGNAL (long BFP) - op_KDBR uint32 = 0xB318 // FORMAT_RRE COMPARE AND SIGNAL (long BFP) - op_KDTR uint32 = 0xB3E0 // FORMAT_RRE COMPARE AND SIGNAL (long DFP) - op_KEB uint32 = 0xED08 // FORMAT_RXE COMPARE AND SIGNAL (short BFP) - op_KEBR uint32 = 0xB308 // FORMAT_RRE COMPARE AND SIGNAL (short BFP) - op_KIMD uint32 = 0xB93E // FORMAT_RRE COMPUTE INTERMEDIATE MESSAGE DIGEST - op_KLMD uint32 = 0xB93F // FORMAT_RRE COMPUTE LAST MESSAGE DIGEST - op_KM uint32 = 0xB92E // FORMAT_RRE CIPHER MESSAGE - op_KMAC uint32 = 0xB91E // FORMAT_RRE COMPUTE MESSAGE AUTHENTICATION CODE - op_KMC uint32 = 0xB92F // FORMAT_RRE CIPHER MESSAGE WITH CHAINING - op_KMCTR uint32 = 0xB92D // FORMAT_RRF2 CIPHER MESSAGE WITH COUNTER - op_KMF uint32 = 0xB92A // FORMAT_RRE CIPHER MESSAGE WITH CFB - op_KMO uint32 = 0xB92B // FORMAT_RRE CIPHER MESSAGE WITH OFB - op_KXBR uint32 = 0xB348 // FORMAT_RRE COMPARE AND SIGNAL (extended BFP) - op_KXTR uint32 = 0xB3E8 // FORMAT_RRE COMPARE AND SIGNAL (extended DFP) - op_L uint32 = 0x5800 // FORMAT_RX1 LOAD (32) - op_LA uint32 = 0x4100 // FORMAT_RX1 LOAD ADDRESS - op_LAA uint32 = 0xEBF8 // FORMAT_RSY1 LOAD AND ADD (32) - op_LAAG uint32 = 0xEBE8 // FORMAT_RSY1 LOAD AND ADD (64) - op_LAAL uint32 = 0xEBFA // FORMAT_RSY1 LOAD AND ADD LOGICAL (32) - op_LAALG uint32 = 0xEBEA // FORMAT_RSY1 LOAD AND ADD LOGICAL (64) - op_LAE uint32 = 0x5100 // FORMAT_RX1 LOAD ADDRESS EXTENDED - op_LAEY uint32 = 0xE375 // FORMAT_RXY1 LOAD ADDRESS EXTENDED - op_LAM uint32 = 0x9A00 // FORMAT_RS1 LOAD ACCESS MULTIPLE - op_LAMY uint32 = 0xEB9A // FORMAT_RSY1 LOAD ACCESS MULTIPLE - op_LAN uint32 = 0xEBF4 // FORMAT_RSY1 LOAD AND AND (32) - op_LANG uint32 = 0xEBE4 // FORMAT_RSY1 LOAD AND AND (64) - op_LAO uint32 = 0xEBF6 // FORMAT_RSY1 LOAD AND OR (32) - op_LAOG uint32 = 0xEBE6 // FORMAT_RSY1 LOAD AND OR (64) - op_LARL uint32 = 0xC000 // FORMAT_RIL2 LOAD ADDRESS RELATIVE LONG - op_LASP uint32 = 0xE500 // FORMAT_SSE LOAD ADDRESS SPACE PARAMETERS - op_LAT uint32 = 0xE39F // FORMAT_RXY1 LOAD AND TRAP (32L<-32) - op_LAX uint32 = 0xEBF7 // FORMAT_RSY1 LOAD AND EXCLUSIVE OR (32) - op_LAXG uint32 = 0xEBE7 // FORMAT_RSY1 LOAD AND EXCLUSIVE OR (64) - op_LAY uint32 = 0xE371 // FORMAT_RXY1 LOAD ADDRESS - op_LB uint32 = 0xE376 // FORMAT_RXY1 LOAD BYTE (32) - op_LBH uint32 = 0xE3C0 // FORMAT_RXY1 LOAD BYTE HIGH (32<-8) - op_LBR uint32 = 0xB926 // FORMAT_RRE LOAD BYTE (32) - op_LCDBR uint32 = 0xB313 // FORMAT_RRE LOAD COMPLEMENT (long BFP) - op_LCDFR uint32 = 0xB373 // FORMAT_RRE LOAD COMPLEMENT (long) - op_LCDR uint32 = 0x2300 // FORMAT_RR LOAD COMPLEMENT (long HFP) - op_LCEBR uint32 = 0xB303 // FORMAT_RRE LOAD COMPLEMENT (short BFP) - op_LCER uint32 = 0x3300 // FORMAT_RR LOAD COMPLEMENT (short HFP) - op_LCGFR uint32 = 0xB913 // FORMAT_RRE LOAD COMPLEMENT (64<-32) - op_LCGR uint32 = 0xB903 // FORMAT_RRE LOAD COMPLEMENT (64) - op_LCR uint32 = 0x1300 // FORMAT_RR LOAD COMPLEMENT (32) - op_LCTL uint32 = 0xB700 // FORMAT_RS1 LOAD CONTROL (32) - op_LCTLG uint32 = 0xEB2F // FORMAT_RSY1 LOAD CONTROL (64) - op_LCXBR uint32 = 0xB343 // FORMAT_RRE LOAD COMPLEMENT (extended BFP) - op_LCXR uint32 = 0xB363 // FORMAT_RRE LOAD COMPLEMENT (extended HFP) - op_LD uint32 = 0x6800 // FORMAT_RX1 LOAD (long) - op_LDE uint32 = 0xED24 // FORMAT_RXE LOAD LENGTHENED (short to long HFP) - op_LDEB uint32 = 0xED04 // FORMAT_RXE LOAD LENGTHENED (short to long BFP) - op_LDEBR uint32 = 0xB304 // FORMAT_RRE LOAD LENGTHENED (short to long BFP) - op_LDER uint32 = 0xB324 // FORMAT_RRE LOAD LENGTHENED (short to long HFP) - op_LDETR uint32 = 0xB3D4 // FORMAT_RRF4 LOAD LENGTHENED (short to long DFP) - op_LDGR uint32 = 0xB3C1 // FORMAT_RRE LOAD FPR FROM GR (64 to long) - op_LDR uint32 = 0x2800 // FORMAT_RR LOAD (long) - op_LDXBR uint32 = 0xB345 // FORMAT_RRE LOAD ROUNDED (extended to long BFP) - op_LDXBRA uint32 = 0xB345 // FORMAT_RRF5 LOAD ROUNDED (extended to long BFP) - op_LDXR uint32 = 0x2500 // FORMAT_RR LOAD ROUNDED (extended to long HFP) - op_LDXTR uint32 = 0xB3DD // FORMAT_RRF5 LOAD ROUNDED (extended to long DFP) - op_LDY uint32 = 0xED65 // FORMAT_RXY1 LOAD (long) - op_LE uint32 = 0x7800 // FORMAT_RX1 LOAD (short) - op_LEDBR uint32 = 0xB344 // FORMAT_RRE LOAD ROUNDED (long to short BFP) - op_LEDBRA uint32 = 0xB344 // FORMAT_RRF5 LOAD ROUNDED (long to short BFP) - op_LEDR uint32 = 0x3500 // FORMAT_RR LOAD ROUNDED (long to short HFP) - op_LEDTR uint32 = 0xB3D5 // FORMAT_RRF5 LOAD ROUNDED (long to short DFP) - op_LER uint32 = 0x3800 // FORMAT_RR LOAD (short) - op_LEXBR uint32 = 0xB346 // FORMAT_RRE LOAD ROUNDED (extended to short BFP) - op_LEXBRA uint32 = 0xB346 // FORMAT_RRF5 LOAD ROUNDED (extended to short BFP) - op_LEXR uint32 = 0xB366 // FORMAT_RRE LOAD ROUNDED (extended to short HFP) - op_LEY uint32 = 0xED64 // FORMAT_RXY1 LOAD (short) - op_LFAS uint32 = 0xB2BD // FORMAT_S LOAD FPC AND SIGNAL - op_LFH uint32 = 0xE3CA // FORMAT_RXY1 LOAD HIGH (32) - op_LFHAT uint32 = 0xE3C8 // FORMAT_RXY1 LOAD HIGH AND TRAP (32H<-32) - op_LFPC uint32 = 0xB29D // FORMAT_S LOAD FPC - op_LG uint32 = 0xE304 // FORMAT_RXY1 LOAD (64) - op_LGAT uint32 = 0xE385 // FORMAT_RXY1 LOAD AND TRAP (64) - op_LGB uint32 = 0xE377 // FORMAT_RXY1 LOAD BYTE (64) - op_LGBR uint32 = 0xB906 // FORMAT_RRE LOAD BYTE (64) - op_LGDR uint32 = 0xB3CD // FORMAT_RRE LOAD GR FROM FPR (long to 64) - op_LGF uint32 = 0xE314 // FORMAT_RXY1 LOAD (64<-32) - op_LGFI uint32 = 0xC001 // FORMAT_RIL1 LOAD IMMEDIATE (64<-32) - op_LGFR uint32 = 0xB914 // FORMAT_RRE LOAD (64<-32) - op_LGFRL uint32 = 0xC40C // FORMAT_RIL2 LOAD RELATIVE LONG (64<-32) - op_LGH uint32 = 0xE315 // FORMAT_RXY1 LOAD HALFWORD (64) - op_LGHI uint32 = 0xA709 // FORMAT_RI1 LOAD HALFWORD IMMEDIATE (64) - op_LGHR uint32 = 0xB907 // FORMAT_RRE LOAD HALFWORD (64) - op_LGHRL uint32 = 0xC404 // FORMAT_RIL2 LOAD HALFWORD RELATIVE LONG (64<-16) - op_LGR uint32 = 0xB904 // FORMAT_RRE LOAD (64) - op_LGRL uint32 = 0xC408 // FORMAT_RIL2 LOAD RELATIVE LONG (64) - op_LH uint32 = 0x4800 // FORMAT_RX1 LOAD HALFWORD (32) - op_LHH uint32 = 0xE3C4 // FORMAT_RXY1 LOAD HALFWORD HIGH (32<-16) - op_LHI uint32 = 0xA708 // FORMAT_RI1 LOAD HALFWORD IMMEDIATE (32) - op_LHR uint32 = 0xB927 // FORMAT_RRE LOAD HALFWORD (32) - op_LHRL uint32 = 0xC405 // FORMAT_RIL2 LOAD HALFWORD RELATIVE LONG (32<-16) - op_LHY uint32 = 0xE378 // FORMAT_RXY1 LOAD HALFWORD (32) - op_LLC uint32 = 0xE394 // FORMAT_RXY1 LOAD LOGICAL CHARACTER (32) - op_LLCH uint32 = 0xE3C2 // FORMAT_RXY1 LOAD LOGICAL CHARACTER HIGH (32<-8) - op_LLCR uint32 = 0xB994 // FORMAT_RRE LOAD LOGICAL CHARACTER (32) - op_LLGC uint32 = 0xE390 // FORMAT_RXY1 LOAD LOGICAL CHARACTER (64) - op_LLGCR uint32 = 0xB984 // FORMAT_RRE LOAD LOGICAL CHARACTER (64) - op_LLGF uint32 = 0xE316 // FORMAT_RXY1 LOAD LOGICAL (64<-32) - op_LLGFAT uint32 = 0xE39D // FORMAT_RXY1 LOAD LOGICAL AND TRAP (64<-32) - op_LLGFR uint32 = 0xB916 // FORMAT_RRE LOAD LOGICAL (64<-32) - op_LLGFRL uint32 = 0xC40E // FORMAT_RIL2 LOAD LOGICAL RELATIVE LONG (64<-32) - op_LLGH uint32 = 0xE391 // FORMAT_RXY1 LOAD LOGICAL HALFWORD (64) - op_LLGHR uint32 = 0xB985 // FORMAT_RRE LOAD LOGICAL HALFWORD (64) - op_LLGHRL uint32 = 0xC406 // FORMAT_RIL2 LOAD LOGICAL HALFWORD RELATIVE LONG (64<-16) - op_LLGT uint32 = 0xE317 // FORMAT_RXY1 LOAD LOGICAL THIRTY ONE BITS - op_LLGTAT uint32 = 0xE39C // FORMAT_RXY1 LOAD LOGICAL THIRTY ONE BITS AND TRAP (64<-31) - op_LLGTR uint32 = 0xB917 // FORMAT_RRE LOAD LOGICAL THIRTY ONE BITS - op_LLH uint32 = 0xE395 // FORMAT_RXY1 LOAD LOGICAL HALFWORD (32) - op_LLHH uint32 = 0xE3C6 // FORMAT_RXY1 LOAD LOGICAL HALFWORD HIGH (32<-16) - op_LLHR uint32 = 0xB995 // FORMAT_RRE LOAD LOGICAL HALFWORD (32) - op_LLHRL uint32 = 0xC402 // FORMAT_RIL2 LOAD LOGICAL HALFWORD RELATIVE LONG (32<-16) - op_LLIHF uint32 = 0xC00E // FORMAT_RIL1 LOAD LOGICAL IMMEDIATE (high) - op_LLIHH uint32 = 0xA50C // FORMAT_RI1 LOAD LOGICAL IMMEDIATE (high high) - op_LLIHL uint32 = 0xA50D // FORMAT_RI1 LOAD LOGICAL IMMEDIATE (high low) - op_LLILF uint32 = 0xC00F // FORMAT_RIL1 LOAD LOGICAL IMMEDIATE (low) - op_LLILH uint32 = 0xA50E // FORMAT_RI1 LOAD LOGICAL IMMEDIATE (low high) - op_LLILL uint32 = 0xA50F // FORMAT_RI1 LOAD LOGICAL IMMEDIATE (low low) - op_LM uint32 = 0x9800 // FORMAT_RS1 LOAD MULTIPLE (32) - op_LMD uint32 = 0xEF00 // FORMAT_SS5 LOAD MULTIPLE DISJOINT - op_LMG uint32 = 0xEB04 // FORMAT_RSY1 LOAD MULTIPLE (64) - op_LMH uint32 = 0xEB96 // FORMAT_RSY1 LOAD MULTIPLE HIGH - op_LMY uint32 = 0xEB98 // FORMAT_RSY1 LOAD MULTIPLE (32) - op_LNDBR uint32 = 0xB311 // FORMAT_RRE LOAD NEGATIVE (long BFP) - op_LNDFR uint32 = 0xB371 // FORMAT_RRE LOAD NEGATIVE (long) - op_LNDR uint32 = 0x2100 // FORMAT_RR LOAD NEGATIVE (long HFP) - op_LNEBR uint32 = 0xB301 // FORMAT_RRE LOAD NEGATIVE (short BFP) - op_LNER uint32 = 0x3100 // FORMAT_RR LOAD NEGATIVE (short HFP) - op_LNGFR uint32 = 0xB911 // FORMAT_RRE LOAD NEGATIVE (64<-32) - op_LNGR uint32 = 0xB901 // FORMAT_RRE LOAD NEGATIVE (64) - op_LNR uint32 = 0x1100 // FORMAT_RR LOAD NEGATIVE (32) - op_LNXBR uint32 = 0xB341 // FORMAT_RRE LOAD NEGATIVE (extended BFP) - op_LNXR uint32 = 0xB361 // FORMAT_RRE LOAD NEGATIVE (extended HFP) - op_LOC uint32 = 0xEBF2 // FORMAT_RSY2 LOAD ON CONDITION (32) - op_LOCG uint32 = 0xEBE2 // FORMAT_RSY2 LOAD ON CONDITION (64) - op_LOCGR uint32 = 0xB9E2 // FORMAT_RRF3 LOAD ON CONDITION (64) - op_LOCR uint32 = 0xB9F2 // FORMAT_RRF3 LOAD ON CONDITION (32) - op_LPD uint32 = 0xC804 // FORMAT_SSF LOAD PAIR DISJOINT (32) - op_LPDBR uint32 = 0xB310 // FORMAT_RRE LOAD POSITIVE (long BFP) - op_LPDFR uint32 = 0xB370 // FORMAT_RRE LOAD POSITIVE (long) - op_LPDG uint32 = 0xC805 // FORMAT_SSF LOAD PAIR DISJOINT (64) - op_LPDR uint32 = 0x2000 // FORMAT_RR LOAD POSITIVE (long HFP) - op_LPEBR uint32 = 0xB300 // FORMAT_RRE LOAD POSITIVE (short BFP) - op_LPER uint32 = 0x3000 // FORMAT_RR LOAD POSITIVE (short HFP) - op_LPGFR uint32 = 0xB910 // FORMAT_RRE LOAD POSITIVE (64<-32) - op_LPGR uint32 = 0xB900 // FORMAT_RRE LOAD POSITIVE (64) - op_LPQ uint32 = 0xE38F // FORMAT_RXY1 LOAD PAIR FROM QUADWORD - op_LPR uint32 = 0x1000 // FORMAT_RR LOAD POSITIVE (32) - op_LPSW uint32 = 0x8200 // FORMAT_S LOAD PSW - op_LPSWE uint32 = 0xB2B2 // FORMAT_S LOAD PSW EXTENDED - op_LPTEA uint32 = 0xB9AA // FORMAT_RRF2 LOAD PAGE TABLE ENTRY ADDRESS - op_LPXBR uint32 = 0xB340 // FORMAT_RRE LOAD POSITIVE (extended BFP) - op_LPXR uint32 = 0xB360 // FORMAT_RRE LOAD POSITIVE (extended HFP) - op_LR uint32 = 0x1800 // FORMAT_RR LOAD (32) - op_LRA uint32 = 0xB100 // FORMAT_RX1 LOAD REAL ADDRESS (32) - op_LRAG uint32 = 0xE303 // FORMAT_RXY1 LOAD REAL ADDRESS (64) - op_LRAY uint32 = 0xE313 // FORMAT_RXY1 LOAD REAL ADDRESS (32) - op_LRDR uint32 = 0x2500 // FORMAT_RR LOAD ROUNDED (extended to long HFP) - op_LRER uint32 = 0x3500 // FORMAT_RR LOAD ROUNDED (long to short HFP) - op_LRL uint32 = 0xC40D // FORMAT_RIL2 LOAD RELATIVE LONG (32) - op_LRV uint32 = 0xE31E // FORMAT_RXY1 LOAD REVERSED (32) - op_LRVG uint32 = 0xE30F // FORMAT_RXY1 LOAD REVERSED (64) - op_LRVGR uint32 = 0xB90F // FORMAT_RRE LOAD REVERSED (64) - op_LRVH uint32 = 0xE31F // FORMAT_RXY1 LOAD REVERSED (16) - op_LRVR uint32 = 0xB91F // FORMAT_RRE LOAD REVERSED (32) - op_LT uint32 = 0xE312 // FORMAT_RXY1 LOAD AND TEST (32) - op_LTDBR uint32 = 0xB312 // FORMAT_RRE LOAD AND TEST (long BFP) - op_LTDR uint32 = 0x2200 // FORMAT_RR LOAD AND TEST (long HFP) - op_LTDTR uint32 = 0xB3D6 // FORMAT_RRE LOAD AND TEST (long DFP) - op_LTEBR uint32 = 0xB302 // FORMAT_RRE LOAD AND TEST (short BFP) - op_LTER uint32 = 0x3200 // FORMAT_RR LOAD AND TEST (short HFP) - op_LTG uint32 = 0xE302 // FORMAT_RXY1 LOAD AND TEST (64) - op_LTGF uint32 = 0xE332 // FORMAT_RXY1 LOAD AND TEST (64<-32) - op_LTGFR uint32 = 0xB912 // FORMAT_RRE LOAD AND TEST (64<-32) - op_LTGR uint32 = 0xB902 // FORMAT_RRE LOAD AND TEST (64) - op_LTR uint32 = 0x1200 // FORMAT_RR LOAD AND TEST (32) - op_LTXBR uint32 = 0xB342 // FORMAT_RRE LOAD AND TEST (extended BFP) - op_LTXR uint32 = 0xB362 // FORMAT_RRE LOAD AND TEST (extended HFP) - op_LTXTR uint32 = 0xB3DE // FORMAT_RRE LOAD AND TEST (extended DFP) - op_LURA uint32 = 0xB24B // FORMAT_RRE LOAD USING REAL ADDRESS (32) - op_LURAG uint32 = 0xB905 // FORMAT_RRE LOAD USING REAL ADDRESS (64) - op_LXD uint32 = 0xED25 // FORMAT_RXE LOAD LENGTHENED (long to extended HFP) - op_LXDB uint32 = 0xED05 // FORMAT_RXE LOAD LENGTHENED (long to extended BFP) - op_LXDBR uint32 = 0xB305 // FORMAT_RRE LOAD LENGTHENED (long to extended BFP) - op_LXDR uint32 = 0xB325 // FORMAT_RRE LOAD LENGTHENED (long to extended HFP) - op_LXDTR uint32 = 0xB3DC // FORMAT_RRF4 LOAD LENGTHENED (long to extended DFP) - op_LXE uint32 = 0xED26 // FORMAT_RXE LOAD LENGTHENED (short to extended HFP) - op_LXEB uint32 = 0xED06 // FORMAT_RXE LOAD LENGTHENED (short to extended BFP) - op_LXEBR uint32 = 0xB306 // FORMAT_RRE LOAD LENGTHENED (short to extended BFP) - op_LXER uint32 = 0xB326 // FORMAT_RRE LOAD LENGTHENED (short to extended HFP) - op_LXR uint32 = 0xB365 // FORMAT_RRE LOAD (extended) - op_LY uint32 = 0xE358 // FORMAT_RXY1 LOAD (32) - op_LZDR uint32 = 0xB375 // FORMAT_RRE LOAD ZERO (long) - op_LZER uint32 = 0xB374 // FORMAT_RRE LOAD ZERO (short) - op_LZXR uint32 = 0xB376 // FORMAT_RRE LOAD ZERO (extended) - op_M uint32 = 0x5C00 // FORMAT_RX1 MULTIPLY (64<-32) - op_MAD uint32 = 0xED3E // FORMAT_RXF MULTIPLY AND ADD (long HFP) - op_MADB uint32 = 0xED1E // FORMAT_RXF MULTIPLY AND ADD (long BFP) - op_MADBR uint32 = 0xB31E // FORMAT_RRD MULTIPLY AND ADD (long BFP) - op_MADR uint32 = 0xB33E // FORMAT_RRD MULTIPLY AND ADD (long HFP) - op_MAE uint32 = 0xED2E // FORMAT_RXF MULTIPLY AND ADD (short HFP) - op_MAEB uint32 = 0xED0E // FORMAT_RXF MULTIPLY AND ADD (short BFP) - op_MAEBR uint32 = 0xB30E // FORMAT_RRD MULTIPLY AND ADD (short BFP) - op_MAER uint32 = 0xB32E // FORMAT_RRD MULTIPLY AND ADD (short HFP) - op_MAY uint32 = 0xED3A // FORMAT_RXF MULTIPLY & ADD UNNORMALIZED (long to ext. HFP) - op_MAYH uint32 = 0xED3C // FORMAT_RXF MULTIPLY AND ADD UNNRM. (long to ext. high HFP) - op_MAYHR uint32 = 0xB33C // FORMAT_RRD MULTIPLY AND ADD UNNRM. (long to ext. high HFP) - op_MAYL uint32 = 0xED38 // FORMAT_RXF MULTIPLY AND ADD UNNRM. (long to ext. low HFP) - op_MAYLR uint32 = 0xB338 // FORMAT_RRD MULTIPLY AND ADD UNNRM. (long to ext. low HFP) - op_MAYR uint32 = 0xB33A // FORMAT_RRD MULTIPLY & ADD UNNORMALIZED (long to ext. HFP) - op_MC uint32 = 0xAF00 // FORMAT_SI MONITOR CALL - op_MD uint32 = 0x6C00 // FORMAT_RX1 MULTIPLY (long HFP) - op_MDB uint32 = 0xED1C // FORMAT_RXE MULTIPLY (long BFP) - op_MDBR uint32 = 0xB31C // FORMAT_RRE MULTIPLY (long BFP) - op_MDE uint32 = 0x7C00 // FORMAT_RX1 MULTIPLY (short to long HFP) - op_MDEB uint32 = 0xED0C // FORMAT_RXE MULTIPLY (short to long BFP) - op_MDEBR uint32 = 0xB30C // FORMAT_RRE MULTIPLY (short to long BFP) - op_MDER uint32 = 0x3C00 // FORMAT_RR MULTIPLY (short to long HFP) - op_MDR uint32 = 0x2C00 // FORMAT_RR MULTIPLY (long HFP) - op_MDTR uint32 = 0xB3D0 // FORMAT_RRF1 MULTIPLY (long DFP) - op_MDTRA uint32 = 0xB3D0 // FORMAT_RRF1 MULTIPLY (long DFP) - op_ME uint32 = 0x7C00 // FORMAT_RX1 MULTIPLY (short to long HFP) - op_MEE uint32 = 0xED37 // FORMAT_RXE MULTIPLY (short HFP) - op_MEEB uint32 = 0xED17 // FORMAT_RXE MULTIPLY (short BFP) - op_MEEBR uint32 = 0xB317 // FORMAT_RRE MULTIPLY (short BFP) - op_MEER uint32 = 0xB337 // FORMAT_RRE MULTIPLY (short HFP) - op_MER uint32 = 0x3C00 // FORMAT_RR MULTIPLY (short to long HFP) - op_MFY uint32 = 0xE35C // FORMAT_RXY1 MULTIPLY (64<-32) - op_MGHI uint32 = 0xA70D // FORMAT_RI1 MULTIPLY HALFWORD IMMEDIATE (64) - op_MH uint32 = 0x4C00 // FORMAT_RX1 MULTIPLY HALFWORD (32) - op_MHI uint32 = 0xA70C // FORMAT_RI1 MULTIPLY HALFWORD IMMEDIATE (32) - op_MHY uint32 = 0xE37C // FORMAT_RXY1 MULTIPLY HALFWORD (32) - op_ML uint32 = 0xE396 // FORMAT_RXY1 MULTIPLY LOGICAL (64<-32) - op_MLG uint32 = 0xE386 // FORMAT_RXY1 MULTIPLY LOGICAL (128<-64) - op_MLGR uint32 = 0xB986 // FORMAT_RRE MULTIPLY LOGICAL (128<-64) - op_MLR uint32 = 0xB996 // FORMAT_RRE MULTIPLY LOGICAL (64<-32) - op_MP uint32 = 0xFC00 // FORMAT_SS2 MULTIPLY DECIMAL - op_MR uint32 = 0x1C00 // FORMAT_RR MULTIPLY (64<-32) - op_MS uint32 = 0x7100 // FORMAT_RX1 MULTIPLY SINGLE (32) - op_MSCH uint32 = 0xB232 // FORMAT_S MODIFY SUBCHANNEL - op_MSD uint32 = 0xED3F // FORMAT_RXF MULTIPLY AND SUBTRACT (long HFP) - op_MSDB uint32 = 0xED1F // FORMAT_RXF MULTIPLY AND SUBTRACT (long BFP) - op_MSDBR uint32 = 0xB31F // FORMAT_RRD MULTIPLY AND SUBTRACT (long BFP) - op_MSDR uint32 = 0xB33F // FORMAT_RRD MULTIPLY AND SUBTRACT (long HFP) - op_MSE uint32 = 0xED2F // FORMAT_RXF MULTIPLY AND SUBTRACT (short HFP) - op_MSEB uint32 = 0xED0F // FORMAT_RXF MULTIPLY AND SUBTRACT (short BFP) - op_MSEBR uint32 = 0xB30F // FORMAT_RRD MULTIPLY AND SUBTRACT (short BFP) - op_MSER uint32 = 0xB32F // FORMAT_RRD MULTIPLY AND SUBTRACT (short HFP) - op_MSFI uint32 = 0xC201 // FORMAT_RIL1 MULTIPLY SINGLE IMMEDIATE (32) - op_MSG uint32 = 0xE30C // FORMAT_RXY1 MULTIPLY SINGLE (64) - op_MSGF uint32 = 0xE31C // FORMAT_RXY1 MULTIPLY SINGLE (64<-32) - op_MSGFI uint32 = 0xC200 // FORMAT_RIL1 MULTIPLY SINGLE IMMEDIATE (64<-32) - op_MSGFR uint32 = 0xB91C // FORMAT_RRE MULTIPLY SINGLE (64<-32) - op_MSGR uint32 = 0xB90C // FORMAT_RRE MULTIPLY SINGLE (64) - op_MSR uint32 = 0xB252 // FORMAT_RRE MULTIPLY SINGLE (32) - op_MSTA uint32 = 0xB247 // FORMAT_RRE MODIFY STACKED STATE - op_MSY uint32 = 0xE351 // FORMAT_RXY1 MULTIPLY SINGLE (32) - op_MVC uint32 = 0xD200 // FORMAT_SS1 MOVE (character) - op_MVCDK uint32 = 0xE50F // FORMAT_SSE MOVE WITH DESTINATION KEY - op_MVCIN uint32 = 0xE800 // FORMAT_SS1 MOVE INVERSE - op_MVCK uint32 = 0xD900 // FORMAT_SS4 MOVE WITH KEY - op_MVCL uint32 = 0x0E00 // FORMAT_RR MOVE LONG - op_MVCLE uint32 = 0xA800 // FORMAT_RS1 MOVE LONG EXTENDED - op_MVCLU uint32 = 0xEB8E // FORMAT_RSY1 MOVE LONG UNICODE - op_MVCOS uint32 = 0xC800 // FORMAT_SSF MOVE WITH OPTIONAL SPECIFICATIONS - op_MVCP uint32 = 0xDA00 // FORMAT_SS4 MOVE TO PRIMARY - op_MVCS uint32 = 0xDB00 // FORMAT_SS4 MOVE TO SECONDARY - op_MVCSK uint32 = 0xE50E // FORMAT_SSE MOVE WITH SOURCE KEY - op_MVGHI uint32 = 0xE548 // FORMAT_SIL MOVE (64<-16) - op_MVHHI uint32 = 0xE544 // FORMAT_SIL MOVE (16<-16) - op_MVHI uint32 = 0xE54C // FORMAT_SIL MOVE (32<-16) - op_MVI uint32 = 0x9200 // FORMAT_SI MOVE (immediate) - op_MVIY uint32 = 0xEB52 // FORMAT_SIY MOVE (immediate) - op_MVN uint32 = 0xD100 // FORMAT_SS1 MOVE NUMERICS - op_MVO uint32 = 0xF100 // FORMAT_SS2 MOVE WITH OFFSET - op_MVPG uint32 = 0xB254 // FORMAT_RRE MOVE PAGE - op_MVST uint32 = 0xB255 // FORMAT_RRE MOVE STRING - op_MVZ uint32 = 0xD300 // FORMAT_SS1 MOVE ZONES - op_MXBR uint32 = 0xB34C // FORMAT_RRE MULTIPLY (extended BFP) - op_MXD uint32 = 0x6700 // FORMAT_RX1 MULTIPLY (long to extended HFP) - op_MXDB uint32 = 0xED07 // FORMAT_RXE MULTIPLY (long to extended BFP) - op_MXDBR uint32 = 0xB307 // FORMAT_RRE MULTIPLY (long to extended BFP) - op_MXDR uint32 = 0x2700 // FORMAT_RR MULTIPLY (long to extended HFP) - op_MXR uint32 = 0x2600 // FORMAT_RR MULTIPLY (extended HFP) - op_MXTR uint32 = 0xB3D8 // FORMAT_RRF1 MULTIPLY (extended DFP) - op_MXTRA uint32 = 0xB3D8 // FORMAT_RRF1 MULTIPLY (extended DFP) - op_MY uint32 = 0xED3B // FORMAT_RXF MULTIPLY UNNORMALIZED (long to ext. HFP) - op_MYH uint32 = 0xED3D // FORMAT_RXF MULTIPLY UNNORM. (long to ext. high HFP) - op_MYHR uint32 = 0xB33D // FORMAT_RRD MULTIPLY UNNORM. (long to ext. high HFP) - op_MYL uint32 = 0xED39 // FORMAT_RXF MULTIPLY UNNORM. (long to ext. low HFP) - op_MYLR uint32 = 0xB339 // FORMAT_RRD MULTIPLY UNNORM. (long to ext. low HFP) - op_MYR uint32 = 0xB33B // FORMAT_RRD MULTIPLY UNNORMALIZED (long to ext. HFP) - op_N uint32 = 0x5400 // FORMAT_RX1 AND (32) - op_NC uint32 = 0xD400 // FORMAT_SS1 AND (character) - op_NG uint32 = 0xE380 // FORMAT_RXY1 AND (64) - op_NGR uint32 = 0xB980 // FORMAT_RRE AND (64) - op_NGRK uint32 = 0xB9E4 // FORMAT_RRF1 AND (64) - op_NI uint32 = 0x9400 // FORMAT_SI AND (immediate) - op_NIAI uint32 = 0xB2FA // FORMAT_IE NEXT INSTRUCTION ACCESS INTENT - op_NIHF uint32 = 0xC00A // FORMAT_RIL1 AND IMMEDIATE (high) - op_NIHH uint32 = 0xA504 // FORMAT_RI1 AND IMMEDIATE (high high) - op_NIHL uint32 = 0xA505 // FORMAT_RI1 AND IMMEDIATE (high low) - op_NILF uint32 = 0xC00B // FORMAT_RIL1 AND IMMEDIATE (low) - op_NILH uint32 = 0xA506 // FORMAT_RI1 AND IMMEDIATE (low high) - op_NILL uint32 = 0xA507 // FORMAT_RI1 AND IMMEDIATE (low low) - op_NIY uint32 = 0xEB54 // FORMAT_SIY AND (immediate) - op_NR uint32 = 0x1400 // FORMAT_RR AND (32) - op_NRK uint32 = 0xB9F4 // FORMAT_RRF1 AND (32) - op_NTSTG uint32 = 0xE325 // FORMAT_RXY1 NONTRANSACTIONAL STORE - op_NY uint32 = 0xE354 // FORMAT_RXY1 AND (32) - op_O uint32 = 0x5600 // FORMAT_RX1 OR (32) - op_OC uint32 = 0xD600 // FORMAT_SS1 OR (character) - op_OG uint32 = 0xE381 // FORMAT_RXY1 OR (64) - op_OGR uint32 = 0xB981 // FORMAT_RRE OR (64) - op_OGRK uint32 = 0xB9E6 // FORMAT_RRF1 OR (64) - op_OI uint32 = 0x9600 // FORMAT_SI OR (immediate) - op_OIHF uint32 = 0xC00C // FORMAT_RIL1 OR IMMEDIATE (high) - op_OIHH uint32 = 0xA508 // FORMAT_RI1 OR IMMEDIATE (high high) - op_OIHL uint32 = 0xA509 // FORMAT_RI1 OR IMMEDIATE (high low) - op_OILF uint32 = 0xC00D // FORMAT_RIL1 OR IMMEDIATE (low) - op_OILH uint32 = 0xA50A // FORMAT_RI1 OR IMMEDIATE (low high) - op_OILL uint32 = 0xA50B // FORMAT_RI1 OR IMMEDIATE (low low) - op_OIY uint32 = 0xEB56 // FORMAT_SIY OR (immediate) - op_OR uint32 = 0x1600 // FORMAT_RR OR (32) - op_ORK uint32 = 0xB9F6 // FORMAT_RRF1 OR (32) - op_OY uint32 = 0xE356 // FORMAT_RXY1 OR (32) - op_PACK uint32 = 0xF200 // FORMAT_SS2 PACK - op_PALB uint32 = 0xB248 // FORMAT_RRE PURGE ALB - op_PC uint32 = 0xB218 // FORMAT_S PROGRAM CALL - op_PCC uint32 = 0xB92C // FORMAT_RRE PERFORM CRYPTOGRAPHIC COMPUTATION - op_PCKMO uint32 = 0xB928 // FORMAT_RRE PERFORM CRYPTOGRAPHIC KEY MGMT. OPERATIONS - op_PFD uint32 = 0xE336 // FORMAT_RXY2 PREFETCH DATA - op_PFDRL uint32 = 0xC602 // FORMAT_RIL3 PREFETCH DATA RELATIVE LONG - op_PFMF uint32 = 0xB9AF // FORMAT_RRE PERFORM FRAME MANAGEMENT FUNCTION - op_PFPO uint32 = 0x010A // FORMAT_E PERFORM FLOATING-POINT OPERATION - op_PGIN uint32 = 0xB22E // FORMAT_RRE PAGE IN - op_PGOUT uint32 = 0xB22F // FORMAT_RRE PAGE OUT - op_PKA uint32 = 0xE900 // FORMAT_SS6 PACK ASCII - op_PKU uint32 = 0xE100 // FORMAT_SS6 PACK UNICODE - op_PLO uint32 = 0xEE00 // FORMAT_SS5 PERFORM LOCKED OPERATION - op_POPCNT uint32 = 0xB9E1 // FORMAT_RRE POPULATION COUNT - op_PPA uint32 = 0xB2E8 // FORMAT_RRF3 PERFORM PROCESSOR ASSIST - op_PR uint32 = 0x0101 // FORMAT_E PROGRAM RETURN - op_PT uint32 = 0xB228 // FORMAT_RRE PROGRAM TRANSFER - op_PTF uint32 = 0xB9A2 // FORMAT_RRE PERFORM TOPOLOGY FUNCTION - op_PTFF uint32 = 0x0104 // FORMAT_E PERFORM TIMING FACILITY FUNCTION - op_PTI uint32 = 0xB99E // FORMAT_RRE PROGRAM TRANSFER WITH INSTANCE - op_PTLB uint32 = 0xB20D // FORMAT_S PURGE TLB - op_QADTR uint32 = 0xB3F5 // FORMAT_RRF2 QUANTIZE (long DFP) - op_QAXTR uint32 = 0xB3FD // FORMAT_RRF2 QUANTIZE (extended DFP) - op_RCHP uint32 = 0xB23B // FORMAT_S RESET CHANNEL PATH - op_RISBG uint32 = 0xEC55 // FORMAT_RIE6 ROTATE THEN INSERT SELECTED BITS - op_RISBGN uint32 = 0xEC59 // FORMAT_RIE6 ROTATE THEN INSERT SELECTED BITS - op_RISBHG uint32 = 0xEC5D // FORMAT_RIE6 ROTATE THEN INSERT SELECTED BITS HIGH - op_RISBLG uint32 = 0xEC51 // FORMAT_RIE6 ROTATE THEN INSERT SELECTED BITS LOW - op_RLL uint32 = 0xEB1D // FORMAT_RSY1 ROTATE LEFT SINGLE LOGICAL (32) - op_RLLG uint32 = 0xEB1C // FORMAT_RSY1 ROTATE LEFT SINGLE LOGICAL (64) - op_RNSBG uint32 = 0xEC54 // FORMAT_RIE6 ROTATE THEN AND SELECTED BITS - op_ROSBG uint32 = 0xEC56 // FORMAT_RIE6 ROTATE THEN OR SELECTED BITS - op_RP uint32 = 0xB277 // FORMAT_S RESUME PROGRAM - op_RRBE uint32 = 0xB22A // FORMAT_RRE RESET REFERENCE BIT EXTENDED - op_RRBM uint32 = 0xB9AE // FORMAT_RRE RESET REFERENCE BITS MULTIPLE - op_RRDTR uint32 = 0xB3F7 // FORMAT_RRF2 REROUND (long DFP) - op_RRXTR uint32 = 0xB3FF // FORMAT_RRF2 REROUND (extended DFP) - op_RSCH uint32 = 0xB238 // FORMAT_S RESUME SUBCHANNEL - op_RXSBG uint32 = 0xEC57 // FORMAT_RIE6 ROTATE THEN EXCLUSIVE OR SELECTED BITS - op_S uint32 = 0x5B00 // FORMAT_RX1 SUBTRACT (32) - op_SAC uint32 = 0xB219 // FORMAT_S SET ADDRESS SPACE CONTROL - op_SACF uint32 = 0xB279 // FORMAT_S SET ADDRESS SPACE CONTROL FAST - op_SAL uint32 = 0xB237 // FORMAT_S SET ADDRESS LIMIT - op_SAM24 uint32 = 0x010C // FORMAT_E SET ADDRESSING MODE (24) - op_SAM31 uint32 = 0x010D // FORMAT_E SET ADDRESSING MODE (31) - op_SAM64 uint32 = 0x010E // FORMAT_E SET ADDRESSING MODE (64) - op_SAR uint32 = 0xB24E // FORMAT_RRE SET ACCESS - op_SCHM uint32 = 0xB23C // FORMAT_S SET CHANNEL MONITOR - op_SCK uint32 = 0xB204 // FORMAT_S SET CLOCK - op_SCKC uint32 = 0xB206 // FORMAT_S SET CLOCK COMPARATOR - op_SCKPF uint32 = 0x0107 // FORMAT_E SET CLOCK PROGRAMMABLE FIELD - op_SD uint32 = 0x6B00 // FORMAT_RX1 SUBTRACT NORMALIZED (long HFP) - op_SDB uint32 = 0xED1B // FORMAT_RXE SUBTRACT (long BFP) - op_SDBR uint32 = 0xB31B // FORMAT_RRE SUBTRACT (long BFP) - op_SDR uint32 = 0x2B00 // FORMAT_RR SUBTRACT NORMALIZED (long HFP) - op_SDTR uint32 = 0xB3D3 // FORMAT_RRF1 SUBTRACT (long DFP) - op_SDTRA uint32 = 0xB3D3 // FORMAT_RRF1 SUBTRACT (long DFP) - op_SE uint32 = 0x7B00 // FORMAT_RX1 SUBTRACT NORMALIZED (short HFP) - op_SEB uint32 = 0xED0B // FORMAT_RXE SUBTRACT (short BFP) - op_SEBR uint32 = 0xB30B // FORMAT_RRE SUBTRACT (short BFP) - op_SER uint32 = 0x3B00 // FORMAT_RR SUBTRACT NORMALIZED (short HFP) - op_SFASR uint32 = 0xB385 // FORMAT_RRE SET FPC AND SIGNAL - op_SFPC uint32 = 0xB384 // FORMAT_RRE SET FPC - op_SG uint32 = 0xE309 // FORMAT_RXY1 SUBTRACT (64) - op_SGF uint32 = 0xE319 // FORMAT_RXY1 SUBTRACT (64<-32) - op_SGFR uint32 = 0xB919 // FORMAT_RRE SUBTRACT (64<-32) - op_SGR uint32 = 0xB909 // FORMAT_RRE SUBTRACT (64) - op_SGRK uint32 = 0xB9E9 // FORMAT_RRF1 SUBTRACT (64) - op_SH uint32 = 0x4B00 // FORMAT_RX1 SUBTRACT HALFWORD - op_SHHHR uint32 = 0xB9C9 // FORMAT_RRF1 SUBTRACT HIGH (32) - op_SHHLR uint32 = 0xB9D9 // FORMAT_RRF1 SUBTRACT HIGH (32) - op_SHY uint32 = 0xE37B // FORMAT_RXY1 SUBTRACT HALFWORD - op_SIGP uint32 = 0xAE00 // FORMAT_RS1 SIGNAL PROCESSOR - op_SL uint32 = 0x5F00 // FORMAT_RX1 SUBTRACT LOGICAL (32) - op_SLA uint32 = 0x8B00 // FORMAT_RS1 SHIFT LEFT SINGLE (32) - op_SLAG uint32 = 0xEB0B // FORMAT_RSY1 SHIFT LEFT SINGLE (64) - op_SLAK uint32 = 0xEBDD // FORMAT_RSY1 SHIFT LEFT SINGLE (32) - op_SLB uint32 = 0xE399 // FORMAT_RXY1 SUBTRACT LOGICAL WITH BORROW (32) - op_SLBG uint32 = 0xE389 // FORMAT_RXY1 SUBTRACT LOGICAL WITH BORROW (64) - op_SLBGR uint32 = 0xB989 // FORMAT_RRE SUBTRACT LOGICAL WITH BORROW (64) - op_SLBR uint32 = 0xB999 // FORMAT_RRE SUBTRACT LOGICAL WITH BORROW (32) - op_SLDA uint32 = 0x8F00 // FORMAT_RS1 SHIFT LEFT DOUBLE - op_SLDL uint32 = 0x8D00 // FORMAT_RS1 SHIFT LEFT DOUBLE LOGICAL - op_SLDT uint32 = 0xED40 // FORMAT_RXF SHIFT SIGNIFICAND LEFT (long DFP) - op_SLFI uint32 = 0xC205 // FORMAT_RIL1 SUBTRACT LOGICAL IMMEDIATE (32) - op_SLG uint32 = 0xE30B // FORMAT_RXY1 SUBTRACT LOGICAL (64) - op_SLGF uint32 = 0xE31B // FORMAT_RXY1 SUBTRACT LOGICAL (64<-32) - op_SLGFI uint32 = 0xC204 // FORMAT_RIL1 SUBTRACT LOGICAL IMMEDIATE (64<-32) - op_SLGFR uint32 = 0xB91B // FORMAT_RRE SUBTRACT LOGICAL (64<-32) - op_SLGR uint32 = 0xB90B // FORMAT_RRE SUBTRACT LOGICAL (64) - op_SLGRK uint32 = 0xB9EB // FORMAT_RRF1 SUBTRACT LOGICAL (64) - op_SLHHHR uint32 = 0xB9CB // FORMAT_RRF1 SUBTRACT LOGICAL HIGH (32) - op_SLHHLR uint32 = 0xB9DB // FORMAT_RRF1 SUBTRACT LOGICAL HIGH (32) - op_SLL uint32 = 0x8900 // FORMAT_RS1 SHIFT LEFT SINGLE LOGICAL (32) - op_SLLG uint32 = 0xEB0D // FORMAT_RSY1 SHIFT LEFT SINGLE LOGICAL (64) - op_SLLK uint32 = 0xEBDF // FORMAT_RSY1 SHIFT LEFT SINGLE LOGICAL (32) - op_SLR uint32 = 0x1F00 // FORMAT_RR SUBTRACT LOGICAL (32) - op_SLRK uint32 = 0xB9FB // FORMAT_RRF1 SUBTRACT LOGICAL (32) - op_SLXT uint32 = 0xED48 // FORMAT_RXF SHIFT SIGNIFICAND LEFT (extended DFP) - op_SLY uint32 = 0xE35F // FORMAT_RXY1 SUBTRACT LOGICAL (32) - op_SP uint32 = 0xFB00 // FORMAT_SS2 SUBTRACT DECIMAL - op_SPKA uint32 = 0xB20A // FORMAT_S SET PSW KEY FROM ADDRESS - op_SPM uint32 = 0x0400 // FORMAT_RR SET PROGRAM MASK - op_SPT uint32 = 0xB208 // FORMAT_S SET CPU TIMER - op_SPX uint32 = 0xB210 // FORMAT_S SET PREFIX - op_SQD uint32 = 0xED35 // FORMAT_RXE SQUARE ROOT (long HFP) - op_SQDB uint32 = 0xED15 // FORMAT_RXE SQUARE ROOT (long BFP) - op_SQDBR uint32 = 0xB315 // FORMAT_RRE SQUARE ROOT (long BFP) - op_SQDR uint32 = 0xB244 // FORMAT_RRE SQUARE ROOT (long HFP) - op_SQE uint32 = 0xED34 // FORMAT_RXE SQUARE ROOT (short HFP) - op_SQEB uint32 = 0xED14 // FORMAT_RXE SQUARE ROOT (short BFP) - op_SQEBR uint32 = 0xB314 // FORMAT_RRE SQUARE ROOT (short BFP) - op_SQER uint32 = 0xB245 // FORMAT_RRE SQUARE ROOT (short HFP) - op_SQXBR uint32 = 0xB316 // FORMAT_RRE SQUARE ROOT (extended BFP) - op_SQXR uint32 = 0xB336 // FORMAT_RRE SQUARE ROOT (extended HFP) - op_SR uint32 = 0x1B00 // FORMAT_RR SUBTRACT (32) - op_SRA uint32 = 0x8A00 // FORMAT_RS1 SHIFT RIGHT SINGLE (32) - op_SRAG uint32 = 0xEB0A // FORMAT_RSY1 SHIFT RIGHT SINGLE (64) - op_SRAK uint32 = 0xEBDC // FORMAT_RSY1 SHIFT RIGHT SINGLE (32) - op_SRDA uint32 = 0x8E00 // FORMAT_RS1 SHIFT RIGHT DOUBLE - op_SRDL uint32 = 0x8C00 // FORMAT_RS1 SHIFT RIGHT DOUBLE LOGICAL - op_SRDT uint32 = 0xED41 // FORMAT_RXF SHIFT SIGNIFICAND RIGHT (long DFP) - op_SRK uint32 = 0xB9F9 // FORMAT_RRF1 SUBTRACT (32) - op_SRL uint32 = 0x8800 // FORMAT_RS1 SHIFT RIGHT SINGLE LOGICAL (32) - op_SRLG uint32 = 0xEB0C // FORMAT_RSY1 SHIFT RIGHT SINGLE LOGICAL (64) - op_SRLK uint32 = 0xEBDE // FORMAT_RSY1 SHIFT RIGHT SINGLE LOGICAL (32) - op_SRNM uint32 = 0xB299 // FORMAT_S SET BFP ROUNDING MODE (2 bit) - op_SRNMB uint32 = 0xB2B8 // FORMAT_S SET BFP ROUNDING MODE (3 bit) - op_SRNMT uint32 = 0xB2B9 // FORMAT_S SET DFP ROUNDING MODE - op_SRP uint32 = 0xF000 // FORMAT_SS3 SHIFT AND ROUND DECIMAL - op_SRST uint32 = 0xB25E // FORMAT_RRE SEARCH STRING - op_SRSTU uint32 = 0xB9BE // FORMAT_RRE SEARCH STRING UNICODE - op_SRXT uint32 = 0xED49 // FORMAT_RXF SHIFT SIGNIFICAND RIGHT (extended DFP) - op_SSAIR uint32 = 0xB99F // FORMAT_RRE SET SECONDARY ASN WITH INSTANCE - op_SSAR uint32 = 0xB225 // FORMAT_RRE SET SECONDARY ASN - op_SSCH uint32 = 0xB233 // FORMAT_S START SUBCHANNEL - op_SSKE uint32 = 0xB22B // FORMAT_RRF3 SET STORAGE KEY EXTENDED - op_SSM uint32 = 0x8000 // FORMAT_S SET SYSTEM MASK - op_ST uint32 = 0x5000 // FORMAT_RX1 STORE (32) - op_STAM uint32 = 0x9B00 // FORMAT_RS1 STORE ACCESS MULTIPLE - op_STAMY uint32 = 0xEB9B // FORMAT_RSY1 STORE ACCESS MULTIPLE - op_STAP uint32 = 0xB212 // FORMAT_S STORE CPU ADDRESS - op_STC uint32 = 0x4200 // FORMAT_RX1 STORE CHARACTER - op_STCH uint32 = 0xE3C3 // FORMAT_RXY1 STORE CHARACTER HIGH (8) - op_STCK uint32 = 0xB205 // FORMAT_S STORE CLOCK - op_STCKC uint32 = 0xB207 // FORMAT_S STORE CLOCK COMPARATOR - op_STCKE uint32 = 0xB278 // FORMAT_S STORE CLOCK EXTENDED - op_STCKF uint32 = 0xB27C // FORMAT_S STORE CLOCK FAST - op_STCM uint32 = 0xBE00 // FORMAT_RS2 STORE CHARACTERS UNDER MASK (low) - op_STCMH uint32 = 0xEB2C // FORMAT_RSY2 STORE CHARACTERS UNDER MASK (high) - op_STCMY uint32 = 0xEB2D // FORMAT_RSY2 STORE CHARACTERS UNDER MASK (low) - op_STCPS uint32 = 0xB23A // FORMAT_S STORE CHANNEL PATH STATUS - op_STCRW uint32 = 0xB239 // FORMAT_S STORE CHANNEL REPORT WORD - op_STCTG uint32 = 0xEB25 // FORMAT_RSY1 STORE CONTROL (64) - op_STCTL uint32 = 0xB600 // FORMAT_RS1 STORE CONTROL (32) - op_STCY uint32 = 0xE372 // FORMAT_RXY1 STORE CHARACTER - op_STD uint32 = 0x6000 // FORMAT_RX1 STORE (long) - op_STDY uint32 = 0xED67 // FORMAT_RXY1 STORE (long) - op_STE uint32 = 0x7000 // FORMAT_RX1 STORE (short) - op_STEY uint32 = 0xED66 // FORMAT_RXY1 STORE (short) - op_STFH uint32 = 0xE3CB // FORMAT_RXY1 STORE HIGH (32) - op_STFL uint32 = 0xB2B1 // FORMAT_S STORE FACILITY LIST - op_STFLE uint32 = 0xB2B0 // FORMAT_S STORE FACILITY LIST EXTENDED - op_STFPC uint32 = 0xB29C // FORMAT_S STORE FPC - op_STG uint32 = 0xE324 // FORMAT_RXY1 STORE (64) - op_STGRL uint32 = 0xC40B // FORMAT_RIL2 STORE RELATIVE LONG (64) - op_STH uint32 = 0x4000 // FORMAT_RX1 STORE HALFWORD - op_STHH uint32 = 0xE3C7 // FORMAT_RXY1 STORE HALFWORD HIGH (16) - op_STHRL uint32 = 0xC407 // FORMAT_RIL2 STORE HALFWORD RELATIVE LONG - op_STHY uint32 = 0xE370 // FORMAT_RXY1 STORE HALFWORD - op_STIDP uint32 = 0xB202 // FORMAT_S STORE CPU ID - op_STM uint32 = 0x9000 // FORMAT_RS1 STORE MULTIPLE (32) - op_STMG uint32 = 0xEB24 // FORMAT_RSY1 STORE MULTIPLE (64) - op_STMH uint32 = 0xEB26 // FORMAT_RSY1 STORE MULTIPLE HIGH - op_STMY uint32 = 0xEB90 // FORMAT_RSY1 STORE MULTIPLE (32) - op_STNSM uint32 = 0xAC00 // FORMAT_SI STORE THEN AND SYSTEM MASK - op_STOC uint32 = 0xEBF3 // FORMAT_RSY2 STORE ON CONDITION (32) - op_STOCG uint32 = 0xEBE3 // FORMAT_RSY2 STORE ON CONDITION (64) - op_STOSM uint32 = 0xAD00 // FORMAT_SI STORE THEN OR SYSTEM MASK - op_STPQ uint32 = 0xE38E // FORMAT_RXY1 STORE PAIR TO QUADWORD - op_STPT uint32 = 0xB209 // FORMAT_S STORE CPU TIMER - op_STPX uint32 = 0xB211 // FORMAT_S STORE PREFIX - op_STRAG uint32 = 0xE502 // FORMAT_SSE STORE REAL ADDRESS - op_STRL uint32 = 0xC40F // FORMAT_RIL2 STORE RELATIVE LONG (32) - op_STRV uint32 = 0xE33E // FORMAT_RXY1 STORE REVERSED (32) - op_STRVG uint32 = 0xE32F // FORMAT_RXY1 STORE REVERSED (64) - op_STRVH uint32 = 0xE33F // FORMAT_RXY1 STORE REVERSED (16) - op_STSCH uint32 = 0xB234 // FORMAT_S STORE SUBCHANNEL - op_STSI uint32 = 0xB27D // FORMAT_S STORE SYSTEM INFORMATION - op_STURA uint32 = 0xB246 // FORMAT_RRE STORE USING REAL ADDRESS (32) - op_STURG uint32 = 0xB925 // FORMAT_RRE STORE USING REAL ADDRESS (64) - op_STY uint32 = 0xE350 // FORMAT_RXY1 STORE (32) - op_SU uint32 = 0x7F00 // FORMAT_RX1 SUBTRACT UNNORMALIZED (short HFP) - op_SUR uint32 = 0x3F00 // FORMAT_RR SUBTRACT UNNORMALIZED (short HFP) - op_SVC uint32 = 0x0A00 // FORMAT_I SUPERVISOR CALL - op_SW uint32 = 0x6F00 // FORMAT_RX1 SUBTRACT UNNORMALIZED (long HFP) - op_SWR uint32 = 0x2F00 // FORMAT_RR SUBTRACT UNNORMALIZED (long HFP) - op_SXBR uint32 = 0xB34B // FORMAT_RRE SUBTRACT (extended BFP) - op_SXR uint32 = 0x3700 // FORMAT_RR SUBTRACT NORMALIZED (extended HFP) - op_SXTR uint32 = 0xB3DB // FORMAT_RRF1 SUBTRACT (extended DFP) - op_SXTRA uint32 = 0xB3DB // FORMAT_RRF1 SUBTRACT (extended DFP) - op_SY uint32 = 0xE35B // FORMAT_RXY1 SUBTRACT (32) - op_TABORT uint32 = 0xB2FC // FORMAT_S TRANSACTION ABORT - op_TAM uint32 = 0x010B // FORMAT_E TEST ADDRESSING MODE - op_TAR uint32 = 0xB24C // FORMAT_RRE TEST ACCESS - op_TB uint32 = 0xB22C // FORMAT_RRE TEST BLOCK - op_TBDR uint32 = 0xB351 // FORMAT_RRF5 CONVERT HFP TO BFP (long) - op_TBEDR uint32 = 0xB350 // FORMAT_RRF5 CONVERT HFP TO BFP (long to short) - op_TBEGIN uint32 = 0xE560 // FORMAT_SIL TRANSACTION BEGIN - op_TBEGINC uint32 = 0xE561 // FORMAT_SIL TRANSACTION BEGIN - op_TCDB uint32 = 0xED11 // FORMAT_RXE TEST DATA CLASS (long BFP) - op_TCEB uint32 = 0xED10 // FORMAT_RXE TEST DATA CLASS (short BFP) - op_TCXB uint32 = 0xED12 // FORMAT_RXE TEST DATA CLASS (extended BFP) - op_TDCDT uint32 = 0xED54 // FORMAT_RXE TEST DATA CLASS (long DFP) - op_TDCET uint32 = 0xED50 // FORMAT_RXE TEST DATA CLASS (short DFP) - op_TDCXT uint32 = 0xED58 // FORMAT_RXE TEST DATA CLASS (extended DFP) - op_TDGDT uint32 = 0xED55 // FORMAT_RXE TEST DATA GROUP (long DFP) - op_TDGET uint32 = 0xED51 // FORMAT_RXE TEST DATA GROUP (short DFP) - op_TDGXT uint32 = 0xED59 // FORMAT_RXE TEST DATA GROUP (extended DFP) - op_TEND uint32 = 0xB2F8 // FORMAT_S TRANSACTION END - op_THDER uint32 = 0xB358 // FORMAT_RRE CONVERT BFP TO HFP (short to long) - op_THDR uint32 = 0xB359 // FORMAT_RRE CONVERT BFP TO HFP (long) - op_TM uint32 = 0x9100 // FORMAT_SI TEST UNDER MASK - op_TMH uint32 = 0xA700 // FORMAT_RI1 TEST UNDER MASK HIGH - op_TMHH uint32 = 0xA702 // FORMAT_RI1 TEST UNDER MASK (high high) - op_TMHL uint32 = 0xA703 // FORMAT_RI1 TEST UNDER MASK (high low) - op_TML uint32 = 0xA701 // FORMAT_RI1 TEST UNDER MASK LOW - op_TMLH uint32 = 0xA700 // FORMAT_RI1 TEST UNDER MASK (low high) - op_TMLL uint32 = 0xA701 // FORMAT_RI1 TEST UNDER MASK (low low) - op_TMY uint32 = 0xEB51 // FORMAT_SIY TEST UNDER MASK - op_TP uint32 = 0xEBC0 // FORMAT_RSL TEST DECIMAL - op_TPI uint32 = 0xB236 // FORMAT_S TEST PENDING INTERRUPTION - op_TPROT uint32 = 0xE501 // FORMAT_SSE TEST PROTECTION - op_TR uint32 = 0xDC00 // FORMAT_SS1 TRANSLATE - op_TRACE uint32 = 0x9900 // FORMAT_RS1 TRACE (32) - op_TRACG uint32 = 0xEB0F // FORMAT_RSY1 TRACE (64) - op_TRAP2 uint32 = 0x01FF // FORMAT_E TRAP - op_TRAP4 uint32 = 0xB2FF // FORMAT_S TRAP - op_TRE uint32 = 0xB2A5 // FORMAT_RRE TRANSLATE EXTENDED - op_TROO uint32 = 0xB993 // FORMAT_RRF3 TRANSLATE ONE TO ONE - op_TROT uint32 = 0xB992 // FORMAT_RRF3 TRANSLATE ONE TO TWO - op_TRT uint32 = 0xDD00 // FORMAT_SS1 TRANSLATE AND TEST - op_TRTE uint32 = 0xB9BF // FORMAT_RRF3 TRANSLATE AND TEST EXTENDED - op_TRTO uint32 = 0xB991 // FORMAT_RRF3 TRANSLATE TWO TO ONE - op_TRTR uint32 = 0xD000 // FORMAT_SS1 TRANSLATE AND TEST REVERSE - op_TRTRE uint32 = 0xB9BD // FORMAT_RRF3 TRANSLATE AND TEST REVERSE EXTENDED - op_TRTT uint32 = 0xB990 // FORMAT_RRF3 TRANSLATE TWO TO TWO - op_TS uint32 = 0x9300 // FORMAT_S TEST AND SET - op_TSCH uint32 = 0xB235 // FORMAT_S TEST SUBCHANNEL - op_UNPK uint32 = 0xF300 // FORMAT_SS2 UNPACK - op_UNPKA uint32 = 0xEA00 // FORMAT_SS1 UNPACK ASCII - op_UNPKU uint32 = 0xE200 // FORMAT_SS1 UNPACK UNICODE - op_UPT uint32 = 0x0102 // FORMAT_E UPDATE TREE - op_X uint32 = 0x5700 // FORMAT_RX1 EXCLUSIVE OR (32) - op_XC uint32 = 0xD700 // FORMAT_SS1 EXCLUSIVE OR (character) - op_XG uint32 = 0xE382 // FORMAT_RXY1 EXCLUSIVE OR (64) - op_XGR uint32 = 0xB982 // FORMAT_RRE EXCLUSIVE OR (64) - op_XGRK uint32 = 0xB9E7 // FORMAT_RRF1 EXCLUSIVE OR (64) - op_XI uint32 = 0x9700 // FORMAT_SI EXCLUSIVE OR (immediate) - op_XIHF uint32 = 0xC006 // FORMAT_RIL1 EXCLUSIVE OR IMMEDIATE (high) - op_XILF uint32 = 0xC007 // FORMAT_RIL1 EXCLUSIVE OR IMMEDIATE (low) - op_XIY uint32 = 0xEB57 // FORMAT_SIY EXCLUSIVE OR (immediate) - op_XR uint32 = 0x1700 // FORMAT_RR EXCLUSIVE OR (32) - op_XRK uint32 = 0xB9F7 // FORMAT_RRF1 EXCLUSIVE OR (32) - op_XSCH uint32 = 0xB276 // FORMAT_S CANCEL SUBCHANNEL - op_XY uint32 = 0xE357 // FORMAT_RXY1 EXCLUSIVE OR (32) - op_ZAP uint32 = 0xF800 // FORMAT_SS2 ZERO AND ADD - - // added in z13 - op_CXPT uint32 = 0xEDAF // RSL-b CONVERT FROM PACKED (to extended DFP) - op_CDPT uint32 = 0xEDAE // RSL-b CONVERT FROM PACKED (to long DFP) - op_CPXT uint32 = 0xEDAD // RSL-b CONVERT TO PACKED (from extended DFP) - op_CPDT uint32 = 0xEDAC // RSL-b CONVERT TO PACKED (from long DFP) - op_LZRF uint32 = 0xE33B // RXY-a LOAD AND ZERO RIGHTMOST BYTE (32) - op_LZRG uint32 = 0xE32A // RXY-a LOAD AND ZERO RIGHTMOST BYTE (64) - op_LCCB uint32 = 0xE727 // RXE LOAD COUNT TO BLOCK BOUNDARY - op_LOCHHI uint32 = 0xEC4E // RIE-g LOAD HALFWORD HIGH IMMEDIATE ON CONDITION (32←16) - op_LOCHI uint32 = 0xEC42 // RIE-g LOAD HALFWORD IMMEDIATE ON CONDITION (32←16) - op_LOCGHI uint32 = 0xEC46 // RIE-g LOAD HALFWORD IMMEDIATE ON CONDITION (64←16) - op_LOCFH uint32 = 0xEBE0 // RSY-b LOAD HIGH ON CONDITION (32) - op_LOCFHR uint32 = 0xB9E0 // RRF-c LOAD HIGH ON CONDITION (32) - op_LLZRGF uint32 = 0xE33A // RXY-a LOAD LOGICAL AND ZERO RIGHTMOST BYTE (64←32) - op_STOCFH uint32 = 0xEBE1 // RSY-b STORE HIGH ON CONDITION - op_VA uint32 = 0xE7F3 // VRR-c VECTOR ADD - op_VACC uint32 = 0xE7F1 // VRR-c VECTOR ADD COMPUTE CARRY - op_VAC uint32 = 0xE7BB // VRR-d VECTOR ADD WITH CARRY - op_VACCC uint32 = 0xE7B9 // VRR-d VECTOR ADD WITH CARRY COMPUTE CARRY - op_VN uint32 = 0xE768 // VRR-c VECTOR AND - op_VNC uint32 = 0xE769 // VRR-c VECTOR AND WITH COMPLEMENT - op_VAVG uint32 = 0xE7F2 // VRR-c VECTOR AVERAGE - op_VAVGL uint32 = 0xE7F0 // VRR-c VECTOR AVERAGE LOGICAL - op_VCKSM uint32 = 0xE766 // VRR-c VECTOR CHECKSUM - op_VCEQ uint32 = 0xE7F8 // VRR-b VECTOR COMPARE EQUAL - op_VCH uint32 = 0xE7FB // VRR-b VECTOR COMPARE HIGH - op_VCHL uint32 = 0xE7F9 // VRR-b VECTOR COMPARE HIGH LOGICAL - op_VCLZ uint32 = 0xE753 // VRR-a VECTOR COUNT LEADING ZEROS - op_VCTZ uint32 = 0xE752 // VRR-a VECTOR COUNT TRAILING ZEROS - op_VEC uint32 = 0xE7DB // VRR-a VECTOR ELEMENT COMPARE - op_VECL uint32 = 0xE7D9 // VRR-a VECTOR ELEMENT COMPARE LOGICAL - op_VERIM uint32 = 0xE772 // VRI-d VECTOR ELEMENT ROTATE AND INSERT UNDER MASK - op_VERLL uint32 = 0xE733 // VRS-a VECTOR ELEMENT ROTATE LEFT LOGICAL - op_VERLLV uint32 = 0xE773 // VRR-c VECTOR ELEMENT ROTATE LEFT LOGICAL - op_VESLV uint32 = 0xE770 // VRR-c VECTOR ELEMENT SHIFT LEFT - op_VESL uint32 = 0xE730 // VRS-a VECTOR ELEMENT SHIFT LEFT - op_VESRA uint32 = 0xE73A // VRS-a VECTOR ELEMENT SHIFT RIGHT ARITHMETIC - op_VESRAV uint32 = 0xE77A // VRR-c VECTOR ELEMENT SHIFT RIGHT ARITHMETIC - op_VESRL uint32 = 0xE738 // VRS-a VECTOR ELEMENT SHIFT RIGHT LOGICAL - op_VESRLV uint32 = 0xE778 // VRR-c VECTOR ELEMENT SHIFT RIGHT LOGICAL - op_VX uint32 = 0xE76D // VRR-c VECTOR EXCLUSIVE OR - op_VFAE uint32 = 0xE782 // VRR-b VECTOR FIND ANY ELEMENT EQUAL - op_VFEE uint32 = 0xE780 // VRR-b VECTOR FIND ELEMENT EQUAL - op_VFENE uint32 = 0xE781 // VRR-b VECTOR FIND ELEMENT NOT EQUAL - op_VFA uint32 = 0xE7E3 // VRR-c VECTOR FP ADD - op_WFK uint32 = 0xE7CA // VRR-a VECTOR FP COMPARE AND SIGNAL SCALAR - op_VFCE uint32 = 0xE7E8 // VRR-c VECTOR FP COMPARE EQUAL - op_VFCH uint32 = 0xE7EB // VRR-c VECTOR FP COMPARE HIGH - op_VFCHE uint32 = 0xE7EA // VRR-c VECTOR FP COMPARE HIGH OR EQUAL - op_WFC uint32 = 0xE7CB // VRR-a VECTOR FP COMPARE SCALAR - op_VCDG uint32 = 0xE7C3 // VRR-a VECTOR FP CONVERT FROM FIXED 64-BIT - op_VCDLG uint32 = 0xE7C1 // VRR-a VECTOR FP CONVERT FROM LOGICAL 64-BIT - op_VCGD uint32 = 0xE7C2 // VRR-a VECTOR FP CONVERT TO FIXED 64-BIT - op_VCLGD uint32 = 0xE7C0 // VRR-a VECTOR FP CONVERT TO LOGICAL 64-BIT - op_VFD uint32 = 0xE7E5 // VRR-c VECTOR FP DIVIDE - op_VLDE uint32 = 0xE7C4 // VRR-a VECTOR FP LOAD LENGTHENED - op_VLED uint32 = 0xE7C5 // VRR-a VECTOR FP LOAD ROUNDED - op_VFM uint32 = 0xE7E7 // VRR-c VECTOR FP MULTIPLY - op_VFMA uint32 = 0xE78F // VRR-e VECTOR FP MULTIPLY AND ADD - op_VFMS uint32 = 0xE78E // VRR-e VECTOR FP MULTIPLY AND SUBTRACT - op_VFPSO uint32 = 0xE7CC // VRR-a VECTOR FP PERFORM SIGN OPERATION - op_VFSQ uint32 = 0xE7CE // VRR-a VECTOR FP SQUARE ROOT - op_VFS uint32 = 0xE7E2 // VRR-c VECTOR FP SUBTRACT - op_VFTCI uint32 = 0xE74A // VRI-e VECTOR FP TEST DATA CLASS IMMEDIATE - op_VGFM uint32 = 0xE7B4 // VRR-c VECTOR GALOIS FIELD MULTIPLY SUM - op_VGFMA uint32 = 0xE7BC // VRR-d VECTOR GALOIS FIELD MULTIPLY SUM AND ACCUMULATE - op_VGEF uint32 = 0xE713 // VRV VECTOR GATHER ELEMENT (32) - op_VGEG uint32 = 0xE712 // VRV VECTOR GATHER ELEMENT (64) - op_VGBM uint32 = 0xE744 // VRI-a VECTOR GENERATE BYTE MASK - op_VGM uint32 = 0xE746 // VRI-b VECTOR GENERATE MASK - op_VISTR uint32 = 0xE75C // VRR-a VECTOR ISOLATE STRING - op_VL uint32 = 0xE706 // VRX VECTOR LOAD - op_VLR uint32 = 0xE756 // VRR-a VECTOR LOAD - op_VLREP uint32 = 0xE705 // VRX VECTOR LOAD AND REPLICATE - op_VLC uint32 = 0xE7DE // VRR-a VECTOR LOAD COMPLEMENT - op_VLEH uint32 = 0xE701 // VRX VECTOR LOAD ELEMENT (16) - op_VLEF uint32 = 0xE703 // VRX VECTOR LOAD ELEMENT (32) - op_VLEG uint32 = 0xE702 // VRX VECTOR LOAD ELEMENT (64) - op_VLEB uint32 = 0xE700 // VRX VECTOR LOAD ELEMENT (8) - op_VLEIH uint32 = 0xE741 // VRI-a VECTOR LOAD ELEMENT IMMEDIATE (16) - op_VLEIF uint32 = 0xE743 // VRI-a VECTOR LOAD ELEMENT IMMEDIATE (32) - op_VLEIG uint32 = 0xE742 // VRI-a VECTOR LOAD ELEMENT IMMEDIATE (64) - op_VLEIB uint32 = 0xE740 // VRI-a VECTOR LOAD ELEMENT IMMEDIATE (8) - op_VFI uint32 = 0xE7C7 // VRR-a VECTOR LOAD FP INTEGER - op_VLGV uint32 = 0xE721 // VRS-c VECTOR LOAD GR FROM VR ELEMENT - op_VLLEZ uint32 = 0xE704 // VRX VECTOR LOAD LOGICAL ELEMENT AND ZERO - op_VLM uint32 = 0xE736 // VRS-a VECTOR LOAD MULTIPLE - op_VLP uint32 = 0xE7DF // VRR-a VECTOR LOAD POSITIVE - op_VLBB uint32 = 0xE707 // VRX VECTOR LOAD TO BLOCK BOUNDARY - op_VLVG uint32 = 0xE722 // VRS-b VECTOR LOAD VR ELEMENT FROM GR - op_VLVGP uint32 = 0xE762 // VRR-f VECTOR LOAD VR FROM GRS DISJOINT - op_VLL uint32 = 0xE737 // VRS-b VECTOR LOAD WITH LENGTH - op_VMX uint32 = 0xE7FF // VRR-c VECTOR MAXIMUM - op_VMXL uint32 = 0xE7FD // VRR-c VECTOR MAXIMUM LOGICAL - op_VMRH uint32 = 0xE761 // VRR-c VECTOR MERGE HIGH - op_VMRL uint32 = 0xE760 // VRR-c VECTOR MERGE LOW - op_VMN uint32 = 0xE7FE // VRR-c VECTOR MINIMUM - op_VMNL uint32 = 0xE7FC // VRR-c VECTOR MINIMUM LOGICAL - op_VMAE uint32 = 0xE7AE // VRR-d VECTOR MULTIPLY AND ADD EVEN - op_VMAH uint32 = 0xE7AB // VRR-d VECTOR MULTIPLY AND ADD HIGH - op_VMALE uint32 = 0xE7AC // VRR-d VECTOR MULTIPLY AND ADD LOGICAL EVEN - op_VMALH uint32 = 0xE7A9 // VRR-d VECTOR MULTIPLY AND ADD LOGICAL HIGH - op_VMALO uint32 = 0xE7AD // VRR-d VECTOR MULTIPLY AND ADD LOGICAL ODD - op_VMAL uint32 = 0xE7AA // VRR-d VECTOR MULTIPLY AND ADD LOW - op_VMAO uint32 = 0xE7AF // VRR-d VECTOR MULTIPLY AND ADD ODD - op_VME uint32 = 0xE7A6 // VRR-c VECTOR MULTIPLY EVEN - op_VMH uint32 = 0xE7A3 // VRR-c VECTOR MULTIPLY HIGH - op_VMLE uint32 = 0xE7A4 // VRR-c VECTOR MULTIPLY EVEN LOGICAL - op_VMLH uint32 = 0xE7A1 // VRR-c VECTOR MULTIPLY HIGH LOGICAL - op_VMLO uint32 = 0xE7A5 // VRR-c VECTOR MULTIPLY ODD LOGICAL - op_VML uint32 = 0xE7A2 // VRR-c VECTOR MULTIPLY LOW - op_VMO uint32 = 0xE7A7 // VRR-c VECTOR MULTIPLY ODD - op_VNO uint32 = 0xE76B // VRR-c VECTOR NOR - op_VO uint32 = 0xE76A // VRR-c VECTOR OR - op_VPK uint32 = 0xE794 // VRR-c VECTOR PACK - op_VPKLS uint32 = 0xE795 // VRR-b VECTOR PACK LOGICAL SATURATE - op_VPKS uint32 = 0xE797 // VRR-b VECTOR PACK SATURATE - op_VPERM uint32 = 0xE78C // VRR-e VECTOR PERMUTE - op_VPDI uint32 = 0xE784 // VRR-c VECTOR PERMUTE DOUBLEWORD IMMEDIATE - op_VPOPCT uint32 = 0xE750 // VRR-a VECTOR POPULATION COUNT - op_VREP uint32 = 0xE74D // VRI-c VECTOR REPLICATE - op_VREPI uint32 = 0xE745 // VRI-a VECTOR REPLICATE IMMEDIATE - op_VSCEF uint32 = 0xE71B // VRV VECTOR SCATTER ELEMENT (32) - op_VSCEG uint32 = 0xE71A // VRV VECTOR SCATTER ELEMENT (64) - op_VSEL uint32 = 0xE78D // VRR-e VECTOR SELECT - op_VSL uint32 = 0xE774 // VRR-c VECTOR SHIFT LEFT - op_VSLB uint32 = 0xE775 // VRR-c VECTOR SHIFT LEFT BY BYTE - op_VSLDB uint32 = 0xE777 // VRI-d VECTOR SHIFT LEFT DOUBLE BY BYTE - op_VSRA uint32 = 0xE77E // VRR-c VECTOR SHIFT RIGHT ARITHMETIC - op_VSRAB uint32 = 0xE77F // VRR-c VECTOR SHIFT RIGHT ARITHMETIC BY BYTE - op_VSRL uint32 = 0xE77C // VRR-c VECTOR SHIFT RIGHT LOGICAL - op_VSRLB uint32 = 0xE77D // VRR-c VECTOR SHIFT RIGHT LOGICAL BY BYTE - op_VSEG uint32 = 0xE75F // VRR-a VECTOR SIGN EXTEND TO DOUBLEWORD - op_VST uint32 = 0xE70E // VRX VECTOR STORE - op_VSTEH uint32 = 0xE709 // VRX VECTOR STORE ELEMENT (16) - op_VSTEF uint32 = 0xE70B // VRX VECTOR STORE ELEMENT (32) - op_VSTEG uint32 = 0xE70A // VRX VECTOR STORE ELEMENT (64) - op_VSTEB uint32 = 0xE708 // VRX VECTOR STORE ELEMENT (8) - op_VSTM uint32 = 0xE73E // VRS-a VECTOR STORE MULTIPLE - op_VSTL uint32 = 0xE73F // VRS-b VECTOR STORE WITH LENGTH - op_VSTRC uint32 = 0xE78A // VRR-d VECTOR STRING RANGE COMPARE - op_VS uint32 = 0xE7F7 // VRR-c VECTOR SUBTRACT - op_VSCBI uint32 = 0xE7F5 // VRR-c VECTOR SUBTRACT COMPUTE BORROW INDICATION - op_VSBCBI uint32 = 0xE7BD // VRR-d VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION - op_VSBI uint32 = 0xE7BF // VRR-d VECTOR SUBTRACT WITH BORROW INDICATION - op_VSUMG uint32 = 0xE765 // VRR-c VECTOR SUM ACROSS DOUBLEWORD - op_VSUMQ uint32 = 0xE767 // VRR-c VECTOR SUM ACROSS QUADWORD - op_VSUM uint32 = 0xE764 // VRR-c VECTOR SUM ACROSS WORD - op_VTM uint32 = 0xE7D8 // VRR-a VECTOR TEST UNDER MASK - op_VUPH uint32 = 0xE7D7 // VRR-a VECTOR UNPACK HIGH - op_VUPLH uint32 = 0xE7D5 // VRR-a VECTOR UNPACK LOGICAL HIGH - op_VUPLL uint32 = 0xE7D4 // VRR-a VECTOR UNPACK LOGICAL LOW - op_VUPL uint32 = 0xE7D6 // VRR-a VECTOR UNPACK LOW -) - -func oclass(a *obj.Addr) int { - return int(a.Class) - 1 -} - -// Add a relocation for the immediate in a RIL style instruction. -// The addend will be adjusted as required. -func addrilreloc(ctxt *obj.Link, sym *obj.LSym, add int64) *obj.Reloc { - if sym == nil { - ctxt.Diag("require symbol to apply relocation") - } - offset := int64(2) // relocation offset from start of instruction - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + offset) - rel.Siz = 4 - rel.Sym = sym - rel.Add = add + offset + int64(rel.Siz) - rel.Type = obj.R_PCRELDBL - return rel -} - -func addrilrelocoffset(ctxt *obj.Link, sym *obj.LSym, add, offset int64) *obj.Reloc { - if sym == nil { - ctxt.Diag("require symbol to apply relocation") - } - offset += int64(2) // relocation offset from start of instruction - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + offset) - rel.Siz = 4 - rel.Sym = sym - rel.Add = add + offset + int64(rel.Siz) - rel.Type = obj.R_PCRELDBL - return rel -} - -// Add a CALL relocation for the immediate in a RIL style instruction. -// The addend will be adjusted as required. -func addcallreloc(ctxt *obj.Link, sym *obj.LSym, add int64) *obj.Reloc { - if sym == nil { - ctxt.Diag("require symbol to apply relocation") - } - offset := int64(2) // relocation offset from start of instruction - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + offset) - rel.Siz = 4 - rel.Sym = sym - rel.Add = add + offset + int64(rel.Siz) - rel.Type = obj.R_CALL - return rel -} - -func branchMask(ctxt *obj.Link, p *obj.Prog) uint32 { - switch p.As { - case ABEQ, ACMPBEQ, ACMPUBEQ, AMOVDEQ: - return 0x8 - case ABGE, ACMPBGE, ACMPUBGE, AMOVDGE: - return 0xA - case ABGT, ACMPBGT, ACMPUBGT, AMOVDGT: - return 0x2 - case ABLE, ACMPBLE, ACMPUBLE, AMOVDLE: - return 0xC - case ABLT, ACMPBLT, ACMPUBLT, AMOVDLT: - return 0x4 - case ABNE, ACMPBNE, ACMPUBNE, AMOVDNE: - return 0x7 - case ABLEU: // LE or unordered - return 0xD - case ABLTU: // LT or unordered - return 0x5 - case ABVC: - return 0x0 // needs extra instruction - case ABVS: - return 0x1 // unordered - } - ctxt.Diag("unknown conditional branch %v", p.As) - return 0xF -} - -func asmout(ctxt *obj.Link, asm *[]byte) { - p := ctxt.Curp - o := oplook(ctxt, p) - ctxt.Printp = p - - switch o.type_ { - default: - ctxt.Diag("unknown type %d", o.type_) - - case 0: // PSEUDO OPS - break - - case 1: // mov reg reg - switch p.As { - default: - ctxt.Diag("unhandled operation: %v", p.As) - case AMOVD: - zRRE(op_LGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - // sign extend - case AMOVW: - zRRE(op_LGFR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - case AMOVH: - zRRE(op_LGHR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - case AMOVB: - zRRE(op_LGBR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - // zero extend - case AMOVWZ: - zRRE(op_LLGFR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - case AMOVHZ: - zRRE(op_LLGHR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - case AMOVBZ: - zRRE(op_LLGCR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - // reverse bytes - case AMOVDBR: - zRRE(op_LRVGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - case AMOVWBR: - zRRE(op_LRVR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - // floating point - case AFMOVD, AFMOVS: - zRR(op_LDR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - - case 2: // arithmetic op reg [reg] reg - r := p.Reg - if r == 0 { - r = p.To.Reg - } - - var opcode uint32 - - switch p.As { - default: - ctxt.Diag("invalid opcode") - case AADD: - opcode = op_AGRK - case AADDC: - opcode = op_ALGRK - case AADDE: - opcode = op_ALCGR - case AADDW: - opcode = op_ARK - case AMULLW: - opcode = op_MSGFR - case AMULLD: - opcode = op_MSGR - case ADIVW, AMODW: - opcode = op_DSGFR - case ADIVWU, AMODWU: - opcode = op_DLR - case ADIVD, AMODD: - opcode = op_DSGR - case ADIVDU, AMODDU: - opcode = op_DLGR - case AFADD: - opcode = op_ADBR - case AFADDS: - opcode = op_AEBR - case AFSUB: - opcode = op_SDBR - case AFSUBS: - opcode = op_SEBR - case AFDIV: - opcode = op_DDBR - case AFDIVS: - opcode = op_DEBR - } - - switch p.As { - default: - - case AADD, AADDC, AADDW: - if p.As == AADDW && r == p.To.Reg { - zRR(op_AR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else { - zRRF(opcode, uint32(p.From.Reg), 0, uint32(p.To.Reg), uint32(r), asm) - } - - case AADDE, AMULLW, AMULLD: - if r == p.To.Reg { - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else if p.From.Reg == p.To.Reg { - zRRE(opcode, uint32(p.To.Reg), uint32(r), asm) - } else { - zRRE(op_LGR, uint32(p.To.Reg), uint32(r), asm) - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - - case ADIVW, ADIVWU, ADIVD, ADIVDU: - if p.As == ADIVWU || p.As == ADIVDU { - zRI(op_LGHI, REGTMP, 0, asm) - } - zRRE(op_LGR, REGTMP2, uint32(r), asm) - zRRE(opcode, REGTMP, uint32(p.From.Reg), asm) - zRRE(op_LGR, uint32(p.To.Reg), REGTMP2, asm) - - case AMODW, AMODWU, AMODD, AMODDU: - if p.As == AMODWU || p.As == AMODDU { - zRI(op_LGHI, REGTMP, 0, asm) - } - zRRE(op_LGR, REGTMP2, uint32(r), asm) - zRRE(opcode, REGTMP, uint32(p.From.Reg), asm) - zRRE(op_LGR, uint32(p.To.Reg), REGTMP, asm) - - case AFADD, AFADDS: - if r == p.To.Reg { - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else if p.From.Reg == p.To.Reg { - zRRE(opcode, uint32(p.To.Reg), uint32(r), asm) - } else { - zRR(op_LDR, uint32(p.To.Reg), uint32(r), asm) - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - - case AFSUB, AFSUBS, AFDIV, AFDIVS: - if r == p.To.Reg { - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else if p.From.Reg == p.To.Reg { - zRRE(op_LGDR, REGTMP, uint32(r), asm) - zRRE(opcode, uint32(r), uint32(p.From.Reg), asm) - zRR(op_LDR, uint32(p.To.Reg), uint32(r), asm) - zRRE(op_LDGR, uint32(r), REGTMP, asm) - } else { - zRR(op_LDR, uint32(p.To.Reg), uint32(r), asm) - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - - } - - case 3: // mov $constant reg - v := vregoff(ctxt, &p.From) - switch p.As { - case AMOVBZ: - v = int64(uint8(v)) - case AMOVHZ: - v = int64(uint16(v)) - case AMOVWZ: - v = int64(uint32(v)) - case AMOVB: - v = int64(int8(v)) - case AMOVH: - v = int64(int16(v)) - case AMOVW: - v = int64(int32(v)) - } - if int64(int16(v)) == v { - zRI(op_LGHI, uint32(p.To.Reg), uint32(v), asm) - } else if v&0xffff0000 == v { - zRI(op_LLILH, uint32(p.To.Reg), uint32(v>>16), asm) - } else if v&0xffff00000000 == v { - zRI(op_LLIHL, uint32(p.To.Reg), uint32(v>>32), asm) - } else if uint64(v)&0xffff000000000000 == uint64(v) { - zRI(op_LLIHH, uint32(p.To.Reg), uint32(v>>48), asm) - } else if int64(int32(v)) == v { - zRIL(_a, op_LGFI, uint32(p.To.Reg), uint32(v), asm) - } else if int64(uint32(v)) == v { - zRIL(_a, op_LLILF, uint32(p.To.Reg), uint32(v), asm) - } else if uint64(v)&0xffffffff00000000 == uint64(v) { - zRIL(_a, op_LLIHF, uint32(p.To.Reg), uint32(v>>32), asm) - } else { - zRIL(_a, op_LLILF, uint32(p.To.Reg), uint32(v), asm) - zRIL(_a, op_IIHF, uint32(p.To.Reg), uint32(v>>32), asm) - } - - case 4: // multiply high (a*b)>>64 - r := p.Reg - if r == 0 { - r = p.To.Reg - } - zRRE(op_LGR, REGTMP2, uint32(r), asm) - zRRE(op_MLGR, REGTMP, uint32(p.From.Reg), asm) - switch p.As { - case AMULHDU: - // Unsigned: move result into correct register. - zRRE(op_LGR, uint32(p.To.Reg), REGTMP, asm) - case AMULHD: - // Signed: need to convert result. - // See Hacker's Delight 8-3. - zRSY(op_SRAG, REGTMP2, uint32(p.From.Reg), 0, 63, asm) - zRRE(op_NGR, REGTMP2, uint32(r), asm) - zRRE(op_SGR, REGTMP, REGTMP2, asm) - zRSY(op_SRAG, REGTMP2, uint32(r), 0, 63, asm) - zRRE(op_NGR, REGTMP2, uint32(p.From.Reg), asm) - zRRF(op_SGRK, REGTMP2, 0, uint32(p.To.Reg), REGTMP, asm) - } - - case 5: // syscall - zI(op_SVC, 0, asm) - - case 6: // logical op reg [reg] reg - var oprr, oprre, oprrf uint32 - switch p.As { - case AAND: - oprre = op_NGR - oprrf = op_NGRK - case AANDW: - oprr = op_NR - oprrf = op_NRK - case AOR: - oprre = op_OGR - oprrf = op_OGRK - case AORW: - oprr = op_OR - oprrf = op_ORK - case AXOR: - oprre = op_XGR - oprrf = op_XGRK - case AXORW: - oprr = op_XR - oprrf = op_XRK - } - if p.Reg == 0 { - if oprr != 0 { - zRR(oprr, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else { - zRRE(oprre, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - } else { - zRRF(oprrf, uint32(p.Reg), 0, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - - case 7: // shift/rotate reg [reg] reg - d2 := vregoff(ctxt, &p.From) - b2 := p.From.Reg - r3 := p.Reg - if r3 == 0 { - r3 = p.To.Reg - } - r1 := p.To.Reg - var opcode uint32 - switch p.As { - default: - case ASLD: - opcode = op_SLLG - case ASRD: - opcode = op_SRLG - case ASLW: - opcode = op_SLLK - case ASRW: - opcode = op_SRLK - case ARLL: - opcode = op_RLL - case ARLLG: - opcode = op_RLLG - case ASRAW: - opcode = op_SRAK - case ASRAD: - opcode = op_SRAG - } - zRSY(opcode, uint32(r1), uint32(r3), uint32(b2), uint32(d2), asm) - - case 8: // find leftmost one - if p.To.Reg&1 != 0 { - ctxt.Diag("target must be an even-numbered register") - } - // FLOGR also writes a mask to p.To.Reg+1. - zRRE(op_FLOGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - - case 10: // subtract reg [reg] reg - r := int(p.Reg) - - switch p.As { - default: - case ASUB: - if r == 0 { - zRRE(op_SGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else { - zRRF(op_SGRK, uint32(p.From.Reg), 0, uint32(p.To.Reg), uint32(r), asm) - } - case ASUBC: - if r == 0 { - zRRE(op_SLGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else { - zRRF(op_SLGRK, uint32(p.From.Reg), 0, uint32(p.To.Reg), uint32(r), asm) - } - case ASUBE: - if r == 0 { - r = int(p.To.Reg) - } - if r == int(p.To.Reg) { - zRRE(op_SLBGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else if p.From.Reg == p.To.Reg { - zRRE(op_LGR, REGTMP, uint32(p.From.Reg), asm) - zRRE(op_LGR, uint32(p.To.Reg), uint32(r), asm) - zRRE(op_SLBGR, uint32(p.To.Reg), REGTMP, asm) - } else { - zRRE(op_LGR, uint32(p.To.Reg), uint32(r), asm) - zRRE(op_SLBGR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - case ASUBW: - if r == 0 { - zRR(op_SR, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else { - zRRF(op_SRK, uint32(p.From.Reg), 0, uint32(p.To.Reg), uint32(r), asm) - } - } - - case 11: // br/bl - v := int32(0) - - if p.Pcond != nil { - v = int32((p.Pcond.Pc - p.Pc) >> 1) - } - - if p.As == ABR && p.To.Sym == nil && int32(int16(v)) == v { - zRI(op_BRC, 0xF, uint32(v), asm) - } else { - if p.As == ABL { - zRIL(_b, op_BRASL, uint32(REG_LR), uint32(v), asm) - } else { - zRIL(_c, op_BRCL, 0xF, uint32(v), asm) - } - if p.To.Sym != nil { - addcallreloc(ctxt, p.To.Sym, p.To.Offset) - } - } - - case 12: - r1 := p.To.Reg - d2 := vregoff(ctxt, &p.From) - b2 := p.From.Reg - if b2 == 0 { - b2 = o.param - } - x2 := p.From.Index - if -DISP20/2 > d2 || d2 >= DISP20/2 { - zRIL(_a, op_LGFI, REGTMP, uint32(d2), asm) - if x2 != 0 { - zRX(op_LA, REGTMP, REGTMP, uint32(x2), 0, asm) - } - x2 = REGTMP - d2 = 0 - } - var opx, opxy uint32 - switch p.As { - case AADD: - opxy = op_AG - case AADDC: - opxy = op_ALG - case AADDW: - opx = op_A - opxy = op_AY - case AMULLW: - opx = op_MS - opxy = op_MSY - case AMULLD: - opxy = op_MSG - case ASUB: - opxy = op_SG - case ASUBC: - opxy = op_SLG - case ASUBE: - opxy = op_SLBG - case ASUBW: - opx = op_S - opxy = op_SY - case AAND: - opxy = op_NG - case AANDW: - opx = op_N - opxy = op_NY - case AOR: - opxy = op_OG - case AORW: - opx = op_O - opxy = op_OY - case AXOR: - opxy = op_XG - case AXORW: - opx = op_X - opxy = op_XY - } - if opx != 0 && 0 <= d2 && d2 < DISP12 { - zRX(opx, uint32(r1), uint32(x2), uint32(b2), uint32(d2), asm) - } else { - zRXY(opxy, uint32(r1), uint32(x2), uint32(b2), uint32(d2), asm) - } - - case 15: // br/bl (reg) - r := p.To.Reg - if p.As == ABCL || p.As == ABL { - zRR(op_BASR, uint32(REG_LR), uint32(r), asm) - } else { - zRR(op_BCR, 0xF, uint32(r), asm) - } - - case 16: // conditional branch - v := int32(0) - if p.Pcond != nil { - v = int32((p.Pcond.Pc - p.Pc) >> 1) - } - mask := branchMask(ctxt, p) - if p.To.Sym == nil && int32(int16(v)) == v { - zRI(op_BRC, mask, uint32(v), asm) - } else { - zRIL(_c, op_BRCL, mask, uint32(v), asm) - } - if p.To.Sym != nil { - addrilreloc(ctxt, p.To.Sym, p.To.Offset) - } - - case 17: // move on condition - m3 := branchMask(ctxt, p) - zRRF(op_LOCGR, m3, 0, uint32(p.To.Reg), uint32(p.From.Reg), asm) - - case 18: // br/bl reg - if p.As == ABL { - zRR(op_BASR, uint32(REG_LR), uint32(p.To.Reg), asm) - } else { - zRR(op_BCR, 0xF, uint32(p.To.Reg), asm) - } - - case 19: // mov $sym+n(SB) reg - d := vregoff(ctxt, &p.From) - zRIL(_b, op_LARL, uint32(p.To.Reg), 0, asm) - if d&1 != 0 { - zRX(op_LA, uint32(p.To.Reg), uint32(p.To.Reg), 0, 1, asm) - d -= 1 - } - addrilreloc(ctxt, p.From.Sym, d) - - case 21: // subtract $constant [reg] reg - v := vregoff(ctxt, &p.From) - r := p.Reg - if r == 0 { - r = p.To.Reg - } - switch p.As { - case ASUB: - zRIL(_a, op_LGFI, uint32(REGTMP), uint32(v), asm) - zRRF(op_SLGRK, uint32(REGTMP), 0, uint32(p.To.Reg), uint32(r), asm) - case ASUBC: - if r != p.To.Reg { - zRRE(op_LGR, uint32(p.To.Reg), uint32(r), asm) - } - zRIL(_a, op_SLGFI, uint32(p.To.Reg), uint32(v), asm) - case ASUBW: - if r != p.To.Reg { - zRR(op_LR, uint32(p.To.Reg), uint32(r), asm) - } - zRIL(_a, op_SLFI, uint32(p.To.Reg), uint32(v), asm) - } - - case 22: // add/multiply $constant [reg] reg - v := vregoff(ctxt, &p.From) - r := p.Reg - if r == 0 { - r = p.To.Reg - } - var opri, opril, oprie uint32 - switch p.As { - case AADD: - opri = op_AGHI - opril = op_AGFI - oprie = op_AGHIK - case AADDC: - opril = op_ALGFI - oprie = op_ALGHSIK - case AADDW: - opri = op_AHI - opril = op_AFI - oprie = op_AHIK - case AMULLW: - opri = op_MHI - opril = op_MSFI - case AMULLD: - opri = op_MGHI - opril = op_MSGFI - } - if r != p.To.Reg && (oprie == 0 || int64(int16(v)) != v) { - switch p.As { - case AADD, AADDC, AMULLD: - zRRE(op_LGR, uint32(p.To.Reg), uint32(r), asm) - case AADDW, AMULLW: - zRR(op_LR, uint32(p.To.Reg), uint32(r), asm) - } - r = p.To.Reg - } - if r == p.To.Reg { - if opri != 0 && int64(int16(v)) == v { - zRI(opri, uint32(p.To.Reg), uint32(v), asm) - } else { - zRIL(_a, opril, uint32(p.To.Reg), uint32(v), asm) - } - } else { - zRIE(_d, oprie, uint32(p.To.Reg), uint32(r), uint32(v), 0, 0, 0, 0, asm) - } - - case 23: // 64-bit logical op $constant reg - // TODO(mundaym): merge with case 24. - v := vregoff(ctxt, &p.From) - switch p.As { - default: - ctxt.Diag("%v is not supported", p) - case AAND: - if v >= 0 { // needs zero extend - zRIL(_a, op_LGFI, REGTMP, uint32(v), asm) - zRRE(op_NGR, uint32(p.To.Reg), REGTMP, asm) - } else if int64(int16(v)) == v { - zRI(op_NILL, uint32(p.To.Reg), uint32(v), asm) - } else { // r.To.Reg & 0xffffffff00000000 & uint32(v) - zRIL(_a, op_NILF, uint32(p.To.Reg), uint32(v), asm) - } - case AOR: - if int64(uint32(v)) != v { // needs sign extend - zRIL(_a, op_LGFI, REGTMP, uint32(v), asm) - zRRE(op_OGR, uint32(p.To.Reg), REGTMP, asm) - } else if int64(uint16(v)) == v { - zRI(op_OILL, uint32(p.To.Reg), uint32(v), asm) - } else { - zRIL(_a, op_OILF, uint32(p.To.Reg), uint32(v), asm) - } - case AXOR: - if int64(uint32(v)) != v { // needs sign extend - zRIL(_a, op_LGFI, REGTMP, uint32(v), asm) - zRRE(op_XGR, uint32(p.To.Reg), REGTMP, asm) - } else { - zRIL(_a, op_XILF, uint32(p.To.Reg), uint32(v), asm) - } - } - - case 24: // 32-bit logical op $constant reg - v := vregoff(ctxt, &p.From) - switch p.As { - case AANDW: - if uint32(v&0xffff0000) == 0xffff0000 { - zRI(op_NILL, uint32(p.To.Reg), uint32(v), asm) - } else if uint32(v&0x0000ffff) == 0x0000ffff { - zRI(op_NILH, uint32(p.To.Reg), uint32(v)>>16, asm) - } else { - zRIL(_a, op_NILF, uint32(p.To.Reg), uint32(v), asm) - } - case AORW: - if uint32(v&0xffff0000) == 0 { - zRI(op_OILL, uint32(p.To.Reg), uint32(v), asm) - } else if uint32(v&0x0000ffff) == 0 { - zRI(op_OILH, uint32(p.To.Reg), uint32(v)>>16, asm) - } else { - zRIL(_a, op_OILF, uint32(p.To.Reg), uint32(v), asm) - } - case AXORW: - zRIL(_a, op_XILF, uint32(p.To.Reg), uint32(v), asm) - } - - case 26: // MOVD $offset(base)(index), reg - v := regoff(ctxt, &p.From) - r := p.From.Reg - if r == 0 { - r = o.param - } - i := p.From.Index - if v >= 0 && v < DISP12 { - zRX(op_LA, uint32(p.To.Reg), uint32(r), uint32(i), uint32(v), asm) - } else if v >= -DISP20/2 && v < DISP20/2 { - zRXY(op_LAY, uint32(p.To.Reg), uint32(r), uint32(i), uint32(v), asm) - } else { - zRIL(_a, op_LGFI, REGTMP, uint32(v), asm) - zRX(op_LA, uint32(p.To.Reg), uint32(r), REGTMP, uint32(i), asm) - } - - case 31: // dword - wd := uint64(vregoff(ctxt, &p.From)) - *asm = append(*asm, - uint8(wd>>56), - uint8(wd>>48), - uint8(wd>>40), - uint8(wd>>32), - uint8(wd>>24), - uint8(wd>>16), - uint8(wd>>8), - uint8(wd)) - - case 32: // fmul freg [freg] freg - r := int(p.Reg) - if r == 0 { - r = int(p.To.Reg) - } - - var opcode uint32 - - switch p.As { - default: - ctxt.Diag("invalid opcode") - case AFMUL: - opcode = op_MDBR - case AFMULS: - opcode = op_MEEBR - } - - if r == int(p.To.Reg) { - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } else if p.From.Reg == p.To.Reg { - zRRE(opcode, uint32(p.To.Reg), uint32(r), asm) - } else { - zRR(op_LDR, uint32(p.To.Reg), uint32(r), asm) - zRRE(opcode, uint32(p.To.Reg), uint32(p.From.Reg), asm) - } - - case 33: // float op [freg] freg - r := p.From.Reg - if oclass(&p.From) == C_NONE { - r = p.To.Reg - } - var opcode uint32 - switch p.As { - default: - case AFABS: - opcode = op_LPDBR - case AFNABS: - opcode = op_LNDBR - case AFNEG: - opcode = op_LCDFR - case AFNEGS: - opcode = op_LCEBR - case ALEDBR: - opcode = op_LEDBR - case ALDEBR: - opcode = op_LDEBR - case AFSQRT: - opcode = op_SQDBR - case AFSQRTS: - opcode = op_SQEBR - } - zRRE(opcode, uint32(p.To.Reg), uint32(r), asm) - - case 34: // float multiply-add freg freg freg freg - var opcode uint32 - - switch p.As { - default: - ctxt.Diag("invalid opcode") - case AFMADD: - opcode = op_MADBR - case AFMADDS: - opcode = op_MAEBR - case AFMSUB: - opcode = op_MSDBR - case AFMSUBS: - opcode = op_MSEBR - case AFNMADD: - opcode = op_MADBR - case AFNMADDS: - opcode = op_MAEBR - case AFNMSUB: - opcode = op_MSDBR - case AFNMSUBS: - opcode = op_MSEBR - } - - zRR(op_LDR, uint32(p.To.Reg), uint32(p.Reg), asm) - zRRD(opcode, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.From3.Reg), asm) - - if p.As == AFNMADD || p.As == AFNMADDS || p.As == AFNMSUB || p.As == AFNMSUBS { - zRRE(op_LCDFR, uint32(p.To.Reg), uint32(p.To.Reg), asm) - } - - case 35: // mov reg mem (no relocation) - d2 := regoff(ctxt, &p.To) - b2 := p.To.Reg - if b2 == 0 { - b2 = o.param - } - x2 := p.To.Index - if d2 < -DISP20/2 || d2 >= DISP20/2 { - zRIL(_a, op_LGFI, REGTMP, uint32(d2), asm) - if x2 != 0 { - zRX(op_LA, REGTMP, REGTMP, uint32(x2), 0, asm) - } - x2 = REGTMP - d2 = 0 - } - zRXY(zopstore(ctxt, p.As), uint32(p.From.Reg), uint32(x2), uint32(b2), uint32(d2), asm) - - case 36: // mov mem reg (no relocation) - d2 := regoff(ctxt, &p.From) - b2 := p.From.Reg - if b2 == 0 { - b2 = o.param - } - x2 := p.From.Index - if d2 < -DISP20/2 || d2 >= DISP20/2 { - zRIL(_a, op_LGFI, REGTMP, uint32(d2), asm) - if x2 != 0 { - zRX(op_LA, REGTMP, REGTMP, uint32(x2), 0, asm) - } - x2 = REGTMP - d2 = 0 - } - zRXY(zopload(ctxt, p.As), uint32(p.To.Reg), uint32(x2), uint32(b2), uint32(d2), asm) - - case 40: // word/byte - wd := uint32(regoff(ctxt, &p.From)) - if p.As == AWORD { //WORD - *asm = append(*asm, uint8(wd>>24), uint8(wd>>16), uint8(wd>>8), uint8(wd)) - } else { //BYTE - *asm = append(*asm, uint8(wd)) - } - - case 47: // negate [reg] reg - r := p.From.Reg - if r == 0 { - r = p.To.Reg - } - switch p.As { - case ANEG: - zRRE(op_LCGR, uint32(p.To.Reg), uint32(r), asm) - case ANEGW: - zRRE(op_LCGFR, uint32(p.To.Reg), uint32(r), asm) - } - - case 48: // floating-point round to integer - m3 := vregoff(ctxt, &p.From) - if 0 > m3 || m3 > 7 { - ctxt.Diag("mask (%v) must be in the range [0, 7]", m3) - } - var opcode uint32 - switch p.As { - case AFIEBR: - opcode = op_FIEBR - case AFIDBR: - opcode = op_FIDBR - } - zRRF(opcode, uint32(m3), 0, uint32(p.To.Reg), uint32(p.Reg), asm) - - case 67: // fmov $0 freg - var opcode uint32 - switch p.As { - case AFMOVS: - opcode = op_LZER - case AFMOVD: - opcode = op_LZDR - } - zRRE(opcode, uint32(p.To.Reg), 0, asm) - - case 68: // movw areg reg - zRRE(op_EAR, uint32(p.To.Reg), uint32(p.From.Reg-REG_AR0), asm) - - case 69: // movw reg areg - zRRE(op_SAR, uint32(p.To.Reg-REG_AR0), uint32(p.From.Reg), asm) - - case 70: // cmp reg reg - if p.As == ACMPW || p.As == ACMPWU { - zRR(zoprr(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Reg), asm) - } else { - zRRE(zoprre(ctxt, p.As), uint32(p.From.Reg), uint32(p.To.Reg), asm) - } - - case 71: // cmp reg $constant - v := vregoff(ctxt, &p.To) - switch p.As { - case ACMP, ACMPW: - if int64(int32(v)) != v { - ctxt.Diag("%v overflows an int32", v) - } - case ACMPU, ACMPWU: - if int64(uint32(v)) != v { - ctxt.Diag("%v overflows a uint32", v) - } - } - if p.As == ACMP && int64(int16(v)) == v { - zRI(op_CGHI, uint32(p.From.Reg), uint32(v), asm) - } else if p.As == ACMPW && int64(int16(v)) == v { - zRI(op_CHI, uint32(p.From.Reg), uint32(v), asm) - } else { - zRIL(_a, zopril(ctxt, p.As), uint32(p.From.Reg), uint32(v), asm) - } - - case 72: // mov $constant mem - v := regoff(ctxt, &p.From) - d := regoff(ctxt, &p.To) - r := p.To.Reg - x := p.To.Index - if r == 0 { - r = o.param - } - if int32(int16(v)) == v && x == 0 { - if d < 0 || d >= DISP12 { - if r == REGTMP || r == REGTMP2 { - zRIL(_a, op_AGFI, uint32(r), uint32(d), asm) - } else { - zRIL(_a, op_LGFI, REGTMP, uint32(d), asm) - zRRE(op_AGR, REGTMP, uint32(r), asm) - r = REGTMP - } - d = 0 - } - var opcode uint32 - switch p.As { - case AMOVD: - opcode = op_MVGHI - case AMOVW, AMOVWZ: - opcode = op_MVHI - case AMOVH, AMOVHZ: - opcode = op_MVHHI - case AMOVB, AMOVBZ: - opcode = op_MVI - } - if opcode == op_MVI { - zSI(opcode, uint32(v), uint32(r), uint32(d), asm) - } else { - zSIL(opcode, uint32(r), uint32(d), uint32(v), asm) - } - } else { - zRIL(_a, op_LGFI, REGTMP2, uint32(v), asm) - if d < -DISP20/2 || d >= DISP20/2 { - if r == REGTMP { - zRIL(_a, op_AGFI, REGTMP, uint32(d), asm) - } else { - zRIL(_a, op_LGFI, REGTMP, uint32(d), asm) - if x != 0 { - zRRE(op_AGR, REGTMP, uint32(x), asm) - } - x = REGTMP - } - d = 0 - } - zRXY(zopstore(ctxt, p.As), REGTMP2, uint32(x), uint32(r), uint32(d), asm) - } - - case 73: // mov $constant addr (including relocation) - v := regoff(ctxt, &p.From) - d := regoff(ctxt, &p.To) - a := uint32(0) - if d&1 != 0 { - d -= 1 - a = 1 - } - zRIL(_b, op_LARL, REGTMP, uint32(d), asm) - addrilreloc(ctxt, p.To.Sym, int64(d)) - if int32(int16(v)) == v { - var opcode uint32 - switch p.As { - case AMOVD: - opcode = op_MVGHI - case AMOVW, AMOVWZ: - opcode = op_MVHI - case AMOVH, AMOVHZ: - opcode = op_MVHHI - case AMOVB, AMOVBZ: - opcode = op_MVI - } - if opcode == op_MVI { - zSI(opcode, uint32(v), REGTMP, a, asm) - } else { - zSIL(opcode, REGTMP, a, uint32(v), asm) - } - } else { - zRIL(_a, op_LGFI, REGTMP2, uint32(v), asm) - zRXY(zopstore(ctxt, p.As), REGTMP2, 0, REGTMP, a, asm) - } - - case 74: // mov reg addr (including relocation) - i2 := regoff(ctxt, &p.To) - switch p.As { - case AMOVD: - zRIL(_b, op_STGRL, uint32(p.From.Reg), 0, asm) - case AMOVW, AMOVWZ: // The zero extension doesn't affect store instructions - zRIL(_b, op_STRL, uint32(p.From.Reg), 0, asm) - case AMOVH, AMOVHZ: // The zero extension doesn't affect store instructions - zRIL(_b, op_STHRL, uint32(p.From.Reg), 0, asm) - case AMOVB, AMOVBZ: // The zero extension doesn't affect store instructions - zRIL(_b, op_LARL, REGTMP, 0, asm) - adj := uint32(0) // adjustment needed for odd addresses - if i2&1 != 0 { - i2 -= 1 - adj = 1 - } - zRX(op_STC, uint32(p.From.Reg), 0, REGTMP, adj, asm) - case AFMOVD: - zRIL(_b, op_LARL, REGTMP, 0, asm) - zRX(op_STD, uint32(p.From.Reg), 0, REGTMP, 0, asm) - case AFMOVS: - zRIL(_b, op_LARL, REGTMP, 0, asm) - zRX(op_STE, uint32(p.From.Reg), 0, REGTMP, 0, asm) - } - addrilreloc(ctxt, p.To.Sym, int64(i2)) - - case 75: // mov addr reg (including relocation) - i2 := regoff(ctxt, &p.From) - switch p.As { - case AMOVD: - if i2&1 != 0 { - zRIL(_b, op_LARL, REGTMP, 0, asm) - zRXY(op_LG, uint32(p.To.Reg), REGTMP, 0, 1, asm) - i2 -= 1 - } else { - zRIL(_b, op_LGRL, uint32(p.To.Reg), 0, asm) - } - case AMOVW: - zRIL(_b, op_LGFRL, uint32(p.To.Reg), 0, asm) - case AMOVWZ: - zRIL(_b, op_LLGFRL, uint32(p.To.Reg), 0, asm) - case AMOVH: - zRIL(_b, op_LGHRL, uint32(p.To.Reg), 0, asm) - case AMOVHZ: - zRIL(_b, op_LLGHRL, uint32(p.To.Reg), 0, asm) - case AMOVB, AMOVBZ: - zRIL(_b, op_LARL, REGTMP, 0, asm) - adj := uint32(0) // adjustment needed for odd addresses - if i2&1 != 0 { - i2 -= 1 - adj = 1 - } - switch p.As { - case AMOVB: - zRXY(op_LGB, uint32(p.To.Reg), 0, REGTMP, adj, asm) - case AMOVBZ: - zRXY(op_LLGC, uint32(p.To.Reg), 0, REGTMP, adj, asm) - } - case AFMOVD: - zRIL(_a, op_LARL, REGTMP, 0, asm) - zRX(op_LD, uint32(p.To.Reg), 0, REGTMP, 0, asm) - case AFMOVS: - zRIL(_a, op_LARL, REGTMP, 0, asm) - zRX(op_LE, uint32(p.To.Reg), 0, REGTMP, 0, asm) - } - addrilreloc(ctxt, p.From.Sym, int64(i2)) - - case 77: // syscall $constant - if p.From.Offset > 255 || p.From.Offset < 1 { - ctxt.Diag("illegal system call; system call number out of range: %v", p) - zE(op_TRAP2, asm) // trap always - } else { - zI(op_SVC, uint32(p.From.Offset), asm) - } - - case 78: // undef - // "An instruction consisting entirely of binary 0s is guaranteed - // always to be an illegal instruction." - *asm = append(*asm, 0, 0, 0, 0) - - case 79: // compare and swap reg reg reg - v := regoff(ctxt, &p.To) - if v < 0 { - v = 0 - } - if p.As == ACS { - zRS(op_CS, uint32(p.From.Reg), uint32(p.Reg), uint32(p.To.Reg), uint32(v), asm) - } else if p.As == ACSG { - zRSY(op_CSG, uint32(p.From.Reg), uint32(p.Reg), uint32(p.To.Reg), uint32(v), asm) - } - - case 81: // sync - zRR(op_BCR, 0xE, 0, asm) - - case 82: // fixed to float conversion - var opcode uint32 - switch p.As { - default: - log.Fatalf("unexpected opcode %v", p.As) - case ACEFBRA: - opcode = op_CEFBRA - case ACDFBRA: - opcode = op_CDFBRA - case ACEGBRA: - opcode = op_CEGBRA - case ACDGBRA: - opcode = op_CDGBRA - case ACELFBR: - opcode = op_CELFBR - case ACDLFBR: - opcode = op_CDLFBR - case ACELGBR: - opcode = op_CELGBR - case ACDLGBR: - opcode = op_CDLGBR - } - // set immediate operand M3 to 0 to use the default BFP rounding mode - // (usually round to nearest, ties to even) - // TODO(mundaym): should this be fixed at round to nearest, ties to even? - // M4 is reserved and must be 0 - zRRF(opcode, 0, 0, uint32(p.To.Reg), uint32(p.From.Reg), asm) - - case 83: // float to fixed conversion - var opcode uint32 - switch p.As { - default: - log.Fatalf("unexpected opcode %v", p.As) - case ACFEBRA: - opcode = op_CFEBRA - case ACFDBRA: - opcode = op_CFDBRA - case ACGEBRA: - opcode = op_CGEBRA - case ACGDBRA: - opcode = op_CGDBRA - case ACLFEBR: - opcode = op_CLFEBR - case ACLFDBR: - opcode = op_CLFDBR - case ACLGEBR: - opcode = op_CLGEBR - case ACLGDBR: - opcode = op_CLGDBR - } - // set immediate operand M3 to 5 for rounding toward zero (required by Go spec) - // M4 is reserved and must be 0 - zRRF(opcode, 5, 0, uint32(p.To.Reg), uint32(p.From.Reg), asm) - - case 84: // storage-and-storage operations $length mem mem (length in From3) - l := regoff(ctxt, p.From3) - if l < 1 || l > 256 { - ctxt.Diag("number of bytes (%v) not in range [1,256]", l) - } - if p.From.Index != 0 || p.To.Index != 0 { - ctxt.Diag("cannot use index reg") - } - b1 := p.To.Reg - b2 := p.From.Reg - if b1 == 0 { - b1 = o.param - } - if b2 == 0 { - b2 = o.param - } - d1 := regoff(ctxt, &p.To) - d2 := regoff(ctxt, &p.From) - if d1 < 0 || d1 >= DISP12 { - if b2 == REGTMP { - ctxt.Diag("REGTMP conflict") - } - if b1 != REGTMP { - zRRE(op_LGR, REGTMP, uint32(b1), asm) - } - zRIL(_a, op_AGFI, REGTMP, uint32(d1), asm) - if d1 == d2 && b1 == b2 { - d2 = 0 - b2 = REGTMP - } - d1 = 0 - b1 = REGTMP - } - if d2 < 0 || d2 >= DISP12 { - if b1 == REGTMP2 { - ctxt.Diag("REGTMP2 conflict") - } - if b2 != REGTMP2 { - zRRE(op_LGR, REGTMP2, uint32(b2), asm) - } - zRIL(_a, op_AGFI, REGTMP2, uint32(d2), asm) - d2 = 0 - b2 = REGTMP2 - } - var opcode uint32 - switch p.As { - default: - ctxt.Diag("unexpected opcode %v", p.As) - case AMVC: - opcode = op_MVC - case ACLC: - opcode = op_CLC - // swap operand order for CLC so that it matches CMP - b1, b2 = b2, b1 - d1, d2 = d2, d1 - case AXC: - opcode = op_XC - case AOC: - opcode = op_OC - case ANC: - opcode = op_NC - } - zSS(_a, opcode, uint32(l-1), 0, uint32(b1), uint32(d1), uint32(b2), uint32(d2), asm) - - case 85: // load address relative long - v := regoff(ctxt, &p.From) - if p.From.Sym == nil { - if (v & 1) != 0 { - ctxt.Diag("cannot use LARL with odd offset: %v", v) - } - } else { - addrilreloc(ctxt, p.From.Sym, int64(v)) - v = 0 - } - zRIL(_b, op_LARL, uint32(p.To.Reg), uint32(v>>1), asm) - - case 86: // load address - d := vregoff(ctxt, &p.From) - x := p.From.Index - b := p.From.Reg - if b == 0 { - b = o.param - } - switch p.As { - case ALA: - zRX(op_LA, uint32(p.To.Reg), uint32(x), uint32(b), uint32(d), asm) - case ALAY: - zRXY(op_LAY, uint32(p.To.Reg), uint32(x), uint32(b), uint32(d), asm) - } - - case 87: // execute relative long - v := vregoff(ctxt, &p.From) - if p.From.Sym == nil { - if v&1 != 0 { - ctxt.Diag("cannot use EXRL with odd offset: %v", v) - } - } else { - addrilreloc(ctxt, p.From.Sym, v) - v = 0 - } - zRIL(_b, op_EXRL, uint32(p.To.Reg), uint32(v>>1), asm) - - case 88: // store clock - var opcode uint32 - switch p.As { - case ASTCK: - opcode = op_STCK - case ASTCKC: - opcode = op_STCKC - case ASTCKE: - opcode = op_STCKE - case ASTCKF: - opcode = op_STCKF - } - v := vregoff(ctxt, &p.To) - r := int(p.To.Reg) - if r == 0 { - r = int(o.param) - } - zS(opcode, uint32(r), uint32(v), asm) - - case 89: // compare and branch reg reg - var v int32 - if p.Pcond != nil { - v = int32((p.Pcond.Pc - p.Pc) >> 1) - } - var opcode, opcode2 uint32 - switch p.As { - case ACMPBEQ, ACMPBGE, ACMPBGT, ACMPBLE, ACMPBLT, ACMPBNE: - opcode = op_CGRJ - opcode2 = op_CGR - case ACMPUBEQ, ACMPUBGE, ACMPUBGT, ACMPUBLE, ACMPUBLT, ACMPUBNE: - opcode = op_CLGRJ - opcode2 = op_CLGR - } - mask := branchMask(ctxt, p) - if int32(int16(v)) != v { - zRRE(opcode2, uint32(p.From.Reg), uint32(p.Reg), asm) - zRIL(_c, op_BRCL, mask, uint32(v-sizeRRE/2), asm) - } else { - zRIE(_b, opcode, uint32(p.From.Reg), uint32(p.Reg), uint32(v), 0, 0, mask, 0, asm) - } - - case 90: // compare and branch reg $constant - var v int32 - if p.Pcond != nil { - v = int32((p.Pcond.Pc - p.Pc) >> 1) - } - var opcode, opcode2 uint32 - switch p.As { - case ACMPBEQ, ACMPBGE, ACMPBGT, ACMPBLE, ACMPBLT, ACMPBNE: - opcode = op_CGIJ - opcode2 = op_CGFI - case ACMPUBEQ, ACMPUBGE, ACMPUBGT, ACMPUBLE, ACMPUBLT, ACMPUBNE: - opcode = op_CLGIJ - opcode2 = op_CLGFI - } - mask := branchMask(ctxt, p) - if int32(int16(v)) != v { - zRIL(_a, opcode2, uint32(p.From.Reg), uint32(regoff(ctxt, p.From3)), asm) - zRIL(_c, op_BRCL, mask, uint32(v-sizeRIL/2), asm) - } else { - zRIE(_c, opcode, uint32(p.From.Reg), mask, uint32(v), 0, 0, 0, uint32(regoff(ctxt, p.From3)), asm) - } - - case 93: // GOT lookup - v := vregoff(ctxt, &p.To) - if v != 0 { - ctxt.Diag("invalid offset against GOT slot %v", p) - } - zRIL(_b, op_LGRL, uint32(p.To.Reg), 0, asm) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + 2) - rel.Siz = 4 - rel.Sym = p.From.Sym - rel.Type = obj.R_GOTPCREL - rel.Add = 2 + int64(rel.Siz) - - case 94: // TLS local exec model - zRIL(_b, op_LARL, REGTMP, (sizeRIL+sizeRXY+sizeRI)>>1, asm) - zRXY(op_LG, uint32(p.To.Reg), REGTMP, 0, 0, asm) - zRI(op_BRC, 0xF, (sizeRI+8)>>1, asm) - *asm = append(*asm, 0, 0, 0, 0, 0, 0, 0, 0) - rel := obj.Addrel(ctxt.Cursym) - rel.Off = int32(ctxt.Pc + sizeRIL + sizeRXY + sizeRI) - rel.Siz = 8 - rel.Sym = p.From.Sym - rel.Type = obj.R_TLS_LE - rel.Add = 0 - - case 95: // TLS initial exec model - // Assembly | Relocation symbol | Done Here? - // -------------------------------------------------------------- - // ear %r11, %a0 | | - // sllg %r11, %r11, 32 | | - // ear %r11, %a1 | | - // larl %r10, @indntpoff | R_390_TLS_IEENT | Y - // lg %r10, 0(%r10) | R_390_TLS_LOAD (tag) | Y - // la %r10, 0(%r10, %r11) | | - // -------------------------------------------------------------- - - // R_390_TLS_IEENT - zRIL(_b, op_LARL, REGTMP, 0, asm) - ieent := obj.Addrel(ctxt.Cursym) - ieent.Off = int32(ctxt.Pc + 2) - ieent.Siz = 4 - ieent.Sym = p.From.Sym - ieent.Type = obj.R_TLS_IE - ieent.Add = 2 + int64(ieent.Siz) - - // R_390_TLS_LOAD - zRXY(op_LGF, uint32(p.To.Reg), REGTMP, 0, 0, asm) - // TODO(mundaym): add R_390_TLS_LOAD relocation here - // not strictly required but might allow the linker to optimize - - case 96: // clear macro - length := vregoff(ctxt, &p.From) - offset := vregoff(ctxt, &p.To) - reg := p.To.Reg - if reg == 0 { - reg = o.param - } - if length <= 0 { - ctxt.Diag("cannot CLEAR %d bytes, must be greater than 0", length) - } - for length > 0 { - if offset < 0 || offset >= DISP12 { - if offset >= -DISP20/2 && offset < DISP20/2 { - zRXY(op_LAY, REGTMP, uint32(reg), 0, uint32(offset), asm) - } else { - if reg != REGTMP { - zRRE(op_LGR, REGTMP, uint32(reg), asm) - } - zRIL(_a, op_AGFI, REGTMP, uint32(offset), asm) - } - reg = REGTMP - offset = 0 - } - size := length - if size > 256 { - size = 256 - } - - switch size { - case 1: - zSI(op_MVI, 0, uint32(reg), uint32(offset), asm) - case 2: - zSIL(op_MVHHI, uint32(reg), uint32(offset), 0, asm) - case 4: - zSIL(op_MVHI, uint32(reg), uint32(offset), 0, asm) - case 8: - zSIL(op_MVGHI, uint32(reg), uint32(offset), 0, asm) - default: - zSS(_a, op_XC, uint32(size-1), 0, uint32(reg), uint32(offset), uint32(reg), uint32(offset), asm) - } - - length -= size - offset += size - } - - case 97: // store multiple - rstart := p.From.Reg - rend := p.Reg - offset := regoff(ctxt, &p.To) - reg := p.To.Reg - if reg == 0 { - reg = o.param - } - if offset < -DISP20/2 || offset >= DISP20/2 { - if reg != REGTMP { - zRRE(op_LGR, REGTMP, uint32(reg), asm) - } - zRIL(_a, op_AGFI, REGTMP, uint32(offset), asm) - reg = REGTMP - offset = 0 - } - switch p.As { - case ASTMY: - if offset >= 0 && offset < DISP12 { - zRS(op_STM, uint32(rstart), uint32(rend), uint32(reg), uint32(offset), asm) - } else { - zRSY(op_STMY, uint32(rstart), uint32(rend), uint32(reg), uint32(offset), asm) - } - case ASTMG: - zRSY(op_STMG, uint32(rstart), uint32(rend), uint32(reg), uint32(offset), asm) - } - - case 98: // load multiple - rstart := p.Reg - rend := p.To.Reg - offset := regoff(ctxt, &p.From) - reg := p.From.Reg - if reg == 0 { - reg = o.param - } - if offset < -DISP20/2 || offset >= DISP20/2 { - if reg != REGTMP { - zRRE(op_LGR, REGTMP, uint32(reg), asm) - } - zRIL(_a, op_AGFI, REGTMP, uint32(offset), asm) - reg = REGTMP - offset = 0 - } - switch p.As { - case ALMY: - if offset >= 0 && offset < DISP12 { - zRS(op_LM, uint32(rstart), uint32(rend), uint32(reg), uint32(offset), asm) - } else { - zRSY(op_LMY, uint32(rstart), uint32(rend), uint32(reg), uint32(offset), asm) - } - case ALMG: - zRSY(op_LMG, uint32(rstart), uint32(rend), uint32(reg), uint32(offset), asm) - } - - case 99: // interlocked load and op - if p.To.Index != 0 { - ctxt.Diag("cannot use indexed address") - } - offset := regoff(ctxt, &p.To) - if offset < -DISP20/2 || offset >= DISP20/2 { - ctxt.Diag("%v does not fit into 20-bit signed integer", offset) - } - var opcode uint32 - switch p.As { - case ALAA: - opcode = op_LAA - case ALAAG: - opcode = op_LAAG - case ALAAL: - opcode = op_LAAL - case ALAALG: - opcode = op_LAALG - case ALAN: - opcode = op_LAN - case ALANG: - opcode = op_LANG - case ALAX: - opcode = op_LAX - case ALAXG: - opcode = op_LAXG - case ALAO: - opcode = op_LAO - case ALAOG: - opcode = op_LAOG - } - zRSY(opcode, uint32(p.Reg), uint32(p.From.Reg), uint32(p.To.Reg), uint32(offset), asm) - - case 100: // VRX STORE - op, m3, _ := vop(p.As) - if p.From3 != nil { - m3 = uint32(vregoff(ctxt, p.From3)) - } - b2 := p.To.Reg - if b2 == 0 { - b2 = o.param - } - d2 := uint32(vregoff(ctxt, &p.To)) - zVRX(op, uint32(p.From.Reg), uint32(p.To.Index), uint32(b2), d2, m3, asm) - - case 101: // VRX LOAD - op, m3, _ := vop(p.As) - if p.From3 != nil { - m3 = uint32(vregoff(ctxt, p.From3)) - } - b2 := p.From.Reg - if b2 == 0 { - b2 = o.param - } - d2 := uint32(vregoff(ctxt, &p.From)) - zVRX(op, uint32(p.To.Reg), uint32(p.From.Index), uint32(b2), d2, m3, asm) - - case 102: // VRV SCATTER - op, m3, _ := vop(p.As) - if p.From3 != nil { - m3 = uint32(vregoff(ctxt, p.From3)) - } - b2 := p.To.Reg - if b2 == 0 { - b2 = o.param - } - d2 := uint32(vregoff(ctxt, &p.To)) - zVRV(op, uint32(p.From.Reg), uint32(p.To.Index), uint32(b2), d2, m3, asm) - - case 103: // VRV GATHER - op, m3, _ := vop(p.As) - if p.From3 != nil { - m3 = uint32(vregoff(ctxt, p.From3)) - } - b2 := p.From.Reg - if b2 == 0 { - b2 = o.param - } - d2 := uint32(vregoff(ctxt, &p.From)) - zVRV(op, uint32(p.To.Reg), uint32(p.From.Index), uint32(b2), d2, m3, asm) - - case 104: // VRS SHIFT/ROTATE and LOAD GR FROM VR ELEMENT - op, m4, _ := vop(p.As) - fr := p.Reg - if fr == 0 { - fr = p.To.Reg - } - bits := uint32(vregoff(ctxt, &p.From)) - zVRS(op, uint32(p.To.Reg), uint32(fr), uint32(p.From.Reg), bits, m4, asm) - - case 105: // VRS STORE MULTIPLE - op, _, _ := vop(p.As) - offset := uint32(vregoff(ctxt, &p.To)) - reg := p.To.Reg - if reg == 0 { - reg = o.param - } - zVRS(op, uint32(p.From.Reg), uint32(p.Reg), uint32(reg), offset, 0, asm) - - case 106: // VRS LOAD MULTIPLE - op, _, _ := vop(p.As) - offset := uint32(vregoff(ctxt, &p.From)) - reg := p.From.Reg - if reg == 0 { - reg = o.param - } - zVRS(op, uint32(p.Reg), uint32(p.To.Reg), uint32(reg), offset, 0, asm) - - case 107: // VRS STORE WITH LENGTH - op, _, _ := vop(p.As) - offset := uint32(vregoff(ctxt, &p.To)) - reg := p.To.Reg - if reg == 0 { - reg = o.param - } - zVRS(op, uint32(p.From.Reg), uint32(p.From3.Reg), uint32(reg), offset, 0, asm) - - case 108: // VRS LOAD WITH LENGTH - op, _, _ := vop(p.As) - offset := uint32(vregoff(ctxt, &p.From)) - reg := p.From.Reg - if reg == 0 { - reg = o.param - } - zVRS(op, uint32(p.To.Reg), uint32(p.From3.Reg), uint32(reg), offset, 0, asm) - - case 109: // VRI-a - op, _, _ := vop(p.As) - i2 := uint32(vregoff(ctxt, &p.From)) - switch p.As { - case AVZERO: - i2 = 0 - case AVONE: - i2 = 0xffff - } - m3 := uint32(0) - if p.From3 != nil { - m3 = uint32(vregoff(ctxt, p.From3)) - } - zVRIa(op, uint32(p.To.Reg), i2, m3, asm) - - case 110: - op, m4, _ := vop(p.As) - i2 := uint32(vregoff(ctxt, p.From3)) - i3 := uint32(vregoff(ctxt, &p.From)) - zVRIb(op, uint32(p.To.Reg), i2, i3, m4, asm) - - case 111: - op, m4, _ := vop(p.As) - i2 := uint32(vregoff(ctxt, &p.From)) - zVRIc(op, uint32(p.To.Reg), uint32(p.Reg), i2, m4, asm) - - case 112: - op, m5, _ := vop(p.As) - i4 := uint32(vregoff(ctxt, p.From3)) - zVRId(op, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), i4, m5, asm) - - case 113: - op, m4, _ := vop(p.As) - m5 := singleElementMask(p.As) - i3 := uint32(vregoff(ctxt, &p.From)) - zVRIe(op, uint32(p.To.Reg), uint32(p.Reg), i3, m5, m4, asm) - - case 114: // VRR-a - op, m3, m5 := vop(p.As) - m4 := singleElementMask(p.As) - zVRRa(op, uint32(p.To.Reg), uint32(p.From.Reg), m5, m4, m3, asm) - - case 115: // VRR-a COMPARE - op, m3, m5 := vop(p.As) - m4 := singleElementMask(p.As) - zVRRa(op, uint32(p.From.Reg), uint32(p.To.Reg), m5, m4, m3, asm) - - case 116: // VRR-a - - case 117: // VRR-b - op, m4, m5 := vop(p.As) - zVRRb(op, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), m5, m4, asm) - - case 118: // VRR-c - op, m4, m6 := vop(p.As) - m5 := singleElementMask(p.As) - v3 := p.Reg - if v3 == 0 { - v3 = p.To.Reg - } - zVRRc(op, uint32(p.To.Reg), uint32(p.From.Reg), uint32(v3), m6, m5, m4, asm) - - case 119: // VRR-c SHIFT/ROTATE/DIVIDE/SUB (rhs value on the left, like SLD, DIV etc.) - op, m4, m6 := vop(p.As) - m5 := singleElementMask(p.As) - v2 := p.Reg - if v2 == 0 { - v2 = p.To.Reg - } - zVRRc(op, uint32(p.To.Reg), uint32(v2), uint32(p.From.Reg), m6, m5, m4, asm) - - case 120: // VRR-d - op, m6, _ := vop(p.As) - m5 := singleElementMask(p.As) - v1 := uint32(p.To.Reg) - v2 := uint32(p.From3.Reg) - v3 := uint32(p.From.Reg) - v4 := uint32(p.Reg) - zVRRd(op, v1, v2, v3, m6, m5, v4, asm) - - case 121: // VRR-e - op, m6, _ := vop(p.As) - m5 := singleElementMask(p.As) - v1 := uint32(p.To.Reg) - v2 := uint32(p.From3.Reg) - v3 := uint32(p.From.Reg) - v4 := uint32(p.Reg) - zVRRe(op, v1, v2, v3, m6, m5, v4, asm) - - case 122: // VRR-f LOAD VRS FROM GRS DISJOINT - op, _, _ := vop(p.As) - zVRRf(op, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), asm) - - case 123: // VPDI $m4, V2, V3, V1 - op, _, _ := vop(p.As) - m4 := regoff(ctxt, p.From3) - zVRRc(op, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), 0, 0, uint32(m4), asm) - } -} - -func vregoff(ctxt *obj.Link, a *obj.Addr) int64 { - ctxt.Instoffset = 0 - if a != nil { - aclass(ctxt, a) - } - return ctxt.Instoffset -} - -func regoff(ctxt *obj.Link, a *obj.Addr) int32 { - return int32(vregoff(ctxt, a)) -} - -// zopload returns the RXY op for the given load -func zopload(ctxt *obj.Link, a obj.As) uint32 { - switch a { - // fixed point load - case AMOVD: - return op_LG - case AMOVW: - return op_LGF - case AMOVWZ: - return op_LLGF - case AMOVH: - return op_LGH - case AMOVHZ: - return op_LLGH - case AMOVB: - return op_LGB - case AMOVBZ: - return op_LLGC - - // floating point load - case AFMOVD: - return op_LDY - case AFMOVS: - return op_LEY - - // byte reversed load - case AMOVDBR: - return op_LRVG - case AMOVWBR: - return op_LRV - case AMOVHBR: - return op_LRVH - } - - ctxt.Diag("unknown store opcode %v", a) - return 0 -} - -// zopstore returns the RXY op for the given store -func zopstore(ctxt *obj.Link, a obj.As) uint32 { - switch a { - // fixed point store - case AMOVD: - return op_STG - case AMOVW, AMOVWZ: - return op_STY - case AMOVH, AMOVHZ: - return op_STHY - case AMOVB, AMOVBZ: - return op_STCY - - // floating point store - case AFMOVD: - return op_STDY - case AFMOVS: - return op_STEY - - // byte reversed store - case AMOVDBR: - return op_STRVG - case AMOVWBR: - return op_STRV - case AMOVHBR: - return op_STRVH - } - - ctxt.Diag("unknown store opcode %v", a) - return 0 -} - -// zoprre returns the RRE op for the given a -func zoprre(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ACMP: - return op_CGR - case ACMPU: - return op_CLGR - case AFCMPO: //ordered - return op_KDBR - case AFCMPU: //unordered - return op_CDBR - case ACEBR: - return op_CEBR - } - ctxt.Diag("unknown rre opcode %v", a) - return 0 -} - -// zoprr returns the RR op for the given a -func zoprr(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ACMPW: - return op_CR - case ACMPWU: - return op_CLR - } - ctxt.Diag("unknown rr opcode %v", a) - return 0 -} - -// zopril returns the RIL op for the given a -func zopril(ctxt *obj.Link, a obj.As) uint32 { - switch a { - case ACMP: - return op_CGFI - case ACMPU: - return op_CLGFI - case ACMPW: - return op_CFI - case ACMPWU: - return op_CLFI - } - ctxt.Diag("unknown ril opcode %v", a) - return 0 -} - -// z instructions sizes -const ( - sizeE = 2 - sizeI = 2 - sizeIE = 4 - sizeMII = 6 - sizeRI = 4 - sizeRI1 = 4 - sizeRI2 = 4 - sizeRI3 = 4 - sizeRIE = 6 - sizeRIE1 = 6 - sizeRIE2 = 6 - sizeRIE3 = 6 - sizeRIE4 = 6 - sizeRIE5 = 6 - sizeRIE6 = 6 - sizeRIL = 6 - sizeRIL1 = 6 - sizeRIL2 = 6 - sizeRIL3 = 6 - sizeRIS = 6 - sizeRR = 2 - sizeRRD = 4 - sizeRRE = 4 - sizeRRF = 4 - sizeRRF1 = 4 - sizeRRF2 = 4 - sizeRRF3 = 4 - sizeRRF4 = 4 - sizeRRF5 = 4 - sizeRRR = 2 - sizeRRS = 6 - sizeRS = 4 - sizeRS1 = 4 - sizeRS2 = 4 - sizeRSI = 4 - sizeRSL = 6 - sizeRSY = 6 - sizeRSY1 = 6 - sizeRSY2 = 6 - sizeRX = 4 - sizeRX1 = 4 - sizeRX2 = 4 - sizeRXE = 6 - sizeRXF = 6 - sizeRXY = 6 - sizeRXY1 = 6 - sizeRXY2 = 6 - sizeS = 4 - sizeSI = 4 - sizeSIL = 6 - sizeSIY = 6 - sizeSMI = 6 - sizeSS = 6 - sizeSS1 = 6 - sizeSS2 = 6 - sizeSS3 = 6 - sizeSS4 = 6 - sizeSS5 = 6 - sizeSS6 = 6 - sizeSSE = 6 - sizeSSF = 6 -) - -// instruction format variations -type form int - -const ( - _a form = iota - _b - _c - _d - _e - _f -) - -func zE(op uint32, asm *[]byte) { - *asm = append(*asm, uint8(op>>8), uint8(op)) -} - -func zI(op, i1 uint32, asm *[]byte) { - *asm = append(*asm, uint8(op>>8), uint8(i1)) -} - -func zMII(op, m1, ri2, ri3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(m1)<<4)|uint8((ri2>>8)&0x0F), - uint8(ri2), - uint8(ri3>>16), - uint8(ri3>>8), - uint8(ri3)) -} - -func zRI(op, r1_m1, i2_ri2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1_m1)<<4)|(uint8(op)&0x0F), - uint8(i2_ri2>>8), - uint8(i2_ri2)) -} - -// Expected argument values for the instruction formats. -// -// Format a1 a2 a3 a4 a5 a6 a7 -// ------------------------------------ -// a r1, 0, i2, 0, 0, m3, 0 -// b r1, r2, ri4, 0, 0, m3, 0 -// c r1, m3, ri4, 0, 0, 0, i2 -// d r1, r3, i2, 0, 0, 0, 0 -// e r1, r3, ri2, 0, 0, 0, 0 -// f r1, r2, 0, i3, i4, 0, i5 -// g r1, m3, i2, 0, 0, 0, 0 -func zRIE(f form, op, r1, r2_m3_r3, i2_ri4_ri2, i3, i4, m3, i2_i5 uint32, asm *[]byte) { - *asm = append(*asm, uint8(op>>8), uint8(r1)<<4|uint8(r2_m3_r3&0x0F)) - - switch f { - default: - *asm = append(*asm, uint8(i2_ri4_ri2>>8), uint8(i2_ri4_ri2)) - case _f: - *asm = append(*asm, uint8(i3), uint8(i4)) - } - - switch f { - case _a, _b: - *asm = append(*asm, uint8(m3)<<4) - default: - *asm = append(*asm, uint8(i2_i5)) - } - - *asm = append(*asm, uint8(op)) -} - -func zRIL(f form, op, r1_m1, i2_ri2 uint32, asm *[]byte) { - if f == _a || f == _b { - r1_m1 = r1_m1 - obj.RBaseS390X // this is a register base - } - *asm = append(*asm, - uint8(op>>8), - (uint8(r1_m1)<<4)|(uint8(op)&0x0F), - uint8(i2_ri2>>24), - uint8(i2_ri2>>16), - uint8(i2_ri2>>8), - uint8(i2_ri2)) -} - -func zRIS(op, r1, m3, b4, d4, i2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1)<<4)|uint8(m3&0x0F), - (uint8(b4)<<4)|(uint8(d4>>8)&0x0F), - uint8(d4), - uint8(i2), - uint8(op)) -} - -func zRR(op, r1, r2 uint32, asm *[]byte) { - *asm = append(*asm, uint8(op>>8), (uint8(r1)<<4)|uint8(r2&0x0F)) -} - -func zRRD(op, r1, r3, r2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(op), - uint8(r1)<<4, - (uint8(r3)<<4)|uint8(r2&0x0F)) -} - -func zRRE(op, r1, r2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(op), - 0, - (uint8(r1)<<4)|uint8(r2&0x0F)) -} - -func zRRF(op, r3_m3, m4, r1, r2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(op), - (uint8(r3_m3)<<4)|uint8(m4&0x0F), - (uint8(r1)<<4)|uint8(r2&0x0F)) -} - -func zRRS(op, r1, r2, b4, d4, m3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1)<<4)|uint8(r2&0x0F), - (uint8(b4)<<4)|uint8((d4>>8)&0x0F), - uint8(d4), - uint8(m3)<<4, - uint8(op)) -} - -func zRS(op, r1, r3_m3, b2, d2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1)<<4)|uint8(r3_m3&0x0F), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2)) -} - -func zRSI(op, r1, r3, ri2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1)<<4)|uint8(r3&0x0F), - uint8(ri2>>8), - uint8(ri2)) -} - -func zRSL(op, l1, b2, d2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(l1), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2), - uint8(op)) -} - -func zRSY(op, r1, r3_m3, b2, d2 uint32, asm *[]byte) { - dl2 := uint16(d2) & 0x0FFF - *asm = append(*asm, - uint8(op>>8), - (uint8(r1)<<4)|uint8(r3_m3&0x0F), - (uint8(b2)<<4)|(uint8(dl2>>8)&0x0F), - uint8(dl2), - uint8(d2>>12), - uint8(op)) -} - -func zRX(op, r1_m1, x2, b2, d2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1_m1)<<4)|uint8(x2&0x0F), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2)) -} - -func zRXE(op, r1, x2, b2, d2, m3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r1)<<4)|uint8(x2&0x0F), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2), - uint8(m3)<<4, - uint8(op)) -} - -func zRXF(op, r3, x2, b2, d2, m1 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r3)<<4)|uint8(x2&0x0F), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2), - uint8(m1)<<4, - uint8(op)) -} - -func zRXY(op, r1_m1, x2, b2, d2 uint32, asm *[]byte) { - dl2 := uint16(d2) & 0x0FFF - *asm = append(*asm, - uint8(op>>8), - (uint8(r1_m1)<<4)|uint8(x2&0x0F), - (uint8(b2)<<4)|(uint8(dl2>>8)&0x0F), - uint8(dl2), - uint8(d2>>12), - uint8(op)) -} - -func zS(op, b2, d2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(op), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2)) -} - -func zSI(op, i2, b1, d1 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(i2), - (uint8(b1)<<4)|uint8((d1>>8)&0x0F), - uint8(d1)) -} - -func zSIL(op, b1, d1, i2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(op), - (uint8(b1)<<4)|uint8((d1>>8)&0x0F), - uint8(d1), - uint8(i2>>8), - uint8(i2)) -} - -func zSIY(op, i2, b1, d1 uint32, asm *[]byte) { - dl1 := uint16(d1) & 0x0FFF - *asm = append(*asm, - uint8(op>>8), - uint8(i2), - (uint8(b1)<<4)|(uint8(dl1>>8)&0x0F), - uint8(dl1), - uint8(d1>>12), - uint8(op)) -} - -func zSMI(op, m1, b3, d3, ri2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(m1)<<4, - (uint8(b3)<<4)|uint8((d3>>8)&0x0F), - uint8(d3), - uint8(ri2>>8), - uint8(ri2)) -} - -// Expected argument values for the instruction formats. -// -// Format a1 a2 a3 a4 a5 a6 -// ------------------------------- -// a l1, 0, b1, d1, b2, d2 -// b l1, l2, b1, d1, b2, d2 -// c l1, i3, b1, d1, b2, d2 -// d r1, r3, b1, d1, b2, d2 -// e r1, r3, b2, d2, b4, d4 -// f 0, l2, b1, d1, b2, d2 -func zSS(f form, op, l1_r1, l2_i3_r3, b1_b2, d1_d2, b2_b4, d2_d4 uint32, asm *[]byte) { - *asm = append(*asm, uint8(op>>8)) - - switch f { - case _a: - *asm = append(*asm, uint8(l1_r1)) - case _b, _c, _d, _e: - *asm = append(*asm, (uint8(l1_r1)<<4)|uint8(l2_i3_r3&0x0F)) - case _f: - *asm = append(*asm, uint8(l2_i3_r3)) - } - - *asm = append(*asm, - (uint8(b1_b2)<<4)|uint8((d1_d2>>8)&0x0F), - uint8(d1_d2), - (uint8(b2_b4)<<4)|uint8((d2_d4>>8)&0x0F), - uint8(d2_d4)) -} - -func zSSE(op, b1, d1, b2, d2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(op), - (uint8(b1)<<4)|uint8((d1>>8)&0x0F), - uint8(d1), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2)) -} - -func zSSF(op, r3, b1, d1, b2, d2 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(r3)<<4)|(uint8(op)&0x0F), - (uint8(b1)<<4)|uint8((d1>>8)&0x0F), - uint8(d1), - (uint8(b2)<<4)|uint8((d2>>8)&0x0F), - uint8(d2)) -} - -func rxb(va, vb, vc, vd uint32) uint8 { - mask := uint8(0) - if va >= REG_V16 && va <= REG_V31 { - mask |= 0x8 - } - if vb >= REG_V16 && vb <= REG_V31 { - mask |= 0x4 - } - if vc >= REG_V16 && vc <= REG_V31 { - mask |= 0x2 - } - if vd >= REG_V16 && vd <= REG_V31 { - mask |= 0x1 - } - return mask -} - -func zVRX(op, v1, x2, b2, d2, m3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(x2)&0xf), - (uint8(b2)<<4)|(uint8(d2>>8)&0xf), - uint8(d2), - (uint8(m3)<<4)|rxb(v1, 0, 0, 0), - uint8(op)) -} - -func zVRV(op, v1, v2, b2, d2, m3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - (uint8(b2)<<4)|(uint8(d2>>8)&0xf), - uint8(d2), - (uint8(m3)<<4)|rxb(v1, v2, 0, 0), - uint8(op)) -} - -func zVRS(op, v1, v3_r3, b2, d2, m4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v3_r3)&0xf), - (uint8(b2)<<4)|(uint8(d2>>8)&0xf), - uint8(d2), - (uint8(m4)<<4)|rxb(v1, v3_r3, 0, 0), - uint8(op)) -} - -func zVRRa(op, v1, v2, m5, m4, m3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - 0, - (uint8(m5)<<4)|(uint8(m4)&0xf), - (uint8(m3)<<4)|rxb(v1, v2, 0, 0), - uint8(op)) -} - -func zVRRb(op, v1, v2, v3, m5, m4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - uint8(v3)<<4, - uint8(m5)<<4, - (uint8(m4)<<4)|rxb(v1, v2, v3, 0), - uint8(op)) -} - -func zVRRc(op, v1, v2, v3, m6, m5, m4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - uint8(v3)<<4, - (uint8(m6)<<4)|(uint8(m5)&0xf), - (uint8(m4)<<4)|rxb(v1, v2, v3, 0), - uint8(op)) -} - -func zVRRd(op, v1, v2, v3, m5, m6, v4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - (uint8(v3)<<4)|(uint8(m5)&0xf), - uint8(m6)<<4, - (uint8(v4)<<4)|rxb(v1, v2, v3, v4), - uint8(op)) -} - -func zVRRe(op, v1, v2, v3, m6, m5, v4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - (uint8(v3)<<4)|(uint8(m6)&0xf), - uint8(m5), - (uint8(v4)<<4)|rxb(v1, v2, v3, v4), - uint8(op)) -} - -func zVRRf(op, v1, r2, r3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(r2)&0xf), - uint8(r3)<<4, - 0, - rxb(v1, 0, 0, 0), - uint8(op)) -} - -func zVRIa(op, v1, i2, m3 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(v1)<<4, - uint8(i2>>8), - uint8(i2), - (uint8(m3)<<4)|rxb(v1, 0, 0, 0), - uint8(op)) -} - -func zVRIb(op, v1, i2, i3, m4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - uint8(v1)<<4, - uint8(i2), - uint8(i3), - (uint8(m4)<<4)|rxb(v1, 0, 0, 0), - uint8(op)) -} - -func zVRIc(op, v1, v3, i2, m4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v3)&0xf), - uint8(i2>>8), - uint8(i2), - (uint8(m4)<<4)|rxb(v1, v3, 0, 0), - uint8(op)) -} - -func zVRId(op, v1, v2, v3, i4, m5 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - uint8(v3)<<4, - uint8(i4), - (uint8(m5)<<4)|rxb(v1, v2, v3, 0), - uint8(op)) -} - -func zVRIe(op, v1, v2, i3, m5, m4 uint32, asm *[]byte) { - *asm = append(*asm, - uint8(op>>8), - (uint8(v1)<<4)|(uint8(v2)&0xf), - uint8(i3>>4), - (uint8(i3)<<4)|(uint8(m5)&0xf), - (uint8(m4)<<4)|rxb(v1, v2, 0, 0), - uint8(op)) -} diff --git a/vendor/github.com/google/gops/internal/obj/s390x/listz.go b/vendor/github.com/google/gops/internal/obj/s390x/listz.go deleted file mode 100644 index 468b8588..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/listz.go +++ /dev/null @@ -1,74 +0,0 @@ -// Based on cmd/internal/obj/ppc64/list9.go. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package s390x - -import ( - "fmt" - - "github.com/google/gops/internal/obj" -) - -func init() { - obj.RegisterRegister(obj.RBaseS390X, REG_R0+1024, Rconv) - obj.RegisterOpcode(obj.ABaseS390X, Anames) -} - -func Rconv(r int) string { - if r == 0 { - return "NONE" - } - if r == REGG { - // Special case. - return "g" - } - if REG_R0 <= r && r <= REG_R15 { - return fmt.Sprintf("R%d", r-REG_R0) - } - if REG_F0 <= r && r <= REG_F15 { - return fmt.Sprintf("F%d", r-REG_F0) - } - if REG_AR0 <= r && r <= REG_AR15 { - return fmt.Sprintf("AR%d", r-REG_AR0) - } - if REG_V0 <= r && r <= REG_V31 { - return fmt.Sprintf("V%d", r-REG_V0) - } - return fmt.Sprintf("Rgok(%d)", r-obj.RBaseS390X) -} - -func DRconv(a int) string { - s := "C_??" - if a >= C_NONE && a <= C_NCLASS { - s = cnamesz[a] - } - var fp string - fp += s - return fp -} diff --git a/vendor/github.com/google/gops/internal/obj/s390x/objz.go b/vendor/github.com/google/gops/internal/obj/s390x/objz.go deleted file mode 100644 index bbf4c35c..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/objz.go +++ /dev/null @@ -1,1029 +0,0 @@ -// Based on cmd/internal/obj/ppc64/obj9.go. -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package s390x - -import ( - "fmt" - "math" - - "github.com/google/gops/internal/obj" - "github.com/google/gops/internal/sys" -) - -func progedit(ctxt *obj.Link, p *obj.Prog) { - p.From.Class = 0 - p.To.Class = 0 - - // Rewrite BR/BL to symbol as TYPE_BRANCH. - switch p.As { - case ABR, - ABL, - obj.ARET, - obj.ADUFFZERO, - obj.ADUFFCOPY: - if p.To.Sym != nil { - p.To.Type = obj.TYPE_BRANCH - } - } - - // Rewrite float constants to values stored in memory unless they are +0. - switch p.As { - case AFMOVS: - if p.From.Type == obj.TYPE_FCONST { - f32 := float32(p.From.Val.(float64)) - i32 := math.Float32bits(f32) - if i32 == 0 { // +0 - break - } - literal := fmt.Sprintf("$f32.%08x", i32) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 4 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - case AFMOVD: - if p.From.Type == obj.TYPE_FCONST { - i64 := math.Float64bits(p.From.Val.(float64)) - if i64 == 0 { // +0 - break - } - literal := fmt.Sprintf("$f64.%016x", i64) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - - // put constants not loadable by LOAD IMMEDIATE into memory - case AMOVD: - if p.From.Type == obj.TYPE_CONST { - val := p.From.Offset - if int64(int32(val)) != val && - int64(uint32(val)) != val && - int64(uint64(val)&(0xffffffff<<32)) != val { - literal := fmt.Sprintf("$i64.%016x", uint64(p.From.Offset)) - s := obj.Linklookup(ctxt, literal, 0) - s.Size = 8 - p.From.Type = obj.TYPE_MEM - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Name = obj.NAME_EXTERN - p.From.Offset = 0 - } - } - } - - // Rewrite SUB constants into ADD. - switch p.As { - case ASUBC: - if p.From.Type == obj.TYPE_CONST && isint32(-p.From.Offset) { - p.From.Offset = -p.From.Offset - p.As = AADDC - } - - case ASUB: - if p.From.Type == obj.TYPE_CONST && isint32(-p.From.Offset) { - p.From.Offset = -p.From.Offset - p.As = AADD - } - } - - if ctxt.Flag_dynlink { - rewriteToUseGot(ctxt, p) - } -} - -// Rewrite p, if necessary, to access global data via the global offset table. -func rewriteToUseGot(ctxt *obj.Link, p *obj.Prog) { - // At the moment EXRL instructions are not emitted by the compiler and only reference local symbols in - // assembly code. - if p.As == AEXRL { - return - } - - // We only care about global data: NAME_EXTERN means a global - // symbol in the Go sense, and p.Sym.Local is true for a few - // internally defined symbols. - if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - // MOVD $sym, Rx becomes MOVD sym@GOT, Rx - // MOVD $sym+, Rx becomes MOVD sym@GOT, Rx; ADD , Rx - if p.To.Type != obj.TYPE_REG || p.As != AMOVD { - ctxt.Diag("do not know how to handle LEA-type insn to non-register in %v with -dynlink", p) - } - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - q := p - if p.From.Offset != 0 { - q = obj.Appendp(ctxt, p) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = p.From.Offset - q.To = p.To - p.From.Offset = 0 - } - } - if p.From3 != nil && p.From3.Name == obj.NAME_EXTERN { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - var source *obj.Addr - // MOVD sym, Ry becomes MOVD sym@GOT, REGTMP; MOVD (REGTMP), Ry - // MOVD Ry, sym becomes MOVD sym@GOT, REGTMP; MOVD Ry, (REGTMP) - // An addition may be inserted between the two MOVs if there is an offset. - if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p) - } - source = &p.From - } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - source = &p.To - } else { - return - } - if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { - return - } - if source.Sym.Type == obj.STLSBSS { - return - } - if source.Type != obj.TYPE_MEM { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - p1 := obj.Appendp(ctxt, p) - p2 := obj.Appendp(ctxt, p1) - - p1.As = AMOVD - p1.From.Type = obj.TYPE_MEM - p1.From.Sym = source.Sym - p1.From.Name = obj.NAME_GOTREF - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REGTMP - - p2.As = p.As - p2.From = p.From - p2.To = p.To - if p.From.Name == obj.NAME_EXTERN { - p2.From.Reg = REGTMP - p2.From.Name = obj.NAME_NONE - p2.From.Sym = nil - } else if p.To.Name == obj.NAME_EXTERN { - p2.To.Reg = REGTMP - p2.To.Name = obj.NAME_NONE - p2.To.Sym = nil - } else { - return - } - obj.Nopout(p) -} - -func preprocess(ctxt *obj.Link, cursym *obj.LSym) { - // TODO(minux): add morestack short-cuts with small fixed frame-size. - ctxt.Cursym = cursym - - if cursym.Text == nil || cursym.Text.Link == nil { - return - } - - p := cursym.Text - textstksiz := p.To.Offset - if textstksiz == -8 { - // Compatibility hack. - p.From3.Offset |= obj.NOFRAME - textstksiz = 0 - } - if textstksiz%8 != 0 { - ctxt.Diag("frame size %d not a multiple of 8", textstksiz) - } - if p.From3.Offset&obj.NOFRAME != 0 { - if textstksiz != 0 { - ctxt.Diag("NOFRAME functions must have a frame size of 0, not %d", textstksiz) - } - } - - cursym.Args = p.To.Val.(int32) - cursym.Locals = int32(textstksiz) - - /* - * find leaf subroutines - * strip NOPs - * expand RET - * expand BECOME pseudo - */ - if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f noops\n", obj.Cputime()) - } - - var q *obj.Prog - var q1 *obj.Prog - for p := cursym.Text; p != nil; p = p.Link { - switch p.As { - /* too hard, just leave alone */ - case obj.ATEXT: - q = p - - p.Mark |= LABEL | LEAF | SYNC - if p.Link != nil { - p.Link.Mark |= LABEL - } - - case ASYNC, - AWORD: - q = p - p.Mark |= LABEL | SYNC - continue - - case AMOVW, AMOVWZ, AMOVD: - q = p - if p.From.Reg >= REG_RESERVED || p.To.Reg >= REG_RESERVED { - p.Mark |= LABEL | SYNC - } - continue - - case AFABS, - AFADD, - AFDIV, - AFMADD, - AFMOVD, - AFMOVS, - AFMSUB, - AFMUL, - AFNABS, - AFNEG, - AFNMADD, - AFNMSUB, - ALEDBR, - ALDEBR, - AFSUB: - q = p - - p.Mark |= FLOAT - continue - - case ABL, - ABCL, - obj.ADUFFZERO, - obj.ADUFFCOPY: - cursym.Text.Mark &^= LEAF - fallthrough - - case ABC, - ABEQ, - ABGE, - ABGT, - ABLE, - ABLT, - ABLEU, - ABLTU, - ABNE, - ABR, - ABVC, - ABVS, - ACMPBEQ, - ACMPBGE, - ACMPBGT, - ACMPBLE, - ACMPBLT, - ACMPBNE, - ACMPUBEQ, - ACMPUBGE, - ACMPUBGT, - ACMPUBLE, - ACMPUBLT, - ACMPUBNE: - p.Mark |= BRANCH - q = p - q1 = p.Pcond - if q1 != nil { - for q1.As == obj.ANOP { - q1 = q1.Link - p.Pcond = q1 - } - - if q1.Mark&LEAF == 0 { - q1.Mark |= LABEL - } - } else { - p.Mark |= LABEL - } - q1 = p.Link - if q1 != nil { - q1.Mark |= LABEL - } - continue - - case AFCMPO, AFCMPU: - q = p - p.Mark |= FCMP | FLOAT - continue - - case obj.ARET: - q = p - if p.Link != nil { - p.Link.Mark |= LABEL - } - continue - - case obj.ANOP: - q1 = p.Link - q.Link = q1 /* q is non-nop */ - q1.Mark |= p.Mark - continue - - default: - q = p - continue - } - } - - autosize := int32(0) - var p1 *obj.Prog - var p2 *obj.Prog - var pLast *obj.Prog - var pPre *obj.Prog - var pPreempt *obj.Prog - wasSplit := false - for p := cursym.Text; p != nil; p = p.Link { - pLast = p - switch p.As { - case obj.ATEXT: - autosize = int32(textstksiz) - - if p.Mark&LEAF != 0 && autosize == 0 { - // A leaf function with no locals has no frame. - p.From3.Offset |= obj.NOFRAME - } - - if p.From3.Offset&obj.NOFRAME == 0 { - // If there is a stack frame at all, it includes - // space to save the LR. - autosize += int32(ctxt.FixedFrameSize()) - } - - if p.Mark&LEAF != 0 && autosize < obj.StackSmall { - // A leaf function with a small stack can be marked - // NOSPLIT, avoiding a stack check. - p.From3.Offset |= obj.NOSPLIT - } - - p.To.Offset = int64(autosize) - - q = p - - if p.From3.Offset&obj.NOSPLIT == 0 { - p, pPreempt = stacksplitPre(ctxt, p, autosize) // emit pre part of split check - pPre = p - wasSplit = true //need post part of split - } - - if autosize != 0 { - // Make sure to save link register for non-empty frame, even if - // it is a leaf function, so that traceback works. - // Store link register before decrementing SP, so if a signal comes - // during the execution of the function prologue, the traceback - // code will not see a half-updated stack frame. - q = obj.Appendp(ctxt, p) - q.As = AMOVD - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_LR - q.To.Type = obj.TYPE_MEM - q.To.Reg = REGSP - q.To.Offset = int64(-autosize) - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_ADDR - q.From.Offset = int64(-autosize) - q.From.Reg = REGSP // not actually needed - REGSP is assumed if no reg is provided - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Spadj = autosize - } else if cursym.Text.Mark&LEAF == 0 { - // A very few functions that do not return to their caller - // (e.g. gogo) are not identified as leaves but still have - // no frame. - cursym.Text.Mark |= LEAF - } - - if cursym.Text.Mark&LEAF != 0 { - cursym.Set(obj.AttrLeaf, true) - break - } - - if cursym.Text.From3.Offset&obj.WRAPPER != 0 { - // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame - // - // MOVD g_panic(g), R3 - // CMP R3, $0 - // BEQ end - // MOVD panic_argp(R3), R4 - // ADD $(autosize+8), R1, R5 - // CMP R4, R5 - // BNE end - // ADD $8, R1, R6 - // MOVD R6, panic_argp(R3) - // end: - // NOP - // - // The NOP is needed to give the jumps somewhere to land. - // It is a liblink NOP, not a s390x NOP: it encodes to 0 instruction bytes. - - q = obj.Appendp(ctxt, q) - - q.As = AMOVD - q.From.Type = obj.TYPE_MEM - q.From.Reg = REGG - q.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R3 - - q = obj.Appendp(ctxt, q) - q.As = ACMP - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R3 - q.To.Type = obj.TYPE_CONST - q.To.Offset = 0 - - q = obj.Appendp(ctxt, q) - q.As = ABEQ - q.To.Type = obj.TYPE_BRANCH - p1 = q - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_MEM - q.From.Reg = REG_R3 - q.From.Offset = 0 // Panic.argp - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R4 - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(autosize) + ctxt.FixedFrameSize() - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R5 - - q = obj.Appendp(ctxt, q) - q.As = ACMP - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R4 - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R5 - - q = obj.Appendp(ctxt, q) - q.As = ABNE - q.To.Type = obj.TYPE_BRANCH - p2 = q - - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = ctxt.FixedFrameSize() - q.Reg = REGSP - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R6 - - q = obj.Appendp(ctxt, q) - q.As = AMOVD - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R6 - q.To.Type = obj.TYPE_MEM - q.To.Reg = REG_R3 - q.To.Offset = 0 // Panic.argp - - q = obj.Appendp(ctxt, q) - - q.As = obj.ANOP - p1.Pcond = q - p2.Pcond = q - } - - case obj.ARET: - if p.From.Type == obj.TYPE_CONST { - ctxt.Diag("using BECOME (%v) is not supported!", p) - break - } - - retTarget := p.To.Sym - - if cursym.Text.Mark&LEAF != 0 { - if autosize == 0 { - p.As = ABR - p.From = obj.Addr{} - if retTarget == nil { - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_LR - } else { - p.To.Type = obj.TYPE_BRANCH - p.To.Sym = retTarget - } - p.Mark |= BRANCH - break - } - - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(autosize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REGSP - p.Spadj = -autosize - - q = obj.Appendp(ctxt, p) - q.As = ABR - q.From = obj.Addr{} - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_LR - q.Mark |= BRANCH - q.Spadj = autosize - break - } - - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGSP - p.From.Offset = 0 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_LR - - q = p - - if autosize != 0 { - q = obj.Appendp(ctxt, q) - q.As = AADD - q.From.Type = obj.TYPE_CONST - q.From.Offset = int64(autosize) - q.To.Type = obj.TYPE_REG - q.To.Reg = REGSP - q.Spadj = -autosize - } - - q = obj.Appendp(ctxt, q) - q.As = ABR - q.From = obj.Addr{} - if retTarget == nil { - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_LR - } else { - q.To.Type = obj.TYPE_BRANCH - q.To.Sym = retTarget - } - q.Mark |= BRANCH - q.Spadj = autosize - - case AADD: - if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { - p.Spadj = int32(-p.From.Offset) - } - } - } - if wasSplit { - pLast = stacksplitPost(ctxt, pLast, pPre, pPreempt, autosize) // emit post part of split check - } -} - -/* -// instruction scheduling - if(debug['Q'] == 0) - return; - - curtext = nil; - q = nil; // p - 1 - q1 = firstp; // top of block - o = 0; // count of instructions - for(p = firstp; p != nil; p = p1) { - p1 = p->link; - o++; - if(p->mark & NOSCHED){ - if(q1 != p){ - sched(q1, q); - } - for(; p != nil; p = p->link){ - if(!(p->mark & NOSCHED)) - break; - q = p; - } - p1 = p; - q1 = p; - o = 0; - continue; - } - if(p->mark & (LABEL|SYNC)) { - if(q1 != p) - sched(q1, q); - q1 = p; - o = 1; - } - if(p->mark & (BRANCH|SYNC)) { - sched(q1, p); - q1 = p1; - o = 0; - } - if(o >= NSCHED) { - sched(q1, p); - q1 = p1; - o = 0; - } - q = p; - } -*/ -func stacksplitPre(ctxt *obj.Link, p *obj.Prog, framesize int32) (*obj.Prog, *obj.Prog) { - var q *obj.Prog - - // MOVD g_stackguard(g), R3 - p = obj.Appendp(ctxt, p) - - p.As = AMOVD - p.From.Type = obj.TYPE_MEM - p.From.Reg = REGG - p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R3 - - q = nil - if framesize <= obj.StackSmall { - // small stack: SP < stackguard - // CMP stackguard, SP - - //p.To.Type = obj.TYPE_REG - //p.To.Reg = REGSP - - // q1: BLT done - - p = obj.Appendp(ctxt, p) - //q1 = p - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.Reg = REGSP - p.As = ACMPUBGE - p.To.Type = obj.TYPE_BRANCH - //p = obj.Appendp(ctxt, p) - - //p.As = ACMPU - //p.From.Type = obj.TYPE_REG - //p.From.Reg = REG_R3 - //p.To.Type = obj.TYPE_REG - //p.To.Reg = REGSP - - //p = obj.Appendp(ctxt, p) - //p.As = ABGE - //p.To.Type = obj.TYPE_BRANCH - - } else if framesize <= obj.StackBig { - // large stack: SP-framesize < stackguard-StackSmall - // ADD $-framesize, SP, R4 - // CMP stackguard, R4 - p = obj.Appendp(ctxt, p) - - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(-framesize) - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.Reg = REG_R4 - p.As = ACMPUBGE - p.To.Type = obj.TYPE_BRANCH - - } else { - // Such a large stack we need to protect against wraparound. - // If SP is close to zero: - // SP-stackguard+StackGuard <= framesize + (StackGuard-StackSmall) - // The +StackGuard on both sides is required to keep the left side positive: - // SP is allowed to be slightly below stackguard. See stack.h. - // - // Preemption sets stackguard to StackPreempt, a very large value. - // That breaks the math above, so we have to check for that explicitly. - // // stackguard is R3 - // CMP R3, $StackPreempt - // BEQ label-of-call-to-morestack - // ADD $StackGuard, SP, R4 - // SUB R3, R4 - // MOVD $(framesize+(StackGuard-StackSmall)), TEMP - // CMPUBGE TEMP, R4 - p = obj.Appendp(ctxt, p) - - p.As = ACMP - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.To.Type = obj.TYPE_CONST - p.To.Offset = obj.StackPreempt - - p = obj.Appendp(ctxt, p) - q = p - p.As = ABEQ - p.To.Type = obj.TYPE_BRANCH - - p = obj.Appendp(ctxt, p) - p.As = AADD - p.From.Type = obj.TYPE_CONST - p.From.Offset = obj.StackGuard - p.Reg = REGSP - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.As = ASUB - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_R3 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R4 - - p = obj.Appendp(ctxt, p) - p.As = AMOVD - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + obj.StackGuard - obj.StackSmall - p.To.Type = obj.TYPE_REG - p.To.Reg = REGTMP - - p = obj.Appendp(ctxt, p) - p.From.Type = obj.TYPE_REG - p.From.Reg = REGTMP - p.Reg = REG_R4 - p.As = ACMPUBGE - p.To.Type = obj.TYPE_BRANCH - } - - return p, q -} - -func stacksplitPost(ctxt *obj.Link, p *obj.Prog, pPre *obj.Prog, pPreempt *obj.Prog, framesize int32) *obj.Prog { - // Now we are at the end of the function, but logically - // we are still in function prologue. We need to fix the - // SP data and PCDATA. - spfix := obj.Appendp(ctxt, p) - spfix.As = obj.ANOP - spfix.Spadj = -framesize - - pcdata := obj.Appendp(ctxt, spfix) - pcdata.Lineno = ctxt.Cursym.Text.Lineno - pcdata.Mode = ctxt.Cursym.Text.Mode - pcdata.As = obj.APCDATA - pcdata.From.Type = obj.TYPE_CONST - pcdata.From.Offset = obj.PCDATA_StackMapIndex - pcdata.To.Type = obj.TYPE_CONST - pcdata.To.Offset = -1 // pcdata starts at -1 at function entry - - // MOVD LR, R5 - p = obj.Appendp(ctxt, pcdata) - pPre.Pcond = p - p.As = AMOVD - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_LR - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_R5 - if pPreempt != nil { - pPreempt.Pcond = p - } - - // BL runtime.morestack(SB) - p = obj.Appendp(ctxt, p) - - p.As = ABL - p.To.Type = obj.TYPE_BRANCH - if ctxt.Cursym.CFunc() { - p.To.Sym = obj.Linklookup(ctxt, "runtime.morestackc", 0) - } else if ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0 { - p.To.Sym = obj.Linklookup(ctxt, "runtime.morestack_noctxt", 0) - } else { - p.To.Sym = obj.Linklookup(ctxt, "runtime.morestack", 0) - } - - // BR start - p = obj.Appendp(ctxt, p) - - p.As = ABR - p.To.Type = obj.TYPE_BRANCH - p.Pcond = ctxt.Cursym.Text.Link - return p -} - -var pc_cnt int64 - -func follow(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - pc_cnt = 0 - firstp := ctxt.NewProg() - lastp := firstp - xfol(ctxt, s.Text, &lastp) - lastp.Link = nil - s.Text = firstp.Link -} - -func relinv(a obj.As) obj.As { - switch a { - case ABEQ: - return ABNE - case ABNE: - return ABEQ - - case ABGE: - return ABLT - case ABLT: - return ABGE - - case ABGT: - return ABLE - case ABLE: - return ABGT - - case ABVC: - return ABVS - case ABVS: - return ABVC - } - - return 0 -} - -func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { - var q *obj.Prog - var r *obj.Prog - var b obj.As - - for p != nil { - a := p.As - if a == ABR { - q = p.Pcond - if (p.Mark&NOSCHED != 0) || q != nil && (q.Mark&NOSCHED != 0) { - p.Mark |= FOLL - (*last).Link = p - *last = p - (*last).Pc = pc_cnt - pc_cnt += 1 - p = p.Link - xfol(ctxt, p, last) - p = q - if p != nil && p.Mark&FOLL == 0 { - continue - } - return - } - - if q != nil { - p.Mark |= FOLL - p = q - if p.Mark&FOLL == 0 { - continue - } - } - } - - if p.Mark&FOLL != 0 { - q = p - for i := 0; i < 4; i, q = i+1, q.Link { - if q == *last || (q.Mark&NOSCHED != 0) { - break - } - b = 0 /* set */ - a = q.As - if a == obj.ANOP { - i-- - continue - } - if a != ABR && a != obj.ARET { - if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { - continue - } - b = relinv(a) - if b == 0 { - continue - } - } - - for { - r = ctxt.NewProg() - *r = *p - if r.Mark&FOLL == 0 { - fmt.Printf("can't happen 1\n") - } - r.Mark |= FOLL - if p != q { - p = p.Link - (*last).Link = r - *last = r - (*last).Pc = pc_cnt - pc_cnt += 1 - continue - } - - (*last).Link = r - *last = r - (*last).Pc = pc_cnt - pc_cnt += 1 - if a == ABR || a == obj.ARET { - return - } - r.As = b - r.Pcond = p.Link - r.Link = p.Pcond - if r.Link.Mark&FOLL == 0 { - xfol(ctxt, r.Link, last) - } - if r.Pcond.Mark&FOLL == 0 { - fmt.Printf("can't happen 2\n") - } - return - } - } - - a = ABR - q = ctxt.NewProg() - q.As = a - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.To.Offset = p.Pc - q.Pcond = p - p = q - } - - p.Mark |= FOLL - (*last).Link = p - *last = p - (*last).Pc = pc_cnt - pc_cnt += 1 - - if a == ABR || a == obj.ARET { - if p.Mark&NOSCHED != 0 { - p = p.Link - continue - } - - return - } - - if p.Pcond != nil { - if a != ABL && p.Link != nil { - xfol(ctxt, p.Link, last) - p = p.Pcond - if p == nil || (p.Mark&FOLL != 0) { - return - } - continue - } - } - - p = p.Link - } -} - -var unaryDst = map[obj.As]bool{ - ASTCK: true, - ASTCKC: true, - ASTCKE: true, - ASTCKF: true, - ANEG: true, - ANEGW: true, - AVONE: true, - AVZERO: true, -} - -var Links390x = obj.LinkArch{ - Arch: sys.ArchS390X, - Preprocess: preprocess, - Assemble: spanz, - Follow: follow, - Progedit: progedit, - UnaryDst: unaryDst, -} diff --git a/vendor/github.com/google/gops/internal/obj/s390x/vector.go b/vendor/github.com/google/gops/internal/obj/s390x/vector.go deleted file mode 100644 index 7aa62229..00000000 --- a/vendor/github.com/google/gops/internal/obj/s390x/vector.go +++ /dev/null @@ -1,1061 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package s390x - -import ( - "github.com/google/gops/internal/obj" -) - -// This file contains utility functions for use when -// assembling vector instructions. - -// vop returns the opcode, element size and condition -// setting for the given (possibly extended) mnemonic. -func vop(as obj.As) (opcode, es, cs uint32) { - switch as { - default: - return 0, 0, 0 - case AVA: - return op_VA, 0, 0 - case AVAB: - return op_VA, 0, 0 - case AVAH: - return op_VA, 1, 0 - case AVAF: - return op_VA, 2, 0 - case AVAG: - return op_VA, 3, 0 - case AVAQ: - return op_VA, 4, 0 - case AVACC: - return op_VACC, 0, 0 - case AVACCB: - return op_VACC, 0, 0 - case AVACCH: - return op_VACC, 1, 0 - case AVACCF: - return op_VACC, 2, 0 - case AVACCG: - return op_VACC, 3, 0 - case AVACCQ: - return op_VACC, 4, 0 - case AVAC: - return op_VAC, 0, 0 - case AVACQ: - return op_VAC, 4, 0 - case AVACCC: - return op_VACCC, 0, 0 - case AVACCCQ: - return op_VACCC, 4, 0 - case AVN: - return op_VN, 0, 0 - case AVNC: - return op_VNC, 0, 0 - case AVAVG: - return op_VAVG, 0, 0 - case AVAVGB: - return op_VAVG, 0, 0 - case AVAVGH: - return op_VAVG, 1, 0 - case AVAVGF: - return op_VAVG, 2, 0 - case AVAVGG: - return op_VAVG, 3, 0 - case AVAVGL: - return op_VAVGL, 0, 0 - case AVAVGLB: - return op_VAVGL, 0, 0 - case AVAVGLH: - return op_VAVGL, 1, 0 - case AVAVGLF: - return op_VAVGL, 2, 0 - case AVAVGLG: - return op_VAVGL, 3, 0 - case AVCKSM: - return op_VCKSM, 0, 0 - case AVCEQ: - return op_VCEQ, 0, 0 - case AVCEQB: - return op_VCEQ, 0, 0 - case AVCEQH: - return op_VCEQ, 1, 0 - case AVCEQF: - return op_VCEQ, 2, 0 - case AVCEQG: - return op_VCEQ, 3, 0 - case AVCEQBS: - return op_VCEQ, 0, 1 - case AVCEQHS: - return op_VCEQ, 1, 1 - case AVCEQFS: - return op_VCEQ, 2, 1 - case AVCEQGS: - return op_VCEQ, 3, 1 - case AVCH: - return op_VCH, 0, 0 - case AVCHB: - return op_VCH, 0, 0 - case AVCHH: - return op_VCH, 1, 0 - case AVCHF: - return op_VCH, 2, 0 - case AVCHG: - return op_VCH, 3, 0 - case AVCHBS: - return op_VCH, 0, 1 - case AVCHHS: - return op_VCH, 1, 1 - case AVCHFS: - return op_VCH, 2, 1 - case AVCHGS: - return op_VCH, 3, 1 - case AVCHL: - return op_VCHL, 0, 0 - case AVCHLB: - return op_VCHL, 0, 0 - case AVCHLH: - return op_VCHL, 1, 0 - case AVCHLF: - return op_VCHL, 2, 0 - case AVCHLG: - return op_VCHL, 3, 0 - case AVCHLBS: - return op_VCHL, 0, 1 - case AVCHLHS: - return op_VCHL, 1, 1 - case AVCHLFS: - return op_VCHL, 2, 1 - case AVCHLGS: - return op_VCHL, 3, 1 - case AVCLZ: - return op_VCLZ, 0, 0 - case AVCLZB: - return op_VCLZ, 0, 0 - case AVCLZH: - return op_VCLZ, 1, 0 - case AVCLZF: - return op_VCLZ, 2, 0 - case AVCLZG: - return op_VCLZ, 3, 0 - case AVCTZ: - return op_VCTZ, 0, 0 - case AVCTZB: - return op_VCTZ, 0, 0 - case AVCTZH: - return op_VCTZ, 1, 0 - case AVCTZF: - return op_VCTZ, 2, 0 - case AVCTZG: - return op_VCTZ, 3, 0 - case AVEC: - return op_VEC, 0, 0 - case AVECB: - return op_VEC, 0, 0 - case AVECH: - return op_VEC, 1, 0 - case AVECF: - return op_VEC, 2, 0 - case AVECG: - return op_VEC, 3, 0 - case AVECL: - return op_VECL, 0, 0 - case AVECLB: - return op_VECL, 0, 0 - case AVECLH: - return op_VECL, 1, 0 - case AVECLF: - return op_VECL, 2, 0 - case AVECLG: - return op_VECL, 3, 0 - case AVERIM: - return op_VERIM, 0, 0 - case AVERIMB: - return op_VERIM, 0, 0 - case AVERIMH: - return op_VERIM, 1, 0 - case AVERIMF: - return op_VERIM, 2, 0 - case AVERIMG: - return op_VERIM, 3, 0 - case AVERLL: - return op_VERLL, 0, 0 - case AVERLLB: - return op_VERLL, 0, 0 - case AVERLLH: - return op_VERLL, 1, 0 - case AVERLLF: - return op_VERLL, 2, 0 - case AVERLLG: - return op_VERLL, 3, 0 - case AVERLLV: - return op_VERLLV, 0, 0 - case AVERLLVB: - return op_VERLLV, 0, 0 - case AVERLLVH: - return op_VERLLV, 1, 0 - case AVERLLVF: - return op_VERLLV, 2, 0 - case AVERLLVG: - return op_VERLLV, 3, 0 - case AVESLV: - return op_VESLV, 0, 0 - case AVESLVB: - return op_VESLV, 0, 0 - case AVESLVH: - return op_VESLV, 1, 0 - case AVESLVF: - return op_VESLV, 2, 0 - case AVESLVG: - return op_VESLV, 3, 0 - case AVESL: - return op_VESL, 0, 0 - case AVESLB: - return op_VESL, 0, 0 - case AVESLH: - return op_VESL, 1, 0 - case AVESLF: - return op_VESL, 2, 0 - case AVESLG: - return op_VESL, 3, 0 - case AVESRA: - return op_VESRA, 0, 0 - case AVESRAB: - return op_VESRA, 0, 0 - case AVESRAH: - return op_VESRA, 1, 0 - case AVESRAF: - return op_VESRA, 2, 0 - case AVESRAG: - return op_VESRA, 3, 0 - case AVESRAV: - return op_VESRAV, 0, 0 - case AVESRAVB: - return op_VESRAV, 0, 0 - case AVESRAVH: - return op_VESRAV, 1, 0 - case AVESRAVF: - return op_VESRAV, 2, 0 - case AVESRAVG: - return op_VESRAV, 3, 0 - case AVESRL: - return op_VESRL, 0, 0 - case AVESRLB: - return op_VESRL, 0, 0 - case AVESRLH: - return op_VESRL, 1, 0 - case AVESRLF: - return op_VESRL, 2, 0 - case AVESRLG: - return op_VESRL, 3, 0 - case AVESRLV: - return op_VESRLV, 0, 0 - case AVESRLVB: - return op_VESRLV, 0, 0 - case AVESRLVH: - return op_VESRLV, 1, 0 - case AVESRLVF: - return op_VESRLV, 2, 0 - case AVESRLVG: - return op_VESRLV, 3, 0 - case AVX: - return op_VX, 0, 0 - case AVFAE: - return op_VFAE, 0, 0 - case AVFAEB: - return op_VFAE, 0, 0 - case AVFAEH: - return op_VFAE, 1, 0 - case AVFAEF: - return op_VFAE, 2, 0 - case AVFAEBS: - return op_VFAE, 0, 1 - case AVFAEHS: - return op_VFAE, 1, 1 - case AVFAEFS: - return op_VFAE, 2, 1 - case AVFAEZB: - return op_VFAE, 0, 2 - case AVFAEZH: - return op_VFAE, 1, 2 - case AVFAEZF: - return op_VFAE, 2, 2 - case AVFAEZBS: - return op_VFAE, 0, 3 - case AVFAEZHS: - return op_VFAE, 1, 3 - case AVFAEZFS: - return op_VFAE, 2, 3 - case AVFEE: - return op_VFEE, 0, 0 - case AVFEEB: - return op_VFEE, 0, 0 - case AVFEEH: - return op_VFEE, 1, 0 - case AVFEEF: - return op_VFEE, 2, 0 - case AVFEEBS: - return op_VFEE, 0, 1 - case AVFEEHS: - return op_VFEE, 1, 1 - case AVFEEFS: - return op_VFEE, 2, 1 - case AVFEEZB: - return op_VFEE, 0, 2 - case AVFEEZH: - return op_VFEE, 1, 2 - case AVFEEZF: - return op_VFEE, 2, 2 - case AVFEEZBS: - return op_VFEE, 0, 3 - case AVFEEZHS: - return op_VFEE, 1, 3 - case AVFEEZFS: - return op_VFEE, 2, 3 - case AVFENE: - return op_VFENE, 0, 0 - case AVFENEB: - return op_VFENE, 0, 0 - case AVFENEH: - return op_VFENE, 1, 0 - case AVFENEF: - return op_VFENE, 2, 0 - case AVFENEBS: - return op_VFENE, 0, 1 - case AVFENEHS: - return op_VFENE, 1, 1 - case AVFENEFS: - return op_VFENE, 2, 1 - case AVFENEZB: - return op_VFENE, 0, 2 - case AVFENEZH: - return op_VFENE, 1, 2 - case AVFENEZF: - return op_VFENE, 2, 2 - case AVFENEZBS: - return op_VFENE, 0, 3 - case AVFENEZHS: - return op_VFENE, 1, 3 - case AVFENEZFS: - return op_VFENE, 2, 3 - case AVFA: - return op_VFA, 0, 0 - case AVFADB: - return op_VFA, 3, 0 - case AWFADB: - return op_VFA, 3, 0 - case AWFK: - return op_WFK, 0, 0 - case AWFKDB: - return op_WFK, 3, 0 - case AVFCE: - return op_VFCE, 0, 0 - case AVFCEDB: - return op_VFCE, 3, 0 - case AVFCEDBS: - return op_VFCE, 3, 1 - case AWFCEDB: - return op_VFCE, 3, 0 - case AWFCEDBS: - return op_VFCE, 3, 1 - case AVFCH: - return op_VFCH, 0, 0 - case AVFCHDB: - return op_VFCH, 3, 0 - case AVFCHDBS: - return op_VFCH, 3, 1 - case AWFCHDB: - return op_VFCH, 3, 0 - case AWFCHDBS: - return op_VFCH, 3, 1 - case AVFCHE: - return op_VFCHE, 0, 0 - case AVFCHEDB: - return op_VFCHE, 3, 0 - case AVFCHEDBS: - return op_VFCHE, 3, 1 - case AWFCHEDB: - return op_VFCHE, 3, 0 - case AWFCHEDBS: - return op_VFCHE, 3, 1 - case AWFC: - return op_WFC, 0, 0 - case AWFCDB: - return op_WFC, 3, 0 - case AVCDG: - return op_VCDG, 0, 0 - case AVCDGB: - return op_VCDG, 3, 0 - case AWCDGB: - return op_VCDG, 3, 0 - case AVCDLG: - return op_VCDLG, 0, 0 - case AVCDLGB: - return op_VCDLG, 3, 0 - case AWCDLGB: - return op_VCDLG, 3, 0 - case AVCGD: - return op_VCGD, 0, 0 - case AVCGDB: - return op_VCGD, 3, 0 - case AWCGDB: - return op_VCGD, 3, 0 - case AVCLGD: - return op_VCLGD, 0, 0 - case AVCLGDB: - return op_VCLGD, 3, 0 - case AWCLGDB: - return op_VCLGD, 3, 0 - case AVFD: - return op_VFD, 0, 0 - case AVFDDB: - return op_VFD, 3, 0 - case AWFDDB: - return op_VFD, 3, 0 - case AVLDE: - return op_VLDE, 0, 0 - case AVLDEB: - return op_VLDE, 2, 0 - case AWLDEB: - return op_VLDE, 2, 0 - case AVLED: - return op_VLED, 0, 0 - case AVLEDB: - return op_VLED, 3, 0 - case AWLEDB: - return op_VLED, 3, 0 - case AVFM: - return op_VFM, 0, 0 - case AVFMDB: - return op_VFM, 3, 0 - case AWFMDB: - return op_VFM, 3, 0 - case AVFMA: - return op_VFMA, 0, 0 - case AVFMADB: - return op_VFMA, 3, 0 - case AWFMADB: - return op_VFMA, 3, 0 - case AVFMS: - return op_VFMS, 0, 0 - case AVFMSDB: - return op_VFMS, 3, 0 - case AWFMSDB: - return op_VFMS, 3, 0 - case AVFPSO: - return op_VFPSO, 0, 0 - case AVFPSODB: - return op_VFPSO, 3, 0 - case AWFPSODB: - return op_VFPSO, 3, 0 - case AVFLCDB: - return op_VFPSO, 3, 0 - case AWFLCDB: - return op_VFPSO, 3, 0 - case AVFLNDB: - return op_VFPSO, 3, 1 - case AWFLNDB: - return op_VFPSO, 3, 1 - case AVFLPDB: - return op_VFPSO, 3, 2 - case AWFLPDB: - return op_VFPSO, 3, 2 - case AVFSQ: - return op_VFSQ, 0, 0 - case AVFSQDB: - return op_VFSQ, 3, 0 - case AWFSQDB: - return op_VFSQ, 3, 0 - case AVFS: - return op_VFS, 0, 0 - case AVFSDB: - return op_VFS, 3, 0 - case AWFSDB: - return op_VFS, 3, 0 - case AVFTCI: - return op_VFTCI, 0, 0 - case AVFTCIDB: - return op_VFTCI, 3, 0 - case AWFTCIDB: - return op_VFTCI, 3, 0 - case AVGFM: - return op_VGFM, 0, 0 - case AVGFMB: - return op_VGFM, 0, 0 - case AVGFMH: - return op_VGFM, 1, 0 - case AVGFMF: - return op_VGFM, 2, 0 - case AVGFMG: - return op_VGFM, 3, 0 - case AVGFMA: - return op_VGFMA, 0, 0 - case AVGFMAB: - return op_VGFMA, 0, 0 - case AVGFMAH: - return op_VGFMA, 1, 0 - case AVGFMAF: - return op_VGFMA, 2, 0 - case AVGFMAG: - return op_VGFMA, 3, 0 - case AVGEF: - return op_VGEF, 0, 0 - case AVGEG: - return op_VGEG, 0, 0 - case AVGBM: - return op_VGBM, 0, 0 - case AVZERO: - return op_VGBM, 0, 0 - case AVONE: - return op_VGBM, 0, 0 - case AVGM: - return op_VGM, 0, 0 - case AVGMB: - return op_VGM, 0, 0 - case AVGMH: - return op_VGM, 1, 0 - case AVGMF: - return op_VGM, 2, 0 - case AVGMG: - return op_VGM, 3, 0 - case AVISTR: - return op_VISTR, 0, 0 - case AVISTRB: - return op_VISTR, 0, 0 - case AVISTRH: - return op_VISTR, 1, 0 - case AVISTRF: - return op_VISTR, 2, 0 - case AVISTRBS: - return op_VISTR, 0, 1 - case AVISTRHS: - return op_VISTR, 1, 1 - case AVISTRFS: - return op_VISTR, 2, 1 - case AVL: - return op_VL, 0, 0 - case AVLR: - return op_VLR, 0, 0 - case AVLREP: - return op_VLREP, 0, 0 - case AVLREPB: - return op_VLREP, 0, 0 - case AVLREPH: - return op_VLREP, 1, 0 - case AVLREPF: - return op_VLREP, 2, 0 - case AVLREPG: - return op_VLREP, 3, 0 - case AVLC: - return op_VLC, 0, 0 - case AVLCB: - return op_VLC, 0, 0 - case AVLCH: - return op_VLC, 1, 0 - case AVLCF: - return op_VLC, 2, 0 - case AVLCG: - return op_VLC, 3, 0 - case AVLEH: - return op_VLEH, 0, 0 - case AVLEF: - return op_VLEF, 0, 0 - case AVLEG: - return op_VLEG, 0, 0 - case AVLEB: - return op_VLEB, 0, 0 - case AVLEIH: - return op_VLEIH, 0, 0 - case AVLEIF: - return op_VLEIF, 0, 0 - case AVLEIG: - return op_VLEIG, 0, 0 - case AVLEIB: - return op_VLEIB, 0, 0 - case AVFI: - return op_VFI, 0, 0 - case AVFIDB: - return op_VFI, 3, 0 - case AWFIDB: - return op_VFI, 3, 0 - case AVLGV: - return op_VLGV, 0, 0 - case AVLGVB: - return op_VLGV, 0, 0 - case AVLGVH: - return op_VLGV, 1, 0 - case AVLGVF: - return op_VLGV, 2, 0 - case AVLGVG: - return op_VLGV, 3, 0 - case AVLLEZ: - return op_VLLEZ, 0, 0 - case AVLLEZB: - return op_VLLEZ, 0, 0 - case AVLLEZH: - return op_VLLEZ, 1, 0 - case AVLLEZF: - return op_VLLEZ, 2, 0 - case AVLLEZG: - return op_VLLEZ, 3, 0 - case AVLM: - return op_VLM, 0, 0 - case AVLP: - return op_VLP, 0, 0 - case AVLPB: - return op_VLP, 0, 0 - case AVLPH: - return op_VLP, 1, 0 - case AVLPF: - return op_VLP, 2, 0 - case AVLPG: - return op_VLP, 3, 0 - case AVLBB: - return op_VLBB, 0, 0 - case AVLVG: - return op_VLVG, 0, 0 - case AVLVGB: - return op_VLVG, 0, 0 - case AVLVGH: - return op_VLVG, 1, 0 - case AVLVGF: - return op_VLVG, 2, 0 - case AVLVGG: - return op_VLVG, 3, 0 - case AVLVGP: - return op_VLVGP, 0, 0 - case AVLL: - return op_VLL, 0, 0 - case AVMX: - return op_VMX, 0, 0 - case AVMXB: - return op_VMX, 0, 0 - case AVMXH: - return op_VMX, 1, 0 - case AVMXF: - return op_VMX, 2, 0 - case AVMXG: - return op_VMX, 3, 0 - case AVMXL: - return op_VMXL, 0, 0 - case AVMXLB: - return op_VMXL, 0, 0 - case AVMXLH: - return op_VMXL, 1, 0 - case AVMXLF: - return op_VMXL, 2, 0 - case AVMXLG: - return op_VMXL, 3, 0 - case AVMRH: - return op_VMRH, 0, 0 - case AVMRHB: - return op_VMRH, 0, 0 - case AVMRHH: - return op_VMRH, 1, 0 - case AVMRHF: - return op_VMRH, 2, 0 - case AVMRHG: - return op_VMRH, 3, 0 - case AVMRL: - return op_VMRL, 0, 0 - case AVMRLB: - return op_VMRL, 0, 0 - case AVMRLH: - return op_VMRL, 1, 0 - case AVMRLF: - return op_VMRL, 2, 0 - case AVMRLG: - return op_VMRL, 3, 0 - case AVMN: - return op_VMN, 0, 0 - case AVMNB: - return op_VMN, 0, 0 - case AVMNH: - return op_VMN, 1, 0 - case AVMNF: - return op_VMN, 2, 0 - case AVMNG: - return op_VMN, 3, 0 - case AVMNL: - return op_VMNL, 0, 0 - case AVMNLB: - return op_VMNL, 0, 0 - case AVMNLH: - return op_VMNL, 1, 0 - case AVMNLF: - return op_VMNL, 2, 0 - case AVMNLG: - return op_VMNL, 3, 0 - case AVMAE: - return op_VMAE, 0, 0 - case AVMAEB: - return op_VMAE, 0, 0 - case AVMAEH: - return op_VMAE, 1, 0 - case AVMAEF: - return op_VMAE, 2, 0 - case AVMAH: - return op_VMAH, 0, 0 - case AVMAHB: - return op_VMAH, 0, 0 - case AVMAHH: - return op_VMAH, 1, 0 - case AVMAHF: - return op_VMAH, 2, 0 - case AVMALE: - return op_VMALE, 0, 0 - case AVMALEB: - return op_VMALE, 0, 0 - case AVMALEH: - return op_VMALE, 1, 0 - case AVMALEF: - return op_VMALE, 2, 0 - case AVMALH: - return op_VMALH, 0, 0 - case AVMALHB: - return op_VMALH, 0, 0 - case AVMALHH: - return op_VMALH, 1, 0 - case AVMALHF: - return op_VMALH, 2, 0 - case AVMALO: - return op_VMALO, 0, 0 - case AVMALOB: - return op_VMALO, 0, 0 - case AVMALOH: - return op_VMALO, 1, 0 - case AVMALOF: - return op_VMALO, 2, 0 - case AVMAL: - return op_VMAL, 0, 0 - case AVMALB: - return op_VMAL, 0, 0 - case AVMALHW: - return op_VMAL, 1, 0 - case AVMALF: - return op_VMAL, 2, 0 - case AVMAO: - return op_VMAO, 0, 0 - case AVMAOB: - return op_VMAO, 0, 0 - case AVMAOH: - return op_VMAO, 1, 0 - case AVMAOF: - return op_VMAO, 2, 0 - case AVME: - return op_VME, 0, 0 - case AVMEB: - return op_VME, 0, 0 - case AVMEH: - return op_VME, 1, 0 - case AVMEF: - return op_VME, 2, 0 - case AVMH: - return op_VMH, 0, 0 - case AVMHB: - return op_VMH, 0, 0 - case AVMHH: - return op_VMH, 1, 0 - case AVMHF: - return op_VMH, 2, 0 - case AVMLE: - return op_VMLE, 0, 0 - case AVMLEB: - return op_VMLE, 0, 0 - case AVMLEH: - return op_VMLE, 1, 0 - case AVMLEF: - return op_VMLE, 2, 0 - case AVMLH: - return op_VMLH, 0, 0 - case AVMLHB: - return op_VMLH, 0, 0 - case AVMLHH: - return op_VMLH, 1, 0 - case AVMLHF: - return op_VMLH, 2, 0 - case AVMLO: - return op_VMLO, 0, 0 - case AVMLOB: - return op_VMLO, 0, 0 - case AVMLOH: - return op_VMLO, 1, 0 - case AVMLOF: - return op_VMLO, 2, 0 - case AVML: - return op_VML, 0, 0 - case AVMLB: - return op_VML, 0, 0 - case AVMLHW: - return op_VML, 1, 0 - case AVMLF: - return op_VML, 2, 0 - case AVMO: - return op_VMO, 0, 0 - case AVMOB: - return op_VMO, 0, 0 - case AVMOH: - return op_VMO, 1, 0 - case AVMOF: - return op_VMO, 2, 0 - case AVNO: - return op_VNO, 0, 0 - case AVNOT: - return op_VNO, 0, 0 - case AVO: - return op_VO, 0, 0 - case AVPK: - return op_VPK, 0, 0 - case AVPKH: - return op_VPK, 1, 0 - case AVPKF: - return op_VPK, 2, 0 - case AVPKG: - return op_VPK, 3, 0 - case AVPKLS: - return op_VPKLS, 0, 0 - case AVPKLSH: - return op_VPKLS, 1, 0 - case AVPKLSF: - return op_VPKLS, 2, 0 - case AVPKLSG: - return op_VPKLS, 3, 0 - case AVPKLSHS: - return op_VPKLS, 1, 1 - case AVPKLSFS: - return op_VPKLS, 2, 1 - case AVPKLSGS: - return op_VPKLS, 3, 1 - case AVPKS: - return op_VPKS, 0, 0 - case AVPKSH: - return op_VPKS, 1, 0 - case AVPKSF: - return op_VPKS, 2, 0 - case AVPKSG: - return op_VPKS, 3, 0 - case AVPKSHS: - return op_VPKS, 1, 1 - case AVPKSFS: - return op_VPKS, 2, 1 - case AVPKSGS: - return op_VPKS, 3, 1 - case AVPERM: - return op_VPERM, 0, 0 - case AVPDI: - return op_VPDI, 0, 0 - case AVPOPCT: - return op_VPOPCT, 0, 0 - case AVREP: - return op_VREP, 0, 0 - case AVREPB: - return op_VREP, 0, 0 - case AVREPH: - return op_VREP, 1, 0 - case AVREPF: - return op_VREP, 2, 0 - case AVREPG: - return op_VREP, 3, 0 - case AVREPI: - return op_VREPI, 0, 0 - case AVREPIB: - return op_VREPI, 0, 0 - case AVREPIH: - return op_VREPI, 1, 0 - case AVREPIF: - return op_VREPI, 2, 0 - case AVREPIG: - return op_VREPI, 3, 0 - case AVSCEF: - return op_VSCEF, 0, 0 - case AVSCEG: - return op_VSCEG, 0, 0 - case AVSEL: - return op_VSEL, 0, 0 - case AVSL: - return op_VSL, 0, 0 - case AVSLB: - return op_VSLB, 0, 0 - case AVSLDB: - return op_VSLDB, 0, 0 - case AVSRA: - return op_VSRA, 0, 0 - case AVSRAB: - return op_VSRAB, 0, 0 - case AVSRL: - return op_VSRL, 0, 0 - case AVSRLB: - return op_VSRLB, 0, 0 - case AVSEG: - return op_VSEG, 0, 0 - case AVSEGB: - return op_VSEG, 0, 0 - case AVSEGH: - return op_VSEG, 1, 0 - case AVSEGF: - return op_VSEG, 2, 0 - case AVST: - return op_VST, 0, 0 - case AVSTEH: - return op_VSTEH, 0, 0 - case AVSTEF: - return op_VSTEF, 0, 0 - case AVSTEG: - return op_VSTEG, 0, 0 - case AVSTEB: - return op_VSTEB, 0, 0 - case AVSTM: - return op_VSTM, 0, 0 - case AVSTL: - return op_VSTL, 0, 0 - case AVSTRC: - return op_VSTRC, 0, 0 - case AVSTRCB: - return op_VSTRC, 0, 0 - case AVSTRCH: - return op_VSTRC, 1, 0 - case AVSTRCF: - return op_VSTRC, 2, 0 - case AVSTRCBS: - return op_VSTRC, 0, 1 - case AVSTRCHS: - return op_VSTRC, 1, 1 - case AVSTRCFS: - return op_VSTRC, 2, 1 - case AVSTRCZB: - return op_VSTRC, 0, 2 - case AVSTRCZH: - return op_VSTRC, 1, 2 - case AVSTRCZF: - return op_VSTRC, 2, 2 - case AVSTRCZBS: - return op_VSTRC, 0, 3 - case AVSTRCZHS: - return op_VSTRC, 1, 3 - case AVSTRCZFS: - return op_VSTRC, 2, 3 - case AVS: - return op_VS, 0, 0 - case AVSB: - return op_VS, 0, 0 - case AVSH: - return op_VS, 1, 0 - case AVSF: - return op_VS, 2, 0 - case AVSG: - return op_VS, 3, 0 - case AVSQ: - return op_VS, 4, 0 - case AVSCBI: - return op_VSCBI, 0, 0 - case AVSCBIB: - return op_VSCBI, 0, 0 - case AVSCBIH: - return op_VSCBI, 1, 0 - case AVSCBIF: - return op_VSCBI, 2, 0 - case AVSCBIG: - return op_VSCBI, 3, 0 - case AVSCBIQ: - return op_VSCBI, 4, 0 - case AVSBCBI: - return op_VSBCBI, 0, 0 - case AVSBCBIQ: - return op_VSBCBI, 4, 0 - case AVSBI: - return op_VSBI, 0, 0 - case AVSBIQ: - return op_VSBI, 4, 0 - case AVSUMG: - return op_VSUMG, 0, 0 - case AVSUMGH: - return op_VSUMG, 1, 0 - case AVSUMGF: - return op_VSUMG, 2, 0 - case AVSUMQ: - return op_VSUMQ, 0, 0 - case AVSUMQF: - return op_VSUMQ, 1, 0 - case AVSUMQG: - return op_VSUMQ, 2, 0 - case AVSUM: - return op_VSUM, 0, 0 - case AVSUMB: - return op_VSUM, 0, 0 - case AVSUMH: - return op_VSUM, 1, 0 - case AVTM: - return op_VTM, 0, 0 - case AVUPH: - return op_VUPH, 0, 0 - case AVUPHB: - return op_VUPH, 0, 0 - case AVUPHH: - return op_VUPH, 1, 0 - case AVUPHF: - return op_VUPH, 2, 0 - case AVUPLH: - return op_VUPLH, 0, 0 - case AVUPLHB: - return op_VUPLH, 0, 0 - case AVUPLHH: - return op_VUPLH, 1, 0 - case AVUPLHF: - return op_VUPLH, 2, 0 - case AVUPLL: - return op_VUPLL, 0, 0 - case AVUPLLB: - return op_VUPLL, 0, 0 - case AVUPLLH: - return op_VUPLL, 1, 0 - case AVUPLLF: - return op_VUPLL, 2, 0 - case AVUPL: - return op_VUPL, 0, 0 - case AVUPLB: - return op_VUPL, 0, 0 - case AVUPLHW: - return op_VUPL, 1, 0 - case AVUPLF: - return op_VUPL, 2, 0 - } -} - -// singleElementMask returns the single element mask bits required for the -// given instruction. -func singleElementMask(as obj.As) uint32 { - switch as { - case AWFADB, - AWFK, - AWFKDB, - AWFCEDB, - AWFCEDBS, - AWFCHDB, - AWFCHDBS, - AWFCHEDB, - AWFCHEDBS, - AWFC, - AWFCDB, - AWCDGB, - AWCDLGB, - AWCGDB, - AWCLGDB, - AWFDDB, - AWLDEB, - AWLEDB, - AWFMDB, - AWFMADB, - AWFMSDB, - AWFPSODB, - AWFLCDB, - AWFLNDB, - AWFLPDB, - AWFSQDB, - AWFSDB, - AWFTCIDB, - AWFIDB: - return 8 - } - return 0 -} diff --git a/vendor/github.com/google/gops/internal/obj/stack.go b/vendor/github.com/google/gops/internal/obj/stack.go deleted file mode 100644 index 687adf20..00000000 --- a/vendor/github.com/google/gops/internal/obj/stack.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -// For the linkers. Must match Go definitions. -// TODO(rsc): Share Go definitions with linkers directly. - -const ( - STACKSYSTEM = 0 - StackSystem = STACKSYSTEM - StackBig = 4096 - StackGuard = 880*stackGuardMultiplier + StackSystem - StackSmall = 128 - StackLimit = StackGuard - StackSystem - StackSmall -) - -const ( - StackPreempt = -1314 // 0xfff...fade -) diff --git a/vendor/github.com/google/gops/internal/obj/stringer.go b/vendor/github.com/google/gops/internal/obj/stringer.go deleted file mode 100644 index 2ba213e5..00000000 --- a/vendor/github.com/google/gops/internal/obj/stringer.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This is a mini version of the stringer tool customized for the Anames table -// in the architecture support for obj. -// This version just generates the slice of strings, not the String method. - -package main - -import ( - "bufio" - "flag" - "fmt" - "log" - "os" - "regexp" - "strings" -) - -var ( - input = flag.String("i", "", "input file name") - output = flag.String("o", "", "output file name") - pkg = flag.String("p", "", "package name") -) - -var Are = regexp.MustCompile(`^\tA([A-Z0-9]+)`) - -func main() { - flag.Parse() - if *input == "" || *output == "" || *pkg == "" { - flag.Usage() - os.Exit(2) - } - in, err := os.Open(*input) - if err != nil { - log.Fatal(err) - } - fd, err := os.Create(*output) - if err != nil { - log.Fatal(err) - } - out := bufio.NewWriter(fd) - defer out.Flush() - var on = false - s := bufio.NewScanner(in) - first := true - for s.Scan() { - line := s.Text() - if !on { - // First relevant line contains "= obj.ABase". - // If we find it, delete the = so we don't stop immediately. - const prefix = "= obj.ABase" - index := strings.Index(line, prefix) - if index < 0 { - continue - } - // It's on. Start with the header. - fmt.Fprintf(out, header, *input, *output, *pkg, *pkg) - on = true - line = line[:index] - } - // Strip comments so their text won't defeat our heuristic. - index := strings.Index(line, "//") - if index > 0 { - line = line[:index] - } - index = strings.Index(line, "/*") - if index > 0 { - line = line[:index] - } - // Termination condition: Any line with an = changes the sequence, - // so stop there, and stop at a closing brace. - if strings.HasPrefix(line, "}") || strings.ContainsRune(line, '=') { - break - } - sub := Are.FindStringSubmatch(line) - if len(sub) < 2 { - continue - } - if first { - fmt.Fprintf(out, "\tobj.A_ARCHSPECIFIC: %q,\n", sub[1]) - first = false - } else { - fmt.Fprintf(out, "\t%q,\n", sub[1]) - } - } - fmt.Fprintln(out, "}") - if s.Err() != nil { - log.Fatal(err) - } -} - -const header = `// Generated by stringer -i %s -o %s -p %s -// Do not edit. - -package %s - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ -` diff --git a/vendor/github.com/google/gops/internal/obj/sym.go b/vendor/github.com/google/gops/internal/obj/sym.go deleted file mode 100644 index 84de5b61..00000000 --- a/vendor/github.com/google/gops/internal/obj/sym.go +++ /dev/null @@ -1,88 +0,0 @@ -// Derived from Inferno utils/6l/obj.c and utils/6l/span.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/obj.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/span.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package obj - -import ( - "log" - "os" - "path/filepath" -) - -func Linknew(arch *LinkArch) *Link { - ctxt := new(Link) - ctxt.Hash = make(map[SymVer]*LSym) - ctxt.Arch = arch - ctxt.Version = HistVersion - - var buf string - buf, _ = os.Getwd() - if buf == "" { - buf = "/???" - } - buf = filepath.ToSlash(buf) - ctxt.Pathname = buf - - ctxt.LineHist.GOROOT = GOROOT - ctxt.LineHist.Dir = ctxt.Pathname - - ctxt.Headtype.Set(GOOS) - if ctxt.Headtype < 0 { - log.Fatalf("unknown goos %s", GOOS) - } - - ctxt.Flag_optimize = true - ctxt.Framepointer_enabled = Framepointer_enabled(GOOS, arch.Name) - return ctxt -} - -func Linklookup(ctxt *Link, name string, v int) *LSym { - s := ctxt.Hash[SymVer{name, v}] - if s != nil { - return s - } - - s = &LSym{ - Name: name, - Type: 0, - Version: int16(v), - Size: 0, - } - ctxt.Hash[SymVer{name, v}] = s - return s -} - -func Linksymfmt(s *LSym) string { - if s == nil { - return "" - } - return s.Name -} diff --git a/vendor/github.com/google/gops/internal/obj/symkind_string.go b/vendor/github.com/google/gops/internal/obj/symkind_string.go deleted file mode 100644 index fef8c355..00000000 --- a/vendor/github.com/google/gops/internal/obj/symkind_string.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by "stringer -type=SymKind"; DO NOT EDIT - -package obj - -import "fmt" - -const _SymKind_name = "SxxxSTEXTSELFRXSECTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASFUNCTABSELFROSECTSMACHOPLTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSTYPELINKSITABLINKSSYMTABSPCLNTABSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASINITARRSDATASBSSSNOPTRBSSSTLSBSSSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILESFILEPATHSCONSTSDYNIMPORTSHOSTOBJSDWARFSECTSDWARFINFO" - -var _SymKind_index = [...]uint16{0, 4, 9, 19, 24, 31, 40, 47, 54, 61, 69, 79, 88, 98, 110, 124, 136, 148, 160, 173, 182, 191, 198, 206, 214, 220, 229, 237, 244, 254, 262, 267, 271, 280, 287, 292, 304, 316, 333, 350, 355, 364, 370, 380, 388, 398, 408} - -func (i SymKind) String() string { - if i < 0 || i >= SymKind(len(_SymKind_index)-1) { - return fmt.Sprintf("SymKind(%d)", i) - } - return _SymKind_name[_SymKind_index[i]:_SymKind_index[i+1]] -} diff --git a/vendor/github.com/google/gops/internal/obj/textflag.go b/vendor/github.com/google/gops/internal/obj/textflag.go deleted file mode 100644 index d8a52da4..00000000 --- a/vendor/github.com/google/gops/internal/obj/textflag.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file defines flags attached to various functions -// and data objects. The compilers, assemblers, and linker must -// all agree on these values. - -package obj - -const ( - // Don't profile the marked routine. - // - // Deprecated: Not implemented, do not use. - NOPROF = 1 - - // It is ok for the linker to get multiple of these symbols. It will - // pick one of the duplicates to use. - DUPOK = 2 - - // Don't insert stack check preamble. - NOSPLIT = 4 - - // Put this data in a read-only section. - RODATA = 8 - - // This data contains no pointers. - NOPTR = 16 - - // This is a wrapper function and should not count as disabling 'recover'. - WRAPPER = 32 - - // This function uses its incoming context register. - NEEDCTXT = 64 - - // When passed to ggloblsym, causes Local to be set to true on the LSym it creates. - LOCAL = 128 - - // Allocate a word of thread local storage and store the offset from the - // thread local base to the thread local storage in this variable. - TLSBSS = 256 - - // Do not insert instructions to allocate a stack frame for this function. - // Only valid on functions that declare a frame size of 0. - // TODO(mwhudson): only implemented for ppc64x at present. - NOFRAME = 512 - - // Function can call reflect.Type.Method or reflect.Type.MethodByName. - REFLECTMETHOD = 1024 -) diff --git a/vendor/github.com/google/gops/internal/obj/typekind.go b/vendor/github.com/google/gops/internal/obj/typekind.go deleted file mode 100644 index 21932716..00000000 --- a/vendor/github.com/google/gops/internal/obj/typekind.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -// Must match runtime and reflect. -// Included by cmd/gc. - -const ( - KindBool = 1 + iota - KindInt - KindInt8 - KindInt16 - KindInt32 - KindInt64 - KindUint - KindUint8 - KindUint16 - KindUint32 - KindUint64 - KindUintptr - KindFloat32 - KindFloat64 - KindComplex64 - KindComplex128 - KindArray - KindChan - KindFunc - KindInterface - KindMap - KindPtr - KindSlice - KindString - KindStruct - KindUnsafePointer - KindDirectIface = 1 << 5 - KindGCProg = 1 << 6 - KindNoPointers = 1 << 7 - KindMask = (1 << 5) - 1 -) diff --git a/vendor/github.com/google/gops/internal/obj/util.go b/vendor/github.com/google/gops/internal/obj/util.go deleted file mode 100644 index 9f1c6f08..00000000 --- a/vendor/github.com/google/gops/internal/obj/util.go +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package obj - -import ( - "bytes" - "fmt" - "log" - "os" - "strings" - "time" -) - -const REG_NONE = 0 - -var start time.Time - -func Cputime() float64 { - if start.IsZero() { - start = time.Now() - } - return time.Since(start).Seconds() -} - -func envOr(key, value string) string { - if x := os.Getenv(key); x != "" { - return x - } - return value -} - -var ( - GOROOT = envOr("GOROOT", defaultGOROOT) - GOARCH = envOr("GOARCH", defaultGOARCH) - GOOS = envOr("GOOS", defaultGOOS) - GO386 = envOr("GO386", defaultGO386) - GOARM = goarm() - Version = version -) - -func goarm() int { - switch v := envOr("GOARM", defaultGOARM); v { - case "5": - return 5 - case "6": - return 6 - case "7": - return 7 - } - // Fail here, rather than validate at multiple call sites. - log.Fatalf("Invalid GOARM value. Must be 5, 6, or 7.") - panic("unreachable") -} - -func Getgoextlinkenabled() string { - return envOr("GO_EXTLINK_ENABLED", defaultGO_EXTLINK_ENABLED) -} - -func (p *Prog) Line() string { - return p.Ctxt.LineHist.LineString(int(p.Lineno)) -} - -var armCondCode = []string{ - ".EQ", - ".NE", - ".CS", - ".CC", - ".MI", - ".PL", - ".VS", - ".VC", - ".HI", - ".LS", - ".GE", - ".LT", - ".GT", - ".LE", - "", - ".NV", -} - -/* ARM scond byte */ -const ( - C_SCOND = (1 << 4) - 1 - C_SBIT = 1 << 4 - C_PBIT = 1 << 5 - C_WBIT = 1 << 6 - C_FBIT = 1 << 7 - C_UBIT = 1 << 7 - C_SCOND_XOR = 14 -) - -// CConv formats ARM condition codes. -func CConv(s uint8) string { - if s == 0 { - return "" - } - sc := armCondCode[(s&C_SCOND)^C_SCOND_XOR] - if s&C_SBIT != 0 { - sc += ".S" - } - if s&C_PBIT != 0 { - sc += ".P" - } - if s&C_WBIT != 0 { - sc += ".W" - } - if s&C_UBIT != 0 { /* ambiguous with FBIT */ - sc += ".U" - } - return sc -} - -func (p *Prog) String() string { - if p == nil { - return "" - } - - if p.Ctxt == nil { - return "" - } - - sc := CConv(p.Scond) - - var buf bytes.Buffer - - fmt.Fprintf(&buf, "%.5d (%v)\t%v%s", p.Pc, p.Line(), p.As, sc) - sep := "\t" - quadOpAmd64 := p.RegTo2 == -1 - if quadOpAmd64 { - fmt.Fprintf(&buf, "%s$%d", sep, p.From3.Offset) - sep = ", " - } - if p.From.Type != TYPE_NONE { - fmt.Fprintf(&buf, "%s%v", sep, Dconv(p, &p.From)) - sep = ", " - } - if p.Reg != REG_NONE { - // Should not happen but might as well show it if it does. - fmt.Fprintf(&buf, "%s%v", sep, Rconv(int(p.Reg))) - sep = ", " - } - if p.From3Type() != TYPE_NONE { - if p.From3.Type == TYPE_CONST && p.As == ATEXT { - // Special case - omit $. - fmt.Fprintf(&buf, "%s%d", sep, p.From3.Offset) - } else if quadOpAmd64 { - fmt.Fprintf(&buf, "%s%v", sep, Rconv(int(p.From3.Reg))) - } else { - fmt.Fprintf(&buf, "%s%v", sep, Dconv(p, p.From3)) - } - sep = ", " - } - if p.To.Type != TYPE_NONE { - fmt.Fprintf(&buf, "%s%v", sep, Dconv(p, &p.To)) - } - if p.RegTo2 != REG_NONE && !quadOpAmd64 { - fmt.Fprintf(&buf, "%s%v", sep, Rconv(int(p.RegTo2))) - } - return buf.String() -} - -func (ctxt *Link) NewProg() *Prog { - var p *Prog - if i := ctxt.allocIdx; i < len(ctxt.progs) { - p = &ctxt.progs[i] - ctxt.allocIdx = i + 1 - } else { - p = new(Prog) // should be the only call to this; all others should use ctxt.NewProg - } - p.Ctxt = ctxt - return p -} -func (ctxt *Link) freeProgs() { - s := ctxt.progs[:ctxt.allocIdx] - for i := range s { - s[i] = Prog{} - } - ctxt.allocIdx = 0 -} - -func (ctxt *Link) Line(n int) string { - return ctxt.LineHist.LineString(n) -} - -func Getcallerpc(interface{}) uintptr { - return 1 -} - -func (ctxt *Link) Dconv(a *Addr) string { - return Dconv(nil, a) -} - -func Dconv(p *Prog, a *Addr) string { - var str string - - switch a.Type { - default: - str = fmt.Sprintf("type=%d", a.Type) - - case TYPE_NONE: - str = "" - if a.Name != NAME_NONE || a.Reg != 0 || a.Sym != nil { - str = fmt.Sprintf("%v(%v)(NONE)", Mconv(a), Rconv(int(a.Reg))) - } - - case TYPE_REG: - // TODO(rsc): This special case is for x86 instructions like - // PINSRQ CX,$1,X6 - // where the $1 is included in the p->to Addr. - // Move into a new field. - if a.Offset != 0 { - str = fmt.Sprintf("$%d,%v", a.Offset, Rconv(int(a.Reg))) - break - } - - str = Rconv(int(a.Reg)) - if a.Name != NAME_NONE || a.Sym != nil { - str = fmt.Sprintf("%v(%v)(REG)", Mconv(a), Rconv(int(a.Reg))) - } - - case TYPE_BRANCH: - if a.Sym != nil { - str = fmt.Sprintf("%s(SB)", a.Sym.Name) - } else if p != nil && p.Pcond != nil { - str = fmt.Sprint(p.Pcond.Pc) - } else if a.Val != nil { - str = fmt.Sprint(a.Val.(*Prog).Pc) - } else { - str = fmt.Sprintf("%d(PC)", a.Offset) - } - - case TYPE_INDIR: - str = fmt.Sprintf("*%s", Mconv(a)) - - case TYPE_MEM: - str = Mconv(a) - if a.Index != REG_NONE { - str += fmt.Sprintf("(%v*%d)", Rconv(int(a.Index)), int(a.Scale)) - } - - case TYPE_CONST: - if a.Reg != 0 { - str = fmt.Sprintf("$%v(%v)", Mconv(a), Rconv(int(a.Reg))) - } else { - str = fmt.Sprintf("$%v", Mconv(a)) - } - - case TYPE_TEXTSIZE: - if a.Val.(int32) == ArgsSizeUnknown { - str = fmt.Sprintf("$%d", a.Offset) - } else { - str = fmt.Sprintf("$%d-%d", a.Offset, a.Val.(int32)) - } - - case TYPE_FCONST: - str = fmt.Sprintf("%.17g", a.Val.(float64)) - // Make sure 1 prints as 1.0 - if !strings.ContainsAny(str, ".e") { - str += ".0" - } - str = fmt.Sprintf("$(%s)", str) - - case TYPE_SCONST: - str = fmt.Sprintf("$%q", a.Val.(string)) - - case TYPE_ADDR: - str = fmt.Sprintf("$%s", Mconv(a)) - - case TYPE_SHIFT: - v := int(a.Offset) - ops := "<<>>->@>" - switch GOARCH { - case "arm": - op := ops[((v>>5)&3)<<1:] - if v&(1<<4) != 0 { - str = fmt.Sprintf("R%d%c%cR%d", v&15, op[0], op[1], (v>>8)&15) - } else { - str = fmt.Sprintf("R%d%c%c%d", v&15, op[0], op[1], (v>>7)&31) - } - if a.Reg != 0 { - str += fmt.Sprintf("(%v)", Rconv(int(a.Reg))) - } - case "arm64": - op := ops[((v>>22)&3)<<1:] - str = fmt.Sprintf("R%d%c%c%d", (v>>16)&31, op[0], op[1], (v>>10)&63) - default: - panic("TYPE_SHIFT is not supported on " + GOARCH) - } - - case TYPE_REGREG: - str = fmt.Sprintf("(%v, %v)", Rconv(int(a.Reg)), Rconv(int(a.Offset))) - - case TYPE_REGREG2: - str = fmt.Sprintf("%v, %v", Rconv(int(a.Reg)), Rconv(int(a.Offset))) - - case TYPE_REGLIST: - str = regListConv(int(a.Offset)) - } - - return str -} - -func Mconv(a *Addr) string { - var str string - - switch a.Name { - default: - str = fmt.Sprintf("name=%d", a.Name) - - case NAME_NONE: - switch { - case a.Reg == REG_NONE: - str = fmt.Sprint(a.Offset) - case a.Offset == 0: - str = fmt.Sprintf("(%v)", Rconv(int(a.Reg))) - case a.Offset != 0: - str = fmt.Sprintf("%d(%v)", a.Offset, Rconv(int(a.Reg))) - } - - case NAME_EXTERN: - if a.Sym != nil { - str = fmt.Sprintf("%s%s(SB)", a.Sym.Name, offConv(a.Offset)) - } else { - str = fmt.Sprintf("%s(SB)", offConv(a.Offset)) - } - - case NAME_GOTREF: - if a.Sym != nil { - str = fmt.Sprintf("%s%s@GOT(SB)", a.Sym.Name, offConv(a.Offset)) - } else { - str = fmt.Sprintf("%s@GOT(SB)", offConv(a.Offset)) - } - - case NAME_STATIC: - if a.Sym != nil { - str = fmt.Sprintf("%s<>%s(SB)", a.Sym.Name, offConv(a.Offset)) - } else { - str = fmt.Sprintf("<>%s(SB)", offConv(a.Offset)) - } - - case NAME_AUTO: - if a.Sym != nil { - str = fmt.Sprintf("%s%s(SP)", a.Sym.Name, offConv(a.Offset)) - } else { - str = fmt.Sprintf("%s(SP)", offConv(a.Offset)) - } - - case NAME_PARAM: - if a.Sym != nil { - str = fmt.Sprintf("%s%s(FP)", a.Sym.Name, offConv(a.Offset)) - } else { - str = fmt.Sprintf("%s(FP)", offConv(a.Offset)) - } - } - return str -} - -func offConv(off int64) string { - if off == 0 { - return "" - } - return fmt.Sprintf("%+d", off) -} - -type regSet struct { - lo int - hi int - Rconv func(int) string -} - -// Few enough architectures that a linear scan is fastest. -// Not even worth sorting. -var regSpace []regSet - -/* - Each architecture defines a register space as a unique - integer range. - Here is the list of architectures and the base of their register spaces. -*/ - -const ( - // Because of masking operations in the encodings, each register - // space should start at 0 modulo some power of 2. - RBase386 = 1 * 1024 - RBaseAMD64 = 2 * 1024 - RBaseARM = 3 * 1024 - RBasePPC64 = 4 * 1024 // range [4k, 8k) - RBaseARM64 = 8 * 1024 // range [8k, 13k) - RBaseMIPS64 = 13 * 1024 // range [13k, 14k) - RBaseS390X = 14 * 1024 // range [14k, 15k) -) - -// RegisterRegister binds a pretty-printer (Rconv) for register -// numbers to a given register number range. Lo is inclusive, -// hi exclusive (valid registers are lo through hi-1). -func RegisterRegister(lo, hi int, Rconv func(int) string) { - regSpace = append(regSpace, regSet{lo, hi, Rconv}) -} - -func Rconv(reg int) string { - if reg == REG_NONE { - return "NONE" - } - for i := range regSpace { - rs := ®Space[i] - if rs.lo <= reg && reg < rs.hi { - return rs.Rconv(reg) - } - } - return fmt.Sprintf("R???%d", reg) -} - -func regListConv(list int) string { - str := "" - - for i := 0; i < 16; i++ { // TODO: 16 is ARM-specific. - if list&(1< AllowedOpCodes { - panic(fmt.Sprintf("too many instructions, have %d max %d", len(Anames), AllowedOpCodes)) - } - aSpace = append(aSpace, opSet{lo, Anames}) -} - -func (a As) String() string { - if 0 <= a && int(a) < len(Anames) { - return Anames[a] - } - for i := range aSpace { - as := &aSpace[i] - if as.lo <= a && int(a-as.lo) < len(as.names) { - return as.names[a-as.lo] - } - } - return fmt.Sprintf("A???%d", a) -} - -var Anames = []string{ - "XXX", - "CALL", - "DUFFCOPY", - "DUFFZERO", - "END", - "FUNCDATA", - "JMP", - "NOP", - "PCDATA", - "RET", - "TEXT", - "TYPE", - "UNDEF", - "USEFIELD", - "VARDEF", - "VARKILL", - "VARLIVE", -} - -func Bool2int(b bool) int { - // The compiler currently only optimizes this form. - // See issue 6011. - var i int - if b { - i = 1 - } else { - i = 0 - } - return i -} diff --git a/vendor/github.com/google/gops/internal/obj/x86/a.out.go b/vendor/github.com/google/gops/internal/obj/x86/a.out.go deleted file mode 100644 index 34480393..00000000 --- a/vendor/github.com/google/gops/internal/obj/x86/a.out.go +++ /dev/null @@ -1,1009 +0,0 @@ -// Inferno utils/6c/6.out.h -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6c/6.out.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package x86 - -import "github.com/google/gops/internal/obj" - -//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p x86 - -const ( - /* mark flags */ - DONE = 1 << iota - PRESERVEFLAGS // not allowed to clobber flags -) - -/* - * amd64 - */ -const ( - AAAA = obj.ABaseAMD64 + obj.A_ARCHSPECIFIC + iota - AAAD - AAAM - AAAS - AADCB - AADCL - AADCW - AADDB - AADDL - AADDW - AADJSP - AANDB - AANDL - AANDW - AARPL - ABOUNDL - ABOUNDW - ABSFL - ABSFW - ABSRL - ABSRW - ABTL - ABTW - ABTCL - ABTCW - ABTRL - ABTRW - ABTSL - ABTSW - ABYTE - ACLC - ACLD - ACLI - ACLTS - ACMC - ACMPB - ACMPL - ACMPW - ACMPSB - ACMPSL - ACMPSW - ADAA - ADAS - ADECB - ADECL - ADECQ - ADECW - ADIVB - ADIVL - ADIVW - AENTER - AHADDPD - AHADDPS - AHLT - AHSUBPD - AHSUBPS - AIDIVB - AIDIVL - AIDIVW - AIMULB - AIMULL - AIMULW - AINB - AINL - AINW - AINCB - AINCL - AINCQ - AINCW - AINSB - AINSL - AINSW - AINT - AINTO - AIRETL - AIRETW - AJCC // >= unsigned - AJCS // < unsigned - AJCXZL - AJEQ // == (zero) - AJGE // >= signed - AJGT // > signed - AJHI // > unsigned - AJLE // <= signed - AJLS // <= unsigned - AJLT // < signed - AJMI // sign bit set (negative) - AJNE // != (nonzero) - AJOC // overflow clear - AJOS // overflow set - AJPC // parity clear - AJPL // sign bit clear (positive) - AJPS // parity set - ALAHF - ALARL - ALARW - ALEAL - ALEAW - ALEAVEL - ALEAVEW - ALOCK - ALODSB - ALODSL - ALODSW - ALONG - ALOOP - ALOOPEQ - ALOOPNE - ALSLL - ALSLW - AMOVB - AMOVL - AMOVW - AMOVBLSX - AMOVBLZX - AMOVBQSX - AMOVBQZX - AMOVBWSX - AMOVBWZX - AMOVWLSX - AMOVWLZX - AMOVWQSX - AMOVWQZX - AMOVSB - AMOVSL - AMOVSW - AMULB - AMULL - AMULW - ANEGB - ANEGL - ANEGW - ANOTB - ANOTL - ANOTW - AORB - AORL - AORW - AOUTB - AOUTL - AOUTW - AOUTSB - AOUTSL - AOUTSW - APAUSE - APOPAL - APOPAW - APOPCNTW - APOPCNTL - APOPCNTQ - APOPFL - APOPFW - APOPL - APOPW - APUSHAL - APUSHAW - APUSHFL - APUSHFW - APUSHL - APUSHW - ARCLB - ARCLL - ARCLW - ARCRB - ARCRL - ARCRW - AREP - AREPN - AROLB - AROLL - AROLW - ARORB - ARORL - ARORW - ASAHF - ASALB - ASALL - ASALW - ASARB - ASARL - ASARW - ASBBB - ASBBL - ASBBW - ASCASB - ASCASL - ASCASW - ASETCC - ASETCS - ASETEQ - ASETGE - ASETGT - ASETHI - ASETLE - ASETLS - ASETLT - ASETMI - ASETNE - ASETOC - ASETOS - ASETPC - ASETPL - ASETPS - ACDQ - ACWD - ASHLB - ASHLL - ASHLW - ASHRB - ASHRL - ASHRW - ASTC - ASTD - ASTI - ASTOSB - ASTOSL - ASTOSW - ASUBB - ASUBL - ASUBW - ASYSCALL - ATESTB - ATESTL - ATESTW - AVERR - AVERW - AWAIT - AWORD - AXCHGB - AXCHGL - AXCHGW - AXLAT - AXORB - AXORL - AXORW - - AFMOVB - AFMOVBP - AFMOVD - AFMOVDP - AFMOVF - AFMOVFP - AFMOVL - AFMOVLP - AFMOVV - AFMOVVP - AFMOVW - AFMOVWP - AFMOVX - AFMOVXP - - AFCOMD - AFCOMDP - AFCOMDPP - AFCOMF - AFCOMFP - AFCOML - AFCOMLP - AFCOMW - AFCOMWP - AFUCOM - AFUCOMP - AFUCOMPP - - AFADDDP - AFADDW - AFADDL - AFADDF - AFADDD - - AFMULDP - AFMULW - AFMULL - AFMULF - AFMULD - - AFSUBDP - AFSUBW - AFSUBL - AFSUBF - AFSUBD - - AFSUBRDP - AFSUBRW - AFSUBRL - AFSUBRF - AFSUBRD - - AFDIVDP - AFDIVW - AFDIVL - AFDIVF - AFDIVD - - AFDIVRDP - AFDIVRW - AFDIVRL - AFDIVRF - AFDIVRD - - AFXCHD - AFFREE - - AFLDCW - AFLDENV - AFRSTOR - AFSAVE - AFSTCW - AFSTENV - AFSTSW - - AF2XM1 - AFABS - AFCHS - AFCLEX - AFCOS - AFDECSTP - AFINCSTP - AFINIT - AFLD1 - AFLDL2E - AFLDL2T - AFLDLG2 - AFLDLN2 - AFLDPI - AFLDZ - AFNOP - AFPATAN - AFPREM - AFPREM1 - AFPTAN - AFRNDINT - AFSCALE - AFSIN - AFSINCOS - AFSQRT - AFTST - AFXAM - AFXTRACT - AFYL2X - AFYL2XP1 - - // extra 32-bit operations - ACMPXCHGB - ACMPXCHGL - ACMPXCHGW - ACMPXCHG8B - ACPUID - AINVD - AINVLPG - ALFENCE - AMFENCE - AMOVNTIL - ARDMSR - ARDPMC - ARDTSC - ARSM - ASFENCE - ASYSRET - AWBINVD - AWRMSR - AXADDB - AXADDL - AXADDW - - // conditional move - ACMOVLCC - ACMOVLCS - ACMOVLEQ - ACMOVLGE - ACMOVLGT - ACMOVLHI - ACMOVLLE - ACMOVLLS - ACMOVLLT - ACMOVLMI - ACMOVLNE - ACMOVLOC - ACMOVLOS - ACMOVLPC - ACMOVLPL - ACMOVLPS - ACMOVQCC - ACMOVQCS - ACMOVQEQ - ACMOVQGE - ACMOVQGT - ACMOVQHI - ACMOVQLE - ACMOVQLS - ACMOVQLT - ACMOVQMI - ACMOVQNE - ACMOVQOC - ACMOVQOS - ACMOVQPC - ACMOVQPL - ACMOVQPS - ACMOVWCC - ACMOVWCS - ACMOVWEQ - ACMOVWGE - ACMOVWGT - ACMOVWHI - ACMOVWLE - ACMOVWLS - ACMOVWLT - ACMOVWMI - ACMOVWNE - ACMOVWOC - ACMOVWOS - ACMOVWPC - ACMOVWPL - ACMOVWPS - - // 64-bit - AADCQ - AADDQ - AANDQ - ABSFQ - ABSRQ - ABTCQ - ABTQ - ABTRQ - ABTSQ - ACMPQ - ACMPSQ - ACMPXCHGQ - ACQO - ADIVQ - AIDIVQ - AIMULQ - AIRETQ - AJCXZQ - ALEAQ - ALEAVEQ - ALODSQ - AMOVQ - AMOVLQSX - AMOVLQZX - AMOVNTIQ - AMOVSQ - AMULQ - ANEGQ - ANOTQ - AORQ - APOPFQ - APOPQ - APUSHFQ - APUSHQ - ARCLQ - ARCRQ - AROLQ - ARORQ - AQUAD - ASALQ - ASARQ - ASBBQ - ASCASQ - ASHLQ - ASHRQ - ASTOSQ - ASUBQ - ATESTQ - AXADDQ - AXCHGQ - AXORQ - AXGETBV - - // media - AADDPD - AADDPS - AADDSD - AADDSS - AANDNL - AANDNQ - AANDNPD - AANDNPS - AANDPD - AANDPS - ABEXTRL - ABEXTRQ - ABLSIL - ABLSIQ - ABLSMSKL - ABLSMSKQ - ABLSRL - ABLSRQ - ABZHIL - ABZHIQ - ACMPPD - ACMPPS - ACMPSD - ACMPSS - ACOMISD - ACOMISS - ACVTPD2PL - ACVTPD2PS - ACVTPL2PD - ACVTPL2PS - ACVTPS2PD - ACVTPS2PL - ACVTSD2SL - ACVTSD2SQ - ACVTSD2SS - ACVTSL2SD - ACVTSL2SS - ACVTSQ2SD - ACVTSQ2SS - ACVTSS2SD - ACVTSS2SL - ACVTSS2SQ - ACVTTPD2PL - ACVTTPS2PL - ACVTTSD2SL - ACVTTSD2SQ - ACVTTSS2SL - ACVTTSS2SQ - ADIVPD - ADIVPS - ADIVSD - ADIVSS - AEMMS - AFXRSTOR - AFXRSTOR64 - AFXSAVE - AFXSAVE64 - ALDDQU - ALDMXCSR - AMASKMOVOU - AMASKMOVQ - AMAXPD - AMAXPS - AMAXSD - AMAXSS - AMINPD - AMINPS - AMINSD - AMINSS - AMOVAPD - AMOVAPS - AMOVOU - AMOVHLPS - AMOVHPD - AMOVHPS - AMOVLHPS - AMOVLPD - AMOVLPS - AMOVMSKPD - AMOVMSKPS - AMOVNTO - AMOVNTPD - AMOVNTPS - AMOVNTQ - AMOVO - AMOVQOZX - AMOVSD - AMOVSS - AMOVUPD - AMOVUPS - AMULPD - AMULPS - AMULSD - AMULSS - AMULXL - AMULXQ - AORPD - AORPS - APACKSSLW - APACKSSWB - APACKUSWB - APADDB - APADDL - APADDQ - APADDSB - APADDSW - APADDUSB - APADDUSW - APADDW - APAND - APANDN - APAVGB - APAVGW - APCMPEQB - APCMPEQL - APCMPEQW - APCMPGTB - APCMPGTL - APCMPGTW - APDEPL - APDEPQ - APEXTL - APEXTQ - APEXTRB - APEXTRD - APEXTRQ - APEXTRW - APHADDD - APHADDSW - APHADDW - APHMINPOSUW - APHSUBD - APHSUBSW - APHSUBW - APINSRB - APINSRD - APINSRQ - APINSRW - APMADDWL - APMAXSW - APMAXUB - APMINSW - APMINUB - APMOVMSKB - APMOVSXBD - APMOVSXBQ - APMOVSXBW - APMOVSXDQ - APMOVSXWD - APMOVSXWQ - APMOVZXBD - APMOVZXBQ - APMOVZXBW - APMOVZXDQ - APMOVZXWD - APMOVZXWQ - APMULDQ - APMULHUW - APMULHW - APMULLD - APMULLW - APMULULQ - APOR - APSADBW - APSHUFB - APSHUFHW - APSHUFL - APSHUFLW - APSHUFW - APSLLL - APSLLO - APSLLQ - APSLLW - APSRAL - APSRAW - APSRLL - APSRLO - APSRLQ - APSRLW - APSUBB - APSUBL - APSUBQ - APSUBSB - APSUBSW - APSUBUSB - APSUBUSW - APSUBW - APUNPCKHBW - APUNPCKHLQ - APUNPCKHQDQ - APUNPCKHWL - APUNPCKLBW - APUNPCKLLQ - APUNPCKLQDQ - APUNPCKLWL - APXOR - ARCPPS - ARCPSS - ARSQRTPS - ARSQRTSS - ASARXL - ASARXQ - ASHLXL - ASHLXQ - ASHRXL - ASHRXQ - ASHUFPD - ASHUFPS - ASQRTPD - ASQRTPS - ASQRTSD - ASQRTSS - ASTMXCSR - ASUBPD - ASUBPS - ASUBSD - ASUBSS - AUCOMISD - AUCOMISS - AUNPCKHPD - AUNPCKHPS - AUNPCKLPD - AUNPCKLPS - AXORPD - AXORPS - APCMPESTRI - - ARETFW - ARETFL - ARETFQ - ASWAPGS - - AMODE - ACRC32B - ACRC32Q - AIMUL3Q - - APREFETCHT0 - APREFETCHT1 - APREFETCHT2 - APREFETCHNTA - - AMOVQL - ABSWAPL - ABSWAPQ - - AAESENC - AAESENCLAST - AAESDEC - AAESDECLAST - AAESIMC - AAESKEYGENASSIST - - AROUNDPS - AROUNDSS - AROUNDPD - AROUNDSD - AMOVDDUP - AMOVSHDUP - AMOVSLDUP - - APSHUFD - APCLMULQDQ - - AVZEROUPPER - AVMOVDQU - AVMOVNTDQ - AVMOVDQA - AVPCMPEQB - AVPXOR - AVPMOVMSKB - AVPAND - AVPTEST - AVPBROADCASTB - AVPSHUFB - AVPSHUFD - AVPERM2F128 - AVPALIGNR - AVPADDQ - AVPADDD - AVPSRLDQ - AVPSLLDQ - AVPSRLQ - AVPSLLQ - AVPSRLD - AVPSLLD - AVPOR - AVPBLENDD - AVINSERTI128 - AVPERM2I128 - ARORXL - ARORXQ - AVBROADCASTSS - AVBROADCASTSD - AVMOVDDUP - AVMOVSHDUP - AVMOVSLDUP - - // from 386 - AJCXZW - AFCMOVCC - AFCMOVCS - AFCMOVEQ - AFCMOVHI - AFCMOVLS - AFCMOVNE - AFCMOVNU - AFCMOVUN - AFCOMI - AFCOMIP - AFUCOMI - AFUCOMIP - - // TSX - AXACQUIRE - AXRELEASE - AXBEGIN - AXEND - AXABORT - AXTEST - - ALAST -) - -const ( - REG_NONE = 0 -) - -const ( - REG_AL = obj.RBaseAMD64 + iota - REG_CL - REG_DL - REG_BL - REG_SPB - REG_BPB - REG_SIB - REG_DIB - REG_R8B - REG_R9B - REG_R10B - REG_R11B - REG_R12B - REG_R13B - REG_R14B - REG_R15B - - REG_AX - REG_CX - REG_DX - REG_BX - REG_SP - REG_BP - REG_SI - REG_DI - REG_R8 - REG_R9 - REG_R10 - REG_R11 - REG_R12 - REG_R13 - REG_R14 - REG_R15 - - REG_AH - REG_CH - REG_DH - REG_BH - - REG_F0 - REG_F1 - REG_F2 - REG_F3 - REG_F4 - REG_F5 - REG_F6 - REG_F7 - - REG_M0 - REG_M1 - REG_M2 - REG_M3 - REG_M4 - REG_M5 - REG_M6 - REG_M7 - - REG_X0 - REG_X1 - REG_X2 - REG_X3 - REG_X4 - REG_X5 - REG_X6 - REG_X7 - REG_X8 - REG_X9 - REG_X10 - REG_X11 - REG_X12 - REG_X13 - REG_X14 - REG_X15 - - REG_Y0 - REG_Y1 - REG_Y2 - REG_Y3 - REG_Y4 - REG_Y5 - REG_Y6 - REG_Y7 - REG_Y8 - REG_Y9 - REG_Y10 - REG_Y11 - REG_Y12 - REG_Y13 - REG_Y14 - REG_Y15 - - REG_CS - REG_SS - REG_DS - REG_ES - REG_FS - REG_GS - - REG_GDTR /* global descriptor table register */ - REG_IDTR /* interrupt descriptor table register */ - REG_LDTR /* local descriptor table register */ - REG_MSW /* machine status word */ - REG_TASK /* task register */ - - REG_CR0 - REG_CR1 - REG_CR2 - REG_CR3 - REG_CR4 - REG_CR5 - REG_CR6 - REG_CR7 - REG_CR8 - REG_CR9 - REG_CR10 - REG_CR11 - REG_CR12 - REG_CR13 - REG_CR14 - REG_CR15 - - REG_DR0 - REG_DR1 - REG_DR2 - REG_DR3 - REG_DR4 - REG_DR5 - REG_DR6 - REG_DR7 - - REG_TR0 - REG_TR1 - REG_TR2 - REG_TR3 - REG_TR4 - REG_TR5 - REG_TR6 - REG_TR7 - - REG_TLS - - MAXREG - - REG_CR = REG_CR0 - REG_DR = REG_DR0 - REG_TR = REG_TR0 - - REGARG = -1 - REGRET = REG_AX - FREGRET = REG_X0 - REGSP = REG_SP - REGCTXT = REG_DX - REGEXT = REG_R15 /* compiler allocates external registers R15 down */ - FREGMIN = REG_X0 + 5 /* first register variable */ - FREGEXT = REG_X0 + 15 /* first external register */ - T_TYPE = 1 << 0 - T_INDEX = 1 << 1 - T_OFFSET = 1 << 2 - T_FCONST = 1 << 3 - T_SYM = 1 << 4 - T_SCONST = 1 << 5 - T_64 = 1 << 6 - T_GOTYPE = 1 << 7 -) diff --git a/vendor/github.com/google/gops/internal/obj/x86/anames.go b/vendor/github.com/google/gops/internal/obj/x86/anames.go deleted file mode 100644 index 5f5e8b8b..00000000 --- a/vendor/github.com/google/gops/internal/obj/x86/anames.go +++ /dev/null @@ -1,769 +0,0 @@ -// Generated by stringer -i a.out.go -o anames.go -p x86 -// Do not edit. - -package x86 - -import "github.com/google/gops/internal/obj" - -var Anames = []string{ - obj.A_ARCHSPECIFIC: "AAA", - "AAD", - "AAM", - "AAS", - "ADCB", - "ADCL", - "ADCW", - "ADDB", - "ADDL", - "ADDW", - "ADJSP", - "ANDB", - "ANDL", - "ANDW", - "ARPL", - "BOUNDL", - "BOUNDW", - "BSFL", - "BSFW", - "BSRL", - "BSRW", - "BTL", - "BTW", - "BTCL", - "BTCW", - "BTRL", - "BTRW", - "BTSL", - "BTSW", - "BYTE", - "CLC", - "CLD", - "CLI", - "CLTS", - "CMC", - "CMPB", - "CMPL", - "CMPW", - "CMPSB", - "CMPSL", - "CMPSW", - "DAA", - "DAS", - "DECB", - "DECL", - "DECQ", - "DECW", - "DIVB", - "DIVL", - "DIVW", - "ENTER", - "HADDPD", - "HADDPS", - "HLT", - "HSUBPD", - "HSUBPS", - "IDIVB", - "IDIVL", - "IDIVW", - "IMULB", - "IMULL", - "IMULW", - "INB", - "INL", - "INW", - "INCB", - "INCL", - "INCQ", - "INCW", - "INSB", - "INSL", - "INSW", - "INT", - "INTO", - "IRETL", - "IRETW", - "JCC", - "JCS", - "JCXZL", - "JEQ", - "JGE", - "JGT", - "JHI", - "JLE", - "JLS", - "JLT", - "JMI", - "JNE", - "JOC", - "JOS", - "JPC", - "JPL", - "JPS", - "LAHF", - "LARL", - "LARW", - "LEAL", - "LEAW", - "LEAVEL", - "LEAVEW", - "LOCK", - "LODSB", - "LODSL", - "LODSW", - "LONG", - "LOOP", - "LOOPEQ", - "LOOPNE", - "LSLL", - "LSLW", - "MOVB", - "MOVL", - "MOVW", - "MOVBLSX", - "MOVBLZX", - "MOVBQSX", - "MOVBQZX", - "MOVBWSX", - "MOVBWZX", - "MOVWLSX", - "MOVWLZX", - "MOVWQSX", - "MOVWQZX", - "MOVSB", - "MOVSL", - "MOVSW", - "MULB", - "MULL", - "MULW", - "NEGB", - "NEGL", - "NEGW", - "NOTB", - "NOTL", - "NOTW", - "ORB", - "ORL", - "ORW", - "OUTB", - "OUTL", - "OUTW", - "OUTSB", - "OUTSL", - "OUTSW", - "PAUSE", - "POPAL", - "POPAW", - "POPCNTW", - "POPCNTL", - "POPCNTQ", - "POPFL", - "POPFW", - "POPL", - "POPW", - "PUSHAL", - "PUSHAW", - "PUSHFL", - "PUSHFW", - "PUSHL", - "PUSHW", - "RCLB", - "RCLL", - "RCLW", - "RCRB", - "RCRL", - "RCRW", - "REP", - "REPN", - "ROLB", - "ROLL", - "ROLW", - "RORB", - "RORL", - "RORW", - "SAHF", - "SALB", - "SALL", - "SALW", - "SARB", - "SARL", - "SARW", - "SBBB", - "SBBL", - "SBBW", - "SCASB", - "SCASL", - "SCASW", - "SETCC", - "SETCS", - "SETEQ", - "SETGE", - "SETGT", - "SETHI", - "SETLE", - "SETLS", - "SETLT", - "SETMI", - "SETNE", - "SETOC", - "SETOS", - "SETPC", - "SETPL", - "SETPS", - "CDQ", - "CWD", - "SHLB", - "SHLL", - "SHLW", - "SHRB", - "SHRL", - "SHRW", - "STC", - "STD", - "STI", - "STOSB", - "STOSL", - "STOSW", - "SUBB", - "SUBL", - "SUBW", - "SYSCALL", - "TESTB", - "TESTL", - "TESTW", - "VERR", - "VERW", - "WAIT", - "WORD", - "XCHGB", - "XCHGL", - "XCHGW", - "XLAT", - "XORB", - "XORL", - "XORW", - "FMOVB", - "FMOVBP", - "FMOVD", - "FMOVDP", - "FMOVF", - "FMOVFP", - "FMOVL", - "FMOVLP", - "FMOVV", - "FMOVVP", - "FMOVW", - "FMOVWP", - "FMOVX", - "FMOVXP", - "FCOMD", - "FCOMDP", - "FCOMDPP", - "FCOMF", - "FCOMFP", - "FCOML", - "FCOMLP", - "FCOMW", - "FCOMWP", - "FUCOM", - "FUCOMP", - "FUCOMPP", - "FADDDP", - "FADDW", - "FADDL", - "FADDF", - "FADDD", - "FMULDP", - "FMULW", - "FMULL", - "FMULF", - "FMULD", - "FSUBDP", - "FSUBW", - "FSUBL", - "FSUBF", - "FSUBD", - "FSUBRDP", - "FSUBRW", - "FSUBRL", - "FSUBRF", - "FSUBRD", - "FDIVDP", - "FDIVW", - "FDIVL", - "FDIVF", - "FDIVD", - "FDIVRDP", - "FDIVRW", - "FDIVRL", - "FDIVRF", - "FDIVRD", - "FXCHD", - "FFREE", - "FLDCW", - "FLDENV", - "FRSTOR", - "FSAVE", - "FSTCW", - "FSTENV", - "FSTSW", - "F2XM1", - "FABS", - "FCHS", - "FCLEX", - "FCOS", - "FDECSTP", - "FINCSTP", - "FINIT", - "FLD1", - "FLDL2E", - "FLDL2T", - "FLDLG2", - "FLDLN2", - "FLDPI", - "FLDZ", - "FNOP", - "FPATAN", - "FPREM", - "FPREM1", - "FPTAN", - "FRNDINT", - "FSCALE", - "FSIN", - "FSINCOS", - "FSQRT", - "FTST", - "FXAM", - "FXTRACT", - "FYL2X", - "FYL2XP1", - "CMPXCHGB", - "CMPXCHGL", - "CMPXCHGW", - "CMPXCHG8B", - "CPUID", - "INVD", - "INVLPG", - "LFENCE", - "MFENCE", - "MOVNTIL", - "RDMSR", - "RDPMC", - "RDTSC", - "RSM", - "SFENCE", - "SYSRET", - "WBINVD", - "WRMSR", - "XADDB", - "XADDL", - "XADDW", - "CMOVLCC", - "CMOVLCS", - "CMOVLEQ", - "CMOVLGE", - "CMOVLGT", - "CMOVLHI", - "CMOVLLE", - "CMOVLLS", - "CMOVLLT", - "CMOVLMI", - "CMOVLNE", - "CMOVLOC", - "CMOVLOS", - "CMOVLPC", - "CMOVLPL", - "CMOVLPS", - "CMOVQCC", - "CMOVQCS", - "CMOVQEQ", - "CMOVQGE", - "CMOVQGT", - "CMOVQHI", - "CMOVQLE", - "CMOVQLS", - "CMOVQLT", - "CMOVQMI", - "CMOVQNE", - "CMOVQOC", - "CMOVQOS", - "CMOVQPC", - "CMOVQPL", - "CMOVQPS", - "CMOVWCC", - "CMOVWCS", - "CMOVWEQ", - "CMOVWGE", - "CMOVWGT", - "CMOVWHI", - "CMOVWLE", - "CMOVWLS", - "CMOVWLT", - "CMOVWMI", - "CMOVWNE", - "CMOVWOC", - "CMOVWOS", - "CMOVWPC", - "CMOVWPL", - "CMOVWPS", - "ADCQ", - "ADDQ", - "ANDQ", - "BSFQ", - "BSRQ", - "BTCQ", - "BTQ", - "BTRQ", - "BTSQ", - "CMPQ", - "CMPSQ", - "CMPXCHGQ", - "CQO", - "DIVQ", - "IDIVQ", - "IMULQ", - "IRETQ", - "JCXZQ", - "LEAQ", - "LEAVEQ", - "LODSQ", - "MOVQ", - "MOVLQSX", - "MOVLQZX", - "MOVNTIQ", - "MOVSQ", - "MULQ", - "NEGQ", - "NOTQ", - "ORQ", - "POPFQ", - "POPQ", - "PUSHFQ", - "PUSHQ", - "RCLQ", - "RCRQ", - "ROLQ", - "RORQ", - "QUAD", - "SALQ", - "SARQ", - "SBBQ", - "SCASQ", - "SHLQ", - "SHRQ", - "STOSQ", - "SUBQ", - "TESTQ", - "XADDQ", - "XCHGQ", - "XORQ", - "XGETBV", - "ADDPD", - "ADDPS", - "ADDSD", - "ADDSS", - "ANDNL", - "ANDNQ", - "ANDNPD", - "ANDNPS", - "ANDPD", - "ANDPS", - "BEXTRL", - "BEXTRQ", - "BLSIL", - "BLSIQ", - "BLSMSKL", - "BLSMSKQ", - "BLSRL", - "BLSRQ", - "BZHIL", - "BZHIQ", - "CMPPD", - "CMPPS", - "CMPSD", - "CMPSS", - "COMISD", - "COMISS", - "CVTPD2PL", - "CVTPD2PS", - "CVTPL2PD", - "CVTPL2PS", - "CVTPS2PD", - "CVTPS2PL", - "CVTSD2SL", - "CVTSD2SQ", - "CVTSD2SS", - "CVTSL2SD", - "CVTSL2SS", - "CVTSQ2SD", - "CVTSQ2SS", - "CVTSS2SD", - "CVTSS2SL", - "CVTSS2SQ", - "CVTTPD2PL", - "CVTTPS2PL", - "CVTTSD2SL", - "CVTTSD2SQ", - "CVTTSS2SL", - "CVTTSS2SQ", - "DIVPD", - "DIVPS", - "DIVSD", - "DIVSS", - "EMMS", - "FXRSTOR", - "FXRSTOR64", - "FXSAVE", - "FXSAVE64", - "LDDQU", - "LDMXCSR", - "MASKMOVOU", - "MASKMOVQ", - "MAXPD", - "MAXPS", - "MAXSD", - "MAXSS", - "MINPD", - "MINPS", - "MINSD", - "MINSS", - "MOVAPD", - "MOVAPS", - "MOVOU", - "MOVHLPS", - "MOVHPD", - "MOVHPS", - "MOVLHPS", - "MOVLPD", - "MOVLPS", - "MOVMSKPD", - "MOVMSKPS", - "MOVNTO", - "MOVNTPD", - "MOVNTPS", - "MOVNTQ", - "MOVO", - "MOVQOZX", - "MOVSD", - "MOVSS", - "MOVUPD", - "MOVUPS", - "MULPD", - "MULPS", - "MULSD", - "MULSS", - "MULXL", - "MULXQ", - "ORPD", - "ORPS", - "PACKSSLW", - "PACKSSWB", - "PACKUSWB", - "PADDB", - "PADDL", - "PADDQ", - "PADDSB", - "PADDSW", - "PADDUSB", - "PADDUSW", - "PADDW", - "PAND", - "PANDN", - "PAVGB", - "PAVGW", - "PCMPEQB", - "PCMPEQL", - "PCMPEQW", - "PCMPGTB", - "PCMPGTL", - "PCMPGTW", - "PDEPL", - "PDEPQ", - "PEXTL", - "PEXTQ", - "PEXTRB", - "PEXTRD", - "PEXTRQ", - "PEXTRW", - "PHADDD", - "PHADDSW", - "PHADDW", - "PHMINPOSUW", - "PHSUBD", - "PHSUBSW", - "PHSUBW", - "PINSRB", - "PINSRD", - "PINSRQ", - "PINSRW", - "PMADDWL", - "PMAXSW", - "PMAXUB", - "PMINSW", - "PMINUB", - "PMOVMSKB", - "PMOVSXBD", - "PMOVSXBQ", - "PMOVSXBW", - "PMOVSXDQ", - "PMOVSXWD", - "PMOVSXWQ", - "PMOVZXBD", - "PMOVZXBQ", - "PMOVZXBW", - "PMOVZXDQ", - "PMOVZXWD", - "PMOVZXWQ", - "PMULDQ", - "PMULHUW", - "PMULHW", - "PMULLD", - "PMULLW", - "PMULULQ", - "POR", - "PSADBW", - "PSHUFB", - "PSHUFHW", - "PSHUFL", - "PSHUFLW", - "PSHUFW", - "PSLLL", - "PSLLO", - "PSLLQ", - "PSLLW", - "PSRAL", - "PSRAW", - "PSRLL", - "PSRLO", - "PSRLQ", - "PSRLW", - "PSUBB", - "PSUBL", - "PSUBQ", - "PSUBSB", - "PSUBSW", - "PSUBUSB", - "PSUBUSW", - "PSUBW", - "PUNPCKHBW", - "PUNPCKHLQ", - "PUNPCKHQDQ", - "PUNPCKHWL", - "PUNPCKLBW", - "PUNPCKLLQ", - "PUNPCKLQDQ", - "PUNPCKLWL", - "PXOR", - "RCPPS", - "RCPSS", - "RSQRTPS", - "RSQRTSS", - "SARXL", - "SARXQ", - "SHLXL", - "SHLXQ", - "SHRXL", - "SHRXQ", - "SHUFPD", - "SHUFPS", - "SQRTPD", - "SQRTPS", - "SQRTSD", - "SQRTSS", - "STMXCSR", - "SUBPD", - "SUBPS", - "SUBSD", - "SUBSS", - "UCOMISD", - "UCOMISS", - "UNPCKHPD", - "UNPCKHPS", - "UNPCKLPD", - "UNPCKLPS", - "XORPD", - "XORPS", - "PCMPESTRI", - "RETFW", - "RETFL", - "RETFQ", - "SWAPGS", - "MODE", - "CRC32B", - "CRC32Q", - "IMUL3Q", - "PREFETCHT0", - "PREFETCHT1", - "PREFETCHT2", - "PREFETCHNTA", - "MOVQL", - "BSWAPL", - "BSWAPQ", - "AESENC", - "AESENCLAST", - "AESDEC", - "AESDECLAST", - "AESIMC", - "AESKEYGENASSIST", - "ROUNDPS", - "ROUNDSS", - "ROUNDPD", - "ROUNDSD", - "MOVDDUP", - "MOVSHDUP", - "MOVSLDUP", - "PSHUFD", - "PCLMULQDQ", - "VZEROUPPER", - "VMOVDQU", - "VMOVNTDQ", - "VMOVDQA", - "VPCMPEQB", - "VPXOR", - "VPMOVMSKB", - "VPAND", - "VPTEST", - "VPBROADCASTB", - "VPSHUFB", - "VPSHUFD", - "VPERM2F128", - "VPALIGNR", - "VPADDQ", - "VPADDD", - "VPSRLDQ", - "VPSLLDQ", - "VPSRLQ", - "VPSLLQ", - "VPSRLD", - "VPSLLD", - "VPOR", - "VPBLENDD", - "VINSERTI128", - "VPERM2I128", - "RORXL", - "RORXQ", - "VBROADCASTSS", - "VBROADCASTSD", - "VMOVDDUP", - "VMOVSHDUP", - "VMOVSLDUP", - "JCXZW", - "FCMOVCC", - "FCMOVCS", - "FCMOVEQ", - "FCMOVHI", - "FCMOVLS", - "FCMOVNE", - "FCMOVNU", - "FCMOVUN", - "FCOMI", - "FCOMIP", - "FUCOMI", - "FUCOMIP", - "XACQUIRE", - "XRELEASE", - "XBEGIN", - "XEND", - "XABORT", - "XTEST", - "LAST", -} diff --git a/vendor/github.com/google/gops/internal/obj/x86/asm6.go b/vendor/github.com/google/gops/internal/obj/x86/asm6.go deleted file mode 100644 index d5462b8a..00000000 --- a/vendor/github.com/google/gops/internal/obj/x86/asm6.go +++ /dev/null @@ -1,4536 +0,0 @@ -// Inferno utils/6l/span.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/span.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package x86 - -import ( - "encoding/binary" - "fmt" - "log" - "strings" - - "github.com/google/gops/internal/obj" -) - -// Instruction layout. - -const ( - // Loop alignment constants: - // want to align loop entry to LoopAlign-byte boundary, - // and willing to insert at most MaxLoopPad bytes of NOP to do so. - // We define a loop entry as the target of a backward jump. - // - // gcc uses MaxLoopPad = 10 for its 'generic x86-64' config, - // and it aligns all jump targets, not just backward jump targets. - // - // As of 6/1/2012, the effect of setting MaxLoopPad = 10 here - // is very slight but negative, so the alignment is disabled by - // setting MaxLoopPad = 0. The code is here for reference and - // for future experiments. - // - LoopAlign = 16 - MaxLoopPad = 0 - funcAlign = 16 -) - -type Optab struct { - as obj.As - ytab []ytab - prefix uint8 - op [23]uint8 -} - -type ytab struct { - from uint8 - from3 uint8 - to uint8 - zcase uint8 - zoffset uint8 -} - -type Movtab struct { - as obj.As - ft uint8 - f3t uint8 - tt uint8 - code uint8 - op [4]uint8 -} - -const ( - Yxxx = iota - Ynone - Yi0 // $0 - Yi1 // $1 - Yi8 // $x, x fits in int8 - Yu8 // $x, x fits in uint8 - Yu7 // $x, x in 0..127 (fits in both int8 and uint8) - Ys32 - Yi32 - Yi64 - Yiauto - Yal - Ycl - Yax - Ycx - Yrb - Yrl - Yrl32 // Yrl on 32-bit system - Yrf - Yf0 - Yrx - Ymb - Yml - Ym - Ybr - Ycs - Yss - Yds - Yes - Yfs - Ygs - Ygdtr - Yidtr - Yldtr - Ymsw - Ytask - Ycr0 - Ycr1 - Ycr2 - Ycr3 - Ycr4 - Ycr5 - Ycr6 - Ycr7 - Ycr8 - Ydr0 - Ydr1 - Ydr2 - Ydr3 - Ydr4 - Ydr5 - Ydr6 - Ydr7 - Ytr0 - Ytr1 - Ytr2 - Ytr3 - Ytr4 - Ytr5 - Ytr6 - Ytr7 - Ymr - Ymm - Yxr - Yxm - Yyr - Yym - Ytls - Ytextsize - Yindir - Ymax -) - -const ( - Zxxx = iota - Zlit - Zlitm_r - Z_rp - Zbr - Zcall - Zcallcon - Zcallduff - Zcallind - Zcallindreg - Zib_ - Zib_rp - Zibo_m - Zibo_m_xm - Zil_ - Zil_rp - Ziq_rp - Zilo_m - Zjmp - Zjmpcon - Zloop - Zo_iw - Zm_o - Zm_r - Zm2_r - Zm_r_xm - Zm_r_i_xm - Zm_r_xm_nr - Zr_m_xm_nr - Zibm_r /* mmx1,mmx2/mem64,imm8 */ - Zibr_m - Zmb_r - Zaut_r - Zo_m - Zo_m64 - Zpseudo - Zr_m - Zr_m_xm - Zrp_ - Z_ib - Z_il - Zm_ibo - Zm_ilo - Zib_rr - Zil_rr - Zclr - Zbyte - Zvex_rm_v_r - Zvex_r_v_rm - Zvex_v_rm_r - Zvex_i_rm_r - Zvex_i_r_v - Zvex_i_rm_v_r - Zmax -) - -const ( - Px = 0 - Px1 = 1 // symbolic; exact value doesn't matter - P32 = 0x32 /* 32-bit only */ - Pe = 0x66 /* operand escape */ - Pm = 0x0f /* 2byte opcode escape */ - Pq = 0xff /* both escapes: 66 0f */ - Pb = 0xfe /* byte operands */ - Pf2 = 0xf2 /* xmm escape 1: f2 0f */ - Pf3 = 0xf3 /* xmm escape 2: f3 0f */ - Pef3 = 0xf5 /* xmm escape 2 with 16-bit prefix: 66 f3 0f */ - Pq3 = 0x67 /* xmm escape 3: 66 48 0f */ - Pq4 = 0x68 /* xmm escape 4: 66 0F 38 */ - Pfw = 0xf4 /* Pf3 with Rex.w: f3 48 0f */ - Pw = 0x48 /* Rex.w */ - Pw8 = 0x90 // symbolic; exact value doesn't matter - Py = 0x80 /* defaults to 64-bit mode */ - Py1 = 0x81 // symbolic; exact value doesn't matter - Py3 = 0x83 // symbolic; exact value doesn't matter - Pvex = 0x84 // symbolic: exact value doesn't matter - - Rxw = 1 << 3 /* =1, 64-bit operand size */ - Rxr = 1 << 2 /* extend modrm reg */ - Rxx = 1 << 1 /* extend sib index */ - Rxb = 1 << 0 /* extend modrm r/m, sib base, or opcode reg */ -) - -const ( - // Encoding for VEX prefix in tables. - // The P, L, and W fields are chosen to match - // their eventual locations in the VEX prefix bytes. - - // P field - 2 bits - vex66 = 1 << 0 - vexF3 = 2 << 0 - vexF2 = 3 << 0 - // L field - 1 bit - vexLZ = 0 << 2 - vexLIG = 0 << 2 - vex128 = 0 << 2 - vex256 = 1 << 2 - // W field - 1 bit - vexWIG = 0 << 7 - vexW0 = 0 << 7 - vexW1 = 1 << 7 - // M field - 5 bits, but mostly reserved; we can store up to 4 - vex0F = 1 << 3 - vex0F38 = 2 << 3 - vex0F3A = 3 << 3 - - // Combinations used in the manual. - VEX_128_0F_WIG = vex128 | vex0F | vexWIG - VEX_128_66_0F_W0 = vex128 | vex66 | vex0F | vexW0 - VEX_128_66_0F_W1 = vex128 | vex66 | vex0F | vexW1 - VEX_128_66_0F_WIG = vex128 | vex66 | vex0F | vexWIG - VEX_128_66_0F38_W0 = vex128 | vex66 | vex0F38 | vexW0 - VEX_128_66_0F38_W1 = vex128 | vex66 | vex0F38 | vexW1 - VEX_128_66_0F38_WIG = vex128 | vex66 | vex0F38 | vexWIG - VEX_128_66_0F3A_W0 = vex128 | vex66 | vex0F3A | vexW0 - VEX_128_66_0F3A_W1 = vex128 | vex66 | vex0F3A | vexW1 - VEX_128_66_0F3A_WIG = vex128 | vex66 | vex0F3A | vexWIG - VEX_128_F2_0F_WIG = vex128 | vexF2 | vex0F | vexWIG - VEX_128_F3_0F_WIG = vex128 | vexF3 | vex0F | vexWIG - VEX_256_66_0F_WIG = vex256 | vex66 | vex0F | vexWIG - VEX_256_66_0F38_W0 = vex256 | vex66 | vex0F38 | vexW0 - VEX_256_66_0F38_W1 = vex256 | vex66 | vex0F38 | vexW1 - VEX_256_66_0F38_WIG = vex256 | vex66 | vex0F38 | vexWIG - VEX_256_66_0F3A_W0 = vex256 | vex66 | vex0F3A | vexW0 - VEX_256_66_0F3A_W1 = vex256 | vex66 | vex0F3A | vexW1 - VEX_256_66_0F3A_WIG = vex256 | vex66 | vex0F3A | vexWIG - VEX_256_F2_0F_WIG = vex256 | vexF2 | vex0F | vexWIG - VEX_256_F3_0F_WIG = vex256 | vexF3 | vex0F | vexWIG - VEX_LIG_0F_WIG = vexLIG | vex0F | vexWIG - VEX_LIG_66_0F_WIG = vexLIG | vex66 | vex0F | vexWIG - VEX_LIG_66_0F38_W0 = vexLIG | vex66 | vex0F38 | vexW0 - VEX_LIG_66_0F38_W1 = vexLIG | vex66 | vex0F38 | vexW1 - VEX_LIG_66_0F3A_WIG = vexLIG | vex66 | vex0F3A | vexWIG - VEX_LIG_F2_0F_W0 = vexLIG | vexF2 | vex0F | vexW0 - VEX_LIG_F2_0F_W1 = vexLIG | vexF2 | vex0F | vexW1 - VEX_LIG_F2_0F_WIG = vexLIG | vexF2 | vex0F | vexWIG - VEX_LIG_F3_0F_W0 = vexLIG | vexF3 | vex0F | vexW0 - VEX_LIG_F3_0F_W1 = vexLIG | vexF3 | vex0F | vexW1 - VEX_LIG_F3_0F_WIG = vexLIG | vexF3 | vex0F | vexWIG - VEX_LZ_0F_WIG = vexLZ | vex0F | vexWIG - VEX_LZ_0F38_W0 = vexLZ | vex0F38 | vexW0 - VEX_LZ_0F38_W1 = vexLZ | vex0F38 | vexW1 - VEX_LZ_66_0F38_W0 = vexLZ | vex66 | vex0F38 | vexW0 - VEX_LZ_66_0F38_W1 = vexLZ | vex66 | vex0F38 | vexW1 - VEX_LZ_F2_0F38_W0 = vexLZ | vexF2 | vex0F38 | vexW0 - VEX_LZ_F2_0F38_W1 = vexLZ | vexF2 | vex0F38 | vexW1 - VEX_LZ_F2_0F3A_W0 = vexLZ | vexF2 | vex0F3A | vexW0 - VEX_LZ_F2_0F3A_W1 = vexLZ | vexF2 | vex0F3A | vexW1 - VEX_LZ_F3_0F38_W0 = vexLZ | vexF3 | vex0F38 | vexW0 - VEX_LZ_F3_0F38_W1 = vexLZ | vexF3 | vex0F38 | vexW1 -) - -var ycover [Ymax * Ymax]uint8 - -var reg [MAXREG]int - -var regrex [MAXREG + 1]int - -var ynone = []ytab{ - {Ynone, Ynone, Ynone, Zlit, 1}, -} - -var ytext = []ytab{ - {Ymb, Ynone, Ytextsize, Zpseudo, 0}, - {Ymb, Yi32, Ytextsize, Zpseudo, 1}, -} - -var ynop = []ytab{ - {Ynone, Ynone, Ynone, Zpseudo, 0}, - {Ynone, Ynone, Yiauto, Zpseudo, 0}, - {Ynone, Ynone, Yml, Zpseudo, 0}, - {Ynone, Ynone, Yrf, Zpseudo, 0}, - {Ynone, Ynone, Yxr, Zpseudo, 0}, - {Yiauto, Ynone, Ynone, Zpseudo, 0}, - {Yml, Ynone, Ynone, Zpseudo, 0}, - {Yrf, Ynone, Ynone, Zpseudo, 0}, - {Yxr, Ynone, Ynone, Zpseudo, 1}, -} - -var yfuncdata = []ytab{ - {Yi32, Ynone, Ym, Zpseudo, 0}, -} - -var ypcdata = []ytab{ - {Yi32, Ynone, Yi32, Zpseudo, 0}, -} - -var yxorb = []ytab{ - {Yi32, Ynone, Yal, Zib_, 1}, - {Yi32, Ynone, Ymb, Zibo_m, 2}, - {Yrb, Ynone, Ymb, Zr_m, 1}, - {Ymb, Ynone, Yrb, Zm_r, 1}, -} - -var yaddl = []ytab{ - {Yi8, Ynone, Yml, Zibo_m, 2}, - {Yi32, Ynone, Yax, Zil_, 1}, - {Yi32, Ynone, Yml, Zilo_m, 2}, - {Yrl, Ynone, Yml, Zr_m, 1}, - {Yml, Ynone, Yrl, Zm_r, 1}, -} - -var yincl = []ytab{ - {Ynone, Ynone, Yrl, Z_rp, 1}, - {Ynone, Ynone, Yml, Zo_m, 2}, -} - -var yincq = []ytab{ - {Ynone, Ynone, Yml, Zo_m, 2}, -} - -var ycmpb = []ytab{ - {Yal, Ynone, Yi32, Z_ib, 1}, - {Ymb, Ynone, Yi32, Zm_ibo, 2}, - {Ymb, Ynone, Yrb, Zm_r, 1}, - {Yrb, Ynone, Ymb, Zr_m, 1}, -} - -var ycmpl = []ytab{ - {Yml, Ynone, Yi8, Zm_ibo, 2}, - {Yax, Ynone, Yi32, Z_il, 1}, - {Yml, Ynone, Yi32, Zm_ilo, 2}, - {Yml, Ynone, Yrl, Zm_r, 1}, - {Yrl, Ynone, Yml, Zr_m, 1}, -} - -var yshb = []ytab{ - {Yi1, Ynone, Ymb, Zo_m, 2}, - {Yi32, Ynone, Ymb, Zibo_m, 2}, - {Ycx, Ynone, Ymb, Zo_m, 2}, -} - -var yshl = []ytab{ - {Yi1, Ynone, Yml, Zo_m, 2}, - {Yi32, Ynone, Yml, Zibo_m, 2}, - {Ycl, Ynone, Yml, Zo_m, 2}, - {Ycx, Ynone, Yml, Zo_m, 2}, -} - -var ytestl = []ytab{ - {Yi32, Ynone, Yax, Zil_, 1}, - {Yi32, Ynone, Yml, Zilo_m, 2}, - {Yrl, Ynone, Yml, Zr_m, 1}, - {Yml, Ynone, Yrl, Zm_r, 1}, -} - -var ymovb = []ytab{ - {Yrb, Ynone, Ymb, Zr_m, 1}, - {Ymb, Ynone, Yrb, Zm_r, 1}, - {Yi32, Ynone, Yrb, Zib_rp, 1}, - {Yi32, Ynone, Ymb, Zibo_m, 2}, -} - -var ybtl = []ytab{ - {Yi8, Ynone, Yml, Zibo_m, 2}, - {Yrl, Ynone, Yml, Zr_m, 1}, -} - -var ymovw = []ytab{ - {Yrl, Ynone, Yml, Zr_m, 1}, - {Yml, Ynone, Yrl, Zm_r, 1}, - {Yi0, Ynone, Yrl, Zclr, 1}, - {Yi32, Ynone, Yrl, Zil_rp, 1}, - {Yi32, Ynone, Yml, Zilo_m, 2}, - {Yiauto, Ynone, Yrl, Zaut_r, 2}, -} - -var ymovl = []ytab{ - {Yrl, Ynone, Yml, Zr_m, 1}, - {Yml, Ynone, Yrl, Zm_r, 1}, - {Yi0, Ynone, Yrl, Zclr, 1}, - {Yi32, Ynone, Yrl, Zil_rp, 1}, - {Yi32, Ynone, Yml, Zilo_m, 2}, - {Yml, Ynone, Ymr, Zm_r_xm, 1}, // MMX MOVD - {Ymr, Ynone, Yml, Zr_m_xm, 1}, // MMX MOVD - {Yml, Ynone, Yxr, Zm_r_xm, 2}, // XMM MOVD (32 bit) - {Yxr, Ynone, Yml, Zr_m_xm, 2}, // XMM MOVD (32 bit) - {Yiauto, Ynone, Yrl, Zaut_r, 2}, -} - -var yret = []ytab{ - {Ynone, Ynone, Ynone, Zo_iw, 1}, - {Yi32, Ynone, Ynone, Zo_iw, 1}, -} - -var ymovq = []ytab{ - // valid in 32-bit mode - {Ym, Ynone, Ymr, Zm_r_xm_nr, 1}, // 0x6f MMX MOVQ (shorter encoding) - {Ymr, Ynone, Ym, Zr_m_xm_nr, 1}, // 0x7f MMX MOVQ - {Yxr, Ynone, Ymr, Zm_r_xm_nr, 2}, // Pf2, 0xd6 MOVDQ2Q - {Yxm, Ynone, Yxr, Zm_r_xm_nr, 2}, // Pf3, 0x7e MOVQ xmm1/m64 -> xmm2 - {Yxr, Ynone, Yxm, Zr_m_xm_nr, 2}, // Pe, 0xd6 MOVQ xmm1 -> xmm2/m64 - - // valid only in 64-bit mode, usually with 64-bit prefix - {Yrl, Ynone, Yml, Zr_m, 1}, // 0x89 - {Yml, Ynone, Yrl, Zm_r, 1}, // 0x8b - {Yi0, Ynone, Yrl, Zclr, 1}, // 0x31 - {Ys32, Ynone, Yrl, Zilo_m, 2}, // 32 bit signed 0xc7,(0) - {Yi64, Ynone, Yrl, Ziq_rp, 1}, // 0xb8 -- 32/64 bit immediate - {Yi32, Ynone, Yml, Zilo_m, 2}, // 0xc7,(0) - {Ymm, Ynone, Ymr, Zm_r_xm, 1}, // 0x6e MMX MOVD - {Ymr, Ynone, Ymm, Zr_m_xm, 1}, // 0x7e MMX MOVD - {Yml, Ynone, Yxr, Zm_r_xm, 2}, // Pe, 0x6e MOVD xmm load - {Yxr, Ynone, Yml, Zr_m_xm, 2}, // Pe, 0x7e MOVD xmm store - {Yiauto, Ynone, Yrl, Zaut_r, 1}, // 0 built-in LEAQ -} - -var ym_rl = []ytab{ - {Ym, Ynone, Yrl, Zm_r, 1}, -} - -var yrl_m = []ytab{ - {Yrl, Ynone, Ym, Zr_m, 1}, -} - -var ymb_rl = []ytab{ - {Ymb, Ynone, Yrl, Zmb_r, 1}, -} - -var yml_rl = []ytab{ - {Yml, Ynone, Yrl, Zm_r, 1}, -} - -var yrl_ml = []ytab{ - {Yrl, Ynone, Yml, Zr_m, 1}, -} - -var yml_mb = []ytab{ - {Yrb, Ynone, Ymb, Zr_m, 1}, - {Ymb, Ynone, Yrb, Zm_r, 1}, -} - -var yrb_mb = []ytab{ - {Yrb, Ynone, Ymb, Zr_m, 1}, -} - -var yxchg = []ytab{ - {Yax, Ynone, Yrl, Z_rp, 1}, - {Yrl, Ynone, Yax, Zrp_, 1}, - {Yrl, Ynone, Yml, Zr_m, 1}, - {Yml, Ynone, Yrl, Zm_r, 1}, -} - -var ydivl = []ytab{ - {Yml, Ynone, Ynone, Zm_o, 2}, -} - -var ydivb = []ytab{ - {Ymb, Ynone, Ynone, Zm_o, 2}, -} - -var yimul = []ytab{ - {Yml, Ynone, Ynone, Zm_o, 2}, - {Yi8, Ynone, Yrl, Zib_rr, 1}, - {Yi32, Ynone, Yrl, Zil_rr, 1}, - {Yml, Ynone, Yrl, Zm_r, 2}, -} - -var yimul3 = []ytab{ - {Yi8, Yml, Yrl, Zibm_r, 2}, -} - -var ybyte = []ytab{ - {Yi64, Ynone, Ynone, Zbyte, 1}, -} - -var yin = []ytab{ - {Yi32, Ynone, Ynone, Zib_, 1}, - {Ynone, Ynone, Ynone, Zlit, 1}, -} - -var yint = []ytab{ - {Yi32, Ynone, Ynone, Zib_, 1}, -} - -var ypushl = []ytab{ - {Yrl, Ynone, Ynone, Zrp_, 1}, - {Ym, Ynone, Ynone, Zm_o, 2}, - {Yi8, Ynone, Ynone, Zib_, 1}, - {Yi32, Ynone, Ynone, Zil_, 1}, -} - -var ypopl = []ytab{ - {Ynone, Ynone, Yrl, Z_rp, 1}, - {Ynone, Ynone, Ym, Zo_m, 2}, -} - -var ybswap = []ytab{ - {Ynone, Ynone, Yrl, Z_rp, 2}, -} - -var yscond = []ytab{ - {Ynone, Ynone, Ymb, Zo_m, 2}, -} - -var yjcond = []ytab{ - {Ynone, Ynone, Ybr, Zbr, 0}, - {Yi0, Ynone, Ybr, Zbr, 0}, - {Yi1, Ynone, Ybr, Zbr, 1}, -} - -var yloop = []ytab{ - {Ynone, Ynone, Ybr, Zloop, 1}, -} - -var ycall = []ytab{ - {Ynone, Ynone, Yml, Zcallindreg, 0}, - {Yrx, Ynone, Yrx, Zcallindreg, 2}, - {Ynone, Ynone, Yindir, Zcallind, 2}, - {Ynone, Ynone, Ybr, Zcall, 0}, - {Ynone, Ynone, Yi32, Zcallcon, 1}, -} - -var yduff = []ytab{ - {Ynone, Ynone, Yi32, Zcallduff, 1}, -} - -var yjmp = []ytab{ - {Ynone, Ynone, Yml, Zo_m64, 2}, - {Ynone, Ynone, Ybr, Zjmp, 0}, - {Ynone, Ynone, Yi32, Zjmpcon, 1}, -} - -var yfmvd = []ytab{ - {Ym, Ynone, Yf0, Zm_o, 2}, - {Yf0, Ynone, Ym, Zo_m, 2}, - {Yrf, Ynone, Yf0, Zm_o, 2}, - {Yf0, Ynone, Yrf, Zo_m, 2}, -} - -var yfmvdp = []ytab{ - {Yf0, Ynone, Ym, Zo_m, 2}, - {Yf0, Ynone, Yrf, Zo_m, 2}, -} - -var yfmvf = []ytab{ - {Ym, Ynone, Yf0, Zm_o, 2}, - {Yf0, Ynone, Ym, Zo_m, 2}, -} - -var yfmvx = []ytab{ - {Ym, Ynone, Yf0, Zm_o, 2}, -} - -var yfmvp = []ytab{ - {Yf0, Ynone, Ym, Zo_m, 2}, -} - -var yfcmv = []ytab{ - {Yrf, Ynone, Yf0, Zm_o, 2}, -} - -var yfadd = []ytab{ - {Ym, Ynone, Yf0, Zm_o, 2}, - {Yrf, Ynone, Yf0, Zm_o, 2}, - {Yf0, Ynone, Yrf, Zo_m, 2}, -} - -var yfxch = []ytab{ - {Yf0, Ynone, Yrf, Zo_m, 2}, - {Yrf, Ynone, Yf0, Zm_o, 2}, -} - -var ycompp = []ytab{ - {Yf0, Ynone, Yrf, Zo_m, 2}, /* botch is really f0,f1 */ -} - -var ystsw = []ytab{ - {Ynone, Ynone, Ym, Zo_m, 2}, - {Ynone, Ynone, Yax, Zlit, 1}, -} - -var ysvrs = []ytab{ - {Ynone, Ynone, Ym, Zo_m, 2}, - {Ym, Ynone, Ynone, Zm_o, 2}, -} - -var ymm = []ytab{ - {Ymm, Ynone, Ymr, Zm_r_xm, 1}, - {Yxm, Ynone, Yxr, Zm_r_xm, 2}, -} - -var yxm = []ytab{ - {Yxm, Ynone, Yxr, Zm_r_xm, 1}, -} - -var yxm_q4 = []ytab{ - {Yxm, Ynone, Yxr, Zm_r, 1}, -} - -var yxcvm1 = []ytab{ - {Yxm, Ynone, Yxr, Zm_r_xm, 2}, - {Yxm, Ynone, Ymr, Zm_r_xm, 2}, -} - -var yxcvm2 = []ytab{ - {Yxm, Ynone, Yxr, Zm_r_xm, 2}, - {Ymm, Ynone, Yxr, Zm_r_xm, 2}, -} - -var yxr = []ytab{ - {Yxr, Ynone, Yxr, Zm_r_xm, 1}, -} - -var yxr_ml = []ytab{ - {Yxr, Ynone, Yml, Zr_m_xm, 1}, -} - -var ymr = []ytab{ - {Ymr, Ynone, Ymr, Zm_r, 1}, -} - -var ymr_ml = []ytab{ - {Ymr, Ynone, Yml, Zr_m_xm, 1}, -} - -var yxcmpi = []ytab{ - {Yxm, Yxr, Yi8, Zm_r_i_xm, 2}, -} - -var yxmov = []ytab{ - {Yxm, Ynone, Yxr, Zm_r_xm, 1}, - {Yxr, Ynone, Yxm, Zr_m_xm, 1}, -} - -var yxcvfl = []ytab{ - {Yxm, Ynone, Yrl, Zm_r_xm, 1}, -} - -var yxcvlf = []ytab{ - {Yml, Ynone, Yxr, Zm_r_xm, 1}, -} - -var yxcvfq = []ytab{ - {Yxm, Ynone, Yrl, Zm_r_xm, 2}, -} - -var yxcvqf = []ytab{ - {Yml, Ynone, Yxr, Zm_r_xm, 2}, -} - -var yps = []ytab{ - {Ymm, Ynone, Ymr, Zm_r_xm, 1}, - {Yi8, Ynone, Ymr, Zibo_m_xm, 2}, - {Yxm, Ynone, Yxr, Zm_r_xm, 2}, - {Yi8, Ynone, Yxr, Zibo_m_xm, 3}, -} - -var yxrrl = []ytab{ - {Yxr, Ynone, Yrl, Zm_r, 1}, -} - -var ymrxr = []ytab{ - {Ymr, Ynone, Yxr, Zm_r, 1}, - {Yxm, Ynone, Yxr, Zm_r_xm, 1}, -} - -var ymshuf = []ytab{ - {Yi8, Ymm, Ymr, Zibm_r, 2}, -} - -var ymshufb = []ytab{ - {Yxm, Ynone, Yxr, Zm2_r, 2}, -} - -var yxshuf = []ytab{ - {Yu8, Yxm, Yxr, Zibm_r, 2}, -} - -var yextrw = []ytab{ - {Yu8, Yxr, Yrl, Zibm_r, 2}, -} - -var yextr = []ytab{ - {Yu8, Yxr, Ymm, Zibr_m, 3}, -} - -var yinsrw = []ytab{ - {Yu8, Yml, Yxr, Zibm_r, 2}, -} - -var yinsr = []ytab{ - {Yu8, Ymm, Yxr, Zibm_r, 3}, -} - -var ypsdq = []ytab{ - {Yi8, Ynone, Yxr, Zibo_m, 2}, -} - -var ymskb = []ytab{ - {Yxr, Ynone, Yrl, Zm_r_xm, 2}, - {Ymr, Ynone, Yrl, Zm_r_xm, 1}, -} - -var ycrc32l = []ytab{ - {Yml, Ynone, Yrl, Zlitm_r, 0}, -} - -var yprefetch = []ytab{ - {Ym, Ynone, Ynone, Zm_o, 2}, -} - -var yaes = []ytab{ - {Yxm, Ynone, Yxr, Zlitm_r, 2}, -} - -var yxbegin = []ytab{ - {Ynone, Ynone, Ybr, Zjmp, 1}, -} - -var yxabort = []ytab{ - {Yu8, Ynone, Ynone, Zib_, 1}, -} - -var ylddqu = []ytab{ - {Ym, Ynone, Yxr, Zm_r, 1}, -} - -// VEX instructions that come in two forms: -// VTHING xmm2/m128, xmmV, xmm1 -// VTHING ymm2/m256, ymmV, ymm1 -// The opcode array in the corresponding Optab entry -// should contain the (VEX prefixes, opcode byte) pair -// for each of the two forms. -// For example, the entries for VPXOR are: -// -// VPXOR xmm2/m128, xmmV, xmm1 -// VEX.NDS.128.66.0F.WIG EF /r -// -// VPXOR ymm2/m256, ymmV, ymm1 -// VEX.NDS.256.66.0F.WIG EF /r -// -// The NDS/NDD/DDS part can be dropped, producing this -// Optab entry: -// -// {AVPXOR, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xEF, VEX_256_66_0F_WIG, 0xEF}} -// -var yvex_xy3 = []ytab{ - {Yxm, Yxr, Yxr, Zvex_rm_v_r, 2}, - {Yym, Yyr, Yyr, Zvex_rm_v_r, 2}, -} - -var yvex_ri3 = []ytab{ - {Yi8, Ymb, Yrl, Zvex_i_rm_r, 2}, -} - -var yvex_xyi3 = []ytab{ - {Yu8, Yxm, Yxr, Zvex_i_rm_r, 2}, - {Yu8, Yym, Yyr, Zvex_i_rm_r, 2}, - {Yi8, Yxm, Yxr, Zvex_i_rm_r, 2}, - {Yi8, Yym, Yyr, Zvex_i_rm_r, 2}, -} - -var yvex_yyi4 = []ytab{ //TODO don't hide 4 op, some version have xmm version - {Yym, Yyr, Yyr, Zvex_i_rm_v_r, 2}, -} - -var yvex_xyi4 = []ytab{ - {Yxm, Yyr, Yyr, Zvex_i_rm_v_r, 2}, -} - -var yvex_shift = []ytab{ - {Yi8, Yxr, Yxr, Zvex_i_r_v, 3}, - {Yi8, Yyr, Yyr, Zvex_i_r_v, 3}, - {Yxm, Yxr, Yxr, Zvex_rm_v_r, 2}, - {Yxm, Yyr, Yyr, Zvex_rm_v_r, 2}, -} - -var yvex_shift_dq = []ytab{ - {Yi8, Yxr, Yxr, Zvex_i_r_v, 3}, - {Yi8, Yyr, Yyr, Zvex_i_r_v, 3}, -} - -var yvex_r3 = []ytab{ - {Yml, Yrl, Yrl, Zvex_rm_v_r, 2}, -} - -var yvex_vmr3 = []ytab{ - {Yrl, Yml, Yrl, Zvex_v_rm_r, 2}, -} - -var yvex_xy2 = []ytab{ - {Yxm, Ynone, Yxr, Zvex_rm_v_r, 2}, - {Yym, Ynone, Yyr, Zvex_rm_v_r, 2}, -} - -var yvex_xyr2 = []ytab{ - {Yxr, Ynone, Yrl, Zvex_rm_v_r, 2}, - {Yyr, Ynone, Yrl, Zvex_rm_v_r, 2}, -} - -var yvex_vmovdqa = []ytab{ - {Yxm, Ynone, Yxr, Zvex_rm_v_r, 2}, - {Yxr, Ynone, Yxm, Zvex_r_v_rm, 2}, - {Yym, Ynone, Yyr, Zvex_rm_v_r, 2}, - {Yyr, Ynone, Yym, Zvex_r_v_rm, 2}, -} - -var yvex_vmovntdq = []ytab{ - {Yxr, Ynone, Ym, Zvex_r_v_rm, 2}, - {Yyr, Ynone, Ym, Zvex_r_v_rm, 2}, -} - -var yvex_vpbroadcast = []ytab{ - {Yxm, Ynone, Yxr, Zvex_rm_v_r, 2}, - {Yxm, Ynone, Yyr, Zvex_rm_v_r, 2}, -} - -var yvex_vpbroadcast_sd = []ytab{ - {Yxm, Ynone, Yyr, Zvex_rm_v_r, 2}, -} - -var ymmxmm0f38 = []ytab{ - {Ymm, Ynone, Ymr, Zlitm_r, 3}, - {Yxm, Ynone, Yxr, Zlitm_r, 5}, -} - -/* - * You are doasm, holding in your hand a Prog* with p->as set to, say, ACRC32, - * and p->from and p->to as operands (Addr*). The linker scans optab to find - * the entry with the given p->as and then looks through the ytable for that - * instruction (the second field in the optab struct) for a line whose first - * two values match the Ytypes of the p->from and p->to operands. The function - * oclass in span.c computes the specific Ytype of an operand and then the set - * of more general Ytypes that it satisfies is implied by the ycover table, set - * up in instinit. For example, oclass distinguishes the constants 0 and 1 - * from the more general 8-bit constants, but instinit says - * - * ycover[Yi0*Ymax + Ys32] = 1; - * ycover[Yi1*Ymax + Ys32] = 1; - * ycover[Yi8*Ymax + Ys32] = 1; - * - * which means that Yi0, Yi1, and Yi8 all count as Ys32 (signed 32) - * if that's what an instruction can handle. - * - * In parallel with the scan through the ytable for the appropriate line, there - * is a z pointer that starts out pointing at the strange magic byte list in - * the Optab struct. With each step past a non-matching ytable line, z - * advances by the 4th entry in the line. When a matching line is found, that - * z pointer has the extra data to use in laying down the instruction bytes. - * The actual bytes laid down are a function of the 3rd entry in the line (that - * is, the Ztype) and the z bytes. - * - * For example, let's look at AADDL. The optab line says: - * { AADDL, yaddl, Px, 0x83,(00),0x05,0x81,(00),0x01,0x03 }, - * - * and yaddl says - * uchar yaddl[] = - * { - * Yi8, Yml, Zibo_m, 2, - * Yi32, Yax, Zil_, 1, - * Yi32, Yml, Zilo_m, 2, - * Yrl, Yml, Zr_m, 1, - * Yml, Yrl, Zm_r, 1, - * 0 - * }; - * - * so there are 5 possible types of ADDL instruction that can be laid down, and - * possible states used to lay them down (Ztype and z pointer, assuming z - * points at {0x83,(00),0x05,0x81,(00),0x01,0x03}) are: - * - * Yi8, Yml -> Zibo_m, z (0x83, 00) - * Yi32, Yax -> Zil_, z+2 (0x05) - * Yi32, Yml -> Zilo_m, z+2+1 (0x81, 0x00) - * Yrl, Yml -> Zr_m, z+2+1+2 (0x01) - * Yml, Yrl -> Zm_r, z+2+1+2+1 (0x03) - * - * The Pconstant in the optab line controls the prefix bytes to emit. That's - * relatively straightforward as this program goes. - * - * The switch on t[2] in doasm implements the various Z cases. Zibo_m, for - * example, is an opcode byte (z[0]) then an asmando (which is some kind of - * encoded addressing mode for the Yml arg), and then a single immediate byte. - * Zilo_m is the same but a long (32-bit) immediate. - */ -var optab = -/* as, ytab, andproto, opcode */ -[]Optab{ - {obj.AXXX, nil, 0, [23]uint8{}}, - {AAAA, ynone, P32, [23]uint8{0x37}}, - {AAAD, ynone, P32, [23]uint8{0xd5, 0x0a}}, - {AAAM, ynone, P32, [23]uint8{0xd4, 0x0a}}, - {AAAS, ynone, P32, [23]uint8{0x3f}}, - {AADCB, yxorb, Pb, [23]uint8{0x14, 0x80, 02, 0x10, 0x10}}, - {AADCL, yaddl, Px, [23]uint8{0x83, 02, 0x15, 0x81, 02, 0x11, 0x13}}, - {AADCQ, yaddl, Pw, [23]uint8{0x83, 02, 0x15, 0x81, 02, 0x11, 0x13}}, - {AADCW, yaddl, Pe, [23]uint8{0x83, 02, 0x15, 0x81, 02, 0x11, 0x13}}, - {AADDB, yxorb, Pb, [23]uint8{0x04, 0x80, 00, 0x00, 0x02}}, - {AADDL, yaddl, Px, [23]uint8{0x83, 00, 0x05, 0x81, 00, 0x01, 0x03}}, - {AADDPD, yxm, Pq, [23]uint8{0x58}}, - {AADDPS, yxm, Pm, [23]uint8{0x58}}, - {AADDQ, yaddl, Pw, [23]uint8{0x83, 00, 0x05, 0x81, 00, 0x01, 0x03}}, - {AADDSD, yxm, Pf2, [23]uint8{0x58}}, - {AADDSS, yxm, Pf3, [23]uint8{0x58}}, - {AADDW, yaddl, Pe, [23]uint8{0x83, 00, 0x05, 0x81, 00, 0x01, 0x03}}, - {AADJSP, nil, 0, [23]uint8{}}, - {AANDB, yxorb, Pb, [23]uint8{0x24, 0x80, 04, 0x20, 0x22}}, - {AANDL, yaddl, Px, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}}, - {AANDNPD, yxm, Pq, [23]uint8{0x55}}, - {AANDNPS, yxm, Pm, [23]uint8{0x55}}, - {AANDPD, yxm, Pq, [23]uint8{0x54}}, - {AANDPS, yxm, Pq, [23]uint8{0x54}}, - {AANDQ, yaddl, Pw, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}}, - {AANDW, yaddl, Pe, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}}, - {AARPL, yrl_ml, P32, [23]uint8{0x63}}, - {ABOUNDL, yrl_m, P32, [23]uint8{0x62}}, - {ABOUNDW, yrl_m, Pe, [23]uint8{0x62}}, - {ABSFL, yml_rl, Pm, [23]uint8{0xbc}}, - {ABSFQ, yml_rl, Pw, [23]uint8{0x0f, 0xbc}}, - {ABSFW, yml_rl, Pq, [23]uint8{0xbc}}, - {ABSRL, yml_rl, Pm, [23]uint8{0xbd}}, - {ABSRQ, yml_rl, Pw, [23]uint8{0x0f, 0xbd}}, - {ABSRW, yml_rl, Pq, [23]uint8{0xbd}}, - {ABSWAPL, ybswap, Px, [23]uint8{0x0f, 0xc8}}, - {ABSWAPQ, ybswap, Pw, [23]uint8{0x0f, 0xc8}}, - {ABTCL, ybtl, Pm, [23]uint8{0xba, 07, 0xbb}}, - {ABTCQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 07, 0x0f, 0xbb}}, - {ABTCW, ybtl, Pq, [23]uint8{0xba, 07, 0xbb}}, - {ABTL, ybtl, Pm, [23]uint8{0xba, 04, 0xa3}}, - {ABTQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 04, 0x0f, 0xa3}}, - {ABTRL, ybtl, Pm, [23]uint8{0xba, 06, 0xb3}}, - {ABTRQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 06, 0x0f, 0xb3}}, - {ABTRW, ybtl, Pq, [23]uint8{0xba, 06, 0xb3}}, - {ABTSL, ybtl, Pm, [23]uint8{0xba, 05, 0xab}}, - {ABTSQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 05, 0x0f, 0xab}}, - {ABTSW, ybtl, Pq, [23]uint8{0xba, 05, 0xab}}, - {ABTW, ybtl, Pq, [23]uint8{0xba, 04, 0xa3}}, - {ABYTE, ybyte, Px, [23]uint8{1}}, - {obj.ACALL, ycall, Px, [23]uint8{0xff, 02, 0xff, 0x15, 0xe8}}, - {ACDQ, ynone, Px, [23]uint8{0x99}}, - {ACLC, ynone, Px, [23]uint8{0xf8}}, - {ACLD, ynone, Px, [23]uint8{0xfc}}, - {ACLI, ynone, Px, [23]uint8{0xfa}}, - {ACLTS, ynone, Pm, [23]uint8{0x06}}, - {ACMC, ynone, Px, [23]uint8{0xf5}}, - {ACMOVLCC, yml_rl, Pm, [23]uint8{0x43}}, - {ACMOVLCS, yml_rl, Pm, [23]uint8{0x42}}, - {ACMOVLEQ, yml_rl, Pm, [23]uint8{0x44}}, - {ACMOVLGE, yml_rl, Pm, [23]uint8{0x4d}}, - {ACMOVLGT, yml_rl, Pm, [23]uint8{0x4f}}, - {ACMOVLHI, yml_rl, Pm, [23]uint8{0x47}}, - {ACMOVLLE, yml_rl, Pm, [23]uint8{0x4e}}, - {ACMOVLLS, yml_rl, Pm, [23]uint8{0x46}}, - {ACMOVLLT, yml_rl, Pm, [23]uint8{0x4c}}, - {ACMOVLMI, yml_rl, Pm, [23]uint8{0x48}}, - {ACMOVLNE, yml_rl, Pm, [23]uint8{0x45}}, - {ACMOVLOC, yml_rl, Pm, [23]uint8{0x41}}, - {ACMOVLOS, yml_rl, Pm, [23]uint8{0x40}}, - {ACMOVLPC, yml_rl, Pm, [23]uint8{0x4b}}, - {ACMOVLPL, yml_rl, Pm, [23]uint8{0x49}}, - {ACMOVLPS, yml_rl, Pm, [23]uint8{0x4a}}, - {ACMOVQCC, yml_rl, Pw, [23]uint8{0x0f, 0x43}}, - {ACMOVQCS, yml_rl, Pw, [23]uint8{0x0f, 0x42}}, - {ACMOVQEQ, yml_rl, Pw, [23]uint8{0x0f, 0x44}}, - {ACMOVQGE, yml_rl, Pw, [23]uint8{0x0f, 0x4d}}, - {ACMOVQGT, yml_rl, Pw, [23]uint8{0x0f, 0x4f}}, - {ACMOVQHI, yml_rl, Pw, [23]uint8{0x0f, 0x47}}, - {ACMOVQLE, yml_rl, Pw, [23]uint8{0x0f, 0x4e}}, - {ACMOVQLS, yml_rl, Pw, [23]uint8{0x0f, 0x46}}, - {ACMOVQLT, yml_rl, Pw, [23]uint8{0x0f, 0x4c}}, - {ACMOVQMI, yml_rl, Pw, [23]uint8{0x0f, 0x48}}, - {ACMOVQNE, yml_rl, Pw, [23]uint8{0x0f, 0x45}}, - {ACMOVQOC, yml_rl, Pw, [23]uint8{0x0f, 0x41}}, - {ACMOVQOS, yml_rl, Pw, [23]uint8{0x0f, 0x40}}, - {ACMOVQPC, yml_rl, Pw, [23]uint8{0x0f, 0x4b}}, - {ACMOVQPL, yml_rl, Pw, [23]uint8{0x0f, 0x49}}, - {ACMOVQPS, yml_rl, Pw, [23]uint8{0x0f, 0x4a}}, - {ACMOVWCC, yml_rl, Pq, [23]uint8{0x43}}, - {ACMOVWCS, yml_rl, Pq, [23]uint8{0x42}}, - {ACMOVWEQ, yml_rl, Pq, [23]uint8{0x44}}, - {ACMOVWGE, yml_rl, Pq, [23]uint8{0x4d}}, - {ACMOVWGT, yml_rl, Pq, [23]uint8{0x4f}}, - {ACMOVWHI, yml_rl, Pq, [23]uint8{0x47}}, - {ACMOVWLE, yml_rl, Pq, [23]uint8{0x4e}}, - {ACMOVWLS, yml_rl, Pq, [23]uint8{0x46}}, - {ACMOVWLT, yml_rl, Pq, [23]uint8{0x4c}}, - {ACMOVWMI, yml_rl, Pq, [23]uint8{0x48}}, - {ACMOVWNE, yml_rl, Pq, [23]uint8{0x45}}, - {ACMOVWOC, yml_rl, Pq, [23]uint8{0x41}}, - {ACMOVWOS, yml_rl, Pq, [23]uint8{0x40}}, - {ACMOVWPC, yml_rl, Pq, [23]uint8{0x4b}}, - {ACMOVWPL, yml_rl, Pq, [23]uint8{0x49}}, - {ACMOVWPS, yml_rl, Pq, [23]uint8{0x4a}}, - {ACMPB, ycmpb, Pb, [23]uint8{0x3c, 0x80, 07, 0x38, 0x3a}}, - {ACMPL, ycmpl, Px, [23]uint8{0x83, 07, 0x3d, 0x81, 07, 0x39, 0x3b}}, - {ACMPPD, yxcmpi, Px, [23]uint8{Pe, 0xc2}}, - {ACMPPS, yxcmpi, Pm, [23]uint8{0xc2, 0}}, - {ACMPQ, ycmpl, Pw, [23]uint8{0x83, 07, 0x3d, 0x81, 07, 0x39, 0x3b}}, - {ACMPSB, ynone, Pb, [23]uint8{0xa6}}, - {ACMPSD, yxcmpi, Px, [23]uint8{Pf2, 0xc2}}, - {ACMPSL, ynone, Px, [23]uint8{0xa7}}, - {ACMPSQ, ynone, Pw, [23]uint8{0xa7}}, - {ACMPSS, yxcmpi, Px, [23]uint8{Pf3, 0xc2}}, - {ACMPSW, ynone, Pe, [23]uint8{0xa7}}, - {ACMPW, ycmpl, Pe, [23]uint8{0x83, 07, 0x3d, 0x81, 07, 0x39, 0x3b}}, - {ACOMISD, yxm, Pe, [23]uint8{0x2f}}, - {ACOMISS, yxm, Pm, [23]uint8{0x2f}}, - {ACPUID, ynone, Pm, [23]uint8{0xa2}}, - {ACVTPL2PD, yxcvm2, Px, [23]uint8{Pf3, 0xe6, Pe, 0x2a}}, - {ACVTPL2PS, yxcvm2, Pm, [23]uint8{0x5b, 0, 0x2a, 0}}, - {ACVTPD2PL, yxcvm1, Px, [23]uint8{Pf2, 0xe6, Pe, 0x2d}}, - {ACVTPD2PS, yxm, Pe, [23]uint8{0x5a}}, - {ACVTPS2PL, yxcvm1, Px, [23]uint8{Pe, 0x5b, Pm, 0x2d}}, - {ACVTPS2PD, yxm, Pm, [23]uint8{0x5a}}, - {ACVTSD2SL, yxcvfl, Pf2, [23]uint8{0x2d}}, - {ACVTSD2SQ, yxcvfq, Pw, [23]uint8{Pf2, 0x2d}}, - {ACVTSD2SS, yxm, Pf2, [23]uint8{0x5a}}, - {ACVTSL2SD, yxcvlf, Pf2, [23]uint8{0x2a}}, - {ACVTSQ2SD, yxcvqf, Pw, [23]uint8{Pf2, 0x2a}}, - {ACVTSL2SS, yxcvlf, Pf3, [23]uint8{0x2a}}, - {ACVTSQ2SS, yxcvqf, Pw, [23]uint8{Pf3, 0x2a}}, - {ACVTSS2SD, yxm, Pf3, [23]uint8{0x5a}}, - {ACVTSS2SL, yxcvfl, Pf3, [23]uint8{0x2d}}, - {ACVTSS2SQ, yxcvfq, Pw, [23]uint8{Pf3, 0x2d}}, - {ACVTTPD2PL, yxcvm1, Px, [23]uint8{Pe, 0xe6, Pe, 0x2c}}, - {ACVTTPS2PL, yxcvm1, Px, [23]uint8{Pf3, 0x5b, Pm, 0x2c}}, - {ACVTTSD2SL, yxcvfl, Pf2, [23]uint8{0x2c}}, - {ACVTTSD2SQ, yxcvfq, Pw, [23]uint8{Pf2, 0x2c}}, - {ACVTTSS2SL, yxcvfl, Pf3, [23]uint8{0x2c}}, - {ACVTTSS2SQ, yxcvfq, Pw, [23]uint8{Pf3, 0x2c}}, - {ACWD, ynone, Pe, [23]uint8{0x99}}, - {ACQO, ynone, Pw, [23]uint8{0x99}}, - {ADAA, ynone, P32, [23]uint8{0x27}}, - {ADAS, ynone, P32, [23]uint8{0x2f}}, - {ADECB, yscond, Pb, [23]uint8{0xfe, 01}}, - {ADECL, yincl, Px1, [23]uint8{0x48, 0xff, 01}}, - {ADECQ, yincq, Pw, [23]uint8{0xff, 01}}, - {ADECW, yincq, Pe, [23]uint8{0xff, 01}}, - {ADIVB, ydivb, Pb, [23]uint8{0xf6, 06}}, - {ADIVL, ydivl, Px, [23]uint8{0xf7, 06}}, - {ADIVPD, yxm, Pe, [23]uint8{0x5e}}, - {ADIVPS, yxm, Pm, [23]uint8{0x5e}}, - {ADIVQ, ydivl, Pw, [23]uint8{0xf7, 06}}, - {ADIVSD, yxm, Pf2, [23]uint8{0x5e}}, - {ADIVSS, yxm, Pf3, [23]uint8{0x5e}}, - {ADIVW, ydivl, Pe, [23]uint8{0xf7, 06}}, - {AEMMS, ynone, Pm, [23]uint8{0x77}}, - {AENTER, nil, 0, [23]uint8{}}, /* botch */ - {AFXRSTOR, ysvrs, Pm, [23]uint8{0xae, 01, 0xae, 01}}, - {AFXSAVE, ysvrs, Pm, [23]uint8{0xae, 00, 0xae, 00}}, - {AFXRSTOR64, ysvrs, Pw, [23]uint8{0x0f, 0xae, 01, 0x0f, 0xae, 01}}, - {AFXSAVE64, ysvrs, Pw, [23]uint8{0x0f, 0xae, 00, 0x0f, 0xae, 00}}, - {AHLT, ynone, Px, [23]uint8{0xf4}}, - {AIDIVB, ydivb, Pb, [23]uint8{0xf6, 07}}, - {AIDIVL, ydivl, Px, [23]uint8{0xf7, 07}}, - {AIDIVQ, ydivl, Pw, [23]uint8{0xf7, 07}}, - {AIDIVW, ydivl, Pe, [23]uint8{0xf7, 07}}, - {AIMULB, ydivb, Pb, [23]uint8{0xf6, 05}}, - {AIMULL, yimul, Px, [23]uint8{0xf7, 05, 0x6b, 0x69, Pm, 0xaf}}, - {AIMULQ, yimul, Pw, [23]uint8{0xf7, 05, 0x6b, 0x69, Pm, 0xaf}}, - {AIMULW, yimul, Pe, [23]uint8{0xf7, 05, 0x6b, 0x69, Pm, 0xaf}}, - {AIMUL3Q, yimul3, Pw, [23]uint8{0x6b, 00}}, - {AINB, yin, Pb, [23]uint8{0xe4, 0xec}}, - {AINCB, yscond, Pb, [23]uint8{0xfe, 00}}, - {AINCL, yincl, Px1, [23]uint8{0x40, 0xff, 00}}, - {AINCQ, yincq, Pw, [23]uint8{0xff, 00}}, - {AINCW, yincq, Pe, [23]uint8{0xff, 00}}, - {AINL, yin, Px, [23]uint8{0xe5, 0xed}}, - {AINSB, ynone, Pb, [23]uint8{0x6c}}, - {AINSL, ynone, Px, [23]uint8{0x6d}}, - {AINSW, ynone, Pe, [23]uint8{0x6d}}, - {AINT, yint, Px, [23]uint8{0xcd}}, - {AINTO, ynone, P32, [23]uint8{0xce}}, - {AINW, yin, Pe, [23]uint8{0xe5, 0xed}}, - {AIRETL, ynone, Px, [23]uint8{0xcf}}, - {AIRETQ, ynone, Pw, [23]uint8{0xcf}}, - {AIRETW, ynone, Pe, [23]uint8{0xcf}}, - {AJCC, yjcond, Px, [23]uint8{0x73, 0x83, 00}}, - {AJCS, yjcond, Px, [23]uint8{0x72, 0x82}}, - {AJCXZL, yloop, Px, [23]uint8{0xe3}}, - {AJCXZW, yloop, Px, [23]uint8{0xe3}}, - {AJCXZQ, yloop, Px, [23]uint8{0xe3}}, - {AJEQ, yjcond, Px, [23]uint8{0x74, 0x84}}, - {AJGE, yjcond, Px, [23]uint8{0x7d, 0x8d}}, - {AJGT, yjcond, Px, [23]uint8{0x7f, 0x8f}}, - {AJHI, yjcond, Px, [23]uint8{0x77, 0x87}}, - {AJLE, yjcond, Px, [23]uint8{0x7e, 0x8e}}, - {AJLS, yjcond, Px, [23]uint8{0x76, 0x86}}, - {AJLT, yjcond, Px, [23]uint8{0x7c, 0x8c}}, - {AJMI, yjcond, Px, [23]uint8{0x78, 0x88}}, - {obj.AJMP, yjmp, Px, [23]uint8{0xff, 04, 0xeb, 0xe9}}, - {AJNE, yjcond, Px, [23]uint8{0x75, 0x85}}, - {AJOC, yjcond, Px, [23]uint8{0x71, 0x81, 00}}, - {AJOS, yjcond, Px, [23]uint8{0x70, 0x80, 00}}, - {AJPC, yjcond, Px, [23]uint8{0x7b, 0x8b}}, - {AJPL, yjcond, Px, [23]uint8{0x79, 0x89}}, - {AJPS, yjcond, Px, [23]uint8{0x7a, 0x8a}}, - {AHADDPD, yxm, Pq, [23]uint8{0x7c}}, - {AHADDPS, yxm, Pf2, [23]uint8{0x7c}}, - {AHSUBPD, yxm, Pq, [23]uint8{0x7d}}, - {AHSUBPS, yxm, Pf2, [23]uint8{0x7d}}, - {ALAHF, ynone, Px, [23]uint8{0x9f}}, - {ALARL, yml_rl, Pm, [23]uint8{0x02}}, - {ALARW, yml_rl, Pq, [23]uint8{0x02}}, - {ALDDQU, ylddqu, Pf2, [23]uint8{0xf0}}, - {ALDMXCSR, ysvrs, Pm, [23]uint8{0xae, 02, 0xae, 02}}, - {ALEAL, ym_rl, Px, [23]uint8{0x8d}}, - {ALEAQ, ym_rl, Pw, [23]uint8{0x8d}}, - {ALEAVEL, ynone, P32, [23]uint8{0xc9}}, - {ALEAVEQ, ynone, Py, [23]uint8{0xc9}}, - {ALEAVEW, ynone, Pe, [23]uint8{0xc9}}, - {ALEAW, ym_rl, Pe, [23]uint8{0x8d}}, - {ALOCK, ynone, Px, [23]uint8{0xf0}}, - {ALODSB, ynone, Pb, [23]uint8{0xac}}, - {ALODSL, ynone, Px, [23]uint8{0xad}}, - {ALODSQ, ynone, Pw, [23]uint8{0xad}}, - {ALODSW, ynone, Pe, [23]uint8{0xad}}, - {ALONG, ybyte, Px, [23]uint8{4}}, - {ALOOP, yloop, Px, [23]uint8{0xe2}}, - {ALOOPEQ, yloop, Px, [23]uint8{0xe1}}, - {ALOOPNE, yloop, Px, [23]uint8{0xe0}}, - {ALSLL, yml_rl, Pm, [23]uint8{0x03}}, - {ALSLW, yml_rl, Pq, [23]uint8{0x03}}, - {AMASKMOVOU, yxr, Pe, [23]uint8{0xf7}}, - {AMASKMOVQ, ymr, Pm, [23]uint8{0xf7}}, - {AMAXPD, yxm, Pe, [23]uint8{0x5f}}, - {AMAXPS, yxm, Pm, [23]uint8{0x5f}}, - {AMAXSD, yxm, Pf2, [23]uint8{0x5f}}, - {AMAXSS, yxm, Pf3, [23]uint8{0x5f}}, - {AMINPD, yxm, Pe, [23]uint8{0x5d}}, - {AMINPS, yxm, Pm, [23]uint8{0x5d}}, - {AMINSD, yxm, Pf2, [23]uint8{0x5d}}, - {AMINSS, yxm, Pf3, [23]uint8{0x5d}}, - {AMOVAPD, yxmov, Pe, [23]uint8{0x28, 0x29}}, - {AMOVAPS, yxmov, Pm, [23]uint8{0x28, 0x29}}, - {AMOVB, ymovb, Pb, [23]uint8{0x88, 0x8a, 0xb0, 0xc6, 00}}, - {AMOVBLSX, ymb_rl, Pm, [23]uint8{0xbe}}, - {AMOVBLZX, ymb_rl, Pm, [23]uint8{0xb6}}, - {AMOVBQSX, ymb_rl, Pw, [23]uint8{0x0f, 0xbe}}, - {AMOVBQZX, ymb_rl, Pm, [23]uint8{0xb6}}, - {AMOVBWSX, ymb_rl, Pq, [23]uint8{0xbe}}, - {AMOVBWZX, ymb_rl, Pq, [23]uint8{0xb6}}, - {AMOVO, yxmov, Pe, [23]uint8{0x6f, 0x7f}}, - {AMOVOU, yxmov, Pf3, [23]uint8{0x6f, 0x7f}}, - {AMOVHLPS, yxr, Pm, [23]uint8{0x12}}, - {AMOVHPD, yxmov, Pe, [23]uint8{0x16, 0x17}}, - {AMOVHPS, yxmov, Pm, [23]uint8{0x16, 0x17}}, - {AMOVL, ymovl, Px, [23]uint8{0x89, 0x8b, 0x31, 0xb8, 0xc7, 00, 0x6e, 0x7e, Pe, 0x6e, Pe, 0x7e, 0}}, - {AMOVLHPS, yxr, Pm, [23]uint8{0x16}}, - {AMOVLPD, yxmov, Pe, [23]uint8{0x12, 0x13}}, - {AMOVLPS, yxmov, Pm, [23]uint8{0x12, 0x13}}, - {AMOVLQSX, yml_rl, Pw, [23]uint8{0x63}}, - {AMOVLQZX, yml_rl, Px, [23]uint8{0x8b}}, - {AMOVMSKPD, yxrrl, Pq, [23]uint8{0x50}}, - {AMOVMSKPS, yxrrl, Pm, [23]uint8{0x50}}, - {AMOVNTO, yxr_ml, Pe, [23]uint8{0xe7}}, - {AMOVNTPD, yxr_ml, Pe, [23]uint8{0x2b}}, - {AMOVNTPS, yxr_ml, Pm, [23]uint8{0x2b}}, - {AMOVNTQ, ymr_ml, Pm, [23]uint8{0xe7}}, - {AMOVQ, ymovq, Pw8, [23]uint8{0x6f, 0x7f, Pf2, 0xd6, Pf3, 0x7e, Pe, 0xd6, 0x89, 0x8b, 0x31, 0xc7, 00, 0xb8, 0xc7, 00, 0x6e, 0x7e, Pe, 0x6e, Pe, 0x7e, 0}}, - {AMOVQOZX, ymrxr, Pf3, [23]uint8{0xd6, 0x7e}}, - {AMOVSB, ynone, Pb, [23]uint8{0xa4}}, - {AMOVSD, yxmov, Pf2, [23]uint8{0x10, 0x11}}, - {AMOVSL, ynone, Px, [23]uint8{0xa5}}, - {AMOVSQ, ynone, Pw, [23]uint8{0xa5}}, - {AMOVSS, yxmov, Pf3, [23]uint8{0x10, 0x11}}, - {AMOVSW, ynone, Pe, [23]uint8{0xa5}}, - {AMOVUPD, yxmov, Pe, [23]uint8{0x10, 0x11}}, - {AMOVUPS, yxmov, Pm, [23]uint8{0x10, 0x11}}, - {AMOVW, ymovw, Pe, [23]uint8{0x89, 0x8b, 0x31, 0xb8, 0xc7, 00, 0}}, - {AMOVWLSX, yml_rl, Pm, [23]uint8{0xbf}}, - {AMOVWLZX, yml_rl, Pm, [23]uint8{0xb7}}, - {AMOVWQSX, yml_rl, Pw, [23]uint8{0x0f, 0xbf}}, - {AMOVWQZX, yml_rl, Pw, [23]uint8{0x0f, 0xb7}}, - {AMULB, ydivb, Pb, [23]uint8{0xf6, 04}}, - {AMULL, ydivl, Px, [23]uint8{0xf7, 04}}, - {AMULPD, yxm, Pe, [23]uint8{0x59}}, - {AMULPS, yxm, Ym, [23]uint8{0x59}}, - {AMULQ, ydivl, Pw, [23]uint8{0xf7, 04}}, - {AMULSD, yxm, Pf2, [23]uint8{0x59}}, - {AMULSS, yxm, Pf3, [23]uint8{0x59}}, - {AMULW, ydivl, Pe, [23]uint8{0xf7, 04}}, - {ANEGB, yscond, Pb, [23]uint8{0xf6, 03}}, - {ANEGL, yscond, Px, [23]uint8{0xf7, 03}}, - {ANEGQ, yscond, Pw, [23]uint8{0xf7, 03}}, - {ANEGW, yscond, Pe, [23]uint8{0xf7, 03}}, - {obj.ANOP, ynop, Px, [23]uint8{0, 0}}, - {ANOTB, yscond, Pb, [23]uint8{0xf6, 02}}, - {ANOTL, yscond, Px, [23]uint8{0xf7, 02}}, // TODO(rsc): yscond is wrong here. - {ANOTQ, yscond, Pw, [23]uint8{0xf7, 02}}, - {ANOTW, yscond, Pe, [23]uint8{0xf7, 02}}, - {AORB, yxorb, Pb, [23]uint8{0x0c, 0x80, 01, 0x08, 0x0a}}, - {AORL, yaddl, Px, [23]uint8{0x83, 01, 0x0d, 0x81, 01, 0x09, 0x0b}}, - {AORPD, yxm, Pq, [23]uint8{0x56}}, - {AORPS, yxm, Pm, [23]uint8{0x56}}, - {AORQ, yaddl, Pw, [23]uint8{0x83, 01, 0x0d, 0x81, 01, 0x09, 0x0b}}, - {AORW, yaddl, Pe, [23]uint8{0x83, 01, 0x0d, 0x81, 01, 0x09, 0x0b}}, - {AOUTB, yin, Pb, [23]uint8{0xe6, 0xee}}, - {AOUTL, yin, Px, [23]uint8{0xe7, 0xef}}, - {AOUTSB, ynone, Pb, [23]uint8{0x6e}}, - {AOUTSL, ynone, Px, [23]uint8{0x6f}}, - {AOUTSW, ynone, Pe, [23]uint8{0x6f}}, - {AOUTW, yin, Pe, [23]uint8{0xe7, 0xef}}, - {APACKSSLW, ymm, Py1, [23]uint8{0x6b, Pe, 0x6b}}, - {APACKSSWB, ymm, Py1, [23]uint8{0x63, Pe, 0x63}}, - {APACKUSWB, ymm, Py1, [23]uint8{0x67, Pe, 0x67}}, - {APADDB, ymm, Py1, [23]uint8{0xfc, Pe, 0xfc}}, - {APADDL, ymm, Py1, [23]uint8{0xfe, Pe, 0xfe}}, - {APADDQ, yxm, Pe, [23]uint8{0xd4}}, - {APADDSB, ymm, Py1, [23]uint8{0xec, Pe, 0xec}}, - {APADDSW, ymm, Py1, [23]uint8{0xed, Pe, 0xed}}, - {APADDUSB, ymm, Py1, [23]uint8{0xdc, Pe, 0xdc}}, - {APADDUSW, ymm, Py1, [23]uint8{0xdd, Pe, 0xdd}}, - {APADDW, ymm, Py1, [23]uint8{0xfd, Pe, 0xfd}}, - {APAND, ymm, Py1, [23]uint8{0xdb, Pe, 0xdb}}, - {APANDN, ymm, Py1, [23]uint8{0xdf, Pe, 0xdf}}, - {APAUSE, ynone, Px, [23]uint8{0xf3, 0x90}}, - {APAVGB, ymm, Py1, [23]uint8{0xe0, Pe, 0xe0}}, - {APAVGW, ymm, Py1, [23]uint8{0xe3, Pe, 0xe3}}, - {APCMPEQB, ymm, Py1, [23]uint8{0x74, Pe, 0x74}}, - {APCMPEQL, ymm, Py1, [23]uint8{0x76, Pe, 0x76}}, - {APCMPEQW, ymm, Py1, [23]uint8{0x75, Pe, 0x75}}, - {APCMPGTB, ymm, Py1, [23]uint8{0x64, Pe, 0x64}}, - {APCMPGTL, ymm, Py1, [23]uint8{0x66, Pe, 0x66}}, - {APCMPGTW, ymm, Py1, [23]uint8{0x65, Pe, 0x65}}, - {APEXTRW, yextrw, Pq, [23]uint8{0xc5, 00}}, - {APEXTRB, yextr, Pq, [23]uint8{0x3a, 0x14, 00}}, - {APEXTRD, yextr, Pq, [23]uint8{0x3a, 0x16, 00}}, - {APEXTRQ, yextr, Pq3, [23]uint8{0x3a, 0x16, 00}}, - {APHADDD, ymmxmm0f38, Px, [23]uint8{0x0F, 0x38, 0x02, 0, 0x66, 0x0F, 0x38, 0x02, 0}}, - {APHADDSW, yxm_q4, Pq4, [23]uint8{0x03}}, - {APHADDW, yxm_q4, Pq4, [23]uint8{0x01}}, - {APHMINPOSUW, yxm_q4, Pq4, [23]uint8{0x41}}, - {APHSUBD, yxm_q4, Pq4, [23]uint8{0x06}}, - {APHSUBSW, yxm_q4, Pq4, [23]uint8{0x07}}, - {APHSUBW, yxm_q4, Pq4, [23]uint8{0x05}}, - {APINSRW, yinsrw, Pq, [23]uint8{0xc4, 00}}, - {APINSRB, yinsr, Pq, [23]uint8{0x3a, 0x20, 00}}, - {APINSRD, yinsr, Pq, [23]uint8{0x3a, 0x22, 00}}, - {APINSRQ, yinsr, Pq3, [23]uint8{0x3a, 0x22, 00}}, - {APMADDWL, ymm, Py1, [23]uint8{0xf5, Pe, 0xf5}}, - {APMAXSW, yxm, Pe, [23]uint8{0xee}}, - {APMAXUB, yxm, Pe, [23]uint8{0xde}}, - {APMINSW, yxm, Pe, [23]uint8{0xea}}, - {APMINUB, yxm, Pe, [23]uint8{0xda}}, - {APMOVMSKB, ymskb, Px, [23]uint8{Pe, 0xd7, 0xd7}}, - {APMOVSXBD, yxm_q4, Pq4, [23]uint8{0x21}}, - {APMOVSXBQ, yxm_q4, Pq4, [23]uint8{0x22}}, - {APMOVSXBW, yxm_q4, Pq4, [23]uint8{0x20}}, - {APMOVSXDQ, yxm_q4, Pq4, [23]uint8{0x25}}, - {APMOVSXWD, yxm_q4, Pq4, [23]uint8{0x23}}, - {APMOVSXWQ, yxm_q4, Pq4, [23]uint8{0x24}}, - {APMOVZXBD, yxm_q4, Pq4, [23]uint8{0x31}}, - {APMOVZXBQ, yxm_q4, Pq4, [23]uint8{0x32}}, - {APMOVZXBW, yxm_q4, Pq4, [23]uint8{0x30}}, - {APMOVZXDQ, yxm_q4, Pq4, [23]uint8{0x35}}, - {APMOVZXWD, yxm_q4, Pq4, [23]uint8{0x33}}, - {APMOVZXWQ, yxm_q4, Pq4, [23]uint8{0x34}}, - {APMULDQ, yxm_q4, Pq4, [23]uint8{0x28}}, - {APMULHUW, ymm, Py1, [23]uint8{0xe4, Pe, 0xe4}}, - {APMULHW, ymm, Py1, [23]uint8{0xe5, Pe, 0xe5}}, - {APMULLD, yxm_q4, Pq4, [23]uint8{0x40}}, - {APMULLW, ymm, Py1, [23]uint8{0xd5, Pe, 0xd5}}, - {APMULULQ, ymm, Py1, [23]uint8{0xf4, Pe, 0xf4}}, - {APOPAL, ynone, P32, [23]uint8{0x61}}, - {APOPAW, ynone, Pe, [23]uint8{0x61}}, - {APOPCNTW, yml_rl, Pef3, [23]uint8{0xb8}}, - {APOPCNTL, yml_rl, Pf3, [23]uint8{0xb8}}, - {APOPCNTQ, yml_rl, Pfw, [23]uint8{0xb8}}, - {APOPFL, ynone, P32, [23]uint8{0x9d}}, - {APOPFQ, ynone, Py, [23]uint8{0x9d}}, - {APOPFW, ynone, Pe, [23]uint8{0x9d}}, - {APOPL, ypopl, P32, [23]uint8{0x58, 0x8f, 00}}, - {APOPQ, ypopl, Py, [23]uint8{0x58, 0x8f, 00}}, - {APOPW, ypopl, Pe, [23]uint8{0x58, 0x8f, 00}}, - {APOR, ymm, Py1, [23]uint8{0xeb, Pe, 0xeb}}, - {APSADBW, yxm, Pq, [23]uint8{0xf6}}, - {APSHUFHW, yxshuf, Pf3, [23]uint8{0x70, 00}}, - {APSHUFL, yxshuf, Pq, [23]uint8{0x70, 00}}, - {APSHUFLW, yxshuf, Pf2, [23]uint8{0x70, 00}}, - {APSHUFW, ymshuf, Pm, [23]uint8{0x70, 00}}, - {APSHUFB, ymshufb, Pq, [23]uint8{0x38, 0x00}}, - {APSLLO, ypsdq, Pq, [23]uint8{0x73, 07}}, - {APSLLL, yps, Py3, [23]uint8{0xf2, 0x72, 06, Pe, 0xf2, Pe, 0x72, 06}}, - {APSLLQ, yps, Py3, [23]uint8{0xf3, 0x73, 06, Pe, 0xf3, Pe, 0x73, 06}}, - {APSLLW, yps, Py3, [23]uint8{0xf1, 0x71, 06, Pe, 0xf1, Pe, 0x71, 06}}, - {APSRAL, yps, Py3, [23]uint8{0xe2, 0x72, 04, Pe, 0xe2, Pe, 0x72, 04}}, - {APSRAW, yps, Py3, [23]uint8{0xe1, 0x71, 04, Pe, 0xe1, Pe, 0x71, 04}}, - {APSRLO, ypsdq, Pq, [23]uint8{0x73, 03}}, - {APSRLL, yps, Py3, [23]uint8{0xd2, 0x72, 02, Pe, 0xd2, Pe, 0x72, 02}}, - {APSRLQ, yps, Py3, [23]uint8{0xd3, 0x73, 02, Pe, 0xd3, Pe, 0x73, 02}}, - {APSRLW, yps, Py3, [23]uint8{0xd1, 0x71, 02, Pe, 0xd1, Pe, 0x71, 02}}, - {APSUBB, yxm, Pe, [23]uint8{0xf8}}, - {APSUBL, yxm, Pe, [23]uint8{0xfa}}, - {APSUBQ, yxm, Pe, [23]uint8{0xfb}}, - {APSUBSB, yxm, Pe, [23]uint8{0xe8}}, - {APSUBSW, yxm, Pe, [23]uint8{0xe9}}, - {APSUBUSB, yxm, Pe, [23]uint8{0xd8}}, - {APSUBUSW, yxm, Pe, [23]uint8{0xd9}}, - {APSUBW, yxm, Pe, [23]uint8{0xf9}}, - {APUNPCKHBW, ymm, Py1, [23]uint8{0x68, Pe, 0x68}}, - {APUNPCKHLQ, ymm, Py1, [23]uint8{0x6a, Pe, 0x6a}}, - {APUNPCKHQDQ, yxm, Pe, [23]uint8{0x6d}}, - {APUNPCKHWL, ymm, Py1, [23]uint8{0x69, Pe, 0x69}}, - {APUNPCKLBW, ymm, Py1, [23]uint8{0x60, Pe, 0x60}}, - {APUNPCKLLQ, ymm, Py1, [23]uint8{0x62, Pe, 0x62}}, - {APUNPCKLQDQ, yxm, Pe, [23]uint8{0x6c}}, - {APUNPCKLWL, ymm, Py1, [23]uint8{0x61, Pe, 0x61}}, - {APUSHAL, ynone, P32, [23]uint8{0x60}}, - {APUSHAW, ynone, Pe, [23]uint8{0x60}}, - {APUSHFL, ynone, P32, [23]uint8{0x9c}}, - {APUSHFQ, ynone, Py, [23]uint8{0x9c}}, - {APUSHFW, ynone, Pe, [23]uint8{0x9c}}, - {APUSHL, ypushl, P32, [23]uint8{0x50, 0xff, 06, 0x6a, 0x68}}, - {APUSHQ, ypushl, Py, [23]uint8{0x50, 0xff, 06, 0x6a, 0x68}}, - {APUSHW, ypushl, Pe, [23]uint8{0x50, 0xff, 06, 0x6a, 0x68}}, - {APXOR, ymm, Py1, [23]uint8{0xef, Pe, 0xef}}, - {AQUAD, ybyte, Px, [23]uint8{8}}, - {ARCLB, yshb, Pb, [23]uint8{0xd0, 02, 0xc0, 02, 0xd2, 02}}, - {ARCLL, yshl, Px, [23]uint8{0xd1, 02, 0xc1, 02, 0xd3, 02, 0xd3, 02}}, - {ARCLQ, yshl, Pw, [23]uint8{0xd1, 02, 0xc1, 02, 0xd3, 02, 0xd3, 02}}, - {ARCLW, yshl, Pe, [23]uint8{0xd1, 02, 0xc1, 02, 0xd3, 02, 0xd3, 02}}, - {ARCPPS, yxm, Pm, [23]uint8{0x53}}, - {ARCPSS, yxm, Pf3, [23]uint8{0x53}}, - {ARCRB, yshb, Pb, [23]uint8{0xd0, 03, 0xc0, 03, 0xd2, 03}}, - {ARCRL, yshl, Px, [23]uint8{0xd1, 03, 0xc1, 03, 0xd3, 03, 0xd3, 03}}, - {ARCRQ, yshl, Pw, [23]uint8{0xd1, 03, 0xc1, 03, 0xd3, 03, 0xd3, 03}}, - {ARCRW, yshl, Pe, [23]uint8{0xd1, 03, 0xc1, 03, 0xd3, 03, 0xd3, 03}}, - {AREP, ynone, Px, [23]uint8{0xf3}}, - {AREPN, ynone, Px, [23]uint8{0xf2}}, - {obj.ARET, ynone, Px, [23]uint8{0xc3}}, - {ARETFW, yret, Pe, [23]uint8{0xcb, 0xca}}, - {ARETFL, yret, Px, [23]uint8{0xcb, 0xca}}, - {ARETFQ, yret, Pw, [23]uint8{0xcb, 0xca}}, - {AROLB, yshb, Pb, [23]uint8{0xd0, 00, 0xc0, 00, 0xd2, 00}}, - {AROLL, yshl, Px, [23]uint8{0xd1, 00, 0xc1, 00, 0xd3, 00, 0xd3, 00}}, - {AROLQ, yshl, Pw, [23]uint8{0xd1, 00, 0xc1, 00, 0xd3, 00, 0xd3, 00}}, - {AROLW, yshl, Pe, [23]uint8{0xd1, 00, 0xc1, 00, 0xd3, 00, 0xd3, 00}}, - {ARORB, yshb, Pb, [23]uint8{0xd0, 01, 0xc0, 01, 0xd2, 01}}, - {ARORL, yshl, Px, [23]uint8{0xd1, 01, 0xc1, 01, 0xd3, 01, 0xd3, 01}}, - {ARORQ, yshl, Pw, [23]uint8{0xd1, 01, 0xc1, 01, 0xd3, 01, 0xd3, 01}}, - {ARORW, yshl, Pe, [23]uint8{0xd1, 01, 0xc1, 01, 0xd3, 01, 0xd3, 01}}, - {ARSQRTPS, yxm, Pm, [23]uint8{0x52}}, - {ARSQRTSS, yxm, Pf3, [23]uint8{0x52}}, - {ASAHF, ynone, Px1, [23]uint8{0x9e, 00, 0x86, 0xe0, 0x50, 0x9d}}, /* XCHGB AH,AL; PUSH AX; POPFL */ - {ASALB, yshb, Pb, [23]uint8{0xd0, 04, 0xc0, 04, 0xd2, 04}}, - {ASALL, yshl, Px, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, - {ASALQ, yshl, Pw, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, - {ASALW, yshl, Pe, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, - {ASARB, yshb, Pb, [23]uint8{0xd0, 07, 0xc0, 07, 0xd2, 07}}, - {ASARL, yshl, Px, [23]uint8{0xd1, 07, 0xc1, 07, 0xd3, 07, 0xd3, 07}}, - {ASARQ, yshl, Pw, [23]uint8{0xd1, 07, 0xc1, 07, 0xd3, 07, 0xd3, 07}}, - {ASARW, yshl, Pe, [23]uint8{0xd1, 07, 0xc1, 07, 0xd3, 07, 0xd3, 07}}, - {ASBBB, yxorb, Pb, [23]uint8{0x1c, 0x80, 03, 0x18, 0x1a}}, - {ASBBL, yaddl, Px, [23]uint8{0x83, 03, 0x1d, 0x81, 03, 0x19, 0x1b}}, - {ASBBQ, yaddl, Pw, [23]uint8{0x83, 03, 0x1d, 0x81, 03, 0x19, 0x1b}}, - {ASBBW, yaddl, Pe, [23]uint8{0x83, 03, 0x1d, 0x81, 03, 0x19, 0x1b}}, - {ASCASB, ynone, Pb, [23]uint8{0xae}}, - {ASCASL, ynone, Px, [23]uint8{0xaf}}, - {ASCASQ, ynone, Pw, [23]uint8{0xaf}}, - {ASCASW, ynone, Pe, [23]uint8{0xaf}}, - {ASETCC, yscond, Pb, [23]uint8{0x0f, 0x93, 00}}, - {ASETCS, yscond, Pb, [23]uint8{0x0f, 0x92, 00}}, - {ASETEQ, yscond, Pb, [23]uint8{0x0f, 0x94, 00}}, - {ASETGE, yscond, Pb, [23]uint8{0x0f, 0x9d, 00}}, - {ASETGT, yscond, Pb, [23]uint8{0x0f, 0x9f, 00}}, - {ASETHI, yscond, Pb, [23]uint8{0x0f, 0x97, 00}}, - {ASETLE, yscond, Pb, [23]uint8{0x0f, 0x9e, 00}}, - {ASETLS, yscond, Pb, [23]uint8{0x0f, 0x96, 00}}, - {ASETLT, yscond, Pb, [23]uint8{0x0f, 0x9c, 00}}, - {ASETMI, yscond, Pb, [23]uint8{0x0f, 0x98, 00}}, - {ASETNE, yscond, Pb, [23]uint8{0x0f, 0x95, 00}}, - {ASETOC, yscond, Pb, [23]uint8{0x0f, 0x91, 00}}, - {ASETOS, yscond, Pb, [23]uint8{0x0f, 0x90, 00}}, - {ASETPC, yscond, Pb, [23]uint8{0x0f, 0x9b, 00}}, - {ASETPL, yscond, Pb, [23]uint8{0x0f, 0x99, 00}}, - {ASETPS, yscond, Pb, [23]uint8{0x0f, 0x9a, 00}}, - {ASHLB, yshb, Pb, [23]uint8{0xd0, 04, 0xc0, 04, 0xd2, 04}}, - {ASHLL, yshl, Px, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, - {ASHLQ, yshl, Pw, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, - {ASHLW, yshl, Pe, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, - {ASHRB, yshb, Pb, [23]uint8{0xd0, 05, 0xc0, 05, 0xd2, 05}}, - {ASHRL, yshl, Px, [23]uint8{0xd1, 05, 0xc1, 05, 0xd3, 05, 0xd3, 05}}, - {ASHRQ, yshl, Pw, [23]uint8{0xd1, 05, 0xc1, 05, 0xd3, 05, 0xd3, 05}}, - {ASHRW, yshl, Pe, [23]uint8{0xd1, 05, 0xc1, 05, 0xd3, 05, 0xd3, 05}}, - {ASHUFPD, yxshuf, Pq, [23]uint8{0xc6, 00}}, - {ASHUFPS, yxshuf, Pm, [23]uint8{0xc6, 00}}, - {ASQRTPD, yxm, Pe, [23]uint8{0x51}}, - {ASQRTPS, yxm, Pm, [23]uint8{0x51}}, - {ASQRTSD, yxm, Pf2, [23]uint8{0x51}}, - {ASQRTSS, yxm, Pf3, [23]uint8{0x51}}, - {ASTC, ynone, Px, [23]uint8{0xf9}}, - {ASTD, ynone, Px, [23]uint8{0xfd}}, - {ASTI, ynone, Px, [23]uint8{0xfb}}, - {ASTMXCSR, ysvrs, Pm, [23]uint8{0xae, 03, 0xae, 03}}, - {ASTOSB, ynone, Pb, [23]uint8{0xaa}}, - {ASTOSL, ynone, Px, [23]uint8{0xab}}, - {ASTOSQ, ynone, Pw, [23]uint8{0xab}}, - {ASTOSW, ynone, Pe, [23]uint8{0xab}}, - {ASUBB, yxorb, Pb, [23]uint8{0x2c, 0x80, 05, 0x28, 0x2a}}, - {ASUBL, yaddl, Px, [23]uint8{0x83, 05, 0x2d, 0x81, 05, 0x29, 0x2b}}, - {ASUBPD, yxm, Pe, [23]uint8{0x5c}}, - {ASUBPS, yxm, Pm, [23]uint8{0x5c}}, - {ASUBQ, yaddl, Pw, [23]uint8{0x83, 05, 0x2d, 0x81, 05, 0x29, 0x2b}}, - {ASUBSD, yxm, Pf2, [23]uint8{0x5c}}, - {ASUBSS, yxm, Pf3, [23]uint8{0x5c}}, - {ASUBW, yaddl, Pe, [23]uint8{0x83, 05, 0x2d, 0x81, 05, 0x29, 0x2b}}, - {ASWAPGS, ynone, Pm, [23]uint8{0x01, 0xf8}}, - {ASYSCALL, ynone, Px, [23]uint8{0x0f, 0x05}}, /* fast syscall */ - {ATESTB, yxorb, Pb, [23]uint8{0xa8, 0xf6, 00, 0x84, 0x84}}, - {ATESTL, ytestl, Px, [23]uint8{0xa9, 0xf7, 00, 0x85, 0x85}}, - {ATESTQ, ytestl, Pw, [23]uint8{0xa9, 0xf7, 00, 0x85, 0x85}}, - {ATESTW, ytestl, Pe, [23]uint8{0xa9, 0xf7, 00, 0x85, 0x85}}, - {obj.ATEXT, ytext, Px, [23]uint8{}}, - {AUCOMISD, yxm, Pe, [23]uint8{0x2e}}, - {AUCOMISS, yxm, Pm, [23]uint8{0x2e}}, - {AUNPCKHPD, yxm, Pe, [23]uint8{0x15}}, - {AUNPCKHPS, yxm, Pm, [23]uint8{0x15}}, - {AUNPCKLPD, yxm, Pe, [23]uint8{0x14}}, - {AUNPCKLPS, yxm, Pm, [23]uint8{0x14}}, - {AVERR, ydivl, Pm, [23]uint8{0x00, 04}}, - {AVERW, ydivl, Pm, [23]uint8{0x00, 05}}, - {AWAIT, ynone, Px, [23]uint8{0x9b}}, - {AWORD, ybyte, Px, [23]uint8{2}}, - {AXCHGB, yml_mb, Pb, [23]uint8{0x86, 0x86}}, - {AXCHGL, yxchg, Px, [23]uint8{0x90, 0x90, 0x87, 0x87}}, - {AXCHGQ, yxchg, Pw, [23]uint8{0x90, 0x90, 0x87, 0x87}}, - {AXCHGW, yxchg, Pe, [23]uint8{0x90, 0x90, 0x87, 0x87}}, - {AXLAT, ynone, Px, [23]uint8{0xd7}}, - {AXORB, yxorb, Pb, [23]uint8{0x34, 0x80, 06, 0x30, 0x32}}, - {AXORL, yaddl, Px, [23]uint8{0x83, 06, 0x35, 0x81, 06, 0x31, 0x33}}, - {AXORPD, yxm, Pe, [23]uint8{0x57}}, - {AXORPS, yxm, Pm, [23]uint8{0x57}}, - {AXORQ, yaddl, Pw, [23]uint8{0x83, 06, 0x35, 0x81, 06, 0x31, 0x33}}, - {AXORW, yaddl, Pe, [23]uint8{0x83, 06, 0x35, 0x81, 06, 0x31, 0x33}}, - {AFMOVB, yfmvx, Px, [23]uint8{0xdf, 04}}, - {AFMOVBP, yfmvp, Px, [23]uint8{0xdf, 06}}, - {AFMOVD, yfmvd, Px, [23]uint8{0xdd, 00, 0xdd, 02, 0xd9, 00, 0xdd, 02}}, - {AFMOVDP, yfmvdp, Px, [23]uint8{0xdd, 03, 0xdd, 03}}, - {AFMOVF, yfmvf, Px, [23]uint8{0xd9, 00, 0xd9, 02}}, - {AFMOVFP, yfmvp, Px, [23]uint8{0xd9, 03}}, - {AFMOVL, yfmvf, Px, [23]uint8{0xdb, 00, 0xdb, 02}}, - {AFMOVLP, yfmvp, Px, [23]uint8{0xdb, 03}}, - {AFMOVV, yfmvx, Px, [23]uint8{0xdf, 05}}, - {AFMOVVP, yfmvp, Px, [23]uint8{0xdf, 07}}, - {AFMOVW, yfmvf, Px, [23]uint8{0xdf, 00, 0xdf, 02}}, - {AFMOVWP, yfmvp, Px, [23]uint8{0xdf, 03}}, - {AFMOVX, yfmvx, Px, [23]uint8{0xdb, 05}}, - {AFMOVXP, yfmvp, Px, [23]uint8{0xdb, 07}}, - {AFCMOVCC, yfcmv, Px, [23]uint8{0xdb, 00}}, - {AFCMOVCS, yfcmv, Px, [23]uint8{0xda, 00}}, - {AFCMOVEQ, yfcmv, Px, [23]uint8{0xda, 01}}, - {AFCMOVHI, yfcmv, Px, [23]uint8{0xdb, 02}}, - {AFCMOVLS, yfcmv, Px, [23]uint8{0xda, 02}}, - {AFCMOVNE, yfcmv, Px, [23]uint8{0xdb, 01}}, - {AFCMOVNU, yfcmv, Px, [23]uint8{0xdb, 03}}, - {AFCMOVUN, yfcmv, Px, [23]uint8{0xda, 03}}, - {AFCOMD, yfadd, Px, [23]uint8{0xdc, 02, 0xd8, 02, 0xdc, 02}}, /* botch */ - {AFCOMDP, yfadd, Px, [23]uint8{0xdc, 03, 0xd8, 03, 0xdc, 03}}, /* botch */ - {AFCOMDPP, ycompp, Px, [23]uint8{0xde, 03}}, - {AFCOMF, yfmvx, Px, [23]uint8{0xd8, 02}}, - {AFCOMFP, yfmvx, Px, [23]uint8{0xd8, 03}}, - {AFCOMI, yfmvx, Px, [23]uint8{0xdb, 06}}, - {AFCOMIP, yfmvx, Px, [23]uint8{0xdf, 06}}, - {AFCOML, yfmvx, Px, [23]uint8{0xda, 02}}, - {AFCOMLP, yfmvx, Px, [23]uint8{0xda, 03}}, - {AFCOMW, yfmvx, Px, [23]uint8{0xde, 02}}, - {AFCOMWP, yfmvx, Px, [23]uint8{0xde, 03}}, - {AFUCOM, ycompp, Px, [23]uint8{0xdd, 04}}, - {AFUCOMI, ycompp, Px, [23]uint8{0xdb, 05}}, - {AFUCOMIP, ycompp, Px, [23]uint8{0xdf, 05}}, - {AFUCOMP, ycompp, Px, [23]uint8{0xdd, 05}}, - {AFUCOMPP, ycompp, Px, [23]uint8{0xda, 13}}, - {AFADDDP, ycompp, Px, [23]uint8{0xde, 00}}, - {AFADDW, yfmvx, Px, [23]uint8{0xde, 00}}, - {AFADDL, yfmvx, Px, [23]uint8{0xda, 00}}, - {AFADDF, yfmvx, Px, [23]uint8{0xd8, 00}}, - {AFADDD, yfadd, Px, [23]uint8{0xdc, 00, 0xd8, 00, 0xdc, 00}}, - {AFMULDP, ycompp, Px, [23]uint8{0xde, 01}}, - {AFMULW, yfmvx, Px, [23]uint8{0xde, 01}}, - {AFMULL, yfmvx, Px, [23]uint8{0xda, 01}}, - {AFMULF, yfmvx, Px, [23]uint8{0xd8, 01}}, - {AFMULD, yfadd, Px, [23]uint8{0xdc, 01, 0xd8, 01, 0xdc, 01}}, - {AFSUBDP, ycompp, Px, [23]uint8{0xde, 05}}, - {AFSUBW, yfmvx, Px, [23]uint8{0xde, 04}}, - {AFSUBL, yfmvx, Px, [23]uint8{0xda, 04}}, - {AFSUBF, yfmvx, Px, [23]uint8{0xd8, 04}}, - {AFSUBD, yfadd, Px, [23]uint8{0xdc, 04, 0xd8, 04, 0xdc, 05}}, - {AFSUBRDP, ycompp, Px, [23]uint8{0xde, 04}}, - {AFSUBRW, yfmvx, Px, [23]uint8{0xde, 05}}, - {AFSUBRL, yfmvx, Px, [23]uint8{0xda, 05}}, - {AFSUBRF, yfmvx, Px, [23]uint8{0xd8, 05}}, - {AFSUBRD, yfadd, Px, [23]uint8{0xdc, 05, 0xd8, 05, 0xdc, 04}}, - {AFDIVDP, ycompp, Px, [23]uint8{0xde, 07}}, - {AFDIVW, yfmvx, Px, [23]uint8{0xde, 06}}, - {AFDIVL, yfmvx, Px, [23]uint8{0xda, 06}}, - {AFDIVF, yfmvx, Px, [23]uint8{0xd8, 06}}, - {AFDIVD, yfadd, Px, [23]uint8{0xdc, 06, 0xd8, 06, 0xdc, 07}}, - {AFDIVRDP, ycompp, Px, [23]uint8{0xde, 06}}, - {AFDIVRW, yfmvx, Px, [23]uint8{0xde, 07}}, - {AFDIVRL, yfmvx, Px, [23]uint8{0xda, 07}}, - {AFDIVRF, yfmvx, Px, [23]uint8{0xd8, 07}}, - {AFDIVRD, yfadd, Px, [23]uint8{0xdc, 07, 0xd8, 07, 0xdc, 06}}, - {AFXCHD, yfxch, Px, [23]uint8{0xd9, 01, 0xd9, 01}}, - {AFFREE, nil, 0, [23]uint8{}}, - {AFLDCW, ysvrs, Px, [23]uint8{0xd9, 05, 0xd9, 05}}, - {AFLDENV, ysvrs, Px, [23]uint8{0xd9, 04, 0xd9, 04}}, - {AFRSTOR, ysvrs, Px, [23]uint8{0xdd, 04, 0xdd, 04}}, - {AFSAVE, ysvrs, Px, [23]uint8{0xdd, 06, 0xdd, 06}}, - {AFSTCW, ysvrs, Px, [23]uint8{0xd9, 07, 0xd9, 07}}, - {AFSTENV, ysvrs, Px, [23]uint8{0xd9, 06, 0xd9, 06}}, - {AFSTSW, ystsw, Px, [23]uint8{0xdd, 07, 0xdf, 0xe0}}, - {AF2XM1, ynone, Px, [23]uint8{0xd9, 0xf0}}, - {AFABS, ynone, Px, [23]uint8{0xd9, 0xe1}}, - {AFCHS, ynone, Px, [23]uint8{0xd9, 0xe0}}, - {AFCLEX, ynone, Px, [23]uint8{0xdb, 0xe2}}, - {AFCOS, ynone, Px, [23]uint8{0xd9, 0xff}}, - {AFDECSTP, ynone, Px, [23]uint8{0xd9, 0xf6}}, - {AFINCSTP, ynone, Px, [23]uint8{0xd9, 0xf7}}, - {AFINIT, ynone, Px, [23]uint8{0xdb, 0xe3}}, - {AFLD1, ynone, Px, [23]uint8{0xd9, 0xe8}}, - {AFLDL2E, ynone, Px, [23]uint8{0xd9, 0xea}}, - {AFLDL2T, ynone, Px, [23]uint8{0xd9, 0xe9}}, - {AFLDLG2, ynone, Px, [23]uint8{0xd9, 0xec}}, - {AFLDLN2, ynone, Px, [23]uint8{0xd9, 0xed}}, - {AFLDPI, ynone, Px, [23]uint8{0xd9, 0xeb}}, - {AFLDZ, ynone, Px, [23]uint8{0xd9, 0xee}}, - {AFNOP, ynone, Px, [23]uint8{0xd9, 0xd0}}, - {AFPATAN, ynone, Px, [23]uint8{0xd9, 0xf3}}, - {AFPREM, ynone, Px, [23]uint8{0xd9, 0xf8}}, - {AFPREM1, ynone, Px, [23]uint8{0xd9, 0xf5}}, - {AFPTAN, ynone, Px, [23]uint8{0xd9, 0xf2}}, - {AFRNDINT, ynone, Px, [23]uint8{0xd9, 0xfc}}, - {AFSCALE, ynone, Px, [23]uint8{0xd9, 0xfd}}, - {AFSIN, ynone, Px, [23]uint8{0xd9, 0xfe}}, - {AFSINCOS, ynone, Px, [23]uint8{0xd9, 0xfb}}, - {AFSQRT, ynone, Px, [23]uint8{0xd9, 0xfa}}, - {AFTST, ynone, Px, [23]uint8{0xd9, 0xe4}}, - {AFXAM, ynone, Px, [23]uint8{0xd9, 0xe5}}, - {AFXTRACT, ynone, Px, [23]uint8{0xd9, 0xf4}}, - {AFYL2X, ynone, Px, [23]uint8{0xd9, 0xf1}}, - {AFYL2XP1, ynone, Px, [23]uint8{0xd9, 0xf9}}, - {ACMPXCHGB, yrb_mb, Pb, [23]uint8{0x0f, 0xb0}}, - {ACMPXCHGL, yrl_ml, Px, [23]uint8{0x0f, 0xb1}}, - {ACMPXCHGW, yrl_ml, Pe, [23]uint8{0x0f, 0xb1}}, - {ACMPXCHGQ, yrl_ml, Pw, [23]uint8{0x0f, 0xb1}}, - {ACMPXCHG8B, yscond, Pm, [23]uint8{0xc7, 01}}, - {AINVD, ynone, Pm, [23]uint8{0x08}}, - {AINVLPG, ydivb, Pm, [23]uint8{0x01, 07}}, - {ALFENCE, ynone, Pm, [23]uint8{0xae, 0xe8}}, - {AMFENCE, ynone, Pm, [23]uint8{0xae, 0xf0}}, - {AMOVNTIL, yrl_ml, Pm, [23]uint8{0xc3}}, - {AMOVNTIQ, yrl_ml, Pw, [23]uint8{0x0f, 0xc3}}, - {ARDMSR, ynone, Pm, [23]uint8{0x32}}, - {ARDPMC, ynone, Pm, [23]uint8{0x33}}, - {ARDTSC, ynone, Pm, [23]uint8{0x31}}, - {ARSM, ynone, Pm, [23]uint8{0xaa}}, - {ASFENCE, ynone, Pm, [23]uint8{0xae, 0xf8}}, - {ASYSRET, ynone, Pm, [23]uint8{0x07}}, - {AWBINVD, ynone, Pm, [23]uint8{0x09}}, - {AWRMSR, ynone, Pm, [23]uint8{0x30}}, - {AXADDB, yrb_mb, Pb, [23]uint8{0x0f, 0xc0}}, - {AXADDL, yrl_ml, Px, [23]uint8{0x0f, 0xc1}}, - {AXADDQ, yrl_ml, Pw, [23]uint8{0x0f, 0xc1}}, - {AXADDW, yrl_ml, Pe, [23]uint8{0x0f, 0xc1}}, - {ACRC32B, ycrc32l, Px, [23]uint8{0xf2, 0x0f, 0x38, 0xf0, 0}}, - {ACRC32Q, ycrc32l, Pw, [23]uint8{0xf2, 0x0f, 0x38, 0xf1, 0}}, - {APREFETCHT0, yprefetch, Pm, [23]uint8{0x18, 01}}, - {APREFETCHT1, yprefetch, Pm, [23]uint8{0x18, 02}}, - {APREFETCHT2, yprefetch, Pm, [23]uint8{0x18, 03}}, - {APREFETCHNTA, yprefetch, Pm, [23]uint8{0x18, 00}}, - {AMOVQL, yrl_ml, Px, [23]uint8{0x89}}, - {obj.AUNDEF, ynone, Px, [23]uint8{0x0f, 0x0b}}, - {AAESENC, yaes, Pq, [23]uint8{0x38, 0xdc, 0}}, - {AAESENCLAST, yaes, Pq, [23]uint8{0x38, 0xdd, 0}}, - {AAESDEC, yaes, Pq, [23]uint8{0x38, 0xde, 0}}, - {AAESDECLAST, yaes, Pq, [23]uint8{0x38, 0xdf, 0}}, - {AAESIMC, yaes, Pq, [23]uint8{0x38, 0xdb, 0}}, - {AAESKEYGENASSIST, yxshuf, Pq, [23]uint8{0x3a, 0xdf, 0}}, - {AROUNDPD, yxshuf, Pq, [23]uint8{0x3a, 0x09, 0}}, - {AROUNDPS, yxshuf, Pq, [23]uint8{0x3a, 0x08, 0}}, - {AROUNDSD, yxshuf, Pq, [23]uint8{0x3a, 0x0b, 0}}, - {AROUNDSS, yxshuf, Pq, [23]uint8{0x3a, 0x0a, 0}}, - {APSHUFD, yxshuf, Pq, [23]uint8{0x70, 0}}, - {APCLMULQDQ, yxshuf, Pq, [23]uint8{0x3a, 0x44, 0}}, - {APCMPESTRI, yxshuf, Pq, [23]uint8{0x3a, 0x61, 0}}, - {AMOVDDUP, yxm, Pf2, [23]uint8{0x12}}, - {AMOVSHDUP, yxm, Pf3, [23]uint8{0x16}}, - {AMOVSLDUP, yxm, Pf3, [23]uint8{0x12}}, - - {AANDNL, yvex_r3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF2}}, - {AANDNQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF2}}, - {ABEXTRL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF7}}, - {ABEXTRQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF7}}, - {ABZHIL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF5}}, - {ABZHIQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF5}}, - {AMULXL, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W0, 0xF6}}, - {AMULXQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W1, 0xF6}}, - {APDEPL, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W0, 0xF5}}, - {APDEPQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W1, 0xF5}}, - {APEXTL, yvex_r3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W0, 0xF5}}, - {APEXTQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W1, 0xF5}}, - {ASARXL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W0, 0xF7}}, - {ASARXQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W1, 0xF7}}, - {ASHLXL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_66_0F38_W0, 0xF7}}, - {ASHLXQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_66_0F38_W1, 0xF7}}, - {ASHRXL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W0, 0xF7}}, - {ASHRXQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W1, 0xF7}}, - - {AVZEROUPPER, ynone, Px, [23]uint8{0xc5, 0xf8, 0x77}}, - {AVMOVDQU, yvex_vmovdqa, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x6F, VEX_128_F3_0F_WIG, 0x7F, VEX_256_F3_0F_WIG, 0x6F, VEX_256_F3_0F_WIG, 0x7F}}, - {AVMOVDQA, yvex_vmovdqa, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x6F, VEX_128_66_0F_WIG, 0x7F, VEX_256_66_0F_WIG, 0x6F, VEX_256_66_0F_WIG, 0x7F}}, - {AVMOVNTDQ, yvex_vmovntdq, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xE7, VEX_256_66_0F_WIG, 0xE7}}, - {AVPCMPEQB, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x74, VEX_256_66_0F_WIG, 0x74}}, - {AVPXOR, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xEF, VEX_256_66_0F_WIG, 0xEF}}, - {AVPMOVMSKB, yvex_xyr2, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xD7, VEX_256_66_0F_WIG, 0xD7}}, - {AVPAND, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xDB, VEX_256_66_0F_WIG, 0xDB}}, - {AVPBROADCASTB, yvex_vpbroadcast, Pvex, [23]uint8{VEX_128_66_0F38_W0, 0x78, VEX_256_66_0F38_W0, 0x78}}, - {AVPTEST, yvex_xy2, Pvex, [23]uint8{VEX_128_66_0F38_WIG, 0x17, VEX_256_66_0F38_WIG, 0x17}}, - {AVPSHUFB, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F38_WIG, 0x00, VEX_256_66_0F38_WIG, 0x00}}, - {AVPSHUFD, yvex_xyi3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x70, VEX_256_66_0F_WIG, 0x70, VEX_128_66_0F_WIG, 0x70, VEX_256_66_0F_WIG, 0x70}}, - {AVPOR, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xeb, VEX_256_66_0F_WIG, 0xeb}}, - {AVPADDQ, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xd4, VEX_256_66_0F_WIG, 0xd4}}, - {AVPADDD, yvex_xy3, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0xfe, VEX_256_66_0F_WIG, 0xfe}}, - {AVPSLLD, yvex_shift, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x72, 0xf0, VEX_256_66_0F_WIG, 0x72, 0xf0, VEX_128_66_0F_WIG, 0xf2, VEX_256_66_0F_WIG, 0xf2}}, - {AVPSLLQ, yvex_shift, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x73, 0xf0, VEX_256_66_0F_WIG, 0x73, 0xf0, VEX_128_66_0F_WIG, 0xf3, VEX_256_66_0F_WIG, 0xf3}}, - {AVPSRLD, yvex_shift, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x72, 0xd0, VEX_256_66_0F_WIG, 0x72, 0xd0, VEX_128_66_0F_WIG, 0xd2, VEX_256_66_0F_WIG, 0xd2}}, - {AVPSRLQ, yvex_shift, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x73, 0xd0, VEX_256_66_0F_WIG, 0x73, 0xd0, VEX_128_66_0F_WIG, 0xd3, VEX_256_66_0F_WIG, 0xd3}}, - {AVPSRLDQ, yvex_shift_dq, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x73, 0xd8, VEX_256_66_0F_WIG, 0x73, 0xd8}}, - {AVPSLLDQ, yvex_shift_dq, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x73, 0xf8, VEX_256_66_0F_WIG, 0x73, 0xf8}}, - {AVPERM2F128, yvex_yyi4, Pvex, [23]uint8{VEX_256_66_0F3A_W0, 0x06}}, - {AVPALIGNR, yvex_yyi4, Pvex, [23]uint8{VEX_256_66_0F3A_WIG, 0x0f}}, - {AVPBLENDD, yvex_yyi4, Pvex, [23]uint8{VEX_256_66_0F3A_WIG, 0x02}}, - {AVINSERTI128, yvex_xyi4, Pvex, [23]uint8{VEX_256_66_0F3A_WIG, 0x38}}, - {AVPERM2I128, yvex_yyi4, Pvex, [23]uint8{VEX_256_66_0F3A_WIG, 0x46}}, - {ARORXL, yvex_ri3, Pvex, [23]uint8{VEX_LZ_F2_0F3A_W0, 0xf0}}, - {ARORXQ, yvex_ri3, Pvex, [23]uint8{VEX_LZ_F2_0F3A_W1, 0xf0}}, - {AVBROADCASTSD, yvex_vpbroadcast_sd, Pvex, [23]uint8{VEX_256_66_0F38_W0, 0x19}}, - {AVBROADCASTSS, yvex_vpbroadcast, Pvex, [23]uint8{VEX_128_66_0F38_W0, 0x18, VEX_256_66_0F38_W0, 0x18}}, - {AVMOVDDUP, yvex_xy2, Pvex, [23]uint8{VEX_128_F2_0F_WIG, 0x12, VEX_256_F2_0F_WIG, 0x12}}, - {AVMOVSHDUP, yvex_xy2, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x16, VEX_256_F3_0F_WIG, 0x16}}, - {AVMOVSLDUP, yvex_xy2, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x12, VEX_256_F3_0F_WIG, 0x12}}, - - {AXACQUIRE, ynone, Px, [23]uint8{0xf2}}, - {AXRELEASE, ynone, Px, [23]uint8{0xf3}}, - {AXBEGIN, yxbegin, Px, [23]uint8{0xc7, 0xf8}}, - {AXABORT, yxabort, Px, [23]uint8{0xc6, 0xf8}}, - {AXEND, ynone, Px, [23]uint8{0x0f, 01, 0xd5}}, - {AXTEST, ynone, Px, [23]uint8{0x0f, 01, 0xd6}}, - {AXGETBV, ynone, Pm, [23]uint8{01, 0xd0}}, - {obj.AUSEFIELD, ynop, Px, [23]uint8{0, 0}}, - {obj.ATYPE, nil, 0, [23]uint8{}}, - {obj.AFUNCDATA, yfuncdata, Px, [23]uint8{0, 0}}, - {obj.APCDATA, ypcdata, Px, [23]uint8{0, 0}}, - {obj.AVARDEF, nil, 0, [23]uint8{}}, - {obj.AVARKILL, nil, 0, [23]uint8{}}, - {obj.ADUFFCOPY, yduff, Px, [23]uint8{0xe8}}, - {obj.ADUFFZERO, yduff, Px, [23]uint8{0xe8}}, - {obj.AEND, nil, 0, [23]uint8{}}, - {0, nil, 0, [23]uint8{}}, -} - -var opindex [(ALAST + 1) & obj.AMask]*Optab - -// isextern reports whether s describes an external symbol that must avoid pc-relative addressing. -// This happens on systems like Solaris that call .so functions instead of system calls. -// It does not seem to be necessary for any other systems. This is probably working -// around a Solaris-specific bug that should be fixed differently, but we don't know -// what that bug is. And this does fix it. -func isextern(s *obj.LSym) bool { - // All the Solaris dynamic imports from libc.so begin with "libc_". - return strings.HasPrefix(s.Name, "libc_") -} - -// single-instruction no-ops of various lengths. -// constructed by hand and disassembled with gdb to verify. -// see http://www.agner.org/optimize/optimizing_assembly.pdf for discussion. -var nop = [][16]uint8{ - {0x90}, - {0x66, 0x90}, - {0x0F, 0x1F, 0x00}, - {0x0F, 0x1F, 0x40, 0x00}, - {0x0F, 0x1F, 0x44, 0x00, 0x00}, - {0x66, 0x0F, 0x1F, 0x44, 0x00, 0x00}, - {0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00}, - {0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, -} - -// Native Client rejects the repeated 0x66 prefix. -// {0x66, 0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, -func fillnop(p []byte, n int) { - var m int - - for n > 0 { - m = n - if m > len(nop) { - m = len(nop) - } - copy(p[:m], nop[m-1][:m]) - p = p[m:] - n -= m - } -} - -func naclpad(ctxt *obj.Link, s *obj.LSym, c int32, pad int32) int32 { - s.Grow(int64(c) + int64(pad)) - fillnop(s.P[c:], int(pad)) - return c + pad -} - -func spadjop(ctxt *obj.Link, p *obj.Prog, l, q obj.As) obj.As { - if p.Mode != 64 || ctxt.Arch.PtrSize == 4 { - return l - } - return q -} - -func span6(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - if s.P != nil { - return - } - - if ycover[0] == 0 { - instinit() - } - - for p := ctxt.Cursym.Text; p != nil; p = p.Link { - if p.To.Type == obj.TYPE_BRANCH { - if p.Pcond == nil { - p.Pcond = p - } - } - if p.As == AADJSP { - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_SP - v := int32(-p.From.Offset) - p.From.Offset = int64(v) - p.As = spadjop(ctxt, p, AADDL, AADDQ) - if v < 0 { - p.As = spadjop(ctxt, p, ASUBL, ASUBQ) - v = -v - p.From.Offset = int64(v) - } - - if v == 0 { - p.As = obj.ANOP - } - } - } - - var q *obj.Prog - var count int64 // rough count of number of instructions - for p := s.Text; p != nil; p = p.Link { - count++ - p.Back = 2 // use short branches first time through - q = p.Pcond - if q != nil && (q.Back&2 != 0) { - p.Back |= 1 // backward jump - q.Back |= 4 // loop head - } - - if p.As == AADJSP { - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_SP - v := int32(-p.From.Offset) - p.From.Offset = int64(v) - p.As = spadjop(ctxt, p, AADDL, AADDQ) - if v < 0 { - p.As = spadjop(ctxt, p, ASUBL, ASUBQ) - v = -v - p.From.Offset = int64(v) - } - - if v == 0 { - p.As = obj.ANOP - } - } - } - s.GrowCap(count * 5) // preallocate roughly 5 bytes per instruction - - n := 0 - var c int32 - errors := ctxt.Errors - var deferreturn *obj.LSym - if ctxt.Headtype == obj.Hnacl { - deferreturn = obj.Linklookup(ctxt, "runtime.deferreturn", 0) - } - for { - loop := int32(0) - for i := range s.R { - s.R[i] = obj.Reloc{} - } - s.R = s.R[:0] - s.P = s.P[:0] - c = 0 - for p := s.Text; p != nil; p = p.Link { - if ctxt.Headtype == obj.Hnacl && p.Isize > 0 { - - // pad everything to avoid crossing 32-byte boundary - if c>>5 != (c+int32(p.Isize)-1)>>5 { - c = naclpad(ctxt, s, c, -c&31) - } - - // pad call deferreturn to start at 32-byte boundary - // so that subtracting 5 in jmpdefer will jump back - // to that boundary and rerun the call. - if p.As == obj.ACALL && p.To.Sym == deferreturn { - c = naclpad(ctxt, s, c, -c&31) - } - - // pad call to end at 32-byte boundary - if p.As == obj.ACALL { - c = naclpad(ctxt, s, c, -(c+int32(p.Isize))&31) - } - - // the linker treats REP and STOSQ as different instructions - // but in fact the REP is a prefix on the STOSQ. - // make sure REP has room for 2 more bytes, so that - // padding will not be inserted before the next instruction. - if (p.As == AREP || p.As == AREPN) && c>>5 != (c+3-1)>>5 { - c = naclpad(ctxt, s, c, -c&31) - } - - // same for LOCK. - // various instructions follow; the longest is 4 bytes. - // give ourselves 8 bytes so as to avoid surprises. - if p.As == ALOCK && c>>5 != (c+8-1)>>5 { - c = naclpad(ctxt, s, c, -c&31) - } - } - - if (p.Back&4 != 0) && c&(LoopAlign-1) != 0 { - // pad with NOPs - v := -c & (LoopAlign - 1) - - if v <= MaxLoopPad { - s.Grow(int64(c) + int64(v)) - fillnop(s.P[c:], int(v)) - c += v - } - } - - p.Pc = int64(c) - - // process forward jumps to p - for q = p.Rel; q != nil; q = q.Forwd { - v := int32(p.Pc - (q.Pc + int64(q.Isize))) - if q.Back&2 != 0 { // short - if v > 127 { - loop++ - q.Back ^= 2 - } - - if q.As == AJCXZL || q.As == AXBEGIN { - s.P[q.Pc+2] = byte(v) - } else { - s.P[q.Pc+1] = byte(v) - } - } else { - binary.LittleEndian.PutUint32(s.P[q.Pc+int64(q.Isize)-4:], uint32(v)) - } - } - - p.Rel = nil - - p.Pc = int64(c) - asmins(ctxt, p) - m := ctxt.AsmBuf.Len() - if int(p.Isize) != m { - p.Isize = uint8(m) - loop++ - } - - s.Grow(p.Pc + int64(m)) - copy(s.P[p.Pc:], ctxt.AsmBuf.Bytes()) - c += int32(m) - } - - n++ - if n > 20 { - ctxt.Diag("span must be looping") - log.Fatalf("loop") - } - if loop == 0 { - break - } - if ctxt.Errors > errors { - return - } - } - - if ctxt.Headtype == obj.Hnacl { - c = naclpad(ctxt, s, c, -c&31) - } - - s.Size = int64(c) - - if false { /* debug['a'] > 1 */ - fmt.Printf("span1 %s %d (%d tries)\n %.6x", s.Name, s.Size, n, 0) - var i int - for i = 0; i < len(s.P); i++ { - fmt.Printf(" %.2x", s.P[i]) - if i%16 == 15 { - fmt.Printf("\n %.6x", uint(i+1)) - } - } - - if i%16 != 0 { - fmt.Printf("\n") - } - - for i := 0; i < len(s.R); i++ { - r := &s.R[i] - fmt.Printf(" rel %#.4x/%d %s%+d\n", uint32(r.Off), r.Siz, r.Sym.Name, r.Add) - } - } -} - -func instinit() { - for i := 1; optab[i].as != 0; i++ { - c := optab[i].as - if opindex[c&obj.AMask] != nil { - log.Fatalf("phase error in optab: %d (%v)", i, c) - } - opindex[c&obj.AMask] = &optab[i] - } - - for i := 0; i < Ymax; i++ { - ycover[i*Ymax+i] = 1 - } - - ycover[Yi0*Ymax+Yi8] = 1 - ycover[Yi1*Ymax+Yi8] = 1 - ycover[Yu7*Ymax+Yi8] = 1 - - ycover[Yi0*Ymax+Yu7] = 1 - ycover[Yi1*Ymax+Yu7] = 1 - - ycover[Yi0*Ymax+Yu8] = 1 - ycover[Yi1*Ymax+Yu8] = 1 - ycover[Yu7*Ymax+Yu8] = 1 - - ycover[Yi0*Ymax+Ys32] = 1 - ycover[Yi1*Ymax+Ys32] = 1 - ycover[Yu7*Ymax+Ys32] = 1 - ycover[Yu8*Ymax+Ys32] = 1 - ycover[Yi8*Ymax+Ys32] = 1 - - ycover[Yi0*Ymax+Yi32] = 1 - ycover[Yi1*Ymax+Yi32] = 1 - ycover[Yu7*Ymax+Yi32] = 1 - ycover[Yu8*Ymax+Yi32] = 1 - ycover[Yi8*Ymax+Yi32] = 1 - ycover[Ys32*Ymax+Yi32] = 1 - - ycover[Yi0*Ymax+Yi64] = 1 - ycover[Yi1*Ymax+Yi64] = 1 - ycover[Yu7*Ymax+Yi64] = 1 - ycover[Yu8*Ymax+Yi64] = 1 - ycover[Yi8*Ymax+Yi64] = 1 - ycover[Ys32*Ymax+Yi64] = 1 - ycover[Yi32*Ymax+Yi64] = 1 - - ycover[Yal*Ymax+Yrb] = 1 - ycover[Ycl*Ymax+Yrb] = 1 - ycover[Yax*Ymax+Yrb] = 1 - ycover[Ycx*Ymax+Yrb] = 1 - ycover[Yrx*Ymax+Yrb] = 1 - ycover[Yrl*Ymax+Yrb] = 1 // but not Yrl32 - - ycover[Ycl*Ymax+Ycx] = 1 - - ycover[Yax*Ymax+Yrx] = 1 - ycover[Ycx*Ymax+Yrx] = 1 - - ycover[Yax*Ymax+Yrl] = 1 - ycover[Ycx*Ymax+Yrl] = 1 - ycover[Yrx*Ymax+Yrl] = 1 - ycover[Yrl32*Ymax+Yrl] = 1 - - ycover[Yf0*Ymax+Yrf] = 1 - - ycover[Yal*Ymax+Ymb] = 1 - ycover[Ycl*Ymax+Ymb] = 1 - ycover[Yax*Ymax+Ymb] = 1 - ycover[Ycx*Ymax+Ymb] = 1 - ycover[Yrx*Ymax+Ymb] = 1 - ycover[Yrb*Ymax+Ymb] = 1 - ycover[Yrl*Ymax+Ymb] = 1 // but not Yrl32 - ycover[Ym*Ymax+Ymb] = 1 - - ycover[Yax*Ymax+Yml] = 1 - ycover[Ycx*Ymax+Yml] = 1 - ycover[Yrx*Ymax+Yml] = 1 - ycover[Yrl*Ymax+Yml] = 1 - ycover[Yrl32*Ymax+Yml] = 1 - ycover[Ym*Ymax+Yml] = 1 - - ycover[Yax*Ymax+Ymm] = 1 - ycover[Ycx*Ymax+Ymm] = 1 - ycover[Yrx*Ymax+Ymm] = 1 - ycover[Yrl*Ymax+Ymm] = 1 - ycover[Yrl32*Ymax+Ymm] = 1 - ycover[Ym*Ymax+Ymm] = 1 - ycover[Ymr*Ymax+Ymm] = 1 - - ycover[Ym*Ymax+Yxm] = 1 - ycover[Yxr*Ymax+Yxm] = 1 - - ycover[Ym*Ymax+Yym] = 1 - ycover[Yyr*Ymax+Yym] = 1 - - for i := 0; i < MAXREG; i++ { - reg[i] = -1 - if i >= REG_AL && i <= REG_R15B { - reg[i] = (i - REG_AL) & 7 - if i >= REG_SPB && i <= REG_DIB { - regrex[i] = 0x40 - } - if i >= REG_R8B && i <= REG_R15B { - regrex[i] = Rxr | Rxx | Rxb - } - } - - if i >= REG_AH && i <= REG_BH { - reg[i] = 4 + ((i - REG_AH) & 7) - } - if i >= REG_AX && i <= REG_R15 { - reg[i] = (i - REG_AX) & 7 - if i >= REG_R8 { - regrex[i] = Rxr | Rxx | Rxb - } - } - - if i >= REG_F0 && i <= REG_F0+7 { - reg[i] = (i - REG_F0) & 7 - } - if i >= REG_M0 && i <= REG_M0+7 { - reg[i] = (i - REG_M0) & 7 - } - if i >= REG_X0 && i <= REG_X0+15 { - reg[i] = (i - REG_X0) & 7 - if i >= REG_X0+8 { - regrex[i] = Rxr | Rxx | Rxb - } - } - if i >= REG_Y0 && i <= REG_Y0+15 { - reg[i] = (i - REG_Y0) & 7 - if i >= REG_Y0+8 { - regrex[i] = Rxr | Rxx | Rxb - } - } - - if i >= REG_CR+8 && i <= REG_CR+15 { - regrex[i] = Rxr - } - } -} - -var isAndroid = (obj.GOOS == "android") - -func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int { - if a.Reg < REG_CS && a.Index < REG_CS { // fast path - return 0 - } - if a.Type == obj.TYPE_MEM && a.Name == obj.NAME_NONE { - switch a.Reg { - case REG_CS: - return 0x2e - - case REG_DS: - return 0x3e - - case REG_ES: - return 0x26 - - case REG_FS: - return 0x64 - - case REG_GS: - return 0x65 - - case REG_TLS: - // NOTE: Systems listed here should be only systems that - // support direct TLS references like 8(TLS) implemented as - // direct references from FS or GS. Systems that require - // the initial-exec model, where you load the TLS base into - // a register and then index from that register, do not reach - // this code and should not be listed. - if p.Mode == 32 { - switch ctxt.Headtype { - default: - if isAndroid { - return 0x65 // GS - } - log.Fatalf("unknown TLS base register for %v", ctxt.Headtype) - - case obj.Hdarwin, - obj.Hdragonfly, - obj.Hfreebsd, - obj.Hnetbsd, - obj.Hopenbsd: - return 0x65 // GS - } - } - - switch ctxt.Headtype { - default: - log.Fatalf("unknown TLS base register for %v", ctxt.Headtype) - - case obj.Hlinux: - if isAndroid { - return 0x64 // FS - } - - if ctxt.Flag_shared { - log.Fatalf("unknown TLS base register for linux with -shared") - } else { - return 0x64 // FS - } - - case obj.Hdragonfly, - obj.Hfreebsd, - obj.Hnetbsd, - obj.Hopenbsd, - obj.Hsolaris: - return 0x64 // FS - - case obj.Hdarwin: - return 0x65 // GS - } - } - } - - if p.Mode == 32 { - if a.Index == REG_TLS && ctxt.Flag_shared { - // When building for inclusion into a shared library, an instruction of the form - // MOVL 0(CX)(TLS*1), AX - // becomes - // mov %gs:(%ecx), %eax - // which assumes that the correct TLS offset has been loaded into %ecx (today - // there is only one TLS variable -- g -- so this is OK). When not building for - // a shared library the instruction it becomes - // mov 0x0(%ecx), $eax - // and a R_TLS_LE relocation, and so does not require a prefix. - if a.Offset != 0 { - ctxt.Diag("cannot handle non-0 offsets to TLS") - } - return 0x65 // GS - } - return 0 - } - - switch a.Index { - case REG_CS: - return 0x2e - - case REG_DS: - return 0x3e - - case REG_ES: - return 0x26 - - case REG_TLS: - if ctxt.Flag_shared { - // When building for inclusion into a shared library, an instruction of the form - // MOV 0(CX)(TLS*1), AX - // becomes - // mov %fs:(%rcx), %rax - // which assumes that the correct TLS offset has been loaded into %rcx (today - // there is only one TLS variable -- g -- so this is OK). When not building for - // a shared library the instruction does not require a prefix. - if a.Offset != 0 { - log.Fatalf("cannot handle non-0 offsets to TLS") - } - return 0x64 - } - - case REG_FS: - return 0x64 - - case REG_GS: - return 0x65 - } - - return 0 -} - -func oclass(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int { - switch a.Type { - case obj.TYPE_NONE: - return Ynone - - case obj.TYPE_BRANCH: - return Ybr - - case obj.TYPE_INDIR: - if a.Name != obj.NAME_NONE && a.Reg == REG_NONE && a.Index == REG_NONE && a.Scale == 0 { - return Yindir - } - return Yxxx - - case obj.TYPE_MEM: - if a.Index == REG_SP { - // Can't use SP as the index register - return Yxxx - } - if ctxt.Asmode == 64 { - switch a.Name { - case obj.NAME_EXTERN, obj.NAME_STATIC, obj.NAME_GOTREF: - // Global variables can't use index registers and their - // base register is %rip (%rip is encoded as REG_NONE). - if a.Reg != REG_NONE || a.Index != REG_NONE || a.Scale != 0 { - return Yxxx - } - case obj.NAME_AUTO, obj.NAME_PARAM: - // These names must have a base of SP. The old compiler - // uses 0 for the base register. SSA uses REG_SP. - if a.Reg != REG_SP && a.Reg != 0 { - return Yxxx - } - case obj.NAME_NONE: - // everything is ok - default: - // unknown name - return Yxxx - } - } - return Ym - - case obj.TYPE_ADDR: - switch a.Name { - case obj.NAME_GOTREF: - ctxt.Diag("unexpected TYPE_ADDR with NAME_GOTREF") - return Yxxx - - case obj.NAME_EXTERN, - obj.NAME_STATIC: - if a.Sym != nil && isextern(a.Sym) || (p.Mode == 32 && !ctxt.Flag_shared) { - return Yi32 - } - return Yiauto // use pc-relative addressing - - case obj.NAME_AUTO, - obj.NAME_PARAM: - return Yiauto - } - - // TODO(rsc): DUFFZERO/DUFFCOPY encoding forgot to set a->index - // and got Yi32 in an earlier version of this code. - // Keep doing that until we fix yduff etc. - if a.Sym != nil && strings.HasPrefix(a.Sym.Name, "runtime.duff") { - return Yi32 - } - - if a.Sym != nil || a.Name != obj.NAME_NONE { - ctxt.Diag("unexpected addr: %v", obj.Dconv(p, a)) - } - fallthrough - - // fall through - - case obj.TYPE_CONST: - if a.Sym != nil { - ctxt.Diag("TYPE_CONST with symbol: %v", obj.Dconv(p, a)) - } - - v := a.Offset - if p.Mode == 32 { - v = int64(int32(v)) - } - if v == 0 { - if p.Mark&PRESERVEFLAGS != 0 { - // If PRESERVEFLAGS is set, avoid MOV $0, AX turning into XOR AX, AX. - return Yu7 - } - return Yi0 - } - if v == 1 { - return Yi1 - } - if v >= 0 && v <= 127 { - return Yu7 - } - if v >= 0 && v <= 255 { - return Yu8 - } - if v >= -128 && v <= 127 { - return Yi8 - } - if p.Mode == 32 { - return Yi32 - } - l := int32(v) - if int64(l) == v { - return Ys32 /* can sign extend */ - } - if v>>32 == 0 { - return Yi32 /* unsigned */ - } - return Yi64 - - case obj.TYPE_TEXTSIZE: - return Ytextsize - } - - if a.Type != obj.TYPE_REG { - ctxt.Diag("unexpected addr1: type=%d %v", a.Type, obj.Dconv(p, a)) - return Yxxx - } - - switch a.Reg { - case REG_AL: - return Yal - - case REG_AX: - return Yax - - /* - case REG_SPB: - */ - case REG_BPB, - REG_SIB, - REG_DIB, - REG_R8B, - REG_R9B, - REG_R10B, - REG_R11B, - REG_R12B, - REG_R13B, - REG_R14B, - REG_R15B: - if ctxt.Asmode != 64 { - return Yxxx - } - fallthrough - - case REG_DL, - REG_BL, - REG_AH, - REG_CH, - REG_DH, - REG_BH: - return Yrb - - case REG_CL: - return Ycl - - case REG_CX: - return Ycx - - case REG_DX, REG_BX: - return Yrx - - case REG_R8, /* not really Yrl */ - REG_R9, - REG_R10, - REG_R11, - REG_R12, - REG_R13, - REG_R14, - REG_R15: - if ctxt.Asmode != 64 { - return Yxxx - } - fallthrough - - case REG_SP, REG_BP, REG_SI, REG_DI: - if p.Mode == 32 { - return Yrl32 - } - return Yrl - - case REG_F0 + 0: - return Yf0 - - case REG_F0 + 1, - REG_F0 + 2, - REG_F0 + 3, - REG_F0 + 4, - REG_F0 + 5, - REG_F0 + 6, - REG_F0 + 7: - return Yrf - - case REG_M0 + 0, - REG_M0 + 1, - REG_M0 + 2, - REG_M0 + 3, - REG_M0 + 4, - REG_M0 + 5, - REG_M0 + 6, - REG_M0 + 7: - return Ymr - - case REG_X0 + 0, - REG_X0 + 1, - REG_X0 + 2, - REG_X0 + 3, - REG_X0 + 4, - REG_X0 + 5, - REG_X0 + 6, - REG_X0 + 7, - REG_X0 + 8, - REG_X0 + 9, - REG_X0 + 10, - REG_X0 + 11, - REG_X0 + 12, - REG_X0 + 13, - REG_X0 + 14, - REG_X0 + 15: - return Yxr - - case REG_Y0 + 0, - REG_Y0 + 1, - REG_Y0 + 2, - REG_Y0 + 3, - REG_Y0 + 4, - REG_Y0 + 5, - REG_Y0 + 6, - REG_Y0 + 7, - REG_Y0 + 8, - REG_Y0 + 9, - REG_Y0 + 10, - REG_Y0 + 11, - REG_Y0 + 12, - REG_Y0 + 13, - REG_Y0 + 14, - REG_Y0 + 15: - return Yyr - - case REG_CS: - return Ycs - case REG_SS: - return Yss - case REG_DS: - return Yds - case REG_ES: - return Yes - case REG_FS: - return Yfs - case REG_GS: - return Ygs - case REG_TLS: - return Ytls - - case REG_GDTR: - return Ygdtr - case REG_IDTR: - return Yidtr - case REG_LDTR: - return Yldtr - case REG_MSW: - return Ymsw - case REG_TASK: - return Ytask - - case REG_CR + 0: - return Ycr0 - case REG_CR + 1: - return Ycr1 - case REG_CR + 2: - return Ycr2 - case REG_CR + 3: - return Ycr3 - case REG_CR + 4: - return Ycr4 - case REG_CR + 5: - return Ycr5 - case REG_CR + 6: - return Ycr6 - case REG_CR + 7: - return Ycr7 - case REG_CR + 8: - return Ycr8 - - case REG_DR + 0: - return Ydr0 - case REG_DR + 1: - return Ydr1 - case REG_DR + 2: - return Ydr2 - case REG_DR + 3: - return Ydr3 - case REG_DR + 4: - return Ydr4 - case REG_DR + 5: - return Ydr5 - case REG_DR + 6: - return Ydr6 - case REG_DR + 7: - return Ydr7 - - case REG_TR + 0: - return Ytr0 - case REG_TR + 1: - return Ytr1 - case REG_TR + 2: - return Ytr2 - case REG_TR + 3: - return Ytr3 - case REG_TR + 4: - return Ytr4 - case REG_TR + 5: - return Ytr5 - case REG_TR + 6: - return Ytr6 - case REG_TR + 7: - return Ytr7 - } - - return Yxxx -} - -func asmidx(ctxt *obj.Link, scale int, index int, base int) { - var i int - - switch index { - default: - goto bad - - case REG_NONE: - i = 4 << 3 - goto bas - - case REG_R8, - REG_R9, - REG_R10, - REG_R11, - REG_R12, - REG_R13, - REG_R14, - REG_R15: - if ctxt.Asmode != 64 { - goto bad - } - fallthrough - - case REG_AX, - REG_CX, - REG_DX, - REG_BX, - REG_BP, - REG_SI, - REG_DI: - i = reg[index] << 3 - } - - switch scale { - default: - goto bad - - case 1: - break - - case 2: - i |= 1 << 6 - - case 4: - i |= 2 << 6 - - case 8: - i |= 3 << 6 - } - -bas: - switch base { - default: - goto bad - - case REG_NONE: /* must be mod=00 */ - i |= 5 - - case REG_R8, - REG_R9, - REG_R10, - REG_R11, - REG_R12, - REG_R13, - REG_R14, - REG_R15: - if ctxt.Asmode != 64 { - goto bad - } - fallthrough - - case REG_AX, - REG_CX, - REG_DX, - REG_BX, - REG_SP, - REG_BP, - REG_SI, - REG_DI: - i |= reg[base] - } - - ctxt.AsmBuf.Put1(byte(i)) - return - -bad: - ctxt.Diag("asmidx: bad address %d/%d/%d", scale, index, base) - ctxt.AsmBuf.Put1(0) - return -} - -func relput4(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { - var rel obj.Reloc - - v := vaddr(ctxt, p, a, &rel) - if rel.Siz != 0 { - if rel.Siz != 4 { - ctxt.Diag("bad reloc") - } - r := obj.Addrel(ctxt.Cursym) - *r = rel - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - } - - ctxt.AsmBuf.PutInt32(int32(v)) -} - -/* -static void -relput8(Prog *p, Addr *a) -{ - vlong v; - Reloc rel, *r; - - v = vaddr(ctxt, p, a, &rel); - if(rel.siz != 0) { - r = addrel(ctxt->cursym); - *r = rel; - r->siz = 8; - r->off = p->pc + ctxt->andptr - ctxt->and; - } - put8(ctxt, v); -} -*/ -func vaddr(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, r *obj.Reloc) int64 { - if r != nil { - *r = obj.Reloc{} - } - - switch a.Name { - case obj.NAME_STATIC, - obj.NAME_GOTREF, - obj.NAME_EXTERN: - s := a.Sym - if r == nil { - ctxt.Diag("need reloc for %v", obj.Dconv(p, a)) - log.Fatalf("reloc") - } - - if a.Name == obj.NAME_GOTREF { - r.Siz = 4 - r.Type = obj.R_GOTPCREL - } else if isextern(s) || (p.Mode != 64 && !ctxt.Flag_shared) { - r.Siz = 4 - r.Type = obj.R_ADDR - } else { - r.Siz = 4 - r.Type = obj.R_PCREL - } - - r.Off = -1 // caller must fill in - r.Sym = s - r.Add = a.Offset - - return 0 - } - - if (a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR) && a.Reg == REG_TLS { - if r == nil { - ctxt.Diag("need reloc for %v", obj.Dconv(p, a)) - log.Fatalf("reloc") - } - - if !ctxt.Flag_shared || isAndroid || ctxt.Headtype == obj.Hdarwin { - r.Type = obj.R_TLS_LE - r.Siz = 4 - r.Off = -1 // caller must fill in - r.Add = a.Offset - } - return 0 - } - - return a.Offset -} - -func asmandsz(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, r int, rex int, m64 int) { - var base int - var rel obj.Reloc - - rex &= 0x40 | Rxr - switch { - case int64(int32(a.Offset)) == a.Offset: - // Offset fits in sign-extended 32 bits. - case int64(uint32(a.Offset)) == a.Offset && ctxt.Rexflag&Rxw == 0: - // Offset fits in zero-extended 32 bits in a 32-bit instruction. - // This is allowed for assembly that wants to use 32-bit hex - // constants, e.g. LEAL 0x99999999(AX), AX. - default: - ctxt.Diag("offset too large in %s", p) - } - v := int32(a.Offset) - rel.Siz = 0 - - switch a.Type { - case obj.TYPE_ADDR: - if a.Name == obj.NAME_NONE { - ctxt.Diag("unexpected TYPE_ADDR with NAME_NONE") - } - if a.Index == REG_TLS { - ctxt.Diag("unexpected TYPE_ADDR with index==REG_TLS") - } - goto bad - - case obj.TYPE_REG: - if a.Reg < REG_AL || REG_Y0+15 < a.Reg { - goto bad - } - if v != 0 { - goto bad - } - ctxt.AsmBuf.Put1(byte(3<<6 | reg[a.Reg]<<0 | r<<3)) - ctxt.Rexflag |= regrex[a.Reg]&(0x40|Rxb) | rex - return - } - - if a.Type != obj.TYPE_MEM { - goto bad - } - - if a.Index != REG_NONE && a.Index != REG_TLS { - base := int(a.Reg) - switch a.Name { - case obj.NAME_EXTERN, - obj.NAME_GOTREF, - obj.NAME_STATIC: - if !isextern(a.Sym) && p.Mode == 64 { - goto bad - } - if p.Mode == 32 && ctxt.Flag_shared { - // The base register has already been set. It holds the PC - // of this instruction returned by a PC-reading thunk. - // See obj6.go:rewriteToPcrel. - } else { - base = REG_NONE - } - v = int32(vaddr(ctxt, p, a, &rel)) - - case obj.NAME_AUTO, - obj.NAME_PARAM: - base = REG_SP - } - - ctxt.Rexflag |= regrex[int(a.Index)]&Rxx | regrex[base]&Rxb | rex - if base == REG_NONE { - ctxt.AsmBuf.Put1(byte(0<<6 | 4<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), int(a.Index), base) - goto putrelv - } - - if v == 0 && rel.Siz == 0 && base != REG_BP && base != REG_R13 { - ctxt.AsmBuf.Put1(byte(0<<6 | 4<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), int(a.Index), base) - return - } - - if v >= -128 && v < 128 && rel.Siz == 0 { - ctxt.AsmBuf.Put1(byte(1<<6 | 4<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), int(a.Index), base) - ctxt.AsmBuf.Put1(byte(v)) - return - } - - ctxt.AsmBuf.Put1(byte(2<<6 | 4<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), int(a.Index), base) - goto putrelv - } - - base = int(a.Reg) - switch a.Name { - case obj.NAME_STATIC, - obj.NAME_GOTREF, - obj.NAME_EXTERN: - if a.Sym == nil { - ctxt.Diag("bad addr: %v", p) - } - if p.Mode == 32 && ctxt.Flag_shared { - // The base register has already been set. It holds the PC - // of this instruction returned by a PC-reading thunk. - // See obj6.go:rewriteToPcrel. - } else { - base = REG_NONE - } - v = int32(vaddr(ctxt, p, a, &rel)) - - case obj.NAME_AUTO, - obj.NAME_PARAM: - base = REG_SP - } - - if base == REG_TLS { - v = int32(vaddr(ctxt, p, a, &rel)) - } - - ctxt.Rexflag |= regrex[base]&Rxb | rex - if base == REG_NONE || (REG_CS <= base && base <= REG_GS) || base == REG_TLS { - if (a.Sym == nil || !isextern(a.Sym)) && base == REG_NONE && (a.Name == obj.NAME_STATIC || a.Name == obj.NAME_EXTERN || a.Name == obj.NAME_GOTREF) || p.Mode != 64 { - if a.Name == obj.NAME_GOTREF && (a.Offset != 0 || a.Index != 0 || a.Scale != 0) { - ctxt.Diag("%v has offset against gotref", p) - } - ctxt.AsmBuf.Put1(byte(0<<6 | 5<<0 | r<<3)) - goto putrelv - } - - // temporary - ctxt.AsmBuf.Put2( - byte(0<<6|4<<0|r<<3), // sib present - 0<<6|4<<3|5<<0, // DS:d32 - ) - goto putrelv - } - - if base == REG_SP || base == REG_R12 { - if v == 0 { - ctxt.AsmBuf.Put1(byte(0<<6 | reg[base]<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), REG_NONE, base) - return - } - - if v >= -128 && v < 128 { - ctxt.AsmBuf.Put1(byte(1<<6 | reg[base]<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), REG_NONE, base) - ctxt.AsmBuf.Put1(byte(v)) - return - } - - ctxt.AsmBuf.Put1(byte(2<<6 | reg[base]<<0 | r<<3)) - asmidx(ctxt, int(a.Scale), REG_NONE, base) - goto putrelv - } - - if REG_AX <= base && base <= REG_R15 { - if a.Index == REG_TLS && !ctxt.Flag_shared { - rel = obj.Reloc{} - rel.Type = obj.R_TLS_LE - rel.Siz = 4 - rel.Sym = nil - rel.Add = int64(v) - v = 0 - } - - if v == 0 && rel.Siz == 0 && base != REG_BP && base != REG_R13 { - ctxt.AsmBuf.Put1(byte(0<<6 | reg[base]<<0 | r<<3)) - return - } - - if v >= -128 && v < 128 && rel.Siz == 0 { - ctxt.AsmBuf.Put2(byte(1<<6|reg[base]<<0|r<<3), byte(v)) - return - } - - ctxt.AsmBuf.Put1(byte(2<<6 | reg[base]<<0 | r<<3)) - goto putrelv - } - - goto bad - -putrelv: - if rel.Siz != 0 { - if rel.Siz != 4 { - ctxt.Diag("bad rel") - goto bad - } - - r := obj.Addrel(ctxt.Cursym) - *r = rel - r.Off = int32(ctxt.Curp.Pc + int64(ctxt.AsmBuf.Len())) - } - - ctxt.AsmBuf.PutInt32(v) - return - -bad: - ctxt.Diag("asmand: bad address %v", obj.Dconv(p, a)) - return -} - -func asmand(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, ra *obj.Addr) { - asmandsz(ctxt, p, a, reg[ra.Reg], regrex[ra.Reg], 0) -} - -func asmando(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, o int) { - asmandsz(ctxt, p, a, o, 0, 0) -} - -func bytereg(a *obj.Addr, t *uint8) { - if a.Type == obj.TYPE_REG && a.Index == REG_NONE && (REG_AX <= a.Reg && a.Reg <= REG_R15) { - a.Reg += REG_AL - REG_AX - *t = 0 - } -} - -func unbytereg(a *obj.Addr, t *uint8) { - if a.Type == obj.TYPE_REG && a.Index == REG_NONE && (REG_AL <= a.Reg && a.Reg <= REG_R15B) { - a.Reg += REG_AX - REG_AL - *t = 0 - } -} - -const ( - E = 0xff -) - -var ymovtab = []Movtab{ - /* push */ - {APUSHL, Ycs, Ynone, Ynone, 0, [4]uint8{0x0e, E, 0, 0}}, - {APUSHL, Yss, Ynone, Ynone, 0, [4]uint8{0x16, E, 0, 0}}, - {APUSHL, Yds, Ynone, Ynone, 0, [4]uint8{0x1e, E, 0, 0}}, - {APUSHL, Yes, Ynone, Ynone, 0, [4]uint8{0x06, E, 0, 0}}, - {APUSHL, Yfs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa0, E, 0}}, - {APUSHL, Ygs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa8, E, 0}}, - {APUSHQ, Yfs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa0, E, 0}}, - {APUSHQ, Ygs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa8, E, 0}}, - {APUSHW, Ycs, Ynone, Ynone, 0, [4]uint8{Pe, 0x0e, E, 0}}, - {APUSHW, Yss, Ynone, Ynone, 0, [4]uint8{Pe, 0x16, E, 0}}, - {APUSHW, Yds, Ynone, Ynone, 0, [4]uint8{Pe, 0x1e, E, 0}}, - {APUSHW, Yes, Ynone, Ynone, 0, [4]uint8{Pe, 0x06, E, 0}}, - {APUSHW, Yfs, Ynone, Ynone, 0, [4]uint8{Pe, 0x0f, 0xa0, E}}, - {APUSHW, Ygs, Ynone, Ynone, 0, [4]uint8{Pe, 0x0f, 0xa8, E}}, - - /* pop */ - {APOPL, Ynone, Ynone, Yds, 0, [4]uint8{0x1f, E, 0, 0}}, - {APOPL, Ynone, Ynone, Yes, 0, [4]uint8{0x07, E, 0, 0}}, - {APOPL, Ynone, Ynone, Yss, 0, [4]uint8{0x17, E, 0, 0}}, - {APOPL, Ynone, Ynone, Yfs, 0, [4]uint8{0x0f, 0xa1, E, 0}}, - {APOPL, Ynone, Ynone, Ygs, 0, [4]uint8{0x0f, 0xa9, E, 0}}, - {APOPQ, Ynone, Ynone, Yfs, 0, [4]uint8{0x0f, 0xa1, E, 0}}, - {APOPQ, Ynone, Ynone, Ygs, 0, [4]uint8{0x0f, 0xa9, E, 0}}, - {APOPW, Ynone, Ynone, Yds, 0, [4]uint8{Pe, 0x1f, E, 0}}, - {APOPW, Ynone, Ynone, Yes, 0, [4]uint8{Pe, 0x07, E, 0}}, - {APOPW, Ynone, Ynone, Yss, 0, [4]uint8{Pe, 0x17, E, 0}}, - {APOPW, Ynone, Ynone, Yfs, 0, [4]uint8{Pe, 0x0f, 0xa1, E}}, - {APOPW, Ynone, Ynone, Ygs, 0, [4]uint8{Pe, 0x0f, 0xa9, E}}, - - /* mov seg */ - {AMOVW, Yes, Ynone, Yml, 1, [4]uint8{0x8c, 0, 0, 0}}, - {AMOVW, Ycs, Ynone, Yml, 1, [4]uint8{0x8c, 1, 0, 0}}, - {AMOVW, Yss, Ynone, Yml, 1, [4]uint8{0x8c, 2, 0, 0}}, - {AMOVW, Yds, Ynone, Yml, 1, [4]uint8{0x8c, 3, 0, 0}}, - {AMOVW, Yfs, Ynone, Yml, 1, [4]uint8{0x8c, 4, 0, 0}}, - {AMOVW, Ygs, Ynone, Yml, 1, [4]uint8{0x8c, 5, 0, 0}}, - {AMOVW, Yml, Ynone, Yes, 2, [4]uint8{0x8e, 0, 0, 0}}, - {AMOVW, Yml, Ynone, Ycs, 2, [4]uint8{0x8e, 1, 0, 0}}, - {AMOVW, Yml, Ynone, Yss, 2, [4]uint8{0x8e, 2, 0, 0}}, - {AMOVW, Yml, Ynone, Yds, 2, [4]uint8{0x8e, 3, 0, 0}}, - {AMOVW, Yml, Ynone, Yfs, 2, [4]uint8{0x8e, 4, 0, 0}}, - {AMOVW, Yml, Ynone, Ygs, 2, [4]uint8{0x8e, 5, 0, 0}}, - - /* mov cr */ - {AMOVL, Ycr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 0, 0}}, - {AMOVL, Ycr2, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 2, 0}}, - {AMOVL, Ycr3, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 3, 0}}, - {AMOVL, Ycr4, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 4, 0}}, - {AMOVL, Ycr8, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 8, 0}}, - {AMOVQ, Ycr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 0, 0}}, - {AMOVQ, Ycr2, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 2, 0}}, - {AMOVQ, Ycr3, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 3, 0}}, - {AMOVQ, Ycr4, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 4, 0}}, - {AMOVQ, Ycr8, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 8, 0}}, - {AMOVL, Yml, Ynone, Ycr0, 4, [4]uint8{0x0f, 0x22, 0, 0}}, - {AMOVL, Yml, Ynone, Ycr2, 4, [4]uint8{0x0f, 0x22, 2, 0}}, - {AMOVL, Yml, Ynone, Ycr3, 4, [4]uint8{0x0f, 0x22, 3, 0}}, - {AMOVL, Yml, Ynone, Ycr4, 4, [4]uint8{0x0f, 0x22, 4, 0}}, - {AMOVL, Yml, Ynone, Ycr8, 4, [4]uint8{0x0f, 0x22, 8, 0}}, - {AMOVQ, Yml, Ynone, Ycr0, 4, [4]uint8{0x0f, 0x22, 0, 0}}, - {AMOVQ, Yml, Ynone, Ycr2, 4, [4]uint8{0x0f, 0x22, 2, 0}}, - {AMOVQ, Yml, Ynone, Ycr3, 4, [4]uint8{0x0f, 0x22, 3, 0}}, - {AMOVQ, Yml, Ynone, Ycr4, 4, [4]uint8{0x0f, 0x22, 4, 0}}, - {AMOVQ, Yml, Ynone, Ycr8, 4, [4]uint8{0x0f, 0x22, 8, 0}}, - - /* mov dr */ - {AMOVL, Ydr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 0, 0}}, - {AMOVL, Ydr6, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 6, 0}}, - {AMOVL, Ydr7, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 7, 0}}, - {AMOVQ, Ydr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 0, 0}}, - {AMOVQ, Ydr6, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 6, 0}}, - {AMOVQ, Ydr7, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 7, 0}}, - {AMOVL, Yml, Ynone, Ydr0, 4, [4]uint8{0x0f, 0x23, 0, 0}}, - {AMOVL, Yml, Ynone, Ydr6, 4, [4]uint8{0x0f, 0x23, 6, 0}}, - {AMOVL, Yml, Ynone, Ydr7, 4, [4]uint8{0x0f, 0x23, 7, 0}}, - {AMOVQ, Yml, Ynone, Ydr0, 4, [4]uint8{0x0f, 0x23, 0, 0}}, - {AMOVQ, Yml, Ynone, Ydr6, 4, [4]uint8{0x0f, 0x23, 6, 0}}, - {AMOVQ, Yml, Ynone, Ydr7, 4, [4]uint8{0x0f, 0x23, 7, 0}}, - - /* mov tr */ - {AMOVL, Ytr6, Ynone, Yml, 3, [4]uint8{0x0f, 0x24, 6, 0}}, - {AMOVL, Ytr7, Ynone, Yml, 3, [4]uint8{0x0f, 0x24, 7, 0}}, - {AMOVL, Yml, Ynone, Ytr6, 4, [4]uint8{0x0f, 0x26, 6, E}}, - {AMOVL, Yml, Ynone, Ytr7, 4, [4]uint8{0x0f, 0x26, 7, E}}, - - /* lgdt, sgdt, lidt, sidt */ - {AMOVL, Ym, Ynone, Ygdtr, 4, [4]uint8{0x0f, 0x01, 2, 0}}, - {AMOVL, Ygdtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 0, 0}}, - {AMOVL, Ym, Ynone, Yidtr, 4, [4]uint8{0x0f, 0x01, 3, 0}}, - {AMOVL, Yidtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 1, 0}}, - {AMOVQ, Ym, Ynone, Ygdtr, 4, [4]uint8{0x0f, 0x01, 2, 0}}, - {AMOVQ, Ygdtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 0, 0}}, - {AMOVQ, Ym, Ynone, Yidtr, 4, [4]uint8{0x0f, 0x01, 3, 0}}, - {AMOVQ, Yidtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 1, 0}}, - - /* lldt, sldt */ - {AMOVW, Yml, Ynone, Yldtr, 4, [4]uint8{0x0f, 0x00, 2, 0}}, - {AMOVW, Yldtr, Ynone, Yml, 3, [4]uint8{0x0f, 0x00, 0, 0}}, - - /* lmsw, smsw */ - {AMOVW, Yml, Ynone, Ymsw, 4, [4]uint8{0x0f, 0x01, 6, 0}}, - {AMOVW, Ymsw, Ynone, Yml, 3, [4]uint8{0x0f, 0x01, 4, 0}}, - - /* ltr, str */ - {AMOVW, Yml, Ynone, Ytask, 4, [4]uint8{0x0f, 0x00, 3, 0}}, - {AMOVW, Ytask, Ynone, Yml, 3, [4]uint8{0x0f, 0x00, 1, 0}}, - - /* load full pointer - unsupported - Movtab{AMOVL, Yml, Ycol, 5, [4]uint8{0, 0, 0, 0}}, - Movtab{AMOVW, Yml, Ycol, 5, [4]uint8{Pe, 0, 0, 0}}, - */ - - /* double shift */ - {ASHLL, Yi8, Yrl, Yml, 6, [4]uint8{0xa4, 0xa5, 0, 0}}, - {ASHLL, Ycl, Yrl, Yml, 6, [4]uint8{0xa4, 0xa5, 0, 0}}, - {ASHLL, Ycx, Yrl, Yml, 6, [4]uint8{0xa4, 0xa5, 0, 0}}, - {ASHRL, Yi8, Yrl, Yml, 6, [4]uint8{0xac, 0xad, 0, 0}}, - {ASHRL, Ycl, Yrl, Yml, 6, [4]uint8{0xac, 0xad, 0, 0}}, - {ASHRL, Ycx, Yrl, Yml, 6, [4]uint8{0xac, 0xad, 0, 0}}, - {ASHLQ, Yi8, Yrl, Yml, 6, [4]uint8{Pw, 0xa4, 0xa5, 0}}, - {ASHLQ, Ycl, Yrl, Yml, 6, [4]uint8{Pw, 0xa4, 0xa5, 0}}, - {ASHLQ, Ycx, Yrl, Yml, 6, [4]uint8{Pw, 0xa4, 0xa5, 0}}, - {ASHRQ, Yi8, Yrl, Yml, 6, [4]uint8{Pw, 0xac, 0xad, 0}}, - {ASHRQ, Ycl, Yrl, Yml, 6, [4]uint8{Pw, 0xac, 0xad, 0}}, - {ASHRQ, Ycx, Yrl, Yml, 6, [4]uint8{Pw, 0xac, 0xad, 0}}, - {ASHLW, Yi8, Yrl, Yml, 6, [4]uint8{Pe, 0xa4, 0xa5, 0}}, - {ASHLW, Ycl, Yrl, Yml, 6, [4]uint8{Pe, 0xa4, 0xa5, 0}}, - {ASHLW, Ycx, Yrl, Yml, 6, [4]uint8{Pe, 0xa4, 0xa5, 0}}, - {ASHRW, Yi8, Yrl, Yml, 6, [4]uint8{Pe, 0xac, 0xad, 0}}, - {ASHRW, Ycl, Yrl, Yml, 6, [4]uint8{Pe, 0xac, 0xad, 0}}, - {ASHRW, Ycx, Yrl, Yml, 6, [4]uint8{Pe, 0xac, 0xad, 0}}, - - /* load TLS base */ - {AMOVL, Ytls, Ynone, Yrl, 7, [4]uint8{0, 0, 0, 0}}, - {AMOVQ, Ytls, Ynone, Yrl, 7, [4]uint8{0, 0, 0, 0}}, - {0, 0, 0, 0, 0, [4]uint8{}}, -} - -func isax(a *obj.Addr) bool { - switch a.Reg { - case REG_AX, REG_AL, REG_AH: - return true - } - - if a.Index == REG_AX { - return true - } - return false -} - -func subreg(p *obj.Prog, from int, to int) { - if false { /* debug['Q'] */ - fmt.Printf("\n%v\ts/%v/%v/\n", p, Rconv(from), Rconv(to)) - } - - if int(p.From.Reg) == from { - p.From.Reg = int16(to) - p.Ft = 0 - } - - if int(p.To.Reg) == from { - p.To.Reg = int16(to) - p.Tt = 0 - } - - if int(p.From.Index) == from { - p.From.Index = int16(to) - p.Ft = 0 - } - - if int(p.To.Index) == from { - p.To.Index = int16(to) - p.Tt = 0 - } - - if false { /* debug['Q'] */ - fmt.Printf("%v\n", p) - } -} - -func mediaop(ctxt *obj.Link, o *Optab, op int, osize int, z int) int { - switch op { - case Pm, Pe, Pf2, Pf3: - if osize != 1 { - if op != Pm { - ctxt.AsmBuf.Put1(byte(op)) - } - ctxt.AsmBuf.Put1(Pm) - z++ - op = int(o.op[z]) - break - } - fallthrough - - default: - if ctxt.AsmBuf.Len() == 0 || ctxt.AsmBuf.Last() != Pm { - ctxt.AsmBuf.Put1(Pm) - } - } - - ctxt.AsmBuf.Put1(byte(op)) - return z -} - -var bpduff1 = []byte{ - 0x48, 0x89, 0x6c, 0x24, 0xf0, // MOVQ BP, -16(SP) - 0x48, 0x8d, 0x6c, 0x24, 0xf0, // LEAQ -16(SP), BP -} - -var bpduff2 = []byte{ - 0x48, 0x8b, 0x6d, 0x00, // MOVQ 0(BP), BP -} - -// Emit VEX prefix and opcode byte. -// The three addresses are the r/m, vvvv, and reg fields. -// The reg and rm arguments appear in the same order as the -// arguments to asmand, which typically follows the call to asmvex. -// The final two arguments are the VEX prefix (see encoding above) -// and the opcode byte. -// For details about vex prefix see: -// https://en.wikipedia.org/wiki/VEX_prefix#Technical_description -func asmvex(ctxt *obj.Link, rm, v, r *obj.Addr, vex, opcode uint8) { - ctxt.Vexflag = 1 - rexR := 0 - if r != nil { - rexR = regrex[r.Reg] & Rxr - } - rexB := 0 - rexX := 0 - if rm != nil { - rexB = regrex[rm.Reg] & Rxb - rexX = regrex[rm.Index] & Rxx - } - vexM := (vex >> 3) & 0xF - vexWLP := vex & 0x87 - vexV := byte(0) - if v != nil { - vexV = byte(reg[v.Reg]|(regrex[v.Reg]&Rxr)<<1) & 0xF - } - vexV ^= 0xF - if vexM == 1 && (rexX|rexB) == 0 && vex&vexW1 == 0 { - // Can use 2-byte encoding. - ctxt.AsmBuf.Put2(0xc5, byte(rexR<<5)^0x80|vexV<<3|vexWLP) - } else { - // Must use 3-byte encoding. - ctxt.AsmBuf.Put3(0xc4, - (byte(rexR|rexX|rexB)<<5)^0xE0|vexM, - vexV<<3|vexWLP, - ) - } - ctxt.AsmBuf.Put1(opcode) -} - -func doasm(ctxt *obj.Link, p *obj.Prog) { - ctxt.Curp = p // TODO - - o := opindex[p.As&obj.AMask] - - if o == nil { - ctxt.Diag("asmins: missing op %v", p) - return - } - - pre := prefixof(ctxt, p, &p.From) - if pre != 0 { - ctxt.AsmBuf.Put1(byte(pre)) - } - pre = prefixof(ctxt, p, &p.To) - if pre != 0 { - ctxt.AsmBuf.Put1(byte(pre)) - } - - // TODO(rsc): This special case is for SHRQ $3, AX:DX, - // which encodes as SHRQ $32(DX*0), AX. - // Similarly SHRQ CX, AX:DX is really SHRQ CX(DX*0), AX. - // Change encoding generated by assemblers and compilers and remove. - if (p.From.Type == obj.TYPE_CONST || p.From.Type == obj.TYPE_REG) && p.From.Index != REG_NONE && p.From.Scale == 0 { - p.From3 = new(obj.Addr) - p.From3.Type = obj.TYPE_REG - p.From3.Reg = p.From.Index - p.From.Index = 0 - } - - // TODO(rsc): This special case is for PINSRQ etc, CMPSD etc. - // Change encoding generated by assemblers and compilers (if any) and remove. - switch p.As { - case AIMUL3Q, APEXTRW, APINSRW, APINSRD, APINSRQ, APSHUFHW, APSHUFL, APSHUFW, ASHUFPD, ASHUFPS, AAESKEYGENASSIST, APSHUFD, APCLMULQDQ: - if p.From3Type() == obj.TYPE_NONE { - p.From3 = new(obj.Addr) - *p.From3 = p.From - p.From = obj.Addr{} - p.From.Type = obj.TYPE_CONST - p.From.Offset = p.To.Offset - p.To.Offset = 0 - } - case ACMPSD, ACMPSS, ACMPPS, ACMPPD: - if p.From3Type() == obj.TYPE_NONE { - p.From3 = new(obj.Addr) - *p.From3 = p.To - p.To = obj.Addr{} - p.To.Type = obj.TYPE_CONST - p.To.Offset = p.From3.Offset - p.From3.Offset = 0 - } - } - - if p.Ft == 0 { - p.Ft = uint8(oclass(ctxt, p, &p.From)) - } - if p.Tt == 0 { - p.Tt = uint8(oclass(ctxt, p, &p.To)) - } - - ft := int(p.Ft) * Ymax - f3t := Ynone * Ymax - if p.From3 != nil { - f3t = oclass(ctxt, p, p.From3) * Ymax - } - tt := int(p.Tt) * Ymax - - xo := obj.Bool2int(o.op[0] == 0x0f) - z := 0 - var a *obj.Addr - var l int - var op int - var q *obj.Prog - var r *obj.Reloc - var rel obj.Reloc - var v int64 - for i := range o.ytab { - yt := &o.ytab[i] - if ycover[ft+int(yt.from)] != 0 && ycover[f3t+int(yt.from3)] != 0 && ycover[tt+int(yt.to)] != 0 { - switch o.prefix { - case Px1: /* first option valid only in 32-bit mode */ - if ctxt.Mode == 64 && z == 0 { - z += int(yt.zoffset) + xo - continue - } - case Pq: /* 16 bit escape and opcode escape */ - ctxt.AsmBuf.Put2(Pe, Pm) - - case Pq3: /* 16 bit escape and opcode escape + REX.W */ - ctxt.Rexflag |= Pw - ctxt.AsmBuf.Put2(Pe, Pm) - - case Pq4: /* 66 0F 38 */ - ctxt.AsmBuf.Put3(0x66, 0x0F, 0x38) - - case Pf2, /* xmm opcode escape */ - Pf3: - ctxt.AsmBuf.Put2(o.prefix, Pm) - - case Pef3: - ctxt.AsmBuf.Put3(Pe, Pf3, Pm) - - case Pfw: /* xmm opcode escape + REX.W */ - ctxt.Rexflag |= Pw - ctxt.AsmBuf.Put2(Pf3, Pm) - - case Pm: /* opcode escape */ - ctxt.AsmBuf.Put1(Pm) - - case Pe: /* 16 bit escape */ - ctxt.AsmBuf.Put1(Pe) - - case Pw: /* 64-bit escape */ - if p.Mode != 64 { - ctxt.Diag("asmins: illegal 64: %v", p) - } - ctxt.Rexflag |= Pw - - case Pw8: /* 64-bit escape if z >= 8 */ - if z >= 8 { - if p.Mode != 64 { - ctxt.Diag("asmins: illegal 64: %v", p) - } - ctxt.Rexflag |= Pw - } - - case Pb: /* botch */ - if p.Mode != 64 && (isbadbyte(&p.From) || isbadbyte(&p.To)) { - goto bad - } - // NOTE(rsc): This is probably safe to do always, - // but when enabled it chooses different encodings - // than the old cmd/internal/obj/i386 code did, - // which breaks our "same bits out" checks. - // In particular, CMPB AX, $0 encodes as 80 f8 00 - // in the original obj/i386, and it would encode - // (using a valid, shorter form) as 3c 00 if we enabled - // the call to bytereg here. - if p.Mode == 64 { - bytereg(&p.From, &p.Ft) - bytereg(&p.To, &p.Tt) - } - - case P32: /* 32 bit but illegal if 64-bit mode */ - if p.Mode == 64 { - ctxt.Diag("asmins: illegal in 64-bit mode: %v", p) - } - - case Py: /* 64-bit only, no prefix */ - if p.Mode != 64 { - ctxt.Diag("asmins: illegal in %d-bit mode: %v", p.Mode, p) - } - - case Py1: /* 64-bit only if z < 1, no prefix */ - if z < 1 && p.Mode != 64 { - ctxt.Diag("asmins: illegal in %d-bit mode: %v", p.Mode, p) - } - - case Py3: /* 64-bit only if z < 3, no prefix */ - if z < 3 && p.Mode != 64 { - ctxt.Diag("asmins: illegal in %d-bit mode: %v", p.Mode, p) - } - } - - if z >= len(o.op) { - log.Fatalf("asmins bad table %v", p) - } - op = int(o.op[z]) - // In vex case 0x0f is actually VEX_256_F2_0F_WIG - if op == 0x0f && o.prefix != Pvex { - ctxt.AsmBuf.Put1(byte(op)) - z++ - op = int(o.op[z]) - } - - switch yt.zcase { - default: - ctxt.Diag("asmins: unknown z %d %v", yt.zcase, p) - return - - case Zpseudo: - break - - case Zlit: - for ; ; z++ { - op = int(o.op[z]) - if op == 0 { - break - } - ctxt.AsmBuf.Put1(byte(op)) - } - - case Zlitm_r: - for ; ; z++ { - op = int(o.op[z]) - if op == 0 { - break - } - ctxt.AsmBuf.Put1(byte(op)) - } - asmand(ctxt, p, &p.From, &p.To) - - case Zmb_r: - bytereg(&p.From, &p.Ft) - fallthrough - - case Zm_r: - ctxt.AsmBuf.Put1(byte(op)) - asmand(ctxt, p, &p.From, &p.To) - - case Zm2_r: - ctxt.AsmBuf.Put2(byte(op), o.op[z+1]) - asmand(ctxt, p, &p.From, &p.To) - - case Zm_r_xm: - mediaop(ctxt, o, op, int(yt.zoffset), z) - asmand(ctxt, p, &p.From, &p.To) - - case Zm_r_xm_nr: - ctxt.Rexflag = 0 - mediaop(ctxt, o, op, int(yt.zoffset), z) - asmand(ctxt, p, &p.From, &p.To) - - case Zm_r_i_xm: - mediaop(ctxt, o, op, int(yt.zoffset), z) - asmand(ctxt, p, &p.From, p.From3) - ctxt.AsmBuf.Put1(byte(p.To.Offset)) - - case Zibm_r, Zibr_m: - for { - tmp1 := z - z++ - op = int(o.op[tmp1]) - if op == 0 { - break - } - ctxt.AsmBuf.Put1(byte(op)) - } - if yt.zcase == Zibr_m { - asmand(ctxt, p, &p.To, p.From3) - } else { - asmand(ctxt, p, p.From3, &p.To) - } - ctxt.AsmBuf.Put1(byte(p.From.Offset)) - - case Zaut_r: - ctxt.AsmBuf.Put1(0x8d) // leal - if p.From.Type != obj.TYPE_ADDR { - ctxt.Diag("asmins: Zaut sb type ADDR") - } - p.From.Type = obj.TYPE_MEM - asmand(ctxt, p, &p.From, &p.To) - p.From.Type = obj.TYPE_ADDR - - case Zm_o: - ctxt.AsmBuf.Put1(byte(op)) - asmando(ctxt, p, &p.From, int(o.op[z+1])) - - case Zr_m: - ctxt.AsmBuf.Put1(byte(op)) - asmand(ctxt, p, &p.To, &p.From) - - case Zvex_rm_v_r: - asmvex(ctxt, &p.From, p.From3, &p.To, o.op[z], o.op[z+1]) - asmand(ctxt, p, &p.From, &p.To) - - case Zvex_i_r_v: - asmvex(ctxt, p.From3, &p.To, nil, o.op[z], o.op[z+1]) - regnum := byte(0x7) - if p.From3.Reg >= REG_X0 && p.From3.Reg <= REG_X15 { - regnum &= byte(p.From3.Reg - REG_X0) - } else { - regnum &= byte(p.From3.Reg - REG_Y0) - } - ctxt.AsmBuf.Put1(byte(o.op[z+2]) | regnum) - ctxt.AsmBuf.Put1(byte(p.From.Offset)) - - case Zvex_i_rm_v_r: - asmvex(ctxt, &p.From, p.From3, &p.To, o.op[z], o.op[z+1]) - asmand(ctxt, p, &p.From, &p.To) - ctxt.AsmBuf.Put1(byte(p.From3.Offset)) - - case Zvex_i_rm_r: - asmvex(ctxt, p.From3, nil, &p.To, o.op[z], o.op[z+1]) - asmand(ctxt, p, p.From3, &p.To) - ctxt.AsmBuf.Put1(byte(p.From.Offset)) - - case Zvex_v_rm_r: - asmvex(ctxt, p.From3, &p.From, &p.To, o.op[z], o.op[z+1]) - asmand(ctxt, p, p.From3, &p.To) - - case Zvex_r_v_rm: - asmvex(ctxt, &p.To, p.From3, &p.From, o.op[z], o.op[z+1]) - asmand(ctxt, p, &p.To, &p.From) - - case Zr_m_xm: - mediaop(ctxt, o, op, int(yt.zoffset), z) - asmand(ctxt, p, &p.To, &p.From) - - case Zr_m_xm_nr: - ctxt.Rexflag = 0 - mediaop(ctxt, o, op, int(yt.zoffset), z) - asmand(ctxt, p, &p.To, &p.From) - - case Zo_m: - ctxt.AsmBuf.Put1(byte(op)) - asmando(ctxt, p, &p.To, int(o.op[z+1])) - - case Zcallindreg: - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc) - r.Type = obj.R_CALLIND - r.Siz = 0 - fallthrough - - case Zo_m64: - ctxt.AsmBuf.Put1(byte(op)) - asmandsz(ctxt, p, &p.To, int(o.op[z+1]), 0, 1) - - case Zm_ibo: - ctxt.AsmBuf.Put1(byte(op)) - asmando(ctxt, p, &p.From, int(o.op[z+1])) - ctxt.AsmBuf.Put1(byte(vaddr(ctxt, p, &p.To, nil))) - - case Zibo_m: - ctxt.AsmBuf.Put1(byte(op)) - asmando(ctxt, p, &p.To, int(o.op[z+1])) - ctxt.AsmBuf.Put1(byte(vaddr(ctxt, p, &p.From, nil))) - - case Zibo_m_xm: - z = mediaop(ctxt, o, op, int(yt.zoffset), z) - asmando(ctxt, p, &p.To, int(o.op[z+1])) - ctxt.AsmBuf.Put1(byte(vaddr(ctxt, p, &p.From, nil))) - - case Z_ib, Zib_: - if yt.zcase == Zib_ { - a = &p.From - } else { - a = &p.To - } - ctxt.AsmBuf.Put1(byte(op)) - if p.As == AXABORT { - ctxt.AsmBuf.Put1(o.op[z+1]) - } - ctxt.AsmBuf.Put1(byte(vaddr(ctxt, p, a, nil))) - - case Zib_rp: - ctxt.Rexflag |= regrex[p.To.Reg] & (Rxb | 0x40) - ctxt.AsmBuf.Put2(byte(op+reg[p.To.Reg]), byte(vaddr(ctxt, p, &p.From, nil))) - - case Zil_rp: - ctxt.Rexflag |= regrex[p.To.Reg] & Rxb - ctxt.AsmBuf.Put1(byte(op + reg[p.To.Reg])) - if o.prefix == Pe { - v = vaddr(ctxt, p, &p.From, nil) - ctxt.AsmBuf.PutInt16(int16(v)) - } else { - relput4(ctxt, p, &p.From) - } - - case Zo_iw: - ctxt.AsmBuf.Put1(byte(op)) - if p.From.Type != obj.TYPE_NONE { - v = vaddr(ctxt, p, &p.From, nil) - ctxt.AsmBuf.PutInt16(int16(v)) - } - - case Ziq_rp: - v = vaddr(ctxt, p, &p.From, &rel) - l = int(v >> 32) - if l == 0 && rel.Siz != 8 { - //p->mark |= 0100; - //print("zero: %llux %v\n", v, p); - ctxt.Rexflag &^= (0x40 | Rxw) - - ctxt.Rexflag |= regrex[p.To.Reg] & Rxb - ctxt.AsmBuf.Put1(byte(0xb8 + reg[p.To.Reg])) - if rel.Type != 0 { - r = obj.Addrel(ctxt.Cursym) - *r = rel - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - } - - ctxt.AsmBuf.PutInt32(int32(v)) - } else if l == -1 && uint64(v)&(uint64(1)<<31) != 0 { /* sign extend */ - - //p->mark |= 0100; - //print("sign: %llux %v\n", v, p); - ctxt.AsmBuf.Put1(0xc7) - asmando(ctxt, p, &p.To, 0) - - ctxt.AsmBuf.PutInt32(int32(v)) // need all 8 - } else { - //print("all: %llux %v\n", v, p); - ctxt.Rexflag |= regrex[p.To.Reg] & Rxb - ctxt.AsmBuf.Put1(byte(op + reg[p.To.Reg])) - if rel.Type != 0 { - r = obj.Addrel(ctxt.Cursym) - *r = rel - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - } - - ctxt.AsmBuf.PutInt64(v) - } - - case Zib_rr: - ctxt.AsmBuf.Put1(byte(op)) - asmand(ctxt, p, &p.To, &p.To) - ctxt.AsmBuf.Put1(byte(vaddr(ctxt, p, &p.From, nil))) - - case Z_il, Zil_: - if yt.zcase == Zil_ { - a = &p.From - } else { - a = &p.To - } - ctxt.AsmBuf.Put1(byte(op)) - if o.prefix == Pe { - v = vaddr(ctxt, p, a, nil) - ctxt.AsmBuf.PutInt16(int16(v)) - } else { - relput4(ctxt, p, a) - } - - case Zm_ilo, Zilo_m: - ctxt.AsmBuf.Put1(byte(op)) - if yt.zcase == Zilo_m { - a = &p.From - asmando(ctxt, p, &p.To, int(o.op[z+1])) - } else { - a = &p.To - asmando(ctxt, p, &p.From, int(o.op[z+1])) - } - - if o.prefix == Pe { - v = vaddr(ctxt, p, a, nil) - ctxt.AsmBuf.PutInt16(int16(v)) - } else { - relput4(ctxt, p, a) - } - - case Zil_rr: - ctxt.AsmBuf.Put1(byte(op)) - asmand(ctxt, p, &p.To, &p.To) - if o.prefix == Pe { - v = vaddr(ctxt, p, &p.From, nil) - ctxt.AsmBuf.PutInt16(int16(v)) - } else { - relput4(ctxt, p, &p.From) - } - - case Z_rp: - ctxt.Rexflag |= regrex[p.To.Reg] & (Rxb | 0x40) - ctxt.AsmBuf.Put1(byte(op + reg[p.To.Reg])) - - case Zrp_: - ctxt.Rexflag |= regrex[p.From.Reg] & (Rxb | 0x40) - ctxt.AsmBuf.Put1(byte(op + reg[p.From.Reg])) - - case Zclr: - ctxt.Rexflag &^= Pw - ctxt.AsmBuf.Put1(byte(op)) - asmand(ctxt, p, &p.To, &p.To) - - case Zcallcon, Zjmpcon: - if yt.zcase == Zcallcon { - ctxt.AsmBuf.Put1(byte(op)) - } else { - ctxt.AsmBuf.Put1(o.op[z+1]) - } - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - r.Type = obj.R_PCREL - r.Siz = 4 - r.Add = p.To.Offset - ctxt.AsmBuf.PutInt32(0) - - case Zcallind: - ctxt.AsmBuf.Put2(byte(op), o.op[z+1]) - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - if p.Mode == 64 { - r.Type = obj.R_PCREL - } else { - r.Type = obj.R_ADDR - } - r.Siz = 4 - r.Add = p.To.Offset - r.Sym = p.To.Sym - ctxt.AsmBuf.PutInt32(0) - - case Zcall, Zcallduff: - if p.To.Sym == nil { - ctxt.Diag("call without target") - log.Fatalf("bad code") - } - - if yt.zcase == Zcallduff && ctxt.Flag_dynlink { - ctxt.Diag("directly calling duff when dynamically linking Go") - } - - if ctxt.Framepointer_enabled && yt.zcase == Zcallduff && p.Mode == 64 { - // Maintain BP around call, since duffcopy/duffzero can't do it - // (the call jumps into the middle of the function). - // This makes it possible to see call sites for duffcopy/duffzero in - // BP-based profiling tools like Linux perf (which is the - // whole point of obj.Framepointer_enabled). - // MOVQ BP, -16(SP) - // LEAQ -16(SP), BP - ctxt.AsmBuf.Put(bpduff1) - } - ctxt.AsmBuf.Put1(byte(op)) - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - r.Sym = p.To.Sym - r.Add = p.To.Offset - r.Type = obj.R_CALL - r.Siz = 4 - ctxt.AsmBuf.PutInt32(0) - - if ctxt.Framepointer_enabled && yt.zcase == Zcallduff && p.Mode == 64 { - // Pop BP pushed above. - // MOVQ 0(BP), BP - ctxt.AsmBuf.Put(bpduff2) - } - - // TODO: jump across functions needs reloc - case Zbr, Zjmp, Zloop: - if p.As == AXBEGIN { - ctxt.AsmBuf.Put1(byte(op)) - } - if p.To.Sym != nil { - if yt.zcase != Zjmp { - ctxt.Diag("branch to ATEXT") - log.Fatalf("bad code") - } - - ctxt.AsmBuf.Put1(o.op[z+1]) - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - r.Sym = p.To.Sym - r.Type = obj.R_PCREL - r.Siz = 4 - ctxt.AsmBuf.PutInt32(0) - break - } - - // Assumes q is in this function. - // TODO: Check in input, preserve in brchain. - - // Fill in backward jump now. - q = p.Pcond - - if q == nil { - ctxt.Diag("jmp/branch/loop without target") - log.Fatalf("bad code") - } - - if p.Back&1 != 0 { - v = q.Pc - (p.Pc + 2) - if v >= -128 && p.As != AXBEGIN { - if p.As == AJCXZL { - ctxt.AsmBuf.Put1(0x67) - } - ctxt.AsmBuf.Put2(byte(op), byte(v)) - } else if yt.zcase == Zloop { - ctxt.Diag("loop too far: %v", p) - } else { - v -= 5 - 2 - if p.As == AXBEGIN { - v-- - } - if yt.zcase == Zbr { - ctxt.AsmBuf.Put1(0x0f) - v-- - } - - ctxt.AsmBuf.Put1(o.op[z+1]) - ctxt.AsmBuf.PutInt32(int32(v)) - } - - break - } - - // Annotate target; will fill in later. - p.Forwd = q.Rel - - q.Rel = p - if p.Back&2 != 0 && p.As != AXBEGIN { // short - if p.As == AJCXZL { - ctxt.AsmBuf.Put1(0x67) - } - ctxt.AsmBuf.Put2(byte(op), 0) - } else if yt.zcase == Zloop { - ctxt.Diag("loop too far: %v", p) - } else { - if yt.zcase == Zbr { - ctxt.AsmBuf.Put1(0x0f) - } - ctxt.AsmBuf.Put1(o.op[z+1]) - ctxt.AsmBuf.PutInt32(0) - } - - break - - /* - v = q->pc - p->pc - 2; - if((v >= -128 && v <= 127) || p->pc == -1 || q->pc == -1) { - *ctxt->andptr++ = op; - *ctxt->andptr++ = v; - } else { - v -= 5-2; - if(yt.zcase == Zbr) { - *ctxt->andptr++ = 0x0f; - v--; - } - *ctxt->andptr++ = o->op[z+1]; - *ctxt->andptr++ = v; - *ctxt->andptr++ = v>>8; - *ctxt->andptr++ = v>>16; - *ctxt->andptr++ = v>>24; - } - */ - - case Zbyte: - v = vaddr(ctxt, p, &p.From, &rel) - if rel.Siz != 0 { - rel.Siz = uint8(op) - r = obj.Addrel(ctxt.Cursym) - *r = rel - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - } - - ctxt.AsmBuf.Put1(byte(v)) - if op > 1 { - ctxt.AsmBuf.Put1(byte(v >> 8)) - if op > 2 { - ctxt.AsmBuf.PutInt16(int16(v >> 16)) - if op > 4 { - ctxt.AsmBuf.PutInt32(int32(v >> 32)) - } - } - } - } - - return - } - z += int(yt.zoffset) + xo - } - for mo := ymovtab; mo[0].as != 0; mo = mo[1:] { - var pp obj.Prog - var t []byte - if p.As == mo[0].as { - if ycover[ft+int(mo[0].ft)] != 0 && ycover[f3t+int(mo[0].f3t)] != 0 && ycover[tt+int(mo[0].tt)] != 0 { - t = mo[0].op[:] - switch mo[0].code { - default: - ctxt.Diag("asmins: unknown mov %d %v", mo[0].code, p) - - case 0: /* lit */ - for z = 0; t[z] != E; z++ { - ctxt.AsmBuf.Put1(t[z]) - } - - case 1: /* r,m */ - ctxt.AsmBuf.Put1(t[0]) - asmando(ctxt, p, &p.To, int(t[1])) - - case 2: /* m,r */ - ctxt.AsmBuf.Put1(t[0]) - asmando(ctxt, p, &p.From, int(t[1])) - - case 3: /* r,m - 2op */ - ctxt.AsmBuf.Put2(t[0], t[1]) - asmando(ctxt, p, &p.To, int(t[2])) - ctxt.Rexflag |= regrex[p.From.Reg] & (Rxr | 0x40) - - case 4: /* m,r - 2op */ - ctxt.AsmBuf.Put2(t[0], t[1]) - asmando(ctxt, p, &p.From, int(t[2])) - ctxt.Rexflag |= regrex[p.To.Reg] & (Rxr | 0x40) - - case 5: /* load full pointer, trash heap */ - if t[0] != 0 { - ctxt.AsmBuf.Put1(t[0]) - } - switch p.To.Index { - default: - goto bad - - case REG_DS: - ctxt.AsmBuf.Put1(0xc5) - - case REG_SS: - ctxt.AsmBuf.Put2(0x0f, 0xb2) - - case REG_ES: - ctxt.AsmBuf.Put1(0xc4) - - case REG_FS: - ctxt.AsmBuf.Put2(0x0f, 0xb4) - - case REG_GS: - ctxt.AsmBuf.Put2(0x0f, 0xb5) - } - - asmand(ctxt, p, &p.From, &p.To) - - case 6: /* double shift */ - if t[0] == Pw { - if p.Mode != 64 { - ctxt.Diag("asmins: illegal 64: %v", p) - } - ctxt.Rexflag |= Pw - t = t[1:] - } else if t[0] == Pe { - ctxt.AsmBuf.Put1(Pe) - t = t[1:] - } - - switch p.From.Type { - default: - goto bad - - case obj.TYPE_CONST: - ctxt.AsmBuf.Put2(0x0f, t[0]) - asmandsz(ctxt, p, &p.To, reg[p.From3.Reg], regrex[p.From3.Reg], 0) - ctxt.AsmBuf.Put1(byte(p.From.Offset)) - - case obj.TYPE_REG: - switch p.From.Reg { - default: - goto bad - - case REG_CL, REG_CX: - ctxt.AsmBuf.Put2(0x0f, t[1]) - asmandsz(ctxt, p, &p.To, reg[p.From3.Reg], regrex[p.From3.Reg], 0) - } - } - - // NOTE: The systems listed here are the ones that use the "TLS initial exec" model, - // where you load the TLS base register into a register and then index off that - // register to access the actual TLS variables. Systems that allow direct TLS access - // are handled in prefixof above and should not be listed here. - case 7: /* mov tls, r */ - if p.Mode == 64 && p.As != AMOVQ || p.Mode == 32 && p.As != AMOVL { - ctxt.Diag("invalid load of TLS: %v", p) - } - - if p.Mode == 32 { - // NOTE: The systems listed here are the ones that use the "TLS initial exec" model, - // where you load the TLS base register into a register and then index off that - // register to access the actual TLS variables. Systems that allow direct TLS access - // are handled in prefixof above and should not be listed here. - switch ctxt.Headtype { - default: - log.Fatalf("unknown TLS base location for %v", ctxt.Headtype) - - case obj.Hlinux, - obj.Hnacl: - if ctxt.Flag_shared { - // Note that this is not generating the same insns as the other cases. - // MOV TLS, dst - // becomes - // call __x86.get_pc_thunk.dst - // movl (gotpc + g@gotntpoff)(dst), dst - // which is encoded as - // call __x86.get_pc_thunk.dst - // movq 0(dst), dst - // and R_CALL & R_TLS_IE relocs. This all assumes the only tls variable we access - // is g, which we can't check here, but will when we assemble the second - // instruction. - dst := p.To.Reg - ctxt.AsmBuf.Put1(0xe8) - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - r.Type = obj.R_CALL - r.Siz = 4 - r.Sym = obj.Linklookup(ctxt, "__x86.get_pc_thunk."+strings.ToLower(Rconv(int(dst))), 0) - ctxt.AsmBuf.PutInt32(0) - - ctxt.AsmBuf.Put2(0x8B, byte(2<<6|reg[dst]|(reg[dst]<<3))) - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - r.Type = obj.R_TLS_IE - r.Siz = 4 - r.Add = 2 - ctxt.AsmBuf.PutInt32(0) - } else { - // ELF TLS base is 0(GS). - pp.From = p.From - - pp.From.Type = obj.TYPE_MEM - pp.From.Reg = REG_GS - pp.From.Offset = 0 - pp.From.Index = REG_NONE - pp.From.Scale = 0 - ctxt.AsmBuf.Put2(0x65, // GS - 0x8B) - asmand(ctxt, p, &pp.From, &p.To) - } - case obj.Hplan9: - if ctxt.Plan9privates == nil { - ctxt.Plan9privates = obj.Linklookup(ctxt, "_privates", 0) - } - pp.From = obj.Addr{} - pp.From.Type = obj.TYPE_MEM - pp.From.Name = obj.NAME_EXTERN - pp.From.Sym = ctxt.Plan9privates - pp.From.Offset = 0 - pp.From.Index = REG_NONE - ctxt.AsmBuf.Put1(0x8B) - asmand(ctxt, p, &pp.From, &p.To) - - case obj.Hwindows, obj.Hwindowsgui: - // Windows TLS base is always 0x14(FS). - pp.From = p.From - - pp.From.Type = obj.TYPE_MEM - pp.From.Reg = REG_FS - pp.From.Offset = 0x14 - pp.From.Index = REG_NONE - pp.From.Scale = 0 - ctxt.AsmBuf.Put2(0x64, // FS - 0x8B) - asmand(ctxt, p, &pp.From, &p.To) - } - break - } - - switch ctxt.Headtype { - default: - log.Fatalf("unknown TLS base location for %v", ctxt.Headtype) - - case obj.Hlinux: - if !ctxt.Flag_shared { - log.Fatalf("unknown TLS base location for linux without -shared") - } - // Note that this is not generating the same insn as the other cases. - // MOV TLS, R_to - // becomes - // movq g@gottpoff(%rip), R_to - // which is encoded as - // movq 0(%rip), R_to - // and a R_TLS_IE reloc. This all assumes the only tls variable we access - // is g, which we can't check here, but will when we assemble the second - // instruction. - ctxt.Rexflag = Pw | (regrex[p.To.Reg] & Rxr) - - ctxt.AsmBuf.Put2(0x8B, byte(0x05|(reg[p.To.Reg]<<3))) - r = obj.Addrel(ctxt.Cursym) - r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len())) - r.Type = obj.R_TLS_IE - r.Siz = 4 - r.Add = -4 - ctxt.AsmBuf.PutInt32(0) - - case obj.Hplan9: - if ctxt.Plan9privates == nil { - ctxt.Plan9privates = obj.Linklookup(ctxt, "_privates", 0) - } - pp.From = obj.Addr{} - pp.From.Type = obj.TYPE_MEM - pp.From.Name = obj.NAME_EXTERN - pp.From.Sym = ctxt.Plan9privates - pp.From.Offset = 0 - pp.From.Index = REG_NONE - ctxt.Rexflag |= Pw - ctxt.AsmBuf.Put1(0x8B) - asmand(ctxt, p, &pp.From, &p.To) - - case obj.Hsolaris: // TODO(rsc): Delete Hsolaris from list. Should not use this code. See progedit in obj6.c. - // TLS base is 0(FS). - pp.From = p.From - - pp.From.Type = obj.TYPE_MEM - pp.From.Name = obj.NAME_NONE - pp.From.Reg = REG_NONE - pp.From.Offset = 0 - pp.From.Index = REG_NONE - pp.From.Scale = 0 - ctxt.Rexflag |= Pw - ctxt.AsmBuf.Put2(0x64, // FS - 0x8B) - asmand(ctxt, p, &pp.From, &p.To) - - case obj.Hwindows, obj.Hwindowsgui: - // Windows TLS base is always 0x28(GS). - pp.From = p.From - - pp.From.Type = obj.TYPE_MEM - pp.From.Name = obj.NAME_NONE - pp.From.Reg = REG_GS - pp.From.Offset = 0x28 - pp.From.Index = REG_NONE - pp.From.Scale = 0 - ctxt.Rexflag |= Pw - ctxt.AsmBuf.Put2(0x65, // GS - 0x8B) - asmand(ctxt, p, &pp.From, &p.To) - } - } - return - } - } - } - goto bad - -bad: - if p.Mode != 64 { - /* - * here, the assembly has failed. - * if its a byte instruction that has - * unaddressable registers, try to - * exchange registers and reissue the - * instruction with the operands renamed. - */ - pp := *p - - unbytereg(&pp.From, &pp.Ft) - unbytereg(&pp.To, &pp.Tt) - - z := int(p.From.Reg) - if p.From.Type == obj.TYPE_REG && z >= REG_BP && z <= REG_DI { - // TODO(rsc): Use this code for x86-64 too. It has bug fixes not present in the amd64 code base. - // For now, different to keep bit-for-bit compatibility. - if p.Mode == 32 { - breg := byteswapreg(ctxt, &p.To) - if breg != REG_AX { - ctxt.AsmBuf.Put1(0x87) // xchg lhs,bx - asmando(ctxt, p, &p.From, reg[breg]) - subreg(&pp, z, breg) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(0x87) // xchg lhs,bx - asmando(ctxt, p, &p.From, reg[breg]) - } else { - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg lsh,ax - subreg(&pp, z, REG_AX) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg lsh,ax - } - return - } - - if isax(&p.To) || p.To.Type == obj.TYPE_NONE { - // We certainly don't want to exchange - // with AX if the op is MUL or DIV. - ctxt.AsmBuf.Put1(0x87) // xchg lhs,bx - asmando(ctxt, p, &p.From, reg[REG_BX]) - subreg(&pp, z, REG_BX) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(0x87) // xchg lhs,bx - asmando(ctxt, p, &p.From, reg[REG_BX]) - } else { - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg lsh,ax - subreg(&pp, z, REG_AX) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg lsh,ax - } - return - } - - z = int(p.To.Reg) - if p.To.Type == obj.TYPE_REG && z >= REG_BP && z <= REG_DI { - // TODO(rsc): Use this code for x86-64 too. It has bug fixes not present in the amd64 code base. - // For now, different to keep bit-for-bit compatibility. - if p.Mode == 32 { - breg := byteswapreg(ctxt, &p.From) - if breg != REG_AX { - ctxt.AsmBuf.Put1(0x87) //xchg rhs,bx - asmando(ctxt, p, &p.To, reg[breg]) - subreg(&pp, z, breg) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(0x87) // xchg rhs,bx - asmando(ctxt, p, &p.To, reg[breg]) - } else { - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg rsh,ax - subreg(&pp, z, REG_AX) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg rsh,ax - } - return - } - - if isax(&p.From) { - ctxt.AsmBuf.Put1(0x87) // xchg rhs,bx - asmando(ctxt, p, &p.To, reg[REG_BX]) - subreg(&pp, z, REG_BX) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(0x87) // xchg rhs,bx - asmando(ctxt, p, &p.To, reg[REG_BX]) - } else { - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg rsh,ax - subreg(&pp, z, REG_AX) - doasm(ctxt, &pp) - ctxt.AsmBuf.Put1(byte(0x90 + reg[z])) // xchg rsh,ax - } - return - } - } - - ctxt.Diag("invalid instruction: %v", p) - // ctxt.Diag("doasm: notfound ft=%d tt=%d %v %d %d", p.Ft, p.Tt, p, oclass(ctxt, p, &p.From), oclass(ctxt, p, &p.To)) - return -} - -// byteswapreg returns a byte-addressable register (AX, BX, CX, DX) -// which is not referenced in a. -// If a is empty, it returns BX to account for MULB-like instructions -// that might use DX and AX. -func byteswapreg(ctxt *obj.Link, a *obj.Addr) int { - cand := 1 - canc := cand - canb := canc - cana := canb - - if a.Type == obj.TYPE_NONE { - cand = 0 - cana = cand - } - - if a.Type == obj.TYPE_REG || ((a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR) && a.Name == obj.NAME_NONE) { - switch a.Reg { - case REG_NONE: - cand = 0 - cana = cand - - case REG_AX, REG_AL, REG_AH: - cana = 0 - - case REG_BX, REG_BL, REG_BH: - canb = 0 - - case REG_CX, REG_CL, REG_CH: - canc = 0 - - case REG_DX, REG_DL, REG_DH: - cand = 0 - } - } - - if a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR { - switch a.Index { - case REG_AX: - cana = 0 - - case REG_BX: - canb = 0 - - case REG_CX: - canc = 0 - - case REG_DX: - cand = 0 - } - } - - if cana != 0 { - return REG_AX - } - if canb != 0 { - return REG_BX - } - if canc != 0 { - return REG_CX - } - if cand != 0 { - return REG_DX - } - - ctxt.Diag("impossible byte register") - log.Fatalf("bad code") - return 0 -} - -func isbadbyte(a *obj.Addr) bool { - return a.Type == obj.TYPE_REG && (REG_BP <= a.Reg && a.Reg <= REG_DI || REG_BPB <= a.Reg && a.Reg <= REG_DIB) -} - -var naclret = []uint8{ - 0x5e, // POPL SI - // 0x8b, 0x7d, 0x00, // MOVL (BP), DI - catch return to invalid address, for debugging - 0x83, - 0xe6, - 0xe0, // ANDL $~31, SI - 0x4c, - 0x01, - 0xfe, // ADDQ R15, SI - 0xff, - 0xe6, // JMP SI -} - -var naclret8 = []uint8{ - 0x5d, // POPL BP - // 0x8b, 0x7d, 0x00, // MOVL (BP), DI - catch return to invalid address, for debugging - 0x83, - 0xe5, - 0xe0, // ANDL $~31, BP - 0xff, - 0xe5, // JMP BP -} - -var naclspfix = []uint8{0x4c, 0x01, 0xfc} // ADDQ R15, SP - -var naclbpfix = []uint8{0x4c, 0x01, 0xfd} // ADDQ R15, BP - -var naclmovs = []uint8{ - 0x89, - 0xf6, // MOVL SI, SI - 0x49, - 0x8d, - 0x34, - 0x37, // LEAQ (R15)(SI*1), SI - 0x89, - 0xff, // MOVL DI, DI - 0x49, - 0x8d, - 0x3c, - 0x3f, // LEAQ (R15)(DI*1), DI -} - -var naclstos = []uint8{ - 0x89, - 0xff, // MOVL DI, DI - 0x49, - 0x8d, - 0x3c, - 0x3f, // LEAQ (R15)(DI*1), DI -} - -func nacltrunc(ctxt *obj.Link, reg int) { - if reg >= REG_R8 { - ctxt.AsmBuf.Put1(0x45) - } - reg = (reg - REG_AX) & 7 - ctxt.AsmBuf.Put2(0x89, byte(3<<6|reg<<3|reg)) -} - -func asmins(ctxt *obj.Link, p *obj.Prog) { - ctxt.AsmBuf.Reset() - ctxt.Asmode = int(p.Mode) - - if ctxt.Headtype == obj.Hnacl && p.Mode == 32 { - switch p.As { - case obj.ARET: - ctxt.AsmBuf.Put(naclret8) - return - - case obj.ACALL, - obj.AJMP: - if p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_DI { - ctxt.AsmBuf.Put3(0x83, byte(0xe0|(p.To.Reg-REG_AX)), 0xe0) - } - - case AINT: - ctxt.AsmBuf.Put1(0xf4) - return - } - } - - if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { - if p.As == AREP { - ctxt.Rep++ - return - } - - if p.As == AREPN { - ctxt.Repn++ - return - } - - if p.As == ALOCK { - ctxt.Lock++ - return - } - - if p.As != ALEAQ && p.As != ALEAL { - if p.From.Index != REG_NONE && p.From.Scale > 0 { - nacltrunc(ctxt, int(p.From.Index)) - } - if p.To.Index != REG_NONE && p.To.Scale > 0 { - nacltrunc(ctxt, int(p.To.Index)) - } - } - - switch p.As { - case obj.ARET: - ctxt.AsmBuf.Put(naclret) - return - - case obj.ACALL, - obj.AJMP: - if p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_DI { - // ANDL $~31, reg - ctxt.AsmBuf.Put3(0x83, byte(0xe0|(p.To.Reg-REG_AX)), 0xe0) - // ADDQ R15, reg - ctxt.AsmBuf.Put3(0x4c, 0x01, byte(0xf8|(p.To.Reg-REG_AX))) - } - - if p.To.Type == obj.TYPE_REG && REG_R8 <= p.To.Reg && p.To.Reg <= REG_R15 { - // ANDL $~31, reg - ctxt.AsmBuf.Put4(0x41, 0x83, byte(0xe0|(p.To.Reg-REG_R8)), 0xe0) - // ADDQ R15, reg - ctxt.AsmBuf.Put3(0x4d, 0x01, byte(0xf8|(p.To.Reg-REG_R8))) - } - - case AINT: - ctxt.AsmBuf.Put1(0xf4) - return - - case ASCASB, - ASCASW, - ASCASL, - ASCASQ, - ASTOSB, - ASTOSW, - ASTOSL, - ASTOSQ: - ctxt.AsmBuf.Put(naclstos) - - case AMOVSB, AMOVSW, AMOVSL, AMOVSQ: - ctxt.AsmBuf.Put(naclmovs) - } - - if ctxt.Rep != 0 { - ctxt.AsmBuf.Put1(0xf3) - ctxt.Rep = 0 - } - - if ctxt.Repn != 0 { - ctxt.AsmBuf.Put1(0xf2) - ctxt.Repn = 0 - } - - if ctxt.Lock != 0 { - ctxt.AsmBuf.Put1(0xf0) - ctxt.Lock = 0 - } - } - - ctxt.Rexflag = 0 - ctxt.Vexflag = 0 - mark := ctxt.AsmBuf.Len() - ctxt.Asmode = int(p.Mode) - doasm(ctxt, p) - if ctxt.Rexflag != 0 && ctxt.Vexflag == 0 { - /* - * as befits the whole approach of the architecture, - * the rex prefix must appear before the first opcode byte - * (and thus after any 66/67/f2/f3/26/2e/3e prefix bytes, but - * before the 0f opcode escape!), or it might be ignored. - * note that the handbook often misleadingly shows 66/f2/f3 in `opcode'. - */ - if p.Mode != 64 { - ctxt.Diag("asmins: illegal in mode %d: %v (%d %d)", p.Mode, p, p.Ft, p.Tt) - } - n := ctxt.AsmBuf.Len() - var np int - for np = mark; np < n; np++ { - c := ctxt.AsmBuf.Peek(np) - if c != 0xf2 && c != 0xf3 && (c < 0x64 || c > 0x67) && c != 0x2e && c != 0x3e && c != 0x26 { - break - } - } - ctxt.AsmBuf.Insert(np, byte(0x40|ctxt.Rexflag)) - } - - n := ctxt.AsmBuf.Len() - for i := len(ctxt.Cursym.R) - 1; i >= 0; i-- { - r := &ctxt.Cursym.R[i] - if int64(r.Off) < p.Pc { - break - } - if ctxt.Rexflag != 0 { - r.Off++ - } - if r.Type == obj.R_PCREL { - if p.Mode == 64 || p.As == obj.AJMP || p.As == obj.ACALL { - // PC-relative addressing is relative to the end of the instruction, - // but the relocations applied by the linker are relative to the end - // of the relocation. Because immediate instruction - // arguments can follow the PC-relative memory reference in the - // instruction encoding, the two may not coincide. In this case, - // adjust addend so that linker can keep relocating relative to the - // end of the relocation. - r.Add -= p.Pc + int64(n) - (int64(r.Off) + int64(r.Siz)) - } else if p.Mode == 32 { - // On 386 PC-relative addressing (for non-call/jmp instructions) - // assumes that the previous instruction loaded the PC of the end - // of that instruction into CX, so the adjustment is relative to - // that. - r.Add += int64(r.Off) - p.Pc + int64(r.Siz) - } - } - if r.Type == obj.R_GOTPCREL && p.Mode == 32 { - // On 386, R_GOTPCREL makes the same assumptions as R_PCREL. - r.Add += int64(r.Off) - p.Pc + int64(r.Siz) - } - - } - - if p.Mode == 64 && ctxt.Headtype == obj.Hnacl && p.As != ACMPL && p.As != ACMPQ && p.To.Type == obj.TYPE_REG { - switch p.To.Reg { - case REG_SP: - ctxt.AsmBuf.Put(naclspfix) - case REG_BP: - ctxt.AsmBuf.Put(naclbpfix) - } - } -} diff --git a/vendor/github.com/google/gops/internal/obj/x86/list6.go b/vendor/github.com/google/gops/internal/obj/x86/list6.go deleted file mode 100644 index 48f2edd5..00000000 --- a/vendor/github.com/google/gops/internal/obj/x86/list6.go +++ /dev/null @@ -1,181 +0,0 @@ -// Inferno utils/6c/list.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6c/list.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package x86 - -import ( - "fmt" - - "github.com/google/gops/internal/obj" -) - -var Register = []string{ - "AL", /* [D_AL] */ - "CL", - "DL", - "BL", - "SPB", - "BPB", - "SIB", - "DIB", - "R8B", - "R9B", - "R10B", - "R11B", - "R12B", - "R13B", - "R14B", - "R15B", - "AX", /* [D_AX] */ - "CX", - "DX", - "BX", - "SP", - "BP", - "SI", - "DI", - "R8", - "R9", - "R10", - "R11", - "R12", - "R13", - "R14", - "R15", - "AH", - "CH", - "DH", - "BH", - "F0", /* [D_F0] */ - "F1", - "F2", - "F3", - "F4", - "F5", - "F6", - "F7", - "M0", - "M1", - "M2", - "M3", - "M4", - "M5", - "M6", - "M7", - "X0", - "X1", - "X2", - "X3", - "X4", - "X5", - "X6", - "X7", - "X8", - "X9", - "X10", - "X11", - "X12", - "X13", - "X14", - "X15", - "Y0", - "Y1", - "Y2", - "Y3", - "Y4", - "Y5", - "Y6", - "Y7", - "Y8", - "Y9", - "Y10", - "Y11", - "Y12", - "Y13", - "Y14", - "Y15", - "CS", /* [D_CS] */ - "SS", - "DS", - "ES", - "FS", - "GS", - "GDTR", /* [D_GDTR] */ - "IDTR", /* [D_IDTR] */ - "LDTR", /* [D_LDTR] */ - "MSW", /* [D_MSW] */ - "TASK", /* [D_TASK] */ - "CR0", /* [D_CR] */ - "CR1", - "CR2", - "CR3", - "CR4", - "CR5", - "CR6", - "CR7", - "CR8", - "CR9", - "CR10", - "CR11", - "CR12", - "CR13", - "CR14", - "CR15", - "DR0", /* [D_DR] */ - "DR1", - "DR2", - "DR3", - "DR4", - "DR5", - "DR6", - "DR7", - "TR0", /* [D_TR] */ - "TR1", - "TR2", - "TR3", - "TR4", - "TR5", - "TR6", - "TR7", - "TLS", /* [D_TLS] */ - "MAXREG", /* [MAXREG] */ -} - -func init() { - obj.RegisterRegister(REG_AL, REG_AL+len(Register), Rconv) - obj.RegisterOpcode(obj.ABaseAMD64, Anames) -} - -func Rconv(r int) string { - if REG_AL <= r && r-REG_AL < len(Register) { - return Register[r-REG_AL] - } - return fmt.Sprintf("Rgok(%d)", r-obj.RBaseAMD64) -} diff --git a/vendor/github.com/google/gops/internal/obj/x86/obj6.go b/vendor/github.com/google/gops/internal/obj/x86/obj6.go deleted file mode 100644 index aad950bb..00000000 --- a/vendor/github.com/google/gops/internal/obj/x86/obj6.go +++ /dev/null @@ -1,1481 +0,0 @@ -// Inferno utils/6l/pass.c -// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6l/pass.c -// -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) -// Portions Copyright © 1997-1999 Vita Nuova Limited -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) -// Portions Copyright © 2004,2006 Bruce Ellis -// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) -// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package x86 - -import ( - "fmt" - "log" - "math" - "strings" - - "github.com/google/gops/internal/obj" - "github.com/google/gops/internal/sys" -) - -func CanUse1InsnTLS(ctxt *obj.Link) bool { - if isAndroid { - // For android, we use a disgusting hack that assumes - // the thread-local storage slot for g is allocated - // using pthread_key_create with a fixed offset - // (see src/runtime/cgo/gcc_android_amd64.c). - // This makes access to the TLS storage (for g) doable - // with 1 instruction. - return true - } - - if ctxt.Arch.RegSize == 4 { - switch ctxt.Headtype { - case obj.Hlinux, - obj.Hnacl, - obj.Hplan9, - obj.Hwindows, - obj.Hwindowsgui: - return false - } - - return true - } - - switch ctxt.Headtype { - case obj.Hplan9, obj.Hwindows, obj.Hwindowsgui: - return false - case obj.Hlinux: - return !ctxt.Flag_shared - } - - return true -} - -func progedit(ctxt *obj.Link, p *obj.Prog) { - // Maintain information about code generation mode. - if ctxt.Mode == 0 { - ctxt.Mode = ctxt.Arch.RegSize * 8 - } - p.Mode = int8(ctxt.Mode) - - switch p.As { - case AMODE: - if p.From.Type == obj.TYPE_CONST || (p.From.Type == obj.TYPE_MEM && p.From.Reg == REG_NONE) { - switch int(p.From.Offset) { - case 16, 32, 64: - ctxt.Mode = int(p.From.Offset) - } - } - obj.Nopout(p) - } - - // Thread-local storage references use the TLS pseudo-register. - // As a register, TLS refers to the thread-local storage base, and it - // can only be loaded into another register: - // - // MOVQ TLS, AX - // - // An offset from the thread-local storage base is written off(reg)(TLS*1). - // Semantically it is off(reg), but the (TLS*1) annotation marks this as - // indexing from the loaded TLS base. This emits a relocation so that - // if the linker needs to adjust the offset, it can. For example: - // - // MOVQ TLS, AX - // MOVQ 0(AX)(TLS*1), CX // load g into CX - // - // On systems that support direct access to the TLS memory, this - // pair of instructions can be reduced to a direct TLS memory reference: - // - // MOVQ 0(TLS), CX // load g into CX - // - // The 2-instruction and 1-instruction forms correspond to the two code - // sequences for loading a TLS variable in the local exec model given in "ELF - // Handling For Thread-Local Storage". - // - // We apply this rewrite on systems that support the 1-instruction form. - // The decision is made using only the operating system and the -shared flag, - // not the link mode. If some link modes on a particular operating system - // require the 2-instruction form, then all builds for that operating system - // will use the 2-instruction form, so that the link mode decision can be - // delayed to link time. - // - // In this way, all supported systems use identical instructions to - // access TLS, and they are rewritten appropriately first here in - // liblink and then finally using relocations in the linker. - // - // When -shared is passed, we leave the code in the 2-instruction form but - // assemble (and relocate) them in different ways to generate the initial - // exec code sequence. It's a bit of a fluke that this is possible without - // rewriting the instructions more comprehensively, and it only does because - // we only support a single TLS variable (g). - - if CanUse1InsnTLS(ctxt) { - // Reduce 2-instruction sequence to 1-instruction sequence. - // Sequences like - // MOVQ TLS, BX - // ... off(BX)(TLS*1) ... - // become - // NOP - // ... off(TLS) ... - // - // TODO(rsc): Remove the Hsolaris special case. It exists only to - // guarantee we are producing byte-identical binaries as before this code. - // But it should be unnecessary. - if (p.As == AMOVQ || p.As == AMOVL) && p.From.Type == obj.TYPE_REG && p.From.Reg == REG_TLS && p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_R15 && ctxt.Headtype != obj.Hsolaris { - obj.Nopout(p) - } - if p.From.Type == obj.TYPE_MEM && p.From.Index == REG_TLS && REG_AX <= p.From.Reg && p.From.Reg <= REG_R15 { - p.From.Reg = REG_TLS - p.From.Scale = 0 - p.From.Index = REG_NONE - } - - if p.To.Type == obj.TYPE_MEM && p.To.Index == REG_TLS && REG_AX <= p.To.Reg && p.To.Reg <= REG_R15 { - p.To.Reg = REG_TLS - p.To.Scale = 0 - p.To.Index = REG_NONE - } - } else { - // load_g_cx, below, always inserts the 1-instruction sequence. Rewrite it - // as the 2-instruction sequence if necessary. - // MOVQ 0(TLS), BX - // becomes - // MOVQ TLS, BX - // MOVQ 0(BX)(TLS*1), BX - if (p.As == AMOVQ || p.As == AMOVL) && p.From.Type == obj.TYPE_MEM && p.From.Reg == REG_TLS && p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_R15 { - q := obj.Appendp(ctxt, p) - q.As = p.As - q.From = p.From - q.From.Type = obj.TYPE_MEM - q.From.Reg = p.To.Reg - q.From.Index = REG_TLS - q.From.Scale = 2 // TODO: use 1 - q.To = p.To - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_TLS - p.From.Index = REG_NONE - p.From.Offset = 0 - } - } - - // TODO: Remove. - if (ctxt.Headtype == obj.Hwindows || ctxt.Headtype == obj.Hwindowsgui) && p.Mode == 64 || ctxt.Headtype == obj.Hplan9 { - if p.From.Scale == 1 && p.From.Index == REG_TLS { - p.From.Scale = 2 - } - if p.To.Scale == 1 && p.To.Index == REG_TLS { - p.To.Scale = 2 - } - } - - // Rewrite 0 to $0 in 3rd argument to CMPPS etc. - // That's what the tables expect. - switch p.As { - case ACMPPD, ACMPPS, ACMPSD, ACMPSS: - if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE && p.To.Reg == REG_NONE && p.To.Index == REG_NONE && p.To.Sym == nil { - p.To.Type = obj.TYPE_CONST - } - } - - // Rewrite CALL/JMP/RET to symbol as TYPE_BRANCH. - switch p.As { - case obj.ACALL, obj.AJMP, obj.ARET: - if p.To.Type == obj.TYPE_MEM && (p.To.Name == obj.NAME_EXTERN || p.To.Name == obj.NAME_STATIC) && p.To.Sym != nil { - p.To.Type = obj.TYPE_BRANCH - } - } - - // Rewrite MOVL/MOVQ $XXX(FP/SP) as LEAL/LEAQ. - if p.From.Type == obj.TYPE_ADDR && (ctxt.Arch.Family == sys.AMD64 || p.From.Name != obj.NAME_EXTERN && p.From.Name != obj.NAME_STATIC) { - switch p.As { - case AMOVL: - p.As = ALEAL - p.From.Type = obj.TYPE_MEM - case AMOVQ: - p.As = ALEAQ - p.From.Type = obj.TYPE_MEM - } - } - - if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { - if p.From3 != nil { - nacladdr(ctxt, p, p.From3) - } - nacladdr(ctxt, p, &p.From) - nacladdr(ctxt, p, &p.To) - } - - // Rewrite float constants to values stored in memory. - switch p.As { - // Convert AMOVSS $(0), Xx to AXORPS Xx, Xx - case AMOVSS: - if p.From.Type == obj.TYPE_FCONST { - // f == 0 can't be used here due to -0, so use Float64bits - if f := p.From.Val.(float64); math.Float64bits(f) == 0 { - if p.To.Type == obj.TYPE_REG && REG_X0 <= p.To.Reg && p.To.Reg <= REG_X15 { - p.As = AXORPS - p.From = p.To - break - } - } - } - fallthrough - - case AFMOVF, - AFADDF, - AFSUBF, - AFSUBRF, - AFMULF, - AFDIVF, - AFDIVRF, - AFCOMF, - AFCOMFP, - AADDSS, - ASUBSS, - AMULSS, - ADIVSS, - ACOMISS, - AUCOMISS: - if p.From.Type == obj.TYPE_FCONST { - f32 := float32(p.From.Val.(float64)) - i32 := math.Float32bits(f32) - literal := fmt.Sprintf("$f32.%08x", i32) - s := obj.Linklookup(ctxt, literal, 0) - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_EXTERN - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Offset = 0 - } - - case AMOVSD: - // Convert AMOVSD $(0), Xx to AXORPS Xx, Xx - if p.From.Type == obj.TYPE_FCONST { - // f == 0 can't be used here due to -0, so use Float64bits - if f := p.From.Val.(float64); math.Float64bits(f) == 0 { - if p.To.Type == obj.TYPE_REG && REG_X0 <= p.To.Reg && p.To.Reg <= REG_X15 { - p.As = AXORPS - p.From = p.To - break - } - } - } - fallthrough - - case AFMOVD, - AFADDD, - AFSUBD, - AFSUBRD, - AFMULD, - AFDIVD, - AFDIVRD, - AFCOMD, - AFCOMDP, - AADDSD, - ASUBSD, - AMULSD, - ADIVSD, - ACOMISD, - AUCOMISD: - if p.From.Type == obj.TYPE_FCONST { - i64 := math.Float64bits(p.From.Val.(float64)) - literal := fmt.Sprintf("$f64.%016x", i64) - s := obj.Linklookup(ctxt, literal, 0) - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_EXTERN - p.From.Sym = s - p.From.Sym.Set(obj.AttrLocal, true) - p.From.Offset = 0 - } - } - - if ctxt.Flag_dynlink { - rewriteToUseGot(ctxt, p) - } - - if ctxt.Flag_shared && p.Mode == 32 { - rewriteToPcrel(ctxt, p) - } -} - -// Rewrite p, if necessary, to access global data via the global offset table. -func rewriteToUseGot(ctxt *obj.Link, p *obj.Prog) { - var add, lea, mov obj.As - var reg int16 - if p.Mode == 64 { - add = AADDQ - lea = ALEAQ - mov = AMOVQ - reg = REG_R15 - } else { - add = AADDL - lea = ALEAL - mov = AMOVL - reg = REG_CX - if p.As == ALEAL && p.To.Reg != p.From.Reg && p.To.Reg != p.From.Index { - // Special case: clobber the destination register with - // the PC so we don't have to clobber CX. - // The SSA backend depends on CX not being clobbered across LEAL. - // See cmd/compile/internal/ssa/gen/386.rules (search for Flag_shared). - reg = p.To.Reg - } - } - - if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO { - // ADUFFxxx $offset - // becomes - // $MOV runtime.duffxxx@GOT, $reg - // $ADD $offset, $reg - // CALL $reg - var sym *obj.LSym - if p.As == obj.ADUFFZERO { - sym = obj.Linklookup(ctxt, "runtime.duffzero", 0) - } else { - sym = obj.Linklookup(ctxt, "runtime.duffcopy", 0) - } - offset := p.To.Offset - p.As = mov - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - p.From.Sym = sym - p.To.Type = obj.TYPE_REG - p.To.Reg = reg - p.To.Offset = 0 - p.To.Sym = nil - p1 := obj.Appendp(ctxt, p) - p1.As = add - p1.From.Type = obj.TYPE_CONST - p1.From.Offset = offset - p1.To.Type = obj.TYPE_REG - p1.To.Reg = reg - p2 := obj.Appendp(ctxt, p1) - p2.As = obj.ACALL - p2.To.Type = obj.TYPE_REG - p2.To.Reg = reg - } - - // We only care about global data: NAME_EXTERN means a global - // symbol in the Go sense, and p.Sym.Local is true for a few - // internally defined symbols. - if p.As == lea && p.From.Type == obj.TYPE_MEM && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - // $LEA sym, Rx becomes $MOV $sym, Rx which will be rewritten below - p.As = mov - p.From.Type = obj.TYPE_ADDR - } - if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - // $MOV $sym, Rx becomes $MOV sym@GOT, Rx - // $MOV $sym+, Rx becomes $MOV sym@GOT, Rx; $LEA (Rx), Rx - // On 386 only, more complicated things like PUSHL $sym become $MOV sym@GOT, CX; PUSHL CX - cmplxdest := false - pAs := p.As - var dest obj.Addr - if p.To.Type != obj.TYPE_REG || pAs != mov { - if p.Mode == 64 { - ctxt.Diag("do not know how to handle LEA-type insn to non-register in %v with -dynlink", p) - } - cmplxdest = true - dest = p.To - p.As = mov - p.To.Type = obj.TYPE_REG - p.To.Reg = reg - p.To.Sym = nil - p.To.Name = obj.NAME_NONE - } - p.From.Type = obj.TYPE_MEM - p.From.Name = obj.NAME_GOTREF - q := p - if p.From.Offset != 0 { - q = obj.Appendp(ctxt, p) - q.As = lea - q.From.Type = obj.TYPE_MEM - q.From.Reg = p.To.Reg - q.From.Offset = p.From.Offset - q.To = p.To - p.From.Offset = 0 - } - if cmplxdest { - q = obj.Appendp(ctxt, q) - q.As = pAs - q.To = dest - q.From.Type = obj.TYPE_REG - q.From.Reg = reg - } - } - if p.From3 != nil && p.From3.Name == obj.NAME_EXTERN { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - var source *obj.Addr - // MOVx sym, Ry becomes $MOV sym@GOT, R15; MOVx (R15), Ry - // MOVx Ry, sym becomes $MOV sym@GOT, R15; MOVx Ry, (R15) - // An addition may be inserted between the two MOVs if there is an offset. - if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local() { - if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p) - } - source = &p.From - } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local() { - source = &p.To - } else { - return - } - if p.As == obj.ACALL { - // When dynlinking on 386, almost any call might end up being a call - // to a PLT, so make sure the GOT pointer is loaded into BX. - // RegTo2 is set on the replacement call insn to stop it being - // processed when it is in turn passed to progedit. - if p.Mode == 64 || (p.To.Sym != nil && p.To.Sym.Local()) || p.RegTo2 != 0 { - return - } - p1 := obj.Appendp(ctxt, p) - p2 := obj.Appendp(ctxt, p1) - - p1.As = ALEAL - p1.From.Type = obj.TYPE_MEM - p1.From.Name = obj.NAME_STATIC - p1.From.Sym = obj.Linklookup(ctxt, "_GLOBAL_OFFSET_TABLE_", 0) - p1.To.Type = obj.TYPE_REG - p1.To.Reg = REG_BX - - p2.As = p.As - p2.Scond = p.Scond - p2.From = p.From - p2.From3 = p.From3 - p2.Reg = p.Reg - p2.To = p.To - // p.To.Type was set to TYPE_BRANCH above, but that makes checkaddr - // in ../pass.go complain, so set it back to TYPE_MEM here, until p2 - // itself gets passed to progedit. - p2.To.Type = obj.TYPE_MEM - p2.RegTo2 = 1 - - obj.Nopout(p) - return - - } - if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ARET || p.As == obj.AJMP { - return - } - if source.Type != obj.TYPE_MEM { - ctxt.Diag("don't know how to handle %v with -dynlink", p) - } - p1 := obj.Appendp(ctxt, p) - p2 := obj.Appendp(ctxt, p1) - - p1.As = mov - p1.From.Type = obj.TYPE_MEM - p1.From.Sym = source.Sym - p1.From.Name = obj.NAME_GOTREF - p1.To.Type = obj.TYPE_REG - p1.To.Reg = reg - - p2.As = p.As - p2.From = p.From - p2.To = p.To - if p.From.Name == obj.NAME_EXTERN { - p2.From.Reg = reg - p2.From.Name = obj.NAME_NONE - p2.From.Sym = nil - } else if p.To.Name == obj.NAME_EXTERN { - p2.To.Reg = reg - p2.To.Name = obj.NAME_NONE - p2.To.Sym = nil - } else { - return - } - obj.Nopout(p) -} - -func rewriteToPcrel(ctxt *obj.Link, p *obj.Prog) { - // RegTo2 is set on the instructions we insert here so they don't get - // processed twice. - if p.RegTo2 != 0 { - return - } - if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { - return - } - // Any Prog (aside from the above special cases) with an Addr with Name == - // NAME_EXTERN, NAME_STATIC or NAME_GOTREF has a CALL __x86.get_pc_thunk.XX - // inserted before it. - isName := func(a *obj.Addr) bool { - if a.Sym == nil || (a.Type != obj.TYPE_MEM && a.Type != obj.TYPE_ADDR) || a.Reg != 0 { - return false - } - if a.Sym.Type == obj.STLSBSS { - return false - } - return a.Name == obj.NAME_EXTERN || a.Name == obj.NAME_STATIC || a.Name == obj.NAME_GOTREF - } - - if isName(&p.From) && p.From.Type == obj.TYPE_ADDR { - // Handle things like "MOVL $sym, (SP)" or "PUSHL $sym" by rewriting - // to "MOVL $sym, CX; MOVL CX, (SP)" or "MOVL $sym, CX; PUSHL CX" - // respectively. - if p.To.Type != obj.TYPE_REG { - q := obj.Appendp(ctxt, p) - q.As = p.As - q.From.Type = obj.TYPE_REG - q.From.Reg = REG_CX - q.To = p.To - p.As = AMOVL - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_CX - p.To.Sym = nil - p.To.Name = obj.NAME_NONE - } - } - - if !isName(&p.From) && !isName(&p.To) && (p.From3 == nil || !isName(p.From3)) { - return - } - var dst int16 = REG_CX - if (p.As == ALEAL || p.As == AMOVL) && p.To.Reg != p.From.Reg && p.To.Reg != p.From.Index { - dst = p.To.Reg - // Why? See the comment near the top of rewriteToUseGot above. - // AMOVLs might be introduced by the GOT rewrites. - } - q := obj.Appendp(ctxt, p) - q.RegTo2 = 1 - r := obj.Appendp(ctxt, q) - r.RegTo2 = 1 - q.As = obj.ACALL - q.To.Sym = obj.Linklookup(ctxt, "__x86.get_pc_thunk."+strings.ToLower(Rconv(int(dst))), 0) - q.To.Type = obj.TYPE_MEM - q.To.Name = obj.NAME_EXTERN - q.To.Sym.Set(obj.AttrLocal, true) - r.As = p.As - r.Scond = p.Scond - r.From = p.From - r.From3 = p.From3 - r.Reg = p.Reg - r.To = p.To - if isName(&p.From) { - r.From.Reg = dst - } - if isName(&p.To) { - r.To.Reg = dst - } - if p.From3 != nil && isName(p.From3) { - r.From3.Reg = dst - } - obj.Nopout(p) -} - -func nacladdr(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { - if p.As == ALEAL || p.As == ALEAQ { - return - } - - if a.Reg == REG_BP { - ctxt.Diag("invalid address: %v", p) - return - } - - if a.Reg == REG_TLS { - a.Reg = REG_BP - } - if a.Type == obj.TYPE_MEM && a.Name == obj.NAME_NONE { - switch a.Reg { - // all ok - case REG_BP, REG_SP, REG_R15: - break - - default: - if a.Index != REG_NONE { - ctxt.Diag("invalid address %v", p) - } - a.Index = a.Reg - if a.Index != REG_NONE { - a.Scale = 1 - } - a.Reg = REG_R15 - } - } -} - -func preprocess(ctxt *obj.Link, cursym *obj.LSym) { - if ctxt.Headtype == obj.Hplan9 && ctxt.Plan9privates == nil { - ctxt.Plan9privates = obj.Linklookup(ctxt, "_privates", 0) - } - - ctxt.Cursym = cursym - - if cursym.Text == nil || cursym.Text.Link == nil { - return - } - - p := cursym.Text - autoffset := int32(p.To.Offset) - if autoffset < 0 { - autoffset = 0 - } - - var bpsize int - if p.Mode == 64 && ctxt.Framepointer_enabled && autoffset > 0 && p.From3.Offset&obj.NOFRAME == 0 { - // Make room for to save a base pointer. If autoffset == 0, - // this might do something special like a tail jump to - // another function, so in that case we omit this. - bpsize = ctxt.Arch.PtrSize - autoffset += int32(bpsize) - p.To.Offset += int64(bpsize) - } else { - bpsize = 0 - } - - textarg := int64(p.To.Val.(int32)) - cursym.Args = int32(textarg) - cursym.Locals = int32(p.To.Offset) - - // TODO(rsc): Remove. - if p.Mode == 32 && cursym.Locals < 0 { - cursym.Locals = 0 - } - - // TODO(rsc): Remove 'p.Mode == 64 &&'. - if p.Mode == 64 && autoffset < obj.StackSmall && p.From3Offset()&obj.NOSPLIT == 0 { - leaf := true - LeafSearch: - for q := p; q != nil; q = q.Link { - switch q.As { - case obj.ACALL: - // Treat common runtime calls that take no arguments - // the same as duffcopy and duffzero. - if !isZeroArgRuntimeCall(q.To.Sym) { - leaf = false - break LeafSearch - } - fallthrough - case obj.ADUFFCOPY, obj.ADUFFZERO: - if autoffset >= obj.StackSmall-8 { - leaf = false - break LeafSearch - } - } - } - - if leaf { - p.From3.Offset |= obj.NOSPLIT - } - } - - if p.From3Offset()&obj.NOSPLIT == 0 || p.From3Offset()&obj.WRAPPER != 0 { - p = obj.Appendp(ctxt, p) - p = load_g_cx(ctxt, p) // load g into CX - } - - if cursym.Text.From3Offset()&obj.NOSPLIT == 0 { - p = stacksplit(ctxt, p, autoffset, int32(textarg)) // emit split check - } - - if autoffset != 0 { - if autoffset%int32(ctxt.Arch.RegSize) != 0 { - ctxt.Diag("unaligned stack size %d", autoffset) - } - p = obj.Appendp(ctxt, p) - p.As = AADJSP - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(autoffset) - p.Spadj = autoffset - } - - deltasp := autoffset - - if bpsize > 0 { - // Save caller's BP - p = obj.Appendp(ctxt, p) - - p.As = AMOVQ - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_BP - p.To.Type = obj.TYPE_MEM - p.To.Reg = REG_SP - p.To.Scale = 1 - p.To.Offset = int64(autoffset) - int64(bpsize) - - // Move current frame to BP - p = obj.Appendp(ctxt, p) - - p.As = ALEAQ - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_SP - p.From.Scale = 1 - p.From.Offset = int64(autoffset) - int64(bpsize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_BP - } - - if cursym.Text.From3Offset()&obj.WRAPPER != 0 { - // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame - // - // MOVQ g_panic(CX), BX - // TESTQ BX, BX - // JEQ end - // LEAQ (autoffset+8)(SP), DI - // CMPQ panic_argp(BX), DI - // JNE end - // MOVQ SP, panic_argp(BX) - // end: - // NOP - // - // The NOP is needed to give the jumps somewhere to land. - // It is a liblink NOP, not an x86 NOP: it encodes to 0 instruction bytes. - - p = obj.Appendp(ctxt, p) - - p.As = AMOVQ - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_CX - p.From.Offset = 4 * int64(ctxt.Arch.PtrSize) // G.panic - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_BX - if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { - p.As = AMOVL - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_R15 - p.From.Scale = 1 - p.From.Index = REG_CX - } - if p.Mode == 32 { - p.As = AMOVL - } - - p = obj.Appendp(ctxt, p) - p.As = ATESTQ - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_BX - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_BX - if ctxt.Headtype == obj.Hnacl || p.Mode == 32 { - p.As = ATESTL - } - - p = obj.Appendp(ctxt, p) - p.As = AJEQ - p.To.Type = obj.TYPE_BRANCH - p1 := p - - p = obj.Appendp(ctxt, p) - p.As = ALEAQ - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_SP - p.From.Offset = int64(autoffset) + int64(ctxt.Arch.RegSize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_DI - if ctxt.Headtype == obj.Hnacl || p.Mode == 32 { - p.As = ALEAL - } - - p = obj.Appendp(ctxt, p) - p.As = ACMPQ - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_BX - p.From.Offset = 0 // Panic.argp - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_DI - if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { - p.As = ACMPL - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_R15 - p.From.Scale = 1 - p.From.Index = REG_BX - } - if p.Mode == 32 { - p.As = ACMPL - } - - p = obj.Appendp(ctxt, p) - p.As = AJNE - p.To.Type = obj.TYPE_BRANCH - p2 := p - - p = obj.Appendp(ctxt, p) - p.As = AMOVQ - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_SP - p.To.Type = obj.TYPE_MEM - p.To.Reg = REG_BX - p.To.Offset = 0 // Panic.argp - if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { - p.As = AMOVL - p.To.Type = obj.TYPE_MEM - p.To.Reg = REG_R15 - p.To.Scale = 1 - p.To.Index = REG_BX - } - if p.Mode == 32 { - p.As = AMOVL - } - - p = obj.Appendp(ctxt, p) - p.As = obj.ANOP - p1.Pcond = p - p2.Pcond = p - } - - for ; p != nil; p = p.Link { - pcsize := int(p.Mode) / 8 - switch p.From.Name { - case obj.NAME_AUTO: - p.From.Offset += int64(deltasp) - int64(bpsize) - case obj.NAME_PARAM: - p.From.Offset += int64(deltasp) + int64(pcsize) - } - if p.From3 != nil { - switch p.From3.Name { - case obj.NAME_AUTO: - p.From3.Offset += int64(deltasp) - int64(bpsize) - case obj.NAME_PARAM: - p.From3.Offset += int64(deltasp) + int64(pcsize) - } - } - switch p.To.Name { - case obj.NAME_AUTO: - p.To.Offset += int64(deltasp) - int64(bpsize) - case obj.NAME_PARAM: - p.To.Offset += int64(deltasp) + int64(pcsize) - } - - switch p.As { - default: - continue - - case APUSHL, APUSHFL: - deltasp += 4 - p.Spadj = 4 - continue - - case APUSHQ, APUSHFQ: - deltasp += 8 - p.Spadj = 8 - continue - - case APUSHW, APUSHFW: - deltasp += 2 - p.Spadj = 2 - continue - - case APOPL, APOPFL: - deltasp -= 4 - p.Spadj = -4 - continue - - case APOPQ, APOPFQ: - deltasp -= 8 - p.Spadj = -8 - continue - - case APOPW, APOPFW: - deltasp -= 2 - p.Spadj = -2 - continue - - case obj.ARET: - // do nothing - } - - if autoffset != deltasp { - ctxt.Diag("unbalanced PUSH/POP") - } - - if autoffset != 0 { - if bpsize > 0 { - // Restore caller's BP - p.As = AMOVQ - - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_SP - p.From.Scale = 1 - p.From.Offset = int64(autoffset) - int64(bpsize) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_BP - p = obj.Appendp(ctxt, p) - } - - p.As = AADJSP - p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(-autoffset) - p.Spadj = -autoffset - p = obj.Appendp(ctxt, p) - p.As = obj.ARET - - // If there are instructions following - // this ARET, they come from a branch - // with the same stackframe, so undo - // the cleanup. - p.Spadj = +autoffset - } - - if p.To.Sym != nil { // retjmp - p.As = obj.AJMP - } - } -} - -func isZeroArgRuntimeCall(s *obj.LSym) bool { - if s == nil { - return false - } - switch s.Name { - case "runtime.panicindex", "runtime.panicslice", "runtime.panicdivide": - return true - } - return false -} - -func indir_cx(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { - if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { - a.Type = obj.TYPE_MEM - a.Reg = REG_R15 - a.Index = REG_CX - a.Scale = 1 - return - } - - a.Type = obj.TYPE_MEM - a.Reg = REG_CX -} - -// Append code to p to load g into cx. -// Overwrites p with the first instruction (no first appendp). -// Overwriting p is unusual but it lets use this in both the -// prologue (caller must call appendp first) and in the epilogue. -// Returns last new instruction. -func load_g_cx(ctxt *obj.Link, p *obj.Prog) *obj.Prog { - p.As = AMOVQ - if ctxt.Arch.PtrSize == 4 { - p.As = AMOVL - } - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_TLS - p.From.Offset = 0 - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_CX - - next := p.Link - progedit(ctxt, p) - for p.Link != next { - p = p.Link - } - - if p.From.Index == REG_TLS { - p.From.Scale = 2 - } - - return p -} - -// Append code to p to check for stack split. -// Appends to (does not overwrite) p. -// Assumes g is in CX. -// Returns last new instruction. -func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32, textarg int32) *obj.Prog { - cmp := ACMPQ - lea := ALEAQ - mov := AMOVQ - sub := ASUBQ - - if ctxt.Headtype == obj.Hnacl || p.Mode == 32 { - cmp = ACMPL - lea = ALEAL - mov = AMOVL - sub = ASUBL - } - - var q1 *obj.Prog - if framesize <= obj.StackSmall { - // small stack: SP <= stackguard - // CMPQ SP, stackguard - p = obj.Appendp(ctxt, p) - - p.As = cmp - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_SP - indir_cx(ctxt, p, &p.To) - p.To.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.To.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - } else if framesize <= obj.StackBig { - // large stack: SP-framesize <= stackguard-StackSmall - // LEAQ -xxx(SP), AX - // CMPQ AX, stackguard - p = obj.Appendp(ctxt, p) - - p.As = lea - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_SP - p.From.Offset = -(int64(framesize) - obj.StackSmall) - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_AX - - p = obj.Appendp(ctxt, p) - p.As = cmp - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_AX - indir_cx(ctxt, p, &p.To) - p.To.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.To.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - } else { - // Such a large stack we need to protect against wraparound. - // If SP is close to zero: - // SP-stackguard+StackGuard <= framesize + (StackGuard-StackSmall) - // The +StackGuard on both sides is required to keep the left side positive: - // SP is allowed to be slightly below stackguard. See stack.h. - // - // Preemption sets stackguard to StackPreempt, a very large value. - // That breaks the math above, so we have to check for that explicitly. - // MOVQ stackguard, CX - // CMPQ CX, $StackPreempt - // JEQ label-of-call-to-morestack - // LEAQ StackGuard(SP), AX - // SUBQ CX, AX - // CMPQ AX, $(framesize+(StackGuard-StackSmall)) - - p = obj.Appendp(ctxt, p) - - p.As = mov - indir_cx(ctxt, p, &p.From) - p.From.Offset = 2 * int64(ctxt.Arch.PtrSize) // G.stackguard0 - if ctxt.Cursym.CFunc() { - p.From.Offset = 3 * int64(ctxt.Arch.PtrSize) // G.stackguard1 - } - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_SI - - p = obj.Appendp(ctxt, p) - p.As = cmp - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_SI - p.To.Type = obj.TYPE_CONST - p.To.Offset = obj.StackPreempt - if p.Mode == 32 { - p.To.Offset = int64(uint32(obj.StackPreempt & (1<<32 - 1))) - } - - p = obj.Appendp(ctxt, p) - p.As = AJEQ - p.To.Type = obj.TYPE_BRANCH - q1 = p - - p = obj.Appendp(ctxt, p) - p.As = lea - p.From.Type = obj.TYPE_MEM - p.From.Reg = REG_SP - p.From.Offset = obj.StackGuard - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_AX - - p = obj.Appendp(ctxt, p) - p.As = sub - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_SI - p.To.Type = obj.TYPE_REG - p.To.Reg = REG_AX - - p = obj.Appendp(ctxt, p) - p.As = cmp - p.From.Type = obj.TYPE_REG - p.From.Reg = REG_AX - p.To.Type = obj.TYPE_CONST - p.To.Offset = int64(framesize) + (obj.StackGuard - obj.StackSmall) - } - - // common - jls := obj.Appendp(ctxt, p) - jls.As = AJLS - jls.To.Type = obj.TYPE_BRANCH - - var last *obj.Prog - for last = ctxt.Cursym.Text; last.Link != nil; last = last.Link { - } - - // Now we are at the end of the function, but logically - // we are still in function prologue. We need to fix the - // SP data and PCDATA. - spfix := obj.Appendp(ctxt, last) - spfix.As = obj.ANOP - spfix.Spadj = -framesize - - pcdata := obj.Appendp(ctxt, spfix) - pcdata.Lineno = ctxt.Cursym.Text.Lineno - pcdata.Mode = ctxt.Cursym.Text.Mode - pcdata.As = obj.APCDATA - pcdata.From.Type = obj.TYPE_CONST - pcdata.From.Offset = obj.PCDATA_StackMapIndex - pcdata.To.Type = obj.TYPE_CONST - pcdata.To.Offset = -1 // pcdata starts at -1 at function entry - - call := obj.Appendp(ctxt, pcdata) - call.Lineno = ctxt.Cursym.Text.Lineno - call.Mode = ctxt.Cursym.Text.Mode - call.As = obj.ACALL - call.To.Type = obj.TYPE_BRANCH - call.To.Name = obj.NAME_EXTERN - morestack := "runtime.morestack" - switch { - case ctxt.Cursym.CFunc(): - morestack = "runtime.morestackc" - case ctxt.Cursym.Text.From3Offset()&obj.NEEDCTXT == 0: - morestack = "runtime.morestack_noctxt" - } - call.To.Sym = obj.Linklookup(ctxt, morestack, 0) - // When compiling 386 code for dynamic linking, the call needs to be adjusted - // to follow PIC rules. This in turn can insert more instructions, so we need - // to keep track of the start of the call (where the jump will be to) and the - // end (which following instructions are appended to). - callend := call - progedit(ctxt, callend) - for ; callend.Link != nil; callend = callend.Link { - progedit(ctxt, callend.Link) - } - - jmp := obj.Appendp(ctxt, callend) - jmp.As = obj.AJMP - jmp.To.Type = obj.TYPE_BRANCH - jmp.Pcond = ctxt.Cursym.Text.Link - jmp.Spadj = +framesize - - jls.Pcond = call - if q1 != nil { - q1.Pcond = call - } - - return jls -} - -func follow(ctxt *obj.Link, s *obj.LSym) { - ctxt.Cursym = s - - firstp := ctxt.NewProg() - lastp := firstp - xfol(ctxt, s.Text, &lastp) - lastp.Link = nil - s.Text = firstp.Link -} - -func nofollow(a obj.As) bool { - switch a { - case obj.AJMP, - obj.ARET, - AIRETL, - AIRETQ, - AIRETW, - ARETFL, - ARETFQ, - ARETFW, - obj.AUNDEF: - return true - } - - return false -} - -func pushpop(a obj.As) bool { - switch a { - case APUSHL, - APUSHFL, - APUSHQ, - APUSHFQ, - APUSHW, - APUSHFW, - APOPL, - APOPFL, - APOPQ, - APOPFQ, - APOPW, - APOPFW: - return true - } - - return false -} - -func relinv(a obj.As) obj.As { - switch a { - case AJEQ: - return AJNE - case AJNE: - return AJEQ - case AJLE: - return AJGT - case AJLS: - return AJHI - case AJLT: - return AJGE - case AJMI: - return AJPL - case AJGE: - return AJLT - case AJPL: - return AJMI - case AJGT: - return AJLE - case AJHI: - return AJLS - case AJCS: - return AJCC - case AJCC: - return AJCS - case AJPS: - return AJPC - case AJPC: - return AJPS - case AJOS: - return AJOC - case AJOC: - return AJOS - } - - log.Fatalf("unknown relation: %s", a) - return 0 -} - -func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { - var q *obj.Prog - var i int - var a obj.As - -loop: - if p == nil { - return - } - if p.As == obj.AJMP { - q = p.Pcond - if q != nil && q.As != obj.ATEXT { - /* mark instruction as done and continue layout at target of jump */ - p.Mark |= DONE - - p = q - if p.Mark&DONE == 0 { - goto loop - } - } - } - - if p.Mark&DONE != 0 { - /* - * p goes here, but already used it elsewhere. - * copy up to 4 instructions or else branch to other copy. - */ - i = 0 - q = p - for ; i < 4; i, q = i+1, q.Link { - if q == nil { - break - } - if q == *last { - break - } - a = q.As - if a == obj.ANOP { - i-- - continue - } - - if nofollow(a) || pushpop(a) { - break // NOTE(rsc): arm does goto copy - } - if q.Pcond == nil || q.Pcond.Mark&DONE != 0 { - continue - } - if a == obj.ACALL || a == ALOOP { - continue - } - for { - if p.As == obj.ANOP { - p = p.Link - continue - } - - q = obj.Copyp(ctxt, p) - p = p.Link - q.Mark |= DONE - (*last).Link = q - *last = q - if q.As != a || q.Pcond == nil || q.Pcond.Mark&DONE != 0 { - continue - } - - q.As = relinv(q.As) - p = q.Pcond - q.Pcond = q.Link - q.Link = p - xfol(ctxt, q.Link, last) - p = q.Link - if p.Mark&DONE != 0 { - return - } - goto loop - /* */ - } - } - q = ctxt.NewProg() - q.As = obj.AJMP - q.Lineno = p.Lineno - q.To.Type = obj.TYPE_BRANCH - q.To.Offset = p.Pc - q.Pcond = p - p = q - } - - /* emit p */ - p.Mark |= DONE - - (*last).Link = p - *last = p - a = p.As - - /* continue loop with what comes after p */ - if nofollow(a) { - return - } - if p.Pcond != nil && a != obj.ACALL { - /* - * some kind of conditional branch. - * recurse to follow one path. - * continue loop on the other. - */ - q = obj.Brchain(ctxt, p.Pcond) - if q != nil { - p.Pcond = q - } - q = obj.Brchain(ctxt, p.Link) - if q != nil { - p.Link = q - } - if p.From.Type == obj.TYPE_CONST { - if p.From.Offset == 1 { - /* - * expect conditional jump to be taken. - * rewrite so that's the fall-through case. - */ - p.As = relinv(a) - - q = p.Link - p.Link = p.Pcond - p.Pcond = q - } - } else { - q = p.Link - if q.Mark&DONE != 0 { - if a != ALOOP { - p.As = relinv(a) - p.Link = p.Pcond - p.Pcond = q - } - } - } - - xfol(ctxt, p.Link, last) - if p.Pcond.Mark&DONE != 0 { - return - } - p = p.Pcond - goto loop - } - - p = p.Link - goto loop -} - -var unaryDst = map[obj.As]bool{ - ABSWAPL: true, - ABSWAPQ: true, - ACMPXCHG8B: true, - ADECB: true, - ADECL: true, - ADECQ: true, - ADECW: true, - AINCB: true, - AINCL: true, - AINCQ: true, - AINCW: true, - ANEGB: true, - ANEGL: true, - ANEGQ: true, - ANEGW: true, - ANOTB: true, - ANOTL: true, - ANOTQ: true, - ANOTW: true, - APOPL: true, - APOPQ: true, - APOPW: true, - ASETCC: true, - ASETCS: true, - ASETEQ: true, - ASETGE: true, - ASETGT: true, - ASETHI: true, - ASETLE: true, - ASETLS: true, - ASETLT: true, - ASETMI: true, - ASETNE: true, - ASETOC: true, - ASETOS: true, - ASETPC: true, - ASETPL: true, - ASETPS: true, - AFFREE: true, - AFLDENV: true, - AFSAVE: true, - AFSTCW: true, - AFSTENV: true, - AFSTSW: true, - AFXSAVE: true, - AFXSAVE64: true, - ASTMXCSR: true, -} - -var Linkamd64 = obj.LinkArch{ - Arch: sys.ArchAMD64, - Preprocess: preprocess, - Assemble: span6, - Follow: follow, - Progedit: progedit, - UnaryDst: unaryDst, -} - -var Linkamd64p32 = obj.LinkArch{ - Arch: sys.ArchAMD64P32, - Preprocess: preprocess, - Assemble: span6, - Follow: follow, - Progedit: progedit, - UnaryDst: unaryDst, -} - -var Link386 = obj.LinkArch{ - Arch: sys.Arch386, - Preprocess: preprocess, - Assemble: span6, - Follow: follow, - Progedit: progedit, - UnaryDst: unaryDst, -} diff --git a/vendor/github.com/google/gops/internal/obj/zbootstrap.go b/vendor/github.com/google/gops/internal/obj/zbootstrap.go deleted file mode 100644 index 5ddb4e0d..00000000 --- a/vendor/github.com/google/gops/internal/obj/zbootstrap.go +++ /dev/null @@ -1,15 +0,0 @@ -// auto generated by go tool dist - -package obj - -import "runtime" - -const defaultGOROOT = `/Users/jbd/go` -const defaultGO386 = `sse2` -const defaultGOARM = `7` -const defaultGOOS = runtime.GOOS -const defaultGOARCH = runtime.GOARCH -const defaultGO_EXTLINK_ENABLED = `` -const version = `devel +4141054 Thu Nov 3 17:42:01 2016 +0000` -const stackGuardMultiplier = 1 -const goexperiment = `` diff --git a/vendor/github.com/google/gops/internal/objfile/disasm.go b/vendor/github.com/google/gops/internal/objfile/disasm.go deleted file mode 100644 index 8af0c8f8..00000000 --- a/vendor/github.com/google/gops/internal/objfile/disasm.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package objfile - -import ( - "bufio" - "debug/gosym" - "encoding/binary" - "fmt" - "io" - "regexp" - "sort" - "strings" - "text/tabwriter" - - "golang.org/x/arch/arm/armasm" - "golang.org/x/arch/ppc64/ppc64asm" - "golang.org/x/arch/x86/x86asm" -) - -// Disasm is a disassembler for a given File. -type Disasm struct { - syms []Sym //symbols in file, sorted by address - pcln Liner // pcln table - text []byte // bytes of text segment (actual instructions) - textStart uint64 // start PC of text - textEnd uint64 // end PC of text - goarch string // GOARCH string - disasm disasmFunc // disassembler function for goarch - byteOrder binary.ByteOrder // byte order for goarch -} - -// Disasm returns a disassembler for the file f. -func (f *File) Disasm() (*Disasm, error) { - syms, err := f.Symbols() - if err != nil { - return nil, err - } - - pcln, err := f.PCLineTable() - if err != nil { - return nil, err - } - - textStart, textBytes, err := f.Text() - if err != nil { - return nil, err - } - - goarch := f.GOARCH() - disasm := disasms[goarch] - byteOrder := byteOrders[goarch] - if disasm == nil || byteOrder == nil { - return nil, fmt.Errorf("unsupported architecture") - } - - // Filter out section symbols, overwriting syms in place. - keep := syms[:0] - for _, sym := range syms { - switch sym.Name { - case "runtime.text", "text", "_text", "runtime.etext", "etext", "_etext": - // drop - default: - keep = append(keep, sym) - } - } - syms = keep - d := &Disasm{ - syms: syms, - pcln: pcln, - text: textBytes, - textStart: textStart, - textEnd: textStart + uint64(len(textBytes)), - goarch: goarch, - disasm: disasm, - byteOrder: byteOrder, - } - - return d, nil -} - -// lookup finds the symbol name containing addr. -func (d *Disasm) lookup(addr uint64) (name string, base uint64) { - i := sort.Search(len(d.syms), func(i int) bool { return addr < d.syms[i].Addr }) - if i > 0 { - s := d.syms[i-1] - if s.Addr != 0 && s.Addr <= addr && addr < s.Addr+uint64(s.Size) { - return s.Name, s.Addr - } - } - return "", 0 -} - -// base returns the final element in the path. -// It works on both Windows and Unix paths, -// regardless of host operating system. -func base(path string) string { - path = path[strings.LastIndex(path, "/")+1:] - path = path[strings.LastIndex(path, `\`)+1:] - return path -} - -// Print prints a disassembly of the file to w. -// If filter is non-nil, the disassembly only includes functions with names matching filter. -// The disassembly only includes functions that overlap the range [start, end). -func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64) { - if start < d.textStart { - start = d.textStart - } - if end > d.textEnd { - end = d.textEnd - } - printed := false - bw := bufio.NewWriter(w) - for _, sym := range d.syms { - symStart := sym.Addr - symEnd := sym.Addr + uint64(sym.Size) - relocs := sym.Relocs - if sym.Code != 'T' && sym.Code != 't' || - symStart < d.textStart || - symEnd <= start || end <= symStart || - filter != nil && !filter.MatchString(sym.Name) { - continue - } - if printed { - fmt.Fprintf(bw, "\n") - } - printed = true - - file, _, _ := d.pcln.PCToLine(sym.Addr) - fmt.Fprintf(bw, "TEXT %s(SB) %s\n", sym.Name, file) - - tw := tabwriter.NewWriter(bw, 1, 8, 1, '\t', 0) - if symEnd > end { - symEnd = end - } - code := d.text[:end-d.textStart] - d.Decode(symStart, symEnd, relocs, func(pc, size uint64, file string, line int, text string) { - i := pc - d.textStart - fmt.Fprintf(tw, "\t%s:%d\t%#x\t", base(file), line, pc) - if size%4 != 0 || d.goarch == "386" || d.goarch == "amd64" { - // Print instruction as bytes. - fmt.Fprintf(tw, "%x", code[i:i+size]) - } else { - // Print instruction as 32-bit words. - for j := uint64(0); j < size; j += 4 { - if j > 0 { - fmt.Fprintf(tw, " ") - } - fmt.Fprintf(tw, "%08x", d.byteOrder.Uint32(code[i+j:])) - } - } - fmt.Fprintf(tw, "\t%s\n", text) - }) - tw.Flush() - } - bw.Flush() -} - -// Decode disassembles the text segment range [start, end), calling f for each instruction. -func (d *Disasm) Decode(start, end uint64, relocs []Reloc, f func(pc, size uint64, file string, line int, text string)) { - if start < d.textStart { - start = d.textStart - } - if end > d.textEnd { - end = d.textEnd - } - code := d.text[:end-d.textStart] - lookup := d.lookup - for pc := start; pc < end; { - i := pc - d.textStart - text, size := d.disasm(code[i:], pc, lookup, d.byteOrder) - file, line, _ := d.pcln.PCToLine(pc) - text += "\t" - first := true - for len(relocs) > 0 && relocs[0].Addr < i+uint64(size) { - if first { - first = false - } else { - text += " " - } - text += relocs[0].Stringer.String(pc - start) - relocs = relocs[1:] - } - f(pc, uint64(size), file, line, text) - pc += uint64(size) - } -} - -type lookupFunc func(addr uint64) (sym string, base uint64) -type disasmFunc func(code []byte, pc uint64, lookup lookupFunc, ord binary.ByteOrder) (text string, size int) - -func disasm_386(code []byte, pc uint64, lookup lookupFunc, _ binary.ByteOrder) (string, int) { - return disasm_x86(code, pc, lookup, 32) -} - -func disasm_amd64(code []byte, pc uint64, lookup lookupFunc, _ binary.ByteOrder) (string, int) { - return disasm_x86(code, pc, lookup, 64) -} - -func disasm_x86(code []byte, pc uint64, lookup lookupFunc, arch int) (string, int) { - inst, err := x86asm.Decode(code, 64) - var text string - size := inst.Len - if err != nil || size == 0 || inst.Op == 0 { - size = 1 - text = "?" - } else { - text = x86asm.GoSyntax(inst, pc, lookup) - } - return text, size -} - -type textReader struct { - code []byte - pc uint64 -} - -func (r textReader) ReadAt(data []byte, off int64) (n int, err error) { - if off < 0 || uint64(off) < r.pc { - return 0, io.EOF - } - d := uint64(off) - r.pc - if d >= uint64(len(r.code)) { - return 0, io.EOF - } - n = copy(data, r.code[d:]) - if n < len(data) { - err = io.ErrUnexpectedEOF - } - return -} - -func disasm_arm(code []byte, pc uint64, lookup lookupFunc, _ binary.ByteOrder) (string, int) { - inst, err := armasm.Decode(code, armasm.ModeARM) - var text string - size := inst.Len - if err != nil || size == 0 || inst.Op == 0 { - size = 4 - text = "?" - } else { - text = armasm.GoSyntax(inst, pc, lookup, textReader{code, pc}) - } - return text, size -} - -func disasm_ppc64(code []byte, pc uint64, lookup lookupFunc, byteOrder binary.ByteOrder) (string, int) { - inst, err := ppc64asm.Decode(code, byteOrder) - var text string - size := inst.Len - if err != nil || size == 0 || inst.Op == 0 { - size = 4 - text = "?" - } else { - text = ppc64asm.GoSyntax(inst, pc, lookup) - } - return text, size -} - -var disasms = map[string]disasmFunc{ - "386": disasm_386, - "amd64": disasm_amd64, - "arm": disasm_arm, - "ppc64": disasm_ppc64, - "ppc64le": disasm_ppc64, -} - -var byteOrders = map[string]binary.ByteOrder{ - "386": binary.LittleEndian, - "amd64": binary.LittleEndian, - "arm": binary.LittleEndian, - "ppc64": binary.BigEndian, - "ppc64le": binary.LittleEndian, - "s390x": binary.BigEndian, -} - -type Liner interface { - // Given a pc, returns the corresponding file, line, and function data. - // If unknown, returns "",0,nil. - PCToLine(uint64) (string, int, *gosym.Func) -} diff --git a/vendor/github.com/google/gops/internal/objfile/elf.go b/vendor/github.com/google/gops/internal/objfile/elf.go deleted file mode 100644 index 4ab7e6de..00000000 --- a/vendor/github.com/google/gops/internal/objfile/elf.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Parsing of ELF executables (Linux, FreeBSD, and so on). - -package objfile - -import ( - "debug/dwarf" - "debug/elf" - "encoding/binary" - "fmt" - "os" -) - -type elfFile struct { - elf *elf.File -} - -func openElf(r *os.File) (rawFile, error) { - f, err := elf.NewFile(r) - if err != nil { - return nil, err - } - return &elfFile{f}, nil -} - -func (f *elfFile) symbols() ([]Sym, error) { - elfSyms, err := f.elf.Symbols() - if err != nil { - return nil, err - } - - var syms []Sym - for _, s := range elfSyms { - sym := Sym{Addr: s.Value, Name: s.Name, Size: int64(s.Size), Code: '?'} - switch s.Section { - case elf.SHN_UNDEF: - sym.Code = 'U' - case elf.SHN_COMMON: - sym.Code = 'B' - default: - i := int(s.Section) - if i < 0 || i >= len(f.elf.Sections) { - break - } - sect := f.elf.Sections[i] - switch sect.Flags & (elf.SHF_WRITE | elf.SHF_ALLOC | elf.SHF_EXECINSTR) { - case elf.SHF_ALLOC | elf.SHF_EXECINSTR: - sym.Code = 'T' - case elf.SHF_ALLOC: - sym.Code = 'R' - case elf.SHF_ALLOC | elf.SHF_WRITE: - sym.Code = 'D' - } - } - if elf.ST_BIND(s.Info) == elf.STB_LOCAL { - sym.Code += 'a' - 'A' - } - syms = append(syms, sym) - } - - return syms, nil -} - -func (f *elfFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { - if sect := f.elf.Section(".text"); sect != nil { - textStart = sect.Addr - } - if sect := f.elf.Section(".gosymtab"); sect != nil { - if symtab, err = sect.Data(); err != nil { - return 0, nil, nil, err - } - } - if sect := f.elf.Section(".gopclntab"); sect != nil { - if pclntab, err = sect.Data(); err != nil { - return 0, nil, nil, err - } - } - return textStart, symtab, pclntab, nil -} - -func (f *elfFile) text() (textStart uint64, text []byte, err error) { - sect := f.elf.Section(".text") - if sect == nil { - return 0, nil, fmt.Errorf("text section not found") - } - textStart = sect.Addr - text, err = sect.Data() - return -} - -func (f *elfFile) goarch() string { - switch f.elf.Machine { - case elf.EM_386: - return "386" - case elf.EM_X86_64: - return "amd64" - case elf.EM_ARM: - return "arm" - case elf.EM_PPC64: - if f.elf.ByteOrder == binary.LittleEndian { - return "ppc64le" - } - return "ppc64" - case elf.EM_S390: - return "s390x" - } - return "" -} - -func (f *elfFile) loadAddress() (uint64, error) { - for _, p := range f.elf.Progs { - if p.Type == elf.PT_LOAD { - return p.Vaddr, nil - } - } - return 0, fmt.Errorf("unknown load address") -} - -func (f *elfFile) dwarf() (*dwarf.Data, error) { - return f.elf.DWARF() -} diff --git a/vendor/github.com/google/gops/internal/objfile/goobj.go b/vendor/github.com/google/gops/internal/objfile/goobj.go deleted file mode 100644 index 5a8ec53d..00000000 --- a/vendor/github.com/google/gops/internal/objfile/goobj.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Parsing of Go intermediate object files and archives. - -package objfile - -/* - - -import ( - "debug/dwarf" - "debug/gosym" - "errors" - "fmt" - "os" - - "github.com/google/gops/internal/sys" - - "github.com/google/gops/internal/goobj" -) - -type goobjFile struct { - goobj *goobj.Package - f *os.File // the underlying .o or .a file -} - -func openGoobj(r *os.File) (rawFile, error) { - f, err := goobj.Parse(r, `""`) - if err != nil { - return nil, err - } - return &goobjFile{goobj: f, f: r}, nil -} - -func goobjName(id goobj.SymID) string { - if id.Version == 0 { - return id.Name - } - return fmt.Sprintf("%s<%d>", id.Name, id.Version) -} - -func (f *goobjFile) symbols() ([]Sym, error) { - seen := make(map[goobj.SymID]bool) - - var syms []Sym - for _, s := range f.goobj.Syms { - seen[s.SymID] = true - sym := Sym{Addr: uint64(s.Data.Offset), Name: goobjName(s.SymID), Size: int64(s.Size), Type: s.Type.Name, Code: '?'} - switch s.Kind { - case goobj.STEXT, goobj.SELFRXSECT: - sym.Code = 'T' - case goobj.STYPE, goobj.SSTRING, goobj.SGOSTRING, goobj.SGOFUNC, goobj.SRODATA, goobj.SFUNCTAB, goobj.STYPELINK, goobj.SITABLINK, goobj.SSYMTAB, goobj.SPCLNTAB, goobj.SELFROSECT: - sym.Code = 'R' - case goobj.SMACHOPLT, goobj.SELFSECT, goobj.SMACHO, goobj.SMACHOGOT, goobj.SNOPTRDATA, goobj.SINITARR, goobj.SDATA, goobj.SWINDOWS: - sym.Code = 'D' - case goobj.SBSS, goobj.SNOPTRBSS, goobj.STLSBSS: - sym.Code = 'B' - case goobj.SXREF, goobj.SMACHOSYMSTR, goobj.SMACHOSYMTAB, goobj.SMACHOINDIRECTPLT, goobj.SMACHOINDIRECTGOT, goobj.SFILE, goobj.SFILEPATH, goobj.SCONST, goobj.SDYNIMPORT, goobj.SHOSTOBJ: - sym.Code = 'X' // should not see - } - if s.Version != 0 { - sym.Code += 'a' - 'A' - } - for i, r := range s.Reloc { - sym.Relocs = append(sym.Relocs, Reloc{Addr: uint64(s.Data.Offset) + uint64(r.Offset), Size: uint64(r.Size), Stringer: &s.Reloc[i]}) - } - syms = append(syms, sym) - } - - for _, s := range f.goobj.Syms { - for _, r := range s.Reloc { - if !seen[r.Sym] { - seen[r.Sym] = true - sym := Sym{Name: goobjName(r.Sym), Code: 'U'} - if s.Version != 0 { - // should not happen but handle anyway - sym.Code = 'u' - } - syms = append(syms, sym) - } - } - } - - return syms, nil -} - -func (f *goobjFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { - // Should never be called. We implement Liner below, callers - // should use that instead. - return 0, nil, nil, fmt.Errorf("pcln not available in go object file") -} - -// Find returns the file name, line, and function data for the given pc. -// Returns "",0,nil if unknown. -// This function implements the Liner interface in preference to pcln() above. -func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) { - // TODO: this is really inefficient. Binary search? Memoize last result? - var arch *sys.Arch - for _, a := range sys.Archs { - if a.Name == f.goobj.Arch { - arch = a - break - } - } - if arch == nil { - return "", 0, nil - } - for _, s := range f.goobj.Syms { - if pc < uint64(s.Data.Offset) || pc >= uint64(s.Data.Offset+s.Data.Size) { - continue - } - if s.Func == nil { - return "", 0, nil - } - pcfile := make([]byte, s.Func.PCFile.Size) - _, err := f.f.ReadAt(pcfile, s.Func.PCFile.Offset) - if err != nil { - return "", 0, nil - } - fileID := gosym.PCValue(pcfile, pc-uint64(s.Data.Offset), arch.MinLC) - fileName := s.Func.File[fileID] - pcline := make([]byte, s.Func.PCLine.Size) - _, err = f.f.ReadAt(pcline, s.Func.PCLine.Offset) - if err != nil { - return "", 0, nil - } - line := gosym.PCValue(pcline, pc-uint64(s.Data.Offset), arch.MinLC) - // Note: we provide only the name in the Func structure. - // We could provide more if needed. - return fileName, line, &gosym.Func{Sym: &gosym.Sym{Name: s.Name}} - } - return "", 0, nil -} - -// We treat the whole object file as the text section. -func (f *goobjFile) text() (textStart uint64, text []byte, err error) { - var info os.FileInfo - info, err = f.f.Stat() - if err != nil { - return - } - text = make([]byte, info.Size()) - _, err = f.f.ReadAt(text, 0) - return -} - -func (f *goobjFile) goarch() string { - return f.goobj.Arch -} - -func (f *goobjFile) loadAddress() (uint64, error) { - return 0, fmt.Errorf("unknown load address") -} - -func (f *goobjFile) dwarf() (*dwarf.Data, error) { - return nil, errors.New("no DWARF data in go object file") -} -*/ diff --git a/vendor/github.com/google/gops/internal/objfile/macho.go b/vendor/github.com/google/gops/internal/objfile/macho.go deleted file mode 100644 index 1d22a09b..00000000 --- a/vendor/github.com/google/gops/internal/objfile/macho.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Parsing of Mach-O executables (OS X). - -package objfile - -import ( - "debug/dwarf" - "debug/macho" - "fmt" - "os" - "sort" -) - -const stabTypeMask = 0xe0 - -type machoFile struct { - macho *macho.File -} - -func openMacho(r *os.File) (rawFile, error) { - f, err := macho.NewFile(r) - if err != nil { - return nil, err - } - return &machoFile{f}, nil -} - -func (f *machoFile) symbols() ([]Sym, error) { - if f.macho.Symtab == nil { - return nil, fmt.Errorf("missing symbol table") - } - - // Build sorted list of addresses of all symbols. - // We infer the size of a symbol by looking at where the next symbol begins. - var addrs []uint64 - for _, s := range f.macho.Symtab.Syms { - // Skip stab debug info. - if s.Type&stabTypeMask == 0 { - addrs = append(addrs, s.Value) - } - } - sort.Sort(uint64s(addrs)) - - var syms []Sym - for _, s := range f.macho.Symtab.Syms { - if s.Type&stabTypeMask != 0 { - // Skip stab debug info. - continue - } - sym := Sym{Name: s.Name, Addr: s.Value, Code: '?'} - i := sort.Search(len(addrs), func(x int) bool { return addrs[x] > s.Value }) - if i < len(addrs) { - sym.Size = int64(addrs[i] - s.Value) - } - if s.Sect == 0 { - sym.Code = 'U' - } else if int(s.Sect) <= len(f.macho.Sections) { - sect := f.macho.Sections[s.Sect-1] - switch sect.Seg { - case "__TEXT": - sym.Code = 'R' - case "__DATA": - sym.Code = 'D' - } - switch sect.Seg + " " + sect.Name { - case "__TEXT __text": - sym.Code = 'T' - case "__DATA __bss", "__DATA __noptrbss": - sym.Code = 'B' - } - } - syms = append(syms, sym) - } - - return syms, nil -} - -func (f *machoFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { - if sect := f.macho.Section("__text"); sect != nil { - textStart = sect.Addr - } - if sect := f.macho.Section("__gosymtab"); sect != nil { - if symtab, err = sect.Data(); err != nil { - return 0, nil, nil, err - } - } - if sect := f.macho.Section("__gopclntab"); sect != nil { - if pclntab, err = sect.Data(); err != nil { - return 0, nil, nil, err - } - } - return textStart, symtab, pclntab, nil -} - -func (f *machoFile) text() (textStart uint64, text []byte, err error) { - sect := f.macho.Section("__text") - if sect == nil { - return 0, nil, fmt.Errorf("text section not found") - } - textStart = sect.Addr - text, err = sect.Data() - return -} - -func (f *machoFile) goarch() string { - switch f.macho.Cpu { - case macho.Cpu386: - return "386" - case macho.CpuAmd64: - return "amd64" - case macho.CpuArm: - return "arm" - case macho.CpuPpc64: - return "ppc64" - } - return "" -} - -type uint64s []uint64 - -func (x uint64s) Len() int { return len(x) } -func (x uint64s) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x uint64s) Less(i, j int) bool { return x[i] < x[j] } - -func (f *machoFile) loadAddress() (uint64, error) { - return 0, fmt.Errorf("unknown load address") -} - -func (f *machoFile) dwarf() (*dwarf.Data, error) { - return f.macho.DWARF() -} diff --git a/vendor/github.com/google/gops/internal/objfile/objfile.go b/vendor/github.com/google/gops/internal/objfile/objfile.go deleted file mode 100644 index a884a20d..00000000 --- a/vendor/github.com/google/gops/internal/objfile/objfile.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package objfile implements portable access to OS-specific executable files. -package objfile - -import ( - "debug/dwarf" - "debug/gosym" - "fmt" - "os" - "sort" -) - -type rawFile interface { - symbols() (syms []Sym, err error) - pcln() (textStart uint64, symtab, pclntab []byte, err error) - text() (textStart uint64, text []byte, err error) - goarch() string - loadAddress() (uint64, error) - dwarf() (*dwarf.Data, error) -} - -// A File is an opened executable file. -type File struct { - r *os.File - raw rawFile -} - -// A Sym is a symbol defined in an executable file. -type Sym struct { - Name string // symbol name - Addr uint64 // virtual address of symbol - Size int64 // size in bytes - Code rune // nm code (T for text, D for data, and so on) - Type string // XXX? - Relocs []Reloc // in increasing Addr order -} - -type Reloc struct { - Addr uint64 // Address of first byte that reloc applies to. - Size uint64 // Number of bytes - Stringer RelocStringer -} - -type RelocStringer interface { - // insnOffset is the offset of the instruction containing the relocation - // from the start of the symbol containing the relocation. - String(insnOffset uint64) string -} - -var openers = []func(*os.File) (rawFile, error){ - openElf, - // openGoobj, // TODO(jbd): Bring it back when 1.8 is popular. - openMacho, - openPE, - openPlan9, -} - -// Open opens the named file. -// The caller must call f.Close when the file is no longer needed. -func Open(name string) (*File, error) { - r, err := os.Open(name) - if err != nil { - return nil, err - } - for _, try := range openers { - if raw, err := try(r); err == nil { - return &File{r, raw}, nil - } - } - r.Close() - return nil, fmt.Errorf("open %s: unrecognized object file", name) -} - -func (f *File) Close() error { - return f.r.Close() -} - -func (f *File) Symbols() ([]Sym, error) { - syms, err := f.raw.symbols() - if err != nil { - return nil, err - } - sort.Sort(byAddr(syms)) - return syms, nil -} - -type byAddr []Sym - -func (x byAddr) Less(i, j int) bool { return x[i].Addr < x[j].Addr } -func (x byAddr) Len() int { return len(x) } -func (x byAddr) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (f *File) PCLineTable() (Liner, error) { - // If the raw file implements Liner directly, use that. - // Currently, only Go intermediate objects and archives (goobj) use this path. - if pcln, ok := f.raw.(Liner); ok { - return pcln, nil - } - // Otherwise, read the pcln tables and build a Liner out of that. - textStart, symtab, pclntab, err := f.raw.pcln() - if err != nil { - return nil, err - } - return gosym.NewTable(symtab, gosym.NewLineTable(pclntab, textStart)) -} - -func (f *File) Text() (uint64, []byte, error) { - return f.raw.text() -} - -func (f *File) GOARCH() string { - return f.raw.goarch() -} - -// LoadAddress returns the expected load address of the file. -// This differs from the actual load address for a position-independent -// executable. -func (f *File) LoadAddress() (uint64, error) { - return f.raw.loadAddress() -} - -// DWARF returns DWARF debug data for the file, if any. -// This is for cmd/pprof to locate cgo functions. -func (f *File) DWARF() (*dwarf.Data, error) { - return f.raw.dwarf() -} diff --git a/vendor/github.com/google/gops/internal/objfile/pe.go b/vendor/github.com/google/gops/internal/objfile/pe.go deleted file mode 100644 index 46b23172..00000000 --- a/vendor/github.com/google/gops/internal/objfile/pe.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Parsing of PE executables (Microsoft Windows). - -package objfile - -import ( - "debug/dwarf" - "debug/pe" - "fmt" - "os" - "sort" -) - -type peFile struct { - pe *pe.File -} - -func openPE(r *os.File) (rawFile, error) { - f, err := pe.NewFile(r) - if err != nil { - return nil, err - } - switch f.OptionalHeader.(type) { - case *pe.OptionalHeader32, *pe.OptionalHeader64: - // ok - default: - return nil, fmt.Errorf("unrecognized PE format") - } - return &peFile{f}, nil -} - -func (f *peFile) symbols() ([]Sym, error) { - // Build sorted list of addresses of all symbols. - // We infer the size of a symbol by looking at where the next symbol begins. - var addrs []uint64 - - var imageBase uint64 - switch oh := f.pe.OptionalHeader.(type) { - case *pe.OptionalHeader32: - imageBase = uint64(oh.ImageBase) - case *pe.OptionalHeader64: - imageBase = oh.ImageBase - } - - var syms []Sym - for _, s := range f.pe.Symbols { - const ( - N_UNDEF = 0 // An undefined (extern) symbol - N_ABS = -1 // An absolute symbol (e_value is a constant, not an address) - N_DEBUG = -2 // A debugging symbol - ) - sym := Sym{Name: s.Name, Addr: uint64(s.Value), Code: '?'} - switch s.SectionNumber { - case N_UNDEF: - sym.Code = 'U' - case N_ABS: - sym.Code = 'C' - case N_DEBUG: - sym.Code = '?' - default: - if s.SectionNumber < 0 || len(f.pe.Sections) < int(s.SectionNumber) { - return nil, fmt.Errorf("invalid section number in symbol table") - } - sect := f.pe.Sections[s.SectionNumber-1] - const ( - text = 0x20 - data = 0x40 - bss = 0x80 - permW = 0x80000000 - ) - ch := sect.Characteristics - switch { - case ch&text != 0: - sym.Code = 'T' - case ch&data != 0: - if ch&permW == 0 { - sym.Code = 'R' - } else { - sym.Code = 'D' - } - case ch&bss != 0: - sym.Code = 'B' - } - sym.Addr += imageBase + uint64(sect.VirtualAddress) - } - syms = append(syms, sym) - addrs = append(addrs, sym.Addr) - } - - sort.Sort(uint64s(addrs)) - for i := range syms { - j := sort.Search(len(addrs), func(x int) bool { return addrs[x] > syms[i].Addr }) - if j < len(addrs) { - syms[i].Size = int64(addrs[j] - syms[i].Addr) - } - } - - return syms, nil -} - -func (f *peFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { - var imageBase uint64 - switch oh := f.pe.OptionalHeader.(type) { - case *pe.OptionalHeader32: - imageBase = uint64(oh.ImageBase) - case *pe.OptionalHeader64: - imageBase = oh.ImageBase - default: - return 0, nil, nil, fmt.Errorf("pe file format not recognized") - } - if sect := f.pe.Section(".text"); sect != nil { - textStart = imageBase + uint64(sect.VirtualAddress) - } - if pclntab, err = loadPETable(f.pe, "runtime.pclntab", "runtime.epclntab"); err != nil { - // We didn't find the symbols, so look for the names used in 1.3 and earlier. - // TODO: Remove code looking for the old symbols when we no longer care about 1.3. - var err2 error - if pclntab, err2 = loadPETable(f.pe, "pclntab", "epclntab"); err2 != nil { - return 0, nil, nil, err - } - } - if symtab, err = loadPETable(f.pe, "runtime.symtab", "runtime.esymtab"); err != nil { - // Same as above. - var err2 error - if symtab, err2 = loadPETable(f.pe, "symtab", "esymtab"); err2 != nil { - return 0, nil, nil, err - } - } - return textStart, symtab, pclntab, nil -} - -func (f *peFile) text() (textStart uint64, text []byte, err error) { - var imageBase uint64 - switch oh := f.pe.OptionalHeader.(type) { - case *pe.OptionalHeader32: - imageBase = uint64(oh.ImageBase) - case *pe.OptionalHeader64: - imageBase = oh.ImageBase - default: - return 0, nil, fmt.Errorf("pe file format not recognized") - } - sect := f.pe.Section(".text") - if sect == nil { - return 0, nil, fmt.Errorf("text section not found") - } - textStart = imageBase + uint64(sect.VirtualAddress) - text, err = sect.Data() - return -} - -func findPESymbol(f *pe.File, name string) (*pe.Symbol, error) { - for _, s := range f.Symbols { - if s.Name != name { - continue - } - if s.SectionNumber <= 0 { - return nil, fmt.Errorf("symbol %s: invalid section number %d", name, s.SectionNumber) - } - if len(f.Sections) < int(s.SectionNumber) { - return nil, fmt.Errorf("symbol %s: section number %d is larger than max %d", name, s.SectionNumber, len(f.Sections)) - } - return s, nil - } - return nil, fmt.Errorf("no %s symbol found", name) -} - -func loadPETable(f *pe.File, sname, ename string) ([]byte, error) { - ssym, err := findPESymbol(f, sname) - if err != nil { - return nil, err - } - esym, err := findPESymbol(f, ename) - if err != nil { - return nil, err - } - if ssym.SectionNumber != esym.SectionNumber { - return nil, fmt.Errorf("%s and %s symbols must be in the same section", sname, ename) - } - sect := f.Sections[ssym.SectionNumber-1] - data, err := sect.Data() - if err != nil { - return nil, err - } - return data[ssym.Value:esym.Value], nil -} - -func (f *peFile) goarch() string { - // Not sure how to get the info we want from PE header. - // Look in symbol table for telltale rt0 symbol. - if _, err := findPESymbol(f.pe, "_rt0_386_windows"); err == nil { - return "386" - } - if _, err := findPESymbol(f.pe, "_rt0_amd64_windows"); err == nil { - return "amd64" - } - return "" -} - -func (f *peFile) loadAddress() (uint64, error) { - return 0, fmt.Errorf("unknown load address") -} - -func (f *peFile) dwarf() (*dwarf.Data, error) { - return f.pe.DWARF() -} diff --git a/vendor/github.com/google/gops/internal/objfile/plan9obj.go b/vendor/github.com/google/gops/internal/objfile/plan9obj.go deleted file mode 100644 index 3e34f65a..00000000 --- a/vendor/github.com/google/gops/internal/objfile/plan9obj.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Parsing of Plan 9 a.out executables. - -package objfile - -import ( - "debug/dwarf" - "debug/plan9obj" - "errors" - "fmt" - "os" - "sort" -) - -var validSymType = map[rune]bool{ - 'T': true, - 't': true, - 'D': true, - 'd': true, - 'B': true, - 'b': true, -} - -type plan9File struct { - plan9 *plan9obj.File -} - -func openPlan9(r *os.File) (rawFile, error) { - f, err := plan9obj.NewFile(r) - if err != nil { - return nil, err - } - return &plan9File{f}, nil -} - -func (f *plan9File) symbols() ([]Sym, error) { - plan9Syms, err := f.plan9.Symbols() - if err != nil { - return nil, err - } - - // Build sorted list of addresses of all symbols. - // We infer the size of a symbol by looking at where the next symbol begins. - var addrs []uint64 - for _, s := range plan9Syms { - if !validSymType[s.Type] { - continue - } - addrs = append(addrs, s.Value) - } - sort.Sort(uint64s(addrs)) - - var syms []Sym - - for _, s := range plan9Syms { - if !validSymType[s.Type] { - continue - } - sym := Sym{Addr: s.Value, Name: s.Name, Code: s.Type} - i := sort.Search(len(addrs), func(x int) bool { return addrs[x] > s.Value }) - if i < len(addrs) { - sym.Size = int64(addrs[i] - s.Value) - } - syms = append(syms, sym) - } - - return syms, nil -} - -func (f *plan9File) pcln() (textStart uint64, symtab, pclntab []byte, err error) { - textStart = f.plan9.LoadAddress + f.plan9.HdrSize - if pclntab, err = loadPlan9Table(f.plan9, "runtime.pclntab", "runtime.epclntab"); err != nil { - // We didn't find the symbols, so look for the names used in 1.3 and earlier. - // TODO: Remove code looking for the old symbols when we no longer care about 1.3. - var err2 error - if pclntab, err2 = loadPlan9Table(f.plan9, "pclntab", "epclntab"); err2 != nil { - return 0, nil, nil, err - } - } - if symtab, err = loadPlan9Table(f.plan9, "runtime.symtab", "runtime.esymtab"); err != nil { - // Same as above. - var err2 error - if symtab, err2 = loadPlan9Table(f.plan9, "symtab", "esymtab"); err2 != nil { - return 0, nil, nil, err - } - } - return textStart, symtab, pclntab, nil -} - -func (f *plan9File) text() (textStart uint64, text []byte, err error) { - sect := f.plan9.Section("text") - if sect == nil { - return 0, nil, fmt.Errorf("text section not found") - } - textStart = f.plan9.LoadAddress + f.plan9.HdrSize - text, err = sect.Data() - return -} - -func findPlan9Symbol(f *plan9obj.File, name string) (*plan9obj.Sym, error) { - syms, err := f.Symbols() - if err != nil { - return nil, err - } - for _, s := range syms { - if s.Name != name { - continue - } - return &s, nil - } - return nil, fmt.Errorf("no %s symbol found", name) -} - -func loadPlan9Table(f *plan9obj.File, sname, ename string) ([]byte, error) { - ssym, err := findPlan9Symbol(f, sname) - if err != nil { - return nil, err - } - esym, err := findPlan9Symbol(f, ename) - if err != nil { - return nil, err - } - sect := f.Section("text") - if sect == nil { - return nil, err - } - data, err := sect.Data() - if err != nil { - return nil, err - } - textStart := f.LoadAddress + f.HdrSize - return data[ssym.Value-textStart : esym.Value-textStart], nil -} - -func (f *plan9File) goarch() string { - switch f.plan9.Magic { - case plan9obj.Magic386: - return "386" - case plan9obj.MagicAMD64: - return "amd64" - case plan9obj.MagicARM: - return "arm" - } - return "" -} - -func (f *plan9File) loadAddress() (uint64, error) { - return 0, fmt.Errorf("unknown load address") -} - -func (f *plan9File) dwarf() (*dwarf.Data, error) { - return nil, errors.New("no DWARF data in Plan 9 file") -} diff --git a/vendor/github.com/google/gops/internal/sys/arch.go b/vendor/github.com/google/gops/internal/sys/arch.go deleted file mode 100644 index 7033f3fb..00000000 --- a/vendor/github.com/google/gops/internal/sys/arch.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sys - -import "encoding/binary" - -// ArchFamily represents a family of one or more related architectures. -// For example, amd64 and amd64p32 are both members of the AMD64 family, -// and ppc64 and ppc64le are both members of the PPC64 family. -type ArchFamily byte - -const ( - AMD64 ArchFamily = iota - ARM - ARM64 - I386 - MIPS64 - PPC64 - S390X -) - -// Arch represents an individual architecture. -type Arch struct { - Name string - Family ArchFamily - - ByteOrder binary.ByteOrder - - IntSize int - PtrSize int - RegSize int - - // MinLC is the minimum length of an instruction code. - MinLC int -} - -// InFamily reports whether a is a member of any of the specified -// architecture families. -func (a *Arch) InFamily(xs ...ArchFamily) bool { - for _, x := range xs { - if a.Family == x { - return true - } - } - return false -} - -var Arch386 = &Arch{ - Name: "386", - Family: I386, - ByteOrder: binary.LittleEndian, - IntSize: 4, - PtrSize: 4, - RegSize: 4, - MinLC: 1, -} - -var ArchAMD64 = &Arch{ - Name: "amd64", - Family: AMD64, - ByteOrder: binary.LittleEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 1, -} - -var ArchAMD64P32 = &Arch{ - Name: "amd64p32", - Family: AMD64, - ByteOrder: binary.LittleEndian, - IntSize: 4, - PtrSize: 4, - RegSize: 8, - MinLC: 1, -} - -var ArchARM = &Arch{ - Name: "arm", - Family: ARM, - ByteOrder: binary.LittleEndian, - IntSize: 4, - PtrSize: 4, - RegSize: 4, - MinLC: 4, -} - -var ArchARM64 = &Arch{ - Name: "arm64", - Family: ARM64, - ByteOrder: binary.LittleEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 4, -} - -var ArchMIPS64 = &Arch{ - Name: "mips64", - Family: MIPS64, - ByteOrder: binary.BigEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 4, -} - -var ArchMIPS64LE = &Arch{ - Name: "mips64le", - Family: MIPS64, - ByteOrder: binary.LittleEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 4, -} - -var ArchPPC64 = &Arch{ - Name: "ppc64", - Family: PPC64, - ByteOrder: binary.BigEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 4, -} - -var ArchPPC64LE = &Arch{ - Name: "ppc64le", - Family: PPC64, - ByteOrder: binary.LittleEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 4, -} - -var ArchS390X = &Arch{ - Name: "s390x", - Family: S390X, - ByteOrder: binary.BigEndian, - IntSize: 8, - PtrSize: 8, - RegSize: 8, - MinLC: 2, -} - -var Archs = [...]*Arch{ - Arch386, - ArchAMD64, - ArchAMD64P32, - ArchARM, - ArchARM64, - ArchMIPS64, - ArchMIPS64LE, - ArchPPC64, - ArchPPC64LE, - ArchS390X, -} diff --git a/vendor/github.com/google/gops/signal/LICENSE b/vendor/github.com/google/gops/signal/LICENSE deleted file mode 100644 index 55e52a01..00000000 --- a/vendor/github.com/google/gops/signal/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2016 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/gorilla/schema/.travis.yml b/vendor/github.com/gorilla/schema/.travis.yml new file mode 100644 index 00000000..5f51dce4 --- /dev/null +++ b/vendor/github.com/gorilla/schema/.travis.yml @@ -0,0 +1,18 @@ +language: go +sudo: false + +matrix: + include: + - go: 1.5 + - go: 1.6 + - go: 1.7 + - go: 1.8 + - go: tip + allow_failures: + - go: tip + +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d .) + - go vet $(go list ./... | grep -v /vendor/) + - go test -v -race ./... diff --git a/vendor/github.com/gorilla/schema/README.md b/vendor/github.com/gorilla/schema/README.md new file mode 100644 index 00000000..2c3ecd8e --- /dev/null +++ b/vendor/github.com/gorilla/schema/README.md @@ -0,0 +1,90 @@ +schema +====== +[![GoDoc](https://godoc.org/github.com/gorilla/schema?status.svg)](https://godoc.org/github.com/gorilla/schema) [![Build Status](https://travis-ci.org/gorilla/schema.png?branch=master)](https://travis-ci.org/gorilla/schema) +[![Sourcegraph](https://sourcegraph.com/github.com/gorilla/schema/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/schema?badge) + + +Package gorilla/schema converts structs to and from form values. + +## Example + +Here's a quick example: we parse POST form values and then decode them into a struct: + +```go +// Set a Decoder instance as a package global, because it caches +// meta-data about structs, and an instance can be shared safely. +var decoder = schema.NewDecoder() + +type Person struct { + Name string + Phone string +} + +func MyHandler(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + if err != nil { + // Handle error + } + + var person Person + + // r.PostForm is a map of our POST form values + err := decoder.Decode(&person, r.PostForm) + if err != nil { + // Handle error + } + + // Do something with person.Name or person.Phone +} +``` + +Conversely, contents of a struct can be encoded into form values. Here's a variant of the previous example using the Encoder: + +```go +var encoder = schema.NewEncoder() + +func MyHttpRequest() { + person := Person{"Jane Doe", "555-5555"} + form := url.Values{} + + err := encoder.Encode(person, form) + + if err != nil { + // Handle error + } + + // Use form values, for example, with an http client + client := new(http.Client) + res, err := client.PostForm("http://my-api.test", form) +} + +``` + +To define custom names for fields, use a struct tag "schema". To not populate certain fields, use a dash for the name and it will be ignored: + +```go +type Person struct { + Name string `schema:"name"` // custom name + Phone string `schema:"phone"` // custom name + Admin bool `schema:"-"` // this field is never set +} +``` + +The supported field types in the struct are: + +* bool +* float variants (float32, float64) +* int variants (int, int8, int16, int32, int64) +* string +* uint variants (uint, uint8, uint16, uint32, uint64) +* struct +* a pointer to one of the above types +* a slice or a pointer to a slice of one of the above types + +Unsupported types are simply ignored, however custom types can be registered to be converted. + +More examples are available on the Gorilla website: http://www.gorillatoolkit.org/pkg/schema + +## License + +BSD licensed. See the LICENSE file for details. diff --git a/vendor/github.com/gorilla/websocket/.gitignore b/vendor/github.com/gorilla/websocket/.gitignore new file mode 100644 index 00000000..ac710204 --- /dev/null +++ b/vendor/github.com/gorilla/websocket/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe + +.idea/ +*.iml \ No newline at end of file diff --git a/vendor/github.com/gorilla/websocket/.travis.yml b/vendor/github.com/gorilla/websocket/.travis.yml new file mode 100644 index 00000000..3d8d29cf --- /dev/null +++ b/vendor/github.com/gorilla/websocket/.travis.yml @@ -0,0 +1,19 @@ +language: go +sudo: false + +matrix: + include: + - go: 1.4 + - go: 1.5 + - go: 1.6 + - go: 1.7 + - go: 1.8 + - go: tip + allow_failures: + - go: tip + +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d .) + - go vet $(go list ./... | grep -v /vendor/) + - go test -v -race ./... diff --git a/vendor/github.com/gorilla/websocket/AUTHORS b/vendor/github.com/gorilla/websocket/AUTHORS new file mode 100644 index 00000000..b003eca0 --- /dev/null +++ b/vendor/github.com/gorilla/websocket/AUTHORS @@ -0,0 +1,8 @@ +# This is the official list of Gorilla WebSocket authors for copyright +# purposes. +# +# Please keep the list sorted. + +Gary Burd +Joachim Bauch + diff --git a/vendor/github.com/gorilla/websocket/README.md b/vendor/github.com/gorilla/websocket/README.md new file mode 100644 index 00000000..33c3d2be --- /dev/null +++ b/vendor/github.com/gorilla/websocket/README.md @@ -0,0 +1,64 @@ +# Gorilla WebSocket + +Gorilla WebSocket is a [Go](http://golang.org/) implementation of the +[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. + +[![Build Status](https://travis-ci.org/gorilla/websocket.svg?branch=master)](https://travis-ci.org/gorilla/websocket) +[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) + +### Documentation + +* [API Reference](http://godoc.org/github.com/gorilla/websocket) +* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat) +* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command) +* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo) +* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch) + +### Status + +The Gorilla WebSocket package provides a complete and tested implementation of +the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The +package API is stable. + +### Installation + + go get github.com/gorilla/websocket + +### Protocol Compliance + +The Gorilla WebSocket package passes the server tests in the [Autobahn Test +Suite](http://autobahn.ws/testsuite) using the application in the [examples/autobahn +subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn). + +### Gorilla WebSocket compared with other packages + + + + + + + + + + + + + + + + + + +
github.com/gorillagolang.org/x/net
RFC 6455 Features
Passes Autobahn Test SuiteYesNo
Receive fragmented messageYesNo, see note 1
Send close messageYesNo
Send pings and receive pongsYesNo
Get the type of a received data messageYesYes, see note 2
Other Features
Compression ExtensionsExperimentalNo
Read message using io.ReaderYesNo, see note 3
Write message using io.WriteCloserYesNo, see note 3
+ +Notes: + +1. Large messages are fragmented in [Chrome's new WebSocket implementation](http://www.ietf.org/mail-archive/web/hybi/current/msg10503.html). +2. The application can get the type of a received data message by implementing + a [Codec marshal](http://godoc.org/golang.org/x/net/websocket#Codec.Marshal) + function. +3. The go.net io.Reader and io.Writer operate across WebSocket frame boundaries. + Read returns when the input buffer is full or a frame boundary is + encountered. Each call to Write sends a single frame message. The Gorilla + io.Reader and io.WriteCloser operate on a single WebSocket message. + diff --git a/vendor/github.com/gorilla/websocket/examples/autobahn/server.go b/vendor/github.com/gorilla/websocket/examples/autobahn/server.go deleted file mode 100644 index 3db880f9..00000000 --- a/vendor/github.com/gorilla/websocket/examples/autobahn/server.go +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Command server is a test server for the Autobahn WebSockets Test Suite. -package main - -import ( - "errors" - "flag" - "io" - "log" - "net/http" - "time" - "unicode/utf8" - - "github.com/gorilla/websocket" -) - -var upgrader = websocket.Upgrader{ - ReadBufferSize: 4096, - WriteBufferSize: 4096, - EnableCompression: true, - CheckOrigin: func(r *http.Request) bool { - return true - }, -} - -// echoCopy echoes messages from the client using io.Copy. -func echoCopy(w http.ResponseWriter, r *http.Request, writerOnly bool) { - conn, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Println("Upgrade:", err) - return - } - defer conn.Close() - for { - mt, r, err := conn.NextReader() - if err != nil { - if err != io.EOF { - log.Println("NextReader:", err) - } - return - } - if mt == websocket.TextMessage { - r = &validator{r: r} - } - w, err := conn.NextWriter(mt) - if err != nil { - log.Println("NextWriter:", err) - return - } - if mt == websocket.TextMessage { - r = &validator{r: r} - } - if writerOnly { - _, err = io.Copy(struct{ io.Writer }{w}, r) - } else { - _, err = io.Copy(w, r) - } - if err != nil { - if err == errInvalidUTF8 { - conn.WriteControl(websocket.CloseMessage, - websocket.FormatCloseMessage(websocket.CloseInvalidFramePayloadData, ""), - time.Time{}) - } - log.Println("Copy:", err) - return - } - err = w.Close() - if err != nil { - log.Println("Close:", err) - return - } - } -} - -func echoCopyWriterOnly(w http.ResponseWriter, r *http.Request) { - echoCopy(w, r, true) -} - -func echoCopyFull(w http.ResponseWriter, r *http.Request) { - echoCopy(w, r, false) -} - -// echoReadAll echoes messages from the client by reading the entire message -// with ioutil.ReadAll. -func echoReadAll(w http.ResponseWriter, r *http.Request, writeMessage, writePrepared bool) { - conn, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Println("Upgrade:", err) - return - } - defer conn.Close() - for { - mt, b, err := conn.ReadMessage() - if err != nil { - if err != io.EOF { - log.Println("NextReader:", err) - } - return - } - if mt == websocket.TextMessage { - if !utf8.Valid(b) { - conn.WriteControl(websocket.CloseMessage, - websocket.FormatCloseMessage(websocket.CloseInvalidFramePayloadData, ""), - time.Time{}) - log.Println("ReadAll: invalid utf8") - } - } - if writeMessage { - if !writePrepared { - err = conn.WriteMessage(mt, b) - if err != nil { - log.Println("WriteMessage:", err) - } - } else { - pm, err := websocket.NewPreparedMessage(mt, b) - if err != nil { - log.Println("NewPreparedMessage:", err) - return - } - err = conn.WritePreparedMessage(pm) - if err != nil { - log.Println("WritePreparedMessage:", err) - } - } - } else { - w, err := conn.NextWriter(mt) - if err != nil { - log.Println("NextWriter:", err) - return - } - if _, err := w.Write(b); err != nil { - log.Println("Writer:", err) - return - } - if err := w.Close(); err != nil { - log.Println("Close:", err) - return - } - } - } -} - -func echoReadAllWriter(w http.ResponseWriter, r *http.Request) { - echoReadAll(w, r, false, false) -} - -func echoReadAllWriteMessage(w http.ResponseWriter, r *http.Request) { - echoReadAll(w, r, true, false) -} - -func echoReadAllWritePreparedMessage(w http.ResponseWriter, r *http.Request) { - echoReadAll(w, r, true, true) -} - -func serveHome(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/" { - http.Error(w, "Not found.", 404) - return - } - if r.Method != "GET" { - http.Error(w, "Method not allowed", 405) - return - } - w.Header().Set("Content-Type", "text/html; charset=utf-8") - io.WriteString(w, "Echo Server") -} - -var addr = flag.String("addr", ":9000", "http service address") - -func main() { - flag.Parse() - http.HandleFunc("/", serveHome) - http.HandleFunc("/c", echoCopyWriterOnly) - http.HandleFunc("/f", echoCopyFull) - http.HandleFunc("/r", echoReadAllWriter) - http.HandleFunc("/m", echoReadAllWriteMessage) - http.HandleFunc("/p", echoReadAllWritePreparedMessage) - err := http.ListenAndServe(*addr, nil) - if err != nil { - log.Fatal("ListenAndServe: ", err) - } -} - -type validator struct { - state int - x rune - r io.Reader -} - -var errInvalidUTF8 = errors.New("invalid utf8") - -func (r *validator) Read(p []byte) (int, error) { - n, err := r.r.Read(p) - state := r.state - x := r.x - for _, b := range p[:n] { - state, x = decode(state, x, b) - if state == utf8Reject { - break - } - } - r.state = state - r.x = x - if state == utf8Reject || (err == io.EOF && state != utf8Accept) { - return n, errInvalidUTF8 - } - return n, err -} - -// UTF-8 decoder from http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ -// -// Copyright (c) 2008-2009 Bjoern Hoehrmann -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -var utf8d = [...]byte{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1f - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3f - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5f - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7f - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9f - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // a0..bf - 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // c0..df - 0xa, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // e0..ef - 0xb, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // f0..ff - 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2 - 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4 - 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6 - 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // s7..s8 -} - -const ( - utf8Accept = 0 - utf8Reject = 1 -) - -func decode(state int, x rune, b byte) (int, rune) { - t := utf8d[b] - if state != utf8Accept { - x = rune(b&0x3f) | (x << 6) - } else { - x = rune((0xff >> t) & b) - } - state = int(utf8d[256+state*16+int(t)]) - return state, x -} diff --git a/vendor/github.com/gorilla/websocket/examples/chat/client.go b/vendor/github.com/gorilla/websocket/examples/chat/client.go deleted file mode 100644 index 26468477..00000000 --- a/vendor/github.com/gorilla/websocket/examples/chat/client.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "bytes" - "log" - "net/http" - "time" - - "github.com/gorilla/websocket" -) - -const ( - // Time allowed to write a message to the peer. - writeWait = 10 * time.Second - - // Time allowed to read the next pong message from the peer. - pongWait = 60 * time.Second - - // Send pings to peer with this period. Must be less than pongWait. - pingPeriod = (pongWait * 9) / 10 - - // Maximum message size allowed from peer. - maxMessageSize = 512 -) - -var ( - newline = []byte{'\n'} - space = []byte{' '} -) - -var upgrader = websocket.Upgrader{ - ReadBufferSize: 1024, - WriteBufferSize: 1024, -} - -// Client is a middleman between the websocket connection and the hub. -type Client struct { - hub *Hub - - // The websocket connection. - conn *websocket.Conn - - // Buffered channel of outbound messages. - send chan []byte -} - -// readPump pumps messages from the websocket connection to the hub. -// -// The application runs readPump in a per-connection goroutine. The application -// ensures that there is at most one reader on a connection by executing all -// reads from this goroutine. -func (c *Client) readPump() { - defer func() { - c.hub.unregister <- c - c.conn.Close() - }() - c.conn.SetReadLimit(maxMessageSize) - c.conn.SetReadDeadline(time.Now().Add(pongWait)) - c.conn.SetPongHandler(func(string) error { c.conn.SetReadDeadline(time.Now().Add(pongWait)); return nil }) - for { - _, message, err := c.conn.ReadMessage() - if err != nil { - if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) { - log.Printf("error: %v", err) - } - break - } - message = bytes.TrimSpace(bytes.Replace(message, newline, space, -1)) - c.hub.broadcast <- message - } -} - -// writePump pumps messages from the hub to the websocket connection. -// -// A goroutine running writePump is started for each connection. The -// application ensures that there is at most one writer to a connection by -// executing all writes from this goroutine. -func (c *Client) writePump() { - ticker := time.NewTicker(pingPeriod) - defer func() { - ticker.Stop() - c.conn.Close() - }() - for { - select { - case message, ok := <-c.send: - c.conn.SetWriteDeadline(time.Now().Add(writeWait)) - if !ok { - // The hub closed the channel. - c.conn.WriteMessage(websocket.CloseMessage, []byte{}) - return - } - - w, err := c.conn.NextWriter(websocket.TextMessage) - if err != nil { - return - } - w.Write(message) - - // Add queued chat messages to the current websocket message. - n := len(c.send) - for i := 0; i < n; i++ { - w.Write(newline) - w.Write(<-c.send) - } - - if err := w.Close(); err != nil { - return - } - case <-ticker.C: - c.conn.SetWriteDeadline(time.Now().Add(writeWait)) - if err := c.conn.WriteMessage(websocket.PingMessage, []byte{}); err != nil { - return - } - } - } -} - -// serveWs handles websocket requests from the peer. -func serveWs(hub *Hub, w http.ResponseWriter, r *http.Request) { - conn, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Println(err) - return - } - client := &Client{hub: hub, conn: conn, send: make(chan []byte, 256)} - client.hub.register <- client - go client.writePump() - client.readPump() -} diff --git a/vendor/github.com/gorilla/websocket/examples/chat/hub.go b/vendor/github.com/gorilla/websocket/examples/chat/hub.go deleted file mode 100644 index 7f07ea07..00000000 --- a/vendor/github.com/gorilla/websocket/examples/chat/hub.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -// hub maintains the set of active clients and broadcasts messages to the -// clients. -type Hub struct { - // Registered clients. - clients map[*Client]bool - - // Inbound messages from the clients. - broadcast chan []byte - - // Register requests from the clients. - register chan *Client - - // Unregister requests from clients. - unregister chan *Client -} - -func newHub() *Hub { - return &Hub{ - broadcast: make(chan []byte), - register: make(chan *Client), - unregister: make(chan *Client), - clients: make(map[*Client]bool), - } -} - -func (h *Hub) run() { - for { - select { - case client := <-h.register: - h.clients[client] = true - case client := <-h.unregister: - if _, ok := h.clients[client]; ok { - delete(h.clients, client) - close(client.send) - } - case message := <-h.broadcast: - for client := range h.clients { - select { - case client.send <- message: - default: - close(client.send) - delete(h.clients, client) - } - } - } - } -} diff --git a/vendor/github.com/gorilla/websocket/examples/chat/main.go b/vendor/github.com/gorilla/websocket/examples/chat/main.go deleted file mode 100644 index 74615d59..00000000 --- a/vendor/github.com/gorilla/websocket/examples/chat/main.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "flag" - "log" - "net/http" -) - -var addr = flag.String("addr", ":8080", "http service address") - -func serveHome(w http.ResponseWriter, r *http.Request) { - log.Println(r.URL) - if r.URL.Path != "/" { - http.Error(w, "Not found", 404) - return - } - if r.Method != "GET" { - http.Error(w, "Method not allowed", 405) - return - } - http.ServeFile(w, r, "home.html") -} - -func main() { - flag.Parse() - hub := newHub() - go hub.run() - http.HandleFunc("/", serveHome) - http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) { - serveWs(hub, w, r) - }) - err := http.ListenAndServe(*addr, nil) - if err != nil { - log.Fatal("ListenAndServe: ", err) - } -} diff --git a/vendor/github.com/gorilla/websocket/examples/command/main.go b/vendor/github.com/gorilla/websocket/examples/command/main.go deleted file mode 100644 index 239c5c85..00000000 --- a/vendor/github.com/gorilla/websocket/examples/command/main.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "bufio" - "flag" - "io" - "log" - "net/http" - "os" - "os/exec" - "time" - - "github.com/gorilla/websocket" -) - -var ( - addr = flag.String("addr", "127.0.0.1:8080", "http service address") - cmdPath string -) - -const ( - // Time allowed to write a message to the peer. - writeWait = 10 * time.Second - - // Maximum message size allowed from peer. - maxMessageSize = 8192 - - // Time allowed to read the next pong message from the peer. - pongWait = 60 * time.Second - - // Send pings to peer with this period. Must be less than pongWait. - pingPeriod = (pongWait * 9) / 10 - - // Time to wait before force close on connection. - closeGracePeriod = 10 * time.Second -) - -func pumpStdin(ws *websocket.Conn, w io.Writer) { - defer ws.Close() - ws.SetReadLimit(maxMessageSize) - ws.SetReadDeadline(time.Now().Add(pongWait)) - ws.SetPongHandler(func(string) error { ws.SetReadDeadline(time.Now().Add(pongWait)); return nil }) - for { - _, message, err := ws.ReadMessage() - if err != nil { - break - } - message = append(message, '\n') - if _, err := w.Write(message); err != nil { - break - } - } -} - -func pumpStdout(ws *websocket.Conn, r io.Reader, done chan struct{}) { - defer func() { - }() - s := bufio.NewScanner(r) - for s.Scan() { - ws.SetWriteDeadline(time.Now().Add(writeWait)) - if err := ws.WriteMessage(websocket.TextMessage, s.Bytes()); err != nil { - ws.Close() - break - } - } - if s.Err() != nil { - log.Println("scan:", s.Err()) - } - close(done) - - ws.SetWriteDeadline(time.Now().Add(writeWait)) - ws.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) - time.Sleep(closeGracePeriod) - ws.Close() -} - -func ping(ws *websocket.Conn, done chan struct{}) { - ticker := time.NewTicker(pingPeriod) - defer ticker.Stop() - for { - select { - case <-ticker.C: - if err := ws.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(writeWait)); err != nil { - log.Println("ping:", err) - } - case <-done: - return - } - } -} - -func internalError(ws *websocket.Conn, msg string, err error) { - log.Println(msg, err) - ws.WriteMessage(websocket.TextMessage, []byte("Internal server error.")) -} - -var upgrader = websocket.Upgrader{} - -func serveWs(w http.ResponseWriter, r *http.Request) { - ws, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Println("upgrade:", err) - return - } - - defer ws.Close() - - outr, outw, err := os.Pipe() - if err != nil { - internalError(ws, "stdout:", err) - return - } - defer outr.Close() - defer outw.Close() - - inr, inw, err := os.Pipe() - if err != nil { - internalError(ws, "stdin:", err) - return - } - defer inr.Close() - defer inw.Close() - - proc, err := os.StartProcess(cmdPath, flag.Args(), &os.ProcAttr{ - Files: []*os.File{inr, outw, outw}, - }) - if err != nil { - internalError(ws, "start:", err) - return - } - - inr.Close() - outw.Close() - - stdoutDone := make(chan struct{}) - go pumpStdout(ws, outr, stdoutDone) - go ping(ws, stdoutDone) - - pumpStdin(ws, inw) - - // Some commands will exit when stdin is closed. - inw.Close() - - // Other commands need a bonk on the head. - if err := proc.Signal(os.Interrupt); err != nil { - log.Println("inter:", err) - } - - select { - case <-stdoutDone: - case <-time.After(time.Second): - // A bigger bonk on the head. - if err := proc.Signal(os.Kill); err != nil { - log.Println("term:", err) - } - <-stdoutDone - } - - if _, err := proc.Wait(); err != nil { - log.Println("wait:", err) - } -} - -func serveHome(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/" { - http.Error(w, "Not found", 404) - return - } - if r.Method != "GET" { - http.Error(w, "Method not allowed", 405) - return - } - http.ServeFile(w, r, "home.html") -} - -func main() { - flag.Parse() - if len(flag.Args()) < 1 { - log.Fatal("must specify at least one argument") - } - var err error - cmdPath, err = exec.LookPath(flag.Args()[0]) - if err != nil { - log.Fatal(err) - } - http.HandleFunc("/", serveHome) - http.HandleFunc("/ws", serveWs) - log.Fatal(http.ListenAndServe(*addr, nil)) -} diff --git a/vendor/github.com/gorilla/websocket/examples/echo/client.go b/vendor/github.com/gorilla/websocket/examples/echo/client.go deleted file mode 100644 index 6578094e..00000000 --- a/vendor/github.com/gorilla/websocket/examples/echo/client.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "flag" - "log" - "net/url" - "os" - "os/signal" - "time" - - "github.com/gorilla/websocket" -) - -var addr = flag.String("addr", "localhost:8080", "http service address") - -func main() { - flag.Parse() - log.SetFlags(0) - - interrupt := make(chan os.Signal, 1) - signal.Notify(interrupt, os.Interrupt) - - u := url.URL{Scheme: "ws", Host: *addr, Path: "/echo"} - log.Printf("connecting to %s", u.String()) - - c, _, err := websocket.DefaultDialer.Dial(u.String(), nil) - if err != nil { - log.Fatal("dial:", err) - } - defer c.Close() - - done := make(chan struct{}) - - go func() { - defer c.Close() - defer close(done) - for { - _, message, err := c.ReadMessage() - if err != nil { - log.Println("read:", err) - return - } - log.Printf("recv: %s", message) - } - }() - - ticker := time.NewTicker(time.Second) - defer ticker.Stop() - - for { - select { - case t := <-ticker.C: - err := c.WriteMessage(websocket.TextMessage, []byte(t.String())) - if err != nil { - log.Println("write:", err) - return - } - case <-interrupt: - log.Println("interrupt") - // To cleanly close a connection, a client should send a close - // frame and wait for the server to close the connection. - err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) - if err != nil { - log.Println("write close:", err) - return - } - select { - case <-done: - case <-time.After(time.Second): - } - c.Close() - return - } - } -} diff --git a/vendor/github.com/gorilla/websocket/examples/echo/server.go b/vendor/github.com/gorilla/websocket/examples/echo/server.go deleted file mode 100644 index a685b097..00000000 --- a/vendor/github.com/gorilla/websocket/examples/echo/server.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -package main - -import ( - "flag" - "html/template" - "log" - "net/http" - - "github.com/gorilla/websocket" -) - -var addr = flag.String("addr", "localhost:8080", "http service address") - -var upgrader = websocket.Upgrader{} // use default options - -func echo(w http.ResponseWriter, r *http.Request) { - c, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Print("upgrade:", err) - return - } - defer c.Close() - for { - mt, message, err := c.ReadMessage() - if err != nil { - log.Println("read:", err) - break - } - log.Printf("recv: %s", message) - err = c.WriteMessage(mt, message) - if err != nil { - log.Println("write:", err) - break - } - } -} - -func home(w http.ResponseWriter, r *http.Request) { - homeTemplate.Execute(w, "ws://"+r.Host+"/echo") -} - -func main() { - flag.Parse() - log.SetFlags(0) - http.HandleFunc("/echo", echo) - http.HandleFunc("/", home) - log.Fatal(http.ListenAndServe(*addr, nil)) -} - -var homeTemplate = template.Must(template.New("").Parse(` - - - - - - - -
-

Click "Open" to create a connection to the server, -"Send" to send a message to the server and "Close" to close the connection. -You can change the message and send multiple times. -

-

- - -

- -

-
-
-
- - -`)) diff --git a/vendor/github.com/gorilla/websocket/examples/filewatch/main.go b/vendor/github.com/gorilla/websocket/examples/filewatch/main.go deleted file mode 100644 index f5f9da5c..00000000 --- a/vendor/github.com/gorilla/websocket/examples/filewatch/main.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "flag" - "html/template" - "io/ioutil" - "log" - "net/http" - "os" - "strconv" - "time" - - "github.com/gorilla/websocket" -) - -const ( - // Time allowed to write the file to the client. - writeWait = 10 * time.Second - - // Time allowed to read the next pong message from the client. - pongWait = 60 * time.Second - - // Send pings to client with this period. Must be less than pongWait. - pingPeriod = (pongWait * 9) / 10 - - // Poll file for changes with this period. - filePeriod = 10 * time.Second -) - -var ( - addr = flag.String("addr", ":8080", "http service address") - homeTempl = template.Must(template.New("").Parse(homeHTML)) - filename string - upgrader = websocket.Upgrader{ - ReadBufferSize: 1024, - WriteBufferSize: 1024, - } -) - -func readFileIfModified(lastMod time.Time) ([]byte, time.Time, error) { - fi, err := os.Stat(filename) - if err != nil { - return nil, lastMod, err - } - if !fi.ModTime().After(lastMod) { - return nil, lastMod, nil - } - p, err := ioutil.ReadFile(filename) - if err != nil { - return nil, fi.ModTime(), err - } - return p, fi.ModTime(), nil -} - -func reader(ws *websocket.Conn) { - defer ws.Close() - ws.SetReadLimit(512) - ws.SetReadDeadline(time.Now().Add(pongWait)) - ws.SetPongHandler(func(string) error { ws.SetReadDeadline(time.Now().Add(pongWait)); return nil }) - for { - _, _, err := ws.ReadMessage() - if err != nil { - break - } - } -} - -func writer(ws *websocket.Conn, lastMod time.Time) { - lastError := "" - pingTicker := time.NewTicker(pingPeriod) - fileTicker := time.NewTicker(filePeriod) - defer func() { - pingTicker.Stop() - fileTicker.Stop() - ws.Close() - }() - for { - select { - case <-fileTicker.C: - var p []byte - var err error - - p, lastMod, err = readFileIfModified(lastMod) - - if err != nil { - if s := err.Error(); s != lastError { - lastError = s - p = []byte(lastError) - } - } else { - lastError = "" - } - - if p != nil { - ws.SetWriteDeadline(time.Now().Add(writeWait)) - if err := ws.WriteMessage(websocket.TextMessage, p); err != nil { - return - } - } - case <-pingTicker.C: - ws.SetWriteDeadline(time.Now().Add(writeWait)) - if err := ws.WriteMessage(websocket.PingMessage, []byte{}); err != nil { - return - } - } - } -} - -func serveWs(w http.ResponseWriter, r *http.Request) { - ws, err := upgrader.Upgrade(w, r, nil) - if err != nil { - if _, ok := err.(websocket.HandshakeError); !ok { - log.Println(err) - } - return - } - - var lastMod time.Time - if n, err := strconv.ParseInt(r.FormValue("lastMod"), 16, 64); err == nil { - lastMod = time.Unix(0, n) - } - - go writer(ws, lastMod) - reader(ws) -} - -func serveHome(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/" { - http.Error(w, "Not found", 404) - return - } - if r.Method != "GET" { - http.Error(w, "Method not allowed", 405) - return - } - w.Header().Set("Content-Type", "text/html; charset=utf-8") - p, lastMod, err := readFileIfModified(time.Time{}) - if err != nil { - p = []byte(err.Error()) - lastMod = time.Unix(0, 0) - } - var v = struct { - Host string - Data string - LastMod string - }{ - r.Host, - string(p), - strconv.FormatInt(lastMod.UnixNano(), 16), - } - homeTempl.Execute(w, &v) -} - -func main() { - flag.Parse() - if flag.NArg() != 1 { - log.Fatal("filename not specified") - } - filename = flag.Args()[0] - http.HandleFunc("/", serveHome) - http.HandleFunc("/ws", serveWs) - if err := http.ListenAndServe(*addr, nil); err != nil { - log.Fatal(err) - } -} - -const homeHTML = ` - - - WebSocket Example - - -
{{.Data}}
- - - -` diff --git a/vendor/github.com/gorilla/websocket/proxy.go b/vendor/github.com/gorilla/websocket/proxy.go deleted file mode 100644 index 102538bd..00000000 --- a/vendor/github.com/gorilla/websocket/proxy.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "encoding/base64" - "errors" - "net" - "net/http" - "net/url" - "strings" -) - -type netDialerFunc func(netowrk, addr string) (net.Conn, error) - -func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) { - return fn(network, addr) -} - -func init() { - proxy_RegisterDialerType("http", func(proxyURL *url.URL, forwardDialer proxy_Dialer) (proxy_Dialer, error) { - return &httpProxyDialer{proxyURL: proxyURL, fowardDial: forwardDialer.Dial}, nil - }) -} - -type httpProxyDialer struct { - proxyURL *url.URL - fowardDial func(network, addr string) (net.Conn, error) -} - -func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) { - hostPort, _ := hostPortNoPort(hpd.proxyURL) - conn, err := hpd.fowardDial(network, hostPort) - if err != nil { - return nil, err - } - - connectHeader := make(http.Header) - if user := hpd.proxyURL.User; user != nil { - proxyUser := user.Username() - if proxyPassword, passwordSet := user.Password(); passwordSet { - credential := base64.StdEncoding.EncodeToString([]byte(proxyUser + ":" + proxyPassword)) - connectHeader.Set("Proxy-Authorization", "Basic "+credential) - } - } - - connectReq := &http.Request{ - Method: "CONNECT", - URL: &url.URL{Opaque: addr}, - Host: addr, - Header: connectHeader, - } - - if err := connectReq.Write(conn); err != nil { - conn.Close() - return nil, err - } - - // Read response. It's OK to use and discard buffered reader here becaue - // the remote server does not speak until spoken to. - br := bufio.NewReader(conn) - resp, err := http.ReadResponse(br, connectReq) - if err != nil { - conn.Close() - return nil, err - } - - if resp.StatusCode != 200 { - conn.Close() - f := strings.SplitN(resp.Status, " ", 2) - return nil, errors.New(f[1]) - } - return conn, nil -} diff --git a/vendor/github.com/gorilla/websocket/x_net_proxy.go b/vendor/github.com/gorilla/websocket/x_net_proxy.go deleted file mode 100644 index 2e668f6b..00000000 --- a/vendor/github.com/gorilla/websocket/x_net_proxy.go +++ /dev/null @@ -1,473 +0,0 @@ -// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT. -//go:generate bundle -o x_net_proxy.go golang.org/x/net/proxy - -// Package proxy provides support for a variety of protocols to proxy network -// data. -// - -package websocket - -import ( - "errors" - "io" - "net" - "net/url" - "os" - "strconv" - "strings" - "sync" -) - -type proxy_direct struct{} - -// Direct is a direct proxy: one that makes network connections directly. -var proxy_Direct = proxy_direct{} - -func (proxy_direct) Dial(network, addr string) (net.Conn, error) { - return net.Dial(network, addr) -} - -// A PerHost directs connections to a default Dialer unless the host name -// requested matches one of a number of exceptions. -type proxy_PerHost struct { - def, bypass proxy_Dialer - - bypassNetworks []*net.IPNet - bypassIPs []net.IP - bypassZones []string - bypassHosts []string -} - -// NewPerHost returns a PerHost Dialer that directs connections to either -// defaultDialer or bypass, depending on whether the connection matches one of -// the configured rules. -func proxy_NewPerHost(defaultDialer, bypass proxy_Dialer) *proxy_PerHost { - return &proxy_PerHost{ - def: defaultDialer, - bypass: bypass, - } -} - -// Dial connects to the address addr on the given network through either -// defaultDialer or bypass. -func (p *proxy_PerHost) Dial(network, addr string) (c net.Conn, err error) { - host, _, err := net.SplitHostPort(addr) - if err != nil { - return nil, err - } - - return p.dialerForRequest(host).Dial(network, addr) -} - -func (p *proxy_PerHost) dialerForRequest(host string) proxy_Dialer { - if ip := net.ParseIP(host); ip != nil { - for _, net := range p.bypassNetworks { - if net.Contains(ip) { - return p.bypass - } - } - for _, bypassIP := range p.bypassIPs { - if bypassIP.Equal(ip) { - return p.bypass - } - } - return p.def - } - - for _, zone := range p.bypassZones { - if strings.HasSuffix(host, zone) { - return p.bypass - } - if host == zone[1:] { - // For a zone ".example.com", we match "example.com" - // too. - return p.bypass - } - } - for _, bypassHost := range p.bypassHosts { - if bypassHost == host { - return p.bypass - } - } - return p.def -} - -// AddFromString parses a string that contains comma-separated values -// specifying hosts that should use the bypass proxy. Each value is either an -// IP address, a CIDR range, a zone (*.example.com) or a host name -// (localhost). A best effort is made to parse the string and errors are -// ignored. -func (p *proxy_PerHost) AddFromString(s string) { - hosts := strings.Split(s, ",") - for _, host := range hosts { - host = strings.TrimSpace(host) - if len(host) == 0 { - continue - } - if strings.Contains(host, "/") { - // We assume that it's a CIDR address like 127.0.0.0/8 - if _, net, err := net.ParseCIDR(host); err == nil { - p.AddNetwork(net) - } - continue - } - if ip := net.ParseIP(host); ip != nil { - p.AddIP(ip) - continue - } - if strings.HasPrefix(host, "*.") { - p.AddZone(host[1:]) - continue - } - p.AddHost(host) - } -} - -// AddIP specifies an IP address that will use the bypass proxy. Note that -// this will only take effect if a literal IP address is dialed. A connection -// to a named host will never match an IP. -func (p *proxy_PerHost) AddIP(ip net.IP) { - p.bypassIPs = append(p.bypassIPs, ip) -} - -// AddNetwork specifies an IP range that will use the bypass proxy. Note that -// this will only take effect if a literal IP address is dialed. A connection -// to a named host will never match. -func (p *proxy_PerHost) AddNetwork(net *net.IPNet) { - p.bypassNetworks = append(p.bypassNetworks, net) -} - -// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of -// "example.com" matches "example.com" and all of its subdomains. -func (p *proxy_PerHost) AddZone(zone string) { - if strings.HasSuffix(zone, ".") { - zone = zone[:len(zone)-1] - } - if !strings.HasPrefix(zone, ".") { - zone = "." + zone - } - p.bypassZones = append(p.bypassZones, zone) -} - -// AddHost specifies a host name that will use the bypass proxy. -func (p *proxy_PerHost) AddHost(host string) { - if strings.HasSuffix(host, ".") { - host = host[:len(host)-1] - } - p.bypassHosts = append(p.bypassHosts, host) -} - -// A Dialer is a means to establish a connection. -type proxy_Dialer interface { - // Dial connects to the given address via the proxy. - Dial(network, addr string) (c net.Conn, err error) -} - -// Auth contains authentication parameters that specific Dialers may require. -type proxy_Auth struct { - User, Password string -} - -// FromEnvironment returns the dialer specified by the proxy related variables in -// the environment. -func proxy_FromEnvironment() proxy_Dialer { - allProxy := proxy_allProxyEnv.Get() - if len(allProxy) == 0 { - return proxy_Direct - } - - proxyURL, err := url.Parse(allProxy) - if err != nil { - return proxy_Direct - } - proxy, err := proxy_FromURL(proxyURL, proxy_Direct) - if err != nil { - return proxy_Direct - } - - noProxy := proxy_noProxyEnv.Get() - if len(noProxy) == 0 { - return proxy - } - - perHost := proxy_NewPerHost(proxy, proxy_Direct) - perHost.AddFromString(noProxy) - return perHost -} - -// proxySchemes is a map from URL schemes to a function that creates a Dialer -// from a URL with such a scheme. -var proxy_proxySchemes map[string]func(*url.URL, proxy_Dialer) (proxy_Dialer, error) - -// RegisterDialerType takes a URL scheme and a function to generate Dialers from -// a URL with that scheme and a forwarding Dialer. Registered schemes are used -// by FromURL. -func proxy_RegisterDialerType(scheme string, f func(*url.URL, proxy_Dialer) (proxy_Dialer, error)) { - if proxy_proxySchemes == nil { - proxy_proxySchemes = make(map[string]func(*url.URL, proxy_Dialer) (proxy_Dialer, error)) - } - proxy_proxySchemes[scheme] = f -} - -// FromURL returns a Dialer given a URL specification and an underlying -// Dialer for it to make network requests. -func proxy_FromURL(u *url.URL, forward proxy_Dialer) (proxy_Dialer, error) { - var auth *proxy_Auth - if u.User != nil { - auth = new(proxy_Auth) - auth.User = u.User.Username() - if p, ok := u.User.Password(); ok { - auth.Password = p - } - } - - switch u.Scheme { - case "socks5": - return proxy_SOCKS5("tcp", u.Host, auth, forward) - } - - // If the scheme doesn't match any of the built-in schemes, see if it - // was registered by another package. - if proxy_proxySchemes != nil { - if f, ok := proxy_proxySchemes[u.Scheme]; ok { - return f(u, forward) - } - } - - return nil, errors.New("proxy: unknown scheme: " + u.Scheme) -} - -var ( - proxy_allProxyEnv = &proxy_envOnce{ - names: []string{"ALL_PROXY", "all_proxy"}, - } - proxy_noProxyEnv = &proxy_envOnce{ - names: []string{"NO_PROXY", "no_proxy"}, - } -) - -// envOnce looks up an environment variable (optionally by multiple -// names) once. It mitigates expensive lookups on some platforms -// (e.g. Windows). -// (Borrowed from net/http/transport.go) -type proxy_envOnce struct { - names []string - once sync.Once - val string -} - -func (e *proxy_envOnce) Get() string { - e.once.Do(e.init) - return e.val -} - -func (e *proxy_envOnce) init() { - for _, n := range e.names { - e.val = os.Getenv(n) - if e.val != "" { - return - } - } -} - -// SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address -// with an optional username and password. See RFC 1928 and RFC 1929. -func proxy_SOCKS5(network, addr string, auth *proxy_Auth, forward proxy_Dialer) (proxy_Dialer, error) { - s := &proxy_socks5{ - network: network, - addr: addr, - forward: forward, - } - if auth != nil { - s.user = auth.User - s.password = auth.Password - } - - return s, nil -} - -type proxy_socks5 struct { - user, password string - network, addr string - forward proxy_Dialer -} - -const proxy_socks5Version = 5 - -const ( - proxy_socks5AuthNone = 0 - proxy_socks5AuthPassword = 2 -) - -const proxy_socks5Connect = 1 - -const ( - proxy_socks5IP4 = 1 - proxy_socks5Domain = 3 - proxy_socks5IP6 = 4 -) - -var proxy_socks5Errors = []string{ - "", - "general failure", - "connection forbidden", - "network unreachable", - "host unreachable", - "connection refused", - "TTL expired", - "command not supported", - "address type not supported", -} - -// Dial connects to the address addr on the given network via the SOCKS5 proxy. -func (s *proxy_socks5) Dial(network, addr string) (net.Conn, error) { - switch network { - case "tcp", "tcp6", "tcp4": - default: - return nil, errors.New("proxy: no support for SOCKS5 proxy connections of type " + network) - } - - conn, err := s.forward.Dial(s.network, s.addr) - if err != nil { - return nil, err - } - if err := s.connect(conn, addr); err != nil { - conn.Close() - return nil, err - } - return conn, nil -} - -// connect takes an existing connection to a socks5 proxy server, -// and commands the server to extend that connection to target, -// which must be a canonical address with a host and port. -func (s *proxy_socks5) connect(conn net.Conn, target string) error { - host, portStr, err := net.SplitHostPort(target) - if err != nil { - return err - } - - port, err := strconv.Atoi(portStr) - if err != nil { - return errors.New("proxy: failed to parse port number: " + portStr) - } - if port < 1 || port > 0xffff { - return errors.New("proxy: port number out of range: " + portStr) - } - - // the size here is just an estimate - buf := make([]byte, 0, 6+len(host)) - - buf = append(buf, proxy_socks5Version) - if len(s.user) > 0 && len(s.user) < 256 && len(s.password) < 256 { - buf = append(buf, 2 /* num auth methods */, proxy_socks5AuthNone, proxy_socks5AuthPassword) - } else { - buf = append(buf, 1 /* num auth methods */, proxy_socks5AuthNone) - } - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write greeting to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read greeting from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - if buf[0] != 5 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " has unexpected version " + strconv.Itoa(int(buf[0]))) - } - if buf[1] == 0xff { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " requires authentication") - } - - // See RFC 1929 - if buf[1] == proxy_socks5AuthPassword { - buf = buf[:0] - buf = append(buf, 1 /* password protocol version */) - buf = append(buf, uint8(len(s.user))) - buf = append(buf, s.user...) - buf = append(buf, uint8(len(s.password))) - buf = append(buf, s.password...) - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write authentication request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read authentication reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if buf[1] != 0 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " rejected username/password") - } - } - - buf = buf[:0] - buf = append(buf, proxy_socks5Version, proxy_socks5Connect, 0 /* reserved */) - - if ip := net.ParseIP(host); ip != nil { - if ip4 := ip.To4(); ip4 != nil { - buf = append(buf, proxy_socks5IP4) - ip = ip4 - } else { - buf = append(buf, proxy_socks5IP6) - } - buf = append(buf, ip...) - } else { - if len(host) > 255 { - return errors.New("proxy: destination host name too long: " + host) - } - buf = append(buf, proxy_socks5Domain) - buf = append(buf, byte(len(host))) - buf = append(buf, host...) - } - buf = append(buf, byte(port>>8), byte(port)) - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write connect request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:4]); err != nil { - return errors.New("proxy: failed to read connect reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - failure := "unknown error" - if int(buf[1]) < len(proxy_socks5Errors) { - failure = proxy_socks5Errors[buf[1]] - } - - if len(failure) > 0 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " failed to connect: " + failure) - } - - bytesToDiscard := 0 - switch buf[3] { - case proxy_socks5IP4: - bytesToDiscard = net.IPv4len - case proxy_socks5IP6: - bytesToDiscard = net.IPv6len - case proxy_socks5Domain: - _, err := io.ReadFull(conn, buf[:1]) - if err != nil { - return errors.New("proxy: failed to read domain length from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - bytesToDiscard = int(buf[0]) - default: - return errors.New("proxy: got unknown address type " + strconv.Itoa(int(buf[3])) + " from SOCKS5 proxy at " + s.addr) - } - - if cap(buf) < bytesToDiscard { - buf = make([]byte, bytesToDiscard) - } else { - buf = buf[:bytesToDiscard] - } - if _, err := io.ReadFull(conn, buf); err != nil { - return errors.New("proxy: failed to read address from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - // Also need to discard the port number - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read port from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/golang-lru/.gitignore b/vendor/github.com/hashicorp/golang-lru/.gitignore new file mode 100644 index 00000000..83656241 --- /dev/null +++ b/vendor/github.com/hashicorp/golang-lru/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/vendor/github.com/hashicorp/golang-lru/README.md b/vendor/github.com/hashicorp/golang-lru/README.md new file mode 100644 index 00000000..33e58cfa --- /dev/null +++ b/vendor/github.com/hashicorp/golang-lru/README.md @@ -0,0 +1,25 @@ +golang-lru +========== + +This provides the `lru` package which implements a fixed-size +thread safe LRU cache. It is based on the cache in Groupcache. + +Documentation +============= + +Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru) + +Example +======= + +Using the LRU is very simple: + +```go +l, _ := New(128) +for i := 0; i < 256; i++ { + l.Add(i, nil) +} +if l.Len() != 128 { + panic(fmt.Sprintf("bad len: %v", l.Len())) +} +``` diff --git a/vendor/github.com/hashicorp/hcl/.gitignore b/vendor/github.com/hashicorp/hcl/.gitignore new file mode 100644 index 00000000..15586a2b --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/.gitignore @@ -0,0 +1,9 @@ +y.output + +# ignore intellij files +.idea +*.iml +*.ipr +*.iws + +*.test diff --git a/vendor/github.com/hashicorp/hcl/.travis.yml b/vendor/github.com/hashicorp/hcl/.travis.yml new file mode 100644 index 00000000..cb63a321 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/.travis.yml @@ -0,0 +1,13 @@ +sudo: false + +language: go + +go: + - 1.x + - tip + +branches: + only: + - master + +script: make test diff --git a/vendor/github.com/hashicorp/hcl/Makefile b/vendor/github.com/hashicorp/hcl/Makefile new file mode 100644 index 00000000..84fd743f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/Makefile @@ -0,0 +1,18 @@ +TEST?=./... + +default: test + +fmt: generate + go fmt ./... + +test: generate + go get -t ./... + go test $(TEST) $(TESTARGS) + +generate: + go generate ./... + +updatedeps: + go get -u golang.org/x/tools/cmd/stringer + +.PHONY: default generate test updatedeps diff --git a/vendor/github.com/hashicorp/hcl/README.md b/vendor/github.com/hashicorp/hcl/README.md new file mode 100644 index 00000000..c8223326 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/README.md @@ -0,0 +1,125 @@ +# HCL + +[![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl) + +HCL (HashiCorp Configuration Language) is a configuration language built +by HashiCorp. The goal of HCL is to build a structured configuration language +that is both human and machine friendly for use with command-line tools, but +specifically targeted towards DevOps tools, servers, etc. + +HCL is also fully JSON compatible. That is, JSON can be used as completely +valid input to a system expecting HCL. This helps makes systems +interoperable with other systems. + +HCL is heavily inspired by +[libucl](https://github.com/vstakhov/libucl), +nginx configuration, and others similar. + +## Why? + +A common question when viewing HCL is to ask the question: why not +JSON, YAML, etc.? + +Prior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com) +used a variety of configuration languages from full programming languages +such as Ruby to complete data structure languages such as JSON. What we +learned is that some people wanted human-friendly configuration languages +and some people wanted machine-friendly languages. + +JSON fits a nice balance in this, but is fairly verbose and most +importantly doesn't support comments. With YAML, we found that beginners +had a really hard time determining what the actual structure was, and +ended up guessing more often than not whether to use a hyphen, colon, etc. +in order to represent some configuration key. + +Full programming languages such as Ruby enable complex behavior +a configuration language shouldn't usually allow, and also forces +people to learn some set of Ruby. + +Because of this, we decided to create our own configuration language +that is JSON-compatible. Our configuration language (HCL) is designed +to be written and modified by humans. The API for HCL allows JSON +as an input so that it is also machine-friendly (machines can generate +JSON instead of trying to generate HCL). + +Our goal with HCL is not to alienate other configuration languages. +It is instead to provide HCL as a specialized language for our tools, +and JSON as the interoperability layer. + +## Syntax + +For a complete grammar, please see the parser itself. A high-level overview +of the syntax and grammar is listed here. + + * Single line comments start with `#` or `//` + + * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments + are not allowed. A multi-line comment (also known as a block comment) + terminates at the first `*/` found. + + * Values are assigned with the syntax `key = value` (whitespace doesn't + matter). The value can be any primitive: a string, number, boolean, + object, or list. + + * Strings are double-quoted and can contain any UTF-8 characters. + Example: `"Hello, World"` + + * Multi-line strings start with `<- + echo %Path% + + go version + + go env + + go get -t ./... + +build_script: +- cmd: go test -v ./... diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go deleted file mode 100644 index 2380d71e..00000000 --- a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go +++ /dev/null @@ -1,162 +0,0 @@ -// Derivative work from: -// - https://golang.org/src/cmd/gofmt/gofmt.go -// - https://github.com/fatih/hclfmt - -package fmtcmd - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" - - "github.com/hashicorp/hcl/hcl/printer" -) - -var ( - ErrWriteStdin = errors.New("cannot use write option with standard input") -) - -type Options struct { - List bool // list files whose formatting differs - Write bool // write result to (source) file instead of stdout - Diff bool // display diffs of formatting changes -} - -func isValidFile(f os.FileInfo, extensions []string) bool { - if !f.IsDir() && !strings.HasPrefix(f.Name(), ".") { - for _, ext := range extensions { - if strings.HasSuffix(f.Name(), "."+ext) { - return true - } - } - } - - return false -} - -// If in == nil, the source is the contents of the file with the given filename. -func processFile(filename string, in io.Reader, out io.Writer, stdin bool, opts Options) error { - if in == nil { - f, err := os.Open(filename) - if err != nil { - return err - } - defer f.Close() - in = f - } - - src, err := ioutil.ReadAll(in) - if err != nil { - return err - } - - res, err := printer.Format(src) - if err != nil { - return fmt.Errorf("In %s: %s", filename, err) - } - - if !bytes.Equal(src, res) { - // formatting has changed - if opts.List { - fmt.Fprintln(out, filename) - } - if opts.Write { - err = ioutil.WriteFile(filename, res, 0644) - if err != nil { - return err - } - } - if opts.Diff { - data, err := diff(src, res) - if err != nil { - return fmt.Errorf("computing diff: %s", err) - } - fmt.Fprintf(out, "diff a/%s b/%s\n", filename, filename) - out.Write(data) - } - } - - if !opts.List && !opts.Write && !opts.Diff { - _, err = out.Write(res) - } - - return err -} - -func walkDir(path string, extensions []string, stdout io.Writer, opts Options) error { - visitFile := func(path string, f os.FileInfo, err error) error { - if err == nil && isValidFile(f, extensions) { - err = processFile(path, nil, stdout, false, opts) - } - return err - } - - return filepath.Walk(path, visitFile) -} - -func Run( - paths, extensions []string, - stdin io.Reader, - stdout io.Writer, - opts Options, -) error { - if len(paths) == 0 { - if opts.Write { - return ErrWriteStdin - } - if err := processFile("", stdin, stdout, true, opts); err != nil { - return err - } - return nil - } - - for _, path := range paths { - switch dir, err := os.Stat(path); { - case err != nil: - return err - case dir.IsDir(): - if err := walkDir(path, extensions, stdout, opts); err != nil { - return err - } - default: - if err := processFile(path, nil, stdout, false, opts); err != nil { - return err - } - } - } - - return nil -} - -func diff(b1, b2 []byte) (data []byte, err error) { - f1, err := ioutil.TempFile("", "") - if err != nil { - return - } - defer os.Remove(f1.Name()) - defer f1.Close() - - f2, err := ioutil.TempFile("", "") - if err != nil { - return - } - defer os.Remove(f2.Name()) - defer f2.Close() - - f1.Write(b1) - f2.Write(b2) - - data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() - if len(data) > 0 { - // diff exits with a non-zero status when the files don't match. - // Ignore that failure as long as we get output. - err = nil - } - return -} diff --git a/vendor/github.com/hashicorp/hcl/testhelper/unix2dos.go b/vendor/github.com/hashicorp/hcl/testhelper/unix2dos.go deleted file mode 100644 index 827ac6f1..00000000 --- a/vendor/github.com/hashicorp/hcl/testhelper/unix2dos.go +++ /dev/null @@ -1,15 +0,0 @@ -package testhelper - -import ( - "runtime" - "strings" -) - -// Converts the line endings when on Windows -func Unix2dos(unix string) string { - if runtime.GOOS != "windows" { - return unix - } - - return strings.Replace(unix, "\n", "\r\n", -1) -} diff --git a/vendor/github.com/jpillora/backoff/README.md b/vendor/github.com/jpillora/backoff/README.md new file mode 100644 index 00000000..81e77cd7 --- /dev/null +++ b/vendor/github.com/jpillora/backoff/README.md @@ -0,0 +1,119 @@ +# Backoff + +A simple exponential backoff counter in Go (Golang) + +[![GoDoc](https://godoc.org/github.com/jpillora/backoff?status.svg)](https://godoc.org/github.com/jpillora/backoff) [![Circle CI](https://circleci.com/gh/jpillora/backoff.svg?style=shield)](https://circleci.com/gh/jpillora/backoff) + +### Install + +``` +$ go get -v github.com/jpillora/backoff +``` + +### Usage + +Backoff is a `time.Duration` counter. It starts at `Min`. After every call to `Duration()` it is multiplied by `Factor`. It is capped at `Max`. It returns to `Min` on every call to `Reset()`. `Jitter` adds randomness ([see below](#example-using-jitter)). Used in conjunction with the `time` package. + +--- + +#### Simple example + +``` go + +b := &backoff.Backoff{ + //These are the defaults + Min: 100 * time.Millisecond, + Max: 10 * time.Second, + Factor: 2, + Jitter: false, +} + +fmt.Printf("%s\n", b.Duration()) +fmt.Printf("%s\n", b.Duration()) +fmt.Printf("%s\n", b.Duration()) + +fmt.Printf("Reset!\n") +b.Reset() + +fmt.Printf("%s\n", b.Duration()) +``` + +``` +100ms +200ms +400ms +Reset! +100ms +``` + +--- + +#### Example using `net` package + +``` go +b := &backoff.Backoff{ + Max: 5 * time.Minute, +} + +for { + conn, err := net.Dial("tcp", "example.com:5309") + if err != nil { + d := b.Duration() + fmt.Printf("%s, reconnecting in %s", err, d) + time.Sleep(d) + continue + } + //connected + b.Reset() + conn.Write([]byte("hello world!")) + // ... Read ... Write ... etc + conn.Close() + //disconnected +} + +``` + +--- + +#### Example using `Jitter` + +Enabling `Jitter` adds some randomization to the backoff durations. [See Amazon's writeup of performance gains using jitter](http://www.awsarchitectureblog.com/2015/03/backoff.html). Seeding is not necessary but doing so gives repeatable results. + +```go +import "math/rand" + +b := &backoff.Backoff{ + Jitter: true, +} + +rand.Seed(42) + +fmt.Printf("%s\n", b.Duration()) +fmt.Printf("%s\n", b.Duration()) +fmt.Printf("%s\n", b.Duration()) + +fmt.Printf("Reset!\n") +b.Reset() + +fmt.Printf("%s\n", b.Duration()) +fmt.Printf("%s\n", b.Duration()) +fmt.Printf("%s\n", b.Duration()) +``` + +``` +100ms +106.600049ms +281.228155ms +Reset! +100ms +104.381845ms +214.957989ms +``` + +#### Documentation + +https://godoc.org/github.com/jpillora/backoff + +#### Credits + +Forked from some JavaScript written by [@tj](https://github.com/tj) \ No newline at end of file diff --git a/vendor/github.com/kardianos/osext/README.md b/vendor/github.com/kardianos/osext/README.md new file mode 100644 index 00000000..15cbc3d9 --- /dev/null +++ b/vendor/github.com/kardianos/osext/README.md @@ -0,0 +1,21 @@ +### Extensions to the "os" package. + +[![GoDoc](https://godoc.org/github.com/kardianos/osext?status.svg)](https://godoc.org/github.com/kardianos/osext) + +## Find the current Executable and ExecutableFolder. + +As of go1.8 the Executable function may be found in `os`. The Executable function +in the std lib `os` package is used if available. + +There is sometimes utility in finding the current executable file +that is running. This can be used for upgrading the current executable +or finding resources located relative to the executable file. Both +working directory and the os.Args[0] value are arbitrary and cannot +be relied on; os.Args[0] can be "faked". + +Multi-platform and supports: + * Linux + * OS X + * Windows + * Plan 9 + * BSDs. diff --git a/vendor/github.com/kr/fs/LICENSE b/vendor/github.com/kr/fs/LICENSE deleted file mode 100644 index 74487567..00000000 --- a/vendor/github.com/kr/fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/kr/fs/filesystem.go b/vendor/github.com/kr/fs/filesystem.go deleted file mode 100644 index f1c4805f..00000000 --- a/vendor/github.com/kr/fs/filesystem.go +++ /dev/null @@ -1,36 +0,0 @@ -package fs - -import ( - "io/ioutil" - "os" - "path/filepath" -) - -// FileSystem defines the methods of an abstract filesystem. -type FileSystem interface { - - // ReadDir reads the directory named by dirname and returns a - // list of directory entries. - ReadDir(dirname string) ([]os.FileInfo, error) - - // Lstat returns a FileInfo describing the named file. If the file is a - // symbolic link, the returned FileInfo describes the symbolic link. Lstat - // makes no attempt to follow the link. - Lstat(name string) (os.FileInfo, error) - - // Join joins any number of path elements into a single path, adding a - // separator if necessary. The result is Cleaned; in particular, all - // empty strings are ignored. - // - // The separator is FileSystem specific. - Join(elem ...string) string -} - -// fs represents a FileSystem provided by the os package. -type fs struct{} - -func (f *fs) ReadDir(dirname string) ([]os.FileInfo, error) { return ioutil.ReadDir(dirname) } - -func (f *fs) Lstat(name string) (os.FileInfo, error) { return os.Lstat(name) } - -func (f *fs) Join(elem ...string) string { return filepath.Join(elem...) } diff --git a/vendor/github.com/kr/fs/walk.go b/vendor/github.com/kr/fs/walk.go deleted file mode 100644 index 6ffa1e0b..00000000 --- a/vendor/github.com/kr/fs/walk.go +++ /dev/null @@ -1,95 +0,0 @@ -// Package fs provides filesystem-related functions. -package fs - -import ( - "os" -) - -// Walker provides a convenient interface for iterating over the -// descendants of a filesystem path. -// Successive calls to the Step method will step through each -// file or directory in the tree, including the root. The files -// are walked in lexical order, which makes the output deterministic -// but means that for very large directories Walker can be inefficient. -// Walker does not follow symbolic links. -type Walker struct { - fs FileSystem - cur item - stack []item - descend bool -} - -type item struct { - path string - info os.FileInfo - err error -} - -// Walk returns a new Walker rooted at root. -func Walk(root string) *Walker { - return WalkFS(root, new(fs)) -} - -// WalkFS returns a new Walker rooted at root on the FileSystem fs. -func WalkFS(root string, fs FileSystem) *Walker { - info, err := fs.Lstat(root) - return &Walker{ - fs: fs, - stack: []item{{root, info, err}}, - } -} - -// Step advances the Walker to the next file or directory, -// which will then be available through the Path, Stat, -// and Err methods. -// It returns false when the walk stops at the end of the tree. -func (w *Walker) Step() bool { - if w.descend && w.cur.err == nil && w.cur.info.IsDir() { - list, err := w.fs.ReadDir(w.cur.path) - if err != nil { - w.cur.err = err - w.stack = append(w.stack, w.cur) - } else { - for i := len(list) - 1; i >= 0; i-- { - path := w.fs.Join(w.cur.path, list[i].Name()) - w.stack = append(w.stack, item{path, list[i], nil}) - } - } - } - - if len(w.stack) == 0 { - return false - } - i := len(w.stack) - 1 - w.cur = w.stack[i] - w.stack = w.stack[:i] - w.descend = true - return true -} - -// Path returns the path to the most recent file or directory -// visited by a call to Step. It contains the argument to Walk -// as a prefix; that is, if Walk is called with "dir", which is -// a directory containing the file "a", Path will return "dir/a". -func (w *Walker) Path() string { - return w.cur.path -} - -// Stat returns info for the most recent file or directory -// visited by a call to Step. -func (w *Walker) Stat() os.FileInfo { - return w.cur.info -} - -// Err returns the error, if any, for the most recent attempt -// by Step to visit a file or directory. If a directory has -// an error, w will not descend into that directory. -func (w *Walker) Err() error { - return w.cur.err -} - -// SkipDir causes the currently visited directory to be skipped. -// If w is not on a directory, SkipDir has no effect. -func (w *Walker) SkipDir() { - w.descend = false -} diff --git a/vendor/github.com/labstack/echo/.editorconfig b/vendor/github.com/labstack/echo/.editorconfig new file mode 100644 index 00000000..17ae50dd --- /dev/null +++ b/vendor/github.com/labstack/echo/.editorconfig @@ -0,0 +1,25 @@ +# EditorConfig coding styles definitions. For more information about the +# properties used in this file, please see the EditorConfig documentation: +# http://editorconfig.org/ + +# indicate this is the root of the project +root = true + +[*] +charset = utf-8 + +end_of_line = LF +insert_final_newline = true +trim_trailing_whitespace = true + +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false + +[*.go] +indent_style = tab diff --git a/vendor/github.com/labstack/echo/.gitattributes b/vendor/github.com/labstack/echo/.gitattributes new file mode 100644 index 00000000..49b63e52 --- /dev/null +++ b/vendor/github.com/labstack/echo/.gitattributes @@ -0,0 +1,20 @@ +# Automatically normalize line endings for all text-based files +# http://git-scm.com/docs/gitattributes#_end_of_line_conversion +* text=auto + +# For the following file types, normalize line endings to LF on checking and +# prevent conversion to CRLF when they are checked out (this is required in +# order to prevent newline related issues) +.* text eol=lf +*.go text eol=lf +*.yml text eol=lf +*.html text eol=lf +*.css text eol=lf +*.js text eol=lf +*.json text eol=lf +LICENSE text eol=lf + +# Exclude `website` and `cookbook` from GitHub's language statistics +# https://github.com/github/linguist#using-gitattributes +cookbook/* linguist-documentation +website/* linguist-documentation diff --git a/vendor/github.com/labstack/echo/.gitignore b/vendor/github.com/labstack/echo/.gitignore new file mode 100644 index 00000000..dd74acca --- /dev/null +++ b/vendor/github.com/labstack/echo/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +coverage.txt +_test +vendor +.idea +*.iml +*.out diff --git a/vendor/github.com/labstack/echo/.travis.yml b/vendor/github.com/labstack/echo/.travis.yml new file mode 100644 index 00000000..951c2d39 --- /dev/null +++ b/vendor/github.com/labstack/echo/.travis.yml @@ -0,0 +1,14 @@ +language: go +go: + - 1.8.x + - 1.9.x + - tip +install: + - make dependency +script: + - make test +after_success: + - bash <(curl -s https://codecov.io/bash) +matrix: + allow_failures: + - go: tip diff --git a/vendor/github.com/labstack/echo/Gopkg.lock b/vendor/github.com/labstack/echo/Gopkg.lock new file mode 100644 index 00000000..272aaa52 --- /dev/null +++ b/vendor/github.com/labstack/echo/Gopkg.lock @@ -0,0 +1,75 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "346938d642f2ec3594ed81d874461961cd0faa76" + version = "v1.1.0" + +[[projects]] + name = "github.com/dgrijalva/jwt-go" + packages = ["."] + revision = "d2709f9f1f31ebcda9651b03077758c1f3a0018c" + version = "v3.0.0" + +[[projects]] + name = "github.com/labstack/gommon" + packages = ["bytes","color","log","random"] + revision = "1121fd3e243c202482226a7afe4dcd07ffc4139a" + version = "v0.2.1" + +[[projects]] + name = "github.com/mattn/go-colorable" + packages = ["."] + revision = "d228849504861217f796da67fae4f6e347643f15" + version = "v0.0.7" + +[[projects]] + name = "github.com/mattn/go-isatty" + packages = ["."] + revision = "fc9e8d8ef48496124e79ae0df75490096eccf6fe" + version = "v0.0.2" + +[[projects]] + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + name = "github.com/stretchr/testify" + packages = ["assert"] + revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" + version = "v1.1.4" + +[[projects]] + branch = "master" + name = "github.com/valyala/bytebufferpool" + packages = ["."] + revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7" + +[[projects]] + branch = "master" + name = "github.com/valyala/fasttemplate" + packages = ["."] + revision = "dcecefd839c4193db0d35b88ec65b4c12d360ab0" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["acme","acme/autocert"] + revision = "e1a4589e7d3ea14a3352255d04b6f1a418845e5e" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix"] + revision = "b90f89a1e7a9c1f6b918820b3daa7f08488c8594" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "5f74a2a2ba5b07475ad0faa1b4c021b973ad40b2ae749e3d94e15fe839bb440e" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/labstack/echo/Makefile b/vendor/github.com/labstack/echo/Makefile new file mode 100644 index 00000000..3952d7bd --- /dev/null +++ b/vendor/github.com/labstack/echo/Makefile @@ -0,0 +1,13 @@ +DEP_VERSION=0.4.1 + +dependency: + curl -fsSL -o ${GOPATH}/bin/dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 + chmod +x ${GOPATH}/bin/dep + dep ensure + +test: + echo "" > coverage.txt + for d in $(shell go list ./... | grep -v vendor); do \ + go test -race -coverprofile=profile.out -covermode=atomic $$d || exit 1; \ + [ -f profile.out ] && cat profile.out >> coverage.txt && rm profile.out; \ + done diff --git a/vendor/github.com/labstack/echo/README.md b/vendor/github.com/labstack/echo/README.md new file mode 100644 index 00000000..d840f343 --- /dev/null +++ b/vendor/github.com/labstack/echo/README.md @@ -0,0 +1,95 @@ + + +[![Sourcegraph](https://sourcegraph.com/github.com/labstack/echo/-/badge.svg?style=flat-square)](https://sourcegraph.com/github.com/labstack/echo?badge) +[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/labstack/echo) +[![Go Report Card](https://goreportcard.com/badge/github.com/labstack/echo?style=flat-square)](https://goreportcard.com/report/github.com/labstack/echo) +[![Build Status](http://img.shields.io/travis/labstack/echo.svg?style=flat-square)](https://travis-ci.org/labstack/echo) +[![Codecov](https://img.shields.io/codecov/c/github/labstack/echo.svg?style=flat-square)](https://codecov.io/gh/labstack/echo) +[![Join the chat at https://gitter.im/labstack/echo](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/labstack/echo) +[![Forum](https://img.shields.io/badge/community-forum-00afd1.svg?style=flat-square)](https://forum.labstack.com) +[![Twitter](https://img.shields.io/badge/twitter-@labstack-55acee.svg?style=flat-square)](https://twitter.com/labstack) +[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/labstack/echo/master/LICENSE) + +## Feature Overview + +- Optimized HTTP router which smartly prioritize routes +- Build robust and scalable RESTful APIs +- Group APIs +- Extensible middleware framework +- Define middleware at root, group or route level +- Data binding for JSON, XML and form payload +- Handy functions to send variety of HTTP responses +- Centralized HTTP error handling +- Template rendering with any template engine +- Define your format for the logger +- Highly customizable +- Automatic TLS via Let’s Encrypt +- HTTP/2 support + +## Performance + + + +## [Guide](https://echo.labstack.com/guide) + +### Example + +```go +package main + +import ( + "net/http" + + "github.com/labstack/echo" + "github.com/labstack/echo/middleware" +) + +func main() { + // Echo instance + e := echo.New() + + // Middleware + e.Use(middleware.Logger()) + e.Use(middleware.Recover()) + + // Routes + e.GET("/", hello) + + // Start server + e.Logger.Fatal(e.Start(":1323")) +} + +// Handler +func hello(c echo.Context) error { + return c.String(http.StatusOK, "Hello, World!") +} +``` + +## Help + +- [Forum](https://forum.labstack.com) +- [Chat](https://gitter.im/labstack/echo) + +## Contribute + +**Use issues for everything** + +- For a small change, just send a PR. +- For bigger changes open an issue for discussion before sending a PR. +- PR should have: + - Test case + - Documentation + - Example (If it makes sense) +- You can also contribute by: + - Reporting issues + - Suggesting new features or enhancements + - Improve/fix documentation + +## Credits +- [Vishal Rana](https://github.com/vishr) - Author +- [Nitin Rana](https://github.com/nr17) - Consultant +- [Contributors](https://github.com/labstack/echo/graphs/contributors) + +## License + +[MIT](https://github.com/labstack/echo/blob/master/LICENSE) diff --git a/vendor/github.com/labstack/gommon/LICENSE b/vendor/github.com/labstack/gommon/LICENSE new file mode 100644 index 00000000..d2ae3edf --- /dev/null +++ b/vendor/github.com/labstack/gommon/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 labstack + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/vendor/github.com/labstack/gommon/bytes/LICENSE b/vendor/github.com/labstack/gommon/bytes/LICENSE deleted file mode 100644 index d2ae3edf..00000000 --- a/vendor/github.com/labstack/gommon/bytes/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 labstack - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/labstack/gommon/bytes/README.md b/vendor/github.com/labstack/gommon/bytes/README.md new file mode 100644 index 00000000..6e3b0fd3 --- /dev/null +++ b/vendor/github.com/labstack/gommon/bytes/README.md @@ -0,0 +1,29 @@ +# Bytes + +- Format bytes integer to human readable bytes string. +- Parse human readable bytes string to bytes integer. + +## Installation + +```go +go get github.com/labstack/gommon/bytes +``` + +## [Usage](https://github.com/labstack/gommon/blob/master/bytes/bytes_test.go) + +### Format + +```go +println(bytes.Format(13231323)) +``` + +`12.62MB` + +### Parse + +```go +b, _ = Parse("2M") +println(b) +``` + +`2097152` diff --git a/vendor/github.com/labstack/gommon/color/LICENSE b/vendor/github.com/labstack/gommon/color/LICENSE deleted file mode 100644 index d2ae3edf..00000000 --- a/vendor/github.com/labstack/gommon/color/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 labstack - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/labstack/gommon/color/README.md b/vendor/github.com/labstack/gommon/color/README.md new file mode 100644 index 00000000..297c3518 --- /dev/null +++ b/vendor/github.com/labstack/gommon/color/README.md @@ -0,0 +1,86 @@ +# Color + +Style terminal text. + +## Installation + +```sh +go get github.com/labstack/gommon/color +``` + +## Windows? + +Try [cmder](http://bliker.github.io/cmder) or https://github.com/mattn/go-colorable + +## [Usage](https://github.com/labstack/gommon/blob/master/color/color_test.go) + +```sh +import github.com/labstack/gommon/color +``` + +### Colored text + +```go +color.Println(color.Black("black")) +color.Println(color.Red("red")) +color.Println(color.Green("green")) +color.Println(color.Yellow("yellow")) +color.Println(color.Blue("blue")) +color.Println(color.Magenta("magenta")) +color.Println(color.Cyan("cyan")) +color.Println(color.White("white")) +color.Println(color.Grey("grey")) +``` +![Colored Text](http://i.imgur.com/8RtY1QR.png) + +### Colored background + +```go +color.Println(color.BlackBg("black background", color.Wht)) +color.Println(color.RedBg("red background")) +color.Println(color.GreenBg("green background")) +color.Println(color.YellowBg("yellow background")) +color.Println(color.BlueBg("blue background")) +color.Println(color.MagentaBg("magenta background")) +color.Println(color.CyanBg("cyan background")) +color.Println(color.WhiteBg("white background")) +``` +![Colored Background](http://i.imgur.com/SrrS6lw.png) + +### Emphasis + +```go +color.Println(color.Bold("bold")) +color.Println(color.Dim("dim")) +color.Println(color.Italic("italic")) +color.Println(color.Underline("underline")) +color.Println(color.Inverse("inverse")) +color.Println(color.Hidden("hidden")) +color.Println(color.Strikeout("strikeout")) +``` +![Emphasis](http://i.imgur.com/3RSJBbc.png) + +### Mix and match + +```go +color.Println(color.Green("bold green with white background", color.B, color.WhtBg)) +color.Println(color.Red("underline red", color.U)) +color.Println(color.Yellow("dim yellow", color.D)) +color.Println(color.Cyan("inverse cyan", color.In)) +color.Println(color.Blue("bold underline dim blue", color.B, color.U, color.D)) +``` +![Mix and match](http://i.imgur.com/jWGq9Ca.png) + +### Enable/Disable the package + +```go +color.Disable() +color.Enable() +``` + +### New instance + +```go +c := New() +c.Green("green") +``` diff --git a/vendor/github.com/labstack/gommon/log/LICENSE b/vendor/github.com/labstack/gommon/log/LICENSE deleted file mode 100644 index d2ae3edf..00000000 --- a/vendor/github.com/labstack/gommon/log/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 labstack - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/labstack/gommon/log/README.md b/vendor/github.com/labstack/gommon/log/README.md new file mode 100644 index 00000000..d5b9e9f0 --- /dev/null +++ b/vendor/github.com/labstack/gommon/log/README.md @@ -0,0 +1,5 @@ +## WORK IN PROGRESS + +### Usage + +[log_test.go](log_test.go) diff --git a/vendor/github.com/labstack/gommon/random/LICENSE b/vendor/github.com/labstack/gommon/random/LICENSE deleted file mode 100644 index d2ae3edf..00000000 --- a/vendor/github.com/labstack/gommon/random/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 labstack - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/lrstanley/girc/.travis.yml b/vendor/github.com/lrstanley/girc/.travis.yml new file mode 100644 index 00000000..658e65d9 --- /dev/null +++ b/vendor/github.com/lrstanley/girc/.travis.yml @@ -0,0 +1,26 @@ +language: go +go: +- 1.8 +- 1.9 +- tip +before_install: +- go get -v github.com/golang/lint/golint +script: +- $HOME/gopath/bin/golint -min_confidence 0.9 -set_exit_status +- GORACE="exitcode=1 halt_on_error=1" go test -v -coverprofile=coverage.txt -race -timeout 3m -count 3 -cpu 1,4 +- go tool vet -v -all . +after_success: + - bash <(curl -s https://codecov.io/bash) +branches: + only: + - master +notifications: + irc: + channels: + - irc.byteirc.org#/dev/null + template: + - "%{repository} #%{build_number} %{branch}/%{commit}: %{author} -- %{message} + %{build_url}" + on_success: change + on_failure: change + skip_join: false diff --git a/vendor/github.com/lrstanley/girc/CONTRIBUTING.md b/vendor/github.com/lrstanley/girc/CONTRIBUTING.md new file mode 100644 index 00000000..7913630c --- /dev/null +++ b/vendor/github.com/lrstanley/girc/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +## Issue submission + + * When submitting an issue or bug report, please ensure to provide as much + information as possible, please ensure that you are running on the latest + stable version (tagged), or when using master, provide the specific commit + being used. + * Provide the minimum needed viable source to replicate the problem. + +## Pull requests + +To review what is currently being worked on, or looked into, feel free to head +over to the [issues list](../../issues). + +Below are a few guidelines if you would like to contribute. Keep the code +clean, standardized, and much of the quality should match Golang's standard +library and common idioms. + + * Always test using the latest Go version. + * Always use `gofmt` before committing anything. + * Always have proper documentation before committing. + * Keep the same whitespacing, documentation, and newline format as the + rest of the project. + * Only use 3rd party libraries if necessary. If only a small portion of + the library is needed, simply rewrite it within the library to prevent + useless imports. + * Also see [golang/go/wiki/CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments) + +If you would like to assist, and the pull request is quite large and/or it has +the potential of being a breaking change, please open an issue first so it can +be discussed. diff --git a/vendor/github.com/lrstanley/girc/README.md b/vendor/github.com/lrstanley/girc/README.md new file mode 100644 index 00000000..ddc1193c --- /dev/null +++ b/vendor/github.com/lrstanley/girc/README.md @@ -0,0 +1,99 @@ +

+

girc, a flexible IRC library for Go

+

+ Build Status + Coverage Status + GoDoc + Go Report Card + IRC Chat +

+ +## Status + +**girc is fairly close to marking the 1.0.0 endpoint, which will be tagged as +necessary, so you will be able to use this with care knowing the specific tag +you're using won't have breaking changes** + +## Features + +- Focuses on simplicity, yet tries to still be flexible. +- Only requires [standard library packages](https://godoc.org/github.com/lrstanley/girc?imports) +- Event based triggering/responses ([example](https://godoc.org/github.com/lrstanley/girc#ex-package--Commands), and [CTCP too](https://godoc.org/github.com/lrstanley/girc#Commands.SendCTCP)!) +- [Documentation](https://godoc.org/github.com/lrstanley/girc) is _mostly_ complete. +- Support for almost all of the [IRCv3 spec](http://ircv3.net/software/libraries.html). + - SASL Auth (currently only `PLAIN` and `EXTERNAL` is support by default, + however you can simply implement `SASLMech` yourself to support additional + mechanisms.) + - Message tags (things like `account-tag` on by default) + - `account-notify`, `away-notify`, `chghost`, `extended-join`, etc -- all handled seemlessly ([cap.go](https://github.com/lrstanley/girc/blob/master/cap.go) for more info). +- Channel and user tracking. Easily find what users are in a channel, if a + user is away, or if they are authenticated (if the server supports it!) +- Client state/capability tracking. Easy methods to access capability data ([LookupChannel](https://godoc.org/github.com/lrstanley/girc#Client.LookupChannel), [LookupUser](https://godoc.org/github.com/lrstanley/girc#Client.LookupUser), [GetServerOption (ISUPPORT)](https://godoc.org/github.com/lrstanley/girc#Client.GetServerOption), etc.) +- Built-in support for things you would commonly have to implement yourself. + - Nick collision detection and prevention (also see [Config.HandleNickCollide](https://godoc.org/github.com/lrstanley/girc#Config).) + - Event/message rate limiting. + - Channel, nick, and user validation methods ([IsValidChannel](https://godoc.org/github.com/lrstanley/girc#IsValidChannel), [IsValidNick](https://godoc.org/github.com/lrstanley/girc#IsValidNick), etc.) + - CTCP handling and auto-responses ([CTCP](https://godoc.org/github.com/lrstanley/girc#CTCP)) + - And more! + +## Installing + + $ go get -u github.com/lrstanley/girc + +## Examples + +See [the examples](https://godoc.org/github.com/lrstanley/girc#example-package--Bare) +within the documentation for real-world usecases. Here are a few real-world +usecases/examples/projects which utilize girc: + +| Project | Description | +| --- | --- | +| [nagios-check-ircd](https://github.com/lrstanley/nagios-check-ircd) | Nagios utility for monitoring the health of an ircd | +| [nagios-notify-irc](https://github.com/lrstanley/nagios-notify-irc) | Nagios utility for sending alerts to one or many channels/networks | +| [matterbridge](https://github.com/42wim/matterbridge) | bridge between mattermost, IRC, slack, discord (and many others) with REST API | + +Working on a project and want to add it to the list? Submit a pull request! + +## Contributing + +Please review the [CONTRIBUTING](CONTRIBUTING.md) doc for submitting issues/a guide +on submitting pull requests and helping out. + +## License + + Copyright (c) 2016 Liam Stanley + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +girc artwork licensed under [CC 3.0](http://creativecommons.org/licenses/by/3.0/) based on Renee French under Creative Commons 3.0 Attributions. + +## References + + * [IRCv3: Specification Docs](http://ircv3.net/irc/) + * [IRCv3: Specification Repo](https://github.com/ircv3/ircv3-specifications) + * [IRCv3 Capability Registry](http://ircv3.net/registry.html) + * [ISUPPORT Specification Docs](http://www.irc.org/tech_docs/005.html) ([alternative 1](http://defs.ircdocs.horse/defs/isupport.html), [alternative 2](https://github.com/grawity/irc-docs/blob/master/client/RPL_ISUPPORT/draft-hardy-irc-isupport-00.txt), [relevant draft](http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt)) + * [IRC Numerics List](http://defs.ircdocs.horse/defs/numerics.html) + * [Extended WHO (also known as WHOX)](https://github.com/quakenet/snircd/blob/master/doc/readme.who) + * [RFC1459: Internet Relay Chat Protocol](https://tools.ietf.org/html/rfc1459) + * [RFC2812: Internet Relay Chat: Client Protocol](https://tools.ietf.org/html/rfc2812) + * [RFC2813: Internet Relay Chat: Server Protocol](https://tools.ietf.org/html/rfc2813) + * [RFC7194: Default Port for Internet Relay Chat (IRC) via TLS/SSL](https://tools.ietf.org/html/rfc7194) + * [RFC4422: Simple Authentication and Security Layer](https://tools.ietf.org/html/rfc4422) ([SASL EXTERNAL](https://tools.ietf.org/html/rfc4422#appendix-A)) + * [RFC4616: The PLAIN SASL Mechanism](https://tools.ietf.org/html/rfc4616) diff --git a/vendor/github.com/lrstanley/girc/cmdhandler/cmd.go b/vendor/github.com/lrstanley/girc/cmdhandler/cmd.go deleted file mode 100644 index a45a42f3..00000000 --- a/vendor/github.com/lrstanley/girc/cmdhandler/cmd.go +++ /dev/null @@ -1,199 +0,0 @@ -package cmdhandler - -import ( - "errors" - "fmt" - "regexp" - "strings" - "sync" - - "github.com/lrstanley/girc" -) - -// Input is a wrapper for events, based around private messages. -type Input struct { - Origin *girc.Event - Args []string - RawArgs string -} - -// Command is an IRC command, supporting aliases, help documentation and easy -// wrapping for message inputs. -type Command struct { - // Name of command, e.g. "search" or "ping". - Name string - // Aliases for the above command, e.g. "s" for search, or "p" for "ping". - Aliases []string - // Help documentation. Should be in the format " [arg] -- - // something useful here" - Help string - // MinArgs is the minimum required arguments for the command. Defaults to - // 0, which means multiple, or no arguments can be supplied. If set - // above 0, this means that the command handler will throw an error asking - // the person to check "help " for more info. - MinArgs int - // Fn is the function which is executed when the command is ran from a - // private message, or channel. - Fn func(*girc.Client, *Input) -} - -func (c *Command) genHelp(prefix string) string { - out := "{b}" + prefix + c.Name + "{b}" - - if c.Aliases != nil && len(c.Aliases) > 0 { - out += " ({b}" + prefix + strings.Join(c.Aliases, "{b}, {b}"+prefix) + "{b})" - } - - out += " :: " + c.Help - - return out -} - -// CmdHandler is an irc command parser and execution format which you could -// use as an example for building your own version/bot. -// -// An example of how you would register this with girc: -// -// ch, err := cmdhandler.New("!") -// if err != nil { -// panic(err) -// } -// -// ch.Add(&cmdhandler.Command{ -// Name: "ping", -// Help: "Sends a pong reply back to the original user.", -// Fn: func(c *girc.Client, input *cmdhandler.Input) { -// c.Commands.ReplyTo(*input.Origin, "pong!") -// }, -// }) -// -// client.Handlers.AddHandler(girc.PRIVMSG, ch) -type CmdHandler struct { - prefix string - re *regexp.Regexp - - mu sync.Mutex - cmds map[string]*Command -} - -var cmdMatch = `^%s([a-z0-9-_]{1,20})(?: (.*))?$` - -// New returns a new CmdHandler based on the specified command prefix. A good -// prefix is a single character, and easy to remember/use. E.g. "!", or ".". -func New(prefix string) (*CmdHandler, error) { - re, err := regexp.Compile(fmt.Sprintf(cmdMatch, regexp.QuoteMeta(prefix))) - if err != nil { - return nil, err - } - - return &CmdHandler{prefix: prefix, re: re, cmds: make(map[string]*Command)}, nil -} - -var validName = regexp.MustCompile(`^[a-z0-9-_]{1,20}$`) - -// Add registers a new command to the handler. Note that you cannot remove -// commands once added, unless you add another CmdHandler to the client. -func (ch *CmdHandler) Add(cmd *Command) error { - if cmd == nil { - return errors.New("nil command provided to CmdHandler") - } - - cmd.Name = strings.ToLower(cmd.Name) - if !validName.MatchString(cmd.Name) { - return fmt.Errorf("invalid command name: %q (req: %q)", cmd.Name, validName.String()) - } - - if cmd.Aliases != nil { - for i := 0; i < len(cmd.Aliases); i++ { - cmd.Aliases[i] = strings.ToLower(cmd.Aliases[i]) - if !validName.MatchString(cmd.Aliases[i]) { - return fmt.Errorf("invalid command name: %q (req: %q)", cmd.Aliases[i], validName.String()) - } - } - } - - if cmd.MinArgs < 0 { - cmd.MinArgs = 0 - } - - ch.mu.Lock() - defer ch.mu.Unlock() - - if _, ok := ch.cmds[cmd.Name]; ok { - return fmt.Errorf("command already registered: %s", cmd.Name) - } - - ch.cmds[cmd.Name] = cmd - - // Since we'd be storing pointers, duplicates do not matter. - for i := 0; i < len(cmd.Aliases); i++ { - if _, ok := ch.cmds[cmd.Aliases[i]]; ok { - return fmt.Errorf("alias already registered: %s", cmd.Aliases[i]) - } - - ch.cmds[cmd.Aliases[i]] = cmd - } - - return nil -} - -// Execute satisfies the girc.Handler interface. -func (ch *CmdHandler) Execute(client *girc.Client, event girc.Event) { - if event.Source == nil || event.Command != girc.PRIVMSG { - return - } - - parsed := ch.re.FindStringSubmatch(event.Trailing) - if len(parsed) != 3 { - return - } - - invCmd := strings.ToLower(parsed[1]) - args := strings.Split(parsed[2], " ") - if len(args) == 1 && args[0] == "" { - args = []string{} - } - - ch.mu.Lock() - defer ch.mu.Unlock() - - if invCmd == "help" { - if len(args) == 0 { - client.Cmd.ReplyTo(event, girc.Fmt("type '{b}!help {blue}{c}{b}' to optionally get more info about a specific command.")) - return - } - - args[0] = strings.ToLower(args[0]) - - if _, ok := ch.cmds[args[0]]; !ok { - client.Cmd.ReplyTof(event, girc.Fmt("unknown command {b}%q{b}."), args[0]) - return - } - - if ch.cmds[args[0]].Help == "" { - client.Cmd.ReplyTof(event, girc.Fmt("there is no help documentation for {b}%q{b}"), args[0]) - return - } - - client.Cmd.ReplyTo(event, girc.Fmt(ch.cmds[args[0]].genHelp(ch.prefix))) - return - } - - cmd, ok := ch.cmds[invCmd] - if !ok { - return - } - - if len(args) < cmd.MinArgs { - client.Cmd.ReplyTof(event, girc.Fmt("not enough arguments supplied for {b}%q{b}. try '{b}%shelp %s{b}'?"), invCmd, ch.prefix, invCmd) - return - } - - in := &Input{ - Origin: &event, - Args: args, - RawArgs: parsed[2], - } - - go cmd.Fn(client, in) -} diff --git a/vendor/github.com/magiconair/properties/.gitignore b/vendor/github.com/magiconair/properties/.gitignore new file mode 100644 index 00000000..e7081ff5 --- /dev/null +++ b/vendor/github.com/magiconair/properties/.gitignore @@ -0,0 +1,6 @@ +*.sublime-project +*.sublime-workspace +*.un~ +*.swp +.idea/ +*.iml diff --git a/vendor/github.com/magiconair/properties/.travis.yml b/vendor/github.com/magiconair/properties/.travis.yml new file mode 100644 index 00000000..923e8664 --- /dev/null +++ b/vendor/github.com/magiconair/properties/.travis.yml @@ -0,0 +1,10 @@ +language: go +go: + - 1.4.x + - 1.5.x + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - "1.10" + - tip diff --git a/vendor/github.com/magiconair/properties/CHANGELOG.md b/vendor/github.com/magiconair/properties/CHANGELOG.md new file mode 100644 index 00000000..adefa17e --- /dev/null +++ b/vendor/github.com/magiconair/properties/CHANGELOG.md @@ -0,0 +1,123 @@ +## Changelog + +### [1.7.6](https://github.com/magiconair/properties/tree/v1.7.6) - 14 Feb 2018 + + * [PR #29](https://github.com/magiconair/properties/pull/29): Reworked expansion logic to handle more complex cases. + + See PR for an example. + + Thanks to [@yobert](https://github.com/yobert) for the fix. + +### [1.7.5](https://github.com/magiconair/properties/tree/v1.7.5) - 13 Feb 2018 + + * [PR #28](https://github.com/magiconair/properties/pull/28): Support duplicate expansions in the same value + + Values which expand the same key multiple times (e.g. `key=${a} ${a}`) will no longer fail + with a `circular reference error`. + + Thanks to [@yobert](https://github.com/yobert) for the fix. + +### [1.7.4](https://github.com/magiconair/properties/tree/v1.7.4) - 31 Oct 2017 + + * [Issue #23](https://github.com/magiconair/properties/issues/23): Ignore blank lines with whitespaces + + * [PR #24](https://github.com/magiconair/properties/pull/24): Update keys when DisableExpansion is enabled + + Thanks to [@mgurov](https://github.com/mgurov) for the fix. + +### [1.7.3](https://github.com/magiconair/properties/tree/v1.7.3) - 10 Jul 2017 + + * [Issue #17](https://github.com/magiconair/properties/issues/17): Add [SetValue()](http://godoc.org/github.com/magiconair/properties#Properties.SetValue) method to set values generically + * [Issue #22](https://github.com/magiconair/properties/issues/22): Add [LoadMap()](http://godoc.org/github.com/magiconair/properties#LoadMap) function to load properties from a string map + +### [1.7.2](https://github.com/magiconair/properties/tree/v1.7.2) - 20 Mar 2017 + + * [Issue #15](https://github.com/magiconair/properties/issues/15): Drop gocheck dependency + * [PR #21](https://github.com/magiconair/properties/pull/21): Add [Map()](http://godoc.org/github.com/magiconair/properties#Properties.Map) and [FilterFunc()](http://godoc.org/github.com/magiconair/properties#Properties.FilterFunc) + +### [1.7.1](https://github.com/magiconair/properties/tree/v1.7.1) - 13 Jan 2017 + + * [Issue #14](https://github.com/magiconair/properties/issues/14): Decouple TestLoadExpandedFile from `$USER` + * [PR #12](https://github.com/magiconair/properties/pull/12): Load from files and URLs + * [PR #16](https://github.com/magiconair/properties/pull/16): Keep gofmt happy + * [PR #18](https://github.com/magiconair/properties/pull/18): Fix Delete() function + +### [1.7.0](https://github.com/magiconair/properties/tree/v1.7.0) - 20 Mar 2016 + + * [Issue #10](https://github.com/magiconair/properties/issues/10): Add [LoadURL,LoadURLs,MustLoadURL,MustLoadURLs](http://godoc.org/github.com/magiconair/properties#LoadURL) method to load properties from a URL. + * [Issue #11](https://github.com/magiconair/properties/issues/11): Add [LoadString,MustLoadString](http://godoc.org/github.com/magiconair/properties#LoadString) method to load properties from an UTF8 string. + * [PR #8](https://github.com/magiconair/properties/pull/8): Add [MustFlag](http://godoc.org/github.com/magiconair/properties#Properties.MustFlag) method to provide overrides via command line flags. (@pascaldekloe) + +### [1.6.0](https://github.com/magiconair/properties/tree/v1.6.0) - 11 Dec 2015 + + * Add [Decode](http://godoc.org/github.com/magiconair/properties#Properties.Decode) method to populate struct from properties via tags. + +### [1.5.6](https://github.com/magiconair/properties/tree/v1.5.6) - 18 Oct 2015 + + * Vendored in gopkg.in/check.v1 + +### [1.5.5](https://github.com/magiconair/properties/tree/v1.5.5) - 31 Jul 2015 + + * [PR #6](https://github.com/magiconair/properties/pull/6): Add [Delete](http://godoc.org/github.com/magiconair/properties#Properties.Delete) method to remove keys including comments. (@gerbenjacobs) + +### [1.5.4](https://github.com/magiconair/properties/tree/v1.5.4) - 23 Jun 2015 + + * [Issue #5](https://github.com/magiconair/properties/issues/5): Allow disabling of property expansion [DisableExpansion](http://godoc.org/github.com/magiconair/properties#Properties.DisableExpansion). When property expansion is disabled Properties become a simple key/value store and don't check for circular references. + +### [1.5.3](https://github.com/magiconair/properties/tree/v1.5.3) - 02 Jun 2015 + + * [Issue #4](https://github.com/magiconair/properties/issues/4): Maintain key order in [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) and [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) + +### [1.5.2](https://github.com/magiconair/properties/tree/v1.5.2) - 10 Apr 2015 + + * [Issue #3](https://github.com/magiconair/properties/issues/3): Don't print comments in [WriteComment()](http://godoc.org/github.com/magiconair/properties#Properties.WriteComment) if they are all empty + * Add clickable links to README + +### [1.5.1](https://github.com/magiconair/properties/tree/v1.5.1) - 08 Dec 2014 + + * Added [GetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.GetParsedDuration) and [MustGetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.MustGetParsedDuration) for values specified compatible with + [time.ParseDuration()](http://golang.org/pkg/time/#ParseDuration). + +### [1.5.0](https://github.com/magiconair/properties/tree/v1.5.0) - 18 Nov 2014 + + * Added support for single and multi-line comments (reading, writing and updating) + * The order of keys is now preserved + * Calling [Set()](http://godoc.org/github.com/magiconair/properties#Properties.Set) with an empty key now silently ignores the call and does not create a new entry + * Added a [MustSet()](http://godoc.org/github.com/magiconair/properties#Properties.MustSet) method + * Migrated test library from launchpad.net/gocheck to [gopkg.in/check.v1](http://gopkg.in/check.v1) + +### [1.4.2](https://github.com/magiconair/properties/tree/v1.4.2) - 15 Nov 2014 + + * [Issue #2](https://github.com/magiconair/properties/issues/2): Fixed goroutine leak in parser which created two lexers but cleaned up only one + +### [1.4.1](https://github.com/magiconair/properties/tree/v1.4.1) - 13 Nov 2014 + + * [Issue #1](https://github.com/magiconair/properties/issues/1): Fixed bug in Keys() method which returned an empty string + +### [1.4.0](https://github.com/magiconair/properties/tree/v1.4.0) - 23 Sep 2014 + + * Added [Keys()](http://godoc.org/github.com/magiconair/properties#Properties.Keys) to get the keys + * Added [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) and [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) to get a subset of the properties + +### [1.3.0](https://github.com/magiconair/properties/tree/v1.3.0) - 18 Mar 2014 + +* Added support for time.Duration +* Made MustXXX() failure beha[ior configurable (log.Fatal, panic](https://github.com/magiconair/properties/tree/vior configurable (log.Fatal, panic) - custom) +* Changed default of MustXXX() failure from panic to log.Fatal + +### [1.2.0](https://github.com/magiconair/properties/tree/v1.2.0) - 05 Mar 2014 + +* Added MustGet... functions +* Added support for int and uint with range checks on 32 bit platforms + +### [1.1.0](https://github.com/magiconair/properties/tree/v1.1.0) - 20 Jan 2014 + +* Renamed from goproperties to properties +* Added support for expansion of environment vars in + filenames and value expressions +* Fixed bug where value expressions were not at the + start of the string + +### [1.0.0](https://github.com/magiconair/properties/tree/v1.0.0) - 7 Jan 2014 + +* Initial release diff --git a/vendor/github.com/magiconair/properties/README.md b/vendor/github.com/magiconair/properties/README.md new file mode 100644 index 00000000..2c05f290 --- /dev/null +++ b/vendor/github.com/magiconair/properties/README.md @@ -0,0 +1,129 @@ +[![](https://img.shields.io/github/tag/magiconair/properties.svg?style=flat-square&label=release)](https://github.com/magiconair/properties/releases) +[![Travis CI Status](https://img.shields.io/travis/magiconair/properties.svg?branch=master&style=flat-square&label=travis)](https://travis-ci.org/magiconair/properties) +[![Codeship CI Status](https://img.shields.io/codeship/16aaf660-f615-0135-b8f0-7e33b70920c0/master.svg?label=codeship&style=flat-square)](https://app.codeship.com/projects/274177") +[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg?style=flat-square)](https://raw.githubusercontent.com/magiconair/properties/master/LICENSE) +[![GoDoc](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](http://godoc.org/github.com/magiconair/properties) + +# Overview + +#### Please run `git pull --tags` to update the tags. See [below](#updated-git-tags) why. + +properties is a Go library for reading and writing properties files. + +It supports reading from multiple files or URLs and Spring style recursive +property expansion of expressions like `${key}` to their corresponding value. +Value expressions can refer to other keys like in `${key}` or to environment +variables like in `${USER}`. Filenames can also contain environment variables +like in `/home/${USER}/myapp.properties`. + +Properties can be decoded into structs, maps, arrays and values through +struct tags. + +Comments and the order of keys are preserved. Comments can be modified +and can be written to the output. + +The properties library supports both ISO-8859-1 and UTF-8 encoded data. + +Starting from version 1.3.0 the behavior of the MustXXX() functions is +configurable by providing a custom `ErrorHandler` function. The default has +changed from `panic` to `log.Fatal` but this is configurable and custom +error handling functions can be provided. See the package documentation for +details. + +Read the full documentation on [GoDoc](https://godoc.org/github.com/magiconair/properties) [![GoDoc](https://godoc.org/github.com/magiconair/properties?status.png)](https://godoc.org/github.com/magiconair/properties) + +## Getting Started + +```go +import ( + "flag" + "github.com/magiconair/properties" +) + +func main() { + // init from a file + p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8) + + // or multiple files + p = properties.MustLoadFiles([]string{ + "${HOME}/config.properties", + "${HOME}/config-${USER}.properties", + }, properties.UTF8, true) + + // or from a map + p = properties.LoadMap(map[string]string{"key": "value", "abc": "def"}) + + // or from a string + p = properties.MustLoadString("key=value\nabc=def") + + // or from a URL + p = properties.MustLoadURL("http://host/path") + + // or from multiple URLs + p = properties.MustLoadURL([]string{ + "http://host/config", + "http://host/config-${USER}", + }, true) + + // or from flags + p.MustFlag(flag.CommandLine) + + // get values through getters + host := p.MustGetString("host") + port := p.GetInt("port", 8080) + + // or through Decode + type Config struct { + Host string `properties:"host"` + Port int `properties:"port,default=9000"` + Accept []string `properties:"accept,default=image/png;image;gif"` + Timeout time.Duration `properties:"timeout,default=5s"` + } + var cfg Config + if err := p.Decode(&cfg); err != nil { + log.Fatal(err) + } +} + +``` + +## Installation and Upgrade + +``` +$ go get -u github.com/magiconair/properties +``` + +## License + +2 clause BSD license. See [LICENSE](https://github.com/magiconair/properties/blob/master/LICENSE) file for details. + +## ToDo + +* Dump contents with passwords and secrets obscured + +## Updated Git tags + +#### 13 Feb 2018 + +I realized that all of the git tags I had pushed before v1.7.5 were lightweight tags +and I've only recently learned that this doesn't play well with `git describe` 😞 + +I have replaced all lightweight tags with signed tags using this script which should +retain the commit date, name and email address. Please run `git pull --tags` to update them. + +Worst case you have to reclone the repo. + +```shell +#!/bin/bash +tag=$1 +echo "Updating $tag" +date=$(git show ${tag}^0 --format=%aD | head -1) +email=$(git show ${tag}^0 --format=%aE | head -1) +name=$(git show ${tag}^0 --format=%aN | head -1) +GIT_COMMITTER_DATE="$date" GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git tag -s -f ${tag} ${tag}^0 -m ${tag} +``` + +I apologize for the inconvenience. + +Frank + diff --git a/vendor/github.com/magiconair/properties/assert/assert.go b/vendor/github.com/magiconair/properties/assert/assert.go deleted file mode 100644 index cb1097ba..00000000 --- a/vendor/github.com/magiconair/properties/assert/assert.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2017 Frank Schroeder. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package assert provides helper functions for testing. -package assert - -import ( - "fmt" - "path/filepath" - "reflect" - "regexp" - "runtime" - "strings" - "testing" -) - -// skip defines the default call depth -const skip = 2 - -// Equal asserts that got and want are equal as defined by -// reflect.DeepEqual. The test fails with msg if they are not equal. -func Equal(t *testing.T, got, want interface{}, msg ...string) { - if x := equal(2, got, want, msg...); x != "" { - fmt.Println(x) - t.Fail() - } -} - -func equal(skip int, got, want interface{}, msg ...string) string { - if !reflect.DeepEqual(got, want) { - return fail(skip, "got %v want %v %s", got, want, strings.Join(msg, " ")) - } - return "" -} - -// Panic asserts that function fn() panics. -// It assumes that recover() either returns a string or -// an error and fails if the message does not match -// the regular expression in 'matches'. -func Panic(t *testing.T, fn func(), matches string) { - if x := doesPanic(2, fn, matches); x != "" { - fmt.Println(x) - t.Fail() - } -} - -func doesPanic(skip int, fn func(), expr string) (err string) { - defer func() { - r := recover() - if r == nil { - err = fail(skip, "did not panic") - return - } - var v string - switch r.(type) { - case error: - v = r.(error).Error() - case string: - v = r.(string) - } - err = matches(skip, v, expr) - }() - fn() - return "" -} - -// Matches asserts that a value matches a given regular expression. -func Matches(t *testing.T, value, expr string) { - if x := matches(2, value, expr); x != "" { - fmt.Println(x) - t.Fail() - } -} - -func matches(skip int, value, expr string) string { - ok, err := regexp.MatchString(expr, value) - if err != nil { - return fail(skip, "invalid pattern %q. %s", expr, err) - } - if !ok { - return fail(skip, "got %s which does not match %s", value, expr) - } - return "" -} - -func fail(skip int, format string, args ...interface{}) string { - _, file, line, _ := runtime.Caller(skip) - return fmt.Sprintf("\t%s:%d: %s\n", filepath.Base(file), line, fmt.Sprintf(format, args...)) -} diff --git a/vendor/github.com/matrix-org/gomatrix/LICENSE b/vendor/github.com/matrix-org/gomatrix/LICENSE deleted file mode 100644 index 8dada3ed..00000000 --- a/vendor/github.com/matrix-org/gomatrix/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/matrix-org/gomatrix/client.go b/vendor/github.com/matrix-org/gomatrix/client.go deleted file mode 100644 index 90a07c68..00000000 --- a/vendor/github.com/matrix-org/gomatrix/client.go +++ /dev/null @@ -1,703 +0,0 @@ -// Package gomatrix implements the Matrix Client-Server API. -// -// Specification can be found at http://matrix.org/docs/spec/client_server/r0.2.0.html -package gomatrix - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "path" - "strconv" - "sync" - "time" -) - -// Client represents a Matrix client. -type Client struct { - HomeserverURL *url.URL // The base homeserver URL - Prefix string // The API prefix eg '/_matrix/client/r0' - UserID string // The user ID of the client. Used for forming HTTP paths which use the client's user ID. - AccessToken string // The access_token for the client. - Client *http.Client // The underlying HTTP client which will be used to make HTTP requests. - Syncer Syncer // The thing which can process /sync responses - Store Storer // The thing which can store rooms/tokens/ids - - // The ?user_id= query parameter for application services. This must be set *prior* to calling a method. If this is empty, - // no user_id parameter will be sent. - // See http://matrix.org/docs/spec/application_service/unstable.html#identity-assertion - AppServiceUserID string - - syncingMutex sync.Mutex // protects syncingID - syncingID uint32 // Identifies the current Sync. Only one Sync can be active at any given time. -} - -// HTTPError An HTTP Error response, which may wrap an underlying native Go Error. -type HTTPError struct { - WrappedError error - Message string - Code int -} - -func (e HTTPError) Error() string { - var wrappedErrMsg string - if e.WrappedError != nil { - wrappedErrMsg = e.WrappedError.Error() - } - return fmt.Sprintf("msg=%s code=%d wrapped=%s", e.Message, e.Code, wrappedErrMsg) -} - -// BuildURL builds a URL with the Client's homserver/prefix/access_token set already. -func (cli *Client) BuildURL(urlPath ...string) string { - ps := []string{cli.Prefix} - for _, p := range urlPath { - ps = append(ps, p) - } - return cli.BuildBaseURL(ps...) -} - -// BuildBaseURL builds a URL with the Client's homeserver/access_token set already. You must -// supply the prefix in the path. -func (cli *Client) BuildBaseURL(urlPath ...string) string { - // copy the URL. Purposefully ignore error as the input is from a valid URL already - hsURL, _ := url.Parse(cli.HomeserverURL.String()) - parts := []string{hsURL.Path} - parts = append(parts, urlPath...) - hsURL.Path = path.Join(parts...) - query := hsURL.Query() - if cli.AccessToken != "" { - query.Set("access_token", cli.AccessToken) - } - if cli.AppServiceUserID != "" { - query.Set("user_id", cli.AppServiceUserID) - } - hsURL.RawQuery = query.Encode() - return hsURL.String() -} - -// BuildURLWithQuery builds a URL with query parameters in addition to the Client's homeserver/prefix/access_token set already. -func (cli *Client) BuildURLWithQuery(urlPath []string, urlQuery map[string]string) string { - u, _ := url.Parse(cli.BuildURL(urlPath...)) - q := u.Query() - for k, v := range urlQuery { - q.Set(k, v) - } - u.RawQuery = q.Encode() - return u.String() -} - -// SetCredentials sets the user ID and access token on this client instance. -func (cli *Client) SetCredentials(userID, accessToken string) { - cli.AccessToken = accessToken - cli.UserID = userID -} - -// ClearCredentials removes the user ID and access token on this client instance. -func (cli *Client) ClearCredentials() { - cli.AccessToken = "" - cli.UserID = "" -} - -// Sync starts syncing with the provided Homeserver. If Sync() is called twice then the first sync will be stopped and the -// error will be nil. -// -// This function will block until a fatal /sync error occurs, so it should almost always be started as a new goroutine. -// Fatal sync errors can be caused by: -// - The failure to create a filter. -// - Client.Syncer.OnFailedSync returning an error in response to a failed sync. -// - Client.Syncer.ProcessResponse returning an error. -// If you wish to continue retrying in spite of these fatal errors, call Sync() again. -func (cli *Client) Sync() error { - // Mark the client as syncing. - // We will keep syncing until the syncing state changes. Either because - // Sync is called or StopSync is called. - syncingID := cli.incrementSyncingID() - nextBatch := cli.Store.LoadNextBatch(cli.UserID) - filterID := cli.Store.LoadFilterID(cli.UserID) - if filterID == "" { - filterJSON := cli.Syncer.GetFilterJSON(cli.UserID) - resFilter, err := cli.CreateFilter(filterJSON) - if err != nil { - return err - } - filterID = resFilter.FilterID - cli.Store.SaveFilterID(cli.UserID, filterID) - } - - for { - resSync, err := cli.SyncRequest(30000, nextBatch, filterID, false, "") - if err != nil { - duration, err2 := cli.Syncer.OnFailedSync(resSync, err) - if err2 != nil { - return err2 - } - time.Sleep(duration) - continue - } - - // Check that the syncing state hasn't changed - // Either because we've stopped syncing or another sync has been started. - // We discard the response from our sync. - if cli.getSyncingID() != syncingID { - return nil - } - - // Save the token now *before* processing it. This means it's possible - // to not process some events, but it means that we won't get constantly stuck processing - // a malformed/buggy event which keeps making us panic. - cli.Store.SaveNextBatch(cli.UserID, resSync.NextBatch) - if err = cli.Syncer.ProcessResponse(resSync, nextBatch); err != nil { - return err - } - - nextBatch = resSync.NextBatch - } -} - -func (cli *Client) incrementSyncingID() uint32 { - cli.syncingMutex.Lock() - defer cli.syncingMutex.Unlock() - cli.syncingID++ - return cli.syncingID -} - -func (cli *Client) getSyncingID() uint32 { - cli.syncingMutex.Lock() - defer cli.syncingMutex.Unlock() - return cli.syncingID -} - -// StopSync stops the ongoing sync started by Sync. -func (cli *Client) StopSync() { - // Advance the syncing state so that any running Syncs will terminate. - cli.incrementSyncingID() -} - -// MakeRequest makes a JSON HTTP request to the given URL. -// If "resBody" is not nil, the response body will be json.Unmarshalled into it. -// -// Returns the HTTP body as bytes on 2xx with a nil error. Returns an error if the response is not 2xx along -// with the HTTP body bytes if it got that far. This error is an HTTPError which includes the returned -// HTTP status code and possibly a RespError as the WrappedError, if the HTTP body could be decoded as a RespError. -func (cli *Client) MakeRequest(method string, httpURL string, reqBody interface{}, resBody interface{}) ([]byte, error) { - var req *http.Request - var err error - if reqBody != nil { - var jsonStr []byte - jsonStr, err = json.Marshal(reqBody) - if err != nil { - return nil, err - } - req, err = http.NewRequest(method, httpURL, bytes.NewBuffer(jsonStr)) - } else { - req, err = http.NewRequest(method, httpURL, nil) - } - - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", "application/json") - res, err := cli.Client.Do(req) - if res != nil { - defer res.Body.Close() - } - if err != nil { - return nil, err - } - contents, err := ioutil.ReadAll(res.Body) - if res.StatusCode/100 != 2 { // not 2xx - var wrap error - var respErr RespError - if _ = json.Unmarshal(contents, &respErr); respErr.ErrCode != "" { - wrap = respErr - } - - // If we failed to decode as RespError, don't just drop the HTTP body, include it in the - // HTTP error instead (e.g proxy errors which return HTML). - msg := "Failed to " + method + " JSON to " + req.URL.Path - if wrap == nil { - msg = msg + ": " + string(contents) - } - - return contents, HTTPError{ - Code: res.StatusCode, - Message: msg, - WrappedError: wrap, - } - } - if err != nil { - return nil, err - } - - if resBody != nil { - if err = json.Unmarshal(contents, &resBody); err != nil { - return nil, err - } - } - - return contents, nil -} - -// CreateFilter makes an HTTP request according to http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-user-userid-filter -func (cli *Client) CreateFilter(filter json.RawMessage) (resp *RespCreateFilter, err error) { - urlPath := cli.BuildURL("user", cli.UserID, "filter") - _, err = cli.MakeRequest("POST", urlPath, &filter, &resp) - return -} - -// SyncRequest makes an HTTP request according to http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-sync -func (cli *Client) SyncRequest(timeout int, since, filterID string, fullState bool, setPresence string) (resp *RespSync, err error) { - query := map[string]string{ - "timeout": strconv.Itoa(timeout), - } - if since != "" { - query["since"] = since - } - if filterID != "" { - query["filter"] = filterID - } - if setPresence != "" { - query["set_presence"] = setPresence - } - if fullState { - query["full_state"] = "true" - } - urlPath := cli.BuildURLWithQuery([]string{"sync"}, query) - _, err = cli.MakeRequest("GET", urlPath, nil, &resp) - return -} - -func (cli *Client) register(u string, req *ReqRegister) (resp *RespRegister, uiaResp *RespUserInteractive, err error) { - var bodyBytes []byte - bodyBytes, err = cli.MakeRequest("POST", u, req, nil) - if err != nil { - httpErr, ok := err.(HTTPError) - if !ok { // network error - return - } - if httpErr.Code == 401 { - // body should be RespUserInteractive, if it isn't, fail with the error - err = json.Unmarshal(bodyBytes, &uiaResp) - return - } - return - } - // body should be RespRegister - err = json.Unmarshal(bodyBytes, &resp) - return -} - -// Register makes an HTTP request according to http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register -// -// Registers with kind=user. For kind=guest, see RegisterGuest. -func (cli *Client) Register(req *ReqRegister) (*RespRegister, *RespUserInteractive, error) { - u := cli.BuildURL("register") - return cli.register(u, req) -} - -// RegisterGuest makes an HTTP request according to http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register -// with kind=guest. -// -// For kind=user, see Register. -func (cli *Client) RegisterGuest(req *ReqRegister) (*RespRegister, *RespUserInteractive, error) { - query := map[string]string{ - "kind": "guest", - } - u := cli.BuildURLWithQuery([]string{"register"}, query) - return cli.register(u, req) -} - -// RegisterDummy performs m.login.dummy registration according to https://matrix.org/docs/spec/client_server/r0.2.0.html#dummy-auth -// -// Only a username and password need to be provided on the ReqRegister struct. Most local/developer homeservers will allow registration -// this way. If the homeserver does not, an error is returned. -// -// This does not set credentials on the client instance. See SetCredentials() instead. -// -// res, err := cli.RegisterDummy(&gomatrix.ReqRegister{ -// Username: "alice", -// Password: "wonderland", -// }) -// if err != nil { -// panic(err) -// } -// token := res.AccessToken -func (cli *Client) RegisterDummy(req *ReqRegister) (*RespRegister, error) { - res, uia, err := cli.Register(req) - if err != nil && uia == nil { - return nil, err - } - if uia != nil && uia.HasSingleStageFlow("m.login.dummy") { - req.Auth = struct { - Type string `json:"type"` - Session string `json:"session,omitempty"` - }{"m.login.dummy", uia.Session} - res, _, err = cli.Register(req) - if err != nil { - return nil, err - } - } - if res == nil { - return nil, fmt.Errorf("registration failed: does this server support m.login.dummy?") - } - return res, nil -} - -// Login a user to the homeserver according to http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-login -// This does not set credentials on this client instance. See SetCredentials() instead. -func (cli *Client) Login(req *ReqLogin) (resp *RespLogin, err error) { - urlPath := cli.BuildURL("login") - _, err = cli.MakeRequest("POST", urlPath, req, &resp) - return -} - -// Logout the current user. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-logout -// This does not clear the credentials from the client instance. See ClearCredentials() instead. -func (cli *Client) Logout() (resp *RespLogout, err error) { - urlPath := cli.BuildURL("logout") - _, err = cli.MakeRequest("POST", urlPath, nil, &resp) - return -} - -// Versions returns the list of supported Matrix versions on this homeserver. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions -func (cli *Client) Versions() (resp *RespVersions, err error) { - urlPath := cli.BuildBaseURL("_matrix", "client", "versions") - _, err = cli.MakeRequest("GET", urlPath, nil, &resp) - return -} - -// JoinRoom joins the client to a room ID or alias. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-join-roomidoralias -// -// If serverName is specified, this will be added as a query param to instruct the homeserver to join via that server. If content is specified, it will -// be JSON encoded and used as the request body. -func (cli *Client) JoinRoom(roomIDorAlias, serverName string, content interface{}) (resp *RespJoinRoom, err error) { - var urlPath string - if serverName != "" { - urlPath = cli.BuildURLWithQuery([]string{"join", roomIDorAlias}, map[string]string{ - "server_name": serverName, - }) - } else { - urlPath = cli.BuildURL("join", roomIDorAlias) - } - _, err = cli.MakeRequest("POST", urlPath, content, &resp) - return -} - -// GetDisplayName returns the display name of the user from the specified MXID. See https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-displayname -func (cli *Client) GetDisplayName(mxid string) (resp *RespUserDisplayName, err error) { - urlPath := cli.BuildURL("profile", mxid, "displayname") - _, err = cli.MakeRequest("GET", urlPath, nil, &resp) - return -} - -// GetOwnDisplayName returns the user's display name. See https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-displayname -func (cli *Client) GetOwnDisplayName() (resp *RespUserDisplayName, err error) { - urlPath := cli.BuildURL("profile", cli.UserID, "displayname") - _, err = cli.MakeRequest("GET", urlPath, nil, &resp) - return -} - -// SetDisplayName sets the user's profile display name. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-profile-userid-displayname -func (cli *Client) SetDisplayName(displayName string) (err error) { - urlPath := cli.BuildURL("profile", cli.UserID, "displayname") - s := struct { - DisplayName string `json:"displayname"` - }{displayName} - _, err = cli.MakeRequest("PUT", urlPath, &s, nil) - return -} - -// GetAvatarURL gets the user's avatar URL. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-avatar-url -func (cli *Client) GetAvatarURL() (url string, err error) { - urlPath := cli.BuildURL("profile", cli.UserID, "avatar_url") - s := struct { - AvatarURL string `json:"avatar_url"` - }{} - - _, err = cli.MakeRequest("GET", urlPath, nil, &s) - if err != nil { - return "", err - } - - return s.AvatarURL, nil -} - -// SetAvatarURL sets the user's avatar URL. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-profile-userid-avatar-url -func (cli *Client) SetAvatarURL(url string) (err error) { - urlPath := cli.BuildURL("profile", cli.UserID, "avatar_url") - s := struct { - AvatarURL string `json:"avatar_url"` - }{url} - _, err = cli.MakeRequest("PUT", urlPath, &s, nil) - if err != nil { - return err - } - - return nil -} - -// SendMessageEvent sends a message event into a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid -// contentJSON should be a pointer to something that can be encoded as JSON using json.Marshal. -func (cli *Client) SendMessageEvent(roomID string, eventType string, contentJSON interface{}) (resp *RespSendEvent, err error) { - txnID := txnID() - urlPath := cli.BuildURL("rooms", roomID, "send", eventType, txnID) - _, err = cli.MakeRequest("PUT", urlPath, contentJSON, &resp) - return -} - -// SendStateEvent sends a state event into a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey -// contentJSON should be a pointer to something that can be encoded as JSON using json.Marshal. -func (cli *Client) SendStateEvent(roomID, eventType, stateKey string, contentJSON interface{}) (resp *RespSendEvent, err error) { - urlPath := cli.BuildURL("rooms", roomID, "state", eventType, stateKey) - _, err = cli.MakeRequest("PUT", urlPath, contentJSON, &resp) - return -} - -// SendText sends an m.room.message event into the given room with a msgtype of m.text -// See http://matrix.org/docs/spec/client_server/r0.2.0.html#m-text -func (cli *Client) SendText(roomID, text string) (*RespSendEvent, error) { - return cli.SendMessageEvent(roomID, "m.room.message", - TextMessage{"m.text", text}) -} - -// SendImage sends an m.room.message event into the given room with a msgtype of m.image -// See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-image -func (cli *Client) SendImage(roomID, body, url string) (*RespSendEvent, error) { - return cli.SendMessageEvent(roomID, "m.room.message", - ImageMessage{ - MsgType: "m.image", - Body: body, - URL: url, - }) -} - -// SendVideo sends an m.room.message event into the given room with a msgtype of m.video -// See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-video -func (cli *Client) SendVideo(roomID, body, url string) (*RespSendEvent, error) { - return cli.SendMessageEvent(roomID, "m.room.message", - VideoMessage{ - MsgType: "m.video", - Body: body, - URL: url, - }) -} - -// SendNotice sends an m.room.message event into the given room with a msgtype of m.notice -// See http://matrix.org/docs/spec/client_server/r0.2.0.html#m-notice -func (cli *Client) SendNotice(roomID, text string) (*RespSendEvent, error) { - return cli.SendMessageEvent(roomID, "m.room.message", - TextMessage{"m.notice", text}) -} - -// RedactEvent redacts the given event. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid -func (cli *Client) RedactEvent(roomID, eventID string, req *ReqRedact) (resp *RespSendEvent, err error) { - txnID := txnID() - urlPath := cli.BuildURL("rooms", roomID, "redact", eventID, txnID) - _, err = cli.MakeRequest("PUT", urlPath, req, &resp) - return -} - -// CreateRoom creates a new Matrix room. See https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom -// resp, err := cli.CreateRoom(&gomatrix.ReqCreateRoom{ -// Preset: "public_chat", -// }) -// fmt.Println("Room:", resp.RoomID) -func (cli *Client) CreateRoom(req *ReqCreateRoom) (resp *RespCreateRoom, err error) { - urlPath := cli.BuildURL("createRoom") - _, err = cli.MakeRequest("POST", urlPath, req, &resp) - return -} - -// LeaveRoom leaves the given room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-leave -func (cli *Client) LeaveRoom(roomID string) (resp *RespLeaveRoom, err error) { - u := cli.BuildURL("rooms", roomID, "leave") - _, err = cli.MakeRequest("POST", u, struct{}{}, &resp) - return -} - -// ForgetRoom forgets a room entirely. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-forget -func (cli *Client) ForgetRoom(roomID string) (resp *RespForgetRoom, err error) { - u := cli.BuildURL("rooms", roomID, "forget") - _, err = cli.MakeRequest("POST", u, struct{}{}, &resp) - return -} - -// InviteUser invites a user to a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite -func (cli *Client) InviteUser(roomID string, req *ReqInviteUser) (resp *RespInviteUser, err error) { - u := cli.BuildURL("rooms", roomID, "invite") - _, err = cli.MakeRequest("POST", u, struct{}{}, &resp) - return -} - -// InviteUserByThirdParty invites a third-party identifier to a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#invite-by-third-party-id-endpoint -func (cli *Client) InviteUserByThirdParty(roomID string, req *ReqInvite3PID) (resp *RespInviteUser, err error) { - u := cli.BuildURL("rooms", roomID, "invite") - _, err = cli.MakeRequest("POST", u, req, &resp) - return -} - -// KickUser kicks a user from a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-kick -func (cli *Client) KickUser(roomID string, req *ReqKickUser) (resp *RespKickUser, err error) { - u := cli.BuildURL("rooms", roomID, "kick") - _, err = cli.MakeRequest("POST", u, req, &resp) - return -} - -// BanUser bans a user from a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-ban -func (cli *Client) BanUser(roomID string, req *ReqBanUser) (resp *RespBanUser, err error) { - u := cli.BuildURL("rooms", roomID, "ban") - _, err = cli.MakeRequest("POST", u, req, &resp) - return -} - -// UnbanUser unbans a user from a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-unban -func (cli *Client) UnbanUser(roomID string, req *ReqUnbanUser) (resp *RespUnbanUser, err error) { - u := cli.BuildURL("rooms", roomID, "unban") - _, err = cli.MakeRequest("POST", u, req, &resp) - return -} - -// UserTyping sets the typing status of the user. See https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid -func (cli *Client) UserTyping(roomID string, typing bool, timeout int64) (resp *RespTyping, err error) { - req := ReqTyping{Typing: typing, Timeout: timeout} - u := cli.BuildURL("rooms", roomID, "typing", cli.UserID) - _, err = cli.MakeRequest("PUT", u, req, &resp) - return -} - -// StateEvent gets a single state event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with -// the HTTP response body, or return an error. -// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey -func (cli *Client) StateEvent(roomID, eventType, stateKey string, outContent interface{}) (err error) { - u := cli.BuildURL("rooms", roomID, "state", eventType, stateKey) - _, err = cli.MakeRequest("GET", u, nil, outContent) - return -} - -// UploadLink uploads an HTTP URL and then returns an MXC URI. -func (cli *Client) UploadLink(link string) (*RespMediaUpload, error) { - res, err := cli.Client.Get(link) - if res != nil { - defer res.Body.Close() - } - if err != nil { - return nil, err - } - return cli.UploadToContentRepo(res.Body, res.Header.Get("Content-Type"), res.ContentLength) -} - -// UploadToContentRepo uploads the given bytes to the content repository and returns an MXC URI. -// See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-media-r0-upload -func (cli *Client) UploadToContentRepo(content io.Reader, contentType string, contentLength int64) (*RespMediaUpload, error) { - req, err := http.NewRequest("POST", cli.BuildBaseURL("_matrix/media/r0/upload"), content) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", contentType) - req.ContentLength = contentLength - res, err := cli.Client.Do(req) - if res != nil { - defer res.Body.Close() - } - if err != nil { - return nil, err - } - if res.StatusCode != 200 { - contents, err := ioutil.ReadAll(res.Body) - if err != nil { - return nil, HTTPError{ - Message: "Upload request failed - Failed to read response body: " + err.Error(), - Code: res.StatusCode, - } - } - return nil, HTTPError{ - Message: "Upload request failed: " + string(contents), - Code: res.StatusCode, - } - } - var m RespMediaUpload - if err := json.NewDecoder(res.Body).Decode(&m); err != nil { - return nil, err - } - return &m, nil -} - -// JoinedMembers returns a map of joined room members. See TODO-SPEC. https://github.com/matrix-org/synapse/pull/1680 -// -// In general, usage of this API is discouraged in favour of /sync, as calling this API can race with incoming membership changes. -// This API is primarily designed for application services which may want to efficiently look up joined members in a room. -func (cli *Client) JoinedMembers(roomID string) (resp *RespJoinedMembers, err error) { - u := cli.BuildURL("rooms", roomID, "joined_members") - _, err = cli.MakeRequest("GET", u, nil, &resp) - return -} - -// JoinedRooms returns a list of rooms which the client is joined to. See TODO-SPEC. https://github.com/matrix-org/synapse/pull/1680 -// -// In general, usage of this API is discouraged in favour of /sync, as calling this API can race with incoming membership changes. -// This API is primarily designed for application services which may want to efficiently look up joined rooms. -func (cli *Client) JoinedRooms() (resp *RespJoinedRooms, err error) { - u := cli.BuildURL("joined_rooms") - _, err = cli.MakeRequest("GET", u, nil, &resp) - return -} - -// Messages returns a list of message and state events for a room. It uses -// pagination query parameters to paginate history in the room. -// See https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-messages -func (cli *Client) Messages(roomID, from, to string, dir rune, limit int) (resp *RespMessages, err error) { - query := map[string]string{ - "from": from, - "dir": string(dir), - } - if to != "" { - query["to"] = to - } - if limit != 0 { - query["limit"] = strconv.Itoa(limit) - } - - urlPath := cli.BuildURLWithQuery([]string{"rooms", roomID, "messages"}, query) - _, err = cli.MakeRequest("GET", urlPath, nil, &resp) - return -} - -// TurnServer returns turn server details and credentials for the client to use when initiating calls. -// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-voip-turnserver -func (cli *Client) TurnServer() (resp *RespTurnServer, err error) { - urlPath := cli.BuildURL("voip", "turnServer") - _, err = cli.MakeRequest("GET", urlPath, nil, &resp) - return -} - -func txnID() string { - return "go" + strconv.FormatInt(time.Now().UnixNano(), 10) -} - -// NewClient creates a new Matrix Client ready for syncing -func NewClient(homeserverURL, userID, accessToken string) (*Client, error) { - hsURL, err := url.Parse(homeserverURL) - if err != nil { - return nil, err - } - // By default, use an in-memory store which will never save filter ids / next batch tokens to disk. - // The client will work with this storer: it just won't remember across restarts. - // In practice, a database backend should be used. - store := NewInMemoryStore() - cli := Client{ - AccessToken: accessToken, - HomeserverURL: hsURL, - UserID: userID, - Prefix: "/_matrix/client/r0", - Syncer: NewDefaultSyncer(userID, store), - Store: store, - } - // By default, use the default HTTP client. - cli.Client = http.DefaultClient - - return &cli, nil -} diff --git a/vendor/github.com/matrix-org/gomatrix/events.go b/vendor/github.com/matrix-org/gomatrix/events.go deleted file mode 100644 index 7427740e..00000000 --- a/vendor/github.com/matrix-org/gomatrix/events.go +++ /dev/null @@ -1,101 +0,0 @@ -package gomatrix - -import ( - "html" - "regexp" -) - -// Event represents a single Matrix event. -type Event struct { - StateKey *string `json:"state_key,omitempty"` // The state key for the event. Only present on State Events. - Sender string `json:"sender"` // The user ID of the sender of the event - Type string `json:"type"` // The event type - Timestamp int64 `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server - ID string `json:"event_id"` // The unique ID of this event - RoomID string `json:"room_id"` // The room the event was sent to. May be nil (e.g. for presence) - Content map[string]interface{} `json:"content"` // The JSON content of the event. -} - -// Body returns the value of the "body" key in the event content if it is -// present and is a string. -func (event *Event) Body() (body string, ok bool) { - value, exists := event.Content["body"] - if !exists { - return - } - body, ok = value.(string) - return -} - -// MessageType returns the value of the "msgtype" key in the event content if -// it is present and is a string. -func (event *Event) MessageType() (msgtype string, ok bool) { - value, exists := event.Content["msgtype"] - if !exists { - return - } - msgtype, ok = value.(string) - return -} - -// TextMessage is the contents of a Matrix formated message event. -type TextMessage struct { - MsgType string `json:"msgtype"` - Body string `json:"body"` -} - -// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image -type ImageInfo struct { - Height uint `json:"h,omitempty"` - Width uint `json:"w,omitempty"` - Mimetype string `json:"mimetype,omitempty"` - Size uint `json:"size,omitempty"` -} - -// VideoInfo contains info about a video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video -type VideoInfo struct { - Mimetype string `json:"mimetype,omitempty"` - ThumbnailInfo ImageInfo `json:"thumbnail_info"` - ThumbnailURL string `json:"thumbnail_url,omitempty"` - Height uint `json:"h,omitempty"` - Width uint `json:"w,omitempty"` - Duration uint `json:"duration,omitempty"` - Size uint `json:"size,omitempty"` -} - -// VideoMessage is an m.video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video -type VideoMessage struct { - MsgType string `json:"msgtype"` - Body string `json:"body"` - URL string `json:"url"` - Info VideoInfo `json:"info"` -} - -// ImageMessage is an m.image event -type ImageMessage struct { - MsgType string `json:"msgtype"` - Body string `json:"body"` - URL string `json:"url"` - Info ImageInfo `json:"info"` -} - -// An HTMLMessage is the contents of a Matrix HTML formated message event. -type HTMLMessage struct { - Body string `json:"body"` - MsgType string `json:"msgtype"` - Format string `json:"format"` - FormattedBody string `json:"formatted_body"` -} - -var htmlRegex = regexp.MustCompile("<[^<]+?>") - -// GetHTMLMessage returns an HTMLMessage with the body set to a stripped version of the provided HTML, in addition -// to the provided HTML. -func GetHTMLMessage(msgtype, htmlText string) HTMLMessage { - return HTMLMessage{ - Body: html.UnescapeString(htmlRegex.ReplaceAllLiteralString(htmlText, "")), - MsgType: msgtype, - Format: "org.matrix.custom.html", - FormattedBody: htmlText, - } -} diff --git a/vendor/github.com/matrix-org/gomatrix/filter.go b/vendor/github.com/matrix-org/gomatrix/filter.go deleted file mode 100644 index e4e76287..00000000 --- a/vendor/github.com/matrix-org/gomatrix/filter.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 Jan Christian Grünhage -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gomatrix - -//Filter is used by clients to specify how the server should filter responses to e.g. sync requests -//Specified by: https://matrix.org/docs/spec/client_server/r0.2.0.html#filtering -type Filter struct { - AccountData FilterPart `json:"account_data,omitempty"` - EventFields []string `json:"event_fields,omitempty"` - EventFormat string `json:"event_format,omitempty"` - Presence FilterPart `json:"presence,omitempty"` - Room struct { - AccountData FilterPart `json:"account_data,omitempty"` - Ephemeral FilterPart `json:"ephemeral,omitempty"` - IncludeLeave bool `json:"include_leave,omitempty"` - NotRooms []string `json:"not_rooms,omitempty"` - Rooms []string `json:"rooms,omitempty"` - State FilterPart `json:"state,omitempty"` - Timeline FilterPart `json:"timeline,omitempty"` - } `json:"room,omitempty"` -} - -type FilterPart struct { - NotRooms []string `json:"not_rooms,omitempty"` - Rooms []string `json:"rooms,omitempty"` - Limit *int `json:"limit,omitempty"` - NotSenders []string `json:"not_senders,omitempty"` - NotTypes []string `json:"not_types,omitempty"` - Senders []string `json:"senders,omitempty"` - Types []string `json:"types,omitempty"` -} diff --git a/vendor/github.com/matrix-org/gomatrix/requests.go b/vendor/github.com/matrix-org/gomatrix/requests.go deleted file mode 100644 index af99a226..00000000 --- a/vendor/github.com/matrix-org/gomatrix/requests.go +++ /dev/null @@ -1,78 +0,0 @@ -package gomatrix - -// ReqRegister is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register -type ReqRegister struct { - Username string `json:"username,omitempty"` - BindEmail bool `json:"bind_email,omitempty"` - Password string `json:"password,omitempty"` - DeviceID string `json:"device_id,omitempty"` - InitialDeviceDisplayName string `json:"initial_device_display_name"` - Auth interface{} `json:"auth,omitempty"` -} - -// ReqLogin is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-login -type ReqLogin struct { - Type string `json:"type"` - Password string `json:"password,omitempty"` - Medium string `json:"medium,omitempty"` - User string `json:"user,omitempty"` - Address string `json:"address,omitempty"` - Token string `json:"token,omitempty"` - DeviceID string `json:"device_id,omitempty"` - InitialDeviceDisplayName string `json:"initial_device_display_name,omitempty"` -} - -// ReqCreateRoom is the JSON request for https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom -type ReqCreateRoom struct { - Visibility string `json:"visibility,omitempty"` - RoomAliasName string `json:"room_alias_name,omitempty"` - Name string `json:"name,omitempty"` - Topic string `json:"topic,omitempty"` - Invite []string `json:"invite,omitempty"` - Invite3PID []ReqInvite3PID `json:"invite_3pid,omitempty"` - CreationContent map[string]interface{} `json:"creation_content,omitempty"` - InitialState []Event `json:"initial_state,omitempty"` - Preset string `json:"preset,omitempty"` - IsDirect bool `json:"is_direct,omitempty"` -} - -// ReqRedact is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid -type ReqRedact struct { - Reason string `json:"reason,omitempty"` -} - -// ReqInvite3PID is the JSON request for https://matrix.org/docs/spec/client_server/r0.2.0.html#id57 -// It is also a JSON object used in https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom -type ReqInvite3PID struct { - IDServer string `json:"id_server"` - Medium string `json:"medium"` - Address string `json:"address"` -} - -// ReqInviteUser is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite -type ReqInviteUser struct { - UserID string `json:"user_id"` -} - -// ReqKickUser is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-kick -type ReqKickUser struct { - Reason string `json:"reason,omitempty"` - UserID string `json:"user_id"` -} - -// ReqBanUser is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-ban -type ReqBanUser struct { - Reason string `json:"reason,omitempty"` - UserID string `json:"user_id"` -} - -// ReqUnbanUser is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-unban -type ReqUnbanUser struct { - UserID string `json:"user_id"` -} - -// ReqTyping is the JSON request for https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid -type ReqTyping struct { - Typing bool `json:"typing"` - Timeout int64 `json:"timeout"` -} diff --git a/vendor/github.com/matrix-org/gomatrix/responses.go b/vendor/github.com/matrix-org/gomatrix/responses.go deleted file mode 100644 index fe0eeb32..00000000 --- a/vendor/github.com/matrix-org/gomatrix/responses.go +++ /dev/null @@ -1,176 +0,0 @@ -package gomatrix - -// RespError is the standard JSON error response from Homeservers. It also implements the Golang "error" interface. -// See http://matrix.org/docs/spec/client_server/r0.2.0.html#api-standards -type RespError struct { - ErrCode string `json:"errcode"` - Err string `json:"error"` -} - -// Error returns the errcode and error message. -func (e RespError) Error() string { - return e.ErrCode + ": " + e.Err -} - -// RespCreateFilter is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-user-userid-filter -type RespCreateFilter struct { - FilterID string `json:"filter_id"` -} - -// RespVersions is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions -type RespVersions struct { - Versions []string `json:"versions"` -} - -// RespJoinRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-join -type RespJoinRoom struct { - RoomID string `json:"room_id"` -} - -// RespLeaveRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-leave -type RespLeaveRoom struct{} - -// RespForgetRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-forget -type RespForgetRoom struct{} - -// RespInviteUser is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite -type RespInviteUser struct{} - -// RespKickUser is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-kick -type RespKickUser struct{} - -// RespBanUser is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-ban -type RespBanUser struct{} - -// RespUnbanUser is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-unban -type RespUnbanUser struct{} - -// RespTyping is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid -type RespTyping struct{} - -// RespJoinedRooms is the JSON response for TODO-SPEC https://github.com/matrix-org/synapse/pull/1680 -type RespJoinedRooms struct { - JoinedRooms []string `json:"joined_rooms"` -} - -// RespJoinedMembers is the JSON response for TODO-SPEC https://github.com/matrix-org/synapse/pull/1680 -type RespJoinedMembers struct { - Joined map[string]struct { - DisplayName *string `json:"display_name"` - AvatarURL *string `json:"avatar_url"` - } `json:"joined"` -} - -// RespMessages is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-messages -type RespMessages struct { - Start string `json:"start"` - Chunk []Event `json:"chunk"` - End string `json:"end"` -} - -// RespSendEvent is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid -type RespSendEvent struct { - EventID string `json:"event_id"` -} - -// RespMediaUpload is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-media-r0-upload -type RespMediaUpload struct { - ContentURI string `json:"content_uri"` -} - -// RespUserInteractive is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#user-interactive-authentication-api -type RespUserInteractive struct { - Flows []struct { - Stages []string `json:"stages"` - } `json:"flows"` - Params map[string]interface{} `json:"params"` - Session string `json:"string"` - Completed []string `json:"completed"` - ErrCode string `json:"errcode"` - Error string `json:"error"` -} - -// HasSingleStageFlow returns true if there exists at least 1 Flow with a single stage of stageName. -func (r RespUserInteractive) HasSingleStageFlow(stageName string) bool { - for _, f := range r.Flows { - if len(f.Stages) == 1 && f.Stages[0] == stageName { - return true - } - } - return false -} - -// RespUserDisplayName is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-displayname -type RespUserDisplayName struct { - DisplayName string `json:"displayname"` -} - -// RespRegister is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register -type RespRegister struct { - AccessToken string `json:"access_token"` - DeviceID string `json:"device_id"` - HomeServer string `json:"home_server"` - RefreshToken string `json:"refresh_token"` - UserID string `json:"user_id"` -} - -// RespLogin is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-login -type RespLogin struct { - AccessToken string `json:"access_token"` - DeviceID string `json:"device_id"` - HomeServer string `json:"home_server"` - UserID string `json:"user_id"` -} - -// RespLogout is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-logout -type RespLogout struct{} - -// RespCreateRoom is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom -type RespCreateRoom struct { - RoomID string `json:"room_id"` -} - -// RespSync is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-sync -type RespSync struct { - NextBatch string `json:"next_batch"` - AccountData struct { - Events []Event `json:"events"` - } `json:"account_data"` - Presence struct { - Events []Event `json:"events"` - } `json:"presence"` - Rooms struct { - Leave map[string]struct { - State struct { - Events []Event `json:"events"` - } `json:"state"` - Timeline struct { - Events []Event `json:"events"` - Limited bool `json:"limited"` - PrevBatch string `json:"prev_batch"` - } `json:"timeline"` - } `json:"leave"` - Join map[string]struct { - State struct { - Events []Event `json:"events"` - } `json:"state"` - Timeline struct { - Events []Event `json:"events"` - Limited bool `json:"limited"` - PrevBatch string `json:"prev_batch"` - } `json:"timeline"` - } `json:"join"` - Invite map[string]struct { - State struct { - Events []Event - } `json:"invite_state"` - } `json:"invite"` - } `json:"rooms"` -} - -type RespTurnServer struct { - Username string `json:"username"` - Password string `json:"password"` - TTL int `json:"ttl"` - URIs []string `json:"uris"` -} diff --git a/vendor/github.com/matrix-org/gomatrix/room.go b/vendor/github.com/matrix-org/gomatrix/room.go deleted file mode 100644 index c9b2351f..00000000 --- a/vendor/github.com/matrix-org/gomatrix/room.go +++ /dev/null @@ -1,50 +0,0 @@ -package gomatrix - -// Room represents a single Matrix room. -type Room struct { - ID string - State map[string]map[string]*Event -} - -// UpdateState updates the room's current state with the given Event. This will clobber events based -// on the type/state_key combination. -func (room Room) UpdateState(event *Event) { - _, exists := room.State[event.Type] - if !exists { - room.State[event.Type] = make(map[string]*Event) - } - room.State[event.Type][*event.StateKey] = event -} - -// GetStateEvent returns the state event for the given type/state_key combo, or nil. -func (room Room) GetStateEvent(eventType string, stateKey string) *Event { - stateEventMap, _ := room.State[eventType] - event, _ := stateEventMap[stateKey] - return event -} - -// GetMembershipState returns the membership state of the given user ID in this room. If there is -// no entry for this member, 'leave' is returned for consistency with left users. -func (room Room) GetMembershipState(userID string) string { - state := "leave" - event := room.GetStateEvent("m.room.member", userID) - if event != nil { - membershipState, found := event.Content["membership"] - if found { - mState, isString := membershipState.(string) - if isString { - state = mState - } - } - } - return state -} - -// NewRoom creates a new Room with the given ID -func NewRoom(roomID string) *Room { - // Init the State map and return a pointer to the Room - return &Room{ - ID: roomID, - State: make(map[string]map[string]*Event), - } -} diff --git a/vendor/github.com/matrix-org/gomatrix/store.go b/vendor/github.com/matrix-org/gomatrix/store.go deleted file mode 100644 index 6dc687e5..00000000 --- a/vendor/github.com/matrix-org/gomatrix/store.go +++ /dev/null @@ -1,65 +0,0 @@ -package gomatrix - -// Storer is an interface which must be satisfied to store client data. -// -// You can either write a struct which persists this data to disk, or you can use the -// provided "InMemoryStore" which just keeps data around in-memory which is lost on -// restarts. -type Storer interface { - SaveFilterID(userID, filterID string) - LoadFilterID(userID string) string - SaveNextBatch(userID, nextBatchToken string) - LoadNextBatch(userID string) string - SaveRoom(room *Room) - LoadRoom(roomID string) *Room -} - -// InMemoryStore implements the Storer interface. -// -// Everything is persisted in-memory as maps. It is not safe to load/save filter IDs -// or next batch tokens on any goroutine other than the syncing goroutine: the one -// which called Client.Sync(). -type InMemoryStore struct { - Filters map[string]string - NextBatch map[string]string - Rooms map[string]*Room -} - -// SaveFilterID to memory. -func (s *InMemoryStore) SaveFilterID(userID, filterID string) { - s.Filters[userID] = filterID -} - -// LoadFilterID from memory. -func (s *InMemoryStore) LoadFilterID(userID string) string { - return s.Filters[userID] -} - -// SaveNextBatch to memory. -func (s *InMemoryStore) SaveNextBatch(userID, nextBatchToken string) { - s.NextBatch[userID] = nextBatchToken -} - -// LoadNextBatch from memory. -func (s *InMemoryStore) LoadNextBatch(userID string) string { - return s.NextBatch[userID] -} - -// SaveRoom to memory. -func (s *InMemoryStore) SaveRoom(room *Room) { - s.Rooms[room.ID] = room -} - -// LoadRoom from memory. -func (s *InMemoryStore) LoadRoom(roomID string) *Room { - return s.Rooms[roomID] -} - -// NewInMemoryStore constructs a new InMemoryStore. -func NewInMemoryStore() *InMemoryStore { - return &InMemoryStore{ - Filters: make(map[string]string), - NextBatch: make(map[string]string), - Rooms: make(map[string]*Room), - } -} diff --git a/vendor/github.com/matrix-org/gomatrix/sync.go b/vendor/github.com/matrix-org/gomatrix/sync.go deleted file mode 100644 index c4bea48c..00000000 --- a/vendor/github.com/matrix-org/gomatrix/sync.go +++ /dev/null @@ -1,164 +0,0 @@ -package gomatrix - -import ( - "encoding/json" - "fmt" - "runtime/debug" - "time" -) - -// Syncer represents an interface that must be satisfied in order to do /sync requests on a client. -type Syncer interface { - // Process the /sync response. The since parameter is the since= value that was used to produce the response. - // This is useful for detecting the very first sync (since=""). If an error is return, Syncing will be stopped - // permanently. - ProcessResponse(resp *RespSync, since string) error - // OnFailedSync returns either the time to wait before retrying or an error to stop syncing permanently. - OnFailedSync(res *RespSync, err error) (time.Duration, error) - // GetFilterJSON for the given user ID. NOT the filter ID. - GetFilterJSON(userID string) json.RawMessage -} - -// DefaultSyncer is the default syncing implementation. You can either write your own syncer, or selectively -// replace parts of this default syncer (e.g. the ProcessResponse method). The default syncer uses the observer -// pattern to notify callers about incoming events. See DefaultSyncer.OnEventType for more information. -type DefaultSyncer struct { - UserID string - Store Storer - listeners map[string][]OnEventListener // event type to listeners array -} - -// OnEventListener can be used with DefaultSyncer.OnEventType to be informed of incoming events. -type OnEventListener func(*Event) - -// NewDefaultSyncer returns an instantiated DefaultSyncer -func NewDefaultSyncer(userID string, store Storer) *DefaultSyncer { - return &DefaultSyncer{ - UserID: userID, - Store: store, - listeners: make(map[string][]OnEventListener), - } -} - -// ProcessResponse processes the /sync response in a way suitable for bots. "Suitable for bots" means a stream of -// unrepeating events. Returns a fatal error if a listener panics. -func (s *DefaultSyncer) ProcessResponse(res *RespSync, since string) (err error) { - if !s.shouldProcessResponse(res, since) { - return - } - - defer func() { - if r := recover(); r != nil { - err = fmt.Errorf("ProcessResponse panicked! userID=%s since=%s panic=%s\n%s", s.UserID, since, r, debug.Stack()) - } - }() - - for roomID, roomData := range res.Rooms.Join { - room := s.getOrCreateRoom(roomID) - for _, event := range roomData.State.Events { - event.RoomID = roomID - room.UpdateState(&event) - s.notifyListeners(&event) - } - for _, event := range roomData.Timeline.Events { - event.RoomID = roomID - s.notifyListeners(&event) - } - } - for roomID, roomData := range res.Rooms.Invite { - room := s.getOrCreateRoom(roomID) - for _, event := range roomData.State.Events { - event.RoomID = roomID - room.UpdateState(&event) - s.notifyListeners(&event) - } - } - for roomID, roomData := range res.Rooms.Leave { - room := s.getOrCreateRoom(roomID) - for _, event := range roomData.Timeline.Events { - if event.StateKey != nil { - event.RoomID = roomID - room.UpdateState(&event) - s.notifyListeners(&event) - } - } - } - return -} - -// OnEventType allows callers to be notified when there are new events for the given event type. -// There are no duplicate checks. -func (s *DefaultSyncer) OnEventType(eventType string, callback OnEventListener) { - _, exists := s.listeners[eventType] - if !exists { - s.listeners[eventType] = []OnEventListener{} - } - s.listeners[eventType] = append(s.listeners[eventType], callback) -} - -// shouldProcessResponse returns true if the response should be processed. May modify the response to remove -// stuff that shouldn't be processed. -func (s *DefaultSyncer) shouldProcessResponse(resp *RespSync, since string) bool { - if since == "" { - return false - } - // This is a horrible hack because /sync will return the most recent messages for a room - // as soon as you /join it. We do NOT want to process those events in that particular room - // because they may have already been processed (if you toggle the bot in/out of the room). - // - // Work around this by inspecting each room's timeline and seeing if an m.room.member event for us - // exists and is "join" and then discard processing that room entirely if so. - // TODO: We probably want to process messages from after the last join event in the timeline. - for roomID, roomData := range resp.Rooms.Join { - for i := len(roomData.Timeline.Events) - 1; i >= 0; i-- { - e := roomData.Timeline.Events[i] - if e.Type == "m.room.member" && e.StateKey != nil && *e.StateKey == s.UserID { - m := e.Content["membership"] - mship, ok := m.(string) - if !ok { - continue - } - if mship == "join" { - _, ok := resp.Rooms.Join[roomID] - if !ok { - continue - } - delete(resp.Rooms.Join, roomID) // don't re-process messages - delete(resp.Rooms.Invite, roomID) // don't re-process invites - break - } - } - } - } - return true -} - -// getOrCreateRoom must only be called by the Sync() goroutine which calls ProcessResponse() -func (s *DefaultSyncer) getOrCreateRoom(roomID string) *Room { - room := s.Store.LoadRoom(roomID) - if room == nil { // create a new Room - room = NewRoom(roomID) - s.Store.SaveRoom(room) - } - return room -} - -func (s *DefaultSyncer) notifyListeners(event *Event) { - listeners, exists := s.listeners[event.Type] - if !exists { - return - } - for _, fn := range listeners { - fn(event) - } -} - -// OnFailedSync always returns a 10 second wait period between failed /syncs, never a fatal error. -func (s *DefaultSyncer) OnFailedSync(res *RespSync, err error) (time.Duration, error) { - return 10 * time.Second, nil -} - -// GetFilterJSON returns a filter with a timeline limit of 50. -func (s *DefaultSyncer) GetFilterJSON(userID string) json.RawMessage { - return json.RawMessage(`{"room":{"timeline":{"limit":50}}}`) -} diff --git a/vendor/github.com/matrix-org/gomatrix/userids.go b/vendor/github.com/matrix-org/gomatrix/userids.go deleted file mode 100644 index 23e78072..00000000 --- a/vendor/github.com/matrix-org/gomatrix/userids.go +++ /dev/null @@ -1,130 +0,0 @@ -package gomatrix - -import ( - "bytes" - "encoding/hex" - "fmt" - "strings" -) - -const lowerhex = "0123456789abcdef" - -// encode the given byte using quoted-printable encoding (e.g "=2f") -// and writes it to the buffer -// See https://golang.org/src/mime/quotedprintable/writer.go -func encode(buf *bytes.Buffer, b byte) { - buf.WriteByte('=') - buf.WriteByte(lowerhex[b>>4]) - buf.WriteByte(lowerhex[b&0x0f]) -} - -// escape the given alpha character and writes it to the buffer -func escape(buf *bytes.Buffer, b byte) { - buf.WriteByte('_') - if b == '_' { - buf.WriteByte('_') // another _ - } else { - buf.WriteByte(b + 0x20) // ASCII shift A-Z to a-z - } -} - -func shouldEncode(b byte) bool { - return b != '-' && b != '.' && b != '_' && !(b >= '0' && b <= '9') && !(b >= 'a' && b <= 'z') && !(b >= 'A' && b <= 'Z') -} - -func shouldEscape(b byte) bool { - return (b >= 'A' && b <= 'Z') || b == '_' -} - -func isValidByte(b byte) bool { - return isValidEscapedChar(b) || (b >= '0' && b <= '9') || b == '.' || b == '=' || b == '-' -} - -func isValidEscapedChar(b byte) bool { - return b == '_' || (b >= 'a' && b <= 'z') -} - -// EncodeUserLocalpart encodes the given string into Matrix-compliant user ID localpart form. -// See http://matrix.org/docs/spec/intro.html#mapping-from-other-character-sets -// -// This returns a string with only the characters "a-z0-9._=-". The uppercase range A-Z -// are encoded using leading underscores ("_"). Characters outside the aforementioned ranges -// (including literal underscores ("_") and equals ("=")) are encoded as UTF8 code points (NOT NCRs) -// and converted to lower-case hex with a leading "=". For example: -// Alph@Bet_50up => _alph=40_bet=5f50up -func EncodeUserLocalpart(str string) string { - strBytes := []byte(str) - var outputBuffer bytes.Buffer - for _, b := range strBytes { - if shouldEncode(b) { - encode(&outputBuffer, b) - } else if shouldEscape(b) { - escape(&outputBuffer, b) - } else { - outputBuffer.WriteByte(b) - } - } - return outputBuffer.String() -} - -// DecodeUserLocalpart decodes the given string back into the original input string. -// Returns an error if the given string is not a valid user ID localpart encoding. -// See http://matrix.org/docs/spec/intro.html#mapping-from-other-character-sets -// -// This decodes quoted-printable bytes back into UTF8, and unescapes casing. For -// example: -// _alph=40_bet=5f50up => Alph@Bet_50up -// Returns an error if the input string contains characters outside the -// range "a-z0-9._=-", has an invalid quote-printable byte (e.g. not hex), or has -// an invalid _ escaped byte (e.g. "_5"). -func DecodeUserLocalpart(str string) (string, error) { - strBytes := []byte(str) - var outputBuffer bytes.Buffer - for i := 0; i < len(strBytes); i++ { - b := strBytes[i] - if !isValidByte(b) { - return "", fmt.Errorf("Byte pos %d: Invalid byte", i) - } - - if b == '_' { // next byte is a-z and should be upper-case or is another _ and should be a literal _ - if i+1 >= len(strBytes) { - return "", fmt.Errorf("Byte pos %d: expected _[a-z_] encoding but ran out of string", i) - } - if !isValidEscapedChar(strBytes[i+1]) { // invalid escaping - return "", fmt.Errorf("Byte pos %d: expected _[a-z_] encoding", i) - } - if strBytes[i+1] == '_' { - outputBuffer.WriteByte('_') - } else { - outputBuffer.WriteByte(strBytes[i+1] - 0x20) // ASCII shift a-z to A-Z - } - i++ // skip next byte since we just handled it - } else if b == '=' { // next 2 bytes are hex and should be buffered ready to be read as utf8 - if i+2 >= len(strBytes) { - return "", fmt.Errorf("Byte pos: %d: expected quote-printable encoding but ran out of string", i) - } - dst := make([]byte, 1) - _, err := hex.Decode(dst, strBytes[i+1:i+3]) - if err != nil { - return "", err - } - outputBuffer.WriteByte(dst[0]) - i += 2 // skip next 2 bytes since we just handled it - } else { // pass through - outputBuffer.WriteByte(b) - } - } - return outputBuffer.String(), nil -} - -// ExtractUserLocalpart extracts the localpart portion of a user ID. -// See http://matrix.org/docs/spec/intro.html#user-identifiers -func ExtractUserLocalpart(userID string) (string, error) { - if len(userID) == 0 || userID[0] != '@' { - return "", fmt.Errorf("%s is not a valid user id", userID) - } - return strings.TrimPrefix( - strings.SplitN(userID, ":", 2)[0], // @foo:bar:8448 => [ "@foo", "bar:8448" ] - "@", // remove "@" prefix - ), nil -} diff --git a/vendor/github.com/matterbridge/discordgo/.travis.yml b/vendor/github.com/matterbridge/discordgo/.travis.yml new file mode 100644 index 00000000..fe626fcf --- /dev/null +++ b/vendor/github.com/matterbridge/discordgo/.travis.yml @@ -0,0 +1,14 @@ +language: go +go: + - 1.7.x + - 1.8.x + - 1.9.x +install: + - go get github.com/bwmarrin/discordgo + - go get -v . + - go get -v github.com/golang/lint/golint +script: + - diff <(gofmt -d .) <(echo -n) + - go vet -x ./... + - golint -set_exit_status ./... + - go test -v -race ./... diff --git a/vendor/github.com/matterbridge/discordgo/README.md b/vendor/github.com/matterbridge/discordgo/README.md new file mode 100644 index 00000000..acc72bf1 --- /dev/null +++ b/vendor/github.com/matterbridge/discordgo/README.md @@ -0,0 +1,130 @@ +# DiscordGo + +[![GoDoc](https://godoc.org/github.com/bwmarrin/discordgo?status.svg)](https://godoc.org/github.com/bwmarrin/discordgo) [![Go report](http://goreportcard.com/badge/bwmarrin/discordgo)](http://goreportcard.com/report/bwmarrin/discordgo) [![Build Status](https://travis-ci.org/bwmarrin/discordgo.svg?branch=master)](https://travis-ci.org/bwmarrin/discordgo) [![Discord Gophers](https://img.shields.io/badge/Discord%20Gophers-%23discordgo-blue.svg)](https://discord.gg/0f1SbxBZjYoCtNPP) [![Discord API](https://img.shields.io/badge/Discord%20API-%23go_discordgo-blue.svg)](https://discord.gg/0SBTUU1wZTWT6sqd) + + + +DiscordGo is a [Go](https://golang.org/) package that provides low level +bindings to the [Discord](https://discordapp.com/) chat client API. DiscordGo +has nearly complete support for all of the Discord API endpoints, websocket +interface, and voice interface. + +If you would like to help the DiscordGo package please use +[this link](https://discordapp.com/oauth2/authorize?client_id=173113690092994561&scope=bot) +to add the official DiscordGo test bot **dgo** to your server. This provides +indispensable help to this project. + +* See [dgVoice](https://github.com/bwmarrin/dgvoice) package for an example of +additional voice helper functions and features for DiscordGo + +* See [dca](https://github.com/bwmarrin/dca) for an **experimental** stand alone +tool that wraps `ffmpeg` to create opus encoded audio appropriate for use with +Discord (and DiscordGo) + +**For help with this package or general Go discussion, please join the [Discord +Gophers](https://discord.gg/0f1SbxBZjYq9jLBk) chat server.** + +## Getting Started + +### master vs develop Branch +* The master branch represents the latest released version of DiscordGo. This +branch will always have a stable and tested version of the library. Each release +is tagged and you can easily download a specific release and view release notes +on the github [releases](https://github.com/bwmarrin/discordgo/releases) page. + +* The develop branch is where all development happens and almost always has +new features over the master branch. However breaking changes are frequently +added to develop and even sometimes bugs are introduced. Bugs get fixed and +the breaking changes get documented before pushing to master. + +*So, what should you use?* + +If you can accept the constant changing nature of *develop* then it is the +recommended branch to use. Otherwise, if you want to tail behind development +slightly and have a more stable package with documented releases then use *master* + +### Installing + +This assumes you already have a working Go environment, if not please see +[this page](https://golang.org/doc/install) first. + +`go get` *will always pull the latest released version from the master branch.* + +```sh +go get github.com/bwmarrin/discordgo +``` + +If you want to use the develop branch, follow these steps next. + +```sh +cd $GOPATH/src/github.com/bwmarrin/discordgo +git checkout develop +``` + +### Usage + +Import the package into your project. + +```go +import "github.com/bwmarrin/discordgo" +``` + +Construct a new Discord client which can be used to access the variety of +Discord API functions and to set callback functions for Discord events. + +```go +discord, err := discordgo.New("Bot " + "authentication token") +``` + +See Documentation and Examples below for more detailed information. + + +## Documentation + +**NOTICE** : This library and the Discord API are unfinished. +Because of that there may be major changes to library in the future. + +The DiscordGo code is fairly well documented at this point and is currently +the only documentation available. Both GoDoc and GoWalker (below) present +that information in a nice format. + +- [![GoDoc](https://godoc.org/github.com/bwmarrin/discordgo?status.svg)](https://godoc.org/github.com/bwmarrin/discordgo) +- [![Go Walker](http://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/bwmarrin/discordgo) +- Hand crafted documentation coming eventually. + + +## Examples + +Below is a list of examples and other projects using DiscordGo. Please submit +an issue if you would like your project added or removed from this list + +- [DiscordGo Examples](https://github.com/bwmarrin/discordgo/tree/master/examples) A collection of example programs written with DiscordGo +- [Awesome DiscordGo](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo) A curated list of high quality projects using DiscordGo + +## Troubleshooting +For help with common problems please reference the +[Troubleshooting](https://github.com/bwmarrin/discordgo/wiki/Troubleshooting) +section of the project wiki. + + +## Contributing +Contributions are very welcomed, however please follow the below guidelines. + +- First open an issue describing the bug or enhancement so it can be +discussed. +- Fork the develop branch and make your changes. +- Try to match current naming conventions as closely as possible. +- This package is intended to be a low level direct mapping of the Discord API +so please avoid adding enhancements outside of that scope without first +discussing it. +- Create a Pull Request with your changes against the develop branch. + + +## List of Discord APIs + +See [this chart](https://abal.moe/Discord/Libraries.html) for a feature +comparison and list of other Discord API libraries. + +## Special Thanks + +[Chris Rhodes](https://github.com/iopred) - For the DiscordGo logo and tons of PRs diff --git a/vendor/github.com/matterbridge/discordgo/examples/airhorn/main.go b/vendor/github.com/matterbridge/discordgo/examples/airhorn/main.go deleted file mode 100644 index 21ceb76b..00000000 --- a/vendor/github.com/matterbridge/discordgo/examples/airhorn/main.go +++ /dev/null @@ -1,211 +0,0 @@ -package main - -import ( - "encoding/binary" - "flag" - "fmt" - "io" - "os" - "os/signal" - "strings" - "syscall" - "time" - - "github.com/bwmarrin/discordgo" -) - -func init() { - flag.StringVar(&token, "t", "", "Bot Token") - flag.Parse() -} - -var token string -var buffer = make([][]byte, 0) - -func main() { - - if token == "" { - fmt.Println("No token provided. Please run: airhorn -t ") - return - } - - // Load the sound file. - err := loadSound() - if err != nil { - fmt.Println("Error loading sound: ", err) - fmt.Println("Please copy $GOPATH/src/github.com/bwmarrin/examples/airhorn/airhorn.dca to this directory.") - return - } - - // Create a new Discord session using the provided bot token. - dg, err := discordgo.New("Bot " + token) - if err != nil { - fmt.Println("Error creating Discord session: ", err) - return - } - - // Register ready as a callback for the ready events. - dg.AddHandler(ready) - - // Register messageCreate as a callback for the messageCreate events. - dg.AddHandler(messageCreate) - - // Register guildCreate as a callback for the guildCreate events. - dg.AddHandler(guildCreate) - - // Open the websocket and begin listening. - err = dg.Open() - if err != nil { - fmt.Println("Error opening Discord session: ", err) - } - - // Wait here until CTRL-C or other term signal is received. - fmt.Println("Airhorn is now running. Press CTRL-C to exit.") - sc := make(chan os.Signal, 1) - signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) - <-sc - - // Cleanly close down the Discord session. - dg.Close() -} - -// This function will be called (due to AddHandler above) when the bot receives -// the "ready" event from Discord. -func ready(s *discordgo.Session, event *discordgo.Ready) { - - // Set the playing status. - s.UpdateStatus(0, "!airhorn") -} - -// This function will be called (due to AddHandler above) every time a new -// message is created on any channel that the autenticated bot has access to. -func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { - - // Ignore all messages created by the bot itself - // This isn't required in this specific example but it's a good practice. - if m.Author.ID == s.State.User.ID { - return - } - - // check if the message is "!airhorn" - if strings.HasPrefix(m.Content, "!airhorn") { - - // Find the channel that the message came from. - c, err := s.State.Channel(m.ChannelID) - if err != nil { - // Could not find channel. - return - } - - // Find the guild for that channel. - g, err := s.State.Guild(c.GuildID) - if err != nil { - // Could not find guild. - return - } - - // Look for the message sender in that guild's current voice states. - for _, vs := range g.VoiceStates { - if vs.UserID == m.Author.ID { - err = playSound(s, g.ID, vs.ChannelID) - if err != nil { - fmt.Println("Error playing sound:", err) - } - - return - } - } - } -} - -// This function will be called (due to AddHandler above) every time a new -// guild is joined. -func guildCreate(s *discordgo.Session, event *discordgo.GuildCreate) { - - if event.Guild.Unavailable { - return - } - - for _, channel := range event.Guild.Channels { - if channel.ID == event.Guild.ID { - _, _ = s.ChannelMessageSend(channel.ID, "Airhorn is ready! Type !airhorn while in a voice channel to play a sound.") - return - } - } -} - -// loadSound attempts to load an encoded sound file from disk. -func loadSound() error { - - file, err := os.Open("airhorn.dca") - if err != nil { - fmt.Println("Error opening dca file :", err) - return err - } - - var opuslen int16 - - for { - // Read opus frame length from dca file. - err = binary.Read(file, binary.LittleEndian, &opuslen) - - // If this is the end of the file, just return. - if err == io.EOF || err == io.ErrUnexpectedEOF { - err := file.Close() - if err != nil { - return err - } - return nil - } - - if err != nil { - fmt.Println("Error reading from dca file :", err) - return err - } - - // Read encoded pcm from dca file. - InBuf := make([]byte, opuslen) - err = binary.Read(file, binary.LittleEndian, &InBuf) - - // Should not be any end of file errors - if err != nil { - fmt.Println("Error reading from dca file :", err) - return err - } - - // Append encoded pcm data to the buffer. - buffer = append(buffer, InBuf) - } -} - -// playSound plays the current buffer to the provided channel. -func playSound(s *discordgo.Session, guildID, channelID string) (err error) { - - // Join the provided voice channel. - vc, err := s.ChannelVoiceJoin(guildID, channelID, false, true) - if err != nil { - return err - } - - // Sleep for a specified amount of time before playing the sound - time.Sleep(250 * time.Millisecond) - - // Start speaking. - vc.Speaking(true) - - // Send the buffer data. - for _, buff := range buffer { - vc.OpusSend <- buff - } - - // Stop speaking - vc.Speaking(false) - - // Sleep for a specificed amount of time before ending. - time.Sleep(250 * time.Millisecond) - - // Disconnect from the provided voice channel. - vc.Disconnect() - - return nil -} diff --git a/vendor/github.com/matterbridge/discordgo/examples/appmaker/main.go b/vendor/github.com/matterbridge/discordgo/examples/appmaker/main.go deleted file mode 100644 index 5581dd93..00000000 --- a/vendor/github.com/matterbridge/discordgo/examples/appmaker/main.go +++ /dev/null @@ -1,103 +0,0 @@ -package main - -import ( - "encoding/json" - "flag" - "fmt" - "os" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line options -var ( - Token string - Name string - DeleteID string - ListOnly bool -) - -func init() { - - flag.StringVar(&Token, "t", "", "Owner Account Token") - flag.StringVar(&Name, "n", "", "Name to give App/Bot") - flag.StringVar(&DeleteID, "d", "", "Application ID to delete") - flag.BoolVar(&ListOnly, "l", false, "List Applications Only") - flag.Parse() - - if Token == "" { - flag.Usage() - os.Exit(1) - } -} - -func main() { - - var err error - - // Create a new Discord session using the provided login information. - dg, err := discordgo.New(Token) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // If -l set, only display a list of existing applications - // for the given account. - if ListOnly { - - aps, err := dg.Applications() - if err != nil { - fmt.Println("error fetching applications,", err) - return - } - - for _, v := range aps { - fmt.Println("-----------------------------------------------------") - b, _ := json.MarshalIndent(v, "", " ") - fmt.Println(string(b)) - } - return - } - - // if -d set, delete the given Application - if DeleteID != "" { - err = dg.ApplicationDelete(DeleteID) - if err != nil { - fmt.Println("error deleting application,", err) - } - return - } - - if Name == "" { - flag.Usage() - os.Exit(1) - } - - // Create a new application. - ap := &discordgo.Application{} - ap.Name = Name - ap, err = dg.ApplicationCreate(ap) - if err != nil { - fmt.Println("error creating new application,", err) - return - } - - fmt.Printf("Application created successfully:\n") - b, _ := json.MarshalIndent(ap, "", " ") - fmt.Println(string(b)) - - // Create the bot account under the application we just created - bot, err := dg.ApplicationBotCreate(ap.ID) - if err != nil { - fmt.Println("error creating bot account,", err) - return - } - - fmt.Printf("Bot account created successfully.\n") - b, _ = json.MarshalIndent(bot, "", " ") - fmt.Println(string(b)) - - fmt.Println("Please save the above posted info in a secure place.") - fmt.Println("You will need that information to login with your bot account.") -} diff --git a/vendor/github.com/matterbridge/discordgo/examples/avatar/main.go b/vendor/github.com/matterbridge/discordgo/examples/avatar/main.go deleted file mode 100644 index e0a9c880..00000000 --- a/vendor/github.com/matterbridge/discordgo/examples/avatar/main.go +++ /dev/null @@ -1,89 +0,0 @@ -package main - -import ( - "encoding/base64" - "flag" - "fmt" - "io/ioutil" - "net/http" - "os" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line parameters -var ( - Token string - AvatarFile string - AvatarURL string -) - -func init() { - - flag.StringVar(&Token, "t", "", "Bot Token") - flag.StringVar(&AvatarFile, "f", "", "Avatar File Name") - flag.StringVar(&AvatarURL, "u", "", "URL to the avatar image") - flag.Parse() - - if Token == "" || (AvatarFile == "" && AvatarURL == "") { - flag.Usage() - os.Exit(1) - } -} - -func main() { - - // Create a new Discord session using the provided login information. - dg, err := discordgo.New("Bot " + Token) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // Declare these here so they can be used in the below two if blocks and - // still carry over to the end of this function. - var base64img string - var contentType string - - // If we're using a URL link for the Avatar - if AvatarURL != "" { - - resp, err := http.Get(AvatarURL) - if err != nil { - fmt.Println("Error retrieving the file, ", err) - return - } - - defer func() { - _ = resp.Body.Close() - }() - - img, err := ioutil.ReadAll(resp.Body) - if err != nil { - fmt.Println("Error reading the response, ", err) - return - } - - contentType = http.DetectContentType(img) - base64img = base64.StdEncoding.EncodeToString(img) - } - - // If we're using a local file for the Avatar - if AvatarFile != "" { - img, err := ioutil.ReadFile(AvatarFile) - if err != nil { - fmt.Println(err) - } - - contentType = http.DetectContentType(img) - base64img = base64.StdEncoding.EncodeToString(img) - } - - // Now lets format our base64 image into the proper format Discord wants - // and then call UserUpdate to set it as our user's Avatar. - avatar := fmt.Sprintf("data:%s;base64,%s", contentType, base64img) - _, err = dg.UserUpdate("", "", "", avatar, "") - if err != nil { - fmt.Println(err) - } -} diff --git a/vendor/github.com/matterbridge/discordgo/examples/mytoken/main.go b/vendor/github.com/matterbridge/discordgo/examples/mytoken/main.go deleted file mode 100644 index 9375eadc..00000000 --- a/vendor/github.com/matterbridge/discordgo/examples/mytoken/main.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line parameters -var ( - Email string - Password string -) - -func init() { - - flag.StringVar(&Email, "e", "", "Account Email") - flag.StringVar(&Password, "p", "", "Account Password") - flag.Parse() - - if Email == "" || Password == "" { - flag.Usage() - os.Exit(1) - } -} - -func main() { - - // Create a new Discord session using the provided login information. - dg, err := discordgo.New(Email, Password) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // Print out your token. - fmt.Printf("Your Authentication Token is:\n\n%s\n", dg.Token) -} diff --git a/vendor/github.com/matterbridge/discordgo/examples/pingpong/main.go b/vendor/github.com/matterbridge/discordgo/examples/pingpong/main.go deleted file mode 100644 index 155e782f..00000000 --- a/vendor/github.com/matterbridge/discordgo/examples/pingpong/main.go +++ /dev/null @@ -1,71 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - "os/signal" - "syscall" - - "github.com/bwmarrin/discordgo" -) - -// Variables used for command line parameters -var ( - Token string -) - -func init() { - - flag.StringVar(&Token, "t", "", "Bot Token") - flag.Parse() -} - -func main() { - - // Create a new Discord session using the provided bot token. - dg, err := discordgo.New("Bot " + Token) - if err != nil { - fmt.Println("error creating Discord session,", err) - return - } - - // Register the messageCreate func as a callback for MessageCreate events. - dg.AddHandler(messageCreate) - - // Open a websocket connection to Discord and begin listening. - err = dg.Open() - if err != nil { - fmt.Println("error opening connection,", err) - return - } - - // Wait here until CTRL-C or other term signal is received. - fmt.Println("Bot is now running. Press CTRL-C to exit.") - sc := make(chan os.Signal, 1) - signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) - <-sc - - // Cleanly close down the Discord session. - dg.Close() -} - -// This function will be called (due to AddHandler above) every time a new -// message is created on any channel that the autenticated bot has access to. -func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { - - // Ignore all messages created by the bot itself - // This isn't required in this specific example but it's a good practice. - if m.Author.ID == s.State.User.ID { - return - } - // If the message is "ping" reply with "Pong!" - if m.Content == "ping" { - s.ChannelMessageSend(m.ChannelID, "Pong!") - } - - // If the message is "pong" reply with "Ping!" - if m.Content == "pong" { - s.ChannelMessageSend(m.ChannelID, "Ping!") - } -} diff --git a/vendor/github.com/matterbridge/discordgo/mkdocs.yml b/vendor/github.com/matterbridge/discordgo/mkdocs.yml new file mode 100644 index 00000000..3ee8eb37 --- /dev/null +++ b/vendor/github.com/matterbridge/discordgo/mkdocs.yml @@ -0,0 +1,17 @@ +site_name: DiscordGo +site_author: Bruce Marriner +site_url: http://bwmarrin.github.io/discordgo/ +repo_url: https://github.com/bwmarrin/discordgo + +dev_addr: 0.0.0.0:8000 +theme: yeti + +markdown_extensions: + - smarty + - toc: + permalink: True + - sane_lists + +pages: + - 'Home': 'index.md' + - 'Getting Started': 'GettingStarted.md' diff --git a/vendor/github.com/matterbridge/discordgo/tools/cmd/eventhandlers/main.go b/vendor/github.com/matterbridge/discordgo/tools/cmd/eventhandlers/main.go deleted file mode 100644 index 839f009d..00000000 --- a/vendor/github.com/matterbridge/discordgo/tools/cmd/eventhandlers/main.go +++ /dev/null @@ -1,124 +0,0 @@ -package main - -import ( - "bytes" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "log" - "path/filepath" - "regexp" - "sort" - "strings" - "text/template" -) - -var eventHandlerTmpl = template.Must(template.New("eventHandler").Funcs(template.FuncMap{ - "constName": constName, - "isDiscordEvent": isDiscordEvent, - "privateName": privateName, -}).Parse(`// Code generated by \"eventhandlers\"; DO NOT EDIT -// See events.go - -package discordgo - -// Following are all the event types. -// Event type values are used to match the events returned by Discord. -// EventTypes surrounded by __ are synthetic and are internal to DiscordGo. -const ({{range .}} - {{privateName .}}EventType = "{{constName .}}"{{end}} -) -{{range .}} -// {{privateName .}}EventHandler is an event handler for {{.}} events. -type {{privateName .}}EventHandler func(*Session, *{{.}}) - -// Type returns the event type for {{.}} events. -func (eh {{privateName .}}EventHandler) Type() string { - return {{privateName .}}EventType -} -{{if isDiscordEvent .}} -// New returns a new instance of {{.}}. -func (eh {{privateName .}}EventHandler) New() interface{} { - return &{{.}}{} -}{{end}} -// Handle is the handler for {{.}} events. -func (eh {{privateName .}}EventHandler) Handle(s *Session, i interface{}) { - if t, ok := i.(*{{.}}); ok { - eh(s, t) - } -} - -{{end}} -func handlerForInterface(handler interface{}) EventHandler { - switch v := handler.(type) { - case func(*Session, interface{}): - return interfaceEventHandler(v){{range .}} - case func(*Session, *{{.}}): - return {{privateName .}}EventHandler(v){{end}} - } - - return nil -} - -func init() { {{range .}}{{if isDiscordEvent .}} - registerInterfaceProvider({{privateName .}}EventHandler(nil)){{end}}{{end}} -} -`)) - -func main() { - var buf bytes.Buffer - dir := filepath.Dir(".") - - fs := token.NewFileSet() - parsedFile, err := parser.ParseFile(fs, "events.go", nil, 0) - if err != nil { - log.Fatalf("warning: internal error: could not parse events.go: %s", err) - return - } - - names := []string{} - for object := range parsedFile.Scope.Objects { - names = append(names, object) - } - sort.Strings(names) - eventHandlerTmpl.Execute(&buf, names) - - src, err := format.Source(buf.Bytes()) - if err != nil { - log.Println("warning: internal error: invalid Go generated:", err) - src = buf.Bytes() - } - - err = ioutil.WriteFile(filepath.Join(dir, strings.ToLower("eventhandlers.go")), src, 0644) - if err != nil { - log.Fatal(buf, "writing output: %s", err) - } -} - -var constRegexp = regexp.MustCompile("([a-z])([A-Z])") - -func constCase(name string) string { - return strings.ToUpper(constRegexp.ReplaceAllString(name, "${1}_${2}")) -} - -func isDiscordEvent(name string) bool { - switch { - case name == "Connect", name == "Disconnect", name == "Event", name == "RateLimit", name == "Interface": - return false - default: - return true - } -} - -func constName(name string) string { - if !isDiscordEvent(name) { - return "__" + constCase(name) + "__" - } - - return constCase(name) -} - -func privateName(name string) string { - return strings.ToLower(string(name[0])) + name[1:] -} diff --git a/vendor/github.com/matterbridge/go-xmpp/.travis.yml b/vendor/github.com/matterbridge/go-xmpp/.travis.yml new file mode 100644 index 00000000..7cf59601 --- /dev/null +++ b/vendor/github.com/matterbridge/go-xmpp/.travis.yml @@ -0,0 +1,5 @@ +language: go +go: + - tip +script: + - go test diff --git a/vendor/github.com/matterbridge/go-xmpp/README.md b/vendor/github.com/matterbridge/go-xmpp/README.md new file mode 100644 index 00000000..7808206a --- /dev/null +++ b/vendor/github.com/matterbridge/go-xmpp/README.md @@ -0,0 +1,6 @@ +go-xmpp +======= + +go xmpp library (original was written by russ cox ) + +[Documentation](https://godoc.org/github.com/mattn/go-xmpp) diff --git a/vendor/github.com/matterbridge/gomatrix/.gitignore b/vendor/github.com/matterbridge/gomatrix/.gitignore new file mode 100644 index 00000000..daf913b1 --- /dev/null +++ b/vendor/github.com/matterbridge/gomatrix/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/matterbridge/gomatrix/.travis.yml b/vendor/github.com/matterbridge/gomatrix/.travis.yml new file mode 100644 index 00000000..fadc3264 --- /dev/null +++ b/vendor/github.com/matterbridge/gomatrix/.travis.yml @@ -0,0 +1,9 @@ +language: go +go: + - 1.8 +install: + - go get github.com/golang/lint/golint + - go get github.com/fzipp/gocyclo + - go get github.com/client9/misspell/... + - go get github.com/gordonklaus/ineffassign +script: ./hooks/pre-commit diff --git a/vendor/github.com/matterbridge/gomatrix/README.md b/vendor/github.com/matterbridge/gomatrix/README.md new file mode 100644 index 00000000..ea9109ad --- /dev/null +++ b/vendor/github.com/matterbridge/gomatrix/README.md @@ -0,0 +1,6 @@ +# gomatrix +[![GoDoc](https://godoc.org/github.com/matrix-org/gomatrix?status.svg)](https://godoc.org/github.com/matrix-org/gomatrix) + +A Golang Matrix client. + +**THIS IS UNDER ACTIVE DEVELOPMENT: BREAKING CHANGES ARE FREQUENT.** diff --git a/vendor/github.com/matterbridge/gozulipbot/.gitignore b/vendor/github.com/matterbridge/gozulipbot/.gitignore new file mode 100644 index 00000000..74775025 --- /dev/null +++ b/vendor/github.com/matterbridge/gozulipbot/.gitignore @@ -0,0 +1,2 @@ +# helper scripts +scripts/ diff --git a/vendor/github.com/matterbridge/gozulipbot/README.md b/vendor/github.com/matterbridge/gozulipbot/README.md new file mode 100644 index 00000000..631095e4 --- /dev/null +++ b/vendor/github.com/matterbridge/gozulipbot/README.md @@ -0,0 +1,20 @@ +## GoZulipBot + +`gozulipbot` is a library to interact with Zulip in Go. +It is primarily targeted toward making bots. + +## Installation + +`go get github.com/ifo/gozulipbot` + +## Usage + +Make sure to add `gozulipbot` to your imports: + +```go +import ( + gzb "github.com/ifo/gozulipbot" +) +``` + +Check out the examples directory for more info. diff --git a/vendor/github.com/matterbridge/logrus-prefixed-formatter/.gitignore b/vendor/github.com/matterbridge/logrus-prefixed-formatter/.gitignore new file mode 100644 index 00000000..450aeaa9 --- /dev/null +++ b/vendor/github.com/matterbridge/logrus-prefixed-formatter/.gitignore @@ -0,0 +1,34 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +# IDEA files +.idea +*.iml + +# OS X +.DS_Store + +# Unit testing +*.coverprofile diff --git a/vendor/github.com/matterbridge/logrus-prefixed-formatter/.travis.yml b/vendor/github.com/matterbridge/logrus-prefixed-formatter/.travis.yml new file mode 100644 index 00000000..0c80b19a --- /dev/null +++ b/vendor/github.com/matterbridge/logrus-prefixed-formatter/.travis.yml @@ -0,0 +1,14 @@ +language: go + +go: + - 1.5 + - 1.6 + - 1.7 + +install: + - make deps + +script: + - make test + +sudo: false diff --git a/vendor/github.com/matterbridge/logrus-prefixed-formatter/Makefile b/vendor/github.com/matterbridge/logrus-prefixed-formatter/Makefile new file mode 100644 index 00000000..70c028cc --- /dev/null +++ b/vendor/github.com/matterbridge/logrus-prefixed-formatter/Makefile @@ -0,0 +1,19 @@ +NAME=logrus-prefixed-formatter +PACKAGES=$(shell go list ./...) + +deps: + @echo "--> Installing dependencies" + @go get -d -v -t ./... + +test-deps: + @which ginkgo 2>/dev/null ; if [ $$? -eq 1 ]; then \ + go get -u -v github.com/onsi/ginkgo/ginkgo; \ + fi + +test: test-deps + @echo "--> Running tests" + @ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --cover --trace --race + +format: + @echo "--> Running go fmt" + @go fmt $(PACKAGES) diff --git a/vendor/github.com/matterbridge/logrus-prefixed-formatter/README.md b/vendor/github.com/matterbridge/logrus-prefixed-formatter/README.md new file mode 100644 index 00000000..cf10f270 --- /dev/null +++ b/vendor/github.com/matterbridge/logrus-prefixed-formatter/README.md @@ -0,0 +1,116 @@ +# Logrus Prefixed Log Formatter +[![Build Status](https://travis-ci.org/x-cray/logrus-prefixed-formatter.svg?branch=master)](https://travis-ci.org/x-cray/logrus-prefixed-formatter) + +[Logrus](https://github.com/sirupsen/logrus) formatter mainly based on original `logrus.TextFormatter` but with slightly +modified colored output and support for log entry prefixes, e.g. message source followed by a colon. In addition, custom +color themes are supported. + +![Formatter screenshot](http://cl.ly/image/1w0B3F233F3z/formatter-screenshot@2x.png) + +Just like with the original `logrus.TextFormatter` when a TTY is not attached, the output is compatible with the +[logfmt](http://godoc.org/github.com/kr/logfmt) format: + +```text +time="Oct 27 00:44:26" level=debug msg="Started observing beach" animal=walrus number=8 +time="Oct 27 00:44:26" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 +time="Oct 27 00:44:26" level=warning msg="The group's number increased tremendously!" number=122 omg=true +time="Oct 27 00:44:26" level=debug msg="Temperature changes" temperature=-4 +time="Oct 27 00:44:26" level=panic msg="It's over 9000!" animal=orca size=9009 +time="Oct 27 00:44:26" level=fatal msg="The ice breaks!" number=100 omg=true +exit status 1 +``` + +## Installation +To install formatter, use `go get`: + +```sh +$ go get github.com/x-cray/logrus-prefixed-formatter +``` + +## Usage +Here is how it should be used: + +```go +package main + +import ( + "github.com/sirupsen/logrus" + prefixed "github.com/x-cray/logrus-prefixed-formatter" +) + +var log = logrus.New() + +func init() { + log.Formatter = new(prefixed.TextFormatter) + log.Level = logrus.DebugLevel +} + +func main() { + log.WithFields(logrus.Fields{ + "prefix": "main", + "animal": "walrus", + "number": 8, + }).Debug("Started observing beach") + + log.WithFields(logrus.Fields{ + "prefix": "sensor", + "temperature": -4, + }).Info("Temperature changes") +} +``` + +## API +`prefixed.TextFormatter` exposes the following fields and methods. + +### Fields + +* `ForceColors bool` — set to true to bypass checking for a TTY before outputting colors. +* `DisableColors bool` — force disabling colors. For a TTY colors are enabled by default. +* `DisableUppercase bool` — set to true to turn off the conversion of the log level names to uppercase. +* `ForceFormatting bool` — force formatted layout, even for non-TTY output. +* `DisableTimestamp bool` — disable timestamp logging. Useful when output is redirected to logging system that already adds timestamps. +* `FullTimestamp bool` — enable logging the full timestamp when a TTY is attached instead of just the time passed since beginning of execution. +* `TimestampFormat string` — timestamp format to use for display when a full timestamp is printed. +* `DisableSorting bool` — the fields are sorted by default for a consistent output. For applications that log extremely frequently and don't use the JSON formatter this may not be desired. +* `QuoteEmptyFields bool` — wrap empty fields in quotes if true. +* `QuoteCharacter string` — can be set to the override the default quoting character `"` with something else. For example: `'`, or `` ` ``. +* `SpacePadding int` — pad msg field with spaces on the right for display. The value for this parameter will be the size of padding. Its default value is zero, which means no padding will be applied. + +### Methods + +#### `SetColorScheme(colorScheme *prefixed.ColorScheme)` + +Sets an alternative color scheme for colored output. `prefixed.ColorScheme` struct supports the following fields: +* `InfoLevelStyle string` — info level style. +* `WarnLevelStyle string` — warn level style. +* `ErrorLevelStyle string` — error style. +* `FatalLevelStyle string` — fatal level style. +* `PanicLevelStyle string` — panic level style. +* `DebugLevelStyle string` — debug level style. +* `PrefixStyle string` — prefix style. +* `TimestampStyle string` — timestamp style. + +Color styles should be specified using [mgutz/ansi](https://github.com/mgutz/ansi#style-format) style syntax. For example, here is the default theme: + +```go +InfoLevelStyle: "green", +WarnLevelStyle: "yellow", +ErrorLevelStyle: "red", +FatalLevelStyle: "red", +PanicLevelStyle: "red", +DebugLevelStyle: "blue", +PrefixStyle: "cyan", +TimestampStyle: "black+h" +``` + +It's not necessary to specify all colors when changing color scheme if you want to change just specific ones: + +```go +formatter.SetColorScheme(&prefixed.ColorScheme{ + PrefixStyle: "blue+b", + TimestampStyle: "white+h", +}) +``` + +# License +MIT diff --git a/vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/basic.go b/vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/basic.go deleted file mode 100644 index 2a42cb43..00000000 --- a/vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/basic.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "github.com/sirupsen/logrus" - prefixed "github.com/x-cray/logrus-prefixed-formatter" -) - -var log = logrus.New() - -func init() { - formatter := new(prefixed.TextFormatter) - log.Formatter = formatter - log.Level = logrus.DebugLevel -} - -func main() { - defer func() { - err := recover() - if err != nil { - // Fatal message - log.WithFields(logrus.Fields{ - "omg": true, - "number": 100, - }).Fatal("[main] The ice breaks!") - } - }() - - // You could either provide a map key called `prefix` to add prefix - log.WithFields(logrus.Fields{ - "prefix": "main", - "animal": "walrus", - "number": 8, - }).Debug("Started observing beach") - - // Or you can simply add prefix in square brackets within message itself - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Debug("[main] A group of walrus emerges from the ocean") - - // Warning message - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("[main] The group's number increased tremendously!") - - // Information message - log.WithFields(logrus.Fields{ - "prefix": "sensor", - "temperature": -4, - }).Info("Temperature changes") - - // Panic message - log.WithFields(logrus.Fields{ - "prefix": "sensor", - "animal": "orca", - "size": 9009, - }).Panic("It's over 9000!") -} diff --git a/vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/themes.go b/vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/themes.go deleted file mode 100644 index 6c911aea..00000000 --- a/vendor/github.com/matterbridge/logrus-prefixed-formatter/examples/themes.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "github.com/sirupsen/logrus" - prefixed "github.com/x-cray/logrus-prefixed-formatter" -) - -var log = logrus.New() - -func init() { - formatter := new(prefixed.TextFormatter) - formatter.FullTimestamp = true - - // Set specific colors for prefix and timestamp - formatter.SetColorScheme(&prefixed.ColorScheme{ - PrefixStyle: "blue+b", - TimestampStyle: "white+h", - }) - - log.Formatter = formatter - log.Level = logrus.DebugLevel -} - -func main() { - log.WithFields(logrus.Fields{ - "prefix": "main", - "animal": "walrus", - "number": 8, - }).Debug("Started observing beach") - - // Or you can simply add prefix in square brackets within message itself - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Debug("[main] A group of walrus emerges from the ocean") - - // Warning message - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("[main] The group's number increased tremendously!") - - // Information message - log.WithFields(logrus.Fields{ - "prefix": "sensor", - "temperature": -4, - }).Info("Temperature changes") -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/einterfaces/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/account_migration.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/account_migration.go deleted file mode 100644 index 0db516d7..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/account_migration.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import "github.com/mattermost/mattermost-server/model" - -type AccountMigrationInterface interface { - MigrateToLdap(fromAuthService string, forignUserFieldNameToMatch string, force bool) *model.AppError -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/brand.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/brand.go deleted file mode 100644 index fc584a91..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/brand.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" - "mime/multipart" -) - -type BrandInterface interface { - SaveBrandImage(*multipart.FileHeader) *model.AppError - GetBrandImage() ([]byte, *model.AppError) -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/cluster.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/cluster.go deleted file mode 100644 index b5ef4772..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/cluster.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type ClusterMessageHandler func(msg *model.ClusterMessage) - -type ClusterInterface interface { - StartInterNodeCommunication() - StopInterNodeCommunication() - RegisterClusterMessageHandler(event string, crm ClusterMessageHandler) - GetClusterId() string - IsLeader() bool - GetMyClusterInfo() *model.ClusterInfo - GetClusterInfos() []*model.ClusterInfo - SendClusterMessage(cluster *model.ClusterMessage) - NotifyMsg(buf []byte) - GetClusterStats() ([]*model.ClusterStats, *model.AppError) - GetLogs(page, perPage int) ([]string, *model.AppError) - ConfigChanged(previousConfig *model.Config, newConfig *model.Config, sendToOtherServer bool) *model.AppError -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/compliance.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/compliance.go deleted file mode 100644 index 14927bee..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/compliance.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type ComplianceInterface interface { - StartComplianceDailyJob() - RunComplianceJob(job *model.Compliance) *model.AppError -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/data_retention.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/data_retention.go deleted file mode 100644 index 07f7d387..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/data_retention.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type DataRetentionInterface interface { - GetPolicy() (*model.DataRetentionPolicy, *model.AppError) -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/elasticsearch.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/elasticsearch.go deleted file mode 100644 index 5582fd4e..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/elasticsearch.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "time" - - "github.com/mattermost/mattermost-server/model" -) - -type ElasticsearchInterface interface { - Start() *model.AppError - IndexPost(post *model.Post, teamId string) *model.AppError - SearchPosts(channels *model.ChannelList, searchParams []*model.SearchParams) ([]string, *model.AppError) - DeletePost(post *model.Post) *model.AppError - TestConfig(cfg *model.Config) *model.AppError - PurgeIndexes() *model.AppError - DataRetentionDeleteIndexes(cutoff time.Time) *model.AppError -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/emoji.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/emoji.go deleted file mode 100644 index b8d61e74..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/emoji.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type EmojiInterface interface { - CanUserCreateEmoji(string, []*model.TeamMember) bool -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/data_retention.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/data_retention.go deleted file mode 100644 index 73f78e4f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/data_retention.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package jobs - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type DataRetentionJobInterface interface { - MakeWorker() model.Worker - MakeScheduler() model.Scheduler -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/elasticsearch.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/elasticsearch.go deleted file mode 100644 index 16e0d769..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/elasticsearch.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package jobs - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type ElasticsearchIndexerInterface interface { - MakeWorker() model.Worker -} - -type ElasticsearchAggregatorInterface interface { - MakeWorker() model.Worker - MakeScheduler() model.Scheduler -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/ldap_sync.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/ldap_sync.go deleted file mode 100644 index 5565afe4..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/ldap_sync.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package jobs - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type LdapSyncInterface interface { - MakeWorker() model.Worker - MakeScheduler() model.Scheduler -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/message_export.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/message_export.go deleted file mode 100644 index 74b0df75..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/jobs/message_export.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package jobs - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type MessageExportJobInterface interface { - MakeWorker() model.Worker - MakeScheduler() model.Scheduler -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/ldap.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/ldap.go deleted file mode 100644 index 26326b17..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/ldap.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/go-ldap/ldap" - - "github.com/mattermost/mattermost-server/model" -) - -type LdapInterface interface { - DoLogin(id string, password string) (*model.User, *model.AppError) - GetUser(id string) (*model.User, *model.AppError) - GetUserAttributes(id string, attributes []string) (map[string]string, *model.AppError) - CheckPassword(id string, password string) *model.AppError - SwitchToLdap(userId, ldapId, ldapPassword string) *model.AppError - ValidateFilter(filter string) *model.AppError - StartSynchronizeJob(waitForJobToFinish bool) (*model.Job, *model.AppError) - RunTest() *model.AppError - GetAllLdapUsers() ([]*model.User, *model.AppError) - UserFromLdapUser(ldapUser *ldap.Entry) *model.User - UserHasUpdateFromLdap(existingUser *model.User, currentLdapUser *model.User) bool - UpdateLocalLdapUser(existingUser *model.User, currentLdapUser *model.User) *model.User -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/message_export.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/message_export.go deleted file mode 100644 index ba498cdf..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/message_export.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "context" - - "github.com/mattermost/mattermost-server/model" -) - -type MessageExportInterface interface { - StartSynchronizeJob(ctx context.Context, exportFromTimestamp int64) (*model.Job, *model.AppError) -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/metrics.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/metrics.go deleted file mode 100644 index a88fe63c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/metrics.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -type MetricsInterface interface { - StartServer() - StopServer() - - IncrementPostCreate() - IncrementWebhookPost() - IncrementPostSentEmail() - IncrementPostSentPush() - IncrementPostBroadcast() - IncrementPostFileAttachment(count int) - - IncrementHttpRequest() - IncrementHttpError() - ObserveHttpRequestDuration(elapsed float64) - - IncrementClusterRequest() - ObserveClusterRequestDuration(elapsed float64) - - IncrementLogin() - IncrementLoginFail() - - IncrementEtagHitCounter(route string) - IncrementEtagMissCounter(route string) - - IncrementMemCacheHitCounter(cacheName string) - IncrementMemCacheMissCounter(cacheName string) - IncrementMemCacheMissCounterSession() - IncrementMemCacheHitCounterSession() - - IncrementWebsocketEvent(eventType string) - IncrementWebSocketBroadcast(eventType string) - - AddMemCacheHitCounter(cacheName string, amount float64) - AddMemCacheMissCounter(cacheName string, amount float64) - - IncrementPostsSearchCounter() - ObservePostsSearchDuration(elapsed float64) -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/mfa.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/mfa.go deleted file mode 100644 index 3afe961e..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/mfa.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type MfaInterface interface { - GenerateSecret(user *model.User) (string, []byte, *model.AppError) - Activate(user *model.User, token string) *model.AppError - Deactivate(userId string) *model.AppError - ValidateToken(secret, token string) (bool, *model.AppError) -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/oauthproviders.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/oauthproviders.go deleted file mode 100644 index 7e24d2a7..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/oauthproviders.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" - "io" -) - -type OauthProvider interface { - GetIdentifier() string - GetUserFromJson(data io.Reader) *model.User - GetAuthDataFromJson(data io.Reader) string -} - -var oauthProviders = make(map[string]OauthProvider) - -func RegisterOauthProvider(name string, newProvider OauthProvider) { - oauthProviders[name] = newProvider -} - -func GetOauthProvider(name string) OauthProvider { - provider, ok := oauthProviders[name] - if ok { - return provider - } - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/einterfaces/saml.go b/vendor/github.com/mattermost/mattermost-server/einterfaces/saml.go deleted file mode 100644 index 833a3d43..00000000 --- a/vendor/github.com/mattermost/mattermost-server/einterfaces/saml.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package einterfaces - -import ( - "github.com/mattermost/mattermost-server/model" -) - -type SamlInterface interface { - ConfigureSP() *model.AppError - BuildRequest(relayState string) (*model.SamlAuthRequest, *model.AppError) - DoLogin(encodedXML string, relayState map[string]string) (*model.User, *model.AppError) - GetMetadata() (string, *model.AppError) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/model/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/model/access.go b/vendor/github.com/mattermost/mattermost-server/model/access.go deleted file mode 100644 index e9603c78..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/access.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" -) - -const ( - ACCESS_TOKEN_GRANT_TYPE = "authorization_code" - ACCESS_TOKEN_TYPE = "bearer" - REFRESH_TOKEN_GRANT_TYPE = "refresh_token" -) - -type AccessData struct { - ClientId string `json:"client_id"` - UserId string `json:"user_id"` - Token string `json:"token"` - RefreshToken string `json:"refresh_token"` - RedirectUri string `json:"redirect_uri"` - ExpiresAt int64 `json:"expires_at"` - Scope string `json:"scope"` -} - -type AccessResponse struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - ExpiresIn int32 `json:"expires_in"` - Scope string `json:"scope"` - RefreshToken string `json:"refresh_token"` -} - -// IsValid validates the AccessData and returns an error if it isn't configured -// correctly. -func (ad *AccessData) IsValid() *AppError { - - if len(ad.ClientId) == 0 || len(ad.ClientId) > 26 { - return NewAppError("AccessData.IsValid", "model.access.is_valid.client_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(ad.UserId) == 0 || len(ad.UserId) > 26 { - return NewAppError("AccessData.IsValid", "model.access.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(ad.Token) != 26 { - return NewAppError("AccessData.IsValid", "model.access.is_valid.access_token.app_error", nil, "", http.StatusBadRequest) - } - - if len(ad.RefreshToken) > 26 { - return NewAppError("AccessData.IsValid", "model.access.is_valid.refresh_token.app_error", nil, "", http.StatusBadRequest) - } - - if len(ad.RedirectUri) == 0 || len(ad.RedirectUri) > 256 || !IsValidHttpUrl(ad.RedirectUri) { - return NewAppError("AccessData.IsValid", "model.access.is_valid.redirect_uri.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (me *AccessData) IsExpired() bool { - - if me.ExpiresAt <= 0 { - return false - } - - if GetMillis() > me.ExpiresAt { - return true - } - - return false -} - -func (ad *AccessData) ToJson() string { - b, _ := json.Marshal(ad) - return string(b) -} - -func AccessDataFromJson(data io.Reader) *AccessData { - var ad *AccessData - json.NewDecoder(data).Decode(&ad) - return ad -} - -func (ar *AccessResponse) ToJson() string { - b, _ := json.Marshal(ar) - return string(b) -} - -func AccessResponseFromJson(data io.Reader) *AccessResponse { - var ar *AccessResponse - json.NewDecoder(data).Decode(&ar) - return ar -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/analytics_row.go b/vendor/github.com/mattermost/mattermost-server/model/analytics_row.go deleted file mode 100644 index 4615bb79..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/analytics_row.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type AnalyticsRow struct { - Name string `json:"name"` - Value float64 `json:"value"` -} - -type AnalyticsRows []*AnalyticsRow - -func (me *AnalyticsRow) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func AnalyticsRowFromJson(data io.Reader) *AnalyticsRow { - var me *AnalyticsRow - json.NewDecoder(data).Decode(&me) - return me -} - -func (me AnalyticsRows) ToJson() string { - if b, err := json.Marshal(me); err != nil { - return "[]" - } else { - return string(b) - } -} - -func AnalyticsRowsFromJson(data io.Reader) AnalyticsRows { - var me AnalyticsRows - json.NewDecoder(data).Decode(&me) - return me -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/audit.go b/vendor/github.com/mattermost/mattermost-server/model/audit.go deleted file mode 100644 index e3d1bdf9..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/audit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type Audit struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UserId string `json:"user_id"` - Action string `json:"action"` - ExtraInfo string `json:"extra_info"` - IpAddress string `json:"ip_address"` - SessionId string `json:"session_id"` -} - -func (o *Audit) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func AuditFromJson(data io.Reader) *Audit { - var o *Audit - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/audits.go b/vendor/github.com/mattermost/mattermost-server/model/audits.go deleted file mode 100644 index 3673eb61..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/audits.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type Audits []Audit - -func (o Audits) Etag() string { - if len(o) > 0 { - // the first in the list is always the most current - return Etag(o[0].CreateAt) - } else { - return "" - } -} - -func (o Audits) ToJson() string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func AuditsFromJson(data io.Reader) Audits { - var o Audits - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/authorization.go b/vendor/github.com/mattermost/mattermost-server/model/authorization.go deleted file mode 100644 index 9f4e36ea..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/authorization.go +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -type Permission struct { - Id string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` -} - -type Role struct { - Id string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Permissions []string `json:"permissions"` -} - -var PERMISSION_INVITE_USER *Permission -var PERMISSION_ADD_USER_TO_TEAM *Permission -var PERMISSION_USE_SLASH_COMMANDS *Permission -var PERMISSION_MANAGE_SLASH_COMMANDS *Permission -var PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS *Permission -var PERMISSION_CREATE_PUBLIC_CHANNEL *Permission -var PERMISSION_CREATE_PRIVATE_CHANNEL *Permission -var PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS *Permission -var PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS *Permission -var PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE *Permission -var PERMISSION_MANAGE_ROLES *Permission -var PERMISSION_MANAGE_TEAM_ROLES *Permission -var PERMISSION_MANAGE_CHANNEL_ROLES *Permission -var PERMISSION_CREATE_DIRECT_CHANNEL *Permission -var PERMISSION_CREATE_GROUP_CHANNEL *Permission -var PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES *Permission -var PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES *Permission -var PERMISSION_LIST_TEAM_CHANNELS *Permission -var PERMISSION_JOIN_PUBLIC_CHANNELS *Permission -var PERMISSION_DELETE_PUBLIC_CHANNEL *Permission -var PERMISSION_DELETE_PRIVATE_CHANNEL *Permission -var PERMISSION_EDIT_OTHER_USERS *Permission -var PERMISSION_READ_CHANNEL *Permission -var PERMISSION_READ_PUBLIC_CHANNEL *Permission -var PERMISSION_PERMANENT_DELETE_USER *Permission -var PERMISSION_UPLOAD_FILE *Permission -var PERMISSION_GET_PUBLIC_LINK *Permission -var PERMISSION_MANAGE_WEBHOOKS *Permission -var PERMISSION_MANAGE_OTHERS_WEBHOOKS *Permission -var PERMISSION_MANAGE_OAUTH *Permission -var PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH *Permission -var PERMISSION_CREATE_POST *Permission -var PERMISSION_CREATE_POST_PUBLIC *Permission -var PERMISSION_EDIT_POST *Permission -var PERMISSION_EDIT_OTHERS_POSTS *Permission -var PERMISSION_DELETE_POST *Permission -var PERMISSION_DELETE_OTHERS_POSTS *Permission -var PERMISSION_REMOVE_USER_FROM_TEAM *Permission -var PERMISSION_CREATE_TEAM *Permission -var PERMISSION_MANAGE_TEAM *Permission -var PERMISSION_IMPORT_TEAM *Permission -var PERMISSION_VIEW_TEAM *Permission -var PERMISSION_LIST_USERS_WITHOUT_TEAM *Permission -var PERMISSION_MANAGE_JOBS *Permission -var PERMISSION_CREATE_USER_ACCESS_TOKEN *Permission -var PERMISSION_READ_USER_ACCESS_TOKEN *Permission -var PERMISSION_REVOKE_USER_ACCESS_TOKEN *Permission - -// General permission that encompases all system admin functions -// in the future this could be broken up to allow access to some -// admin functions but not others -var PERMISSION_MANAGE_SYSTEM *Permission - -const ( - SYSTEM_USER_ROLE_ID = "system_user" - SYSTEM_ADMIN_ROLE_ID = "system_admin" - SYSTEM_POST_ALL_ROLE_ID = "system_post_all" - SYSTEM_POST_ALL_PUBLIC_ROLE_ID = "system_post_all_public" - SYSTEM_USER_ACCESS_TOKEN_ROLE_ID = "system_user_access_token" - - TEAM_USER_ROLE_ID = "team_user" - TEAM_ADMIN_ROLE_ID = "team_admin" - TEAM_POST_ALL_ROLE_ID = "team_post_all" - TEAM_POST_ALL_PUBLIC_ROLE_ID = "team_post_all_public" - - CHANNEL_USER_ROLE_ID = "channel_user" - CHANNEL_ADMIN_ROLE_ID = "channel_admin" - CHANNEL_GUEST_ROLE_ID = "guest" -) - -func initializePermissions() { - PERMISSION_INVITE_USER = &Permission{ - "invite_user", - "authentication.permissions.team_invite_user.name", - "authentication.permissions.team_invite_user.description", - } - PERMISSION_ADD_USER_TO_TEAM = &Permission{ - "add_user_to_team", - "authentication.permissions.add_user_to_team.name", - "authentication.permissions.add_user_to_team.description", - } - PERMISSION_USE_SLASH_COMMANDS = &Permission{ - "use_slash_commands", - "authentication.permissions.team_use_slash_commands.name", - "authentication.permissions.team_use_slash_commands.description", - } - PERMISSION_MANAGE_SLASH_COMMANDS = &Permission{ - "manage_slash_commands", - "authentication.permissions.manage_slash_commands.name", - "authentication.permissions.manage_slash_commands.description", - } - PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS = &Permission{ - "manage_others_slash_commands", - "authentication.permissions.manage_others_slash_commands.name", - "authentication.permissions.manage_others_slash_commands.description", - } - PERMISSION_CREATE_PUBLIC_CHANNEL = &Permission{ - "create_public_channel", - "authentication.permissions.create_public_channel.name", - "authentication.permissions.create_public_channel.description", - } - PERMISSION_CREATE_PRIVATE_CHANNEL = &Permission{ - "create_private_channel", - "authentication.permissions.create_private_channel.name", - "authentication.permissions.create_private_channel.description", - } - PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS = &Permission{ - "manage_public_channel_members", - "authentication.permissions.manage_public_channel_members.name", - "authentication.permissions.manage_public_channel_members.description", - } - PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS = &Permission{ - "manage_private_channel_members", - "authentication.permissions.manage_private_channel_members.name", - "authentication.permissions.manage_private_channel_members.description", - } - PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE = &Permission{ - "assign_system_admin_role", - "authentication.permissions.assign_system_admin_role.name", - "authentication.permissions.assign_system_admin_role.description", - } - PERMISSION_MANAGE_ROLES = &Permission{ - "manage_roles", - "authentication.permissions.manage_roles.name", - "authentication.permissions.manage_roles.description", - } - PERMISSION_MANAGE_TEAM_ROLES = &Permission{ - "manage_team_roles", - "authentication.permissions.manage_team_roles.name", - "authentication.permissions.manage_team_roles.description", - } - PERMISSION_MANAGE_CHANNEL_ROLES = &Permission{ - "manage_channel_roles", - "authentication.permissions.manage_channel_roles.name", - "authentication.permissions.manage_channel_roles.description", - } - PERMISSION_MANAGE_SYSTEM = &Permission{ - "manage_system", - "authentication.permissions.manage_system.name", - "authentication.permissions.manage_system.description", - } - PERMISSION_CREATE_DIRECT_CHANNEL = &Permission{ - "create_direct_channel", - "authentication.permissions.create_direct_channel.name", - "authentication.permissions.create_direct_channel.description", - } - PERMISSION_CREATE_GROUP_CHANNEL = &Permission{ - "create_group_channel", - "authentication.permissions.create_group_channel.name", - "authentication.permissions.create_group_channel.description", - } - PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES = &Permission{ - "manage__publicchannel_properties", - "authentication.permissions.manage_public_channel_properties.name", - "authentication.permissions.manage_public_channel_properties.description", - } - PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES = &Permission{ - "manage_private_channel_properties", - "authentication.permissions.manage_private_channel_properties.name", - "authentication.permissions.manage_private_channel_properties.description", - } - PERMISSION_LIST_TEAM_CHANNELS = &Permission{ - "list_team_channels", - "authentication.permissions.list_team_channels.name", - "authentication.permissions.list_team_channels.description", - } - PERMISSION_JOIN_PUBLIC_CHANNELS = &Permission{ - "join_public_channels", - "authentication.permissions.join_public_channels.name", - "authentication.permissions.join_public_channels.description", - } - PERMISSION_DELETE_PUBLIC_CHANNEL = &Permission{ - "delete_public_channel", - "authentication.permissions.delete_public_channel.name", - "authentication.permissions.delete_public_channel.description", - } - PERMISSION_DELETE_PRIVATE_CHANNEL = &Permission{ - "delete_private_channel", - "authentication.permissions.delete_private_channel.name", - "authentication.permissions.delete_private_channel.description", - } - PERMISSION_EDIT_OTHER_USERS = &Permission{ - "edit_other_users", - "authentication.permissions.edit_other_users.name", - "authentication.permissions.edit_other_users.description", - } - PERMISSION_READ_CHANNEL = &Permission{ - "read_channel", - "authentication.permissions.read_channel.name", - "authentication.permissions.read_channel.description", - } - PERMISSION_READ_PUBLIC_CHANNEL = &Permission{ - "read_public_channel", - "authentication.permissions.read_public_channel.name", - "authentication.permissions.read_public_channel.description", - } - PERMISSION_PERMANENT_DELETE_USER = &Permission{ - "permanent_delete_user", - "authentication.permissions.permanent_delete_user.name", - "authentication.permissions.permanent_delete_user.description", - } - PERMISSION_UPLOAD_FILE = &Permission{ - "upload_file", - "authentication.permissions.upload_file.name", - "authentication.permissions.upload_file.description", - } - PERMISSION_GET_PUBLIC_LINK = &Permission{ - "get_public_link", - "authentication.permissions.get_public_link.name", - "authentication.permissions.get_public_link.description", - } - PERMISSION_MANAGE_WEBHOOKS = &Permission{ - "manage_webhooks", - "authentication.permissions.manage_webhooks.name", - "authentication.permissions.manage_webhooks.description", - } - PERMISSION_MANAGE_OTHERS_WEBHOOKS = &Permission{ - "manage_others_webhooks", - "authentication.permissions.manage_others_webhooks.name", - "authentication.permissions.manage_others_webhooks.description", - } - PERMISSION_MANAGE_OAUTH = &Permission{ - "manage_oauth", - "authentication.permissions.manage_oauth.name", - "authentication.permissions.manage_oauth.description", - } - PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH = &Permission{ - "manage_sytem_wide_oauth", - "authentication.permissions.manage_sytem_wide_oauth.name", - "authentication.permissions.manage_sytem_wide_oauth.description", - } - PERMISSION_CREATE_POST = &Permission{ - "create_post", - "authentication.permissions.create_post.name", - "authentication.permissions.create_post.description", - } - PERMISSION_CREATE_POST_PUBLIC = &Permission{ - "create_post_public", - "authentication.permissions.create_post_public.name", - "authentication.permissions.create_post_public.description", - } - PERMISSION_EDIT_POST = &Permission{ - "edit_post", - "authentication.permissions.edit_post.name", - "authentication.permissions.edit_post.description", - } - PERMISSION_EDIT_OTHERS_POSTS = &Permission{ - "edit_others_posts", - "authentication.permissions.edit_others_posts.name", - "authentication.permissions.edit_others_posts.description", - } - PERMISSION_DELETE_POST = &Permission{ - "delete_post", - "authentication.permissions.delete_post.name", - "authentication.permissions.delete_post.description", - } - PERMISSION_DELETE_OTHERS_POSTS = &Permission{ - "delete_others_posts", - "authentication.permissions.delete_others_posts.name", - "authentication.permissions.delete_others_posts.description", - } - PERMISSION_REMOVE_USER_FROM_TEAM = &Permission{ - "remove_user_from_team", - "authentication.permissions.remove_user_from_team.name", - "authentication.permissions.remove_user_from_team.description", - } - PERMISSION_CREATE_TEAM = &Permission{ - "create_team", - "authentication.permissions.create_team.name", - "authentication.permissions.create_team.description", - } - PERMISSION_MANAGE_TEAM = &Permission{ - "manage_team", - "authentication.permissions.manage_team.name", - "authentication.permissions.manage_team.description", - } - PERMISSION_IMPORT_TEAM = &Permission{ - "import_team", - "authentication.permissions.import_team.name", - "authentication.permissions.import_team.description", - } - PERMISSION_VIEW_TEAM = &Permission{ - "view_team", - "authentication.permissions.view_team.name", - "authentication.permissions.view_team.description", - } - PERMISSION_LIST_USERS_WITHOUT_TEAM = &Permission{ - "list_users_without_team", - "authentication.permissions.list_users_without_team.name", - "authentication.permissions.list_users_without_team.description", - } - PERMISSION_CREATE_USER_ACCESS_TOKEN = &Permission{ - "create_user_access_token", - "authentication.permissions.create_user_access_token.name", - "authentication.permissions.create_user_access_token.description", - } - PERMISSION_READ_USER_ACCESS_TOKEN = &Permission{ - "read_user_access_token", - "authentication.permissions.read_user_access_token.name", - "authentication.permissions.read_user_access_token.description", - } - PERMISSION_REVOKE_USER_ACCESS_TOKEN = &Permission{ - "revoke_user_access_token", - "authentication.permissions.revoke_user_access_token.name", - "authentication.permissions.revoke_user_access_token.description", - } - PERMISSION_MANAGE_JOBS = &Permission{ - "manage_jobs", - "authentication.permisssions.manage_jobs.name", - "authentication.permisssions.manage_jobs.description", - } -} - -var DefaultRoles map[string]*Role - -func initializeDefaultRoles() { - DefaultRoles = make(map[string]*Role) - - DefaultRoles[CHANNEL_USER_ROLE_ID] = &Role{ - "channel_user", - "authentication.roles.channel_user.name", - "authentication.roles.channel_user.description", - []string{ - PERMISSION_READ_CHANNEL.Id, - PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS.Id, - PERMISSION_UPLOAD_FILE.Id, - PERMISSION_GET_PUBLIC_LINK.Id, - PERMISSION_CREATE_POST.Id, - PERMISSION_EDIT_POST.Id, - PERMISSION_USE_SLASH_COMMANDS.Id, - }, - } - - DefaultRoles[CHANNEL_ADMIN_ROLE_ID] = &Role{ - "channel_admin", - "authentication.roles.channel_admin.name", - "authentication.roles.channel_admin.description", - []string{ - PERMISSION_MANAGE_CHANNEL_ROLES.Id, - }, - } - - DefaultRoles[CHANNEL_GUEST_ROLE_ID] = &Role{ - "guest", - "authentication.roles.global_guest.name", - "authentication.roles.global_guest.description", - []string{}, - } - - DefaultRoles[TEAM_USER_ROLE_ID] = &Role{ - "team_user", - "authentication.roles.team_user.name", - "authentication.roles.team_user.description", - []string{ - PERMISSION_LIST_TEAM_CHANNELS.Id, - PERMISSION_JOIN_PUBLIC_CHANNELS.Id, - PERMISSION_READ_PUBLIC_CHANNEL.Id, - PERMISSION_VIEW_TEAM.Id, - }, - } - - DefaultRoles[TEAM_POST_ALL_ROLE_ID] = &Role{ - "team_post_all", - "authentication.roles.team_post_all.name", - "authentication.roles.team_post_all.description", - []string{ - PERMISSION_CREATE_POST.Id, - }, - } - - DefaultRoles[TEAM_POST_ALL_PUBLIC_ROLE_ID] = &Role{ - "team_post_all_public", - "authentication.roles.team_post_all_public.name", - "authentication.roles.team_post_all_public.description", - []string{ - PERMISSION_CREATE_POST_PUBLIC.Id, - }, - } - - DefaultRoles[TEAM_ADMIN_ROLE_ID] = &Role{ - "team_admin", - "authentication.roles.team_admin.name", - "authentication.roles.team_admin.description", - []string{ - PERMISSION_EDIT_OTHERS_POSTS.Id, - PERMISSION_REMOVE_USER_FROM_TEAM.Id, - PERMISSION_MANAGE_TEAM.Id, - PERMISSION_IMPORT_TEAM.Id, - PERMISSION_MANAGE_TEAM_ROLES.Id, - PERMISSION_MANAGE_CHANNEL_ROLES.Id, - PERMISSION_MANAGE_OTHERS_WEBHOOKS.Id, - PERMISSION_MANAGE_SLASH_COMMANDS.Id, - PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS.Id, - PERMISSION_MANAGE_WEBHOOKS.Id, - }, - } - - DefaultRoles[SYSTEM_USER_ROLE_ID] = &Role{ - "system_user", - "authentication.roles.global_user.name", - "authentication.roles.global_user.description", - []string{ - PERMISSION_CREATE_DIRECT_CHANNEL.Id, - PERMISSION_CREATE_GROUP_CHANNEL.Id, - PERMISSION_PERMANENT_DELETE_USER.Id, - }, - } - - DefaultRoles[SYSTEM_POST_ALL_ROLE_ID] = &Role{ - "system_post_all", - "authentication.roles.system_post_all.name", - "authentication.roles.system_post_all.description", - []string{ - PERMISSION_CREATE_POST.Id, - }, - } - - DefaultRoles[SYSTEM_POST_ALL_PUBLIC_ROLE_ID] = &Role{ - "system_post_all_public", - "authentication.roles.system_post_all_public.name", - "authentication.roles.system_post_all_public.description", - []string{ - PERMISSION_CREATE_POST_PUBLIC.Id, - }, - } - - DefaultRoles[SYSTEM_USER_ACCESS_TOKEN_ROLE_ID] = &Role{ - "system_user_access_token", - "authentication.roles.system_user_access_token.name", - "authentication.roles.system_user_access_token.description", - []string{ - PERMISSION_CREATE_USER_ACCESS_TOKEN.Id, - PERMISSION_READ_USER_ACCESS_TOKEN.Id, - PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, - }, - } - - DefaultRoles[SYSTEM_ADMIN_ROLE_ID] = &Role{ - "system_admin", - "authentication.roles.global_admin.name", - "authentication.roles.global_admin.description", - // System admins can do anything channel and team admins can do - // plus everything members of teams and channels can do to all teams - // and channels on the system - append( - append( - append( - append( - []string{ - PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE.Id, - PERMISSION_MANAGE_SYSTEM.Id, - PERMISSION_MANAGE_ROLES.Id, - PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES.Id, - PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS.Id, - PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS.Id, - PERMISSION_DELETE_PUBLIC_CHANNEL.Id, - PERMISSION_CREATE_PUBLIC_CHANNEL.Id, - PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES.Id, - PERMISSION_DELETE_PRIVATE_CHANNEL.Id, - PERMISSION_CREATE_PRIVATE_CHANNEL.Id, - PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH.Id, - PERMISSION_MANAGE_OTHERS_WEBHOOKS.Id, - PERMISSION_EDIT_OTHER_USERS.Id, - PERMISSION_MANAGE_OAUTH.Id, - PERMISSION_INVITE_USER.Id, - PERMISSION_DELETE_POST.Id, - PERMISSION_DELETE_OTHERS_POSTS.Id, - PERMISSION_CREATE_TEAM.Id, - PERMISSION_ADD_USER_TO_TEAM.Id, - PERMISSION_LIST_USERS_WITHOUT_TEAM.Id, - PERMISSION_MANAGE_JOBS.Id, - PERMISSION_CREATE_POST_PUBLIC.Id, - PERMISSION_CREATE_USER_ACCESS_TOKEN.Id, - PERMISSION_READ_USER_ACCESS_TOKEN.Id, - PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, - }, - DefaultRoles[TEAM_USER_ROLE_ID].Permissions..., - ), - DefaultRoles[CHANNEL_USER_ROLE_ID].Permissions..., - ), - DefaultRoles[TEAM_ADMIN_ROLE_ID].Permissions..., - ), - DefaultRoles[CHANNEL_ADMIN_ROLE_ID].Permissions..., - ), - } -} - -func RoleIdsToString(roles []string) string { - output := "" - for _, role := range roles { - output += role + ", " - } - - if output == "" { - return "[]" - } - - return output[:len(output)-1] -} - -func init() { - initializePermissions() - initializeDefaultRoles() -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/authorize.go b/vendor/github.com/mattermost/mattermost-server/model/authorize.go deleted file mode 100644 index 2296e7e2..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/authorize.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" -) - -const ( - AUTHCODE_EXPIRE_TIME = 60 * 10 // 10 minutes - AUTHCODE_RESPONSE_TYPE = "code" - DEFAULT_SCOPE = "user" -) - -type AuthData struct { - ClientId string `json:"client_id"` - UserId string `json:"user_id"` - Code string `json:"code"` - ExpiresIn int32 `json:"expires_in"` - CreateAt int64 `json:"create_at"` - RedirectUri string `json:"redirect_uri"` - State string `json:"state"` - Scope string `json:"scope"` -} - -type AuthorizeRequest struct { - ResponseType string `json:"response_type"` - ClientId string `json:"client_id"` - RedirectUri string `json:"redirect_uri"` - Scope string `json:"scope"` - State string `json:"state"` -} - -// IsValid validates the AuthData and returns an error if it isn't configured -// correctly. -func (ad *AuthData) IsValid() *AppError { - - if len(ad.ClientId) != 26 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.client_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(ad.UserId) != 26 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(ad.Code) == 0 || len(ad.Code) > 128 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.auth_code.app_error", nil, "client_id="+ad.ClientId, http.StatusBadRequest) - } - - if ad.ExpiresIn == 0 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.expires.app_error", nil, "", http.StatusBadRequest) - } - - if ad.CreateAt <= 0 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.create_at.app_error", nil, "client_id="+ad.ClientId, http.StatusBadRequest) - } - - if len(ad.RedirectUri) == 0 || len(ad.RedirectUri) > 256 || !IsValidHttpUrl(ad.RedirectUri) { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.redirect_uri.app_error", nil, "client_id="+ad.ClientId, http.StatusBadRequest) - } - - if len(ad.State) > 128 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.state.app_error", nil, "client_id="+ad.ClientId, http.StatusBadRequest) - } - - if len(ad.Scope) > 128 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.scope.app_error", nil, "client_id="+ad.ClientId, http.StatusBadRequest) - } - - return nil -} - -// IsValid validates the AuthorizeRequest and returns an error if it isn't configured -// correctly. -func (ar *AuthorizeRequest) IsValid() *AppError { - - if len(ar.ClientId) != 26 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.client_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(ar.ResponseType) == 0 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.response_type.app_error", nil, "", http.StatusBadRequest) - } - - if len(ar.RedirectUri) == 0 || len(ar.RedirectUri) > 256 || !IsValidHttpUrl(ar.RedirectUri) { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.redirect_uri.app_error", nil, "client_id="+ar.ClientId, http.StatusBadRequest) - } - - if len(ar.State) > 128 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.state.app_error", nil, "client_id="+ar.ClientId, http.StatusBadRequest) - } - - if len(ar.Scope) > 128 { - return NewAppError("AuthData.IsValid", "model.authorize.is_valid.scope.app_error", nil, "client_id="+ar.ClientId, http.StatusBadRequest) - } - - return nil -} - -func (ad *AuthData) PreSave() { - if ad.ExpiresIn == 0 { - ad.ExpiresIn = AUTHCODE_EXPIRE_TIME - } - - if ad.CreateAt == 0 { - ad.CreateAt = GetMillis() - } - - if len(ad.Scope) == 0 { - ad.Scope = DEFAULT_SCOPE - } -} - -func (ad *AuthData) ToJson() string { - b, _ := json.Marshal(ad) - return string(b) -} - -func AuthDataFromJson(data io.Reader) *AuthData { - var ad *AuthData - json.NewDecoder(data).Decode(&ad) - return ad -} - -func (ar *AuthorizeRequest) ToJson() string { - b, _ := json.Marshal(ar) - return string(b) -} - -func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest { - var ar *AuthorizeRequest - json.NewDecoder(data).Decode(&ar) - return ar -} - -func (ad *AuthData) IsExpired() bool { - return GetMillis() > ad.CreateAt+int64(ad.ExpiresIn*1000) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/builtin.go b/vendor/github.com/mattermost/mattermost-server/model/builtin.go deleted file mode 100644 index 5dd00a96..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/builtin.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -func NewBool(b bool) *bool { return &b } -func NewInt(n int) *int { return &n } -func NewInt64(n int64) *int64 { return &n } -func NewString(s string) *string { return &s } diff --git a/vendor/github.com/mattermost/mattermost-server/model/bundle_info.go b/vendor/github.com/mattermost/mattermost-server/model/bundle_info.go deleted file mode 100644 index 6965159c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/bundle_info.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -type BundleInfo struct { - Path string - - Manifest *Manifest - ManifestPath string - ManifestError error -} - -// Returns bundle info for the given path. The return value is never nil. -func BundleInfoForPath(path string) *BundleInfo { - m, mpath, err := FindManifest(path) - return &BundleInfo{ - Path: path, - Manifest: m, - ManifestPath: mpath, - ManifestError: err, - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel.go b/vendor/github.com/mattermost/mattermost-server/model/channel.go deleted file mode 100644 index ce812be3..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel.go +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "crypto/sha1" - "encoding/hex" - "encoding/json" - "io" - "net/http" - "sort" - "strings" - "unicode/utf8" -) - -const ( - CHANNEL_OPEN = "O" - CHANNEL_PRIVATE = "P" - CHANNEL_DIRECT = "D" - CHANNEL_GROUP = "G" - CHANNEL_GROUP_MAX_USERS = 8 - CHANNEL_GROUP_MIN_USERS = 3 - DEFAULT_CHANNEL = "town-square" - CHANNEL_DISPLAY_NAME_MAX_RUNES = 64 - CHANNEL_NAME_MIN_LENGTH = 2 - CHANNEL_NAME_MAX_LENGTH = 64 - CHANNEL_NAME_UI_MAX_LENGTH = 22 - CHANNEL_HEADER_MAX_RUNES = 1024 - CHANNEL_PURPOSE_MAX_RUNES = 250 - CHANNEL_CACHE_SIZE = 25000 -) - -type Channel struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - TeamId string `json:"team_id"` - Type string `json:"type"` - DisplayName string `json:"display_name"` - Name string `json:"name"` - Header string `json:"header"` - Purpose string `json:"purpose"` - LastPostAt int64 `json:"last_post_at"` - TotalMsgCount int64 `json:"total_msg_count"` - ExtraUpdateAt int64 `json:"extra_update_at"` - CreatorId string `json:"creator_id"` -} - -type ChannelPatch struct { - DisplayName *string `json:"display_name"` - Name *string `json:"name"` - Header *string `json:"header"` - Purpose *string `json:"purpose"` -} - -func (o *Channel) DeepCopy() *Channel { - copy := *o - return © -} - -func (o *Channel) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func (o *ChannelPatch) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelFromJson(data io.Reader) *Channel { - var o *Channel - json.NewDecoder(data).Decode(&o) - return o -} - -func ChannelPatchFromJson(data io.Reader) *ChannelPatch { - var o *ChannelPatch - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *Channel) Etag() string { - return Etag(o.Id, o.UpdateAt) -} - -func (o *Channel) StatsEtag() string { - return Etag(o.Id, o.ExtraUpdateAt) -} - -func (o *Channel) IsValid() *AppError { - - if len(o.Id) != 26 { - return NewAppError("Channel.IsValid", "model.channel.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("Channel.IsValid", "model.channel.is_valid.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("Channel.IsValid", "model.channel.is_valid.update_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.DisplayName) > CHANNEL_DISPLAY_NAME_MAX_RUNES { - return NewAppError("Channel.IsValid", "model.channel.is_valid.display_name.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if !IsValidChannelIdentifier(o.Name) { - return NewAppError("Channel.IsValid", "model.channel.is_valid.2_or_more.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if !(o.Type == CHANNEL_OPEN || o.Type == CHANNEL_PRIVATE || o.Type == CHANNEL_DIRECT || o.Type == CHANNEL_GROUP) { - return NewAppError("Channel.IsValid", "model.channel.is_valid.type.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.Header) > CHANNEL_HEADER_MAX_RUNES { - return NewAppError("Channel.IsValid", "model.channel.is_valid.header.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.Purpose) > CHANNEL_PURPOSE_MAX_RUNES { - return NewAppError("Channel.IsValid", "model.channel.is_valid.purpose.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.CreatorId) > 26 { - return NewAppError("Channel.IsValid", "model.channel.is_valid.creator_id.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *Channel) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - o.CreateAt = GetMillis() - o.UpdateAt = o.CreateAt - o.ExtraUpdateAt = o.CreateAt -} - -func (o *Channel) PreUpdate() { - o.UpdateAt = GetMillis() -} - -func (o *Channel) ExtraUpdated() { - o.ExtraUpdateAt = GetMillis() -} - -func (o *Channel) IsGroupOrDirect() bool { - return o.Type == CHANNEL_DIRECT || o.Type == CHANNEL_GROUP -} - -func (o *Channel) Patch(patch *ChannelPatch) { - if patch.DisplayName != nil { - o.DisplayName = *patch.DisplayName - } - - if patch.Name != nil { - o.Name = *patch.Name - } - - if patch.Header != nil { - o.Header = *patch.Header - } - - if patch.Purpose != nil { - o.Purpose = *patch.Purpose - } -} - -func GetDMNameFromIds(userId1, userId2 string) string { - if userId1 > userId2 { - return userId2 + "__" + userId1 - } else { - return userId1 + "__" + userId2 - } -} - -func GetGroupDisplayNameFromUsers(users []*User, truncate bool) string { - usernames := make([]string, len(users)) - for index, user := range users { - usernames[index] = user.Username - } - - sort.Strings(usernames) - - name := strings.Join(usernames, ", ") - - if truncate && len(name) > CHANNEL_NAME_MAX_LENGTH { - name = name[:CHANNEL_NAME_MAX_LENGTH] - } - - return name -} - -func GetGroupNameFromUserIds(userIds []string) string { - sort.Strings(userIds) - - h := sha1.New() - for _, id := range userIds { - io.WriteString(h, id) - } - - return hex.EncodeToString(h.Sum(nil)) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_count.go b/vendor/github.com/mattermost/mattermost-server/model/channel_count.go deleted file mode 100644 index 8c6d8dd0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_count.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "crypto/md5" - "encoding/json" - "fmt" - "io" - "sort" - "strconv" -) - -type ChannelCounts struct { - Counts map[string]int64 `json:"counts"` - UpdateTimes map[string]int64 `json:"update_times"` -} - -func (o *ChannelCounts) Etag() string { - - ids := []string{} - for id := range o.Counts { - ids = append(ids, id) - } - sort.Strings(ids) - - str := "" - for _, id := range ids { - str += id + strconv.FormatInt(o.Counts[id], 10) - } - - md5Counts := fmt.Sprintf("%x", md5.Sum([]byte(str))) - - var update int64 = 0 - for _, u := range o.UpdateTimes { - if u > update { - update = u - } - } - - return Etag(md5Counts, update) -} - -func (o *ChannelCounts) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelCountsFromJson(data io.Reader) *ChannelCounts { - var o *ChannelCounts - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_data.go b/vendor/github.com/mattermost/mattermost-server/model/channel_data.go deleted file mode 100644 index aae0a149..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_data.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type ChannelData struct { - Channel *Channel `json:"channel"` - Member *ChannelMember `json:"member"` -} - -func (o *ChannelData) Etag() string { - var mt int64 = 0 - if o.Member != nil { - mt = o.Member.LastUpdateAt - } - - return Etag(o.Channel.Id, o.Channel.UpdateAt, o.Channel.LastPostAt, mt) -} - -func (o *ChannelData) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelDataFromJson(data io.Reader) *ChannelData { - var o *ChannelData - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_list.go b/vendor/github.com/mattermost/mattermost-server/model/channel_list.go deleted file mode 100644 index 1b3bda46..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_list.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type ChannelList []*Channel - -func (o *ChannelList) ToJson() string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func (o *ChannelList) Etag() string { - - id := "0" - var t int64 = 0 - var delta int64 = 0 - - for _, v := range *o { - if v.LastPostAt > t { - t = v.LastPostAt - id = v.Id - } - - if v.UpdateAt > t { - t = v.UpdateAt - id = v.Id - } - - } - - return Etag(id, t, delta, len(*o)) -} - -func ChannelListFromJson(data io.Reader) *ChannelList { - var o *ChannelList - json.NewDecoder(data).Decode(&o) - return o -} - -func ChannelSliceFromJson(data io.Reader) []*Channel { - var o []*Channel - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_member.go b/vendor/github.com/mattermost/mattermost-server/model/channel_member.go deleted file mode 100644 index e9895aea..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_member.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "strings" -) - -const ( - CHANNEL_NOTIFY_DEFAULT = "default" - CHANNEL_NOTIFY_ALL = "all" - CHANNEL_NOTIFY_MENTION = "mention" - CHANNEL_NOTIFY_NONE = "none" - CHANNEL_MARK_UNREAD_ALL = "all" - CHANNEL_MARK_UNREAD_MENTION = "mention" -) - -type ChannelUnread struct { - TeamId string `json:"team_id"` - ChannelId string `json:"channel_id"` - MsgCount int64 `json:"msg_count"` - MentionCount int64 `json:"mention_count"` - NotifyProps StringMap `json:"-"` -} - -type ChannelMember struct { - ChannelId string `json:"channel_id"` - UserId string `json:"user_id"` - Roles string `json:"roles"` - LastViewedAt int64 `json:"last_viewed_at"` - MsgCount int64 `json:"msg_count"` - MentionCount int64 `json:"mention_count"` - NotifyProps StringMap `json:"notify_props"` - LastUpdateAt int64 `json:"last_update_at"` -} - -type ChannelMembers []ChannelMember - -func (o *ChannelMembers) ToJson() string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func (o *ChannelUnread) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelMembersFromJson(data io.Reader) *ChannelMembers { - var o *ChannelMembers - json.NewDecoder(data).Decode(&o) - return o -} - -func ChannelUnreadFromJson(data io.Reader) *ChannelUnread { - var o *ChannelUnread - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *ChannelMember) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelMemberFromJson(data io.Reader) *ChannelMember { - var o *ChannelMember - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *ChannelMember) IsValid() *AppError { - - if len(o.ChannelId) != 26 { - return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.channel_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.UserId) != 26 { - return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - notifyLevel := o.NotifyProps[DESKTOP_NOTIFY_PROP] - if len(notifyLevel) > 20 || !IsChannelNotifyLevelValid(notifyLevel) { - return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.notify_level.app_error", nil, "notify_level="+notifyLevel, http.StatusBadRequest) - } - - markUnreadLevel := o.NotifyProps[MARK_UNREAD_NOTIFY_PROP] - if len(markUnreadLevel) > 20 || !IsChannelMarkUnreadLevelValid(markUnreadLevel) { - return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.unread_level.app_error", nil, "mark_unread_level="+markUnreadLevel, http.StatusBadRequest) - } - - if pushLevel, ok := o.NotifyProps[PUSH_NOTIFY_PROP]; ok { - if len(pushLevel) > 20 || !IsChannelNotifyLevelValid(pushLevel) { - return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.push_level.app_error", nil, "push_notification_level="+pushLevel, http.StatusBadRequest) - } - } - - if sendEmail, ok := o.NotifyProps[EMAIL_NOTIFY_PROP]; ok { - if len(sendEmail) > 20 || !IsSendEmailValid(sendEmail) { - return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.email_value.app_error", nil, "push_notification_level="+sendEmail, http.StatusBadRequest) - } - } - - return nil -} - -func (o *ChannelMember) PreSave() { - o.LastUpdateAt = GetMillis() -} - -func (o *ChannelMember) PreUpdate() { - o.LastUpdateAt = GetMillis() -} - -func (o *ChannelMember) GetRoles() []string { - return strings.Fields(o.Roles) -} - -func IsChannelNotifyLevelValid(notifyLevel string) bool { - return notifyLevel == CHANNEL_NOTIFY_DEFAULT || - notifyLevel == CHANNEL_NOTIFY_ALL || - notifyLevel == CHANNEL_NOTIFY_MENTION || - notifyLevel == CHANNEL_NOTIFY_NONE -} - -func IsChannelMarkUnreadLevelValid(markUnreadLevel string) bool { - return markUnreadLevel == CHANNEL_MARK_UNREAD_ALL || markUnreadLevel == CHANNEL_MARK_UNREAD_MENTION -} - -func IsSendEmailValid(sendEmail string) bool { - return sendEmail == CHANNEL_NOTIFY_DEFAULT || sendEmail == "true" || sendEmail == "false" -} - -func GetDefaultChannelNotifyProps() StringMap { - return StringMap{ - DESKTOP_NOTIFY_PROP: CHANNEL_NOTIFY_DEFAULT, - MARK_UNREAD_NOTIFY_PROP: CHANNEL_MARK_UNREAD_ALL, - PUSH_NOTIFY_PROP: CHANNEL_NOTIFY_DEFAULT, - EMAIL_NOTIFY_PROP: CHANNEL_NOTIFY_DEFAULT, - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_member_history.go b/vendor/github.com/mattermost/mattermost-server/model/channel_member_history.go deleted file mode 100644 index 47c59d54..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_member_history.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -type ChannelMemberHistory struct { - ChannelId string - UserId string - JoinTime int64 - LeaveTime *int64 - - // these two fields are never set in the database - when we SELECT, we join on Users to get them - UserEmail string `db:"Email"` - Username string -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_search.go b/vendor/github.com/mattermost/mattermost-server/model/channel_search.go deleted file mode 100644 index 593cf669..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_search.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type ChannelSearch struct { - Term string `json:"term"` -} - -// ToJson convert a Channel to a json string -func (c *ChannelSearch) ToJson() string { - b, _ := json.Marshal(c) - return string(b) -} - -// ChannelSearchFromJson will decode the input and return a Channel -func ChannelSearchFromJson(data io.Reader) *ChannelSearch { - var cs *ChannelSearch - json.NewDecoder(data).Decode(&cs) - return cs -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_stats.go b/vendor/github.com/mattermost/mattermost-server/model/channel_stats.go deleted file mode 100644 index 21af920f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_stats.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type ChannelStats struct { - ChannelId string `json:"channel_id"` - MemberCount int64 `json:"member_count"` -} - -func (o *ChannelStats) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelStatsFromJson(data io.Reader) *ChannelStats { - var o *ChannelStats - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/channel_view.go b/vendor/github.com/mattermost/mattermost-server/model/channel_view.go deleted file mode 100644 index 650d14ce..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/channel_view.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type ChannelView struct { - ChannelId string `json:"channel_id"` - PrevChannelId string `json:"prev_channel_id"` -} - -func (o *ChannelView) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelViewFromJson(data io.Reader) *ChannelView { - var o *ChannelView - json.NewDecoder(data).Decode(&o) - return o -} - -type ChannelViewResponse struct { - Status string `json:"status"` - LastViewedAtTimes map[string]int64 `json:"last_viewed_at_times"` -} - -func (o *ChannelViewResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ChannelViewResponseFromJson(data io.Reader) *ChannelViewResponse { - var o *ChannelViewResponse - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/client.go b/vendor/github.com/mattermost/mattermost-server/model/client.go deleted file mode 100644 index ef890b59..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/client.go +++ /dev/null @@ -1,2379 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - l4g "github.com/alecthomas/log4go" -) - -var UsedApiV3 *int32 = new(int32) - -const ( - HEADER_REQUEST_ID = "X-Request-ID" - HEADER_VERSION_ID = "X-Version-ID" - HEADER_CLUSTER_ID = "X-Cluster-ID" - HEADER_ETAG_SERVER = "ETag" - HEADER_ETAG_CLIENT = "If-None-Match" - HEADER_FORWARDED = "X-Forwarded-For" - HEADER_REAL_IP = "X-Real-IP" - HEADER_FORWARDED_PROTO = "X-Forwarded-Proto" - HEADER_TOKEN = "token" - HEADER_BEARER = "BEARER" - HEADER_AUTH = "Authorization" - HEADER_REQUESTED_WITH = "X-Requested-With" - HEADER_REQUESTED_WITH_XML = "XMLHttpRequest" - STATUS = "status" - STATUS_OK = "OK" - STATUS_FAIL = "FAIL" - STATUS_REMOVE = "REMOVE" - - CLIENT_DIR = "client" - - API_URL_SUFFIX_V1 = "/api/v1" - API_URL_SUFFIX_V3 = "/api/v3" - API_URL_SUFFIX_V4 = "/api/v4" - API_URL_SUFFIX = API_URL_SUFFIX_V4 -) - -type Result struct { - RequestId string - Etag string - Data interface{} -} - -type ResponseMetadata struct { - StatusCode int - Error *AppError - RequestId string - Etag string -} - -type Client struct { - Url string // The location of the server like "http://localhost:8065" - ApiUrl string // The api location of the server like "http://localhost:8065/api/v3" - HttpClient *http.Client // The http client - AuthToken string - AuthType string - TeamId string - RequestId string - Etag string - ServerVersion string -} - -// NewClient constructs a new client with convienence methods for talking to -// the server. -func NewClient(url string) *Client { - return &Client{url, url + API_URL_SUFFIX_V3, &http.Client{}, "", "", "", "", "", ""} -} - -func closeBody(r *http.Response) { - if r.Body != nil { - ioutil.ReadAll(r.Body) - r.Body.Close() - } -} - -func (c *Client) SetOAuthToken(token string) { - c.AuthToken = token - c.AuthType = HEADER_TOKEN -} - -func (c *Client) ClearOAuthToken() { - c.AuthToken = "" - c.AuthType = HEADER_BEARER -} - -func (c *Client) SetTeamId(teamId string) { - c.TeamId = teamId -} - -func (c *Client) GetTeamId() string { - if len(c.TeamId) == 0 { - println(`You are trying to use a route that requires a team_id, - but you have not called SetTeamId() in client.go`) - } - - return c.TeamId -} - -func (c *Client) ClearTeamId() { - c.TeamId = "" -} - -func (c *Client) GetTeamRoute() string { - return fmt.Sprintf("/teams/%v", c.GetTeamId()) -} - -func (c *Client) GetChannelRoute(channelId string) string { - return fmt.Sprintf("/teams/%v/channels/%v", c.GetTeamId(), channelId) -} - -func (c *Client) GetUserRequiredRoute(userId string) string { - return fmt.Sprintf("/users/%v", userId) -} - -func (c *Client) GetChannelNameRoute(channelName string) string { - return fmt.Sprintf("/teams/%v/channels/name/%v", c.GetTeamId(), channelName) -} - -func (c *Client) GetEmojiRoute() string { - return "/emoji" -} - -func (c *Client) GetGeneralRoute() string { - return "/general" -} - -func (c *Client) GetFileRoute(fileId string) string { - return fmt.Sprintf("/files/%v", fileId) -} - -func (c *Client) DoPost(url, data, contentType string) (*http.Response, *AppError) { - rq, _ := http.NewRequest("POST", c.Url+url, strings.NewReader(data)) - rq.Header.Set("Content-Type", contentType) - rq.Close = true - - if rp, err := c.HttpClient.Do(rq); err != nil { - return nil, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode >= 300 { - defer closeBody(rp) - return nil, AppErrorFromJson(rp.Body) - } else { - return rp, nil - } -} - -func (c *Client) DoApiPost(url string, data string) (*http.Response, *AppError) { - rq, _ := http.NewRequest("POST", c.ApiUrl+url, strings.NewReader(data)) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil { - return nil, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode >= 300 { - defer closeBody(rp) - return nil, AppErrorFromJson(rp.Body) - } else { - return rp, nil - } -} - -func (c *Client) DoApiGet(url string, data string, etag string) (*http.Response, *AppError) { - rq, _ := http.NewRequest("GET", c.ApiUrl+url, strings.NewReader(data)) - rq.Close = true - - if len(etag) > 0 { - rq.Header.Set(HEADER_ETAG_CLIENT, etag) - } - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil { - return nil, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode == 304 { - return rp, nil - } else if rp.StatusCode >= 300 { - defer closeBody(rp) - return rp, AppErrorFromJson(rp.Body) - } else { - return rp, nil - } -} - -func getCookie(name string, resp *http.Response) *http.Cookie { - for _, cookie := range resp.Cookies() { - if cookie.Name == name { - return cookie - } - } - - return nil -} - -// Must is a convenience function used for testing. -func (c *Client) Must(result *Result, err *AppError) *Result { - if err != nil { - l4g.Close() - time.Sleep(time.Second) - panic(err) - } - - return result -} - -// MustGeneric is a convenience function used for testing. -func (c *Client) MustGeneric(result interface{}, err *AppError) interface{} { - if err != nil { - l4g.Close() - time.Sleep(time.Second) - panic(err) - } - - return result -} - -// CheckStatusOK is a convenience function for checking the return of Web Service -// call that return the a map of status=OK. -func (c *Client) CheckStatusOK(r *http.Response) bool { - m := MapFromJson(r.Body) - defer closeBody(r) - - if m != nil && m[STATUS] == STATUS_OK { - return true - } - - return false -} - -func (c *Client) fillInExtraProperties(r *http.Response) { - c.RequestId = r.Header.Get(HEADER_REQUEST_ID) - c.Etag = r.Header.Get(HEADER_ETAG_SERVER) - c.ServerVersion = r.Header.Get(HEADER_VERSION_ID) -} - -func (c *Client) clearExtraProperties() { - c.RequestId = "" - c.Etag = "" - c.ServerVersion = "" -} - -// General Routes Section - -// GetClientProperties returns properties needed by the client to show/hide -// certian features. It returns a map of strings. -func (c *Client) GetClientProperties() (map[string]string, *AppError) { - c.clearExtraProperties() - if r, err := c.DoApiGet(c.GetGeneralRoute()+"/client_props", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return MapFromJson(r.Body), nil - } -} - -// LogClient is a convenience Web Service call so clients can log messages into -// the server-side logs. For example we typically log javascript error messages -// into the server-side. It returns true if the logging was successful. -func (c *Client) LogClient(message string) (bool, *AppError) { - c.clearExtraProperties() - m := make(map[string]string) - m["level"] = "ERROR" - m["message"] = message - - if r, err := c.DoApiPost(c.GetGeneralRoute()+"/log_client", MapToJson(m)); err != nil { - return false, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return c.CheckStatusOK(r), nil - } -} - -// GetPing returns a map of strings with server time, server version, and node Id. -// Systems that want to check on health status of the server should check the -// url /api/v3/ping for a 200 status response. -func (c *Client) GetPing() (map[string]string, *AppError) { - c.clearExtraProperties() - if r, err := c.DoApiGet(c.GetGeneralRoute()+"/ping", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return MapFromJson(r.Body), nil - } -} - -// Team Routes Section - -// CreateTeam creates a team based on the provided Team struct. On success it returns -// the Team struct with the Id, CreateAt and other server-decided fields populated. -func (c *Client) CreateTeam(team *Team) (*Result, *AppError) { - if r, err := c.DoApiPost("/teams/create", team.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamFromJson(r.Body)}, nil - } -} - -// GetAllTeams returns a map of all teams using team ids as the key. -func (c *Client) GetAllTeams() (*Result, *AppError) { - if r, err := c.DoApiGet("/teams/all", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamMapFromJson(r.Body)}, nil - } -} - -// GetAllTeamListings returns a map of all teams that are available to join -// using team ids as the key. Must be authenticated. -func (c *Client) GetAllTeamListings() (*Result, *AppError) { - if r, err := c.DoApiGet("/teams/all_team_listings", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamMapFromJson(r.Body)}, nil - } -} - -// FindTeamByName returns the strings "true" or "false" depending on if a team -// with the provided name was found. -func (c *Client) FindTeamByName(name string) (*Result, *AppError) { - m := make(map[string]string) - m["name"] = name - if r, err := c.DoApiPost("/teams/find_team_by_name", MapToJson(m)); err != nil { - return nil, err - } else { - val := false - if body, _ := ioutil.ReadAll(r.Body); string(body) == "true" { - val = true - } - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), val}, nil - } -} - -// Adds a user directly to the team without sending an invite. -// The teamId and userId are required. You must be a valid member of the team and/or -// have the correct role to add new users to the team. Returns a map of user_id=userId -// if successful, otherwise returns an AppError. -func (c *Client) AddUserToTeam(teamId string, userId string) (*Result, *AppError) { - if len(teamId) == 0 { - teamId = c.GetTeamId() - } - - data := make(map[string]string) - data["user_id"] = userId - if r, err := c.DoApiPost(fmt.Sprintf("/teams/%v", teamId)+"/add_user_to_team", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// AddUserToTeamFromInvite adds a user to a team based off data provided in an invite link. -// Either hash and dataToHash are required or inviteId is required. -func (c *Client) AddUserToTeamFromInvite(hash, dataToHash, inviteId string) (*Result, *AppError) { - data := make(map[string]string) - data["hash"] = hash - data["data"] = dataToHash - data["invite_id"] = inviteId - if r, err := c.DoApiPost("/teams/add_user_to_team_from_invite", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamFromJson(r.Body)}, nil - } -} - -// Removes a user directly from the team. -// The teamId and userId are required. You must be a valid member of the team and/or -// have the correct role to remove a user from the team. Returns a map of user_id=userId -// if successful, otherwise returns an AppError. -func (c *Client) RemoveUserFromTeam(teamId string, userId string) (*Result, *AppError) { - if len(teamId) == 0 { - teamId = c.GetTeamId() - } - - data := make(map[string]string) - data["user_id"] = userId - if r, err := c.DoApiPost(fmt.Sprintf("/teams/%v", teamId)+"/remove_user_from_team", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) InviteMembers(invites *Invites) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/invite_members", invites.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), InvitesFromJson(r.Body)}, nil - } -} - -// UpdateTeam updates a team based on the changes in the provided team struct. On success -// it returns a sanitized version of the updated team. Must be authenticated as a team admin -// for that team or a system admin. -func (c *Client) UpdateTeam(team *Team) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/update", team.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamFromJson(r.Body)}, nil - } -} - -// User Routes Section - -// CreateUser creates a user in the system based on the provided user struct. -func (c *Client) CreateUser(user *User, hash string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/create", user.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -// CreateUserWithInvite creates a user based on the provided user struct. Either the hash and -// data strings or the inviteId is required from the invite. -func (c *Client) CreateUserWithInvite(user *User, hash string, data string, inviteId string) (*Result, *AppError) { - - url := "/users/create?d=" + url.QueryEscape(data) + "&h=" + url.QueryEscape(hash) + "&iid=" + url.QueryEscape(inviteId) - - if r, err := c.DoApiPost(url, user.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -func (c *Client) CreateUserFromSignup(user *User, data string, hash string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/create?d="+url.QueryEscape(data)+"&h="+hash, user.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -// GetUser returns a user based on a provided user id string. Must be authenticated. -func (c *Client) GetUser(id string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/"+id+"/get", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -// getByUsername returns a user based on a provided username string. Must be authenticated. -func (c *Client) GetByUsername(username string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/users/name/%v", username), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -// getByEmail returns a user based on a provided username string. Must be authenticated. -func (c *Client) GetByEmail(email string, etag string) (*User, *ResponseMetadata) { - if r, err := c.DoApiGet(fmt.Sprintf("/users/email/%v", email), "", etag); err != nil { - return nil, &ResponseMetadata{StatusCode: r.StatusCode, Error: err} - } else { - defer closeBody(r) - return UserFromJson(r.Body), - &ResponseMetadata{ - StatusCode: r.StatusCode, - RequestId: r.Header.Get(HEADER_REQUEST_ID), - Etag: r.Header.Get(HEADER_ETAG_SERVER), - } - } -} - -// GetMe returns the current user. -func (c *Client) GetMe(etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/me", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -// GetProfiles returns a map of users using user id as the key. Must be authenticated. -func (c *Client) GetProfiles(offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/users/%v/%v", offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil - } -} - -// GetProfilesInTeam returns a map of users for a team using user id as the key. Must -// be authenticated. -func (c *Client) GetProfilesInTeam(teamId string, offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/teams/%v/users/%v/%v", teamId, offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil - } -} - -// GetProfilesInChannel returns a map of users for a channel using user id as the key. Must -// be authenticated. -func (c *Client) GetProfilesInChannel(channelId string, offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf(c.GetChannelRoute(channelId)+"/users/%v/%v", offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil - } -} - -// GetProfilesNotInChannel returns a map of users not in a channel but on the team using user id as the key. Must -// be authenticated. -func (c *Client) GetProfilesNotInChannel(channelId string, offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf(c.GetChannelRoute(channelId)+"/users/not_in_channel/%v/%v", offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil - } -} - -// GetProfilesByIds returns a map of users based on the user ids provided. Must -// be authenticated. -func (c *Client) GetProfilesByIds(userIds []string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/ids", ArrayToJson(userIds)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil - } -} - -// SearchUsers returns a list of users that have a username matching or similar to the search term. Must -// be authenticated. -func (c *Client) SearchUsers(params UserSearch) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/search", params.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserListFromJson(r.Body)}, nil - } -} - -// AutocompleteUsersInChannel returns two lists for autocompletion of users in a channel. The first list "in_channel", -// specifies users in the channel. The second list "out_of_channel" specifies users outside of the -// channel. Term, the string to search against, is required, channel id is also required. Must be authenticated. -func (c *Client) AutocompleteUsersInChannel(term string, channelId string) (*Result, *AppError) { - url := fmt.Sprintf("%s/users/autocomplete?term=%s", c.GetChannelRoute(channelId), url.QueryEscape(term)) - if r, err := c.DoApiGet(url, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserAutocompleteInChannelFromJson(r.Body)}, nil - } -} - -// AutocompleteUsersInTeam returns a list for autocompletion of users in a team. The list "in_team" specifies -// the users in the team that match the provided term, matching against username, full name and -// nickname. Must be authenticated. -func (c *Client) AutocompleteUsersInTeam(term string) (*Result, *AppError) { - url := fmt.Sprintf("%s/users/autocomplete?term=%s", c.GetTeamRoute(), url.QueryEscape(term)) - if r, err := c.DoApiGet(url, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserAutocompleteInTeamFromJson(r.Body)}, nil - } -} - -// AutocompleteUsers returns a list for autocompletion of users on the system that match the provided term, -// matching against username, full name and nickname. Must be authenticated. -func (c *Client) AutocompleteUsers(term string) (*Result, *AppError) { - url := fmt.Sprintf("/users/autocomplete?term=%s", url.QueryEscape(term)) - if r, err := c.DoApiGet(url, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserListFromJson(r.Body)}, nil - } -} - -// LoginById authenticates a user by user id and password. -func (c *Client) LoginById(id string, password string) (*Result, *AppError) { - m := make(map[string]string) - m["id"] = id - m["password"] = password - return c.login(m) -} - -// Login authenticates a user by login id, which can be username, email or some sort -// of SSO identifier based on configuration, and a password. -func (c *Client) Login(loginId string, password string) (*Result, *AppError) { - m := make(map[string]string) - m["login_id"] = loginId - m["password"] = password - return c.login(m) -} - -// LoginByLdap authenticates a user by LDAP id and password. -func (c *Client) LoginByLdap(loginId string, password string) (*Result, *AppError) { - m := make(map[string]string) - m["login_id"] = loginId - m["password"] = password - m["ldap_only"] = "true" - return c.login(m) -} - -// LoginWithDevice authenticates a user by login id (username, email or some sort -// of SSO identifier based on configuration), password and attaches a device id to -// the session. -func (c *Client) LoginWithDevice(loginId string, password string, deviceId string) (*Result, *AppError) { - m := make(map[string]string) - m["login_id"] = loginId - m["password"] = password - m["device_id"] = deviceId - return c.login(m) -} - -func (c *Client) login(m map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/login", MapToJson(m)); err != nil { - return nil, err - } else { - c.AuthToken = r.Header.Get(HEADER_TOKEN) - c.AuthType = HEADER_BEARER - sessionToken := getCookie(SESSION_COOKIE_TOKEN, r) - - if c.AuthToken != sessionToken.Value { - NewAppError("/users/login", "model.client.login.app_error", nil, "", 0) - } - - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -// Logout terminates the current user's session. -func (c *Client) Logout() (*Result, *AppError) { - if r, err := c.DoApiPost("/users/logout", ""); err != nil { - return nil, err - } else { - c.AuthToken = "" - c.AuthType = HEADER_BEARER - c.TeamId = "" - - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// CheckMfa returns a map with key "mfa_required" with the string value "true" or "false", -// indicating whether MFA is required to log the user in, based on a provided login id -// (username, email or some sort of SSO identifier based on configuration). -func (c *Client) CheckMfa(loginId string) (*Result, *AppError) { - m := make(map[string]string) - m["login_id"] = loginId - - if r, err := c.DoApiPost("/users/mfa", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// GenerateMfaSecret returns a QR code image containing the secret, to be scanned -// by a multi-factor authentication mobile application. It also returns the secret -// for manual entry. Must be authenticated. -func (c *Client) GenerateMfaSecret() (*Result, *AppError) { - if r, err := c.DoApiGet("/users/generate_mfa_secret", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// UpdateMfa activates multi-factor authenticates for the current user if activate -// is true and a valid token is provided. If activate is false, then token is not -// required and multi-factor authentication is disabled for the current user. -func (c *Client) UpdateMfa(activate bool, token string) (*Result, *AppError) { - m := make(map[string]interface{}) - m["activate"] = activate - m["token"] = token - - if r, err := c.DoApiPost("/users/update_mfa", StringInterfaceToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) AdminResetMfa(userId string) (*Result, *AppError) { - m := make(map[string]string) - m["user_id"] = userId - - if r, err := c.DoApiPost("/admin/reset_mfa", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) RevokeSession(sessionAltId string) (*Result, *AppError) { - m := make(map[string]string) - m["id"] = sessionAltId - - if r, err := c.DoApiPost("/users/revoke_session", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetSessions(id string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/"+id+"/sessions", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), SessionsFromJson(r.Body)}, nil - } -} - -func (c *Client) EmailToOAuth(m map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/claim/email_to_oauth", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) OAuthToEmail(m map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/claim/oauth_to_email", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) LDAPToEmail(m map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/claim/ldap_to_email", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) EmailToLDAP(m map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/claim/ldap_to_email", MapToJson(m)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) Command(channelId string, command string) (*Result, *AppError) { - args := &CommandArgs{ChannelId: channelId, Command: command} - if r, err := c.DoApiPost(c.GetTeamRoute()+"/commands/execute", args.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CommandResponseFromJson(r.Body)}, nil - } -} - -func (c *Client) ListCommands() (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/commands/list", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CommandListFromJson(r.Body)}, nil - } -} - -func (c *Client) ListTeamCommands() (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/commands/list_team_commands", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CommandListFromJson(r.Body)}, nil - } -} - -func (c *Client) CreateCommand(cmd *Command) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/commands/create", cmd.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CommandFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateCommand(cmd *Command) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/commands/update", cmd.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CommandFromJson(r.Body)}, nil - } -} - -func (c *Client) RegenCommandToken(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/commands/regen_token", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CommandFromJson(r.Body)}, nil - } -} - -func (c *Client) DeleteCommand(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/commands/delete", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetAudits(id string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/users/"+id+"/audits", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), AuditsFromJson(r.Body)}, nil - } -} - -func (c *Client) GetLogs() (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/logs", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ArrayFromJson(r.Body)}, nil - } -} - -func (c *Client) GetClusterStatus() ([]*ClusterInfo, *AppError) { - if r, err := c.DoApiGet("/admin/cluster_status", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return ClusterInfosFromJson(r.Body), nil - } -} - -// GetRecentlyActiveUsers returns a map of users including lastActivityAt using user id as the key -func (c *Client) GetRecentlyActiveUsers(teamId string) (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/recently_active_users/"+teamId, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserMapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetAllAudits() (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/audits", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), AuditsFromJson(r.Body)}, nil - } -} - -func (c *Client) GetConfig() (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/config", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ConfigFromJson(r.Body)}, nil - } -} - -// ReloadConfig will reload the config.json file from disk. Properties -// requiring a server restart will still need a server restart. You must -// have the system admin role to call this method. It will return status=OK -// if it's successfully reloaded the config file, otherwise check the returned error. -func (c *Client) ReloadConfig() (bool, *AppError) { - c.clearExtraProperties() - if r, err := c.DoApiGet("/admin/reload_config", "", ""); err != nil { - return false, err - } else { - c.fillInExtraProperties(r) - return c.CheckStatusOK(r), nil - } -} - -func (c *Client) InvalidateAllCaches() (bool, *AppError) { - c.clearExtraProperties() - if r, err := c.DoApiGet("/admin/invalidate_all_caches", "", ""); err != nil { - return false, err - } else { - c.fillInExtraProperties(r) - return c.CheckStatusOK(r), nil - } -} - -func (c *Client) SaveConfig(config *Config) (*Result, *AppError) { - if r, err := c.DoApiPost("/admin/save_config", config.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// RecycleDatabaseConnection will attempt to recycle the database connections. -// You must have the system admin role to call this method. It will return status=OK -// if it's successfully recycled the connections, otherwise check the returned error. -func (c *Client) RecycleDatabaseConnection() (bool, *AppError) { - c.clearExtraProperties() - if r, err := c.DoApiGet("/admin/recycle_db_conn", "", ""); err != nil { - return false, err - } else { - c.fillInExtraProperties(r) - return c.CheckStatusOK(r), nil - } -} - -func (c *Client) TestEmail(config *Config) (*Result, *AppError) { - if r, err := c.DoApiPost("/admin/test_email", config.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// TestLdap will run a connection test on the current LDAP settings. -// It will return the standard OK response if settings work. Otherwise -// it will return an appropriate error. -func (c *Client) TestLdap(config *Config) (*Result, *AppError) { - if r, err := c.DoApiPost("/admin/ldap_test", config.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetComplianceReports() (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/compliance_reports", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), CompliancesFromJson(r.Body)}, nil - } -} - -func (c *Client) SaveComplianceReport(job *Compliance) (*Result, *AppError) { - if r, err := c.DoApiPost("/admin/save_compliance_report", job.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ComplianceFromJson(r.Body)}, nil - } -} - -func (c *Client) DownloadComplianceReport(id string) (*Result, *AppError) { - var rq *http.Request - rq, _ = http.NewRequest("GET", c.ApiUrl+"/admin/download_compliance_report/"+id, nil) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, "BEARER "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil { - return nil, NewAppError("/admin/download_compliance_report", "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode >= 300 { - defer rp.Body.Close() - return nil, AppErrorFromJson(rp.Body) - } else { - defer closeBody(rp) - return &Result{rp.Header.Get(HEADER_REQUEST_ID), - rp.Header.Get(HEADER_ETAG_SERVER), rp.Body}, nil - } -} - -func (c *Client) GetTeamAnalytics(teamId, name string) (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/analytics/"+teamId+"/"+name, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), AnalyticsRowsFromJson(r.Body)}, nil - } -} - -func (c *Client) GetSystemAnalytics(name string) (*Result, *AppError) { - if r, err := c.DoApiGet("/admin/analytics/"+name, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), AnalyticsRowsFromJson(r.Body)}, nil - } -} - -// Initiate immediate synchronization of LDAP users. -// The synchronization will be performed asynchronously and this function will -// always return OK unless you don't have permissions. -// You must be the system administrator to use this function. -func (c *Client) LdapSyncNow() (*Result, *AppError) { - if r, err := c.DoApiPost("/admin/ldap_sync_now", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) CreateChannel(channel *Channel) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/create", channel.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) CreateDirectChannel(userId string) (*Result, *AppError) { - data := make(map[string]string) - data["user_id"] = userId - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/create_direct", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) CreateGroupChannel(userIds []string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/create_group", ArrayToJson(userIds)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateChannel(channel *Channel) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/update", channel.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateChannelHeader(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/update_header", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateChannelPurpose(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/update_purpose", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateNotifyProps(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/update_notify_props", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetMyChannelMembers() (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/channels/members", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelMembersFromJson(r.Body)}, nil - } -} - -func (c *Client) GetChannel(id, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(id)+"/", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelDataFromJson(r.Body)}, nil - } -} - -// GetMoreChannelsPage will return a page of open channels the user is not in based on -// the provided offset and limit. Must be authenticated. -func (c *Client) GetMoreChannelsPage(offset int, limit int) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf(c.GetTeamRoute()+"/channels/more/%v/%v", offset, limit), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelListFromJson(r.Body)}, nil - } -} - -// SearchMoreChannels will return a list of open channels the user is not in, that matches -// the search criteria provided. Must be authenticated. -func (c *Client) SearchMoreChannels(channelSearch ChannelSearch) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/more/search", channelSearch.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelListFromJson(r.Body)}, nil - } -} - -// AutocompleteChannels will return a list of open channels that match the provided -// string. Must be authenticated. -func (c *Client) AutocompleteChannels(term string) (*Result, *AppError) { - url := fmt.Sprintf("%s/channels/autocomplete?term=%s", c.GetTeamRoute(), url.QueryEscape(term)) - if r, err := c.DoApiGet(url, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetChannelCounts(etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/channels/counts", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelCountsFromJson(r.Body)}, nil - } -} - -func (c *Client) GetChannels(etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/channels/", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetChannelByName(channelName string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelNameRoute(channelName), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelFromJson(r.Body)}, nil - } -} - -func (c *Client) JoinChannel(id string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(id)+"/join", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -func (c *Client) JoinChannelByName(name string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelNameRoute(name)+"/join", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -func (c *Client) LeaveChannel(id string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(id)+"/leave", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -func (c *Client) DeleteChannel(id string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(id)+"/delete", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -func (c *Client) AddChannelMember(id, user_id string) (*Result, *AppError) { - data := make(map[string]string) - data["user_id"] = user_id - if r, err := c.DoApiPost(c.GetChannelRoute(id)+"/add", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -func (c *Client) RemoveChannelMember(id, user_id string) (*Result, *AppError) { - data := make(map[string]string) - data["user_id"] = user_id - if r, err := c.DoApiPost(c.GetChannelRoute(id)+"/remove", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -// ViewChannel performs all the actions related to viewing a channel. This includes marking -// the channel and the previous one as read, and marking the channel as being actively viewed. -// ChannelId is required but may be blank to indicate no channel is being viewed. -// PrevChannelId is optional, populate to indicate a channel switch occurred. -func (c *Client) ViewChannel(params ChannelView) (bool, *ResponseMetadata) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/view", params.ToJson()); err != nil { - return false, &ResponseMetadata{StatusCode: r.StatusCode, Error: err} - } else { - return c.CheckStatusOK(r), - &ResponseMetadata{ - StatusCode: r.StatusCode, - RequestId: r.Header.Get(HEADER_REQUEST_ID), - Etag: r.Header.Get(HEADER_ETAG_SERVER), - } - } -} - -func (c *Client) GetChannelStats(id string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(id)+"/stats", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelStatsFromJson(r.Body)}, nil - } -} - -func (c *Client) GetChannelMember(channelId string, userId string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/members/"+userId, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelMemberFromJson(r.Body)}, nil - } -} - -// GetChannelMembersByIds will return channel member objects as an array based on the -// channel id and a list of user ids provided. Must be authenticated. -func (c *Client) GetChannelMembersByIds(channelId string, userIds []string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/members/ids", ArrayToJson(userIds)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), ChannelMembersFromJson(r.Body)}, nil - } -} - -func (c *Client) CreatePost(post *Post) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(post.ChannelId)+"/posts/create", post.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdatePost(post *Post) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(post.ChannelId)+"/posts/update", post.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPosts(channelId string, offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/page/%v/%v", offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPostsSince(channelId string, time int64) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/since/%v", time), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPostsBefore(channelId string, postid string, offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/before/%v/%v", postid, offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPostsAfter(channelId string, postid string, offset int, limit int, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf(c.GetChannelRoute(channelId)+"/posts/%v/after/%v/%v", postid, offset, limit), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPost(channelId string, postId string, etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/get", postId), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -// GetPostById returns a post and any posts in the same thread by post id -func (c *Client) GetPostById(postId string, etag string) (*PostList, *ResponseMetadata) { - if r, err := c.DoApiGet(c.GetTeamRoute()+fmt.Sprintf("/posts/%v", postId), "", etag); err != nil { - return nil, &ResponseMetadata{StatusCode: r.StatusCode, Error: err} - } else { - defer closeBody(r) - return PostListFromJson(r.Body), - &ResponseMetadata{ - StatusCode: r.StatusCode, - RequestId: r.Header.Get(HEADER_REQUEST_ID), - Etag: r.Header.Get(HEADER_ETAG_SERVER), - } - } -} - -// GetPermalink returns a post list, based on the provided channel and post ID. -func (c *Client) GetPermalink(channelId string, postId string, etag string) (*PostList, *ResponseMetadata) { - if r, err := c.DoApiGet(c.GetTeamRoute()+fmt.Sprintf("/pltmp/%v", postId), "", etag); err != nil { - return nil, &ResponseMetadata{StatusCode: r.StatusCode, Error: err} - } else { - defer closeBody(r) - return PostListFromJson(r.Body), - &ResponseMetadata{ - StatusCode: r.StatusCode, - RequestId: r.Header.Get(HEADER_REQUEST_ID), - Etag: r.Header.Get(HEADER_ETAG_SERVER), - } - } -} - -func (c *Client) DeletePost(channelId string, postId string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/delete", postId), ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) SearchPosts(terms string, isOrSearch bool) (*Result, *AppError) { - data := map[string]interface{}{} - data["terms"] = terms - data["is_or_search"] = isOrSearch - if r, err := c.DoApiPost(c.GetTeamRoute()+"/posts/search", StringInterfaceToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -// GetFlaggedPosts will return a post list of posts that have been flagged by the user. -// The page is set by the integer parameters offset and limit. -func (c *Client) GetFlaggedPosts(offset int, limit int) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+fmt.Sprintf("/posts/flagged/%v/%v", offset, limit), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPinnedPosts(channelId string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/pinned", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostListFromJson(r.Body)}, nil - } -} - -func (c *Client) UploadProfileFile(data []byte, contentType string) (*Result, *AppError) { - return c.uploadFile(c.ApiUrl+"/users/newimage", data, contentType) -} - -func (c *Client) UploadPostAttachment(data []byte, channelId string, filename string) (*FileUploadResponse, *AppError) { - c.clearExtraProperties() - - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("files", filename); err != nil { - return nil, NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.file.app_error", nil, err.Error(), 0) - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return nil, NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.file.app_error", nil, err.Error(), 0) - } - - if part, err := writer.CreateFormField("channel_id"); err != nil { - return nil, NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.channel_id.app_error", nil, err.Error(), 0) - } else if _, err = io.Copy(part, strings.NewReader(channelId)); err != nil { - return nil, NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.channel_id.app_error", nil, err.Error(), 0) - } - - if err := writer.Close(); err != nil { - return nil, NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.writer.app_error", nil, err.Error(), 0) - } - - if result, err := c.uploadFile(c.ApiUrl+c.GetTeamRoute()+"/files/upload", body.Bytes(), writer.FormDataContentType()); err != nil { - return nil, err - } else { - return result.Data.(*FileUploadResponse), nil - } -} - -func (c *Client) uploadFile(url string, data []byte, contentType string) (*Result, *AppError) { - rq, _ := http.NewRequest("POST", url, bytes.NewReader(data)) - rq.Header.Set("Content-Type", contentType) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, "BEARER "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil { - return nil, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode >= 300 { - return nil, AppErrorFromJson(rp.Body) - } else { - defer closeBody(rp) - return &Result{rp.Header.Get(HEADER_REQUEST_ID), - rp.Header.Get(HEADER_ETAG_SERVER), FileUploadResponseFromJson(rp.Body)}, nil - } -} - -func (c *Client) GetFile(fileId string) (io.ReadCloser, *AppError) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/get", "", ""); err != nil { - return nil, err - } else { - c.fillInExtraProperties(r) - return r.Body, nil - } -} - -func (c *Client) GetFileThumbnail(fileId string) (io.ReadCloser, *AppError) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/get_thumbnail", "", ""); err != nil { - return nil, err - } else { - c.fillInExtraProperties(r) - return r.Body, nil - } -} - -func (c *Client) GetFilePreview(fileId string) (io.ReadCloser, *AppError) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/get_preview", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return r.Body, nil - } -} - -func (c *Client) GetFileInfo(fileId string) (*FileInfo, *AppError) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/get_info", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return FileInfoFromJson(r.Body), nil - } -} - -func (c *Client) GetPublicLink(fileId string) (string, *AppError) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/get_public_link", "", ""); err != nil { - return "", err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return StringFromJson(r.Body), nil - } -} - -func (c *Client) UpdateUser(user *User) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/update", user.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateUserRoles(userId string, roles string) (*Result, *AppError) { - data := make(map[string]string) - data["new_roles"] = roles - - if r, err := c.DoApiPost(c.GetUserRequiredRoute(userId)+"/update_roles", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateTeamRoles(userId string, roles string) (*Result, *AppError) { - data := make(map[string]string) - data["new_roles"] = roles - data["user_id"] = userId - - if r, err := c.DoApiPost(c.GetTeamRoute()+"/update_member_roles", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) AttachDeviceId(deviceId string) (*Result, *AppError) { - data := make(map[string]string) - data["device_id"] = deviceId - if r, err := c.DoApiPost("/users/attach_device", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateActive(userId string, active bool) (*Result, *AppError) { - data := make(map[string]string) - data["user_id"] = userId - data["active"] = strconv.FormatBool(active) - if r, err := c.DoApiPost("/users/update_active", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateUserNotify(data map[string]string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/update_notify", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), UserFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateUserPassword(userId, currentPassword, newPassword string) (*Result, *AppError) { - data := make(map[string]string) - data["current_password"] = currentPassword - data["new_password"] = newPassword - data["user_id"] = userId - - if r, err := c.DoApiPost("/users/newpassword", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) SendPasswordReset(email string) (*Result, *AppError) { - data := map[string]string{} - data["email"] = email - if r, err := c.DoApiPost("/users/send_password_reset", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) ResetPassword(code, newPassword string) (*Result, *AppError) { - data := map[string]string{} - data["code"] = code - data["new_password"] = newPassword - if r, err := c.DoApiPost("/users/reset_password", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) AdminResetPassword(userId, newPassword string) (*Result, *AppError) { - data := map[string]string{} - data["user_id"] = userId - data["new_password"] = newPassword - if r, err := c.DoApiPost("/admin/reset_password", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// GetStatuses returns a map of string statuses using user id as the key -func (c *Client) GetStatuses() (*Result, *AppError) { - if r, err := c.DoApiGet("/users/status", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// GetStatusesByIds returns a map of string statuses using user id as the key, -// based on the provided user ids -func (c *Client) GetStatusesByIds(userIds []string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/status/ids", ArrayToJson(userIds)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetMyTeam(etag string) (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/me", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamFromJson(r.Body)}, nil - } -} - -// GetTeamMembers will return a page of team member objects as an array paged based on the -// team id, offset and limit provided. Must be authenticated. -func (c *Client) GetTeamMembers(teamId string, offset int, limit int) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/teams/%v/members/%v/%v", teamId, offset, limit), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamMembersFromJson(r.Body)}, nil - } -} - -// GetMyTeamMembers will return an array with team member objects that the current user -// is a member of. Must be authenticated. -func (c *Client) GetMyTeamMembers() (*Result, *AppError) { - if r, err := c.DoApiGet("/teams/members", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamMembersFromJson(r.Body)}, nil - } -} - -// GetMyTeamsUnread will return an array with TeamUnread objects that contain the amount of -// unread messages and mentions the current user has for the teams it belongs to. -// An optional team ID can be set to exclude that team from the results. Must be authenticated. -func (c *Client) GetMyTeamsUnread(teamId string) (*Result, *AppError) { - endpoint := "/teams/unread" - - if teamId != "" { - endpoint += fmt.Sprintf("?id=%s", url.QueryEscape(teamId)) - } - if r, err := c.DoApiGet(endpoint, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamsUnreadFromJson(r.Body)}, nil - } -} - -// GetTeamMember will return a team member object based on the team id and user id provided. -// Must be authenticated. -func (c *Client) GetTeamMember(teamId string, userId string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/teams/%v/members/%v", teamId, userId), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamMemberFromJson(r.Body)}, nil - } -} - -// GetTeamStats will return a team stats object containing the number of users on the team -// based on the team id provided. Must be authenticated. -func (c *Client) GetTeamStats(teamId string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/teams/%v/stats", teamId), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamStatsFromJson(r.Body)}, nil - } -} - -// GetTeamByName will return a team object based on the team name provided. Must be authenticated. -func (c *Client) GetTeamByName(teamName string) (*Result, *AppError) { - if r, err := c.DoApiGet(fmt.Sprintf("/teams/name/%v", teamName), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamFromJson(r.Body)}, nil - } -} - -// GetTeamMembersByIds will return team member objects as an array based on the -// team id and a list of user ids provided. Must be authenticated. -func (c *Client) GetTeamMembersByIds(teamId string, userIds []string) (*Result, *AppError) { - if r, err := c.DoApiPost(fmt.Sprintf("/teams/%v/members/ids", teamId), ArrayToJson(userIds)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), TeamMembersFromJson(r.Body)}, nil - } -} - -// RegisterApp creates a new OAuth2 app to be used with the OAuth2 Provider. On success -// it returns the created app. Must be authenticated as a user. -func (c *Client) RegisterApp(app *OAuthApp) (*Result, *AppError) { - if r, err := c.DoApiPost("/oauth/register", app.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OAuthAppFromJson(r.Body)}, nil - } -} - -// AllowOAuth allows a new session by an OAuth2 App. On success -// it returns the url to be redirected back to the app which initiated the oauth2 flow. -// Must be authenticated as a user. -func (c *Client) AllowOAuth(rspType, clientId, redirect, scope, state string) (*Result, *AppError) { - if r, err := c.DoApiGet("/oauth/allow?response_type="+rspType+"&client_id="+clientId+"&redirect_uri="+url.QueryEscape(redirect)+"&scope="+scope+"&state="+url.QueryEscape(state), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// GetOAuthAppsByUser returns the OAuth2 Apps registered by the user. On success -// it returns a list of OAuth2 Apps from the same user or all the registered apps if the user -// is a System Administrator. Must be authenticated as a user. -func (c *Client) GetOAuthAppsByUser() (*Result, *AppError) { - if r, err := c.DoApiGet("/oauth/list", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OAuthAppListFromJson(r.Body)}, nil - } -} - -// GetOAuthAppInfo lookup an OAuth2 App using the client_id. On success -// it returns a Sanitized OAuth2 App. Must be authenticated as a user. -func (c *Client) GetOAuthAppInfo(clientId string) (*Result, *AppError) { - if r, err := c.DoApiGet("/oauth/app/"+clientId, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OAuthAppFromJson(r.Body)}, nil - } -} - -// DeleteOAuthApp deletes an OAuth2 app, the app must be deleted by the same user who created it or -// a System Administrator. On success returs Status OK. Must be authenticated as a user. -func (c *Client) DeleteOAuthApp(id string) (*Result, *AppError) { - data := make(map[string]string) - data["id"] = id - if r, err := c.DoApiPost("/oauth/delete", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -// GetOAuthAuthorizedApps returns the OAuth2 Apps authorized by the user. On success -// it returns a list of sanitized OAuth2 Authorized Apps by the user. -func (c *Client) GetOAuthAuthorizedApps() (*Result, *AppError) { - if r, err := c.DoApiGet("/oauth/authorized", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OAuthAppListFromJson(r.Body)}, nil - } -} - -// OAuthDeauthorizeApp deauthorize a user an OAuth 2.0 app. On success -// it returns status OK or an AppError on fail. -func (c *Client) OAuthDeauthorizeApp(clientId string) *AppError { - if r, err := c.DoApiPost("/oauth/"+clientId+"/deauthorize", ""); err != nil { - return err - } else { - defer closeBody(r) - return nil - } -} - -// RegenerateOAuthAppSecret generates a new OAuth App Client Secret. On success -// it returns an OAuth2 App. Must be authenticated as a user and the same user who -// registered the app or a System Admin. -func (c *Client) RegenerateOAuthAppSecret(clientId string) (*Result, *AppError) { - if r, err := c.DoApiPost("/oauth/"+clientId+"/regen_secret", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OAuthAppFromJson(r.Body)}, nil - } -} - -func (c *Client) GetAccessToken(data url.Values) (*Result, *AppError) { - if r, err := c.DoPost("/oauth/access_token", data.Encode(), "application/x-www-form-urlencoded"); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), AccessResponseFromJson(r.Body)}, nil - } -} - -func (c *Client) CreateIncomingWebhook(hook *IncomingWebhook) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/incoming/create", hook.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), IncomingWebhookFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateIncomingWebhook(hook *IncomingWebhook) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/incoming/update", hook.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), IncomingWebhookFromJson(r.Body)}, nil - } -} - -func (c *Client) PostToWebhook(id, payload string) (*Result, *AppError) { - if r, err := c.DoPost("/hooks/"+id, payload, "application/x-www-form-urlencoded"); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), nil}, nil - } -} - -func (c *Client) DeleteIncomingWebhook(id string) (*Result, *AppError) { - data := make(map[string]string) - data["id"] = id - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/incoming/delete", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) ListIncomingWebhooks() (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/hooks/incoming/list", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), IncomingWebhookListFromJson(r.Body)}, nil - } -} - -func (c *Client) GetAllPreferences() (*Result, *AppError) { - if r, err := c.DoApiGet("/preferences/", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - preferences, _ := PreferencesFromJson(r.Body) - return &Result{r.Header.Get(HEADER_REQUEST_ID), r.Header.Get(HEADER_ETAG_SERVER), preferences}, nil - } -} - -func (c *Client) SetPreferences(preferences *Preferences) (*Result, *AppError) { - if r, err := c.DoApiPost("/preferences/save", preferences.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), preferences}, nil - } -} - -func (c *Client) GetPreference(category string, name string) (*Result, *AppError) { - if r, err := c.DoApiGet("/preferences/"+category+"/"+name, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), r.Header.Get(HEADER_ETAG_SERVER), PreferenceFromJson(r.Body)}, nil - } -} - -func (c *Client) GetPreferenceCategory(category string) (*Result, *AppError) { - if r, err := c.DoApiGet("/preferences/"+category, "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - preferences, _ := PreferencesFromJson(r.Body) - return &Result{r.Header.Get(HEADER_REQUEST_ID), r.Header.Get(HEADER_ETAG_SERVER), preferences}, nil - } -} - -// DeletePreferences deletes a list of preferences owned by the current user. If successful, -// it will return status=ok. Otherwise, an error will be returned. -func (c *Client) DeletePreferences(preferences *Preferences) (bool, *AppError) { - if r, err := c.DoApiPost("/preferences/delete", preferences.ToJson()); err != nil { - return false, err - } else { - return c.CheckStatusOK(r), nil - } -} - -func (c *Client) CreateOutgoingWebhook(hook *OutgoingWebhook) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/outgoing/create", hook.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OutgoingWebhookFromJson(r.Body)}, nil - } -} - -func (c *Client) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/outgoing/update", hook.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OutgoingWebhookFromJson(r.Body)}, nil - } -} - -func (c *Client) DeleteOutgoingWebhook(id string) (*Result, *AppError) { - data := make(map[string]string) - data["id"] = id - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/outgoing/delete", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) ListOutgoingWebhooks() (*Result, *AppError) { - if r, err := c.DoApiGet(c.GetTeamRoute()+"/hooks/outgoing/list", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OutgoingWebhookListFromJson(r.Body)}, nil - } -} - -func (c *Client) RegenOutgoingWebhookToken(id string) (*Result, *AppError) { - data := make(map[string]string) - data["id"] = id - if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/outgoing/regen_token", MapToJson(data)); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), OutgoingWebhookFromJson(r.Body)}, nil - } -} - -func (c *Client) MockSession(sessionToken string) { - c.AuthToken = sessionToken - c.AuthType = HEADER_BEARER -} - -func (c *Client) GetClientLicenceConfig(etag string) (*Result, *AppError) { - if r, err := c.DoApiGet("/license/client_config", "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil - } -} - -func (c *Client) GetInitialLoad() (*Result, *AppError) { - if r, err := c.DoApiGet("/users/initial_load", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), InitialLoadFromJson(r.Body)}, nil - } -} - -// ListEmoji returns a list of all user-created emoji for the server. -func (c *Client) ListEmoji() ([]*Emoji, *AppError) { - if r, err := c.DoApiGet(c.GetEmojiRoute()+"/list", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return EmojiListFromJson(r.Body), nil - } -} - -// CreateEmoji will save an emoji to the server if the current user has permission -// to do so. If successful, the provided emoji will be returned with its Id field -// filled in. Otherwise, an error will be returned. -func (c *Client) CreateEmoji(emoji *Emoji, image []byte, filename string) (*Emoji, *AppError) { - c.clearExtraProperties() - - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("image", filename); err != nil { - return nil, NewAppError("CreateEmoji", "model.client.create_emoji.image.app_error", nil, err.Error(), 0) - } else if _, err = io.Copy(part, bytes.NewBuffer(image)); err != nil { - return nil, NewAppError("CreateEmoji", "model.client.create_emoji.image.app_error", nil, err.Error(), 0) - } - - if err := writer.WriteField("emoji", emoji.ToJson()); err != nil { - return nil, NewAppError("CreateEmoji", "model.client.create_emoji.emoji.app_error", nil, err.Error(), 0) - } - - if err := writer.Close(); err != nil { - return nil, NewAppError("CreateEmoji", "model.client.create_emoji.writer.app_error", nil, err.Error(), 0) - } - - rq, _ := http.NewRequest("POST", c.ApiUrl+c.GetEmojiRoute()+"/create", body) - rq.Header.Set("Content-Type", writer.FormDataContentType()) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, "BEARER "+c.AuthToken) - } - - if r, err := c.HttpClient.Do(rq); err != nil { - return nil, NewAppError("CreateEmoji", "model.client.connecting.app_error", nil, err.Error(), 0) - } else if r.StatusCode >= 300 { - return nil, AppErrorFromJson(r.Body) - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return EmojiFromJson(r.Body), nil - } -} - -// DeleteEmoji will delete an emoji from the server if the current user has permission -// to do so. If successful, it will return status=ok. Otherwise, an error will be returned. -func (c *Client) DeleteEmoji(id string) (bool, *AppError) { - data := map[string]string{"id": id} - - if r, err := c.DoApiPost(c.GetEmojiRoute()+"/delete", MapToJson(data)); err != nil { - return false, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return c.CheckStatusOK(r), nil - } -} - -// GetCustomEmojiImageUrl returns the API route that can be used to get the image used by -// the given emoji. -func (c *Client) GetCustomEmojiImageUrl(id string) string { - return c.GetEmojiRoute() + "/" + id -} - -// Uploads a x509 base64 Certificate or Private Key file to be used with SAML. -// data byte array is required and needs to be a Multi-Part with 'certificate' as the field name -// contentType is also required. Returns nil if succesful, otherwise returns an AppError -func (c *Client) UploadCertificateFile(data []byte, contentType string) *AppError { - url := c.ApiUrl + "/admin/add_certificate" - rq, _ := http.NewRequest("POST", url, bytes.NewReader(data)) - rq.Header.Set("Content-Type", contentType) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, "BEARER "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil { - return NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode >= 300 { - return AppErrorFromJson(rp.Body) - } else { - defer closeBody(rp) - c.fillInExtraProperties(rp) - return nil - } -} - -// Removes a x509 base64 Certificate or Private Key file used with SAML. -// filename is required. Returns nil if successful, otherwise returns an AppError -func (c *Client) RemoveCertificateFile(filename string) *AppError { - if r, err := c.DoApiPost("/admin/remove_certificate", MapToJson(map[string]string{"filename": filename})); err != nil { - return err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return nil - } -} - -// Checks if the x509 base64 Certificates and Private Key files used with SAML exists on the file system. -// Returns a map[string]interface{} if successful, otherwise returns an AppError. Must be System Admin authenticated. -func (c *Client) SamlCertificateStatus(filename string) (map[string]interface{}, *AppError) { - if r, err := c.DoApiGet("/admin/remove_certificate", "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return StringInterfaceFromJson(r.Body), nil - } -} - -// GetWebrtcToken if Successful returns a map with a valid token, stun server and turn server with credentials to use with -// the Mattermost WebRTC service, otherwise returns an AppError. Must be authenticated user. -func (c *Client) GetWebrtcToken() (map[string]string, *AppError) { - if r, err := c.DoApiPost("/webrtc/token", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return MapFromJson(r.Body), nil - } -} - -// GetFileInfosForPost returns a list of FileInfo objects for a given post id, if successful. -// Otherwise, it returns an error. -func (c *Client) GetFileInfosForPost(channelId string, postId string, etag string) ([]*FileInfo, *AppError) { - c.clearExtraProperties() - - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/get_file_infos", postId), "", etag); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return FileInfosFromJson(r.Body), nil - } -} - -// Saves an emoji reaction for a post in the given channel. Returns the saved reaction if successful, otherwise returns an AppError. -func (c *Client) SaveReaction(channelId string, reaction *Reaction) (*Reaction, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/reactions/save", reaction.PostId), reaction.ToJson()); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return ReactionFromJson(r.Body), nil - } -} - -// Removes an emoji reaction for a post in the given channel. Returns nil if successful, otherwise returns an AppError. -func (c *Client) DeleteReaction(channelId string, reaction *Reaction) *AppError { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/reactions/delete", reaction.PostId), reaction.ToJson()); err != nil { - return err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return nil - } -} - -// Lists all emoji reactions made for the given post in the given channel. Returns a list of Reactions if successful, otherwise returns an AppError. -func (c *Client) ListReactions(channelId string, postId string) ([]*Reaction, *AppError) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+fmt.Sprintf("/posts/%v/reactions", postId), "", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - c.fillInExtraProperties(r) - return ReactionsFromJson(r.Body), nil - } -} - -// Updates the user's roles in the channel by replacing them with the roles provided. -func (c *Client) UpdateChannelRoles(channelId string, userId string, roles string) (map[string]string, *ResponseMetadata) { - data := make(map[string]string) - data["new_roles"] = roles - data["user_id"] = userId - - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/update_member_roles", MapToJson(data)); err != nil { - metadata := ResponseMetadata{Error: err} - if r != nil { - metadata.StatusCode = r.StatusCode - } - return nil, &metadata - } else { - defer closeBody(r) - return MapFromJson(r.Body), - &ResponseMetadata{ - StatusCode: r.StatusCode, - RequestId: r.Header.Get(HEADER_REQUEST_ID), - Etag: r.Header.Get(HEADER_ETAG_SERVER), - } - } -} - -func (c *Client) PinPost(channelId string, postId string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/posts/"+postId+"/pin", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostFromJson(r.Body)}, nil - } -} - -func (c *Client) UnpinPost(channelId string, postId string) (*Result, *AppError) { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/posts/"+postId+"/unpin", ""); err != nil { - return nil, err - } else { - defer closeBody(r) - return &Result{r.Header.Get(HEADER_REQUEST_ID), - r.Header.Get(HEADER_ETAG_SERVER), PostFromJson(r.Body)}, nil - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/client4.go b/vendor/github.com/mattermost/mattermost-server/model/client4.go deleted file mode 100644 index 962b816b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/client4.go +++ /dev/null @@ -1,3299 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/url" - "strconv" - "strings" -) - -type Response struct { - StatusCode int - Error *AppError - RequestId string - Etag string - ServerVersion string - Header http.Header -} - -type Client4 struct { - Url string // The location of the server, for example "http://localhost:8065" - ApiUrl string // The api location of the server, for example "http://localhost:8065/api/v4" - HttpClient *http.Client // The http client - AuthToken string - AuthType string -} - -func NewAPIv4Client(url string) *Client4 { - return &Client4{url, url + API_URL_SUFFIX, &http.Client{}, "", ""} -} - -func BuildErrorResponse(r *http.Response, err *AppError) *Response { - var statusCode int - var header http.Header - if r != nil { - statusCode = r.StatusCode - header = r.Header - } else { - statusCode = 0 - header = make(http.Header) - } - - return &Response{ - StatusCode: statusCode, - Error: err, - Header: header, - } -} - -func BuildResponse(r *http.Response) *Response { - return &Response{ - StatusCode: r.StatusCode, - RequestId: r.Header.Get(HEADER_REQUEST_ID), - Etag: r.Header.Get(HEADER_ETAG_SERVER), - ServerVersion: r.Header.Get(HEADER_VERSION_ID), - Header: r.Header, - } -} - -func (c *Client4) SetOAuthToken(token string) { - c.AuthToken = token - c.AuthType = HEADER_TOKEN -} - -func (c *Client4) ClearOAuthToken() { - c.AuthToken = "" - c.AuthType = HEADER_BEARER -} - -func (c *Client4) GetUsersRoute() string { - return fmt.Sprintf("/users") -} - -func (c *Client4) GetUserRoute(userId string) string { - return fmt.Sprintf(c.GetUsersRoute()+"/%v", userId) -} - -func (c *Client4) GetUserAccessTokensRoute() string { - return fmt.Sprintf(c.GetUsersRoute() + "/tokens") -} - -func (c *Client4) GetUserAccessTokenRoute(tokenId string) string { - return fmt.Sprintf(c.GetUsersRoute()+"/tokens/%v", tokenId) -} - -func (c *Client4) GetUserByUsernameRoute(userName string) string { - return fmt.Sprintf(c.GetUsersRoute()+"/username/%v", userName) -} - -func (c *Client4) GetUserByEmailRoute(email string) string { - return fmt.Sprintf(c.GetUsersRoute()+"/email/%v", email) -} - -func (c *Client4) GetTeamsRoute() string { - return fmt.Sprintf("/teams") -} - -func (c *Client4) GetTeamRoute(teamId string) string { - return fmt.Sprintf(c.GetTeamsRoute()+"/%v", teamId) -} - -func (c *Client4) GetTeamAutoCompleteCommandsRoute(teamId string) string { - return fmt.Sprintf(c.GetTeamsRoute()+"/%v/commands/autocomplete", teamId) -} - -func (c *Client4) GetTeamByNameRoute(teamName string) string { - return fmt.Sprintf(c.GetTeamsRoute()+"/name/%v", teamName) -} - -func (c *Client4) GetTeamMemberRoute(teamId, userId string) string { - return fmt.Sprintf(c.GetTeamRoute(teamId)+"/members/%v", userId) -} - -func (c *Client4) GetTeamMembersRoute(teamId string) string { - return fmt.Sprintf(c.GetTeamRoute(teamId) + "/members") -} - -func (c *Client4) GetTeamStatsRoute(teamId string) string { - return fmt.Sprintf(c.GetTeamRoute(teamId) + "/stats") -} - -func (c *Client4) GetTeamImportRoute(teamId string) string { - return fmt.Sprintf(c.GetTeamRoute(teamId) + "/import") -} - -func (c *Client4) GetChannelsRoute() string { - return fmt.Sprintf("/channels") -} - -func (c *Client4) GetChannelsForTeamRoute(teamId string) string { - return fmt.Sprintf(c.GetTeamRoute(teamId) + "/channels") -} - -func (c *Client4) GetChannelRoute(channelId string) string { - return fmt.Sprintf(c.GetChannelsRoute()+"/%v", channelId) -} - -func (c *Client4) GetChannelByNameRoute(channelName, teamId string) string { - return fmt.Sprintf(c.GetTeamRoute(teamId)+"/channels/name/%v", channelName) -} - -func (c *Client4) GetChannelByNameForTeamNameRoute(channelName, teamName string) string { - return fmt.Sprintf(c.GetTeamByNameRoute(teamName)+"/channels/name/%v", channelName) -} - -func (c *Client4) GetChannelMembersRoute(channelId string) string { - return fmt.Sprintf(c.GetChannelRoute(channelId) + "/members") -} - -func (c *Client4) GetChannelMemberRoute(channelId, userId string) string { - return fmt.Sprintf(c.GetChannelMembersRoute(channelId)+"/%v", userId) -} - -func (c *Client4) GetPostsRoute() string { - return fmt.Sprintf("/posts") -} - -func (c *Client4) GetConfigRoute() string { - return fmt.Sprintf("/config") -} - -func (c *Client4) GetLicenseRoute() string { - return fmt.Sprintf("/license") -} - -func (c *Client4) GetPostRoute(postId string) string { - return fmt.Sprintf(c.GetPostsRoute()+"/%v", postId) -} - -func (c *Client4) GetFilesRoute() string { - return fmt.Sprintf("/files") -} - -func (c *Client4) GetFileRoute(fileId string) string { - return fmt.Sprintf(c.GetFilesRoute()+"/%v", fileId) -} - -func (c *Client4) GetPluginsRoute() string { - return fmt.Sprintf("/plugins") -} - -func (c *Client4) GetPluginRoute(pluginId string) string { - return fmt.Sprintf(c.GetPluginsRoute()+"/%v", pluginId) -} - -func (c *Client4) GetSystemRoute() string { - return fmt.Sprintf("/system") -} - -func (c *Client4) GetTestEmailRoute() string { - return fmt.Sprintf("/email/test") -} - -func (c *Client4) GetDatabaseRoute() string { - return fmt.Sprintf("/database") -} - -func (c *Client4) GetCacheRoute() string { - return fmt.Sprintf("/caches") -} - -func (c *Client4) GetClusterRoute() string { - return fmt.Sprintf("/cluster") -} - -func (c *Client4) GetIncomingWebhooksRoute() string { - return fmt.Sprintf("/hooks/incoming") -} - -func (c *Client4) GetIncomingWebhookRoute(hookID string) string { - return fmt.Sprintf(c.GetIncomingWebhooksRoute()+"/%v", hookID) -} - -func (c *Client4) GetComplianceReportsRoute() string { - return fmt.Sprintf("/compliance/reports") -} - -func (c *Client4) GetComplianceReportRoute(reportId string) string { - return fmt.Sprintf("/compliance/reports/%v", reportId) -} - -func (c *Client4) GetOutgoingWebhooksRoute() string { - return fmt.Sprintf("/hooks/outgoing") -} - -func (c *Client4) GetOutgoingWebhookRoute(hookID string) string { - return fmt.Sprintf(c.GetOutgoingWebhooksRoute()+"/%v", hookID) -} - -func (c *Client4) GetPreferencesRoute(userId string) string { - return fmt.Sprintf(c.GetUserRoute(userId) + "/preferences") -} - -func (c *Client4) GetUserStatusRoute(userId string) string { - return fmt.Sprintf(c.GetUserRoute(userId) + "/status") -} - -func (c *Client4) GetUserStatusesRoute() string { - return fmt.Sprintf(c.GetUsersRoute() + "/status") -} - -func (c *Client4) GetSamlRoute() string { - return fmt.Sprintf("/saml") -} - -func (c *Client4) GetLdapRoute() string { - return fmt.Sprintf("/ldap") -} - -func (c *Client4) GetBrandRoute() string { - return fmt.Sprintf("/brand") -} - -func (c *Client4) GetDataRetentionRoute() string { - return fmt.Sprintf("/data_retention") -} - -func (c *Client4) GetElasticsearchRoute() string { - return fmt.Sprintf("/elasticsearch") -} - -func (c *Client4) GetCommandsRoute() string { - return fmt.Sprintf("/commands") -} - -func (c *Client4) GetCommandRoute(commandId string) string { - return fmt.Sprintf(c.GetCommandsRoute()+"/%v", commandId) -} - -func (c *Client4) GetEmojisRoute() string { - return fmt.Sprintf("/emoji") -} - -func (c *Client4) GetEmojiRoute(emojiId string) string { - return fmt.Sprintf(c.GetEmojisRoute()+"/%v", emojiId) -} - -func (c *Client4) GetEmojiByNameRoute(name string) string { - return fmt.Sprintf(c.GetEmojisRoute()+"/name/%v", name) -} - -func (c *Client4) GetReactionsRoute() string { - return fmt.Sprintf("/reactions") -} - -func (c *Client4) GetOAuthAppsRoute() string { - return fmt.Sprintf("/oauth/apps") -} - -func (c *Client4) GetOAuthAppRoute(appId string) string { - return fmt.Sprintf("/oauth/apps/%v", appId) -} - -func (c *Client4) GetOpenGraphRoute() string { - return fmt.Sprintf("/opengraph") -} - -func (c *Client4) GetJobsRoute() string { - return fmt.Sprintf("/jobs") -} - -func (c *Client4) GetAnalyticsRoute() string { - return fmt.Sprintf("/analytics") -} - -func (c *Client4) DoApiGet(url string, etag string) (*http.Response, *AppError) { - return c.DoApiRequest(http.MethodGet, c.ApiUrl+url, "", etag) -} - -func (c *Client4) DoApiPost(url string, data string) (*http.Response, *AppError) { - return c.DoApiRequest(http.MethodPost, c.ApiUrl+url, data, "") -} - -func (c *Client4) DoApiPut(url string, data string) (*http.Response, *AppError) { - return c.DoApiRequest(http.MethodPut, c.ApiUrl+url, data, "") -} - -func (c *Client4) DoApiDelete(url string) (*http.Response, *AppError) { - return c.DoApiRequest(http.MethodDelete, c.ApiUrl+url, "", "") -} - -func (c *Client4) DoApiRequest(method, url, data, etag string) (*http.Response, *AppError) { - rq, _ := http.NewRequest(method, url, strings.NewReader(data)) - rq.Close = true - - if len(etag) > 0 { - rq.Header.Set(HEADER_ETAG_CLIENT, etag) - } - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return nil, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0) - } else if rp.StatusCode == 304 { - return rp, nil - } else if rp.StatusCode >= 300 { - defer closeBody(rp) - return rp, AppErrorFromJson(rp.Body) - } else { - return rp, nil - } -} - -func (c *Client4) DoUploadFile(url string, data []byte, contentType string) (*FileUploadResponse, *Response) { - rq, _ := http.NewRequest("POST", c.ApiUrl+url, bytes.NewReader(data)) - rq.Header.Set("Content-Type", contentType) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return nil, BuildErrorResponse(rp, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0)) - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return nil, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return FileUploadResponseFromJson(rp.Body), BuildResponse(rp) - } - } -} - -func (c *Client4) DoEmojiUploadFile(url string, data []byte, contentType string) (*Emoji, *Response) { - rq, _ := http.NewRequest("POST", c.ApiUrl+url, bytes.NewReader(data)) - rq.Header.Set("Content-Type", contentType) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return nil, BuildErrorResponse(rp, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0)) - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return nil, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return EmojiFromJson(rp.Body), BuildResponse(rp) - } - } -} - -func (c *Client4) DoUploadImportTeam(url string, data []byte, contentType string) (map[string]string, *Response) { - rq, _ := http.NewRequest("POST", c.ApiUrl+url, bytes.NewReader(data)) - rq.Header.Set("Content-Type", contentType) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return nil, BuildErrorResponse(rp, NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0)) - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return nil, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return MapFromJson(rp.Body), BuildResponse(rp) - } - } -} - -// CheckStatusOK is a convenience function for checking the standard OK response -// from the web service. -func CheckStatusOK(r *http.Response) bool { - m := MapFromJson(r.Body) - defer closeBody(r) - - if m != nil && m[STATUS] == STATUS_OK { - return true - } - - return false -} - -// Authentication Section - -// LoginById authenticates a user by user id and password. -func (c *Client4) LoginById(id string, password string) (*User, *Response) { - m := make(map[string]string) - m["id"] = id - m["password"] = password - return c.login(m) -} - -// Login authenticates a user by login id, which can be username, email or some sort -// of SSO identifier based on server configuration, and a password. -func (c *Client4) Login(loginId string, password string) (*User, *Response) { - m := make(map[string]string) - m["login_id"] = loginId - m["password"] = password - return c.login(m) -} - -// LoginByLdap authenticates a user by LDAP id and password. -func (c *Client4) LoginByLdap(loginId string, password string) (*User, *Response) { - m := make(map[string]string) - m["login_id"] = loginId - m["password"] = password - m["ldap_only"] = "true" - return c.login(m) -} - -// LoginWithDevice authenticates a user by login id (username, email or some sort -// of SSO identifier based on configuration), password and attaches a device id to -// the session. -func (c *Client4) LoginWithDevice(loginId string, password string, deviceId string) (*User, *Response) { - m := make(map[string]string) - m["login_id"] = loginId - m["password"] = password - m["device_id"] = deviceId - return c.login(m) -} - -func (c *Client4) login(m map[string]string) (*User, *Response) { - if r, err := c.DoApiPost("/users/login", MapToJson(m)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - c.AuthToken = r.Header.Get(HEADER_TOKEN) - c.AuthType = HEADER_BEARER - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// Logout terminates the current user's session. -func (c *Client4) Logout() (bool, *Response) { - if r, err := c.DoApiPost("/users/logout", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - c.AuthToken = "" - c.AuthType = HEADER_BEARER - - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// SwitchAccountType changes a user's login type from one type to another. -func (c *Client4) SwitchAccountType(switchRequest *SwitchRequest) (string, *Response) { - if r, err := c.DoApiPost(c.GetUsersRoute()+"/login/switch", switchRequest.ToJson()); err != nil { - return "", BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body)["follow_link"], BuildResponse(r) - } -} - -// User Section - -// CreateUser creates a user in the system based on the provided user struct. -func (c *Client4) CreateUser(user *User) (*User, *Response) { - if r, err := c.DoApiPost(c.GetUsersRoute(), user.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// CreateUserWithHash creates a user in the system based on the provided user struct and hash created. -func (c *Client4) CreateUserWithHash(user *User, hash, data string) (*User, *Response) { - var query string - if hash != "" && data != "" { - query = fmt.Sprintf("?d=%v&h=%v", url.QueryEscape(data), hash) - } else { - err := NewAppError("MissingHashOrData", "api.user.create_user.missing_hash_or_data.app_error", nil, "", http.StatusBadRequest) - return nil, &Response{StatusCode: err.StatusCode, Error: err} - } - if r, err := c.DoApiPost(c.GetUsersRoute()+query, user.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// CreateUserWithInviteId creates a user in the system based on the provided invited id. -func (c *Client4) CreateUserWithInviteId(user *User, inviteId string) (*User, *Response) { - var query string - if inviteId != "" { - query = fmt.Sprintf("?iid=%v", url.QueryEscape(inviteId)) - } else { - err := NewAppError("MissingInviteId", "api.user.create_user.missing_invite_id.app_error", nil, "", http.StatusBadRequest) - return nil, &Response{StatusCode: err.StatusCode, Error: err} - } - if r, err := c.DoApiPost(c.GetUsersRoute()+query, user.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// GetMe returns the logged in user. -func (c *Client4) GetMe(etag string) (*User, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(ME), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// GetUser returns a user based on the provided user id string. -func (c *Client4) GetUser(userId, etag string) (*User, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// GetUserByUsername returns a user based on the provided user name string. -func (c *Client4) GetUserByUsername(userName, etag string) (*User, *Response) { - if r, err := c.DoApiGet(c.GetUserByUsernameRoute(userName), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// GetUserByEmail returns a user based on the provided user email string. -func (c *Client4) GetUserByEmail(email, etag string) (*User, *Response) { - if r, err := c.DoApiGet(c.GetUserByEmailRoute(email), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// AutocompleteUsersInTeam returns the users on a team based on search term. -func (c *Client4) AutocompleteUsersInTeam(teamId string, username string, etag string) (*UserAutocomplete, *Response) { - query := fmt.Sprintf("?in_team=%v&name=%v", teamId, username) - if r, err := c.DoApiGet(c.GetUsersRoute()+"/autocomplete"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAutocompleteFromJson(r.Body), BuildResponse(r) - } -} - -// AutocompleteUsersInChannel returns the users in a channel based on search term. -func (c *Client4) AutocompleteUsersInChannel(teamId string, channelId string, username string, etag string) (*UserAutocomplete, *Response) { - query := fmt.Sprintf("?in_team=%v&in_channel=%v&name=%v", teamId, channelId, username) - if r, err := c.DoApiGet(c.GetUsersRoute()+"/autocomplete"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAutocompleteFromJson(r.Body), BuildResponse(r) - } -} - -// AutocompleteUsers returns the users in the system based on search term. -func (c *Client4) AutocompleteUsers(username string, etag string) (*UserAutocomplete, *Response) { - query := fmt.Sprintf("?name=%v", username) - if r, err := c.DoApiGet(c.GetUsersRoute()+"/autocomplete"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAutocompleteFromJson(r.Body), BuildResponse(r) - } -} - -// GetProfileImage gets user's profile image. Must be logged in or be a system administrator. -func (c *Client4) GetProfileImage(userId, etag string) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/image", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("GetProfileImage", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// GetUsers returns a page of users on the system. Page counting starts at 0. -func (c *Client4) GetUsers(page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersInTeam returns a page of users on a team. Page counting starts at 0. -func (c *Client4) GetUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?in_team=%v&page=%v&per_page=%v", teamId, page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetNewUsersInTeam returns a page of users on a team. Page counting starts at 0. -func (c *Client4) GetNewUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?sort=create_at&in_team=%v&page=%v&per_page=%v", teamId, page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetRecentlyActiveUsersInTeam returns a page of users on a team. Page counting starts at 0. -func (c *Client4) GetRecentlyActiveUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?sort=last_activity_at&in_team=%v&page=%v&per_page=%v", teamId, page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersNotInTeam returns a page of users who are not in a team. Page counting starts at 0. -func (c *Client4) GetUsersNotInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?not_in_team=%v&page=%v&per_page=%v", teamId, page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersInChannel returns a page of users on a team. Page counting starts at 0. -func (c *Client4) GetUsersInChannel(channelId string, page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?in_channel=%v&page=%v&per_page=%v", channelId, page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersNotInChannel returns a page of users on a team. Page counting starts at 0. -func (c *Client4) GetUsersNotInChannel(teamId, channelId string, page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?in_team=%v¬_in_channel=%v&page=%v&per_page=%v", teamId, channelId, page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersWithoutTeam returns a page of users on the system that aren't on any teams. Page counting starts at 0. -func (c *Client4) GetUsersWithoutTeam(page int, perPage int, etag string) ([]*User, *Response) { - query := fmt.Sprintf("?without_team=1&page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersByIds returns a list of users based on the provided user ids. -func (c *Client4) GetUsersByIds(userIds []string) ([]*User, *Response) { - if r, err := c.DoApiPost(c.GetUsersRoute()+"/ids", ArrayToJson(userIds)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersByUsernames returns a list of users based on the provided usernames. -func (c *Client4) GetUsersByUsernames(usernames []string) ([]*User, *Response) { - if r, err := c.DoApiPost(c.GetUsersRoute()+"/usernames", ArrayToJson(usernames)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// SearchUsers returns a list of users based on some search criteria. -func (c *Client4) SearchUsers(search *UserSearch) ([]*User, *Response) { - if r, err := c.DoApiPost(c.GetUsersRoute()+"/search", search.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserListFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateUser updates a user in the system based on the provided user struct. -func (c *Client4) UpdateUser(user *User) (*User, *Response) { - if r, err := c.DoApiPut(c.GetUserRoute(user.Id), user.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// PatchUser partially updates a user in the system. Any missing fields are not updated. -func (c *Client4) PatchUser(userId string, patch *UserPatch) (*User, *Response) { - if r, err := c.DoApiPut(c.GetUserRoute(userId)+"/patch", patch.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateUserAuth updates a user AuthData (uthData, authService and password) in the system. -func (c *Client4) UpdateUserAuth(userId string, userAuth *UserAuth) (*UserAuth, *Response) { - if r, err := c.DoApiPut(c.GetUserRoute(userId)+"/auth", userAuth.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAuthFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateUserMfa activates multi-factor authentication for a user if activate -// is true and a valid code is provided. If activate is false, then code is not -// required and multi-factor authentication is disabled for the user. -func (c *Client4) UpdateUserMfa(userId, code string, activate bool) (bool, *Response) { - requestBody := make(map[string]interface{}) - requestBody["activate"] = activate - requestBody["code"] = code - - if r, err := c.DoApiPut(c.GetUserRoute(userId)+"/mfa", StringInterfaceToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// CheckUserMfa checks whether a user has MFA active on their account or not based on the -// provided login id. -func (c *Client4) CheckUserMfa(loginId string) (bool, *Response) { - requestBody := make(map[string]interface{}) - requestBody["login_id"] = loginId - - if r, err := c.DoApiPost(c.GetUsersRoute()+"/mfa", StringInterfaceToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - data := StringInterfaceFromJson(r.Body) - if mfaRequired, ok := data["mfa_required"].(bool); !ok { - return false, BuildResponse(r) - } else { - return mfaRequired, BuildResponse(r) - } - } -} - -// GenerateMfaSecret will generate a new MFA secret for a user and return it as a string and -// as a base64 encoded image QR code. -func (c *Client4) GenerateMfaSecret(userId string) (*MfaSecret, *Response) { - if r, err := c.DoApiPost(c.GetUserRoute(userId)+"/mfa/generate", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MfaSecretFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateUserPassword updates a user's password. Must be logged in as the user or be a system administrator. -func (c *Client4) UpdateUserPassword(userId, currentPassword, newPassword string) (bool, *Response) { - requestBody := map[string]string{"current_password": currentPassword, "new_password": newPassword} - if r, err := c.DoApiPut(c.GetUserRoute(userId)+"/password", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// UpdateUserRoles updates a user's roles in the system. A user can have "system_user" and "system_admin" roles. -func (c *Client4) UpdateUserRoles(userId, roles string) (bool, *Response) { - requestBody := map[string]string{"roles": roles} - if r, err := c.DoApiPut(c.GetUserRoute(userId)+"/roles", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// UpdateUserActive updates status of a user whether active or not. -func (c *Client4) UpdateUserActive(userId string, active bool) (bool, *Response) { - requestBody := make(map[string]interface{}) - requestBody["active"] = active - - if r, err := c.DoApiPut(c.GetUserRoute(userId)+"/active", StringInterfaceToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// DeleteUser deactivates a user in the system based on the provided user id string. -func (c *Client4) DeleteUser(userId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetUserRoute(userId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// SendPasswordResetEmail will send a link for password resetting to a user with the -// provided email. -func (c *Client4) SendPasswordResetEmail(email string) (bool, *Response) { - requestBody := map[string]string{"email": email} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/password/reset/send", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// ResetPassword uses a recovery code to update reset a user's password. -func (c *Client4) ResetPassword(token, newPassword string) (bool, *Response) { - requestBody := map[string]string{"token": token, "new_password": newPassword} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/password/reset", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetSessions returns a list of sessions based on the provided user id string. -func (c *Client4) GetSessions(userId, etag string) ([]*Session, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/sessions", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return SessionsFromJson(r.Body), BuildResponse(r) - } -} - -// RevokeSession revokes a user session based on the provided user id and session id strings. -func (c *Client4) RevokeSession(userId, sessionId string) (bool, *Response) { - requestBody := map[string]string{"session_id": sessionId} - if r, err := c.DoApiPost(c.GetUserRoute(userId)+"/sessions/revoke", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// RevokeAllSessions revokes all sessions for the provided user id string. -func (c *Client4) RevokeAllSessions(userId string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetUserRoute(userId)+"/sessions/revoke/all", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// AttachDeviceId attaches a mobile device ID to the current session. -func (c *Client4) AttachDeviceId(deviceId string) (bool, *Response) { - requestBody := map[string]string{"device_id": deviceId} - if r, err := c.DoApiPut(c.GetUsersRoute()+"/sessions/device", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetTeamsUnreadForUser will return an array with TeamUnread objects that contain the amount -// of unread messages and mentions the current user has for the teams it belongs to. -// An optional team ID can be set to exclude that team from the results. Must be authenticated. -func (c *Client4) GetTeamsUnreadForUser(userId, teamIdToExclude string) ([]*TeamUnread, *Response) { - optional := "" - if teamIdToExclude != "" { - optional += fmt.Sprintf("?exclude_team=%s", url.QueryEscape(teamIdToExclude)) - } - - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/teams/unread"+optional, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamsUnreadFromJson(r.Body), BuildResponse(r) - } -} - -// GetUserAudits returns a list of audit based on the provided user id string. -func (c *Client4) GetUserAudits(userId string, page int, perPage int, etag string) (Audits, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/audits"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return AuditsFromJson(r.Body), BuildResponse(r) - } -} - -// VerifyUserEmail will verify a user's email using the supplied token. -func (c *Client4) VerifyUserEmail(token string) (bool, *Response) { - requestBody := map[string]string{"token": token} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/email/verify", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// SendVerificationEmail will send an email to the user with the provided email address, if -// that user exists. The email will contain a link that can be used to verify the user's -// email address. -func (c *Client4) SendVerificationEmail(email string) (bool, *Response) { - requestBody := map[string]string{"email": email} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/email/verify/send", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// SetProfileImage sets profile image of the user -func (c *Client4) SetProfileImage(userId string, data []byte) (bool, *Response) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("image", "profile.png"); err != nil { - return false, &Response{Error: NewAppError("SetProfileImage", "model.client.set_profile_user.no_file.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return false, &Response{Error: NewAppError("SetProfileImage", "model.client.set_profile_user.no_file.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if err := writer.Close(); err != nil { - return false, &Response{Error: NewAppError("SetProfileImage", "model.client.set_profile_user.writer.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - rq, _ := http.NewRequest("POST", c.ApiUrl+c.GetUserRoute(userId)+"/image", bytes.NewReader(body.Bytes())) - rq.Header.Set("Content-Type", writer.FormDataContentType()) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - // set to http.StatusForbidden(403) - return false, &Response{StatusCode: http.StatusForbidden, Error: NewAppError(c.GetUserRoute(userId)+"/image", "model.client.connecting.app_error", nil, err.Error(), 403)} - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return false, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return CheckStatusOK(rp), BuildResponse(rp) - } - } -} - -// CreateUserAccessToken will generate a user access token that can be used in place -// of a session token to access the REST API. Must have the 'create_user_access_token' -// permission and if generating for another user, must have the 'edit_other_users' -// permission. A non-blank description is required. -func (c *Client4) CreateUserAccessToken(userId, description string) (*UserAccessToken, *Response) { - requestBody := map[string]string{"description": description} - if r, err := c.DoApiPost(c.GetUserRoute(userId)+"/tokens", MapToJson(requestBody)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAccessTokenFromJson(r.Body), BuildResponse(r) - } -} - -// GetUserAccessTokens will get a page of access tokens' id, description, is_active -// and the user_id in the system. The actual token will not be returned. Must have -// the 'manage_system' permission. -func (c *Client4) GetUserAccessTokens(page int, perPage int) ([]*UserAccessToken, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUserAccessTokensRoute()+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAccessTokenListFromJson(r.Body), BuildResponse(r) - } -} - -// GetUserAccessToken will get a user access tokens' id, description, is_active -// and the user_id of the user it is for. The actual token will not be returned. -// Must have the 'read_user_access_token' permission and if getting for another -// user, must have the 'edit_other_users' permission. -func (c *Client4) GetUserAccessToken(tokenId string) (*UserAccessToken, *Response) { - if r, err := c.DoApiGet(c.GetUserAccessTokenRoute(tokenId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAccessTokenFromJson(r.Body), BuildResponse(r) - } -} - -// GetUserAccessTokensForUser will get a paged list of user access tokens showing id, -// description and user_id for each. The actual tokens will not be returned. Must have -// the 'read_user_access_token' permission and if getting for another user, must have the -// 'edit_other_users' permission. -func (c *Client4) GetUserAccessTokensForUser(userId string, page, perPage int) ([]*UserAccessToken, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/tokens"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAccessTokenListFromJson(r.Body), BuildResponse(r) - } -} - -// RevokeUserAccessToken will revoke a user access token by id. Must have the -// 'revoke_user_access_token' permission and if revoking for another user, must have the -// 'edit_other_users' permission. -func (c *Client4) RevokeUserAccessToken(tokenId string) (bool, *Response) { - requestBody := map[string]string{"token_id": tokenId} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/tokens/revoke", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// SearchUserAccessTokens returns user access tokens matching the provided search term. -func (c *Client4) SearchUserAccessTokens(search *UserAccessTokenSearch) ([]*UserAccessToken, *Response) { - if r, err := c.DoApiPost(c.GetUsersRoute()+"/tokens/search", search.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return UserAccessTokenListFromJson(r.Body), BuildResponse(r) - } -} - -// DisableUserAccessToken will disable a user access token by id. Must have the -// 'revoke_user_access_token' permission and if disabling for another user, must have the -// 'edit_other_users' permission. -func (c *Client4) DisableUserAccessToken(tokenId string) (bool, *Response) { - requestBody := map[string]string{"token_id": tokenId} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/tokens/disable", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// EnableUserAccessToken will enable a user access token by id. Must have the -// 'create_user_access_token' permission and if enabling for another user, must have the -// 'edit_other_users' permission. -func (c *Client4) EnableUserAccessToken(tokenId string) (bool, *Response) { - requestBody := map[string]string{"token_id": tokenId} - if r, err := c.DoApiPost(c.GetUsersRoute()+"/tokens/enable", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Team Section - -// CreateTeam creates a team in the system based on the provided team struct. -func (c *Client4) CreateTeam(team *Team) (*Team, *Response) { - if r, err := c.DoApiPost(c.GetTeamsRoute(), team.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamFromJson(r.Body), BuildResponse(r) - } -} - -// GetTeam returns a team based on the provided team id string. -func (c *Client4) GetTeam(teamId, etag string) (*Team, *Response) { - if r, err := c.DoApiGet(c.GetTeamRoute(teamId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamFromJson(r.Body), BuildResponse(r) - } -} - -// GetAllTeams returns all teams based on permissions. -func (c *Client4) GetAllTeams(etag string, page int, perPage int) ([]*Team, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetTeamsRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamListFromJson(r.Body), BuildResponse(r) - } -} - -// GetTeamByName returns a team based on the provided team name string. -func (c *Client4) GetTeamByName(name, etag string) (*Team, *Response) { - if r, err := c.DoApiGet(c.GetTeamByNameRoute(name), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamFromJson(r.Body), BuildResponse(r) - } -} - -// SearchTeams returns teams matching the provided search term. -func (c *Client4) SearchTeams(search *TeamSearch) ([]*Team, *Response) { - if r, err := c.DoApiPost(c.GetTeamsRoute()+"/search", search.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamListFromJson(r.Body), BuildResponse(r) - } -} - -// TeamExists returns true or false if the team exist or not. -func (c *Client4) TeamExists(name, etag string) (bool, *Response) { - if r, err := c.DoApiGet(c.GetTeamByNameRoute(name)+"/exists", etag); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapBoolFromJson(r.Body)["exists"], BuildResponse(r) - } -} - -// GetTeamsForUser returns a list of teams a user is on. Must be logged in as the user -// or be a system administrator. -func (c *Client4) GetTeamsForUser(userId, etag string) ([]*Team, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/teams", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamListFromJson(r.Body), BuildResponse(r) - } -} - -// GetTeamMember returns a team member based on the provided team and user id strings. -func (c *Client4) GetTeamMember(teamId, userId, etag string) (*TeamMember, *Response) { - if r, err := c.DoApiGet(c.GetTeamMemberRoute(teamId, userId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMemberFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateTeamMemberRoles will update the roles on a team for a user. -func (c *Client4) UpdateTeamMemberRoles(teamId, userId, newRoles string) (bool, *Response) { - requestBody := map[string]string{"roles": newRoles} - if r, err := c.DoApiPut(c.GetTeamMemberRoute(teamId, userId)+"/roles", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// UpdateTeam will update a team. -func (c *Client4) UpdateTeam(team *Team) (*Team, *Response) { - if r, err := c.DoApiPut(c.GetTeamRoute(team.Id), team.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamFromJson(r.Body), BuildResponse(r) - } -} - -// PatchTeam partially updates a team. Any missing fields are not updated. -func (c *Client4) PatchTeam(teamId string, patch *TeamPatch) (*Team, *Response) { - if r, err := c.DoApiPut(c.GetTeamRoute(teamId)+"/patch", patch.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamFromJson(r.Body), BuildResponse(r) - } -} - -// SoftDeleteTeam deletes the team softly (archive only, not permanent delete). -func (c *Client4) SoftDeleteTeam(teamId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetTeamRoute(teamId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// PermanentDeleteTeam deletes the team, should only be used when needed for -// compliance and the like -func (c *Client4) PermanentDeleteTeam(teamId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetTeamRoute(teamId) + "?permanent=true"); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetTeamMembers returns team members based on the provided team id string. -func (c *Client4) GetTeamMembers(teamId string, page int, perPage int, etag string) ([]*TeamMember, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetTeamMembersRoute(teamId)+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMembersFromJson(r.Body), BuildResponse(r) - } -} - -// GetTeamMembersForUser returns the team members for a user. -func (c *Client4) GetTeamMembersForUser(userId string, etag string) ([]*TeamMember, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/teams/members", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMembersFromJson(r.Body), BuildResponse(r) - } -} - -// GetTeamMembersByIds will return an array of team members based on the -// team id and a list of user ids provided. Must be authenticated. -func (c *Client4) GetTeamMembersByIds(teamId string, userIds []string) ([]*TeamMember, *Response) { - if r, err := c.DoApiPost(fmt.Sprintf("/teams/%v/members/ids", teamId), ArrayToJson(userIds)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMembersFromJson(r.Body), BuildResponse(r) - } -} - -// AddTeamMember adds user to a team and return a team member. -func (c *Client4) AddTeamMember(teamId, userId string) (*TeamMember, *Response) { - member := &TeamMember{TeamId: teamId, UserId: userId} - - if r, err := c.DoApiPost(c.GetTeamMembersRoute(teamId), member.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMemberFromJson(r.Body), BuildResponse(r) - } -} - -// AddTeamMemberFromInvite adds a user to a team and return a team member using an invite id -// or an invite hash/data pair. -func (c *Client4) AddTeamMemberFromInvite(hash, dataToHash, inviteId string) (*TeamMember, *Response) { - var query string - - if inviteId != "" { - query += fmt.Sprintf("?invite_id=%v", inviteId) - } - - if hash != "" && dataToHash != "" { - query += fmt.Sprintf("?hash=%v&data=%v", hash, dataToHash) - } - - if r, err := c.DoApiPost(c.GetTeamsRoute()+"/members/invite"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMemberFromJson(r.Body), BuildResponse(r) - } -} - -// AddTeamMembers adds a number of users to a team and returns the team members. -func (c *Client4) AddTeamMembers(teamId string, userIds []string) ([]*TeamMember, *Response) { - var members []*TeamMember - for _, userId := range userIds { - member := &TeamMember{TeamId: teamId, UserId: userId} - members = append(members, member) - } - - if r, err := c.DoApiPost(c.GetTeamMembersRoute(teamId)+"/batch", TeamMembersToJson(members)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamMembersFromJson(r.Body), BuildResponse(r) - } -} - -// RemoveTeamMember will remove a user from a team. -func (c *Client4) RemoveTeamMember(teamId, userId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetTeamMemberRoute(teamId, userId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetTeamStats returns a team stats based on the team id string. -// Must be authenticated. -func (c *Client4) GetTeamStats(teamId, etag string) (*TeamStats, *Response) { - if r, err := c.DoApiGet(c.GetTeamStatsRoute(teamId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamStatsFromJson(r.Body), BuildResponse(r) - } -} - -// GetTeamUnread will return a TeamUnread object that contains the amount of -// unread messages and mentions the user has for the specified team. -// Must be authenticated. -func (c *Client4) GetTeamUnread(teamId, userId string) (*TeamUnread, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+c.GetTeamRoute(teamId)+"/unread", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamUnreadFromJson(r.Body), BuildResponse(r) - } -} - -// ImportTeam will import an exported team from other app into a existing team. -func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, teamId string) (map[string]string, *Response) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("file", filename); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.file.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.file.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if part, err := writer.CreateFormField("filesize"); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.file_size.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, strings.NewReader(strconv.Itoa(filesize))); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.file_size.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if part, err := writer.CreateFormField("importFrom"); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.import_from.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, strings.NewReader(importFrom)); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.import_from.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if err := writer.Close(); err != nil { - return nil, &Response{Error: NewAppError("UploadImportTeam", "model.client.upload_post_attachment.writer.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - return c.DoUploadImportTeam(c.GetTeamImportRoute(teamId), body.Bytes(), writer.FormDataContentType()) -} - -// InviteUsersToTeam invite users by email to the team. -func (c *Client4) InviteUsersToTeam(teamId string, userEmails []string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetTeamRoute(teamId)+"/invite/email", ArrayToJson(userEmails)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetTeamInviteInfo returns a team object from an invite id containing sanitized information. -func (c *Client4) GetTeamInviteInfo(inviteId string) (*Team, *Response) { - if r, err := c.DoApiGet(c.GetTeamsRoute()+"/invite/"+inviteId, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return TeamFromJson(r.Body), BuildResponse(r) - } -} - -// Channel Section - -// CreateChannel creates a channel based on the provided channel struct. -func (c *Client4) CreateChannel(channel *Channel) (*Channel, *Response) { - if r, err := c.DoApiPost(c.GetChannelsRoute(), channel.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateChannel update a channel based on the provided channel struct. -func (c *Client4) UpdateChannel(channel *Channel) (*Channel, *Response) { - if r, err := c.DoApiPut(c.GetChannelRoute(channel.Id), channel.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// PatchChannel partially updates a channel. Any missing fields are not updated. -func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel, *Response) { - if r, err := c.DoApiPut(c.GetChannelRoute(channelId)+"/patch", patch.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// RestoreChannel restores a previously deleted channel. Any missing fields are not updated. -func (c *Client4) RestoreChannel(channelId string) (*Channel, *Response) { - if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/restore", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// CreateDirectChannel creates a direct message channel based on the two user -// ids provided. -func (c *Client4) CreateDirectChannel(userId1, userId2 string) (*Channel, *Response) { - requestBody := []string{userId1, userId2} - if r, err := c.DoApiPost(c.GetChannelsRoute()+"/direct", ArrayToJson(requestBody)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// CreateGroupChannel creates a group message channel based on userIds provided -func (c *Client4) CreateGroupChannel(userIds []string) (*Channel, *Response) { - if r, err := c.DoApiPost(c.GetChannelsRoute()+"/group", ArrayToJson(userIds)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannel returns a channel based on the provided channel id string. -func (c *Client4) GetChannel(channelId, etag string) (*Channel, *Response) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelStats returns statistics for a channel. -func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats, *Response) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/stats", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelStatsFromJson(r.Body), BuildResponse(r) - } -} - -// GetPinnedPosts gets a list of pinned posts. -func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Response) { - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/pinned", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetPublicChannelsForTeam returns a list of public channels based on the provided team id string. -func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelSliceFromJson(r.Body), BuildResponse(r) - } -} - -// GetDeletedChannelsForTeam returns a list of public channels based on the provided team id string. -func (c *Client4) GetDeletedChannelsForTeam(teamId string, page int, perPage int, etag string) ([]*Channel, *Response) { - query := fmt.Sprintf("/deleted?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelSliceFromJson(r.Body), BuildResponse(r) - } -} - -// GetPublicChannelsByIdsForTeam returns a list of public channels based on provided team id string -func (c *Client4) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) ([]*Channel, *Response) { - if r, err := c.DoApiPost(c.GetChannelsForTeamRoute(teamId)+"/ids", ArrayToJson(channelIds)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelSliceFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelsForTeamForUser returns a list channels of on a team for a user. -func (c *Client4) GetChannelsForTeamForUser(teamId, userId, etag string) ([]*Channel, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+c.GetTeamRoute(teamId)+"/channels", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelSliceFromJson(r.Body), BuildResponse(r) - } -} - -// SearchChannels returns the channels on a team matching the provided search term. -func (c *Client4) SearchChannels(teamId string, search *ChannelSearch) ([]*Channel, *Response) { - if r, err := c.DoApiPost(c.GetChannelsForTeamRoute(teamId)+"/search", search.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelSliceFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteChannel deletes channel based on the provided channel id string. -func (c *Client4) DeleteChannel(channelId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetChannelRoute(channelId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetChannelByName returns a channel based on the provided channel name and team id strings. -func (c *Client4) GetChannelByName(channelName, teamId string, etag string) (*Channel, *Response) { - if r, err := c.DoApiGet(c.GetChannelByNameRoute(channelName, teamId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelByNameForTeamName returns a channel based on the provided channel name and team name strings. -func (c *Client4) GetChannelByNameForTeamName(channelName, teamName string, etag string) (*Channel, *Response) { - if r, err := c.DoApiGet(c.GetChannelByNameForTeamNameRoute(channelName, teamName), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelMembers gets a page of channel members. -func (c *Client4) GetChannelMembers(channelId string, page, perPage int, etag string) (*ChannelMembers, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetChannelMembersRoute(channelId)+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelMembersFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelMembersByIds gets the channel members in a channel for a list of user ids. -func (c *Client4) GetChannelMembersByIds(channelId string, userIds []string) (*ChannelMembers, *Response) { - if r, err := c.DoApiPost(c.GetChannelMembersRoute(channelId)+"/ids", ArrayToJson(userIds)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelMembersFromJson(r.Body), BuildResponse(r) - - } -} - -// GetChannelMember gets a channel member. -func (c *Client4) GetChannelMember(channelId, userId, etag string) (*ChannelMember, *Response) { - if r, err := c.DoApiGet(c.GetChannelMemberRoute(channelId, userId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelMemberFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelMembersForUser gets all the channel members for a user on a team. -func (c *Client4) GetChannelMembersForUser(userId, teamId, etag string) (*ChannelMembers, *Response) { - if r, err := c.DoApiGet(fmt.Sprintf(c.GetUserRoute(userId)+"/teams/%v/channels/members", teamId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelMembersFromJson(r.Body), BuildResponse(r) - } -} - -// ViewChannel performs a view action for a user. Synonymous with switching channels or marking channels as read by a user. -func (c *Client4) ViewChannel(userId string, view *ChannelView) (*ChannelViewResponse, *Response) { - url := fmt.Sprintf(c.GetChannelsRoute()+"/members/%v/view", userId) - if r, err := c.DoApiPost(url, view.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelViewResponseFromJson(r.Body), BuildResponse(r) - } -} - -// GetChannelUnread will return a ChannelUnread object that contains the number of -// unread messages and mentions for a user. -func (c *Client4) GetChannelUnread(channelId, userId string) (*ChannelUnread, *Response) { - if r, err := c.DoApiGet(c.GetUserRoute(userId)+c.GetChannelRoute(channelId)+"/unread", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelUnreadFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateChannelRoles will update the roles on a channel for a user. -func (c *Client4) UpdateChannelRoles(channelId, userId, roles string) (bool, *Response) { - requestBody := map[string]string{"roles": roles} - if r, err := c.DoApiPut(c.GetChannelMemberRoute(channelId, userId)+"/roles", MapToJson(requestBody)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// UpdateChannelNotifyProps will update the notification properties on a channel for a user. -func (c *Client4) UpdateChannelNotifyProps(channelId, userId string, props map[string]string) (bool, *Response) { - if r, err := c.DoApiPut(c.GetChannelMemberRoute(channelId, userId)+"/notify_props", MapToJson(props)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// AddChannelMember adds user to channel and return a channel member. -func (c *Client4) AddChannelMember(channelId, userId string) (*ChannelMember, *Response) { - requestBody := map[string]string{"user_id": userId} - if r, err := c.DoApiPost(c.GetChannelMembersRoute(channelId)+"", MapToJson(requestBody)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelMemberFromJson(r.Body), BuildResponse(r) - } -} - -// AddChannelMemberWithRootId adds user to channel and return a channel member. Post add to channel message has the postRootId. -func (c *Client4) AddChannelMemberWithRootId(channelId, userId, postRootId string) (*ChannelMember, *Response) { - requestBody := map[string]string{"user_id": userId, "post_root_id": postRootId} - if r, err := c.DoApiPost(c.GetChannelMembersRoute(channelId)+"", MapToJson(requestBody)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ChannelMemberFromJson(r.Body), BuildResponse(r) - } -} - -// RemoveUserFromChannel will delete the channel member object for a user, effectively removing the user from a channel. -func (c *Client4) RemoveUserFromChannel(channelId, userId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetChannelMemberRoute(channelId, userId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Post Section - -// CreatePost creates a post based on the provided post struct. -func (c *Client4) CreatePost(post *Post) (*Post, *Response) { - if r, err := c.DoApiPost(c.GetPostsRoute(), post.ToUnsanitizedJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostFromJson(r.Body), BuildResponse(r) - } -} - -// UpdatePost updates a post based on the provided post struct. -func (c *Client4) UpdatePost(postId string, post *Post) (*Post, *Response) { - if r, err := c.DoApiPut(c.GetPostRoute(postId), post.ToUnsanitizedJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostFromJson(r.Body), BuildResponse(r) - } -} - -// PatchPost partially updates a post. Any missing fields are not updated. -func (c *Client4) PatchPost(postId string, patch *PostPatch) (*Post, *Response) { - if r, err := c.DoApiPut(c.GetPostRoute(postId)+"/patch", patch.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostFromJson(r.Body), BuildResponse(r) - } -} - -// PinPost pin a post based on provided post id string. -func (c *Client4) PinPost(postId string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetPostRoute(postId)+"/pin", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// UnpinPost unpin a post based on provided post id string. -func (c *Client4) UnpinPost(postId string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetPostRoute(postId)+"/unpin", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetPost gets a single post. -func (c *Client4) GetPost(postId string, etag string) (*Post, *Response) { - if r, err := c.DoApiGet(c.GetPostRoute(postId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostFromJson(r.Body), BuildResponse(r) - } -} - -// DeletePost deletes a post from the provided post id string. -func (c *Client4) DeletePost(postId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetPostRoute(postId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetPostThread gets a post with all the other posts in the same thread. -func (c *Client4) GetPostThread(postId string, etag string) (*PostList, *Response) { - if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/thread", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetPostsForChannel gets a page of posts with an array for ordering for a channel. -func (c *Client4) GetPostsForChannel(channelId string, page, perPage int, etag string) (*PostList, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/posts"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetFlaggedPostsForUser returns flagged posts of a user based on user id string. -func (c *Client4) GetFlaggedPostsForUser(userId string, page int, perPage int) (*PostList, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/posts/flagged"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetFlaggedPostsForUserInTeam returns flagged posts in team of a user based on user id string. -func (c *Client4) GetFlaggedPostsForUserInTeam(userId string, teamId string, page int, perPage int) (*PostList, *Response) { - if len(teamId) == 0 || len(teamId) != 26 { - return nil, &Response{StatusCode: http.StatusBadRequest, Error: NewAppError("GetFlaggedPostsForUserInTeam", "model.client.get_flagged_posts_in_team.missing_parameter.app_error", nil, "", http.StatusBadRequest)} - } - - query := fmt.Sprintf("?team_id=%v&page=%v&per_page=%v", teamId, page, perPage) - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/posts/flagged"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetFlaggedPostsForUserInChannel returns flagged posts in channel of a user based on user id string. -func (c *Client4) GetFlaggedPostsForUserInChannel(userId string, channelId string, page int, perPage int) (*PostList, *Response) { - if len(channelId) == 0 || len(channelId) != 26 { - return nil, &Response{StatusCode: http.StatusBadRequest, Error: NewAppError("GetFlaggedPostsForUserInChannel", "model.client.get_flagged_posts_in_channel.missing_parameter.app_error", nil, "", http.StatusBadRequest)} - } - - query := fmt.Sprintf("?channel_id=%v&page=%v&per_page=%v", channelId, page, perPage) - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/posts/flagged"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetPostsSince gets posts created after a specified time as Unix time in milliseconds. -func (c *Client4) GetPostsSince(channelId string, time int64) (*PostList, *Response) { - query := fmt.Sprintf("?since=%v", time) - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/posts"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetPostsAfter gets a page of posts that were posted after the post provided. -func (c *Client4) GetPostsAfter(channelId, postId string, page, perPage int, etag string) (*PostList, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v&after=%v", page, perPage, postId) - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/posts"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// GetPostsBefore gets a page of posts that were posted before the post provided. -func (c *Client4) GetPostsBefore(channelId, postId string, page, perPage int, etag string) (*PostList, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v&before=%v", page, perPage, postId) - if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/posts"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// SearchPosts returns any posts with matching terms string. -func (c *Client4) SearchPosts(teamId string, terms string, isOrSearch bool) (*PostList, *Response) { - requestBody := map[string]interface{}{"terms": terms, "is_or_search": isOrSearch} - if r, err := c.DoApiPost(c.GetTeamRoute(teamId)+"/posts/search", StringInterfaceToJson(requestBody)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PostListFromJson(r.Body), BuildResponse(r) - } -} - -// DoPostAction performs a post action. -func (c *Client4) DoPostAction(postId, actionId string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetPostRoute(postId)+"/actions/"+actionId, ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// File Section - -// UploadFile will upload a file to a channel, to be later attached to a post. -func (c *Client4) UploadFile(data []byte, channelId string, filename string) (*FileUploadResponse, *Response) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("files", filename); err != nil { - return nil, &Response{Error: NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.file.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return nil, &Response{Error: NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.file.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if part, err := writer.CreateFormField("channel_id"); err != nil { - return nil, &Response{Error: NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.channel_id.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, strings.NewReader(channelId)); err != nil { - return nil, &Response{Error: NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.channel_id.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if err := writer.Close(); err != nil { - return nil, &Response{Error: NewAppError("UploadPostAttachment", "model.client.upload_post_attachment.writer.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - return c.DoUploadFile(c.GetFilesRoute(), body.Bytes(), writer.FormDataContentType()) -} - -// GetFile gets the bytes for a file by id. -func (c *Client4) GetFile(fileId string) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("GetFile", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// DownloadFile gets the bytes for a file by id, optionally adding headers to force the browser to download it -func (c *Client4) DownloadFile(fileId string, download bool) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+fmt.Sprintf("?download=%v", download), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("DownloadFile", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// GetFileThumbnail gets the bytes for a file by id. -func (c *Client4) GetFileThumbnail(fileId string) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/thumbnail", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("GetFileThumbnail", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// DownloadFileThumbnail gets the bytes for a file by id, optionally adding headers to force the browser to download it. -func (c *Client4) DownloadFileThumbnail(fileId string, download bool) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+fmt.Sprintf("/thumbnail?download=%v", download), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("DownloadFileThumbnail", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// GetFileLink gets the public link of a file by id. -func (c *Client4) GetFileLink(fileId string) (string, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/link", ""); err != nil { - return "", BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - return MapFromJson(r.Body)["link"], BuildResponse(r) - } -} - -// GetFilePreview gets the bytes for a file by id. -func (c *Client4) GetFilePreview(fileId string) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/preview", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("GetFilePreview", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// DownloadFilePreview gets the bytes for a file by id. -func (c *Client4) DownloadFilePreview(fileId string, download bool) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+fmt.Sprintf("/preview?download=%v", download), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("DownloadFilePreview", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// GetFileInfo gets all the file info objects. -func (c *Client4) GetFileInfo(fileId string) (*FileInfo, *Response) { - if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/info", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return FileInfoFromJson(r.Body), BuildResponse(r) - } -} - -// GetFileInfosForPost gets all the file info objects attached to a post. -func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response) { - if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/files/info", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return FileInfosFromJson(r.Body), BuildResponse(r) - } -} - -// General/System Section - -// GetPing will return ok if the running goRoutines are below the threshold and unhealthy for above. -func (c *Client4) GetPing() (string, *Response) { - if r, err := c.DoApiGet(c.GetSystemRoute()+"/ping", ""); r != nil && r.StatusCode == 500 { - defer r.Body.Close() - return "unhealthy", BuildErrorResponse(r, err) - } else if err != nil { - return "", BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body)["status"], BuildResponse(r) - } -} - -// TestEmail will attempt to connect to the configured SMTP server. -func (c *Client4) TestEmail() (bool, *Response) { - if r, err := c.DoApiPost(c.GetTestEmailRoute(), ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetConfig will retrieve the server config with some sanitized items. -func (c *Client4) GetConfig() (*Config, *Response) { - if r, err := c.DoApiGet(c.GetConfigRoute(), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ConfigFromJson(r.Body), BuildResponse(r) - } -} - -// ReloadConfig will reload the server configuration. -func (c *Client4) ReloadConfig() (bool, *Response) { - if r, err := c.DoApiPost(c.GetConfigRoute()+"/reload", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetOldClientConfig will retrieve the parts of the server configuration needed by the -// client, formatted in the old format. -func (c *Client4) GetOldClientConfig(etag string) (map[string]string, *Response) { - if r, err := c.DoApiGet(c.GetConfigRoute()+"/client?format=old", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body), BuildResponse(r) - } -} - -// GetOldClientLicense will retrieve the parts of the server license needed by the -// client, formatted in the old format. -func (c *Client4) GetOldClientLicense(etag string) (map[string]string, *Response) { - if r, err := c.DoApiGet(c.GetLicenseRoute()+"/client?format=old", etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body), BuildResponse(r) - } -} - -// DatabaseRecycle will recycle the connections. Discard current connection and get new one. -func (c *Client4) DatabaseRecycle() (bool, *Response) { - if r, err := c.DoApiPost(c.GetDatabaseRoute()+"/recycle", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// InvalidateCaches will purge the cache and can affect the performance while is cleaning. -func (c *Client4) InvalidateCaches() (bool, *Response) { - if r, err := c.DoApiPost(c.GetCacheRoute()+"/invalidate", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// UpdateConfig will update the server configuration. -func (c *Client4) UpdateConfig(config *Config) (*Config, *Response) { - if r, err := c.DoApiPut(c.GetConfigRoute(), config.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ConfigFromJson(r.Body), BuildResponse(r) - } -} - -// UploadLicenseFile will add a license file to the system. -func (c *Client4) UploadLicenseFile(data []byte) (bool, *Response) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("license", "test-license.mattermost-license"); err != nil { - return false, &Response{Error: NewAppError("UploadLicenseFile", "model.client.set_profile_user.no_file.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return false, &Response{Error: NewAppError("UploadLicenseFile", "model.client.set_profile_user.no_file.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if err := writer.Close(); err != nil { - return false, &Response{Error: NewAppError("UploadLicenseFile", "model.client.set_profile_user.writer.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - rq, _ := http.NewRequest("POST", c.ApiUrl+c.GetLicenseRoute(), bytes.NewReader(body.Bytes())) - rq.Header.Set("Content-Type", writer.FormDataContentType()) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return false, &Response{StatusCode: http.StatusForbidden, Error: NewAppError(c.GetLicenseRoute(), "model.client.connecting.app_error", nil, err.Error(), http.StatusForbidden)} - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return false, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return CheckStatusOK(rp), BuildResponse(rp) - } - } -} - -// RemoveLicenseFile will remove the server license it exists. Note that this will -// disable all enterprise features. -func (c *Client4) RemoveLicenseFile() (bool, *Response) { - if r, err := c.DoApiDelete(c.GetLicenseRoute()); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetAnalyticsOld will retrieve analytics using the old format. New format is not -// available but the "/analytics" endpoint is reserved for it. The "name" argument is optional -// and defaults to "standard". The "teamId" argument is optional and will limit results -// to a specific team. -func (c *Client4) GetAnalyticsOld(name, teamId string) (AnalyticsRows, *Response) { - query := fmt.Sprintf("?name=%v&teamId=%v", name, teamId) - if r, err := c.DoApiGet(c.GetAnalyticsRoute()+"/old"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return AnalyticsRowsFromJson(r.Body), BuildResponse(r) - } -} - -// Webhooks Section - -// CreateIncomingWebhook creates an incoming webhook for a channel. -func (c *Client4) CreateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response) { - if r, err := c.DoApiPost(c.GetIncomingWebhooksRoute(), hook.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return IncomingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateIncomingWebhook updates an incoming webhook for a channel. -func (c *Client4) UpdateIncomingWebhook(hook *IncomingWebhook) (*IncomingWebhook, *Response) { - if r, err := c.DoApiPut(c.GetIncomingWebhookRoute(hook.Id), hook.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return IncomingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// GetIncomingWebhooks returns a page of incoming webhooks on the system. Page counting starts at 0. -func (c *Client4) GetIncomingWebhooks(page int, perPage int, etag string) ([]*IncomingWebhook, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetIncomingWebhooksRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return IncomingWebhookListFromJson(r.Body), BuildResponse(r) - } -} - -// GetIncomingWebhooksForTeam returns a page of incoming webhooks for a team. Page counting starts at 0. -func (c *Client4) GetIncomingWebhooksForTeam(teamId string, page int, perPage int, etag string) ([]*IncomingWebhook, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v&team_id=%v", page, perPage, teamId) - if r, err := c.DoApiGet(c.GetIncomingWebhooksRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return IncomingWebhookListFromJson(r.Body), BuildResponse(r) - } -} - -// GetIncomingWebhook returns an Incoming webhook given the hook ID -func (c *Client4) GetIncomingWebhook(hookID string, etag string) (*IncomingWebhook, *Response) { - if r, err := c.DoApiGet(c.GetIncomingWebhookRoute(hookID), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return IncomingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteIncomingWebhook deletes and Incoming Webhook given the hook ID -func (c *Client4) DeleteIncomingWebhook(hookID string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetIncomingWebhookRoute(hookID)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// CreateOutgoingWebhook creates an outgoing webhook for a team or channel. -func (c *Client4) CreateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response) { - if r, err := c.DoApiPost(c.GetOutgoingWebhooksRoute(), hook.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateOutgoingWebhook creates an outgoing webhook for a team or channel. -func (c *Client4) UpdateOutgoingWebhook(hook *OutgoingWebhook) (*OutgoingWebhook, *Response) { - if r, err := c.DoApiPut(c.GetOutgoingWebhookRoute(hook.Id), hook.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// GetOutgoingWebhooks returns a page of outgoing webhooks on the system. Page counting starts at 0. -func (c *Client4) GetOutgoingWebhooks(page int, perPage int, etag string) ([]*OutgoingWebhook, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetOutgoingWebhooksRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookListFromJson(r.Body), BuildResponse(r) - } -} - -// GetOutgoingWebhook outgoing webhooks on the system requested by Hook Id. -func (c *Client4) GetOutgoingWebhook(hookId string) (*OutgoingWebhook, *Response) { - if r, err := c.DoApiGet(c.GetOutgoingWebhookRoute(hookId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// GetOutgoingWebhooksForChannel returns a page of outgoing webhooks for a channel. Page counting starts at 0. -func (c *Client4) GetOutgoingWebhooksForChannel(channelId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v&channel_id=%v", page, perPage, channelId) - if r, err := c.DoApiGet(c.GetOutgoingWebhooksRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookListFromJson(r.Body), BuildResponse(r) - } -} - -// GetOutgoingWebhooksForTeam returns a page of outgoing webhooks for a team. Page counting starts at 0. -func (c *Client4) GetOutgoingWebhooksForTeam(teamId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v&team_id=%v", page, perPage, teamId) - if r, err := c.DoApiGet(c.GetOutgoingWebhooksRoute()+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookListFromJson(r.Body), BuildResponse(r) - } -} - -// RegenOutgoingHookToken regenerate the outgoing webhook token. -func (c *Client4) RegenOutgoingHookToken(hookId string) (*OutgoingWebhook, *Response) { - if r, err := c.DoApiPost(c.GetOutgoingWebhookRoute(hookId)+"/regen_token", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OutgoingWebhookFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteOutgoingWebhook delete the outgoing webhook on the system requested by Hook Id. -func (c *Client4) DeleteOutgoingWebhook(hookId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetOutgoingWebhookRoute(hookId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Preferences Section - -// GetPreferences returns the user's preferences. -func (c *Client4) GetPreferences(userId string) (Preferences, *Response) { - if r, err := c.DoApiGet(c.GetPreferencesRoute(userId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - preferences, _ := PreferencesFromJson(r.Body) - defer closeBody(r) - return preferences, BuildResponse(r) - } -} - -// UpdatePreferences saves the user's preferences. -func (c *Client4) UpdatePreferences(userId string, preferences *Preferences) (bool, *Response) { - if r, err := c.DoApiPut(c.GetPreferencesRoute(userId), preferences.ToJson()); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return true, BuildResponse(r) - } -} - -// DeletePreferences deletes the user's preferences. -func (c *Client4) DeletePreferences(userId string, preferences *Preferences) (bool, *Response) { - if r, err := c.DoApiPost(c.GetPreferencesRoute(userId)+"/delete", preferences.ToJson()); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return true, BuildResponse(r) - } -} - -// GetPreferencesByCategory returns the user's preferences from the provided category string. -func (c *Client4) GetPreferencesByCategory(userId string, category string) (Preferences, *Response) { - url := fmt.Sprintf(c.GetPreferencesRoute(userId)+"/%s", category) - if r, err := c.DoApiGet(url, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - preferences, _ := PreferencesFromJson(r.Body) - defer closeBody(r) - return preferences, BuildResponse(r) - } -} - -// GetPreferenceByCategoryAndName returns the user's preferences from the provided category and preference name string. -func (c *Client4) GetPreferenceByCategoryAndName(userId string, category string, preferenceName string) (*Preference, *Response) { - url := fmt.Sprintf(c.GetPreferencesRoute(userId)+"/%s/name/%v", category, preferenceName) - if r, err := c.DoApiGet(url, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PreferenceFromJson(r.Body), BuildResponse(r) - } -} - -// SAML Section - -// GetSamlMetadata returns metadata for the SAML configuration. -func (c *Client4) GetSamlMetadata() (string, *Response) { - if r, err := c.DoApiGet(c.GetSamlRoute()+"/metadata", ""); err != nil { - return "", BuildErrorResponse(r, err) - } else { - defer closeBody(r) - buf := new(bytes.Buffer) - buf.ReadFrom(r.Body) - return buf.String(), BuildResponse(r) - } -} - -func samlFileToMultipart(data []byte, filename string) ([]byte, *multipart.Writer, error) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("certificate", filename); err != nil { - return nil, nil, err - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return nil, nil, err - } - - if err := writer.Close(); err != nil { - return nil, nil, err - } - - return body.Bytes(), writer, nil -} - -// UploadSamlIdpCertificate will upload an IDP certificate for SAML and set the config to use it. -func (c *Client4) UploadSamlIdpCertificate(data []byte, filename string) (bool, *Response) { - body, writer, err := samlFileToMultipart(data, filename) - if err != nil { - return false, &Response{Error: NewAppError("UploadSamlIdpCertificate", "model.client.upload_saml_cert.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - _, resp := c.DoUploadFile(c.GetSamlRoute()+"/certificate/idp", body, writer.FormDataContentType()) - return resp.Error == nil, resp -} - -// UploadSamlPublicCertificate will upload a public certificate for SAML and set the config to use it. -func (c *Client4) UploadSamlPublicCertificate(data []byte, filename string) (bool, *Response) { - body, writer, err := samlFileToMultipart(data, filename) - if err != nil { - return false, &Response{Error: NewAppError("UploadSamlPublicCertificate", "model.client.upload_saml_cert.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - _, resp := c.DoUploadFile(c.GetSamlRoute()+"/certificate/public", body, writer.FormDataContentType()) - return resp.Error == nil, resp -} - -// UploadSamlPrivateCertificate will upload a private key for SAML and set the config to use it. -func (c *Client4) UploadSamlPrivateCertificate(data []byte, filename string) (bool, *Response) { - body, writer, err := samlFileToMultipart(data, filename) - if err != nil { - return false, &Response{Error: NewAppError("UploadSamlPrivateCertificate", "model.client.upload_saml_cert.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - _, resp := c.DoUploadFile(c.GetSamlRoute()+"/certificate/private", body, writer.FormDataContentType()) - return resp.Error == nil, resp -} - -// DeleteSamlIdpCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML. -func (c *Client4) DeleteSamlIdpCertificate() (bool, *Response) { - if r, err := c.DoApiDelete(c.GetSamlRoute() + "/certificate/idp"); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// DeleteSamlPublicCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML. -func (c *Client4) DeleteSamlPublicCertificate() (bool, *Response) { - if r, err := c.DoApiDelete(c.GetSamlRoute() + "/certificate/public"); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// DeleteSamlPrivateCertificate deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML. -func (c *Client4) DeleteSamlPrivateCertificate() (bool, *Response) { - if r, err := c.DoApiDelete(c.GetSamlRoute() + "/certificate/private"); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetSamlCertificateStatus returns metadata for the SAML configuration. -func (c *Client4) GetSamlCertificateStatus() (*SamlCertificateStatus, *Response) { - if r, err := c.DoApiGet(c.GetSamlRoute()+"/certificate/status", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return SamlCertificateStatusFromJson(r.Body), BuildResponse(r) - } -} - -// Compliance Section - -// CreateComplianceReport creates an incoming webhook for a channel. -func (c *Client4) CreateComplianceReport(report *Compliance) (*Compliance, *Response) { - if r, err := c.DoApiPost(c.GetComplianceReportsRoute(), report.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ComplianceFromJson(r.Body), BuildResponse(r) - } -} - -// GetComplianceReports returns list of compliance reports. -func (c *Client4) GetComplianceReports(page, perPage int) (Compliances, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetComplianceReportsRoute()+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CompliancesFromJson(r.Body), BuildResponse(r) - } -} - -// GetComplianceReport returns a compliance report. -func (c *Client4) GetComplianceReport(reportId string) (*Compliance, *Response) { - if r, err := c.DoApiGet(c.GetComplianceReportRoute(reportId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ComplianceFromJson(r.Body), BuildResponse(r) - } -} - -// DownloadComplianceReport returns a full compliance report as a file. -func (c *Client4) DownloadComplianceReport(reportId string) ([]byte, *Response) { - var rq *http.Request - rq, _ = http.NewRequest("GET", c.ApiUrl+c.GetComplianceReportRoute(reportId), nil) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, "BEARER "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return nil, &Response{Error: NewAppError("DownloadComplianceReport", "model.client.connecting.app_error", nil, err.Error(), http.StatusBadRequest)} - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return nil, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else if data, err := ioutil.ReadAll(rp.Body); err != nil { - return nil, BuildErrorResponse(rp, NewAppError("DownloadComplianceReport", "model.client.read_file.app_error", nil, err.Error(), rp.StatusCode)) - } else { - return data, BuildResponse(rp) - } - } -} - -// Cluster Section - -// GetClusterStatus returns the status of all the configured cluster nodes. -func (c *Client4) GetClusterStatus() ([]*ClusterInfo, *Response) { - if r, err := c.DoApiGet(c.GetClusterRoute()+"/status", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ClusterInfosFromJson(r.Body), BuildResponse(r) - } -} - -// LDAP Section - -// SyncLdap will force a sync with the configured LDAP server. -func (c *Client4) SyncLdap() (bool, *Response) { - if r, err := c.DoApiPost(c.GetLdapRoute()+"/sync", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// TestLdap will attempt to connect to the configured LDAP server and return OK if configured -// correctly. -func (c *Client4) TestLdap() (bool, *Response) { - if r, err := c.DoApiPost(c.GetLdapRoute()+"/test", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Audits Section - -// GetAudits returns a list of audits for the whole system. -func (c *Client4) GetAudits(page int, perPage int, etag string) (Audits, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet("/audits"+query, etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return AuditsFromJson(r.Body), BuildResponse(r) - } -} - -// Brand Section - -// GetBrandImage retrieves the previously uploaded brand image. -func (c *Client4) GetBrandImage() ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetBrandRoute()+"/image", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if r.StatusCode >= 300 { - return nil, BuildErrorResponse(r, AppErrorFromJson(r.Body)) - } else if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("GetBrandImage", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// UploadBrandImage sets the brand image for the system. -func (c *Client4) UploadBrandImage(data []byte) (bool, *Response) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("image", "brand.png"); err != nil { - return false, &Response{Error: NewAppError("UploadBrandImage", "model.client.set_profile_user.no_file.app_error", nil, err.Error(), http.StatusBadRequest)} - } else if _, err = io.Copy(part, bytes.NewBuffer(data)); err != nil { - return false, &Response{Error: NewAppError("UploadBrandImage", "model.client.set_profile_user.no_file.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - if err := writer.Close(); err != nil { - return false, &Response{Error: NewAppError("UploadBrandImage", "model.client.set_profile_user.writer.app_error", nil, err.Error(), http.StatusBadRequest)} - } - - rq, _ := http.NewRequest("POST", c.ApiUrl+c.GetBrandRoute()+"/image", bytes.NewReader(body.Bytes())) - rq.Header.Set("Content-Type", writer.FormDataContentType()) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return false, &Response{StatusCode: http.StatusForbidden, Error: NewAppError(c.GetBrandRoute()+"/image", "model.client.connecting.app_error", nil, err.Error(), http.StatusForbidden)} - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return false, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return CheckStatusOK(rp), BuildResponse(rp) - } - } -} - -// Logs Section - -// GetLogs page of logs as a string array. -func (c *Client4) GetLogs(page, perPage int) ([]string, *Response) { - query := fmt.Sprintf("?page=%v&logs_per_page=%v", page, perPage) - if r, err := c.DoApiGet("/logs"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ArrayFromJson(r.Body), BuildResponse(r) - } -} - -// PostLog is a convenience Web Service call so clients can log messages into -// the server-side logs. For example we typically log javascript error messages -// into the server-side. It returns the log message if the logging was successful. -func (c *Client4) PostLog(message map[string]string) (map[string]string, *Response) { - if r, err := c.DoApiPost("/logs", MapToJson(message)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body), BuildResponse(r) - } -} - -// OAuth Section - -// CreateOAuthApp will register a new OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider. -func (c *Client4) CreateOAuthApp(app *OAuthApp) (*OAuthApp, *Response) { - if r, err := c.DoApiPost(c.GetOAuthAppsRoute(), app.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateOAuthApp -func (c *Client4) UpdateOAuthApp(app *OAuthApp) (*OAuthApp, *Response) { - if r, err := c.DoApiPut(c.GetOAuthAppRoute(app.Id), app.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppFromJson(r.Body), BuildResponse(r) - } -} - -// GetOAuthApps gets a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider. -func (c *Client4) GetOAuthApps(page, perPage int) ([]*OAuthApp, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetOAuthAppsRoute()+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppListFromJson(r.Body), BuildResponse(r) - } -} - -// GetOAuthApp gets a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider. -func (c *Client4) GetOAuthApp(appId string) (*OAuthApp, *Response) { - if r, err := c.DoApiGet(c.GetOAuthAppRoute(appId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppFromJson(r.Body), BuildResponse(r) - } -} - -// GetOAuthAppInfo gets a sanitized version of a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider. -func (c *Client4) GetOAuthAppInfo(appId string) (*OAuthApp, *Response) { - if r, err := c.DoApiGet(c.GetOAuthAppRoute(appId)+"/info", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteOAuthApp deletes a registered OAuth 2.0 client application. -func (c *Client4) DeleteOAuthApp(appId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetOAuthAppRoute(appId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// RegenerateOAuthAppSecret regenerates the client secret for a registered OAuth 2.0 client application. -func (c *Client4) RegenerateOAuthAppSecret(appId string) (*OAuthApp, *Response) { - if r, err := c.DoApiPost(c.GetOAuthAppRoute(appId)+"/regen_secret", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppFromJson(r.Body), BuildResponse(r) - } -} - -// GetAuthorizedOAuthAppsForUser gets a page of OAuth 2.0 client applications the user has authorized to use access their account. -func (c *Client4) GetAuthorizedOAuthAppsForUser(userId string, page, perPage int) ([]*OAuthApp, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/oauth/apps/authorized"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return OAuthAppListFromJson(r.Body), BuildResponse(r) - } -} - -// AuthorizeOAuthApp will authorize an OAuth 2.0 client application to access a user's account and provide a redirect link to follow. -func (c *Client4) AuthorizeOAuthApp(authRequest *AuthorizeRequest) (string, *Response) { - if r, err := c.DoApiRequest(http.MethodPost, c.Url+"/oauth/authorize", authRequest.ToJson(), ""); err != nil { - return "", BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body)["redirect"], BuildResponse(r) - } -} - -// DeauthorizeOAuthApp will deauthorize an OAuth 2.0 client application from accessing a user's account. -func (c *Client4) DeauthorizeOAuthApp(appId string) (bool, *Response) { - requestData := map[string]string{"client_id": appId} - if r, err := c.DoApiRequest(http.MethodPost, c.Url+"/oauth/deauthorize", MapToJson(requestData), ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Elasticsearch Section - -// TestElasticsearch will attempt to connect to the configured Elasticsearch server and return OK if configured -// correctly. -func (c *Client4) TestElasticsearch() (bool, *Response) { - if r, err := c.DoApiPost(c.GetElasticsearchRoute()+"/test", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// PurgeElasticsearchIndexes immediately deletes all Elasticsearch indexes. -func (c *Client4) PurgeElasticsearchIndexes() (bool, *Response) { - if r, err := c.DoApiPost(c.GetElasticsearchRoute()+"/purge_indexes", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Data Retention Section - -// GetDataRetentionPolicy will get the current server data retention policy details. -func (c *Client4) GetDataRetentionPolicy() (*DataRetentionPolicy, *Response) { - if r, err := c.DoApiGet(c.GetDataRetentionRoute()+"/policy", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return DataRetentionPolicyFromJson(r.Body), BuildResponse(r) - } -} - -// Commands Section - -// CreateCommand will create a new command if the user have the right permissions. -func (c *Client4) CreateCommand(cmd *Command) (*Command, *Response) { - if r, err := c.DoApiPost(c.GetCommandsRoute(), cmd.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CommandFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateCommand updates a command based on the provided Command struct -func (c *Client4) UpdateCommand(cmd *Command) (*Command, *Response) { - if r, err := c.DoApiPut(c.GetCommandRoute(cmd.Id), cmd.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CommandFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteCommand deletes a command based on the provided command id string -func (c *Client4) DeleteCommand(commandId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetCommandRoute(commandId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// ListCommands will retrieve a list of commands available in the team. -func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Response) { - query := fmt.Sprintf("?team_id=%v&custom_only=%v", teamId, customOnly) - if r, err := c.DoApiGet(c.GetCommandsRoute()+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CommandListFromJson(r.Body), BuildResponse(r) - } -} - -// ExecuteCommand executes a given slash command. -func (c *Client4) ExecuteCommand(channelId, command string) (*CommandResponse, *Response) { - commandArgs := &CommandArgs{ - ChannelId: channelId, - Command: command, - } - if r, err := c.DoApiPost(c.GetCommandsRoute()+"/execute", commandArgs.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CommandResponseFromJson(r.Body), BuildResponse(r) - } -} - -// ExecuteCommand executes a given slash command against the specified team -// Use this when executing slash commands in a DM/GM, since the team id cannot be inferred in that case -func (c *Client4) ExecuteCommandWithTeam(channelId, teamId, command string) (*CommandResponse, *Response) { - commandArgs := &CommandArgs{ - ChannelId: channelId, - TeamId: teamId, - Command: command, - } - if r, err := c.DoApiPost(c.GetCommandsRoute()+"/execute", commandArgs.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CommandResponseFromJson(r.Body), BuildResponse(r) - } -} - -// ListCommands will retrieve a list of commands available in the team. -func (c *Client4) ListAutocompleteCommands(teamId string) ([]*Command, *Response) { - if r, err := c.DoApiGet(c.GetTeamAutoCompleteCommandsRoute(teamId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CommandListFromJson(r.Body), BuildResponse(r) - } -} - -// RegenCommandToken will create a new token if the user have the right permissions. -func (c *Client4) RegenCommandToken(commandId string) (string, *Response) { - if r, err := c.DoApiPut(c.GetCommandRoute(commandId)+"/regen_token", ""); err != nil { - return "", BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body)["token"], BuildResponse(r) - } -} - -// Status Section - -// GetUserStatus returns a user based on the provided user id string. -func (c *Client4) GetUserStatus(userId, etag string) (*Status, *Response) { - if r, err := c.DoApiGet(c.GetUserStatusRoute(userId), etag); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return StatusFromJson(r.Body), BuildResponse(r) - } -} - -// GetUsersStatusesByIds returns a list of users status based on the provided user ids. -func (c *Client4) GetUsersStatusesByIds(userIds []string) ([]*Status, *Response) { - if r, err := c.DoApiPost(c.GetUserStatusesRoute()+"/ids", ArrayToJson(userIds)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return StatusListFromJson(r.Body), BuildResponse(r) - } -} - -// UpdateUserStatus sets a user's status based on the provided user id string. -func (c *Client4) UpdateUserStatus(userId string, userStatus *Status) (*Status, *Response) { - if r, err := c.DoApiPut(c.GetUserStatusRoute(userId), userStatus.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return StatusFromJson(r.Body), BuildResponse(r) - - } -} - -// Webrtc Section - -// GetWebrtcToken returns a valid token, stun server and turn server with credentials to -// use with the Mattermost WebRTC service. -func (c *Client4) GetWebrtcToken() (*WebrtcInfoResponse, *Response) { - if r, err := c.DoApiGet("/webrtc/token", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return WebrtcInfoResponseFromJson(r.Body), BuildResponse(r) - } -} - -// Emoji Section - -// CreateEmoji will save an emoji to the server if the current user has permission -// to do so. If successful, the provided emoji will be returned with its Id field -// filled in. Otherwise, an error will be returned. -func (c *Client4) CreateEmoji(emoji *Emoji, image []byte, filename string) (*Emoji, *Response) { - body := &bytes.Buffer{} - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("image", filename); err != nil { - return nil, &Response{StatusCode: http.StatusForbidden, Error: NewAppError("CreateEmoji", "model.client.create_emoji.image.app_error", nil, err.Error(), 0)} - } else if _, err = io.Copy(part, bytes.NewBuffer(image)); err != nil { - return nil, &Response{StatusCode: http.StatusForbidden, Error: NewAppError("CreateEmoji", "model.client.create_emoji.image.app_error", nil, err.Error(), 0)} - } - - if err := writer.WriteField("emoji", emoji.ToJson()); err != nil { - return nil, &Response{StatusCode: http.StatusForbidden, Error: NewAppError("CreateEmoji", "model.client.create_emoji.emoji.app_error", nil, err.Error(), 0)} - } - - if err := writer.Close(); err != nil { - return nil, &Response{StatusCode: http.StatusForbidden, Error: NewAppError("CreateEmoji", "model.client.create_emoji.writer.app_error", nil, err.Error(), 0)} - } - - return c.DoEmojiUploadFile(c.GetEmojisRoute(), body.Bytes(), writer.FormDataContentType()) -} - -// GetEmojiList returns a page of custom emoji on the system. -func (c *Client4) GetEmojiList(page, perPage int) ([]*Emoji, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage) - if r, err := c.DoApiGet(c.GetEmojisRoute()+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return EmojiListFromJson(r.Body), BuildResponse(r) - } -} - -// GetSortedEmojiList returns a page of custom emoji on the system sorted based on the sort -// parameter, blank for no sorting and "name" to sort by emoji names. -func (c *Client4) GetSortedEmojiList(page, perPage int, sort string) ([]*Emoji, *Response) { - query := fmt.Sprintf("?page=%v&per_page=%v&sort=%v", page, perPage, sort) - if r, err := c.DoApiGet(c.GetEmojisRoute()+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return EmojiListFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteEmoji delete an custom emoji on the provided emoji id string. -func (c *Client4) DeleteEmoji(emojiId string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetEmojiRoute(emojiId)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetEmoji returns a custom emoji based on the emojiId string. -func (c *Client4) GetEmoji(emojiId string) (*Emoji, *Response) { - if r, err := c.DoApiGet(c.GetEmojiRoute(emojiId), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return EmojiFromJson(r.Body), BuildResponse(r) - } -} - -// GetEmojiByName returns a custom emoji based on the name string. -func (c *Client4) GetEmojiByName(name string) (*Emoji, *Response) { - if r, err := c.DoApiGet(c.GetEmojiByNameRoute(name), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return EmojiFromJson(r.Body), BuildResponse(r) - } -} - -// GetEmojiImage returns the emoji image. -func (c *Client4) GetEmojiImage(emojiId string) ([]byte, *Response) { - if r, err := c.DoApiGet(c.GetEmojiRoute(emojiId)+"/image", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - - if data, err := ioutil.ReadAll(r.Body); err != nil { - return nil, BuildErrorResponse(r, NewAppError("GetEmojiImage", "model.client.read_file.app_error", nil, err.Error(), r.StatusCode)) - } else { - return data, BuildResponse(r) - } - } -} - -// SearchEmoji returns a list of emoji matching some search criteria. -func (c *Client4) SearchEmoji(search *EmojiSearch) ([]*Emoji, *Response) { - if r, err := c.DoApiPost(c.GetEmojisRoute()+"/search", search.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return EmojiListFromJson(r.Body), BuildResponse(r) - } -} - -// AutocompleteEmoji returns a list of emoji starting with or matching name. -func (c *Client4) AutocompleteEmoji(name string, etag string) ([]*Emoji, *Response) { - query := fmt.Sprintf("?name=%v", name) - if r, err := c.DoApiGet(c.GetEmojisRoute()+"/autocomplete"+query, ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return EmojiListFromJson(r.Body), BuildResponse(r) - } -} - -// Reaction Section - -// SaveReaction saves an emoji reaction for a post. Returns the saved reaction if successful, otherwise an error will be returned. -func (c *Client4) SaveReaction(reaction *Reaction) (*Reaction, *Response) { - if r, err := c.DoApiPost(c.GetReactionsRoute(), reaction.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ReactionFromJson(r.Body), BuildResponse(r) - } -} - -// GetReactions returns a list of reactions to a post. -func (c *Client4) GetReactions(postId string) ([]*Reaction, *Response) { - if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/reactions", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ReactionsFromJson(r.Body), BuildResponse(r) - } -} - -// DeleteReaction deletes reaction of a user in a post. -func (c *Client4) DeleteReaction(reaction *Reaction) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetUserRoute(reaction.UserId) + c.GetPostRoute(reaction.PostId) + fmt.Sprintf("/reactions/%v", reaction.EmojiName)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Open Graph Metadata Section - -// OpenGraph return the open graph metadata for a particular url if the site have the metadata -func (c *Client4) OpenGraph(url string) (map[string]string, *Response) { - requestBody := make(map[string]string) - requestBody["url"] = url - - if r, err := c.DoApiPost(c.GetOpenGraphRoute(), MapToJson(requestBody)); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return MapFromJson(r.Body), BuildResponse(r) - } -} - -// Jobs Section - -// GetJob gets a single job. -func (c *Client4) GetJob(id string) (*Job, *Response) { - if r, err := c.DoApiGet(c.GetJobsRoute()+fmt.Sprintf("/%v", id), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return JobFromJson(r.Body), BuildResponse(r) - } -} - -// Get all jobs, sorted with the job that was created most recently first. -func (c *Client4) GetJobs(page int, perPage int) ([]*Job, *Response) { - if r, err := c.DoApiGet(c.GetJobsRoute()+fmt.Sprintf("?page=%v&per_page=%v", page, perPage), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return JobsFromJson(r.Body), BuildResponse(r) - } -} - -// GetJobsByType gets all jobs of a given type, sorted with the job that was created most recently first. -func (c *Client4) GetJobsByType(jobType string, page int, perPage int) ([]*Job, *Response) { - if r, err := c.DoApiGet(c.GetJobsRoute()+fmt.Sprintf("/type/%v?page=%v&per_page=%v", jobType, page, perPage), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return JobsFromJson(r.Body), BuildResponse(r) - } -} - -// CreateJob creates a job based on the provided job struct. -func (c *Client4) CreateJob(job *Job) (*Job, *Response) { - if r, err := c.DoApiPost(c.GetJobsRoute(), job.ToJson()); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return JobFromJson(r.Body), BuildResponse(r) - } -} - -// CancelJob requests the cancellation of the job with the provided Id. -func (c *Client4) CancelJob(jobId string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetJobsRoute()+fmt.Sprintf("/%v/cancel", jobId), ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// Plugin Section - -// UploadPlugin takes an io.Reader stream pointing to the contents of a .tar.gz plugin. -// WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE. -func (c *Client4) UploadPlugin(file io.Reader) (*Manifest, *Response) { - body := new(bytes.Buffer) - writer := multipart.NewWriter(body) - - if part, err := writer.CreateFormFile("plugin", "plugin.tar.gz"); err != nil { - return nil, &Response{Error: NewAppError("UploadPlugin", "model.client.writer.app_error", nil, err.Error(), 0)} - } else if _, err = io.Copy(part, file); err != nil { - return nil, &Response{Error: NewAppError("UploadPlugin", "model.client.writer.app_error", nil, err.Error(), 0)} - } - - if err := writer.Close(); err != nil { - return nil, &Response{Error: NewAppError("UploadPlugin", "model.client.writer.app_error", nil, err.Error(), 0)} - } - - rq, _ := http.NewRequest("POST", c.ApiUrl+c.GetPluginsRoute(), body) - rq.Header.Set("Content-Type", writer.FormDataContentType()) - rq.Close = true - - if len(c.AuthToken) > 0 { - rq.Header.Set(HEADER_AUTH, c.AuthType+" "+c.AuthToken) - } - - if rp, err := c.HttpClient.Do(rq); err != nil || rp == nil { - return nil, BuildErrorResponse(rp, NewAppError("UploadPlugin", "model.client.connecting.app_error", nil, err.Error(), 0)) - } else { - defer closeBody(rp) - - if rp.StatusCode >= 300 { - return nil, BuildErrorResponse(rp, AppErrorFromJson(rp.Body)) - } else { - return ManifestFromJson(rp.Body), BuildResponse(rp) - } - } -} - -// GetPlugins will return a list of plugin manifests for currently active plugins. -// WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE. -func (c *Client4) GetPlugins() (*PluginsResponse, *Response) { - if r, err := c.DoApiGet(c.GetPluginsRoute(), ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return PluginsResponseFromJson(r.Body), BuildResponse(r) - } -} - -// RemovePlugin will deactivate and delete a plugin. -// WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE. -func (c *Client4) RemovePlugin(id string) (bool, *Response) { - if r, err := c.DoApiDelete(c.GetPluginRoute(id)); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// GetWebappPlugins will return a list of plugins that the webapp should download. -// WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE. -func (c *Client4) GetWebappPlugins() ([]*Manifest, *Response) { - if r, err := c.DoApiGet(c.GetPluginsRoute()+"/webapp", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return ManifestListFromJson(r.Body), BuildResponse(r) - } -} - -// ActivatePlugin will activate an plugin installed. -// WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE. -func (c *Client4) ActivatePlugin(id string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetPluginRoute(id)+"/activate", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} - -// DeactivatePlugin will deactivate an active plugin. -// WARNING: PLUGINS ARE STILL EXPERIMENTAL. THIS FUNCTION IS SUBJECT TO CHANGE. -func (c *Client4) DeactivatePlugin(id string) (bool, *Response) { - if r, err := c.DoApiPost(c.GetPluginRoute(id)+"/deactivate", ""); err != nil { - return false, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return CheckStatusOK(r), BuildResponse(r) - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/cluster_discovery.go b/vendor/github.com/mattermost/mattermost-server/model/cluster_discovery.go deleted file mode 100644 index 89e5fc95..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/cluster_discovery.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "os" -) - -const ( - CDS_OFFLINE_AFTER_MILLIS = 1000 * 60 * 30 // 30 minutes - CDS_TYPE_APP = "mattermost_app" -) - -type ClusterDiscovery struct { - Id string `json:"id"` - Type string `json:"type"` - ClusterName string `json:"cluster_name"` - Hostname string `json:"hostname"` - GossipPort int32 `json:"gossip_port"` - Port int32 `json:"port"` - CreateAt int64 `json:"create_at"` - LastPingAt int64 `json:"last_ping_at"` -} - -func (o *ClusterDiscovery) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - if o.CreateAt == 0 { - o.CreateAt = GetMillis() - o.LastPingAt = o.CreateAt - } -} - -func (o *ClusterDiscovery) AutoFillHostname() { - // attempt to set the hostname from the OS - if len(o.Hostname) == 0 { - if hn, err := os.Hostname(); err == nil { - o.Hostname = hn - } - } -} - -func (o *ClusterDiscovery) AutoFillIpAddress() { - // attempt to set the hostname to the first non-local IP address - if len(o.Hostname) == 0 { - o.Hostname = GetServerIpAddress() - } -} - -func (o *ClusterDiscovery) IsEqual(in *ClusterDiscovery) bool { - if in == nil { - return false - } - - if o.Type != in.Type { - return false - } - - if o.ClusterName != in.ClusterName { - return false - } - - if o.Hostname != in.Hostname { - return false - } - - return true -} - -func FilterClusterDiscovery(vs []*ClusterDiscovery, f func(*ClusterDiscovery) bool) []*ClusterDiscovery { - copy := make([]*ClusterDiscovery, 0) - for _, v := range vs { - if f(v) { - copy = append(copy, v) - } - } - - return copy -} - -func (o *ClusterDiscovery) IsValid() *AppError { - if len(o.Id) != 26 { - return NewAppError("Channel.IsValid", "model.channel.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ClusterName) == 0 { - return NewAppError("ClusterDiscovery.IsValid", "ClusterName must be set", nil, "", http.StatusBadRequest) - } - - if len(o.Type) == 0 { - return NewAppError("ClusterDiscovery.IsValid", "Type must be set", nil, "", http.StatusBadRequest) - } - - if len(o.Hostname) == 0 { - return NewAppError("ClusterDiscovery.IsValid", "Hostname must be set", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("ClusterDiscovery.IsValid", "CreateAt must be set", nil, "", http.StatusBadRequest) - } - - if o.LastPingAt == 0 { - return NewAppError("ClusterDiscovery.IsValid", "LastPingAt must be set", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *ClusterDiscovery) ToJson() string { - b, err := json.Marshal(o) - if err != nil { - return "" - } - - return string(b) -} - -func ClusterDiscoveryFromJson(data io.Reader) *ClusterDiscovery { - decoder := json.NewDecoder(data) - var me ClusterDiscovery - err := decoder.Decode(&me) - if err == nil { - return &me - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/cluster_info.go b/vendor/github.com/mattermost/mattermost-server/model/cluster_info.go deleted file mode 100644 index a8d63ec3..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/cluster_info.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "strings" -) - -type ClusterInfo struct { - Id string `json:"id"` - Version string `json:"version"` - ConfigHash string `json:"config_hash"` - IpAddress string `json:"ipaddress"` - Hostname string `json:"hostname"` -} - -func (me *ClusterInfo) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func (me *ClusterInfo) Copy() *ClusterInfo { - json := me.ToJson() - return ClusterInfoFromJson(strings.NewReader(json)) -} - -func ClusterInfoFromJson(data io.Reader) *ClusterInfo { - var me *ClusterInfo - json.NewDecoder(data).Decode(&me) - return me -} - -func ClusterInfosToJson(objmap []*ClusterInfo) string { - b, _ := json.Marshal(objmap) - return string(b) -} - -func ClusterInfosFromJson(data io.Reader) []*ClusterInfo { - decoder := json.NewDecoder(data) - - var objmap []*ClusterInfo - if err := decoder.Decode(&objmap); err != nil { - return make([]*ClusterInfo, 0) - } else { - return objmap - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go b/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go deleted file mode 100644 index f060c4ac..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -const ( - CLUSTER_EVENT_PUBLISH = "publish" - CLUSTER_EVENT_UPDATE_STATUS = "update_status" - CLUSTER_EVENT_INVALIDATE_ALL_CACHES = "inv_all_caches" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_REACTIONS = "inv_reactions" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_WEBHOOK = "inv_webhook" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_POSTS = "inv_channel_posts" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBERS_NOTIFY_PROPS = "inv_channel_members_notify_props" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBERS = "inv_channel_members" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_BY_NAME = "inv_channel_name" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL = "inv_channel" - CLUSTER_EVENT_INVALIDATE_CACHE_FOR_USER = "inv_user" - CLUSTER_EVENT_CLEAR_SESSION_CACHE_FOR_USER = "clear_session_user" - - CLUSTER_SEND_BEST_EFFORT = "best_effort" - CLUSTER_SEND_RELIABLE = "reliable" -) - -type ClusterMessage struct { - Event string `json:"event"` - SendType string `json:"-"` - WaitForAllToSend bool `json:"-"` - Data string `json:"data,omitempty"` - Props map[string]string `json:"props,omitempty"` -} - -func (o *ClusterMessage) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ClusterMessageFromJson(data io.Reader) *ClusterMessage { - var o *ClusterMessage - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/cluster_stats.go b/vendor/github.com/mattermost/mattermost-server/model/cluster_stats.go deleted file mode 100644 index 064f7b81..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/cluster_stats.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type ClusterStats struct { - Id string `json:"id"` - TotalWebsocketConnections int `json:"total_websocket_connections"` - TotalReadDbConnections int `json:"total_read_db_connections"` - TotalMasterDbConnections int `json:"total_master_db_connections"` -} - -func (me *ClusterStats) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func ClusterStatsFromJson(data io.Reader) *ClusterStats { - var me *ClusterStats - json.NewDecoder(data).Decode(&me) - return me -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/command.go b/vendor/github.com/mattermost/mattermost-server/model/command.go deleted file mode 100644 index b23e5020..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/command.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "strings" -) - -const ( - COMMAND_METHOD_POST = "P" - COMMAND_METHOD_GET = "G" - MIN_TRIGGER_LENGTH = 1 - MAX_TRIGGER_LENGTH = 128 -) - -type Command struct { - Id string `json:"id"` - Token string `json:"token"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - CreatorId string `json:"creator_id"` - TeamId string `json:"team_id"` - Trigger string `json:"trigger"` - Method string `json:"method"` - Username string `json:"username"` - IconURL string `json:"icon_url"` - AutoComplete bool `json:"auto_complete"` - AutoCompleteDesc string `json:"auto_complete_desc"` - AutoCompleteHint string `json:"auto_complete_hint"` - DisplayName string `json:"display_name"` - Description string `json:"description"` - URL string `json:"url"` -} - -func (o *Command) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func CommandFromJson(data io.Reader) *Command { - var o *Command - json.NewDecoder(data).Decode(&o) - return o -} - -func CommandListToJson(l []*Command) string { - b, _ := json.Marshal(l) - return string(b) -} - -func CommandListFromJson(data io.Reader) []*Command { - var o []*Command - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *Command) IsValid() *AppError { - - if len(o.Id) != 26 { - return NewAppError("Command.IsValid", "model.command.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Token) != 26 { - return NewAppError("Command.IsValid", "model.command.is_valid.token.app_error", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("Command.IsValid", "model.command.is_valid.create_at.app_error", nil, "", http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("Command.IsValid", "model.command.is_valid.update_at.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.CreatorId) != 26 { - return NewAppError("Command.IsValid", "model.command.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.TeamId) != 26 { - return NewAppError("Command.IsValid", "model.command.is_valid.team_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Trigger) < MIN_TRIGGER_LENGTH || len(o.Trigger) > MAX_TRIGGER_LENGTH || strings.Index(o.Trigger, "/") == 0 || strings.Contains(o.Trigger, " ") { - return NewAppError("Command.IsValid", "model.command.is_valid.trigger.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.URL) == 0 || len(o.URL) > 1024 { - return NewAppError("Command.IsValid", "model.command.is_valid.url.app_error", nil, "", http.StatusBadRequest) - } - - if !IsValidHttpUrl(o.URL) { - return NewAppError("Command.IsValid", "model.command.is_valid.url_http.app_error", nil, "", http.StatusBadRequest) - } - - if !(o.Method == COMMAND_METHOD_GET || o.Method == COMMAND_METHOD_POST) { - return NewAppError("Command.IsValid", "model.command.is_valid.method.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.DisplayName) > 64 { - return NewAppError("Command.IsValid", "model.command.is_valid.display_name.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Description) > 128 { - return NewAppError("Command.IsValid", "model.command.is_valid.description.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *Command) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - if o.Token == "" { - o.Token = NewId() - } - - o.CreateAt = GetMillis() - o.UpdateAt = o.CreateAt -} - -func (o *Command) PreUpdate() { - o.UpdateAt = GetMillis() -} - -func (o *Command) Sanitize() { - o.Token = "" - o.CreatorId = "" - o.Method = "" - o.URL = "" - o.Username = "" - o.IconURL = "" -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/command_args.go b/vendor/github.com/mattermost/mattermost-server/model/command_args.go deleted file mode 100644 index 4a635a1a..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/command_args.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - - goi18n "github.com/nicksnyder/go-i18n/i18n" -) - -type CommandArgs struct { - UserId string `json:"user_id"` - ChannelId string `json:"channel_id"` - TeamId string `json:"team_id"` - RootId string `json:"root_id"` - ParentId string `json:"parent_id"` - Command string `json:"command"` - SiteURL string `json:"-"` - T goi18n.TranslateFunc `json:"-"` - Session Session `json:"-"` -} - -func (o *CommandArgs) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func CommandArgsFromJson(data io.Reader) *CommandArgs { - var o *CommandArgs - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/command_response.go b/vendor/github.com/mattermost/mattermost-server/model/command_response.go deleted file mode 100644 index cac7e845..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/command_response.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "io/ioutil" - "strings" -) - -const ( - COMMAND_RESPONSE_TYPE_IN_CHANNEL = "in_channel" - COMMAND_RESPONSE_TYPE_EPHEMERAL = "ephemeral" -) - -type CommandResponse struct { - ResponseType string `json:"response_type"` - Text string `json:"text"` - Username string `json:"username"` - IconURL string `json:"icon_url"` - Type string `json:"type"` - Props StringInterface `json:"props"` - GotoLocation string `json:"goto_location"` - Attachments []*SlackAttachment `json:"attachments"` -} - -func (o *CommandResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func CommandResponseFromHTTPBody(contentType string, body io.Reader) *CommandResponse { - if strings.TrimSpace(strings.Split(contentType, ";")[0]) == "application/json" { - return CommandResponseFromJson(body) - } - if b, err := ioutil.ReadAll(body); err == nil { - return CommandResponseFromPlainText(string(b)) - } - return nil -} - -func CommandResponseFromPlainText(text string) *CommandResponse { - return &CommandResponse{ - Text: text, - } -} - -func CommandResponseFromJson(data io.Reader) *CommandResponse { - decoder := json.NewDecoder(data) - var o CommandResponse - - if err := decoder.Decode(&o); err != nil { - return nil - } - - o.Attachments = StringifySlackFieldValue(o.Attachments) - - return &o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/command_webhook.go b/vendor/github.com/mattermost/mattermost-server/model/command_webhook.go deleted file mode 100644 index 0b00e00b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/command_webhook.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "net/http" -) - -type CommandWebhook struct { - Id string - CreateAt int64 - CommandId string - UserId string - ChannelId string - RootId string - ParentId string - UseCount int -} - -const ( - COMMAND_WEBHOOK_LIFETIME = 1000 * 60 * 30 -) - -func (o *CommandWebhook) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - if o.CreateAt == 0 { - o.CreateAt = GetMillis() - } -} - -func (o *CommandWebhook) IsValid() *AppError { - if len(o.Id) != 26 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.id.app_error", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.CommandId) != 26 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.command_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.UserId) != 26 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ChannelId) != 26 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.channel_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.RootId) != 0 && len(o.RootId) != 26 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.root_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ParentId) != 0 && len(o.ParentId) != 26 { - return NewAppError("CommandWebhook.IsValid", "model.command_hook.parent_id.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/compliance.go b/vendor/github.com/mattermost/mattermost-server/model/compliance.go deleted file mode 100644 index 5546b783..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/compliance.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "strings" -) - -const ( - COMPLIANCE_STATUS_CREATED = "created" - COMPLIANCE_STATUS_RUNNING = "running" - COMPLIANCE_STATUS_FINISHED = "finished" - COMPLIANCE_STATUS_FAILED = "failed" - COMPLIANCE_STATUS_REMOVED = "removed" - - COMPLIANCE_TYPE_DAILY = "daily" - COMPLIANCE_TYPE_ADHOC = "adhoc" -) - -type Compliance struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UserId string `json:"user_id"` - Status string `json:"status"` - Count int `json:"count"` - Desc string `json:"desc"` - Type string `json:"type"` - StartAt int64 `json:"start_at"` - EndAt int64 `json:"end_at"` - Keywords string `json:"keywords"` - Emails string `json:"emails"` -} - -type Compliances []Compliance - -func (o *Compliance) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func (me *Compliance) PreSave() { - if me.Id == "" { - me.Id = NewId() - } - - if me.Status == "" { - me.Status = COMPLIANCE_STATUS_CREATED - } - - me.Count = 0 - me.Emails = NormalizeEmail(me.Emails) - me.Keywords = strings.ToLower(me.Keywords) - - me.CreateAt = GetMillis() -} - -func (me *Compliance) JobName() string { - jobName := me.Type - if me.Type == COMPLIANCE_TYPE_DAILY { - jobName += "-" + me.Desc - } - - jobName += "-" + me.Id - - return jobName -} - -func (me *Compliance) IsValid() *AppError { - - if len(me.Id) != 26 { - return NewAppError("Compliance.IsValid", "model.compliance.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if me.CreateAt == 0 { - return NewAppError("Compliance.IsValid", "model.compliance.is_valid.create_at.app_error", nil, "", http.StatusBadRequest) - } - - if len(me.Desc) > 512 || len(me.Desc) == 0 { - return NewAppError("Compliance.IsValid", "model.compliance.is_valid.desc.app_error", nil, "", http.StatusBadRequest) - } - - if me.StartAt == 0 { - return NewAppError("Compliance.IsValid", "model.compliance.is_valid.start_at.app_error", nil, "", http.StatusBadRequest) - } - - if me.EndAt == 0 { - return NewAppError("Compliance.IsValid", "model.compliance.is_valid.end_at.app_error", nil, "", http.StatusBadRequest) - } - - if me.EndAt <= me.StartAt { - return NewAppError("Compliance.IsValid", "model.compliance.is_valid.start_end_at.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func ComplianceFromJson(data io.Reader) *Compliance { - var o *Compliance - json.NewDecoder(data).Decode(&o) - return o -} - -func (o Compliances) ToJson() string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func CompliancesFromJson(data io.Reader) Compliances { - var o Compliances - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/compliance_post.go b/vendor/github.com/mattermost/mattermost-server/model/compliance_post.go deleted file mode 100644 index 3751c586..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/compliance_post.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "regexp" - "time" -) - -type CompliancePost struct { - - // From Team - TeamName string - TeamDisplayName string - - // From Channel - ChannelName string - ChannelDisplayName string - - // From User - UserUsername string - UserEmail string - UserNickname string - - // From Post - PostId string - PostCreateAt int64 - PostUpdateAt int64 - PostDeleteAt int64 - PostRootId string - PostParentId string - PostOriginalId string - PostMessage string - PostType string - PostProps string - PostHashtags string - PostFileIds string -} - -func CompliancePostHeader() []string { - return []string{ - "TeamName", - "TeamDisplayName", - - "ChannelName", - "ChannelDisplayName", - - "UserUsername", - "UserEmail", - "UserNickname", - - "PostId", - "PostCreateAt", - "PostUpdateAt", - "PostDeleteAt", - "PostRootId", - "PostParentId", - "PostOriginalId", - "PostMessage", - "PostType", - "PostProps", - "PostHashtags", - "PostFileIds", - } -} - -func cleanComplianceStrings(in string) string { - if matched, _ := regexp.MatchString("^\\s*(=|\\+|\\-)", in); matched { - return "'" + in - - } else { - return in - } -} - -func (me *CompliancePost) Row() []string { - - postDeleteAt := "" - if me.PostDeleteAt > 0 { - postDeleteAt = time.Unix(0, me.PostDeleteAt*int64(1000*1000)).Format(time.RFC3339) - } - - postUpdateAt := "" - if me.PostUpdateAt != me.PostCreateAt { - postUpdateAt = time.Unix(0, me.PostUpdateAt*int64(1000*1000)).Format(time.RFC3339) - } - - return []string{ - cleanComplianceStrings(me.TeamName), - cleanComplianceStrings(me.TeamDisplayName), - - cleanComplianceStrings(me.ChannelName), - cleanComplianceStrings(me.ChannelDisplayName), - - cleanComplianceStrings(me.UserUsername), - cleanComplianceStrings(me.UserEmail), - cleanComplianceStrings(me.UserNickname), - - me.PostId, - time.Unix(0, me.PostCreateAt*int64(1000*1000)).Format(time.RFC3339), - postUpdateAt, - postDeleteAt, - - me.PostRootId, - me.PostParentId, - me.PostOriginalId, - cleanComplianceStrings(me.PostMessage), - me.PostType, - me.PostProps, - me.PostHashtags, - me.PostFileIds, - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/config.go b/vendor/github.com/mattermost/mattermost-server/model/config.go deleted file mode 100644 index 9010eaea..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/config.go +++ /dev/null @@ -1,2238 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "net/url" - "strings" - "time" -) - -const ( - CONN_SECURITY_NONE = "" - CONN_SECURITY_PLAIN = "PLAIN" - CONN_SECURITY_TLS = "TLS" - CONN_SECURITY_STARTTLS = "STARTTLS" - - IMAGE_DRIVER_LOCAL = "local" - IMAGE_DRIVER_S3 = "amazons3" - - DATABASE_DRIVER_MYSQL = "mysql" - DATABASE_DRIVER_POSTGRES = "postgres" - - MINIO_ACCESS_KEY = "minioaccesskey" - MINIO_SECRET_KEY = "miniosecretkey" - MINIO_BUCKET = "mattermost-test" - - PASSWORD_MAXIMUM_LENGTH = 64 - PASSWORD_MINIMUM_LENGTH = 5 - - SERVICE_GITLAB = "gitlab" - SERVICE_GOOGLE = "google" - SERVICE_OFFICE365 = "office365" - - WEBSERVER_MODE_REGULAR = "regular" - WEBSERVER_MODE_GZIP = "gzip" - WEBSERVER_MODE_DISABLED = "disabled" - - GENERIC_NO_CHANNEL_NOTIFICATION = "generic_no_channel" - GENERIC_NOTIFICATION = "generic" - FULL_NOTIFICATION = "full" - - DIRECT_MESSAGE_ANY = "any" - DIRECT_MESSAGE_TEAM = "team" - - SHOW_USERNAME = "username" - SHOW_NICKNAME_FULLNAME = "nickname_full_name" - SHOW_FULLNAME = "full_name" - - PERMISSIONS_ALL = "all" - PERMISSIONS_CHANNEL_ADMIN = "channel_admin" - PERMISSIONS_TEAM_ADMIN = "team_admin" - PERMISSIONS_SYSTEM_ADMIN = "system_admin" - - FAKE_SETTING = "********************************" - - RESTRICT_EMOJI_CREATION_ALL = "all" - RESTRICT_EMOJI_CREATION_ADMIN = "admin" - RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin" - - PERMISSIONS_DELETE_POST_ALL = "all" - PERMISSIONS_DELETE_POST_TEAM_ADMIN = "team_admin" - PERMISSIONS_DELETE_POST_SYSTEM_ADMIN = "system_admin" - - ALLOW_EDIT_POST_ALWAYS = "always" - ALLOW_EDIT_POST_NEVER = "never" - ALLOW_EDIT_POST_TIME_LIMIT = "time_limit" - - GROUP_UNREAD_CHANNELS_DISABLED = "disabled" - GROUP_UNREAD_CHANNELS_DEFAULT_ON = "default_on" - GROUP_UNREAD_CHANNELS_DEFAULT_OFF = "default_off" - - EMAIL_BATCHING_BUFFER_SIZE = 256 - EMAIL_BATCHING_INTERVAL = 30 - - EMAIL_NOTIFICATION_CONTENTS_FULL = "full" - EMAIL_NOTIFICATION_CONTENTS_GENERIC = "generic" - - SITENAME_MAX_LENGTH = 30 - - SERVICE_SETTINGS_DEFAULT_SITE_URL = "" - SERVICE_SETTINGS_DEFAULT_TLS_CERT_FILE = "" - SERVICE_SETTINGS_DEFAULT_TLS_KEY_FILE = "" - SERVICE_SETTINGS_DEFAULT_READ_TIMEOUT = 300 - SERVICE_SETTINGS_DEFAULT_WRITE_TIMEOUT = 300 - SERVICE_SETTINGS_DEFAULT_MAX_LOGIN_ATTEMPTS = 10 - SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM = "" - SERVICE_SETTINGS_DEFAULT_LISTEN_AND_ADDRESS = ":8065" - - TEAM_SETTINGS_DEFAULT_MAX_USERS_PER_TEAM = 50 - TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT = "" - TEAM_SETTINGS_DEFAULT_CUSTOM_DESCRIPTION_TEXT = "" - TEAM_SETTINGS_DEFAULT_USER_STATUS_AWAY_TIMEOUT = 300 - - SQL_SETTINGS_DEFAULT_DATA_SOURCE = "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s" - - EMAIL_SETTINGS_DEFAULT_FEEDBACK_ORGANIZATION = "" - - SUPPORT_SETTINGS_DEFAULT_TERMS_OF_SERVICE_LINK = "https://about.mattermost.com/default-terms/" - SUPPORT_SETTINGS_DEFAULT_PRIVACY_POLICY_LINK = "https://about.mattermost.com/default-privacy-policy/" - SUPPORT_SETTINGS_DEFAULT_ABOUT_LINK = "https://about.mattermost.com/default-about/" - SUPPORT_SETTINGS_DEFAULT_HELP_LINK = "https://about.mattermost.com/default-help/" - SUPPORT_SETTINGS_DEFAULT_REPORT_A_PROBLEM_LINK = "https://about.mattermost.com/default-report-a-problem/" - SUPPORT_SETTINGS_DEFAULT_ADMINISTRATORS_GUIDE_LINK = "https://about.mattermost.com/administrators-guide/" - SUPPORT_SETTINGS_DEFAULT_TROUBLESHOOTING_FORUM_LINK = "https://about.mattermost.com/troubleshooting-forum/" - SUPPORT_SETTINGS_DEFAULT_COMMERCIAL_SUPPORT_LINK = "https://about.mattermost.com/commercial-support/" - SUPPORT_SETTINGS_DEFAULT_SUPPORT_EMAIL = "feedback@mattermost.com" - - LDAP_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_ID_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_POSITION_ATTRIBUTE = "" - LDAP_SETTINGS_DEFAULT_LOGIN_FIELD_NAME = "" - - SAML_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE = "" - SAML_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE = "" - SAML_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE = "" - SAML_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE = "" - SAML_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE = "" - SAML_SETTINGS_DEFAULT_LOCALE_ATTRIBUTE = "" - SAML_SETTINGS_DEFAULT_POSITION_ATTRIBUTE = "" - - NATIVEAPP_SETTINGS_DEFAULT_APP_DOWNLOAD_LINK = "https://about.mattermost.com/downloads/" - NATIVEAPP_SETTINGS_DEFAULT_ANDROID_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-android-app/" - NATIVEAPP_SETTINGS_DEFAULT_IOS_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-ios-app/" - - WEBRTC_SETTINGS_DEFAULT_STUN_URI = "" - WEBRTC_SETTINGS_DEFAULT_TURN_URI = "" - - ANALYTICS_SETTINGS_DEFAULT_MAX_USERS_FOR_STATISTICS = 2500 - - ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_COLOR = "#f2a93b" - ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_TEXT_COLOR = "#333333" - - TEAM_SETTINGS_DEFAULT_TEAM_TEXT = "default" - - ELASTICSEARCH_SETTINGS_DEFAULT_CONNECTION_URL = "" - ELASTICSEARCH_SETTINGS_DEFAULT_USERNAME = "" - ELASTICSEARCH_SETTINGS_DEFAULT_PASSWORD = "" - ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_REPLICAS = 1 - ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_SHARDS = 1 - ELASTICSEARCH_SETTINGS_DEFAULT_AGGREGATE_POSTS_AFTER_DAYS = 365 - ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME = "03:00" - ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX = "" - ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE = 1 - ELASTICSEARCH_SETTINGS_DEFAULT_BULK_INDEXING_TIME_WINDOW_SECONDS = 3600 - ELASTICSEARCH_SETTINGS_DEFAULT_REQUEST_TIMEOUT_SECONDS = 30 - - DATA_RETENTION_SETTINGS_DEFAULT_MESSAGE_RETENTION_DAYS = 365 - DATA_RETENTION_SETTINGS_DEFAULT_FILE_RETENTION_DAYS = 365 - DATA_RETENTION_SETTINGS_DEFAULT_DELETION_JOB_START_TIME = "02:00" - - PLUGIN_SETTINGS_DEFAULT_DIRECTORY = "./plugins" - PLUGIN_SETTINGS_DEFAULT_CLIENT_DIRECTORY = "./client/plugins" - - COMPLIANCE_EXPORT_TYPE_ACTIANCE = "actiance" - COMPLIANCE_EXPORT_TYPE_GLOBALRELAY = "globalrelay" -) - -type ServiceSettings struct { - SiteURL *string - LicenseFileLocation *string - ListenAddress *string - ConnectionSecurity *string - TLSCertFile *string - TLSKeyFile *string - UseLetsEncrypt *bool - LetsEncryptCertificateCacheFile *string - Forward80To443 *bool - ReadTimeout *int - WriteTimeout *int - MaximumLoginAttempts *int - GoroutineHealthThreshold *int - GoogleDeveloperKey string - EnableOAuthServiceProvider bool - EnableIncomingWebhooks bool - EnableOutgoingWebhooks bool - EnableCommands *bool - EnableOnlyAdminIntegrations *bool - EnablePostUsernameOverride bool - EnablePostIconOverride bool - EnableAPIv3 *bool - EnableLinkPreviews *bool - EnableTesting bool - EnableDeveloper *bool - EnableSecurityFixAlert *bool - EnableInsecureOutgoingConnections *bool - AllowedUntrustedInternalConnections *string - EnableMultifactorAuthentication *bool - EnforceMultifactorAuthentication *bool - EnableUserAccessTokens *bool - AllowCorsFrom *string - SessionLengthWebInDays *int - SessionLengthMobileInDays *int - SessionLengthSSOInDays *int - SessionCacheInMinutes *int - SessionIdleTimeoutInMinutes *int - WebsocketSecurePort *int - WebsocketPort *int - WebserverMode *string - EnableCustomEmoji *bool - EnableEmojiPicker *bool - RestrictCustomEmojiCreation *string - RestrictPostDelete *string - AllowEditPost *string - PostEditTimeLimit *int - TimeBetweenUserTypingUpdatesMilliseconds *int64 - EnablePostSearch *bool - EnableUserTypingMessages *bool - EnableChannelViewedMessages *bool - EnableUserStatuses *bool - ExperimentalEnableAuthenticationTransfer *bool - ClusterLogTimeoutMilliseconds *int - CloseUnusedDirectMessages *bool - EnablePreviewFeatures *bool - EnableTutorial *bool - ExperimentalEnableDefaultChannelLeaveJoinMessages *bool - ExperimentalGroupUnreadChannels *string - ImageProxyType *string - ImageProxyURL *string - ImageProxyOptions *string -} - -func (s *ServiceSettings) SetDefaults() { - if s.SiteURL == nil { - s.SiteURL = NewString(SERVICE_SETTINGS_DEFAULT_SITE_URL) - } - - if s.LicenseFileLocation == nil { - s.LicenseFileLocation = NewString("") - } - - if s.ListenAddress == nil { - s.ListenAddress = NewString(SERVICE_SETTINGS_DEFAULT_LISTEN_AND_ADDRESS) - } - - if s.EnableAPIv3 == nil { - s.EnableAPIv3 = NewBool(true) - } - - if s.EnableLinkPreviews == nil { - s.EnableLinkPreviews = NewBool(false) - } - - if s.EnableDeveloper == nil { - s.EnableDeveloper = NewBool(false) - } - - if s.EnableSecurityFixAlert == nil { - s.EnableSecurityFixAlert = NewBool(true) - } - - if s.EnableInsecureOutgoingConnections == nil { - s.EnableInsecureOutgoingConnections = NewBool(false) - } - - if s.AllowedUntrustedInternalConnections == nil { - s.AllowedUntrustedInternalConnections = NewString("") - } - - if s.EnableMultifactorAuthentication == nil { - s.EnableMultifactorAuthentication = NewBool(false) - } - - if s.EnforceMultifactorAuthentication == nil { - s.EnforceMultifactorAuthentication = NewBool(false) - } - - if s.EnableUserAccessTokens == nil { - s.EnableUserAccessTokens = NewBool(false) - } - - if s.GoroutineHealthThreshold == nil { - s.GoroutineHealthThreshold = NewInt(-1) - } - - if s.ConnectionSecurity == nil { - s.ConnectionSecurity = NewString("") - } - - if s.TLSKeyFile == nil { - s.TLSKeyFile = NewString(SERVICE_SETTINGS_DEFAULT_TLS_KEY_FILE) - } - - if s.TLSCertFile == nil { - s.TLSCertFile = NewString(SERVICE_SETTINGS_DEFAULT_TLS_CERT_FILE) - } - - if s.UseLetsEncrypt == nil { - s.UseLetsEncrypt = NewBool(false) - } - - if s.LetsEncryptCertificateCacheFile == nil { - s.LetsEncryptCertificateCacheFile = NewString("./config/letsencrypt.cache") - } - - if s.ReadTimeout == nil { - s.ReadTimeout = NewInt(SERVICE_SETTINGS_DEFAULT_READ_TIMEOUT) - } - - if s.WriteTimeout == nil { - s.WriteTimeout = NewInt(SERVICE_SETTINGS_DEFAULT_WRITE_TIMEOUT) - } - - if s.MaximumLoginAttempts == nil { - s.MaximumLoginAttempts = NewInt(SERVICE_SETTINGS_DEFAULT_MAX_LOGIN_ATTEMPTS) - } - - if s.Forward80To443 == nil { - s.Forward80To443 = NewBool(false) - } - - if s.TimeBetweenUserTypingUpdatesMilliseconds == nil { - s.TimeBetweenUserTypingUpdatesMilliseconds = NewInt64(5000) - } - - if s.EnablePostSearch == nil { - s.EnablePostSearch = NewBool(true) - } - - if s.EnableUserTypingMessages == nil { - s.EnableUserTypingMessages = NewBool(true) - } - - if s.EnableChannelViewedMessages == nil { - s.EnableChannelViewedMessages = NewBool(true) - } - - if s.EnableUserStatuses == nil { - s.EnableUserStatuses = NewBool(true) - } - - if s.ClusterLogTimeoutMilliseconds == nil { - s.ClusterLogTimeoutMilliseconds = NewInt(2000) - } - - if s.CloseUnusedDirectMessages == nil { - s.CloseUnusedDirectMessages = NewBool(false) - } - - if s.EnableTutorial == nil { - s.EnableTutorial = NewBool(true) - } - - if s.SessionLengthWebInDays == nil { - s.SessionLengthWebInDays = NewInt(30) - } - - if s.SessionLengthMobileInDays == nil { - s.SessionLengthMobileInDays = NewInt(30) - } - - if s.SessionLengthSSOInDays == nil { - s.SessionLengthSSOInDays = NewInt(30) - } - - if s.SessionCacheInMinutes == nil { - s.SessionCacheInMinutes = NewInt(10) - } - - if s.SessionIdleTimeoutInMinutes == nil { - s.SessionIdleTimeoutInMinutes = NewInt(0) - } - - if s.EnableCommands == nil { - s.EnableCommands = NewBool(false) - } - - if s.EnableOnlyAdminIntegrations == nil { - s.EnableOnlyAdminIntegrations = NewBool(true) - } - - if s.WebsocketPort == nil { - s.WebsocketPort = NewInt(80) - } - - if s.WebsocketSecurePort == nil { - s.WebsocketSecurePort = NewInt(443) - } - - if s.AllowCorsFrom == nil { - s.AllowCorsFrom = NewString(SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM) - } - - if s.WebserverMode == nil { - s.WebserverMode = NewString("gzip") - } else if *s.WebserverMode == "regular" { - *s.WebserverMode = "gzip" - } - - if s.EnableCustomEmoji == nil { - s.EnableCustomEmoji = NewBool(false) - } - - if s.EnableEmojiPicker == nil { - s.EnableEmojiPicker = NewBool(true) - } - - if s.RestrictCustomEmojiCreation == nil { - s.RestrictCustomEmojiCreation = NewString(RESTRICT_EMOJI_CREATION_ALL) - } - - if s.RestrictPostDelete == nil { - s.RestrictPostDelete = NewString(PERMISSIONS_DELETE_POST_ALL) - } - - if s.AllowEditPost == nil { - s.AllowEditPost = NewString(ALLOW_EDIT_POST_ALWAYS) - } - - if s.ExperimentalEnableAuthenticationTransfer == nil { - s.ExperimentalEnableAuthenticationTransfer = NewBool(true) - } - - if s.PostEditTimeLimit == nil { - s.PostEditTimeLimit = NewInt(300) - } - - if s.EnablePreviewFeatures == nil { - s.EnablePreviewFeatures = NewBool(true) - } - - if s.ExperimentalEnableDefaultChannelLeaveJoinMessages == nil { - s.ExperimentalEnableDefaultChannelLeaveJoinMessages = NewBool(true) - } - - if s.ExperimentalGroupUnreadChannels == nil { - s.ExperimentalGroupUnreadChannels = NewString(GROUP_UNREAD_CHANNELS_DISABLED) - } else if *s.ExperimentalGroupUnreadChannels == "0" { - s.ExperimentalGroupUnreadChannels = NewString(GROUP_UNREAD_CHANNELS_DISABLED) - } else if *s.ExperimentalGroupUnreadChannels == "1" { - s.ExperimentalGroupUnreadChannels = NewString(GROUP_UNREAD_CHANNELS_DEFAULT_ON) - } - - if s.ImageProxyType == nil { - s.ImageProxyType = NewString("") - } - - if s.ImageProxyURL == nil { - s.ImageProxyURL = NewString("") - } - - if s.ImageProxyOptions == nil { - s.ImageProxyOptions = NewString("") - } -} - -type ClusterSettings struct { - Enable *bool - ClusterName *string - OverrideHostname *string - UseIpAddress *bool - UseExperimentalGossip *bool - ReadOnlyConfig *bool - GossipPort *int - StreamingPort *int -} - -func (s *ClusterSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.ClusterName == nil { - s.ClusterName = NewString("") - } - - if s.OverrideHostname == nil { - s.OverrideHostname = NewString("") - } - - if s.UseIpAddress == nil { - s.UseIpAddress = NewBool(true) - } - - if s.UseExperimentalGossip == nil { - s.UseExperimentalGossip = NewBool(false) - } - - if s.ReadOnlyConfig == nil { - s.ReadOnlyConfig = NewBool(true) - } - - if s.GossipPort == nil { - s.GossipPort = NewInt(8074) - } - - if s.StreamingPort == nil { - s.StreamingPort = NewInt(8075) - } -} - -type MetricsSettings struct { - Enable *bool - BlockProfileRate *int - ListenAddress *string -} - -func (s *MetricsSettings) SetDefaults() { - if s.ListenAddress == nil { - s.ListenAddress = NewString(":8067") - } - - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.BlockProfileRate == nil { - s.BlockProfileRate = NewInt(0) - } -} - -type AnalyticsSettings struct { - MaxUsersForStatistics *int -} - -func (s *AnalyticsSettings) SetDefaults() { - if s.MaxUsersForStatistics == nil { - s.MaxUsersForStatistics = NewInt(ANALYTICS_SETTINGS_DEFAULT_MAX_USERS_FOR_STATISTICS) - } -} - -type SSOSettings struct { - Enable bool - Secret string - Id string - Scope string - AuthEndpoint string - TokenEndpoint string - UserApiEndpoint string -} - -type SqlSettings struct { - DriverName *string - DataSource *string - DataSourceReplicas []string - DataSourceSearchReplicas []string - MaxIdleConns *int - MaxOpenConns *int - Trace bool - AtRestEncryptKey string - QueryTimeout *int -} - -func (s *SqlSettings) SetDefaults() { - if s.DriverName == nil { - s.DriverName = NewString(DATABASE_DRIVER_MYSQL) - } - - if s.DataSource == nil { - s.DataSource = NewString(SQL_SETTINGS_DEFAULT_DATA_SOURCE) - } - - if len(s.AtRestEncryptKey) == 0 { - s.AtRestEncryptKey = NewRandomString(32) - } - - if s.MaxIdleConns == nil { - s.MaxIdleConns = NewInt(20) - } - - if s.MaxOpenConns == nil { - s.MaxOpenConns = NewInt(300) - } - - if s.QueryTimeout == nil { - s.QueryTimeout = NewInt(30) - } -} - -type LogSettings struct { - EnableConsole bool - ConsoleLevel string - EnableFile bool - FileLevel string - FileFormat string - FileLocation string - EnableWebhookDebugging bool - EnableDiagnostics *bool -} - -func (s *LogSettings) SetDefaults() { - if s.EnableDiagnostics == nil { - s.EnableDiagnostics = NewBool(true) - } -} - -type PasswordSettings struct { - MinimumLength *int - Lowercase *bool - Number *bool - Uppercase *bool - Symbol *bool -} - -func (s *PasswordSettings) SetDefaults() { - if s.MinimumLength == nil { - s.MinimumLength = NewInt(PASSWORD_MINIMUM_LENGTH) - } - - if s.Lowercase == nil { - s.Lowercase = NewBool(false) - } - - if s.Number == nil { - s.Number = NewBool(false) - } - - if s.Uppercase == nil { - s.Uppercase = NewBool(false) - } - - if s.Symbol == nil { - s.Symbol = NewBool(false) - } -} - -type FileSettings struct { - EnableFileAttachments *bool - EnableMobileUpload *bool - EnableMobileDownload *bool - MaxFileSize *int64 - DriverName *string - Directory string - EnablePublicLink bool - PublicLinkSalt *string - InitialFont string - AmazonS3AccessKeyId string - AmazonS3SecretAccessKey string - AmazonS3Bucket string - AmazonS3Region string - AmazonS3Endpoint string - AmazonS3SSL *bool - AmazonS3SignV2 *bool - AmazonS3SSE *bool - AmazonS3Trace *bool -} - -func (s *FileSettings) SetDefaults() { - if s.DriverName == nil { - s.DriverName = NewString(IMAGE_DRIVER_LOCAL) - } - - if s.AmazonS3Endpoint == "" { - // Defaults to "s3.amazonaws.com" - s.AmazonS3Endpoint = "s3.amazonaws.com" - } - - if s.AmazonS3SSL == nil { - s.AmazonS3SSL = NewBool(true) // Secure by default. - } - - if s.AmazonS3SignV2 == nil { - s.AmazonS3SignV2 = new(bool) - // Signature v2 is not enabled by default. - } - - if s.AmazonS3SSE == nil { - s.AmazonS3SSE = NewBool(false) // Not Encrypted by default. - } - - if s.AmazonS3Trace == nil { - s.AmazonS3Trace = NewBool(false) - } - - if s.EnableFileAttachments == nil { - s.EnableFileAttachments = NewBool(true) - } - - if s.EnableMobileUpload == nil { - s.EnableMobileUpload = NewBool(true) - } - - if s.EnableMobileDownload == nil { - s.EnableMobileDownload = NewBool(true) - } - - if s.MaxFileSize == nil { - s.MaxFileSize = NewInt64(52428800) // 50 MB - } - - if s.PublicLinkSalt == nil || len(*s.PublicLinkSalt) == 0 { - s.PublicLinkSalt = NewString(NewRandomString(32)) - } - - if s.InitialFont == "" { - // Defaults to "luximbi.ttf" - s.InitialFont = "luximbi.ttf" - } - - if s.Directory == "" { - s.Directory = "./data/" - } -} - -type EmailSettings struct { - EnableSignUpWithEmail bool - EnableSignInWithEmail *bool - EnableSignInWithUsername *bool - SendEmailNotifications bool - UseChannelInEmailNotifications *bool - RequireEmailVerification bool - FeedbackName string - FeedbackEmail string - FeedbackOrganization *string - EnableSMTPAuth *bool - SMTPUsername string - SMTPPassword string - SMTPServer string - SMTPPort string - ConnectionSecurity string - InviteSalt string - SendPushNotifications *bool - PushNotificationServer *string - PushNotificationContents *string - EnableEmailBatching *bool - EmailBatchingBufferSize *int - EmailBatchingInterval *int - SkipServerCertificateVerification *bool - EmailNotificationContentsType *string - LoginButtonColor *string - LoginButtonBorderColor *string - LoginButtonTextColor *string -} - -func (s *EmailSettings) SetDefaults() { - if len(s.InviteSalt) == 0 { - s.InviteSalt = NewRandomString(32) - } - - if s.EnableSignInWithEmail == nil { - s.EnableSignInWithEmail = NewBool(s.EnableSignUpWithEmail) - } - - if s.EnableSignInWithUsername == nil { - s.EnableSignInWithUsername = NewBool(false) - } - - if s.UseChannelInEmailNotifications == nil { - s.UseChannelInEmailNotifications = NewBool(false) - } - - if s.SendPushNotifications == nil { - s.SendPushNotifications = NewBool(false) - } - - if s.PushNotificationServer == nil { - s.PushNotificationServer = NewString("") - } - - if s.PushNotificationContents == nil { - s.PushNotificationContents = NewString(GENERIC_NOTIFICATION) - } - - if s.FeedbackOrganization == nil { - s.FeedbackOrganization = NewString(EMAIL_SETTINGS_DEFAULT_FEEDBACK_ORGANIZATION) - } - - if s.EnableEmailBatching == nil { - s.EnableEmailBatching = NewBool(false) - } - - if s.EmailBatchingBufferSize == nil { - s.EmailBatchingBufferSize = NewInt(EMAIL_BATCHING_BUFFER_SIZE) - } - - if s.EmailBatchingInterval == nil { - s.EmailBatchingInterval = NewInt(EMAIL_BATCHING_INTERVAL) - } - - if s.EnableSMTPAuth == nil { - s.EnableSMTPAuth = new(bool) - if s.ConnectionSecurity == CONN_SECURITY_NONE { - *s.EnableSMTPAuth = false - } else { - *s.EnableSMTPAuth = true - } - } - - if s.ConnectionSecurity == CONN_SECURITY_PLAIN { - s.ConnectionSecurity = CONN_SECURITY_NONE - } - - if s.SkipServerCertificateVerification == nil { - s.SkipServerCertificateVerification = NewBool(false) - } - - if s.EmailNotificationContentsType == nil { - s.EmailNotificationContentsType = NewString(EMAIL_NOTIFICATION_CONTENTS_FULL) - } - - if s.LoginButtonColor == nil { - s.LoginButtonColor = NewString("#0000") - } - - if s.LoginButtonBorderColor == nil { - s.LoginButtonBorderColor = NewString("#2389D7") - } - - if s.LoginButtonTextColor == nil { - s.LoginButtonTextColor = NewString("#2389D7") - } -} - -type RateLimitSettings struct { - Enable *bool - PerSec *int - MaxBurst *int - MemoryStoreSize *int - VaryByRemoteAddr *bool - VaryByUser *bool - VaryByHeader string -} - -func (s *RateLimitSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.PerSec == nil { - s.PerSec = NewInt(10) - } - - if s.MaxBurst == nil { - s.MaxBurst = NewInt(100) - } - - if s.MemoryStoreSize == nil { - s.MemoryStoreSize = NewInt(10000) - } - - if s.VaryByRemoteAddr == nil { - s.VaryByRemoteAddr = NewBool(true) - } - - if s.VaryByUser == nil { - s.VaryByUser = NewBool(false) - } -} - -type PrivacySettings struct { - ShowEmailAddress bool - ShowFullName bool -} - -type SupportSettings struct { - TermsOfServiceLink *string - PrivacyPolicyLink *string - AboutLink *string - HelpLink *string - ReportAProblemLink *string - SupportEmail *string -} - -func (s *SupportSettings) SetDefaults() { - if !IsSafeLink(s.TermsOfServiceLink) { - *s.TermsOfServiceLink = SUPPORT_SETTINGS_DEFAULT_TERMS_OF_SERVICE_LINK - } - - if s.TermsOfServiceLink == nil { - s.TermsOfServiceLink = NewString(SUPPORT_SETTINGS_DEFAULT_TERMS_OF_SERVICE_LINK) - } - - if !IsSafeLink(s.PrivacyPolicyLink) { - *s.PrivacyPolicyLink = "" - } - - if s.PrivacyPolicyLink == nil { - s.PrivacyPolicyLink = NewString(SUPPORT_SETTINGS_DEFAULT_PRIVACY_POLICY_LINK) - } - - if !IsSafeLink(s.AboutLink) { - *s.AboutLink = "" - } - - if s.AboutLink == nil { - s.AboutLink = NewString(SUPPORT_SETTINGS_DEFAULT_ABOUT_LINK) - } - - if !IsSafeLink(s.HelpLink) { - *s.HelpLink = "" - } - - if s.HelpLink == nil { - s.HelpLink = NewString(SUPPORT_SETTINGS_DEFAULT_HELP_LINK) - } - - if !IsSafeLink(s.ReportAProblemLink) { - *s.ReportAProblemLink = "" - } - - if s.ReportAProblemLink == nil { - s.ReportAProblemLink = NewString(SUPPORT_SETTINGS_DEFAULT_REPORT_A_PROBLEM_LINK) - } - - if s.SupportEmail == nil { - s.SupportEmail = NewString(SUPPORT_SETTINGS_DEFAULT_SUPPORT_EMAIL) - } -} - -type AnnouncementSettings struct { - EnableBanner *bool - BannerText *string - BannerColor *string - BannerTextColor *string - AllowBannerDismissal *bool -} - -func (s *AnnouncementSettings) SetDefaults() { - if s.EnableBanner == nil { - s.EnableBanner = NewBool(false) - } - - if s.BannerText == nil { - s.BannerText = NewString("") - } - - if s.BannerColor == nil { - s.BannerColor = NewString(ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_COLOR) - } - - if s.BannerTextColor == nil { - s.BannerTextColor = NewString(ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_TEXT_COLOR) - } - - if s.AllowBannerDismissal == nil { - s.AllowBannerDismissal = NewBool(true) - } -} - -type ThemeSettings struct { - EnableThemeSelection *bool - DefaultTheme *string - AllowCustomThemes *bool - AllowedThemes []string -} - -func (s *ThemeSettings) SetDefaults() { - if s.EnableThemeSelection == nil { - s.EnableThemeSelection = NewBool(true) - } - - if s.DefaultTheme == nil { - s.DefaultTheme = NewString(TEAM_SETTINGS_DEFAULT_TEAM_TEXT) - } - - if s.AllowCustomThemes == nil { - s.AllowCustomThemes = NewBool(true) - } - - if s.AllowedThemes == nil { - s.AllowedThemes = []string{} - } -} - -type TeamSettings struct { - SiteName string - MaxUsersPerTeam *int - EnableTeamCreation bool - EnableUserCreation bool - EnableOpenServer *bool - RestrictCreationToDomains string - EnableCustomBrand *bool - CustomBrandText *string - CustomDescriptionText *string - RestrictDirectMessage *string - RestrictTeamInvite *string - RestrictPublicChannelManagement *string - RestrictPrivateChannelManagement *string - RestrictPublicChannelCreation *string - RestrictPrivateChannelCreation *string - RestrictPublicChannelDeletion *string - RestrictPrivateChannelDeletion *string - RestrictPrivateChannelManageMembers *string - EnableXToLeaveChannelsFromLHS *bool - UserStatusAwayTimeout *int64 - MaxChannelsPerTeam *int64 - MaxNotificationsPerChannel *int64 - EnableConfirmNotificationsToChannel *bool - TeammateNameDisplay *string - ExperimentalTownSquareIsReadOnly *bool - ExperimentalPrimaryTeam *string -} - -func (s *TeamSettings) SetDefaults() { - if s.MaxUsersPerTeam == nil { - s.MaxUsersPerTeam = NewInt(TEAM_SETTINGS_DEFAULT_MAX_USERS_PER_TEAM) - } - - if s.EnableCustomBrand == nil { - s.EnableCustomBrand = NewBool(false) - } - - if s.CustomBrandText == nil { - s.CustomBrandText = NewString(TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT) - } - - if s.CustomDescriptionText == nil { - s.CustomDescriptionText = NewString(TEAM_SETTINGS_DEFAULT_CUSTOM_DESCRIPTION_TEXT) - } - - if s.EnableOpenServer == nil { - s.EnableOpenServer = NewBool(false) - } - - if s.RestrictDirectMessage == nil { - s.RestrictDirectMessage = NewString(DIRECT_MESSAGE_ANY) - } - - if s.RestrictTeamInvite == nil { - s.RestrictTeamInvite = NewString(PERMISSIONS_ALL) - } - - if s.RestrictPublicChannelManagement == nil { - s.RestrictPublicChannelManagement = NewString(PERMISSIONS_ALL) - } - - if s.RestrictPrivateChannelManagement == nil { - s.RestrictPrivateChannelManagement = NewString(PERMISSIONS_ALL) - } - - if s.RestrictPublicChannelCreation == nil { - s.RestrictPublicChannelCreation = new(string) - // If this setting does not exist, assume migration from <3.6, so use management setting as default. - if *s.RestrictPublicChannelManagement == PERMISSIONS_CHANNEL_ADMIN { - *s.RestrictPublicChannelCreation = PERMISSIONS_TEAM_ADMIN - } else { - *s.RestrictPublicChannelCreation = *s.RestrictPublicChannelManagement - } - } - - if s.RestrictPrivateChannelCreation == nil { - // If this setting does not exist, assume migration from <3.6, so use management setting as default. - if *s.RestrictPrivateChannelManagement == PERMISSIONS_CHANNEL_ADMIN { - s.RestrictPrivateChannelCreation = NewString(PERMISSIONS_TEAM_ADMIN) - } else { - s.RestrictPrivateChannelCreation = NewString(*s.RestrictPrivateChannelManagement) - } - } - - if s.RestrictPublicChannelDeletion == nil { - // If this setting does not exist, assume migration from <3.6, so use management setting as default. - s.RestrictPublicChannelDeletion = NewString(*s.RestrictPublicChannelManagement) - } - - if s.RestrictPrivateChannelDeletion == nil { - // If this setting does not exist, assume migration from <3.6, so use management setting as default. - s.RestrictPrivateChannelDeletion = NewString(*s.RestrictPrivateChannelManagement) - } - - if s.RestrictPrivateChannelManageMembers == nil { - s.RestrictPrivateChannelManageMembers = NewString(PERMISSIONS_ALL) - } - - if s.EnableXToLeaveChannelsFromLHS == nil { - s.EnableXToLeaveChannelsFromLHS = NewBool(false) - } - - if s.UserStatusAwayTimeout == nil { - s.UserStatusAwayTimeout = NewInt64(TEAM_SETTINGS_DEFAULT_USER_STATUS_AWAY_TIMEOUT) - } - - if s.MaxChannelsPerTeam == nil { - s.MaxChannelsPerTeam = NewInt64(2000) - } - - if s.MaxNotificationsPerChannel == nil { - s.MaxNotificationsPerChannel = NewInt64(1000) - } - - if s.EnableConfirmNotificationsToChannel == nil { - s.EnableConfirmNotificationsToChannel = NewBool(true) - } - - if s.ExperimentalTownSquareIsReadOnly == nil { - s.ExperimentalTownSquareIsReadOnly = NewBool(false) - } - - if s.ExperimentalPrimaryTeam == nil { - s.ExperimentalPrimaryTeam = NewString("") - } -} - -type ClientRequirements struct { - AndroidLatestVersion string - AndroidMinVersion string - DesktopLatestVersion string - DesktopMinVersion string - IosLatestVersion string - IosMinVersion string -} - -type LdapSettings struct { - // Basic - Enable *bool - EnableSync *bool - LdapServer *string - LdapPort *int - ConnectionSecurity *string - BaseDN *string - BindUsername *string - BindPassword *string - - // Filtering - UserFilter *string - - // User Mapping - FirstNameAttribute *string - LastNameAttribute *string - EmailAttribute *string - UsernameAttribute *string - NicknameAttribute *string - IdAttribute *string - PositionAttribute *string - - // Syncronization - SyncIntervalMinutes *int - - // Advanced - SkipCertificateVerification *bool - QueryTimeout *int - MaxPageSize *int - - // Customization - LoginFieldName *string - - LoginButtonColor *string - LoginButtonBorderColor *string - LoginButtonTextColor *string -} - -func (s *LdapSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - // When unset should default to LDAP Enabled - if s.EnableSync == nil { - s.EnableSync = NewBool(*s.Enable) - } - - if s.LdapServer == nil { - s.LdapServer = NewString("") - } - - if s.LdapPort == nil { - s.LdapPort = NewInt(389) - } - - if s.ConnectionSecurity == nil { - s.ConnectionSecurity = NewString("") - } - - if s.BaseDN == nil { - s.BaseDN = NewString("") - } - - if s.BindUsername == nil { - s.BindUsername = NewString("") - } - - if s.BindPassword == nil { - s.BindPassword = NewString("") - } - - if s.UserFilter == nil { - s.UserFilter = NewString("") - } - - if s.FirstNameAttribute == nil { - s.FirstNameAttribute = NewString(LDAP_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE) - } - - if s.LastNameAttribute == nil { - s.LastNameAttribute = NewString(LDAP_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE) - } - - if s.EmailAttribute == nil { - s.EmailAttribute = NewString(LDAP_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE) - } - - if s.UsernameAttribute == nil { - s.UsernameAttribute = NewString(LDAP_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE) - } - - if s.NicknameAttribute == nil { - s.NicknameAttribute = NewString(LDAP_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE) - } - - if s.IdAttribute == nil { - s.IdAttribute = NewString(LDAP_SETTINGS_DEFAULT_ID_ATTRIBUTE) - } - - if s.PositionAttribute == nil { - s.PositionAttribute = NewString(LDAP_SETTINGS_DEFAULT_POSITION_ATTRIBUTE) - } - - if s.SyncIntervalMinutes == nil { - s.SyncIntervalMinutes = NewInt(60) - } - - if s.SkipCertificateVerification == nil { - s.SkipCertificateVerification = NewBool(false) - } - - if s.QueryTimeout == nil { - s.QueryTimeout = NewInt(60) - } - - if s.MaxPageSize == nil { - s.MaxPageSize = NewInt(0) - } - - if s.LoginFieldName == nil { - s.LoginFieldName = NewString(LDAP_SETTINGS_DEFAULT_LOGIN_FIELD_NAME) - } - - if s.LoginButtonColor == nil { - s.LoginButtonColor = NewString("#0000") - } - - if s.LoginButtonBorderColor == nil { - s.LoginButtonBorderColor = NewString("#2389D7") - } - - if s.LoginButtonTextColor == nil { - s.LoginButtonTextColor = NewString("#2389D7") - } -} - -type ComplianceSettings struct { - Enable *bool - Directory *string - EnableDaily *bool -} - -func (s *ComplianceSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.Directory == nil { - s.Directory = NewString("./data/") - } - - if s.EnableDaily == nil { - s.EnableDaily = NewBool(false) - } -} - -type LocalizationSettings struct { - DefaultServerLocale *string - DefaultClientLocale *string - AvailableLocales *string -} - -func (s *LocalizationSettings) SetDefaults() { - if s.DefaultServerLocale == nil { - s.DefaultServerLocale = NewString(DEFAULT_LOCALE) - } - - if s.DefaultClientLocale == nil { - s.DefaultClientLocale = NewString(DEFAULT_LOCALE) - } - - if s.AvailableLocales == nil { - s.AvailableLocales = NewString("") - } -} - -type SamlSettings struct { - // Basic - Enable *bool - EnableSyncWithLdap *bool - - Verify *bool - Encrypt *bool - - IdpUrl *string - IdpDescriptorUrl *string - AssertionConsumerServiceURL *string - - IdpCertificateFile *string - PublicCertificateFile *string - PrivateKeyFile *string - - // User Mapping - FirstNameAttribute *string - LastNameAttribute *string - EmailAttribute *string - UsernameAttribute *string - NicknameAttribute *string - LocaleAttribute *string - PositionAttribute *string - - LoginButtonText *string - - LoginButtonColor *string - LoginButtonBorderColor *string - LoginButtonTextColor *string -} - -func (s *SamlSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.EnableSyncWithLdap == nil { - s.EnableSyncWithLdap = NewBool(false) - } - - if s.Verify == nil { - s.Verify = NewBool(true) - } - - if s.Encrypt == nil { - s.Encrypt = NewBool(true) - } - - if s.IdpUrl == nil { - s.IdpUrl = NewString("") - } - - if s.IdpDescriptorUrl == nil { - s.IdpDescriptorUrl = NewString("") - } - - if s.IdpCertificateFile == nil { - s.IdpCertificateFile = NewString("") - } - - if s.PublicCertificateFile == nil { - s.PublicCertificateFile = NewString("") - } - - if s.PrivateKeyFile == nil { - s.PrivateKeyFile = NewString("") - } - - if s.AssertionConsumerServiceURL == nil { - s.AssertionConsumerServiceURL = NewString("") - } - - if s.LoginButtonText == nil || *s.LoginButtonText == "" { - s.LoginButtonText = NewString(USER_AUTH_SERVICE_SAML_TEXT) - } - - if s.FirstNameAttribute == nil { - s.FirstNameAttribute = NewString(SAML_SETTINGS_DEFAULT_FIRST_NAME_ATTRIBUTE) - } - - if s.LastNameAttribute == nil { - s.LastNameAttribute = NewString(SAML_SETTINGS_DEFAULT_LAST_NAME_ATTRIBUTE) - } - - if s.EmailAttribute == nil { - s.EmailAttribute = NewString(SAML_SETTINGS_DEFAULT_EMAIL_ATTRIBUTE) - } - - if s.UsernameAttribute == nil { - s.UsernameAttribute = NewString(SAML_SETTINGS_DEFAULT_USERNAME_ATTRIBUTE) - } - - if s.NicknameAttribute == nil { - s.NicknameAttribute = NewString(SAML_SETTINGS_DEFAULT_NICKNAME_ATTRIBUTE) - } - - if s.PositionAttribute == nil { - s.PositionAttribute = NewString(SAML_SETTINGS_DEFAULT_POSITION_ATTRIBUTE) - } - - if s.LocaleAttribute == nil { - s.LocaleAttribute = NewString(SAML_SETTINGS_DEFAULT_LOCALE_ATTRIBUTE) - } - - if s.LoginButtonColor == nil { - s.LoginButtonColor = NewString("#34a28b") - } - - if s.LoginButtonBorderColor == nil { - s.LoginButtonBorderColor = NewString("#2389D7") - } - - if s.LoginButtonTextColor == nil { - s.LoginButtonTextColor = NewString("#ffffff") - } -} - -type NativeAppSettings struct { - AppDownloadLink *string - AndroidAppDownloadLink *string - IosAppDownloadLink *string -} - -func (s *NativeAppSettings) SetDefaults() { - if s.AppDownloadLink == nil { - s.AppDownloadLink = NewString(NATIVEAPP_SETTINGS_DEFAULT_APP_DOWNLOAD_LINK) - } - - if s.AndroidAppDownloadLink == nil { - s.AndroidAppDownloadLink = NewString(NATIVEAPP_SETTINGS_DEFAULT_ANDROID_APP_DOWNLOAD_LINK) - } - - if s.IosAppDownloadLink == nil { - s.IosAppDownloadLink = NewString(NATIVEAPP_SETTINGS_DEFAULT_IOS_APP_DOWNLOAD_LINK) - } -} - -type WebrtcSettings struct { - Enable *bool - GatewayWebsocketUrl *string - GatewayAdminUrl *string - GatewayAdminSecret *string - StunURI *string - TurnURI *string - TurnUsername *string - TurnSharedKey *string -} - -func (s *WebrtcSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.GatewayWebsocketUrl == nil { - s.GatewayWebsocketUrl = NewString("") - } - - if s.GatewayAdminUrl == nil { - s.GatewayAdminUrl = NewString("") - } - - if s.GatewayAdminSecret == nil { - s.GatewayAdminSecret = NewString("") - } - - if s.StunURI == nil { - s.StunURI = NewString(WEBRTC_SETTINGS_DEFAULT_STUN_URI) - } - - if s.TurnURI == nil { - s.TurnURI = NewString(WEBRTC_SETTINGS_DEFAULT_TURN_URI) - } - - if s.TurnUsername == nil { - s.TurnUsername = NewString("") - } - - if s.TurnSharedKey == nil { - s.TurnSharedKey = NewString("") - } -} - -type ElasticsearchSettings struct { - ConnectionUrl *string - Username *string - Password *string - EnableIndexing *bool - EnableSearching *bool - Sniff *bool - PostIndexReplicas *int - PostIndexShards *int - AggregatePostsAfterDays *int - PostsAggregatorJobStartTime *string - IndexPrefix *string - LiveIndexingBatchSize *int - BulkIndexingTimeWindowSeconds *int - RequestTimeoutSeconds *int -} - -func (s *ElasticsearchSettings) SetDefaults() { - if s.ConnectionUrl == nil { - s.ConnectionUrl = NewString(ELASTICSEARCH_SETTINGS_DEFAULT_CONNECTION_URL) - } - - if s.Username == nil { - s.Username = NewString(ELASTICSEARCH_SETTINGS_DEFAULT_USERNAME) - } - - if s.Password == nil { - s.Password = NewString(ELASTICSEARCH_SETTINGS_DEFAULT_PASSWORD) - } - - if s.EnableIndexing == nil { - s.EnableIndexing = NewBool(false) - } - - if s.EnableSearching == nil { - s.EnableSearching = NewBool(false) - } - - if s.Sniff == nil { - s.Sniff = NewBool(true) - } - - if s.PostIndexReplicas == nil { - s.PostIndexReplicas = NewInt(ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_REPLICAS) - } - - if s.PostIndexShards == nil { - s.PostIndexShards = NewInt(ELASTICSEARCH_SETTINGS_DEFAULT_POST_INDEX_SHARDS) - } - - if s.AggregatePostsAfterDays == nil { - s.AggregatePostsAfterDays = NewInt(ELASTICSEARCH_SETTINGS_DEFAULT_AGGREGATE_POSTS_AFTER_DAYS) - } - - if s.PostsAggregatorJobStartTime == nil { - s.PostsAggregatorJobStartTime = NewString(ELASTICSEARCH_SETTINGS_DEFAULT_POSTS_AGGREGATOR_JOB_START_TIME) - } - - if s.IndexPrefix == nil { - s.IndexPrefix = NewString(ELASTICSEARCH_SETTINGS_DEFAULT_INDEX_PREFIX) - } - - if s.LiveIndexingBatchSize == nil { - s.LiveIndexingBatchSize = NewInt(ELASTICSEARCH_SETTINGS_DEFAULT_LIVE_INDEXING_BATCH_SIZE) - } - - if s.BulkIndexingTimeWindowSeconds == nil { - s.BulkIndexingTimeWindowSeconds = NewInt(ELASTICSEARCH_SETTINGS_DEFAULT_BULK_INDEXING_TIME_WINDOW_SECONDS) - } - - if s.RequestTimeoutSeconds == nil { - s.RequestTimeoutSeconds = NewInt(ELASTICSEARCH_SETTINGS_DEFAULT_REQUEST_TIMEOUT_SECONDS) - } -} - -type DataRetentionSettings struct { - EnableMessageDeletion *bool - EnableFileDeletion *bool - MessageRetentionDays *int - FileRetentionDays *int - DeletionJobStartTime *string -} - -func (s *DataRetentionSettings) SetDefaults() { - if s.EnableMessageDeletion == nil { - s.EnableMessageDeletion = NewBool(false) - } - - if s.EnableFileDeletion == nil { - s.EnableFileDeletion = NewBool(false) - } - - if s.MessageRetentionDays == nil { - s.MessageRetentionDays = NewInt(DATA_RETENTION_SETTINGS_DEFAULT_MESSAGE_RETENTION_DAYS) - } - - if s.FileRetentionDays == nil { - s.FileRetentionDays = NewInt(DATA_RETENTION_SETTINGS_DEFAULT_FILE_RETENTION_DAYS) - } - - if s.DeletionJobStartTime == nil { - s.DeletionJobStartTime = NewString(DATA_RETENTION_SETTINGS_DEFAULT_DELETION_JOB_START_TIME) - } -} - -type JobSettings struct { - RunJobs *bool - RunScheduler *bool -} - -func (s *JobSettings) SetDefaults() { - if s.RunJobs == nil { - s.RunJobs = NewBool(true) - } - - if s.RunScheduler == nil { - s.RunScheduler = NewBool(true) - } -} - -type PluginState struct { - Enable bool -} - -type PluginSettings struct { - Enable *bool - EnableUploads *bool - Directory *string - ClientDirectory *string - Plugins map[string]interface{} - PluginStates map[string]*PluginState -} - -func (s *PluginSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(true) - } - - if s.EnableUploads == nil { - s.EnableUploads = NewBool(false) - } - - if s.Directory == nil { - s.Directory = NewString(PLUGIN_SETTINGS_DEFAULT_DIRECTORY) - } - - if *s.Directory == "" { - *s.Directory = PLUGIN_SETTINGS_DEFAULT_DIRECTORY - } - - if s.ClientDirectory == nil { - s.ClientDirectory = NewString(PLUGIN_SETTINGS_DEFAULT_CLIENT_DIRECTORY) - } - - if *s.ClientDirectory == "" { - *s.ClientDirectory = PLUGIN_SETTINGS_DEFAULT_CLIENT_DIRECTORY - } - - if s.Plugins == nil { - s.Plugins = make(map[string]interface{}) - } - - if s.PluginStates == nil { - s.PluginStates = make(map[string]*PluginState) - } -} - -type MessageExportSettings struct { - EnableExport *bool - ExportFormat *string - DailyRunTime *string - ExportFromTimestamp *int64 - BatchSize *int - - // formatter-specific settings - these are only expected to be non-nil if ExportFormat is set to the associated format - GlobalRelayEmailAddress *string -} - -func (s *MessageExportSettings) SetDefaults() { - if s.EnableExport == nil { - s.EnableExport = NewBool(false) - } - - if s.ExportFormat == nil { - s.ExportFormat = NewString(COMPLIANCE_EXPORT_TYPE_ACTIANCE) - } - - if s.DailyRunTime == nil { - s.DailyRunTime = NewString("01:00") - } - - if s.ExportFromTimestamp == nil { - s.ExportFromTimestamp = NewInt64(0) - } - - if s.EnableExport != nil && *s.EnableExport && *s.ExportFromTimestamp == int64(0) { - // when the feature is enabled via the System Console, use the current timestamp as the start time for future exports - s.ExportFromTimestamp = NewInt64(GetMillis()) - } else if s.EnableExport != nil && !*s.EnableExport { - // when the feature is disabled, reset the timestamp so that the timestamp will be set if the feature is re-enabled - s.ExportFromTimestamp = NewInt64(0) - } - - if s.BatchSize == nil { - s.BatchSize = NewInt(10000) - } -} - -type ConfigFunc func() *Config - -type Config struct { - ServiceSettings ServiceSettings - TeamSettings TeamSettings - ClientRequirements ClientRequirements - SqlSettings SqlSettings - LogSettings LogSettings - PasswordSettings PasswordSettings - FileSettings FileSettings - EmailSettings EmailSettings - RateLimitSettings RateLimitSettings - PrivacySettings PrivacySettings - SupportSettings SupportSettings - AnnouncementSettings AnnouncementSettings - ThemeSettings ThemeSettings - GitLabSettings SSOSettings - GoogleSettings SSOSettings - Office365Settings SSOSettings - LdapSettings LdapSettings - ComplianceSettings ComplianceSettings - LocalizationSettings LocalizationSettings - SamlSettings SamlSettings - NativeAppSettings NativeAppSettings - ClusterSettings ClusterSettings - MetricsSettings MetricsSettings - AnalyticsSettings AnalyticsSettings - WebrtcSettings WebrtcSettings - ElasticsearchSettings ElasticsearchSettings - DataRetentionSettings DataRetentionSettings - MessageExportSettings MessageExportSettings - JobSettings JobSettings - PluginSettings PluginSettings -} - -func (o *Config) Clone() *Config { - var ret Config - if err := json.Unmarshal([]byte(o.ToJson()), &ret); err != nil { - panic(err) - } - return &ret -} - -func (o *Config) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func (o *Config) GetSSOService(service string) *SSOSettings { - switch service { - case SERVICE_GITLAB: - return &o.GitLabSettings - case SERVICE_GOOGLE: - return &o.GoogleSettings - case SERVICE_OFFICE365: - return &o.Office365Settings - } - - return nil -} - -func ConfigFromJson(data io.Reader) *Config { - var o *Config - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *Config) SetDefaults() { - o.LdapSettings.SetDefaults() - o.SamlSettings.SetDefaults() - - if o.TeamSettings.TeammateNameDisplay == nil { - o.TeamSettings.TeammateNameDisplay = NewString(SHOW_USERNAME) - - if *o.SamlSettings.Enable || *o.LdapSettings.Enable { - *o.TeamSettings.TeammateNameDisplay = SHOW_FULLNAME - } - } - - o.SqlSettings.SetDefaults() - o.FileSettings.SetDefaults() - o.EmailSettings.SetDefaults() - o.ServiceSettings.SetDefaults() - o.PasswordSettings.SetDefaults() - o.TeamSettings.SetDefaults() - o.MetricsSettings.SetDefaults() - o.SupportSettings.SetDefaults() - o.AnnouncementSettings.SetDefaults() - o.ThemeSettings.SetDefaults() - o.ClusterSettings.SetDefaults() - o.PluginSettings.SetDefaults() - o.AnalyticsSettings.SetDefaults() - o.ComplianceSettings.SetDefaults() - o.LocalizationSettings.SetDefaults() - o.ElasticsearchSettings.SetDefaults() - o.NativeAppSettings.SetDefaults() - o.DataRetentionSettings.SetDefaults() - o.RateLimitSettings.SetDefaults() - o.LogSettings.SetDefaults() - o.JobSettings.SetDefaults() - o.WebrtcSettings.SetDefaults() - o.MessageExportSettings.SetDefaults() -} - -func (o *Config) IsValid() *AppError { - if len(*o.ServiceSettings.SiteURL) == 0 && *o.EmailSettings.EnableEmailBatching { - return NewAppError("Config.IsValid", "model.config.is_valid.site_url_email_batching.app_error", nil, "", http.StatusBadRequest) - } - - if *o.ClusterSettings.Enable && *o.EmailSettings.EnableEmailBatching { - return NewAppError("Config.IsValid", "model.config.is_valid.cluster_email_batching.app_error", nil, "", http.StatusBadRequest) - } - - if err := o.TeamSettings.isValid(); err != nil { - return err - } - - if err := o.SqlSettings.isValid(); err != nil { - return err - } - - if err := o.FileSettings.isValid(); err != nil { - return err - } - - if err := o.EmailSettings.isValid(); err != nil { - return err - } - - if err := o.LdapSettings.isValid(); err != nil { - return err - } - - if err := o.SamlSettings.isValid(); err != nil { - return err - } - - if *o.PasswordSettings.MinimumLength < PASSWORD_MINIMUM_LENGTH || *o.PasswordSettings.MinimumLength > PASSWORD_MAXIMUM_LENGTH { - return NewAppError("Config.IsValid", "model.config.is_valid.password_length.app_error", map[string]interface{}{"MinLength": PASSWORD_MINIMUM_LENGTH, "MaxLength": PASSWORD_MAXIMUM_LENGTH}, "", http.StatusBadRequest) - } - - if err := o.RateLimitSettings.isValid(); err != nil { - return err - } - - if err := o.WebrtcSettings.isValid(); err != nil { - return err - } - - if err := o.ServiceSettings.isValid(); err != nil { - return err - } - - if err := o.ElasticsearchSettings.isValid(); err != nil { - return err - } - - if err := o.DataRetentionSettings.isValid(); err != nil { - return err - } - - if err := o.LocalizationSettings.isValid(); err != nil { - return err - } - - if err := o.MessageExportSettings.isValid(o.FileSettings); err != nil { - return err - } - - return nil -} - -func (ts *TeamSettings) isValid() *AppError { - if *ts.MaxUsersPerTeam <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.max_users.app_error", nil, "", http.StatusBadRequest) - } - - if *ts.MaxChannelsPerTeam <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.max_channels.app_error", nil, "", http.StatusBadRequest) - } - - if *ts.MaxNotificationsPerChannel <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.max_notify_per_channel.app_error", nil, "", http.StatusBadRequest) - } - - if !(*ts.RestrictDirectMessage == DIRECT_MESSAGE_ANY || *ts.RestrictDirectMessage == DIRECT_MESSAGE_TEAM) { - return NewAppError("Config.IsValid", "model.config.is_valid.restrict_direct_message.app_error", nil, "", http.StatusBadRequest) - } - - if !(*ts.TeammateNameDisplay == SHOW_FULLNAME || *ts.TeammateNameDisplay == SHOW_NICKNAME_FULLNAME || *ts.TeammateNameDisplay == SHOW_USERNAME) { - return NewAppError("Config.IsValid", "model.config.is_valid.teammate_name_display.app_error", nil, "", http.StatusBadRequest) - } - - if len(ts.SiteName) > SITENAME_MAX_LENGTH { - return NewAppError("Config.IsValid", "model.config.is_valid.sitename_length.app_error", map[string]interface{}{"MaxLength": SITENAME_MAX_LENGTH}, "", http.StatusBadRequest) - } - - return nil -} - -func (ss *SqlSettings) isValid() *AppError { - if len(ss.AtRestEncryptKey) < 32 { - return NewAppError("Config.IsValid", "model.config.is_valid.encrypt_sql.app_error", nil, "", http.StatusBadRequest) - } - - if !(*ss.DriverName == DATABASE_DRIVER_MYSQL || *ss.DriverName == DATABASE_DRIVER_POSTGRES) { - return NewAppError("Config.IsValid", "model.config.is_valid.sql_driver.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.MaxIdleConns <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.sql_idle.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.QueryTimeout <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.sql_query_timeout.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.DataSource) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.sql_data_src.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.MaxOpenConns <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.sql_max_conn.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (fs *FileSettings) isValid() *AppError { - if *fs.MaxFileSize <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.max_file_size.app_error", nil, "", http.StatusBadRequest) - } - - if !(*fs.DriverName == IMAGE_DRIVER_LOCAL || *fs.DriverName == IMAGE_DRIVER_S3) { - return NewAppError("Config.IsValid", "model.config.is_valid.file_driver.app_error", nil, "", http.StatusBadRequest) - } - - if len(*fs.PublicLinkSalt) < 32 { - return NewAppError("Config.IsValid", "model.config.is_valid.file_salt.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (es *EmailSettings) isValid() *AppError { - if !(es.ConnectionSecurity == CONN_SECURITY_NONE || es.ConnectionSecurity == CONN_SECURITY_TLS || es.ConnectionSecurity == CONN_SECURITY_STARTTLS || es.ConnectionSecurity == CONN_SECURITY_PLAIN) { - return NewAppError("Config.IsValid", "model.config.is_valid.email_security.app_error", nil, "", http.StatusBadRequest) - } - - if len(es.InviteSalt) < 32 { - return NewAppError("Config.IsValid", "model.config.is_valid.email_salt.app_error", nil, "", http.StatusBadRequest) - } - - if *es.EmailBatchingBufferSize <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.email_batching_buffer_size.app_error", nil, "", http.StatusBadRequest) - } - - if *es.EmailBatchingInterval < 30 { - return NewAppError("Config.IsValid", "model.config.is_valid.email_batching_interval.app_error", nil, "", http.StatusBadRequest) - } - - if !(*es.EmailNotificationContentsType == EMAIL_NOTIFICATION_CONTENTS_FULL || *es.EmailNotificationContentsType == EMAIL_NOTIFICATION_CONTENTS_GENERIC) { - return NewAppError("Config.IsValid", "model.config.is_valid.email_notification_contents_type.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (rls *RateLimitSettings) isValid() *AppError { - if *rls.MemoryStoreSize <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.rate_mem.app_error", nil, "", http.StatusBadRequest) - } - - if *rls.PerSec <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.rate_sec.app_error", nil, "", http.StatusBadRequest) - } - - if *rls.MaxBurst <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.max_burst.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (ls *LdapSettings) isValid() *AppError { - if !(*ls.ConnectionSecurity == CONN_SECURITY_NONE || *ls.ConnectionSecurity == CONN_SECURITY_TLS || *ls.ConnectionSecurity == CONN_SECURITY_STARTTLS) { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_security.app_error", nil, "", http.StatusBadRequest) - } - - if *ls.SyncIntervalMinutes <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_sync_interval.app_error", nil, "", http.StatusBadRequest) - } - - if *ls.MaxPageSize < 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_max_page_size.app_error", nil, "", http.StatusBadRequest) - } - - if *ls.Enable { - if *ls.LdapServer == "" { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_server", nil, "", http.StatusBadRequest) - } - - if *ls.BaseDN == "" { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_basedn", nil, "", http.StatusBadRequest) - } - - if *ls.EmailAttribute == "" { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_email", nil, "", http.StatusBadRequest) - } - - if *ls.UsernameAttribute == "" { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_username", nil, "", http.StatusBadRequest) - } - - if *ls.IdAttribute == "" { - return NewAppError("Config.IsValid", "model.config.is_valid.ldap_id", nil, "", http.StatusBadRequest) - } - } - - return nil -} - -func (ss *SamlSettings) isValid() *AppError { - if *ss.Enable { - if len(*ss.IdpUrl) == 0 || !IsValidHttpUrl(*ss.IdpUrl) { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_idp_url.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.IdpDescriptorUrl) == 0 || !IsValidHttpUrl(*ss.IdpDescriptorUrl) { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_idp_descriptor_url.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.IdpCertificateFile) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_idp_cert.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.EmailAttribute) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_email_attribute.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.UsernameAttribute) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_username_attribute.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.Verify { - if len(*ss.AssertionConsumerServiceURL) == 0 || !IsValidHttpUrl(*ss.AssertionConsumerServiceURL) { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_assertion_consumer_service_url.app_error", nil, "", http.StatusBadRequest) - } - } - - if *ss.Encrypt { - if len(*ss.PrivateKeyFile) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_private_key.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.PublicCertificateFile) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_public_cert.app_error", nil, "", http.StatusBadRequest) - } - } - - if len(*ss.EmailAttribute) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.saml_email_attribute.app_error", nil, "", http.StatusBadRequest) - } - } - - return nil -} - -func (ws *WebrtcSettings) isValid() *AppError { - if *ws.Enable { - if len(*ws.GatewayWebsocketUrl) == 0 || !IsValidWebsocketUrl(*ws.GatewayWebsocketUrl) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_gateway_ws_url.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.GatewayAdminUrl) == 0 || !IsValidHttpUrl(*ws.GatewayAdminUrl) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_gateway_admin_url.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.GatewayAdminSecret) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_gateway_admin_secret.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.StunURI) != 0 && !IsValidTurnOrStunServer(*ws.StunURI) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_stun_uri.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.TurnURI) != 0 { - if !IsValidTurnOrStunServer(*ws.TurnURI) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_turn_uri.app_error", nil, "", http.StatusBadRequest) - } - if len(*ws.TurnUsername) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_turn_username.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.TurnSharedKey) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_turn_shared_key.app_error", nil, "", http.StatusBadRequest) - } - } - } - - return nil -} - -func (ss *ServiceSettings) isValid() *AppError { - if !(*ss.ConnectionSecurity == CONN_SECURITY_NONE || *ss.ConnectionSecurity == CONN_SECURITY_TLS) { - return NewAppError("Config.IsValid", "model.config.is_valid.webserver_security.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.ReadTimeout <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.read_timeout.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.WriteTimeout <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.write_timeout.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.TimeBetweenUserTypingUpdatesMilliseconds < 1000 { - return NewAppError("Config.IsValid", "model.config.is_valid.time_between_user_typing.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.MaximumLoginAttempts <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.login_attempts.app_error", nil, "", http.StatusBadRequest) - } - - if len(*ss.SiteURL) != 0 { - if _, err := url.ParseRequestURI(*ss.SiteURL); err != nil { - return NewAppError("Config.IsValid", "model.config.is_valid.site_url.app_error", nil, "", http.StatusBadRequest) - } - } - - if len(*ss.ListenAddress) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.listen_address.app_error", nil, "", http.StatusBadRequest) - } - - if *ss.ExperimentalGroupUnreadChannels != GROUP_UNREAD_CHANNELS_DISABLED && - *ss.ExperimentalGroupUnreadChannels != GROUP_UNREAD_CHANNELS_DEFAULT_ON && - *ss.ExperimentalGroupUnreadChannels != GROUP_UNREAD_CHANNELS_DEFAULT_OFF { - return NewAppError("Config.IsValid", "model.config.is_valid.group_unread_channels.app_error", nil, "", http.StatusBadRequest) - } - - switch *ss.ImageProxyType { - case "", "willnorris/imageproxy": - case "atmos/camo": - if *ss.ImageProxyOptions == "" { - return NewAppError("Config.IsValid", "model.config.is_valid.atmos_camo_image_proxy_options.app_error", nil, "", http.StatusBadRequest) - } - default: - return NewAppError("Config.IsValid", "model.config.is_valid.image_proxy_type.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (ess *ElasticsearchSettings) isValid() *AppError { - if *ess.EnableIndexing { - if len(*ess.ConnectionUrl) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.connection_url.app_error", nil, "", http.StatusBadRequest) - } - } - - if *ess.EnableSearching && !*ess.EnableIndexing { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.enable_searching.app_error", nil, "", http.StatusBadRequest) - } - - if *ess.AggregatePostsAfterDays < 1 { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.aggregate_posts_after_days.app_error", nil, "", http.StatusBadRequest) - } - - if _, err := time.Parse("15:04", *ess.PostsAggregatorJobStartTime); err != nil { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.posts_aggregator_job_start_time.app_error", nil, err.Error(), http.StatusBadRequest) - } - - if *ess.LiveIndexingBatchSize < 1 { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.live_indexing_batch_size.app_error", nil, "", http.StatusBadRequest) - } - - if *ess.BulkIndexingTimeWindowSeconds < 1 { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.bulk_indexing_time_window_seconds.app_error", nil, "", http.StatusBadRequest) - } - - if *ess.RequestTimeoutSeconds < 1 { - return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.request_timeout_seconds.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (drs *DataRetentionSettings) isValid() *AppError { - if *drs.MessageRetentionDays <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.data_retention.message_retention_days_too_low.app_error", nil, "", http.StatusBadRequest) - } - - if *drs.FileRetentionDays <= 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.data_retention.file_retention_days_too_low.app_error", nil, "", http.StatusBadRequest) - } - - if _, err := time.Parse("15:04", *drs.DeletionJobStartTime); err != nil { - return NewAppError("Config.IsValid", "model.config.is_valid.data_retention.deletion_job_start_time.app_error", nil, err.Error(), http.StatusBadRequest) - } - - return nil -} - -func (ls *LocalizationSettings) isValid() *AppError { - if len(*ls.AvailableLocales) > 0 { - if !strings.Contains(*ls.AvailableLocales, *ls.DefaultClientLocale) { - return NewAppError("Config.IsValid", "model.config.is_valid.localization.available_locales.app_error", nil, "", http.StatusBadRequest) - } - } - - return nil -} - -func (mes *MessageExportSettings) isValid(fs FileSettings) *AppError { - if mes.EnableExport == nil { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.enable.app_error", nil, "", http.StatusBadRequest) - } - if *mes.EnableExport { - if mes.ExportFromTimestamp == nil || *mes.ExportFromTimestamp < 0 || *mes.ExportFromTimestamp > GetMillis() { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.export_from.app_error", nil, "", http.StatusBadRequest) - } else if mes.DailyRunTime == nil { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.daily_runtime.app_error", nil, "", http.StatusBadRequest) - } else if _, err := time.Parse("15:04", *mes.DailyRunTime); err != nil { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.daily_runtime.app_error", nil, err.Error(), http.StatusBadRequest) - } else if mes.BatchSize == nil || *mes.BatchSize < 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.batch_size.app_error", nil, "", http.StatusBadRequest) - } else if mes.ExportFormat == nil || (*mes.ExportFormat != COMPLIANCE_EXPORT_TYPE_ACTIANCE && *mes.ExportFormat != COMPLIANCE_EXPORT_TYPE_GLOBALRELAY) { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.export_type.app_error", nil, "", http.StatusBadRequest) - } - - if *mes.ExportFormat == COMPLIANCE_EXPORT_TYPE_GLOBALRELAY { - // validating email addresses is hard - just make sure it contains an '@' sign - // see https://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address - if mes.GlobalRelayEmailAddress == nil || !strings.Contains(*mes.GlobalRelayEmailAddress, "@") { - return NewAppError("Config.IsValid", "model.config.is_valid.message_export.global_relay_email_address.app_error", nil, "", http.StatusBadRequest) - } - } - } - return nil -} - -func (o *Config) GetSanitizeOptions() map[string]bool { - options := map[string]bool{} - options["fullname"] = o.PrivacySettings.ShowFullName - options["email"] = o.PrivacySettings.ShowEmailAddress - - return options -} - -func (o *Config) Sanitize() { - if o.LdapSettings.BindPassword != nil && len(*o.LdapSettings.BindPassword) > 0 { - *o.LdapSettings.BindPassword = FAKE_SETTING - } - - *o.FileSettings.PublicLinkSalt = FAKE_SETTING - if len(o.FileSettings.AmazonS3SecretAccessKey) > 0 { - o.FileSettings.AmazonS3SecretAccessKey = FAKE_SETTING - } - - o.EmailSettings.InviteSalt = FAKE_SETTING - if len(o.EmailSettings.SMTPPassword) > 0 { - o.EmailSettings.SMTPPassword = FAKE_SETTING - } - - if len(o.GitLabSettings.Secret) > 0 { - o.GitLabSettings.Secret = FAKE_SETTING - } - - *o.SqlSettings.DataSource = FAKE_SETTING - o.SqlSettings.AtRestEncryptKey = FAKE_SETTING - - for i := range o.SqlSettings.DataSourceReplicas { - o.SqlSettings.DataSourceReplicas[i] = FAKE_SETTING - } - - for i := range o.SqlSettings.DataSourceSearchReplicas { - o.SqlSettings.DataSourceSearchReplicas[i] = FAKE_SETTING - } - - *o.ElasticsearchSettings.Password = FAKE_SETTING -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/data_retention_policy.go b/vendor/github.com/mattermost/mattermost-server/model/data_retention_policy.go deleted file mode 100644 index dbb13374..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/data_retention_policy.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type DataRetentionPolicy struct { - MessageDeletionEnabled bool `json:"message_deletion_enabled"` - FileDeletionEnabled bool `json:"file_deletion_enabled"` - MessageRetentionCutoff int64 `json:"message_retention_cutoff"` - FileRetentionCutoff int64 `json:"file_retention_cutoff"` -} - -func (me *DataRetentionPolicy) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func DataRetentionPolicyFromJson(data io.Reader) *DataRetentionPolicy { - var me *DataRetentionPolicy - json.NewDecoder(data).Decode(&me) - return me -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/emoji.go b/vendor/github.com/mattermost/mattermost-server/model/emoji.go deleted file mode 100644 index a1703abb..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/emoji.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" -) - -const ( - EMOJI_NAME_MAX_LENGTH = 64 - EMOJI_SORT_BY_NAME = "name" -) - -type Emoji struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - CreatorId string `json:"creator_id"` - Name string `json:"name"` -} - -func (emoji *Emoji) IsValid() *AppError { - if len(emoji.Id) != 26 { - return NewAppError("Emoji.IsValid", "model.emoji.id.app_error", nil, "", http.StatusBadRequest) - } - - if emoji.CreateAt == 0 { - return NewAppError("Emoji.IsValid", "model.emoji.create_at.app_error", nil, "id="+emoji.Id, http.StatusBadRequest) - } - - if emoji.UpdateAt == 0 { - return NewAppError("Emoji.IsValid", "model.emoji.update_at.app_error", nil, "id="+emoji.Id, http.StatusBadRequest) - } - - if len(emoji.CreatorId) != 26 { - return NewAppError("Emoji.IsValid", "model.emoji.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(emoji.Name) == 0 || len(emoji.Name) > EMOJI_NAME_MAX_LENGTH || !IsValidAlphaNumHyphenUnderscore(emoji.Name, false) { - return NewAppError("Emoji.IsValid", "model.emoji.name.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (emoji *Emoji) PreSave() { - if emoji.Id == "" { - emoji.Id = NewId() - } - - emoji.CreateAt = GetMillis() - emoji.UpdateAt = emoji.CreateAt -} - -func (emoji *Emoji) PreUpdate() { - emoji.UpdateAt = GetMillis() -} - -func (emoji *Emoji) ToJson() string { - b, _ := json.Marshal(emoji) - return string(b) -} - -func EmojiFromJson(data io.Reader) *Emoji { - var emoji *Emoji - json.NewDecoder(data).Decode(&emoji) - return emoji -} - -func EmojiListToJson(emojiList []*Emoji) string { - b, _ := json.Marshal(emojiList) - return string(b) -} - -func EmojiListFromJson(data io.Reader) []*Emoji { - var emojiList []*Emoji - json.NewDecoder(data).Decode(&emojiList) - return emojiList -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/emoji_search.go b/vendor/github.com/mattermost/mattermost-server/model/emoji_search.go deleted file mode 100644 index 3a768a57..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/emoji_search.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type EmojiSearch struct { - Term string `json:"term"` - PrefixOnly bool `json:"prefix_only"` -} - -func (es *EmojiSearch) ToJson() string { - b, _ := json.Marshal(es) - return string(b) -} - -func EmojiSearchFromJson(data io.Reader) *EmojiSearch { - var es *EmojiSearch - json.NewDecoder(data).Decode(&es) - return es -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/file.go b/vendor/github.com/mattermost/mattermost-server/model/file.go deleted file mode 100644 index c7ffbf0b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/file.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -const ( - MaxImageSize = 6048 * 4032 // 24 megapixels, roughly 36MB as a raw image -) - -var ( - IMAGE_EXTENSIONS = [5]string{".jpg", ".jpeg", ".gif", ".bmp", ".png"} - IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"} -) - -type FileUploadResponse struct { - FileInfos []*FileInfo `json:"file_infos"` - ClientIds []string `json:"client_ids"` -} - -func FileUploadResponseFromJson(data io.Reader) *FileUploadResponse { - var o *FileUploadResponse - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *FileUploadResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/file_info.go b/vendor/github.com/mattermost/mattermost-server/model/file_info.go deleted file mode 100644 index e0bbfcfc..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/file_info.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "bytes" - "encoding/json" - "image" - "image/gif" - "io" - "mime" - "net/http" - "path/filepath" - "strings" -) - -type FileInfo struct { - Id string `json:"id"` - CreatorId string `json:"user_id"` - PostId string `json:"post_id,omitempty"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - Path string `json:"-"` // not sent back to the client - ThumbnailPath string `json:"-"` // not sent back to the client - PreviewPath string `json:"-"` // not sent back to the client - Name string `json:"name"` - Extension string `json:"extension"` - Size int64 `json:"size"` - MimeType string `json:"mime_type"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` - HasPreviewImage bool `json:"has_preview_image,omitempty"` -} - -func (info *FileInfo) ToJson() string { - b, _ := json.Marshal(info) - return string(b) -} - -func FileInfoFromJson(data io.Reader) *FileInfo { - decoder := json.NewDecoder(data) - - var info FileInfo - if err := decoder.Decode(&info); err != nil { - return nil - } else { - return &info - } -} - -func FileInfosToJson(infos []*FileInfo) string { - b, _ := json.Marshal(infos) - return string(b) -} - -func FileInfosFromJson(data io.Reader) []*FileInfo { - decoder := json.NewDecoder(data) - - var infos []*FileInfo - if err := decoder.Decode(&infos); err != nil { - return nil - } else { - return infos - } -} - -func (o *FileInfo) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - if o.CreateAt == 0 { - o.CreateAt = GetMillis() - } - - if o.UpdateAt < o.CreateAt { - o.UpdateAt = o.CreateAt - } -} - -func (o *FileInfo) IsValid() *AppError { - if len(o.Id) != 26 { - return NewAppError("FileInfo.IsValid", "model.file_info.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.CreatorId) != 26 { - return NewAppError("FileInfo.IsValid", "model.file_info.is_valid.user_id.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.PostId) != 0 && len(o.PostId) != 26 { - return NewAppError("FileInfo.IsValid", "model.file_info.is_valid.post_id.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("FileInfo.IsValid", "model.file_info.is_valid.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("FileInfo.IsValid", "model.file_info.is_valid.update_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.Path == "" { - return NewAppError("FileInfo.IsValid", "model.file_info.is_valid.path.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - return nil -} - -func (o *FileInfo) IsImage() bool { - return strings.HasPrefix(o.MimeType, "image") -} - -func GetInfoForBytes(name string, data []byte) (*FileInfo, *AppError) { - info := &FileInfo{ - Name: name, - Size: int64(len(data)), - } - var err *AppError - - extension := strings.ToLower(filepath.Ext(name)) - info.MimeType = mime.TypeByExtension(extension) - - if extension != "" && extension[0] == '.' { - // The client expects a file extension without the leading period - info.Extension = extension[1:] - } else { - info.Extension = extension - } - - if info.IsImage() { - // Only set the width and height if it's actually an image that we can understand - if config, _, err := image.DecodeConfig(bytes.NewReader(data)); err == nil { - info.Width = config.Width - info.Height = config.Height - - if info.MimeType == "image/gif" { - // Just show the gif itself instead of a preview image for animated gifs - if gifConfig, err := gif.DecodeAll(bytes.NewReader(data)); err != nil { - // Still return the rest of the info even though it doesn't appear to be an actual gif - info.HasPreviewImage = true - err = NewAppError("GetInfoForBytes", "model.file_info.get.gif.app_error", nil, "name="+name, http.StatusBadRequest) - } else { - info.HasPreviewImage = len(gifConfig.Image) == 1 - } - } else { - info.HasPreviewImage = true - } - } - } - - return info, err -} - -func GetEtagForFileInfos(infos []*FileInfo) string { - if len(infos) == 0 { - return Etag() - } - - var maxUpdateAt int64 - - for _, info := range infos { - if info.UpdateAt > maxUpdateAt { - maxUpdateAt = info.UpdateAt - } - } - - return Etag(infos[0].PostId, maxUpdateAt) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/gitlab.go b/vendor/github.com/mattermost/mattermost-server/model/gitlab.go deleted file mode 100644 index 8777614c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/gitlab.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -const ( - USER_AUTH_SERVICE_GITLAB = "gitlab" -) diff --git a/vendor/github.com/mattermost/mattermost-server/model/gitlab/gitlab.go b/vendor/github.com/mattermost/mattermost-server/model/gitlab/gitlab.go deleted file mode 100644 index 7e0cb10a..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/gitlab/gitlab.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package oauthgitlab - -import ( - "encoding/json" - "io" - "strconv" - "strings" - - "github.com/mattermost/mattermost-server/einterfaces" - "github.com/mattermost/mattermost-server/model" -) - -type GitLabProvider struct { -} - -type GitLabUser struct { - Id int64 `json:"id"` - Username string `json:"username"` - Login string `json:"login"` - Email string `json:"email"` - Name string `json:"name"` -} - -func init() { - provider := &GitLabProvider{} - einterfaces.RegisterOauthProvider(model.USER_AUTH_SERVICE_GITLAB, provider) -} - -func userFromGitLabUser(glu *GitLabUser) *model.User { - user := &model.User{} - username := glu.Username - if username == "" { - username = glu.Login - } - user.Username = model.CleanUsername(username) - splitName := strings.Split(glu.Name, " ") - if len(splitName) == 2 { - user.FirstName = splitName[0] - user.LastName = splitName[1] - } else if len(splitName) >= 2 { - user.FirstName = splitName[0] - user.LastName = strings.Join(splitName[1:], " ") - } else { - user.FirstName = glu.Name - } - user.Email = glu.Email - userId := strconv.FormatInt(glu.Id, 10) - user.AuthData = &userId - user.AuthService = model.USER_AUTH_SERVICE_GITLAB - - return user -} - -func gitLabUserFromJson(data io.Reader) *GitLabUser { - decoder := json.NewDecoder(data) - var glu GitLabUser - err := decoder.Decode(&glu) - if err == nil { - return &glu - } else { - return nil - } -} - -func (glu *GitLabUser) ToJson() string { - b, err := json.Marshal(glu) - if err != nil { - return "" - } else { - return string(b) - } -} - -func (glu *GitLabUser) IsValid() bool { - if glu.Id == 0 { - return false - } - - if len(glu.Email) == 0 { - return false - } - - return true -} - -func (glu *GitLabUser) getAuthData() string { - return strconv.FormatInt(glu.Id, 10) -} - -func (m *GitLabProvider) GetIdentifier() string { - return model.USER_AUTH_SERVICE_GITLAB -} - -func (m *GitLabProvider) GetUserFromJson(data io.Reader) *model.User { - glu := gitLabUserFromJson(data) - if glu.IsValid() { - return userFromGitLabUser(glu) - } - - return &model.User{} -} - -func (m *GitLabProvider) GetAuthDataFromJson(data io.Reader) string { - glu := gitLabUserFromJson(data) - - if glu.IsValid() { - return glu.getAuthData() - } - - return "" -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/incoming_webhook.go b/vendor/github.com/mattermost/mattermost-server/model/incoming_webhook.go deleted file mode 100644 index b38cfeec..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/incoming_webhook.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "bytes" - "encoding/json" - "io" - "net/http" - "regexp" -) - -const ( - DEFAULT_WEBHOOK_USERNAME = "webhook" -) - -type IncomingWebhook struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - UserId string `json:"user_id"` - ChannelId string `json:"channel_id"` - TeamId string `json:"team_id"` - DisplayName string `json:"display_name"` - Description string `json:"description"` - Username string `json:"username"` - IconURL string `json:"icon_url"` -} - -type IncomingWebhookRequest struct { - Text string `json:"text"` - Username string `json:"username"` - IconURL string `json:"icon_url"` - ChannelName string `json:"channel"` - Props StringInterface `json:"props"` - Attachments []*SlackAttachment `json:"attachments"` - Type string `json:"type"` -} - -func (o *IncomingWebhook) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func IncomingWebhookFromJson(data io.Reader) *IncomingWebhook { - var o *IncomingWebhook - json.NewDecoder(data).Decode(&o) - return o -} - -func IncomingWebhookListToJson(l []*IncomingWebhook) string { - b, _ := json.Marshal(l) - return string(b) -} - -func IncomingWebhookListFromJson(data io.Reader) []*IncomingWebhook { - var o []*IncomingWebhook - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *IncomingWebhook) IsValid() *AppError { - - if len(o.Id) != 26 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.id.app_error", nil, "", http.StatusBadRequest) - - } - - if o.CreateAt == 0 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.update_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.UserId) != 26 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ChannelId) != 26 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.channel_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.TeamId) != 26 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.team_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.DisplayName) > 64 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.display_name.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Description) > 128 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.description.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Username) > 64 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.username.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.IconURL) > 1024 { - return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.icon_url.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *IncomingWebhook) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - o.CreateAt = GetMillis() - o.UpdateAt = o.CreateAt -} - -func (o *IncomingWebhook) PreUpdate() { - o.UpdateAt = GetMillis() -} - -// escapeControlCharsFromPayload escapes control chars (\n, \t) from a byte slice. -// Context: -// JSON strings are not supposed to contain control characters such as \n, \t, -// ... but some incoming webhooks might still send invalid JSON and we want to -// try to handle that. An example invalid JSON string from an incoming webhook -// might look like this (strings for both "text" and "fallback" attributes are -// invalid JSON strings because they contain unescaped newlines and tabs): -// `{ -// "text": "this is a test -// that contains a newline and tabs", -// "attachments": [ -// { -// "fallback": "Required plain-text summary of the attachment -// that contains a newline and tabs", -// "color": "#36a64f", -// ... -// "text": "Optional text that appears within the attachment -// that contains a newline and tabs", -// ... -// "thumb_url": "http://example.com/path/to/thumb.png" -// } -// ] -// }` -// This function will search for `"key": "value"` pairs, and escape \n, \t -// from the value. -func escapeControlCharsFromPayload(by []byte) []byte { - // we'll search for `"text": "..."` or `"fallback": "..."`, ... - keys := "text|fallback|pretext|author_name|title|value" - - // the regexp reads like this: - // (?s): this flag let . match \n (default is false) - // "(keys)": we search for the keys defined above - // \s*:\s*: followed by 0..n spaces/tabs, a colon then 0..n spaces/tabs - // ": a double-quote - // (\\"|[^"])*: any number of times the `\"` string or any char but a double-quote - // ": a double-quote - r := `(?s)"(` + keys + `)"\s*:\s*"(\\"|[^"])*"` - re := regexp.MustCompile(r) - - // the function that will escape \n and \t on the regexp matches - repl := func(b []byte) []byte { - if bytes.Contains(b, []byte("\n")) { - b = bytes.Replace(b, []byte("\n"), []byte("\\n"), -1) - } - if bytes.Contains(b, []byte("\t")) { - b = bytes.Replace(b, []byte("\t"), []byte("\\t"), -1) - } - - return b - } - - return re.ReplaceAllFunc(by, repl) -} - -func decodeIncomingWebhookRequest(by []byte) (*IncomingWebhookRequest, error) { - decoder := json.NewDecoder(bytes.NewReader(by)) - var o IncomingWebhookRequest - err := decoder.Decode(&o) - if err == nil { - return &o, nil - } else { - return nil, err - } -} - -func IncomingWebhookRequestFromJson(data io.Reader) (*IncomingWebhookRequest, *AppError) { - buf := new(bytes.Buffer) - buf.ReadFrom(data) - by := buf.Bytes() - - // Try to decode the JSON data. Only if it fails, try to escape control - // characters from the strings contained in the JSON data. - o, err := decodeIncomingWebhookRequest(by) - if err != nil { - o, err = decodeIncomingWebhookRequest(escapeControlCharsFromPayload(by)) - if err != nil { - return nil, NewAppError("IncomingWebhookRequestFromJson", "Unable to parse incoming data", nil, err.Error(), http.StatusBadRequest) - } - } - - o.Attachments = StringifySlackFieldValue(o.Attachments) - - return o, nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/initial_load.go b/vendor/github.com/mattermost/mattermost-server/model/initial_load.go deleted file mode 100644 index 3be68044..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/initial_load.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type InitialLoad struct { - User *User `json:"user"` - TeamMembers []*TeamMember `json:"team_members"` - Teams []*Team `json:"teams"` - Preferences Preferences `json:"preferences"` - ClientCfg map[string]string `json:"client_cfg"` - LicenseCfg map[string]string `json:"license_cfg"` - NoAccounts bool `json:"no_accounts"` -} - -func (me *InitialLoad) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func InitialLoadFromJson(data io.Reader) *InitialLoad { - var o *InitialLoad - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/job.go b/vendor/github.com/mattermost/mattermost-server/model/job.go deleted file mode 100644 index e10ed1f5..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/job.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "time" -) - -const ( - JOB_TYPE_DATA_RETENTION = "data_retention" - JOB_TYPE_MESSAGE_EXPORT = "message_export" - JOB_TYPE_ELASTICSEARCH_POST_INDEXING = "elasticsearch_post_indexing" - JOB_TYPE_ELASTICSEARCH_POST_AGGREGATION = "elasticsearch_post_aggregation" - JOB_TYPE_LDAP_SYNC = "ldap_sync" - - JOB_STATUS_PENDING = "pending" - JOB_STATUS_IN_PROGRESS = "in_progress" - JOB_STATUS_SUCCESS = "success" - JOB_STATUS_ERROR = "error" - JOB_STATUS_CANCEL_REQUESTED = "cancel_requested" - JOB_STATUS_CANCELED = "canceled" -) - -type Job struct { - Id string `json:"id"` - Type string `json:"type"` - Priority int64 `json:"priority"` - CreateAt int64 `json:"create_at"` - StartAt int64 `json:"start_at"` - LastActivityAt int64 `json:"last_activity_at"` - Status string `json:"status"` - Progress int64 `json:"progress"` - Data map[string]string `json:"data"` -} - -func (j *Job) IsValid() *AppError { - if len(j.Id) != 26 { - return NewAppError("Job.IsValid", "model.job.is_valid.id.app_error", nil, "id="+j.Id, http.StatusBadRequest) - } - - if j.CreateAt == 0 { - return NewAppError("Job.IsValid", "model.job.is_valid.create_at.app_error", nil, "id="+j.Id, http.StatusBadRequest) - } - - switch j.Type { - case JOB_TYPE_DATA_RETENTION: - case JOB_TYPE_ELASTICSEARCH_POST_INDEXING: - case JOB_TYPE_ELASTICSEARCH_POST_AGGREGATION: - case JOB_TYPE_LDAP_SYNC: - case JOB_TYPE_MESSAGE_EXPORT: - default: - return NewAppError("Job.IsValid", "model.job.is_valid.type.app_error", nil, "id="+j.Id, http.StatusBadRequest) - } - - switch j.Status { - case JOB_STATUS_PENDING: - case JOB_STATUS_IN_PROGRESS: - case JOB_STATUS_SUCCESS: - case JOB_STATUS_ERROR: - case JOB_STATUS_CANCEL_REQUESTED: - case JOB_STATUS_CANCELED: - default: - return NewAppError("Job.IsValid", "model.job.is_valid.status.app_error", nil, "id="+j.Id, http.StatusBadRequest) - } - - return nil -} - -func (js *Job) ToJson() string { - b, _ := json.Marshal(js) - return string(b) -} - -func JobFromJson(data io.Reader) *Job { - var job Job - if err := json.NewDecoder(data).Decode(&job); err == nil { - return &job - } else { - return nil - } -} - -func JobsToJson(jobs []*Job) string { - b, _ := json.Marshal(jobs) - return string(b) -} - -func JobsFromJson(data io.Reader) []*Job { - var jobs []*Job - if err := json.NewDecoder(data).Decode(&jobs); err == nil { - return jobs - } else { - return nil - } -} - -func (js *Job) DataToJson() string { - b, _ := json.Marshal(js.Data) - return string(b) -} - -type Worker interface { - Run() - Stop() - JobChannel() chan<- Job -} - -type Scheduler interface { - Name() string - JobType() string - Enabled(cfg *Config) bool - NextScheduleTime(cfg *Config, now time.Time, pendingJobs bool, lastSuccessfulJob *Job) *time.Time - ScheduleJob(cfg *Config, pendingJobs bool, lastSuccessfulJob *Job) (*Job, *AppError) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/ldap.go b/vendor/github.com/mattermost/mattermost-server/model/ldap.go deleted file mode 100644 index 1453a4ad..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/ldap.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -const ( - USER_AUTH_SERVICE_LDAP = "ldap" - LDAP_SYNC_TASK_NAME = "LDAP Syncronization" -) diff --git a/vendor/github.com/mattermost/mattermost-server/model/license.go b/vendor/github.com/mattermost/mattermost-server/model/license.go deleted file mode 100644 index 942a18d5..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/license.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" -) - -const ( - EXPIRED_LICENSE_ERROR = "api.license.add_license.expired.app_error" - INVALID_LICENSE_ERROR = "api.license.add_license.invalid.app_error" -) - -type LicenseRecord struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - Bytes string `json:"-"` -} - -type License struct { - Id string `json:"id"` - IssuedAt int64 `json:"issued_at"` - StartsAt int64 `json:"starts_at"` - ExpiresAt int64 `json:"expires_at"` - Customer *Customer `json:"customer"` - Features *Features `json:"features"` -} - -type Customer struct { - Id string `json:"id"` - Name string `json:"name"` - Email string `json:"email"` - Company string `json:"company"` - PhoneNumber string `json:"phone_number"` -} - -type Features struct { - Users *int `json:"users"` - LDAP *bool `json:"ldap"` - MFA *bool `json:"mfa"` - GoogleOAuth *bool `json:"google_oauth"` - Office365OAuth *bool `json:"office365_oauth"` - Compliance *bool `json:"compliance"` - Cluster *bool `json:"cluster"` - Metrics *bool `json:"metrics"` - CustomBrand *bool `json:"custom_brand"` - MHPNS *bool `json:"mhpns"` - SAML *bool `json:"saml"` - PasswordRequirements *bool `json:"password_requirements"` - Elasticsearch *bool `json:"elastic_search"` - Announcement *bool `json:"announcement"` - ThemeManagement *bool `json:"theme_management"` - EmailNotificationContents *bool `json:"email_notification_contents"` - DataRetention *bool `json:"data_retention"` - MessageExport *bool `json:"message_export"` - - // after we enabled more features for webrtc we'll need to control them with this - FutureFeatures *bool `json:"future_features"` -} - -func (f *Features) ToMap() map[string]interface{} { - return map[string]interface{}{ - "ldap": *f.LDAP, - "mfa": *f.MFA, - "google": *f.GoogleOAuth, - "office365": *f.Office365OAuth, - "compliance": *f.Compliance, - "cluster": *f.Cluster, - "metrics": *f.Metrics, - "custom_brand": *f.CustomBrand, - "mhpns": *f.MHPNS, - "saml": *f.SAML, - "password": *f.PasswordRequirements, - "elastic_search": *f.Elasticsearch, - "email_notification_contents": *f.EmailNotificationContents, - "data_retention": *f.DataRetention, - "message_export": *f.MessageExport, - "future": *f.FutureFeatures, - } -} - -func (f *Features) SetDefaults() { - if f.FutureFeatures == nil { - f.FutureFeatures = NewBool(true) - } - - if f.Users == nil { - f.Users = NewInt(0) - } - - if f.LDAP == nil { - f.LDAP = NewBool(*f.FutureFeatures) - } - - if f.MFA == nil { - f.MFA = NewBool(*f.FutureFeatures) - } - - if f.GoogleOAuth == nil { - f.GoogleOAuth = NewBool(*f.FutureFeatures) - } - - if f.Office365OAuth == nil { - f.Office365OAuth = NewBool(*f.FutureFeatures) - } - - if f.Compliance == nil { - f.Compliance = NewBool(*f.FutureFeatures) - } - - if f.Cluster == nil { - f.Cluster = NewBool(*f.FutureFeatures) - } - - if f.Metrics == nil { - f.Metrics = NewBool(*f.FutureFeatures) - } - - if f.CustomBrand == nil { - f.CustomBrand = NewBool(*f.FutureFeatures) - } - - if f.MHPNS == nil { - f.MHPNS = NewBool(*f.FutureFeatures) - } - - if f.SAML == nil { - f.SAML = NewBool(*f.FutureFeatures) - } - - if f.PasswordRequirements == nil { - f.PasswordRequirements = NewBool(*f.FutureFeatures) - } - - if f.Elasticsearch == nil { - f.Elasticsearch = NewBool(*f.FutureFeatures) - } - - if f.Announcement == nil { - f.Announcement = NewBool(true) - } - - if f.ThemeManagement == nil { - f.ThemeManagement = NewBool(true) - } - - if f.EmailNotificationContents == nil { - f.EmailNotificationContents = NewBool(*f.FutureFeatures) - } - - if f.DataRetention == nil { - f.DataRetention = NewBool(*f.FutureFeatures) - } - - if f.MessageExport == nil { - f.MessageExport = NewBool(*f.FutureFeatures) - } -} - -func (l *License) IsExpired() bool { - return l.ExpiresAt < GetMillis() -} - -func (l *License) IsStarted() bool { - return l.StartsAt < GetMillis() -} - -func (l *License) ToJson() string { - b, _ := json.Marshal(l) - return string(b) -} - -// NewTestLicense returns a license that expires in the future and has the given features. -func NewTestLicense(features ...string) *License { - ret := &License{ - ExpiresAt: GetMillis() + 90*24*60*60*1000, - Customer: &Customer{}, - Features: &Features{}, - } - ret.Features.SetDefaults() - - featureMap := map[string]bool{} - for _, feature := range features { - featureMap[feature] = true - } - featureJson, _ := json.Marshal(featureMap) - json.Unmarshal(featureJson, &ret.Features) - - return ret -} - -func LicenseFromJson(data io.Reader) *License { - var o *License - json.NewDecoder(data).Decode(&o) - return o -} - -func (lr *LicenseRecord) IsValid() *AppError { - if len(lr.Id) != 26 { - return NewAppError("LicenseRecord.IsValid", "model.license_record.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if lr.CreateAt == 0 { - return NewAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "", http.StatusBadRequest) - } - - if len(lr.Bytes) == 0 || len(lr.Bytes) > 10000 { - return NewAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (lr *LicenseRecord) PreSave() { - lr.CreateAt = GetMillis() -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/manifest.go b/vendor/github.com/mattermost/mattermost-server/model/manifest.go deleted file mode 100644 index 5ba4854b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/manifest.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "io/ioutil" - "os" - "path/filepath" - - "gopkg.in/yaml.v2" -) - -const ( - PLUGIN_CONFIG_TYPE_TEXT = "text" - PLUGIN_CONFIG_TYPE_BOOL = "bool" - PLUGIN_CONFIG_TYPE_RADIO = "radio" - PLUGIN_CONFIG_TYPE_DROPDOWN = "dropdown" - PLUGIN_CONFIG_TYPE_GENERATED = "generated" - PLUGIN_CONFIG_TYPE_USERNAME = "username" -) - -type PluginOption struct { - // The display name for the option. - DisplayName string `json:"display_name" yaml:"display_name"` - - // The string value for the option. - Value string `json:"value" yaml:"value"` -} - -type PluginSetting struct { - // The key that the setting will be assigned to in the configuration file. - Key string `json:"key" yaml:"key"` - - // The display name for the setting. - DisplayName string `json:"display_name" yaml:"display_name"` - - // The type of the setting. - // - // "bool" will result in a boolean true or false setting. - // - // "dropdown" will result in a string setting that allows the user to select from a list of - // pre-defined options. - // - // "generated" will result in a string setting that is set to a random, cryptographically secure - // string. - // - // "radio" will result in a string setting that allows the user to select from a short selection - // of pre-defined options. - // - // "text" will result in a string setting that can be typed in manually. - // - // "username" will result in a text setting that will autocomplete to a username. - Type string `json:"type" yaml:"type"` - - // The help text to display to the user. - HelpText string `json:"help_text" yaml:"help_text"` - - // The help text to display alongside the "Regenerate" button for settings of the "generated" type. - RegenerateHelpText string `json:"regenerate_help_text,omitempty" yaml:"regenerate_help_text,omitempty"` - - // The placeholder to display for "text", "generated" and "username" types when blank. - Placeholder string `json:"placeholder" yaml:"placeholder"` - - // The default value of the setting. - Default interface{} `json:"default" yaml:"default"` - - // For "radio" or "dropdown" settings, this is the list of pre-defined options that the user can choose - // from. - Options []*PluginOption `json:"options,omitempty" yaml:"options,omitempty"` -} - -type PluginSettingsSchema struct { - // Optional text to display above the settings. - Header string `json:"header" yaml:"header"` - - // Optional text to display below the settings. - Footer string `json:"footer" yaml:"footer"` - - // A list of setting definitions. - Settings []*PluginSetting `json:"settings" yaml:"settings"` -} - -// The plugin manifest defines the metadata required to load and present your plugin. The manifest -// file should be named plugin.json or plugin.yaml and placed in the top of your -// plugin bundle. -// -// Example plugin.yaml: -// -// id: com.mycompany.myplugin -// name: My Plugin -// description: This is my plugin. It does stuff. -// backend: -// executable: myplugin -// settings_schema: -// settings: -// - key: enable_extra_thing -// type: bool -// display_name: Enable Extra Thing -// help_text: When true, an extra thing will be enabled! -// default: false -type Manifest struct { - // The id is a globally unique identifier that represents your plugin. Ids are limited - // to 190 characters. Reverse-DNS notation using a name you control is a good option. - // For example, "com.mycompany.myplugin". - Id string `json:"id" yaml:"id"` - - // The name to be displayed for the plugin. - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - // A description of what your plugin is and does. - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - // A version number for your plugin. Semantic versioning is recommended: http://semver.org - Version string `json:"version" yaml:"version"` - - // If your plugin extends the server, you'll need define backend. - Backend *ManifestBackend `json:"backend,omitempty" yaml:"backend,omitempty"` - - // If your plugin extends the web app, you'll need to define webapp. - Webapp *ManifestWebapp `json:"webapp,omitempty" yaml:"webapp,omitempty"` - - // To allow administrators to configure your plugin via the Mattermost system console, you can - // provide your settings schema. - SettingsSchema *PluginSettingsSchema `json:"settings_schema,omitempty" yaml:"settings_schema,omitempty"` -} - -type ManifestBackend struct { - // The path to your executable binary. This should be relative to the root of your bundle and the - // location of the manifest file. - // - // On Windows, this file must have a ".exe" extension. - Executable string `json:"executable" yaml:"executable"` -} - -type ManifestWebapp struct { - // The path to your webapp bundle. This should be relative to the root of your bundle and the - // location of the manifest file. - BundlePath string `json:"bundle_path" yaml:"bundle_path"` -} - -func (m *Manifest) ToJson() string { - b, _ := json.Marshal(m) - return string(b) -} - -func ManifestListToJson(m []*Manifest) string { - b, _ := json.Marshal(m) - return string(b) -} - -func ManifestFromJson(data io.Reader) *Manifest { - var m *Manifest - json.NewDecoder(data).Decode(&m) - return m -} - -func ManifestListFromJson(data io.Reader) []*Manifest { - var manifests []*Manifest - json.NewDecoder(data).Decode(&manifests) - return manifests -} - -func (m *Manifest) HasClient() bool { - return m.Webapp != nil -} - -func (m *Manifest) ClientManifest() *Manifest { - cm := new(Manifest) - *cm = *m - cm.Name = "" - cm.Description = "" - cm.Backend = nil - return cm -} - -// FindManifest will find and parse the manifest in a given directory. -// -// In all cases other than a does-not-exist error, path is set to the path of the manifest file that was -// found. -// -// Manifests are JSON or YAML files named plugin.json, plugin.yaml, or plugin.yml. -func FindManifest(dir string) (manifest *Manifest, path string, err error) { - for _, name := range []string{"plugin.yml", "plugin.yaml"} { - path = filepath.Join(dir, name) - f, ferr := os.Open(path) - if ferr != nil { - if !os.IsNotExist(ferr) { - err = ferr - return - } - continue - } - b, ioerr := ioutil.ReadAll(f) - f.Close() - if ioerr != nil { - err = ioerr - return - } - var parsed Manifest - err = yaml.Unmarshal(b, &parsed) - if err != nil { - return - } - manifest = &parsed - return - } - - path = filepath.Join(dir, "plugin.json") - f, ferr := os.Open(path) - if ferr != nil { - if os.IsNotExist(ferr) { - path = "" - } - err = ferr - return - } - defer f.Close() - var parsed Manifest - err = json.NewDecoder(f).Decode(&parsed) - if err != nil { - return - } - manifest = &parsed - return -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/message_export.go b/vendor/github.com/mattermost/mattermost-server/model/message_export.go deleted file mode 100644 index 22641dee..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/message_export.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -type MessageExport struct { - ChannelId *string - ChannelDisplayName *string - - UserId *string - UserEmail *string - Username *string - - PostId *string - PostCreateAt *int64 - PostMessage *string - PostType *string - PostFileIds StringArray -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/mfa_secret.go b/vendor/github.com/mattermost/mattermost-server/model/mfa_secret.go deleted file mode 100644 index 23a903c8..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/mfa_secret.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type MfaSecret struct { - Secret string `json:"secret"` - QRCode string `json:"qr_code"` -} - -func (me *MfaSecret) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func MfaSecretFromJson(data io.Reader) *MfaSecret { - var me *MfaSecret - json.NewDecoder(data).Decode(&me) - return me -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/oauth.go b/vendor/github.com/mattermost/mattermost-server/model/oauth.go deleted file mode 100644 index 70e8a3f2..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/oauth.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "unicode/utf8" -) - -const ( - OAUTH_ACTION_SIGNUP = "signup" - OAUTH_ACTION_LOGIN = "login" - OAUTH_ACTION_EMAIL_TO_SSO = "email_to_sso" - OAUTH_ACTION_SSO_TO_EMAIL = "sso_to_email" - OAUTH_ACTION_MOBILE = "mobile" -) - -type OAuthApp struct { - Id string `json:"id"` - CreatorId string `json:"creator_id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - ClientSecret string `json:"client_secret"` - Name string `json:"name"` - Description string `json:"description"` - IconURL string `json:"icon_url"` - CallbackUrls StringArray `json:"callback_urls"` - Homepage string `json:"homepage"` - IsTrusted bool `json:"is_trusted"` -} - -// IsValid validates the app and returns an error if it isn't configured -// correctly. -func (a *OAuthApp) IsValid() *AppError { - - if len(a.Id) != 26 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.app_id.app_error", nil, "", http.StatusBadRequest) - } - - if a.CreateAt == 0 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.create_at.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if a.UpdateAt == 0 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.update_at.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if len(a.CreatorId) != 26 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.creator_id.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if len(a.ClientSecret) == 0 || len(a.ClientSecret) > 128 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.client_secret.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if len(a.Name) == 0 || len(a.Name) > 64 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.name.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if len(a.CallbackUrls) == 0 || len(fmt.Sprintf("%s", a.CallbackUrls)) > 1024 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.callback.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - for _, callback := range a.CallbackUrls { - if !IsValidHttpUrl(callback) { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.callback.app_error", nil, "", http.StatusBadRequest) - } - } - - if len(a.Homepage) == 0 || len(a.Homepage) > 256 || !IsValidHttpUrl(a.Homepage) { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.homepage.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(a.Description) > 512 { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.description.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - - if len(a.IconURL) > 0 { - if len(a.IconURL) > 512 || !IsValidHttpUrl(a.IconURL) { - return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.icon_url.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) - } - } - - return nil -} - -// PreSave will set the Id and ClientSecret if missing. It will also fill -// in the CreateAt, UpdateAt times. It should be run before saving the app to the db. -func (a *OAuthApp) PreSave() { - if a.Id == "" { - a.Id = NewId() - } - - if a.ClientSecret == "" { - a.ClientSecret = NewId() - } - - a.CreateAt = GetMillis() - a.UpdateAt = a.CreateAt -} - -// PreUpdate should be run before updating the app in the db. -func (a *OAuthApp) PreUpdate() { - a.UpdateAt = GetMillis() -} - -// ToJson convert a User to a json string -func (a *OAuthApp) ToJson() string { - b, _ := json.Marshal(a) - return string(b) -} - -// Generate a valid strong etag so the browser can cache the results -func (a *OAuthApp) Etag() string { - return Etag(a.Id, a.UpdateAt) -} - -// Remove any private data from the app object -func (a *OAuthApp) Sanitize() { - a.ClientSecret = "" -} - -func (a *OAuthApp) IsValidRedirectURL(url string) bool { - for _, u := range a.CallbackUrls { - if u == url { - return true - } - } - - return false -} - -// OAuthAppFromJson will decode the input and return a User -func OAuthAppFromJson(data io.Reader) *OAuthApp { - var app *OAuthApp - json.NewDecoder(data).Decode(&app) - return app -} - -func OAuthAppMapToJson(a map[string]*OAuthApp) string { - b, _ := json.Marshal(a) - return string(b) -} - -func OAuthAppMapFromJson(data io.Reader) map[string]*OAuthApp { - var apps map[string]*OAuthApp - json.NewDecoder(data).Decode(&apps) - return apps -} - -func OAuthAppListToJson(l []*OAuthApp) string { - b, _ := json.Marshal(l) - return string(b) -} - -func OAuthAppListFromJson(data io.Reader) []*OAuthApp { - var o []*OAuthApp - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/outgoing_webhook.go b/vendor/github.com/mattermost/mattermost-server/model/outgoing_webhook.go deleted file mode 100644 index b5dbf34d..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/outgoing_webhook.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "strconv" - "strings" -) - -type OutgoingWebhook struct { - Id string `json:"id"` - Token string `json:"token"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - CreatorId string `json:"creator_id"` - ChannelId string `json:"channel_id"` - TeamId string `json:"team_id"` - TriggerWords StringArray `json:"trigger_words"` - TriggerWhen int `json:"trigger_when"` - CallbackURLs StringArray `json:"callback_urls"` - DisplayName string `json:"display_name"` - Description string `json:"description"` - ContentType string `json:"content_type"` -} - -type OutgoingWebhookPayload struct { - Token string `json:"token"` - TeamId string `json:"team_id"` - TeamDomain string `json:"team_domain"` - ChannelId string `json:"channel_id"` - ChannelName string `json:"channel_name"` - Timestamp int64 `json:"timestamp"` - UserId string `json:"user_id"` - UserName string `json:"user_name"` - PostId string `json:"post_id"` - Text string `json:"text"` - TriggerWord string `json:"trigger_word"` - FileIds string `json:"file_ids"` -} - -type OutgoingWebhookResponse struct { - Text *string `json:"text"` - Username string `json:"username"` - IconURL string `json:"icon_url"` - Props StringInterface `json:"props"` - Attachments []*SlackAttachment `json:"attachments"` - Type string `json:"type"` - ResponseType string `json:"response_type"` -} - -const OUTGOING_HOOK_RESPONSE_TYPE_COMMENT = "comment" - -func (o *OutgoingWebhookPayload) ToJSON() string { - b, _ := json.Marshal(o) - return string(b) -} - -func (o *OutgoingWebhookPayload) ToFormValues() string { - v := url.Values{} - v.Set("token", o.Token) - v.Set("team_id", o.TeamId) - v.Set("team_domain", o.TeamDomain) - v.Set("channel_id", o.ChannelId) - v.Set("channel_name", o.ChannelName) - v.Set("timestamp", strconv.FormatInt(o.Timestamp/1000, 10)) - v.Set("user_id", o.UserId) - v.Set("user_name", o.UserName) - v.Set("post_id", o.PostId) - v.Set("text", o.Text) - v.Set("trigger_word", o.TriggerWord) - v.Set("file_ids", o.FileIds) - - return v.Encode() -} - -func (o *OutgoingWebhook) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func OutgoingWebhookFromJson(data io.Reader) *OutgoingWebhook { - var o *OutgoingWebhook - json.NewDecoder(data).Decode(&o) - return o -} - -func OutgoingWebhookListToJson(l []*OutgoingWebhook) string { - b, _ := json.Marshal(l) - return string(b) -} - -func OutgoingWebhookListFromJson(data io.Reader) []*OutgoingWebhook { - var o []*OutgoingWebhook - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *OutgoingWebhookResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func OutgoingWebhookResponseFromJson(data io.Reader) *OutgoingWebhookResponse { - var o *OutgoingWebhookResponse - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *OutgoingWebhook) IsValid() *AppError { - - if len(o.Id) != 26 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Token) != 26 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.token.app_error", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.update_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.CreatorId) != 26 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ChannelId) != 0 && len(o.ChannelId) != 26 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.channel_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.TeamId) != 26 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.team_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(fmt.Sprintf("%s", o.TriggerWords)) > 1024 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.words.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.TriggerWords) != 0 { - for _, triggerWord := range o.TriggerWords { - if len(triggerWord) == 0 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.trigger_words.app_error", nil, "", http.StatusBadRequest) - } - } - } - - if len(o.CallbackURLs) == 0 || len(fmt.Sprintf("%s", o.CallbackURLs)) > 1024 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.callback.app_error", nil, "", http.StatusBadRequest) - } - - for _, callback := range o.CallbackURLs { - if !IsValidHttpUrl(callback) { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.url.app_error", nil, "", http.StatusBadRequest) - } - } - - if len(o.DisplayName) > 64 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.display_name.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.Description) > 128 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.description.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ContentType) > 128 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.content_type.app_error", nil, "", http.StatusBadRequest) - } - - if o.TriggerWhen > 1 { - return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.content_type.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *OutgoingWebhook) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - if o.Token == "" { - o.Token = NewId() - } - - o.CreateAt = GetMillis() - o.UpdateAt = o.CreateAt -} - -func (o *OutgoingWebhook) PreUpdate() { - o.UpdateAt = GetMillis() -} - -func (o *OutgoingWebhook) TriggerWordExactMatch(word string) bool { - if len(word) == 0 { - return false - } - - for _, trigger := range o.TriggerWords { - if trigger == word { - return true - } - } - - return false -} - -func (o *OutgoingWebhook) TriggerWordStartsWith(word string) bool { - if len(word) == 0 { - return false - } - - for _, trigger := range o.TriggerWords { - if strings.HasPrefix(word, trigger) { - return true - } - } - - return false -} - -func (o *OutgoingWebhook) GetTriggerWord(word string, isExactMatch bool) (triggerWord string) { - if len(word) == 0 { - return - } - - if isExactMatch { - for _, trigger := range o.TriggerWords { - if trigger == word { - triggerWord = trigger - break - } - } - } else { - for _, trigger := range o.TriggerWords { - if strings.HasPrefix(word, trigger) { - triggerWord = trigger - break - } - } - } - - return triggerWord -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/plugin_key_value.go b/vendor/github.com/mattermost/mattermost-server/model/plugin_key_value.go deleted file mode 100644 index b7a7731c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/plugin_key_value.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "net/http" - "unicode/utf8" -) - -const ( - KEY_VALUE_PLUGIN_ID_MAX_RUNES = 190 - KEY_VALUE_KEY_MAX_RUNES = 50 -) - -type PluginKeyValue struct { - PluginId string `json:"plugin_id"` - Key string `json:"key" db:"PKey"` - Value []byte `json:"value" db:"PValue"` -} - -func (kv *PluginKeyValue) IsValid() *AppError { - if len(kv.PluginId) == 0 || utf8.RuneCountInString(kv.PluginId) > KEY_VALUE_PLUGIN_ID_MAX_RUNES { - return NewAppError("PluginKeyValue.IsValid", "model.plugin_key_value.is_valid.plugin_id.app_error", map[string]interface{}{"Max": KEY_VALUE_KEY_MAX_RUNES, "Min": 0}, "key="+kv.Key, http.StatusBadRequest) - } - - if len(kv.Key) == 0 || utf8.RuneCountInString(kv.Key) > KEY_VALUE_KEY_MAX_RUNES { - return NewAppError("PluginKeyValue.IsValid", "model.plugin_key_value.is_valid.key.app_error", map[string]interface{}{"Max": KEY_VALUE_KEY_MAX_RUNES, "Min": 0}, "key="+kv.Key, http.StatusBadRequest) - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/plugins_response.go b/vendor/github.com/mattermost/mattermost-server/model/plugins_response.go deleted file mode 100644 index b6c01b64..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/plugins_response.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type PluginInfo struct { - Manifest - Prepackaged bool `json:"prepackaged"` -} - -type PluginsResponse struct { - Active []*PluginInfo `json:"active"` - Inactive []*PluginInfo `json:"inactive"` -} - -func (m *PluginsResponse) ToJson() string { - b, _ := json.Marshal(m) - return string(b) -} - -func PluginsResponseFromJson(data io.Reader) *PluginsResponse { - var m *PluginsResponse - json.NewDecoder(data).Decode(&m) - return m -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/post.go b/vendor/github.com/mattermost/mattermost-server/model/post.go deleted file mode 100644 index 4a774b5d..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/post.go +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "regexp" - "sort" - "strings" - "unicode/utf8" - - "github.com/mattermost/mattermost-server/utils/markdown" -) - -const ( - POST_SYSTEM_MESSAGE_PREFIX = "system_" - POST_DEFAULT = "" - POST_SLACK_ATTACHMENT = "slack_attachment" - POST_SYSTEM_GENERIC = "system_generic" - POST_JOIN_LEAVE = "system_join_leave" // Deprecated, use POST_JOIN_CHANNEL or POST_LEAVE_CHANNEL instead - POST_JOIN_CHANNEL = "system_join_channel" - POST_LEAVE_CHANNEL = "system_leave_channel" - POST_JOIN_TEAM = "system_join_team" - POST_LEAVE_TEAM = "system_leave_team" - POST_ADD_REMOVE = "system_add_remove" // Deprecated, use POST_ADD_TO_CHANNEL or POST_REMOVE_FROM_CHANNEL instead - POST_ADD_TO_CHANNEL = "system_add_to_channel" - POST_REMOVE_FROM_CHANNEL = "system_remove_from_channel" - POST_MOVE_CHANNEL = "system_move_channel" - POST_ADD_TO_TEAM = "system_add_to_team" - POST_REMOVE_FROM_TEAM = "system_remove_from_team" - POST_HEADER_CHANGE = "system_header_change" - POST_DISPLAYNAME_CHANGE = "system_displayname_change" - POST_PURPOSE_CHANGE = "system_purpose_change" - POST_CHANNEL_DELETED = "system_channel_deleted" - POST_EPHEMERAL = "system_ephemeral" - POST_CHANGE_CHANNEL_PRIVACY = "system_change_chan_privacy" - POST_FILEIDS_MAX_RUNES = 150 - POST_FILENAMES_MAX_RUNES = 4000 - POST_HASHTAGS_MAX_RUNES = 1000 - POST_MESSAGE_MAX_RUNES = 4000 - POST_PROPS_MAX_RUNES = 8000 - POST_PROPS_MAX_USER_RUNES = POST_PROPS_MAX_RUNES - 400 // Leave some room for system / pre-save modifications - POST_CUSTOM_TYPE_PREFIX = "custom_" - PROPS_ADD_CHANNEL_MEMBER = "add_channel_member" -) - -type Post struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - EditAt int64 `json:"edit_at"` - DeleteAt int64 `json:"delete_at"` - IsPinned bool `json:"is_pinned"` - UserId string `json:"user_id"` - ChannelId string `json:"channel_id"` - RootId string `json:"root_id"` - ParentId string `json:"parent_id"` - OriginalId string `json:"original_id"` - - Message string `json:"message"` - - // MessageSource will contain the message as submitted by the user if Message has been modified - // by Mattermost for presentation (e.g if an image proxy is being used). It should be used to - // populate edit boxes if present. - MessageSource string `json:"message_source,omitempty" db:"-"` - - Type string `json:"type"` - Props StringInterface `json:"props"` - Hashtags string `json:"hashtags"` - Filenames StringArray `json:"filenames,omitempty"` // Deprecated, do not use this field any more - FileIds StringArray `json:"file_ids,omitempty"` - PendingPostId string `json:"pending_post_id" db:"-"` - HasReactions bool `json:"has_reactions,omitempty"` -} - -type PostPatch struct { - IsPinned *bool `json:"is_pinned"` - Message *string `json:"message"` - Props *StringInterface `json:"props"` - FileIds *StringArray `json:"file_ids"` - HasReactions *bool `json:"has_reactions"` -} - -func (o *PostPatch) WithRewrittenImageURLs(f func(string) string) *PostPatch { - copy := *o - if copy.Message != nil { - *copy.Message = RewriteImageURLs(*o.Message, f) - } - return © -} - -type PostForIndexing struct { - Post - TeamId string `json:"team_id"` - ParentCreateAt *int64 `json:"parent_create_at"` -} - -type PostAction struct { - Id string `json:"id"` - Name string `json:"name"` - Integration *PostActionIntegration `json:"integration,omitempty"` -} - -type PostActionIntegration struct { - URL string `json:"url,omitempty"` - Context StringInterface `json:"context,omitempty"` -} - -type PostActionIntegrationRequest struct { - UserId string `json:"user_id"` - Context StringInterface `json:"context,omitempty"` -} - -type PostActionIntegrationResponse struct { - Update *Post `json:"update"` - EphemeralText string `json:"ephemeral_text"` -} - -func (o *Post) ToJson() string { - copy := *o - copy.StripActionIntegrations() - b, _ := json.Marshal(©) - return string(b) -} - -func (o *Post) ToUnsanitizedJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func PostFromJson(data io.Reader) *Post { - var o *Post - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *Post) Etag() string { - return Etag(o.Id, o.UpdateAt) -} - -func (o *Post) IsValid() *AppError { - - if len(o.Id) != 26 { - return NewAppError("Post.IsValid", "model.post.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("Post.IsValid", "model.post.is_valid.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("Post.IsValid", "model.post.is_valid.update_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.UserId) != 26 { - return NewAppError("Post.IsValid", "model.post.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ChannelId) != 26 { - return NewAppError("Post.IsValid", "model.post.is_valid.channel_id.app_error", nil, "", http.StatusBadRequest) - } - - if !(len(o.RootId) == 26 || len(o.RootId) == 0) { - return NewAppError("Post.IsValid", "model.post.is_valid.root_id.app_error", nil, "", http.StatusBadRequest) - } - - if !(len(o.ParentId) == 26 || len(o.ParentId) == 0) { - return NewAppError("Post.IsValid", "model.post.is_valid.parent_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.ParentId) == 26 && len(o.RootId) == 0 { - return NewAppError("Post.IsValid", "model.post.is_valid.root_parent.app_error", nil, "", http.StatusBadRequest) - } - - if !(len(o.OriginalId) == 26 || len(o.OriginalId) == 0) { - return NewAppError("Post.IsValid", "model.post.is_valid.original_id.app_error", nil, "", http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.Message) > POST_MESSAGE_MAX_RUNES { - return NewAppError("Post.IsValid", "model.post.is_valid.msg.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.Hashtags) > POST_HASHTAGS_MAX_RUNES { - return NewAppError("Post.IsValid", "model.post.is_valid.hashtags.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - switch o.Type { - case - POST_DEFAULT, - POST_JOIN_LEAVE, - POST_ADD_REMOVE, - POST_JOIN_CHANNEL, - POST_LEAVE_CHANNEL, - POST_JOIN_TEAM, - POST_LEAVE_TEAM, - POST_ADD_TO_CHANNEL, - POST_REMOVE_FROM_CHANNEL, - POST_MOVE_CHANNEL, - POST_ADD_TO_TEAM, - POST_REMOVE_FROM_TEAM, - POST_SLACK_ATTACHMENT, - POST_HEADER_CHANGE, - POST_PURPOSE_CHANGE, - POST_DISPLAYNAME_CHANGE, - POST_CHANNEL_DELETED, - POST_CHANGE_CHANNEL_PRIVACY: - default: - if !strings.HasPrefix(o.Type, POST_CUSTOM_TYPE_PREFIX) { - return NewAppError("Post.IsValid", "model.post.is_valid.type.app_error", nil, "id="+o.Type, http.StatusBadRequest) - } - } - - if utf8.RuneCountInString(ArrayToJson(o.Filenames)) > POST_FILENAMES_MAX_RUNES { - return NewAppError("Post.IsValid", "model.post.is_valid.filenames.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(ArrayToJson(o.FileIds)) > POST_FILEIDS_MAX_RUNES { - return NewAppError("Post.IsValid", "model.post.is_valid.file_ids.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(StringInterfaceToJson(o.Props)) > POST_PROPS_MAX_RUNES { - return NewAppError("Post.IsValid", "model.post.is_valid.props.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - return nil -} - -func (o *Post) SanitizeProps() { - membersToSanitize := []string{ - PROPS_ADD_CHANNEL_MEMBER, - } - - for _, member := range membersToSanitize { - if _, ok := o.Props[member]; ok { - delete(o.Props, member) - } - } -} - -func (o *Post) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - o.OriginalId = "" - - if o.CreateAt == 0 { - o.CreateAt = GetMillis() - } - - o.UpdateAt = o.CreateAt - o.PreCommit() -} - -func (o *Post) PreCommit() { - if o.Props == nil { - o.Props = make(map[string]interface{}) - } - - if o.Filenames == nil { - o.Filenames = []string{} - } - - if o.FileIds == nil { - o.FileIds = []string{} - } - - o.GenerateActionIds() -} - -func (o *Post) MakeNonNil() { - if o.Props == nil { - o.Props = make(map[string]interface{}) - } -} - -func (o *Post) AddProp(key string, value interface{}) { - - o.MakeNonNil() - - o.Props[key] = value -} - -func (o *Post) IsSystemMessage() bool { - return len(o.Type) >= len(POST_SYSTEM_MESSAGE_PREFIX) && o.Type[:len(POST_SYSTEM_MESSAGE_PREFIX)] == POST_SYSTEM_MESSAGE_PREFIX -} - -func (p *Post) Patch(patch *PostPatch) { - if patch.IsPinned != nil { - p.IsPinned = *patch.IsPinned - } - - if patch.Message != nil { - p.Message = *patch.Message - } - - if patch.Props != nil { - p.Props = *patch.Props - } - - if patch.FileIds != nil { - p.FileIds = *patch.FileIds - } - - if patch.HasReactions != nil { - p.HasReactions = *patch.HasReactions - } -} - -func (o *PostPatch) ToJson() string { - b, err := json.Marshal(o) - if err != nil { - return "" - } - - return string(b) -} - -func PostPatchFromJson(data io.Reader) *PostPatch { - decoder := json.NewDecoder(data) - var post PostPatch - err := decoder.Decode(&post) - if err != nil { - return nil - } - - return &post -} - -var channelMentionRegexp = regexp.MustCompile(`\B~[a-zA-Z0-9\-_]+`) - -func (o *Post) ChannelMentions() (names []string) { - if strings.Contains(o.Message, "~") { - alreadyMentioned := make(map[string]bool) - for _, match := range channelMentionRegexp.FindAllString(o.Message, -1) { - name := match[1:] - if !alreadyMentioned[name] { - names = append(names, name) - alreadyMentioned[name] = true - } - } - } - return -} - -func (r *PostActionIntegrationRequest) ToJson() string { - b, _ := json.Marshal(r) - return string(b) -} - -func (o *Post) Attachments() []*SlackAttachment { - if attachments, ok := o.Props["attachments"].([]*SlackAttachment); ok { - return attachments - } - var ret []*SlackAttachment - if attachments, ok := o.Props["attachments"].([]interface{}); ok { - for _, attachment := range attachments { - if enc, err := json.Marshal(attachment); err == nil { - var decoded SlackAttachment - if json.Unmarshal(enc, &decoded) == nil { - ret = append(ret, &decoded) - } - } - } - } - return ret -} - -func (o *Post) StripActionIntegrations() { - attachments := o.Attachments() - if o.Props["attachments"] != nil { - o.Props["attachments"] = attachments - } - for _, attachment := range attachments { - for _, action := range attachment.Actions { - action.Integration = nil - } - } -} - -func (o *Post) GetAction(id string) *PostAction { - for _, attachment := range o.Attachments() { - for _, action := range attachment.Actions { - if action.Id == id { - return action - } - } - } - return nil -} - -func (o *Post) GenerateActionIds() { - if o.Props["attachments"] != nil { - o.Props["attachments"] = o.Attachments() - } - if attachments, ok := o.Props["attachments"].([]*SlackAttachment); ok { - for _, attachment := range attachments { - for _, action := range attachment.Actions { - if action.Id == "" { - action.Id = NewId() - } - } - } - } -} - -var markdownDestinationEscaper = strings.NewReplacer( - `\`, `\\`, - `<`, `\<`, - `>`, `\>`, - `(`, `\(`, - `)`, `\)`, -) - -// WithRewrittenImageURLs returns a new shallow copy of the post where the message has been -// rewritten via RewriteImageURLs. -func (o *Post) WithRewrittenImageURLs(f func(string) string) *Post { - copy := *o - copy.Message = RewriteImageURLs(o.Message, f) - if copy.MessageSource == "" && copy.Message != o.Message { - copy.MessageSource = o.Message - } - return © -} - -// RewriteImageURLs takes a message and returns a copy that has all of the image URLs replaced -// according to the function f. For each image URL, f will be invoked, and the resulting markdown -// will contain the URL returned by that invocation instead. -// -// Image URLs are destination URLs used in inline images or reference definitions that are used -// anywhere in the input markdown as an image. -func RewriteImageURLs(message string, f func(string) string) string { - if !strings.Contains(message, "![") { - return message - } - - var ranges []markdown.Range - - markdown.Inspect(message, func(blockOrInline interface{}) bool { - switch v := blockOrInline.(type) { - case *markdown.ReferenceImage: - ranges = append(ranges, v.ReferenceDefinition.RawDestination) - case *markdown.InlineImage: - ranges = append(ranges, v.RawDestination) - default: - return true - } - return true - }) - - if ranges == nil { - return message - } - - sort.Slice(ranges, func(i, j int) bool { - return ranges[i].Position < ranges[j].Position - }) - - copyRanges := make([]markdown.Range, 0, len(ranges)) - urls := make([]string, 0, len(ranges)) - resultLength := len(message) - - start := 0 - for i, r := range ranges { - switch { - case i == 0: - case r.Position != ranges[i-1].Position: - start = ranges[i-1].End - default: - continue - } - original := message[r.Position:r.End] - replacement := markdownDestinationEscaper.Replace(f(markdown.Unescape(original))) - resultLength += len(replacement) - len(original) - copyRanges = append(copyRanges, markdown.Range{Position: start, End: r.Position}) - urls = append(urls, replacement) - } - - result := make([]byte, resultLength) - - offset := 0 - for i, r := range copyRanges { - offset += copy(result[offset:], message[r.Position:r.End]) - offset += copy(result[offset:], urls[i]) - } - copy(result[offset:], message[ranges[len(ranges)-1].End:]) - - return string(result) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/post_list.go b/vendor/github.com/mattermost/mattermost-server/model/post_list.go deleted file mode 100644 index 27c22e7b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/post_list.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "sort" -) - -type PostList struct { - Order []string `json:"order"` - Posts map[string]*Post `json:"posts"` -} - -func NewPostList() *PostList { - return &PostList{ - Order: make([]string, 0), - Posts: make(map[string]*Post), - } -} - -func (o *PostList) WithRewrittenImageURLs(f func(string) string) *PostList { - copy := *o - copy.Posts = make(map[string]*Post) - for id, post := range o.Posts { - copy.Posts[id] = post.WithRewrittenImageURLs(f) - } - return © -} - -func (o *PostList) StripActionIntegrations() { - posts := o.Posts - o.Posts = make(map[string]*Post) - for id, post := range posts { - pcopy := *post - pcopy.StripActionIntegrations() - o.Posts[id] = &pcopy - } -} - -func (o *PostList) ToJson() string { - copy := *o - copy.StripActionIntegrations() - b, err := json.Marshal(©) - if err != nil { - return "" - } else { - return string(b) - } -} - -func (o *PostList) MakeNonNil() { - if o.Order == nil { - o.Order = make([]string, 0) - } - - if o.Posts == nil { - o.Posts = make(map[string]*Post) - } - - for _, v := range o.Posts { - v.MakeNonNil() - } -} - -func (o *PostList) AddOrder(id string) { - - if o.Order == nil { - o.Order = make([]string, 0, 128) - } - - o.Order = append(o.Order, id) -} - -func (o *PostList) AddPost(post *Post) { - - if o.Posts == nil { - o.Posts = make(map[string]*Post) - } - - o.Posts[post.Id] = post -} - -func (o *PostList) Extend(other *PostList) { - for _, postId := range other.Order { - if _, ok := o.Posts[postId]; !ok { - o.AddPost(other.Posts[postId]) - o.AddOrder(postId) - } - } -} - -func (o *PostList) SortByCreateAt() { - sort.Slice(o.Order, func(i, j int) bool { - return o.Posts[o.Order[i]].CreateAt > o.Posts[o.Order[j]].CreateAt - }) -} - -func (o *PostList) Etag() string { - - id := "0" - var t int64 = 0 - - for _, v := range o.Posts { - if v.UpdateAt > t { - t = v.UpdateAt - id = v.Id - } else if v.UpdateAt == t && v.Id > id { - t = v.UpdateAt - id = v.Id - } - } - - orderId := "" - if len(o.Order) > 0 { - orderId = o.Order[0] - } - - return Etag(orderId, id, t) -} - -func (o *PostList) IsChannelId(channelId string) bool { - for _, v := range o.Posts { - if v.ChannelId != channelId { - return false - } - } - - return true -} - -func PostListFromJson(data io.Reader) *PostList { - var o *PostList - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/preference.go b/vendor/github.com/mattermost/mattermost-server/model/preference.go deleted file mode 100644 index dc97314c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/preference.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "regexp" - "strings" - "unicode/utf8" -) - -const ( - PREFERENCE_CATEGORY_DIRECT_CHANNEL_SHOW = "direct_channel_show" - PREFERENCE_CATEGORY_TUTORIAL_STEPS = "tutorial_step" - PREFERENCE_CATEGORY_ADVANCED_SETTINGS = "advanced_settings" - PREFERENCE_CATEGORY_FLAGGED_POST = "flagged_post" - PREFERENCE_CATEGORY_FAVORITE_CHANNEL = "favorite_channel" - - PREFERENCE_CATEGORY_DISPLAY_SETTINGS = "display_settings" - PREFERENCE_NAME_COLLAPSE_SETTING = "collapse_previews" - - PREFERENCE_CATEGORY_THEME = "theme" - // the name for theme props is the team id - - PREFERENCE_CATEGORY_AUTHORIZED_OAUTH_APP = "oauth_app" - // the name for oauth_app is the client_id and value is the current scope - - PREFERENCE_CATEGORY_LAST = "last" - PREFERENCE_NAME_LAST_CHANNEL = "channel" - PREFERENCE_NAME_LAST_TEAM = "team" - - PREFERENCE_CATEGORY_NOTIFICATIONS = "notifications" - PREFERENCE_NAME_EMAIL_INTERVAL = "email_interval" - - PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS = "30" // the "immediate" setting is actually 30s - PREFERENCE_EMAIL_INTERVAL_BATCHING_SECONDS = "900" // fifteen minutes is 900 seconds -) - -type Preference struct { - UserId string `json:"user_id"` - Category string `json:"category"` - Name string `json:"name"` - Value string `json:"value"` -} - -func (o *Preference) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func PreferenceFromJson(data io.Reader) *Preference { - var o *Preference - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *Preference) IsValid() *AppError { - if len(o.UserId) != 26 { - return NewAppError("Preference.IsValid", "model.preference.is_valid.id.app_error", nil, "user_id="+o.UserId, http.StatusBadRequest) - } - - if len(o.Category) == 0 || len(o.Category) > 32 { - return NewAppError("Preference.IsValid", "model.preference.is_valid.category.app_error", nil, "category="+o.Category, http.StatusBadRequest) - } - - if len(o.Name) > 32 { - return NewAppError("Preference.IsValid", "model.preference.is_valid.name.app_error", nil, "name="+o.Name, http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.Value) > 2000 { - return NewAppError("Preference.IsValid", "model.preference.is_valid.value.app_error", nil, "value="+o.Value, http.StatusBadRequest) - } - - if o.Category == PREFERENCE_CATEGORY_THEME { - var unused map[string]string - if err := json.NewDecoder(strings.NewReader(o.Value)).Decode(&unused); err != nil { - return NewAppError("Preference.IsValid", "model.preference.is_valid.theme.app_error", nil, "value="+o.Value, http.StatusBadRequest) - } - } - - return nil -} - -func (o *Preference) PreUpdate() { - if o.Category == PREFERENCE_CATEGORY_THEME { - // decode the value of theme (a map of strings to string) and eliminate any invalid values - var props map[string]string - if err := json.NewDecoder(strings.NewReader(o.Value)).Decode(&props); err != nil { - // just continue, the invalid preference value should get caught by IsValid before saving - return - } - - colorPattern := regexp.MustCompile(`^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$`) - - // blank out any invalid theme values - for name, value := range props { - if name == "image" || name == "type" || name == "codeTheme" { - continue - } - - if !colorPattern.MatchString(value) { - props[name] = "#ffffff" - } - } - - if b, err := json.Marshal(props); err == nil { - o.Value = string(b) - } - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/preferences.go b/vendor/github.com/mattermost/mattermost-server/model/preferences.go deleted file mode 100644 index 172e1aa8..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/preferences.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type Preferences []Preference - -func (o *Preferences) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func PreferencesFromJson(data io.Reader) (Preferences, error) { - decoder := json.NewDecoder(data) - var o Preferences - err := decoder.Decode(&o) - if err == nil { - return o, nil - } else { - return nil, err - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/push_notification.go b/vendor/github.com/mattermost/mattermost-server/model/push_notification.go deleted file mode 100644 index 0d7ba77a..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/push_notification.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "strings" -) - -const ( - PUSH_NOTIFY_APPLE = "apple" - PUSH_NOTIFY_ANDROID = "android" - PUSH_NOTIFY_APPLE_REACT_NATIVE = "apple_rn" - PUSH_NOTIFY_ANDROID_REACT_NATIVE = "android_rn" - - PUSH_TYPE_MESSAGE = "message" - PUSH_TYPE_CLEAR = "clear" - - // The category is set to handle a set of interactive Actions - // with the push notifications - CATEGORY_CAN_REPLY = "CAN_REPLY" - - MHPNS = "https://push.mattermost.com" -) - -type PushNotification struct { - Platform string `json:"platform"` - ServerId string `json:"server_id"` - DeviceId string `json:"device_id"` - Category string `json:"category"` - Sound string `json:"sound"` - Message string `json:"message"` - Badge int `json:"badge"` - ContentAvailable int `json:"cont_ava"` - TeamId string `json:"team_id"` - ChannelId string `json:"channel_id"` - PostId string `json:"post_id"` - RootId string `json:"root_id"` - ChannelName string `json:"channel_name"` - Type string `json:"type"` - SenderId string `json:"sender_id"` - OverrideUsername string `json:"override_username"` - OverrideIconUrl string `json:"override_icon_url"` - FromWebhook string `json:"from_webhook"` -} - -func (me *PushNotification) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) { - - index := strings.Index(deviceId, ":") - - if index > -1 { - me.Platform = deviceId[:index] - me.DeviceId = deviceId[index+1:] - } -} - -func PushNotificationFromJson(data io.Reader) *PushNotification { - var me *PushNotification - json.NewDecoder(data).Decode(&me) - return me -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/push_response.go b/vendor/github.com/mattermost/mattermost-server/model/push_response.go deleted file mode 100644 index 1434a2b1..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/push_response.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -const ( - PUSH_STATUS = "status" - PUSH_STATUS_OK = "OK" - PUSH_STATUS_FAIL = "FAIL" - PUSH_STATUS_REMOVE = "REMOVE" - PUSH_STATUS_ERROR_MSG = "error" -) - -type PushResponse map[string]string - -func NewOkPushResponse() PushResponse { - m := make(map[string]string) - m[PUSH_STATUS] = PUSH_STATUS_OK - return m -} - -func NewRemovePushResponse() PushResponse { - m := make(map[string]string) - m[PUSH_STATUS] = PUSH_STATUS_REMOVE - return m -} - -func NewErrorPushResponse(message string) PushResponse { - m := make(map[string]string) - m[PUSH_STATUS] = PUSH_STATUS_FAIL - m[PUSH_STATUS_ERROR_MSG] = message - return m -} - -func (me *PushResponse) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func PushResponseFromJson(data io.Reader) PushResponse { - decoder := json.NewDecoder(data) - - var objmap PushResponse - if err := decoder.Decode(&objmap); err != nil { - return make(map[string]string) - } else { - return objmap - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/reaction.go b/vendor/github.com/mattermost/mattermost-server/model/reaction.go deleted file mode 100644 index c1b9c499..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/reaction.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "regexp" -) - -type Reaction struct { - UserId string `json:"user_id"` - PostId string `json:"post_id"` - EmojiName string `json:"emoji_name"` - CreateAt int64 `json:"create_at"` -} - -func (o *Reaction) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func ReactionFromJson(data io.Reader) *Reaction { - var o Reaction - - if err := json.NewDecoder(data).Decode(&o); err != nil { - return nil - } else { - return &o - } -} - -func ReactionsToJson(o []*Reaction) string { - b, _ := json.Marshal(o) - return string(b) -} - -func ReactionsFromJson(data io.Reader) []*Reaction { - var o []*Reaction - - if err := json.NewDecoder(data).Decode(&o); err != nil { - return nil - } else { - return o - } -} - -func (o *Reaction) IsValid() *AppError { - if len(o.UserId) != 26 { - return NewAppError("Reaction.IsValid", "model.reaction.is_valid.user_id.app_error", nil, "user_id="+o.UserId, http.StatusBadRequest) - } - - if len(o.PostId) != 26 { - return NewAppError("Reaction.IsValid", "model.reaction.is_valid.post_id.app_error", nil, "post_id="+o.PostId, http.StatusBadRequest) - } - - validName := regexp.MustCompile(`^[a-zA-Z0-9\-\+_]+$`) - - if len(o.EmojiName) == 0 || len(o.EmojiName) > EMOJI_NAME_MAX_LENGTH || !validName.MatchString(o.EmojiName) { - return NewAppError("Reaction.IsValid", "model.reaction.is_valid.emoji_name.app_error", nil, "emoji_name="+o.EmojiName, http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("Reaction.IsValid", "model.reaction.is_valid.create_at.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *Reaction) PreSave() { - if o.CreateAt == 0 { - o.CreateAt = GetMillis() - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/saml.go b/vendor/github.com/mattermost/mattermost-server/model/saml.go deleted file mode 100644 index e7475015..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/saml.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -const ( - USER_AUTH_SERVICE_SAML = "saml" - USER_AUTH_SERVICE_SAML_TEXT = "With SAML" - SAML_IDP_CERTIFICATE = 1 - SAML_PRIVATE_KEY = 2 - SAML_PUBLIC_CERT = 3 -) - -type SamlAuthRequest struct { - Base64AuthRequest string - URL string - RelayState string -} - -type SamlCertificateStatus struct { - IdpCertificateFile bool `json:"idp_certificate_file"` - PrivateKeyFile bool `json:"private_key_file"` - PublicCertificateFile bool `json:"public_certificate_file"` -} - -func (s *SamlCertificateStatus) ToJson() string { - b, _ := json.Marshal(s) - return string(b) -} - -func SamlCertificateStatusFromJson(data io.Reader) *SamlCertificateStatus { - var status *SamlCertificateStatus - json.NewDecoder(data).Decode(&status) - return status -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/scheduled_task.go b/vendor/github.com/mattermost/mattermost-server/model/scheduled_task.go deleted file mode 100644 index 453828bd..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/scheduled_task.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "fmt" - "sync" - "time" -) - -type TaskFunc func() - -type ScheduledTask struct { - Name string `json:"name"` - Interval time.Duration `json:"interval"` - Recurring bool `json:"recurring"` - function TaskFunc - timer *time.Timer -} - -var taskMutex = sync.Mutex{} -var tasks = make(map[string]*ScheduledTask) - -func addTask(task *ScheduledTask) { - taskMutex.Lock() - defer taskMutex.Unlock() - tasks[task.Name] = task -} - -func removeTaskByName(name string) { - taskMutex.Lock() - defer taskMutex.Unlock() - delete(tasks, name) -} - -func GetTaskByName(name string) *ScheduledTask { - taskMutex.Lock() - defer taskMutex.Unlock() - if task, ok := tasks[name]; ok { - return task - } - return nil -} - -func GetAllTasks() *map[string]*ScheduledTask { - taskMutex.Lock() - defer taskMutex.Unlock() - return &tasks -} - -func CreateTask(name string, function TaskFunc, timeToExecution time.Duration) *ScheduledTask { - task := &ScheduledTask{ - Name: name, - Interval: timeToExecution, - Recurring: false, - function: function, - } - - taskRunner := func() { - go task.function() - removeTaskByName(task.Name) - } - - task.timer = time.AfterFunc(timeToExecution, taskRunner) - - addTask(task) - - return task -} - -func CreateRecurringTask(name string, function TaskFunc, interval time.Duration) *ScheduledTask { - task := &ScheduledTask{ - Name: name, - Interval: interval, - Recurring: true, - function: function, - } - - taskRecurer := func() { - go task.function() - task.timer.Reset(task.Interval) - } - - task.timer = time.AfterFunc(interval, taskRecurer) - - addTask(task) - - return task -} - -func (task *ScheduledTask) Cancel() { - task.timer.Stop() - removeTaskByName(task.Name) -} - -// Executes the task immediatly. A recurring task will be run regularally after interval. -func (task *ScheduledTask) Execute() { - task.function() - task.timer.Reset(task.Interval) -} - -func (task *ScheduledTask) String() string { - return fmt.Sprintf( - "%s\nInterval: %s\nRecurring: %t\n", - task.Name, - task.Interval.String(), - task.Recurring, - ) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/search_params.go b/vendor/github.com/mattermost/mattermost-server/model/search_params.go deleted file mode 100644 index 1692b3aa..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/search_params.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "regexp" - "strings" -) - -var searchTermPuncStart = regexp.MustCompile(`^[^\pL\d\s#"]+`) -var searchTermPuncEnd = regexp.MustCompile(`[^\pL\d\s*"]+$`) - -type SearchParams struct { - Terms string - IsHashtag bool - InChannels []string - FromUsers []string - OrTerms bool -} - -func (o *SearchParams) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -var searchFlags = [...]string{"from", "channel", "in"} - -func splitWords(text string) []string { - words := []string{} - - foundQuote := false - location := 0 - for i, char := range text { - if char == '"' { - if foundQuote { - // Grab the quoted section - word := text[location : i+1] - words = append(words, word) - foundQuote = false - location = i + 1 - } else { - words = append(words, strings.Fields(text[location:i])...) - foundQuote = true - location = i - } - } - } - - words = append(words, strings.Fields(text[location:])...) - - return words -} - -func parseSearchFlags(input []string) ([]string, [][2]string) { - words := []string{} - flags := [][2]string{} - - skipNextWord := false - for i, word := range input { - if skipNextWord { - skipNextWord = false - continue - } - - isFlag := false - - if colon := strings.Index(word, ":"); colon != -1 { - flag := word[:colon] - value := word[colon+1:] - - for _, searchFlag := range searchFlags { - // check for case insensitive equality - if strings.EqualFold(flag, searchFlag) { - if value != "" { - flags = append(flags, [2]string{searchFlag, value}) - isFlag = true - } else if i < len(input)-1 { - flags = append(flags, [2]string{searchFlag, input[i+1]}) - skipNextWord = true - isFlag = true - } - - if isFlag { - break - } - } - } - } - - if !isFlag { - // trim off surrounding punctuation (note that we leave trailing asterisks to allow wildcards) - word = searchTermPuncStart.ReplaceAllString(word, "") - word = searchTermPuncEnd.ReplaceAllString(word, "") - - // and remove extra pound #s - word = hashtagStart.ReplaceAllString(word, "#") - - if len(word) != 0 { - words = append(words, word) - } - } - } - - return words, flags -} - -func ParseSearchParams(text string) []*SearchParams { - words, flags := parseSearchFlags(splitWords(text)) - - hashtagTermList := []string{} - plainTermList := []string{} - - for _, word := range words { - if validHashtag.MatchString(word) { - hashtagTermList = append(hashtagTermList, word) - } else { - plainTermList = append(plainTermList, word) - } - } - - hashtagTerms := strings.Join(hashtagTermList, " ") - plainTerms := strings.Join(plainTermList, " ") - - inChannels := []string{} - fromUsers := []string{} - - for _, flagPair := range flags { - flag := flagPair[0] - value := flagPair[1] - - if flag == "in" || flag == "channel" { - inChannels = append(inChannels, value) - } else if flag == "from" { - fromUsers = append(fromUsers, value) - } - } - - paramsList := []*SearchParams{} - - if len(plainTerms) > 0 { - paramsList = append(paramsList, &SearchParams{ - Terms: plainTerms, - IsHashtag: false, - InChannels: inChannels, - FromUsers: fromUsers, - }) - } - - if len(hashtagTerms) > 0 { - paramsList = append(paramsList, &SearchParams{ - Terms: hashtagTerms, - IsHashtag: true, - InChannels: inChannels, - FromUsers: fromUsers, - }) - } - - // special case for when no terms are specified but we still have a filter - if len(plainTerms) == 0 && len(hashtagTerms) == 0 && (len(inChannels) != 0 || len(fromUsers) != 0) { - paramsList = append(paramsList, &SearchParams{ - Terms: "", - IsHashtag: false, - InChannels: inChannels, - FromUsers: fromUsers, - }) - } - - return paramsList -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/security_bulletin.go b/vendor/github.com/mattermost/mattermost-server/model/security_bulletin.go deleted file mode 100644 index 958b9c9e..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/security_bulletin.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type SecurityBulletin struct { - Id string `json:"id"` - AppliesToVersion string `json:"applies_to_version"` -} - -type SecurityBulletins []SecurityBulletin - -func (me *SecurityBulletin) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func SecurityBulletinFromJson(data io.Reader) *SecurityBulletin { - var o *SecurityBulletin - json.NewDecoder(data).Decode(&o) - return o -} - -func (me SecurityBulletins) ToJson() string { - if b, err := json.Marshal(me); err != nil { - return "[]" - } else { - return string(b) - } -} - -func SecurityBulletinsFromJson(data io.Reader) SecurityBulletins { - var o SecurityBulletins - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/session.go b/vendor/github.com/mattermost/mattermost-server/model/session.go deleted file mode 100644 index a407af26..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/session.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "strings" -) - -const ( - SESSION_COOKIE_TOKEN = "MMAUTHTOKEN" - SESSION_COOKIE_USER = "MMUSERID" - SESSION_CACHE_SIZE = 35000 - SESSION_PROP_PLATFORM = "platform" - SESSION_PROP_OS = "os" - SESSION_PROP_BROWSER = "browser" - SESSION_PROP_TYPE = "type" - SESSION_PROP_USER_ACCESS_TOKEN_ID = "user_access_token_id" - SESSION_TYPE_USER_ACCESS_TOKEN = "UserAccessToken" - SESSION_ACTIVITY_TIMEOUT = 1000 * 60 * 5 // 5 minutes - SESSION_USER_ACCESS_TOKEN_EXPIRY = 100 * 365 // 100 years -) - -type Session struct { - Id string `json:"id"` - Token string `json:"token"` - CreateAt int64 `json:"create_at"` - ExpiresAt int64 `json:"expires_at"` - LastActivityAt int64 `json:"last_activity_at"` - UserId string `json:"user_id"` - DeviceId string `json:"device_id"` - Roles string `json:"roles"` - IsOAuth bool `json:"is_oauth"` - Props StringMap `json:"props"` - TeamMembers []*TeamMember `json:"team_members" db:"-"` -} - -func (me *Session) DeepCopy() *Session { - copy := *me - return © -} - -func (me *Session) ToJson() string { - b, _ := json.Marshal(me) - return string(b) -} - -func SessionFromJson(data io.Reader) *Session { - var me *Session - json.NewDecoder(data).Decode(&me) - return me -} - -func (me *Session) PreSave() { - if me.Id == "" { - me.Id = NewId() - } - - if me.Token == "" { - me.Token = NewId() - } - - me.CreateAt = GetMillis() - me.LastActivityAt = me.CreateAt - - if me.Props == nil { - me.Props = make(map[string]string) - } -} - -func (me *Session) Sanitize() { - me.Token = "" -} - -func (me *Session) IsExpired() bool { - - if me.ExpiresAt <= 0 { - return false - } - - if GetMillis() > me.ExpiresAt { - return true - } - - return false -} - -func (me *Session) SetExpireInDays(days int) { - if me.CreateAt == 0 { - me.ExpiresAt = GetMillis() + (1000 * 60 * 60 * 24 * int64(days)) - } else { - me.ExpiresAt = me.CreateAt + (1000 * 60 * 60 * 24 * int64(days)) - } -} - -func (me *Session) AddProp(key string, value string) { - - if me.Props == nil { - me.Props = make(map[string]string) - } - - me.Props[key] = value -} - -func (me *Session) GetTeamByTeamId(teamId string) *TeamMember { - for _, team := range me.TeamMembers { - if team.TeamId == teamId { - return team - } - } - - return nil -} - -func (me *Session) IsMobileApp() bool { - return len(me.DeviceId) > 0 -} - -func (me *Session) GetUserRoles() []string { - return strings.Fields(me.Roles) -} - -func SessionsToJson(o []*Session) string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func SessionsFromJson(data io.Reader) []*Session { - var o []*Session - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/slack_attachment.go b/vendor/github.com/mattermost/mattermost-server/model/slack_attachment.go deleted file mode 100644 index 197d3f0f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/slack_attachment.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "fmt" -) - -type SlackAttachment struct { - Id int64 `json:"id"` - Fallback string `json:"fallback"` - Color string `json:"color"` - Pretext string `json:"pretext"` - AuthorName string `json:"author_name"` - AuthorLink string `json:"author_link"` - AuthorIcon string `json:"author_icon"` - Title string `json:"title"` - TitleLink string `json:"title_link"` - Text string `json:"text"` - Fields []*SlackAttachmentField `json:"fields"` - ImageURL string `json:"image_url"` - ThumbURL string `json:"thumb_url"` - Footer string `json:"footer"` - FooterIcon string `json:"footer_icon"` - Timestamp interface{} `json:"ts"` // This is either a string or an int64 - Actions []*PostAction `json:"actions,omitempty"` -} - -type SlackAttachmentField struct { - Title string `json:"title"` - Value interface{} `json:"value"` - Short bool `json:"short"` -} - -func StringifySlackFieldValue(a []*SlackAttachment) []*SlackAttachment { - var nonNilAttachments []*SlackAttachment - for _, attachment := range a { - if attachment == nil { - continue - } - nonNilAttachments = append(nonNilAttachments, attachment) - - var nonNilFields []*SlackAttachmentField - for _, field := range attachment.Fields { - if field == nil { - continue - } - nonNilFields = append(nonNilFields, field) - - if field.Value != nil { - // Ensure the value is set to a string if it is set - field.Value = fmt.Sprintf("%v", field.Value) - } - } - attachment.Fields = nonNilFields - } - return nonNilAttachments -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/status.go b/vendor/github.com/mattermost/mattermost-server/model/status.go deleted file mode 100644 index cd9e32ed..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/status.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -const ( - STATUS_OFFLINE = "offline" - STATUS_AWAY = "away" - STATUS_DND = "dnd" - STATUS_ONLINE = "online" - STATUS_CACHE_SIZE = SESSION_CACHE_SIZE - STATUS_CHANNEL_TIMEOUT = 20000 // 20 seconds - STATUS_MIN_UPDATE_TIME = 120000 // 2 minutes -) - -type Status struct { - UserId string `json:"user_id"` - Status string `json:"status"` - Manual bool `json:"manual"` - LastActivityAt int64 `json:"last_activity_at"` - ActiveChannel string `json:"-" db:"-"` -} - -func (o *Status) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func StatusFromJson(data io.Reader) *Status { - var o *Status - json.NewDecoder(data).Decode(&o) - return o -} - -func StatusListToJson(u []*Status) string { - b, _ := json.Marshal(u) - return string(b) -} - -func StatusListFromJson(data io.Reader) []*Status { - var statuses []*Status - json.NewDecoder(data).Decode(&statuses) - return statuses -} - -func StatusMapToInterfaceMap(statusMap map[string]*Status) map[string]interface{} { - interfaceMap := map[string]interface{}{} - for _, s := range statusMap { - // Omitted statues mean offline - if s.Status != STATUS_OFFLINE { - interfaceMap[s.UserId] = s.Status - } - } - return interfaceMap -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/suggest_command.go b/vendor/github.com/mattermost/mattermost-server/model/suggest_command.go deleted file mode 100644 index 44f46bf7..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/suggest_command.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type SuggestCommand struct { - Suggestion string `json:"suggestion"` - Description string `json:"description"` -} - -func (o *SuggestCommand) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func SuggestCommandFromJson(data io.Reader) *SuggestCommand { - var o *SuggestCommand - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/switch_request.go b/vendor/github.com/mattermost/mattermost-server/model/switch_request.go deleted file mode 100644 index e153c92f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/switch_request.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type SwitchRequest struct { - CurrentService string `json:"current_service"` - NewService string `json:"new_service"` - Email string `json:"email"` - Password string `json:"password"` - NewPassword string `json:"new_password"` - MfaCode string `json:"mfa_code"` - LdapId string `json:"ldap_id"` -} - -func (o *SwitchRequest) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func SwitchRequestFromJson(data io.Reader) *SwitchRequest { - var o *SwitchRequest - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *SwitchRequest) EmailToOAuth() bool { - return o.CurrentService == USER_AUTH_SERVICE_EMAIL && - (o.NewService == USER_AUTH_SERVICE_SAML || - o.NewService == USER_AUTH_SERVICE_GITLAB || - o.NewService == SERVICE_GOOGLE || - o.NewService == SERVICE_OFFICE365) -} - -func (o *SwitchRequest) OAuthToEmail() bool { - return (o.CurrentService == USER_AUTH_SERVICE_SAML || - o.CurrentService == USER_AUTH_SERVICE_GITLAB || - o.CurrentService == SERVICE_GOOGLE || - o.CurrentService == SERVICE_OFFICE365) && o.NewService == USER_AUTH_SERVICE_EMAIL -} - -func (o *SwitchRequest) EmailToLdap() bool { - return o.CurrentService == USER_AUTH_SERVICE_EMAIL && o.NewService == USER_AUTH_SERVICE_LDAP -} - -func (o *SwitchRequest) LdapToEmail() bool { - return o.CurrentService == USER_AUTH_SERVICE_LDAP && o.NewService == USER_AUTH_SERVICE_EMAIL -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/system.go b/vendor/github.com/mattermost/mattermost-server/model/system.go deleted file mode 100644 index 2a636b14..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/system.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "math/big" -) - -const ( - SYSTEM_DIAGNOSTIC_ID = "DiagnosticId" - SYSTEM_RAN_UNIT_TESTS = "RanUnitTests" - SYSTEM_LAST_SECURITY_TIME = "LastSecurityTime" - SYSTEM_ACTIVE_LICENSE_ID = "ActiveLicenseId" - SYSTEM_LAST_COMPLIANCE_TIME = "LastComplianceTime" - SYSTEM_ASYMMETRIC_SIGNING_KEY = "AsymmetricSigningKey" -) - -type System struct { - Name string `json:"name"` - Value string `json:"value"` -} - -func (o *System) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func SystemFromJson(data io.Reader) *System { - var o *System - json.NewDecoder(data).Decode(&o) - return o -} - -type SystemAsymmetricSigningKey struct { - ECDSAKey *SystemECDSAKey `json:"ecdsa_key,omitempty"` -} - -type SystemECDSAKey struct { - Curve string `json:"curve"` - X *big.Int `json:"x"` - Y *big.Int `json:"y"` - D *big.Int `json:"d,omitempty"` -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/team.go b/vendor/github.com/mattermost/mattermost-server/model/team.go deleted file mode 100644 index 5b6eb1fa..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/team.go +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "regexp" - "strings" - "unicode/utf8" -) - -const ( - TEAM_OPEN = "O" - TEAM_INVITE = "I" - TEAM_ALLOWED_DOMAINS_MAX_LENGTH = 500 - TEAM_COMPANY_NAME_MAX_LENGTH = 64 - TEAM_DESCRIPTION_MAX_LENGTH = 255 - TEAM_DISPLAY_NAME_MAX_RUNES = 64 - TEAM_EMAIL_MAX_LENGTH = 128 - TEAM_NAME_MAX_LENGTH = 64 - TEAM_NAME_MIN_LENGTH = 2 -) - -type Team struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - DisplayName string `json:"display_name"` - Name string `json:"name"` - Description string `json:"description"` - Email string `json:"email"` - Type string `json:"type"` - CompanyName string `json:"company_name"` - AllowedDomains string `json:"allowed_domains"` - InviteId string `json:"invite_id"` - AllowOpenInvite bool `json:"allow_open_invite"` -} - -type TeamPatch struct { - DisplayName *string `json:"display_name"` - Description *string `json:"description"` - CompanyName *string `json:"company_name"` - InviteId *string `json:"invite_id"` - AllowOpenInvite *bool `json:"allow_open_invite"` -} - -type Invites struct { - Invites []map[string]string `json:"invites"` -} - -func InvitesFromJson(data io.Reader) *Invites { - var o *Invites - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *Invites) ToEmailList() []string { - emailList := make([]string, len(o.Invites)) - for _, invite := range o.Invites { - emailList = append(emailList, invite["email"]) - } - return emailList -} - -func (o *Invites) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func (o *Team) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func TeamFromJson(data io.Reader) *Team { - var o *Team - json.NewDecoder(data).Decode(&o) - return o -} - -func TeamMapToJson(u map[string]*Team) string { - b, _ := json.Marshal(u) - return string(b) -} - -func TeamMapFromJson(data io.Reader) map[string]*Team { - var teams map[string]*Team - json.NewDecoder(data).Decode(&teams) - return teams -} - -func TeamListToJson(t []*Team) string { - b, _ := json.Marshal(t) - return string(b) -} - -func TeamListFromJson(data io.Reader) []*Team { - var teams []*Team - json.NewDecoder(data).Decode(&teams) - return teams -} - -func (o *Team) Etag() string { - return Etag(o.Id, o.UpdateAt) -} - -func (o *Team) IsValid() *AppError { - - if len(o.Id) != 26 { - return NewAppError("Team.IsValid", "model.team.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if o.CreateAt == 0 { - return NewAppError("Team.IsValid", "model.team.is_valid.create_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if o.UpdateAt == 0 { - return NewAppError("Team.IsValid", "model.team.is_valid.update_at.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.Email) > TEAM_EMAIL_MAX_LENGTH { - return NewAppError("Team.IsValid", "model.team.is_valid.email.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.Email) > 0 && !IsValidEmail(o.Email) { - return NewAppError("Team.IsValid", "model.team.is_valid.email.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if utf8.RuneCountInString(o.DisplayName) == 0 || utf8.RuneCountInString(o.DisplayName) > TEAM_DISPLAY_NAME_MAX_RUNES { - return NewAppError("Team.IsValid", "model.team.is_valid.name.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.Name) > TEAM_NAME_MAX_LENGTH { - return NewAppError("Team.IsValid", "model.team.is_valid.url.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.Description) > TEAM_DESCRIPTION_MAX_LENGTH { - return NewAppError("Team.IsValid", "model.team.is_valid.description.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if IsReservedTeamName(o.Name) { - return NewAppError("Team.IsValid", "model.team.is_valid.reserved.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if !IsValidTeamName(o.Name) { - return NewAppError("Team.IsValid", "model.team.is_valid.characters.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if !(o.Type == TEAM_OPEN || o.Type == TEAM_INVITE) { - return NewAppError("Team.IsValid", "model.team.is_valid.type.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.CompanyName) > TEAM_COMPANY_NAME_MAX_LENGTH { - return NewAppError("Team.IsValid", "model.team.is_valid.company.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - if len(o.AllowedDomains) > TEAM_ALLOWED_DOMAINS_MAX_LENGTH { - return NewAppError("Team.IsValid", "model.team.is_valid.domains.app_error", nil, "id="+o.Id, http.StatusBadRequest) - } - - return nil -} - -func (o *Team) PreSave() { - if o.Id == "" { - o.Id = NewId() - } - - o.CreateAt = GetMillis() - o.UpdateAt = o.CreateAt - - if len(o.InviteId) == 0 { - o.InviteId = NewId() - } -} - -func (o *Team) PreUpdate() { - o.UpdateAt = GetMillis() -} - -func IsReservedTeamName(s string) bool { - s = strings.ToLower(s) - - for _, value := range reservedName { - if strings.Index(s, value) == 0 { - return true - } - } - - return false -} - -func IsValidTeamName(s string) bool { - - if !IsValidAlphaNum(s) { - return false - } - - if len(s) < TEAM_NAME_MIN_LENGTH { - return false - } - - return true -} - -var validTeamNameCharacter = regexp.MustCompile(`^[a-z0-9-]$`) - -func CleanTeamName(s string) string { - s = strings.ToLower(strings.Replace(s, " ", "-", -1)) - - for _, value := range reservedName { - if strings.Index(s, value) == 0 { - s = strings.Replace(s, value, "", -1) - } - } - - s = strings.TrimSpace(s) - - for _, c := range s { - char := fmt.Sprintf("%c", c) - if !validTeamNameCharacter.MatchString(char) { - s = strings.Replace(s, char, "", -1) - } - } - - s = strings.Trim(s, "-") - - if !IsValidTeamName(s) { - s = NewId() - } - - return s -} - -func (o *Team) Sanitize() { - o.Email = "" - o.AllowedDomains = "" -} - -func (o *Team) SanitizeForNotLoggedIn() { - o.Email = "" - o.AllowedDomains = "" - o.CompanyName = "" - if !o.AllowOpenInvite { - o.InviteId = "" - } -} - -func (t *Team) Patch(patch *TeamPatch) { - if patch.DisplayName != nil { - t.DisplayName = *patch.DisplayName - } - - if patch.Description != nil { - t.Description = *patch.Description - } - - if patch.CompanyName != nil { - t.CompanyName = *patch.CompanyName - } - - if patch.InviteId != nil { - t.InviteId = *patch.InviteId - } - - if patch.AllowOpenInvite != nil { - t.AllowOpenInvite = *patch.AllowOpenInvite - } -} - -func (t *TeamPatch) ToJson() string { - b, err := json.Marshal(t) - if err != nil { - return "" - } - - return string(b) -} - -func TeamPatchFromJson(data io.Reader) *TeamPatch { - decoder := json.NewDecoder(data) - var team TeamPatch - err := decoder.Decode(&team) - if err != nil { - return nil - } - - return &team -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/team_member.go b/vendor/github.com/mattermost/mattermost-server/model/team_member.go deleted file mode 100644 index 2fcd1e15..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/team_member.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" - "strings" -) - -type TeamMember struct { - TeamId string `json:"team_id"` - UserId string `json:"user_id"` - Roles string `json:"roles"` - DeleteAt int64 `json:"delete_at"` -} - -type TeamUnread struct { - TeamId string `json:"team_id"` - MsgCount int64 `json:"msg_count"` - MentionCount int64 `json:"mention_count"` -} - -func (o *TeamMember) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func (o *TeamUnread) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func TeamMemberFromJson(data io.Reader) *TeamMember { - var o *TeamMember - json.NewDecoder(data).Decode(&o) - return o -} - -func TeamUnreadFromJson(data io.Reader) *TeamUnread { - var o *TeamUnread - json.NewDecoder(data).Decode(&o) - return o -} - -func TeamMembersToJson(o []*TeamMember) string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func TeamMembersFromJson(data io.Reader) []*TeamMember { - var o []*TeamMember - json.NewDecoder(data).Decode(&o) - return o -} - -func TeamsUnreadToJson(o []*TeamUnread) string { - if b, err := json.Marshal(o); err != nil { - return "[]" - } else { - return string(b) - } -} - -func TeamsUnreadFromJson(data io.Reader) []*TeamUnread { - var o []*TeamUnread - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *TeamMember) IsValid() *AppError { - - if len(o.TeamId) != 26 { - return NewAppError("TeamMember.IsValid", "model.team_member.is_valid.team_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(o.UserId) != 26 { - return NewAppError("TeamMember.IsValid", "model.team_member.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (o *TeamMember) PreUpdate() { -} - -func (o *TeamMember) GetRoles() []string { - return strings.Fields(o.Roles) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/team_search.go b/vendor/github.com/mattermost/mattermost-server/model/team_search.go deleted file mode 100644 index e0676022..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/team_search.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type TeamSearch struct { - Term string `json:"term"` -} - -// ToJson convert a TeamSearch to json string -func (c *TeamSearch) ToJson() string { - b, err := json.Marshal(c) - if err != nil { - return "" - } - - return string(b) -} - -// TeamSearchFromJson decodes the input and returns a TeamSearch -func TeamSearchFromJson(data io.Reader) *TeamSearch { - decoder := json.NewDecoder(data) - var cs TeamSearch - err := decoder.Decode(&cs) - if err == nil { - return &cs - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/team_stats.go b/vendor/github.com/mattermost/mattermost-server/model/team_stats.go deleted file mode 100644 index 0d688b80..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/team_stats.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type TeamStats struct { - TeamId string `json:"team_id"` - TotalMemberCount int64 `json:"total_member_count"` - ActiveMemberCount int64 `json:"active_member_count"` -} - -func (o *TeamStats) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func TeamStatsFromJson(data io.Reader) *TeamStats { - var o *TeamStats - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/token.go b/vendor/github.com/mattermost/mattermost-server/model/token.go deleted file mode 100644 index a4d10c7f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/token.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import "net/http" - -const ( - TOKEN_SIZE = 64 - MAX_TOKEN_EXIPRY_TIME = 1000 * 60 * 60 * 24 // 24 hour - TOKEN_TYPE_OAUTH = "oauth" -) - -type Token struct { - Token string - CreateAt int64 - Type string - Extra string -} - -func NewToken(tokentype, extra string) *Token { - return &Token{ - Token: NewRandomString(TOKEN_SIZE), - CreateAt: GetMillis(), - Type: tokentype, - Extra: extra, - } -} - -func (t *Token) IsValid() *AppError { - if len(t.Token) != TOKEN_SIZE { - return NewAppError("Token.IsValid", "model.token.is_valid.size", nil, "", http.StatusInternalServerError) - } - - if t.CreateAt == 0 { - return NewAppError("Token.IsValid", "model.token.is_valid.expiry", nil, "", http.StatusInternalServerError) - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/user.go b/vendor/github.com/mattermost/mattermost-server/model/user.go deleted file mode 100644 index 1e1d49f7..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/user.go +++ /dev/null @@ -1,616 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "regexp" - "strings" - "unicode/utf8" - - "golang.org/x/crypto/bcrypt" -) - -const ( - ME = "me" - USER_NOTIFY_ALL = "all" - USER_NOTIFY_MENTION = "mention" - USER_NOTIFY_NONE = "none" - DESKTOP_NOTIFY_PROP = "desktop" - DESKTOP_SOUND_NOTIFY_PROP = "desktop_sound" - DESKTOP_DURATION_NOTIFY_PROP = "desktop_duration" - MARK_UNREAD_NOTIFY_PROP = "mark_unread" - PUSH_NOTIFY_PROP = "push" - PUSH_STATUS_NOTIFY_PROP = "push_status" - EMAIL_NOTIFY_PROP = "email" - CHANNEL_MENTIONS_NOTIFY_PROP = "channel" - COMMENTS_NOTIFY_PROP = "comments" - MENTION_KEYS_NOTIFY_PROP = "mention_keys" - COMMENTS_NOTIFY_NEVER = "never" - COMMENTS_NOTIFY_ROOT = "root" - COMMENTS_NOTIFY_ANY = "any" - - DEFAULT_LOCALE = "en" - USER_AUTH_SERVICE_EMAIL = "email" - - USER_EMAIL_MAX_LENGTH = 128 - USER_NICKNAME_MAX_RUNES = 64 - USER_POSITION_MAX_RUNES = 128 - USER_FIRST_NAME_MAX_RUNES = 64 - USER_LAST_NAME_MAX_RUNES = 64 - USER_AUTH_DATA_MAX_LENGTH = 128 - USER_NAME_MAX_LENGTH = 64 - USER_NAME_MIN_LENGTH = 1 - USER_PASSWORD_MAX_LENGTH = 72 -) - -type User struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at,omitempty"` - UpdateAt int64 `json:"update_at,omitempty"` - DeleteAt int64 `json:"delete_at"` - Username string `json:"username"` - Password string `json:"password,omitempty"` - AuthData *string `json:"auth_data,omitempty"` - AuthService string `json:"auth_service"` - Email string `json:"email"` - EmailVerified bool `json:"email_verified,omitempty"` - Nickname string `json:"nickname"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Position string `json:"position"` - Roles string `json:"roles"` - AllowMarketing bool `json:"allow_marketing,omitempty"` - Props StringMap `json:"props,omitempty"` - NotifyProps StringMap `json:"notify_props,omitempty"` - LastPasswordUpdate int64 `json:"last_password_update,omitempty"` - LastPictureUpdate int64 `json:"last_picture_update,omitempty"` - FailedAttempts int `json:"failed_attempts,omitempty"` - Locale string `json:"locale"` - MfaActive bool `json:"mfa_active,omitempty"` - MfaSecret string `json:"mfa_secret,omitempty"` - LastActivityAt int64 `db:"-" json:"last_activity_at,omitempty"` -} - -type UserPatch struct { - Username *string `json:"username"` - Nickname *string `json:"nickname"` - FirstName *string `json:"first_name"` - LastName *string `json:"last_name"` - Position *string `json:"position"` - Email *string `json:"email"` - Props StringMap `json:"props,omitempty"` - NotifyProps StringMap `json:"notify_props,omitempty"` - Locale *string `json:"locale"` -} - -type UserAuth struct { - Password string `json:"password,omitempty"` - AuthData *string `json:"auth_data,omitempty"` - AuthService string `json:"auth_service,omitempty"` -} - -// IsValid validates the user and returns an error if it isn't configured -// correctly. -func (u *User) IsValid() *AppError { - - if len(u.Id) != 26 { - return InvalidUserError("id", "") - } - - if u.CreateAt == 0 { - return InvalidUserError("create_at", u.Id) - } - - if u.UpdateAt == 0 { - return InvalidUserError("update_at", u.Id) - } - - if !IsValidUsername(u.Username) { - return InvalidUserError("username", u.Id) - } - - if len(u.Email) > USER_EMAIL_MAX_LENGTH || len(u.Email) == 0 { - return InvalidUserError("email", u.Id) - } - - if utf8.RuneCountInString(u.Nickname) > USER_NICKNAME_MAX_RUNES { - return InvalidUserError("nickname", u.Id) - } - - if utf8.RuneCountInString(u.Position) > USER_POSITION_MAX_RUNES { - return InvalidUserError("position", u.Id) - } - - if utf8.RuneCountInString(u.FirstName) > USER_FIRST_NAME_MAX_RUNES { - return InvalidUserError("first_name", u.Id) - } - - if utf8.RuneCountInString(u.LastName) > USER_LAST_NAME_MAX_RUNES { - return InvalidUserError("last_name", u.Id) - } - - if u.AuthData != nil && len(*u.AuthData) > USER_AUTH_DATA_MAX_LENGTH { - return InvalidUserError("auth_data", u.Id) - } - - if u.AuthData != nil && len(*u.AuthData) > 0 && len(u.AuthService) == 0 { - return InvalidUserError("auth_data_type", u.Id) - } - - if len(u.Password) > 0 && u.AuthData != nil && len(*u.AuthData) > 0 { - return InvalidUserError("auth_data_pwd", u.Id) - } - - if len(u.Password) > USER_PASSWORD_MAX_LENGTH { - return InvalidUserError("password_limit", u.Id) - } - - return nil -} - -func InvalidUserError(fieldName string, userId string) *AppError { - id := fmt.Sprintf("model.user.is_valid.%s.app_error", fieldName) - details := "" - if userId != "" { - details = "user_id=" + userId - } - return NewAppError("User.IsValid", id, nil, details, http.StatusBadRequest) -} - -func NormalizeUsername(username string) string { - return strings.ToLower(username) -} - -func NormalizeEmail(email string) string { - return strings.ToLower(email) -} - -// PreSave will set the Id and Username if missing. It will also fill -// in the CreateAt, UpdateAt times. It will also hash the password. It should -// be run before saving the user to the db. -func (u *User) PreSave() { - if u.Id == "" { - u.Id = NewId() - } - - if u.Username == "" { - u.Username = NewId() - } - - if u.AuthData != nil && *u.AuthData == "" { - u.AuthData = nil - } - - u.Username = NormalizeUsername(u.Username) - u.Email = NormalizeEmail(u.Email) - - u.CreateAt = GetMillis() - u.UpdateAt = u.CreateAt - - u.LastPasswordUpdate = u.CreateAt - - u.MfaActive = false - - if u.Locale == "" { - u.Locale = DEFAULT_LOCALE - } - - if u.Props == nil { - u.Props = make(map[string]string) - } - - if u.NotifyProps == nil || len(u.NotifyProps) == 0 { - u.SetDefaultNotifications() - } - - if len(u.Password) > 0 { - u.Password = HashPassword(u.Password) - } -} - -// PreUpdate should be run before updating the user in the db. -func (u *User) PreUpdate() { - u.Username = NormalizeUsername(u.Username) - u.Email = NormalizeEmail(u.Email) - u.UpdateAt = GetMillis() - - if u.AuthData != nil && *u.AuthData == "" { - u.AuthData = nil - } - - if u.NotifyProps == nil || len(u.NotifyProps) == 0 { - u.SetDefaultNotifications() - } else if _, ok := u.NotifyProps["mention_keys"]; ok { - // Remove any blank mention keys - splitKeys := strings.Split(u.NotifyProps["mention_keys"], ",") - goodKeys := []string{} - for _, key := range splitKeys { - if len(key) > 0 { - goodKeys = append(goodKeys, strings.ToLower(key)) - } - } - u.NotifyProps["mention_keys"] = strings.Join(goodKeys, ",") - } -} - -func (u *User) SetDefaultNotifications() { - u.NotifyProps = make(map[string]string) - u.NotifyProps["email"] = "true" - u.NotifyProps["push"] = USER_NOTIFY_MENTION - u.NotifyProps["desktop"] = USER_NOTIFY_MENTION - u.NotifyProps["desktop_sound"] = "true" - u.NotifyProps["mention_keys"] = u.Username + ",@" + u.Username - u.NotifyProps["channel"] = "true" - u.NotifyProps["push_status"] = STATUS_AWAY - u.NotifyProps["comments"] = "never" - u.NotifyProps["first_name"] = "false" -} - -func (user *User) UpdateMentionKeysFromUsername(oldUsername string) { - nonUsernameKeys := []string{} - splitKeys := strings.Split(user.NotifyProps["mention_keys"], ",") - for _, key := range splitKeys { - if key != oldUsername && key != "@"+oldUsername { - nonUsernameKeys = append(nonUsernameKeys, key) - } - } - - user.NotifyProps["mention_keys"] = user.Username + ",@" + user.Username - if len(nonUsernameKeys) > 0 { - user.NotifyProps["mention_keys"] += "," + strings.Join(nonUsernameKeys, ",") - } -} - -func (u *User) Patch(patch *UserPatch) { - if patch.Username != nil { - u.Username = *patch.Username - } - - if patch.Nickname != nil { - u.Nickname = *patch.Nickname - } - - if patch.FirstName != nil { - u.FirstName = *patch.FirstName - } - - if patch.LastName != nil { - u.LastName = *patch.LastName - } - - if patch.Position != nil { - u.Position = *patch.Position - } - - if patch.Email != nil { - u.Email = *patch.Email - } - - if patch.Props != nil { - u.Props = patch.Props - } - - if patch.NotifyProps != nil { - u.NotifyProps = patch.NotifyProps - } - - if patch.Locale != nil { - u.Locale = *patch.Locale - } -} - -// ToJson convert a User to a json string -func (u *User) ToJson() string { - b, _ := json.Marshal(u) - return string(b) -} - -func (u *UserPatch) ToJson() string { - b, _ := json.Marshal(u) - return string(b) -} - -func (u *UserAuth) ToJson() string { - b, _ := json.Marshal(u) - return string(b) -} - -// Generate a valid strong etag so the browser can cache the results -func (u *User) Etag(showFullName, showEmail bool) string { - return Etag(u.Id, u.UpdateAt, showFullName, showEmail) -} - -// Remove any private data from the user object -func (u *User) Sanitize(options map[string]bool) { - u.Password = "" - u.AuthData = NewString("") - u.MfaSecret = "" - - if len(options) != 0 && !options["email"] { - u.Email = "" - } - if len(options) != 0 && !options["fullname"] { - u.FirstName = "" - u.LastName = "" - } - if len(options) != 0 && !options["passwordupdate"] { - u.LastPasswordUpdate = 0 - } - if len(options) != 0 && !options["authservice"] { - u.AuthService = "" - } -} - -func (u *User) ClearNonProfileFields() { - u.Password = "" - u.AuthData = NewString("") - u.MfaSecret = "" - u.EmailVerified = false - u.AllowMarketing = false - u.NotifyProps = StringMap{} - u.LastPasswordUpdate = 0 - u.FailedAttempts = 0 -} - -func (u *User) SanitizeProfile(options map[string]bool) { - u.ClearNonProfileFields() - - u.Sanitize(options) -} - -func (u *User) MakeNonNil() { - if u.Props == nil { - u.Props = make(map[string]string) - } - - if u.NotifyProps == nil { - u.NotifyProps = make(map[string]string) - } -} - -func (u *User) AddProp(key string, value string) { - u.MakeNonNil() - - u.Props[key] = value -} - -func (u *User) AddNotifyProp(key string, value string) { - u.MakeNonNil() - - u.NotifyProps[key] = value -} - -func (u *User) GetFullName() string { - if u.FirstName != "" && u.LastName != "" { - return u.FirstName + " " + u.LastName - } else if u.FirstName != "" { - return u.FirstName - } else if u.LastName != "" { - return u.LastName - } else { - return "" - } -} - -func (u *User) GetDisplayName(nameFormat string) string { - displayName := u.Username - - if nameFormat == SHOW_NICKNAME_FULLNAME { - if u.Nickname != "" { - displayName = u.Nickname - } else if fullName := u.GetFullName(); fullName != "" { - displayName = fullName - } - } else if nameFormat == SHOW_FULLNAME { - if fullName := u.GetFullName(); fullName != "" { - displayName = fullName - } - } - - return displayName -} - -func (u *User) GetRoles() []string { - return strings.Fields(u.Roles) -} - -func (u *User) GetRawRoles() string { - return u.Roles -} - -func IsValidUserRoles(userRoles string) bool { - - roles := strings.Fields(userRoles) - - for _, r := range roles { - if !isValidRole(r) { - return false - } - } - - // Exclude just the system_admin role explicitly to prevent mistakes - if len(roles) == 1 && roles[0] == "system_admin" { - return false - } - - return true -} - -func isValidRole(roleId string) bool { - _, ok := DefaultRoles[roleId] - return ok -} - -// Make sure you acually want to use this function. In context.go there are functions to check permissions -// This function should not be used to check permissions. -func (u *User) IsInRole(inRole string) bool { - return IsInRole(u.Roles, inRole) -} - -// Make sure you acually want to use this function. In context.go there are functions to check permissions -// This function should not be used to check permissions. -func IsInRole(userRoles string, inRole string) bool { - roles := strings.Split(userRoles, " ") - - for _, r := range roles { - if r == inRole { - return true - } - } - - return false -} - -func (u *User) IsSSOUser() bool { - return u.AuthService != "" && u.AuthService != USER_AUTH_SERVICE_EMAIL -} - -func (u *User) IsOAuthUser() bool { - return u.AuthService == USER_AUTH_SERVICE_GITLAB -} - -func (u *User) IsLDAPUser() bool { - return u.AuthService == USER_AUTH_SERVICE_LDAP -} - -func (u *User) IsSAMLUser() bool { - return u.AuthService == USER_AUTH_SERVICE_SAML -} - -// UserFromJson will decode the input and return a User -func UserFromJson(data io.Reader) *User { - var user *User - json.NewDecoder(data).Decode(&user) - return user -} - -func UserPatchFromJson(data io.Reader) *UserPatch { - var user *UserPatch - json.NewDecoder(data).Decode(&user) - return user -} - -func UserAuthFromJson(data io.Reader) *UserAuth { - var user *UserAuth - json.NewDecoder(data).Decode(&user) - return user -} - -func UserMapToJson(u map[string]*User) string { - b, _ := json.Marshal(u) - return string(b) -} - -func UserMapFromJson(data io.Reader) map[string]*User { - var users map[string]*User - json.NewDecoder(data).Decode(&users) - return users -} - -func UserListToJson(u []*User) string { - b, _ := json.Marshal(u) - return string(b) -} - -func UserListFromJson(data io.Reader) []*User { - var users []*User - json.NewDecoder(data).Decode(&users) - return users -} - -// HashPassword generates a hash using the bcrypt.GenerateFromPassword -func HashPassword(password string) string { - hash, err := bcrypt.GenerateFromPassword([]byte(password), 10) - if err != nil { - panic(err) - } - - return string(hash) -} - -// ComparePassword compares the hash -func ComparePassword(hash string, password string) bool { - - if len(password) == 0 || len(hash) == 0 { - return false - } - - err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) - return err == nil -} - -var validUsernameChars = regexp.MustCompile(`^[a-z0-9\.\-_]+$`) - -var restrictedUsernames = []string{ - "all", - "channel", - "matterbot", -} - -func IsValidUsername(s string) bool { - if len(s) < USER_NAME_MIN_LENGTH || len(s) > USER_NAME_MAX_LENGTH { - return false - } - - if !validUsernameChars.MatchString(s) { - return false - } - - for _, restrictedUsername := range restrictedUsernames { - if s == restrictedUsername { - return false - } - } - - return true -} - -func CleanUsername(s string) string { - s = NormalizeUsername(strings.Replace(s, " ", "-", -1)) - - for _, value := range reservedName { - if s == value { - s = strings.Replace(s, value, "", -1) - } - } - - s = strings.TrimSpace(s) - - for _, c := range s { - char := fmt.Sprintf("%c", c) - if !validUsernameChars.MatchString(char) { - s = strings.Replace(s, char, "-", -1) - } - } - - s = strings.Trim(s, "-") - - if !IsValidUsername(s) { - s = "a" + NewId() - } - - return s -} - -func IsValidUserNotifyLevel(notifyLevel string) bool { - return notifyLevel == CHANNEL_NOTIFY_ALL || - notifyLevel == CHANNEL_NOTIFY_MENTION || - notifyLevel == CHANNEL_NOTIFY_NONE -} - -func IsValidPushStatusNotifyLevel(notifyLevel string) bool { - return notifyLevel == STATUS_ONLINE || - notifyLevel == STATUS_AWAY || - notifyLevel == STATUS_OFFLINE -} - -func IsValidCommentsNotifyLevel(notifyLevel string) bool { - return notifyLevel == COMMENTS_NOTIFY_ANY || - notifyLevel == COMMENTS_NOTIFY_ROOT || - notifyLevel == COMMENTS_NOTIFY_NEVER -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/user_access_token.go b/vendor/github.com/mattermost/mattermost-server/model/user_access_token.go deleted file mode 100644 index bffd9fcb..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/user_access_token.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - "net/http" -) - -type UserAccessToken struct { - Id string `json:"id"` - Token string `json:"token,omitempty"` - UserId string `json:"user_id"` - Description string `json:"description"` - IsActive bool `json:"is_active"` -} - -func (t *UserAccessToken) IsValid() *AppError { - if len(t.Id) != 26 { - return NewAppError("UserAccessToken.IsValid", "model.user_access_token.is_valid.id.app_error", nil, "", http.StatusBadRequest) - } - - if len(t.Token) != 26 { - return NewAppError("UserAccessToken.IsValid", "model.user_access_token.is_valid.token.app_error", nil, "", http.StatusBadRequest) - } - - if len(t.UserId) != 26 { - return NewAppError("UserAccessToken.IsValid", "model.user_access_token.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) - } - - if len(t.Description) > 255 { - return NewAppError("UserAccessToken.IsValid", "model.user_access_token.is_valid.description.app_error", nil, "", http.StatusBadRequest) - } - - return nil -} - -func (t *UserAccessToken) PreSave() { - t.Id = NewId() - t.IsActive = true -} - -func (t *UserAccessToken) ToJson() string { - b, _ := json.Marshal(t) - return string(b) -} - -func UserAccessTokenFromJson(data io.Reader) *UserAccessToken { - var t *UserAccessToken - json.NewDecoder(data).Decode(&t) - return t -} - -func UserAccessTokenListToJson(t []*UserAccessToken) string { - b, _ := json.Marshal(t) - return string(b) -} - -func UserAccessTokenListFromJson(data io.Reader) []*UserAccessToken { - var t []*UserAccessToken - json.NewDecoder(data).Decode(&t) - return t -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/user_access_token_search.go b/vendor/github.com/mattermost/mattermost-server/model/user_access_token_search.go deleted file mode 100644 index 1b0146ed..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/user_access_token_search.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type UserAccessTokenSearch struct { - Term string `json:"term"` -} - -// ToJson convert a UserAccessTokenSearch to json string -func (c *UserAccessTokenSearch) ToJson() string { - b, err := json.Marshal(c) - if err != nil { - return "" - } - - return string(b) -} - -// UserAccessTokenSearchJson decodes the input and returns a UserAccessTokenSearch -func UserAccessTokenSearchFromJson(data io.Reader) *UserAccessTokenSearch { - decoder := json.NewDecoder(data) - var cs UserAccessTokenSearch - err := decoder.Decode(&cs) - if err == nil { - return &cs - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/user_autocomplete.go b/vendor/github.com/mattermost/mattermost-server/model/user_autocomplete.go deleted file mode 100644 index b5edb45b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/user_autocomplete.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type UserAutocompleteInChannel struct { - InChannel []*User `json:"in_channel"` - OutOfChannel []*User `json:"out_of_channel"` -} - -type UserAutocompleteInTeam struct { - InTeam []*User `json:"in_team"` -} - -type UserAutocomplete struct { - Users []*User `json:"users"` - OutOfChannel []*User `json:"out_of_channel,omitempty"` -} - -func (o *UserAutocomplete) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func UserAutocompleteFromJson(data io.Reader) *UserAutocomplete { - decoder := json.NewDecoder(data) - autocomplete := new(UserAutocomplete) - err := decoder.Decode(&autocomplete) - if err == nil { - return autocomplete - } else { - return nil - } -} - -func (o *UserAutocompleteInChannel) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func UserAutocompleteInChannelFromJson(data io.Reader) *UserAutocompleteInChannel { - var o *UserAutocompleteInChannel - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *UserAutocompleteInTeam) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func UserAutocompleteInTeamFromJson(data io.Reader) *UserAutocompleteInTeam { - var o *UserAutocompleteInTeam - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/user_search.go b/vendor/github.com/mattermost/mattermost-server/model/user_search.go deleted file mode 100644 index 94596bdc..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/user_search.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type UserSearch struct { - Term string `json:"term"` - TeamId string `json:"team_id"` - NotInTeamId string `json:"not_in_team_id"` - InChannelId string `json:"in_channel_id"` - NotInChannelId string `json:"not_in_channel_id"` - AllowInactive bool `json:"allow_inactive"` - WithoutTeam bool `json:"without_team"` -} - -// ToJson convert a User to a json string -func (u *UserSearch) ToJson() string { - b, _ := json.Marshal(u) - return string(b) -} - -// UserSearchFromJson will decode the input and return a User -func UserSearchFromJson(data io.Reader) *UserSearch { - var us *UserSearch - json.NewDecoder(data).Decode(&us) - return us -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/utils.go b/vendor/github.com/mattermost/mattermost-server/model/utils.go deleted file mode 100644 index 331a1aaa..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/utils.go +++ /dev/null @@ -1,486 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "bytes" - "crypto/rand" - "encoding/base32" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/mail" - "net/url" - "regexp" - "strconv" - "strings" - "time" - "unicode" - - goi18n "github.com/nicksnyder/go-i18n/i18n" - "github.com/pborman/uuid" -) - -const ( - LOWERCASE_LETTERS = "abcdefghijklmnopqrstuvwxyz" - UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - NUMBERS = "0123456789" - SYMBOLS = " !\"\\#$%&'()*+,-./:;<=>?@[]^_`|~" -) - -type StringInterface map[string]interface{} -type StringMap map[string]string -type StringArray []string - -var translateFunc goi18n.TranslateFunc = nil - -func AppErrorInit(t goi18n.TranslateFunc) { - translateFunc = t -} - -type AppError struct { - Id string `json:"id"` - Message string `json:"message"` // Message to be display to the end user without debugging information - DetailedError string `json:"detailed_error"` // Internal error string to help the developer - RequestId string `json:"request_id,omitempty"` // The RequestId that's also set in the header - StatusCode int `json:"status_code,omitempty"` // The http status code - Where string `json:"-"` // The function where it happened in the form of Struct.Func - IsOAuth bool `json:"is_oauth,omitempty"` // Whether the error is OAuth specific - params map[string]interface{} -} - -func (er *AppError) Error() string { - return er.Where + ": " + er.Message + ", " + er.DetailedError -} - -func (er *AppError) Translate(T goi18n.TranslateFunc) { - if T == nil { - er.Message = er.Id - return - } - - if er.params == nil { - er.Message = T(er.Id) - } else { - er.Message = T(er.Id, er.params) - } -} - -func (er *AppError) SystemMessage(T goi18n.TranslateFunc) string { - if er.params == nil { - return T(er.Id) - } else { - return T(er.Id, er.params) - } -} - -func (er *AppError) ToJson() string { - b, _ := json.Marshal(er) - return string(b) -} - -// AppErrorFromJson will decode the input and return an AppError -func AppErrorFromJson(data io.Reader) *AppError { - str := "" - bytes, rerr := ioutil.ReadAll(data) - if rerr != nil { - str = rerr.Error() - } else { - str = string(bytes) - } - - decoder := json.NewDecoder(strings.NewReader(str)) - var er AppError - err := decoder.Decode(&er) - if err == nil { - return &er - } else { - return NewAppError("AppErrorFromJson", "model.utils.decode_json.app_error", nil, "body: "+str, http.StatusInternalServerError) - } -} - -func NewAppError(where string, id string, params map[string]interface{}, details string, status int) *AppError { - ap := &AppError{} - ap.Id = id - ap.params = params - ap.Message = id - ap.Where = where - ap.DetailedError = details - ap.StatusCode = status - ap.IsOAuth = false - ap.Translate(translateFunc) - return ap -} - -var encoding = base32.NewEncoding("ybndrfg8ejkmcpqxot1uwisza345h769") - -// NewId is a globally unique identifier. It is a [A-Z0-9] string 26 -// characters long. It is a UUID version 4 Guid that is zbased32 encoded -// with the padding stripped off. -func NewId() string { - var b bytes.Buffer - encoder := base32.NewEncoder(encoding, &b) - encoder.Write(uuid.NewRandom()) - encoder.Close() - b.Truncate(26) // removes the '==' padding - return b.String() -} - -func NewRandomString(length int) string { - var b bytes.Buffer - str := make([]byte, length+8) - rand.Read(str) - encoder := base32.NewEncoder(encoding, &b) - encoder.Write(str) - encoder.Close() - b.Truncate(length) // removes the '==' padding - return b.String() -} - -// GetMillis is a convience method to get milliseconds since epoch. -func GetMillis() int64 { - return time.Now().UnixNano() / int64(time.Millisecond) -} - -// MapToJson converts a map to a json string -func MapToJson(objmap map[string]string) string { - b, _ := json.Marshal(objmap) - return string(b) -} - -// MapToJson converts a map to a json string -func MapBoolToJson(objmap map[string]bool) string { - b, _ := json.Marshal(objmap) - return string(b) -} - -// MapFromJson will decode the key/value pair map -func MapFromJson(data io.Reader) map[string]string { - decoder := json.NewDecoder(data) - - var objmap map[string]string - if err := decoder.Decode(&objmap); err != nil { - return make(map[string]string) - } else { - return objmap - } -} - -// MapFromJson will decode the key/value pair map -func MapBoolFromJson(data io.Reader) map[string]bool { - decoder := json.NewDecoder(data) - - var objmap map[string]bool - if err := decoder.Decode(&objmap); err != nil { - return make(map[string]bool) - } else { - return objmap - } -} - -func ArrayToJson(objmap []string) string { - b, _ := json.Marshal(objmap) - return string(b) -} - -func ArrayFromJson(data io.Reader) []string { - decoder := json.NewDecoder(data) - - var objmap []string - if err := decoder.Decode(&objmap); err != nil { - return make([]string, 0) - } else { - return objmap - } -} - -func ArrayFromInterface(data interface{}) []string { - stringArray := []string{} - - dataArray, ok := data.([]interface{}) - if !ok { - return stringArray - } - - for _, v := range dataArray { - if str, ok := v.(string); ok { - stringArray = append(stringArray, str) - } - } - - return stringArray -} - -func StringInterfaceToJson(objmap map[string]interface{}) string { - b, _ := json.Marshal(objmap) - return string(b) -} - -func StringInterfaceFromJson(data io.Reader) map[string]interface{} { - decoder := json.NewDecoder(data) - - var objmap map[string]interface{} - if err := decoder.Decode(&objmap); err != nil { - return make(map[string]interface{}) - } else { - return objmap - } -} - -func StringToJson(s string) string { - b, _ := json.Marshal(s) - return string(b) -} - -func StringFromJson(data io.Reader) string { - decoder := json.NewDecoder(data) - - var s string - if err := decoder.Decode(&s); err != nil { - return "" - } else { - return s - } -} - -func GetServerIpAddress() string { - if addrs, err := net.InterfaceAddrs(); err != nil { - return "" - } else { - for _, addr := range addrs { - - if ip, ok := addr.(*net.IPNet); ok && !ip.IP.IsLoopback() { - if ip.IP.To4() != nil { - return ip.IP.String() - } - } - } - } - - return "" -} - -func IsLower(s string) bool { - return strings.ToLower(s) == s -} - -func IsValidEmail(email string) bool { - - if !IsLower(email) { - return false - } - - if _, err := mail.ParseAddress(email); err == nil { - return true - } - - return false -} - -var reservedName = []string{ - "signup", - "login", - "admin", - "channel", - "post", - "api", - "oauth", -} - -func IsValidChannelIdentifier(s string) bool { - - if !IsValidAlphaNumHyphenUnderscore(s, true) { - return false - } - - if len(s) < CHANNEL_NAME_MIN_LENGTH { - return false - } - - return true -} - -func IsValidAlphaNum(s string) bool { - validAlphaNum := regexp.MustCompile(`^[a-z0-9]+([a-z\-0-9]+|(__)?)[a-z0-9]+$`) - - return validAlphaNum.MatchString(s) -} - -func IsValidAlphaNumHyphenUnderscore(s string, withFormat bool) bool { - if withFormat { - validAlphaNumHyphenUnderscore := regexp.MustCompile(`^[a-z0-9]+([a-z\-\_0-9]+|(__)?)[a-z0-9]+$`) - return validAlphaNumHyphenUnderscore.MatchString(s) - } - - validSimpleAlphaNumHyphenUnderscore := regexp.MustCompile(`^[a-zA-Z0-9\-_]+$`) - return validSimpleAlphaNumHyphenUnderscore.MatchString(s) -} - -func Etag(parts ...interface{}) string { - - etag := CurrentVersion - - for _, part := range parts { - etag += fmt.Sprintf(".%v", part) - } - - return etag -} - -var validHashtag = regexp.MustCompile(`^(#\pL[\pL\d\-_.]*[\pL\d])$`) -var puncStart = regexp.MustCompile(`^[^\pL\d\s#]+`) -var hashtagStart = regexp.MustCompile(`^#{2,}`) -var puncEnd = regexp.MustCompile(`[^\pL\d\s]+$`) - -func ParseHashtags(text string) (string, string) { - words := strings.Fields(text) - - hashtagString := "" - plainString := "" - for _, word := range words { - // trim off surrounding punctuation - word = puncStart.ReplaceAllString(word, "") - word = puncEnd.ReplaceAllString(word, "") - - // and remove extra pound #s - word = hashtagStart.ReplaceAllString(word, "#") - - if validHashtag.MatchString(word) { - hashtagString += " " + word - } else { - plainString += " " + word - } - } - - if len(hashtagString) > 1000 { - hashtagString = hashtagString[:999] - lastSpace := strings.LastIndex(hashtagString, " ") - if lastSpace > -1 { - hashtagString = hashtagString[:lastSpace] - } else { - hashtagString = "" - } - } - - return strings.TrimSpace(hashtagString), strings.TrimSpace(plainString) -} - -func IsFileExtImage(ext string) bool { - ext = strings.ToLower(ext) - for _, imgExt := range IMAGE_EXTENSIONS { - if ext == imgExt { - return true - } - } - return false -} - -func GetImageMimeType(ext string) string { - ext = strings.ToLower(ext) - if len(IMAGE_MIME_TYPES[ext]) == 0 { - return "image" - } else { - return IMAGE_MIME_TYPES[ext] - } -} - -func ClearMentionTags(post string) string { - post = strings.Replace(post, "", "", -1) - post = strings.Replace(post, "", "", -1) - return post -} - -var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`) -var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`) - -func IsValidHttpUrl(rawUrl string) bool { - if strings.Index(rawUrl, "http://") != 0 && strings.Index(rawUrl, "https://") != 0 { - return false - } - - if _, err := url.ParseRequestURI(rawUrl); err != nil { - return false - } - - return true -} - -func IsValidHttpsUrl(rawUrl string) bool { - if strings.Index(rawUrl, "https://") != 0 { - return false - } - - if _, err := url.ParseRequestURI(rawUrl); err != nil { - return false - } - - return true -} - -func IsValidTurnOrStunServer(rawUri string) bool { - if strings.Index(rawUri, "turn:") != 0 && strings.Index(rawUri, "stun:") != 0 { - return false - } - - if _, err := url.ParseRequestURI(rawUri); err != nil { - return false - } - - return true -} - -func IsSafeLink(link *string) bool { - if link != nil { - if IsValidHttpUrl(*link) { - return true - } else if strings.HasPrefix(*link, "/") { - return true - } else { - return false - } - } - - return true -} - -func IsValidWebsocketUrl(rawUrl string) bool { - if strings.Index(rawUrl, "ws://") != 0 && strings.Index(rawUrl, "wss://") != 0 { - return false - } - - if _, err := url.ParseRequestURI(rawUrl); err != nil { - return false - } - - return true -} - -func IsValidTrueOrFalseString(value string) bool { - return value == "true" || value == "false" -} - -func IsValidNumberString(value string) bool { - if _, err := strconv.Atoi(value); err != nil { - return false - } - - return true -} - -func IsValidId(value string) bool { - if len(value) != 26 { - return false - } - - for _, r := range value { - if !unicode.IsLetter(r) && !unicode.IsNumber(r) { - return false - } - } - - return true -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/version.go b/vendor/github.com/mattermost/mattermost-server/model/version.go deleted file mode 100644 index 1bd7baec..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/version.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "fmt" - "strconv" - "strings" -) - -// This is a list of all the current viersions including any patches. -// It should be maitained in chronological order with most current -// release at the front of the list. -var versions = []string{ - "4.7.0", - "4.6.0", - "4.5.0", - "4.4.0", - "4.3.0", - "4.2.0", - "4.1.0", - "4.0.0", - "3.10.0", - "3.9.0", - "3.8.0", - "3.7.0", - "3.6.0", - "3.5.0", - "3.4.0", - "3.3.0", - "3.2.0", - "3.1.0", - "3.0.0", - "2.2.0", - "2.1.0", - "2.0.0", - "1.4.0", - "1.3.0", - "1.2.1", - "1.2.0", - "1.1.0", - "1.0.0", - "0.7.1", - "0.7.0", - "0.6.0", - "0.5.0", -} - -var CurrentVersion string = versions[0] -var BuildNumber string -var BuildDate string -var BuildHash string -var BuildHashEnterprise string -var BuildEnterpriseReady string -var versionsWithoutHotFixes []string - -func init() { - versionsWithoutHotFixes = make([]string, 0, len(versions)) - seen := make(map[string]string) - - for _, version := range versions { - maj, min, _ := SplitVersion(version) - verStr := fmt.Sprintf("%v.%v.0", maj, min) - - if seen[verStr] == "" { - versionsWithoutHotFixes = append(versionsWithoutHotFixes, verStr) - seen[verStr] = verStr - } - } -} - -func SplitVersion(version string) (int64, int64, int64) { - parts := strings.Split(version, ".") - - major := int64(0) - minor := int64(0) - patch := int64(0) - - if len(parts) > 0 { - major, _ = strconv.ParseInt(parts[0], 10, 64) - } - - if len(parts) > 1 { - minor, _ = strconv.ParseInt(parts[1], 10, 64) - } - - if len(parts) > 2 { - patch, _ = strconv.ParseInt(parts[2], 10, 64) - } - - return major, minor, patch -} - -func GetPreviousVersion(version string) string { - verMajor, verMinor, _ := SplitVersion(version) - verStr := fmt.Sprintf("%v.%v.0", verMajor, verMinor) - - for index, v := range versionsWithoutHotFixes { - if v == verStr && len(versionsWithoutHotFixes) > index+1 { - return versionsWithoutHotFixes[index+1] - } - } - - return "" -} - -func IsOfficalBuild() bool { - return BuildNumber != "_BUILD_NUMBER_" -} - -func IsCurrentVersion(versionToCheck string) bool { - currentMajor, currentMinor, _ := SplitVersion(CurrentVersion) - toCheckMajor, toCheckMinor, _ := SplitVersion(versionToCheck) - - if toCheckMajor == currentMajor && toCheckMinor == currentMinor { - return true - } else { - return false - } -} - -func IsPreviousVersionsSupported(versionToCheck string) bool { - toCheckMajor, toCheckMinor, _ := SplitVersion(versionToCheck) - versionToCheckStr := fmt.Sprintf("%v.%v.0", toCheckMajor, toCheckMinor) - - // Current Supported - if versionsWithoutHotFixes[0] == versionToCheckStr { - return true - } - - // Current - 1 Supported - if versionsWithoutHotFixes[1] == versionToCheckStr { - return true - } - - // Current - 2 Supported - if versionsWithoutHotFixes[2] == versionToCheckStr { - return true - } - - // Current - 3 Supported - if versionsWithoutHotFixes[3] == versionToCheckStr { - return true - } - - return false -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/webrtc.go b/vendor/github.com/mattermost/mattermost-server/model/webrtc.go deleted file mode 100644 index 59797a5b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/webrtc.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type WebrtcInfoResponse struct { - Token string `json:"token"` - GatewayUrl string `json:"gateway_url"` - StunUri string `json:"stun_uri,omitempty"` - TurnUri string `json:"turn_uri,omitempty"` - TurnPassword string `json:"turn_password,omitempty"` - TurnUsername string `json:"turn_username,omitempty"` -} - -type GatewayResponse struct { - Status string `json:"janus"` -} - -func GatewayResponseFromJson(data io.Reader) *GatewayResponse { - var o *GatewayResponse - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *WebrtcInfoResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func WebrtcInfoResponseFromJson(data io.Reader) *WebrtcInfoResponse { - var o *WebrtcInfoResponse - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/websocket_client.go b/vendor/github.com/mattermost/mattermost-server/model/websocket_client.go deleted file mode 100644 index e5c44dde..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/websocket_client.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "net/http" - - "github.com/gorilla/websocket" -) - -const ( - SOCKET_MAX_MESSAGE_SIZE_KB = 8 * 1024 // 8KB -) - -type WebSocketClient struct { - Url string // The location of the server like "ws://localhost:8065" - ApiUrl string // The api location of the server like "ws://localhost:8065/api/v3" - ConnectUrl string // The websocket URL to connect to like "ws://localhost:8065/api/v3/path/to/websocket" - Conn *websocket.Conn // The WebSocket connection - AuthToken string // The token used to open the WebSocket - Sequence int64 // The ever-incrementing sequence attached to each WebSocket action - EventChannel chan *WebSocketEvent - ResponseChannel chan *WebSocketResponse - ListenError *AppError -} - -// NewWebSocketClient constructs a new WebSocket client with convienence -// methods for talking to the server. -func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) { - conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX_V3+"/users/websocket", nil) - if err != nil { - return nil, NewAppError("NewWebSocketClient", "model.websocket_client.connect_fail.app_error", nil, err.Error(), http.StatusInternalServerError) - } - - client := &WebSocketClient{ - url, - url + API_URL_SUFFIX_V3, - url + API_URL_SUFFIX_V3 + "/users/websocket", - conn, - authToken, - 1, - make(chan *WebSocketEvent, 100), - make(chan *WebSocketResponse, 100), - nil, - } - - client.SendMessage(WEBSOCKET_AUTHENTICATION_CHALLENGE, map[string]interface{}{"token": authToken}) - - return client, nil -} - -// NewWebSocketClient4 constructs a new WebSocket client with convienence -// methods for talking to the server. Uses the v4 endpoint. -func NewWebSocketClient4(url, authToken string) (*WebSocketClient, *AppError) { - conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX+"/websocket", nil) - if err != nil { - return nil, NewAppError("NewWebSocketClient4", "model.websocket_client.connect_fail.app_error", nil, err.Error(), http.StatusInternalServerError) - } - - client := &WebSocketClient{ - url, - url + API_URL_SUFFIX, - url + API_URL_SUFFIX + "/websocket", - conn, - authToken, - 1, - make(chan *WebSocketEvent, 100), - make(chan *WebSocketResponse, 100), - nil, - } - - client.SendMessage(WEBSOCKET_AUTHENTICATION_CHALLENGE, map[string]interface{}{"token": authToken}) - - return client, nil -} - -func (wsc *WebSocketClient) Connect() *AppError { - var err error - wsc.Conn, _, err = websocket.DefaultDialer.Dial(wsc.ConnectUrl, nil) - if err != nil { - return NewAppError("Connect", "model.websocket_client.connect_fail.app_error", nil, err.Error(), http.StatusInternalServerError) - } - - wsc.EventChannel = make(chan *WebSocketEvent, 100) - wsc.ResponseChannel = make(chan *WebSocketResponse, 100) - - wsc.SendMessage(WEBSOCKET_AUTHENTICATION_CHALLENGE, map[string]interface{}{"token": wsc.AuthToken}) - - return nil -} - -func (wsc *WebSocketClient) Close() { - wsc.Conn.Close() -} - -func (wsc *WebSocketClient) Listen() { - go func() { - defer func() { - wsc.Conn.Close() - close(wsc.EventChannel) - close(wsc.ResponseChannel) - }() - - for { - var rawMsg json.RawMessage - var err error - if _, rawMsg, err = wsc.Conn.ReadMessage(); err != nil { - if !websocket.IsCloseError(err, websocket.CloseNormalClosure, websocket.CloseNoStatusReceived) { - wsc.ListenError = NewAppError("NewWebSocketClient", "model.websocket_client.connect_fail.app_error", nil, err.Error(), http.StatusInternalServerError) - } - - return - } - - var event WebSocketEvent - if err := json.Unmarshal(rawMsg, &event); err == nil && event.IsValid() { - wsc.EventChannel <- &event - continue - } - - var response WebSocketResponse - if err := json.Unmarshal(rawMsg, &response); err == nil && response.IsValid() { - wsc.ResponseChannel <- &response - continue - } - - } - }() -} - -func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{}) { - req := &WebSocketRequest{} - req.Seq = wsc.Sequence - req.Action = action - req.Data = data - - wsc.Sequence++ - - wsc.Conn.WriteJSON(req) -} - -// UserTyping will push a user_typing event out to all connected users -// who are in the specified channel -func (wsc *WebSocketClient) UserTyping(channelId, parentId string) { - data := map[string]interface{}{ - "channel_id": channelId, - "parent_id": parentId, - } - - wsc.SendMessage("user_typing", data) -} - -// GetStatuses will return a map of string statuses using user id as the key -func (wsc *WebSocketClient) GetStatuses() { - wsc.SendMessage("get_statuses", nil) -} - -// GetStatusesByIds will fetch certain user statuses based on ids and return -// a map of string statuses using user id as the key -func (wsc *WebSocketClient) GetStatusesByIds(userIds []string) { - data := map[string]interface{}{ - "user_ids": userIds, - } - wsc.SendMessage("get_statuses_by_ids", data) -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/websocket_message.go b/vendor/github.com/mattermost/mattermost-server/model/websocket_message.go deleted file mode 100644 index 0256e400..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/websocket_message.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -const ( - WEBSOCKET_EVENT_TYPING = "typing" - WEBSOCKET_EVENT_POSTED = "posted" - WEBSOCKET_EVENT_POST_EDITED = "post_edited" - WEBSOCKET_EVENT_POST_DELETED = "post_deleted" - WEBSOCKET_EVENT_CHANNEL_DELETED = "channel_deleted" - WEBSOCKET_EVENT_CHANNEL_CREATED = "channel_created" - WEBSOCKET_EVENT_CHANNEL_UPDATED = "channel_updated" - WEBSOCKET_EVENT_DIRECT_ADDED = "direct_added" - WEBSOCKET_EVENT_GROUP_ADDED = "group_added" - WEBSOCKET_EVENT_NEW_USER = "new_user" - WEBSOCKET_EVENT_ADDED_TO_TEAM = "added_to_team" - WEBSOCKET_EVENT_LEAVE_TEAM = "leave_team" - WEBSOCKET_EVENT_UPDATE_TEAM = "update_team" - WEBSOCKET_EVENT_DELETE_TEAM = "delete_team" - WEBSOCKET_EVENT_USER_ADDED = "user_added" - WEBSOCKET_EVENT_USER_UPDATED = "user_updated" - WEBSOCKET_EVENT_USER_ROLE_UPDATED = "user_role_updated" - WEBSOCKET_EVENT_MEMBERROLE_UPDATED = "memberrole_updated" - WEBSOCKET_EVENT_USER_REMOVED = "user_removed" - WEBSOCKET_EVENT_PREFERENCE_CHANGED = "preference_changed" - WEBSOCKET_EVENT_PREFERENCES_CHANGED = "preferences_changed" - WEBSOCKET_EVENT_PREFERENCES_DELETED = "preferences_deleted" - WEBSOCKET_EVENT_EPHEMERAL_MESSAGE = "ephemeral_message" - WEBSOCKET_EVENT_STATUS_CHANGE = "status_change" - WEBSOCKET_EVENT_HELLO = "hello" - WEBSOCKET_EVENT_WEBRTC = "webrtc" - WEBSOCKET_AUTHENTICATION_CHALLENGE = "authentication_challenge" - WEBSOCKET_EVENT_REACTION_ADDED = "reaction_added" - WEBSOCKET_EVENT_REACTION_REMOVED = "reaction_removed" - WEBSOCKET_EVENT_RESPONSE = "response" - WEBSOCKET_EVENT_EMOJI_ADDED = "emoji_added" - WEBSOCKET_EVENT_CHANNEL_VIEWED = "channel_viewed" - WEBSOCKET_EVENT_PLUGIN_ACTIVATED = "plugin_activated" // EXPERIMENTAL - SUBJECT TO CHANGE - WEBSOCKET_EVENT_PLUGIN_DEACTIVATED = "plugin_deactivated" // EXPERIMENTAL - SUBJECT TO CHANGE -) - -type WebSocketMessage interface { - ToJson() string - IsValid() bool - EventType() string -} - -type WebsocketBroadcast struct { - OmitUsers map[string]bool `json:"omit_users"` // broadcast is omitted for users listed here - UserId string `json:"user_id"` // broadcast only occurs for this user - ChannelId string `json:"channel_id"` // broadcast only occurs for users in this channel - TeamId string `json:"team_id"` // broadcast only occurs for users in this team -} - -type WebSocketEvent struct { - Event string `json:"event"` - Data map[string]interface{} `json:"data"` - Broadcast *WebsocketBroadcast `json:"broadcast"` - Sequence int64 `json:"seq"` -} - -func (m *WebSocketEvent) Add(key string, value interface{}) { - m.Data[key] = value -} - -func NewWebSocketEvent(event, teamId, channelId, userId string, omitUsers map[string]bool) *WebSocketEvent { - return &WebSocketEvent{Event: event, Data: make(map[string]interface{}), - Broadcast: &WebsocketBroadcast{TeamId: teamId, ChannelId: channelId, UserId: userId, OmitUsers: omitUsers}} -} - -func (o *WebSocketEvent) IsValid() bool { - return o.Event != "" -} - -func (o *WebSocketEvent) EventType() string { - return o.Event -} - -func (o *WebSocketEvent) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func WebSocketEventFromJson(data io.Reader) *WebSocketEvent { - var o *WebSocketEvent - json.NewDecoder(data).Decode(&o) - return o -} - -type WebSocketResponse struct { - Status string `json:"status"` - SeqReply int64 `json:"seq_reply,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - Error *AppError `json:"error,omitempty"` -} - -func (m *WebSocketResponse) Add(key string, value interface{}) { - m.Data[key] = value -} - -func NewWebSocketResponse(status string, seqReply int64, data map[string]interface{}) *WebSocketResponse { - return &WebSocketResponse{Status: status, SeqReply: seqReply, Data: data} -} - -func NewWebSocketError(seqReply int64, err *AppError) *WebSocketResponse { - return &WebSocketResponse{Status: STATUS_FAIL, SeqReply: seqReply, Error: err} -} - -func (o *WebSocketResponse) IsValid() bool { - return o.Status != "" -} - -func (o *WebSocketResponse) EventType() string { - return WEBSOCKET_EVENT_RESPONSE -} - -func (o *WebSocketResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func WebSocketResponseFromJson(data io.Reader) *WebSocketResponse { - var o *WebSocketResponse - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/model/websocket_request.go b/vendor/github.com/mattermost/mattermost-server/model/websocket_request.go deleted file mode 100644 index 4da626e2..00000000 --- a/vendor/github.com/mattermost/mattermost-server/model/websocket_request.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" - - goi18n "github.com/nicksnyder/go-i18n/i18n" -) - -type WebSocketRequest struct { - // Client-provided fields - Seq int64 `json:"seq"` - Action string `json:"action"` - Data map[string]interface{} `json:"data"` - - // Server-provided fields - Session Session `json:"-"` - T goi18n.TranslateFunc `json:"-"` - Locale string `json:"-"` -} - -func (o *WebSocketRequest) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func WebSocketRequestFromJson(data io.Reader) *WebSocketRequest { - var o *WebSocketRequest - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/config.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/config.go deleted file mode 100644 index 577c3eb2..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/config.go +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -package log4go - -import ( - "encoding/xml" - "fmt" - "io/ioutil" - "os" - "strconv" - "strings" -) - -type xmlProperty struct { - Name string `xml:"name,attr"` - Value string `xml:",chardata"` -} - -type xmlFilter struct { - Enabled string `xml:"enabled,attr"` - Tag string `xml:"tag"` - Level string `xml:"level"` - Type string `xml:"type"` - Property []xmlProperty `xml:"property"` -} - -type xmlLoggerConfig struct { - Filter []xmlFilter `xml:"filter"` -} - -// Load XML configuration; see examples/example.xml for documentation -func (log Logger) LoadConfiguration(filename string) { - log.Close() - - // Open the configuration file - fd, err := os.Open(filename) - if err != nil { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Could not open %q for reading: %s\n", filename, err) - os.Exit(1) - } - - contents, err := ioutil.ReadAll(fd) - if err != nil { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Could not read %q: %s\n", filename, err) - os.Exit(1) - } - - xc := new(xmlLoggerConfig) - if err := xml.Unmarshal(contents, xc); err != nil { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Could not parse XML configuration in %q: %s\n", filename, err) - os.Exit(1) - } - - for _, xmlfilt := range xc.Filter { - var filt LogWriter - var lvl Level - bad, good, enabled := false, true, false - - // Check required children - if len(xmlfilt.Enabled) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required attribute %s for filter missing in %s\n", "enabled", filename) - bad = true - } else { - enabled = xmlfilt.Enabled != "false" - } - if len(xmlfilt.Tag) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required child <%s> for filter missing in %s\n", "tag", filename) - bad = true - } - if len(xmlfilt.Type) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required child <%s> for filter missing in %s\n", "type", filename) - bad = true - } - if len(xmlfilt.Level) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required child <%s> for filter missing in %s\n", "level", filename) - bad = true - } - - switch xmlfilt.Level { - case "FINEST": - lvl = FINEST - case "FINE": - lvl = FINE - case "DEBUG": - lvl = DEBUG - case "TRACE": - lvl = TRACE - case "INFO": - lvl = INFO - case "WARNING": - lvl = WARNING - case "ERROR": - lvl = ERROR - case "CRITICAL": - lvl = CRITICAL - default: - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required child <%s> for filter has unknown value in %s: %s\n", "level", filename, xmlfilt.Level) - bad = true - } - - // Just so all of the required attributes are errored at the same time if missing - if bad { - os.Exit(1) - } - - switch xmlfilt.Type { - case "console": - filt, good = xmlToConsoleLogWriter(filename, xmlfilt.Property, enabled) - case "file": - filt, good = xmlToFileLogWriter(filename, xmlfilt.Property, enabled) - case "xml": - filt, good = xmlToXMLLogWriter(filename, xmlfilt.Property, enabled) - case "socket": - filt, good = xmlToSocketLogWriter(filename, xmlfilt.Property, enabled) - default: - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Could not load XML configuration in %s: unknown filter type \"%s\"\n", filename, xmlfilt.Type) - os.Exit(1) - } - - // Just so all of the required params are errored at the same time if wrong - if !good { - os.Exit(1) - } - - // If we're disabled (syntax and correctness checks only), don't add to logger - if !enabled { - continue - } - - log[xmlfilt.Tag] = &Filter{lvl, filt} - } -} - -func xmlToConsoleLogWriter(filename string, props []xmlProperty, enabled bool) (*ConsoleLogWriter, bool) { - // Parse properties - for _, prop := range props { - switch prop.Name { - default: - fmt.Fprintf(os.Stderr, "LoadConfiguration: Warning: Unknown property \"%s\" for console filter in %s\n", prop.Name, filename) - } - } - - // If it's disabled, we're just checking syntax - if !enabled { - return nil, true - } - - return NewConsoleLogWriter(), true -} - -// Parse a number with K/M/G suffixes based on thousands (1000) or 2^10 (1024) -func strToNumSuffix(str string, mult int) int { - num := 1 - if len(str) > 1 { - switch str[len(str)-1] { - case 'G', 'g': - num *= mult - fallthrough - case 'M', 'm': - num *= mult - fallthrough - case 'K', 'k': - num *= mult - str = str[0 : len(str)-1] - } - } - parsed, _ := strconv.Atoi(str) - return parsed * num -} -func xmlToFileLogWriter(filename string, props []xmlProperty, enabled bool) (*FileLogWriter, bool) { - file := "" - format := "[%D %T] [%L] (%S) %M" - maxlines := 0 - maxsize := 0 - daily := false - rotate := false - - // Parse properties - for _, prop := range props { - switch prop.Name { - case "filename": - file = strings.Trim(prop.Value, " \r\n") - case "format": - format = strings.Trim(prop.Value, " \r\n") - case "maxlines": - maxlines = strToNumSuffix(strings.Trim(prop.Value, " \r\n"), 1000) - case "maxsize": - maxsize = strToNumSuffix(strings.Trim(prop.Value, " \r\n"), 1024) - case "daily": - daily = strings.Trim(prop.Value, " \r\n") != "false" - case "rotate": - rotate = strings.Trim(prop.Value, " \r\n") != "false" - default: - fmt.Fprintf(os.Stderr, "LoadConfiguration: Warning: Unknown property \"%s\" for file filter in %s\n", prop.Name, filename) - } - } - - // Check properties - if len(file) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required property \"%s\" for file filter missing in %s\n", "filename", filename) - return nil, false - } - - // If it's disabled, we're just checking syntax - if !enabled { - return nil, true - } - - flw := NewFileLogWriter(file, rotate) - flw.SetFormat(format) - flw.SetRotateLines(maxlines) - flw.SetRotateSize(maxsize) - flw.SetRotateDaily(daily) - return flw, true -} - -func xmlToXMLLogWriter(filename string, props []xmlProperty, enabled bool) (*FileLogWriter, bool) { - file := "" - maxrecords := 0 - maxsize := 0 - daily := false - rotate := false - - // Parse properties - for _, prop := range props { - switch prop.Name { - case "filename": - file = strings.Trim(prop.Value, " \r\n") - case "maxrecords": - maxrecords = strToNumSuffix(strings.Trim(prop.Value, " \r\n"), 1000) - case "maxsize": - maxsize = strToNumSuffix(strings.Trim(prop.Value, " \r\n"), 1024) - case "daily": - daily = strings.Trim(prop.Value, " \r\n") != "false" - case "rotate": - rotate = strings.Trim(prop.Value, " \r\n") != "false" - default: - fmt.Fprintf(os.Stderr, "LoadConfiguration: Warning: Unknown property \"%s\" for xml filter in %s\n", prop.Name, filename) - } - } - - // Check properties - if len(file) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required property \"%s\" for xml filter missing in %s\n", "filename", filename) - return nil, false - } - - // If it's disabled, we're just checking syntax - if !enabled { - return nil, true - } - - xlw := NewXMLLogWriter(file, rotate) - xlw.SetRotateLines(maxrecords) - xlw.SetRotateSize(maxsize) - xlw.SetRotateDaily(daily) - return xlw, true -} - -func xmlToSocketLogWriter(filename string, props []xmlProperty, enabled bool) (SocketLogWriter, bool) { - endpoint := "" - protocol := "udp" - - // Parse properties - for _, prop := range props { - switch prop.Name { - case "endpoint": - endpoint = strings.Trim(prop.Value, " \r\n") - case "protocol": - protocol = strings.Trim(prop.Value, " \r\n") - default: - fmt.Fprintf(os.Stderr, "LoadConfiguration: Warning: Unknown property \"%s\" for file filter in %s\n", prop.Name, filename) - } - } - - // Check properties - if len(endpoint) == 0 { - fmt.Fprintf(os.Stderr, "LoadConfiguration: Error: Required property \"%s\" for file filter missing in %s\n", "endpoint", filename) - return nil, false - } - - // If it's disabled, we're just checking syntax - if !enabled { - return nil, true - } - - return NewSocketLogWriter(protocol, endpoint), true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go deleted file mode 100644 index 698dd332..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "time" -) - -import l4g "code.google.com/p/log4go" - -func main() { - log := l4g.NewLogger() - defer log.Close() - log.AddFilter("stdout", l4g.DEBUG, l4g.NewConsoleLogWriter()) - log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02")) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go deleted file mode 100644 index efd596aa..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go +++ /dev/null @@ -1,57 +0,0 @@ -package main - -import ( - "bufio" - "fmt" - "io" - "os" - "time" -) - -import l4g "code.google.com/p/log4go" - -const ( - filename = "flw.log" -) - -func main() { - // Get a new logger instance - log := l4g.NewLogger() - - // Create a default logger that is logging messages of FINE or higher - log.AddFilter("file", l4g.FINE, l4g.NewFileLogWriter(filename, false)) - log.Close() - - /* Can also specify manually via the following: (these are the defaults) */ - flw := l4g.NewFileLogWriter(filename, false) - flw.SetFormat("[%D %T] [%L] (%S) %M") - flw.SetRotate(false) - flw.SetRotateSize(0) - flw.SetRotateLines(0) - flw.SetRotateDaily(false) - log.AddFilter("file", l4g.FINE, flw) - - // Log some experimental messages - log.Finest("Everything is created now (notice that I will not be printing to the file)") - log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02")) - log.Critical("Time to close out!") - - // Close the log - log.Close() - - // Print what was logged to the file (yes, I know I'm skipping error checking) - fd, _ := os.Open(filename) - in := bufio.NewReader(fd) - fmt.Print("Messages logged to file were: (line numbers not included)\n") - for lineno := 1; ; lineno++ { - line, err := in.ReadString('\n') - if err == io.EOF { - break - } - fmt.Printf("%3d:\t%s", lineno, line) - } - fd.Close() - - // Remove the file so it's not lying around - os.Remove(filename) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go deleted file mode 100644 index 83c80ad1..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "net" - "os" -) - -var ( - port = flag.String("p", "12124", "Port number to listen on") -) - -func e(err error) { - if err != nil { - fmt.Printf("Erroring out: %s\n", err) - os.Exit(1) - } -} - -func main() { - flag.Parse() - - // Bind to the port - bind, err := net.ResolveUDPAddr("0.0.0.0:" + *port) - e(err) - - // Create listener - listener, err := net.ListenUDP("udp", bind) - e(err) - - fmt.Printf("Listening to port %s...\n", *port) - for { - // read into a new buffer - buffer := make([]byte, 1024) - _, _, err := listener.ReadFrom(buffer) - e(err) - - // log to standard output - fmt.Println(string(buffer)) - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go deleted file mode 100644 index 400b698c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "time" -) - -import l4g "code.google.com/p/log4go" - -func main() { - log := l4g.NewLogger() - log.AddFilter("network", l4g.FINEST, l4g.NewSocketLogWriter("udp", "192.168.1.255:12124")) - - // Run `nc -u -l -p 12124` or similar before you run this to see the following message - log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02")) - - // This makes sure the output stream buffer is written - log.Close() -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go deleted file mode 100644 index 164c2add..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import l4g "code.google.com/p/log4go" - -func main() { - // Load the configuration (isn't this easy?) - l4g.LoadConfiguration("example.xml") - - // And now we're ready! - l4g.Finest("This will only go to those of you really cool UDP kids! If you change enabled=true.") - l4g.Debug("Oh no! %d + %d = %d!", 2, 2, 2+2) - l4g.Info("About that time, eh chaps?") -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/filelog.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/filelog.go deleted file mode 100644 index 9bc4df15..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/filelog.go +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -package log4go - -import ( - "fmt" - "os" - "time" -) - -// This log writer sends output to a file -type FileLogWriter struct { - rec chan *LogRecord - rot chan bool - - // The opened file - filename string - file *os.File - - // The logging format - format string - - // File header/trailer - header, trailer string - - // Rotate at linecount - maxlines int - maxlines_curlines int - - // Rotate at size - maxsize int - maxsize_cursize int - - // Rotate daily - daily bool - daily_opendate int - - // Keep old logfiles (.001, .002, etc) - rotate bool - maxbackup int -} - -// This is the FileLogWriter's output method -func (w *FileLogWriter) LogWrite(rec *LogRecord) { - w.rec <- rec -} - -func (w *FileLogWriter) Close() { - close(w.rec) -} - -// NewFileLogWriter creates a new LogWriter which writes to the given file and -// has rotation enabled if rotate is true. -// -// If rotate is true, any time a new log file is opened, the old one is renamed -// with a .### extension to preserve it. The various Set* methods can be used -// to configure log rotation based on lines, size, and daily. -// -// The standard log-line format is: -// [%D %T] [%L] (%S) %M -func NewFileLogWriter(fname string, rotate bool) *FileLogWriter { - w := &FileLogWriter{ - rec: make(chan *LogRecord, LogBufferLength), - rot: make(chan bool), - filename: fname, - format: "[%D %T] [%L] (%S) %M", - rotate: rotate, - maxbackup: 999, - } - - // open the file for the first time - if err := w.intRotate(); err != nil { - fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.filename, err) - return nil - } - - go func() { - defer func() { - if w.file != nil { - fmt.Fprint(w.file, FormatLogRecord(w.trailer, &LogRecord{Created: time.Now()})) - w.file.Sync() - w.file.Close() - } - }() - - for { - select { - case <-w.rot: - if err := w.intRotate(); err != nil { - fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.filename, err) - return - } - case rec, ok := <-w.rec: - if !ok { - return - } - now := time.Now() - if (w.maxlines > 0 && w.maxlines_curlines >= w.maxlines) || - (w.maxsize > 0 && w.maxsize_cursize >= w.maxsize) || - (w.daily && now.Day() != w.daily_opendate) { - if err := w.intRotate(); err != nil { - fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.filename, err) - return - } - } - - // Perform the write - n, err := fmt.Fprint(w.file, FormatLogRecord(w.format, rec)) - if err != nil { - fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.filename, err) - return - } - - // Update the counts - w.maxlines_curlines++ - w.maxsize_cursize += n - } - } - }() - - return w -} - -// Request that the logs rotate -func (w *FileLogWriter) Rotate() { - w.rot <- true -} - -// If this is called in a threaded context, it MUST be synchronized -func (w *FileLogWriter) intRotate() error { - // Close any log file that may be open - if w.file != nil { - fmt.Fprint(w.file, FormatLogRecord(w.trailer, &LogRecord{Created: time.Now()})) - w.file.Close() - } - - // If we are keeping log files, move it to the next available number - if w.rotate { - _, err := os.Lstat(w.filename) - if err == nil { // file exists - // Find the next available number - num := 1 - fname := "" - if w.daily && time.Now().Day() != w.daily_opendate { - yesterday := time.Now().AddDate(0, 0, -1).Format("2006-01-02") - - for ; err == nil && num <= 999; num++ { - fname = w.filename + fmt.Sprintf(".%s.%03d", yesterday, num) - _, err = os.Lstat(fname) - } - // return error if the last file checked still existed - if err == nil { - return fmt.Errorf("Rotate: Cannot find free log number to rename %s\n", w.filename) - } - } else { - num = w.maxbackup - 1 - for ; num >= 1; num-- { - fname = w.filename + fmt.Sprintf(".%d", num) - nfname := w.filename + fmt.Sprintf(".%d", num+1) - _, err = os.Lstat(fname) - if err == nil { - os.Rename(fname, nfname) - } - } - } - - w.file.Close() - // Rename the file to its newfound home - err = os.Rename(w.filename, fname) - if err != nil { - return fmt.Errorf("Rotate: %s\n", err) - } - } - } - - // Open the log file - fd, err := os.OpenFile(w.filename, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0660) - if err != nil { - return err - } - w.file = fd - - now := time.Now() - fmt.Fprint(w.file, FormatLogRecord(w.header, &LogRecord{Created: now})) - - // Set the daily open date to the current date - w.daily_opendate = now.Day() - - // initialize rotation values - w.maxlines_curlines = 0 - w.maxsize_cursize = 0 - - return nil -} - -// Set the logging format (chainable). Must be called before the first log -// message is written. -func (w *FileLogWriter) SetFormat(format string) *FileLogWriter { - w.format = format - return w -} - -// Set the logfile header and footer (chainable). Must be called before the first log -// message is written. These are formatted similar to the FormatLogRecord (e.g. -// you can use %D and %T in your header/footer for date and time). -func (w *FileLogWriter) SetHeadFoot(head, foot string) *FileLogWriter { - w.header, w.trailer = head, foot - if w.maxlines_curlines == 0 { - fmt.Fprint(w.file, FormatLogRecord(w.header, &LogRecord{Created: time.Now()})) - } - return w -} - -// Set rotate at linecount (chainable). Must be called before the first log -// message is written. -func (w *FileLogWriter) SetRotateLines(maxlines int) *FileLogWriter { - //fmt.Fprintf(os.Stderr, "FileLogWriter.SetRotateLines: %v\n", maxlines) - w.maxlines = maxlines - return w -} - -// Set rotate at size (chainable). Must be called before the first log message -// is written. -func (w *FileLogWriter) SetRotateSize(maxsize int) *FileLogWriter { - //fmt.Fprintf(os.Stderr, "FileLogWriter.SetRotateSize: %v\n", maxsize) - w.maxsize = maxsize - return w -} - -// Set rotate daily (chainable). Must be called before the first log message is -// written. -func (w *FileLogWriter) SetRotateDaily(daily bool) *FileLogWriter { - //fmt.Fprintf(os.Stderr, "FileLogWriter.SetRotateDaily: %v\n", daily) - w.daily = daily - return w -} - -// Set max backup files. Must be called before the first log message -// is written. -func (w *FileLogWriter) SetRotateMaxBackup(maxbackup int) *FileLogWriter { - w.maxbackup = maxbackup - return w -} - -// SetRotate changes whether or not the old logs are kept. (chainable) Must be -// called before the first log message is written. If rotate is false, the -// files are overwritten; otherwise, they are rotated to another file before the -// new log is opened. -func (w *FileLogWriter) SetRotate(rotate bool) *FileLogWriter { - //fmt.Fprintf(os.Stderr, "FileLogWriter.SetRotate: %v\n", rotate) - w.rotate = rotate - return w -} - -// NewXMLLogWriter is a utility method for creating a FileLogWriter set up to -// output XML record log messages instead of line-based ones. -func NewXMLLogWriter(fname string, rotate bool) *FileLogWriter { - return NewFileLogWriter(fname, rotate).SetFormat( - ` - %D %T - %S - %M - `).SetHeadFoot("", "") -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/log4go.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/log4go.go deleted file mode 100644 index 822e890c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/log4go.go +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -// Package log4go provides level-based and highly configurable logging. -// -// Enhanced Logging -// -// This is inspired by the logging functionality in Java. Essentially, you create a Logger -// object and create output filters for it. You can send whatever you want to the Logger, -// and it will filter that based on your settings and send it to the outputs. This way, you -// can put as much debug code in your program as you want, and when you're done you can filter -// out the mundane messages so only the important ones show up. -// -// Utility functions are provided to make life easier. Here is some example code to get started: -// -// log := log4go.NewLogger() -// log.AddFilter("stdout", log4go.DEBUG, log4go.NewConsoleLogWriter()) -// log.AddFilter("log", log4go.FINE, log4go.NewFileLogWriter("example.log", true)) -// log.Info("The time is now: %s", time.LocalTime().Format("15:04:05 MST 2006/01/02")) -// -// The first two lines can be combined with the utility NewDefaultLogger: -// -// log := log4go.NewDefaultLogger(log4go.DEBUG) -// log.AddFilter("log", log4go.FINE, log4go.NewFileLogWriter("example.log", true)) -// log.Info("The time is now: %s", time.LocalTime().Format("15:04:05 MST 2006/01/02")) -// -// Usage notes: -// - The ConsoleLogWriter does not display the source of the message to standard -// output, but the FileLogWriter does. -// - The utility functions (Info, Debug, Warn, etc) derive their source from the -// calling function, and this incurs extra overhead. -// -// Changes from 2.0: -// - The external interface has remained mostly stable, but a lot of the -// internals have been changed, so if you depended on any of this or created -// your own LogWriter, then you will probably have to update your code. In -// particular, Logger is now a map and ConsoleLogWriter is now a channel -// behind-the-scenes, and the LogWrite method no longer has return values. -// -// Future work: (please let me know if you think I should work on any of these particularly) -// - Log file rotation -// - Logging configuration files ala log4j -// - Have the ability to remove filters? -// - Have GetInfoChannel, GetDebugChannel, etc return a chan string that allows -// for another method of logging -// - Add an XML filter type -package log4go - -import ( - "errors" - "fmt" - "os" - "runtime" - "strings" - "time" -) - -// Version information -const ( - L4G_VERSION = "log4go-v3.0.1" - L4G_MAJOR = 3 - L4G_MINOR = 0 - L4G_BUILD = 1 -) - -/****** Constants ******/ - -// These are the integer logging levels used by the logger -type Level int - -const ( - FINEST Level = iota - FINE - DEBUG - TRACE - INFO - WARNING - ERROR - CRITICAL -) - -// Logging level strings -var ( - levelStrings = [...]string{"FNST", "FINE", "DEBG", "TRAC", "INFO", "WARN", "EROR", "CRIT"} -) - -func (l Level) String() string { - if l < 0 || int(l) > len(levelStrings) { - return "UNKNOWN" - } - return levelStrings[int(l)] -} - -/****** Variables ******/ -var ( - // LogBufferLength specifies how many log messages a particular log4go - // logger can buffer at a time before writing them. - LogBufferLength = 32 -) - -/****** LogRecord ******/ - -// A LogRecord contains all of the pertinent information for each message -type LogRecord struct { - Level Level // The log level - Created time.Time // The time at which the log message was created (nanoseconds) - Source string // The message source - Message string // The log message -} - -/****** LogWriter ******/ - -// This is an interface for anything that should be able to write logs -type LogWriter interface { - // This will be called to log a LogRecord message. - LogWrite(rec *LogRecord) - - // This should clean up anything lingering about the LogWriter, as it is called before - // the LogWriter is removed. LogWrite should not be called after Close. - Close() -} - -/****** Logger ******/ - -// A Filter represents the log level below which no log records are written to -// the associated LogWriter. -type Filter struct { - Level Level - LogWriter -} - -// A Logger represents a collection of Filters through which log messages are -// written. -type Logger map[string]*Filter - -// Create a new logger. -// -// DEPRECATED: Use make(Logger) instead. -func NewLogger() Logger { - os.Stderr.WriteString("warning: use of deprecated NewLogger\n") - return make(Logger) -} - -// Create a new logger with a "stdout" filter configured to send log messages at -// or above lvl to standard output. -// -// DEPRECATED: use NewDefaultLogger instead. -func NewConsoleLogger(lvl Level) Logger { - os.Stderr.WriteString("warning: use of deprecated NewConsoleLogger\n") - return Logger{ - "stdout": &Filter{lvl, NewConsoleLogWriter()}, - } -} - -// Create a new logger with a "stdout" filter configured to send log messages at -// or above lvl to standard output. -func NewDefaultLogger(lvl Level) Logger { - return Logger{ - "stdout": &Filter{lvl, NewConsoleLogWriter()}, - } -} - -// Closes all log writers in preparation for exiting the program or a -// reconfiguration of logging. Calling this is not really imperative, unless -// you want to guarantee that all log messages are written. Close removes -// all filters (and thus all LogWriters) from the logger. -func (log Logger) Close() { - // Close all open loggers - for name, filt := range log { - filt.Close() - delete(log, name) - } -} - -// Add a new LogWriter to the Logger which will only log messages at lvl or -// higher. This function should not be called from multiple goroutines. -// Returns the logger for chaining. -func (log Logger) AddFilter(name string, lvl Level, writer LogWriter) Logger { - log[name] = &Filter{lvl, writer} - return log -} - -/******* Logging *******/ -// Send a formatted log message internally -func (log Logger) intLogf(lvl Level, format string, args ...interface{}) { - skip := true - - // Determine if any logging will be done - for _, filt := range log { - if lvl >= filt.Level { - skip = false - break - } - } - if skip { - return - } - - // Determine caller func - pc, _, lineno, ok := runtime.Caller(2) - src := "" - if ok { - src = fmt.Sprintf("%s:%d", runtime.FuncForPC(pc).Name(), lineno) - } - - msg := format - if len(args) > 0 { - msg = fmt.Sprintf(format, args...) - } - - // Make the log record - rec := &LogRecord{ - Level: lvl, - Created: time.Now(), - Source: src, - Message: msg, - } - - // Dispatch the logs - for _, filt := range log { - if lvl < filt.Level { - continue - } - filt.LogWrite(rec) - } -} - -// Send a closure log message internally -func (log Logger) intLogc(lvl Level, closure func() string) { - skip := true - - // Determine if any logging will be done - for _, filt := range log { - if lvl >= filt.Level { - skip = false - break - } - } - if skip { - return - } - - // Determine caller func - pc, _, lineno, ok := runtime.Caller(2) - src := "" - if ok { - src = fmt.Sprintf("%s:%d", runtime.FuncForPC(pc).Name(), lineno) - } - - // Make the log record - rec := &LogRecord{ - Level: lvl, - Created: time.Now(), - Source: src, - Message: closure(), - } - - // Dispatch the logs - for _, filt := range log { - if lvl < filt.Level { - continue - } - filt.LogWrite(rec) - } -} - -// Send a log message with manual level, source, and message. -func (log Logger) Log(lvl Level, source, message string) { - skip := true - - // Determine if any logging will be done - for _, filt := range log { - if lvl >= filt.Level { - skip = false - break - } - } - if skip { - return - } - - // Make the log record - rec := &LogRecord{ - Level: lvl, - Created: time.Now(), - Source: source, - Message: message, - } - - // Dispatch the logs - for _, filt := range log { - if lvl < filt.Level { - continue - } - filt.LogWrite(rec) - } -} - -// Logf logs a formatted log message at the given log level, using the caller as -// its source. -func (log Logger) Logf(lvl Level, format string, args ...interface{}) { - log.intLogf(lvl, format, args...) -} - -// Logc logs a string returned by the closure at the given log level, using the caller as -// its source. If no log message would be written, the closure is never called. -func (log Logger) Logc(lvl Level, closure func() string) { - log.intLogc(lvl, closure) -} - -// Finest logs a message at the finest log level. -// See Debug for an explanation of the arguments. -func (log Logger) Finest(arg0 interface{}, args ...interface{}) { - const ( - lvl = FINEST - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - log.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - log.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - log.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Fine logs a message at the fine log level. -// See Debug for an explanation of the arguments. -func (log Logger) Fine(arg0 interface{}, args ...interface{}) { - const ( - lvl = FINE - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - log.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - log.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - log.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Debug is a utility method for debug log messages. -// The behavior of Debug depends on the first argument: -// - arg0 is a string -// When given a string as the first argument, this behaves like Logf but with -// the DEBUG log level: the first argument is interpreted as a format for the -// latter arguments. -// - arg0 is a func()string -// When given a closure of type func()string, this logs the string returned by -// the closure iff it will be logged. The closure runs at most one time. -// - arg0 is interface{} -// When given anything else, the log message will be each of the arguments -// formatted with %v and separated by spaces (ala Sprint). -func (log Logger) Debug(arg0 interface{}, args ...interface{}) { - const ( - lvl = DEBUG - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - log.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - log.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - log.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Trace logs a message at the trace log level. -// See Debug for an explanation of the arguments. -func (log Logger) Trace(arg0 interface{}, args ...interface{}) { - const ( - lvl = TRACE - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - log.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - log.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - log.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Info logs a message at the info log level. -// See Debug for an explanation of the arguments. -func (log Logger) Info(arg0 interface{}, args ...interface{}) { - const ( - lvl = INFO - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - log.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - log.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - log.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Warn logs a message at the warning log level and returns the formatted error. -// At the warning level and higher, there is no performance benefit if the -// message is not actually logged, because all formats are processed and all -// closures are executed to format the error message. -// See Debug for further explanation of the arguments. -func (log Logger) Warn(arg0 interface{}, args ...interface{}) error { - const ( - lvl = WARNING - ) - var msg string - switch first := arg0.(type) { - case string: - // Use the string as a format string - msg = fmt.Sprintf(first, args...) - case func() string: - // Log the closure (no other arguments used) - msg = first() - default: - // Build a format string so that it will be similar to Sprint - msg = fmt.Sprintf(fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...) - } - log.intLogf(lvl, msg) - return errors.New(msg) -} - -// Error logs a message at the error log level and returns the formatted error, -// See Warn for an explanation of the performance and Debug for an explanation -// of the parameters. -func (log Logger) Error(arg0 interface{}, args ...interface{}) error { - const ( - lvl = ERROR - ) - var msg string - switch first := arg0.(type) { - case string: - // Use the string as a format string - msg = fmt.Sprintf(first, args...) - case func() string: - // Log the closure (no other arguments used) - msg = first() - default: - // Build a format string so that it will be similar to Sprint - msg = fmt.Sprintf(fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...) - } - log.intLogf(lvl, msg) - return errors.New(msg) -} - -// Critical logs a message at the critical log level and returns the formatted error, -// See Warn for an explanation of the performance and Debug for an explanation -// of the parameters. -func (log Logger) Critical(arg0 interface{}, args ...interface{}) error { - const ( - lvl = CRITICAL - ) - var msg string - switch first := arg0.(type) { - case string: - // Use the string as a format string - msg = fmt.Sprintf(first, args...) - case func() string: - // Log the closure (no other arguments used) - msg = first() - default: - // Build a format string so that it will be similar to Sprint - msg = fmt.Sprintf(fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...) - } - log.intLogf(lvl, msg) - return errors.New(msg) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/pattlog.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/pattlog.go deleted file mode 100644 index 98632e4d..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/pattlog.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -package log4go - -import ( - "bytes" - "fmt" - "io" - "strings" - "sync" -) - -const ( - FORMAT_DEFAULT = "[%D %T] [%L] (%S) %M" - FORMAT_SHORT = "[%t %d] [%L] %M" - FORMAT_ABBREV = "[%L] %M" -) - -type formatCacheType struct { - LastUpdateSeconds int64 - shortTime, shortDate string - longTime, longDate string -} - -var formatCache = &formatCacheType{} -var mutex sync.Mutex - -// Known format codes: -// %T - Time (15:04:05 MST) -// %t - Time (15:04) -// %D - Date (2006/01/02) -// %d - Date (01/02/06) -// %L - Level (FNST, FINE, DEBG, TRAC, WARN, EROR, CRIT) -// %S - Source -// %M - Message -// Ignores unknown formats -// Recommended: "[%D %T] [%L] (%S) %M" -func FormatLogRecord(format string, rec *LogRecord) string { - if rec == nil { - return "" - } - if len(format) == 0 { - return "" - } - - out := bytes.NewBuffer(make([]byte, 0, 64)) - secs := rec.Created.UnixNano() / 1e9 - - mutex.Lock() - cache := *formatCache - if cache.LastUpdateSeconds != secs { - month, day, year := rec.Created.Month(), rec.Created.Day(), rec.Created.Year() - hour, minute, second := rec.Created.Hour(), rec.Created.Minute(), rec.Created.Second() - zone, _ := rec.Created.Zone() - updated := &formatCacheType{ - LastUpdateSeconds: secs, - shortTime: fmt.Sprintf("%02d:%02d", hour, minute), - shortDate: fmt.Sprintf("%02d/%02d/%02d", day, month, year%100), - longTime: fmt.Sprintf("%02d:%02d:%02d %s", hour, minute, second, zone), - longDate: fmt.Sprintf("%04d/%02d/%02d", year, month, day), - } - cache = *updated - formatCache = updated - } - mutex.Unlock() - - // Split the string into pieces by % signs - pieces := bytes.Split([]byte(format), []byte{'%'}) - - // Iterate over the pieces, replacing known formats - for i, piece := range pieces { - if i > 0 && len(piece) > 0 { - switch piece[0] { - case 'T': - out.WriteString(cache.longTime) - case 't': - out.WriteString(cache.shortTime) - case 'D': - out.WriteString(cache.longDate) - case 'd': - out.WriteString(cache.shortDate) - case 'L': - out.WriteString(levelStrings[rec.Level]) - case 'S': - out.WriteString(rec.Source) - case 's': - slice := strings.Split(rec.Source, "/") - out.WriteString(slice[len(slice)-1]) - case 'M': - out.WriteString(rec.Message) - } - if len(piece) > 1 { - out.Write(piece[1:]) - } - } else if len(piece) > 0 { - out.Write(piece) - } - } - out.WriteByte('\n') - - return out.String() -} - -// This is the standard writer that prints to standard output. -type FormatLogWriter chan *LogRecord - -// This creates a new FormatLogWriter -func NewFormatLogWriter(out io.Writer, format string) FormatLogWriter { - records := make(FormatLogWriter, LogBufferLength) - go records.run(out, format) - return records -} - -func (w FormatLogWriter) run(out io.Writer, format string) { - for rec := range w { - fmt.Fprint(out, FormatLogRecord(format, rec)) - } -} - -// This is the FormatLogWriter's output method. This will block if the output -// buffer is full. -func (w FormatLogWriter) LogWrite(rec *LogRecord) { - w <- rec -} - -// Close stops the logger from sending messages to standard output. Attempts to -// send log messages to this logger after a Close have undefined behavior. -func (w FormatLogWriter) Close() { - close(w) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/socklog.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/socklog.go deleted file mode 100644 index 1d224a99..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/socklog.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -package log4go - -import ( - "encoding/json" - "fmt" - "net" - "os" -) - -// This log writer sends output to a socket -type SocketLogWriter chan *LogRecord - -// This is the SocketLogWriter's output method -func (w SocketLogWriter) LogWrite(rec *LogRecord) { - w <- rec -} - -func (w SocketLogWriter) Close() { - close(w) -} - -func NewSocketLogWriter(proto, hostport string) SocketLogWriter { - sock, err := net.Dial(proto, hostport) - if err != nil { - fmt.Fprintf(os.Stderr, "NewSocketLogWriter(%q): %s\n", hostport, err) - return nil - } - - w := SocketLogWriter(make(chan *LogRecord, LogBufferLength)) - - go func() { - defer func() { - if sock != nil && proto == "tcp" { - sock.Close() - } - }() - - for rec := range w { - // Marshall into JSON - js, err := json.Marshal(rec) - if err != nil { - fmt.Fprint(os.Stderr, "SocketLogWriter(%q): %s", hostport, err) - return - } - - _, err = sock.Write(js) - if err != nil { - fmt.Fprint(os.Stderr, "SocketLogWriter(%q): %s", hostport, err) - return - } - } - }() - - return w -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/termlog.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/termlog.go deleted file mode 100644 index 8a941e26..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/termlog.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -package log4go - -import ( - "fmt" - "io" - "os" - "time" -) - -var stdout io.Writer = os.Stdout - -// This is the standard writer that prints to standard output. -type ConsoleLogWriter struct { - format string - w chan *LogRecord -} - -// This creates a new ConsoleLogWriter -func NewConsoleLogWriter() *ConsoleLogWriter { - consoleWriter := &ConsoleLogWriter{ - format: "[%T %D] [%L] (%S) %M", - w: make(chan *LogRecord, LogBufferLength), - } - go consoleWriter.run(stdout) - return consoleWriter -} -func (c *ConsoleLogWriter) SetFormat(format string) { - c.format = format -} -func (c *ConsoleLogWriter) run(out io.Writer) { - for rec := range c.w { - fmt.Fprint(out, FormatLogRecord(c.format, rec)) - } -} - -// This is the ConsoleLogWriter's output method. This will block if the output -// buffer is full. -func (c *ConsoleLogWriter) LogWrite(rec *LogRecord) { - c.w <- rec -} - -// Close stops the logger from sending messages to standard output. Attempts to -// send log messages to this logger after a Close have undefined behavior. -func (c *ConsoleLogWriter) Close() { - close(c.w) - time.Sleep(50 * time.Millisecond) // Try to give console I/O time to complete -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/wrapper.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/wrapper.go deleted file mode 100644 index 2ae222b0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/alecthomas/log4go/wrapper.go +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (C) 2010, Kyle Lemons . All rights reserved. - -package log4go - -import ( - "errors" - "fmt" - "os" - "strings" -) - -var ( - Global Logger -) - -func init() { - Global = NewDefaultLogger(DEBUG) -} - -// Wrapper for (*Logger).LoadConfiguration -func LoadConfiguration(filename string) { - Global.LoadConfiguration(filename) -} - -// Wrapper for (*Logger).AddFilter -func AddFilter(name string, lvl Level, writer LogWriter) { - Global.AddFilter(name, lvl, writer) -} - -// Wrapper for (*Logger).Close (closes and removes all logwriters) -func Close() { - Global.Close() -} - -func Crash(args ...interface{}) { - if len(args) > 0 { - Global.intLogf(CRITICAL, strings.Repeat(" %v", len(args))[1:], args...) - } - panic(args) -} - -// Logs the given message and crashes the program -func Crashf(format string, args ...interface{}) { - Global.intLogf(CRITICAL, format, args...) - Global.Close() // so that hopefully the messages get logged - panic(fmt.Sprintf(format, args...)) -} - -// Compatibility with `log` -func Exit(args ...interface{}) { - if len(args) > 0 { - Global.intLogf(ERROR, strings.Repeat(" %v", len(args))[1:], args...) - } - Global.Close() // so that hopefully the messages get logged - os.Exit(0) -} - -// Compatibility with `log` -func Exitf(format string, args ...interface{}) { - Global.intLogf(ERROR, format, args...) - Global.Close() // so that hopefully the messages get logged - os.Exit(0) -} - -// Compatibility with `log` -func Stderr(args ...interface{}) { - if len(args) > 0 { - Global.intLogf(ERROR, strings.Repeat(" %v", len(args))[1:], args...) - } -} - -// Compatibility with `log` -func Stderrf(format string, args ...interface{}) { - Global.intLogf(ERROR, format, args...) -} - -// Compatibility with `log` -func Stdout(args ...interface{}) { - if len(args) > 0 { - Global.intLogf(INFO, strings.Repeat(" %v", len(args))[1:], args...) - } -} - -// Compatibility with `log` -func Stdoutf(format string, args ...interface{}) { - Global.intLogf(INFO, format, args...) -} - -// Send a log message manually -// Wrapper for (*Logger).Log -func Log(lvl Level, source, message string) { - Global.Log(lvl, source, message) -} - -// Send a formatted log message easily -// Wrapper for (*Logger).Logf -func Logf(lvl Level, format string, args ...interface{}) { - Global.intLogf(lvl, format, args...) -} - -// Send a closure log message -// Wrapper for (*Logger).Logc -func Logc(lvl Level, closure func() string) { - Global.intLogc(lvl, closure) -} - -// Utility for finest log messages (see Debug() for parameter explanation) -// Wrapper for (*Logger).Finest -func Finest(arg0 interface{}, args ...interface{}) { - const ( - lvl = FINEST - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - Global.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Utility for fine log messages (see Debug() for parameter explanation) -// Wrapper for (*Logger).Fine -func Fine(arg0 interface{}, args ...interface{}) { - const ( - lvl = FINE - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - Global.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Utility for debug log messages -// When given a string as the first argument, this behaves like Logf but with the DEBUG log level (e.g. the first argument is interpreted as a format for the latter arguments) -// When given a closure of type func()string, this logs the string returned by the closure iff it will be logged. The closure runs at most one time. -// When given anything else, the log message will be each of the arguments formatted with %v and separated by spaces (ala Sprint). -// Wrapper for (*Logger).Debug -func Debug(arg0 interface{}, args ...interface{}) { - const ( - lvl = DEBUG - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - Global.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Utility for trace log messages (see Debug() for parameter explanation) -// Wrapper for (*Logger).Trace -func Trace(arg0 interface{}, args ...interface{}) { - const ( - lvl = TRACE - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - Global.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Utility for info log messages (see Debug() for parameter explanation) -// Wrapper for (*Logger).Info -func Info(arg0 interface{}, args ...interface{}) { - const ( - lvl = INFO - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - case func() string: - // Log the closure (no other arguments used) - Global.intLogc(lvl, first) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...) - } -} - -// Utility for warn log messages (returns an error for easy function returns) (see Debug() for parameter explanation) -// These functions will execute a closure exactly once, to build the error message for the return -// Wrapper for (*Logger).Warn -func Warn(arg0 interface{}, args ...interface{}) error { - const ( - lvl = WARNING - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - return errors.New(fmt.Sprintf(first, args...)) - case func() string: - // Log the closure (no other arguments used) - str := first() - Global.intLogf(lvl, "%s", str) - return errors.New(str) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...) - return errors.New(fmt.Sprint(first) + fmt.Sprintf(strings.Repeat(" %v", len(args)), args...)) - } - return nil -} - -// Utility for error log messages (returns an error for easy function returns) (see Debug() for parameter explanation) -// These functions will execute a closure exactly once, to build the error message for the return -// Wrapper for (*Logger).Error -func Error(arg0 interface{}, args ...interface{}) error { - const ( - lvl = ERROR - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - return errors.New(fmt.Sprintf(first, args...)) - case func() string: - // Log the closure (no other arguments used) - str := first() - Global.intLogf(lvl, "%s", str) - return errors.New(str) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...) - return errors.New(fmt.Sprint(first) + fmt.Sprintf(strings.Repeat(" %v", len(args)), args...)) - } - return nil -} - -// Utility for critical log messages (returns an error for easy function returns) (see Debug() for parameter explanation) -// These functions will execute a closure exactly once, to build the error message for the return -// Wrapper for (*Logger).Critical -func Critical(arg0 interface{}, args ...interface{}) error { - const ( - lvl = CRITICAL - ) - switch first := arg0.(type) { - case string: - // Use the string as a format string - Global.intLogf(lvl, first, args...) - return errors.New(fmt.Sprintf(first, args...)) - case func() string: - // Log the closure (no other arguments used) - str := first() - Global.intLogf(lvl, "%s", str) - return errors.New(str) - default: - // Build a format string so that it will be similar to Sprint - Global.intLogf(lvl, fmt.Sprint(first)+strings.Repeat(" %v", len(args)), args...) - return errors.New(fmt.Sprint(first) + fmt.Sprintf(strings.Repeat(" %v", len(args)), args...)) - } - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/add.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/add.go deleted file mode 100644 index 0e5f6cdb..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/add.go +++ /dev/null @@ -1,113 +0,0 @@ -// -// https://tools.ietf.org/html/rfc4511 -// -// AddRequest ::= [APPLICATION 8] SEQUENCE { -// entry LDAPDN, -// attributes AttributeList } -// -// AttributeList ::= SEQUENCE OF attribute Attribute - -package ldap - -import ( - "errors" - "log" - - "gopkg.in/asn1-ber.v1" -) - -// Attribute represents an LDAP attribute -type Attribute struct { - // Type is the name of the LDAP attribute - Type string - // Vals are the LDAP attribute values - Vals []string -} - -func (a *Attribute) encode() *ber.Packet { - seq := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Attribute") - seq.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, a.Type, "Type")) - set := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSet, nil, "AttributeValue") - for _, value := range a.Vals { - set.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, value, "Vals")) - } - seq.AppendChild(set) - return seq -} - -// AddRequest represents an LDAP AddRequest operation -type AddRequest struct { - // DN identifies the entry being added - DN string - // Attributes list the attributes of the new entry - Attributes []Attribute -} - -func (a AddRequest) encode() *ber.Packet { - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationAddRequest, nil, "Add Request") - request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, a.DN, "DN")) - attributes := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Attributes") - for _, attribute := range a.Attributes { - attributes.AppendChild(attribute.encode()) - } - request.AppendChild(attributes) - return request -} - -// Attribute adds an attribute with the given type and values -func (a *AddRequest) Attribute(attrType string, attrVals []string) { - a.Attributes = append(a.Attributes, Attribute{Type: attrType, Vals: attrVals}) -} - -// NewAddRequest returns an AddRequest for the given DN, with no attributes -func NewAddRequest(dn string) *AddRequest { - return &AddRequest{ - DN: dn, - } - -} - -// Add performs the given AddRequest -func (l *Conn) Add(addRequest *AddRequest) error { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - packet.AppendChild(addRequest.encode()) - - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return err - } - defer l.finishMessage(msgCtx) - - l.Debug.Printf("%d: waiting for response", msgCtx.id) - packetResponse, ok := <-msgCtx.responses - if !ok { - return NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return err - } - ber.PrintPacket(packet) - } - - if packet.Children[1].Tag == ApplicationAddResponse { - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return NewError(resultCode, errors.New(resultDescription)) - } - } else { - log.Printf("Unexpected Response: %d", packet.Children[1].Tag) - } - - l.Debug.Printf("%d: returning", msgCtx.id) - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value.go deleted file mode 100644 index bccf7573..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build go1.4 - -package ldap - -import ( - "sync/atomic" -) - -// For compilers that support it, we just use the underlying sync/atomic.Value -// type. -type atomicValue struct { - atomic.Value -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value_go13.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value_go13.go deleted file mode 100644 index 04920bb2..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/atomic_value_go13.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build !go1.4 - -package ldap - -import ( - "sync" -) - -// This is a helper type that emulates the use of the "sync/atomic.Value" -// struct that's available in Go 1.4 and up. -type atomicValue struct { - value interface{} - lock sync.RWMutex -} - -func (av *atomicValue) Store(val interface{}) { - av.lock.Lock() - av.value = val - av.lock.Unlock() -} - -func (av *atomicValue) Load() interface{} { - av.lock.RLock() - ret := av.value - av.lock.RUnlock() - - return ret -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/bind.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/bind.go deleted file mode 100644 index 26b3cc72..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/bind.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ldap - -import ( - "errors" - - "gopkg.in/asn1-ber.v1" -) - -// SimpleBindRequest represents a username/password bind operation -type SimpleBindRequest struct { - // Username is the name of the Directory object that the client wishes to bind as - Username string - // Password is the credentials to bind with - Password string - // Controls are optional controls to send with the bind request - Controls []Control -} - -// SimpleBindResult contains the response from the server -type SimpleBindResult struct { - Controls []Control -} - -// NewSimpleBindRequest returns a bind request -func NewSimpleBindRequest(username string, password string, controls []Control) *SimpleBindRequest { - return &SimpleBindRequest{ - Username: username, - Password: password, - Controls: controls, - } -} - -func (bindRequest *SimpleBindRequest) encode() *ber.Packet { - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationBindRequest, nil, "Bind Request") - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, 3, "Version")) - request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, bindRequest.Username, "User Name")) - request.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 0, bindRequest.Password, "Password")) - - request.AppendChild(encodeControls(bindRequest.Controls)) - - return request -} - -// SimpleBind performs the simple bind operation defined in the given request -func (l *Conn) SimpleBind(simpleBindRequest *SimpleBindRequest) (*SimpleBindResult, error) { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - encodedBindRequest := simpleBindRequest.encode() - packet.AppendChild(encodedBindRequest) - - if l.Debug { - ber.PrintPacket(packet) - } - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return nil, err - } - defer l.finishMessage(msgCtx) - - packetResponse, ok := <-msgCtx.responses - if !ok { - return nil, NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return nil, err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return nil, err - } - ber.PrintPacket(packet) - } - - result := &SimpleBindResult{ - Controls: make([]Control, 0), - } - - if len(packet.Children) == 3 { - for _, child := range packet.Children[2].Children { - result.Controls = append(result.Controls, DecodeControl(child)) - } - } - - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return result, NewError(resultCode, errors.New(resultDescription)) - } - - return result, nil -} - -// Bind performs a bind with the given username and password -func (l *Conn) Bind(username, password string) error { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - bindRequest := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationBindRequest, nil, "Bind Request") - bindRequest.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, 3, "Version")) - bindRequest.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, username, "User Name")) - bindRequest.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 0, password, "Password")) - packet.AppendChild(bindRequest) - - if l.Debug { - ber.PrintPacket(packet) - } - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return err - } - defer l.finishMessage(msgCtx) - - packetResponse, ok := <-msgCtx.responses - if !ok { - return NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return err - } - ber.PrintPacket(packet) - } - - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return NewError(resultCode, errors.New(resultDescription)) - } - - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/client.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/client.go deleted file mode 100644 index 055b27b5..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/client.go +++ /dev/null @@ -1,27 +0,0 @@ -package ldap - -import ( - "crypto/tls" - "time" -) - -// Client knows how to interact with an LDAP server -type Client interface { - Start() - StartTLS(config *tls.Config) error - Close() - SetTimeout(time.Duration) - - Bind(username, password string) error - SimpleBind(simpleBindRequest *SimpleBindRequest) (*SimpleBindResult, error) - - Add(addRequest *AddRequest) error - Del(delRequest *DelRequest) error - Modify(modifyRequest *ModifyRequest) error - - Compare(dn, attribute, value string) (bool, error) - PasswordModify(passwordModifyRequest *PasswordModifyRequest) (*PasswordModifyResult, error) - - Search(searchRequest *SearchRequest) (*SearchResult, error) - SearchWithPaging(searchRequest *SearchRequest, pagingSize uint32) (*SearchResult, error) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/compare.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/compare.go deleted file mode 100644 index cc6d2af5..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/compare.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// File contains Compare functionality -// -// https://tools.ietf.org/html/rfc4511 -// -// CompareRequest ::= [APPLICATION 14] SEQUENCE { -// entry LDAPDN, -// ava AttributeValueAssertion } -// -// AttributeValueAssertion ::= SEQUENCE { -// attributeDesc AttributeDescription, -// assertionValue AssertionValue } -// -// AttributeDescription ::= LDAPString -// -- Constrained to -// -- [RFC4512] -// -// AttributeValue ::= OCTET STRING -// - -package ldap - -import ( - "errors" - "fmt" - - "gopkg.in/asn1-ber.v1" -) - -// Compare checks to see if the attribute of the dn matches value. Returns true if it does otherwise -// false with any error that occurs if any. -func (l *Conn) Compare(dn, attribute, value string) (bool, error) { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationCompareRequest, nil, "Compare Request") - request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, dn, "DN")) - - ava := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "AttributeValueAssertion") - ava.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, attribute, "AttributeDesc")) - ava.AppendChild(ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagOctetString, value, "AssertionValue")) - request.AppendChild(ava) - packet.AppendChild(request) - - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return false, err - } - defer l.finishMessage(msgCtx) - - l.Debug.Printf("%d: waiting for response", msgCtx.id) - packetResponse, ok := <-msgCtx.responses - if !ok { - return false, NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return false, err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return false, err - } - ber.PrintPacket(packet) - } - - if packet.Children[1].Tag == ApplicationCompareResponse { - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode == LDAPResultCompareTrue { - return true, nil - } else if resultCode == LDAPResultCompareFalse { - return false, nil - } else { - return false, NewError(resultCode, errors.New(resultDescription)) - } - } - return false, fmt.Errorf("Unexpected Response: %d", packet.Children[1].Tag) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/conn.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/conn.go deleted file mode 100644 index eb28eb47..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/conn.go +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ldap - -import ( - "crypto/tls" - "errors" - "fmt" - "log" - "net" - "sync" - "sync/atomic" - "time" - - "gopkg.in/asn1-ber.v1" -) - -const ( - // MessageQuit causes the processMessages loop to exit - MessageQuit = 0 - // MessageRequest sends a request to the server - MessageRequest = 1 - // MessageResponse receives a response from the server - MessageResponse = 2 - // MessageFinish indicates the client considers a particular message ID to be finished - MessageFinish = 3 - // MessageTimeout indicates the client-specified timeout for a particular message ID has been reached - MessageTimeout = 4 -) - -// PacketResponse contains the packet or error encountered reading a response -type PacketResponse struct { - // Packet is the packet read from the server - Packet *ber.Packet - // Error is an error encountered while reading - Error error -} - -// ReadPacket returns the packet or an error -func (pr *PacketResponse) ReadPacket() (*ber.Packet, error) { - if (pr == nil) || (pr.Packet == nil && pr.Error == nil) { - return nil, NewError(ErrorNetwork, errors.New("ldap: could not retrieve response")) - } - return pr.Packet, pr.Error -} - -type messageContext struct { - id int64 - // close(done) should only be called from finishMessage() - done chan struct{} - // close(responses) should only be called from processMessages(), and only sent to from sendResponse() - responses chan *PacketResponse -} - -// sendResponse should only be called within the processMessages() loop which -// is also responsible for closing the responses channel. -func (msgCtx *messageContext) sendResponse(packet *PacketResponse) { - select { - case msgCtx.responses <- packet: - // Successfully sent packet to message handler. - case <-msgCtx.done: - // The request handler is done and will not receive more - // packets. - } -} - -type messagePacket struct { - Op int - MessageID int64 - Packet *ber.Packet - Context *messageContext -} - -type sendMessageFlags uint - -const ( - startTLS sendMessageFlags = 1 << iota -) - -// Conn represents an LDAP Connection -type Conn struct { - conn net.Conn - isTLS bool - closing uint32 - closeErr atomicValue - isStartingTLS bool - Debug debugging - chanConfirm chan struct{} - messageContexts map[int64]*messageContext - chanMessage chan *messagePacket - chanMessageID chan int64 - wgClose sync.WaitGroup - outstandingRequests uint - messageMutex sync.Mutex - requestTimeout int64 -} - -var _ Client = &Conn{} - -// DefaultTimeout is a package-level variable that sets the timeout value -// used for the Dial and DialTLS methods. -// -// WARNING: since this is a package-level variable, setting this value from -// multiple places will probably result in undesired behaviour. -var DefaultTimeout = 60 * time.Second - -// Dial connects to the given address on the given network using net.Dial -// and then returns a new Conn for the connection. -func Dial(network, addr string) (*Conn, error) { - c, err := net.DialTimeout(network, addr, DefaultTimeout) - if err != nil { - return nil, NewError(ErrorNetwork, err) - } - conn := NewConn(c, false) - conn.Start() - return conn, nil -} - -// DialTLS connects to the given address on the given network using tls.Dial -// and then returns a new Conn for the connection. -func DialTLS(network, addr string, config *tls.Config) (*Conn, error) { - dc, err := net.DialTimeout(network, addr, DefaultTimeout) - if err != nil { - return nil, NewError(ErrorNetwork, err) - } - c := tls.Client(dc, config) - err = c.Handshake() - if err != nil { - // Handshake error, close the established connection before we return an error - dc.Close() - return nil, NewError(ErrorNetwork, err) - } - conn := NewConn(c, true) - conn.Start() - return conn, nil -} - -// NewConn returns a new Conn using conn for network I/O. -func NewConn(conn net.Conn, isTLS bool) *Conn { - return &Conn{ - conn: conn, - chanConfirm: make(chan struct{}), - chanMessageID: make(chan int64), - chanMessage: make(chan *messagePacket, 10), - messageContexts: map[int64]*messageContext{}, - requestTimeout: 0, - isTLS: isTLS, - } -} - -// Start initializes goroutines to read responses and process messages -func (l *Conn) Start() { - go l.reader() - go l.processMessages() - l.wgClose.Add(1) -} - -// isClosing returns whether or not we're currently closing. -func (l *Conn) isClosing() bool { - return atomic.LoadUint32(&l.closing) == 1 -} - -// setClosing sets the closing value to true -func (l *Conn) setClosing() bool { - return atomic.CompareAndSwapUint32(&l.closing, 0, 1) -} - -// Close closes the connection. -func (l *Conn) Close() { - l.messageMutex.Lock() - defer l.messageMutex.Unlock() - - if l.setClosing() { - l.Debug.Printf("Sending quit message and waiting for confirmation") - l.chanMessage <- &messagePacket{Op: MessageQuit} - <-l.chanConfirm - close(l.chanMessage) - - l.Debug.Printf("Closing network connection") - if err := l.conn.Close(); err != nil { - log.Println(err) - } - - l.wgClose.Done() - } - l.wgClose.Wait() -} - -// SetTimeout sets the time after a request is sent that a MessageTimeout triggers -func (l *Conn) SetTimeout(timeout time.Duration) { - if timeout > 0 { - atomic.StoreInt64(&l.requestTimeout, int64(timeout)) - } -} - -// Returns the next available messageID -func (l *Conn) nextMessageID() int64 { - if messageID, ok := <-l.chanMessageID; ok { - return messageID - } - return 0 -} - -// StartTLS sends the command to start a TLS session and then creates a new TLS Client -func (l *Conn) StartTLS(config *tls.Config) error { - if l.isTLS { - return NewError(ErrorNetwork, errors.New("ldap: already encrypted")) - } - - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationExtendedRequest, nil, "Start TLS") - request.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 0, "1.3.6.1.4.1.1466.20037", "TLS Extended Command")) - packet.AppendChild(request) - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessageWithFlags(packet, startTLS) - if err != nil { - return err - } - defer l.finishMessage(msgCtx) - - l.Debug.Printf("%d: waiting for response", msgCtx.id) - - packetResponse, ok := <-msgCtx.responses - if !ok { - return NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - l.Close() - return err - } - ber.PrintPacket(packet) - } - - if resultCode, message := getLDAPResultCode(packet); resultCode == LDAPResultSuccess { - conn := tls.Client(l.conn, config) - - if err := conn.Handshake(); err != nil { - l.Close() - return NewError(ErrorNetwork, fmt.Errorf("TLS handshake failed (%v)", err)) - } - - l.isTLS = true - l.conn = conn - } else { - return NewError(resultCode, fmt.Errorf("ldap: cannot StartTLS (%s)", message)) - } - go l.reader() - - return nil -} - -func (l *Conn) sendMessage(packet *ber.Packet) (*messageContext, error) { - return l.sendMessageWithFlags(packet, 0) -} - -func (l *Conn) sendMessageWithFlags(packet *ber.Packet, flags sendMessageFlags) (*messageContext, error) { - if l.isClosing() { - return nil, NewError(ErrorNetwork, errors.New("ldap: connection closed")) - } - l.messageMutex.Lock() - l.Debug.Printf("flags&startTLS = %d", flags&startTLS) - if l.isStartingTLS { - l.messageMutex.Unlock() - return nil, NewError(ErrorNetwork, errors.New("ldap: connection is in startls phase")) - } - if flags&startTLS != 0 { - if l.outstandingRequests != 0 { - l.messageMutex.Unlock() - return nil, NewError(ErrorNetwork, errors.New("ldap: cannot StartTLS with outstanding requests")) - } - l.isStartingTLS = true - } - l.outstandingRequests++ - - l.messageMutex.Unlock() - - responses := make(chan *PacketResponse) - messageID := packet.Children[0].Value.(int64) - message := &messagePacket{ - Op: MessageRequest, - MessageID: messageID, - Packet: packet, - Context: &messageContext{ - id: messageID, - done: make(chan struct{}), - responses: responses, - }, - } - l.sendProcessMessage(message) - return message.Context, nil -} - -func (l *Conn) finishMessage(msgCtx *messageContext) { - close(msgCtx.done) - - if l.isClosing() { - return - } - - l.messageMutex.Lock() - l.outstandingRequests-- - if l.isStartingTLS { - l.isStartingTLS = false - } - l.messageMutex.Unlock() - - message := &messagePacket{ - Op: MessageFinish, - MessageID: msgCtx.id, - } - l.sendProcessMessage(message) -} - -func (l *Conn) sendProcessMessage(message *messagePacket) bool { - l.messageMutex.Lock() - defer l.messageMutex.Unlock() - if l.isClosing() { - return false - } - l.chanMessage <- message - return true -} - -func (l *Conn) processMessages() { - defer func() { - if err := recover(); err != nil { - log.Printf("ldap: recovered panic in processMessages: %v", err) - } - for messageID, msgCtx := range l.messageContexts { - // If we are closing due to an error, inform anyone who - // is waiting about the error. - if l.isClosing() && l.closeErr.Load() != nil { - msgCtx.sendResponse(&PacketResponse{Error: l.closeErr.Load().(error)}) - } - l.Debug.Printf("Closing channel for MessageID %d", messageID) - close(msgCtx.responses) - delete(l.messageContexts, messageID) - } - close(l.chanMessageID) - close(l.chanConfirm) - }() - - var messageID int64 = 1 - for { - select { - case l.chanMessageID <- messageID: - messageID++ - case message := <-l.chanMessage: - switch message.Op { - case MessageQuit: - l.Debug.Printf("Shutting down - quit message received") - return - case MessageRequest: - // Add to message list and write to network - l.Debug.Printf("Sending message %d", message.MessageID) - - buf := message.Packet.Bytes() - _, err := l.conn.Write(buf) - if err != nil { - l.Debug.Printf("Error Sending Message: %s", err.Error()) - message.Context.sendResponse(&PacketResponse{Error: fmt.Errorf("unable to send request: %s", err)}) - close(message.Context.responses) - break - } - - // Only add to messageContexts if we were able to - // successfully write the message. - l.messageContexts[message.MessageID] = message.Context - - // Add timeout if defined - requestTimeout := time.Duration(atomic.LoadInt64(&l.requestTimeout)) - if requestTimeout > 0 { - go func() { - defer func() { - if err := recover(); err != nil { - log.Printf("ldap: recovered panic in RequestTimeout: %v", err) - } - }() - time.Sleep(requestTimeout) - timeoutMessage := &messagePacket{ - Op: MessageTimeout, - MessageID: message.MessageID, - } - l.sendProcessMessage(timeoutMessage) - }() - } - case MessageResponse: - l.Debug.Printf("Receiving message %d", message.MessageID) - if msgCtx, ok := l.messageContexts[message.MessageID]; ok { - msgCtx.sendResponse(&PacketResponse{message.Packet, nil}) - } else { - log.Printf("Received unexpected message %d, %v", message.MessageID, l.isClosing()) - ber.PrintPacket(message.Packet) - } - case MessageTimeout: - // Handle the timeout by closing the channel - // All reads will return immediately - if msgCtx, ok := l.messageContexts[message.MessageID]; ok { - l.Debug.Printf("Receiving message timeout for %d", message.MessageID) - msgCtx.sendResponse(&PacketResponse{message.Packet, errors.New("ldap: connection timed out")}) - delete(l.messageContexts, message.MessageID) - close(msgCtx.responses) - } - case MessageFinish: - l.Debug.Printf("Finished message %d", message.MessageID) - if msgCtx, ok := l.messageContexts[message.MessageID]; ok { - delete(l.messageContexts, message.MessageID) - close(msgCtx.responses) - } - } - } - } -} - -func (l *Conn) reader() { - cleanstop := false - defer func() { - if err := recover(); err != nil { - log.Printf("ldap: recovered panic in reader: %v", err) - } - if !cleanstop { - l.Close() - } - }() - - for { - if cleanstop { - l.Debug.Printf("reader clean stopping (without closing the connection)") - return - } - packet, err := ber.ReadPacket(l.conn) - if err != nil { - // A read error is expected here if we are closing the connection... - if !l.isClosing() { - l.closeErr.Store(fmt.Errorf("unable to read LDAP response packet: %s", err)) - l.Debug.Printf("reader error: %s", err.Error()) - } - return - } - addLDAPDescriptions(packet) - if len(packet.Children) == 0 { - l.Debug.Printf("Received bad ldap packet") - continue - } - l.messageMutex.Lock() - if l.isStartingTLS { - cleanstop = true - } - l.messageMutex.Unlock() - message := &messagePacket{ - Op: MessageResponse, - MessageID: packet.Children[0].Value.(int64), - Packet: packet, - } - if !l.sendProcessMessage(message) { - return - } - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/control.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/control.go deleted file mode 100644 index 342f325c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/control.go +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ldap - -import ( - "fmt" - "strconv" - - "gopkg.in/asn1-ber.v1" -) - -const ( - // ControlTypePaging - https://www.ietf.org/rfc/rfc2696.txt - ControlTypePaging = "1.2.840.113556.1.4.319" - // ControlTypeBeheraPasswordPolicy - https://tools.ietf.org/html/draft-behera-ldap-password-policy-10 - ControlTypeBeheraPasswordPolicy = "1.3.6.1.4.1.42.2.27.8.5.1" - // ControlTypeVChuPasswordMustChange - https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00 - ControlTypeVChuPasswordMustChange = "2.16.840.1.113730.3.4.4" - // ControlTypeVChuPasswordWarning - https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00 - ControlTypeVChuPasswordWarning = "2.16.840.1.113730.3.4.5" - // ControlTypeManageDsaIT - https://tools.ietf.org/html/rfc3296 - ControlTypeManageDsaIT = "2.16.840.1.113730.3.4.2" -) - -// ControlTypeMap maps controls to text descriptions -var ControlTypeMap = map[string]string{ - ControlTypePaging: "Paging", - ControlTypeBeheraPasswordPolicy: "Password Policy - Behera Draft", - ControlTypeManageDsaIT: "Manage DSA IT", -} - -// Control defines an interface controls provide to encode and describe themselves -type Control interface { - // GetControlType returns the OID - GetControlType() string - // Encode returns the ber packet representation - Encode() *ber.Packet - // String returns a human-readable description - String() string -} - -// ControlString implements the Control interface for simple controls -type ControlString struct { - ControlType string - Criticality bool - ControlValue string -} - -// GetControlType returns the OID -func (c *ControlString) GetControlType() string { - return c.ControlType -} - -// Encode returns the ber packet representation -func (c *ControlString) Encode() *ber.Packet { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Control") - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, c.ControlType, "Control Type ("+ControlTypeMap[c.ControlType]+")")) - if c.Criticality { - packet.AppendChild(ber.NewBoolean(ber.ClassUniversal, ber.TypePrimitive, ber.TagBoolean, c.Criticality, "Criticality")) - } - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, string(c.ControlValue), "Control Value")) - return packet -} - -// String returns a human-readable description -func (c *ControlString) String() string { - return fmt.Sprintf("Control Type: %s (%q) Criticality: %t Control Value: %s", ControlTypeMap[c.ControlType], c.ControlType, c.Criticality, c.ControlValue) -} - -// ControlPaging implements the paging control described in https://www.ietf.org/rfc/rfc2696.txt -type ControlPaging struct { - // PagingSize indicates the page size - PagingSize uint32 - // Cookie is an opaque value returned by the server to track a paging cursor - Cookie []byte -} - -// GetControlType returns the OID -func (c *ControlPaging) GetControlType() string { - return ControlTypePaging -} - -// Encode returns the ber packet representation -func (c *ControlPaging) Encode() *ber.Packet { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Control") - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, ControlTypePaging, "Control Type ("+ControlTypeMap[ControlTypePaging]+")")) - - p2 := ber.Encode(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, nil, "Control Value (Paging)") - seq := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Search Control Value") - seq.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, int64(c.PagingSize), "Paging Size")) - cookie := ber.Encode(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, nil, "Cookie") - cookie.Value = c.Cookie - cookie.Data.Write(c.Cookie) - seq.AppendChild(cookie) - p2.AppendChild(seq) - - packet.AppendChild(p2) - return packet -} - -// String returns a human-readable description -func (c *ControlPaging) String() string { - return fmt.Sprintf( - "Control Type: %s (%q) Criticality: %t PagingSize: %d Cookie: %q", - ControlTypeMap[ControlTypePaging], - ControlTypePaging, - false, - c.PagingSize, - c.Cookie) -} - -// SetCookie stores the given cookie in the paging control -func (c *ControlPaging) SetCookie(cookie []byte) { - c.Cookie = cookie -} - -// ControlBeheraPasswordPolicy implements the control described in https://tools.ietf.org/html/draft-behera-ldap-password-policy-10 -type ControlBeheraPasswordPolicy struct { - // Expire contains the number of seconds before a password will expire - Expire int64 - // Grace indicates the remaining number of times a user will be allowed to authenticate with an expired password - Grace int64 - // Error indicates the error code - Error int8 - // ErrorString is a human readable error - ErrorString string -} - -// GetControlType returns the OID -func (c *ControlBeheraPasswordPolicy) GetControlType() string { - return ControlTypeBeheraPasswordPolicy -} - -// Encode returns the ber packet representation -func (c *ControlBeheraPasswordPolicy) Encode() *ber.Packet { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Control") - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, ControlTypeBeheraPasswordPolicy, "Control Type ("+ControlTypeMap[ControlTypeBeheraPasswordPolicy]+")")) - - return packet -} - -// String returns a human-readable description -func (c *ControlBeheraPasswordPolicy) String() string { - return fmt.Sprintf( - "Control Type: %s (%q) Criticality: %t Expire: %d Grace: %d Error: %d, ErrorString: %s", - ControlTypeMap[ControlTypeBeheraPasswordPolicy], - ControlTypeBeheraPasswordPolicy, - false, - c.Expire, - c.Grace, - c.Error, - c.ErrorString) -} - -// ControlVChuPasswordMustChange implements the control described in https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00 -type ControlVChuPasswordMustChange struct { - // MustChange indicates if the password is required to be changed - MustChange bool -} - -// GetControlType returns the OID -func (c *ControlVChuPasswordMustChange) GetControlType() string { - return ControlTypeVChuPasswordMustChange -} - -// Encode returns the ber packet representation -func (c *ControlVChuPasswordMustChange) Encode() *ber.Packet { - return nil -} - -// String returns a human-readable description -func (c *ControlVChuPasswordMustChange) String() string { - return fmt.Sprintf( - "Control Type: %s (%q) Criticality: %t MustChange: %v", - ControlTypeMap[ControlTypeVChuPasswordMustChange], - ControlTypeVChuPasswordMustChange, - false, - c.MustChange) -} - -// ControlVChuPasswordWarning implements the control described in https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00 -type ControlVChuPasswordWarning struct { - // Expire indicates the time in seconds until the password expires - Expire int64 -} - -// GetControlType returns the OID -func (c *ControlVChuPasswordWarning) GetControlType() string { - return ControlTypeVChuPasswordWarning -} - -// Encode returns the ber packet representation -func (c *ControlVChuPasswordWarning) Encode() *ber.Packet { - return nil -} - -// String returns a human-readable description -func (c *ControlVChuPasswordWarning) String() string { - return fmt.Sprintf( - "Control Type: %s (%q) Criticality: %t Expire: %b", - ControlTypeMap[ControlTypeVChuPasswordWarning], - ControlTypeVChuPasswordWarning, - false, - c.Expire) -} - -// ControlManageDsaIT implements the control described in https://tools.ietf.org/html/rfc3296 -type ControlManageDsaIT struct { - // Criticality indicates if this control is required - Criticality bool -} - -// GetControlType returns the OID -func (c *ControlManageDsaIT) GetControlType() string { - return ControlTypeManageDsaIT -} - -// Encode returns the ber packet representation -func (c *ControlManageDsaIT) Encode() *ber.Packet { - //FIXME - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Control") - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, ControlTypeManageDsaIT, "Control Type ("+ControlTypeMap[ControlTypeManageDsaIT]+")")) - if c.Criticality { - packet.AppendChild(ber.NewBoolean(ber.ClassUniversal, ber.TypePrimitive, ber.TagBoolean, c.Criticality, "Criticality")) - } - return packet -} - -// String returns a human-readable description -func (c *ControlManageDsaIT) String() string { - return fmt.Sprintf( - "Control Type: %s (%q) Criticality: %t", - ControlTypeMap[ControlTypeManageDsaIT], - ControlTypeManageDsaIT, - c.Criticality) -} - -// NewControlManageDsaIT returns a ControlManageDsaIT control -func NewControlManageDsaIT(Criticality bool) *ControlManageDsaIT { - return &ControlManageDsaIT{Criticality: Criticality} -} - -// FindControl returns the first control of the given type in the list, or nil -func FindControl(controls []Control, controlType string) Control { - for _, c := range controls { - if c.GetControlType() == controlType { - return c - } - } - return nil -} - -// DecodeControl returns a control read from the given packet, or nil if no recognized control can be made -func DecodeControl(packet *ber.Packet) Control { - var ( - ControlType = "" - Criticality = false - value *ber.Packet - ) - - switch len(packet.Children) { - case 0: - // at least one child is required for control type - return nil - - case 1: - // just type, no criticality or value - packet.Children[0].Description = "Control Type (" + ControlTypeMap[ControlType] + ")" - ControlType = packet.Children[0].Value.(string) - - case 2: - packet.Children[0].Description = "Control Type (" + ControlTypeMap[ControlType] + ")" - ControlType = packet.Children[0].Value.(string) - - // Children[1] could be criticality or value (both are optional) - // duck-type on whether this is a boolean - if _, ok := packet.Children[1].Value.(bool); ok { - packet.Children[1].Description = "Criticality" - Criticality = packet.Children[1].Value.(bool) - } else { - packet.Children[1].Description = "Control Value" - value = packet.Children[1] - } - - case 3: - packet.Children[0].Description = "Control Type (" + ControlTypeMap[ControlType] + ")" - ControlType = packet.Children[0].Value.(string) - - packet.Children[1].Description = "Criticality" - Criticality = packet.Children[1].Value.(bool) - - packet.Children[2].Description = "Control Value" - value = packet.Children[2] - - default: - // more than 3 children is invalid - return nil - } - - switch ControlType { - case ControlTypeManageDsaIT: - return NewControlManageDsaIT(Criticality) - case ControlTypePaging: - value.Description += " (Paging)" - c := new(ControlPaging) - if value.Value != nil { - valueChildren := ber.DecodePacket(value.Data.Bytes()) - value.Data.Truncate(0) - value.Value = nil - value.AppendChild(valueChildren) - } - value = value.Children[0] - value.Description = "Search Control Value" - value.Children[0].Description = "Paging Size" - value.Children[1].Description = "Cookie" - c.PagingSize = uint32(value.Children[0].Value.(int64)) - c.Cookie = value.Children[1].Data.Bytes() - value.Children[1].Value = c.Cookie - return c - case ControlTypeBeheraPasswordPolicy: - value.Description += " (Password Policy - Behera)" - c := NewControlBeheraPasswordPolicy() - if value.Value != nil { - valueChildren := ber.DecodePacket(value.Data.Bytes()) - value.Data.Truncate(0) - value.Value = nil - value.AppendChild(valueChildren) - } - - sequence := value.Children[0] - - for _, child := range sequence.Children { - if child.Tag == 0 { - //Warning - warningPacket := child.Children[0] - packet := ber.DecodePacket(warningPacket.Data.Bytes()) - val, ok := packet.Value.(int64) - if ok { - if warningPacket.Tag == 0 { - //timeBeforeExpiration - c.Expire = val - warningPacket.Value = c.Expire - } else if warningPacket.Tag == 1 { - //graceAuthNsRemaining - c.Grace = val - warningPacket.Value = c.Grace - } - } - } else if child.Tag == 1 { - // Error - packet := ber.DecodePacket(child.Data.Bytes()) - val, ok := packet.Value.(int8) - if !ok { - // what to do? - val = -1 - } - c.Error = val - child.Value = c.Error - c.ErrorString = BeheraPasswordPolicyErrorMap[c.Error] - } - } - return c - case ControlTypeVChuPasswordMustChange: - c := &ControlVChuPasswordMustChange{MustChange: true} - return c - case ControlTypeVChuPasswordWarning: - c := &ControlVChuPasswordWarning{Expire: -1} - expireStr := ber.DecodeString(value.Data.Bytes()) - - expire, err := strconv.ParseInt(expireStr, 10, 64) - if err != nil { - return nil - } - c.Expire = expire - value.Value = c.Expire - - return c - default: - c := new(ControlString) - c.ControlType = ControlType - c.Criticality = Criticality - if value != nil { - c.ControlValue = value.Value.(string) - } - return c - } -} - -// NewControlString returns a generic control -func NewControlString(controlType string, criticality bool, controlValue string) *ControlString { - return &ControlString{ - ControlType: controlType, - Criticality: criticality, - ControlValue: controlValue, - } -} - -// NewControlPaging returns a paging control -func NewControlPaging(pagingSize uint32) *ControlPaging { - return &ControlPaging{PagingSize: pagingSize} -} - -// NewControlBeheraPasswordPolicy returns a ControlBeheraPasswordPolicy -func NewControlBeheraPasswordPolicy() *ControlBeheraPasswordPolicy { - return &ControlBeheraPasswordPolicy{ - Expire: -1, - Grace: -1, - Error: -1, - } -} - -func encodeControls(controls []Control) *ber.Packet { - packet := ber.Encode(ber.ClassContext, ber.TypeConstructed, 0, nil, "Controls") - for _, control := range controls { - packet.AppendChild(control.Encode()) - } - return packet -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/debug.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/debug.go deleted file mode 100644 index 7279fc25..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/debug.go +++ /dev/null @@ -1,24 +0,0 @@ -package ldap - -import ( - "log" - - "gopkg.in/asn1-ber.v1" -) - -// debugging type -// - has a Printf method to write the debug output -type debugging bool - -// write debug output -func (debug debugging) Printf(format string, args ...interface{}) { - if debug { - log.Printf(format, args...) - } -} - -func (debug debugging) PrintPacket(packet *ber.Packet) { - if debug { - ber.PrintPacket(packet) - } -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/del.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/del.go deleted file mode 100644 index 4fd63dc3..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/del.go +++ /dev/null @@ -1,84 +0,0 @@ -// -// https://tools.ietf.org/html/rfc4511 -// -// DelRequest ::= [APPLICATION 10] LDAPDN - -package ldap - -import ( - "errors" - "log" - - "gopkg.in/asn1-ber.v1" -) - -// DelRequest implements an LDAP deletion request -type DelRequest struct { - // DN is the name of the directory entry to delete - DN string - // Controls hold optional controls to send with the request - Controls []Control -} - -func (d DelRequest) encode() *ber.Packet { - request := ber.Encode(ber.ClassApplication, ber.TypePrimitive, ApplicationDelRequest, d.DN, "Del Request") - request.Data.Write([]byte(d.DN)) - return request -} - -// NewDelRequest creates a delete request for the given DN and controls -func NewDelRequest(DN string, - Controls []Control) *DelRequest { - return &DelRequest{ - DN: DN, - Controls: Controls, - } -} - -// Del executes the given delete request -func (l *Conn) Del(delRequest *DelRequest) error { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - packet.AppendChild(delRequest.encode()) - if delRequest.Controls != nil { - packet.AppendChild(encodeControls(delRequest.Controls)) - } - - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return err - } - defer l.finishMessage(msgCtx) - - l.Debug.Printf("%d: waiting for response", msgCtx.id) - packetResponse, ok := <-msgCtx.responses - if !ok { - return NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return err - } - ber.PrintPacket(packet) - } - - if packet.Children[1].Tag == ApplicationDelResponse { - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return NewError(resultCode, errors.New(resultDescription)) - } - } else { - log.Printf("Unexpected Response: %d", packet.Children[1].Tag) - } - - l.Debug.Printf("%d: returning", msgCtx.id) - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/dn.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/dn.go deleted file mode 100644 index 34e9023a..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/dn.go +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// File contains DN parsing functionality -// -// https://tools.ietf.org/html/rfc4514 -// -// distinguishedName = [ relativeDistinguishedName -// *( COMMA relativeDistinguishedName ) ] -// relativeDistinguishedName = attributeTypeAndValue -// *( PLUS attributeTypeAndValue ) -// attributeTypeAndValue = attributeType EQUALS attributeValue -// attributeType = descr / numericoid -// attributeValue = string / hexstring -// -// ; The following characters are to be escaped when they appear -// ; in the value to be encoded: ESC, one of , leading -// ; SHARP or SPACE, trailing SPACE, and NULL. -// string = [ ( leadchar / pair ) [ *( stringchar / pair ) -// ( trailchar / pair ) ] ] -// -// leadchar = LUTF1 / UTFMB -// LUTF1 = %x01-1F / %x21 / %x24-2A / %x2D-3A / -// %x3D / %x3F-5B / %x5D-7F -// -// trailchar = TUTF1 / UTFMB -// TUTF1 = %x01-1F / %x21 / %x23-2A / %x2D-3A / -// %x3D / %x3F-5B / %x5D-7F -// -// stringchar = SUTF1 / UTFMB -// SUTF1 = %x01-21 / %x23-2A / %x2D-3A / -// %x3D / %x3F-5B / %x5D-7F -// -// pair = ESC ( ESC / special / hexpair ) -// special = escaped / SPACE / SHARP / EQUALS -// escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE -// hexstring = SHARP 1*hexpair -// hexpair = HEX HEX -// -// where the productions , , , , -// , , , , , , , , -// , , and are defined in [RFC4512]. -// - -package ldap - -import ( - "bytes" - enchex "encoding/hex" - "errors" - "fmt" - "strings" - - "gopkg.in/asn1-ber.v1" -) - -// AttributeTypeAndValue represents an attributeTypeAndValue from https://tools.ietf.org/html/rfc4514 -type AttributeTypeAndValue struct { - // Type is the attribute type - Type string - // Value is the attribute value - Value string -} - -// RelativeDN represents a relativeDistinguishedName from https://tools.ietf.org/html/rfc4514 -type RelativeDN struct { - Attributes []*AttributeTypeAndValue -} - -// DN represents a distinguishedName from https://tools.ietf.org/html/rfc4514 -type DN struct { - RDNs []*RelativeDN -} - -// ParseDN returns a distinguishedName or an error -func ParseDN(str string) (*DN, error) { - dn := new(DN) - dn.RDNs = make([]*RelativeDN, 0) - rdn := new(RelativeDN) - rdn.Attributes = make([]*AttributeTypeAndValue, 0) - buffer := bytes.Buffer{} - attribute := new(AttributeTypeAndValue) - escaping := false - - unescapedTrailingSpaces := 0 - stringFromBuffer := func() string { - s := buffer.String() - s = s[0 : len(s)-unescapedTrailingSpaces] - buffer.Reset() - unescapedTrailingSpaces = 0 - return s - } - - for i := 0; i < len(str); i++ { - char := str[i] - if escaping { - unescapedTrailingSpaces = 0 - escaping = false - switch char { - case ' ', '"', '#', '+', ',', ';', '<', '=', '>', '\\': - buffer.WriteByte(char) - continue - } - // Not a special character, assume hex encoded octet - if len(str) == i+1 { - return nil, errors.New("Got corrupted escaped character") - } - - dst := []byte{0} - n, err := enchex.Decode([]byte(dst), []byte(str[i:i+2])) - if err != nil { - return nil, fmt.Errorf("Failed to decode escaped character: %s", err) - } else if n != 1 { - return nil, fmt.Errorf("Expected 1 byte when un-escaping, got %d", n) - } - buffer.WriteByte(dst[0]) - i++ - } else if char == '\\' { - unescapedTrailingSpaces = 0 - escaping = true - } else if char == '=' { - attribute.Type = stringFromBuffer() - // Special case: If the first character in the value is # the - // following data is BER encoded so we can just fast forward - // and decode. - if len(str) > i+1 && str[i+1] == '#' { - i += 2 - index := strings.IndexAny(str[i:], ",+") - data := str - if index > 0 { - data = str[i : i+index] - } else { - data = str[i:] - } - rawBER, err := enchex.DecodeString(data) - if err != nil { - return nil, fmt.Errorf("Failed to decode BER encoding: %s", err) - } - packet := ber.DecodePacket(rawBER) - buffer.WriteString(packet.Data.String()) - i += len(data) - 1 - } - } else if char == ',' || char == '+' { - // We're done with this RDN or value, push it - if len(attribute.Type) == 0 { - return nil, errors.New("incomplete type, value pair") - } - attribute.Value = stringFromBuffer() - rdn.Attributes = append(rdn.Attributes, attribute) - attribute = new(AttributeTypeAndValue) - if char == ',' { - dn.RDNs = append(dn.RDNs, rdn) - rdn = new(RelativeDN) - rdn.Attributes = make([]*AttributeTypeAndValue, 0) - } - } else if char == ' ' && buffer.Len() == 0 { - // ignore unescaped leading spaces - continue - } else { - if char == ' ' { - // Track unescaped spaces in case they are trailing and we need to remove them - unescapedTrailingSpaces++ - } else { - // Reset if we see a non-space char - unescapedTrailingSpaces = 0 - } - buffer.WriteByte(char) - } - } - if buffer.Len() > 0 { - if len(attribute.Type) == 0 { - return nil, errors.New("DN ended with incomplete type, value pair") - } - attribute.Value = stringFromBuffer() - rdn.Attributes = append(rdn.Attributes, attribute) - dn.RDNs = append(dn.RDNs, rdn) - } - return dn, nil -} - -// Equal returns true if the DNs are equal as defined by rfc4517 4.2.15 (distinguishedNameMatch). -// Returns true if they have the same number of relative distinguished names -// and corresponding relative distinguished names (by position) are the same. -func (d *DN) Equal(other *DN) bool { - if len(d.RDNs) != len(other.RDNs) { - return false - } - for i := range d.RDNs { - if !d.RDNs[i].Equal(other.RDNs[i]) { - return false - } - } - return true -} - -// AncestorOf returns true if the other DN consists of at least one RDN followed by all the RDNs of the current DN. -// "ou=widgets,o=acme.com" is an ancestor of "ou=sprockets,ou=widgets,o=acme.com" -// "ou=widgets,o=acme.com" is not an ancestor of "ou=sprockets,ou=widgets,o=foo.com" -// "ou=widgets,o=acme.com" is not an ancestor of "ou=widgets,o=acme.com" -func (d *DN) AncestorOf(other *DN) bool { - if len(d.RDNs) >= len(other.RDNs) { - return false - } - // Take the last `len(d.RDNs)` RDNs from the other DN to compare against - otherRDNs := other.RDNs[len(other.RDNs)-len(d.RDNs):] - for i := range d.RDNs { - if !d.RDNs[i].Equal(otherRDNs[i]) { - return false - } - } - return true -} - -// Equal returns true if the RelativeDNs are equal as defined by rfc4517 4.2.15 (distinguishedNameMatch). -// Relative distinguished names are the same if and only if they have the same number of AttributeTypeAndValues -// and each attribute of the first RDN is the same as the attribute of the second RDN with the same attribute type. -// The order of attributes is not significant. -// Case of attribute types is not significant. -func (r *RelativeDN) Equal(other *RelativeDN) bool { - if len(r.Attributes) != len(other.Attributes) { - return false - } - return r.hasAllAttributes(other.Attributes) && other.hasAllAttributes(r.Attributes) -} - -func (r *RelativeDN) hasAllAttributes(attrs []*AttributeTypeAndValue) bool { - for _, attr := range attrs { - found := false - for _, myattr := range r.Attributes { - if myattr.Equal(attr) { - found = true - break - } - } - if !found { - return false - } - } - return true -} - -// Equal returns true if the AttributeTypeAndValue is equivalent to the specified AttributeTypeAndValue -// Case of the attribute type is not significant -func (a *AttributeTypeAndValue) Equal(other *AttributeTypeAndValue) bool { - return strings.EqualFold(a.Type, other.Type) && a.Value == other.Value -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/doc.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/doc.go deleted file mode 100644 index f20d39bc..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package ldap provides basic LDAP v3 functionality. -*/ -package ldap diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/error.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/error.go deleted file mode 100644 index 4cccb537..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/error.go +++ /dev/null @@ -1,155 +0,0 @@ -package ldap - -import ( - "fmt" - - "gopkg.in/asn1-ber.v1" -) - -// LDAP Result Codes -const ( - LDAPResultSuccess = 0 - LDAPResultOperationsError = 1 - LDAPResultProtocolError = 2 - LDAPResultTimeLimitExceeded = 3 - LDAPResultSizeLimitExceeded = 4 - LDAPResultCompareFalse = 5 - LDAPResultCompareTrue = 6 - LDAPResultAuthMethodNotSupported = 7 - LDAPResultStrongAuthRequired = 8 - LDAPResultReferral = 10 - LDAPResultAdminLimitExceeded = 11 - LDAPResultUnavailableCriticalExtension = 12 - LDAPResultConfidentialityRequired = 13 - LDAPResultSaslBindInProgress = 14 - LDAPResultNoSuchAttribute = 16 - LDAPResultUndefinedAttributeType = 17 - LDAPResultInappropriateMatching = 18 - LDAPResultConstraintViolation = 19 - LDAPResultAttributeOrValueExists = 20 - LDAPResultInvalidAttributeSyntax = 21 - LDAPResultNoSuchObject = 32 - LDAPResultAliasProblem = 33 - LDAPResultInvalidDNSyntax = 34 - LDAPResultAliasDereferencingProblem = 36 - LDAPResultInappropriateAuthentication = 48 - LDAPResultInvalidCredentials = 49 - LDAPResultInsufficientAccessRights = 50 - LDAPResultBusy = 51 - LDAPResultUnavailable = 52 - LDAPResultUnwillingToPerform = 53 - LDAPResultLoopDetect = 54 - LDAPResultNamingViolation = 64 - LDAPResultObjectClassViolation = 65 - LDAPResultNotAllowedOnNonLeaf = 66 - LDAPResultNotAllowedOnRDN = 67 - LDAPResultEntryAlreadyExists = 68 - LDAPResultObjectClassModsProhibited = 69 - LDAPResultAffectsMultipleDSAs = 71 - LDAPResultOther = 80 - - ErrorNetwork = 200 - ErrorFilterCompile = 201 - ErrorFilterDecompile = 202 - ErrorDebugging = 203 - ErrorUnexpectedMessage = 204 - ErrorUnexpectedResponse = 205 -) - -// LDAPResultCodeMap contains string descriptions for LDAP error codes -var LDAPResultCodeMap = map[uint8]string{ - LDAPResultSuccess: "Success", - LDAPResultOperationsError: "Operations Error", - LDAPResultProtocolError: "Protocol Error", - LDAPResultTimeLimitExceeded: "Time Limit Exceeded", - LDAPResultSizeLimitExceeded: "Size Limit Exceeded", - LDAPResultCompareFalse: "Compare False", - LDAPResultCompareTrue: "Compare True", - LDAPResultAuthMethodNotSupported: "Auth Method Not Supported", - LDAPResultStrongAuthRequired: "Strong Auth Required", - LDAPResultReferral: "Referral", - LDAPResultAdminLimitExceeded: "Admin Limit Exceeded", - LDAPResultUnavailableCriticalExtension: "Unavailable Critical Extension", - LDAPResultConfidentialityRequired: "Confidentiality Required", - LDAPResultSaslBindInProgress: "Sasl Bind In Progress", - LDAPResultNoSuchAttribute: "No Such Attribute", - LDAPResultUndefinedAttributeType: "Undefined Attribute Type", - LDAPResultInappropriateMatching: "Inappropriate Matching", - LDAPResultConstraintViolation: "Constraint Violation", - LDAPResultAttributeOrValueExists: "Attribute Or Value Exists", - LDAPResultInvalidAttributeSyntax: "Invalid Attribute Syntax", - LDAPResultNoSuchObject: "No Such Object", - LDAPResultAliasProblem: "Alias Problem", - LDAPResultInvalidDNSyntax: "Invalid DN Syntax", - LDAPResultAliasDereferencingProblem: "Alias Dereferencing Problem", - LDAPResultInappropriateAuthentication: "Inappropriate Authentication", - LDAPResultInvalidCredentials: "Invalid Credentials", - LDAPResultInsufficientAccessRights: "Insufficient Access Rights", - LDAPResultBusy: "Busy", - LDAPResultUnavailable: "Unavailable", - LDAPResultUnwillingToPerform: "Unwilling To Perform", - LDAPResultLoopDetect: "Loop Detect", - LDAPResultNamingViolation: "Naming Violation", - LDAPResultObjectClassViolation: "Object Class Violation", - LDAPResultNotAllowedOnNonLeaf: "Not Allowed On Non Leaf", - LDAPResultNotAllowedOnRDN: "Not Allowed On RDN", - LDAPResultEntryAlreadyExists: "Entry Already Exists", - LDAPResultObjectClassModsProhibited: "Object Class Mods Prohibited", - LDAPResultAffectsMultipleDSAs: "Affects Multiple DSAs", - LDAPResultOther: "Other", - - ErrorNetwork: "Network Error", - ErrorFilterCompile: "Filter Compile Error", - ErrorFilterDecompile: "Filter Decompile Error", - ErrorDebugging: "Debugging Error", - ErrorUnexpectedMessage: "Unexpected Message", - ErrorUnexpectedResponse: "Unexpected Response", -} - -func getLDAPResultCode(packet *ber.Packet) (code uint8, description string) { - if packet == nil { - return ErrorUnexpectedResponse, "Empty packet" - } else if len(packet.Children) >= 2 { - response := packet.Children[1] - if response == nil { - return ErrorUnexpectedResponse, "Empty response in packet" - } - if response.ClassType == ber.ClassApplication && response.TagType == ber.TypeConstructed && len(response.Children) >= 3 { - // Children[1].Children[2] is the diagnosticMessage which is guaranteed to exist as seen here: https://tools.ietf.org/html/rfc4511#section-4.1.9 - return uint8(response.Children[0].Value.(int64)), response.Children[2].Value.(string) - } - } - - return ErrorNetwork, "Invalid packet format" -} - -// Error holds LDAP error information -type Error struct { - // Err is the underlying error - Err error - // ResultCode is the LDAP error code - ResultCode uint8 -} - -func (e *Error) Error() string { - return fmt.Sprintf("LDAP Result Code %d %q: %s", e.ResultCode, LDAPResultCodeMap[e.ResultCode], e.Err.Error()) -} - -// NewError creates an LDAP error with the given code and underlying error -func NewError(resultCode uint8, err error) error { - return &Error{ResultCode: resultCode, Err: err} -} - -// IsErrorWithCode returns true if the given error is an LDAP error with the given result code -func IsErrorWithCode(err error, desiredResultCode uint8) bool { - if err == nil { - return false - } - - serverError, ok := err.(*Error) - if !ok { - return false - } - - return serverError.ResultCode == desiredResultCode -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/filter.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/filter.go deleted file mode 100644 index 3858a286..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/filter.go +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ldap - -import ( - "bytes" - hexpac "encoding/hex" - "errors" - "fmt" - "strings" - "unicode/utf8" - - "gopkg.in/asn1-ber.v1" -) - -// Filter choices -const ( - FilterAnd = 0 - FilterOr = 1 - FilterNot = 2 - FilterEqualityMatch = 3 - FilterSubstrings = 4 - FilterGreaterOrEqual = 5 - FilterLessOrEqual = 6 - FilterPresent = 7 - FilterApproxMatch = 8 - FilterExtensibleMatch = 9 -) - -// FilterMap contains human readable descriptions of Filter choices -var FilterMap = map[uint64]string{ - FilterAnd: "And", - FilterOr: "Or", - FilterNot: "Not", - FilterEqualityMatch: "Equality Match", - FilterSubstrings: "Substrings", - FilterGreaterOrEqual: "Greater Or Equal", - FilterLessOrEqual: "Less Or Equal", - FilterPresent: "Present", - FilterApproxMatch: "Approx Match", - FilterExtensibleMatch: "Extensible Match", -} - -// SubstringFilter options -const ( - FilterSubstringsInitial = 0 - FilterSubstringsAny = 1 - FilterSubstringsFinal = 2 -) - -// FilterSubstringsMap contains human readable descriptions of SubstringFilter choices -var FilterSubstringsMap = map[uint64]string{ - FilterSubstringsInitial: "Substrings Initial", - FilterSubstringsAny: "Substrings Any", - FilterSubstringsFinal: "Substrings Final", -} - -// MatchingRuleAssertion choices -const ( - MatchingRuleAssertionMatchingRule = 1 - MatchingRuleAssertionType = 2 - MatchingRuleAssertionMatchValue = 3 - MatchingRuleAssertionDNAttributes = 4 -) - -// MatchingRuleAssertionMap contains human readable descriptions of MatchingRuleAssertion choices -var MatchingRuleAssertionMap = map[uint64]string{ - MatchingRuleAssertionMatchingRule: "Matching Rule Assertion Matching Rule", - MatchingRuleAssertionType: "Matching Rule Assertion Type", - MatchingRuleAssertionMatchValue: "Matching Rule Assertion Match Value", - MatchingRuleAssertionDNAttributes: "Matching Rule Assertion DN Attributes", -} - -// CompileFilter converts a string representation of a filter into a BER-encoded packet -func CompileFilter(filter string) (*ber.Packet, error) { - if len(filter) == 0 || filter[0] != '(' { - return nil, NewError(ErrorFilterCompile, errors.New("ldap: filter does not start with an '('")) - } - packet, pos, err := compileFilter(filter, 1) - if err != nil { - return nil, err - } - switch { - case pos > len(filter): - return nil, NewError(ErrorFilterCompile, errors.New("ldap: unexpected end of filter")) - case pos < len(filter): - return nil, NewError(ErrorFilterCompile, errors.New("ldap: finished compiling filter with extra at end: "+fmt.Sprint(filter[pos:]))) - } - return packet, nil -} - -// DecompileFilter converts a packet representation of a filter into a string representation -func DecompileFilter(packet *ber.Packet) (ret string, err error) { - defer func() { - if r := recover(); r != nil { - err = NewError(ErrorFilterDecompile, errors.New("ldap: error decompiling filter")) - } - }() - ret = "(" - err = nil - childStr := "" - - switch packet.Tag { - case FilterAnd: - ret += "&" - for _, child := range packet.Children { - childStr, err = DecompileFilter(child) - if err != nil { - return - } - ret += childStr - } - case FilterOr: - ret += "|" - for _, child := range packet.Children { - childStr, err = DecompileFilter(child) - if err != nil { - return - } - ret += childStr - } - case FilterNot: - ret += "!" - childStr, err = DecompileFilter(packet.Children[0]) - if err != nil { - return - } - ret += childStr - - case FilterSubstrings: - ret += ber.DecodeString(packet.Children[0].Data.Bytes()) - ret += "=" - for i, child := range packet.Children[1].Children { - if i == 0 && child.Tag != FilterSubstringsInitial { - ret += "*" - } - ret += EscapeFilter(ber.DecodeString(child.Data.Bytes())) - if child.Tag != FilterSubstringsFinal { - ret += "*" - } - } - case FilterEqualityMatch: - ret += ber.DecodeString(packet.Children[0].Data.Bytes()) - ret += "=" - ret += EscapeFilter(ber.DecodeString(packet.Children[1].Data.Bytes())) - case FilterGreaterOrEqual: - ret += ber.DecodeString(packet.Children[0].Data.Bytes()) - ret += ">=" - ret += EscapeFilter(ber.DecodeString(packet.Children[1].Data.Bytes())) - case FilterLessOrEqual: - ret += ber.DecodeString(packet.Children[0].Data.Bytes()) - ret += "<=" - ret += EscapeFilter(ber.DecodeString(packet.Children[1].Data.Bytes())) - case FilterPresent: - ret += ber.DecodeString(packet.Data.Bytes()) - ret += "=*" - case FilterApproxMatch: - ret += ber.DecodeString(packet.Children[0].Data.Bytes()) - ret += "~=" - ret += EscapeFilter(ber.DecodeString(packet.Children[1].Data.Bytes())) - case FilterExtensibleMatch: - attr := "" - dnAttributes := false - matchingRule := "" - value := "" - - for _, child := range packet.Children { - switch child.Tag { - case MatchingRuleAssertionMatchingRule: - matchingRule = ber.DecodeString(child.Data.Bytes()) - case MatchingRuleAssertionType: - attr = ber.DecodeString(child.Data.Bytes()) - case MatchingRuleAssertionMatchValue: - value = ber.DecodeString(child.Data.Bytes()) - case MatchingRuleAssertionDNAttributes: - dnAttributes = child.Value.(bool) - } - } - - if len(attr) > 0 { - ret += attr - } - if dnAttributes { - ret += ":dn" - } - if len(matchingRule) > 0 { - ret += ":" - ret += matchingRule - } - ret += ":=" - ret += EscapeFilter(value) - } - - ret += ")" - return -} - -func compileFilterSet(filter string, pos int, parent *ber.Packet) (int, error) { - for pos < len(filter) && filter[pos] == '(' { - child, newPos, err := compileFilter(filter, pos+1) - if err != nil { - return pos, err - } - pos = newPos - parent.AppendChild(child) - } - if pos == len(filter) { - return pos, NewError(ErrorFilterCompile, errors.New("ldap: unexpected end of filter")) - } - - return pos + 1, nil -} - -func compileFilter(filter string, pos int) (*ber.Packet, int, error) { - var ( - packet *ber.Packet - err error - ) - - defer func() { - if r := recover(); r != nil { - err = NewError(ErrorFilterCompile, errors.New("ldap: error compiling filter")) - } - }() - newPos := pos - - currentRune, currentWidth := utf8.DecodeRuneInString(filter[newPos:]) - - switch currentRune { - case utf8.RuneError: - return nil, 0, NewError(ErrorFilterCompile, fmt.Errorf("ldap: error reading rune at position %d", newPos)) - case '(': - packet, newPos, err = compileFilter(filter, pos+currentWidth) - newPos++ - return packet, newPos, err - case '&': - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterAnd, nil, FilterMap[FilterAnd]) - newPos, err = compileFilterSet(filter, pos+currentWidth, packet) - return packet, newPos, err - case '|': - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterOr, nil, FilterMap[FilterOr]) - newPos, err = compileFilterSet(filter, pos+currentWidth, packet) - return packet, newPos, err - case '!': - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterNot, nil, FilterMap[FilterNot]) - var child *ber.Packet - child, newPos, err = compileFilter(filter, pos+currentWidth) - packet.AppendChild(child) - return packet, newPos, err - default: - const ( - stateReadingAttr = 0 - stateReadingExtensibleMatchingRule = 1 - stateReadingCondition = 2 - ) - - state := stateReadingAttr - - attribute := "" - extensibleDNAttributes := false - extensibleMatchingRule := "" - condition := "" - - for newPos < len(filter) { - remainingFilter := filter[newPos:] - currentRune, currentWidth = utf8.DecodeRuneInString(remainingFilter) - if currentRune == ')' { - break - } - if currentRune == utf8.RuneError { - return packet, newPos, NewError(ErrorFilterCompile, fmt.Errorf("ldap: error reading rune at position %d", newPos)) - } - - switch state { - case stateReadingAttr: - switch { - // Extensible rule, with only DN-matching - case currentRune == ':' && strings.HasPrefix(remainingFilter, ":dn:="): - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterExtensibleMatch, nil, FilterMap[FilterExtensibleMatch]) - extensibleDNAttributes = true - state = stateReadingCondition - newPos += 5 - - // Extensible rule, with DN-matching and a matching OID - case currentRune == ':' && strings.HasPrefix(remainingFilter, ":dn:"): - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterExtensibleMatch, nil, FilterMap[FilterExtensibleMatch]) - extensibleDNAttributes = true - state = stateReadingExtensibleMatchingRule - newPos += 4 - - // Extensible rule, with attr only - case currentRune == ':' && strings.HasPrefix(remainingFilter, ":="): - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterExtensibleMatch, nil, FilterMap[FilterExtensibleMatch]) - state = stateReadingCondition - newPos += 2 - - // Extensible rule, with no DN attribute matching - case currentRune == ':': - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterExtensibleMatch, nil, FilterMap[FilterExtensibleMatch]) - state = stateReadingExtensibleMatchingRule - newPos++ - - // Equality condition - case currentRune == '=': - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterEqualityMatch, nil, FilterMap[FilterEqualityMatch]) - state = stateReadingCondition - newPos++ - - // Greater-than or equal - case currentRune == '>' && strings.HasPrefix(remainingFilter, ">="): - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterGreaterOrEqual, nil, FilterMap[FilterGreaterOrEqual]) - state = stateReadingCondition - newPos += 2 - - // Less-than or equal - case currentRune == '<' && strings.HasPrefix(remainingFilter, "<="): - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterLessOrEqual, nil, FilterMap[FilterLessOrEqual]) - state = stateReadingCondition - newPos += 2 - - // Approx - case currentRune == '~' && strings.HasPrefix(remainingFilter, "~="): - packet = ber.Encode(ber.ClassContext, ber.TypeConstructed, FilterApproxMatch, nil, FilterMap[FilterApproxMatch]) - state = stateReadingCondition - newPos += 2 - - // Still reading the attribute name - default: - attribute += fmt.Sprintf("%c", currentRune) - newPos += currentWidth - } - - case stateReadingExtensibleMatchingRule: - switch { - - // Matching rule OID is done - case currentRune == ':' && strings.HasPrefix(remainingFilter, ":="): - state = stateReadingCondition - newPos += 2 - - // Still reading the matching rule oid - default: - extensibleMatchingRule += fmt.Sprintf("%c", currentRune) - newPos += currentWidth - } - - case stateReadingCondition: - // append to the condition - condition += fmt.Sprintf("%c", currentRune) - newPos += currentWidth - } - } - - if newPos == len(filter) { - err = NewError(ErrorFilterCompile, errors.New("ldap: unexpected end of filter")) - return packet, newPos, err - } - if packet == nil { - err = NewError(ErrorFilterCompile, errors.New("ldap: error parsing filter")) - return packet, newPos, err - } - - switch { - case packet.Tag == FilterExtensibleMatch: - // MatchingRuleAssertion ::= SEQUENCE { - // matchingRule [1] MatchingRuleID OPTIONAL, - // type [2] AttributeDescription OPTIONAL, - // matchValue [3] AssertionValue, - // dnAttributes [4] BOOLEAN DEFAULT FALSE - // } - - // Include the matching rule oid, if specified - if len(extensibleMatchingRule) > 0 { - packet.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, MatchingRuleAssertionMatchingRule, extensibleMatchingRule, MatchingRuleAssertionMap[MatchingRuleAssertionMatchingRule])) - } - - // Include the attribute, if specified - if len(attribute) > 0 { - packet.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, MatchingRuleAssertionType, attribute, MatchingRuleAssertionMap[MatchingRuleAssertionType])) - } - - // Add the value (only required child) - encodedString, encodeErr := escapedStringToEncodedBytes(condition) - if encodeErr != nil { - return packet, newPos, encodeErr - } - packet.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, MatchingRuleAssertionMatchValue, encodedString, MatchingRuleAssertionMap[MatchingRuleAssertionMatchValue])) - - // Defaults to false, so only include in the sequence if true - if extensibleDNAttributes { - packet.AppendChild(ber.NewBoolean(ber.ClassContext, ber.TypePrimitive, MatchingRuleAssertionDNAttributes, extensibleDNAttributes, MatchingRuleAssertionMap[MatchingRuleAssertionDNAttributes])) - } - - case packet.Tag == FilterEqualityMatch && condition == "*": - packet = ber.NewString(ber.ClassContext, ber.TypePrimitive, FilterPresent, attribute, FilterMap[FilterPresent]) - case packet.Tag == FilterEqualityMatch && strings.Contains(condition, "*"): - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, attribute, "Attribute")) - packet.Tag = FilterSubstrings - packet.Description = FilterMap[uint64(packet.Tag)] - seq := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Substrings") - parts := strings.Split(condition, "*") - for i, part := range parts { - if part == "" { - continue - } - var tag ber.Tag - switch i { - case 0: - tag = FilterSubstringsInitial - case len(parts) - 1: - tag = FilterSubstringsFinal - default: - tag = FilterSubstringsAny - } - encodedString, encodeErr := escapedStringToEncodedBytes(part) - if encodeErr != nil { - return packet, newPos, encodeErr - } - seq.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, tag, encodedString, FilterSubstringsMap[uint64(tag)])) - } - packet.AppendChild(seq) - default: - encodedString, encodeErr := escapedStringToEncodedBytes(condition) - if encodeErr != nil { - return packet, newPos, encodeErr - } - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, attribute, "Attribute")) - packet.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, encodedString, "Condition")) - } - - newPos += currentWidth - return packet, newPos, err - } -} - -// Convert from "ABC\xx\xx\xx" form to literal bytes for transport -func escapedStringToEncodedBytes(escapedString string) (string, error) { - var buffer bytes.Buffer - i := 0 - for i < len(escapedString) { - currentRune, currentWidth := utf8.DecodeRuneInString(escapedString[i:]) - if currentRune == utf8.RuneError { - return "", NewError(ErrorFilterCompile, fmt.Errorf("ldap: error reading rune at position %d", i)) - } - - // Check for escaped hex characters and convert them to their literal value for transport. - if currentRune == '\\' { - // http://tools.ietf.org/search/rfc4515 - // \ (%x5C) is not a valid character unless it is followed by two HEX characters due to not - // being a member of UTF1SUBSET. - if i+2 > len(escapedString) { - return "", NewError(ErrorFilterCompile, errors.New("ldap: missing characters for escape in filter")) - } - escByte, decodeErr := hexpac.DecodeString(escapedString[i+1 : i+3]) - if decodeErr != nil { - return "", NewError(ErrorFilterCompile, errors.New("ldap: invalid characters for escape in filter")) - } - buffer.WriteByte(escByte[0]) - i += 2 // +1 from end of loop, so 3 total for \xx. - } else { - buffer.WriteRune(currentRune) - } - - i += currentWidth - } - return buffer.String(), nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/ldap.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/ldap.go deleted file mode 100644 index 49692475..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/ldap.go +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ldap - -import ( - "errors" - "io/ioutil" - "os" - - "gopkg.in/asn1-ber.v1" -) - -// LDAP Application Codes -const ( - ApplicationBindRequest = 0 - ApplicationBindResponse = 1 - ApplicationUnbindRequest = 2 - ApplicationSearchRequest = 3 - ApplicationSearchResultEntry = 4 - ApplicationSearchResultDone = 5 - ApplicationModifyRequest = 6 - ApplicationModifyResponse = 7 - ApplicationAddRequest = 8 - ApplicationAddResponse = 9 - ApplicationDelRequest = 10 - ApplicationDelResponse = 11 - ApplicationModifyDNRequest = 12 - ApplicationModifyDNResponse = 13 - ApplicationCompareRequest = 14 - ApplicationCompareResponse = 15 - ApplicationAbandonRequest = 16 - ApplicationSearchResultReference = 19 - ApplicationExtendedRequest = 23 - ApplicationExtendedResponse = 24 -) - -// ApplicationMap contains human readable descriptions of LDAP Application Codes -var ApplicationMap = map[uint8]string{ - ApplicationBindRequest: "Bind Request", - ApplicationBindResponse: "Bind Response", - ApplicationUnbindRequest: "Unbind Request", - ApplicationSearchRequest: "Search Request", - ApplicationSearchResultEntry: "Search Result Entry", - ApplicationSearchResultDone: "Search Result Done", - ApplicationModifyRequest: "Modify Request", - ApplicationModifyResponse: "Modify Response", - ApplicationAddRequest: "Add Request", - ApplicationAddResponse: "Add Response", - ApplicationDelRequest: "Del Request", - ApplicationDelResponse: "Del Response", - ApplicationModifyDNRequest: "Modify DN Request", - ApplicationModifyDNResponse: "Modify DN Response", - ApplicationCompareRequest: "Compare Request", - ApplicationCompareResponse: "Compare Response", - ApplicationAbandonRequest: "Abandon Request", - ApplicationSearchResultReference: "Search Result Reference", - ApplicationExtendedRequest: "Extended Request", - ApplicationExtendedResponse: "Extended Response", -} - -// Ldap Behera Password Policy Draft 10 (https://tools.ietf.org/html/draft-behera-ldap-password-policy-10) -const ( - BeheraPasswordExpired = 0 - BeheraAccountLocked = 1 - BeheraChangeAfterReset = 2 - BeheraPasswordModNotAllowed = 3 - BeheraMustSupplyOldPassword = 4 - BeheraInsufficientPasswordQuality = 5 - BeheraPasswordTooShort = 6 - BeheraPasswordTooYoung = 7 - BeheraPasswordInHistory = 8 -) - -// BeheraPasswordPolicyErrorMap contains human readable descriptions of Behera Password Policy error codes -var BeheraPasswordPolicyErrorMap = map[int8]string{ - BeheraPasswordExpired: "Password expired", - BeheraAccountLocked: "Account locked", - BeheraChangeAfterReset: "Password must be changed", - BeheraPasswordModNotAllowed: "Policy prevents password modification", - BeheraMustSupplyOldPassword: "Policy requires old password in order to change password", - BeheraInsufficientPasswordQuality: "Password fails quality checks", - BeheraPasswordTooShort: "Password is too short for policy", - BeheraPasswordTooYoung: "Password has been changed too recently", - BeheraPasswordInHistory: "New password is in list of old passwords", -} - -// Adds descriptions to an LDAP Response packet for debugging -func addLDAPDescriptions(packet *ber.Packet) (err error) { - defer func() { - if r := recover(); r != nil { - err = NewError(ErrorDebugging, errors.New("ldap: cannot process packet to add descriptions")) - } - }() - packet.Description = "LDAP Response" - packet.Children[0].Description = "Message ID" - - application := uint8(packet.Children[1].Tag) - packet.Children[1].Description = ApplicationMap[application] - - switch application { - case ApplicationBindRequest: - addRequestDescriptions(packet) - case ApplicationBindResponse: - addDefaultLDAPResponseDescriptions(packet) - case ApplicationUnbindRequest: - addRequestDescriptions(packet) - case ApplicationSearchRequest: - addRequestDescriptions(packet) - case ApplicationSearchResultEntry: - packet.Children[1].Children[0].Description = "Object Name" - packet.Children[1].Children[1].Description = "Attributes" - for _, child := range packet.Children[1].Children[1].Children { - child.Description = "Attribute" - child.Children[0].Description = "Attribute Name" - child.Children[1].Description = "Attribute Values" - for _, grandchild := range child.Children[1].Children { - grandchild.Description = "Attribute Value" - } - } - if len(packet.Children) == 3 { - addControlDescriptions(packet.Children[2]) - } - case ApplicationSearchResultDone: - addDefaultLDAPResponseDescriptions(packet) - case ApplicationModifyRequest: - addRequestDescriptions(packet) - case ApplicationModifyResponse: - case ApplicationAddRequest: - addRequestDescriptions(packet) - case ApplicationAddResponse: - case ApplicationDelRequest: - addRequestDescriptions(packet) - case ApplicationDelResponse: - case ApplicationModifyDNRequest: - addRequestDescriptions(packet) - case ApplicationModifyDNResponse: - case ApplicationCompareRequest: - addRequestDescriptions(packet) - case ApplicationCompareResponse: - case ApplicationAbandonRequest: - addRequestDescriptions(packet) - case ApplicationSearchResultReference: - case ApplicationExtendedRequest: - addRequestDescriptions(packet) - case ApplicationExtendedResponse: - } - - return nil -} - -func addControlDescriptions(packet *ber.Packet) { - packet.Description = "Controls" - for _, child := range packet.Children { - var value *ber.Packet - controlType := "" - child.Description = "Control" - switch len(child.Children) { - case 0: - // at least one child is required for control type - continue - - case 1: - // just type, no criticality or value - controlType = child.Children[0].Value.(string) - child.Children[0].Description = "Control Type (" + ControlTypeMap[controlType] + ")" - - case 2: - controlType = child.Children[0].Value.(string) - child.Children[0].Description = "Control Type (" + ControlTypeMap[controlType] + ")" - // Children[1] could be criticality or value (both are optional) - // duck-type on whether this is a boolean - if _, ok := child.Children[1].Value.(bool); ok { - child.Children[1].Description = "Criticality" - } else { - child.Children[1].Description = "Control Value" - value = child.Children[1] - } - - case 3: - // criticality and value present - controlType = child.Children[0].Value.(string) - child.Children[0].Description = "Control Type (" + ControlTypeMap[controlType] + ")" - child.Children[1].Description = "Criticality" - child.Children[2].Description = "Control Value" - value = child.Children[2] - - default: - // more than 3 children is invalid - continue - } - if value == nil { - continue - } - switch controlType { - case ControlTypePaging: - value.Description += " (Paging)" - if value.Value != nil { - valueChildren := ber.DecodePacket(value.Data.Bytes()) - value.Data.Truncate(0) - value.Value = nil - valueChildren.Children[1].Value = valueChildren.Children[1].Data.Bytes() - value.AppendChild(valueChildren) - } - value.Children[0].Description = "Real Search Control Value" - value.Children[0].Children[0].Description = "Paging Size" - value.Children[0].Children[1].Description = "Cookie" - - case ControlTypeBeheraPasswordPolicy: - value.Description += " (Password Policy - Behera Draft)" - if value.Value != nil { - valueChildren := ber.DecodePacket(value.Data.Bytes()) - value.Data.Truncate(0) - value.Value = nil - value.AppendChild(valueChildren) - } - sequence := value.Children[0] - for _, child := range sequence.Children { - if child.Tag == 0 { - //Warning - warningPacket := child.Children[0] - packet := ber.DecodePacket(warningPacket.Data.Bytes()) - val, ok := packet.Value.(int64) - if ok { - if warningPacket.Tag == 0 { - //timeBeforeExpiration - value.Description += " (TimeBeforeExpiration)" - warningPacket.Value = val - } else if warningPacket.Tag == 1 { - //graceAuthNsRemaining - value.Description += " (GraceAuthNsRemaining)" - warningPacket.Value = val - } - } - } else if child.Tag == 1 { - // Error - packet := ber.DecodePacket(child.Data.Bytes()) - val, ok := packet.Value.(int8) - if !ok { - val = -1 - } - child.Description = "Error" - child.Value = val - } - } - } - } -} - -func addRequestDescriptions(packet *ber.Packet) { - packet.Description = "LDAP Request" - packet.Children[0].Description = "Message ID" - packet.Children[1].Description = ApplicationMap[uint8(packet.Children[1].Tag)] - if len(packet.Children) == 3 { - addControlDescriptions(packet.Children[2]) - } -} - -func addDefaultLDAPResponseDescriptions(packet *ber.Packet) { - resultCode, _ := getLDAPResultCode(packet) - packet.Children[1].Children[0].Description = "Result Code (" + LDAPResultCodeMap[resultCode] + ")" - packet.Children[1].Children[1].Description = "Matched DN" - packet.Children[1].Children[2].Description = "Error Message" - if len(packet.Children[1].Children) > 3 { - packet.Children[1].Children[3].Description = "Referral" - } - if len(packet.Children) == 3 { - addControlDescriptions(packet.Children[2]) - } -} - -// DebugBinaryFile reads and prints packets from the given filename -func DebugBinaryFile(fileName string) error { - file, err := ioutil.ReadFile(fileName) - if err != nil { - return NewError(ErrorDebugging, err) - } - ber.PrintBytes(os.Stdout, file, "") - packet := ber.DecodePacket(file) - addLDAPDescriptions(packet) - ber.PrintPacket(packet) - - return nil -} - -var hex = "0123456789abcdef" - -func mustEscape(c byte) bool { - return c > 0x7f || c == '(' || c == ')' || c == '\\' || c == '*' || c == 0 -} - -// EscapeFilter escapes from the provided LDAP filter string the special -// characters in the set `()*\` and those out of the range 0 < c < 0x80, -// as defined in RFC4515. -func EscapeFilter(filter string) string { - escape := 0 - for i := 0; i < len(filter); i++ { - if mustEscape(filter[i]) { - escape++ - } - } - if escape == 0 { - return filter - } - buf := make([]byte, len(filter)+escape*2) - for i, j := 0, 0; i < len(filter); i++ { - c := filter[i] - if mustEscape(c) { - buf[j+0] = '\\' - buf[j+1] = hex[c>>4] - buf[j+2] = hex[c&0xf] - j += 3 - } else { - buf[j] = c - j++ - } - } - return string(buf) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/modify.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/modify.go deleted file mode 100644 index e4ab6cef..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/modify.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// File contains Modify functionality -// -// https://tools.ietf.org/html/rfc4511 -// -// ModifyRequest ::= [APPLICATION 6] SEQUENCE { -// object LDAPDN, -// changes SEQUENCE OF change SEQUENCE { -// operation ENUMERATED { -// add (0), -// delete (1), -// replace (2), -// ... }, -// modification PartialAttribute } } -// -// PartialAttribute ::= SEQUENCE { -// type AttributeDescription, -// vals SET OF value AttributeValue } -// -// AttributeDescription ::= LDAPString -// -- Constrained to -// -- [RFC4512] -// -// AttributeValue ::= OCTET STRING -// - -package ldap - -import ( - "errors" - "log" - - "gopkg.in/asn1-ber.v1" -) - -// Change operation choices -const ( - AddAttribute = 0 - DeleteAttribute = 1 - ReplaceAttribute = 2 -) - -// PartialAttribute for a ModifyRequest as defined in https://tools.ietf.org/html/rfc4511 -type PartialAttribute struct { - // Type is the type of the partial attribute - Type string - // Vals are the values of the partial attribute - Vals []string -} - -func (p *PartialAttribute) encode() *ber.Packet { - seq := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "PartialAttribute") - seq.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, p.Type, "Type")) - set := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSet, nil, "AttributeValue") - for _, value := range p.Vals { - set.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, value, "Vals")) - } - seq.AppendChild(set) - return seq -} - -// ModifyRequest as defined in https://tools.ietf.org/html/rfc4511 -type ModifyRequest struct { - // DN is the distinguishedName of the directory entry to modify - DN string - // AddAttributes contain the attributes to add - AddAttributes []PartialAttribute - // DeleteAttributes contain the attributes to delete - DeleteAttributes []PartialAttribute - // ReplaceAttributes contain the attributes to replace - ReplaceAttributes []PartialAttribute -} - -// Add inserts the given attribute to the list of attributes to add -func (m *ModifyRequest) Add(attrType string, attrVals []string) { - m.AddAttributes = append(m.AddAttributes, PartialAttribute{Type: attrType, Vals: attrVals}) -} - -// Delete inserts the given attribute to the list of attributes to delete -func (m *ModifyRequest) Delete(attrType string, attrVals []string) { - m.DeleteAttributes = append(m.DeleteAttributes, PartialAttribute{Type: attrType, Vals: attrVals}) -} - -// Replace inserts the given attribute to the list of attributes to replace -func (m *ModifyRequest) Replace(attrType string, attrVals []string) { - m.ReplaceAttributes = append(m.ReplaceAttributes, PartialAttribute{Type: attrType, Vals: attrVals}) -} - -func (m ModifyRequest) encode() *ber.Packet { - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationModifyRequest, nil, "Modify Request") - request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, m.DN, "DN")) - changes := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Changes") - for _, attribute := range m.AddAttributes { - change := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Change") - change.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(AddAttribute), "Operation")) - change.AppendChild(attribute.encode()) - changes.AppendChild(change) - } - for _, attribute := range m.DeleteAttributes { - change := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Change") - change.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(DeleteAttribute), "Operation")) - change.AppendChild(attribute.encode()) - changes.AppendChild(change) - } - for _, attribute := range m.ReplaceAttributes { - change := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Change") - change.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(ReplaceAttribute), "Operation")) - change.AppendChild(attribute.encode()) - changes.AppendChild(change) - } - request.AppendChild(changes) - return request -} - -// NewModifyRequest creates a modify request for the given DN -func NewModifyRequest( - dn string, -) *ModifyRequest { - return &ModifyRequest{ - DN: dn, - } -} - -// Modify performs the ModifyRequest -func (l *Conn) Modify(modifyRequest *ModifyRequest) error { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - packet.AppendChild(modifyRequest.encode()) - - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return err - } - defer l.finishMessage(msgCtx) - - l.Debug.Printf("%d: waiting for response", msgCtx.id) - packetResponse, ok := <-msgCtx.responses - if !ok { - return NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return err - } - ber.PrintPacket(packet) - } - - if packet.Children[1].Tag == ApplicationModifyResponse { - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return NewError(resultCode, errors.New(resultDescription)) - } - } else { - log.Printf("Unexpected Response: %d", packet.Children[1].Tag) - } - - l.Debug.Printf("%d: returning", msgCtx.id) - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/passwdmodify.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/passwdmodify.go deleted file mode 100644 index 7d8246fd..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/passwdmodify.go +++ /dev/null @@ -1,148 +0,0 @@ -// This file contains the password modify extended operation as specified in rfc 3062 -// -// https://tools.ietf.org/html/rfc3062 -// - -package ldap - -import ( - "errors" - "fmt" - - "gopkg.in/asn1-ber.v1" -) - -const ( - passwordModifyOID = "1.3.6.1.4.1.4203.1.11.1" -) - -// PasswordModifyRequest implements the Password Modify Extended Operation as defined in https://www.ietf.org/rfc/rfc3062.txt -type PasswordModifyRequest struct { - // UserIdentity is an optional string representation of the user associated with the request. - // This string may or may not be an LDAPDN [RFC2253]. - // If no UserIdentity field is present, the request acts up upon the password of the user currently associated with the LDAP session - UserIdentity string - // OldPassword, if present, contains the user's current password - OldPassword string - // NewPassword, if present, contains the desired password for this user - NewPassword string -} - -// PasswordModifyResult holds the server response to a PasswordModifyRequest -type PasswordModifyResult struct { - // GeneratedPassword holds a password generated by the server, if present - GeneratedPassword string -} - -func (r *PasswordModifyRequest) encode() (*ber.Packet, error) { - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationExtendedRequest, nil, "Password Modify Extended Operation") - request.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 0, passwordModifyOID, "Extended Request Name: Password Modify OID")) - extendedRequestValue := ber.Encode(ber.ClassContext, ber.TypePrimitive, 1, nil, "Extended Request Value: Password Modify Request") - passwordModifyRequestValue := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Password Modify Request") - if r.UserIdentity != "" { - passwordModifyRequestValue.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 0, r.UserIdentity, "User Identity")) - } - if r.OldPassword != "" { - passwordModifyRequestValue.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 1, r.OldPassword, "Old Password")) - } - if r.NewPassword != "" { - passwordModifyRequestValue.AppendChild(ber.NewString(ber.ClassContext, ber.TypePrimitive, 2, r.NewPassword, "New Password")) - } - - extendedRequestValue.AppendChild(passwordModifyRequestValue) - request.AppendChild(extendedRequestValue) - - return request, nil -} - -// NewPasswordModifyRequest creates a new PasswordModifyRequest -// -// According to the RFC 3602: -// userIdentity is a string representing the user associated with the request. -// This string may or may not be an LDAPDN (RFC 2253). -// If userIdentity is empty then the operation will act on the user associated -// with the session. -// -// oldPassword is the current user's password, it can be empty or it can be -// needed depending on the session user access rights (usually an administrator -// can change a user's password without knowing the current one) and the -// password policy (see pwdSafeModify password policy's attribute) -// -// newPassword is the desired user's password. If empty the server can return -// an error or generate a new password that will be available in the -// PasswordModifyResult.GeneratedPassword -// -func NewPasswordModifyRequest(userIdentity string, oldPassword string, newPassword string) *PasswordModifyRequest { - return &PasswordModifyRequest{ - UserIdentity: userIdentity, - OldPassword: oldPassword, - NewPassword: newPassword, - } -} - -// PasswordModify performs the modification request -func (l *Conn) PasswordModify(passwordModifyRequest *PasswordModifyRequest) (*PasswordModifyResult, error) { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - - encodedPasswordModifyRequest, err := passwordModifyRequest.encode() - if err != nil { - return nil, err - } - packet.AppendChild(encodedPasswordModifyRequest) - - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return nil, err - } - defer l.finishMessage(msgCtx) - - result := &PasswordModifyResult{} - - l.Debug.Printf("%d: waiting for response", msgCtx.id) - packetResponse, ok := <-msgCtx.responses - if !ok { - return nil, NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return nil, err - } - - if packet == nil { - return nil, NewError(ErrorNetwork, errors.New("ldap: could not retrieve message")) - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return nil, err - } - ber.PrintPacket(packet) - } - - if packet.Children[1].Tag == ApplicationExtendedResponse { - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return nil, NewError(resultCode, errors.New(resultDescription)) - } - } else { - return nil, NewError(ErrorUnexpectedResponse, fmt.Errorf("Unexpected Response: %d", packet.Children[1].Tag)) - } - - extendedResponse := packet.Children[1] - for _, child := range extendedResponse.Children { - if child.Tag == 11 { - passwordModifyResponseValue := ber.DecodePacket(child.Data.Bytes()) - if len(passwordModifyResponseValue.Children) == 1 { - if passwordModifyResponseValue.Children[0].Tag == 0 { - result.GeneratedPassword = ber.DecodeString(passwordModifyResponseValue.Children[0].Data.Bytes()) - } - } - } - } - - return result, nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/search.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/search.go deleted file mode 100644 index 2a99894c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/go-ldap/ldap/search.go +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// File contains Search functionality -// -// https://tools.ietf.org/html/rfc4511 -// -// SearchRequest ::= [APPLICATION 3] SEQUENCE { -// baseObject LDAPDN, -// scope ENUMERATED { -// baseObject (0), -// singleLevel (1), -// wholeSubtree (2), -// ... }, -// derefAliases ENUMERATED { -// neverDerefAliases (0), -// derefInSearching (1), -// derefFindingBaseObj (2), -// derefAlways (3) }, -// sizeLimit INTEGER (0 .. maxInt), -// timeLimit INTEGER (0 .. maxInt), -// typesOnly BOOLEAN, -// filter Filter, -// attributes AttributeSelection } -// -// AttributeSelection ::= SEQUENCE OF selector LDAPString -// -- The LDAPString is constrained to -// -- in Section 4.5.1.8 -// -// Filter ::= CHOICE { -// and [0] SET SIZE (1..MAX) OF filter Filter, -// or [1] SET SIZE (1..MAX) OF filter Filter, -// not [2] Filter, -// equalityMatch [3] AttributeValueAssertion, -// substrings [4] SubstringFilter, -// greaterOrEqual [5] AttributeValueAssertion, -// lessOrEqual [6] AttributeValueAssertion, -// present [7] AttributeDescription, -// approxMatch [8] AttributeValueAssertion, -// extensibleMatch [9] MatchingRuleAssertion, -// ... } -// -// SubstringFilter ::= SEQUENCE { -// type AttributeDescription, -// substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE { -// initial [0] AssertionValue, -- can occur at most once -// any [1] AssertionValue, -// final [2] AssertionValue } -- can occur at most once -// } -// -// MatchingRuleAssertion ::= SEQUENCE { -// matchingRule [1] MatchingRuleId OPTIONAL, -// type [2] AttributeDescription OPTIONAL, -// matchValue [3] AssertionValue, -// dnAttributes [4] BOOLEAN DEFAULT FALSE } -// -// - -package ldap - -import ( - "errors" - "fmt" - "sort" - "strings" - - "gopkg.in/asn1-ber.v1" -) - -// scope choices -const ( - ScopeBaseObject = 0 - ScopeSingleLevel = 1 - ScopeWholeSubtree = 2 -) - -// ScopeMap contains human readable descriptions of scope choices -var ScopeMap = map[int]string{ - ScopeBaseObject: "Base Object", - ScopeSingleLevel: "Single Level", - ScopeWholeSubtree: "Whole Subtree", -} - -// derefAliases -const ( - NeverDerefAliases = 0 - DerefInSearching = 1 - DerefFindingBaseObj = 2 - DerefAlways = 3 -) - -// DerefMap contains human readable descriptions of derefAliases choices -var DerefMap = map[int]string{ - NeverDerefAliases: "NeverDerefAliases", - DerefInSearching: "DerefInSearching", - DerefFindingBaseObj: "DerefFindingBaseObj", - DerefAlways: "DerefAlways", -} - -// NewEntry returns an Entry object with the specified distinguished name and attribute key-value pairs. -// The map of attributes is accessed in alphabetical order of the keys in order to ensure that, for the -// same input map of attributes, the output entry will contain the same order of attributes -func NewEntry(dn string, attributes map[string][]string) *Entry { - var attributeNames []string - for attributeName := range attributes { - attributeNames = append(attributeNames, attributeName) - } - sort.Strings(attributeNames) - - var encodedAttributes []*EntryAttribute - for _, attributeName := range attributeNames { - encodedAttributes = append(encodedAttributes, NewEntryAttribute(attributeName, attributes[attributeName])) - } - return &Entry{ - DN: dn, - Attributes: encodedAttributes, - } -} - -// Entry represents a single search result entry -type Entry struct { - // DN is the distinguished name of the entry - DN string - // Attributes are the returned attributes for the entry - Attributes []*EntryAttribute -} - -// GetAttributeValues returns the values for the named attribute, or an empty list -func (e *Entry) GetAttributeValues(attribute string) []string { - for _, attr := range e.Attributes { - if attr.Name == attribute { - return attr.Values - } - } - return []string{} -} - -// GetRawAttributeValues returns the byte values for the named attribute, or an empty list -func (e *Entry) GetRawAttributeValues(attribute string) [][]byte { - for _, attr := range e.Attributes { - if attr.Name == attribute { - return attr.ByteValues - } - } - return [][]byte{} -} - -// GetAttributeValue returns the first value for the named attribute, or "" -func (e *Entry) GetAttributeValue(attribute string) string { - values := e.GetAttributeValues(attribute) - if len(values) == 0 { - return "" - } - return values[0] -} - -// GetRawAttributeValue returns the first value for the named attribute, or an empty slice -func (e *Entry) GetRawAttributeValue(attribute string) []byte { - values := e.GetRawAttributeValues(attribute) - if len(values) == 0 { - return []byte{} - } - return values[0] -} - -// Print outputs a human-readable description -func (e *Entry) Print() { - fmt.Printf("DN: %s\n", e.DN) - for _, attr := range e.Attributes { - attr.Print() - } -} - -// PrettyPrint outputs a human-readable description indenting -func (e *Entry) PrettyPrint(indent int) { - fmt.Printf("%sDN: %s\n", strings.Repeat(" ", indent), e.DN) - for _, attr := range e.Attributes { - attr.PrettyPrint(indent + 2) - } -} - -// NewEntryAttribute returns a new EntryAttribute with the desired key-value pair -func NewEntryAttribute(name string, values []string) *EntryAttribute { - var bytes [][]byte - for _, value := range values { - bytes = append(bytes, []byte(value)) - } - return &EntryAttribute{ - Name: name, - Values: values, - ByteValues: bytes, - } -} - -// EntryAttribute holds a single attribute -type EntryAttribute struct { - // Name is the name of the attribute - Name string - // Values contain the string values of the attribute - Values []string - // ByteValues contain the raw values of the attribute - ByteValues [][]byte -} - -// Print outputs a human-readable description -func (e *EntryAttribute) Print() { - fmt.Printf("%s: %s\n", e.Name, e.Values) -} - -// PrettyPrint outputs a human-readable description with indenting -func (e *EntryAttribute) PrettyPrint(indent int) { - fmt.Printf("%s%s: %s\n", strings.Repeat(" ", indent), e.Name, e.Values) -} - -// SearchResult holds the server's response to a search request -type SearchResult struct { - // Entries are the returned entries - Entries []*Entry - // Referrals are the returned referrals - Referrals []string - // Controls are the returned controls - Controls []Control -} - -// Print outputs a human-readable description -func (s *SearchResult) Print() { - for _, entry := range s.Entries { - entry.Print() - } -} - -// PrettyPrint outputs a human-readable description with indenting -func (s *SearchResult) PrettyPrint(indent int) { - for _, entry := range s.Entries { - entry.PrettyPrint(indent) - } -} - -// SearchRequest represents a search request to send to the server -type SearchRequest struct { - BaseDN string - Scope int - DerefAliases int - SizeLimit int - TimeLimit int - TypesOnly bool - Filter string - Attributes []string - Controls []Control -} - -func (s *SearchRequest) encode() (*ber.Packet, error) { - request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationSearchRequest, nil, "Search Request") - request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, s.BaseDN, "Base DN")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(s.Scope), "Scope")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(s.DerefAliases), "Deref Aliases")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, uint64(s.SizeLimit), "Size Limit")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, uint64(s.TimeLimit), "Time Limit")) - request.AppendChild(ber.NewBoolean(ber.ClassUniversal, ber.TypePrimitive, ber.TagBoolean, s.TypesOnly, "Types Only")) - // compile and encode filter - filterPacket, err := CompileFilter(s.Filter) - if err != nil { - return nil, err - } - request.AppendChild(filterPacket) - // encode attributes - attributesPacket := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Attributes") - for _, attribute := range s.Attributes { - attributesPacket.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, attribute, "Attribute")) - } - request.AppendChild(attributesPacket) - return request, nil -} - -// NewSearchRequest creates a new search request -func NewSearchRequest( - BaseDN string, - Scope, DerefAliases, SizeLimit, TimeLimit int, - TypesOnly bool, - Filter string, - Attributes []string, - Controls []Control, -) *SearchRequest { - return &SearchRequest{ - BaseDN: BaseDN, - Scope: Scope, - DerefAliases: DerefAliases, - SizeLimit: SizeLimit, - TimeLimit: TimeLimit, - TypesOnly: TypesOnly, - Filter: Filter, - Attributes: Attributes, - Controls: Controls, - } -} - -// SearchWithPaging accepts a search request and desired page size in order to execute LDAP queries to fulfill the -// search request. All paged LDAP query responses will be buffered and the final result will be returned atomically. -// The following four cases are possible given the arguments: -// - given SearchRequest missing a control of type ControlTypePaging: we will add one with the desired paging size -// - given SearchRequest contains a control of type ControlTypePaging that isn't actually a ControlPaging: fail without issuing any queries -// - given SearchRequest contains a control of type ControlTypePaging with pagingSize equal to the size requested: no change to the search request -// - given SearchRequest contains a control of type ControlTypePaging with pagingSize not equal to the size requested: fail without issuing any queries -// A requested pagingSize of 0 is interpreted as no limit by LDAP servers. -func (l *Conn) SearchWithPaging(searchRequest *SearchRequest, pagingSize uint32) (*SearchResult, error) { - var pagingControl *ControlPaging - - control := FindControl(searchRequest.Controls, ControlTypePaging) - if control == nil { - pagingControl = NewControlPaging(pagingSize) - searchRequest.Controls = append(searchRequest.Controls, pagingControl) - } else { - castControl, ok := control.(*ControlPaging) - if !ok { - return nil, fmt.Errorf("Expected paging control to be of type *ControlPaging, got %v", control) - } - if castControl.PagingSize != pagingSize { - return nil, fmt.Errorf("Paging size given in search request (%d) conflicts with size given in search call (%d)", castControl.PagingSize, pagingSize) - } - pagingControl = castControl - } - - searchResult := new(SearchResult) - for { - result, err := l.Search(searchRequest) - l.Debug.Printf("Looking for Paging Control...") - if err != nil { - return searchResult, err - } - if result == nil { - return searchResult, NewError(ErrorNetwork, errors.New("ldap: packet not received")) - } - - for _, entry := range result.Entries { - searchResult.Entries = append(searchResult.Entries, entry) - } - for _, referral := range result.Referrals { - searchResult.Referrals = append(searchResult.Referrals, referral) - } - for _, control := range result.Controls { - searchResult.Controls = append(searchResult.Controls, control) - } - - l.Debug.Printf("Looking for Paging Control...") - pagingResult := FindControl(result.Controls, ControlTypePaging) - if pagingResult == nil { - pagingControl = nil - l.Debug.Printf("Could not find paging control. Breaking...") - break - } - - cookie := pagingResult.(*ControlPaging).Cookie - if len(cookie) == 0 { - pagingControl = nil - l.Debug.Printf("Could not find cookie. Breaking...") - break - } - pagingControl.SetCookie(cookie) - } - - if pagingControl != nil { - l.Debug.Printf("Abandoning Paging...") - pagingControl.PagingSize = 0 - l.Search(searchRequest) - } - - return searchResult, nil -} - -// Search performs the given search request -func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) { - packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, l.nextMessageID(), "MessageID")) - // encode search request - encodedSearchRequest, err := searchRequest.encode() - if err != nil { - return nil, err - } - packet.AppendChild(encodedSearchRequest) - // encode search controls - if searchRequest.Controls != nil { - packet.AppendChild(encodeControls(searchRequest.Controls)) - } - - l.Debug.PrintPacket(packet) - - msgCtx, err := l.sendMessage(packet) - if err != nil { - return nil, err - } - defer l.finishMessage(msgCtx) - - result := &SearchResult{ - Entries: make([]*Entry, 0), - Referrals: make([]string, 0), - Controls: make([]Control, 0)} - - foundSearchResultDone := false - for !foundSearchResultDone { - l.Debug.Printf("%d: waiting for response", msgCtx.id) - packetResponse, ok := <-msgCtx.responses - if !ok { - return nil, NewError(ErrorNetwork, errors.New("ldap: response channel closed")) - } - packet, err = packetResponse.ReadPacket() - l.Debug.Printf("%d: got response %p", msgCtx.id, packet) - if err != nil { - return nil, err - } - - if l.Debug { - if err := addLDAPDescriptions(packet); err != nil { - return nil, err - } - ber.PrintPacket(packet) - } - - switch packet.Children[1].Tag { - case 4: - entry := new(Entry) - entry.DN = packet.Children[1].Children[0].Value.(string) - for _, child := range packet.Children[1].Children[1].Children { - attr := new(EntryAttribute) - attr.Name = child.Children[0].Value.(string) - for _, value := range child.Children[1].Children { - attr.Values = append(attr.Values, value.Value.(string)) - attr.ByteValues = append(attr.ByteValues, value.ByteValue) - } - entry.Attributes = append(entry.Attributes, attr) - } - result.Entries = append(result.Entries, entry) - case 5: - resultCode, resultDescription := getLDAPResultCode(packet) - if resultCode != 0 { - return result, NewError(resultCode, errors.New(resultDescription)) - } - if len(packet.Children) == 3 { - for _, child := range packet.Children[2].Children { - result.Controls = append(result.Controls, DecodeControl(child)) - } - } - foundSearchResultDone = true - case 19: - result.Referrals = append(result.Referrals, packet.Children[1].Children[0].Value.(string)) - } - } - l.Debug.Printf("%d: returning", msgCtx.id) - return result, nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/dce.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/dce.go deleted file mode 100644 index 50a0f2d0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/dce.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "encoding/binary" - "fmt" - "os" -) - -// A Domain represents a Version 2 domain -type Domain byte - -// Domain constants for DCE Security (Version 2) UUIDs. -const ( - Person = Domain(0) - Group = Domain(1) - Org = Domain(2) -) - -// NewDCESecurity returns a DCE Security (Version 2) UUID. -// -// The domain should be one of Person, Group or Org. -// On a POSIX system the id should be the users UID for the Person -// domain and the users GID for the Group. The meaning of id for -// the domain Org or on non-POSIX systems is site defined. -// -// For a given domain/id pair the same token may be returned for up to -// 7 minutes and 10 seconds. -func NewDCESecurity(domain Domain, id uint32) UUID { - uuid := NewUUID() - if uuid != nil { - uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2 - uuid[9] = byte(domain) - binary.BigEndian.PutUint32(uuid[0:], id) - } - return uuid -} - -// NewDCEPerson returns a DCE Security (Version 2) UUID in the person -// domain with the id returned by os.Getuid. -// -// NewDCEPerson(Person, uint32(os.Getuid())) -func NewDCEPerson() UUID { - return NewDCESecurity(Person, uint32(os.Getuid())) -} - -// NewDCEGroup returns a DCE Security (Version 2) UUID in the group -// domain with the id returned by os.Getgid. -// -// NewDCEGroup(Group, uint32(os.Getgid())) -func NewDCEGroup() UUID { - return NewDCESecurity(Group, uint32(os.Getgid())) -} - -// Domain returns the domain for a Version 2 UUID or false. -func (uuid UUID) Domain() (Domain, bool) { - if v, _ := uuid.Version(); v != 2 { - return 0, false - } - return Domain(uuid[9]), true -} - -// Id returns the id for a Version 2 UUID or false. -func (uuid UUID) Id() (uint32, bool) { - if v, _ := uuid.Version(); v != 2 { - return 0, false - } - return binary.BigEndian.Uint32(uuid[0:4]), true -} - -func (d Domain) String() string { - switch d { - case Person: - return "Person" - case Group: - return "Group" - case Org: - return "Org" - } - return fmt.Sprintf("Domain%d", int(d)) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/doc.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/doc.go deleted file mode 100644 index d8bd013e..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// The uuid package generates and inspects UUIDs. -// -// UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services. -package uuid diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/hash.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/hash.go deleted file mode 100644 index a0420c1e..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/hash.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "crypto/md5" - "crypto/sha1" - "hash" -) - -// Well known Name Space IDs and UUIDs -var ( - NameSpace_DNS = Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - NameSpace_URL = Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8") - NameSpace_OID = Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8") - NameSpace_X500 = Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8") - NIL = Parse("00000000-0000-0000-0000-000000000000") -) - -// NewHash returns a new UUID derived from the hash of space concatenated with -// data generated by h. The hash should be at least 16 byte in length. The -// first 16 bytes of the hash are used to form the UUID. The version of the -// UUID will be the lower 4 bits of version. NewHash is used to implement -// NewMD5 and NewSHA1. -func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { - h.Reset() - h.Write(space) - h.Write([]byte(data)) - s := h.Sum(nil) - uuid := make([]byte, 16) - copy(uuid, s) - uuid[6] = (uuid[6] & 0x0f) | uint8((version&0xf)<<4) - uuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 variant - return uuid -} - -// NewMD5 returns a new MD5 (Version 3) UUID based on the -// supplied name space and data. -// -// NewHash(md5.New(), space, data, 3) -func NewMD5(space UUID, data []byte) UUID { - return NewHash(md5.New(), space, data, 3) -} - -// NewSHA1 returns a new SHA1 (Version 5) UUID based on the -// supplied name space and data. -// -// NewHash(sha1.New(), space, data, 5) -func NewSHA1(space UUID, data []byte) UUID { - return NewHash(sha1.New(), space, data, 5) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/marshal.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/marshal.go deleted file mode 100644 index 6621dd54..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/marshal.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2016 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "errors" - "fmt" -) - -// MarshalText implements encoding.TextMarshaler. -func (u UUID) MarshalText() ([]byte, error) { - if len(u) != 16 { - return nil, nil - } - var js [36]byte - encodeHex(js[:], u) - return js[:], nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (u *UUID) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - id := Parse(string(data)) - if id == nil { - return errors.New("invalid UUID") - } - *u = id - return nil -} - -// MarshalBinary implements encoding.BinaryMarshaler. -func (u UUID) MarshalBinary() ([]byte, error) { - return u[:], nil -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler. -func (u *UUID) UnmarshalBinary(data []byte) error { - if len(data) == 0 { - return nil - } - if len(data) != 16 { - return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) - } - var id [16]byte - copy(id[:], data) - *u = id[:] - return nil -} - -// MarshalText implements encoding.TextMarshaler. -func (u Array) MarshalText() ([]byte, error) { - var js [36]byte - encodeHex(js[:], u[:]) - return js[:], nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (u *Array) UnmarshalText(data []byte) error { - id := Parse(string(data)) - if id == nil { - return errors.New("invalid UUID") - } - *u = id.Array() - return nil -} - -// MarshalBinary implements encoding.BinaryMarshaler. -func (u Array) MarshalBinary() ([]byte, error) { - return u[:], nil -} - -// UnmarshalBinary implements encoding.BinaryUnmarshaler. -func (u *Array) UnmarshalBinary(data []byte) error { - if len(data) != 16 { - return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) - } - copy(u[:], data) - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/node.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/node.go deleted file mode 100644 index 42d60da8..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/node.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "net" - "sync" -) - -var ( - nodeMu sync.Mutex - interfaces []net.Interface // cached list of interfaces - ifname string // name of interface being used - nodeID []byte // hardware for version 1 UUIDs -) - -// NodeInterface returns the name of the interface from which the NodeID was -// derived. The interface "user" is returned if the NodeID was set by -// SetNodeID. -func NodeInterface() string { - defer nodeMu.Unlock() - nodeMu.Lock() - return ifname -} - -// SetNodeInterface selects the hardware address to be used for Version 1 UUIDs. -// If name is "" then the first usable interface found will be used or a random -// Node ID will be generated. If a named interface cannot be found then false -// is returned. -// -// SetNodeInterface never fails when name is "". -func SetNodeInterface(name string) bool { - defer nodeMu.Unlock() - nodeMu.Lock() - return setNodeInterface(name) -} - -func setNodeInterface(name string) bool { - if interfaces == nil { - var err error - interfaces, err = net.Interfaces() - if err != nil && name != "" { - return false - } - } - - for _, ifs := range interfaces { - if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { - if setNodeID(ifs.HardwareAddr) { - ifname = ifs.Name - return true - } - } - } - - // We found no interfaces with a valid hardware address. If name - // does not specify a specific interface generate a random Node ID - // (section 4.1.6) - if name == "" { - if nodeID == nil { - nodeID = make([]byte, 6) - } - randomBits(nodeID) - return true - } - return false -} - -// NodeID returns a slice of a copy of the current Node ID, setting the Node ID -// if not already set. -func NodeID() []byte { - defer nodeMu.Unlock() - nodeMu.Lock() - if nodeID == nil { - setNodeInterface("") - } - nid := make([]byte, 6) - copy(nid, nodeID) - return nid -} - -// SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes -// of id are used. If id is less than 6 bytes then false is returned and the -// Node ID is not set. -func SetNodeID(id []byte) bool { - defer nodeMu.Unlock() - nodeMu.Lock() - if setNodeID(id) { - ifname = "user" - return true - } - return false -} - -func setNodeID(id []byte) bool { - if len(id) < 6 { - return false - } - if nodeID == nil { - nodeID = make([]byte, 6) - } - copy(nodeID, id) - return true -} - -// NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is -// not valid. The NodeID is only well defined for version 1 and 2 UUIDs. -func (uuid UUID) NodeID() []byte { - if len(uuid) != 16 { - return nil - } - node := make([]byte, 6) - copy(node, uuid[10:]) - return node -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/sql.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/sql.go deleted file mode 100644 index d015bfd1..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/sql.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2015 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "database/sql/driver" - "errors" - "fmt" -) - -// Scan implements sql.Scanner so UUIDs can be read from databases transparently -// Currently, database types that map to string and []byte are supported. Please -// consult database-specific driver documentation for matching types. -func (uuid *UUID) Scan(src interface{}) error { - switch src.(type) { - case string: - // if an empty UUID comes from a table, we return a null UUID - if src.(string) == "" { - return nil - } - - // see uuid.Parse for required string format - parsed := Parse(src.(string)) - - if parsed == nil { - return errors.New("Scan: invalid UUID format") - } - - *uuid = parsed - case []byte: - b := src.([]byte) - - // if an empty UUID comes from a table, we return a null UUID - if len(b) == 0 { - return nil - } - - // assumes a simple slice of bytes if 16 bytes - // otherwise attempts to parse - if len(b) == 16 { - *uuid = UUID(b) - } else { - u := Parse(string(b)) - - if u == nil { - return errors.New("Scan: invalid UUID format") - } - - *uuid = u - } - - default: - return fmt.Errorf("Scan: unable to scan type %T into UUID", src) - } - - return nil -} - -// Value implements sql.Valuer so that UUIDs can be written to databases -// transparently. Currently, UUIDs map to strings. Please consult -// database-specific driver documentation for matching types. -func (uuid UUID) Value() (driver.Value, error) { - return uuid.String(), nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/time.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/time.go deleted file mode 100644 index eedf2421..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/time.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2014 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "encoding/binary" - "sync" - "time" -) - -// A Time represents a time as the number of 100's of nanoseconds since 15 Oct -// 1582. -type Time int64 - -const ( - lillian = 2299160 // Julian day of 15 Oct 1582 - unix = 2440587 // Julian day of 1 Jan 1970 - epoch = unix - lillian // Days between epochs - g1582 = epoch * 86400 // seconds between epochs - g1582ns100 = g1582 * 10000000 // 100s of a nanoseconds between epochs -) - -var ( - timeMu sync.Mutex - lasttime uint64 // last time we returned - clock_seq uint16 // clock sequence for this run - - timeNow = time.Now // for testing -) - -// UnixTime converts t the number of seconds and nanoseconds using the Unix -// epoch of 1 Jan 1970. -func (t Time) UnixTime() (sec, nsec int64) { - sec = int64(t - g1582ns100) - nsec = (sec % 10000000) * 100 - sec /= 10000000 - return sec, nsec -} - -// GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and -// clock sequence as well as adjusting the clock sequence as needed. An error -// is returned if the current time cannot be determined. -func GetTime() (Time, uint16, error) { - defer timeMu.Unlock() - timeMu.Lock() - return getTime() -} - -func getTime() (Time, uint16, error) { - t := timeNow() - - // If we don't have a clock sequence already, set one. - if clock_seq == 0 { - setClockSequence(-1) - } - now := uint64(t.UnixNano()/100) + g1582ns100 - - // If time has gone backwards with this clock sequence then we - // increment the clock sequence - if now <= lasttime { - clock_seq = ((clock_seq + 1) & 0x3fff) | 0x8000 - } - lasttime = now - return Time(now), clock_seq, nil -} - -// ClockSequence returns the current clock sequence, generating one if not -// already set. The clock sequence is only used for Version 1 UUIDs. -// -// The uuid package does not use global static storage for the clock sequence or -// the last time a UUID was generated. Unless SetClockSequence a new random -// clock sequence is generated the first time a clock sequence is requested by -// ClockSequence, GetTime, or NewUUID. (section 4.2.1.1) sequence is generated -// for -func ClockSequence() int { - defer timeMu.Unlock() - timeMu.Lock() - return clockSequence() -} - -func clockSequence() int { - if clock_seq == 0 { - setClockSequence(-1) - } - return int(clock_seq & 0x3fff) -} - -// SetClockSeq sets the clock sequence to the lower 14 bits of seq. Setting to -// -1 causes a new sequence to be generated. -func SetClockSequence(seq int) { - defer timeMu.Unlock() - timeMu.Lock() - setClockSequence(seq) -} - -func setClockSequence(seq int) { - if seq == -1 { - var b [2]byte - randomBits(b[:]) // clock sequence - seq = int(b[0])<<8 | int(b[1]) - } - old_seq := clock_seq - clock_seq = uint16(seq&0x3fff) | 0x8000 // Set our variant - if old_seq != clock_seq { - lasttime = 0 - } -} - -// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in -// uuid. It returns false if uuid is not valid. The time is only well defined -// for version 1 and 2 UUIDs. -func (uuid UUID) Time() (Time, bool) { - if len(uuid) != 16 { - return 0, false - } - time := int64(binary.BigEndian.Uint32(uuid[0:4])) - time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32 - time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48 - return Time(time), true -} - -// ClockSequence returns the clock sequence encoded in uuid. It returns false -// if uuid is not valid. The clock sequence is only well defined for version 1 -// and 2 UUIDs. -func (uuid UUID) ClockSequence() (int, bool) { - if len(uuid) != 16 { - return 0, false - } - return int(binary.BigEndian.Uint16(uuid[8:10])) & 0x3fff, true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/util.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/util.go deleted file mode 100644 index fc8e052c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/util.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "io" -) - -// randomBits completely fills slice b with random data. -func randomBits(b []byte) { - if _, err := io.ReadFull(rander, b); err != nil { - panic(err.Error()) // rand should never fail - } -} - -// xvalues returns the value of a byte as a hexadecimal digit or 255. -var xvalues = [256]byte{ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255, - 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, -} - -// xtob converts the the first two hex bytes of x into a byte. -func xtob(x string) (byte, bool) { - b1 := xvalues[x[0]] - b2 := xvalues[x[1]] - return (b1 << 4) | b2, b1 != 255 && b2 != 255 -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/uuid.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/uuid.go deleted file mode 100644 index 7c643cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/uuid.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "bytes" - "crypto/rand" - "encoding/hex" - "fmt" - "io" - "strings" -) - -// Array is a pass-by-value UUID that can be used as an effecient key in a map. -type Array [16]byte - -// UUID converts uuid into a slice. -func (uuid Array) UUID() UUID { - return uuid[:] -} - -// String returns the string representation of uuid, -// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. -func (uuid Array) String() string { - return uuid.UUID().String() -} - -// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC -// 4122. -type UUID []byte - -// A Version represents a UUIDs version. -type Version byte - -// A Variant represents a UUIDs variant. -type Variant byte - -// Constants returned by Variant. -const ( - Invalid = Variant(iota) // Invalid UUID - RFC4122 // The variant specified in RFC4122 - Reserved // Reserved, NCS backward compatibility. - Microsoft // Reserved, Microsoft Corporation backward compatibility. - Future // Reserved for future definition. -) - -var rander = rand.Reader // random function - -// New returns a new random (version 4) UUID as a string. It is a convenience -// function for NewRandom().String(). -func New() string { - return NewRandom().String() -} - -// Parse decodes s into a UUID or returns nil. Both the UUID form of -// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and -// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded. -func Parse(s string) UUID { - if len(s) == 36+9 { - if strings.ToLower(s[:9]) != "urn:uuid:" { - return nil - } - s = s[9:] - } else if len(s) != 36 { - return nil - } - if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { - return nil - } - var uuid [16]byte - for i, x := range [16]int{ - 0, 2, 4, 6, - 9, 11, - 14, 16, - 19, 21, - 24, 26, 28, 30, 32, 34} { - if v, ok := xtob(s[x:]); !ok { - return nil - } else { - uuid[i] = v - } - } - return uuid[:] -} - -// Equal returns true if uuid1 and uuid2 are equal. -func Equal(uuid1, uuid2 UUID) bool { - return bytes.Equal(uuid1, uuid2) -} - -// Array returns an array representation of uuid that can be used as a map key. -// Array panics if uuid is not valid. -func (uuid UUID) Array() Array { - if len(uuid) != 16 { - panic("invalid uuid") - } - var a Array - copy(a[:], uuid) - return a -} - -// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -// , or "" if uuid is invalid. -func (uuid UUID) String() string { - if len(uuid) != 16 { - return "" - } - var buf [36]byte - encodeHex(buf[:], uuid) - return string(buf[:]) -} - -// URN returns the RFC 2141 URN form of uuid, -// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid. -func (uuid UUID) URN() string { - if len(uuid) != 16 { - return "" - } - var buf [36 + 9]byte - copy(buf[:], "urn:uuid:") - encodeHex(buf[9:], uuid) - return string(buf[:]) -} - -func encodeHex(dst []byte, uuid UUID) { - hex.Encode(dst[:], uuid[:4]) - dst[8] = '-' - hex.Encode(dst[9:13], uuid[4:6]) - dst[13] = '-' - hex.Encode(dst[14:18], uuid[6:8]) - dst[18] = '-' - hex.Encode(dst[19:23], uuid[8:10]) - dst[23] = '-' - hex.Encode(dst[24:], uuid[10:]) -} - -// Variant returns the variant encoded in uuid. It returns Invalid if -// uuid is invalid. -func (uuid UUID) Variant() Variant { - if len(uuid) != 16 { - return Invalid - } - switch { - case (uuid[8] & 0xc0) == 0x80: - return RFC4122 - case (uuid[8] & 0xe0) == 0xc0: - return Microsoft - case (uuid[8] & 0xe0) == 0xe0: - return Future - default: - return Reserved - } -} - -// Version returns the version of uuid. It returns false if uuid is not -// valid. -func (uuid UUID) Version() (Version, bool) { - if len(uuid) != 16 { - return 0, false - } - return Version(uuid[6] >> 4), true -} - -func (v Version) String() string { - if v > 15 { - return fmt.Sprintf("BAD_VERSION_%d", v) - } - return fmt.Sprintf("VERSION_%d", v) -} - -func (v Variant) String() string { - switch v { - case RFC4122: - return "RFC4122" - case Reserved: - return "Reserved" - case Microsoft: - return "Microsoft" - case Future: - return "Future" - case Invalid: - return "Invalid" - } - return fmt.Sprintf("BadVariant%d", int(v)) -} - -// SetRand sets the random number generator to r, which implements io.Reader. -// If r.Read returns an error when the package requests random data then -// a panic will be issued. -// -// Calling SetRand with nil sets the random number generator to the default -// generator. -func SetRand(r io.Reader) { - if r == nil { - rander = rand.Reader - return - } - rander = r -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version1.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version1.go deleted file mode 100644 index 0127eacf..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version1.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -import ( - "encoding/binary" -) - -// NewUUID returns a Version 1 UUID based on the current NodeID and clock -// sequence, and the current time. If the NodeID has not been set by SetNodeID -// or SetNodeInterface then it will be set automatically. If the NodeID cannot -// be set NewUUID returns nil. If clock sequence has not been set by -// SetClockSequence then it will be set automatically. If GetTime fails to -// return the current NewUUID returns nil. -func NewUUID() UUID { - if nodeID == nil { - SetNodeInterface("") - } - - now, seq, err := GetTime() - if err != nil { - return nil - } - - uuid := make([]byte, 16) - - time_low := uint32(now & 0xffffffff) - time_mid := uint16((now >> 32) & 0xffff) - time_hi := uint16((now >> 48) & 0x0fff) - time_hi |= 0x1000 // Version 1 - - binary.BigEndian.PutUint32(uuid[0:], time_low) - binary.BigEndian.PutUint16(uuid[4:], time_mid) - binary.BigEndian.PutUint16(uuid[6:], time_hi) - binary.BigEndian.PutUint16(uuid[8:], seq) - copy(uuid[10:], nodeID) - - return uuid -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version4.go b/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version4.go deleted file mode 100644 index b3d4a368..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/github.com/pborman/uuid/version4.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package uuid - -// Random returns a Random (Version 4) UUID or panics. -// -// The strength of the UUIDs is based on the strength of the crypto/rand -// package. -// -// A note about uniqueness derived from from the UUID Wikipedia entry: -// -// Randomly generated UUIDs have 122 random bits. One's annual risk of being -// hit by a meteorite is estimated to be one chance in 17 billion, that -// means the probability is about 0.00000000006 (6 × 10−11), -// equivalent to the odds of creating a few tens of trillions of UUIDs in a -// year and having one duplicate. -func NewRandom() UUID { - uuid := make([]byte, 16) - randomBits([]byte(uuid)) - uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 - uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 - return uuid -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/base64.go b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/base64.go deleted file mode 100644 index fc311609..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/base64.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package bcrypt - -import "encoding/base64" - -const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - -var bcEncoding = base64.NewEncoding(alphabet) - -func base64Encode(src []byte) []byte { - n := bcEncoding.EncodedLen(len(src)) - dst := make([]byte, n) - bcEncoding.Encode(dst, src) - for dst[n-1] == '=' { - n-- - } - return dst[:n] -} - -func base64Decode(src []byte) ([]byte, error) { - numOfEquals := 4 - (len(src) % 4) - for i := 0; i < numOfEquals; i++ { - src = append(src, '=') - } - - dst := make([]byte, bcEncoding.DecodedLen(len(src))) - n, err := bcEncoding.Decode(dst, src) - if err != nil { - return nil, err - } - return dst[:n], nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/bcrypt.go b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/bcrypt.go deleted file mode 100644 index aeb73f81..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/bcrypt/bcrypt.go +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing -// algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf -package bcrypt // import "golang.org/x/crypto/bcrypt" - -// The code is a port of Provos and Mazières's C implementation. -import ( - "crypto/rand" - "crypto/subtle" - "errors" - "fmt" - "io" - "strconv" - - "golang.org/x/crypto/blowfish" -) - -const ( - MinCost int = 4 // the minimum allowable cost as passed in to GenerateFromPassword - MaxCost int = 31 // the maximum allowable cost as passed in to GenerateFromPassword - DefaultCost int = 10 // the cost that will actually be set if a cost below MinCost is passed into GenerateFromPassword -) - -// The error returned from CompareHashAndPassword when a password and hash do -// not match. -var ErrMismatchedHashAndPassword = errors.New("crypto/bcrypt: hashedPassword is not the hash of the given password") - -// The error returned from CompareHashAndPassword when a hash is too short to -// be a bcrypt hash. -var ErrHashTooShort = errors.New("crypto/bcrypt: hashedSecret too short to be a bcrypted password") - -// The error returned from CompareHashAndPassword when a hash was created with -// a bcrypt algorithm newer than this implementation. -type HashVersionTooNewError byte - -func (hv HashVersionTooNewError) Error() string { - return fmt.Sprintf("crypto/bcrypt: bcrypt algorithm version '%c' requested is newer than current version '%c'", byte(hv), majorVersion) -} - -// The error returned from CompareHashAndPassword when a hash starts with something other than '$' -type InvalidHashPrefixError byte - -func (ih InvalidHashPrefixError) Error() string { - return fmt.Sprintf("crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'", byte(ih)) -} - -type InvalidCostError int - -func (ic InvalidCostError) Error() string { - return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), int(MinCost), int(MaxCost)) -} - -const ( - majorVersion = '2' - minorVersion = 'a' - maxSaltSize = 16 - maxCryptedHashSize = 23 - encodedSaltSize = 22 - encodedHashSize = 31 - minHashSize = 59 -) - -// magicCipherData is an IV for the 64 Blowfish encryption calls in -// bcrypt(). It's the string "OrpheanBeholderScryDoubt" in big-endian bytes. -var magicCipherData = []byte{ - 0x4f, 0x72, 0x70, 0x68, - 0x65, 0x61, 0x6e, 0x42, - 0x65, 0x68, 0x6f, 0x6c, - 0x64, 0x65, 0x72, 0x53, - 0x63, 0x72, 0x79, 0x44, - 0x6f, 0x75, 0x62, 0x74, -} - -type hashed struct { - hash []byte - salt []byte - cost int // allowed range is MinCost to MaxCost - major byte - minor byte -} - -// GenerateFromPassword returns the bcrypt hash of the password at the given -// cost. If the cost given is less than MinCost, the cost will be set to -// DefaultCost, instead. Use CompareHashAndPassword, as defined in this package, -// to compare the returned hashed password with its cleartext version. -func GenerateFromPassword(password []byte, cost int) ([]byte, error) { - p, err := newFromPassword(password, cost) - if err != nil { - return nil, err - } - return p.Hash(), nil -} - -// CompareHashAndPassword compares a bcrypt hashed password with its possible -// plaintext equivalent. Returns nil on success, or an error on failure. -func CompareHashAndPassword(hashedPassword, password []byte) error { - p, err := newFromHash(hashedPassword) - if err != nil { - return err - } - - otherHash, err := bcrypt(password, p.cost, p.salt) - if err != nil { - return err - } - - otherP := &hashed{otherHash, p.salt, p.cost, p.major, p.minor} - if subtle.ConstantTimeCompare(p.Hash(), otherP.Hash()) == 1 { - return nil - } - - return ErrMismatchedHashAndPassword -} - -// Cost returns the hashing cost used to create the given hashed -// password. When, in the future, the hashing cost of a password system needs -// to be increased in order to adjust for greater computational power, this -// function allows one to establish which passwords need to be updated. -func Cost(hashedPassword []byte) (int, error) { - p, err := newFromHash(hashedPassword) - if err != nil { - return 0, err - } - return p.cost, nil -} - -func newFromPassword(password []byte, cost int) (*hashed, error) { - if cost < MinCost { - cost = DefaultCost - } - p := new(hashed) - p.major = majorVersion - p.minor = minorVersion - - err := checkCost(cost) - if err != nil { - return nil, err - } - p.cost = cost - - unencodedSalt := make([]byte, maxSaltSize) - _, err = io.ReadFull(rand.Reader, unencodedSalt) - if err != nil { - return nil, err - } - - p.salt = base64Encode(unencodedSalt) - hash, err := bcrypt(password, p.cost, p.salt) - if err != nil { - return nil, err - } - p.hash = hash - return p, err -} - -func newFromHash(hashedSecret []byte) (*hashed, error) { - if len(hashedSecret) < minHashSize { - return nil, ErrHashTooShort - } - p := new(hashed) - n, err := p.decodeVersion(hashedSecret) - if err != nil { - return nil, err - } - hashedSecret = hashedSecret[n:] - n, err = p.decodeCost(hashedSecret) - if err != nil { - return nil, err - } - hashedSecret = hashedSecret[n:] - - // The "+2" is here because we'll have to append at most 2 '=' to the salt - // when base64 decoding it in expensiveBlowfishSetup(). - p.salt = make([]byte, encodedSaltSize, encodedSaltSize+2) - copy(p.salt, hashedSecret[:encodedSaltSize]) - - hashedSecret = hashedSecret[encodedSaltSize:] - p.hash = make([]byte, len(hashedSecret)) - copy(p.hash, hashedSecret) - - return p, nil -} - -func bcrypt(password []byte, cost int, salt []byte) ([]byte, error) { - cipherData := make([]byte, len(magicCipherData)) - copy(cipherData, magicCipherData) - - c, err := expensiveBlowfishSetup(password, uint32(cost), salt) - if err != nil { - return nil, err - } - - for i := 0; i < 24; i += 8 { - for j := 0; j < 64; j++ { - c.Encrypt(cipherData[i:i+8], cipherData[i:i+8]) - } - } - - // Bug compatibility with C bcrypt implementations. We only encode 23 of - // the 24 bytes encrypted. - hsh := base64Encode(cipherData[:maxCryptedHashSize]) - return hsh, nil -} - -func expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cipher, error) { - csalt, err := base64Decode(salt) - if err != nil { - return nil, err - } - - // Bug compatibility with C bcrypt implementations. They use the trailing - // NULL in the key string during expansion. - // We copy the key to prevent changing the underlying array. - ckey := append(key[:len(key):len(key)], 0) - - c, err := blowfish.NewSaltedCipher(ckey, csalt) - if err != nil { - return nil, err - } - - var i, rounds uint64 - rounds = 1 << cost - for i = 0; i < rounds; i++ { - blowfish.ExpandKey(ckey, c) - blowfish.ExpandKey(csalt, c) - } - - return c, nil -} - -func (p *hashed) Hash() []byte { - arr := make([]byte, 60) - arr[0] = '$' - arr[1] = p.major - n := 2 - if p.minor != 0 { - arr[2] = p.minor - n = 3 - } - arr[n] = '$' - n++ - copy(arr[n:], []byte(fmt.Sprintf("%02d", p.cost))) - n += 2 - arr[n] = '$' - n++ - copy(arr[n:], p.salt) - n += encodedSaltSize - copy(arr[n:], p.hash) - n += encodedHashSize - return arr[:n] -} - -func (p *hashed) decodeVersion(sbytes []byte) (int, error) { - if sbytes[0] != '$' { - return -1, InvalidHashPrefixError(sbytes[0]) - } - if sbytes[1] > majorVersion { - return -1, HashVersionTooNewError(sbytes[1]) - } - p.major = sbytes[1] - n := 3 - if sbytes[2] != '$' { - p.minor = sbytes[2] - n++ - } - return n, nil -} - -// sbytes should begin where decodeVersion left off. -func (p *hashed) decodeCost(sbytes []byte) (int, error) { - cost, err := strconv.Atoi(string(sbytes[0:2])) - if err != nil { - return -1, err - } - err = checkCost(cost) - if err != nil { - return -1, err - } - p.cost = cost - return 3, nil -} - -func (p *hashed) String() string { - return fmt.Sprintf("&{hash: %#v, salt: %#v, cost: %d, major: %c, minor: %c}", string(p.hash), p.salt, p.cost, p.major, p.minor) -} - -func checkCost(cost int) error { - if cost < MinCost || cost > MaxCost { - return InvalidCostError(cost) - } - return nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/block.go b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/block.go deleted file mode 100644 index 9d80f195..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/block.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blowfish - -// getNextWord returns the next big-endian uint32 value from the byte slice -// at the given position in a circular manner, updating the position. -func getNextWord(b []byte, pos *int) uint32 { - var w uint32 - j := *pos - for i := 0; i < 4; i++ { - w = w<<8 | uint32(b[j]) - j++ - if j >= len(b) { - j = 0 - } - } - *pos = j - return w -} - -// ExpandKey performs a key expansion on the given *Cipher. Specifically, it -// performs the Blowfish algorithm's key schedule which sets up the *Cipher's -// pi and substitution tables for calls to Encrypt. This is used, primarily, -// by the bcrypt package to reuse the Blowfish key schedule during its -// set up. It's unlikely that you need to use this directly. -func ExpandKey(key []byte, c *Cipher) { - j := 0 - for i := 0; i < 18; i++ { - // Using inlined getNextWord for performance. - var d uint32 - for k := 0; k < 4; k++ { - d = d<<8 | uint32(key[j]) - j++ - if j >= len(key) { - j = 0 - } - } - c.p[i] ^= d - } - - var l, r uint32 - for i := 0; i < 18; i += 2 { - l, r = encryptBlock(l, r, c) - c.p[i], c.p[i+1] = l, r - } - - for i := 0; i < 256; i += 2 { - l, r = encryptBlock(l, r, c) - c.s0[i], c.s0[i+1] = l, r - } - for i := 0; i < 256; i += 2 { - l, r = encryptBlock(l, r, c) - c.s1[i], c.s1[i+1] = l, r - } - for i := 0; i < 256; i += 2 { - l, r = encryptBlock(l, r, c) - c.s2[i], c.s2[i+1] = l, r - } - for i := 0; i < 256; i += 2 { - l, r = encryptBlock(l, r, c) - c.s3[i], c.s3[i+1] = l, r - } -} - -// This is similar to ExpandKey, but folds the salt during the key -// schedule. While ExpandKey is essentially expandKeyWithSalt with an all-zero -// salt passed in, reusing ExpandKey turns out to be a place of inefficiency -// and specializing it here is useful. -func expandKeyWithSalt(key []byte, salt []byte, c *Cipher) { - j := 0 - for i := 0; i < 18; i++ { - c.p[i] ^= getNextWord(key, &j) - } - - j = 0 - var l, r uint32 - for i := 0; i < 18; i += 2 { - l ^= getNextWord(salt, &j) - r ^= getNextWord(salt, &j) - l, r = encryptBlock(l, r, c) - c.p[i], c.p[i+1] = l, r - } - - for i := 0; i < 256; i += 2 { - l ^= getNextWord(salt, &j) - r ^= getNextWord(salt, &j) - l, r = encryptBlock(l, r, c) - c.s0[i], c.s0[i+1] = l, r - } - - for i := 0; i < 256; i += 2 { - l ^= getNextWord(salt, &j) - r ^= getNextWord(salt, &j) - l, r = encryptBlock(l, r, c) - c.s1[i], c.s1[i+1] = l, r - } - - for i := 0; i < 256; i += 2 { - l ^= getNextWord(salt, &j) - r ^= getNextWord(salt, &j) - l, r = encryptBlock(l, r, c) - c.s2[i], c.s2[i+1] = l, r - } - - for i := 0; i < 256; i += 2 { - l ^= getNextWord(salt, &j) - r ^= getNextWord(salt, &j) - l, r = encryptBlock(l, r, c) - c.s3[i], c.s3[i+1] = l, r - } -} - -func encryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { - xl, xr := l, r - xl ^= c.p[0] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[1] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[2] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[3] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[4] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[5] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[6] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[7] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[8] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[9] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[10] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[11] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[12] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[13] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[14] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[15] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[16] - xr ^= c.p[17] - return xr, xl -} - -func decryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { - xl, xr := l, r - xl ^= c.p[17] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[16] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[15] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[14] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[13] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[12] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[11] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[10] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[9] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[8] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[7] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[6] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[5] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[4] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[3] - xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[2] - xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[1] - xr ^= c.p[0] - return xr, xl -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/cipher.go b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/cipher.go deleted file mode 100644 index 2641dadd..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/cipher.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package blowfish implements Bruce Schneier's Blowfish encryption algorithm. -package blowfish // import "golang.org/x/crypto/blowfish" - -// The code is a port of Bruce Schneier's C implementation. -// See https://www.schneier.com/blowfish.html. - -import "strconv" - -// The Blowfish block size in bytes. -const BlockSize = 8 - -// A Cipher is an instance of Blowfish encryption using a particular key. -type Cipher struct { - p [18]uint32 - s0, s1, s2, s3 [256]uint32 -} - -type KeySizeError int - -func (k KeySizeError) Error() string { - return "crypto/blowfish: invalid key size " + strconv.Itoa(int(k)) -} - -// NewCipher creates and returns a Cipher. -// The key argument should be the Blowfish key, from 1 to 56 bytes. -func NewCipher(key []byte) (*Cipher, error) { - var result Cipher - if k := len(key); k < 1 || k > 56 { - return nil, KeySizeError(k) - } - initCipher(&result) - ExpandKey(key, &result) - return &result, nil -} - -// NewSaltedCipher creates a returns a Cipher that folds a salt into its key -// schedule. For most purposes, NewCipher, instead of NewSaltedCipher, is -// sufficient and desirable. For bcrypt compatibility, the key can be over 56 -// bytes. -func NewSaltedCipher(key, salt []byte) (*Cipher, error) { - if len(salt) == 0 { - return NewCipher(key) - } - var result Cipher - if k := len(key); k < 1 { - return nil, KeySizeError(k) - } - initCipher(&result) - expandKeyWithSalt(key, salt, &result) - return &result, nil -} - -// BlockSize returns the Blowfish block size, 8 bytes. -// It is necessary to satisfy the Block interface in the -// package "crypto/cipher". -func (c *Cipher) BlockSize() int { return BlockSize } - -// Encrypt encrypts the 8-byte buffer src using the key k -// and stores the result in dst. -// Note that for amounts of data larger than a block, -// it is not safe to just call Encrypt on successive blocks; -// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go). -func (c *Cipher) Encrypt(dst, src []byte) { - l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) - r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) - l, r = encryptBlock(l, r, c) - dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) - dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) -} - -// Decrypt decrypts the 8-byte buffer src using the key k -// and stores the result in dst. -func (c *Cipher) Decrypt(dst, src []byte) { - l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) - r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) - l, r = decryptBlock(l, r, c) - dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) - dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) -} - -func initCipher(c *Cipher) { - copy(c.p[0:], p[0:]) - copy(c.s0[0:], s0[0:]) - copy(c.s1[0:], s1[0:]) - copy(c.s2[0:], s2[0:]) - copy(c.s3[0:], s3[0:]) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/const.go b/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/const.go deleted file mode 100644 index d0407759..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/crypto/blowfish/const.go +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// The startup permutation array and substitution boxes. -// They are the hexadecimal digits of PI; see: -// https://www.schneier.com/code/constants.txt. - -package blowfish - -var s0 = [256]uint32{ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, - 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, - 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, - 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, - 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, - 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, - 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, - 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, - 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, - 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, - 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, - 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, - 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, - 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, - 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, - 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, - 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, - 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, - 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, - 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, - 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, - 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, - 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, - 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, - 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, - 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, - 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, - 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, - 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, - 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, - 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, - 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, - 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, - 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, - 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, - 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, - 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, - 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, - 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, -} - -var s1 = [256]uint32{ - 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, - 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, - 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, - 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, - 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, - 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, - 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, - 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, - 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, - 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, - 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, - 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, - 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, - 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, - 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, - 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, - 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, - 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, - 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, - 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, - 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, - 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, - 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, - 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, - 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, - 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, - 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, - 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, - 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, - 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, - 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, - 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, - 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, - 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, - 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, - 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, - 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, - 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, - 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, -} - -var s2 = [256]uint32{ - 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, - 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, - 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, - 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, - 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, - 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, - 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, - 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, - 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, - 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, - 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, - 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, - 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, - 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, - 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, - 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, - 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, - 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, - 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, - 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, - 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, - 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, - 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, - 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, - 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, - 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, - 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, - 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, - 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, - 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, - 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, - 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, - 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, - 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, - 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, - 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, - 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, - 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, - 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, -} - -var s3 = [256]uint32{ - 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, - 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, - 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, - 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, - 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, - 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, - 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, - 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, - 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, - 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, - 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, - 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, - 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, - 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, - 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, - 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, - 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, - 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, - 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, - 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, - 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, - 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, - 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, - 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, - 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, - 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, - 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, - 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, - 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, - 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, - 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, - 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, - 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, - 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, - 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, - 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, - 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, - 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, -} - -var p = [18]uint32{ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, - 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, - 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b, -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/ber.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/ber.go deleted file mode 100644 index 25cc921b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/ber.go +++ /dev/null @@ -1,504 +0,0 @@ -package ber - -import ( - "bytes" - "errors" - "fmt" - "io" - "os" - "reflect" -) - -type Packet struct { - Identifier - Value interface{} - ByteValue []byte - Data *bytes.Buffer - Children []*Packet - Description string -} - -type Identifier struct { - ClassType Class - TagType Type - Tag Tag -} - -type Tag uint64 - -const ( - TagEOC Tag = 0x00 - TagBoolean Tag = 0x01 - TagInteger Tag = 0x02 - TagBitString Tag = 0x03 - TagOctetString Tag = 0x04 - TagNULL Tag = 0x05 - TagObjectIdentifier Tag = 0x06 - TagObjectDescriptor Tag = 0x07 - TagExternal Tag = 0x08 - TagRealFloat Tag = 0x09 - TagEnumerated Tag = 0x0a - TagEmbeddedPDV Tag = 0x0b - TagUTF8String Tag = 0x0c - TagRelativeOID Tag = 0x0d - TagSequence Tag = 0x10 - TagSet Tag = 0x11 - TagNumericString Tag = 0x12 - TagPrintableString Tag = 0x13 - TagT61String Tag = 0x14 - TagVideotexString Tag = 0x15 - TagIA5String Tag = 0x16 - TagUTCTime Tag = 0x17 - TagGeneralizedTime Tag = 0x18 - TagGraphicString Tag = 0x19 - TagVisibleString Tag = 0x1a - TagGeneralString Tag = 0x1b - TagUniversalString Tag = 0x1c - TagCharacterString Tag = 0x1d - TagBMPString Tag = 0x1e - TagBitmask Tag = 0x1f // xxx11111b - - // HighTag indicates the start of a high-tag byte sequence - HighTag Tag = 0x1f // xxx11111b - // HighTagContinueBitmask indicates the high-tag byte sequence should continue - HighTagContinueBitmask Tag = 0x80 // 10000000b - // HighTagValueBitmask obtains the tag value from a high-tag byte sequence byte - HighTagValueBitmask Tag = 0x7f // 01111111b -) - -const ( - // LengthLongFormBitmask is the mask to apply to the length byte to see if a long-form byte sequence is used - LengthLongFormBitmask = 0x80 - // LengthValueBitmask is the mask to apply to the length byte to get the number of bytes in the long-form byte sequence - LengthValueBitmask = 0x7f - - // LengthIndefinite is returned from readLength to indicate an indefinite length - LengthIndefinite = -1 -) - -var tagMap = map[Tag]string{ - TagEOC: "EOC (End-of-Content)", - TagBoolean: "Boolean", - TagInteger: "Integer", - TagBitString: "Bit String", - TagOctetString: "Octet String", - TagNULL: "NULL", - TagObjectIdentifier: "Object Identifier", - TagObjectDescriptor: "Object Descriptor", - TagExternal: "External", - TagRealFloat: "Real (float)", - TagEnumerated: "Enumerated", - TagEmbeddedPDV: "Embedded PDV", - TagUTF8String: "UTF8 String", - TagRelativeOID: "Relative-OID", - TagSequence: "Sequence and Sequence of", - TagSet: "Set and Set OF", - TagNumericString: "Numeric String", - TagPrintableString: "Printable String", - TagT61String: "T61 String", - TagVideotexString: "Videotex String", - TagIA5String: "IA5 String", - TagUTCTime: "UTC Time", - TagGeneralizedTime: "Generalized Time", - TagGraphicString: "Graphic String", - TagVisibleString: "Visible String", - TagGeneralString: "General String", - TagUniversalString: "Universal String", - TagCharacterString: "Character String", - TagBMPString: "BMP String", -} - -type Class uint8 - -const ( - ClassUniversal Class = 0 // 00xxxxxxb - ClassApplication Class = 64 // 01xxxxxxb - ClassContext Class = 128 // 10xxxxxxb - ClassPrivate Class = 192 // 11xxxxxxb - ClassBitmask Class = 192 // 11xxxxxxb -) - -var ClassMap = map[Class]string{ - ClassUniversal: "Universal", - ClassApplication: "Application", - ClassContext: "Context", - ClassPrivate: "Private", -} - -type Type uint8 - -const ( - TypePrimitive Type = 0 // xx0xxxxxb - TypeConstructed Type = 32 // xx1xxxxxb - TypeBitmask Type = 32 // xx1xxxxxb -) - -var TypeMap = map[Type]string{ - TypePrimitive: "Primitive", - TypeConstructed: "Constructed", -} - -var Debug bool = false - -func PrintBytes(out io.Writer, buf []byte, indent string) { - data_lines := make([]string, (len(buf)/30)+1) - num_lines := make([]string, (len(buf)/30)+1) - - for i, b := range buf { - data_lines[i/30] += fmt.Sprintf("%02x ", b) - num_lines[i/30] += fmt.Sprintf("%02d ", (i+1)%100) - } - - for i := 0; i < len(data_lines); i++ { - out.Write([]byte(indent + data_lines[i] + "\n")) - out.Write([]byte(indent + num_lines[i] + "\n\n")) - } -} - -func PrintPacket(p *Packet) { - printPacket(os.Stdout, p, 0, false) -} - -func printPacket(out io.Writer, p *Packet, indent int, printBytes bool) { - indent_str := "" - - for len(indent_str) != indent { - indent_str += " " - } - - class_str := ClassMap[p.ClassType] - - tagtype_str := TypeMap[p.TagType] - - tag_str := fmt.Sprintf("0x%02X", p.Tag) - - if p.ClassType == ClassUniversal { - tag_str = tagMap[p.Tag] - } - - value := fmt.Sprint(p.Value) - description := "" - - if p.Description != "" { - description = p.Description + ": " - } - - fmt.Fprintf(out, "%s%s(%s, %s, %s) Len=%d %q\n", indent_str, description, class_str, tagtype_str, tag_str, p.Data.Len(), value) - - if printBytes { - PrintBytes(out, p.Bytes(), indent_str) - } - - for _, child := range p.Children { - printPacket(out, child, indent+1, printBytes) - } -} - -// ReadPacket reads a single Packet from the reader -func ReadPacket(reader io.Reader) (*Packet, error) { - p, _, err := readPacket(reader) - if err != nil { - return nil, err - } - return p, nil -} - -func DecodeString(data []byte) string { - return string(data) -} - -func parseInt64(bytes []byte) (ret int64, err error) { - if len(bytes) > 8 { - // We'll overflow an int64 in this case. - err = fmt.Errorf("integer too large") - return - } - for bytesRead := 0; bytesRead < len(bytes); bytesRead++ { - ret <<= 8 - ret |= int64(bytes[bytesRead]) - } - - // Shift up and down in order to sign extend the result. - ret <<= 64 - uint8(len(bytes))*8 - ret >>= 64 - uint8(len(bytes))*8 - return -} - -func encodeInteger(i int64) []byte { - n := int64Length(i) - out := make([]byte, n) - - var j int - for ; n > 0; n-- { - out[j] = (byte(i >> uint((n-1)*8))) - j++ - } - - return out -} - -func int64Length(i int64) (numBytes int) { - numBytes = 1 - - for i > 127 { - numBytes++ - i >>= 8 - } - - for i < -128 { - numBytes++ - i >>= 8 - } - - return -} - -// DecodePacket decodes the given bytes into a single Packet -// If a decode error is encountered, nil is returned. -func DecodePacket(data []byte) *Packet { - p, _, _ := readPacket(bytes.NewBuffer(data)) - - return p -} - -// DecodePacketErr decodes the given bytes into a single Packet -// If a decode error is encountered, nil is returned -func DecodePacketErr(data []byte) (*Packet, error) { - p, _, err := readPacket(bytes.NewBuffer(data)) - if err != nil { - return nil, err - } - return p, nil -} - -// readPacket reads a single Packet from the reader, returning the number of bytes read -func readPacket(reader io.Reader) (*Packet, int, error) { - identifier, length, read, err := readHeader(reader) - if err != nil { - return nil, read, err - } - - p := &Packet{ - Identifier: identifier, - } - - p.Data = new(bytes.Buffer) - p.Children = make([]*Packet, 0, 2) - p.Value = nil - - if p.TagType == TypeConstructed { - // TODO: if universal, ensure tag type is allowed to be constructed - - // Track how much content we've read - contentRead := 0 - for { - if length != LengthIndefinite { - // End if we've read what we've been told to - if contentRead == length { - break - } - // Detect if a packet boundary didn't fall on the expected length - if contentRead > length { - return nil, read, fmt.Errorf("expected to read %d bytes, read %d", length, contentRead) - } - } - - // Read the next packet - child, r, err := readPacket(reader) - if err != nil { - return nil, read, err - } - contentRead += r - read += r - - // Test is this is the EOC marker for our packet - if isEOCPacket(child) { - if length == LengthIndefinite { - break - } - return nil, read, errors.New("eoc child not allowed with definite length") - } - - // Append and continue - p.AppendChild(child) - } - return p, read, nil - } - - if length == LengthIndefinite { - return nil, read, errors.New("indefinite length used with primitive type") - } - - // Read definite-length content - content := make([]byte, length, length) - if length > 0 { - _, err := io.ReadFull(reader, content) - if err != nil { - if err == io.EOF { - return nil, read, io.ErrUnexpectedEOF - } - return nil, read, err - } - read += length - } - - if p.ClassType == ClassUniversal { - p.Data.Write(content) - p.ByteValue = content - - switch p.Tag { - case TagEOC: - case TagBoolean: - val, _ := parseInt64(content) - - p.Value = val != 0 - case TagInteger: - p.Value, _ = parseInt64(content) - case TagBitString: - case TagOctetString: - // the actual string encoding is not known here - // (e.g. for LDAP content is already an UTF8-encoded - // string). Return the data without further processing - p.Value = DecodeString(content) - case TagNULL: - case TagObjectIdentifier: - case TagObjectDescriptor: - case TagExternal: - case TagRealFloat: - case TagEnumerated: - p.Value, _ = parseInt64(content) - case TagEmbeddedPDV: - case TagUTF8String: - p.Value = DecodeString(content) - case TagRelativeOID: - case TagSequence: - case TagSet: - case TagNumericString: - case TagPrintableString: - p.Value = DecodeString(content) - case TagT61String: - case TagVideotexString: - case TagIA5String: - case TagUTCTime: - case TagGeneralizedTime: - case TagGraphicString: - case TagVisibleString: - case TagGeneralString: - case TagUniversalString: - case TagCharacterString: - case TagBMPString: - } - } else { - p.Data.Write(content) - } - - return p, read, nil -} - -func (p *Packet) Bytes() []byte { - var out bytes.Buffer - - out.Write(encodeIdentifier(p.Identifier)) - out.Write(encodeLength(p.Data.Len())) - out.Write(p.Data.Bytes()) - - return out.Bytes() -} - -func (p *Packet) AppendChild(child *Packet) { - p.Data.Write(child.Bytes()) - p.Children = append(p.Children, child) -} - -func Encode(ClassType Class, TagType Type, Tag Tag, Value interface{}, Description string) *Packet { - p := new(Packet) - - p.ClassType = ClassType - p.TagType = TagType - p.Tag = Tag - p.Data = new(bytes.Buffer) - - p.Children = make([]*Packet, 0, 2) - - p.Value = Value - p.Description = Description - - if Value != nil { - v := reflect.ValueOf(Value) - - if ClassType == ClassUniversal { - switch Tag { - case TagOctetString: - sv, ok := v.Interface().(string) - - if ok { - p.Data.Write([]byte(sv)) - } - } - } - } - - return p -} - -func NewSequence(Description string) *Packet { - return Encode(ClassUniversal, TypeConstructed, TagSequence, nil, Description) -} - -func NewBoolean(ClassType Class, TagType Type, Tag Tag, Value bool, Description string) *Packet { - intValue := int64(0) - - if Value { - intValue = 1 - } - - p := Encode(ClassType, TagType, Tag, nil, Description) - - p.Value = Value - p.Data.Write(encodeInteger(intValue)) - - return p -} - -func NewInteger(ClassType Class, TagType Type, Tag Tag, Value interface{}, Description string) *Packet { - p := Encode(ClassType, TagType, Tag, nil, Description) - - p.Value = Value - switch v := Value.(type) { - case int: - p.Data.Write(encodeInteger(int64(v))) - case uint: - p.Data.Write(encodeInteger(int64(v))) - case int64: - p.Data.Write(encodeInteger(v)) - case uint64: - // TODO : check range or add encodeUInt... - p.Data.Write(encodeInteger(int64(v))) - case int32: - p.Data.Write(encodeInteger(int64(v))) - case uint32: - p.Data.Write(encodeInteger(int64(v))) - case int16: - p.Data.Write(encodeInteger(int64(v))) - case uint16: - p.Data.Write(encodeInteger(int64(v))) - case int8: - p.Data.Write(encodeInteger(int64(v))) - case uint8: - p.Data.Write(encodeInteger(int64(v))) - default: - // TODO : add support for big.Int ? - panic(fmt.Sprintf("Invalid type %T, expected {u|}int{64|32|16|8}", v)) - } - - return p -} - -func NewString(ClassType Class, TagType Type, Tag Tag, Value, Description string) *Packet { - p := Encode(ClassType, TagType, Tag, nil, Description) - - p.Value = Value - p.Data.Write([]byte(Value)) - - return p -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/content_int.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/content_int.go deleted file mode 100644 index 1858b74b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/content_int.go +++ /dev/null @@ -1,25 +0,0 @@ -package ber - -func encodeUnsignedInteger(i uint64) []byte { - n := uint64Length(i) - out := make([]byte, n) - - var j int - for ; n > 0; n-- { - out[j] = (byte(i >> uint((n-1)*8))) - j++ - } - - return out -} - -func uint64Length(i uint64) (numBytes int) { - numBytes = 1 - - for i > 255 { - numBytes++ - i >>= 8 - } - - return -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/header.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/header.go deleted file mode 100644 index 123744e9..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/header.go +++ /dev/null @@ -1,29 +0,0 @@ -package ber - -import ( - "errors" - "io" -) - -func readHeader(reader io.Reader) (identifier Identifier, length int, read int, err error) { - if i, c, err := readIdentifier(reader); err != nil { - return Identifier{}, 0, read, err - } else { - identifier = i - read += c - } - - if l, c, err := readLength(reader); err != nil { - return Identifier{}, 0, read, err - } else { - length = l - read += c - } - - // Validate length type with identifier (x.600, 8.1.3.2.a) - if length == LengthIndefinite && identifier.TagType == TypePrimitive { - return Identifier{}, 0, read, errors.New("indefinite length used with primitive type") - } - - return identifier, length, read, nil -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/identifier.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/identifier.go deleted file mode 100644 index f7672a84..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/identifier.go +++ /dev/null @@ -1,103 +0,0 @@ -package ber - -import ( - "errors" - "fmt" - "io" - "math" -) - -func readIdentifier(reader io.Reader) (Identifier, int, error) { - identifier := Identifier{} - read := 0 - - // identifier byte - b, err := readByte(reader) - if err != nil { - if Debug { - fmt.Printf("error reading identifier byte: %v\n", err) - } - return Identifier{}, read, err - } - read++ - - identifier.ClassType = Class(b) & ClassBitmask - identifier.TagType = Type(b) & TypeBitmask - - if tag := Tag(b) & TagBitmask; tag != HighTag { - // short-form tag - identifier.Tag = tag - return identifier, read, nil - } - - // high-tag-number tag - tagBytes := 0 - for { - b, err := readByte(reader) - if err != nil { - if Debug { - fmt.Printf("error reading high-tag-number tag byte %d: %v\n", tagBytes, err) - } - return Identifier{}, read, err - } - tagBytes++ - read++ - - // Lowest 7 bits get appended to the tag value (x.690, 8.1.2.4.2.b) - identifier.Tag <<= 7 - identifier.Tag |= Tag(b) & HighTagValueBitmask - - // First byte may not be all zeros (x.690, 8.1.2.4.2.c) - if tagBytes == 1 && identifier.Tag == 0 { - return Identifier{}, read, errors.New("invalid first high-tag-number tag byte") - } - // Overflow of int64 - // TODO: support big int tags? - if tagBytes > 9 { - return Identifier{}, read, errors.New("high-tag-number tag overflow") - } - - // Top bit of 0 means this is the last byte in the high-tag-number tag (x.690, 8.1.2.4.2.a) - if Tag(b)&HighTagContinueBitmask == 0 { - break - } - } - - return identifier, read, nil -} - -func encodeIdentifier(identifier Identifier) []byte { - b := []byte{0x0} - b[0] |= byte(identifier.ClassType) - b[0] |= byte(identifier.TagType) - - if identifier.Tag < HighTag { - // Short-form - b[0] |= byte(identifier.Tag) - } else { - // high-tag-number - b[0] |= byte(HighTag) - - tag := identifier.Tag - - highBit := uint(63) - for { - if tag&(1<= 0; i-- { - offset := uint(i) * 7 - mask := Tag(0x7f) << offset - tagByte := (tag & mask) >> offset - if i != 0 { - tagByte |= 0x80 - } - b = append(b, byte(tagByte)) - } - } - return b -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/length.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/length.go deleted file mode 100644 index 750e8f44..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/length.go +++ /dev/null @@ -1,81 +0,0 @@ -package ber - -import ( - "errors" - "fmt" - "io" -) - -func readLength(reader io.Reader) (length int, read int, err error) { - // length byte - b, err := readByte(reader) - if err != nil { - if Debug { - fmt.Printf("error reading length byte: %v\n", err) - } - return 0, 0, err - } - read++ - - switch { - case b == 0xFF: - // Invalid 0xFF (x.600, 8.1.3.5.c) - return 0, read, errors.New("invalid length byte 0xff") - - case b == LengthLongFormBitmask: - // Indefinite form, we have to decode packets until we encounter an EOC packet (x.600, 8.1.3.6) - length = LengthIndefinite - - case b&LengthLongFormBitmask == 0: - // Short definite form, extract the length from the bottom 7 bits (x.600, 8.1.3.4) - length = int(b) & LengthValueBitmask - - case b&LengthLongFormBitmask != 0: - // Long definite form, extract the number of length bytes to follow from the bottom 7 bits (x.600, 8.1.3.5.b) - lengthBytes := int(b) & LengthValueBitmask - // Protect against overflow - // TODO: support big int length? - if lengthBytes > 8 { - return 0, read, errors.New("long-form length overflow") - } - - // Accumulate into a 64-bit variable - var length64 int64 - for i := 0; i < lengthBytes; i++ { - b, err = readByte(reader) - if err != nil { - if Debug { - fmt.Printf("error reading long-form length byte %d: %v\n", i, err) - } - return 0, read, err - } - read++ - - // x.600, 8.1.3.5 - length64 <<= 8 - length64 |= int64(b) - } - - // Cast to a platform-specific integer - length = int(length64) - // Ensure we didn't overflow - if int64(length) != length64 { - return 0, read, errors.New("long-form length overflow") - } - - default: - return 0, read, errors.New("invalid length byte") - } - - return length, read, nil -} - -func encodeLength(length int) []byte { - length_bytes := encodeUnsignedInteger(uint64(length)) - if length > 127 || len(length_bytes) > 1 { - longFormBytes := []byte{(LengthLongFormBitmask | byte(len(length_bytes)))} - longFormBytes = append(longFormBytes, length_bytes...) - length_bytes = longFormBytes - } - return length_bytes -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/util.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/util.go deleted file mode 100644 index 3e56b66c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/asn1-ber.v1/util.go +++ /dev/null @@ -1,24 +0,0 @@ -package ber - -import "io" - -func readByte(reader io.Reader) (byte, error) { - bytes := make([]byte, 1, 1) - _, err := io.ReadFull(reader, bytes) - if err != nil { - if err == io.EOF { - return 0, io.ErrUnexpectedEOF - } - return 0, err - } - return bytes[0], nil -} - -func isEOCPacket(p *Packet) bool { - return p != nil && - p.Tag == TagEOC && - p.ClassType == ClassUniversal && - p.TagType == TypePrimitive && - len(p.ByteValue) == 0 && - len(p.Children) == 0 -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/LICENSE.txt b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/apic.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/apic.go deleted file mode 100644 index 95ec014e..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/apic.go +++ /dev/null @@ -1,742 +0,0 @@ -package yaml - -import ( - "io" - "os" -) - -func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) { - //fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) - - // Check if we can move the queue at the beginning of the buffer. - if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { - if parser.tokens_head != len(parser.tokens) { - copy(parser.tokens, parser.tokens[parser.tokens_head:]) - } - parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head] - parser.tokens_head = 0 - } - parser.tokens = append(parser.tokens, *token) - if pos < 0 { - return - } - copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:]) - parser.tokens[parser.tokens_head+pos] = *token -} - -// Create a new parser object. -func yaml_parser_initialize(parser *yaml_parser_t) bool { - *parser = yaml_parser_t{ - raw_buffer: make([]byte, 0, input_raw_buffer_size), - buffer: make([]byte, 0, input_buffer_size), - } - return true -} - -// Destroy a parser object. -func yaml_parser_delete(parser *yaml_parser_t) { - *parser = yaml_parser_t{} -} - -// String read handler. -func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { - if parser.input_pos == len(parser.input) { - return 0, io.EOF - } - n = copy(buffer, parser.input[parser.input_pos:]) - parser.input_pos += n - return n, nil -} - -// File read handler. -func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { - return parser.input_file.Read(buffer) -} - -// Set a string input. -func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) { - if parser.read_handler != nil { - panic("must set the input source only once") - } - parser.read_handler = yaml_string_read_handler - parser.input = input - parser.input_pos = 0 -} - -// Set a file input. -func yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) { - if parser.read_handler != nil { - panic("must set the input source only once") - } - parser.read_handler = yaml_file_read_handler - parser.input_file = file -} - -// Set the source encoding. -func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) { - if parser.encoding != yaml_ANY_ENCODING { - panic("must set the encoding only once") - } - parser.encoding = encoding -} - -// Create a new emitter object. -func yaml_emitter_initialize(emitter *yaml_emitter_t) bool { - *emitter = yaml_emitter_t{ - buffer: make([]byte, output_buffer_size), - raw_buffer: make([]byte, 0, output_raw_buffer_size), - states: make([]yaml_emitter_state_t, 0, initial_stack_size), - events: make([]yaml_event_t, 0, initial_queue_size), - } - return true -} - -// Destroy an emitter object. -func yaml_emitter_delete(emitter *yaml_emitter_t) { - *emitter = yaml_emitter_t{} -} - -// String write handler. -func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - *emitter.output_buffer = append(*emitter.output_buffer, buffer...) - return nil -} - -// File write handler. -func yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - _, err := emitter.output_file.Write(buffer) - return err -} - -// Set a string output. -func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) { - if emitter.write_handler != nil { - panic("must set the output target only once") - } - emitter.write_handler = yaml_string_write_handler - emitter.output_buffer = output_buffer -} - -// Set a file output. -func yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) { - if emitter.write_handler != nil { - panic("must set the output target only once") - } - emitter.write_handler = yaml_file_write_handler - emitter.output_file = file -} - -// Set the output encoding. -func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) { - if emitter.encoding != yaml_ANY_ENCODING { - panic("must set the output encoding only once") - } - emitter.encoding = encoding -} - -// Set the canonical output style. -func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) { - emitter.canonical = canonical -} - -//// Set the indentation increment. -func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) { - if indent < 2 || indent > 9 { - indent = 2 - } - emitter.best_indent = indent -} - -// Set the preferred line width. -func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) { - if width < 0 { - width = -1 - } - emitter.best_width = width -} - -// Set if unescaped non-ASCII characters are allowed. -func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) { - emitter.unicode = unicode -} - -// Set the preferred line break character. -func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) { - emitter.line_break = line_break -} - -///* -// * Destroy a token object. -// */ -// -//YAML_DECLARE(void) -//yaml_token_delete(yaml_token_t *token) -//{ -// assert(token); // Non-NULL token object expected. -// -// switch (token.type) -// { -// case YAML_TAG_DIRECTIVE_TOKEN: -// yaml_free(token.data.tag_directive.handle); -// yaml_free(token.data.tag_directive.prefix); -// break; -// -// case YAML_ALIAS_TOKEN: -// yaml_free(token.data.alias.value); -// break; -// -// case YAML_ANCHOR_TOKEN: -// yaml_free(token.data.anchor.value); -// break; -// -// case YAML_TAG_TOKEN: -// yaml_free(token.data.tag.handle); -// yaml_free(token.data.tag.suffix); -// break; -// -// case YAML_SCALAR_TOKEN: -// yaml_free(token.data.scalar.value); -// break; -// -// default: -// break; -// } -// -// memset(token, 0, sizeof(yaml_token_t)); -//} -// -///* -// * Check if a string is a valid UTF-8 sequence. -// * -// * Check 'reader.c' for more details on UTF-8 encoding. -// */ -// -//static int -//yaml_check_utf8(yaml_char_t *start, size_t length) -//{ -// yaml_char_t *end = start+length; -// yaml_char_t *pointer = start; -// -// while (pointer < end) { -// unsigned char octet; -// unsigned int width; -// unsigned int value; -// size_t k; -// -// octet = pointer[0]; -// width = (octet & 0x80) == 0x00 ? 1 : -// (octet & 0xE0) == 0xC0 ? 2 : -// (octet & 0xF0) == 0xE0 ? 3 : -// (octet & 0xF8) == 0xF0 ? 4 : 0; -// value = (octet & 0x80) == 0x00 ? octet & 0x7F : -// (octet & 0xE0) == 0xC0 ? octet & 0x1F : -// (octet & 0xF0) == 0xE0 ? octet & 0x0F : -// (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0; -// if (!width) return 0; -// if (pointer+width > end) return 0; -// for (k = 1; k < width; k ++) { -// octet = pointer[k]; -// if ((octet & 0xC0) != 0x80) return 0; -// value = (value << 6) + (octet & 0x3F); -// } -// if (!((width == 1) || -// (width == 2 && value >= 0x80) || -// (width == 3 && value >= 0x800) || -// (width == 4 && value >= 0x10000))) return 0; -// -// pointer += width; -// } -// -// return 1; -//} -// - -// Create STREAM-START. -func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool { - *event = yaml_event_t{ - typ: yaml_STREAM_START_EVENT, - encoding: encoding, - } - return true -} - -// Create STREAM-END. -func yaml_stream_end_event_initialize(event *yaml_event_t) bool { - *event = yaml_event_t{ - typ: yaml_STREAM_END_EVENT, - } - return true -} - -// Create DOCUMENT-START. -func yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t, - tag_directives []yaml_tag_directive_t, implicit bool) bool { - *event = yaml_event_t{ - typ: yaml_DOCUMENT_START_EVENT, - version_directive: version_directive, - tag_directives: tag_directives, - implicit: implicit, - } - return true -} - -// Create DOCUMENT-END. -func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool { - *event = yaml_event_t{ - typ: yaml_DOCUMENT_END_EVENT, - implicit: implicit, - } - return true -} - -///* -// * Create ALIAS. -// */ -// -//YAML_DECLARE(int) -//yaml_alias_event_initialize(event *yaml_event_t, anchor *yaml_char_t) -//{ -// mark yaml_mark_t = { 0, 0, 0 } -// anchor_copy *yaml_char_t = NULL -// -// assert(event) // Non-NULL event object is expected. -// assert(anchor) // Non-NULL anchor is expected. -// -// if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0 -// -// anchor_copy = yaml_strdup(anchor) -// if (!anchor_copy) -// return 0 -// -// ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark) -// -// return 1 -//} - -// Create SCALAR. -func yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool { - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - anchor: anchor, - tag: tag, - value: value, - implicit: plain_implicit, - quoted_implicit: quoted_implicit, - style: yaml_style_t(style), - } - return true -} - -// Create SEQUENCE-START. -func yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool { - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(style), - } - return true -} - -// Create SEQUENCE-END. -func yaml_sequence_end_event_initialize(event *yaml_event_t) bool { - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - } - return true -} - -// Create MAPPING-START. -func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool { - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(style), - } - return true -} - -// Create MAPPING-END. -func yaml_mapping_end_event_initialize(event *yaml_event_t) bool { - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - } - return true -} - -// Destroy an event object. -func yaml_event_delete(event *yaml_event_t) { - *event = yaml_event_t{} -} - -///* -// * Create a document object. -// */ -// -//YAML_DECLARE(int) -//yaml_document_initialize(document *yaml_document_t, -// version_directive *yaml_version_directive_t, -// tag_directives_start *yaml_tag_directive_t, -// tag_directives_end *yaml_tag_directive_t, -// start_implicit int, end_implicit int) -//{ -// struct { -// error yaml_error_type_t -// } context -// struct { -// start *yaml_node_t -// end *yaml_node_t -// top *yaml_node_t -// } nodes = { NULL, NULL, NULL } -// version_directive_copy *yaml_version_directive_t = NULL -// struct { -// start *yaml_tag_directive_t -// end *yaml_tag_directive_t -// top *yaml_tag_directive_t -// } tag_directives_copy = { NULL, NULL, NULL } -// value yaml_tag_directive_t = { NULL, NULL } -// mark yaml_mark_t = { 0, 0, 0 } -// -// assert(document) // Non-NULL document object is expected. -// assert((tag_directives_start && tag_directives_end) || -// (tag_directives_start == tag_directives_end)) -// // Valid tag directives are expected. -// -// if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error -// -// if (version_directive) { -// version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t)) -// if (!version_directive_copy) goto error -// version_directive_copy.major = version_directive.major -// version_directive_copy.minor = version_directive.minor -// } -// -// if (tag_directives_start != tag_directives_end) { -// tag_directive *yaml_tag_directive_t -// if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE)) -// goto error -// for (tag_directive = tag_directives_start -// tag_directive != tag_directives_end; tag_directive ++) { -// assert(tag_directive.handle) -// assert(tag_directive.prefix) -// if (!yaml_check_utf8(tag_directive.handle, -// strlen((char *)tag_directive.handle))) -// goto error -// if (!yaml_check_utf8(tag_directive.prefix, -// strlen((char *)tag_directive.prefix))) -// goto error -// value.handle = yaml_strdup(tag_directive.handle) -// value.prefix = yaml_strdup(tag_directive.prefix) -// if (!value.handle || !value.prefix) goto error -// if (!PUSH(&context, tag_directives_copy, value)) -// goto error -// value.handle = NULL -// value.prefix = NULL -// } -// } -// -// DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy, -// tag_directives_copy.start, tag_directives_copy.top, -// start_implicit, end_implicit, mark, mark) -// -// return 1 -// -//error: -// STACK_DEL(&context, nodes) -// yaml_free(version_directive_copy) -// while (!STACK_EMPTY(&context, tag_directives_copy)) { -// value yaml_tag_directive_t = POP(&context, tag_directives_copy) -// yaml_free(value.handle) -// yaml_free(value.prefix) -// } -// STACK_DEL(&context, tag_directives_copy) -// yaml_free(value.handle) -// yaml_free(value.prefix) -// -// return 0 -//} -// -///* -// * Destroy a document object. -// */ -// -//YAML_DECLARE(void) -//yaml_document_delete(document *yaml_document_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// tag_directive *yaml_tag_directive_t -// -// context.error = YAML_NO_ERROR // Eliminate a compliler warning. -// -// assert(document) // Non-NULL document object is expected. -// -// while (!STACK_EMPTY(&context, document.nodes)) { -// node yaml_node_t = POP(&context, document.nodes) -// yaml_free(node.tag) -// switch (node.type) { -// case YAML_SCALAR_NODE: -// yaml_free(node.data.scalar.value) -// break -// case YAML_SEQUENCE_NODE: -// STACK_DEL(&context, node.data.sequence.items) -// break -// case YAML_MAPPING_NODE: -// STACK_DEL(&context, node.data.mapping.pairs) -// break -// default: -// assert(0) // Should not happen. -// } -// } -// STACK_DEL(&context, document.nodes) -// -// yaml_free(document.version_directive) -// for (tag_directive = document.tag_directives.start -// tag_directive != document.tag_directives.end -// tag_directive++) { -// yaml_free(tag_directive.handle) -// yaml_free(tag_directive.prefix) -// } -// yaml_free(document.tag_directives.start) -// -// memset(document, 0, sizeof(yaml_document_t)) -//} -// -///** -// * Get a document node. -// */ -// -//YAML_DECLARE(yaml_node_t *) -//yaml_document_get_node(document *yaml_document_t, index int) -//{ -// assert(document) // Non-NULL document object is expected. -// -// if (index > 0 && document.nodes.start + index <= document.nodes.top) { -// return document.nodes.start + index - 1 -// } -// return NULL -//} -// -///** -// * Get the root object. -// */ -// -//YAML_DECLARE(yaml_node_t *) -//yaml_document_get_root_node(document *yaml_document_t) -//{ -// assert(document) // Non-NULL document object is expected. -// -// if (document.nodes.top != document.nodes.start) { -// return document.nodes.start -// } -// return NULL -//} -// -///* -// * Add a scalar node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_scalar(document *yaml_document_t, -// tag *yaml_char_t, value *yaml_char_t, length int, -// style yaml_scalar_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// value_copy *yaml_char_t = NULL -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// assert(value) // Non-NULL value is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (length < 0) { -// length = strlen((char *)value) -// } -// -// if (!yaml_check_utf8(value, length)) goto error -// value_copy = yaml_malloc(length+1) -// if (!value_copy) goto error -// memcpy(value_copy, value, length) -// value_copy[length] = '\0' -// -// SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// yaml_free(tag_copy) -// yaml_free(value_copy) -// -// return 0 -//} -// -///* -// * Add a sequence node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_sequence(document *yaml_document_t, -// tag *yaml_char_t, style yaml_sequence_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// struct { -// start *yaml_node_item_t -// end *yaml_node_item_t -// top *yaml_node_item_t -// } items = { NULL, NULL, NULL } -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error -// -// SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end, -// style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// STACK_DEL(&context, items) -// yaml_free(tag_copy) -// -// return 0 -//} -// -///* -// * Add a mapping node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_mapping(document *yaml_document_t, -// tag *yaml_char_t, style yaml_mapping_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// struct { -// start *yaml_node_pair_t -// end *yaml_node_pair_t -// top *yaml_node_pair_t -// } pairs = { NULL, NULL, NULL } -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error -// -// MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end, -// style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// STACK_DEL(&context, pairs) -// yaml_free(tag_copy) -// -// return 0 -//} -// -///* -// * Append an item to a sequence node. -// */ -// -//YAML_DECLARE(int) -//yaml_document_append_sequence_item(document *yaml_document_t, -// sequence int, item int) -//{ -// struct { -// error yaml_error_type_t -// } context -// -// assert(document) // Non-NULL document is required. -// assert(sequence > 0 -// && document.nodes.start + sequence <= document.nodes.top) -// // Valid sequence id is required. -// assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE) -// // A sequence node is required. -// assert(item > 0 && document.nodes.start + item <= document.nodes.top) -// // Valid item id is required. -// -// if (!PUSH(&context, -// document.nodes.start[sequence-1].data.sequence.items, item)) -// return 0 -// -// return 1 -//} -// -///* -// * Append a pair of a key and a value to a mapping node. -// */ -// -//YAML_DECLARE(int) -//yaml_document_append_mapping_pair(document *yaml_document_t, -// mapping int, key int, value int) -//{ -// struct { -// error yaml_error_type_t -// } context -// -// pair yaml_node_pair_t -// -// assert(document) // Non-NULL document is required. -// assert(mapping > 0 -// && document.nodes.start + mapping <= document.nodes.top) -// // Valid mapping id is required. -// assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE) -// // A mapping node is required. -// assert(key > 0 && document.nodes.start + key <= document.nodes.top) -// // Valid key id is required. -// assert(value > 0 && document.nodes.start + value <= document.nodes.top) -// // Valid value id is required. -// -// pair.key = key -// pair.value = value -// -// if (!PUSH(&context, -// document.nodes.start[mapping-1].data.mapping.pairs, pair)) -// return 0 -// -// return 1 -//} -// -// diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/decode.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/decode.go deleted file mode 100644 index e85eb2e3..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/decode.go +++ /dev/null @@ -1,685 +0,0 @@ -package yaml - -import ( - "encoding" - "encoding/base64" - "fmt" - "math" - "reflect" - "strconv" - "time" -) - -const ( - documentNode = 1 << iota - mappingNode - sequenceNode - scalarNode - aliasNode -) - -type node struct { - kind int - line, column int - tag string - value string - implicit bool - children []*node - anchors map[string]*node -} - -// ---------------------------------------------------------------------------- -// Parser, produces a node tree out of a libyaml event stream. - -type parser struct { - parser yaml_parser_t - event yaml_event_t - doc *node -} - -func newParser(b []byte) *parser { - p := parser{} - if !yaml_parser_initialize(&p.parser) { - panic("failed to initialize YAML emitter") - } - - if len(b) == 0 { - b = []byte{'\n'} - } - - yaml_parser_set_input_string(&p.parser, b) - - p.skip() - if p.event.typ != yaml_STREAM_START_EVENT { - panic("expected stream start event, got " + strconv.Itoa(int(p.event.typ))) - } - p.skip() - return &p -} - -func (p *parser) destroy() { - if p.event.typ != yaml_NO_EVENT { - yaml_event_delete(&p.event) - } - yaml_parser_delete(&p.parser) -} - -func (p *parser) skip() { - if p.event.typ != yaml_NO_EVENT { - if p.event.typ == yaml_STREAM_END_EVENT { - failf("attempted to go past the end of stream; corrupted value?") - } - yaml_event_delete(&p.event) - } - if !yaml_parser_parse(&p.parser, &p.event) { - p.fail() - } -} - -func (p *parser) fail() { - var where string - var line int - if p.parser.problem_mark.line != 0 { - line = p.parser.problem_mark.line - } else if p.parser.context_mark.line != 0 { - line = p.parser.context_mark.line - } - if line != 0 { - where = "line " + strconv.Itoa(line) + ": " - } - var msg string - if len(p.parser.problem) > 0 { - msg = p.parser.problem - } else { - msg = "unknown problem parsing YAML content" - } - failf("%s%s", where, msg) -} - -func (p *parser) anchor(n *node, anchor []byte) { - if anchor != nil { - p.doc.anchors[string(anchor)] = n - } -} - -func (p *parser) parse() *node { - switch p.event.typ { - case yaml_SCALAR_EVENT: - return p.scalar() - case yaml_ALIAS_EVENT: - return p.alias() - case yaml_MAPPING_START_EVENT: - return p.mapping() - case yaml_SEQUENCE_START_EVENT: - return p.sequence() - case yaml_DOCUMENT_START_EVENT: - return p.document() - case yaml_STREAM_END_EVENT: - // Happens when attempting to decode an empty buffer. - return nil - default: - panic("attempted to parse unknown event: " + strconv.Itoa(int(p.event.typ))) - } -} - -func (p *parser) node(kind int) *node { - return &node{ - kind: kind, - line: p.event.start_mark.line, - column: p.event.start_mark.column, - } -} - -func (p *parser) document() *node { - n := p.node(documentNode) - n.anchors = make(map[string]*node) - p.doc = n - p.skip() - n.children = append(n.children, p.parse()) - if p.event.typ != yaml_DOCUMENT_END_EVENT { - panic("expected end of document event but got " + strconv.Itoa(int(p.event.typ))) - } - p.skip() - return n -} - -func (p *parser) alias() *node { - n := p.node(aliasNode) - n.value = string(p.event.anchor) - p.skip() - return n -} - -func (p *parser) scalar() *node { - n := p.node(scalarNode) - n.value = string(p.event.value) - n.tag = string(p.event.tag) - n.implicit = p.event.implicit - p.anchor(n, p.event.anchor) - p.skip() - return n -} - -func (p *parser) sequence() *node { - n := p.node(sequenceNode) - p.anchor(n, p.event.anchor) - p.skip() - for p.event.typ != yaml_SEQUENCE_END_EVENT { - n.children = append(n.children, p.parse()) - } - p.skip() - return n -} - -func (p *parser) mapping() *node { - n := p.node(mappingNode) - p.anchor(n, p.event.anchor) - p.skip() - for p.event.typ != yaml_MAPPING_END_EVENT { - n.children = append(n.children, p.parse(), p.parse()) - } - p.skip() - return n -} - -// ---------------------------------------------------------------------------- -// Decoder, unmarshals a node into a provided value. - -type decoder struct { - doc *node - aliases map[string]bool - mapType reflect.Type - terrors []string - strict bool -} - -var ( - mapItemType = reflect.TypeOf(MapItem{}) - durationType = reflect.TypeOf(time.Duration(0)) - defaultMapType = reflect.TypeOf(map[interface{}]interface{}{}) - ifaceType = defaultMapType.Elem() -) - -func newDecoder(strict bool) *decoder { - d := &decoder{mapType: defaultMapType, strict: strict} - d.aliases = make(map[string]bool) - return d -} - -func (d *decoder) terror(n *node, tag string, out reflect.Value) { - if n.tag != "" { - tag = n.tag - } - value := n.value - if tag != yaml_SEQ_TAG && tag != yaml_MAP_TAG { - if len(value) > 10 { - value = " `" + value[:7] + "...`" - } else { - value = " `" + value + "`" - } - } - d.terrors = append(d.terrors, fmt.Sprintf("line %d: cannot unmarshal %s%s into %s", n.line+1, shortTag(tag), value, out.Type())) -} - -func (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) { - terrlen := len(d.terrors) - err := u.UnmarshalYAML(func(v interface{}) (err error) { - defer handleErr(&err) - d.unmarshal(n, reflect.ValueOf(v)) - if len(d.terrors) > terrlen { - issues := d.terrors[terrlen:] - d.terrors = d.terrors[:terrlen] - return &TypeError{issues} - } - return nil - }) - if e, ok := err.(*TypeError); ok { - d.terrors = append(d.terrors, e.Errors...) - return false - } - if err != nil { - fail(err) - } - return true -} - -// d.prepare initializes and dereferences pointers and calls UnmarshalYAML -// if a value is found to implement it. -// It returns the initialized and dereferenced out value, whether -// unmarshalling was already done by UnmarshalYAML, and if so whether -// its types unmarshalled appropriately. -// -// If n holds a null value, prepare returns before doing anything. -func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) { - if n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == "" && (n.value == "null" || n.value == "~" || n.value == "" && n.implicit) { - return out, false, false - } - again := true - for again { - again = false - if out.Kind() == reflect.Ptr { - if out.IsNil() { - out.Set(reflect.New(out.Type().Elem())) - } - out = out.Elem() - again = true - } - if out.CanAddr() { - if u, ok := out.Addr().Interface().(Unmarshaler); ok { - good = d.callUnmarshaler(n, u) - return out, true, good - } - } - } - return out, false, false -} - -func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) { - switch n.kind { - case documentNode: - return d.document(n, out) - case aliasNode: - return d.alias(n, out) - } - out, unmarshaled, good := d.prepare(n, out) - if unmarshaled { - return good - } - switch n.kind { - case scalarNode: - good = d.scalar(n, out) - case mappingNode: - good = d.mapping(n, out) - case sequenceNode: - good = d.sequence(n, out) - default: - panic("internal error: unknown node kind: " + strconv.Itoa(n.kind)) - } - return good -} - -func (d *decoder) document(n *node, out reflect.Value) (good bool) { - if len(n.children) == 1 { - d.doc = n - d.unmarshal(n.children[0], out) - return true - } - return false -} - -func (d *decoder) alias(n *node, out reflect.Value) (good bool) { - an, ok := d.doc.anchors[n.value] - if !ok { - failf("unknown anchor '%s' referenced", n.value) - } - if d.aliases[n.value] { - failf("anchor '%s' value contains itself", n.value) - } - d.aliases[n.value] = true - good = d.unmarshal(an, out) - delete(d.aliases, n.value) - return good -} - -var zeroValue reflect.Value - -func resetMap(out reflect.Value) { - for _, k := range out.MapKeys() { - out.SetMapIndex(k, zeroValue) - } -} - -func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { - var tag string - var resolved interface{} - if n.tag == "" && !n.implicit { - tag = yaml_STR_TAG - resolved = n.value - } else { - tag, resolved = resolve(n.tag, n.value) - if tag == yaml_BINARY_TAG { - data, err := base64.StdEncoding.DecodeString(resolved.(string)) - if err != nil { - failf("!!binary value contains invalid base64 data") - } - resolved = string(data) - } - } - if resolved == nil { - if out.Kind() == reflect.Map && !out.CanAddr() { - resetMap(out) - } else { - out.Set(reflect.Zero(out.Type())) - } - return true - } - if s, ok := resolved.(string); ok && out.CanAddr() { - if u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok { - err := u.UnmarshalText([]byte(s)) - if err != nil { - fail(err) - } - return true - } - } - switch out.Kind() { - case reflect.String: - if tag == yaml_BINARY_TAG { - out.SetString(resolved.(string)) - good = true - } else if resolved != nil { - out.SetString(n.value) - good = true - } - case reflect.Interface: - if resolved == nil { - out.Set(reflect.Zero(out.Type())) - } else { - out.Set(reflect.ValueOf(resolved)) - } - good = true - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - switch resolved := resolved.(type) { - case int: - if !out.OverflowInt(int64(resolved)) { - out.SetInt(int64(resolved)) - good = true - } - case int64: - if !out.OverflowInt(resolved) { - out.SetInt(resolved) - good = true - } - case uint64: - if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { - out.SetInt(int64(resolved)) - good = true - } - case float64: - if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { - out.SetInt(int64(resolved)) - good = true - } - case string: - if out.Type() == durationType { - d, err := time.ParseDuration(resolved) - if err == nil { - out.SetInt(int64(d)) - good = true - } - } - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - switch resolved := resolved.(type) { - case int: - if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - case int64: - if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - case uint64: - if !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - case float64: - if resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - } - case reflect.Bool: - switch resolved := resolved.(type) { - case bool: - out.SetBool(resolved) - good = true - } - case reflect.Float32, reflect.Float64: - switch resolved := resolved.(type) { - case int: - out.SetFloat(float64(resolved)) - good = true - case int64: - out.SetFloat(float64(resolved)) - good = true - case uint64: - out.SetFloat(float64(resolved)) - good = true - case float64: - out.SetFloat(resolved) - good = true - } - case reflect.Ptr: - if out.Type().Elem() == reflect.TypeOf(resolved) { - // TODO DOes this make sense? When is out a Ptr except when decoding a nil value? - elem := reflect.New(out.Type().Elem()) - elem.Elem().Set(reflect.ValueOf(resolved)) - out.Set(elem) - good = true - } - } - if !good { - d.terror(n, tag, out) - } - return good -} - -func settableValueOf(i interface{}) reflect.Value { - v := reflect.ValueOf(i) - sv := reflect.New(v.Type()).Elem() - sv.Set(v) - return sv -} - -func (d *decoder) sequence(n *node, out reflect.Value) (good bool) { - l := len(n.children) - - var iface reflect.Value - switch out.Kind() { - case reflect.Slice: - out.Set(reflect.MakeSlice(out.Type(), l, l)) - case reflect.Interface: - // No type hints. Will have to use a generic sequence. - iface = out - out = settableValueOf(make([]interface{}, l)) - default: - d.terror(n, yaml_SEQ_TAG, out) - return false - } - et := out.Type().Elem() - - j := 0 - for i := 0; i < l; i++ { - e := reflect.New(et).Elem() - if ok := d.unmarshal(n.children[i], e); ok { - out.Index(j).Set(e) - j++ - } - } - out.Set(out.Slice(0, j)) - if iface.IsValid() { - iface.Set(out) - } - return true -} - -func (d *decoder) mapping(n *node, out reflect.Value) (good bool) { - switch out.Kind() { - case reflect.Struct: - return d.mappingStruct(n, out) - case reflect.Slice: - return d.mappingSlice(n, out) - case reflect.Map: - // okay - case reflect.Interface: - if d.mapType.Kind() == reflect.Map { - iface := out - out = reflect.MakeMap(d.mapType) - iface.Set(out) - } else { - slicev := reflect.New(d.mapType).Elem() - if !d.mappingSlice(n, slicev) { - return false - } - out.Set(slicev) - return true - } - default: - d.terror(n, yaml_MAP_TAG, out) - return false - } - outt := out.Type() - kt := outt.Key() - et := outt.Elem() - - mapType := d.mapType - if outt.Key() == ifaceType && outt.Elem() == ifaceType { - d.mapType = outt - } - - if out.IsNil() { - out.Set(reflect.MakeMap(outt)) - } - l := len(n.children) - for i := 0; i < l; i += 2 { - if isMerge(n.children[i]) { - d.merge(n.children[i+1], out) - continue - } - k := reflect.New(kt).Elem() - if d.unmarshal(n.children[i], k) { - kkind := k.Kind() - if kkind == reflect.Interface { - kkind = k.Elem().Kind() - } - if kkind == reflect.Map || kkind == reflect.Slice { - failf("invalid map key: %#v", k.Interface()) - } - e := reflect.New(et).Elem() - if d.unmarshal(n.children[i+1], e) { - out.SetMapIndex(k, e) - } - } - } - d.mapType = mapType - return true -} - -func (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) { - outt := out.Type() - if outt.Elem() != mapItemType { - d.terror(n, yaml_MAP_TAG, out) - return false - } - - mapType := d.mapType - d.mapType = outt - - var slice []MapItem - var l = len(n.children) - for i := 0; i < l; i += 2 { - if isMerge(n.children[i]) { - d.merge(n.children[i+1], out) - continue - } - item := MapItem{} - k := reflect.ValueOf(&item.Key).Elem() - if d.unmarshal(n.children[i], k) { - v := reflect.ValueOf(&item.Value).Elem() - if d.unmarshal(n.children[i+1], v) { - slice = append(slice, item) - } - } - } - out.Set(reflect.ValueOf(slice)) - d.mapType = mapType - return true -} - -func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) { - sinfo, err := getStructInfo(out.Type()) - if err != nil { - panic(err) - } - name := settableValueOf("") - l := len(n.children) - - var inlineMap reflect.Value - var elemType reflect.Type - if sinfo.InlineMap != -1 { - inlineMap = out.Field(sinfo.InlineMap) - inlineMap.Set(reflect.New(inlineMap.Type()).Elem()) - elemType = inlineMap.Type().Elem() - } - - for i := 0; i < l; i += 2 { - ni := n.children[i] - if isMerge(ni) { - d.merge(n.children[i+1], out) - continue - } - if !d.unmarshal(ni, name) { - continue - } - if info, ok := sinfo.FieldsMap[name.String()]; ok { - var field reflect.Value - if info.Inline == nil { - field = out.Field(info.Num) - } else { - field = out.FieldByIndex(info.Inline) - } - d.unmarshal(n.children[i+1], field) - } else if sinfo.InlineMap != -1 { - if inlineMap.IsNil() { - inlineMap.Set(reflect.MakeMap(inlineMap.Type())) - } - value := reflect.New(elemType).Elem() - d.unmarshal(n.children[i+1], value) - inlineMap.SetMapIndex(name, value) - } else if d.strict { - d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in struct %s", ni.line+1, name.String(), out.Type())) - } - } - return true -} - -func failWantMap() { - failf("map merge requires map or sequence of maps as the value") -} - -func (d *decoder) merge(n *node, out reflect.Value) { - switch n.kind { - case mappingNode: - d.unmarshal(n, out) - case aliasNode: - an, ok := d.doc.anchors[n.value] - if ok && an.kind != mappingNode { - failWantMap() - } - d.unmarshal(n, out) - case sequenceNode: - // Step backwards as earlier nodes take precedence. - for i := len(n.children) - 1; i >= 0; i-- { - ni := n.children[i] - if ni.kind == aliasNode { - an, ok := d.doc.anchors[ni.value] - if ok && an.kind != mappingNode { - failWantMap() - } - } else if ni.kind != mappingNode { - failWantMap() - } - d.unmarshal(ni, out) - } - default: - failWantMap() - } -} - -func isMerge(n *node) bool { - return n.kind == scalarNode && n.value == "<<" && (n.implicit == true || n.tag == yaml_MERGE_TAG) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/emitterc.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/emitterc.go deleted file mode 100644 index dcaf502f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/emitterc.go +++ /dev/null @@ -1,1684 +0,0 @@ -package yaml - -import ( - "bytes" -) - -// Flush the buffer if needed. -func flush(emitter *yaml_emitter_t) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - return yaml_emitter_flush(emitter) - } - return true -} - -// Put a character to the output buffer. -func put(emitter *yaml_emitter_t, value byte) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { - return false - } - emitter.buffer[emitter.buffer_pos] = value - emitter.buffer_pos++ - emitter.column++ - return true -} - -// Put a line break to the output buffer. -func put_break(emitter *yaml_emitter_t) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { - return false - } - switch emitter.line_break { - case yaml_CR_BREAK: - emitter.buffer[emitter.buffer_pos] = '\r' - emitter.buffer_pos += 1 - case yaml_LN_BREAK: - emitter.buffer[emitter.buffer_pos] = '\n' - emitter.buffer_pos += 1 - case yaml_CRLN_BREAK: - emitter.buffer[emitter.buffer_pos+0] = '\r' - emitter.buffer[emitter.buffer_pos+1] = '\n' - emitter.buffer_pos += 2 - default: - panic("unknown line break setting") - } - emitter.column = 0 - emitter.line++ - return true -} - -// Copy a character from a string into buffer. -func write(emitter *yaml_emitter_t, s []byte, i *int) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { - return false - } - p := emitter.buffer_pos - w := width(s[*i]) - switch w { - case 4: - emitter.buffer[p+3] = s[*i+3] - fallthrough - case 3: - emitter.buffer[p+2] = s[*i+2] - fallthrough - case 2: - emitter.buffer[p+1] = s[*i+1] - fallthrough - case 1: - emitter.buffer[p+0] = s[*i+0] - default: - panic("unknown character width") - } - emitter.column++ - emitter.buffer_pos += w - *i += w - return true -} - -// Write a whole string into buffer. -func write_all(emitter *yaml_emitter_t, s []byte) bool { - for i := 0; i < len(s); { - if !write(emitter, s, &i) { - return false - } - } - return true -} - -// Copy a line break character from a string into buffer. -func write_break(emitter *yaml_emitter_t, s []byte, i *int) bool { - if s[*i] == '\n' { - if !put_break(emitter) { - return false - } - *i++ - } else { - if !write(emitter, s, i) { - return false - } - emitter.column = 0 - emitter.line++ - } - return true -} - -// Set an emitter error and return false. -func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool { - emitter.error = yaml_EMITTER_ERROR - emitter.problem = problem - return false -} - -// Emit an event. -func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.events = append(emitter.events, *event) - for !yaml_emitter_need_more_events(emitter) { - event := &emitter.events[emitter.events_head] - if !yaml_emitter_analyze_event(emitter, event) { - return false - } - if !yaml_emitter_state_machine(emitter, event) { - return false - } - yaml_event_delete(event) - emitter.events_head++ - } - return true -} - -// Check if we need to accumulate more events before emitting. -// -// We accumulate extra -// - 1 event for DOCUMENT-START -// - 2 events for SEQUENCE-START -// - 3 events for MAPPING-START -// -func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool { - if emitter.events_head == len(emitter.events) { - return true - } - var accumulate int - switch emitter.events[emitter.events_head].typ { - case yaml_DOCUMENT_START_EVENT: - accumulate = 1 - break - case yaml_SEQUENCE_START_EVENT: - accumulate = 2 - break - case yaml_MAPPING_START_EVENT: - accumulate = 3 - break - default: - return false - } - if len(emitter.events)-emitter.events_head > accumulate { - return false - } - var level int - for i := emitter.events_head; i < len(emitter.events); i++ { - switch emitter.events[i].typ { - case yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT: - level++ - case yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT: - level-- - } - if level == 0 { - return false - } - } - return true -} - -// Append a directive to the directives stack. -func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool { - for i := 0; i < len(emitter.tag_directives); i++ { - if bytes.Equal(value.handle, emitter.tag_directives[i].handle) { - if allow_duplicates { - return true - } - return yaml_emitter_set_emitter_error(emitter, "duplicate %TAG directive") - } - } - - // [Go] Do we actually need to copy this given garbage collection - // and the lack of deallocating destructors? - tag_copy := yaml_tag_directive_t{ - handle: make([]byte, len(value.handle)), - prefix: make([]byte, len(value.prefix)), - } - copy(tag_copy.handle, value.handle) - copy(tag_copy.prefix, value.prefix) - emitter.tag_directives = append(emitter.tag_directives, tag_copy) - return true -} - -// Increase the indentation level. -func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool { - emitter.indents = append(emitter.indents, emitter.indent) - if emitter.indent < 0 { - if flow { - emitter.indent = emitter.best_indent - } else { - emitter.indent = 0 - } - } else if !indentless { - emitter.indent += emitter.best_indent - } - return true -} - -// State dispatcher. -func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool { - switch emitter.state { - default: - case yaml_EMIT_STREAM_START_STATE: - return yaml_emitter_emit_stream_start(emitter, event) - - case yaml_EMIT_FIRST_DOCUMENT_START_STATE: - return yaml_emitter_emit_document_start(emitter, event, true) - - case yaml_EMIT_DOCUMENT_START_STATE: - return yaml_emitter_emit_document_start(emitter, event, false) - - case yaml_EMIT_DOCUMENT_CONTENT_STATE: - return yaml_emitter_emit_document_content(emitter, event) - - case yaml_EMIT_DOCUMENT_END_STATE: - return yaml_emitter_emit_document_end(emitter, event) - - case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE: - return yaml_emitter_emit_flow_sequence_item(emitter, event, true) - - case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE: - return yaml_emitter_emit_flow_sequence_item(emitter, event, false) - - case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE: - return yaml_emitter_emit_flow_mapping_key(emitter, event, true) - - case yaml_EMIT_FLOW_MAPPING_KEY_STATE: - return yaml_emitter_emit_flow_mapping_key(emitter, event, false) - - case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE: - return yaml_emitter_emit_flow_mapping_value(emitter, event, true) - - case yaml_EMIT_FLOW_MAPPING_VALUE_STATE: - return yaml_emitter_emit_flow_mapping_value(emitter, event, false) - - case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE: - return yaml_emitter_emit_block_sequence_item(emitter, event, true) - - case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE: - return yaml_emitter_emit_block_sequence_item(emitter, event, false) - - case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE: - return yaml_emitter_emit_block_mapping_key(emitter, event, true) - - case yaml_EMIT_BLOCK_MAPPING_KEY_STATE: - return yaml_emitter_emit_block_mapping_key(emitter, event, false) - - case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE: - return yaml_emitter_emit_block_mapping_value(emitter, event, true) - - case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE: - return yaml_emitter_emit_block_mapping_value(emitter, event, false) - - case yaml_EMIT_END_STATE: - return yaml_emitter_set_emitter_error(emitter, "expected nothing after STREAM-END") - } - panic("invalid emitter state") -} - -// Expect STREAM-START. -func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if event.typ != yaml_STREAM_START_EVENT { - return yaml_emitter_set_emitter_error(emitter, "expected STREAM-START") - } - if emitter.encoding == yaml_ANY_ENCODING { - emitter.encoding = event.encoding - if emitter.encoding == yaml_ANY_ENCODING { - emitter.encoding = yaml_UTF8_ENCODING - } - } - if emitter.best_indent < 2 || emitter.best_indent > 9 { - emitter.best_indent = 2 - } - if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 { - emitter.best_width = 80 - } - if emitter.best_width < 0 { - emitter.best_width = 1<<31 - 1 - } - if emitter.line_break == yaml_ANY_BREAK { - emitter.line_break = yaml_LN_BREAK - } - - emitter.indent = -1 - emitter.line = 0 - emitter.column = 0 - emitter.whitespace = true - emitter.indention = true - - if emitter.encoding != yaml_UTF8_ENCODING { - if !yaml_emitter_write_bom(emitter) { - return false - } - } - emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE - return true -} - -// Expect DOCUMENT-START or STREAM-END. -func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - - if event.typ == yaml_DOCUMENT_START_EVENT { - - if event.version_directive != nil { - if !yaml_emitter_analyze_version_directive(emitter, event.version_directive) { - return false - } - } - - for i := 0; i < len(event.tag_directives); i++ { - tag_directive := &event.tag_directives[i] - if !yaml_emitter_analyze_tag_directive(emitter, tag_directive) { - return false - } - if !yaml_emitter_append_tag_directive(emitter, tag_directive, false) { - return false - } - } - - for i := 0; i < len(default_tag_directives); i++ { - tag_directive := &default_tag_directives[i] - if !yaml_emitter_append_tag_directive(emitter, tag_directive, true) { - return false - } - } - - implicit := event.implicit - if !first || emitter.canonical { - implicit = false - } - - if emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if event.version_directive != nil { - implicit = false - if !yaml_emitter_write_indicator(emitter, []byte("%YAML"), true, false, false) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte("1.1"), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if len(event.tag_directives) > 0 { - implicit = false - for i := 0; i < len(event.tag_directives); i++ { - tag_directive := &event.tag_directives[i] - if !yaml_emitter_write_indicator(emitter, []byte("%TAG"), true, false, false) { - return false - } - if !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) { - return false - } - if !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - } - - if yaml_emitter_check_empty_document(emitter) { - implicit = false - } - if !implicit { - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte("---"), true, false, false) { - return false - } - if emitter.canonical { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - } - - emitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE - return true - } - - if event.typ == yaml_STREAM_END_EVENT { - if emitter.open_ended { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_flush(emitter) { - return false - } - emitter.state = yaml_EMIT_END_STATE - return true - } - - return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-START or STREAM-END") -} - -// Expect the root node. -func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE) - return yaml_emitter_emit_node(emitter, event, true, false, false, false) -} - -// Expect DOCUMENT-END. -func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if event.typ != yaml_DOCUMENT_END_EVENT { - return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-END") - } - if !yaml_emitter_write_indent(emitter) { - return false - } - if !event.implicit { - // [Go] Allocate the slice elsewhere. - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_flush(emitter) { - return false - } - emitter.state = yaml_EMIT_DOCUMENT_START_STATE - emitter.tag_directives = emitter.tag_directives[:0] - return true -} - -// Expect a flow item node. -func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - emitter.flow_level++ - } - - if event.typ == yaml_SEQUENCE_END_EVENT { - emitter.flow_level-- - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - if emitter.canonical && !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true - } - - if !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - } - - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE) - return yaml_emitter_emit_node(emitter, event, false, true, false, false) -} - -// Expect a flow key node. -func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - emitter.flow_level++ - } - - if event.typ == yaml_MAPPING_END_EVENT { - emitter.flow_level-- - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - if emitter.canonical && !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true - } - - if !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - } - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if !emitter.canonical && yaml_emitter_check_simple_key(emitter) { - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, true) - } - if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a flow value node. -func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool { - if simple { - if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) { - return false - } - } else { - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a block item node. -func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_increase_indent(emitter, false, emitter.mapping_context && !emitter.indention) { - return false - } - } - if event.typ == yaml_SEQUENCE_END_EVENT { - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true - } - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE) - return yaml_emitter_emit_node(emitter, event, false, true, false, false) -} - -// Expect a block key node. -func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_increase_indent(emitter, false, false) { - return false - } - } - if event.typ == yaml_MAPPING_END_EVENT { - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true - } - if !yaml_emitter_write_indent(emitter) { - return false - } - if yaml_emitter_check_simple_key(emitter) { - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, true) - } - if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a block value node. -func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool { - if simple { - if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) { - return false - } - } else { - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a node. -func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, - root bool, sequence bool, mapping bool, simple_key bool) bool { - - emitter.root_context = root - emitter.sequence_context = sequence - emitter.mapping_context = mapping - emitter.simple_key_context = simple_key - - switch event.typ { - case yaml_ALIAS_EVENT: - return yaml_emitter_emit_alias(emitter, event) - case yaml_SCALAR_EVENT: - return yaml_emitter_emit_scalar(emitter, event) - case yaml_SEQUENCE_START_EVENT: - return yaml_emitter_emit_sequence_start(emitter, event) - case yaml_MAPPING_START_EVENT: - return yaml_emitter_emit_mapping_start(emitter, event) - default: - return yaml_emitter_set_emitter_error(emitter, - "expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS") - } -} - -// Expect ALIAS. -func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true -} - -// Expect SCALAR. -func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_select_scalar_style(emitter, event) { - return false - } - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - if !yaml_emitter_process_scalar(emitter) { - return false - } - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true -} - -// Expect SEQUENCE-START. -func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE || - yaml_emitter_check_empty_sequence(emitter) { - emitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE - } else { - emitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE - } - return true -} - -// Expect MAPPING-START. -func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE || - yaml_emitter_check_empty_mapping(emitter) { - emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE - } else { - emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE - } - return true -} - -// Check if the document content is an empty scalar. -func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool { - return false // [Go] Huh? -} - -// Check if the next events represent an empty sequence. -func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool { - if len(emitter.events)-emitter.events_head < 2 { - return false - } - return emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT && - emitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT -} - -// Check if the next events represent an empty mapping. -func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool { - if len(emitter.events)-emitter.events_head < 2 { - return false - } - return emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT && - emitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT -} - -// Check if the next node can be expressed as a simple key. -func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool { - length := 0 - switch emitter.events[emitter.events_head].typ { - case yaml_ALIAS_EVENT: - length += len(emitter.anchor_data.anchor) - case yaml_SCALAR_EVENT: - if emitter.scalar_data.multiline { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) + - len(emitter.scalar_data.value) - case yaml_SEQUENCE_START_EVENT: - if !yaml_emitter_check_empty_sequence(emitter) { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - case yaml_MAPPING_START_EVENT: - if !yaml_emitter_check_empty_mapping(emitter) { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - default: - return false - } - return length <= 128 -} - -// Determine an acceptable scalar style. -func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool { - - no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 - if no_tag && !event.implicit && !event.quoted_implicit { - return yaml_emitter_set_emitter_error(emitter, "neither tag nor implicit flags are specified") - } - - style := event.scalar_style() - if style == yaml_ANY_SCALAR_STYLE { - style = yaml_PLAIN_SCALAR_STYLE - } - if emitter.canonical { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - if emitter.simple_key_context && emitter.scalar_data.multiline { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - - if style == yaml_PLAIN_SCALAR_STYLE { - if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed || - emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - if len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - if no_tag && !event.implicit { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - } - if style == yaml_SINGLE_QUOTED_SCALAR_STYLE { - if !emitter.scalar_data.single_quoted_allowed { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - } - if style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE { - if !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - } - - if no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE { - emitter.tag_data.handle = []byte{'!'} - } - emitter.scalar_data.style = style - return true -} - -// Write an achor. -func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool { - if emitter.anchor_data.anchor == nil { - return true - } - c := []byte{'&'} - if emitter.anchor_data.alias { - c[0] = '*' - } - if !yaml_emitter_write_indicator(emitter, c, true, false, false) { - return false - } - return yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor) -} - -// Write a tag. -func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool { - if len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 { - return true - } - if len(emitter.tag_data.handle) > 0 { - if !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) { - return false - } - if len(emitter.tag_data.suffix) > 0 { - if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { - return false - } - } - } else { - // [Go] Allocate these slices elsewhere. - if !yaml_emitter_write_indicator(emitter, []byte("!<"), true, false, false) { - return false - } - if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) { - return false - } - } - return true -} - -// Write a scalar. -func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool { - switch emitter.scalar_data.style { - case yaml_PLAIN_SCALAR_STYLE: - return yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) - - case yaml_SINGLE_QUOTED_SCALAR_STYLE: - return yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) - - case yaml_DOUBLE_QUOTED_SCALAR_STYLE: - return yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) - - case yaml_LITERAL_SCALAR_STYLE: - return yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value) - - case yaml_FOLDED_SCALAR_STYLE: - return yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value) - } - panic("unknown scalar style") -} - -// Check if a %YAML directive is valid. -func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool { - if version_directive.major != 1 || version_directive.minor != 1 { - return yaml_emitter_set_emitter_error(emitter, "incompatible %YAML directive") - } - return true -} - -// Check if a %TAG directive is valid. -func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool { - handle := tag_directive.handle - prefix := tag_directive.prefix - if len(handle) == 0 { - return yaml_emitter_set_emitter_error(emitter, "tag handle must not be empty") - } - if handle[0] != '!' { - return yaml_emitter_set_emitter_error(emitter, "tag handle must start with '!'") - } - if handle[len(handle)-1] != '!' { - return yaml_emitter_set_emitter_error(emitter, "tag handle must end with '!'") - } - for i := 1; i < len(handle)-1; i += width(handle[i]) { - if !is_alpha(handle, i) { - return yaml_emitter_set_emitter_error(emitter, "tag handle must contain alphanumerical characters only") - } - } - if len(prefix) == 0 { - return yaml_emitter_set_emitter_error(emitter, "tag prefix must not be empty") - } - return true -} - -// Check if an anchor is valid. -func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool { - if len(anchor) == 0 { - problem := "anchor value must not be empty" - if alias { - problem = "alias value must not be empty" - } - return yaml_emitter_set_emitter_error(emitter, problem) - } - for i := 0; i < len(anchor); i += width(anchor[i]) { - if !is_alpha(anchor, i) { - problem := "anchor value must contain alphanumerical characters only" - if alias { - problem = "alias value must contain alphanumerical characters only" - } - return yaml_emitter_set_emitter_error(emitter, problem) - } - } - emitter.anchor_data.anchor = anchor - emitter.anchor_data.alias = alias - return true -} - -// Check if a tag is valid. -func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool { - if len(tag) == 0 { - return yaml_emitter_set_emitter_error(emitter, "tag value must not be empty") - } - for i := 0; i < len(emitter.tag_directives); i++ { - tag_directive := &emitter.tag_directives[i] - if bytes.HasPrefix(tag, tag_directive.prefix) { - emitter.tag_data.handle = tag_directive.handle - emitter.tag_data.suffix = tag[len(tag_directive.prefix):] - return true - } - } - emitter.tag_data.suffix = tag - return true -} - -// Check if a scalar is valid. -func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { - var ( - block_indicators = false - flow_indicators = false - line_breaks = false - special_characters = false - - leading_space = false - leading_break = false - trailing_space = false - trailing_break = false - break_space = false - space_break = false - - preceded_by_whitespace = false - followed_by_whitespace = false - previous_space = false - previous_break = false - ) - - emitter.scalar_data.value = value - - if len(value) == 0 { - emitter.scalar_data.multiline = false - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = true - emitter.scalar_data.single_quoted_allowed = true - emitter.scalar_data.block_allowed = false - return true - } - - if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) { - block_indicators = true - flow_indicators = true - } - - preceded_by_whitespace = true - for i, w := 0, 0; i < len(value); i += w { - w = width(value[i]) - followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w) - - if i == 0 { - switch value[i] { - case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': - flow_indicators = true - block_indicators = true - case '?', ':': - flow_indicators = true - if followed_by_whitespace { - block_indicators = true - } - case '-': - if followed_by_whitespace { - flow_indicators = true - block_indicators = true - } - } - } else { - switch value[i] { - case ',', '?', '[', ']', '{', '}': - flow_indicators = true - case ':': - flow_indicators = true - if followed_by_whitespace { - block_indicators = true - } - case '#': - if preceded_by_whitespace { - flow_indicators = true - block_indicators = true - } - } - } - - if !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode { - special_characters = true - } - if is_space(value, i) { - if i == 0 { - leading_space = true - } - if i+width(value[i]) == len(value) { - trailing_space = true - } - if previous_break { - break_space = true - } - previous_space = true - previous_break = false - } else if is_break(value, i) { - line_breaks = true - if i == 0 { - leading_break = true - } - if i+width(value[i]) == len(value) { - trailing_break = true - } - if previous_space { - space_break = true - } - previous_space = false - previous_break = true - } else { - previous_space = false - previous_break = false - } - - // [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition. - preceded_by_whitespace = is_blankz(value, i) - } - - emitter.scalar_data.multiline = line_breaks - emitter.scalar_data.flow_plain_allowed = true - emitter.scalar_data.block_plain_allowed = true - emitter.scalar_data.single_quoted_allowed = true - emitter.scalar_data.block_allowed = true - - if leading_space || leading_break || trailing_space || trailing_break { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - } - if trailing_space { - emitter.scalar_data.block_allowed = false - } - if break_space { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - emitter.scalar_data.single_quoted_allowed = false - } - if space_break || special_characters { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - emitter.scalar_data.single_quoted_allowed = false - emitter.scalar_data.block_allowed = false - } - if line_breaks { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - } - if flow_indicators { - emitter.scalar_data.flow_plain_allowed = false - } - if block_indicators { - emitter.scalar_data.block_plain_allowed = false - } - return true -} - -// Check if the event data is valid. -func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { - - emitter.anchor_data.anchor = nil - emitter.tag_data.handle = nil - emitter.tag_data.suffix = nil - emitter.scalar_data.value = nil - - switch event.typ { - case yaml_ALIAS_EVENT: - if !yaml_emitter_analyze_anchor(emitter, event.anchor, true) { - return false - } - - case yaml_SCALAR_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - if !yaml_emitter_analyze_scalar(emitter, event.value) { - return false - } - - case yaml_SEQUENCE_START_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || !event.implicit) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - - case yaml_MAPPING_START_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || !event.implicit) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - } - return true -} - -// Write the BOM character. -func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool { - if !flush(emitter) { - return false - } - pos := emitter.buffer_pos - emitter.buffer[pos+0] = '\xEF' - emitter.buffer[pos+1] = '\xBB' - emitter.buffer[pos+2] = '\xBF' - emitter.buffer_pos += 3 - return true -} - -func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool { - indent := emitter.indent - if indent < 0 { - indent = 0 - } - if !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) { - if !put_break(emitter) { - return false - } - } - for emitter.column < indent { - if !put(emitter, ' ') { - return false - } - } - emitter.whitespace = true - emitter.indention = true - return true -} - -func yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool { - if need_whitespace && !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - if !write_all(emitter, indicator) { - return false - } - emitter.whitespace = is_whitespace - emitter.indention = (emitter.indention && is_indention) - emitter.open_ended = false - return true -} - -func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool { - if !write_all(emitter, value) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool { - if !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - if !write_all(emitter, value) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool { - if need_whitespace && !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - for i := 0; i < len(value); { - var must_write bool - switch value[i] { - case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\'', '(', ')', '[', ']': - must_write = true - default: - must_write = is_alpha(value, i) - } - if must_write { - if !write(emitter, value, &i) { - return false - } - } else { - w := width(value[i]) - for k := 0; k < w; k++ { - octet := value[i] - i++ - if !put(emitter, '%') { - return false - } - - c := octet >> 4 - if c < 10 { - c += '0' - } else { - c += 'A' - 10 - } - if !put(emitter, c) { - return false - } - - c = octet & 0x0f - if c < 10 { - c += '0' - } else { - c += 'A' - 10 - } - if !put(emitter, c) { - return false - } - } - } - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { - if !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - - spaces := false - breaks := false - for i := 0; i < len(value); { - if is_space(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else if is_break(value, i) { - if !breaks && value[i] == '\n' { - if !put_break(emitter) { - return false - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - spaces = false - breaks = false - } - } - - emitter.whitespace = false - emitter.indention = false - if emitter.root_context { - emitter.open_ended = true - } - - return true -} - -func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { - - if !yaml_emitter_write_indicator(emitter, []byte{'\''}, true, false, false) { - return false - } - - spaces := false - breaks := false - for i := 0; i < len(value); { - if is_space(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else if is_break(value, i) { - if !breaks && value[i] == '\n' { - if !put_break(emitter) { - return false - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if value[i] == '\'' { - if !put(emitter, '\'') { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - spaces = false - breaks = false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{'\''}, false, false, false) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { - spaces := false - if !yaml_emitter_write_indicator(emitter, []byte{'"'}, true, false, false) { - return false - } - - for i := 0; i < len(value); { - if !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) || - is_bom(value, i) || is_break(value, i) || - value[i] == '"' || value[i] == '\\' { - - octet := value[i] - - var w int - var v rune - switch { - case octet&0x80 == 0x00: - w, v = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, v = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, v = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, v = 4, rune(octet&0x07) - } - for k := 1; k < w; k++ { - octet = value[i+k] - v = (v << 6) + (rune(octet) & 0x3F) - } - i += w - - if !put(emitter, '\\') { - return false - } - - var ok bool - switch v { - case 0x00: - ok = put(emitter, '0') - case 0x07: - ok = put(emitter, 'a') - case 0x08: - ok = put(emitter, 'b') - case 0x09: - ok = put(emitter, 't') - case 0x0A: - ok = put(emitter, 'n') - case 0x0b: - ok = put(emitter, 'v') - case 0x0c: - ok = put(emitter, 'f') - case 0x0d: - ok = put(emitter, 'r') - case 0x1b: - ok = put(emitter, 'e') - case 0x22: - ok = put(emitter, '"') - case 0x5c: - ok = put(emitter, '\\') - case 0x85: - ok = put(emitter, 'N') - case 0xA0: - ok = put(emitter, '_') - case 0x2028: - ok = put(emitter, 'L') - case 0x2029: - ok = put(emitter, 'P') - default: - if v <= 0xFF { - ok = put(emitter, 'x') - w = 2 - } else if v <= 0xFFFF { - ok = put(emitter, 'u') - w = 4 - } else { - ok = put(emitter, 'U') - w = 8 - } - for k := (w - 1) * 4; ok && k >= 0; k -= 4 { - digit := byte((v >> uint(k)) & 0x0F) - if digit < 10 { - ok = put(emitter, digit+'0') - } else { - ok = put(emitter, digit+'A'-10) - } - } - } - if !ok { - return false - } - spaces = false - } else if is_space(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 { - if !yaml_emitter_write_indent(emitter) { - return false - } - if is_space(value, i+1) { - if !put(emitter, '\\') { - return false - } - } - i += width(value[i]) - } else if !write(emitter, value, &i) { - return false - } - spaces = true - } else { - if !write(emitter, value, &i) { - return false - } - spaces = false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{'"'}, false, false, false) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool { - if is_space(value, 0) || is_break(value, 0) { - indent_hint := []byte{'0' + byte(emitter.best_indent)} - if !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) { - return false - } - } - - emitter.open_ended = false - - var chomp_hint [1]byte - if len(value) == 0 { - chomp_hint[0] = '-' - } else { - i := len(value) - 1 - for value[i]&0xC0 == 0x80 { - i-- - } - if !is_break(value, i) { - chomp_hint[0] = '-' - } else if i == 0 { - chomp_hint[0] = '+' - emitter.open_ended = true - } else { - i-- - for value[i]&0xC0 == 0x80 { - i-- - } - if is_break(value, i) { - chomp_hint[0] = '+' - emitter.open_ended = true - } - } - } - if chomp_hint[0] != 0 { - if !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) { - return false - } - } - return true -} - -func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool { - if !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) { - return false - } - if !yaml_emitter_write_block_scalar_hints(emitter, value) { - return false - } - if !put_break(emitter) { - return false - } - emitter.indention = true - emitter.whitespace = true - breaks := true - for i := 0; i < len(value); { - if is_break(value, i) { - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - breaks = false - } - } - - return true -} - -func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool { - if !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) { - return false - } - if !yaml_emitter_write_block_scalar_hints(emitter, value) { - return false - } - - if !put_break(emitter) { - return false - } - emitter.indention = true - emitter.whitespace = true - - breaks := true - leading_spaces := true - for i := 0; i < len(value); { - if is_break(value, i) { - if !breaks && !leading_spaces && value[i] == '\n' { - k := 0 - for is_break(value, k) { - k += width(value[k]) - } - if !is_blankz(value, k) { - if !put_break(emitter) { - return false - } - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - leading_spaces = is_blank(value, i) - } - if !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - emitter.indention = false - breaks = false - } - } - return true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/encode.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/encode.go deleted file mode 100644 index 84f84995..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/encode.go +++ /dev/null @@ -1,306 +0,0 @@ -package yaml - -import ( - "encoding" - "fmt" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" -) - -type encoder struct { - emitter yaml_emitter_t - event yaml_event_t - out []byte - flow bool -} - -func newEncoder() (e *encoder) { - e = &encoder{} - e.must(yaml_emitter_initialize(&e.emitter)) - yaml_emitter_set_output_string(&e.emitter, &e.out) - yaml_emitter_set_unicode(&e.emitter, true) - e.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING)) - e.emit() - e.must(yaml_document_start_event_initialize(&e.event, nil, nil, true)) - e.emit() - return e -} - -func (e *encoder) finish() { - e.must(yaml_document_end_event_initialize(&e.event, true)) - e.emit() - e.emitter.open_ended = false - e.must(yaml_stream_end_event_initialize(&e.event)) - e.emit() -} - -func (e *encoder) destroy() { - yaml_emitter_delete(&e.emitter) -} - -func (e *encoder) emit() { - // This will internally delete the e.event value. - if !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT { - e.must(false) - } -} - -func (e *encoder) must(ok bool) { - if !ok { - msg := e.emitter.problem - if msg == "" { - msg = "unknown problem generating YAML content" - } - failf("%s", msg) - } -} - -func (e *encoder) marshal(tag string, in reflect.Value) { - if !in.IsValid() { - e.nilv() - return - } - iface := in.Interface() - if m, ok := iface.(Marshaler); ok { - v, err := m.MarshalYAML() - if err != nil { - fail(err) - } - if v == nil { - e.nilv() - return - } - in = reflect.ValueOf(v) - } else if m, ok := iface.(encoding.TextMarshaler); ok { - text, err := m.MarshalText() - if err != nil { - fail(err) - } - in = reflect.ValueOf(string(text)) - } - switch in.Kind() { - case reflect.Interface: - if in.IsNil() { - e.nilv() - } else { - e.marshal(tag, in.Elem()) - } - case reflect.Map: - e.mapv(tag, in) - case reflect.Ptr: - if in.IsNil() { - e.nilv() - } else { - e.marshal(tag, in.Elem()) - } - case reflect.Struct: - e.structv(tag, in) - case reflect.Slice: - if in.Type().Elem() == mapItemType { - e.itemsv(tag, in) - } else { - e.slicev(tag, in) - } - case reflect.String: - e.stringv(tag, in) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if in.Type() == durationType { - e.stringv(tag, reflect.ValueOf(iface.(time.Duration).String())) - } else { - e.intv(tag, in) - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - e.uintv(tag, in) - case reflect.Float32, reflect.Float64: - e.floatv(tag, in) - case reflect.Bool: - e.boolv(tag, in) - default: - panic("cannot marshal type: " + in.Type().String()) - } -} - -func (e *encoder) mapv(tag string, in reflect.Value) { - e.mappingv(tag, func() { - keys := keyList(in.MapKeys()) - sort.Sort(keys) - for _, k := range keys { - e.marshal("", k) - e.marshal("", in.MapIndex(k)) - } - }) -} - -func (e *encoder) itemsv(tag string, in reflect.Value) { - e.mappingv(tag, func() { - slice := in.Convert(reflect.TypeOf([]MapItem{})).Interface().([]MapItem) - for _, item := range slice { - e.marshal("", reflect.ValueOf(item.Key)) - e.marshal("", reflect.ValueOf(item.Value)) - } - }) -} - -func (e *encoder) structv(tag string, in reflect.Value) { - sinfo, err := getStructInfo(in.Type()) - if err != nil { - panic(err) - } - e.mappingv(tag, func() { - for _, info := range sinfo.FieldsList { - var value reflect.Value - if info.Inline == nil { - value = in.Field(info.Num) - } else { - value = in.FieldByIndex(info.Inline) - } - if info.OmitEmpty && isZero(value) { - continue - } - e.marshal("", reflect.ValueOf(info.Key)) - e.flow = info.Flow - e.marshal("", value) - } - if sinfo.InlineMap >= 0 { - m := in.Field(sinfo.InlineMap) - if m.Len() > 0 { - e.flow = false - keys := keyList(m.MapKeys()) - sort.Sort(keys) - for _, k := range keys { - if _, found := sinfo.FieldsMap[k.String()]; found { - panic(fmt.Sprintf("Can't have key %q in inlined map; conflicts with struct field", k.String())) - } - e.marshal("", k) - e.flow = false - e.marshal("", m.MapIndex(k)) - } - } - } - }) -} - -func (e *encoder) mappingv(tag string, f func()) { - implicit := tag == "" - style := yaml_BLOCK_MAPPING_STYLE - if e.flow { - e.flow = false - style = yaml_FLOW_MAPPING_STYLE - } - e.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)) - e.emit() - f() - e.must(yaml_mapping_end_event_initialize(&e.event)) - e.emit() -} - -func (e *encoder) slicev(tag string, in reflect.Value) { - implicit := tag == "" - style := yaml_BLOCK_SEQUENCE_STYLE - if e.flow { - e.flow = false - style = yaml_FLOW_SEQUENCE_STYLE - } - e.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)) - e.emit() - n := in.Len() - for i := 0; i < n; i++ { - e.marshal("", in.Index(i)) - } - e.must(yaml_sequence_end_event_initialize(&e.event)) - e.emit() -} - -// isBase60 returns whether s is in base 60 notation as defined in YAML 1.1. -// -// The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported -// in YAML 1.2 and by this package, but these should be marshalled quoted for -// the time being for compatibility with other parsers. -func isBase60Float(s string) (result bool) { - // Fast path. - if s == "" { - return false - } - c := s[0] - if !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 { - return false - } - // Do the full match. - return base60float.MatchString(s) -} - -// From http://yaml.org/type/float.html, except the regular expression there -// is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix. -var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`) - -func (e *encoder) stringv(tag string, in reflect.Value) { - var style yaml_scalar_style_t - s := in.String() - rtag, rs := resolve("", s) - if rtag == yaml_BINARY_TAG { - if tag == "" || tag == yaml_STR_TAG { - tag = rtag - s = rs.(string) - } else if tag == yaml_BINARY_TAG { - failf("explicitly tagged !!binary data must be base64-encoded") - } else { - failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag)) - } - } - if tag == "" && (rtag != yaml_STR_TAG || isBase60Float(s)) { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } else if strings.Contains(s, "\n") { - style = yaml_LITERAL_SCALAR_STYLE - } else { - style = yaml_PLAIN_SCALAR_STYLE - } - e.emitScalar(s, "", tag, style) -} - -func (e *encoder) boolv(tag string, in reflect.Value) { - var s string - if in.Bool() { - s = "true" - } else { - s = "false" - } - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) intv(tag string, in reflect.Value) { - s := strconv.FormatInt(in.Int(), 10) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) uintv(tag string, in reflect.Value) { - s := strconv.FormatUint(in.Uint(), 10) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) floatv(tag string, in reflect.Value) { - // FIXME: Handle 64 bits here. - s := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32) - switch s { - case "+Inf": - s = ".inf" - case "-Inf": - s = "-.inf" - case "NaN": - s = ".nan" - } - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) nilv() { - e.emitScalar("null", "", "", yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) { - implicit := tag == "" - e.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style)) - e.emit() -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/parserc.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/parserc.go deleted file mode 100644 index 81d05dfe..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/parserc.go +++ /dev/null @@ -1,1095 +0,0 @@ -package yaml - -import ( - "bytes" -) - -// The parser implements the following grammar: -// -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END -// implicit_document ::= block_node DOCUMENT-END* -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// block_node_or_indentless_sequence ::= -// ALIAS -// | properties (block_content | indentless_block_sequence)? -// | block_content -// | indentless_block_sequence -// block_node ::= ALIAS -// | properties block_content? -// | block_content -// flow_node ::= ALIAS -// | properties flow_content? -// | flow_content -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// block_content ::= block_collection | flow_collection | SCALAR -// flow_content ::= flow_collection | SCALAR -// block_collection ::= block_sequence | block_mapping -// flow_collection ::= flow_sequence | flow_mapping -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ -// block_mapping ::= BLOCK-MAPPING_START -// ((KEY block_node_or_indentless_sequence?)? -// (VALUE block_node_or_indentless_sequence?)?)* -// BLOCK-END -// flow_sequence ::= FLOW-SEQUENCE-START -// (flow_sequence_entry FLOW-ENTRY)* -// flow_sequence_entry? -// FLOW-SEQUENCE-END -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// flow_mapping ::= FLOW-MAPPING-START -// (flow_mapping_entry FLOW-ENTRY)* -// flow_mapping_entry? -// FLOW-MAPPING-END -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - -// Peek the next token in the token queue. -func peek_token(parser *yaml_parser_t) *yaml_token_t { - if parser.token_available || yaml_parser_fetch_more_tokens(parser) { - return &parser.tokens[parser.tokens_head] - } - return nil -} - -// Remove the next token from the queue (must be called after peek_token). -func skip_token(parser *yaml_parser_t) { - parser.token_available = false - parser.tokens_parsed++ - parser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN - parser.tokens_head++ -} - -// Get the next event. -func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool { - // Erase the event object. - *event = yaml_event_t{} - - // No events after the end of the stream or error. - if parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE { - return true - } - - // Generate the next event. - return yaml_parser_state_machine(parser, event) -} - -// Set parser error. -func yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool { - parser.error = yaml_PARSER_ERROR - parser.problem = problem - parser.problem_mark = problem_mark - return false -} - -func yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string, problem_mark yaml_mark_t) bool { - parser.error = yaml_PARSER_ERROR - parser.context = context - parser.context_mark = context_mark - parser.problem = problem - parser.problem_mark = problem_mark - return false -} - -// State dispatcher. -func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool { - //trace("yaml_parser_state_machine", "state:", parser.state.String()) - - switch parser.state { - case yaml_PARSE_STREAM_START_STATE: - return yaml_parser_parse_stream_start(parser, event) - - case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: - return yaml_parser_parse_document_start(parser, event, true) - - case yaml_PARSE_DOCUMENT_START_STATE: - return yaml_parser_parse_document_start(parser, event, false) - - case yaml_PARSE_DOCUMENT_CONTENT_STATE: - return yaml_parser_parse_document_content(parser, event) - - case yaml_PARSE_DOCUMENT_END_STATE: - return yaml_parser_parse_document_end(parser, event) - - case yaml_PARSE_BLOCK_NODE_STATE: - return yaml_parser_parse_node(parser, event, true, false) - - case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: - return yaml_parser_parse_node(parser, event, true, true) - - case yaml_PARSE_FLOW_NODE_STATE: - return yaml_parser_parse_node(parser, event, false, false) - - case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: - return yaml_parser_parse_block_sequence_entry(parser, event, true) - - case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_block_sequence_entry(parser, event, false) - - case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_indentless_sequence_entry(parser, event) - - case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: - return yaml_parser_parse_block_mapping_key(parser, event, true) - - case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: - return yaml_parser_parse_block_mapping_key(parser, event, false) - - case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: - return yaml_parser_parse_block_mapping_value(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: - return yaml_parser_parse_flow_sequence_entry(parser, event, true) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_flow_sequence_entry(parser, event, false) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event) - - case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: - return yaml_parser_parse_flow_mapping_key(parser, event, true) - - case yaml_PARSE_FLOW_MAPPING_KEY_STATE: - return yaml_parser_parse_flow_mapping_key(parser, event, false) - - case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: - return yaml_parser_parse_flow_mapping_value(parser, event, false) - - case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: - return yaml_parser_parse_flow_mapping_value(parser, event, true) - - default: - panic("invalid parser state") - } -} - -// Parse the production: -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END -// ************ -func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_STREAM_START_TOKEN { - return yaml_parser_set_parser_error(parser, "did not find expected ", token.start_mark) - } - parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE - *event = yaml_event_t{ - typ: yaml_STREAM_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - encoding: token.encoding, - } - skip_token(parser) - return true -} - -// Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// * -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// ************************* -func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { - - token := peek_token(parser) - if token == nil { - return false - } - - // Parse extra document end indicators. - if !implicit { - for token.typ == yaml_DOCUMENT_END_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } - - if implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN && - token.typ != yaml_TAG_DIRECTIVE_TOKEN && - token.typ != yaml_DOCUMENT_START_TOKEN && - token.typ != yaml_STREAM_END_TOKEN { - // Parse an implicit document. - if !yaml_parser_process_directives(parser, nil, nil) { - return false - } - parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) - parser.state = yaml_PARSE_BLOCK_NODE_STATE - - *event = yaml_event_t{ - typ: yaml_DOCUMENT_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - } else if token.typ != yaml_STREAM_END_TOKEN { - // Parse an explicit document. - var version_directive *yaml_version_directive_t - var tag_directives []yaml_tag_directive_t - start_mark := token.start_mark - if !yaml_parser_process_directives(parser, &version_directive, &tag_directives) { - return false - } - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_DOCUMENT_START_TOKEN { - yaml_parser_set_parser_error(parser, - "did not find expected ", token.start_mark) - return false - } - parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) - parser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE - end_mark := token.end_mark - - *event = yaml_event_t{ - typ: yaml_DOCUMENT_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - version_directive: version_directive, - tag_directives: tag_directives, - implicit: false, - } - skip_token(parser) - - } else { - // Parse the stream end. - parser.state = yaml_PARSE_END_STATE - *event = yaml_event_t{ - typ: yaml_STREAM_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - } - - return true -} - -// Parse the productions: -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// *********** -// -func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_VERSION_DIRECTIVE_TOKEN || - token.typ == yaml_TAG_DIRECTIVE_TOKEN || - token.typ == yaml_DOCUMENT_START_TOKEN || - token.typ == yaml_DOCUMENT_END_TOKEN || - token.typ == yaml_STREAM_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - return yaml_parser_process_empty_scalar(parser, event, - token.start_mark) - } - return yaml_parser_parse_node(parser, event, true, false) -} - -// Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// ************* -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// -func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - start_mark := token.start_mark - end_mark := token.start_mark - - implicit := true - if token.typ == yaml_DOCUMENT_END_TOKEN { - end_mark = token.end_mark - skip_token(parser) - implicit = false - } - - parser.tag_directives = parser.tag_directives[:0] - - parser.state = yaml_PARSE_DOCUMENT_START_STATE - *event = yaml_event_t{ - typ: yaml_DOCUMENT_END_EVENT, - start_mark: start_mark, - end_mark: end_mark, - implicit: implicit, - } - return true -} - -// Parse the productions: -// block_node_or_indentless_sequence ::= -// ALIAS -// ***** -// | properties (block_content | indentless_block_sequence)? -// ********** * -// | block_content | indentless_block_sequence -// * -// block_node ::= ALIAS -// ***** -// | properties block_content? -// ********** * -// | block_content -// * -// flow_node ::= ALIAS -// ***** -// | properties flow_content? -// ********** * -// | flow_content -// * -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// ************************* -// block_content ::= block_collection | flow_collection | SCALAR -// ****** -// flow_content ::= flow_collection | SCALAR -// ****** -func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { - //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_ALIAS_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - *event = yaml_event_t{ - typ: yaml_ALIAS_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - anchor: token.value, - } - skip_token(parser) - return true - } - - start_mark := token.start_mark - end_mark := token.start_mark - - var tag_token bool - var tag_handle, tag_suffix, anchor []byte - var tag_mark yaml_mark_t - if token.typ == yaml_ANCHOR_TOKEN { - anchor = token.value - start_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_TAG_TOKEN { - tag_token = true - tag_handle = token.value - tag_suffix = token.suffix - tag_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } else if token.typ == yaml_TAG_TOKEN { - tag_token = true - tag_handle = token.value - tag_suffix = token.suffix - start_mark = token.start_mark - tag_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_ANCHOR_TOKEN { - anchor = token.value - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } - - var tag []byte - if tag_token { - if len(tag_handle) == 0 { - tag = tag_suffix - tag_suffix = nil - } else { - for i := range parser.tag_directives { - if bytes.Equal(parser.tag_directives[i].handle, tag_handle) { - tag = append([]byte(nil), parser.tag_directives[i].prefix...) - tag = append(tag, tag_suffix...) - break - } - } - if len(tag) == 0 { - yaml_parser_set_parser_error_context(parser, - "while parsing a node", start_mark, - "found undefined tag handle", tag_mark) - return false - } - } - } - - implicit := len(tag) == 0 - if indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), - } - return true - } - if token.typ == yaml_SCALAR_TOKEN { - var plain_implicit, quoted_implicit bool - end_mark = token.end_mark - if (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') { - plain_implicit = true - } else if len(tag) == 0 { - quoted_implicit = true - } - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - value: token.value, - implicit: plain_implicit, - quoted_implicit: quoted_implicit, - style: yaml_style_t(token.style), - } - skip_token(parser) - return true - } - if token.typ == yaml_FLOW_SEQUENCE_START_TOKEN { - // [Go] Some of the events below can be merged as they differ only on style. - end_mark = token.end_mark - parser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_FLOW_SEQUENCE_STYLE), - } - return true - } - if token.typ == yaml_FLOW_MAPPING_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), - } - return true - } - if block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), - } - return true - } - if block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE), - } - return true - } - if len(anchor) > 0 || len(tag) > 0 { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - quoted_implicit: false, - style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), - } - return true - } - - context := "while parsing a flow node" - if block { - context = "while parsing a block node" - } - yaml_parser_set_parser_error_context(parser, context, start_mark, - "did not find expected node content", token.start_mark) - return false -} - -// Parse the productions: -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END -// ******************** *********** * ********* -// -func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_BLOCK_ENTRY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, true, false) - } else { - parser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } - if token.typ == yaml_BLOCK_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true - } - - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a block collection", context_mark, - "did not find expected '-' indicator", token.start_mark) -} - -// Parse the productions: -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ -// *********** * -func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_BLOCK_ENTRY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_BLOCK_ENTRY_TOKEN && - token.typ != yaml_KEY_TOKEN && - token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, true, false) - } - parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.start_mark, // [Go] Shouldn't this be token.end_mark? - } - return true -} - -// Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START -// ******************* -// ((KEY block_node_or_indentless_sequence?)? -// *** * -// (VALUE block_node_or_indentless_sequence?)?)* -// -// BLOCK-END -// ********* -// -func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_KEY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_KEY_TOKEN && - token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, true, true) - } else { - parser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } else if token.typ == yaml_BLOCK_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - return true - } - - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a block mapping", context_mark, - "did not find expected key", token.start_mark) -} - -// Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START -// -// ((KEY block_node_or_indentless_sequence?)? -// -// (VALUE block_node_or_indentless_sequence?)?)* -// ***** * -// BLOCK-END -// -// -func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_VALUE_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_KEY_TOKEN && - token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE) - return yaml_parser_parse_node(parser, event, true, true) - } - parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -// Parse the productions: -// flow_sequence ::= FLOW-SEQUENCE-START -// ******************* -// (flow_sequence_entry FLOW-ENTRY)* -// * ********** -// flow_sequence_entry? -// * -// FLOW-SEQUENCE-END -// ***************** -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * -// -func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - if !first { - if token.typ == yaml_FLOW_ENTRY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } else { - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a flow sequence", context_mark, - "did not find expected ',' or ']'", token.start_mark) - } - } - - if token.typ == yaml_KEY_TOKEN { - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - implicit: true, - style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), - } - skip_token(parser) - return true - } else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true -} - -// -// Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// *** * -// -func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_FLOW_ENTRY_TOKEN && - token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - mark := token.end_mark - skip_token(parser) - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) -} - -// Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// ***** * -// -func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_VALUE_TOKEN { - skip_token(parser) - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -// Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * -// -func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.start_mark, // [Go] Shouldn't this be end_mark? - } - return true -} - -// Parse the productions: -// flow_mapping ::= FLOW-MAPPING-START -// ****************** -// (flow_mapping_entry FLOW-ENTRY)* -// * ********** -// flow_mapping_entry? -// ****************** -// FLOW-MAPPING-END -// **************** -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * *** * -// -func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ != yaml_FLOW_MAPPING_END_TOKEN { - if !first { - if token.typ == yaml_FLOW_ENTRY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } else { - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a flow mapping", context_mark, - "did not find expected ',' or '}'", token.start_mark) - } - } - - if token.typ == yaml_KEY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_FLOW_ENTRY_TOKEN && - token.typ != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } else { - parser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) - } - } else if token.typ != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - return true -} - -// Parse the productions: -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * ***** * -// -func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool { - token := peek_token(parser) - if token == nil { - return false - } - if empty { - parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) - } - if token.typ == yaml_VALUE_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -// Generate an empty scalar event. -func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool { - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - start_mark: mark, - end_mark: mark, - value: nil, // Empty - implicit: true, - style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), - } - return true -} - -var default_tag_directives = []yaml_tag_directive_t{ - {[]byte("!"), []byte("!")}, - {[]byte("!!"), []byte("tag:yaml.org,2002:")}, -} - -// Parse directives. -func yaml_parser_process_directives(parser *yaml_parser_t, - version_directive_ref **yaml_version_directive_t, - tag_directives_ref *[]yaml_tag_directive_t) bool { - - var version_directive *yaml_version_directive_t - var tag_directives []yaml_tag_directive_t - - token := peek_token(parser) - if token == nil { - return false - } - - for token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN { - if token.typ == yaml_VERSION_DIRECTIVE_TOKEN { - if version_directive != nil { - yaml_parser_set_parser_error(parser, - "found duplicate %YAML directive", token.start_mark) - return false - } - if token.major != 1 || token.minor != 1 { - yaml_parser_set_parser_error(parser, - "found incompatible YAML document", token.start_mark) - return false - } - version_directive = &yaml_version_directive_t{ - major: token.major, - minor: token.minor, - } - } else if token.typ == yaml_TAG_DIRECTIVE_TOKEN { - value := yaml_tag_directive_t{ - handle: token.value, - prefix: token.prefix, - } - if !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) { - return false - } - tag_directives = append(tag_directives, value) - } - - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - - for i := range default_tag_directives { - if !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) { - return false - } - } - - if version_directive_ref != nil { - *version_directive_ref = version_directive - } - if tag_directives_ref != nil { - *tag_directives_ref = tag_directives - } - return true -} - -// Append a tag directive to the directives stack. -func yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool { - for i := range parser.tag_directives { - if bytes.Equal(value.handle, parser.tag_directives[i].handle) { - if allow_duplicates { - return true - } - return yaml_parser_set_parser_error(parser, "found duplicate %TAG directive", mark) - } - } - - // [Go] I suspect the copy is unnecessary. This was likely done - // because there was no way to track ownership of the data. - value_copy := yaml_tag_directive_t{ - handle: make([]byte, len(value.handle)), - prefix: make([]byte, len(value.prefix)), - } - copy(value_copy.handle, value.handle) - copy(value_copy.prefix, value.prefix) - parser.tag_directives = append(parser.tag_directives, value_copy) - return true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/readerc.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/readerc.go deleted file mode 100644 index f4507917..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/readerc.go +++ /dev/null @@ -1,394 +0,0 @@ -package yaml - -import ( - "io" -) - -// Set the reader error and return 0. -func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool { - parser.error = yaml_READER_ERROR - parser.problem = problem - parser.problem_offset = offset - parser.problem_value = value - return false -} - -// Byte order marks. -const ( - bom_UTF8 = "\xef\xbb\xbf" - bom_UTF16LE = "\xff\xfe" - bom_UTF16BE = "\xfe\xff" -) - -// Determine the input stream encoding by checking the BOM symbol. If no BOM is -// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure. -func yaml_parser_determine_encoding(parser *yaml_parser_t) bool { - // Ensure that we had enough bytes in the raw buffer. - for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 { - if !yaml_parser_update_raw_buffer(parser) { - return false - } - } - - // Determine the encoding. - buf := parser.raw_buffer - pos := parser.raw_buffer_pos - avail := len(buf) - pos - if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] { - parser.encoding = yaml_UTF16LE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] { - parser.encoding = yaml_UTF16BE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] { - parser.encoding = yaml_UTF8_ENCODING - parser.raw_buffer_pos += 3 - parser.offset += 3 - } else { - parser.encoding = yaml_UTF8_ENCODING - } - return true -} - -// Update the raw buffer. -func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool { - size_read := 0 - - // Return if the raw buffer is full. - if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) { - return true - } - - // Return on EOF. - if parser.eof { - return true - } - - // Move the remaining bytes in the raw buffer to the beginning. - if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) { - copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:]) - } - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos] - parser.raw_buffer_pos = 0 - - // Call the read handler to fill the buffer. - size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)]) - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read] - if err == io.EOF { - parser.eof = true - } else if err != nil { - return yaml_parser_set_reader_error(parser, "input error: "+err.Error(), parser.offset, -1) - } - return true -} - -// Ensure that the buffer contains at least `length` characters. -// Return true on success, false on failure. -// -// The length is supposed to be significantly less that the buffer size. -func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { - if parser.read_handler == nil { - panic("read handler must be set") - } - - // If the EOF flag is set and the raw buffer is empty, do nothing. - if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { - return true - } - - // Return if the buffer contains enough characters. - if parser.unread >= length { - return true - } - - // Determine the input encoding if it is not known yet. - if parser.encoding == yaml_ANY_ENCODING { - if !yaml_parser_determine_encoding(parser) { - return false - } - } - - // Move the unread characters to the beginning of the buffer. - buffer_len := len(parser.buffer) - if parser.buffer_pos > 0 && parser.buffer_pos < buffer_len { - copy(parser.buffer, parser.buffer[parser.buffer_pos:]) - buffer_len -= parser.buffer_pos - parser.buffer_pos = 0 - } else if parser.buffer_pos == buffer_len { - buffer_len = 0 - parser.buffer_pos = 0 - } - - // Open the whole buffer for writing, and cut it before returning. - parser.buffer = parser.buffer[:cap(parser.buffer)] - - // Fill the buffer until it has enough characters. - first := true - for parser.unread < length { - - // Fill the raw buffer if necessary. - if !first || parser.raw_buffer_pos == len(parser.raw_buffer) { - if !yaml_parser_update_raw_buffer(parser) { - parser.buffer = parser.buffer[:buffer_len] - return false - } - } - first = false - - // Decode the raw buffer. - inner: - for parser.raw_buffer_pos != len(parser.raw_buffer) { - var value rune - var width int - - raw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos - - // Decode the next character. - switch parser.encoding { - case yaml_UTF8_ENCODING: - // Decode a UTF-8 character. Check RFC 3629 - // (http://www.ietf.org/rfc/rfc3629.txt) for more details. - // - // The following table (taken from the RFC) is used for - // decoding. - // - // Char. number range | UTF-8 octet sequence - // (hexadecimal) | (binary) - // --------------------+------------------------------------ - // 0000 0000-0000 007F | 0xxxxxxx - // 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - // 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - // 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - // - // Additionally, the characters in the range 0xD800-0xDFFF - // are prohibited as they are reserved for use with UTF-16 - // surrogate pairs. - - // Determine the length of the UTF-8 sequence. - octet := parser.raw_buffer[parser.raw_buffer_pos] - switch { - case octet&0x80 == 0x00: - width = 1 - case octet&0xE0 == 0xC0: - width = 2 - case octet&0xF0 == 0xE0: - width = 3 - case octet&0xF8 == 0xF0: - width = 4 - default: - // The leading octet is invalid. - return yaml_parser_set_reader_error(parser, - "invalid leading UTF-8 octet", - parser.offset, int(octet)) - } - - // Check if the raw buffer contains an incomplete character. - if width > raw_unread { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-8 octet sequence", - parser.offset, -1) - } - break inner - } - - // Decode the leading octet. - switch { - case octet&0x80 == 0x00: - value = rune(octet & 0x7F) - case octet&0xE0 == 0xC0: - value = rune(octet & 0x1F) - case octet&0xF0 == 0xE0: - value = rune(octet & 0x0F) - case octet&0xF8 == 0xF0: - value = rune(octet & 0x07) - default: - value = 0 - } - - // Check and decode the trailing octets. - for k := 1; k < width; k++ { - octet = parser.raw_buffer[parser.raw_buffer_pos+k] - - // Check if the octet is valid. - if (octet & 0xC0) != 0x80 { - return yaml_parser_set_reader_error(parser, - "invalid trailing UTF-8 octet", - parser.offset+k, int(octet)) - } - - // Decode the octet. - value = (value << 6) + rune(octet&0x3F) - } - - // Check the length of the sequence against the value. - switch { - case width == 1: - case width == 2 && value >= 0x80: - case width == 3 && value >= 0x800: - case width == 4 && value >= 0x10000: - default: - return yaml_parser_set_reader_error(parser, - "invalid length of a UTF-8 sequence", - parser.offset, -1) - } - - // Check the range of the value. - if value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF { - return yaml_parser_set_reader_error(parser, - "invalid Unicode character", - parser.offset, int(value)) - } - - case yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING: - var low, high int - if parser.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - low, high = 1, 0 - } - - // The UTF-16 encoding is not as simple as one might - // naively think. Check RFC 2781 - // (http://www.ietf.org/rfc/rfc2781.txt). - // - // Normally, two subsequent bytes describe a Unicode - // character. However a special technique (called a - // surrogate pair) is used for specifying character - // values larger than 0xFFFF. - // - // A surrogate pair consists of two pseudo-characters: - // high surrogate area (0xD800-0xDBFF) - // low surrogate area (0xDC00-0xDFFF) - // - // The following formulas are used for decoding - // and encoding characters using surrogate pairs: - // - // U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF) - // U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF) - // W1 = 110110yyyyyyyyyy - // W2 = 110111xxxxxxxxxx - // - // where U is the character value, W1 is the high surrogate - // area, W2 is the low surrogate area. - - // Check for incomplete UTF-16 character. - if raw_unread < 2 { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-16 character", - parser.offset, -1) - } - break inner - } - - // Get the character. - value = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) + - (rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8) - - // Check for unexpected low surrogate area. - if value&0xFC00 == 0xDC00 { - return yaml_parser_set_reader_error(parser, - "unexpected low surrogate area", - parser.offset, int(value)) - } - - // Check for a high surrogate area. - if value&0xFC00 == 0xD800 { - width = 4 - - // Check for incomplete surrogate pair. - if raw_unread < 4 { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-16 surrogate pair", - parser.offset, -1) - } - break inner - } - - // Get the next character. - value2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) + - (rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8) - - // Check for a low surrogate area. - if value2&0xFC00 != 0xDC00 { - return yaml_parser_set_reader_error(parser, - "expected low surrogate area", - parser.offset+2, int(value2)) - } - - // Generate the value of the surrogate pair. - value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF) - } else { - width = 2 - } - - default: - panic("impossible") - } - - // Check if the character is in the allowed range: - // #x9 | #xA | #xD | [#x20-#x7E] (8 bit) - // | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] (16 bit) - // | [#x10000-#x10FFFF] (32 bit) - switch { - case value == 0x09: - case value == 0x0A: - case value == 0x0D: - case value >= 0x20 && value <= 0x7E: - case value == 0x85: - case value >= 0xA0 && value <= 0xD7FF: - case value >= 0xE000 && value <= 0xFFFD: - case value >= 0x10000 && value <= 0x10FFFF: - default: - return yaml_parser_set_reader_error(parser, - "control characters are not allowed", - parser.offset, int(value)) - } - - // Move the raw pointers. - parser.raw_buffer_pos += width - parser.offset += width - - // Finally put the character into the buffer. - if value <= 0x7F { - // 0000 0000-0000 007F . 0xxxxxxx - parser.buffer[buffer_len+0] = byte(value) - buffer_len += 1 - } else if value <= 0x7FF { - // 0000 0080-0000 07FF . 110xxxxx 10xxxxxx - parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6)) - parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F)) - buffer_len += 2 - } else if value <= 0xFFFF { - // 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx - parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12)) - parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F)) - parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F)) - buffer_len += 3 - } else { - // 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18)) - parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F)) - parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F)) - parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F)) - buffer_len += 4 - } - - parser.unread++ - } - - // On EOF, put NUL into the buffer and return. - if parser.eof { - parser.buffer[buffer_len] = 0 - buffer_len++ - parser.unread++ - break - } - } - parser.buffer = parser.buffer[:buffer_len] - return true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/resolve.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/resolve.go deleted file mode 100644 index 232313cc..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/resolve.go +++ /dev/null @@ -1,208 +0,0 @@ -package yaml - -import ( - "encoding/base64" - "math" - "regexp" - "strconv" - "strings" - "unicode/utf8" -) - -type resolveMapItem struct { - value interface{} - tag string -} - -var resolveTable = make([]byte, 256) -var resolveMap = make(map[string]resolveMapItem) - -func init() { - t := resolveTable - t[int('+')] = 'S' // Sign - t[int('-')] = 'S' - for _, c := range "0123456789" { - t[int(c)] = 'D' // Digit - } - for _, c := range "yYnNtTfFoO~" { - t[int(c)] = 'M' // In map - } - t[int('.')] = '.' // Float (potentially in map) - - var resolveMapList = []struct { - v interface{} - tag string - l []string - }{ - {true, yaml_BOOL_TAG, []string{"y", "Y", "yes", "Yes", "YES"}}, - {true, yaml_BOOL_TAG, []string{"true", "True", "TRUE"}}, - {true, yaml_BOOL_TAG, []string{"on", "On", "ON"}}, - {false, yaml_BOOL_TAG, []string{"n", "N", "no", "No", "NO"}}, - {false, yaml_BOOL_TAG, []string{"false", "False", "FALSE"}}, - {false, yaml_BOOL_TAG, []string{"off", "Off", "OFF"}}, - {nil, yaml_NULL_TAG, []string{"", "~", "null", "Null", "NULL"}}, - {math.NaN(), yaml_FLOAT_TAG, []string{".nan", ".NaN", ".NAN"}}, - {math.Inf(+1), yaml_FLOAT_TAG, []string{".inf", ".Inf", ".INF"}}, - {math.Inf(+1), yaml_FLOAT_TAG, []string{"+.inf", "+.Inf", "+.INF"}}, - {math.Inf(-1), yaml_FLOAT_TAG, []string{"-.inf", "-.Inf", "-.INF"}}, - {"<<", yaml_MERGE_TAG, []string{"<<"}}, - } - - m := resolveMap - for _, item := range resolveMapList { - for _, s := range item.l { - m[s] = resolveMapItem{item.v, item.tag} - } - } -} - -const longTagPrefix = "tag:yaml.org,2002:" - -func shortTag(tag string) string { - // TODO This can easily be made faster and produce less garbage. - if strings.HasPrefix(tag, longTagPrefix) { - return "!!" + tag[len(longTagPrefix):] - } - return tag -} - -func longTag(tag string) string { - if strings.HasPrefix(tag, "!!") { - return longTagPrefix + tag[2:] - } - return tag -} - -func resolvableTag(tag string) bool { - switch tag { - case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG: - return true - } - return false -} - -var yamlStyleFloat = regexp.MustCompile(`^[-+]?[0-9]*\.?[0-9]+([eE][-+][0-9]+)?$`) - -func resolve(tag string, in string) (rtag string, out interface{}) { - if !resolvableTag(tag) { - return tag, in - } - - defer func() { - switch tag { - case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG: - return - } - failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)) - }() - - // Any data is accepted as a !!str or !!binary. - // Otherwise, the prefix is enough of a hint about what it might be. - hint := byte('N') - if in != "" { - hint = resolveTable[in[0]] - } - if hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG { - // Handle things we can lookup in a map. - if item, ok := resolveMap[in]; ok { - return item.tag, item.value - } - - // Base 60 floats are a bad idea, were dropped in YAML 1.2, and - // are purposefully unsupported here. They're still quoted on - // the way out for compatibility with other parser, though. - - switch hint { - case 'M': - // We've already checked the map above. - - case '.': - // Not in the map, so maybe a normal float. - floatv, err := strconv.ParseFloat(in, 64) - if err == nil { - return yaml_FLOAT_TAG, floatv - } - - case 'D', 'S': - // Int, float, or timestamp. - plain := strings.Replace(in, "_", "", -1) - intv, err := strconv.ParseInt(plain, 0, 64) - if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, int(intv) - } else { - return yaml_INT_TAG, intv - } - } - uintv, err := strconv.ParseUint(plain, 0, 64) - if err == nil { - return yaml_INT_TAG, uintv - } - if yamlStyleFloat.MatchString(plain) { - floatv, err := strconv.ParseFloat(plain, 64) - if err == nil { - return yaml_FLOAT_TAG, floatv - } - } - if strings.HasPrefix(plain, "0b") { - intv, err := strconv.ParseInt(plain[2:], 2, 64) - if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, int(intv) - } else { - return yaml_INT_TAG, intv - } - } - uintv, err := strconv.ParseUint(plain[2:], 2, 64) - if err == nil { - return yaml_INT_TAG, uintv - } - } else if strings.HasPrefix(plain, "-0b") { - intv, err := strconv.ParseInt(plain[3:], 2, 64) - if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, -int(intv) - } else { - return yaml_INT_TAG, -intv - } - } - } - // XXX Handle timestamps here. - - default: - panic("resolveTable item not yet handled: " + string(rune(hint)) + " (with " + in + ")") - } - } - if tag == yaml_BINARY_TAG { - return yaml_BINARY_TAG, in - } - if utf8.ValidString(in) { - return yaml_STR_TAG, in - } - return yaml_BINARY_TAG, encodeBase64(in) -} - -// encodeBase64 encodes s as base64 that is broken up into multiple lines -// as appropriate for the resulting length. -func encodeBase64(s string) string { - const lineLen = 70 - encLen := base64.StdEncoding.EncodedLen(len(s)) - lines := encLen/lineLen + 1 - buf := make([]byte, encLen*2+lines) - in := buf[0:encLen] - out := buf[encLen:] - base64.StdEncoding.Encode(in, []byte(s)) - k := 0 - for i := 0; i < len(in); i += lineLen { - j := i + lineLen - if j > len(in) { - j = len(in) - } - k += copy(out[k:], in[i:j]) - if lines > 1 { - out[k] = '\n' - k++ - } - } - return string(out[:k]) -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/scannerc.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/scannerc.go deleted file mode 100644 index 07448445..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/scannerc.go +++ /dev/null @@ -1,2711 +0,0 @@ -package yaml - -import ( - "bytes" - "fmt" -) - -// Introduction -// ************ -// -// The following notes assume that you are familiar with the YAML specification -// (http://yaml.org/spec/1.2/spec.html). We mostly follow it, although in -// some cases we are less restrictive that it requires. -// -// The process of transforming a YAML stream into a sequence of events is -// divided on two steps: Scanning and Parsing. -// -// The Scanner transforms the input stream into a sequence of tokens, while the -// parser transform the sequence of tokens produced by the Scanner into a -// sequence of parsing events. -// -// The Scanner is rather clever and complicated. The Parser, on the contrary, -// is a straightforward implementation of a recursive-descendant parser (or, -// LL(1) parser, as it is usually called). -// -// Actually there are two issues of Scanning that might be called "clever", the -// rest is quite straightforward. The issues are "block collection start" and -// "simple keys". Both issues are explained below in details. -// -// Here the Scanning step is explained and implemented. We start with the list -// of all the tokens produced by the Scanner together with short descriptions. -// -// Now, tokens: -// -// STREAM-START(encoding) # The stream start. -// STREAM-END # The stream end. -// VERSION-DIRECTIVE(major,minor) # The '%YAML' directive. -// TAG-DIRECTIVE(handle,prefix) # The '%TAG' directive. -// DOCUMENT-START # '---' -// DOCUMENT-END # '...' -// BLOCK-SEQUENCE-START # Indentation increase denoting a block -// BLOCK-MAPPING-START # sequence or a block mapping. -// BLOCK-END # Indentation decrease. -// FLOW-SEQUENCE-START # '[' -// FLOW-SEQUENCE-END # ']' -// BLOCK-SEQUENCE-START # '{' -// BLOCK-SEQUENCE-END # '}' -// BLOCK-ENTRY # '-' -// FLOW-ENTRY # ',' -// KEY # '?' or nothing (simple keys). -// VALUE # ':' -// ALIAS(anchor) # '*anchor' -// ANCHOR(anchor) # '&anchor' -// TAG(handle,suffix) # '!handle!suffix' -// SCALAR(value,style) # A scalar. -// -// The following two tokens are "virtual" tokens denoting the beginning and the -// end of the stream: -// -// STREAM-START(encoding) -// STREAM-END -// -// We pass the information about the input stream encoding with the -// STREAM-START token. -// -// The next two tokens are responsible for tags: -// -// VERSION-DIRECTIVE(major,minor) -// TAG-DIRECTIVE(handle,prefix) -// -// Example: -// -// %YAML 1.1 -// %TAG ! !foo -// %TAG !yaml! tag:yaml.org,2002: -// --- -// -// The correspoding sequence of tokens: -// -// STREAM-START(utf-8) -// VERSION-DIRECTIVE(1,1) -// TAG-DIRECTIVE("!","!foo") -// TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:") -// DOCUMENT-START -// STREAM-END -// -// Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole -// line. -// -// The document start and end indicators are represented by: -// -// DOCUMENT-START -// DOCUMENT-END -// -// Note that if a YAML stream contains an implicit document (without '---' -// and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be -// produced. -// -// In the following examples, we present whole documents together with the -// produced tokens. -// -// 1. An implicit document: -// -// 'a scalar' -// -// Tokens: -// -// STREAM-START(utf-8) -// SCALAR("a scalar",single-quoted) -// STREAM-END -// -// 2. An explicit document: -// -// --- -// 'a scalar' -// ... -// -// Tokens: -// -// STREAM-START(utf-8) -// DOCUMENT-START -// SCALAR("a scalar",single-quoted) -// DOCUMENT-END -// STREAM-END -// -// 3. Several documents in a stream: -// -// 'a scalar' -// --- -// 'another scalar' -// --- -// 'yet another scalar' -// -// Tokens: -// -// STREAM-START(utf-8) -// SCALAR("a scalar",single-quoted) -// DOCUMENT-START -// SCALAR("another scalar",single-quoted) -// DOCUMENT-START -// SCALAR("yet another scalar",single-quoted) -// STREAM-END -// -// We have already introduced the SCALAR token above. The following tokens are -// used to describe aliases, anchors, tag, and scalars: -// -// ALIAS(anchor) -// ANCHOR(anchor) -// TAG(handle,suffix) -// SCALAR(value,style) -// -// The following series of examples illustrate the usage of these tokens: -// -// 1. A recursive sequence: -// -// &A [ *A ] -// -// Tokens: -// -// STREAM-START(utf-8) -// ANCHOR("A") -// FLOW-SEQUENCE-START -// ALIAS("A") -// FLOW-SEQUENCE-END -// STREAM-END -// -// 2. A tagged scalar: -// -// !!float "3.14" # A good approximation. -// -// Tokens: -// -// STREAM-START(utf-8) -// TAG("!!","float") -// SCALAR("3.14",double-quoted) -// STREAM-END -// -// 3. Various scalar styles: -// -// --- # Implicit empty plain scalars do not produce tokens. -// --- a plain scalar -// --- 'a single-quoted scalar' -// --- "a double-quoted scalar" -// --- |- -// a literal scalar -// --- >- -// a folded -// scalar -// -// Tokens: -// -// STREAM-START(utf-8) -// DOCUMENT-START -// DOCUMENT-START -// SCALAR("a plain scalar",plain) -// DOCUMENT-START -// SCALAR("a single-quoted scalar",single-quoted) -// DOCUMENT-START -// SCALAR("a double-quoted scalar",double-quoted) -// DOCUMENT-START -// SCALAR("a literal scalar",literal) -// DOCUMENT-START -// SCALAR("a folded scalar",folded) -// STREAM-END -// -// Now it's time to review collection-related tokens. We will start with -// flow collections: -// -// FLOW-SEQUENCE-START -// FLOW-SEQUENCE-END -// FLOW-MAPPING-START -// FLOW-MAPPING-END -// FLOW-ENTRY -// KEY -// VALUE -// -// The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and -// FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}' -// correspondingly. FLOW-ENTRY represent the ',' indicator. Finally the -// indicators '?' and ':', which are used for denoting mapping keys and values, -// are represented by the KEY and VALUE tokens. -// -// The following examples show flow collections: -// -// 1. A flow sequence: -// -// [item 1, item 2, item 3] -// -// Tokens: -// -// STREAM-START(utf-8) -// FLOW-SEQUENCE-START -// SCALAR("item 1",plain) -// FLOW-ENTRY -// SCALAR("item 2",plain) -// FLOW-ENTRY -// SCALAR("item 3",plain) -// FLOW-SEQUENCE-END -// STREAM-END -// -// 2. A flow mapping: -// -// { -// a simple key: a value, # Note that the KEY token is produced. -// ? a complex key: another value, -// } -// -// Tokens: -// -// STREAM-START(utf-8) -// FLOW-MAPPING-START -// KEY -// SCALAR("a simple key",plain) -// VALUE -// SCALAR("a value",plain) -// FLOW-ENTRY -// KEY -// SCALAR("a complex key",plain) -// VALUE -// SCALAR("another value",plain) -// FLOW-ENTRY -// FLOW-MAPPING-END -// STREAM-END -// -// A simple key is a key which is not denoted by the '?' indicator. Note that -// the Scanner still produce the KEY token whenever it encounters a simple key. -// -// For scanning block collections, the following tokens are used (note that we -// repeat KEY and VALUE here): -// -// BLOCK-SEQUENCE-START -// BLOCK-MAPPING-START -// BLOCK-END -// BLOCK-ENTRY -// KEY -// VALUE -// -// The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation -// increase that precedes a block collection (cf. the INDENT token in Python). -// The token BLOCK-END denote indentation decrease that ends a block collection -// (cf. the DEDENT token in Python). However YAML has some syntax pecularities -// that makes detections of these tokens more complex. -// -// The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators -// '-', '?', and ':' correspondingly. -// -// The following examples show how the tokens BLOCK-SEQUENCE-START, -// BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner: -// -// 1. Block sequences: -// -// - item 1 -// - item 2 -// - -// - item 3.1 -// - item 3.2 -// - -// key 1: value 1 -// key 2: value 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-ENTRY -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 3.1",plain) -// BLOCK-ENTRY -// SCALAR("item 3.2",plain) -// BLOCK-END -// BLOCK-ENTRY -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// 2. Block mappings: -// -// a simple key: a value # The KEY token is produced here. -// ? a complex key -// : another value -// a mapping: -// key 1: value 1 -// key 2: value 2 -// a sequence: -// - item 1 -// - item 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-MAPPING-START -// KEY -// SCALAR("a simple key",plain) -// VALUE -// SCALAR("a value",plain) -// KEY -// SCALAR("a complex key",plain) -// VALUE -// SCALAR("another value",plain) -// KEY -// SCALAR("a mapping",plain) -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// KEY -// SCALAR("a sequence",plain) -// VALUE -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// YAML does not always require to start a new block collection from a new -// line. If the current line contains only '-', '?', and ':' indicators, a new -// block collection may start at the current line. The following examples -// illustrate this case: -// -// 1. Collections in a sequence: -// -// - - item 1 -// - item 2 -// - key 1: value 1 -// key 2: value 2 -// - ? complex key -// : complex value -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// BLOCK-ENTRY -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// BLOCK-ENTRY -// BLOCK-MAPPING-START -// KEY -// SCALAR("complex key") -// VALUE -// SCALAR("complex value") -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// 2. Collections in a mapping: -// -// ? a sequence -// : - item 1 -// - item 2 -// ? a mapping -// : key 1: value 1 -// key 2: value 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-MAPPING-START -// KEY -// SCALAR("a sequence",plain) -// VALUE -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// KEY -// SCALAR("a mapping",plain) -// VALUE -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// YAML also permits non-indented sequences if they are included into a block -// mapping. In this case, the token BLOCK-SEQUENCE-START is not produced: -// -// key: -// - item 1 # BLOCK-SEQUENCE-START is NOT produced here. -// - item 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-MAPPING-START -// KEY -// SCALAR("key",plain) -// VALUE -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// - -// Ensure that the buffer contains the required number of characters. -// Return true on success, false on failure (reader error or memory error). -func cache(parser *yaml_parser_t, length int) bool { - // [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B) - return parser.unread >= length || yaml_parser_update_buffer(parser, length) -} - -// Advance the buffer pointer. -func skip(parser *yaml_parser_t) { - parser.mark.index++ - parser.mark.column++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) -} - -func skip_line(parser *yaml_parser_t) { - if is_crlf(parser.buffer, parser.buffer_pos) { - parser.mark.index += 2 - parser.mark.column = 0 - parser.mark.line++ - parser.unread -= 2 - parser.buffer_pos += 2 - } else if is_break(parser.buffer, parser.buffer_pos) { - parser.mark.index++ - parser.mark.column = 0 - parser.mark.line++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) - } -} - -// Copy a character to a string buffer and advance pointers. -func read(parser *yaml_parser_t, s []byte) []byte { - w := width(parser.buffer[parser.buffer_pos]) - if w == 0 { - panic("invalid character sequence") - } - if len(s) == 0 { - s = make([]byte, 0, 32) - } - if w == 1 && len(s)+w <= cap(s) { - s = s[:len(s)+1] - s[len(s)-1] = parser.buffer[parser.buffer_pos] - parser.buffer_pos++ - } else { - s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...) - parser.buffer_pos += w - } - parser.mark.index++ - parser.mark.column++ - parser.unread-- - return s -} - -// Copy a line break character to a string buffer and advance pointers. -func read_line(parser *yaml_parser_t, s []byte) []byte { - buf := parser.buffer - pos := parser.buffer_pos - switch { - case buf[pos] == '\r' && buf[pos+1] == '\n': - // CR LF . LF - s = append(s, '\n') - parser.buffer_pos += 2 - parser.mark.index++ - parser.unread-- - case buf[pos] == '\r' || buf[pos] == '\n': - // CR|LF . LF - s = append(s, '\n') - parser.buffer_pos += 1 - case buf[pos] == '\xC2' && buf[pos+1] == '\x85': - // NEL . LF - s = append(s, '\n') - parser.buffer_pos += 2 - case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'): - // LS|PS . LS|PS - s = append(s, buf[parser.buffer_pos:pos+3]...) - parser.buffer_pos += 3 - default: - return s - } - parser.mark.index++ - parser.mark.column = 0 - parser.mark.line++ - parser.unread-- - return s -} - -// Get the next token. -func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool { - // Erase the token object. - *token = yaml_token_t{} // [Go] Is this necessary? - - // No tokens after STREAM-END or error. - if parser.stream_end_produced || parser.error != yaml_NO_ERROR { - return true - } - - // Ensure that the tokens queue contains enough tokens. - if !parser.token_available { - if !yaml_parser_fetch_more_tokens(parser) { - return false - } - } - - // Fetch the next token from the queue. - *token = parser.tokens[parser.tokens_head] - parser.tokens_head++ - parser.tokens_parsed++ - parser.token_available = false - - if token.typ == yaml_STREAM_END_TOKEN { - parser.stream_end_produced = true - } - return true -} - -// Set the scanner error and return false. -func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool { - parser.error = yaml_SCANNER_ERROR - parser.context = context - parser.context_mark = context_mark - parser.problem = problem - parser.problem_mark = parser.mark - return false -} - -func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool { - context := "while parsing a tag" - if directive { - context = "while parsing a %TAG directive" - } - return yaml_parser_set_scanner_error(parser, context, context_mark, problem) -} - -func trace(args ...interface{}) func() { - pargs := append([]interface{}{"+++"}, args...) - fmt.Println(pargs...) - pargs = append([]interface{}{"---"}, args...) - return func() { fmt.Println(pargs...) } -} - -// Ensure that the tokens queue contains at least one token which can be -// returned to the Parser. -func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool { - // While we need more tokens to fetch, do it. - for { - // Check if we really need to fetch more tokens. - need_more_tokens := false - - if parser.tokens_head == len(parser.tokens) { - // Queue is empty. - need_more_tokens = true - } else { - // Check if any potential simple key may occupy the head position. - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - for i := range parser.simple_keys { - simple_key := &parser.simple_keys[i] - if simple_key.possible && simple_key.token_number == parser.tokens_parsed { - need_more_tokens = true - break - } - } - } - - // We are finished. - if !need_more_tokens { - break - } - // Fetch the next token. - if !yaml_parser_fetch_next_token(parser) { - return false - } - } - - parser.token_available = true - return true -} - -// The dispatcher for token fetchers. -func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool { - // Ensure that the buffer is initialized. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - // Check if we just started scanning. Fetch STREAM-START then. - if !parser.stream_start_produced { - return yaml_parser_fetch_stream_start(parser) - } - - // Eat whitespaces and comments until we reach the next token. - if !yaml_parser_scan_to_next_token(parser) { - return false - } - - // Remove obsolete potential simple keys. - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - // Check the indentation level against the current column. - if !yaml_parser_unroll_indent(parser, parser.mark.column) { - return false - } - - // Ensure that the buffer contains at least 4 characters. 4 is the length - // of the longest indicators ('--- ' and '... '). - if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { - return false - } - - // Is it the end of the stream? - if is_z(parser.buffer, parser.buffer_pos) { - return yaml_parser_fetch_stream_end(parser) - } - - // Is it a directive? - if parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' { - return yaml_parser_fetch_directive(parser) - } - - buf := parser.buffer - pos := parser.buffer_pos - - // Is it the document start indicator? - if parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) { - return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN) - } - - // Is it the document end indicator? - if parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) { - return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN) - } - - // Is it the flow sequence start indicator? - if buf[pos] == '[' { - return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN) - } - - // Is it the flow mapping start indicator? - if parser.buffer[parser.buffer_pos] == '{' { - return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN) - } - - // Is it the flow sequence end indicator? - if parser.buffer[parser.buffer_pos] == ']' { - return yaml_parser_fetch_flow_collection_end(parser, - yaml_FLOW_SEQUENCE_END_TOKEN) - } - - // Is it the flow mapping end indicator? - if parser.buffer[parser.buffer_pos] == '}' { - return yaml_parser_fetch_flow_collection_end(parser, - yaml_FLOW_MAPPING_END_TOKEN) - } - - // Is it the flow entry indicator? - if parser.buffer[parser.buffer_pos] == ',' { - return yaml_parser_fetch_flow_entry(parser) - } - - // Is it the block entry indicator? - if parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) { - return yaml_parser_fetch_block_entry(parser) - } - - // Is it the key indicator? - if parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) { - return yaml_parser_fetch_key(parser) - } - - // Is it the value indicator? - if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) { - return yaml_parser_fetch_value(parser) - } - - // Is it an alias? - if parser.buffer[parser.buffer_pos] == '*' { - return yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN) - } - - // Is it an anchor? - if parser.buffer[parser.buffer_pos] == '&' { - return yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN) - } - - // Is it a tag? - if parser.buffer[parser.buffer_pos] == '!' { - return yaml_parser_fetch_tag(parser) - } - - // Is it a literal scalar? - if parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 { - return yaml_parser_fetch_block_scalar(parser, true) - } - - // Is it a folded scalar? - if parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 { - return yaml_parser_fetch_block_scalar(parser, false) - } - - // Is it a single-quoted scalar? - if parser.buffer[parser.buffer_pos] == '\'' { - return yaml_parser_fetch_flow_scalar(parser, true) - } - - // Is it a double-quoted scalar? - if parser.buffer[parser.buffer_pos] == '"' { - return yaml_parser_fetch_flow_scalar(parser, false) - } - - // Is it a plain scalar? - // - // A plain scalar may start with any non-blank characters except - // - // '-', '?', ':', ',', '[', ']', '{', '}', - // '#', '&', '*', '!', '|', '>', '\'', '\"', - // '%', '@', '`'. - // - // In the block context (and, for the '-' indicator, in the flow context - // too), it may also start with the characters - // - // '-', '?', ':' - // - // if it is followed by a non-space character. - // - // The last rule is more restrictive than the specification requires. - // [Go] Make this logic more reasonable. - //switch parser.buffer[parser.buffer_pos] { - //case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '"', '\'', '@', '%', '-', '`': - //} - if !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' || - parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' || - parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || - parser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' || - parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' || - parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' || - parser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\'' || - parser.buffer[parser.buffer_pos] == '"' || parser.buffer[parser.buffer_pos] == '%' || - parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') || - (parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) || - (parser.flow_level == 0 && - (parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') && - !is_blankz(parser.buffer, parser.buffer_pos+1)) { - return yaml_parser_fetch_plain_scalar(parser) - } - - // If we don't determine the token type so far, it is an error. - return yaml_parser_set_scanner_error(parser, - "while scanning for the next token", parser.mark, - "found character that cannot start any token") -} - -// Check the list of potential simple keys and remove the positions that -// cannot contain simple keys anymore. -func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool { - // Check for a potential simple key for each flow level. - for i := range parser.simple_keys { - simple_key := &parser.simple_keys[i] - - // The specification requires that a simple key - // - // - is limited to a single line, - // - is shorter than 1024 characters. - if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) { - - // Check if the potential simple key to be removed is required. - if simple_key.required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", simple_key.mark, - "could not find expected ':'") - } - simple_key.possible = false - } - } - return true -} - -// Check if a simple key may start at the current position and add it if -// needed. -func yaml_parser_save_simple_key(parser *yaml_parser_t) bool { - // A simple key is required at the current position if the scanner is in - // the block context and the current column coincides with the indentation - // level. - - required := parser.flow_level == 0 && parser.indent == parser.mark.column - - // A simple key is required only when it is the first token in the current - // line. Therefore it is always allowed. But we add a check anyway. - if required && !parser.simple_key_allowed { - panic("should not happen") - } - - // - // If the current position may start a simple key, save it. - // - if parser.simple_key_allowed { - simple_key := yaml_simple_key_t{ - possible: true, - required: required, - token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), - } - simple_key.mark = parser.mark - - if !yaml_parser_remove_simple_key(parser) { - return false - } - parser.simple_keys[len(parser.simple_keys)-1] = simple_key - } - return true -} - -// Remove a potential simple key at the current flow level. -func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool { - i := len(parser.simple_keys) - 1 - if parser.simple_keys[i].possible { - // If the key is required, it is an error. - if parser.simple_keys[i].required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", parser.simple_keys[i].mark, - "could not find expected ':'") - } - } - // Remove the key from the stack. - parser.simple_keys[i].possible = false - return true -} - -// Increase the flow level and resize the simple key list if needed. -func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool { - // Reset the simple key on the next level. - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) - - // Increase the flow level. - parser.flow_level++ - return true -} - -// Decrease the flow level. -func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool { - if parser.flow_level > 0 { - parser.flow_level-- - parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1] - } - return true -} - -// Push the current indentation level to the stack and set the new level -// the current column is greater than the indentation level. In this case, -// append or insert the specified token into the token queue. -func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool { - // In the flow context, do nothing. - if parser.flow_level > 0 { - return true - } - - if parser.indent < column { - // Push the current indentation level to the stack and set the new - // indentation level. - parser.indents = append(parser.indents, parser.indent) - parser.indent = column - - // Create a token and insert it into the queue. - token := yaml_token_t{ - typ: typ, - start_mark: mark, - end_mark: mark, - } - if number > -1 { - number -= parser.tokens_parsed - } - yaml_insert_token(parser, number, &token) - } - return true -} - -// Pop indentation levels from the indents stack until the current level -// becomes less or equal to the column. For each indentation level, append -// the BLOCK-END token. -func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { - // In the flow context, do nothing. - if parser.flow_level > 0 { - return true - } - - // Loop through the indentation levels in the stack. - for parser.indent > column { - // Create a token and append it to the queue. - token := yaml_token_t{ - typ: yaml_BLOCK_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - yaml_insert_token(parser, -1, &token) - - // Pop the indentation level. - parser.indent = parser.indents[len(parser.indents)-1] - parser.indents = parser.indents[:len(parser.indents)-1] - } - return true -} - -// Initialize the scanner and produce the STREAM-START token. -func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool { - - // Set the initial indentation. - parser.indent = -1 - - // Initialize the simple key stack. - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) - - // A simple key is allowed at the beginning of the stream. - parser.simple_key_allowed = true - - // We have started. - parser.stream_start_produced = true - - // Create the STREAM-START token and append it to the queue. - token := yaml_token_t{ - typ: yaml_STREAM_START_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - encoding: parser.encoding, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the STREAM-END token and shut down the scanner. -func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool { - - // Force new line. - if parser.mark.column != 0 { - parser.mark.column = 0 - parser.mark.line++ - } - - // Reset the indentation level. - if !yaml_parser_unroll_indent(parser, -1) { - return false - } - - // Reset simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - // Create the STREAM-END token and append it to the queue. - token := yaml_token_t{ - typ: yaml_STREAM_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token. -func yaml_parser_fetch_directive(parser *yaml_parser_t) bool { - // Reset the indentation level. - if !yaml_parser_unroll_indent(parser, -1) { - return false - } - - // Reset simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - // Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. - token := yaml_token_t{} - if !yaml_parser_scan_directive(parser, &token) { - return false - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the DOCUMENT-START or DOCUMENT-END token. -func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // Reset the indentation level. - if !yaml_parser_unroll_indent(parser, -1) { - return false - } - - // Reset simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - // Consume the token. - start_mark := parser.mark - - skip(parser) - skip(parser) - skip(parser) - - end_mark := parser.mark - - // Create the DOCUMENT-START or DOCUMENT-END token. - token := yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. -func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // The indicators '[' and '{' may start a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // Increase the flow level. - if !yaml_parser_increase_flow_level(parser) { - return false - } - - // A simple key may follow the indicators '[' and '{'. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. - token := yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. -func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // Reset any potential simple key on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Decrease the flow level. - if !yaml_parser_decrease_flow_level(parser) { - return false - } - - // No simple keys after the indicators ']' and '}'. - parser.simple_key_allowed = false - - // Consume the token. - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. - token := yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the FLOW-ENTRY token. -func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool { - // Reset any potential simple keys on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Simple keys are allowed after ','. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the FLOW-ENTRY token and append it to the queue. - token := yaml_token_t{ - typ: yaml_FLOW_ENTRY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the BLOCK-ENTRY token. -func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool { - // Check if the scanner is in the block context. - if parser.flow_level == 0 { - // Check if we are allowed to start a new entry. - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "block sequence entries are not allowed in this context") - } - // Add the BLOCK-SEQUENCE-START token if needed. - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) { - return false - } - } else { - // It is an error for the '-' indicator to occur in the flow context, - // but we let the Parser detect and report about it because the Parser - // is able to point to the context. - } - - // Reset any potential simple keys on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Simple keys are allowed after '-'. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the BLOCK-ENTRY token and append it to the queue. - token := yaml_token_t{ - typ: yaml_BLOCK_ENTRY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the KEY token. -func yaml_parser_fetch_key(parser *yaml_parser_t) bool { - - // In the block context, additional checks are required. - if parser.flow_level == 0 { - // Check if we are allowed to start a new key (not nessesary simple). - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "mapping keys are not allowed in this context") - } - // Add the BLOCK-MAPPING-START token if needed. - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { - return false - } - } - - // Reset any potential simple keys on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Simple keys are allowed after '?' in the block context. - parser.simple_key_allowed = parser.flow_level == 0 - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the KEY token and append it to the queue. - token := yaml_token_t{ - typ: yaml_KEY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the VALUE token. -func yaml_parser_fetch_value(parser *yaml_parser_t) bool { - - simple_key := &parser.simple_keys[len(parser.simple_keys)-1] - - // Have we found a simple key? - if simple_key.possible { - // Create the KEY token and insert it into the queue. - token := yaml_token_t{ - typ: yaml_KEY_TOKEN, - start_mark: simple_key.mark, - end_mark: simple_key.mark, - } - yaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token) - - // In the block context, we may need to add the BLOCK-MAPPING-START token. - if !yaml_parser_roll_indent(parser, simple_key.mark.column, - simple_key.token_number, - yaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) { - return false - } - - // Remove the simple key. - simple_key.possible = false - - // A simple key cannot follow another simple key. - parser.simple_key_allowed = false - - } else { - // The ':' indicator follows a complex key. - - // In the block context, extra checks are required. - if parser.flow_level == 0 { - - // Check if we are allowed to start a complex value. - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "mapping values are not allowed in this context") - } - - // Add the BLOCK-MAPPING-START token if needed. - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { - return false - } - } - - // Simple keys after ':' are allowed in the block context. - parser.simple_key_allowed = parser.flow_level == 0 - } - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the VALUE token and append it to the queue. - token := yaml_token_t{ - typ: yaml_VALUE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the ALIAS or ANCHOR token. -func yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // An anchor or an alias could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow an anchor or an alias. - parser.simple_key_allowed = false - - // Create the ALIAS or ANCHOR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_anchor(parser, &token, typ) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the TAG token. -func yaml_parser_fetch_tag(parser *yaml_parser_t) bool { - // A tag could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow a tag. - parser.simple_key_allowed = false - - // Create the TAG token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_tag(parser, &token) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. -func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool { - // Remove any potential simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // A simple key may follow a block scalar. - parser.simple_key_allowed = true - - // Create the SCALAR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_block_scalar(parser, &token, literal) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. -func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool { - // A plain scalar could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow a flow scalar. - parser.simple_key_allowed = false - - // Create the SCALAR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_flow_scalar(parser, &token, single) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the SCALAR(...,plain) token. -func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool { - // A plain scalar could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow a flow scalar. - parser.simple_key_allowed = false - - // Create the SCALAR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_plain_scalar(parser, &token) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Eat whitespaces and comments until the next token is found. -func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { - - // Until the next token is not found. - for { - // Allow the BOM mark to start a line. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) { - skip(parser) - } - - // Eat whitespaces. - // Tabs are allowed: - // - in the flow context - // - in the block context, but not at the beginning of the line or - // after '-', '?', or ':' (complex value). - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Eat a comment until a line break. - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - } - - // If it is a line break, eat it. - if is_break(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - skip_line(parser) - - // In the block context, a new line may start a simple key. - if parser.flow_level == 0 { - parser.simple_key_allowed = true - } - } else { - break // We have found a token. - } - } - - return true -} - -// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// -func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool { - // Eat '%'. - start_mark := parser.mark - skip(parser) - - // Scan the directive name. - var name []byte - if !yaml_parser_scan_directive_name(parser, start_mark, &name) { - return false - } - - // Is it a YAML directive? - if bytes.Equal(name, []byte("YAML")) { - // Scan the VERSION directive value. - var major, minor int8 - if !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) { - return false - } - end_mark := parser.mark - - // Create a VERSION-DIRECTIVE token. - *token = yaml_token_t{ - typ: yaml_VERSION_DIRECTIVE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - major: major, - minor: minor, - } - - // Is it a TAG directive? - } else if bytes.Equal(name, []byte("TAG")) { - // Scan the TAG directive value. - var handle, prefix []byte - if !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) { - return false - } - end_mark := parser.mark - - // Create a TAG-DIRECTIVE token. - *token = yaml_token_t{ - typ: yaml_TAG_DIRECTIVE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: handle, - prefix: prefix, - } - - // Unknown directive. - } else { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found unknown directive name") - return false - } - - // Eat the rest of the line including any comments. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - } - - // Check if we are at the end of the line. - if !is_breakz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "did not find expected comment or line break") - return false - } - - // Eat a line break. - if is_break(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - skip_line(parser) - } - - return true -} - -// Scan the directive name. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^ -// -func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool { - // Consume the directive name. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - var s []byte - for is_alpha(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check if the name is empty. - if len(s) == 0 { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "could not find expected directive name") - return false - } - - // Check for an blank character after the name. - if !is_blankz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found unexpected non-alphabetical character") - return false - } - *name = s - return true -} - -// Scan the value of VERSION-DIRECTIVE. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^ -func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool { - // Eat whitespaces. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Consume the major version number. - if !yaml_parser_scan_version_directive_number(parser, start_mark, major) { - return false - } - - // Eat '.'. - if parser.buffer[parser.buffer_pos] != '.' { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "did not find expected digit or '.' character") - } - - skip(parser) - - // Consume the minor version number. - if !yaml_parser_scan_version_directive_number(parser, start_mark, minor) { - return false - } - return true -} - -const max_number_length = 2 - -// Scan the version number of VERSION-DIRECTIVE. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^ -// %YAML 1.1 # a comment \n -// ^ -func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool { - - // Repeat while the next character is digit. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - var value, length int8 - for is_digit(parser.buffer, parser.buffer_pos) { - // Check if the number is too long. - length++ - if length > max_number_length { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "found extremely long version number") - } - value = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos)) - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check if the number was present. - if length == 0 { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "did not find expected version number") - } - *number = value - return true -} - -// Scan the value of a TAG-DIRECTIVE token. -// -// Scope: -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// -func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool { - var handle_value, prefix_value []byte - - // Eat whitespaces. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Scan a handle. - if !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) { - return false - } - - // Expect a whitespace. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if !is_blank(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", - start_mark, "did not find expected whitespace") - return false - } - - // Eat whitespaces. - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Scan a prefix. - if !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) { - return false - } - - // Expect a whitespace or line break. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if !is_blankz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", - start_mark, "did not find expected whitespace or line break") - return false - } - - *handle = handle_value - *prefix = prefix_value - return true -} - -func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool { - var s []byte - - // Eat the indicator character. - start_mark := parser.mark - skip(parser) - - // Consume the value. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_alpha(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - end_mark := parser.mark - - /* - * Check if length of the anchor is greater than 0 and it is followed by - * a whitespace character or one of the indicators: - * - * '?', ':', ',', ']', '}', '%', '@', '`'. - */ - - if len(s) == 0 || - !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' || - parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' || - parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' || - parser.buffer[parser.buffer_pos] == '`') { - context := "while scanning an alias" - if typ == yaml_ANCHOR_TOKEN { - context = "while scanning an anchor" - } - yaml_parser_set_scanner_error(parser, context, start_mark, - "did not find expected alphabetic or numeric character") - return false - } - - // Create a token. - *token = yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - value: s, - } - - return true -} - -/* - * Scan a TAG token. - */ - -func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool { - var handle, suffix []byte - - start_mark := parser.mark - - // Check if the tag is in the canonical form. - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - if parser.buffer[parser.buffer_pos+1] == '<' { - // Keep the handle as '' - - // Eat '!<' - skip(parser) - skip(parser) - - // Consume the tag value. - if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { - return false - } - - // Check for '>' and eat it. - if parser.buffer[parser.buffer_pos] != '>' { - yaml_parser_set_scanner_error(parser, "while scanning a tag", - start_mark, "did not find the expected '>'") - return false - } - - skip(parser) - } else { - // The tag has either the '!suffix' or the '!handle!suffix' form. - - // First, try to scan a handle. - if !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) { - return false - } - - // Check if it is, indeed, handle. - if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' { - // Scan the suffix now. - if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { - return false - } - } else { - // It wasn't a handle after all. Scan the rest of the tag. - if !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) { - return false - } - - // Set the handle to '!'. - handle = []byte{'!'} - - // A special case: the '!' tag. Set the handle to '' and the - // suffix to '!'. - if len(suffix) == 0 { - handle, suffix = suffix, handle - } - } - } - - // Check the character which ends the tag. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if !is_blankz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a tag", - start_mark, "did not find expected whitespace or line break") - return false - } - - end_mark := parser.mark - - // Create a token. - *token = yaml_token_t{ - typ: yaml_TAG_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: handle, - suffix: suffix, - } - return true -} - -// Scan a tag handle. -func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool { - // Check the initial '!' character. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if parser.buffer[parser.buffer_pos] != '!' { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected '!'") - return false - } - - var s []byte - - // Copy the '!' character. - s = read(parser, s) - - // Copy all subsequent alphabetical and numerical characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_alpha(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check if the trailing character is '!' and copy it. - if parser.buffer[parser.buffer_pos] == '!' { - s = read(parser, s) - } else { - // It's either the '!' tag or not really a tag handle. If it's a %TAG - // directive, it's an error. If it's a tag token, it must be a part of URI. - if directive && string(s) != "!" { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected '!'") - return false - } - } - - *handle = s - return true -} - -// Scan a tag. -func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool { - //size_t length = head ? strlen((char *)head) : 0 - var s []byte - hasTag := len(head) > 0 - - // Copy the head if needed. - // - // Note that we don't copy the leading '!' character. - if len(head) > 1 { - s = append(s, head[1:]...) - } - - // Scan the tag. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - // The set of characters that may appear in URI is as follows: - // - // '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', - // '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']', - // '%'. - // [Go] Convert this into more reasonable logic. - for is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' || - parser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' || - parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' || - parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' || - parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' || - parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' || - parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' || - parser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\'' || - parser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' || - parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' || - parser.buffer[parser.buffer_pos] == '%' { - // Check if it is a URI-escape sequence. - if parser.buffer[parser.buffer_pos] == '%' { - if !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) { - return false - } - } else { - s = read(parser, s) - } - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - hasTag = true - } - - if !hasTag { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected tag URI") - return false - } - *uri = s - return true -} - -// Decode an URI-escape sequence corresponding to a single UTF-8 character. -func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool { - - // Decode the required number of characters. - w := 1024 - for w > 0 { - // Check for a URI-escaped octet. - if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { - return false - } - - if !(parser.buffer[parser.buffer_pos] == '%' && - is_hex(parser.buffer, parser.buffer_pos+1) && - is_hex(parser.buffer, parser.buffer_pos+2)) { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find URI escaped octet") - } - - // Get the octet. - octet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2)) - - // If it is the leading octet, determine the length of the UTF-8 sequence. - if w == 1024 { - w = width(octet) - if w == 0 { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "found an incorrect leading UTF-8 octet") - } - } else { - // Check if the trailing octet is correct. - if octet&0xC0 != 0x80 { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "found an incorrect trailing UTF-8 octet") - } - } - - // Copy the octet and move the pointers. - *s = append(*s, octet) - skip(parser) - skip(parser) - skip(parser) - w-- - } - return true -} - -// Scan a block scalar. -func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool { - // Eat the indicator '|' or '>'. - start_mark := parser.mark - skip(parser) - - // Scan the additional block scalar indicators. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - // Check for a chomping indicator. - var chomping, increment int - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - // Set the chomping method and eat the indicator. - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - skip(parser) - - // Check for an indentation indicator. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if is_digit(parser.buffer, parser.buffer_pos) { - // Check that the indentation is greater than 0. - if parser.buffer[parser.buffer_pos] == '0' { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an indentation indicator equal to 0") - return false - } - - // Get the indentation level and eat the indicator. - increment = as_digit(parser.buffer, parser.buffer_pos) - skip(parser) - } - - } else if is_digit(parser.buffer, parser.buffer_pos) { - // Do the same as above, but in the opposite order. - - if parser.buffer[parser.buffer_pos] == '0' { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an indentation indicator equal to 0") - return false - } - increment = as_digit(parser.buffer, parser.buffer_pos) - skip(parser) - - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - skip(parser) - } - } - - // Eat whitespaces and comments to the end of the line. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - } - - // Check if we are at the end of the line. - if !is_breakz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "did not find expected comment or line break") - return false - } - - // Eat a line break. - if is_break(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - skip_line(parser) - } - - end_mark := parser.mark - - // Set the indentation level if it was specified. - var indent int - if increment > 0 { - if parser.indent >= 0 { - indent = parser.indent + increment - } else { - indent = increment - } - } - - // Scan the leading line breaks and determine the indentation level if needed. - var s, leading_break, trailing_breaks []byte - if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { - return false - } - - // Scan the block scalar content. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - var leading_blank, trailing_blank bool - for parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) { - // We are at the beginning of a non-empty line. - - // Is it a trailing whitespace? - trailing_blank = is_blank(parser.buffer, parser.buffer_pos) - - // Check if we need to fold the leading line break. - if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' { - // Do we need to join the lines by space? - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } - } else { - s = append(s, leading_break...) - } - leading_break = leading_break[:0] - - // Append the remaining line breaks. - s = append(s, trailing_breaks...) - trailing_breaks = trailing_breaks[:0] - - // Is it a leading whitespace? - leading_blank = is_blank(parser.buffer, parser.buffer_pos) - - // Consume the current line. - for !is_breakz(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Consume the line break. - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - leading_break = read_line(parser, leading_break) - - // Eat the following indentation spaces and line breaks. - if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { - return false - } - } - - // Chomp the tail. - if chomping != -1 { - s = append(s, leading_break...) - } - if chomping == 1 { - s = append(s, trailing_breaks...) - } - - // Create a token. - *token = yaml_token_t{ - typ: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_LITERAL_SCALAR_STYLE, - } - if !literal { - token.style = yaml_FOLDED_SCALAR_STYLE - } - return true -} - -// Scan indentation spaces and line breaks for a block scalar. Determine the -// indentation level if needed. -func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool { - *end_mark = parser.mark - - // Eat the indentation spaces and line breaks. - max_indent := 0 - for { - // Eat the indentation spaces. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - if parser.mark.column > max_indent { - max_indent = parser.mark.column - } - - // Check for a tab character messing the indentation. - if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) { - return yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found a tab character where an indentation space is expected") - } - - // Have we found a non-empty line? - if !is_break(parser.buffer, parser.buffer_pos) { - break - } - - // Consume the line break. - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - // [Go] Should really be returning breaks instead. - *breaks = read_line(parser, *breaks) - *end_mark = parser.mark - } - - // Determine the indentation level if needed. - if *indent == 0 { - *indent = max_indent - if *indent < parser.indent+1 { - *indent = parser.indent + 1 - } - if *indent < 1 { - *indent = 1 - } - } - return true -} - -// Scan a quoted scalar. -func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool { - // Eat the left quote. - start_mark := parser.mark - skip(parser) - - // Consume the content of the quoted scalar. - var s, leading_break, trailing_breaks, whitespaces []byte - for { - // Check that there are no document indicators at the beginning of the line. - if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { - return false - } - - if parser.mark.column == 0 && - ((parser.buffer[parser.buffer_pos+0] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos+0] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - is_blankz(parser.buffer, parser.buffer_pos+3) { - yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", - start_mark, "found unexpected document indicator") - return false - } - - // Check for EOF. - if is_z(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", - start_mark, "found unexpected end of stream") - return false - } - - // Consume non-blank characters. - leading_blanks := false - for !is_blankz(parser.buffer, parser.buffer_pos) { - if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' { - // Is is an escaped single quote. - s = append(s, '\'') - skip(parser) - skip(parser) - - } else if single && parser.buffer[parser.buffer_pos] == '\'' { - // It is a right single quote. - break - } else if !single && parser.buffer[parser.buffer_pos] == '"' { - // It is a right double quote. - break - - } else if !single && parser.buffer[parser.buffer_pos] == '\\' && is_break(parser.buffer, parser.buffer_pos+1) { - // It is an escaped line break. - if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { - return false - } - skip(parser) - skip_line(parser) - leading_blanks = true - break - - } else if !single && parser.buffer[parser.buffer_pos] == '\\' { - // It is an escape sequence. - code_length := 0 - - // Check the escape character. - switch parser.buffer[parser.buffer_pos+1] { - case '0': - s = append(s, 0) - case 'a': - s = append(s, '\x07') - case 'b': - s = append(s, '\x08') - case 't', '\t': - s = append(s, '\x09') - case 'n': - s = append(s, '\x0A') - case 'v': - s = append(s, '\x0B') - case 'f': - s = append(s, '\x0C') - case 'r': - s = append(s, '\x0D') - case 'e': - s = append(s, '\x1B') - case ' ': - s = append(s, '\x20') - case '"': - s = append(s, '"') - case '\'': - s = append(s, '\'') - case '\\': - s = append(s, '\\') - case 'N': // NEL (#x85) - s = append(s, '\xC2') - s = append(s, '\x85') - case '_': // #xA0 - s = append(s, '\xC2') - s = append(s, '\xA0') - case 'L': // LS (#x2028) - s = append(s, '\xE2') - s = append(s, '\x80') - s = append(s, '\xA8') - case 'P': // PS (#x2029) - s = append(s, '\xE2') - s = append(s, '\x80') - s = append(s, '\xA9') - case 'x': - code_length = 2 - case 'u': - code_length = 4 - case 'U': - code_length = 8 - default: - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "found unknown escape character") - return false - } - - skip(parser) - skip(parser) - - // Consume an arbitrary escape code. - if code_length > 0 { - var value int - - // Scan the character value. - if parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) { - return false - } - for k := 0; k < code_length; k++ { - if !is_hex(parser.buffer, parser.buffer_pos+k) { - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "did not find expected hexdecimal number") - return false - } - value = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k) - } - - // Check the value and write the character. - if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF { - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "found invalid Unicode character escape code") - return false - } - if value <= 0x7F { - s = append(s, byte(value)) - } else if value <= 0x7FF { - s = append(s, byte(0xC0+(value>>6))) - s = append(s, byte(0x80+(value&0x3F))) - } else if value <= 0xFFFF { - s = append(s, byte(0xE0+(value>>12))) - s = append(s, byte(0x80+((value>>6)&0x3F))) - s = append(s, byte(0x80+(value&0x3F))) - } else { - s = append(s, byte(0xF0+(value>>18))) - s = append(s, byte(0x80+((value>>12)&0x3F))) - s = append(s, byte(0x80+((value>>6)&0x3F))) - s = append(s, byte(0x80+(value&0x3F))) - } - - // Advance the pointer. - for k := 0; k < code_length; k++ { - skip(parser) - } - } - } else { - // It is a non-escaped non-blank character. - s = read(parser, s) - } - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - } - - // Check if we are at the end of the scalar. - if single { - if parser.buffer[parser.buffer_pos] == '\'' { - break - } - } else { - if parser.buffer[parser.buffer_pos] == '"' { - break - } - } - - // Consume blank characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { - if is_blank(parser.buffer, parser.buffer_pos) { - // Consume a space or a tab character. - if !leading_blanks { - whitespaces = read(parser, whitespaces) - } else { - skip(parser) - } - } else { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - // Check if it is a first line break. - if !leading_blanks { - whitespaces = whitespaces[:0] - leading_break = read_line(parser, leading_break) - leading_blanks = true - } else { - trailing_breaks = read_line(parser, trailing_breaks) - } - } - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Join the whitespaces or fold line breaks. - if leading_blanks { - // Do we need to fold line breaks? - if len(leading_break) > 0 && leading_break[0] == '\n' { - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } else { - s = append(s, trailing_breaks...) - } - } else { - s = append(s, leading_break...) - s = append(s, trailing_breaks...) - } - trailing_breaks = trailing_breaks[:0] - leading_break = leading_break[:0] - } else { - s = append(s, whitespaces...) - whitespaces = whitespaces[:0] - } - } - - // Eat the right quote. - skip(parser) - end_mark := parser.mark - - // Create a token. - *token = yaml_token_t{ - typ: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_SINGLE_QUOTED_SCALAR_STYLE, - } - if !single { - token.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - return true -} - -// Scan a plain scalar. -func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool { - - var s, leading_break, trailing_breaks, whitespaces []byte - var leading_blanks bool - var indent = parser.indent + 1 - - start_mark := parser.mark - end_mark := parser.mark - - // Consume the content of the plain scalar. - for { - // Check for a document indicator. - if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { - return false - } - if parser.mark.column == 0 && - ((parser.buffer[parser.buffer_pos+0] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos+0] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - is_blankz(parser.buffer, parser.buffer_pos+3) { - break - } - - // Check for a comment. - if parser.buffer[parser.buffer_pos] == '#' { - break - } - - // Consume non-blank characters. - for !is_blankz(parser.buffer, parser.buffer_pos) { - - // Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". - if parser.flow_level > 0 && - parser.buffer[parser.buffer_pos] == ':' && - !is_blankz(parser.buffer, parser.buffer_pos+1) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found unexpected ':'") - return false - } - - // Check for indicators that may end a plain scalar. - if (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) || - (parser.flow_level > 0 && - (parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' || - parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || - parser.buffer[parser.buffer_pos] == '}')) { - break - } - - // Check if we need to join whitespaces and breaks. - if leading_blanks || len(whitespaces) > 0 { - if leading_blanks { - // Do we need to fold line breaks? - if leading_break[0] == '\n' { - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } else { - s = append(s, trailing_breaks...) - } - } else { - s = append(s, leading_break...) - s = append(s, trailing_breaks...) - } - trailing_breaks = trailing_breaks[:0] - leading_break = leading_break[:0] - leading_blanks = false - } else { - s = append(s, whitespaces...) - whitespaces = whitespaces[:0] - } - } - - // Copy the character. - s = read(parser, s) - - end_mark = parser.mark - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - } - - // Is it the end? - if !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) { - break - } - - // Consume blank characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { - if is_blank(parser.buffer, parser.buffer_pos) { - - // Check for tab character that abuse indentation. - if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate indentation") - return false - } - - // Consume a space or a tab character. - if !leading_blanks { - whitespaces = read(parser, whitespaces) - } else { - skip(parser) - } - } else { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - // Check if it is a first line break. - if !leading_blanks { - whitespaces = whitespaces[:0] - leading_break = read_line(parser, leading_break) - leading_blanks = true - } else { - trailing_breaks = read_line(parser, trailing_breaks) - } - } - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check indentation level. - if parser.flow_level == 0 && parser.mark.column < indent { - break - } - } - - // Create a token. - *token = yaml_token_t{ - typ: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_PLAIN_SCALAR_STYLE, - } - - // Note that we change the 'simple_key_allowed' flag. - if leading_blanks { - parser.simple_key_allowed = true - } - return true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/sorter.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/sorter.go deleted file mode 100644 index 5958822f..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/sorter.go +++ /dev/null @@ -1,104 +0,0 @@ -package yaml - -import ( - "reflect" - "unicode" -) - -type keyList []reflect.Value - -func (l keyList) Len() int { return len(l) } -func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l keyList) Less(i, j int) bool { - a := l[i] - b := l[j] - ak := a.Kind() - bk := b.Kind() - for (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() { - a = a.Elem() - ak = a.Kind() - } - for (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() { - b = b.Elem() - bk = b.Kind() - } - af, aok := keyFloat(a) - bf, bok := keyFloat(b) - if aok && bok { - if af != bf { - return af < bf - } - if ak != bk { - return ak < bk - } - return numLess(a, b) - } - if ak != reflect.String || bk != reflect.String { - return ak < bk - } - ar, br := []rune(a.String()), []rune(b.String()) - for i := 0; i < len(ar) && i < len(br); i++ { - if ar[i] == br[i] { - continue - } - al := unicode.IsLetter(ar[i]) - bl := unicode.IsLetter(br[i]) - if al && bl { - return ar[i] < br[i] - } - if al || bl { - return bl - } - var ai, bi int - var an, bn int64 - for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ { - an = an*10 + int64(ar[ai]-'0') - } - for bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ { - bn = bn*10 + int64(br[bi]-'0') - } - if an != bn { - return an < bn - } - if ai != bi { - return ai < bi - } - return ar[i] < br[i] - } - return len(ar) < len(br) -} - -// keyFloat returns a float value for v if it is a number/bool -// and whether it is a number/bool or not. -func keyFloat(v reflect.Value) (f float64, ok bool) { - switch v.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return float64(v.Int()), true - case reflect.Float32, reflect.Float64: - return v.Float(), true - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return float64(v.Uint()), true - case reflect.Bool: - if v.Bool() { - return 1, true - } - return 0, true - } - return 0, false -} - -// numLess returns whether a < b. -// a and b must necessarily have the same kind. -func numLess(a, b reflect.Value) bool { - switch a.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return a.Int() < b.Int() - case reflect.Float32, reflect.Float64: - return a.Float() < b.Float() - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return a.Uint() < b.Uint() - case reflect.Bool: - return !a.Bool() && b.Bool() - } - panic("not a number") -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/writerc.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/writerc.go deleted file mode 100644 index 190362f2..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/writerc.go +++ /dev/null @@ -1,89 +0,0 @@ -package yaml - -// Set the writer error and return false. -func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { - emitter.error = yaml_WRITER_ERROR - emitter.problem = problem - return false -} - -// Flush the output buffer. -func yaml_emitter_flush(emitter *yaml_emitter_t) bool { - if emitter.write_handler == nil { - panic("write handler not set") - } - - // Check if the buffer is empty. - if emitter.buffer_pos == 0 { - return true - } - - // If the output encoding is UTF-8, we don't need to recode the buffer. - if emitter.encoding == yaml_UTF8_ENCODING { - if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - emitter.buffer_pos = 0 - return true - } - - // Recode the buffer into the raw buffer. - var low, high int - if emitter.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - high, low = 1, 0 - } - - pos := 0 - for pos < emitter.buffer_pos { - // See the "reader.c" code for more details on UTF-8 encoding. Note - // that we assume that the buffer contains a valid UTF-8 sequence. - - // Read the next UTF-8 character. - octet := emitter.buffer[pos] - - var w int - var value rune - switch { - case octet&0x80 == 0x00: - w, value = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, value = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, value = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, value = 4, rune(octet&0x07) - } - for k := 1; k < w; k++ { - octet = emitter.buffer[pos+k] - value = (value << 6) + (rune(octet) & 0x3F) - } - pos += w - - // Write the character. - if value < 0x10000 { - var b [2]byte - b[high] = byte(value >> 8) - b[low] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1]) - } else { - // Write the character using a surrogate pair (check "reader.c"). - var b [4]byte - value -= 0x10000 - b[high] = byte(0xD8 + (value >> 18)) - b[low] = byte((value >> 10) & 0xFF) - b[high+2] = byte(0xDC + ((value >> 8) & 0xFF)) - b[low+2] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3]) - } - } - - // Write the raw buffer. - if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - emitter.buffer_pos = 0 - emitter.raw_buffer = emitter.raw_buffer[:0] - return true -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yaml.go deleted file mode 100644 index 5e3c2dae..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yaml.go +++ /dev/null @@ -1,357 +0,0 @@ -// Package yaml implements YAML support for the Go language. -// -// Source code and other details for the project are available at GitHub: -// -// https://github.com/go-yaml/yaml -// -package yaml - -import ( - "errors" - "fmt" - "reflect" - "strings" - "sync" -) - -// MapSlice encodes and decodes as a YAML map. -// The order of keys is preserved when encoding and decoding. -type MapSlice []MapItem - -// MapItem is an item in a MapSlice. -type MapItem struct { - Key, Value interface{} -} - -// The Unmarshaler interface may be implemented by types to customize their -// behavior when being unmarshaled from a YAML document. The UnmarshalYAML -// method receives a function that may be called to unmarshal the original -// YAML value into a field or variable. It is safe to call the unmarshal -// function parameter more than once if necessary. -type Unmarshaler interface { - UnmarshalYAML(unmarshal func(interface{}) error) error -} - -// The Marshaler interface may be implemented by types to customize their -// behavior when being marshaled into a YAML document. The returned value -// is marshaled in place of the original value implementing Marshaler. -// -// If an error is returned by MarshalYAML, the marshaling procedure stops -// and returns with the provided error. -type Marshaler interface { - MarshalYAML() (interface{}, error) -} - -// Unmarshal decodes the first document found within the in byte slice -// and assigns decoded values into the out value. -// -// Maps and pointers (to a struct, string, int, etc) are accepted as out -// values. If an internal pointer within a struct is not initialized, -// the yaml package will initialize it if necessary for unmarshalling -// the provided data. The out parameter must not be nil. -// -// The type of the decoded values should be compatible with the respective -// values in out. If one or more values cannot be decoded due to a type -// mismatches, decoding continues partially until the end of the YAML -// content, and a *yaml.TypeError is returned with details for all -// missed values. -// -// Struct fields are only unmarshalled if they are exported (have an -// upper case first letter), and are unmarshalled using the field name -// lowercased as the default key. Custom keys may be defined via the -// "yaml" name in the field tag: the content preceding the first comma -// is used as the key, and the following comma-separated options are -// used to tweak the marshalling process (see Marshal). -// Conflicting names result in a runtime error. -// -// For example: -// -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// var t T -// yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) -// -// See the documentation of Marshal for the format of tags and a list of -// supported tag options. -// -func Unmarshal(in []byte, out interface{}) (err error) { - return unmarshal(in, out, false) -} - -// UnmarshalStrict is like Unmarshal except that any fields that are found -// in the data that do not have corresponding struct members will result in -// an error. -func UnmarshalStrict(in []byte, out interface{}) (err error) { - return unmarshal(in, out, true) -} - -func unmarshal(in []byte, out interface{}, strict bool) (err error) { - defer handleErr(&err) - d := newDecoder(strict) - p := newParser(in) - defer p.destroy() - node := p.parse() - if node != nil { - v := reflect.ValueOf(out) - if v.Kind() == reflect.Ptr && !v.IsNil() { - v = v.Elem() - } - d.unmarshal(node, v) - } - if len(d.terrors) > 0 { - return &TypeError{d.terrors} - } - return nil -} - -// Marshal serializes the value provided into a YAML document. The structure -// of the generated document will reflect the structure of the value itself. -// Maps and pointers (to struct, string, int, etc) are accepted as the in value. -// -// Struct fields are only unmarshalled if they are exported (have an upper case -// first letter), and are unmarshalled using the field name lowercased as the -// default key. Custom keys may be defined via the "yaml" name in the field -// tag: the content preceding the first comma is used as the key, and the -// following comma-separated options are used to tweak the marshalling process. -// Conflicting names result in a runtime error. -// -// The field tag format accepted is: -// -// `(...) yaml:"[][,[,]]" (...)` -// -// The following flags are currently supported: -// -// omitempty Only include the field if it's not set to the zero -// value for the type or to empty slices or maps. -// Does not apply to zero valued structs. -// -// flow Marshal using a flow style (useful for structs, -// sequences and maps). -// -// inline Inline the field, which must be a struct or a map, -// causing all of its fields or keys to be processed as if -// they were part of the outer struct. For maps, keys must -// not conflict with the yaml keys of other struct fields. -// -// In addition, if the key is "-", the field is ignored. -// -// For example: -// -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" -// yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" -// -func Marshal(in interface{}) (out []byte, err error) { - defer handleErr(&err) - e := newEncoder() - defer e.destroy() - e.marshal("", reflect.ValueOf(in)) - e.finish() - out = e.out - return -} - -func handleErr(err *error) { - if v := recover(); v != nil { - if e, ok := v.(yamlError); ok { - *err = e.err - } else { - panic(v) - } - } -} - -type yamlError struct { - err error -} - -func fail(err error) { - panic(yamlError{err}) -} - -func failf(format string, args ...interface{}) { - panic(yamlError{fmt.Errorf("yaml: "+format, args...)}) -} - -// A TypeError is returned by Unmarshal when one or more fields in -// the YAML document cannot be properly decoded into the requested -// types. When this error is returned, the value is still -// unmarshaled partially. -type TypeError struct { - Errors []string -} - -func (e *TypeError) Error() string { - return fmt.Sprintf("yaml: unmarshal errors:\n %s", strings.Join(e.Errors, "\n ")) -} - -// -------------------------------------------------------------------------- -// Maintain a mapping of keys to structure field indexes - -// The code in this section was copied from mgo/bson. - -// structInfo holds details for the serialization of fields of -// a given struct. -type structInfo struct { - FieldsMap map[string]fieldInfo - FieldsList []fieldInfo - - // InlineMap is the number of the field in the struct that - // contains an ,inline map, or -1 if there's none. - InlineMap int -} - -type fieldInfo struct { - Key string - Num int - OmitEmpty bool - Flow bool - - // Inline holds the field index if the field is part of an inlined struct. - Inline []int -} - -var structMap = make(map[reflect.Type]*structInfo) -var fieldMapMutex sync.RWMutex - -func getStructInfo(st reflect.Type) (*structInfo, error) { - fieldMapMutex.RLock() - sinfo, found := structMap[st] - fieldMapMutex.RUnlock() - if found { - return sinfo, nil - } - - n := st.NumField() - fieldsMap := make(map[string]fieldInfo) - fieldsList := make([]fieldInfo, 0, n) - inlineMap := -1 - for i := 0; i != n; i++ { - field := st.Field(i) - if field.PkgPath != "" && !field.Anonymous { - continue // Private field - } - - info := fieldInfo{Num: i} - - tag := field.Tag.Get("yaml") - if tag == "" && strings.Index(string(field.Tag), ":") < 0 { - tag = string(field.Tag) - } - if tag == "-" { - continue - } - - inline := false - fields := strings.Split(tag, ",") - if len(fields) > 1 { - for _, flag := range fields[1:] { - switch flag { - case "omitempty": - info.OmitEmpty = true - case "flow": - info.Flow = true - case "inline": - inline = true - default: - return nil, errors.New(fmt.Sprintf("Unsupported flag %q in tag %q of type %s", flag, tag, st)) - } - } - tag = fields[0] - } - - if inline { - switch field.Type.Kind() { - case reflect.Map: - if inlineMap >= 0 { - return nil, errors.New("Multiple ,inline maps in struct " + st.String()) - } - if field.Type.Key() != reflect.TypeOf("") { - return nil, errors.New("Option ,inline needs a map with string keys in struct " + st.String()) - } - inlineMap = info.Num - case reflect.Struct: - sinfo, err := getStructInfo(field.Type) - if err != nil { - return nil, err - } - for _, finfo := range sinfo.FieldsList { - if _, found := fieldsMap[finfo.Key]; found { - msg := "Duplicated key '" + finfo.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - if finfo.Inline == nil { - finfo.Inline = []int{i, finfo.Num} - } else { - finfo.Inline = append([]int{i}, finfo.Inline...) - } - fieldsMap[finfo.Key] = finfo - fieldsList = append(fieldsList, finfo) - } - default: - //return nil, errors.New("Option ,inline needs a struct value or map field") - return nil, errors.New("Option ,inline needs a struct value field") - } - continue - } - - if tag != "" { - info.Key = tag - } else { - info.Key = strings.ToLower(field.Name) - } - - if _, found = fieldsMap[info.Key]; found { - msg := "Duplicated key '" + info.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - - fieldsList = append(fieldsList, info) - fieldsMap[info.Key] = info - } - - sinfo = &structInfo{fieldsMap, fieldsList, inlineMap} - - fieldMapMutex.Lock() - structMap[st] = sinfo - fieldMapMutex.Unlock() - return sinfo, nil -} - -func isZero(v reflect.Value) bool { - switch v.Kind() { - case reflect.String: - return len(v.String()) == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - case reflect.Slice: - return v.Len() == 0 - case reflect.Map: - return v.Len() == 0 - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Struct: - vt := v.Type() - for i := v.NumField() - 1; i >= 0; i-- { - if vt.Field(i).PkgPath != "" { - continue // Private field - } - if !isZero(v.Field(i)) { - return false - } - } - return true - } - return false -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlh.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlh.go deleted file mode 100644 index 3caeca04..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlh.go +++ /dev/null @@ -1,716 +0,0 @@ -package yaml - -import ( - "io" -) - -// The version directive data. -type yaml_version_directive_t struct { - major int8 // The major version number. - minor int8 // The minor version number. -} - -// The tag directive data. -type yaml_tag_directive_t struct { - handle []byte // The tag handle. - prefix []byte // The tag prefix. -} - -type yaml_encoding_t int - -// The stream encoding. -const ( - // Let the parser choose the encoding. - yaml_ANY_ENCODING yaml_encoding_t = iota - - yaml_UTF8_ENCODING // The default UTF-8 encoding. - yaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM. - yaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM. -) - -type yaml_break_t int - -// Line break types. -const ( - // Let the parser choose the break type. - yaml_ANY_BREAK yaml_break_t = iota - - yaml_CR_BREAK // Use CR for line breaks (Mac style). - yaml_LN_BREAK // Use LN for line breaks (Unix style). - yaml_CRLN_BREAK // Use CR LN for line breaks (DOS style). -) - -type yaml_error_type_t int - -// Many bad things could happen with the parser and emitter. -const ( - // No error is produced. - yaml_NO_ERROR yaml_error_type_t = iota - - yaml_MEMORY_ERROR // Cannot allocate or reallocate a block of memory. - yaml_READER_ERROR // Cannot read or decode the input stream. - yaml_SCANNER_ERROR // Cannot scan the input stream. - yaml_PARSER_ERROR // Cannot parse the input stream. - yaml_COMPOSER_ERROR // Cannot compose a YAML document. - yaml_WRITER_ERROR // Cannot write to the output stream. - yaml_EMITTER_ERROR // Cannot emit a YAML stream. -) - -// The pointer position. -type yaml_mark_t struct { - index int // The position index. - line int // The position line. - column int // The position column. -} - -// Node Styles - -type yaml_style_t int8 - -type yaml_scalar_style_t yaml_style_t - -// Scalar styles. -const ( - // Let the emitter choose the style. - yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota - - yaml_PLAIN_SCALAR_STYLE // The plain scalar style. - yaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style. - yaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style. - yaml_LITERAL_SCALAR_STYLE // The literal scalar style. - yaml_FOLDED_SCALAR_STYLE // The folded scalar style. -) - -type yaml_sequence_style_t yaml_style_t - -// Sequence styles. -const ( - // Let the emitter choose the style. - yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota - - yaml_BLOCK_SEQUENCE_STYLE // The block sequence style. - yaml_FLOW_SEQUENCE_STYLE // The flow sequence style. -) - -type yaml_mapping_style_t yaml_style_t - -// Mapping styles. -const ( - // Let the emitter choose the style. - yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota - - yaml_BLOCK_MAPPING_STYLE // The block mapping style. - yaml_FLOW_MAPPING_STYLE // The flow mapping style. -) - -// Tokens - -type yaml_token_type_t int - -// Token types. -const ( - // An empty token. - yaml_NO_TOKEN yaml_token_type_t = iota - - yaml_STREAM_START_TOKEN // A STREAM-START token. - yaml_STREAM_END_TOKEN // A STREAM-END token. - - yaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token. - yaml_TAG_DIRECTIVE_TOKEN // A TAG-DIRECTIVE token. - yaml_DOCUMENT_START_TOKEN // A DOCUMENT-START token. - yaml_DOCUMENT_END_TOKEN // A DOCUMENT-END token. - - yaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token. - yaml_BLOCK_MAPPING_START_TOKEN // A BLOCK-SEQUENCE-END token. - yaml_BLOCK_END_TOKEN // A BLOCK-END token. - - yaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token. - yaml_FLOW_SEQUENCE_END_TOKEN // A FLOW-SEQUENCE-END token. - yaml_FLOW_MAPPING_START_TOKEN // A FLOW-MAPPING-START token. - yaml_FLOW_MAPPING_END_TOKEN // A FLOW-MAPPING-END token. - - yaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token. - yaml_FLOW_ENTRY_TOKEN // A FLOW-ENTRY token. - yaml_KEY_TOKEN // A KEY token. - yaml_VALUE_TOKEN // A VALUE token. - - yaml_ALIAS_TOKEN // An ALIAS token. - yaml_ANCHOR_TOKEN // An ANCHOR token. - yaml_TAG_TOKEN // A TAG token. - yaml_SCALAR_TOKEN // A SCALAR token. -) - -func (tt yaml_token_type_t) String() string { - switch tt { - case yaml_NO_TOKEN: - return "yaml_NO_TOKEN" - case yaml_STREAM_START_TOKEN: - return "yaml_STREAM_START_TOKEN" - case yaml_STREAM_END_TOKEN: - return "yaml_STREAM_END_TOKEN" - case yaml_VERSION_DIRECTIVE_TOKEN: - return "yaml_VERSION_DIRECTIVE_TOKEN" - case yaml_TAG_DIRECTIVE_TOKEN: - return "yaml_TAG_DIRECTIVE_TOKEN" - case yaml_DOCUMENT_START_TOKEN: - return "yaml_DOCUMENT_START_TOKEN" - case yaml_DOCUMENT_END_TOKEN: - return "yaml_DOCUMENT_END_TOKEN" - case yaml_BLOCK_SEQUENCE_START_TOKEN: - return "yaml_BLOCK_SEQUENCE_START_TOKEN" - case yaml_BLOCK_MAPPING_START_TOKEN: - return "yaml_BLOCK_MAPPING_START_TOKEN" - case yaml_BLOCK_END_TOKEN: - return "yaml_BLOCK_END_TOKEN" - case yaml_FLOW_SEQUENCE_START_TOKEN: - return "yaml_FLOW_SEQUENCE_START_TOKEN" - case yaml_FLOW_SEQUENCE_END_TOKEN: - return "yaml_FLOW_SEQUENCE_END_TOKEN" - case yaml_FLOW_MAPPING_START_TOKEN: - return "yaml_FLOW_MAPPING_START_TOKEN" - case yaml_FLOW_MAPPING_END_TOKEN: - return "yaml_FLOW_MAPPING_END_TOKEN" - case yaml_BLOCK_ENTRY_TOKEN: - return "yaml_BLOCK_ENTRY_TOKEN" - case yaml_FLOW_ENTRY_TOKEN: - return "yaml_FLOW_ENTRY_TOKEN" - case yaml_KEY_TOKEN: - return "yaml_KEY_TOKEN" - case yaml_VALUE_TOKEN: - return "yaml_VALUE_TOKEN" - case yaml_ALIAS_TOKEN: - return "yaml_ALIAS_TOKEN" - case yaml_ANCHOR_TOKEN: - return "yaml_ANCHOR_TOKEN" - case yaml_TAG_TOKEN: - return "yaml_TAG_TOKEN" - case yaml_SCALAR_TOKEN: - return "yaml_SCALAR_TOKEN" - } - return "" -} - -// The token structure. -type yaml_token_t struct { - // The token type. - typ yaml_token_type_t - - // The start/end of the token. - start_mark, end_mark yaml_mark_t - - // The stream encoding (for yaml_STREAM_START_TOKEN). - encoding yaml_encoding_t - - // The alias/anchor/scalar value or tag/tag directive handle - // (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN). - value []byte - - // The tag suffix (for yaml_TAG_TOKEN). - suffix []byte - - // The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN). - prefix []byte - - // The scalar style (for yaml_SCALAR_TOKEN). - style yaml_scalar_style_t - - // The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN). - major, minor int8 -} - -// Events - -type yaml_event_type_t int8 - -// Event types. -const ( - // An empty event. - yaml_NO_EVENT yaml_event_type_t = iota - - yaml_STREAM_START_EVENT // A STREAM-START event. - yaml_STREAM_END_EVENT // A STREAM-END event. - yaml_DOCUMENT_START_EVENT // A DOCUMENT-START event. - yaml_DOCUMENT_END_EVENT // A DOCUMENT-END event. - yaml_ALIAS_EVENT // An ALIAS event. - yaml_SCALAR_EVENT // A SCALAR event. - yaml_SEQUENCE_START_EVENT // A SEQUENCE-START event. - yaml_SEQUENCE_END_EVENT // A SEQUENCE-END event. - yaml_MAPPING_START_EVENT // A MAPPING-START event. - yaml_MAPPING_END_EVENT // A MAPPING-END event. -) - -// The event structure. -type yaml_event_t struct { - - // The event type. - typ yaml_event_type_t - - // The start and end of the event. - start_mark, end_mark yaml_mark_t - - // The document encoding (for yaml_STREAM_START_EVENT). - encoding yaml_encoding_t - - // The version directive (for yaml_DOCUMENT_START_EVENT). - version_directive *yaml_version_directive_t - - // The list of tag directives (for yaml_DOCUMENT_START_EVENT). - tag_directives []yaml_tag_directive_t - - // The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT). - anchor []byte - - // The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). - tag []byte - - // The scalar value (for yaml_SCALAR_EVENT). - value []byte - - // Is the document start/end indicator implicit, or the tag optional? - // (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT). - implicit bool - - // Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT). - quoted_implicit bool - - // The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). - style yaml_style_t -} - -func (e *yaml_event_t) scalar_style() yaml_scalar_style_t { return yaml_scalar_style_t(e.style) } -func (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) } -func (e *yaml_event_t) mapping_style() yaml_mapping_style_t { return yaml_mapping_style_t(e.style) } - -// Nodes - -const ( - yaml_NULL_TAG = "tag:yaml.org,2002:null" // The tag !!null with the only possible value: null. - yaml_BOOL_TAG = "tag:yaml.org,2002:bool" // The tag !!bool with the values: true and false. - yaml_STR_TAG = "tag:yaml.org,2002:str" // The tag !!str for string values. - yaml_INT_TAG = "tag:yaml.org,2002:int" // The tag !!int for integer values. - yaml_FLOAT_TAG = "tag:yaml.org,2002:float" // The tag !!float for float values. - yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values. - - yaml_SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences. - yaml_MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping. - - // Not in original libyaml. - yaml_BINARY_TAG = "tag:yaml.org,2002:binary" - yaml_MERGE_TAG = "tag:yaml.org,2002:merge" - - yaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG // The default scalar tag is !!str. - yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq. - yaml_DEFAULT_MAPPING_TAG = yaml_MAP_TAG // The default mapping tag is !!map. -) - -type yaml_node_type_t int - -// Node types. -const ( - // An empty node. - yaml_NO_NODE yaml_node_type_t = iota - - yaml_SCALAR_NODE // A scalar node. - yaml_SEQUENCE_NODE // A sequence node. - yaml_MAPPING_NODE // A mapping node. -) - -// An element of a sequence node. -type yaml_node_item_t int - -// An element of a mapping node. -type yaml_node_pair_t struct { - key int // The key of the element. - value int // The value of the element. -} - -// The node structure. -type yaml_node_t struct { - typ yaml_node_type_t // The node type. - tag []byte // The node tag. - - // The node data. - - // The scalar parameters (for yaml_SCALAR_NODE). - scalar struct { - value []byte // The scalar value. - length int // The length of the scalar value. - style yaml_scalar_style_t // The scalar style. - } - - // The sequence parameters (for YAML_SEQUENCE_NODE). - sequence struct { - items_data []yaml_node_item_t // The stack of sequence items. - style yaml_sequence_style_t // The sequence style. - } - - // The mapping parameters (for yaml_MAPPING_NODE). - mapping struct { - pairs_data []yaml_node_pair_t // The stack of mapping pairs (key, value). - pairs_start *yaml_node_pair_t // The beginning of the stack. - pairs_end *yaml_node_pair_t // The end of the stack. - pairs_top *yaml_node_pair_t // The top of the stack. - style yaml_mapping_style_t // The mapping style. - } - - start_mark yaml_mark_t // The beginning of the node. - end_mark yaml_mark_t // The end of the node. - -} - -// The document structure. -type yaml_document_t struct { - - // The document nodes. - nodes []yaml_node_t - - // The version directive. - version_directive *yaml_version_directive_t - - // The list of tag directives. - tag_directives_data []yaml_tag_directive_t - tag_directives_start int // The beginning of the tag directives list. - tag_directives_end int // The end of the tag directives list. - - start_implicit int // Is the document start indicator implicit? - end_implicit int // Is the document end indicator implicit? - - // The start/end of the document. - start_mark, end_mark yaml_mark_t -} - -// The prototype of a read handler. -// -// The read handler is called when the parser needs to read more bytes from the -// source. The handler should write not more than size bytes to the buffer. -// The number of written bytes should be set to the size_read variable. -// -// [in,out] data A pointer to an application data specified by -// yaml_parser_set_input(). -// [out] buffer The buffer to write the data from the source. -// [in] size The size of the buffer. -// [out] size_read The actual number of bytes read from the source. -// -// On success, the handler should return 1. If the handler failed, -// the returned value should be 0. On EOF, the handler should set the -// size_read to 0 and return 1. -type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error) - -// This structure holds information about a potential simple key. -type yaml_simple_key_t struct { - possible bool // Is a simple key possible? - required bool // Is a simple key required? - token_number int // The number of the token. - mark yaml_mark_t // The position mark. -} - -// The states of the parser. -type yaml_parser_state_t int - -const ( - yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota - - yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE // Expect the beginning of an implicit document. - yaml_PARSE_DOCUMENT_START_STATE // Expect DOCUMENT-START. - yaml_PARSE_DOCUMENT_CONTENT_STATE // Expect the content of a document. - yaml_PARSE_DOCUMENT_END_STATE // Expect DOCUMENT-END. - yaml_PARSE_BLOCK_NODE_STATE // Expect a block node. - yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence. - yaml_PARSE_FLOW_NODE_STATE // Expect a flow node. - yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a block sequence. - yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE // Expect an entry of a block sequence. - yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE // Expect an entry of an indentless sequence. - yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. - yaml_PARSE_BLOCK_MAPPING_KEY_STATE // Expect a block mapping key. - yaml_PARSE_BLOCK_MAPPING_VALUE_STATE // Expect a block mapping value. - yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a flow sequence. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE // Expect an entry of a flow sequence. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE // Expect a key of an ordered mapping. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE // Expect the and of an ordered mapping entry. - yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. - yaml_PARSE_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. - yaml_PARSE_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. - yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE // Expect an empty value of a flow mapping. - yaml_PARSE_END_STATE // Expect nothing. -) - -func (ps yaml_parser_state_t) String() string { - switch ps { - case yaml_PARSE_STREAM_START_STATE: - return "yaml_PARSE_STREAM_START_STATE" - case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: - return "yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE" - case yaml_PARSE_DOCUMENT_START_STATE: - return "yaml_PARSE_DOCUMENT_START_STATE" - case yaml_PARSE_DOCUMENT_CONTENT_STATE: - return "yaml_PARSE_DOCUMENT_CONTENT_STATE" - case yaml_PARSE_DOCUMENT_END_STATE: - return "yaml_PARSE_DOCUMENT_END_STATE" - case yaml_PARSE_BLOCK_NODE_STATE: - return "yaml_PARSE_BLOCK_NODE_STATE" - case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: - return "yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE" - case yaml_PARSE_FLOW_NODE_STATE: - return "yaml_PARSE_FLOW_NODE_STATE" - case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: - return "yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE" - case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: - return "yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE" - case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: - return "yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE" - case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: - return "yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE" - case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: - return "yaml_PARSE_BLOCK_MAPPING_KEY_STATE" - case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: - return "yaml_PARSE_BLOCK_MAPPING_VALUE_STATE" - case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE" - case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: - return "yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE" - case yaml_PARSE_FLOW_MAPPING_KEY_STATE: - return "yaml_PARSE_FLOW_MAPPING_KEY_STATE" - case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: - return "yaml_PARSE_FLOW_MAPPING_VALUE_STATE" - case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: - return "yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE" - case yaml_PARSE_END_STATE: - return "yaml_PARSE_END_STATE" - } - return "" -} - -// This structure holds aliases data. -type yaml_alias_data_t struct { - anchor []byte // The anchor. - index int // The node id. - mark yaml_mark_t // The anchor mark. -} - -// The parser structure. -// -// All members are internal. Manage the structure using the -// yaml_parser_ family of functions. -type yaml_parser_t struct { - - // Error handling - - error yaml_error_type_t // Error type. - - problem string // Error description. - - // The byte about which the problem occurred. - problem_offset int - problem_value int - problem_mark yaml_mark_t - - // The error context. - context string - context_mark yaml_mark_t - - // Reader stuff - - read_handler yaml_read_handler_t // Read handler. - - input_file io.Reader // File input data. - input []byte // String input data. - input_pos int - - eof bool // EOF flag - - buffer []byte // The working buffer. - buffer_pos int // The current position of the buffer. - - unread int // The number of unread characters in the buffer. - - raw_buffer []byte // The raw buffer. - raw_buffer_pos int // The current position of the buffer. - - encoding yaml_encoding_t // The input encoding. - - offset int // The offset of the current position (in bytes). - mark yaml_mark_t // The mark of the current position. - - // Scanner stuff - - stream_start_produced bool // Have we started to scan the input stream? - stream_end_produced bool // Have we reached the end of the input stream? - - flow_level int // The number of unclosed '[' and '{' indicators. - - tokens []yaml_token_t // The tokens queue. - tokens_head int // The head of the tokens queue. - tokens_parsed int // The number of tokens fetched from the queue. - token_available bool // Does the tokens queue contain a token ready for dequeueing. - - indent int // The current indentation level. - indents []int // The indentation levels stack. - - simple_key_allowed bool // May a simple key occur at the current position? - simple_keys []yaml_simple_key_t // The stack of simple keys. - - // Parser stuff - - state yaml_parser_state_t // The current parser state. - states []yaml_parser_state_t // The parser states stack. - marks []yaml_mark_t // The stack of marks. - tag_directives []yaml_tag_directive_t // The list of TAG directives. - - // Dumper stuff - - aliases []yaml_alias_data_t // The alias data. - - document *yaml_document_t // The currently parsed document. -} - -// Emitter Definitions - -// The prototype of a write handler. -// -// The write handler is called when the emitter needs to flush the accumulated -// characters to the output. The handler should write @a size bytes of the -// @a buffer to the output. -// -// @param[in,out] data A pointer to an application data specified by -// yaml_emitter_set_output(). -// @param[in] buffer The buffer with bytes to be written. -// @param[in] size The size of the buffer. -// -// @returns On success, the handler should return @c 1. If the handler failed, -// the returned value should be @c 0. -// -type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error - -type yaml_emitter_state_t int - -// The emitter states. -const ( - // Expect STREAM-START. - yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota - - yaml_EMIT_FIRST_DOCUMENT_START_STATE // Expect the first DOCUMENT-START or STREAM-END. - yaml_EMIT_DOCUMENT_START_STATE // Expect DOCUMENT-START or STREAM-END. - yaml_EMIT_DOCUMENT_CONTENT_STATE // Expect the content of a document. - yaml_EMIT_DOCUMENT_END_STATE // Expect DOCUMENT-END. - yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a flow sequence. - yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE // Expect an item of a flow sequence. - yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. - yaml_EMIT_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. - yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a flow mapping. - yaml_EMIT_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. - yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a block sequence. - yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE // Expect an item of a block sequence. - yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. - yaml_EMIT_BLOCK_MAPPING_KEY_STATE // Expect the key of a block mapping. - yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping. - yaml_EMIT_BLOCK_MAPPING_VALUE_STATE // Expect a value of a block mapping. - yaml_EMIT_END_STATE // Expect nothing. -) - -// The emitter structure. -// -// All members are internal. Manage the structure using the @c yaml_emitter_ -// family of functions. -type yaml_emitter_t struct { - - // Error handling - - error yaml_error_type_t // Error type. - problem string // Error description. - - // Writer stuff - - write_handler yaml_write_handler_t // Write handler. - - output_buffer *[]byte // String output data. - output_file io.Writer // File output data. - - buffer []byte // The working buffer. - buffer_pos int // The current position of the buffer. - - raw_buffer []byte // The raw buffer. - raw_buffer_pos int // The current position of the buffer. - - encoding yaml_encoding_t // The stream encoding. - - // Emitter stuff - - canonical bool // If the output is in the canonical style? - best_indent int // The number of indentation spaces. - best_width int // The preferred width of the output lines. - unicode bool // Allow unescaped non-ASCII characters? - line_break yaml_break_t // The preferred line break. - - state yaml_emitter_state_t // The current emitter state. - states []yaml_emitter_state_t // The stack of states. - - events []yaml_event_t // The event queue. - events_head int // The head of the event queue. - - indents []int // The stack of indentation levels. - - tag_directives []yaml_tag_directive_t // The list of tag directives. - - indent int // The current indentation level. - - flow_level int // The current flow level. - - root_context bool // Is it the document root context? - sequence_context bool // Is it a sequence context? - mapping_context bool // Is it a mapping context? - simple_key_context bool // Is it a simple mapping key context? - - line int // The current line. - column int // The current column. - whitespace bool // If the last character was a whitespace? - indention bool // If the last character was an indentation character (' ', '-', '?', ':')? - open_ended bool // If an explicit document end is required? - - // Anchor analysis. - anchor_data struct { - anchor []byte // The anchor value. - alias bool // Is it an alias? - } - - // Tag analysis. - tag_data struct { - handle []byte // The tag handle. - suffix []byte // The tag suffix. - } - - // Scalar analysis. - scalar_data struct { - value []byte // The scalar value. - multiline bool // Does the scalar contain line breaks? - flow_plain_allowed bool // Can the scalar be expessed in the flow plain style? - block_plain_allowed bool // Can the scalar be expressed in the block plain style? - single_quoted_allowed bool // Can the scalar be expressed in the single quoted style? - block_allowed bool // Can the scalar be expressed in the literal or folded styles? - style yaml_scalar_style_t // The output style. - } - - // Dumper stuff - - opened bool // If the stream was already opened? - closed bool // If the stream was already closed? - - // The information associated with the document nodes. - anchors *struct { - references int // The number of references. - anchor int // The anchor id. - serialized bool // If the node has been emitted? - } - - last_anchor_id int // The last assigned anchor id. - - document *yaml_document_t // The currently emitted document. -} diff --git a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlprivateh.go b/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlprivateh.go deleted file mode 100644 index 8110ce3c..00000000 --- a/vendor/github.com/mattermost/mattermost-server/vendor/gopkg.in/yaml.v2/yamlprivateh.go +++ /dev/null @@ -1,173 +0,0 @@ -package yaml - -const ( - // The size of the input raw buffer. - input_raw_buffer_size = 512 - - // The size of the input buffer. - // It should be possible to decode the whole raw buffer. - input_buffer_size = input_raw_buffer_size * 3 - - // The size of the output buffer. - output_buffer_size = 128 - - // The size of the output raw buffer. - // It should be possible to encode the whole output buffer. - output_raw_buffer_size = (output_buffer_size*2 + 2) - - // The size of other stacks and queues. - initial_stack_size = 16 - initial_queue_size = 16 - initial_string_size = 16 -) - -// Check if the character at the specified position is an alphabetical -// character, a digit, '_', or '-'. -func is_alpha(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-' -} - -// Check if the character at the specified position is a digit. -func is_digit(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' -} - -// Get the value of a digit. -func as_digit(b []byte, i int) int { - return int(b[i]) - '0' -} - -// Check if the character at the specified position is a hex-digit. -func is_hex(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f' -} - -// Get the value of a hex-digit. -func as_hex(b []byte, i int) int { - bi := b[i] - if bi >= 'A' && bi <= 'F' { - return int(bi) - 'A' + 10 - } - if bi >= 'a' && bi <= 'f' { - return int(bi) - 'a' + 10 - } - return int(bi) - '0' -} - -// Check if the character is ASCII. -func is_ascii(b []byte, i int) bool { - return b[i] <= 0x7F -} - -// Check if the character at the start of the buffer can be printed unescaped. -func is_printable(b []byte, i int) bool { - return ((b[i] == 0x0A) || // . == #x0A - (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E - (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF - (b[i] > 0xC2 && b[i] < 0xED) || - (b[i] == 0xED && b[i+1] < 0xA0) || - (b[i] == 0xEE) || - (b[i] == 0xEF && // #xE000 <= . <= #xFFFD - !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF - !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) -} - -// Check if the character at the specified position is NUL. -func is_z(b []byte, i int) bool { - return b[i] == 0x00 -} - -// Check if the beginning of the buffer is a BOM. -func is_bom(b []byte, i int) bool { - return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF -} - -// Check if the character at the specified position is space. -func is_space(b []byte, i int) bool { - return b[i] == ' ' -} - -// Check if the character at the specified position is tab. -func is_tab(b []byte, i int) bool { - return b[i] == '\t' -} - -// Check if the character at the specified position is blank (space or tab). -func is_blank(b []byte, i int) bool { - //return is_space(b, i) || is_tab(b, i) - return b[i] == ' ' || b[i] == '\t' -} - -// Check if the character at the specified position is a line break. -func is_break(b []byte, i int) bool { - return (b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029) -} - -func is_crlf(b []byte, i int) bool { - return b[i] == '\r' && b[i+1] == '\n' -} - -// Check if the character is a line break or NUL. -func is_breakz(b []byte, i int) bool { - //return is_break(b, i) || is_z(b, i) - return ( // is_break: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - // is_z: - b[i] == 0) -} - -// Check if the character is a line break, space, or NUL. -func is_spacez(b []byte, i int) bool { - //return is_space(b, i) || is_breakz(b, i) - return ( // is_space: - b[i] == ' ' || - // is_breakz: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - b[i] == 0) -} - -// Check if the character is a line break, space, tab, or NUL. -func is_blankz(b []byte, i int) bool { - //return is_blank(b, i) || is_breakz(b, i) - return ( // is_blank: - b[i] == ' ' || b[i] == '\t' || - // is_breakz: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - b[i] == 0) -} - -// Determine the width of the character. -func width(b byte) int { - // Don't replace these by a switch without first - // confirming that it is being inlined. - if b&0x80 == 0x00 { - return 1 - } - if b&0xE0 == 0xC0 { - return 2 - } - if b&0xF0 == 0xE0 { - return 3 - } - if b&0xF8 == 0xF0 { - return 4 - } - return 0 - -} diff --git a/vendor/github.com/mattermost/platform/LICENSE.txt b/vendor/github.com/mattermost/platform/LICENSE.txt new file mode 100644 index 00000000..ead98cf0 --- /dev/null +++ b/vendor/github.com/mattermost/platform/LICENSE.txt @@ -0,0 +1,897 @@ +Mattermost Licensing + +SOFTWARE LICENSING + +You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE + +- See MIT-COMPILED-LICENSE.md included in compiled versions for details + +You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: + +1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or +2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com + +You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, +webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. + +We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not +link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and +(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of +a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. + +MATTERMOST TRADEMARK GUIDELINES + +Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark +Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions +you have about using these trademarks, please email trademark@mattermost.com + +------------------------------------------------------------------------------------------------------------------------------ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ + +The software is released under the terms of the GNU Affero General Public +License, version 3. + + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/vendor/github.com/mattermost/platform/NOTICE.txt b/vendor/github.com/mattermost/platform/NOTICE.txt new file mode 100644 index 00000000..f68ef872 --- /dev/null +++ b/vendor/github.com/mattermost/platform/NOTICE.txt @@ -0,0 +1,2935 @@ +Mattermost Server +© 2015-present Mattermost, Inc. All Rights Reserved. See LICENSE.txt for license information. + +NOTICES: +-------- + +This document includes a list of open source components used in Mattermost Server, including those that have been modified. + +--- + +This product contains a modified portion of 'jquery-dragster', a drag and drop listener +by Jan Martin. + +* HOMEPAGE: + * https://github.com/catmanjan/jquery-dragster + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Jan Martin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +This product contains a modified portion of 'golang-lru', a golang LRU cache by hashicorp, +based on Groupcache by Google Inc. + +* HOMEPAGE: + * https://github.com/hashicorp/golang-lru + +* LICENSE: + +This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a +copy of the MPL was not distributed with this file, You can obtain one at +http://mozilla.org/MPL/2.0/. + +--- + +This product contains a modified portion of 'golang-freetype', a port of the Freetype +font rasterizer (www.freetype.org) to the Go programming. + +Portions of this software are copyright © 2010 The FreeType Project (www.freetype.org). +All rights reserved. + +* HOMEPAGE: + * http://www.freetype.org + +* LICENSE: + + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright � The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + +--- end of FTL.TXT --- + +--- + +This product contains a modified portion of 'gemoji', a collection of emoji images and names by Apple Inc. and other contributors. + +* HOMEPAGE: + * https://github.com/github/gemoji/blob/master/LICENSE + +* LICENSE: + +octocat, squirrel, shipit +Copyright (c) 2013 GitHub Inc. All rights reserved. + +bowtie, neckbeard, fu +Copyright (c) 2013 37signals, LLC. All rights reserved. + +feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect +Copyright (c) 2013 id Software. All rights reserved. + +trollface +Copyright (c) 2013 whynne@deviantart. All rights reserved. + +All other images +Copyright (c) 2013 Apple Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +--- + +This product contains a modified portion of 'goexif', which provides decoding of basic exif and tiff encoded data. + +by Robert Carlsen & Contributors + +* HOMEPAGE: + * https://github.com/rwcarlsen/goexif + +* LICENSE: + +Copyright (c) 2012, Robert Carlsen & Contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'graphics-go', an implementation of basic image manipulation operations in the Go programming language. + +by The Graphics-Go Authors + +* HOMEPAGE: + * https://code.google.com/p/graphics-go/ + +* LICENSE: + +Copyright (c) 2011 The Graphics-Go Authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'babel-es6-polyfill', a pure ES6 polyfill for Babel that only includes standardised features. + +by Jason Berry + +* HOMEPAGE: + * https://github.com/JasonBerry/babel-es6-polyfill + +* LICENSE: + +Copyright (c) 2015 Jason Berry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--- + +This product contains a modified portion of 'go-ldap', basic LDAP v3 functionality for the GO programming language. + +by The Go Authors + +* HOMEPAGE: + * https://github.com/go-ldap/ldap + +* LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'Google Fonts', various Open Source fonts for use on the web. + +by Google Inc. + +* HOMEPAGE: + * https://www.google.com/fonts + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Copyright 2011 Google Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +# Fonts licensed under CC-BY 3.0: + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + +"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. +"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. +"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. +"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. +"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. +"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. +"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. +"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. +"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + +to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; +to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; +to Distribute and Publicly Perform the Work including as incorporated in Collections; and, +to Distribute and Publicly Perform Adaptations. +For the avoidance of doubt: + +Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; +Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, +Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + +You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. +If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. +Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + +This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. +Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + +Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. +Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. +If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. +This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. +The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. + +Creative Commons Notice + +Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. + +Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License. + +Creative Commons may be contacted at https://creativecommons.org/. + +--- + +This product contains a modified portion of 'go-i18n', a Go package and a command that translates Go programs into multiple languages +by Nick Snyder. + +* HOMEPAGE: + * https://github.com/nicksnyder/go-i18n + +* LICENSE: + +Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--- + +This product contains a modified portion of 'dgoogauth', a go implementation of the Google Authenticator library by Damian Gryski. + +* HOMEPAGE: + * https://github.com/dgryski/dgoogauth + +* LICENSE: + +Copyright 2012 Damian Gryski + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains a modified portion of 'fbjs', a collection of JavaScript utilities by Facebook, Inc. + +* HOMEPAGE: + * https://github.com/facebook/fbjs + +* LICENSE: + +BSD License + +For fbjs software + +Copyright (c) 2013-present, Facebook, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'marked', a full-featured markdown parser and compiler, written in JavaScript. Built for speed by Christopher Jeffrey. + +* HOMEPAGE: + * https://github.com/chjj/marked + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2011-2014, Christopher Jeffrey. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. +No attribution is required by products that make use of this software. + +--- + +This product contains a modified portion of 'gziphandler', a tiny Go package which wraps HTTP handlers to transparently gzip the response body, for clients which support it by The New York Times Company. + +* HOMEPAGE: + * https://github.com/NYTimes/gziphandler + +* LICENSE: + +Apache License 2.0 + +Copyright (c) 2015 The New York Times Company + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this library except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains a modified portion of 'handlers', a collection of handlers (aka "HTTP middleware") for use with Go's net/http package (or any framework supporting http.Handler) by The Gorilla Handlers Authors. + +* HOMEPAGE: + * https://github.com/gorilla/handlers + +* LICENSE: + +Copyright (c) 2013 The Gorilla Handlers Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'log4go', an unmaintained fork, left only so it doesn't break imports by Kyle Lemons. + +* HOMEPAGE: + * https://github.com/alecthomas/log4go + +* LICENSE: + +Copyright (c) 2010, Kyle Lemons . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'manners', a package imaging providing basic image manipulation functions (resize, rotate, flip, crop, etc.) by Grigory Dryapak. + +* HOMEPAGE: + * https://github.com/disintegration/imaging + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2012-2014 Grigory Dryapak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +This product contains a modified portion of 'gorp', to save time, minimize the drudgery of getting data in and out of the database, and help code focus on algorithms, not infrastructure by James Cooper. + +* HOMEPAGE: + * https://github.com/go-gorp/gorp + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2012 James Cooper + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +This product contains a modified portion of 'mysql', a lightweight and fast MySQL driver for Go's (golang) database/sql package by Mozilla Public. + +* HOMEPAGE: + * https://github.com/go-sql-driver/mysql + +* LICENSE: + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +--- + +This product contains a modified portion of 'context', a golang registry for global request variables by Rodrigo Moraes. + +* HOMEPAGE: + * https://github.com/gorilla/context + +* LICENSE: + +Copyright (c) 2012 Rodrigo Moraes. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'mux', a powerful URL router and dispatcher for golang by Rodrigo Moraes. + +* HOMEPAGE: + * https://github.com/gorilla/mux + +* LICENSE: + +Copyright (c) 2012 Rodrigo Moraes. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'websocket', a WebSocket implementation for Go by The Gorilla WebSocket Authors. + +* HOMEPAGE: + * https://github.com/gorilla/websocket + +* LICENSE: + +Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## pq + +This product contains a modified portion of 'pq', a Pure Go Postgres driver for database/sql by Blake Mizerany and Contributors. + +* HOMEPAGE: + * https://github.com/lib/pq + +* LICENSE: + +Copyright (c) 2011-2013, 'pq' Contributors +Portions Copyright (C) 2011 Blake Mizerany + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +This product contains a modified portion of 'user_agent', a Go library that parses HTTP User Agents by Miquel Sabaté Solà. + +* HOMEPAGE: + * https://github.com/mssola/user_agent + +* LICENSE: + +Copyright (c) 2012-2016 Miquel Sabaté Solà + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +This product contains a modified portion of 'uuid', a package generates and inspects UUIDs based on RFC 412 and DCE 1.1: Authentication and Security Services by Google Inc. + +* HOMEPAGE: + * https://github.com/pborman/uuid + +* LICENSE: + +Copyright (c) 2009,2014 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'yaml', a YAML support for the Go language by Canonical Inc. + +* HOMEPAGE: + * https://gopkg.in/yaml.v2 + +* LICENSE: + + +Copyright (c) 2011-2014 - Canonical Inc. + +This software is licensed under the LGPLv3, included below. + +As a special exception to the GNU Lesser General Public License version 3 +("LGPL3"), the copyright holders of this Library give you permission to +convey to a third party a Combined Work that links statically or dynamically +to this Library without providing any Minimal Corresponding Source or +Minimal Application Code as set out in 4d or providing the installation +information set out in section 4e, provided that you comply with the other +provisions of LGPL3 and provided that you meet, for the Application the +terms and conditions of the license(s) which apply to the Application. + +Except as stated in this special exception, the provisions of LGPL3 will +continue to comply in full to this Library. If you modify this Library, you +may apply this exception to your version of this Library, but you are not +obliged to do so. If you do not wish to do so, delete this exception +statement from your version. This exception does not (and cannot) modify any +license terms which apply to the Application, with which you must still +comply. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + +--- + +This product contains a modified portion of 'throttled', a package store offering a memory-based and a Redis-based throttled by Martin Angers. + +* HOMEPAGE: + * http://gopkg.in/throttled/throttled.v1/store + +* LICENSE: + +Copyright (c) 2014, Martin Angers +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'throttled', a package throttled implementing different throttling strategies for controlling access to HTTP handlers by Martin Angers and Contributors. + +* HOMEPAGE: + * http://gopkg.in/throttled/throttled.v1 + +* LICENSE: + +Copyright (c) 2014, Martin Angers and Contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'fsnotify', to utilize golang.org/x/sys rather than syscall from the standard library by The Go Authors and fsnotify Authors. + +* HOMEPAGE: + * http://gopkg.in/fsnotify.v1 + +* LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2012 fsnotify Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## asn1-ber + +This product contains a modified portion of 'asn1-ber', an ASN1 BER Encoding / Decoding Library for the GO programming language by The Go Authors. + +* HOMEPAGE: + * http://gopkg.in/asn1-ber.v1 + +* LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'asn1-ber', an ASN1 BER Encoding / Decoding Library for the GO programming language by The Go Authors. + +* HOMEPAGE: + * http://gopkg.in/asn1-ber.v1 + +* LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## redigo + +This product contains a modified portion of 'redigo', a Go client for the Redis database. + +* HOMEPAGE: + * https://github.com/garyburd/redigo + +* LICENSE: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +--- + +## crypto + +This product contains a modified portion of 'crypto', a set of Go cryptographic libraries. + +* HOMEPAGE: + * https://github.com/golang/crypto + +* LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--- + +## image + +This product contains a modified portion of 'image', a set of Go image libraries. + +* HOMEPAGE: + * https://github.com/golang/image + +* LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--- + +## rsc + +This product contains a modified portion of 'rsc', a random source code library from Google + +* HOMEPAGE: + * https://code.google.com/archive/p/rsc/ + +* LICENSE: + +Copyright (c) , +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## mattermost-driver-javascript + +This product contains a modified portion of 'mattermost-driver-javascript', a Javascript library for interacting with the Mattermost API. + +* HOMEPAGE: + * https://github.com/mattermost/mattermost-driver-javascript + +* LICENSE: + +Copyright 2016-present Mattermost + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +--- + +This product contains a modified portion of 'osext', providing a function that returns an absolute path to the current program executable, built by kardianos. + +* HOMEPAGE: + * https://github.com/kardianos/osext + +* LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of 'go-saml', a SAML client library for Go written by RobotsAndPencils. + +* HOMEPAGE: + * https://github.com/RobotsAndPencils/go-saml + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Robots and Pencils + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +This product contains a modified portion of 'minio-go', a Golang Client SDK providing simple APIs to access any Amazon S3 compatible object storage server, built by Minio. + +* HOMEPAGE: + * https://github.com/minio/minio-go + +* LICENSE: + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +--- + +This product contains a modified portion of 'graceful', a Go package enabling graceful shutdown of an http.Handler server, built by Tyler Bunnell. + +* HOMEPAGE: + * https://github.com/tylerb/graceful + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Tyler Bunnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +This product contains a modified portion of 'letsencrypt' to manage TLS certificates automatically via LetsEncrypt.org, built by Russ Cox. + +* HOMEPAGE: + * https://github.com/rsc/letsencrypt + +* LICENSE: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of ‘manners’ a polite webserver for Go, built by Braintree, a division of PayPal, Inc. + +* HOMEPAGE: + * https://github.com/braintree/manners + +* LICENSE: + +Copyright (c) 2014 Braintree, a division of PayPal, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--- + +This product contains a modified portion of ‘perks’ which contains the Go package quantile that computes approximate quantiles over an unbounded data stream within low memory and CPU bounds, built by Blake Mizerany. + +* HOMEPAGE: + * https://github.com/beorn7/perks + +* LICENSE: + +Copyright (C) 2013 Blake Mizerany + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +This product contains a modified portion of ‘protobuf’ for Go support for Protocol Buffers, built by The Go Authors. + +* HOMEPAGE: + * https://github.com/golang/protobuf + +* LICENSE: + +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains a modified portion of ‘golang_protobuf_extensions’ which provides various Protocol Buffer extensions, built by matttproud. + +* HOMEPAGE: + * https://github.com/matttproud/golang_protobuf_extensions + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains a modified portion of ‘cobra’, a Commander for modern Go CLI interactions, built by spf13. + +* HOMEPAGE: + * https://github.com/spf13/cobra + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains a modified portion of ‘pflag’, a Commander for modern Go CLI interactions, built by Alex Ogier. + +* HOMEPAGE: + * https://github.com/spf13/pflag + +* LICENSE: + +Copyright (c) 2012 Alex Ogier. All rights reserved. +Copyright (c) 2012 The Go Authors. All rights reserved. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This product contains modified portions of Prometheus ‘client_golang’, which is the Go library for Prometheus. Prometheus is a systems and service monitoring system, started by Matt T. Proud and Julius Volz in 2012. + +* HOMEPAGE: + * https://github.com/prometheus/client_golang + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains modified portions of Prometheus ‘client_model’, which provides data model artifacts for Prometheus. Prometheus is a systems and service monitoring system, started by Matt T. Proud and Julius Volz in 2012. + +* HOMEPAGE: + * https://github.com/prometheus/client_model + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains modified portions of Prometheus ‘common’, which is the part of the Prometheus project that contains Go libraries that are shared across Prometheus components and libraries. Prometheus is a systems and service monitoring system, started by Matt T. Proud and Julius Volz in 2012. + +* HOMEPAGE: + * https://github.com/prometheus/common + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +--- + +This product contains modified portions of Prometheus ‘procfs’, which is the part of the Prometheus project that provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc. Prometheus is a systems and service monitoring system, started by Matt T. Proud and Julius Volz in 2012. + +* HOMEPAGE: + * https://github.com/prometheus/procfs + +* LICENSE: + +# Code licensed under the Apache 2.0 License: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +---- + +This product contains a modified portion of 'go-opengraph', for parsing OpenGraph data from HTML into regular structures by Vitaly Dyatlov. + +* HOMEPAGE: + * https://github.com/dyatlov/go-opengraph + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Vitaly Dyatlov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +---- + +This product contains a modified portion of `viper` for handling configuration in Go programs. Built by Steve Francia. + +* HOMEPAGE: + * https://github.com/spf13/viper + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +---- + +This product contains a modified version of `gomail` for sending emails. Built by Alexandre Cesaro. + +* HOMEPAGE: + * https://github.com/go-gomail/gomail + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Alexandre Cesaro + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +---- + +This product contains a modified version of `fsnotify` for file system notifications. Built by the Go Authors and the fsnotify Authors. + +* HOMEPAGE: + * https://github.com/fsnotify/fsnotify + +* LICENSE: + +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2012 fsnotify Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---- + +## analytics-go + +This product contains a modified portion of `analytics-go`, a segment analytics client for Go by Segment. + +* HOMEPAGE: + * https://github.com/segmentio/analytics-go + +* LICENSE: + +MIT license + +---- + +## html2text + +This product contains a modified portion of 'html2text', an HTML to raw text converter by Carlos Tadeu Panato Junior, based on `html2text` by Jay Taylor. + +* HOMEPAGE + * https://github.com/mattermost/html2text + +* LICENSE + +The MIT License (MIT) + +Copyright (c) 2015 Jay Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## elastic + +This product contains a modified portion of `elastic`, an Elasticsearch client for the Go programming language by Oliver Eilhard. + +* HOMEPAGE + * https://github.com/olivere/elastic + +* LICENSE + +The MIT License (MIT) +Copyright © 2012-2015 Oliver Eilhard + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +--- + +## redis + +This product contains a modified portion of `redis`, a type-safe Redis client for Golang, by go-redis. + +* HOMEPAGE + * https://github.com/go-redis/redis + +* LICENSE + +Copyright (c) 2013 The github.com/go-redis/redis Authors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## testify + +This product contains a modified portion of testify, a Golang toolkit providing tools for testifying that code behaves as intended. + +* HOMEPAGE + * https://github.com/stretchr/testify + +* LICENSE + +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +## html2text + +This product contains a modified portion of `html2text`, a Golang library for HTML to plaintext conversion. + +* HOMEPAGE + * https://github.com/mattermost/html2text + +* LICENSE + +The MIT License (MIT) + +Copyright (c) 2015 Jay Taylor +Modified work: Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/mattermost/platform/model/LICENSE.txt b/vendor/github.com/mattermost/platform/model/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/platform/model/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go b/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go deleted file mode 100644 index 7e0cb10a..00000000 --- a/vendor/github.com/mattermost/platform/model/gitlab/gitlab.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package oauthgitlab - -import ( - "encoding/json" - "io" - "strconv" - "strings" - - "github.com/mattermost/mattermost-server/einterfaces" - "github.com/mattermost/mattermost-server/model" -) - -type GitLabProvider struct { -} - -type GitLabUser struct { - Id int64 `json:"id"` - Username string `json:"username"` - Login string `json:"login"` - Email string `json:"email"` - Name string `json:"name"` -} - -func init() { - provider := &GitLabProvider{} - einterfaces.RegisterOauthProvider(model.USER_AUTH_SERVICE_GITLAB, provider) -} - -func userFromGitLabUser(glu *GitLabUser) *model.User { - user := &model.User{} - username := glu.Username - if username == "" { - username = glu.Login - } - user.Username = model.CleanUsername(username) - splitName := strings.Split(glu.Name, " ") - if len(splitName) == 2 { - user.FirstName = splitName[0] - user.LastName = splitName[1] - } else if len(splitName) >= 2 { - user.FirstName = splitName[0] - user.LastName = strings.Join(splitName[1:], " ") - } else { - user.FirstName = glu.Name - } - user.Email = glu.Email - userId := strconv.FormatInt(glu.Id, 10) - user.AuthData = &userId - user.AuthService = model.USER_AUTH_SERVICE_GITLAB - - return user -} - -func gitLabUserFromJson(data io.Reader) *GitLabUser { - decoder := json.NewDecoder(data) - var glu GitLabUser - err := decoder.Decode(&glu) - if err == nil { - return &glu - } else { - return nil - } -} - -func (glu *GitLabUser) ToJson() string { - b, err := json.Marshal(glu) - if err != nil { - return "" - } else { - return string(b) - } -} - -func (glu *GitLabUser) IsValid() bool { - if glu.Id == 0 { - return false - } - - if len(glu.Email) == 0 { - return false - } - - return true -} - -func (glu *GitLabUser) getAuthData() string { - return strconv.FormatInt(glu.Id, 10) -} - -func (m *GitLabProvider) GetIdentifier() string { - return model.USER_AUTH_SERVICE_GITLAB -} - -func (m *GitLabProvider) GetUserFromJson(data io.Reader) *model.User { - glu := gitLabUserFromJson(data) - if glu.IsValid() { - return userFromGitLabUser(glu) - } - - return &model.User{} -} - -func (m *GitLabProvider) GetAuthDataFromJson(data io.Reader) string { - glu := gitLabUserFromJson(data) - - if glu.IsValid() { - return glu.getAuthData() - } - - return "" -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE.txt b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/bundle/bundle.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/bundle/bundle.go deleted file mode 100644 index a2291362..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/bundle/bundle.go +++ /dev/null @@ -1,444 +0,0 @@ -// Package bundle manages translations for multiple languages. -package bundle - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "path/filepath" - "reflect" - "sync" - "unicode" - - "github.com/nicksnyder/go-i18n/i18n/language" - "github.com/nicksnyder/go-i18n/i18n/translation" - toml "github.com/pelletier/go-toml" - "gopkg.in/yaml.v2" -) - -// TranslateFunc is a copy of i18n.TranslateFunc to avoid a circular dependency. -type TranslateFunc func(translationID string, args ...interface{}) string - -// Bundle stores the translations for multiple languages. -type Bundle struct { - // The primary translations for a language tag and translation id. - translations map[string]map[string]translation.Translation - - // Translations that can be used when an exact language match is not possible. - fallbackTranslations map[string]map[string]translation.Translation - - sync.RWMutex -} - -// New returns an empty bundle. -func New() *Bundle { - return &Bundle{ - translations: make(map[string]map[string]translation.Translation), - fallbackTranslations: make(map[string]map[string]translation.Translation), - } -} - -// MustLoadTranslationFile is similar to LoadTranslationFile -// except it panics if an error happens. -func (b *Bundle) MustLoadTranslationFile(filename string) { - if err := b.LoadTranslationFile(filename); err != nil { - panic(err) - } -} - -// LoadTranslationFile loads the translations from filename into memory. -// -// The language that the translations are associated with is parsed from the filename (e.g. en-US.json). -// -// Generally you should load translation files once during your program's initialization. -func (b *Bundle) LoadTranslationFile(filename string) error { - buf, err := ioutil.ReadFile(filename) - if err != nil { - return err - } - return b.ParseTranslationFileBytes(filename, buf) -} - -// ParseTranslationFileBytes is similar to LoadTranslationFile except it parses the bytes in buf. -// -// It is useful for parsing translation files embedded with go-bindata. -func (b *Bundle) ParseTranslationFileBytes(filename string, buf []byte) error { - basename := filepath.Base(filename) - langs := language.Parse(basename) - switch l := len(langs); { - case l == 0: - return fmt.Errorf("no language found in %q", basename) - case l > 1: - return fmt.Errorf("multiple languages found in filename %q: %v; expected one", basename, langs) - } - translations, err := parseTranslations(filename, buf) - if err != nil { - return err - } - b.AddTranslation(langs[0], translations...) - return nil -} - -func parseTranslations(filename string, buf []byte) ([]translation.Translation, error) { - if len(buf) == 0 { - return []translation.Translation{}, nil - } - - ext := filepath.Ext(filename) - - // `github.com/pelletier/go-toml` lacks an Unmarshal function, - // so we should parse TOML separately. - if ext == ".toml" { - tree, err := toml.LoadReader(bytes.NewReader(buf)) - if err != nil { - return nil, err - } - - m := make(map[string]map[string]interface{}) - for k, v := range tree.ToMap() { - m[k] = v.(map[string]interface{}) - } - - return parseFlatFormat(m) - } - - // Then parse other formats. - if isStandardFormat(ext, buf) { - var standardFormat []map[string]interface{} - if err := unmarshal(ext, buf, &standardFormat); err != nil { - return nil, fmt.Errorf("failed to unmarshal %v: %v", filename, err) - } - return parseStandardFormat(standardFormat) - } else { - var flatFormat map[string]map[string]interface{} - if err := unmarshal(ext, buf, &flatFormat); err != nil { - return nil, fmt.Errorf("failed to unmarshal %v: %v", filename, err) - } - return parseFlatFormat(flatFormat) - } -} - -func isStandardFormat(ext string, buf []byte) bool { - buf = deleteLeadingComments(ext, buf) - firstRune := rune(buf[0]) - return (ext == ".json" && firstRune == '[') || (ext == ".yaml" && firstRune == '-') -} - -// deleteLeadingComments deletes leading newlines and comments in buf. -// It only works for ext == ".yaml". -func deleteLeadingComments(ext string, buf []byte) []byte { - if ext != ".yaml" { - return buf - } - - for { - buf = bytes.TrimLeftFunc(buf, unicode.IsSpace) - if buf[0] == '#' { - buf = deleteLine(buf) - } else { - break - } - } - - return buf -} - -func deleteLine(buf []byte) []byte { - index := bytes.IndexRune(buf, '\n') - if index == -1 { // If there is only one line without newline ... - return nil // ... delete it and return nothing. - } - if index == len(buf)-1 { // If there is only one line with newline ... - return nil // ... do the same as above. - } - return buf[index+1:] -} - -// unmarshal finds an appropriate unmarshal function for ext -// (extension of filename) and unmarshals buf to out. out must be a pointer. -func unmarshal(ext string, buf []byte, out interface{}) error { - switch ext { - case ".json": - return json.Unmarshal(buf, out) - case ".yaml": - return yaml.Unmarshal(buf, out) - } - - return fmt.Errorf("unsupported file extension %v", ext) -} - -func parseStandardFormat(data []map[string]interface{}) ([]translation.Translation, error) { - translations := make([]translation.Translation, 0, len(data)) - for i, translationData := range data { - t, err := translation.NewTranslation(translationData) - if err != nil { - return nil, fmt.Errorf("unable to parse translation #%d because %s\n%v", i, err, translationData) - } - translations = append(translations, t) - } - return translations, nil -} - -// parseFlatFormat just converts data from flat format to standard format -// and passes it to parseStandardFormat. -// -// Flat format logic: -// key of data must be a string and data[key] must be always map[string]interface{}, -// but if there is only "other" key in it then it is non-plural, else plural. -func parseFlatFormat(data map[string]map[string]interface{}) ([]translation.Translation, error) { - var standardFormatData []map[string]interface{} - for id, translationData := range data { - dataObject := make(map[string]interface{}) - dataObject["id"] = id - if len(translationData) == 1 { // non-plural form - _, otherExists := translationData["other"] - if otherExists { - dataObject["translation"] = translationData["other"] - } - } else { // plural form - dataObject["translation"] = translationData - } - - standardFormatData = append(standardFormatData, dataObject) - } - - return parseStandardFormat(standardFormatData) -} - -// AddTranslation adds translations for a language. -// -// It is useful if your translations are in a format not supported by LoadTranslationFile. -func (b *Bundle) AddTranslation(lang *language.Language, translations ...translation.Translation) { - b.Lock() - defer b.Unlock() - if b.translations[lang.Tag] == nil { - b.translations[lang.Tag] = make(map[string]translation.Translation, len(translations)) - } - currentTranslations := b.translations[lang.Tag] - for _, newTranslation := range translations { - if currentTranslation := currentTranslations[newTranslation.ID()]; currentTranslation != nil { - currentTranslations[newTranslation.ID()] = currentTranslation.Merge(newTranslation) - } else { - currentTranslations[newTranslation.ID()] = newTranslation - } - } - - // lang can provide translations for less specific language tags. - for _, tag := range lang.MatchingTags() { - b.fallbackTranslations[tag] = currentTranslations - } -} - -// Translations returns all translations in the bundle. -func (b *Bundle) Translations() map[string]map[string]translation.Translation { - t := make(map[string]map[string]translation.Translation) - b.RLock() - for tag, translations := range b.translations { - t[tag] = make(map[string]translation.Translation) - for id, translation := range translations { - t[tag][id] = translation - } - } - b.RUnlock() - return t -} - -// LanguageTags returns the tags of all languages that that have been added. -func (b *Bundle) LanguageTags() []string { - var tags []string - b.RLock() - for k := range b.translations { - tags = append(tags, k) - } - b.RUnlock() - return tags -} - -// LanguageTranslationIDs returns the ids of all translations that have been added for a given language. -func (b *Bundle) LanguageTranslationIDs(languageTag string) []string { - var ids []string - b.RLock() - for id := range b.translations[languageTag] { - ids = append(ids, id) - } - b.RUnlock() - return ids -} - -// MustTfunc is similar to Tfunc except it panics if an error happens. -func (b *Bundle) MustTfunc(pref string, prefs ...string) TranslateFunc { - tfunc, err := b.Tfunc(pref, prefs...) - if err != nil { - panic(err) - } - return tfunc -} - -// MustTfuncAndLanguage is similar to TfuncAndLanguage except it panics if an error happens. -func (b *Bundle) MustTfuncAndLanguage(pref string, prefs ...string) (TranslateFunc, *language.Language) { - tfunc, language, err := b.TfuncAndLanguage(pref, prefs...) - if err != nil { - panic(err) - } - return tfunc, language -} - -// Tfunc is similar to TfuncAndLanguage except is doesn't return the Language. -func (b *Bundle) Tfunc(pref string, prefs ...string) (TranslateFunc, error) { - tfunc, _, err := b.TfuncAndLanguage(pref, prefs...) - return tfunc, err -} - -// TfuncAndLanguage returns a TranslateFunc for the first Language that -// has a non-zero number of translations in the bundle. -// -// The returned Language matches the the first language preference that could be satisfied, -// but this may not strictly match the language of the translations used to satisfy that preference. -// -// For example, the user may request "zh". If there are no translations for "zh" but there are translations -// for "zh-cn", then the translations for "zh-cn" will be used but the returned Language will be "zh". -// -// It can parse languages from Accept-Language headers (RFC 2616), -// but it assumes weights are monotonically decreasing. -func (b *Bundle) TfuncAndLanguage(pref string, prefs ...string) (TranslateFunc, *language.Language, error) { - lang := b.supportedLanguage(pref, prefs...) - var err error - if lang == nil { - err = fmt.Errorf("no supported languages found %#v", append(prefs, pref)) - } - return func(translationID string, args ...interface{}) string { - return b.translate(lang, translationID, args...) - }, lang, err -} - -// supportedLanguage returns the first language which -// has a non-zero number of translations in the bundle. -func (b *Bundle) supportedLanguage(pref string, prefs ...string) *language.Language { - lang := b.translatedLanguage(pref) - if lang == nil { - for _, pref := range prefs { - lang = b.translatedLanguage(pref) - if lang != nil { - break - } - } - } - return lang -} - -func (b *Bundle) translatedLanguage(src string) *language.Language { - langs := language.Parse(src) - b.RLock() - defer b.RUnlock() - for _, lang := range langs { - if len(b.translations[lang.Tag]) > 0 || - len(b.fallbackTranslations[lang.Tag]) > 0 { - return lang - } - } - return nil -} - -func (b *Bundle) translate(lang *language.Language, translationID string, args ...interface{}) string { - if lang == nil { - return translationID - } - - translation := b.translation(lang, translationID) - if translation == nil { - return translationID - } - - var data interface{} - var count interface{} - if argc := len(args); argc > 0 { - if isNumber(args[0]) { - count = args[0] - if argc > 1 { - data = args[1] - } - } else { - data = args[0] - } - } - - if count != nil { - if data == nil { - data = map[string]interface{}{"Count": count} - } else { - dataMap := toMap(data) - dataMap["Count"] = count - data = dataMap - } - } else { - dataMap := toMap(data) - if c, ok := dataMap["Count"]; ok { - count = c - } - } - - p, _ := lang.Plural(count) - template := translation.Template(p) - if template == nil { - return translationID - } - - s := template.Execute(data) - if s == "" { - return translationID - } - return s -} - -func (b *Bundle) translation(lang *language.Language, translationID string) translation.Translation { - b.RLock() - defer b.RUnlock() - translations := b.translations[lang.Tag] - if translations == nil { - translations = b.fallbackTranslations[lang.Tag] - if translations == nil { - return nil - } - } - return translations[translationID] -} - -func isNumber(n interface{}) bool { - switch n.(type) { - case int, int8, int16, int32, int64, string: - return true - } - return false -} - -func toMap(input interface{}) map[string]interface{} { - if data, ok := input.(map[string]interface{}); ok { - return data - } - v := reflect.ValueOf(input) - switch v.Kind() { - case reflect.Ptr: - return toMap(v.Elem().Interface()) - case reflect.Struct: - return structToMap(v) - default: - return nil - } -} - -// Converts the top level of a struct to a map[string]interface{}. -// Code inspired by github.com/fatih/structs. -func structToMap(v reflect.Value) map[string]interface{} { - out := make(map[string]interface{}) - t := v.Type() - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - if field.PkgPath != "" { - // unexported field. skip. - continue - } - out[field.Name] = v.FieldByName(field.Name).Interface() - } - return out -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/i18n.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/i18n.go deleted file mode 100644 index c478ff6e..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/i18n.go +++ /dev/null @@ -1,158 +0,0 @@ -// Package i18n supports string translations with variable substitution and CLDR pluralization. -// It is intended to be used in conjunction with the goi18n command, although that is not strictly required. -// -// Initialization -// -// Your Go program should load translations during its initialization. -// i18n.MustLoadTranslationFile("path/to/fr-FR.all.json") -// If your translations are in a file format not supported by (Must)?LoadTranslationFile, -// then you can use the AddTranslation function to manually add translations. -// -// Fetching a translation -// -// Use Tfunc or MustTfunc to fetch a TranslateFunc that will return the translated string for a specific language. -// func handleRequest(w http.ResponseWriter, r *http.Request) { -// cookieLang := r.Cookie("lang") -// acceptLang := r.Header.Get("Accept-Language") -// defaultLang = "en-US" // known valid language -// T, err := i18n.Tfunc(cookieLang, acceptLang, defaultLang) -// fmt.Println(T("Hello world")) -// } -// -// Usually it is a good idea to identify strings by a generic id rather than the English translation, -// but the rest of this documentation will continue to use the English translation for readability. -// T("Hello world") // ok -// T("programGreeting") // better! -// -// Variables -// -// TranslateFunc supports strings that have variables using the text/template syntax. -// T("Hello {{.Person}}", map[string]interface{}{ -// "Person": "Bob", -// }) -// -// Pluralization -// -// TranslateFunc supports the pluralization of strings using the CLDR pluralization rules defined here: -// http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html -// T("You have {{.Count}} unread emails.", 2) -// T("I am {{.Count}} meters tall.", "1.7") -// -// Plural strings may also have variables. -// T("{{.Person}} has {{.Count}} unread emails", 2, map[string]interface{}{ -// "Person": "Bob", -// }) -// -// Sentences with multiple plural components can be supported with nesting. -// T("{{.Person}} has {{.Count}} unread emails in the past {{.Timeframe}}.", 3, map[string]interface{}{ -// "Person": "Bob", -// "Timeframe": T("{{.Count}} days", 2), -// }) -// -// Templates -// -// You can use the .Funcs() method of a text/template or html/template to register a TranslateFunc -// for usage inside of that template. -package i18n - -import ( - "github.com/nicksnyder/go-i18n/i18n/bundle" - "github.com/nicksnyder/go-i18n/i18n/language" - "github.com/nicksnyder/go-i18n/i18n/translation" -) - -// TranslateFunc returns the translation of the string identified by translationID. -// -// If there is no translation for translationID, then the translationID itself is returned. -// This makes it easy to identify missing translations in your app. -// -// If translationID is a non-plural form, then the first variadic argument may be a map[string]interface{} -// or struct that contains template data. -// -// If translationID is a plural form, the function accepts two parameter signatures -// 1. T(count int, data struct{}) -// The first variadic argument must be an integer type -// (int, int8, int16, int32, int64) or a float formatted as a string (e.g. "123.45"). -// The second variadic argument may be a map[string]interface{} or struct{} that contains template data. -// 2. T(data struct{}) -// data must be a struct{} or map[string]interface{} that contains a Count field and the template data, -// Count field must be an integer type (int, int8, int16, int32, int64) -// or a float formatted as a string (e.g. "123.45"). -type TranslateFunc func(translationID string, args ...interface{}) string - -// IdentityTfunc returns a TranslateFunc that always returns the translationID passed to it. -// -// It is a useful placeholder when parsing a text/template or html/template -// before the actual Tfunc is available. -func IdentityTfunc() TranslateFunc { - return func(translationID string, args ...interface{}) string { - return translationID - } -} - -var defaultBundle = bundle.New() - -// MustLoadTranslationFile is similar to LoadTranslationFile -// except it panics if an error happens. -func MustLoadTranslationFile(filename string) { - defaultBundle.MustLoadTranslationFile(filename) -} - -// LoadTranslationFile loads the translations from filename into memory. -// -// The language that the translations are associated with is parsed from the filename (e.g. en-US.json). -// -// Generally you should load translation files once during your program's initialization. -func LoadTranslationFile(filename string) error { - return defaultBundle.LoadTranslationFile(filename) -} - -// ParseTranslationFileBytes is similar to LoadTranslationFile except it parses the bytes in buf. -// -// It is useful for parsing translation files embedded with go-bindata. -func ParseTranslationFileBytes(filename string, buf []byte) error { - return defaultBundle.ParseTranslationFileBytes(filename, buf) -} - -// AddTranslation adds translations for a language. -// -// It is useful if your translations are in a format not supported by LoadTranslationFile. -func AddTranslation(lang *language.Language, translations ...translation.Translation) { - defaultBundle.AddTranslation(lang, translations...) -} - -// LanguageTags returns the tags of all languages that have been added. -func LanguageTags() []string { - return defaultBundle.LanguageTags() -} - -// LanguageTranslationIDs returns the ids of all translations that have been added for a given language. -func LanguageTranslationIDs(languageTag string) []string { - return defaultBundle.LanguageTranslationIDs(languageTag) -} - -// MustTfunc is similar to Tfunc except it panics if an error happens. -func MustTfunc(languageSource string, languageSources ...string) TranslateFunc { - return TranslateFunc(defaultBundle.MustTfunc(languageSource, languageSources...)) -} - -// Tfunc returns a TranslateFunc that will be bound to the first language which -// has a non-zero number of translations. -// -// It can parse languages from Accept-Language headers (RFC 2616). -func Tfunc(languageSource string, languageSources ...string) (TranslateFunc, error) { - tfunc, err := defaultBundle.Tfunc(languageSource, languageSources...) - return TranslateFunc(tfunc), err -} - -// MustTfuncAndLanguage is similar to TfuncAndLanguage except it panics if an error happens. -func MustTfuncAndLanguage(languageSource string, languageSources ...string) (TranslateFunc, *language.Language) { - tfunc, lang := defaultBundle.MustTfuncAndLanguage(languageSource, languageSources...) - return TranslateFunc(tfunc), lang -} - -// TfuncAndLanguage is similar to Tfunc except it also returns the language which TranslateFunc is bound to. -func TfuncAndLanguage(languageSource string, languageSources ...string) (TranslateFunc, *language.Language, error) { - tfunc, lang, err := defaultBundle.TfuncAndLanguage(languageSource, languageSources...) - return TranslateFunc(tfunc), lang, err -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go deleted file mode 100644 index 58971033..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go +++ /dev/null @@ -1,132 +0,0 @@ -package main - -import ( - "encoding/xml" - "flag" - "fmt" - "io/ioutil" - "os" - "text/template" -) - -var usage = `%[1]s generates Go code to support CLDR plural rules. - -Usage: %[1]s [options] - -Options: - -` - -func main() { - flag.Usage = func() { - fmt.Fprintf(os.Stderr, usage, os.Args[0]) - flag.PrintDefaults() - } - var in, cout, tout string - flag.StringVar(&in, "i", "plurals.xml", "the input XML file containing CLDR plural rules") - flag.StringVar(&cout, "cout", "", "the code output file") - flag.StringVar(&tout, "tout", "", "the test output file") - flag.BoolVar(&verbose, "v", false, "verbose output") - flag.Parse() - - buf, err := ioutil.ReadFile(in) - if err != nil { - fatalf("failed to read file: %s", err) - } - - var data SupplementalData - if err := xml.Unmarshal(buf, &data); err != nil { - fatalf("failed to unmarshal xml: %s", err) - } - - count := 0 - for _, pg := range data.PluralGroups { - count += len(pg.SplitLocales()) - } - infof("parsed %d locales", count) - - if cout != "" { - file := openWritableFile(cout) - if err := codeTemplate.Execute(file, data); err != nil { - fatalf("unable to execute code template because %s", err) - } else { - infof("generated %s", cout) - } - } else { - infof("not generating code file (use -cout)") - } - - if tout != "" { - file := openWritableFile(tout) - if err := testTemplate.Execute(file, data); err != nil { - fatalf("unable to execute test template because %s", err) - } else { - infof("generated %s", tout) - } - } else { - infof("not generating test file (use -tout)") - } -} - -func openWritableFile(name string) *os.File { - file, err := os.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) - if err != nil { - fatalf("failed to write file %s because %s", name, err) - } - return file -} - -var codeTemplate = template.Must(template.New("spec").Parse(`package language -// This file is generated by i18n/language/codegen/generate.sh - -func init() { -{{range .PluralGroups}} - RegisterPluralSpec({{printf "%#v" .SplitLocales}}, &PluralSpec{ - Plurals: newPluralSet({{range $i, $e := .PluralRules}}{{if $i}}, {{end}}{{$e.CountTitle}}{{end}}), - PluralFunc: func(ops *Operands) Plural { {{range .PluralRules}}{{if .GoCondition}} - // {{.Condition}} - if {{.GoCondition}} { - return {{.CountTitle}} - }{{end}}{{end}} - return Other - }, - }){{end}} -} -`)) - -var testTemplate = template.Must(template.New("spec").Parse(`package language -// This file is generated by i18n/language/codegen/generate.sh - -import "testing" - -{{range .PluralGroups}} -func Test{{.Name}}(t *testing.T) { - var tests []pluralTest - {{range .PluralRules}} - {{if .IntegerExamples}}tests = appendIntegerTests(tests, {{.CountTitle}}, {{printf "%#v" .IntegerExamples}}){{end}} - {{if .DecimalExamples}}tests = appendDecimalTests(tests, {{.CountTitle}}, {{printf "%#v" .DecimalExamples}}){{end}} - {{end}} - locales := {{printf "%#v" .SplitLocales}} - for _, locale := range locales { - runTests(t, locale, tests) - } -} -{{end}} -`)) - -func infof(format string, args ...interface{}) { - fmt.Fprintf(os.Stderr, format+"\n", args...) -} - -var verbose bool - -func verbosef(format string, args ...interface{}) { - if verbose { - infof(format, args...) - } -} - -func fatalf(format string, args ...interface{}) { - infof("fatal: "+format+"\n", args...) - os.Exit(1) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go deleted file mode 100644 index 9d39053c..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go +++ /dev/null @@ -1,143 +0,0 @@ -package main - -import ( - "encoding/xml" - "fmt" - "regexp" - "strings" -) - -// SupplementalData is the top level struct of plural.xml -type SupplementalData struct { - XMLName xml.Name `xml:"supplementalData"` - PluralGroups []PluralGroup `xml:"plurals>pluralRules"` -} - -// PluralGroup is a group of locales with the same plural rules. -type PluralGroup struct { - Locales string `xml:"locales,attr"` - PluralRules []PluralRule `xml:"pluralRule"` -} - -// Name returns a unique name for this plural group. -func (pg *PluralGroup) Name() string { - n := strings.Title(pg.Locales) - return strings.Replace(n, " ", "", -1) -} - -// SplitLocales returns all the locales in the PluralGroup as a slice. -func (pg *PluralGroup) SplitLocales() []string { - return strings.Split(pg.Locales, " ") -} - -// PluralRule is the rule for a single plural form. -type PluralRule struct { - Count string `xml:"count,attr"` - Rule string `xml:",innerxml"` -} - -// CountTitle returns the title case of the PluralRule's count. -func (pr *PluralRule) CountTitle() string { - return strings.Title(pr.Count) -} - -// Condition returns the condition where the PluralRule applies. -func (pr *PluralRule) Condition() string { - i := strings.Index(pr.Rule, "@") - return pr.Rule[:i] -} - -// Examples returns the integer and decimal exmaples for the PLuralRule. -func (pr *PluralRule) Examples() (integer []string, decimal []string) { - ex := strings.Replace(pr.Rule, ", …", "", -1) - ddelim := "@decimal" - if i := strings.Index(ex, ddelim); i > 0 { - dex := strings.TrimSpace(ex[i+len(ddelim):]) - decimal = strings.Split(dex, ", ") - ex = ex[:i] - } - idelim := "@integer" - if i := strings.Index(ex, idelim); i > 0 { - iex := strings.TrimSpace(ex[i+len(idelim):]) - integer = strings.Split(iex, ", ") - } - return integer, decimal -} - -// IntegerExamples returns the integer exmaples for the PLuralRule. -func (pr *PluralRule) IntegerExamples() []string { - integer, _ := pr.Examples() - return integer -} - -// DecimalExamples returns the decimal exmaples for the PLuralRule. -func (pr *PluralRule) DecimalExamples() []string { - _, decimal := pr.Examples() - return decimal -} - -var relationRegexp = regexp.MustCompile("([niftvw])(?: % ([0-9]+))? (!=|=)(.*)") - -// GoCondition converts the XML condition to valid Go code. -func (pr *PluralRule) GoCondition() string { - var ors []string - for _, and := range strings.Split(pr.Condition(), "or") { - var ands []string - for _, relation := range strings.Split(and, "and") { - parts := relationRegexp.FindStringSubmatch(relation) - if parts == nil { - continue - } - lvar, lmod, op, rhs := strings.Title(parts[1]), parts[2], parts[3], strings.TrimSpace(parts[4]) - if op == "=" { - op = "==" - } - lvar = "ops." + lvar - var rhor []string - var rany []string - for _, rh := range strings.Split(rhs, ",") { - if parts := strings.Split(rh, ".."); len(parts) == 2 { - from, to := parts[0], parts[1] - if lvar == "ops.N" { - if lmod != "" { - rhor = append(rhor, fmt.Sprintf("ops.NmodInRange(%s, %s, %s)", lmod, from, to)) - } else { - rhor = append(rhor, fmt.Sprintf("ops.NinRange(%s, %s)", from, to)) - } - } else if lmod != "" { - rhor = append(rhor, fmt.Sprintf("intInRange(%s %% %s, %s, %s)", lvar, lmod, from, to)) - } else { - rhor = append(rhor, fmt.Sprintf("intInRange(%s, %s, %s)", lvar, from, to)) - } - } else { - rany = append(rany, rh) - } - } - - if len(rany) > 0 { - rh := strings.Join(rany, ",") - if lvar == "ops.N" { - if lmod != "" { - rhor = append(rhor, fmt.Sprintf("ops.NmodEqualsAny(%s, %s)", lmod, rh)) - } else { - rhor = append(rhor, fmt.Sprintf("ops.NequalsAny(%s)", rh)) - } - } else if lmod != "" { - rhor = append(rhor, fmt.Sprintf("intEqualsAny(%s %% %s, %s)", lvar, lmod, rh)) - } else { - rhor = append(rhor, fmt.Sprintf("intEqualsAny(%s, %s)", lvar, rh)) - } - } - r := strings.Join(rhor, " || ") - if len(rhor) > 1 { - r = "(" + r + ")" - } - if op == "!=" { - r = "!" + r - } - ands = append(ands, r) - } - ors = append(ors, strings.Join(ands, " && ")) - } - return strings.Join(ors, " ||\n") -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/language.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/language.go deleted file mode 100644 index b045a275..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/language.go +++ /dev/null @@ -1,99 +0,0 @@ -// Package language defines languages that implement CLDR pluralization. -package language - -import ( - "fmt" - "strings" -) - -// Language is a written human language. -type Language struct { - // Tag uniquely identifies the language as defined by RFC 5646. - // - // Most language tags are a two character language code (ISO 639-1) - // optionally followed by a dash and a two character country code (ISO 3166-1). - // (e.g. en, pt-br) - Tag string - *PluralSpec -} - -func (l *Language) String() string { - return l.Tag -} - -// MatchingTags returns the set of language tags that map to this Language. -// e.g. "zh-hans-cn" yields {"zh", "zh-hans", "zh-hans-cn"} -// BUG: This should be computed once and stored as a field on Language for efficiency, -// but this would require changing how Languages are constructed. -func (l *Language) MatchingTags() []string { - parts := strings.Split(l.Tag, "-") - var prefix, matches []string - for _, part := range parts { - prefix = append(prefix, part) - match := strings.Join(prefix, "-") - matches = append(matches, match) - } - return matches -} - -// Parse returns a slice of supported languages found in src or nil if none are found. -// It can parse language tags and Accept-Language headers. -func Parse(src string) []*Language { - var langs []*Language - start := 0 - for end, chr := range src { - switch chr { - case ',', ';', '.': - tag := strings.TrimSpace(src[start:end]) - if spec := GetPluralSpec(tag); spec != nil { - langs = append(langs, &Language{NormalizeTag(tag), spec}) - } - start = end + 1 - } - } - if start > 0 { - tag := strings.TrimSpace(src[start:]) - if spec := GetPluralSpec(tag); spec != nil { - langs = append(langs, &Language{NormalizeTag(tag), spec}) - } - return dedupe(langs) - } - if spec := GetPluralSpec(src); spec != nil { - langs = append(langs, &Language{NormalizeTag(src), spec}) - } - return langs -} - -func dedupe(langs []*Language) []*Language { - found := make(map[string]struct{}, len(langs)) - deduped := make([]*Language, 0, len(langs)) - for _, lang := range langs { - if _, ok := found[lang.Tag]; !ok { - found[lang.Tag] = struct{}{} - deduped = append(deduped, lang) - } - } - return deduped -} - -// MustParse is similar to Parse except it panics instead of retuning a nil Language. -func MustParse(src string) []*Language { - langs := Parse(src) - if len(langs) == 0 { - panic(fmt.Errorf("unable to parse language from %q", src)) - } - return langs -} - -// Add adds support for a new language. -func Add(l *Language) { - tag := NormalizeTag(l.Tag) - pluralSpecs[tag] = l.PluralSpec -} - -// NormalizeTag returns a language tag with all lower-case characters -// and dashes "-" instead of underscores "_" -func NormalizeTag(tag string) string { - tag = strings.ToLower(tag) - return strings.Replace(tag, "_", "-", -1) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/operands.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/operands.go deleted file mode 100644 index 49ee7dc7..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/operands.go +++ /dev/null @@ -1,119 +0,0 @@ -package language - -import ( - "fmt" - "strconv" - "strings" -) - -// http://unicode.org/reports/tr35/tr35-numbers.html#Operands -type Operands struct { - N float64 // absolute value of the source number (integer and decimals) - I int64 // integer digits of n - V int64 // number of visible fraction digits in n, with trailing zeros - W int64 // number of visible fraction digits in n, without trailing zeros - F int64 // visible fractional digits in n, with trailing zeros - T int64 // visible fractional digits in n, without trailing zeros -} - -// NmodEqualAny returns true if o represents an integer equal to any of the arguments. -func (o *Operands) NequalsAny(any ...int64) bool { - for _, i := range any { - if o.I == i && o.T == 0 { - return true - } - } - return false -} - -// NmodEqualAny returns true if o represents an integer equal to any of the arguments modulo mod. -func (o *Operands) NmodEqualsAny(mod int64, any ...int64) bool { - modI := o.I % mod - for _, i := range any { - if modI == i && o.T == 0 { - return true - } - } - return false -} - -// NmodInRange returns true if o represents an integer in the closed interval [from, to]. -func (o *Operands) NinRange(from, to int64) bool { - return o.T == 0 && from <= o.I && o.I <= to -} - -// NmodInRange returns true if o represents an integer in the closed interval [from, to] modulo mod. -func (o *Operands) NmodInRange(mod, from, to int64) bool { - modI := o.I % mod - return o.T == 0 && from <= modI && modI <= to -} - -func newOperands(v interface{}) (*Operands, error) { - switch v := v.(type) { - case int: - return newOperandsInt64(int64(v)), nil - case int8: - return newOperandsInt64(int64(v)), nil - case int16: - return newOperandsInt64(int64(v)), nil - case int32: - return newOperandsInt64(int64(v)), nil - case int64: - return newOperandsInt64(v), nil - case string: - return newOperandsString(v) - case float32, float64: - return nil, fmt.Errorf("floats should be formatted into a string") - default: - return nil, fmt.Errorf("invalid type %T; expected integer or string", v) - } -} - -func newOperandsInt64(i int64) *Operands { - if i < 0 { - i = -i - } - return &Operands{float64(i), i, 0, 0, 0, 0} -} - -func newOperandsString(s string) (*Operands, error) { - if s[0] == '-' { - s = s[1:] - } - n, err := strconv.ParseFloat(s, 64) - if err != nil { - return nil, err - } - ops := &Operands{N: n} - parts := strings.SplitN(s, ".", 2) - ops.I, err = strconv.ParseInt(parts[0], 10, 64) - if err != nil { - return nil, err - } - if len(parts) == 1 { - return ops, nil - } - fraction := parts[1] - ops.V = int64(len(fraction)) - for i := ops.V - 1; i >= 0; i-- { - if fraction[i] != '0' { - ops.W = i + 1 - break - } - } - if ops.V > 0 { - f, err := strconv.ParseInt(fraction, 10, 0) - if err != nil { - return nil, err - } - ops.F = f - } - if ops.W > 0 { - t, err := strconv.ParseInt(fraction[:ops.W], 10, 0) - if err != nil { - return nil, err - } - ops.T = t - } - return ops, nil -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/plural.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/plural.go deleted file mode 100644 index 1f3ea5c6..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/plural.go +++ /dev/null @@ -1,40 +0,0 @@ -package language - -import ( - "fmt" -) - -// Plural represents a language pluralization form as defined here: -// http://cldr.unicode.org/index/cldr-spec/plural-rules -type Plural string - -// All defined plural categories. -const ( - Invalid Plural = "invalid" - Zero = "zero" - One = "one" - Two = "two" - Few = "few" - Many = "many" - Other = "other" -) - -// NewPlural returns src as a Plural -// or Invalid and a non-nil error if src is not a valid Plural. -func NewPlural(src string) (Plural, error) { - switch src { - case "zero": - return Zero, nil - case "one": - return One, nil - case "two": - return Two, nil - case "few": - return Few, nil - case "many": - return Many, nil - case "other": - return Other, nil - } - return Invalid, fmt.Errorf("invalid plural category %s", src) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec.go deleted file mode 100644 index fc31e880..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec.go +++ /dev/null @@ -1,75 +0,0 @@ -package language - -import "strings" - -// PluralSpec defines the CLDR plural rules for a language. -// http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html -// http://unicode.org/reports/tr35/tr35-numbers.html#Operands -type PluralSpec struct { - Plurals map[Plural]struct{} - PluralFunc func(*Operands) Plural -} - -var pluralSpecs = make(map[string]*PluralSpec) - -func normalizePluralSpecID(id string) string { - id = strings.Replace(id, "_", "-", -1) - id = strings.ToLower(id) - return id -} - -// RegisterPluralSpec registers a new plural spec for the language ids. -func RegisterPluralSpec(ids []string, ps *PluralSpec) { - for _, id := range ids { - id = normalizePluralSpecID(id) - pluralSpecs[id] = ps - } -} - -// Plural returns the plural category for number as defined by -// the language's CLDR plural rules. -func (ps *PluralSpec) Plural(number interface{}) (Plural, error) { - ops, err := newOperands(number) - if err != nil { - return Invalid, err - } - return ps.PluralFunc(ops), nil -} - -// GetPluralSpec returns the PluralSpec that matches the longest prefix of tag. -// It returns nil if no PluralSpec matches tag. -func GetPluralSpec(tag string) *PluralSpec { - tag = NormalizeTag(tag) - subtag := tag - for { - if spec := pluralSpecs[subtag]; spec != nil { - return spec - } - end := strings.LastIndex(subtag, "-") - if end == -1 { - return nil - } - subtag = subtag[:end] - } -} - -func newPluralSet(plurals ...Plural) map[Plural]struct{} { - set := make(map[Plural]struct{}, len(plurals)) - for _, plural := range plurals { - set[plural] = struct{}{} - } - return set -} - -func intInRange(i, from, to int64) bool { - return from <= i && i <= to -} - -func intEqualsAny(i int64, any ...int64) bool { - for _, a := range any { - if i == a { - return true - } - } - return false -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec_gen.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec_gen.go deleted file mode 100644 index 0268bb92..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/language/pluralspec_gen.go +++ /dev/null @@ -1,557 +0,0 @@ -package language - -// This file is generated by i18n/language/codegen/generate.sh - -func init() { - - RegisterPluralSpec([]string{"bm", "bo", "dz", "id", "ig", "ii", "in", "ja", "jbo", "jv", "jw", "kde", "kea", "km", "ko", "lkt", "lo", "ms", "my", "nqo", "root", "sah", "ses", "sg", "th", "to", "vi", "wo", "yo", "yue", "zh"}, &PluralSpec{ - Plurals: newPluralSet(Other), - PluralFunc: func(ops *Operands) Plural { - return Other - }, - }) - RegisterPluralSpec([]string{"am", "as", "bn", "fa", "gu", "hi", "kn", "mr", "zu"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 0 or n = 1 - if intEqualsAny(ops.I, 0) || - ops.NequalsAny(1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"ff", "fr", "hy", "kab"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 0,1 - if intEqualsAny(ops.I, 0, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"pt"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 0..1 - if intInRange(ops.I, 0, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"ast", "ca", "de", "en", "et", "fi", "fy", "gl", "it", "ji", "nl", "sv", "sw", "ur", "yi"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"si"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0,1 or i = 0 and f = 1 - if ops.NequalsAny(0, 1) || - intEqualsAny(ops.I, 0) && intEqualsAny(ops.F, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"ak", "bh", "guw", "ln", "mg", "nso", "pa", "ti", "wa"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0..1 - if ops.NinRange(0, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"tzm"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0..1 or n = 11..99 - if ops.NinRange(0, 1) || - ops.NinRange(11, 99) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"af", "asa", "az", "bem", "bez", "bg", "brx", "ce", "cgg", "chr", "ckb", "dv", "ee", "el", "eo", "es", "eu", "fo", "fur", "gsw", "ha", "haw", "hu", "jgo", "jmc", "ka", "kaj", "kcg", "kk", "kkj", "kl", "ks", "ksb", "ku", "ky", "lb", "lg", "mas", "mgo", "ml", "mn", "nah", "nb", "nd", "ne", "nn", "nnh", "no", "nr", "ny", "nyn", "om", "or", "os", "pap", "ps", "rm", "rof", "rwk", "saq", "sdh", "seh", "sn", "so", "sq", "ss", "ssy", "st", "syr", "ta", "te", "teo", "tig", "tk", "tn", "tr", "ts", "ug", "uz", "ve", "vo", "vun", "wae", "xh", "xog"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 1 - if ops.NequalsAny(1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"da"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 1 or t != 0 and i = 0,1 - if ops.NequalsAny(1) || - !intEqualsAny(ops.T, 0) && intEqualsAny(ops.I, 0, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"is"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // t = 0 and i % 10 = 1 and i % 100 != 11 or t != 0 - if intEqualsAny(ops.T, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) || - !intEqualsAny(ops.T, 0) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"mk"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i % 10 = 1 or f % 10 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) || - intEqualsAny(ops.F%10, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"fil", "tl"}, &PluralSpec{ - Plurals: newPluralSet(One, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I, 1, 2, 3) || - intEqualsAny(ops.V, 0) && !intEqualsAny(ops.I%10, 4, 6, 9) || - !intEqualsAny(ops.V, 0) && !intEqualsAny(ops.F%10, 4, 6, 9) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"lv", "prg"}, &PluralSpec{ - Plurals: newPluralSet(Zero, One, Other), - PluralFunc: func(ops *Operands) Plural { - // n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 - if ops.NmodEqualsAny(10, 0) || - ops.NmodInRange(100, 11, 19) || - intEqualsAny(ops.V, 2) && intInRange(ops.F%100, 11, 19) { - return Zero - } - // n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 - if ops.NmodEqualsAny(10, 1) && !ops.NmodEqualsAny(100, 11) || - intEqualsAny(ops.V, 2) && intEqualsAny(ops.F%10, 1) && !intEqualsAny(ops.F%100, 11) || - !intEqualsAny(ops.V, 2) && intEqualsAny(ops.F%10, 1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"lag"}, &PluralSpec{ - Plurals: newPluralSet(Zero, One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0 - if ops.NequalsAny(0) { - return Zero - } - // i = 0,1 and n != 0 - if intEqualsAny(ops.I, 0, 1) && !ops.NequalsAny(0) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"ksh"}, &PluralSpec{ - Plurals: newPluralSet(Zero, One, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0 - if ops.NequalsAny(0) { - return Zero - } - // n = 1 - if ops.NequalsAny(1) { - return One - } - return Other - }, - }) - RegisterPluralSpec([]string{"iu", "kw", "naq", "se", "sma", "smi", "smj", "smn", "sms"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 1 - if ops.NequalsAny(1) { - return One - } - // n = 2 - if ops.NequalsAny(2) { - return Two - } - return Other - }, - }) - RegisterPluralSpec([]string{"shi"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 0 or n = 1 - if intEqualsAny(ops.I, 0) || - ops.NequalsAny(1) { - return One - } - // n = 2..10 - if ops.NinRange(2, 10) { - return Few - } - return Other - }, - }) - RegisterPluralSpec([]string{"mo", "ro"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // v != 0 or n = 0 or n != 1 and n % 100 = 1..19 - if !intEqualsAny(ops.V, 0) || - ops.NequalsAny(0) || - !ops.NequalsAny(1) && ops.NmodInRange(100, 1, 19) { - return Few - } - return Other - }, - }) - RegisterPluralSpec([]string{"bs", "hr", "sh", "sr"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) || - intEqualsAny(ops.F%10, 1) && !intEqualsAny(ops.F%100, 11) { - return One - } - // v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 2, 4) && !intInRange(ops.I%100, 12, 14) || - intInRange(ops.F%10, 2, 4) && !intInRange(ops.F%100, 12, 14) { - return Few - } - return Other - }, - }) - RegisterPluralSpec([]string{"gd"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Few, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 1,11 - if ops.NequalsAny(1, 11) { - return One - } - // n = 2,12 - if ops.NequalsAny(2, 12) { - return Two - } - // n = 3..10,13..19 - if ops.NinRange(3, 10) || ops.NinRange(13, 19) { - return Few - } - return Other - }, - }) - RegisterPluralSpec([]string{"sl"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Few, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i % 100 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 1) { - return One - } - // v = 0 and i % 100 = 2 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 2) { - return Two - } - // v = 0 and i % 100 = 3..4 or v != 0 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 3, 4) || - !intEqualsAny(ops.V, 0) { - return Few - } - return Other - }, - }) - RegisterPluralSpec([]string{"dsb", "hsb"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Few, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i % 100 = 1 or f % 100 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 1) || - intEqualsAny(ops.F%100, 1) { - return One - } - // v = 0 and i % 100 = 2 or f % 100 = 2 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 2) || - intEqualsAny(ops.F%100, 2) { - return Two - } - // v = 0 and i % 100 = 3..4 or f % 100 = 3..4 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 3, 4) || - intInRange(ops.F%100, 3, 4) { - return Few - } - return Other - }, - }) - RegisterPluralSpec([]string{"he", "iw"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // i = 2 and v = 0 - if intEqualsAny(ops.I, 2) && intEqualsAny(ops.V, 0) { - return Two - } - // v = 0 and n != 0..10 and n % 10 = 0 - if intEqualsAny(ops.V, 0) && !ops.NinRange(0, 10) && ops.NmodEqualsAny(10, 0) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"cs", "sk"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // i = 2..4 and v = 0 - if intInRange(ops.I, 2, 4) && intEqualsAny(ops.V, 0) { - return Few - } - // v != 0 - if !intEqualsAny(ops.V, 0) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"pl"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // v = 0 and i % 10 = 2..4 and i % 100 != 12..14 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 2, 4) && !intInRange(ops.I%100, 12, 14) { - return Few - } - // v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14 - if intEqualsAny(ops.V, 0) && !intEqualsAny(ops.I, 1) && intInRange(ops.I%10, 0, 1) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 5, 9) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 12, 14) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"be"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n % 10 = 1 and n % 100 != 11 - if ops.NmodEqualsAny(10, 1) && !ops.NmodEqualsAny(100, 11) { - return One - } - // n % 10 = 2..4 and n % 100 != 12..14 - if ops.NmodInRange(10, 2, 4) && !ops.NmodInRange(100, 12, 14) { - return Few - } - // n % 10 = 0 or n % 10 = 5..9 or n % 100 = 11..14 - if ops.NmodEqualsAny(10, 0) || - ops.NmodInRange(10, 5, 9) || - ops.NmodInRange(100, 11, 14) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"lt"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n % 10 = 1 and n % 100 != 11..19 - if ops.NmodEqualsAny(10, 1) && !ops.NmodInRange(100, 11, 19) { - return One - } - // n % 10 = 2..9 and n % 100 != 11..19 - if ops.NmodInRange(10, 2, 9) && !ops.NmodInRange(100, 11, 19) { - return Few - } - // f != 0 - if !intEqualsAny(ops.F, 0) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"mt"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 1 - if ops.NequalsAny(1) { - return One - } - // n = 0 or n % 100 = 2..10 - if ops.NequalsAny(0) || - ops.NmodInRange(100, 2, 10) { - return Few - } - // n % 100 = 11..19 - if ops.NmodInRange(100, 11, 19) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"ru", "uk"}, &PluralSpec{ - Plurals: newPluralSet(One, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i % 10 = 1 and i % 100 != 11 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) { - return One - } - // v = 0 and i % 10 = 2..4 and i % 100 != 12..14 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 2, 4) && !intInRange(ops.I%100, 12, 14) { - return Few - } - // v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 0) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 5, 9) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 11, 14) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"br"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n % 10 = 1 and n % 100 != 11,71,91 - if ops.NmodEqualsAny(10, 1) && !ops.NmodEqualsAny(100, 11, 71, 91) { - return One - } - // n % 10 = 2 and n % 100 != 12,72,92 - if ops.NmodEqualsAny(10, 2) && !ops.NmodEqualsAny(100, 12, 72, 92) { - return Two - } - // n % 10 = 3..4,9 and n % 100 != 10..19,70..79,90..99 - if (ops.NmodInRange(10, 3, 4) || ops.NmodEqualsAny(10, 9)) && !(ops.NmodInRange(100, 10, 19) || ops.NmodInRange(100, 70, 79) || ops.NmodInRange(100, 90, 99)) { - return Few - } - // n != 0 and n % 1000000 = 0 - if !ops.NequalsAny(0) && ops.NmodEqualsAny(1000000, 0) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"ga"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 1 - if ops.NequalsAny(1) { - return One - } - // n = 2 - if ops.NequalsAny(2) { - return Two - } - // n = 3..6 - if ops.NinRange(3, 6) { - return Few - } - // n = 7..10 - if ops.NinRange(7, 10) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"gv"}, &PluralSpec{ - Plurals: newPluralSet(One, Two, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // v = 0 and i % 10 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) { - return One - } - // v = 0 and i % 10 = 2 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 2) { - return Two - } - // v = 0 and i % 100 = 0,20,40,60,80 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 0, 20, 40, 60, 80) { - return Few - } - // v != 0 - if !intEqualsAny(ops.V, 0) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"ar", "ars"}, &PluralSpec{ - Plurals: newPluralSet(Zero, One, Two, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0 - if ops.NequalsAny(0) { - return Zero - } - // n = 1 - if ops.NequalsAny(1) { - return One - } - // n = 2 - if ops.NequalsAny(2) { - return Two - } - // n % 100 = 3..10 - if ops.NmodInRange(100, 3, 10) { - return Few - } - // n % 100 = 11..99 - if ops.NmodInRange(100, 11, 99) { - return Many - } - return Other - }, - }) - RegisterPluralSpec([]string{"cy"}, &PluralSpec{ - Plurals: newPluralSet(Zero, One, Two, Few, Many, Other), - PluralFunc: func(ops *Operands) Plural { - // n = 0 - if ops.NequalsAny(0) { - return Zero - } - // n = 1 - if ops.NequalsAny(1) { - return One - } - // n = 2 - if ops.NequalsAny(2) { - return Two - } - // n = 3 - if ops.NequalsAny(3) { - return Few - } - // n = 6 - if ops.NequalsAny(6) { - return Many - } - return Other - }, - }) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/plural_translation.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/plural_translation.go deleted file mode 100644 index 17c32609..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/plural_translation.go +++ /dev/null @@ -1,82 +0,0 @@ -package translation - -import ( - "github.com/nicksnyder/go-i18n/i18n/language" -) - -type pluralTranslation struct { - id string - templates map[language.Plural]*template -} - -func (pt *pluralTranslation) MarshalInterface() interface{} { - return map[string]interface{}{ - "id": pt.id, - "translation": pt.templates, - } -} - -func (pt *pluralTranslation) MarshalFlatInterface() interface{} { - return pt.templates -} - -func (pt *pluralTranslation) ID() string { - return pt.id -} - -func (pt *pluralTranslation) Template(pc language.Plural) *template { - return pt.templates[pc] -} - -func (pt *pluralTranslation) UntranslatedCopy() Translation { - return &pluralTranslation{pt.id, make(map[language.Plural]*template)} -} - -func (pt *pluralTranslation) Normalize(l *language.Language) Translation { - // Delete plural categories that don't belong to this language. - for pc := range pt.templates { - if _, ok := l.Plurals[pc]; !ok { - delete(pt.templates, pc) - } - } - // Create map entries for missing valid categories. - for pc := range l.Plurals { - if _, ok := pt.templates[pc]; !ok { - pt.templates[pc] = mustNewTemplate("") - } - } - return pt -} - -func (pt *pluralTranslation) Backfill(src Translation) Translation { - for pc, t := range pt.templates { - if (t == nil || t.src == "") && src != nil { - pt.templates[pc] = src.Template(language.Other) - } - } - return pt -} - -func (pt *pluralTranslation) Merge(t Translation) Translation { - other, ok := t.(*pluralTranslation) - if !ok || pt.ID() != t.ID() { - return t - } - for pluralCategory, template := range other.templates { - if template != nil && template.src != "" { - pt.templates[pluralCategory] = template - } - } - return pt -} - -func (pt *pluralTranslation) Incomplete(l *language.Language) bool { - for pc := range l.Plurals { - if t := pt.templates[pc]; t == nil || t.src == "" { - return true - } - } - return false -} - -var _ = Translation(&pluralTranslation{}) diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go deleted file mode 100644 index a76c8c94..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/single_translation.go +++ /dev/null @@ -1,61 +0,0 @@ -package translation - -import ( - "github.com/nicksnyder/go-i18n/i18n/language" -) - -type singleTranslation struct { - id string - template *template -} - -func (st *singleTranslation) MarshalInterface() interface{} { - return map[string]interface{}{ - "id": st.id, - "translation": st.template, - } -} - -func (st *singleTranslation) MarshalFlatInterface() interface{} { - return map[string]interface{}{"other": st.template} -} - -func (st *singleTranslation) ID() string { - return st.id -} - -func (st *singleTranslation) Template(pc language.Plural) *template { - return st.template -} - -func (st *singleTranslation) UntranslatedCopy() Translation { - return &singleTranslation{st.id, mustNewTemplate("")} -} - -func (st *singleTranslation) Normalize(language *language.Language) Translation { - return st -} - -func (st *singleTranslation) Backfill(src Translation) Translation { - if (st.template == nil || st.template.src == "") && src != nil { - st.template = src.Template(language.Other) - } - return st -} - -func (st *singleTranslation) Merge(t Translation) Translation { - other, ok := t.(*singleTranslation) - if !ok || st.ID() != t.ID() { - return t - } - if other.template != nil && other.template.src != "" { - st.template = other.template - } - return st -} - -func (st *singleTranslation) Incomplete(l *language.Language) bool { - return st.template == nil || st.template.src == "" -} - -var _ = Translation(&singleTranslation{}) diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/template.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/template.go deleted file mode 100644 index 3310150c..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/template.go +++ /dev/null @@ -1,65 +0,0 @@ -package translation - -import ( - "bytes" - "encoding" - "strings" - gotemplate "text/template" -) - -type template struct { - tmpl *gotemplate.Template - src string -} - -func newTemplate(src string) (*template, error) { - if src == "" { - return new(template), nil - } - - var tmpl template - err := tmpl.parseTemplate(src) - return &tmpl, err -} - -func mustNewTemplate(src string) *template { - t, err := newTemplate(src) - if err != nil { - panic(err) - } - return t -} - -func (t *template) String() string { - return t.src -} - -func (t *template) Execute(args interface{}) string { - if t.tmpl == nil { - return t.src - } - var buf bytes.Buffer - if err := t.tmpl.Execute(&buf, args); err != nil { - return err.Error() - } - return buf.String() -} - -func (t *template) MarshalText() ([]byte, error) { - return []byte(t.src), nil -} - -func (t *template) UnmarshalText(src []byte) error { - return t.parseTemplate(string(src)) -} - -func (t *template) parseTemplate(src string) (err error) { - t.src = src - if strings.Contains(src, "{{") { - t.tmpl, err = gotemplate.New(src).Parse(src) - } - return -} - -var _ = encoding.TextMarshaler(&template{}) -var _ = encoding.TextUnmarshaler(&template{}) diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/translation.go b/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/translation.go deleted file mode 100644 index 19751462..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/nicksnyder/go-i18n/i18n/translation/translation.go +++ /dev/null @@ -1,84 +0,0 @@ -// Package translation defines the interface for a translation. -package translation - -import ( - "fmt" - - "github.com/nicksnyder/go-i18n/i18n/language" -) - -// Translation is the interface that represents a translated string. -type Translation interface { - // MarshalInterface returns the object that should be used - // to serialize the translation. - MarshalInterface() interface{} - MarshalFlatInterface() interface{} - ID() string - Template(language.Plural) *template - UntranslatedCopy() Translation - Normalize(language *language.Language) Translation - Backfill(src Translation) Translation - Merge(Translation) Translation - Incomplete(l *language.Language) bool -} - -// SortableByID implements sort.Interface for a slice of translations. -type SortableByID []Translation - -func (a SortableByID) Len() int { return len(a) } -func (a SortableByID) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a SortableByID) Less(i, j int) bool { return a[i].ID() < a[j].ID() } - -// NewTranslation reflects on data to create a new Translation. -// -// data["id"] must be a string and data["translation"] must be either a string -// for a non-plural translation or a map[string]interface{} for a plural translation. -func NewTranslation(data map[string]interface{}) (Translation, error) { - id, ok := data["id"].(string) - if !ok { - return nil, fmt.Errorf(`missing "id" key`) - } - var pluralObject map[string]interface{} - switch translation := data["translation"].(type) { - case string: - tmpl, err := newTemplate(translation) - if err != nil { - return nil, err - } - return &singleTranslation{id, tmpl}, nil - case map[interface{}]interface{}: - // The YAML parser uses interface{} keys so we first convert them to string keys. - pluralObject = make(map[string]interface{}) - for k, v := range translation { - kStr, ok := k.(string) - if !ok { - return nil, fmt.Errorf(`invalid plural category type %T; expected string`, k) - } - pluralObject[kStr] = v - } - case map[string]interface{}: - pluralObject = translation - case nil: - return nil, fmt.Errorf(`missing "translation" key`) - default: - return nil, fmt.Errorf(`unsupported type for "translation" key %T`, translation) - } - - templates := make(map[language.Plural]*template, len(pluralObject)) - for k, v := range pluralObject { - pc, err := language.NewPlural(k) - if err != nil { - return nil, err - } - str, ok := v.(string) - if !ok { - return nil, fmt.Errorf(`plural category "%s" has value of type %T; expected string`, pc, v) - } - tmpl, err := newTemplate(str) - if err != nil { - return nil, err - } - templates[pc] = tmpl - } - return &pluralTranslation{id, templates}, nil -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/LICENSE.txt b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/test_program.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/test_program.go deleted file mode 100644 index 73077f61..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/test_program.go +++ /dev/null @@ -1,91 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "os" - "time" - - "github.com/pelletier/go-toml" -) - -func main() { - bytes, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Fatalf("Error during TOML read: %s", err) - os.Exit(2) - } - tree, err := toml.Load(string(bytes)) - if err != nil { - log.Fatalf("Error during TOML load: %s", err) - os.Exit(1) - } - - typedTree := translate(*tree) - - if err := json.NewEncoder(os.Stdout).Encode(typedTree); err != nil { - log.Fatalf("Error encoding JSON: %s", err) - os.Exit(3) - } - - os.Exit(0) -} - -func translate(tomlData interface{}) interface{} { - switch orig := tomlData.(type) { - case map[string]interface{}: - typed := make(map[string]interface{}, len(orig)) - for k, v := range orig { - typed[k] = translate(v) - } - return typed - case *toml.Tree: - return translate(*orig) - case toml.Tree: - keys := orig.Keys() - typed := make(map[string]interface{}, len(keys)) - for _, k := range keys { - typed[k] = translate(orig.GetPath([]string{k})) - } - return typed - case []*toml.Tree: - typed := make([]map[string]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v).(map[string]interface{}) - } - return typed - case []map[string]interface{}: - typed := make([]map[string]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v).(map[string]interface{}) - } - return typed - case []interface{}: - typed := make([]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v) - } - return tag("array", typed) - case time.Time: - return tag("datetime", orig.Format("2006-01-02T15:04:05Z")) - case bool: - return tag("bool", fmt.Sprintf("%v", orig)) - case int64: - return tag("integer", fmt.Sprintf("%d", orig)) - case float64: - return tag("float", fmt.Sprintf("%v", orig)) - case string: - return tag("string", orig) - } - - panic(fmt.Sprintf("Unknown type: %T", tomlData)) -} - -func tag(typeName string, data interface{}) map[string]interface{} { - return map[string]interface{}{ - "type": typeName, - "value": data, - } -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go deleted file mode 100644 index b2d6fc67..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go +++ /dev/null @@ -1,72 +0,0 @@ -// Tomljson reads TOML and converts to JSON. -// -// Usage: -// cat file.toml | tomljson > file.json -// tomljson file1.toml > file.json -package main - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "os" - - "github.com/pelletier/go-toml" -) - -func main() { - flag.Usage = func() { - fmt.Fprintln(os.Stderr, `tomljson can be used in two ways: -Writing to STDIN and reading from STDOUT: - cat file.toml | tomljson > file.json - -Reading from a file name: - tomljson file.toml -`) - } - flag.Parse() - os.Exit(processMain(flag.Args(), os.Stdin, os.Stdout, os.Stderr)) -} - -func processMain(files []string, defaultInput io.Reader, output io.Writer, errorOutput io.Writer) int { - // read from stdin and print to stdout - inputReader := defaultInput - - if len(files) > 0 { - var err error - inputReader, err = os.Open(files[0]) - if err != nil { - printError(err, errorOutput) - return -1 - } - } - s, err := reader(inputReader) - if err != nil { - printError(err, errorOutput) - return -1 - } - io.WriteString(output, s+"\n") - return 0 -} - -func printError(err error, output io.Writer) { - io.WriteString(output, err.Error()+"\n") -} - -func reader(r io.Reader) (string, error) { - tree, err := toml.LoadReader(r) - if err != nil { - return "", err - } - return mapToJSON(tree) -} - -func mapToJSON(tree *toml.Tree) (string, error) { - treeMap := tree.ToMap() - bytes, err := json.MarshalIndent(treeMap, "", " ") - if err != nil { - return "", err - } - return string(bytes[:]), nil -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go deleted file mode 100644 index 36c7e375..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go +++ /dev/null @@ -1,66 +0,0 @@ -// Tomll is a linter for TOML -// -// Usage: -// cat file.toml | tomll > file_linted.toml -// tomll file1.toml file2.toml # lint the two files in place -package main - -import ( - "flag" - "fmt" - "io" - "io/ioutil" - "os" - - "github.com/pelletier/go-toml" -) - -func main() { - flag.Usage = func() { - fmt.Fprintln(os.Stderr, `tomll can be used in two ways: -Writing to STDIN and reading from STDOUT: - cat file.toml | tomll > file.toml - -Reading and updating a list of files: - tomll a.toml b.toml c.toml - -When given a list of files, tomll will modify all files in place without asking. -`) - } - flag.Parse() - // read from stdin and print to stdout - if flag.NArg() == 0 { - s, err := lintReader(os.Stdin) - if err != nil { - io.WriteString(os.Stderr, err.Error()) - os.Exit(-1) - } - io.WriteString(os.Stdout, s) - } else { - // otherwise modify a list of files - for _, filename := range flag.Args() { - s, err := lintFile(filename) - if err != nil { - io.WriteString(os.Stderr, err.Error()) - os.Exit(-1) - } - ioutil.WriteFile(filename, []byte(s), 0644) - } - } -} - -func lintFile(filename string) (string, error) { - tree, err := toml.LoadFile(filename) - if err != nil { - return "", err - } - return tree.String(), nil -} - -func lintReader(r io.Reader) (string, error) { - tree, err := toml.LoadReader(r) - if err != nil { - return "", err - } - return tree.String(), nil -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/doc.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/doc.go deleted file mode 100644 index d5fd98c0..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Package toml is a TOML parser and manipulation library. -// -// This version supports the specification as described in -// https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md -// -// Marshaling -// -// Go-toml can marshal and unmarshal TOML documents from and to data -// structures. -// -// TOML document as a tree -// -// Go-toml can operate on a TOML document as a tree. Use one of the Load* -// functions to parse TOML data and obtain a Tree instance, then one of its -// methods to manipulate the tree. -// -// JSONPath-like queries -// -// The package github.com/pelletier/go-toml/query implements a system -// similar to JSONPath to quickly retrieve elements of a TOML document using a -// single expression. See the package documentation for more information. -// -package toml diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/fuzz.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/fuzz.go deleted file mode 100644 index 14570c8d..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/fuzz.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build gofuzz - -package toml - -func Fuzz(data []byte) int { - tree, err := LoadBytes(data) - if err != nil { - if tree != nil { - panic("tree must be nil if there is an error") - } - return 0 - } - - str, err := tree.ToTomlString() - if err != nil { - if str != "" { - panic(`str must be "" if there is an error`) - } - panic(err) - } - - tree, err = Load(str) - if err != nil { - if tree != nil { - panic("tree must be nil if there is an error") - } - return 0 - } - - return 1 -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/keysparsing.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/keysparsing.go deleted file mode 100644 index 9707c688..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/keysparsing.go +++ /dev/null @@ -1,161 +0,0 @@ -// Parsing keys handling both bare and quoted keys. - -package toml - -import ( - "bytes" - "errors" - "fmt" - "strconv" - "unicode" -) - -var escapeSequenceMap = map[rune]rune{ - 'b': '\b', - 't': '\t', - 'n': '\n', - 'f': '\f', - 'r': '\r', - '"': '"', - '\\': '\\', -} - -type parseKeyState int - -const ( - BARE parseKeyState = iota - BASIC - LITERAL - ESC - UNICODE_4 - UNICODE_8 -) - -func parseKey(key string) ([]string, error) { - groups := []string{} - var buffer bytes.Buffer - var hex bytes.Buffer - state := BARE - wasInQuotes := false - ignoreSpace := true - expectDot := false - - for _, char := range key { - if ignoreSpace { - if char == ' ' { - continue - } - ignoreSpace = false - } - - if state == ESC { - if char == 'u' { - state = UNICODE_4 - hex.Reset() - } else if char == 'U' { - state = UNICODE_8 - hex.Reset() - } else if newChar, ok := escapeSequenceMap[char]; ok { - buffer.WriteRune(newChar) - state = BASIC - } else { - return nil, fmt.Errorf(`invalid escape sequence \%c`, char) - } - continue - } - - if state == UNICODE_4 || state == UNICODE_8 { - if isHexDigit(char) { - hex.WriteRune(char) - } - if (state == UNICODE_4 && hex.Len() == 4) || (state == UNICODE_8 && hex.Len() == 8) { - if value, err := strconv.ParseInt(hex.String(), 16, 32); err == nil { - buffer.WriteRune(rune(value)) - } else { - return nil, err - } - state = BASIC - } - continue - } - - switch char { - case '\\': - if state == BASIC { - state = ESC - } else if state == LITERAL { - buffer.WriteRune(char) - } - case '\'': - if state == BARE { - state = LITERAL - } else if state == LITERAL { - groups = append(groups, buffer.String()) - buffer.Reset() - wasInQuotes = true - state = BARE - } - expectDot = false - case '"': - if state == BARE { - state = BASIC - } else if state == BASIC { - groups = append(groups, buffer.String()) - buffer.Reset() - state = BARE - wasInQuotes = true - } - expectDot = false - case '.': - if state != BARE { - buffer.WriteRune(char) - } else { - if !wasInQuotes { - if buffer.Len() == 0 { - return nil, errors.New("empty table key") - } - groups = append(groups, buffer.String()) - buffer.Reset() - } - ignoreSpace = true - expectDot = false - wasInQuotes = false - } - case ' ': - if state == BASIC { - buffer.WriteRune(char) - } else { - expectDot = true - } - default: - if state == BARE { - if !isValidBareChar(char) { - return nil, fmt.Errorf("invalid bare character: %c", char) - } else if expectDot { - return nil, errors.New("what?") - } - } - buffer.WriteRune(char) - expectDot = false - } - } - - // state must be BARE at the end - if state == ESC { - return nil, errors.New("unfinished escape sequence") - } else if state != BARE { - return nil, errors.New("mismatched quotes") - } - - if buffer.Len() > 0 { - groups = append(groups, buffer.String()) - } - if len(groups) == 0 { - return nil, errors.New("empty key") - } - return groups, nil -} - -func isValidBareChar(r rune) bool { - return isAlphanumeric(r) || r == '-' || unicode.IsNumber(r) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/lexer.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/lexer.go deleted file mode 100644 index 1b6647d6..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/lexer.go +++ /dev/null @@ -1,651 +0,0 @@ -// TOML lexer. -// -// Written using the principles developed by Rob Pike in -// http://www.youtube.com/watch?v=HxaD_trXwRE - -package toml - -import ( - "bytes" - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -var dateRegexp *regexp.Regexp - -// Define state functions -type tomlLexStateFn func() tomlLexStateFn - -// Define lexer -type tomlLexer struct { - inputIdx int - input []rune // Textual source - currentTokenStart int - currentTokenStop int - tokens []token - depth int - line int - col int - endbufferLine int - endbufferCol int -} - -// Basic read operations on input - -func (l *tomlLexer) read() rune { - r := l.peek() - if r == '\n' { - l.endbufferLine++ - l.endbufferCol = 1 - } else { - l.endbufferCol++ - } - l.inputIdx++ - return r -} - -func (l *tomlLexer) next() rune { - r := l.read() - - if r != eof { - l.currentTokenStop++ - } - return r -} - -func (l *tomlLexer) ignore() { - l.currentTokenStart = l.currentTokenStop - l.line = l.endbufferLine - l.col = l.endbufferCol -} - -func (l *tomlLexer) skip() { - l.next() - l.ignore() -} - -func (l *tomlLexer) fastForward(n int) { - for i := 0; i < n; i++ { - l.next() - } -} - -func (l *tomlLexer) emitWithValue(t tokenType, value string) { - l.tokens = append(l.tokens, token{ - Position: Position{l.line, l.col}, - typ: t, - val: value, - }) - l.ignore() -} - -func (l *tomlLexer) emit(t tokenType) { - l.emitWithValue(t, string(l.input[l.currentTokenStart:l.currentTokenStop])) -} - -func (l *tomlLexer) peek() rune { - if l.inputIdx >= len(l.input) { - return eof - } - return l.input[l.inputIdx] -} - -func (l *tomlLexer) peekString(size int) string { - maxIdx := len(l.input) - upperIdx := l.inputIdx + size // FIXME: potential overflow - if upperIdx > maxIdx { - upperIdx = maxIdx - } - return string(l.input[l.inputIdx:upperIdx]) -} - -func (l *tomlLexer) follow(next string) bool { - return next == l.peekString(len(next)) -} - -// Error management - -func (l *tomlLexer) errorf(format string, args ...interface{}) tomlLexStateFn { - l.tokens = append(l.tokens, token{ - Position: Position{l.line, l.col}, - typ: tokenError, - val: fmt.Sprintf(format, args...), - }) - return nil -} - -// State functions - -func (l *tomlLexer) lexVoid() tomlLexStateFn { - for { - next := l.peek() - switch next { - case '[': - return l.lexTableKey - case '#': - return l.lexComment(l.lexVoid) - case '=': - return l.lexEqual - case '\r': - fallthrough - case '\n': - l.skip() - continue - } - - if isSpace(next) { - l.skip() - } - - if l.depth > 0 { - return l.lexRvalue - } - - if isKeyStartChar(next) { - return l.lexKey - } - - if next == eof { - l.next() - break - } - } - - l.emit(tokenEOF) - return nil -} - -func (l *tomlLexer) lexRvalue() tomlLexStateFn { - for { - next := l.peek() - switch next { - case '.': - return l.errorf("cannot start float with a dot") - case '=': - return l.lexEqual - case '[': - l.depth++ - return l.lexLeftBracket - case ']': - l.depth-- - return l.lexRightBracket - case '{': - return l.lexLeftCurlyBrace - case '}': - return l.lexRightCurlyBrace - case '#': - return l.lexComment(l.lexRvalue) - case '"': - return l.lexString - case '\'': - return l.lexLiteralString - case ',': - return l.lexComma - case '\r': - fallthrough - case '\n': - l.skip() - if l.depth == 0 { - return l.lexVoid - } - return l.lexRvalue - case '_': - return l.errorf("cannot start number with underscore") - } - - if l.follow("true") { - return l.lexTrue - } - - if l.follow("false") { - return l.lexFalse - } - - if isSpace(next) { - l.skip() - continue - } - - if next == eof { - l.next() - break - } - - possibleDate := l.peekString(35) - dateMatch := dateRegexp.FindString(possibleDate) - if dateMatch != "" { - l.fastForward(len(dateMatch)) - return l.lexDate - } - - if next == '+' || next == '-' || isDigit(next) { - return l.lexNumber - } - - if isAlphanumeric(next) { - return l.lexKey - } - - return l.errorf("no value can start with %c", next) - } - - l.emit(tokenEOF) - return nil -} - -func (l *tomlLexer) lexLeftCurlyBrace() tomlLexStateFn { - l.next() - l.emit(tokenLeftCurlyBrace) - return l.lexRvalue -} - -func (l *tomlLexer) lexRightCurlyBrace() tomlLexStateFn { - l.next() - l.emit(tokenRightCurlyBrace) - return l.lexRvalue -} - -func (l *tomlLexer) lexDate() tomlLexStateFn { - l.emit(tokenDate) - return l.lexRvalue -} - -func (l *tomlLexer) lexTrue() tomlLexStateFn { - l.fastForward(4) - l.emit(tokenTrue) - return l.lexRvalue -} - -func (l *tomlLexer) lexFalse() tomlLexStateFn { - l.fastForward(5) - l.emit(tokenFalse) - return l.lexRvalue -} - -func (l *tomlLexer) lexEqual() tomlLexStateFn { - l.next() - l.emit(tokenEqual) - return l.lexRvalue -} - -func (l *tomlLexer) lexComma() tomlLexStateFn { - l.next() - l.emit(tokenComma) - return l.lexRvalue -} - -func (l *tomlLexer) lexKey() tomlLexStateFn { - growingString := "" - - for r := l.peek(); isKeyChar(r) || r == '\n' || r == '\r'; r = l.peek() { - if r == '"' { - l.next() - str, err := l.lexStringAsString(`"`, false, true) - if err != nil { - return l.errorf(err.Error()) - } - growingString += `"` + str + `"` - l.next() - continue - } else if r == '\n' { - return l.errorf("keys cannot contain new lines") - } else if isSpace(r) { - break - } else if !isValidBareChar(r) { - return l.errorf("keys cannot contain %c character", r) - } - growingString += string(r) - l.next() - } - l.emitWithValue(tokenKey, growingString) - return l.lexVoid -} - -func (l *tomlLexer) lexComment(previousState tomlLexStateFn) tomlLexStateFn { - return func() tomlLexStateFn { - for next := l.peek(); next != '\n' && next != eof; next = l.peek() { - if next == '\r' && l.follow("\r\n") { - break - } - l.next() - } - l.ignore() - return previousState - } -} - -func (l *tomlLexer) lexLeftBracket() tomlLexStateFn { - l.next() - l.emit(tokenLeftBracket) - return l.lexRvalue -} - -func (l *tomlLexer) lexLiteralStringAsString(terminator string, discardLeadingNewLine bool) (string, error) { - growingString := "" - - if discardLeadingNewLine { - if l.follow("\r\n") { - l.skip() - l.skip() - } else if l.peek() == '\n' { - l.skip() - } - } - - // find end of string - for { - if l.follow(terminator) { - return growingString, nil - } - - next := l.peek() - if next == eof { - break - } - growingString += string(l.next()) - } - - return "", errors.New("unclosed string") -} - -func (l *tomlLexer) lexLiteralString() tomlLexStateFn { - l.skip() - - // handle special case for triple-quote - terminator := "'" - discardLeadingNewLine := false - if l.follow("''") { - l.skip() - l.skip() - terminator = "'''" - discardLeadingNewLine = true - } - - str, err := l.lexLiteralStringAsString(terminator, discardLeadingNewLine) - if err != nil { - return l.errorf(err.Error()) - } - - l.emitWithValue(tokenString, str) - l.fastForward(len(terminator)) - l.ignore() - return l.lexRvalue -} - -// Lex a string and return the results as a string. -// Terminator is the substring indicating the end of the token. -// The resulting string does not include the terminator. -func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine, acceptNewLines bool) (string, error) { - growingString := "" - - if discardLeadingNewLine { - if l.follow("\r\n") { - l.skip() - l.skip() - } else if l.peek() == '\n' { - l.skip() - } - } - - for { - if l.follow(terminator) { - return growingString, nil - } - - if l.follow("\\") { - l.next() - switch l.peek() { - case '\r': - fallthrough - case '\n': - fallthrough - case '\t': - fallthrough - case ' ': - // skip all whitespace chars following backslash - for strings.ContainsRune("\r\n\t ", l.peek()) { - l.next() - } - case '"': - growingString += "\"" - l.next() - case 'n': - growingString += "\n" - l.next() - case 'b': - growingString += "\b" - l.next() - case 'f': - growingString += "\f" - l.next() - case '/': - growingString += "/" - l.next() - case 't': - growingString += "\t" - l.next() - case 'r': - growingString += "\r" - l.next() - case '\\': - growingString += "\\" - l.next() - case 'u': - l.next() - code := "" - for i := 0; i < 4; i++ { - c := l.peek() - if !isHexDigit(c) { - return "", errors.New("unfinished unicode escape") - } - l.next() - code = code + string(c) - } - intcode, err := strconv.ParseInt(code, 16, 32) - if err != nil { - return "", errors.New("invalid unicode escape: \\u" + code) - } - growingString += string(rune(intcode)) - case 'U': - l.next() - code := "" - for i := 0; i < 8; i++ { - c := l.peek() - if !isHexDigit(c) { - return "", errors.New("unfinished unicode escape") - } - l.next() - code = code + string(c) - } - intcode, err := strconv.ParseInt(code, 16, 64) - if err != nil { - return "", errors.New("invalid unicode escape: \\U" + code) - } - growingString += string(rune(intcode)) - default: - return "", errors.New("invalid escape sequence: \\" + string(l.peek())) - } - } else { - r := l.peek() - - if 0x00 <= r && r <= 0x1F && !(acceptNewLines && (r == '\n' || r == '\r')) { - return "", fmt.Errorf("unescaped control character %U", r) - } - l.next() - growingString += string(r) - } - - if l.peek() == eof { - break - } - } - - return "", errors.New("unclosed string") -} - -func (l *tomlLexer) lexString() tomlLexStateFn { - l.skip() - - // handle special case for triple-quote - terminator := `"` - discardLeadingNewLine := false - acceptNewLines := false - if l.follow(`""`) { - l.skip() - l.skip() - terminator = `"""` - discardLeadingNewLine = true - acceptNewLines = true - } - - str, err := l.lexStringAsString(terminator, discardLeadingNewLine, acceptNewLines) - - if err != nil { - return l.errorf(err.Error()) - } - - l.emitWithValue(tokenString, str) - l.fastForward(len(terminator)) - l.ignore() - return l.lexRvalue -} - -func (l *tomlLexer) lexTableKey() tomlLexStateFn { - l.next() - - if l.peek() == '[' { - // token '[[' signifies an array of tables - l.next() - l.emit(tokenDoubleLeftBracket) - return l.lexInsideTableArrayKey - } - // vanilla table key - l.emit(tokenLeftBracket) - return l.lexInsideTableKey -} - -func (l *tomlLexer) lexInsideTableArrayKey() tomlLexStateFn { - for r := l.peek(); r != eof; r = l.peek() { - switch r { - case ']': - if l.currentTokenStop > l.currentTokenStart { - l.emit(tokenKeyGroupArray) - } - l.next() - if l.peek() != ']' { - break - } - l.next() - l.emit(tokenDoubleRightBracket) - return l.lexVoid - case '[': - return l.errorf("table array key cannot contain ']'") - default: - l.next() - } - } - return l.errorf("unclosed table array key") -} - -func (l *tomlLexer) lexInsideTableKey() tomlLexStateFn { - for r := l.peek(); r != eof; r = l.peek() { - switch r { - case ']': - if l.currentTokenStop > l.currentTokenStart { - l.emit(tokenKeyGroup) - } - l.next() - l.emit(tokenRightBracket) - return l.lexVoid - case '[': - return l.errorf("table key cannot contain ']'") - default: - l.next() - } - } - return l.errorf("unclosed table key") -} - -func (l *tomlLexer) lexRightBracket() tomlLexStateFn { - l.next() - l.emit(tokenRightBracket) - return l.lexRvalue -} - -func (l *tomlLexer) lexNumber() tomlLexStateFn { - r := l.peek() - if r == '+' || r == '-' { - l.next() - } - pointSeen := false - expSeen := false - digitSeen := false - for { - next := l.peek() - if next == '.' { - if pointSeen { - return l.errorf("cannot have two dots in one float") - } - l.next() - if !isDigit(l.peek()) { - return l.errorf("float cannot end with a dot") - } - pointSeen = true - } else if next == 'e' || next == 'E' { - expSeen = true - l.next() - r := l.peek() - if r == '+' || r == '-' { - l.next() - } - } else if isDigit(next) { - digitSeen = true - l.next() - } else if next == '_' { - l.next() - } else { - break - } - if pointSeen && !digitSeen { - return l.errorf("cannot start float with a dot") - } - } - - if !digitSeen { - return l.errorf("no digit in that number") - } - if pointSeen || expSeen { - l.emit(tokenFloat) - } else { - l.emit(tokenInteger) - } - return l.lexRvalue -} - -func (l *tomlLexer) run() { - for state := l.lexVoid; state != nil; { - state = state() - } -} - -func init() { - dateRegexp = regexp.MustCompile(`^\d{1,4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})`) -} - -// Entry point -func lexToml(inputBytes []byte) []token { - runes := bytes.Runes(inputBytes) - l := &tomlLexer{ - input: runes, - tokens: make([]token, 0, 256), - line: 1, - col: 1, - endbufferLine: 1, - endbufferCol: 1, - } - l.run() - return l.tokens -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/marshal.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/marshal.go deleted file mode 100644 index 1bbdfa1d..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/marshal.go +++ /dev/null @@ -1,621 +0,0 @@ -package toml - -import ( - "bytes" - "errors" - "fmt" - "io" - "reflect" - "strconv" - "strings" - "time" -) - -type tomlOpts struct { - name string - comment string - commented bool - include bool - omitempty bool -} - -type encOpts struct { - quoteMapKeys bool -} - -var encOptsDefaults = encOpts{ - quoteMapKeys: false, -} - -var timeType = reflect.TypeOf(time.Time{}) -var marshalerType = reflect.TypeOf(new(Marshaler)).Elem() - -// Check if the given marshall type maps to a Tree primitive -func isPrimitive(mtype reflect.Type) bool { - switch mtype.Kind() { - case reflect.Ptr: - return isPrimitive(mtype.Elem()) - case reflect.Bool: - return true - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return true - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return true - case reflect.Float32, reflect.Float64: - return true - case reflect.String: - return true - case reflect.Struct: - return mtype == timeType || isCustomMarshaler(mtype) - default: - return false - } -} - -// Check if the given marshall type maps to a Tree slice -func isTreeSlice(mtype reflect.Type) bool { - switch mtype.Kind() { - case reflect.Slice: - return !isOtherSlice(mtype) - default: - return false - } -} - -// Check if the given marshall type maps to a non-Tree slice -func isOtherSlice(mtype reflect.Type) bool { - switch mtype.Kind() { - case reflect.Ptr: - return isOtherSlice(mtype.Elem()) - case reflect.Slice: - return isPrimitive(mtype.Elem()) || isOtherSlice(mtype.Elem()) - default: - return false - } -} - -// Check if the given marshall type maps to a Tree -func isTree(mtype reflect.Type) bool { - switch mtype.Kind() { - case reflect.Map: - return true - case reflect.Struct: - return !isPrimitive(mtype) - default: - return false - } -} - -func isCustomMarshaler(mtype reflect.Type) bool { - return mtype.Implements(marshalerType) -} - -func callCustomMarshaler(mval reflect.Value) ([]byte, error) { - return mval.Interface().(Marshaler).MarshalTOML() -} - -// Marshaler is the interface implemented by types that -// can marshal themselves into valid TOML. -type Marshaler interface { - MarshalTOML() ([]byte, error) -} - -/* -Marshal returns the TOML encoding of v. Behavior is similar to the Go json -encoder, except that there is no concept of a Marshaler interface or MarshalTOML -function for sub-structs, and currently only definite types can be marshaled -(i.e. no `interface{}`). - -The following struct annotations are supported: - - toml:"Field" Overrides the field's name to output. - omitempty When set, empty values and groups are not emitted. - comment:"comment" Emits a # comment on the same line. This supports new lines. - commented:"true" Emits the value as commented. - -Note that pointers are automatically assigned the "omitempty" option, as TOML -explicitly does not handle null values (saying instead the label should be -dropped). - -Tree structural types and corresponding marshal types: - - *Tree (*)struct, (*)map[string]interface{} - []*Tree (*)[](*)struct, (*)[](*)map[string]interface{} - []interface{} (as interface{}) (*)[]primitive, (*)[]([]interface{}) - interface{} (*)primitive - -Tree primitive types and corresponding marshal types: - - uint64 uint, uint8-uint64, pointers to same - int64 int, int8-uint64, pointers to same - float64 float32, float64, pointers to same - string string, pointers to same - bool bool, pointers to same - time.Time time.Time{}, pointers to same -*/ -func Marshal(v interface{}) ([]byte, error) { - return NewEncoder(nil).marshal(v) -} - -// Encoder writes TOML values to an output stream. -type Encoder struct { - w io.Writer - encOpts -} - -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - w: w, - encOpts: encOptsDefaults, - } -} - -// Encode writes the TOML encoding of v to the stream. -// -// See the documentation for Marshal for details. -func (e *Encoder) Encode(v interface{}) error { - b, err := e.marshal(v) - if err != nil { - return err - } - if _, err := e.w.Write(b); err != nil { - return err - } - return nil -} - -// QuoteMapKeys sets up the encoder to encode -// maps with string type keys with quoted TOML keys. -// -// This relieves the character limitations on map keys. -func (e *Encoder) QuoteMapKeys(v bool) *Encoder { - e.quoteMapKeys = v - return e -} - -func (e *Encoder) marshal(v interface{}) ([]byte, error) { - mtype := reflect.TypeOf(v) - if mtype.Kind() != reflect.Struct { - return []byte{}, errors.New("Only a struct can be marshaled to TOML") - } - sval := reflect.ValueOf(v) - if isCustomMarshaler(mtype) { - return callCustomMarshaler(sval) - } - t, err := e.valueToTree(mtype, sval) - if err != nil { - return []byte{}, err - } - s, err := t.ToTomlString() - return []byte(s), err -} - -// Convert given marshal struct or map value to toml tree -func (e *Encoder) valueToTree(mtype reflect.Type, mval reflect.Value) (*Tree, error) { - if mtype.Kind() == reflect.Ptr { - return e.valueToTree(mtype.Elem(), mval.Elem()) - } - tval := newTree() - switch mtype.Kind() { - case reflect.Struct: - for i := 0; i < mtype.NumField(); i++ { - mtypef, mvalf := mtype.Field(i), mval.Field(i) - opts := tomlOptions(mtypef) - if opts.include && (!opts.omitempty || !isZero(mvalf)) { - val, err := e.valueToToml(mtypef.Type, mvalf) - if err != nil { - return nil, err - } - tval.Set(opts.name, opts.comment, opts.commented, val) - } - } - case reflect.Map: - for _, key := range mval.MapKeys() { - mvalf := mval.MapIndex(key) - val, err := e.valueToToml(mtype.Elem(), mvalf) - if err != nil { - return nil, err - } - if e.quoteMapKeys { - keyStr, err := tomlValueStringRepresentation(key.String()) - if err != nil { - return nil, err - } - tval.SetPath([]string{keyStr}, "", false, val) - } else { - tval.Set(key.String(), "", false, val) - } - } - } - return tval, nil -} - -// Convert given marshal slice to slice of Toml trees -func (e *Encoder) valueToTreeSlice(mtype reflect.Type, mval reflect.Value) ([]*Tree, error) { - tval := make([]*Tree, mval.Len(), mval.Len()) - for i := 0; i < mval.Len(); i++ { - val, err := e.valueToTree(mtype.Elem(), mval.Index(i)) - if err != nil { - return nil, err - } - tval[i] = val - } - return tval, nil -} - -// Convert given marshal slice to slice of toml values -func (e *Encoder) valueToOtherSlice(mtype reflect.Type, mval reflect.Value) (interface{}, error) { - tval := make([]interface{}, mval.Len(), mval.Len()) - for i := 0; i < mval.Len(); i++ { - val, err := e.valueToToml(mtype.Elem(), mval.Index(i)) - if err != nil { - return nil, err - } - tval[i] = val - } - return tval, nil -} - -// Convert given marshal value to toml value -func (e *Encoder) valueToToml(mtype reflect.Type, mval reflect.Value) (interface{}, error) { - if mtype.Kind() == reflect.Ptr { - return e.valueToToml(mtype.Elem(), mval.Elem()) - } - switch { - case isCustomMarshaler(mtype): - return callCustomMarshaler(mval) - case isTree(mtype): - return e.valueToTree(mtype, mval) - case isTreeSlice(mtype): - return e.valueToTreeSlice(mtype, mval) - case isOtherSlice(mtype): - return e.valueToOtherSlice(mtype, mval) - default: - switch mtype.Kind() { - case reflect.Bool: - return mval.Bool(), nil - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return mval.Int(), nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return mval.Uint(), nil - case reflect.Float32, reflect.Float64: - return mval.Float(), nil - case reflect.String: - return mval.String(), nil - case reflect.Struct: - return mval.Interface().(time.Time), nil - default: - return nil, fmt.Errorf("Marshal can't handle %v(%v)", mtype, mtype.Kind()) - } - } -} - -// Unmarshal attempts to unmarshal the Tree into a Go struct pointed by v. -// Neither Unmarshaler interfaces nor UnmarshalTOML functions are supported for -// sub-structs, and only definite types can be unmarshaled. -func (t *Tree) Unmarshal(v interface{}) error { - d := Decoder{tval: t} - return d.unmarshal(v) -} - -// Marshal returns the TOML encoding of Tree. -// See Marshal() documentation for types mapping table. -func (t *Tree) Marshal() ([]byte, error) { - var buf bytes.Buffer - err := NewEncoder(&buf).Encode(t) - return buf.Bytes(), err -} - -// Unmarshal parses the TOML-encoded data and stores the result in the value -// pointed to by v. Behavior is similar to the Go json encoder, except that there -// is no concept of an Unmarshaler interface or UnmarshalTOML function for -// sub-structs, and currently only definite types can be unmarshaled to (i.e. no -// `interface{}`). -// -// The following struct annotations are supported: -// -// toml:"Field" Overrides the field's name to map to. -// -// See Marshal() documentation for types mapping table. -func Unmarshal(data []byte, v interface{}) error { - t, err := LoadReader(bytes.NewReader(data)) - if err != nil { - return err - } - return t.Unmarshal(v) -} - -// Decoder reads and decodes TOML values from an input stream. -type Decoder struct { - r io.Reader - tval *Tree - encOpts -} - -// NewDecoder returns a new decoder that reads from r. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{ - r: r, - encOpts: encOptsDefaults, - } -} - -// Decode reads a TOML-encoded value from it's input -// and unmarshals it in the value pointed at by v. -// -// See the documentation for Marshal for details. -func (d *Decoder) Decode(v interface{}) error { - var err error - d.tval, err = LoadReader(d.r) - if err != nil { - return err - } - return d.unmarshal(v) -} - -func (d *Decoder) unmarshal(v interface{}) error { - mtype := reflect.TypeOf(v) - if mtype.Kind() != reflect.Ptr || mtype.Elem().Kind() != reflect.Struct { - return errors.New("Only a pointer to struct can be unmarshaled from TOML") - } - - sval, err := d.valueFromTree(mtype.Elem(), d.tval) - if err != nil { - return err - } - reflect.ValueOf(v).Elem().Set(sval) - return nil -} - -// Convert toml tree to marshal struct or map, using marshal type -func (d *Decoder) valueFromTree(mtype reflect.Type, tval *Tree) (reflect.Value, error) { - if mtype.Kind() == reflect.Ptr { - return d.unwrapPointer(mtype, tval) - } - var mval reflect.Value - switch mtype.Kind() { - case reflect.Struct: - mval = reflect.New(mtype).Elem() - for i := 0; i < mtype.NumField(); i++ { - mtypef := mtype.Field(i) - opts := tomlOptions(mtypef) - if opts.include { - baseKey := opts.name - keysToTry := []string{baseKey, strings.ToLower(baseKey), strings.ToTitle(baseKey)} - for _, key := range keysToTry { - exists := tval.Has(key) - if !exists { - continue - } - val := tval.Get(key) - mvalf, err := d.valueFromToml(mtypef.Type, val) - if err != nil { - return mval, formatError(err, tval.GetPosition(key)) - } - mval.Field(i).Set(mvalf) - break - } - } - } - case reflect.Map: - mval = reflect.MakeMap(mtype) - for _, key := range tval.Keys() { - // TODO: path splits key - val := tval.GetPath([]string{key}) - mvalf, err := d.valueFromToml(mtype.Elem(), val) - if err != nil { - return mval, formatError(err, tval.GetPosition(key)) - } - mval.SetMapIndex(reflect.ValueOf(key), mvalf) - } - } - return mval, nil -} - -// Convert toml value to marshal struct/map slice, using marshal type -func (d *Decoder) valueFromTreeSlice(mtype reflect.Type, tval []*Tree) (reflect.Value, error) { - mval := reflect.MakeSlice(mtype, len(tval), len(tval)) - for i := 0; i < len(tval); i++ { - val, err := d.valueFromTree(mtype.Elem(), tval[i]) - if err != nil { - return mval, err - } - mval.Index(i).Set(val) - } - return mval, nil -} - -// Convert toml value to marshal primitive slice, using marshal type -func (d *Decoder) valueFromOtherSlice(mtype reflect.Type, tval []interface{}) (reflect.Value, error) { - mval := reflect.MakeSlice(mtype, len(tval), len(tval)) - for i := 0; i < len(tval); i++ { - val, err := d.valueFromToml(mtype.Elem(), tval[i]) - if err != nil { - return mval, err - } - mval.Index(i).Set(val) - } - return mval, nil -} - -// Convert toml value to marshal value, using marshal type -func (d *Decoder) valueFromToml(mtype reflect.Type, tval interface{}) (reflect.Value, error) { - if mtype.Kind() == reflect.Ptr { - return d.unwrapPointer(mtype, tval) - } - - switch tval.(type) { - case *Tree: - if isTree(mtype) { - return d.valueFromTree(mtype, tval.(*Tree)) - } else { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to a tree", tval, tval) - } - case []*Tree: - if isTreeSlice(mtype) { - return d.valueFromTreeSlice(mtype, tval.([]*Tree)) - } else { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to trees", tval, tval) - } - case []interface{}: - if isOtherSlice(mtype) { - return d.valueFromOtherSlice(mtype, tval.([]interface{})) - } else { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to a slice", tval, tval) - } - default: - switch mtype.Kind() { - case reflect.Bool: - val, ok := tval.(bool) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to bool", tval, tval) - } - return reflect.ValueOf(val), nil - case reflect.Int: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) - } - return reflect.ValueOf(int(val)), nil - case reflect.Int8: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) - } - return reflect.ValueOf(int8(val)), nil - case reflect.Int16: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) - } - return reflect.ValueOf(int16(val)), nil - case reflect.Int32: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) - } - return reflect.ValueOf(int32(val)), nil - case reflect.Int64: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to int", tval, tval) - } - return reflect.ValueOf(val), nil - case reflect.Uint: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) - } - return reflect.ValueOf(uint(val)), nil - case reflect.Uint8: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) - } - return reflect.ValueOf(uint8(val)), nil - case reflect.Uint16: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) - } - return reflect.ValueOf(uint16(val)), nil - case reflect.Uint32: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) - } - return reflect.ValueOf(uint32(val)), nil - case reflect.Uint64: - val, ok := tval.(int64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to uint", tval, tval) - } - return reflect.ValueOf(uint64(val)), nil - case reflect.Float32: - val, ok := tval.(float64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to float", tval, tval) - } - return reflect.ValueOf(float32(val)), nil - case reflect.Float64: - val, ok := tval.(float64) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to float", tval, tval) - } - return reflect.ValueOf(val), nil - case reflect.String: - val, ok := tval.(string) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to string", tval, tval) - } - return reflect.ValueOf(val), nil - case reflect.Struct: - val, ok := tval.(time.Time) - if !ok { - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to time", tval, tval) - } - return reflect.ValueOf(val), nil - default: - return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v(%v)", tval, tval, mtype, mtype.Kind()) - } - } -} - -func (d *Decoder) unwrapPointer(mtype reflect.Type, tval interface{}) (reflect.Value, error) { - val, err := d.valueFromToml(mtype.Elem(), tval) - if err != nil { - return reflect.ValueOf(nil), err - } - mval := reflect.New(mtype.Elem()) - mval.Elem().Set(val) - return mval, nil -} - -func tomlOptions(vf reflect.StructField) tomlOpts { - tag := vf.Tag.Get("toml") - parse := strings.Split(tag, ",") - var comment string - if c := vf.Tag.Get("comment"); c != "" { - comment = c - } - commented, _ := strconv.ParseBool(vf.Tag.Get("commented")) - result := tomlOpts{name: vf.Name, comment: comment, commented: commented, include: true, omitempty: false} - if parse[0] != "" { - if parse[0] == "-" && len(parse) == 1 { - result.include = false - } else { - result.name = strings.Trim(parse[0], " ") - } - } - if vf.PkgPath != "" { - result.include = false - } - if len(parse) > 1 && strings.Trim(parse[1], " ") == "omitempty" { - result.omitempty = true - } - if vf.Type.Kind() == reflect.Ptr { - result.omitempty = true - } - return result -} - -func isZero(val reflect.Value) bool { - switch val.Type().Kind() { - case reflect.Map: - fallthrough - case reflect.Array: - fallthrough - case reflect.Slice: - return val.Len() == 0 - default: - return reflect.DeepEqual(val.Interface(), reflect.Zero(val.Type()).Interface()) - } -} - -func formatError(err error, pos Position) error { - if err.Error()[0] == '(' { // Error already contains position information - return err - } - return fmt.Errorf("%s: %s", pos, err) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/parser.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/parser.go deleted file mode 100644 index d492a1e6..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/parser.go +++ /dev/null @@ -1,383 +0,0 @@ -// TOML Parser. - -package toml - -import ( - "errors" - "fmt" - "reflect" - "regexp" - "strconv" - "strings" - "time" -) - -type tomlParser struct { - flowIdx int - flow []token - tree *Tree - currentTable []string - seenTableKeys []string -} - -type tomlParserStateFn func() tomlParserStateFn - -// Formats and panics an error message based on a token -func (p *tomlParser) raiseError(tok *token, msg string, args ...interface{}) { - panic(tok.Position.String() + ": " + fmt.Sprintf(msg, args...)) -} - -func (p *tomlParser) run() { - for state := p.parseStart; state != nil; { - state = state() - } -} - -func (p *tomlParser) peek() *token { - if p.flowIdx >= len(p.flow) { - return nil - } - return &p.flow[p.flowIdx] -} - -func (p *tomlParser) assume(typ tokenType) { - tok := p.getToken() - if tok == nil { - p.raiseError(tok, "was expecting token %s, but token stream is empty", tok) - } - if tok.typ != typ { - p.raiseError(tok, "was expecting token %s, but got %s instead", typ, tok) - } -} - -func (p *tomlParser) getToken() *token { - tok := p.peek() - if tok == nil { - return nil - } - p.flowIdx++ - return tok -} - -func (p *tomlParser) parseStart() tomlParserStateFn { - tok := p.peek() - - // end of stream, parsing is finished - if tok == nil { - return nil - } - - switch tok.typ { - case tokenDoubleLeftBracket: - return p.parseGroupArray - case tokenLeftBracket: - return p.parseGroup - case tokenKey: - return p.parseAssign - case tokenEOF: - return nil - default: - p.raiseError(tok, "unexpected token") - } - return nil -} - -func (p *tomlParser) parseGroupArray() tomlParserStateFn { - startToken := p.getToken() // discard the [[ - key := p.getToken() - if key.typ != tokenKeyGroupArray { - p.raiseError(key, "unexpected token %s, was expecting a table array key", key) - } - - // get or create table array element at the indicated part in the path - keys, err := parseKey(key.val) - if err != nil { - p.raiseError(key, "invalid table array key: %s", err) - } - p.tree.createSubTree(keys[:len(keys)-1], startToken.Position) // create parent entries - destTree := p.tree.GetPath(keys) - var array []*Tree - if destTree == nil { - array = make([]*Tree, 0) - } else if target, ok := destTree.([]*Tree); ok && target != nil { - array = destTree.([]*Tree) - } else { - p.raiseError(key, "key %s is already assigned and not of type table array", key) - } - p.currentTable = keys - - // add a new tree to the end of the table array - newTree := newTree() - newTree.position = startToken.Position - array = append(array, newTree) - p.tree.SetPath(p.currentTable, "", false, array) - - // remove all keys that were children of this table array - prefix := key.val + "." - found := false - for ii := 0; ii < len(p.seenTableKeys); { - tableKey := p.seenTableKeys[ii] - if strings.HasPrefix(tableKey, prefix) { - p.seenTableKeys = append(p.seenTableKeys[:ii], p.seenTableKeys[ii+1:]...) - } else { - found = (tableKey == key.val) - ii++ - } - } - - // keep this key name from use by other kinds of assignments - if !found { - p.seenTableKeys = append(p.seenTableKeys, key.val) - } - - // move to next parser state - p.assume(tokenDoubleRightBracket) - return p.parseStart -} - -func (p *tomlParser) parseGroup() tomlParserStateFn { - startToken := p.getToken() // discard the [ - key := p.getToken() - if key.typ != tokenKeyGroup { - p.raiseError(key, "unexpected token %s, was expecting a table key", key) - } - for _, item := range p.seenTableKeys { - if item == key.val { - p.raiseError(key, "duplicated tables") - } - } - - p.seenTableKeys = append(p.seenTableKeys, key.val) - keys, err := parseKey(key.val) - if err != nil { - p.raiseError(key, "invalid table array key: %s", err) - } - if err := p.tree.createSubTree(keys, startToken.Position); err != nil { - p.raiseError(key, "%s", err) - } - p.assume(tokenRightBracket) - p.currentTable = keys - return p.parseStart -} - -func (p *tomlParser) parseAssign() tomlParserStateFn { - key := p.getToken() - p.assume(tokenEqual) - - value := p.parseRvalue() - var tableKey []string - if len(p.currentTable) > 0 { - tableKey = p.currentTable - } else { - tableKey = []string{} - } - - // find the table to assign, looking out for arrays of tables - var targetNode *Tree - switch node := p.tree.GetPath(tableKey).(type) { - case []*Tree: - targetNode = node[len(node)-1] - case *Tree: - targetNode = node - default: - p.raiseError(key, "Unknown table type for path: %s", - strings.Join(tableKey, ".")) - } - - // assign value to the found table - keyVals, err := parseKey(key.val) - if err != nil { - p.raiseError(key, "%s", err) - } - if len(keyVals) != 1 { - p.raiseError(key, "Invalid key") - } - keyVal := keyVals[0] - localKey := []string{keyVal} - finalKey := append(tableKey, keyVal) - if targetNode.GetPath(localKey) != nil { - p.raiseError(key, "The following key was defined twice: %s", - strings.Join(finalKey, ".")) - } - var toInsert interface{} - - switch value.(type) { - case *Tree, []*Tree: - toInsert = value - default: - toInsert = &tomlValue{value: value, position: key.Position} - } - targetNode.values[keyVal] = toInsert - return p.parseStart -} - -var numberUnderscoreInvalidRegexp *regexp.Regexp - -func cleanupNumberToken(value string) (string, error) { - if numberUnderscoreInvalidRegexp.MatchString(value) { - return "", errors.New("invalid use of _ in number") - } - cleanedVal := strings.Replace(value, "_", "", -1) - return cleanedVal, nil -} - -func (p *tomlParser) parseRvalue() interface{} { - tok := p.getToken() - if tok == nil || tok.typ == tokenEOF { - p.raiseError(tok, "expecting a value") - } - - switch tok.typ { - case tokenString: - return tok.val - case tokenTrue: - return true - case tokenFalse: - return false - case tokenInteger: - cleanedVal, err := cleanupNumberToken(tok.val) - if err != nil { - p.raiseError(tok, "%s", err) - } - val, err := strconv.ParseInt(cleanedVal, 10, 64) - if err != nil { - p.raiseError(tok, "%s", err) - } - return val - case tokenFloat: - cleanedVal, err := cleanupNumberToken(tok.val) - if err != nil { - p.raiseError(tok, "%s", err) - } - val, err := strconv.ParseFloat(cleanedVal, 64) - if err != nil { - p.raiseError(tok, "%s", err) - } - return val - case tokenDate: - val, err := time.ParseInLocation(time.RFC3339Nano, tok.val, time.UTC) - if err != nil { - p.raiseError(tok, "%s", err) - } - return val - case tokenLeftBracket: - return p.parseArray() - case tokenLeftCurlyBrace: - return p.parseInlineTable() - case tokenEqual: - p.raiseError(tok, "cannot have multiple equals for the same key") - case tokenError: - p.raiseError(tok, "%s", tok) - } - - p.raiseError(tok, "never reached") - - return nil -} - -func tokenIsComma(t *token) bool { - return t != nil && t.typ == tokenComma -} - -func (p *tomlParser) parseInlineTable() *Tree { - tree := newTree() - var previous *token -Loop: - for { - follow := p.peek() - if follow == nil || follow.typ == tokenEOF { - p.raiseError(follow, "unterminated inline table") - } - switch follow.typ { - case tokenRightCurlyBrace: - p.getToken() - break Loop - case tokenKey: - if !tokenIsComma(previous) && previous != nil { - p.raiseError(follow, "comma expected between fields in inline table") - } - key := p.getToken() - p.assume(tokenEqual) - value := p.parseRvalue() - tree.Set(key.val, "", false, value) - case tokenComma: - if previous == nil { - p.raiseError(follow, "inline table cannot start with a comma") - } - if tokenIsComma(previous) { - p.raiseError(follow, "need field between two commas in inline table") - } - p.getToken() - default: - p.raiseError(follow, "unexpected token type in inline table: %s", follow.typ.String()) - } - previous = follow - } - if tokenIsComma(previous) { - p.raiseError(previous, "trailing comma at the end of inline table") - } - return tree -} - -func (p *tomlParser) parseArray() interface{} { - var array []interface{} - arrayType := reflect.TypeOf(nil) - for { - follow := p.peek() - if follow == nil || follow.typ == tokenEOF { - p.raiseError(follow, "unterminated array") - } - if follow.typ == tokenRightBracket { - p.getToken() - break - } - val := p.parseRvalue() - if arrayType == nil { - arrayType = reflect.TypeOf(val) - } - if reflect.TypeOf(val) != arrayType { - p.raiseError(follow, "mixed types in array") - } - array = append(array, val) - follow = p.peek() - if follow == nil || follow.typ == tokenEOF { - p.raiseError(follow, "unterminated array") - } - if follow.typ != tokenRightBracket && follow.typ != tokenComma { - p.raiseError(follow, "missing comma") - } - if follow.typ == tokenComma { - p.getToken() - } - } - // An array of Trees is actually an array of inline - // tables, which is a shorthand for a table array. If the - // array was not converted from []interface{} to []*Tree, - // the two notations would not be equivalent. - if arrayType == reflect.TypeOf(newTree()) { - tomlArray := make([]*Tree, len(array)) - for i, v := range array { - tomlArray[i] = v.(*Tree) - } - return tomlArray - } - return array -} - -func parseToml(flow []token) *Tree { - result := newTree() - result.position = Position{1, 1} - parser := &tomlParser{ - flowIdx: 0, - flow: flow, - tree: result, - currentTable: make([]string, 0), - seenTableKeys: make([]string, 0), - } - parser.run() - return result -} - -func init() { - numberUnderscoreInvalidRegexp = regexp.MustCompile(`([^\d]_|_[^\d]|_$|^_)`) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/position.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/position.go deleted file mode 100644 index c17bff87..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/position.go +++ /dev/null @@ -1,29 +0,0 @@ -// Position support for go-toml - -package toml - -import ( - "fmt" -) - -// Position of a document element within a TOML document. -// -// Line and Col are both 1-indexed positions for the element's line number and -// column number, respectively. Values of zero or less will cause Invalid(), -// to return true. -type Position struct { - Line int // line within the document - Col int // column within the line -} - -// String representation of the position. -// Displays 1-indexed line and column numbers. -func (p Position) String() string { - return fmt.Sprintf("(%d, %d)", p.Line, p.Col) -} - -// Invalid returns whether or not the position is valid (i.e. with negative or -// null values) -func (p Position) Invalid() bool { - return p.Line <= 0 || p.Col <= 0 -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/doc.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/doc.go deleted file mode 100644 index ed63c110..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/doc.go +++ /dev/null @@ -1,175 +0,0 @@ -// Package query performs JSONPath-like queries on a TOML document. -// -// The query path implementation is based loosely on the JSONPath specification: -// http://goessner.net/articles/JsonPath/. -// -// The idea behind a query path is to allow quick access to any element, or set -// of elements within TOML document, with a single expression. -// -// result, err := query.CompileAndExecute("$.foo.bar.baz", tree) -// -// This is roughly equivalent to: -// -// next := tree.Get("foo") -// if next != nil { -// next = next.Get("bar") -// if next != nil { -// next = next.Get("baz") -// } -// } -// result := next -// -// err is nil if any parsing exception occurs. -// -// If no node in the tree matches the query, result will simply contain an empty list of -// items. -// -// As illustrated above, the query path is much more efficient, especially since -// the structure of the TOML file can vary. Rather than making assumptions about -// a document's structure, a query allows the programmer to make structured -// requests into the document, and get zero or more values as a result. -// -// Query syntax -// -// The syntax of a query begins with a root token, followed by any number -// sub-expressions: -// -// $ -// Root of the TOML tree. This must always come first. -// .name -// Selects child of this node, where 'name' is a TOML key -// name. -// ['name'] -// Selects child of this node, where 'name' is a string -// containing a TOML key name. -// [index] -// Selcts child array element at 'index'. -// ..expr -// Recursively selects all children, filtered by an a union, -// index, or slice expression. -// ..* -// Recursive selection of all nodes at this point in the -// tree. -// .* -// Selects all children of the current node. -// [expr,expr] -// Union operator - a logical 'or' grouping of two or more -// sub-expressions: index, key name, or filter. -// [start:end:step] -// Slice operator - selects array elements from start to -// end-1, at the given step. All three arguments are -// optional. -// [?(filter)] -// Named filter expression - the function 'filter' is -// used to filter children at this node. -// -// Query Indexes And Slices -// -// Index expressions perform no bounds checking, and will contribute no -// values to the result set if the provided index or index range is invalid. -// Negative indexes represent values from the end of the array, counting backwards. -// -// // select the last index of the array named 'foo' -// query.CompileAndExecute("$.foo[-1]", tree) -// -// Slice expressions are supported, by using ':' to separate a start/end index pair. -// -// // select up to the first five elements in the array -// query.CompileAndExecute("$.foo[0:5]", tree) -// -// Slice expressions also allow negative indexes for the start and stop -// arguments. -// -// // select all array elements. -// query.CompileAndExecute("$.foo[0:-1]", tree) -// -// Slice expressions may have an optional stride/step parameter: -// -// // select every other element -// query.CompileAndExecute("$.foo[0:-1:2]", tree) -// -// Slice start and end parameters are also optional: -// -// // these are all equivalent and select all the values in the array -// query.CompileAndExecute("$.foo[:]", tree) -// query.CompileAndExecute("$.foo[0:]", tree) -// query.CompileAndExecute("$.foo[:-1]", tree) -// query.CompileAndExecute("$.foo[0:-1:]", tree) -// query.CompileAndExecute("$.foo[::1]", tree) -// query.CompileAndExecute("$.foo[0::1]", tree) -// query.CompileAndExecute("$.foo[:-1:1]", tree) -// query.CompileAndExecute("$.foo[0:-1:1]", tree) -// -// Query Filters -// -// Query filters are used within a Union [,] or single Filter [] expression. -// A filter only allows nodes that qualify through to the next expression, -// and/or into the result set. -// -// // returns children of foo that are permitted by the 'bar' filter. -// query.CompileAndExecute("$.foo[?(bar)]", tree) -// -// There are several filters provided with the library: -// -// tree -// Allows nodes of type Tree. -// int -// Allows nodes of type int64. -// float -// Allows nodes of type float64. -// string -// Allows nodes of type string. -// time -// Allows nodes of type time.Time. -// bool -// Allows nodes of type bool. -// -// Query Results -// -// An executed query returns a Result object. This contains the nodes -// in the TOML tree that qualify the query expression. Position information -// is also available for each value in the set. -// -// // display the results of a query -// results := query.CompileAndExecute("$.foo.bar.baz", tree) -// for idx, value := results.Values() { -// fmt.Println("%v: %v", results.Positions()[idx], value) -// } -// -// Compiled Queries -// -// Queries may be executed directly on a Tree object, or compiled ahead -// of time and executed discretely. The former is more convenient, but has the -// penalty of having to recompile the query expression each time. -// -// // basic query -// results := query.CompileAndExecute("$.foo.bar.baz", tree) -// -// // compiled query -// query, err := toml.Compile("$.foo.bar.baz") -// results := query.Execute(tree) -// -// // run the compiled query again on a different tree -// moreResults := query.Execute(anotherTree) -// -// User Defined Query Filters -// -// Filter expressions may also be user defined by using the SetFilter() -// function on the Query object. The function must return true/false, which -// signifies if the passed node is kept or discarded, respectively. -// -// // create a query that references a user-defined filter -// query, _ := query.Compile("$[?(bazOnly)]") -// -// // define the filter, and assign it to the query -// query.SetFilter("bazOnly", func(node interface{}) bool{ -// if tree, ok := node.(*Tree); ok { -// return tree.Has("baz") -// } -// return false // reject all other node types -// }) -// -// // run the query -// query.Execute(tree) -// -package query diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/lexer.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/lexer.go deleted file mode 100644 index 2dc31940..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/lexer.go +++ /dev/null @@ -1,357 +0,0 @@ -// TOML JSONPath lexer. -// -// Written using the principles developed by Rob Pike in -// http://www.youtube.com/watch?v=HxaD_trXwRE - -package query - -import ( - "fmt" - "github.com/pelletier/go-toml" - "strconv" - "strings" - "unicode/utf8" -) - -// Lexer state function -type queryLexStateFn func() queryLexStateFn - -// Lexer definition -type queryLexer struct { - input string - start int - pos int - width int - tokens chan token - depth int - line int - col int - stringTerm string -} - -func (l *queryLexer) run() { - for state := l.lexVoid; state != nil; { - state = state() - } - close(l.tokens) -} - -func (l *queryLexer) nextStart() { - // iterate by runes (utf8 characters) - // search for newlines and advance line/col counts - for i := l.start; i < l.pos; { - r, width := utf8.DecodeRuneInString(l.input[i:]) - if r == '\n' { - l.line++ - l.col = 1 - } else { - l.col++ - } - i += width - } - // advance start position to next token - l.start = l.pos -} - -func (l *queryLexer) emit(t tokenType) { - l.tokens <- token{ - Position: toml.Position{Line: l.line, Col: l.col}, - typ: t, - val: l.input[l.start:l.pos], - } - l.nextStart() -} - -func (l *queryLexer) emitWithValue(t tokenType, value string) { - l.tokens <- token{ - Position: toml.Position{Line: l.line, Col: l.col}, - typ: t, - val: value, - } - l.nextStart() -} - -func (l *queryLexer) next() rune { - if l.pos >= len(l.input) { - l.width = 0 - return eof - } - var r rune - r, l.width = utf8.DecodeRuneInString(l.input[l.pos:]) - l.pos += l.width - return r -} - -func (l *queryLexer) ignore() { - l.nextStart() -} - -func (l *queryLexer) backup() { - l.pos -= l.width -} - -func (l *queryLexer) errorf(format string, args ...interface{}) queryLexStateFn { - l.tokens <- token{ - Position: toml.Position{Line: l.line, Col: l.col}, - typ: tokenError, - val: fmt.Sprintf(format, args...), - } - return nil -} - -func (l *queryLexer) peek() rune { - r := l.next() - l.backup() - return r -} - -func (l *queryLexer) accept(valid string) bool { - if strings.ContainsRune(valid, l.next()) { - return true - } - l.backup() - return false -} - -func (l *queryLexer) follow(next string) bool { - return strings.HasPrefix(l.input[l.pos:], next) -} - -func (l *queryLexer) lexVoid() queryLexStateFn { - for { - next := l.peek() - switch next { - case '$': - l.pos++ - l.emit(tokenDollar) - continue - case '.': - if l.follow("..") { - l.pos += 2 - l.emit(tokenDotDot) - } else { - l.pos++ - l.emit(tokenDot) - } - continue - case '[': - l.pos++ - l.emit(tokenLeftBracket) - continue - case ']': - l.pos++ - l.emit(tokenRightBracket) - continue - case ',': - l.pos++ - l.emit(tokenComma) - continue - case '*': - l.pos++ - l.emit(tokenStar) - continue - case '(': - l.pos++ - l.emit(tokenLeftParen) - continue - case ')': - l.pos++ - l.emit(tokenRightParen) - continue - case '?': - l.pos++ - l.emit(tokenQuestion) - continue - case ':': - l.pos++ - l.emit(tokenColon) - continue - case '\'': - l.ignore() - l.stringTerm = string(next) - return l.lexString - case '"': - l.ignore() - l.stringTerm = string(next) - return l.lexString - } - - if isSpace(next) { - l.next() - l.ignore() - continue - } - - if isAlphanumeric(next) { - return l.lexKey - } - - if next == '+' || next == '-' || isDigit(next) { - return l.lexNumber - } - - if l.next() == eof { - break - } - - return l.errorf("unexpected char: '%v'", next) - } - l.emit(tokenEOF) - return nil -} - -func (l *queryLexer) lexKey() queryLexStateFn { - for { - next := l.peek() - if !isAlphanumeric(next) { - l.emit(tokenKey) - return l.lexVoid - } - - if l.next() == eof { - break - } - } - l.emit(tokenEOF) - return nil -} - -func (l *queryLexer) lexString() queryLexStateFn { - l.pos++ - l.ignore() - growingString := "" - - for { - if l.follow(l.stringTerm) { - l.emitWithValue(tokenString, growingString) - l.pos++ - l.ignore() - return l.lexVoid - } - - if l.follow("\\\"") { - l.pos++ - growingString += "\"" - } else if l.follow("\\'") { - l.pos++ - growingString += "'" - } else if l.follow("\\n") { - l.pos++ - growingString += "\n" - } else if l.follow("\\b") { - l.pos++ - growingString += "\b" - } else if l.follow("\\f") { - l.pos++ - growingString += "\f" - } else if l.follow("\\/") { - l.pos++ - growingString += "/" - } else if l.follow("\\t") { - l.pos++ - growingString += "\t" - } else if l.follow("\\r") { - l.pos++ - growingString += "\r" - } else if l.follow("\\\\") { - l.pos++ - growingString += "\\" - } else if l.follow("\\u") { - l.pos += 2 - code := "" - for i := 0; i < 4; i++ { - c := l.peek() - l.pos++ - if !isHexDigit(c) { - return l.errorf("unfinished unicode escape") - } - code = code + string(c) - } - l.pos-- - intcode, err := strconv.ParseInt(code, 16, 32) - if err != nil { - return l.errorf("invalid unicode escape: \\u" + code) - } - growingString += string(rune(intcode)) - } else if l.follow("\\U") { - l.pos += 2 - code := "" - for i := 0; i < 8; i++ { - c := l.peek() - l.pos++ - if !isHexDigit(c) { - return l.errorf("unfinished unicode escape") - } - code = code + string(c) - } - l.pos-- - intcode, err := strconv.ParseInt(code, 16, 32) - if err != nil { - return l.errorf("invalid unicode escape: \\u" + code) - } - growingString += string(rune(intcode)) - } else if l.follow("\\") { - l.pos++ - return l.errorf("invalid escape sequence: \\" + string(l.peek())) - } else { - growingString += string(l.peek()) - } - - if l.next() == eof { - break - } - } - - return l.errorf("unclosed string") -} - -func (l *queryLexer) lexNumber() queryLexStateFn { - l.ignore() - if !l.accept("+") { - l.accept("-") - } - pointSeen := false - digitSeen := false - for { - next := l.next() - if next == '.' { - if pointSeen { - return l.errorf("cannot have two dots in one float") - } - if !isDigit(l.peek()) { - return l.errorf("float cannot end with a dot") - } - pointSeen = true - } else if isDigit(next) { - digitSeen = true - } else { - l.backup() - break - } - if pointSeen && !digitSeen { - return l.errorf("cannot start float with a dot") - } - } - - if !digitSeen { - return l.errorf("no digit in that number") - } - if pointSeen { - l.emit(tokenFloat) - } else { - l.emit(tokenInteger) - } - return l.lexVoid -} - -// Entry point -func lexQuery(input string) chan token { - l := &queryLexer{ - input: input, - tokens: make(chan token), - line: 1, - col: 1, - } - go l.run() - return l.tokens -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/match.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/match.go deleted file mode 100644 index d7bb15a4..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/match.go +++ /dev/null @@ -1,232 +0,0 @@ -package query - -import ( - "fmt" - "github.com/pelletier/go-toml" -) - -// base match -type matchBase struct { - next pathFn -} - -func (f *matchBase) setNext(next pathFn) { - f.next = next -} - -// terminating functor - gathers results -type terminatingFn struct { - // empty -} - -func newTerminatingFn() *terminatingFn { - return &terminatingFn{} -} - -func (f *terminatingFn) setNext(next pathFn) { - // do nothing -} - -func (f *terminatingFn) call(node interface{}, ctx *queryContext) { - ctx.result.appendResult(node, ctx.lastPosition) -} - -// match single key -type matchKeyFn struct { - matchBase - Name string -} - -func newMatchKeyFn(name string) *matchKeyFn { - return &matchKeyFn{Name: name} -} - -func (f *matchKeyFn) call(node interface{}, ctx *queryContext) { - if array, ok := node.([]*toml.Tree); ok { - for _, tree := range array { - item := tree.Get(f.Name) - if item != nil { - ctx.lastPosition = tree.GetPosition(f.Name) - f.next.call(item, ctx) - } - } - } else if tree, ok := node.(*toml.Tree); ok { - item := tree.Get(f.Name) - if item != nil { - ctx.lastPosition = tree.GetPosition(f.Name) - f.next.call(item, ctx) - } - } -} - -// match single index -type matchIndexFn struct { - matchBase - Idx int -} - -func newMatchIndexFn(idx int) *matchIndexFn { - return &matchIndexFn{Idx: idx} -} - -func (f *matchIndexFn) call(node interface{}, ctx *queryContext) { - if arr, ok := node.([]interface{}); ok { - if f.Idx < len(arr) && f.Idx >= 0 { - if treesArray, ok := node.([]*toml.Tree); ok { - if len(treesArray) > 0 { - ctx.lastPosition = treesArray[0].Position() - } - } - f.next.call(arr[f.Idx], ctx) - } - } -} - -// filter by slicing -type matchSliceFn struct { - matchBase - Start, End, Step int -} - -func newMatchSliceFn(start, end, step int) *matchSliceFn { - return &matchSliceFn{Start: start, End: end, Step: step} -} - -func (f *matchSliceFn) call(node interface{}, ctx *queryContext) { - if arr, ok := node.([]interface{}); ok { - // adjust indexes for negative values, reverse ordering - realStart, realEnd := f.Start, f.End - if realStart < 0 { - realStart = len(arr) + realStart - } - if realEnd < 0 { - realEnd = len(arr) + realEnd - } - if realEnd < realStart { - realEnd, realStart = realStart, realEnd // swap - } - // loop and gather - for idx := realStart; idx < realEnd; idx += f.Step { - if treesArray, ok := node.([]*toml.Tree); ok { - if len(treesArray) > 0 { - ctx.lastPosition = treesArray[0].Position() - } - } - f.next.call(arr[idx], ctx) - } - } -} - -// match anything -type matchAnyFn struct { - matchBase -} - -func newMatchAnyFn() *matchAnyFn { - return &matchAnyFn{} -} - -func (f *matchAnyFn) call(node interface{}, ctx *queryContext) { - if tree, ok := node.(*toml.Tree); ok { - for _, k := range tree.Keys() { - v := tree.Get(k) - ctx.lastPosition = tree.GetPosition(k) - f.next.call(v, ctx) - } - } -} - -// filter through union -type matchUnionFn struct { - Union []pathFn -} - -func (f *matchUnionFn) setNext(next pathFn) { - for _, fn := range f.Union { - fn.setNext(next) - } -} - -func (f *matchUnionFn) call(node interface{}, ctx *queryContext) { - for _, fn := range f.Union { - fn.call(node, ctx) - } -} - -// match every single last node in the tree -type matchRecursiveFn struct { - matchBase -} - -func newMatchRecursiveFn() *matchRecursiveFn { - return &matchRecursiveFn{} -} - -func (f *matchRecursiveFn) call(node interface{}, ctx *queryContext) { - originalPosition := ctx.lastPosition - if tree, ok := node.(*toml.Tree); ok { - var visit func(tree *toml.Tree) - visit = func(tree *toml.Tree) { - for _, k := range tree.Keys() { - v := tree.Get(k) - ctx.lastPosition = tree.GetPosition(k) - f.next.call(v, ctx) - switch node := v.(type) { - case *toml.Tree: - visit(node) - case []*toml.Tree: - for _, subtree := range node { - visit(subtree) - } - } - } - } - ctx.lastPosition = originalPosition - f.next.call(tree, ctx) - visit(tree) - } -} - -// match based on an externally provided functional filter -type matchFilterFn struct { - matchBase - Pos toml.Position - Name string -} - -func newMatchFilterFn(name string, pos toml.Position) *matchFilterFn { - return &matchFilterFn{Name: name, Pos: pos} -} - -func (f *matchFilterFn) call(node interface{}, ctx *queryContext) { - fn, ok := (*ctx.filters)[f.Name] - if !ok { - panic(fmt.Sprintf("%s: query context does not have filter '%s'", - f.Pos.String(), f.Name)) - } - switch castNode := node.(type) { - case *toml.Tree: - for _, k := range castNode.Keys() { - v := castNode.Get(k) - if fn(v) { - ctx.lastPosition = castNode.GetPosition(k) - f.next.call(v, ctx) - } - } - case []*toml.Tree: - for _, v := range castNode { - if fn(v) { - if len(castNode) > 0 { - ctx.lastPosition = castNode[0].Position() - } - f.next.call(v, ctx) - } - } - case []interface{}: - for _, v := range castNode { - if fn(v) { - f.next.call(v, ctx) - } - } - } -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/parser.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/parser.go deleted file mode 100644 index 5f69b70d..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/parser.go +++ /dev/null @@ -1,275 +0,0 @@ -/* - Based on the "jsonpath" spec/concept. - - http://goessner.net/articles/JsonPath/ - https://code.google.com/p/json-path/ -*/ - -package query - -import ( - "fmt" -) - -const maxInt = int(^uint(0) >> 1) - -type queryParser struct { - flow chan token - tokensBuffer []token - query *Query - union []pathFn - err error -} - -type queryParserStateFn func() queryParserStateFn - -// Formats and panics an error message based on a token -func (p *queryParser) parseError(tok *token, msg string, args ...interface{}) queryParserStateFn { - p.err = fmt.Errorf(tok.Position.String()+": "+msg, args...) - return nil // trigger parse to end -} - -func (p *queryParser) run() { - for state := p.parseStart; state != nil; { - state = state() - } -} - -func (p *queryParser) backup(tok *token) { - p.tokensBuffer = append(p.tokensBuffer, *tok) -} - -func (p *queryParser) peek() *token { - if len(p.tokensBuffer) != 0 { - return &(p.tokensBuffer[0]) - } - - tok, ok := <-p.flow - if !ok { - return nil - } - p.backup(&tok) - return &tok -} - -func (p *queryParser) lookahead(types ...tokenType) bool { - result := true - buffer := []token{} - - for _, typ := range types { - tok := p.getToken() - if tok == nil { - result = false - break - } - buffer = append(buffer, *tok) - if tok.typ != typ { - result = false - break - } - } - // add the tokens back to the buffer, and return - p.tokensBuffer = append(p.tokensBuffer, buffer...) - return result -} - -func (p *queryParser) getToken() *token { - if len(p.tokensBuffer) != 0 { - tok := p.tokensBuffer[0] - p.tokensBuffer = p.tokensBuffer[1:] - return &tok - } - tok, ok := <-p.flow - if !ok { - return nil - } - return &tok -} - -func (p *queryParser) parseStart() queryParserStateFn { - tok := p.getToken() - - if tok == nil || tok.typ == tokenEOF { - return nil - } - - if tok.typ != tokenDollar { - return p.parseError(tok, "Expected '$' at start of expression") - } - - return p.parseMatchExpr -} - -// handle '.' prefix, '[]', and '..' -func (p *queryParser) parseMatchExpr() queryParserStateFn { - tok := p.getToken() - switch tok.typ { - case tokenDotDot: - p.query.appendPath(&matchRecursiveFn{}) - // nested parse for '..' - tok := p.getToken() - switch tok.typ { - case tokenKey: - p.query.appendPath(newMatchKeyFn(tok.val)) - return p.parseMatchExpr - case tokenLeftBracket: - return p.parseBracketExpr - case tokenStar: - // do nothing - the recursive predicate is enough - return p.parseMatchExpr - } - - case tokenDot: - // nested parse for '.' - tok := p.getToken() - switch tok.typ { - case tokenKey: - p.query.appendPath(newMatchKeyFn(tok.val)) - return p.parseMatchExpr - case tokenStar: - p.query.appendPath(&matchAnyFn{}) - return p.parseMatchExpr - } - - case tokenLeftBracket: - return p.parseBracketExpr - - case tokenEOF: - return nil // allow EOF at this stage - } - return p.parseError(tok, "expected match expression") -} - -func (p *queryParser) parseBracketExpr() queryParserStateFn { - if p.lookahead(tokenInteger, tokenColon) { - return p.parseSliceExpr - } - if p.peek().typ == tokenColon { - return p.parseSliceExpr - } - return p.parseUnionExpr -} - -func (p *queryParser) parseUnionExpr() queryParserStateFn { - var tok *token - - // this state can be traversed after some sub-expressions - // so be careful when setting up state in the parser - if p.union == nil { - p.union = []pathFn{} - } - -loop: // labeled loop for easy breaking - for { - if len(p.union) > 0 { - // parse delimiter or terminator - tok = p.getToken() - switch tok.typ { - case tokenComma: - // do nothing - case tokenRightBracket: - break loop - default: - return p.parseError(tok, "expected ',' or ']', not '%s'", tok.val) - } - } - - // parse sub expression - tok = p.getToken() - switch tok.typ { - case tokenInteger: - p.union = append(p.union, newMatchIndexFn(tok.Int())) - case tokenKey: - p.union = append(p.union, newMatchKeyFn(tok.val)) - case tokenString: - p.union = append(p.union, newMatchKeyFn(tok.val)) - case tokenQuestion: - return p.parseFilterExpr - default: - return p.parseError(tok, "expected union sub expression, not '%s', %d", tok.val, len(p.union)) - } - } - - // if there is only one sub-expression, use that instead - if len(p.union) == 1 { - p.query.appendPath(p.union[0]) - } else { - p.query.appendPath(&matchUnionFn{p.union}) - } - - p.union = nil // clear out state - return p.parseMatchExpr -} - -func (p *queryParser) parseSliceExpr() queryParserStateFn { - // init slice to grab all elements - start, end, step := 0, maxInt, 1 - - // parse optional start - tok := p.getToken() - if tok.typ == tokenInteger { - start = tok.Int() - tok = p.getToken() - } - if tok.typ != tokenColon { - return p.parseError(tok, "expected ':'") - } - - // parse optional end - tok = p.getToken() - if tok.typ == tokenInteger { - end = tok.Int() - tok = p.getToken() - } - if tok.typ == tokenRightBracket { - p.query.appendPath(newMatchSliceFn(start, end, step)) - return p.parseMatchExpr - } - if tok.typ != tokenColon { - return p.parseError(tok, "expected ']' or ':'") - } - - // parse optional step - tok = p.getToken() - if tok.typ == tokenInteger { - step = tok.Int() - if step < 0 { - return p.parseError(tok, "step must be a positive value") - } - tok = p.getToken() - } - if tok.typ != tokenRightBracket { - return p.parseError(tok, "expected ']'") - } - - p.query.appendPath(newMatchSliceFn(start, end, step)) - return p.parseMatchExpr -} - -func (p *queryParser) parseFilterExpr() queryParserStateFn { - tok := p.getToken() - if tok.typ != tokenLeftParen { - return p.parseError(tok, "expected left-parenthesis for filter expression") - } - tok = p.getToken() - if tok.typ != tokenKey && tok.typ != tokenString { - return p.parseError(tok, "expected key or string for filter function name") - } - name := tok.val - tok = p.getToken() - if tok.typ != tokenRightParen { - return p.parseError(tok, "expected right-parenthesis for filter expression") - } - p.union = append(p.union, newMatchFilterFn(name, tok.Position)) - return p.parseUnionExpr -} - -func parseQuery(flow chan token) (*Query, error) { - parser := &queryParser{ - flow: flow, - tokensBuffer: []token{}, - query: newQuery(), - } - parser.run() - return parser.query, parser.err -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/query.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/query.go deleted file mode 100644 index 1c6cd801..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/query.go +++ /dev/null @@ -1,158 +0,0 @@ -package query - -import ( - "time" - - "github.com/pelletier/go-toml" -) - -// NodeFilterFn represents a user-defined filter function, for use with -// Query.SetFilter(). -// -// The return value of the function must indicate if 'node' is to be included -// at this stage of the TOML path. Returning true will include the node, and -// returning false will exclude it. -// -// NOTE: Care should be taken to write script callbacks such that they are safe -// to use from multiple goroutines. -type NodeFilterFn func(node interface{}) bool - -// Result is the result of Executing a Query. -type Result struct { - items []interface{} - positions []toml.Position -} - -// appends a value/position pair to the result set. -func (r *Result) appendResult(node interface{}, pos toml.Position) { - r.items = append(r.items, node) - r.positions = append(r.positions, pos) -} - -// Values is a set of values within a Result. The order of values is not -// guaranteed to be in document order, and may be different each time a query is -// executed. -func (r Result) Values() []interface{} { - return r.items -} - -// Positions is a set of positions for values within a Result. Each index -// in Positions() corresponds to the entry in Value() of the same index. -func (r Result) Positions() []toml.Position { - return r.positions -} - -// runtime context for executing query paths -type queryContext struct { - result *Result - filters *map[string]NodeFilterFn - lastPosition toml.Position -} - -// generic path functor interface -type pathFn interface { - setNext(next pathFn) - // it is the caller's responsibility to set the ctx.lastPosition before invoking call() - // node can be one of: *toml.Tree, []*toml.Tree, or a scalar - call(node interface{}, ctx *queryContext) -} - -// A Query is the representation of a compiled TOML path. A Query is safe -// for concurrent use by multiple goroutines. -type Query struct { - root pathFn - tail pathFn - filters *map[string]NodeFilterFn -} - -func newQuery() *Query { - return &Query{ - root: nil, - tail: nil, - filters: &defaultFilterFunctions, - } -} - -func (q *Query) appendPath(next pathFn) { - if q.root == nil { - q.root = next - } else { - q.tail.setNext(next) - } - q.tail = next - next.setNext(newTerminatingFn()) // init the next functor -} - -// Compile compiles a TOML path expression. The returned Query can be used -// to match elements within a Tree and its descendants. See Execute. -func Compile(path string) (*Query, error) { - return parseQuery(lexQuery(path)) -} - -// Execute executes a query against a Tree, and returns the result of the query. -func (q *Query) Execute(tree *toml.Tree) *Result { - result := &Result{ - items: []interface{}{}, - positions: []toml.Position{}, - } - if q.root == nil { - result.appendResult(tree, tree.GetPosition("")) - } else { - ctx := &queryContext{ - result: result, - filters: q.filters, - } - ctx.lastPosition = tree.Position() - q.root.call(tree, ctx) - } - return result -} - -// CompileAndExecute is a shorthand for Compile(path) followed by Execute(tree). -func CompileAndExecute(path string, tree *toml.Tree) (*Result, error) { - query, err := Compile(path) - if err != nil { - return nil, err - } - return query.Execute(tree), nil -} - -// SetFilter sets a user-defined filter function. These may be used inside -// "?(..)" query expressions to filter TOML document elements within a query. -func (q *Query) SetFilter(name string, fn NodeFilterFn) { - if q.filters == &defaultFilterFunctions { - // clone the static table - q.filters = &map[string]NodeFilterFn{} - for k, v := range defaultFilterFunctions { - (*q.filters)[k] = v - } - } - (*q.filters)[name] = fn -} - -var defaultFilterFunctions = map[string]NodeFilterFn{ - "tree": func(node interface{}) bool { - _, ok := node.(*toml.Tree) - return ok - }, - "int": func(node interface{}) bool { - _, ok := node.(int64) - return ok - }, - "float": func(node interface{}) bool { - _, ok := node.(float64) - return ok - }, - "string": func(node interface{}) bool { - _, ok := node.(string) - return ok - }, - "time": func(node interface{}) bool { - _, ok := node.(time.Time) - return ok - }, - "bool": func(node interface{}) bool { - _, ok := node.(bool) - return ok - }, -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/tokens.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/tokens.go deleted file mode 100644 index 9ae579de..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/query/tokens.go +++ /dev/null @@ -1,106 +0,0 @@ -package query - -import ( - "fmt" - "github.com/pelletier/go-toml" - "strconv" - "unicode" -) - -// Define tokens -type tokenType int - -const ( - eof = -(iota + 1) -) - -const ( - tokenError tokenType = iota - tokenEOF - tokenKey - tokenString - tokenInteger - tokenFloat - tokenLeftBracket - tokenRightBracket - tokenLeftParen - tokenRightParen - tokenComma - tokenColon - tokenDollar - tokenStar - tokenQuestion - tokenDot - tokenDotDot -) - -var tokenTypeNames = []string{ - "Error", - "EOF", - "Key", - "String", - "Integer", - "Float", - "[", - "]", - "(", - ")", - ",", - ":", - "$", - "*", - "?", - ".", - "..", -} - -type token struct { - toml.Position - typ tokenType - val string -} - -func (tt tokenType) String() string { - idx := int(tt) - if idx < len(tokenTypeNames) { - return tokenTypeNames[idx] - } - return "Unknown" -} - -func (t token) Int() int { - if result, err := strconv.Atoi(t.val); err != nil { - panic(err) - } else { - return result - } -} - -func (t token) String() string { - switch t.typ { - case tokenEOF: - return "EOF" - case tokenError: - return t.val - } - - return fmt.Sprintf("%q", t.val) -} - -func isSpace(r rune) bool { - return r == ' ' || r == '\t' -} - -func isAlphanumeric(r rune) bool { - return unicode.IsLetter(r) || r == '_' -} - -func isDigit(r rune) bool { - return unicode.IsNumber(r) -} - -func isHexDigit(r rune) bool { - return isDigit(r) || - (r >= 'a' && r <= 'f') || - (r >= 'A' && r <= 'F') -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/token.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/token.go deleted file mode 100644 index 5581fe0b..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/token.go +++ /dev/null @@ -1,140 +0,0 @@ -package toml - -import ( - "fmt" - "strconv" - "unicode" -) - -// Define tokens -type tokenType int - -const ( - eof = -(iota + 1) -) - -const ( - tokenError tokenType = iota - tokenEOF - tokenComment - tokenKey - tokenString - tokenInteger - tokenTrue - tokenFalse - tokenFloat - tokenEqual - tokenLeftBracket - tokenRightBracket - tokenLeftCurlyBrace - tokenRightCurlyBrace - tokenLeftParen - tokenRightParen - tokenDoubleLeftBracket - tokenDoubleRightBracket - tokenDate - tokenKeyGroup - tokenKeyGroupArray - tokenComma - tokenColon - tokenDollar - tokenStar - tokenQuestion - tokenDot - tokenDotDot - tokenEOL -) - -var tokenTypeNames = []string{ - "Error", - "EOF", - "Comment", - "Key", - "String", - "Integer", - "True", - "False", - "Float", - "=", - "[", - "]", - "{", - "}", - "(", - ")", - "]]", - "[[", - "Date", - "KeyGroup", - "KeyGroupArray", - ",", - ":", - "$", - "*", - "?", - ".", - "..", - "EOL", -} - -type token struct { - Position - typ tokenType - val string -} - -func (tt tokenType) String() string { - idx := int(tt) - if idx < len(tokenTypeNames) { - return tokenTypeNames[idx] - } - return "Unknown" -} - -func (t token) Int() int { - if result, err := strconv.Atoi(t.val); err != nil { - panic(err) - } else { - return result - } -} - -func (t token) String() string { - switch t.typ { - case tokenEOF: - return "EOF" - case tokenError: - return t.val - } - - return fmt.Sprintf("%q", t.val) -} - -func isSpace(r rune) bool { - return r == ' ' || r == '\t' -} - -func isAlphanumeric(r rune) bool { - return unicode.IsLetter(r) || r == '_' -} - -func isKeyChar(r rune) bool { - // Keys start with the first character that isn't whitespace or [ and end - // with the last non-whitespace character before the equals sign. Keys - // cannot contain a # character." - return !(r == '\r' || r == '\n' || r == eof || r == '=') -} - -func isKeyStartChar(r rune) bool { - return !(isSpace(r) || r == '\r' || r == '\n' || r == eof || r == '[') -} - -func isDigit(r rune) bool { - return unicode.IsNumber(r) -} - -func isHexDigit(r rune) bool { - return isDigit(r) || - (r >= 'a' && r <= 'f') || - (r >= 'A' && r <= 'F') -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/toml.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/toml.go deleted file mode 100644 index c3e32437..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/toml.go +++ /dev/null @@ -1,300 +0,0 @@ -package toml - -import ( - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "runtime" - "strings" -) - -type tomlValue struct { - value interface{} // string, int64, uint64, float64, bool, time.Time, [] of any of this list - comment string - commented bool - position Position -} - -// Tree is the result of the parsing of a TOML file. -type Tree struct { - values map[string]interface{} // string -> *tomlValue, *Tree, []*Tree - comment string - commented bool - position Position -} - -func newTree() *Tree { - return &Tree{ - values: make(map[string]interface{}), - position: Position{}, - } -} - -// TreeFromMap initializes a new Tree object using the given map. -func TreeFromMap(m map[string]interface{}) (*Tree, error) { - result, err := toTree(m) - if err != nil { - return nil, err - } - return result.(*Tree), nil -} - -// Position returns the position of the tree. -func (t *Tree) Position() Position { - return t.position -} - -// Has returns a boolean indicating if the given key exists. -func (t *Tree) Has(key string) bool { - if key == "" { - return false - } - return t.HasPath(strings.Split(key, ".")) -} - -// HasPath returns true if the given path of keys exists, false otherwise. -func (t *Tree) HasPath(keys []string) bool { - return t.GetPath(keys) != nil -} - -// Keys returns the keys of the toplevel tree (does not recurse). -func (t *Tree) Keys() []string { - keys := make([]string, len(t.values)) - i := 0 - for k := range t.values { - keys[i] = k - i++ - } - return keys -} - -// Get the value at key in the Tree. -// Key is a dot-separated path (e.g. a.b.c). -// Returns nil if the path does not exist in the tree. -// If keys is of length zero, the current tree is returned. -func (t *Tree) Get(key string) interface{} { - if key == "" { - return t - } - comps, err := parseKey(key) - if err != nil { - return nil - } - return t.GetPath(comps) -} - -// GetPath returns the element in the tree indicated by 'keys'. -// If keys is of length zero, the current tree is returned. -func (t *Tree) GetPath(keys []string) interface{} { - if len(keys) == 0 { - return t - } - subtree := t - for _, intermediateKey := range keys[:len(keys)-1] { - value, exists := subtree.values[intermediateKey] - if !exists { - return nil - } - switch node := value.(type) { - case *Tree: - subtree = node - case []*Tree: - // go to most recent element - if len(node) == 0 { - return nil - } - subtree = node[len(node)-1] - default: - return nil // cannot navigate through other node types - } - } - // branch based on final node type - switch node := subtree.values[keys[len(keys)-1]].(type) { - case *tomlValue: - return node.value - default: - return node - } -} - -// GetPosition returns the position of the given key. -func (t *Tree) GetPosition(key string) Position { - if key == "" { - return t.position - } - return t.GetPositionPath(strings.Split(key, ".")) -} - -// GetPositionPath returns the element in the tree indicated by 'keys'. -// If keys is of length zero, the current tree is returned. -func (t *Tree) GetPositionPath(keys []string) Position { - if len(keys) == 0 { - return t.position - } - subtree := t - for _, intermediateKey := range keys[:len(keys)-1] { - value, exists := subtree.values[intermediateKey] - if !exists { - return Position{0, 0} - } - switch node := value.(type) { - case *Tree: - subtree = node - case []*Tree: - // go to most recent element - if len(node) == 0 { - return Position{0, 0} - } - subtree = node[len(node)-1] - default: - return Position{0, 0} - } - } - // branch based on final node type - switch node := subtree.values[keys[len(keys)-1]].(type) { - case *tomlValue: - return node.position - case *Tree: - return node.position - case []*Tree: - // go to most recent element - if len(node) == 0 { - return Position{0, 0} - } - return node[len(node)-1].position - default: - return Position{0, 0} - } -} - -// GetDefault works like Get but with a default value -func (t *Tree) GetDefault(key string, def interface{}) interface{} { - val := t.Get(key) - if val == nil { - return def - } - return val -} - -// Set an element in the tree. -// Key is a dot-separated path (e.g. a.b.c). -// Creates all necessary intermediate trees, if needed. -func (t *Tree) Set(key string, comment string, commented bool, value interface{}) { - t.SetPath(strings.Split(key, "."), comment, commented, value) -} - -// SetPath sets an element in the tree. -// Keys is an array of path elements (e.g. {"a","b","c"}). -// Creates all necessary intermediate trees, if needed. -func (t *Tree) SetPath(keys []string, comment string, commented bool, value interface{}) { - subtree := t - for _, intermediateKey := range keys[:len(keys)-1] { - nextTree, exists := subtree.values[intermediateKey] - if !exists { - nextTree = newTree() - subtree.values[intermediateKey] = nextTree // add new element here - } - switch node := nextTree.(type) { - case *Tree: - subtree = node - case []*Tree: - // go to most recent element - if len(node) == 0 { - // create element if it does not exist - subtree.values[intermediateKey] = append(node, newTree()) - } - subtree = node[len(node)-1] - } - } - - var toInsert interface{} - - switch value.(type) { - case *Tree: - tt := value.(*Tree) - tt.comment = comment - toInsert = value - case []*Tree: - toInsert = value - case *tomlValue: - tt := value.(*tomlValue) - tt.comment = comment - toInsert = tt - default: - toInsert = &tomlValue{value: value, comment: comment, commented: commented} - } - - subtree.values[keys[len(keys)-1]] = toInsert -} - -// createSubTree takes a tree and a key and create the necessary intermediate -// subtrees to create a subtree at that point. In-place. -// -// e.g. passing a.b.c will create (assuming tree is empty) tree[a], tree[a][b] -// and tree[a][b][c] -// -// Returns nil on success, error object on failure -func (t *Tree) createSubTree(keys []string, pos Position) error { - subtree := t - for _, intermediateKey := range keys { - nextTree, exists := subtree.values[intermediateKey] - if !exists { - tree := newTree() - tree.position = pos - subtree.values[intermediateKey] = tree - nextTree = tree - } - - switch node := nextTree.(type) { - case []*Tree: - subtree = node[len(node)-1] - case *Tree: - subtree = node - default: - return fmt.Errorf("unknown type for path %s (%s): %T (%#v)", - strings.Join(keys, "."), intermediateKey, nextTree, nextTree) - } - } - return nil -} - -// LoadBytes creates a Tree from a []byte. -func LoadBytes(b []byte) (tree *Tree, err error) { - defer func() { - if r := recover(); r != nil { - if _, ok := r.(runtime.Error); ok { - panic(r) - } - err = errors.New(r.(string)) - } - }() - tree = parseToml(lexToml(b)) - return -} - -// LoadReader creates a Tree from any io.Reader. -func LoadReader(reader io.Reader) (tree *Tree, err error) { - inputBytes, err := ioutil.ReadAll(reader) - if err != nil { - return - } - tree, err = LoadBytes(inputBytes) - return -} - -// Load creates a Tree from a string. -func Load(content string) (tree *Tree, err error) { - return LoadBytes([]byte(content)) -} - -// LoadFile creates a Tree from a file. -func LoadFile(path string) (tree *Tree, err error) { - file, err := os.Open(path) - if err != nil { - return nil, err - } - defer file.Close() - return LoadReader(file) -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_create.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_create.go deleted file mode 100644 index 79610e9b..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_create.go +++ /dev/null @@ -1,142 +0,0 @@ -package toml - -import ( - "fmt" - "reflect" - "time" -) - -var kindToType = [reflect.String + 1]reflect.Type{ - reflect.Bool: reflect.TypeOf(true), - reflect.String: reflect.TypeOf(""), - reflect.Float32: reflect.TypeOf(float64(1)), - reflect.Float64: reflect.TypeOf(float64(1)), - reflect.Int: reflect.TypeOf(int64(1)), - reflect.Int8: reflect.TypeOf(int64(1)), - reflect.Int16: reflect.TypeOf(int64(1)), - reflect.Int32: reflect.TypeOf(int64(1)), - reflect.Int64: reflect.TypeOf(int64(1)), - reflect.Uint: reflect.TypeOf(uint64(1)), - reflect.Uint8: reflect.TypeOf(uint64(1)), - reflect.Uint16: reflect.TypeOf(uint64(1)), - reflect.Uint32: reflect.TypeOf(uint64(1)), - reflect.Uint64: reflect.TypeOf(uint64(1)), -} - -// typeFor returns a reflect.Type for a reflect.Kind, or nil if none is found. -// supported values: -// string, bool, int64, uint64, float64, time.Time, int, int8, int16, int32, uint, uint8, uint16, uint32, float32 -func typeFor(k reflect.Kind) reflect.Type { - if k > 0 && int(k) < len(kindToType) { - return kindToType[k] - } - return nil -} - -func simpleValueCoercion(object interface{}) (interface{}, error) { - switch original := object.(type) { - case string, bool, int64, uint64, float64, time.Time: - return original, nil - case int: - return int64(original), nil - case int8: - return int64(original), nil - case int16: - return int64(original), nil - case int32: - return int64(original), nil - case uint: - return uint64(original), nil - case uint8: - return uint64(original), nil - case uint16: - return uint64(original), nil - case uint32: - return uint64(original), nil - case float32: - return float64(original), nil - case fmt.Stringer: - return original.String(), nil - default: - return nil, fmt.Errorf("cannot convert type %T to Tree", object) - } -} - -func sliceToTree(object interface{}) (interface{}, error) { - // arrays are a bit tricky, since they can represent either a - // collection of simple values, which is represented by one - // *tomlValue, or an array of tables, which is represented by an - // array of *Tree. - - // holding the assumption that this function is called from toTree only when value.Kind() is Array or Slice - value := reflect.ValueOf(object) - insideType := value.Type().Elem() - length := value.Len() - if length > 0 { - insideType = reflect.ValueOf(value.Index(0).Interface()).Type() - } - if insideType.Kind() == reflect.Map { - // this is considered as an array of tables - tablesArray := make([]*Tree, 0, length) - for i := 0; i < length; i++ { - table := value.Index(i) - tree, err := toTree(table.Interface()) - if err != nil { - return nil, err - } - tablesArray = append(tablesArray, tree.(*Tree)) - } - return tablesArray, nil - } - - sliceType := typeFor(insideType.Kind()) - if sliceType == nil { - sliceType = insideType - } - - arrayValue := reflect.MakeSlice(reflect.SliceOf(sliceType), 0, length) - - for i := 0; i < length; i++ { - val := value.Index(i).Interface() - simpleValue, err := simpleValueCoercion(val) - if err != nil { - return nil, err - } - arrayValue = reflect.Append(arrayValue, reflect.ValueOf(simpleValue)) - } - return &tomlValue{value: arrayValue.Interface(), position: Position{}}, nil -} - -func toTree(object interface{}) (interface{}, error) { - value := reflect.ValueOf(object) - - if value.Kind() == reflect.Map { - values := map[string]interface{}{} - keys := value.MapKeys() - for _, key := range keys { - if key.Kind() != reflect.String { - if _, ok := key.Interface().(string); !ok { - return nil, fmt.Errorf("map key needs to be a string, not %T (%v)", key.Interface(), key.Kind()) - } - } - - v := value.MapIndex(key) - newValue, err := toTree(v.Interface()) - if err != nil { - return nil, err - } - values[key.String()] = newValue - } - return &Tree{values: values, position: Position{}}, nil - } - - if value.Kind() == reflect.Array || value.Kind() == reflect.Slice { - return sliceToTree(object) - } - - simpleValue, err := simpleValueCoercion(object) - if err != nil { - return nil, err - } - return &tomlValue{value: simpleValue, position: Position{}}, nil -} diff --git a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_write.go b/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_write.go deleted file mode 100644 index 449f35a4..00000000 --- a/vendor/github.com/mattermost/platform/vendor/github.com/pelletier/go-toml/tomltree_write.go +++ /dev/null @@ -1,270 +0,0 @@ -package toml - -import ( - "bytes" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" -) - -// encodes a string to a TOML-compliant string value -func encodeTomlString(value string) string { - var b bytes.Buffer - - for _, rr := range value { - switch rr { - case '\b': - b.WriteString(`\b`) - case '\t': - b.WriteString(`\t`) - case '\n': - b.WriteString(`\n`) - case '\f': - b.WriteString(`\f`) - case '\r': - b.WriteString(`\r`) - case '"': - b.WriteString(`\"`) - case '\\': - b.WriteString(`\\`) - default: - intRr := uint16(rr) - if intRr < 0x001F { - b.WriteString(fmt.Sprintf("\\u%0.4X", intRr)) - } else { - b.WriteRune(rr) - } - } - } - return b.String() -} - -func tomlValueStringRepresentation(v interface{}) (string, error) { - switch value := v.(type) { - case uint64: - return strconv.FormatUint(value, 10), nil - case int64: - return strconv.FormatInt(value, 10), nil - case float64: - // Ensure a round float does contain a decimal point. Otherwise feeding - // the output back to the parser would convert to an integer. - if math.Trunc(value) == value { - return strconv.FormatFloat(value, 'f', 1, 32), nil - } - return strconv.FormatFloat(value, 'f', -1, 32), nil - case string: - return "\"" + encodeTomlString(value) + "\"", nil - case []byte: - b, _ := v.([]byte) - return tomlValueStringRepresentation(string(b)) - case bool: - if value { - return "true", nil - } - return "false", nil - case time.Time: - return value.Format(time.RFC3339), nil - case nil: - return "", nil - } - - rv := reflect.ValueOf(v) - - if rv.Kind() == reflect.Slice { - values := []string{} - for i := 0; i < rv.Len(); i++ { - item := rv.Index(i).Interface() - itemRepr, err := tomlValueStringRepresentation(item) - if err != nil { - return "", err - } - values = append(values, itemRepr) - } - return "[" + strings.Join(values, ",") + "]", nil - } - return "", fmt.Errorf("unsupported value type %T: %v", v, v) -} - -func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64) (int64, error) { - simpleValuesKeys := make([]string, 0) - complexValuesKeys := make([]string, 0) - - for k := range t.values { - v := t.values[k] - switch v.(type) { - case *Tree, []*Tree: - complexValuesKeys = append(complexValuesKeys, k) - default: - simpleValuesKeys = append(simpleValuesKeys, k) - } - } - - sort.Strings(simpleValuesKeys) - sort.Strings(complexValuesKeys) - - for _, k := range simpleValuesKeys { - v, ok := t.values[k].(*tomlValue) - if !ok { - return bytesCount, fmt.Errorf("invalid value type at %s: %T", k, t.values[k]) - } - - repr, err := tomlValueStringRepresentation(v.value) - if err != nil { - return bytesCount, err - } - - if v.comment != "" { - comment := strings.Replace(v.comment, "\n", "\n"+indent+"#", -1) - start := "# " - if strings.HasPrefix(comment, "#") { - start = "" - } - writtenBytesCountComment, errc := writeStrings(w, "\n", indent, start, comment, "\n") - bytesCount += int64(writtenBytesCountComment) - if errc != nil { - return bytesCount, errc - } - } - - var commented string - if v.commented { - commented = "# " - } - writtenBytesCount, err := writeStrings(w, indent, commented, k, " = ", repr, "\n") - bytesCount += int64(writtenBytesCount) - if err != nil { - return bytesCount, err - } - } - - for _, k := range complexValuesKeys { - v := t.values[k] - - combinedKey := k - if keyspace != "" { - combinedKey = keyspace + "." + combinedKey - } - var commented string - if t.commented { - commented = "# " - } - - switch node := v.(type) { - // node has to be of those two types given how keys are sorted above - case *Tree: - tv, ok := t.values[k].(*Tree) - if !ok { - return bytesCount, fmt.Errorf("invalid value type at %s: %T", k, t.values[k]) - } - if tv.comment != "" { - comment := strings.Replace(tv.comment, "\n", "\n"+indent+"#", -1) - start := "# " - if strings.HasPrefix(comment, "#") { - start = "" - } - writtenBytesCountComment, errc := writeStrings(w, "\n", indent, start, comment) - bytesCount += int64(writtenBytesCountComment) - if errc != nil { - return bytesCount, errc - } - } - writtenBytesCount, err := writeStrings(w, "\n", indent, commented, "[", combinedKey, "]\n") - bytesCount += int64(writtenBytesCount) - if err != nil { - return bytesCount, err - } - bytesCount, err = node.writeTo(w, indent+" ", combinedKey, bytesCount) - if err != nil { - return bytesCount, err - } - case []*Tree: - for _, subTree := range node { - writtenBytesCount, err := writeStrings(w, "\n", indent, commented, "[[", combinedKey, "]]\n") - bytesCount += int64(writtenBytesCount) - if err != nil { - return bytesCount, err - } - - bytesCount, err = subTree.writeTo(w, indent+" ", combinedKey, bytesCount) - if err != nil { - return bytesCount, err - } - } - } - } - - return bytesCount, nil -} - -func writeStrings(w io.Writer, s ...string) (int, error) { - var n int - for i := range s { - b, err := io.WriteString(w, s[i]) - n += b - if err != nil { - return n, err - } - } - return n, nil -} - -// WriteTo encode the Tree as Toml and writes it to the writer w. -// Returns the number of bytes written in case of success, or an error if anything happened. -func (t *Tree) WriteTo(w io.Writer) (int64, error) { - return t.writeTo(w, "", "", 0) -} - -// ToTomlString generates a human-readable representation of the current tree. -// Output spans multiple lines, and is suitable for ingest by a TOML parser. -// If the conversion cannot be performed, ToString returns a non-nil error. -func (t *Tree) ToTomlString() (string, error) { - var buf bytes.Buffer - _, err := t.WriteTo(&buf) - if err != nil { - return "", err - } - return buf.String(), nil -} - -// String generates a human-readable representation of the current tree. -// Alias of ToString. Present to implement the fmt.Stringer interface. -func (t *Tree) String() string { - result, _ := t.ToTomlString() - return result -} - -// ToMap recursively generates a representation of the tree using Go built-in structures. -// The following types are used: -// -// * bool -// * float64 -// * int64 -// * string -// * uint64 -// * time.Time -// * map[string]interface{} (where interface{} is any of this list) -// * []interface{} (where interface{} is any of this list) -func (t *Tree) ToMap() map[string]interface{} { - result := map[string]interface{}{} - - for k, v := range t.values { - switch node := v.(type) { - case []*Tree: - var array []interface{} - for _, item := range node { - array = append(array, item.ToMap()) - } - result[k] = array - case *Tree: - result[k] = node.ToMap() - case *tomlValue: - result[k] = node.value - } - } - return result -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/LICENSE.txt b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/LICENSE.txt deleted file mode 100644 index ead98cf0..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/LICENSE.txt +++ /dev/null @@ -1,897 +0,0 @@ -Mattermost Licensing - -SOFTWARE LICENSING - -You are licensed to use compiled versions of the Mattermost platform produced by Mattermost, Inc. under an MIT LICENSE - -- See MIT-COMPILED-LICENSE.md included in compiled versions for details - -You may be licensed to use source code to create compiled versions not produced by Mattermost, Inc. in one of two ways: - -1. Under the Free Software Foundation’s GNU AGPL v.3.0, subject to the exceptions outlined in this policy; or -2. Under a commercial license available from Mattermost, Inc. by contacting commercial@mattermost.com - -You are licensed to use the source code in Admin Tools and Configuration Files (templates/, config/, model/, -webapp/client, webapp/fonts, webapp/i18n, webapp/images and all subdirectories thereof) under the Apache License v2.0. - -We promise that we will not enforce the copyleft provisions in AGPL v3.0 against you if your application (a) does not -link to the Mattermost Platform directly, but exclusively uses the Mattermost Admin Tools and Configuration Files, and -(b) you have not modified, added to or adapted the source code of Mattermost in a way that results in the creation of -a “modified version” or “work based on” Mattermost as these terms are defined in the AGPL v3.0 license. - -MATTERMOST TRADEMARK GUIDELINES - -Your use of the mark Mattermost is subject to Mattermost, Inc's prior written approval and our organization’s Trademark -Standards of Use at http://www.mattermost.org/trademark-standards-of-use/. For trademark approval or any questions -you have about using these trademarks, please email trademark@mattermost.com - ------------------------------------------------------------------------------------------------------------------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- - -The software is released under the terms of the GNU Affero General Public -License, version 3. - - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/apic.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/apic.go deleted file mode 100644 index 95ec014e..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/apic.go +++ /dev/null @@ -1,742 +0,0 @@ -package yaml - -import ( - "io" - "os" -) - -func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) { - //fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) - - // Check if we can move the queue at the beginning of the buffer. - if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { - if parser.tokens_head != len(parser.tokens) { - copy(parser.tokens, parser.tokens[parser.tokens_head:]) - } - parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head] - parser.tokens_head = 0 - } - parser.tokens = append(parser.tokens, *token) - if pos < 0 { - return - } - copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:]) - parser.tokens[parser.tokens_head+pos] = *token -} - -// Create a new parser object. -func yaml_parser_initialize(parser *yaml_parser_t) bool { - *parser = yaml_parser_t{ - raw_buffer: make([]byte, 0, input_raw_buffer_size), - buffer: make([]byte, 0, input_buffer_size), - } - return true -} - -// Destroy a parser object. -func yaml_parser_delete(parser *yaml_parser_t) { - *parser = yaml_parser_t{} -} - -// String read handler. -func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { - if parser.input_pos == len(parser.input) { - return 0, io.EOF - } - n = copy(buffer, parser.input[parser.input_pos:]) - parser.input_pos += n - return n, nil -} - -// File read handler. -func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { - return parser.input_file.Read(buffer) -} - -// Set a string input. -func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) { - if parser.read_handler != nil { - panic("must set the input source only once") - } - parser.read_handler = yaml_string_read_handler - parser.input = input - parser.input_pos = 0 -} - -// Set a file input. -func yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) { - if parser.read_handler != nil { - panic("must set the input source only once") - } - parser.read_handler = yaml_file_read_handler - parser.input_file = file -} - -// Set the source encoding. -func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) { - if parser.encoding != yaml_ANY_ENCODING { - panic("must set the encoding only once") - } - parser.encoding = encoding -} - -// Create a new emitter object. -func yaml_emitter_initialize(emitter *yaml_emitter_t) bool { - *emitter = yaml_emitter_t{ - buffer: make([]byte, output_buffer_size), - raw_buffer: make([]byte, 0, output_raw_buffer_size), - states: make([]yaml_emitter_state_t, 0, initial_stack_size), - events: make([]yaml_event_t, 0, initial_queue_size), - } - return true -} - -// Destroy an emitter object. -func yaml_emitter_delete(emitter *yaml_emitter_t) { - *emitter = yaml_emitter_t{} -} - -// String write handler. -func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - *emitter.output_buffer = append(*emitter.output_buffer, buffer...) - return nil -} - -// File write handler. -func yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - _, err := emitter.output_file.Write(buffer) - return err -} - -// Set a string output. -func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]byte) { - if emitter.write_handler != nil { - panic("must set the output target only once") - } - emitter.write_handler = yaml_string_write_handler - emitter.output_buffer = output_buffer -} - -// Set a file output. -func yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) { - if emitter.write_handler != nil { - panic("must set the output target only once") - } - emitter.write_handler = yaml_file_write_handler - emitter.output_file = file -} - -// Set the output encoding. -func yaml_emitter_set_encoding(emitter *yaml_emitter_t, encoding yaml_encoding_t) { - if emitter.encoding != yaml_ANY_ENCODING { - panic("must set the output encoding only once") - } - emitter.encoding = encoding -} - -// Set the canonical output style. -func yaml_emitter_set_canonical(emitter *yaml_emitter_t, canonical bool) { - emitter.canonical = canonical -} - -//// Set the indentation increment. -func yaml_emitter_set_indent(emitter *yaml_emitter_t, indent int) { - if indent < 2 || indent > 9 { - indent = 2 - } - emitter.best_indent = indent -} - -// Set the preferred line width. -func yaml_emitter_set_width(emitter *yaml_emitter_t, width int) { - if width < 0 { - width = -1 - } - emitter.best_width = width -} - -// Set if unescaped non-ASCII characters are allowed. -func yaml_emitter_set_unicode(emitter *yaml_emitter_t, unicode bool) { - emitter.unicode = unicode -} - -// Set the preferred line break character. -func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) { - emitter.line_break = line_break -} - -///* -// * Destroy a token object. -// */ -// -//YAML_DECLARE(void) -//yaml_token_delete(yaml_token_t *token) -//{ -// assert(token); // Non-NULL token object expected. -// -// switch (token.type) -// { -// case YAML_TAG_DIRECTIVE_TOKEN: -// yaml_free(token.data.tag_directive.handle); -// yaml_free(token.data.tag_directive.prefix); -// break; -// -// case YAML_ALIAS_TOKEN: -// yaml_free(token.data.alias.value); -// break; -// -// case YAML_ANCHOR_TOKEN: -// yaml_free(token.data.anchor.value); -// break; -// -// case YAML_TAG_TOKEN: -// yaml_free(token.data.tag.handle); -// yaml_free(token.data.tag.suffix); -// break; -// -// case YAML_SCALAR_TOKEN: -// yaml_free(token.data.scalar.value); -// break; -// -// default: -// break; -// } -// -// memset(token, 0, sizeof(yaml_token_t)); -//} -// -///* -// * Check if a string is a valid UTF-8 sequence. -// * -// * Check 'reader.c' for more details on UTF-8 encoding. -// */ -// -//static int -//yaml_check_utf8(yaml_char_t *start, size_t length) -//{ -// yaml_char_t *end = start+length; -// yaml_char_t *pointer = start; -// -// while (pointer < end) { -// unsigned char octet; -// unsigned int width; -// unsigned int value; -// size_t k; -// -// octet = pointer[0]; -// width = (octet & 0x80) == 0x00 ? 1 : -// (octet & 0xE0) == 0xC0 ? 2 : -// (octet & 0xF0) == 0xE0 ? 3 : -// (octet & 0xF8) == 0xF0 ? 4 : 0; -// value = (octet & 0x80) == 0x00 ? octet & 0x7F : -// (octet & 0xE0) == 0xC0 ? octet & 0x1F : -// (octet & 0xF0) == 0xE0 ? octet & 0x0F : -// (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0; -// if (!width) return 0; -// if (pointer+width > end) return 0; -// for (k = 1; k < width; k ++) { -// octet = pointer[k]; -// if ((octet & 0xC0) != 0x80) return 0; -// value = (value << 6) + (octet & 0x3F); -// } -// if (!((width == 1) || -// (width == 2 && value >= 0x80) || -// (width == 3 && value >= 0x800) || -// (width == 4 && value >= 0x10000))) return 0; -// -// pointer += width; -// } -// -// return 1; -//} -// - -// Create STREAM-START. -func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool { - *event = yaml_event_t{ - typ: yaml_STREAM_START_EVENT, - encoding: encoding, - } - return true -} - -// Create STREAM-END. -func yaml_stream_end_event_initialize(event *yaml_event_t) bool { - *event = yaml_event_t{ - typ: yaml_STREAM_END_EVENT, - } - return true -} - -// Create DOCUMENT-START. -func yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t, - tag_directives []yaml_tag_directive_t, implicit bool) bool { - *event = yaml_event_t{ - typ: yaml_DOCUMENT_START_EVENT, - version_directive: version_directive, - tag_directives: tag_directives, - implicit: implicit, - } - return true -} - -// Create DOCUMENT-END. -func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool { - *event = yaml_event_t{ - typ: yaml_DOCUMENT_END_EVENT, - implicit: implicit, - } - return true -} - -///* -// * Create ALIAS. -// */ -// -//YAML_DECLARE(int) -//yaml_alias_event_initialize(event *yaml_event_t, anchor *yaml_char_t) -//{ -// mark yaml_mark_t = { 0, 0, 0 } -// anchor_copy *yaml_char_t = NULL -// -// assert(event) // Non-NULL event object is expected. -// assert(anchor) // Non-NULL anchor is expected. -// -// if (!yaml_check_utf8(anchor, strlen((char *)anchor))) return 0 -// -// anchor_copy = yaml_strdup(anchor) -// if (!anchor_copy) -// return 0 -// -// ALIAS_EVENT_INIT(*event, anchor_copy, mark, mark) -// -// return 1 -//} - -// Create SCALAR. -func yaml_scalar_event_initialize(event *yaml_event_t, anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style yaml_scalar_style_t) bool { - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - anchor: anchor, - tag: tag, - value: value, - implicit: plain_implicit, - quoted_implicit: quoted_implicit, - style: yaml_style_t(style), - } - return true -} - -// Create SEQUENCE-START. -func yaml_sequence_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_sequence_style_t) bool { - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(style), - } - return true -} - -// Create SEQUENCE-END. -func yaml_sequence_end_event_initialize(event *yaml_event_t) bool { - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - } - return true -} - -// Create MAPPING-START. -func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool { - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(style), - } - return true -} - -// Create MAPPING-END. -func yaml_mapping_end_event_initialize(event *yaml_event_t) bool { - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - } - return true -} - -// Destroy an event object. -func yaml_event_delete(event *yaml_event_t) { - *event = yaml_event_t{} -} - -///* -// * Create a document object. -// */ -// -//YAML_DECLARE(int) -//yaml_document_initialize(document *yaml_document_t, -// version_directive *yaml_version_directive_t, -// tag_directives_start *yaml_tag_directive_t, -// tag_directives_end *yaml_tag_directive_t, -// start_implicit int, end_implicit int) -//{ -// struct { -// error yaml_error_type_t -// } context -// struct { -// start *yaml_node_t -// end *yaml_node_t -// top *yaml_node_t -// } nodes = { NULL, NULL, NULL } -// version_directive_copy *yaml_version_directive_t = NULL -// struct { -// start *yaml_tag_directive_t -// end *yaml_tag_directive_t -// top *yaml_tag_directive_t -// } tag_directives_copy = { NULL, NULL, NULL } -// value yaml_tag_directive_t = { NULL, NULL } -// mark yaml_mark_t = { 0, 0, 0 } -// -// assert(document) // Non-NULL document object is expected. -// assert((tag_directives_start && tag_directives_end) || -// (tag_directives_start == tag_directives_end)) -// // Valid tag directives are expected. -// -// if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error -// -// if (version_directive) { -// version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t)) -// if (!version_directive_copy) goto error -// version_directive_copy.major = version_directive.major -// version_directive_copy.minor = version_directive.minor -// } -// -// if (tag_directives_start != tag_directives_end) { -// tag_directive *yaml_tag_directive_t -// if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE)) -// goto error -// for (tag_directive = tag_directives_start -// tag_directive != tag_directives_end; tag_directive ++) { -// assert(tag_directive.handle) -// assert(tag_directive.prefix) -// if (!yaml_check_utf8(tag_directive.handle, -// strlen((char *)tag_directive.handle))) -// goto error -// if (!yaml_check_utf8(tag_directive.prefix, -// strlen((char *)tag_directive.prefix))) -// goto error -// value.handle = yaml_strdup(tag_directive.handle) -// value.prefix = yaml_strdup(tag_directive.prefix) -// if (!value.handle || !value.prefix) goto error -// if (!PUSH(&context, tag_directives_copy, value)) -// goto error -// value.handle = NULL -// value.prefix = NULL -// } -// } -// -// DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy, -// tag_directives_copy.start, tag_directives_copy.top, -// start_implicit, end_implicit, mark, mark) -// -// return 1 -// -//error: -// STACK_DEL(&context, nodes) -// yaml_free(version_directive_copy) -// while (!STACK_EMPTY(&context, tag_directives_copy)) { -// value yaml_tag_directive_t = POP(&context, tag_directives_copy) -// yaml_free(value.handle) -// yaml_free(value.prefix) -// } -// STACK_DEL(&context, tag_directives_copy) -// yaml_free(value.handle) -// yaml_free(value.prefix) -// -// return 0 -//} -// -///* -// * Destroy a document object. -// */ -// -//YAML_DECLARE(void) -//yaml_document_delete(document *yaml_document_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// tag_directive *yaml_tag_directive_t -// -// context.error = YAML_NO_ERROR // Eliminate a compliler warning. -// -// assert(document) // Non-NULL document object is expected. -// -// while (!STACK_EMPTY(&context, document.nodes)) { -// node yaml_node_t = POP(&context, document.nodes) -// yaml_free(node.tag) -// switch (node.type) { -// case YAML_SCALAR_NODE: -// yaml_free(node.data.scalar.value) -// break -// case YAML_SEQUENCE_NODE: -// STACK_DEL(&context, node.data.sequence.items) -// break -// case YAML_MAPPING_NODE: -// STACK_DEL(&context, node.data.mapping.pairs) -// break -// default: -// assert(0) // Should not happen. -// } -// } -// STACK_DEL(&context, document.nodes) -// -// yaml_free(document.version_directive) -// for (tag_directive = document.tag_directives.start -// tag_directive != document.tag_directives.end -// tag_directive++) { -// yaml_free(tag_directive.handle) -// yaml_free(tag_directive.prefix) -// } -// yaml_free(document.tag_directives.start) -// -// memset(document, 0, sizeof(yaml_document_t)) -//} -// -///** -// * Get a document node. -// */ -// -//YAML_DECLARE(yaml_node_t *) -//yaml_document_get_node(document *yaml_document_t, index int) -//{ -// assert(document) // Non-NULL document object is expected. -// -// if (index > 0 && document.nodes.start + index <= document.nodes.top) { -// return document.nodes.start + index - 1 -// } -// return NULL -//} -// -///** -// * Get the root object. -// */ -// -//YAML_DECLARE(yaml_node_t *) -//yaml_document_get_root_node(document *yaml_document_t) -//{ -// assert(document) // Non-NULL document object is expected. -// -// if (document.nodes.top != document.nodes.start) { -// return document.nodes.start -// } -// return NULL -//} -// -///* -// * Add a scalar node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_scalar(document *yaml_document_t, -// tag *yaml_char_t, value *yaml_char_t, length int, -// style yaml_scalar_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// value_copy *yaml_char_t = NULL -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// assert(value) // Non-NULL value is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (length < 0) { -// length = strlen((char *)value) -// } -// -// if (!yaml_check_utf8(value, length)) goto error -// value_copy = yaml_malloc(length+1) -// if (!value_copy) goto error -// memcpy(value_copy, value, length) -// value_copy[length] = '\0' -// -// SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// yaml_free(tag_copy) -// yaml_free(value_copy) -// -// return 0 -//} -// -///* -// * Add a sequence node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_sequence(document *yaml_document_t, -// tag *yaml_char_t, style yaml_sequence_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// struct { -// start *yaml_node_item_t -// end *yaml_node_item_t -// top *yaml_node_item_t -// } items = { NULL, NULL, NULL } -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error -// -// SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end, -// style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// STACK_DEL(&context, items) -// yaml_free(tag_copy) -// -// return 0 -//} -// -///* -// * Add a mapping node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_mapping(document *yaml_document_t, -// tag *yaml_char_t, style yaml_mapping_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// struct { -// start *yaml_node_pair_t -// end *yaml_node_pair_t -// top *yaml_node_pair_t -// } pairs = { NULL, NULL, NULL } -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error -// -// MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end, -// style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// STACK_DEL(&context, pairs) -// yaml_free(tag_copy) -// -// return 0 -//} -// -///* -// * Append an item to a sequence node. -// */ -// -//YAML_DECLARE(int) -//yaml_document_append_sequence_item(document *yaml_document_t, -// sequence int, item int) -//{ -// struct { -// error yaml_error_type_t -// } context -// -// assert(document) // Non-NULL document is required. -// assert(sequence > 0 -// && document.nodes.start + sequence <= document.nodes.top) -// // Valid sequence id is required. -// assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE) -// // A sequence node is required. -// assert(item > 0 && document.nodes.start + item <= document.nodes.top) -// // Valid item id is required. -// -// if (!PUSH(&context, -// document.nodes.start[sequence-1].data.sequence.items, item)) -// return 0 -// -// return 1 -//} -// -///* -// * Append a pair of a key and a value to a mapping node. -// */ -// -//YAML_DECLARE(int) -//yaml_document_append_mapping_pair(document *yaml_document_t, -// mapping int, key int, value int) -//{ -// struct { -// error yaml_error_type_t -// } context -// -// pair yaml_node_pair_t -// -// assert(document) // Non-NULL document is required. -// assert(mapping > 0 -// && document.nodes.start + mapping <= document.nodes.top) -// // Valid mapping id is required. -// assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE) -// // A mapping node is required. -// assert(key > 0 && document.nodes.start + key <= document.nodes.top) -// // Valid key id is required. -// assert(value > 0 && document.nodes.start + value <= document.nodes.top) -// // Valid value id is required. -// -// pair.key = key -// pair.value = value -// -// if (!PUSH(&context, -// document.nodes.start[mapping-1].data.mapping.pairs, pair)) -// return 0 -// -// return 1 -//} -// -// diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/decode.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/decode.go deleted file mode 100644 index db1f5f20..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/decode.go +++ /dev/null @@ -1,685 +0,0 @@ -package yaml - -import ( - "encoding" - "encoding/base64" - "fmt" - "math" - "reflect" - "strconv" - "time" -) - -const ( - documentNode = 1 << iota - mappingNode - sequenceNode - scalarNode - aliasNode -) - -type node struct { - kind int - line, column int - tag string - value string - implicit bool - children []*node - anchors map[string]*node -} - -// ---------------------------------------------------------------------------- -// Parser, produces a node tree out of a libyaml event stream. - -type parser struct { - parser yaml_parser_t - event yaml_event_t - doc *node -} - -func newParser(b []byte) *parser { - p := parser{} - if !yaml_parser_initialize(&p.parser) { - panic("failed to initialize YAML emitter") - } - - if len(b) == 0 { - b = []byte{'\n'} - } - - yaml_parser_set_input_string(&p.parser, b) - - p.skip() - if p.event.typ != yaml_STREAM_START_EVENT { - panic("expected stream start event, got " + strconv.Itoa(int(p.event.typ))) - } - p.skip() - return &p -} - -func (p *parser) destroy() { - if p.event.typ != yaml_NO_EVENT { - yaml_event_delete(&p.event) - } - yaml_parser_delete(&p.parser) -} - -func (p *parser) skip() { - if p.event.typ != yaml_NO_EVENT { - if p.event.typ == yaml_STREAM_END_EVENT { - failf("attempted to go past the end of stream; corrupted value?") - } - yaml_event_delete(&p.event) - } - if !yaml_parser_parse(&p.parser, &p.event) { - p.fail() - } -} - -func (p *parser) fail() { - var where string - var line int - if p.parser.problem_mark.line != 0 { - line = p.parser.problem_mark.line - } else if p.parser.context_mark.line != 0 { - line = p.parser.context_mark.line - } - if line != 0 { - where = "line " + strconv.Itoa(line) + ": " - } - var msg string - if len(p.parser.problem) > 0 { - msg = p.parser.problem - } else { - msg = "unknown problem parsing YAML content" - } - failf("%s%s", where, msg) -} - -func (p *parser) anchor(n *node, anchor []byte) { - if anchor != nil { - p.doc.anchors[string(anchor)] = n - } -} - -func (p *parser) parse() *node { - switch p.event.typ { - case yaml_SCALAR_EVENT: - return p.scalar() - case yaml_ALIAS_EVENT: - return p.alias() - case yaml_MAPPING_START_EVENT: - return p.mapping() - case yaml_SEQUENCE_START_EVENT: - return p.sequence() - case yaml_DOCUMENT_START_EVENT: - return p.document() - case yaml_STREAM_END_EVENT: - // Happens when attempting to decode an empty buffer. - return nil - default: - panic("attempted to parse unknown event: " + strconv.Itoa(int(p.event.typ))) - } -} - -func (p *parser) node(kind int) *node { - return &node{ - kind: kind, - line: p.event.start_mark.line, - column: p.event.start_mark.column, - } -} - -func (p *parser) document() *node { - n := p.node(documentNode) - n.anchors = make(map[string]*node) - p.doc = n - p.skip() - n.children = append(n.children, p.parse()) - if p.event.typ != yaml_DOCUMENT_END_EVENT { - panic("expected end of document event but got " + strconv.Itoa(int(p.event.typ))) - } - p.skip() - return n -} - -func (p *parser) alias() *node { - n := p.node(aliasNode) - n.value = string(p.event.anchor) - p.skip() - return n -} - -func (p *parser) scalar() *node { - n := p.node(scalarNode) - n.value = string(p.event.value) - n.tag = string(p.event.tag) - n.implicit = p.event.implicit - p.anchor(n, p.event.anchor) - p.skip() - return n -} - -func (p *parser) sequence() *node { - n := p.node(sequenceNode) - p.anchor(n, p.event.anchor) - p.skip() - for p.event.typ != yaml_SEQUENCE_END_EVENT { - n.children = append(n.children, p.parse()) - } - p.skip() - return n -} - -func (p *parser) mapping() *node { - n := p.node(mappingNode) - p.anchor(n, p.event.anchor) - p.skip() - for p.event.typ != yaml_MAPPING_END_EVENT { - n.children = append(n.children, p.parse(), p.parse()) - } - p.skip() - return n -} - -// ---------------------------------------------------------------------------- -// Decoder, unmarshals a node into a provided value. - -type decoder struct { - doc *node - aliases map[string]bool - mapType reflect.Type - terrors []string - strict bool -} - -var ( - mapItemType = reflect.TypeOf(MapItem{}) - durationType = reflect.TypeOf(time.Duration(0)) - defaultMapType = reflect.TypeOf(map[interface{}]interface{}{}) - ifaceType = defaultMapType.Elem() -) - -func newDecoder(strict bool) *decoder { - d := &decoder{mapType: defaultMapType, strict: strict} - d.aliases = make(map[string]bool) - return d -} - -func (d *decoder) terror(n *node, tag string, out reflect.Value) { - if n.tag != "" { - tag = n.tag - } - value := n.value - if tag != yaml_SEQ_TAG && tag != yaml_MAP_TAG { - if len(value) > 10 { - value = " `" + value[:7] + "...`" - } else { - value = " `" + value + "`" - } - } - d.terrors = append(d.terrors, fmt.Sprintf("line %d: cannot unmarshal %s%s into %s", n.line+1, shortTag(tag), value, out.Type())) -} - -func (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) { - terrlen := len(d.terrors) - err := u.UnmarshalYAML(func(v interface{}) (err error) { - defer handleErr(&err) - d.unmarshal(n, reflect.ValueOf(v)) - if len(d.terrors) > terrlen { - issues := d.terrors[terrlen:] - d.terrors = d.terrors[:terrlen] - return &TypeError{issues} - } - return nil - }) - if e, ok := err.(*TypeError); ok { - d.terrors = append(d.terrors, e.Errors...) - return false - } - if err != nil { - fail(err) - } - return true -} - -// d.prepare initializes and dereferences pointers and calls UnmarshalYAML -// if a value is found to implement it. -// It returns the initialized and dereferenced out value, whether -// unmarshalling was already done by UnmarshalYAML, and if so whether -// its types unmarshalled appropriately. -// -// If n holds a null value, prepare returns before doing anything. -func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) { - if n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == "" && (n.value == "null" || n.value == "" && n.implicit) { - return out, false, false - } - again := true - for again { - again = false - if out.Kind() == reflect.Ptr { - if out.IsNil() { - out.Set(reflect.New(out.Type().Elem())) - } - out = out.Elem() - again = true - } - if out.CanAddr() { - if u, ok := out.Addr().Interface().(Unmarshaler); ok { - good = d.callUnmarshaler(n, u) - return out, true, good - } - } - } - return out, false, false -} - -func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) { - switch n.kind { - case documentNode: - return d.document(n, out) - case aliasNode: - return d.alias(n, out) - } - out, unmarshaled, good := d.prepare(n, out) - if unmarshaled { - return good - } - switch n.kind { - case scalarNode: - good = d.scalar(n, out) - case mappingNode: - good = d.mapping(n, out) - case sequenceNode: - good = d.sequence(n, out) - default: - panic("internal error: unknown node kind: " + strconv.Itoa(n.kind)) - } - return good -} - -func (d *decoder) document(n *node, out reflect.Value) (good bool) { - if len(n.children) == 1 { - d.doc = n - d.unmarshal(n.children[0], out) - return true - } - return false -} - -func (d *decoder) alias(n *node, out reflect.Value) (good bool) { - an, ok := d.doc.anchors[n.value] - if !ok { - failf("unknown anchor '%s' referenced", n.value) - } - if d.aliases[n.value] { - failf("anchor '%s' value contains itself", n.value) - } - d.aliases[n.value] = true - good = d.unmarshal(an, out) - delete(d.aliases, n.value) - return good -} - -var zeroValue reflect.Value - -func resetMap(out reflect.Value) { - for _, k := range out.MapKeys() { - out.SetMapIndex(k, zeroValue) - } -} - -func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { - var tag string - var resolved interface{} - if n.tag == "" && !n.implicit { - tag = yaml_STR_TAG - resolved = n.value - } else { - tag, resolved = resolve(n.tag, n.value) - if tag == yaml_BINARY_TAG { - data, err := base64.StdEncoding.DecodeString(resolved.(string)) - if err != nil { - failf("!!binary value contains invalid base64 data") - } - resolved = string(data) - } - } - if resolved == nil { - if out.Kind() == reflect.Map && !out.CanAddr() { - resetMap(out) - } else { - out.Set(reflect.Zero(out.Type())) - } - return true - } - if s, ok := resolved.(string); ok && out.CanAddr() { - if u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok { - err := u.UnmarshalText([]byte(s)) - if err != nil { - fail(err) - } - return true - } - } - switch out.Kind() { - case reflect.String: - if tag == yaml_BINARY_TAG { - out.SetString(resolved.(string)) - good = true - } else if resolved != nil { - out.SetString(n.value) - good = true - } - case reflect.Interface: - if resolved == nil { - out.Set(reflect.Zero(out.Type())) - } else { - out.Set(reflect.ValueOf(resolved)) - } - good = true - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - switch resolved := resolved.(type) { - case int: - if !out.OverflowInt(int64(resolved)) { - out.SetInt(int64(resolved)) - good = true - } - case int64: - if !out.OverflowInt(resolved) { - out.SetInt(resolved) - good = true - } - case uint64: - if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { - out.SetInt(int64(resolved)) - good = true - } - case float64: - if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { - out.SetInt(int64(resolved)) - good = true - } - case string: - if out.Type() == durationType { - d, err := time.ParseDuration(resolved) - if err == nil { - out.SetInt(int64(d)) - good = true - } - } - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - switch resolved := resolved.(type) { - case int: - if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - case int64: - if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - case uint64: - if !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - case float64: - if resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) { - out.SetUint(uint64(resolved)) - good = true - } - } - case reflect.Bool: - switch resolved := resolved.(type) { - case bool: - out.SetBool(resolved) - good = true - } - case reflect.Float32, reflect.Float64: - switch resolved := resolved.(type) { - case int: - out.SetFloat(float64(resolved)) - good = true - case int64: - out.SetFloat(float64(resolved)) - good = true - case uint64: - out.SetFloat(float64(resolved)) - good = true - case float64: - out.SetFloat(resolved) - good = true - } - case reflect.Ptr: - if out.Type().Elem() == reflect.TypeOf(resolved) { - // TODO DOes this make sense? When is out a Ptr except when decoding a nil value? - elem := reflect.New(out.Type().Elem()) - elem.Elem().Set(reflect.ValueOf(resolved)) - out.Set(elem) - good = true - } - } - if !good { - d.terror(n, tag, out) - } - return good -} - -func settableValueOf(i interface{}) reflect.Value { - v := reflect.ValueOf(i) - sv := reflect.New(v.Type()).Elem() - sv.Set(v) - return sv -} - -func (d *decoder) sequence(n *node, out reflect.Value) (good bool) { - l := len(n.children) - - var iface reflect.Value - switch out.Kind() { - case reflect.Slice: - out.Set(reflect.MakeSlice(out.Type(), l, l)) - case reflect.Interface: - // No type hints. Will have to use a generic sequence. - iface = out - out = settableValueOf(make([]interface{}, l)) - default: - d.terror(n, yaml_SEQ_TAG, out) - return false - } - et := out.Type().Elem() - - j := 0 - for i := 0; i < l; i++ { - e := reflect.New(et).Elem() - if ok := d.unmarshal(n.children[i], e); ok { - out.Index(j).Set(e) - j++ - } - } - out.Set(out.Slice(0, j)) - if iface.IsValid() { - iface.Set(out) - } - return true -} - -func (d *decoder) mapping(n *node, out reflect.Value) (good bool) { - switch out.Kind() { - case reflect.Struct: - return d.mappingStruct(n, out) - case reflect.Slice: - return d.mappingSlice(n, out) - case reflect.Map: - // okay - case reflect.Interface: - if d.mapType.Kind() == reflect.Map { - iface := out - out = reflect.MakeMap(d.mapType) - iface.Set(out) - } else { - slicev := reflect.New(d.mapType).Elem() - if !d.mappingSlice(n, slicev) { - return false - } - out.Set(slicev) - return true - } - default: - d.terror(n, yaml_MAP_TAG, out) - return false - } - outt := out.Type() - kt := outt.Key() - et := outt.Elem() - - mapType := d.mapType - if outt.Key() == ifaceType && outt.Elem() == ifaceType { - d.mapType = outt - } - - if out.IsNil() { - out.Set(reflect.MakeMap(outt)) - } - l := len(n.children) - for i := 0; i < l; i += 2 { - if isMerge(n.children[i]) { - d.merge(n.children[i+1], out) - continue - } - k := reflect.New(kt).Elem() - if d.unmarshal(n.children[i], k) { - kkind := k.Kind() - if kkind == reflect.Interface { - kkind = k.Elem().Kind() - } - if kkind == reflect.Map || kkind == reflect.Slice { - failf("invalid map key: %#v", k.Interface()) - } - e := reflect.New(et).Elem() - if d.unmarshal(n.children[i+1], e) { - out.SetMapIndex(k, e) - } - } - } - d.mapType = mapType - return true -} - -func (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) { - outt := out.Type() - if outt.Elem() != mapItemType { - d.terror(n, yaml_MAP_TAG, out) - return false - } - - mapType := d.mapType - d.mapType = outt - - var slice []MapItem - var l = len(n.children) - for i := 0; i < l; i += 2 { - if isMerge(n.children[i]) { - d.merge(n.children[i+1], out) - continue - } - item := MapItem{} - k := reflect.ValueOf(&item.Key).Elem() - if d.unmarshal(n.children[i], k) { - v := reflect.ValueOf(&item.Value).Elem() - if d.unmarshal(n.children[i+1], v) { - slice = append(slice, item) - } - } - } - out.Set(reflect.ValueOf(slice)) - d.mapType = mapType - return true -} - -func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) { - sinfo, err := getStructInfo(out.Type()) - if err != nil { - panic(err) - } - name := settableValueOf("") - l := len(n.children) - - var inlineMap reflect.Value - var elemType reflect.Type - if sinfo.InlineMap != -1 { - inlineMap = out.Field(sinfo.InlineMap) - inlineMap.Set(reflect.New(inlineMap.Type()).Elem()) - elemType = inlineMap.Type().Elem() - } - - for i := 0; i < l; i += 2 { - ni := n.children[i] - if isMerge(ni) { - d.merge(n.children[i+1], out) - continue - } - if !d.unmarshal(ni, name) { - continue - } - if info, ok := sinfo.FieldsMap[name.String()]; ok { - var field reflect.Value - if info.Inline == nil { - field = out.Field(info.Num) - } else { - field = out.FieldByIndex(info.Inline) - } - d.unmarshal(n.children[i+1], field) - } else if sinfo.InlineMap != -1 { - if inlineMap.IsNil() { - inlineMap.Set(reflect.MakeMap(inlineMap.Type())) - } - value := reflect.New(elemType).Elem() - d.unmarshal(n.children[i+1], value) - inlineMap.SetMapIndex(name, value) - } else if d.strict { - d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in struct %s", n.line+1, name.String(), out.Type())) - } - } - return true -} - -func failWantMap() { - failf("map merge requires map or sequence of maps as the value") -} - -func (d *decoder) merge(n *node, out reflect.Value) { - switch n.kind { - case mappingNode: - d.unmarshal(n, out) - case aliasNode: - an, ok := d.doc.anchors[n.value] - if ok && an.kind != mappingNode { - failWantMap() - } - d.unmarshal(n, out) - case sequenceNode: - // Step backwards as earlier nodes take precedence. - for i := len(n.children) - 1; i >= 0; i-- { - ni := n.children[i] - if ni.kind == aliasNode { - an, ok := d.doc.anchors[ni.value] - if ok && an.kind != mappingNode { - failWantMap() - } - } else if ni.kind != mappingNode { - failWantMap() - } - d.unmarshal(ni, out) - } - default: - failWantMap() - } -} - -func isMerge(n *node) bool { - return n.kind == scalarNode && n.value == "<<" && (n.implicit == true || n.tag == yaml_MERGE_TAG) -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/emitterc.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/emitterc.go deleted file mode 100644 index 41de8b85..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/emitterc.go +++ /dev/null @@ -1,1684 +0,0 @@ -package yaml - -import ( - "bytes" -) - -// Flush the buffer if needed. -func flush(emitter *yaml_emitter_t) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - return yaml_emitter_flush(emitter) - } - return true -} - -// Put a character to the output buffer. -func put(emitter *yaml_emitter_t, value byte) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { - return false - } - emitter.buffer[emitter.buffer_pos] = value - emitter.buffer_pos++ - emitter.column++ - return true -} - -// Put a line break to the output buffer. -func put_break(emitter *yaml_emitter_t) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { - return false - } - switch emitter.line_break { - case yaml_CR_BREAK: - emitter.buffer[emitter.buffer_pos] = '\r' - emitter.buffer_pos += 1 - case yaml_LN_BREAK: - emitter.buffer[emitter.buffer_pos] = '\n' - emitter.buffer_pos += 1 - case yaml_CRLN_BREAK: - emitter.buffer[emitter.buffer_pos+0] = '\r' - emitter.buffer[emitter.buffer_pos+1] = '\n' - emitter.buffer_pos += 2 - default: - panic("unknown line break setting") - } - emitter.column = 0 - emitter.line++ - return true -} - -// Copy a character from a string into buffer. -func write(emitter *yaml_emitter_t, s []byte, i *int) bool { - if emitter.buffer_pos+5 >= len(emitter.buffer) && !yaml_emitter_flush(emitter) { - return false - } - p := emitter.buffer_pos - w := width(s[*i]) - switch w { - case 4: - emitter.buffer[p+3] = s[*i+3] - fallthrough - case 3: - emitter.buffer[p+2] = s[*i+2] - fallthrough - case 2: - emitter.buffer[p+1] = s[*i+1] - fallthrough - case 1: - emitter.buffer[p+0] = s[*i+0] - default: - panic("unknown character width") - } - emitter.column++ - emitter.buffer_pos += w - *i += w - return true -} - -// Write a whole string into buffer. -func write_all(emitter *yaml_emitter_t, s []byte) bool { - for i := 0; i < len(s); { - if !write(emitter, s, &i) { - return false - } - } - return true -} - -// Copy a line break character from a string into buffer. -func write_break(emitter *yaml_emitter_t, s []byte, i *int) bool { - if s[*i] == '\n' { - if !put_break(emitter) { - return false - } - *i++ - } else { - if !write(emitter, s, i) { - return false - } - emitter.column = 0 - emitter.line++ - } - return true -} - -// Set an emitter error and return false. -func yaml_emitter_set_emitter_error(emitter *yaml_emitter_t, problem string) bool { - emitter.error = yaml_EMITTER_ERROR - emitter.problem = problem - return false -} - -// Emit an event. -func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.events = append(emitter.events, *event) - for !yaml_emitter_need_more_events(emitter) { - event := &emitter.events[emitter.events_head] - if !yaml_emitter_analyze_event(emitter, event) { - return false - } - if !yaml_emitter_state_machine(emitter, event) { - return false - } - yaml_event_delete(event) - emitter.events_head++ - } - return true -} - -// Check if we need to accumulate more events before emitting. -// -// We accumulate extra -// - 1 event for DOCUMENT-START -// - 2 events for SEQUENCE-START -// - 3 events for MAPPING-START -// -func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool { - if emitter.events_head == len(emitter.events) { - return true - } - var accumulate int - switch emitter.events[emitter.events_head].typ { - case yaml_DOCUMENT_START_EVENT: - accumulate = 1 - break - case yaml_SEQUENCE_START_EVENT: - accumulate = 2 - break - case yaml_MAPPING_START_EVENT: - accumulate = 3 - break - default: - return false - } - if len(emitter.events)-emitter.events_head > accumulate { - return false - } - var level int - for i := emitter.events_head; i < len(emitter.events); i++ { - switch emitter.events[i].typ { - case yaml_STREAM_START_EVENT, yaml_DOCUMENT_START_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT: - level++ - case yaml_STREAM_END_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_END_EVENT, yaml_MAPPING_END_EVENT: - level-- - } - if level == 0 { - return false - } - } - return true -} - -// Append a directive to the directives stack. -func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_directive_t, allow_duplicates bool) bool { - for i := 0; i < len(emitter.tag_directives); i++ { - if bytes.Equal(value.handle, emitter.tag_directives[i].handle) { - if allow_duplicates { - return true - } - return yaml_emitter_set_emitter_error(emitter, "duplicate %TAG directive") - } - } - - // [Go] Do we actually need to copy this given garbage collection - // and the lack of deallocating destructors? - tag_copy := yaml_tag_directive_t{ - handle: make([]byte, len(value.handle)), - prefix: make([]byte, len(value.prefix)), - } - copy(tag_copy.handle, value.handle) - copy(tag_copy.prefix, value.prefix) - emitter.tag_directives = append(emitter.tag_directives, tag_copy) - return true -} - -// Increase the indentation level. -func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool { - emitter.indents = append(emitter.indents, emitter.indent) - if emitter.indent < 0 { - if flow { - emitter.indent = emitter.best_indent - } else { - emitter.indent = 0 - } - } else if !indentless { - emitter.indent += emitter.best_indent - } - return true -} - -// State dispatcher. -func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool { - switch emitter.state { - default: - case yaml_EMIT_STREAM_START_STATE: - return yaml_emitter_emit_stream_start(emitter, event) - - case yaml_EMIT_FIRST_DOCUMENT_START_STATE: - return yaml_emitter_emit_document_start(emitter, event, true) - - case yaml_EMIT_DOCUMENT_START_STATE: - return yaml_emitter_emit_document_start(emitter, event, false) - - case yaml_EMIT_DOCUMENT_CONTENT_STATE: - return yaml_emitter_emit_document_content(emitter, event) - - case yaml_EMIT_DOCUMENT_END_STATE: - return yaml_emitter_emit_document_end(emitter, event) - - case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE: - return yaml_emitter_emit_flow_sequence_item(emitter, event, true) - - case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE: - return yaml_emitter_emit_flow_sequence_item(emitter, event, false) - - case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE: - return yaml_emitter_emit_flow_mapping_key(emitter, event, true) - - case yaml_EMIT_FLOW_MAPPING_KEY_STATE: - return yaml_emitter_emit_flow_mapping_key(emitter, event, false) - - case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE: - return yaml_emitter_emit_flow_mapping_value(emitter, event, true) - - case yaml_EMIT_FLOW_MAPPING_VALUE_STATE: - return yaml_emitter_emit_flow_mapping_value(emitter, event, false) - - case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE: - return yaml_emitter_emit_block_sequence_item(emitter, event, true) - - case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE: - return yaml_emitter_emit_block_sequence_item(emitter, event, false) - - case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE: - return yaml_emitter_emit_block_mapping_key(emitter, event, true) - - case yaml_EMIT_BLOCK_MAPPING_KEY_STATE: - return yaml_emitter_emit_block_mapping_key(emitter, event, false) - - case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE: - return yaml_emitter_emit_block_mapping_value(emitter, event, true) - - case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE: - return yaml_emitter_emit_block_mapping_value(emitter, event, false) - - case yaml_EMIT_END_STATE: - return yaml_emitter_set_emitter_error(emitter, "expected nothing after STREAM-END") - } - panic("invalid emitter state") -} - -// Expect STREAM-START. -func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if event.typ != yaml_STREAM_START_EVENT { - return yaml_emitter_set_emitter_error(emitter, "expected STREAM-START") - } - if emitter.encoding == yaml_ANY_ENCODING { - emitter.encoding = event.encoding - if emitter.encoding == yaml_ANY_ENCODING { - emitter.encoding = yaml_UTF8_ENCODING - } - } - if emitter.best_indent < 2 || emitter.best_indent > 9 { - emitter.best_indent = 2 - } - if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 { - emitter.best_width = 80 - } - if emitter.best_width < 0 { - emitter.best_width = 1<<31 - 1 - } - if emitter.line_break == yaml_ANY_BREAK { - emitter.line_break = yaml_LN_BREAK - } - - emitter.indent = -1 - emitter.line = 0 - emitter.column = 0 - emitter.whitespace = true - emitter.indention = true - - if emitter.encoding != yaml_UTF8_ENCODING { - if !yaml_emitter_write_bom(emitter) { - return false - } - } - emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE - return true -} - -// Expect DOCUMENT-START or STREAM-END. -func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - - if event.typ == yaml_DOCUMENT_START_EVENT { - - if event.version_directive != nil { - if !yaml_emitter_analyze_version_directive(emitter, event.version_directive) { - return false - } - } - - for i := 0; i < len(event.tag_directives); i++ { - tag_directive := &event.tag_directives[i] - if !yaml_emitter_analyze_tag_directive(emitter, tag_directive) { - return false - } - if !yaml_emitter_append_tag_directive(emitter, tag_directive, false) { - return false - } - } - - for i := 0; i < len(default_tag_directives); i++ { - tag_directive := &default_tag_directives[i] - if !yaml_emitter_append_tag_directive(emitter, tag_directive, true) { - return false - } - } - - implicit := event.implicit - if !first || emitter.canonical { - implicit = false - } - - if emitter.open_ended && (event.version_directive != nil || len(event.tag_directives) > 0) { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if event.version_directive != nil { - implicit = false - if !yaml_emitter_write_indicator(emitter, []byte("%YAML"), true, false, false) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte("1.1"), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if len(event.tag_directives) > 0 { - implicit = false - for i := 0; i < len(event.tag_directives); i++ { - tag_directive := &event.tag_directives[i] - if !yaml_emitter_write_indicator(emitter, []byte("%TAG"), true, false, false) { - return false - } - if !yaml_emitter_write_tag_handle(emitter, tag_directive.handle) { - return false - } - if !yaml_emitter_write_tag_content(emitter, tag_directive.prefix, true) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - } - - if yaml_emitter_check_empty_document(emitter) { - implicit = false - } - if !implicit { - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte("---"), true, false, false) { - return false - } - if emitter.canonical { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - } - - emitter.state = yaml_EMIT_DOCUMENT_CONTENT_STATE - return true - } - - if event.typ == yaml_STREAM_END_EVENT { - if emitter.open_ended { - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_flush(emitter) { - return false - } - emitter.state = yaml_EMIT_END_STATE - return true - } - - return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-START or STREAM-END") -} - -// Expect the root node. -func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool { - emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE) - return yaml_emitter_emit_node(emitter, event, true, false, false, false) -} - -// Expect DOCUMENT-END. -func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if event.typ != yaml_DOCUMENT_END_EVENT { - return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-END") - } - if !yaml_emitter_write_indent(emitter) { - return false - } - if !event.implicit { - // [Go] Allocate the slice elsewhere. - if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_flush(emitter) { - return false - } - emitter.state = yaml_EMIT_DOCUMENT_START_STATE - emitter.tag_directives = emitter.tag_directives[:0] - return true -} - -// Expect a flow item node. -func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_write_indicator(emitter, []byte{'['}, true, true, false) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - emitter.flow_level++ - } - - if event.typ == yaml_SEQUENCE_END_EVENT { - emitter.flow_level-- - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - if emitter.canonical && !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{']'}, false, false, false) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - - return true - } - - if !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - } - - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE) - return yaml_emitter_emit_node(emitter, event, false, true, false, false) -} - -// Expect a flow key node. -func yaml_emitter_emit_flow_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_write_indicator(emitter, []byte{'{'}, true, true, false) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - emitter.flow_level++ - } - - if event.typ == yaml_MAPPING_END_EVENT { - emitter.flow_level-- - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - if emitter.canonical && !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{'}'}, false, false, false) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true - } - - if !first { - if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) { - return false - } - } - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - - if !emitter.canonical && yaml_emitter_check_simple_key(emitter) { - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, true) - } - if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, false) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a flow value node. -func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool { - if simple { - if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) { - return false - } - } else { - if emitter.canonical || emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a block item node. -func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_increase_indent(emitter, false, emitter.mapping_context && !emitter.indention) { - return false - } - } - if event.typ == yaml_SEQUENCE_END_EVENT { - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true - } - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE) - return yaml_emitter_emit_node(emitter, event, false, true, false, false) -} - -// Expect a block key node. -func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { - if first { - if !yaml_emitter_increase_indent(emitter, false, false) { - return false - } - } - if event.typ == yaml_MAPPING_END_EVENT { - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true - } - if !yaml_emitter_write_indent(emitter) { - return false - } - if yaml_emitter_check_simple_key(emitter) { - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, true) - } - if !yaml_emitter_write_indicator(emitter, []byte{'?'}, true, false, true) { - return false - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_VALUE_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a block value node. -func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool { - if simple { - if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) { - return false - } - } else { - if !yaml_emitter_write_indent(emitter) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, true) { - return false - } - } - emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) - return yaml_emitter_emit_node(emitter, event, false, false, true, false) -} - -// Expect a node. -func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, - root bool, sequence bool, mapping bool, simple_key bool) bool { - - emitter.root_context = root - emitter.sequence_context = sequence - emitter.mapping_context = mapping - emitter.simple_key_context = simple_key - - switch event.typ { - case yaml_ALIAS_EVENT: - return yaml_emitter_emit_alias(emitter, event) - case yaml_SCALAR_EVENT: - return yaml_emitter_emit_scalar(emitter, event) - case yaml_SEQUENCE_START_EVENT: - return yaml_emitter_emit_sequence_start(emitter, event) - case yaml_MAPPING_START_EVENT: - return yaml_emitter_emit_mapping_start(emitter, event) - default: - return yaml_emitter_set_emitter_error(emitter, - "expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS") - } -} - -// Expect ALIAS. -func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true -} - -// Expect SCALAR. -func yaml_emitter_emit_scalar(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_select_scalar_style(emitter, event) { - return false - } - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if !yaml_emitter_increase_indent(emitter, true, false) { - return false - } - if !yaml_emitter_process_scalar(emitter) { - return false - } - emitter.indent = emitter.indents[len(emitter.indents)-1] - emitter.indents = emitter.indents[:len(emitter.indents)-1] - emitter.state = emitter.states[len(emitter.states)-1] - emitter.states = emitter.states[:len(emitter.states)-1] - return true -} - -// Expect SEQUENCE-START. -func yaml_emitter_emit_sequence_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if emitter.flow_level > 0 || emitter.canonical || event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE || - yaml_emitter_check_empty_sequence(emitter) { - emitter.state = yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE - } else { - emitter.state = yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE - } - return true -} - -// Expect MAPPING-START. -func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool { - if !yaml_emitter_process_anchor(emitter) { - return false - } - if !yaml_emitter_process_tag(emitter) { - return false - } - if emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE || - yaml_emitter_check_empty_mapping(emitter) { - emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE - } else { - emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE - } - return true -} - -// Check if the document content is an empty scalar. -func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool { - return false // [Go] Huh? -} - -// Check if the next events represent an empty sequence. -func yaml_emitter_check_empty_sequence(emitter *yaml_emitter_t) bool { - if len(emitter.events)-emitter.events_head < 2 { - return false - } - return emitter.events[emitter.events_head].typ == yaml_SEQUENCE_START_EVENT && - emitter.events[emitter.events_head+1].typ == yaml_SEQUENCE_END_EVENT -} - -// Check if the next events represent an empty mapping. -func yaml_emitter_check_empty_mapping(emitter *yaml_emitter_t) bool { - if len(emitter.events)-emitter.events_head < 2 { - return false - } - return emitter.events[emitter.events_head].typ == yaml_MAPPING_START_EVENT && - emitter.events[emitter.events_head+1].typ == yaml_MAPPING_END_EVENT -} - -// Check if the next node can be expressed as a simple key. -func yaml_emitter_check_simple_key(emitter *yaml_emitter_t) bool { - length := 0 - switch emitter.events[emitter.events_head].typ { - case yaml_ALIAS_EVENT: - length += len(emitter.anchor_data.anchor) - case yaml_SCALAR_EVENT: - if emitter.scalar_data.multiline { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) + - len(emitter.scalar_data.value) - case yaml_SEQUENCE_START_EVENT: - if !yaml_emitter_check_empty_sequence(emitter) { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - case yaml_MAPPING_START_EVENT: - if !yaml_emitter_check_empty_mapping(emitter) { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - default: - return false - } - return length <= 128 -} - -// Determine an acceptable scalar style. -func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event_t) bool { - - no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 - if no_tag && !event.implicit && !event.quoted_implicit { - return yaml_emitter_set_emitter_error(emitter, "neither tag nor implicit flags are specified") - } - - style := event.scalar_style() - if style == yaml_ANY_SCALAR_STYLE { - style = yaml_PLAIN_SCALAR_STYLE - } - if emitter.canonical { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - if emitter.simple_key_context && emitter.scalar_data.multiline { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - - if style == yaml_PLAIN_SCALAR_STYLE { - if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed || - emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - if len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - if no_tag && !event.implicit { - style = yaml_SINGLE_QUOTED_SCALAR_STYLE - } - } - if style == yaml_SINGLE_QUOTED_SCALAR_STYLE { - if !emitter.scalar_data.single_quoted_allowed { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - } - if style == yaml_LITERAL_SCALAR_STYLE || style == yaml_FOLDED_SCALAR_STYLE { - if !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - } - - if no_tag && !event.quoted_implicit && style != yaml_PLAIN_SCALAR_STYLE { - emitter.tag_data.handle = []byte{'!'} - } - emitter.scalar_data.style = style - return true -} - -// Write an achor. -func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool { - if emitter.anchor_data.anchor == nil { - return true - } - c := []byte{'&'} - if emitter.anchor_data.alias { - c[0] = '*' - } - if !yaml_emitter_write_indicator(emitter, c, true, false, false) { - return false - } - return yaml_emitter_write_anchor(emitter, emitter.anchor_data.anchor) -} - -// Write a tag. -func yaml_emitter_process_tag(emitter *yaml_emitter_t) bool { - if len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 { - return true - } - if len(emitter.tag_data.handle) > 0 { - if !yaml_emitter_write_tag_handle(emitter, emitter.tag_data.handle) { - return false - } - if len(emitter.tag_data.suffix) > 0 { - if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { - return false - } - } - } else { - // [Go] Allocate these slices elsewhere. - if !yaml_emitter_write_indicator(emitter, []byte("!<"), true, false, false) { - return false - } - if !yaml_emitter_write_tag_content(emitter, emitter.tag_data.suffix, false) { - return false - } - if !yaml_emitter_write_indicator(emitter, []byte{'>'}, false, false, false) { - return false - } - } - return true -} - -// Write a scalar. -func yaml_emitter_process_scalar(emitter *yaml_emitter_t) bool { - switch emitter.scalar_data.style { - case yaml_PLAIN_SCALAR_STYLE: - return yaml_emitter_write_plain_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) - - case yaml_SINGLE_QUOTED_SCALAR_STYLE: - return yaml_emitter_write_single_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) - - case yaml_DOUBLE_QUOTED_SCALAR_STYLE: - return yaml_emitter_write_double_quoted_scalar(emitter, emitter.scalar_data.value, !emitter.simple_key_context) - - case yaml_LITERAL_SCALAR_STYLE: - return yaml_emitter_write_literal_scalar(emitter, emitter.scalar_data.value) - - case yaml_FOLDED_SCALAR_STYLE: - return yaml_emitter_write_folded_scalar(emitter, emitter.scalar_data.value) - } - panic("unknown scalar style") -} - -// Check if a %YAML directive is valid. -func yaml_emitter_analyze_version_directive(emitter *yaml_emitter_t, version_directive *yaml_version_directive_t) bool { - if version_directive.major != 1 || version_directive.minor != 1 { - return yaml_emitter_set_emitter_error(emitter, "incompatible %YAML directive") - } - return true -} - -// Check if a %TAG directive is valid. -func yaml_emitter_analyze_tag_directive(emitter *yaml_emitter_t, tag_directive *yaml_tag_directive_t) bool { - handle := tag_directive.handle - prefix := tag_directive.prefix - if len(handle) == 0 { - return yaml_emitter_set_emitter_error(emitter, "tag handle must not be empty") - } - if handle[0] != '!' { - return yaml_emitter_set_emitter_error(emitter, "tag handle must start with '!'") - } - if handle[len(handle)-1] != '!' { - return yaml_emitter_set_emitter_error(emitter, "tag handle must end with '!'") - } - for i := 1; i < len(handle)-1; i += width(handle[i]) { - if !is_alpha(handle, i) { - return yaml_emitter_set_emitter_error(emitter, "tag handle must contain alphanumerical characters only") - } - } - if len(prefix) == 0 { - return yaml_emitter_set_emitter_error(emitter, "tag prefix must not be empty") - } - return true -} - -// Check if an anchor is valid. -func yaml_emitter_analyze_anchor(emitter *yaml_emitter_t, anchor []byte, alias bool) bool { - if len(anchor) == 0 { - problem := "anchor value must not be empty" - if alias { - problem = "alias value must not be empty" - } - return yaml_emitter_set_emitter_error(emitter, problem) - } - for i := 0; i < len(anchor); i += width(anchor[i]) { - if !is_alpha(anchor, i) { - problem := "anchor value must contain alphanumerical characters only" - if alias { - problem = "alias value must contain alphanumerical characters only" - } - return yaml_emitter_set_emitter_error(emitter, problem) - } - } - emitter.anchor_data.anchor = anchor - emitter.anchor_data.alias = alias - return true -} - -// Check if a tag is valid. -func yaml_emitter_analyze_tag(emitter *yaml_emitter_t, tag []byte) bool { - if len(tag) == 0 { - return yaml_emitter_set_emitter_error(emitter, "tag value must not be empty") - } - for i := 0; i < len(emitter.tag_directives); i++ { - tag_directive := &emitter.tag_directives[i] - if bytes.HasPrefix(tag, tag_directive.prefix) { - emitter.tag_data.handle = tag_directive.handle - emitter.tag_data.suffix = tag[len(tag_directive.prefix):] - return true - } - } - emitter.tag_data.suffix = tag - return true -} - -// Check if a scalar is valid. -func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { - var ( - block_indicators = false - flow_indicators = false - line_breaks = false - special_characters = false - - leading_space = false - leading_break = false - trailing_space = false - trailing_break = false - break_space = false - space_break = false - - preceded_by_whitespace = false - followed_by_whitespace = false - previous_space = false - previous_break = false - ) - - emitter.scalar_data.value = value - - if len(value) == 0 { - emitter.scalar_data.multiline = false - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = true - emitter.scalar_data.single_quoted_allowed = true - emitter.scalar_data.block_allowed = false - return true - } - - if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) { - block_indicators = true - flow_indicators = true - } - - preceded_by_whitespace = true - for i, w := 0, 0; i < len(value); i += w { - w = width(value[i]) - followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w) - - if i == 0 { - switch value[i] { - case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': - flow_indicators = true - block_indicators = true - case '?', ':': - flow_indicators = true - if followed_by_whitespace { - block_indicators = true - } - case '-': - if followed_by_whitespace { - flow_indicators = true - block_indicators = true - } - } - } else { - switch value[i] { - case ',', '?', '[', ']', '{', '}': - flow_indicators = true - case ':': - flow_indicators = true - if followed_by_whitespace { - block_indicators = true - } - case '#': - if preceded_by_whitespace { - flow_indicators = true - block_indicators = true - } - } - } - - if !is_printable(value, i) || !is_ascii(value, i) && !emitter.unicode { - special_characters = true - } - if is_space(value, i) { - if i == 0 { - leading_space = true - } - if i+width(value[i]) == len(value) { - trailing_space = true - } - if previous_break { - break_space = true - } - previous_space = true - previous_break = false - } else if is_break(value, i) { - line_breaks = true - if i == 0 { - leading_break = true - } - if i+width(value[i]) == len(value) { - trailing_break = true - } - if previous_space { - space_break = true - } - previous_space = false - previous_break = true - } else { - previous_space = false - previous_break = false - } - - // [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition. - preceded_by_whitespace = is_blankz(value, i) - } - - emitter.scalar_data.multiline = line_breaks - emitter.scalar_data.flow_plain_allowed = true - emitter.scalar_data.block_plain_allowed = true - emitter.scalar_data.single_quoted_allowed = true - emitter.scalar_data.block_allowed = true - - if leading_space || leading_break || trailing_space || trailing_break { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - } - if trailing_space { - emitter.scalar_data.block_allowed = false - } - if break_space { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - emitter.scalar_data.single_quoted_allowed = false - } - if space_break || special_characters { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - emitter.scalar_data.single_quoted_allowed = false - emitter.scalar_data.block_allowed = false - } - if line_breaks { - emitter.scalar_data.flow_plain_allowed = false - emitter.scalar_data.block_plain_allowed = false - } - if flow_indicators { - emitter.scalar_data.flow_plain_allowed = false - } - if block_indicators { - emitter.scalar_data.block_plain_allowed = false - } - return true -} - -// Check if the event data is valid. -func yaml_emitter_analyze_event(emitter *yaml_emitter_t, event *yaml_event_t) bool { - - emitter.anchor_data.anchor = nil - emitter.tag_data.handle = nil - emitter.tag_data.suffix = nil - emitter.scalar_data.value = nil - - switch event.typ { - case yaml_ALIAS_EVENT: - if !yaml_emitter_analyze_anchor(emitter, event.anchor, true) { - return false - } - - case yaml_SCALAR_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || (!event.implicit && !event.quoted_implicit)) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - if !yaml_emitter_analyze_scalar(emitter, event.value) { - return false - } - - case yaml_SEQUENCE_START_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || !event.implicit) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - - case yaml_MAPPING_START_EVENT: - if len(event.anchor) > 0 { - if !yaml_emitter_analyze_anchor(emitter, event.anchor, false) { - return false - } - } - if len(event.tag) > 0 && (emitter.canonical || !event.implicit) { - if !yaml_emitter_analyze_tag(emitter, event.tag) { - return false - } - } - } - return true -} - -// Write the BOM character. -func yaml_emitter_write_bom(emitter *yaml_emitter_t) bool { - if !flush(emitter) { - return false - } - pos := emitter.buffer_pos - emitter.buffer[pos+0] = '\xEF' - emitter.buffer[pos+1] = '\xBB' - emitter.buffer[pos+2] = '\xBF' - emitter.buffer_pos += 3 - return true -} - -func yaml_emitter_write_indent(emitter *yaml_emitter_t) bool { - indent := emitter.indent - if indent < 0 { - indent = 0 - } - if !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) { - if !put_break(emitter) { - return false - } - } - for emitter.column < indent { - if !put(emitter, ' ') { - return false - } - } - emitter.whitespace = true - emitter.indention = true - return true -} - -func yaml_emitter_write_indicator(emitter *yaml_emitter_t, indicator []byte, need_whitespace, is_whitespace, is_indention bool) bool { - if need_whitespace && !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - if !write_all(emitter, indicator) { - return false - } - emitter.whitespace = is_whitespace - emitter.indention = (emitter.indention && is_indention) - emitter.open_ended = false - return true -} - -func yaml_emitter_write_anchor(emitter *yaml_emitter_t, value []byte) bool { - if !write_all(emitter, value) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_tag_handle(emitter *yaml_emitter_t, value []byte) bool { - if !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - if !write_all(emitter, value) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_tag_content(emitter *yaml_emitter_t, value []byte, need_whitespace bool) bool { - if need_whitespace && !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - for i := 0; i < len(value); { - var must_write bool - switch value[i] { - case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\'', '(', ')', '[', ']': - must_write = true - default: - must_write = is_alpha(value, i) - } - if must_write { - if !write(emitter, value, &i) { - return false - } - } else { - w := width(value[i]) - for k := 0; k < w; k++ { - octet := value[i] - i++ - if !put(emitter, '%') { - return false - } - - c := octet >> 4 - if c < 10 { - c += '0' - } else { - c += 'A' - 10 - } - if !put(emitter, c) { - return false - } - - c = octet & 0x0f - if c < 10 { - c += '0' - } else { - c += 'A' - 10 - } - if !put(emitter, c) { - return false - } - } - } - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_plain_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { - if !emitter.whitespace { - if !put(emitter, ' ') { - return false - } - } - - spaces := false - breaks := false - for i := 0; i < len(value); { - if is_space(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && !is_space(value, i+1) { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else if is_break(value, i) { - if !breaks && value[i] == '\n' { - if !put_break(emitter) { - return false - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - spaces = false - breaks = false - } - } - - emitter.whitespace = false - emitter.indention = false - if emitter.root_context { - emitter.open_ended = true - } - - return true -} - -func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { - - if !yaml_emitter_write_indicator(emitter, []byte{'\''}, true, false, false) { - return false - } - - spaces := false - breaks := false - for i := 0; i < len(value); { - if is_space(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !is_space(value, i+1) { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - spaces = true - } else if is_break(value, i) { - if !breaks && value[i] == '\n' { - if !put_break(emitter) { - return false - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if value[i] == '\'' { - if !put(emitter, '\'') { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - spaces = false - breaks = false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{'\''}, false, false, false) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_double_quoted_scalar(emitter *yaml_emitter_t, value []byte, allow_breaks bool) bool { - spaces := false - if !yaml_emitter_write_indicator(emitter, []byte{'"'}, true, false, false) { - return false - } - - for i := 0; i < len(value); { - if !is_printable(value, i) || (!emitter.unicode && !is_ascii(value, i)) || - is_bom(value, i) || is_break(value, i) || - value[i] == '"' || value[i] == '\\' { - - octet := value[i] - - var w int - var v rune - switch { - case octet&0x80 == 0x00: - w, v = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, v = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, v = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, v = 4, rune(octet&0x07) - } - for k := 1; k < w; k++ { - octet = value[i+k] - v = (v << 6) + (rune(octet) & 0x3F) - } - i += w - - if !put(emitter, '\\') { - return false - } - - var ok bool - switch v { - case 0x00: - ok = put(emitter, '0') - case 0x07: - ok = put(emitter, 'a') - case 0x08: - ok = put(emitter, 'b') - case 0x09: - ok = put(emitter, 't') - case 0x0A: - ok = put(emitter, 'n') - case 0x0b: - ok = put(emitter, 'v') - case 0x0c: - ok = put(emitter, 'f') - case 0x0d: - ok = put(emitter, 'r') - case 0x1b: - ok = put(emitter, 'e') - case 0x22: - ok = put(emitter, '"') - case 0x5c: - ok = put(emitter, '\\') - case 0x85: - ok = put(emitter, 'N') - case 0xA0: - ok = put(emitter, '_') - case 0x2028: - ok = put(emitter, 'L') - case 0x2029: - ok = put(emitter, 'P') - default: - if v <= 0xFF { - ok = put(emitter, 'x') - w = 2 - } else if v <= 0xFFFF { - ok = put(emitter, 'u') - w = 4 - } else { - ok = put(emitter, 'U') - w = 8 - } - for k := (w - 1) * 4; ok && k >= 0; k -= 4 { - digit := byte((v >> uint(k)) & 0x0F) - if digit < 10 { - ok = put(emitter, digit+'0') - } else { - ok = put(emitter, digit+'A'-10) - } - } - } - if !ok { - return false - } - spaces = false - } else if is_space(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 { - if !yaml_emitter_write_indent(emitter) { - return false - } - if is_space(value, i+1) { - if !put(emitter, '\\') { - return false - } - } - i += width(value[i]) - } else if !write(emitter, value, &i) { - return false - } - spaces = true - } else { - if !write(emitter, value, &i) { - return false - } - spaces = false - } - } - if !yaml_emitter_write_indicator(emitter, []byte{'"'}, false, false, false) { - return false - } - emitter.whitespace = false - emitter.indention = false - return true -} - -func yaml_emitter_write_block_scalar_hints(emitter *yaml_emitter_t, value []byte) bool { - if is_space(value, 0) || is_break(value, 0) { - indent_hint := []byte{'0' + byte(emitter.best_indent)} - if !yaml_emitter_write_indicator(emitter, indent_hint, false, false, false) { - return false - } - } - - emitter.open_ended = false - - var chomp_hint [1]byte - if len(value) == 0 { - chomp_hint[0] = '-' - } else { - i := len(value) - 1 - for value[i]&0xC0 == 0x80 { - i-- - } - if !is_break(value, i) { - chomp_hint[0] = '-' - } else if i == 0 { - chomp_hint[0] = '+' - emitter.open_ended = true - } else { - i-- - for value[i]&0xC0 == 0x80 { - i-- - } - if is_break(value, i) { - chomp_hint[0] = '+' - emitter.open_ended = true - } - } - } - if chomp_hint[0] != 0 { - if !yaml_emitter_write_indicator(emitter, chomp_hint[:], false, false, false) { - return false - } - } - return true -} - -func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bool { - if !yaml_emitter_write_indicator(emitter, []byte{'|'}, true, false, false) { - return false - } - if !yaml_emitter_write_block_scalar_hints(emitter, value) { - return false - } - if !put_break(emitter) { - return false - } - emitter.indention = true - emitter.whitespace = true - breaks := true - for i := 0; i < len(value); { - if is_break(value, i) { - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - } - if !write(emitter, value, &i) { - return false - } - emitter.indention = false - breaks = false - } - } - - return true -} - -func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) bool { - if !yaml_emitter_write_indicator(emitter, []byte{'>'}, true, false, false) { - return false - } - if !yaml_emitter_write_block_scalar_hints(emitter, value) { - return false - } - - if !put_break(emitter) { - return false - } - emitter.indention = true - emitter.whitespace = true - - breaks := true - leading_spaces := true - for i := 0; i < len(value); { - if is_break(value, i) { - if !breaks && !leading_spaces && value[i] == '\n' { - k := 0 - for is_break(value, k) { - k += width(value[k]) - } - if !is_blankz(value, k) { - if !put_break(emitter) { - return false - } - } - } - if !write_break(emitter, value, &i) { - return false - } - emitter.indention = true - breaks = true - } else { - if breaks { - if !yaml_emitter_write_indent(emitter) { - return false - } - leading_spaces = is_blank(value, i) - } - if !breaks && is_space(value, i) && !is_space(value, i+1) && emitter.column > emitter.best_width { - if !yaml_emitter_write_indent(emitter) { - return false - } - i += width(value[i]) - } else { - if !write(emitter, value, &i) { - return false - } - } - emitter.indention = false - breaks = false - } - } - return true -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/encode.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/encode.go deleted file mode 100644 index 84f84995..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/encode.go +++ /dev/null @@ -1,306 +0,0 @@ -package yaml - -import ( - "encoding" - "fmt" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" -) - -type encoder struct { - emitter yaml_emitter_t - event yaml_event_t - out []byte - flow bool -} - -func newEncoder() (e *encoder) { - e = &encoder{} - e.must(yaml_emitter_initialize(&e.emitter)) - yaml_emitter_set_output_string(&e.emitter, &e.out) - yaml_emitter_set_unicode(&e.emitter, true) - e.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING)) - e.emit() - e.must(yaml_document_start_event_initialize(&e.event, nil, nil, true)) - e.emit() - return e -} - -func (e *encoder) finish() { - e.must(yaml_document_end_event_initialize(&e.event, true)) - e.emit() - e.emitter.open_ended = false - e.must(yaml_stream_end_event_initialize(&e.event)) - e.emit() -} - -func (e *encoder) destroy() { - yaml_emitter_delete(&e.emitter) -} - -func (e *encoder) emit() { - // This will internally delete the e.event value. - if !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT { - e.must(false) - } -} - -func (e *encoder) must(ok bool) { - if !ok { - msg := e.emitter.problem - if msg == "" { - msg = "unknown problem generating YAML content" - } - failf("%s", msg) - } -} - -func (e *encoder) marshal(tag string, in reflect.Value) { - if !in.IsValid() { - e.nilv() - return - } - iface := in.Interface() - if m, ok := iface.(Marshaler); ok { - v, err := m.MarshalYAML() - if err != nil { - fail(err) - } - if v == nil { - e.nilv() - return - } - in = reflect.ValueOf(v) - } else if m, ok := iface.(encoding.TextMarshaler); ok { - text, err := m.MarshalText() - if err != nil { - fail(err) - } - in = reflect.ValueOf(string(text)) - } - switch in.Kind() { - case reflect.Interface: - if in.IsNil() { - e.nilv() - } else { - e.marshal(tag, in.Elem()) - } - case reflect.Map: - e.mapv(tag, in) - case reflect.Ptr: - if in.IsNil() { - e.nilv() - } else { - e.marshal(tag, in.Elem()) - } - case reflect.Struct: - e.structv(tag, in) - case reflect.Slice: - if in.Type().Elem() == mapItemType { - e.itemsv(tag, in) - } else { - e.slicev(tag, in) - } - case reflect.String: - e.stringv(tag, in) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if in.Type() == durationType { - e.stringv(tag, reflect.ValueOf(iface.(time.Duration).String())) - } else { - e.intv(tag, in) - } - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - e.uintv(tag, in) - case reflect.Float32, reflect.Float64: - e.floatv(tag, in) - case reflect.Bool: - e.boolv(tag, in) - default: - panic("cannot marshal type: " + in.Type().String()) - } -} - -func (e *encoder) mapv(tag string, in reflect.Value) { - e.mappingv(tag, func() { - keys := keyList(in.MapKeys()) - sort.Sort(keys) - for _, k := range keys { - e.marshal("", k) - e.marshal("", in.MapIndex(k)) - } - }) -} - -func (e *encoder) itemsv(tag string, in reflect.Value) { - e.mappingv(tag, func() { - slice := in.Convert(reflect.TypeOf([]MapItem{})).Interface().([]MapItem) - for _, item := range slice { - e.marshal("", reflect.ValueOf(item.Key)) - e.marshal("", reflect.ValueOf(item.Value)) - } - }) -} - -func (e *encoder) structv(tag string, in reflect.Value) { - sinfo, err := getStructInfo(in.Type()) - if err != nil { - panic(err) - } - e.mappingv(tag, func() { - for _, info := range sinfo.FieldsList { - var value reflect.Value - if info.Inline == nil { - value = in.Field(info.Num) - } else { - value = in.FieldByIndex(info.Inline) - } - if info.OmitEmpty && isZero(value) { - continue - } - e.marshal("", reflect.ValueOf(info.Key)) - e.flow = info.Flow - e.marshal("", value) - } - if sinfo.InlineMap >= 0 { - m := in.Field(sinfo.InlineMap) - if m.Len() > 0 { - e.flow = false - keys := keyList(m.MapKeys()) - sort.Sort(keys) - for _, k := range keys { - if _, found := sinfo.FieldsMap[k.String()]; found { - panic(fmt.Sprintf("Can't have key %q in inlined map; conflicts with struct field", k.String())) - } - e.marshal("", k) - e.flow = false - e.marshal("", m.MapIndex(k)) - } - } - } - }) -} - -func (e *encoder) mappingv(tag string, f func()) { - implicit := tag == "" - style := yaml_BLOCK_MAPPING_STYLE - if e.flow { - e.flow = false - style = yaml_FLOW_MAPPING_STYLE - } - e.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)) - e.emit() - f() - e.must(yaml_mapping_end_event_initialize(&e.event)) - e.emit() -} - -func (e *encoder) slicev(tag string, in reflect.Value) { - implicit := tag == "" - style := yaml_BLOCK_SEQUENCE_STYLE - if e.flow { - e.flow = false - style = yaml_FLOW_SEQUENCE_STYLE - } - e.must(yaml_sequence_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)) - e.emit() - n := in.Len() - for i := 0; i < n; i++ { - e.marshal("", in.Index(i)) - } - e.must(yaml_sequence_end_event_initialize(&e.event)) - e.emit() -} - -// isBase60 returns whether s is in base 60 notation as defined in YAML 1.1. -// -// The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported -// in YAML 1.2 and by this package, but these should be marshalled quoted for -// the time being for compatibility with other parsers. -func isBase60Float(s string) (result bool) { - // Fast path. - if s == "" { - return false - } - c := s[0] - if !(c == '+' || c == '-' || c >= '0' && c <= '9') || strings.IndexByte(s, ':') < 0 { - return false - } - // Do the full match. - return base60float.MatchString(s) -} - -// From http://yaml.org/type/float.html, except the regular expression there -// is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix. -var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`) - -func (e *encoder) stringv(tag string, in reflect.Value) { - var style yaml_scalar_style_t - s := in.String() - rtag, rs := resolve("", s) - if rtag == yaml_BINARY_TAG { - if tag == "" || tag == yaml_STR_TAG { - tag = rtag - s = rs.(string) - } else if tag == yaml_BINARY_TAG { - failf("explicitly tagged !!binary data must be base64-encoded") - } else { - failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag)) - } - } - if tag == "" && (rtag != yaml_STR_TAG || isBase60Float(s)) { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } else if strings.Contains(s, "\n") { - style = yaml_LITERAL_SCALAR_STYLE - } else { - style = yaml_PLAIN_SCALAR_STYLE - } - e.emitScalar(s, "", tag, style) -} - -func (e *encoder) boolv(tag string, in reflect.Value) { - var s string - if in.Bool() { - s = "true" - } else { - s = "false" - } - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) intv(tag string, in reflect.Value) { - s := strconv.FormatInt(in.Int(), 10) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) uintv(tag string, in reflect.Value) { - s := strconv.FormatUint(in.Uint(), 10) - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) floatv(tag string, in reflect.Value) { - // FIXME: Handle 64 bits here. - s := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32) - switch s { - case "+Inf": - s = ".inf" - case "-Inf": - s = "-.inf" - case "NaN": - s = ".nan" - } - e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) nilv() { - e.emitScalar("null", "", "", yaml_PLAIN_SCALAR_STYLE) -} - -func (e *encoder) emitScalar(value, anchor, tag string, style yaml_scalar_style_t) { - implicit := tag == "" - e.must(yaml_scalar_event_initialize(&e.event, []byte(anchor), []byte(tag), []byte(value), implicit, implicit, style)) - e.emit() -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/parserc.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/parserc.go deleted file mode 100644 index 81d05dfe..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/parserc.go +++ /dev/null @@ -1,1095 +0,0 @@ -package yaml - -import ( - "bytes" -) - -// The parser implements the following grammar: -// -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END -// implicit_document ::= block_node DOCUMENT-END* -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// block_node_or_indentless_sequence ::= -// ALIAS -// | properties (block_content | indentless_block_sequence)? -// | block_content -// | indentless_block_sequence -// block_node ::= ALIAS -// | properties block_content? -// | block_content -// flow_node ::= ALIAS -// | properties flow_content? -// | flow_content -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// block_content ::= block_collection | flow_collection | SCALAR -// flow_content ::= flow_collection | SCALAR -// block_collection ::= block_sequence | block_mapping -// flow_collection ::= flow_sequence | flow_mapping -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ -// block_mapping ::= BLOCK-MAPPING_START -// ((KEY block_node_or_indentless_sequence?)? -// (VALUE block_node_or_indentless_sequence?)?)* -// BLOCK-END -// flow_sequence ::= FLOW-SEQUENCE-START -// (flow_sequence_entry FLOW-ENTRY)* -// flow_sequence_entry? -// FLOW-SEQUENCE-END -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// flow_mapping ::= FLOW-MAPPING-START -// (flow_mapping_entry FLOW-ENTRY)* -// flow_mapping_entry? -// FLOW-MAPPING-END -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - -// Peek the next token in the token queue. -func peek_token(parser *yaml_parser_t) *yaml_token_t { - if parser.token_available || yaml_parser_fetch_more_tokens(parser) { - return &parser.tokens[parser.tokens_head] - } - return nil -} - -// Remove the next token from the queue (must be called after peek_token). -func skip_token(parser *yaml_parser_t) { - parser.token_available = false - parser.tokens_parsed++ - parser.stream_end_produced = parser.tokens[parser.tokens_head].typ == yaml_STREAM_END_TOKEN - parser.tokens_head++ -} - -// Get the next event. -func yaml_parser_parse(parser *yaml_parser_t, event *yaml_event_t) bool { - // Erase the event object. - *event = yaml_event_t{} - - // No events after the end of the stream or error. - if parser.stream_end_produced || parser.error != yaml_NO_ERROR || parser.state == yaml_PARSE_END_STATE { - return true - } - - // Generate the next event. - return yaml_parser_state_machine(parser, event) -} - -// Set parser error. -func yaml_parser_set_parser_error(parser *yaml_parser_t, problem string, problem_mark yaml_mark_t) bool { - parser.error = yaml_PARSER_ERROR - parser.problem = problem - parser.problem_mark = problem_mark - return false -} - -func yaml_parser_set_parser_error_context(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string, problem_mark yaml_mark_t) bool { - parser.error = yaml_PARSER_ERROR - parser.context = context - parser.context_mark = context_mark - parser.problem = problem - parser.problem_mark = problem_mark - return false -} - -// State dispatcher. -func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool { - //trace("yaml_parser_state_machine", "state:", parser.state.String()) - - switch parser.state { - case yaml_PARSE_STREAM_START_STATE: - return yaml_parser_parse_stream_start(parser, event) - - case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: - return yaml_parser_parse_document_start(parser, event, true) - - case yaml_PARSE_DOCUMENT_START_STATE: - return yaml_parser_parse_document_start(parser, event, false) - - case yaml_PARSE_DOCUMENT_CONTENT_STATE: - return yaml_parser_parse_document_content(parser, event) - - case yaml_PARSE_DOCUMENT_END_STATE: - return yaml_parser_parse_document_end(parser, event) - - case yaml_PARSE_BLOCK_NODE_STATE: - return yaml_parser_parse_node(parser, event, true, false) - - case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: - return yaml_parser_parse_node(parser, event, true, true) - - case yaml_PARSE_FLOW_NODE_STATE: - return yaml_parser_parse_node(parser, event, false, false) - - case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: - return yaml_parser_parse_block_sequence_entry(parser, event, true) - - case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_block_sequence_entry(parser, event, false) - - case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_indentless_sequence_entry(parser, event) - - case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: - return yaml_parser_parse_block_mapping_key(parser, event, true) - - case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: - return yaml_parser_parse_block_mapping_key(parser, event, false) - - case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: - return yaml_parser_parse_block_mapping_value(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: - return yaml_parser_parse_flow_sequence_entry(parser, event, true) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: - return yaml_parser_parse_flow_sequence_entry(parser, event, false) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_key(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_value(parser, event) - - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: - return yaml_parser_parse_flow_sequence_entry_mapping_end(parser, event) - - case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: - return yaml_parser_parse_flow_mapping_key(parser, event, true) - - case yaml_PARSE_FLOW_MAPPING_KEY_STATE: - return yaml_parser_parse_flow_mapping_key(parser, event, false) - - case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: - return yaml_parser_parse_flow_mapping_value(parser, event, false) - - case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: - return yaml_parser_parse_flow_mapping_value(parser, event, true) - - default: - panic("invalid parser state") - } -} - -// Parse the production: -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END -// ************ -func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_STREAM_START_TOKEN { - return yaml_parser_set_parser_error(parser, "did not find expected ", token.start_mark) - } - parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE - *event = yaml_event_t{ - typ: yaml_STREAM_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - encoding: token.encoding, - } - skip_token(parser) - return true -} - -// Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// * -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// ************************* -func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { - - token := peek_token(parser) - if token == nil { - return false - } - - // Parse extra document end indicators. - if !implicit { - for token.typ == yaml_DOCUMENT_END_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } - - if implicit && token.typ != yaml_VERSION_DIRECTIVE_TOKEN && - token.typ != yaml_TAG_DIRECTIVE_TOKEN && - token.typ != yaml_DOCUMENT_START_TOKEN && - token.typ != yaml_STREAM_END_TOKEN { - // Parse an implicit document. - if !yaml_parser_process_directives(parser, nil, nil) { - return false - } - parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) - parser.state = yaml_PARSE_BLOCK_NODE_STATE - - *event = yaml_event_t{ - typ: yaml_DOCUMENT_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - } else if token.typ != yaml_STREAM_END_TOKEN { - // Parse an explicit document. - var version_directive *yaml_version_directive_t - var tag_directives []yaml_tag_directive_t - start_mark := token.start_mark - if !yaml_parser_process_directives(parser, &version_directive, &tag_directives) { - return false - } - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_DOCUMENT_START_TOKEN { - yaml_parser_set_parser_error(parser, - "did not find expected ", token.start_mark) - return false - } - parser.states = append(parser.states, yaml_PARSE_DOCUMENT_END_STATE) - parser.state = yaml_PARSE_DOCUMENT_CONTENT_STATE - end_mark := token.end_mark - - *event = yaml_event_t{ - typ: yaml_DOCUMENT_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - version_directive: version_directive, - tag_directives: tag_directives, - implicit: false, - } - skip_token(parser) - - } else { - // Parse the stream end. - parser.state = yaml_PARSE_END_STATE - *event = yaml_event_t{ - typ: yaml_STREAM_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - } - - return true -} - -// Parse the productions: -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// *********** -// -func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_VERSION_DIRECTIVE_TOKEN || - token.typ == yaml_TAG_DIRECTIVE_TOKEN || - token.typ == yaml_DOCUMENT_START_TOKEN || - token.typ == yaml_DOCUMENT_END_TOKEN || - token.typ == yaml_STREAM_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - return yaml_parser_process_empty_scalar(parser, event, - token.start_mark) - } - return yaml_parser_parse_node(parser, event, true, false) -} - -// Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// ************* -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// -func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - start_mark := token.start_mark - end_mark := token.start_mark - - implicit := true - if token.typ == yaml_DOCUMENT_END_TOKEN { - end_mark = token.end_mark - skip_token(parser) - implicit = false - } - - parser.tag_directives = parser.tag_directives[:0] - - parser.state = yaml_PARSE_DOCUMENT_START_STATE - *event = yaml_event_t{ - typ: yaml_DOCUMENT_END_EVENT, - start_mark: start_mark, - end_mark: end_mark, - implicit: implicit, - } - return true -} - -// Parse the productions: -// block_node_or_indentless_sequence ::= -// ALIAS -// ***** -// | properties (block_content | indentless_block_sequence)? -// ********** * -// | block_content | indentless_block_sequence -// * -// block_node ::= ALIAS -// ***** -// | properties block_content? -// ********** * -// | block_content -// * -// flow_node ::= ALIAS -// ***** -// | properties flow_content? -// ********** * -// | flow_content -// * -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// ************************* -// block_content ::= block_collection | flow_collection | SCALAR -// ****** -// flow_content ::= flow_collection | SCALAR -// ****** -func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { - //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_ALIAS_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - *event = yaml_event_t{ - typ: yaml_ALIAS_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - anchor: token.value, - } - skip_token(parser) - return true - } - - start_mark := token.start_mark - end_mark := token.start_mark - - var tag_token bool - var tag_handle, tag_suffix, anchor []byte - var tag_mark yaml_mark_t - if token.typ == yaml_ANCHOR_TOKEN { - anchor = token.value - start_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_TAG_TOKEN { - tag_token = true - tag_handle = token.value - tag_suffix = token.suffix - tag_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } else if token.typ == yaml_TAG_TOKEN { - tag_token = true - tag_handle = token.value - tag_suffix = token.suffix - start_mark = token.start_mark - tag_mark = token.start_mark - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_ANCHOR_TOKEN { - anchor = token.value - end_mark = token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - } - - var tag []byte - if tag_token { - if len(tag_handle) == 0 { - tag = tag_suffix - tag_suffix = nil - } else { - for i := range parser.tag_directives { - if bytes.Equal(parser.tag_directives[i].handle, tag_handle) { - tag = append([]byte(nil), parser.tag_directives[i].prefix...) - tag = append(tag, tag_suffix...) - break - } - } - if len(tag) == 0 { - yaml_parser_set_parser_error_context(parser, - "while parsing a node", start_mark, - "found undefined tag handle", tag_mark) - return false - } - } - } - - implicit := len(tag) == 0 - if indentless_sequence && token.typ == yaml_BLOCK_ENTRY_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), - } - return true - } - if token.typ == yaml_SCALAR_TOKEN { - var plain_implicit, quoted_implicit bool - end_mark = token.end_mark - if (len(tag) == 0 && token.style == yaml_PLAIN_SCALAR_STYLE) || (len(tag) == 1 && tag[0] == '!') { - plain_implicit = true - } else if len(tag) == 0 { - quoted_implicit = true - } - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - value: token.value, - implicit: plain_implicit, - quoted_implicit: quoted_implicit, - style: yaml_style_t(token.style), - } - skip_token(parser) - return true - } - if token.typ == yaml_FLOW_SEQUENCE_START_TOKEN { - // [Go] Some of the events below can be merged as they differ only on style. - end_mark = token.end_mark - parser.state = yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_FLOW_SEQUENCE_STYLE), - } - return true - } - if token.typ == yaml_FLOW_MAPPING_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), - } - return true - } - if block && token.typ == yaml_BLOCK_SEQUENCE_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_SEQUENCE_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_SEQUENCE_STYLE), - } - return true - } - if block && token.typ == yaml_BLOCK_MAPPING_START_TOKEN { - end_mark = token.end_mark - parser.state = yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - style: yaml_style_t(yaml_BLOCK_MAPPING_STYLE), - } - return true - } - if len(anchor) > 0 || len(tag) > 0 { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - start_mark: start_mark, - end_mark: end_mark, - anchor: anchor, - tag: tag, - implicit: implicit, - quoted_implicit: false, - style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), - } - return true - } - - context := "while parsing a flow node" - if block { - context = "while parsing a block node" - } - yaml_parser_set_parser_error_context(parser, context, start_mark, - "did not find expected node content", token.start_mark) - return false -} - -// Parse the productions: -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END -// ******************** *********** * ********* -// -func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_BLOCK_ENTRY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_BLOCK_ENTRY_TOKEN && token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, true, false) - } else { - parser.state = yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } - if token.typ == yaml_BLOCK_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true - } - - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a block collection", context_mark, - "did not find expected '-' indicator", token.start_mark) -} - -// Parse the productions: -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ -// *********** * -func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_BLOCK_ENTRY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_BLOCK_ENTRY_TOKEN && - token.typ != yaml_KEY_TOKEN && - token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, true, false) - } - parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.start_mark, // [Go] Shouldn't this be token.end_mark? - } - return true -} - -// Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START -// ******************* -// ((KEY block_node_or_indentless_sequence?)? -// *** * -// (VALUE block_node_or_indentless_sequence?)?)* -// -// BLOCK-END -// ********* -// -func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ == yaml_KEY_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_KEY_TOKEN && - token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, true, true) - } else { - parser.state = yaml_PARSE_BLOCK_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - } else if token.typ == yaml_BLOCK_END_TOKEN { - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - return true - } - - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a block mapping", context_mark, - "did not find expected key", token.start_mark) -} - -// Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START -// -// ((KEY block_node_or_indentless_sequence?)? -// -// (VALUE block_node_or_indentless_sequence?)?)* -// ***** * -// BLOCK-END -// -// -func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_VALUE_TOKEN { - mark := token.end_mark - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_KEY_TOKEN && - token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_BLOCK_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_BLOCK_MAPPING_KEY_STATE) - return yaml_parser_parse_node(parser, event, true, true) - } - parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) - } - parser.state = yaml_PARSE_BLOCK_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -// Parse the productions: -// flow_sequence ::= FLOW-SEQUENCE-START -// ******************* -// (flow_sequence_entry FLOW-ENTRY)* -// * ********** -// flow_sequence_entry? -// * -// FLOW-SEQUENCE-END -// ***************** -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * -// -func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - if !first { - if token.typ == yaml_FLOW_ENTRY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } else { - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a flow sequence", context_mark, - "did not find expected ',' or ']'", token.start_mark) - } - } - - if token.typ == yaml_KEY_TOKEN { - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_START_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - implicit: true, - style: yaml_style_t(yaml_FLOW_MAPPING_STYLE), - } - skip_token(parser) - return true - } else if token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - - *event = yaml_event_t{ - typ: yaml_SEQUENCE_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - - skip_token(parser) - return true -} - -// -// Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// *** * -// -func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_FLOW_ENTRY_TOKEN && - token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - mark := token.end_mark - skip_token(parser) - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, mark) -} - -// Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// ***** * -// -func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - if token.typ == yaml_VALUE_TOKEN { - skip_token(parser) - token := peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_SEQUENCE_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -// Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * -// -func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool { - token := peek_token(parser) - if token == nil { - return false - } - parser.state = yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.start_mark, // [Go] Shouldn't this be end_mark? - } - return true -} - -// Parse the productions: -// flow_mapping ::= FLOW-MAPPING-START -// ****************** -// (flow_mapping_entry FLOW-ENTRY)* -// * ********** -// flow_mapping_entry? -// ****************** -// FLOW-MAPPING-END -// **************** -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * *** * -// -func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { - if first { - token := peek_token(parser) - parser.marks = append(parser.marks, token.start_mark) - skip_token(parser) - } - - token := peek_token(parser) - if token == nil { - return false - } - - if token.typ != yaml_FLOW_MAPPING_END_TOKEN { - if !first { - if token.typ == yaml_FLOW_ENTRY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } else { - context_mark := parser.marks[len(parser.marks)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - return yaml_parser_set_parser_error_context(parser, - "while parsing a flow mapping", context_mark, - "did not find expected ',' or '}'", token.start_mark) - } - } - - if token.typ == yaml_KEY_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_VALUE_TOKEN && - token.typ != yaml_FLOW_ENTRY_TOKEN && - token.typ != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } else { - parser.state = yaml_PARSE_FLOW_MAPPING_VALUE_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) - } - } else if token.typ != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - - parser.state = parser.states[len(parser.states)-1] - parser.states = parser.states[:len(parser.states)-1] - parser.marks = parser.marks[:len(parser.marks)-1] - *event = yaml_event_t{ - typ: yaml_MAPPING_END_EVENT, - start_mark: token.start_mark, - end_mark: token.end_mark, - } - skip_token(parser) - return true -} - -// Parse the productions: -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * ***** * -// -func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool { - token := peek_token(parser) - if token == nil { - return false - } - if empty { - parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) - } - if token.typ == yaml_VALUE_TOKEN { - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - if token.typ != yaml_FLOW_ENTRY_TOKEN && token.typ != yaml_FLOW_MAPPING_END_TOKEN { - parser.states = append(parser.states, yaml_PARSE_FLOW_MAPPING_KEY_STATE) - return yaml_parser_parse_node(parser, event, false, false) - } - } - parser.state = yaml_PARSE_FLOW_MAPPING_KEY_STATE - return yaml_parser_process_empty_scalar(parser, event, token.start_mark) -} - -// Generate an empty scalar event. -func yaml_parser_process_empty_scalar(parser *yaml_parser_t, event *yaml_event_t, mark yaml_mark_t) bool { - *event = yaml_event_t{ - typ: yaml_SCALAR_EVENT, - start_mark: mark, - end_mark: mark, - value: nil, // Empty - implicit: true, - style: yaml_style_t(yaml_PLAIN_SCALAR_STYLE), - } - return true -} - -var default_tag_directives = []yaml_tag_directive_t{ - {[]byte("!"), []byte("!")}, - {[]byte("!!"), []byte("tag:yaml.org,2002:")}, -} - -// Parse directives. -func yaml_parser_process_directives(parser *yaml_parser_t, - version_directive_ref **yaml_version_directive_t, - tag_directives_ref *[]yaml_tag_directive_t) bool { - - var version_directive *yaml_version_directive_t - var tag_directives []yaml_tag_directive_t - - token := peek_token(parser) - if token == nil { - return false - } - - for token.typ == yaml_VERSION_DIRECTIVE_TOKEN || token.typ == yaml_TAG_DIRECTIVE_TOKEN { - if token.typ == yaml_VERSION_DIRECTIVE_TOKEN { - if version_directive != nil { - yaml_parser_set_parser_error(parser, - "found duplicate %YAML directive", token.start_mark) - return false - } - if token.major != 1 || token.minor != 1 { - yaml_parser_set_parser_error(parser, - "found incompatible YAML document", token.start_mark) - return false - } - version_directive = &yaml_version_directive_t{ - major: token.major, - minor: token.minor, - } - } else if token.typ == yaml_TAG_DIRECTIVE_TOKEN { - value := yaml_tag_directive_t{ - handle: token.value, - prefix: token.prefix, - } - if !yaml_parser_append_tag_directive(parser, value, false, token.start_mark) { - return false - } - tag_directives = append(tag_directives, value) - } - - skip_token(parser) - token = peek_token(parser) - if token == nil { - return false - } - } - - for i := range default_tag_directives { - if !yaml_parser_append_tag_directive(parser, default_tag_directives[i], true, token.start_mark) { - return false - } - } - - if version_directive_ref != nil { - *version_directive_ref = version_directive - } - if tag_directives_ref != nil { - *tag_directives_ref = tag_directives - } - return true -} - -// Append a tag directive to the directives stack. -func yaml_parser_append_tag_directive(parser *yaml_parser_t, value yaml_tag_directive_t, allow_duplicates bool, mark yaml_mark_t) bool { - for i := range parser.tag_directives { - if bytes.Equal(value.handle, parser.tag_directives[i].handle) { - if allow_duplicates { - return true - } - return yaml_parser_set_parser_error(parser, "found duplicate %TAG directive", mark) - } - } - - // [Go] I suspect the copy is unnecessary. This was likely done - // because there was no way to track ownership of the data. - value_copy := yaml_tag_directive_t{ - handle: make([]byte, len(value.handle)), - prefix: make([]byte, len(value.prefix)), - } - copy(value_copy.handle, value.handle) - copy(value_copy.prefix, value.prefix) - parser.tag_directives = append(parser.tag_directives, value_copy) - return true -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/readerc.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/readerc.go deleted file mode 100644 index f4507917..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/readerc.go +++ /dev/null @@ -1,394 +0,0 @@ -package yaml - -import ( - "io" -) - -// Set the reader error and return 0. -func yaml_parser_set_reader_error(parser *yaml_parser_t, problem string, offset int, value int) bool { - parser.error = yaml_READER_ERROR - parser.problem = problem - parser.problem_offset = offset - parser.problem_value = value - return false -} - -// Byte order marks. -const ( - bom_UTF8 = "\xef\xbb\xbf" - bom_UTF16LE = "\xff\xfe" - bom_UTF16BE = "\xfe\xff" -) - -// Determine the input stream encoding by checking the BOM symbol. If no BOM is -// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure. -func yaml_parser_determine_encoding(parser *yaml_parser_t) bool { - // Ensure that we had enough bytes in the raw buffer. - for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 { - if !yaml_parser_update_raw_buffer(parser) { - return false - } - } - - // Determine the encoding. - buf := parser.raw_buffer - pos := parser.raw_buffer_pos - avail := len(buf) - pos - if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] { - parser.encoding = yaml_UTF16LE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] { - parser.encoding = yaml_UTF16BE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] { - parser.encoding = yaml_UTF8_ENCODING - parser.raw_buffer_pos += 3 - parser.offset += 3 - } else { - parser.encoding = yaml_UTF8_ENCODING - } - return true -} - -// Update the raw buffer. -func yaml_parser_update_raw_buffer(parser *yaml_parser_t) bool { - size_read := 0 - - // Return if the raw buffer is full. - if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) { - return true - } - - // Return on EOF. - if parser.eof { - return true - } - - // Move the remaining bytes in the raw buffer to the beginning. - if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) { - copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:]) - } - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos] - parser.raw_buffer_pos = 0 - - // Call the read handler to fill the buffer. - size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)]) - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read] - if err == io.EOF { - parser.eof = true - } else if err != nil { - return yaml_parser_set_reader_error(parser, "input error: "+err.Error(), parser.offset, -1) - } - return true -} - -// Ensure that the buffer contains at least `length` characters. -// Return true on success, false on failure. -// -// The length is supposed to be significantly less that the buffer size. -func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { - if parser.read_handler == nil { - panic("read handler must be set") - } - - // If the EOF flag is set and the raw buffer is empty, do nothing. - if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { - return true - } - - // Return if the buffer contains enough characters. - if parser.unread >= length { - return true - } - - // Determine the input encoding if it is not known yet. - if parser.encoding == yaml_ANY_ENCODING { - if !yaml_parser_determine_encoding(parser) { - return false - } - } - - // Move the unread characters to the beginning of the buffer. - buffer_len := len(parser.buffer) - if parser.buffer_pos > 0 && parser.buffer_pos < buffer_len { - copy(parser.buffer, parser.buffer[parser.buffer_pos:]) - buffer_len -= parser.buffer_pos - parser.buffer_pos = 0 - } else if parser.buffer_pos == buffer_len { - buffer_len = 0 - parser.buffer_pos = 0 - } - - // Open the whole buffer for writing, and cut it before returning. - parser.buffer = parser.buffer[:cap(parser.buffer)] - - // Fill the buffer until it has enough characters. - first := true - for parser.unread < length { - - // Fill the raw buffer if necessary. - if !first || parser.raw_buffer_pos == len(parser.raw_buffer) { - if !yaml_parser_update_raw_buffer(parser) { - parser.buffer = parser.buffer[:buffer_len] - return false - } - } - first = false - - // Decode the raw buffer. - inner: - for parser.raw_buffer_pos != len(parser.raw_buffer) { - var value rune - var width int - - raw_unread := len(parser.raw_buffer) - parser.raw_buffer_pos - - // Decode the next character. - switch parser.encoding { - case yaml_UTF8_ENCODING: - // Decode a UTF-8 character. Check RFC 3629 - // (http://www.ietf.org/rfc/rfc3629.txt) for more details. - // - // The following table (taken from the RFC) is used for - // decoding. - // - // Char. number range | UTF-8 octet sequence - // (hexadecimal) | (binary) - // --------------------+------------------------------------ - // 0000 0000-0000 007F | 0xxxxxxx - // 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - // 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - // 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - // - // Additionally, the characters in the range 0xD800-0xDFFF - // are prohibited as they are reserved for use with UTF-16 - // surrogate pairs. - - // Determine the length of the UTF-8 sequence. - octet := parser.raw_buffer[parser.raw_buffer_pos] - switch { - case octet&0x80 == 0x00: - width = 1 - case octet&0xE0 == 0xC0: - width = 2 - case octet&0xF0 == 0xE0: - width = 3 - case octet&0xF8 == 0xF0: - width = 4 - default: - // The leading octet is invalid. - return yaml_parser_set_reader_error(parser, - "invalid leading UTF-8 octet", - parser.offset, int(octet)) - } - - // Check if the raw buffer contains an incomplete character. - if width > raw_unread { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-8 octet sequence", - parser.offset, -1) - } - break inner - } - - // Decode the leading octet. - switch { - case octet&0x80 == 0x00: - value = rune(octet & 0x7F) - case octet&0xE0 == 0xC0: - value = rune(octet & 0x1F) - case octet&0xF0 == 0xE0: - value = rune(octet & 0x0F) - case octet&0xF8 == 0xF0: - value = rune(octet & 0x07) - default: - value = 0 - } - - // Check and decode the trailing octets. - for k := 1; k < width; k++ { - octet = parser.raw_buffer[parser.raw_buffer_pos+k] - - // Check if the octet is valid. - if (octet & 0xC0) != 0x80 { - return yaml_parser_set_reader_error(parser, - "invalid trailing UTF-8 octet", - parser.offset+k, int(octet)) - } - - // Decode the octet. - value = (value << 6) + rune(octet&0x3F) - } - - // Check the length of the sequence against the value. - switch { - case width == 1: - case width == 2 && value >= 0x80: - case width == 3 && value >= 0x800: - case width == 4 && value >= 0x10000: - default: - return yaml_parser_set_reader_error(parser, - "invalid length of a UTF-8 sequence", - parser.offset, -1) - } - - // Check the range of the value. - if value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF { - return yaml_parser_set_reader_error(parser, - "invalid Unicode character", - parser.offset, int(value)) - } - - case yaml_UTF16LE_ENCODING, yaml_UTF16BE_ENCODING: - var low, high int - if parser.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - low, high = 1, 0 - } - - // The UTF-16 encoding is not as simple as one might - // naively think. Check RFC 2781 - // (http://www.ietf.org/rfc/rfc2781.txt). - // - // Normally, two subsequent bytes describe a Unicode - // character. However a special technique (called a - // surrogate pair) is used for specifying character - // values larger than 0xFFFF. - // - // A surrogate pair consists of two pseudo-characters: - // high surrogate area (0xD800-0xDBFF) - // low surrogate area (0xDC00-0xDFFF) - // - // The following formulas are used for decoding - // and encoding characters using surrogate pairs: - // - // U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF) - // U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF) - // W1 = 110110yyyyyyyyyy - // W2 = 110111xxxxxxxxxx - // - // where U is the character value, W1 is the high surrogate - // area, W2 is the low surrogate area. - - // Check for incomplete UTF-16 character. - if raw_unread < 2 { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-16 character", - parser.offset, -1) - } - break inner - } - - // Get the character. - value = rune(parser.raw_buffer[parser.raw_buffer_pos+low]) + - (rune(parser.raw_buffer[parser.raw_buffer_pos+high]) << 8) - - // Check for unexpected low surrogate area. - if value&0xFC00 == 0xDC00 { - return yaml_parser_set_reader_error(parser, - "unexpected low surrogate area", - parser.offset, int(value)) - } - - // Check for a high surrogate area. - if value&0xFC00 == 0xD800 { - width = 4 - - // Check for incomplete surrogate pair. - if raw_unread < 4 { - if parser.eof { - return yaml_parser_set_reader_error(parser, - "incomplete UTF-16 surrogate pair", - parser.offset, -1) - } - break inner - } - - // Get the next character. - value2 := rune(parser.raw_buffer[parser.raw_buffer_pos+low+2]) + - (rune(parser.raw_buffer[parser.raw_buffer_pos+high+2]) << 8) - - // Check for a low surrogate area. - if value2&0xFC00 != 0xDC00 { - return yaml_parser_set_reader_error(parser, - "expected low surrogate area", - parser.offset+2, int(value2)) - } - - // Generate the value of the surrogate pair. - value = 0x10000 + ((value & 0x3FF) << 10) + (value2 & 0x3FF) - } else { - width = 2 - } - - default: - panic("impossible") - } - - // Check if the character is in the allowed range: - // #x9 | #xA | #xD | [#x20-#x7E] (8 bit) - // | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] (16 bit) - // | [#x10000-#x10FFFF] (32 bit) - switch { - case value == 0x09: - case value == 0x0A: - case value == 0x0D: - case value >= 0x20 && value <= 0x7E: - case value == 0x85: - case value >= 0xA0 && value <= 0xD7FF: - case value >= 0xE000 && value <= 0xFFFD: - case value >= 0x10000 && value <= 0x10FFFF: - default: - return yaml_parser_set_reader_error(parser, - "control characters are not allowed", - parser.offset, int(value)) - } - - // Move the raw pointers. - parser.raw_buffer_pos += width - parser.offset += width - - // Finally put the character into the buffer. - if value <= 0x7F { - // 0000 0000-0000 007F . 0xxxxxxx - parser.buffer[buffer_len+0] = byte(value) - buffer_len += 1 - } else if value <= 0x7FF { - // 0000 0080-0000 07FF . 110xxxxx 10xxxxxx - parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6)) - parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F)) - buffer_len += 2 - } else if value <= 0xFFFF { - // 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx - parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12)) - parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F)) - parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F)) - buffer_len += 3 - } else { - // 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18)) - parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F)) - parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F)) - parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F)) - buffer_len += 4 - } - - parser.unread++ - } - - // On EOF, put NUL into the buffer and return. - if parser.eof { - parser.buffer[buffer_len] = 0 - buffer_len++ - parser.unread++ - break - } - } - parser.buffer = parser.buffer[:buffer_len] - return true -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/resolve.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/resolve.go deleted file mode 100644 index 232313cc..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/resolve.go +++ /dev/null @@ -1,208 +0,0 @@ -package yaml - -import ( - "encoding/base64" - "math" - "regexp" - "strconv" - "strings" - "unicode/utf8" -) - -type resolveMapItem struct { - value interface{} - tag string -} - -var resolveTable = make([]byte, 256) -var resolveMap = make(map[string]resolveMapItem) - -func init() { - t := resolveTable - t[int('+')] = 'S' // Sign - t[int('-')] = 'S' - for _, c := range "0123456789" { - t[int(c)] = 'D' // Digit - } - for _, c := range "yYnNtTfFoO~" { - t[int(c)] = 'M' // In map - } - t[int('.')] = '.' // Float (potentially in map) - - var resolveMapList = []struct { - v interface{} - tag string - l []string - }{ - {true, yaml_BOOL_TAG, []string{"y", "Y", "yes", "Yes", "YES"}}, - {true, yaml_BOOL_TAG, []string{"true", "True", "TRUE"}}, - {true, yaml_BOOL_TAG, []string{"on", "On", "ON"}}, - {false, yaml_BOOL_TAG, []string{"n", "N", "no", "No", "NO"}}, - {false, yaml_BOOL_TAG, []string{"false", "False", "FALSE"}}, - {false, yaml_BOOL_TAG, []string{"off", "Off", "OFF"}}, - {nil, yaml_NULL_TAG, []string{"", "~", "null", "Null", "NULL"}}, - {math.NaN(), yaml_FLOAT_TAG, []string{".nan", ".NaN", ".NAN"}}, - {math.Inf(+1), yaml_FLOAT_TAG, []string{".inf", ".Inf", ".INF"}}, - {math.Inf(+1), yaml_FLOAT_TAG, []string{"+.inf", "+.Inf", "+.INF"}}, - {math.Inf(-1), yaml_FLOAT_TAG, []string{"-.inf", "-.Inf", "-.INF"}}, - {"<<", yaml_MERGE_TAG, []string{"<<"}}, - } - - m := resolveMap - for _, item := range resolveMapList { - for _, s := range item.l { - m[s] = resolveMapItem{item.v, item.tag} - } - } -} - -const longTagPrefix = "tag:yaml.org,2002:" - -func shortTag(tag string) string { - // TODO This can easily be made faster and produce less garbage. - if strings.HasPrefix(tag, longTagPrefix) { - return "!!" + tag[len(longTagPrefix):] - } - return tag -} - -func longTag(tag string) string { - if strings.HasPrefix(tag, "!!") { - return longTagPrefix + tag[2:] - } - return tag -} - -func resolvableTag(tag string) bool { - switch tag { - case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG: - return true - } - return false -} - -var yamlStyleFloat = regexp.MustCompile(`^[-+]?[0-9]*\.?[0-9]+([eE][-+][0-9]+)?$`) - -func resolve(tag string, in string) (rtag string, out interface{}) { - if !resolvableTag(tag) { - return tag, in - } - - defer func() { - switch tag { - case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG: - return - } - failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)) - }() - - // Any data is accepted as a !!str or !!binary. - // Otherwise, the prefix is enough of a hint about what it might be. - hint := byte('N') - if in != "" { - hint = resolveTable[in[0]] - } - if hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG { - // Handle things we can lookup in a map. - if item, ok := resolveMap[in]; ok { - return item.tag, item.value - } - - // Base 60 floats are a bad idea, were dropped in YAML 1.2, and - // are purposefully unsupported here. They're still quoted on - // the way out for compatibility with other parser, though. - - switch hint { - case 'M': - // We've already checked the map above. - - case '.': - // Not in the map, so maybe a normal float. - floatv, err := strconv.ParseFloat(in, 64) - if err == nil { - return yaml_FLOAT_TAG, floatv - } - - case 'D', 'S': - // Int, float, or timestamp. - plain := strings.Replace(in, "_", "", -1) - intv, err := strconv.ParseInt(plain, 0, 64) - if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, int(intv) - } else { - return yaml_INT_TAG, intv - } - } - uintv, err := strconv.ParseUint(plain, 0, 64) - if err == nil { - return yaml_INT_TAG, uintv - } - if yamlStyleFloat.MatchString(plain) { - floatv, err := strconv.ParseFloat(plain, 64) - if err == nil { - return yaml_FLOAT_TAG, floatv - } - } - if strings.HasPrefix(plain, "0b") { - intv, err := strconv.ParseInt(plain[2:], 2, 64) - if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, int(intv) - } else { - return yaml_INT_TAG, intv - } - } - uintv, err := strconv.ParseUint(plain[2:], 2, 64) - if err == nil { - return yaml_INT_TAG, uintv - } - } else if strings.HasPrefix(plain, "-0b") { - intv, err := strconv.ParseInt(plain[3:], 2, 64) - if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, -int(intv) - } else { - return yaml_INT_TAG, -intv - } - } - } - // XXX Handle timestamps here. - - default: - panic("resolveTable item not yet handled: " + string(rune(hint)) + " (with " + in + ")") - } - } - if tag == yaml_BINARY_TAG { - return yaml_BINARY_TAG, in - } - if utf8.ValidString(in) { - return yaml_STR_TAG, in - } - return yaml_BINARY_TAG, encodeBase64(in) -} - -// encodeBase64 encodes s as base64 that is broken up into multiple lines -// as appropriate for the resulting length. -func encodeBase64(s string) string { - const lineLen = 70 - encLen := base64.StdEncoding.EncodedLen(len(s)) - lines := encLen/lineLen + 1 - buf := make([]byte, encLen*2+lines) - in := buf[0:encLen] - out := buf[encLen:] - base64.StdEncoding.Encode(in, []byte(s)) - k := 0 - for i := 0; i < len(in); i += lineLen { - j := i + lineLen - if j > len(in) { - j = len(in) - } - k += copy(out[k:], in[i:j]) - if lines > 1 { - out[k] = '\n' - k++ - } - } - return string(out[:k]) -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/scannerc.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/scannerc.go deleted file mode 100644 index 07448445..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/scannerc.go +++ /dev/null @@ -1,2711 +0,0 @@ -package yaml - -import ( - "bytes" - "fmt" -) - -// Introduction -// ************ -// -// The following notes assume that you are familiar with the YAML specification -// (http://yaml.org/spec/1.2/spec.html). We mostly follow it, although in -// some cases we are less restrictive that it requires. -// -// The process of transforming a YAML stream into a sequence of events is -// divided on two steps: Scanning and Parsing. -// -// The Scanner transforms the input stream into a sequence of tokens, while the -// parser transform the sequence of tokens produced by the Scanner into a -// sequence of parsing events. -// -// The Scanner is rather clever and complicated. The Parser, on the contrary, -// is a straightforward implementation of a recursive-descendant parser (or, -// LL(1) parser, as it is usually called). -// -// Actually there are two issues of Scanning that might be called "clever", the -// rest is quite straightforward. The issues are "block collection start" and -// "simple keys". Both issues are explained below in details. -// -// Here the Scanning step is explained and implemented. We start with the list -// of all the tokens produced by the Scanner together with short descriptions. -// -// Now, tokens: -// -// STREAM-START(encoding) # The stream start. -// STREAM-END # The stream end. -// VERSION-DIRECTIVE(major,minor) # The '%YAML' directive. -// TAG-DIRECTIVE(handle,prefix) # The '%TAG' directive. -// DOCUMENT-START # '---' -// DOCUMENT-END # '...' -// BLOCK-SEQUENCE-START # Indentation increase denoting a block -// BLOCK-MAPPING-START # sequence or a block mapping. -// BLOCK-END # Indentation decrease. -// FLOW-SEQUENCE-START # '[' -// FLOW-SEQUENCE-END # ']' -// BLOCK-SEQUENCE-START # '{' -// BLOCK-SEQUENCE-END # '}' -// BLOCK-ENTRY # '-' -// FLOW-ENTRY # ',' -// KEY # '?' or nothing (simple keys). -// VALUE # ':' -// ALIAS(anchor) # '*anchor' -// ANCHOR(anchor) # '&anchor' -// TAG(handle,suffix) # '!handle!suffix' -// SCALAR(value,style) # A scalar. -// -// The following two tokens are "virtual" tokens denoting the beginning and the -// end of the stream: -// -// STREAM-START(encoding) -// STREAM-END -// -// We pass the information about the input stream encoding with the -// STREAM-START token. -// -// The next two tokens are responsible for tags: -// -// VERSION-DIRECTIVE(major,minor) -// TAG-DIRECTIVE(handle,prefix) -// -// Example: -// -// %YAML 1.1 -// %TAG ! !foo -// %TAG !yaml! tag:yaml.org,2002: -// --- -// -// The correspoding sequence of tokens: -// -// STREAM-START(utf-8) -// VERSION-DIRECTIVE(1,1) -// TAG-DIRECTIVE("!","!foo") -// TAG-DIRECTIVE("!yaml","tag:yaml.org,2002:") -// DOCUMENT-START -// STREAM-END -// -// Note that the VERSION-DIRECTIVE and TAG-DIRECTIVE tokens occupy a whole -// line. -// -// The document start and end indicators are represented by: -// -// DOCUMENT-START -// DOCUMENT-END -// -// Note that if a YAML stream contains an implicit document (without '---' -// and '...' indicators), no DOCUMENT-START and DOCUMENT-END tokens will be -// produced. -// -// In the following examples, we present whole documents together with the -// produced tokens. -// -// 1. An implicit document: -// -// 'a scalar' -// -// Tokens: -// -// STREAM-START(utf-8) -// SCALAR("a scalar",single-quoted) -// STREAM-END -// -// 2. An explicit document: -// -// --- -// 'a scalar' -// ... -// -// Tokens: -// -// STREAM-START(utf-8) -// DOCUMENT-START -// SCALAR("a scalar",single-quoted) -// DOCUMENT-END -// STREAM-END -// -// 3. Several documents in a stream: -// -// 'a scalar' -// --- -// 'another scalar' -// --- -// 'yet another scalar' -// -// Tokens: -// -// STREAM-START(utf-8) -// SCALAR("a scalar",single-quoted) -// DOCUMENT-START -// SCALAR("another scalar",single-quoted) -// DOCUMENT-START -// SCALAR("yet another scalar",single-quoted) -// STREAM-END -// -// We have already introduced the SCALAR token above. The following tokens are -// used to describe aliases, anchors, tag, and scalars: -// -// ALIAS(anchor) -// ANCHOR(anchor) -// TAG(handle,suffix) -// SCALAR(value,style) -// -// The following series of examples illustrate the usage of these tokens: -// -// 1. A recursive sequence: -// -// &A [ *A ] -// -// Tokens: -// -// STREAM-START(utf-8) -// ANCHOR("A") -// FLOW-SEQUENCE-START -// ALIAS("A") -// FLOW-SEQUENCE-END -// STREAM-END -// -// 2. A tagged scalar: -// -// !!float "3.14" # A good approximation. -// -// Tokens: -// -// STREAM-START(utf-8) -// TAG("!!","float") -// SCALAR("3.14",double-quoted) -// STREAM-END -// -// 3. Various scalar styles: -// -// --- # Implicit empty plain scalars do not produce tokens. -// --- a plain scalar -// --- 'a single-quoted scalar' -// --- "a double-quoted scalar" -// --- |- -// a literal scalar -// --- >- -// a folded -// scalar -// -// Tokens: -// -// STREAM-START(utf-8) -// DOCUMENT-START -// DOCUMENT-START -// SCALAR("a plain scalar",plain) -// DOCUMENT-START -// SCALAR("a single-quoted scalar",single-quoted) -// DOCUMENT-START -// SCALAR("a double-quoted scalar",double-quoted) -// DOCUMENT-START -// SCALAR("a literal scalar",literal) -// DOCUMENT-START -// SCALAR("a folded scalar",folded) -// STREAM-END -// -// Now it's time to review collection-related tokens. We will start with -// flow collections: -// -// FLOW-SEQUENCE-START -// FLOW-SEQUENCE-END -// FLOW-MAPPING-START -// FLOW-MAPPING-END -// FLOW-ENTRY -// KEY -// VALUE -// -// The tokens FLOW-SEQUENCE-START, FLOW-SEQUENCE-END, FLOW-MAPPING-START, and -// FLOW-MAPPING-END represent the indicators '[', ']', '{', and '}' -// correspondingly. FLOW-ENTRY represent the ',' indicator. Finally the -// indicators '?' and ':', which are used for denoting mapping keys and values, -// are represented by the KEY and VALUE tokens. -// -// The following examples show flow collections: -// -// 1. A flow sequence: -// -// [item 1, item 2, item 3] -// -// Tokens: -// -// STREAM-START(utf-8) -// FLOW-SEQUENCE-START -// SCALAR("item 1",plain) -// FLOW-ENTRY -// SCALAR("item 2",plain) -// FLOW-ENTRY -// SCALAR("item 3",plain) -// FLOW-SEQUENCE-END -// STREAM-END -// -// 2. A flow mapping: -// -// { -// a simple key: a value, # Note that the KEY token is produced. -// ? a complex key: another value, -// } -// -// Tokens: -// -// STREAM-START(utf-8) -// FLOW-MAPPING-START -// KEY -// SCALAR("a simple key",plain) -// VALUE -// SCALAR("a value",plain) -// FLOW-ENTRY -// KEY -// SCALAR("a complex key",plain) -// VALUE -// SCALAR("another value",plain) -// FLOW-ENTRY -// FLOW-MAPPING-END -// STREAM-END -// -// A simple key is a key which is not denoted by the '?' indicator. Note that -// the Scanner still produce the KEY token whenever it encounters a simple key. -// -// For scanning block collections, the following tokens are used (note that we -// repeat KEY and VALUE here): -// -// BLOCK-SEQUENCE-START -// BLOCK-MAPPING-START -// BLOCK-END -// BLOCK-ENTRY -// KEY -// VALUE -// -// The tokens BLOCK-SEQUENCE-START and BLOCK-MAPPING-START denote indentation -// increase that precedes a block collection (cf. the INDENT token in Python). -// The token BLOCK-END denote indentation decrease that ends a block collection -// (cf. the DEDENT token in Python). However YAML has some syntax pecularities -// that makes detections of these tokens more complex. -// -// The tokens BLOCK-ENTRY, KEY, and VALUE are used to represent the indicators -// '-', '?', and ':' correspondingly. -// -// The following examples show how the tokens BLOCK-SEQUENCE-START, -// BLOCK-MAPPING-START, and BLOCK-END are emitted by the Scanner: -// -// 1. Block sequences: -// -// - item 1 -// - item 2 -// - -// - item 3.1 -// - item 3.2 -// - -// key 1: value 1 -// key 2: value 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-ENTRY -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 3.1",plain) -// BLOCK-ENTRY -// SCALAR("item 3.2",plain) -// BLOCK-END -// BLOCK-ENTRY -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// 2. Block mappings: -// -// a simple key: a value # The KEY token is produced here. -// ? a complex key -// : another value -// a mapping: -// key 1: value 1 -// key 2: value 2 -// a sequence: -// - item 1 -// - item 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-MAPPING-START -// KEY -// SCALAR("a simple key",plain) -// VALUE -// SCALAR("a value",plain) -// KEY -// SCALAR("a complex key",plain) -// VALUE -// SCALAR("another value",plain) -// KEY -// SCALAR("a mapping",plain) -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// KEY -// SCALAR("a sequence",plain) -// VALUE -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// YAML does not always require to start a new block collection from a new -// line. If the current line contains only '-', '?', and ':' indicators, a new -// block collection may start at the current line. The following examples -// illustrate this case: -// -// 1. Collections in a sequence: -// -// - - item 1 -// - item 2 -// - key 1: value 1 -// key 2: value 2 -// - ? complex key -// : complex value -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// BLOCK-ENTRY -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// BLOCK-ENTRY -// BLOCK-MAPPING-START -// KEY -// SCALAR("complex key") -// VALUE -// SCALAR("complex value") -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// 2. Collections in a mapping: -// -// ? a sequence -// : - item 1 -// - item 2 -// ? a mapping -// : key 1: value 1 -// key 2: value 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-MAPPING-START -// KEY -// SCALAR("a sequence",plain) -// VALUE -// BLOCK-SEQUENCE-START -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// KEY -// SCALAR("a mapping",plain) -// VALUE -// BLOCK-MAPPING-START -// KEY -// SCALAR("key 1",plain) -// VALUE -// SCALAR("value 1",plain) -// KEY -// SCALAR("key 2",plain) -// VALUE -// SCALAR("value 2",plain) -// BLOCK-END -// BLOCK-END -// STREAM-END -// -// YAML also permits non-indented sequences if they are included into a block -// mapping. In this case, the token BLOCK-SEQUENCE-START is not produced: -// -// key: -// - item 1 # BLOCK-SEQUENCE-START is NOT produced here. -// - item 2 -// -// Tokens: -// -// STREAM-START(utf-8) -// BLOCK-MAPPING-START -// KEY -// SCALAR("key",plain) -// VALUE -// BLOCK-ENTRY -// SCALAR("item 1",plain) -// BLOCK-ENTRY -// SCALAR("item 2",plain) -// BLOCK-END -// - -// Ensure that the buffer contains the required number of characters. -// Return true on success, false on failure (reader error or memory error). -func cache(parser *yaml_parser_t, length int) bool { - // [Go] This was inlined: !cache(A, B) -> unread < B && !update(A, B) - return parser.unread >= length || yaml_parser_update_buffer(parser, length) -} - -// Advance the buffer pointer. -func skip(parser *yaml_parser_t) { - parser.mark.index++ - parser.mark.column++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) -} - -func skip_line(parser *yaml_parser_t) { - if is_crlf(parser.buffer, parser.buffer_pos) { - parser.mark.index += 2 - parser.mark.column = 0 - parser.mark.line++ - parser.unread -= 2 - parser.buffer_pos += 2 - } else if is_break(parser.buffer, parser.buffer_pos) { - parser.mark.index++ - parser.mark.column = 0 - parser.mark.line++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) - } -} - -// Copy a character to a string buffer and advance pointers. -func read(parser *yaml_parser_t, s []byte) []byte { - w := width(parser.buffer[parser.buffer_pos]) - if w == 0 { - panic("invalid character sequence") - } - if len(s) == 0 { - s = make([]byte, 0, 32) - } - if w == 1 && len(s)+w <= cap(s) { - s = s[:len(s)+1] - s[len(s)-1] = parser.buffer[parser.buffer_pos] - parser.buffer_pos++ - } else { - s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...) - parser.buffer_pos += w - } - parser.mark.index++ - parser.mark.column++ - parser.unread-- - return s -} - -// Copy a line break character to a string buffer and advance pointers. -func read_line(parser *yaml_parser_t, s []byte) []byte { - buf := parser.buffer - pos := parser.buffer_pos - switch { - case buf[pos] == '\r' && buf[pos+1] == '\n': - // CR LF . LF - s = append(s, '\n') - parser.buffer_pos += 2 - parser.mark.index++ - parser.unread-- - case buf[pos] == '\r' || buf[pos] == '\n': - // CR|LF . LF - s = append(s, '\n') - parser.buffer_pos += 1 - case buf[pos] == '\xC2' && buf[pos+1] == '\x85': - // NEL . LF - s = append(s, '\n') - parser.buffer_pos += 2 - case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'): - // LS|PS . LS|PS - s = append(s, buf[parser.buffer_pos:pos+3]...) - parser.buffer_pos += 3 - default: - return s - } - parser.mark.index++ - parser.mark.column = 0 - parser.mark.line++ - parser.unread-- - return s -} - -// Get the next token. -func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool { - // Erase the token object. - *token = yaml_token_t{} // [Go] Is this necessary? - - // No tokens after STREAM-END or error. - if parser.stream_end_produced || parser.error != yaml_NO_ERROR { - return true - } - - // Ensure that the tokens queue contains enough tokens. - if !parser.token_available { - if !yaml_parser_fetch_more_tokens(parser) { - return false - } - } - - // Fetch the next token from the queue. - *token = parser.tokens[parser.tokens_head] - parser.tokens_head++ - parser.tokens_parsed++ - parser.token_available = false - - if token.typ == yaml_STREAM_END_TOKEN { - parser.stream_end_produced = true - } - return true -} - -// Set the scanner error and return false. -func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool { - parser.error = yaml_SCANNER_ERROR - parser.context = context - parser.context_mark = context_mark - parser.problem = problem - parser.problem_mark = parser.mark - return false -} - -func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, context_mark yaml_mark_t, problem string) bool { - context := "while parsing a tag" - if directive { - context = "while parsing a %TAG directive" - } - return yaml_parser_set_scanner_error(parser, context, context_mark, problem) -} - -func trace(args ...interface{}) func() { - pargs := append([]interface{}{"+++"}, args...) - fmt.Println(pargs...) - pargs = append([]interface{}{"---"}, args...) - return func() { fmt.Println(pargs...) } -} - -// Ensure that the tokens queue contains at least one token which can be -// returned to the Parser. -func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool { - // While we need more tokens to fetch, do it. - for { - // Check if we really need to fetch more tokens. - need_more_tokens := false - - if parser.tokens_head == len(parser.tokens) { - // Queue is empty. - need_more_tokens = true - } else { - // Check if any potential simple key may occupy the head position. - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - for i := range parser.simple_keys { - simple_key := &parser.simple_keys[i] - if simple_key.possible && simple_key.token_number == parser.tokens_parsed { - need_more_tokens = true - break - } - } - } - - // We are finished. - if !need_more_tokens { - break - } - // Fetch the next token. - if !yaml_parser_fetch_next_token(parser) { - return false - } - } - - parser.token_available = true - return true -} - -// The dispatcher for token fetchers. -func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool { - // Ensure that the buffer is initialized. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - // Check if we just started scanning. Fetch STREAM-START then. - if !parser.stream_start_produced { - return yaml_parser_fetch_stream_start(parser) - } - - // Eat whitespaces and comments until we reach the next token. - if !yaml_parser_scan_to_next_token(parser) { - return false - } - - // Remove obsolete potential simple keys. - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - // Check the indentation level against the current column. - if !yaml_parser_unroll_indent(parser, parser.mark.column) { - return false - } - - // Ensure that the buffer contains at least 4 characters. 4 is the length - // of the longest indicators ('--- ' and '... '). - if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { - return false - } - - // Is it the end of the stream? - if is_z(parser.buffer, parser.buffer_pos) { - return yaml_parser_fetch_stream_end(parser) - } - - // Is it a directive? - if parser.mark.column == 0 && parser.buffer[parser.buffer_pos] == '%' { - return yaml_parser_fetch_directive(parser) - } - - buf := parser.buffer - pos := parser.buffer_pos - - // Is it the document start indicator? - if parser.mark.column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && is_blankz(buf, pos+3) { - return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_START_TOKEN) - } - - // Is it the document end indicator? - if parser.mark.column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && is_blankz(buf, pos+3) { - return yaml_parser_fetch_document_indicator(parser, yaml_DOCUMENT_END_TOKEN) - } - - // Is it the flow sequence start indicator? - if buf[pos] == '[' { - return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_SEQUENCE_START_TOKEN) - } - - // Is it the flow mapping start indicator? - if parser.buffer[parser.buffer_pos] == '{' { - return yaml_parser_fetch_flow_collection_start(parser, yaml_FLOW_MAPPING_START_TOKEN) - } - - // Is it the flow sequence end indicator? - if parser.buffer[parser.buffer_pos] == ']' { - return yaml_parser_fetch_flow_collection_end(parser, - yaml_FLOW_SEQUENCE_END_TOKEN) - } - - // Is it the flow mapping end indicator? - if parser.buffer[parser.buffer_pos] == '}' { - return yaml_parser_fetch_flow_collection_end(parser, - yaml_FLOW_MAPPING_END_TOKEN) - } - - // Is it the flow entry indicator? - if parser.buffer[parser.buffer_pos] == ',' { - return yaml_parser_fetch_flow_entry(parser) - } - - // Is it the block entry indicator? - if parser.buffer[parser.buffer_pos] == '-' && is_blankz(parser.buffer, parser.buffer_pos+1) { - return yaml_parser_fetch_block_entry(parser) - } - - // Is it the key indicator? - if parser.buffer[parser.buffer_pos] == '?' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) { - return yaml_parser_fetch_key(parser) - } - - // Is it the value indicator? - if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 || is_blankz(parser.buffer, parser.buffer_pos+1)) { - return yaml_parser_fetch_value(parser) - } - - // Is it an alias? - if parser.buffer[parser.buffer_pos] == '*' { - return yaml_parser_fetch_anchor(parser, yaml_ALIAS_TOKEN) - } - - // Is it an anchor? - if parser.buffer[parser.buffer_pos] == '&' { - return yaml_parser_fetch_anchor(parser, yaml_ANCHOR_TOKEN) - } - - // Is it a tag? - if parser.buffer[parser.buffer_pos] == '!' { - return yaml_parser_fetch_tag(parser) - } - - // Is it a literal scalar? - if parser.buffer[parser.buffer_pos] == '|' && parser.flow_level == 0 { - return yaml_parser_fetch_block_scalar(parser, true) - } - - // Is it a folded scalar? - if parser.buffer[parser.buffer_pos] == '>' && parser.flow_level == 0 { - return yaml_parser_fetch_block_scalar(parser, false) - } - - // Is it a single-quoted scalar? - if parser.buffer[parser.buffer_pos] == '\'' { - return yaml_parser_fetch_flow_scalar(parser, true) - } - - // Is it a double-quoted scalar? - if parser.buffer[parser.buffer_pos] == '"' { - return yaml_parser_fetch_flow_scalar(parser, false) - } - - // Is it a plain scalar? - // - // A plain scalar may start with any non-blank characters except - // - // '-', '?', ':', ',', '[', ']', '{', '}', - // '#', '&', '*', '!', '|', '>', '\'', '\"', - // '%', '@', '`'. - // - // In the block context (and, for the '-' indicator, in the flow context - // too), it may also start with the characters - // - // '-', '?', ':' - // - // if it is followed by a non-space character. - // - // The last rule is more restrictive than the specification requires. - // [Go] Make this logic more reasonable. - //switch parser.buffer[parser.buffer_pos] { - //case '-', '?', ':', ',', '?', '-', ',', ':', ']', '[', '}', '{', '&', '#', '!', '*', '>', '|', '"', '\'', '@', '%', '-', '`': - //} - if !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '-' || - parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':' || - parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '[' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || - parser.buffer[parser.buffer_pos] == '}' || parser.buffer[parser.buffer_pos] == '#' || - parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '*' || - parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '|' || - parser.buffer[parser.buffer_pos] == '>' || parser.buffer[parser.buffer_pos] == '\'' || - parser.buffer[parser.buffer_pos] == '"' || parser.buffer[parser.buffer_pos] == '%' || - parser.buffer[parser.buffer_pos] == '@' || parser.buffer[parser.buffer_pos] == '`') || - (parser.buffer[parser.buffer_pos] == '-' && !is_blank(parser.buffer, parser.buffer_pos+1)) || - (parser.flow_level == 0 && - (parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == ':') && - !is_blankz(parser.buffer, parser.buffer_pos+1)) { - return yaml_parser_fetch_plain_scalar(parser) - } - - // If we don't determine the token type so far, it is an error. - return yaml_parser_set_scanner_error(parser, - "while scanning for the next token", parser.mark, - "found character that cannot start any token") -} - -// Check the list of potential simple keys and remove the positions that -// cannot contain simple keys anymore. -func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool { - // Check for a potential simple key for each flow level. - for i := range parser.simple_keys { - simple_key := &parser.simple_keys[i] - - // The specification requires that a simple key - // - // - is limited to a single line, - // - is shorter than 1024 characters. - if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) { - - // Check if the potential simple key to be removed is required. - if simple_key.required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", simple_key.mark, - "could not find expected ':'") - } - simple_key.possible = false - } - } - return true -} - -// Check if a simple key may start at the current position and add it if -// needed. -func yaml_parser_save_simple_key(parser *yaml_parser_t) bool { - // A simple key is required at the current position if the scanner is in - // the block context and the current column coincides with the indentation - // level. - - required := parser.flow_level == 0 && parser.indent == parser.mark.column - - // A simple key is required only when it is the first token in the current - // line. Therefore it is always allowed. But we add a check anyway. - if required && !parser.simple_key_allowed { - panic("should not happen") - } - - // - // If the current position may start a simple key, save it. - // - if parser.simple_key_allowed { - simple_key := yaml_simple_key_t{ - possible: true, - required: required, - token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), - } - simple_key.mark = parser.mark - - if !yaml_parser_remove_simple_key(parser) { - return false - } - parser.simple_keys[len(parser.simple_keys)-1] = simple_key - } - return true -} - -// Remove a potential simple key at the current flow level. -func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool { - i := len(parser.simple_keys) - 1 - if parser.simple_keys[i].possible { - // If the key is required, it is an error. - if parser.simple_keys[i].required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", parser.simple_keys[i].mark, - "could not find expected ':'") - } - } - // Remove the key from the stack. - parser.simple_keys[i].possible = false - return true -} - -// Increase the flow level and resize the simple key list if needed. -func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool { - // Reset the simple key on the next level. - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) - - // Increase the flow level. - parser.flow_level++ - return true -} - -// Decrease the flow level. -func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool { - if parser.flow_level > 0 { - parser.flow_level-- - parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1] - } - return true -} - -// Push the current indentation level to the stack and set the new level -// the current column is greater than the indentation level. In this case, -// append or insert the specified token into the token queue. -func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool { - // In the flow context, do nothing. - if parser.flow_level > 0 { - return true - } - - if parser.indent < column { - // Push the current indentation level to the stack and set the new - // indentation level. - parser.indents = append(parser.indents, parser.indent) - parser.indent = column - - // Create a token and insert it into the queue. - token := yaml_token_t{ - typ: typ, - start_mark: mark, - end_mark: mark, - } - if number > -1 { - number -= parser.tokens_parsed - } - yaml_insert_token(parser, number, &token) - } - return true -} - -// Pop indentation levels from the indents stack until the current level -// becomes less or equal to the column. For each indentation level, append -// the BLOCK-END token. -func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { - // In the flow context, do nothing. - if parser.flow_level > 0 { - return true - } - - // Loop through the indentation levels in the stack. - for parser.indent > column { - // Create a token and append it to the queue. - token := yaml_token_t{ - typ: yaml_BLOCK_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - yaml_insert_token(parser, -1, &token) - - // Pop the indentation level. - parser.indent = parser.indents[len(parser.indents)-1] - parser.indents = parser.indents[:len(parser.indents)-1] - } - return true -} - -// Initialize the scanner and produce the STREAM-START token. -func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool { - - // Set the initial indentation. - parser.indent = -1 - - // Initialize the simple key stack. - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) - - // A simple key is allowed at the beginning of the stream. - parser.simple_key_allowed = true - - // We have started. - parser.stream_start_produced = true - - // Create the STREAM-START token and append it to the queue. - token := yaml_token_t{ - typ: yaml_STREAM_START_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - encoding: parser.encoding, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the STREAM-END token and shut down the scanner. -func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool { - - // Force new line. - if parser.mark.column != 0 { - parser.mark.column = 0 - parser.mark.line++ - } - - // Reset the indentation level. - if !yaml_parser_unroll_indent(parser, -1) { - return false - } - - // Reset simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - // Create the STREAM-END token and append it to the queue. - token := yaml_token_t{ - typ: yaml_STREAM_END_TOKEN, - start_mark: parser.mark, - end_mark: parser.mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token. -func yaml_parser_fetch_directive(parser *yaml_parser_t) bool { - // Reset the indentation level. - if !yaml_parser_unroll_indent(parser, -1) { - return false - } - - // Reset simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - // Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. - token := yaml_token_t{} - if !yaml_parser_scan_directive(parser, &token) { - return false - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the DOCUMENT-START or DOCUMENT-END token. -func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // Reset the indentation level. - if !yaml_parser_unroll_indent(parser, -1) { - return false - } - - // Reset simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - parser.simple_key_allowed = false - - // Consume the token. - start_mark := parser.mark - - skip(parser) - skip(parser) - skip(parser) - - end_mark := parser.mark - - // Create the DOCUMENT-START or DOCUMENT-END token. - token := yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. -func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // The indicators '[' and '{' may start a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // Increase the flow level. - if !yaml_parser_increase_flow_level(parser) { - return false - } - - // A simple key may follow the indicators '[' and '{'. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. - token := yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. -func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // Reset any potential simple key on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Decrease the flow level. - if !yaml_parser_decrease_flow_level(parser) { - return false - } - - // No simple keys after the indicators ']' and '}'. - parser.simple_key_allowed = false - - // Consume the token. - - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. - token := yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - } - // Append the token to the queue. - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the FLOW-ENTRY token. -func yaml_parser_fetch_flow_entry(parser *yaml_parser_t) bool { - // Reset any potential simple keys on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Simple keys are allowed after ','. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the FLOW-ENTRY token and append it to the queue. - token := yaml_token_t{ - typ: yaml_FLOW_ENTRY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the BLOCK-ENTRY token. -func yaml_parser_fetch_block_entry(parser *yaml_parser_t) bool { - // Check if the scanner is in the block context. - if parser.flow_level == 0 { - // Check if we are allowed to start a new entry. - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "block sequence entries are not allowed in this context") - } - // Add the BLOCK-SEQUENCE-START token if needed. - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_SEQUENCE_START_TOKEN, parser.mark) { - return false - } - } else { - // It is an error for the '-' indicator to occur in the flow context, - // but we let the Parser detect and report about it because the Parser - // is able to point to the context. - } - - // Reset any potential simple keys on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Simple keys are allowed after '-'. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the BLOCK-ENTRY token and append it to the queue. - token := yaml_token_t{ - typ: yaml_BLOCK_ENTRY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the KEY token. -func yaml_parser_fetch_key(parser *yaml_parser_t) bool { - - // In the block context, additional checks are required. - if parser.flow_level == 0 { - // Check if we are allowed to start a new key (not nessesary simple). - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "mapping keys are not allowed in this context") - } - // Add the BLOCK-MAPPING-START token if needed. - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { - return false - } - } - - // Reset any potential simple keys on the current flow level. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // Simple keys are allowed after '?' in the block context. - parser.simple_key_allowed = parser.flow_level == 0 - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the KEY token and append it to the queue. - token := yaml_token_t{ - typ: yaml_KEY_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the VALUE token. -func yaml_parser_fetch_value(parser *yaml_parser_t) bool { - - simple_key := &parser.simple_keys[len(parser.simple_keys)-1] - - // Have we found a simple key? - if simple_key.possible { - // Create the KEY token and insert it into the queue. - token := yaml_token_t{ - typ: yaml_KEY_TOKEN, - start_mark: simple_key.mark, - end_mark: simple_key.mark, - } - yaml_insert_token(parser, simple_key.token_number-parser.tokens_parsed, &token) - - // In the block context, we may need to add the BLOCK-MAPPING-START token. - if !yaml_parser_roll_indent(parser, simple_key.mark.column, - simple_key.token_number, - yaml_BLOCK_MAPPING_START_TOKEN, simple_key.mark) { - return false - } - - // Remove the simple key. - simple_key.possible = false - - // A simple key cannot follow another simple key. - parser.simple_key_allowed = false - - } else { - // The ':' indicator follows a complex key. - - // In the block context, extra checks are required. - if parser.flow_level == 0 { - - // Check if we are allowed to start a complex value. - if !parser.simple_key_allowed { - return yaml_parser_set_scanner_error(parser, "", parser.mark, - "mapping values are not allowed in this context") - } - - // Add the BLOCK-MAPPING-START token if needed. - if !yaml_parser_roll_indent(parser, parser.mark.column, -1, yaml_BLOCK_MAPPING_START_TOKEN, parser.mark) { - return false - } - } - - // Simple keys after ':' are allowed in the block context. - parser.simple_key_allowed = parser.flow_level == 0 - } - - // Consume the token. - start_mark := parser.mark - skip(parser) - end_mark := parser.mark - - // Create the VALUE token and append it to the queue. - token := yaml_token_t{ - typ: yaml_VALUE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the ALIAS or ANCHOR token. -func yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool { - // An anchor or an alias could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow an anchor or an alias. - parser.simple_key_allowed = false - - // Create the ALIAS or ANCHOR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_anchor(parser, &token, typ) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the TAG token. -func yaml_parser_fetch_tag(parser *yaml_parser_t) bool { - // A tag could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow a tag. - parser.simple_key_allowed = false - - // Create the TAG token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_tag(parser, &token) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. -func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool { - // Remove any potential simple keys. - if !yaml_parser_remove_simple_key(parser) { - return false - } - - // A simple key may follow a block scalar. - parser.simple_key_allowed = true - - // Create the SCALAR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_block_scalar(parser, &token, literal) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. -func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool { - // A plain scalar could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow a flow scalar. - parser.simple_key_allowed = false - - // Create the SCALAR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_flow_scalar(parser, &token, single) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Produce the SCALAR(...,plain) token. -func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool { - // A plain scalar could be a simple key. - if !yaml_parser_save_simple_key(parser) { - return false - } - - // A simple key cannot follow a flow scalar. - parser.simple_key_allowed = false - - // Create the SCALAR token and append it to the queue. - var token yaml_token_t - if !yaml_parser_scan_plain_scalar(parser, &token) { - return false - } - yaml_insert_token(parser, -1, &token) - return true -} - -// Eat whitespaces and comments until the next token is found. -func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { - - // Until the next token is not found. - for { - // Allow the BOM mark to start a line. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if parser.mark.column == 0 && is_bom(parser.buffer, parser.buffer_pos) { - skip(parser) - } - - // Eat whitespaces. - // Tabs are allowed: - // - in the flow context - // - in the block context, but not at the beginning of the line or - // after '-', '?', or ':' (complex value). - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Eat a comment until a line break. - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - } - - // If it is a line break, eat it. - if is_break(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - skip_line(parser) - - // In the block context, a new line may start a simple key. - if parser.flow_level == 0 { - parser.simple_key_allowed = true - } - } else { - break // We have found a token. - } - } - - return true -} - -// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// -func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool { - // Eat '%'. - start_mark := parser.mark - skip(parser) - - // Scan the directive name. - var name []byte - if !yaml_parser_scan_directive_name(parser, start_mark, &name) { - return false - } - - // Is it a YAML directive? - if bytes.Equal(name, []byte("YAML")) { - // Scan the VERSION directive value. - var major, minor int8 - if !yaml_parser_scan_version_directive_value(parser, start_mark, &major, &minor) { - return false - } - end_mark := parser.mark - - // Create a VERSION-DIRECTIVE token. - *token = yaml_token_t{ - typ: yaml_VERSION_DIRECTIVE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - major: major, - minor: minor, - } - - // Is it a TAG directive? - } else if bytes.Equal(name, []byte("TAG")) { - // Scan the TAG directive value. - var handle, prefix []byte - if !yaml_parser_scan_tag_directive_value(parser, start_mark, &handle, &prefix) { - return false - } - end_mark := parser.mark - - // Create a TAG-DIRECTIVE token. - *token = yaml_token_t{ - typ: yaml_TAG_DIRECTIVE_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: handle, - prefix: prefix, - } - - // Unknown directive. - } else { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found unknown directive name") - return false - } - - // Eat the rest of the line including any comments. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - } - - // Check if we are at the end of the line. - if !is_breakz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "did not find expected comment or line break") - return false - } - - // Eat a line break. - if is_break(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - skip_line(parser) - } - - return true -} - -// Scan the directive name. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^ -// -func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool { - // Consume the directive name. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - var s []byte - for is_alpha(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check if the name is empty. - if len(s) == 0 { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "could not find expected directive name") - return false - } - - // Check for an blank character after the name. - if !is_blankz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found unexpected non-alphabetical character") - return false - } - *name = s - return true -} - -// Scan the value of VERSION-DIRECTIVE. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^ -func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool { - // Eat whitespaces. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Consume the major version number. - if !yaml_parser_scan_version_directive_number(parser, start_mark, major) { - return false - } - - // Eat '.'. - if parser.buffer[parser.buffer_pos] != '.' { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "did not find expected digit or '.' character") - } - - skip(parser) - - // Consume the minor version number. - if !yaml_parser_scan_version_directive_number(parser, start_mark, minor) { - return false - } - return true -} - -const max_number_length = 2 - -// Scan the version number of VERSION-DIRECTIVE. -// -// Scope: -// %YAML 1.1 # a comment \n -// ^ -// %YAML 1.1 # a comment \n -// ^ -func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool { - - // Repeat while the next character is digit. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - var value, length int8 - for is_digit(parser.buffer, parser.buffer_pos) { - // Check if the number is too long. - length++ - if length > max_number_length { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "found extremely long version number") - } - value = value*10 + int8(as_digit(parser.buffer, parser.buffer_pos)) - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check if the number was present. - if length == 0 { - return yaml_parser_set_scanner_error(parser, "while scanning a %YAML directive", - start_mark, "did not find expected version number") - } - *number = value - return true -} - -// Scan the value of a TAG-DIRECTIVE token. -// -// Scope: -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// -func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool { - var handle_value, prefix_value []byte - - // Eat whitespaces. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Scan a handle. - if !yaml_parser_scan_tag_handle(parser, true, start_mark, &handle_value) { - return false - } - - // Expect a whitespace. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if !is_blank(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", - start_mark, "did not find expected whitespace") - return false - } - - // Eat whitespaces. - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Scan a prefix. - if !yaml_parser_scan_tag_uri(parser, true, nil, start_mark, &prefix_value) { - return false - } - - // Expect a whitespace or line break. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if !is_blankz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a %TAG directive", - start_mark, "did not find expected whitespace or line break") - return false - } - - *handle = handle_value - *prefix = prefix_value - return true -} - -func yaml_parser_scan_anchor(parser *yaml_parser_t, token *yaml_token_t, typ yaml_token_type_t) bool { - var s []byte - - // Eat the indicator character. - start_mark := parser.mark - skip(parser) - - // Consume the value. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_alpha(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - end_mark := parser.mark - - /* - * Check if length of the anchor is greater than 0 and it is followed by - * a whitespace character or one of the indicators: - * - * '?', ':', ',', ']', '}', '%', '@', '`'. - */ - - if len(s) == 0 || - !(is_blankz(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' || - parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' || - parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' || - parser.buffer[parser.buffer_pos] == '`') { - context := "while scanning an alias" - if typ == yaml_ANCHOR_TOKEN { - context = "while scanning an anchor" - } - yaml_parser_set_scanner_error(parser, context, start_mark, - "did not find expected alphabetic or numeric character") - return false - } - - // Create a token. - *token = yaml_token_t{ - typ: typ, - start_mark: start_mark, - end_mark: end_mark, - value: s, - } - - return true -} - -/* - * Scan a TAG token. - */ - -func yaml_parser_scan_tag(parser *yaml_parser_t, token *yaml_token_t) bool { - var handle, suffix []byte - - start_mark := parser.mark - - // Check if the tag is in the canonical form. - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - if parser.buffer[parser.buffer_pos+1] == '<' { - // Keep the handle as '' - - // Eat '!<' - skip(parser) - skip(parser) - - // Consume the tag value. - if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { - return false - } - - // Check for '>' and eat it. - if parser.buffer[parser.buffer_pos] != '>' { - yaml_parser_set_scanner_error(parser, "while scanning a tag", - start_mark, "did not find the expected '>'") - return false - } - - skip(parser) - } else { - // The tag has either the '!suffix' or the '!handle!suffix' form. - - // First, try to scan a handle. - if !yaml_parser_scan_tag_handle(parser, false, start_mark, &handle) { - return false - } - - // Check if it is, indeed, handle. - if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' { - // Scan the suffix now. - if !yaml_parser_scan_tag_uri(parser, false, nil, start_mark, &suffix) { - return false - } - } else { - // It wasn't a handle after all. Scan the rest of the tag. - if !yaml_parser_scan_tag_uri(parser, false, handle, start_mark, &suffix) { - return false - } - - // Set the handle to '!'. - handle = []byte{'!'} - - // A special case: the '!' tag. Set the handle to '' and the - // suffix to '!'. - if len(suffix) == 0 { - handle, suffix = suffix, handle - } - } - } - - // Check the character which ends the tag. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if !is_blankz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a tag", - start_mark, "did not find expected whitespace or line break") - return false - } - - end_mark := parser.mark - - // Create a token. - *token = yaml_token_t{ - typ: yaml_TAG_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: handle, - suffix: suffix, - } - return true -} - -// Scan a tag handle. -func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, handle *[]byte) bool { - // Check the initial '!' character. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if parser.buffer[parser.buffer_pos] != '!' { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected '!'") - return false - } - - var s []byte - - // Copy the '!' character. - s = read(parser, s) - - // Copy all subsequent alphabetical and numerical characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_alpha(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check if the trailing character is '!' and copy it. - if parser.buffer[parser.buffer_pos] == '!' { - s = read(parser, s) - } else { - // It's either the '!' tag or not really a tag handle. If it's a %TAG - // directive, it's an error. If it's a tag token, it must be a part of URI. - if directive && string(s) != "!" { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected '!'") - return false - } - } - - *handle = s - return true -} - -// Scan a tag. -func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool { - //size_t length = head ? strlen((char *)head) : 0 - var s []byte - hasTag := len(head) > 0 - - // Copy the head if needed. - // - // Note that we don't copy the leading '!' character. - if len(head) > 1 { - s = append(s, head[1:]...) - } - - // Scan the tag. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - // The set of characters that may appear in URI is as follows: - // - // '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', - // '=', '+', '$', ',', '.', '!', '~', '*', '\'', '(', ')', '[', ']', - // '%'. - // [Go] Convert this into more reasonable logic. - for is_alpha(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == ';' || - parser.buffer[parser.buffer_pos] == '/' || parser.buffer[parser.buffer_pos] == '?' || - parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == '@' || - parser.buffer[parser.buffer_pos] == '&' || parser.buffer[parser.buffer_pos] == '=' || - parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '$' || - parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '.' || - parser.buffer[parser.buffer_pos] == '!' || parser.buffer[parser.buffer_pos] == '~' || - parser.buffer[parser.buffer_pos] == '*' || parser.buffer[parser.buffer_pos] == '\'' || - parser.buffer[parser.buffer_pos] == '(' || parser.buffer[parser.buffer_pos] == ')' || - parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' || - parser.buffer[parser.buffer_pos] == '%' { - // Check if it is a URI-escape sequence. - if parser.buffer[parser.buffer_pos] == '%' { - if !yaml_parser_scan_uri_escapes(parser, directive, start_mark, &s) { - return false - } - } else { - s = read(parser, s) - } - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - hasTag = true - } - - if !hasTag { - yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find expected tag URI") - return false - } - *uri = s - return true -} - -// Decode an URI-escape sequence corresponding to a single UTF-8 character. -func yaml_parser_scan_uri_escapes(parser *yaml_parser_t, directive bool, start_mark yaml_mark_t, s *[]byte) bool { - - // Decode the required number of characters. - w := 1024 - for w > 0 { - // Check for a URI-escaped octet. - if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { - return false - } - - if !(parser.buffer[parser.buffer_pos] == '%' && - is_hex(parser.buffer, parser.buffer_pos+1) && - is_hex(parser.buffer, parser.buffer_pos+2)) { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "did not find URI escaped octet") - } - - // Get the octet. - octet := byte((as_hex(parser.buffer, parser.buffer_pos+1) << 4) + as_hex(parser.buffer, parser.buffer_pos+2)) - - // If it is the leading octet, determine the length of the UTF-8 sequence. - if w == 1024 { - w = width(octet) - if w == 0 { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "found an incorrect leading UTF-8 octet") - } - } else { - // Check if the trailing octet is correct. - if octet&0xC0 != 0x80 { - return yaml_parser_set_scanner_tag_error(parser, directive, - start_mark, "found an incorrect trailing UTF-8 octet") - } - } - - // Copy the octet and move the pointers. - *s = append(*s, octet) - skip(parser) - skip(parser) - skip(parser) - w-- - } - return true -} - -// Scan a block scalar. -func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, literal bool) bool { - // Eat the indicator '|' or '>'. - start_mark := parser.mark - skip(parser) - - // Scan the additional block scalar indicators. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - // Check for a chomping indicator. - var chomping, increment int - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - // Set the chomping method and eat the indicator. - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - skip(parser) - - // Check for an indentation indicator. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if is_digit(parser.buffer, parser.buffer_pos) { - // Check that the indentation is greater than 0. - if parser.buffer[parser.buffer_pos] == '0' { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an indentation indicator equal to 0") - return false - } - - // Get the indentation level and eat the indicator. - increment = as_digit(parser.buffer, parser.buffer_pos) - skip(parser) - } - - } else if is_digit(parser.buffer, parser.buffer_pos) { - // Do the same as above, but in the opposite order. - - if parser.buffer[parser.buffer_pos] == '0' { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an indentation indicator equal to 0") - return false - } - increment = as_digit(parser.buffer, parser.buffer_pos) - skip(parser) - - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - skip(parser) - } - } - - // Eat whitespaces and comments to the end of the line. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_blank(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - if parser.buffer[parser.buffer_pos] == '#' { - for !is_breakz(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - } - - // Check if we are at the end of the line. - if !is_breakz(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "did not find expected comment or line break") - return false - } - - // Eat a line break. - if is_break(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - skip_line(parser) - } - - end_mark := parser.mark - - // Set the indentation level if it was specified. - var indent int - if increment > 0 { - if parser.indent >= 0 { - indent = parser.indent + increment - } else { - indent = increment - } - } - - // Scan the leading line breaks and determine the indentation level if needed. - var s, leading_break, trailing_breaks []byte - if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { - return false - } - - // Scan the block scalar content. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - var leading_blank, trailing_blank bool - for parser.mark.column == indent && !is_z(parser.buffer, parser.buffer_pos) { - // We are at the beginning of a non-empty line. - - // Is it a trailing whitespace? - trailing_blank = is_blank(parser.buffer, parser.buffer_pos) - - // Check if we need to fold the leading line break. - if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' { - // Do we need to join the lines by space? - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } - } else { - s = append(s, leading_break...) - } - leading_break = leading_break[:0] - - // Append the remaining line breaks. - s = append(s, trailing_breaks...) - trailing_breaks = trailing_breaks[:0] - - // Is it a leading whitespace? - leading_blank = is_blank(parser.buffer, parser.buffer_pos) - - // Consume the current line. - for !is_breakz(parser.buffer, parser.buffer_pos) { - s = read(parser, s) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Consume the line break. - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - leading_break = read_line(parser, leading_break) - - // Eat the following indentation spaces and line breaks. - if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { - return false - } - } - - // Chomp the tail. - if chomping != -1 { - s = append(s, leading_break...) - } - if chomping == 1 { - s = append(s, trailing_breaks...) - } - - // Create a token. - *token = yaml_token_t{ - typ: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_LITERAL_SCALAR_STYLE, - } - if !literal { - token.style = yaml_FOLDED_SCALAR_STYLE - } - return true -} - -// Scan indentation spaces and line breaks for a block scalar. Determine the -// indentation level if needed. -func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool { - *end_mark = parser.mark - - // Eat the indentation spaces and line breaks. - max_indent := 0 - for { - // Eat the indentation spaces. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for (*indent == 0 || parser.mark.column < *indent) && is_space(parser.buffer, parser.buffer_pos) { - skip(parser) - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - if parser.mark.column > max_indent { - max_indent = parser.mark.column - } - - // Check for a tab character messing the indentation. - if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) { - return yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found a tab character where an indentation space is expected") - } - - // Have we found a non-empty line? - if !is_break(parser.buffer, parser.buffer_pos) { - break - } - - // Consume the line break. - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - // [Go] Should really be returning breaks instead. - *breaks = read_line(parser, *breaks) - *end_mark = parser.mark - } - - // Determine the indentation level if needed. - if *indent == 0 { - *indent = max_indent - if *indent < parser.indent+1 { - *indent = parser.indent + 1 - } - if *indent < 1 { - *indent = 1 - } - } - return true -} - -// Scan a quoted scalar. -func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, single bool) bool { - // Eat the left quote. - start_mark := parser.mark - skip(parser) - - // Consume the content of the quoted scalar. - var s, leading_break, trailing_breaks, whitespaces []byte - for { - // Check that there are no document indicators at the beginning of the line. - if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { - return false - } - - if parser.mark.column == 0 && - ((parser.buffer[parser.buffer_pos+0] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos+0] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - is_blankz(parser.buffer, parser.buffer_pos+3) { - yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", - start_mark, "found unexpected document indicator") - return false - } - - // Check for EOF. - if is_z(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a quoted scalar", - start_mark, "found unexpected end of stream") - return false - } - - // Consume non-blank characters. - leading_blanks := false - for !is_blankz(parser.buffer, parser.buffer_pos) { - if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' { - // Is is an escaped single quote. - s = append(s, '\'') - skip(parser) - skip(parser) - - } else if single && parser.buffer[parser.buffer_pos] == '\'' { - // It is a right single quote. - break - } else if !single && parser.buffer[parser.buffer_pos] == '"' { - // It is a right double quote. - break - - } else if !single && parser.buffer[parser.buffer_pos] == '\\' && is_break(parser.buffer, parser.buffer_pos+1) { - // It is an escaped line break. - if parser.unread < 3 && !yaml_parser_update_buffer(parser, 3) { - return false - } - skip(parser) - skip_line(parser) - leading_blanks = true - break - - } else if !single && parser.buffer[parser.buffer_pos] == '\\' { - // It is an escape sequence. - code_length := 0 - - // Check the escape character. - switch parser.buffer[parser.buffer_pos+1] { - case '0': - s = append(s, 0) - case 'a': - s = append(s, '\x07') - case 'b': - s = append(s, '\x08') - case 't', '\t': - s = append(s, '\x09') - case 'n': - s = append(s, '\x0A') - case 'v': - s = append(s, '\x0B') - case 'f': - s = append(s, '\x0C') - case 'r': - s = append(s, '\x0D') - case 'e': - s = append(s, '\x1B') - case ' ': - s = append(s, '\x20') - case '"': - s = append(s, '"') - case '\'': - s = append(s, '\'') - case '\\': - s = append(s, '\\') - case 'N': // NEL (#x85) - s = append(s, '\xC2') - s = append(s, '\x85') - case '_': // #xA0 - s = append(s, '\xC2') - s = append(s, '\xA0') - case 'L': // LS (#x2028) - s = append(s, '\xE2') - s = append(s, '\x80') - s = append(s, '\xA8') - case 'P': // PS (#x2029) - s = append(s, '\xE2') - s = append(s, '\x80') - s = append(s, '\xA9') - case 'x': - code_length = 2 - case 'u': - code_length = 4 - case 'U': - code_length = 8 - default: - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "found unknown escape character") - return false - } - - skip(parser) - skip(parser) - - // Consume an arbitrary escape code. - if code_length > 0 { - var value int - - // Scan the character value. - if parser.unread < code_length && !yaml_parser_update_buffer(parser, code_length) { - return false - } - for k := 0; k < code_length; k++ { - if !is_hex(parser.buffer, parser.buffer_pos+k) { - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "did not find expected hexdecimal number") - return false - } - value = (value << 4) + as_hex(parser.buffer, parser.buffer_pos+k) - } - - // Check the value and write the character. - if (value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF { - yaml_parser_set_scanner_error(parser, "while parsing a quoted scalar", - start_mark, "found invalid Unicode character escape code") - return false - } - if value <= 0x7F { - s = append(s, byte(value)) - } else if value <= 0x7FF { - s = append(s, byte(0xC0+(value>>6))) - s = append(s, byte(0x80+(value&0x3F))) - } else if value <= 0xFFFF { - s = append(s, byte(0xE0+(value>>12))) - s = append(s, byte(0x80+((value>>6)&0x3F))) - s = append(s, byte(0x80+(value&0x3F))) - } else { - s = append(s, byte(0xF0+(value>>18))) - s = append(s, byte(0x80+((value>>12)&0x3F))) - s = append(s, byte(0x80+((value>>6)&0x3F))) - s = append(s, byte(0x80+(value&0x3F))) - } - - // Advance the pointer. - for k := 0; k < code_length; k++ { - skip(parser) - } - } - } else { - // It is a non-escaped non-blank character. - s = read(parser, s) - } - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - } - - // Check if we are at the end of the scalar. - if single { - if parser.buffer[parser.buffer_pos] == '\'' { - break - } - } else { - if parser.buffer[parser.buffer_pos] == '"' { - break - } - } - - // Consume blank characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { - if is_blank(parser.buffer, parser.buffer_pos) { - // Consume a space or a tab character. - if !leading_blanks { - whitespaces = read(parser, whitespaces) - } else { - skip(parser) - } - } else { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - // Check if it is a first line break. - if !leading_blanks { - whitespaces = whitespaces[:0] - leading_break = read_line(parser, leading_break) - leading_blanks = true - } else { - trailing_breaks = read_line(parser, trailing_breaks) - } - } - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Join the whitespaces or fold line breaks. - if leading_blanks { - // Do we need to fold line breaks? - if len(leading_break) > 0 && leading_break[0] == '\n' { - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } else { - s = append(s, trailing_breaks...) - } - } else { - s = append(s, leading_break...) - s = append(s, trailing_breaks...) - } - trailing_breaks = trailing_breaks[:0] - leading_break = leading_break[:0] - } else { - s = append(s, whitespaces...) - whitespaces = whitespaces[:0] - } - } - - // Eat the right quote. - skip(parser) - end_mark := parser.mark - - // Create a token. - *token = yaml_token_t{ - typ: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_SINGLE_QUOTED_SCALAR_STYLE, - } - if !single { - token.style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } - return true -} - -// Scan a plain scalar. -func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) bool { - - var s, leading_break, trailing_breaks, whitespaces []byte - var leading_blanks bool - var indent = parser.indent + 1 - - start_mark := parser.mark - end_mark := parser.mark - - // Consume the content of the plain scalar. - for { - // Check for a document indicator. - if parser.unread < 4 && !yaml_parser_update_buffer(parser, 4) { - return false - } - if parser.mark.column == 0 && - ((parser.buffer[parser.buffer_pos+0] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos+0] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - is_blankz(parser.buffer, parser.buffer_pos+3) { - break - } - - // Check for a comment. - if parser.buffer[parser.buffer_pos] == '#' { - break - } - - // Consume non-blank characters. - for !is_blankz(parser.buffer, parser.buffer_pos) { - - // Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". - if parser.flow_level > 0 && - parser.buffer[parser.buffer_pos] == ':' && - !is_blankz(parser.buffer, parser.buffer_pos+1) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found unexpected ':'") - return false - } - - // Check for indicators that may end a plain scalar. - if (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) || - (parser.flow_level > 0 && - (parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' || - parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || - parser.buffer[parser.buffer_pos] == '}')) { - break - } - - // Check if we need to join whitespaces and breaks. - if leading_blanks || len(whitespaces) > 0 { - if leading_blanks { - // Do we need to fold line breaks? - if leading_break[0] == '\n' { - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } else { - s = append(s, trailing_breaks...) - } - } else { - s = append(s, leading_break...) - s = append(s, trailing_breaks...) - } - trailing_breaks = trailing_breaks[:0] - leading_break = leading_break[:0] - leading_blanks = false - } else { - s = append(s, whitespaces...) - whitespaces = whitespaces[:0] - } - } - - // Copy the character. - s = read(parser, s) - - end_mark = parser.mark - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - } - - // Is it the end? - if !(is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos)) { - break - } - - // Consume blank characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - - for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { - if is_blank(parser.buffer, parser.buffer_pos) { - - // Check for tab character that abuse indentation. - if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate indentation") - return false - } - - // Consume a space or a tab character. - if !leading_blanks { - whitespaces = read(parser, whitespaces) - } else { - skip(parser) - } - } else { - if parser.unread < 2 && !yaml_parser_update_buffer(parser, 2) { - return false - } - - // Check if it is a first line break. - if !leading_blanks { - whitespaces = whitespaces[:0] - leading_break = read_line(parser, leading_break) - leading_blanks = true - } else { - trailing_breaks = read_line(parser, trailing_breaks) - } - } - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - } - - // Check indentation level. - if parser.flow_level == 0 && parser.mark.column < indent { - break - } - } - - // Create a token. - *token = yaml_token_t{ - typ: yaml_SCALAR_TOKEN, - start_mark: start_mark, - end_mark: end_mark, - value: s, - style: yaml_PLAIN_SCALAR_STYLE, - } - - // Note that we change the 'simple_key_allowed' flag. - if leading_blanks { - parser.simple_key_allowed = true - } - return true -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/sorter.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/sorter.go deleted file mode 100644 index 5958822f..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/sorter.go +++ /dev/null @@ -1,104 +0,0 @@ -package yaml - -import ( - "reflect" - "unicode" -) - -type keyList []reflect.Value - -func (l keyList) Len() int { return len(l) } -func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l keyList) Less(i, j int) bool { - a := l[i] - b := l[j] - ak := a.Kind() - bk := b.Kind() - for (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() { - a = a.Elem() - ak = a.Kind() - } - for (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() { - b = b.Elem() - bk = b.Kind() - } - af, aok := keyFloat(a) - bf, bok := keyFloat(b) - if aok && bok { - if af != bf { - return af < bf - } - if ak != bk { - return ak < bk - } - return numLess(a, b) - } - if ak != reflect.String || bk != reflect.String { - return ak < bk - } - ar, br := []rune(a.String()), []rune(b.String()) - for i := 0; i < len(ar) && i < len(br); i++ { - if ar[i] == br[i] { - continue - } - al := unicode.IsLetter(ar[i]) - bl := unicode.IsLetter(br[i]) - if al && bl { - return ar[i] < br[i] - } - if al || bl { - return bl - } - var ai, bi int - var an, bn int64 - for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ { - an = an*10 + int64(ar[ai]-'0') - } - for bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ { - bn = bn*10 + int64(br[bi]-'0') - } - if an != bn { - return an < bn - } - if ai != bi { - return ai < bi - } - return ar[i] < br[i] - } - return len(ar) < len(br) -} - -// keyFloat returns a float value for v if it is a number/bool -// and whether it is a number/bool or not. -func keyFloat(v reflect.Value) (f float64, ok bool) { - switch v.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return float64(v.Int()), true - case reflect.Float32, reflect.Float64: - return v.Float(), true - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return float64(v.Uint()), true - case reflect.Bool: - if v.Bool() { - return 1, true - } - return 0, true - } - return 0, false -} - -// numLess returns whether a < b. -// a and b must necessarily have the same kind. -func numLess(a, b reflect.Value) bool { - switch a.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return a.Int() < b.Int() - case reflect.Float32, reflect.Float64: - return a.Float() < b.Float() - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return a.Uint() < b.Uint() - case reflect.Bool: - return !a.Bool() && b.Bool() - } - panic("not a number") -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/writerc.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/writerc.go deleted file mode 100644 index 190362f2..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/writerc.go +++ /dev/null @@ -1,89 +0,0 @@ -package yaml - -// Set the writer error and return false. -func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { - emitter.error = yaml_WRITER_ERROR - emitter.problem = problem - return false -} - -// Flush the output buffer. -func yaml_emitter_flush(emitter *yaml_emitter_t) bool { - if emitter.write_handler == nil { - panic("write handler not set") - } - - // Check if the buffer is empty. - if emitter.buffer_pos == 0 { - return true - } - - // If the output encoding is UTF-8, we don't need to recode the buffer. - if emitter.encoding == yaml_UTF8_ENCODING { - if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - emitter.buffer_pos = 0 - return true - } - - // Recode the buffer into the raw buffer. - var low, high int - if emitter.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - high, low = 1, 0 - } - - pos := 0 - for pos < emitter.buffer_pos { - // See the "reader.c" code for more details on UTF-8 encoding. Note - // that we assume that the buffer contains a valid UTF-8 sequence. - - // Read the next UTF-8 character. - octet := emitter.buffer[pos] - - var w int - var value rune - switch { - case octet&0x80 == 0x00: - w, value = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, value = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, value = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, value = 4, rune(octet&0x07) - } - for k := 1; k < w; k++ { - octet = emitter.buffer[pos+k] - value = (value << 6) + (rune(octet) & 0x3F) - } - pos += w - - // Write the character. - if value < 0x10000 { - var b [2]byte - b[high] = byte(value >> 8) - b[low] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1]) - } else { - // Write the character using a surrogate pair (check "reader.c"). - var b [4]byte - value -= 0x10000 - b[high] = byte(0xD8 + (value >> 18)) - b[low] = byte((value >> 10) & 0xFF) - b[high+2] = byte(0xDC + ((value >> 8) & 0xFF)) - b[low+2] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3]) - } - } - - // Write the raw buffer. - if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - emitter.buffer_pos = 0 - emitter.raw_buffer = emitter.raw_buffer[:0] - return true -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yaml.go deleted file mode 100644 index bf18884e..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yaml.go +++ /dev/null @@ -1,357 +0,0 @@ -// Package yaml implements YAML support for the Go language. -// -// Source code and other details for the project are available at GitHub: -// -// https://github.com/go-yaml/yaml -// -package yaml - -import ( - "errors" - "fmt" - "reflect" - "strings" - "sync" -) - -// MapSlice encodes and decodes as a YAML map. -// The order of keys is preserved when encoding and decoding. -type MapSlice []MapItem - -// MapItem is an item in a MapSlice. -type MapItem struct { - Key, Value interface{} -} - -// The Unmarshaler interface may be implemented by types to customize their -// behavior when being unmarshaled from a YAML document. The UnmarshalYAML -// method receives a function that may be called to unmarshal the original -// YAML value into a field or variable. It is safe to call the unmarshal -// function parameter more than once if necessary. -type Unmarshaler interface { - UnmarshalYAML(unmarshal func(interface{}) error) error -} - -// The Marshaler interface may be implemented by types to customize their -// behavior when being marshaled into a YAML document. The returned value -// is marshaled in place of the original value implementing Marshaler. -// -// If an error is returned by MarshalYAML, the marshaling procedure stops -// and returns with the provided error. -type Marshaler interface { - MarshalYAML() (interface{}, error) -} - -// Unmarshal decodes the first document found within the in byte slice -// and assigns decoded values into the out value. -// -// Maps and pointers (to a struct, string, int, etc) are accepted as out -// values. If an internal pointer within a struct is not initialized, -// the yaml package will initialize it if necessary for unmarshalling -// the provided data. The out parameter must not be nil. -// -// The type of the decoded values should be compatible with the respective -// values in out. If one or more values cannot be decoded due to a type -// mismatches, decoding continues partially until the end of the YAML -// content, and a *yaml.TypeError is returned with details for all -// missed values. -// -// Struct fields are only unmarshalled if they are exported (have an -// upper case first letter), and are unmarshalled using the field name -// lowercased as the default key. Custom keys may be defined via the -// "yaml" name in the field tag: the content preceding the first comma -// is used as the key, and the following comma-separated options are -// used to tweak the marshalling process (see Marshal). -// Conflicting names result in a runtime error. -// -// For example: -// -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// var t T -// yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) -// -// See the documentation of Marshal for the format of tags and a list of -// supported tag options. -// -func Unmarshal(in []byte, out interface{}) (err error) { - return unmarshal(in, out, false) -} - -// UnmarshalStrict is like Unmarshal except that any fields that are found -// in the data that do not have corresponding struct members will result in -// an error. -func UnmarshalStrict(in []byte, out interface{}) (err error) { - return unmarshal(in, out, true) -} - -func unmarshal(in []byte, out interface{}, strict bool) (err error) { - defer handleErr(&err) - d := newDecoder(strict) - p := newParser(in) - defer p.destroy() - node := p.parse() - if node != nil { - v := reflect.ValueOf(out) - if v.Kind() == reflect.Ptr && !v.IsNil() { - v = v.Elem() - } - d.unmarshal(node, v) - } - if len(d.terrors) > 0 { - return &TypeError{d.terrors} - } - return nil -} - -// Marshal serializes the value provided into a YAML document. The structure -// of the generated document will reflect the structure of the value itself. -// Maps and pointers (to struct, string, int, etc) are accepted as the in value. -// -// Struct fields are only unmarshalled if they are exported (have an upper case -// first letter), and are unmarshalled using the field name lowercased as the -// default key. Custom keys may be defined via the "yaml" name in the field -// tag: the content preceding the first comma is used as the key, and the -// following comma-separated options are used to tweak the marshalling process. -// Conflicting names result in a runtime error. -// -// The field tag format accepted is: -// -// `(...) yaml:"[][,[,]]" (...)` -// -// The following flags are currently supported: -// -// omitempty Only include the field if it's not set to the zero -// value for the type or to empty slices or maps. -// Does not apply to zero valued structs. -// -// flow Marshal using a flow style (useful for structs, -// sequences and maps). -// -// inline Inline the field, which must be a struct or a map, -// causing all of its fields or keys to be processed as if -// they were part of the outer struct. For maps, keys must -// not conflict with the yaml keys of other struct fields. -// -// In addition, if the key is "-", the field is ignored. -// -// For example: -// -// type T struct { -// F int "a,omitempty" -// B int -// } -// yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" -// yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" -// -func Marshal(in interface{}) (out []byte, err error) { - defer handleErr(&err) - e := newEncoder() - defer e.destroy() - e.marshal("", reflect.ValueOf(in)) - e.finish() - out = e.out - return -} - -func handleErr(err *error) { - if v := recover(); v != nil { - if e, ok := v.(yamlError); ok { - *err = e.err - } else { - panic(v) - } - } -} - -type yamlError struct { - err error -} - -func fail(err error) { - panic(yamlError{err}) -} - -func failf(format string, args ...interface{}) { - panic(yamlError{fmt.Errorf("yaml: "+format, args...)}) -} - -// A TypeError is returned by Unmarshal when one or more fields in -// the YAML document cannot be properly decoded into the requested -// types. When this error is returned, the value is still -// unmarshaled partially. -type TypeError struct { - Errors []string -} - -func (e *TypeError) Error() string { - return fmt.Sprintf("yaml: unmarshal errors:\n %s", strings.Join(e.Errors, "\n ")) -} - -// -------------------------------------------------------------------------- -// Maintain a mapping of keys to structure field indexes - -// The code in this section was copied from mgo/bson. - -// structInfo holds details for the serialization of fields of -// a given struct. -type structInfo struct { - FieldsMap map[string]fieldInfo - FieldsList []fieldInfo - - // InlineMap is the number of the field in the struct that - // contains an ,inline map, or -1 if there's none. - InlineMap int -} - -type fieldInfo struct { - Key string - Num int - OmitEmpty bool - Flow bool - - // Inline holds the field index if the field is part of an inlined struct. - Inline []int -} - -var structMap = make(map[reflect.Type]*structInfo) -var fieldMapMutex sync.RWMutex - -func getStructInfo(st reflect.Type) (*structInfo, error) { - fieldMapMutex.RLock() - sinfo, found := structMap[st] - fieldMapMutex.RUnlock() - if found { - return sinfo, nil - } - - n := st.NumField() - fieldsMap := make(map[string]fieldInfo) - fieldsList := make([]fieldInfo, 0, n) - inlineMap := -1 - for i := 0; i != n; i++ { - field := st.Field(i) - if field.PkgPath != "" && !field.Anonymous { - continue // Private field - } - - info := fieldInfo{Num: i} - - tag := field.Tag.Get("yaml") - if tag == "" && strings.Index(string(field.Tag), ":") < 0 { - tag = string(field.Tag) - } - if tag == "-" { - continue - } - - inline := false - fields := strings.Split(tag, ",") - if len(fields) > 1 { - for _, flag := range fields[1:] { - switch flag { - case "omitempty": - info.OmitEmpty = true - case "flow": - info.Flow = true - case "inline": - inline = true - default: - return nil, errors.New(fmt.Sprintf("Unsupported flag %q in tag %q of type %s", flag, tag, st)) - } - } - tag = fields[0] - } - - if inline { - switch field.Type.Kind() { - case reflect.Map: - if inlineMap >= 0 { - return nil, errors.New("Multiple ,inline maps in struct " + st.String()) - } - if field.Type.Key() != reflect.TypeOf("") { - return nil, errors.New("Option ,inline needs a map with string keys in struct " + st.String()) - } - inlineMap = info.Num - case reflect.Struct: - sinfo, err := getStructInfo(field.Type) - if err != nil { - return nil, err - } - for _, finfo := range sinfo.FieldsList { - if _, found := fieldsMap[finfo.Key]; found { - msg := "Duplicated key '" + finfo.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - if finfo.Inline == nil { - finfo.Inline = []int{i, finfo.Num} - } else { - finfo.Inline = append([]int{i}, finfo.Inline...) - } - fieldsMap[finfo.Key] = finfo - fieldsList = append(fieldsList, finfo) - } - default: - //return nil, errors.New("Option ,inline needs a struct value or map field") - return nil, errors.New("Option ,inline needs a struct value field") - } - continue - } - - if tag != "" { - info.Key = tag - } else { - info.Key = strings.ToLower(field.Name) - } - - if _, found = fieldsMap[info.Key]; found { - msg := "Duplicated key '" + info.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - - fieldsList = append(fieldsList, info) - fieldsMap[info.Key] = info - } - - sinfo = &structInfo{fieldsMap, fieldsList, inlineMap} - - fieldMapMutex.Lock() - structMap[st] = sinfo - fieldMapMutex.Unlock() - return sinfo, nil -} - -func isZero(v reflect.Value) bool { - switch v.Kind() { - case reflect.String: - return len(v.String()) == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - case reflect.Slice: - return v.Len() == 0 - case reflect.Map: - return v.Len() == 0 - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Struct: - vt := v.Type() - for i := v.NumField() - 1; i >= 0; i-- { - if vt.Field(i).PkgPath != "" { - continue // Private field - } - if !isZero(v.Field(i)) { - return false - } - } - return true - } - return false -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlh.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlh.go deleted file mode 100644 index 3caeca04..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlh.go +++ /dev/null @@ -1,716 +0,0 @@ -package yaml - -import ( - "io" -) - -// The version directive data. -type yaml_version_directive_t struct { - major int8 // The major version number. - minor int8 // The minor version number. -} - -// The tag directive data. -type yaml_tag_directive_t struct { - handle []byte // The tag handle. - prefix []byte // The tag prefix. -} - -type yaml_encoding_t int - -// The stream encoding. -const ( - // Let the parser choose the encoding. - yaml_ANY_ENCODING yaml_encoding_t = iota - - yaml_UTF8_ENCODING // The default UTF-8 encoding. - yaml_UTF16LE_ENCODING // The UTF-16-LE encoding with BOM. - yaml_UTF16BE_ENCODING // The UTF-16-BE encoding with BOM. -) - -type yaml_break_t int - -// Line break types. -const ( - // Let the parser choose the break type. - yaml_ANY_BREAK yaml_break_t = iota - - yaml_CR_BREAK // Use CR for line breaks (Mac style). - yaml_LN_BREAK // Use LN for line breaks (Unix style). - yaml_CRLN_BREAK // Use CR LN for line breaks (DOS style). -) - -type yaml_error_type_t int - -// Many bad things could happen with the parser and emitter. -const ( - // No error is produced. - yaml_NO_ERROR yaml_error_type_t = iota - - yaml_MEMORY_ERROR // Cannot allocate or reallocate a block of memory. - yaml_READER_ERROR // Cannot read or decode the input stream. - yaml_SCANNER_ERROR // Cannot scan the input stream. - yaml_PARSER_ERROR // Cannot parse the input stream. - yaml_COMPOSER_ERROR // Cannot compose a YAML document. - yaml_WRITER_ERROR // Cannot write to the output stream. - yaml_EMITTER_ERROR // Cannot emit a YAML stream. -) - -// The pointer position. -type yaml_mark_t struct { - index int // The position index. - line int // The position line. - column int // The position column. -} - -// Node Styles - -type yaml_style_t int8 - -type yaml_scalar_style_t yaml_style_t - -// Scalar styles. -const ( - // Let the emitter choose the style. - yaml_ANY_SCALAR_STYLE yaml_scalar_style_t = iota - - yaml_PLAIN_SCALAR_STYLE // The plain scalar style. - yaml_SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style. - yaml_DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style. - yaml_LITERAL_SCALAR_STYLE // The literal scalar style. - yaml_FOLDED_SCALAR_STYLE // The folded scalar style. -) - -type yaml_sequence_style_t yaml_style_t - -// Sequence styles. -const ( - // Let the emitter choose the style. - yaml_ANY_SEQUENCE_STYLE yaml_sequence_style_t = iota - - yaml_BLOCK_SEQUENCE_STYLE // The block sequence style. - yaml_FLOW_SEQUENCE_STYLE // The flow sequence style. -) - -type yaml_mapping_style_t yaml_style_t - -// Mapping styles. -const ( - // Let the emitter choose the style. - yaml_ANY_MAPPING_STYLE yaml_mapping_style_t = iota - - yaml_BLOCK_MAPPING_STYLE // The block mapping style. - yaml_FLOW_MAPPING_STYLE // The flow mapping style. -) - -// Tokens - -type yaml_token_type_t int - -// Token types. -const ( - // An empty token. - yaml_NO_TOKEN yaml_token_type_t = iota - - yaml_STREAM_START_TOKEN // A STREAM-START token. - yaml_STREAM_END_TOKEN // A STREAM-END token. - - yaml_VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token. - yaml_TAG_DIRECTIVE_TOKEN // A TAG-DIRECTIVE token. - yaml_DOCUMENT_START_TOKEN // A DOCUMENT-START token. - yaml_DOCUMENT_END_TOKEN // A DOCUMENT-END token. - - yaml_BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token. - yaml_BLOCK_MAPPING_START_TOKEN // A BLOCK-SEQUENCE-END token. - yaml_BLOCK_END_TOKEN // A BLOCK-END token. - - yaml_FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token. - yaml_FLOW_SEQUENCE_END_TOKEN // A FLOW-SEQUENCE-END token. - yaml_FLOW_MAPPING_START_TOKEN // A FLOW-MAPPING-START token. - yaml_FLOW_MAPPING_END_TOKEN // A FLOW-MAPPING-END token. - - yaml_BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token. - yaml_FLOW_ENTRY_TOKEN // A FLOW-ENTRY token. - yaml_KEY_TOKEN // A KEY token. - yaml_VALUE_TOKEN // A VALUE token. - - yaml_ALIAS_TOKEN // An ALIAS token. - yaml_ANCHOR_TOKEN // An ANCHOR token. - yaml_TAG_TOKEN // A TAG token. - yaml_SCALAR_TOKEN // A SCALAR token. -) - -func (tt yaml_token_type_t) String() string { - switch tt { - case yaml_NO_TOKEN: - return "yaml_NO_TOKEN" - case yaml_STREAM_START_TOKEN: - return "yaml_STREAM_START_TOKEN" - case yaml_STREAM_END_TOKEN: - return "yaml_STREAM_END_TOKEN" - case yaml_VERSION_DIRECTIVE_TOKEN: - return "yaml_VERSION_DIRECTIVE_TOKEN" - case yaml_TAG_DIRECTIVE_TOKEN: - return "yaml_TAG_DIRECTIVE_TOKEN" - case yaml_DOCUMENT_START_TOKEN: - return "yaml_DOCUMENT_START_TOKEN" - case yaml_DOCUMENT_END_TOKEN: - return "yaml_DOCUMENT_END_TOKEN" - case yaml_BLOCK_SEQUENCE_START_TOKEN: - return "yaml_BLOCK_SEQUENCE_START_TOKEN" - case yaml_BLOCK_MAPPING_START_TOKEN: - return "yaml_BLOCK_MAPPING_START_TOKEN" - case yaml_BLOCK_END_TOKEN: - return "yaml_BLOCK_END_TOKEN" - case yaml_FLOW_SEQUENCE_START_TOKEN: - return "yaml_FLOW_SEQUENCE_START_TOKEN" - case yaml_FLOW_SEQUENCE_END_TOKEN: - return "yaml_FLOW_SEQUENCE_END_TOKEN" - case yaml_FLOW_MAPPING_START_TOKEN: - return "yaml_FLOW_MAPPING_START_TOKEN" - case yaml_FLOW_MAPPING_END_TOKEN: - return "yaml_FLOW_MAPPING_END_TOKEN" - case yaml_BLOCK_ENTRY_TOKEN: - return "yaml_BLOCK_ENTRY_TOKEN" - case yaml_FLOW_ENTRY_TOKEN: - return "yaml_FLOW_ENTRY_TOKEN" - case yaml_KEY_TOKEN: - return "yaml_KEY_TOKEN" - case yaml_VALUE_TOKEN: - return "yaml_VALUE_TOKEN" - case yaml_ALIAS_TOKEN: - return "yaml_ALIAS_TOKEN" - case yaml_ANCHOR_TOKEN: - return "yaml_ANCHOR_TOKEN" - case yaml_TAG_TOKEN: - return "yaml_TAG_TOKEN" - case yaml_SCALAR_TOKEN: - return "yaml_SCALAR_TOKEN" - } - return "" -} - -// The token structure. -type yaml_token_t struct { - // The token type. - typ yaml_token_type_t - - // The start/end of the token. - start_mark, end_mark yaml_mark_t - - // The stream encoding (for yaml_STREAM_START_TOKEN). - encoding yaml_encoding_t - - // The alias/anchor/scalar value or tag/tag directive handle - // (for yaml_ALIAS_TOKEN, yaml_ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN). - value []byte - - // The tag suffix (for yaml_TAG_TOKEN). - suffix []byte - - // The tag directive prefix (for yaml_TAG_DIRECTIVE_TOKEN). - prefix []byte - - // The scalar style (for yaml_SCALAR_TOKEN). - style yaml_scalar_style_t - - // The version directive major/minor (for yaml_VERSION_DIRECTIVE_TOKEN). - major, minor int8 -} - -// Events - -type yaml_event_type_t int8 - -// Event types. -const ( - // An empty event. - yaml_NO_EVENT yaml_event_type_t = iota - - yaml_STREAM_START_EVENT // A STREAM-START event. - yaml_STREAM_END_EVENT // A STREAM-END event. - yaml_DOCUMENT_START_EVENT // A DOCUMENT-START event. - yaml_DOCUMENT_END_EVENT // A DOCUMENT-END event. - yaml_ALIAS_EVENT // An ALIAS event. - yaml_SCALAR_EVENT // A SCALAR event. - yaml_SEQUENCE_START_EVENT // A SEQUENCE-START event. - yaml_SEQUENCE_END_EVENT // A SEQUENCE-END event. - yaml_MAPPING_START_EVENT // A MAPPING-START event. - yaml_MAPPING_END_EVENT // A MAPPING-END event. -) - -// The event structure. -type yaml_event_t struct { - - // The event type. - typ yaml_event_type_t - - // The start and end of the event. - start_mark, end_mark yaml_mark_t - - // The document encoding (for yaml_STREAM_START_EVENT). - encoding yaml_encoding_t - - // The version directive (for yaml_DOCUMENT_START_EVENT). - version_directive *yaml_version_directive_t - - // The list of tag directives (for yaml_DOCUMENT_START_EVENT). - tag_directives []yaml_tag_directive_t - - // The anchor (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_ALIAS_EVENT). - anchor []byte - - // The tag (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). - tag []byte - - // The scalar value (for yaml_SCALAR_EVENT). - value []byte - - // Is the document start/end indicator implicit, or the tag optional? - // (for yaml_DOCUMENT_START_EVENT, yaml_DOCUMENT_END_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT, yaml_SCALAR_EVENT). - implicit bool - - // Is the tag optional for any non-plain style? (for yaml_SCALAR_EVENT). - quoted_implicit bool - - // The style (for yaml_SCALAR_EVENT, yaml_SEQUENCE_START_EVENT, yaml_MAPPING_START_EVENT). - style yaml_style_t -} - -func (e *yaml_event_t) scalar_style() yaml_scalar_style_t { return yaml_scalar_style_t(e.style) } -func (e *yaml_event_t) sequence_style() yaml_sequence_style_t { return yaml_sequence_style_t(e.style) } -func (e *yaml_event_t) mapping_style() yaml_mapping_style_t { return yaml_mapping_style_t(e.style) } - -// Nodes - -const ( - yaml_NULL_TAG = "tag:yaml.org,2002:null" // The tag !!null with the only possible value: null. - yaml_BOOL_TAG = "tag:yaml.org,2002:bool" // The tag !!bool with the values: true and false. - yaml_STR_TAG = "tag:yaml.org,2002:str" // The tag !!str for string values. - yaml_INT_TAG = "tag:yaml.org,2002:int" // The tag !!int for integer values. - yaml_FLOAT_TAG = "tag:yaml.org,2002:float" // The tag !!float for float values. - yaml_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values. - - yaml_SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences. - yaml_MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping. - - // Not in original libyaml. - yaml_BINARY_TAG = "tag:yaml.org,2002:binary" - yaml_MERGE_TAG = "tag:yaml.org,2002:merge" - - yaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG // The default scalar tag is !!str. - yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq. - yaml_DEFAULT_MAPPING_TAG = yaml_MAP_TAG // The default mapping tag is !!map. -) - -type yaml_node_type_t int - -// Node types. -const ( - // An empty node. - yaml_NO_NODE yaml_node_type_t = iota - - yaml_SCALAR_NODE // A scalar node. - yaml_SEQUENCE_NODE // A sequence node. - yaml_MAPPING_NODE // A mapping node. -) - -// An element of a sequence node. -type yaml_node_item_t int - -// An element of a mapping node. -type yaml_node_pair_t struct { - key int // The key of the element. - value int // The value of the element. -} - -// The node structure. -type yaml_node_t struct { - typ yaml_node_type_t // The node type. - tag []byte // The node tag. - - // The node data. - - // The scalar parameters (for yaml_SCALAR_NODE). - scalar struct { - value []byte // The scalar value. - length int // The length of the scalar value. - style yaml_scalar_style_t // The scalar style. - } - - // The sequence parameters (for YAML_SEQUENCE_NODE). - sequence struct { - items_data []yaml_node_item_t // The stack of sequence items. - style yaml_sequence_style_t // The sequence style. - } - - // The mapping parameters (for yaml_MAPPING_NODE). - mapping struct { - pairs_data []yaml_node_pair_t // The stack of mapping pairs (key, value). - pairs_start *yaml_node_pair_t // The beginning of the stack. - pairs_end *yaml_node_pair_t // The end of the stack. - pairs_top *yaml_node_pair_t // The top of the stack. - style yaml_mapping_style_t // The mapping style. - } - - start_mark yaml_mark_t // The beginning of the node. - end_mark yaml_mark_t // The end of the node. - -} - -// The document structure. -type yaml_document_t struct { - - // The document nodes. - nodes []yaml_node_t - - // The version directive. - version_directive *yaml_version_directive_t - - // The list of tag directives. - tag_directives_data []yaml_tag_directive_t - tag_directives_start int // The beginning of the tag directives list. - tag_directives_end int // The end of the tag directives list. - - start_implicit int // Is the document start indicator implicit? - end_implicit int // Is the document end indicator implicit? - - // The start/end of the document. - start_mark, end_mark yaml_mark_t -} - -// The prototype of a read handler. -// -// The read handler is called when the parser needs to read more bytes from the -// source. The handler should write not more than size bytes to the buffer. -// The number of written bytes should be set to the size_read variable. -// -// [in,out] data A pointer to an application data specified by -// yaml_parser_set_input(). -// [out] buffer The buffer to write the data from the source. -// [in] size The size of the buffer. -// [out] size_read The actual number of bytes read from the source. -// -// On success, the handler should return 1. If the handler failed, -// the returned value should be 0. On EOF, the handler should set the -// size_read to 0 and return 1. -type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error) - -// This structure holds information about a potential simple key. -type yaml_simple_key_t struct { - possible bool // Is a simple key possible? - required bool // Is a simple key required? - token_number int // The number of the token. - mark yaml_mark_t // The position mark. -} - -// The states of the parser. -type yaml_parser_state_t int - -const ( - yaml_PARSE_STREAM_START_STATE yaml_parser_state_t = iota - - yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE // Expect the beginning of an implicit document. - yaml_PARSE_DOCUMENT_START_STATE // Expect DOCUMENT-START. - yaml_PARSE_DOCUMENT_CONTENT_STATE // Expect the content of a document. - yaml_PARSE_DOCUMENT_END_STATE // Expect DOCUMENT-END. - yaml_PARSE_BLOCK_NODE_STATE // Expect a block node. - yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE // Expect a block node or indentless sequence. - yaml_PARSE_FLOW_NODE_STATE // Expect a flow node. - yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a block sequence. - yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE // Expect an entry of a block sequence. - yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE // Expect an entry of an indentless sequence. - yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. - yaml_PARSE_BLOCK_MAPPING_KEY_STATE // Expect a block mapping key. - yaml_PARSE_BLOCK_MAPPING_VALUE_STATE // Expect a block mapping value. - yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a flow sequence. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE // Expect an entry of a flow sequence. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE // Expect a key of an ordered mapping. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping. - yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE // Expect the and of an ordered mapping entry. - yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. - yaml_PARSE_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. - yaml_PARSE_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. - yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE // Expect an empty value of a flow mapping. - yaml_PARSE_END_STATE // Expect nothing. -) - -func (ps yaml_parser_state_t) String() string { - switch ps { - case yaml_PARSE_STREAM_START_STATE: - return "yaml_PARSE_STREAM_START_STATE" - case yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE: - return "yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE" - case yaml_PARSE_DOCUMENT_START_STATE: - return "yaml_PARSE_DOCUMENT_START_STATE" - case yaml_PARSE_DOCUMENT_CONTENT_STATE: - return "yaml_PARSE_DOCUMENT_CONTENT_STATE" - case yaml_PARSE_DOCUMENT_END_STATE: - return "yaml_PARSE_DOCUMENT_END_STATE" - case yaml_PARSE_BLOCK_NODE_STATE: - return "yaml_PARSE_BLOCK_NODE_STATE" - case yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE: - return "yaml_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE" - case yaml_PARSE_FLOW_NODE_STATE: - return "yaml_PARSE_FLOW_NODE_STATE" - case yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: - return "yaml_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE" - case yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE: - return "yaml_PARSE_BLOCK_SEQUENCE_ENTRY_STATE" - case yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: - return "yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE" - case yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: - return "yaml_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE" - case yaml_PARSE_BLOCK_MAPPING_KEY_STATE: - return "yaml_PARSE_BLOCK_MAPPING_KEY_STATE" - case yaml_PARSE_BLOCK_MAPPING_VALUE_STATE: - return "yaml_PARSE_BLOCK_MAPPING_VALUE_STATE" - case yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE" - case yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: - return "yaml_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE" - case yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE: - return "yaml_PARSE_FLOW_MAPPING_FIRST_KEY_STATE" - case yaml_PARSE_FLOW_MAPPING_KEY_STATE: - return "yaml_PARSE_FLOW_MAPPING_KEY_STATE" - case yaml_PARSE_FLOW_MAPPING_VALUE_STATE: - return "yaml_PARSE_FLOW_MAPPING_VALUE_STATE" - case yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: - return "yaml_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE" - case yaml_PARSE_END_STATE: - return "yaml_PARSE_END_STATE" - } - return "" -} - -// This structure holds aliases data. -type yaml_alias_data_t struct { - anchor []byte // The anchor. - index int // The node id. - mark yaml_mark_t // The anchor mark. -} - -// The parser structure. -// -// All members are internal. Manage the structure using the -// yaml_parser_ family of functions. -type yaml_parser_t struct { - - // Error handling - - error yaml_error_type_t // Error type. - - problem string // Error description. - - // The byte about which the problem occurred. - problem_offset int - problem_value int - problem_mark yaml_mark_t - - // The error context. - context string - context_mark yaml_mark_t - - // Reader stuff - - read_handler yaml_read_handler_t // Read handler. - - input_file io.Reader // File input data. - input []byte // String input data. - input_pos int - - eof bool // EOF flag - - buffer []byte // The working buffer. - buffer_pos int // The current position of the buffer. - - unread int // The number of unread characters in the buffer. - - raw_buffer []byte // The raw buffer. - raw_buffer_pos int // The current position of the buffer. - - encoding yaml_encoding_t // The input encoding. - - offset int // The offset of the current position (in bytes). - mark yaml_mark_t // The mark of the current position. - - // Scanner stuff - - stream_start_produced bool // Have we started to scan the input stream? - stream_end_produced bool // Have we reached the end of the input stream? - - flow_level int // The number of unclosed '[' and '{' indicators. - - tokens []yaml_token_t // The tokens queue. - tokens_head int // The head of the tokens queue. - tokens_parsed int // The number of tokens fetched from the queue. - token_available bool // Does the tokens queue contain a token ready for dequeueing. - - indent int // The current indentation level. - indents []int // The indentation levels stack. - - simple_key_allowed bool // May a simple key occur at the current position? - simple_keys []yaml_simple_key_t // The stack of simple keys. - - // Parser stuff - - state yaml_parser_state_t // The current parser state. - states []yaml_parser_state_t // The parser states stack. - marks []yaml_mark_t // The stack of marks. - tag_directives []yaml_tag_directive_t // The list of TAG directives. - - // Dumper stuff - - aliases []yaml_alias_data_t // The alias data. - - document *yaml_document_t // The currently parsed document. -} - -// Emitter Definitions - -// The prototype of a write handler. -// -// The write handler is called when the emitter needs to flush the accumulated -// characters to the output. The handler should write @a size bytes of the -// @a buffer to the output. -// -// @param[in,out] data A pointer to an application data specified by -// yaml_emitter_set_output(). -// @param[in] buffer The buffer with bytes to be written. -// @param[in] size The size of the buffer. -// -// @returns On success, the handler should return @c 1. If the handler failed, -// the returned value should be @c 0. -// -type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error - -type yaml_emitter_state_t int - -// The emitter states. -const ( - // Expect STREAM-START. - yaml_EMIT_STREAM_START_STATE yaml_emitter_state_t = iota - - yaml_EMIT_FIRST_DOCUMENT_START_STATE // Expect the first DOCUMENT-START or STREAM-END. - yaml_EMIT_DOCUMENT_START_STATE // Expect DOCUMENT-START or STREAM-END. - yaml_EMIT_DOCUMENT_CONTENT_STATE // Expect the content of a document. - yaml_EMIT_DOCUMENT_END_STATE // Expect DOCUMENT-END. - yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a flow sequence. - yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE // Expect an item of a flow sequence. - yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. - yaml_EMIT_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. - yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a flow mapping. - yaml_EMIT_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. - yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a block sequence. - yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE // Expect an item of a block sequence. - yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. - yaml_EMIT_BLOCK_MAPPING_KEY_STATE // Expect the key of a block mapping. - yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping. - yaml_EMIT_BLOCK_MAPPING_VALUE_STATE // Expect a value of a block mapping. - yaml_EMIT_END_STATE // Expect nothing. -) - -// The emitter structure. -// -// All members are internal. Manage the structure using the @c yaml_emitter_ -// family of functions. -type yaml_emitter_t struct { - - // Error handling - - error yaml_error_type_t // Error type. - problem string // Error description. - - // Writer stuff - - write_handler yaml_write_handler_t // Write handler. - - output_buffer *[]byte // String output data. - output_file io.Writer // File output data. - - buffer []byte // The working buffer. - buffer_pos int // The current position of the buffer. - - raw_buffer []byte // The raw buffer. - raw_buffer_pos int // The current position of the buffer. - - encoding yaml_encoding_t // The stream encoding. - - // Emitter stuff - - canonical bool // If the output is in the canonical style? - best_indent int // The number of indentation spaces. - best_width int // The preferred width of the output lines. - unicode bool // Allow unescaped non-ASCII characters? - line_break yaml_break_t // The preferred line break. - - state yaml_emitter_state_t // The current emitter state. - states []yaml_emitter_state_t // The stack of states. - - events []yaml_event_t // The event queue. - events_head int // The head of the event queue. - - indents []int // The stack of indentation levels. - - tag_directives []yaml_tag_directive_t // The list of tag directives. - - indent int // The current indentation level. - - flow_level int // The current flow level. - - root_context bool // Is it the document root context? - sequence_context bool // Is it a sequence context? - mapping_context bool // Is it a mapping context? - simple_key_context bool // Is it a simple mapping key context? - - line int // The current line. - column int // The current column. - whitespace bool // If the last character was a whitespace? - indention bool // If the last character was an indentation character (' ', '-', '?', ':')? - open_ended bool // If an explicit document end is required? - - // Anchor analysis. - anchor_data struct { - anchor []byte // The anchor value. - alias bool // Is it an alias? - } - - // Tag analysis. - tag_data struct { - handle []byte // The tag handle. - suffix []byte // The tag suffix. - } - - // Scalar analysis. - scalar_data struct { - value []byte // The scalar value. - multiline bool // Does the scalar contain line breaks? - flow_plain_allowed bool // Can the scalar be expessed in the flow plain style? - block_plain_allowed bool // Can the scalar be expressed in the block plain style? - single_quoted_allowed bool // Can the scalar be expressed in the single quoted style? - block_allowed bool // Can the scalar be expressed in the literal or folded styles? - style yaml_scalar_style_t // The output style. - } - - // Dumper stuff - - opened bool // If the stream was already opened? - closed bool // If the stream was already closed? - - // The information associated with the document nodes. - anchors *struct { - references int // The number of references. - anchor int // The anchor id. - serialized bool // If the node has been emitted? - } - - last_anchor_id int // The last assigned anchor id. - - document *yaml_document_t // The currently emitted document. -} diff --git a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlprivateh.go b/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlprivateh.go deleted file mode 100644 index 8110ce3c..00000000 --- a/vendor/github.com/mattermost/platform/vendor/gopkg.in/yaml.v2/yamlprivateh.go +++ /dev/null @@ -1,173 +0,0 @@ -package yaml - -const ( - // The size of the input raw buffer. - input_raw_buffer_size = 512 - - // The size of the input buffer. - // It should be possible to decode the whole raw buffer. - input_buffer_size = input_raw_buffer_size * 3 - - // The size of the output buffer. - output_buffer_size = 128 - - // The size of the output raw buffer. - // It should be possible to encode the whole output buffer. - output_raw_buffer_size = (output_buffer_size*2 + 2) - - // The size of other stacks and queues. - initial_stack_size = 16 - initial_queue_size = 16 - initial_string_size = 16 -) - -// Check if the character at the specified position is an alphabetical -// character, a digit, '_', or '-'. -func is_alpha(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-' -} - -// Check if the character at the specified position is a digit. -func is_digit(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' -} - -// Get the value of a digit. -func as_digit(b []byte, i int) int { - return int(b[i]) - '0' -} - -// Check if the character at the specified position is a hex-digit. -func is_hex(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f' -} - -// Get the value of a hex-digit. -func as_hex(b []byte, i int) int { - bi := b[i] - if bi >= 'A' && bi <= 'F' { - return int(bi) - 'A' + 10 - } - if bi >= 'a' && bi <= 'f' { - return int(bi) - 'a' + 10 - } - return int(bi) - '0' -} - -// Check if the character is ASCII. -func is_ascii(b []byte, i int) bool { - return b[i] <= 0x7F -} - -// Check if the character at the start of the buffer can be printed unescaped. -func is_printable(b []byte, i int) bool { - return ((b[i] == 0x0A) || // . == #x0A - (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E - (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF - (b[i] > 0xC2 && b[i] < 0xED) || - (b[i] == 0xED && b[i+1] < 0xA0) || - (b[i] == 0xEE) || - (b[i] == 0xEF && // #xE000 <= . <= #xFFFD - !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF - !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) -} - -// Check if the character at the specified position is NUL. -func is_z(b []byte, i int) bool { - return b[i] == 0x00 -} - -// Check if the beginning of the buffer is a BOM. -func is_bom(b []byte, i int) bool { - return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF -} - -// Check if the character at the specified position is space. -func is_space(b []byte, i int) bool { - return b[i] == ' ' -} - -// Check if the character at the specified position is tab. -func is_tab(b []byte, i int) bool { - return b[i] == '\t' -} - -// Check if the character at the specified position is blank (space or tab). -func is_blank(b []byte, i int) bool { - //return is_space(b, i) || is_tab(b, i) - return b[i] == ' ' || b[i] == '\t' -} - -// Check if the character at the specified position is a line break. -func is_break(b []byte, i int) bool { - return (b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029) -} - -func is_crlf(b []byte, i int) bool { - return b[i] == '\r' && b[i+1] == '\n' -} - -// Check if the character is a line break or NUL. -func is_breakz(b []byte, i int) bool { - //return is_break(b, i) || is_z(b, i) - return ( // is_break: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - // is_z: - b[i] == 0) -} - -// Check if the character is a line break, space, or NUL. -func is_spacez(b []byte, i int) bool { - //return is_space(b, i) || is_breakz(b, i) - return ( // is_space: - b[i] == ' ' || - // is_breakz: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - b[i] == 0) -} - -// Check if the character is a line break, space, tab, or NUL. -func is_blankz(b []byte, i int) bool { - //return is_blank(b, i) || is_breakz(b, i) - return ( // is_blank: - b[i] == ' ' || b[i] == '\t' || - // is_breakz: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - b[i] == 0) -} - -// Determine the width of the character. -func width(b byte) int { - // Don't replace these by a switch without first - // confirming that it is being inlined. - if b&0x80 == 0x00 { - return 1 - } - if b&0xE0 == 0xC0 { - return 2 - } - if b&0xF0 == 0xE0 { - return 3 - } - if b&0xF8 == 0xF0 { - return 4 - } - return 0 - -} diff --git a/vendor/github.com/mattn/go-colorable/.travis.yml b/vendor/github.com/mattn/go-colorable/.travis.yml new file mode 100644 index 00000000..42768b8b --- /dev/null +++ b/vendor/github.com/mattn/go-colorable/.travis.yml @@ -0,0 +1,8 @@ +language: go +go: + - tip + +sudo: false + +script: + - go test -v diff --git a/vendor/github.com/mattn/go-colorable/README.md b/vendor/github.com/mattn/go-colorable/README.md new file mode 100644 index 00000000..e84226a7 --- /dev/null +++ b/vendor/github.com/mattn/go-colorable/README.md @@ -0,0 +1,43 @@ +# go-colorable + +Colorable writer for windows. + +For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) +This package is possible to handle escape sequence for ansi color on windows. + +## Too Bad! + +![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) + + +## So Good! + +![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) + +## Usage + +```go +logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) +logrus.SetOutput(colorable.NewColorableStdout()) + +logrus.Info("succeeded") +logrus.Warn("not correct") +logrus.Error("something error") +logrus.Fatal("panic") +``` + +You can compile above code on non-windows OSs. + +## Installation + +``` +$ go get github.com/mattn/go-colorable +``` + +# License + +MIT + +# Author + +Yasuhiro Matsumoto (a.k.a mattn) diff --git a/vendor/github.com/mattn/go-isatty/.travis.yml b/vendor/github.com/mattn/go-isatty/.travis.yml new file mode 100644 index 00000000..b8111d67 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/.travis.yml @@ -0,0 +1,8 @@ +language: go +go: + - tip +before_install: + - go get github.com/mattn/goveralls + - go get golang.org/x/tools/cmd/cover +script: + - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5 diff --git a/vendor/github.com/mattn/go-isatty/README.md b/vendor/github.com/mattn/go-isatty/README.md new file mode 100644 index 00000000..8e4365f4 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/README.md @@ -0,0 +1,47 @@ +# go-isatty + +[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) + +isatty for golang + +## Usage + +```go +package main + +import ( + "fmt" + "github.com/mattn/go-isatty" + "os" +) + +func main() { + if isatty.IsTerminal(os.Stdout.Fd()) { + fmt.Println("Is Terminal") + } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { + fmt.Println("Is Cygwin/MSYS2 Terminal") + } else { + fmt.Println("Is Not Terminal") + } +} +``` + +## Installation + +``` +$ go get github.com/mattn/go-isatty +``` + +## License + +MIT + +## Author + +Yasuhiro Matsumoto (a.k.a mattn) + +## Thanks + +* k-takata: base idea for IsCygwinTerminal + + https://github.com/k-takata/go-iscygpty diff --git a/vendor/github.com/mgutz/ansi/.gitignore b/vendor/github.com/mgutz/ansi/.gitignore new file mode 100644 index 00000000..9ed3b07c --- /dev/null +++ b/vendor/github.com/mgutz/ansi/.gitignore @@ -0,0 +1 @@ +*.test diff --git a/vendor/github.com/mgutz/ansi/README.md b/vendor/github.com/mgutz/ansi/README.md new file mode 100644 index 00000000..8f8e20b7 --- /dev/null +++ b/vendor/github.com/mgutz/ansi/README.md @@ -0,0 +1,121 @@ +# ansi + +Package ansi is a small, fast library to create ANSI colored strings and codes. + +## Install + +Get it + +```sh +go get -u github.com/mgutz/ansi +``` + +## Example + +```go +import "github.com/mgutz/ansi" + +// colorize a string, SLOW +msg := ansi.Color("foo", "red+b:white") + +// create a FAST closure function to avoid computation of ANSI code +phosphorize := ansi.ColorFunc("green+h:black") +msg = phosphorize("Bring back the 80s!") +msg2 := phospohorize("Look, I'm a CRT!") + +// cache escape codes and build strings manually +lime := ansi.ColorCode("green+h:black") +reset := ansi.ColorCode("reset") + +fmt.Println(lime, "Bring back the 80s!", reset) +``` + +Other examples + +```go +Color(s, "red") // red +Color(s, "red+b") // red bold +Color(s, "red+B") // red blinking +Color(s, "red+u") // red underline +Color(s, "red+bh") // red bold bright +Color(s, "red:white") // red on white +Color(s, "red+b:white+h") // red bold on white bright +Color(s, "red+B:white+h") // red blink on white bright +Color(s, "off") // turn off ansi codes +``` + +To view color combinations, from project directory in terminal. + +```sh +go test +``` + +## Style format + +```go +"foregroundColor+attributes:backgroundColor+attributes" +``` + +Colors + +* black +* red +* green +* yellow +* blue +* magenta +* cyan +* white +* 0...255 (256 colors) + +Foreground Attributes + +* B = Blink +* b = bold +* h = high intensity (bright) +* i = inverse +* s = strikethrough +* u = underline + +Background Attributes + +* h = high intensity (bright) + +## Constants + +* ansi.Reset +* ansi.DefaultBG +* ansi.DefaultFG +* ansi.Black +* ansi.Red +* ansi.Green +* ansi.Yellow +* ansi.Blue +* ansi.Magenta +* ansi.Cyan +* ansi.White +* ansi.LightBlack +* ansi.LightRed +* ansi.LightGreen +* ansi.LightYellow +* ansi.LightBlue +* ansi.LightMagenta +* ansi.LightCyan +* ansi.LightWhite + +## References + +Wikipedia ANSI escape codes [Colors](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) + +General [tips and formatting](http://misc.flogisoft.com/bash/tip_colors_and_formatting) + +What about support on Windows? Use [colorable by mattn](https://github.com/mattn/go-colorable). +Ansi and colorable are used by [logxi](https://github.com/mgutz/logxi) to support logging in +color on Windows. + +## MIT License + +Copyright (c) 2013 Mario Gutierrez mario@mgutz.com + +See the file LICENSE for copying permission. + diff --git a/vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go b/vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go deleted file mode 100644 index 736b45dd..00000000 --- a/vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go +++ /dev/null @@ -1,135 +0,0 @@ -package main - -import ( - "fmt" - "sort" - "strconv" - - "github.com/mattn/go-colorable" - "github.com/mgutz/ansi" -) - -func main() { - printColors() - print256Colors() - printConstants() -} - -func pad(s string, length int) string { - for len(s) < length { - s += " " - } - return s -} - -func padColor(s string, styles []string) string { - buffer := "" - for _, style := range styles { - buffer += ansi.Color(pad(s+style, 20), s+style) - } - return buffer -} - -func printPlain() { - ansi.DisableColors(true) - bgColors := []string{ - "", - ":black", - ":red", - ":green", - ":yellow", - ":blue", - ":magenta", - ":cyan", - ":white", - } - for fg := range ansi.Colors { - for _, bg := range bgColors { - println(padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg})) - println(padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h"})) - println(padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"})) - } - } -} - -func printColors() { - ansi.DisableColors(false) - stdout := colorable.NewColorableStdout() - - bgColors := []string{ - "", - ":black", - ":red", - ":green", - ":yellow", - ":blue", - ":magenta", - ":cyan", - ":white", - } - - keys := []string{} - for fg := range ansi.Colors { - _, err := strconv.Atoi(fg) - if err != nil { - keys = append(keys, fg) - } - } - sort.Strings(keys) - - for _, fg := range keys { - for _, bg := range bgColors { - fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg})) - fmt.Fprintln(stdout, padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h", "+s" + bg})) - fmt.Fprintln(stdout, padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"})) - } - } -} - -func print256Colors() { - ansi.DisableColors(false) - stdout := colorable.NewColorableStdout() - - bgColors := []string{""} - for i := 0; i < 256; i++ { - key := fmt.Sprintf(":%d", i) - bgColors = append(bgColors, key) - } - - keys := []string{} - for fg := range ansi.Colors { - n, err := strconv.Atoi(fg) - if err == nil { - keys = append(keys, fmt.Sprintf("%3d", n)) - } - } - sort.Strings(keys) - - for _, fg := range keys { - for _, bg := range bgColors { - fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+u" + bg})) - fmt.Fprintln(stdout, padColor(fg, []string{"+B" + bg, "+Bb" + bg, "+s" + bg})) - } - } -} - -func printConstants() { - stdout := colorable.NewColorableStdout() - fmt.Fprintln(stdout, ansi.DefaultFG, "ansi.DefaultFG", ansi.Reset) - fmt.Fprintln(stdout, ansi.Black, "ansi.Black", ansi.Reset) - fmt.Fprintln(stdout, ansi.Red, "ansi.Red", ansi.Reset) - fmt.Fprintln(stdout, ansi.Green, "ansi.Green", ansi.Reset) - fmt.Fprintln(stdout, ansi.Yellow, "ansi.Yellow", ansi.Reset) - fmt.Fprintln(stdout, ansi.Blue, "ansi.Blue", ansi.Reset) - fmt.Fprintln(stdout, ansi.Magenta, "ansi.Magenta", ansi.Reset) - fmt.Fprintln(stdout, ansi.Cyan, "ansi.Cyan", ansi.Reset) - fmt.Fprintln(stdout, ansi.White, "ansi.White", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightBlack, "ansi.LightBlack", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightRed, "ansi.LightRed", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightGreen, "ansi.LightGreen", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightYellow, "ansi.LightYellow", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightBlue, "ansi.LightBlue", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightMagenta, "ansi.LightMagenta", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightCyan, "ansi.LightCyan", ansi.Reset) - fmt.Fprintln(stdout, ansi.LightWhite, "ansi.LightWhite", ansi.Reset) -} diff --git a/vendor/github.com/mitchellh/mapstructure/.travis.yml b/vendor/github.com/mitchellh/mapstructure/.travis.yml new file mode 100644 index 00000000..d9deadb8 --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/.travis.yml @@ -0,0 +1,8 @@ +language: go + +go: + - 1.9.x + - tip + +script: + - go test diff --git a/vendor/github.com/mitchellh/mapstructure/README.md b/vendor/github.com/mitchellh/mapstructure/README.md new file mode 100644 index 00000000..0018dc7d --- /dev/null +++ b/vendor/github.com/mitchellh/mapstructure/README.md @@ -0,0 +1,46 @@ +# mapstructure [![Godoc](https://godoc.org/github.com/mitchellh/mapstructure?status.svg)](https://godoc.org/github.com/mitchellh/mapstructure) + +mapstructure is a Go library for decoding generic map values to structures +and vice versa, while providing helpful error handling. + +This library is most useful when decoding values from some data stream (JSON, +Gob, etc.) where you don't _quite_ know the structure of the underlying data +until you read a part of it. You can therefore read a `map[string]interface{}` +and use this library to decode it into the proper underlying native Go +structure. + +## Installation + +Standard `go get`: + +``` +$ go get github.com/mitchellh/mapstructure +``` + +## Usage & Example + +For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). + +The `Decode` function has examples associated with it there. + +## But Why?! + +Go offers fantastic standard libraries for decoding formats such as JSON. +The standard method is to have a struct pre-created, and populate that struct +from the bytes of the encoded format. This is great, but the problem is if +you have configuration or an encoding that changes slightly depending on +specific fields. For example, consider this JSON: + +```json +{ + "type": "person", + "name": "Mitchell" +} +``` + +Perhaps we can't populate a specific structure without first reading +the "type" field from the JSON. We could always do two passes over the +decoding of the JSON (reading the "type" first, and the rest later). +However, it is much simpler to just decode this into a `map[string]interface{}` +structure, read the "type" key, then use something like this library +to decode it into the proper structure. diff --git a/vendor/github.com/mreiferson/go-httpclient/.gitignore b/vendor/github.com/mreiferson/go-httpclient/.gitignore new file mode 100644 index 00000000..dbec55fb --- /dev/null +++ b/vendor/github.com/mreiferson/go-httpclient/.gitignore @@ -0,0 +1 @@ +*.sw[op] diff --git a/vendor/github.com/mreiferson/go-httpclient/.travis.yml b/vendor/github.com/mreiferson/go-httpclient/.travis.yml new file mode 100644 index 00000000..ba1b6b7f --- /dev/null +++ b/vendor/github.com/mreiferson/go-httpclient/.travis.yml @@ -0,0 +1,11 @@ +language: go +go: + - 1.1 +install: + - go get github.com/bmizerany/assert +script: + - pushd $TRAVIS_BUILD_DIR + - go test + - popd +notifications: + email: false diff --git a/vendor/github.com/mreiferson/go-httpclient/README.md b/vendor/github.com/mreiferson/go-httpclient/README.md new file mode 100644 index 00000000..6d0dbff9 --- /dev/null +++ b/vendor/github.com/mreiferson/go-httpclient/README.md @@ -0,0 +1,41 @@ +## go-httpclient + +**requires Go 1.1+** as of `v0.4.0` the API has been completely re-written for Go 1.1 (for a Go +1.0.x compatible release see [1adef50](https://github.com/mreiferson/go-httpclient/tree/1adef50)) + +[![Build +Status](https://secure.travis-ci.org/mreiferson/go-httpclient.png?branch=master)](http://travis-ci.org/mreiferson/go-httpclient) + +Provides an HTTP Transport that implements the `RoundTripper` interface and +can be used as a built in replacement for the standard library's, providing: + + * connection timeouts + * request timeouts + +This is a thin wrapper around `http.Transport` that sets dial timeouts and uses +Go's internal timer scheduler to call the Go 1.1+ `CancelRequest()` API. + +### Example + +```go +transport := &httpclient.Transport{ + ConnectTimeout: 1*time.Second, + RequestTimeout: 10*time.Second, + ResponseHeaderTimeout: 5*time.Second, +} +defer transport.Close() + +client := &http.Client{Transport: transport} +req, _ := http.NewRequest("GET", "http://127.0.0.1/test", nil) +resp, err := client.Do(req) +if err != nil { + return err +} +defer resp.Body.Close() +``` + +*Note:* you will want to re-use a single client object rather than creating one for each request, otherwise you will end up [leaking connections](https://code.google.com/p/go/issues/detail?id=4049#c3). + +### Reference Docs + +For API docs see [godoc](http://godoc.org/github.com/mreiferson/go-httpclient). diff --git a/vendor/github.com/mrexodia/wray/README.markdown b/vendor/github.com/mrexodia/wray/README.markdown new file mode 100644 index 00000000..64c1e833 --- /dev/null +++ b/vendor/github.com/mrexodia/wray/README.markdown @@ -0,0 +1,113 @@ +# Wray, faye client for Go + +Wray is a client for the [Faye](http://faye.jcoglan.com) publish-subscribe messaging service by [James Coglan](https://twitter.com/jcoglan). + +## Current status + +In progress. + +## Getting Started + +Wray is only a client for Faye. You will need to setup a server using Ruby or Node.js first. Instructions that can be found on the [Faye project pages](http://faye.jcoglan.com/). + +###Subscribing to channels + +``` +package main + +import "github.com/pythonandchips/wray" +import "fmt" + +func main() { + //register the types of transport you want available. Only long-polling is currently supported + wray.RegisterTransports([]gofaye.Transport{ &gofaye.HttpTransport{} }) + + //create a new client + client := wray.NewFayeClient("http://localhost:5000/faye") + + //subscribe to the channels you want to listen to + client.Subscribe("/foo", false, func(message wray.Message) { + fmt.Println("-------------------------------------------") + fmt.Println(message.Data) + }) + + //wildcards can be used to subscribe to multipule channels + client.Subscribe("/foo/*", false, func(message wray.Message) { + fmt.Println("-------------------------------------------") + fmt.Println(message.Data) + }) + + //start listening on all subscribed channels and hold the process open + client.Listen() +} +``` + +###Publishing to channels +``` +package main + +import "github.com/pythonandchips/wray" +import "fmt" + +func main() { + //register the types of transport you want available. Only long-polling is currently supported + wray.RegisterTransports([]wray.Transport{ &gofaye.HttpTransport{} }) + + //create a new client + client := wray.NewFayeClient("http://localhost:5000/faye") + + params := map[string]interface{}{"hello": "from golang"} + + //send message to server + client.Publish("/foo", params) +} +``` + +Simple examples are availabe in the examples folder. + +##Future Work +There is still a lot to do to bring Wray in line with Faye functionality. This is a less than exhaustive list of work to be completed:- + +- web socket support +- eventsource support +- logging +- middleware additions +- correctly handle disconnect and server down +- promises for subscription and publishing +- automated integrations test to ensure Wray continues to work with Faye + +## Bugs/Features/Prase + +It you find any bugs or have some feature requests please add an issue on the repository. Or if you just want to get in touch and tell me how awesome wray is you can get me on twitter @colin_gemmell or drop me an email at pythonandchips{at}gmail.com. + +## Contributing to Wray + +* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet +* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it +* Fork the project +* Start a feature/bugfix branch +* Commit and push until you are happy with your contribution +* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. + +## Copyright + +Copyright (c) 2014 Colin Gemmell + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/mrexodia/wray/examples/client.go b/vendor/github.com/mrexodia/wray/examples/client.go deleted file mode 100644 index 50edf446..00000000 --- a/vendor/github.com/mrexodia/wray/examples/client.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import "github.com/pythonandchips/wray" -import "fmt" - -func main() { - wray.RegisterTransports([]wray.Transport{&wray.HttpTransport{}}) - client := wray.NewFayeClient("http://localhost:5000/faye") - - fmt.Println("subscribing") - client.Subscribe("/foo", false, func(message wray.Message) { - fmt.Println("-------------------------------------------") - fmt.Println(message.Data) - }) - - client.Listen() -} diff --git a/vendor/github.com/mrexodia/wray/examples/publish.go b/vendor/github.com/mrexodia/wray/examples/publish.go deleted file mode 100644 index 9a08a376..00000000 --- a/vendor/github.com/mrexodia/wray/examples/publish.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import "github.com/pythonandchips/wray" -import "fmt" - -func main() { - wray.RegisterTransports([]wray.Transport{ &gofaye.HttpTransport{} }) - client := wray.NewFayeClient("http://localhost:5000/faye") - - params := map[string]interface{}{"hello": "from golang"} - fmt.Println("sending") - client.Publish("/foo", params) -} - - diff --git a/vendor/github.com/nicksnyder/go-i18n/LICENSE b/vendor/github.com/nicksnyder/go-i18n/LICENSE new file mode 100644 index 00000000..609cce79 --- /dev/null +++ b/vendor/github.com/nicksnyder/go-i18n/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE b/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE deleted file mode 100644 index 609cce79..00000000 --- a/vendor/github.com/nicksnyder/go-i18n/i18n/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go b/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go deleted file mode 100644 index 5d6b6ad4..00000000 --- a/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/main.go +++ /dev/null @@ -1,132 +0,0 @@ -package main - -import ( - "encoding/xml" - "flag" - "fmt" - "io/ioutil" - "os" - "text/template" -) - -var usage = `%[1]s generates Go code to support CLDR plural rules. - -Usage: %[1]s [options] - -Options: - -` - -func main() { - flag.Usage = func() { - fmt.Fprintf(os.Stderr, usage, os.Args[0]) - flag.PrintDefaults() - } - var in, cout, tout string - flag.StringVar(&in, "i", "plurals.xml", "the input XML file containing CLDR plural rules") - flag.StringVar(&cout, "cout", "", "the code output file") - flag.StringVar(&tout, "tout", "", "the test output file") - flag.BoolVar(&verbose, "v", false, "verbose output") - flag.Parse() - - buf, err := ioutil.ReadFile(in) - if err != nil { - fatalf("failed to read file: %s", err) - } - - var data SupplementalData - if err := xml.Unmarshal(buf, &data); err != nil { - fatalf("failed to unmarshal xml: %s", err) - } - - count := 0 - for _, pg := range data.PluralGroups { - count += len(pg.SplitLocales()) - } - infof("parsed %d locales", count) - - if cout != "" { - file := openWritableFile(cout) - if err := codeTemplate.Execute(file, data); err != nil { - fatalf("unable to execute code template because %s", err) - } else { - infof("generated %s", cout) - } - } else { - infof("not generating code file (use -cout)") - } - - if tout != "" { - file := openWritableFile(tout) - if err := testTemplate.Execute(file, data); err != nil { - fatalf("unable to execute test template because %s", err) - } else { - infof("generated %s", tout) - } - } else { - infof("not generating test file (use -tout)") - } -} - -func openWritableFile(name string) *os.File { - file, err := os.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) - if err != nil { - fatalf("failed to write file %s because %s", name, err) - } - return file -} - -var codeTemplate = template.Must(template.New("spec").Parse(`package language -// This file is generated by i18n/language/codegen/generate.sh - -func init() { -{{range .PluralGroups}} - registerPluralSpec({{printf "%#v" .SplitLocales}}, &PluralSpec{ - Plurals: newPluralSet({{range $i, $e := .PluralRules}}{{if $i}}, {{end}}{{$e.CountTitle}}{{end}}), - PluralFunc: func(ops *operands) Plural { {{range .PluralRules}}{{if .GoCondition}} - // {{.Condition}} - if {{.GoCondition}} { - return {{.CountTitle}} - }{{end}}{{end}} - return Other - }, - }){{end}} -} -`)) - -var testTemplate = template.Must(template.New("spec").Parse(`package language -// This file is generated by i18n/language/codegen/generate.sh - -import "testing" - -{{range .PluralGroups}} -func Test{{.Name}}(t *testing.T) { - var tests []pluralTest - {{range .PluralRules}} - {{if .IntegerExamples}}tests = appendIntegerTests(tests, {{.CountTitle}}, {{printf "%#v" .IntegerExamples}}){{end}} - {{if .DecimalExamples}}tests = appendDecimalTests(tests, {{.CountTitle}}, {{printf "%#v" .DecimalExamples}}){{end}} - {{end}} - locales := {{printf "%#v" .SplitLocales}} - for _, locale := range locales { - runTests(t, locale, tests) - } -} -{{end}} -`)) - -func infof(format string, args ...interface{}) { - fmt.Fprintf(os.Stderr, format+"\n", args...) -} - -var verbose bool - -func verbosef(format string, args ...interface{}) { - if verbose { - infof(format, args...) - } -} - -func fatalf(format string, args ...interface{}) { - infof("fatal: "+format+"\n", args...) - os.Exit(1) -} diff --git a/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go b/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go deleted file mode 100644 index 9d39053c..00000000 --- a/vendor/github.com/nicksnyder/go-i18n/i18n/language/codegen/xml.go +++ /dev/null @@ -1,143 +0,0 @@ -package main - -import ( - "encoding/xml" - "fmt" - "regexp" - "strings" -) - -// SupplementalData is the top level struct of plural.xml -type SupplementalData struct { - XMLName xml.Name `xml:"supplementalData"` - PluralGroups []PluralGroup `xml:"plurals>pluralRules"` -} - -// PluralGroup is a group of locales with the same plural rules. -type PluralGroup struct { - Locales string `xml:"locales,attr"` - PluralRules []PluralRule `xml:"pluralRule"` -} - -// Name returns a unique name for this plural group. -func (pg *PluralGroup) Name() string { - n := strings.Title(pg.Locales) - return strings.Replace(n, " ", "", -1) -} - -// SplitLocales returns all the locales in the PluralGroup as a slice. -func (pg *PluralGroup) SplitLocales() []string { - return strings.Split(pg.Locales, " ") -} - -// PluralRule is the rule for a single plural form. -type PluralRule struct { - Count string `xml:"count,attr"` - Rule string `xml:",innerxml"` -} - -// CountTitle returns the title case of the PluralRule's count. -func (pr *PluralRule) CountTitle() string { - return strings.Title(pr.Count) -} - -// Condition returns the condition where the PluralRule applies. -func (pr *PluralRule) Condition() string { - i := strings.Index(pr.Rule, "@") - return pr.Rule[:i] -} - -// Examples returns the integer and decimal exmaples for the PLuralRule. -func (pr *PluralRule) Examples() (integer []string, decimal []string) { - ex := strings.Replace(pr.Rule, ", …", "", -1) - ddelim := "@decimal" - if i := strings.Index(ex, ddelim); i > 0 { - dex := strings.TrimSpace(ex[i+len(ddelim):]) - decimal = strings.Split(dex, ", ") - ex = ex[:i] - } - idelim := "@integer" - if i := strings.Index(ex, idelim); i > 0 { - iex := strings.TrimSpace(ex[i+len(idelim):]) - integer = strings.Split(iex, ", ") - } - return integer, decimal -} - -// IntegerExamples returns the integer exmaples for the PLuralRule. -func (pr *PluralRule) IntegerExamples() []string { - integer, _ := pr.Examples() - return integer -} - -// DecimalExamples returns the decimal exmaples for the PLuralRule. -func (pr *PluralRule) DecimalExamples() []string { - _, decimal := pr.Examples() - return decimal -} - -var relationRegexp = regexp.MustCompile("([niftvw])(?: % ([0-9]+))? (!=|=)(.*)") - -// GoCondition converts the XML condition to valid Go code. -func (pr *PluralRule) GoCondition() string { - var ors []string - for _, and := range strings.Split(pr.Condition(), "or") { - var ands []string - for _, relation := range strings.Split(and, "and") { - parts := relationRegexp.FindStringSubmatch(relation) - if parts == nil { - continue - } - lvar, lmod, op, rhs := strings.Title(parts[1]), parts[2], parts[3], strings.TrimSpace(parts[4]) - if op == "=" { - op = "==" - } - lvar = "ops." + lvar - var rhor []string - var rany []string - for _, rh := range strings.Split(rhs, ",") { - if parts := strings.Split(rh, ".."); len(parts) == 2 { - from, to := parts[0], parts[1] - if lvar == "ops.N" { - if lmod != "" { - rhor = append(rhor, fmt.Sprintf("ops.NmodInRange(%s, %s, %s)", lmod, from, to)) - } else { - rhor = append(rhor, fmt.Sprintf("ops.NinRange(%s, %s)", from, to)) - } - } else if lmod != "" { - rhor = append(rhor, fmt.Sprintf("intInRange(%s %% %s, %s, %s)", lvar, lmod, from, to)) - } else { - rhor = append(rhor, fmt.Sprintf("intInRange(%s, %s, %s)", lvar, from, to)) - } - } else { - rany = append(rany, rh) - } - } - - if len(rany) > 0 { - rh := strings.Join(rany, ",") - if lvar == "ops.N" { - if lmod != "" { - rhor = append(rhor, fmt.Sprintf("ops.NmodEqualsAny(%s, %s)", lmod, rh)) - } else { - rhor = append(rhor, fmt.Sprintf("ops.NequalsAny(%s)", rh)) - } - } else if lmod != "" { - rhor = append(rhor, fmt.Sprintf("intEqualsAny(%s %% %s, %s)", lvar, lmod, rh)) - } else { - rhor = append(rhor, fmt.Sprintf("intEqualsAny(%s, %s)", lvar, rh)) - } - } - r := strings.Join(rhor, " || ") - if len(rhor) > 1 { - r = "(" + r + ")" - } - if op == "!=" { - r = "!" + r - } - ands = append(ands, r) - } - ors = append(ors, strings.Join(ands, " && ")) - } - return strings.Join(ors, " ||\n") -} diff --git a/vendor/github.com/nlopes/slack/.gitignore b/vendor/github.com/nlopes/slack/.gitignore new file mode 100644 index 00000000..dd2440d5 --- /dev/null +++ b/vendor/github.com/nlopes/slack/.gitignore @@ -0,0 +1,2 @@ +*.test +*~ diff --git a/vendor/github.com/nlopes/slack/.travis.yml b/vendor/github.com/nlopes/slack/.travis.yml new file mode 100644 index 00000000..bd0539e0 --- /dev/null +++ b/vendor/github.com/nlopes/slack/.travis.yml @@ -0,0 +1,21 @@ +language: go + +go: + - 1.7.x + - 1.8.x + - 1.9.x + - tip + +before_install: + - export PATH=$HOME/gopath/bin:$PATH + +script: + - go test -race ./... + - go test -cover ./... + +matrix: + allow_failures: + - go: tip + +git: + depth: 10 diff --git a/vendor/github.com/nlopes/slack/CHANGELOG.md b/vendor/github.com/nlopes/slack/CHANGELOG.md new file mode 100644 index 00000000..8c4772da --- /dev/null +++ b/vendor/github.com/nlopes/slack/CHANGELOG.md @@ -0,0 +1,12 @@ +### v0.1.0 - May 28, 2017 + +This is released before adding context support. +As the used context package is the one from Go 1.7 this will be the last +compatible with Go < 1.7. + +Please check [0.1.0](https://github.com/nlopes/slack/releases/tag/v0.1.0) + +### v0.0.1 - Jul 26, 2015 + +If you just updated from master and it broke your implementation, please +check [0.0.1](https://github.com/nlopes/slack/releases/tag/v0.0.1) diff --git a/vendor/github.com/nlopes/slack/README.md b/vendor/github.com/nlopes/slack/README.md new file mode 100644 index 00000000..953b9d8f --- /dev/null +++ b/vendor/github.com/nlopes/slack/README.md @@ -0,0 +1,89 @@ +Slack API in Go [![GoDoc](https://godoc.org/github.com/nlopes/slack?status.svg)](https://godoc.org/github.com/nlopes/slack) [![Build Status](https://travis-ci.org/nlopes/slack.svg)](https://travis-ci.org/nlopes/slack) +=============== + +[![Join the chat at https://gitter.im/go-slack/Lobby](https://badges.gitter.im/go-slack/Lobby.svg)](https://gitter.im/go-slack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +This library supports most if not all of the `api.slack.com` REST +calls, as well as the Real-Time Messaging protocol over websocket, in +a fully managed way. + +## Change log + +### v0.1.0 - May 28, 2017 + +This is released before adding context support. +As the used context package is the one from Go 1.7 this will be the last +compatible with Go < 1.7. + +Please check [0.1.0](https://github.com/nlopes/slack/releases/tag/v0.1.0) + +### CHANGELOG.md + +As of this version a [CHANGELOG.md](https://github.com/nlopes/slack/blob/master/CHANGELOG.md) is available. Please visit it for updates. + +## Installing + +### *go get* + + $ go get -u github.com/nlopes/slack + +## Example + +### Getting all groups + +```golang +import ( + "fmt" + + "github.com/nlopes/slack" +) + +func main() { + api := slack.New("YOUR_TOKEN_HERE") + // If you set debugging, it will log all requests to the console + // Useful when encountering issues + // api.SetDebug(true) + groups, err := api.GetGroups(false) + if err != nil { + fmt.Printf("%s\n", err) + return + } + for _, group := range groups { + fmt.Printf("ID: %s, Name: %s\n", group.ID, group.Name) + } +} +``` + +### Getting User Information + +```golang +import ( + "fmt" + + "github.com/nlopes/slack" +) + +func main() { + api := slack.New("YOUR_TOKEN_HERE") + user, err := api.GetUserInfo("U023BECGF") + if err != nil { + fmt.Printf("%s\n", err) + return + } + fmt.Printf("ID: %s, Fullname: %s, Email: %s\n", user.ID, user.Profile.RealName, user.Profile.Email) +} +``` + +## Minimal RTM usage: + +See https://github.com/nlopes/slack/blob/master/examples/websocket/websocket.go + + +## Contributing + +You are more than welcome to contribute to this project. Fork and +make a Pull Request, or create an Issue if you see any problem. + +## License + +BSD 2 Clause license diff --git a/vendor/github.com/nlopes/slack/TODO.txt b/vendor/github.com/nlopes/slack/TODO.txt new file mode 100644 index 00000000..8607960b --- /dev/null +++ b/vendor/github.com/nlopes/slack/TODO.txt @@ -0,0 +1,3 @@ +- Add more tests!!! +- Add support to have markdown hints + - See section Message Formatting at https://api.slack.com/docs/formatting diff --git a/vendor/github.com/nlopes/slack/examples/channels/channels.go b/vendor/github.com/nlopes/slack/examples/channels/channels.go deleted file mode 100644 index 37d5f741..00000000 --- a/vendor/github.com/nlopes/slack/examples/channels/channels.go +++ /dev/null @@ -1,21 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - channels, err := api.GetChannels(false) - if err != nil { - fmt.Printf("%s\n", err) - return - } - for _, channel := range channels { - fmt.Println(channel.Name) - // channel is of type conversation & groupConversation - // see all available methods in `conversation.go` - } -} diff --git a/vendor/github.com/nlopes/slack/examples/files/files.go b/vendor/github.com/nlopes/slack/examples/files/files.go deleted file mode 100644 index bb7b4e50..00000000 --- a/vendor/github.com/nlopes/slack/examples/files/files.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - params := slack.FileUploadParameters{ - Title: "Batman Example", - //Filetype: "txt", - File: "example.txt", - //Content: "Nan Nan Nan Nan Nan Nan Nan Nan Batman", - } - file, err := api.UploadFile(params) - if err != nil { - fmt.Printf("%s\n", err) - return - } - fmt.Printf("Name: %s, URL: %s\n", file.Name, file.URL) - - err = api.DeleteFile(file.ID) - if err != nil { - fmt.Printf("%s\n", err) - return - } - fmt.Printf("File %s deleted successfully.\n", file.Name) -} diff --git a/vendor/github.com/nlopes/slack/examples/groups/groups.go b/vendor/github.com/nlopes/slack/examples/groups/groups.go deleted file mode 100644 index 2af215d1..00000000 --- a/vendor/github.com/nlopes/slack/examples/groups/groups.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - // If you set debugging, it will log all requests to the console - // Useful when encountering issues - // api.SetDebug(true) - groups, err := api.GetGroups(false) - if err != nil { - fmt.Printf("%s\n", err) - return - } - for _, group := range groups { - fmt.Printf("ID: %s, Name: %s\n", group.ID, group.Name) - } -} diff --git a/vendor/github.com/nlopes/slack/examples/ims/ims.go b/vendor/github.com/nlopes/slack/examples/ims/ims.go deleted file mode 100644 index 80d73c0a..00000000 --- a/vendor/github.com/nlopes/slack/examples/ims/ims.go +++ /dev/null @@ -1,21 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - - userID := "USER_ID" - - _, _, channelID, err := api.OpenIMChannel(userID) - - if err != nil { - fmt.Printf("%s\n", err) - } - - api.PostMessage(channelID, "Hello World!", slack.PostMessageParameters{}) -} diff --git a/vendor/github.com/nlopes/slack/examples/messages/messages.go b/vendor/github.com/nlopes/slack/examples/messages/messages.go deleted file mode 100644 index b3ea87f3..00000000 --- a/vendor/github.com/nlopes/slack/examples/messages/messages.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - params := slack.PostMessageParameters{} - attachment := slack.Attachment{ - Pretext: "some pretext", - Text: "some text", - // Uncomment the following part to send a field too - /* - Fields: []slack.AttachmentField{ - slack.AttachmentField{ - Title: "a", - Value: "no", - }, - }, - */ - } - params.Attachments = []slack.Attachment{attachment} - channelID, timestamp, err := api.PostMessage("CHANNEL_ID", "Some text", params) - if err != nil { - fmt.Printf("%s\n", err) - return - } - fmt.Printf("Message successfully sent to channel %s at %s", channelID, timestamp) -} diff --git a/vendor/github.com/nlopes/slack/examples/pins/pins.go b/vendor/github.com/nlopes/slack/examples/pins/pins.go deleted file mode 100644 index d225184c..00000000 --- a/vendor/github.com/nlopes/slack/examples/pins/pins.go +++ /dev/null @@ -1,123 +0,0 @@ -package main - -import ( - "flag" - "fmt" - - "github.com/nlopes/slack" -) - -/* - WARNING: This example is destructive in the sense that it create a channel called testpinning -*/ -func main() { - var ( - apiToken string - debug bool - ) - - flag.StringVar(&apiToken, "token", "YOUR_TOKEN_HERE", "Your Slack API Token") - flag.BoolVar(&debug, "debug", false, "Show JSON output") - flag.Parse() - - api := slack.New(apiToken) - if debug { - api.SetDebug(true) - } - - var ( - postAsUserName string - postAsUserID string - postToChannelID string - ) - - // Find the user to post as. - authTest, err := api.AuthTest() - if err != nil { - fmt.Printf("Error getting channels: %s\n", err) - return - } - - channelName := "testpinning" - - // Post as the authenticated user. - postAsUserName = authTest.User - postAsUserID = authTest.UserID - - // Create a temporary channel - channel, err := api.CreateChannel(channelName) - - if err != nil { - // If the channel exists, that means we just need to unarchive it - if err.Error() == "name_taken" { - err = nil - channels, err := api.GetChannels(false) - if err != nil { - fmt.Println("Could not retrieve channels") - return - } - for _, archivedChannel := range channels { - if archivedChannel.Name == channelName { - if archivedChannel.IsArchived { - err = api.UnarchiveChannel(archivedChannel.ID) - if err != nil { - fmt.Printf("Could not unarchive %s: %s\n", archivedChannel.ID, err) - return - } - } - channel = &archivedChannel - break - } - } - } - if err != nil { - fmt.Printf("Error setting test channel for pinning: %s\n", err) - return - } - } - postToChannelID = channel.ID - - fmt.Printf("Posting as %s (%s) in channel %s\n", postAsUserName, postAsUserID, postToChannelID) - - // Post a message. - postParams := slack.PostMessageParameters{} - channelID, timestamp, err := api.PostMessage(postToChannelID, "Is this any good?", postParams) - if err != nil { - fmt.Printf("Error posting message: %s\n", err) - return - } - - // Grab a reference to the message. - msgRef := slack.NewRefToMessage(channelID, timestamp) - - // Add message pin to channel - if err := api.AddPin(channelID, msgRef); err != nil { - fmt.Printf("Error adding pin: %s\n", err) - return - } - - // List all of the users pins. - listPins, _, err := api.ListPins(channelID) - if err != nil { - fmt.Printf("Error listing pins: %s\n", err) - return - } - fmt.Printf("\n") - fmt.Printf("All pins by %s...\n", authTest.User) - for _, item := range listPins { - fmt.Printf(" > Item type: %s\n", item.Type) - } - - // Remove the pin. - err = api.RemovePin(channelID, msgRef) - if err != nil { - fmt.Printf("Error remove pin: %s\n", err) - return - } - - if err = api.ArchiveChannel(channelID); err != nil { - fmt.Printf("Error archiving channel: %s\n", err) - return - } - -} diff --git a/vendor/github.com/nlopes/slack/examples/reactions/reactions.go b/vendor/github.com/nlopes/slack/examples/reactions/reactions.go deleted file mode 100644 index 753f0d25..00000000 --- a/vendor/github.com/nlopes/slack/examples/reactions/reactions.go +++ /dev/null @@ -1,126 +0,0 @@ -package main - -import ( - "flag" - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - var ( - apiToken string - debug bool - ) - - flag.StringVar(&apiToken, "token", "YOUR_TOKEN_HERE", "Your Slack API Token") - flag.BoolVar(&debug, "debug", false, "Show JSON output") - flag.Parse() - - api := slack.New(apiToken) - if debug { - api.SetDebug(true) - } - - var ( - postAsUserName string - postAsUserID string - postToUserName string - postToUserID string - postToChannelID string - ) - - // Find the user to post as. - authTest, err := api.AuthTest() - if err != nil { - fmt.Printf("Error getting channels: %s\n", err) - return - } - - // Post as the authenticated user. - postAsUserName = authTest.User - postAsUserID = authTest.UserID - - // Posting to DM with self causes a conversation with slackbot. - postToUserName = authTest.User - postToUserID = authTest.UserID - - // Find the channel. - _, _, chanID, err := api.OpenIMChannel(postToUserID) - if err != nil { - fmt.Printf("Error opening IM: %s\n", err) - return - } - postToChannelID = chanID - - fmt.Printf("Posting as %s (%s) in DM with %s (%s), channel %s\n", postAsUserName, postAsUserID, postToUserName, postToUserID, postToChannelID) - - // Post a message. - postParams := slack.PostMessageParameters{} - channelID, timestamp, err := api.PostMessage(postToChannelID, "Is this any good?", postParams) - if err != nil { - fmt.Printf("Error posting message: %s\n", err) - return - } - - // Grab a reference to the message. - msgRef := slack.NewRefToMessage(channelID, timestamp) - - // React with :+1: - if err := api.AddReaction("+1", msgRef); err != nil { - fmt.Printf("Error adding reaction: %s\n", err) - return - } - - // React with :-1: - if err := api.AddReaction("cry", msgRef); err != nil { - fmt.Printf("Error adding reaction: %s\n", err) - return - } - - // Get all reactions on the message. - msgReactions, err := api.GetReactions(msgRef, slack.NewGetReactionsParameters()) - if err != nil { - fmt.Printf("Error getting reactions: %s\n", err) - return - } - fmt.Printf("\n") - fmt.Printf("%d reactions to message...\n", len(msgReactions)) - for _, r := range msgReactions { - fmt.Printf(" %d users say %s\n", r.Count, r.Name) - } - - // List all of the users reactions. - listReactions, _, err := api.ListReactions(slack.NewListReactionsParameters()) - if err != nil { - fmt.Printf("Error listing reactions: %s\n", err) - return - } - fmt.Printf("\n") - fmt.Printf("All reactions by %s...\n", authTest.User) - for _, item := range listReactions { - fmt.Printf("%d on a %s...\n", len(item.Reactions), item.Type) - for _, r := range item.Reactions { - fmt.Printf(" %s (along with %d others)\n", r.Name, r.Count-1) - } - } - - // Remove the :cry: reaction. - err = api.RemoveReaction("cry", msgRef) - if err != nil { - fmt.Printf("Error remove reaction: %s\n", err) - return - } - - // Get all reactions on the message. - msgReactions, err = api.GetReactions(msgRef, slack.NewGetReactionsParameters()) - if err != nil { - fmt.Printf("Error getting reactions: %s\n", err) - return - } - fmt.Printf("\n") - fmt.Printf("%d reactions to message after removing cry...\n", len(msgReactions)) - for _, r := range msgReactions { - fmt.Printf(" %d users say %s\n", r.Count, r.Name) - } -} diff --git a/vendor/github.com/nlopes/slack/examples/stars/stars.go b/vendor/github.com/nlopes/slack/examples/stars/stars.go deleted file mode 100644 index d20c3dcf..00000000 --- a/vendor/github.com/nlopes/slack/examples/stars/stars.go +++ /dev/null @@ -1,46 +0,0 @@ -package main - -import ( - "flag" - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - var ( - apiToken string - debug bool - ) - - flag.StringVar(&apiToken, "token", "YOUR_TOKEN_HERE", "Your Slack API Token") - flag.BoolVar(&debug, "debug", false, "Show JSON output") - flag.Parse() - - api := slack.New(apiToken) - if debug { - api.SetDebug(true) - } - - // Get all stars for the usr. - params := slack.NewStarsParameters() - starredItems, _, err := api.GetStarred(params) - if err != nil { - fmt.Printf("Error getting stars: %s\n", err) - return - } - for _, s := range starredItems { - var desc string - switch s.Type { - case slack.TYPE_MESSAGE: - desc = s.Message.Text - case slack.TYPE_FILE: - desc = s.File.Name - case slack.TYPE_FILE_COMMENT: - desc = s.File.Name + " - " + s.Comment.Comment - case slack.TYPE_CHANNEL, slack.TYPE_IM, slack.TYPE_GROUP: - desc = s.Channel - } - fmt.Printf("Starred %s: %s\n", s.Type, desc) - } -} diff --git a/vendor/github.com/nlopes/slack/examples/team/team.go b/vendor/github.com/nlopes/slack/examples/team/team.go deleted file mode 100644 index caaf79f6..00000000 --- a/vendor/github.com/nlopes/slack/examples/team/team.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - //Example for single user - billingActive, err := api.GetBillableInfo("U023BECGF") - if err != nil { - fmt.Printf("%s\n", err) - return - } - fmt.Printf("ID: U023BECGF, BillingActive: %v\n\n\n", billingActive["U023BECGF"]) - - //Example for team - billingActiveForTeam, _ := api.GetBillableInfoForTeam() - for id, value := range billingActiveForTeam { - fmt.Printf("ID: %v, BillingActive: %v\n", id, value) - } - -} diff --git a/vendor/github.com/nlopes/slack/examples/users/users.go b/vendor/github.com/nlopes/slack/examples/users/users.go deleted file mode 100644 index 9a6e1f6f..00000000 --- a/vendor/github.com/nlopes/slack/examples/users/users.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR_TOKEN_HERE") - user, err := api.GetUserInfo("U023BECGF") - if err != nil { - fmt.Printf("%s\n", err) - return - } - fmt.Printf("ID: %s, Fullname: %s, Email: %s\n", user.ID, user.Profile.RealName, user.Profile.Email) -} diff --git a/vendor/github.com/nlopes/slack/examples/websocket/websocket.go b/vendor/github.com/nlopes/slack/examples/websocket/websocket.go deleted file mode 100644 index c232951a..00000000 --- a/vendor/github.com/nlopes/slack/examples/websocket/websocket.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - - "github.com/nlopes/slack" -) - -func main() { - api := slack.New("YOUR TOKEN HERE") - logger := log.New(os.Stdout, "slack-bot: ", log.Lshortfile|log.LstdFlags) - slack.SetLogger(logger) - api.SetDebug(true) - - rtm := api.NewRTM() - go rtm.ManageConnection() - - for msg := range rtm.IncomingEvents { - fmt.Print("Event Received: ") - switch ev := msg.Data.(type) { - case *slack.HelloEvent: - // Ignore hello - - case *slack.ConnectedEvent: - fmt.Println("Infos:", ev.Info) - fmt.Println("Connection counter:", ev.ConnectionCount) - // Replace C2147483705 with your Channel ID - rtm.SendMessage(rtm.NewOutgoingMessage("Hello world", "C2147483705")) - - case *slack.MessageEvent: - fmt.Printf("Message: %v\n", ev) - - case *slack.PresenceChangeEvent: - fmt.Printf("Presence Change: %v\n", ev) - - case *slack.LatencyReport: - fmt.Printf("Current latency: %v\n", ev.Value) - - case *slack.RTMError: - fmt.Printf("Error: %s\n", ev.Error()) - - case *slack.InvalidAuthEvent: - fmt.Printf("Invalid credentials") - return - - default: - - // Ignore other events.. - // fmt.Printf("Unexpected: %v\n", msg.Data) - } - } -} diff --git a/vendor/github.com/paulrosania/go-charset/charset/iconv/iconv.go b/vendor/github.com/paulrosania/go-charset/charset/iconv/iconv.go deleted file mode 100644 index f7187f5f..00000000 --- a/vendor/github.com/paulrosania/go-charset/charset/iconv/iconv.go +++ /dev/null @@ -1,184 +0,0 @@ -// The iconv package provides an interface to the GNU iconv character set -// conversion library (see http://www.gnu.org/software/libiconv/). -// It automatically registers all the character sets with the charset package, -// so it is usually used simply for the side effects of importing it. -// Example: -// import ( -// "go-charset.googlecode.com/hg/charset" -// _ "go-charset.googlecode.com/hg/charset/iconv" -// ) -package iconv - -//#cgo darwin LDFLAGS: -liconv -//#include -//#include -//#include -//iconv_t iconv_open_error = (iconv_t)-1; -//size_t iconv_error = (size_t)-1; -import "C" -import ( - "errors" - "fmt" - "github.com/paulrosania/go-charset/charset" - "runtime" - "strings" - "syscall" - "unicode/utf8" - "unsafe" -) - -type iconvTranslator struct { - cd C.iconv_t - invalid rune - scratch []byte -} - -func canonicalChar(c rune) rune { - if c >= 'a' && c <= 'z' { - return c - 'a' + 'A' - } - return c -} - -func canonicalName(s string) string { - return strings.Map(canonicalChar, s) -} - -func init() { - charset.Register(iconvFactory{}) -} - -type iconvFactory struct { -} - -func (iconvFactory) TranslatorFrom(name string) (charset.Translator, error) { - return Translator("UTF-8", name, utf8.RuneError) -} - -func (iconvFactory) TranslatorTo(name string) (charset.Translator, error) { - // BUG This is wrong. The target character set may not be ASCII - // compatible. There's no easy solution to this other than - // removing the offending code point. - return Translator(name, "UTF-8", '?') -} - -// Translator returns a Translator that translates between -// the named character sets. When an invalid multibyte -// character is found, the bytes in invalid are substituted instead. -func Translator(toCharset, fromCharset string, invalid rune) (charset.Translator, error) { - cto, cfrom := C.CString(toCharset), C.CString(fromCharset) - cd, err := C.iconv_open(cto, cfrom) - - C.free(unsafe.Pointer(cfrom)) - C.free(unsafe.Pointer(cto)) - - if cd == C.iconv_open_error { - if err == syscall.EINVAL { - return nil, errors.New("iconv: conversion not supported") - } - return nil, err - } - t := &iconvTranslator{cd: cd, invalid: invalid} - runtime.SetFinalizer(t, func(*iconvTranslator) { - C.iconv_close(cd) - }) - return t, nil -} - -func (iconvFactory) Names() []string { - all := aliases() - names := make([]string, 0, len(all)) - for name, aliases := range all { - if aliases[0] == name { - names = append(names, name) - } - } - return names -} - -func (iconvFactory) Info(name string) *charset.Charset { - name = strings.ToLower(name) - all := aliases() - a, ok := all[name] - if !ok { - return nil - } - return &charset.Charset{ - Name: name, - Aliases: a, - } -} - -func (p *iconvTranslator) Translate(data []byte, eof bool) (rn int, rd []byte, rerr error) { - n := 0 - p.scratch = p.scratch[:0] - for len(data) > 0 { - p.scratch = ensureCap(p.scratch, len(p.scratch)+len(data)*utf8.UTFMax) - cData := (*C.char)(unsafe.Pointer(&data[:1][0])) - nData := C.size_t(len(data)) - - ns := len(p.scratch) - cScratch := (*C.char)(unsafe.Pointer(&p.scratch[ns : ns+1][0])) - nScratch := C.size_t(cap(p.scratch) - ns) - r, err := C.iconv(p.cd, &cData, &nData, &cScratch, &nScratch) - - p.scratch = p.scratch[0 : cap(p.scratch)-int(nScratch)] - n += len(data) - int(nData) - data = data[len(data)-int(nData):] - - if r != C.iconv_error || err == nil { - return n, p.scratch, nil - } - switch err := err.(syscall.Errno); err { - case C.EILSEQ: - // invalid multibyte sequence - skip one byte and continue - p.scratch = appendRune(p.scratch, p.invalid) - n++ - data = data[1:] - case C.EINVAL: - // incomplete multibyte sequence - return n, p.scratch, nil - case C.E2BIG: - // output buffer not large enough; try again with larger buffer. - p.scratch = ensureCap(p.scratch, cap(p.scratch)+utf8.UTFMax) - default: - panic(fmt.Sprintf("unexpected error code: %v", err)) - } - } - return n, p.scratch, nil -} - -// ensureCap returns s with a capacity of at least n bytes. -// If cap(s) < n, then it returns a new copy of s with the -// required capacity. -func ensureCap(s []byte, n int) []byte { - if n <= cap(s) { - return s - } - // logic adapted from appendslice1 in runtime - m := cap(s) - if m == 0 { - m = n - } else { - for { - if m < 1024 { - m += m - } else { - m += m / 4 - } - if m >= n { - break - } - } - } - t := make([]byte, len(s), m) - copy(t, s) - return t -} - -func appendRune(buf []byte, r rune) []byte { - n := len(buf) - buf = ensureCap(buf, n+utf8.UTFMax) - nu := utf8.EncodeRune(buf[n:n+utf8.UTFMax], r) - return buf[0 : n+nu] -} diff --git a/vendor/github.com/paulrosania/go-charset/charset/iconv/list_query.go b/vendor/github.com/paulrosania/go-charset/charset/iconv/list_query.go deleted file mode 100644 index cda03270..00000000 --- a/vendor/github.com/paulrosania/go-charset/charset/iconv/list_query.go +++ /dev/null @@ -1,80 +0,0 @@ -// +build !linux -// This file is systemdependent because not all versions -// of iconv have the iconvlist function. - -package iconv - -//#cgo darwin LDFLAGS: -liconv -//#cgo freebsd LDFLAGS: -liconv -//#cgo windows LDFLAGS: -liconv -//#include -//#include -//#include -//#include -// -//typedef struct nameList nameList; -//struct nameList { -// int n; -// char **names; -// nameList *next; -//}; -// -//int -//addNames(unsigned int n, const char *const *names, void *data) { -// // we can't call back to Go because of the stack size issue, -// // so copy all the names. -// nameList *hd, *e; -// int i; -// -// hd = data; -// e = malloc(sizeof(nameList)); -// e->n = n; -// e->names = malloc(sizeof(char*) * n); -// for(i = 0; i < n; i++){ -// e->names[i] = strdup(names[i]); -// } -// e->next = hd->next; -// hd->next = e; -// return 0; -//} -// -//nameList * -//listNames(void) { -// nameList hd; -// hd.next = 0; -// iconvlist(addNames, &hd); -// return hd.next; -//} -import "C" - -import ( - "strings" - "sync" - "unsafe" -) - -var getAliasesOnce sync.Once -var allAliases = map[string][]string{} - -func aliases() map[string][]string { - getAliasesOnce.Do(getAliases) - return allAliases -} - -func getAliases() { - var next *C.nameList - for p := C.listNames(); p != nil; p = next { - next = p.next - aliases := make([]string, p.n) - pnames := (*[1e9]*C.char)(unsafe.Pointer(p.names)) - for i := range aliases { - aliases[i] = strings.ToLower(C.GoString(pnames[i])) - C.free(unsafe.Pointer(pnames[i])) - } - C.free(unsafe.Pointer(p.names)) - C.free(unsafe.Pointer(p)) - for _, alias := range aliases { - allAliases[alias] = aliases - } - } -} diff --git a/vendor/github.com/paulrosania/go-charset/charset/iconv/list_static.go b/vendor/github.com/paulrosania/go-charset/charset/iconv/list_static.go deleted file mode 100644 index edf9e28a..00000000 --- a/vendor/github.com/paulrosania/go-charset/charset/iconv/list_static.go +++ /dev/null @@ -1,176 +0,0 @@ -// +build linux - -// We just use a list of names obtained from iconv on a platform -// that allows iconvlist. We could invoke the iconv command, -// but that might fail too, and it gives no information about aliases. - -package iconv - -import ( - "sync" -) - -func aliases() map[string][]string { - initAliasesOnce.Do(initAliases) - return allAliases -} - -var initAliasesOnce sync.Once -var allAliases map[string][]string - -func initAliases() { - allAliases = make(map[string][]string) - for _, a := range aliasData { - for _, alias := range a { - allAliases[alias] = a - } - } -} - -var aliasData = [][]string{ - {"437", "cp437", "ibm437", "cspc8codepage437"}, - {"850", "cp850", "ibm850", "cspc850multilingual"}, - {"852", "cp852", "ibm852", "cspcp852"}, - {"855", "cp855", "ibm855", "csibm855"}, - {"857", "cp857", "ibm857", "csibm857"}, - {"860", "cp860", "ibm860", "csibm860"}, - {"861", "cp-is", "cp861", "ibm861", "csibm861"}, - {"862", "cp862", "ibm862", "cspc862latinhebrew"}, - {"863", "cp863", "ibm863", "csibm863"}, - {"865", "cp865", "ibm865", "csibm865"}, - {"866", "cp866", "ibm866", "csibm866"}, - {"869", "cp-gr", "cp869", "ibm869", "csibm869"}, - {"ansi-x3.4-1968", "ansi-x3.4-1986", "ascii", "cp367", "ibm367", "iso-ir-6", "iso646-us", "iso-646.irv:1991", "us", "us-ascii", "csascii"}, - {"arabic", "asmo-708", "ecma-114", "iso-8859-6", "iso-ir-127", "iso8859-6", "iso-8859-6", "iso-8859-6:1987", "csisolatinarabic"}, - {"armscii-8"}, - {"atari", "atarist"}, - {"big5-2003"}, - {"big-5", "big-five", "big5", "bigfive", "cn-big5", "csbig5"}, - {"big5-hkscs:1999"}, - {"big5-hkscs:2001"}, - {"big5-hkscs", "big5-hkscs:2004", "big5hkscs"}, - {"c99"}, - {"chinese", "gb-2312-80", "iso-ir-58", "csiso58gb231280"}, - {"cn", "gb-1988-80", "iso-ir-57", "iso646-cn", "csiso57gb1988"}, - {"cn-gb", "euc-cn", "euccn", "gb2312", "csgb2312"}, - {"cn-gb-isoir165", "iso-ir-165"}, - {"cp1046"}, - {"cp1124"}, - {"cp1125"}, - {"cp1129"}, - {"cp1131"}, - {"cp1133", "ibm-cp1133"}, - {"cp1161", "ibm-1161", "ibm1161", "csibm1161"}, - {"cp1162", "ibm-1162", "ibm1162", "csibm1162"}, - {"cp1163", "ibm-1163", "ibm1163", "csibm1163"}, - {"cp1250", "ms-ee", "windows-1250"}, - {"cp1251", "ms-cyrl", "windows-1251"}, - {"cp1252", "ms-ansi", "windows-1252"}, - {"cp1253", "ms-greek", "windows-1253"}, - {"cp1254", "ms-turk", "windows-1254"}, - {"cp1255", "ms-hebr", "windows-1255"}, - {"cp1256", "ms-arab", "windows-1256"}, - {"cp1257", "winbaltrim", "windows-1257"}, - {"cp1258", "windows-1258"}, - {"cp1361", "johab"}, - {"cp154", "cyrillic-asian", "pt154", "ptcp154", "csptcp154"}, - {"cp737"}, - {"cp775", "ibm775", "cspc775baltic"}, - {"cp819", "ibm819", "iso-8859-1", "iso-ir-100", "iso8859-1", "iso-8859-1", "iso-8859-1:1987", "l1", "latin1", "csisolatin1"}, - {"cp853"}, - {"cp856"}, - {"cp858"}, - {"cp864", "ibm864", "csibm864"}, - {"cp874", "windows-874"}, - {"cp922"}, - {"cp932"}, - {"cp936", "ms936", "windows-936"}, - {"cp943"}, - {"cp949", "uhc"}, - {"cp950"}, - {"cyrillic", "iso-8859-5", "iso-ir-144", "iso8859-5", "iso-8859-5", "iso-8859-5:1988", "csisolatincyrillic"}, - {"dec-hanyu"}, - {"dec-kanji"}, - {"ecma-118", "elot-928", "greek", "greek8", "iso-8859-7", "iso-ir-126", "iso8859-7", "iso-8859-7", "iso-8859-7:1987", "iso-8859-7:2003", "csisolatingreek"}, - {"euc-jis-2004", "euc-jisx0213"}, - {"euc-jp", "eucjp", "extended-unix-code-packed-format-for-japanese", "cseucpkdfmtjapanese"}, - {"euc-kr", "euckr", "cseuckr"}, - {"euc-tw", "euctw", "cseuctw"}, - {"gb18030"}, - {"gbk"}, - {"georgian-academy"}, - {"georgian-ps"}, - {"hebrew", "iso-8859-8", "iso-ir-138", "iso8859-8", "iso-8859-8", "iso-8859-8:1988", "csisolatinhebrew"}, - {"hp-roman8", "r8", "roman8", "cshproman8"}, - {"hz", "hz-gb-2312"}, - {"iso-10646-ucs-2", "ucs-2", "csunicode"}, - {"iso-10646-ucs-4", "ucs-4", "csucs4"}, - {"iso-2022-cn", "csiso2022cn"}, - {"iso-2022-cn-ext"}, - {"iso-2022-jp-1"}, - {"iso-2022-jp-2004", "iso-2022-jp-3"}, - {"iso-2022-jp-2", "csiso2022jp2"}, - {"iso-2022-jp", "csiso2022jp"}, - {"iso-2022-kr", "csiso2022kr"}, - {"iso-8859-10", "iso-ir-157", "iso8859-10", "iso-8859-10", "iso-8859-10:1992", "l6", "latin6", "csisolatin6"}, - {"iso-8859-11", "iso8859-11", "iso-8859-11"}, - {"iso-8859-13", "iso-ir-179", "iso8859-13", "iso-8859-13", "l7", "latin7"}, - {"iso-8859-14", "iso-celtic", "iso-ir-199", "iso8859-14", "iso-8859-14", "iso-8859-14:1998", "l8", "latin8"}, - {"iso-8859-15", "iso-ir-203", "iso8859-15", "iso-8859-15", "iso-8859-15:1998", "latin-9"}, - {"iso-8859-16", "iso-ir-226", "iso8859-16", "iso-8859-16", "iso-8859-16:2001", "l10", "latin10"}, - {"iso-8859-2", "iso-ir-101", "iso8859-2", "iso-8859-2", "iso-8859-2:1987", "l2", "latin2", "csisolatin2"}, - {"iso-8859-3", "iso-ir-109", "iso8859-3", "iso-8859-3", "iso-8859-3:1988", "l3", "latin3", "csisolatin3"}, - {"iso-8859-4", "iso-ir-110", "iso8859-4", "iso-8859-4", "iso-8859-4:1988", "l4", "latin4", "csisolatin4"}, - {"iso-8859-9", "iso-ir-148", "iso8859-9", "iso-8859-9", "iso-8859-9:1989", "l5", "latin5", "csisolatin5"}, - {"iso-ir-149", "korean", "ksc-5601", "ks-c-5601-1987", "ks-c-5601-1989", "csksc56011987"}, - {"iso-ir-14", "iso646-jp", "jis-c6220-1969-ro", "jp", "csiso14jisc6220ro"}, - {"iso-ir-159", "jis-x0212", "jis-x0212-1990", "jis-x0212.1990-0", "x0212", "csiso159jisx02121990"}, - {"iso-ir-166", "tis-620", "tis620", "tis620-0", "tis620.2529-1", "tis620.2533-0", "tis620.2533-1"}, - {"iso-ir-230", "tds565"}, - {"iso-ir-87", "jis0208", "jis-c6226-1983", "jis-x0208", "jis-x0208-1983", "jis-x0208-1990", "x0208", "csiso87jisx0208"}, - {"java"}, - {"jisx0201-1976", "jis-x0201", "x0201", "cshalfwidthkatakana"}, - {"koi8-r", "cskoi8r"}, - {"koi8-ru"}, - {"koi8-t"}, - {"koi8-u"}, - {"kz-1048", "rk1048", "strk1048-2002", "cskz1048"}, - {"macarabic"}, - {"maccentraleurope"}, - {"maccroatian"}, - {"maccyrillic"}, - {"macgreek"}, - {"machebrew"}, - {"maciceland"}, - {"mac", "macintosh", "macroman", "csmacintosh"}, - {"macromania"}, - {"macthai"}, - {"macturkish"}, - {"macukraine"}, - {"ms-kanji", "shift-jis", "shift-jis", "sjis", "csshiftjis"}, - {" MS-Windows", "Japanese", "(cp932)"}, - {"mulelao-1"}, - {"nextstep"}, - {"riscos-latin1"}, - {"shift-jis-2004", "shift-jisx0213"}, - {"tcvn", "tcvn-5712", "tcvn5712-1", "tcvn5712-1:1993"}, - {"ucs-2be", "unicode-1-1", "unicodebig", "csunicode11"}, - {"ucs-2-internal"}, - {"ucs-2le", "unicodelittle"}, - {"ucs-2-swapped"}, - {"ucs-4be"}, - {"ucs-4-internal"}, - {"ucs-4le"}, - {"ucs-4-swapped"}, - {"unicode-1-1-utf-7", "utf-7", "csunicode11utf7"}, - {"utf-16"}, - {"utf-16be"}, - {"utf-16le"}, - {"utf-32"}, - {"utf-32be"}, - {"utf-32le"}, - {"utf-8"}, - {"utf-8-mac", "utf8-mac"}, - {"viscii", "viscii1.1-1", "csviscii"}, - {"windows-31j", "cp932"}, -} diff --git a/vendor/github.com/paulrosania/go-charset/cmd/tcs/tcs.go b/vendor/github.com/paulrosania/go-charset/cmd/tcs/tcs.go deleted file mode 100644 index 188c2a16..00000000 --- a/vendor/github.com/paulrosania/go-charset/cmd/tcs/tcs.go +++ /dev/null @@ -1,103 +0,0 @@ -package main - -import ( - "bytes" - "flag" - "fmt" - "github.com/paulrosania/go-charset/charset" - _ "github.com/paulrosania/go-charset/charset/iconv" - "io" - "os" - "strings" -) - -var listFlag = flag.Bool("l", false, "list available character sets") -var verboseFlag = flag.Bool("v", false, "list more information") -var fromCharset = flag.String("f", "utf-8", "translate from this character set") -var toCharset = flag.String("t", "utf-8", "translate to this character set") - -func main() { - flag.Usage = func() { - fmt.Fprintf(os.Stderr, "usage: tcs [-l] [-v] [charset]\n") - fmt.Fprintf(os.Stderr, "\ttcs [-f charset] [-t charset] [file]\n") - } - flag.Parse() - if *listFlag { - cs := "" - switch flag.NArg() { - case 1: - cs = flag.Arg(0) - case 0: - default: - flag.Usage() - } - listCharsets(*verboseFlag, cs) - return - } - var f *os.File - switch flag.NArg() { - case 0: - f = os.Stdin - case 1: - var err error - f, err = os.Open(flag.Arg(0)) - if err != nil { - fatalf("cannot open %q: %v", err) - } - } - r, err := charset.NewReader(*fromCharset, f) - if err != nil { - fatalf("cannot translate from %q: %v", *fromCharset, err) - } - w, err := charset.NewWriter(*toCharset, os.Stdout) - if err != nil { - fatalf("cannot translate to %q: ", err) - } - _, err = io.Copy(w, r) - if err != nil { - fatalf("%v", err) - } -} - -func listCharsets(verbose bool, csname string) { - var buf bytes.Buffer - if !verbose { - if csname != "" { - cs := charset.Info(csname) - if cs == nil { - fatalf("no such charset %q", csname) - } - fmt.Fprintf(&buf, "%s %s\n", cs.Name, strings.Join(cs.Aliases, " ")) - } else { - fmt.Fprintf(&buf, "%v\n", strings.Join(charset.Names(), " ")) - } - } else { - var charsets []*charset.Charset - if csname != "" { - cs := charset.Info(csname) - if cs == nil { - fatalf("no such charset %q", csname) - } - charsets = []*charset.Charset{cs} - } else { - for _, name := range charset.Names() { - if cs := charset.Info(name); cs != nil { - charsets = append(charsets, cs) - } - } - } - for _, cs := range charsets { - fmt.Fprintf(&buf, "%s %s\n", cs.Name, strings.Join(cs.Aliases, " ")) - if cs.Desc != "" { - fmt.Fprintf(&buf, "\t%s\n", cs.Desc) - } - } - } - os.Stdout.Write(buf.Bytes()) -} - -func fatalf(f string, a ...interface{}) { - s := fmt.Sprintf(f, a...) - fmt.Fprintf(os.Stderr, "%s\n", s) - os.Exit(2) -} diff --git a/vendor/github.com/pborman/uuid/.travis.yml b/vendor/github.com/pborman/uuid/.travis.yml new file mode 100644 index 00000000..a6a98db8 --- /dev/null +++ b/vendor/github.com/pborman/uuid/.travis.yml @@ -0,0 +1,10 @@ +language: go + +go: + - 1.4.3 + - 1.5.3 + - release + - tip + +script: + - go test -v ./... diff --git a/vendor/github.com/pborman/uuid/CONTRIBUTING.md b/vendor/github.com/pborman/uuid/CONTRIBUTING.md new file mode 100644 index 00000000..04fdf09f --- /dev/null +++ b/vendor/github.com/pborman/uuid/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to contribute + +We definitely welcome patches and contribution to this project! + +### Legal requirements + +In order to protect both you and ourselves, you will need to sign the +[Contributor License Agreement](https://cla.developers.google.com/clas). + +You may have already signed it for other Google projects. diff --git a/vendor/github.com/pborman/uuid/CONTRIBUTORS b/vendor/github.com/pborman/uuid/CONTRIBUTORS new file mode 100644 index 00000000..b382a04e --- /dev/null +++ b/vendor/github.com/pborman/uuid/CONTRIBUTORS @@ -0,0 +1 @@ +Paul Borman diff --git a/vendor/github.com/pborman/uuid/README.md b/vendor/github.com/pborman/uuid/README.md new file mode 100644 index 00000000..f023d47c --- /dev/null +++ b/vendor/github.com/pborman/uuid/README.md @@ -0,0 +1,13 @@ +This project was automatically exported from code.google.com/p/go-uuid + +# uuid ![build status](https://travis-ci.org/pborman/uuid.svg?branch=master) +The uuid package generates and inspects UUIDs based on [RFC 412](http://tools.ietf.org/html/rfc4122) and DCE 1.1: Authentication and Security Services. + +###### Install +`go get github.com/pborman/uuid` + +###### Documentation +[![GoDoc](https://godoc.org/github.com/pborman/uuid?status.svg)](http://godoc.org/github.com/pborman/uuid) + +Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: +http://godoc.org/github.com/pborman/uuid diff --git a/vendor/github.com/pelletier/go-toml/.gitignore b/vendor/github.com/pelletier/go-toml/.gitignore new file mode 100644 index 00000000..99e38bbc --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.gitignore @@ -0,0 +1,2 @@ +test_program/test_program_bin +fuzz/ diff --git a/vendor/github.com/pelletier/go-toml/.travis.yml b/vendor/github.com/pelletier/go-toml/.travis.yml new file mode 100644 index 00000000..ab2775d7 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.travis.yml @@ -0,0 +1,22 @@ +sudo: false +language: go +go: + - 1.8.5 + - 1.9.2 + - tip +matrix: + allow_failures: + - go: tip + fast_finish: true +script: + - if [ -n "$(go fmt ./...)" ]; then exit 1; fi + - ./test.sh + - ./benchmark.sh $TRAVIS_BRANCH https://github.com/$TRAVIS_REPO_SLUG.git +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi +branches: + only: [master] +after_success: + - $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=coverage.out -repotoken $COVERALLS_TOKEN diff --git a/vendor/github.com/pelletier/go-toml/README.md b/vendor/github.com/pelletier/go-toml/README.md new file mode 100644 index 00000000..0d357acf --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/README.md @@ -0,0 +1,131 @@ +# go-toml + +Go library for the [TOML](https://github.com/mojombo/toml) format. + +This library supports TOML version +[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md) + +[![GoDoc](https://godoc.org/github.com/pelletier/go-toml?status.svg)](http://godoc.org/github.com/pelletier/go-toml) +[![license](https://img.shields.io/github/license/pelletier/go-toml.svg)](https://github.com/pelletier/go-toml/blob/master/LICENSE) +[![Build Status](https://travis-ci.org/pelletier/go-toml.svg?branch=master)](https://travis-ci.org/pelletier/go-toml) +[![Coverage Status](https://coveralls.io/repos/github/pelletier/go-toml/badge.svg?branch=master)](https://coveralls.io/github/pelletier/go-toml?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/pelletier/go-toml)](https://goreportcard.com/report/github.com/pelletier/go-toml) + +## Features + +Go-toml provides the following features for using data parsed from TOML documents: + +* Load TOML documents from files and string data +* Easily navigate TOML structure using Tree +* Mashaling and unmarshaling to and from data structures +* Line & column position data for all parsed elements +* [Query support similar to JSON-Path](query/) +* Syntax errors contain line and column numbers + +## Import + +```go +import "github.com/pelletier/go-toml" +``` + +## Usage example + +Read a TOML document: + +```go +config, _ := toml.Load(` +[postgres] +user = "pelletier" +password = "mypassword"`) +// retrieve data directly +user := config.Get("postgres.user").(string) + +// or using an intermediate object +postgresConfig := config.Get("postgres").(*toml.Tree) +password := postgresConfig.Get("password").(string) +``` + +Or use Unmarshal: + +```go +type Postgres struct { + User string + Password string +} +type Config struct { + Postgres Postgres +} + +doc := []byte(` +[Postgres] +User = "pelletier" +Password = "mypassword"`) + +config := Config{} +toml.Unmarshal(doc, &config) +fmt.Println("user=", config.Postgres.User) +``` + +Or use a query: + +```go +// use a query to gather elements without walking the tree +q, _ := query.Compile("$..[user,password]") +results := q.Execute(config) +for ii, item := range results.Values() { + fmt.Println("Query result %d: %v", ii, item) +} +``` + +## Documentation + +The documentation and additional examples are available at +[godoc.org](http://godoc.org/github.com/pelletier/go-toml). + +## Tools + +Go-toml provides two handy command line tools: + +* `tomll`: Reads TOML files and lint them. + + ``` + go install github.com/pelletier/go-toml/cmd/tomll + tomll --help + ``` +* `tomljson`: Reads a TOML file and outputs its JSON representation. + + ``` + go install github.com/pelletier/go-toml/cmd/tomljson + tomljson --help + ``` + +## Contribute + +Feel free to report bugs and patches using GitHub's pull requests system on +[pelletier/go-toml](https://github.com/pelletier/go-toml). Any feedback would be +much appreciated! + +### Run tests + +You have to make sure two kind of tests run: + +1. The Go unit tests +2. The TOML examples base + +You can run both of them using `./test.sh`. + +### Fuzzing + +The script `./fuzz.sh` is available to +run [go-fuzz](https://github.com/dvyukov/go-fuzz) on go-toml. + +## Versioning + +Go-toml follows [Semantic Versioning](http://semver.org/). The supported version +of [TOML](https://github.com/toml-lang/toml) is indicated at the beginning of +this document. The last two major versions of Go are supported +(see [Go Release Policy](https://golang.org/doc/devel/release.html#policy)). + +## License + +The MIT License (MIT). Read [LICENSE](LICENSE). diff --git a/vendor/github.com/pelletier/go-toml/benchmark.json b/vendor/github.com/pelletier/go-toml/benchmark.json new file mode 100644 index 00000000..86f99c6a --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.json @@ -0,0 +1,164 @@ +{ + "array": { + "key1": [ + 1, + 2, + 3 + ], + "key2": [ + "red", + "yellow", + "green" + ], + "key3": [ + [ + 1, + 2 + ], + [ + 3, + 4, + 5 + ] + ], + "key4": [ + [ + 1, + 2 + ], + [ + "a", + "b", + "c" + ] + ], + "key5": [ + 1, + 2, + 3 + ], + "key6": [ + 1, + 2 + ] + }, + "boolean": { + "False": false, + "True": true + }, + "datetime": { + "key1": "1979-05-27T07:32:00Z", + "key2": "1979-05-27T00:32:00-07:00", + "key3": "1979-05-27T00:32:00.999999-07:00" + }, + "float": { + "both": { + "key": 6.626e-34 + }, + "exponent": { + "key1": 5e+22, + "key2": 1000000, + "key3": -0.02 + }, + "fractional": { + "key1": 1, + "key2": 3.1415, + "key3": -0.01 + }, + "underscores": { + "key1": 9224617.445991227, + "key2": 1e+100 + } + }, + "fruit": [{ + "name": "apple", + "physical": { + "color": "red", + "shape": "round" + }, + "variety": [{ + "name": "red delicious" + }, + { + "name": "granny smith" + } + ] + }, + { + "name": "banana", + "variety": [{ + "name": "plantain" + }] + } + ], + "integer": { + "key1": 99, + "key2": 42, + "key3": 0, + "key4": -17, + "underscores": { + "key1": 1000, + "key2": 5349221, + "key3": 12345 + } + }, + "products": [{ + "name": "Hammer", + "sku": 738594937 + }, + {}, + { + "color": "gray", + "name": "Nail", + "sku": 284758393 + } + ], + "string": { + "basic": { + "basic": "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." + }, + "literal": { + "multiline": { + "lines": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n", + "regex2": "I [dw]on't need \\d{2} apples" + }, + "quoted": "Tom \"Dubs\" Preston-Werner", + "regex": "\u003c\\i\\c*\\s*\u003e", + "winpath": "C:\\Users\\nodejs\\templates", + "winpath2": "\\\\ServerX\\admin$\\system32\\" + }, + "multiline": { + "continued": { + "key1": "The quick brown fox jumps over the lazy dog.", + "key2": "The quick brown fox jumps over the lazy dog.", + "key3": "The quick brown fox jumps over the lazy dog." + }, + "key1": "One\nTwo", + "key2": "One\nTwo", + "key3": "One\nTwo" + } + }, + "table": { + "inline": { + "name": { + "first": "Tom", + "last": "Preston-Werner" + }, + "point": { + "x": 1, + "y": 2 + } + }, + "key": "value", + "subtable": { + "key": "another value" + } + }, + "x": { + "y": { + "z": { + "w": {} + } + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/benchmark.sh b/vendor/github.com/pelletier/go-toml/benchmark.sh new file mode 100644 index 00000000..8b8bb528 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +reference_ref=${1:-master} +reference_git=${2:-.} + +if ! `hash benchstat 2>/dev/null`; then + echo "Installing benchstat" + go get golang.org/x/perf/cmd/benchstat + go install golang.org/x/perf/cmd/benchstat +fi + +tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX` +ref_tempdir="${tempdir}/ref" +ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt" +local_benchmark="`pwd`/benchmark-local.txt" + +echo "=== ${reference_ref} (${ref_tempdir})" +git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null +pushd ${ref_tempdir} >/dev/null +git checkout ${reference_ref} >/dev/null 2>/dev/null +go test -bench=. -benchmem | tee ${ref_benchmark} +popd >/dev/null + +echo "" +echo "=== local" +go test -bench=. -benchmem | tee ${local_benchmark} + +echo "" +echo "=== diff" +benchstat -delta-test=none ${ref_benchmark} ${local_benchmark} \ No newline at end of file diff --git a/vendor/github.com/pelletier/go-toml/benchmark.yml b/vendor/github.com/pelletier/go-toml/benchmark.yml new file mode 100644 index 00000000..0bd19f08 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.yml @@ -0,0 +1,121 @@ +--- +array: + key1: + - 1 + - 2 + - 3 + key2: + - red + - yellow + - green + key3: + - - 1 + - 2 + - - 3 + - 4 + - 5 + key4: + - - 1 + - 2 + - - a + - b + - c + key5: + - 1 + - 2 + - 3 + key6: + - 1 + - 2 +boolean: + 'False': false + 'True': true +datetime: + key1: '1979-05-27T07:32:00Z' + key2: '1979-05-27T00:32:00-07:00' + key3: '1979-05-27T00:32:00.999999-07:00' +float: + both: + key: 6.626e-34 + exponent: + key1: 5.0e+22 + key2: 1000000 + key3: -0.02 + fractional: + key1: 1 + key2: 3.1415 + key3: -0.01 + underscores: + key1: 9224617.445991227 + key2: 1.0e+100 +fruit: +- name: apple + physical: + color: red + shape: round + variety: + - name: red delicious + - name: granny smith +- name: banana + variety: + - name: plantain +integer: + key1: 99 + key2: 42 + key3: 0 + key4: -17 + underscores: + key1: 1000 + key2: 5349221 + key3: 12345 +products: +- name: Hammer + sku: 738594937 +- {} +- color: gray + name: Nail + sku: 284758393 +string: + basic: + basic: "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." + literal: + multiline: + lines: | + The first newline is + trimmed in raw strings. + All other whitespace + is preserved. + regex2: I [dw]on't need \d{2} apples + quoted: Tom "Dubs" Preston-Werner + regex: "<\\i\\c*\\s*>" + winpath: C:\Users\nodejs\templates + winpath2: "\\\\ServerX\\admin$\\system32\\" + multiline: + continued: + key1: The quick brown fox jumps over the lazy dog. + key2: The quick brown fox jumps over the lazy dog. + key3: The quick brown fox jumps over the lazy dog. + key1: |- + One + Two + key2: |- + One + Two + key3: |- + One + Two +table: + inline: + name: + first: Tom + last: Preston-Werner + point: + x: 1 + y: 2 + key: value + subtable: + key: another value +x: + y: + z: + w: {} diff --git a/vendor/github.com/pelletier/go-toml/cmd/test_program.go b/vendor/github.com/pelletier/go-toml/cmd/test_program.go deleted file mode 100644 index 73077f61..00000000 --- a/vendor/github.com/pelletier/go-toml/cmd/test_program.go +++ /dev/null @@ -1,91 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "os" - "time" - - "github.com/pelletier/go-toml" -) - -func main() { - bytes, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Fatalf("Error during TOML read: %s", err) - os.Exit(2) - } - tree, err := toml.Load(string(bytes)) - if err != nil { - log.Fatalf("Error during TOML load: %s", err) - os.Exit(1) - } - - typedTree := translate(*tree) - - if err := json.NewEncoder(os.Stdout).Encode(typedTree); err != nil { - log.Fatalf("Error encoding JSON: %s", err) - os.Exit(3) - } - - os.Exit(0) -} - -func translate(tomlData interface{}) interface{} { - switch orig := tomlData.(type) { - case map[string]interface{}: - typed := make(map[string]interface{}, len(orig)) - for k, v := range orig { - typed[k] = translate(v) - } - return typed - case *toml.Tree: - return translate(*orig) - case toml.Tree: - keys := orig.Keys() - typed := make(map[string]interface{}, len(keys)) - for _, k := range keys { - typed[k] = translate(orig.GetPath([]string{k})) - } - return typed - case []*toml.Tree: - typed := make([]map[string]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v).(map[string]interface{}) - } - return typed - case []map[string]interface{}: - typed := make([]map[string]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v).(map[string]interface{}) - } - return typed - case []interface{}: - typed := make([]interface{}, len(orig)) - for i, v := range orig { - typed[i] = translate(v) - } - return tag("array", typed) - case time.Time: - return tag("datetime", orig.Format("2006-01-02T15:04:05Z")) - case bool: - return tag("bool", fmt.Sprintf("%v", orig)) - case int64: - return tag("integer", fmt.Sprintf("%d", orig)) - case float64: - return tag("float", fmt.Sprintf("%v", orig)) - case string: - return tag("string", orig) - } - - panic(fmt.Sprintf("Unknown type: %T", tomlData)) -} - -func tag(typeName string, data interface{}) map[string]interface{} { - return map[string]interface{}{ - "type": typeName, - "value": data, - } -} diff --git a/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go b/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go deleted file mode 100644 index b2d6fc67..00000000 --- a/vendor/github.com/pelletier/go-toml/cmd/tomljson/main.go +++ /dev/null @@ -1,72 +0,0 @@ -// Tomljson reads TOML and converts to JSON. -// -// Usage: -// cat file.toml | tomljson > file.json -// tomljson file1.toml > file.json -package main - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "os" - - "github.com/pelletier/go-toml" -) - -func main() { - flag.Usage = func() { - fmt.Fprintln(os.Stderr, `tomljson can be used in two ways: -Writing to STDIN and reading from STDOUT: - cat file.toml | tomljson > file.json - -Reading from a file name: - tomljson file.toml -`) - } - flag.Parse() - os.Exit(processMain(flag.Args(), os.Stdin, os.Stdout, os.Stderr)) -} - -func processMain(files []string, defaultInput io.Reader, output io.Writer, errorOutput io.Writer) int { - // read from stdin and print to stdout - inputReader := defaultInput - - if len(files) > 0 { - var err error - inputReader, err = os.Open(files[0]) - if err != nil { - printError(err, errorOutput) - return -1 - } - } - s, err := reader(inputReader) - if err != nil { - printError(err, errorOutput) - return -1 - } - io.WriteString(output, s+"\n") - return 0 -} - -func printError(err error, output io.Writer) { - io.WriteString(output, err.Error()+"\n") -} - -func reader(r io.Reader) (string, error) { - tree, err := toml.LoadReader(r) - if err != nil { - return "", err - } - return mapToJSON(tree) -} - -func mapToJSON(tree *toml.Tree) (string, error) { - treeMap := tree.ToMap() - bytes, err := json.MarshalIndent(treeMap, "", " ") - if err != nil { - return "", err - } - return string(bytes[:]), nil -} diff --git a/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go b/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go deleted file mode 100644 index 36c7e375..00000000 --- a/vendor/github.com/pelletier/go-toml/cmd/tomll/main.go +++ /dev/null @@ -1,66 +0,0 @@ -// Tomll is a linter for TOML -// -// Usage: -// cat file.toml | tomll > file_linted.toml -// tomll file1.toml file2.toml # lint the two files in place -package main - -import ( - "flag" - "fmt" - "io" - "io/ioutil" - "os" - - "github.com/pelletier/go-toml" -) - -func main() { - flag.Usage = func() { - fmt.Fprintln(os.Stderr, `tomll can be used in two ways: -Writing to STDIN and reading from STDOUT: - cat file.toml | tomll > file.toml - -Reading and updating a list of files: - tomll a.toml b.toml c.toml - -When given a list of files, tomll will modify all files in place without asking. -`) - } - flag.Parse() - // read from stdin and print to stdout - if flag.NArg() == 0 { - s, err := lintReader(os.Stdin) - if err != nil { - io.WriteString(os.Stderr, err.Error()) - os.Exit(-1) - } - io.WriteString(os.Stdout, s) - } else { - // otherwise modify a list of files - for _, filename := range flag.Args() { - s, err := lintFile(filename) - if err != nil { - io.WriteString(os.Stderr, err.Error()) - os.Exit(-1) - } - ioutil.WriteFile(filename, []byte(s), 0644) - } - } -} - -func lintFile(filename string) (string, error) { - tree, err := toml.LoadFile(filename) - if err != nil { - return "", err - } - return tree.String(), nil -} - -func lintReader(r io.Reader) (string, error) { - tree, err := toml.LoadReader(r) - if err != nil { - return "", err - } - return tree.String(), nil -} diff --git a/vendor/github.com/pelletier/go-toml/fuzz.sh b/vendor/github.com/pelletier/go-toml/fuzz.sh new file mode 100644 index 00000000..3204b4c4 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/fuzz.sh @@ -0,0 +1,15 @@ +#! /bin/sh +set -eu + +go get github.com/dvyukov/go-fuzz/go-fuzz +go get github.com/dvyukov/go-fuzz/go-fuzz-build + +if [ ! -e toml-fuzz.zip ]; then + go-fuzz-build github.com/pelletier/go-toml +fi + +rm -fr fuzz +mkdir -p fuzz/corpus +cp *.toml fuzz/corpus + +go-fuzz -bin=toml-fuzz.zip -workdir=fuzz diff --git a/vendor/github.com/pelletier/go-toml/query/doc.go b/vendor/github.com/pelletier/go-toml/query/doc.go deleted file mode 100644 index ed63c110..00000000 --- a/vendor/github.com/pelletier/go-toml/query/doc.go +++ /dev/null @@ -1,175 +0,0 @@ -// Package query performs JSONPath-like queries on a TOML document. -// -// The query path implementation is based loosely on the JSONPath specification: -// http://goessner.net/articles/JsonPath/. -// -// The idea behind a query path is to allow quick access to any element, or set -// of elements within TOML document, with a single expression. -// -// result, err := query.CompileAndExecute("$.foo.bar.baz", tree) -// -// This is roughly equivalent to: -// -// next := tree.Get("foo") -// if next != nil { -// next = next.Get("bar") -// if next != nil { -// next = next.Get("baz") -// } -// } -// result := next -// -// err is nil if any parsing exception occurs. -// -// If no node in the tree matches the query, result will simply contain an empty list of -// items. -// -// As illustrated above, the query path is much more efficient, especially since -// the structure of the TOML file can vary. Rather than making assumptions about -// a document's structure, a query allows the programmer to make structured -// requests into the document, and get zero or more values as a result. -// -// Query syntax -// -// The syntax of a query begins with a root token, followed by any number -// sub-expressions: -// -// $ -// Root of the TOML tree. This must always come first. -// .name -// Selects child of this node, where 'name' is a TOML key -// name. -// ['name'] -// Selects child of this node, where 'name' is a string -// containing a TOML key name. -// [index] -// Selcts child array element at 'index'. -// ..expr -// Recursively selects all children, filtered by an a union, -// index, or slice expression. -// ..* -// Recursive selection of all nodes at this point in the -// tree. -// .* -// Selects all children of the current node. -// [expr,expr] -// Union operator - a logical 'or' grouping of two or more -// sub-expressions: index, key name, or filter. -// [start:end:step] -// Slice operator - selects array elements from start to -// end-1, at the given step. All three arguments are -// optional. -// [?(filter)] -// Named filter expression - the function 'filter' is -// used to filter children at this node. -// -// Query Indexes And Slices -// -// Index expressions perform no bounds checking, and will contribute no -// values to the result set if the provided index or index range is invalid. -// Negative indexes represent values from the end of the array, counting backwards. -// -// // select the last index of the array named 'foo' -// query.CompileAndExecute("$.foo[-1]", tree) -// -// Slice expressions are supported, by using ':' to separate a start/end index pair. -// -// // select up to the first five elements in the array -// query.CompileAndExecute("$.foo[0:5]", tree) -// -// Slice expressions also allow negative indexes for the start and stop -// arguments. -// -// // select all array elements. -// query.CompileAndExecute("$.foo[0:-1]", tree) -// -// Slice expressions may have an optional stride/step parameter: -// -// // select every other element -// query.CompileAndExecute("$.foo[0:-1:2]", tree) -// -// Slice start and end parameters are also optional: -// -// // these are all equivalent and select all the values in the array -// query.CompileAndExecute("$.foo[:]", tree) -// query.CompileAndExecute("$.foo[0:]", tree) -// query.CompileAndExecute("$.foo[:-1]", tree) -// query.CompileAndExecute("$.foo[0:-1:]", tree) -// query.CompileAndExecute("$.foo[::1]", tree) -// query.CompileAndExecute("$.foo[0::1]", tree) -// query.CompileAndExecute("$.foo[:-1:1]", tree) -// query.CompileAndExecute("$.foo[0:-1:1]", tree) -// -// Query Filters -// -// Query filters are used within a Union [,] or single Filter [] expression. -// A filter only allows nodes that qualify through to the next expression, -// and/or into the result set. -// -// // returns children of foo that are permitted by the 'bar' filter. -// query.CompileAndExecute("$.foo[?(bar)]", tree) -// -// There are several filters provided with the library: -// -// tree -// Allows nodes of type Tree. -// int -// Allows nodes of type int64. -// float -// Allows nodes of type float64. -// string -// Allows nodes of type string. -// time -// Allows nodes of type time.Time. -// bool -// Allows nodes of type bool. -// -// Query Results -// -// An executed query returns a Result object. This contains the nodes -// in the TOML tree that qualify the query expression. Position information -// is also available for each value in the set. -// -// // display the results of a query -// results := query.CompileAndExecute("$.foo.bar.baz", tree) -// for idx, value := results.Values() { -// fmt.Println("%v: %v", results.Positions()[idx], value) -// } -// -// Compiled Queries -// -// Queries may be executed directly on a Tree object, or compiled ahead -// of time and executed discretely. The former is more convenient, but has the -// penalty of having to recompile the query expression each time. -// -// // basic query -// results := query.CompileAndExecute("$.foo.bar.baz", tree) -// -// // compiled query -// query, err := toml.Compile("$.foo.bar.baz") -// results := query.Execute(tree) -// -// // run the compiled query again on a different tree -// moreResults := query.Execute(anotherTree) -// -// User Defined Query Filters -// -// Filter expressions may also be user defined by using the SetFilter() -// function on the Query object. The function must return true/false, which -// signifies if the passed node is kept or discarded, respectively. -// -// // create a query that references a user-defined filter -// query, _ := query.Compile("$[?(bazOnly)]") -// -// // define the filter, and assign it to the query -// query.SetFilter("bazOnly", func(node interface{}) bool{ -// if tree, ok := node.(*Tree); ok { -// return tree.Has("baz") -// } -// return false // reject all other node types -// }) -// -// // run the query -// query.Execute(tree) -// -package query diff --git a/vendor/github.com/pelletier/go-toml/query/lexer.go b/vendor/github.com/pelletier/go-toml/query/lexer.go deleted file mode 100644 index 2dc31940..00000000 --- a/vendor/github.com/pelletier/go-toml/query/lexer.go +++ /dev/null @@ -1,357 +0,0 @@ -// TOML JSONPath lexer. -// -// Written using the principles developed by Rob Pike in -// http://www.youtube.com/watch?v=HxaD_trXwRE - -package query - -import ( - "fmt" - "github.com/pelletier/go-toml" - "strconv" - "strings" - "unicode/utf8" -) - -// Lexer state function -type queryLexStateFn func() queryLexStateFn - -// Lexer definition -type queryLexer struct { - input string - start int - pos int - width int - tokens chan token - depth int - line int - col int - stringTerm string -} - -func (l *queryLexer) run() { - for state := l.lexVoid; state != nil; { - state = state() - } - close(l.tokens) -} - -func (l *queryLexer) nextStart() { - // iterate by runes (utf8 characters) - // search for newlines and advance line/col counts - for i := l.start; i < l.pos; { - r, width := utf8.DecodeRuneInString(l.input[i:]) - if r == '\n' { - l.line++ - l.col = 1 - } else { - l.col++ - } - i += width - } - // advance start position to next token - l.start = l.pos -} - -func (l *queryLexer) emit(t tokenType) { - l.tokens <- token{ - Position: toml.Position{Line: l.line, Col: l.col}, - typ: t, - val: l.input[l.start:l.pos], - } - l.nextStart() -} - -func (l *queryLexer) emitWithValue(t tokenType, value string) { - l.tokens <- token{ - Position: toml.Position{Line: l.line, Col: l.col}, - typ: t, - val: value, - } - l.nextStart() -} - -func (l *queryLexer) next() rune { - if l.pos >= len(l.input) { - l.width = 0 - return eof - } - var r rune - r, l.width = utf8.DecodeRuneInString(l.input[l.pos:]) - l.pos += l.width - return r -} - -func (l *queryLexer) ignore() { - l.nextStart() -} - -func (l *queryLexer) backup() { - l.pos -= l.width -} - -func (l *queryLexer) errorf(format string, args ...interface{}) queryLexStateFn { - l.tokens <- token{ - Position: toml.Position{Line: l.line, Col: l.col}, - typ: tokenError, - val: fmt.Sprintf(format, args...), - } - return nil -} - -func (l *queryLexer) peek() rune { - r := l.next() - l.backup() - return r -} - -func (l *queryLexer) accept(valid string) bool { - if strings.ContainsRune(valid, l.next()) { - return true - } - l.backup() - return false -} - -func (l *queryLexer) follow(next string) bool { - return strings.HasPrefix(l.input[l.pos:], next) -} - -func (l *queryLexer) lexVoid() queryLexStateFn { - for { - next := l.peek() - switch next { - case '$': - l.pos++ - l.emit(tokenDollar) - continue - case '.': - if l.follow("..") { - l.pos += 2 - l.emit(tokenDotDot) - } else { - l.pos++ - l.emit(tokenDot) - } - continue - case '[': - l.pos++ - l.emit(tokenLeftBracket) - continue - case ']': - l.pos++ - l.emit(tokenRightBracket) - continue - case ',': - l.pos++ - l.emit(tokenComma) - continue - case '*': - l.pos++ - l.emit(tokenStar) - continue - case '(': - l.pos++ - l.emit(tokenLeftParen) - continue - case ')': - l.pos++ - l.emit(tokenRightParen) - continue - case '?': - l.pos++ - l.emit(tokenQuestion) - continue - case ':': - l.pos++ - l.emit(tokenColon) - continue - case '\'': - l.ignore() - l.stringTerm = string(next) - return l.lexString - case '"': - l.ignore() - l.stringTerm = string(next) - return l.lexString - } - - if isSpace(next) { - l.next() - l.ignore() - continue - } - - if isAlphanumeric(next) { - return l.lexKey - } - - if next == '+' || next == '-' || isDigit(next) { - return l.lexNumber - } - - if l.next() == eof { - break - } - - return l.errorf("unexpected char: '%v'", next) - } - l.emit(tokenEOF) - return nil -} - -func (l *queryLexer) lexKey() queryLexStateFn { - for { - next := l.peek() - if !isAlphanumeric(next) { - l.emit(tokenKey) - return l.lexVoid - } - - if l.next() == eof { - break - } - } - l.emit(tokenEOF) - return nil -} - -func (l *queryLexer) lexString() queryLexStateFn { - l.pos++ - l.ignore() - growingString := "" - - for { - if l.follow(l.stringTerm) { - l.emitWithValue(tokenString, growingString) - l.pos++ - l.ignore() - return l.lexVoid - } - - if l.follow("\\\"") { - l.pos++ - growingString += "\"" - } else if l.follow("\\'") { - l.pos++ - growingString += "'" - } else if l.follow("\\n") { - l.pos++ - growingString += "\n" - } else if l.follow("\\b") { - l.pos++ - growingString += "\b" - } else if l.follow("\\f") { - l.pos++ - growingString += "\f" - } else if l.follow("\\/") { - l.pos++ - growingString += "/" - } else if l.follow("\\t") { - l.pos++ - growingString += "\t" - } else if l.follow("\\r") { - l.pos++ - growingString += "\r" - } else if l.follow("\\\\") { - l.pos++ - growingString += "\\" - } else if l.follow("\\u") { - l.pos += 2 - code := "" - for i := 0; i < 4; i++ { - c := l.peek() - l.pos++ - if !isHexDigit(c) { - return l.errorf("unfinished unicode escape") - } - code = code + string(c) - } - l.pos-- - intcode, err := strconv.ParseInt(code, 16, 32) - if err != nil { - return l.errorf("invalid unicode escape: \\u" + code) - } - growingString += string(rune(intcode)) - } else if l.follow("\\U") { - l.pos += 2 - code := "" - for i := 0; i < 8; i++ { - c := l.peek() - l.pos++ - if !isHexDigit(c) { - return l.errorf("unfinished unicode escape") - } - code = code + string(c) - } - l.pos-- - intcode, err := strconv.ParseInt(code, 16, 32) - if err != nil { - return l.errorf("invalid unicode escape: \\u" + code) - } - growingString += string(rune(intcode)) - } else if l.follow("\\") { - l.pos++ - return l.errorf("invalid escape sequence: \\" + string(l.peek())) - } else { - growingString += string(l.peek()) - } - - if l.next() == eof { - break - } - } - - return l.errorf("unclosed string") -} - -func (l *queryLexer) lexNumber() queryLexStateFn { - l.ignore() - if !l.accept("+") { - l.accept("-") - } - pointSeen := false - digitSeen := false - for { - next := l.next() - if next == '.' { - if pointSeen { - return l.errorf("cannot have two dots in one float") - } - if !isDigit(l.peek()) { - return l.errorf("float cannot end with a dot") - } - pointSeen = true - } else if isDigit(next) { - digitSeen = true - } else { - l.backup() - break - } - if pointSeen && !digitSeen { - return l.errorf("cannot start float with a dot") - } - } - - if !digitSeen { - return l.errorf("no digit in that number") - } - if pointSeen { - l.emit(tokenFloat) - } else { - l.emit(tokenInteger) - } - return l.lexVoid -} - -// Entry point -func lexQuery(input string) chan token { - l := &queryLexer{ - input: input, - tokens: make(chan token), - line: 1, - col: 1, - } - go l.run() - return l.tokens -} diff --git a/vendor/github.com/pelletier/go-toml/query/match.go b/vendor/github.com/pelletier/go-toml/query/match.go deleted file mode 100644 index d7bb15a4..00000000 --- a/vendor/github.com/pelletier/go-toml/query/match.go +++ /dev/null @@ -1,232 +0,0 @@ -package query - -import ( - "fmt" - "github.com/pelletier/go-toml" -) - -// base match -type matchBase struct { - next pathFn -} - -func (f *matchBase) setNext(next pathFn) { - f.next = next -} - -// terminating functor - gathers results -type terminatingFn struct { - // empty -} - -func newTerminatingFn() *terminatingFn { - return &terminatingFn{} -} - -func (f *terminatingFn) setNext(next pathFn) { - // do nothing -} - -func (f *terminatingFn) call(node interface{}, ctx *queryContext) { - ctx.result.appendResult(node, ctx.lastPosition) -} - -// match single key -type matchKeyFn struct { - matchBase - Name string -} - -func newMatchKeyFn(name string) *matchKeyFn { - return &matchKeyFn{Name: name} -} - -func (f *matchKeyFn) call(node interface{}, ctx *queryContext) { - if array, ok := node.([]*toml.Tree); ok { - for _, tree := range array { - item := tree.Get(f.Name) - if item != nil { - ctx.lastPosition = tree.GetPosition(f.Name) - f.next.call(item, ctx) - } - } - } else if tree, ok := node.(*toml.Tree); ok { - item := tree.Get(f.Name) - if item != nil { - ctx.lastPosition = tree.GetPosition(f.Name) - f.next.call(item, ctx) - } - } -} - -// match single index -type matchIndexFn struct { - matchBase - Idx int -} - -func newMatchIndexFn(idx int) *matchIndexFn { - return &matchIndexFn{Idx: idx} -} - -func (f *matchIndexFn) call(node interface{}, ctx *queryContext) { - if arr, ok := node.([]interface{}); ok { - if f.Idx < len(arr) && f.Idx >= 0 { - if treesArray, ok := node.([]*toml.Tree); ok { - if len(treesArray) > 0 { - ctx.lastPosition = treesArray[0].Position() - } - } - f.next.call(arr[f.Idx], ctx) - } - } -} - -// filter by slicing -type matchSliceFn struct { - matchBase - Start, End, Step int -} - -func newMatchSliceFn(start, end, step int) *matchSliceFn { - return &matchSliceFn{Start: start, End: end, Step: step} -} - -func (f *matchSliceFn) call(node interface{}, ctx *queryContext) { - if arr, ok := node.([]interface{}); ok { - // adjust indexes for negative values, reverse ordering - realStart, realEnd := f.Start, f.End - if realStart < 0 { - realStart = len(arr) + realStart - } - if realEnd < 0 { - realEnd = len(arr) + realEnd - } - if realEnd < realStart { - realEnd, realStart = realStart, realEnd // swap - } - // loop and gather - for idx := realStart; idx < realEnd; idx += f.Step { - if treesArray, ok := node.([]*toml.Tree); ok { - if len(treesArray) > 0 { - ctx.lastPosition = treesArray[0].Position() - } - } - f.next.call(arr[idx], ctx) - } - } -} - -// match anything -type matchAnyFn struct { - matchBase -} - -func newMatchAnyFn() *matchAnyFn { - return &matchAnyFn{} -} - -func (f *matchAnyFn) call(node interface{}, ctx *queryContext) { - if tree, ok := node.(*toml.Tree); ok { - for _, k := range tree.Keys() { - v := tree.Get(k) - ctx.lastPosition = tree.GetPosition(k) - f.next.call(v, ctx) - } - } -} - -// filter through union -type matchUnionFn struct { - Union []pathFn -} - -func (f *matchUnionFn) setNext(next pathFn) { - for _, fn := range f.Union { - fn.setNext(next) - } -} - -func (f *matchUnionFn) call(node interface{}, ctx *queryContext) { - for _, fn := range f.Union { - fn.call(node, ctx) - } -} - -// match every single last node in the tree -type matchRecursiveFn struct { - matchBase -} - -func newMatchRecursiveFn() *matchRecursiveFn { - return &matchRecursiveFn{} -} - -func (f *matchRecursiveFn) call(node interface{}, ctx *queryContext) { - originalPosition := ctx.lastPosition - if tree, ok := node.(*toml.Tree); ok { - var visit func(tree *toml.Tree) - visit = func(tree *toml.Tree) { - for _, k := range tree.Keys() { - v := tree.Get(k) - ctx.lastPosition = tree.GetPosition(k) - f.next.call(v, ctx) - switch node := v.(type) { - case *toml.Tree: - visit(node) - case []*toml.Tree: - for _, subtree := range node { - visit(subtree) - } - } - } - } - ctx.lastPosition = originalPosition - f.next.call(tree, ctx) - visit(tree) - } -} - -// match based on an externally provided functional filter -type matchFilterFn struct { - matchBase - Pos toml.Position - Name string -} - -func newMatchFilterFn(name string, pos toml.Position) *matchFilterFn { - return &matchFilterFn{Name: name, Pos: pos} -} - -func (f *matchFilterFn) call(node interface{}, ctx *queryContext) { - fn, ok := (*ctx.filters)[f.Name] - if !ok { - panic(fmt.Sprintf("%s: query context does not have filter '%s'", - f.Pos.String(), f.Name)) - } - switch castNode := node.(type) { - case *toml.Tree: - for _, k := range castNode.Keys() { - v := castNode.Get(k) - if fn(v) { - ctx.lastPosition = castNode.GetPosition(k) - f.next.call(v, ctx) - } - } - case []*toml.Tree: - for _, v := range castNode { - if fn(v) { - if len(castNode) > 0 { - ctx.lastPosition = castNode[0].Position() - } - f.next.call(v, ctx) - } - } - case []interface{}: - for _, v := range castNode { - if fn(v) { - f.next.call(v, ctx) - } - } - } -} diff --git a/vendor/github.com/pelletier/go-toml/query/parser.go b/vendor/github.com/pelletier/go-toml/query/parser.go deleted file mode 100644 index 5f69b70d..00000000 --- a/vendor/github.com/pelletier/go-toml/query/parser.go +++ /dev/null @@ -1,275 +0,0 @@ -/* - Based on the "jsonpath" spec/concept. - - http://goessner.net/articles/JsonPath/ - https://code.google.com/p/json-path/ -*/ - -package query - -import ( - "fmt" -) - -const maxInt = int(^uint(0) >> 1) - -type queryParser struct { - flow chan token - tokensBuffer []token - query *Query - union []pathFn - err error -} - -type queryParserStateFn func() queryParserStateFn - -// Formats and panics an error message based on a token -func (p *queryParser) parseError(tok *token, msg string, args ...interface{}) queryParserStateFn { - p.err = fmt.Errorf(tok.Position.String()+": "+msg, args...) - return nil // trigger parse to end -} - -func (p *queryParser) run() { - for state := p.parseStart; state != nil; { - state = state() - } -} - -func (p *queryParser) backup(tok *token) { - p.tokensBuffer = append(p.tokensBuffer, *tok) -} - -func (p *queryParser) peek() *token { - if len(p.tokensBuffer) != 0 { - return &(p.tokensBuffer[0]) - } - - tok, ok := <-p.flow - if !ok { - return nil - } - p.backup(&tok) - return &tok -} - -func (p *queryParser) lookahead(types ...tokenType) bool { - result := true - buffer := []token{} - - for _, typ := range types { - tok := p.getToken() - if tok == nil { - result = false - break - } - buffer = append(buffer, *tok) - if tok.typ != typ { - result = false - break - } - } - // add the tokens back to the buffer, and return - p.tokensBuffer = append(p.tokensBuffer, buffer...) - return result -} - -func (p *queryParser) getToken() *token { - if len(p.tokensBuffer) != 0 { - tok := p.tokensBuffer[0] - p.tokensBuffer = p.tokensBuffer[1:] - return &tok - } - tok, ok := <-p.flow - if !ok { - return nil - } - return &tok -} - -func (p *queryParser) parseStart() queryParserStateFn { - tok := p.getToken() - - if tok == nil || tok.typ == tokenEOF { - return nil - } - - if tok.typ != tokenDollar { - return p.parseError(tok, "Expected '$' at start of expression") - } - - return p.parseMatchExpr -} - -// handle '.' prefix, '[]', and '..' -func (p *queryParser) parseMatchExpr() queryParserStateFn { - tok := p.getToken() - switch tok.typ { - case tokenDotDot: - p.query.appendPath(&matchRecursiveFn{}) - // nested parse for '..' - tok := p.getToken() - switch tok.typ { - case tokenKey: - p.query.appendPath(newMatchKeyFn(tok.val)) - return p.parseMatchExpr - case tokenLeftBracket: - return p.parseBracketExpr - case tokenStar: - // do nothing - the recursive predicate is enough - return p.parseMatchExpr - } - - case tokenDot: - // nested parse for '.' - tok := p.getToken() - switch tok.typ { - case tokenKey: - p.query.appendPath(newMatchKeyFn(tok.val)) - return p.parseMatchExpr - case tokenStar: - p.query.appendPath(&matchAnyFn{}) - return p.parseMatchExpr - } - - case tokenLeftBracket: - return p.parseBracketExpr - - case tokenEOF: - return nil // allow EOF at this stage - } - return p.parseError(tok, "expected match expression") -} - -func (p *queryParser) parseBracketExpr() queryParserStateFn { - if p.lookahead(tokenInteger, tokenColon) { - return p.parseSliceExpr - } - if p.peek().typ == tokenColon { - return p.parseSliceExpr - } - return p.parseUnionExpr -} - -func (p *queryParser) parseUnionExpr() queryParserStateFn { - var tok *token - - // this state can be traversed after some sub-expressions - // so be careful when setting up state in the parser - if p.union == nil { - p.union = []pathFn{} - } - -loop: // labeled loop for easy breaking - for { - if len(p.union) > 0 { - // parse delimiter or terminator - tok = p.getToken() - switch tok.typ { - case tokenComma: - // do nothing - case tokenRightBracket: - break loop - default: - return p.parseError(tok, "expected ',' or ']', not '%s'", tok.val) - } - } - - // parse sub expression - tok = p.getToken() - switch tok.typ { - case tokenInteger: - p.union = append(p.union, newMatchIndexFn(tok.Int())) - case tokenKey: - p.union = append(p.union, newMatchKeyFn(tok.val)) - case tokenString: - p.union = append(p.union, newMatchKeyFn(tok.val)) - case tokenQuestion: - return p.parseFilterExpr - default: - return p.parseError(tok, "expected union sub expression, not '%s', %d", tok.val, len(p.union)) - } - } - - // if there is only one sub-expression, use that instead - if len(p.union) == 1 { - p.query.appendPath(p.union[0]) - } else { - p.query.appendPath(&matchUnionFn{p.union}) - } - - p.union = nil // clear out state - return p.parseMatchExpr -} - -func (p *queryParser) parseSliceExpr() queryParserStateFn { - // init slice to grab all elements - start, end, step := 0, maxInt, 1 - - // parse optional start - tok := p.getToken() - if tok.typ == tokenInteger { - start = tok.Int() - tok = p.getToken() - } - if tok.typ != tokenColon { - return p.parseError(tok, "expected ':'") - } - - // parse optional end - tok = p.getToken() - if tok.typ == tokenInteger { - end = tok.Int() - tok = p.getToken() - } - if tok.typ == tokenRightBracket { - p.query.appendPath(newMatchSliceFn(start, end, step)) - return p.parseMatchExpr - } - if tok.typ != tokenColon { - return p.parseError(tok, "expected ']' or ':'") - } - - // parse optional step - tok = p.getToken() - if tok.typ == tokenInteger { - step = tok.Int() - if step < 0 { - return p.parseError(tok, "step must be a positive value") - } - tok = p.getToken() - } - if tok.typ != tokenRightBracket { - return p.parseError(tok, "expected ']'") - } - - p.query.appendPath(newMatchSliceFn(start, end, step)) - return p.parseMatchExpr -} - -func (p *queryParser) parseFilterExpr() queryParserStateFn { - tok := p.getToken() - if tok.typ != tokenLeftParen { - return p.parseError(tok, "expected left-parenthesis for filter expression") - } - tok = p.getToken() - if tok.typ != tokenKey && tok.typ != tokenString { - return p.parseError(tok, "expected key or string for filter function name") - } - name := tok.val - tok = p.getToken() - if tok.typ != tokenRightParen { - return p.parseError(tok, "expected right-parenthesis for filter expression") - } - p.union = append(p.union, newMatchFilterFn(name, tok.Position)) - return p.parseUnionExpr -} - -func parseQuery(flow chan token) (*Query, error) { - parser := &queryParser{ - flow: flow, - tokensBuffer: []token{}, - query: newQuery(), - } - parser.run() - return parser.query, parser.err -} diff --git a/vendor/github.com/pelletier/go-toml/query/query.go b/vendor/github.com/pelletier/go-toml/query/query.go deleted file mode 100644 index 1c6cd801..00000000 --- a/vendor/github.com/pelletier/go-toml/query/query.go +++ /dev/null @@ -1,158 +0,0 @@ -package query - -import ( - "time" - - "github.com/pelletier/go-toml" -) - -// NodeFilterFn represents a user-defined filter function, for use with -// Query.SetFilter(). -// -// The return value of the function must indicate if 'node' is to be included -// at this stage of the TOML path. Returning true will include the node, and -// returning false will exclude it. -// -// NOTE: Care should be taken to write script callbacks such that they are safe -// to use from multiple goroutines. -type NodeFilterFn func(node interface{}) bool - -// Result is the result of Executing a Query. -type Result struct { - items []interface{} - positions []toml.Position -} - -// appends a value/position pair to the result set. -func (r *Result) appendResult(node interface{}, pos toml.Position) { - r.items = append(r.items, node) - r.positions = append(r.positions, pos) -} - -// Values is a set of values within a Result. The order of values is not -// guaranteed to be in document order, and may be different each time a query is -// executed. -func (r Result) Values() []interface{} { - return r.items -} - -// Positions is a set of positions for values within a Result. Each index -// in Positions() corresponds to the entry in Value() of the same index. -func (r Result) Positions() []toml.Position { - return r.positions -} - -// runtime context for executing query paths -type queryContext struct { - result *Result - filters *map[string]NodeFilterFn - lastPosition toml.Position -} - -// generic path functor interface -type pathFn interface { - setNext(next pathFn) - // it is the caller's responsibility to set the ctx.lastPosition before invoking call() - // node can be one of: *toml.Tree, []*toml.Tree, or a scalar - call(node interface{}, ctx *queryContext) -} - -// A Query is the representation of a compiled TOML path. A Query is safe -// for concurrent use by multiple goroutines. -type Query struct { - root pathFn - tail pathFn - filters *map[string]NodeFilterFn -} - -func newQuery() *Query { - return &Query{ - root: nil, - tail: nil, - filters: &defaultFilterFunctions, - } -} - -func (q *Query) appendPath(next pathFn) { - if q.root == nil { - q.root = next - } else { - q.tail.setNext(next) - } - q.tail = next - next.setNext(newTerminatingFn()) // init the next functor -} - -// Compile compiles a TOML path expression. The returned Query can be used -// to match elements within a Tree and its descendants. See Execute. -func Compile(path string) (*Query, error) { - return parseQuery(lexQuery(path)) -} - -// Execute executes a query against a Tree, and returns the result of the query. -func (q *Query) Execute(tree *toml.Tree) *Result { - result := &Result{ - items: []interface{}{}, - positions: []toml.Position{}, - } - if q.root == nil { - result.appendResult(tree, tree.GetPosition("")) - } else { - ctx := &queryContext{ - result: result, - filters: q.filters, - } - ctx.lastPosition = tree.Position() - q.root.call(tree, ctx) - } - return result -} - -// CompileAndExecute is a shorthand for Compile(path) followed by Execute(tree). -func CompileAndExecute(path string, tree *toml.Tree) (*Result, error) { - query, err := Compile(path) - if err != nil { - return nil, err - } - return query.Execute(tree), nil -} - -// SetFilter sets a user-defined filter function. These may be used inside -// "?(..)" query expressions to filter TOML document elements within a query. -func (q *Query) SetFilter(name string, fn NodeFilterFn) { - if q.filters == &defaultFilterFunctions { - // clone the static table - q.filters = &map[string]NodeFilterFn{} - for k, v := range defaultFilterFunctions { - (*q.filters)[k] = v - } - } - (*q.filters)[name] = fn -} - -var defaultFilterFunctions = map[string]NodeFilterFn{ - "tree": func(node interface{}) bool { - _, ok := node.(*toml.Tree) - return ok - }, - "int": func(node interface{}) bool { - _, ok := node.(int64) - return ok - }, - "float": func(node interface{}) bool { - _, ok := node.(float64) - return ok - }, - "string": func(node interface{}) bool { - _, ok := node.(string) - return ok - }, - "time": func(node interface{}) bool { - _, ok := node.(time.Time) - return ok - }, - "bool": func(node interface{}) bool { - _, ok := node.(bool) - return ok - }, -} diff --git a/vendor/github.com/pelletier/go-toml/query/tokens.go b/vendor/github.com/pelletier/go-toml/query/tokens.go deleted file mode 100644 index 9ae579de..00000000 --- a/vendor/github.com/pelletier/go-toml/query/tokens.go +++ /dev/null @@ -1,106 +0,0 @@ -package query - -import ( - "fmt" - "github.com/pelletier/go-toml" - "strconv" - "unicode" -) - -// Define tokens -type tokenType int - -const ( - eof = -(iota + 1) -) - -const ( - tokenError tokenType = iota - tokenEOF - tokenKey - tokenString - tokenInteger - tokenFloat - tokenLeftBracket - tokenRightBracket - tokenLeftParen - tokenRightParen - tokenComma - tokenColon - tokenDollar - tokenStar - tokenQuestion - tokenDot - tokenDotDot -) - -var tokenTypeNames = []string{ - "Error", - "EOF", - "Key", - "String", - "Integer", - "Float", - "[", - "]", - "(", - ")", - ",", - ":", - "$", - "*", - "?", - ".", - "..", -} - -type token struct { - toml.Position - typ tokenType - val string -} - -func (tt tokenType) String() string { - idx := int(tt) - if idx < len(tokenTypeNames) { - return tokenTypeNames[idx] - } - return "Unknown" -} - -func (t token) Int() int { - if result, err := strconv.Atoi(t.val); err != nil { - panic(err) - } else { - return result - } -} - -func (t token) String() string { - switch t.typ { - case tokenEOF: - return "EOF" - case tokenError: - return t.val - } - - return fmt.Sprintf("%q", t.val) -} - -func isSpace(r rune) bool { - return r == ' ' || r == '\t' -} - -func isAlphanumeric(r rune) bool { - return unicode.IsLetter(r) || r == '_' -} - -func isDigit(r rune) bool { - return unicode.IsNumber(r) -} - -func isHexDigit(r rune) bool { - return isDigit(r) || - (r >= 'a' && r <= 'f') || - (r >= 'A' && r <= 'F') -} diff --git a/vendor/github.com/pelletier/go-toml/test.sh b/vendor/github.com/pelletier/go-toml/test.sh new file mode 100644 index 00000000..a70a8b02 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/test.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# fail out of the script if anything here fails +set -e +set -o pipefail + +# set the path to the present working directory +export GOPATH=`pwd` + +function git_clone() { + path=$1 + branch=$2 + version=$3 + if [ ! -d "src/$path" ]; then + mkdir -p src/$path + git clone https://$path.git src/$path + fi + pushd src/$path + git checkout "$branch" + git reset --hard "$version" + popd +} + +# Remove potential previous runs +rm -rf src test_program_bin toml-test + +# Run go vet +go vet ./... + +go get github.com/pelletier/go-buffruneio +go get github.com/davecgh/go-spew/spew +go get gopkg.in/yaml.v2 +go get github.com/BurntSushi/toml + +# get code for BurntSushi TOML validation +# pinning all to 'HEAD' for version 0.3.x work (TODO: pin to commit hash when tests stabilize) +git_clone github.com/BurntSushi/toml master HEAD +git_clone github.com/BurntSushi/toml-test master HEAD #was: 0.2.0 HEAD + +# build the BurntSushi test application +go build -o toml-test github.com/BurntSushi/toml-test + +# vendorize the current lib for testing +# NOTE: this basically mocks an install without having to go back out to github for code +mkdir -p src/github.com/pelletier/go-toml/cmd +mkdir -p src/github.com/pelletier/go-toml/query +cp *.go *.toml src/github.com/pelletier/go-toml +cp -R cmd/* src/github.com/pelletier/go-toml/cmd +cp -R query/* src/github.com/pelletier/go-toml/query +go build -o test_program_bin src/github.com/pelletier/go-toml/cmd/test_program.go + +# Run basic unit tests +go test github.com/pelletier/go-toml -covermode=count -coverprofile=coverage.out +go test github.com/pelletier/go-toml/cmd/tomljson +go test github.com/pelletier/go-toml/query + +# run the entire BurntSushi test suite +if [[ $# -eq 0 ]] ; then + echo "Running all BurntSushi tests" + ./toml-test ./test_program_bin | tee test_out +else + # run a specific test + test=$1 + test_path='src/github.com/BurntSushi/toml-test/tests' + valid_test="$test_path/valid/$test" + invalid_test="$test_path/invalid/$test" + + if [ -e "$valid_test.toml" ]; then + echo "Valid Test TOML for $test:" + echo "====" + cat "$valid_test.toml" + + echo "Valid Test JSON for $test:" + echo "====" + cat "$valid_test.json" + + echo "Go-TOML Output for $test:" + echo "====" + cat "$valid_test.toml" | ./test_program_bin + fi + + if [ -e "$invalid_test.toml" ]; then + echo "Invalid Test TOML for $test:" + echo "====" + cat "$invalid_test.toml" + + echo "Go-TOML Output for $test:" + echo "====" + echo "go-toml Output:" + cat "$invalid_test.toml" | ./test_program_bin + fi +fi diff --git a/vendor/github.com/peterhellberg/emojilib/.travis.yml b/vendor/github.com/peterhellberg/emojilib/.travis.yml new file mode 100644 index 00000000..15cfa8b6 --- /dev/null +++ b/vendor/github.com/peterhellberg/emojilib/.travis.yml @@ -0,0 +1,8 @@ +language: go + +go: + - 1.8 + - 1.7.5 + - 1.6.4 + +sudo: false diff --git a/vendor/github.com/peterhellberg/emojilib/README.md b/vendor/github.com/peterhellberg/emojilib/README.md new file mode 100644 index 00000000..3175a43d --- /dev/null +++ b/vendor/github.com/peterhellberg/emojilib/README.md @@ -0,0 +1,61 @@ +# :book: emojilib + +[![Build Status](https://travis-ci.org/peterhellberg/emojilib.svg?branch=master)](https://travis-ci.org/peterhellberg/emojilib) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/peterhellberg/emojilib) +[![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/peterhellberg/emojilib#license-mit) + +The [Emoji keyword library](https://github.com/muan/emojilib) by [@muan](https://github.com/muan/) ported to Go. (using `go generate`) + +## Installation + + go get -u github.com/peterhellberg/emojilib + +## Usage + +```go +package main + +import ( + "fmt" + + "github.com/peterhellberg/emojilib" +) + +func main() { + fmt.Println(emojilib.ReplaceWithPadding("I :green_heart: You!")) +} +``` + +## Generating a new version + +```bash +$ go generate +``` + +This will download the latest version of [emojis.json](https://raw.githubusercontent.com/muan/emojilib/master/emojis.json) +and generate a new version of `generated.go` + +_You’ll need to have the [golang.org/x/tools/imports](https://golang.org/x/tools/imports) package installed in order to run the generator._ + +## License (MIT) + +Copyright (c) 2015-2017 [Peter Hellberg](http://c7.se/) + +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: + +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. + +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/peterhellberg/giphy/client.go b/vendor/github.com/peterhellberg/giphy/client.go deleted file mode 100644 index 09c005c2..00000000 --- a/vendor/github.com/peterhellberg/giphy/client.go +++ /dev/null @@ -1,117 +0,0 @@ -package giphy - -import ( - "encoding/json" - "fmt" - "net/http" - "net/url" -) - -// DefaultClient is the default Giphy API client -var DefaultClient = NewClient() - -// PublicBetaKey is the public beta key for the Giphy API -var PublicBetaKey = "dc6zaTOxFJmzC" - -// A Client communicates with the Giphy API. -type Client struct { - // APIKey is the key used for requests to the Giphy API - APIKey string - - // Limit is the limit used for requests to the Giphy API - Limit int - - // Rating is the rating used for requests to the Giphy API - Rating string - - // BaseURL is the base url for Giphy API. - BaseURL *url.URL - - // BasePath is the base path for the gifs endpoints - BasePath string - - // User agent used for HTTP requests to Giphy API. - UserAgent string - - // HTTP client used to communicate with the Giphy API. - httpClient *http.Client -} - -// NewClient returns a new Giphy API client. -// If no *http.Client were provided then http.DefaultClient is used. -func NewClient(httpClients ...*http.Client) *Client { - var httpClient *http.Client - - if len(httpClients) > 0 && httpClients[0] != nil { - httpClient = httpClients[0] - } else { - cloned := *http.DefaultClient - httpClient = &cloned - } - - c := &Client{ - APIKey: Env("GIPHY_API_KEY", PublicBetaKey), - Rating: Env("GIPHY_RATING", "g"), - Limit: EnvInt("GIPHY_LIMIT", 10), - BaseURL: &url.URL{ - Scheme: Env("GIPHY_BASE_URL_SCHEME", "https"), - Host: Env("GIPHY_BASE_URL_HOST", "api.giphy.com"), - }, - BasePath: Env("GIPHY_BASE_PATH", "/v1"), - UserAgent: Env("GIPHY_USER_AGENT", "giphy.go"), - httpClient: httpClient, - } - - return c -} - -// NewRequest creates an API request. -func (c *Client) NewRequest(s string) (*http.Request, error) { - rel, err := url.Parse(c.BasePath + s) - if err != nil { - return nil, err - } - - q := rel.Query() - q.Set("api_key", c.APIKey) - q.Set("rating", c.Rating) - rel.RawQuery = q.Encode() - - u := c.BaseURL.ResolveReference(rel) - - if EnvBool("GIPHY_VERBOSE", false) { - fmt.Println("giphy: GET", u.String()) - } - - req, err := http.NewRequest("GET", u.String(), nil) - if err != nil { - return nil, err - } - - req.Header.Add("User-Agent", c.UserAgent) - return req, nil -} - -// Do sends an API request and returns the API response. The API response is -// decoded and stored in the value pointed to by v, or returned as an error if -// an API error has occurred. -func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error) { - // Make sure to close the connection after replying to this request - req.Close = true - - resp, err := c.httpClient.Do(req) - if err != nil { - return resp, err - } - defer resp.Body.Close() - - if v != nil { - err = json.NewDecoder(resp.Body).Decode(v) - } - - if err != nil { - return nil, fmt.Errorf("error reading response from %s %s: %s", req.Method, req.URL.RequestURI(), err) - } - - return resp, nil -} diff --git a/vendor/github.com/peterhellberg/giphy/cmd/giphy/main.go b/vendor/github.com/peterhellberg/giphy/cmd/giphy/main.go deleted file mode 100644 index b621f092..00000000 --- a/vendor/github.com/peterhellberg/giphy/cmd/giphy/main.go +++ /dev/null @@ -1,140 +0,0 @@ -/* - -A command line client for the Giphy API - -Installation - -Just go get the command: - - go get -u github.com/peterhellberg/giphy/cmd/giphy - -Configuration - -The command line client can be used straight out of the box, but -there are also a few environment variables that you can use in order -to override the default configuration. - - Environment variable | Default value - ----------------------|-------------- - GIPHY_API_KEY | dc6zaTOxFJmzC - GIPHY_RATING | g - GIPHY_LIMIT | 10 - GIPHY_BASE_URL_SCHEME | http - GIPHY_BASE_URL_HOST | api.giphy.com - GIPHY_BASE_PATH | /v1 - GIPHY_USER_AGENT | giphy.go - -Usage - -The command line client consists of a few sub commands. - - Commands: - search, s [args] - gif, id [args] - random, rand, r [args] - translate, trans, t [args] - trending, trend, tr [args] - -*/ -package main - -import ( - "fmt" - "os" - "strings" - - "github.com/peterhellberg/giphy" -) - -func main() { - g := giphy.DefaultClient - - if len(os.Args) < 2 { - fmt.Println(strings.Join([]string{ - "Commands:", - "search, s [args]", - "gif, id [args]", - "random, rand, r [args]", - "translate, trans, t [args]", - "trending, trend, tr [args]", - }, "\n\t")) - - return - } - - args := os.Args[1:] - - switch args[0] { - default: - search(g, args) - case "search", "s": - search(g, args[1:]) - case "gif", "id": - gif(g, args[1:]) - case "random", "rand", "r": - random(g, args[1:]) - case "translate", "trans", "t": - translate(g, args[1:]) - case "trending", "trend", "tr": - trending(g, args[1:]) - } -} - -func search(c *giphy.Client, args []string) { - res, err := c.Search(args) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - for _, d := range res.Data { - fmt.Println(d.Images.Original.URL) - } -} - -func gif(c *giphy.Client, args []string) { - if len(args) == 0 { - fmt.Println("missing Giphy id") - os.Exit(1) - } - - res, err := c.GIF(args[0]) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - fmt.Println(res.Data.Images.Original.URL) -} - -func random(c *giphy.Client, args []string) { - res, err := c.Random(args) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - fmt.Println(res.Data.ImageOriginalURL) -} - -func translate(c *giphy.Client, args []string) { - res, err := c.Translate(args) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - fmt.Println(res.Data.Images.Original.URL) -} - -func trending(c *giphy.Client, args []string) { - res, err := c.Trending(args) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - for _, d := range res.Data { - fmt.Println(d.Images.Original.URL) - } -} diff --git a/vendor/github.com/peterhellberg/giphy/env.go b/vendor/github.com/peterhellberg/giphy/env.go deleted file mode 100644 index b41944ce..00000000 --- a/vendor/github.com/peterhellberg/giphy/env.go +++ /dev/null @@ -1,34 +0,0 @@ -package giphy - -import ( - "os" - "strconv" -) - -// Env returns a string from the ENV, or fallback variable -func Env(key, fallback string) string { - v := os.Getenv(key) - if v != "" { - return v - } - - return fallback -} - -// EnvBool returns a bool from the ENV, or fallback variable -func EnvBool(key string, fallback bool) bool { - if b, err := strconv.ParseBool(os.Getenv(key)); err == nil { - return b - } - - return fallback -} - -// EnvInt returns an int from the ENV, or fallback variable -func EnvInt(key string, fallback int) int { - if i, err := strconv.Atoi(os.Getenv(key)); err == nil { - return i - } - - return fallback -} diff --git a/vendor/github.com/peterhellberg/giphy/errors.go b/vendor/github.com/peterhellberg/giphy/errors.go deleted file mode 100644 index a98bc2f8..00000000 --- a/vendor/github.com/peterhellberg/giphy/errors.go +++ /dev/null @@ -1,17 +0,0 @@ -package giphy - -import "errors" - -var ( - // ErrNoImageFound is the error returned when no image was found - ErrNoImageFound = errors.New("no image found") - - // ErrUnknown is used for unknown errors from the Giphy API - ErrUnknown = errors.New("unknown error") - - // ErrNoTrendingImagesFound is returned when no trending images were found - ErrNoTrendingImagesFound = errors.New("no trending images found") - - // ErrNoRawData is returned if there was no data property in response - ErrNoRawData = errors.New("no raw data") -) diff --git a/vendor/github.com/peterhellberg/giphy/gif.go b/vendor/github.com/peterhellberg/giphy/gif.go deleted file mode 100644 index 8c317c97..00000000 --- a/vendor/github.com/peterhellberg/giphy/gif.go +++ /dev/null @@ -1,44 +0,0 @@ -package giphy - -import ( - "encoding/json" - "fmt" - "strings" -) - -// GIF returns a ID response from the Giphy API -func (c *Client) GIF(id string) (GIF, error) { - if strings.ContainsAny(id, "/&?") { - return GIF{}, fmt.Errorf("Invalid giphy id: `%v`", id) - } - - req, err := c.NewRequest("/gifs/" + id) - if err != nil { - return GIF{}, err - } - - var gif GIF - if _, err = c.Do(req, &gif); err != nil { - return GIF{}, err - } - - if gif.RawData == nil || gif.RawData[0] == '[' { - return GIF{}, ErrNoImageFound - } - - // Check if the first character in Data is a { - if gif.RawData[0] == '{' { - var d Data - - err = json.Unmarshal(gif.RawData, &d) - if err != nil { - return GIF{}, err - } - - gif.Data = d - - return gif, nil - } - - return GIF{}, ErrUnknown -} diff --git a/vendor/github.com/peterhellberg/giphy/random.go b/vendor/github.com/peterhellberg/giphy/random.go deleted file mode 100644 index 1374ed24..00000000 --- a/vendor/github.com/peterhellberg/giphy/random.go +++ /dev/null @@ -1,37 +0,0 @@ -package giphy - -import ( - "encoding/json" - "strings" -) - -// Random returns a random response from the Giphy API -func (c *Client) Random(args []string) (Random, error) { - argsStr := strings.Join(args, " ") - - req, err := c.NewRequest("/gifs/random?tag=" + argsStr) - if err != nil { - return Random{}, err - } - - var random Random - if _, err = c.Do(req, &random); err != nil { - return Random{}, err - } - - // Check if the first character in Data is a [ - if random.RawData == nil || random.RawData[0] == '[' { - return Random{}, ErrNoImageFound - } - - var d RandomData - - err = json.Unmarshal(random.RawData, &d) - if err != nil { - return Random{}, err - } - - random.Data = d - - return random, nil -} diff --git a/vendor/github.com/peterhellberg/giphy/search.go b/vendor/github.com/peterhellberg/giphy/search.go deleted file mode 100644 index ca5af117..00000000 --- a/vendor/github.com/peterhellberg/giphy/search.go +++ /dev/null @@ -1,24 +0,0 @@ -package giphy - -import ( - "fmt" - "strings" -) - -// Search returns a search response from the Giphy API -func (c *Client) Search(args []string) (Search, error) { - argsStr := strings.Join(args, " ") - - path := fmt.Sprintf("/gifs/search?limit=%v&q=%s", c.Limit, argsStr) - req, err := c.NewRequest(path) - if err != nil { - return Search{}, err - } - - var search Search - if _, err = c.Do(req, &search); err != nil { - return Search{}, err - } - - return search, nil -} diff --git a/vendor/github.com/peterhellberg/giphy/translate.go b/vendor/github.com/peterhellberg/giphy/translate.go deleted file mode 100644 index e3454b28..00000000 --- a/vendor/github.com/peterhellberg/giphy/translate.go +++ /dev/null @@ -1,37 +0,0 @@ -package giphy - -import ( - "encoding/json" - "strings" -) - -// Translate returns a translate response from the Giphy API -func (c *Client) Translate(args []string) (Translate, error) { - argsStr := strings.Join(args, " ") - - req, err := c.NewRequest("/gifs/translate?s=" + argsStr) - if err != nil { - return Translate{}, err - } - - var translate Translate - if _, err = c.Do(req, &translate); err != nil { - return Translate{}, err - } - - if len(translate.RawData) == 0 { - return Translate{}, ErrNoRawData - } - - // Check if the first character in Data is a [ - if translate.RawData[0] == '[' { - return Translate{}, ErrNoImageFound - } - - err = json.Unmarshal(translate.RawData, &translate.Data) - if err != nil { - return Translate{}, err - } - - return translate, nil -} diff --git a/vendor/github.com/peterhellberg/giphy/trending.go b/vendor/github.com/peterhellberg/giphy/trending.go deleted file mode 100644 index 671e0d51..00000000 --- a/vendor/github.com/peterhellberg/giphy/trending.go +++ /dev/null @@ -1,23 +0,0 @@ -package giphy - -import "fmt" - -// Trending returns a trending response from the Giphy API -func (c *Client) Trending(args ...[]string) (Trending, error) { - path := fmt.Sprintf("/gifs/trending?limit=%v", c.Limit) - req, err := c.NewRequest(path) - if err != nil { - return Trending{}, err - } - - var res Trending - if _, err = c.Do(req, &res); err != nil { - return res, err - } - - if len(res.Data) == 0 { - return res, ErrNoTrendingImagesFound - } - - return res, nil -} diff --git a/vendor/github.com/peterhellberg/giphy/types.go b/vendor/github.com/peterhellberg/giphy/types.go deleted file mode 100644 index e7a7ebfc..00000000 --- a/vendor/github.com/peterhellberg/giphy/types.go +++ /dev/null @@ -1,116 +0,0 @@ -package giphy - -import "encoding/json" - -// Search represents a search response from the Giphy API -type Search struct { - Data []Data `json:"data"` - Meta Meta `json:"meta"` - Pagination Pagination `json:"pagination"` -} - -// GIF represents a ID response from the Giphy API -type GIF struct { - Data Data - RawData json.RawMessage `json:"data"` - Meta Meta `json:"meta"` -} - -// Random represents a random response from the Giphy API -type Random struct { - Data RandomData - RawData json.RawMessage `json:"data"` - Meta Meta `json:"meta"` -} - -// Translate represents a translate response from the Giphy API -type Translate struct { - Data - RawData json.RawMessage `json:"data"` - Meta Meta `json:"meta"` -} - -// Trending represents a trending response from the Giphy API -type Trending struct { - Data []Data `json:"data"` - Meta Meta `json:"meta"` - Pagination Pagination `json:"pagination"` -} - -// Data contains all the fields in a data response from the Giphy API -type Data struct { - Type string `json:"type"` - ID string `json:"id"` - URL string `json:"url"` - BitlyGifURL string `json:"bitly_gif_url"` - BitlyURL string `json:"bitly_url"` - EmbedURL string `json:"embed_url"` - Username string `json:"username"` - Source string `json:"source"` - Rating string `json:"rating"` - Caption string `json:"caption"` - ContentURL string `json:"content_url"` - ImportDatetime string `json:"import_datetime"` - TrendingDatetime string `json:"trending_datetime"` - Images Images `json:"images"` -} - -// RandomData represents data section in random response from the Giphy API -type RandomData struct { - Type string `json:"type"` - ID string `json:"id"` - URL string `json:"url"` - ImageOriginalURL string `json:"image_original_url"` - ImageURL string `json:"image_url"` - ImageMp4URL string `json:"image_mp4_url"` - ImageFrames string `json:"image_frames"` - ImageWidth string `json:"image_width"` - ImageHeight string `json:"image_height"` - FixedHeightDownsampledURL string `json:"fixed_height_downsampled_url"` - FixedHeightDownsampledWidth string `json:"fixed_height_downsampled_width"` - FixedHeightDownsampledHeight string `json:"fixed_height_downsampled_height"` - FixedWidthDownsampledURL string `json:"fixed_width_downsampled_url"` - FixedWidthDownsampledWidth string `json:"fixed_width_downsampled_width"` - FixedWidthDownsampledHeight string `json:"fixed_width_downsampled_height"` - Rating string `json:"rating"` - Username string `json:"username"` - Caption string `json:"caption"` - Tags []string `json:"tags"` -} - -// Images represents all the different types of images -type Images struct { - FixedHeight Image `json:"fixed_height"` - FixedHeightStill Image `json:"fixed_height_still"` - FixedHeightDownsampled Image `json:"fixed_height_downsampled"` - FixedWidth Image `json:"fixed_width"` - FixedWidthStill Image `json:"fixed_width_still"` - FixedWidthDownsampled Image `json:"fixed_width_downsampled"` - Downsized Image `json:"downsized"` - DownsizedStill Image `json:"downsized_still"` - Original Image `json:"original"` - OriginalStill Image `json:"original_still"` -} - -// Image represents an image -type Image struct { - URL string `json:"url"` - Width string `json:"width"` - Height string `json:"height"` - Size string `json:"size,omitempty"` - Frames string `json:"frames,omitempty"` - Mp4 string `json:"mp4,omitempty"` -} - -// Pagination represents the pagination section in a Giphy API response -type Pagination struct { - TotalCount int `json:"total_count"` - Count int `json:"count"` - Offset int `json:"offset"` -} - -// Meta represents the meta section in a Giphy API response -type Meta struct { - Status int `json:"status"` - Msg string `json:"msg"` -} diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE deleted file mode 100644 index 835ba3e7..00000000 --- a/vendor/github.com/pkg/errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go deleted file mode 100644 index 842ee804..00000000 --- a/vendor/github.com/pkg/errors/errors.go +++ /dev/null @@ -1,269 +0,0 @@ -// Package errors provides simple error handling primitives. -// -// The traditional error handling idiom in Go is roughly akin to -// -// if err != nil { -// return err -// } -// -// which applied recursively up the call stack results in error reports -// without context or debugging information. The errors package allows -// programmers to add context to the failure path in their code in a way -// that does not destroy the original value of the error. -// -// Adding context to an error -// -// The errors.Wrap function returns a new error that adds context to the -// original error by recording a stack trace at the point Wrap is called, -// and the supplied message. For example -// -// _, err := ioutil.ReadAll(r) -// if err != nil { -// return errors.Wrap(err, "read failed") -// } -// -// If additional control is required the errors.WithStack and errors.WithMessage -// functions destructure errors.Wrap into its component operations of annotating -// an error with a stack trace and an a message, respectively. -// -// Retrieving the cause of an error -// -// Using errors.Wrap constructs a stack of errors, adding context to the -// preceding error. Depending on the nature of the error it may be necessary -// to reverse the operation of errors.Wrap to retrieve the original error -// for inspection. Any error value which implements this interface -// -// type causer interface { -// Cause() error -// } -// -// can be inspected by errors.Cause. errors.Cause will recursively retrieve -// the topmost error which does not implement causer, which is assumed to be -// the original cause. For example: -// -// switch err := errors.Cause(err).(type) { -// case *MyError: -// // handle specifically -// default: -// // unknown error -// } -// -// causer interface is not exported by this package, but is considered a part -// of stable public API. -// -// Formatted printing of errors -// -// All error values returned from this package implement fmt.Formatter and can -// be formatted by the fmt package. The following verbs are supported -// -// %s print the error. If the error has a Cause it will be -// printed recursively -// %v see %s -// %+v extended format. Each Frame of the error's StackTrace will -// be printed in detail. -// -// Retrieving the stack trace of an error or wrapper -// -// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are -// invoked. This information can be retrieved with the following interface. -// -// type stackTracer interface { -// StackTrace() errors.StackTrace -// } -// -// Where errors.StackTrace is defined as -// -// type StackTrace []Frame -// -// The Frame type represents a call site in the stack trace. Frame supports -// the fmt.Formatter interface that can be used for printing information about -// the stack trace of this error. For example: -// -// if err, ok := err.(stackTracer); ok { -// for _, f := range err.StackTrace() { -// fmt.Printf("%+s:%d", f) -// } -// } -// -// stackTracer interface is not exported by this package, but is considered a part -// of stable public API. -// -// See the documentation for Frame.Format for more details. -package errors - -import ( - "fmt" - "io" -) - -// New returns an error with the supplied message. -// New also records the stack trace at the point it was called. -func New(message string) error { - return &fundamental{ - msg: message, - stack: callers(), - } -} - -// Errorf formats according to a format specifier and returns the string -// as a value that satisfies error. -// Errorf also records the stack trace at the point it was called. -func Errorf(format string, args ...interface{}) error { - return &fundamental{ - msg: fmt.Sprintf(format, args...), - stack: callers(), - } -} - -// fundamental is an error that has a message and a stack, but no caller. -type fundamental struct { - msg string - *stack -} - -func (f *fundamental) Error() string { return f.msg } - -func (f *fundamental) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - io.WriteString(s, f.msg) - f.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, f.msg) - case 'q': - fmt.Fprintf(s, "%q", f.msg) - } -} - -// WithStack annotates err with a stack trace at the point WithStack was called. -// If err is nil, WithStack returns nil. -func WithStack(err error) error { - if err == nil { - return nil - } - return &withStack{ - err, - callers(), - } -} - -type withStack struct { - error - *stack -} - -func (w *withStack) Cause() error { return w.error } - -func (w *withStack) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v", w.Cause()) - w.stack.Format(s, verb) - return - } - fallthrough - case 's': - io.WriteString(s, w.Error()) - case 'q': - fmt.Fprintf(s, "%q", w.Error()) - } -} - -// Wrap returns an error annotating err with a stack trace -// at the point Wrap is called, and the supplied message. -// If err is nil, Wrap returns nil. -func Wrap(err error, message string) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: message, - } - return &withStack{ - err, - callers(), - } -} - -// Wrapf returns an error annotating err with a stack trace -// at the point Wrapf is call, and the format specifier. -// If err is nil, Wrapf returns nil. -func Wrapf(err error, format string, args ...interface{}) error { - if err == nil { - return nil - } - err = &withMessage{ - cause: err, - msg: fmt.Sprintf(format, args...), - } - return &withStack{ - err, - callers(), - } -} - -// WithMessage annotates err with a new message. -// If err is nil, WithMessage returns nil. -func WithMessage(err error, message string) error { - if err == nil { - return nil - } - return &withMessage{ - cause: err, - msg: message, - } -} - -type withMessage struct { - cause error - msg string -} - -func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } -func (w *withMessage) Cause() error { return w.cause } - -func (w *withMessage) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - if s.Flag('+') { - fmt.Fprintf(s, "%+v\n", w.Cause()) - io.WriteString(s, w.msg) - return - } - fallthrough - case 's', 'q': - io.WriteString(s, w.Error()) - } -} - -// Cause returns the underlying cause of the error, if possible. -// An error value has a cause if it implements the following -// interface: -// -// type causer interface { -// Cause() error -// } -// -// If the error does not implement Cause, the original error will -// be returned. If the error is nil, nil will be returned without further -// investigation. -func Cause(err error) error { - type causer interface { - Cause() error - } - - for err != nil { - cause, ok := err.(causer) - if !ok { - break - } - err = cause.Cause() - } - return err -} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go deleted file mode 100644 index 2874a048..00000000 --- a/vendor/github.com/pkg/errors/stack.go +++ /dev/null @@ -1,147 +0,0 @@ -package errors - -import ( - "fmt" - "io" - "path" - "runtime" - "strings" -) - -// Frame represents a program counter inside a stack frame. -type Frame uintptr - -// pc returns the program counter for this frame; -// multiple frames may have the same PC value. -func (f Frame) pc() uintptr { return uintptr(f) - 1 } - -// file returns the full path to the file that contains the -// function for this Frame's pc. -func (f Frame) file() string { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return "unknown" - } - file, _ := fn.FileLine(f.pc()) - return file -} - -// line returns the line number of source code of the -// function for this Frame's pc. -func (f Frame) line() int { - fn := runtime.FuncForPC(f.pc()) - if fn == nil { - return 0 - } - _, line := fn.FileLine(f.pc()) - return line -} - -// Format formats the frame according to the fmt.Formatter interface. -// -// %s source file -// %d source line -// %n function name -// %v equivalent to %s:%d -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+s function name and path of source file relative to the compile time -// GOPATH separated by \n\t (\n\t) -// %+v equivalent to %+s:%d -func (f Frame) Format(s fmt.State, verb rune) { - switch verb { - case 's': - switch { - case s.Flag('+'): - pc := f.pc() - fn := runtime.FuncForPC(pc) - if fn == nil { - io.WriteString(s, "unknown") - } else { - file, _ := fn.FileLine(pc) - fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) - } - default: - io.WriteString(s, path.Base(f.file())) - } - case 'd': - fmt.Fprintf(s, "%d", f.line()) - case 'n': - name := runtime.FuncForPC(f.pc()).Name() - io.WriteString(s, funcname(name)) - case 'v': - f.Format(s, 's') - io.WriteString(s, ":") - f.Format(s, 'd') - } -} - -// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). -type StackTrace []Frame - -// Format formats the stack of Frames according to the fmt.Formatter interface. -// -// %s lists source files for each Frame in the stack -// %v lists the source file and line number for each Frame in the stack -// -// Format accepts flags that alter the printing of some verbs, as follows: -// -// %+v Prints filename, function, and line number for each Frame in the stack. -func (st StackTrace) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case s.Flag('+'): - for _, f := range st { - fmt.Fprintf(s, "\n%+v", f) - } - case s.Flag('#'): - fmt.Fprintf(s, "%#v", []Frame(st)) - default: - fmt.Fprintf(s, "%v", []Frame(st)) - } - case 's': - fmt.Fprintf(s, "%s", []Frame(st)) - } -} - -// stack represents a stack of program counters. -type stack []uintptr - -func (s *stack) Format(st fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case st.Flag('+'): - for _, pc := range *s { - f := Frame(pc) - fmt.Fprintf(st, "\n%+v", f) - } - } - } -} - -func (s *stack) StackTrace() StackTrace { - f := make([]Frame, len(*s)) - for i := 0; i < len(f); i++ { - f[i] = Frame((*s)[i]) - } - return f -} - -func callers() *stack { - const depth = 32 - var pcs [depth]uintptr - n := runtime.Callers(3, pcs[:]) - var st stack = pcs[0:n] - return &st -} - -// funcname removes the path prefix component of a function's name reported by func.Name(). -func funcname(name string) string { - i := strings.LastIndex(name, "/") - name = name[i+1:] - i = strings.Index(name, ".") - return name[i+1:] -} diff --git a/vendor/github.com/pkg/sftp/LICENSE b/vendor/github.com/pkg/sftp/LICENSE deleted file mode 100644 index b7b53921..00000000 --- a/vendor/github.com/pkg/sftp/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Copyright (c) 2013, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/sftp/attrs.go b/vendor/github.com/pkg/sftp/attrs.go deleted file mode 100644 index 18412e33..00000000 --- a/vendor/github.com/pkg/sftp/attrs.go +++ /dev/null @@ -1,241 +0,0 @@ -package sftp - -// ssh_FXP_ATTRS support -// see http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-5 - -import ( - "os" - "syscall" - "time" -) - -const ( - ssh_FILEXFER_ATTR_SIZE = 0x00000001 - ssh_FILEXFER_ATTR_UIDGID = 0x00000002 - ssh_FILEXFER_ATTR_PERMISSIONS = 0x00000004 - ssh_FILEXFER_ATTR_ACMODTIME = 0x00000008 - ssh_FILEXFER_ATTR_EXTENDED = 0x80000000 -) - -// fileInfo is an artificial type designed to satisfy os.FileInfo. -type fileInfo struct { - name string - size int64 - mode os.FileMode - mtime time.Time - sys interface{} -} - -// Name returns the base name of the file. -func (fi *fileInfo) Name() string { return fi.name } - -// Size returns the length in bytes for regular files; system-dependent for others. -func (fi *fileInfo) Size() int64 { return fi.size } - -// Mode returns file mode bits. -func (fi *fileInfo) Mode() os.FileMode { return fi.mode } - -// ModTime returns the last modification time of the file. -func (fi *fileInfo) ModTime() time.Time { return fi.mtime } - -// IsDir returns true if the file is a directory. -func (fi *fileInfo) IsDir() bool { return fi.Mode().IsDir() } - -func (fi *fileInfo) Sys() interface{} { return fi.sys } - -// FileStat holds the original unmarshalled values from a call to READDIR or *STAT. -// It is exported for the purposes of accessing the raw values via os.FileInfo.Sys() -type FileStat struct { - Size uint64 - Mode uint32 - Mtime uint32 - Atime uint32 - UID uint32 - GID uint32 - Extended []StatExtended -} - -// StatExtended contains additional, extended information for a FileStat. -type StatExtended struct { - ExtType string - ExtData string -} - -func fileInfoFromStat(st *FileStat, name string) os.FileInfo { - fs := &fileInfo{ - name: name, - size: int64(st.Size), - mode: toFileMode(st.Mode), - mtime: time.Unix(int64(st.Mtime), 0), - sys: st, - } - return fs -} - -func fileStatFromInfo(fi os.FileInfo) (uint32, FileStat) { - mtime := fi.ModTime().Unix() - atime := mtime - var flags uint32 = ssh_FILEXFER_ATTR_SIZE | - ssh_FILEXFER_ATTR_PERMISSIONS | - ssh_FILEXFER_ATTR_ACMODTIME - - fileStat := FileStat{ - Size: uint64(fi.Size()), - Mode: fromFileMode(fi.Mode()), - Mtime: uint32(mtime), - Atime: uint32(atime), - } - - // os specific file stat decoding - fileStatFromInfoOs(fi, &flags, &fileStat) - - return flags, fileStat -} - -func unmarshalAttrs(b []byte) (*FileStat, []byte) { - flags, b := unmarshalUint32(b) - return getFileStat(flags, b) -} - -func getFileStat(flags uint32, b []byte) (*FileStat, []byte) { - var fs FileStat - if flags&ssh_FILEXFER_ATTR_SIZE == ssh_FILEXFER_ATTR_SIZE { - fs.Size, b = unmarshalUint64(b) - } - if flags&ssh_FILEXFER_ATTR_UIDGID == ssh_FILEXFER_ATTR_UIDGID { - fs.UID, b = unmarshalUint32(b) - } - if flags&ssh_FILEXFER_ATTR_UIDGID == ssh_FILEXFER_ATTR_UIDGID { - fs.GID, b = unmarshalUint32(b) - } - if flags&ssh_FILEXFER_ATTR_PERMISSIONS == ssh_FILEXFER_ATTR_PERMISSIONS { - fs.Mode, b = unmarshalUint32(b) - } - if flags&ssh_FILEXFER_ATTR_ACMODTIME == ssh_FILEXFER_ATTR_ACMODTIME { - fs.Atime, b = unmarshalUint32(b) - fs.Mtime, b = unmarshalUint32(b) - } - if flags&ssh_FILEXFER_ATTR_EXTENDED == ssh_FILEXFER_ATTR_EXTENDED { - var count uint32 - count, b = unmarshalUint32(b) - ext := make([]StatExtended, count) - for i := uint32(0); i < count; i++ { - var typ string - var data string - typ, b = unmarshalString(b) - data, b = unmarshalString(b) - ext[i] = StatExtended{typ, data} - } - fs.Extended = ext - } - return &fs, b -} - -func marshalFileInfo(b []byte, fi os.FileInfo) []byte { - // attributes variable struct, and also variable per protocol version - // spec version 3 attributes: - // uint32 flags - // uint64 size present only if flag SSH_FILEXFER_ATTR_SIZE - // uint32 uid present only if flag SSH_FILEXFER_ATTR_UIDGID - // uint32 gid present only if flag SSH_FILEXFER_ATTR_UIDGID - // uint32 permissions present only if flag SSH_FILEXFER_ATTR_PERMISSIONS - // uint32 atime present only if flag SSH_FILEXFER_ACMODTIME - // uint32 mtime present only if flag SSH_FILEXFER_ACMODTIME - // uint32 extended_count present only if flag SSH_FILEXFER_ATTR_EXTENDED - // string extended_type - // string extended_data - // ... more extended data (extended_type - extended_data pairs), - // so that number of pairs equals extended_count - - flags, fileStat := fileStatFromInfo(fi) - - b = marshalUint32(b, flags) - if flags&ssh_FILEXFER_ATTR_SIZE != 0 { - b = marshalUint64(b, fileStat.Size) - } - if flags&ssh_FILEXFER_ATTR_UIDGID != 0 { - b = marshalUint32(b, fileStat.UID) - b = marshalUint32(b, fileStat.GID) - } - if flags&ssh_FILEXFER_ATTR_PERMISSIONS != 0 { - b = marshalUint32(b, fileStat.Mode) - } - if flags&ssh_FILEXFER_ATTR_ACMODTIME != 0 { - b = marshalUint32(b, fileStat.Atime) - b = marshalUint32(b, fileStat.Mtime) - } - - return b -} - -// toFileMode converts sftp filemode bits to the os.FileMode specification -func toFileMode(mode uint32) os.FileMode { - var fm = os.FileMode(mode & 0777) - switch mode & syscall.S_IFMT { - case syscall.S_IFBLK: - fm |= os.ModeDevice - case syscall.S_IFCHR: - fm |= os.ModeDevice | os.ModeCharDevice - case syscall.S_IFDIR: - fm |= os.ModeDir - case syscall.S_IFIFO: - fm |= os.ModeNamedPipe - case syscall.S_IFLNK: - fm |= os.ModeSymlink - case syscall.S_IFREG: - // nothing to do - case syscall.S_IFSOCK: - fm |= os.ModeSocket - } - if mode&syscall.S_ISGID != 0 { - fm |= os.ModeSetgid - } - if mode&syscall.S_ISUID != 0 { - fm |= os.ModeSetuid - } - if mode&syscall.S_ISVTX != 0 { - fm |= os.ModeSticky - } - return fm -} - -// fromFileMode converts from the os.FileMode specification to sftp filemode bits -func fromFileMode(mode os.FileMode) uint32 { - ret := uint32(0) - - if mode&os.ModeDevice != 0 { - if mode&os.ModeCharDevice != 0 { - ret |= syscall.S_IFCHR - } else { - ret |= syscall.S_IFBLK - } - } - if mode&os.ModeDir != 0 { - ret |= syscall.S_IFDIR - } - if mode&os.ModeSymlink != 0 { - ret |= syscall.S_IFLNK - } - if mode&os.ModeNamedPipe != 0 { - ret |= syscall.S_IFIFO - } - if mode&os.ModeSetgid != 0 { - ret |= syscall.S_ISGID - } - if mode&os.ModeSetuid != 0 { - ret |= syscall.S_ISUID - } - if mode&os.ModeSticky != 0 { - ret |= syscall.S_ISVTX - } - if mode&os.ModeSocket != 0 { - ret |= syscall.S_IFSOCK - } - - if mode&os.ModeType == 0 { - ret |= syscall.S_IFREG - } - ret |= uint32(mode & os.ModePerm) - - return ret -} diff --git a/vendor/github.com/pkg/sftp/attrs_stubs.go b/vendor/github.com/pkg/sftp/attrs_stubs.go deleted file mode 100644 index 81cf3eac..00000000 --- a/vendor/github.com/pkg/sftp/attrs_stubs.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !cgo,!plan9 windows android - -package sftp - -import ( - "os" -) - -func fileStatFromInfoOs(fi os.FileInfo, flags *uint32, fileStat *FileStat) { - // todo -} diff --git a/vendor/github.com/pkg/sftp/attrs_unix.go b/vendor/github.com/pkg/sftp/attrs_unix.go deleted file mode 100644 index ab6ecdea..00000000 --- a/vendor/github.com/pkg/sftp/attrs_unix.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris -// +build cgo - -package sftp - -import ( - "os" - "syscall" -) - -func fileStatFromInfoOs(fi os.FileInfo, flags *uint32, fileStat *FileStat) { - if statt, ok := fi.Sys().(*syscall.Stat_t); ok { - *flags |= ssh_FILEXFER_ATTR_UIDGID - fileStat.UID = statt.Uid - fileStat.GID = statt.Gid - } -} diff --git a/vendor/github.com/pkg/sftp/client.go b/vendor/github.com/pkg/sftp/client.go deleted file mode 100644 index c90d0b23..00000000 --- a/vendor/github.com/pkg/sftp/client.go +++ /dev/null @@ -1,1174 +0,0 @@ -package sftp - -import ( - "bytes" - "encoding/binary" - "io" - "os" - "path" - "sync/atomic" - "time" - - "github.com/kr/fs" - "github.com/pkg/errors" - "golang.org/x/crypto/ssh" -) - -// InternalInconsistency indicates the packets sent and the data queued to be -// written to the file don't match up. It is an unusual error and usually is -// caused by bad behavior server side or connection issues. The error is -// limited in scope to the call where it happened, the client object is still -// OK to use as long as the connection is still open. -var InternalInconsistency = errors.New("internal inconsistency") - -// A ClientOption is a function which applies configuration to a Client. -type ClientOption func(*Client) error - -// This is based on Openssh's max accepted size of 1<<18 - overhead -const maxMaxPacket = (1 << 18) - 1024 - -// MaxPacket sets the maximum size of the payload. The size param must be -// between 32768 (1<<15) and 261120 ((1 << 18) - 1024). The minimum size is -// given by the RFC, while the maximum size is a de-facto standard based on -// Openssh's SFTP server which won't accept packets much larger than that. -// -// Note if you aren't using Openssh's sftp server and get the error "failed to -// send packet header: EOF" when copying a large file try lowering this number. -func MaxPacket(size int) ClientOption { - return func(c *Client) error { - if size < 1<<15 { - return errors.Errorf("size must be greater or equal to 32k") - } - if size > maxMaxPacket { - return errors.Errorf("max packet size is too large (see docs)") - } - c.maxPacket = size - return nil - } -} - -// NewClient creates a new SFTP client on conn, using zero or more option -// functions. -func NewClient(conn *ssh.Client, opts ...ClientOption) (*Client, error) { - s, err := conn.NewSession() - if err != nil { - return nil, err - } - if err := s.RequestSubsystem("sftp"); err != nil { - return nil, err - } - pw, err := s.StdinPipe() - if err != nil { - return nil, err - } - pr, err := s.StdoutPipe() - if err != nil { - return nil, err - } - - return NewClientPipe(pr, pw, opts...) -} - -// NewClientPipe creates a new SFTP client given a Reader and a WriteCloser. -// This can be used for connecting to an SFTP server over TCP/TLS or by using -// the system's ssh client program (e.g. via exec.Command). -func NewClientPipe(rd io.Reader, wr io.WriteCloser, opts ...ClientOption) (*Client, error) { - sftp := &Client{ - clientConn: clientConn{ - conn: conn{ - Reader: rd, - WriteCloser: wr, - }, - inflight: make(map[uint32]chan<- result), - }, - maxPacket: 1 << 15, - } - if err := sftp.applyOptions(opts...); err != nil { - wr.Close() - return nil, err - } - if err := sftp.sendInit(); err != nil { - wr.Close() - return nil, err - } - if err := sftp.recvVersion(); err != nil { - wr.Close() - return nil, err - } - sftp.clientConn.wg.Add(1) - go sftp.loop() - return sftp, nil -} - -// Client represents an SFTP session on a *ssh.ClientConn SSH connection. -// Multiple Clients can be active on a single SSH connection, and a Client -// may be called concurrently from multiple Goroutines. -// -// Client implements the github.com/kr/fs.FileSystem interface. -type Client struct { - clientConn - - maxPacket int // max packet size read or written. - nextid uint32 -} - -// Create creates the named file mode 0666 (before umask), truncating it if it -// already exists. If successful, methods on the returned File can be used for -// I/O; the associated file descriptor has mode O_RDWR. If you need more -// control over the flags/mode used to open the file see client.OpenFile. -func (c *Client) Create(path string) (*File, error) { - return c.open(path, flags(os.O_RDWR|os.O_CREATE|os.O_TRUNC)) -} - -const sftpProtocolVersion = 3 // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 - -func (c *Client) sendInit() error { - return c.clientConn.conn.sendPacket(sshFxInitPacket{ - Version: sftpProtocolVersion, // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 - }) -} - -// returns the next value of c.nextid -func (c *Client) nextID() uint32 { - return atomic.AddUint32(&c.nextid, 1) -} - -func (c *Client) recvVersion() error { - typ, data, err := c.recvPacket() - if err != nil { - return err - } - if typ != ssh_FXP_VERSION { - return &unexpectedPacketErr{ssh_FXP_VERSION, typ} - } - - version, _ := unmarshalUint32(data) - if version != sftpProtocolVersion { - return &unexpectedVersionErr{sftpProtocolVersion, version} - } - - return nil -} - -// Walk returns a new Walker rooted at root. -func (c *Client) Walk(root string) *fs.Walker { - return fs.WalkFS(root, c) -} - -// ReadDir reads the directory named by dirname and returns a list of -// directory entries. -func (c *Client) ReadDir(p string) ([]os.FileInfo, error) { - handle, err := c.opendir(p) - if err != nil { - return nil, err - } - defer c.close(handle) // this has to defer earlier than the lock below - var attrs []os.FileInfo - var done = false - for !done { - id := c.nextID() - typ, data, err1 := c.sendPacket(sshFxpReaddirPacket{ - ID: id, - Handle: handle, - }) - if err1 != nil { - err = err1 - done = true - break - } - switch typ { - case ssh_FXP_NAME: - sid, data := unmarshalUint32(data) - if sid != id { - return nil, &unexpectedIDErr{id, sid} - } - count, data := unmarshalUint32(data) - for i := uint32(0); i < count; i++ { - var filename string - filename, data = unmarshalString(data) - _, data = unmarshalString(data) // discard longname - var attr *FileStat - attr, data = unmarshalAttrs(data) - if filename == "." || filename == ".." { - continue - } - attrs = append(attrs, fileInfoFromStat(attr, path.Base(filename))) - } - case ssh_FXP_STATUS: - // TODO(dfc) scope warning! - err = normaliseError(unmarshalStatus(id, data)) - done = true - default: - return nil, unimplementedPacketErr(typ) - } - } - if err == io.EOF { - err = nil - } - return attrs, err -} - -func (c *Client) opendir(path string) (string, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpOpendirPacket{ - ID: id, - Path: path, - }) - if err != nil { - return "", err - } - switch typ { - case ssh_FXP_HANDLE: - sid, data := unmarshalUint32(data) - if sid != id { - return "", &unexpectedIDErr{id, sid} - } - handle, _ := unmarshalString(data) - return handle, nil - case ssh_FXP_STATUS: - return "", normaliseError(unmarshalStatus(id, data)) - default: - return "", unimplementedPacketErr(typ) - } -} - -// Stat returns a FileInfo structure describing the file specified by path 'p'. -// If 'p' is a symbolic link, the returned FileInfo structure describes the referent file. -func (c *Client) Stat(p string) (os.FileInfo, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpStatPacket{ - ID: id, - Path: p, - }) - if err != nil { - return nil, err - } - switch typ { - case ssh_FXP_ATTRS: - sid, data := unmarshalUint32(data) - if sid != id { - return nil, &unexpectedIDErr{id, sid} - } - attr, _ := unmarshalAttrs(data) - return fileInfoFromStat(attr, path.Base(p)), nil - case ssh_FXP_STATUS: - return nil, normaliseError(unmarshalStatus(id, data)) - default: - return nil, unimplementedPacketErr(typ) - } -} - -// Lstat returns a FileInfo structure describing the file specified by path 'p'. -// If 'p' is a symbolic link, the returned FileInfo structure describes the symbolic link. -func (c *Client) Lstat(p string) (os.FileInfo, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpLstatPacket{ - ID: id, - Path: p, - }) - if err != nil { - return nil, err - } - switch typ { - case ssh_FXP_ATTRS: - sid, data := unmarshalUint32(data) - if sid != id { - return nil, &unexpectedIDErr{id, sid} - } - attr, _ := unmarshalAttrs(data) - return fileInfoFromStat(attr, path.Base(p)), nil - case ssh_FXP_STATUS: - return nil, normaliseError(unmarshalStatus(id, data)) - default: - return nil, unimplementedPacketErr(typ) - } -} - -// ReadLink reads the target of a symbolic link. -func (c *Client) ReadLink(p string) (string, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpReadlinkPacket{ - ID: id, - Path: p, - }) - if err != nil { - return "", err - } - switch typ { - case ssh_FXP_NAME: - sid, data := unmarshalUint32(data) - if sid != id { - return "", &unexpectedIDErr{id, sid} - } - count, data := unmarshalUint32(data) - if count != 1 { - return "", unexpectedCount(1, count) - } - filename, _ := unmarshalString(data) // ignore dummy attributes - return filename, nil - case ssh_FXP_STATUS: - return "", normaliseError(unmarshalStatus(id, data)) - default: - return "", unimplementedPacketErr(typ) - } -} - -// Symlink creates a symbolic link at 'newname', pointing at target 'oldname' -func (c *Client) Symlink(oldname, newname string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpSymlinkPacket{ - ID: id, - Linkpath: newname, - Targetpath: oldname, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -// setstat is a convience wrapper to allow for changing of various parts of the file descriptor. -func (c *Client) setstat(path string, flags uint32, attrs interface{}) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpSetstatPacket{ - ID: id, - Path: path, - Flags: flags, - Attrs: attrs, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -// Chtimes changes the access and modification times of the named file. -func (c *Client) Chtimes(path string, atime time.Time, mtime time.Time) error { - type times struct { - Atime uint32 - Mtime uint32 - } - attrs := times{uint32(atime.Unix()), uint32(mtime.Unix())} - return c.setstat(path, ssh_FILEXFER_ATTR_ACMODTIME, attrs) -} - -// Chown changes the user and group owners of the named file. -func (c *Client) Chown(path string, uid, gid int) error { - type owner struct { - UID uint32 - GID uint32 - } - attrs := owner{uint32(uid), uint32(gid)} - return c.setstat(path, ssh_FILEXFER_ATTR_UIDGID, attrs) -} - -// Chmod changes the permissions of the named file. -func (c *Client) Chmod(path string, mode os.FileMode) error { - return c.setstat(path, ssh_FILEXFER_ATTR_PERMISSIONS, uint32(mode)) -} - -// Truncate sets the size of the named file. Although it may be safely assumed -// that if the size is less than its current size it will be truncated to fit, -// the SFTP protocol does not specify what behavior the server should do when setting -// size greater than the current size. -func (c *Client) Truncate(path string, size int64) error { - return c.setstat(path, ssh_FILEXFER_ATTR_SIZE, uint64(size)) -} - -// Open opens the named file for reading. If successful, methods on the -// returned file can be used for reading; the associated file descriptor -// has mode O_RDONLY. -func (c *Client) Open(path string) (*File, error) { - return c.open(path, flags(os.O_RDONLY)) -} - -// OpenFile is the generalized open call; most users will use Open or -// Create instead. It opens the named file with specified flag (O_RDONLY -// etc.). If successful, methods on the returned File can be used for I/O. -func (c *Client) OpenFile(path string, f int) (*File, error) { - return c.open(path, flags(f)) -} - -func (c *Client) open(path string, pflags uint32) (*File, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpOpenPacket{ - ID: id, - Path: path, - Pflags: pflags, - }) - if err != nil { - return nil, err - } - switch typ { - case ssh_FXP_HANDLE: - sid, data := unmarshalUint32(data) - if sid != id { - return nil, &unexpectedIDErr{id, sid} - } - handle, _ := unmarshalString(data) - return &File{c: c, path: path, handle: handle}, nil - case ssh_FXP_STATUS: - return nil, normaliseError(unmarshalStatus(id, data)) - default: - return nil, unimplementedPacketErr(typ) - } -} - -// close closes a handle handle previously returned in the response -// to SSH_FXP_OPEN or SSH_FXP_OPENDIR. The handle becomes invalid -// immediately after this request has been sent. -func (c *Client) close(handle string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpClosePacket{ - ID: id, - Handle: handle, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -func (c *Client) fstat(handle string) (*FileStat, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpFstatPacket{ - ID: id, - Handle: handle, - }) - if err != nil { - return nil, err - } - switch typ { - case ssh_FXP_ATTRS: - sid, data := unmarshalUint32(data) - if sid != id { - return nil, &unexpectedIDErr{id, sid} - } - attr, _ := unmarshalAttrs(data) - return attr, nil - case ssh_FXP_STATUS: - return nil, normaliseError(unmarshalStatus(id, data)) - default: - return nil, unimplementedPacketErr(typ) - } -} - -// StatVFS retrieves VFS statistics from a remote host. -// -// It implements the statvfs@openssh.com SSH_FXP_EXTENDED feature -// from http://www.opensource.apple.com/source/OpenSSH/OpenSSH-175/openssh/PROTOCOL?txt. -func (c *Client) StatVFS(path string) (*StatVFS, error) { - // send the StatVFS packet to the server - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpStatvfsPacket{ - ID: id, - Path: path, - }) - if err != nil { - return nil, err - } - - switch typ { - // server responded with valid data - case ssh_FXP_EXTENDED_REPLY: - var response StatVFS - err = binary.Read(bytes.NewReader(data), binary.BigEndian, &response) - if err != nil { - return nil, errors.New("can not parse reply") - } - - return &response, nil - - // the resquest failed - case ssh_FXP_STATUS: - return nil, errors.New(fxp(ssh_FXP_STATUS).String()) - - default: - return nil, unimplementedPacketErr(typ) - } -} - -// Join joins any number of path elements into a single path, adding a -// separating slash if necessary. The result is Cleaned; in particular, all -// empty strings are ignored. -func (c *Client) Join(elem ...string) string { return path.Join(elem...) } - -// Remove removes the specified file or directory. An error will be returned if no -// file or directory with the specified path exists, or if the specified directory -// is not empty. -func (c *Client) Remove(path string) error { - err := c.removeFile(path) - if err, ok := err.(*StatusError); ok { - switch err.Code { - // some servers, *cough* osx *cough*, return EPERM, not ENODIR. - // serv-u returns ssh_FX_FILE_IS_A_DIRECTORY - case ssh_FX_PERMISSION_DENIED, ssh_FX_FAILURE, ssh_FX_FILE_IS_A_DIRECTORY: - return c.RemoveDirectory(path) - } - } - return err -} - -func (c *Client) removeFile(path string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpRemovePacket{ - ID: id, - Filename: path, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -// RemoveDirectory removes a directory path. -func (c *Client) RemoveDirectory(path string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpRmdirPacket{ - ID: id, - Path: path, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -// Rename renames a file. -func (c *Client) Rename(oldname, newname string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpRenamePacket{ - ID: id, - Oldpath: oldname, - Newpath: newname, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -// PosixRename renames a file using the posix-rename@openssh.com extension -// which will replace newname if it already exists. -func (c *Client) PosixRename(oldname, newname string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpPosixRenamePacket{ - ID: id, - Oldpath: oldname, - Newpath: newname, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -func (c *Client) realpath(path string) (string, error) { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpRealpathPacket{ - ID: id, - Path: path, - }) - if err != nil { - return "", err - } - switch typ { - case ssh_FXP_NAME: - sid, data := unmarshalUint32(data) - if sid != id { - return "", &unexpectedIDErr{id, sid} - } - count, data := unmarshalUint32(data) - if count != 1 { - return "", unexpectedCount(1, count) - } - filename, _ := unmarshalString(data) // ignore attributes - return filename, nil - case ssh_FXP_STATUS: - return "", normaliseError(unmarshalStatus(id, data)) - default: - return "", unimplementedPacketErr(typ) - } -} - -// Getwd returns the current working directory of the server. Operations -// involving relative paths will be based at this location. -func (c *Client) Getwd() (string, error) { - return c.realpath(".") -} - -// Mkdir creates the specified directory. An error will be returned if a file or -// directory with the specified path already exists, or if the directory's -// parent folder does not exist (the method cannot create complete paths). -func (c *Client) Mkdir(path string) error { - id := c.nextID() - typ, data, err := c.sendPacket(sshFxpMkdirPacket{ - ID: id, - Path: path, - }) - if err != nil { - return err - } - switch typ { - case ssh_FXP_STATUS: - return normaliseError(unmarshalStatus(id, data)) - default: - return unimplementedPacketErr(typ) - } -} - -// applyOptions applies options functions to the Client. -// If an error is encountered, option processing ceases. -func (c *Client) applyOptions(opts ...ClientOption) error { - for _, f := range opts { - if err := f(c); err != nil { - return err - } - } - return nil -} - -// File represents a remote file. -type File struct { - c *Client - path string - handle string - offset uint64 // current offset within remote file -} - -// Close closes the File, rendering it unusable for I/O. It returns an -// error, if any. -func (f *File) Close() error { - return f.c.close(f.handle) -} - -// Name returns the name of the file as presented to Open or Create. -func (f *File) Name() string { - return f.path -} - -const maxConcurrentRequests = 64 - -// Read reads up to len(b) bytes from the File. It returns the number of bytes -// read and an error, if any. Read follows io.Reader semantics, so when Read -// encounters an error or EOF condition after successfully reading n > 0 bytes, -// it returns the number of bytes read. -func (f *File) Read(b []byte) (int, error) { - // Split the read into multiple maxPacket sized concurrent reads - // bounded by maxConcurrentRequests. This allows reads with a suitably - // large buffer to transfer data at a much faster rate due to - // overlapping round trip times. - inFlight := 0 - desiredInFlight := 1 - offset := f.offset - // maxConcurrentRequests buffer to deal with broadcastErr() floods - // also must have a buffer of max value of (desiredInFlight - inFlight) - ch := make(chan result, maxConcurrentRequests) - type inflightRead struct { - b []byte - offset uint64 - } - reqs := map[uint32]inflightRead{} - type offsetErr struct { - offset uint64 - err error - } - var firstErr offsetErr - - sendReq := func(b []byte, offset uint64) { - reqID := f.c.nextID() - f.c.dispatchRequest(ch, sshFxpReadPacket{ - ID: reqID, - Handle: f.handle, - Offset: offset, - Len: uint32(len(b)), - }) - inFlight++ - reqs[reqID] = inflightRead{b: b, offset: offset} - } - - var read int - for len(b) > 0 || inFlight > 0 { - for inFlight < desiredInFlight && len(b) > 0 && firstErr.err == nil { - l := min(len(b), f.c.maxPacket) - rb := b[:l] - sendReq(rb, offset) - offset += uint64(l) - b = b[l:] - } - - if inFlight == 0 { - break - } - res := <-ch - inFlight-- - if res.err != nil { - firstErr = offsetErr{offset: 0, err: res.err} - continue - } - reqID, data := unmarshalUint32(res.data) - req, ok := reqs[reqID] - if !ok { - firstErr = offsetErr{offset: 0, err: errors.Errorf("sid: %v not found", reqID)} - continue - } - delete(reqs, reqID) - switch res.typ { - case ssh_FXP_STATUS: - if firstErr.err == nil || req.offset < firstErr.offset { - firstErr = offsetErr{ - offset: req.offset, - err: normaliseError(unmarshalStatus(reqID, res.data)), - } - } - case ssh_FXP_DATA: - l, data := unmarshalUint32(data) - n := copy(req.b, data[:l]) - read += n - if n < len(req.b) { - sendReq(req.b[l:], req.offset+uint64(l)) - } - if desiredInFlight < maxConcurrentRequests { - desiredInFlight++ - } - default: - firstErr = offsetErr{offset: 0, err: unimplementedPacketErr(res.typ)} - } - } - // If the error is anything other than EOF, then there - // may be gaps in the data copied to the buffer so it's - // best to return 0 so the caller can't make any - // incorrect assumptions about the state of the buffer. - if firstErr.err != nil && firstErr.err != io.EOF { - read = 0 - } - f.offset += uint64(read) - return read, firstErr.err -} - -// WriteTo writes the file to w. The return value is the number of bytes -// written. Any error encountered during the write is also returned. -func (f *File) WriteTo(w io.Writer) (int64, error) { - fi, err := f.Stat() - if err != nil { - return 0, err - } - inFlight := 0 - desiredInFlight := 1 - offset := f.offset - writeOffset := offset - fileSize := uint64(fi.Size()) - // see comment on same line in Read() above - ch := make(chan result, maxConcurrentRequests) - type inflightRead struct { - b []byte - offset uint64 - } - reqs := map[uint32]inflightRead{} - pendingWrites := map[uint64][]byte{} - type offsetErr struct { - offset uint64 - err error - } - var firstErr offsetErr - - sendReq := func(b []byte, offset uint64) { - reqID := f.c.nextID() - f.c.dispatchRequest(ch, sshFxpReadPacket{ - ID: reqID, - Handle: f.handle, - Offset: offset, - Len: uint32(len(b)), - }) - inFlight++ - reqs[reqID] = inflightRead{b: b, offset: offset} - } - - var copied int64 - for firstErr.err == nil || inFlight > 0 { - if firstErr.err == nil { - for inFlight+len(pendingWrites) < desiredInFlight { - b := make([]byte, f.c.maxPacket) - sendReq(b, offset) - offset += uint64(f.c.maxPacket) - if offset > fileSize { - desiredInFlight = 1 - } - } - } - - if inFlight == 0 { - if firstErr.err == nil && len(pendingWrites) > 0 { - return copied, InternalInconsistency - } - break - } - res := <-ch - inFlight-- - if res.err != nil { - firstErr = offsetErr{offset: 0, err: res.err} - continue - } - reqID, data := unmarshalUint32(res.data) - req, ok := reqs[reqID] - if !ok { - firstErr = offsetErr{offset: 0, err: errors.Errorf("sid: %v not found", reqID)} - continue - } - delete(reqs, reqID) - switch res.typ { - case ssh_FXP_STATUS: - if firstErr.err == nil || req.offset < firstErr.offset { - firstErr = offsetErr{offset: req.offset, err: normaliseError(unmarshalStatus(reqID, res.data))} - } - case ssh_FXP_DATA: - l, data := unmarshalUint32(data) - if req.offset == writeOffset { - nbytes, err := w.Write(data) - copied += int64(nbytes) - if err != nil { - // We will never receive another DATA with offset==writeOffset, so - // the loop will drain inFlight and then exit. - firstErr = offsetErr{offset: req.offset + uint64(nbytes), err: err} - break - } - if nbytes < int(l) { - firstErr = offsetErr{offset: req.offset + uint64(nbytes), err: io.ErrShortWrite} - break - } - switch { - case offset > fileSize: - desiredInFlight = 1 - case desiredInFlight < maxConcurrentRequests: - desiredInFlight++ - } - writeOffset += uint64(nbytes) - for { - pendingData, ok := pendingWrites[writeOffset] - if !ok { - break - } - // Give go a chance to free the memory. - delete(pendingWrites, writeOffset) - nbytes, err := w.Write(pendingData) - // Do not move writeOffset on error so subsequent iterations won't trigger - // any writes. - if err != nil { - firstErr = offsetErr{offset: writeOffset + uint64(nbytes), err: err} - break - } - if nbytes < len(pendingData) { - firstErr = offsetErr{offset: writeOffset + uint64(nbytes), err: io.ErrShortWrite} - break - } - writeOffset += uint64(nbytes) - } - } else { - // Don't write the data yet because - // this response came in out of order - // and we need to wait for responses - // for earlier segments of the file. - pendingWrites[req.offset] = data - } - default: - firstErr = offsetErr{offset: 0, err: unimplementedPacketErr(res.typ)} - } - } - if firstErr.err != io.EOF { - return copied, firstErr.err - } - return copied, nil -} - -// Stat returns the FileInfo structure describing file. If there is an -// error. -func (f *File) Stat() (os.FileInfo, error) { - fs, err := f.c.fstat(f.handle) - if err != nil { - return nil, err - } - return fileInfoFromStat(fs, path.Base(f.path)), nil -} - -// Write writes len(b) bytes to the File. It returns the number of bytes -// written and an error, if any. Write returns a non-nil error when n != -// len(b). -func (f *File) Write(b []byte) (int, error) { - // Split the write into multiple maxPacket sized concurrent writes - // bounded by maxConcurrentRequests. This allows writes with a suitably - // large buffer to transfer data at a much faster rate due to - // overlapping round trip times. - inFlight := 0 - desiredInFlight := 1 - offset := f.offset - // see comment on same line in Read() above - ch := make(chan result, maxConcurrentRequests) - var firstErr error - written := len(b) - for len(b) > 0 || inFlight > 0 { - for inFlight < desiredInFlight && len(b) > 0 && firstErr == nil { - l := min(len(b), f.c.maxPacket) - rb := b[:l] - f.c.dispatchRequest(ch, sshFxpWritePacket{ - ID: f.c.nextID(), - Handle: f.handle, - Offset: offset, - Length: uint32(len(rb)), - Data: rb, - }) - inFlight++ - offset += uint64(l) - b = b[l:] - } - - if inFlight == 0 { - break - } - res := <-ch - inFlight-- - if res.err != nil { - firstErr = res.err - continue - } - switch res.typ { - case ssh_FXP_STATUS: - id, _ := unmarshalUint32(res.data) - err := normaliseError(unmarshalStatus(id, res.data)) - if err != nil && firstErr == nil { - firstErr = err - break - } - if desiredInFlight < maxConcurrentRequests { - desiredInFlight++ - } - default: - firstErr = unimplementedPacketErr(res.typ) - } - } - // If error is non-nil, then there may be gaps in the data written to - // the file so it's best to return 0 so the caller can't make any - // incorrect assumptions about the state of the file. - if firstErr != nil { - written = 0 - } - f.offset += uint64(written) - return written, firstErr -} - -// ReadFrom reads data from r until EOF and writes it to the file. The return -// value is the number of bytes read. Any error except io.EOF encountered -// during the read is also returned. -func (f *File) ReadFrom(r io.Reader) (int64, error) { - inFlight := 0 - desiredInFlight := 1 - offset := f.offset - // see comment on same line in Read() above - ch := make(chan result, maxConcurrentRequests) - var firstErr error - read := int64(0) - b := make([]byte, f.c.maxPacket) - for inFlight > 0 || firstErr == nil { - for inFlight < desiredInFlight && firstErr == nil { - n, err := r.Read(b) - if err != nil { - firstErr = err - } - f.c.dispatchRequest(ch, sshFxpWritePacket{ - ID: f.c.nextID(), - Handle: f.handle, - Offset: offset, - Length: uint32(n), - Data: b[:n], - }) - inFlight++ - offset += uint64(n) - read += int64(n) - } - - if inFlight == 0 { - break - } - res := <-ch - inFlight-- - if res.err != nil { - firstErr = res.err - continue - } - switch res.typ { - case ssh_FXP_STATUS: - id, _ := unmarshalUint32(res.data) - err := normaliseError(unmarshalStatus(id, res.data)) - if err != nil && firstErr == nil { - firstErr = err - break - } - if desiredInFlight < maxConcurrentRequests { - desiredInFlight++ - } - default: - firstErr = unimplementedPacketErr(res.typ) - } - } - if firstErr == io.EOF { - firstErr = nil - } - // If error is non-nil, then there may be gaps in the data written to - // the file so it's best to return 0 so the caller can't make any - // incorrect assumptions about the state of the file. - if firstErr != nil { - read = 0 - } - f.offset += uint64(read) - return read, firstErr -} - -// Seek implements io.Seeker by setting the client offset for the next Read or -// Write. It returns the next offset read. Seeking before or after the end of -// the file is undefined. Seeking relative to the end calls Stat. -func (f *File) Seek(offset int64, whence int) (int64, error) { - switch whence { - case io.SeekStart: - f.offset = uint64(offset) - case io.SeekCurrent: - f.offset = uint64(int64(f.offset) + offset) - case io.SeekEnd: - fi, err := f.Stat() - if err != nil { - return int64(f.offset), err - } - f.offset = uint64(fi.Size() + offset) - default: - return int64(f.offset), unimplementedSeekWhence(whence) - } - return int64(f.offset), nil -} - -// Chown changes the uid/gid of the current file. -func (f *File) Chown(uid, gid int) error { - return f.c.Chown(f.path, uid, gid) -} - -// Chmod changes the permissions of the current file. -func (f *File) Chmod(mode os.FileMode) error { - return f.c.Chmod(f.path, mode) -} - -// Truncate sets the size of the current file. Although it may be safely assumed -// that if the size is less than its current size it will be truncated to fit, -// the SFTP protocol does not specify what behavior the server should do when setting -// size greater than the current size. -func (f *File) Truncate(size int64) error { - return f.c.Truncate(f.path, size) -} - -func min(a, b int) int { - if a > b { - return b - } - return a -} - -// normaliseError normalises an error into a more standard form that can be -// checked against stdlib errors like io.EOF or os.ErrNotExist. -func normaliseError(err error) error { - switch err := err.(type) { - case *StatusError: - switch err.Code { - case ssh_FX_EOF: - return io.EOF - case ssh_FX_NO_SUCH_FILE: - return os.ErrNotExist - case ssh_FX_OK: - return nil - default: - return err - } - default: - return err - } -} - -func unmarshalStatus(id uint32, data []byte) error { - sid, data := unmarshalUint32(data) - if sid != id { - return &unexpectedIDErr{id, sid} - } - code, data := unmarshalUint32(data) - msg, data, _ := unmarshalStringSafe(data) - lang, _, _ := unmarshalStringSafe(data) - return &StatusError{ - Code: code, - msg: msg, - lang: lang, - } -} - -func marshalStatus(b []byte, err StatusError) []byte { - b = marshalUint32(b, err.Code) - b = marshalString(b, err.msg) - b = marshalString(b, err.lang) - return b -} - -// flags converts the flags passed to OpenFile into ssh flags. -// Unsupported flags are ignored. -func flags(f int) uint32 { - var out uint32 - switch f & os.O_WRONLY { - case os.O_WRONLY: - out |= ssh_FXF_WRITE - case os.O_RDONLY: - out |= ssh_FXF_READ - } - if f&os.O_RDWR == os.O_RDWR { - out |= ssh_FXF_READ | ssh_FXF_WRITE - } - if f&os.O_APPEND == os.O_APPEND { - out |= ssh_FXF_APPEND - } - if f&os.O_CREATE == os.O_CREATE { - out |= ssh_FXF_CREAT - } - if f&os.O_TRUNC == os.O_TRUNC { - out |= ssh_FXF_TRUNC - } - if f&os.O_EXCL == os.O_EXCL { - out |= ssh_FXF_EXCL - } - return out -} diff --git a/vendor/github.com/pkg/sftp/conn.go b/vendor/github.com/pkg/sftp/conn.go deleted file mode 100644 index f799715e..00000000 --- a/vendor/github.com/pkg/sftp/conn.go +++ /dev/null @@ -1,133 +0,0 @@ -package sftp - -import ( - "encoding" - "io" - "sync" - - "github.com/pkg/errors" -) - -// conn implements a bidirectional channel on which client and server -// connections are multiplexed. -type conn struct { - io.Reader - io.WriteCloser - sync.Mutex // used to serialise writes to sendPacket - // sendPacketTest is needed to replicate packet issues in testing - sendPacketTest func(w io.Writer, m encoding.BinaryMarshaler) error -} - -func (c *conn) recvPacket() (uint8, []byte, error) { - return recvPacket(c) -} - -func (c *conn) sendPacket(m encoding.BinaryMarshaler) error { - c.Lock() - defer c.Unlock() - if c.sendPacketTest != nil { - return c.sendPacketTest(c, m) - } - return sendPacket(c, m) -} - -type clientConn struct { - conn - wg sync.WaitGroup - sync.Mutex // protects inflight - inflight map[uint32]chan<- result // outstanding requests -} - -// Close closes the SFTP session. -func (c *clientConn) Close() error { - defer c.wg.Wait() - return c.conn.Close() -} - -func (c *clientConn) loop() { - defer c.wg.Done() - err := c.recv() - if err != nil { - c.broadcastErr(err) - } -} - -// recv continuously reads from the server and forwards responses to the -// appropriate channel. -func (c *clientConn) recv() error { - defer func() { - c.conn.Lock() - c.conn.Close() - c.conn.Unlock() - }() - for { - typ, data, err := c.recvPacket() - if err != nil { - return err - } - sid, _ := unmarshalUint32(data) - c.Lock() - ch, ok := c.inflight[sid] - delete(c.inflight, sid) - c.Unlock() - if !ok { - // This is an unexpected occurrence. Send the error - // back to all listeners so that they terminate - // gracefully. - return errors.Errorf("sid: %v not fond", sid) - } - ch <- result{typ: typ, data: data} - } -} - -// result captures the result of receiving the a packet from the server -type result struct { - typ byte - data []byte - err error -} - -type idmarshaler interface { - id() uint32 - encoding.BinaryMarshaler -} - -func (c *clientConn) sendPacket(p idmarshaler) (byte, []byte, error) { - ch := make(chan result, 2) - c.dispatchRequest(ch, p) - s := <-ch - return s.typ, s.data, s.err -} - -func (c *clientConn) dispatchRequest(ch chan<- result, p idmarshaler) { - c.Lock() - c.inflight[p.id()] = ch - c.Unlock() - if err := c.conn.sendPacket(p); err != nil { - c.Lock() - delete(c.inflight, p.id()) - c.Unlock() - ch <- result{err: err} - } -} - -// broadcastErr sends an error to all goroutines waiting for a response. -func (c *clientConn) broadcastErr(err error) { - c.Lock() - listeners := make([]chan<- result, 0, len(c.inflight)) - for _, ch := range c.inflight { - listeners = append(listeners, ch) - } - c.Unlock() - for _, ch := range listeners { - ch <- result{err: err} - } -} - -type serverConn struct { - conn -} - -func (s *serverConn) sendError(p ider, err error) error { - return s.sendPacket(statusFromError(p, err)) -} diff --git a/vendor/github.com/pkg/sftp/debug.go b/vendor/github.com/pkg/sftp/debug.go deleted file mode 100644 index 3e264abe..00000000 --- a/vendor/github.com/pkg/sftp/debug.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build debug - -package sftp - -import "log" - -func debug(fmt string, args ...interface{}) { - log.Printf(fmt, args...) -} diff --git a/vendor/github.com/pkg/sftp/examples/buffered-read-benchmark/main.go b/vendor/github.com/pkg/sftp/examples/buffered-read-benchmark/main.go deleted file mode 100644 index 36ac6d72..00000000 --- a/vendor/github.com/pkg/sftp/examples/buffered-read-benchmark/main.go +++ /dev/null @@ -1,78 +0,0 @@ -// buffered-read-benchmark benchmarks the peformance of reading -// from /dev/zero on the server to a []byte on the client via io.Copy. -package main - -import ( - "flag" - "fmt" - "io" - "log" - "net" - "os" - "time" - - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" - - "github.com/pkg/sftp" -) - -var ( - USER = flag.String("user", os.Getenv("USER"), "ssh username") - HOST = flag.String("host", "localhost", "ssh server hostname") - PORT = flag.Int("port", 22, "ssh server port") - PASS = flag.String("pass", os.Getenv("SOCKSIE_SSH_PASSWORD"), "ssh password") - SIZE = flag.Int("s", 1<<15, "set max packet size") -) - -func init() { - flag.Parse() -} - -func main() { - var auths []ssh.AuthMethod - if aconn, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")); err == nil { - auths = append(auths, ssh.PublicKeysCallback(agent.NewClient(aconn).Signers)) - - } - if *PASS != "" { - auths = append(auths, ssh.Password(*PASS)) - } - - config := ssh.ClientConfig{ - User: *USER, - Auth: auths, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - } - addr := fmt.Sprintf("%s:%d", *HOST, *PORT) - conn, err := ssh.Dial("tcp", addr, &config) - if err != nil { - log.Fatalf("unable to connect to [%s]: %v", addr, err) - } - defer conn.Close() - - c, err := sftp.NewClient(conn, sftp.MaxPacket(*SIZE)) - if err != nil { - log.Fatalf("unable to start sftp subsytem: %v", err) - } - defer c.Close() - - r, err := c.Open("/dev/zero") - if err != nil { - log.Fatal(err) - } - defer r.Close() - - const size = 1e9 - - log.Printf("reading %v bytes", size) - t1 := time.Now() - n, err := io.ReadFull(r, make([]byte, size)) - if err != nil { - log.Fatal(err) - } - if n != size { - log.Fatalf("copy: expected %v bytes, got %d", size, n) - } - log.Printf("read %v bytes in %s", size, time.Since(t1)) -} diff --git a/vendor/github.com/pkg/sftp/examples/buffered-write-benchmark/main.go b/vendor/github.com/pkg/sftp/examples/buffered-write-benchmark/main.go deleted file mode 100644 index d1babedb..00000000 --- a/vendor/github.com/pkg/sftp/examples/buffered-write-benchmark/main.go +++ /dev/null @@ -1,84 +0,0 @@ -// buffered-write-benchmark benchmarks the peformance of writing -// a single large []byte on the client to /dev/null on the server via io.Copy. -package main - -import ( - "flag" - "fmt" - "log" - "net" - "os" - "syscall" - "time" - - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" - - "github.com/pkg/sftp" -) - -var ( - USER = flag.String("user", os.Getenv("USER"), "ssh username") - HOST = flag.String("host", "localhost", "ssh server hostname") - PORT = flag.Int("port", 22, "ssh server port") - PASS = flag.String("pass", os.Getenv("SOCKSIE_SSH_PASSWORD"), "ssh password") - SIZE = flag.Int("s", 1<<15, "set max packet size") -) - -func init() { - flag.Parse() -} - -func main() { - var auths []ssh.AuthMethod - if aconn, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")); err == nil { - auths = append(auths, ssh.PublicKeysCallback(agent.NewClient(aconn).Signers)) - - } - if *PASS != "" { - auths = append(auths, ssh.Password(*PASS)) - } - - config := ssh.ClientConfig{ - User: *USER, - Auth: auths, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - } - addr := fmt.Sprintf("%s:%d", *HOST, *PORT) - conn, err := ssh.Dial("tcp", addr, &config) - if err != nil { - log.Fatalf("unable to connect to [%s]: %v", addr, err) - } - defer conn.Close() - - c, err := sftp.NewClient(conn, sftp.MaxPacket(*SIZE)) - if err != nil { - log.Fatalf("unable to start sftp subsytem: %v", err) - } - defer c.Close() - - w, err := c.OpenFile("/dev/null", syscall.O_WRONLY) - if err != nil { - log.Fatal(err) - } - defer w.Close() - - f, err := os.Open("/dev/zero") - if err != nil { - log.Fatal(err) - } - defer f.Close() - - const size = 1e9 - - log.Printf("writing %v bytes", size) - t1 := time.Now() - n, err := w.Write(make([]byte, size)) - if err != nil { - log.Fatal(err) - } - if n != size { - log.Fatalf("copy: expected %v bytes, got %d", size, n) - } - log.Printf("wrote %v bytes in %s", size, time.Since(t1)) -} diff --git a/vendor/github.com/pkg/sftp/examples/request-server/main.go b/vendor/github.com/pkg/sftp/examples/request-server/main.go deleted file mode 100644 index fd21b43e..00000000 --- a/vendor/github.com/pkg/sftp/examples/request-server/main.go +++ /dev/null @@ -1,131 +0,0 @@ -// An example SFTP server implementation using the golang SSH package. -// Serves the whole filesystem visible to the user, and has a hard-coded username and password, -// so not for real use! -package main - -import ( - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "net" - "os" - - "github.com/pkg/sftp" - "golang.org/x/crypto/ssh" -) - -// Based on example server code from golang.org/x/crypto/ssh and server_standalone -func main() { - - var ( - readOnly bool - debugStderr bool - ) - - flag.BoolVar(&readOnly, "R", false, "read-only server") - flag.BoolVar(&debugStderr, "e", false, "debug to stderr") - flag.Parse() - - debugStream := ioutil.Discard - if debugStderr { - debugStream = os.Stderr - } - - // An SSH server is represented by a ServerConfig, which holds - // certificate details and handles authentication of ServerConns. - config := &ssh.ServerConfig{ - PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) { - // Should use constant-time compare (or better, salt+hash) in - // a production setting. - fmt.Fprintf(debugStream, "Login: %s\n", c.User()) - if c.User() == "testuser" && string(pass) == "tiger" { - return nil, nil - } - return nil, fmt.Errorf("password rejected for %q", c.User()) - }, - } - - privateBytes, err := ioutil.ReadFile("id_rsa") - if err != nil { - log.Fatal("Failed to load private key", err) - } - - private, err := ssh.ParsePrivateKey(privateBytes) - if err != nil { - log.Fatal("Failed to parse private key", err) - } - - config.AddHostKey(private) - - // Once a ServerConfig has been configured, connections can be - // accepted. - listener, err := net.Listen("tcp", "0.0.0.0:2022") - if err != nil { - log.Fatal("failed to listen for connection", err) - } - fmt.Printf("Listening on %v\n", listener.Addr()) - - nConn, err := listener.Accept() - if err != nil { - log.Fatal("failed to accept incoming connection", err) - } - - // Before use, a handshake must be performed on the incoming net.Conn. - sconn, chans, reqs, err := ssh.NewServerConn(nConn, config) - if err != nil { - log.Fatal("failed to handshake", err) - } - log.Println("login detected:", sconn.User()) - fmt.Fprintf(debugStream, "SSH server established\n") - - // The incoming Request channel must be serviced. - go ssh.DiscardRequests(reqs) - - // Service the incoming Channel channel. - for newChannel := range chans { - // Channels have a type, depending on the application level - // protocol intended. In the case of an SFTP session, this is "subsystem" - // with a payload string of "sftp" - fmt.Fprintf(debugStream, "Incoming channel: %s\n", newChannel.ChannelType()) - if newChannel.ChannelType() != "session" { - newChannel.Reject(ssh.UnknownChannelType, "unknown channel type") - fmt.Fprintf(debugStream, "Unknown channel type: %s\n", newChannel.ChannelType()) - continue - } - channel, requests, err := newChannel.Accept() - if err != nil { - log.Fatal("could not accept channel.", err) - } - fmt.Fprintf(debugStream, "Channel accepted\n") - - // Sessions have out-of-band requests such as "shell", - // "pty-req" and "env". Here we handle only the - // "subsystem" request. - go func(in <-chan *ssh.Request) { - for req := range in { - fmt.Fprintf(debugStream, "Request: %v\n", req.Type) - ok := false - switch req.Type { - case "subsystem": - fmt.Fprintf(debugStream, "Subsystem: %s\n", req.Payload[4:]) - if string(req.Payload[4:]) == "sftp" { - ok = true - } - } - fmt.Fprintf(debugStream, " - accepted: %v\n", ok) - req.Reply(ok, nil) - } - }(requests) - - root := sftp.InMemHandler() - server := sftp.NewRequestServer(channel, root) - if err := server.Serve(); err == io.EOF { - server.Close() - log.Print("sftp client exited session.") - } else if err != nil { - log.Fatal("sftp server completed with error:", err) - } - } -} diff --git a/vendor/github.com/pkg/sftp/examples/sftp-server/main.go b/vendor/github.com/pkg/sftp/examples/sftp-server/main.go deleted file mode 100644 index 48e0e868..00000000 --- a/vendor/github.com/pkg/sftp/examples/sftp-server/main.go +++ /dev/null @@ -1,147 +0,0 @@ -// An example SFTP server implementation using the golang SSH package. -// Serves the whole filesystem visible to the user, and has a hard-coded username and password, -// so not for real use! -package main - -import ( - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "net" - "os" - - "github.com/pkg/sftp" - "golang.org/x/crypto/ssh" -) - -// Based on example server code from golang.org/x/crypto/ssh and server_standalone -func main() { - - var ( - readOnly bool - debugStderr bool - ) - - flag.BoolVar(&readOnly, "R", false, "read-only server") - flag.BoolVar(&debugStderr, "e", false, "debug to stderr") - flag.Parse() - - debugStream := ioutil.Discard - if debugStderr { - debugStream = os.Stderr - } - - // An SSH server is represented by a ServerConfig, which holds - // certificate details and handles authentication of ServerConns. - config := &ssh.ServerConfig{ - PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) { - // Should use constant-time compare (or better, salt+hash) in - // a production setting. - fmt.Fprintf(debugStream, "Login: %s\n", c.User()) - if c.User() == "testuser" && string(pass) == "tiger" { - return nil, nil - } - return nil, fmt.Errorf("password rejected for %q", c.User()) - }, - } - - privateBytes, err := ioutil.ReadFile("id_rsa") - if err != nil { - log.Fatal("Failed to load private key", err) - } - - private, err := ssh.ParsePrivateKey(privateBytes) - if err != nil { - log.Fatal("Failed to parse private key", err) - } - - config.AddHostKey(private) - - // Once a ServerConfig has been configured, connections can be - // accepted. - listener, err := net.Listen("tcp", "0.0.0.0:2022") - if err != nil { - log.Fatal("failed to listen for connection", err) - } - fmt.Printf("Listening on %v\n", listener.Addr()) - - nConn, err := listener.Accept() - if err != nil { - log.Fatal("failed to accept incoming connection", err) - } - - // Before use, a handshake must be performed on the incoming - // net.Conn. - _, chans, reqs, err := ssh.NewServerConn(nConn, config) - if err != nil { - log.Fatal("failed to handshake", err) - } - fmt.Fprintf(debugStream, "SSH server established\n") - - // The incoming Request channel must be serviced. - go ssh.DiscardRequests(reqs) - - // Service the incoming Channel channel. - for newChannel := range chans { - // Channels have a type, depending on the application level - // protocol intended. In the case of an SFTP session, this is "subsystem" - // with a payload string of "sftp" - fmt.Fprintf(debugStream, "Incoming channel: %s\n", newChannel.ChannelType()) - if newChannel.ChannelType() != "session" { - newChannel.Reject(ssh.UnknownChannelType, "unknown channel type") - fmt.Fprintf(debugStream, "Unknown channel type: %s\n", newChannel.ChannelType()) - continue - } - channel, requests, err := newChannel.Accept() - if err != nil { - log.Fatal("could not accept channel.", err) - } - fmt.Fprintf(debugStream, "Channel accepted\n") - - // Sessions have out-of-band requests such as "shell", - // "pty-req" and "env". Here we handle only the - // "subsystem" request. - go func(in <-chan *ssh.Request) { - for req := range in { - fmt.Fprintf(debugStream, "Request: %v\n", req.Type) - ok := false - switch req.Type { - case "subsystem": - fmt.Fprintf(debugStream, "Subsystem: %s\n", req.Payload[4:]) - if string(req.Payload[4:]) == "sftp" { - ok = true - } - } - fmt.Fprintf(debugStream, " - accepted: %v\n", ok) - req.Reply(ok, nil) - } - }(requests) - - serverOptions := []sftp.ServerOption{ - sftp.WithDebug(debugStream), - } - - if readOnly { - serverOptions = append(serverOptions, sftp.ReadOnly()) - fmt.Fprintf(debugStream, "Read-only server\n") - } else { - fmt.Fprintf(debugStream, "Read write server\n") - } - - server, err := sftp.NewServer( - channel, - serverOptions..., - ) - if err != nil { - log.Fatal(err) - } - if err := server.Serve(); err == io.EOF { - server.Close() - log.Print("sftp client exited session.") - } else if err != nil { - log.Fatal("sftp server completed with error:", err) - } - } -} diff --git a/vendor/github.com/pkg/sftp/examples/streaming-read-benchmark/main.go b/vendor/github.com/pkg/sftp/examples/streaming-read-benchmark/main.go deleted file mode 100644 index 87afc5a3..00000000 --- a/vendor/github.com/pkg/sftp/examples/streaming-read-benchmark/main.go +++ /dev/null @@ -1,85 +0,0 @@ -// streaming-read-benchmark benchmarks the peformance of reading -// from /dev/zero on the server to /dev/null on the client via io.Copy. -package main - -import ( - "flag" - "fmt" - "io" - "log" - "net" - "os" - "syscall" - "time" - - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" - - "github.com/pkg/sftp" -) - -var ( - USER = flag.String("user", os.Getenv("USER"), "ssh username") - HOST = flag.String("host", "localhost", "ssh server hostname") - PORT = flag.Int("port", 22, "ssh server port") - PASS = flag.String("pass", os.Getenv("SOCKSIE_SSH_PASSWORD"), "ssh password") - SIZE = flag.Int("s", 1<<15, "set max packet size") -) - -func init() { - flag.Parse() -} - -func main() { - var auths []ssh.AuthMethod - if aconn, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")); err == nil { - auths = append(auths, ssh.PublicKeysCallback(agent.NewClient(aconn).Signers)) - - } - if *PASS != "" { - auths = append(auths, ssh.Password(*PASS)) - } - - config := ssh.ClientConfig{ - User: *USER, - Auth: auths, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - } - addr := fmt.Sprintf("%s:%d", *HOST, *PORT) - conn, err := ssh.Dial("tcp", addr, &config) - if err != nil { - log.Fatalf("unable to connect to [%s]: %v", addr, err) - } - defer conn.Close() - - c, err := sftp.NewClient(conn, sftp.MaxPacket(*SIZE)) - if err != nil { - log.Fatalf("unable to start sftp subsytem: %v", err) - } - defer c.Close() - - r, err := c.Open("/dev/zero") - if err != nil { - log.Fatal(err) - } - defer r.Close() - - w, err := os.OpenFile("/dev/null", syscall.O_WRONLY, 0600) - if err != nil { - log.Fatal(err) - } - defer w.Close() - - const size int64 = 1e9 - - log.Printf("reading %v bytes", size) - t1 := time.Now() - n, err := io.Copy(w, io.LimitReader(r, size)) - if err != nil { - log.Fatal(err) - } - if n != size { - log.Fatalf("copy: expected %v bytes, got %d", size, n) - } - log.Printf("read %v bytes in %s", size, time.Since(t1)) -} diff --git a/vendor/github.com/pkg/sftp/examples/streaming-write-benchmark/main.go b/vendor/github.com/pkg/sftp/examples/streaming-write-benchmark/main.go deleted file mode 100644 index 8f432d39..00000000 --- a/vendor/github.com/pkg/sftp/examples/streaming-write-benchmark/main.go +++ /dev/null @@ -1,85 +0,0 @@ -// streaming-write-benchmark benchmarks the peformance of writing -// from /dev/zero on the client to /dev/null on the server via io.Copy. -package main - -import ( - "flag" - "fmt" - "io" - "log" - "net" - "os" - "syscall" - "time" - - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" - - "github.com/pkg/sftp" -) - -var ( - USER = flag.String("user", os.Getenv("USER"), "ssh username") - HOST = flag.String("host", "localhost", "ssh server hostname") - PORT = flag.Int("port", 22, "ssh server port") - PASS = flag.String("pass", os.Getenv("SOCKSIE_SSH_PASSWORD"), "ssh password") - SIZE = flag.Int("s", 1<<15, "set max packet size") -) - -func init() { - flag.Parse() -} - -func main() { - var auths []ssh.AuthMethod - if aconn, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK")); err == nil { - auths = append(auths, ssh.PublicKeysCallback(agent.NewClient(aconn).Signers)) - - } - if *PASS != "" { - auths = append(auths, ssh.Password(*PASS)) - } - - config := ssh.ClientConfig{ - User: *USER, - Auth: auths, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - } - addr := fmt.Sprintf("%s:%d", *HOST, *PORT) - conn, err := ssh.Dial("tcp", addr, &config) - if err != nil { - log.Fatalf("unable to connect to [%s]: %v", addr, err) - } - defer conn.Close() - - c, err := sftp.NewClient(conn, sftp.MaxPacket(*SIZE)) - if err != nil { - log.Fatalf("unable to start sftp subsytem: %v", err) - } - defer c.Close() - - w, err := c.OpenFile("/dev/null", syscall.O_WRONLY) - if err != nil { - log.Fatal(err) - } - defer w.Close() - - f, err := os.Open("/dev/zero") - if err != nil { - log.Fatal(err) - } - defer f.Close() - - const size int64 = 1e9 - - log.Printf("writing %v bytes", size) - t1 := time.Now() - n, err := io.Copy(w, io.LimitReader(f, size)) - if err != nil { - log.Fatal(err) - } - if n != size { - log.Fatalf("copy: expected %v bytes, got %d", size, n) - } - log.Printf("wrote %v bytes in %s", size, time.Since(t1)) -} diff --git a/vendor/github.com/pkg/sftp/match.go b/vendor/github.com/pkg/sftp/match.go deleted file mode 100644 index e2f2ba40..00000000 --- a/vendor/github.com/pkg/sftp/match.go +++ /dev/null @@ -1,295 +0,0 @@ -package sftp - -import ( - "path" - "strings" - "unicode/utf8" -) - -// ErrBadPattern indicates a globbing pattern was malformed. -var ErrBadPattern = path.ErrBadPattern - -// Unix separator -const separator = "/" - -// Match reports whether name matches the shell file name pattern. -// The pattern syntax is: -// -// pattern: -// { term } -// term: -// '*' matches any sequence of non-Separator characters -// '?' matches any single non-Separator character -// '[' [ '^' ] { character-range } ']' -// character class (must be non-empty) -// c matches character c (c != '*', '?', '\\', '[') -// '\\' c matches character c -// -// character-range: -// c matches character c (c != '\\', '-', ']') -// '\\' c matches character c -// lo '-' hi matches character c for lo <= c <= hi -// -// Match requires pattern to match all of name, not just a substring. -// The only possible returned error is ErrBadPattern, when pattern -// is malformed. -// -// -func Match(pattern, name string) (matched bool, err error) { - return path.Match(pattern, name) -} - -// detect if byte(char) is path separator -func isPathSeparator(c byte) bool { - return string(c) == "/" -} - -// scanChunk gets the next segment of pattern, which is a non-star string -// possibly preceded by a star. -func scanChunk(pattern string) (star bool, chunk, rest string) { - for len(pattern) > 0 && pattern[0] == '*' { - pattern = pattern[1:] - star = true - } - inrange := false - var i int -Scan: - for i = 0; i < len(pattern); i++ { - switch pattern[i] { - case '\\': - - // error check handled in matchChunk: bad pattern. - if i+1 < len(pattern) { - i++ - } - case '[': - inrange = true - case ']': - inrange = false - case '*': - if !inrange { - break Scan - } - } - } - return star, pattern[0:i], pattern[i:] -} - -// matchChunk checks whether chunk matches the beginning of s. -// If so, it returns the remainder of s (after the match). -// Chunk is all single-character operators: literals, char classes, and ?. -func matchChunk(chunk, s string) (rest string, ok bool, err error) { - for len(chunk) > 0 { - if len(s) == 0 { - return - } - switch chunk[0] { - case '[': - // character class - r, n := utf8.DecodeRuneInString(s) - s = s[n:] - chunk = chunk[1:] - // We can't end right after '[', we're expecting at least - // a closing bracket and possibly a caret. - if len(chunk) == 0 { - err = ErrBadPattern - return - } - // possibly negated - negated := chunk[0] == '^' - if negated { - chunk = chunk[1:] - } - // parse all ranges - match := false - nrange := 0 - for { - if len(chunk) > 0 && chunk[0] == ']' && nrange > 0 { - chunk = chunk[1:] - break - } - var lo, hi rune - if lo, chunk, err = getEsc(chunk); err != nil { - return - } - hi = lo - if chunk[0] == '-' { - if hi, chunk, err = getEsc(chunk[1:]); err != nil { - return - } - } - if lo <= r && r <= hi { - match = true - } - nrange++ - } - if match == negated { - return - } - - case '?': - if isPathSeparator(s[0]) { - return - } - _, n := utf8.DecodeRuneInString(s) - s = s[n:] - chunk = chunk[1:] - - case '\\': - chunk = chunk[1:] - if len(chunk) == 0 { - err = ErrBadPattern - return - } - fallthrough - - default: - if chunk[0] != s[0] { - return - } - s = s[1:] - chunk = chunk[1:] - } - } - return s, true, nil -} - -// getEsc gets a possibly-escaped character from chunk, for a character class. -func getEsc(chunk string) (r rune, nchunk string, err error) { - if len(chunk) == 0 || chunk[0] == '-' || chunk[0] == ']' { - err = ErrBadPattern - return - } - if chunk[0] == '\\' { - chunk = chunk[1:] - if len(chunk) == 0 { - err = ErrBadPattern - return - } - } - r, n := utf8.DecodeRuneInString(chunk) - if r == utf8.RuneError && n == 1 { - err = ErrBadPattern - } - nchunk = chunk[n:] - if len(nchunk) == 0 { - err = ErrBadPattern - } - return -} - -// Split splits path immediately following the final Separator, -// separating it into a directory and file name component. -// If there is no Separator in path, Split returns an empty dir -// and file set to path. -// The returned values have the property that path = dir+file. -func Split(path string) (dir, file string) { - i := len(path) - 1 - for i >= 0 && !isPathSeparator(path[i]) { - i-- - } - return path[:i+1], path[i+1:] -} - -// Glob returns the names of all files matching pattern or nil -// if there is no matching file. The syntax of patterns is the same -// as in Match. The pattern may describe hierarchical names such as -// /usr/*/bin/ed (assuming the Separator is '/'). -// -// Glob ignores file system errors such as I/O errors reading directories. -// The only possible returned error is ErrBadPattern, when pattern -// is malformed. -func (c *Client) Glob(pattern string) (matches []string, err error) { - if !hasMeta(pattern) { - file, err := c.Lstat(pattern) - if err != nil { - return nil, nil - } - dir, _ := Split(pattern) - dir = cleanGlobPath(dir) - return []string{Join(dir, file.Name())}, nil - } - - dir, file := Split(pattern) - dir = cleanGlobPath(dir) - - if !hasMeta(dir) { - return c.glob(dir, file, nil) - } - - // Prevent infinite recursion. See issue 15879. - if dir == pattern { - return nil, ErrBadPattern - } - - var m []string - m, err = c.Glob(dir) - if err != nil { - return - } - for _, d := range m { - matches, err = c.glob(d, file, matches) - if err != nil { - return - } - } - return -} - -// cleanGlobPath prepares path for glob matching. -func cleanGlobPath(path string) string { - switch path { - case "": - return "." - case string(separator): - // do nothing to the path - return path - default: - return path[0 : len(path)-1] // chop off trailing separator - } -} - -// glob searches for files matching pattern in the directory dir -// and appends them to matches. If the directory cannot be -// opened, it returns the existing matches. New matches are -// added in lexicographical order. -func (c *Client) glob(dir, pattern string, matches []string) (m []string, e error) { - m = matches - fi, err := c.Stat(dir) - if err != nil { - return - } - if !fi.IsDir() { - return - } - names, err := c.ReadDir(dir) - if err != nil { - return - } - //sort.Strings(names) - - for _, n := range names { - matched, err := Match(pattern, n.Name()) - if err != nil { - return m, err - } - if matched { - m = append(m, Join(dir, n.Name())) - } - } - return -} - -// Join joins any number of path elements into a single path, adding -// a Separator if necessary. -// all empty strings are ignored. -func Join(elem ...string) string { - return path.Join(elem...) -} - -// hasMeta reports whether path contains any of the magic characters -// recognized by Match. -func hasMeta(path string) bool { - // TODO(niemeyer): Should other magic characters be added here? - return strings.ContainsAny(path, "*?[") -} diff --git a/vendor/github.com/pkg/sftp/packet-manager.go b/vendor/github.com/pkg/sftp/packet-manager.go deleted file mode 100644 index bf822e67..00000000 --- a/vendor/github.com/pkg/sftp/packet-manager.go +++ /dev/null @@ -1,173 +0,0 @@ -package sftp - -import ( - "encoding" - "sort" - "sync" -) - -// The goal of the packetManager is to keep the outgoing packets in the same -// order as the incoming. This is due to some sftp clients requiring this -// behavior (eg. winscp). - -type packetSender interface { - sendPacket(encoding.BinaryMarshaler) error -} - -type packetManager struct { - requests chan requestPacket - responses chan responsePacket - fini chan struct{} - incoming requestPacketIDs - outgoing responsePackets - sender packetSender // connection object - working *sync.WaitGroup -} - -func newPktMgr(sender packetSender) *packetManager { - s := &packetManager{ - requests: make(chan requestPacket, SftpServerWorkerCount), - responses: make(chan responsePacket, SftpServerWorkerCount), - fini: make(chan struct{}), - incoming: make([]uint32, 0, SftpServerWorkerCount), - outgoing: make([]responsePacket, 0, SftpServerWorkerCount), - sender: sender, - working: &sync.WaitGroup{}, - } - go s.controller() - return s -} - -type responsePackets []responsePacket - -func (r responsePackets) Sort() { - sort.Slice(r, func(i, j int) bool { - return r[i].id() < r[j].id() - }) -} - -type requestPacketIDs []uint32 - -func (r requestPacketIDs) Sort() { - sort.Slice(r, func(i, j int) bool { - return r[i] < r[j] - }) -} - -// register incoming packets to be handled -// send id of 0 for packets without id -func (s *packetManager) incomingPacket(pkt requestPacket) { - s.working.Add(1) - s.requests <- pkt // buffer == SftpServerWorkerCount -} - -// register outgoing packets as being ready -func (s *packetManager) readyPacket(pkt responsePacket) { - s.responses <- pkt - s.working.Done() -} - -// shut down packetManager controller -func (s *packetManager) close() { - // pause until current packets are processed - s.working.Wait() - close(s.fini) -} - -// Passed a worker function, returns a channel for incoming packets. -// The goal is to process packets in the order they are received as is -// requires by section 7 of the RFC, while maximizing throughput of file -// transfers. -func (s *packetManager) workerChan(runWorker func(requestChan)) requestChan { - - rwChan := make(chan requestPacket, SftpServerWorkerCount) - for i := 0; i < SftpServerWorkerCount; i++ { - runWorker(rwChan) - } - - cmdChan := make(chan requestPacket) - runWorker(cmdChan) - - pktChan := make(chan requestPacket, SftpServerWorkerCount) - go func() { - // start with cmdChan - curChan := cmdChan - for pkt := range pktChan { - // on file open packet, switch to rwChan - switch pkt.(type) { - case *sshFxpOpenPacket: - curChan = rwChan - // on file close packet, switch back to cmdChan - // after waiting for any reads/writes to finish - case *sshFxpClosePacket: - // wait for rwChan to finish - s.working.Wait() - // stop using rwChan - curChan = cmdChan - } - s.incomingPacket(pkt) - curChan <- pkt - } - close(rwChan) - close(cmdChan) - s.close() - }() - - return pktChan -} - -// process packets -func (s *packetManager) controller() { - for { - select { - case pkt := <-s.requests: - debug("incoming id: %v", pkt.id()) - s.incoming = append(s.incoming, pkt.id()) - if len(s.incoming) > 1 { - s.incoming.Sort() - } - case pkt := <-s.responses: - debug("outgoing pkt: %v", pkt.id()) - s.outgoing = append(s.outgoing, pkt) - if len(s.outgoing) > 1 { - s.outgoing.Sort() - } - case <-s.fini: - return - } - s.maybeSendPackets() - } -} - -// send as many packets as are ready -func (s *packetManager) maybeSendPackets() { - for { - if len(s.outgoing) == 0 || len(s.incoming) == 0 { - debug("break! -- outgoing: %v; incoming: %v", - len(s.outgoing), len(s.incoming)) - break - } - out := s.outgoing[0] - in := s.incoming[0] - // debug("incoming: %v", s.incoming) - // debug("outgoing: %v", outfilter(s.outgoing)) - if in == out.id() { - s.sender.sendPacket(out) - // pop off heads - copy(s.incoming, s.incoming[1:]) // shift left - s.incoming = s.incoming[:len(s.incoming)-1] // remove last - copy(s.outgoing, s.outgoing[1:]) // shift left - s.outgoing = s.outgoing[:len(s.outgoing)-1] // remove last - } else { - break - } - } -} - -//func outfilter(o []responsePacket) []uint32 { -// res := make([]uint32, 0, len(o)) -// for _, v := range o { -// res = append(res, v.id()) -// } -// return res -//} diff --git a/vendor/github.com/pkg/sftp/packet-typing.go b/vendor/github.com/pkg/sftp/packet-typing.go deleted file mode 100644 index 9001aea6..00000000 --- a/vendor/github.com/pkg/sftp/packet-typing.go +++ /dev/null @@ -1,133 +0,0 @@ -package sftp - -import ( - "encoding" - - "github.com/pkg/errors" -) - -// all incoming packets -type requestPacket interface { - encoding.BinaryUnmarshaler - id() uint32 -} - -type requestChan chan requestPacket - -type responsePacket interface { - encoding.BinaryMarshaler - id() uint32 -} - -// interfaces to group types -type hasPath interface { - requestPacket - getPath() string -} - -type hasHandle interface { - requestPacket - getHandle() string -} - -type notReadOnly interface { - notReadOnly() -} - -//// define types by adding methods -// hasPath -func (p sshFxpLstatPacket) getPath() string { return p.Path } -func (p sshFxpStatPacket) getPath() string { return p.Path } -func (p sshFxpRmdirPacket) getPath() string { return p.Path } -func (p sshFxpReadlinkPacket) getPath() string { return p.Path } -func (p sshFxpRealpathPacket) getPath() string { return p.Path } -func (p sshFxpMkdirPacket) getPath() string { return p.Path } -func (p sshFxpSetstatPacket) getPath() string { return p.Path } -func (p sshFxpStatvfsPacket) getPath() string { return p.Path } -func (p sshFxpRemovePacket) getPath() string { return p.Filename } -func (p sshFxpRenamePacket) getPath() string { return p.Oldpath } -func (p sshFxpSymlinkPacket) getPath() string { return p.Targetpath } -func (p sshFxpOpendirPacket) getPath() string { return p.Path } -func (p sshFxpOpenPacket) getPath() string { return p.Path } - -func (p sshFxpExtendedPacketPosixRename) getPath() string { return p.Oldpath } - -// hasHandle -func (p sshFxpFstatPacket) getHandle() string { return p.Handle } -func (p sshFxpFsetstatPacket) getHandle() string { return p.Handle } -func (p sshFxpReadPacket) getHandle() string { return p.Handle } -func (p sshFxpWritePacket) getHandle() string { return p.Handle } -func (p sshFxpReaddirPacket) getHandle() string { return p.Handle } -func (p sshFxpClosePacket) getHandle() string { return p.Handle } - -// notReadOnly -func (p sshFxpWritePacket) notReadOnly() {} -func (p sshFxpSetstatPacket) notReadOnly() {} -func (p sshFxpFsetstatPacket) notReadOnly() {} -func (p sshFxpRemovePacket) notReadOnly() {} -func (p sshFxpMkdirPacket) notReadOnly() {} -func (p sshFxpRmdirPacket) notReadOnly() {} -func (p sshFxpRenamePacket) notReadOnly() {} -func (p sshFxpSymlinkPacket) notReadOnly() {} -func (p sshFxpExtendedPacketPosixRename) notReadOnly() {} - -// some packets with ID are missing id() -func (p sshFxpDataPacket) id() uint32 { return p.ID } -func (p sshFxpStatusPacket) id() uint32 { return p.ID } -func (p sshFxpStatResponse) id() uint32 { return p.ID } -func (p sshFxpNamePacket) id() uint32 { return p.ID } -func (p sshFxpHandlePacket) id() uint32 { return p.ID } -func (p sshFxVersionPacket) id() uint32 { return 0 } - -// take raw incoming packet data and build packet objects -func makePacket(p rxPacket) (requestPacket, error) { - var pkt requestPacket - switch p.pktType { - case ssh_FXP_INIT: - pkt = &sshFxInitPacket{} - case ssh_FXP_LSTAT: - pkt = &sshFxpLstatPacket{} - case ssh_FXP_OPEN: - pkt = &sshFxpOpenPacket{} - case ssh_FXP_CLOSE: - pkt = &sshFxpClosePacket{} - case ssh_FXP_READ: - pkt = &sshFxpReadPacket{} - case ssh_FXP_WRITE: - pkt = &sshFxpWritePacket{} - case ssh_FXP_FSTAT: - pkt = &sshFxpFstatPacket{} - case ssh_FXP_SETSTAT: - pkt = &sshFxpSetstatPacket{} - case ssh_FXP_FSETSTAT: - pkt = &sshFxpFsetstatPacket{} - case ssh_FXP_OPENDIR: - pkt = &sshFxpOpendirPacket{} - case ssh_FXP_READDIR: - pkt = &sshFxpReaddirPacket{} - case ssh_FXP_REMOVE: - pkt = &sshFxpRemovePacket{} - case ssh_FXP_MKDIR: - pkt = &sshFxpMkdirPacket{} - case ssh_FXP_RMDIR: - pkt = &sshFxpRmdirPacket{} - case ssh_FXP_REALPATH: - pkt = &sshFxpRealpathPacket{} - case ssh_FXP_STAT: - pkt = &sshFxpStatPacket{} - case ssh_FXP_RENAME: - pkt = &sshFxpRenamePacket{} - case ssh_FXP_READLINK: - pkt = &sshFxpReadlinkPacket{} - case ssh_FXP_SYMLINK: - pkt = &sshFxpSymlinkPacket{} - case ssh_FXP_EXTENDED: - pkt = &sshFxpExtendedPacket{} - default: - return nil, errors.Errorf("unhandled packet type: %s", p.pktType) - } - if err := pkt.UnmarshalBinary(p.pktBytes); err != nil { - return nil, err - } - return pkt, nil -} diff --git a/vendor/github.com/pkg/sftp/packet.go b/vendor/github.com/pkg/sftp/packet.go deleted file mode 100644 index 711ca50c..00000000 --- a/vendor/github.com/pkg/sftp/packet.go +++ /dev/null @@ -1,952 +0,0 @@ -package sftp - -import ( - "bytes" - "encoding" - "encoding/binary" - "fmt" - "io" - "os" - "reflect" - - "github.com/pkg/errors" -) - -var ( - errShortPacket = errors.New("packet too short") - errUnknownExtendedPacket = errors.New("unknown extended packet") -) - -const ( - debugDumpTxPacket = false - debugDumpRxPacket = false - debugDumpTxPacketBytes = false - debugDumpRxPacketBytes = false -) - -func marshalUint32(b []byte, v uint32) []byte { - return append(b, byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) -} - -func marshalUint64(b []byte, v uint64) []byte { - return marshalUint32(marshalUint32(b, uint32(v>>32)), uint32(v)) -} - -func marshalString(b []byte, v string) []byte { - return append(marshalUint32(b, uint32(len(v))), v...) -} - -func marshal(b []byte, v interface{}) []byte { - if v == nil { - return b - } - switch v := v.(type) { - case uint8: - return append(b, v) - case uint32: - return marshalUint32(b, v) - case uint64: - return marshalUint64(b, v) - case string: - return marshalString(b, v) - case os.FileInfo: - return marshalFileInfo(b, v) - default: - switch d := reflect.ValueOf(v); d.Kind() { - case reflect.Struct: - for i, n := 0, d.NumField(); i < n; i++ { - b = append(marshal(b, d.Field(i).Interface())) - } - return b - case reflect.Slice: - for i, n := 0, d.Len(); i < n; i++ { - b = append(marshal(b, d.Index(i).Interface())) - } - return b - default: - panic(fmt.Sprintf("marshal(%#v): cannot handle type %T", v, v)) - } - } -} - -func unmarshalUint32(b []byte) (uint32, []byte) { - v := uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24 - return v, b[4:] -} - -func unmarshalUint32Safe(b []byte) (uint32, []byte, error) { - var v uint32 - if len(b) < 4 { - return 0, nil, errShortPacket - } - v, b = unmarshalUint32(b) - return v, b, nil -} - -func unmarshalUint64(b []byte) (uint64, []byte) { - h, b := unmarshalUint32(b) - l, b := unmarshalUint32(b) - return uint64(h)<<32 | uint64(l), b -} - -func unmarshalUint64Safe(b []byte) (uint64, []byte, error) { - var v uint64 - if len(b) < 8 { - return 0, nil, errShortPacket - } - v, b = unmarshalUint64(b) - return v, b, nil -} - -func unmarshalString(b []byte) (string, []byte) { - n, b := unmarshalUint32(b) - return string(b[:n]), b[n:] -} - -func unmarshalStringSafe(b []byte) (string, []byte, error) { - n, b, err := unmarshalUint32Safe(b) - if err != nil { - return "", nil, err - } - if int64(n) > int64(len(b)) { - return "", nil, errShortPacket - } - return string(b[:n]), b[n:], nil -} - -// sendPacket marshals p according to RFC 4234. -func sendPacket(w io.Writer, m encoding.BinaryMarshaler) error { - bb, err := m.MarshalBinary() - if err != nil { - return errors.Errorf("binary marshaller failed: %v", err) - } - if debugDumpTxPacketBytes { - debug("send packet: %s %d bytes %x", fxp(bb[0]), len(bb), bb[1:]) - } else if debugDumpTxPacket { - debug("send packet: %s %d bytes", fxp(bb[0]), len(bb)) - } - l := uint32(len(bb)) - hdr := []byte{byte(l >> 24), byte(l >> 16), byte(l >> 8), byte(l)} - _, err = w.Write(hdr) - if err != nil { - return errors.Errorf("failed to send packet header: %v", err) - } - _, err = w.Write(bb) - if err != nil { - return errors.Errorf("failed to send packet body: %v", err) - } - return nil -} - -func recvPacket(r io.Reader) (uint8, []byte, error) { - var b = []byte{0, 0, 0, 0} - if _, err := io.ReadFull(r, b); err != nil { - return 0, nil, err - } - l, _ := unmarshalUint32(b) - b = make([]byte, l) - if _, err := io.ReadFull(r, b); err != nil { - debug("recv packet %d bytes: err %v", l, err) - return 0, nil, err - } - if debugDumpRxPacketBytes { - debug("recv packet: %s %d bytes %x", fxp(b[0]), l, b[1:]) - } else if debugDumpRxPacket { - debug("recv packet: %s %d bytes", fxp(b[0]), l) - } - return b[0], b[1:], nil -} - -type extensionPair struct { - Name string - Data string -} - -func unmarshalExtensionPair(b []byte) (extensionPair, []byte, error) { - var ep extensionPair - var err error - ep.Name, b, err = unmarshalStringSafe(b) - if err != nil { - return ep, b, err - } - ep.Data, b, err = unmarshalStringSafe(b) - return ep, b, err -} - -// Here starts the definition of packets along with their MarshalBinary -// implementations. -// Manually writing the marshalling logic wins us a lot of time and -// allocation. - -type sshFxInitPacket struct { - Version uint32 - Extensions []extensionPair -} - -func (p sshFxInitPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 // byte + uint32 - for _, e := range p.Extensions { - l += 4 + len(e.Name) + 4 + len(e.Data) - } - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_INIT) - b = marshalUint32(b, p.Version) - for _, e := range p.Extensions { - b = marshalString(b, e.Name) - b = marshalString(b, e.Data) - } - return b, nil -} - -func (p *sshFxInitPacket) UnmarshalBinary(b []byte) error { - var err error - if p.Version, b, err = unmarshalUint32Safe(b); err != nil { - return err - } - for len(b) > 0 { - var ep extensionPair - ep, b, err = unmarshalExtensionPair(b) - if err != nil { - return err - } - p.Extensions = append(p.Extensions, ep) - } - return nil -} - -type sshFxVersionPacket struct { - Version uint32 - Extensions []struct { - Name, Data string - } -} - -func (p sshFxVersionPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 // byte + uint32 - for _, e := range p.Extensions { - l += 4 + len(e.Name) + 4 + len(e.Data) - } - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_VERSION) - b = marshalUint32(b, p.Version) - for _, e := range p.Extensions { - b = marshalString(b, e.Name) - b = marshalString(b, e.Data) - } - return b, nil -} - -func marshalIDString(packetType byte, id uint32, str string) ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(str) - - b := make([]byte, 0, l) - b = append(b, packetType) - b = marshalUint32(b, id) - b = marshalString(b, str) - return b, nil -} - -func unmarshalIDString(b []byte, id *uint32, str *string) error { - var err error - *id, b, err = unmarshalUint32Safe(b) - if err != nil { - return err - } - *str, _, err = unmarshalStringSafe(b) - return err -} - -type sshFxpReaddirPacket struct { - ID uint32 - Handle string -} - -func (p sshFxpReaddirPacket) id() uint32 { return p.ID } - -func (p sshFxpReaddirPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_READDIR, p.ID, p.Handle) -} - -func (p *sshFxpReaddirPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Handle) -} - -type sshFxpOpendirPacket struct { - ID uint32 - Path string -} - -func (p sshFxpOpendirPacket) id() uint32 { return p.ID } - -func (p sshFxpOpendirPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_OPENDIR, p.ID, p.Path) -} - -func (p *sshFxpOpendirPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Path) -} - -type sshFxpLstatPacket struct { - ID uint32 - Path string -} - -func (p sshFxpLstatPacket) id() uint32 { return p.ID } - -func (p sshFxpLstatPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_LSTAT, p.ID, p.Path) -} - -func (p *sshFxpLstatPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Path) -} - -type sshFxpStatPacket struct { - ID uint32 - Path string -} - -func (p sshFxpStatPacket) id() uint32 { return p.ID } - -func (p sshFxpStatPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_STAT, p.ID, p.Path) -} - -func (p *sshFxpStatPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Path) -} - -type sshFxpFstatPacket struct { - ID uint32 - Handle string -} - -func (p sshFxpFstatPacket) id() uint32 { return p.ID } - -func (p sshFxpFstatPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_FSTAT, p.ID, p.Handle) -} - -func (p *sshFxpFstatPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Handle) -} - -type sshFxpClosePacket struct { - ID uint32 - Handle string -} - -func (p sshFxpClosePacket) id() uint32 { return p.ID } - -func (p sshFxpClosePacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_CLOSE, p.ID, p.Handle) -} - -func (p *sshFxpClosePacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Handle) -} - -type sshFxpRemovePacket struct { - ID uint32 - Filename string -} - -func (p sshFxpRemovePacket) id() uint32 { return p.ID } - -func (p sshFxpRemovePacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_REMOVE, p.ID, p.Filename) -} - -func (p *sshFxpRemovePacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Filename) -} - -type sshFxpRmdirPacket struct { - ID uint32 - Path string -} - -func (p sshFxpRmdirPacket) id() uint32 { return p.ID } - -func (p sshFxpRmdirPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_RMDIR, p.ID, p.Path) -} - -func (p *sshFxpRmdirPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Path) -} - -type sshFxpSymlinkPacket struct { - ID uint32 - Targetpath string - Linkpath string -} - -func (p sshFxpSymlinkPacket) id() uint32 { return p.ID } - -func (p sshFxpSymlinkPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Targetpath) + - 4 + len(p.Linkpath) - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_SYMLINK) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Targetpath) - b = marshalString(b, p.Linkpath) - return b, nil -} - -func (p *sshFxpSymlinkPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Targetpath, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Linkpath, _, err = unmarshalStringSafe(b); err != nil { - return err - } - return nil -} - -type sshFxpReadlinkPacket struct { - ID uint32 - Path string -} - -func (p sshFxpReadlinkPacket) id() uint32 { return p.ID } - -func (p sshFxpReadlinkPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_READLINK, p.ID, p.Path) -} - -func (p *sshFxpReadlinkPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Path) -} - -type sshFxpRealpathPacket struct { - ID uint32 - Path string -} - -func (p sshFxpRealpathPacket) id() uint32 { return p.ID } - -func (p sshFxpRealpathPacket) MarshalBinary() ([]byte, error) { - return marshalIDString(ssh_FXP_REALPATH, p.ID, p.Path) -} - -func (p *sshFxpRealpathPacket) UnmarshalBinary(b []byte) error { - return unmarshalIDString(b, &p.ID, &p.Path) -} - -type sshFxpNameAttr struct { - Name string - LongName string - Attrs []interface{} -} - -func (p sshFxpNameAttr) MarshalBinary() ([]byte, error) { - b := []byte{} - b = marshalString(b, p.Name) - b = marshalString(b, p.LongName) - for _, attr := range p.Attrs { - b = marshal(b, attr) - } - return b, nil -} - -type sshFxpNamePacket struct { - ID uint32 - NameAttrs []sshFxpNameAttr -} - -func (p sshFxpNamePacket) MarshalBinary() ([]byte, error) { - b := []byte{} - b = append(b, ssh_FXP_NAME) - b = marshalUint32(b, p.ID) - b = marshalUint32(b, uint32(len(p.NameAttrs))) - for _, na := range p.NameAttrs { - ab, err := na.MarshalBinary() - if err != nil { - return nil, err - } - - b = append(b, ab...) - } - return b, nil -} - -type sshFxpOpenPacket struct { - ID uint32 - Path string - Pflags uint32 - Flags uint32 // ignored -} - -func (p sshFxpOpenPacket) id() uint32 { return p.ID } - -func (p sshFxpOpenPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + - 4 + len(p.Path) + - 4 + 4 - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_OPEN) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Path) - b = marshalUint32(b, p.Pflags) - b = marshalUint32(b, p.Flags) - return b, nil -} - -func (p *sshFxpOpenPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Path, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Pflags, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Flags, _, err = unmarshalUint32Safe(b); err != nil { - return err - } - return nil -} - -type sshFxpReadPacket struct { - ID uint32 - Handle string - Offset uint64 - Len uint32 -} - -func (p sshFxpReadPacket) id() uint32 { return p.ID } - -func (p sshFxpReadPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Handle) + - 8 + 4 // uint64 + uint32 - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_READ) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Handle) - b = marshalUint64(b, p.Offset) - b = marshalUint32(b, p.Len) - return b, nil -} - -func (p *sshFxpReadPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Handle, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Offset, b, err = unmarshalUint64Safe(b); err != nil { - return err - } else if p.Len, _, err = unmarshalUint32Safe(b); err != nil { - return err - } - return nil -} - -type sshFxpRenamePacket struct { - ID uint32 - Oldpath string - Newpath string -} - -func (p sshFxpRenamePacket) id() uint32 { return p.ID } - -func (p sshFxpRenamePacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Oldpath) + - 4 + len(p.Newpath) - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_RENAME) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Oldpath) - b = marshalString(b, p.Newpath) - return b, nil -} - -func (p *sshFxpRenamePacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Oldpath, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Newpath, _, err = unmarshalStringSafe(b); err != nil { - return err - } - return nil -} - -type sshFxpPosixRenamePacket struct { - ID uint32 - Oldpath string - Newpath string -} - -func (p sshFxpPosixRenamePacket) id() uint32 { return p.ID } - -func (p sshFxpPosixRenamePacket) MarshalBinary() ([]byte, error) { - const ext = "posix-rename@openssh.com" - l := 1 + 4 + // type(byte) + uint32 - 4 + len(ext) + - 4 + len(p.Oldpath) + - 4 + len(p.Newpath) - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_EXTENDED) - b = marshalUint32(b, p.ID) - b = marshalString(b, ext) - b = marshalString(b, p.Oldpath) - b = marshalString(b, p.Newpath) - return b, nil -} - -type sshFxpWritePacket struct { - ID uint32 - Handle string - Offset uint64 - Length uint32 - Data []byte -} - -func (p sshFxpWritePacket) id() uint32 { return p.ID } - -func (p sshFxpWritePacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Handle) + - 8 + 4 + // uint64 + uint32 - len(p.Data) - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_WRITE) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Handle) - b = marshalUint64(b, p.Offset) - b = marshalUint32(b, p.Length) - b = append(b, p.Data...) - return b, nil -} - -func (p *sshFxpWritePacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Handle, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Offset, b, err = unmarshalUint64Safe(b); err != nil { - return err - } else if p.Length, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if uint32(len(b)) < p.Length { - return errShortPacket - } - - p.Data = append([]byte{}, b[:p.Length]...) - return nil -} - -type sshFxpMkdirPacket struct { - ID uint32 - Path string - Flags uint32 // ignored -} - -func (p sshFxpMkdirPacket) id() uint32 { return p.ID } - -func (p sshFxpMkdirPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Path) + - 4 // uint32 - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_MKDIR) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Path) - b = marshalUint32(b, p.Flags) - return b, nil -} - -func (p *sshFxpMkdirPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Path, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Flags, _, err = unmarshalUint32Safe(b); err != nil { - return err - } - return nil -} - -type sshFxpSetstatPacket struct { - ID uint32 - Path string - Flags uint32 - Attrs interface{} -} - -type sshFxpFsetstatPacket struct { - ID uint32 - Handle string - Flags uint32 - Attrs interface{} -} - -func (p sshFxpSetstatPacket) id() uint32 { return p.ID } -func (p sshFxpFsetstatPacket) id() uint32 { return p.ID } - -func (p sshFxpSetstatPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Path) + - 4 // uint32 + uint64 - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_SETSTAT) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Path) - b = marshalUint32(b, p.Flags) - b = marshal(b, p.Attrs) - return b, nil -} - -func (p sshFxpFsetstatPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - 4 + len(p.Handle) + - 4 // uint32 + uint64 - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_FSETSTAT) - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Handle) - b = marshalUint32(b, p.Flags) - b = marshal(b, p.Attrs) - return b, nil -} - -func (p *sshFxpSetstatPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Path, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Flags, b, err = unmarshalUint32Safe(b); err != nil { - return err - } - p.Attrs = b - return nil -} - -func (p *sshFxpFsetstatPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Handle, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Flags, b, err = unmarshalUint32Safe(b); err != nil { - return err - } - p.Attrs = b - return nil -} - -type sshFxpHandlePacket struct { - ID uint32 - Handle string -} - -func (p sshFxpHandlePacket) MarshalBinary() ([]byte, error) { - b := []byte{ssh_FXP_HANDLE} - b = marshalUint32(b, p.ID) - b = marshalString(b, p.Handle) - return b, nil -} - -type sshFxpStatusPacket struct { - ID uint32 - StatusError -} - -func (p sshFxpStatusPacket) MarshalBinary() ([]byte, error) { - b := []byte{ssh_FXP_STATUS} - b = marshalUint32(b, p.ID) - b = marshalStatus(b, p.StatusError) - return b, nil -} - -type sshFxpDataPacket struct { - ID uint32 - Length uint32 - Data []byte -} - -func (p sshFxpDataPacket) MarshalBinary() ([]byte, error) { - b := []byte{ssh_FXP_DATA} - b = marshalUint32(b, p.ID) - b = marshalUint32(b, p.Length) - b = append(b, p.Data[:p.Length]...) - return b, nil -} - -func (p *sshFxpDataPacket) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.Length, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if uint32(len(b)) < p.Length { - return errors.New("truncated packet") - } - - p.Data = make([]byte, p.Length) - copy(p.Data, b) - return nil -} - -type sshFxpStatvfsPacket struct { - ID uint32 - Path string -} - -func (p sshFxpStatvfsPacket) id() uint32 { return p.ID } - -func (p sshFxpStatvfsPacket) MarshalBinary() ([]byte, error) { - l := 1 + 4 + // type(byte) + uint32 - len(p.Path) + - len("statvfs@openssh.com") - - b := make([]byte, 0, l) - b = append(b, ssh_FXP_EXTENDED) - b = marshalUint32(b, p.ID) - b = marshalString(b, "statvfs@openssh.com") - b = marshalString(b, p.Path) - return b, nil -} - -// A StatVFS contains statistics about a filesystem. -type StatVFS struct { - ID uint32 - Bsize uint64 /* file system block size */ - Frsize uint64 /* fundamental fs block size */ - Blocks uint64 /* number of blocks (unit f_frsize) */ - Bfree uint64 /* free blocks in file system */ - Bavail uint64 /* free blocks for non-root */ - Files uint64 /* total file inodes */ - Ffree uint64 /* free file inodes */ - Favail uint64 /* free file inodes for to non-root */ - Fsid uint64 /* file system id */ - Flag uint64 /* bit mask of f_flag values */ - Namemax uint64 /* maximum filename length */ -} - -// TotalSpace calculates the amount of total space in a filesystem. -func (p *StatVFS) TotalSpace() uint64 { - return p.Frsize * p.Blocks -} - -// FreeSpace calculates the amount of free space in a filesystem. -func (p *StatVFS) FreeSpace() uint64 { - return p.Frsize * p.Bfree -} - -// Convert to ssh_FXP_EXTENDED_REPLY packet binary format -func (p *StatVFS) MarshalBinary() ([]byte, error) { - var buf bytes.Buffer - buf.Write([]byte{ssh_FXP_EXTENDED_REPLY}) - err := binary.Write(&buf, binary.BigEndian, p) - return buf.Bytes(), err -} - -type sshFxpExtendedPacket struct { - ID uint32 - ExtendedRequest string - SpecificPacket interface { - serverRespondablePacket - readonly() bool - } -} - -func (p sshFxpExtendedPacket) id() uint32 { return p.ID } -func (p sshFxpExtendedPacket) readonly() bool { return p.SpecificPacket.readonly() } - -func (p sshFxpExtendedPacket) respond(svr *Server) error { - return p.SpecificPacket.respond(svr) -} - -func (p *sshFxpExtendedPacket) UnmarshalBinary(b []byte) error { - var err error - bOrig := b - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.ExtendedRequest, _, err = unmarshalStringSafe(b); err != nil { - return err - } - - // specific unmarshalling - switch p.ExtendedRequest { - case "statvfs@openssh.com": - p.SpecificPacket = &sshFxpExtendedPacketStatVFS{} - case "posix-rename@openssh.com": - p.SpecificPacket = &sshFxpExtendedPacketPosixRename{} - default: - return errUnknownExtendedPacket - } - - return p.SpecificPacket.UnmarshalBinary(bOrig) -} - -type sshFxpExtendedPacketStatVFS struct { - ID uint32 - ExtendedRequest string - Path string -} - -func (p sshFxpExtendedPacketStatVFS) id() uint32 { return p.ID } -func (p sshFxpExtendedPacketStatVFS) readonly() bool { return true } -func (p *sshFxpExtendedPacketStatVFS) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.ExtendedRequest, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Path, _, err = unmarshalStringSafe(b); err != nil { - return err - } - return nil -} - -type sshFxpExtendedPacketPosixRename struct { - ID uint32 - ExtendedRequest string - Oldpath string - Newpath string -} - -func (p sshFxpExtendedPacketPosixRename) id() uint32 { return p.ID } -func (p sshFxpExtendedPacketPosixRename) readonly() bool { return false } -func (p *sshFxpExtendedPacketPosixRename) UnmarshalBinary(b []byte) error { - var err error - if p.ID, b, err = unmarshalUint32Safe(b); err != nil { - return err - } else if p.ExtendedRequest, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Oldpath, b, err = unmarshalStringSafe(b); err != nil { - return err - } else if p.Newpath, _, err = unmarshalStringSafe(b); err != nil { - return err - } - return nil -} - -func (p sshFxpExtendedPacketPosixRename) respond(s *Server) error { - err := os.Rename(p.Oldpath, p.Newpath) - return s.sendError(p, err) -} diff --git a/vendor/github.com/pkg/sftp/release.go b/vendor/github.com/pkg/sftp/release.go deleted file mode 100644 index b695528f..00000000 --- a/vendor/github.com/pkg/sftp/release.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build !debug - -package sftp - -func debug(fmt string, args ...interface{}) {} diff --git a/vendor/github.com/pkg/sftp/request-attrs.go b/vendor/github.com/pkg/sftp/request-attrs.go deleted file mode 100644 index 0149d930..00000000 --- a/vendor/github.com/pkg/sftp/request-attrs.go +++ /dev/null @@ -1,63 +0,0 @@ -package sftp - -// Methods on the Request object to make working with the Flags bitmasks and -// Attr(ibutes) byte blob easier. Use Pflags() when working with an Open/Write -// request and AttrFlags() and Attributes() when working with SetStat requests. - -import "os" - -// Open packet pflags -type pflags struct { - Read, Write, Append, Creat, Trunc, Excl bool -} - -// testable constructor -func newPflags(flags uint32) pflags { - return pflags{ - Read: flags&ssh_FXF_READ != 0, - Write: flags&ssh_FXF_WRITE != 0, - Append: flags&ssh_FXF_APPEND != 0, - Creat: flags&ssh_FXF_CREAT != 0, - Trunc: flags&ssh_FXF_TRUNC != 0, - Excl: flags&ssh_FXF_EXCL != 0, - } -} - -// Check bitmap/uint32 for Open packet pflag values -func (r *Request) Pflags() pflags { - return newPflags(r.Flags) -} - -// File attribute flags -type aflags struct { - Size, UidGid, Permissions, Acmodtime bool -} - -// testable constructor -func newAflags(flags uint32) aflags { - return aflags{ - Size: (flags & ssh_FILEXFER_ATTR_SIZE) != 0, - UidGid: (flags & ssh_FILEXFER_ATTR_UIDGID) != 0, - Permissions: (flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0, - Acmodtime: (flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0, - } -} - -// Check bitmap/uint32 for file attribute flags -func (r *Request) AttrFlags(flags uint32) aflags { - return newAflags(r.Flags) -} - -// File attributes -type fileattrs FileStat - -// Return Mode wrapped in os.FileMode -func (a fileattrs) FileMode() os.FileMode { - return os.FileMode(a.Mode) -} - -// Parse file attributes byte blob and return them in object -func (r *Request) Attributes() fileattrs { - fa, _ := getFileStat(r.Flags, r.Attrs) - return fileattrs(*fa) -} diff --git a/vendor/github.com/pkg/sftp/request-errors.go b/vendor/github.com/pkg/sftp/request-errors.go deleted file mode 100644 index 00451e74..00000000 --- a/vendor/github.com/pkg/sftp/request-errors.go +++ /dev/null @@ -1,42 +0,0 @@ -package sftp - -// Error types that match the SFTP's SSH_FXP_STATUS codes. Gives you more -// direct control of the errors being sent vs. letting the library work them -// out from the standard os/io errors. - -type fxerr uint32 - -const ( - ErrSshFxOk = fxerr(ssh_FX_OK) - ErrSshFxEof = fxerr(ssh_FX_EOF) - ErrSshFxNoSuchFile = fxerr(ssh_FX_NO_SUCH_FILE) - ErrSshFxPermissionDenied = fxerr(ssh_FX_PERMISSION_DENIED) - ErrSshFxFailure = fxerr(ssh_FX_FAILURE) - ErrSshFxBadMessage = fxerr(ssh_FX_BAD_MESSAGE) - ErrSshFxNoConnection = fxerr(ssh_FX_NO_CONNECTION) - ErrSshFxConnectionLost = fxerr(ssh_FX_CONNECTION_LOST) - ErrSshFxOpUnsupported = fxerr(ssh_FX_OP_UNSUPPORTED) -) - -func (e fxerr) Error() string { - switch e { - case ErrSshFxOk: - return "OK" - case ErrSshFxEof: - return "EOF" - case ErrSshFxNoSuchFile: - return "No Such File" - case ErrSshFxPermissionDenied: - return "Permission Denied" - case ErrSshFxBadMessage: - return "Bad Message" - case ErrSshFxNoConnection: - return "No Connection" - case ErrSshFxConnectionLost: - return "Connection Lost" - case ErrSshFxOpUnsupported: - return "Operation Unsupported" - default: - return "Failure" - } -} diff --git a/vendor/github.com/pkg/sftp/request-example.go b/vendor/github.com/pkg/sftp/request-example.go deleted file mode 100644 index 96191e0d..00000000 --- a/vendor/github.com/pkg/sftp/request-example.go +++ /dev/null @@ -1,261 +0,0 @@ -package sftp - -// This serves as an example of how to implement the request server handler as -// well as a dummy backend for testing. It implements an in-memory backend that -// works as a very simple filesystem with simple flat key-value lookup system. - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "sync" - "time" -) - -// InMemHandler returns a Hanlders object with the test handlers -func InMemHandler() Handlers { - root := &root{ - files: make(map[string]*memFile), - } - root.memFile = newMemFile("/", true) - return Handlers{root, root, root, root} -} - -// Handlers -func (fs *root) Fileread(r *Request) (io.ReaderAt, error) { - if fs.mockErr != nil { - return nil, fs.mockErr - } - fs.filesLock.Lock() - defer fs.filesLock.Unlock() - file, err := fs.fetch(r.Filepath) - if err != nil { - return nil, err - } - if file.symlink != "" { - file, err = fs.fetch(file.symlink) - if err != nil { - return nil, err - } - } - return file.ReaderAt() -} - -func (fs *root) Filewrite(r *Request) (io.WriterAt, error) { - if fs.mockErr != nil { - return nil, fs.mockErr - } - fs.filesLock.Lock() - defer fs.filesLock.Unlock() - file, err := fs.fetch(r.Filepath) - if err == os.ErrNotExist { - dir, err := fs.fetch(filepath.Dir(r.Filepath)) - if err != nil { - return nil, err - } - if !dir.isdir { - return nil, os.ErrInvalid - } - file = newMemFile(r.Filepath, false) - fs.files[r.Filepath] = file - } - return file.WriterAt() -} - -func (fs *root) Filecmd(r *Request) error { - if fs.mockErr != nil { - return fs.mockErr - } - fs.filesLock.Lock() - defer fs.filesLock.Unlock() - switch r.Method { - case "Setstat": - return nil - case "Rename": - file, err := fs.fetch(r.Filepath) - if err != nil { - return err - } - if _, ok := fs.files[r.Target]; ok { - return &os.LinkError{Op: "rename", Old: r.Filepath, New: r.Target, - Err: fmt.Errorf("dest file exists")} - } - fs.files[r.Target] = file - delete(fs.files, r.Filepath) - case "Rmdir", "Remove": - _, err := fs.fetch(filepath.Dir(r.Filepath)) - if err != nil { - return err - } - delete(fs.files, r.Filepath) - case "Mkdir": - _, err := fs.fetch(filepath.Dir(r.Filepath)) - if err != nil { - return err - } - fs.files[r.Filepath] = newMemFile(r.Filepath, true) - case "Symlink": - _, err := fs.fetch(r.Filepath) - if err != nil { - return err - } - link := newMemFile(r.Target, false) - link.symlink = r.Filepath - fs.files[r.Target] = link - } - return nil -} - -type listerat []os.FileInfo - -// Modeled after strings.Reader's ReadAt() implementation -func (f listerat) ListAt(ls []os.FileInfo, offset int64) (int, error) { - var n int - if offset >= int64(len(f)) { - return 0, io.EOF - } - n = copy(ls, f[offset:]) - if n < len(ls) { - return n, io.EOF - } - return n, nil -} - -func (fs *root) Filelist(r *Request) (ListerAt, error) { - if fs.mockErr != nil { - return nil, fs.mockErr - } - fs.filesLock.Lock() - defer fs.filesLock.Unlock() - - switch r.Method { - case "List": - ordered_names := []string{} - for fn, _ := range fs.files { - if filepath.Dir(fn) == r.Filepath { - ordered_names = append(ordered_names, fn) - } - } - sort.Strings(ordered_names) - list := make([]os.FileInfo, len(ordered_names)) - for i, fn := range ordered_names { - list[i] = fs.files[fn] - } - return listerat(list), nil - case "Stat": - file, err := fs.fetch(r.Filepath) - if err != nil { - return nil, err - } - return listerat([]os.FileInfo{file}), nil - case "Readlink": - file, err := fs.fetch(r.Filepath) - if err != nil { - return nil, err - } - if file.symlink != "" { - file, err = fs.fetch(file.symlink) - if err != nil { - return nil, err - } - } - return listerat([]os.FileInfo{file}), nil - } - return nil, nil -} - -// In memory file-system-y thing that the Hanlders live on -type root struct { - *memFile - files map[string]*memFile - filesLock sync.Mutex - mockErr error -} - -// Set a mocked error that the next handler call will return. -// Set to nil to reset for no error. -func (fs *root) returnErr(err error) { - fs.mockErr = err -} - -func (fs *root) fetch(path string) (*memFile, error) { - if path == "/" { - return fs.memFile, nil - } - if file, ok := fs.files[path]; ok { - return file, nil - } - return nil, os.ErrNotExist -} - -// Implements os.FileInfo, Reader and Writer interfaces. -// These are the 3 interfaces necessary for the Handlers. -type memFile struct { - name string - modtime time.Time - symlink string - isdir bool - content []byte - contentLock sync.RWMutex -} - -// factory to make sure modtime is set -func newMemFile(name string, isdir bool) *memFile { - return &memFile{ - name: name, - modtime: time.Now(), - isdir: isdir, - } -} - -// Have memFile fulfill os.FileInfo interface -func (f *memFile) Name() string { return filepath.Base(f.name) } -func (f *memFile) Size() int64 { return int64(len(f.content)) } -func (f *memFile) Mode() os.FileMode { - ret := os.FileMode(0644) - if f.isdir { - ret = os.FileMode(0755) | os.ModeDir - } - if f.symlink != "" { - ret = os.FileMode(0777) | os.ModeSymlink - } - return ret -} -func (f *memFile) ModTime() time.Time { return f.modtime } -func (f *memFile) IsDir() bool { return f.isdir } -func (f *memFile) Sys() interface{} { - return fakeFileInfoSys() -} - -// Read/Write -func (f *memFile) ReaderAt() (io.ReaderAt, error) { - if f.isdir { - return nil, os.ErrInvalid - } - return bytes.NewReader(f.content), nil -} - -func (f *memFile) WriterAt() (io.WriterAt, error) { - if f.isdir { - return nil, os.ErrInvalid - } - return f, nil -} -func (f *memFile) WriteAt(p []byte, off int64) (int, error) { - // fmt.Println(string(p), off) - // mimic write delays, should be optional - time.Sleep(time.Microsecond * time.Duration(len(p))) - f.contentLock.Lock() - defer f.contentLock.Unlock() - plen := len(p) + int(off) - if plen >= len(f.content) { - nc := make([]byte, plen) - copy(nc, f.content) - f.content = nc - } - copy(f.content[off:], p) - return len(p), nil -} diff --git a/vendor/github.com/pkg/sftp/request-interfaces.go b/vendor/github.com/pkg/sftp/request-interfaces.go deleted file mode 100644 index 44b8da10..00000000 --- a/vendor/github.com/pkg/sftp/request-interfaces.go +++ /dev/null @@ -1,46 +0,0 @@ -package sftp - -import ( - "io" - "os" -) - -// Interfaces are differentiated based on required returned values. -// All input arguments are to be pulled from Request (the only arg). - -// FileReader should return an io.ReaderAt for the filepath -// Note in cases of an error, the error text will be sent to the client. -type FileReader interface { - Fileread(*Request) (io.ReaderAt, error) -} - -// FileWriter should return an io.WriterAt for the filepath. -// -// The request server code will call Close() on the returned io.WriterAt -// ojbect if an io.Closer type assertion succeeds. -// Note in cases of an error, the error text will be sent to the client. -type FileWriter interface { - Filewrite(*Request) (io.WriterAt, error) -} - -// FileCmder should return an error -// Note in cases of an error, the error text will be sent to the client. -type FileCmder interface { - Filecmd(*Request) error -} - -// FileLister should return an object that fulfils the ListerAt interface -// Note in cases of an error, the error text will be sent to the client. -type FileLister interface { - Filelist(*Request) (ListerAt, error) -} - -// ListerAt does for file lists what io.ReaderAt does for files. -// ListAt should return the number of entries copied and an io.EOF -// error if at end of list. This is testable by comparing how many you -// copied to how many could be copied (eg. n < len(ls) below). -// The copy() builtin is best for the copying. -// Note in cases of an error, the error text will be sent to the client. -type ListerAt interface { - ListAt([]os.FileInfo, int64) (int, error) -} diff --git a/vendor/github.com/pkg/sftp/request-server.go b/vendor/github.com/pkg/sftp/request-server.go deleted file mode 100644 index ec64a1ff..00000000 --- a/vendor/github.com/pkg/sftp/request-server.go +++ /dev/null @@ -1,238 +0,0 @@ -package sftp - -import ( - "context" - "encoding" - "io" - "path" - "path/filepath" - "strconv" - "sync" - "syscall" - - "github.com/pkg/errors" -) - -var maxTxPacket uint32 = 1 << 15 - -// Handlers contains the 4 SFTP server request handlers. -type Handlers struct { - FileGet FileReader - FilePut FileWriter - FileCmd FileCmder - FileList FileLister -} - -// RequestServer abstracts the sftp protocol with an http request-like protocol -type RequestServer struct { - *serverConn - Handlers Handlers - pktMgr *packetManager - openRequests map[string]*Request - openRequestLock sync.RWMutex - handleCount int -} - -// NewRequestServer creates/allocates/returns new RequestServer. -// Normally there there will be one server per user-session. -func NewRequestServer(rwc io.ReadWriteCloser, h Handlers) *RequestServer { - svrConn := &serverConn{ - conn: conn{ - Reader: rwc, - WriteCloser: rwc, - }, - } - return &RequestServer{ - serverConn: svrConn, - Handlers: h, - pktMgr: newPktMgr(svrConn), - openRequests: make(map[string]*Request), - } -} - -// New Open packet/Request -func (rs *RequestServer) nextRequest(r *Request) string { - rs.openRequestLock.Lock() - defer rs.openRequestLock.Unlock() - rs.handleCount++ - handle := strconv.Itoa(rs.handleCount) - rs.openRequests[handle] = r - return handle -} - -// Returns Request from openRequests, bool is false if it is missing -// If the method is different, save/return a new Request w/ that Method. -// -// The Requests in openRequests work essentially as open file descriptors that -// you can do different things with. What you are doing with it are denoted by -// the first packet of that type (read/write/etc). We create a new Request when -// it changes to set the request.Method attribute in a thread safe way. -func (rs *RequestServer) getRequest(handle, method string) (*Request, bool) { - rs.openRequestLock.RLock() - r, ok := rs.openRequests[handle] - rs.openRequestLock.RUnlock() - if !ok || r.Method == method { - return r, ok - } - // if we make it here we need to replace the request - rs.openRequestLock.Lock() - defer rs.openRequestLock.Unlock() - r, ok = rs.openRequests[handle] - if !ok || r.Method == method { // re-check needed b/c lock race - return r, ok - } - r = r.copy() - r.Method = method - rs.openRequests[handle] = r - return r, ok -} - -func (rs *RequestServer) closeRequest(handle string) error { - rs.openRequestLock.Lock() - defer rs.openRequestLock.Unlock() - if r, ok := rs.openRequests[handle]; ok { - delete(rs.openRequests, handle) - return r.close() - } - return syscall.EBADF -} - -// Close the read/write/closer to trigger exiting the main server loop -func (rs *RequestServer) Close() error { return rs.conn.Close() } - -// Serve requests for user session -func (rs *RequestServer) Serve() error { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - var wg sync.WaitGroup - runWorker := func(ch requestChan) { - wg.Add(1) - go func() { - defer wg.Done() - if err := rs.packetWorker(ctx, ch); err != nil { - rs.conn.Close() // shuts down recvPacket - } - }() - } - pktChan := rs.pktMgr.workerChan(runWorker) - - var err error - var pkt requestPacket - var pktType uint8 - var pktBytes []byte - for { - pktType, pktBytes, err = rs.recvPacket() - if err != nil { - break - } - - pkt, err = makePacket(rxPacket{fxp(pktType), pktBytes}) - if err != nil { - debug("makePacket err: %v", err) - rs.conn.Close() // shuts down recvPacket - break - } - - pktChan <- pkt - } - - close(pktChan) // shuts down sftpServerWorkers - wg.Wait() // wait for all workers to exit - - // make sure all open requests are properly closed - // (eg. possible on dropped connections, client crashes, etc.) - for handle, req := range rs.openRequests { - delete(rs.openRequests, handle) - req.close() - } - - return err -} - -func (rs *RequestServer) packetWorker( - ctx context.Context, pktChan chan requestPacket, -) error { - for pkt := range pktChan { - var rpkt responsePacket - switch pkt := pkt.(type) { - case *sshFxInitPacket: - rpkt = sshFxVersionPacket{sftpProtocolVersion, nil} - case *sshFxpClosePacket: - handle := pkt.getHandle() - rpkt = statusFromError(pkt, rs.closeRequest(handle)) - case *sshFxpRealpathPacket: - rpkt = cleanPacketPath(pkt) - case *sshFxpOpendirPacket: - request := requestFromPacket(ctx, pkt) - handle := rs.nextRequest(request) - rpkt = sshFxpHandlePacket{pkt.id(), handle} - case *sshFxpOpenPacket: - request := requestFromPacket(ctx, pkt) - handle := rs.nextRequest(request) - rpkt = sshFxpHandlePacket{pkt.id(), handle} - if pkt.hasPflags(ssh_FXF_CREAT) { - if p := request.call(rs.Handlers, pkt); !isOk(p) { - rpkt = p // if error in write, return it - } - } - case hasHandle: - handle := pkt.getHandle() - request, ok := rs.getRequest(handle, requestMethod(pkt)) - if !ok { - rpkt = statusFromError(pkt, syscall.EBADF) - } else { - rpkt = request.call(rs.Handlers, pkt) - } - case hasPath: - request := requestFromPacket(ctx, pkt) - rpkt = request.call(rs.Handlers, pkt) - request.close() - default: - return errors.Errorf("unexpected packet type %T", pkt) - } - - err := rs.sendPacket(rpkt) - if err != nil { - return err - } - } - return nil -} - -// True is responsePacket is an OK status packet -func isOk(rpkt responsePacket) bool { - p, ok := rpkt.(sshFxpStatusPacket) - return ok && p.StatusError.Code == ssh_FX_OK -} - -// clean and return name packet for file -func cleanPacketPath(pkt *sshFxpRealpathPacket) responsePacket { - path := cleanPath(pkt.getPath()) - return &sshFxpNamePacket{ - ID: pkt.id(), - NameAttrs: []sshFxpNameAttr{{ - Name: path, - LongName: path, - Attrs: emptyFileStat, - }}, - } -} - -// Makes sure we have a clean POSIX (/) absolute path to work with -func cleanPath(p string) string { - p = filepath.ToSlash(p) - if !filepath.IsAbs(p) { - p = "/" + p - } - return path.Clean(p) -} - -// Wrap underlying connection methods to use packetManager -func (rs *RequestServer) sendPacket(m encoding.BinaryMarshaler) error { - if pkt, ok := m.(responsePacket); ok { - rs.pktMgr.readyPacket(pkt) - } else { - return errors.Errorf("unexpected packet type %T", m) - } - return nil -} diff --git a/vendor/github.com/pkg/sftp/request-unix.go b/vendor/github.com/pkg/sftp/request-unix.go deleted file mode 100644 index a71a8980..00000000 --- a/vendor/github.com/pkg/sftp/request-unix.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !windows - -package sftp - -import ( - "errors" - "syscall" -) - -func fakeFileInfoSys() interface{} { - return &syscall.Stat_t{Uid: 65534, Gid: 65534} -} - -func testOsSys(sys interface{}) error { - fstat := sys.(*FileStat) - if fstat.UID != uint32(65534) { - return errors.New("Uid failed to match.") - } - if fstat.GID != uint32(65534) { - return errors.New("Gid failed to match:") - } - return nil -} diff --git a/vendor/github.com/pkg/sftp/request.go b/vendor/github.com/pkg/sftp/request.go deleted file mode 100644 index d74d6fa3..00000000 --- a/vendor/github.com/pkg/sftp/request.go +++ /dev/null @@ -1,353 +0,0 @@ -package sftp - -import ( - "context" - "io" - "os" - "path" - "path/filepath" - "sync" - "syscall" - - "github.com/pkg/errors" -) - -// MaxFilelist is the max number of files to return in a readdir batch. -var MaxFilelist int64 = 100 - -// Request contains the data and state for the incoming service request. -type Request struct { - // Get, Put, Setstat, Stat, Rename, Remove - // Rmdir, Mkdir, List, Readlink, Symlink - Method string - Filepath string - Flags uint32 - Attrs []byte // convert to sub-struct - Target string // for renames and sym-links - // reader/writer/readdir from handlers - state state - // context lasts duration of request - ctx context.Context - cancelCtx context.CancelFunc -} - -type state struct { - *sync.RWMutex - writerAt io.WriterAt - readerAt io.ReaderAt - listerAt ListerAt - lsoffset int64 -} - -// New Request initialized based on packet data -func requestFromPacket(ctx context.Context, pkt hasPath) *Request { - method := requestMethod(pkt) - request := NewRequest(method, pkt.getPath()) - request.ctx, request.cancelCtx = context.WithCancel(ctx) - - switch p := pkt.(type) { - case *sshFxpOpenPacket: - request.Flags = p.Pflags - case *sshFxpSetstatPacket: - request.Flags = p.Flags - request.Attrs = p.Attrs.([]byte) - case *sshFxpRenamePacket: - request.Target = cleanPath(p.Newpath) - case *sshFxpSymlinkPacket: - request.Target = cleanPath(p.Linkpath) - } - return request -} - -// NewRequest creates a new Request object. -func NewRequest(method, path string) *Request { - return &Request{Method: method, Filepath: cleanPath(path), - state: state{RWMutex: new(sync.RWMutex)}} -} - -// shallow copy of existing request -func (r *Request) copy() *Request { - r.state.Lock() - defer r.state.Unlock() - r2 := new(Request) - *r2 = *r - return r2 -} - -// Context returns the request's context. To change the context, -// use WithContext. -// -// The returned context is always non-nil; it defaults to the -// background context. -// -// For incoming server requests, the context is canceled when the -// request is complete or the client's connection closes. -func (r *Request) Context() context.Context { - if r.ctx != nil { - return r.ctx - } - return context.Background() -} - -// WithContext returns a copy of r with its context changed to ctx. -// The provided ctx must be non-nil. -func (r *Request) WithContext(ctx context.Context) *Request { - if ctx == nil { - panic("nil context") - } - r2 := r.copy() - r2.ctx = ctx - r2.cancelCtx = nil - return r2 -} - -// Returns current offset for file list -func (r *Request) lsNext() int64 { - r.state.RLock() - defer r.state.RUnlock() - return r.state.lsoffset -} - -// Increases next offset -func (r *Request) lsInc(offset int64) { - r.state.Lock() - defer r.state.Unlock() - r.state.lsoffset = r.state.lsoffset + offset -} - -// manage file read/write state -func (r *Request) setWriterState(wa io.WriterAt) { - r.state.Lock() - defer r.state.Unlock() - r.state.writerAt = wa -} -func (r *Request) setReaderState(ra io.ReaderAt) { - r.state.Lock() - defer r.state.Unlock() - r.state.readerAt = ra -} -func (r *Request) setListerState(la ListerAt) { - r.state.Lock() - defer r.state.Unlock() - r.state.listerAt = la -} - -func (r *Request) getWriter() io.WriterAt { - r.state.RLock() - defer r.state.RUnlock() - return r.state.writerAt -} - -func (r *Request) getReader() io.ReaderAt { - r.state.RLock() - defer r.state.RUnlock() - return r.state.readerAt -} - -func (r *Request) getLister() ListerAt { - r.state.RLock() - defer r.state.RUnlock() - return r.state.listerAt -} - -// Close reader/writer if possible -func (r *Request) close() error { - if r.cancelCtx != nil { - r.cancelCtx() - } - rd := r.getReader() - if c, ok := rd.(io.Closer); ok { - return c.Close() - } - wt := r.getWriter() - if c, ok := wt.(io.Closer); ok { - return c.Close() - } - return nil -} - -// called from worker to handle packet/request -func (r *Request) call(handlers Handlers, pkt requestPacket) responsePacket { - switch r.Method { - case "Get": - return fileget(handlers.FileGet, r, pkt) - case "Put", "Open": - return fileput(handlers.FilePut, r, pkt) - case "Setstat", "Rename", "Rmdir", "Mkdir", "Symlink", "Remove": - return filecmd(handlers.FileCmd, r, pkt) - case "List", "Stat", "Readlink": - return filelist(handlers.FileList, r, pkt) - default: - return statusFromError(pkt, - errors.Errorf("unexpected method: %s", r.Method)) - } -} - -// file data for additional read/write packets -func packetData(p requestPacket) (data []byte, offset int64, length uint32) { - switch p := p.(type) { - case *sshFxpReadPacket: - length = p.Len - offset = int64(p.Offset) - case *sshFxpWritePacket: - data = p.Data - length = p.Length - offset = int64(p.Offset) - } - return -} - -// wrap FileReader handler -func fileget(h FileReader, r *Request, pkt requestPacket) responsePacket { - var err error - reader := r.getReader() - if reader == nil { - reader, err = h.Fileread(r) - if err != nil { - return statusFromError(pkt, err) - } - r.setReaderState(reader) - } - - _, offset, length := packetData(pkt) - data := make([]byte, clamp(length, maxTxPacket)) - n, err := reader.ReadAt(data, offset) - // only return EOF erro if no data left to read - if err != nil && (err != io.EOF || n == 0) { - return statusFromError(pkt, err) - } - return &sshFxpDataPacket{ - ID: pkt.id(), - Length: uint32(n), - Data: data[:n], - } -} - -// wrap FileWriter handler -func fileput(h FileWriter, r *Request, pkt requestPacket) responsePacket { - var err error - writer := r.getWriter() - if writer == nil { - writer, err = h.Filewrite(r) - if err != nil { - return statusFromError(pkt, err) - } - r.setWriterState(writer) - } - - data, offset, _ := packetData(pkt) - _, err = writer.WriteAt(data, offset) - return statusFromError(pkt, err) -} - -// wrap FileCmder handler -func filecmd(h FileCmder, r *Request, pkt requestPacket) responsePacket { - err := h.Filecmd(r) - return statusFromError(pkt, err) -} - -// wrap FileLister handler -func filelist(h FileLister, r *Request, pkt requestPacket) responsePacket { - var err error - lister := r.getLister() - if lister == nil { - lister, err = h.Filelist(r) - if err != nil { - return statusFromError(pkt, err) - } - r.setListerState(lister) - } - - offset := r.lsNext() - finfo := make([]os.FileInfo, MaxFilelist) - n, err := lister.ListAt(finfo, offset) - r.lsInc(int64(n)) - // ignore EOF as we only return it when there are no results - finfo = finfo[:n] // avoid need for nil tests below - - switch r.Method { - case "List": - if err != nil && err != io.EOF { - return statusFromError(pkt, err) - } - if n == 0 { - return statusFromError(pkt, io.EOF) - } - dirname := filepath.ToSlash(path.Base(r.Filepath)) - ret := &sshFxpNamePacket{ID: pkt.id()} - - for _, fi := range finfo { - ret.NameAttrs = append(ret.NameAttrs, sshFxpNameAttr{ - Name: fi.Name(), - LongName: runLs(dirname, fi), - Attrs: []interface{}{fi}, - }) - } - return ret - case "Stat": - if err != nil && err != io.EOF { - return statusFromError(pkt, err) - } - if n == 0 { - err = &os.PathError{Op: "stat", Path: r.Filepath, - Err: syscall.ENOENT} - return statusFromError(pkt, err) - } - return &sshFxpStatResponse{ - ID: pkt.id(), - info: finfo[0], - } - case "Readlink": - if err != nil && err != io.EOF { - return statusFromError(pkt, err) - } - if n == 0 { - err = &os.PathError{Op: "readlink", Path: r.Filepath, - Err: syscall.ENOENT} - return statusFromError(pkt, err) - } - filename := finfo[0].Name() - return &sshFxpNamePacket{ - ID: pkt.id(), - NameAttrs: []sshFxpNameAttr{{ - Name: filename, - LongName: filename, - Attrs: emptyFileStat, - }}, - } - default: - err = errors.Errorf("unexpected method: %s", r.Method) - return statusFromError(pkt, err) - } -} - -// init attributes of request object from packet data -func requestMethod(p requestPacket) (method string) { - switch p.(type) { - case *sshFxpReadPacket: - method = "Get" - case *sshFxpWritePacket: - method = "Put" - case *sshFxpReaddirPacket: - method = "List" - case *sshFxpOpenPacket, *sshFxpOpendirPacket: - method = "Open" - case *sshFxpSetstatPacket, *sshFxpFsetstatPacket: - method = "Setstat" - case *sshFxpRenamePacket: - method = "Rename" - case *sshFxpSymlinkPacket: - method = "Symlink" - case *sshFxpRemovePacket: - method = "Remove" - case *sshFxpStatPacket, *sshFxpLstatPacket, *sshFxpFstatPacket: - method = "Stat" - case *sshFxpRmdirPacket: - method = "Rmdir" - case *sshFxpReadlinkPacket: - method = "Readlink" - case *sshFxpMkdirPacket: - method = "Mkdir" - } - return method -} diff --git a/vendor/github.com/pkg/sftp/request_windows.go b/vendor/github.com/pkg/sftp/request_windows.go deleted file mode 100644 index 94d306b6..00000000 --- a/vendor/github.com/pkg/sftp/request_windows.go +++ /dev/null @@ -1,11 +0,0 @@ -package sftp - -import "syscall" - -func fakeFileInfoSys() interface{} { - return syscall.Win32FileAttributeData{} -} - -func testOsSys(sys interface{}) error { - return nil -} diff --git a/vendor/github.com/pkg/sftp/server.go b/vendor/github.com/pkg/sftp/server.go deleted file mode 100644 index 16678d1f..00000000 --- a/vendor/github.com/pkg/sftp/server.go +++ /dev/null @@ -1,675 +0,0 @@ -package sftp - -// sftp server counterpart - -import ( - "encoding" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "sync" - "syscall" - "time" - - "github.com/pkg/errors" -) - -const ( - SftpServerWorkerCount = 8 -) - -// Server is an SSH File Transfer Protocol (sftp) server. -// This is intended to provide the sftp subsystem to an ssh server daemon. -// This implementation currently supports most of sftp server protocol version 3, -// as specified at http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 -type Server struct { - *serverConn - debugStream io.Writer - readOnly bool - pktMgr *packetManager - openFiles map[string]*os.File - openFilesLock sync.RWMutex - handleCount int - maxTxPacket uint32 -} - -func (svr *Server) nextHandle(f *os.File) string { - svr.openFilesLock.Lock() - defer svr.openFilesLock.Unlock() - svr.handleCount++ - handle := strconv.Itoa(svr.handleCount) - svr.openFiles[handle] = f - return handle -} - -func (svr *Server) closeHandle(handle string) error { - svr.openFilesLock.Lock() - defer svr.openFilesLock.Unlock() - if f, ok := svr.openFiles[handle]; ok { - delete(svr.openFiles, handle) - return f.Close() - } - - return syscall.EBADF -} - -func (svr *Server) getHandle(handle string) (*os.File, bool) { - svr.openFilesLock.RLock() - defer svr.openFilesLock.RUnlock() - f, ok := svr.openFiles[handle] - return f, ok -} - -type serverRespondablePacket interface { - encoding.BinaryUnmarshaler - id() uint32 - respond(svr *Server) error -} - -// NewServer creates a new Server instance around the provided streams, serving -// content from the root of the filesystem. Optionally, ServerOption -// functions may be specified to further configure the Server. -// -// A subsequent call to Serve() is required to begin serving files over SFTP. -func NewServer(rwc io.ReadWriteCloser, options ...ServerOption) (*Server, error) { - svrConn := &serverConn{ - conn: conn{ - Reader: rwc, - WriteCloser: rwc, - }, - } - s := &Server{ - serverConn: svrConn, - debugStream: ioutil.Discard, - pktMgr: newPktMgr(svrConn), - openFiles: make(map[string]*os.File), - maxTxPacket: 1 << 15, - } - - for _, o := range options { - if err := o(s); err != nil { - return nil, err - } - } - - return s, nil -} - -// A ServerOption is a function which applies configuration to a Server. -type ServerOption func(*Server) error - -// WithDebug enables Server debugging output to the supplied io.Writer. -func WithDebug(w io.Writer) ServerOption { - return func(s *Server) error { - s.debugStream = w - return nil - } -} - -// ReadOnly configures a Server to serve files in read-only mode. -func ReadOnly() ServerOption { - return func(s *Server) error { - s.readOnly = true - return nil - } -} - -type rxPacket struct { - pktType fxp - pktBytes []byte -} - -// Up to N parallel servers -func (svr *Server) sftpServerWorker(pktChan chan requestPacket) error { - for pkt := range pktChan { - - // readonly checks - readonly := true - switch pkt := pkt.(type) { - case notReadOnly: - readonly = false - case *sshFxpOpenPacket: - readonly = pkt.readonly() - case *sshFxpExtendedPacket: - readonly = pkt.SpecificPacket.readonly() - } - - // If server is operating read-only and a write operation is requested, - // return permission denied - if !readonly && svr.readOnly { - if err := svr.sendError(pkt, syscall.EPERM); err != nil { - return errors.Wrap(err, "failed to send read only packet response") - } - continue - } - - if err := handlePacket(svr, pkt); err != nil { - return err - } - } - return nil -} - -func handlePacket(s *Server, p interface{}) error { - switch p := p.(type) { - case *sshFxInitPacket: - return s.sendPacket(sshFxVersionPacket{sftpProtocolVersion, nil}) - case *sshFxpStatPacket: - // stat the requested file - info, err := os.Stat(p.Path) - if err != nil { - return s.sendError(p, err) - } - return s.sendPacket(sshFxpStatResponse{ - ID: p.ID, - info: info, - }) - case *sshFxpLstatPacket: - // stat the requested file - info, err := os.Lstat(p.Path) - if err != nil { - return s.sendError(p, err) - } - return s.sendPacket(sshFxpStatResponse{ - ID: p.ID, - info: info, - }) - case *sshFxpFstatPacket: - f, ok := s.getHandle(p.Handle) - if !ok { - return s.sendError(p, syscall.EBADF) - } - - info, err := f.Stat() - if err != nil { - return s.sendError(p, err) - } - - return s.sendPacket(sshFxpStatResponse{ - ID: p.ID, - info: info, - }) - case *sshFxpMkdirPacket: - // TODO FIXME: ignore flags field - err := os.Mkdir(p.Path, 0755) - return s.sendError(p, err) - case *sshFxpRmdirPacket: - err := os.Remove(p.Path) - return s.sendError(p, err) - case *sshFxpRemovePacket: - err := os.Remove(p.Filename) - return s.sendError(p, err) - case *sshFxpRenamePacket: - err := os.Rename(p.Oldpath, p.Newpath) - return s.sendError(p, err) - case *sshFxpSymlinkPacket: - err := os.Symlink(p.Targetpath, p.Linkpath) - return s.sendError(p, err) - case *sshFxpClosePacket: - return s.sendError(p, s.closeHandle(p.Handle)) - case *sshFxpReadlinkPacket: - f, err := os.Readlink(p.Path) - if err != nil { - return s.sendError(p, err) - } - - return s.sendPacket(sshFxpNamePacket{ - ID: p.ID, - NameAttrs: []sshFxpNameAttr{{ - Name: f, - LongName: f, - Attrs: emptyFileStat, - }}, - }) - - case *sshFxpRealpathPacket: - f, err := filepath.Abs(p.Path) - if err != nil { - return s.sendError(p, err) - } - f = cleanPath(f) - return s.sendPacket(sshFxpNamePacket{ - ID: p.ID, - NameAttrs: []sshFxpNameAttr{{ - Name: f, - LongName: f, - Attrs: emptyFileStat, - }}, - }) - case *sshFxpOpendirPacket: - return sshFxpOpenPacket{ - ID: p.ID, - Path: p.Path, - Pflags: ssh_FXF_READ, - }.respond(s) - case *sshFxpReadPacket: - f, ok := s.getHandle(p.Handle) - if !ok { - return s.sendError(p, syscall.EBADF) - } - - data := make([]byte, clamp(p.Len, s.maxTxPacket)) - n, err := f.ReadAt(data, int64(p.Offset)) - if err != nil && (err != io.EOF || n == 0) { - return s.sendError(p, err) - } - return s.sendPacket(sshFxpDataPacket{ - ID: p.ID, - Length: uint32(n), - Data: data[:n], - }) - case *sshFxpWritePacket: - f, ok := s.getHandle(p.Handle) - if !ok { - return s.sendError(p, syscall.EBADF) - } - - _, err := f.WriteAt(p.Data, int64(p.Offset)) - return s.sendError(p, err) - case serverRespondablePacket: - err := p.respond(s) - return errors.Wrap(err, "pkt.respond failed") - default: - return errors.Errorf("unexpected packet type %T", p) - } -} - -// Serve serves SFTP connections until the streams stop or the SFTP subsystem -// is stopped. -func (svr *Server) Serve() error { - var wg sync.WaitGroup - runWorker := func(ch requestChan) { - wg.Add(1) - go func() { - defer wg.Done() - if err := svr.sftpServerWorker(ch); err != nil { - svr.conn.Close() // shuts down recvPacket - } - }() - } - pktChan := svr.pktMgr.workerChan(runWorker) - - var err error - var pkt requestPacket - var pktType uint8 - var pktBytes []byte - for { - pktType, pktBytes, err = svr.recvPacket() - if err != nil { - break - } - - pkt, err = makePacket(rxPacket{fxp(pktType), pktBytes}) - if err != nil { - debug("makePacket err: %v", err) - svr.conn.Close() // shuts down recvPacket - break - } - - pktChan <- pkt - } - - close(pktChan) // shuts down sftpServerWorkers - wg.Wait() // wait for all workers to exit - - // close any still-open files - for handle, file := range svr.openFiles { - fmt.Fprintf(svr.debugStream, "sftp server file with handle %q left open: %v\n", handle, file.Name()) - file.Close() - } - return err // error from recvPacket -} - -// Wrap underlying connection methods to use packetManager -func (svr *Server) sendPacket(m encoding.BinaryMarshaler) error { - if pkt, ok := m.(responsePacket); ok { - svr.pktMgr.readyPacket(pkt) - } else { - return errors.Errorf("unexpected packet type %T", m) - } - return nil -} - -func (svr *Server) sendError(p ider, err error) error { - return svr.sendPacket(statusFromError(p, err)) -} - -type ider interface { - id() uint32 -} - -// The init packet has no ID, so we just return a zero-value ID -func (p sshFxInitPacket) id() uint32 { return 0 } - -type sshFxpStatResponse struct { - ID uint32 - info os.FileInfo -} - -func (p sshFxpStatResponse) MarshalBinary() ([]byte, error) { - b := []byte{ssh_FXP_ATTRS} - b = marshalUint32(b, p.ID) - b = marshalFileInfo(b, p.info) - return b, nil -} - -var emptyFileStat = []interface{}{uint32(0)} - -func (p sshFxpOpenPacket) readonly() bool { - return !p.hasPflags(ssh_FXF_WRITE) -} - -func (p sshFxpOpenPacket) hasPflags(flags ...uint32) bool { - for _, f := range flags { - if p.Pflags&f == 0 { - return false - } - } - return true -} - -func (p sshFxpOpenPacket) respond(svr *Server) error { - var osFlags int - if p.hasPflags(ssh_FXF_READ, ssh_FXF_WRITE) { - osFlags |= os.O_RDWR - } else if p.hasPflags(ssh_FXF_WRITE) { - osFlags |= os.O_WRONLY - } else if p.hasPflags(ssh_FXF_READ) { - osFlags |= os.O_RDONLY - } else { - // how are they opening? - return svr.sendError(p, syscall.EINVAL) - } - - if p.hasPflags(ssh_FXF_APPEND) { - osFlags |= os.O_APPEND - } - if p.hasPflags(ssh_FXF_CREAT) { - osFlags |= os.O_CREATE - } - if p.hasPflags(ssh_FXF_TRUNC) { - osFlags |= os.O_TRUNC - } - if p.hasPflags(ssh_FXF_EXCL) { - osFlags |= os.O_EXCL - } - - f, err := os.OpenFile(p.Path, osFlags, 0644) - if err != nil { - return svr.sendError(p, err) - } - - handle := svr.nextHandle(f) - return svr.sendPacket(sshFxpHandlePacket{p.ID, handle}) -} - -func (p sshFxpReaddirPacket) respond(svr *Server) error { - f, ok := svr.getHandle(p.Handle) - if !ok { - return svr.sendError(p, syscall.EBADF) - } - - dirname := f.Name() - dirents, err := f.Readdir(128) - if err != nil { - return svr.sendError(p, err) - } - - ret := sshFxpNamePacket{ID: p.ID} - for _, dirent := range dirents { - ret.NameAttrs = append(ret.NameAttrs, sshFxpNameAttr{ - Name: dirent.Name(), - LongName: runLs(dirname, dirent), - Attrs: []interface{}{dirent}, - }) - } - return svr.sendPacket(ret) -} - -func (p sshFxpSetstatPacket) respond(svr *Server) error { - // additional unmarshalling is required for each possibility here - b := p.Attrs.([]byte) - var err error - - debug("setstat name \"%s\"", p.Path) - if (p.Flags & ssh_FILEXFER_ATTR_SIZE) != 0 { - var size uint64 - if size, b, err = unmarshalUint64Safe(b); err == nil { - err = os.Truncate(p.Path, int64(size)) - } - } - if (p.Flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0 { - var mode uint32 - if mode, b, err = unmarshalUint32Safe(b); err == nil { - err = os.Chmod(p.Path, os.FileMode(mode)) - } - } - if (p.Flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0 { - var atime uint32 - var mtime uint32 - if atime, b, err = unmarshalUint32Safe(b); err != nil { - } else if mtime, b, err = unmarshalUint32Safe(b); err != nil { - } else { - atimeT := time.Unix(int64(atime), 0) - mtimeT := time.Unix(int64(mtime), 0) - err = os.Chtimes(p.Path, atimeT, mtimeT) - } - } - if (p.Flags & ssh_FILEXFER_ATTR_UIDGID) != 0 { - var uid uint32 - var gid uint32 - if uid, b, err = unmarshalUint32Safe(b); err != nil { - } else if gid, _, err = unmarshalUint32Safe(b); err != nil { - } else { - err = os.Chown(p.Path, int(uid), int(gid)) - } - } - - return svr.sendError(p, err) -} - -func (p sshFxpFsetstatPacket) respond(svr *Server) error { - f, ok := svr.getHandle(p.Handle) - if !ok { - return svr.sendError(p, syscall.EBADF) - } - - // additional unmarshalling is required for each possibility here - b := p.Attrs.([]byte) - var err error - - debug("fsetstat name \"%s\"", f.Name()) - if (p.Flags & ssh_FILEXFER_ATTR_SIZE) != 0 { - var size uint64 - if size, b, err = unmarshalUint64Safe(b); err == nil { - err = f.Truncate(int64(size)) - } - } - if (p.Flags & ssh_FILEXFER_ATTR_PERMISSIONS) != 0 { - var mode uint32 - if mode, b, err = unmarshalUint32Safe(b); err == nil { - err = f.Chmod(os.FileMode(mode)) - } - } - if (p.Flags & ssh_FILEXFER_ATTR_ACMODTIME) != 0 { - var atime uint32 - var mtime uint32 - if atime, b, err = unmarshalUint32Safe(b); err != nil { - } else if mtime, b, err = unmarshalUint32Safe(b); err != nil { - } else { - atimeT := time.Unix(int64(atime), 0) - mtimeT := time.Unix(int64(mtime), 0) - err = os.Chtimes(f.Name(), atimeT, mtimeT) - } - } - if (p.Flags & ssh_FILEXFER_ATTR_UIDGID) != 0 { - var uid uint32 - var gid uint32 - if uid, b, err = unmarshalUint32Safe(b); err != nil { - } else if gid, _, err = unmarshalUint32Safe(b); err != nil { - } else { - err = f.Chown(int(uid), int(gid)) - } - } - - return svr.sendError(p, err) -} - -// translateErrno translates a syscall error number to a SFTP error code. -func translateErrno(errno syscall.Errno) uint32 { - switch errno { - case 0: - return ssh_FX_OK - case syscall.ENOENT: - return ssh_FX_NO_SUCH_FILE - case syscall.EPERM: - return ssh_FX_PERMISSION_DENIED - } - - return ssh_FX_FAILURE -} - -func statusFromError(p ider, err error) sshFxpStatusPacket { - ret := sshFxpStatusPacket{ - ID: p.id(), - StatusError: StatusError{ - // ssh_FX_OK = 0 - // ssh_FX_EOF = 1 - // ssh_FX_NO_SUCH_FILE = 2 ENOENT - // ssh_FX_PERMISSION_DENIED = 3 - // ssh_FX_FAILURE = 4 - // ssh_FX_BAD_MESSAGE = 5 - // ssh_FX_NO_CONNECTION = 6 - // ssh_FX_CONNECTION_LOST = 7 - // ssh_FX_OP_UNSUPPORTED = 8 - Code: ssh_FX_OK, - }, - } - if err == nil { - return ret - } - - debug("statusFromError: error is %T %#v", err, err) - ret.StatusError.Code = ssh_FX_FAILURE - ret.StatusError.msg = err.Error() - - switch e := err.(type) { - case syscall.Errno: - ret.StatusError.Code = translateErrno(e) - case *os.PathError: - debug("statusFromError,pathError: error is %T %#v", e.Err, e.Err) - if errno, ok := e.Err.(syscall.Errno); ok { - ret.StatusError.Code = translateErrno(errno) - } - case fxerr: - ret.StatusError.Code = uint32(e) - default: - switch e { - case io.EOF: - ret.StatusError.Code = ssh_FX_EOF - case os.ErrNotExist: - ret.StatusError.Code = ssh_FX_NO_SUCH_FILE - } - } - - return ret -} - -func clamp(v, max uint32) uint32 { - if v > max { - return max - } - return v -} - -func runLsTypeWord(dirent os.FileInfo) string { - // find first character, the type char - // b Block special file. - // c Character special file. - // d Directory. - // l Symbolic link. - // s Socket link. - // p FIFO. - // - Regular file. - tc := '-' - mode := dirent.Mode() - if (mode & os.ModeDir) != 0 { - tc = 'd' - } else if (mode & os.ModeDevice) != 0 { - tc = 'b' - if (mode & os.ModeCharDevice) != 0 { - tc = 'c' - } - } else if (mode & os.ModeSymlink) != 0 { - tc = 'l' - } else if (mode & os.ModeSocket) != 0 { - tc = 's' - } else if (mode & os.ModeNamedPipe) != 0 { - tc = 'p' - } - - // owner - orc := '-' - if (mode & 0400) != 0 { - orc = 'r' - } - owc := '-' - if (mode & 0200) != 0 { - owc = 'w' - } - oxc := '-' - ox := (mode & 0100) != 0 - setuid := (mode & os.ModeSetuid) != 0 - if ox && setuid { - oxc = 's' - } else if setuid { - oxc = 'S' - } else if ox { - oxc = 'x' - } - - // group - grc := '-' - if (mode & 040) != 0 { - grc = 'r' - } - gwc := '-' - if (mode & 020) != 0 { - gwc = 'w' - } - gxc := '-' - gx := (mode & 010) != 0 - setgid := (mode & os.ModeSetgid) != 0 - if gx && setgid { - gxc = 's' - } else if setgid { - gxc = 'S' - } else if gx { - gxc = 'x' - } - - // all / others - arc := '-' - if (mode & 04) != 0 { - arc = 'r' - } - awc := '-' - if (mode & 02) != 0 { - awc = 'w' - } - axc := '-' - ax := (mode & 01) != 0 - sticky := (mode & os.ModeSticky) != 0 - if ax && sticky { - axc = 't' - } else if sticky { - axc = 'T' - } else if ax { - axc = 'x' - } - - return fmt.Sprintf("%c%c%c%c%c%c%c%c%c%c", tc, orc, owc, oxc, grc, gwc, gxc, arc, awc, axc) -} diff --git a/vendor/github.com/pkg/sftp/server_standalone/main.go b/vendor/github.com/pkg/sftp/server_standalone/main.go deleted file mode 100644 index 0b8e102a..00000000 --- a/vendor/github.com/pkg/sftp/server_standalone/main.go +++ /dev/null @@ -1,52 +0,0 @@ -package main - -// small wrapper around sftp server that allows it to be used as a separate process subsystem call by the ssh server. -// in practice this will statically link; however this allows unit testing from the sftp client. - -import ( - "flag" - "fmt" - "io" - "io/ioutil" - "os" - - "github.com/pkg/sftp" -) - -func main() { - var ( - readOnly bool - debugStderr bool - debugLevel string - options []sftp.ServerOption - ) - - flag.BoolVar(&readOnly, "R", false, "read-only server") - flag.BoolVar(&debugStderr, "e", false, "debug to stderr") - flag.StringVar(&debugLevel, "l", "none", "debug level (ignored)") - flag.Parse() - - debugStream := ioutil.Discard - if debugStderr { - debugStream = os.Stderr - } - options = append(options, sftp.WithDebug(debugStream)) - - if readOnly { - options = append(options, sftp.ReadOnly()) - } - - svr, _ := sftp.NewServer( - struct { - io.Reader - io.WriteCloser - }{os.Stdin, - os.Stdout, - }, - options..., - ) - if err := svr.Serve(); err != nil { - fmt.Fprintf(debugStream, "sftp server completed with error: %v", err) - os.Exit(1) - } -} diff --git a/vendor/github.com/pkg/sftp/server_statvfs_darwin.go b/vendor/github.com/pkg/sftp/server_statvfs_darwin.go deleted file mode 100644 index 8c01dac5..00000000 --- a/vendor/github.com/pkg/sftp/server_statvfs_darwin.go +++ /dev/null @@ -1,21 +0,0 @@ -package sftp - -import ( - "syscall" -) - -func statvfsFromStatfst(stat *syscall.Statfs_t) (*StatVFS, error) { - return &StatVFS{ - Bsize: uint64(stat.Bsize), - Frsize: uint64(stat.Bsize), // fragment size is a linux thing; use block size here - Blocks: stat.Blocks, - Bfree: stat.Bfree, - Bavail: stat.Bavail, - Files: stat.Files, - Ffree: stat.Ffree, - Favail: stat.Ffree, // not sure how to calculate Favail - Fsid: uint64(uint64(stat.Fsid.Val[1])<<32 | uint64(stat.Fsid.Val[0])), // endianness? - Flag: uint64(stat.Flags), // assuming POSIX? - Namemax: 1024, // man 2 statfs shows: #define MAXPATHLEN 1024 - }, nil -} diff --git a/vendor/github.com/pkg/sftp/server_statvfs_impl.go b/vendor/github.com/pkg/sftp/server_statvfs_impl.go deleted file mode 100644 index c37a34ac..00000000 --- a/vendor/github.com/pkg/sftp/server_statvfs_impl.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build darwin linux - -// fill in statvfs structure with OS specific values -// Statfs_t is different per-kernel, and only exists on some unixes (not Solaris for instance) - -package sftp - -import ( - "syscall" -) - -func (p sshFxpExtendedPacketStatVFS) respond(svr *Server) error { - stat := &syscall.Statfs_t{} - if err := syscall.Statfs(p.Path, stat); err != nil { - return svr.sendPacket(statusFromError(p, err)) - } - - retPkt, err := statvfsFromStatfst(stat) - if err != nil { - return svr.sendPacket(statusFromError(p, err)) - } - retPkt.ID = p.ID - - return svr.sendPacket(retPkt) -} diff --git a/vendor/github.com/pkg/sftp/server_statvfs_linux.go b/vendor/github.com/pkg/sftp/server_statvfs_linux.go deleted file mode 100644 index 1d180d47..00000000 --- a/vendor/github.com/pkg/sftp/server_statvfs_linux.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build linux - -package sftp - -import ( - "syscall" -) - -func statvfsFromStatfst(stat *syscall.Statfs_t) (*StatVFS, error) { - return &StatVFS{ - Bsize: uint64(stat.Bsize), - Frsize: uint64(stat.Frsize), - Blocks: stat.Blocks, - Bfree: stat.Bfree, - Bavail: stat.Bavail, - Files: stat.Files, - Ffree: stat.Ffree, - Favail: stat.Ffree, // not sure how to calculate Favail - Flag: uint64(stat.Flags), // assuming POSIX? - Namemax: uint64(stat.Namelen), - }, nil -} diff --git a/vendor/github.com/pkg/sftp/server_statvfs_stubs.go b/vendor/github.com/pkg/sftp/server_statvfs_stubs.go deleted file mode 100644 index 3fe40788..00000000 --- a/vendor/github.com/pkg/sftp/server_statvfs_stubs.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !darwin,!linux - -package sftp - -import ( - "syscall" -) - -func (p sshFxpExtendedPacketStatVFS) respond(svr *Server) error { - return syscall.ENOTSUP -} diff --git a/vendor/github.com/pkg/sftp/server_stubs.go b/vendor/github.com/pkg/sftp/server_stubs.go deleted file mode 100644 index a14c7348..00000000 --- a/vendor/github.com/pkg/sftp/server_stubs.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build !cgo,!plan9 windows android - -package sftp - -import ( - "os" - "time" - "fmt" -) - -func runLs(dirname string, dirent os.FileInfo) string { - typeword := runLsTypeWord(dirent) - numLinks := 1 - if dirent.IsDir() { - numLinks = 0 - } - username := "root" - groupname := "root" - mtime := dirent.ModTime() - monthStr := mtime.Month().String()[0:3] - day := mtime.Day() - year := mtime.Year() - now := time.Now() - isOld := mtime.Before(now.Add(-time.Hour * 24 * 365 / 2)) - - yearOrTime := fmt.Sprintf("%02d:%02d", mtime.Hour(), mtime.Minute()) - if isOld { - yearOrTime = fmt.Sprintf("%d", year) - } - - return fmt.Sprintf("%s %4d %-8s %-8s %8d %s %2d %5s %s", typeword, numLinks, username, groupname, dirent.Size(), monthStr, day, yearOrTime, dirent.Name()) -} diff --git a/vendor/github.com/pkg/sftp/server_unix.go b/vendor/github.com/pkg/sftp/server_unix.go deleted file mode 100644 index 8d0c138c..00000000 --- a/vendor/github.com/pkg/sftp/server_unix.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris -// +build cgo - -package sftp - -import ( - "fmt" - "os" - "path" - "syscall" - "time" -) - -func runLsStatt(dirent os.FileInfo, statt *syscall.Stat_t) string { - // example from openssh sftp server: - // crw-rw-rw- 1 root wheel 0 Jul 31 20:52 ttyvd - // format: - // {directory / char device / etc}{rwxrwxrwx} {number of links} owner group size month day [time (this year) | year (otherwise)] name - - typeword := runLsTypeWord(dirent) - numLinks := statt.Nlink - uid := statt.Uid - gid := statt.Gid - username := fmt.Sprintf("%d", uid) - groupname := fmt.Sprintf("%d", gid) - // TODO FIXME: uid -> username, gid -> groupname lookup for ls -l format output - - mtime := dirent.ModTime() - monthStr := mtime.Month().String()[0:3] - day := mtime.Day() - year := mtime.Year() - now := time.Now() - isOld := mtime.Before(now.Add(-time.Hour * 24 * 365 / 2)) - - yearOrTime := fmt.Sprintf("%02d:%02d", mtime.Hour(), mtime.Minute()) - if isOld { - yearOrTime = fmt.Sprintf("%d", year) - } - - return fmt.Sprintf("%s %4d %-8s %-8s %8d %s %2d %5s %s", typeword, numLinks, username, groupname, dirent.Size(), monthStr, day, yearOrTime, dirent.Name()) -} - -// ls -l style output for a file, which is in the 'long output' section of a readdir response packet -// this is a very simple (lazy) implementation, just enough to look almost like openssh in a few basic cases -func runLs(dirname string, dirent os.FileInfo) string { - dsys := dirent.Sys() - if dsys == nil { - } else if statt, ok := dsys.(*syscall.Stat_t); !ok { - } else { - return runLsStatt(dirent, statt) - } - - return path.Join(dirname, dirent.Name()) -} diff --git a/vendor/github.com/pkg/sftp/sftp.go b/vendor/github.com/pkg/sftp/sftp.go deleted file mode 100644 index 3cdb14df..00000000 --- a/vendor/github.com/pkg/sftp/sftp.go +++ /dev/null @@ -1,217 +0,0 @@ -// Package sftp implements the SSH File Transfer Protocol as described in -// https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 -package sftp - -import ( - "fmt" - - "github.com/pkg/errors" -) - -const ( - ssh_FXP_INIT = 1 - ssh_FXP_VERSION = 2 - ssh_FXP_OPEN = 3 - ssh_FXP_CLOSE = 4 - ssh_FXP_READ = 5 - ssh_FXP_WRITE = 6 - ssh_FXP_LSTAT = 7 - ssh_FXP_FSTAT = 8 - ssh_FXP_SETSTAT = 9 - ssh_FXP_FSETSTAT = 10 - ssh_FXP_OPENDIR = 11 - ssh_FXP_READDIR = 12 - ssh_FXP_REMOVE = 13 - ssh_FXP_MKDIR = 14 - ssh_FXP_RMDIR = 15 - ssh_FXP_REALPATH = 16 - ssh_FXP_STAT = 17 - ssh_FXP_RENAME = 18 - ssh_FXP_READLINK = 19 - ssh_FXP_SYMLINK = 20 - ssh_FXP_STATUS = 101 - ssh_FXP_HANDLE = 102 - ssh_FXP_DATA = 103 - ssh_FXP_NAME = 104 - ssh_FXP_ATTRS = 105 - ssh_FXP_EXTENDED = 200 - ssh_FXP_EXTENDED_REPLY = 201 -) - -const ( - ssh_FX_OK = 0 - ssh_FX_EOF = 1 - ssh_FX_NO_SUCH_FILE = 2 - ssh_FX_PERMISSION_DENIED = 3 - ssh_FX_FAILURE = 4 - ssh_FX_BAD_MESSAGE = 5 - ssh_FX_NO_CONNECTION = 6 - ssh_FX_CONNECTION_LOST = 7 - ssh_FX_OP_UNSUPPORTED = 8 - - // see draft-ietf-secsh-filexfer-13 - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-9.1 - ssh_FX_INVALID_HANDLE = 9 - ssh_FX_NO_SUCH_PATH = 10 - ssh_FX_FILE_ALREADY_EXISTS = 11 - ssh_FX_WRITE_PROTECT = 12 - ssh_FX_NO_MEDIA = 13 - ssh_FX_NO_SPACE_ON_FILESYSTEM = 14 - ssh_FX_QUOTA_EXCEEDED = 15 - ssh_FX_UNKNOWN_PRINCIPAL = 16 - ssh_FX_LOCK_CONFLICT = 17 - ssh_FX_DIR_NOT_EMPTY = 18 - ssh_FX_NOT_A_DIRECTORY = 19 - ssh_FX_INVALID_FILENAME = 20 - ssh_FX_LINK_LOOP = 21 - ssh_FX_CANNOT_DELETE = 22 - ssh_FX_INVALID_PARAMETER = 23 - ssh_FX_FILE_IS_A_DIRECTORY = 24 - ssh_FX_BYTE_RANGE_LOCK_CONFLICT = 25 - ssh_FX_BYTE_RANGE_LOCK_REFUSED = 26 - ssh_FX_DELETE_PENDING = 27 - ssh_FX_FILE_CORRUPT = 28 - ssh_FX_OWNER_INVALID = 29 - ssh_FX_GROUP_INVALID = 30 - ssh_FX_NO_MATCHING_BYTE_RANGE_LOCK = 31 -) - -const ( - ssh_FXF_READ = 0x00000001 - ssh_FXF_WRITE = 0x00000002 - ssh_FXF_APPEND = 0x00000004 - ssh_FXF_CREAT = 0x00000008 - ssh_FXF_TRUNC = 0x00000010 - ssh_FXF_EXCL = 0x00000020 -) - -type fxp uint8 - -func (f fxp) String() string { - switch f { - case ssh_FXP_INIT: - return "SSH_FXP_INIT" - case ssh_FXP_VERSION: - return "SSH_FXP_VERSION" - case ssh_FXP_OPEN: - return "SSH_FXP_OPEN" - case ssh_FXP_CLOSE: - return "SSH_FXP_CLOSE" - case ssh_FXP_READ: - return "SSH_FXP_READ" - case ssh_FXP_WRITE: - return "SSH_FXP_WRITE" - case ssh_FXP_LSTAT: - return "SSH_FXP_LSTAT" - case ssh_FXP_FSTAT: - return "SSH_FXP_FSTAT" - case ssh_FXP_SETSTAT: - return "SSH_FXP_SETSTAT" - case ssh_FXP_FSETSTAT: - return "SSH_FXP_FSETSTAT" - case ssh_FXP_OPENDIR: - return "SSH_FXP_OPENDIR" - case ssh_FXP_READDIR: - return "SSH_FXP_READDIR" - case ssh_FXP_REMOVE: - return "SSH_FXP_REMOVE" - case ssh_FXP_MKDIR: - return "SSH_FXP_MKDIR" - case ssh_FXP_RMDIR: - return "SSH_FXP_RMDIR" - case ssh_FXP_REALPATH: - return "SSH_FXP_REALPATH" - case ssh_FXP_STAT: - return "SSH_FXP_STAT" - case ssh_FXP_RENAME: - return "SSH_FXP_RENAME" - case ssh_FXP_READLINK: - return "SSH_FXP_READLINK" - case ssh_FXP_SYMLINK: - return "SSH_FXP_SYMLINK" - case ssh_FXP_STATUS: - return "SSH_FXP_STATUS" - case ssh_FXP_HANDLE: - return "SSH_FXP_HANDLE" - case ssh_FXP_DATA: - return "SSH_FXP_DATA" - case ssh_FXP_NAME: - return "SSH_FXP_NAME" - case ssh_FXP_ATTRS: - return "SSH_FXP_ATTRS" - case ssh_FXP_EXTENDED: - return "SSH_FXP_EXTENDED" - case ssh_FXP_EXTENDED_REPLY: - return "SSH_FXP_EXTENDED_REPLY" - default: - return "unknown" - } -} - -type fx uint8 - -func (f fx) String() string { - switch f { - case ssh_FX_OK: - return "SSH_FX_OK" - case ssh_FX_EOF: - return "SSH_FX_EOF" - case ssh_FX_NO_SUCH_FILE: - return "SSH_FX_NO_SUCH_FILE" - case ssh_FX_PERMISSION_DENIED: - return "SSH_FX_PERMISSION_DENIED" - case ssh_FX_FAILURE: - return "SSH_FX_FAILURE" - case ssh_FX_BAD_MESSAGE: - return "SSH_FX_BAD_MESSAGE" - case ssh_FX_NO_CONNECTION: - return "SSH_FX_NO_CONNECTION" - case ssh_FX_CONNECTION_LOST: - return "SSH_FX_CONNECTION_LOST" - case ssh_FX_OP_UNSUPPORTED: - return "SSH_FX_OP_UNSUPPORTED" - default: - return "unknown" - } -} - -type unexpectedPacketErr struct { - want, got uint8 -} - -func (u *unexpectedPacketErr) Error() string { - return fmt.Sprintf("sftp: unexpected packet: want %v, got %v", fxp(u.want), fxp(u.got)) -} - -func unimplementedPacketErr(u uint8) error { - return errors.Errorf("sftp: unimplemented packet type: got %v", fxp(u)) -} - -type unexpectedIDErr struct{ want, got uint32 } - -func (u *unexpectedIDErr) Error() string { - return fmt.Sprintf("sftp: unexpected id: want %v, got %v", u.want, u.got) -} - -func unimplementedSeekWhence(whence int) error { - return errors.Errorf("sftp: unimplemented seek whence %v", whence) -} - -func unexpectedCount(want, got uint32) error { - return errors.Errorf("sftp: unexpected count: want %v, got %v", want, got) -} - -type unexpectedVersionErr struct{ want, got uint32 } - -func (u *unexpectedVersionErr) Error() string { - return fmt.Sprintf("sftp: unexpected server version: want %v, got %v", u.want, u.got) -} - -// A StatusError is returned when an SFTP operation fails, and provides -// additional information about the failure. -type StatusError struct { - Code uint32 - msg, lang string -} - -func (s *StatusError) Error() string { return fmt.Sprintf("sftp: %q (%v)", s.msg, fx(s.Code)) } diff --git a/vendor/github.com/pmezard/go-difflib/LICENSE b/vendor/github.com/pmezard/go-difflib/LICENSE new file mode 100644 index 00000000..c67dad61 --- /dev/null +++ b/vendor/github.com/pmezard/go-difflib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/pmezard/go-difflib/difflib/difflib.go new file mode 100644 index 00000000..003e99fa --- /dev/null +++ b/vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -0,0 +1,772 @@ +// Package difflib is a partial port of Python difflib module. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// The following class and functions have been ported: +// +// - SequenceMatcher +// +// - unified_diff +// +// - context_diff +// +// Getting unified diffs was the main goal of the port. Keep in mind this code +// is mostly suitable to output text differences in a human friendly way, there +// are no guarantees generated diffs are consumable by patch(1). +package difflib + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func calculateRatio(matches, length int) float64 { + if length > 0 { + return 2.0 * float64(matches) / float64(length) + } + return 1.0 +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "

" lines in HTML files). That may be +// because this is the only method of the 3 that has a *concept* of +// "junk" . +// +// Timing: Basic R-O is cubic time worst case and quadratic time expected +// case. SequenceMatcher is quadratic time for the worst case and has +// expected-case behavior dependent in a complicated way on how many +// elements the sequences have in common; best case time is linear. +type SequenceMatcher struct { + a []string + b []string + b2j map[string][]int + IsJunk func(string) bool + autoJunk bool + bJunk map[string]struct{} + matchingBlocks []Match + fullBCount map[string]int + bPopular map[string]struct{} + opCodes []OpCode +} + +func NewMatcher(a, b []string) *SequenceMatcher { + m := SequenceMatcher{autoJunk: true} + m.SetSeqs(a, b) + return &m +} + +func NewMatcherWithJunk(a, b []string, autoJunk bool, + isJunk func(string) bool) *SequenceMatcher { + + m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} + m.SetSeqs(a, b) + return &m +} + +// Set two sequences to be compared. +func (m *SequenceMatcher) SetSeqs(a, b []string) { + m.SetSeq1(a) + m.SetSeq2(b) +} + +// Set the first sequence to be compared. The second sequence to be compared is +// not changed. +// +// SequenceMatcher computes and caches detailed information about the second +// sequence, so if you want to compare one sequence S against many sequences, +// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other +// sequences. +// +// See also SetSeqs() and SetSeq2(). +func (m *SequenceMatcher) SetSeq1(a []string) { + if &a == &m.a { + return + } + m.a = a + m.matchingBlocks = nil + m.opCodes = nil +} + +// Set the second sequence to be compared. The first sequence to be compared is +// not changed. +func (m *SequenceMatcher) SetSeq2(b []string) { + if &b == &m.b { + return + } + m.b = b + m.matchingBlocks = nil + m.opCodes = nil + m.fullBCount = nil + m.chainB() +} + +func (m *SequenceMatcher) chainB() { + // Populate line -> index mapping + b2j := map[string][]int{} + for i, s := range m.b { + indices := b2j[s] + indices = append(indices, i) + b2j[s] = indices + } + + // Purge junk elements + m.bJunk = map[string]struct{}{} + if m.IsJunk != nil { + junk := m.bJunk + for s, _ := range b2j { + if m.IsJunk(s) { + junk[s] = struct{}{} + } + } + for s, _ := range junk { + delete(b2j, s) + } + } + + // Purge remaining popular elements + popular := map[string]struct{}{} + n := len(m.b) + if m.autoJunk && n >= 200 { + ntest := n/100 + 1 + for s, indices := range b2j { + if len(indices) > ntest { + popular[s] = struct{}{} + } + } + for s, _ := range popular { + delete(b2j, s) + } + } + m.bPopular = popular + m.b2j = b2j +} + +func (m *SequenceMatcher) isBJunk(s string) bool { + _, ok := m.bJunk[s] + return ok +} + +// Find longest matching block in a[alo:ahi] and b[blo:bhi]. +// +// If IsJunk is not defined: +// +// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where +// alo <= i <= i+k <= ahi +// blo <= j <= j+k <= bhi +// and for all (i',j',k') meeting those conditions, +// k >= k' +// i <= i' +// and if i == i', j <= j' +// +// In other words, of all maximal matching blocks, return one that +// starts earliest in a, and of all those maximal matching blocks that +// start earliest in a, return the one that starts earliest in b. +// +// If IsJunk is defined, first the longest matching block is +// determined as above, but with the additional restriction that no +// junk element appears in the block. Then that block is extended as +// far as possible by matching (only) junk elements on both sides. So +// the resulting block never matches on junk except as identical junk +// happens to be adjacent to an "interesting" match. +// +// If no blocks match, return (alo, blo, 0). +func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { + // CAUTION: stripping common prefix or suffix would be incorrect. + // E.g., + // ab + // acab + // Longest matching block is "ab", but if common prefix is + // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so + // strip, so ends up claiming that ab is changed to acab by + // inserting "ca" in the middle. That's minimal but unintuitive: + // "it's obvious" that someone inserted "ac" at the front. + // Windiff ends up at the same place as diff, but by pairing up + // the unique 'b's and then matching the first two 'a's. + besti, bestj, bestsize := alo, blo, 0 + + // find longest junk-free match + // during an iteration of the loop, j2len[j] = length of longest + // junk-free match ending with a[i-1] and b[j] + j2len := map[int]int{} + for i := alo; i != ahi; i++ { + // look at all instances of a[i] in b; note that because + // b2j has no junk keys, the loop is skipped if a[i] is junk + newj2len := map[int]int{} + for _, j := range m.b2j[m.a[i]] { + // a[i] matches b[j] + if j < blo { + continue + } + if j >= bhi { + break + } + k := j2len[j-1] + 1 + newj2len[j] = k + if k > bestsize { + besti, bestj, bestsize = i-k+1, j-k+1, k + } + } + j2len = newj2len + } + + // Extend the best by non-junk elements on each end. In particular, + // "popular" non-junk elements aren't in b2j, which greatly speeds + // the inner loop above, but also means "the best" match so far + // doesn't contain any junk *or* popular non-junk elements. + for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + !m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + // Now that we have a wholly interesting match (albeit possibly + // empty!), we may as well suck up the matching junk on each + // side of it too. Can't think of a good reason not to, and it + // saves post-processing the (possibly considerable) expense of + // figuring out what to do with it. In the case of an empty + // interesting match, this is clearly the right thing to do, + // because no other kind of match is possible in the regions. + for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && + m.a[besti-1] == m.b[bestj-1] { + besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 + } + for besti+bestsize < ahi && bestj+bestsize < bhi && + m.isBJunk(m.b[bestj+bestsize]) && + m.a[besti+bestsize] == m.b[bestj+bestsize] { + bestsize += 1 + } + + return Match{A: besti, B: bestj, Size: bestsize} +} + +// Return list of triples describing matching subsequences. +// +// Each triple is of the form (i, j, n), and means that +// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in +// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are +// adjacent triples in the list, and the second is not the last triple in the +// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe +// adjacent equal blocks. +// +// The last triple is a dummy, (len(a), len(b), 0), and is the only +// triple with n==0. +func (m *SequenceMatcher) GetMatchingBlocks() []Match { + if m.matchingBlocks != nil { + return m.matchingBlocks + } + + var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match + matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { + match := m.findLongestMatch(alo, ahi, blo, bhi) + i, j, k := match.A, match.B, match.Size + if match.Size > 0 { + if alo < i && blo < j { + matched = matchBlocks(alo, i, blo, j, matched) + } + matched = append(matched, match) + if i+k < ahi && j+k < bhi { + matched = matchBlocks(i+k, ahi, j+k, bhi, matched) + } + } + return matched + } + matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) + + // It's possible that we have adjacent equal blocks in the + // matching_blocks list now. + nonAdjacent := []Match{} + i1, j1, k1 := 0, 0, 0 + for _, b := range matched { + // Is this block adjacent to i1, j1, k1? + i2, j2, k2 := b.A, b.B, b.Size + if i1+k1 == i2 && j1+k1 == j2 { + // Yes, so collapse them -- this just increases the length of + // the first block by the length of the second, and the first + // block so lengthened remains the block to compare against. + k1 += k2 + } else { + // Not adjacent. Remember the first block (k1==0 means it's + // the dummy we started with), and make the second block the + // new block to compare against. + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + i1, j1, k1 = i2, j2, k2 + } + } + if k1 > 0 { + nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) + } + + nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) + m.matchingBlocks = nonAdjacent + return m.matchingBlocks +} + +// Return list of 5-tuples describing how to turn a into b. +// +// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple +// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the +// tuple preceding it, and likewise for j1 == the previous j2. +// +// The tags are characters, with these meanings: +// +// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] +// +// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. +// +// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. +// +// 'e' (equal): a[i1:i2] == b[j1:j2] +func (m *SequenceMatcher) GetOpCodes() []OpCode { + if m.opCodes != nil { + return m.opCodes + } + i, j := 0, 0 + matching := m.GetMatchingBlocks() + opCodes := make([]OpCode, 0, len(matching)) + for _, m := range matching { + // invariant: we've pumped out correct diffs to change + // a[:i] into b[:j], and the next matching block is + // a[ai:ai+size] == b[bj:bj+size]. So we need to pump + // out a diff to change a[i:ai] into b[j:bj], pump out + // the matching block, and move (i,j) beyond the match + ai, bj, size := m.A, m.B, m.Size + tag := byte(0) + if i < ai && j < bj { + tag = 'r' + } else if i < ai { + tag = 'd' + } else if j < bj { + tag = 'i' + } + if tag > 0 { + opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) + } + i, j = ai+size, bj+size + // the list of matching blocks is terminated by a + // sentinel with size 0 + if size > 0 { + opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) + } + } + m.opCodes = opCodes + return m.opCodes +} + +// Isolate change clusters by eliminating ranges with no changes. +// +// Return a generator of groups with up to n lines of context. +// Each group is in the same format as returned by GetOpCodes(). +func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { + if n < 0 { + n = 3 + } + codes := m.GetOpCodes() + if len(codes) == 0 { + codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} + } + // Fixup leading and trailing groups if they show no changes. + if codes[0].Tag == 'e' { + c := codes[0] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} + } + if codes[len(codes)-1].Tag == 'e' { + c := codes[len(codes)-1] + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} + } + nn := n + n + groups := [][]OpCode{} + group := []OpCode{} + for _, c := range codes { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + // End the current group and start a new one whenever + // there is a large range with no changes. + if c.Tag == 'e' && i2-i1 > nn { + group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), + j1, min(j2, j1+n)}) + groups = append(groups, group) + group = []OpCode{} + i1, j1 = max(i1, i2-n), max(j1, j2-n) + } + group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) + } + if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { + groups = append(groups, group) + } + return groups +} + +// Return a measure of the sequences' similarity (float in [0,1]). +// +// Where T is the total number of elements in both sequences, and +// M is the number of matches, this is 2.0*M / T. +// Note that this is 1 if the sequences are identical, and 0 if +// they have nothing in common. +// +// .Ratio() is expensive to compute if you haven't already computed +// .GetMatchingBlocks() or .GetOpCodes(), in which case you may +// want to try .QuickRatio() or .RealQuickRation() first to get an +// upper bound. +func (m *SequenceMatcher) Ratio() float64 { + matches := 0 + for _, m := range m.GetMatchingBlocks() { + matches += m.Size + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() relatively quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute. +func (m *SequenceMatcher) QuickRatio() float64 { + // viewing a and b as multisets, set matches to the cardinality + // of their intersection; this counts the number of matches + // without regard to order, so is clearly an upper bound + if m.fullBCount == nil { + m.fullBCount = map[string]int{} + for _, s := range m.b { + m.fullBCount[s] = m.fullBCount[s] + 1 + } + } + + // avail[x] is the number of times x appears in 'b' less the + // number of times we've seen it in 'a' so far ... kinda + avail := map[string]int{} + matches := 0 + for _, s := range m.a { + n, ok := avail[s] + if !ok { + n = m.fullBCount[s] + } + avail[s] = n - 1 + if n > 0 { + matches += 1 + } + } + return calculateRatio(matches, len(m.a)+len(m.b)) +} + +// Return an upper bound on ratio() very quickly. +// +// This isn't defined beyond that it is an upper bound on .Ratio(), and +// is faster to compute than either .Ratio() or .QuickRatio(). +func (m *SequenceMatcher) RealQuickRatio() float64 { + la, lb := len(m.a), len(m.b) + return calculateRatio(min(la, lb), la+lb) +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +// Unified diff parameters +type UnifiedDiff struct { + A []string // First sequence lines + FromFile string // First file name + FromDate string // First file time + B []string // Second sequence lines + ToFile string // Second file name + ToDate string // Second file time + Eol string // Headers end of line, defaults to LF + Context int // Number of context lines +} + +// Compare two sequences of lines; generate the delta as a unified diff. +// +// Unified diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by 'n' which +// defaults to three. +// +// By default, the diff control lines (those with ---, +++, or @@) are +// created with a trailing newline. This is helpful so that inputs +// created from file.readlines() result in diffs that are suitable for +// file.writelines() since both the inputs and outputs have trailing +// newlines. +// +// For inputs that do not have trailing newlines, set the lineterm +// argument to "" so that the output will be uniformly newline free. +// +// The unidiff format normally has a header for filenames and modification +// times. Any or all of these may be specified using strings for +// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. +// The modification times are normally expressed in the ISO 8601 format. +func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + wf := func(format string, args ...interface{}) error { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + return err + } + ws := func(s string) error { + _, err := buf.WriteString(s) + return err + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + if diff.FromFile != "" || diff.ToFile != "" { + err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } + } + } + first, last := g[0], g[len(g)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + return err + } + for _, c := range g { + i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 + if c.Tag == 'e' { + for _, line := range diff.A[i1:i2] { + if err := ws(" " + line); err != nil { + return err + } + } + continue + } + if c.Tag == 'r' || c.Tag == 'd' { + for _, line := range diff.A[i1:i2] { + if err := ws("-" + line); err != nil { + return err + } + } + } + if c.Tag == 'r' || c.Tag == 'i' { + for _, line := range diff.B[j1:j2] { + if err := ws("+" + line); err != nil { + return err + } + } + } + } + } + return nil +} + +// Like WriteUnifiedDiff but returns the diff a string. +func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteUnifiedDiff(w, diff) + return string(w.Bytes()), err +} + +// Convert range to the "ed" format. +func formatRangeContext(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 0 { + beginning -= 1 // empty ranges begin at line just before the range + } + if length <= 1 { + return fmt.Sprintf("%d", beginning) + } + return fmt.Sprintf("%d,%d", beginning, beginning+length-1) +} + +type ContextDiff UnifiedDiff + +// Compare two sequences of lines; generate the delta as a context diff. +// +// Context diffs are a compact way of showing line changes and a few +// lines of context. The number of context lines is set by diff.Context +// which defaults to three. +// +// By default, the diff control lines (those with *** or ---) are +// created with a trailing newline. +// +// For inputs that do not have trailing newlines, set the diff.Eol +// argument to "" so that the output will be uniformly newline free. +// +// The context diff format normally has a header for filenames and +// modification times. Any or all of these may be specified using +// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. +// The modification times are normally expressed in the ISO 8601 format. +// If not specified, the strings default to blanks. +func WriteContextDiff(writer io.Writer, diff ContextDiff) error { + buf := bufio.NewWriter(writer) + defer buf.Flush() + var diffErr error + wf := func(format string, args ...interface{}) { + _, err := buf.WriteString(fmt.Sprintf(format, args...)) + if diffErr == nil && err != nil { + diffErr = err + } + } + ws := func(s string) { + _, err := buf.WriteString(s) + if diffErr == nil && err != nil { + diffErr = err + } + } + + if len(diff.Eol) == 0 { + diff.Eol = "\n" + } + + prefix := map[byte]string{ + 'i': "+ ", + 'd': "- ", + 'r': "! ", + 'e': " ", + } + + started := false + m := NewMatcher(diff.A, diff.B) + for _, g := range m.GetGroupedOpCodes(diff.Context) { + if !started { + started = true + fromDate := "" + if len(diff.FromDate) > 0 { + fromDate = "\t" + diff.FromDate + } + toDate := "" + if len(diff.ToDate) > 0 { + toDate = "\t" + diff.ToDate + } + if diff.FromFile != "" || diff.ToFile != "" { + wf("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) + wf("--- %s%s%s", diff.ToFile, toDate, diff.Eol) + } + } + + first, last := g[0], g[len(g)-1] + ws("***************" + diff.Eol) + + range1 := formatRangeContext(first.I1, last.I2) + wf("*** %s ****%s", range1, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'd' { + for _, cc := range g { + if cc.Tag == 'i' { + continue + } + for _, line := range diff.A[cc.I1:cc.I2] { + ws(prefix[cc.Tag] + line) + } + } + break + } + } + + range2 := formatRangeContext(first.J1, last.J2) + wf("--- %s ----%s", range2, diff.Eol) + for _, c := range g { + if c.Tag == 'r' || c.Tag == 'i' { + for _, cc := range g { + if cc.Tag == 'd' { + continue + } + for _, line := range diff.B[cc.J1:cc.J2] { + ws(prefix[cc.Tag] + line) + } + } + break + } + } + } + return diffErr +} + +// Like WriteContextDiff but returns the diff a string. +func GetContextDiffString(diff ContextDiff) (string, error) { + w := &bytes.Buffer{} + err := WriteContextDiff(w, diff) + return string(w.Bytes()), err +} + +// Split a string on "\n" while preserving them. The output can be used +// as input for UnifiedDiff and ContextDiff structures. +func SplitLines(s string) []string { + lines := strings.SplitAfter(s, "\n") + lines[len(lines)-1] += "\n" + return lines +} diff --git a/vendor/github.com/rs/xid/.appveyor.yml b/vendor/github.com/rs/xid/.appveyor.yml new file mode 100644 index 00000000..c73bb33b --- /dev/null +++ b/vendor/github.com/rs/xid/.appveyor.yml @@ -0,0 +1,27 @@ +version: 1.0.0.{build} + +platform: x64 + +branches: + only: + - master + +clone_folder: c:\gopath\src\github.com\rs\xid + +environment: + GOPATH: c:\gopath + +install: + - echo %PATH% + - echo %GOPATH% + - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - go version + - go env + - go get -t . + +build_script: + - go build + +test_script: + - go test + diff --git a/vendor/github.com/rs/xid/.travis.yml b/vendor/github.com/rs/xid/.travis.yml new file mode 100644 index 00000000..b37da159 --- /dev/null +++ b/vendor/github.com/rs/xid/.travis.yml @@ -0,0 +1,8 @@ +language: go +go: +- "1.9" +- "1.10" +- "master" +matrix: + allow_failures: + - go: "master" diff --git a/vendor/github.com/rs/xid/README.md b/vendor/github.com/rs/xid/README.md new file mode 100644 index 00000000..1f886fd7 --- /dev/null +++ b/vendor/github.com/rs/xid/README.md @@ -0,0 +1,112 @@ +# Globally Unique ID Generator + +[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/rs/xid) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/rs/xid/master/LICENSE) [![Build Status](https://travis-ci.org/rs/xid.svg?branch=master)](https://travis-ci.org/rs/xid) [![Coverage](http://gocover.io/_badge/github.com/rs/xid)](http://gocover.io/github.com/rs/xid) + +Package xid is a globally unique id generator library, ready to be used safely directly in your server code. + +Xid is using Mongo Object ID algorithm to generate globally unique ids with a different serialization (base64) to make it shorter when transported as a string: +https://docs.mongodb.org/manual/reference/object-id/ + +- 4-byte value representing the seconds since the Unix epoch, +- 3-byte machine identifier, +- 2-byte process id, and +- 3-byte counter, starting with a random value. + +The binary representation of the id is compatible with Mongo 12 bytes Object IDs. +The string representation is using base32 hex (w/o padding) for better space efficiency +when stored in that form (20 bytes). The hex variant of base32 is used to retain the +sortable property of the id. + +Xid doesn't use base64 because case sensitivity and the 2 non alphanum chars may be an +issue when transported as a string between various systems. Base36 wasn't retained either +because 1/ it's not standard 2/ the resulting size is not predictable (not bit aligned) +and 3/ it would not remain sortable. To validate a base32 `xid`, expect a 20 chars long, +all lowercase sequence of `a` to `v` letters and `0` to `9` numbers (`[0-9a-v]{20}`). + +UUIDs are 16 bytes (128 bits) and 36 chars as string representation. Twitter Snowflake +ids are 8 bytes (64 bits) but require machine/data-center configuration and/or central +generator servers. xid stands in between with 12 bytes (96 bits) and a more compact +URL-safe string representation (20 chars). No configuration or central generator server +is required so it can be used directly in server's code. + +| Name | Binary Size | String Size | Features +|-------------|-------------|----------------|---------------- +| [UUID] | 16 bytes | 36 chars | configuration free, not sortable +| [shortuuid] | 16 bytes | 22 chars | configuration free, not sortable +| [Snowflake] | 8 bytes | up to 20 chars | needs machin/DC configuration, needs central server, sortable +| [MongoID] | 12 bytes | 24 chars | configuration free, sortable +| xid | 12 bytes | 20 chars | configuration free, sortable + +[UUID]: https://en.wikipedia.org/wiki/Universally_unique_identifier +[shortuuid]: https://github.com/stochastic-technologies/shortuuid +[Snowflake]: https://blog.twitter.com/2010/announcing-snowflake +[MongoID]: https://docs.mongodb.org/manual/reference/object-id/ + +Features: + +- Size: 12 bytes (96 bits), smaller than UUID, larger than snowflake +- Base32 hex encoded by default (20 chars when transported as printable string, still sortable) +- Non configured, you don't need set a unique machine and/or data center id +- K-ordered +- Embedded time with 1 second precision +- Unicity guaranteed for 16,777,216 (24 bits) unique ids per second and per host/process +- Lock-free (i.e.: unlike UUIDv1 and v2) + +Best used with [zerolog](https://github.com/rs/zerolog)'s +[RequestIDHandler](https://godoc.org/github.com/rs/zerolog/hlog#RequestIDHandler). + +Notes: + +- Xid is dependent on the system time, a monotonic counter and so is not cryptographically secure. If unpredictability of IDs is important, you should not use Xids. It is worth noting that most of the other UUID like implementations are also not cryptographically secure. You shoud use libraries that rely on cryptographically secure sources (like /dev/urandom on unix, crypto/rand in golang), if you want a truly random ID generator. + +References: + +- http://www.slideshare.net/davegardnerisme/unique-id-generation-in-distributed-systems +- https://en.wikipedia.org/wiki/Universally_unique_identifier +- https://blog.twitter.com/2010/announcing-snowflake +- Python port by [Graham Abbott](https://github.com/graham): https://github.com/graham/python_xid +- Scala port by [Egor Kolotaev](https://github.com/kolotaev): https://github.com/kolotaev/ride + +## Install + + go get github.com/rs/xid + +## Usage + +```go +guid := xid.New() + +println(guid.String()) +// Output: 9m4e2mr0ui3e8a215n4g +``` + +Get `xid` embedded info: + +```go +guid.Machine() +guid.Pid() +guid.Time() +guid.Counter() +``` + +## Benchmark + +Benchmark against Go [Maxim Bublis](https://github.com/satori)'s [UUID](https://github.com/satori/go.uuid). + +``` +BenchmarkXID 20000000 91.1 ns/op 32 B/op 1 allocs/op +BenchmarkXID-2 20000000 55.9 ns/op 32 B/op 1 allocs/op +BenchmarkXID-4 50000000 32.3 ns/op 32 B/op 1 allocs/op +BenchmarkUUIDv1 10000000 204 ns/op 48 B/op 1 allocs/op +BenchmarkUUIDv1-2 10000000 160 ns/op 48 B/op 1 allocs/op +BenchmarkUUIDv1-4 10000000 195 ns/op 48 B/op 1 allocs/op +BenchmarkUUIDv4 1000000 1503 ns/op 64 B/op 2 allocs/op +BenchmarkUUIDv4-2 1000000 1427 ns/op 64 B/op 2 allocs/op +BenchmarkUUIDv4-4 1000000 1452 ns/op 64 B/op 2 allocs/op +``` + +Note: UUIDv1 requires a global lock, hence the performence degrading as we add more CPUs. + +## Licenses + +All source code is licensed under the [MIT License](https://raw.github.com/rs/xid/master/LICENSE). diff --git a/vendor/github.com/rs/xid/go.mod b/vendor/github.com/rs/xid/go.mod new file mode 100644 index 00000000..95b83386 --- /dev/null +++ b/vendor/github.com/rs/xid/go.mod @@ -0,0 +1 @@ +module github.com/rs/xid diff --git a/vendor/github.com/russross/blackfriday/.gitignore b/vendor/github.com/russross/blackfriday/.gitignore new file mode 100644 index 00000000..75623dcc --- /dev/null +++ b/vendor/github.com/russross/blackfriday/.gitignore @@ -0,0 +1,8 @@ +*.out +*.swp +*.8 +*.6 +_obj +_test* +markdown +tags diff --git a/vendor/github.com/russross/blackfriday/.travis.yml b/vendor/github.com/russross/blackfriday/.travis.yml new file mode 100644 index 00000000..a1687f17 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/.travis.yml @@ -0,0 +1,30 @@ +sudo: false +language: go +go: + - 1.5.4 + - 1.6.2 + - tip +matrix: + include: + - go: 1.2.2 + script: + - go get -t -v ./... + - go test -v -race ./... + - go: 1.3.3 + script: + - go get -t -v ./... + - go test -v -race ./... + - go: 1.4.3 + script: + - go get -t -v ./... + - go test -v -race ./... + allow_failures: + - go: tip + fast_finish: true +install: + - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d -s .) + - go tool vet . + - go test -v -race ./... diff --git a/vendor/github.com/russross/blackfriday/README.md b/vendor/github.com/russross/blackfriday/README.md new file mode 100644 index 00000000..a6c94b79 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/README.md @@ -0,0 +1,363 @@ +Blackfriday +[![Build Status][BuildSVG]][BuildURL] +[![Godoc][GodocV2SVG]][GodocV2URL] +=========== + +Blackfriday is a [Markdown][1] processor implemented in [Go][2]. It +is paranoid about its input (so you can safely feed it user-supplied +data), it is fast, it supports common extensions (tables, smart +punctuation substitutions, etc.), and it is safe for all utf-8 +(unicode) input. + +HTML output is currently supported, along with Smartypants +extensions. + +It started as a translation from C of [Sundown][3]. + + +Installation +------------ + +Blackfriday is compatible with any modern Go release. With Go and git installed: + + go get -u gopkg.in/russross/blackfriday.v2 + +will download, compile, and install the package into your `$GOPATH` directory +hierarchy. + + +Versions +-------- + +Currently maintained and recommended version of Blackfriday is `v2`. It's being +developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the +documentation is available at +https://godoc.org/gopkg.in/russross/blackfriday.v2. + +It is `go get`-able via via [gopkg.in][6] at `gopkg.in/russross/blackfriday.v2`, +but we highly recommend using package management tool like [dep][7] or +[Glide][8] and make use of semantic versioning. With package management you +should import `github.com/russross/blackfriday` and specify that you're using +version 2.0.0. + +Version 2 offers a number of improvements over v1: + +* Cleaned up API +* A separate call to [`Parse`][4], which produces an abstract syntax tree for + the document +* Latest bug fixes +* Flexibility to easily add your own rendering extensions + +Potential drawbacks: + +* Our benchmarks show v2 to be slightly slower than v1. Currently in the + ballpark of around 15%. +* API breakage. If you can't afford modifying your code to adhere to the new API + and don't care too much about the new features, v2 is probably not for you. +* Several bug fixes are trailing behind and still need to be forward-ported to + v2. See issue [#348](https://github.com/russross/blackfriday/issues/348) for + tracking. + +If you are still interested in the legacy `v1`, you can import it from +`github.com/russross/blackfriday`. Documentation for the legacy v1 can be found +here: https://godoc.org/github.com/russross/blackfriday + +### Known issue with `dep` + +There is a known problem with using Blackfriday v1 _transitively_ and `dep`. +Currently `dep` prioritizes semver versions over anything else, and picks the +latest one, plus it does not apply a `[[constraint]]` specifier to transitively +pulled in packages. So if you're using something that uses Blackfriday v1, but +that something does not use `dep` yet, you will get Blackfriday v2 pulled in and +your first dependency will fail to build. + +There are couple of fixes for it, documented here: +https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version + +Meanwhile, `dep` team is working on a more general solution to the constraints +on transitive dependencies problem: https://github.com/golang/dep/issues/1124. + + +Usage +----- + +### v1 + +For basic usage, it is as simple as getting your input into a byte +slice and calling: + + output := blackfriday.MarkdownBasic(input) + +This renders it with no extensions enabled. To get a more useful +feature set, use this instead: + + output := blackfriday.MarkdownCommon(input) + +### v2 + +For the most sensible markdown processing, it is as simple as getting your input +into a byte slice and calling: + +```go +output := blackfriday.Run(input) +``` + +Your input will be parsed and the output rendered with a set of most popular +extensions enabled. If you want the most basic feature set, corresponding with +the bare Markdown specification, use: + +```go +output := blackfriday.Run(input, blackfriday.WithNoExtensions()) +``` + +### Sanitize untrusted content + +Blackfriday itself does nothing to protect against malicious content. If you are +dealing with user-supplied markdown, we recommend running Blackfriday's output +through HTML sanitizer such as [Bluemonday][5]. + +Here's an example of simple usage of Blackfriday together with Bluemonday: + +```go +import ( + "github.com/microcosm-cc/bluemonday" + "gopkg.in/russross/blackfriday.v2" +) + +// ... +unsafe := blackfriday.Run(input) +html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) +``` + +### Custom options, v1 + +If you want to customize the set of options, first get a renderer +(currently only the HTML output engine), then use it to +call the more general `Markdown` function. For examples, see the +implementations of `MarkdownBasic` and `MarkdownCommon` in +`markdown.go`. + +### Custom options, v2 + +If you want to customize the set of options, use `blackfriday.WithExtensions`, +`blackfriday.WithRenderer` and `blackfriday.WithRefOverride`. + +### `blackfriday-tool` + +You can also check out `blackfriday-tool` for a more complete example +of how to use it. Download and install it using: + + go get github.com/russross/blackfriday-tool + +This is a simple command-line tool that allows you to process a +markdown file using a standalone program. You can also browse the +source directly on github if you are just looking for some example +code: + +* + +Note that if you have not already done so, installing +`blackfriday-tool` will be sufficient to download and install +blackfriday in addition to the tool itself. The tool binary will be +installed in `$GOPATH/bin`. This is a statically-linked binary that +can be copied to wherever you need it without worrying about +dependencies and library versions. + +### Sanitized anchor names + +Blackfriday includes an algorithm for creating sanitized anchor names +corresponding to a given input text. This algorithm is used to create +anchors for headings when `EXTENSION_AUTO_HEADER_IDS` is enabled. The +algorithm has a specification, so that other packages can create +compatible anchor names and links to those anchors. + +The specification is located at https://godoc.org/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names. + +[`SanitizedAnchorName`](https://godoc.org/github.com/russross/blackfriday#SanitizedAnchorName) exposes this functionality, and can be used to +create compatible links to the anchor names generated by blackfriday. +This algorithm is also implemented in a small standalone package at +[`github.com/shurcooL/sanitized_anchor_name`](https://godoc.org/github.com/shurcooL/sanitized_anchor_name). It can be useful for clients +that want a small package and don't need full functionality of blackfriday. + + +Features +-------- + +All features of Sundown are supported, including: + +* **Compatibility**. The Markdown v1.0.3 test suite passes with + the `--tidy` option. Without `--tidy`, the differences are + mostly in whitespace and entity escaping, where blackfriday is + more consistent and cleaner. + +* **Common extensions**, including table support, fenced code + blocks, autolinks, strikethroughs, non-strict emphasis, etc. + +* **Safety**. Blackfriday is paranoid when parsing, making it safe + to feed untrusted user input without fear of bad things + happening. The test suite stress tests this and there are no + known inputs that make it crash. If you find one, please let me + know and send me the input that does it. + + NOTE: "safety" in this context means *runtime safety only*. In order to + protect yourself against JavaScript injection in untrusted content, see + [this example](https://github.com/russross/blackfriday#sanitize-untrusted-content). + +* **Fast processing**. It is fast enough to render on-demand in + most web applications without having to cache the output. + +* **Thread safety**. You can run multiple parsers in different + goroutines without ill effect. There is no dependence on global + shared state. + +* **Minimal dependencies**. Blackfriday only depends on standard + library packages in Go. The source code is pretty + self-contained, so it is easy to add to any project, including + Google App Engine projects. + +* **Standards compliant**. Output successfully validates using the + W3C validation tool for HTML 4.01 and XHTML 1.0 Transitional. + + +Extensions +---------- + +In addition to the standard markdown syntax, this package +implements the following extensions: + +* **Intra-word emphasis supression**. The `_` character is + commonly used inside words when discussing code, so having + markdown interpret it as an emphasis command is usually the + wrong thing. Blackfriday lets you treat all emphasis markers as + normal characters when they occur inside a word. + +* **Tables**. Tables can be created by drawing them in the input + using a simple syntax: + + ``` + Name | Age + --------|------ + Bob | 27 + Alice | 23 + ``` + +* **Fenced code blocks**. In addition to the normal 4-space + indentation to mark code blocks, you can explicitly mark them + and supply a language (to make syntax highlighting simple). Just + mark it like this: + + ``` go + func getTrue() bool { + return true + } + ``` + + You can use 3 or more backticks to mark the beginning of the + block, and the same number to mark the end of the block. + + To preserve classes of fenced code blocks while using the bluemonday + HTML sanitizer, use the following policy: + + ``` go + p := bluemonday.UGCPolicy() + p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code") + html := p.SanitizeBytes(unsafe) + ``` + +* **Definition lists**. A simple definition list is made of a single-line + term followed by a colon and the definition for that term. + + Cat + : Fluffy animal everyone likes + + Internet + : Vector of transmission for pictures of cats + + Terms must be separated from the previous definition by a blank line. + +* **Footnotes**. A marker in the text that will become a superscript number; + a footnote definition that will be placed in a list of footnotes at the + end of the document. A footnote looks like this: + + This is a footnote.[^1] + + [^1]: the footnote text. + +* **Autolinking**. Blackfriday can find URLs that have not been + explicitly marked as links and turn them into links. + +* **Strikethrough**. Use two tildes (`~~`) to mark text that + should be crossed out. + +* **Hard line breaks**. With this extension enabled (it is off by + default in the `MarkdownBasic` and `MarkdownCommon` convenience + functions), newlines in the input translate into line breaks in + the output. + +* **Smart quotes**. Smartypants-style punctuation substitution is + supported, turning normal double- and single-quote marks into + curly quotes, etc. + +* **LaTeX-style dash parsing** is an additional option, where `--` + is translated into `–`, and `---` is translated into + `—`. This differs from most smartypants processors, which + turn a single hyphen into an ndash and a double hyphen into an + mdash. + +* **Smart fractions**, where anything that looks like a fraction + is translated into suitable HTML (instead of just a few special + cases like most smartypant processors). For example, `4/5` + becomes `45`, which renders as + 45. + + +Other renderers +--------------- + +Blackfriday is structured to allow alternative rendering engines. Here +are a few of note: + +* [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown): + provides a GitHub Flavored Markdown renderer with fenced code block + highlighting, clickable heading anchor links. + + It's not customizable, and its goal is to produce HTML output + equivalent to the [GitHub Markdown API endpoint](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode), + except the rendering is performed locally. + +* [markdownfmt](https://github.com/shurcooL/markdownfmt): like gofmt, + but for markdown. + +* [LaTeX output](https://bitbucket.org/ambrevar/blackfriday-latex): + renders output as LaTeX. + + +TODO +---- + +* More unit testing +* Improve Unicode support. It does not understand all Unicode + rules (about what constitutes a letter, a punctuation symbol, + etc.), so it may fail to detect word boundaries correctly in + some instances. It is safe on all UTF-8 input. + + +License +------- + +[Blackfriday is distributed under the Simplified BSD License](LICENSE.txt) + + + [1]: https://daringfireball.net/projects/markdown/ "Markdown" + [2]: https://golang.org/ "Go Language" + [3]: https://github.com/vmg/sundown "Sundown" + [4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func" + [5]: https://github.com/microcosm-cc/bluemonday "Bluemonday" + [6]: https://labix.org/gopkg.in "gopkg.in" + [7]: https://github.com/golang/dep/ "dep" + [8]: https://github.com/Masterminds/glide "Glide" + + [BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master + [BuildURL]: https://travis-ci.org/russross/blackfriday + [GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg + [GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2 diff --git a/vendor/github.com/russross/blackfriday/block.go b/vendor/github.com/russross/blackfriday/block.go index 9cf451f0..7fc731d5 100644 --- a/vendor/github.com/russross/blackfriday/block.go +++ b/vendor/github.com/russross/blackfriday/block.go @@ -15,8 +15,7 @@ package blackfriday import ( "bytes" - - "github.com/shurcooL/sanitized_anchor_name" + "unicode" ) // Parse block-level data. @@ -243,7 +242,7 @@ func (p *parser) prefixHeader(out *bytes.Buffer, data []byte) int { } if end > i { if id == "" && p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { - id = sanitized_anchor_name.Create(string(data[i:end])) + id = SanitizedAnchorName(string(data[i:end])) } work := func() bool { p.inline(out, data[i:end]) @@ -1364,7 +1363,7 @@ func (p *parser) paragraph(out *bytes.Buffer, data []byte) int { id := "" if p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { - id = sanitized_anchor_name.Create(string(data[prev:eol])) + id = SanitizedAnchorName(string(data[prev:eol])) } p.r.Header(out, work, level, id) @@ -1428,3 +1427,24 @@ func (p *parser) paragraph(out *bytes.Buffer, data []byte) int { p.renderParagraph(out, data[:i]) return i } + +// SanitizedAnchorName returns a sanitized anchor name for the given text. +// +// It implements the algorithm specified in the package comment. +func SanitizedAnchorName(text string) string { + var anchorName []rune + futureDash := false + for _, r := range text { + switch { + case unicode.IsLetter(r) || unicode.IsNumber(r): + if futureDash && len(anchorName) > 0 { + anchorName = append(anchorName, '-') + } + futureDash = false + anchorName = append(anchorName, unicode.ToLower(r)) + default: + futureDash = true + } + } + return string(anchorName) +} diff --git a/vendor/github.com/russross/blackfriday/doc.go b/vendor/github.com/russross/blackfriday/doc.go new file mode 100644 index 00000000..9656c42a --- /dev/null +++ b/vendor/github.com/russross/blackfriday/doc.go @@ -0,0 +1,32 @@ +// Package blackfriday is a Markdown processor. +// +// It translates plain text with simple formatting rules into HTML or LaTeX. +// +// Sanitized Anchor Names +// +// Blackfriday includes an algorithm for creating sanitized anchor names +// corresponding to a given input text. This algorithm is used to create +// anchors for headings when EXTENSION_AUTO_HEADER_IDS is enabled. The +// algorithm is specified below, so that other packages can create +// compatible anchor names and links to those anchors. +// +// The algorithm iterates over the input text, interpreted as UTF-8, +// one Unicode code point (rune) at a time. All runes that are letters (category L) +// or numbers (category N) are considered valid characters. They are mapped to +// lower case, and included in the output. All other runes are considered +// invalid characters. Invalid characters that preceed the first valid character, +// as well as invalid character that follow the last valid character +// are dropped completely. All other sequences of invalid characters +// between two valid characters are replaced with a single dash character '-'. +// +// SanitizedAnchorName exposes this functionality, and can be used to +// create compatible links to the anchor names generated by blackfriday. +// This algorithm is also implemented in a small standalone package at +// github.com/shurcooL/sanitized_anchor_name. It can be useful for clients +// that want a small package and don't need full functionality of blackfriday. +package blackfriday + +// NOTE: Keep Sanitized Anchor Name algorithm in sync with package +// github.com/shurcooL/sanitized_anchor_name. +// Otherwise, users of sanitized_anchor_name will get anchor names +// that are incompatible with those generated by blackfriday. diff --git a/vendor/github.com/russross/blackfriday/html.go b/vendor/github.com/russross/blackfriday/html.go index 74e67ee8..c917c7d3 100644 --- a/vendor/github.com/russross/blackfriday/html.go +++ b/vendor/github.com/russross/blackfriday/html.go @@ -42,6 +42,7 @@ const ( HTML_SMARTYPANTS_DASHES // enable smart dashes (with HTML_USE_SMARTYPANTS) HTML_SMARTYPANTS_LATEX_DASHES // enable LaTeX-style dashes (with HTML_USE_SMARTYPANTS and HTML_SMARTYPANTS_DASHES) HTML_SMARTYPANTS_ANGLED_QUOTES // enable angled double quotes (with HTML_USE_SMARTYPANTS) for double quotes rendering + HTML_SMARTYPANTS_QUOTES_NBSP // enable "French guillemets" (with HTML_USE_SMARTYPANTS) HTML_FOOTNOTE_RETURN_LINKS // generate a link at the end of a footnote to return to the source ) @@ -619,7 +620,7 @@ func (options *Html) FootnoteRef(out *bytes.Buffer, ref []byte, id int) { out.WriteString(`fnref:`) out.WriteString(options.parameters.FootnoteAnchorPrefix) out.Write(slug) - out.WriteString(`">= 3 { nextChar = text[2] } - if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) { + if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote, false) { return 1 } } @@ -141,7 +152,7 @@ func smartSingleQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byt if len(text) > 1 { nextChar = text[1] } - if smartQuoteHelper(out, previousChar, nextChar, 's', &smrt.inSingleQuote) { + if smartQuoteHelper(out, previousChar, nextChar, 's', &smrt.inSingleQuote, false) { return 0 } @@ -205,13 +216,13 @@ func smartDashLatex(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, return 0 } -func smartAmpVariant(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte, quote byte) int { +func smartAmpVariant(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte, quote byte, addNBSP bool) int { if bytes.HasPrefix(text, []byte(""")) { nextChar := byte(0) if len(text) >= 7 { nextChar = text[6] } - if smartQuoteHelper(out, previousChar, nextChar, quote, &smrt.inDoubleQuote) { + if smartQuoteHelper(out, previousChar, nextChar, quote, &smrt.inDoubleQuote, addNBSP) { return 5 } } @@ -224,12 +235,15 @@ func smartAmpVariant(out *bytes.Buffer, smrt *smartypantsData, previousChar byte return 0 } -func smartAmp(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int { - return smartAmpVariant(out, smrt, previousChar, text, 'd') -} +func smartAmp(angledQuotes, addNBSP bool) func(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int { + var quote byte = 'd' + if angledQuotes { + quote = 'a' + } -func smartAmpAngledQuote(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int { - return smartAmpVariant(out, smrt, previousChar, text, 'a') + return func(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int { + return smartAmpVariant(out, smrt, previousChar, text, quote, addNBSP) + } } func smartPeriod(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, text []byte) int { @@ -253,7 +267,7 @@ func smartBacktick(out *bytes.Buffer, smrt *smartypantsData, previousChar byte, if len(text) >= 3 { nextChar = text[2] } - if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote) { + if smartQuoteHelper(out, previousChar, nextChar, 'd', &smrt.inDoubleQuote, false) { return 1 } } @@ -337,7 +351,7 @@ func smartDoubleQuoteVariant(out *bytes.Buffer, smrt *smartypantsData, previousC if len(text) > 1 { nextChar = text[1] } - if !smartQuoteHelper(out, previousChar, nextChar, quote, &smrt.inDoubleQuote) { + if !smartQuoteHelper(out, previousChar, nextChar, quote, &smrt.inDoubleQuote, false) { out.WriteString(""") } @@ -367,14 +381,30 @@ type smartCallback func(out *bytes.Buffer, smrt *smartypantsData, previousChar b type smartypantsRenderer [256]smartCallback +var ( + smartAmpAngled = smartAmp(true, false) + smartAmpAngledNBSP = smartAmp(true, true) + smartAmpRegular = smartAmp(false, false) + smartAmpRegularNBSP = smartAmp(false, true) +) + func smartypants(flags int) *smartypantsRenderer { r := new(smartypantsRenderer) + addNBSP := flags&HTML_SMARTYPANTS_QUOTES_NBSP != 0 if flags&HTML_SMARTYPANTS_ANGLED_QUOTES == 0 { r['"'] = smartDoubleQuote - r['&'] = smartAmp + if !addNBSP { + r['&'] = smartAmpRegular + } else { + r['&'] = smartAmpRegularNBSP + } } else { r['"'] = smartAngledDoubleQuote - r['&'] = smartAmpAngledQuote + if !addNBSP { + r['&'] = smartAmpAngled + } else { + r['&'] = smartAmpAngledNBSP + } } r['\''] = smartSingleQuote r['('] = smartParens diff --git a/vendor/github.com/saintfish/chardet/AUTHORS b/vendor/github.com/saintfish/chardet/AUTHORS new file mode 100644 index 00000000..842d0216 --- /dev/null +++ b/vendor/github.com/saintfish/chardet/AUTHORS @@ -0,0 +1 @@ +Sheng Yu (yusheng dot sjtu at gmail dot com) diff --git a/vendor/github.com/saintfish/chardet/README.md b/vendor/github.com/saintfish/chardet/README.md new file mode 100644 index 00000000..4281eecc --- /dev/null +++ b/vendor/github.com/saintfish/chardet/README.md @@ -0,0 +1,10 @@ +# chardet + +chardet is library to automatically detect +[charset](http://en.wikipedia.org/wiki/Character_encoding) of texts for [Go +programming language](http://golang.org/). It's based on the algorithm and data +in [ICU](http://icu-project.org/)'s implementation. + +## Documentation and Usage + +See [pkgdoc](http://go.pkgdoc.org/github.com/saintfish/chardet) diff --git a/vendor/github.com/saintfish/chardet/icu-license.html b/vendor/github.com/saintfish/chardet/icu-license.html new file mode 100644 index 00000000..d078d057 --- /dev/null +++ b/vendor/github.com/saintfish/chardet/icu-license.html @@ -0,0 +1,51 @@ + + + + +ICU License - ICU 1.8.1 and later + + + +

ICU License - ICU 1.8.1 and later

+ +

COPYRIGHT AND PERMISSION NOTICE

+ +

+Copyright (c) 1995-2012 International Business Machines Corporation and others +

+

+All rights reserved. +

+

+Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies +of the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. +

+

+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, +OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. +

+

+Except as contained in this notice, the name of a copyright holder shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization of the copyright holder. +

+ +
+

+All trademarks and registered trademarks mentioned herein are the property of their respective owners. +

+ + diff --git a/vendor/github.com/satori/go.uuid/LICENSE b/vendor/github.com/satori/go.uuid/LICENSE deleted file mode 100644 index 488357b8..00000000 --- a/vendor/github.com/satori/go.uuid/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) 2013-2016 by Maxim Bublis - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/satori/go.uuid/uuid.go b/vendor/github.com/satori/go.uuid/uuid.go deleted file mode 100644 index 295f3fc2..00000000 --- a/vendor/github.com/satori/go.uuid/uuid.go +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright (C) 2013-2015 by Maxim Bublis -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -// Package uuid provides implementation of Universally Unique Identifier (UUID). -// Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and -// version 2 (as specified in DCE 1.1). -package uuid - -import ( - "bytes" - "crypto/md5" - "crypto/rand" - "crypto/sha1" - "database/sql/driver" - "encoding/binary" - "encoding/hex" - "fmt" - "hash" - "net" - "os" - "sync" - "time" -) - -// UUID layout variants. -const ( - VariantNCS = iota - VariantRFC4122 - VariantMicrosoft - VariantFuture -) - -// UUID DCE domains. -const ( - DomainPerson = iota - DomainGroup - DomainOrg -) - -// Difference in 100-nanosecond intervals between -// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). -const epochStart = 122192928000000000 - -// Used in string method conversion -const dash byte = '-' - -// UUID v1/v2 storage. -var ( - storageMutex sync.Mutex - storageOnce sync.Once - epochFunc = unixTimeFunc - clockSequence uint16 - lastTime uint64 - hardwareAddr [6]byte - posixUID = uint32(os.Getuid()) - posixGID = uint32(os.Getgid()) -) - -// String parse helpers. -var ( - urnPrefix = []byte("urn:uuid:") - byteGroups = []int{8, 4, 4, 4, 12} -) - -func initClockSequence() { - buf := make([]byte, 2) - safeRandom(buf) - clockSequence = binary.BigEndian.Uint16(buf) -} - -func initHardwareAddr() { - interfaces, err := net.Interfaces() - if err == nil { - for _, iface := range interfaces { - if len(iface.HardwareAddr) >= 6 { - copy(hardwareAddr[:], iface.HardwareAddr) - return - } - } - } - - // Initialize hardwareAddr randomly in case - // of real network interfaces absence - safeRandom(hardwareAddr[:]) - - // Set multicast bit as recommended in RFC 4122 - hardwareAddr[0] |= 0x01 -} - -func initStorage() { - initClockSequence() - initHardwareAddr() -} - -func safeRandom(dest []byte) { - if _, err := rand.Read(dest); err != nil { - panic(err) - } -} - -// Returns difference in 100-nanosecond intervals between -// UUID epoch (October 15, 1582) and current time. -// This is default epoch calculation function. -func unixTimeFunc() uint64 { - return epochStart + uint64(time.Now().UnixNano()/100) -} - -// UUID representation compliant with specification -// described in RFC 4122. -type UUID [16]byte - -// NullUUID can be used with the standard sql package to represent a -// UUID value that can be NULL in the database -type NullUUID struct { - UUID UUID - Valid bool -} - -// The nil UUID is special form of UUID that is specified to have all -// 128 bits set to zero. -var Nil = UUID{} - -// Predefined namespace UUIDs. -var ( - NamespaceDNS, _ = FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - NamespaceURL, _ = FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8") - NamespaceOID, _ = FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8") - NamespaceX500, _ = FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8") -) - -// And returns result of binary AND of two UUIDs. -func And(u1 UUID, u2 UUID) UUID { - u := UUID{} - for i := 0; i < 16; i++ { - u[i] = u1[i] & u2[i] - } - return u -} - -// Or returns result of binary OR of two UUIDs. -func Or(u1 UUID, u2 UUID) UUID { - u := UUID{} - for i := 0; i < 16; i++ { - u[i] = u1[i] | u2[i] - } - return u -} - -// Equal returns true if u1 and u2 equals, otherwise returns false. -func Equal(u1 UUID, u2 UUID) bool { - return bytes.Equal(u1[:], u2[:]) -} - -// Version returns algorithm version used to generate UUID. -func (u UUID) Version() uint { - return uint(u[6] >> 4) -} - -// Variant returns UUID layout variant. -func (u UUID) Variant() uint { - switch { - case (u[8] & 0x80) == 0x00: - return VariantNCS - case (u[8]&0xc0)|0x80 == 0x80: - return VariantRFC4122 - case (u[8]&0xe0)|0xc0 == 0xc0: - return VariantMicrosoft - } - return VariantFuture -} - -// Bytes returns bytes slice representation of UUID. -func (u UUID) Bytes() []byte { - return u[:] -} - -// Returns canonical string representation of UUID: -// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. -func (u UUID) String() string { - buf := make([]byte, 36) - - hex.Encode(buf[0:8], u[0:4]) - buf[8] = dash - hex.Encode(buf[9:13], u[4:6]) - buf[13] = dash - hex.Encode(buf[14:18], u[6:8]) - buf[18] = dash - hex.Encode(buf[19:23], u[8:10]) - buf[23] = dash - hex.Encode(buf[24:], u[10:]) - - return string(buf) -} - -// SetVersion sets version bits. -func (u *UUID) SetVersion(v byte) { - u[6] = (u[6] & 0x0f) | (v << 4) -} - -// SetVariant sets variant bits as described in RFC 4122. -func (u *UUID) SetVariant() { - u[8] = (u[8] & 0xbf) | 0x80 -} - -// MarshalText implements the encoding.TextMarshaler interface. -// The encoding is the same as returned by String. -func (u UUID) MarshalText() (text []byte, err error) { - text = []byte(u.String()) - return -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -// Following formats are supported: -// "6ba7b810-9dad-11d1-80b4-00c04fd430c8", -// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", -// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" -func (u *UUID) UnmarshalText(text []byte) (err error) { - if len(text) < 32 { - err = fmt.Errorf("uuid: UUID string too short: %s", text) - return - } - - t := text[:] - braced := false - - if bytes.Equal(t[:9], urnPrefix) { - t = t[9:] - } else if t[0] == '{' { - braced = true - t = t[1:] - } - - b := u[:] - - for i, byteGroup := range byteGroups { - if i > 0 { - if t[0] != '-' { - err = fmt.Errorf("uuid: invalid string format") - return - } - t = t[1:] - } - - if len(t) < byteGroup { - err = fmt.Errorf("uuid: UUID string too short: %s", text) - return - } - - if i == 4 && len(t) > byteGroup && - ((braced && t[byteGroup] != '}') || len(t[byteGroup:]) > 1 || !braced) { - err = fmt.Errorf("uuid: UUID string too long: %s", text) - return - } - - _, err = hex.Decode(b[:byteGroup/2], t[:byteGroup]) - if err != nil { - return - } - - t = t[byteGroup:] - b = b[byteGroup/2:] - } - - return -} - -// MarshalBinary implements the encoding.BinaryMarshaler interface. -func (u UUID) MarshalBinary() (data []byte, err error) { - data = u.Bytes() - return -} - -// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. -// It will return error if the slice isn't 16 bytes long. -func (u *UUID) UnmarshalBinary(data []byte) (err error) { - if len(data) != 16 { - err = fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data)) - return - } - copy(u[:], data) - - return -} - -// Value implements the driver.Valuer interface. -func (u UUID) Value() (driver.Value, error) { - return u.String(), nil -} - -// Scan implements the sql.Scanner interface. -// A 16-byte slice is handled by UnmarshalBinary, while -// a longer byte slice or a string is handled by UnmarshalText. -func (u *UUID) Scan(src interface{}) error { - switch src := src.(type) { - case []byte: - if len(src) == 16 { - return u.UnmarshalBinary(src) - } - return u.UnmarshalText(src) - - case string: - return u.UnmarshalText([]byte(src)) - } - - return fmt.Errorf("uuid: cannot convert %T to UUID", src) -} - -// Value implements the driver.Valuer interface. -func (u NullUUID) Value() (driver.Value, error) { - if !u.Valid { - return nil, nil - } - // Delegate to UUID Value function - return u.UUID.Value() -} - -// Scan implements the sql.Scanner interface. -func (u *NullUUID) Scan(src interface{}) error { - if src == nil { - u.UUID, u.Valid = Nil, false - return nil - } - - // Delegate to UUID Scan function - u.Valid = true - return u.UUID.Scan(src) -} - -// FromBytes returns UUID converted from raw byte slice input. -// It will return error if the slice isn't 16 bytes long. -func FromBytes(input []byte) (u UUID, err error) { - err = u.UnmarshalBinary(input) - return -} - -// FromBytesOrNil returns UUID converted from raw byte slice input. -// Same behavior as FromBytes, but returns a Nil UUID on error. -func FromBytesOrNil(input []byte) UUID { - uuid, err := FromBytes(input) - if err != nil { - return Nil - } - return uuid -} - -// FromString returns UUID parsed from string input. -// Input is expected in a form accepted by UnmarshalText. -func FromString(input string) (u UUID, err error) { - err = u.UnmarshalText([]byte(input)) - return -} - -// FromStringOrNil returns UUID parsed from string input. -// Same behavior as FromString, but returns a Nil UUID on error. -func FromStringOrNil(input string) UUID { - uuid, err := FromString(input) - if err != nil { - return Nil - } - return uuid -} - -// Returns UUID v1/v2 storage state. -// Returns epoch timestamp, clock sequence, and hardware address. -func getStorage() (uint64, uint16, []byte) { - storageOnce.Do(initStorage) - - storageMutex.Lock() - defer storageMutex.Unlock() - - timeNow := epochFunc() - // Clock changed backwards since last UUID generation. - // Should increase clock sequence. - if timeNow <= lastTime { - clockSequence++ - } - lastTime = timeNow - - return timeNow, clockSequence, hardwareAddr[:] -} - -// NewV1 returns UUID based on current timestamp and MAC address. -func NewV1() UUID { - u := UUID{} - - timeNow, clockSeq, hardwareAddr := getStorage() - - binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) - binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) - binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) - binary.BigEndian.PutUint16(u[8:], clockSeq) - - copy(u[10:], hardwareAddr) - - u.SetVersion(1) - u.SetVariant() - - return u -} - -// NewV2 returns DCE Security UUID based on POSIX UID/GID. -func NewV2(domain byte) UUID { - u := UUID{} - - timeNow, clockSeq, hardwareAddr := getStorage() - - switch domain { - case DomainPerson: - binary.BigEndian.PutUint32(u[0:], posixUID) - case DomainGroup: - binary.BigEndian.PutUint32(u[0:], posixGID) - } - - binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) - binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) - binary.BigEndian.PutUint16(u[8:], clockSeq) - u[9] = domain - - copy(u[10:], hardwareAddr) - - u.SetVersion(2) - u.SetVariant() - - return u -} - -// NewV3 returns UUID based on MD5 hash of namespace UUID and name. -func NewV3(ns UUID, name string) UUID { - u := newFromHash(md5.New(), ns, name) - u.SetVersion(3) - u.SetVariant() - - return u -} - -// NewV4 returns random generated UUID. -func NewV4() UUID { - u := UUID{} - safeRandom(u[:]) - u.SetVersion(4) - u.SetVariant() - - return u -} - -// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name. -func NewV5(ns UUID, name string) UUID { - u := newFromHash(sha1.New(), ns, name) - u.SetVersion(5) - u.SetVariant() - - return u -} - -// Returns UUID based on hashing of namespace UUID and name. -func newFromHash(h hash.Hash, ns UUID, name string) UUID { - u := UUID{} - h.Write(ns[:]) - h.Write([]byte(name)) - copy(u[:], h.Sum(nil)) - - return u -} diff --git a/vendor/github.com/shazow/ssh-chat/LICENSE b/vendor/github.com/shazow/ssh-chat/LICENSE new file mode 100644 index 00000000..325b43a6 --- /dev/null +++ b/vendor/github.com/shazow/ssh-chat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Andrey Petrov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/shazow/ssh-chat/sshd/LICENSE b/vendor/github.com/shazow/ssh-chat/sshd/LICENSE deleted file mode 100644 index 325b43a6..00000000 --- a/vendor/github.com/shazow/ssh-chat/sshd/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Andrey Petrov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE b/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE deleted file mode 100644 index 5f4e3ed5..00000000 --- a/vendor/github.com/shurcooL/sanitized_anchor_name/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Dmitri Shuralyov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/shurcooL/sanitized_anchor_name/main.go b/vendor/github.com/shurcooL/sanitized_anchor_name/main.go deleted file mode 100644 index 72a87535..00000000 --- a/vendor/github.com/shurcooL/sanitized_anchor_name/main.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package sanitized_anchor_name provides a func to create sanitized anchor names. -// -// Its logic can be reused by multiple packages to create interoperable anchor names -// and links to those anchors. -// -// At this time, it does not try to ensure that generated anchor names -// are unique, that responsibility falls on the caller. -package sanitized_anchor_name // import "github.com/shurcooL/sanitized_anchor_name" - -import "unicode" - -// Create returns a sanitized anchor name for the given text. -func Create(text string) string { - var anchorName []rune - var futureDash = false - for _, r := range []rune(text) { - switch { - case unicode.IsLetter(r) || unicode.IsNumber(r): - if futureDash && len(anchorName) > 0 { - anchorName = append(anchorName, '-') - } - futureDash = false - anchorName = append(anchorName, unicode.ToLower(r)) - default: - futureDash = true - } - } - return string(anchorName) -} diff --git a/vendor/github.com/sirupsen/logrus/.gitignore b/vendor/github.com/sirupsen/logrus/.gitignore new file mode 100644 index 00000000..66be63a0 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/.gitignore @@ -0,0 +1 @@ +logrus diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml new file mode 100644 index 00000000..a23296a5 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/.travis.yml @@ -0,0 +1,15 @@ +language: go +go: + - 1.6.x + - 1.7.x + - 1.8.x + - tip +env: + - GOMAXPROCS=4 GORACE=halt_on_error=1 +install: + - go get github.com/stretchr/testify/assert + - go get gopkg.in/gemnasium/logrus-airbrake-hook.v2 + - go get golang.org/x/sys/unix + - go get golang.org/x/sys/windows +script: + - go test -race -v ./... diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md new file mode 100644 index 00000000..cc58f645 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md @@ -0,0 +1,118 @@ +# 1.0.4 + +* Fix race when adding hooks (#612) +* Fix terminal check in AppEngine (#635) + +# 1.0.3 + +* Replace example files with testable examples + +# 1.0.2 + +* bug: quote non-string values in text formatter (#583) +* Make (*Logger) SetLevel a public method + +# 1.0.1 + +* bug: fix escaping in text formatter (#575) + +# 1.0.0 + +* Officially changed name to lower-case +* bug: colors on Windows 10 (#541) +* bug: fix race in accessing level (#512) + +# 0.11.5 + +* feature: add writer and writerlevel to entry (#372) + +# 0.11.4 + +* bug: fix undefined variable on solaris (#493) + +# 0.11.3 + +* formatter: configure quoting of empty values (#484) +* formatter: configure quoting character (default is `"`) (#484) +* bug: fix not importing io correctly in non-linux environments (#481) + +# 0.11.2 + +* bug: fix windows terminal detection (#476) + +# 0.11.1 + +* bug: fix tty detection with custom out (#471) + +# 0.11.0 + +* performance: Use bufferpool to allocate (#370) +* terminal: terminal detection for app-engine (#343) +* feature: exit handler (#375) + +# 0.10.0 + +* feature: Add a test hook (#180) +* feature: `ParseLevel` is now case-insensitive (#326) +* feature: `FieldLogger` interface that generalizes `Logger` and `Entry` (#308) +* performance: avoid re-allocations on `WithFields` (#335) + +# 0.9.0 + +* logrus/text_formatter: don't emit empty msg +* logrus/hooks/airbrake: move out of main repository +* logrus/hooks/sentry: move out of main repository +* logrus/hooks/papertrail: move out of main repository +* logrus/hooks/bugsnag: move out of main repository +* logrus/core: run tests with `-race` +* logrus/core: detect TTY based on `stderr` +* logrus/core: support `WithError` on logger +* logrus/core: Solaris support + +# 0.8.7 + +* logrus/core: fix possible race (#216) +* logrus/doc: small typo fixes and doc improvements + + +# 0.8.6 + +* hooks/raven: allow passing an initialized client + +# 0.8.5 + +* logrus/core: revert #208 + +# 0.8.4 + +* formatter/text: fix data race (#218) + +# 0.8.3 + +* logrus/core: fix entry log level (#208) +* logrus/core: improve performance of text formatter by 40% +* logrus/core: expose `LevelHooks` type +* logrus/core: add support for DragonflyBSD and NetBSD +* formatter/text: print structs more verbosely + +# 0.8.2 + +* logrus: fix more Fatal family functions + +# 0.8.1 + +* logrus: fix not exiting on `Fatalf` and `Fatalln` + +# 0.8.0 + +* logrus: defaults to stderr instead of stdout +* hooks/sentry: add special field for `*http.Request` +* formatter/text: ignore Windows for colors + +# 0.7.3 + +* formatter/\*: allow configuration of timestamp layout + +# 0.7.2 + +* formatter/text: Add configuration option for time format (#158) diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md new file mode 100644 index 00000000..bc3f9bc0 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -0,0 +1,510 @@ +# Logrus :walrus: [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) + +Logrus is a structured logger for Go (golang), completely API compatible with +the standard library logger. + +**Seeing weird case-sensitive problems?** It's in the past been possible to +import Logrus as both upper- and lower-case. Due to the Go package environment, +this caused issues in the community and we needed a standard. Some environments +experienced problems with the upper-case variant, so the lower-case was decided. +Everything using `logrus` will need to use the lower-case: +`github.com/sirupsen/logrus`. Any package that isn't, should be changed. + +To fix Glide, see [these +comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). +For an in-depth explanation of the casing issue, see [this +comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276). + +**Are you interested in assisting in maintaining Logrus?** Currently I have a +lot of obligations, and I am unable to provide Logrus with the maintainership it +needs. If you'd like to help, please reach out to me at `simon at author's +username dot com`. + +Nicely color-coded in development (when a TTY is attached, otherwise just +plain text): + +![Colored](http://i.imgur.com/PY7qMwd.png) + +With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash +or Splunk: + +```json +{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the +ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"} + +{"level":"warning","msg":"The group's number increased tremendously!", +"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} + +{"animal":"walrus","level":"info","msg":"A giant walrus appears!", +"size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"} + +{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", +"size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"} + +{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, +"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} +``` + +With the default `log.SetFormatter(&log.TextFormatter{})` when a TTY is not +attached, the output is compatible with the +[logfmt](http://godoc.org/github.com/kr/logfmt) format: + +```text +time="2015-03-26T01:27:38-04:00" level=debug msg="Started observing beach" animal=walrus number=8 +time="2015-03-26T01:27:38-04:00" level=info msg="A group of walrus emerges from the ocean" animal=walrus size=10 +time="2015-03-26T01:27:38-04:00" level=warning msg="The group's number increased tremendously!" number=122 omg=true +time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4 +time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 +time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true +exit status 1 +``` + +#### Case-sensitivity + +The organization's name was changed to lower-case--and this will not be changed +back. If you are getting import conflicts due to case sensitivity, please use +the lower-case import: `github.com/sirupsen/logrus`. + +#### Example + +The simplest way to use Logrus is simply the package-level exported logger: + +```go +package main + +import ( + log "github.com/sirupsen/logrus" +) + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + }).Info("A walrus appears") +} +``` + +Note that it's completely api-compatible with the stdlib logger, so you can +replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"` +and you'll now have the flexibility of Logrus. You can customize it all you +want: + +```go +package main + +import ( + "os" + log "github.com/sirupsen/logrus" +) + +func init() { + // Log as JSON instead of the default ASCII formatter. + log.SetFormatter(&log.JSONFormatter{}) + + // Output to stdout instead of the default stderr + // Can be any io.Writer, see below for File example + log.SetOutput(os.Stdout) + + // Only log the warning severity or above. + log.SetLevel(log.WarnLevel) +} + +func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "size": 10, + }).Info("A group of walrus emerges from the ocean") + + log.WithFields(log.Fields{ + "omg": true, + "number": 122, + }).Warn("The group's number increased tremendously!") + + log.WithFields(log.Fields{ + "omg": true, + "number": 100, + }).Fatal("The ice breaks!") + + // A common pattern is to re-use fields between logging statements by re-using + // the logrus.Entry returned from WithFields() + contextLogger := log.WithFields(log.Fields{ + "common": "this is a common field", + "other": "I also should be logged always", + }) + + contextLogger.Info("I'll be logged with common and other field") + contextLogger.Info("Me too") +} +``` + +For more advanced usage such as logging to multiple locations from the same +application, you can also create an instance of the `logrus` Logger: + +```go +package main + +import ( + "os" + "github.com/sirupsen/logrus" +) + +// Create a new instance of the logger. You can have any number of instances. +var log = logrus.New() + +func main() { + // The API for setting attributes is a little different than the package level + // exported logger. See Godoc. + log.Out = os.Stdout + + // You could set this to any `io.Writer` such as a file + // file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY, 0666) + // if err == nil { + // log.Out = file + // } else { + // log.Info("Failed to log to file, using default stderr") + // } + + log.WithFields(logrus.Fields{ + "animal": "walrus", + "size": 10, + }).Info("A group of walrus emerges from the ocean") +} +``` + +#### Fields + +Logrus encourages careful, structured logging through logging fields instead of +long, unparseable error messages. For example, instead of: `log.Fatalf("Failed +to send event %s to topic %s with key %d")`, you should log the much more +discoverable: + +```go +log.WithFields(log.Fields{ + "event": event, + "topic": topic, + "key": key, +}).Fatal("Failed to send event") +``` + +We've found this API forces you to think about logging in a way that produces +much more useful logging messages. We've been in countless situations where just +a single added field to a log statement that was already there would've saved us +hours. The `WithFields` call is optional. + +In general, with Logrus using any of the `printf`-family functions should be +seen as a hint you should add a field, however, you can still use the +`printf`-family functions with Logrus. + +#### Default Fields + +Often it's helpful to have fields _always_ attached to log statements in an +application or parts of one. For example, you may want to always log the +`request_id` and `user_ip` in the context of a request. Instead of writing +`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on +every line, you can create a `logrus.Entry` to pass around instead: + +```go +requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip}) +requestLogger.Info("something happened on that request") # will log request_id and user_ip +requestLogger.Warn("something not great happened") +``` + +#### Hooks + +You can add hooks for logging levels. For example to send errors to an exception +tracking service on `Error`, `Fatal` and `Panic`, info to StatsD or log to +multiple places simultaneously, e.g. syslog. + +Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in +`init`: + +```go +import ( + log "github.com/sirupsen/logrus" + "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake" + logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" + "log/syslog" +) + +func init() { + + // Use the Airbrake hook to report errors that have Error severity or above to + // an exception tracker. You can create custom hooks, see the Hooks section. + log.AddHook(airbrake.NewHook(123, "xyz", "production")) + + hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") + if err != nil { + log.Error("Unable to connect to local syslog daemon") + } else { + log.AddHook(hook) + } +} +``` +Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). + +| Hook | Description | +| ----- | ----------- | +| [Airbrake "legacy"](https://github.com/gemnasium/logrus-airbrake-legacy-hook) | Send errors to an exception tracking service compatible with the Airbrake API V2. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. | +| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. | +| [Amazon Kinesis](https://github.com/evalphobia/logrus_kinesis) | Hook for logging to [Amazon Kinesis](https://aws.amazon.com/kinesis/) | +| [Amqp-Hook](https://github.com/vladoatanasov/logrus_amqp) | Hook for logging to Amqp broker (Like RabbitMQ) | +| [Application Insights](https://github.com/jjcollinge/logrus-appinsights) | Hook for logging to [Application Insights](https://azure.microsoft.com/en-us/services/application-insights/) +| [AzureTableHook](https://github.com/kpfaulkner/azuretablehook/) | Hook for logging to Azure Table Storage| +| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. | +| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic | +| [Discordrus](https://github.com/kz/discordrus) | Hook for logging to [Discord](https://discordapp.com/) | +| [ElasticSearch](https://github.com/sohlich/elogrus) | Hook for logging to ElasticSearch| +| [Firehose](https://github.com/beaubrewer/logrus_firehose) | Hook for logging to [Amazon Firehose](https://aws.amazon.com/kinesis/firehose/) +| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd | +| [Go-Slack](https://github.com/multiplay/go-slack) | Hook for logging to [Slack](https://slack.com) | +| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) | +| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. | +| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger | +| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb | +| [Influxus](http://github.com/vlad-doru/influxus) | Hook for concurrently logging to [InfluxDB](http://influxdata.com/) | +| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` | +| [KafkaLogrus](https://github.com/tracer0tong/kafkalogrus) | Hook for logging to Kafka | +| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem | +| [Logbeat](https://github.com/macandmia/logbeat) | Hook for logging to [Opbeat](https://opbeat.com/) | +| [Logentries](https://github.com/jcftang/logentriesrus) | Hook for logging to [Logentries](https://logentries.com/) | +| [Logentrus](https://github.com/puddingfactory/logentrus) | Hook for logging to [Logentries](https://logentries.com/) | +| [Logmatic.io](https://github.com/logmatic/logmatic-go) | Hook for logging to [Logmatic.io](http://logmatic.io/) | +| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) | +| [Logstash](https://github.com/bshuster-repo/logrus-logstash-hook) | Hook for logging to [Logstash](https://www.elastic.co/products/logstash) | +| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail | +| [Mattermost](https://github.com/shuLhan/mattermost-integration/tree/master/hooks/logrus) | Hook for logging to [Mattermost](https://mattermost.com/) | +| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb | +| [NATS-Hook](https://github.com/rybit/nats_logrus_hook) | Hook for logging to [NATS](https://nats.io) | +| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit | +| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. | +| [PostgreSQL](https://github.com/gemnasium/logrus-postgresql-hook) | Send logs to [PostgreSQL](http://postgresql.org) | +| [Promrus](https://github.com/weaveworks/promrus) | Expose number of log messages as [Prometheus](https://prometheus.io/) metrics | +| [Pushover](https://github.com/toorop/logrus_pushover) | Send error via [Pushover](https://pushover.net) | +| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) | +| [Redis-Hook](https://github.com/rogierlommers/logrus-redis-hook) | Hook for logging to a ELK stack (through Redis) | +| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar | +| [Scribe](https://github.com/sagar8192/logrus-scribe-hook) | Hook for logging to [Scribe](https://github.com/facebookarchive/scribe)| +| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. | +| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. | +| [Stackdriver](https://github.com/knq/sdhook) | Hook for logging to [Google Stackdriver](https://cloud.google.com/logging/) | +| [Sumorus](https://github.com/doublefree/sumorus) | Hook for logging to [SumoLogic](https://www.sumologic.com/)| +| [Syslog](https://github.com/sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. | +| [Syslog TLS](https://github.com/shinji62/logrus-syslog-ng) | Send errors to remote syslog server with TLS support. | +| [Telegram](https://github.com/rossmcdonald/telegram_hook) | Hook for logging errors to [Telegram](https://telegram.org/) | +| [TraceView](https://github.com/evalphobia/logrus_appneta) | Hook for logging to [AppNeta TraceView](https://www.appneta.com/products/traceview/) | +| [Typetalk](https://github.com/dragon3/logrus-typetalk-hook) | Hook for logging to [Typetalk](https://www.typetalk.in/) | +| [logz.io](https://github.com/ripcurld00d/logrus-logzio-hook) | Hook for logging to [logz.io](https://logz.io), a Log as a Service using Logstash | +| [SQS-Hook](https://github.com/tsarpaul/logrus_sqs) | Hook for logging to [Amazon Simple Queue Service (SQS)](https://aws.amazon.com/sqs/) | + +#### Level logging + +Logrus has six logging levels: Debug, Info, Warning, Error, Fatal and Panic. + +```go +log.Debug("Useful debugging information.") +log.Info("Something noteworthy happened!") +log.Warn("You should probably take a look at this.") +log.Error("Something failed but I'm not quitting.") +// Calls os.Exit(1) after logging +log.Fatal("Bye.") +// Calls panic() after logging +log.Panic("I'm bailing.") +``` + +You can set the logging level on a `Logger`, then it will only log entries with +that severity or anything above it: + +```go +// Will log anything that is info or above (warn, error, fatal, panic). Default. +log.SetLevel(log.InfoLevel) +``` + +It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose +environment if your application has that. + +#### Entries + +Besides the fields added with `WithField` or `WithFields` some fields are +automatically added to all logging events: + +1. `time`. The timestamp when the entry was created. +2. `msg`. The logging message passed to `{Info,Warn,Error,Fatal,Panic}` after + the `AddFields` call. E.g. `Failed to send event.` +3. `level`. The logging level. E.g. `info`. + +#### Environments + +Logrus has no notion of environment. + +If you wish for hooks and formatters to only be used in specific environments, +you should handle that yourself. For example, if your application has a global +variable `Environment`, which is a string representation of the environment you +could do: + +```go +import ( + log "github.com/sirupsen/logrus" +) + +init() { + // do something here to set environment depending on an environment variable + // or command-line flag + if Environment == "production" { + log.SetFormatter(&log.JSONFormatter{}) + } else { + // The TextFormatter is default, you don't actually have to do this. + log.SetFormatter(&log.TextFormatter{}) + } +} +``` + +This configuration is how `logrus` was intended to be used, but JSON in +production is mostly only useful if you do log aggregation with tools like +Splunk or Logstash. + +#### Formatters + +The built-in logging formatters are: + +* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise + without colors. + * *Note:* to force colored output when there is no TTY, set the `ForceColors` + field to `true`. To force no colored output even if there is a TTY set the + `DisableColors` field to `true`. For Windows, see + [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). + * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). +* `logrus.JSONFormatter`. Logs fields as JSON. + * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). + +Third party logging formatters: + +* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine. +* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. +* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. +* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the P͉̫o̳̼̊w̖͈̰͎e̬͔̭͂r͚̼̹̲ ̫͓͉̳͈ō̠͕͖̚f̝͍̠ ͕̲̞͖͑Z̖̫̤̫ͪa͉̬͈̗l͖͎g̳̥o̰̥̅!̣͔̲̻͊̄ ̙̘̦̹̦. + +You can define your formatter by implementing the `Formatter` interface, +requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a +`Fields` type (`map[string]interface{}`) with all your fields as well as the +default ones (see Entries section above): + +```go +type MyJSONFormatter struct { +} + +log.SetFormatter(new(MyJSONFormatter)) + +func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { + // Note this doesn't include Time, Level and Message which are available on + // the Entry. Consult `godoc` on information about those fields or read the + // source of the official loggers. + serialized, err := json.Marshal(entry.Data) + if err != nil { + return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) + } + return append(serialized, '\n'), nil +} +``` + +#### Logger as an `io.Writer` + +Logrus can be transformed into an `io.Writer`. That writer is the end of an `io.Pipe` and it is your responsibility to close it. + +```go +w := logger.Writer() +defer w.Close() + +srv := http.Server{ + // create a stdlib log.Logger that writes to + // logrus.Logger. + ErrorLog: log.New(w, "", 0), +} +``` + +Each line written to that writer will be printed the usual way, using formatters +and hooks. The level for those entries is `info`. + +This means that we can override the standard library logger easily: + +```go +logger := logrus.New() +logger.Formatter = &logrus.JSONFormatter{} + +// Use logrus for standard log output +// Note that `log` here references stdlib's log +// Not logrus imported under the name `log`. +log.SetOutput(logger.Writer()) +``` + +#### Rotation + +Log rotation is not provided with Logrus. Log rotation should be done by an +external program (like `logrotate(8)`) that can compress and delete old log +entries. It should not be a feature of the application-level logger. + +#### Tools + +| Tool | Description | +| ---- | ----------- | +|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| +|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | + +#### Testing + +Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: + +* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just add the `test` hook +* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): + +```go +import( + "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus/hooks/test" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestSomething(t*testing.T){ + logger, hook := test.NewNullLogger() + logger.Error("Helloerror") + + assert.Equal(t, 1, len(hook.Entries)) + assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level) + assert.Equal(t, "Helloerror", hook.LastEntry().Message) + + hook.Reset() + assert.Nil(t, hook.LastEntry()) +} +``` + +#### Fatal handlers + +Logrus can register one or more functions that will be called when any `fatal` +level message is logged. The registered handlers will be executed before +logrus performs a `os.Exit(1)`. This behavior may be helpful if callers need +to gracefully shutdown. Unlike a `panic("Something went wrong...")` call which can be intercepted with a deferred `recover` a call to `os.Exit(1)` can not be intercepted. + +``` +... +handler := func() { + // gracefully shutdown something... +} +logrus.RegisterExitHandler(handler) +... +``` + +#### Thread safety + +By default Logger is protected by mutex for concurrent writes, this mutex is invoked when calling hooks and writing logs. +If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking. + +Situation when locking is not needed includes: + +* You have no hooks registered, or hooks calling is already thread-safe. + +* Writing to logger.Out is already thread-safe, for example: + + 1) logger.Out is protected by locks. + + 2) logger.Out is a os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allow multi-thread/multi-process writing) + + (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/) diff --git a/vendor/github.com/sirupsen/logrus/appveyor.yml b/vendor/github.com/sirupsen/logrus/appveyor.yml new file mode 100644 index 00000000..96c2ce15 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/appveyor.yml @@ -0,0 +1,14 @@ +version: "{build}" +platform: x64 +clone_folder: c:\gopath\src\github.com\sirupsen\logrus +environment: + GOPATH: c:\gopath +branches: + only: + - master +install: + - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - go version +build_script: + - go get -t + - go test diff --git a/vendor/github.com/sirupsen/logrus/hooks/syslog/syslog.go b/vendor/github.com/sirupsen/logrus/hooks/syslog/syslog.go deleted file mode 100644 index 329ce0d6..00000000 --- a/vendor/github.com/sirupsen/logrus/hooks/syslog/syslog.go +++ /dev/null @@ -1,55 +0,0 @@ -// +build !windows,!nacl,!plan9 - -package syslog - -import ( - "fmt" - "log/syslog" - "os" - - "github.com/sirupsen/logrus" -) - -// SyslogHook to send logs via syslog. -type SyslogHook struct { - Writer *syslog.Writer - SyslogNetwork string - SyslogRaddr string -} - -// Creates a hook to be added to an instance of logger. This is called with -// `hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_DEBUG, "")` -// `if err == nil { log.Hooks.Add(hook) }` -func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string) (*SyslogHook, error) { - w, err := syslog.Dial(network, raddr, priority, tag) - return &SyslogHook{w, network, raddr}, err -} - -func (hook *SyslogHook) Fire(entry *logrus.Entry) error { - line, err := entry.String() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err) - return err - } - - switch entry.Level { - case logrus.PanicLevel: - return hook.Writer.Crit(line) - case logrus.FatalLevel: - return hook.Writer.Crit(line) - case logrus.ErrorLevel: - return hook.Writer.Err(line) - case logrus.WarnLevel: - return hook.Writer.Warning(line) - case logrus.InfoLevel: - return hook.Writer.Info(line) - case logrus.DebugLevel: - return hook.Writer.Debug(line) - default: - return nil - } -} - -func (hook *SyslogHook) Levels() []logrus.Level { - return logrus.AllLevels -} diff --git a/vendor/github.com/sirupsen/logrus/hooks/test/test.go b/vendor/github.com/sirupsen/logrus/hooks/test/test.go deleted file mode 100644 index 62c4845d..00000000 --- a/vendor/github.com/sirupsen/logrus/hooks/test/test.go +++ /dev/null @@ -1,95 +0,0 @@ -// The Test package is used for testing logrus. It is here for backwards -// compatibility from when logrus' organization was upper-case. Please use -// lower-case logrus and the `null` package instead of this one. -package test - -import ( - "io/ioutil" - "sync" - - "github.com/sirupsen/logrus" -) - -// Hook is a hook designed for dealing with logs in test scenarios. -type Hook struct { - // Entries is an array of all entries that have been received by this hook. - // For safe access, use the AllEntries() method, rather than reading this - // value directly. - Entries []*logrus.Entry - mu sync.RWMutex -} - -// NewGlobal installs a test hook for the global logger. -func NewGlobal() *Hook { - - hook := new(Hook) - logrus.AddHook(hook) - - return hook - -} - -// NewLocal installs a test hook for a given local logger. -func NewLocal(logger *logrus.Logger) *Hook { - - hook := new(Hook) - logger.Hooks.Add(hook) - - return hook - -} - -// NewNullLogger creates a discarding logger and installs the test hook. -func NewNullLogger() (*logrus.Logger, *Hook) { - - logger := logrus.New() - logger.Out = ioutil.Discard - - return logger, NewLocal(logger) - -} - -func (t *Hook) Fire(e *logrus.Entry) error { - t.mu.Lock() - defer t.mu.Unlock() - t.Entries = append(t.Entries, e) - return nil -} - -func (t *Hook) Levels() []logrus.Level { - return logrus.AllLevels -} - -// LastEntry returns the last entry that was logged or nil. -func (t *Hook) LastEntry() *logrus.Entry { - t.mu.RLock() - defer t.mu.RUnlock() - i := len(t.Entries) - 1 - if i < 0 { - return nil - } - // Make a copy, for safety - e := *t.Entries[i] - return &e -} - -// AllEntries returns all entries that were logged. -func (t *Hook) AllEntries() []*logrus.Entry { - t.mu.RLock() - defer t.mu.RUnlock() - // Make a copy so the returned value won't race with future log requests - entries := make([]*logrus.Entry, len(t.Entries)) - for i, entry := range t.Entries { - // Make a copy, for safety - e := *entry - entries[i] = &e - } - return entries -} - -// Reset removes all Entries from this test hook. -func (t *Hook) Reset() { - t.mu.Lock() - defer t.mu.Unlock() - t.Entries = make([]*logrus.Entry, 0) -} diff --git a/vendor/github.com/sorcix/irc/LICENSE b/vendor/github.com/sorcix/irc/LICENSE deleted file mode 100644 index 10cecc4c..00000000 --- a/vendor/github.com/sorcix/irc/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2014 Vic Demuzere - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/sorcix/irc/constants.go b/vendor/github.com/sorcix/irc/constants.go deleted file mode 100644 index d4812ba3..00000000 --- a/vendor/github.com/sorcix/irc/constants.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -package irc - -// Various prefixes extracted from RFC1459. -const ( - Channel = '#' // Normal channel - Distributed = '&' // Distributed channel - - Owner = '~' // Channel owner +q (non-standard) - Admin = '&' // Channel admin +a (non-standard) - Operator = '@' // Channel operator +o - HalfOperator = '%' // Channel half operator +h (non-standard) - Voice = '+' // User has voice +v -) - -// User modes as defined by RFC1459 section 4.2.3.2. -const ( - UserModeInvisible = 'i' // User is invisible - UserModeServerNotices = 's' // User wants to receive server notices - UserModeWallops = 'w' // User wants to receive Wallops - UserModeOperator = 'o' // Server operator -) - -// Channel modes as defined by RFC1459 section 4.2.3.1 -const ( - ModeOperator = 'o' // Operator privileges - ModeVoice = 'v' // Ability to speak on a moderated channel - ModePrivate = 'p' // Private channel - ModeSecret = 's' // Secret channel - ModeInviteOnly = 'i' // Users can't join without invite - ModeTopic = 't' // Topic can only be set by an operator - ModeModerated = 'm' // Only voiced users and operators can talk - ModeLimit = 'l' // User limit - ModeKey = 'k' // Channel password - - ModeOwner = 'q' // Owner privileges (non-standard) - ModeAdmin = 'a' // Admin privileges (non-standard) - ModeHalfOperator = 'h' // Half-operator privileges (non-standard) -) - -// IRC commands extracted from RFC2812 section 3 and RFC2813 section 4. -const ( - PASS = "PASS" - NICK = "NICK" - USER = "USER" - OPER = "OPER" - MODE = "MODE" - SERVICE = "SERVICE" - QUIT = "QUIT" - SQUIT = "SQUIT" - JOIN = "JOIN" - PART = "PART" - TOPIC = "TOPIC" - NAMES = "NAMES" - LIST = "LIST" - INVITE = "INVITE" - KICK = "KICK" - PRIVMSG = "PRIVMSG" - NOTICE = "NOTICE" - MOTD = "MOTD" - LUSERS = "LUSERS" - VERSION = "VERSION" - STATS = "STATS" - LINKS = "LINKS" - TIME = "TIME" - CONNECT = "CONNECT" - TRACE = "TRACE" - ADMIN = "ADMIN" - INFO = "INFO" - SERVLIST = "SERVLIST" - SQUERY = "SQUERY" - WHO = "WHO" - WHOIS = "WHOIS" - WHOWAS = "WHOWAS" - KILL = "KILL" - PING = "PING" - PONG = "PONG" - ERROR = "ERROR" - AWAY = "AWAY" - REHASH = "REHASH" - DIE = "DIE" - RESTART = "RESTART" - SUMMON = "SUMMON" - USERS = "USERS" - WALLOPS = "WALLOPS" - USERHOST = "USERHOST" - ISON = "ISON" - SERVER = "SERVER" - NJOIN = "NJOIN" -) - -// Numeric IRC replies extracted from RFC2812 section 5. -const ( - RPL_WELCOME = "001" - RPL_YOURHOST = "002" - RPL_CREATED = "003" - RPL_MYINFO = "004" - RPL_BOUNCE = "005" - RPL_ISUPPORT = "005" - RPL_USERHOST = "302" - RPL_ISON = "303" - RPL_AWAY = "301" - RPL_UNAWAY = "305" - RPL_NOWAWAY = "306" - RPL_WHOISUSER = "311" - RPL_WHOISSERVER = "312" - RPL_WHOISOPERATOR = "313" - RPL_WHOISIDLE = "317" - RPL_ENDOFWHOIS = "318" - RPL_WHOISCHANNELS = "319" - RPL_WHOWASUSER = "314" - RPL_ENDOFWHOWAS = "369" - RPL_LISTSTART = "321" - RPL_LIST = "322" - RPL_LISTEND = "323" - RPL_UNIQOPIS = "325" - RPL_CHANNELMODEIS = "324" - RPL_NOTOPIC = "331" - RPL_TOPIC = "332" - RPL_INVITING = "341" - RPL_SUMMONING = "342" - RPL_INVITELIST = "346" - RPL_ENDOFINVITELIST = "347" - RPL_EXCEPTLIST = "348" - RPL_ENDOFEXCEPTLIST = "349" - RPL_VERSION = "351" - RPL_WHOREPLY = "352" - RPL_ENDOFWHO = "315" - RPL_NAMREPLY = "353" - RPL_ENDOFNAMES = "366" - RPL_LINKS = "364" - RPL_ENDOFLINKS = "365" - RPL_BANLIST = "367" - RPL_ENDOFBANLIST = "368" - RPL_INFO = "371" - RPL_ENDOFINFO = "374" - RPL_MOTDSTART = "375" - RPL_MOTD = "372" - RPL_ENDOFMOTD = "376" - RPL_YOUREOPER = "381" - RPL_REHASHING = "382" - RPL_YOURESERVICE = "383" - RPL_TIME = "391" - RPL_USERSSTART = "392" - RPL_USERS = "393" - RPL_ENDOFUSERS = "394" - RPL_NOUSERS = "395" - RPL_TRACELINK = "200" - RPL_TRACECONNECTING = "201" - RPL_TRACEHANDSHAKE = "202" - RPL_TRACEUNKNOWN = "203" - RPL_TRACEOPERATOR = "204" - RPL_TRACEUSER = "205" - RPL_TRACESERVER = "206" - RPL_TRACESERVICE = "207" - RPL_TRACENEWTYPE = "208" - RPL_TRACECLASS = "209" - RPL_TRACERECONNECT = "210" - RPL_TRACELOG = "261" - RPL_TRACEEND = "262" - RPL_STATSLINKINFO = "211" - RPL_STATSCOMMANDS = "212" - RPL_ENDOFSTATS = "219" - RPL_STATSUPTIME = "242" - RPL_STATSOLINE = "243" - RPL_UMODEIS = "221" - RPL_SERVLIST = "234" - RPL_SERVLISTEND = "235" - RPL_LUSERCLIENT = "251" - RPL_LUSEROP = "252" - RPL_LUSERUNKNOWN = "253" - RPL_LUSERCHANNELS = "254" - RPL_LUSERME = "255" - RPL_ADMINME = "256" - RPL_ADMINLOC1 = "257" - RPL_ADMINLOC2 = "258" - RPL_ADMINEMAIL = "259" - RPL_TRYAGAIN = "263" - ERR_NOSUCHNICK = "401" - ERR_NOSUCHSERVER = "402" - ERR_NOSUCHCHANNEL = "403" - ERR_CANNOTSENDTOCHAN = "404" - ERR_TOOMANYCHANNELS = "405" - ERR_WASNOSUCHNICK = "406" - ERR_TOOMANYTARGETS = "407" - ERR_NOSUCHSERVICE = "408" - ERR_NOORIGIN = "409" - ERR_NORECIPIENT = "411" - ERR_NOTEXTTOSEND = "412" - ERR_NOTOPLEVEL = "413" - ERR_WILDTOPLEVEL = "414" - ERR_BADMASK = "415" - ERR_UNKNOWNCOMMAND = "421" - ERR_NOMOTD = "422" - ERR_NOADMININFO = "423" - ERR_FILEERROR = "424" - ERR_NONICKNAMEGIVEN = "431" - ERR_ERRONEUSNICKNAME = "432" - ERR_NICKNAMEINUSE = "433" - ERR_NICKCOLLISION = "436" - ERR_UNAVAILRESOURCE = "437" - ERR_USERNOTINCHANNEL = "441" - ERR_NOTONCHANNEL = "442" - ERR_USERONCHANNEL = "443" - ERR_NOLOGIN = "444" - ERR_SUMMONDISABLED = "445" - ERR_USERSDISABLED = "446" - ERR_NOTREGISTERED = "451" - ERR_NEEDMOREPARAMS = "461" - ERR_ALREADYREGISTRED = "462" - ERR_NOPERMFORHOST = "463" - ERR_PASSWDMISMATCH = "464" - ERR_YOUREBANNEDCREEP = "465" - ERR_YOUWILLBEBANNED = "466" - ERR_KEYSET = "467" - ERR_CHANNELISFULL = "471" - ERR_UNKNOWNMODE = "472" - ERR_INVITEONLYCHAN = "473" - ERR_BANNEDFROMCHAN = "474" - ERR_BADCHANNELKEY = "475" - ERR_BADCHANMASK = "476" - ERR_NOCHANMODES = "477" - ERR_BANLISTFULL = "478" - ERR_NOPRIVILEGES = "481" - ERR_CHANOPRIVSNEEDED = "482" - ERR_CANTKILLSERVER = "483" - ERR_RESTRICTED = "484" - ERR_UNIQOPPRIVSNEEDED = "485" - ERR_NOOPERHOST = "491" - ERR_UMODEUNKNOWNFLAG = "501" - ERR_USERSDONTMATCH = "502" -) - -// IRC commands extracted from the IRCv3 spec at http://www.ircv3.org/. -const ( - CAP = "CAP" - CAP_LS = "LS" // Subcommand (param) - CAP_LIST = "LIST" // Subcommand (param) - CAP_REQ = "REQ" // Subcommand (param) - CAP_ACK = "ACK" // Subcommand (param) - CAP_NAK = "NAK" // Subcommand (param) - CAP_CLEAR = "CLEAR" // Subcommand (param) - CAP_END = "END" // Subcommand (param) - - AUTHENTICATE = "AUTHENTICATE" -) - -// Numeric IRC replies extracted from the IRCv3 spec. -const ( - RPL_LOGGEDIN = "900" - RPL_LOGGEDOUT = "901" - RPL_NICKLOCKED = "902" - RPL_SASLSUCCESS = "903" - ERR_SASLFAIL = "904" - ERR_SASLTOOLONG = "905" - ERR_SASLABORTED = "906" - ERR_SASLALREADY = "907" - RPL_SASLMECHS = "908" -) - -// RFC2812, section 5.3 -const ( - RPL_STATSCLINE = "213" - RPL_STATSNLINE = "214" - RPL_STATSILINE = "215" - RPL_STATSKLINE = "216" - RPL_STATSQLINE = "217" - RPL_STATSYLINE = "218" - RPL_SERVICEINFO = "231" - RPL_ENDOFSERVICES = "232" - RPL_SERVICE = "233" - RPL_STATSVLINE = "240" - RPL_STATSLLINE = "241" - RPL_STATSHLINE = "244" - RPL_STATSSLINE = "245" - RPL_STATSPING = "246" - RPL_STATSBLINE = "247" - RPL_STATSDLINE = "250" - RPL_NONE = "300" - RPL_WHOISCHANOP = "316" - RPL_KILLDONE = "361" - RPL_CLOSING = "362" - RPL_CLOSEEND = "363" - RPL_INFOSTART = "373" - RPL_MYPORTIS = "384" - ERR_NOSERVICEHOST = "492" -) - -// Other constants -const ( - ERR_TOOMANYMATCHES = "416" // Used on IRCNet - RPL_TOPICWHOTIME = "333" // From ircu, in use on Freenode - RPL_LOCALUSERS = "265" // From aircd, Hybrid, Hybrid, Bahamut, in use on Freenode - RPL_GLOBALUSERS = "266" // From aircd, Hybrid, Hybrid, Bahamut, in use on Freenode -) diff --git a/vendor/github.com/sorcix/irc/ctcp/ctcp.go b/vendor/github.com/sorcix/irc/ctcp/ctcp.go deleted file mode 100644 index 7ead788d..00000000 --- a/vendor/github.com/sorcix/irc/ctcp/ctcp.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -package ctcp - -// Sources: -// http://www.irchelp.org/irchelp/rfc/ctcpspec.html -// http://www.kvirc.net/doc/doc_ctcp_handling.html - -import ( - "fmt" - "runtime" - "strings" - "time" -) - -// Various constants used for formatting CTCP messages. -const ( - delimiter byte = 0x01 // Prefix and suffix for CTCP tagged messages. - space byte = 0x20 // Token separator - - empty = "" // The empty string - - timeFormat = time.RFC1123Z - versionFormat = "Go v%s (" + runtime.GOOS + ", " + runtime.GOARCH + ")" -) - -// Tags extracted from the CTCP spec. -const ( - ACTION = "ACTION" - PING = "PING" - PONG = "PONG" - VERSION = "VERSION" - USERINFO = "USERINFO" - CLIENTINFO = "CLIENTINFO" - FINGER = "FINGER" - SOURCE = "SOURCE" - TIME = "TIME" -) - -// Decode attempts to decode CTCP tagged data inside given message text. -// -// If the message text does not contain tagged data, ok will be false. -// -// ::= [ ] -// ::= 0x01 -// -func Decode(text string) (tag, message string, ok bool) { - - // Fast path, return if this text does not contain a CTCP message. - if len(text) < 3 || text[0] != delimiter || text[len(text)-1] != delimiter { - return empty, empty, false - } - - s := strings.IndexByte(text, space) - - if s < 0 { - - // Messages may contain only a tag. - return text[1 : len(text)-1], empty, true - } - - return text[1:s], text[s+1 : len(text)-1], true -} - -// Encode returns the IRC message text for CTCP tagged data. -// -// ::= [ ] -// ::= 0x01 -// -func Encode(tag, message string) (text string) { - - switch { - - // We can't build a valid CTCP tagged message without at least a tag. - case len(tag) <= 0: - return empty - - // Tagged data with a message - case len(message) > 0: - return string(delimiter) + tag + string(space) + message + string(delimiter) - - // Tagged data without a message - default: - return string(delimiter) + tag + string(delimiter) - - } -} - -// Action is a shortcut for Encode(ctcp.ACTION, message). -func Action(message string) string { - return Encode(ACTION, message) -} - -// Ping is a shortcut for Encode(ctcp.PING, message). -func Ping(message string) string { - return Encode(PING, message) -} - -// Pong is a shortcut for Encode(ctcp.PONG, message). -func Pong(message string) string { - return Encode(PONG, message) -} - -// Version is a shortcut for Encode(ctcp.VERSION, message). -func Version(message string) string { - return Encode(VERSION, message) -} - -// VersionReply is a shortcut for ENCODE(ctcp.VERSION, go version info). -func VersionReply() string { - return Encode(VERSION, fmt.Sprintf(versionFormat, runtime.Version())) -} - -// UserInfo is a shortcut for Encode(ctcp.USERINFO, message). -func UserInfo(message string) string { - return Encode(USERINFO, message) -} - -// ClientInfo is a shortcut for Encode(ctcp.CLIENTINFO, message). -func ClientInfo(message string) string { - return Encode(CLIENTINFO, message) -} - -// Finger is a shortcut for Encode(ctcp.FINGER, message). -func Finger(message string) string { - return Encode(FINGER, message) -} - -// Source is a shortcut for Encode(ctcp.SOURCE, message). -func Source(message string) string { - return Encode(SOURCE, message) -} - -// Time is a shortcut for Encode(ctcp.TIME, message). -func Time(message string) string { - return Encode(TIME, message) -} - -// TimeReply is a shortcut for Encode(ctcp.TIME, currenttime). -func TimeReply() string { - return Encode(TIME, time.Now().Format(timeFormat)) -} diff --git a/vendor/github.com/sorcix/irc/ctcp/doc.go b/vendor/github.com/sorcix/irc/ctcp/doc.go deleted file mode 100644 index f0308d86..00000000 --- a/vendor/github.com/sorcix/irc/ctcp/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -// Package ctcp implements partial support for the Client-to-Client Protocol. -// -// CTCP defines extended messages using the standard PRIVMSG and NOTICE -// commands in IRC. This means that any CTCP messages are embedded inside the -// normal message text. Clients that don't support CTCP simply show -// the encoded message to the user. -// -// Most IRC clients support only a subset of the protocol, and only a few -// commands are actually used. This package aims to implement the most basic -// CTCP messages: a single command per IRC message. Quoting is not supported. -// -// Example using the irc.Message type: -// -// m := irc.ParseMessage(...) -// -// if tag, text, ok := ctcp.Decode(m.Trailing); ok { -// // This is a CTCP message. -// } else { -// // This is not a CTCP message. -// } -// -// Similar, for encoding messages: -// -// m.Trailing = ctcp.Encode("ACTION","wants a cookie!") -// -// Do not send a complete IRC message to Decode, it won't work. -package ctcp diff --git a/vendor/github.com/sorcix/irc/doc.go b/vendor/github.com/sorcix/irc/doc.go deleted file mode 100644 index 0effeb8a..00000000 --- a/vendor/github.com/sorcix/irc/doc.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -// Package irc allows your application to speak the IRC protocol. -// -// The Message and Prefix structs provide translation to and from raw IRC messages: -// -// // Parse the IRC-encoded data and store the result in a new struct: -// message := irc.ParseMessage(raw) -// -// // Translate back to a raw IRC message string: -// raw = message.String() -// -// Decoder and Encoder can be used to decode and encode messages in a stream: -// -// // Create a decoder that reads from given io.Reader -// dec := irc.NewDecoder(reader) -// -// // Decode the next IRC message -// message, err := dec.Decode() -// -// // Create an encoder that writes to given io.Writer -// enc := irc.NewEncoder(writer) -// -// // Send a message to the writer. -// enc.Encode(message) -// -// The Conn type combines an Encoder and Decoder for a duplex connection. -// -// c, err := irc.Dial("irc.server.net:6667") -// -// // Methods from both Encoder and Decoder are available -// message, err := c.Decode() -// -package irc diff --git a/vendor/github.com/sorcix/irc/message.go b/vendor/github.com/sorcix/irc/message.go deleted file mode 100644 index 088938dc..00000000 --- a/vendor/github.com/sorcix/irc/message.go +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -package irc - -import ( - "bytes" - "strings" -) - -// Various constants used for formatting IRC messages. -const ( - prefix byte = 0x3A // Prefix or last argument - prefixUser byte = 0x21 // Username - prefixHost byte = 0x40 // Hostname - space byte = 0x20 // Separator - - maxLength = 510 // Maximum length is 512 - 2 for the line endings. -) - -func cutsetFunc(r rune) bool { - // Characters to trim from prefixes/messages. - return r == '\r' || r == '\n' -} - -// Sender represents objects that are able to send messages to an IRC server. -// -// As there might be a message queue, it is possible that Send returns a nil -// error, but the message is not sent (yet). The error value is only used when -// it is certain that sending the message is impossible. -// -// This interface is not used inside this package, and shouldn't have been -// defined here in the first place. For backwards compatibility only. -type Sender interface { - Send(*Message) error -} - -// Prefix represents the prefix (sender) of an IRC message. -// See RFC1459 section 2.3.1. -// -// | [ '!' ] [ '@' ] -// -type Prefix struct { - Name string // Nick- or servername - User string // Username - Host string // Hostname -} - -// ParsePrefix takes a string and attempts to create a Prefix struct. -func ParsePrefix(raw string) (p *Prefix) { - - p = new(Prefix) - - user := indexByte(raw, prefixUser) - host := indexByte(raw, prefixHost) - - switch { - - case user > 0 && host > user: - p.Name = raw[:user] - p.User = raw[user+1 : host] - p.Host = raw[host+1:] - - case user > 0: - p.Name = raw[:user] - p.User = raw[user+1:] - - case host > 0: - p.Name = raw[:host] - p.Host = raw[host+1:] - - default: - p.Name = raw - - } - - return p -} - -// Len calculates the length of the string representation of this prefix. -func (p *Prefix) Len() (length int) { - length = len(p.Name) - if len(p.User) > 0 { - length = length + len(p.User) + 1 - } - if len(p.Host) > 0 { - length = length + len(p.Host) + 1 - } - return -} - -// Bytes returns a []byte representation of this prefix. -func (p *Prefix) Bytes() []byte { - buffer := new(bytes.Buffer) - p.writeTo(buffer) - return buffer.Bytes() -} - -// String returns a string representation of this prefix. -func (p *Prefix) String() (s string) { - // Benchmarks revealed that in this case simple string concatenation - // is actually faster than using a ByteBuffer as in (*Message).String() - s = p.Name - if len(p.User) > 0 { - s = s + string(prefixUser) + p.User - } - if len(p.Host) > 0 { - s = s + string(prefixHost) + p.Host - } - return -} - -// IsHostmask returns true if this prefix looks like a user hostmask. -func (p *Prefix) IsHostmask() bool { - return len(p.User) > 0 && len(p.Host) > 0 -} - -// IsServer returns true if this prefix looks like a server name. -func (p *Prefix) IsServer() bool { - return len(p.User) <= 0 && len(p.Host) <= 0 // && indexByte(p.Name, '.') > 0 -} - -// writeTo is an utility function to write the prefix to the bytes.Buffer in Message.String(). -func (p *Prefix) writeTo(buffer *bytes.Buffer) { - buffer.WriteString(p.Name) - if len(p.User) > 0 { - buffer.WriteByte(prefixUser) - buffer.WriteString(p.User) - } - if len(p.Host) > 0 { - buffer.WriteByte(prefixHost) - buffer.WriteString(p.Host) - } - return -} - -// Message represents an IRC protocol message. -// See RFC1459 section 2.3.1. -// -// ::= [':' ] -// ::= | [ '!' ] [ '@' ] -// ::= { } | -// ::= ' ' { ' ' } -// ::= [ ':' | ] -// -// ::= -// ::= -// -// ::= CR LF -type Message struct { - *Prefix - Command string - Params []string - Trailing string - - // When set to true, the trailing prefix (:) will be added even if the trailing message is empty. - EmptyTrailing bool -} - -// ParseMessage takes a string and attempts to create a Message struct. -// Returns nil if the Message is invalid. -func ParseMessage(raw string) (m *Message) { - - // Ignore empty messages. - if raw = strings.TrimFunc(raw, cutsetFunc); len(raw) < 2 { - return nil - } - - i, j := 0, 0 - - m = new(Message) - - if raw[0] == prefix { - - // Prefix ends with a space. - i = indexByte(raw, space) - - // Prefix string must not be empty if the indicator is present. - if i < 2 { - return nil - } - - m.Prefix = ParsePrefix(raw[1:i]) - - // Skip space at the end of the prefix - i++ - } - - // Find end of command - j = i + indexByte(raw[i:], space) - - // Extract command - if j > i { - m.Command = strings.ToUpper(raw[i:j]) - } else { - m.Command = strings.ToUpper(raw[i:]) - - // We're done here! - return m - } - - // Skip space after command - j++ - - // Find prefix for trailer - i = indexByte(raw[j:], prefix) - - if i < 0 || raw[j+i-1] != space { - - // There is no trailing argument! - m.Params = strings.Split(raw[j:], string(space)) - - // We're done here! - return m - } - - // Compensate for index on substring - i = i + j - - // Check if we need to parse arguments. - if i > j { - m.Params = strings.Split(raw[j:i-1], string(space)) - } - - m.Trailing = raw[i+1:] - - // We need to re-encode the trailing argument even if it was empty. - if len(m.Trailing) <= 0 { - m.EmptyTrailing = true - } - - return m - -} - -// Len calculates the length of the string representation of this message. -func (m *Message) Len() (length int) { - - if m.Prefix != nil { - length = m.Prefix.Len() + 2 // Include prefix and trailing space - } - - length = length + len(m.Command) - - if len(m.Params) > 0 { - length = length + len(m.Params) - for _, param := range m.Params { - length = length + len(param) - } - } - - if len(m.Trailing) > 0 || m.EmptyTrailing { - length = length + len(m.Trailing) + 2 // Include prefix and space - } - - return -} - -// Bytes returns a []byte representation of this message. -// -// As noted in rfc2812 section 2.3, messages should not exceed 512 characters -// in length. This method forces that limit by discarding any characters -// exceeding the length limit. -func (m *Message) Bytes() []byte { - - buffer := new(bytes.Buffer) - - // Message prefix - if m.Prefix != nil { - buffer.WriteByte(prefix) - m.Prefix.writeTo(buffer) - buffer.WriteByte(space) - } - - // Command is required - buffer.WriteString(m.Command) - - // Space separated list of arguments - if len(m.Params) > 0 { - buffer.WriteByte(space) - buffer.WriteString(strings.Join(m.Params, string(space))) - } - - if len(m.Trailing) > 0 || m.EmptyTrailing { - buffer.WriteByte(space) - buffer.WriteByte(prefix) - buffer.WriteString(m.Trailing) - } - - // We need the limit the buffer length. - if buffer.Len() > (maxLength) { - buffer.Truncate(maxLength) - } - - return buffer.Bytes() -} - -// String returns a string representation of this message. -// -// As noted in rfc2812 section 2.3, messages should not exceed 512 characters -// in length. This method forces that limit by discarding any characters -// exceeding the length limit. -func (m *Message) String() string { - return string(m.Bytes()) -} diff --git a/vendor/github.com/sorcix/irc/stream.go b/vendor/github.com/sorcix/irc/stream.go deleted file mode 100644 index c4af9af1..00000000 --- a/vendor/github.com/sorcix/irc/stream.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -package irc - -import ( - "bufio" - "io" - "net" - "sync" -) - -// Messages are delimited with CR and LF line endings, -// we're using the last one to split the stream. Both are removed -// during message parsing. -const delim byte = '\n' - -var endline = []byte("\r\n") - -// A Conn represents an IRC network protocol connection. -// It consists of an Encoder and Decoder to manage I/O. -type Conn struct { - Encoder - Decoder - - conn io.ReadWriteCloser -} - -// NewConn returns a new Conn using rwc for I/O. -func NewConn(rwc io.ReadWriteCloser) *Conn { - return &Conn{ - Encoder: Encoder{ - writer: rwc, - }, - Decoder: Decoder{ - reader: bufio.NewReader(rwc), - }, - conn: rwc, - } -} - -// Dial connects to the given address using net.Dial and -// then returns a new Conn for the connection. -func Dial(addr string) (*Conn, error) { - c, err := net.Dial("tcp", addr) - - if err != nil { - return nil, err - } - - return NewConn(c), nil -} - -// Close closes the underlying ReadWriteCloser. -func (c *Conn) Close() error { - return c.conn.Close() -} - -// A Decoder reads Message objects from an input stream. -type Decoder struct { - reader *bufio.Reader - line string - mu sync.Mutex -} - -// NewDecoder returns a new Decoder that reads from r. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{ - reader: bufio.NewReader(r), - } -} - -// Decode attempts to read a single Message from the stream. -// -// Returns a non-nil error if the read failed. -func (dec *Decoder) Decode() (m *Message, err error) { - - dec.mu.Lock() - dec.line, err = dec.reader.ReadString(delim) - dec.mu.Unlock() - - if err != nil { - return nil, err - } - - return ParseMessage(dec.line), nil -} - -// An Encoder writes Message objects to an output stream. -type Encoder struct { - writer io.Writer - mu sync.Mutex -} - -// NewEncoder returns a new Encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - writer: w, - } -} - -// Encode writes the IRC encoding of m to the stream. -// -// This method may be used from multiple goroutines. -// -// Returns an non-nil error if the write to the underlying stream stopped early. -func (enc *Encoder) Encode(m *Message) (err error) { - - _, err = enc.Write(m.Bytes()) - - return -} - -// Write writes len(p) bytes from p followed by CR+LF. -// -// This method can be used simultaneously from multiple goroutines, -// it guarantees to serialize access. However, writing a single IRC message -// using multiple Write calls will cause corruption. -func (enc *Encoder) Write(p []byte) (n int, err error) { - - enc.mu.Lock() - n, err = enc.writer.Write(p) - - if err != nil { - enc.mu.Unlock() - return - } - - _, err = enc.writer.Write(endline) - enc.mu.Unlock() - - return -} diff --git a/vendor/github.com/sorcix/irc/strings.go b/vendor/github.com/sorcix/irc/strings.go deleted file mode 100644 index 550739f4..00000000 --- a/vendor/github.com/sorcix/irc/strings.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -// +build go1.2 - -// Documented in strings_legacy.go - -package irc - -import ( - "strings" -) - -func indexByte(s string, c byte) int { - return strings.IndexByte(s, c) -} diff --git a/vendor/github.com/sorcix/irc/strings_legacy.go b/vendor/github.com/sorcix/irc/strings_legacy.go deleted file mode 100644 index f9328ec7..00000000 --- a/vendor/github.com/sorcix/irc/strings_legacy.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2014 Vic Demuzere -// -// Use of this source code is governed by the MIT license. - -// +build !go1.2 - -// Debian Wheezy only ships Go 1.0: -// https://github.com/sorcix/irc/issues/4 -// -// This code may be removed when Wheezy is no longer supported. - -package irc - -// indexByte implements strings.IndexByte for Go versions < 1.2. -func indexByte(s string, c byte) int { - for i := range s { - if s[i] == c { - return i - } - } - return -1 -} diff --git a/vendor/github.com/spf13/afero/.travis.yml b/vendor/github.com/spf13/afero/.travis.yml new file mode 100644 index 00000000..e002181f --- /dev/null +++ b/vendor/github.com/spf13/afero/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: go + +go: + - 1.8 + - 1.9 + - tip + +os: + - linux + - osx + +matrix: + allow_failures: + - go: tip + fast_finish: true + +script: + - go build + - go test -race -v ./... + diff --git a/vendor/github.com/spf13/afero/README.md b/vendor/github.com/spf13/afero/README.md new file mode 100644 index 00000000..0c9b04b5 --- /dev/null +++ b/vendor/github.com/spf13/afero/README.md @@ -0,0 +1,452 @@ +![afero logo-sm](https://cloud.githubusercontent.com/assets/173412/11490338/d50e16dc-97a5-11e5-8b12-019a300d0fcb.png) + +A FileSystem Abstraction System for Go + +[![Build Status](https://travis-ci.org/spf13/afero.svg)](https://travis-ci.org/spf13/afero) [![Build status](https://ci.appveyor.com/api/projects/status/github/spf13/afero?branch=master&svg=true)](https://ci.appveyor.com/project/spf13/afero) [![GoDoc](https://godoc.org/github.com/spf13/afero?status.svg)](https://godoc.org/github.com/spf13/afero) [![Join the chat at https://gitter.im/spf13/afero](https://badges.gitter.im/Dev%20Chat.svg)](https://gitter.im/spf13/afero?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +# Overview + +Afero is an filesystem framework providing a simple, uniform and universal API +interacting with any filesystem, as an abstraction layer providing interfaces, +types and methods. Afero has an exceptionally clean interface and simple design +without needless constructors or initialization methods. + +Afero is also a library providing a base set of interoperable backend +filesystems that make it easy to work with afero while retaining all the power +and benefit of the os and ioutil packages. + +Afero provides significant improvements over using the os package alone, most +notably the ability to create mock and testing filesystems without relying on the disk. + +It is suitable for use in a any situation where you would consider using the OS +package as it provides an additional abstraction that makes it easy to use a +memory backed file system during testing. It also adds support for the http +filesystem for full interoperability. + + +## Afero Features + +* A single consistent API for accessing a variety of filesystems +* Interoperation between a variety of file system types +* A set of interfaces to encourage and enforce interoperability between backends +* An atomic cross platform memory backed file system +* Support for compositional (union) file systems by combining multiple file systems acting as one +* Specialized backends which modify existing filesystems (Read Only, Regexp filtered) +* A set of utility functions ported from io, ioutil & hugo to be afero aware + + +# Using Afero + +Afero is easy to use and easier to adopt. + +A few different ways you could use Afero: + +* Use the interfaces alone to define you own file system. +* Wrap for the OS packages. +* Define different filesystems for different parts of your application. +* Use Afero for mock filesystems while testing + +## Step 1: Install Afero + +First use go get to install the latest version of the library. + + $ go get github.com/spf13/afero + +Next include Afero in your application. +```go +import "github.com/spf13/afero" +``` + +## Step 2: Declare a backend + +First define a package variable and set it to a pointer to a filesystem. +```go +var AppFs = afero.NewMemMapFs() + +or + +var AppFs = afero.NewOsFs() +``` +It is important to note that if you repeat the composite literal you +will be using a completely new and isolated filesystem. In the case of +OsFs it will still use the same underlying filesystem but will reduce +the ability to drop in other filesystems as desired. + +## Step 3: Use it like you would the OS package + +Throughout your application use any function and method like you normally +would. + +So if my application before had: +```go +os.Open('/tmp/foo') +``` +We would replace it with: +```go +AppFs.Open('/tmp/foo') +``` + +`AppFs` being the variable we defined above. + + +## List of all available functions + +File System Methods Available: +```go +Chmod(name string, mode os.FileMode) : error +Chtimes(name string, atime time.Time, mtime time.Time) : error +Create(name string) : File, error +Mkdir(name string, perm os.FileMode) : error +MkdirAll(path string, perm os.FileMode) : error +Name() : string +Open(name string) : File, error +OpenFile(name string, flag int, perm os.FileMode) : File, error +Remove(name string) : error +RemoveAll(path string) : error +Rename(oldname, newname string) : error +Stat(name string) : os.FileInfo, error +``` +File Interfaces and Methods Available: +```go +io.Closer +io.Reader +io.ReaderAt +io.Seeker +io.Writer +io.WriterAt + +Name() : string +Readdir(count int) : []os.FileInfo, error +Readdirnames(n int) : []string, error +Stat() : os.FileInfo, error +Sync() : error +Truncate(size int64) : error +WriteString(s string) : ret int, err error +``` +In some applications it may make sense to define a new package that +simply exports the file system variable for easy access from anywhere. + +## Using Afero's utility functions + +Afero provides a set of functions to make it easier to use the underlying file systems. +These functions have been primarily ported from io & ioutil with some developed for Hugo. + +The afero utilities support all afero compatible backends. + +The list of utilities includes: + +```go +DirExists(path string) (bool, error) +Exists(path string) (bool, error) +FileContainsBytes(filename string, subslice []byte) (bool, error) +GetTempDir(subPath string) string +IsDir(path string) (bool, error) +IsEmpty(path string) (bool, error) +ReadDir(dirname string) ([]os.FileInfo, error) +ReadFile(filename string) ([]byte, error) +SafeWriteReader(path string, r io.Reader) (err error) +TempDir(dir, prefix string) (name string, err error) +TempFile(dir, prefix string) (f File, err error) +Walk(root string, walkFn filepath.WalkFunc) error +WriteFile(filename string, data []byte, perm os.FileMode) error +WriteReader(path string, r io.Reader) (err error) +``` +For a complete list see [Afero's GoDoc](https://godoc.org/github.com/spf13/afero) + +They are available under two different approaches to use. You can either call +them directly where the first parameter of each function will be the file +system, or you can declare a new `Afero`, a custom type used to bind these +functions as methods to a given filesystem. + +### Calling utilities directly + +```go +fs := new(afero.MemMapFs) +f, err := afero.TempFile(fs,"", "ioutil-test") + +``` + +### Calling via Afero + +```go +fs := afero.NewMemMapFs() +afs := &afero.Afero{Fs: fs} +f, err := afs.TempFile("", "ioutil-test") +``` + +## Using Afero for Testing + +There is a large benefit to using a mock filesystem for testing. It has a +completely blank state every time it is initialized and can be easily +reproducible regardless of OS. You could create files to your heart’s content +and the file access would be fast while also saving you from all the annoying +issues with deleting temporary files, Windows file locking, etc. The MemMapFs +backend is perfect for testing. + +* Much faster than performing I/O operations on disk +* Avoid security issues and permissions +* Far more control. 'rm -rf /' with confidence +* Test setup is far more easier to do +* No test cleanup needed + +One way to accomplish this is to define a variable as mentioned above. +In your application this will be set to afero.NewOsFs() during testing you +can set it to afero.NewMemMapFs(). + +It wouldn't be uncommon to have each test initialize a blank slate memory +backend. To do this I would define my `appFS = afero.NewOsFs()` somewhere +appropriate in my application code. This approach ensures that Tests are order +independent, with no test relying on the state left by an earlier test. + +Then in my tests I would initialize a new MemMapFs for each test: +```go +func TestExist(t *testing.T) { + appFS := afero.NewMemMapFs() + // create test files and directories + appFS.MkdirAll("src/a", 0755) + afero.WriteFile(appFS, "src/a/b", []byte("file b"), 0644) + afero.WriteFile(appFS, "src/c", []byte("file c"), 0644) + name := "src/c" + _, err := appFS.Stat(name) + if os.IsNotExist(err) { + t.Errorf("file \"%s\" does not exist.\n", name) + } +} +``` + +# Available Backends + +## Operating System Native + +### OsFs + +The first is simply a wrapper around the native OS calls. This makes it +very easy to use as all of the calls are the same as the existing OS +calls. It also makes it trivial to have your code use the OS during +operation and a mock filesystem during testing or as needed. + +```go +appfs := afero.NewOsFs() +appfs.MkdirAll("src/a", 0755)) +``` + +## Memory Backed Storage + +### MemMapFs + +Afero also provides a fully atomic memory backed filesystem perfect for use in +mocking and to speed up unnecessary disk io when persistence isn’t +necessary. It is fully concurrent and will work within go routines +safely. + +```go +mm := afero.NewMemMapFs() +mm.MkdirAll("src/a", 0755)) +``` + +#### InMemoryFile + +As part of MemMapFs, Afero also provides an atomic, fully concurrent memory +backed file implementation. This can be used in other memory backed file +systems with ease. Plans are to add a radix tree memory stored file +system using InMemoryFile. + +## Network Interfaces + +### SftpFs + +Afero has experimental support for secure file transfer protocol (sftp). Which can +be used to perform file operations over a encrypted channel. + +## Filtering Backends + +### BasePathFs + +The BasePathFs restricts all operations to a given path within an Fs. +The given file name to the operations on this Fs will be prepended with +the base path before calling the source Fs. + +```go +bp := afero.NewBasePathFs(afero.NewOsFs(), "/base/path") +``` + +### ReadOnlyFs + +A thin wrapper around the source Fs providing a read only view. + +```go +fs := afero.NewReadOnlyFs(afero.NewOsFs()) +_, err := fs.Create("/file.txt") +// err = syscall.EPERM +``` + +# RegexpFs + +A filtered view on file names, any file NOT matching +the passed regexp will be treated as non-existing. +Files not matching the regexp provided will not be created. +Directories are not filtered. + +```go +fs := afero.NewRegexpFs(afero.NewMemMapFs(), regexp.MustCompile(`\.txt$`)) +_, err := fs.Create("/file.html") +// err = syscall.ENOENT +``` + +### HttpFs + +Afero provides an http compatible backend which can wrap any of the existing +backends. + +The Http package requires a slightly specific version of Open which +returns an http.File type. + +Afero provides an httpFs file system which satisfies this requirement. +Any Afero FileSystem can be used as an httpFs. + +```go +httpFs := afero.NewHttpFs() +fileserver := http.FileServer(httpFs.Dir())) +http.Handle("/", fileserver) +``` + +## Composite Backends + +Afero provides the ability have two filesystems (or more) act as a single +file system. + +### CacheOnReadFs + +The CacheOnReadFs will lazily make copies of any accessed files from the base +layer into the overlay. Subsequent reads will be pulled from the overlay +directly permitting the request is within the cache duration of when it was +created in the overlay. + +If the base filesystem is writeable, any changes to files will be +done first to the base, then to the overlay layer. Write calls to open file +handles like `Write()` or `Truncate()` to the overlay first. + +To writing files to the overlay only, you can use the overlay Fs directly (not +via the union Fs). + +Cache files in the layer for the given time.Duration, a cache duration of 0 +means "forever" meaning the file will not be re-requested from the base ever. + +A read-only base will make the overlay also read-only but still copy files +from the base to the overlay when they're not present (or outdated) in the +caching layer. + +```go +base := afero.NewOsFs() +layer := afero.NewMemMapFs() +ufs := afero.NewCacheOnReadFs(base, layer, 100 * time.Second) +``` + +### CopyOnWriteFs() + +The CopyOnWriteFs is a read only base file system with a potentially +writeable layer on top. + +Read operations will first look in the overlay and if not found there, will +serve the file from the base. + +Changes to the file system will only be made in the overlay. + +Any attempt to modify a file found only in the base will copy the file to the +overlay layer before modification (including opening a file with a writable +handle). + +Removing and Renaming files present only in the base layer is not currently +permitted. If a file is present in the base layer and the overlay, only the +overlay will be removed/renamed. + +```go + base := afero.NewOsFs() + roBase := afero.NewReadOnlyFs(base) + ufs := afero.NewCopyOnWriteFs(roBase, afero.NewMemMapFs()) + + fh, _ = ufs.Create("/home/test/file2.txt") + fh.WriteString("This is a test") + fh.Close() +``` + +In this example all write operations will only occur in memory (MemMapFs) +leaving the base filesystem (OsFs) untouched. + + +## Desired/possible backends + +The following is a short list of possible backends we hope someone will +implement: + +* SSH +* ZIP +* TAR +* S3 + +# About the project + +## What's in the name + +Afero comes from the latin roots Ad-Facere. + +**"Ad"** is a prefix meaning "to". + +**"Facere"** is a form of the root "faciō" making "make or do". + +The literal meaning of afero is "to make" or "to do" which seems very fitting +for a library that allows one to make files and directories and do things with them. + +The English word that shares the same roots as Afero is "affair". Affair shares +the same concept but as a noun it means "something that is made or done" or "an +object of a particular type". + +It's also nice that unlike some of my other libraries (hugo, cobra, viper) it +Googles very well. + +## Release Notes + +* **0.10.0** 2015.12.10 + * Full compatibility with Windows + * Introduction of afero utilities + * Test suite rewritten to work cross platform + * Normalize paths for MemMapFs + * Adding Sync to the file interface + * **Breaking Change** Walk and ReadDir have changed parameter order + * Moving types used by MemMapFs to a subpackage + * General bugfixes and improvements +* **0.9.0** 2015.11.05 + * New Walk function similar to filepath.Walk + * MemMapFs.OpenFile handles O_CREATE, O_APPEND, O_TRUNC + * MemMapFs.Remove now really deletes the file + * InMemoryFile.Readdir and Readdirnames work correctly + * InMemoryFile functions lock it for concurrent access + * Test suite improvements +* **0.8.0** 2014.10.28 + * First public version + * Interfaces feel ready for people to build using + * Interfaces satisfy all known uses + * MemMapFs passes the majority of the OS test suite + * OsFs passes the majority of the OS test suite + +## Contributing + +1. Fork it +2. Create your feature branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am 'Add some feature'`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create new Pull Request + +## Contributors + +Names in no particular order: + +* [spf13](https://github.com/spf13) +* [jaqx0r](https://github.com/jaqx0r) +* [mbertschler](https://github.com/mbertschler) +* [xor-gate](https://github.com/xor-gate) + +## License + +Afero is released under the Apache 2.0 license. See +[LICENSE.txt](https://github.com/spf13/afero/blob/master/LICENSE.txt) diff --git a/vendor/github.com/spf13/afero/appveyor.yml b/vendor/github.com/spf13/afero/appveyor.yml new file mode 100644 index 00000000..a633ad50 --- /dev/null +++ b/vendor/github.com/spf13/afero/appveyor.yml @@ -0,0 +1,15 @@ +version: '{build}' +clone_folder: C:\gopath\src\github.com\spf13\afero +environment: + GOPATH: C:\gopath +build_script: +- cmd: >- + go version + + go env + + go get -v github.com/spf13/afero/... + + go build github.com/spf13/afero +test_script: +- cmd: go test -race -v github.com/spf13/afero/... diff --git a/vendor/github.com/spf13/afero/sftpfs/file.go b/vendor/github.com/spf13/afero/sftpfs/file.go deleted file mode 100644 index e4ccb55c..00000000 --- a/vendor/github.com/spf13/afero/sftpfs/file.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright © 2015 Jerry Jacobs . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sftpfs - -import ( - "github.com/pkg/sftp" - "os" -) - -type File struct { - fd *sftp.File -} - -func FileOpen(s *sftp.Client, name string) (*File, error) { - fd, err := s.Open(name) - if err != nil { - return &File{}, err - } - return &File{fd: fd}, nil -} - -func FileCreate(s *sftp.Client, name string) (*File, error) { - fd, err := s.Create(name) - if err != nil { - return &File{}, err - } - return &File{fd: fd}, nil -} - -func (f *File) Close() error { - return f.fd.Close() -} - -func (f *File) Name() string { - return f.fd.Name() -} - -func (f *File) Stat() (os.FileInfo, error) { - return f.fd.Stat() -} - -func (f *File) Sync() error { - return nil -} - -func (f *File) Truncate(size int64) error { - return f.fd.Truncate(size) -} - -func (f *File) Read(b []byte) (n int, err error) { - return f.fd.Read(b) -} - -// TODO -func (f *File) ReadAt(b []byte, off int64) (n int, err error) { - return 0, nil -} - -// TODO -func (f *File) Readdir(count int) (res []os.FileInfo, err error) { - return nil, nil -} - -// TODO -func (f *File) Readdirnames(n int) (names []string, err error) { - return nil, nil -} - -func (f *File) Seek(offset int64, whence int) (int64, error) { - return f.fd.Seek(offset, whence) -} - -func (f *File) Write(b []byte) (n int, err error) { - return f.fd.Write(b) -} - -// TODO -func (f *File) WriteAt(b []byte, off int64) (n int, err error) { - return 0, nil -} - -func (f *File) WriteString(s string) (ret int, err error) { - return f.fd.Write([]byte(s)) -} diff --git a/vendor/github.com/spf13/afero/sftpfs/sftp.go b/vendor/github.com/spf13/afero/sftpfs/sftp.go deleted file mode 100644 index 28721da7..00000000 --- a/vendor/github.com/spf13/afero/sftpfs/sftp.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright © 2015 Jerry Jacobs . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sftpfs - -import ( - "os" - "time" - - "github.com/pkg/sftp" - "github.com/spf13/afero" -) - -// Fs is a afero.Fs implementation that uses functions provided by the sftp package. -// -// For details in any method, check the documentation of the sftp package -// (github.com/pkg/sftp). -type Fs struct { - client *sftp.Client -} - -func New(client *sftp.Client) afero.Fs { - return &Fs{client: client} -} - -func (s Fs) Name() string { return "sftpfs" } - -func (s Fs) Create(name string) (afero.File, error) { - return FileCreate(s.client, name) -} - -func (s Fs) Mkdir(name string, perm os.FileMode) error { - err := s.client.Mkdir(name) - if err != nil { - return err - } - return s.client.Chmod(name, perm) -} - -func (s Fs) MkdirAll(path string, perm os.FileMode) error { - // Fast path: if we can tell whether path is a directory or file, stop with success or error. - dir, err := s.Stat(path) - if err == nil { - if dir.IsDir() { - return nil - } - return err - } - - // Slow path: make sure parent exists and then call Mkdir for path. - i := len(path) - for i > 0 && os.IsPathSeparator(path[i-1]) { // Skip trailing path separator. - i-- - } - - j := i - for j > 0 && !os.IsPathSeparator(path[j-1]) { // Scan backward over element. - j-- - } - - if j > 1 { - // Create parent - err = s.MkdirAll(path[0:j-1], perm) - if err != nil { - return err - } - } - - // Parent now exists; invoke Mkdir and use its result. - err = s.Mkdir(path, perm) - if err != nil { - // Handle arguments like "foo/." by - // double-checking that directory doesn't exist. - dir, err1 := s.Lstat(path) - if err1 == nil && dir.IsDir() { - return nil - } - return err - } - return nil -} - -func (s Fs) Open(name string) (afero.File, error) { - return FileOpen(s.client, name) -} - -func (s Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) { - return nil, nil -} - -func (s Fs) Remove(name string) error { - return s.client.Remove(name) -} - -func (s Fs) RemoveAll(path string) error { - // TODO have a look at os.RemoveAll - // https://github.com/golang/go/blob/master/src/os/path.go#L66 - return nil -} - -func (s Fs) Rename(oldname, newname string) error { - return s.client.Rename(oldname, newname) -} - -func (s Fs) Stat(name string) (os.FileInfo, error) { - return s.client.Stat(name) -} - -func (s Fs) Lstat(p string) (os.FileInfo, error) { - return s.client.Lstat(p) -} - -func (s Fs) Chmod(name string, mode os.FileMode) error { - return s.client.Chmod(name, mode) -} - -func (s Fs) Chtimes(name string, atime time.Time, mtime time.Time) error { - return s.client.Chtimes(name, atime, mtime) -} diff --git a/vendor/github.com/spf13/cast/.gitignore b/vendor/github.com/spf13/cast/.gitignore new file mode 100644 index 00000000..53053a8a --- /dev/null +++ b/vendor/github.com/spf13/cast/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test + +*.bench diff --git a/vendor/github.com/spf13/cast/.travis.yml b/vendor/github.com/spf13/cast/.travis.yml new file mode 100644 index 00000000..4da97668 --- /dev/null +++ b/vendor/github.com/spf13/cast/.travis.yml @@ -0,0 +1,14 @@ +language: go +sudo: required +go: + - 1.7.5 + - 1.8 + - tip +os: + - linux +matrix: + allow_failures: + - go: tip + fast_finish: true +script: + - make check diff --git a/vendor/github.com/spf13/cast/Makefile b/vendor/github.com/spf13/cast/Makefile new file mode 100644 index 00000000..7ccf8930 --- /dev/null +++ b/vendor/github.com/spf13/cast/Makefile @@ -0,0 +1,38 @@ +# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html + +.PHONY: check fmt lint test test-race vet test-cover-html help +.DEFAULT_GOAL := help + +check: test-race fmt vet lint ## Run tests and linters + +test: ## Run tests + go test ./... + +test-race: ## Run tests with race detector + go test -race ./... + +fmt: ## Run gofmt linter + @for d in `go list` ; do \ + if [ "`gofmt -l -s $$GOPATH/src/$$d | tee /dev/stderr`" ]; then \ + echo "^ improperly formatted go files" && echo && exit 1; \ + fi \ + done + +lint: ## Run golint linter + @for d in `go list` ; do \ + if [ "`golint $$d | tee /dev/stderr`" ]; then \ + echo "^ golint errors!" && echo && exit 1; \ + fi \ + done + +vet: ## Run go vet linter + @if [ "`go vet | tee /dev/stderr`" ]; then \ + echo "^ go vet errors!" && echo && exit 1; \ + fi + +test-cover-html: ## Generate test coverage report + go test -coverprofile=coverage.out -covermode=count + go tool cover -func=coverage.out + +help: + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/vendor/github.com/spf13/cast/README.md b/vendor/github.com/spf13/cast/README.md new file mode 100644 index 00000000..e6939397 --- /dev/null +++ b/vendor/github.com/spf13/cast/README.md @@ -0,0 +1,75 @@ +cast +==== +[![GoDoc](https://godoc.org/github.com/spf13/cast?status.svg)](https://godoc.org/github.com/spf13/cast) +[![Build Status](https://api.travis-ci.org/spf13/cast.svg?branch=master)](https://travis-ci.org/spf13/cast) +[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cast)](https://goreportcard.com/report/github.com/spf13/cast) + +Easy and safe casting from one type to another in Go + +Don’t Panic! ... Cast + +## What is Cast? + +Cast is a library to convert between different go types in a consistent and easy way. + +Cast provides simple functions to easily convert a number to a string, an +interface into a bool, etc. Cast does this intelligently when an obvious +conversion is possible. It doesn’t make any attempts to guess what you meant, +for example you can only convert a string to an int when it is a string +representation of an int such as “8”. Cast was developed for use in +[Hugo](http://hugo.spf13.com), a website engine which uses YAML, TOML or JSON +for meta data. + +## Why use Cast? + +When working with dynamic data in Go you often need to cast or convert the data +from one type into another. Cast goes beyond just using type assertion (though +it uses that when possible) to provide a very straightforward and convenient +library. + +If you are working with interfaces to handle things like dynamic content +you’ll need an easy way to convert an interface into a given type. This +is the library for you. + +If you are taking in data from YAML, TOML or JSON or other formats which lack +full types, then Cast is the library for you. + +## Usage + +Cast provides a handful of To_____ methods. These methods will always return +the desired type. **If input is provided that will not convert to that type, the +0 or nil value for that type will be returned**. + +Cast also provides identical methods To_____E. These return the same result as +the To_____ methods, plus an additional error which tells you if it successfully +converted. Using these methods you can tell the difference between when the +input matched the zero value or when the conversion failed and the zero value +was returned. + +The following examples are merely a sample of what is available. Please review +the code for a complete set. + +### Example ‘ToString’: + + cast.ToString("mayonegg") // "mayonegg" + cast.ToString(8) // "8" + cast.ToString(8.31) // "8.31" + cast.ToString([]byte("one time")) // "one time" + cast.ToString(nil) // "" + + var foo interface{} = "one more time" + cast.ToString(foo) // "one more time" + + +### Example ‘ToInt’: + + cast.ToInt(8) // 8 + cast.ToInt(8.31) // 8 + cast.ToInt("8") // 8 + cast.ToInt(true) // 1 + cast.ToInt(false) // 0 + + var eight interface{} = 8 + cast.ToInt(eight) // 8 + cast.ToInt(nil) // 0 + diff --git a/vendor/github.com/spf13/jwalterweatherman/.gitignore b/vendor/github.com/spf13/jwalterweatherman/.gitignore new file mode 100644 index 00000000..00268614 --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe diff --git a/vendor/github.com/spf13/jwalterweatherman/README.md b/vendor/github.com/spf13/jwalterweatherman/README.md new file mode 100644 index 00000000..d8cfd27a --- /dev/null +++ b/vendor/github.com/spf13/jwalterweatherman/README.md @@ -0,0 +1,148 @@ +jWalterWeatherman +================= + +Seamless printing to the terminal (stdout) and logging to a io.Writer +(file) that’s as easy to use as fmt.Println. + +![and_that__s_why_you_always_leave_a_note_by_jonnyetc-d57q7um](https://cloud.githubusercontent.com/assets/173412/11002937/ccd01654-847d-11e5-828e-12ebaf582eaf.jpg) +Graphic by [JonnyEtc](http://jonnyetc.deviantart.com/art/And-That-s-Why-You-Always-Leave-a-Note-315311422) + +JWW is primarily a wrapper around the excellent standard log library. It +provides a few advantages over using the standard log library alone. + +1. Ready to go out of the box. +2. One library for both printing to the terminal and logging (to files). +3. Really easy to log to either a temp file or a file you specify. + + +I really wanted a very straightforward library that could seamlessly do +the following things. + +1. Replace all the println, printf, etc statements thought my code with + something more useful +2. Allow the user to easily control what levels are printed to stdout +3. Allow the user to easily control what levels are logged +4. Provide an easy mechanism (like fmt.Println) to print info to the user + which can be easily logged as well +5. Due to 2 & 3 provide easy verbose mode for output and logs +6. Not have any unnecessary initialization cruft. Just use it. + +# Usage + +## Step 1. Use it +Put calls throughout your source based on type of feedback. +No initialization or setup needs to happen. Just start calling things. + +Available Loggers are: + + * TRACE + * DEBUG + * INFO + * WARN + * ERROR + * CRITICAL + * FATAL + +These each are loggers based on the log standard library and follow the +standard usage. Eg. + +```go + import ( + jww "github.com/spf13/jwalterweatherman" + ) + + ... + + if err != nil { + + // This is a pretty serious error and the user should know about + // it. It will be printed to the terminal as well as logged under the + // default thresholds. + + jww.ERROR.Println(err) + } + + if err2 != nil { + // This error isn’t going to materially change the behavior of the + // application, but it’s something that may not be what the user + // expects. Under the default thresholds, Warn will be logged, but + // not printed to the terminal. + + jww.WARN.Println(err2) + } + + // Information that’s relevant to what’s happening, but not very + // important for the user. Under the default thresholds this will be + // discarded. + + jww.INFO.Printf("information %q", response) + +``` + +NOTE: You can also use the library in a non-global setting by creating an instance of a Notebook: + +```go +notepad = jww.NewNotepad(jww.LevelInfo, jww.LevelTrace, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime) +notepad.WARN.Println("Some warning"") +``` + +_Why 7 levels?_ + +Maybe you think that 7 levels are too much for any application... and you +are probably correct. Just because there are seven levels doesn’t mean +that you should be using all 7 levels. Pick the right set for your needs. +Remember they only have to mean something to your project. + +## Step 2. Optionally configure JWW + +Under the default thresholds : + + * Debug, Trace & Info goto /dev/null + * Warn and above is logged (when a log file/io.Writer is provided) + * Error and above is printed to the terminal (stdout) + +### Changing the thresholds + +The threshold can be changed at any time, but will only affect calls that +execute after the change was made. + +This is very useful if your application has a verbose mode. Of course you +can decide what verbose means to you or even have multiple levels of +verbosity. + + +```go + import ( + jww "github.com/spf13/jwalterweatherman" + ) + + if Verbose { + jww.SetLogThreshold(jww.LevelTrace) + jww.SetStdoutThreshold(jww.LevelInfo) + } +``` + +Note that JWW's own internal output uses log levels as well, so set the log +level before making any other calls if you want to see what it's up to. + + +### Setting a log file + +JWW can log to any `io.Writer`: + + +```go + + jww.SetLogOutput(customWriter) + +``` + + +# More information + +This is an early release. I’ve been using it for a while and this is the +third interface I’ve tried. I like this one pretty well, but no guarantees +that it won’t change a bit. + +I wrote this for use in [hugo](https://gohugo.io). If you are looking +for a static website engine that’s super fast please checkout Hugo. diff --git a/vendor/github.com/spf13/pflag/.gitignore b/vendor/github.com/spf13/pflag/.gitignore new file mode 100644 index 00000000..c3da2901 --- /dev/null +++ b/vendor/github.com/spf13/pflag/.gitignore @@ -0,0 +1,2 @@ +.idea/* + diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml new file mode 100644 index 00000000..f8a63b30 --- /dev/null +++ b/vendor/github.com/spf13/pflag/.travis.yml @@ -0,0 +1,21 @@ +sudo: false + +language: go + +go: + - 1.7.3 + - 1.8.1 + - tip + +matrix: + allow_failures: + - go: tip + +install: + - go get github.com/golang/lint/golint + - export PATH=$GOPATH/bin:$PATH + - go install ./... + +script: + - verify/all.sh -v + - go test ./... diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md new file mode 100644 index 00000000..b052414d --- /dev/null +++ b/vendor/github.com/spf13/pflag/README.md @@ -0,0 +1,296 @@ +[![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) +[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag) +[![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag) + +## Description + +pflag is a drop-in replacement for Go's flag package, implementing +POSIX/GNU-style --flags. + +pflag is compatible with the [GNU extensions to the POSIX recommendations +for command-line options][1]. For a more precise description, see the +"Command-line flag syntax" section below. + +[1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html + +pflag is available under the same style of BSD license as the Go language, +which can be found in the LICENSE file. + +## Installation + +pflag is available using the standard `go get` command. + +Install by running: + + go get github.com/spf13/pflag + +Run tests by running: + + go test github.com/spf13/pflag + +## Usage + +pflag is a drop-in replacement of Go's native flag package. If you import +pflag under the name "flag" then all code should continue to function +with no changes. + +``` go +import flag "github.com/spf13/pflag" +``` + +There is one exception to this: if you directly instantiate the Flag struct +there is one more field "Shorthand" that you will need to set. +Most code never instantiates this struct directly, and instead uses +functions such as String(), BoolVar(), and Var(), and is therefore +unaffected. + +Define flags using flag.String(), Bool(), Int(), etc. + +This declares an integer flag, -flagname, stored in the pointer ip, with type *int. + +``` go +var ip *int = flag.Int("flagname", 1234, "help message for flagname") +``` + +If you like, you can bind the flag to a variable using the Var() functions. + +``` go +var flagvar int +func init() { + flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") +} +``` + +Or you can create custom flags that satisfy the Value interface (with +pointer receivers) and couple them to flag parsing by + +``` go +flag.Var(&flagVal, "name", "help message for flagname") +``` + +For such flags, the default value is just the initial value of the variable. + +After all flags are defined, call + +``` go +flag.Parse() +``` + +to parse the command line into the defined flags. + +Flags may then be used directly. If you're using the flags themselves, +they are all pointers; if you bind to variables, they're values. + +``` go +fmt.Println("ip has value ", *ip) +fmt.Println("flagvar has value ", flagvar) +``` + +There are helpers function to get values later if you have the FlagSet but +it was difficult to keep up with all of the flag pointers in your code. +If you have a pflag.FlagSet with a flag called 'flagname' of type int you +can use GetInt() to get the int value. But notice that 'flagname' must exist +and it must be an int. GetString("flagname") will fail. + +``` go +i, err := flagset.GetInt("flagname") +``` + +After parsing, the arguments after the flag are available as the +slice flag.Args() or individually as flag.Arg(i). +The arguments are indexed from 0 through flag.NArg()-1. + +The pflag package also defines some new functions that are not in flag, +that give one-letter shorthands for flags. You can use these by appending +'P' to the name of any function that defines a flag. + +``` go +var ip = flag.IntP("flagname", "f", 1234, "help message") +var flagvar bool +func init() { + flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") +} +flag.VarP(&flagVal, "varname", "v", "help message") +``` + +Shorthand letters can be used with single dashes on the command line. +Boolean shorthand flags can be combined with other shorthand flags. + +The default set of command-line flags is controlled by +top-level functions. The FlagSet type allows one to define +independent sets of flags, such as to implement subcommands +in a command-line interface. The methods of FlagSet are +analogous to the top-level functions for the command-line +flag set. + +## Setting no option default values for flags + +After you create a flag it is possible to set the pflag.NoOptDefVal for +the given flag. Doing this changes the meaning of the flag slightly. If +a flag has a NoOptDefVal and the flag is set on the command line without +an option the flag will be set to the NoOptDefVal. For example given: + +``` go +var ip = flag.IntP("flagname", "f", 1234, "help message") +flag.Lookup("flagname").NoOptDefVal = "4321" +``` + +Would result in something like + +| Parsed Arguments | Resulting Value | +| ------------- | ------------- | +| --flagname=1357 | ip=1357 | +| --flagname | ip=4321 | +| [nothing] | ip=1234 | + +## Command line flag syntax + +``` +--flag // boolean flags, or flags with no option default values +--flag x // only on flags without a default value +--flag=x +``` + +Unlike the flag package, a single dash before an option means something +different than a double dash. Single dashes signify a series of shorthand +letters for flags. All but the last shorthand letter must be boolean flags +or a flag with a default value + +``` +// boolean or flags where the 'no option default value' is set +-f +-f=true +-abc +but +-b true is INVALID + +// non-boolean and flags without a 'no option default value' +-n 1234 +-n=1234 +-n1234 + +// mixed +-abcs "hello" +-absd="hello" +-abcs1234 +``` + +Flag parsing stops after the terminator "--". Unlike the flag package, +flags can be interspersed with arguments anywhere on the command line +before this terminator. + +Integer flags accept 1234, 0664, 0x1234 and may be negative. +Boolean flags (in their long form) accept 1, 0, t, f, true, false, +TRUE, FALSE, True, False. +Duration flags accept any input valid for time.ParseDuration. + +## Mutating or "Normalizing" Flag names + +It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow. + +**Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag + +``` go +func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + from := []string{"-", "_"} + to := "." + for _, sep := range from { + name = strings.Replace(name, sep, to, -1) + } + return pflag.NormalizedName(name) +} + +myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc) +``` + +**Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name + +``` go +func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + switch name { + case "old-flag-name": + name = "new-flag-name" + break + } + return pflag.NormalizedName(name) +} + +myFlagSet.SetNormalizeFunc(aliasNormalizeFunc) +``` + +## Deprecating a flag or its shorthand +It is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used. + +**Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead. +```go +// deprecate a flag by specifying its name and a usage message +flags.MarkDeprecated("badflag", "please use --good-flag instead") +``` +This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used. + +**Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n". +```go +// deprecate a flag shorthand by specifying its flag name and a usage message +flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only") +``` +This hides the shortname "n" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand "n" is used. + +Note that usage message is essential here, and it should not be empty. + +## Hidden flags +It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text. + +**Example**: You have a flag named "secretFlag" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available. +```go +// hide a flag by specifying its name +flags.MarkHidden("secretFlag") +``` + +## Disable sorting of flags +`pflag` allows you to disable sorting of flags for help and usage message. + +**Example**: +```go +flags.BoolP("verbose", "v", false, "verbose output") +flags.String("coolflag", "yeaah", "it's really cool flag") +flags.Int("usefulflag", 777, "sometimes it's very useful") +flags.SortFlags = false +flags.PrintDefaults() +``` +**Output**: +``` + -v, --verbose verbose output + --coolflag string it's really cool flag (default "yeaah") + --usefulflag int sometimes it's very useful (default 777) +``` + + +## Supporting Go flags when using pflag +In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary +to support flags defined by third-party dependencies (e.g. `golang/glog`). + +**Example**: You want to add the Go flags to the `CommandLine` flagset +```go +import ( + goflag "flag" + flag "github.com/spf13/pflag" +) + +var ip *int = flag.Int("flagname", 1234, "help message for flagname") + +func main() { + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) + flag.Parse() +} +``` + +## More info + +You can see the full reference documentation of the pflag package +[at godoc.org][3], or through go's standard documentation system by +running `godoc -http=:6060` and browsing to +[http://localhost:6060/pkg/github.com/spf13/pflag][2] after +installation. + +[2]: http://localhost:6060/pkg/github.com/spf13/pflag +[3]: http://godoc.org/github.com/spf13/pflag diff --git a/vendor/github.com/spf13/viper/.gitignore b/vendor/github.com/spf13/viper/.gitignore new file mode 100644 index 00000000..352a34a5 --- /dev/null +++ b/vendor/github.com/spf13/viper/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.bench \ No newline at end of file diff --git a/vendor/github.com/spf13/viper/.travis.yml b/vendor/github.com/spf13/viper/.travis.yml new file mode 100644 index 00000000..55960d11 --- /dev/null +++ b/vendor/github.com/spf13/viper/.travis.yml @@ -0,0 +1,28 @@ +go_import_path: github.com/spf13/viper + +language: go +go: + - 1.7.x + - 1.8.x + - 1.9.x + - tip + +os: + - linux + - osx + +matrix: + allow_failures: + - go: tip + fast_finish: true + +script: + - go install ./... + - diff -u <(echo -n) <(gofmt -d .) + - go test -v ./... + +after_success: + - go get -u -d github.com/spf13/hugo + - cd $GOPATH/src/github.com/spf13/hugo && make && ./hugo -s docs && cd - + +sudo: false diff --git a/vendor/github.com/spf13/viper/README.md b/vendor/github.com/spf13/viper/README.md new file mode 100644 index 00000000..64bf4743 --- /dev/null +++ b/vendor/github.com/spf13/viper/README.md @@ -0,0 +1,643 @@ +![viper logo](https://cloud.githubusercontent.com/assets/173412/10886745/998df88a-8151-11e5-9448-4736db51020d.png) + +Go configuration with fangs! + +Many Go projects are built using Viper including: + +* [Hugo](http://gohugo.io) +* [EMC RexRay](http://rexray.readthedocs.org/en/stable/) +* [Imgur’s Incus](https://github.com/Imgur/incus) +* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) +* [Docker Notary](https://github.com/docker/Notary) +* [BloomApi](https://www.bloomapi.com/) +* [doctl](https://github.com/digitalocean/doctl) +* [Clairctl](https://github.com/jgsqware/clairctl) + +[![Build Status](https://travis-ci.org/spf13/viper.svg)](https://travis-ci.org/spf13/viper) [![Join the chat at https://gitter.im/spf13/viper](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/spf13/viper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GoDoc](https://godoc.org/github.com/spf13/viper?status.svg)](https://godoc.org/github.com/spf13/viper) + + +## What is Viper? + +Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed +to work within an application, and can handle all types of configuration needs +and formats. It supports: + +* setting defaults +* reading from JSON, TOML, YAML, HCL, and Java properties config files +* live watching and re-reading of config files (optional) +* reading from environment variables +* reading from remote config systems (etcd or Consul), and watching changes +* reading from command line flags +* reading from buffer +* setting explicit values + +Viper can be thought of as a registry for all of your applications +configuration needs. + +## Why Viper? + +When building a modern application, you don’t want to worry about +configuration file formats; you want to focus on building awesome software. +Viper is here to help with that. + +Viper does the following for you: + +1. Find, load, and unmarshal a configuration file in JSON, TOML, YAML, HCL, or Java properties formats. +2. Provide a mechanism to set default values for your different + configuration options. +3. Provide a mechanism to set override values for options specified through + command line flags. +4. Provide an alias system to easily rename parameters without breaking existing + code. +5. Make it easy to tell the difference between when a user has provided a + command line or config file which is the same as the default. + +Viper uses the following precedence order. Each item takes precedence over the +item below it: + + * explicit call to Set + * flag + * env + * config + * key/value store + * default + +Viper configuration keys are case insensitive. + +## Putting Values into Viper + +### Establishing Defaults + +A good configuration system will support default values. A default value is not +required for a key, but it’s useful in the event that a key hasn’t been set via +config file, environment variable, remote configuration or flag. + +Examples: + +```go +viper.SetDefault("ContentDir", "content") +viper.SetDefault("LayoutDir", "layouts") +viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"}) +``` + +### Reading Config Files + +Viper requires minimal configuration so it knows where to look for config files. +Viper supports JSON, TOML, YAML, HCL, and Java Properties files. Viper can search multiple paths, but +currently a single Viper instance only supports a single configuration file. +Viper does not default to any configuration search paths leaving defaults decision +to an application. + +Here is an example of how to use Viper to search for and read a configuration file. +None of the specific paths are required, but at least one path should be provided +where a configuration file is expected. + +```go +viper.SetConfigName("config") // name of config file (without extension) +viper.AddConfigPath("/etc/appname/") // path to look for the config file in +viper.AddConfigPath("$HOME/.appname") // call multiple times to add many search paths +viper.AddConfigPath(".") // optionally look for config in the working directory +err := viper.ReadInConfig() // Find and read the config file +if err != nil { // Handle errors reading the config file + panic(fmt.Errorf("Fatal error config file: %s \n", err)) +} +``` + +### Watching and re-reading config files + +Viper supports the ability to have your application live read a config file while running. + +Gone are the days of needing to restart a server to have a config take effect, +viper powered applications can read an update to a config file while running and +not miss a beat. + +Simply tell the viper instance to watchConfig. +Optionally you can provide a function for Viper to run each time a change occurs. + +**Make sure you add all of the configPaths prior to calling `WatchConfig()`** + +```go +viper.WatchConfig() +viper.OnConfigChange(func(e fsnotify.Event) { + fmt.Println("Config file changed:", e.Name) +}) +``` + +### Reading Config from io.Reader + +Viper predefines many configuration sources such as files, environment +variables, flags, and remote K/V store, but you are not bound to them. You can +also implement your own required configuration source and feed it to viper. + +```go +viper.SetConfigType("yaml") // or viper.SetConfigType("YAML") + +// any approach to require this configuration into your program. +var yamlExample = []byte(` +Hacker: true +name: steve +hobbies: +- skateboarding +- snowboarding +- go +clothing: + jacket: leather + trousers: denim +age: 35 +eyes : brown +beard: true +`) + +viper.ReadConfig(bytes.NewBuffer(yamlExample)) + +viper.Get("name") // this would be "steve" +``` + +### Setting Overrides + +These could be from a command line flag, or from your own application logic. + +```go +viper.Set("Verbose", true) +viper.Set("LogFile", LogFile) +``` + +### Registering and Using Aliases + +Aliases permit a single value to be referenced by multiple keys + +```go +viper.RegisterAlias("loud", "Verbose") + +viper.Set("verbose", true) // same result as next line +viper.Set("loud", true) // same result as prior line + +viper.GetBool("loud") // true +viper.GetBool("verbose") // true +``` + +### Working with Environment Variables + +Viper has full support for environment variables. This enables 12 factor +applications out of the box. There are four methods that exist to aid working +with ENV: + + * `AutomaticEnv()` + * `BindEnv(string...) : error` + * `SetEnvPrefix(string)` + * `SetEnvKeyReplacer(string...) *strings.Replacer` + +_When working with ENV variables, it’s important to recognize that Viper +treats ENV variables as case sensitive._ + +Viper provides a mechanism to try to ensure that ENV variables are unique. By +using `SetEnvPrefix`, you can tell Viper to use add a prefix while reading from +the environment variables. Both `BindEnv` and `AutomaticEnv` will use this +prefix. + +`BindEnv` takes one or two parameters. The first parameter is the key name, the +second is the name of the environment variable. The name of the environment +variable is case sensitive. If the ENV variable name is not provided, then +Viper will automatically assume that the key name matches the ENV variable name, +but the ENV variable is IN ALL CAPS. When you explicitly provide the ENV +variable name, it **does not** automatically add the prefix. + +One important thing to recognize when working with ENV variables is that the +value will be read each time it is accessed. Viper does not fix the value when +the `BindEnv` is called. + +`AutomaticEnv` is a powerful helper especially when combined with +`SetEnvPrefix`. When called, Viper will check for an environment variable any +time a `viper.Get` request is made. It will apply the following rules. It will +check for a environment variable with a name matching the key uppercased and +prefixed with the `EnvPrefix` if set. + +`SetEnvKeyReplacer` allows you to use a `strings.Replacer` object to rewrite Env +keys to an extent. This is useful if you want to use `-` or something in your +`Get()` calls, but want your environmental variables to use `_` delimiters. An +example of using it can be found in `viper_test.go`. + +#### Env example + +```go +SetEnvPrefix("spf") // will be uppercased automatically +BindEnv("id") + +os.Setenv("SPF_ID", "13") // typically done outside of the app + +id := Get("id") // 13 +``` + +### Working with Flags + +Viper has the ability to bind to flags. Specifically, Viper supports `Pflags` +as used in the [Cobra](https://github.com/spf13/cobra) library. + +Like `BindEnv`, the value is not set when the binding method is called, but when +it is accessed. This means you can bind as early as you want, even in an +`init()` function. + +For individual flags, the `BindPFlag()` method provides this functionality. + +Example: + +```go +serverCmd.Flags().Int("port", 1138, "Port to run Application server on") +viper.BindPFlag("port", serverCmd.Flags().Lookup("port")) +``` + +You can also bind an existing set of pflags (pflag.FlagSet): + +Example: + +```go +pflag.Int("flagname", 1234, "help message for flagname") + +pflag.Parse() +viper.BindPFlags(pflag.CommandLine) + +i := viper.GetInt("flagname") // retrieve values from viper instead of pflag +``` + +The use of [pflag](https://github.com/spf13/pflag/) in Viper does not preclude +the use of other packages that use the [flag](https://golang.org/pkg/flag/) +package from the standard library. The pflag package can handle the flags +defined for the flag package by importing these flags. This is accomplished +by a calling a convenience function provided by the pflag package called +AddGoFlagSet(). + +Example: + +```go +package main + +import ( + "flag" + "github.com/spf13/pflag" +) + +func main() { + + // using standard library "flag" package + flag.Int("flagname", 1234, "help message for flagname") + + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + viper.BindPFlags(pflag.CommandLine) + + i := viper.GetInt("flagname") // retrieve value from viper + + ... +} +``` + +#### Flag interfaces + +Viper provides two Go interfaces to bind other flag systems if you don’t use `Pflags`. + +`FlagValue` represents a single flag. This is a very simple example on how to implement this interface: + +```go +type myFlag struct {} +func (f myFlag) HasChanged() bool { return false } +func (f myFlag) Name() string { return "my-flag-name" } +func (f myFlag) ValueString() string { return "my-flag-value" } +func (f myFlag) ValueType() string { return "string" } +``` + +Once your flag implements this interface, you can simply tell Viper to bind it: + +```go +viper.BindFlagValue("my-flag-name", myFlag{}) +``` + +`FlagValueSet` represents a group of flags. This is a very simple example on how to implement this interface: + +```go +type myFlagSet struct { + flags []myFlag +} + +func (f myFlagSet) VisitAll(fn func(FlagValue)) { + for _, flag := range flags { + fn(flag) + } +} +``` + +Once your flag set implements this interface, you can simply tell Viper to bind it: + +```go +fSet := myFlagSet{ + flags: []myFlag{myFlag{}, myFlag{}}, +} +viper.BindFlagValues("my-flags", fSet) +``` + +### Remote Key/Value Store Support + +To enable remote support in Viper, do a blank import of the `viper/remote` +package: + +`import _ "github.com/spf13/viper/remote"` + +Viper will read a config string (as JSON, TOML, YAML or HCL) retrieved from a path +in a Key/Value store such as etcd or Consul. These values take precedence over +default values, but are overridden by configuration values retrieved from disk, +flags, or environment variables. + +Viper uses [crypt](https://github.com/xordataexchange/crypt) to retrieve +configuration from the K/V store, which means that you can store your +configuration values encrypted and have them automatically decrypted if you have +the correct gpg keyring. Encryption is optional. + +You can use remote configuration in conjunction with local configuration, or +independently of it. + +`crypt` has a command-line helper that you can use to put configurations in your +K/V store. `crypt` defaults to etcd on http://127.0.0.1:4001. + +```bash +$ go get github.com/xordataexchange/crypt/bin/crypt +$ crypt set -plaintext /config/hugo.json /Users/hugo/settings/config.json +``` + +Confirm that your value was set: + +```bash +$ crypt get -plaintext /config/hugo.json +``` + +See the `crypt` documentation for examples of how to set encrypted values, or +how to use Consul. + +### Remote Key/Value Store Example - Unencrypted + +```go +viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001","/config/hugo.json") +viper.SetConfigType("json") // because there is no file extension in a stream of bytes, supported extensions are "json", "toml", "yaml", "yml", "properties", "props", "prop" +err := viper.ReadRemoteConfig() +``` + +### Remote Key/Value Store Example - Encrypted + +```go +viper.AddSecureRemoteProvider("etcd","http://127.0.0.1:4001","/config/hugo.json","/etc/secrets/mykeyring.gpg") +viper.SetConfigType("json") // because there is no file extension in a stream of bytes, supported extensions are "json", "toml", "yaml", "yml", "properties", "props", "prop" +err := viper.ReadRemoteConfig() +``` + +### Watching Changes in etcd - Unencrypted + +```go +// alternatively, you can create a new viper instance. +var runtime_viper = viper.New() + +runtime_viper.AddRemoteProvider("etcd", "http://127.0.0.1:4001", "/config/hugo.yml") +runtime_viper.SetConfigType("yaml") // because there is no file extension in a stream of bytes, supported extensions are "json", "toml", "yaml", "yml", "properties", "props", "prop" + +// read from remote config the first time. +err := runtime_viper.ReadRemoteConfig() + +// unmarshal config +runtime_viper.Unmarshal(&runtime_conf) + +// open a goroutine to watch remote changes forever +go func(){ + for { + time.Sleep(time.Second * 5) // delay after each request + + // currently, only tested with etcd support + err := runtime_viper.WatchRemoteConfig() + if err != nil { + log.Errorf("unable to read remote config: %v", err) + continue + } + + // unmarshal new config into our runtime config struct. you can also use channel + // to implement a signal to notify the system of the changes + runtime_viper.Unmarshal(&runtime_conf) + } +}() +``` + +## Getting Values From Viper + +In Viper, there are a few ways to get a value depending on the value’s type. +The following functions and methods exist: + + * `Get(key string) : interface{}` + * `GetBool(key string) : bool` + * `GetFloat64(key string) : float64` + * `GetInt(key string) : int` + * `GetString(key string) : string` + * `GetStringMap(key string) : map[string]interface{}` + * `GetStringMapString(key string) : map[string]string` + * `GetStringSlice(key string) : []string` + * `GetTime(key string) : time.Time` + * `GetDuration(key string) : time.Duration` + * `IsSet(key string) : bool` + +One important thing to recognize is that each Get function will return a zero +value if it’s not found. To check if a given key exists, the `IsSet()` method +has been provided. + +Example: +```go +viper.GetString("logfile") // case-insensitive Setting & Getting +if viper.GetBool("verbose") { + fmt.Println("verbose enabled") +} +``` +### Accessing nested keys + +The accessor methods also accept formatted paths to deeply nested keys. For +example, if the following JSON file is loaded: + +```json +{ + "host": { + "address": "localhost", + "port": 5799 + }, + "datastore": { + "metric": { + "host": "127.0.0.1", + "port": 3099 + }, + "warehouse": { + "host": "198.0.0.1", + "port": 2112 + } + } +} + +``` + +Viper can access a nested field by passing a `.` delimited path of keys: + +```go +GetString("datastore.metric.host") // (returns "127.0.0.1") +``` + +This obeys the precedence rules established above; the search for the path +will cascade through the remaining configuration registries until found. + +For example, given this configuration file, both `datastore.metric.host` and +`datastore.metric.port` are already defined (and may be overridden). If in addition +`datastore.metric.protocol` was defined in the defaults, Viper would also find it. + +However, if `datastore.metric` was overridden (by a flag, an environment variable, +the `Set()` method, …) with an immediate value, then all sub-keys of +`datastore.metric` become undefined, they are “shadowed” by the higher-priority +configuration level. + +Lastly, if there exists a key that matches the delimited key path, its value +will be returned instead. E.g. + +```json +{ + "datastore.metric.host": "0.0.0.0", + "host": { + "address": "localhost", + "port": 5799 + }, + "datastore": { + "metric": { + "host": "127.0.0.1", + "port": 3099 + }, + "warehouse": { + "host": "198.0.0.1", + "port": 2112 + } + } +} + +GetString("datastore.metric.host") // returns "0.0.0.0" +``` + +### Extract sub-tree + +Extract sub-tree from Viper. + +For example, `viper` represents: + +```json +app: + cache1: + max-items: 100 + item-size: 64 + cache2: + max-items: 200 + item-size: 80 +``` + +After executing: + +```go +subv := viper.Sub("app.cache1") +``` + +`subv` represents: + +```json +max-items: 100 +item-size: 64 +``` + +Suppose we have: + +```go +func NewCache(cfg *Viper) *Cache {...} +``` + +which creates a cache based on config information formatted as `subv`. +Now it’s easy to create these 2 caches separately as: + +```go +cfg1 := viper.Sub("app.cache1") +cache1 := NewCache(cfg1) + +cfg2 := viper.Sub("app.cache2") +cache2 := NewCache(cfg2) +``` + +### Unmarshaling + +You also have the option of Unmarshaling all or a specific value to a struct, map, +etc. + +There are two methods to do this: + + * `Unmarshal(rawVal interface{}) : error` + * `UnmarshalKey(key string, rawVal interface{}) : error` + +Example: + +```go +type config struct { + Port int + Name string + PathMap string `mapstructure:"path_map"` +} + +var C config + +err := Unmarshal(&C) +if err != nil { + t.Fatalf("unable to decode into struct, %v", err) +} +``` + +## Viper or Vipers? + +Viper comes ready to use out of the box. There is no configuration or +initialization needed to begin using Viper. Since most applications will want +to use a single central repository for their configuration, the viper package +provides this. It is similar to a singleton. + +In all of the examples above, they demonstrate using viper in its singleton +style approach. + +### Working with multiple vipers + +You can also create many different vipers for use in your application. Each will +have its own unique set of configurations and values. Each can read from a +different config file, key value store, etc. All of the functions that viper +package supports are mirrored as methods on a viper. + +Example: + +```go +x := viper.New() +y := viper.New() + +x.SetDefault("ContentDir", "content") +y.SetDefault("ContentDir", "foobar") + +//... +``` + +When working with multiple vipers, it is up to the user to keep track of the +different vipers. + +## Q & A + +Q: Why not INI files? + +A: Ini files are pretty awful. There’s no standard format, and they are hard to +validate. Viper is designed to work with JSON, TOML or YAML files. If someone +really wants to add this feature, I’d be happy to merge it. It’s easy to specify +which formats your application will permit. + +Q: Why is it called “Viper”? + +A: Viper is designed to be a [companion](http://en.wikipedia.org/wiki/Viper_(G.I._Joe)) +to [Cobra](https://github.com/spf13/cobra). While both can operate completely +independently, together they make a powerful pair to handle much of your +application foundation needs. + +Q: Why is it called “Cobra”? + +A: Is there a better name for a [commander](http://en.wikipedia.org/wiki/Cobra_Commander)? diff --git a/vendor/github.com/spf13/viper/nohup.out b/vendor/github.com/spf13/viper/nohup.out new file mode 100644 index 00000000..8973bf27 --- /dev/null +++ b/vendor/github.com/spf13/viper/nohup.out @@ -0,0 +1 @@ +QProcess::start: Process is already running diff --git a/vendor/github.com/spf13/viper/remote/remote.go b/vendor/github.com/spf13/viper/remote/remote.go deleted file mode 100644 index 810d0702..00000000 --- a/vendor/github.com/spf13/viper/remote/remote.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file. - -// Package remote integrates the remote features of Viper. -package remote - -import ( - "bytes" - "io" - "os" - - "github.com/spf13/viper" - crypt "github.com/xordataexchange/crypt/config" -) - -type remoteConfigProvider struct{} - -func (rc remoteConfigProvider) Get(rp viper.RemoteProvider) (io.Reader, error) { - cm, err := getConfigManager(rp) - if err != nil { - return nil, err - } - b, err := cm.Get(rp.Path()) - if err != nil { - return nil, err - } - return bytes.NewReader(b), nil -} - -func (rc remoteConfigProvider) Watch(rp viper.RemoteProvider) (io.Reader, error) { - cm, err := getConfigManager(rp) - if err != nil { - return nil, err - } - resp, err := cm.Get(rp.Path()) - if err != nil { - return nil, err - } - - return bytes.NewReader(resp), nil -} - -func (rc remoteConfigProvider) WatchChannel(rp viper.RemoteProvider) (<-chan *viper.RemoteResponse, chan bool) { - cm, err := getConfigManager(rp) - if err != nil { - return nil, nil - } - quit := make(chan bool) - quitwc := make(chan bool) - viperResponsCh := make(chan *viper.RemoteResponse) - cryptoResponseCh := cm.Watch(rp.Path(), quit) - // need this function to convert the Channel response form crypt.Response to viper.Response - go func(cr <-chan *crypt.Response, vr chan<- *viper.RemoteResponse, quitwc <-chan bool, quit chan<- bool) { - for { - select { - case <-quitwc: - quit <- true - return - case resp := <-cr: - vr <- &viper.RemoteResponse{ - Error: resp.Error, - Value: resp.Value, - } - - } - - } - }(cryptoResponseCh, viperResponsCh, quitwc, quit) - - return viperResponsCh, quitwc -} - -func getConfigManager(rp viper.RemoteProvider) (crypt.ConfigManager, error) { - var cm crypt.ConfigManager - var err error - - if rp.SecretKeyring() != "" { - kr, err := os.Open(rp.SecretKeyring()) - defer kr.Close() - if err != nil { - return nil, err - } - if rp.Provider() == "etcd" { - cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr) - } else { - cm, err = crypt.NewConsulConfigManager([]string{rp.Endpoint()}, kr) - } - } else { - if rp.Provider() == "etcd" { - cm, err = crypt.NewStandardEtcdConfigManager([]string{rp.Endpoint()}) - } else { - cm, err = crypt.NewStandardConsulConfigManager([]string{rp.Endpoint()}) - } - } - if err != nil { - return nil, err - } - return cm, nil -} - -func init() { - viper.RemoteConfig = &remoteConfigProvider{} -} diff --git a/vendor/github.com/stretchr/testify/LICENSE b/vendor/github.com/stretchr/testify/LICENSE new file mode 100644 index 00000000..473b670a --- /dev/null +++ b/vendor/github.com/stretchr/testify/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell + +Please consider promoting this project if you find it useful. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/assert/LICENCE.txt b/vendor/github.com/stretchr/testify/assert/LICENCE.txt deleted file mode 100644 index 473b670a..00000000 --- a/vendor/github.com/stretchr/testify/assert/LICENCE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/assert/LICENSE b/vendor/github.com/stretchr/testify/assert/LICENSE deleted file mode 100644 index 473b670a..00000000 --- a/vendor/github.com/stretchr/testify/assert/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl b/vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl new file mode 100644 index 00000000..c5cc66f4 --- /dev/null +++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl @@ -0,0 +1,4 @@ +{{.CommentFormat}} +func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { + return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) +} diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl b/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl new file mode 100644 index 00000000..99f9acfb --- /dev/null +++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl @@ -0,0 +1,4 @@ +{{.CommentWithoutT "a"}} +func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { + return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) +} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENCE.txt b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENCE.txt deleted file mode 100644 index 473b670a..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENCE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENSE b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENSE deleted file mode 100644 index 473b670a..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go deleted file mode 100644 index d42a0bc4..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypass.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2015 Dave Collins -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when the code is not running on Google App Engine, compiled by GopherJS, and -// "-tags safe" is not added to the go build command line. The "disableunsafe" -// tag is deprecated and thus should not be used. -// +build !js,!appengine,!safe,!disableunsafe - -package spew - -import ( - "reflect" - "unsafe" -) - -const ( - // UnsafeDisabled is a build-time constant which specifies whether or - // not access to the unsafe package is available. - UnsafeDisabled = false - - // ptrSize is the size of a pointer on the current arch. - ptrSize = unsafe.Sizeof((*byte)(nil)) -) - -var ( - // offsetPtr, offsetScalar, and offsetFlag are the offsets for the - // internal reflect.Value fields. These values are valid before golang - // commit ecccf07e7f9d which changed the format. The are also valid - // after commit 82f48826c6c7 which changed the format again to mirror - // the original format. Code in the init function updates these offsets - // as necessary. - offsetPtr = uintptr(ptrSize) - offsetScalar = uintptr(0) - offsetFlag = uintptr(ptrSize * 2) - - // flagKindWidth and flagKindShift indicate various bits that the - // reflect package uses internally to track kind information. - // - // flagRO indicates whether or not the value field of a reflect.Value is - // read-only. - // - // flagIndir indicates whether the value field of a reflect.Value is - // the actual data or a pointer to the data. - // - // These values are valid before golang commit 90a7c3c86944 which - // changed their positions. Code in the init function updates these - // flags as necessary. - flagKindWidth = uintptr(5) - flagKindShift = uintptr(flagKindWidth - 1) - flagRO = uintptr(1 << 0) - flagIndir = uintptr(1 << 1) -) - -func init() { - // Older versions of reflect.Value stored small integers directly in the - // ptr field (which is named val in the older versions). Versions - // between commits ecccf07e7f9d and 82f48826c6c7 added a new field named - // scalar for this purpose which unfortunately came before the flag - // field, so the offset of the flag field is different for those - // versions. - // - // This code constructs a new reflect.Value from a known small integer - // and checks if the size of the reflect.Value struct indicates it has - // the scalar field. When it does, the offsets are updated accordingly. - vv := reflect.ValueOf(0xf00) - if unsafe.Sizeof(vv) == (ptrSize * 4) { - offsetScalar = ptrSize * 2 - offsetFlag = ptrSize * 3 - } - - // Commit 90a7c3c86944 changed the flag positions such that the low - // order bits are the kind. This code extracts the kind from the flags - // field and ensures it's the correct type. When it's not, the flag - // order has been changed to the newer format, so the flags are updated - // accordingly. - upf := unsafe.Pointer(uintptr(unsafe.Pointer(&vv)) + offsetFlag) - upfv := *(*uintptr)(upf) - flagKindMask := uintptr((1<>flagKindShift != uintptr(reflect.Int) { - flagKindShift = 0 - flagRO = 1 << 5 - flagIndir = 1 << 6 - - // Commit adf9b30e5594 modified the flags to separate the - // flagRO flag into two bits which specifies whether or not the - // field is embedded. This causes flagIndir to move over a bit - // and means that flagRO is the combination of either of the - // original flagRO bit and the new bit. - // - // This code detects the change by extracting what used to be - // the indirect bit to ensure it's set. When it's not, the flag - // order has been changed to the newer format, so the flags are - // updated accordingly. - if upfv&flagIndir == 0 { - flagRO = 3 << 5 - flagIndir = 1 << 7 - } - } -} - -// unsafeReflectValue converts the passed reflect.Value into a one that bypasses -// the typical safety restrictions preventing access to unaddressable and -// unexported data. It works by digging the raw pointer to the underlying -// value out of the protected value and generating a new unprotected (unsafe) -// reflect.Value to it. -// -// This allows us to check for implementations of the Stringer and error -// interfaces to be used for pretty printing ordinarily unaddressable and -// inaccessible values such as unexported struct fields. -func unsafeReflectValue(v reflect.Value) (rv reflect.Value) { - indirects := 1 - vt := v.Type() - upv := unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetPtr) - rvf := *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetFlag)) - if rvf&flagIndir != 0 { - vt = reflect.PtrTo(v.Type()) - indirects++ - } else if offsetScalar != 0 { - // The value is in the scalar field when it's not one of the - // reference types. - switch vt.Kind() { - case reflect.Uintptr: - case reflect.Chan: - case reflect.Func: - case reflect.Map: - case reflect.Ptr: - case reflect.UnsafePointer: - default: - upv = unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + - offsetScalar) - } - } - - pv := reflect.NewAt(vt, upv) - rv = pv - for i := 0; i < indirects; i++ { - rv = rv.Elem() - } - return rv -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go deleted file mode 100644 index e47a4e79..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2015 Dave Collins -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when the code is running on Google App Engine, compiled by GopherJS, or -// "-tags safe" is added to the go build command line. The "disableunsafe" -// tag is deprecated and thus should not be used. -// +build js appengine safe disableunsafe - -package spew - -import "reflect" - -const ( - // UnsafeDisabled is a build-time constant which specifies whether or - // not access to the unsafe package is available. - UnsafeDisabled = true -) - -// unsafeReflectValue typically converts the passed reflect.Value into a one -// that bypasses the typical safety restrictions preventing access to -// unaddressable and unexported data. However, doing this relies on access to -// the unsafe package. This is a stub version which simply returns the passed -// reflect.Value when the unsafe package is not available. -func unsafeReflectValue(v reflect.Value) reflect.Value { - return v -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go deleted file mode 100644 index 14f02dc1..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/common.go +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) 2013 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "fmt" - "io" - "reflect" - "sort" - "strconv" -) - -// Some constants in the form of bytes to avoid string overhead. This mirrors -// the technique used in the fmt package. -var ( - panicBytes = []byte("(PANIC=") - plusBytes = []byte("+") - iBytes = []byte("i") - trueBytes = []byte("true") - falseBytes = []byte("false") - interfaceBytes = []byte("(interface {})") - commaNewlineBytes = []byte(",\n") - newlineBytes = []byte("\n") - openBraceBytes = []byte("{") - openBraceNewlineBytes = []byte("{\n") - closeBraceBytes = []byte("}") - asteriskBytes = []byte("*") - colonBytes = []byte(":") - colonSpaceBytes = []byte(": ") - openParenBytes = []byte("(") - closeParenBytes = []byte(")") - spaceBytes = []byte(" ") - pointerChainBytes = []byte("->") - nilAngleBytes = []byte("") - maxNewlineBytes = []byte("\n") - maxShortBytes = []byte("") - circularBytes = []byte("") - circularShortBytes = []byte("") - invalidAngleBytes = []byte("") - openBracketBytes = []byte("[") - closeBracketBytes = []byte("]") - percentBytes = []byte("%") - precisionBytes = []byte(".") - openAngleBytes = []byte("<") - closeAngleBytes = []byte(">") - openMapBytes = []byte("map[") - closeMapBytes = []byte("]") - lenEqualsBytes = []byte("len=") - capEqualsBytes = []byte("cap=") -) - -// hexDigits is used to map a decimal value to a hex digit. -var hexDigits = "0123456789abcdef" - -// catchPanic handles any panics that might occur during the handleMethods -// calls. -func catchPanic(w io.Writer, v reflect.Value) { - if err := recover(); err != nil { - w.Write(panicBytes) - fmt.Fprintf(w, "%v", err) - w.Write(closeParenBytes) - } -} - -// handleMethods attempts to call the Error and String methods on the underlying -// type the passed reflect.Value represents and outputes the result to Writer w. -// -// It handles panics in any called methods by catching and displaying the error -// as the formatted value. -func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { - // We need an interface to check if the type implements the error or - // Stringer interface. However, the reflect package won't give us an - // interface on certain things like unexported struct fields in order - // to enforce visibility rules. We use unsafe, when it's available, - // to bypass these restrictions since this package does not mutate the - // values. - if !v.CanInterface() { - if UnsafeDisabled { - return false - } - - v = unsafeReflectValue(v) - } - - // Choose whether or not to do error and Stringer interface lookups against - // the base type or a pointer to the base type depending on settings. - // Technically calling one of these methods with a pointer receiver can - // mutate the value, however, types which choose to satisify an error or - // Stringer interface with a pointer receiver should not be mutating their - // state inside these interface methods. - if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { - v = unsafeReflectValue(v) - } - if v.CanAddr() { - v = v.Addr() - } - - // Is it an error or Stringer? - switch iface := v.Interface().(type) { - case error: - defer catchPanic(w, v) - if cs.ContinueOnMethod { - w.Write(openParenBytes) - w.Write([]byte(iface.Error())) - w.Write(closeParenBytes) - w.Write(spaceBytes) - return false - } - - w.Write([]byte(iface.Error())) - return true - - case fmt.Stringer: - defer catchPanic(w, v) - if cs.ContinueOnMethod { - w.Write(openParenBytes) - w.Write([]byte(iface.String())) - w.Write(closeParenBytes) - w.Write(spaceBytes) - return false - } - w.Write([]byte(iface.String())) - return true - } - return false -} - -// printBool outputs a boolean value as true or false to Writer w. -func printBool(w io.Writer, val bool) { - if val { - w.Write(trueBytes) - } else { - w.Write(falseBytes) - } -} - -// printInt outputs a signed integer value to Writer w. -func printInt(w io.Writer, val int64, base int) { - w.Write([]byte(strconv.FormatInt(val, base))) -} - -// printUint outputs an unsigned integer value to Writer w. -func printUint(w io.Writer, val uint64, base int) { - w.Write([]byte(strconv.FormatUint(val, base))) -} - -// printFloat outputs a floating point value using the specified precision, -// which is expected to be 32 or 64bit, to Writer w. -func printFloat(w io.Writer, val float64, precision int) { - w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) -} - -// printComplex outputs a complex value using the specified float precision -// for the real and imaginary parts to Writer w. -func printComplex(w io.Writer, c complex128, floatPrecision int) { - r := real(c) - w.Write(openParenBytes) - w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) - i := imag(c) - if i >= 0 { - w.Write(plusBytes) - } - w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) - w.Write(iBytes) - w.Write(closeParenBytes) -} - -// printHexPtr outputs a uintptr formatted as hexidecimal with a leading '0x' -// prefix to Writer w. -func printHexPtr(w io.Writer, p uintptr) { - // Null pointer. - num := uint64(p) - if num == 0 { - w.Write(nilAngleBytes) - return - } - - // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix - buf := make([]byte, 18) - - // It's simpler to construct the hex string right to left. - base := uint64(16) - i := len(buf) - 1 - for num >= base { - buf[i] = hexDigits[num%base] - num /= base - i-- - } - buf[i] = hexDigits[num] - - // Add '0x' prefix. - i-- - buf[i] = 'x' - i-- - buf[i] = '0' - - // Strip unused leading bytes. - buf = buf[i:] - w.Write(buf) -} - -// valuesSorter implements sort.Interface to allow a slice of reflect.Value -// elements to be sorted. -type valuesSorter struct { - values []reflect.Value - strings []string // either nil or same len and values - cs *ConfigState -} - -// newValuesSorter initializes a valuesSorter instance, which holds a set of -// surrogate keys on which the data should be sorted. It uses flags in -// ConfigState to decide if and how to populate those surrogate keys. -func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { - vs := &valuesSorter{values: values, cs: cs} - if canSortSimply(vs.values[0].Kind()) { - return vs - } - if !cs.DisableMethods { - vs.strings = make([]string, len(values)) - for i := range vs.values { - b := bytes.Buffer{} - if !handleMethods(cs, &b, vs.values[i]) { - vs.strings = nil - break - } - vs.strings[i] = b.String() - } - } - if vs.strings == nil && cs.SpewKeys { - vs.strings = make([]string, len(values)) - for i := range vs.values { - vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) - } - } - return vs -} - -// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted -// directly, or whether it should be considered for sorting by surrogate keys -// (if the ConfigState allows it). -func canSortSimply(kind reflect.Kind) bool { - // This switch parallels valueSortLess, except for the default case. - switch kind { - case reflect.Bool: - return true - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return true - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - return true - case reflect.Float32, reflect.Float64: - return true - case reflect.String: - return true - case reflect.Uintptr: - return true - case reflect.Array: - return true - } - return false -} - -// Len returns the number of values in the slice. It is part of the -// sort.Interface implementation. -func (s *valuesSorter) Len() int { - return len(s.values) -} - -// Swap swaps the values at the passed indices. It is part of the -// sort.Interface implementation. -func (s *valuesSorter) Swap(i, j int) { - s.values[i], s.values[j] = s.values[j], s.values[i] - if s.strings != nil { - s.strings[i], s.strings[j] = s.strings[j], s.strings[i] - } -} - -// valueSortLess returns whether the first value should sort before the second -// value. It is used by valueSorter.Less as part of the sort.Interface -// implementation. -func valueSortLess(a, b reflect.Value) bool { - switch a.Kind() { - case reflect.Bool: - return !a.Bool() && b.Bool() - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return a.Int() < b.Int() - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - return a.Uint() < b.Uint() - case reflect.Float32, reflect.Float64: - return a.Float() < b.Float() - case reflect.String: - return a.String() < b.String() - case reflect.Uintptr: - return a.Uint() < b.Uint() - case reflect.Array: - // Compare the contents of both arrays. - l := a.Len() - for i := 0; i < l; i++ { - av := a.Index(i) - bv := b.Index(i) - if av.Interface() == bv.Interface() { - continue - } - return valueSortLess(av, bv) - } - } - return a.String() < b.String() -} - -// Less returns whether the value at index i should sort before the -// value at index j. It is part of the sort.Interface implementation. -func (s *valuesSorter) Less(i, j int) bool { - if s.strings == nil { - return valueSortLess(s.values[i], s.values[j]) - } - return s.strings[i] < s.strings[j] -} - -// sortValues is a sort function that handles both native types and any type that -// can be converted to error or Stringer. Other inputs are sorted according to -// their Value.String() value to ensure display stability. -func sortValues(values []reflect.Value, cs *ConfigState) { - if len(values) == 0 { - return - } - sort.Sort(newValuesSorter(values, cs)) -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go deleted file mode 100644 index 9db83c66..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/config.go +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2013 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "fmt" - "io" - "os" -) - -// ConfigState houses the configuration options used by spew to format and -// display values. There is a global instance, Config, that is used to control -// all top-level Formatter and Dump functionality. Each ConfigState instance -// provides methods equivalent to the top-level functions. -// -// The zero value for ConfigState provides no indentation. You would typically -// want to set it to a space or a tab. -// -// Alternatively, you can use NewDefaultConfig to get a ConfigState instance -// with default settings. See the documentation of NewDefaultConfig for default -// values. -type ConfigState struct { - // Indent specifies the string to use for each indentation level. The - // global config instance that all top-level functions use set this to a - // single space by default. If you would like more indentation, you might - // set this to a tab with "\t" or perhaps two spaces with " ". - Indent string - - // MaxDepth controls the maximum number of levels to descend into nested - // data structures. The default, 0, means there is no limit. - // - // NOTE: Circular data structures are properly detected, so it is not - // necessary to set this value unless you specifically want to limit deeply - // nested data structures. - MaxDepth int - - // DisableMethods specifies whether or not error and Stringer interfaces are - // invoked for types that implement them. - DisableMethods bool - - // DisablePointerMethods specifies whether or not to check for and invoke - // error and Stringer interfaces on types which only accept a pointer - // receiver when the current type is not a pointer. - // - // NOTE: This might be an unsafe action since calling one of these methods - // with a pointer receiver could technically mutate the value, however, - // in practice, types which choose to satisify an error or Stringer - // interface with a pointer receiver should not be mutating their state - // inside these interface methods. As a result, this option relies on - // access to the unsafe package, so it will not have any effect when - // running in environments without access to the unsafe package such as - // Google App Engine or with the "safe" build tag specified. - DisablePointerMethods bool - - // DisablePointerAddresses specifies whether to disable the printing of - // pointer addresses. This is useful when diffing data structures in tests. - DisablePointerAddresses bool - - // DisableCapacities specifies whether to disable the printing of capacities - // for arrays, slices, maps and channels. This is useful when diffing - // data structures in tests. - DisableCapacities bool - - // ContinueOnMethod specifies whether or not recursion should continue once - // a custom error or Stringer interface is invoked. The default, false, - // means it will print the results of invoking the custom error or Stringer - // interface and return immediately instead of continuing to recurse into - // the internals of the data type. - // - // NOTE: This flag does not have any effect if method invocation is disabled - // via the DisableMethods or DisablePointerMethods options. - ContinueOnMethod bool - - // SortKeys specifies map keys should be sorted before being printed. Use - // this to have a more deterministic, diffable output. Note that only - // native types (bool, int, uint, floats, uintptr and string) and types - // that support the error or Stringer interfaces (if methods are - // enabled) are supported, with other types sorted according to the - // reflect.Value.String() output which guarantees display stability. - SortKeys bool - - // SpewKeys specifies that, as a last resort attempt, map keys should - // be spewed to strings and sorted by those strings. This is only - // considered if SortKeys is true. - SpewKeys bool -} - -// Config is the active configuration of the top-level functions. -// The configuration can be changed by modifying the contents of spew.Config. -var Config = ConfigState{Indent: " "} - -// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the formatted string as a value that satisfies error. See NewFormatter -// for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { - return fmt.Errorf(format, c.convertArgs(a)...) -} - -// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprint(w, c.convertArgs(a)...) -} - -// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - return fmt.Fprintf(w, format, c.convertArgs(a)...) -} - -// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it -// passed with a Formatter interface returned by c.NewFormatter. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, c.convertArgs(a)...) -} - -// Print is a wrapper for fmt.Print that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Print(a ...interface{}) (n int, err error) { - return fmt.Print(c.convertArgs(a)...) -} - -// Printf is a wrapper for fmt.Printf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { - return fmt.Printf(format, c.convertArgs(a)...) -} - -// Println is a wrapper for fmt.Println that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Println(a ...interface{}) (n int, err error) { - return fmt.Println(c.convertArgs(a)...) -} - -// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprint(a ...interface{}) string { - return fmt.Sprint(c.convertArgs(a)...) -} - -// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, c.convertArgs(a)...) -} - -// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it -// were passed with a Formatter interface returned by c.NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprintln(a ...interface{}) string { - return fmt.Sprintln(c.convertArgs(a)...) -} - -/* -NewFormatter returns a custom formatter that satisfies the fmt.Formatter -interface. As a result, it integrates cleanly with standard fmt package -printing functions. The formatter is useful for inline printing of smaller data -types similar to the standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Typically this function shouldn't be called directly. It is much easier to make -use of the custom formatter by calling one of the convenience functions such as -c.Printf, c.Println, or c.Printf. -*/ -func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { - return newFormatter(c, v) -} - -// Fdump formats and displays the passed arguments to io.Writer w. It formats -// exactly the same as Dump. -func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { - fdump(c, w, a...) -} - -/* -Dump displays the passed parameters to standard out with newlines, customizable -indentation, and additional debug information such as complete types and all -pointer addresses used to indirect to the final value. It provides the -following features over the built-in printing facilities provided by the fmt -package: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output - -The configuration options are controlled by modifying the public members -of c. See ConfigState for options documentation. - -See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to -get the formatted result as a string. -*/ -func (c *ConfigState) Dump(a ...interface{}) { - fdump(c, os.Stdout, a...) -} - -// Sdump returns a string with the passed arguments formatted exactly the same -// as Dump. -func (c *ConfigState) Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(c, &buf, a...) - return buf.String() -} - -// convertArgs accepts a slice of arguments and returns a slice of the same -// length with each argument converted to a spew Formatter interface using -// the ConfigState associated with s. -func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { - formatters = make([]interface{}, len(args)) - for index, arg := range args { - formatters[index] = newFormatter(c, arg) - } - return formatters -} - -// NewDefaultConfig returns a ConfigState with the following default settings. -// -// Indent: " " -// MaxDepth: 0 -// DisableMethods: false -// DisablePointerMethods: false -// ContinueOnMethod: false -// SortKeys: false -func NewDefaultConfig() *ConfigState { - return &ConfigState{Indent: " "} -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go deleted file mode 100644 index 5be0c406..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/doc.go +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 2013 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* -Package spew implements a deep pretty printer for Go data structures to aid in -debugging. - -A quick overview of the additional features spew provides over the built-in -printing facilities for Go data types are as follows: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output (only when using - Dump style) - -There are two different approaches spew allows for dumping Go data structures: - - * Dump style which prints with newlines, customizable indentation, - and additional debug information such as types and all pointer addresses - used to indirect to the final value - * A custom Formatter interface that integrates cleanly with the standard fmt - package and replaces %v, %+v, %#v, and %#+v to provide inline printing - similar to the default %v while providing the additional functionality - outlined above and passing unsupported format verbs such as %x and %q - along to fmt - -Quick Start - -This section demonstrates how to quickly get started with spew. See the -sections below for further details on formatting and configuration options. - -To dump a variable with full newlines, indentation, type, and pointer -information use Dump, Fdump, or Sdump: - spew.Dump(myVar1, myVar2, ...) - spew.Fdump(someWriter, myVar1, myVar2, ...) - str := spew.Sdump(myVar1, myVar2, ...) - -Alternatively, if you would prefer to use format strings with a compacted inline -printing style, use the convenience wrappers Printf, Fprintf, etc with -%v (most compact), %+v (adds pointer addresses), %#v (adds types), or -%#+v (adds types and pointer addresses): - spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - -Configuration Options - -Configuration of spew is handled by fields in the ConfigState type. For -convenience, all of the top-level functions use a global state available -via the spew.Config global. - -It is also possible to create a ConfigState instance that provides methods -equivalent to the top-level functions. This allows concurrent configuration -options. See the ConfigState documentation for more details. - -The following configuration options are available: - * Indent - String to use for each indentation level for Dump functions. - It is a single space by default. A popular alternative is "\t". - - * MaxDepth - Maximum number of levels to descend into nested data structures. - There is no limit by default. - - * DisableMethods - Disables invocation of error and Stringer interface methods. - Method invocation is enabled by default. - - * DisablePointerMethods - Disables invocation of error and Stringer interface methods on types - which only accept pointer receivers from non-pointer variables. - Pointer method invocation is enabled by default. - - * ContinueOnMethod - Enables recursion into types after invoking error and Stringer interface - methods. Recursion after method invocation is disabled by default. - - * SortKeys - Specifies map keys should be sorted before being printed. Use - this to have a more deterministic, diffable output. Note that - only native types (bool, int, uint, floats, uintptr and string) - and types which implement error or Stringer interfaces are - supported with other types sorted according to the - reflect.Value.String() output which guarantees display - stability. Natural map order is used by default. - - * SpewKeys - Specifies that, as a last resort attempt, map keys should be - spewed to strings and sorted by those strings. This is only - considered if SortKeys is true. - -Dump Usage - -Simply call spew.Dump with a list of variables you want to dump: - - spew.Dump(myVar1, myVar2, ...) - -You may also call spew.Fdump if you would prefer to output to an arbitrary -io.Writer. For example, to dump to standard error: - - spew.Fdump(os.Stderr, myVar1, myVar2, ...) - -A third option is to call spew.Sdump to get the formatted output as a string: - - str := spew.Sdump(myVar1, myVar2, ...) - -Sample Dump Output - -See the Dump example for details on the setup of the types and variables being -shown here. - - (main.Foo) { - unexportedField: (*main.Bar)(0xf84002e210)({ - flag: (main.Flag) flagTwo, - data: (uintptr) - }), - ExportedField: (map[interface {}]interface {}) (len=1) { - (string) (len=3) "one": (bool) true - } - } - -Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C -command as shown. - ([]uint8) (len=32 cap=32) { - 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | - 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| - 00000020 31 32 |12| - } - -Custom Formatter - -Spew provides a custom formatter that implements the fmt.Formatter interface -so that it integrates cleanly with standard fmt package printing functions. The -formatter is useful for inline printing of smaller data types similar to the -standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Custom Formatter Usage - -The simplest way to make use of the spew custom formatter is to call one of the -convenience functions such as spew.Printf, spew.Println, or spew.Printf. The -functions have syntax you are most likely already familiar with: - - spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - spew.Println(myVar, myVar2) - spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - -See the Index for the full list convenience functions. - -Sample Formatter Output - -Double pointer to a uint8: - %v: <**>5 - %+v: <**>(0xf8400420d0->0xf8400420c8)5 - %#v: (**uint8)5 - %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 - -Pointer to circular struct with a uint8 field and a pointer to itself: - %v: <*>{1 <*>} - %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} - %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} - %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} - -See the Printf example for details on the setup of variables being shown -here. - -Errors - -Since it is possible for custom Stringer/error interfaces to panic, spew -detects them and handles them internally by printing the panic information -inline with the output. Since spew is intended to provide deep pretty printing -capabilities on structures, it intentionally does not return any errors. -*/ -package spew diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go deleted file mode 100644 index 95f9dbfe..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/dump.go +++ /dev/null @@ -1,509 +0,0 @@ -/* - * Copyright (c) 2013 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "encoding/hex" - "fmt" - "io" - "os" - "reflect" - "regexp" - "strconv" - "strings" -) - -var ( - // uint8Type is a reflect.Type representing a uint8. It is used to - // convert cgo types to uint8 slices for hexdumping. - uint8Type = reflect.TypeOf(uint8(0)) - - // cCharRE is a regular expression that matches a cgo char. - // It is used to detect character arrays to hexdump them. - cCharRE = regexp.MustCompile("^.*\\._Ctype_char$") - - // cUnsignedCharRE is a regular expression that matches a cgo unsigned - // char. It is used to detect unsigned character arrays to hexdump - // them. - cUnsignedCharRE = regexp.MustCompile("^.*\\._Ctype_unsignedchar$") - - // cUint8tCharRE is a regular expression that matches a cgo uint8_t. - // It is used to detect uint8_t arrays to hexdump them. - cUint8tCharRE = regexp.MustCompile("^.*\\._Ctype_uint8_t$") -) - -// dumpState contains information about the state of a dump operation. -type dumpState struct { - w io.Writer - depth int - pointers map[uintptr]int - ignoreNextType bool - ignoreNextIndent bool - cs *ConfigState -} - -// indent performs indentation according to the depth level and cs.Indent -// option. -func (d *dumpState) indent() { - if d.ignoreNextIndent { - d.ignoreNextIndent = false - return - } - d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) -} - -// unpackValue returns values inside of non-nil interfaces when possible. -// This is useful for data types like structs, arrays, slices, and maps which -// can contain varying types packed inside an interface. -func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Interface && !v.IsNil() { - v = v.Elem() - } - return v -} - -// dumpPtr handles formatting of pointers by indirecting them as necessary. -func (d *dumpState) dumpPtr(v reflect.Value) { - // Remove pointers at or below the current depth from map used to detect - // circular refs. - for k, depth := range d.pointers { - if depth >= d.depth { - delete(d.pointers, k) - } - } - - // Keep list of all dereferenced pointers to show later. - pointerChain := make([]uintptr, 0) - - // Figure out how many levels of indirection there are by dereferencing - // pointers and unpacking interfaces down the chain while detecting circular - // references. - nilFound := false - cycleFound := false - indirects := 0 - ve := v - for ve.Kind() == reflect.Ptr { - if ve.IsNil() { - nilFound = true - break - } - indirects++ - addr := ve.Pointer() - pointerChain = append(pointerChain, addr) - if pd, ok := d.pointers[addr]; ok && pd < d.depth { - cycleFound = true - indirects-- - break - } - d.pointers[addr] = d.depth - - ve = ve.Elem() - if ve.Kind() == reflect.Interface { - if ve.IsNil() { - nilFound = true - break - } - ve = ve.Elem() - } - } - - // Display type information. - d.w.Write(openParenBytes) - d.w.Write(bytes.Repeat(asteriskBytes, indirects)) - d.w.Write([]byte(ve.Type().String())) - d.w.Write(closeParenBytes) - - // Display pointer information. - if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { - d.w.Write(openParenBytes) - for i, addr := range pointerChain { - if i > 0 { - d.w.Write(pointerChainBytes) - } - printHexPtr(d.w, addr) - } - d.w.Write(closeParenBytes) - } - - // Display dereferenced value. - d.w.Write(openParenBytes) - switch { - case nilFound == true: - d.w.Write(nilAngleBytes) - - case cycleFound == true: - d.w.Write(circularBytes) - - default: - d.ignoreNextType = true - d.dump(ve) - } - d.w.Write(closeParenBytes) -} - -// dumpSlice handles formatting of arrays and slices. Byte (uint8 under -// reflection) arrays and slices are dumped in hexdump -C fashion. -func (d *dumpState) dumpSlice(v reflect.Value) { - // Determine whether this type should be hex dumped or not. Also, - // for types which should be hexdumped, try to use the underlying data - // first, then fall back to trying to convert them to a uint8 slice. - var buf []uint8 - doConvert := false - doHexDump := false - numEntries := v.Len() - if numEntries > 0 { - vt := v.Index(0).Type() - vts := vt.String() - switch { - // C types that need to be converted. - case cCharRE.MatchString(vts): - fallthrough - case cUnsignedCharRE.MatchString(vts): - fallthrough - case cUint8tCharRE.MatchString(vts): - doConvert = true - - // Try to use existing uint8 slices and fall back to converting - // and copying if that fails. - case vt.Kind() == reflect.Uint8: - // We need an addressable interface to convert the type - // to a byte slice. However, the reflect package won't - // give us an interface on certain things like - // unexported struct fields in order to enforce - // visibility rules. We use unsafe, when available, to - // bypass these restrictions since this package does not - // mutate the values. - vs := v - if !vs.CanInterface() || !vs.CanAddr() { - vs = unsafeReflectValue(vs) - } - if !UnsafeDisabled { - vs = vs.Slice(0, numEntries) - - // Use the existing uint8 slice if it can be - // type asserted. - iface := vs.Interface() - if slice, ok := iface.([]uint8); ok { - buf = slice - doHexDump = true - break - } - } - - // The underlying data needs to be converted if it can't - // be type asserted to a uint8 slice. - doConvert = true - } - - // Copy and convert the underlying type if needed. - if doConvert && vt.ConvertibleTo(uint8Type) { - // Convert and copy each element into a uint8 byte - // slice. - buf = make([]uint8, numEntries) - for i := 0; i < numEntries; i++ { - vv := v.Index(i) - buf[i] = uint8(vv.Convert(uint8Type).Uint()) - } - doHexDump = true - } - } - - // Hexdump the entire slice as needed. - if doHexDump { - indent := strings.Repeat(d.cs.Indent, d.depth) - str := indent + hex.Dump(buf) - str = strings.Replace(str, "\n", "\n"+indent, -1) - str = strings.TrimRight(str, d.cs.Indent) - d.w.Write([]byte(str)) - return - } - - // Recursively call dump for each item. - for i := 0; i < numEntries; i++ { - d.dump(d.unpackValue(v.Index(i))) - if i < (numEntries - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } -} - -// dump is the main workhorse for dumping a value. It uses the passed reflect -// value to figure out what kind of object we are dealing with and formats it -// appropriately. It is a recursive function, however circular data structures -// are detected and handled properly. -func (d *dumpState) dump(v reflect.Value) { - // Handle invalid reflect values immediately. - kind := v.Kind() - if kind == reflect.Invalid { - d.w.Write(invalidAngleBytes) - return - } - - // Handle pointers specially. - if kind == reflect.Ptr { - d.indent() - d.dumpPtr(v) - return - } - - // Print type information unless already handled elsewhere. - if !d.ignoreNextType { - d.indent() - d.w.Write(openParenBytes) - d.w.Write([]byte(v.Type().String())) - d.w.Write(closeParenBytes) - d.w.Write(spaceBytes) - } - d.ignoreNextType = false - - // Display length and capacity if the built-in len and cap functions - // work with the value's kind and the len/cap itself is non-zero. - valueLen, valueCap := 0, 0 - switch v.Kind() { - case reflect.Array, reflect.Slice, reflect.Chan: - valueLen, valueCap = v.Len(), v.Cap() - case reflect.Map, reflect.String: - valueLen = v.Len() - } - if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { - d.w.Write(openParenBytes) - if valueLen != 0 { - d.w.Write(lenEqualsBytes) - printInt(d.w, int64(valueLen), 10) - } - if !d.cs.DisableCapacities && valueCap != 0 { - if valueLen != 0 { - d.w.Write(spaceBytes) - } - d.w.Write(capEqualsBytes) - printInt(d.w, int64(valueCap), 10) - } - d.w.Write(closeParenBytes) - d.w.Write(spaceBytes) - } - - // Call Stringer/error interfaces if they exist and the handle methods flag - // is enabled - if !d.cs.DisableMethods { - if (kind != reflect.Invalid) && (kind != reflect.Interface) { - if handled := handleMethods(d.cs, d.w, v); handled { - return - } - } - } - - switch kind { - case reflect.Invalid: - // Do nothing. We should never get here since invalid has already - // been handled above. - - case reflect.Bool: - printBool(d.w, v.Bool()) - - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - printInt(d.w, v.Int(), 10) - - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - printUint(d.w, v.Uint(), 10) - - case reflect.Float32: - printFloat(d.w, v.Float(), 32) - - case reflect.Float64: - printFloat(d.w, v.Float(), 64) - - case reflect.Complex64: - printComplex(d.w, v.Complex(), 32) - - case reflect.Complex128: - printComplex(d.w, v.Complex(), 64) - - case reflect.Slice: - if v.IsNil() { - d.w.Write(nilAngleBytes) - break - } - fallthrough - - case reflect.Array: - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - d.dumpSlice(v) - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.String: - d.w.Write([]byte(strconv.Quote(v.String()))) - - case reflect.Interface: - // The only time we should get here is for nil interfaces due to - // unpackValue calls. - if v.IsNil() { - d.w.Write(nilAngleBytes) - } - - case reflect.Ptr: - // Do nothing. We should never get here since pointers have already - // been handled above. - - case reflect.Map: - // nil maps should be indicated as different than empty maps - if v.IsNil() { - d.w.Write(nilAngleBytes) - break - } - - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - numEntries := v.Len() - keys := v.MapKeys() - if d.cs.SortKeys { - sortValues(keys, d.cs) - } - for i, key := range keys { - d.dump(d.unpackValue(key)) - d.w.Write(colonSpaceBytes) - d.ignoreNextIndent = true - d.dump(d.unpackValue(v.MapIndex(key))) - if i < (numEntries - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.Struct: - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - vt := v.Type() - numFields := v.NumField() - for i := 0; i < numFields; i++ { - d.indent() - vtf := vt.Field(i) - d.w.Write([]byte(vtf.Name)) - d.w.Write(colonSpaceBytes) - d.ignoreNextIndent = true - d.dump(d.unpackValue(v.Field(i))) - if i < (numFields - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.Uintptr: - printHexPtr(d.w, uintptr(v.Uint())) - - case reflect.UnsafePointer, reflect.Chan, reflect.Func: - printHexPtr(d.w, v.Pointer()) - - // There were not any other types at the time this code was written, but - // fall back to letting the default fmt package handle it in case any new - // types are added. - default: - if v.CanInterface() { - fmt.Fprintf(d.w, "%v", v.Interface()) - } else { - fmt.Fprintf(d.w, "%v", v.String()) - } - } -} - -// fdump is a helper function to consolidate the logic from the various public -// methods which take varying writers and config states. -func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { - for _, arg := range a { - if arg == nil { - w.Write(interfaceBytes) - w.Write(spaceBytes) - w.Write(nilAngleBytes) - w.Write(newlineBytes) - continue - } - - d := dumpState{w: w, cs: cs} - d.pointers = make(map[uintptr]int) - d.dump(reflect.ValueOf(arg)) - d.w.Write(newlineBytes) - } -} - -// Fdump formats and displays the passed arguments to io.Writer w. It formats -// exactly the same as Dump. -func Fdump(w io.Writer, a ...interface{}) { - fdump(&Config, w, a...) -} - -// Sdump returns a string with the passed arguments formatted exactly the same -// as Dump. -func Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(&Config, &buf, a...) - return buf.String() -} - -/* -Dump displays the passed parameters to standard out with newlines, customizable -indentation, and additional debug information such as complete types and all -pointer addresses used to indirect to the final value. It provides the -following features over the built-in printing facilities provided by the fmt -package: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output - -The configuration options are controlled by an exported package global, -spew.Config. See ConfigState for options documentation. - -See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to -get the formatted result as a string. -*/ -func Dump(a ...interface{}) { - fdump(&Config, os.Stdout, a...) -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go deleted file mode 100644 index ecf3b80e..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format.go +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright (c) 2013 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "bytes" - "fmt" - "reflect" - "strconv" - "strings" -) - -// supportedFlags is a list of all the character flags supported by fmt package. -const supportedFlags = "0-+# " - -// formatState implements the fmt.Formatter interface and contains information -// about the state of a formatting operation. The NewFormatter function can -// be used to get a new Formatter which can be used directly as arguments -// in standard fmt package printing calls. -type formatState struct { - value interface{} - fs fmt.State - depth int - pointers map[uintptr]int - ignoreNextType bool - cs *ConfigState -} - -// buildDefaultFormat recreates the original format string without precision -// and width information to pass in to fmt.Sprintf in the case of an -// unrecognized type. Unless new types are added to the language, this -// function won't ever be called. -func (f *formatState) buildDefaultFormat() (format string) { - buf := bytes.NewBuffer(percentBytes) - - for _, flag := range supportedFlags { - if f.fs.Flag(int(flag)) { - buf.WriteRune(flag) - } - } - - buf.WriteRune('v') - - format = buf.String() - return format -} - -// constructOrigFormat recreates the original format string including precision -// and width information to pass along to the standard fmt package. This allows -// automatic deferral of all format strings this package doesn't support. -func (f *formatState) constructOrigFormat(verb rune) (format string) { - buf := bytes.NewBuffer(percentBytes) - - for _, flag := range supportedFlags { - if f.fs.Flag(int(flag)) { - buf.WriteRune(flag) - } - } - - if width, ok := f.fs.Width(); ok { - buf.WriteString(strconv.Itoa(width)) - } - - if precision, ok := f.fs.Precision(); ok { - buf.Write(precisionBytes) - buf.WriteString(strconv.Itoa(precision)) - } - - buf.WriteRune(verb) - - format = buf.String() - return format -} - -// unpackValue returns values inside of non-nil interfaces when possible and -// ensures that types for values which have been unpacked from an interface -// are displayed when the show types flag is also set. -// This is useful for data types like structs, arrays, slices, and maps which -// can contain varying types packed inside an interface. -func (f *formatState) unpackValue(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Interface { - f.ignoreNextType = false - if !v.IsNil() { - v = v.Elem() - } - } - return v -} - -// formatPtr handles formatting of pointers by indirecting them as necessary. -func (f *formatState) formatPtr(v reflect.Value) { - // Display nil if top level pointer is nil. - showTypes := f.fs.Flag('#') - if v.IsNil() && (!showTypes || f.ignoreNextType) { - f.fs.Write(nilAngleBytes) - return - } - - // Remove pointers at or below the current depth from map used to detect - // circular refs. - for k, depth := range f.pointers { - if depth >= f.depth { - delete(f.pointers, k) - } - } - - // Keep list of all dereferenced pointers to possibly show later. - pointerChain := make([]uintptr, 0) - - // Figure out how many levels of indirection there are by derferencing - // pointers and unpacking interfaces down the chain while detecting circular - // references. - nilFound := false - cycleFound := false - indirects := 0 - ve := v - for ve.Kind() == reflect.Ptr { - if ve.IsNil() { - nilFound = true - break - } - indirects++ - addr := ve.Pointer() - pointerChain = append(pointerChain, addr) - if pd, ok := f.pointers[addr]; ok && pd < f.depth { - cycleFound = true - indirects-- - break - } - f.pointers[addr] = f.depth - - ve = ve.Elem() - if ve.Kind() == reflect.Interface { - if ve.IsNil() { - nilFound = true - break - } - ve = ve.Elem() - } - } - - // Display type or indirection level depending on flags. - if showTypes && !f.ignoreNextType { - f.fs.Write(openParenBytes) - f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) - f.fs.Write([]byte(ve.Type().String())) - f.fs.Write(closeParenBytes) - } else { - if nilFound || cycleFound { - indirects += strings.Count(ve.Type().String(), "*") - } - f.fs.Write(openAngleBytes) - f.fs.Write([]byte(strings.Repeat("*", indirects))) - f.fs.Write(closeAngleBytes) - } - - // Display pointer information depending on flags. - if f.fs.Flag('+') && (len(pointerChain) > 0) { - f.fs.Write(openParenBytes) - for i, addr := range pointerChain { - if i > 0 { - f.fs.Write(pointerChainBytes) - } - printHexPtr(f.fs, addr) - } - f.fs.Write(closeParenBytes) - } - - // Display dereferenced value. - switch { - case nilFound == true: - f.fs.Write(nilAngleBytes) - - case cycleFound == true: - f.fs.Write(circularShortBytes) - - default: - f.ignoreNextType = true - f.format(ve) - } -} - -// format is the main workhorse for providing the Formatter interface. It -// uses the passed reflect value to figure out what kind of object we are -// dealing with and formats it appropriately. It is a recursive function, -// however circular data structures are detected and handled properly. -func (f *formatState) format(v reflect.Value) { - // Handle invalid reflect values immediately. - kind := v.Kind() - if kind == reflect.Invalid { - f.fs.Write(invalidAngleBytes) - return - } - - // Handle pointers specially. - if kind == reflect.Ptr { - f.formatPtr(v) - return - } - - // Print type information unless already handled elsewhere. - if !f.ignoreNextType && f.fs.Flag('#') { - f.fs.Write(openParenBytes) - f.fs.Write([]byte(v.Type().String())) - f.fs.Write(closeParenBytes) - } - f.ignoreNextType = false - - // Call Stringer/error interfaces if they exist and the handle methods - // flag is enabled. - if !f.cs.DisableMethods { - if (kind != reflect.Invalid) && (kind != reflect.Interface) { - if handled := handleMethods(f.cs, f.fs, v); handled { - return - } - } - } - - switch kind { - case reflect.Invalid: - // Do nothing. We should never get here since invalid has already - // been handled above. - - case reflect.Bool: - printBool(f.fs, v.Bool()) - - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - printInt(f.fs, v.Int(), 10) - - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - printUint(f.fs, v.Uint(), 10) - - case reflect.Float32: - printFloat(f.fs, v.Float(), 32) - - case reflect.Float64: - printFloat(f.fs, v.Float(), 64) - - case reflect.Complex64: - printComplex(f.fs, v.Complex(), 32) - - case reflect.Complex128: - printComplex(f.fs, v.Complex(), 64) - - case reflect.Slice: - if v.IsNil() { - f.fs.Write(nilAngleBytes) - break - } - fallthrough - - case reflect.Array: - f.fs.Write(openBracketBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - numEntries := v.Len() - for i := 0; i < numEntries; i++ { - if i > 0 { - f.fs.Write(spaceBytes) - } - f.ignoreNextType = true - f.format(f.unpackValue(v.Index(i))) - } - } - f.depth-- - f.fs.Write(closeBracketBytes) - - case reflect.String: - f.fs.Write([]byte(v.String())) - - case reflect.Interface: - // The only time we should get here is for nil interfaces due to - // unpackValue calls. - if v.IsNil() { - f.fs.Write(nilAngleBytes) - } - - case reflect.Ptr: - // Do nothing. We should never get here since pointers have already - // been handled above. - - case reflect.Map: - // nil maps should be indicated as different than empty maps - if v.IsNil() { - f.fs.Write(nilAngleBytes) - break - } - - f.fs.Write(openMapBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - keys := v.MapKeys() - if f.cs.SortKeys { - sortValues(keys, f.cs) - } - for i, key := range keys { - if i > 0 { - f.fs.Write(spaceBytes) - } - f.ignoreNextType = true - f.format(f.unpackValue(key)) - f.fs.Write(colonBytes) - f.ignoreNextType = true - f.format(f.unpackValue(v.MapIndex(key))) - } - } - f.depth-- - f.fs.Write(closeMapBytes) - - case reflect.Struct: - numFields := v.NumField() - f.fs.Write(openBraceBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - vt := v.Type() - for i := 0; i < numFields; i++ { - if i > 0 { - f.fs.Write(spaceBytes) - } - vtf := vt.Field(i) - if f.fs.Flag('+') || f.fs.Flag('#') { - f.fs.Write([]byte(vtf.Name)) - f.fs.Write(colonBytes) - } - f.format(f.unpackValue(v.Field(i))) - } - } - f.depth-- - f.fs.Write(closeBraceBytes) - - case reflect.Uintptr: - printHexPtr(f.fs, uintptr(v.Uint())) - - case reflect.UnsafePointer, reflect.Chan, reflect.Func: - printHexPtr(f.fs, v.Pointer()) - - // There were not any other types at the time this code was written, but - // fall back to letting the default fmt package handle it if any get added. - default: - format := f.buildDefaultFormat() - if v.CanInterface() { - fmt.Fprintf(f.fs, format, v.Interface()) - } else { - fmt.Fprintf(f.fs, format, v.String()) - } - } -} - -// Format satisfies the fmt.Formatter interface. See NewFormatter for usage -// details. -func (f *formatState) Format(fs fmt.State, verb rune) { - f.fs = fs - - // Use standard formatting for verbs that are not v. - if verb != 'v' { - format := f.constructOrigFormat(verb) - fmt.Fprintf(fs, format, f.value) - return - } - - if f.value == nil { - if fs.Flag('#') { - fs.Write(interfaceBytes) - } - fs.Write(nilAngleBytes) - return - } - - f.format(reflect.ValueOf(f.value)) -} - -// newFormatter is a helper function to consolidate the logic from the various -// public methods which take varying config states. -func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { - fs := &formatState{value: v, cs: cs} - fs.pointers = make(map[uintptr]int) - return fs -} - -/* -NewFormatter returns a custom formatter that satisfies the fmt.Formatter -interface. As a result, it integrates cleanly with standard fmt package -printing functions. The formatter is useful for inline printing of smaller data -types similar to the standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Typically this function shouldn't be called directly. It is much easier to make -use of the custom formatter by calling one of the convenience functions such as -Printf, Println, or Fprintf. -*/ -func NewFormatter(v interface{}) fmt.Formatter { - return newFormatter(&Config, v) -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go b/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go deleted file mode 100644 index d8233f54..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/spew.go +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 2013 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew - -import ( - "fmt" - "io" -) - -// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the formatted string as a value that satisfies error. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Errorf(format string, a ...interface{}) (err error) { - return fmt.Errorf(format, convertArgs(a)...) -} - -// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprint(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprint(w, convertArgs(a)...) -} - -// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - return fmt.Fprintf(w, format, convertArgs(a)...) -} - -// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it -// passed with a default Formatter interface returned by NewFormatter. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, convertArgs(a)...) -} - -// Print is a wrapper for fmt.Print that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) -func Print(a ...interface{}) (n int, err error) { - return fmt.Print(convertArgs(a)...) -} - -// Printf is a wrapper for fmt.Printf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Printf(format string, a ...interface{}) (n int, err error) { - return fmt.Printf(format, convertArgs(a)...) -} - -// Println is a wrapper for fmt.Println that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) -func Println(a ...interface{}) (n int, err error) { - return fmt.Println(convertArgs(a)...) -} - -// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprint(a ...interface{}) string { - return fmt.Sprint(convertArgs(a)...) -} - -// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, convertArgs(a)...) -} - -// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it -// were passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprintln(a ...interface{}) string { - return fmt.Sprintln(convertArgs(a)...) -} - -// convertArgs accepts a slice of arguments and returns a slice of the same -// length with each argument converted to a default spew Formatter interface. -func convertArgs(args []interface{}) (formatters []interface{}) { - formatters = make([]interface{}, len(args)) - for index, arg := range args { - formatters[index] = NewFormatter(arg) - } - return formatters -} diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENCE.txt b/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENCE.txt deleted file mode 100644 index 473b670a..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENCE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENSE b/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENSE deleted file mode 100644 index 473b670a..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go deleted file mode 100644 index 64cc40fe..00000000 --- a/vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go +++ /dev/null @@ -1,758 +0,0 @@ -// Package difflib is a partial port of Python difflib module. -// -// It provides tools to compare sequences of strings and generate textual diffs. -// -// The following class and functions have been ported: -// -// - SequenceMatcher -// -// - unified_diff -// -// - context_diff -// -// Getting unified diffs was the main goal of the port. Keep in mind this code -// is mostly suitable to output text differences in a human friendly way, there -// are no guarantees generated diffs are consumable by patch(1). -package difflib - -import ( - "bufio" - "bytes" - "fmt" - "io" - "strings" -) - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func calculateRatio(matches, length int) float64 { - if length > 0 { - return 2.0 * float64(matches) / float64(length) - } - return 1.0 -} - -type Match struct { - A int - B int - Size int -} - -type OpCode struct { - Tag byte - I1 int - I2 int - J1 int - J2 int -} - -// SequenceMatcher compares sequence of strings. The basic -// algorithm predates, and is a little fancier than, an algorithm -// published in the late 1980's by Ratcliff and Obershelp under the -// hyperbolic name "gestalt pattern matching". The basic idea is to find -// the longest contiguous matching subsequence that contains no "junk" -// elements (R-O doesn't address junk). The same idea is then applied -// recursively to the pieces of the sequences to the left and to the right -// of the matching subsequence. This does not yield minimal edit -// sequences, but does tend to yield matches that "look right" to people. -// -// SequenceMatcher tries to compute a "human-friendly diff" between two -// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the -// longest *contiguous* & junk-free matching subsequence. That's what -// catches peoples' eyes. The Windows(tm) windiff has another interesting -// notion, pairing up elements that appear uniquely in each sequence. -// That, and the method here, appear to yield more intuitive difference -// reports than does diff. This method appears to be the least vulnerable -// to synching up on blocks of "junk lines", though (like blank lines in -// ordinary text files, or maybe "

" lines in HTML files). That may be -// because this is the only method of the 3 that has a *concept* of -// "junk" . -// -// Timing: Basic R-O is cubic time worst case and quadratic time expected -// case. SequenceMatcher is quadratic time for the worst case and has -// expected-case behavior dependent in a complicated way on how many -// elements the sequences have in common; best case time is linear. -type SequenceMatcher struct { - a []string - b []string - b2j map[string][]int - IsJunk func(string) bool - autoJunk bool - bJunk map[string]struct{} - matchingBlocks []Match - fullBCount map[string]int - bPopular map[string]struct{} - opCodes []OpCode -} - -func NewMatcher(a, b []string) *SequenceMatcher { - m := SequenceMatcher{autoJunk: true} - m.SetSeqs(a, b) - return &m -} - -func NewMatcherWithJunk(a, b []string, autoJunk bool, - isJunk func(string) bool) *SequenceMatcher { - - m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} - m.SetSeqs(a, b) - return &m -} - -// Set two sequences to be compared. -func (m *SequenceMatcher) SetSeqs(a, b []string) { - m.SetSeq1(a) - m.SetSeq2(b) -} - -// Set the first sequence to be compared. The second sequence to be compared is -// not changed. -// -// SequenceMatcher computes and caches detailed information about the second -// sequence, so if you want to compare one sequence S against many sequences, -// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other -// sequences. -// -// See also SetSeqs() and SetSeq2(). -func (m *SequenceMatcher) SetSeq1(a []string) { - if &a == &m.a { - return - } - m.a = a - m.matchingBlocks = nil - m.opCodes = nil -} - -// Set the second sequence to be compared. The first sequence to be compared is -// not changed. -func (m *SequenceMatcher) SetSeq2(b []string) { - if &b == &m.b { - return - } - m.b = b - m.matchingBlocks = nil - m.opCodes = nil - m.fullBCount = nil - m.chainB() -} - -func (m *SequenceMatcher) chainB() { - // Populate line -> index mapping - b2j := map[string][]int{} - for i, s := range m.b { - indices := b2j[s] - indices = append(indices, i) - b2j[s] = indices - } - - // Purge junk elements - m.bJunk = map[string]struct{}{} - if m.IsJunk != nil { - junk := m.bJunk - for s, _ := range b2j { - if m.IsJunk(s) { - junk[s] = struct{}{} - } - } - for s, _ := range junk { - delete(b2j, s) - } - } - - // Purge remaining popular elements - popular := map[string]struct{}{} - n := len(m.b) - if m.autoJunk && n >= 200 { - ntest := n/100 + 1 - for s, indices := range b2j { - if len(indices) > ntest { - popular[s] = struct{}{} - } - } - for s, _ := range popular { - delete(b2j, s) - } - } - m.bPopular = popular - m.b2j = b2j -} - -func (m *SequenceMatcher) isBJunk(s string) bool { - _, ok := m.bJunk[s] - return ok -} - -// Find longest matching block in a[alo:ahi] and b[blo:bhi]. -// -// If IsJunk is not defined: -// -// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where -// alo <= i <= i+k <= ahi -// blo <= j <= j+k <= bhi -// and for all (i',j',k') meeting those conditions, -// k >= k' -// i <= i' -// and if i == i', j <= j' -// -// In other words, of all maximal matching blocks, return one that -// starts earliest in a, and of all those maximal matching blocks that -// start earliest in a, return the one that starts earliest in b. -// -// If IsJunk is defined, first the longest matching block is -// determined as above, but with the additional restriction that no -// junk element appears in the block. Then that block is extended as -// far as possible by matching (only) junk elements on both sides. So -// the resulting block never matches on junk except as identical junk -// happens to be adjacent to an "interesting" match. -// -// If no blocks match, return (alo, blo, 0). -func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { - // CAUTION: stripping common prefix or suffix would be incorrect. - // E.g., - // ab - // acab - // Longest matching block is "ab", but if common prefix is - // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so - // strip, so ends up claiming that ab is changed to acab by - // inserting "ca" in the middle. That's minimal but unintuitive: - // "it's obvious" that someone inserted "ac" at the front. - // Windiff ends up at the same place as diff, but by pairing up - // the unique 'b's and then matching the first two 'a's. - besti, bestj, bestsize := alo, blo, 0 - - // find longest junk-free match - // during an iteration of the loop, j2len[j] = length of longest - // junk-free match ending with a[i-1] and b[j] - j2len := map[int]int{} - for i := alo; i != ahi; i++ { - // look at all instances of a[i] in b; note that because - // b2j has no junk keys, the loop is skipped if a[i] is junk - newj2len := map[int]int{} - for _, j := range m.b2j[m.a[i]] { - // a[i] matches b[j] - if j < blo { - continue - } - if j >= bhi { - break - } - k := j2len[j-1] + 1 - newj2len[j] = k - if k > bestsize { - besti, bestj, bestsize = i-k+1, j-k+1, k - } - } - j2len = newj2len - } - - // Extend the best by non-junk elements on each end. In particular, - // "popular" non-junk elements aren't in b2j, which greatly speeds - // the inner loop above, but also means "the best" match so far - // doesn't contain any junk *or* popular non-junk elements. - for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && - m.a[besti-1] == m.b[bestj-1] { - besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 - } - for besti+bestsize < ahi && bestj+bestsize < bhi && - !m.isBJunk(m.b[bestj+bestsize]) && - m.a[besti+bestsize] == m.b[bestj+bestsize] { - bestsize += 1 - } - - // Now that we have a wholly interesting match (albeit possibly - // empty!), we may as well suck up the matching junk on each - // side of it too. Can't think of a good reason not to, and it - // saves post-processing the (possibly considerable) expense of - // figuring out what to do with it. In the case of an empty - // interesting match, this is clearly the right thing to do, - // because no other kind of match is possible in the regions. - for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && - m.a[besti-1] == m.b[bestj-1] { - besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 - } - for besti+bestsize < ahi && bestj+bestsize < bhi && - m.isBJunk(m.b[bestj+bestsize]) && - m.a[besti+bestsize] == m.b[bestj+bestsize] { - bestsize += 1 - } - - return Match{A: besti, B: bestj, Size: bestsize} -} - -// Return list of triples describing matching subsequences. -// -// Each triple is of the form (i, j, n), and means that -// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in -// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are -// adjacent triples in the list, and the second is not the last triple in the -// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe -// adjacent equal blocks. -// -// The last triple is a dummy, (len(a), len(b), 0), and is the only -// triple with n==0. -func (m *SequenceMatcher) GetMatchingBlocks() []Match { - if m.matchingBlocks != nil { - return m.matchingBlocks - } - - var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match - matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { - match := m.findLongestMatch(alo, ahi, blo, bhi) - i, j, k := match.A, match.B, match.Size - if match.Size > 0 { - if alo < i && blo < j { - matched = matchBlocks(alo, i, blo, j, matched) - } - matched = append(matched, match) - if i+k < ahi && j+k < bhi { - matched = matchBlocks(i+k, ahi, j+k, bhi, matched) - } - } - return matched - } - matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) - - // It's possible that we have adjacent equal blocks in the - // matching_blocks list now. - nonAdjacent := []Match{} - i1, j1, k1 := 0, 0, 0 - for _, b := range matched { - // Is this block adjacent to i1, j1, k1? - i2, j2, k2 := b.A, b.B, b.Size - if i1+k1 == i2 && j1+k1 == j2 { - // Yes, so collapse them -- this just increases the length of - // the first block by the length of the second, and the first - // block so lengthened remains the block to compare against. - k1 += k2 - } else { - // Not adjacent. Remember the first block (k1==0 means it's - // the dummy we started with), and make the second block the - // new block to compare against. - if k1 > 0 { - nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) - } - i1, j1, k1 = i2, j2, k2 - } - } - if k1 > 0 { - nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) - } - - nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) - m.matchingBlocks = nonAdjacent - return m.matchingBlocks -} - -// Return list of 5-tuples describing how to turn a into b. -// -// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple -// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the -// tuple preceding it, and likewise for j1 == the previous j2. -// -// The tags are characters, with these meanings: -// -// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] -// -// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. -// -// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. -// -// 'e' (equal): a[i1:i2] == b[j1:j2] -func (m *SequenceMatcher) GetOpCodes() []OpCode { - if m.opCodes != nil { - return m.opCodes - } - i, j := 0, 0 - matching := m.GetMatchingBlocks() - opCodes := make([]OpCode, 0, len(matching)) - for _, m := range matching { - // invariant: we've pumped out correct diffs to change - // a[:i] into b[:j], and the next matching block is - // a[ai:ai+size] == b[bj:bj+size]. So we need to pump - // out a diff to change a[i:ai] into b[j:bj], pump out - // the matching block, and move (i,j) beyond the match - ai, bj, size := m.A, m.B, m.Size - tag := byte(0) - if i < ai && j < bj { - tag = 'r' - } else if i < ai { - tag = 'd' - } else if j < bj { - tag = 'i' - } - if tag > 0 { - opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) - } - i, j = ai+size, bj+size - // the list of matching blocks is terminated by a - // sentinel with size 0 - if size > 0 { - opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) - } - } - m.opCodes = opCodes - return m.opCodes -} - -// Isolate change clusters by eliminating ranges with no changes. -// -// Return a generator of groups with up to n lines of context. -// Each group is in the same format as returned by GetOpCodes(). -func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { - if n < 0 { - n = 3 - } - codes := m.GetOpCodes() - if len(codes) == 0 { - codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} - } - // Fixup leading and trailing groups if they show no changes. - if codes[0].Tag == 'e' { - c := codes[0] - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} - } - if codes[len(codes)-1].Tag == 'e' { - c := codes[len(codes)-1] - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} - } - nn := n + n - groups := [][]OpCode{} - group := []OpCode{} - for _, c := range codes { - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - // End the current group and start a new one whenever - // there is a large range with no changes. - if c.Tag == 'e' && i2-i1 > nn { - group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), - j1, min(j2, j1+n)}) - groups = append(groups, group) - group = []OpCode{} - i1, j1 = max(i1, i2-n), max(j1, j2-n) - } - group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) - } - if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { - groups = append(groups, group) - } - return groups -} - -// Return a measure of the sequences' similarity (float in [0,1]). -// -// Where T is the total number of elements in both sequences, and -// M is the number of matches, this is 2.0*M / T. -// Note that this is 1 if the sequences are identical, and 0 if -// they have nothing in common. -// -// .Ratio() is expensive to compute if you haven't already computed -// .GetMatchingBlocks() or .GetOpCodes(), in which case you may -// want to try .QuickRatio() or .RealQuickRation() first to get an -// upper bound. -func (m *SequenceMatcher) Ratio() float64 { - matches := 0 - for _, m := range m.GetMatchingBlocks() { - matches += m.Size - } - return calculateRatio(matches, len(m.a)+len(m.b)) -} - -// Return an upper bound on ratio() relatively quickly. -// -// This isn't defined beyond that it is an upper bound on .Ratio(), and -// is faster to compute. -func (m *SequenceMatcher) QuickRatio() float64 { - // viewing a and b as multisets, set matches to the cardinality - // of their intersection; this counts the number of matches - // without regard to order, so is clearly an upper bound - if m.fullBCount == nil { - m.fullBCount = map[string]int{} - for _, s := range m.b { - m.fullBCount[s] = m.fullBCount[s] + 1 - } - } - - // avail[x] is the number of times x appears in 'b' less the - // number of times we've seen it in 'a' so far ... kinda - avail := map[string]int{} - matches := 0 - for _, s := range m.a { - n, ok := avail[s] - if !ok { - n = m.fullBCount[s] - } - avail[s] = n - 1 - if n > 0 { - matches += 1 - } - } - return calculateRatio(matches, len(m.a)+len(m.b)) -} - -// Return an upper bound on ratio() very quickly. -// -// This isn't defined beyond that it is an upper bound on .Ratio(), and -// is faster to compute than either .Ratio() or .QuickRatio(). -func (m *SequenceMatcher) RealQuickRatio() float64 { - la, lb := len(m.a), len(m.b) - return calculateRatio(min(la, lb), la+lb) -} - -// Convert range to the "ed" format -func formatRangeUnified(start, stop int) string { - // Per the diff spec at http://www.unix.org/single_unix_specification/ - beginning := start + 1 // lines start numbering with one - length := stop - start - if length == 1 { - return fmt.Sprintf("%d", beginning) - } - if length == 0 { - beginning -= 1 // empty ranges begin at line just before the range - } - return fmt.Sprintf("%d,%d", beginning, length) -} - -// Unified diff parameters -type UnifiedDiff struct { - A []string // First sequence lines - FromFile string // First file name - FromDate string // First file time - B []string // Second sequence lines - ToFile string // Second file name - ToDate string // Second file time - Eol string // Headers end of line, defaults to LF - Context int // Number of context lines -} - -// Compare two sequences of lines; generate the delta as a unified diff. -// -// Unified diffs are a compact way of showing line changes and a few -// lines of context. The number of context lines is set by 'n' which -// defaults to three. -// -// By default, the diff control lines (those with ---, +++, or @@) are -// created with a trailing newline. This is helpful so that inputs -// created from file.readlines() result in diffs that are suitable for -// file.writelines() since both the inputs and outputs have trailing -// newlines. -// -// For inputs that do not have trailing newlines, set the lineterm -// argument to "" so that the output will be uniformly newline free. -// -// The unidiff format normally has a header for filenames and modification -// times. Any or all of these may be specified using strings for -// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. -// The modification times are normally expressed in the ISO 8601 format. -func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { - buf := bufio.NewWriter(writer) - defer buf.Flush() - w := func(format string, args ...interface{}) error { - _, err := buf.WriteString(fmt.Sprintf(format, args...)) - return err - } - - if len(diff.Eol) == 0 { - diff.Eol = "\n" - } - - started := false - m := NewMatcher(diff.A, diff.B) - for _, g := range m.GetGroupedOpCodes(diff.Context) { - if !started { - started = true - fromDate := "" - if len(diff.FromDate) > 0 { - fromDate = "\t" + diff.FromDate - } - toDate := "" - if len(diff.ToDate) > 0 { - toDate = "\t" + diff.ToDate - } - err := w("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) - if err != nil { - return err - } - err = w("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) - if err != nil { - return err - } - } - first, last := g[0], g[len(g)-1] - range1 := formatRangeUnified(first.I1, last.I2) - range2 := formatRangeUnified(first.J1, last.J2) - if err := w("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { - return err - } - for _, c := range g { - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - if c.Tag == 'e' { - for _, line := range diff.A[i1:i2] { - if err := w(" " + line); err != nil { - return err - } - } - continue - } - if c.Tag == 'r' || c.Tag == 'd' { - for _, line := range diff.A[i1:i2] { - if err := w("-" + line); err != nil { - return err - } - } - } - if c.Tag == 'r' || c.Tag == 'i' { - for _, line := range diff.B[j1:j2] { - if err := w("+" + line); err != nil { - return err - } - } - } - } - } - return nil -} - -// Like WriteUnifiedDiff but returns the diff a string. -func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { - w := &bytes.Buffer{} - err := WriteUnifiedDiff(w, diff) - return string(w.Bytes()), err -} - -// Convert range to the "ed" format. -func formatRangeContext(start, stop int) string { - // Per the diff spec at http://www.unix.org/single_unix_specification/ - beginning := start + 1 // lines start numbering with one - length := stop - start - if length == 0 { - beginning -= 1 // empty ranges begin at line just before the range - } - if length <= 1 { - return fmt.Sprintf("%d", beginning) - } - return fmt.Sprintf("%d,%d", beginning, beginning+length-1) -} - -type ContextDiff UnifiedDiff - -// Compare two sequences of lines; generate the delta as a context diff. -// -// Context diffs are a compact way of showing line changes and a few -// lines of context. The number of context lines is set by diff.Context -// which defaults to three. -// -// By default, the diff control lines (those with *** or ---) are -// created with a trailing newline. -// -// For inputs that do not have trailing newlines, set the diff.Eol -// argument to "" so that the output will be uniformly newline free. -// -// The context diff format normally has a header for filenames and -// modification times. Any or all of these may be specified using -// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. -// The modification times are normally expressed in the ISO 8601 format. -// If not specified, the strings default to blanks. -func WriteContextDiff(writer io.Writer, diff ContextDiff) error { - buf := bufio.NewWriter(writer) - defer buf.Flush() - var diffErr error - w := func(format string, args ...interface{}) { - _, err := buf.WriteString(fmt.Sprintf(format, args...)) - if diffErr == nil && err != nil { - diffErr = err - } - } - - if len(diff.Eol) == 0 { - diff.Eol = "\n" - } - - prefix := map[byte]string{ - 'i': "+ ", - 'd': "- ", - 'r': "! ", - 'e': " ", - } - - started := false - m := NewMatcher(diff.A, diff.B) - for _, g := range m.GetGroupedOpCodes(diff.Context) { - if !started { - started = true - fromDate := "" - if len(diff.FromDate) > 0 { - fromDate = "\t" + diff.FromDate - } - toDate := "" - if len(diff.ToDate) > 0 { - toDate = "\t" + diff.ToDate - } - w("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) - w("--- %s%s%s", diff.ToFile, toDate, diff.Eol) - } - - first, last := g[0], g[len(g)-1] - w("***************" + diff.Eol) - - range1 := formatRangeContext(first.I1, last.I2) - w("*** %s ****%s", range1, diff.Eol) - for _, c := range g { - if c.Tag == 'r' || c.Tag == 'd' { - for _, cc := range g { - if cc.Tag == 'i' { - continue - } - for _, line := range diff.A[cc.I1:cc.I2] { - w(prefix[cc.Tag] + line) - } - } - break - } - } - - range2 := formatRangeContext(first.J1, last.J2) - w("--- %s ----%s", range2, diff.Eol) - for _, c := range g { - if c.Tag == 'r' || c.Tag == 'i' { - for _, cc := range g { - if cc.Tag == 'd' { - continue - } - for _, line := range diff.B[cc.J1:cc.J2] { - w(prefix[cc.Tag] + line) - } - } - break - } - } - } - return diffErr -} - -// Like WriteContextDiff but returns the diff a string. -func GetContextDiffString(diff ContextDiff) (string, error) { - w := &bytes.Buffer{} - err := WriteContextDiff(w, diff) - return string(w.Bytes()), err -} - -// Split a string on "\n" while preserving them. The output can be used -// as input for UnifiedDiff and ContextDiff structures. -func SplitLines(s string) []string { - lines := strings.SplitAfter(s, "\n") - lines[len(lines)-1] += "\n" - return lines -} diff --git a/vendor/github.com/technoweenie/multipartstreamer/README.md b/vendor/github.com/technoweenie/multipartstreamer/README.md new file mode 100644 index 00000000..dc1f824f --- /dev/null +++ b/vendor/github.com/technoweenie/multipartstreamer/README.md @@ -0,0 +1,47 @@ +# multipartstreamer + +Package multipartstreamer helps you encode large files in MIME multipart format +without reading the entire content into memory. It uses io.MultiReader to +combine an inner multipart.Reader with a file handle. + +```go +package main + +import ( + "github.com/technoweenie/multipartstreamer.go" + "net/http" +) + +func main() { + ms := multipartstreamer.New() + + ms.WriteFields(map[string]string{ + "key": "some-key", + "AWSAccessKeyId": "ABCDEF", + "acl": "some-acl", + }) + + // Add any io.Reader to the multipart.Reader. + ms.WriteReader("file", "filename", some_ioReader, size) + + // Shortcut for adding local file. + ms.WriteFile("file", "path/to/file") + + req, _ := http.NewRequest("POST", "someurl", nil) + ms.SetupRequest(req) + + res, _ := http.DefaultClient.Do(req) +} +``` + +One limitation: You can only write a single file. + +## TODO + +* Multiple files? + +## Credits + +Heavily inspired by James + +https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/Zjg5l4nKcQ0 diff --git a/vendor/github.com/technoweenie/multipartstreamer/examples/multipart.go b/vendor/github.com/technoweenie/multipartstreamer/examples/multipart.go deleted file mode 100644 index 971078be..00000000 --- a/vendor/github.com/technoweenie/multipartstreamer/examples/multipart.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "bytes" - "flag" - "fmt" - "io" - "mime/multipart" - "os" - "path/filepath" -) - -func main() { - defaultPath, _ := os.Getwd() - defaultFile := filepath.Join(defaultPath, "streamer.go") - fullpath := flag.String("path", defaultFile, "Path to the include in the multipart data.") - flag.Parse() - - buffer := bytes.NewBufferString("") - writer := multipart.NewWriter(buffer) - - fmt.Println("Adding the file to the multipart writer") - fileWriter, _ := writer.CreateFormFile("file", *fullpath) - fileData, _ := os.Open(*fullpath) - io.Copy(fileWriter, fileData) - writer.Close() - - fmt.Println("Writing the multipart data to a file") - output, _ := os.Create("multiparttest") - io.Copy(output, buffer) -} diff --git a/vendor/github.com/technoweenie/multipartstreamer/examples/streamer.go b/vendor/github.com/technoweenie/multipartstreamer/examples/streamer.go deleted file mode 100644 index 324f7e12..00000000 --- a/vendor/github.com/technoweenie/multipartstreamer/examples/streamer.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "github.com/technoweenie/multipartstreamer" - "io" - "os" - "path/filepath" -) - -func main() { - defaultPath, _ := os.Getwd() - defaultFile := filepath.Join(defaultPath, "streamer.go") - fullpath := flag.String("path", defaultFile, "Path to the include in the multipart data.") - flag.Parse() - - ms := multipartstreamer.New() - - fmt.Println("Adding the file to the multipart writer") - ms.WriteFile("file", *fullpath) - reader := ms.GetReader() - - fmt.Println("Writing the multipart data to a file") - file, _ := os.Create("streamtest") - io.Copy(file, reader) -} diff --git a/vendor/github.com/tylerb/graceful/LICENSE b/vendor/github.com/tylerb/graceful/LICENSE deleted file mode 100644 index a4f2f281..00000000 --- a/vendor/github.com/tylerb/graceful/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Tyler Bunnell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/tylerb/graceful/graceful.go b/vendor/github.com/tylerb/graceful/graceful.go deleted file mode 100644 index ebf0aeb7..00000000 --- a/vendor/github.com/tylerb/graceful/graceful.go +++ /dev/null @@ -1,489 +0,0 @@ -package graceful - -import ( - "crypto/tls" - "log" - "net" - "net/http" - "os" - "sync" - "time" -) - -// Server wraps an http.Server with graceful connection handling. -// It may be used directly in the same way as http.Server, or may -// be constructed with the global functions in this package. -// -// Example: -// srv := &graceful.Server{ -// Timeout: 5 * time.Second, -// Server: &http.Server{Addr: ":1234", Handler: handler}, -// } -// srv.ListenAndServe() -type Server struct { - *http.Server - - // Timeout is the duration to allow outstanding requests to survive - // before forcefully terminating them. - Timeout time.Duration - - // Limit the number of outstanding requests - ListenLimit int - - // TCPKeepAlive sets the TCP keep-alive timeouts on accepted - // connections. It prunes dead TCP connections ( e.g. closing - // laptop mid-download) - TCPKeepAlive time.Duration - - // ConnState specifies an optional callback function that is - // called when a client connection changes state. This is a proxy - // to the underlying http.Server's ConnState, and the original - // must not be set directly. - ConnState func(net.Conn, http.ConnState) - - // BeforeShutdown is an optional callback function that is called - // before the listener is closed. Returns true if shutdown is allowed - BeforeShutdown func() bool - - // ShutdownInitiated is an optional callback function that is called - // when shutdown is initiated. It can be used to notify the client - // side of long lived connections (e.g. websockets) to reconnect. - ShutdownInitiated func() - - // NoSignalHandling prevents graceful from automatically shutting down - // on SIGINT and SIGTERM. If set to true, you must shut down the server - // manually with Stop(). - NoSignalHandling bool - - // Logger used to notify of errors on startup and on stop. - Logger *log.Logger - - // LogFunc can be assigned with a logging function of your choice, allowing - // you to use whatever logging approach you would like - LogFunc func(format string, args ...interface{}) - - // Interrupted is true if the server is handling a SIGINT or SIGTERM - // signal and is thus shutting down. - Interrupted bool - - // interrupt signals the listener to stop serving connections, - // and the server to shut down. - interrupt chan os.Signal - - // stopLock is used to protect against concurrent calls to Stop - stopLock sync.Mutex - - // stopChan is the channel on which callers may block while waiting for - // the server to stop. - stopChan chan struct{} - - // chanLock is used to protect access to the various channel constructors. - chanLock sync.RWMutex - - // connections holds all connections managed by graceful - connections map[net.Conn]struct{} - - // idleConnections holds all idle connections managed by graceful - idleConnections map[net.Conn]struct{} -} - -// Run serves the http.Handler with graceful shutdown enabled. -// -// timeout is the duration to wait until killing active requests and stopping the server. -// If timeout is 0, the server never times out. It waits for all active requests to finish. -func Run(addr string, timeout time.Duration, n http.Handler) { - srv := &Server{ - Timeout: timeout, - TCPKeepAlive: 3 * time.Minute, - Server: &http.Server{Addr: addr, Handler: n}, - // Logger: DefaultLogger(), - } - - if err := srv.ListenAndServe(); err != nil { - if opErr, ok := err.(*net.OpError); !ok || (ok && opErr.Op != "accept") { - srv.logf("%s", err) - os.Exit(1) - } - } - -} - -// RunWithErr is an alternative version of Run function which can return error. -// -// Unlike Run this version will not exit the program if an error is encountered but will -// return it instead. -func RunWithErr(addr string, timeout time.Duration, n http.Handler) error { - srv := &Server{ - Timeout: timeout, - TCPKeepAlive: 3 * time.Minute, - Server: &http.Server{Addr: addr, Handler: n}, - Logger: DefaultLogger(), - } - - return srv.ListenAndServe() -} - -// ListenAndServe is equivalent to http.Server.ListenAndServe with graceful shutdown enabled. -// -// timeout is the duration to wait until killing active requests and stopping the server. -// If timeout is 0, the server never times out. It waits for all active requests to finish. -func ListenAndServe(server *http.Server, timeout time.Duration) error { - srv := &Server{Timeout: timeout, Server: server, Logger: DefaultLogger()} - return srv.ListenAndServe() -} - -// ListenAndServe is equivalent to http.Server.ListenAndServe with graceful shutdown enabled. -func (srv *Server) ListenAndServe() error { - // Create the listener so we can control their lifetime - addr := srv.Addr - if addr == "" { - addr = ":http" - } - conn, err := srv.newTCPListener(addr) - if err != nil { - return err - } - - return srv.Serve(conn) -} - -// ListenAndServeTLS is equivalent to http.Server.ListenAndServeTLS with graceful shutdown enabled. -// -// timeout is the duration to wait until killing active requests and stopping the server. -// If timeout is 0, the server never times out. It waits for all active requests to finish. -func ListenAndServeTLS(server *http.Server, certFile, keyFile string, timeout time.Duration) error { - srv := &Server{Timeout: timeout, Server: server, Logger: DefaultLogger()} - return srv.ListenAndServeTLS(certFile, keyFile) -} - -// ListenTLS is a convenience method that creates an https listener using the -// provided cert and key files. Use this method if you need access to the -// listener object directly. When ready, pass it to the Serve method. -func (srv *Server) ListenTLS(certFile, keyFile string) (net.Listener, error) { - // Create the listener ourselves so we can control its lifetime - addr := srv.Addr - if addr == "" { - addr = ":https" - } - - config := &tls.Config{} - if srv.TLSConfig != nil { - *config = *srv.TLSConfig - } - - var err error - if certFile != "" && keyFile != "" { - config.Certificates = make([]tls.Certificate, 1) - config.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile) - if err != nil { - return nil, err - } - } - - // Enable http2 - enableHTTP2ForTLSConfig(config) - - conn, err := srv.newTCPListener(addr) - if err != nil { - return nil, err - } - - srv.TLSConfig = config - - tlsListener := tls.NewListener(conn, config) - return tlsListener, nil -} - -// Enable HTTP2ForTLSConfig explicitly enables http/2 for a TLS Config. This is due to changes in Go 1.7 where -// http servers are no longer automatically configured to enable http/2 if the server's TLSConfig is set. -// See https://github.com/golang/go/issues/15908 -func enableHTTP2ForTLSConfig(t *tls.Config) { - - if TLSConfigHasHTTP2Enabled(t) { - return - } - - t.NextProtos = append(t.NextProtos, "h2") -} - -// TLSConfigHasHTTP2Enabled checks to see if a given TLS Config has http2 enabled. -func TLSConfigHasHTTP2Enabled(t *tls.Config) bool { - for _, value := range t.NextProtos { - if value == "h2" { - return true - } - } - return false -} - -// ListenAndServeTLS is equivalent to http.Server.ListenAndServeTLS with graceful shutdown enabled. -func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error { - l, err := srv.ListenTLS(certFile, keyFile) - if err != nil { - return err - } - - return srv.Serve(l) -} - -// ListenAndServeTLSConfig can be used with an existing TLS config and is equivalent to -// http.Server.ListenAndServeTLS with graceful shutdown enabled, -func (srv *Server) ListenAndServeTLSConfig(config *tls.Config) error { - addr := srv.Addr - if addr == "" { - addr = ":https" - } - - conn, err := srv.newTCPListener(addr) - if err != nil { - return err - } - - srv.TLSConfig = config - - tlsListener := tls.NewListener(conn, config) - return srv.Serve(tlsListener) -} - -// Serve is equivalent to http.Server.Serve with graceful shutdown enabled. -// -// timeout is the duration to wait until killing active requests and stopping the server. -// If timeout is 0, the server never times out. It waits for all active requests to finish. -func Serve(server *http.Server, l net.Listener, timeout time.Duration) error { - srv := &Server{Timeout: timeout, Server: server, Logger: DefaultLogger()} - - return srv.Serve(l) -} - -// Serve is equivalent to http.Server.Serve with graceful shutdown enabled. -func (srv *Server) Serve(listener net.Listener) error { - - if srv.ListenLimit != 0 { - listener = LimitListener(listener, srv.ListenLimit) - } - - // Make our stopchan - srv.StopChan() - - // Track connection state - add := make(chan net.Conn) - idle := make(chan net.Conn) - active := make(chan net.Conn) - remove := make(chan net.Conn) - - srv.Server.ConnState = func(conn net.Conn, state http.ConnState) { - switch state { - case http.StateNew: - add <- conn - case http.StateActive: - active <- conn - case http.StateIdle: - idle <- conn - case http.StateClosed, http.StateHijacked: - remove <- conn - } - - srv.stopLock.Lock() - defer srv.stopLock.Unlock() - - if srv.ConnState != nil { - srv.ConnState(conn, state) - } - } - - // Manage open connections - shutdown := make(chan chan struct{}) - kill := make(chan struct{}) - go srv.manageConnections(add, idle, active, remove, shutdown, kill) - - interrupt := srv.interruptChan() - // Set up the interrupt handler - if !srv.NoSignalHandling { - signalNotify(interrupt) - } - quitting := make(chan struct{}) - go srv.handleInterrupt(interrupt, quitting, listener) - - // Serve with graceful listener. - // Execution blocks here until listener.Close() is called, above. - err := srv.Server.Serve(listener) - if err != nil { - // If the underlying listening is closed, Serve returns an error - // complaining about listening on a closed socket. This is expected, so - // let's ignore the error if we are the ones who explicitly closed the - // socket. - select { - case <-quitting: - err = nil - default: - } - } - - srv.shutdown(shutdown, kill) - - return err -} - -// Stop instructs the type to halt operations and close -// the stop channel when it is finished. -// -// timeout is grace period for which to wait before shutting -// down the server. The timeout value passed here will override the -// timeout given when constructing the server, as this is an explicit -// command to stop the server. -func (srv *Server) Stop(timeout time.Duration) { - srv.stopLock.Lock() - defer srv.stopLock.Unlock() - - srv.Timeout = timeout - sendSignalInt(srv.interruptChan()) -} - -// StopChan gets the stop channel which will block until -// stopping has completed, at which point it is closed. -// Callers should never close the stop channel. -func (srv *Server) StopChan() <-chan struct{} { - srv.chanLock.Lock() - defer srv.chanLock.Unlock() - - if srv.stopChan == nil { - srv.stopChan = make(chan struct{}) - } - return srv.stopChan -} - -// DefaultLogger returns the logger used by Run, RunWithErr, ListenAndServe, ListenAndServeTLS and Serve. -// The logger outputs to STDERR by default. -func DefaultLogger() *log.Logger { - return log.New(os.Stderr, "[graceful] ", 0) -} - -func (srv *Server) manageConnections(add, idle, active, remove chan net.Conn, shutdown chan chan struct{}, kill chan struct{}) { - var done chan struct{} - srv.connections = map[net.Conn]struct{}{} - srv.idleConnections = map[net.Conn]struct{}{} - for { - select { - case conn := <-add: - srv.connections[conn] = struct{}{} - srv.idleConnections[conn] = struct{}{} // Newly-added connections are considered idle until they become active. - case conn := <-idle: - srv.idleConnections[conn] = struct{}{} - case conn := <-active: - delete(srv.idleConnections, conn) - case conn := <-remove: - delete(srv.connections, conn) - delete(srv.idleConnections, conn) - if done != nil && len(srv.connections) == 0 { - done <- struct{}{} - return - } - case done = <-shutdown: - if len(srv.connections) == 0 && len(srv.idleConnections) == 0 { - done <- struct{}{} - return - } - // a shutdown request has been received. if we have open idle - // connections, we must close all of them now. this prevents idle - // connections from holding the server open while waiting for them to - // hit their idle timeout. - for k := range srv.idleConnections { - if err := k.Close(); err != nil { - srv.logf("[ERROR] %s", err) - } - } - case <-kill: - srv.stopLock.Lock() - defer srv.stopLock.Unlock() - - srv.Server.ConnState = nil - for k := range srv.connections { - if err := k.Close(); err != nil { - srv.logf("[ERROR] %s", err) - } - } - return - } - } -} - -func (srv *Server) interruptChan() chan os.Signal { - srv.chanLock.Lock() - defer srv.chanLock.Unlock() - - if srv.interrupt == nil { - srv.interrupt = make(chan os.Signal, 1) - } - - return srv.interrupt -} - -func (srv *Server) handleInterrupt(interrupt chan os.Signal, quitting chan struct{}, listener net.Listener) { - for _ = range interrupt { - if srv.Interrupted { - srv.logf("already shutting down") - continue - } - srv.logf("shutdown initiated") - srv.Interrupted = true - if srv.BeforeShutdown != nil { - if !srv.BeforeShutdown() { - srv.Interrupted = false - continue - } - } - - close(quitting) - srv.SetKeepAlivesEnabled(false) - if err := listener.Close(); err != nil { - srv.logf("[ERROR] %s", err) - } - - if srv.ShutdownInitiated != nil { - srv.ShutdownInitiated() - } - } -} - -func (srv *Server) logf(format string, args ...interface{}) { - if srv.LogFunc != nil { - srv.LogFunc(format, args...) - } else if srv.Logger != nil { - srv.Logger.Printf(format, args...) - } -} - -func (srv *Server) shutdown(shutdown chan chan struct{}, kill chan struct{}) { - // Request done notification - done := make(chan struct{}) - shutdown <- done - - srv.stopLock.Lock() - defer srv.stopLock.Unlock() - if srv.Timeout > 0 { - select { - case <-done: - case <-time.After(srv.Timeout): - close(kill) - } - } else { - <-done - } - // Close the stopChan to wake up any blocked goroutines. - srv.chanLock.Lock() - if srv.stopChan != nil { - close(srv.stopChan) - } - srv.chanLock.Unlock() -} - -func (srv *Server) newTCPListener(addr string) (net.Listener, error) { - conn, err := net.Listen("tcp", addr) - if err != nil { - return conn, err - } - if srv.TCPKeepAlive != 0 { - conn = keepAliveListener{conn, srv.TCPKeepAlive} - } - return conn, nil -} diff --git a/vendor/github.com/tylerb/graceful/keepalive_listener.go b/vendor/github.com/tylerb/graceful/keepalive_listener.go deleted file mode 100644 index 1484bc21..00000000 --- a/vendor/github.com/tylerb/graceful/keepalive_listener.go +++ /dev/null @@ -1,32 +0,0 @@ -package graceful - -import ( - "net" - "time" -) - -type keepAliveConn interface { - SetKeepAlive(bool) error - SetKeepAlivePeriod(d time.Duration) error -} - -// keepAliveListener sets TCP keep-alive timeouts on accepted -// connections. It's used by ListenAndServe and ListenAndServeTLS so -// dead TCP connections (e.g. closing laptop mid-download) eventually -// go away. -type keepAliveListener struct { - net.Listener - keepAlivePeriod time.Duration -} - -func (ln keepAliveListener) Accept() (net.Conn, error) { - c, err := ln.Listener.Accept() - if err != nil { - return nil, err - } - - kac := c.(keepAliveConn) - kac.SetKeepAlive(true) - kac.SetKeepAlivePeriod(ln.keepAlivePeriod) - return c, nil -} diff --git a/vendor/github.com/tylerb/graceful/limit_listen.go b/vendor/github.com/tylerb/graceful/limit_listen.go deleted file mode 100644 index ce32ce99..00000000 --- a/vendor/github.com/tylerb/graceful/limit_listen.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2013 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package graceful - -import ( - "errors" - "net" - "sync" - "time" -) - -// ErrNotTCP indicates that network connection is not a TCP connection. -var ErrNotTCP = errors.New("only tcp connections have keepalive") - -// LimitListener returns a Listener that accepts at most n simultaneous -// connections from the provided Listener. -func LimitListener(l net.Listener, n int) net.Listener { - return &limitListener{l, make(chan struct{}, n)} -} - -type limitListener struct { - net.Listener - sem chan struct{} -} - -func (l *limitListener) acquire() { l.sem <- struct{}{} } -func (l *limitListener) release() { <-l.sem } - -func (l *limitListener) Accept() (net.Conn, error) { - l.acquire() - c, err := l.Listener.Accept() - if err != nil { - l.release() - return nil, err - } - return &limitListenerConn{Conn: c, release: l.release}, nil -} - -type limitListenerConn struct { - net.Conn - releaseOnce sync.Once - release func() -} - -func (l *limitListenerConn) Close() error { - err := l.Conn.Close() - l.releaseOnce.Do(l.release) - return err -} - -func (l *limitListenerConn) SetKeepAlive(doKeepAlive bool) error { - tcpc, ok := l.Conn.(*net.TCPConn) - if !ok { - return ErrNotTCP - } - return tcpc.SetKeepAlive(doKeepAlive) -} - -func (l *limitListenerConn) SetKeepAlivePeriod(d time.Duration) error { - tcpc, ok := l.Conn.(*net.TCPConn) - if !ok { - return ErrNotTCP - } - return tcpc.SetKeepAlivePeriod(d) -} diff --git a/vendor/github.com/tylerb/graceful/signal.go b/vendor/github.com/tylerb/graceful/signal.go deleted file mode 100644 index 9550978f..00000000 --- a/vendor/github.com/tylerb/graceful/signal.go +++ /dev/null @@ -1,17 +0,0 @@ -//+build !appengine - -package graceful - -import ( - "os" - "os/signal" - "syscall" -) - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} - -func sendSignalInt(interrupt chan<- os.Signal) { - interrupt <- syscall.SIGINT -} diff --git a/vendor/github.com/tylerb/graceful/signal_appengine.go b/vendor/github.com/tylerb/graceful/signal_appengine.go deleted file mode 100644 index 6b776f08..00000000 --- a/vendor/github.com/tylerb/graceful/signal_appengine.go +++ /dev/null @@ -1,13 +0,0 @@ -//+build appengine - -package graceful - -import "os" - -func signalNotify(interrupt chan<- os.Signal) { - // Does not notify in the case of AppEngine. -} - -func sendSignalInt(interrupt chan<- os.Signal) { - // Does not send in the case of AppEngine. -} diff --git a/vendor/github.com/tylerb/graceful/tests/main.go b/vendor/github.com/tylerb/graceful/tests/main.go deleted file mode 100644 index 9380ae69..00000000 --- a/vendor/github.com/tylerb/graceful/tests/main.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "fmt" - "sync" - - "github.com/urfave/negroni" - "gopkg.in/tylerb/graceful.v1" -) - -func main() { - - var wg sync.WaitGroup - - wg.Add(3) - go func() { - n := negroni.New() - fmt.Println("Launching server on :3000") - graceful.Run(":3000", 0, n) - fmt.Println("Terminated server on :3000") - wg.Done() - }() - go func() { - n := negroni.New() - fmt.Println("Launching server on :3001") - graceful.Run(":3001", 0, n) - fmt.Println("Terminated server on :3001") - wg.Done() - }() - go func() { - n := negroni.New() - fmt.Println("Launching server on :3002") - graceful.Run(":3002", 0, n) - fmt.Println("Terminated server on :3002") - wg.Done() - }() - fmt.Println("Press ctrl+c. All servers should terminate.") - wg.Wait() - -} diff --git a/vendor/github.com/valyala/bytebufferpool/.travis.yml b/vendor/github.com/valyala/bytebufferpool/.travis.yml new file mode 100644 index 00000000..6a6ec2eb --- /dev/null +++ b/vendor/github.com/valyala/bytebufferpool/.travis.yml @@ -0,0 +1,15 @@ +language: go + +go: + - 1.6 + +script: + # build test for supported platforms + - GOOS=linux go build + - GOOS=darwin go build + - GOOS=freebsd go build + - GOOS=windows go build + - GOARCH=386 go build + + # run tests on a standard platform + - go test -v ./... diff --git a/vendor/github.com/valyala/bytebufferpool/README.md b/vendor/github.com/valyala/bytebufferpool/README.md new file mode 100644 index 00000000..061357e8 --- /dev/null +++ b/vendor/github.com/valyala/bytebufferpool/README.md @@ -0,0 +1,21 @@ +[![Build Status](https://travis-ci.org/valyala/bytebufferpool.svg)](https://travis-ci.org/valyala/bytebufferpool) +[![GoDoc](https://godoc.org/github.com/valyala/bytebufferpool?status.svg)](http://godoc.org/github.com/valyala/bytebufferpool) +[![Go Report](http://goreportcard.com/badge/valyala/bytebufferpool)](http://goreportcard.com/report/valyala/bytebufferpool) + +# bytebufferpool + +An implementation of a pool of byte buffers with anti-memory-waste protection. + +The pool may waste limited amount of memory due to fragmentation. +This amount equals to the maximum total size of the byte buffers +in concurrent use. + +# Benchmark results +Currently bytebufferpool is fastest and most effective buffer pool written in Go. + +You can find results [here](https://omgnull.github.io/go-benchmark/buffer/). + +# bytebufferpool users + +* [fasthttp](https://github.com/valyala/fasthttp) +* [quicktemplate](https://github.com/valyala/quicktemplate) diff --git a/vendor/github.com/valyala/fasttemplate/README.md b/vendor/github.com/valyala/fasttemplate/README.md new file mode 100644 index 00000000..3a4d56ce --- /dev/null +++ b/vendor/github.com/valyala/fasttemplate/README.md @@ -0,0 +1,85 @@ +fasttemplate +============ + +Simple and fast template engine for Go. + +Fasttemplate peforms only a single task - it substitutes template placeholders +with user-defined values. At high speed :) + +Take a look at [quicktemplate](https://github.com/valyala/quicktemplate) if you need fast yet powerful html template engine. + +*Please note that fasttemplate doesn't do any escaping on template values +unlike [html/template](http://golang.org/pkg/html/template/) do. So values +must be properly escaped before passing them to fasttemplate.* + +Fasttemplate is faster than [text/template](http://golang.org/pkg/text/template/), +[strings.Replace](http://golang.org/pkg/strings/#Replace), +[strings.Replacer](http://golang.org/pkg/strings/#Replacer) +and [fmt.Fprintf](https://golang.org/pkg/fmt/#Fprintf) on placeholders' substitution. + +Below are benchmark results comparing fasttemplate performance to text/template, +strings.Replace, strings.Replacer and fmt.Fprintf: + +``` +$ go test -bench=. -benchmem +PASS +BenchmarkFmtFprintf-4 2000000 790 ns/op 0 B/op 0 allocs/op +BenchmarkStringsReplace-4 500000 3474 ns/op 2112 B/op 14 allocs/op +BenchmarkStringsReplacer-4 500000 2657 ns/op 2256 B/op 23 allocs/op +BenchmarkTextTemplate-4 500000 3333 ns/op 336 B/op 19 allocs/op +BenchmarkFastTemplateExecuteFunc-4 5000000 349 ns/op 0 B/op 0 allocs/op +BenchmarkFastTemplateExecute-4 3000000 383 ns/op 0 B/op 0 allocs/op +BenchmarkFastTemplateExecuteFuncString-4 3000000 549 ns/op 144 B/op 1 allocs/op +BenchmarkFastTemplateExecuteString-4 3000000 572 ns/op 144 B/op 1 allocs/op +BenchmarkFastTemplateExecuteTagFunc-4 2000000 743 ns/op 144 B/op 3 allocs/op +``` + + +Docs +==== + +See http://godoc.org/github.com/valyala/fasttemplate . + + +Usage +===== + +```go + template := "http://{{host}}/?q={{query}}&foo={{bar}}{{bar}}" + t := fasttemplate.New(template, "{{", "}}") + s := t.ExecuteString(map[string]interface{}{ + "host": "google.com", + "query": url.QueryEscape("hello=world"), + "bar": "foobar", + }) + fmt.Printf("%s", s) + + // Output: + // http://google.com/?q=hello%3Dworld&foo=foobarfoobar +``` + + +Advanced usage +============== + +```go + template := "Hello, [user]! You won [prize]!!! [foobar]" + t, err := fasttemplate.NewTemplate(template, "[", "]") + if err != nil { + log.Fatalf("unexpected error when parsing template: %s", err) + } + s := t.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { + switch tag { + case "user": + return w.Write([]byte("John")) + case "prize": + return w.Write([]byte("$100500")) + default: + return w.Write([]byte(fmt.Sprintf("[unknown tag %q]", tag))) + } + }) + fmt.Printf("%s", s) + + // Output: + // Hello, John! You won $100500!!! [unknown tag "foobar"] +``` diff --git a/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/bytebuffer.go b/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/bytebuffer.go deleted file mode 100644 index 07a055a2..00000000 --- a/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/bytebuffer.go +++ /dev/null @@ -1,111 +0,0 @@ -package bytebufferpool - -import "io" - -// ByteBuffer provides byte buffer, which can be used for minimizing -// memory allocations. -// -// ByteBuffer may be used with functions appending data to the given []byte -// slice. See example code for details. -// -// Use Get for obtaining an empty byte buffer. -type ByteBuffer struct { - - // B is a byte buffer to use in append-like workloads. - // See example code for details. - B []byte -} - -// Len returns the size of the byte buffer. -func (b *ByteBuffer) Len() int { - return len(b.B) -} - -// ReadFrom implements io.ReaderFrom. -// -// The function appends all the data read from r to b. -func (b *ByteBuffer) ReadFrom(r io.Reader) (int64, error) { - p := b.B - nStart := int64(len(p)) - nMax := int64(cap(p)) - n := nStart - if nMax == 0 { - nMax = 64 - p = make([]byte, nMax) - } else { - p = p[:nMax] - } - for { - if n == nMax { - nMax *= 2 - bNew := make([]byte, nMax) - copy(bNew, p) - p = bNew - } - nn, err := r.Read(p[n:]) - n += int64(nn) - if err != nil { - b.B = p[:n] - n -= nStart - if err == io.EOF { - return n, nil - } - return n, err - } - } -} - -// WriteTo implements io.WriterTo. -func (b *ByteBuffer) WriteTo(w io.Writer) (int64, error) { - n, err := w.Write(b.B) - return int64(n), err -} - -// Bytes returns b.B, i.e. all the bytes accumulated in the buffer. -// -// The purpose of this function is bytes.Buffer compatibility. -func (b *ByteBuffer) Bytes() []byte { - return b.B -} - -// Write implements io.Writer - it appends p to ByteBuffer.B -func (b *ByteBuffer) Write(p []byte) (int, error) { - b.B = append(b.B, p...) - return len(p), nil -} - -// WriteByte appends the byte c to the buffer. -// -// The purpose of this function is bytes.Buffer compatibility. -// -// The function always returns nil. -func (b *ByteBuffer) WriteByte(c byte) error { - b.B = append(b.B, c) - return nil -} - -// WriteString appends s to ByteBuffer.B. -func (b *ByteBuffer) WriteString(s string) (int, error) { - b.B = append(b.B, s...) - return len(s), nil -} - -// Set sets ByteBuffer.B to p. -func (b *ByteBuffer) Set(p []byte) { - b.B = append(b.B[:0], p...) -} - -// SetString sets ByteBuffer.B to s. -func (b *ByteBuffer) SetString(s string) { - b.B = append(b.B[:0], s...) -} - -// String returns string representation of ByteBuffer.B. -func (b *ByteBuffer) String() string { - return string(b.B) -} - -// Reset makes ByteBuffer.B empty. -func (b *ByteBuffer) Reset() { - b.B = b.B[:0] -} diff --git a/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/doc.go b/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/doc.go deleted file mode 100644 index e511b7c5..00000000 --- a/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package bytebufferpool implements a pool of byte buffers -// with anti-fragmentation protection. -// -// The pool may waste limited amount of memory due to fragmentation. -// This amount equals to the maximum total size of the byte buffers -// in concurrent use. -package bytebufferpool diff --git a/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/pool.go b/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/pool.go deleted file mode 100644 index 8bb4134d..00000000 --- a/vendor/github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool/pool.go +++ /dev/null @@ -1,151 +0,0 @@ -package bytebufferpool - -import ( - "sort" - "sync" - "sync/atomic" -) - -const ( - minBitSize = 6 // 2**6=64 is a CPU cache line size - steps = 20 - - minSize = 1 << minBitSize - maxSize = 1 << (minBitSize + steps - 1) - - calibrateCallsThreshold = 42000 - maxPercentile = 0.95 -) - -// Pool represents byte buffer pool. -// -// Distinct pools may be used for distinct types of byte buffers. -// Properly determined byte buffer types with their own pools may help reducing -// memory waste. -type Pool struct { - calls [steps]uint64 - calibrating uint64 - - defaultSize uint64 - maxSize uint64 - - pool sync.Pool -} - -var defaultPool Pool - -// Get returns an empty byte buffer from the pool. -// -// Got byte buffer may be returned to the pool via Put call. -// This reduces the number of memory allocations required for byte buffer -// management. -func Get() *ByteBuffer { return defaultPool.Get() } - -// Get returns new byte buffer with zero length. -// -// The byte buffer may be returned to the pool via Put after the use -// in order to minimize GC overhead. -func (p *Pool) Get() *ByteBuffer { - v := p.pool.Get() - if v != nil { - return v.(*ByteBuffer) - } - return &ByteBuffer{ - B: make([]byte, 0, atomic.LoadUint64(&p.defaultSize)), - } -} - -// Put returns byte buffer to the pool. -// -// ByteBuffer.B mustn't be touched after returning it to the pool. -// Otherwise data races will occur. -func Put(b *ByteBuffer) { defaultPool.Put(b) } - -// Put releases byte buffer obtained via Get to the pool. -// -// The buffer mustn't be accessed after returning to the pool. -func (p *Pool) Put(b *ByteBuffer) { - idx := index(len(b.B)) - - if atomic.AddUint64(&p.calls[idx], 1) > calibrateCallsThreshold { - p.calibrate() - } - - maxSize := int(atomic.LoadUint64(&p.maxSize)) - if maxSize == 0 || cap(b.B) <= maxSize { - b.Reset() - p.pool.Put(b) - } -} - -func (p *Pool) calibrate() { - if !atomic.CompareAndSwapUint64(&p.calibrating, 0, 1) { - return - } - - a := make(callSizes, 0, steps) - var callsSum uint64 - for i := uint64(0); i < steps; i++ { - calls := atomic.SwapUint64(&p.calls[i], 0) - callsSum += calls - a = append(a, callSize{ - calls: calls, - size: minSize << i, - }) - } - sort.Sort(a) - - defaultSize := a[0].size - maxSize := defaultSize - - maxSum := uint64(float64(callsSum) * maxPercentile) - callsSum = 0 - for i := 0; i < steps; i++ { - if callsSum > maxSum { - break - } - callsSum += a[i].calls - size := a[i].size - if size > maxSize { - maxSize = size - } - } - - atomic.StoreUint64(&p.defaultSize, defaultSize) - atomic.StoreUint64(&p.maxSize, maxSize) - - atomic.StoreUint64(&p.calibrating, 0) -} - -type callSize struct { - calls uint64 - size uint64 -} - -type callSizes []callSize - -func (ci callSizes) Len() int { - return len(ci) -} - -func (ci callSizes) Less(i, j int) bool { - return ci[i].calls > ci[j].calls -} - -func (ci callSizes) Swap(i, j int) { - ci[i], ci[j] = ci[j], ci[i] -} - -func index(n int) int { - n-- - n >>= minBitSize - idx := 0 - for n > 0 { - n >>= 1 - idx++ - } - if idx >= steps { - idx = steps - 1 - } - return idx -} diff --git a/vendor/github.com/x-cray/logrus-prefixed-formatter/LICENSE b/vendor/github.com/x-cray/logrus-prefixed-formatter/LICENSE deleted file mode 100644 index b41cb238..00000000 --- a/vendor/github.com/x-cray/logrus-prefixed-formatter/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Denis Parchenko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/x-cray/logrus-prefixed-formatter/examples/basic.go b/vendor/github.com/x-cray/logrus-prefixed-formatter/examples/basic.go deleted file mode 100644 index 2a42cb43..00000000 --- a/vendor/github.com/x-cray/logrus-prefixed-formatter/examples/basic.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "github.com/sirupsen/logrus" - prefixed "github.com/x-cray/logrus-prefixed-formatter" -) - -var log = logrus.New() - -func init() { - formatter := new(prefixed.TextFormatter) - log.Formatter = formatter - log.Level = logrus.DebugLevel -} - -func main() { - defer func() { - err := recover() - if err != nil { - // Fatal message - log.WithFields(logrus.Fields{ - "omg": true, - "number": 100, - }).Fatal("[main] The ice breaks!") - } - }() - - // You could either provide a map key called `prefix` to add prefix - log.WithFields(logrus.Fields{ - "prefix": "main", - "animal": "walrus", - "number": 8, - }).Debug("Started observing beach") - - // Or you can simply add prefix in square brackets within message itself - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Debug("[main] A group of walrus emerges from the ocean") - - // Warning message - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("[main] The group's number increased tremendously!") - - // Information message - log.WithFields(logrus.Fields{ - "prefix": "sensor", - "temperature": -4, - }).Info("Temperature changes") - - // Panic message - log.WithFields(logrus.Fields{ - "prefix": "sensor", - "animal": "orca", - "size": 9009, - }).Panic("It's over 9000!") -} diff --git a/vendor/github.com/x-cray/logrus-prefixed-formatter/examples/themes.go b/vendor/github.com/x-cray/logrus-prefixed-formatter/examples/themes.go deleted file mode 100644 index 6c911aea..00000000 --- a/vendor/github.com/x-cray/logrus-prefixed-formatter/examples/themes.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "github.com/sirupsen/logrus" - prefixed "github.com/x-cray/logrus-prefixed-formatter" -) - -var log = logrus.New() - -func init() { - formatter := new(prefixed.TextFormatter) - formatter.FullTimestamp = true - - // Set specific colors for prefix and timestamp - formatter.SetColorScheme(&prefixed.ColorScheme{ - PrefixStyle: "blue+b", - TimestampStyle: "white+h", - }) - - log.Formatter = formatter - log.Level = logrus.DebugLevel -} - -func main() { - log.WithFields(logrus.Fields{ - "prefix": "main", - "animal": "walrus", - "number": 8, - }).Debug("Started observing beach") - - // Or you can simply add prefix in square brackets within message itself - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Debug("[main] A group of walrus emerges from the ocean") - - // Warning message - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("[main] The group's number increased tremendously!") - - // Information message - log.WithFields(logrus.Fields{ - "prefix": "sensor", - "temperature": -4, - }).Info("Temperature changes") -} diff --git a/vendor/github.com/x-cray/logrus-prefixed-formatter/formatter.go b/vendor/github.com/x-cray/logrus-prefixed-formatter/formatter.go deleted file mode 100644 index 7cb807da..00000000 --- a/vendor/github.com/x-cray/logrus-prefixed-formatter/formatter.go +++ /dev/null @@ -1,382 +0,0 @@ -package prefixed - -import ( - "bytes" - "fmt" - "io" - "os" - "regexp" - "sort" - "strings" - "sync" - "time" - - "github.com/mgutz/ansi" - "github.com/sirupsen/logrus" - "golang.org/x/crypto/ssh/terminal" -) - -const defaultTimestampFormat = time.RFC3339 - -var ( - baseTimestamp time.Time = time.Now() - defaultColorScheme *ColorScheme = &ColorScheme{ - InfoLevelStyle: "green", - WarnLevelStyle: "yellow", - ErrorLevelStyle: "red", - FatalLevelStyle: "red", - PanicLevelStyle: "red", - DebugLevelStyle: "blue", - PrefixStyle: "cyan", - TimestampStyle: "black+h", - } - noColorsColorScheme *compiledColorScheme = &compiledColorScheme{ - InfoLevelColor: ansi.ColorFunc(""), - WarnLevelColor: ansi.ColorFunc(""), - ErrorLevelColor: ansi.ColorFunc(""), - FatalLevelColor: ansi.ColorFunc(""), - PanicLevelColor: ansi.ColorFunc(""), - DebugLevelColor: ansi.ColorFunc(""), - PrefixColor: ansi.ColorFunc(""), - TimestampColor: ansi.ColorFunc(""), - } - defaultCompiledColorScheme *compiledColorScheme = compileColorScheme(defaultColorScheme) -) - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) -} - -type ColorScheme struct { - InfoLevelStyle string - WarnLevelStyle string - ErrorLevelStyle string - FatalLevelStyle string - PanicLevelStyle string - DebugLevelStyle string - PrefixStyle string - TimestampStyle string -} - -type compiledColorScheme struct { - InfoLevelColor func(string) string - WarnLevelColor func(string) string - ErrorLevelColor func(string) string - FatalLevelColor func(string) string - PanicLevelColor func(string) string - DebugLevelColor func(string) string - PrefixColor func(string) string - TimestampColor func(string) string -} - -type TextFormatter struct { - // Set to true to bypass checking for a TTY before outputting colors. - ForceColors bool - - // Force disabling colors. For a TTY colors are enabled by default. - DisableColors bool - - // Force formatted layout, even for non-TTY output. - ForceFormatting bool - - // Disable timestamp logging. useful when output is redirected to logging - // system that already adds timestamps. - DisableTimestamp bool - - // Disable the conversion of the log levels to uppercase - DisableUppercase bool - - // Enable logging the full timestamp when a TTY is attached instead of just - // the time passed since beginning of execution. - FullTimestamp bool - - // Timestamp format to use for display when a full timestamp is printed. - TimestampFormat string - - // The fields are sorted by default for a consistent output. For applications - // that log extremely frequently and don't use the JSON formatter this may not - // be desired. - DisableSorting bool - - // Wrap empty fields in quotes if true. - QuoteEmptyFields bool - - // Can be set to the override the default quoting character " - // with something else. For example: ', or `. - QuoteCharacter string - - // Pad msg field with spaces on the right for display. - // The value for this parameter will be the size of padding. - // Its default value is zero, which means no padding will be applied for msg. - SpacePadding int - - // Pad prefix field with spaces on the right for display. - // The value for this parameter will be the size of padding. - // Its default value is zero, which means no padding will be applied for prefix. - PrefixPadding int - - // Color scheme to use. - colorScheme *compiledColorScheme - - // Whether the logger's out is to a terminal. - isTerminal bool - - sync.Once -} - -func getCompiledColor(main string, fallback string) func(string) string { - var style string - if main != "" { - style = main - } else { - style = fallback - } - return ansi.ColorFunc(style) -} - -func compileColorScheme(s *ColorScheme) *compiledColorScheme { - return &compiledColorScheme{ - InfoLevelColor: getCompiledColor(s.InfoLevelStyle, defaultColorScheme.InfoLevelStyle), - WarnLevelColor: getCompiledColor(s.WarnLevelStyle, defaultColorScheme.WarnLevelStyle), - ErrorLevelColor: getCompiledColor(s.ErrorLevelStyle, defaultColorScheme.ErrorLevelStyle), - FatalLevelColor: getCompiledColor(s.FatalLevelStyle, defaultColorScheme.FatalLevelStyle), - PanicLevelColor: getCompiledColor(s.PanicLevelStyle, defaultColorScheme.PanicLevelStyle), - DebugLevelColor: getCompiledColor(s.DebugLevelStyle, defaultColorScheme.DebugLevelStyle), - PrefixColor: getCompiledColor(s.PrefixStyle, defaultColorScheme.PrefixStyle), - TimestampColor: getCompiledColor(s.TimestampStyle, defaultColorScheme.TimestampStyle), - } -} - -func (f *TextFormatter) init(entry *logrus.Entry) { - if len(f.QuoteCharacter) == 0 { - f.QuoteCharacter = "\"" - } - if entry.Logger != nil { - f.isTerminal = f.checkIfTerminal(entry.Logger.Out) - } -} - -func (f *TextFormatter) checkIfTerminal(w io.Writer) bool { - switch v := w.(type) { - case *os.File: - return terminal.IsTerminal(int(v.Fd())) - default: - return false - } -} - -func (f *TextFormatter) SetColorScheme(colorScheme *ColorScheme) { - f.colorScheme = compileColorScheme(colorScheme) -} - -func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) { - var b *bytes.Buffer - var keys []string = make([]string, 0, len(entry.Data)) - for k := range entry.Data { - keys = append(keys, k) - } - lastKeyIdx := len(keys) - 1 - - if !f.DisableSorting { - sort.Strings(keys) - } - if entry.Buffer != nil { - b = entry.Buffer - } else { - b = &bytes.Buffer{} - } - - prefixFieldClashes(entry.Data) - - f.Do(func() { f.init(entry) }) - - isFormatted := f.ForceFormatting || f.isTerminal - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = defaultTimestampFormat - } - if isFormatted { - isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors - var colorScheme *compiledColorScheme - if isColored { - if f.colorScheme == nil { - colorScheme = defaultCompiledColorScheme - } else { - colorScheme = f.colorScheme - } - } else { - colorScheme = noColorsColorScheme - } - f.printColored(b, entry, keys, timestampFormat, colorScheme) - } else { - if !f.DisableTimestamp { - f.appendKeyValue(b, "time", entry.Time.Format(timestampFormat), true) - } - f.appendKeyValue(b, "level", entry.Level.String(), true) - if entry.Message != "" { - f.appendKeyValue(b, "msg", entry.Message, lastKeyIdx >= 0) - } - for i, key := range keys { - f.appendKeyValue(b, key, entry.Data[key], lastKeyIdx != i) - } - } - - b.WriteByte('\n') - return b.Bytes(), nil -} - -func (f *TextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string, timestampFormat string, colorScheme *compiledColorScheme) { - var levelColor func(string) string - var levelText string - switch entry.Level { - case logrus.InfoLevel: - levelColor = colorScheme.InfoLevelColor - case logrus.WarnLevel: - levelColor = colorScheme.WarnLevelColor - case logrus.ErrorLevel: - levelColor = colorScheme.ErrorLevelColor - case logrus.FatalLevel: - levelColor = colorScheme.FatalLevelColor - case logrus.PanicLevel: - levelColor = colorScheme.PanicLevelColor - default: - levelColor = colorScheme.DebugLevelColor - } - - if entry.Level != logrus.WarnLevel { - levelText = entry.Level.String() - } else { - levelText = "warn" - } - - if !f.DisableUppercase { - levelText = strings.ToUpper(levelText) - } - - level := levelColor(fmt.Sprintf("%5s", levelText)) - prefix := "" - message := entry.Message - - adjustedPrefixPadding := f.PrefixPadding //compensate for ANSI color sequences - - if prefixValue, ok := entry.Data["prefix"]; ok { - rawPrefixLength := len(prefixValue.(string)) - prefix = colorScheme.PrefixColor(" " + prefixValue.(string) + ":") - adjustedPrefixPadding = f.PrefixPadding + (len(prefix) - rawPrefixLength - 1) - } else { - prefixValue, trimmedMsg := extractPrefix(entry.Message) - rawPrefixLength := len(prefixValue) - if len(prefixValue) > 0 { - prefix = colorScheme.PrefixColor(" " + prefixValue + ":") - message = trimmedMsg - } - adjustedPrefixPadding = f.PrefixPadding + (len(prefix) - rawPrefixLength - 1) - } - - prefixFormat := "%s" - if f.PrefixPadding != 0 { - prefixFormat = fmt.Sprintf("%%-%ds", adjustedPrefixPadding) - } - - messageFormat := "%s" - if f.SpacePadding != 0 { - messageFormat = fmt.Sprintf("%%-%ds", f.SpacePadding) - } - - if f.DisableTimestamp { - fmt.Fprintf(b, "%s"+prefixFormat+" "+messageFormat, level, prefix, message) - } else { - var timestamp string - if !f.FullTimestamp { - timestamp = fmt.Sprintf("[%04d]", miniTS()) - } else { - timestamp = fmt.Sprintf("[%s]", entry.Time.Format(timestampFormat)) - } - fmt.Fprintf(b, "%s %s"+prefixFormat+" "+messageFormat, colorScheme.TimestampColor(timestamp), level, prefix, message) - } - for _, k := range keys { - if k != "prefix" { - v := entry.Data[k] - fmt.Fprintf(b, " %s=%+v", levelColor(k), v) - } - } -} - -func (f *TextFormatter) needsQuoting(text string) bool { - if f.QuoteEmptyFields && len(text) == 0 { - return true - } - for _, ch := range text { - if !((ch >= 'a' && ch <= 'z') || - (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || - ch == '-' || ch == '.') { - return true - } - } - return false -} - -func extractPrefix(msg string) (string, string) { - prefix := "" - regex := regexp.MustCompile("^\\[(.*?)\\]") - if regex.MatchString(msg) { - match := regex.FindString(msg) - prefix, msg = match[1:len(match)-1], strings.TrimSpace(msg[len(match):]) - } - return prefix, msg -} - -func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}, appendSpace bool) { - b.WriteString(key) - b.WriteByte('=') - f.appendValue(b, value) - - if appendSpace { - b.WriteByte(' ') - } -} - -func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { - switch value := value.(type) { - case string: - if !f.needsQuoting(value) { - b.WriteString(value) - } else { - fmt.Fprintf(b, "%s%v%s", f.QuoteCharacter, value, f.QuoteCharacter) - } - case error: - errmsg := value.Error() - if !f.needsQuoting(errmsg) { - b.WriteString(errmsg) - } else { - fmt.Fprintf(b, "%s%v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) - } - default: - fmt.Fprint(b, value) - } -} - -// This is to not silently overwrite `time`, `msg` and `level` fields when -// dumping it. If this code wasn't there doing: -// -// logrus.WithField("level", 1).Info("hello") -// -// would just silently drop the user provided level. Instead with this code -// it'll be logged as: -// -// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} -func prefixFieldClashes(data logrus.Fields) { - if t, ok := data["time"]; ok { - data["fields.time"] = t - } - - if m, ok := data["msg"]; ok { - data["fields.msg"] = m - } - - if l, ok := data["level"]; ok { - data["fields.level"] = l - } -} diff --git a/vendor/github.com/xordataexchange/crypt/backend/LICENSE b/vendor/github.com/xordataexchange/crypt/backend/LICENSE deleted file mode 100644 index 43846317..00000000 --- a/vendor/github.com/xordataexchange/crypt/backend/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 XOR Data Exchange, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/xordataexchange/crypt/backend/backend.go b/vendor/github.com/xordataexchange/crypt/backend/backend.go deleted file mode 100644 index bfe894dc..00000000 --- a/vendor/github.com/xordataexchange/crypt/backend/backend.go +++ /dev/null @@ -1,32 +0,0 @@ -// Package backend provides the K/V store interface for crypt backends. -package backend - -// Response represents a response from a backend store. -type Response struct { - Value []byte - Error error -} - -// KVPair holds both a key and value when reading a list. -type KVPair struct { - Key string - Value []byte -} - -type KVPairs []*KVPair - -// A Store is a K/V store backend that retrieves and sets, and monitors -// data in a K/V store. -type Store interface { - // Get retrieves a value from a K/V store for the provided key. - Get(key string) ([]byte, error) - - // List retrieves all keys and values under a provided key. - List(key string) (KVPairs, error) - - // Set sets the provided key to value. - Set(key string, value []byte) error - - // Watch monitors a K/V store for changes to key. - Watch(key string, stop chan bool) <-chan *Response -} diff --git a/vendor/github.com/xordataexchange/crypt/backend/consul/consul.go b/vendor/github.com/xordataexchange/crypt/backend/consul/consul.go deleted file mode 100644 index cf85ed53..00000000 --- a/vendor/github.com/xordataexchange/crypt/backend/consul/consul.go +++ /dev/null @@ -1,87 +0,0 @@ -package consul - -import ( - "fmt" - "strings" - "time" - - "github.com/xordataexchange/crypt/backend" - - "github.com/armon/consul-api" -) - -type Client struct { - client *consulapi.KV - waitIndex uint64 -} - -func New(machines []string) (*Client, error) { - conf := consulapi.DefaultConfig() - if len(machines) > 0 { - conf.Address = machines[0] - } - client, err := consulapi.NewClient(conf) - if err != nil { - return nil, err - } - return &Client{client.KV(), 0}, nil -} - -func (c *Client) Get(key string) ([]byte, error) { - kv, _, err := c.client.Get(key, nil) - if err != nil { - return nil, err - } - if kv == nil { - return nil, fmt.Errorf("Key ( %s ) was not found.", key) - } - return kv.Value, nil -} - -func (c *Client) List(key string) (backend.KVPairs, error) { - pairs, _, err := c.client.List(key, nil) - if err != nil { - return nil, err - } - if err != nil { - return nil, err - } - ret := make(backend.KVPairs, len(pairs), len(pairs)) - for i, kv := range pairs { - ret[i] = &backend.KVPair{Key: kv.Key, Value: kv.Value} - } - return ret, nil -} - -func (c *Client) Set(key string, value []byte) error { - key = strings.TrimPrefix(key, "/") - kv := &consulapi.KVPair{ - Key: key, - Value: value, - } - _, err := c.client.Put(kv, nil) - return err -} - -func (c *Client) Watch(key string, stop chan bool) <-chan *backend.Response { - respChan := make(chan *backend.Response, 0) - go func() { - for { - opts := consulapi.QueryOptions{ - WaitIndex: c.waitIndex, - } - keypair, meta, err := c.client.Get(key, &opts) - if keypair == nil && err == nil { - err = fmt.Errorf("Key ( %s ) was not found.", key) - } - if err != nil { - respChan <- &backend.Response{nil, err} - time.Sleep(time.Second * 5) - continue - } - c.waitIndex = meta.LastIndex - respChan <- &backend.Response{keypair.Value, nil} - } - }() - return respChan -} diff --git a/vendor/github.com/xordataexchange/crypt/backend/etcd/etcd.go b/vendor/github.com/xordataexchange/crypt/backend/etcd/etcd.go deleted file mode 100644 index 18f35510..00000000 --- a/vendor/github.com/xordataexchange/crypt/backend/etcd/etcd.go +++ /dev/null @@ -1,116 +0,0 @@ -package etcd - -import ( - "context" - "errors" - "fmt" - "time" - - "github.com/xordataexchange/crypt/backend" - - goetcd "github.com/coreos/etcd/client" -) - -type Client struct { - client goetcd.Client - keysAPI goetcd.KeysAPI - waitIndex uint64 -} - -func New(machines []string) (*Client, error) { - newClient, err := goetcd.New(goetcd.Config{ - Endpoints: machines, - }) - if err != nil { - return nil, fmt.Errorf("creating new etcd client for crypt.backend.Client: %v", err) - } - keysAPI := goetcd.NewKeysAPI(newClient) - return &Client{client: newClient, keysAPI: keysAPI, waitIndex: 0}, nil -} - -func (c *Client) Get(key string) ([]byte, error) { - return c.GetWithContext(context.TODO(), key) -} - -func (c *Client) GetWithContext(ctx context.Context, key string) ([]byte, error) { - resp, err := c.keysAPI.Get(ctx, key, nil) - if err != nil { - return nil, err - } - return []byte(resp.Node.Value), nil -} - -func addKVPairs(node *goetcd.Node, list backend.KVPairs) backend.KVPairs { - if node.Dir { - for _, n := range node.Nodes { - list = addKVPairs(n, list) - } - return list - } - return append(list, &backend.KVPair{Key: node.Key, Value: []byte(node.Value)}) -} - -func (c *Client) List(key string) (backend.KVPairs, error) { - return c.ListWithContext(context.TODO(), key) -} - -func (c *Client) ListWithContext(ctx context.Context, key string) (backend.KVPairs, error) { - resp, err := c.keysAPI.Get(ctx, key, nil) - if err != nil { - return nil, err - } - if !resp.Node.Dir { - return nil, errors.New("key is not a directory") - } - list := addKVPairs(resp.Node, nil) - return list, nil -} - -func (c *Client) Set(key string, value []byte) error { - return c.SetWithContext(context.TODO(), key, value) -} - -func (c *Client) SetWithContext(ctx context.Context, key string, value []byte) error { - _, err := c.keysAPI.Set(ctx, key, string(value), nil) - return err -} - -func (c *Client) Watch(key string, stop chan bool) <-chan *backend.Response { - return c.WatchWithContext(context.Background(), key, stop) -} - -func (c *Client) WatchWithContext(ctx context.Context, key string, stop chan bool) <-chan *backend.Response { - respChan := make(chan *backend.Response, 0) - go func() { - watcher := c.keysAPI.Watcher(key, nil) - ctx, cancel := context.WithCancel(ctx) - go func() { - <-stop - cancel() - }() - for { - var resp *goetcd.Response - var err error - // if c.waitIndex == 0 { - // resp, err = c.client.Get(key, false, false) - // if err != nil { - // respChan <- &backend.Response{nil, err} - // time.Sleep(time.Second * 5) - // continue - // } - // c.waitIndex = resp.EtcdIndex - // respChan <- &backend.Response{[]byte(resp.Node.Value), nil} - // } - // resp, err = c.client.Watch(key, c.waitIndex+1, false, nil, stop) - resp, err = watcher.Next(ctx) - if err != nil { - respChan <- &backend.Response{nil, err} - time.Sleep(time.Second * 5) - continue - } - c.waitIndex = resp.Node.ModifiedIndex - respChan <- &backend.Response{[]byte(resp.Node.Value), nil} - } - }() - return respChan -} diff --git a/vendor/github.com/xordataexchange/crypt/backend/mock/mock.go b/vendor/github.com/xordataexchange/crypt/backend/mock/mock.go deleted file mode 100644 index 68a9b1c7..00000000 --- a/vendor/github.com/xordataexchange/crypt/backend/mock/mock.go +++ /dev/null @@ -1,61 +0,0 @@ -package mock - -import ( - "errors" - "path" - "strings" - "time" - - "github.com/xordataexchange/crypt/backend" -) - -var mockedStore map[string][]byte - -type Client struct{} - -func New(machines []string) (*Client, error) { - if mockedStore == nil { - mockedStore = make(map[string][]byte, 2) - } - return &Client{}, nil -} - -func (c *Client) Get(key string) ([]byte, error) { - if v, ok := mockedStore[key]; ok { - return v, nil - } - err := errors.New("Could not find key: " + key) - return nil, err -} - -func (c *Client) List(key string) (backend.KVPairs, error) { - var list backend.KVPairs - dir := path.Clean(key) + "/" - for k, v := range mockedStore { - if strings.HasPrefix(k, dir) { - list = append(list, &backend.KVPair{Key: k, Value: v}) - } - } - return list, nil -} - -func (c *Client) Set(key string, value []byte) error { - mockedStore[key] = value - return nil -} - -func (c *Client) Watch(key string, stop chan bool) <-chan *backend.Response { - respChan := make(chan *backend.Response, 0) - go func() { - for { - b, err := c.Get(key) - if err != nil { - respChan <- &backend.Response{nil, err} - time.Sleep(time.Second * 5) - continue - } - respChan <- &backend.Response{b, nil} - } - }() - return respChan -} diff --git a/vendor/github.com/xordataexchange/crypt/config/LICENSE b/vendor/github.com/xordataexchange/crypt/config/LICENSE deleted file mode 100644 index 43846317..00000000 --- a/vendor/github.com/xordataexchange/crypt/config/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 XOR Data Exchange, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/xordataexchange/crypt/config/config.go b/vendor/github.com/xordataexchange/crypt/config/config.go deleted file mode 100644 index 30864ae9..00000000 --- a/vendor/github.com/xordataexchange/crypt/config/config.go +++ /dev/null @@ -1,201 +0,0 @@ -package config - -import ( - "bytes" - "io" - "io/ioutil" - - "github.com/xordataexchange/crypt/backend" - "github.com/xordataexchange/crypt/backend/consul" - "github.com/xordataexchange/crypt/backend/etcd" - "github.com/xordataexchange/crypt/encoding/secconf" -) - -type KVPair struct { - backend.KVPair -} - -type KVPairs []*KVPair - -type configManager struct { - keystore []byte - store backend.Store -} - -// A ConfigManager retrieves and decrypts configuration from a key/value store. -type ConfigManager interface { - Get(key string) ([]byte, error) - List(key string) (KVPairs, error) - Set(key string, value []byte) error - Watch(key string, stop chan bool) <-chan *Response -} - -type standardConfigManager struct { - store backend.Store -} - -func NewStandardConfigManager(client backend.Store) (ConfigManager, error) { - return standardConfigManager{client}, nil -} - -func NewConfigManager(client backend.Store, keystore io.Reader) (ConfigManager, error) { - bytes, err := ioutil.ReadAll(keystore) - if err != nil { - return nil, err - } - return configManager{bytes, client}, nil -} - -// NewStandardEtcdConfigManager returns a new ConfigManager backed by etcd. -func NewStandardEtcdConfigManager(machines []string) (ConfigManager, error) { - store, err := etcd.New(machines) - if err != nil { - return nil, err - } - - return NewStandardConfigManager(store) -} - -// NewStandardConsulConfigManager returns a new ConfigManager backed by consul. -func NewStandardConsulConfigManager(machines []string) (ConfigManager, error) { - store, err := consul.New(machines) - if err != nil { - return nil, err - } - return NewStandardConfigManager(store) -} - -// NewEtcdConfigManager returns a new ConfigManager backed by etcd. -// Data will be encrypted. -func NewEtcdConfigManager(machines []string, keystore io.Reader) (ConfigManager, error) { - store, err := etcd.New(machines) - if err != nil { - return nil, err - } - return NewConfigManager(store, keystore) -} - -// NewConsulConfigManager returns a new ConfigManager backed by consul. -// Data will be encrypted. -func NewConsulConfigManager(machines []string, keystore io.Reader) (ConfigManager, error) { - store, err := consul.New(machines) - if err != nil { - return nil, err - } - return NewConfigManager(store, keystore) -} - -// Get retrieves and decodes a secconf value stored at key. -func (c configManager) Get(key string) ([]byte, error) { - value, err := c.store.Get(key) - if err != nil { - return nil, err - } - return secconf.Decode(value, bytes.NewBuffer(c.keystore)) -} - -// Get retrieves a value stored at key. -// convenience function, no additional value provided over -// `etcdctl` -func (c standardConfigManager) Get(key string) ([]byte, error) { - value, err := c.store.Get(key) - if err != nil { - return nil, err - } - return value, err -} - -// List retrieves and decodes all secconf value stored under key. -func (c configManager) List(key string) (KVPairs, error) { - list, err := c.store.List(key) - retList := make(KVPairs, len(list)) - if err != nil { - return nil, err - } - for i, kv := range list { - retList[i].Key = kv.Key - retList[i].Value, err = secconf.Decode(kv.Value, bytes.NewBuffer(c.keystore)) - if err != nil { - return nil, err - } - } - return retList, nil -} - -// List retrieves all values under key. -// convenience function, no additional value provided over -// `etcdctl` -func (c standardConfigManager) List(key string) (KVPairs, error) { - list, err := c.store.List(key) - retList := make(KVPairs, len(list)) - if err != nil { - return nil, err - } - for i, kv := range list { - retList[i].Key = kv.Key - retList[i].Value = kv.Value - } - return retList, err -} - -// Set will put a key/value into the data store -// and encode it with secconf -func (c configManager) Set(key string, value []byte) error { - encodedValue, err := secconf.Encode(value, bytes.NewBuffer(c.keystore)) - if err == nil { - err = c.store.Set(key, encodedValue) - } - return err -} - -// Set will put a key/value into the data store -func (c standardConfigManager) Set(key string, value []byte) error { - err := c.store.Set(key, value) - return err -} - -type Response struct { - Value []byte - Error error -} - -func (c configManager) Watch(key string, stop chan bool) <-chan *Response { - resp := make(chan *Response, 0) - backendResp := c.store.Watch(key, stop) - go func() { - for { - select { - case <-stop: - return - case r := <-backendResp: - if r.Error != nil { - resp <- &Response{nil, r.Error} - continue - } - value, err := secconf.Decode(r.Value, bytes.NewBuffer(c.keystore)) - resp <- &Response{value, err} - } - } - }() - return resp -} - -func (c standardConfigManager) Watch(key string, stop chan bool) <-chan *Response { - resp := make(chan *Response, 0) - backendResp := c.store.Watch(key, stop) - go func() { - for { - select { - case <-stop: - return - case r := <-backendResp: - if r.Error != nil { - resp <- &Response{nil, r.Error} - continue - } - resp <- &Response{r.Value, nil} - } - } - }() - return resp -} diff --git a/vendor/github.com/xordataexchange/crypt/encoding/secconf/LICENSE b/vendor/github.com/xordataexchange/crypt/encoding/secconf/LICENSE deleted file mode 100644 index 43846317..00000000 --- a/vendor/github.com/xordataexchange/crypt/encoding/secconf/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 XOR Data Exchange, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/xordataexchange/crypt/encoding/secconf/secconf.go b/vendor/github.com/xordataexchange/crypt/encoding/secconf/secconf.go deleted file mode 100644 index 6e94565d..00000000 --- a/vendor/github.com/xordataexchange/crypt/encoding/secconf/secconf.go +++ /dev/null @@ -1,68 +0,0 @@ -// Package secconf implements secconf encoding as specified in the following -// format: -// -// base64(gpg(gzip(data))) -// -package secconf - -import ( - "bytes" - "compress/gzip" - "encoding/base64" - "io" - "io/ioutil" - - "golang.org/x/crypto/openpgp" -) - -// Deocde decodes data using the secconf codec. -func Decode(data []byte, secertKeyring io.Reader) ([]byte, error) { - decoder := base64.NewDecoder(base64.StdEncoding, bytes.NewBuffer(data)) - entityList, err := openpgp.ReadArmoredKeyRing(secertKeyring) - if err != nil { - return nil, err - } - md, err := openpgp.ReadMessage(decoder, entityList, nil, nil) - if err != nil { - return nil, err - } - gzReader, err := gzip.NewReader(md.UnverifiedBody) - if err != nil { - return nil, err - } - defer gzReader.Close() - bytes, err := ioutil.ReadAll(gzReader) - if err != nil { - return nil, err - } - return bytes, nil -} - -// Encode encodes data to a base64 encoded using the secconf codec. -// data is encrypted with all public keys found in the supplied keyring. -func Encode(data []byte, keyring io.Reader) ([]byte, error) { - entityList, err := openpgp.ReadArmoredKeyRing(keyring) - if err != nil { - return nil, err - } - buffer := new(bytes.Buffer) - encoder := base64.NewEncoder(base64.StdEncoding, buffer) - pgpWriter, err := openpgp.Encrypt(encoder, entityList, nil, nil, nil) - if err != nil { - return nil, err - } - gzWriter := gzip.NewWriter(pgpWriter) - if _, err := gzWriter.Write(data); err != nil { - return nil, err - } - if err := gzWriter.Close(); err != nil { - return nil, err - } - if err := pgpWriter.Close(); err != nil { - return nil, err - } - if err := encoder.Close(); err != nil { - return nil, err - } - return buffer.Bytes(), nil -} diff --git a/vendor/github.com/zfjagann/golang-ring/.gitignore b/vendor/github.com/zfjagann/golang-ring/.gitignore new file mode 100644 index 00000000..daf913b1 --- /dev/null +++ b/vendor/github.com/zfjagann/golang-ring/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/zfjagann/golang-ring/README.md b/vendor/github.com/zfjagann/golang-ring/README.md new file mode 100644 index 00000000..1da6cf73 --- /dev/null +++ b/vendor/github.com/zfjagann/golang-ring/README.md @@ -0,0 +1,76 @@ +# ring + +[![GoDoc](https://godoc.org/github.com/zfjagann/golang-ring?status.svg)](https://godoc.org/github.com/zfjagann/golang-ring) + +-- + import "github.com/zfjagann/golang-ring" + +Package ring provides a simple implementation of a ring buffer. + +## Usage + +```go +var DefaultCapacity int = 10 +``` +The DefaultCapacity of an uninitialized Ring buffer. + +Changing this value only affects ring buffers created after it is changed. + +#### type Ring + +```go +type Ring struct { +} +``` + +Type Ring implements a Circular Buffer. The default value of the Ring struct is +a valid (empty) Ring buffer with capacity DefaultCapacify. + +#### func (Ring) Capacity + +```go +func (r Ring) Capacity() int +``` +Capacity returns the current capacity of the ring buffer. + +#### func (*Ring) Dequeue + +```go +func (r *Ring) Dequeue() interface{} +``` +Dequeue a value from the Ring buffer. + +Returns nil if the ring buffer is empty. + +#### func (*Ring) Enqueue + +```go +func (r *Ring) Enqueue(i interface{}) +``` +Enqueue a value into the Ring buffer. + +#### func (*Ring) Peek + +```go +func (r *Ring) Peek() interface{} +``` +Read the value that Dequeue would have dequeued without actually dequeuing it. + +Returns nil if the ring buffer is empty. + +#### func (*Ring) SetCapacity + +```go +func (r *Ring) SetCapacity(size int) +``` +Set the maximum size of the ring buffer. + +#### func (*Ring) Values + +```go +func (r *Ring) Values() []interface{} +``` +Values returns a slice of all the values in the circular buffer without +modifying them at all. The returned slice can be modified independently of the +circular buffer. However, the values inside the slice are shared between the +slice and circular buffer. diff --git a/vendor/github.com/zfjagann/golang-ring/makefile b/vendor/github.com/zfjagann/golang-ring/makefile new file mode 100644 index 00000000..48a57357 --- /dev/null +++ b/vendor/github.com/zfjagann/golang-ring/makefile @@ -0,0 +1,10 @@ +.PHONY: ring test doc + +ring: test doc + +test: + go fmt + go test -v + +doc: + godocdown > README.md diff --git a/vendor/golang.org/x/arch/arm/armasm/LICENSE b/vendor/golang.org/x/arch/arm/armasm/LICENSE deleted file mode 100644 index d29b3726..00000000 --- a/vendor/golang.org/x/arch/arm/armasm/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2015 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/arch/arm/armasm/decode.go b/vendor/golang.org/x/arch/arm/armasm/decode.go deleted file mode 100644 index 6b4d7384..00000000 --- a/vendor/golang.org/x/arch/arm/armasm/decode.go +++ /dev/null @@ -1,567 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package armasm - -import ( - "encoding/binary" - "fmt" -) - -// An instFormat describes the format of an instruction encoding. -// An instruction with 32-bit value x matches the format if x&mask == value -// and the condition matches. -// The condition matches if x>>28 == 0xF && value>>28==0xF -// or if x>>28 != 0xF and value>>28 == 0. -// If x matches the format, then the rest of the fields describe how to interpret x. -// The opBits describe bits that should be extracted from x and added to the opcode. -// For example opBits = 0x1234 means that the value -// (2 bits at offset 1) followed by (4 bits at offset 3) -// should be added to op. -// Finally the args describe how to decode the instruction arguments. -// args is stored as a fixed-size array; if there are fewer than len(args) arguments, -// args[i] == 0 marks the end of the argument list. -type instFormat struct { - mask uint32 - value uint32 - priority int8 - op Op - opBits uint64 - args instArgs -} - -type instArgs [4]instArg - -var ( - errMode = fmt.Errorf("unsupported execution mode") - errShort = fmt.Errorf("truncated instruction") - errUnknown = fmt.Errorf("unknown instruction") -) - -var decoderCover []bool - -// Decode decodes the leading bytes in src as a single instruction. -func Decode(src []byte, mode Mode) (inst Inst, err error) { - if mode != ModeARM { - return Inst{}, errMode - } - if len(src) < 4 { - return Inst{}, errShort - } - - if decoderCover == nil { - decoderCover = make([]bool, len(instFormats)) - } - - x := binary.LittleEndian.Uint32(src) - - // The instFormat table contains both conditional and unconditional instructions. - // Considering only the top 4 bits, the conditional instructions use mask=0, value=0, - // while the unconditional instructions use mask=f, value=f. - // Prepare a version of x with the condition cleared to 0 in conditional instructions - // and then assume mask=f during matching. - const condMask = 0xf0000000 - xNoCond := x - if x&condMask != condMask { - xNoCond &^= condMask - } - var priority int8 -Search: - for i := range instFormats { - f := &instFormats[i] - if xNoCond&(f.mask|condMask) != f.value || f.priority <= priority { - continue - } - delta := uint32(0) - deltaShift := uint(0) - for opBits := f.opBits; opBits != 0; opBits >>= 16 { - n := uint(opBits & 0xFF) - off := uint((opBits >> 8) & 0xFF) - delta |= (x >> off) & (1<> 8) & (1<<4 - 1)) - case arg_R_12: - return Reg((x >> 12) & (1<<4 - 1)) - case arg_R_16: - return Reg((x >> 16) & (1<<4 - 1)) - - case arg_R_12_nzcv: - r := Reg((x >> 12) & (1<<4 - 1)) - if r == R15 { - return APSR_nzcv - } - return r - - case arg_R_16_WB: - mode := AddrLDM - if (x>>21)&1 != 0 { - mode = AddrLDM_WB - } - return Mem{Base: Reg((x >> 16) & (1<<4 - 1)), Mode: mode} - - case arg_R_rotate: - Rm := Reg(x & (1<<4 - 1)) - typ, count := decodeShift(x) - // ROR #0 here means ROR #0, but decodeShift rewrites to RRX #1. - if typ == RotateRightExt { - return Reg(Rm) - } - return RegShift{Rm, typ, uint8(count)} - - case arg_R_shift_R: - Rm := Reg(x & (1<<4 - 1)) - Rs := Reg((x >> 8) & (1<<4 - 1)) - typ := Shift((x >> 5) & (1<<2 - 1)) - return RegShiftReg{Rm, typ, Rs} - - case arg_R_shift_imm: - Rm := Reg(x & (1<<4 - 1)) - typ, count := decodeShift(x) - if typ == ShiftLeft && count == 0 { - return Reg(Rm) - } - return RegShift{Rm, typ, uint8(count)} - - case arg_R1_0: - return Reg((x & (1<<4 - 1))) - case arg_R1_12: - return Reg(((x >> 12) & (1<<4 - 1))) - case arg_R2_0: - return Reg((x & (1<<4 - 1)) | 1) - case arg_R2_12: - return Reg(((x >> 12) & (1<<4 - 1)) | 1) - - case arg_SP: - return SP - - case arg_Sd_Dd: - v := (x >> 12) & (1<<4 - 1) - vx := (x >> 22) & 1 - sz := (x >> 8) & 1 - if sz != 0 { - return D0 + Reg(vx<<4+v) - } else { - return S0 + Reg(v<<1+vx) - } - - case arg_Dd_Sd: - return decodeArg(arg_Sd_Dd, x^(1<<8)) - - case arg_Sd: - v := (x >> 12) & (1<<4 - 1) - vx := (x >> 22) & 1 - return S0 + Reg(v<<1+vx) - - case arg_Sm_Dm: - v := (x >> 0) & (1<<4 - 1) - vx := (x >> 5) & 1 - sz := (x >> 8) & 1 - if sz != 0 { - return D0 + Reg(vx<<4+v) - } else { - return S0 + Reg(v<<1+vx) - } - - case arg_Sm: - v := (x >> 0) & (1<<4 - 1) - vx := (x >> 5) & 1 - return S0 + Reg(v<<1+vx) - - case arg_Dn_half: - v := (x >> 16) & (1<<4 - 1) - vx := (x >> 7) & 1 - return RegX{D0 + Reg(vx<<4+v), int((x >> 21) & 1)} - - case arg_Sn_Dn: - v := (x >> 16) & (1<<4 - 1) - vx := (x >> 7) & 1 - sz := (x >> 8) & 1 - if sz != 0 { - return D0 + Reg(vx<<4+v) - } else { - return S0 + Reg(v<<1+vx) - } - - case arg_Sn: - v := (x >> 16) & (1<<4 - 1) - vx := (x >> 7) & 1 - return S0 + Reg(v<<1+vx) - - case arg_const: - v := x & (1<<8 - 1) - rot := (x >> 8) & (1<<4 - 1) * 2 - if rot > 0 && v&3 == 0 { - // could rotate less - return ImmAlt{uint8(v), uint8(rot)} - } - if rot >= 24 && ((v<<(32-rot))&0xFF)>>(32-rot) == v { - // could wrap around to rot==0. - return ImmAlt{uint8(v), uint8(rot)} - } - return Imm(v>>rot | v<<(32-rot)) - - case arg_endian: - return Endian((x >> 9) & 1) - - case arg_fbits: - return Imm((16 << ((x >> 7) & 1)) - ((x&(1<<4-1))<<1 | (x>>5)&1)) - - case arg_fp_0: - return Imm(0) - - case arg_imm24: - return Imm(x & (1<<24 - 1)) - - case arg_imm5: - return Imm((x >> 7) & (1<<5 - 1)) - - case arg_imm5_32: - x = (x >> 7) & (1<<5 - 1) - if x == 0 { - x = 32 - } - return Imm(x) - - case arg_imm5_nz: - x = (x >> 7) & (1<<5 - 1) - if x == 0 { - return nil - } - return Imm(x) - - case arg_imm_4at16_12at0: - return Imm((x>>16)&(1<<4-1)<<12 | x&(1<<12-1)) - - case arg_imm_12at8_4at0: - return Imm((x>>8)&(1<<12-1)<<4 | x&(1<<4-1)) - - case arg_imm_vfp: - x = (x>>16)&(1<<4-1)<<4 | x&(1<<4-1) - return Imm(x) - - case arg_label24: - imm := (x & (1<<24 - 1)) << 2 - return PCRel(int32(imm<<6) >> 6) - - case arg_label24H: - h := (x >> 24) & 1 - imm := (x&(1<<24-1))<<2 | h<<1 - return PCRel(int32(imm<<6) >> 6) - - case arg_label_m_12: - d := int32(x & (1<<12 - 1)) - return Mem{Base: PC, Mode: AddrOffset, Offset: int16(-d)} - - case arg_label_p_12: - d := int32(x & (1<<12 - 1)) - return Mem{Base: PC, Mode: AddrOffset, Offset: int16(d)} - - case arg_label_pm_12: - d := int32(x & (1<<12 - 1)) - u := (x >> 23) & 1 - if u == 0 { - d = -d - } - return Mem{Base: PC, Mode: AddrOffset, Offset: int16(d)} - - case arg_label_pm_4_4: - d := int32((x>>8)&(1<<4-1)<<4 | x&(1<<4-1)) - u := (x >> 23) & 1 - if u == 0 { - d = -d - } - return PCRel(d) - - case arg_lsb_width: - lsb := (x >> 7) & (1<<5 - 1) - msb := (x >> 16) & (1<<5 - 1) - if msb < lsb || msb >= 32 { - return nil - } - return Imm(msb + 1 - lsb) - - case arg_mem_R: - Rn := Reg((x >> 16) & (1<<4 - 1)) - return Mem{Base: Rn, Mode: AddrOffset} - - case arg_mem_R_pm_R_postindex: - // Treat [],+/- like [,+/-{,}]{!} - // by forcing shift bits to <<0 and P=0, W=0 (postindex=true). - return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^((1<<7-1)<<5|1<<24|1<<21)) - - case arg_mem_R_pm_R_W: - // Treat [,+/-]{!} like [,+/-{,}]{!} - // by forcing shift bits to <<0. - return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^((1<<7-1)<<5)) - - case arg_mem_R_pm_R_shift_imm_offset: - // Treat [],+/-{,} like [,+/-{,}]{!} - // by forcing P=1, W=0 (index=false, wback=false). - return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^(1<<21)|1<<24) - - case arg_mem_R_pm_R_shift_imm_postindex: - // Treat [],+/-{,} like [,+/-{,}]{!} - // by forcing P=0, W=0 (postindex=true). - return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^(1<<24|1<<21)) - - case arg_mem_R_pm_R_shift_imm_W: - Rn := Reg((x >> 16) & (1<<4 - 1)) - Rm := Reg(x & (1<<4 - 1)) - typ, count := decodeShift(x) - u := (x >> 23) & 1 - w := (x >> 21) & 1 - p := (x >> 24) & 1 - if p == 0 && w == 1 { - return nil - } - sign := int8(+1) - if u == 0 { - sign = -1 - } - mode := AddrMode(uint8(p<<1) | uint8(w^1)) - return Mem{Base: Rn, Mode: mode, Sign: sign, Index: Rm, Shift: typ, Count: count} - - case arg_mem_R_pm_imm12_offset: - // Treat [,#+/-] like [{,#+/-}]{!} - // by forcing P=1, W=0 (index=false, wback=false). - return decodeArg(arg_mem_R_pm_imm12_W, x&^(1<<21)|1<<24) - - case arg_mem_R_pm_imm12_postindex: - // Treat [],#+/- like [{,#+/-}]{!} - // by forcing P=0, W=0 (postindex=true). - return decodeArg(arg_mem_R_pm_imm12_W, x&^(1<<24|1<<21)) - - case arg_mem_R_pm_imm12_W: - Rn := Reg((x >> 16) & (1<<4 - 1)) - u := (x >> 23) & 1 - w := (x >> 21) & 1 - p := (x >> 24) & 1 - if p == 0 && w == 1 { - return nil - } - sign := int8(+1) - if u == 0 { - sign = -1 - } - imm := int16(x & (1<<12 - 1)) - mode := AddrMode(uint8(p<<1) | uint8(w^1)) - return Mem{Base: Rn, Mode: mode, Offset: int16(sign) * imm} - - case arg_mem_R_pm_imm8_postindex: - // Treat [],#+/- like [{,#+/-}]{!} - // by forcing P=0, W=0 (postindex=true). - return decodeArg(arg_mem_R_pm_imm8_W, x&^(1<<24|1<<21)) - - case arg_mem_R_pm_imm8_W: - Rn := Reg((x >> 16) & (1<<4 - 1)) - u := (x >> 23) & 1 - w := (x >> 21) & 1 - p := (x >> 24) & 1 - if p == 0 && w == 1 { - return nil - } - sign := int8(+1) - if u == 0 { - sign = -1 - } - imm := int16((x>>8)&(1<<4-1)<<4 | x&(1<<4-1)) - mode := AddrMode(uint8(p<<1) | uint8(w^1)) - return Mem{Base: Rn, Mode: mode, Offset: int16(sign) * imm} - - case arg_mem_R_pm_imm8at0_offset: - Rn := Reg((x >> 16) & (1<<4 - 1)) - u := (x >> 23) & 1 - sign := int8(+1) - if u == 0 { - sign = -1 - } - imm := int16(x&(1<<8-1)) << 2 - return Mem{Base: Rn, Mode: AddrOffset, Offset: int16(sign) * imm} - - case arg_option: - return Imm(x & (1<<4 - 1)) - - case arg_registers: - return RegList(x & (1<<16 - 1)) - - case arg_registers2: - x &= 1<<16 - 1 - n := 0 - for i := 0; i < 16; i++ { - if x>>uint(i)&1 != 0 { - n++ - } - } - if n < 2 { - return nil - } - return RegList(x) - - case arg_registers1: - Rt := (x >> 12) & (1<<4 - 1) - return RegList(1 << Rt) - - case arg_satimm4: - return Imm((x >> 16) & (1<<4 - 1)) - - case arg_satimm5: - return Imm((x >> 16) & (1<<5 - 1)) - - case arg_satimm4m1: - return Imm((x>>16)&(1<<4-1) + 1) - - case arg_satimm5m1: - return Imm((x>>16)&(1<<5-1) + 1) - - case arg_widthm1: - return Imm((x>>16)&(1<<5-1) + 1) - - } -} - -// decodeShift decodes the shift-by-immediate encoded in x. -func decodeShift(x uint32) (Shift, uint8) { - count := (x >> 7) & (1<<5 - 1) - typ := Shift((x >> 5) & (1<<2 - 1)) - switch typ { - case ShiftRight, ShiftRightSigned: - if count == 0 { - count = 32 - } - case RotateRight: - if count == 0 { - typ = RotateRightExt - count = 1 - } - } - return typ, uint8(count) -} diff --git a/vendor/golang.org/x/arch/arm/armasm/gnu.go b/vendor/golang.org/x/arch/arm/armasm/gnu.go deleted file mode 100644 index 1a97a5a8..00000000 --- a/vendor/golang.org/x/arch/arm/armasm/gnu.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package armasm - -import ( - "bytes" - "fmt" - "strings" -) - -var saveDot = strings.NewReplacer( - ".F16", "_dot_F16", - ".F32", "_dot_F32", - ".F64", "_dot_F64", - ".S32", "_dot_S32", - ".U32", "_dot_U32", - ".FXS", "_dot_S", - ".FXU", "_dot_U", - ".32", "_dot_32", -) - -// GNUSyntax returns the GNU assembler syntax for the instruction, as defined by GNU binutils. -// This form typically matches the syntax defined in the ARM Reference Manual. -func GNUSyntax(inst Inst) string { - var buf bytes.Buffer - op := inst.Op.String() - op = saveDot.Replace(op) - op = strings.Replace(op, ".", "", -1) - op = strings.Replace(op, "_dot_", ".", -1) - op = strings.ToLower(op) - buf.WriteString(op) - sep := " " - for i, arg := range inst.Args { - if arg == nil { - break - } - text := gnuArg(&inst, i, arg) - if text == "" { - continue - } - buf.WriteString(sep) - sep = ", " - buf.WriteString(text) - } - return buf.String() -} - -func gnuArg(inst *Inst, argIndex int, arg Arg) string { - switch inst.Op &^ 15 { - case LDRD_EQ, LDREXD_EQ, STRD_EQ: - if argIndex == 1 { - // second argument in consecutive pair not printed - return "" - } - case STREXD_EQ: - if argIndex == 2 { - // second argument in consecutive pair not printed - return "" - } - } - - switch arg := arg.(type) { - case Imm: - switch inst.Op &^ 15 { - case BKPT_EQ: - return fmt.Sprintf("%#04x", uint32(arg)) - case SVC_EQ: - return fmt.Sprintf("%#08x", uint32(arg)) - } - return fmt.Sprintf("#%d", int32(arg)) - - case ImmAlt: - return fmt.Sprintf("#%d, %d", arg.Val, arg.Rot) - - case Mem: - R := gnuArg(inst, -1, arg.Base) - X := "" - if arg.Sign != 0 { - X = "" - if arg.Sign < 0 { - X = "-" - } - X += gnuArg(inst, -1, arg.Index) - if arg.Shift == ShiftLeft && arg.Count == 0 { - // nothing - } else if arg.Shift == RotateRightExt { - X += ", rrx" - } else { - X += fmt.Sprintf(", %s #%d", strings.ToLower(arg.Shift.String()), arg.Count) - } - } else { - X = fmt.Sprintf("#%d", arg.Offset) - } - - switch arg.Mode { - case AddrOffset: - if X == "#0" { - return fmt.Sprintf("[%s]", R) - } - return fmt.Sprintf("[%s, %s]", R, X) - case AddrPreIndex: - return fmt.Sprintf("[%s, %s]!", R, X) - case AddrPostIndex: - return fmt.Sprintf("[%s], %s", R, X) - case AddrLDM: - if X == "#0" { - return R - } - case AddrLDM_WB: - if X == "#0" { - return R + "!" - } - } - return fmt.Sprintf("[%s Mode(%d) %s]", R, int(arg.Mode), X) - - case PCRel: - return fmt.Sprintf(".%+#x", int32(arg)+4) - - case Reg: - switch inst.Op &^ 15 { - case LDREX_EQ: - if argIndex == 0 { - return fmt.Sprintf("r%d", int32(arg)) - } - } - switch arg { - case R10: - return "sl" - case R11: - return "fp" - case R12: - return "ip" - } - - case RegList: - var buf bytes.Buffer - fmt.Fprintf(&buf, "{") - sep := "" - for i := 0; i < 16; i++ { - if arg&(1<= Op(len(opstr)) || opstr[op] == "" { - return fmt.Sprintf("Op(%d)", int(op)) - } - return opstr[op] -} - -// An Inst is a single instruction. -type Inst struct { - Op Op // Opcode mnemonic - Enc uint32 // Raw encoding bits. - Len int // Length of encoding in bytes. - Args Args // Instruction arguments, in ARM manual order. -} - -func (i Inst) String() string { - var buf bytes.Buffer - buf.WriteString(i.Op.String()) - for j, arg := range i.Args { - if arg == nil { - break - } - if j == 0 { - buf.WriteString(" ") - } else { - buf.WriteString(", ") - } - buf.WriteString(arg.String()) - } - return buf.String() -} - -// An Args holds the instruction arguments. -// If an instruction has fewer than 4 arguments, -// the final elements in the array are nil. -type Args [4]Arg - -// An Arg is a single instruction argument, one of these types: -// Endian, Imm, Mem, PCRel, Reg, RegList, RegShift, RegShiftReg. -type Arg interface { - IsArg() - String() string -} - -type Float32Imm float32 - -func (Float32Imm) IsArg() {} - -func (f Float32Imm) String() string { - return fmt.Sprintf("#%v", float32(f)) -} - -type Float64Imm float32 - -func (Float64Imm) IsArg() {} - -func (f Float64Imm) String() string { - return fmt.Sprintf("#%v", float64(f)) -} - -// An Imm is an integer constant. -type Imm uint32 - -func (Imm) IsArg() {} - -func (i Imm) String() string { - return fmt.Sprintf("#%#x", uint32(i)) -} - -// A ImmAlt is an alternate encoding of an integer constant. -type ImmAlt struct { - Val uint8 - Rot uint8 -} - -func (ImmAlt) IsArg() {} - -func (i ImmAlt) Imm() Imm { - v := uint32(i.Val) - r := uint(i.Rot) - return Imm(v>>r | v<<(32-r)) -} - -func (i ImmAlt) String() string { - return fmt.Sprintf("#%#x, %d", i.Val, i.Rot) -} - -// A Label is a text (code) address. -type Label uint32 - -func (Label) IsArg() {} - -func (i Label) String() string { - return fmt.Sprintf("%#x", uint32(i)) -} - -// A Reg is a single register. -// The zero value denotes R0, not the absence of a register. -type Reg uint8 - -const ( - R0 Reg = iota - R1 - R2 - R3 - R4 - R5 - R6 - R7 - R8 - R9 - R10 - R11 - R12 - R13 - R14 - R15 - - S0 - S1 - S2 - S3 - S4 - S5 - S6 - S7 - S8 - S9 - S10 - S11 - S12 - S13 - S14 - S15 - S16 - S17 - S18 - S19 - S20 - S21 - S22 - S23 - S24 - S25 - S26 - S27 - S28 - S29 - S30 - S31 - - D0 - D1 - D2 - D3 - D4 - D5 - D6 - D7 - D8 - D9 - D10 - D11 - D12 - D13 - D14 - D15 - D16 - D17 - D18 - D19 - D20 - D21 - D22 - D23 - D24 - D25 - D26 - D27 - D28 - D29 - D30 - D31 - - APSR - APSR_nzcv - FPSCR - - SP = R13 - LR = R14 - PC = R15 -) - -func (Reg) IsArg() {} - -func (r Reg) String() string { - switch r { - case APSR: - return "APSR" - case APSR_nzcv: - return "APSR_nzcv" - case FPSCR: - return "FPSCR" - case SP: - return "SP" - case PC: - return "PC" - case LR: - return "LR" - } - if R0 <= r && r <= R15 { - return fmt.Sprintf("R%d", int(r-R0)) - } - if S0 <= r && r <= S31 { - return fmt.Sprintf("S%d", int(r-S0)) - } - if D0 <= r && r <= D31 { - return fmt.Sprintf("D%d", int(r-D0)) - } - return fmt.Sprintf("Reg(%d)", int(r)) -} - -// A RegX represents a fraction of a multi-value register. -// The Index field specifies the index number, -// but the size of the fraction is not specified. -// It must be inferred from the instruction and the register type. -// For example, in a VMOV instruction, RegX{D5, 1} represents -// the top 32 bits of the 64-bit D5 register. -type RegX struct { - Reg Reg - Index int -} - -func (RegX) IsArg() {} - -func (r RegX) String() string { - return fmt.Sprintf("%s[%d]", r.Reg, r.Index) -} - -// A RegList is a register list. -// Bits at indexes x = 0 through 15 indicate whether the corresponding Rx register is in the list. -type RegList uint16 - -func (RegList) IsArg() {} - -func (r RegList) String() string { - var buf bytes.Buffer - fmt.Fprintf(&buf, "{") - sep := "" - for i := 0; i < 16; i++ { - if r&(1< is a lie; the assembler uses @> 0 -// instead of @x> 1, but i wanted to be clear that it -// was a different operation (rotate right extended, not rotate right). -var plan9Shift = []string{"<<", ">>", "->", "@>", "@x>"} - -func plan9Arg(inst *Inst, pc uint64, symname func(uint64) (string, uint64), arg Arg) string { - switch a := arg.(type) { - case Endian: - - case Imm: - return fmt.Sprintf("$%d", int(a)) - - case Mem: - - case PCRel: - addr := uint32(pc) + 8 + uint32(a) - if s, base := symname(uint64(addr)); s != "" && uint64(addr) == base { - return fmt.Sprintf("%s(SB)", s) - } - return fmt.Sprintf("%#x", addr) - - case Reg: - if a < 16 { - return fmt.Sprintf("R%d", int(a)) - } - - case RegList: - var buf bytes.Buffer - start := -2 - end := -2 - fmt.Fprintf(&buf, "[") - flush := func() { - if start >= 0 { - if buf.Len() > 1 { - fmt.Fprintf(&buf, ",") - } - if start == end { - fmt.Fprintf(&buf, "R%d", start) - } else { - fmt.Fprintf(&buf, "R%d-R%d", start, end) - } - start = -2 - end = -2 - } - } - for i := 0; i < 16; i++ { - if a&(1< ,,# cond:4|0|0|1|0|1|0|1|S|Rn:4|Rd:4|imm12:12 - {0x0fe00090, 0x00a00010, 4, ADC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // ADC{S} ,,, cond:4|0|0|0|0|1|0|1|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 - {0x0fe00010, 0x00a00000, 2, ADC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // ADC{S} ,,{,} cond:4|0|0|0|0|1|0|1|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 - {0x0fe00000, 0x02800000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_const}}, // ADD{S} ,,# cond:4|0|0|1|0|1|0|0|S|Rn:4|Rd:4|imm12:12 - {0x0fe00090, 0x00800010, 4, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // ADD{S} ,,, cond:4|0|0|0|0|1|0|0|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 - {0x0fe00010, 0x00800000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // ADD{S} ,,{,} cond:4|0|0|0|0|1|0|0|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 - {0x0fef0000, 0x028d0000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_SP, arg_const}}, // ADD{S} ,SP,# cond:4|0|0|1|0|1|0|0|S|1|1|0|1|Rd:4|imm12:12 - {0x0fef0010, 0x008d0000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_SP, arg_R_shift_imm}}, // ADD{S} ,SP,{,} cond:4|0|0|0|0|1|0|0|S|1|1|0|1|Rd:4|imm5:5|type:2|0|Rm:4 - {0x0fe00000, 0x02000000, 2, AND_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_const}}, // AND{S} ,,# cond:4|0|0|1|0|0|0|0|S|Rn:4|Rd:4|imm12:12 - {0x0fe00090, 0x00000010, 4, AND_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // AND{S} ,,, cond:4|0|0|0|0|0|0|0|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 - {0x0fe00010, 0x00000000, 2, AND_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // AND{S} ,,{,} cond:4|0|0|0|0|0|0|0|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 - {0x0fef0070, 0x01a00040, 4, ASR_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_0, arg_imm5_32}}, // ASR{S} ,,# cond:4|0|0|0|1|1|0|1|S|0|0|0|0|Rd:4|imm5:5|1|0|0|Rm:4 - {0x0fef00f0, 0x01a00050, 4, ASR_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_0, arg_R_8}}, // ASR{S} ,, cond:4|0|0|0|1|1|0|1|S|0|0|0|0|Rd:4|Rm:4|0|1|0|1|Rn:4 - {0x0f000000, 0x0a000000, 4, B_EQ, 0x1c04, instArgs{arg_label24}}, // B cond:4|1|0|1|0|imm24:24 - {0x0fe0007f, 0x07c0001f, 4, BFC_EQ, 0x1c04, instArgs{arg_R_12, arg_imm5, arg_lsb_width}}, // BFC ,#,# cond:4|0|1|1|1|1|1|0|msb:5|Rd:4|lsb:5|0|0|1|1|1|1|1 - {0x0fe00070, 0x07c00010, 2, BFI_EQ, 0x1c04, instArgs{arg_R_12, arg_R_0, arg_imm5, arg_lsb_width}}, // BFI ,,#,# cond:4|0|1|1|1|1|1|0|msb:5|Rd:4|lsb:5|0|0|1|Rn:4 - {0x0fe00000, 0x03c00000, 2, BIC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_const}}, // BIC{S} ,,# cond:4|0|0|1|1|1|1|0|S|Rn:4|Rd:4|imm12:12 - {0x0fe00090, 0x01c00010, 4, BIC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // BIC{S} ,,, cond:4|0|0|0|1|1|1|0|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 - {0x0fe00010, 0x01c00000, 2, BIC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // BIC{S} ,,{,} cond:4|0|0|0|1|1|1|0|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 - {0x0ff000f0, 0x01200070, 4, BKPT_EQ, 0x1c04, instArgs{arg_imm_12at8_4at0}}, // BKPT # cond:4|0|0|0|1|0|0|1|0|imm12:12|0|1|1|1|imm4:4 - {0x0f000000, 0x0b000000, 4, BL_EQ, 0x1c04, instArgs{arg_label24}}, // BL cond:4|1|0|1|1|imm24:24 - {0xfe000000, 0xfa000000, 4, BLX, 0x0, instArgs{arg_label24H}}, // BLX 1|1|1|1|1|0|1|H|imm24:24 - {0x0ffffff0, 0x012fff30, 4, BLX_EQ, 0x1c04, instArgs{arg_R_0}}, // BLX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|1|Rm:4 - {0x0ff000f0, 0x012fff30, 3, BLX_EQ, 0x1c04, instArgs{arg_R_0}}, // BLX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|1|Rm:4 - {0x0ffffff0, 0x012fff10, 4, BX_EQ, 0x1c04, instArgs{arg_R_0}}, // BX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 - {0x0ff000f0, 0x012fff10, 3, BX_EQ, 0x1c04, instArgs{arg_R_0}}, // BX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 - {0x0ffffff0, 0x012fff20, 4, BXJ_EQ, 0x1c04, instArgs{arg_R_0}}, // BXJ cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|0|Rm:4 - {0x0ff000f0, 0x012fff20, 3, BXJ_EQ, 0x1c04, instArgs{arg_R_0}}, // BXJ cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|0|Rm:4 - {0xffffffff, 0xf57ff01f, 4, CLREX, 0x0, instArgs{}}, // CLREX 1|1|1|1|0|1|0|1|0|1|1|1|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(0)|(0)|(0)|(0)|0|0|0|1|(1)|(1)|(1)|(1) - {0xfff000f0, 0xf57ff01f, 3, CLREX, 0x0, instArgs{}}, // CLREX 1|1|1|1|0|1|0|1|0|1|1|1|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(0)|(0)|(0)|(0)|0|0|0|1|(1)|(1)|(1)|(1) - {0x0fff0ff0, 0x016f0f10, 4, CLZ_EQ, 0x1c04, instArgs{arg_R_12, arg_R_0}}, // CLZ , cond:4|0|0|0|1|0|1|1|0|(1)|(1)|(1)|(1)|Rd:4|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 - {0x0ff000f0, 0x016f0f10, 3, CLZ_EQ, 0x1c04, instArgs{arg_R_12, arg_R_0}}, // CLZ , cond:4|0|0|0|1|0|1|1|0|(1)|(1)|(1)|(1)|Rd:4|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 - {0x0ff0f000, 0x03700000, 4, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMN ,# cond:4|0|0|1|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 - {0x0ff00000, 0x03700000, 3, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMN ,# cond:4|0|0|1|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 - {0x0ff0f090, 0x01700010, 4, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMN ,, cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 - {0x0ff00090, 0x01700010, 3, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMN ,, cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 - {0x0ff0f010, 0x01700000, 4, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMN ,{,} cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 - {0x0ff00010, 0x01700000, 3, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMN ,{,} cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 - {0x0ff0f000, 0x03500000, 4, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMP ,# cond:4|0|0|1|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 - {0x0ff00000, 0x03500000, 3, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMP ,# cond:4|0|0|1|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 - {0x0ff0f090, 0x01500010, 4, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMP ,, cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 - {0x0ff00090, 0x01500010, 3, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMP ,, cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 - {0x0ff0f010, 0x01500000, 4, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMP ,{,} cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 - {0x0ff00010, 0x01500000, 3, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMP ,{,} cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 - {0x0ffffff0, 0x0320f0f0, 4, DBG_EQ, 0x1c04, instArgs{arg_option}}, // DBG #


are treated as start tags, except that - // hasSelfClosingToken is set while they are being processed. - hasSelfClosingToken bool - // doc is the document root element. - doc *Node - // The stack of open elements (section 12.2.3.2) and active formatting - // elements (section 12.2.3.3). - oe, afe nodeStack - // Element pointers (section 12.2.3.4). - head, form *Node - // Other parsing state flags (section 12.2.3.5). - scripting, framesetOK bool - // im is the current insertion mode. - im insertionMode - // originalIM is the insertion mode to go back to after completing a text - // or inTableText insertion mode. - originalIM insertionMode - // fosterParenting is whether new elements should be inserted according to - // the foster parenting rules (section 12.2.5.3). - fosterParenting bool - // quirks is whether the parser is operating in "quirks mode." - quirks bool - // fragment is whether the parser is parsing an HTML fragment. - fragment bool - // context is the context element when parsing an HTML fragment - // (section 12.4). - context *Node -} - -func (p *parser) top() *Node { - if n := p.oe.top(); n != nil { - return n - } - return p.doc -} - -// Stop tags for use in popUntil. These come from section 12.2.3.2. -var ( - defaultScopeStopTags = map[string][]a.Atom{ - "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, - "math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext}, - "svg": {a.Desc, a.ForeignObject, a.Title}, - } -) - -type scope int - -const ( - defaultScope scope = iota - listItemScope - buttonScope - tableScope - tableRowScope - tableBodyScope - selectScope -) - -// popUntil pops the stack of open elements at the highest element whose tag -// is in matchTags, provided there is no higher element in the scope's stop -// tags (as defined in section 12.2.3.2). It returns whether or not there was -// such an element. If there was not, popUntil leaves the stack unchanged. -// -// For example, the set of stop tags for table scope is: "html", "table". If -// the stack was: -// ["html", "body", "font", "table", "b", "i", "u"] -// then popUntil(tableScope, "font") would return false, but -// popUntil(tableScope, "i") would return true and the stack would become: -// ["html", "body", "font", "table", "b"] -// -// If an element's tag is in both the stop tags and matchTags, then the stack -// will be popped and the function returns true (provided, of course, there was -// no higher element in the stack that was also in the stop tags). For example, -// popUntil(tableScope, "table") returns true and leaves: -// ["html", "body", "font"] -func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool { - if i := p.indexOfElementInScope(s, matchTags...); i != -1 { - p.oe = p.oe[:i] - return true - } - return false -} - -// indexOfElementInScope returns the index in p.oe of the highest element whose -// tag is in matchTags that is in scope. If no matching element is in scope, it -// returns -1. -func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - if p.oe[i].Namespace == "" { - for _, t := range matchTags { - if t == tagAtom { - return i - } - } - switch s { - case defaultScope: - // No-op. - case listItemScope: - if tagAtom == a.Ol || tagAtom == a.Ul { - return -1 - } - case buttonScope: - if tagAtom == a.Button { - return -1 - } - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { - return -1 - } - case selectScope: - if tagAtom != a.Optgroup && tagAtom != a.Option { - return -1 - } - default: - panic("unreachable") - } - } - switch s { - case defaultScope, listItemScope, buttonScope: - for _, t := range defaultScopeStopTags[p.oe[i].Namespace] { - if t == tagAtom { - return -1 - } - } - } - } - return -1 -} - -// elementInScope is like popUntil, except that it doesn't modify the stack of -// open elements. -func (p *parser) elementInScope(s scope, matchTags ...a.Atom) bool { - return p.indexOfElementInScope(s, matchTags...) != -1 -} - -// clearStackToContext pops elements off the stack of open elements until a -// scope-defined element is found. -func (p *parser) clearStackToContext(s scope) { - for i := len(p.oe) - 1; i >= 0; i-- { - tagAtom := p.oe[i].DataAtom - switch s { - case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { - p.oe = p.oe[:i+1] - return - } - case tableRowScope: - if tagAtom == a.Html || tagAtom == a.Tr { - p.oe = p.oe[:i+1] - return - } - case tableBodyScope: - if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { - p.oe = p.oe[:i+1] - return - } - default: - panic("unreachable") - } - } -} - -// generateImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. -// If exceptions are specified, nodes with that name will not be popped off. -func (p *parser) generateImpliedEndTags(exceptions ...string) { - var i int -loop: - for i = len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if n.Type == ElementNode { - switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: - for _, except := range exceptions { - if n.Data == except { - break loop - } - } - continue - } - } - break - } - - p.oe = p.oe[:i+1] -} - -// addChild adds a child node n to the top element, and pushes n onto the stack -// of open elements if it is an element node. -func (p *parser) addChild(n *Node) { - if p.shouldFosterParent() { - p.fosterParent(n) - } else { - p.top().AppendChild(n) - } - - if n.Type == ElementNode { - p.oe = append(p.oe, n) - } -} - -// shouldFosterParent returns whether the next node to be added should be -// foster parented. -func (p *parser) shouldFosterParent() bool { - if p.fosterParenting { - switch p.top().DataAtom { - case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: - return true - } - } - return false -} - -// fosterParent adds a child node according to the foster parenting rules. -// Section 12.2.5.3, "foster parenting". -func (p *parser) fosterParent(n *Node) { - var table, parent, prev *Node - var i int - for i = len(p.oe) - 1; i >= 0; i-- { - if p.oe[i].DataAtom == a.Table { - table = p.oe[i] - break - } - } - - if table == nil { - // The foster parent is the html element. - parent = p.oe[0] - } else { - parent = table.Parent - } - if parent == nil { - parent = p.oe[i-1] - } - - if table != nil { - prev = table.PrevSibling - } else { - prev = parent.LastChild - } - if prev != nil && prev.Type == TextNode && n.Type == TextNode { - prev.Data += n.Data - return - } - - parent.InsertBefore(n, table) -} - -// addText adds text to the preceding node if it is a text node, or else it -// calls addChild with a new text node. -func (p *parser) addText(text string) { - if text == "" { - return - } - - if p.shouldFosterParent() { - p.fosterParent(&Node{ - Type: TextNode, - Data: text, - }) - return - } - - t := p.top() - if n := t.LastChild; n != nil && n.Type == TextNode { - n.Data += text - return - } - p.addChild(&Node{ - Type: TextNode, - Data: text, - }) -} - -// addElement adds a child element based on the current token. -func (p *parser) addElement() { - p.addChild(&Node{ - Type: ElementNode, - DataAtom: p.tok.DataAtom, - Data: p.tok.Data, - Attr: p.tok.Attr, - }) -} - -// Section 12.2.3.3. -func (p *parser) addFormattingElement() { - tagAtom, attr := p.tok.DataAtom, p.tok.Attr - p.addElement() - - // Implement the Noah's Ark clause, but with three per family instead of two. - identicalElements := 0 -findIdenticalElements: - for i := len(p.afe) - 1; i >= 0; i-- { - n := p.afe[i] - if n.Type == scopeMarkerNode { - break - } - if n.Type != ElementNode { - continue - } - if n.Namespace != "" { - continue - } - if n.DataAtom != tagAtom { - continue - } - if len(n.Attr) != len(attr) { - continue - } - compareAttributes: - for _, t0 := range n.Attr { - for _, t1 := range attr { - if t0.Key == t1.Key && t0.Namespace == t1.Namespace && t0.Val == t1.Val { - // Found a match for this attribute, continue with the next attribute. - continue compareAttributes - } - } - // If we get here, there is no attribute that matches a. - // Therefore the element is not identical to the new one. - continue findIdenticalElements - } - - identicalElements++ - if identicalElements >= 3 { - p.afe.remove(n) - } - } - - p.afe = append(p.afe, p.top()) -} - -// Section 12.2.3.3. -func (p *parser) clearActiveFormattingElements() { - for { - n := p.afe.pop() - if len(p.afe) == 0 || n.Type == scopeMarkerNode { - return - } - } -} - -// Section 12.2.3.3. -func (p *parser) reconstructActiveFormattingElements() { - n := p.afe.top() - if n == nil { - return - } - if n.Type == scopeMarkerNode || p.oe.index(n) != -1 { - return - } - i := len(p.afe) - 1 - for n.Type != scopeMarkerNode && p.oe.index(n) == -1 { - if i == 0 { - i = -1 - break - } - i-- - n = p.afe[i] - } - for { - i++ - clone := p.afe[i].clone() - p.addChild(clone) - p.afe[i] = clone - if i == len(p.afe)-1 { - break - } - } -} - -// Section 12.2.4. -func (p *parser) acknowledgeSelfClosingTag() { - p.hasSelfClosingToken = false -} - -// An insertion mode (section 12.2.3.1) is the state transition function from -// a particular state in the HTML5 parser's state machine. It updates the -// parser's fields depending on parser.tok (where ErrorToken means EOF). -// It returns whether the token was consumed. -type insertionMode func(*parser) bool - -// setOriginalIM sets the insertion mode to return to after completing a text or -// inTableText insertion mode. -// Section 12.2.3.1, "using the rules for". -func (p *parser) setOriginalIM() { - if p.originalIM != nil { - panic("html: bad parser state: originalIM was set twice") - } - p.originalIM = p.im -} - -// Section 12.2.3.1, "reset the insertion mode". -func (p *parser) resetInsertionMode() { - for i := len(p.oe) - 1; i >= 0; i-- { - n := p.oe[i] - if i == 0 && p.context != nil { - n = p.context - } - - switch n.DataAtom { - case a.Select: - p.im = inSelectIM - case a.Td, a.Th: - p.im = inCellIM - case a.Tr: - p.im = inRowIM - case a.Tbody, a.Thead, a.Tfoot: - p.im = inTableBodyIM - case a.Caption: - p.im = inCaptionIM - case a.Colgroup: - p.im = inColumnGroupIM - case a.Table: - p.im = inTableIM - case a.Head: - p.im = inBodyIM - case a.Body: - p.im = inBodyIM - case a.Frameset: - p.im = inFramesetIM - case a.Html: - p.im = beforeHeadIM - default: - continue - } - return - } - p.im = inBodyIM -} - -const whitespace = " \t\r\n\f" - -// Section 12.2.5.4.1. -func initialIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - n, quirks := parseDoctype(p.tok.Data) - p.doc.AppendChild(n) - p.quirks = quirks - p.im = beforeHTMLIM - return true - } - p.quirks = true - p.im = beforeHTMLIM - return false -} - -// Section 12.2.5.4.2. -func beforeHTMLIM(p *parser) bool { - switch p.tok.Type { - case DoctypeToken: - // Ignore the token. - return true - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - if p.tok.DataAtom == a.Html { - p.addElement() - p.im = beforeHeadIM - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.doc.AppendChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - } - p.parseImpliedToken(StartTagToken, a.Html, a.Html.String()) - return false -} - -// Section 12.2.5.4.3. -func beforeHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) - if len(p.tok.Data) == 0 { - // It was all whitespace, so ignore it. - return true - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Head: - p.addElement() - p.head = p.top() - p.im = inHeadIM - return true - case a.Html: - return inBodyIM(p) - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head, a.Body, a.Html, a.Br: - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.5.4.4. -func inHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta: - p.addElement() - p.oe.pop() - p.acknowledgeSelfClosingTag() - return true - case a.Script, a.Title, a.Noscript, a.Noframes, a.Style: - p.addElement() - p.setOriginalIM() - p.im = textIM - return true - case a.Head: - // Ignore the token. - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Head: - n := p.oe.pop() - if n.DataAtom != a.Head { - panic("html: bad parser state: element not found, in the in-head insertion mode") - } - p.im = afterHeadIM - return true - case a.Body, a.Html, a.Br: - p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) - return false - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) - return false -} - -// Section 12.2.5.4.6. -func afterHeadIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - s := strings.TrimLeft(p.tok.Data, whitespace) - if len(s) < len(p.tok.Data) { - // Add the initial whitespace to the current node. - p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) - if s == "" { - return true - } - p.tok.Data = s - } - case StartTagToken: - switch p.tok.DataAtom { - case a.Html: - return inBodyIM(p) - case a.Body: - p.addElement() - p.framesetOK = false - p.im = inBodyIM - return true - case a.Frameset: - p.addElement() - p.im = inFramesetIM - return true - case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: - p.oe = append(p.oe, p.head) - defer p.oe.remove(p.head) - return inHeadIM(p) - case a.Head: - // Ignore the token. - return true - } - case EndTagToken: - switch p.tok.DataAtom { - case a.Body, a.Html, a.Br: - // Drop down to creating an implied tag. - default: - // Ignore the token. - return true - } - case CommentToken: - p.addChild(&Node{ - Type: CommentNode, - Data: p.tok.Data, - }) - return true - case DoctypeToken: - // Ignore the token. - return true - } - - p.parseImpliedToken(StartTagToken, a.Body, a.Body.String()) - p.framesetOK = true - return false -} - -// copyAttributes copies attributes of src not found on dst to dst. -func copyAttributes(dst *Node, src Token) { - if len(src.Attr) == 0 { - return - } - attr := map[string]string{} - for _, t := range dst.Attr { - attr[t.Key] = t.Val - } - for _, t := range src.Attr { - if _, ok := attr[t.Key]; !ok { - dst.Attr = append(dst.Attr, t) - attr[t.Key] = t.Val - } - } -} - -// Section 12.2.5.4.7. -func inBodyIM(p *parser) bool { - switch p.tok.Type { - case TextToken: - d := p.tok.Data - switch n := p.oe.top(); n.DataAtom { - case a.Pre, a.Listing: - if n.FirstChild == nil { - // Ignore a newline at the start of a
 block.
-				if d != "" && d[0] == '\r' {
-					d = d[1:]
-				}
-				if d != "" && d[0] == '\n' {
-					d = d[1:]
-				}
-			}
-		}
-		d = strings.Replace(d, "\x00", "", -1)
-		if d == "" {
-			return true
-		}
-		p.reconstructActiveFormattingElements()
-		p.addText(d)
-		if p.framesetOK && strings.TrimLeft(d, whitespace) != "" {
-			// There were non-whitespace characters inserted.
-			p.framesetOK = false
-		}
-	case StartTagToken:
-		switch p.tok.DataAtom {
-		case a.Html:
-			copyAttributes(p.oe[0], p.tok)
-		case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title:
-			return inHeadIM(p)
-		case a.Body:
-			if len(p.oe) >= 2 {
-				body := p.oe[1]
-				if body.Type == ElementNode && body.DataAtom == a.Body {
-					p.framesetOK = false
-					copyAttributes(body, p.tok)
-				}
-			}
-		case a.Frameset:
-			if !p.framesetOK || len(p.oe) < 2 || p.oe[1].DataAtom != a.Body {
-				// Ignore the token.
-				return true
-			}
-			body := p.oe[1]
-			if body.Parent != nil {
-				body.Parent.RemoveChild(body)
-			}
-			p.oe = p.oe[:1]
-			p.addElement()
-			p.im = inFramesetIM
-			return true
-		case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
-			p.popUntil(buttonScope, a.P)
-			switch n := p.top(); n.DataAtom {
-			case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
-				p.oe.pop()
-			}
-			p.addElement()
-		case a.Pre, a.Listing:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-			// The newline, if any, will be dealt with by the TextToken case.
-			p.framesetOK = false
-		case a.Form:
-			if p.form == nil {
-				p.popUntil(buttonScope, a.P)
-				p.addElement()
-				p.form = p.top()
-			}
-		case a.Li:
-			p.framesetOK = false
-			for i := len(p.oe) - 1; i >= 0; i-- {
-				node := p.oe[i]
-				switch node.DataAtom {
-				case a.Li:
-					p.oe = p.oe[:i]
-				case a.Address, a.Div, a.P:
-					continue
-				default:
-					if !isSpecialElement(node) {
-						continue
-					}
-				}
-				break
-			}
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.Dd, a.Dt:
-			p.framesetOK = false
-			for i := len(p.oe) - 1; i >= 0; i-- {
-				node := p.oe[i]
-				switch node.DataAtom {
-				case a.Dd, a.Dt:
-					p.oe = p.oe[:i]
-				case a.Address, a.Div, a.P:
-					continue
-				default:
-					if !isSpecialElement(node) {
-						continue
-					}
-				}
-				break
-			}
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.Plaintext:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-		case a.Button:
-			p.popUntil(defaultScope, a.Button)
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.framesetOK = false
-		case a.A:
-			for i := len(p.afe) - 1; i >= 0 && p.afe[i].Type != scopeMarkerNode; i-- {
-				if n := p.afe[i]; n.Type == ElementNode && n.DataAtom == a.A {
-					p.inBodyEndTagFormatting(a.A)
-					p.oe.remove(n)
-					p.afe.remove(n)
-					break
-				}
-			}
-			p.reconstructActiveFormattingElements()
-			p.addFormattingElement()
-		case a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
-			p.reconstructActiveFormattingElements()
-			p.addFormattingElement()
-		case a.Nobr:
-			p.reconstructActiveFormattingElements()
-			if p.elementInScope(defaultScope, a.Nobr) {
-				p.inBodyEndTagFormatting(a.Nobr)
-				p.reconstructActiveFormattingElements()
-			}
-			p.addFormattingElement()
-		case a.Applet, a.Marquee, a.Object:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.afe = append(p.afe, &scopeMarker)
-			p.framesetOK = false
-		case a.Table:
-			if !p.quirks {
-				p.popUntil(buttonScope, a.P)
-			}
-			p.addElement()
-			p.framesetOK = false
-			p.im = inTableIM
-			return true
-		case a.Area, a.Br, a.Embed, a.Img, a.Input, a.Keygen, a.Wbr:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.oe.pop()
-			p.acknowledgeSelfClosingTag()
-			if p.tok.DataAtom == a.Input {
-				for _, t := range p.tok.Attr {
-					if t.Key == "type" {
-						if strings.ToLower(t.Val) == "hidden" {
-							// Skip setting framesetOK = false
-							return true
-						}
-					}
-				}
-			}
-			p.framesetOK = false
-		case a.Param, a.Source, a.Track:
-			p.addElement()
-			p.oe.pop()
-			p.acknowledgeSelfClosingTag()
-		case a.Hr:
-			p.popUntil(buttonScope, a.P)
-			p.addElement()
-			p.oe.pop()
-			p.acknowledgeSelfClosingTag()
-			p.framesetOK = false
-		case a.Image:
-			p.tok.DataAtom = a.Img
-			p.tok.Data = a.Img.String()
-			return false
-		case a.Isindex:
-			if p.form != nil {
-				// Ignore the token.
-				return true
-			}
-			action := ""
-			prompt := "This is a searchable index. Enter search keywords: "
-			attr := []Attribute{{Key: "name", Val: "isindex"}}
-			for _, t := range p.tok.Attr {
-				switch t.Key {
-				case "action":
-					action = t.Val
-				case "name":
-					// Ignore the attribute.
-				case "prompt":
-					prompt = t.Val
-				default:
-					attr = append(attr, t)
-				}
-			}
-			p.acknowledgeSelfClosingTag()
-			p.popUntil(buttonScope, a.P)
-			p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
-			if action != "" {
-				p.form.Attr = []Attribute{{Key: "action", Val: action}}
-			}
-			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
-			p.parseImpliedToken(StartTagToken, a.Label, a.Label.String())
-			p.addText(prompt)
-			p.addChild(&Node{
-				Type:     ElementNode,
-				DataAtom: a.Input,
-				Data:     a.Input.String(),
-				Attr:     attr,
-			})
-			p.oe.pop()
-			p.parseImpliedToken(EndTagToken, a.Label, a.Label.String())
-			p.parseImpliedToken(StartTagToken, a.Hr, a.Hr.String())
-			p.parseImpliedToken(EndTagToken, a.Form, a.Form.String())
-		case a.Textarea:
-			p.addElement()
-			p.setOriginalIM()
-			p.framesetOK = false
-			p.im = textIM
-		case a.Xmp:
-			p.popUntil(buttonScope, a.P)
-			p.reconstructActiveFormattingElements()
-			p.framesetOK = false
-			p.addElement()
-			p.setOriginalIM()
-			p.im = textIM
-		case a.Iframe:
-			p.framesetOK = false
-			p.addElement()
-			p.setOriginalIM()
-			p.im = textIM
-		case a.Noembed, a.Noscript:
-			p.addElement()
-			p.setOriginalIM()
-			p.im = textIM
-		case a.Select:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-			p.framesetOK = false
-			p.im = inSelectIM
-			return true
-		case a.Optgroup, a.Option:
-			if p.top().DataAtom == a.Option {
-				p.oe.pop()
-			}
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-		case a.Rp, a.Rt:
-			if p.elementInScope(defaultScope, a.Ruby) {
-				p.generateImpliedEndTags()
-			}
-			p.addElement()
-		case a.Math, a.Svg:
-			p.reconstructActiveFormattingElements()
-			if p.tok.DataAtom == a.Math {
-				adjustAttributeNames(p.tok.Attr, mathMLAttributeAdjustments)
-			} else {
-				adjustAttributeNames(p.tok.Attr, svgAttributeAdjustments)
-			}
-			adjustForeignAttributes(p.tok.Attr)
-			p.addElement()
-			p.top().Namespace = p.tok.Data
-			if p.hasSelfClosingToken {
-				p.oe.pop()
-				p.acknowledgeSelfClosingTag()
-			}
-			return true
-		case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr:
-			// Ignore the token.
-		default:
-			p.reconstructActiveFormattingElements()
-			p.addElement()
-		}
-	case EndTagToken:
-		switch p.tok.DataAtom {
-		case a.Body:
-			if p.elementInScope(defaultScope, a.Body) {
-				p.im = afterBodyIM
-			}
-		case a.Html:
-			if p.elementInScope(defaultScope, a.Body) {
-				p.parseImpliedToken(EndTagToken, a.Body, a.Body.String())
-				return false
-			}
-			return true
-		case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
-			p.popUntil(defaultScope, p.tok.DataAtom)
-		case a.Form:
-			node := p.form
-			p.form = nil
-			i := p.indexOfElementInScope(defaultScope, a.Form)
-			if node == nil || i == -1 || p.oe[i] != node {
-				// Ignore the token.
-				return true
-			}
-			p.generateImpliedEndTags()
-			p.oe.remove(node)
-		case a.P:
-			if !p.elementInScope(buttonScope, a.P) {
-				p.parseImpliedToken(StartTagToken, a.P, a.P.String())
-			}
-			p.popUntil(buttonScope, a.P)
-		case a.Li:
-			p.popUntil(listItemScope, a.Li)
-		case a.Dd, a.Dt:
-			p.popUntil(defaultScope, p.tok.DataAtom)
-		case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
-			p.popUntil(defaultScope, a.H1, a.H2, a.H3, a.H4, a.H5, a.H6)
-		case a.A, a.B, a.Big, a.Code, a.Em, a.Font, a.I, a.Nobr, a.S, a.Small, a.Strike, a.Strong, a.Tt, a.U:
-			p.inBodyEndTagFormatting(p.tok.DataAtom)
-		case a.Applet, a.Marquee, a.Object:
-			if p.popUntil(defaultScope, p.tok.DataAtom) {
-				p.clearActiveFormattingElements()
-			}
-		case a.Br:
-			p.tok.Type = StartTagToken
-			return false
-		default:
-			p.inBodyEndTagOther(p.tok.DataAtom)
-		}
-	case CommentToken:
-		p.addChild(&Node{
-			Type: CommentNode,
-			Data: p.tok.Data,
-		})
-	}
-
-	return true
-}
-
-func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
-	// This is the "adoption agency" algorithm, described at
-	// https://html.spec.whatwg.org/multipage/syntax.html#adoptionAgency
-
-	// TODO: this is a fairly literal line-by-line translation of that algorithm.
-	// Once the code successfully parses the comprehensive test suite, we should
-	// refactor this code to be more idiomatic.
-
-	// Steps 1-4. The outer loop.
-	for i := 0; i < 8; i++ {
-		// Step 5. Find the formatting element.
-		var formattingElement *Node
-		for j := len(p.afe) - 1; j >= 0; j-- {
-			if p.afe[j].Type == scopeMarkerNode {
-				break
-			}
-			if p.afe[j].DataAtom == tagAtom {
-				formattingElement = p.afe[j]
-				break
-			}
-		}
-		if formattingElement == nil {
-			p.inBodyEndTagOther(tagAtom)
-			return
-		}
-		feIndex := p.oe.index(formattingElement)
-		if feIndex == -1 {
-			p.afe.remove(formattingElement)
-			return
-		}
-		if !p.elementInScope(defaultScope, tagAtom) {
-			// Ignore the tag.
-			return
-		}
-
-		// Steps 9-10. Find the furthest block.
-		var furthestBlock *Node
-		for _, e := range p.oe[feIndex:] {
-			if isSpecialElement(e) {
-				furthestBlock = e
-				break
-			}
-		}
-		if furthestBlock == nil {
-			e := p.oe.pop()
-			for e != formattingElement {
-				e = p.oe.pop()
-			}
-			p.afe.remove(e)
-			return
-		}
-
-		// Steps 11-12. Find the common ancestor and bookmark node.
-		commonAncestor := p.oe[feIndex-1]
-		bookmark := p.afe.index(formattingElement)
-
-		// Step 13. The inner loop. Find the lastNode to reparent.
-		lastNode := furthestBlock
-		node := furthestBlock
-		x := p.oe.index(node)
-		// Steps 13.1-13.2
-		for j := 0; j < 3; j++ {
-			// Step 13.3.
-			x--
-			node = p.oe[x]
-			// Step 13.4 - 13.5.
-			if p.afe.index(node) == -1 {
-				p.oe.remove(node)
-				continue
-			}
-			// Step 13.6.
-			if node == formattingElement {
-				break
-			}
-			// Step 13.7.
-			clone := node.clone()
-			p.afe[p.afe.index(node)] = clone
-			p.oe[p.oe.index(node)] = clone
-			node = clone
-			// Step 13.8.
-			if lastNode == furthestBlock {
-				bookmark = p.afe.index(node) + 1
-			}
-			// Step 13.9.
-			if lastNode.Parent != nil {
-				lastNode.Parent.RemoveChild(lastNode)
-			}
-			node.AppendChild(lastNode)
-			// Step 13.10.
-			lastNode = node
-		}
-
-		// Step 14. Reparent lastNode to the common ancestor,
-		// or for misnested table nodes, to the foster parent.
-		if lastNode.Parent != nil {
-			lastNode.Parent.RemoveChild(lastNode)
-		}
-		switch commonAncestor.DataAtom {
-		case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr:
-			p.fosterParent(lastNode)
-		default:
-			commonAncestor.AppendChild(lastNode)
-		}
-
-		// Steps 15-17. Reparent nodes from the furthest block's children
-		// to a clone of the formatting element.
-		clone := formattingElement.clone()
-		reparentChildren(clone, furthestBlock)
-		furthestBlock.AppendChild(clone)
-
-		// Step 18. Fix up the list of active formatting elements.
-		if oldLoc := p.afe.index(formattingElement); oldLoc != -1 && oldLoc < bookmark {
-			// Move the bookmark with the rest of the list.
-			bookmark--
-		}
-		p.afe.remove(formattingElement)
-		p.afe.insert(bookmark, clone)
-
-		// Step 19. Fix up the stack of open elements.
-		p.oe.remove(formattingElement)
-		p.oe.insert(p.oe.index(furthestBlock)+1, clone)
-	}
-}
-
-// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
-// "Any other end tag" handling from 12.2.5.5 The rules for parsing tokens in foreign content
-// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
-func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
-	for i := len(p.oe) - 1; i >= 0; i-- {
-		if p.oe[i].DataAtom == tagAtom {
-			p.oe = p.oe[:i]
-			break
-		}
-		if isSpecialElement(p.oe[i]) {
-			break
-		}
-	}
-}
-
-// Section 12.2.5.4.8.
-func textIM(p *parser) bool {
-	switch p.tok.Type {
-	case ErrorToken:
-		p.oe.pop()
-	case TextToken:
-		d := p.tok.Data
-		if n := p.oe.top(); n.DataAtom == a.Textarea && n.FirstChild == nil {
-			// Ignore a newline at the start of a